From: Andrea Amorese Date: Fri, 8 Oct 2021 13:06:34 +0000 (+0200) Subject: Built motion from commit 0d7cdd56.|2.5.36 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=47536dd0a17207dd75d42885cfb09f9b9cee4ed2;p=motion2.git Built motion from commit 0d7cdd56.|2.5.36 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ae38788..839ceb3 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-08T09:16:04.527Z", + "time": "2021-10-08T12:53:04.799Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 54ce375..a43254d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-08T09:16:04.527Z", + "time": "2021-10-08T12:53:04.799Z", "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 eb21530..6ba9d5c 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 _0x3411=['script','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','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x5eb307,_0x580bef){var _0x5c5862=function(_0x311b41){while(--_0x311b41){_0x5eb307['push'](_0x5eb307['shift']());}};_0x5c5862(++_0x580bef);}(_0x3411,0x1c7));var _0x1341=function(_0x1a3429,_0x2ef9cf){_0x1a3429=_0x1a3429-0x0;var _0xf1981d=_0x3411[_0x1a3429];return _0xf1981d;};'use strict';var Sequelize=require(_0x1341('0x0'));module[_0x1341('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5ea50b){return this[_0x1341('0x2')](_0x1341('0x3'));}},'action':{'type':Sequelize[_0x1341('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1341('0x5'),_0x1341('0x6'),_0x1341('0x7'),_0x1341('0x8'),'urlForward','browser','bot',_0x1341('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xa')},'data2':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xb')},'data3':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xc')},'data4':{'type':Sequelize[_0x1341('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x1341('0xd')},'data6':{'type':Sequelize[_0x1341('0x4')],'comments':_0x1341('0xe')},'data7':{'type':Sequelize[_0x1341('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xeb73=['urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x3fe05c,_0x325126){var _0x166aac=function(_0x35ef44){while(--_0x35ef44){_0x3fe05c['push'](_0x3fe05c['shift']());}};_0x166aac(++_0x325126);}(_0xeb73,0x131));var _0x3eb7=function(_0x46012c,_0x66bacf){_0x46012c=_0x46012c-0x0;var _0x26d30f=_0xeb73[_0x46012c];return _0x26d30f;};'use strict';var Sequelize=require(_0x3eb7('0x0'));module[_0x3eb7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x22dc6c){return this[_0x3eb7('0x2')](_0x3eb7('0x3'));}},'action':{'type':Sequelize[_0x3eb7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3eb7('0x5'),_0x3eb7('0x6'),_0x3eb7('0x7'),_0x3eb7('0x8'),_0x3eb7('0x9'),_0x3eb7('0xa'),'bot',_0x3eb7('0xb')]],'msg':_0x3eb7('0xc')}},'comment':_0x3eb7('0xc')},'data1':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xd')},'data3':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xe')},'data4':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comments':_0x3eb7('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3eb7('0x4')],'comments':_0x3eb7('0x10')},'data7':{'type':Sequelize[_0x3eb7('0x11')],'comments':_0x3eb7('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index abed405..786af8e 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 _0xec9b=['params','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','status','apply','reject','update','then','destroy','error','stack','name','send','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec9b,0xa6));var _0xbec9=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0xec9b[_0x54da5b];return _0x285d3b;};'use strict';var emlformat=require(_0xbec9('0x0'));var rimraf=require(_0xbec9('0x1'));var zipdir=require(_0xbec9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec9('0x3'));var moment=require('moment');var BPromise=require(_0xbec9('0x4'));var Mustache=require('mustache');var util=require(_0xbec9('0x5'));var path=require('path');var sox=require(_0xbec9('0x6'));var csv=require(_0xbec9('0x7'));var ejs=require(_0xbec9('0x8'));var fs=require('fs');var fs_extra=require(_0xbec9('0x9'));var _=require(_0xbec9('0xa'));var squel=require(_0xbec9('0xb'));var crypto=require(_0xbec9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbec9('0xd'));var toCsv=require(_0xbec9('0x7'));var querystring=require(_0xbec9('0xe'));var Papa=require('papaparse');var Redis=require(_0xbec9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbec9('0x10'));var as=require(_0xbec9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbec9('0x12'))('api');var utils=require(_0xbec9('0x13'));var config=require(_0xbec9('0x14'));var licenseUtil=require(_0xbec9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55cf0b,_0x87cb61){_0x87cb61=_0x87cb61||0xcc;return function(_0x335d89){if(_0x335d89){return _0x55cf0b[_0xbec9('0x16')](_0x87cb61);}return _0x55cf0b['status'](_0x87cb61)[_0xbec9('0x17')]();};}function respondWithResult(_0x5d3bb7,_0xf3c927){_0xf3c927=_0xf3c927||0xc8;return function(_0x10ba6e){if(_0x10ba6e){return _0x5d3bb7['status'](_0xf3c927)[_0xbec9('0x18')](_0x10ba6e);}};}function respondWithFilteredResult(_0x29aeaf,_0x3b9627){return function(_0xced470){if(_0xced470){var _0x8f9b5e=typeof _0x3b9627[_0xbec9('0x19')]==='undefined'&&typeof _0x3b9627['limit']===_0xbec9('0x1a');var _0x56b291=_0xced470['count'];var _0x21fe5c=_0x8f9b5e?0x0:_0x3b9627[_0xbec9('0x19')];var _0x13a982=_0x8f9b5e?_0xced470['count']:_0x3b9627[_0xbec9('0x19')]+_0x3b9627[_0xbec9('0x1b')];var _0x17ccda;if(_0x13a982>=_0x56b291){_0x13a982=_0x56b291;_0x17ccda=0xc8;}else{_0x17ccda=0xce;}_0x29aeaf[_0xbec9('0x1c')](_0x17ccda);return _0x29aeaf['set']('Content-Range',_0x21fe5c+'-'+_0x13a982+'/'+_0x56b291)[_0xbec9('0x18')](_0xced470);}return null;};}function patchUpdates(_0x41fd58){return function(_0x59f045){try{jsonpatch[_0xbec9('0x1d')](_0x59f045,_0x41fd58,!![]);}catch(_0x6e9259){return BPromise[_0xbec9('0x1e')](_0x6e9259);}return _0x59f045['save']();};}function saveUpdates(_0x35c2fe,_0x44dbeb){return function(_0x422cec){if(_0x422cec){return _0x422cec[_0xbec9('0x1f')](_0x35c2fe)[_0xbec9('0x20')](function(_0x5b8e14){return _0x5b8e14;});}return null;};}function removeEntity(_0x3c6923,_0x984064){return function(_0x10583a){if(_0x10583a){return _0x10583a[_0xbec9('0x21')]()[_0xbec9('0x20')](function(){_0x3c6923[_0xbec9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e2ef,_0x2a33bf){return function(_0x2c1780){if(!_0x2c1780){_0x22e2ef['sendStatus'](0x194);}return _0x2c1780;};}function handleError(_0x21d2bf,_0x36ce62){_0x36ce62=_0x36ce62||0x1f4;return function(_0x43ec8c){logger[_0xbec9('0x22')](_0x43ec8c[_0xbec9('0x23')]);if(_0x43ec8c[_0xbec9('0x24')]){delete _0x43ec8c['name'];}_0x21d2bf[_0xbec9('0x1c')](_0x36ce62)[_0xbec9('0x25')](_0x43ec8c);};}exports[_0xbec9('0x1f')]=function(_0x4c4fee,_0x5c65de){if(_0x4c4fee[_0xbec9('0x26')]['id']){delete _0x4c4fee[_0xbec9('0x26')]['id'];}return db['Action']['find']({'where':{'id':_0x4c4fee[_0xbec9('0x27')]['id']}})[_0xbec9('0x20')](handleEntityNotFound(_0x5c65de,null))['then'](saveUpdates(_0x4c4fee[_0xbec9('0x26')],null))['then'](respondWithResult(_0x5c65de,null))[_0xbec9('0x28')](handleError(_0x5c65de,null));};exports[_0xbec9('0x21')]=function(_0x1b40fe,_0x3eb2c0){return db['Action']['find']({'where':{'id':_0x1b40fe[_0xbec9('0x27')]['id']}})[_0xbec9('0x20')](handleEntityNotFound(_0x3eb2c0,null))[_0xbec9('0x20')](removeEntity(_0x3eb2c0,null))[_0xbec9('0x28')](handleError(_0x3eb2c0,null));}; \ No newline at end of file +var _0x0b74=['path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','mustache','util'];(function(_0x1517b6,_0x172069){var _0xb9d140=function(_0x41da44){while(--_0x41da44){_0x1517b6['push'](_0x1517b6['shift']());}};_0xb9d140(++_0x172069);}(_0x0b74,0x1da));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x40b7('0x0'));var rimraf=require(_0x40b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40b7('0x2'));var rp=require(_0x40b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40b7('0x4'));var util=require(_0x40b7('0x5'));var path=require(_0x40b7('0x6'));var sox=require(_0x40b7('0x7'));var csv=require('to-csv');var ejs=require(_0x40b7('0x8'));var fs=require('fs');var fs_extra=require(_0x40b7('0x9'));var _=require(_0x40b7('0xa'));var squel=require('squel');var crypto=require(_0x40b7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40b7('0xc'));var toCsv=require(_0x40b7('0xd'));var querystring=require(_0x40b7('0xe'));var Papa=require(_0x40b7('0xf'));var Redis=require(_0x40b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40b7('0x11'));var as=require(_0x40b7('0x12'));var hardwareService=require(_0x40b7('0x13'));var logger=require(_0x40b7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x40b7('0x15'));var licenseUtil=require(_0x40b7('0x16'));var db=require(_0x40b7('0x17'))['db'];function respondWithStatusCode(_0x562f60,_0x5ab69c){_0x5ab69c=_0x5ab69c||0xcc;return function(_0x8184ca){if(_0x8184ca){return _0x562f60[_0x40b7('0x18')](_0x5ab69c);}return _0x562f60['status'](_0x5ab69c)[_0x40b7('0x19')]();};}function respondWithResult(_0x2a2df9,_0x17c582){_0x17c582=_0x17c582||0xc8;return function(_0x514229){if(_0x514229){return _0x2a2df9[_0x40b7('0x1a')](_0x17c582)[_0x40b7('0x1b')](_0x514229);}};}function respondWithFilteredResult(_0x253199,_0x4c31d0){return function(_0x1fa69e){if(_0x1fa69e){var _0x429c17=typeof _0x4c31d0[_0x40b7('0x1c')]===_0x40b7('0x1d')&&typeof _0x4c31d0[_0x40b7('0x1e')]==='undefined';var _0x40f6cb=_0x1fa69e[_0x40b7('0x1f')];var _0xb9eb8b=_0x429c17?0x0:_0x4c31d0[_0x40b7('0x1c')];var _0x50507f=_0x429c17?_0x1fa69e['count']:_0x4c31d0[_0x40b7('0x1c')]+_0x4c31d0[_0x40b7('0x1e')];var _0x409ce3;if(_0x50507f>=_0x40f6cb){_0x50507f=_0x40f6cb;_0x409ce3=0xc8;}else{_0x409ce3=0xce;}_0x253199[_0x40b7('0x1a')](_0x409ce3);return _0x253199['set'](_0x40b7('0x20'),_0xb9eb8b+'-'+_0x50507f+'/'+_0x40f6cb)['json'](_0x1fa69e);}return null;};}function patchUpdates(_0x226ab7){return function(_0x3ae0b9){try{jsonpatch[_0x40b7('0x21')](_0x3ae0b9,_0x226ab7,!![]);}catch(_0x21c51e){return BPromise[_0x40b7('0x22')](_0x21c51e);}return _0x3ae0b9[_0x40b7('0x23')]();};}function saveUpdates(_0x343a09,_0x5e9711){return function(_0x3a77ab){if(_0x3a77ab){return _0x3a77ab[_0x40b7('0x24')](_0x343a09)[_0x40b7('0x25')](function(_0x41e114){return _0x41e114;});}return null;};}function removeEntity(_0x1be214,_0x15814a){return function(_0x3c58b1){if(_0x3c58b1){return _0x3c58b1[_0x40b7('0x26')]()[_0x40b7('0x25')](function(){_0x1be214['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x508231,_0x4da132){return function(_0x227ae3){if(!_0x227ae3){_0x508231[_0x40b7('0x18')](0x194);}return _0x227ae3;};}function handleError(_0x5b7b1a,_0xa7e845){_0xa7e845=_0xa7e845||0x1f4;return function(_0xdb5b10){logger[_0x40b7('0x27')](_0xdb5b10[_0x40b7('0x28')]);if(_0xdb5b10[_0x40b7('0x29')]){delete _0xdb5b10['name'];}_0x5b7b1a['status'](_0xa7e845)[_0x40b7('0x2a')](_0xdb5b10);};}exports[_0x40b7('0x24')]=function(_0x4e146b,_0x2a0dbe){if(_0x4e146b[_0x40b7('0x2b')]['id']){delete _0x4e146b['body']['id'];}return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x4e146b[_0x40b7('0x2e')]['id']}})[_0x40b7('0x25')](handleEntityNotFound(_0x2a0dbe,null))[_0x40b7('0x25')](saveUpdates(_0x4e146b[_0x40b7('0x2b')],null))['then'](respondWithResult(_0x2a0dbe,null))[_0x40b7('0x2f')](handleError(_0x2a0dbe,null));};exports[_0x40b7('0x26')]=function(_0x3966ea,_0x3a7f48){return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x3966ea[_0x40b7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3a7f48,null))['then'](removeEntity(_0x3a7f48,null))[_0x40b7('0x2f')](handleError(_0x3a7f48,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 4a3c3fa..043379c 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 _0x3aa7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x152350,_0x3b0fe2){var _0x23a26b=function(_0x5148ca){while(--_0x5148ca){_0x152350['push'](_0x152350['shift']());}};_0x23a26b(++_0x3b0fe2);}(_0x3aa7,0x18d));var _0x73aa=function(_0x2af6e0,_0x4ceb6f){_0x2af6e0=_0x2af6e0-0x0;var _0x31938d=_0x3aa7[_0x2af6e0];return _0x31938d;};'use strict';var _=require(_0x73aa('0x0'));var util=require(_0x73aa('0x1'));var logger=require(_0x73aa('0x2'))('api');var moment=require('moment');var BPromise=require(_0x73aa('0x3'));var rp=require(_0x73aa('0x4'));var fs=require('fs');var path=require(_0x73aa('0x5'));var rimraf=require(_0x73aa('0x6'));var config=require(_0x73aa('0x7'));var attributes=require('./action.attributes');module[_0x73aa('0x8')]=function(_0x766401,_0x3d53c0){return _0x766401[_0x73aa('0x9')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf61c=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','util','../../config/logger','api','moment','bluebird'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0xf61c,0x1c3));var _0xcf61=function(_0x28a9aa,_0x3f054f){_0x28a9aa=_0x28a9aa-0x0;var _0x532458=_0xf61c[_0x28a9aa];return _0x532458;};'use strict';var _=require('lodash');var util=require(_0xcf61('0x0'));var logger=require(_0xcf61('0x1'))(_0xcf61('0x2'));var moment=require(_0xcf61('0x3'));var BPromise=require(_0xcf61('0x4'));var rp=require(_0xcf61('0x5'));var fs=require('fs');var path=require(_0xcf61('0x6'));var rimraf=require(_0xcf61('0x7'));var config=require(_0xcf61('0x8'));var attributes=require(_0xcf61('0x9'));module[_0xcf61('0xa')]=function(_0x7764ec,_0x2f9b93){return _0x7764ec['define'](_0xcf61('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index b71b552..ee94b72 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea60d,_0x36cd19){_0x4ea60d=_0x4ea60d-0x0;var _0x4130fe=_0x7a54[_0x4ea60d];return _0x4130fe;};'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')]('Action,\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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10ecd6,_0x26d87b){var _0x516301=function(_0x51c59a){while(--_0x51c59a){_0x10ecd6['push'](_0x10ecd6['shift']());}};_0x516301(++_0x26d87b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x7fbe[_0xd29c88];return _0x375635;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 637b5b3..f36cf29 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 _0x2308=['express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path'];(function(_0x1ab91c,_0x14e58d){var _0x327b58=function(_0x19c481){while(--_0x19c481){_0x1ab91c['push'](_0x1ab91c['shift']());}};_0x327b58(++_0x14e58d);}(_0x2308,0x1b8));var _0x8230=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x2308[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x8230('0x0'));var util=require('util');var path=require(_0x8230('0x1'));var timeout=require('connect-timeout');var express=require(_0x8230('0x2'));var router=express[_0x8230('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8230('0x4'));var config=require(_0x8230('0x5'));var controller=require('./action.controller');router[_0x8230('0x6')](_0x8230('0x7'),auth[_0x8230('0x8')](),controller[_0x8230('0x9')]);router[_0x8230('0xa')](_0x8230('0x7'),auth[_0x8230('0x8')](),controller[_0x8230('0xb')]);module[_0x8230('0xc')]=router; \ No newline at end of file +var _0xe3cb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3cb,0x1cb));var _0xbe3c=function(_0x22783e,_0x591a8e){_0x22783e=_0x22783e-0x0;var _0x40887a=_0xe3cb[_0x22783e];return _0x40887a;};'use strict';var multer=require(_0xbe3c('0x0'));var util=require('util');var path=require(_0xbe3c('0x1'));var timeout=require(_0xbe3c('0x2'));var express=require(_0xbe3c('0x3'));var router=express[_0xbe3c('0x4')]();var fs_extra=require(_0xbe3c('0x5'));var auth=require(_0xbe3c('0x6'));var interaction=require(_0xbe3c('0x7'));var config=require(_0xbe3c('0x8'));var controller=require(_0xbe3c('0x9'));router['put'](_0xbe3c('0xa'),auth['isAuthenticated'](),controller[_0xbe3c('0xb')]);router[_0xbe3c('0xc')]('/:id',auth[_0xbe3c('0xd')](),controller[_0xbe3c('0xe')]);module[_0xbe3c('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index cdaa1d5..32bf193 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x4b477a,_0x3e3f1e){var _0x291072=function(_0x2539a9){while(--_0x2539a9){_0x4b477a['push'](_0x4b477a['shift']());}};_0x291072(++_0x3e3f1e);}(_0xac9d,0x14d));var _0xdac9=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xac9d[_0x5e3701];return _0x345dcf;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x3e2423,_0x5554c6){var _0x26c422=function(_0x5b23e7){while(--_0x5b23e7){_0x3e2423['push'](_0x3e2423['shift']());}};_0x26c422(++_0x5554c6);}(_0x5496,0x175));var _0x6549=function(_0x510218,_0x3d8b2e){_0x510218=_0x510218-0x0;var _0x3e80bd=_0x5496[_0x510218];return _0x3e80bd;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f9244b7..b0e22e8 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 _0xdcde=['save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','include','findAll','params','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','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','operator','group','field','condition','value','merge','options','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','parentKey','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x26b1a5,_0x3ffb3e){var _0xb21c93=function(_0x1578dd){while(--_0x1578dd){_0x26b1a5['push'](_0x26b1a5['shift']());}};_0xb21c93(++_0x3ffb3e);}(_0xdcde,0x1d0));var _0xedcd=function(_0x6b942a,_0x311643){_0x6b942a=_0x6b942a-0x0;var _0x22129d=_0xdcde[_0x6b942a];return _0x22129d;};'use strict';var emlformat=require(_0xedcd('0x0'));var rimraf=require(_0xedcd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedcd('0x2'));var rp=require(_0xedcd('0x3'));var moment=require(_0xedcd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xedcd('0x5'));var sox=require(_0xedcd('0x6'));var csv=require(_0xedcd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedcd('0x8'));var _=require(_0xedcd('0x9'));var squel=require(_0xedcd('0xa'));var crypto=require(_0xedcd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xedcd('0xc'));var toCsv=require(_0xedcd('0x7'));var querystring=require(_0xedcd('0xd'));var Papa=require(_0xedcd('0xe'));var Redis=require(_0xedcd('0xf'));var authService=require(_0xedcd('0x10'));var qs=require(_0xedcd('0x11'));var as=require(_0xedcd('0x12'));var hardwareService=require(_0xedcd('0x13'));var logger=require(_0xedcd('0x14'))(_0xedcd('0x15'));var utils=require(_0xedcd('0x16'));var config=require(_0xedcd('0x17'));var licenseUtil=require(_0xedcd('0x18'));var db=require(_0xedcd('0x19'))['db'];var dbH=require(_0xedcd('0x19'))['dbH'];function respondWithStatusCode(_0x219b4a,_0x2f521a){_0x2f521a=_0x2f521a||0xcc;return function(_0x590620){if(_0x590620){return _0x219b4a[_0xedcd('0x1a')](_0x2f521a);}return _0x219b4a[_0xedcd('0x1b')](_0x2f521a)['end']();};}function respondWithResult(_0x4a9390,_0x3fb712){_0x3fb712=_0x3fb712||0xc8;return function(_0x599981){if(_0x599981){return _0x4a9390['status'](_0x3fb712)[_0xedcd('0x1c')](_0x599981);}};}function respondWithFilteredResult(_0x39a87a,_0x48a5f7){return function(_0x543628){if(_0x543628){var _0x981b01=typeof _0x48a5f7[_0xedcd('0x1d')]==='undefined'&&typeof _0x48a5f7[_0xedcd('0x1e')]===_0xedcd('0x1f');var _0x2e0095=_0x543628[_0xedcd('0x20')];var _0x4b7365=_0x981b01?0x0:_0x48a5f7['offset'];var _0x329f94=_0x981b01?_0x543628[_0xedcd('0x20')]:_0x48a5f7[_0xedcd('0x1d')]+_0x48a5f7[_0xedcd('0x1e')];var _0x5b33d8;if(_0x329f94>=_0x2e0095){_0x329f94=_0x2e0095;_0x5b33d8=0xc8;}else{_0x5b33d8=0xce;}_0x39a87a[_0xedcd('0x1b')](_0x5b33d8);return _0x39a87a[_0xedcd('0x21')](_0xedcd('0x22'),_0x4b7365+'-'+_0x329f94+'/'+_0x2e0095)['json'](_0x543628);}return null;};}function patchUpdates(_0x3e84d5){return function(_0x506c11){try{jsonpatch[_0xedcd('0x23')](_0x506c11,_0x3e84d5,!![]);}catch(_0x251b49){return BPromise[_0xedcd('0x24')](_0x251b49);}return _0x506c11[_0xedcd('0x25')]();};}function saveUpdates(_0x3267ba,_0x5aba2b){return function(_0x4e7360){if(_0x4e7360){return _0x4e7360[_0xedcd('0x26')](_0x3267ba)[_0xedcd('0x27')](function(_0x1b51d9){return _0x1b51d9;});}return null;};}function removeEntity(_0x4b3e3d,_0xd70440){return function(_0x516c49){if(_0x516c49){return _0x516c49[_0xedcd('0x28')]()[_0xedcd('0x27')](function(){var _0xa7558e=_0x516c49[_0xedcd('0x29')]({'plain':!![]});var _0xdbd925='CustomReports';return db[_0xedcd('0x2a')]['destroy']({'where':{'type':_0xdbd925,'resourceId':_0xa7558e['id']}})[_0xedcd('0x27')](function(){return _0x516c49;});})[_0xedcd('0x27')](function(){_0x4b3e3d[_0xedcd('0x1b')](0xcc)[_0xedcd('0x2b')]();});}};}function handleEntityNotFound(_0x379f6f,_0x202068){return function(_0x3e6aab){if(!_0x3e6aab){_0x379f6f[_0xedcd('0x1a')](0x194);}return _0x3e6aab;};}function handleError(_0x46110e,_0x359e1b){_0x359e1b=_0x359e1b||0x1f4;return function(_0x7d81f8){logger['error'](_0x7d81f8[_0xedcd('0x2c')]);if(_0x7d81f8[_0xedcd('0x2d')]){delete _0x7d81f8[_0xedcd('0x2d')];}_0x46110e['status'](_0x359e1b)[_0xedcd('0x2e')](_0x7d81f8);};}exports[_0xedcd('0x2f')]=function(_0x16554e,_0x5d93ad){var _0x39e327={},_0x4d86a3={},_0x4251fe={'count':0x0,'rows':[]};var _0xb2e186=_[_0xedcd('0x30')](db[_0xedcd('0x31')][_0xedcd('0x32')],function(_0x16c9c0){return{'name':_0x16c9c0['fieldName'],'type':_0x16c9c0[_0xedcd('0x33')][_0xedcd('0x34')]};});_0x4d86a3[_0xedcd('0x35')]=_[_0xedcd('0x30')](_0xb2e186,_0xedcd('0x2d'));_0x4d86a3['query']=_['keys'](_0x16554e[_0xedcd('0x36')]);_0x4d86a3[_0xedcd('0x37')]=_[_0xedcd('0x38')](_0x4d86a3[_0xedcd('0x35')],_0x4d86a3[_0xedcd('0x36')]);_0x39e327[_0xedcd('0x39')]=_[_0xedcd('0x38')](_0x4d86a3['model'],qs[_0xedcd('0x3a')](_0x16554e[_0xedcd('0x36')]['fields']));_0x39e327[_0xedcd('0x39')]=_0x39e327[_0xedcd('0x39')][_0xedcd('0x3b')]?_0x39e327[_0xedcd('0x39')]:_0x4d86a3[_0xedcd('0x35')];if(!_0x16554e[_0xedcd('0x36')][_0xedcd('0x3c')](_0xedcd('0x3d'))){_0x39e327['limit']=qs['limit'](_0x16554e[_0xedcd('0x36')][_0xedcd('0x1e')]);_0x39e327[_0xedcd('0x1d')]=qs['offset'](_0x16554e[_0xedcd('0x36')]['offset']);}_0x39e327[_0xedcd('0x3e')]=qs[_0xedcd('0x3f')](_0x16554e[_0xedcd('0x36')]['sort']);_0x39e327[_0xedcd('0x40')]=qs[_0xedcd('0x37')](_[_0xedcd('0x41')](_0x16554e[_0xedcd('0x36')],_0x4d86a3[_0xedcd('0x37')]),_0xb2e186);if(_0x16554e[_0xedcd('0x36')][_0xedcd('0x42')]){_0x39e327[_0xedcd('0x40')]=_['merge'](_0x39e327[_0xedcd('0x40')],{'$or':_[_0xedcd('0x30')](_0xb2e186,function(_0x32506c){if(_0x32506c['type']!=='VIRTUAL'){var _0x40a8bc={};_0x40a8bc[_0x32506c['name']]={'$like':'%'+_0x16554e[_0xedcd('0x36')][_0xedcd('0x42')]+'%'};return _0x40a8bc;}})});}_0x39e327=_['merge']({},_0x39e327,_0x16554e['options']);var _0x202258={'where':_0x39e327[_0xedcd('0x40')]};return db[_0xedcd('0x31')][_0xedcd('0x20')](_0x202258)[_0xedcd('0x27')](function(_0xf78174){_0x4251fe[_0xedcd('0x20')]=_0xf78174;if(_0x16554e[_0xedcd('0x36')]['includeAll']){_0x39e327[_0xedcd('0x43')]=[{'all':!![]}];}return db[_0xedcd('0x31')][_0xedcd('0x44')](_0x39e327);})[_0xedcd('0x27')](function(_0xfc44b1){_0x4251fe['rows']=_0xfc44b1;return _0x4251fe;})[_0xedcd('0x27')](respondWithFilteredResult(_0x5d93ad,_0x39e327))['catch'](handleError(_0x5d93ad,null));};exports['show']=function(_0x3dd8b3,_0x4a5aa7){var _0x580568={'raw':![],'where':{'id':_0x3dd8b3[_0xedcd('0x45')]['id']}},_0x5d4744={};_0x5d4744['model']=_['keys'](db[_0xedcd('0x31')][_0xedcd('0x32')]);_0x5d4744[_0xedcd('0x36')]=_['keys'](_0x3dd8b3[_0xedcd('0x36')]);_0x5d4744[_0xedcd('0x37')]=_[_0xedcd('0x38')](_0x5d4744[_0xedcd('0x35')],_0x5d4744['query']);_0x580568[_0xedcd('0x39')]=_[_0xedcd('0x38')](_0x5d4744['model'],qs[_0xedcd('0x3a')](_0x3dd8b3[_0xedcd('0x36')][_0xedcd('0x3a')]));_0x580568[_0xedcd('0x39')]=_0x580568[_0xedcd('0x39')][_0xedcd('0x3b')]?_0x580568[_0xedcd('0x39')]:_0x5d4744[_0xedcd('0x35')];if(_0x3dd8b3['query'][_0xedcd('0x46')]){_0x580568['include']=[{'all':!![]}];}_0x580568=_['merge']({},_0x580568,_0x3dd8b3['options']);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x580568)[_0xedcd('0x27')](handleEntityNotFound(_0x4a5aa7,null))[_0xedcd('0x27')](respondWithResult(_0x4a5aa7,null))[_0xedcd('0x48')](handleError(_0x4a5aa7,null));};exports[_0xedcd('0x49')]=function(_0x5755ed,_0x29647d){return db[_0xedcd('0x31')][_0xedcd('0x49')](_0x5755ed[_0xedcd('0x4a')],{})[_0xedcd('0x27')](function(_0x79890f){var _0x443e4e=_0x5755ed[_0xedcd('0x4b')][_0xedcd('0x29')]({'plain':!![]});if(!_0x443e4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x443e4e[_0xedcd('0x4c')]===_0xedcd('0x4b')){var _0xdc975a=_0x79890f[_0xedcd('0x29')]({'plain':!![]});var _0x1e67a0='Reports';return db[_0xedcd('0x4d')][_0xedcd('0x47')]({'where':{'name':_0x1e67a0,'userProfileId':_0x443e4e[_0xedcd('0x4e')]},'raw':!![]})['then'](function(_0x1072f6){if(_0x1072f6&&_0x1072f6[_0xedcd('0x4f')]===0x0){return db['UserProfileResource'][_0xedcd('0x49')]({'name':_0xdc975a['name'],'resourceId':_0xdc975a['id'],'type':_0xedcd('0x50'),'sectionId':_0x1072f6['id']},{})['then'](function(){return _0x79890f;});}else{return _0x79890f;}})['catch'](function(_0x307d8b){logger[_0xedcd('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x307d8b);throw _0x307d8b;});}return _0x79890f;})[_0xedcd('0x27')](respondWithResult(_0x29647d,0xc9))[_0xedcd('0x48')](handleError(_0x29647d,null));};exports[_0xedcd('0x26')]=function(_0x12dafb,_0x407dad){if(_0x12dafb[_0xedcd('0x4a')]['id']){delete _0x12dafb['body']['id'];}return db[_0xedcd('0x31')][_0xedcd('0x47')]({'where':{'id':_0x12dafb['params']['id']}})[_0xedcd('0x27')](handleEntityNotFound(_0x407dad,null))[_0xedcd('0x27')](saveUpdates(_0x12dafb['body'],null))[_0xedcd('0x27')](respondWithResult(_0x407dad,null))['catch'](handleError(_0x407dad,null));};exports[_0xedcd('0x28')]=function(_0x3551b9,_0x2ab786){return db[_0xedcd('0x31')][_0xedcd('0x47')]({'where':{'id':_0x3551b9['params']['id']}})[_0xedcd('0x27')](handleEntityNotFound(_0x2ab786,null))['then'](removeEntity(_0x2ab786,null))[_0xedcd('0x48')](handleError(_0x2ab786,null));};exports[_0xedcd('0x52')]=function(_0x5ca493,_0x2540a3){var _0x279185=0xa;var _0x2a3358=[_0xedcd('0x53'),_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x5af447={'SUM':_0xedcd('0x57'),'COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xedcd('0x5b')};var _0x2e02c7={'SEC_TO_TIME':_0xedcd('0x5c'),'DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':_0xedcd('0x60')};var _0x305e6f=function(_0x5e05f2){return!_[_0xedcd('0x61')]([_0xedcd('0x62'),_0xedcd('0x63'),_0xedcd('0x64'),_0xedcd('0x65')],_0x5e05f2);};var _0x4ee1be=function(_0x4ebb41){if(!_0x4ebb41||!_0x4ebb41[_0xedcd('0x66')]['length']){return'';}for(var _0x4d0305='(',_0x50ea42=0x0;_0x50ea42<_0x4ebb41['rules']['length'];_0x50ea42+=0x1){_0x50ea42>0x0&&(_0x4d0305+='\x20'+_0x4ebb41[_0xedcd('0x67')]+'\x20');_0x4d0305+=_0x4ebb41['rules'][_0x50ea42][_0xedcd('0x68')]?_0x4ee1be(_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x68')]):_0x4ebb41['rules'][_0x50ea42][_0xedcd('0x69')]+'\x20'+_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x6a')]+(_0x305e6f(_0x4ebb41[_0xedcd('0x66')][_0x50ea42]['condition'])?'\x20'+_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x6b')]:'');}return _0x4d0305+')';};var _0x2ec2db={'where':{'id':_0x5ca493['params']['id']}},_0x177bbf,_0x274de0,_0x1a11d2,_0x52a901,_0x10b757;_0x2ec2db=_[_0xedcd('0x6c')]({},_0x2ec2db,_0x5ca493[_0xedcd('0x6d')]);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x2ec2db)['then'](function(_0x4eff26){if(_0x4eff26){_0x177bbf=_0x4eff26;return _0x4eff26['getFields']();}return null;})[_0xedcd('0x27')](function(_0x58fd12){if(_0x58fd12){if(!_0x58fd12[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))][(_0xedcd('0x6f'))](_0xedcd('0x70'),0x193);}_0x274de0=_0x58fd12;return db[_0xedcd('0x71')][_0xedcd('0x44')]({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0x1bff43){if(_0x1bff43){_0x1a11d2=_[_0xedcd('0x72')](_0x1bff43,'id');var _0x5de8fa;var _0x3bd228=squel[_0xedcd('0x73')]();_0x3bd228[_0xedcd('0x74')](_0x177bbf[_0xedcd('0x75')]);for(var _0xa51eca=0x0;_0xa51eca<_0x274de0[_0xedcd('0x3b')];_0xa51eca+=0x1){_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x76')]?_0x1a11d2[_0x274de0[_0xa51eca]['MetricId']]['metric']:_0x274de0[_0xa51eca][_0xedcd('0x69')];_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x5af447[_0x274de0[_0xa51eca][_0xedcd('0x77')]],'%s',_0x5de8fa):_0x5de8fa;_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x79')]?_[_0xedcd('0x78')](_0x2e02c7[_0x274de0[_0xa51eca][_0xedcd('0x79')]],'%s',_0x5de8fa):_0x5de8fa;if(_0x274de0[_0xa51eca][_0xedcd('0x7a')]){_0x3bd228[_0xedcd('0x68')](_0x5de8fa);}_0x274de0[_0xa51eca][_0xedcd('0x7b')]&&_0x3bd228[_0xedcd('0x3e')](_0x5de8fa,_0x274de0[_0xa51eca][_0xedcd('0x7b')]===_0xedcd('0x7c')?![]:!![]);_0x3bd228[_0xedcd('0x69')](_0x5de8fa,_0x274de0[_0xa51eca][_0xedcd('0x7d')]||_0x5de8fa);}if(_0x177bbf[_0xedcd('0x7e')]){_0x177bbf[_0xedcd('0x7e')]=JSON[_0xedcd('0x7f')](_0x177bbf[_0xedcd('0x7e')]);for(var _0x26239b=0x0;_0x26239b<_0x177bbf[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x26239b+=0x1){if(_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')]&&_[_0xedcd('0x61')](_0x2a3358,_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')])&&_0x177bbf['joins'][_0x26239b]['parentKey']&&_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')]&&_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x81')]){_0x3bd228[_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')]](_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x177bbf[_0xedcd('0x75')],_0x177bbf[_0xedcd('0x7e')][_0x26239b]['parentKey'],_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')],_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x81')]));}}}if(_0x177bbf[_0xedcd('0x83')]){_0x177bbf[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x177bbf['conditions']);_0x3bd228[_0xedcd('0x40')](_0x4ee1be(_0x177bbf[_0xedcd('0x83')][_0xedcd('0x68')]));}_0x10b757=_0x3bd228['clone']();_0x3bd228[_0xedcd('0x1e')](_0x279185);_0x3bd228[_0xedcd('0x1d')](0x0);logger[_0xedcd('0x84')](_0xedcd('0x85'),_0x3bd228[_0xedcd('0x86')]());return dbH[_0xedcd('0x87')][_0xedcd('0x36')](_0x3bd228['toString'](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')][_0xedcd('0x89')]});}})[_0xedcd('0x27')](respondWithResult(_0x2540a3,null))['catch'](handleError(_0x2540a3,null));};function runReport(_0x124a23,_0x249b9f,_0x8963ea){var _0x14113a=_0x249b9f['name'];var _0x5f4a84=0xa;var _0x441917=[_0xedcd('0x53'),_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x2dbdb4={'SUM':_0xedcd('0x57'),'COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':_0xedcd('0x8a'),'AVG':_0xedcd('0x8b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xedcd('0x8c'),'GROUP_CONCAT DESC':_0xedcd('0x5b')};var _0xa0034b={'SEC_TO_TIME':_0xedcd('0x5c'),'DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3fcc70=function(_0xcf840d){return!_['includes'](['IS\x20NULL',_0xedcd('0x63'),_0xedcd('0x64'),_0xedcd('0x65')],_0xcf840d);};var _0x50dcb5=function(_0x3425db){if(!_0x3425db||!_0x3425db[_0xedcd('0x66')][_0xedcd('0x3b')]){return'';}for(var _0x5aa4f1='(',_0x3c65f6=0x0;_0x3c65f6<_0x3425db[_0xedcd('0x66')][_0xedcd('0x3b')];_0x3c65f6+=0x1){_0x3c65f6>0x0&&(_0x5aa4f1+='\x20'+_0x3425db[_0xedcd('0x67')]+'\x20');_0x5aa4f1+=_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x68')]?_0x50dcb5(_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x68')]):_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x69')]+'\x20'+_0x3425db['rules'][_0x3c65f6][_0xedcd('0x6a')]+(_0x3fcc70(_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x6a')])?'\x20'+_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x6b')]:'');}return _0x5aa4f1+')';};var _0x5ab59a={'where':{'id':_0x124a23['id']}},_0x19185c,_0x42f1af,_0x147b86,_0x457e5a,_0x20f54c;_0x5ab59a=_[_0xedcd('0x6c')]({},_0x5ab59a,_0x8963ea);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x5ab59a)['then'](function(_0x3894a8){if(_0x3894a8){_0x19185c=_0x3894a8;return _0x3894a8[_0xedcd('0x8d')]();}return null;})[_0xedcd('0x27')](function(_0x3769cf){if(_0x3769cf){if(!_0x3769cf[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))]['ValidationErrorItem'](_0xedcd('0x70'),0x193);}_0x42f1af=_0x3769cf;return db[_0xedcd('0x71')][_0xedcd('0x44')]({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0x485513){if(_0x485513){_0x147b86=_['keyBy'](_0x485513,'id');var _0x53f476;var _0x6de9af=squel['select']();_0x6de9af[_0xedcd('0x74')](_0x19185c[_0xedcd('0x75')]);for(var _0x992ba3=0x0;_0x992ba3<_0x42f1af[_0xedcd('0x3b')];_0x992ba3+=0x1){_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x76')]?_0x147b86[_0x42f1af[_0x992ba3][_0xedcd('0x76')]]['metric']:_0x42f1af[_0x992ba3][_0xedcd('0x69')];_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x2dbdb4[_0x42f1af[_0x992ba3][_0xedcd('0x77')]],'%s',_0x53f476):_0x53f476;_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x79')]?_['replace'](_0xa0034b[_0x42f1af[_0x992ba3]['format']],'%s',_0x53f476):_0x53f476;if(_0x42f1af[_0x992ba3][_0xedcd('0x7a')]){_0x6de9af[_0xedcd('0x68')](_0x53f476);}_0x42f1af[_0x992ba3][_0xedcd('0x7b')]&&_0x6de9af[_0xedcd('0x3e')](_0x53f476,_0x42f1af[_0x992ba3][_0xedcd('0x7b')]==='DESC'?![]:!![]);_0x6de9af[_0xedcd('0x69')](_0x53f476,_0x42f1af[_0x992ba3]['alias']||_0x53f476);}if(_0x19185c[_0xedcd('0x7e')]){_0x19185c[_0xedcd('0x7e')]=JSON[_0xedcd('0x7f')](_0x19185c[_0xedcd('0x7e')]);for(var _0x1cecaa=0x0;_0x1cecaa<_0x19185c[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x1cecaa+=0x1){if(_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x33')]&&_[_0xedcd('0x61')](_0x441917,_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x33')])&&_0x19185c[_0xedcd('0x7e')][_0x1cecaa]['parentKey']&&_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')]&&_0x19185c['joins'][_0x1cecaa][_0xedcd('0x81')]){_0x6de9af[_0x19185c['joins'][_0x1cecaa]['type']](_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x19185c[_0xedcd('0x75')],_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x8e')],_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')],_0x19185c['joins'][_0x1cecaa][_0xedcd('0x81')]));}}}if(_0x19185c[_0xedcd('0x83')]){_0x19185c[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x19185c['conditions']);_0x6de9af['where'](_0x50dcb5(_0x19185c[_0xedcd('0x83')][_0xedcd('0x68')]));}_0x20f54c=_0x6de9af[_0xedcd('0x8f')]();_0x6de9af[_0xedcd('0x1e')](_0x5f4a84);_0x6de9af['offset'](0x0);return;}})['then'](function(){if(_0x249b9f['output']===_0xedcd('0x90')){return null;}var _0xdf23=_['merge'](_0x249b9f,{'name':_0x249b9f[_0xedcd('0x91')]||_0x249b9f[_0xedcd('0x2d')]||_0x19185c['name'],'basename':_0x14113a,'savename':util[_0xedcd('0x79')](_0xedcd('0x92'),_0x249b9f[_0xedcd('0x2d')]||_0x19185c[_0xedcd('0x2d')],require(_0xedcd('0x93'))[_0xedcd('0x94')](0x4),_0x249b9f[_0xedcd('0x95')]||'csv'),'reportId':_0x19185c['id'],'reportType':_0xedcd('0x96')});return db[_0xedcd('0x97')][_0xedcd('0x49')](_0xdf23,{'raw':!![]});})[_0xedcd('0x27')](function(_0x74ba12){if(_0x19185c[_0xedcd('0x75')]===_0xedcd('0x98')){_0x20f54c['where'](_0x19185c[_0xedcd('0x75')]+_0xedcd('0x99'),_0x249b9f[_0xedcd('0x9a')],_0x249b9f[_0xedcd('0x9b')]);}else{_0x20f54c[_0xedcd('0x40')](_0x19185c[_0xedcd('0x75')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x249b9f[_0xedcd('0x9a')],_0x249b9f[_0xedcd('0x9b')]);}if(_0x74ba12){logger[_0xedcd('0x9c')](_0xedcd('0x9d'),_0x20f54c[_0xedcd('0x86')]());require(_0xedcd('0x9e'))[_0xedcd('0x9f')](path[_0xedcd('0x53')](__dirname,'../../components/export/',_0x74ba12['output']),[_0x74ba12['id'],_0x20f54c[_0xedcd('0x86')](),path[_0xedcd('0x53')](__dirname,_0xedcd('0xa0'),_0x74ba12[_0xedcd('0xa1')]),_0x14113a]);return _0x74ba12;}else{var _0x11e3bc=squel[_0xedcd('0x73')]();_0x11e3bc[_0xedcd('0x74')]('('+_0x20f54c[_0xedcd('0x86')]()+')',_0xedcd('0xa2'));_0x11e3bc['field'](_0xedcd('0xa3'),_0xedcd('0x20'));_0x20f54c[_0xedcd('0x1e')](_0x249b9f['limit']||_0x5f4a84);_0x20f54c[_0xedcd('0x1d')](_0x249b9f[_0xedcd('0x1d')]||0x0);return dbH[_0xedcd('0x87')]['query'](_0x11e3bc['toString'](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')][_0xedcd('0x89')]})[_0xedcd('0x27')](function(_0x4e67ab){if(!_0x4e67ab[_0xedcd('0x3b')]){_0x457e5a=0x0;}else{_0x457e5a=_0x4e67ab[0x0]['count']||0x0;}return dbH[_0xedcd('0x87')][_0xedcd('0x36')](_0x20f54c[_0xedcd('0x86')](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')]['SELECT']});})[_0xedcd('0x27')](function(_0x3a9c48){return{'rows':_0x3a9c48||[],'count':_0x457e5a};});}});}exports[_0xedcd('0xa4')]=function(_0x15624b,_0x50d069){return runReport(_0x15624b['params'],_0x15624b['query'],_0x15624b['options'])[_0xedcd('0x27')](respondWithResult(_0x50d069,null))[_0xedcd('0x48')](handleError(_0x50d069,null));};exports[_0xedcd('0xa5')]=runReport;exports['query']=function(_0x272cc3,_0x482663){var _0x214efe=0xa;var _0x51a69a=['join',_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x2ea0a2={'SUM':'SUM(%s)','COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':_0xedcd('0x8a'),'AVG':_0xedcd('0x8b'),'GROUP_CONCAT':_0xedcd('0xa6'),'GROUP_CONCAT ASC':_0xedcd('0x8c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x8aaf73={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':_0xedcd('0x60')};var _0x408f54=function(_0x150802){return!_[_0xedcd('0x61')]([_0xedcd('0x62'),'IS\x20NOT\x20NULL',_0xedcd('0x64'),_0xedcd('0x65')],_0x150802);};var _0x12355e=function(_0x1275bd){if(!_0x1275bd||!_0x1275bd[_0xedcd('0x66')][_0xedcd('0x3b')]){return'';}for(var _0x5ae020='(',_0x29a1a2=0x0;_0x29a1a2<_0x1275bd[_0xedcd('0x66')]['length'];_0x29a1a2+=0x1){_0x29a1a2>0x0&&(_0x5ae020+='\x20'+_0x1275bd[_0xedcd('0x67')]+'\x20');_0x5ae020+=_0x1275bd['rules'][_0x29a1a2][_0xedcd('0x68')]?_0x12355e(_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x68')]):_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x69')]+'\x20'+_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x6a')]+(_0x408f54(_0x1275bd[_0xedcd('0x66')][_0x29a1a2]['condition'])?'\x20'+_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x6b')]:'');}return _0x5ae020+')';};var _0x358e11={'where':{'id':_0x272cc3[_0xedcd('0x45')]['id']}},_0x139fbf,_0x4c902e,_0x7019c5,_0x18df84,_0x2cc929;_0x358e11=_[_0xedcd('0x6c')]({},_0x358e11,_0x272cc3[_0xedcd('0x6d')]);return db[_0xedcd('0x31')]['find'](_0x358e11)['then'](function(_0x4c51fd){if(_0x4c51fd){_0x139fbf=_0x4c51fd;return _0x4c51fd[_0xedcd('0x8d')]();}return null;})[_0xedcd('0x27')](function(_0xca8b18){if(_0xca8b18){if(!_0xca8b18[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))][(_0xedcd('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4c902e=_0xca8b18;return db[_0xedcd('0x71')]['findAll']({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0xac03f7){if(_0xac03f7){_0x7019c5=_['keyBy'](_0xac03f7,'id');var _0x31234f;var _0x1e4301=squel[_0xedcd('0x73')]();_0x1e4301[_0xedcd('0x74')](_0x139fbf['table']);for(var _0x2662b4=0x0;_0x2662b4<_0x4c902e[_0xedcd('0x3b')];_0x2662b4+=0x1){_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x76')]?_0x7019c5[_0x4c902e[_0x2662b4]['MetricId']]['metric']:_0x4c902e[_0x2662b4]['field'];_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x2ea0a2[_0x4c902e[_0x2662b4][_0xedcd('0x77')]],'%s',_0x31234f):_0x31234f;_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x79')]?_['replace'](_0x8aaf73[_0x4c902e[_0x2662b4][_0xedcd('0x79')]],'%s',_0x31234f):_0x31234f;if(_0x4c902e[_0x2662b4][_0xedcd('0x7a')]){_0x1e4301[_0xedcd('0x68')](_0x31234f);}_0x4c902e[_0x2662b4]['orderBy']&&_0x1e4301[_0xedcd('0x3e')](_0x31234f,_0x4c902e[_0x2662b4][_0xedcd('0x7b')]==='DESC'?![]:!![]);_0x1e4301[_0xedcd('0x69')](_0x31234f,_0x4c902e[_0x2662b4][_0xedcd('0x7d')]||_0x31234f);}if(_0x139fbf[_0xedcd('0x7e')]){_0x139fbf['joins']=JSON[_0xedcd('0x7f')](_0x139fbf[_0xedcd('0x7e')]);for(var _0x210532=0x0;_0x210532<_0x139fbf[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x210532+=0x1){if(_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x33')]&&_['includes'](_0x51a69a,_0x139fbf['joins'][_0x210532]['type'])&&_0x139fbf['joins'][_0x210532][_0xedcd('0x8e')]&&_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')]&&_0x139fbf['joins'][_0x210532]['foreignKey']){_0x1e4301[_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x33')]](_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x139fbf[_0xedcd('0x75')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x8e')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x81')]));}}}if(_0x139fbf[_0xedcd('0x83')]){_0x139fbf[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x139fbf[_0xedcd('0x83')]);_0x1e4301['where'](_0x12355e(_0x139fbf['conditions'][_0xedcd('0x68')]));}_0x2cc929=_0x1e4301[_0xedcd('0x8f')]();_0x1e4301[_0xedcd('0x1e')](_0x214efe);_0x1e4301[_0xedcd('0x1d')](0x0);logger[_0xedcd('0x84')](_0xedcd('0x85'),_0x1e4301[_0xedcd('0x86')]());return dbH[_0xedcd('0x87')]['query'](_0x1e4301['toString'](),{'type':dbH[_0xedcd('0x87')]['QueryTypes']['SELECT']});}})[_0xedcd('0x27')](function(){return{'sql':_0x2cc929[_0xedcd('0x86')]()};})['then'](respondWithResult(_0x482663,null))[_0xedcd('0x48')](handleError(_0x482663,null));}; \ No newline at end of file +var _0xc448=['getFields','select','from','metric','groupBy','clone','output','fullPath','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','countTable','COUNT(*)','SELECT','run','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','show','params','keys','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0xd0746a,_0x726b2b){var _0x36985b=function(_0x252b45){while(--_0x252b45){_0xd0746a['push'](_0xd0746a['shift']());}};_0x36985b(++_0x726b2b);}(_0xc448,0xbc));var _0x8c44=function(_0x4c4edd,_0x31cce5){_0x4c4edd=_0x4c4edd-0x0;var _0x329a8a=_0xc448[_0x4c4edd];return _0x329a8a;};'use strict';var emlformat=require(_0x8c44('0x0'));var rimraf=require(_0x8c44('0x1'));var zipdir=require(_0x8c44('0x2'));var jsonpatch=require(_0x8c44('0x3'));var rp=require(_0x8c44('0x4'));var moment=require(_0x8c44('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c44('0x6'));var util=require(_0x8c44('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8c44('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c44('0x9'));var _=require(_0x8c44('0xa'));var squel=require(_0x8c44('0xb'));var crypto=require(_0x8c44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8c44('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8c44('0xe'));var Papa=require(_0x8c44('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c44('0x11'))(_0x8c44('0x12'));var utils=require(_0x8c44('0x13'));var config=require(_0x8c44('0x14'));var licenseUtil=require(_0x8c44('0x15'));var db=require(_0x8c44('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5ad87f,_0x361606){_0x361606=_0x361606||0xcc;return function(_0x472eef){if(_0x472eef){return _0x5ad87f[_0x8c44('0x17')](_0x361606);}return _0x5ad87f['status'](_0x361606)[_0x8c44('0x18')]();};}function respondWithResult(_0x2769a2,_0x1e6fb2){_0x1e6fb2=_0x1e6fb2||0xc8;return function(_0x4db10c){if(_0x4db10c){return _0x2769a2[_0x8c44('0x19')](_0x1e6fb2)[_0x8c44('0x1a')](_0x4db10c);}};}function respondWithFilteredResult(_0x569cb6,_0x19e564){return function(_0x286cbe){if(_0x286cbe){var _0x2c4178=typeof _0x19e564[_0x8c44('0x1b')]==='undefined'&&typeof _0x19e564[_0x8c44('0x1c')]==='undefined';var _0x1b8146=_0x286cbe[_0x8c44('0x1d')];var _0x1e86e0=_0x2c4178?0x0:_0x19e564[_0x8c44('0x1b')];var _0x27876e=_0x2c4178?_0x286cbe['count']:_0x19e564[_0x8c44('0x1b')]+_0x19e564[_0x8c44('0x1c')];var _0x889282;if(_0x27876e>=_0x1b8146){_0x27876e=_0x1b8146;_0x889282=0xc8;}else{_0x889282=0xce;}_0x569cb6['status'](_0x889282);return _0x569cb6[_0x8c44('0x1e')](_0x8c44('0x1f'),_0x1e86e0+'-'+_0x27876e+'/'+_0x1b8146)[_0x8c44('0x1a')](_0x286cbe);}return null;};}function patchUpdates(_0xce1595){return function(_0xc43a48){try{jsonpatch['apply'](_0xc43a48,_0xce1595,!![]);}catch(_0x247303){return BPromise[_0x8c44('0x20')](_0x247303);}return _0xc43a48[_0x8c44('0x21')]();};}function saveUpdates(_0x2ae733,_0xec2324){return function(_0x2b9c7a){if(_0x2b9c7a){return _0x2b9c7a[_0x8c44('0x22')](_0x2ae733)['then'](function(_0x3d4c5f){return _0x3d4c5f;});}return null;};}function removeEntity(_0x203e05,_0x7a70a4){return function(_0x51dc47){if(_0x51dc47){return _0x51dc47[_0x8c44('0x23')]()[_0x8c44('0x24')](function(){var _0x55a290=_0x51dc47[_0x8c44('0x25')]({'plain':!![]});var _0x1ba2b2='CustomReports';return db[_0x8c44('0x26')][_0x8c44('0x23')]({'where':{'type':_0x1ba2b2,'resourceId':_0x55a290['id']}})[_0x8c44('0x24')](function(){return _0x51dc47;});})[_0x8c44('0x24')](function(){_0x203e05['status'](0xcc)[_0x8c44('0x18')]();});}};}function handleEntityNotFound(_0x1db34c,_0x4c3c41){return function(_0x531def){if(!_0x531def){_0x1db34c[_0x8c44('0x17')](0x194);}return _0x531def;};}function handleError(_0x1f8a83,_0x35b828){_0x35b828=_0x35b828||0x1f4;return function(_0x3ecc1a){logger[_0x8c44('0x27')](_0x3ecc1a[_0x8c44('0x28')]);if(_0x3ecc1a[_0x8c44('0x29')]){delete _0x3ecc1a[_0x8c44('0x29')];}_0x1f8a83[_0x8c44('0x19')](_0x35b828)['send'](_0x3ecc1a);};}exports['index']=function(_0x2effcd,_0x407d7a){var _0x235a1a={},_0x547d5e={},_0x252d76={'count':0x0,'rows':[]};var _0xd060d5=_['map'](db[_0x8c44('0x2a')][_0x8c44('0x2b')],function(_0x1c2355){return{'name':_0x1c2355[_0x8c44('0x2c')],'type':_0x1c2355[_0x8c44('0x2d')][_0x8c44('0x2e')]};});_0x547d5e[_0x8c44('0x2f')]=_['map'](_0xd060d5,'name');_0x547d5e[_0x8c44('0x30')]=_['keys'](_0x2effcd[_0x8c44('0x30')]);_0x547d5e[_0x8c44('0x31')]=_['intersection'](_0x547d5e[_0x8c44('0x2f')],_0x547d5e[_0x8c44('0x30')]);_0x235a1a[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x547d5e['model'],qs[_0x8c44('0x34')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x34')]));_0x235a1a[_0x8c44('0x32')]=_0x235a1a[_0x8c44('0x32')][_0x8c44('0x35')]?_0x235a1a[_0x8c44('0x32')]:_0x547d5e['model'];if(!_0x2effcd['query'][_0x8c44('0x36')](_0x8c44('0x37'))){_0x235a1a[_0x8c44('0x1c')]=qs[_0x8c44('0x1c')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1c')]);_0x235a1a['offset']=qs['offset'](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1b')]);}_0x235a1a[_0x8c44('0x38')]=qs[_0x8c44('0x39')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x39')]);_0x235a1a[_0x8c44('0x3a')]=qs[_0x8c44('0x31')](_[_0x8c44('0x3b')](_0x2effcd[_0x8c44('0x30')],_0x547d5e[_0x8c44('0x31')]),_0xd060d5);if(_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]){_0x235a1a[_0x8c44('0x3a')]=_[_0x8c44('0x3d')](_0x235a1a['where'],{'$or':_[_0x8c44('0x3e')](_0xd060d5,function(_0x5e2c16){if(_0x5e2c16[_0x8c44('0x2d')]!==_0x8c44('0x3f')){var _0x4cf1d2={};_0x4cf1d2[_0x5e2c16[_0x8c44('0x29')]]={'$like':'%'+_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]+'%'};return _0x4cf1d2;}})});}_0x235a1a=_[_0x8c44('0x3d')]({},_0x235a1a,_0x2effcd['options']);var _0x1ccaa2={'where':_0x235a1a[_0x8c44('0x3a')]};return db['AnalyticCustomReport'][_0x8c44('0x1d')](_0x1ccaa2)[_0x8c44('0x24')](function(_0x81fa4e){_0x252d76[_0x8c44('0x1d')]=_0x81fa4e;if(_0x2effcd[_0x8c44('0x30')]['includeAll']){_0x235a1a[_0x8c44('0x40')]=[{'all':!![]}];}return db[_0x8c44('0x2a')][_0x8c44('0x41')](_0x235a1a);})['then'](function(_0x352a39){_0x252d76[_0x8c44('0x42')]=_0x352a39;return _0x252d76;})['then'](respondWithFilteredResult(_0x407d7a,_0x235a1a))['catch'](handleError(_0x407d7a,null));};exports[_0x8c44('0x43')]=function(_0x4628a4,_0x522d19){var _0x142d15={'raw':![],'where':{'id':_0x4628a4[_0x8c44('0x44')]['id']}},_0x2c2d23={};_0x2c2d23[_0x8c44('0x2f')]=_[_0x8c44('0x45')](db['AnalyticCustomReport'][_0x8c44('0x2b')]);_0x2c2d23['query']=_['keys'](_0x4628a4[_0x8c44('0x30')]);_0x2c2d23['filters']=_[_0x8c44('0x33')](_0x2c2d23[_0x8c44('0x2f')],_0x2c2d23['query']);_0x142d15[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x2c2d23['model'],qs[_0x8c44('0x34')](_0x4628a4['query'][_0x8c44('0x34')]));_0x142d15[_0x8c44('0x32')]=_0x142d15[_0x8c44('0x32')][_0x8c44('0x35')]?_0x142d15[_0x8c44('0x32')]:_0x2c2d23['model'];if(_0x4628a4[_0x8c44('0x30')][_0x8c44('0x46')]){_0x142d15[_0x8c44('0x40')]=[{'all':!![]}];}_0x142d15=_[_0x8c44('0x3d')]({},_0x142d15,_0x4628a4[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x142d15)[_0x8c44('0x24')](handleEntityNotFound(_0x522d19,null))['then'](respondWithResult(_0x522d19,null))[_0x8c44('0x49')](handleError(_0x522d19,null));};exports[_0x8c44('0x4a')]=function(_0x33cfb0,_0xfb831d){return db[_0x8c44('0x2a')]['create'](_0x33cfb0[_0x8c44('0x4b')],{})[_0x8c44('0x24')](function(_0x5e7d4a){var _0x48e72d=_0x33cfb0[_0x8c44('0x4c')]['get']({'plain':!![]});if(!_0x48e72d)throw new Error(_0x8c44('0x4d'));if(_0x48e72d[_0x8c44('0x4e')]==='user'){var _0x2445eb=_0x5e7d4a['get']({'plain':!![]});var _0xcceb0c=_0x8c44('0x4f');return db[_0x8c44('0x50')]['find']({'where':{'name':_0xcceb0c,'userProfileId':_0x48e72d[_0x8c44('0x51')]},'raw':!![]})[_0x8c44('0x24')](function(_0x32bd3d){if(_0x32bd3d&&_0x32bd3d[_0x8c44('0x52')]===0x0){return db[_0x8c44('0x26')][_0x8c44('0x4a')]({'name':_0x2445eb[_0x8c44('0x29')],'resourceId':_0x2445eb['id'],'type':_0x8c44('0x53'),'sectionId':_0x32bd3d['id']},{})[_0x8c44('0x24')](function(){return _0x5e7d4a;});}else{return _0x5e7d4a;}})[_0x8c44('0x49')](function(_0x18805a){logger[_0x8c44('0x27')](_0x8c44('0x54'),_0x18805a);throw _0x18805a;});}return _0x5e7d4a;})[_0x8c44('0x24')](respondWithResult(_0xfb831d,0xc9))['catch'](handleError(_0xfb831d,null));};exports['update']=function(_0x3f15b6,_0x2bd7c2){if(_0x3f15b6[_0x8c44('0x4b')]['id']){delete _0x3f15b6[_0x8c44('0x4b')]['id'];}return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x3f15b6['params']['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x2bd7c2,null))['then'](saveUpdates(_0x3f15b6[_0x8c44('0x4b')],null))[_0x8c44('0x24')](respondWithResult(_0x2bd7c2,null))['catch'](handleError(_0x2bd7c2,null));};exports[_0x8c44('0x23')]=function(_0x441e54,_0x5194c0){return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x441e54[_0x8c44('0x44')]['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x5194c0,null))[_0x8c44('0x24')](removeEntity(_0x5194c0,null))['catch'](handleError(_0x5194c0,null));};exports[_0x8c44('0x55')]=function(_0x5c4523,_0x384d79){var _0x3b0436=0xa;var _0x258f66=[_0x8c44('0x56'),_0x8c44('0x57'),_0x8c44('0x58'),_0x8c44('0x59')];var _0x348080={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ec0d0={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x18cdac=function(_0x4b6375){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),_0x8c44('0x64'),_0x8c44('0x65')],_0x4b6375);};var _0x39dd88=function(_0x5f5347){if(!_0x5f5347||!_0x5f5347['rules'][_0x8c44('0x35')]){return'';}for(var _0x43ae35='(',_0x43363d=0x0;_0x43363d<_0x5f5347[_0x8c44('0x66')][_0x8c44('0x35')];_0x43363d+=0x1){_0x43363d>0x0&&(_0x43ae35+='\x20'+_0x5f5347['operator']+'\x20');_0x43ae35+=_0x5f5347[_0x8c44('0x66')][_0x43363d]['group']?_0x39dd88(_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x67')]):_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x68')]+'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x69')]+(_0x18cdac(_0x5f5347['rules'][_0x43363d][_0x8c44('0x69')])?'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x6a')]:'');}return _0x43ae35+')';};var _0x38f929={'where':{'id':_0x5c4523[_0x8c44('0x44')]['id']}},_0x384015,_0x6fbeb0,_0x58653b,_0x54e07c,_0x4496fa;_0x38f929=_[_0x8c44('0x3d')]({},_0x38f929,_0x5c4523[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x38f929)[_0x8c44('0x24')](function(_0x334eea){if(_0x334eea){_0x384015=_0x334eea;return _0x334eea['getFields']();}return null;})[_0x8c44('0x24')](function(_0x550e3e){if(_0x550e3e){if(!_0x550e3e[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x6fbeb0=_0x550e3e;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x7d282d){if(_0x7d282d){_0x58653b=_[_0x8c44('0x6f')](_0x7d282d,'id');var _0x3f3486;var _0x87cbfd=squel['select']();_0x87cbfd['from'](_0x384015[_0x8c44('0x70')]);for(var _0x1e6750=0x0;_0x1e6750<_0x6fbeb0[_0x8c44('0x35')];_0x1e6750+=0x1){_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]?_0x58653b[_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]]['metric']:_0x6fbeb0[_0x1e6750]['field'];_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x72')]?_[_0x8c44('0x73')](_0x348080[_0x6fbeb0[_0x1e6750]['function']],'%s',_0x3f3486):_0x3f3486;_0x3f3486=_0x6fbeb0[_0x1e6750]['format']?_[_0x8c44('0x73')](_0x1ec0d0[_0x6fbeb0[_0x1e6750][_0x8c44('0x74')]],'%s',_0x3f3486):_0x3f3486;if(_0x6fbeb0[_0x1e6750]['groupBy']){_0x87cbfd[_0x8c44('0x67')](_0x3f3486);}_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]&&_0x87cbfd[_0x8c44('0x38')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x87cbfd[_0x8c44('0x68')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x77')]||_0x3f3486);}if(_0x384015[_0x8c44('0x78')]){_0x384015[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x384015['joins']);for(var _0x178a26=0x0;_0x178a26<_0x384015['joins'][_0x8c44('0x35')];_0x178a26+=0x1){if(_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x258f66,_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')])&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')]&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')]&&_0x384015[_0x8c44('0x78')][_0x178a26]['foreignKey']){_0x87cbfd[_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]](_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')],null,util[_0x8c44('0x74')](_0x8c44('0x7c'),_0x384015[_0x8c44('0x70')],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')],_0x384015[_0x8c44('0x78')][_0x178a26]['foreignTable'],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7d')]));}}}if(_0x384015[_0x8c44('0x7e')]){_0x384015[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x384015[_0x8c44('0x7e')]);_0x87cbfd[_0x8c44('0x3a')](_0x39dd88(_0x384015[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x4496fa=_0x87cbfd['clone']();_0x87cbfd[_0x8c44('0x1c')](_0x3b0436);_0x87cbfd[_0x8c44('0x1b')](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x87cbfd[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x87cbfd[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](respondWithResult(_0x384d79,null))[_0x8c44('0x49')](handleError(_0x384d79,null));};function runReport(_0x52b284,_0x1683e4,_0x190279){var _0x54f781=_0x1683e4[_0x8c44('0x29')];var _0x29e337=0xa;var _0x2b919e=[_0x8c44('0x56'),'left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x59af2b={'SUM':_0x8c44('0x84'),'COUNT':_0x8c44('0x85'),'COUNT DISTINCT':_0x8c44('0x86'),'MAX':_0x8c44('0x5a'),'MIN':_0x8c44('0x87'),'AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x490771={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d1172=function(_0x464eb2){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x464eb2);};var _0x2779e3=function(_0x432cbc){if(!_0x432cbc||!_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0xf06ab8='(',_0x4a1f39=0x0;_0x4a1f39<_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')];_0x4a1f39+=0x1){_0x4a1f39>0x0&&(_0xf06ab8+='\x20'+_0x432cbc['operator']+'\x20');_0xf06ab8+=_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]?_0x2779e3(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]):_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x68')]+'\x20'+_0x432cbc['rules'][_0x4a1f39][_0x8c44('0x69')]+(_0x2d1172(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x69')])?'\x20'+_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x6a')]:'');}return _0xf06ab8+')';};var _0x36392e={'where':{'id':_0x52b284['id']}},_0x1d7f49,_0x29d551,_0x14d747,_0x2a05cd,_0x5f5310;_0x36392e=_[_0x8c44('0x3d')]({},_0x36392e,_0x190279);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x36392e)[_0x8c44('0x24')](function(_0x15b389){if(_0x15b389){_0x1d7f49=_0x15b389;return _0x15b389[_0x8c44('0x8a')]();}return null;})[_0x8c44('0x24')](function(_0xb8a6bf){if(_0xb8a6bf){if(!_0xb8a6bf[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x29d551=_0xb8a6bf;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x1ef2da){if(_0x1ef2da){_0x14d747=_['keyBy'](_0x1ef2da,'id');var _0x3a57f4;var _0x1d6030=squel[_0x8c44('0x8b')]();_0x1d6030[_0x8c44('0x8c')](_0x1d7f49[_0x8c44('0x70')]);for(var _0x69f34b=0x0;_0x69f34b<_0x29d551[_0x8c44('0x35')];_0x69f34b+=0x1){_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x71')]?_0x14d747[_0x29d551[_0x69f34b]['MetricId']][_0x8c44('0x8d')]:_0x29d551[_0x69f34b][_0x8c44('0x68')];_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x72')]?_['replace'](_0x59af2b[_0x29d551[_0x69f34b][_0x8c44('0x72')]],'%s',_0x3a57f4):_0x3a57f4;_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x74')]?_['replace'](_0x490771[_0x29d551[_0x69f34b][_0x8c44('0x74')]],'%s',_0x3a57f4):_0x3a57f4;if(_0x29d551[_0x69f34b][_0x8c44('0x8e')]){_0x1d6030[_0x8c44('0x67')](_0x3a57f4);}_0x29d551[_0x69f34b]['orderBy']&&_0x1d6030[_0x8c44('0x38')](_0x3a57f4,_0x29d551[_0x69f34b]['orderBy']===_0x8c44('0x76')?![]:!![]);_0x1d6030[_0x8c44('0x68')](_0x3a57f4,_0x29d551[_0x69f34b][_0x8c44('0x77')]||_0x3a57f4);}if(_0x1d7f49[_0x8c44('0x78')]){_0x1d7f49['joins']=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x78')]);for(var _0x5cda5f=0x0;_0x5cda5f<_0x1d7f49[_0x8c44('0x78')]['length'];_0x5cda5f+=0x1){if(_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x2b919e,_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')])&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')]&&_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')]&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]){_0x1d6030[_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]](_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1d7f49[_0x8c44('0x70')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7b')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]));}}}if(_0x1d7f49[_0x8c44('0x7e')]){_0x1d7f49[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x7e')]);_0x1d6030[_0x8c44('0x3a')](_0x2779e3(_0x1d7f49[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x5f5310=_0x1d6030[_0x8c44('0x8f')]();_0x1d6030[_0x8c44('0x1c')](_0x29e337);_0x1d6030[_0x8c44('0x1b')](0x0);return;}})['then'](function(){if(_0x1683e4[_0x8c44('0x90')]==='web'){return null;}var _0x3e443a=_[_0x8c44('0x3d')](_0x1683e4,{'name':_0x1683e4[_0x8c44('0x91')]||_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],'basename':_0x54f781,'savename':util[_0x8c44('0x74')]('%s-%s.%s',_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],require('randomstring')[_0x8c44('0x92')](0x4),_0x1683e4[_0x8c44('0x90')]||_0x8c44('0x93')),'reportId':_0x1d7f49['id'],'reportType':_0x8c44('0x94')});return db[_0x8c44('0x95')][_0x8c44('0x4a')](_0x3e443a,{'raw':!![]});})[_0x8c44('0x24')](function(_0x32567b){if(_0x1d7f49['table']==='cdr'){_0x5f5310[_0x8c44('0x3a')](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x96'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}else{_0x5f5310['where'](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x99'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}if(_0x32567b){logger['info'](_0x8c44('0x9a'),_0x5f5310[_0x8c44('0x81')]());require('child_process')[_0x8c44('0x9b')](path['join'](__dirname,_0x8c44('0x9c'),_0x32567b[_0x8c44('0x90')]),[_0x32567b['id'],_0x5f5310[_0x8c44('0x81')](),path['join'](__dirname,'../../files/reports',_0x32567b['savename']),_0x54f781]);return _0x32567b;}else{var _0x4720a8=squel[_0x8c44('0x8b')]();_0x4720a8[_0x8c44('0x8c')]('('+_0x5f5310[_0x8c44('0x81')]()+')',_0x8c44('0x9d'));_0x4720a8['field'](_0x8c44('0x9e'),_0x8c44('0x1d'));_0x5f5310[_0x8c44('0x1c')](_0x1683e4['limit']||_0x29e337);_0x5f5310[_0x8c44('0x1b')](_0x1683e4[_0x8c44('0x1b')]||0x0);return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x4720a8['toString'](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]})[_0x8c44('0x24')](function(_0x18be19){if(!_0x18be19[_0x8c44('0x35')]){_0x2a05cd=0x0;}else{_0x2a05cd=_0x18be19[0x0][_0x8c44('0x1d')]||0x0;}return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x5f5310[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]});})[_0x8c44('0x24')](function(_0x3a27ba){return{'rows':_0x3a27ba||[],'count':_0x2a05cd};});}});}exports[_0x8c44('0xa0')]=function(_0x453929,_0xc5c110){return runReport(_0x453929[_0x8c44('0x44')],_0x453929[_0x8c44('0x30')],_0x453929[_0x8c44('0x47')])[_0x8c44('0x24')](respondWithResult(_0xc5c110,null))[_0x8c44('0x49')](handleError(_0xc5c110,null));};exports[_0x8c44('0xa1')]=runReport;exports[_0x8c44('0x30')]=function(_0x10d43e,_0x20679d){var _0x1c013e=0xa;var _0x23b957=['join','left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x4ccdbc={'SUM':_0x8c44('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x570cfb={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x23fde8=function(_0x1ea945){return!_['includes'](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY',_0x8c44('0x65')],_0x1ea945);};var _0x1df086=function(_0x2427fa){if(!_0x2427fa||!_0x2427fa[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0x25a9c7='(',_0x5ab2fb=0x0;_0x5ab2fb<_0x2427fa['rules'][_0x8c44('0x35')];_0x5ab2fb+=0x1){_0x5ab2fb>0x0&&(_0x25a9c7+='\x20'+_0x2427fa[_0x8c44('0xa2')]+'\x20');_0x25a9c7+=_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['group']?_0x1df086(_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x67')]):_0x2427fa[_0x8c44('0x66')][_0x5ab2fb][_0x8c44('0x68')]+'\x20'+_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x69')]+(_0x23fde8(_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['condition'])?'\x20'+_0x2427fa['rules'][_0x5ab2fb]['value']:'');}return _0x25a9c7+')';};var _0x22072b={'where':{'id':_0x10d43e[_0x8c44('0x44')]['id']}},_0x31675d,_0x54dc77,_0x394a08,_0x36231f,_0x1a30fa;_0x22072b=_[_0x8c44('0x3d')]({},_0x22072b,_0x10d43e[_0x8c44('0x47')]);return db['AnalyticCustomReport'][_0x8c44('0x48')](_0x22072b)['then'](function(_0x4bddd8){if(_0x4bddd8){_0x31675d=_0x4bddd8;return _0x4bddd8['getFields']();}return null;})['then'](function(_0x481df5){if(_0x481df5){if(!_0x481df5[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x54dc77=_0x481df5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x21c745){if(_0x21c745){_0x394a08=_[_0x8c44('0x6f')](_0x21c745,'id');var _0x4ce2d6;var _0x1a696d=squel[_0x8c44('0x8b')]();_0x1a696d[_0x8c44('0x8c')](_0x31675d[_0x8c44('0x70')]);for(var _0x58859b=0x0;_0x58859b<_0x54dc77[_0x8c44('0x35')];_0x58859b+=0x1){_0x4ce2d6=_0x54dc77[_0x58859b]['MetricId']?_0x394a08[_0x54dc77[_0x58859b]['MetricId']][_0x8c44('0x8d')]:_0x54dc77[_0x58859b][_0x8c44('0x68')];_0x4ce2d6=_0x54dc77[_0x58859b]['function']?_[_0x8c44('0x73')](_0x4ccdbc[_0x54dc77[_0x58859b][_0x8c44('0x72')]],'%s',_0x4ce2d6):_0x4ce2d6;_0x4ce2d6=_0x54dc77[_0x58859b][_0x8c44('0x74')]?_[_0x8c44('0x73')](_0x570cfb[_0x54dc77[_0x58859b][_0x8c44('0x74')]],'%s',_0x4ce2d6):_0x4ce2d6;if(_0x54dc77[_0x58859b][_0x8c44('0x8e')]){_0x1a696d[_0x8c44('0x67')](_0x4ce2d6);}_0x54dc77[_0x58859b][_0x8c44('0x75')]&&_0x1a696d[_0x8c44('0x38')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x1a696d[_0x8c44('0x68')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x77')]||_0x4ce2d6);}if(_0x31675d[_0x8c44('0x78')]){_0x31675d[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x78')]);for(var _0x35cb8c=0x0;_0x35cb8c<_0x31675d[_0x8c44('0x78')][_0x8c44('0x35')];_0x35cb8c+=0x1){if(_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x23b957,_0x31675d['joins'][_0x35cb8c][_0x8c44('0x2d')])&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7a')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7b')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]){_0x1a696d[_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]](_0x31675d[_0x8c44('0x78')][_0x35cb8c]['foreignTable'],null,util[_0x8c44('0x74')]('%s.%s\x20=\x20%s.%s',_0x31675d[_0x8c44('0x70')],_0x31675d['joins'][_0x35cb8c]['parentKey'],_0x31675d['joins'][_0x35cb8c][_0x8c44('0x7b')],_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]));}}}if(_0x31675d[_0x8c44('0x7e')]){_0x31675d['conditions']=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x7e')]);_0x1a696d[_0x8c44('0x3a')](_0x1df086(_0x31675d['conditions'][_0x8c44('0x67')]));}_0x1a30fa=_0x1a696d[_0x8c44('0x8f')]();_0x1a696d[_0x8c44('0x1c')](_0x1c013e);_0x1a696d['offset'](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x1a696d[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x1a696d[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](function(){return{'sql':_0x1a30fa[_0x8c44('0x81')]()};})['then'](respondWithResult(_0x20679d,null))[_0x8c44('0x49')](handleError(_0x20679d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 951019a..4f45295 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 _0x1078=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x57a4f3,_0xa978ac){var _0x16e7d2=function(_0x214142){while(--_0x214142){_0x57a4f3['push'](_0x57a4f3['shift']());}};_0x16e7d2(++_0xa978ac);}(_0x1078,0xff));var _0x8107=function(_0x3e8b0d,_0x42a07a){_0x3e8b0d=_0x3e8b0d-0x0;var _0x82951f=_0x1078[_0x3e8b0d];return _0x82951f;};'use strict';var _=require(_0x8107('0x0'));var util=require('util');var logger=require(_0x8107('0x1'))('api');var moment=require(_0x8107('0x2'));var BPromise=require(_0x8107('0x3'));var rp=require(_0x8107('0x4'));var fs=require('fs');var path=require(_0x8107('0x5'));var rimraf=require(_0x8107('0x6'));var config=require(_0x8107('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x8107('0x8')]=function(_0x4412b2,_0x4b0392){return _0x4412b2['define'](_0x8107('0x9'),attributes,{'tableName':_0x8107('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x703e=['AnalyticCustomReport','../../config/logger','api','request-promise','./analyticCustomReport.attributes','exports','define'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x703e,0xfd));var _0xe703=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x703e[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe703('0x0'))(_0xe703('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe703('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe703('0x3'));module[_0xe703('0x4')]=function(_0x26a166,_0x49cca5){return _0x26a166[_0xe703('0x5')](_0xe703('0x6'),attributes,{'tableName':'analytics_custom_reports','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 dbb2229..d6c72fc 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 _0x71a1=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x26b00e,_0x245a09){var _0x3764c3=function(_0x30fe77){while(--_0x30fe77){_0x26b00e['push'](_0x26b00e['shift']());}};_0x3764c3(++_0x245a09);}(_0x71a1,0x11c));var _0x171a=function(_0x49081c,_0x45d068){_0x49081c=_0x49081c-0x0;var _0x2da921=_0x71a1[_0x49081c];return _0x2da921;};'use strict';var _=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var moment=require(_0x171a('0x2'));var BPromise=require(_0x171a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x171a('0x4'));var db=require(_0x171a('0x5'))['db'];var utils=require(_0x171a('0x6'));var logger=require(_0x171a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x171a('0x8'));var client=jayson[_0x171a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d7f8c,_0x5e8980,_0x1a4570){return new BPromise(function(_0x5dae66,_0x496d70){return client[_0x171a('0xa')](_0x2d7f8c,_0x1a4570)[_0x171a('0xb')](function(_0x20b3f6){logger[_0x171a('0xc')](_0x171a('0xd'),_0x5e8980,_0x171a('0xe'));logger[_0x171a('0xf')](_0x171a('0x10'),_0x5e8980,_0x171a('0xe'),JSON[_0x171a('0x11')](_0x20b3f6));if(_0x20b3f6[_0x171a('0x12')]){if(_0x20b3f6[_0x171a('0x12')]['code']===0x1f4){logger['error'](_0x171a('0xd'),_0x5e8980,_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);return _0x496d70(_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);}logger[_0x171a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e8980,_0x20b3f6['error'][_0x171a('0x13')]);return _0x5dae66(_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);}else{logger['info'](_0x171a('0xd'),_0x5e8980,_0x171a('0xe'));_0x5dae66(_0x20b3f6['result'][_0x171a('0x13')]);}})[_0x171a('0x14')](function(_0x364611){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5e8980,_0x364611);_0x496d70(_0x364611);});});} \ No newline at end of file +var _0x59c3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x50604e,_0x28e40f){var _0x5bf0fa=function(_0x406aa2){while(--_0x406aa2){_0x50604e['push'](_0x50604e['shift']());}};_0x5bf0fa(++_0x28e40f);}(_0x59c3,0x110));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var moment=require(_0x359c('0x2'));var BPromise=require(_0x359c('0x3'));var rs=require(_0x359c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x359c('0x5'))['db'];var utils=require(_0x359c('0x6'));var logger=require(_0x359c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x359c('0x8'));var client=jayson[_0x359c('0x9')][_0x359c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4706,_0x3e0430,_0x483aa3){return new BPromise(function(_0x4a530f,_0x599d44){return client['request'](_0x2e4706,_0x483aa3)['then'](function(_0x405254){logger[_0x359c('0xb')](_0x359c('0xc'),_0x3e0430,_0x359c('0xd'));logger[_0x359c('0xe')](_0x359c('0xf'),_0x3e0430,'request\x20sent',JSON[_0x359c('0x10')](_0x405254));if(_0x405254[_0x359c('0x11')]){if(_0x405254[_0x359c('0x11')][_0x359c('0x12')]===0x1f4){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254[_0x359c('0x11')][_0x359c('0x13')]);return _0x599d44(_0x405254['error']['message']);}logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254['error'][_0x359c('0x13')]);return _0x4a530f(_0x405254['error']['message']);}else{logger[_0x359c('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3e0430,_0x359c('0xd'));_0x4a530f(_0x405254[_0x359c('0x14')]['message']);}})['catch'](function(_0xc8ddc9){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0xc8ddc9);_0x599d44(_0xc8ddc9);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e552358..d4ebd8f 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 _0x93f7=['/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x93f7,0x1c5));var _0x793f=function(_0x1a9aec,_0x21b537){_0x1a9aec=_0x1a9aec-0x0;var _0x375a51=_0x93f7[_0x1a9aec];return _0x375a51;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x793f('0x0'));var timeout=require('connect-timeout');var express=require(_0x793f('0x1'));var router=express[_0x793f('0x2')]();var fs_extra=require(_0x793f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x793f('0x4'));var controller=require(_0x793f('0x5'));router[_0x793f('0x6')]('/',auth[_0x793f('0x7')](),controller[_0x793f('0x8')]);router[_0x793f('0x6')](_0x793f('0x9'),auth[_0x793f('0x7')](),controller[_0x793f('0xa')]);router['get'](_0x793f('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x793f('0x6')](_0x793f('0xc'),auth[_0x793f('0x7')](),controller[_0x793f('0xd')]);router['get'](_0x793f('0xe'),auth[_0x793f('0x7')](),controller[_0x793f('0xf')]);router[_0x793f('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x793f('0x11')](_0x793f('0x9'),auth[_0x793f('0x7')](),controller['update']);router[_0x793f('0x12')]('/:id',auth[_0x793f('0x7')](),controller[_0x793f('0x13')]);module[_0x793f('0x14')]=router; \ No newline at end of file +var _0xd80d=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete'];(function(_0x40fec9,_0x2dac70){var _0x5842c2=function(_0x3dc0a2){while(--_0x3dc0a2){_0x40fec9['push'](_0x40fec9['shift']());}};_0x5842c2(++_0x2dac70);}(_0xd80d,0x147));var _0xdd80=function(_0x5d8a87,_0xec0615){_0x5d8a87=_0x5d8a87-0x0;var _0x3c2448=_0xd80d[_0x5d8a87];return _0x3c2448;};'use strict';var multer=require(_0xdd80('0x0'));var util=require(_0xdd80('0x1'));var path=require(_0xdd80('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd80('0x3'));var router=express[_0xdd80('0x4')]();var fs_extra=require(_0xdd80('0x5'));var auth=require(_0xdd80('0x6'));var interaction=require(_0xdd80('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xdd80('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd80('0x9')]);router[_0xdd80('0x8')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xc')]);router[_0xdd80('0x8')](_0xdd80('0xd'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xe')]);router[_0xdd80('0x8')](_0xdd80('0xf'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x10')]);router[_0xdd80('0x8')](_0xdd80('0x11'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x12')]);router[_0xdd80('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd80('0x14')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x15')]);router[_0xdd80('0x16')](_0xdd80('0xa'),auth['isAuthenticated'](),controller[_0xdd80('0x17')]);module[_0xdd80('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c29e8a5..cced836 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 _0xae24=['sequelize','STRING'];(function(_0x86c459,_0x426bd0){var _0xefa9ff=function(_0x168c67){while(--_0x168c67){_0x86c459['push'](_0x86c459['shift']());}};_0xefa9ff(++_0x426bd0);}(_0xae24,0x182));var _0x4ae2=function(_0xe35036,_0x529e36){_0xe35036=_0xe35036-0x0;var _0x4e47f0=_0xae24[_0xe35036];return _0x4e47f0;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0x30ec42,_0x3639e1){var _0x2d8415=function(_0x4dcb3c){while(--_0x4dcb3c){_0x30ec42['push'](_0x30ec42['shift']());}};_0x2d8415(++_0x3639e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x2eb2[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index c13472b..2b07641 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 _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x2869c1,_0x34d7ec){var _0x522a30=function(_0x2af3e7){while(--_0x2af3e7){_0x2869c1['push'](_0x2869c1['shift']());}};_0x522a30(++_0x34d7ec);}(_0x187d,0x93));var _0xd187=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x187d[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file +var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x1e332e,_0x4e3356){var _0x5dfe80=function(_0x3ba1cd){while(--_0x3ba1cd){_0x1e332e['push'](_0x1e332e['shift']());}};_0x5dfe80(++_0x4e3356);}(_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'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 0a7bd2f..e5face4 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 _0xbe2a=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x386858,_0x26deda){var _0x104a60=function(_0x499286){while(--_0x499286){_0x386858['push'](_0x386858['shift']());}};_0x104a60(++_0x26deda);}(_0xbe2a,0x93));var _0xabe2=function(_0x5b6c71,_0x578194){_0x5b6c71=_0x5b6c71-0x0;var _0x35029b=_0xbe2a[_0x5b6c71];return _0x35029b;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var logger=require(_0xabe2('0x2'))(_0xabe2('0x3'));var moment=require(_0xabe2('0x4'));var BPromise=require(_0xabe2('0x5'));var rp=require(_0xabe2('0x6'));var fs=require('fs');var path=require(_0xabe2('0x7'));var rimraf=require('rimraf');var config=require(_0xabe2('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xabe2('0x9')]=function(_0x3edb35,_0x3f08c8){return _0x3edb35[_0xabe2('0xa')](_0xabe2('0xb'),attributes,{'tableName':_0xabe2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad10=['AnalyticDefaultReport','analytics_default_reports','lodash','api','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x57eb92,_0x224768){var _0x13945e=function(_0x53fa51){while(--_0x53fa51){_0x57eb92['push'](_0x57eb92['shift']());}};_0x13945e(++_0x224768);}(_0xad10,0x156));var _0x0ad1=function(_0x5f99e1,_0x1ac016){_0x5f99e1=_0x5f99e1-0x0;var _0x3871a5=_0xad10[_0x5f99e1];return _0x3871a5;};'use strict';var _=require(_0x0ad1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad1('0x2'));var rimraf=require(_0x0ad1('0x3'));var config=require(_0x0ad1('0x4'));var attributes=require(_0x0ad1('0x5'));module[_0x0ad1('0x6')]=function(_0x19d9fd,_0x22898c){return _0x19d9fd[_0x0ad1('0x7')](_0x0ad1('0x8'),attributes,{'tableName':_0x0ad1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 12c8003..a72b03c 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 _0xf25b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util'];(function(_0x34793f,_0x59a6af){var _0x3a7e23=function(_0x29de0f){while(--_0x29de0f){_0x34793f['push'](_0x34793f['shift']());}};_0x3a7e23(++_0x59a6af);}(_0xf25b,0xc4));var _0xbf25=function(_0x450b29,_0x187d77){_0x450b29=_0x450b29-0x0;var _0x28df4f=_0xf25b[_0x450b29];return _0x28df4f;};'use strict';var _=require(_0xbf25('0x0'));var util=require(_0xbf25('0x1'));var moment=require('moment');var BPromise=require(_0xbf25('0x2'));var rs=require(_0xbf25('0x3'));var fs=require('fs');var Redis=require(_0xbf25('0x4'));var db=require(_0xbf25('0x5'))['db'];var utils=require(_0xbf25('0x6'));var logger=require('../../config/logger')(_0xbf25('0x7'));var config=require(_0xbf25('0x8'));var jayson=require(_0xbf25('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x140857,_0x30c468,_0x31f78e){return new BPromise(function(_0x5e6fd2,_0x783b18){return client[_0xbf25('0xa')](_0x140857,_0x31f78e)[_0xbf25('0xb')](function(_0x145ff2){logger[_0xbf25('0xc')](_0xbf25('0xd'),_0x30c468,_0xbf25('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x30c468,_0xbf25('0xe'),JSON['stringify'](_0x145ff2));if(_0x145ff2[_0xbf25('0xf')]){if(_0x145ff2['error'][_0xbf25('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x30c468,_0x145ff2['error'][_0xbf25('0x11')]);return _0x783b18(_0x145ff2['error']['message']);}logger[_0xbf25('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x30c468,_0x145ff2[_0xbf25('0xf')]['message']);return _0x5e6fd2(_0x145ff2[_0xbf25('0xf')][_0xbf25('0x11')]);}else{logger[_0xbf25('0xc')](_0xbf25('0xd'),_0x30c468,_0xbf25('0xe'));_0x5e6fd2(_0x145ff2['result'][_0xbf25('0x11')]);}})['catch'](function(_0x4cdd99){logger[_0xbf25('0xf')](_0xbf25('0xd'),_0x30c468,_0x4cdd99);_0x783b18(_0x4cdd99);});});} \ No newline at end of file +var _0xb115=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x4570d5,_0x115f91){var _0x314a34=function(_0x100d84){while(--_0x100d84){_0x4570d5['push'](_0x4570d5['shift']());}};_0x314a34(++_0x115f91);}(_0xb115,0x1c2));var _0x5b11=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb115[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5b11('0x0'));var util=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var rs=require(_0x5b11('0x4'));var fs=require('fs');var Redis=require(_0x5b11('0x5'));var db=require(_0x5b11('0x6'))['db'];var utils=require(_0x5b11('0x7'));var logger=require(_0x5b11('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b11('0x9'));var client=jayson[_0x5b11('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572f47,_0x489366,_0x33a530){return new BPromise(function(_0x2a737a,_0x4d94dc){return client[_0x5b11('0xb')](_0x572f47,_0x33a530)[_0x5b11('0xc')](function(_0x1627c8){logger[_0x5b11('0xd')](_0x5b11('0xe'),_0x489366,'request\x20sent');logger[_0x5b11('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'),JSON[_0x5b11('0x11')](_0x1627c8));if(_0x1627c8['error']){if(_0x1627c8[_0x5b11('0x12')][_0x5b11('0x13')]===0x1f4){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x4d94dc(_0x1627c8[_0x5b11('0x12')]['message']);}logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x2a737a(_0x1627c8['error'][_0x5b11('0x14')]);}else{logger[_0x5b11('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'));_0x2a737a(_0x1627c8['result']['message']);}})[_0x5b11('0x15')](function(_0x45bf30){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x45bf30);_0x4d94dc(_0x45bf30);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index cd1ca94..006367c 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 _0x5295=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','preview','run','/:id/query','query','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x5295,0x6c));var _0x5529=function(_0x23b93f,_0xbd249c){_0x23b93f=_0x23b93f-0x0;var _0x5794bc=_0x5295[_0x23b93f];return _0x5794bc;};'use strict';var multer=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var path=require(_0x5529('0x2'));var timeout=require(_0x5529('0x3'));var express=require(_0x5529('0x4'));var router=express[_0x5529('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5529('0x6'));var interaction=require(_0x5529('0x7'));var config=require(_0x5529('0x8'));var controller=require(_0x5529('0x9'));router[_0x5529('0xa')]('/',auth[_0x5529('0xb')](),controller['index']);router[_0x5529('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5529('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x5529('0xc')]);router[_0x5529('0xa')]('/:id/run',auth[_0x5529('0xb')](),controller[_0x5529('0xd')]);router[_0x5529('0xa')](_0x5529('0xe'),auth[_0x5529('0xb')](),controller[_0x5529('0xf')]);router[_0x5529('0x10')]('/',auth['isAuthenticated'](),controller[_0x5529('0x11')]);router[_0x5529('0x12')](_0x5529('0x13'),auth[_0x5529('0xb')](),controller[_0x5529('0x14')]);router[_0x5529('0x15')](_0x5529('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x5529('0x16')]=router; \ No newline at end of file +var _0xd6d1=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xd6d1,0x14a));var _0x1d6d=function(_0x294d69,_0xe46345){_0x294d69=_0x294d69-0x0;var _0x449951=_0xd6d1[_0x294d69];return _0x449951;};'use strict';var multer=require(_0x1d6d('0x0'));var util=require(_0x1d6d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d6d('0x2'));var router=express[_0x1d6d('0x3')]();var fs_extra=require(_0x1d6d('0x4'));var auth=require(_0x1d6d('0x5'));var interaction=require(_0x1d6d('0x6'));var config=require(_0x1d6d('0x7'));var controller=require(_0x1d6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d6d('0x9')](_0x1d6d('0xa'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xc')]);router[_0x1d6d('0x9')](_0x1d6d('0xd'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xe')]);router['get'](_0x1d6d('0xf'),auth[_0x1d6d('0xb')](),controller['run']);router[_0x1d6d('0x9')](_0x1d6d('0x10'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x11')]);router[_0x1d6d('0x12')]('/',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x13')]);router[_0x1d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1d6d('0x15')]);router[_0x1d6d('0x16')]('/:id',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x17')]);module[_0x1d6d('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 cb929d7..9af8a2e 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 _0xcb2f=['manual','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x4b3b5f,_0x2b3d54){var _0xfb1baf=function(_0x6ba288){while(--_0x6ba288){_0x4b3b5f['push'](_0x4b3b5f['shift']());}};_0xfb1baf(++_0x2b3d54);}(_0xcb2f,0x10f));var _0xfcb2=function(_0x34c00e,_0x4873a9){_0x34c00e=_0x34c00e-0x0;var _0x1e9548=_0xcb2f[_0x34c00e];return _0x1e9548;};'use strict';var Sequelize=require(_0xfcb2('0x0'));var moment=require('moment');module[_0xfcb2('0x1')]={'name':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfcb2('0x3')](_0xfcb2('0x4'),_0xfcb2('0x5'),_0xfcb2('0x6')),'allowNull':![],'defaultValue':_0xfcb2('0x4')},'savename':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfcb2('0x7')]},'endDate':{'type':Sequelize[_0xfcb2('0x7')]},'status':{'type':Sequelize[_0xfcb2('0x2')],'defaultValue':_0xfcb2('0x8')},'type':{'type':Sequelize[_0xfcb2('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xfcb2('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xfcb2('0x2')]}}; \ No newline at end of file +var _0xef46=['ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xef46,0x1b2));var _0x6ef4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xef46[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x6ef4('0x0'));var moment=require(_0x6ef4('0x1'));module[_0x6ef4('0x2')]={'name':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6ef4('0x4'),_0x6ef4('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x6ef4('0x4')},'savename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6ef4('0x6')]},'endDate':{'type':Sequelize[_0x6ef4('0x6')]},'status':{'type':Sequelize[_0x6ef4('0x3')],'defaultValue':_0x6ef4('0x7')},'type':{'type':Sequelize[_0x6ef4('0x8')](_0x6ef4('0x9'),_0x6ef4('0xa')),'allowNull':![],'defaultValue':_0x6ef4('0x9')},'reportId':{'type':Sequelize[_0x6ef4('0xb')](0xb)[_0x6ef4('0xc')]},'reportType':{'type':Sequelize[_0x6ef4('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5cecfdc..f538d3d 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 _0x2f28=['merge','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','join','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','%s.%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter'];(function(_0x5c585c,_0x284a29){var _0x14ea80=function(_0xe7bbec){while(--_0xe7bbec){_0x5c585c['push'](_0x5c585c['shift']());}};_0x14ea80(++_0x284a29);}(_0x2f28,0x192));var _0x82f2=function(_0x1d38be,_0x5a9cc6){_0x1d38be=_0x1d38be-0x0;var _0x254ab4=_0x2f28[_0x1d38be];return _0x254ab4;};'use strict';var emlformat=require(_0x82f2('0x0'));var rimraf=require(_0x82f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f2('0x2'));var rp=require('request-promise');var moment=require(_0x82f2('0x3'));var BPromise=require(_0x82f2('0x4'));var Mustache=require(_0x82f2('0x5'));var util=require('util');var path=require(_0x82f2('0x6'));var sox=require(_0x82f2('0x7'));var csv=require(_0x82f2('0x8'));var ejs=require(_0x82f2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82f2('0xa'));var squel=require(_0x82f2('0xb'));var crypto=require(_0x82f2('0xc'));var jsforce=require(_0x82f2('0xd'));var deskjs=require(_0x82f2('0xe'));var toCsv=require(_0x82f2('0x8'));var querystring=require(_0x82f2('0xf'));var Papa=require(_0x82f2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82f2('0x11'));var logger=require(_0x82f2('0x12'))(_0x82f2('0x13'));var utils=require(_0x82f2('0x14'));var config=require(_0x82f2('0x15'));var licenseUtil=require(_0x82f2('0x16'));var db=require(_0x82f2('0x17'))['db'];function respondWithStatusCode(_0x1ef00d,_0x4ff9ec){_0x4ff9ec=_0x4ff9ec||0xcc;return function(_0x463823){if(_0x463823){return _0x1ef00d[_0x82f2('0x18')](_0x4ff9ec);}return _0x1ef00d[_0x82f2('0x19')](_0x4ff9ec)[_0x82f2('0x1a')]();};}function respondWithResult(_0x494809,_0x17ca12){_0x17ca12=_0x17ca12||0xc8;return function(_0x1af885){if(_0x1af885){return _0x494809['status'](_0x17ca12)[_0x82f2('0x1b')](_0x1af885);}};}function respondWithFilteredResult(_0x399ead,_0x10a07d){return function(_0x17c434){if(_0x17c434){var _0x5ed86f=typeof _0x10a07d[_0x82f2('0x1c')]==='undefined'&&typeof _0x10a07d[_0x82f2('0x1d')]==='undefined';var _0x4d7980=_0x17c434[_0x82f2('0x1e')];var _0x38946a=_0x5ed86f?0x0:_0x10a07d[_0x82f2('0x1c')];var _0x4da754=_0x5ed86f?_0x17c434[_0x82f2('0x1e')]:_0x10a07d[_0x82f2('0x1c')]+_0x10a07d[_0x82f2('0x1d')];var _0x222958;if(_0x4da754>=_0x4d7980){_0x4da754=_0x4d7980;_0x222958=0xc8;}else{_0x222958=0xce;}_0x399ead[_0x82f2('0x19')](_0x222958);return _0x399ead[_0x82f2('0x1f')]('Content-Range',_0x38946a+'-'+_0x4da754+'/'+_0x4d7980)['json'](_0x17c434);}return null;};}function patchUpdates(_0x549134){return function(_0x23a1fa){try{jsonpatch[_0x82f2('0x20')](_0x23a1fa,_0x549134,!![]);}catch(_0x54c84e){return BPromise[_0x82f2('0x21')](_0x54c84e);}return _0x23a1fa[_0x82f2('0x22')]();};}function saveUpdates(_0x120834,_0x1fba22){return function(_0x1b396b){if(_0x1b396b){return _0x1b396b[_0x82f2('0x23')](_0x120834)[_0x82f2('0x24')](function(_0x2b08b3){return _0x2b08b3;});}return null;};}function removeEntity(_0x4a0f4d,_0x56c5dd){return function(_0x364067){if(_0x364067){return _0x364067[_0x82f2('0x25')]()[_0x82f2('0x24')](function(){var _0x123620=_0x364067[_0x82f2('0x26')]({'plain':!![]});var _0x4b61cf='ExtractedReports';return db['UserProfileResource'][_0x82f2('0x25')]({'where':{'type':_0x4b61cf,'resourceId':_0x123620['id']}})[_0x82f2('0x24')](function(){return _0x364067;});})[_0x82f2('0x24')](function(){_0x4a0f4d['status'](0xcc)[_0x82f2('0x1a')]();});}};}function handleEntityNotFound(_0x215d9e,_0xc53486){return function(_0x4cf013){if(!_0x4cf013){_0x215d9e['sendStatus'](0x194);}return _0x4cf013;};}function handleError(_0x40c8b3,_0x3ec7f9){_0x3ec7f9=_0x3ec7f9||0x1f4;return function(_0x43a5e4){logger[_0x82f2('0x27')](_0x43a5e4[_0x82f2('0x28')]);if(_0x43a5e4[_0x82f2('0x29')]){delete _0x43a5e4['name'];}_0x40c8b3[_0x82f2('0x19')](_0x3ec7f9)[_0x82f2('0x2a')](_0x43a5e4);};}exports['index']=function(_0x5a0720,_0x1d8917){var _0x51a381={},_0x1b475f={},_0x27d7fe={'count':0x0,'rows':[]};var _0xf89ae4=_[_0x82f2('0x2b')](db['AnalyticExtractedReport'][_0x82f2('0x2c')],function(_0x4b9ebd){return{'name':_0x4b9ebd[_0x82f2('0x2d')],'type':_0x4b9ebd[_0x82f2('0x2e')][_0x82f2('0x2f')]};});_0x1b475f[_0x82f2('0x30')]=_['map'](_0xf89ae4,'name');_0x1b475f[_0x82f2('0x31')]=_[_0x82f2('0x32')](_0x5a0720[_0x82f2('0x31')]);_0x1b475f[_0x82f2('0x33')]=_[_0x82f2('0x34')](_0x1b475f[_0x82f2('0x30')],_0x1b475f['query']);_0x51a381[_0x82f2('0x35')]=_['intersection'](_0x1b475f[_0x82f2('0x30')],qs['fields'](_0x5a0720[_0x82f2('0x31')]['fields']));_0x51a381[_0x82f2('0x35')]=_0x51a381[_0x82f2('0x35')][_0x82f2('0x36')]?_0x51a381[_0x82f2('0x35')]:_0x1b475f[_0x82f2('0x30')];if(!_0x5a0720['query']['hasOwnProperty']('nolimit')){_0x51a381[_0x82f2('0x1d')]=qs[_0x82f2('0x1d')](_0x5a0720['query'][_0x82f2('0x1d')]);_0x51a381[_0x82f2('0x1c')]=qs[_0x82f2('0x1c')](_0x5a0720[_0x82f2('0x31')][_0x82f2('0x1c')]);}_0x51a381['order']=qs[_0x82f2('0x37')](_0x5a0720[_0x82f2('0x31')][_0x82f2('0x37')]);_0x51a381[_0x82f2('0x38')]=qs['filters'](_['pick'](_0x5a0720[_0x82f2('0x31')],_0x1b475f[_0x82f2('0x33')]),_0xf89ae4);if(_0x5a0720[_0x82f2('0x31')][_0x82f2('0x39')]){_0x51a381['where']=_[_0x82f2('0x3a')](_0x51a381[_0x82f2('0x38')],{'$or':_[_0x82f2('0x2b')](_0xf89ae4,function(_0xef74e2){if(_0xef74e2[_0x82f2('0x2e')]!=='VIRTUAL'){var _0x6fae50={};_0x6fae50[_0xef74e2[_0x82f2('0x29')]]={'$like':'%'+_0x5a0720[_0x82f2('0x31')][_0x82f2('0x39')]+'%'};return _0x6fae50;}})});}_0x51a381=_[_0x82f2('0x3a')]({},_0x51a381,_0x5a0720['options']);var _0x51e77e={'where':_0x51a381['where']};return db[_0x82f2('0x3b')][_0x82f2('0x1e')](_0x51e77e)['then'](function(_0x1eda7b){_0x27d7fe[_0x82f2('0x1e')]=_0x1eda7b;if(_0x5a0720['query'][_0x82f2('0x3c')]){_0x51a381[_0x82f2('0x3d')]=[{'all':!![]}];}return db[_0x82f2('0x3b')][_0x82f2('0x3e')](_0x51a381);})[_0x82f2('0x24')](function(_0x2a765){_0x27d7fe['rows']=_0x2a765;return _0x27d7fe;})[_0x82f2('0x24')](respondWithFilteredResult(_0x1d8917,_0x51a381))[_0x82f2('0x3f')](handleError(_0x1d8917,null));};exports[_0x82f2('0x40')]=function(_0x2c076a,_0x57f035){var _0x2fb4b9={'raw':!![],'where':{'id':_0x2c076a[_0x82f2('0x41')]['id']}},_0x56dd6f={};_0x56dd6f['model']=_['keys'](db[_0x82f2('0x3b')]['rawAttributes']);_0x56dd6f[_0x82f2('0x31')]=_['keys'](_0x2c076a[_0x82f2('0x31')]);_0x56dd6f['filters']=_[_0x82f2('0x34')](_0x56dd6f['model'],_0x56dd6f[_0x82f2('0x31')]);_0x2fb4b9[_0x82f2('0x35')]=_[_0x82f2('0x34')](_0x56dd6f[_0x82f2('0x30')],qs['fields'](_0x2c076a[_0x82f2('0x31')][_0x82f2('0x42')]));_0x2fb4b9[_0x82f2('0x35')]=_0x2fb4b9[_0x82f2('0x35')]['length']?_0x2fb4b9[_0x82f2('0x35')]:_0x56dd6f[_0x82f2('0x30')];if(_0x2c076a[_0x82f2('0x31')][_0x82f2('0x3c')]){_0x2fb4b9['include']=[{'all':!![]}];}_0x2fb4b9=_['merge']({},_0x2fb4b9,_0x2c076a[_0x82f2('0x43')]);return db['AnalyticExtractedReport'][_0x82f2('0x44')](_0x2fb4b9)[_0x82f2('0x24')](handleEntityNotFound(_0x57f035,null))[_0x82f2('0x24')](respondWithResult(_0x57f035,null))[_0x82f2('0x3f')](handleError(_0x57f035,null));};exports[_0x82f2('0x45')]=function(_0x53cec8,_0xc0daf9){return db[_0x82f2('0x3b')][_0x82f2('0x45')](_0x53cec8[_0x82f2('0x46')],{})['then'](function(_0x5739d9){var _0x313222=_0x53cec8['user'][_0x82f2('0x26')]({'plain':!![]});if(!_0x313222)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x313222[_0x82f2('0x47')]===_0x82f2('0x48')){var _0x100a60=_0x5739d9[_0x82f2('0x26')]({'plain':!![]});var _0xb9dbb4=_0x82f2('0x49');return db[_0x82f2('0x4a')][_0x82f2('0x44')]({'where':{'name':_0xb9dbb4,'userProfileId':_0x313222[_0x82f2('0x4b')]},'raw':!![]})[_0x82f2('0x24')](function(_0x495bcf){if(_0x495bcf&&_0x495bcf[_0x82f2('0x4c')]===0x0){return db[_0x82f2('0x4d')][_0x82f2('0x45')]({'name':_0x100a60[_0x82f2('0x29')],'resourceId':_0x100a60['id'],'type':_0x495bcf[_0x82f2('0x29')],'sectionId':_0x495bcf['id']},{})[_0x82f2('0x24')](function(){return _0x5739d9;});}else{return _0x5739d9;}})[_0x82f2('0x3f')](function(_0x344c97){logger[_0x82f2('0x27')](_0x82f2('0x4e'),_0x344c97);throw _0x344c97;});}return _0x5739d9;})['then'](respondWithResult(_0xc0daf9,0xc9))[_0x82f2('0x3f')](handleError(_0xc0daf9,null));};exports[_0x82f2('0x23')]=function(_0x3d656a,_0x5ccf2c){if(_0x3d656a[_0x82f2('0x46')]['id']){delete _0x3d656a['body']['id'];}return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x3d656a[_0x82f2('0x41')]['id']}})[_0x82f2('0x24')](handleEntityNotFound(_0x5ccf2c,null))[_0x82f2('0x24')](saveUpdates(_0x3d656a[_0x82f2('0x46')],null))[_0x82f2('0x24')](respondWithResult(_0x5ccf2c,null))[_0x82f2('0x3f')](handleError(_0x5ccf2c,null));};exports[_0x82f2('0x25')]=function(_0x4cc342,_0x1f6572){return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x4cc342['params']['id']}})[_0x82f2('0x24')](handleEntityNotFound(_0x1f6572,null))[_0x82f2('0x24')](removeEntity(_0x1f6572,null))[_0x82f2('0x3f')](handleError(_0x1f6572,null));};exports['download']=function(_0x1df177,_0xffb473,_0x30b993){return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x1df177[_0x82f2('0x41')]['id']},'attributes':[_0x82f2('0x29'),_0x82f2('0x4f'),'savename',_0x82f2('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0xffb473,null))[_0x82f2('0x24')](function(_0x47c93d){if(_0x47c93d){if(!fs[_0x82f2('0x51')](path[_0x82f2('0x52')](config['root'],_0x82f2('0x53'),_0x47c93d[_0x82f2('0x54')]))){throw new db['Sequelize'][(_0x82f2('0x55'))](_0x82f2('0x56'));}if(_0x1df177[_0x82f2('0x31')][_0x82f2('0x57')]){return _0xffb473[_0x82f2('0x18')](0xc8);}return _0xffb473[_0x82f2('0x58')](path[_0x82f2('0x52')](config[_0x82f2('0x59')],_0x82f2('0x53'),_0x47c93d[_0x82f2('0x54')]),util[_0x82f2('0x5a')](_0x82f2('0x5b'),_0x47c93d[_0x82f2('0x4f')]||_0x47c93d[_0x82f2('0x29')],_0x47c93d[_0x82f2('0x50')]['toLowerCase']()));}})[_0x82f2('0x3f')](handleError(_0xffb473,null));}; \ No newline at end of file +var _0xa42d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','basename','eml-format','zip-dir'];(function(_0x579711,_0x389871){var _0x2d8333=function(_0x25b06d){while(--_0x25b06d){_0x579711['push'](_0x579711['shift']());}};_0x2d8333(++_0x389871);}(_0xa42d,0x18a));var _0xda42=function(_0x41c5b9,_0xdbbeb7){_0x41c5b9=_0x41c5b9-0x0;var _0x2c3ab2=_0xa42d[_0x41c5b9];return _0x2c3ab2;};'use strict';var emlformat=require(_0xda42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda42('0x2'));var moment=require(_0xda42('0x3'));var BPromise=require(_0xda42('0x4'));var Mustache=require(_0xda42('0x5'));var util=require(_0xda42('0x6'));var path=require(_0xda42('0x7'));var sox=require(_0xda42('0x8'));var csv=require(_0xda42('0x9'));var ejs=require(_0xda42('0xa'));var fs=require('fs');var fs_extra=require(_0xda42('0xb'));var _=require('lodash');var squel=require(_0xda42('0xc'));var crypto=require(_0xda42('0xd'));var jsforce=require(_0xda42('0xe'));var deskjs=require(_0xda42('0xf'));var toCsv=require(_0xda42('0x9'));var querystring=require(_0xda42('0x10'));var Papa=require(_0xda42('0x11'));var Redis=require(_0xda42('0x12'));var authService=require(_0xda42('0x13'));var qs=require(_0xda42('0x14'));var as=require(_0xda42('0x15'));var hardwareService=require(_0xda42('0x16'));var logger=require(_0xda42('0x17'))(_0xda42('0x18'));var utils=require(_0xda42('0x19'));var config=require(_0xda42('0x1a'));var licenseUtil=require(_0xda42('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545661,_0x45d3c9){_0x45d3c9=_0x45d3c9||0xcc;return function(_0x53105d){if(_0x53105d){return _0x545661[_0xda42('0x1c')](_0x45d3c9);}return _0x545661[_0xda42('0x1d')](_0x45d3c9)['end']();};}function respondWithResult(_0x18cad0,_0x50ecd6){_0x50ecd6=_0x50ecd6||0xc8;return function(_0x3c689b){if(_0x3c689b){return _0x18cad0[_0xda42('0x1d')](_0x50ecd6)[_0xda42('0x1e')](_0x3c689b);}};}function respondWithFilteredResult(_0x409325,_0x2c24ec){return function(_0x3e282c){if(_0x3e282c){var _0xe8cc03=typeof _0x2c24ec[_0xda42('0x1f')]===_0xda42('0x20')&&typeof _0x2c24ec[_0xda42('0x21')]==='undefined';var _0xfc85ce=_0x3e282c['count'];var _0x24a5a4=_0xe8cc03?0x0:_0x2c24ec['offset'];var _0x1636ec=_0xe8cc03?_0x3e282c[_0xda42('0x22')]:_0x2c24ec[_0xda42('0x1f')]+_0x2c24ec[_0xda42('0x21')];var _0x4856a0;if(_0x1636ec>=_0xfc85ce){_0x1636ec=_0xfc85ce;_0x4856a0=0xc8;}else{_0x4856a0=0xce;}_0x409325['status'](_0x4856a0);return _0x409325[_0xda42('0x23')]('Content-Range',_0x24a5a4+'-'+_0x1636ec+'/'+_0xfc85ce)['json'](_0x3e282c);}return null;};}function patchUpdates(_0x11277c){return function(_0x10217c){try{jsonpatch[_0xda42('0x24')](_0x10217c,_0x11277c,!![]);}catch(_0x30b395){return BPromise['reject'](_0x30b395);}return _0x10217c['save']();};}function saveUpdates(_0x13093c,_0xe65842){return function(_0x2fffc2){if(_0x2fffc2){return _0x2fffc2[_0xda42('0x25')](_0x13093c)[_0xda42('0x26')](function(_0x3c913a){return _0x3c913a;});}return null;};}function removeEntity(_0x30eba5,_0x225b78){return function(_0x386569){if(_0x386569){return _0x386569[_0xda42('0x27')]()['then'](function(){var _0x28b18b=_0x386569[_0xda42('0x28')]({'plain':!![]});var _0x4411c9=_0xda42('0x29');return db[_0xda42('0x2a')][_0xda42('0x27')]({'where':{'type':_0x4411c9,'resourceId':_0x28b18b['id']}})[_0xda42('0x26')](function(){return _0x386569;});})['then'](function(){_0x30eba5[_0xda42('0x1d')](0xcc)[_0xda42('0x2b')]();});}};}function handleEntityNotFound(_0x8f8238,_0x232c74){return function(_0x1be843){if(!_0x1be843){_0x8f8238['sendStatus'](0x194);}return _0x1be843;};}function handleError(_0x314d8a,_0x1fa61c){_0x1fa61c=_0x1fa61c||0x1f4;return function(_0x5e466d){logger[_0xda42('0x2c')](_0x5e466d[_0xda42('0x2d')]);if(_0x5e466d['name']){delete _0x5e466d[_0xda42('0x2e')];}_0x314d8a[_0xda42('0x1d')](_0x1fa61c)[_0xda42('0x2f')](_0x5e466d);};}exports[_0xda42('0x30')]=function(_0x51f4b8,_0x3c04a6){var _0x5d3785={},_0x27351f={},_0x26fe9c={'count':0x0,'rows':[]};var _0x3cf235=_['map'](db[_0xda42('0x31')][_0xda42('0x32')],function(_0x3ed591){return{'name':_0x3ed591[_0xda42('0x33')],'type':_0x3ed591[_0xda42('0x34')][_0xda42('0x35')]};});_0x27351f[_0xda42('0x36')]=_[_0xda42('0x37')](_0x3cf235,_0xda42('0x2e'));_0x27351f[_0xda42('0x38')]=_['keys'](_0x51f4b8[_0xda42('0x38')]);_0x27351f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],_0x27351f[_0xda42('0x38')]);_0x5d3785[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],qs['fields'](_0x51f4b8['query'][_0xda42('0x3c')]));_0x5d3785[_0xda42('0x3b')]=_0x5d3785[_0xda42('0x3b')][_0xda42('0x3d')]?_0x5d3785[_0xda42('0x3b')]:_0x27351f[_0xda42('0x36')];if(!_0x51f4b8['query'][_0xda42('0x3e')](_0xda42('0x3f'))){_0x5d3785[_0xda42('0x21')]=qs[_0xda42('0x21')](_0x51f4b8[_0xda42('0x38')]['limit']);_0x5d3785[_0xda42('0x1f')]=qs[_0xda42('0x1f')](_0x51f4b8[_0xda42('0x38')][_0xda42('0x1f')]);}_0x5d3785[_0xda42('0x40')]=qs[_0xda42('0x41')](_0x51f4b8[_0xda42('0x38')]['sort']);_0x5d3785[_0xda42('0x42')]=qs['filters'](_[_0xda42('0x43')](_0x51f4b8[_0xda42('0x38')],_0x27351f[_0xda42('0x39')]),_0x3cf235);if(_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]){_0x5d3785[_0xda42('0x42')]=_[_0xda42('0x45')](_0x5d3785[_0xda42('0x42')],{'$or':_[_0xda42('0x37')](_0x3cf235,function(_0x1db34f){if(_0x1db34f[_0xda42('0x34')]!==_0xda42('0x46')){var _0x4336f7={};_0x4336f7[_0x1db34f[_0xda42('0x2e')]]={'$like':'%'+_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]+'%'};return _0x4336f7;}})});}_0x5d3785=_[_0xda42('0x45')]({},_0x5d3785,_0x51f4b8[_0xda42('0x47')]);var _0x2d60d2={'where':_0x5d3785[_0xda42('0x42')]};return db['AnalyticExtractedReport'][_0xda42('0x22')](_0x2d60d2)[_0xda42('0x26')](function(_0x1bdf76){_0x26fe9c[_0xda42('0x22')]=_0x1bdf76;if(_0x51f4b8[_0xda42('0x38')]['includeAll']){_0x5d3785['include']=[{'all':!![]}];}return db[_0xda42('0x31')][_0xda42('0x48')](_0x5d3785);})[_0xda42('0x26')](function(_0x242ddc){_0x26fe9c['rows']=_0x242ddc;return _0x26fe9c;})[_0xda42('0x26')](respondWithFilteredResult(_0x3c04a6,_0x5d3785))[_0xda42('0x49')](handleError(_0x3c04a6,null));};exports[_0xda42('0x4a')]=function(_0x52b409,_0x544d26){var _0x4d0f37={'raw':!![],'where':{'id':_0x52b409[_0xda42('0x4b')]['id']}},_0xbdaf3f={};_0xbdaf3f['model']=_[_0xda42('0x4c')](db['AnalyticExtractedReport'][_0xda42('0x32')]);_0xbdaf3f[_0xda42('0x38')]=_[_0xda42('0x4c')](_0x52b409[_0xda42('0x38')]);_0xbdaf3f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0xbdaf3f['model'],_0xbdaf3f[_0xda42('0x38')]);_0x4d0f37[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0xbdaf3f[_0xda42('0x36')],qs[_0xda42('0x3c')](_0x52b409[_0xda42('0x38')][_0xda42('0x3c')]));_0x4d0f37['attributes']=_0x4d0f37[_0xda42('0x3b')]['length']?_0x4d0f37[_0xda42('0x3b')]:_0xbdaf3f['model'];if(_0x52b409[_0xda42('0x38')][_0xda42('0x4d')]){_0x4d0f37[_0xda42('0x4e')]=[{'all':!![]}];}_0x4d0f37=_[_0xda42('0x45')]({},_0x4d0f37,_0x52b409[_0xda42('0x47')]);return db[_0xda42('0x31')][_0xda42('0x4f')](_0x4d0f37)['then'](handleEntityNotFound(_0x544d26,null))[_0xda42('0x26')](respondWithResult(_0x544d26,null))['catch'](handleError(_0x544d26,null));};exports[_0xda42('0x50')]=function(_0x5e0e0f,_0x5150fd){return db[_0xda42('0x31')][_0xda42('0x50')](_0x5e0e0f[_0xda42('0x51')],{})['then'](function(_0x4e01cf){var _0x5c80b7=_0x5e0e0f[_0xda42('0x52')]['get']({'plain':!![]});if(!_0x5c80b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c80b7[_0xda42('0x53')]===_0xda42('0x52')){var _0x293304=_0x4e01cf[_0xda42('0x28')]({'plain':!![]});var _0x333101='ExtractedReports';return db[_0xda42('0x54')][_0xda42('0x4f')]({'where':{'name':_0x333101,'userProfileId':_0x5c80b7[_0xda42('0x55')]},'raw':!![]})[_0xda42('0x26')](function(_0x11fe55){if(_0x11fe55&&_0x11fe55[_0xda42('0x56')]===0x0){return db['UserProfileResource'][_0xda42('0x50')]({'name':_0x293304[_0xda42('0x2e')],'resourceId':_0x293304['id'],'type':_0x11fe55[_0xda42('0x2e')],'sectionId':_0x11fe55['id']},{})[_0xda42('0x26')](function(){return _0x4e01cf;});}else{return _0x4e01cf;}})[_0xda42('0x49')](function(_0x50bb8a){logger['error'](_0xda42('0x57'),_0x50bb8a);throw _0x50bb8a;});}return _0x4e01cf;})[_0xda42('0x26')](respondWithResult(_0x5150fd,0xc9))['catch'](handleError(_0x5150fd,null));};exports['update']=function(_0x7e9273,_0xe4e51e){if(_0x7e9273[_0xda42('0x51')]['id']){delete _0x7e9273[_0xda42('0x51')]['id'];}return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x7e9273[_0xda42('0x4b')]['id']}})[_0xda42('0x26')](handleEntityNotFound(_0xe4e51e,null))['then'](saveUpdates(_0x7e9273[_0xda42('0x51')],null))['then'](respondWithResult(_0xe4e51e,null))['catch'](handleError(_0xe4e51e,null));};exports['destroy']=function(_0x5bfce2,_0x502124){return db['AnalyticExtractedReport'][_0xda42('0x4f')]({'where':{'id':_0x5bfce2[_0xda42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x502124,null))['then'](removeEntity(_0x502124,null))[_0xda42('0x49')](handleError(_0x502124,null));};exports[_0xda42('0x58')]=function(_0x33adb6,_0x299a4c,_0x3474ab){return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x33adb6[_0xda42('0x4b')]['id']},'attributes':['name','basename',_0xda42('0x59'),_0xda42('0x5a')],'raw':!![]})[_0xda42('0x26')](handleEntityNotFound(_0x299a4c,null))[_0xda42('0x26')](function(_0x5e70a9){if(_0x5e70a9){if(!fs['existsSync'](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']))){throw new db[(_0xda42('0x5d'))][(_0xda42('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x33adb6[_0xda42('0x38')][_0xda42('0x5f')]){return _0x299a4c[_0xda42('0x1c')](0xc8);}return _0x299a4c[_0xda42('0x58')](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']),util[_0xda42('0x60')](_0xda42('0x61'),_0x5e70a9[_0xda42('0x62')]||_0x5e70a9[_0xda42('0x2e')],_0x5e70a9[_0xda42('0x5a')]['toLowerCase']()));}})[_0xda42('0x49')](handleError(_0x299a4c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 3263b57..9f4a342 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 _0x010b=['../../config/logger','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4b9459,_0x4460b2){var _0x21717b=function(_0x53b39a){while(--_0x53b39a){_0x4b9459['push'](_0x4b9459['shift']());}};_0x21717b(++_0x4460b2);}(_0x010b,0x127));var _0xb010=function(_0x5cbc9f,_0x75250b){_0x5cbc9f=_0x5cbc9f-0x0;var _0x21e0a7=_0x010b[_0x5cbc9f];return _0x21e0a7;};'use strict';var _=require(_0xb010('0x0'));var util=require(_0xb010('0x1'));var logger=require(_0xb010('0x2'))('api');var moment=require(_0xb010('0x3'));var BPromise=require('bluebird');var rp=require(_0xb010('0x4'));var fs=require('fs');var path=require(_0xb010('0x5'));var rimraf=require(_0xb010('0x6'));var config=require('../../config/environment');var attributes=require(_0xb010('0x7'));module['exports']=function(_0x1f5d05,_0x50658c){return _0x1f5d05[_0xb010('0x8')](_0xb010('0x9'),attributes,{'tableName':_0xb010('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5748=['moment','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x4ec80b,_0x324203){var _0x187bc7=function(_0x4a8e8a){while(--_0x4a8e8a){_0x4ec80b['push'](_0x4ec80b['shift']());}};_0x187bc7(++_0x324203);}(_0x5748,0x1d2));var _0x8574=function(_0x56b7dc,_0x5a2857){_0x56b7dc=_0x56b7dc-0x0;var _0x31a8dd=_0x5748[_0x56b7dc];return _0x31a8dd;};'use strict';var _=require(_0x8574('0x0'));var util=require(_0x8574('0x1'));var logger=require(_0x8574('0x2'))(_0x8574('0x3'));var moment=require(_0x8574('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8574('0x5'));var config=require(_0x8574('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x8574('0x7')]=function(_0x40738f,_0x4c419d){return _0x40738f['define'](_0x8574('0x8'),attributes,{'tableName':_0x8574('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 03a0ed0..74e1dcd 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 _0x8ca9=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0x238cec,_0x2ad1ad){var _0x654aa9=function(_0x2a00c0){while(--_0x2a00c0){_0x238cec['push'](_0x238cec['shift']());}};_0x654aa9(++_0x2ad1ad);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x8d0f51,_0x386e61){_0x8d0f51=_0x8d0f51-0x0;var _0x3166e7=_0x8ca9[_0x8d0f51];return _0x3166e7;};'use strict';var _=require('lodash');var util=require(_0x98ca('0x0'));var moment=require(_0x98ca('0x1'));var BPromise=require(_0x98ca('0x2'));var rs=require(_0x98ca('0x3'));var fs=require('fs');var Redis=require(_0x98ca('0x4'));var db=require(_0x98ca('0x5'))['db'];var utils=require(_0x98ca('0x6'));var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson[_0x98ca('0x9')][_0x98ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55aa2e,_0x5f57b3,_0x58aa49){return new BPromise(function(_0x29f20d,_0x7166c6){return client['request'](_0x55aa2e,_0x58aa49)[_0x98ca('0xb')](function(_0xfd452b){logger[_0x98ca('0xc')](_0x98ca('0xd'),_0x5f57b3,_0x98ca('0xe'));logger[_0x98ca('0xf')](_0x98ca('0x10'),_0x5f57b3,_0x98ca('0xe'),JSON['stringify'](_0xfd452b));if(_0xfd452b[_0x98ca('0x11')]){if(_0xfd452b[_0x98ca('0x11')][_0x98ca('0x12')]===0x1f4){logger[_0x98ca('0x11')](_0x98ca('0xd'),_0x5f57b3,_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);return _0x7166c6(_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);}logger[_0x98ca('0x11')](_0x98ca('0xd'),_0x5f57b3,_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);return _0x29f20d(_0xfd452b['error'][_0x98ca('0x13')]);}else{logger[_0x98ca('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f57b3,'request\x20sent');_0x29f20d(_0xfd452b['result']['message']);}})[_0x98ca('0x14')](function(_0x4f176b){logger['error'](_0x98ca('0xd'),_0x5f57b3,_0x4f176b);_0x7166c6(_0x4f176b);});});} \ No newline at end of file +var _0x4ed8=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x50ba3a,_0x2afbd0){var _0x5a8554=function(_0x26e2d8){while(--_0x26e2d8){_0x50ba3a['push'](_0x50ba3a['shift']());}};_0x5a8554(++_0x2afbd0);}(_0x4ed8,0xc9));var _0x84ed=function(_0x323658,_0xe37515){_0x323658=_0x323658-0x0;var _0x4ad32c=_0x4ed8[_0x323658];return _0x4ad32c;};'use strict';var _=require(_0x84ed('0x0'));var util=require('util');var moment=require(_0x84ed('0x1'));var BPromise=require(_0x84ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84ed('0x4'));var logger=require(_0x84ed('0x5'))(_0x84ed('0x6'));var config=require(_0x84ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84ed('0x8')][_0x84ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4281dc,_0x14dbe2,_0x56a26a){return new BPromise(function(_0x4243c1,_0x2511cd){return client[_0x84ed('0xa')](_0x4281dc,_0x56a26a)['then'](function(_0x16c096){logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));logger[_0x84ed('0xe')](_0x84ed('0xf'),_0x14dbe2,_0x84ed('0xd'),JSON[_0x84ed('0x10')](_0x16c096));if(_0x16c096[_0x84ed('0x11')]){if(_0x16c096[_0x84ed('0x11')]['code']===0x1f4){logger['error'](_0x84ed('0xc'),_0x14dbe2,_0x16c096[_0x84ed('0x11')]['message']);return _0x2511cd(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}logger[_0x84ed('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x14dbe2,_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);return _0x4243c1(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}else{logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));_0x4243c1(_0x16c096[_0x84ed('0x13')]['message']);}})[_0x84ed('0x14')](function(_0x14a6d0){logger[_0x84ed('0x11')](_0x84ed('0xc'),_0x14dbe2,_0x14a6d0);_0x2511cd(_0x14a6d0);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index bce2d68..cf26cbf 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 _0x06ee=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post'];(function(_0x2704cc,_0x5157bc){var _0x14e16e=function(_0x5c26de){while(--_0x5c26de){_0x2704cc['push'](_0x2704cc['shift']());}};_0x14e16e(++_0x5157bc);}(_0x06ee,0x110));var _0xe06e=function(_0x2c8be4,_0x380f0e){_0x2c8be4=_0x2c8be4-0x0;var _0x442531=_0x06ee[_0x2c8be4];return _0x442531;};'use strict';var multer=require('multer');var util=require(_0xe06e('0x0'));var path=require(_0xe06e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe06e('0x2'));var router=express[_0xe06e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe06e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe06e('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0xe06e('0x6')]('/',auth[_0xe06e('0x7')](),controller[_0xe06e('0x8')]);router[_0xe06e('0x6')](_0xe06e('0x9'),auth['isAuthenticated'](),controller[_0xe06e('0xa')]);router[_0xe06e('0x6')]('/:id/download',auth[_0xe06e('0x7')](),controller[_0xe06e('0xb')]);router[_0xe06e('0xc')]('/',auth['isAuthenticated'](),controller[_0xe06e('0xd')]);router[_0xe06e('0xe')](_0xe06e('0x9'),auth['isAuthenticated'](),controller[_0xe06e('0xf')]);router[_0xe06e('0x10')](_0xe06e('0x9'),auth[_0xe06e('0x7')](),controller[_0xe06e('0x11')]);module[_0xe06e('0x12')]=router; \ No newline at end of file +var _0xfa9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/download','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4adaf2,_0x4a7b4c){var _0x42080f=function(_0x146a50){while(--_0x146a50){_0x4adaf2['push'](_0x4adaf2['shift']());}};_0x42080f(++_0x4a7b4c);}(_0xfa9e,0x8e));var _0xefa9=function(_0x5c172,_0x343986){_0x5c172=_0x5c172-0x0;var _0x5526f3=_0xfa9e[_0x5c172];return _0x5526f3;};'use strict';var multer=require(_0xefa9('0x0'));var util=require(_0xefa9('0x1'));var path=require(_0xefa9('0x2'));var timeout=require(_0xefa9('0x3'));var express=require(_0xefa9('0x4'));var router=express[_0xefa9('0x5')]();var fs_extra=require(_0xefa9('0x6'));var auth=require(_0xefa9('0x7'));var interaction=require(_0xefa9('0x8'));var config=require(_0xefa9('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0xefa9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefa9('0xb')]);router['get']('/:id',auth[_0xefa9('0xc')](),controller[_0xefa9('0xd')]);router[_0xefa9('0xa')](_0xefa9('0xe'),auth[_0xefa9('0xc')](),controller['download']);router[_0xefa9('0xf')]('/',auth['isAuthenticated'](),controller[_0xefa9('0x10')]);router[_0xefa9('0x11')](_0xefa9('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xefa9('0x13')](_0xefa9('0x12'),auth['isAuthenticated'](),controller[_0xefa9('0x14')]);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 04f4f4d..1621876 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 _0x746e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x451429,_0x542d1b){var _0x52194c=function(_0x583990){while(--_0x583990){_0x451429['push'](_0x451429['shift']());}};_0x52194c(++_0x542d1b);}(_0x746e,0xf6));var _0xe746=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x746e[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xe746('0x0'));module[_0xe746('0x1')]={'field':{'type':Sequelize[_0xe746('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe746('0x3')]},'format':{'type':Sequelize[_0xe746('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe746('0x3')]},'custom':{'type':Sequelize[_0xe746('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xeffe=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2f0274,_0x2dd966){var _0x188cca=function(_0x28e7b1){while(--_0x28e7b1){_0x2f0274['push'](_0x2f0274['shift']());}};_0x188cca(++_0x2dd966);}(_0xeffe,0x1e9));var _0xeeff=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xeffe[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xeeff('0x0'));module[_0xeeff('0x1')]={'field':{'type':Sequelize[_0xeeff('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xeeff('0x3')]},'format':{'type':Sequelize[_0xeeff('0x3')]},'groupBy':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xeeff('0x3')]},'custom':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index cc63e26..ddc460a 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 _0xbe39=['body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','params','sequelize','CustomReportId','findAll','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','AnalyticFieldReport','fieldName','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','rows','catch','keys','rawAttributes','fields','includeAll','include','find','create'];(function(_0x538175,_0xec25f3){var _0x5464bc=function(_0x1d568f){while(--_0x1d568f){_0x538175['push'](_0x538175['shift']());}};_0x5464bc(++_0xec25f3);}(_0xbe39,0x196));var _0x9be3=function(_0x49b06a,_0x38699b){_0x49b06a=_0x49b06a-0x0;var _0x77a508=_0xbe39[_0x49b06a];return _0x77a508;};'use strict';var emlformat=require(_0x9be3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9be3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9be3('0x2'));var util=require(_0x9be3('0x3'));var path=require(_0x9be3('0x4'));var sox=require(_0x9be3('0x5'));var csv=require(_0x9be3('0x6'));var ejs=require(_0x9be3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9be3('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9be3('0x9'));var toCsv=require(_0x9be3('0x6'));var querystring=require(_0x9be3('0xa'));var Papa=require(_0x9be3('0xb'));var Redis=require(_0x9be3('0xc'));var authService=require(_0x9be3('0xd'));var qs=require(_0x9be3('0xe'));var as=require(_0x9be3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9be3('0x10'))(_0x9be3('0x11'));var utils=require(_0x9be3('0x12'));var config=require(_0x9be3('0x13'));var licenseUtil=require(_0x9be3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496471,_0x256f50){_0x256f50=_0x256f50||0xcc;return function(_0x153adc){if(_0x153adc){return _0x496471['sendStatus'](_0x256f50);}return _0x496471['status'](_0x256f50)['end']();};}function respondWithResult(_0x454e8f,_0x575f2c){_0x575f2c=_0x575f2c||0xc8;return function(_0x428e7d){if(_0x428e7d){return _0x454e8f[_0x9be3('0x15')](_0x575f2c)[_0x9be3('0x16')](_0x428e7d);}};}function respondWithFilteredResult(_0x391891,_0x3fb740){return function(_0x3e58a4){if(_0x3e58a4){var _0x477139=typeof _0x3fb740[_0x9be3('0x17')]===_0x9be3('0x18')&&typeof _0x3fb740['limit']===_0x9be3('0x18');var _0xe93937=_0x3e58a4[_0x9be3('0x19')];var _0x3f3637=_0x477139?0x0:_0x3fb740[_0x9be3('0x17')];var _0x4d09c2=_0x477139?_0x3e58a4[_0x9be3('0x19')]:_0x3fb740[_0x9be3('0x17')]+_0x3fb740[_0x9be3('0x1a')];var _0x42734d;if(_0x4d09c2>=_0xe93937){_0x4d09c2=_0xe93937;_0x42734d=0xc8;}else{_0x42734d=0xce;}_0x391891[_0x9be3('0x15')](_0x42734d);return _0x391891[_0x9be3('0x1b')](_0x9be3('0x1c'),_0x3f3637+'-'+_0x4d09c2+'/'+_0xe93937)[_0x9be3('0x16')](_0x3e58a4);}return null;};}function patchUpdates(_0x23dd78){return function(_0x557eb5){try{jsonpatch[_0x9be3('0x1d')](_0x557eb5,_0x23dd78,!![]);}catch(_0x3b34aa){return BPromise[_0x9be3('0x1e')](_0x3b34aa);}return _0x557eb5[_0x9be3('0x1f')]();};}function saveUpdates(_0x4fcac7,_0x315056){return function(_0x4f65e2){if(_0x4f65e2){return _0x4f65e2[_0x9be3('0x20')](_0x4fcac7)[_0x9be3('0x21')](function(_0x507fc6){return _0x507fc6;});}return null;};}function removeEntity(_0x14d077,_0x33df60){return function(_0x14bfc2){if(_0x14bfc2){return _0x14bfc2['destroy']()['then'](function(){_0x14d077['status'](0xcc)[_0x9be3('0x22')]();});}};}function handleEntityNotFound(_0x38ecc8,_0x39bde9){return function(_0x73292b){if(!_0x73292b){_0x38ecc8[_0x9be3('0x23')](0x194);}return _0x73292b;};}function handleError(_0x1287c9,_0x449c0b){_0x449c0b=_0x449c0b||0x1f4;return function(_0x2e8c52){logger[_0x9be3('0x24')](_0x2e8c52[_0x9be3('0x25')]);if(_0x2e8c52[_0x9be3('0x26')]){delete _0x2e8c52[_0x9be3('0x26')];}_0x1287c9[_0x9be3('0x15')](_0x449c0b)[_0x9be3('0x27')](_0x2e8c52);};}exports['index']=function(_0x3b2eec,_0x4fa5f2){var _0x49f4e3={},_0x5ed091={},_0x15e32b={'count':0x0,'rows':[]};var _0x38625b=_['map'](db[_0x9be3('0x28')]['rawAttributes'],function(_0x450df5){return{'name':_0x450df5[_0x9be3('0x29')],'type':_0x450df5['type'][_0x9be3('0x2a')]};});_0x5ed091[_0x9be3('0x2b')]=_[_0x9be3('0x2c')](_0x38625b,'name');_0x5ed091[_0x9be3('0x2d')]=_['keys'](_0x3b2eec[_0x9be3('0x2d')]);_0x5ed091[_0x9be3('0x2e')]=_['intersection'](_0x5ed091['model'],_0x5ed091[_0x9be3('0x2d')]);_0x49f4e3['attributes']=_[_0x9be3('0x2f')](_0x5ed091[_0x9be3('0x2b')],qs['fields'](_0x3b2eec[_0x9be3('0x2d')]['fields']));_0x49f4e3[_0x9be3('0x30')]=_0x49f4e3[_0x9be3('0x30')][_0x9be3('0x31')]?_0x49f4e3[_0x9be3('0x30')]:_0x5ed091['model'];if(!_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x32')]('nolimit')){_0x49f4e3[_0x9be3('0x1a')]=qs[_0x9be3('0x1a')](_0x3b2eec['query'][_0x9be3('0x1a')]);_0x49f4e3[_0x9be3('0x17')]=qs[_0x9be3('0x17')](_0x3b2eec['query'][_0x9be3('0x17')]);}_0x49f4e3[_0x9be3('0x33')]=qs[_0x9be3('0x34')](_0x3b2eec['query'][_0x9be3('0x34')]);_0x49f4e3[_0x9be3('0x35')]=qs['filters'](_[_0x9be3('0x36')](_0x3b2eec[_0x9be3('0x2d')],_0x5ed091[_0x9be3('0x2e')]),_0x38625b);if(_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x37')]){_0x49f4e3['where']=_[_0x9be3('0x38')](_0x49f4e3[_0x9be3('0x35')],{'$or':_['map'](_0x38625b,function(_0x49d692){if(_0x49d692[_0x9be3('0x39')]!==_0x9be3('0x3a')){var _0x5a0823={};_0x5a0823[_0x49d692[_0x9be3('0x26')]]={'$like':'%'+_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x37')]+'%'};return _0x5a0823;}})});}_0x49f4e3=_[_0x9be3('0x38')]({},_0x49f4e3,_0x3b2eec['options']);var _0x449870={'where':_0x49f4e3['where']};return db[_0x9be3('0x28')][_0x9be3('0x19')](_0x449870)['then'](function(_0x1a711e){_0x15e32b[_0x9be3('0x19')]=_0x1a711e;if(_0x3b2eec[_0x9be3('0x2d')]['includeAll']){_0x49f4e3['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x49f4e3);})[_0x9be3('0x21')](function(_0x51a451){_0x15e32b[_0x9be3('0x3b')]=_0x51a451;return _0x15e32b;})['then'](respondWithFilteredResult(_0x4fa5f2,_0x49f4e3))[_0x9be3('0x3c')](handleError(_0x4fa5f2,null));};exports['show']=function(_0x3c13ce,_0x5f3a45){var _0x192552={'raw':![],'where':{'id':_0x3c13ce['params']['id']}},_0x4bf943={};_0x4bf943['model']=_[_0x9be3('0x3d')](db[_0x9be3('0x28')][_0x9be3('0x3e')]);_0x4bf943[_0x9be3('0x2d')]=_[_0x9be3('0x3d')](_0x3c13ce[_0x9be3('0x2d')]);_0x4bf943[_0x9be3('0x2e')]=_['intersection'](_0x4bf943[_0x9be3('0x2b')],_0x4bf943['query']);_0x192552[_0x9be3('0x30')]=_[_0x9be3('0x2f')](_0x4bf943[_0x9be3('0x2b')],qs[_0x9be3('0x3f')](_0x3c13ce[_0x9be3('0x2d')][_0x9be3('0x3f')]));_0x192552[_0x9be3('0x30')]=_0x192552[_0x9be3('0x30')][_0x9be3('0x31')]?_0x192552[_0x9be3('0x30')]:_0x4bf943['model'];if(_0x3c13ce['query'][_0x9be3('0x40')]){_0x192552[_0x9be3('0x41')]=[{'all':!![]}];}_0x192552=_[_0x9be3('0x38')]({},_0x192552,_0x3c13ce['options']);return db[_0x9be3('0x28')][_0x9be3('0x42')](_0x192552)[_0x9be3('0x21')](handleEntityNotFound(_0x5f3a45,null))['then'](respondWithResult(_0x5f3a45,null))[_0x9be3('0x3c')](handleError(_0x5f3a45,null));};exports[_0x9be3('0x43')]=function(_0x465111,_0xff0281){return db[_0x9be3('0x28')]['create'](_0x465111[_0x9be3('0x44')],{})['then'](respondWithResult(_0xff0281,0xc9))['catch'](handleError(_0xff0281,null));};exports[_0x9be3('0x45')]=function(_0x21a524,_0x20523b){return db['AnalyticFieldReport'][_0x9be3('0x45')](_0x21a524[_0x9be3('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20523b,0xc9))[_0x9be3('0x3c')](handleError(_0x20523b,null));};exports[_0x9be3('0x20')]=function(_0x23fe06,_0x22bd07){if(_0x23fe06['body']['id']){delete _0x23fe06[_0x9be3('0x44')]['id'];}return db[_0x9be3('0x28')][_0x9be3('0x42')]({'where':{'id':_0x23fe06['params']['id']}})[_0x9be3('0x21')](handleEntityNotFound(_0x22bd07,null))[_0x9be3('0x21')](saveUpdates(_0x23fe06[_0x9be3('0x44')],null))[_0x9be3('0x21')](respondWithResult(_0x22bd07,null))[_0x9be3('0x3c')](handleError(_0x22bd07,null));};exports[_0x9be3('0x46')]=function(_0x17bf05,_0x14debf){return db[_0x9be3('0x28')][_0x9be3('0x42')]({'where':{'id':_0x17bf05['params']['id']}})['then'](handleEntityNotFound(_0x14debf,null))['then'](removeEntity(_0x14debf,null))[_0x9be3('0x3c')](handleError(_0x14debf,null));};exports[_0x9be3('0x47')]=function(_0xc98161,_0x23313d){return db[_0x9be3('0x28')]['destroy']({'where':{'id':_0xc98161[_0x9be3('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x9be3('0x21')](respondWithResult(_0x23313d,0xcc))[_0x9be3('0x3c')](handleError(_0x23313d,null));};exports[_0x9be3('0x48')]=function(_0xc5e5c1,_0x8fbfff,_0x5753b3){return db[_0x9be3('0x49')][_0x9be3('0x4a')]({'where':{'id':_0xc5e5c1[_0x9be3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8fbfff,null))['then'](function(_0x429321){if(_0x429321){return db[_0x9be3('0x4c')]['transaction'](function(_0x2457c4){return db[_0x9be3('0x28')][_0x9be3('0x46')]({'where':{'CustomReportId':_0xc5e5c1[_0x9be3('0x4b')]['id']},'transaction':_0x2457c4})[_0x9be3('0x21')](function(_0x566e58){var _0xae6ddc=_[_0x9be3('0x2c')](_0xc5e5c1[_0x9be3('0x44')],function(_0x2f8f8f){delete _0x2f8f8f['id'];_0x2f8f8f[_0x9be3('0x4d')]=_0xc5e5c1[_0x9be3('0x4b')]['id'];return _0x2f8f8f;});return db[_0x9be3('0x28')]['bulkCreate'](_0xae6ddc,{'transaction':_0x2457c4});});})[_0x9be3('0x21')](function(){return db[_0x9be3('0x28')][_0x9be3('0x4e')]({'where':{'CustomReportId':_0xc5e5c1['params']['id']}});});}})[_0x9be3('0x21')](respondWithResult(_0x8fbfff,null))[_0x9be3('0x3c')](handleError(_0x8fbfff,null));}; \ No newline at end of file +var _0xf0e5=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','sendStatus','error','stack','name','send','map','AnalyticFieldReport','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','params','intersection','include','find','create','bulkCreate','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf0e5,0x185));var _0x5f0e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf0e5[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x5f0e('0x0'));var rimraf=require(_0x5f0e('0x1'));var zipdir=require(_0x5f0e('0x2'));var jsonpatch=require(_0x5f0e('0x3'));var rp=require(_0x5f0e('0x4'));var moment=require(_0x5f0e('0x5'));var BPromise=require(_0x5f0e('0x6'));var Mustache=require(_0x5f0e('0x7'));var util=require(_0x5f0e('0x8'));var path=require('path');var sox=require(_0x5f0e('0x9'));var csv=require(_0x5f0e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f0e('0xb'));var _=require(_0x5f0e('0xc'));var squel=require(_0x5f0e('0xd'));var crypto=require('crypto');var jsforce=require(_0x5f0e('0xe'));var deskjs=require(_0x5f0e('0xf'));var toCsv=require(_0x5f0e('0xa'));var querystring=require(_0x5f0e('0x10'));var Papa=require(_0x5f0e('0x11'));var Redis=require(_0x5f0e('0x12'));var authService=require(_0x5f0e('0x13'));var qs=require(_0x5f0e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f0e('0x15'));var utils=require(_0x5f0e('0x16'));var config=require(_0x5f0e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f0e('0x18'))['db'];function respondWithStatusCode(_0x64a9b2,_0x4cf23f){_0x4cf23f=_0x4cf23f||0xcc;return function(_0x1fd2be){if(_0x1fd2be){return _0x64a9b2['sendStatus'](_0x4cf23f);}return _0x64a9b2[_0x5f0e('0x19')](_0x4cf23f)[_0x5f0e('0x1a')]();};}function respondWithResult(_0x30a30e,_0x287939){_0x287939=_0x287939||0xc8;return function(_0x17df17){if(_0x17df17){return _0x30a30e[_0x5f0e('0x19')](_0x287939)[_0x5f0e('0x1b')](_0x17df17);}};}function respondWithFilteredResult(_0xbf2f2a,_0x21f168){return function(_0x15a587){if(_0x15a587){var _0x40af2b=typeof _0x21f168[_0x5f0e('0x1c')]===_0x5f0e('0x1d')&&typeof _0x21f168[_0x5f0e('0x1e')]===_0x5f0e('0x1d');var _0x40e4ab=_0x15a587[_0x5f0e('0x1f')];var _0x542c5d=_0x40af2b?0x0:_0x21f168[_0x5f0e('0x1c')];var _0x38d7a8=_0x40af2b?_0x15a587[_0x5f0e('0x1f')]:_0x21f168[_0x5f0e('0x1c')]+_0x21f168[_0x5f0e('0x1e')];var _0x4bdf42;if(_0x38d7a8>=_0x40e4ab){_0x38d7a8=_0x40e4ab;_0x4bdf42=0xc8;}else{_0x4bdf42=0xce;}_0xbf2f2a[_0x5f0e('0x19')](_0x4bdf42);return _0xbf2f2a[_0x5f0e('0x20')]('Content-Range',_0x542c5d+'-'+_0x38d7a8+'/'+_0x40e4ab)[_0x5f0e('0x1b')](_0x15a587);}return null;};}function patchUpdates(_0x20be4c){return function(_0xf70efa){try{jsonpatch[_0x5f0e('0x21')](_0xf70efa,_0x20be4c,!![]);}catch(_0x26b03b){return BPromise['reject'](_0x26b03b);}return _0xf70efa['save']();};}function saveUpdates(_0x3ace8c,_0x1a5045){return function(_0x4faa9b){if(_0x4faa9b){return _0x4faa9b[_0x5f0e('0x22')](_0x3ace8c)['then'](function(_0x373077){return _0x373077;});}return null;};}function removeEntity(_0xd2a027,_0x55eb49){return function(_0xf9ca5e){if(_0xf9ca5e){return _0xf9ca5e[_0x5f0e('0x23')]()['then'](function(){_0xd2a027[_0x5f0e('0x19')](0xcc)[_0x5f0e('0x1a')]();});}};}function handleEntityNotFound(_0x2f50a5,_0x11e761){return function(_0xc7c07e){if(!_0xc7c07e){_0x2f50a5[_0x5f0e('0x24')](0x194);}return _0xc7c07e;};}function handleError(_0x2c63ab,_0x306652){_0x306652=_0x306652||0x1f4;return function(_0x55f5dd){logger[_0x5f0e('0x25')](_0x55f5dd[_0x5f0e('0x26')]);if(_0x55f5dd[_0x5f0e('0x27')]){delete _0x55f5dd[_0x5f0e('0x27')];}_0x2c63ab['status'](_0x306652)[_0x5f0e('0x28')](_0x55f5dd);};}exports['index']=function(_0x2a47e9,_0x2d0c9f){var _0x1a1bcf={},_0x171e3c={},_0x336618={'count':0x0,'rows':[]};var _0x118ccb=_[_0x5f0e('0x29')](db[_0x5f0e('0x2a')]['rawAttributes'],function(_0x211766){return{'name':_0x211766['fieldName'],'type':_0x211766[_0x5f0e('0x2b')][_0x5f0e('0x2c')]};});_0x171e3c[_0x5f0e('0x2d')]=_[_0x5f0e('0x29')](_0x118ccb,_0x5f0e('0x27'));_0x171e3c['query']=_[_0x5f0e('0x2e')](_0x2a47e9[_0x5f0e('0x2f')]);_0x171e3c[_0x5f0e('0x30')]=_['intersection'](_0x171e3c[_0x5f0e('0x2d')],_0x171e3c['query']);_0x1a1bcf['attributes']=_['intersection'](_0x171e3c['model'],qs[_0x5f0e('0x31')](_0x2a47e9['query'][_0x5f0e('0x31')]));_0x1a1bcf[_0x5f0e('0x32')]=_0x1a1bcf[_0x5f0e('0x32')][_0x5f0e('0x33')]?_0x1a1bcf[_0x5f0e('0x32')]:_0x171e3c['model'];if(!_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x34')](_0x5f0e('0x35'))){_0x1a1bcf['limit']=qs[_0x5f0e('0x1e')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x1e')]);_0x1a1bcf[_0x5f0e('0x1c')]=qs[_0x5f0e('0x1c')](_0x2a47e9[_0x5f0e('0x2f')]['offset']);}_0x1a1bcf[_0x5f0e('0x36')]=qs[_0x5f0e('0x37')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x37')]);_0x1a1bcf[_0x5f0e('0x38')]=qs['filters'](_[_0x5f0e('0x39')](_0x2a47e9['query'],_0x171e3c[_0x5f0e('0x30')]),_0x118ccb);if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]){_0x1a1bcf[_0x5f0e('0x38')]=_[_0x5f0e('0x3b')](_0x1a1bcf[_0x5f0e('0x38')],{'$or':_[_0x5f0e('0x29')](_0x118ccb,function(_0x3b1572){if(_0x3b1572['type']!==_0x5f0e('0x3c')){var _0x2a112f={};_0x2a112f[_0x3b1572[_0x5f0e('0x27')]]={'$like':'%'+_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]+'%'};return _0x2a112f;}})});}_0x1a1bcf=_[_0x5f0e('0x3b')]({},_0x1a1bcf,_0x2a47e9[_0x5f0e('0x3d')]);var _0x2e7eaf={'where':_0x1a1bcf[_0x5f0e('0x38')]};return db[_0x5f0e('0x2a')][_0x5f0e('0x1f')](_0x2e7eaf)[_0x5f0e('0x3e')](function(_0x4cf602){_0x336618[_0x5f0e('0x1f')]=_0x4cf602;if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x1a1bcf['include']=[{'all':!![]}];}return db[_0x5f0e('0x2a')]['findAll'](_0x1a1bcf);})[_0x5f0e('0x3e')](function(_0x2eb5f6){_0x336618[_0x5f0e('0x40')]=_0x2eb5f6;return _0x336618;})[_0x5f0e('0x3e')](respondWithFilteredResult(_0x2d0c9f,_0x1a1bcf))[_0x5f0e('0x41')](handleError(_0x2d0c9f,null));};exports['show']=function(_0x300b66,_0x18ed0e){var _0x326c8c={'raw':![],'where':{'id':_0x300b66[_0x5f0e('0x42')]['id']}},_0x386858={};_0x386858[_0x5f0e('0x2d')]=_['keys'](db[_0x5f0e('0x2a')]['rawAttributes']);_0x386858[_0x5f0e('0x2f')]=_[_0x5f0e('0x2e')](_0x300b66[_0x5f0e('0x2f')]);_0x386858['filters']=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],_0x386858[_0x5f0e('0x2f')]);_0x326c8c[_0x5f0e('0x32')]=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],qs[_0x5f0e('0x31')](_0x300b66['query'][_0x5f0e('0x31')]));_0x326c8c[_0x5f0e('0x32')]=_0x326c8c['attributes'][_0x5f0e('0x33')]?_0x326c8c[_0x5f0e('0x32')]:_0x386858['model'];if(_0x300b66[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x326c8c[_0x5f0e('0x44')]=[{'all':!![]}];}_0x326c8c=_[_0x5f0e('0x3b')]({},_0x326c8c,_0x300b66[_0x5f0e('0x3d')]);return db[_0x5f0e('0x2a')][_0x5f0e('0x45')](_0x326c8c)[_0x5f0e('0x3e')](handleEntityNotFound(_0x18ed0e,null))['then'](respondWithResult(_0x18ed0e,null))['catch'](handleError(_0x18ed0e,null));};exports[_0x5f0e('0x46')]=function(_0x5c5f3f,_0x517a47){return db['AnalyticFieldReport']['create'](_0x5c5f3f['body'],{})[_0x5f0e('0x3e')](respondWithResult(_0x517a47,0xc9))[_0x5f0e('0x41')](handleError(_0x517a47,null));};exports[_0x5f0e('0x47')]=function(_0x265d01,_0x3ea3da){return db['AnalyticFieldReport']['bulkCreate'](_0x265d01[_0x5f0e('0x48')],{'raw':![],'individualHooks':!![]})[_0x5f0e('0x3e')](respondWithResult(_0x3ea3da,0xc9))[_0x5f0e('0x41')](handleError(_0x3ea3da,null));};exports[_0x5f0e('0x22')]=function(_0x30fc72,_0x3747c6){if(_0x30fc72[_0x5f0e('0x48')]['id']){delete _0x30fc72[_0x5f0e('0x48')]['id'];}return db[_0x5f0e('0x2a')][_0x5f0e('0x45')]({'where':{'id':_0x30fc72[_0x5f0e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3747c6,null))[_0x5f0e('0x3e')](saveUpdates(_0x30fc72[_0x5f0e('0x48')],null))['then'](respondWithResult(_0x3747c6,null))[_0x5f0e('0x41')](handleError(_0x3747c6,null));};exports[_0x5f0e('0x23')]=function(_0xd0650c,_0xb29786){return db[_0x5f0e('0x2a')]['find']({'where':{'id':_0xd0650c[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0xb29786,null))[_0x5f0e('0x3e')](removeEntity(_0xb29786,null))[_0x5f0e('0x41')](handleError(_0xb29786,null));};exports[_0x5f0e('0x49')]=function(_0x1b10a,_0x20ff95){return db[_0x5f0e('0x2a')][_0x5f0e('0x23')]({'where':{'id':_0x1b10a[_0x5f0e('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20ff95,0xcc))[_0x5f0e('0x41')](handleError(_0x20ff95,null));};exports['addFields']=function(_0x3a3b32,_0x413671,_0x58cd9a){return db[_0x5f0e('0x4a')][_0x5f0e('0x4b')]({'where':{'id':_0x3a3b32[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0x413671,null))['then'](function(_0x5c4d0c){if(_0x5c4d0c){return db[_0x5f0e('0x4c')]['transaction'](function(_0x1bdf43){return db[_0x5f0e('0x2a')]['destroy']({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']},'transaction':_0x1bdf43})[_0x5f0e('0x3e')](function(_0x1f34d8){var _0x42cd3b=_[_0x5f0e('0x29')](_0x3a3b32['body'],function(_0x2acff2){delete _0x2acff2['id'];_0x2acff2[_0x5f0e('0x4d')]=_0x3a3b32['params']['id'];return _0x2acff2;});return db[_0x5f0e('0x2a')][_0x5f0e('0x47')](_0x42cd3b,{'transaction':_0x1bdf43});});})[_0x5f0e('0x3e')](function(){return db['AnalyticFieldReport'][_0x5f0e('0x4e')]({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']}});});}})[_0x5f0e('0x3e')](respondWithResult(_0x413671,null))[_0x5f0e('0x41')](handleError(_0x413671,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 526259f..4796da4 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 _0xbf5d=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x136d15,_0x50f7e5){var _0xcde364=function(_0x18ee22){while(--_0x18ee22){_0x136d15['push'](_0x136d15['shift']());}};_0xcde364(++_0x50f7e5);}(_0xbf5d,0xbc));var _0xdbf5=function(_0x4569fb,_0x1952f2){_0x4569fb=_0x4569fb-0x0;var _0x19f7b9=_0xbf5d[_0x4569fb];return _0x19f7b9;};'use strict';var _=require(_0xdbf5('0x0'));var util=require(_0xdbf5('0x1'));var logger=require(_0xdbf5('0x2'))(_0xdbf5('0x3'));var moment=require(_0xdbf5('0x4'));var BPromise=require(_0xdbf5('0x5'));var rp=require(_0xdbf5('0x6'));var fs=require('fs');var path=require(_0xdbf5('0x7'));var rimraf=require(_0xdbf5('0x8'));var config=require(_0xdbf5('0x9'));var attributes=require(_0xdbf5('0xa'));module[_0xdbf5('0xb')]=function(_0x15c29d,_0x114b9a){return _0x15c29d['define'](_0xdbf5('0xc'),attributes,{'tableName':_0xdbf5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf913=['exports','define','analytics_report_fields','lodash','util','api','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x22d543,_0xdfa138){var _0x14fee8=function(_0x5cac0f){while(--_0x5cac0f){_0x22d543['push'](_0x22d543['shift']());}};_0x14fee8(++_0xdfa138);}(_0xf913,0x121));var _0x3f91=function(_0x25aa8f,_0x47ae2c){_0x25aa8f=_0x25aa8f-0x0;var _0x11a4ed=_0xf913[_0x25aa8f];return _0x11a4ed;};'use strict';var _=require(_0x3f91('0x0'));var util=require(_0x3f91('0x1'));var logger=require('../../config/logger')(_0x3f91('0x2'));var moment=require(_0x3f91('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f91('0x4'));var rimraf=require(_0x3f91('0x5'));var config=require(_0x3f91('0x6'));var attributes=require(_0x3f91('0x7'));module[_0x3f91('0x8')]=function(_0x4eb80d,_0x3d59c6){return _0x4eb80d[_0x3f91('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x3f91('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 ebf06a7..ac82c31 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 _0xf661=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x4f60a7,_0x41a500){var _0x300253=function(_0x17d5ec){while(--_0x17d5ec){_0x4f60a7['push'](_0x4f60a7['shift']());}};_0x300253(++_0x41a500);}(_0xf661,0x65));var _0x1f66=function(_0x494e0f,_0xd8adfe){_0x494e0f=_0x494e0f-0x0;var _0x39f102=_0xf661[_0x494e0f];return _0x39f102;};'use strict';var _=require(_0x1f66('0x0'));var util=require(_0x1f66('0x1'));var moment=require(_0x1f66('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f66('0x4'))['db'];var utils=require(_0x1f66('0x5'));var logger=require(_0x1f66('0x6'))(_0x1f66('0x7'));var config=require(_0x1f66('0x8'));var jayson=require(_0x1f66('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7f04,_0x22b1f9,_0x483e85){return new BPromise(function(_0x213590,_0x41826f){return client[_0x1f66('0xa')](_0x2f7f04,_0x483e85)[_0x1f66('0xb')](function(_0xeb77e3){logger[_0x1f66('0xc')](_0x1f66('0xd'),_0x22b1f9,'request\x20sent');logger[_0x1f66('0xe')](_0x1f66('0xf'),_0x22b1f9,_0x1f66('0x10'),JSON[_0x1f66('0x11')](_0xeb77e3));if(_0xeb77e3[_0x1f66('0x12')]){if(_0xeb77e3['error'][_0x1f66('0x13')]===0x1f4){logger[_0x1f66('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22b1f9,_0xeb77e3['error']['message']);return _0x41826f(_0xeb77e3[_0x1f66('0x12')][_0x1f66('0x14')]);}logger[_0x1f66('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22b1f9,_0xeb77e3['error'][_0x1f66('0x14')]);return _0x213590(_0xeb77e3['error']['message']);}else{logger['info'](_0x1f66('0xd'),_0x22b1f9,_0x1f66('0x10'));_0x213590(_0xeb77e3[_0x1f66('0x15')][_0x1f66('0x14')]);}})[_0x1f66('0x16')](function(_0x382fd9){logger['error'](_0x1f66('0xd'),_0x22b1f9,_0x382fd9);_0x41826f(_0x382fd9);});});} \ No newline at end of file +var _0x436c=['ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','randomstring'];(function(_0x1b44e2,_0x32103e){var _0x428122=function(_0x3985d0){while(--_0x3985d0){_0x1b44e2['push'](_0x1b44e2['shift']());}};_0x428122(++_0x32103e);}(_0x436c,0xd9));var _0xc436=function(_0x772992,_0x5fce1e){_0x772992=_0x772992-0x0;var _0x37a9ea=_0x436c[_0x772992];return _0x37a9ea;};'use strict';var _=require('lodash');var util=require(_0xc436('0x0'));var moment=require(_0xc436('0x1'));var BPromise=require('bluebird');var rs=require(_0xc436('0x2'));var fs=require('fs');var Redis=require(_0xc436('0x3'));var db=require(_0xc436('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc436('0x5'));var client=jayson[_0xc436('0x6')][_0xc436('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b39bd,_0x1490bd,_0x23c66c){return new BPromise(function(_0x55aeea,_0x1e6aed){return client[_0xc436('0x8')](_0x1b39bd,_0x23c66c)[_0xc436('0x9')](function(_0x10002f){logger[_0xc436('0xa')](_0xc436('0xb'),_0x1490bd,_0xc436('0xc'));logger[_0xc436('0xd')](_0xc436('0xe'),_0x1490bd,_0xc436('0xc'),JSON[_0xc436('0xf')](_0x10002f));if(_0x10002f['error']){if(_0x10002f['error'][_0xc436('0x10')]===0x1f4){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x1e6aed(_0x10002f[_0xc436('0x11')]['message']);}logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x55aeea(_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);}else{logger[_0xc436('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1490bd,_0xc436('0xc'));_0x55aeea(_0x10002f[_0xc436('0x13')][_0xc436('0x12')]);}})['catch'](function(_0x1c6815){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x1c6815);_0x1e6aed(_0x1c6815);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 7ceaf59..4459f5e 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(_0xc6800a,_0x4eac70){var _0x4919d3=function(_0x1ccfa6){while(--_0x1ccfa6){_0xc6800a['push'](_0xc6800a['shift']());}};_0x4919d3(++_0x4eac70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x5fa0bf,_0x38661b){var _0x636f63=function(_0x2986dc){while(--_0x2986dc){_0x5fa0bf['push'](_0x5fa0bf['shift']());}};_0x636f63(++_0x38661b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 083fd0c..b355593 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 _0x9780=['STRING','name','TEXT'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x9780,0x1d4));var _0x0978=function(_0x255036,_0xf94145){_0x255036=_0x255036-0x0;var _0x3c4c56=_0x9780[_0x255036];return _0x3c4c56;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'unique':_0x0978('0x1')},'table':{'type':Sequelize[_0x0978('0x0')]},'metric':{'type':Sequelize[_0x0978('0x2')]},'description':{'type':Sequelize[_0x0978('0x0')]}}; \ No newline at end of file +var _0x9703=['name','STRING'];(function(_0x452109,_0x4b63c1){var _0x3c2ffd=function(_0x57b320){while(--_0x57b320){_0x452109['push'](_0x452109['shift']());}};_0x3c2ffd(++_0x4b63c1);}(_0x9703,0xdb));var _0x3970=function(_0xaee241,_0x26d77f){_0xaee241=_0xaee241-0x0;var _0x42384c=_0x9703[_0xaee241];return _0x42384c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3970('0x0')],'allowNull':![],'unique':_0x3970('0x1')},'table':{'type':Sequelize[_0x3970('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3970('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index d847fbc..cffa330 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2576b0,_0x3fb339){var _0x2a6658=function(_0x3b5908){while(--_0x3b5908){_0x2576b0['push'](_0x2576b0['shift']());}};_0x2a6658(++_0x3fb339);}(_0xe5b3,0x133));var _0x3e5b=function(_0x59622b,_0x26e364){_0x59622b=_0x59622b-0x0;var _0x453424=_0xe5b3[_0x59622b];return _0x453424;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file +var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x008c,0x188));var _0xc008=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x008c[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 2fb9752..dcfaecc 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 _0x2178=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x515ab1,_0x133504){var _0x2589ba=function(_0x430cf9){while(--_0x430cf9){_0x515ab1['push'](_0x515ab1['shift']());}};_0x2589ba(++_0x133504);}(_0x2178,0x1b0));var _0x8217=function(_0x155a36,_0x4bf39){_0x155a36=_0x155a36-0x0;var _0x3c99d0=_0x2178[_0x155a36];return _0x3c99d0;};'use strict';var _=require(_0x8217('0x0'));var util=require('util');var logger=require(_0x8217('0x1'))(_0x8217('0x2'));var moment=require(_0x8217('0x3'));var BPromise=require('bluebird');var rp=require(_0x8217('0x4'));var fs=require('fs');var path=require(_0x8217('0x5'));var rimraf=require('rimraf');var config=require(_0x8217('0x6'));var attributes=require(_0x8217('0x7'));module[_0x8217('0x8')]=function(_0x16da6e,_0x18f4bd){return _0x16da6e[_0x8217('0x9')](_0x8217('0xa'),attributes,{'tableName':_0x8217('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde81=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x389c94,_0x2a93d9){var _0x1455cb=function(_0x5903d6){while(--_0x5903d6){_0x389c94['push'](_0x389c94['shift']());}};_0x1455cb(++_0x2a93d9);}(_0xde81,0x109));var _0x1de8=function(_0x1bc13c,_0x4483a0){_0x1bc13c=_0x1bc13c-0x0;var _0x4a7ceb=_0xde81[_0x1bc13c];return _0x4a7ceb;};'use strict';var _=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var logger=require(_0x1de8('0x2'))(_0x1de8('0x3'));var moment=require(_0x1de8('0x4'));var BPromise=require(_0x1de8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x1de8('0x7'));module[_0x1de8('0x8')]=function(_0x42801a,_0x3ae723){return _0x42801a[_0x1de8('0x9')](_0x1de8('0xa'),attributes,{'tableName':_0x1de8('0xb'),'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 fe4d50e..859d541 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 _0x91fa=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c0f4c,_0x43faf6){var _0x129b93=function(_0x51b101){while(--_0x51b101){_0x5c0f4c['push'](_0x5c0f4c['shift']());}};_0x129b93(++_0x43faf6);}(_0x91fa,0x183));var _0xa91f=function(_0x390143,_0x2b54ac){_0x390143=_0x390143-0x0;var _0x11361b=_0x91fa[_0x390143];return _0x11361b;};'use strict';var _=require(_0xa91f('0x0'));var util=require('util');var moment=require(_0xa91f('0x1'));var BPromise=require(_0xa91f('0x2'));var rs=require(_0xa91f('0x3'));var fs=require('fs');var Redis=require(_0xa91f('0x4'));var db=require(_0xa91f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa91f('0x6'))(_0xa91f('0x7'));var config=require(_0xa91f('0x8'));var jayson=require(_0xa91f('0x9'));var client=jayson[_0xa91f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42ee7e,_0x8617c6,_0x32274b){return new BPromise(function(_0x1da2b6,_0x458653){return client[_0xa91f('0xb')](_0x42ee7e,_0x32274b)[_0xa91f('0xc')](function(_0x175961){logger[_0xa91f('0xd')](_0xa91f('0xe'),_0x8617c6,'request\x20sent');logger[_0xa91f('0xf')](_0xa91f('0x10'),_0x8617c6,_0xa91f('0x11'),JSON[_0xa91f('0x12')](_0x175961));if(_0x175961[_0xa91f('0x13')]){if(_0x175961['error'][_0xa91f('0x14')]===0x1f4){logger[_0xa91f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x8617c6,_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);return _0x458653(_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);}logger[_0xa91f('0x13')](_0xa91f('0xe'),_0x8617c6,_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);return _0x1da2b6(_0x175961[_0xa91f('0x13')]['message']);}else{logger[_0xa91f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x8617c6,_0xa91f('0x11'));_0x1da2b6(_0x175961[_0xa91f('0x16')][_0xa91f('0x15')]);}})[_0xa91f('0x17')](function(_0x25cb92){logger[_0xa91f('0x13')](_0xa91f('0xe'),_0x8617c6,_0x25cb92);_0x458653(_0x25cb92);});});} \ No newline at end of file +var _0x8dcb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0xf0d2ff,_0x3b2df0){var _0x3b06db=function(_0x41d314){while(--_0x41d314){_0xf0d2ff['push'](_0xf0d2ff['shift']());}};_0x3b06db(++_0x3b2df0);}(_0x8dcb,0x6b));var _0xb8dc=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x8dcb[_0x3a73bc];return _0x32891b;};'use strict';var _=require('lodash');var util=require(_0xb8dc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8dc('0x1'));var fs=require('fs');var Redis=require(_0xb8dc('0x2'));var db=require(_0xb8dc('0x3'))['db'];var utils=require(_0xb8dc('0x4'));var logger=require(_0xb8dc('0x5'))(_0xb8dc('0x6'));var config=require(_0xb8dc('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x949d20,_0x588f94,_0x3d793f){return new BPromise(function(_0x2774af,_0x2996b7){return client[_0xb8dc('0x8')](_0x949d20,_0x3d793f)['then'](function(_0x54542e){logger[_0xb8dc('0x9')](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));logger['debug'](_0xb8dc('0xc'),_0x588f94,_0xb8dc('0xb'),JSON[_0xb8dc('0xd')](_0x54542e));if(_0x54542e[_0xb8dc('0xe')]){if(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0xf')]===0x1f4){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x54542e['error']['message']);return _0x2996b7(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}logger['error'](_0xb8dc('0xa'),_0x588f94,_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);return _0x2774af(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}else{logger['info'](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));_0x2774af(_0x54542e[_0xb8dc('0x11')][_0xb8dc('0x10')]);}})['catch'](function(_0x3933fd){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x3933fd);_0x2996b7(_0x3933fd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index cdbacfb..4bfd87f 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 _0x0fda=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x55ffdb,_0x295851){_0x55ffdb=_0x55ffdb-0x0;var _0x15bf09=_0x0fda[_0x55ffdb];return _0x15bf09;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var timeout=require(_0xa0fd('0x2'));var express=require(_0xa0fd('0x3'));var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xa0fd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0fd('0x8')](_0xa0fd('0x9'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xb')]);router['post']('/',auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xc')]);router[_0xa0fd('0xd')](_0xa0fd('0x9'),auth['isAuthenticated'](),controller[_0xa0fd('0xe')]);router[_0xa0fd('0xf')](_0xa0fd('0x9'),auth['isAuthenticated'](),controller[_0xa0fd('0x10')]);module[_0xa0fd('0x11')]=router; \ No newline at end of file +var _0x448a=['path','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x4bf89c,_0x1632bc){var _0x3bf7b6=function(_0x5b021f){while(--_0x5b021f){_0x4bf89c['push'](_0x4bf89c['shift']());}};_0x3bf7b6(++_0x1632bc);}(_0x448a,0x1ef));var _0xa448=function(_0x4a3f30,_0x44ad1c){_0x4a3f30=_0x4a3f30-0x0;var _0x1b03eb=_0x448a[_0x4a3f30];return _0x1b03eb;};'use strict';var multer=require('multer');var util=require(_0xa448('0x0'));var path=require(_0xa448('0x1'));var timeout=require('connect-timeout');var express=require(_0xa448('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa448('0x3'));var interaction=require(_0xa448('0x4'));var config=require('../../config/environment');var controller=require(_0xa448('0x5'));router[_0xa448('0x6')]('/',auth[_0xa448('0x7')](),controller[_0xa448('0x8')]);router[_0xa448('0x6')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller['show']);router['post']('/',auth[_0xa448('0x7')](),controller[_0xa448('0xa')]);router[_0xa448('0xb')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller[_0xa448('0xc')]);router[_0xa448('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa448('0xe')]);module[_0xa448('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ae45cda..90a7d9e 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 _0x0717=['exports','sequelize'];(function(_0x545cd3,_0x56761a){var _0x663f8b=function(_0x364458){while(--_0x364458){_0x545cd3['push'](_0x545cd3['shift']());}};_0x663f8b(++_0x56761a);}(_0x0717,0x7d));var _0x7071=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0717[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x7071('0x0'));module[_0x7071('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x0d06=['TEXT','sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0d06,0x94));var _0x60d0=function(_0x460264,_0x51ddff){_0x460264=_0x460264-0x0;var _0x2d75a1=_0x0d06[_0x460264];return _0x2d75a1;};'use strict';var Sequelize=require(_0x60d0('0x0'));module[_0x60d0('0x1')]={'tree':{'type':Sequelize[_0x60d0('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 6e37b09..93fec37 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 _0xc96d=['filters','intersection','fields','attributes','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','type','key','map','query'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xc96d,0x1e4));var _0xdc96=function(_0x364e40,_0x83d809){_0x364e40=_0x364e40-0x0;var _0x4fed2a=_0xc96d[_0x364e40];return _0x4fed2a;};'use strict';var emlformat=require(_0xdc96('0x0'));var rimraf=require(_0xdc96('0x1'));var zipdir=require(_0xdc96('0x2'));var jsonpatch=require(_0xdc96('0x3'));var rp=require(_0xdc96('0x4'));var moment=require(_0xdc96('0x5'));var BPromise=require(_0xdc96('0x6'));var Mustache=require(_0xdc96('0x7'));var util=require(_0xdc96('0x8'));var path=require(_0xdc96('0x9'));var sox=require('sox');var csv=require(_0xdc96('0xa'));var ejs=require(_0xdc96('0xb'));var fs=require('fs');var fs_extra=require(_0xdc96('0xc'));var _=require(_0xdc96('0xd'));var squel=require(_0xdc96('0xe'));var crypto=require(_0xdc96('0xf'));var jsforce=require(_0xdc96('0x10'));var deskjs=require(_0xdc96('0x11'));var toCsv=require(_0xdc96('0xa'));var querystring=require(_0xdc96('0x12'));var Papa=require(_0xdc96('0x13'));var Redis=require('ioredis');var authService=require(_0xdc96('0x14'));var qs=require(_0xdc96('0x15'));var as=require(_0xdc96('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdc96('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc96('0x18'))['db'];function respondWithStatusCode(_0x25cdba,_0x3d38a9){_0x3d38a9=_0x3d38a9||0xcc;return function(_0x3bc79e){if(_0x3bc79e){return _0x25cdba[_0xdc96('0x19')](_0x3d38a9);}return _0x25cdba[_0xdc96('0x1a')](_0x3d38a9)[_0xdc96('0x1b')]();};}function respondWithResult(_0x8c040e,_0x5c0ba5){_0x5c0ba5=_0x5c0ba5||0xc8;return function(_0x1e1183){if(_0x1e1183){return _0x8c040e['status'](_0x5c0ba5)[_0xdc96('0x1c')](_0x1e1183);}};}function respondWithFilteredResult(_0x32a48a,_0x40eb6d){return function(_0x5488eb){if(_0x5488eb){var _0x5f3a9c=typeof _0x40eb6d['offset']===_0xdc96('0x1d')&&typeof _0x40eb6d[_0xdc96('0x1e')]===_0xdc96('0x1d');var _0x47b4a9=_0x5488eb[_0xdc96('0x1f')];var _0x3a38d4=_0x5f3a9c?0x0:_0x40eb6d[_0xdc96('0x20')];var _0x4bf0ae=_0x5f3a9c?_0x5488eb[_0xdc96('0x1f')]:_0x40eb6d[_0xdc96('0x20')]+_0x40eb6d[_0xdc96('0x1e')];var _0x4943b7;if(_0x4bf0ae>=_0x47b4a9){_0x4bf0ae=_0x47b4a9;_0x4943b7=0xc8;}else{_0x4943b7=0xce;}_0x32a48a['status'](_0x4943b7);return _0x32a48a[_0xdc96('0x21')](_0xdc96('0x22'),_0x3a38d4+'-'+_0x4bf0ae+'/'+_0x47b4a9)[_0xdc96('0x1c')](_0x5488eb);}return null;};}function patchUpdates(_0x48b11e){return function(_0x3957ff){try{jsonpatch['apply'](_0x3957ff,_0x48b11e,!![]);}catch(_0x1acc4f){return BPromise[_0xdc96('0x23')](_0x1acc4f);}return _0x3957ff[_0xdc96('0x24')]();};}function saveUpdates(_0x4625fb,_0x5418c6){return function(_0x4e5124){if(_0x4e5124){return _0x4e5124['update'](_0x4625fb)[_0xdc96('0x25')](function(_0x4947d3){return _0x4947d3;});}return null;};}function removeEntity(_0x18abed,_0x2b95dc){return function(_0x249d58){if(_0x249d58){return _0x249d58[_0xdc96('0x26')]()[_0xdc96('0x25')](function(){_0x18abed[_0xdc96('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466086,_0x4052fd){return function(_0x583fff){if(!_0x583fff){_0x466086[_0xdc96('0x19')](0x194);}return _0x583fff;};}function handleError(_0x5639ea,_0x3b8561){_0x3b8561=_0x3b8561||0x1f4;return function(_0xbffd29){logger[_0xdc96('0x27')](_0xbffd29[_0xdc96('0x28')]);if(_0xbffd29[_0xdc96('0x29')]){delete _0xbffd29['name'];}_0x5639ea[_0xdc96('0x1a')](_0x3b8561)[_0xdc96('0x2a')](_0xbffd29);};}exports['index']=function(_0x2de094,_0x463ff8){var _0x2617ce={},_0x3592b1={},_0x15d94d={'count':0x0,'rows':[]};var _0x1990f1=_['map'](db['AnalyticTreeReport'][_0xdc96('0x2b')],function(_0x3b8258){return{'name':_0x3b8258['fieldName'],'type':_0x3b8258[_0xdc96('0x2c')][_0xdc96('0x2d')]};});_0x3592b1['model']=_[_0xdc96('0x2e')](_0x1990f1,'name');_0x3592b1[_0xdc96('0x2f')]=_['keys'](_0x2de094[_0xdc96('0x2f')]);_0x3592b1[_0xdc96('0x30')]=_[_0xdc96('0x31')](_0x3592b1['model'],_0x3592b1[_0xdc96('0x2f')]);_0x2617ce['attributes']=_['intersection'](_0x3592b1['model'],qs[_0xdc96('0x32')](_0x2de094['query']['fields']));_0x2617ce[_0xdc96('0x33')]=_0x2617ce[_0xdc96('0x33')]['length']?_0x2617ce[_0xdc96('0x33')]:_0x3592b1[_0xdc96('0x34')];if(!_0x2de094['query'][_0xdc96('0x35')]('nolimit')){_0x2617ce[_0xdc96('0x1e')]=qs['limit'](_0x2de094[_0xdc96('0x2f')]['limit']);_0x2617ce[_0xdc96('0x20')]=qs[_0xdc96('0x20')](_0x2de094[_0xdc96('0x2f')][_0xdc96('0x20')]);}_0x2617ce[_0xdc96('0x36')]=qs[_0xdc96('0x37')](_0x2de094['query'][_0xdc96('0x37')]);_0x2617ce[_0xdc96('0x38')]=qs[_0xdc96('0x30')](_[_0xdc96('0x39')](_0x2de094['query'],_0x3592b1[_0xdc96('0x30')]),_0x1990f1);if(_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3a')]){_0x2617ce['where']=_[_0xdc96('0x3b')](_0x2617ce['where'],{'$or':_[_0xdc96('0x2e')](_0x1990f1,function(_0x3fed23){if(_0x3fed23[_0xdc96('0x2c')]!==_0xdc96('0x3c')){var _0x3e7f50={};_0x3e7f50[_0x3fed23[_0xdc96('0x29')]]={'$like':'%'+_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3a')]+'%'};return _0x3e7f50;}})});}_0x2617ce=_['merge']({},_0x2617ce,_0x2de094[_0xdc96('0x3d')]);var _0x2cb1ca={'where':_0x2617ce[_0xdc96('0x38')]};return db[_0xdc96('0x3e')]['count'](_0x2cb1ca)[_0xdc96('0x25')](function(_0x477c23){_0x15d94d[_0xdc96('0x1f')]=_0x477c23;if(_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3f')]){_0x2617ce[_0xdc96('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xdc96('0x41')](_0x2617ce);})[_0xdc96('0x25')](function(_0x26b6fe){_0x15d94d[_0xdc96('0x42')]=_0x26b6fe;return _0x15d94d;})[_0xdc96('0x25')](respondWithFilteredResult(_0x463ff8,_0x2617ce))['catch'](handleError(_0x463ff8,null));};exports[_0xdc96('0x43')]=function(_0x1ae9cb,_0x5347cd){var _0x21ff11={'raw':!![],'where':{'id':_0x1ae9cb['params']['id']}},_0x5d7021={};_0x5d7021[_0xdc96('0x34')]=_['keys'](db[_0xdc96('0x3e')]['rawAttributes']);_0x5d7021[_0xdc96('0x2f')]=_[_0xdc96('0x44')](_0x1ae9cb[_0xdc96('0x2f')]);_0x5d7021[_0xdc96('0x30')]=_[_0xdc96('0x31')](_0x5d7021['model'],_0x5d7021[_0xdc96('0x2f')]);_0x21ff11[_0xdc96('0x33')]=_['intersection'](_0x5d7021[_0xdc96('0x34')],qs[_0xdc96('0x32')](_0x1ae9cb[_0xdc96('0x2f')][_0xdc96('0x32')]));_0x21ff11[_0xdc96('0x33')]=_0x21ff11[_0xdc96('0x33')][_0xdc96('0x45')]?_0x21ff11['attributes']:_0x5d7021[_0xdc96('0x34')];if(_0x1ae9cb[_0xdc96('0x2f')][_0xdc96('0x3f')]){_0x21ff11[_0xdc96('0x40')]=[{'all':!![]}];}_0x21ff11=_[_0xdc96('0x3b')]({},_0x21ff11,_0x1ae9cb[_0xdc96('0x3d')]);return db['AnalyticTreeReport'][_0xdc96('0x46')](_0x21ff11)[_0xdc96('0x25')](handleEntityNotFound(_0x5347cd,null))['then'](respondWithResult(_0x5347cd,null))[_0xdc96('0x47')](handleError(_0x5347cd,null));};exports['create']=function(_0x4c6557,_0x5d76c6){return db['AnalyticTreeReport'][_0xdc96('0x48')](_0x4c6557[_0xdc96('0x49')],{})[_0xdc96('0x25')](respondWithResult(_0x5d76c6,0xc9))['catch'](handleError(_0x5d76c6,null));};exports[_0xdc96('0x4a')]=function(_0x4a00f7,_0x5c7cf6){if(_0x4a00f7[_0xdc96('0x49')]['id']){delete _0x4a00f7[_0xdc96('0x49')]['id'];}return db[_0xdc96('0x3e')]['find']({'where':{'id':_0x4a00f7[_0xdc96('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c7cf6,null))[_0xdc96('0x25')](saveUpdates(_0x4a00f7['body'],null))['then'](respondWithResult(_0x5c7cf6,null))[_0xdc96('0x47')](handleError(_0x5c7cf6,null));};exports['destroy']=function(_0x48337e,_0x266f1e){return db[_0xdc96('0x3e')]['find']({'where':{'id':_0x48337e[_0xdc96('0x4b')]['id']}})[_0xdc96('0x25')](handleEntityNotFound(_0x266f1e,null))['then'](removeEntity(_0x266f1e,null))[_0xdc96('0x47')](handleError(_0x266f1e,null));}; \ No newline at end of file +var _0x3417=['rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','AnalyticTreeReport'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3417,0x6a));var _0x7341=function(_0x3c51b1,_0x1fdd45){_0x3c51b1=_0x3c51b1-0x0;var _0x1b2bc2=_0x3417[_0x3c51b1];return _0x1b2bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7341('0x0'));var zipdir=require(_0x7341('0x1'));var jsonpatch=require(_0x7341('0x2'));var rp=require(_0x7341('0x3'));var moment=require(_0x7341('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7341('0x5'));var path=require(_0x7341('0x6'));var sox=require(_0x7341('0x7'));var csv=require('to-csv');var ejs=require(_0x7341('0x8'));var fs=require('fs');var fs_extra=require(_0x7341('0x9'));var _=require('lodash');var squel=require(_0x7341('0xa'));var crypto=require(_0x7341('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7341('0xc'));var toCsv=require(_0x7341('0xd'));var querystring=require(_0x7341('0xe'));var Papa=require('papaparse');var Redis=require(_0x7341('0xf'));var authService=require(_0x7341('0x10'));var qs=require(_0x7341('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7341('0x12'));var logger=require(_0x7341('0x13'))(_0x7341('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7341('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c7c8a,_0x30e0a2){_0x30e0a2=_0x30e0a2||0xcc;return function(_0xfcf74d){if(_0xfcf74d){return _0x3c7c8a['sendStatus'](_0x30e0a2);}return _0x3c7c8a[_0x7341('0x16')](_0x30e0a2)[_0x7341('0x17')]();};}function respondWithResult(_0x3b8842,_0x2dc22e){_0x2dc22e=_0x2dc22e||0xc8;return function(_0x460afe){if(_0x460afe){return _0x3b8842[_0x7341('0x16')](_0x2dc22e)[_0x7341('0x18')](_0x460afe);}};}function respondWithFilteredResult(_0x1d6d1d,_0x4cbcb5){return function(_0x104b8d){if(_0x104b8d){var _0x3f74d2=typeof _0x4cbcb5[_0x7341('0x19')]===_0x7341('0x1a')&&typeof _0x4cbcb5['limit']===_0x7341('0x1a');var _0x7ae82b=_0x104b8d[_0x7341('0x1b')];var _0xc204f5=_0x3f74d2?0x0:_0x4cbcb5[_0x7341('0x19')];var _0x305657=_0x3f74d2?_0x104b8d[_0x7341('0x1b')]:_0x4cbcb5[_0x7341('0x19')]+_0x4cbcb5['limit'];var _0x4214f3;if(_0x305657>=_0x7ae82b){_0x305657=_0x7ae82b;_0x4214f3=0xc8;}else{_0x4214f3=0xce;}_0x1d6d1d[_0x7341('0x16')](_0x4214f3);return _0x1d6d1d[_0x7341('0x1c')](_0x7341('0x1d'),_0xc204f5+'-'+_0x305657+'/'+_0x7ae82b)[_0x7341('0x18')](_0x104b8d);}return null;};}function patchUpdates(_0x405d47){return function(_0x1b83b7){try{jsonpatch[_0x7341('0x1e')](_0x1b83b7,_0x405d47,!![]);}catch(_0x167847){return BPromise['reject'](_0x167847);}return _0x1b83b7[_0x7341('0x1f')]();};}function saveUpdates(_0x214f59,_0x46d4bd){return function(_0xedb8f6){if(_0xedb8f6){return _0xedb8f6[_0x7341('0x20')](_0x214f59)[_0x7341('0x21')](function(_0x1be382){return _0x1be382;});}return null;};}function removeEntity(_0x52f9d4,_0x2a78d7){return function(_0x242074){if(_0x242074){return _0x242074[_0x7341('0x22')]()[_0x7341('0x21')](function(){_0x52f9d4[_0x7341('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50b152,_0x17b3e4){return function(_0x12a06e){if(!_0x12a06e){_0x50b152[_0x7341('0x23')](0x194);}return _0x12a06e;};}function handleError(_0xcd88bd,_0x40916b){_0x40916b=_0x40916b||0x1f4;return function(_0xb8829e){logger[_0x7341('0x24')](_0xb8829e['stack']);if(_0xb8829e[_0x7341('0x25')]){delete _0xb8829e[_0x7341('0x25')];}_0xcd88bd[_0x7341('0x16')](_0x40916b)['send'](_0xb8829e);};}exports[_0x7341('0x26')]=function(_0x5f5da0,_0xf96ac4){var _0x5b5b0d={},_0x209733={},_0x5c129c={'count':0x0,'rows':[]};var _0x3e1873=_['map'](db[_0x7341('0x27')][_0x7341('0x28')],function(_0x27ff50){return{'name':_0x27ff50[_0x7341('0x29')],'type':_0x27ff50[_0x7341('0x2a')][_0x7341('0x2b')]};});_0x209733['model']=_[_0x7341('0x2c')](_0x3e1873,_0x7341('0x25'));_0x209733[_0x7341('0x2d')]=_[_0x7341('0x2e')](_0x5f5da0[_0x7341('0x2d')]);_0x209733[_0x7341('0x2f')]=_['intersection'](_0x209733[_0x7341('0x30')],_0x209733['query']);_0x5b5b0d[_0x7341('0x31')]=_[_0x7341('0x32')](_0x209733['model'],qs['fields'](_0x5f5da0['query'][_0x7341('0x33')]));_0x5b5b0d['attributes']=_0x5b5b0d[_0x7341('0x31')]['length']?_0x5b5b0d[_0x7341('0x31')]:_0x209733[_0x7341('0x30')];if(!_0x5f5da0[_0x7341('0x2d')][_0x7341('0x34')](_0x7341('0x35'))){_0x5b5b0d[_0x7341('0x36')]=qs[_0x7341('0x36')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x36')]);_0x5b5b0d[_0x7341('0x19')]=qs['offset'](_0x5f5da0['query']['offset']);}_0x5b5b0d[_0x7341('0x37')]=qs[_0x7341('0x38')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x38')]);_0x5b5b0d[_0x7341('0x39')]=qs[_0x7341('0x2f')](_[_0x7341('0x3a')](_0x5f5da0[_0x7341('0x2d')],_0x209733['filters']),_0x3e1873);if(_0x5f5da0['query'][_0x7341('0x3b')]){_0x5b5b0d['where']=_[_0x7341('0x3c')](_0x5b5b0d[_0x7341('0x39')],{'$or':_[_0x7341('0x2c')](_0x3e1873,function(_0x815383){if(_0x815383['type']!==_0x7341('0x3d')){var _0x9dd907={};_0x9dd907[_0x815383[_0x7341('0x25')]]={'$like':'%'+_0x5f5da0['query'][_0x7341('0x3b')]+'%'};return _0x9dd907;}})});}_0x5b5b0d=_[_0x7341('0x3c')]({},_0x5b5b0d,_0x5f5da0[_0x7341('0x3e')]);var _0x28d076={'where':_0x5b5b0d[_0x7341('0x39')]};return db[_0x7341('0x27')][_0x7341('0x1b')](_0x28d076)[_0x7341('0x21')](function(_0x3e5ffb){_0x5c129c[_0x7341('0x1b')]=_0x3e5ffb;if(_0x5f5da0[_0x7341('0x2d')][_0x7341('0x3f')]){_0x5b5b0d[_0x7341('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x7341('0x41')](_0x5b5b0d);})['then'](function(_0x3e2a18){_0x5c129c[_0x7341('0x42')]=_0x3e2a18;return _0x5c129c;})[_0x7341('0x21')](respondWithFilteredResult(_0xf96ac4,_0x5b5b0d))['catch'](handleError(_0xf96ac4,null));};exports[_0x7341('0x43')]=function(_0xf62635,_0xd34c72){var _0x3588ff={'raw':!![],'where':{'id':_0xf62635[_0x7341('0x44')]['id']}},_0x519f12={};_0x519f12[_0x7341('0x30')]=_[_0x7341('0x2e')](db[_0x7341('0x27')][_0x7341('0x28')]);_0x519f12[_0x7341('0x2d')]=_['keys'](_0xf62635['query']);_0x519f12[_0x7341('0x2f')]=_['intersection'](_0x519f12[_0x7341('0x30')],_0x519f12[_0x7341('0x2d')]);_0x3588ff[_0x7341('0x31')]=_[_0x7341('0x32')](_0x519f12[_0x7341('0x30')],qs[_0x7341('0x33')](_0xf62635['query'][_0x7341('0x33')]));_0x3588ff[_0x7341('0x31')]=_0x3588ff[_0x7341('0x31')]['length']?_0x3588ff[_0x7341('0x31')]:_0x519f12[_0x7341('0x30')];if(_0xf62635[_0x7341('0x2d')][_0x7341('0x3f')]){_0x3588ff[_0x7341('0x40')]=[{'all':!![]}];}_0x3588ff=_['merge']({},_0x3588ff,_0xf62635[_0x7341('0x3e')]);return db['AnalyticTreeReport']['find'](_0x3588ff)[_0x7341('0x21')](handleEntityNotFound(_0xd34c72,null))[_0x7341('0x21')](respondWithResult(_0xd34c72,null))[_0x7341('0x45')](handleError(_0xd34c72,null));};exports[_0x7341('0x46')]=function(_0x1a2290,_0x430c00){return db[_0x7341('0x27')][_0x7341('0x46')](_0x1a2290[_0x7341('0x47')],{})[_0x7341('0x21')](respondWithResult(_0x430c00,0xc9))[_0x7341('0x45')](handleError(_0x430c00,null));};exports[_0x7341('0x20')]=function(_0x44605f,_0x3c8927){if(_0x44605f[_0x7341('0x47')]['id']){delete _0x44605f[_0x7341('0x47')]['id'];}return db[_0x7341('0x27')][_0x7341('0x48')]({'where':{'id':_0x44605f['params']['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x3c8927,null))['then'](saveUpdates(_0x44605f[_0x7341('0x47')],null))['then'](respondWithResult(_0x3c8927,null))[_0x7341('0x45')](handleError(_0x3c8927,null));};exports['destroy']=function(_0x4b198b,_0x4dedd6){return db[_0x7341('0x27')]['find']({'where':{'id':_0x4b198b[_0x7341('0x44')]['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x4dedd6,null))[_0x7341('0x21')](removeEntity(_0x4dedd6,null))[_0x7341('0x45')](handleError(_0x4dedd6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 457cf3c..65ab224 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 _0x1ff6=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x4a567a,_0x9c9416){var _0x5bc161=function(_0x2c11d0){while(--_0x2c11d0){_0x4a567a['push'](_0x4a567a['shift']());}};_0x5bc161(++_0x9c9416);}(_0x1ff6,0x17b));var _0x61ff=function(_0x5b8c2b,_0x155bc3){_0x5b8c2b=_0x5b8c2b-0x0;var _0xe1ff56=_0x1ff6[_0x5b8c2b];return _0xe1ff56;};'use strict';var _=require(_0x61ff('0x0'));var util=require(_0x61ff('0x1'));var logger=require(_0x61ff('0x2'))(_0x61ff('0x3'));var moment=require(_0x61ff('0x4'));var BPromise=require(_0x61ff('0x5'));var rp=require(_0x61ff('0x6'));var fs=require('fs');var path=require(_0x61ff('0x7'));var rimraf=require(_0x61ff('0x8'));var config=require(_0x61ff('0x9'));var attributes=require(_0x61ff('0xa'));module[_0x61ff('0xb')]=function(_0x41888a,_0x82f97e){return _0x41888a['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabeb=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0xabeb,0x153));var _0xbabe=function(_0x5c6bc9,_0x4276f7){_0x5c6bc9=_0x5c6bc9-0x0;var _0x5b1fa5=_0xabeb[_0x5c6bc9];return _0x5b1fa5;};'use strict';var _=require('lodash');var util=require(_0xbabe('0x0'));var logger=require(_0xbabe('0x1'))(_0xbabe('0x2'));var moment=require('moment');var BPromise=require(_0xbabe('0x3'));var rp=require(_0xbabe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbabe('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xbabe('0x6')]=function(_0x13c5de,_0x2f9e91){return _0x13c5de[_0xbabe('0x7')](_0xbabe('0x8'),attributes,{'tableName':_0xbabe('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 eea84c5..3b5ac47 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x55571d,_0x3f8d26){var _0x361198=function(_0x273ffd){while(--_0x273ffd){_0x55571d['push'](_0x55571d['shift']());}};_0x361198(++_0x3f8d26);}(_0x1261,0x144));var _0x1126=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x1261[_0x30c649];return _0x3edfb9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x59628a,_0x701f80){var _0x3899e4=function(_0xab737c){while(--_0xab737c){_0x59628a['push'](_0x59628a['shift']());}};_0x3899e4(++_0x701f80);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 9319957..18e7431 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 _0x8522=['create','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0x18becc,_0x1600ef){var _0xf6760f=function(_0x4c8a2d){while(--_0x4c8a2d){_0x18becc['push'](_0x18becc['shift']());}};_0xf6760f(++_0x1600ef);}(_0x8522,0x124));var _0x2852=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x8522[_0x28fbbf];return _0x543af6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2852('0x0'));var timeout=require(_0x2852('0x1'));var express=require(_0x2852('0x2'));var router=express[_0x2852('0x3')]();var fs_extra=require(_0x2852('0x4'));var auth=require(_0x2852('0x5'));var interaction=require(_0x2852('0x6'));var config=require(_0x2852('0x7'));var controller=require(_0x2852('0x8'));router['get']('/',auth[_0x2852('0x9')](),controller[_0x2852('0xa')]);router[_0x2852('0xb')](_0x2852('0xc'),auth[_0x2852('0x9')](),controller[_0x2852('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2852('0xe')]);router[_0x2852('0xf')](_0x2852('0xc'),auth['isAuthenticated'](),controller[_0x2852('0x10')]);router['delete'](_0x2852('0xc'),auth['isAuthenticated'](),controller[_0x2852('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb58b=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x503c6a,_0x738a9d){var _0x5f591e=function(_0x5d080c){while(--_0x5d080c){_0x503c6a['push'](_0x503c6a['shift']());}};_0x5f591e(++_0x738a9d);}(_0xb58b,0x1e8));var _0xbb58=function(_0x4797f8,_0x2ebab8){_0x4797f8=_0x4797f8-0x0;var _0x4062be=_0xb58b[_0x4797f8];return _0x4062be;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require(_0xbb58('0x3'));var router=express['Router']();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require(_0xbb58('0x6'));var controller=require(_0xbb58('0x7'));router[_0xbb58('0x8')]('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x8')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xc')]);router['post']('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xd')]);router['put'](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xf')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0x10')]);module[_0xbb58('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 d0c68ff..5b40364 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 _0x85d8=['sequelize','exports','STRING'];(function(_0x58a2d1,_0x704141){var _0x5833db=function(_0x2af0b2){while(--_0x2af0b2){_0x58a2d1['push'](_0x58a2d1['shift']());}};_0x5833db(++_0x704141);}(_0x85d8,0x1b0));var _0x885d=function(_0x238d72,_0x5b9350){_0x238d72=_0x238d72-0x0;var _0x29e624=_0x85d8[_0x238d72];return _0x29e624;};'use strict';var Sequelize=require(_0x885d('0x0'));module[_0x885d('0x1')]={'name':{'type':Sequelize[_0x885d('0x2')]},'basename':{'type':Sequelize[_0x885d('0x2')]},'type':{'type':Sequelize[_0x885d('0x2')]}}; \ No newline at end of file +var _0x097c=['STRING','sequelize','exports'];(function(_0x74e775,_0x1c394f){var _0x1b0bd1=function(_0x3ac740){while(--_0x3ac740){_0x74e775['push'](_0x74e775['shift']());}};_0x1b0bd1(++_0x1c394f);}(_0x097c,0x1d5));var _0xc097=function(_0x1241aa,_0x323da9){_0x1241aa=_0x1241aa-0x0;var _0x44d356=_0x097c[_0x1241aa];return _0x44d356;};'use strict';var Sequelize=require(_0xc097('0x0'));module[_0xc097('0x1')]={'name':{'type':Sequelize[_0xc097('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc097('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d8f8e4b..7cf4eb6 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 _0xfd1b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','params','length','find','get','createdAt','updatedAt','body','omit','create','destroy','file','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x57b3f9,_0x5a4ef5){var _0xbc5579=function(_0x4f67a0){while(--_0x4f67a0){_0x57b3f9['push'](_0x57b3f9['shift']());}};_0xbc5579(++_0x5a4ef5);}(_0xfd1b,0x1ab));var _0xbfd1=function(_0x2e3dd1,_0x29b549){_0x2e3dd1=_0x2e3dd1-0x0;var _0x39de59=_0xfd1b[_0x2e3dd1];return _0x39de59;};'use strict';var emlformat=require(_0xbfd1('0x0'));var rimraf=require(_0xbfd1('0x1'));var zipdir=require(_0xbfd1('0x2'));var jsonpatch=require(_0xbfd1('0x3'));var rp=require(_0xbfd1('0x4'));var moment=require('moment');var BPromise=require(_0xbfd1('0x5'));var Mustache=require(_0xbfd1('0x6'));var util=require('util');var path=require(_0xbfd1('0x7'));var sox=require(_0xbfd1('0x8'));var csv=require(_0xbfd1('0x9'));var ejs=require(_0xbfd1('0xa'));var fs=require('fs');var fs_extra=require(_0xbfd1('0xb'));var _=require(_0xbfd1('0xc'));var squel=require(_0xbfd1('0xd'));var crypto=require(_0xbfd1('0xe'));var jsforce=require(_0xbfd1('0xf'));var deskjs=require(_0xbfd1('0x10'));var toCsv=require(_0xbfd1('0x9'));var querystring=require('querystring');var Papa=require(_0xbfd1('0x11'));var Redis=require('ioredis');var authService=require(_0xbfd1('0x12'));var qs=require(_0xbfd1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfd1('0x14'));var logger=require(_0xbfd1('0x15'))('api');var utils=require(_0xbfd1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfd1('0x17'))['db'];function respondWithStatusCode(_0x36ab7a,_0x1ec7c5){_0x1ec7c5=_0x1ec7c5||0xcc;return function(_0x5cee80){if(_0x5cee80){return _0x36ab7a[_0xbfd1('0x18')](_0x1ec7c5);}return _0x36ab7a[_0xbfd1('0x19')](_0x1ec7c5)[_0xbfd1('0x1a')]();};}function respondWithResult(_0x258fde,_0x1e15df){_0x1e15df=_0x1e15df||0xc8;return function(_0x49fa53){if(_0x49fa53){return _0x258fde[_0xbfd1('0x19')](_0x1e15df)[_0xbfd1('0x1b')](_0x49fa53);}};}function respondWithFilteredResult(_0x50a2ea,_0x4be34d){return function(_0x3e96ca){if(_0x3e96ca){var _0x240654=typeof _0x4be34d['offset']===_0xbfd1('0x1c')&&typeof _0x4be34d[_0xbfd1('0x1d')]==='undefined';var _0x5a5f33=_0x3e96ca[_0xbfd1('0x1e')];var _0x57b2f2=_0x240654?0x0:_0x4be34d[_0xbfd1('0x1f')];var _0x36d79b=_0x240654?_0x3e96ca[_0xbfd1('0x1e')]:_0x4be34d[_0xbfd1('0x1f')]+_0x4be34d[_0xbfd1('0x1d')];var _0x29fcfe;if(_0x36d79b>=_0x5a5f33){_0x36d79b=_0x5a5f33;_0x29fcfe=0xc8;}else{_0x29fcfe=0xce;}_0x50a2ea[_0xbfd1('0x19')](_0x29fcfe);return _0x50a2ea[_0xbfd1('0x20')](_0xbfd1('0x21'),_0x57b2f2+'-'+_0x36d79b+'/'+_0x5a5f33)[_0xbfd1('0x1b')](_0x3e96ca);}return null;};}function patchUpdates(_0xe11483){return function(_0x4a6419){try{jsonpatch['apply'](_0x4a6419,_0xe11483,!![]);}catch(_0x1ce5d4){return BPromise[_0xbfd1('0x22')](_0x1ce5d4);}return _0x4a6419[_0xbfd1('0x23')]();};}function saveUpdates(_0x436f45,_0x45b4a4){return function(_0x2a77c6){if(_0x2a77c6){return _0x2a77c6[_0xbfd1('0x24')](_0x436f45)['then'](function(_0x42b616){return _0x42b616;});}return null;};}function removeEntity(_0x337f34,_0xd1ccc4){return function(_0x4a981a){if(_0x4a981a){return _0x4a981a['destroy']()['then'](function(){_0x337f34['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8151,_0x283cdd){return function(_0x4ea1fe){if(!_0x4ea1fe){_0x4e8151[_0xbfd1('0x18')](0x194);}return _0x4ea1fe;};}function handleError(_0x36f07e,_0x2bf725){_0x2bf725=_0x2bf725||0x1f4;return function(_0xeda9d0){logger[_0xbfd1('0x25')](_0xeda9d0['stack']);if(_0xeda9d0[_0xbfd1('0x26')]){delete _0xeda9d0[_0xbfd1('0x26')];}_0x36f07e[_0xbfd1('0x19')](_0x2bf725)[_0xbfd1('0x27')](_0xeda9d0);};}exports[_0xbfd1('0x28')]=function(_0xd0fab8,_0x15533d){var _0x1febe6={},_0x890073={},_0x22df43={'count':0x0,'rows':[]};var _0x281bc8=_[_0xbfd1('0x29')](db[_0xbfd1('0x2a')][_0xbfd1('0x2b')],function(_0x3e2df4){return{'name':_0x3e2df4[_0xbfd1('0x2c')],'type':_0x3e2df4[_0xbfd1('0x2d')][_0xbfd1('0x2e')]};});_0x890073[_0xbfd1('0x2f')]=_[_0xbfd1('0x29')](_0x281bc8,_0xbfd1('0x26'));_0x890073[_0xbfd1('0x30')]=_[_0xbfd1('0x31')](_0xd0fab8[_0xbfd1('0x30')]);_0x890073[_0xbfd1('0x32')]=_[_0xbfd1('0x33')](_0x890073[_0xbfd1('0x2f')],_0x890073['query']);_0x1febe6[_0xbfd1('0x34')]=_[_0xbfd1('0x33')](_0x890073['model'],qs[_0xbfd1('0x35')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x35')]));_0x1febe6[_0xbfd1('0x34')]=_0x1febe6[_0xbfd1('0x34')]['length']?_0x1febe6[_0xbfd1('0x34')]:_0x890073['model'];if(!_0xd0fab8['query'][_0xbfd1('0x36')]('nolimit')){_0x1febe6['limit']=qs[_0xbfd1('0x1d')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x1d')]);_0x1febe6[_0xbfd1('0x1f')]=qs[_0xbfd1('0x1f')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x1f')]);}_0x1febe6['order']=qs[_0xbfd1('0x37')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x37')]);_0x1febe6[_0xbfd1('0x38')]=qs['filters'](_[_0xbfd1('0x39')](_0xd0fab8['query'],_0x890073[_0xbfd1('0x32')]),_0x281bc8);if(_0xd0fab8[_0xbfd1('0x30')]['filter']){_0x1febe6['where']=_[_0xbfd1('0x3a')](_0x1febe6['where'],{'$or':_[_0xbfd1('0x29')](_0x281bc8,function(_0x11fc76){if(_0x11fc76[_0xbfd1('0x2d')]!==_0xbfd1('0x3b')){var _0x1916d1={};_0x1916d1[_0x11fc76[_0xbfd1('0x26')]]={'$like':'%'+_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x3c')]+'%'};return _0x1916d1;}})});}_0x1febe6=_[_0xbfd1('0x3a')]({},_0x1febe6,_0xd0fab8[_0xbfd1('0x3d')]);var _0x3d025c={'where':_0x1febe6[_0xbfd1('0x38')]};return db[_0xbfd1('0x2a')]['count'](_0x3d025c)[_0xbfd1('0x3e')](function(_0x5ad8f4){_0x22df43['count']=_0x5ad8f4;if(_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x1febe6[_0xbfd1('0x40')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1febe6);})[_0xbfd1('0x3e')](function(_0x25303a){_0x22df43[_0xbfd1('0x41')]=_0x25303a;return _0x22df43;})[_0xbfd1('0x3e')](respondWithFilteredResult(_0x15533d,_0x1febe6))[_0xbfd1('0x42')](handleError(_0x15533d,null));};exports[_0xbfd1('0x43')]=function(_0x265abb,_0x434b27){var _0x4d8c5d={'raw':!![],'where':{'id':_0x265abb[_0xbfd1('0x44')]['id']}},_0x380185={};_0x380185[_0xbfd1('0x2f')]=_[_0xbfd1('0x31')](db[_0xbfd1('0x2a')]['rawAttributes']);_0x380185['query']=_[_0xbfd1('0x31')](_0x265abb[_0xbfd1('0x30')]);_0x380185['filters']=_['intersection'](_0x380185[_0xbfd1('0x2f')],_0x380185['query']);_0x4d8c5d[_0xbfd1('0x34')]=_[_0xbfd1('0x33')](_0x380185['model'],qs['fields'](_0x265abb[_0xbfd1('0x30')][_0xbfd1('0x35')]));_0x4d8c5d[_0xbfd1('0x34')]=_0x4d8c5d[_0xbfd1('0x34')][_0xbfd1('0x45')]?_0x4d8c5d['attributes']:_0x380185[_0xbfd1('0x2f')];if(_0x265abb[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x4d8c5d[_0xbfd1('0x40')]=[{'all':!![]}];}_0x4d8c5d=_[_0xbfd1('0x3a')]({},_0x4d8c5d,_0x265abb[_0xbfd1('0x3d')]);return db[_0xbfd1('0x2a')][_0xbfd1('0x46')](_0x4d8c5d)[_0xbfd1('0x3e')](handleEntityNotFound(_0x434b27,null))[_0xbfd1('0x3e')](respondWithResult(_0x434b27,null))[_0xbfd1('0x42')](handleError(_0x434b27,null));};exports['clone']=function(_0xc29bc2,_0x1efc64){var _0x2184f8={'where':{'id':_0xc29bc2[_0xbfd1('0x44')]['id']}},_0x3cf05c={};_0x3cf05c[_0xbfd1('0x2f')]=_[_0xbfd1('0x31')](db[_0xbfd1('0x2a')][_0xbfd1('0x2b')]);_0x2184f8['attributes']=_[_0xbfd1('0x33')](_0x3cf05c[_0xbfd1('0x2f')],qs['fields'](_0xc29bc2['query']['fields']));_0x2184f8[_0xbfd1('0x34')]=_0x2184f8[_0xbfd1('0x34')][_0xbfd1('0x45')]?_0x2184f8[_0xbfd1('0x34')]:_0x3cf05c[_0xbfd1('0x2f')];if(_0xc29bc2[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x2184f8['include']=[{'all':!![]}];}_0x2184f8=_[_0xbfd1('0x3a')]({},_0x2184f8,_0xc29bc2[_0xbfd1('0x3d')]);return db[_0xbfd1('0x2a')][_0xbfd1('0x46')](_0x2184f8)[_0xbfd1('0x3e')](handleEntityNotFound(_0x1efc64,null))[_0xbfd1('0x3e')](function(_0x24bbb6){if(_0x24bbb6){var _0x358a5d=_0x24bbb6[_0xbfd1('0x47')]({'plain':!![]});_0x358a5d=qs['omit'](_0x358a5d,['id',_0xbfd1('0x48'),_0xbfd1('0x49')]);_0xc29bc2[_0xbfd1('0x4a')]=_[_0xbfd1('0x4b')](_0xc29bc2['body'],['id',_0xbfd1('0x48'),_0xbfd1('0x49')]);return db['Attachment'][_0xbfd1('0x4c')](_[_0xbfd1('0x3a')](_0x358a5d,_0xc29bc2['body']),{'include':_0xc29bc2['query'][_0xbfd1('0x3f')]?[{'all':!![]}]:undefined});}})[_0xbfd1('0x3e')](respondWithResult(_0x1efc64,0xc9))[_0xbfd1('0x42')](handleError(_0x1efc64,null));};exports[_0xbfd1('0x24')]=function(_0x8f22a1,_0x3a4d78){if(_0x8f22a1[_0xbfd1('0x4a')]['id']){delete _0x8f22a1[_0xbfd1('0x4a')]['id'];}return db[_0xbfd1('0x2a')]['find']({'where':{'id':_0x8f22a1[_0xbfd1('0x44')]['id']}})[_0xbfd1('0x3e')](handleEntityNotFound(_0x3a4d78,null))['then'](saveUpdates(_0x8f22a1['body'],null))['then'](respondWithResult(_0x3a4d78,null))['catch'](handleError(_0x3a4d78,null));};exports[_0xbfd1('0x4d')]=function(_0x517dfa,_0x264ecf){return db[_0xbfd1('0x2a')][_0xbfd1('0x46')]({'where':{'id':_0x517dfa['params']['id']}})['then'](handleEntityNotFound(_0x264ecf,null))['then'](removeEntity(_0x264ecf,null))[_0xbfd1('0x42')](handleError(_0x264ecf,null));};exports[_0xbfd1('0x4c')]=function(_0x4c8dfe,_0x3ffb30,_0x1d9e6a){_0x4c8dfe[_0xbfd1('0x4a')][_0xbfd1('0x26')]=_0x4c8dfe[_0xbfd1('0x4e')]['originalname'];_0x4c8dfe[_0xbfd1('0x4a')][_0xbfd1('0x4f')]=_0x4c8dfe[_0xbfd1('0x4e')][_0xbfd1('0x50')];_0x4c8dfe[_0xbfd1('0x4a')]['type']=_0x4c8dfe[_0xbfd1('0x4e')][_0xbfd1('0x51')];return db[_0xbfd1('0x2a')]['create'](_0x4c8dfe[_0xbfd1('0x4a')])[_0xbfd1('0x3e')](respondWithResult(_0x3ffb30,0xc9))[_0xbfd1('0x42')](handleError(_0x3ffb30,null));};exports['download']=function(_0x22b08e,_0x4484da,_0x46c44b){return db[_0xbfd1('0x2a')][_0xbfd1('0x52')]({'where':{'id':_0x22b08e[_0xbfd1('0x44')]['id']},'raw':!![]})[_0xbfd1('0x3e')](handleEntityNotFound(_0x4484da,null))[_0xbfd1('0x3e')](function(_0x377387){if(_0x377387){var _0x5df941=_0x377387[_0xbfd1('0x53')]!==null;var _0x138b1d=path['join'](config[_0xbfd1('0x54')],'server/files/attachments/');if(_0x5df941){_0x138b1d=path[_0xbfd1('0x55')](_0x138b1d,_0xbfd1('0x56'));}var _0x446b55=path[_0xbfd1('0x55')](_0x138b1d,_0x377387[_0xbfd1('0x4f')]);return _0x4484da['download'](_0x446b55);}})[_0xbfd1('0x42')](handleError(_0x4484da,null));}; \ No newline at end of file +var _0xaa4c=['join','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Attachment','findAll','catch','show','find','clone','params','includeAll','get','createdAt','omit','body','updatedAt','create','update','destroy','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xaa4c,0x1b6));var _0xcaa4=function(_0x9ded82,_0xca5381){_0x9ded82=_0x9ded82-0x0;var _0x30c7a6=_0xaa4c[_0x9ded82];return _0x30c7a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcaa4('0x0'));var jsonpatch=require(_0xcaa4('0x1'));var rp=require(_0xcaa4('0x2'));var moment=require(_0xcaa4('0x3'));var BPromise=require(_0xcaa4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcaa4('0x5'));var sox=require(_0xcaa4('0x6'));var csv=require(_0xcaa4('0x7'));var ejs=require(_0xcaa4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa4('0x9'));var squel=require('squel');var crypto=require(_0xcaa4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcaa4('0xb'));var toCsv=require(_0xcaa4('0x7'));var querystring=require(_0xcaa4('0xc'));var Papa=require('papaparse');var Redis=require(_0xcaa4('0xd'));var authService=require(_0xcaa4('0xe'));var qs=require(_0xcaa4('0xf'));var as=require(_0xcaa4('0x10'));var hardwareService=require(_0xcaa4('0x11'));var logger=require(_0xcaa4('0x12'))(_0xcaa4('0x13'));var utils=require(_0xcaa4('0x14'));var config=require(_0xcaa4('0x15'));var licenseUtil=require(_0xcaa4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c167,_0x46752f){_0x46752f=_0x46752f||0xcc;return function(_0x4ec7b9){if(_0x4ec7b9){return _0x18c167[_0xcaa4('0x17')](_0x46752f);}return _0x18c167[_0xcaa4('0x18')](_0x46752f)[_0xcaa4('0x19')]();};}function respondWithResult(_0xdccc15,_0x5170cb){_0x5170cb=_0x5170cb||0xc8;return function(_0x278a14){if(_0x278a14){return _0xdccc15[_0xcaa4('0x18')](_0x5170cb)[_0xcaa4('0x1a')](_0x278a14);}};}function respondWithFilteredResult(_0x282f16,_0x5c6f4c){return function(_0x4d31d5){if(_0x4d31d5){var _0x47875a=typeof _0x5c6f4c[_0xcaa4('0x1b')]===_0xcaa4('0x1c')&&typeof _0x5c6f4c[_0xcaa4('0x1d')]===_0xcaa4('0x1c');var _0x541793=_0x4d31d5[_0xcaa4('0x1e')];var _0x4b96e6=_0x47875a?0x0:_0x5c6f4c[_0xcaa4('0x1b')];var _0x442d46=_0x47875a?_0x4d31d5[_0xcaa4('0x1e')]:_0x5c6f4c[_0xcaa4('0x1b')]+_0x5c6f4c[_0xcaa4('0x1d')];var _0x3f26fa;if(_0x442d46>=_0x541793){_0x442d46=_0x541793;_0x3f26fa=0xc8;}else{_0x3f26fa=0xce;}_0x282f16[_0xcaa4('0x18')](_0x3f26fa);return _0x282f16[_0xcaa4('0x1f')](_0xcaa4('0x20'),_0x4b96e6+'-'+_0x442d46+'/'+_0x541793)['json'](_0x4d31d5);}return null;};}function patchUpdates(_0x100870){return function(_0x3a222a){try{jsonpatch['apply'](_0x3a222a,_0x100870,!![]);}catch(_0x45da81){return BPromise['reject'](_0x45da81);}return _0x3a222a[_0xcaa4('0x21')]();};}function saveUpdates(_0x44f8cb,_0x4d52c9){return function(_0x1ea7bb){if(_0x1ea7bb){return _0x1ea7bb['update'](_0x44f8cb)[_0xcaa4('0x22')](function(_0x3b51f4){return _0x3b51f4;});}return null;};}function removeEntity(_0x2f8f8d,_0x40c79d){return function(_0x4c5e8f){if(_0x4c5e8f){return _0x4c5e8f['destroy']()['then'](function(){_0x2f8f8d[_0xcaa4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bfe9,_0x5b15dd){return function(_0x2d6f82){if(!_0x2d6f82){_0x11bfe9[_0xcaa4('0x17')](0x194);}return _0x2d6f82;};}function handleError(_0x1b750b,_0x24509e){_0x24509e=_0x24509e||0x1f4;return function(_0x4d6a78){logger[_0xcaa4('0x23')](_0x4d6a78[_0xcaa4('0x24')]);if(_0x4d6a78[_0xcaa4('0x25')]){delete _0x4d6a78[_0xcaa4('0x25')];}_0x1b750b['status'](_0x24509e)['send'](_0x4d6a78);};}exports['index']=function(_0x45d51c,_0x5a3713){var _0x2cb0f6={},_0x10028a={},_0x4aae7c={'count':0x0,'rows':[]};var _0x5e3307=_[_0xcaa4('0x26')](db['Attachment'][_0xcaa4('0x27')],function(_0x3d6462){return{'name':_0x3d6462['fieldName'],'type':_0x3d6462[_0xcaa4('0x28')][_0xcaa4('0x29')]};});_0x10028a[_0xcaa4('0x2a')]=_[_0xcaa4('0x26')](_0x5e3307,'name');_0x10028a['query']=_[_0xcaa4('0x2b')](_0x45d51c[_0xcaa4('0x2c')]);_0x10028a[_0xcaa4('0x2d')]=_[_0xcaa4('0x2e')](_0x10028a['model'],_0x10028a[_0xcaa4('0x2c')]);_0x2cb0f6[_0xcaa4('0x2f')]=_[_0xcaa4('0x2e')](_0x10028a[_0xcaa4('0x2a')],qs[_0xcaa4('0x30')](_0x45d51c[_0xcaa4('0x2c')]['fields']));_0x2cb0f6[_0xcaa4('0x2f')]=_0x2cb0f6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x2cb0f6[_0xcaa4('0x2f')]:_0x10028a['model'];if(!_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x32')](_0xcaa4('0x33'))){_0x2cb0f6['limit']=qs[_0xcaa4('0x1d')](_0x45d51c[_0xcaa4('0x2c')]['limit']);_0x2cb0f6[_0xcaa4('0x1b')]=qs['offset'](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x1b')]);}_0x2cb0f6[_0xcaa4('0x34')]=qs[_0xcaa4('0x35')](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x35')]);_0x2cb0f6[_0xcaa4('0x36')]=qs[_0xcaa4('0x2d')](_[_0xcaa4('0x37')](_0x45d51c[_0xcaa4('0x2c')],_0x10028a[_0xcaa4('0x2d')]),_0x5e3307);if(_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x38')]){_0x2cb0f6[_0xcaa4('0x36')]=_[_0xcaa4('0x39')](_0x2cb0f6['where'],{'$or':_['map'](_0x5e3307,function(_0x3b4209){if(_0x3b4209['type']!==_0xcaa4('0x3a')){var _0xe4afc7={};_0xe4afc7[_0x3b4209['name']]={'$like':'%'+_0x45d51c[_0xcaa4('0x2c')]['filter']+'%'};return _0xe4afc7;}})});}_0x2cb0f6=_[_0xcaa4('0x39')]({},_0x2cb0f6,_0x45d51c[_0xcaa4('0x3b')]);var _0x4d6f9a={'where':_0x2cb0f6[_0xcaa4('0x36')]};return db['Attachment']['count'](_0x4d6f9a)['then'](function(_0x50561e){_0x4aae7c[_0xcaa4('0x1e')]=_0x50561e;if(_0x45d51c[_0xcaa4('0x2c')]['includeAll']){_0x2cb0f6[_0xcaa4('0x3c')]=[{'all':!![]}];}return db[_0xcaa4('0x3d')][_0xcaa4('0x3e')](_0x2cb0f6);})[_0xcaa4('0x22')](function(_0x1da855){_0x4aae7c['rows']=_0x1da855;return _0x4aae7c;})['then'](respondWithFilteredResult(_0x5a3713,_0x2cb0f6))[_0xcaa4('0x3f')](handleError(_0x5a3713,null));};exports[_0xcaa4('0x40')]=function(_0x4a20d8,_0xc7f2c1){var _0x1bd3b6={'raw':!![],'where':{'id':_0x4a20d8['params']['id']}},_0x13e749={};_0x13e749[_0xcaa4('0x2a')]=_[_0xcaa4('0x2b')](db[_0xcaa4('0x3d')]['rawAttributes']);_0x13e749[_0xcaa4('0x2c')]=_[_0xcaa4('0x2b')](_0x4a20d8[_0xcaa4('0x2c')]);_0x13e749[_0xcaa4('0x2d')]=_['intersection'](_0x13e749[_0xcaa4('0x2a')],_0x13e749[_0xcaa4('0x2c')]);_0x1bd3b6['attributes']=_[_0xcaa4('0x2e')](_0x13e749['model'],qs[_0xcaa4('0x30')](_0x4a20d8[_0xcaa4('0x2c')]['fields']));_0x1bd3b6[_0xcaa4('0x2f')]=_0x1bd3b6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x1bd3b6['attributes']:_0x13e749[_0xcaa4('0x2a')];if(_0x4a20d8[_0xcaa4('0x2c')]['includeAll']){_0x1bd3b6[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x1bd3b6=_[_0xcaa4('0x39')]({},_0x1bd3b6,_0x4a20d8[_0xcaa4('0x3b')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x1bd3b6)['then'](handleEntityNotFound(_0xc7f2c1,null))['then'](respondWithResult(_0xc7f2c1,null))[_0xcaa4('0x3f')](handleError(_0xc7f2c1,null));};exports[_0xcaa4('0x42')]=function(_0x2749dc,_0x562cc8){var _0x283ec5={'where':{'id':_0x2749dc[_0xcaa4('0x43')]['id']}},_0x513762={};_0x513762['model']=_[_0xcaa4('0x2b')](db['Attachment'][_0xcaa4('0x27')]);_0x283ec5['attributes']=_[_0xcaa4('0x2e')](_0x513762['model'],qs[_0xcaa4('0x30')](_0x2749dc[_0xcaa4('0x2c')]['fields']));_0x283ec5[_0xcaa4('0x2f')]=_0x283ec5['attributes']['length']?_0x283ec5[_0xcaa4('0x2f')]:_0x513762['model'];if(_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]){_0x283ec5[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x283ec5=_['merge']({},_0x283ec5,_0x2749dc['options']);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x283ec5)[_0xcaa4('0x22')](handleEntityNotFound(_0x562cc8,null))[_0xcaa4('0x22')](function(_0x2eb83d){if(_0x2eb83d){var _0x379dec=_0x2eb83d[_0xcaa4('0x45')]({'plain':!![]});_0x379dec=qs['omit'](_0x379dec,['id',_0xcaa4('0x46'),'updatedAt']);_0x2749dc['body']=_[_0xcaa4('0x47')](_0x2749dc[_0xcaa4('0x48')],['id',_0xcaa4('0x46'),_0xcaa4('0x49')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_[_0xcaa4('0x39')](_0x379dec,_0x2749dc[_0xcaa4('0x48')]),{'include':_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]?[{'all':!![]}]:undefined});}})[_0xcaa4('0x22')](respondWithResult(_0x562cc8,0xc9))[_0xcaa4('0x3f')](handleError(_0x562cc8,null));};exports[_0xcaa4('0x4b')]=function(_0x10054b,_0x2c681c){if(_0x10054b['body']['id']){delete _0x10054b[_0xcaa4('0x48')]['id'];}return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x10054b[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x2c681c,null))['then'](saveUpdates(_0x10054b[_0xcaa4('0x48')],null))[_0xcaa4('0x22')](respondWithResult(_0x2c681c,null))[_0xcaa4('0x3f')](handleError(_0x2c681c,null));};exports[_0xcaa4('0x4c')]=function(_0x5ca145,_0x404d8b){return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x5ca145[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x404d8b,null))[_0xcaa4('0x22')](removeEntity(_0x404d8b,null))[_0xcaa4('0x3f')](handleError(_0x404d8b,null));};exports[_0xcaa4('0x4a')]=function(_0x253a3f,_0x2e5641,_0x5c830b){_0x253a3f[_0xcaa4('0x48')]['name']=_0x253a3f[_0xcaa4('0x4d')]['originalname'];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x4e')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x4f')];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x28')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x50')];return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_0x253a3f[_0xcaa4('0x48')])[_0xcaa4('0x22')](respondWithResult(_0x2e5641,0xc9))[_0xcaa4('0x3f')](handleError(_0x2e5641,null));};exports[_0xcaa4('0x51')]=function(_0x4d28c4,_0x1d3030,_0x31d2e1){return db[_0xcaa4('0x3d')][_0xcaa4('0x52')]({'where':{'id':_0x4d28c4[_0xcaa4('0x43')]['id']},'raw':!![]})[_0xcaa4('0x22')](handleEntityNotFound(_0x1d3030,null))['then'](function(_0x4c5e00){if(_0x4c5e00){var _0x18ddc0=_0x4c5e00[_0xcaa4('0x53')]!==null;var _0xdc3206=path[_0xcaa4('0x54')](config['root'],_0xcaa4('0x55'));if(_0x18ddc0){_0xdc3206=path[_0xcaa4('0x54')](_0xdc3206,_0xcaa4('0x56'));}var _0x12e2d9=path['join'](_0xdc3206,_0x4c5e00[_0xcaa4('0x4e')]);return _0x1d3030[_0xcaa4('0x51')](_0x12e2d9);}})[_0xcaa4('0x3f')](handleError(_0x1d3030,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e209036..5cd788d 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 _0xe7fa=['../../config/environment','exports','define','attachments','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x152ba8,_0x56f0cc){var _0x2759dc=function(_0x48a9cd){while(--_0x48a9cd){_0x152ba8['push'](_0x152ba8['shift']());}};_0x2759dc(++_0x56f0cc);}(_0xe7fa,0xd5));var _0xae7f=function(_0x2743ad,_0x5669b6){_0x2743ad=_0x2743ad-0x0;var _0x15a93b=_0xe7fa[_0x2743ad];return _0x15a93b;};'use strict';var _=require('lodash');var util=require(_0xae7f('0x0'));var logger=require('../../config/logger')(_0xae7f('0x1'));var moment=require(_0xae7f('0x2'));var BPromise=require(_0xae7f('0x3'));var rp=require(_0xae7f('0x4'));var fs=require('fs');var path=require(_0xae7f('0x5'));var rimraf=require(_0xae7f('0x6'));var config=require(_0xae7f('0x7'));var attributes=require('./attachment.attributes');module[_0xae7f('0x8')]=function(_0x347f98,_0x352ad5){return _0x347f98[_0xae7f('0x9')]('Attachment',attributes,{'tableName':_0xae7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger'];(function(_0x19c483,_0x3b63fc){var _0x47ae32=function(_0x5fd5a0){while(--_0x5fd5a0){_0x19c483['push'](_0x19c483['shift']());}};_0x47ae32(++_0x3b63fc);}(_0x207d,0x177));var _0xd207=function(_0x3615f8,_0x5652c6){_0x3615f8=_0x3615f8-0x0;var _0x11ff59=_0x207d[_0x3615f8];return _0x11ff59;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require(_0xd207('0x1'))(_0xd207('0x2'));var moment=require(_0xd207('0x3'));var BPromise=require(_0xd207('0x4'));var rp=require(_0xd207('0x5'));var fs=require('fs');var path=require(_0xd207('0x6'));var rimraf=require(_0xd207('0x7'));var config=require(_0xd207('0x8'));var attributes=require(_0xd207('0x9'));module['exports']=function(_0x54af97,_0x15b43a){return _0x54af97[_0xd207('0xa')](_0xd207('0xb'),attributes,{'tableName':_0xd207('0xc'),'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 0c91b15..ad6d5b9 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 _0x3667=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc9e63e,_0x85efd1){var _0x2c224a=function(_0x5cca5b){while(--_0x5cca5b){_0xc9e63e['push'](_0xc9e63e['shift']());}};_0x2c224a(++_0x85efd1);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});}exports[_0x7366('0x19')]=function(_0x1a71f5){var _0x49e50b=this;return new Promise(function(_0x208ac8,_0x4ffbc7){return db[_0x7366('0x1a')][_0x7366('0x1b')](_0x1a71f5[_0x7366('0x1c')],{'raw':_0x1a71f5['options']?_0x1a71f5[_0x7366('0x1d')][_0x7366('0x1e')]===undefined?!![]:![]:!![]})[_0x7366('0xd')](function(_0x532ce2){logger[_0x7366('0xe')](_0x7366('0x19'),_0x1a71f5);logger['debug'](_0x7366('0x19'),_0x1a71f5,JSON[_0x7366('0x13')](_0x532ce2));_0x208ac8(_0x532ce2);})[_0x7366('0x18')](function(_0x1a12d2){logger[_0x7366('0x14')](_0x7366('0x19'),_0x1a12d2[_0x7366('0x16')],_0x1a71f5);_0x4ffbc7(_0x49e50b[_0x7366('0x14')](0x1f4,_0x1a12d2[_0x7366('0x16')]));});});}; \ No newline at end of file +var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','lodash'];(function(_0x3de6f6,_0x5cbf81){var _0x47050d=function(_0x2c983b){while(--_0x2c983b){_0x3de6f6['push'](_0x3de6f6['shift']());}};_0x47050d(++_0x5cbf81);}(_0x20ce,0x10d));var _0xe20c=function(_0x47965b,_0x228ce8){_0x47965b=_0x47965b-0x0;var _0x1eb7e2=_0x20ce[_0x47965b];return _0x1eb7e2;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a336926..db4ea2e 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x462f5e,_0x39c6fb){var _0xb96df2=function(_0x4259c4){while(--_0x4259c4){_0x462f5e['push'](_0x462f5e['shift']());}};_0xb96df2(++_0x39c6fb);}(_0xb10b,0x12a));var _0xbb10=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xb10b[_0xef4fc0];return _0x57dade;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0xfaa8d,_0x1f7240){_0xfaa8d=_0xfaa8d-0x0;var _0x2e3407=_0xdb28[_0xfaa8d];return _0x2e3407;};'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('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 647dae3..47fdf77 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 _0xa112=['passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','/login','profile','email','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','getLicense','catch','lodash'];(function(_0x37e85c,_0x1a26f7){var _0x1a7ccc=function(_0x3b018f){while(--_0x3b018f){_0x37e85c['push'](_0x37e85c['shift']());}};_0x1a7ccc(++_0x1a26f7);}(_0xa112,0x153));var _0x2a11=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa112[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x2a11('0x0'));var passport=require(_0x2a11('0x1'));var GoogleStrategy=require(_0x2a11('0x2'))[_0x2a11('0x3')];var moment=require(_0x2a11('0x4'));var db=require(_0x2a11('0x5'))['db'];var config=require(_0x2a11('0x6'));var signToken=require(_0x2a11('0x7'))['signToken'];var utils=require(_0x2a11('0x8'));exports['login']=passport[_0x2a11('0x9')](_0x2a11('0xa'),{'failureRedirect':_0x2a11('0xb'),'scope':[_0x2a11('0xc'),_0x2a11('0xd')],'session':![]});exports['callback']=passport['authenticate'](_0x2a11('0xa'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x2a11('0xa')]?config[_0x2a11('0xa')][_0x2a11('0xe')]:'id','clientSecret':config[_0x2a11('0xa')]?config[_0x2a11('0xa')]['clientSecret']:_0x2a11('0xf'),'callbackURL':config[_0x2a11('0xa')]?config[_0x2a11('0xa')][_0x2a11('0x10')]:''},function(_0x16b7e3,_0x22f378,_0x520c47,_0x395d3f){var _0x512568,_0x32d040;return db[_0x2a11('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x2a11('0x12'),_0x2a11('0x13')],'raw':!![]})[_0x2a11('0x14')](function(_0x1092bc){_0x512568=_0x1092bc;return db[_0x2a11('0x15')]['find']({'where':{'email':_['map'](_0x520c47[_0x2a11('0x16')],_0x2a11('0x17')),'role':{'$or':[_0x2a11('0x18'),_0x2a11('0x19'),_0x2a11('0x1a')]}}});})[_0x2a11('0x14')](function(_0x5e0110){_0x32d040=_0x5e0110;if(_0x32d040){if(_0x32d040[_0x2a11('0x1b')]){return _0x395d3f(_0x2a11('0x1c'));}else if(_0x512568[_0x2a11('0x13')]>0x0){if(_0x32d040[_0x2a11('0x1d')]){if(moment(_0x32d040[_0x2a11('0x1e')])['add'](_0x512568[_0x2a11('0x13')],_0x2a11('0x1f'))>moment()){return _0x395d3f(_0x2a11('0x1c'));}else{return utils['clearBlockUser'](_0x32d040,0x0,![],null)[_0x2a11('0x14')](function(){return utils['getLicense'](_0x32d040);})[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}else{return utils[_0x2a11('0x20')](_0x32d040)[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}else{return utils[_0x2a11('0x20')](_0x32d040)[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}return _0x395d3f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2a11('0x21')](function(_0x4a334c){_0x395d3f(_0x4a334c);});})); \ No newline at end of file +var _0xd492=['google','/login','profile','email','callback','use','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','../../config/utils','login','authenticate'];(function(_0x48fc52,_0x5cb557){var _0x10233e=function(_0x282d39){while(--_0x282d39){_0x48fc52['push'](_0x48fc52['shift']());}};_0x10233e(++_0x5cb557);}(_0xd492,0x11f));var _0x2d49=function(_0x43b318,_0x301079){_0x43b318=_0x43b318-0x0;var _0x5bd2ec=_0xd492[_0x43b318];return _0x5bd2ec;};'use strict';var _=require(_0x2d49('0x0'));var passport=require(_0x2d49('0x1'));var GoogleStrategy=require(_0x2d49('0x2'))[_0x2d49('0x3')];var moment=require(_0x2d49('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x2d49('0x5'))['signToken'];var utils=require(_0x2d49('0x6'));exports[_0x2d49('0x7')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'scope':[_0x2d49('0xb'),_0x2d49('0xc')],'session':![]});exports[_0x2d49('0xd')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'session':![]});passport[_0x2d49('0xe')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0xf')]:_0x2d49('0x10'),'callbackURL':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0x11')]:''},function(_0x48817c,_0x65b811,_0x1a43d8,_0x5482f8){var _0x1d5edc,_0x232e98;return db['Setting'][_0x2d49('0x12')]({'where':{'id':0x1},'attributes':[_0x2d49('0x13'),_0x2d49('0x14')],'raw':!![]})[_0x2d49('0x15')](function(_0x473a25){_0x1d5edc=_0x473a25;return db[_0x2d49('0x16')][_0x2d49('0x17')]({'where':{'email':_['map'](_0x1a43d8[_0x2d49('0x18')],_0x2d49('0x19')),'role':{'$or':[_0x2d49('0x1a'),_0x2d49('0x1b'),_0x2d49('0x1c')]}}});})[_0x2d49('0x15')](function(_0xffa649){_0x232e98=_0xffa649;if(_0x232e98){if(_0x232e98[_0x2d49('0x1d')]){return _0x5482f8(_0x2d49('0x1e'));}else if(_0x1d5edc[_0x2d49('0x14')]>0x0){if(_0x232e98[_0x2d49('0x1f')]){if(moment(_0x232e98[_0x2d49('0x20')])[_0x2d49('0x21')](_0x1d5edc[_0x2d49('0x14')],'minutes')>moment()){return _0x5482f8(_0x2d49('0x1e'));}else{return utils[_0x2d49('0x22')](_0x232e98,0x0,![],null)['then'](function(){return utils[_0x2d49('0x23')](_0x232e98);})[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}return _0x5482f8(_0x2d49('0x1e'));})[_0x2d49('0x24')](function(_0x3f301f){_0x5482f8(_0x3f301f);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index a7f8fbc..4ded2ec 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 _0x56d8=['/callback','setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x935fc8,_0x2e6376){var _0x2bd2e4=function(_0x35a00f){while(--_0x35a00f){_0x935fc8['push'](_0x935fc8['shift']());}};_0x2bd2e4(++_0x2e6376);}(_0x56d8,0x1a1));var _0x856d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x56d8[_0x9df060];return _0x338dfe;};'use strict';var express=require(_0x856d('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x856d('0x1'));var userController=require(_0x856d('0x2'));var authService=require(_0x856d('0x3'));router[_0x856d('0x4')]('/',controller[_0x856d('0x5')]);router[_0x856d('0x4')](_0x856d('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x856d('0x5')],authService[_0x856d('0x7')]);module[_0x856d('0x8')]=router; \ No newline at end of file +var _0x4369=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x1d1da3,_0x387863){var _0x4ea3b1=function(_0x4ee207){while(--_0x4ee207){_0x1d1da3['push'](_0x1d1da3['shift']());}};_0x4ea3b1(++_0x387863);}(_0x4369,0x147));var _0x9436=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x4369[_0x5ad07c];return _0x204bae;};'use strict';var express=require(_0x9436('0x0'));var passport=require(_0x9436('0x1'));var router=express[_0x9436('0x2')]();var controller=require(_0x9436('0x3'));var userController=require(_0x9436('0x4'));var authService=require(_0x9436('0x5'));router[_0x9436('0x6')]('/',controller[_0x9436('0x7')]);router[_0x9436('0x6')]('/callback',controller[_0x9436('0x8')],authService[_0x9436('0x9')],userController['login'],authService[_0x9436('0xa')]);module[_0x9436('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1357b53..010441f 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 _0x75c5=['../../components/auth/service','client','http','Setting','findOne','blockDuration','then','name','salt','disabled','blocked','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb'];(function(_0x44d2a1,_0x22c302){var _0x319606=function(_0x397b82){while(--_0x397b82){_0x44d2a1['push'](_0x44d2a1['shift']());}};_0x319606(++_0x22c302);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x575c('0x0'));var passport=require(_0x575c('0x1'));var LocalStrategy=require(_0x575c('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x575c('0x3'));var rs=require(_0x575c('0x4'));var moment=require(_0x575c('0x5'));var db=require(_0x575c('0x6'))['db'];var authService=require(_0x575c('0x7'));var utils=require('../../config/utils');var client=jayson[_0x575c('0x8')][_0x575c('0x9')]({'port':0x232b});function localAuthenticate(_0x62e644,_0xc786e7,_0x2d0629,_0x204764){var _0x163b31,_0x207199;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x54767d){_0x163b31=_0x54767d;return _0x62e644[_0x575c('0xb')]({'attributes':['id',_0x575c('0xe'),'password',_0x575c('0xf'),'role',_0x575c('0x10'),_0x575c('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0xc786e7,'role':{'$or':['admin',_0x575c('0x12'),_0x575c('0x13')]}}});})[_0x575c('0xd')](function(_0x1d71bb){if(!_0x1d71bb||_0x1d71bb&&_0x1d71bb[_0x575c('0xe')]!==_0xc786e7){throw new Error(_0x575c('0x14'));}else{_0x207199=_0x1d71bb;return _0x207199;}})['then'](function(){_0x207199[_0x575c('0x15')](_0x2d0629,function(_0x40a57c,_0xa2cd02){var _0x41edcb=_0x207199[_0x575c('0x16')]+0x1;if(_0x40a57c){return _0x204764(_0x40a57c);}else if(!_0xa2cd02){if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31[_0x575c('0x17')]>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31[_0x575c('0xc')],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{if(_0x41edcb>=_0x163b31[_0x575c('0x17')]){return utils[_0x575c('0x1a')](_0x207199,0x0,!![],moment())[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)['then'](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}}else{return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31['allowedLoginAttempts']>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31['blockDuration'],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);})['catch'](function(_0x32c038){return _0x204764(null,![],_0x32c038);});}}else{if(_0x207199[_0x575c('0x11')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1b')](_0x207199)[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}}});})[_0x575c('0x1c')](function(_0x41497a){return _0x204764(null,![],_0x41497a);});}function sendServiceMail(_0x17b1cd){return db[_0x575c('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x575c('0x1e')],'as':'Smtp'}]})[_0x575c('0xd')](function(_0x1bcd11){if(!_0x1bcd11){throw new Error(_0x575c('0x1f'));}var _0x594575={'tls':{'rejectUnauthorized':![]}};if(_0x1bcd11['Smtp'][_0x575c('0x20')]){_0x594575['service']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x20')];}else{_0x594575['host']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x22')];_0x594575[_0x575c('0x23')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x23')];_0x594575[_0x575c('0x24')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x24')];}if(_0x1bcd11[_0x575c('0x21')][_0x575c('0x25')]){_0x594575[_0x575c('0x26')]={'user':_0x1bcd11[_0x575c('0x21')]['user'],'pass':_0x1bcd11['Smtp']['pass']};}var _0x18f0ec={'account':_0x594575,'message':_['merge']({'from':util[_0x575c('0x27')]('\x22%s\x22\x20<%s>',_0x1bcd11[_0x575c('0xe')],_0x1bcd11['email']||_0x1bcd11[_0x575c('0x21')][_0x575c('0x12')])},_0x17b1cd)};return client[_0x575c('0x28')]('SendMail',_0x18f0ec);})[_0x575c('0xd')](function(_0x1e694e){if(_0x1e694e[_0x575c('0x29')]){throw new Error(util['format'](_0x575c('0x2a'),_0x1e694e[_0x575c('0x29')][_0x575c('0x2b')]||JSON[_0x575c('0x2c')](_0x1e694e[_0x575c('0x29')])));}return!![];});}function handleError(_0x3bdd1b,_0x50f9f1,_0x441865){return _0x3bdd1b[_0x575c('0x2d')](_0x50f9f1||0x1f4)[_0x575c('0x2e')]({'message':_0x441865?_0x441865[_0x575c('0x2b')]||_0x441865:''});}exports[_0x575c('0x2f')]=function(_0x1503dd,_0x5ca678,_0x5005f6){passport[_0x575c('0x15')](_0x575c('0x30'),function(_0x38c7c1,_0x59ea5e,_0x34acf5){var _0x4bbea=_0x38c7c1||_0x34acf5;if(_0x4bbea){return handleError(_0x5ca678,0x191,_0x4bbea);}if(!_0x59ea5e){return handleError(_0x5ca678,0x194,{'message':_0x575c('0x31')});}else{var _0x13e11f={'payload':{'id':_0x59ea5e['id'],'role':_0x59ea5e[_0x575c('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x13e11f)[_0x575c('0xd')](function(_0x563913){_0x5ca678[_0x575c('0x33')]({'id':_0x59ea5e['id'],'token':_0x563913,'statusCall':'','isAlreadyLogged':_0x59ea5e['online']});});}})(_0x1503dd,_0x5ca678,_0x5005f6);};exports['forgot']=function(_0x246816,_0x2a8c06,_0x13a789){if(!_0x246816['body'][_0x575c('0x34')]){return handleError(_0x2a8c06,0x1f4,{'message':_0x575c('0x35')});}var _0x76fe12=rs[_0x575c('0x36')]();_0x246816[_0x575c('0x37')][_0x575c('0x34')]=_0x246816[_0x575c('0x37')][_0x575c('0x34')][_0x575c('0x38')]()[_0x575c('0x39')]();var _0x245666;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x10b9d2){_0x245666=_0x10b9d2;return db[_0x575c('0x3a')][_0x575c('0x3b')]({'where':{'email':_0x246816[_0x575c('0x37')][_0x575c('0x34')]}});})[_0x575c('0xd')](function(_0x56315a){if(!_0x56315a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56315a[_0x575c('0x10')]){throw new Error(_0x575c('0x3c'));}if(_0x56315a[_0x575c('0x11')]){if(moment(_0x56315a[_0x575c('0x3d')])['add'](_0x245666[_0x575c('0xc')],_0x575c('0x19'))>moment()){throw new Error(_0x575c('0x3e'));}else{_0x56315a[_0x575c('0x11')]=![];_0x56315a['blockedAt']=null;}}_0x56315a[_0x575c('0x3f')]=_0x76fe12;_0x56315a[_0x575c('0x40')]=Date['now']()+0x36ee80;return _0x56315a[_0x575c('0x41')]();})[_0x575c('0xd')](function(){return sendServiceMail({'to':_0x246816['body'][_0x575c('0x34')],'subject':_0x575c('0x42'),'text':_0x575c('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x575c('0x44')+_0x246816[_0x575c('0x45')][_0x575c('0x22')]+_0x575c('0x46')+_0x76fe12+'\x0a\x0a'+_0x575c('0x47')});})[_0x575c('0xd')](function(){_0x2a8c06[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x48')});})[_0x575c('0x1c')](function(_0x4fa6cc){return handleError(_0x2a8c06,0x1f4,_0x4fa6cc);});};exports[_0x575c('0x49')]=function(_0x3bf240,_0xf04b49,_0x7af69f){return db['User']['find']({'where':{'resetPasswordToken':_0x3bf240[_0x575c('0x4a')][_0x575c('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x575c('0xd')](function(_0x2419b5){if(!_0x2419b5){throw new Error(_0x575c('0x4c'));}return db[_0x575c('0xa')][_0x575c('0xb')]({'attributes':['id',_0x575c('0x4d'),_0x575c('0x4e'),_0x575c('0x4f')]})[_0x575c('0xd')](function(_0x116bed){if(_0x116bed[_0x575c('0x4d')])authService[_0x575c('0x50')](_0x3bf240['body'][_0x575c('0x51')]);if(!_0x116bed['enforcePasswordHistory']||!_0x2419b5[_0x575c('0x52')])return _0x2419b5;authService[_0x575c('0x53')](_0x3bf240[_0x575c('0x37')][_0x575c('0x51')],_0x2419b5[_0x575c('0x52')],_0x116bed[_0x575c('0x4f')]);return _0x2419b5;})[_0x575c('0xd')](function(){_0x2419b5[_0x575c('0x51')]=_0x3bf240[_0x575c('0x37')][_0x575c('0x51')];_0x2419b5['resetPasswordToken']=null;_0x2419b5[_0x575c('0x40')]=null;return _0x2419b5[_0x575c('0x41')]();});})[_0x575c('0xd')](function(){_0xf04b49[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x54')});})[_0x575c('0x1c')](function(_0x3defd2){return handleError(_0xf04b49,0x1f4,_0x3defd2);});};passport[_0x575c('0x55')](new LocalStrategy({'usernameField':'name','passwordField':_0x575c('0x51')},function(_0x2b2999,_0x1226a1,_0x2392e6){return localAuthenticate(db['User'],_0x2b2999,_0x1226a1,_0x2392e6);})); \ No newline at end of file +var _0x9f80=['Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport-local','randomstring','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','loginAttempts','admin','user','agent','name','authenticate','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','getLicense','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','login','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','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','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x48c938,_0x14ac2c){var _0x5625b2=function(_0x3edffd){while(--_0x3edffd){_0x48c938['push'](_0x48c938['shift']());}};_0x5625b2(++_0x14ac2c);}(_0x9f80,0x105));var _0x09f8=function(_0x18ae7c,_0x51e930){_0x18ae7c=_0x18ae7c-0x0;var _0x28057f=_0x9f80[_0x18ae7c];return _0x28057f;};'use strict';var util=require(_0x09f8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x09f8('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x09f8('0x2'));var moment=require('moment');var db=require(_0x09f8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x09f8('0x4'));var client=jayson[_0x09f8('0x5')][_0x09f8('0x6')]({'port':0x232b});function localAuthenticate(_0x3b573d,_0x2dcff1,_0x406409,_0x4e3ce5){var _0x1ea626,_0x2fe8b1;return db[_0x09f8('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})[_0x09f8('0xa')](function(_0x446224){_0x1ea626=_0x446224;return _0x3b573d[_0x09f8('0xb')]({'attributes':['id','name',_0x09f8('0xc'),_0x09f8('0xd'),_0x09f8('0xe'),_0x09f8('0xf'),'blocked','blockedAt',_0x09f8('0x10')],'where':{'name':_0x2dcff1,'role':{'$or':[_0x09f8('0x11'),_0x09f8('0x12'),_0x09f8('0x13')]}}});})[_0x09f8('0xa')](function(_0x7fc5ee){if(!_0x7fc5ee||_0x7fc5ee&&_0x7fc5ee[_0x09f8('0x14')]!==_0x2dcff1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2fe8b1=_0x7fc5ee;return _0x2fe8b1;}})[_0x09f8('0xa')](function(){_0x2fe8b1[_0x09f8('0x15')](_0x406409,function(_0x5eda69,_0xc009bf){var _0x169bf1=_0x2fe8b1[_0x09f8('0x10')]+0x1;if(_0x5eda69){return _0x4e3ce5(_0x5eda69);}else if(!_0xc009bf){if(_0x2fe8b1['disabled']){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1ea626['allowedLoginAttempts']>0x0){if(_0x2fe8b1['blocked']){if(_0x1ea626[_0x09f8('0x9')]>0x0){if(moment(_0x2fe8b1[_0x09f8('0x16')])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x169bf1>=_0x1ea626[_0x09f8('0x8')]){return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,!![],moment())['then'](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}else{return utils['clearBlockUser'](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x2fe8b1[_0x09f8('0xf')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else if(_0x1ea626[_0x09f8('0x8')]>0x0){if(_0x2fe8b1[_0x09f8('0x1b')]){if(_0x1ea626['blockDuration']>0x0){if(moment(_0x2fe8b1['blockedAt'])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils[_0x09f8('0x1c')](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils['getLicense'](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);})['catch'](function(_0x15bd75){return _0x4e3ce5(null,![],_0x15bd75);});}}else{if(_0x2fe8b1[_0x09f8('0x1b')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1c')](_0x2fe8b1)['then'](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}}});})[_0x09f8('0x1d')](function(_0x4f600b){return _0x4e3ce5(null,![],_0x4f600b);});}function sendServiceMail(_0x45e2f1){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x09f8('0x14'),_0x09f8('0x1e')],'include':[{'model':db[_0x09f8('0x1f')],'as':'Smtp'}]})[_0x09f8('0xa')](function(_0x2fde04){if(!_0x2fde04){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x349e1e={'tls':{'rejectUnauthorized':![]}};if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')]){_0x349e1e[_0x09f8('0x21')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')];}else{_0x349e1e[_0x09f8('0x22')]=_0x2fde04[_0x09f8('0x20')]['host'];_0x349e1e[_0x09f8('0x23')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x23')];_0x349e1e[_0x09f8('0x24')]=_0x2fde04[_0x09f8('0x20')]['secure'];}if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x25')]){_0x349e1e[_0x09f8('0x26')]={'user':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x12')],'pass':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x27')]};}var _0x17ff53={'account':_0x349e1e,'message':_[_0x09f8('0x28')]({'from':util[_0x09f8('0x29')](_0x09f8('0x2a'),_0x2fde04[_0x09f8('0x14')],_0x2fde04[_0x09f8('0x1e')]||_0x2fde04['Smtp'][_0x09f8('0x12')])},_0x45e2f1)};return client[_0x09f8('0x2b')](_0x09f8('0x2c'),_0x17ff53);})[_0x09f8('0xa')](function(_0x4081b6){if(_0x4081b6[_0x09f8('0x2d')]){throw new Error(util[_0x09f8('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4081b6[_0x09f8('0x2d')]['message']||JSON[_0x09f8('0x2e')](_0x4081b6[_0x09f8('0x2d')])));}return!![];});}function handleError(_0x53a864,_0x58f20c,_0x10b8ee){return _0x53a864[_0x09f8('0x2f')](_0x58f20c||0x1f4)[_0x09f8('0x30')]({'message':_0x10b8ee?_0x10b8ee[_0x09f8('0x31')]||_0x10b8ee:''});}exports[_0x09f8('0x32')]=function(_0x458e74,_0x443050,_0xe23a14){passport[_0x09f8('0x15')](_0x09f8('0x33'),function(_0x361988,_0x25a23b,_0x540554){var _0x4dcca2=_0x361988||_0x540554;if(_0x4dcca2){return handleError(_0x443050,0x191,_0x4dcca2);}if(!_0x25a23b){return handleError(_0x443050,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xe2ae9f={'payload':{'id':_0x25a23b['id'],'role':_0x25a23b[_0x09f8('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x09f8('0x34')](_0xe2ae9f)[_0x09f8('0xa')](function(_0x14b6c2){_0x443050[_0x09f8('0x35')]({'id':_0x25a23b['id'],'token':_0x14b6c2,'statusCall':'','isAlreadyLogged':_0x25a23b[_0x09f8('0x36')]});});}})(_0x458e74,_0x443050,_0xe23a14);};exports[_0x09f8('0x37')]=function(_0x3ffafc,_0x113245,_0x198750){if(!_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]){return handleError(_0x113245,0x1f4,{'message':_0x09f8('0x39')});}var _0x3c6282=rs[_0x09f8('0x3a')]();_0x3ffafc[_0x09f8('0x38')]['email']=_0x3ffafc[_0x09f8('0x38')]['email']['trim']()[_0x09f8('0x3b')]();var _0x58c81a;return db[_0x09f8('0x7')][_0x09f8('0xb')]({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})['then'](function(_0x37c2bf){_0x58c81a=_0x37c2bf;return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'email':_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]}});})['then'](function(_0x93e483){if(!_0x93e483){throw new Error(_0x09f8('0x3e'));}if(_0x93e483[_0x09f8('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x93e483[_0x09f8('0x1b')]){if(moment(_0x93e483[_0x09f8('0x16')])['add'](_0x58c81a[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x93e483[_0x09f8('0x1b')]=![];_0x93e483[_0x09f8('0x16')]=null;}}_0x93e483[_0x09f8('0x3f')]=_0x3c6282;_0x93e483['resetPasswordExpires']=Date[_0x09f8('0x40')]()+0x36ee80;return _0x93e483[_0x09f8('0x41')]();})[_0x09f8('0xa')](function(){return sendServiceMail({'to':_0x3ffafc['body']['email'],'subject':_0x09f8('0x42'),'text':_0x09f8('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x09f8('0x44')+_0x3ffafc[_0x09f8('0x45')][_0x09f8('0x22')]+'/reset/'+_0x3c6282+'\x0a\x0a'+_0x09f8('0x46')});})[_0x09f8('0xa')](function(){_0x113245[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x47')});})['catch'](function(_0xbe4ee1){return handleError(_0x113245,0x1f4,_0xbe4ee1);});};exports[_0x09f8('0x48')]=function(_0x456287,_0x4b48a3,_0x52d85d){return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'resetPasswordToken':_0x456287['params'][_0x09f8('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x09f8('0xa')](function(_0x458ba6){if(!_0x458ba6){throw new Error(_0x09f8('0x4a'));}return db[_0x09f8('0x7')][_0x09f8('0xb')]({'attributes':['id',_0x09f8('0x4b'),_0x09f8('0x4c'),'passwordHistoryLimit']})[_0x09f8('0xa')](function(_0x3685a5){if(_0x3685a5[_0x09f8('0x4b')])authService['validatePasswordPattern'](_0x456287[_0x09f8('0x38')]['password']);if(!_0x3685a5[_0x09f8('0x4c')]||!_0x458ba6[_0x09f8('0x4d')])return _0x458ba6;authService[_0x09f8('0x4e')](_0x456287[_0x09f8('0x38')][_0x09f8('0xc')],_0x458ba6[_0x09f8('0x4d')],_0x3685a5[_0x09f8('0x4f')]);return _0x458ba6;})[_0x09f8('0xa')](function(){_0x458ba6['password']=_0x456287[_0x09f8('0x38')][_0x09f8('0xc')];_0x458ba6[_0x09f8('0x3f')]=null;_0x458ba6[_0x09f8('0x50')]=null;return _0x458ba6[_0x09f8('0x41')]();});})[_0x09f8('0xa')](function(){_0x4b48a3[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x51')});})['catch'](function(_0x181a04){return handleError(_0x4b48a3,0x1f4,_0x181a04);});};passport[_0x09f8('0x52')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4466ba,_0x51fe21,_0x300686){return localAuthenticate(db[_0x09f8('0x3c')],_0x4466ba,_0x51fe21,_0x300686);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 3fc3291..9be22d4 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 _0xa8a8=['/forgot','/reset/:token','exports','./authLocal.controller','login','post'];(function(_0x153cdb,_0x440c79){var _0xa3085f=function(_0x55d65e){while(--_0x55d65e){_0x153cdb['push'](_0x153cdb['shift']());}};_0xa3085f(++_0x440c79);}(_0xa8a8,0x9f));var _0x8a8a=function(_0x384131,_0x41a880){_0x384131=_0x384131-0x0;var _0x1fd8e1=_0xa8a8[_0x384131];return _0x1fd8e1;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x8a8a('0x0'));router['post']('/',controller[_0x8a8a('0x1')]);router[_0x8a8a('0x2')](_0x8a8a('0x3'),controller['forgot']);router[_0x8a8a('0x2')](_0x8a8a('0x4'),controller['reset']);module[_0x8a8a('0x5')]=router; \ No newline at end of file +var _0xb768=['/reset/:token','exports','Router','./authLocal.controller','login','post','/forgot','forgot'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xb768,0x16a));var _0x8b76=function(_0x408e10,_0x560479){_0x408e10=_0x408e10-0x0;var _0x228eeb=_0xb768[_0x408e10];return _0x228eeb;};'use strict';var express=require('express');var router=express[_0x8b76('0x0')]();var controller=require(_0x8b76('0x1'));router['post']('/',controller[_0x8b76('0x2')]);router[_0x8b76('0x3')](_0x8b76('0x4'),controller[_0x8b76('0x5')]);router[_0x8b76('0x3')](_0x8b76('0x6'),controller['reset']);module[_0x8b76('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index be507bf..4479efe 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 _0x7fe3=['sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7fe3,0x81));var _0x37fe=function(_0x3fd49e,_0x268790){_0x3fd49e=_0x3fd49e-0x0;var _0x12f9da=_0x7fe3[_0x3fd49e];return _0x12f9da;};'use strict';var Sequelize=require(_0x37fe('0x0'));module[_0x37fe('0x1')]={'name':{'type':Sequelize[_0x37fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x37fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x4875=['BOOLEAN','sequelize','exports','STRING'];(function(_0x12566a,_0x448050){var _0x15f53f=function(_0x31eac9){while(--_0x31eac9){_0x12566a['push'](_0x12566a['shift']());}};_0x15f53f(++_0x448050);}(_0x4875,0x171));var _0x5487=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0x4875[_0x519de3];return _0x3e21d9;};'use strict';var Sequelize=require(_0x5487('0x0'));module[_0x5487('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5487('0x2')]},'status':{'type':Sequelize[_0x5487('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 3e423c8..eec4bdd 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 _0xa0e8=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','Automation','fieldName','type','model','query','intersection','fields','attributes','length','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','count','then','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format'];(function(_0xb01aa9,_0xf6be7d){var _0x23c06c=function(_0x102f03){while(--_0x102f03){_0xb01aa9['push'](_0xb01aa9['shift']());}};_0x23c06c(++_0xf6be7d);}(_0xa0e8,0x1a8));var _0x8a0e=function(_0x26075f,_0x5b1d30){_0x26075f=_0x26075f-0x0;var _0xeb85bf=_0xa0e8[_0x26075f];return _0xeb85bf;};'use strict';var emlformat=require(_0x8a0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a0e('0x2'));var moment=require(_0x8a0e('0x3'));var BPromise=require(_0x8a0e('0x4'));var Mustache=require(_0x8a0e('0x5'));var util=require('util');var path=require(_0x8a0e('0x6'));var sox=require(_0x8a0e('0x7'));var csv=require(_0x8a0e('0x8'));var ejs=require(_0x8a0e('0x9'));var fs=require('fs');var fs_extra=require(_0x8a0e('0xa'));var _=require(_0x8a0e('0xb'));var squel=require(_0x8a0e('0xc'));var crypto=require(_0x8a0e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a0e('0xe'));var toCsv=require(_0x8a0e('0x8'));var querystring=require(_0x8a0e('0xf'));var Papa=require(_0x8a0e('0x10'));var Redis=require(_0x8a0e('0x11'));var authService=require(_0x8a0e('0x12'));var qs=require(_0x8a0e('0x13'));var as=require(_0x8a0e('0x14'));var hardwareService=require(_0x8a0e('0x15'));var logger=require(_0x8a0e('0x16'))(_0x8a0e('0x17'));var utils=require(_0x8a0e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8a0e('0x19'));var db=require(_0x8a0e('0x1a'))['db'];function respondWithStatusCode(_0x320b1f,_0x3972ef){_0x3972ef=_0x3972ef||0xcc;return function(_0x273edd){if(_0x273edd){return _0x320b1f[_0x8a0e('0x1b')](_0x3972ef);}return _0x320b1f[_0x8a0e('0x1c')](_0x3972ef)['end']();};}function respondWithResult(_0x294bc1,_0x28dd53){_0x28dd53=_0x28dd53||0xc8;return function(_0xe0ab2){if(_0xe0ab2){return _0x294bc1[_0x8a0e('0x1c')](_0x28dd53)[_0x8a0e('0x1d')](_0xe0ab2);}};}function respondWithFilteredResult(_0x2b5af5,_0xf251d6){return function(_0x56633c){if(_0x56633c){var _0x63411e=typeof _0xf251d6[_0x8a0e('0x1e')]===_0x8a0e('0x1f')&&typeof _0xf251d6[_0x8a0e('0x20')]==='undefined';var _0x181b2b=_0x56633c['count'];var _0x4c5b2a=_0x63411e?0x0:_0xf251d6[_0x8a0e('0x1e')];var _0x300f57=_0x63411e?_0x56633c['count']:_0xf251d6[_0x8a0e('0x1e')]+_0xf251d6[_0x8a0e('0x20')];var _0x507546;if(_0x300f57>=_0x181b2b){_0x300f57=_0x181b2b;_0x507546=0xc8;}else{_0x507546=0xce;}_0x2b5af5[_0x8a0e('0x1c')](_0x507546);return _0x2b5af5[_0x8a0e('0x21')]('Content-Range',_0x4c5b2a+'-'+_0x300f57+'/'+_0x181b2b)[_0x8a0e('0x1d')](_0x56633c);}return null;};}function patchUpdates(_0x41af1c){return function(_0x30b494){try{jsonpatch[_0x8a0e('0x22')](_0x30b494,_0x41af1c,!![]);}catch(_0x5d309e){return BPromise[_0x8a0e('0x23')](_0x5d309e);}return _0x30b494[_0x8a0e('0x24')]();};}function saveUpdates(_0xa49dae,_0x1363e8){return function(_0x486705){if(_0x486705){return _0x486705[_0x8a0e('0x25')](_0xa49dae)['then'](function(_0x5e93d1){return _0x5e93d1;});}return null;};}function removeEntity(_0x54e2b9,_0x4e2edf){return function(_0x57b3b9){if(_0x57b3b9){return _0x57b3b9[_0x8a0e('0x26')]()['then'](function(){_0x54e2b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47958f,_0x516db4){return function(_0x52ff2c){if(!_0x52ff2c){_0x47958f[_0x8a0e('0x1b')](0x194);}return _0x52ff2c;};}function handleError(_0x384dfd,_0x2fb4c5){_0x2fb4c5=_0x2fb4c5||0x1f4;return function(_0xba2ab4){logger[_0x8a0e('0x27')](_0xba2ab4[_0x8a0e('0x28')]);if(_0xba2ab4[_0x8a0e('0x29')]){delete _0xba2ab4[_0x8a0e('0x29')];}_0x384dfd[_0x8a0e('0x1c')](_0x2fb4c5)[_0x8a0e('0x2a')](_0xba2ab4);};}exports[_0x8a0e('0x2b')]=function(_0x48aad2,_0x5bfdc9){var _0xfadf56={},_0x25aef1={},_0x44232d={'count':0x0,'rows':[]};var _0x4177ca=_[_0x8a0e('0x2c')](db[_0x8a0e('0x2d')]['rawAttributes'],function(_0x3df4d5){return{'name':_0x3df4d5[_0x8a0e('0x2e')],'type':_0x3df4d5[_0x8a0e('0x2f')]['key']};});_0x25aef1[_0x8a0e('0x30')]=_[_0x8a0e('0x2c')](_0x4177ca,_0x8a0e('0x29'));_0x25aef1['query']=_['keys'](_0x48aad2[_0x8a0e('0x31')]);_0x25aef1['filters']=_[_0x8a0e('0x32')](_0x25aef1[_0x8a0e('0x30')],_0x25aef1[_0x8a0e('0x31')]);_0xfadf56['attributes']=_['intersection'](_0x25aef1[_0x8a0e('0x30')],qs[_0x8a0e('0x33')](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x33')]));_0xfadf56[_0x8a0e('0x34')]=_0xfadf56[_0x8a0e('0x34')][_0x8a0e('0x35')]?_0xfadf56[_0x8a0e('0x34')]:_0x25aef1[_0x8a0e('0x30')];if(!_0x48aad2['query']['hasOwnProperty']('nolimit')){_0xfadf56['limit']=qs['limit'](_0x48aad2[_0x8a0e('0x31')]['limit']);_0xfadf56['offset']=qs[_0x8a0e('0x1e')](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x1e')]);}_0xfadf56[_0x8a0e('0x36')]=qs['sort'](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0xfadf56[_0x8a0e('0x38')]=qs['filters'](_[_0x8a0e('0x39')](_0x48aad2['query'],_0x25aef1[_0x8a0e('0x3a')]),_0x4177ca);if(_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x3b')]){_0xfadf56['where']=_['merge'](_0xfadf56[_0x8a0e('0x38')],{'$or':_[_0x8a0e('0x2c')](_0x4177ca,function(_0x58d5a8){if(_0x58d5a8[_0x8a0e('0x2f')]!==_0x8a0e('0x3c')){var _0x3eb2ec={};_0x3eb2ec[_0x58d5a8[_0x8a0e('0x29')]]={'$like':'%'+_0x48aad2[_0x8a0e('0x31')]['filter']+'%'};return _0x3eb2ec;}})});}_0xfadf56=_[_0x8a0e('0x3d')]({},_0xfadf56,_0x48aad2[_0x8a0e('0x3e')]);var _0xfa8632={'where':_0xfadf56['where']};return db[_0x8a0e('0x2d')][_0x8a0e('0x3f')](_0xfa8632)[_0x8a0e('0x40')](function(_0x8390da){_0x44232d[_0x8a0e('0x3f')]=_0x8390da;if(_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x41')]){_0xfadf56[_0x8a0e('0x42')]=[{'all':!![]}];}return db[_0x8a0e('0x2d')]['findAll'](_0xfadf56);})['then'](function(_0x4dfc47){_0x44232d[_0x8a0e('0x43')]=_0x4dfc47;return _0x44232d;})[_0x8a0e('0x40')](respondWithFilteredResult(_0x5bfdc9,_0xfadf56))[_0x8a0e('0x44')](handleError(_0x5bfdc9,null));};exports['show']=function(_0x308d2b,_0x12ff29){var _0x18701c={'raw':![],'where':{'id':_0x308d2b[_0x8a0e('0x45')]['id']}},_0x5d686d={};_0x5d686d[_0x8a0e('0x30')]=_[_0x8a0e('0x46')](db[_0x8a0e('0x2d')][_0x8a0e('0x47')]);_0x5d686d[_0x8a0e('0x31')]=_[_0x8a0e('0x46')](_0x308d2b['query']);_0x5d686d[_0x8a0e('0x3a')]=_[_0x8a0e('0x32')](_0x5d686d['model'],_0x5d686d[_0x8a0e('0x31')]);_0x18701c[_0x8a0e('0x34')]=_['intersection'](_0x5d686d[_0x8a0e('0x30')],qs[_0x8a0e('0x33')](_0x308d2b[_0x8a0e('0x31')][_0x8a0e('0x33')]));_0x18701c[_0x8a0e('0x34')]=_0x18701c['attributes'][_0x8a0e('0x35')]?_0x18701c[_0x8a0e('0x34')]:_0x5d686d[_0x8a0e('0x30')];if(_0x308d2b['query'][_0x8a0e('0x41')]){_0x18701c['include']=[{'all':!![]}];}_0x18701c=_['merge']({},_0x18701c,_0x308d2b[_0x8a0e('0x3e')]);return db[_0x8a0e('0x2d')][_0x8a0e('0x48')](_0x18701c)[_0x8a0e('0x40')](handleEntityNotFound(_0x12ff29,null))[_0x8a0e('0x40')](respondWithResult(_0x12ff29,null))[_0x8a0e('0x44')](handleError(_0x12ff29,null));};exports[_0x8a0e('0x49')]=function(_0x195796,_0x465b7a){return db['Automation']['create'](_0x195796[_0x8a0e('0x4a')],{})[_0x8a0e('0x40')](respondWithResult(_0x465b7a,0xc9))[_0x8a0e('0x44')](handleError(_0x465b7a,null));};exports[_0x8a0e('0x25')]=function(_0x110fe8,_0x372f3f){if(_0x110fe8['body']['id']){delete _0x110fe8[_0x8a0e('0x4a')]['id'];}return db[_0x8a0e('0x2d')][_0x8a0e('0x48')]({'where':{'id':_0x110fe8['params']['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x372f3f,null))['then'](saveUpdates(_0x110fe8[_0x8a0e('0x4a')],null))['then'](respondWithResult(_0x372f3f,null))[_0x8a0e('0x44')](handleError(_0x372f3f,null));};exports[_0x8a0e('0x26')]=function(_0x140fb3,_0x192c3c){return db[_0x8a0e('0x2d')][_0x8a0e('0x48')]({'where':{'id':_0x140fb3['params']['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x192c3c,null))[_0x8a0e('0x40')](removeEntity(_0x192c3c,null))[_0x8a0e('0x44')](handleError(_0x192c3c,null));};exports[_0x8a0e('0x4b')]=function(_0x52b8ed,_0x51a524,_0xcf2ab1){return db[_0x8a0e('0x4c')][_0x8a0e('0x48')]({'where':{'id':_0x52b8ed[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x51a524,null))[_0x8a0e('0x40')](function(_0x230304){if(_0x230304){return _0x230304['addConditions'](_0x52b8ed[_0x8a0e('0x4a')][_0x8a0e('0x4d')],_[_0x8a0e('0x4e')](_0x52b8ed[_0x8a0e('0x4a')],[_0x8a0e('0x4d'),'id'])||{});}})[_0x8a0e('0x40')](respondWithResult(_0x51a524,null))[_0x8a0e('0x44')](handleError(_0x51a524,null));};exports[_0x8a0e('0x4f')]=function(_0x251ad5,_0x27fcf4,_0x54e90e){var _0x446991={};var _0x4dcc51={};var _0x3cad27;var _0x578032;return db[_0x8a0e('0x2d')][_0x8a0e('0x50')]({'where':{'id':_0x251ad5[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x27fcf4,null))[_0x8a0e('0x40')](function(_0x35803d){if(_0x35803d){_0x3cad27=_0x35803d;_0x4dcc51['model']=_[_0x8a0e('0x46')](db[_0x8a0e('0x4c')]['rawAttributes']);_0x4dcc51['query']=_[_0x8a0e('0x46')](_0x251ad5[_0x8a0e('0x31')]);_0x4dcc51['filters']=_[_0x8a0e('0x32')](_0x4dcc51[_0x8a0e('0x30')],_0x4dcc51[_0x8a0e('0x31')]);_0x446991[_0x8a0e('0x34')]=_['intersection'](_0x4dcc51['model'],qs[_0x8a0e('0x33')](_0x251ad5['query']['fields']));_0x446991['attributes']=_0x446991['attributes'][_0x8a0e('0x35')]?_0x446991['attributes']:_0x4dcc51[_0x8a0e('0x30')];_0x446991['order']=qs[_0x8a0e('0x37')](_0x251ad5[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0x446991['where']=qs['filters'](_[_0x8a0e('0x39')](_0x251ad5[_0x8a0e('0x31')],_0x4dcc51[_0x8a0e('0x3a')]));if(_0x251ad5['query'][_0x8a0e('0x3b')]){_0x446991[_0x8a0e('0x38')]=_[_0x8a0e('0x3d')](_0x446991['where'],{'$or':_[_0x8a0e('0x2c')](_0x446991[_0x8a0e('0x34')],function(_0x350f89){var _0x55f3cf={};_0x55f3cf[_0x350f89]={'$like':'%'+_0x251ad5['query']['filter']+'%'};return _0x55f3cf;})});}_0x446991=_['merge']({},_0x446991,_0x251ad5[_0x8a0e('0x3e')]);return _0x3cad27[_0x8a0e('0x4f')](_0x446991);}})[_0x8a0e('0x40')](function(_0x59a903){if(_0x59a903){_0x578032=_0x59a903[_0x8a0e('0x35')];if(!_0x251ad5[_0x8a0e('0x31')]['hasOwnProperty'](_0x8a0e('0x51'))){_0x446991[_0x8a0e('0x20')]=qs[_0x8a0e('0x20')](_0x251ad5[_0x8a0e('0x31')][_0x8a0e('0x20')]);_0x446991[_0x8a0e('0x1e')]=qs[_0x8a0e('0x1e')](_0x251ad5['query'][_0x8a0e('0x1e')]);}return _0x3cad27[_0x8a0e('0x4f')](_0x446991);}})[_0x8a0e('0x40')](function(_0x26dafc){if(_0x26dafc){return _0x26dafc?{'count':_0x578032,'rows':_0x26dafc}:null;}})[_0x8a0e('0x40')](respondWithResult(_0x27fcf4,null))['catch'](handleError(_0x27fcf4,null));};exports[_0x8a0e('0x52')]=function(_0x46df62,_0x48f9b4,_0x137eab){return db[_0x8a0e('0x53')][_0x8a0e('0x48')]({'where':{'id':_0x46df62[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x48f9b4,null))[_0x8a0e('0x40')](function(_0x55a358){if(_0x55a358){return _0x55a358[_0x8a0e('0x52')](_0x46df62['body'][_0x8a0e('0x4d')],_[_0x8a0e('0x4e')](_0x46df62[_0x8a0e('0x4a')],[_0x8a0e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x48f9b4,null))['catch'](handleError(_0x48f9b4,null));};exports[_0x8a0e('0x54')]=function(_0x54bd2c,_0x1848b8,_0x1ac8c5){var _0x33a2da={};var _0x623404={};var _0x3e6f82;var _0x2be170;return db[_0x8a0e('0x2d')][_0x8a0e('0x50')]({'where':{'id':_0x54bd2c[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x1848b8,null))[_0x8a0e('0x40')](function(_0x49a9f0){if(_0x49a9f0){_0x3e6f82=_0x49a9f0;_0x623404[_0x8a0e('0x30')]=_[_0x8a0e('0x46')](db['Action']['rawAttributes']);_0x623404['query']=_['keys'](_0x54bd2c['query']);_0x623404[_0x8a0e('0x3a')]=_[_0x8a0e('0x32')](_0x623404[_0x8a0e('0x30')],_0x623404['query']);_0x33a2da[_0x8a0e('0x34')]=_[_0x8a0e('0x32')](_0x623404['model'],qs[_0x8a0e('0x33')](_0x54bd2c['query'][_0x8a0e('0x33')]));_0x33a2da[_0x8a0e('0x34')]=_0x33a2da[_0x8a0e('0x34')]['length']?_0x33a2da[_0x8a0e('0x34')]:_0x623404[_0x8a0e('0x30')];_0x33a2da['order']=qs['sort'](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0x33a2da[_0x8a0e('0x38')]=qs[_0x8a0e('0x3a')](_[_0x8a0e('0x39')](_0x54bd2c[_0x8a0e('0x31')],_0x623404[_0x8a0e('0x3a')]));if(_0x54bd2c[_0x8a0e('0x31')]['filter']){_0x33a2da[_0x8a0e('0x38')]=_[_0x8a0e('0x3d')](_0x33a2da[_0x8a0e('0x38')],{'$or':_[_0x8a0e('0x2c')](_0x33a2da[_0x8a0e('0x34')],function(_0x56245a){var _0x4adcea={};_0x4adcea[_0x56245a]={'$like':'%'+_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x3b')]+'%'};return _0x4adcea;})});}_0x33a2da=_[_0x8a0e('0x3d')]({},_0x33a2da,_0x54bd2c['options']);return _0x3e6f82['getActions'](_0x33a2da);}})['then'](function(_0x25b73b){if(_0x25b73b){_0x2be170=_0x25b73b['length'];if(!_0x54bd2c['query']['hasOwnProperty'](_0x8a0e('0x51'))){_0x33a2da['limit']=qs['limit'](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x20')]);_0x33a2da['offset']=qs[_0x8a0e('0x1e')](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x1e')]);}return _0x3e6f82['getActions'](_0x33a2da);}})[_0x8a0e('0x40')](function(_0x4577d0){if(_0x4577d0){return _0x4577d0?{'count':_0x2be170,'rows':_0x4577d0}:null;}})[_0x8a0e('0x40')](respondWithResult(_0x1848b8,null))['catch'](handleError(_0x1848b8,null));}; \ No newline at end of file +var _0x740e=['key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','show','params','keys','intersection','includeAll','options','find','create','catch','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x740e,0x179));var _0xe740=function(_0x12de57,_0x3a3edc){_0x12de57=_0x12de57-0x0;var _0x3f668f=_0x740e[_0x12de57];return _0x3f668f;};'use strict';var emlformat=require(_0xe740('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe740('0x1'));var rp=require(_0xe740('0x2'));var moment=require(_0xe740('0x3'));var BPromise=require(_0xe740('0x4'));var Mustache=require(_0xe740('0x5'));var util=require(_0xe740('0x6'));var path=require(_0xe740('0x7'));var sox=require('sox');var csv=require(_0xe740('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe740('0x9'));var _=require(_0xe740('0xa'));var squel=require(_0xe740('0xb'));var crypto=require(_0xe740('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe740('0xd'));var toCsv=require(_0xe740('0x8'));var querystring=require(_0xe740('0xe'));var Papa=require(_0xe740('0xf'));var Redis=require(_0xe740('0x10'));var authService=require(_0xe740('0x11'));var qs=require(_0xe740('0x12'));var as=require(_0xe740('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe740('0x14'))(_0xe740('0x15'));var utils=require(_0xe740('0x16'));var config=require(_0xe740('0x17'));var licenseUtil=require(_0xe740('0x18'));var db=require(_0xe740('0x19'))['db'];function respondWithStatusCode(_0x53e7c1,_0x2a50cc){_0x2a50cc=_0x2a50cc||0xcc;return function(_0xbe8b7b){if(_0xbe8b7b){return _0x53e7c1[_0xe740('0x1a')](_0x2a50cc);}return _0x53e7c1[_0xe740('0x1b')](_0x2a50cc)[_0xe740('0x1c')]();};}function respondWithResult(_0x35ff3f,_0x57dc45){_0x57dc45=_0x57dc45||0xc8;return function(_0x247183){if(_0x247183){return _0x35ff3f[_0xe740('0x1b')](_0x57dc45)[_0xe740('0x1d')](_0x247183);}};}function respondWithFilteredResult(_0x519b5,_0x38b6db){return function(_0x26adfd){if(_0x26adfd){var _0x121bec=typeof _0x38b6db[_0xe740('0x1e')]===_0xe740('0x1f')&&typeof _0x38b6db[_0xe740('0x20')]==='undefined';var _0x446b4b=_0x26adfd['count'];var _0x41e781=_0x121bec?0x0:_0x38b6db[_0xe740('0x1e')];var _0x3b8a6f=_0x121bec?_0x26adfd[_0xe740('0x21')]:_0x38b6db[_0xe740('0x1e')]+_0x38b6db[_0xe740('0x20')];var _0x158db4;if(_0x3b8a6f>=_0x446b4b){_0x3b8a6f=_0x446b4b;_0x158db4=0xc8;}else{_0x158db4=0xce;}_0x519b5['status'](_0x158db4);return _0x519b5[_0xe740('0x22')]('Content-Range',_0x41e781+'-'+_0x3b8a6f+'/'+_0x446b4b)[_0xe740('0x1d')](_0x26adfd);}return null;};}function patchUpdates(_0x1c9c3c){return function(_0x5ccc88){try{jsonpatch[_0xe740('0x23')](_0x5ccc88,_0x1c9c3c,!![]);}catch(_0x2060d5){return BPromise['reject'](_0x2060d5);}return _0x5ccc88['save']();};}function saveUpdates(_0x27d305,_0x39578d){return function(_0x2b092d){if(_0x2b092d){return _0x2b092d[_0xe740('0x24')](_0x27d305)[_0xe740('0x25')](function(_0x16f648){return _0x16f648;});}return null;};}function removeEntity(_0x42a23d,_0x371c03){return function(_0x367418){if(_0x367418){return _0x367418[_0xe740('0x26')]()[_0xe740('0x25')](function(){_0x42a23d['status'](0xcc)[_0xe740('0x1c')]();});}};}function handleEntityNotFound(_0x19fe3c,_0x426250){return function(_0xcbe053){if(!_0xcbe053){_0x19fe3c[_0xe740('0x1a')](0x194);}return _0xcbe053;};}function handleError(_0x3f0878,_0x4e74fb){_0x4e74fb=_0x4e74fb||0x1f4;return function(_0x43c7fa){logger[_0xe740('0x27')](_0x43c7fa[_0xe740('0x28')]);if(_0x43c7fa[_0xe740('0x29')]){delete _0x43c7fa[_0xe740('0x29')];}_0x3f0878[_0xe740('0x1b')](_0x4e74fb)[_0xe740('0x2a')](_0x43c7fa);};}exports[_0xe740('0x2b')]=function(_0x1795c1,_0x3d192b){var _0x52c106={},_0x52675b={},_0x264631={'count':0x0,'rows':[]};var _0x425944=_[_0xe740('0x2c')](db[_0xe740('0x2d')][_0xe740('0x2e')],function(_0x5ded98){return{'name':_0x5ded98['fieldName'],'type':_0x5ded98[_0xe740('0x2f')][_0xe740('0x30')]};});_0x52675b[_0xe740('0x31')]=_[_0xe740('0x2c')](_0x425944,_0xe740('0x29'));_0x52675b[_0xe740('0x32')]=_['keys'](_0x1795c1['query']);_0x52675b[_0xe740('0x33')]=_['intersection'](_0x52675b['model'],_0x52675b[_0xe740('0x32')]);_0x52c106[_0xe740('0x34')]=_['intersection'](_0x52675b[_0xe740('0x31')],qs[_0xe740('0x35')](_0x1795c1[_0xe740('0x32')][_0xe740('0x35')]));_0x52c106[_0xe740('0x34')]=_0x52c106['attributes'][_0xe740('0x36')]?_0x52c106[_0xe740('0x34')]:_0x52675b[_0xe740('0x31')];if(!_0x1795c1[_0xe740('0x32')][_0xe740('0x37')]('nolimit')){_0x52c106[_0xe740('0x20')]=qs[_0xe740('0x20')](_0x1795c1['query'][_0xe740('0x20')]);_0x52c106[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x1795c1['query'][_0xe740('0x1e')]);}_0x52c106[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x1795c1['query'][_0xe740('0x39')]);_0x52c106['where']=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x1795c1[_0xe740('0x32')],_0x52675b['filters']),_0x425944);if(_0x1795c1[_0xe740('0x32')][_0xe740('0x3b')]){_0x52c106[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x52c106[_0xe740('0x3c')],{'$or':_['map'](_0x425944,function(_0x4d5d16){if(_0x4d5d16['type']!==_0xe740('0x3e')){var _0x5b52f5={};_0x5b52f5[_0x4d5d16[_0xe740('0x29')]]={'$like':'%'+_0x1795c1[_0xe740('0x32')]['filter']+'%'};return _0x5b52f5;}})});}_0x52c106=_['merge']({},_0x52c106,_0x1795c1['options']);var _0xb8bcc9={'where':_0x52c106[_0xe740('0x3c')]};return db[_0xe740('0x2d')][_0xe740('0x21')](_0xb8bcc9)[_0xe740('0x25')](function(_0x15b0a4){_0x264631[_0xe740('0x21')]=_0x15b0a4;if(_0x1795c1[_0xe740('0x32')]['includeAll']){_0x52c106['include']=[{'all':!![]}];}return db[_0xe740('0x2d')][_0xe740('0x3f')](_0x52c106);})[_0xe740('0x25')](function(_0x35f6ba){_0x264631[_0xe740('0x40')]=_0x35f6ba;return _0x264631;})['then'](respondWithFilteredResult(_0x3d192b,_0x52c106))['catch'](handleError(_0x3d192b,null));};exports[_0xe740('0x41')]=function(_0x298735,_0x502ef2){var _0x4f67bd={'raw':![],'where':{'id':_0x298735[_0xe740('0x42')]['id']}},_0x3d4192={};_0x3d4192['model']=_[_0xe740('0x43')](db[_0xe740('0x2d')][_0xe740('0x2e')]);_0x3d4192[_0xe740('0x32')]=_[_0xe740('0x43')](_0x298735[_0xe740('0x32')]);_0x3d4192[_0xe740('0x33')]=_[_0xe740('0x44')](_0x3d4192['model'],_0x3d4192[_0xe740('0x32')]);_0x4f67bd['attributes']=_[_0xe740('0x44')](_0x3d4192[_0xe740('0x31')],qs[_0xe740('0x35')](_0x298735['query']['fields']));_0x4f67bd['attributes']=_0x4f67bd['attributes']['length']?_0x4f67bd['attributes']:_0x3d4192['model'];if(_0x298735[_0xe740('0x32')][_0xe740('0x45')]){_0x4f67bd['include']=[{'all':!![]}];}_0x4f67bd=_[_0xe740('0x3d')]({},_0x4f67bd,_0x298735[_0xe740('0x46')]);return db[_0xe740('0x2d')][_0xe740('0x47')](_0x4f67bd)['then'](handleEntityNotFound(_0x502ef2,null))[_0xe740('0x25')](respondWithResult(_0x502ef2,null))['catch'](handleError(_0x502ef2,null));};exports[_0xe740('0x48')]=function(_0x2c5d16,_0x47c960){return db[_0xe740('0x2d')][_0xe740('0x48')](_0x2c5d16['body'],{})[_0xe740('0x25')](respondWithResult(_0x47c960,0xc9))[_0xe740('0x49')](handleError(_0x47c960,null));};exports[_0xe740('0x24')]=function(_0x8989fd,_0x17f55e){if(_0x8989fd[_0xe740('0x4a')]['id']){delete _0x8989fd[_0xe740('0x4a')]['id'];}return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x8989fd[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x17f55e,null))['then'](saveUpdates(_0x8989fd[_0xe740('0x4a')],null))[_0xe740('0x25')](respondWithResult(_0x17f55e,null))['catch'](handleError(_0x17f55e,null));};exports[_0xe740('0x26')]=function(_0x108b9b,_0x2f7675){return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x108b9b[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x2f7675,null))[_0xe740('0x25')](removeEntity(_0x2f7675,null))[_0xe740('0x49')](handleError(_0x2f7675,null));};exports[_0xe740('0x4b')]=function(_0x57a22e,_0x55d19a,_0x1e2915){return db[_0xe740('0x4c')][_0xe740('0x47')]({'where':{'id':_0x57a22e['params']['id']}})['then'](handleEntityNotFound(_0x55d19a,null))['then'](function(_0x5b3697){if(_0x5b3697){return _0x5b3697[_0xe740('0x4b')](_0x57a22e[_0xe740('0x4a')][_0xe740('0x4d')],_[_0xe740('0x4e')](_0x57a22e[_0xe740('0x4a')],['ids','id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x55d19a,null))['catch'](handleError(_0x55d19a,null));};exports[_0xe740('0x4f')]=function(_0x34a276,_0x5868fa,_0x2bc6c6){var _0x4c51c6={};var _0x163e49={};var _0x6baac7;var _0x2fb841;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x34a276[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x5868fa,null))['then'](function(_0x5f45ea){if(_0x5f45ea){_0x6baac7=_0x5f45ea;_0x163e49['model']=_[_0xe740('0x43')](db[_0xe740('0x4c')][_0xe740('0x2e')]);_0x163e49['query']=_[_0xe740('0x43')](_0x34a276[_0xe740('0x32')]);_0x163e49[_0xe740('0x33')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],_0x163e49['query']);_0x4c51c6[_0xe740('0x34')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],qs[_0xe740('0x35')](_0x34a276[_0xe740('0x32')][_0xe740('0x35')]));_0x4c51c6[_0xe740('0x34')]=_0x4c51c6['attributes'][_0xe740('0x36')]?_0x4c51c6[_0xe740('0x34')]:_0x163e49[_0xe740('0x31')];_0x4c51c6[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x34a276[_0xe740('0x32')][_0xe740('0x39')]);_0x4c51c6[_0xe740('0x3c')]=qs['filters'](_[_0xe740('0x3a')](_0x34a276['query'],_0x163e49[_0xe740('0x33')]));if(_0x34a276[_0xe740('0x32')][_0xe740('0x3b')]){_0x4c51c6[_0xe740('0x3c')]=_['merge'](_0x4c51c6['where'],{'$or':_[_0xe740('0x2c')](_0x4c51c6['attributes'],function(_0x259576){var _0x2df1a5={};_0x2df1a5[_0x259576]={'$like':'%'+_0x34a276['query']['filter']+'%'};return _0x2df1a5;})});}_0x4c51c6=_[_0xe740('0x3d')]({},_0x4c51c6,_0x34a276[_0xe740('0x46')]);return _0x6baac7[_0xe740('0x4f')](_0x4c51c6);}})['then'](function(_0x494117){if(_0x494117){_0x2fb841=_0x494117['length'];if(!_0x34a276[_0xe740('0x32')][_0xe740('0x37')](_0xe740('0x51'))){_0x4c51c6[_0xe740('0x20')]=qs['limit'](_0x34a276[_0xe740('0x32')][_0xe740('0x20')]);_0x4c51c6['offset']=qs[_0xe740('0x1e')](_0x34a276[_0xe740('0x32')][_0xe740('0x1e')]);}return _0x6baac7['getConditions'](_0x4c51c6);}})[_0xe740('0x25')](function(_0x2a9381){if(_0x2a9381){return _0x2a9381?{'count':_0x2fb841,'rows':_0x2a9381}:null;}})[_0xe740('0x25')](respondWithResult(_0x5868fa,null))[_0xe740('0x49')](handleError(_0x5868fa,null));};exports[_0xe740('0x52')]=function(_0x42ad66,_0x504e29,_0x5a7145){return db[_0xe740('0x53')][_0xe740('0x47')]({'where':{'id':_0x42ad66[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x504e29,null))[_0xe740('0x25')](function(_0x1db76d){if(_0x1db76d){return _0x1db76d['addActions'](_0x42ad66[_0xe740('0x4a')][_0xe740('0x4d')],_['omit'](_0x42ad66[_0xe740('0x4a')],[_0xe740('0x4d'),'id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x504e29,null))[_0xe740('0x49')](handleError(_0x504e29,null));};exports[_0xe740('0x54')]=function(_0x37f482,_0x8df0e4,_0x16b686){var _0x25371a={};var _0x586310={};var _0x40fdf0;var _0x23bed4;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x37f482['params']['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x8df0e4,null))[_0xe740('0x25')](function(_0x568724){if(_0x568724){_0x40fdf0=_0x568724;_0x586310[_0xe740('0x31')]=_[_0xe740('0x43')](db[_0xe740('0x53')][_0xe740('0x2e')]);_0x586310[_0xe740('0x32')]=_[_0xe740('0x43')](_0x37f482[_0xe740('0x32')]);_0x586310[_0xe740('0x33')]=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],_0x586310[_0xe740('0x32')]);_0x25371a['attributes']=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],qs['fields'](_0x37f482[_0xe740('0x32')][_0xe740('0x35')]));_0x25371a[_0xe740('0x34')]=_0x25371a['attributes'][_0xe740('0x36')]?_0x25371a[_0xe740('0x34')]:_0x586310[_0xe740('0x31')];_0x25371a[_0xe740('0x38')]=qs['sort'](_0x37f482[_0xe740('0x32')][_0xe740('0x39')]);_0x25371a[_0xe740('0x3c')]=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x37f482[_0xe740('0x32')],_0x586310[_0xe740('0x33')]));if(_0x37f482[_0xe740('0x32')][_0xe740('0x3b')]){_0x25371a[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x25371a['where'],{'$or':_[_0xe740('0x2c')](_0x25371a['attributes'],function(_0x4eca8c){var _0x2121eb={};_0x2121eb[_0x4eca8c]={'$like':'%'+_0x37f482['query'][_0xe740('0x3b')]+'%'};return _0x2121eb;})});}_0x25371a=_[_0xe740('0x3d')]({},_0x25371a,_0x37f482[_0xe740('0x46')]);return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x4c04d3){if(_0x4c04d3){_0x23bed4=_0x4c04d3['length'];if(!_0x37f482[_0xe740('0x32')]['hasOwnProperty']('nolimit')){_0x25371a['limit']=qs[_0xe740('0x20')](_0x37f482[_0xe740('0x32')][_0xe740('0x20')]);_0x25371a[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x37f482['query']['offset']);}return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x5e5657){if(_0x5e5657){return _0x5e5657?{'count':_0x23bed4,'rows':_0x5e5657}:null;}})[_0xe740('0x25')](respondWithResult(_0x8df0e4,null))[_0xe740('0x49')](handleError(_0x8df0e4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a7c10a5..c9b5e4a 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 _0x4996=['api','moment','bluebird','path','../../config/environment','define','util'];(function(_0x81c1ef,_0x5a49ea){var _0x4b83d6=function(_0x4d6706){while(--_0x4d6706){_0x81c1ef['push'](_0x81c1ef['shift']());}};_0x4b83d6(++_0x5a49ea);}(_0x4996,0xbc));var _0x6499=function(_0x55214a,_0x30f5ac){_0x55214a=_0x55214a-0x0;var _0x58cb5b=_0x4996[_0x55214a];return _0x58cb5b;};'use strict';var _=require('lodash');var util=require(_0x6499('0x0'));var logger=require('../../config/logger')(_0x6499('0x1'));var moment=require(_0x6499('0x2'));var BPromise=require(_0x6499('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6499('0x4'));var rimraf=require('rimraf');var config=require(_0x6499('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x269d75,_0x119f29){return _0x269d75[_0x6499('0x6')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06b3=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Automation','lodash'];(function(_0x2299c8,_0xacd528){var _0x151013=function(_0x270d0b){while(--_0x270d0b){_0x2299c8['push'](_0x2299c8['shift']());}};_0x151013(++_0xacd528);}(_0x06b3,0x15f));var _0x306b=function(_0x30040c,_0x2f8c29){_0x30040c=_0x30040c-0x0;var _0x5b0204=_0x06b3[_0x30040c];return _0x5b0204;};'use strict';var _=require(_0x306b('0x0'));var util=require(_0x306b('0x1'));var logger=require(_0x306b('0x2'))(_0x306b('0x3'));var moment=require('moment');var BPromise=require(_0x306b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x306b('0x5'));var rimraf=require(_0x306b('0x6'));var config=require(_0x306b('0x7'));var attributes=require('./automation.attributes');module[_0x306b('0x8')]=function(_0x249d02,_0x12814c){return _0x249d02[_0x306b('0x9')](_0x306b('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 692ad70..f4a8e89 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 _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xb4c1f4,_0x10648f){var _0x443ccc=function(_0x16a69a){while(--_0x16a69a){_0xb4c1f4['push'](_0xb4c1f4['shift']());}};_0x443ccc(++_0x10648f);}(_0x70e3,0x9d));var _0x370e=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x70e3[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});} \ No newline at end of file +var _0x5454=['stringify','error','code','message','result','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5454,0x15b));var _0x4545=function(_0x281ea8,_0x46e40c){_0x281ea8=_0x281ea8-0x0;var _0x786282=_0x5454[_0x281ea8];return _0x786282;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4545('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4545('0x1'));var logger=require(_0x4545('0x2'))(_0x4545('0x3'));var config=require(_0x4545('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4545('0x5')][_0x4545('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x6fd3bb,_0xc79c57,_0x3f1134){return new BPromise(function(_0x1fd7e5,_0x1c5649){return client[_0x4545('0x7')](_0x6fd3bb,_0x3f1134)[_0x4545('0x8')](function(_0x3e2526){logger[_0x4545('0x9')](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));logger['debug'](_0x4545('0xc'),_0xc79c57,_0x4545('0xb'),JSON[_0x4545('0xd')](_0x3e2526));if(_0x3e2526[_0x4545('0xe')]){if(_0x3e2526[_0x4545('0xe')][_0x4545('0xf')]===0x1f4){logger['error'](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1c5649(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1fd7e5(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}else{logger['info'](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));_0x1fd7e5(_0x3e2526[_0x4545('0x11')][_0x4545('0x10')]);}})['catch'](function(_0x4a5bdf){logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x4a5bdf);_0x1c5649(_0x4a5bdf);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a284468..44d0ed1 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 _0xd847=['../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x41a6f4,_0x2a5df9){var _0x40785e=function(_0x2ad2a8){while(--_0x2ad2a8){_0x41a6f4['push'](_0x41a6f4['shift']());}};_0x40785e(++_0x2a5df9);}(_0xd847,0x18a));var _0x7d84=function(_0x300cdb,_0x88b46){_0x300cdb=_0x300cdb-0x0;var _0x54e47f=_0xd847[_0x300cdb];return _0x54e47f;};'use strict';var multer=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var path=require(_0x7d84('0x2'));var timeout=require(_0x7d84('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d84('0x4'));var auth=require(_0x7d84('0x5'));var interaction=require(_0x7d84('0x6'));var config=require(_0x7d84('0x7'));var controller=require(_0x7d84('0x8'));router['get']('/',auth[_0x7d84('0x9')](),controller['index']);router[_0x7d84('0xa')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0xc')]);router[_0x7d84('0xa')](_0x7d84('0xd'),auth['isAuthenticated'](),controller[_0x7d84('0xe')]);router['get']('/:id/actions',auth[_0x7d84('0x9')](),controller[_0x7d84('0xf')]);router[_0x7d84('0x10')]('/',auth[_0x7d84('0x9')](),controller[_0x7d84('0x11')]);router[_0x7d84('0x10')](_0x7d84('0xd'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x12')]);router[_0x7d84('0x10')](_0x7d84('0x13'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x14')]);router[_0x7d84('0x15')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x16')]);router[_0x7d84('0x17')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1fdc=['put','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x3806e8,_0x5f43ce){var _0x35bc99=function(_0xf5e039){while(--_0xf5e039){_0x3806e8['push'](_0x3806e8['shift']());}};_0x35bc99(++_0x5f43ce);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x1fdc[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var path=require('path');var timeout=require(_0xc1fd('0x2'));var express=require(_0xc1fd('0x3'));var router=express[_0xc1fd('0x4')]();var fs_extra=require(_0xc1fd('0x5'));var auth=require(_0xc1fd('0x6'));var interaction=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var controller=require('./automation.controller');router[_0xc1fd('0x9')]('/',auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xb')]);router[_0xc1fd('0x9')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xd')]);router[_0xc1fd('0x9')](_0xc1fd('0xe'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xf')]);router[_0xc1fd('0x9')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x11')]);router[_0xc1fd('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1fd('0x13')]);router['post'](_0xc1fd('0xe'),auth['isAuthenticated'](),controller[_0xc1fd('0x14')]);router[_0xc1fd('0x12')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x15')]);router[_0xc1fd('0x16')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['update']);router['delete'](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 7bf3be7..ba79688 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 _0x2581=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x4845cd,_0x4e7997){var _0x38d59a=function(_0x4bb7e3){while(--_0x4bb7e3){_0x4845cd['push'](_0x4845cd['shift']());}};_0x38d59a(++_0x4e7997);}(_0x2581,0x72));var _0x1258=function(_0x21ef4c,_0x3dbb09){_0x21ef4c=_0x21ef4c-0x0;var _0xf4326=_0x2581[_0x21ef4c];return _0xf4326;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'unique':_0x1258('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x5')),'allowNull':![],'defaultValue':_0x1258('0x5')},'description':{'type':Sequelize[_0x1258('0x2')]},'active':{'type':Sequelize[_0x1258('0x6')],'defaultValue':0x0,'comment':_0x1258('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1258('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1258('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1258('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1258('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'comment':_0x1258('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1258('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1258('0x2')],'defaultValue':_0x1258('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x11'),'never',_0x1258('0x12')),'defaultValue':_0x1258('0x11')},'dialAMDActive':{'type':Sequelize[_0x1258('0x6')],'defaultValue':0x0,'comment':_0x1258('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1258('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1258('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1258('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1258('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1258('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1258('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1258('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1258('0xa')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1258('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1258('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1258('0x1a'),_0x1258('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1258('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1258('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'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 +var _0xc0b1=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr'];(function(_0x17bcc8,_0x3dac2f){var _0x5854aa=function(_0x2fb8a9){while(--_0x2fb8a9){_0x17bcc8['push'](_0x17bcc8['shift']());}};_0x5854aa(++_0x3dac2f);}(_0xc0b1,0x1b3));var _0x1c0b=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0xc0b1[_0x260ce2];return _0x16b105;};'use strict';var Sequelize=require('sequelize');module[_0x1c0b('0x0')]={'name':{'type':Sequelize[_0x1c0b('0x1')],'unique':_0x1c0b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x4')),'allowNull':![],'defaultValue':_0x1c0b('0x4')},'description':{'type':Sequelize[_0x1c0b('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1c0b('0x5')},'limitCalls':{'type':Sequelize[_0x1c0b('0x6')](0x4)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1c0b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c0b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1c0b('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c0b('0xe')},'dialTimezone':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':_0x1c0b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x10'),_0x1c0b('0x11'),_0x1c0b('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1c0b('0x13')],'defaultValue':0x0,'comment':_0x1c0b('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c0b('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c0b('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1c0b('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c0b('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c0b('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1c0b('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1c0b('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c0b('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1c0b('0x3')]('DESC',_0x1c0b('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c0b('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1e')},'dialCutDigit':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 44d2147..f15b219 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 _0x6526=['phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','cm_contacts','select','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','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','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','Campaign','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0x6526,0xa2));var _0x6652=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x6526[_0x553a87];return _0x12d1e6;};'use strict';var emlformat=require(_0x6652('0x0'));var rimraf=require(_0x6652('0x1'));var zipdir=require(_0x6652('0x2'));var jsonpatch=require(_0x6652('0x3'));var rp=require(_0x6652('0x4'));var moment=require(_0x6652('0x5'));var BPromise=require(_0x6652('0x6'));var Mustache=require('mustache');var util=require(_0x6652('0x7'));var path=require('path');var sox=require(_0x6652('0x8'));var csv=require(_0x6652('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6652('0xa'));var _=require('lodash');var squel=require(_0x6652('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6652('0xc'));var toCsv=require(_0x6652('0x9'));var querystring=require(_0x6652('0xd'));var Papa=require(_0x6652('0xe'));var Redis=require(_0x6652('0xf'));var authService=require(_0x6652('0x10'));var qs=require(_0x6652('0x11'));var as=require(_0x6652('0x12'));var hardwareService=require(_0x6652('0x13'));var logger=require(_0x6652('0x14'))('api');var utils=require(_0x6652('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6652('0x16'));var db=require(_0x6652('0x17'))['db'];function respondWithStatusCode(_0x31ef0b,_0x209674){_0x209674=_0x209674||0xcc;return function(_0x386c30){if(_0x386c30){return _0x31ef0b['sendStatus'](_0x209674);}return _0x31ef0b[_0x6652('0x18')](_0x209674)[_0x6652('0x19')]();};}function respondWithResult(_0x3b04b3,_0x296531){_0x296531=_0x296531||0xc8;return function(_0x4b4f84){if(_0x4b4f84){return _0x3b04b3[_0x6652('0x18')](_0x296531)[_0x6652('0x1a')](_0x4b4f84);}};}function respondWithFilteredResult(_0x43547c,_0x435da9){return function(_0x5b010c){if(_0x5b010c){var _0x49859e=typeof _0x435da9[_0x6652('0x1b')]==='undefined'&&typeof _0x435da9[_0x6652('0x1c')]===_0x6652('0x1d');var _0x281f41=_0x5b010c['count'];var _0x31a6ca=_0x49859e?0x0:_0x435da9[_0x6652('0x1b')];var _0x453c65=_0x49859e?_0x5b010c[_0x6652('0x1e')]:_0x435da9[_0x6652('0x1b')]+_0x435da9[_0x6652('0x1c')];var _0x2b0740;if(_0x453c65>=_0x281f41){_0x453c65=_0x281f41;_0x2b0740=0xc8;}else{_0x2b0740=0xce;}_0x43547c['status'](_0x2b0740);return _0x43547c[_0x6652('0x1f')](_0x6652('0x20'),_0x31a6ca+'-'+_0x453c65+'/'+_0x281f41)[_0x6652('0x1a')](_0x5b010c);}return null;};}function patchUpdates(_0x20699b){return function(_0x911b6e){try{jsonpatch[_0x6652('0x21')](_0x911b6e,_0x20699b,!![]);}catch(_0x1c0f19){return BPromise['reject'](_0x1c0f19);}return _0x911b6e[_0x6652('0x22')]();};}function saveUpdates(_0x580fe5,_0x1f9d27){return function(_0x21441d){if(_0x21441d){return _0x21441d['update'](_0x580fe5)[_0x6652('0x23')](function(_0x4761c5){return _0x4761c5;});}return null;};}function removeEntity(_0x4e4102,_0x5cb432){return function(_0x294f99){if(_0x294f99){return _0x294f99[_0x6652('0x24')]()[_0x6652('0x23')](function(){var _0x4f0c24=_0x294f99[_0x6652('0x25')]({'plain':!![]});var _0x5eb5eb='IvrCampaigns';return db[_0x6652('0x26')][_0x6652('0x24')]({'where':{'type':_0x5eb5eb,'resourceId':_0x4f0c24['id']}})[_0x6652('0x23')](function(){return _0x294f99;});})[_0x6652('0x23')](function(){_0x4e4102[_0x6652('0x18')](0xcc)[_0x6652('0x19')]();});}};}function handleEntityNotFound(_0x50d035,_0x30209c){return function(_0xd8bd18){if(!_0xd8bd18){_0x50d035[_0x6652('0x27')](0x194);}return _0xd8bd18;};}function handleError(_0x5ceece,_0x3c3958){_0x3c3958=_0x3c3958||0x1f4;return function(_0x2fb2f0){logger[_0x6652('0x28')](_0x2fb2f0[_0x6652('0x29')]);if(_0x2fb2f0[_0x6652('0x2a')]){delete _0x2fb2f0[_0x6652('0x2a')];}_0x5ceece[_0x6652('0x18')](_0x3c3958)[_0x6652('0x2b')](_0x2fb2f0);};}exports['index']=function(_0x4ffb2b,_0x583d7a){var _0x444cb1={},_0x894c3={},_0x2d8e95={'count':0x0,'rows':[]};var _0x358b55=_[_0x6652('0x2c')](db[_0x6652('0x2d')]['rawAttributes'],function(_0x23deda){return{'name':_0x23deda[_0x6652('0x2e')],'type':_0x23deda[_0x6652('0x2f')][_0x6652('0x30')]};});_0x894c3[_0x6652('0x31')]=_[_0x6652('0x2c')](_0x358b55,_0x6652('0x2a'));_0x894c3[_0x6652('0x32')]=_[_0x6652('0x33')](_0x4ffb2b[_0x6652('0x32')]);_0x894c3[_0x6652('0x34')]=_['intersection'](_0x894c3[_0x6652('0x31')],_0x894c3['query']);_0x444cb1[_0x6652('0x35')]=_[_0x6652('0x36')](_0x894c3[_0x6652('0x31')],qs[_0x6652('0x37')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x37')]));_0x444cb1[_0x6652('0x35')]=_0x444cb1['attributes'][_0x6652('0x38')]?_0x444cb1['attributes']:_0x894c3['model'];if(!_0x4ffb2b[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x444cb1[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x1c')]);_0x444cb1['offset']=qs[_0x6652('0x1b')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x1b')]);}_0x444cb1[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x4ffb2b[_0x6652('0x32')]['sort']);_0x444cb1[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x4ffb2b[_0x6652('0x32')],_0x894c3[_0x6652('0x34')]),_0x358b55);if(_0x4ffb2b[_0x6652('0x32')][_0x6652('0x3f')]){_0x444cb1[_0x6652('0x3d')]=_['merge'](_0x444cb1[_0x6652('0x3d')],{'$or':_['map'](_0x358b55,function(_0x599a23){if(_0x599a23[_0x6652('0x2f')]!==_0x6652('0x40')){var _0x5c1c4d={};_0x5c1c4d[_0x599a23[_0x6652('0x2a')]]={'$like':'%'+_0x4ffb2b[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x5c1c4d;}})});}_0x444cb1=_['merge']({},_0x444cb1,_0x4ffb2b[_0x6652('0x41')]);var _0xdb942a={'where':_0x444cb1['where']};return db[_0x6652('0x2d')]['count'](_0xdb942a)[_0x6652('0x23')](function(_0x20bab0){_0x2d8e95[_0x6652('0x1e')]=_0x20bab0;if(_0x4ffb2b['query'][_0x6652('0x42')]){_0x444cb1[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x2d')][_0x6652('0x44')](_0x444cb1);})[_0x6652('0x23')](function(_0x1980e5){_0x2d8e95['rows']=_0x1980e5;return _0x2d8e95;})[_0x6652('0x23')](respondWithFilteredResult(_0x583d7a,_0x444cb1))[_0x6652('0x45')](handleError(_0x583d7a,null));};exports[_0x6652('0x46')]=function(_0xb7bcd3,_0x2ab18b){var _0xb3cdca={'raw':![],'where':{'id':_0xb7bcd3[_0x6652('0x47')]['id']}},_0x3c3388={};_0x3c3388[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x2d')][_0x6652('0x48')]);_0x3c3388['query']=_[_0x6652('0x33')](_0xb7bcd3['query']);_0x3c3388[_0x6652('0x34')]=_[_0x6652('0x36')](_0x3c3388['model'],_0x3c3388[_0x6652('0x32')]);_0xb3cdca[_0x6652('0x35')]=_[_0x6652('0x36')](_0x3c3388[_0x6652('0x31')],qs[_0x6652('0x37')](_0xb7bcd3[_0x6652('0x32')][_0x6652('0x37')]));_0xb3cdca[_0x6652('0x35')]=_0xb3cdca[_0x6652('0x35')][_0x6652('0x38')]?_0xb3cdca[_0x6652('0x35')]:_0x3c3388['model'];if(_0xb7bcd3[_0x6652('0x32')][_0x6652('0x42')]){_0xb3cdca[_0x6652('0x43')]=[{'all':!![]}];}_0xb3cdca=_[_0x6652('0x49')]({},_0xb3cdca,_0xb7bcd3[_0x6652('0x41')]);return db[_0x6652('0x2d')][_0x6652('0x4a')](_0xb3cdca)[_0x6652('0x23')](handleEntityNotFound(_0x2ab18b,null))[_0x6652('0x23')](respondWithResult(_0x2ab18b,null))[_0x6652('0x45')](handleError(_0x2ab18b,null));};exports[_0x6652('0x4b')]=function(_0xda945a,_0x4f3b94){return db['Campaign'][_0x6652('0x4b')](_0xda945a[_0x6652('0x4c')],{})['then'](function(_0x6d105a){var _0x4dfb54=_0xda945a[_0x6652('0x4d')][_0x6652('0x25')]({'plain':!![]});if(!_0x4dfb54)throw new Error(_0x6652('0x4e'));if(_0x4dfb54[_0x6652('0x4f')]===_0x6652('0x4d')){var _0x340d03=_0x6d105a['get']({'plain':!![]});var _0x623f6b=_0x6652('0x50');return db[_0x6652('0x51')][_0x6652('0x4a')]({'where':{'name':_0x623f6b,'userProfileId':_0x4dfb54[_0x6652('0x52')]},'raw':!![]})[_0x6652('0x23')](function(_0x33d714){if(_0x33d714&&_0x33d714['autoAssociation']===0x0){return db[_0x6652('0x26')]['create']({'name':_0x340d03[_0x6652('0x2a')],'resourceId':_0x340d03['id'],'type':_0x33d714['name'],'sectionId':_0x33d714['id']},{})[_0x6652('0x23')](function(){return _0x6d105a;});}else{return _0x6d105a;}})[_0x6652('0x45')](function(_0x444163){logger[_0x6652('0x28')](_0x6652('0x53'),_0x444163);throw _0x444163;});}return _0x6d105a;})['then'](respondWithResult(_0x4f3b94,0xc9))['catch'](handleError(_0x4f3b94,null));};exports[_0x6652('0x54')]=function(_0x48cbae,_0x32c82f){var _0x5944e8={'where':{'id':_0x48cbae[_0x6652('0x47')]['id']}},_0x1390d2={};_0x1390d2[_0x6652('0x31')]=_['keys'](db[_0x6652('0x2d')][_0x6652('0x48')]);_0x5944e8[_0x6652('0x35')]=_['intersection'](_0x1390d2['model'],qs[_0x6652('0x37')](_0x48cbae[_0x6652('0x32')][_0x6652('0x37')]));_0x5944e8['attributes']=_0x5944e8[_0x6652('0x35')]['length']?_0x5944e8[_0x6652('0x35')]:_0x1390d2[_0x6652('0x31')];if(_0x48cbae[_0x6652('0x32')][_0x6652('0x42')]){_0x5944e8[_0x6652('0x43')]=[{'all':!![]}];}_0x5944e8=_['merge']({},_0x5944e8,_0x48cbae['options']);return db[_0x6652('0x2d')]['find'](_0x5944e8)[_0x6652('0x23')](handleEntityNotFound(_0x32c82f,null))['then'](function(_0x399919){if(_0x399919){var _0x2b65e9=_0x399919[_0x6652('0x25')]({'plain':!![]});_0x2b65e9=qs[_0x6652('0x55')](_0x2b65e9,['id','createdAt',_0x6652('0x56')]);_0x48cbae[_0x6652('0x4c')]=_[_0x6652('0x55')](_0x48cbae[_0x6652('0x4c')],['id',_0x6652('0x57'),_0x6652('0x56')]);return db[_0x6652('0x2d')][_0x6652('0x4b')](_[_0x6652('0x49')](_0x2b65e9,_0x48cbae[_0x6652('0x4c')]),{'include':_0x48cbae['query'][_0x6652('0x42')]?[{'all':!![]}]:undefined})[_0x6652('0x23')](function(_0x116c95){var _0x46e273=_0x48cbae[_0x6652('0x4d')][_0x6652('0x25')]({'plain':!![]});if(!_0x46e273)throw new Error(_0x6652('0x4e'));if(_0x46e273[_0x6652('0x4f')]===_0x6652('0x4d')){var _0x3ba822=_0x116c95[_0x6652('0x25')]({'plain':!![]});var _0x3b7156=_0x6652('0x50');return db[_0x6652('0x51')]['find']({'where':{'name':_0x3b7156,'userProfileId':_0x46e273[_0x6652('0x52')]},'raw':!![]})[_0x6652('0x23')](function(_0xfe2e2){if(_0xfe2e2&&_0xfe2e2[_0x6652('0x58')]===0x0){return db[_0x6652('0x26')][_0x6652('0x4b')]({'name':_0x3ba822['name'],'resourceId':_0x3ba822['id'],'type':_0xfe2e2[_0x6652('0x2a')],'sectionId':_0xfe2e2['id']},{})['then'](function(){return _0x116c95;});}else{return _0x116c95;}})[_0x6652('0x45')](function(_0x52caab){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52caab);throw _0x52caab;});}return _0x116c95;});}})[_0x6652('0x23')](respondWithResult(_0x32c82f,0xc9))[_0x6652('0x45')](handleError(_0x32c82f,null));};exports['update']=function(_0x70b025,_0x4e4480){if(_0x70b025['body']['id']){delete _0x70b025[_0x6652('0x4c')]['id'];}return db[_0x6652('0x2d')]['find']({'where':{'id':_0x70b025['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x4e4480,null))[_0x6652('0x23')](saveUpdates(_0x70b025[_0x6652('0x4c')],null))[_0x6652('0x23')](respondWithResult(_0x4e4480,null))['catch'](handleError(_0x4e4480,null));};exports[_0x6652('0x24')]=function(_0x441e6c,_0x3f48c8){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x441e6c[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x3f48c8,null))[_0x6652('0x23')](removeEntity(_0x3f48c8,null))[_0x6652('0x45')](handleError(_0x3f48c8,null));};exports[_0x6652('0x59')]=function(_0x506c89,_0x417c89,_0x22e190){var _0x27bdc3={'raw':!![],'where':{}};var _0x2be797={};var _0x486194={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x506c89[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x417c89,null))[_0x6652('0x23')](function(_0x3b3cac){if(_0x3b3cac){_0x2be797['model']=_['keys'](db[_0x6652('0x5b')][_0x6652('0x48')]);_0x2be797[_0x6652('0x32')]=_[_0x6652('0x33')](_0x506c89[_0x6652('0x32')]);_0x2be797[_0x6652('0x34')]=_['intersection'](_0x2be797[_0x6652('0x31')],_0x2be797[_0x6652('0x32')]);_0x27bdc3[_0x6652('0x35')]=_['intersection'](_0x2be797['model'],qs['fields'](_0x506c89[_0x6652('0x32')][_0x6652('0x37')]));_0x27bdc3[_0x6652('0x35')]=_0x27bdc3[_0x6652('0x35')]['length']?_0x27bdc3[_0x6652('0x35')]:_0x2be797[_0x6652('0x31')];if(!_0x506c89['query'][_0x6652('0x39')](_0x6652('0x3a'))){_0x27bdc3[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x506c89['query'][_0x6652('0x1c')]);_0x27bdc3[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x506c89[_0x6652('0x32')]['offset']);}_0x27bdc3[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x506c89[_0x6652('0x32')][_0x6652('0x3c')]);_0x27bdc3[_0x6652('0x3d')]=qs['filters'](_[_0x6652('0x3e')](_0x506c89[_0x6652('0x32')],_0x2be797['filters']));_0x27bdc3['where'][_0x6652('0x5c')]=_0x3b3cac['id'];if(_0x506c89[_0x6652('0x32')][_0x6652('0x3f')]){_0x27bdc3[_0x6652('0x3d')]=_[_0x6652('0x49')](_0x27bdc3[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x27bdc3[_0x6652('0x35')],function(_0x5fd026){var _0x5f0560={};_0x5f0560[_0x5fd026]={'$like':'%'+_0x506c89['query'][_0x6652('0x3f')]+'%'};return _0x5f0560;})});}_0x27bdc3=_['merge']({},_0x27bdc3,_0x506c89['options']);return db[_0x6652('0x5b')][_0x6652('0x1e')]({'where':_0x27bdc3['where']})[_0x6652('0x23')](function(_0x1b3751){_0x486194[_0x6652('0x1e')]=_0x1b3751;if(_0x506c89[_0x6652('0x32')]['includeAll']){_0x27bdc3[_0x6652('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0x6652('0x44')](_0x27bdc3);})[_0x6652('0x23')](function(_0x44b760){_0x486194['rows']=_0x44b760;return _0x486194;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x417c89,_0x27bdc3))['catch'](handleError(_0x417c89,null));};exports['getHopperHistories']=function(_0x541909,_0x512bf7,_0x1802d6){var _0x9ace91={'raw':!![],'where':{}};var _0x542667={};var _0x4253e9={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x541909[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x512bf7,null))[_0x6652('0x23')](function(_0x401124){if(_0x401124){_0x542667['model']=_[_0x6652('0x33')](db['CmHopperHistory'][_0x6652('0x48')]);_0x542667[_0x6652('0x32')]=_[_0x6652('0x33')](_0x541909[_0x6652('0x32')]);_0x542667['filters']=_[_0x6652('0x36')](_0x542667[_0x6652('0x31')],_0x542667[_0x6652('0x32')]);_0x9ace91['attributes']=_[_0x6652('0x36')](_0x542667['model'],qs['fields'](_0x541909['query']['fields']));_0x9ace91[_0x6652('0x35')]=_0x9ace91[_0x6652('0x35')][_0x6652('0x38')]?_0x9ace91['attributes']:_0x542667[_0x6652('0x31')];if(!_0x541909[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x9ace91[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x541909[_0x6652('0x32')][_0x6652('0x1c')]);_0x9ace91[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x541909[_0x6652('0x32')][_0x6652('0x1b')]);}_0x9ace91[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x541909[_0x6652('0x32')][_0x6652('0x3c')]);_0x9ace91[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x541909[_0x6652('0x32')],_0x542667[_0x6652('0x34')]));_0x9ace91[_0x6652('0x3d')][_0x6652('0x5c')]=_0x401124['id'];if(_0x541909[_0x6652('0x32')][_0x6652('0x3f')]){_0x9ace91[_0x6652('0x3d')]=_[_0x6652('0x49')](_0x9ace91[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x9ace91['attributes'],function(_0x45d20b){var _0x17e180={};_0x17e180[_0x45d20b]={'$like':'%'+_0x541909[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x17e180;})});}_0x9ace91=_[_0x6652('0x49')]({},_0x9ace91,_0x541909[_0x6652('0x41')]);return db['CmHopperHistory'][_0x6652('0x1e')]({'where':_0x9ace91[_0x6652('0x3d')]})[_0x6652('0x23')](function(_0x27363c){_0x4253e9[_0x6652('0x1e')]=_0x27363c;if(_0x541909[_0x6652('0x32')][_0x6652('0x42')]){_0x9ace91[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x5d')]['findAll'](_0x9ace91);})['then'](function(_0xe168f4){_0x4253e9[_0x6652('0x5e')]=_0xe168f4;return _0x4253e9;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x512bf7,_0x9ace91))[_0x6652('0x45')](handleError(_0x512bf7,null));};exports[_0x6652('0x5f')]=function(_0x30d2e2,_0x254837,_0x377fb2){var _0x7c638f={'raw':!![],'where':{}};var _0x301133={};var _0x22f870={'count':0x0,'rows':[]};return db[_0x6652('0x2d')]['findOne']({'where':{'id':_0x30d2e2[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x254837,null))[_0x6652('0x23')](function(_0x322adc){if(_0x322adc){_0x301133[_0x6652('0x31')]=_['keys'](db[_0x6652('0x60')][_0x6652('0x48')]);_0x301133[_0x6652('0x32')]=_[_0x6652('0x33')](_0x30d2e2[_0x6652('0x32')]);_0x301133[_0x6652('0x34')]=_[_0x6652('0x36')](_0x301133[_0x6652('0x31')],_0x301133[_0x6652('0x32')]);_0x7c638f[_0x6652('0x35')]=_['intersection'](_0x301133[_0x6652('0x31')],qs['fields'](_0x30d2e2[_0x6652('0x32')][_0x6652('0x37')]));_0x7c638f[_0x6652('0x35')]=_0x7c638f['attributes'][_0x6652('0x38')]?_0x7c638f['attributes']:_0x301133[_0x6652('0x31')];if(!_0x30d2e2[_0x6652('0x32')][_0x6652('0x39')]('nolimit')){_0x7c638f[_0x6652('0x1c')]=qs['limit'](_0x30d2e2[_0x6652('0x32')][_0x6652('0x1c')]);_0x7c638f[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x30d2e2['query']['offset']);}_0x7c638f[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x30d2e2[_0x6652('0x32')][_0x6652('0x3c')]);_0x7c638f[_0x6652('0x3d')]=qs[_0x6652('0x34')](_['pick'](_0x30d2e2[_0x6652('0x32')],_0x301133[_0x6652('0x34')]));_0x7c638f['where']['CampaignId']=_0x322adc['id'];if(_0x30d2e2['query'][_0x6652('0x3f')]){_0x7c638f['where']=_[_0x6652('0x49')](_0x7c638f[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x7c638f[_0x6652('0x35')],function(_0x1dd439){var _0x15781e={};_0x15781e[_0x1dd439]={'$like':'%'+_0x30d2e2['query'][_0x6652('0x3f')]+'%'};return _0x15781e;})});}_0x7c638f=_[_0x6652('0x49')]({},_0x7c638f,_0x30d2e2['options']);return db[_0x6652('0x60')][_0x6652('0x1e')]({'where':_0x7c638f['where']})[_0x6652('0x23')](function(_0x18b396){_0x22f870['count']=_0x18b396;if(_0x30d2e2[_0x6652('0x32')][_0x6652('0x42')]){_0x7c638f[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x60')][_0x6652('0x44')](_0x7c638f);})['then'](function(_0x16994d){_0x22f870[_0x6652('0x5e')]=_0x16994d;return _0x22f870;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x254837,_0x7c638f))[_0x6652('0x45')](handleError(_0x254837,null));};exports['getHopperBlacks']=function(_0x3d48e5,_0x30c32f,_0x1da683){var _0x3b8225={'raw':!![],'where':{}};var _0x16f648={};var _0x13bc9d={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3d48e5[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x30c32f,null))['then'](function(_0x52caf5){if(_0x52caf5){_0x16f648[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x61')][_0x6652('0x48')]);_0x16f648[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3d48e5[_0x6652('0x32')]);_0x16f648['filters']=_[_0x6652('0x36')](_0x16f648['model'],_0x16f648[_0x6652('0x32')]);_0x3b8225['attributes']=_['intersection'](_0x16f648[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x37')]));_0x3b8225[_0x6652('0x35')]=_0x3b8225[_0x6652('0x35')][_0x6652('0x38')]?_0x3b8225[_0x6652('0x35')]:_0x16f648[_0x6652('0x31')];if(!_0x3d48e5[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x3b8225[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x3d48e5['query']['limit']);_0x3b8225[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x1b')]);}_0x3b8225[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x3c')]);_0x3b8225['where']=qs['filters'](_[_0x6652('0x3e')](_0x3d48e5[_0x6652('0x32')],_0x16f648[_0x6652('0x34')]));_0x3b8225[_0x6652('0x3d')][_0x6652('0x5c')]=_0x52caf5['id'];if(_0x3d48e5[_0x6652('0x32')][_0x6652('0x3f')]){_0x3b8225[_0x6652('0x3d')]=_['merge'](_0x3b8225['where'],{'$or':_[_0x6652('0x2c')](_0x3b8225['attributes'],function(_0x3e2371){var _0x61272b={};_0x61272b[_0x3e2371]={'$like':'%'+_0x3d48e5[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x61272b;})});}_0x3b8225=_[_0x6652('0x49')]({},_0x3b8225,_0x3d48e5[_0x6652('0x41')]);return db[_0x6652('0x61')]['count']({'where':_0x3b8225['where']})['then'](function(_0x430386){_0x13bc9d[_0x6652('0x1e')]=_0x430386;if(_0x3d48e5[_0x6652('0x32')][_0x6652('0x42')]){_0x3b8225[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x61')][_0x6652('0x44')](_0x3b8225);})[_0x6652('0x23')](function(_0x5aaace){_0x13bc9d[_0x6652('0x5e')]=_0x5aaace;return _0x13bc9d;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x30c32f,_0x3b8225))[_0x6652('0x45')](handleError(_0x30c32f,null));};exports[_0x6652('0x62')]=function(_0x3f9dc0,_0x4bc4da,_0x314a8b){var _0x4de1fd={};var _0xd82e5d={};var _0x7ed149;var _0x450ffc;return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3f9dc0['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x4bc4da,null))[_0x6652('0x23')](function(_0x5530eb){if(_0x5530eb){_0x7ed149=_0x5530eb;_0xd82e5d[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x63')]['rawAttributes']);_0xd82e5d[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3f9dc0['query']);_0xd82e5d[_0x6652('0x34')]=_[_0x6652('0x36')](_0xd82e5d[_0x6652('0x31')],_0xd82e5d[_0x6652('0x32')]);_0x4de1fd[_0x6652('0x35')]=_[_0x6652('0x36')](_0xd82e5d[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3f9dc0[_0x6652('0x32')][_0x6652('0x37')]));_0x4de1fd[_0x6652('0x35')]=_0x4de1fd[_0x6652('0x35')]['length']?_0x4de1fd[_0x6652('0x35')]:_0xd82e5d[_0x6652('0x31')];_0x4de1fd[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x3f9dc0['query']['sort']);_0x4de1fd[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x3f9dc0[_0x6652('0x32')],_0xd82e5d[_0x6652('0x34')]));if(_0x3f9dc0['query']['filter']){_0x4de1fd[_0x6652('0x3d')]=_['merge'](_0x4de1fd['where'],{'$or':_[_0x6652('0x2c')](_0x4de1fd['attributes'],function(_0x12e996){var _0x494e88={};_0x494e88[_0x12e996]={'$like':'%'+_0x3f9dc0[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x494e88;})});}_0x4de1fd=_['merge']({},_0x4de1fd,_0x3f9dc0[_0x6652('0x41')]);return _0x7ed149[_0x6652('0x62')](_0x4de1fd);}})['then'](function(_0x1c95cb){if(_0x1c95cb){_0x450ffc=_0x1c95cb[_0x6652('0x38')];if(!_0x3f9dc0[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x4de1fd[_0x6652('0x1c')]=qs['limit'](_0x3f9dc0[_0x6652('0x32')]['limit']);_0x4de1fd[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3f9dc0[_0x6652('0x32')]['offset']);}return _0x7ed149[_0x6652('0x62')](_0x4de1fd);}})['then'](function(_0x498302){if(_0x498302){return _0x498302?{'count':_0x450ffc,'rows':_0x498302}:null;}})[_0x6652('0x23')](respondWithResult(_0x4bc4da,null))['catch'](handleError(_0x4bc4da,null));};exports[_0x6652('0x64')]=function(_0x4476f9,_0x428576,_0x22e1b2){var _0x5ddb77,_0x52a842;return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x4476f9['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x428576,null))[_0x6652('0x23')](function(_0x1496e8){if(_0x1496e8){_0x52a842=_0x1496e8;return _0x1496e8[_0x6652('0x64')](_0x4476f9[_0x6652('0x4c')][_0x6652('0x65')],_[_0x6652('0x55')](_0x4476f9['body'],[_0x6652('0x65'),'id'])||{});}return null;})[_0x6652('0x66')](function(_0x2e74e3){var _0x330f16;_0x5ddb77=_0x2e74e3||[];var _0x51ab11=[];if(_0x2e74e3){for(var _0x4aaca3=0x0;_0x4aaca3<_0x2e74e3[_0x6652('0x38')];_0x4aaca3+=0x1){var _0x3b47d6=_0x2e74e3[_0x4aaca3]['get']({'plain':!![]});_0x52a842[_0x6652('0x67')]=_0x4476f9['body'][_0x6652('0x67')]?_0x4476f9[_0x6652('0x4c')]['dialCheckDuplicateType']:_0x52a842[_0x6652('0x67')];switch(_0x52a842[_0x6652('0x67')]){case _0x6652('0x68'):_0x330f16=squel['insert']()[_0x6652('0x69')](_0x6652('0x6a'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),'CampaignId',_0x6652('0x57'),_0x6652('0x56')],squel['select']()[_0x6652('0x70')]('phone','phone')[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x6d'))[_0x6652('0x70')]('id',_0x6652('0x6e'))[_0x6652('0x70')](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),_0x6652('0x6f'))[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')](),_0x6652('0x5c'))['field'](_0x6652('0x71'),'createdAt')[_0x6652('0x70')](_0x6652('0x71'),'updatedAt')['from']('cm_contacts')[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')](_0x6652('0x75'),_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')]())['where'](_0x6652('0x76'))[_0x6652('0x3d')](_0x6652('0x77'),squel['select']()[_0x6652('0x70')](_0x6652('0x78'))[_0x6652('0x79')](_0x6652('0x7a'))[_0x6652('0x3d')](_0x6652('0x7b'),_0x4476f9['params']['id'][_0x6652('0x73')]()))[_0x6652('0x3d')](_0x6652('0x77'),squel['select']()[_0x6652('0x70')](_0x6652('0x7c'))[_0x6652('0x79')](_0x6652('0x6a'))['where']('CampaignId\x20=\x20?',_0x4476f9['params']['id']['toString']())))[_0x6652('0x73')]();break;case'onlyIfOpen':_0x330f16=squel[_0x6652('0x7d')]()[_0x6652('0x69')](_0x6652('0x6a'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel['select']()[_0x6652('0x70')](_0x6652('0x6c'),_0x6652('0x6c'))[_0x6652('0x70')]('NOW()',_0x6652('0x6d'))[_0x6652('0x70')]('id',_0x6652('0x6e'))[_0x6652('0x70')](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),'ListId')[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id']['toString'](),_0x6652('0x5c'))['field'](_0x6652('0x71'),_0x6652('0x57'))[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x56'))['from'](_0x6652('0x7e'))[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')]('ListId\x20=\x20?',_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')]())[_0x6652('0x3d')](_0x6652('0x76'))[_0x6652('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x7c'))[_0x6652('0x79')]('cm_hopper')[_0x6652('0x3d')](_0x6652('0x7b'),_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')]())))[_0x6652('0x73')]();break;default:_0x330f16=squel['insert']()[_0x6652('0x69')]('cm_hopper')['fromQuery'](['phone',_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x6c'),'phone')['field'](_0x6652('0x71'),_0x6652('0x6d'))['field']('id',_0x6652('0x6e'))['field'](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),'ListId')[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')](),_0x6652('0x5c'))[_0x6652('0x70')]('NOW()','createdAt')[_0x6652('0x70')]('NOW()',_0x6652('0x56'))[_0x6652('0x79')]('cm_contacts')[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')](_0x6652('0x75'),_0x3b47d6['CmListId'][_0x6652('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x51ab11[_0x6652('0x80')](db['sequelize'][_0x6652('0x32')](_0x330f16));}return BPromise[_0x6652('0x81')](_0x51ab11);}})[_0x6652('0x23')](function(){return _0x5ddb77;})[_0x6652('0x23')](respondWithResult(_0x428576,null))[_0x6652('0x45')](handleError(_0x428576,null));};exports[_0x6652('0x82')]=function(_0xb1d39e,_0x49368c,_0x4d8267){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0xb1d39e['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x49368c,null))['then'](function(_0xaff0c){if(_0xaff0c){return _0xaff0c[_0x6652('0x82')](_0xb1d39e[_0x6652('0x32')][_0x6652('0x65')]);}})['then'](function(_0x49990d){if(_0x49990d){return db['CmHopper'][_0x6652('0x24')]({'where':{'ListId':_0xb1d39e[_0x6652('0x32')][_0x6652('0x65')],'CampaignId':_0xb1d39e[_0x6652('0x47')]['id']}})[_0x6652('0x23')](function(){return _0x49990d;});}})[_0x6652('0x23')](respondWithStatusCode(_0x49368c,null))[_0x6652('0x45')](handleError(_0x49368c,null));};exports[_0x6652('0x83')]=function(_0x3f0a9c,_0x52fdb5,_0x3f9128){var _0xd4db6e={};var _0x39cbc5={};var _0x51832d;var _0xe17d31;return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3f0a9c[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x52fdb5,null))[_0x6652('0x23')](function(_0x24707a){if(_0x24707a){_0x51832d=_0x24707a;_0x39cbc5[_0x6652('0x31')]=_['keys'](db[_0x6652('0x63')][_0x6652('0x48')]);_0x39cbc5[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3f0a9c[_0x6652('0x32')]);_0x39cbc5[_0x6652('0x34')]=_[_0x6652('0x36')](_0x39cbc5['model'],_0x39cbc5[_0x6652('0x32')]);_0xd4db6e[_0x6652('0x35')]=_[_0x6652('0x36')](_0x39cbc5[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3f0a9c[_0x6652('0x32')][_0x6652('0x37')]));_0xd4db6e['attributes']=_0xd4db6e[_0x6652('0x35')][_0x6652('0x38')]?_0xd4db6e[_0x6652('0x35')]:_0x39cbc5['model'];_0xd4db6e[_0x6652('0x3b')]=qs['sort'](_0x3f0a9c['query'][_0x6652('0x3c')]);_0xd4db6e[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x3f0a9c[_0x6652('0x32')],_0x39cbc5[_0x6652('0x34')]));if(_0x3f0a9c[_0x6652('0x32')]['filter']){_0xd4db6e[_0x6652('0x3d')]=_[_0x6652('0x49')](_0xd4db6e[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0xd4db6e[_0x6652('0x35')],function(_0x566793){var _0x1012af={};_0x1012af[_0x566793]={'$like':'%'+_0x3f0a9c[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x1012af;})});}_0xd4db6e=_[_0x6652('0x49')]({},_0xd4db6e,_0x3f0a9c[_0x6652('0x41')]);return _0x51832d[_0x6652('0x83')](_0xd4db6e);}})[_0x6652('0x23')](function(_0x5d844e){if(_0x5d844e){_0xe17d31=_0x5d844e[_0x6652('0x38')];if(!_0x3f0a9c[_0x6652('0x32')][_0x6652('0x39')]('nolimit')){_0xd4db6e[_0x6652('0x1c')]=qs['limit'](_0x3f0a9c['query'][_0x6652('0x1c')]);_0xd4db6e[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3f0a9c[_0x6652('0x32')][_0x6652('0x1b')]);}return _0x51832d[_0x6652('0x83')](_0xd4db6e);}})['then'](function(_0x57d355){if(_0x57d355){return _0x57d355?{'count':_0xe17d31,'rows':_0x57d355}:null;}})[_0x6652('0x23')](respondWithResult(_0x52fdb5,null))['catch'](handleError(_0x52fdb5,null));};exports[_0x6652('0x84')]=function(_0x202586,_0x167ba3,_0x37215b){var _0x238a21,_0xbfbfdd;return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x202586['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x167ba3,null))[_0x6652('0x23')](function(_0x4767b7){if(_0x4767b7){_0xbfbfdd=_0x4767b7;return _0x4767b7['addBlackLists'](_0x202586['body'][_0x6652('0x65')],_[_0x6652('0x55')](_0x202586[_0x6652('0x4c')],[_0x6652('0x65'),'id'])||{});}return null;})['spread'](function(_0x37f18e){var _0x48ac53;_0x238a21=_0x37f18e||[];var _0x40dc76=[];if(_0x37f18e){for(var _0x418402=0x0;_0x418402<_0x37f18e[_0x6652('0x38')];_0x418402+=0x1){var _0x4dec79=_0x37f18e[_0x418402][_0x6652('0x25')]({'plain':!![]});_0x48ac53=squel['insert']()['into'](_0x6652('0x85'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x6c'),'phone')[_0x6652('0x70')]('id',_0x6652('0x6e'))['field'](_0x4dec79[_0x6652('0x72')][_0x6652('0x73')](),_0x6652('0x6f'))[_0x6652('0x70')](_0x202586[_0x6652('0x47')]['id']['toString'](),_0x6652('0x5c'))[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x57'))['field'](_0x6652('0x71'),_0x6652('0x56'))[_0x6652('0x79')](_0x6652('0x7e'))['where']('deletedAt\x20IS\x20NULL')[_0x6652('0x3d')]('ListId\x20=\x20?',_0x4dec79[_0x6652('0x72')]['toString']())[_0x6652('0x3d')](_0x6652('0x76')))[_0x6652('0x73')]();_0x40dc76['push'](db['sequelize'][_0x6652('0x32')](_0x48ac53));}return BPromise['all'](_0x40dc76);}})[_0x6652('0x23')](function(){return _0x238a21;})[_0x6652('0x23')](respondWithResult(_0x167ba3,null))[_0x6652('0x45')](handleError(_0x167ba3,null));};exports[_0x6652('0x86')]=function(_0x255ad3,_0x1e07b5,_0xace7f6){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x255ad3[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x1e07b5,null))['then'](function(_0x27f859){if(_0x27f859){return _0x27f859[_0x6652('0x86')](_0x255ad3[_0x6652('0x32')]['ids']);}})['then'](function(_0x28b2ae){if(_0x28b2ae){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x255ad3['query'][_0x6652('0x65')],'CampaignId':_0x255ad3[_0x6652('0x47')]['id']}})[_0x6652('0x23')](function(){return _0x28b2ae;});}})['then'](respondWithStatusCode(_0x1e07b5,null))[_0x6652('0x45')](handleError(_0x1e07b5,null));}; \ No newline at end of file +var _0x87e4=['CampaignId\x20=\x20?','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','Campaign','include','findAll','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','user','IvrCampaigns','userProfileId','getHoppers','findOne','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)'];(function(_0x55d089,_0x52aa76){var _0x1406de=function(_0x4d68ca){while(--_0x4d68ca){_0x55d089['push'](_0x55d089['shift']());}};_0x1406de(++_0x52aa76);}(_0x87e4,0x8e));var _0x487e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x87e4[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x487e('0x0'));var rimraf=require(_0x487e('0x1'));var zipdir=require(_0x487e('0x2'));var jsonpatch=require(_0x487e('0x3'));var rp=require(_0x487e('0x4'));var moment=require(_0x487e('0x5'));var BPromise=require(_0x487e('0x6'));var Mustache=require(_0x487e('0x7'));var util=require(_0x487e('0x8'));var path=require(_0x487e('0x9'));var sox=require(_0x487e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x487e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x487e('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x487e('0xd'));var qs=require(_0x487e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x487e('0xf'))(_0x487e('0x10'));var utils=require(_0x487e('0x11'));var config=require(_0x487e('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ffba,_0x2ee4d5){_0x2ee4d5=_0x2ee4d5||0xcc;return function(_0x286794){if(_0x286794){return _0x20ffba['sendStatus'](_0x2ee4d5);}return _0x20ffba[_0x487e('0x13')](_0x2ee4d5)[_0x487e('0x14')]();};}function respondWithResult(_0x95af3d,_0x1c5fc4){_0x1c5fc4=_0x1c5fc4||0xc8;return function(_0x2a5a43){if(_0x2a5a43){return _0x95af3d[_0x487e('0x13')](_0x1c5fc4)[_0x487e('0x15')](_0x2a5a43);}};}function respondWithFilteredResult(_0x6dcae,_0x574d4e){return function(_0xa0611a){if(_0xa0611a){var _0x2a9e33=typeof _0x574d4e[_0x487e('0x16')]===_0x487e('0x17')&&typeof _0x574d4e[_0x487e('0x18')]==='undefined';var _0x493b28=_0xa0611a[_0x487e('0x19')];var _0x1daa1a=_0x2a9e33?0x0:_0x574d4e[_0x487e('0x16')];var _0xc5a457=_0x2a9e33?_0xa0611a[_0x487e('0x19')]:_0x574d4e[_0x487e('0x16')]+_0x574d4e['limit'];var _0x1dc264;if(_0xc5a457>=_0x493b28){_0xc5a457=_0x493b28;_0x1dc264=0xc8;}else{_0x1dc264=0xce;}_0x6dcae[_0x487e('0x13')](_0x1dc264);return _0x6dcae['set'](_0x487e('0x1a'),_0x1daa1a+'-'+_0xc5a457+'/'+_0x493b28)[_0x487e('0x15')](_0xa0611a);}return null;};}function patchUpdates(_0x30bc7d){return function(_0xe34c5c){try{jsonpatch['apply'](_0xe34c5c,_0x30bc7d,!![]);}catch(_0x284e01){return BPromise[_0x487e('0x1b')](_0x284e01);}return _0xe34c5c['save']();};}function saveUpdates(_0x3f5ae5,_0x223b32){return function(_0xa67cdc){if(_0xa67cdc){return _0xa67cdc[_0x487e('0x1c')](_0x3f5ae5)[_0x487e('0x1d')](function(_0x1e1410){return _0x1e1410;});}return null;};}function removeEntity(_0x558471,_0x2cd4ba){return function(_0x29f2ff){if(_0x29f2ff){return _0x29f2ff[_0x487e('0x1e')]()[_0x487e('0x1d')](function(){var _0x3afd18=_0x29f2ff['get']({'plain':!![]});var _0x20dc6c='IvrCampaigns';return db['UserProfileResource'][_0x487e('0x1e')]({'where':{'type':_0x20dc6c,'resourceId':_0x3afd18['id']}})[_0x487e('0x1d')](function(){return _0x29f2ff;});})[_0x487e('0x1d')](function(){_0x558471[_0x487e('0x13')](0xcc)[_0x487e('0x14')]();});}};}function handleEntityNotFound(_0xfa5a26,_0x7913a1){return function(_0x38d513){if(!_0x38d513){_0xfa5a26['sendStatus'](0x194);}return _0x38d513;};}function handleError(_0x2af344,_0x284822){_0x284822=_0x284822||0x1f4;return function(_0x756839){logger[_0x487e('0x1f')](_0x756839[_0x487e('0x20')]);if(_0x756839[_0x487e('0x21')]){delete _0x756839[_0x487e('0x21')];}_0x2af344['status'](_0x284822)['send'](_0x756839);};}exports[_0x487e('0x22')]=function(_0x4c31e2,_0x1d7807){var _0x5b9ba0={},_0x3ea044={},_0x165ae3={'count':0x0,'rows':[]};var _0x27253c=_[_0x487e('0x23')](db['Campaign'][_0x487e('0x24')],function(_0x572514){return{'name':_0x572514[_0x487e('0x25')],'type':_0x572514['type'][_0x487e('0x26')]};});_0x3ea044['model']=_[_0x487e('0x23')](_0x27253c,'name');_0x3ea044['query']=_[_0x487e('0x27')](_0x4c31e2[_0x487e('0x28')]);_0x3ea044[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],_0x3ea044[_0x487e('0x28')]);_0x5b9ba0[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x4c31e2['query'][_0x487e('0x2d')]));_0x5b9ba0[_0x487e('0x2c')]=_0x5b9ba0[_0x487e('0x2c')][_0x487e('0x2e')]?_0x5b9ba0[_0x487e('0x2c')]:_0x3ea044[_0x487e('0x2b')];if(!_0x4c31e2[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x5b9ba0[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4c31e2[_0x487e('0x28')][_0x487e('0x18')]);_0x5b9ba0[_0x487e('0x16')]=qs['offset'](_0x4c31e2[_0x487e('0x28')]['offset']);}_0x5b9ba0['order']=qs[_0x487e('0x31')](_0x4c31e2[_0x487e('0x28')]['sort']);_0x5b9ba0[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4c31e2['query'],_0x3ea044['filters']),_0x27253c);if(_0x4c31e2[_0x487e('0x28')]['filter']){_0x5b9ba0[_0x487e('0x32')]=_[_0x487e('0x34')](_0x5b9ba0[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x27253c,function(_0x51b138){if(_0x51b138[_0x487e('0x35')]!==_0x487e('0x36')){var _0x4cb9a6={};_0x4cb9a6[_0x51b138['name']]={'$like':'%'+_0x4c31e2['query']['filter']+'%'};return _0x4cb9a6;}})});}_0x5b9ba0=_[_0x487e('0x34')]({},_0x5b9ba0,_0x4c31e2[_0x487e('0x37')]);var _0x1b4a78={'where':_0x5b9ba0[_0x487e('0x32')]};return db[_0x487e('0x38')]['count'](_0x1b4a78)[_0x487e('0x1d')](function(_0x34c842){_0x165ae3[_0x487e('0x19')]=_0x34c842;if(_0x4c31e2[_0x487e('0x28')]['includeAll']){_0x5b9ba0[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x38')][_0x487e('0x3a')](_0x5b9ba0);})['then'](function(_0x1d92f4){_0x165ae3[_0x487e('0x3b')]=_0x1d92f4;return _0x165ae3;})[_0x487e('0x1d')](respondWithFilteredResult(_0x1d7807,_0x5b9ba0))['catch'](handleError(_0x1d7807,null));};exports[_0x487e('0x3c')]=function(_0x1ec6b0,_0x55cfd6){var _0x35f1cd={'raw':![],'where':{'id':_0x1ec6b0[_0x487e('0x3d')]['id']}},_0x216709={};_0x216709['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x216709['query']=_[_0x487e('0x27')](_0x1ec6b0['query']);_0x216709[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],_0x216709[_0x487e('0x28')]);_0x35f1cd[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x1ec6b0[_0x487e('0x28')][_0x487e('0x2d')]));_0x35f1cd[_0x487e('0x2c')]=_0x35f1cd[_0x487e('0x2c')][_0x487e('0x2e')]?_0x35f1cd['attributes']:_0x216709[_0x487e('0x2b')];if(_0x1ec6b0[_0x487e('0x28')][_0x487e('0x3e')]){_0x35f1cd[_0x487e('0x39')]=[{'all':!![]}];}_0x35f1cd=_[_0x487e('0x34')]({},_0x35f1cd,_0x1ec6b0['options']);return db[_0x487e('0x38')][_0x487e('0x3f')](_0x35f1cd)[_0x487e('0x1d')](handleEntityNotFound(_0x55cfd6,null))[_0x487e('0x1d')](respondWithResult(_0x55cfd6,null))[_0x487e('0x40')](handleError(_0x55cfd6,null));};exports[_0x487e('0x41')]=function(_0x4482ee,_0x25fab7){return db[_0x487e('0x38')][_0x487e('0x41')](_0x4482ee['body'],{})['then'](function(_0x12fe88){var _0x1cd66d=_0x4482ee['user'][_0x487e('0x42')]({'plain':!![]});if(!_0x1cd66d)throw new Error(_0x487e('0x43'));if(_0x1cd66d[_0x487e('0x44')]==='user'){var _0x3791d9=_0x12fe88['get']({'plain':!![]});var _0x23c54c='IvrCampaigns';return db[_0x487e('0x45')][_0x487e('0x3f')]({'where':{'name':_0x23c54c,'userProfileId':_0x1cd66d['userProfileId']},'raw':!![]})[_0x487e('0x1d')](function(_0x543a2e){if(_0x543a2e&&_0x543a2e[_0x487e('0x46')]===0x0){return db[_0x487e('0x47')][_0x487e('0x41')]({'name':_0x3791d9[_0x487e('0x21')],'resourceId':_0x3791d9['id'],'type':_0x543a2e[_0x487e('0x21')],'sectionId':_0x543a2e['id']},{})['then'](function(){return _0x12fe88;});}else{return _0x12fe88;}})[_0x487e('0x40')](function(_0x1e4c23){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x1e4c23);throw _0x1e4c23;});}return _0x12fe88;})['then'](respondWithResult(_0x25fab7,0xc9))[_0x487e('0x40')](handleError(_0x25fab7,null));};exports[_0x487e('0x49')]=function(_0x6334b4,_0x121e3c){var _0x512af7={'where':{'id':_0x6334b4[_0x487e('0x3d')]['id']}},_0x2da6de={};_0x2da6de['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x512af7[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x2da6de['model'],qs[_0x487e('0x2d')](_0x6334b4[_0x487e('0x28')]['fields']));_0x512af7[_0x487e('0x2c')]=_0x512af7[_0x487e('0x2c')]['length']?_0x512af7[_0x487e('0x2c')]:_0x2da6de['model'];if(_0x6334b4[_0x487e('0x28')]['includeAll']){_0x512af7[_0x487e('0x39')]=[{'all':!![]}];}_0x512af7=_['merge']({},_0x512af7,_0x6334b4[_0x487e('0x37')]);return db['Campaign']['find'](_0x512af7)[_0x487e('0x1d')](handleEntityNotFound(_0x121e3c,null))[_0x487e('0x1d')](function(_0x58c2a3){if(_0x58c2a3){var _0x4b6c32=_0x58c2a3['get']({'plain':!![]});_0x4b6c32=qs['omit'](_0x4b6c32,['id','createdAt',_0x487e('0x4a')]);_0x6334b4[_0x487e('0x4b')]=_[_0x487e('0x4c')](_0x6334b4[_0x487e('0x4b')],['id',_0x487e('0x4d'),'updatedAt']);return db[_0x487e('0x38')][_0x487e('0x41')](_[_0x487e('0x34')](_0x4b6c32,_0x6334b4[_0x487e('0x4b')]),{'include':_0x6334b4[_0x487e('0x28')]['includeAll']?[{'all':!![]}]:undefined})[_0x487e('0x1d')](function(_0x1c9de2){var _0xceac80=_0x6334b4['user']['get']({'plain':!![]});if(!_0xceac80)throw new Error(_0x487e('0x43'));if(_0xceac80[_0x487e('0x44')]===_0x487e('0x4e')){var _0x204fa9=_0x1c9de2[_0x487e('0x42')]({'plain':!![]});var _0xc5202f=_0x487e('0x4f');return db[_0x487e('0x45')]['find']({'where':{'name':_0xc5202f,'userProfileId':_0xceac80[_0x487e('0x50')]},'raw':!![]})[_0x487e('0x1d')](function(_0x140d7b){if(_0x140d7b&&_0x140d7b[_0x487e('0x46')]===0x0){return db['UserProfileResource'][_0x487e('0x41')]({'name':_0x204fa9[_0x487e('0x21')],'resourceId':_0x204fa9['id'],'type':_0x140d7b[_0x487e('0x21')],'sectionId':_0x140d7b['id']},{})[_0x487e('0x1d')](function(){return _0x1c9de2;});}else{return _0x1c9de2;}})[_0x487e('0x40')](function(_0x18d24b){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x18d24b);throw _0x18d24b;});}return _0x1c9de2;});}})[_0x487e('0x1d')](respondWithResult(_0x121e3c,0xc9))['catch'](handleError(_0x121e3c,null));};exports[_0x487e('0x1c')]=function(_0x486a10,_0x431370){if(_0x486a10['body']['id']){delete _0x486a10[_0x487e('0x4b')]['id'];}return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x486a10[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x431370,null))[_0x487e('0x1d')](saveUpdates(_0x486a10[_0x487e('0x4b')],null))[_0x487e('0x1d')](respondWithResult(_0x431370,null))[_0x487e('0x40')](handleError(_0x431370,null));};exports['destroy']=function(_0x3f30de,_0x211d2e){return db['Campaign'][_0x487e('0x3f')]({'where':{'id':_0x3f30de[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x211d2e,null))[_0x487e('0x1d')](removeEntity(_0x211d2e,null))[_0x487e('0x40')](handleError(_0x211d2e,null));};exports[_0x487e('0x51')]=function(_0x4cb3f6,_0x1ab190,_0x18898f){var _0x57ecb5={'raw':!![],'where':{}};var _0x1d672b={};var _0x14e0d7={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x4cb3f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x1ab190,null))['then'](function(_0x26ae67){if(_0x26ae67){_0x1d672b[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmHopper'][_0x487e('0x24')]);_0x1d672b[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4cb3f6[_0x487e('0x28')]);_0x1d672b['filters']=_[_0x487e('0x2a')](_0x1d672b[_0x487e('0x2b')],_0x1d672b[_0x487e('0x28')]);_0x57ecb5[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x1d672b['model'],qs['fields'](_0x4cb3f6[_0x487e('0x28')]['fields']));_0x57ecb5[_0x487e('0x2c')]=_0x57ecb5['attributes'][_0x487e('0x2e')]?_0x57ecb5[_0x487e('0x2c')]:_0x1d672b[_0x487e('0x2b')];if(!_0x4cb3f6[_0x487e('0x28')][_0x487e('0x2f')]('nolimit')){_0x57ecb5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x18')]);_0x57ecb5[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x16')]);}_0x57ecb5['order']=qs[_0x487e('0x31')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x31')]);_0x57ecb5[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4cb3f6['query'],_0x1d672b[_0x487e('0x29')]));_0x57ecb5[_0x487e('0x32')][_0x487e('0x53')]=_0x26ae67['id'];if(_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]){_0x57ecb5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x57ecb5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x57ecb5['attributes'],function(_0x18d66b){var _0x546671={};_0x546671[_0x18d66b]={'$like':'%'+_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x546671;})});}_0x57ecb5=_[_0x487e('0x34')]({},_0x57ecb5,_0x4cb3f6['options']);return db[_0x487e('0x55')][_0x487e('0x19')]({'where':_0x57ecb5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x5a70fc){_0x14e0d7[_0x487e('0x19')]=_0x5a70fc;if(_0x4cb3f6['query'][_0x487e('0x3e')]){_0x57ecb5['include']=[{'all':!![]}];}return db[_0x487e('0x55')]['findAll'](_0x57ecb5);})[_0x487e('0x1d')](function(_0x19b4a8){_0x14e0d7[_0x487e('0x3b')]=_0x19b4a8;return _0x14e0d7;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x1ab190,_0x57ecb5))[_0x487e('0x40')](handleError(_0x1ab190,null));};exports[_0x487e('0x56')]=function(_0x4c3d0a,_0x592caf,_0x90a262){var _0x227b83={'raw':!![],'where':{}};var _0x3a9b4e={};var _0x10d8d3={'count':0x0,'rows':[]};return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x4c3d0a[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x592caf,null))[_0x487e('0x1d')](function(_0xa73d47){if(_0xa73d47){_0x3a9b4e[_0x487e('0x2b')]=_['keys'](db['CmHopperHistory'][_0x487e('0x24')]);_0x3a9b4e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4c3d0a[_0x487e('0x28')]);_0x3a9b4e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],_0x3a9b4e[_0x487e('0x28')]);_0x227b83[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],qs[_0x487e('0x2d')](_0x4c3d0a['query'][_0x487e('0x2d')]));_0x227b83[_0x487e('0x2c')]=_0x227b83[_0x487e('0x2c')][_0x487e('0x2e')]?_0x227b83[_0x487e('0x2c')]:_0x3a9b4e['model'];if(!_0x4c3d0a[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x227b83['limit']=qs[_0x487e('0x18')](_0x4c3d0a['query'][_0x487e('0x18')]);_0x227b83[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4c3d0a['query'][_0x487e('0x16')]);}_0x227b83['order']=qs[_0x487e('0x31')](_0x4c3d0a[_0x487e('0x28')][_0x487e('0x31')]);_0x227b83[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x4c3d0a['query'],_0x3a9b4e[_0x487e('0x29')]));_0x227b83['where'][_0x487e('0x53')]=_0xa73d47['id'];if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]){_0x227b83['where']=_[_0x487e('0x34')](_0x227b83['where'],{'$or':_[_0x487e('0x23')](_0x227b83[_0x487e('0x2c')],function(_0xa6e4df){var _0x18ca4e={};_0x18ca4e[_0xa6e4df]={'$like':'%'+_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x18ca4e;})});}_0x227b83=_[_0x487e('0x34')]({},_0x227b83,_0x4c3d0a[_0x487e('0x37')]);return db[_0x487e('0x57')]['count']({'where':_0x227b83[_0x487e('0x32')]})['then'](function(_0x2a28ea){_0x10d8d3[_0x487e('0x19')]=_0x2a28ea;if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x3e')]){_0x227b83['include']=[{'all':!![]}];}return db[_0x487e('0x57')]['findAll'](_0x227b83);})[_0x487e('0x1d')](function(_0x1ead74){_0x10d8d3[_0x487e('0x3b')]=_0x1ead74;return _0x10d8d3;});}})['then'](respondWithFilteredResult(_0x592caf,_0x227b83))[_0x487e('0x40')](handleError(_0x592caf,null));};exports['getHopperFinals']=function(_0x3895fe,_0xf74805,_0x55e384){var _0x46e123={'raw':!![],'where':{}};var _0xc7c207={};var _0x18887e={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x3895fe[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xf74805,null))[_0x487e('0x1d')](function(_0x4c95d6){if(_0x4c95d6){_0xc7c207[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x58')]['rawAttributes']);_0xc7c207['query']=_[_0x487e('0x27')](_0x3895fe[_0x487e('0x28')]);_0xc7c207[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xc7c207['model'],_0xc7c207['query']);_0x46e123['attributes']=_[_0x487e('0x2a')](_0xc7c207[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x3895fe[_0x487e('0x28')][_0x487e('0x2d')]));_0x46e123[_0x487e('0x2c')]=_0x46e123[_0x487e('0x2c')]['length']?_0x46e123[_0x487e('0x2c')]:_0xc7c207['model'];if(!_0x3895fe[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x46e123[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x3895fe[_0x487e('0x28')][_0x487e('0x18')]);_0x46e123[_0x487e('0x16')]=qs['offset'](_0x3895fe['query'][_0x487e('0x16')]);}_0x46e123[_0x487e('0x59')]=qs['sort'](_0x3895fe[_0x487e('0x28')][_0x487e('0x31')]);_0x46e123['where']=qs['filters'](_[_0x487e('0x33')](_0x3895fe[_0x487e('0x28')],_0xc7c207[_0x487e('0x29')]));_0x46e123['where'][_0x487e('0x53')]=_0x4c95d6['id'];if(_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]){_0x46e123[_0x487e('0x32')]=_[_0x487e('0x34')](_0x46e123['where'],{'$or':_[_0x487e('0x23')](_0x46e123['attributes'],function(_0x202b4b){var _0x337c09={};_0x337c09[_0x202b4b]={'$like':'%'+_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x337c09;})});}_0x46e123=_[_0x487e('0x34')]({},_0x46e123,_0x3895fe[_0x487e('0x37')]);return db[_0x487e('0x58')]['count']({'where':_0x46e123[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x583d4a){_0x18887e[_0x487e('0x19')]=_0x583d4a;if(_0x3895fe[_0x487e('0x28')][_0x487e('0x3e')]){_0x46e123[_0x487e('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x487e('0x3a')](_0x46e123);})[_0x487e('0x1d')](function(_0x54abdd){_0x18887e[_0x487e('0x3b')]=_0x54abdd;return _0x18887e;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0xf74805,_0x46e123))['catch'](handleError(_0xf74805,null));};exports[_0x487e('0x5a')]=function(_0x18bf9e,_0x446d6d,_0x4ec48d){var _0x3392f5={'raw':!![],'where':{}};var _0x5d57da={};var _0x44c231={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x18bf9e[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x446d6d,null))['then'](function(_0x34990a){if(_0x34990a){_0x5d57da[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5b')][_0x487e('0x24')]);_0x5d57da[_0x487e('0x28')]=_[_0x487e('0x27')](_0x18bf9e['query']);_0x5d57da['filters']=_['intersection'](_0x5d57da[_0x487e('0x2b')],_0x5d57da[_0x487e('0x28')]);_0x3392f5[_0x487e('0x2c')]=_['intersection'](_0x5d57da[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x18bf9e['query'][_0x487e('0x2d')]));_0x3392f5[_0x487e('0x2c')]=_0x3392f5[_0x487e('0x2c')][_0x487e('0x2e')]?_0x3392f5[_0x487e('0x2c')]:_0x5d57da[_0x487e('0x2b')];if(!_0x18bf9e['query']['hasOwnProperty']('nolimit')){_0x3392f5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x18bf9e[_0x487e('0x28')]['limit']);_0x3392f5['offset']=qs[_0x487e('0x16')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x16')]);}_0x3392f5[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x31')]);_0x3392f5[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x18bf9e[_0x487e('0x28')],_0x5d57da[_0x487e('0x29')]));_0x3392f5[_0x487e('0x32')]['CampaignId']=_0x34990a['id'];if(_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]){_0x3392f5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x3392f5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x3392f5[_0x487e('0x2c')],function(_0x38b707){var _0x47b7c8={};_0x47b7c8[_0x38b707]={'$like':'%'+_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x47b7c8;})});}_0x3392f5=_[_0x487e('0x34')]({},_0x3392f5,_0x18bf9e[_0x487e('0x37')]);return db[_0x487e('0x5b')][_0x487e('0x19')]({'where':_0x3392f5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x3679d5){_0x44c231['count']=_0x3679d5;if(_0x18bf9e['query'][_0x487e('0x3e')]){_0x3392f5[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x5b')][_0x487e('0x3a')](_0x3392f5);})['then'](function(_0x355dc1){_0x44c231[_0x487e('0x3b')]=_0x355dc1;return _0x44c231;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x446d6d,_0x3392f5))[_0x487e('0x40')](handleError(_0x446d6d,null));};exports['getLists']=function(_0x2f2acc,_0xc987cc,_0x267cb8){var _0x13a0a1={};var _0xdf251e={};var _0x37cd63;var _0x2fddbf;return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x2f2acc[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xc987cc,null))[_0x487e('0x1d')](function(_0x5564e8){if(_0x5564e8){_0x37cd63=_0x5564e8;_0xdf251e[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5c')][_0x487e('0x24')]);_0xdf251e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x2f2acc[_0x487e('0x28')]);_0xdf251e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xdf251e[_0x487e('0x2b')],_0xdf251e[_0x487e('0x28')]);_0x13a0a1[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0xdf251e['model'],qs[_0x487e('0x2d')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x2d')]));_0x13a0a1[_0x487e('0x2c')]=_0x13a0a1[_0x487e('0x2c')][_0x487e('0x2e')]?_0x13a0a1[_0x487e('0x2c')]:_0xdf251e['model'];_0x13a0a1[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x31')]);_0x13a0a1[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x2f2acc['query'],_0xdf251e['filters']));if(_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]){_0x13a0a1[_0x487e('0x32')]=_['merge'](_0x13a0a1[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x13a0a1[_0x487e('0x2c')],function(_0x49b9b2){var _0x352a85={};_0x352a85[_0x49b9b2]={'$like':'%'+_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x352a85;})});}_0x13a0a1=_['merge']({},_0x13a0a1,_0x2f2acc[_0x487e('0x37')]);return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x39ea4f){if(_0x39ea4f){_0x2fddbf=_0x39ea4f[_0x487e('0x2e')];if(!_0x2f2acc[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x13a0a1[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x18')]);_0x13a0a1[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x2f2acc[_0x487e('0x28')]['offset']);}return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x7edc37){if(_0x7edc37){return _0x7edc37?{'count':_0x2fddbf,'rows':_0x7edc37}:null;}})[_0x487e('0x1d')](respondWithResult(_0xc987cc,null))[_0x487e('0x40')](handleError(_0xc987cc,null));};exports[_0x487e('0x5e')]=function(_0x5324ad,_0x2299ac,_0x9a14b5){var _0x595db6,_0x462c1f;return db[_0x487e('0x38')]['find']({'where':{'id':_0x5324ad[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x2299ac,null))[_0x487e('0x1d')](function(_0xdcbc84){if(_0xdcbc84){_0x462c1f=_0xdcbc84;return _0xdcbc84['addLists'](_0x5324ad[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0x5324ad[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})['spread'](function(_0x38d8a7){var _0x2b1561;_0x595db6=_0x38d8a7||[];var _0x5b0625=[];if(_0x38d8a7){for(var _0x2de04d=0x0;_0x2de04d<_0x38d8a7[_0x487e('0x2e')];_0x2de04d+=0x1){var _0x124204=_0x38d8a7[_0x2de04d][_0x487e('0x42')]({'plain':!![]});_0x462c1f['dialCheckDuplicateType']=_0x5324ad['body'][_0x487e('0x60')]?_0x5324ad[_0x487e('0x4b')][_0x487e('0x60')]:_0x462c1f[_0x487e('0x60')];switch(_0x462c1f[_0x487e('0x60')]){case _0x487e('0x61'):_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x67'))[_0x487e('0x6b')]('id',_0x487e('0x68'))['field'](_0x124204['CmListId']['toString'](),_0x487e('0x69'))[_0x487e('0x6b')](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),'createdAt')['field'](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')]('deletedAt\x20IS\x20NULL')[_0x487e('0x32')]('ListId\x20=\x20?',_0x124204['CmListId'][_0x487e('0x6d')]())[_0x487e('0x32')](_0x487e('0x70'))[_0x487e('0x32')](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x487e('0x6e')](_0x487e('0x72'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]()))[_0x487e('0x32')](_0x487e('0x71'),squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x73'))['from']('cm_hopper')[_0x487e('0x32')](_0x487e('0x74'),_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]())))[_0x487e('0x6d')]();break;case'onlyIfOpen':_0x2b1561=squel[_0x487e('0x62')]()['into'](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),'ContactId',_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))['field'](_0x487e('0x6c'),'scheduledAt')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),'ListId')['field'](_0x5324ad['params']['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')]('NOW()',_0x487e('0x4d'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204['CmListId']['toString']())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')](_0x487e('0x73'))[_0x487e('0x6e')](_0x487e('0x64'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad['params']['id'][_0x487e('0x6d')]())))['toString']();break;default:_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')]('cm_hopper')[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),_0x487e('0x4d'),_0x487e('0x4a')],squel['select']()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('NOW()','scheduledAt')[_0x487e('0x6b')]('id','ContactId')[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),_0x487e('0x69'))['field'](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')]('cm_contacts')['where'](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204[_0x487e('0x75')][_0x487e('0x6d')]())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x5b0625[_0x487e('0x78')](db['sequelize']['query'](_0x2b1561));}return BPromise[_0x487e('0x79')](_0x5b0625);}})[_0x487e('0x1d')](function(){return _0x595db6;})[_0x487e('0x1d')](respondWithResult(_0x2299ac,null))['catch'](handleError(_0x2299ac,null));};exports['removeLists']=function(_0x3cc4f6,_0x196458,_0xd8c9c0){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x3cc4f6['params']['id']}})['then'](handleEntityNotFound(_0x196458,null))['then'](function(_0x2f4767){if(_0x2f4767){return _0x2f4767[_0x487e('0x7a')](_0x3cc4f6[_0x487e('0x28')][_0x487e('0x5f')]);}})[_0x487e('0x1d')](function(_0x40a701){if(_0x40a701){return db[_0x487e('0x55')][_0x487e('0x1e')]({'where':{'ListId':_0x3cc4f6['query']['ids'],'CampaignId':_0x3cc4f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x40a701;});}})[_0x487e('0x1d')](respondWithStatusCode(_0x196458,null))[_0x487e('0x40')](handleError(_0x196458,null));};exports[_0x487e('0x7b')]=function(_0x37c57b,_0x13feca,_0x57af49){var _0x1726b3={};var _0x4ac702={};var _0x38e5d2;var _0x7081eb;return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x37c57b['params']['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x13feca,null))[_0x487e('0x1d')](function(_0x4db0d5){if(_0x4db0d5){_0x38e5d2=_0x4db0d5;_0x4ac702[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmList'][_0x487e('0x24')]);_0x4ac702['query']=_[_0x487e('0x27')](_0x37c57b[_0x487e('0x28')]);_0x4ac702[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x4ac702['model'],_0x4ac702[_0x487e('0x28')]);_0x1726b3['attributes']=_[_0x487e('0x2a')](_0x4ac702[_0x487e('0x2b')],qs['fields'](_0x37c57b[_0x487e('0x28')]['fields']));_0x1726b3['attributes']=_0x1726b3['attributes'][_0x487e('0x2e')]?_0x1726b3[_0x487e('0x2c')]:_0x4ac702[_0x487e('0x2b')];_0x1726b3['order']=qs[_0x487e('0x31')](_0x37c57b[_0x487e('0x28')][_0x487e('0x31')]);_0x1726b3[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x37c57b[_0x487e('0x28')],_0x4ac702[_0x487e('0x29')]));if(_0x37c57b[_0x487e('0x28')]['filter']){_0x1726b3['where']=_[_0x487e('0x34')](_0x1726b3[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x1726b3['attributes'],function(_0x3d9230){var _0x3fdf6a={};_0x3fdf6a[_0x3d9230]={'$like':'%'+_0x37c57b['query'][_0x487e('0x54')]+'%'};return _0x3fdf6a;})});}_0x1726b3=_['merge']({},_0x1726b3,_0x37c57b[_0x487e('0x37')]);return _0x38e5d2[_0x487e('0x7b')](_0x1726b3);}})[_0x487e('0x1d')](function(_0x263f2c){if(_0x263f2c){_0x7081eb=_0x263f2c[_0x487e('0x2e')];if(!_0x37c57b[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x1726b3[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x37c57b[_0x487e('0x28')]['limit']);_0x1726b3[_0x487e('0x16')]=qs['offset'](_0x37c57b[_0x487e('0x28')]['offset']);}return _0x38e5d2['getBlackLists'](_0x1726b3);}})[_0x487e('0x1d')](function(_0x584443){if(_0x584443){return _0x584443?{'count':_0x7081eb,'rows':_0x584443}:null;}})[_0x487e('0x1d')](respondWithResult(_0x13feca,null))['catch'](handleError(_0x13feca,null));};exports['addBlackLists']=function(_0xa10b08,_0x41dd4e,_0x49606a){var _0x27ceed,_0x43b470;return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0xa10b08[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x41dd4e,null))[_0x487e('0x1d')](function(_0x561a2b){if(_0x561a2b){_0x43b470=_0x561a2b;return _0x561a2b[_0x487e('0x7c')](_0xa10b08[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0xa10b08[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})[_0x487e('0x7d')](function(_0x2272e3){var _0x3c3d10;_0x27ceed=_0x2272e3||[];var _0x5cf7a3=[];if(_0x2272e3){for(var _0x44b027=0x0;_0x44b027<_0x2272e3[_0x487e('0x2e')];_0x44b027+=0x1){var _0x6f9a2d=_0x2272e3[_0x44b027][_0x487e('0x42')]({'plain':!![]});_0x3c3d10=squel['insert']()['into'](_0x487e('0x7e'))[_0x487e('0x65')](['phone',_0x487e('0x68'),'ListId',_0x487e('0x53'),_0x487e('0x4d'),'updatedAt'],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x6f9a2d['CmListId']['toString'](),_0x487e('0x69'))['field'](_0xa10b08['params']['id'][_0x487e('0x6d')](),_0x487e('0x53'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')]('ListId\x20=\x20?',_0x6f9a2d[_0x487e('0x75')][_0x487e('0x6d')]())['where'](_0x487e('0x70')))[_0x487e('0x6d')]();_0x5cf7a3[_0x487e('0x78')](db[_0x487e('0x7f')]['query'](_0x3c3d10));}return BPromise['all'](_0x5cf7a3);}})[_0x487e('0x1d')](function(){return _0x27ceed;})['then'](respondWithResult(_0x41dd4e,null))[_0x487e('0x40')](handleError(_0x41dd4e,null));};exports[_0x487e('0x80')]=function(_0x110c49,_0x190d48,_0x15c7ce){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x190d48,null))[_0x487e('0x1d')](function(_0x113563){if(_0x113563){return _0x113563[_0x487e('0x80')](_0x110c49[_0x487e('0x28')][_0x487e('0x5f')]);}})['then'](function(_0x5aad32){if(_0x5aad32){return db[_0x487e('0x5b')]['destroy']({'where':{'ListId':_0x110c49[_0x487e('0x28')][_0x487e('0x5f')],'CampaignId':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x5aad32;});}})['then'](respondWithStatusCode(_0x190d48,null))[_0x487e('0x40')](handleError(_0x190d48,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a1da653..0e45ee5 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3d391b,_0x139db6){var _0x34adb6=function(_0x464b1e){while(--_0x464b1e){_0x3d391b['push'](_0x3d391b['shift']());}};_0x34adb6(++_0x139db6);}(_0x7a54,0x106));var _0x47a5=function(_0x3bdbe6,_0x484bbf){_0x3bdbe6=_0x3bdbe6-0x0;var _0xe7b61d=_0x7a54[_0x3bdbe6];return _0xe7b61d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index a07fae8..bcd5238 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 _0xa477=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x404f01,_0x365b18){var _0x16201a=function(_0x258c37){while(--_0x258c37){_0x404f01['push'](_0x404f01['shift']());}};_0x16201a(++_0x365b18);}(_0xa477,0xe6));var _0x7a47=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa477[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require('moment');var BPromise=require(_0x7a47('0x2'));var rs=require(_0x7a47('0x3'));var fs=require('fs');var Redis=require(_0x7a47('0x4'));var db=require(_0x7a47('0x5'))['db'];var utils=require(_0x7a47('0x6'));var logger=require(_0x7a47('0x7'))(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')][_0x7a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e0e,_0x54e9aa,_0x47f594){return new BPromise(function(_0x4276ed,_0x49db4c){return client[_0x7a47('0xc')](_0x4c6e0e,_0x47f594)[_0x7a47('0xd')](function(_0x52eb49){logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,_0x7a47('0x10'));logger[_0x7a47('0x11')](_0x7a47('0x12'),_0x54e9aa,'request\x20sent',JSON[_0x7a47('0x13')](_0x52eb49));if(_0x52eb49[_0x7a47('0x14')]){if(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x15')]===0x1f4){logger['error'](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);return _0x49db4c(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')]['message']);return _0x4276ed(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}else{logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,'request\x20sent');_0x4276ed(_0x52eb49[_0x7a47('0x17')][_0x7a47('0x16')]);}})['catch'](function(_0x4a81fb){logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x4a81fb);_0x49db4c(_0x4a81fb);});});}exports[_0x7a47('0x18')]=function(_0x5a4e79){var _0x444c48=this;return new Promise(function(_0x4a24b6,_0x203ab4){return db[_0x7a47('0x19')][_0x7a47('0x1a')]({'raw':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1d')]||null:null,'attributes':_0x5a4e79['options']?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1e')]||null:null,'limit':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1f')]||null:null,'include':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')]?_[_0x7a47('0x21')](_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')],function(_0xe9bb12){return{'model':db[_0xe9bb12['model']],'as':_0xe9bb12['as'],'attributes':_0xe9bb12['attributes'],'include':_0xe9bb12[_0x7a47('0x20')]?_[_0x7a47('0x21')](_0xe9bb12[_0x7a47('0x20')],function(_0x3e598b){return{'model':db[_0x3e598b['model']],'as':_0x3e598b['as'],'attributes':_0x3e598b[_0x7a47('0x1e')],'include':_0x3e598b[_0x7a47('0x20')]?_['map'](_0x3e598b[_0x7a47('0x20')],function(_0x324a85){return{'model':db[_0x324a85[_0x7a47('0x22')]],'as':_0x324a85['as'],'attributes':_0x324a85[_0x7a47('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a47('0xd')](function(_0x5b2a0c){logger[_0x7a47('0xe')](_0x7a47('0x18'),_0x5a4e79);logger[_0x7a47('0x11')](_0x7a47('0x18'),_0x5a4e79,JSON['stringify'](_0x5b2a0c));_0x4a24b6(_0x5b2a0c);})['catch'](function(_0x5d4b9c){logger[_0x7a47('0x14')](_0x7a47('0x18'),_0x5d4b9c[_0x7a47('0x16')],_0x5a4e79);_0x203ab4(_0x444c48[_0x7a47('0x14')](0x1f4,_0x5d4b9c[_0x7a47('0x16')]));});});}; \ No newline at end of file +var _0x4e83=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x4e83,0x88));var _0x34e8=function(_0x38230,_0x148d0c){_0x38230=_0x38230-0x0;var _0x522ec9=_0x4e83[_0x38230];return _0x522ec9;};'use strict';var _=require('lodash');var util=require(_0x34e8('0x0'));var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34e8('0x4'))['db'];var utils=require(_0x34e8('0x5'));var logger=require(_0x34e8('0x6'))(_0x34e8('0x7'));var config=require(_0x34e8('0x8'));var jayson=require(_0x34e8('0x9'));var client=jayson[_0x34e8('0xa')][_0x34e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x320b00,_0x146a1f,_0x188f11){return new BPromise(function(_0x18e178,_0x3ace57){return client['request'](_0x320b00,_0x188f11)[_0x34e8('0xc')](function(_0x200425){logger[_0x34e8('0xd')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0x34e8('0xe'));logger[_0x34e8('0xf')](_0x34e8('0x10'),_0x146a1f,_0x34e8('0xe'),JSON[_0x34e8('0x11')](_0x200425));if(_0x200425['error']){if(_0x200425[_0x34e8('0x12')]['code']===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x13'),_0x146a1f,_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);return _0x3ace57(_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);}logger['error'](_0x34e8('0x13'),_0x146a1f,_0x200425['error'][_0x34e8('0x14')]);return _0x18e178(_0x200425['error'][_0x34e8('0x14')]);}else{logger[_0x34e8('0xd')](_0x34e8('0x13'),_0x146a1f,'request\x20sent');_0x18e178(_0x200425[_0x34e8('0x15')]['message']);}})[_0x34e8('0x16')](function(_0xed8219){logger[_0x34e8('0x12')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0xed8219);_0x3ace57(_0xed8219);});});}exports[_0x34e8('0x17')]=function(_0x1a2fa7){var _0x3b83bb=this;return new Promise(function(_0x38edda,_0x326416){return db[_0x34e8('0x18')][_0x34e8('0x19')]({'raw':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a2fa7['options']?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1c')]||null:null,'attributes':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1d')]||null:null,'limit':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1e')]||null:null,'include':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')],function(_0x2e04f8){return{'model':db[_0x2e04f8[_0x34e8('0x21')]],'as':_0x2e04f8['as'],'attributes':_0x2e04f8[_0x34e8('0x1d')],'include':_0x2e04f8[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x2e04f8[_0x34e8('0x1f')],function(_0x4d8780){return{'model':db[_0x4d8780['model']],'as':_0x4d8780['as'],'attributes':_0x4d8780['attributes'],'include':_0x4d8780[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x4d8780[_0x34e8('0x1f')],function(_0x2b1179){return{'model':db[_0x2b1179['model']],'as':_0x2b1179['as'],'attributes':_0x2b1179[_0x34e8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1440d0){logger['info'](_0x34e8('0x17'),_0x1a2fa7);logger['debug'](_0x34e8('0x17'),_0x1a2fa7,JSON[_0x34e8('0x11')](_0x1440d0));_0x38edda(_0x1440d0);})[_0x34e8('0x16')](function(_0x1bb4f3){logger['error'](_0x34e8('0x17'),_0x1bb4f3[_0x34e8('0x14')],_0x1a2fa7);_0x326416(_0x3b83bb[_0x34e8('0x12')](0x1f4,_0x1bb4f3['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d1cb38e..acd47be 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 _0xaf23=['destroy','removeLists','multer','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','get','isAuthenticated','/:id','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','/:id/blacklists','addBlackLists','put','delete'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf23,0x106));var _0x3af2=function(_0xa16401,_0x9a9949){_0xa16401=_0xa16401-0x0;var _0x3d5676=_0xaf23[_0xa16401];return _0x3d5676;};'use strict';var multer=require(_0x3af2('0x0'));var util=require('util');var path=require(_0x3af2('0x1'));var timeout=require(_0x3af2('0x2'));var express=require(_0x3af2('0x3'));var router=express[_0x3af2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3af2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3af2('0x6'));router[_0x3af2('0x7')]('/',auth[_0x3af2('0x8')](),controller['index']);router['get'](_0x3af2('0x9'),auth[_0x3af2('0x8')](),controller['show']);router['get']('/:id/hoppers',auth[_0x3af2('0x8')](),controller[_0x3af2('0xa')]);router[_0x3af2('0x7')]('/:id/hopper_histories',auth[_0x3af2('0x8')](),controller[_0x3af2('0xb')]);router[_0x3af2('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x3af2('0x7')](_0x3af2('0xc'),auth[_0x3af2('0x8')](),controller[_0x3af2('0xd')]);router[_0x3af2('0x7')](_0x3af2('0xe'),auth[_0x3af2('0x8')](),controller[_0x3af2('0xf')]);router[_0x3af2('0x7')]('/:id/blacklists',auth[_0x3af2('0x8')](),controller[_0x3af2('0x10')]);router[_0x3af2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3af2('0x12'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x13')]);router['post'](_0x3af2('0xe'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x3af2('0x14'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x15')]);router[_0x3af2('0x16')]('/:id',auth[_0x3af2('0x8')](),controller['update']);router[_0x3af2('0x17')](_0x3af2('0x9'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x18')]);router[_0x3af2('0x17')]('/:id/lists',auth[_0x3af2('0x8')](),controller[_0x3af2('0x19')]);router[_0x3af2('0x17')](_0x3af2('0x14'),auth[_0x3af2('0x8')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x7800=['path','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x8e6768,_0x997aad){var _0x4db9e9=function(_0x530ccb){while(--_0x530ccb){_0x8e6768['push'](_0x8e6768['shift']());}};_0x4db9e9(++_0x997aad);}(_0x7800,0x1ee));var _0x0780=function(_0x529287,_0x23957c){_0x529287=_0x529287-0x0;var _0x10936e=_0x7800[_0x529287];return _0x10936e;};'use strict';var multer=require(_0x0780('0x0'));var util=require(_0x0780('0x1'));var path=require(_0x0780('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0780('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0780('0x4'));var config=require(_0x0780('0x5'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0780('0x6')]);router[_0x0780('0x7')](_0x0780('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0780('0x7')](_0x0780('0x9'),auth[_0x0780('0xa')](),controller[_0x0780('0xb')]);router[_0x0780('0x7')](_0x0780('0xc'),auth[_0x0780('0xa')](),controller['getHopperHistories']);router[_0x0780('0x7')](_0x0780('0xd'),auth['isAuthenticated'](),controller[_0x0780('0xe')]);router[_0x0780('0x7')](_0x0780('0xf'),auth[_0x0780('0xa')](),controller[_0x0780('0x10')]);router[_0x0780('0x7')]('/:id/lists',auth[_0x0780('0xa')](),controller[_0x0780('0x11')]);router[_0x0780('0x7')](_0x0780('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x0780('0x13')]('/',auth[_0x0780('0xa')](),controller['create']);router[_0x0780('0x13')]('/:id/clone',auth[_0x0780('0xa')](),controller[_0x0780('0x14')]);router[_0x0780('0x13')](_0x0780('0x15'),auth['isAuthenticated'](),controller[_0x0780('0x16')]);router[_0x0780('0x13')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x17')]);router[_0x0780('0x18')]('/:id',auth[_0x0780('0xa')](),controller[_0x0780('0x19')]);router[_0x0780('0x1a')](_0x0780('0x8'),auth['isAuthenticated'](),controller[_0x0780('0x1b')]);router['delete'](_0x0780('0x15'),auth[_0x0780('0xa')](),controller[_0x0780('0x1c')]);router[_0x0780('0x1a')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x1d')]);module[_0x0780('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 753848f..d01e760 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 _0x482b=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x31b591,_0x11d791){var _0x5040ff=function(_0x544cc5){while(--_0x544cc5){_0x31b591['push'](_0x31b591['shift']());}};_0x5040ff(++_0x11d791);}(_0x482b,0x89));var _0xb482=function(_0x3de54a,_0x43c911){_0x3de54a=_0x3de54a-0x0;var _0x9f02e2=_0x482b[_0x3de54a];return _0x9f02e2;};'use strict';var Sequelize=require(_0xb482('0x0'));module['exports']={'key':{'type':Sequelize[_0xb482('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb482('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb482('0x1')]},'name':{'type':Sequelize[_0xb482('0x3')],'get':function(){return this[_0xb482('0x4')](_0xb482('0x5'));}}}; \ No newline at end of file +var _0x5399=['sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x5399,0xeb));var _0x9539=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x5399[_0x44ceee];return _0x1a065c;};'use strict';var Sequelize=require(_0x9539('0x0'));module[_0x9539('0x1')]={'key':{'type':Sequelize[_0x9539('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9539('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9539('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9539('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9b0350b..3cf4531 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 _0x29d6=['ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','destroy','get','CannedAnswers','UserProfileResource','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','CannedAnswer','includeAll','rows','catch','show','params','keys','include','merge','options','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x14845b,_0x5d8458){var _0x50998b=function(_0x324776){while(--_0x324776){_0x14845b['push'](_0x14845b['shift']());}};_0x50998b(++_0x5d8458);}(_0x29d6,0x11a));var _0x629d=function(_0x56a176,_0x298477){_0x56a176=_0x56a176-0x0;var _0x539ef2=_0x29d6[_0x56a176];return _0x539ef2;};'use strict';var emlformat=require(_0x629d('0x0'));var rimraf=require(_0x629d('0x1'));var zipdir=require(_0x629d('0x2'));var jsonpatch=require(_0x629d('0x3'));var rp=require(_0x629d('0x4'));var moment=require(_0x629d('0x5'));var BPromise=require(_0x629d('0x6'));var Mustache=require(_0x629d('0x7'));var util=require(_0x629d('0x8'));var path=require(_0x629d('0x9'));var sox=require(_0x629d('0xa'));var csv=require(_0x629d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x629d('0xc'));var _=require(_0x629d('0xd'));var squel=require(_0x629d('0xe'));var crypto=require(_0x629d('0xf'));var jsforce=require(_0x629d('0x10'));var deskjs=require(_0x629d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x629d('0x12'));var Redis=require(_0x629d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x629d('0x14'));var as=require(_0x629d('0x15'));var hardwareService=require(_0x629d('0x16'));var logger=require(_0x629d('0x17'))(_0x629d('0x18'));var utils=require(_0x629d('0x19'));var config=require(_0x629d('0x1a'));var licenseUtil=require(_0x629d('0x1b'));var db=require(_0x629d('0x1c'))['db'];function respondWithStatusCode(_0xd1b214,_0x51b95a){_0x51b95a=_0x51b95a||0xcc;return function(_0x29ca50){if(_0x29ca50){return _0xd1b214[_0x629d('0x1d')](_0x51b95a);}return _0xd1b214[_0x629d('0x1e')](_0x51b95a)[_0x629d('0x1f')]();};}function respondWithResult(_0x40c3ea,_0x547a26){_0x547a26=_0x547a26||0xc8;return function(_0x10a370){if(_0x10a370){return _0x40c3ea[_0x629d('0x1e')](_0x547a26)[_0x629d('0x20')](_0x10a370);}};}function respondWithFilteredResult(_0x596821,_0x2f0d3e){return function(_0x30c3e8){if(_0x30c3e8){var _0x1003c9=typeof _0x2f0d3e[_0x629d('0x21')]===_0x629d('0x22')&&typeof _0x2f0d3e[_0x629d('0x23')]===_0x629d('0x22');var _0x45d71c=_0x30c3e8[_0x629d('0x24')];var _0x125435=_0x1003c9?0x0:_0x2f0d3e[_0x629d('0x21')];var _0x596404=_0x1003c9?_0x30c3e8[_0x629d('0x24')]:_0x2f0d3e[_0x629d('0x21')]+_0x2f0d3e['limit'];var _0x417505;if(_0x596404>=_0x45d71c){_0x596404=_0x45d71c;_0x417505=0xc8;}else{_0x417505=0xce;}_0x596821[_0x629d('0x1e')](_0x417505);return _0x596821[_0x629d('0x25')](_0x629d('0x26'),_0x125435+'-'+_0x596404+'/'+_0x45d71c)['json'](_0x30c3e8);}return null;};}function patchUpdates(_0x3f37e4){return function(_0x51d3b0){try{jsonpatch[_0x629d('0x27')](_0x51d3b0,_0x3f37e4,!![]);}catch(_0x40eafe){return BPromise[_0x629d('0x28')](_0x40eafe);}return _0x51d3b0[_0x629d('0x29')]();};}function saveUpdates(_0x8d43b,_0x3aaad3){return function(_0x2e5375){if(_0x2e5375){return _0x2e5375[_0x629d('0x2a')](_0x8d43b)['then'](function(_0x47ed7b){return _0x47ed7b;});}return null;};}function removeEntity(_0x3e5097,_0x2929cd){return function(_0x28ef28){if(_0x28ef28){return _0x28ef28[_0x629d('0x2b')]()['then'](function(){var _0x38104a=_0x28ef28[_0x629d('0x2c')]({'plain':!![]});var _0x594115=_0x629d('0x2d');return db[_0x629d('0x2e')][_0x629d('0x2b')]({'where':{'type':_0x594115,'resourceId':_0x38104a['id']}})[_0x629d('0x2f')](function(){return _0x28ef28;});})[_0x629d('0x2f')](function(){_0x3e5097[_0x629d('0x1e')](0xcc)[_0x629d('0x1f')]();});}};}function handleEntityNotFound(_0x31a4bb,_0x440a03){return function(_0x5d85d1){if(!_0x5d85d1){_0x31a4bb[_0x629d('0x1d')](0x194);}return _0x5d85d1;};}function handleError(_0x22b08e,_0x5c5af7){_0x5c5af7=_0x5c5af7||0x1f4;return function(_0x10caed){logger['error'](_0x10caed[_0x629d('0x30')]);if(_0x10caed['name']){delete _0x10caed[_0x629d('0x31')];}_0x22b08e['status'](_0x5c5af7)[_0x629d('0x32')](_0x10caed);};}exports['index']=function(_0x28db49,_0x230c5a){var _0x556684={},_0x3d0933={},_0x4d8f4f={'count':0x0,'rows':[]};var _0x4fea8c=_[_0x629d('0x33')](db['CannedAnswer'][_0x629d('0x34')],function(_0x3d1b44){return{'name':_0x3d1b44[_0x629d('0x35')],'type':_0x3d1b44[_0x629d('0x36')][_0x629d('0x37')]};});_0x3d0933[_0x629d('0x38')]=_[_0x629d('0x33')](_0x4fea8c,_0x629d('0x31'));_0x3d0933['query']=_['keys'](_0x28db49[_0x629d('0x39')]);_0x3d0933[_0x629d('0x3a')]=_[_0x629d('0x3b')](_0x3d0933[_0x629d('0x38')],_0x3d0933['query']);_0x556684[_0x629d('0x3c')]=_['intersection'](_0x3d0933['model'],qs[_0x629d('0x3d')](_0x28db49[_0x629d('0x39')][_0x629d('0x3d')]));_0x556684[_0x629d('0x3c')]=_0x556684['attributes'][_0x629d('0x3e')]?_0x556684[_0x629d('0x3c')]:_0x3d0933[_0x629d('0x38')];if(!_0x28db49[_0x629d('0x39')]['hasOwnProperty'](_0x629d('0x3f'))){_0x556684[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x28db49[_0x629d('0x39')]['limit']);_0x556684['offset']=qs[_0x629d('0x21')](_0x28db49[_0x629d('0x39')][_0x629d('0x21')]);}_0x556684[_0x629d('0x40')]=qs[_0x629d('0x41')](_0x28db49[_0x629d('0x39')][_0x629d('0x41')]);_0x556684[_0x629d('0x42')]=qs[_0x629d('0x3a')](_[_0x629d('0x43')](_0x28db49[_0x629d('0x39')],_0x3d0933[_0x629d('0x3a')]),_0x4fea8c);if(_0x28db49[_0x629d('0x39')]['filter']){_0x556684[_0x629d('0x42')]=_['merge'](_0x556684[_0x629d('0x42')],{'$or':[{'key':{'$like':'%'+_0x28db49['query'][_0x629d('0x44')]+'%'}},{'value':{'$like':'%'+_0x28db49[_0x629d('0x39')][_0x629d('0x44')]+'%'}}]});}_0x556684=_['merge']({},_0x556684,_0x28db49['options']);var _0x42e1e4={'where':_0x556684['where']};return db[_0x629d('0x45')][_0x629d('0x24')](_0x42e1e4)['then'](function(_0x4bc6e0){_0x4d8f4f[_0x629d('0x24')]=_0x4bc6e0;if(_0x28db49['query'][_0x629d('0x46')]){_0x556684['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x556684);})['then'](function(_0x43e926){_0x4d8f4f[_0x629d('0x47')]=_0x43e926;return _0x4d8f4f;})[_0x629d('0x2f')](respondWithFilteredResult(_0x230c5a,_0x556684))[_0x629d('0x48')](handleError(_0x230c5a,null));};exports[_0x629d('0x49')]=function(_0x472a40,_0x4fc6da){var _0x3177a4={'raw':!![],'where':{'id':_0x472a40[_0x629d('0x4a')]['id']}},_0x130df1={};_0x130df1[_0x629d('0x38')]=_[_0x629d('0x4b')](db[_0x629d('0x45')]['rawAttributes']);_0x130df1['query']=_['keys'](_0x472a40[_0x629d('0x39')]);_0x130df1[_0x629d('0x3a')]=_[_0x629d('0x3b')](_0x130df1[_0x629d('0x38')],_0x130df1[_0x629d('0x39')]);_0x3177a4['attributes']=_[_0x629d('0x3b')](_0x130df1[_0x629d('0x38')],qs[_0x629d('0x3d')](_0x472a40[_0x629d('0x39')][_0x629d('0x3d')]));_0x3177a4[_0x629d('0x3c')]=_0x3177a4[_0x629d('0x3c')][_0x629d('0x3e')]?_0x3177a4[_0x629d('0x3c')]:_0x130df1[_0x629d('0x38')];if(_0x472a40[_0x629d('0x39')][_0x629d('0x46')]){_0x3177a4[_0x629d('0x4c')]=[{'all':!![]}];}_0x3177a4=_[_0x629d('0x4d')]({},_0x3177a4,_0x472a40[_0x629d('0x4e')]);return db[_0x629d('0x45')]['find'](_0x3177a4)[_0x629d('0x2f')](handleEntityNotFound(_0x4fc6da,null))[_0x629d('0x2f')](respondWithResult(_0x4fc6da,null))[_0x629d('0x48')](handleError(_0x4fc6da,null));};exports['update']=function(_0x3a8367,_0x341e2e){if(_0x3a8367[_0x629d('0x4f')]['id']){delete _0x3a8367[_0x629d('0x4f')]['id'];}return db[_0x629d('0x45')][_0x629d('0x50')]({'where':{'id':_0x3a8367[_0x629d('0x4a')]['id']}})[_0x629d('0x2f')](handleEntityNotFound(_0x341e2e,null))[_0x629d('0x2f')](saveUpdates(_0x3a8367[_0x629d('0x4f')],null))[_0x629d('0x2f')](respondWithResult(_0x341e2e,null))[_0x629d('0x48')](handleError(_0x341e2e,null));};exports[_0x629d('0x2b')]=function(_0x894a3c,_0x463b8e){return db[_0x629d('0x45')][_0x629d('0x50')]({'where':{'id':_0x894a3c[_0x629d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x463b8e,null))[_0x629d('0x2f')](removeEntity(_0x463b8e,null))[_0x629d('0x48')](handleError(_0x463b8e,null));};exports['create']=function(_0x4991d1,_0x13df96){var _0x37f611={'key':_0x4991d1[_0x629d('0x4f')]['key']};if(_0x4991d1['body'][_0x629d('0x51')]){_0x37f611['MailAccountId']=_0x4991d1[_0x629d('0x4f')][_0x629d('0x51')];}else if(_0x4991d1['body'][_0x629d('0x52')]){_0x37f611[_0x629d('0x52')]=_0x4991d1[_0x629d('0x4f')][_0x629d('0x52')];}else if(_0x4991d1[_0x629d('0x4f')]['OpenchannelAccountId']){_0x37f611['OpenchannelAccountId']=_0x4991d1[_0x629d('0x4f')][_0x629d('0x53')];}else if(_0x4991d1[_0x629d('0x4f')]['ChatWebsiteId']){_0x37f611[_0x629d('0x54')]=_0x4991d1[_0x629d('0x4f')][_0x629d('0x54')];}return db['CannedAnswer'][_0x629d('0x50')]({'where':_0x37f611})[_0x629d('0x2f')](function(_0x539dd1){if(_0x539dd1){throw new db[(_0x629d('0x55'))][(_0x629d('0x56'))](_0x629d('0x57'));}return db[_0x629d('0x45')]['create'](_0x4991d1[_0x629d('0x4f')]);})[_0x629d('0x2f')](function(_0xc2a0a0){var _0x3da611=_0x4991d1[_0x629d('0x58')][_0x629d('0x2c')]({'plain':!![]});if(!_0x3da611)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da611['role']===_0x629d('0x58')){var _0x2f814a=_0xc2a0a0[_0x629d('0x2c')]({'plain':!![]});return db[_0x629d('0x59')]['find']({'where':{'name':_0x629d('0x2d'),'userProfileId':_0x3da611['userProfileId']},'raw':!![]})[_0x629d('0x2f')](function(_0x549376){if(_0x549376&&_0x549376[_0x629d('0x5a')]===0x0){return db[_0x629d('0x2e')][_0x629d('0x5b')]({'name':_0x2f814a[_0x629d('0x31')],'resourceId':_0x2f814a['id'],'type':_0x549376['name'],'sectionId':_0x549376['id']},{})[_0x629d('0x2f')](function(){return _0xc2a0a0;});}else{return _0xc2a0a0;}})['catch'](function(_0x36c943){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c943);throw _0x36c943;});}return _0xc2a0a0;})['then'](respondWithResult(_0x13df96,0xc9))[_0x629d('0x48')](handleError(_0x13df96,null));}; \ No newline at end of file +var _0x258b=['rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','CannedAnswer','includeAll','include','catch','show','params','keys','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','mustache','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x1e7d26,_0x208a83){var _0x26d190=function(_0x15f3d3){while(--_0x15f3d3){_0x1e7d26['push'](_0x1e7d26['shift']());}};_0x26d190(++_0x208a83);}(_0x258b,0x81));var _0xb258=function(_0x12e32e,_0x158771){_0x12e32e=_0x12e32e-0x0;var _0x306637=_0x258b[_0x12e32e];return _0x306637;};'use strict';var emlformat=require(_0xb258('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb258('0x1'));var util=require(_0xb258('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb258('0x3'));var squel=require(_0xb258('0x4'));var crypto=require(_0xb258('0x5'));var jsforce=require(_0xb258('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xb258('0x7'));var querystring=require(_0xb258('0x8'));var Papa=require(_0xb258('0x9'));var Redis=require(_0xb258('0xa'));var authService=require(_0xb258('0xb'));var qs=require(_0xb258('0xc'));var as=require(_0xb258('0xd'));var hardwareService=require(_0xb258('0xe'));var logger=require(_0xb258('0xf'))(_0xb258('0x10'));var utils=require('../../config/utils');var config=require(_0xb258('0x11'));var licenseUtil=require(_0xb258('0x12'));var db=require(_0xb258('0x13'))['db'];function respondWithStatusCode(_0x251617,_0x53008a){_0x53008a=_0x53008a||0xcc;return function(_0x2a7d5e){if(_0x2a7d5e){return _0x251617['sendStatus'](_0x53008a);}return _0x251617['status'](_0x53008a)[_0xb258('0x14')]();};}function respondWithResult(_0x46bce1,_0x581d34){_0x581d34=_0x581d34||0xc8;return function(_0x56144e){if(_0x56144e){return _0x46bce1[_0xb258('0x15')](_0x581d34)['json'](_0x56144e);}};}function respondWithFilteredResult(_0x44b235,_0x2d33a9){return function(_0x4f937f){if(_0x4f937f){var _0x32b69a=typeof _0x2d33a9[_0xb258('0x16')]===_0xb258('0x17')&&typeof _0x2d33a9[_0xb258('0x18')]===_0xb258('0x17');var _0x36586e=_0x4f937f[_0xb258('0x19')];var _0x78fe6d=_0x32b69a?0x0:_0x2d33a9[_0xb258('0x16')];var _0x1ac322=_0x32b69a?_0x4f937f[_0xb258('0x19')]:_0x2d33a9[_0xb258('0x16')]+_0x2d33a9[_0xb258('0x18')];var _0x2bb02c;if(_0x1ac322>=_0x36586e){_0x1ac322=_0x36586e;_0x2bb02c=0xc8;}else{_0x2bb02c=0xce;}_0x44b235[_0xb258('0x15')](_0x2bb02c);return _0x44b235[_0xb258('0x1a')](_0xb258('0x1b'),_0x78fe6d+'-'+_0x1ac322+'/'+_0x36586e)[_0xb258('0x1c')](_0x4f937f);}return null;};}function patchUpdates(_0x5851c4){return function(_0x1c80c2){try{jsonpatch[_0xb258('0x1d')](_0x1c80c2,_0x5851c4,!![]);}catch(_0x2b8fa9){return BPromise[_0xb258('0x1e')](_0x2b8fa9);}return _0x1c80c2[_0xb258('0x1f')]();};}function saveUpdates(_0x42a14b,_0x1458ac){return function(_0xb4069f){if(_0xb4069f){return _0xb4069f[_0xb258('0x20')](_0x42a14b)[_0xb258('0x21')](function(_0x32aaea){return _0x32aaea;});}return null;};}function removeEntity(_0x19514e,_0xe2fc8a){return function(_0xe4ddf0){if(_0xe4ddf0){return _0xe4ddf0[_0xb258('0x22')]()[_0xb258('0x21')](function(){var _0x3dd7c6=_0xe4ddf0[_0xb258('0x23')]({'plain':!![]});var _0x215416=_0xb258('0x24');return db[_0xb258('0x25')][_0xb258('0x22')]({'where':{'type':_0x215416,'resourceId':_0x3dd7c6['id']}})['then'](function(){return _0xe4ddf0;});})[_0xb258('0x21')](function(){_0x19514e[_0xb258('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420e48,_0x2c649a){return function(_0x52011e){if(!_0x52011e){_0x420e48[_0xb258('0x26')](0x194);}return _0x52011e;};}function handleError(_0x32633c,_0x24ea6e){_0x24ea6e=_0x24ea6e||0x1f4;return function(_0x39f68e){logger[_0xb258('0x27')](_0x39f68e[_0xb258('0x28')]);if(_0x39f68e[_0xb258('0x29')]){delete _0x39f68e[_0xb258('0x29')];}_0x32633c[_0xb258('0x15')](_0x24ea6e)['send'](_0x39f68e);};}exports[_0xb258('0x2a')]=function(_0x56db73,_0x164900){var _0x6e43c5={},_0x31507b={},_0x505b76={'count':0x0,'rows':[]};var _0x41be0a=_['map'](db['CannedAnswer'][_0xb258('0x2b')],function(_0x1fd5da){return{'name':_0x1fd5da[_0xb258('0x2c')],'type':_0x1fd5da['type'][_0xb258('0x2d')]};});_0x31507b[_0xb258('0x2e')]=_[_0xb258('0x2f')](_0x41be0a,_0xb258('0x29'));_0x31507b[_0xb258('0x30')]=_['keys'](_0x56db73[_0xb258('0x30')]);_0x31507b['filters']=_[_0xb258('0x31')](_0x31507b[_0xb258('0x2e')],_0x31507b[_0xb258('0x30')]);_0x6e43c5['attributes']=_[_0xb258('0x31')](_0x31507b['model'],qs[_0xb258('0x32')](_0x56db73[_0xb258('0x30')]['fields']));_0x6e43c5[_0xb258('0x33')]=_0x6e43c5[_0xb258('0x33')][_0xb258('0x34')]?_0x6e43c5[_0xb258('0x33')]:_0x31507b[_0xb258('0x2e')];if(!_0x56db73[_0xb258('0x30')][_0xb258('0x35')](_0xb258('0x36'))){_0x6e43c5['limit']=qs[_0xb258('0x18')](_0x56db73[_0xb258('0x30')][_0xb258('0x18')]);_0x6e43c5['offset']=qs['offset'](_0x56db73[_0xb258('0x30')]['offset']);}_0x6e43c5[_0xb258('0x37')]=qs['sort'](_0x56db73[_0xb258('0x30')][_0xb258('0x38')]);_0x6e43c5[_0xb258('0x39')]=qs[_0xb258('0x3a')](_[_0xb258('0x3b')](_0x56db73[_0xb258('0x30')],_0x31507b[_0xb258('0x3a')]),_0x41be0a);if(_0x56db73['query']['filter']){_0x6e43c5[_0xb258('0x39')]=_[_0xb258('0x3c')](_0x6e43c5[_0xb258('0x39')],{'$or':[{'key':{'$like':'%'+_0x56db73[_0xb258('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x56db73[_0xb258('0x30')][_0xb258('0x3d')]+'%'}}]});}_0x6e43c5=_['merge']({},_0x6e43c5,_0x56db73[_0xb258('0x3e')]);var _0x2db763={'where':_0x6e43c5['where']};return db[_0xb258('0x3f')][_0xb258('0x19')](_0x2db763)[_0xb258('0x21')](function(_0x53168b){_0x505b76['count']=_0x53168b;if(_0x56db73[_0xb258('0x30')][_0xb258('0x40')]){_0x6e43c5[_0xb258('0x41')]=[{'all':!![]}];}return db[_0xb258('0x3f')]['findAll'](_0x6e43c5);})['then'](function(_0xc35bf9){_0x505b76['rows']=_0xc35bf9;return _0x505b76;})[_0xb258('0x21')](respondWithFilteredResult(_0x164900,_0x6e43c5))[_0xb258('0x42')](handleError(_0x164900,null));};exports[_0xb258('0x43')]=function(_0x255969,_0x561487){var _0x2a3df6={'raw':!![],'where':{'id':_0x255969[_0xb258('0x44')]['id']}},_0x2a4689={};_0x2a4689['model']=_[_0xb258('0x45')](db[_0xb258('0x3f')][_0xb258('0x2b')]);_0x2a4689[_0xb258('0x30')]=_[_0xb258('0x45')](_0x255969[_0xb258('0x30')]);_0x2a4689[_0xb258('0x3a')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],_0x2a4689[_0xb258('0x30')]);_0x2a3df6[_0xb258('0x33')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],qs[_0xb258('0x32')](_0x255969[_0xb258('0x30')][_0xb258('0x32')]));_0x2a3df6[_0xb258('0x33')]=_0x2a3df6[_0xb258('0x33')][_0xb258('0x34')]?_0x2a3df6[_0xb258('0x33')]:_0x2a4689[_0xb258('0x2e')];if(_0x255969[_0xb258('0x30')]['includeAll']){_0x2a3df6[_0xb258('0x41')]=[{'all':!![]}];}_0x2a3df6=_[_0xb258('0x3c')]({},_0x2a3df6,_0x255969[_0xb258('0x3e')]);return db[_0xb258('0x3f')][_0xb258('0x46')](_0x2a3df6)[_0xb258('0x21')](handleEntityNotFound(_0x561487,null))['then'](respondWithResult(_0x561487,null))[_0xb258('0x42')](handleError(_0x561487,null));};exports[_0xb258('0x20')]=function(_0x12c5a1,_0x2b0f56){if(_0x12c5a1[_0xb258('0x47')]['id']){delete _0x12c5a1[_0xb258('0x47')]['id'];}return db[_0xb258('0x3f')]['find']({'where':{'id':_0x12c5a1[_0xb258('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b0f56,null))[_0xb258('0x21')](saveUpdates(_0x12c5a1[_0xb258('0x47')],null))[_0xb258('0x21')](respondWithResult(_0x2b0f56,null))[_0xb258('0x42')](handleError(_0x2b0f56,null));};exports[_0xb258('0x22')]=function(_0x3dc865,_0x282b89){return db[_0xb258('0x3f')][_0xb258('0x46')]({'where':{'id':_0x3dc865[_0xb258('0x44')]['id']}})[_0xb258('0x21')](handleEntityNotFound(_0x282b89,null))['then'](removeEntity(_0x282b89,null))[_0xb258('0x42')](handleError(_0x282b89,null));};exports['create']=function(_0x16776c,_0x16f6bb){var _0x1bb3f5={'key':_0x16776c[_0xb258('0x47')]['key']};if(_0x16776c[_0xb258('0x47')]['MailAccountId']){_0x1bb3f5[_0xb258('0x48')]=_0x16776c[_0xb258('0x47')][_0xb258('0x48')];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x49')]){_0x1bb3f5[_0xb258('0x49')]=_0x16776c[_0xb258('0x47')]['SmsAccountId'];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x4a')]){_0x1bb3f5['OpenchannelAccountId']=_0x16776c[_0xb258('0x47')][_0xb258('0x4a')];}else if(_0x16776c[_0xb258('0x47')]['ChatWebsiteId']){_0x1bb3f5[_0xb258('0x4b')]=_0x16776c['body'][_0xb258('0x4b')];}return db[_0xb258('0x3f')]['find']({'where':_0x1bb3f5})[_0xb258('0x21')](function(_0x581a2d){if(_0x581a2d){throw new db['Sequelize'][(_0xb258('0x4c'))](_0xb258('0x4d'));}return db[_0xb258('0x3f')][_0xb258('0x4e')](_0x16776c[_0xb258('0x47')]);})['then'](function(_0xb8539b){var _0x465545=_0x16776c[_0xb258('0x4f')][_0xb258('0x23')]({'plain':!![]});if(!_0x465545)throw new Error(_0xb258('0x50'));if(_0x465545[_0xb258('0x51')]===_0xb258('0x4f')){var _0x5333cf=_0xb8539b[_0xb258('0x23')]({'plain':!![]});return db[_0xb258('0x52')][_0xb258('0x46')]({'where':{'name':_0xb258('0x24'),'userProfileId':_0x465545[_0xb258('0x53')]},'raw':!![]})['then'](function(_0x32cb34){if(_0x32cb34&&_0x32cb34[_0xb258('0x54')]===0x0){return db[_0xb258('0x25')][_0xb258('0x4e')]({'name':_0x5333cf['name'],'resourceId':_0x5333cf['id'],'type':_0x32cb34[_0xb258('0x29')],'sectionId':_0x32cb34['id']},{})[_0xb258('0x21')](function(){return _0xb8539b;});}else{return _0xb8539b;}})[_0xb258('0x42')](function(_0x2b557e){logger[_0xb258('0x27')](_0xb258('0x55'),_0x2b557e);throw _0x2b557e;});}return _0xb8539b;})[_0xb258('0x21')](respondWithResult(_0x16f6bb,0xc9))['catch'](handleError(_0x16f6bb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e814745..6425379 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 _0xb6e6=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x2e1fe2,_0x4dc62a){var _0x4d7447=function(_0x5f1896){while(--_0x5f1896){_0x2e1fe2['push'](_0x2e1fe2['shift']());}};_0x4d7447(++_0x4dc62a);}(_0xb6e6,0xbf));var _0x6b6e=function(_0x2ff6ea,_0x4e373a){_0x2ff6ea=_0x2ff6ea-0x0;var _0x24a11c=_0xb6e6[_0x2ff6ea];return _0x24a11c;};'use strict';var _=require(_0x6b6e('0x0'));var util=require('util');var logger=require(_0x6b6e('0x1'))(_0x6b6e('0x2'));var moment=require(_0x6b6e('0x3'));var BPromise=require(_0x6b6e('0x4'));var rp=require(_0x6b6e('0x5'));var fs=require('fs');var path=require(_0x6b6e('0x6'));var rimraf=require(_0x6b6e('0x7'));var config=require(_0x6b6e('0x8'));var attributes=require(_0x6b6e('0x9'));module[_0x6b6e('0xa')]=function(_0x319018,_0x29ab81){return _0x319018[_0x6b6e('0xb')](_0x6b6e('0xc'),attributes,{'tableName':_0x6b6e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b6e('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8eef=['moment','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x373ac3,_0x4d7851){var _0x11b344=function(_0x40caff){while(--_0x40caff){_0x373ac3['push'](_0x373ac3['shift']());}};_0x11b344(++_0x4d7851);}(_0x8eef,0xb2));var _0xf8ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8eef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf8ee('0x0'));var util=require(_0xf8ee('0x1'));var logger=require(_0xf8ee('0x2'))(_0xf8ee('0x3'));var moment=require(_0xf8ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xf8ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ee('0x6'));var config=require('../../config/environment');var attributes=require(_0xf8ee('0x7'));module[_0xf8ee('0x8')]=function(_0x5cb281,_0x3c8258){return _0x5cb281[_0xf8ee('0x9')](_0xf8ee('0xa'),attributes,{'tableName':_0xf8ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ee('0xc'),'collate':_0xf8ee('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a002664..92aa659 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(_0x586128,_0x223852){var _0x8acfc6=function(_0x274d7c){while(--_0x274d7c){_0x586128['push'](_0x586128['shift']());}};_0x8acfc6(++_0x223852);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x35bd13,_0x50086d){var _0x4ee8a0=function(_0x566bd6){while(--_0x566bd6){_0x35bd13['push'](_0x35bd13['shift']());}};_0x4ee8a0(++_0x50086d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 cb8f917..0b68d26 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 _0x382c=['post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show'];(function(_0x3744ba,_0x5e13bc){var _0x21e749=function(_0xf88887){while(--_0xf88887){_0x3744ba['push'](_0x3744ba['shift']());}};_0x21e749(++_0x5e13bc);}(_0x382c,0x126));var _0xc382=function(_0x3a604a,_0x1b5e07){_0x3a604a=_0x3a604a-0x0;var _0xde7ac9=_0x382c[_0x3a604a];return _0xde7ac9;};'use strict';var multer=require(_0xc382('0x0'));var util=require('util');var path=require(_0xc382('0x1'));var timeout=require(_0xc382('0x2'));var express=require(_0xc382('0x3'));var router=express['Router']();var fs_extra=require(_0xc382('0x4'));var auth=require(_0xc382('0x5'));var interaction=require(_0xc382('0x6'));var config=require('../../config/environment');var controller=require(_0xc382('0x7'));router[_0xc382('0x8')]('/',auth[_0xc382('0x9')](),controller['index']);router[_0xc382('0x8')](_0xc382('0xa'),auth['isAuthenticated'](),controller[_0xc382('0xb')]);router[_0xc382('0xc')]('/',auth['isAuthenticated'](),controller[_0xc382('0xd')]);router[_0xc382('0xe')](_0xc382('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc382('0xf')]('/:id',auth[_0xc382('0x9')](),controller[_0xc382('0x10')]);module[_0xc382('0x11')]=router; \ No newline at end of file +var _0x1824=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xb6b5b4,_0x174061){var _0x1187a6=function(_0x59ba44){while(--_0x59ba44){_0xb6b5b4['push'](_0xb6b5b4['shift']());}};_0x1187a6(++_0x174061);}(_0x1824,0x1b3));var _0x4182=function(_0x31045e,_0x39f65a){_0x31045e=_0x31045e-0x0;var _0x3a31b1=_0x1824[_0x31045e];return _0x3a31b1;};'use strict';var multer=require('multer');var util=require(_0x4182('0x0'));var path=require('path');var timeout=require(_0x4182('0x1'));var express=require(_0x4182('0x2'));var router=express[_0x4182('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4182('0x4'));var interaction=require(_0x4182('0x5'));var config=require(_0x4182('0x6'));var controller=require(_0x4182('0x7'));router[_0x4182('0x8')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xa')]);router[_0x4182('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4182('0xb')]);router[_0x4182('0xc')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xd')]);router[_0x4182('0xe')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x10')]);router[_0x4182('0x11')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x12')]);module[_0x4182('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9e6d31f..daf1a28 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 _0x0f61=['INTEGER','exports','STRING'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0x0f61,0xa6));var _0x10f6=function(_0x2a2dfc,_0x33b59c){_0x2a2dfc=_0x2a2dfc-0x0;var _0x124c3f=_0x0f61[_0x2a2dfc];return _0x124c3f;};'use strict';var Sequelize=require('sequelize');module[_0x10f6('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x10f6('0x1')]},'src':{'type':Sequelize[_0x10f6('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x10f6('0x1')]},'channel':{'type':Sequelize[_0x10f6('0x1')]},'dstchannel':{'type':Sequelize[_0x10f6('0x1')]},'lastapp':{'type':Sequelize[_0x10f6('0x1')]},'lastdata':{'type':Sequelize[_0x10f6('0x1')]},'duration':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x10f6('0x1')]},'amaflags':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x10f6('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x10f6('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x10f6('0x1')]},'peeraccount':{'type':Sequelize[_0x10f6('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x10f6('0x1')]}}; \ No newline at end of file +var _0x765e=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1246ea,_0x5e9190){var _0x486c50=function(_0x20fa12){while(--_0x20fa12){_0x1246ea['push'](_0x1246ea['shift']());}};_0x486c50(++_0x5e9190);}(_0x765e,0x131));var _0xe765=function(_0x13082,_0x3a8a83){_0x13082=_0x13082-0x0;var _0x415358=_0x765e[_0x13082];return _0x415358;};'use strict';var Sequelize=require(_0xe765('0x0'));module[_0xe765('0x1')]={'calldate':{'type':Sequelize[_0xe765('0x2')],'allowNull':![],'defaultValue':_0xe765('0x3')},'clid':{'type':Sequelize[_0xe765('0x4')]},'src':{'type':Sequelize[_0xe765('0x4')]},'dst':{'type':Sequelize[_0xe765('0x4')]},'dcontext':{'type':Sequelize[_0xe765('0x4')]},'channel':{'type':Sequelize[_0xe765('0x4')]},'dstchannel':{'type':Sequelize[_0xe765('0x4')]},'lastapp':{'type':Sequelize[_0xe765('0x4')]},'lastdata':{'type':Sequelize[_0xe765('0x4')]},'duration':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe765('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe765('0x4')]},'userfield':{'type':Sequelize[_0xe765('0x4')]},'uniqueid':{'type':Sequelize[_0xe765('0x4')]},'linkedid':{'type':Sequelize[_0xe765('0x4')]},'sequence':{'type':Sequelize[_0xe765('0x4')]},'peeraccount':{'type':Sequelize[_0xe765('0x4')]},'type':{'type':Sequelize[_0xe765('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 72a6ff4..fad15c8 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 _0x8ce1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x8ce1,0x183));var _0x18ce=function(_0x489c86,_0x3b80e5){_0x489c86=_0x489c86-0x0;var _0x4ee191=_0x8ce1[_0x489c86];return _0x4ee191;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require(_0x18ce('0x7'));var util=require(_0x18ce('0x8'));var path=require(_0x18ce('0x9'));var sox=require(_0x18ce('0xa'));var csv=require(_0x18ce('0xb'));var ejs=require(_0x18ce('0xc'));var fs=require('fs');var fs_extra=require(_0x18ce('0xd'));var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xb'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var licenseUtil=require(_0x18ce('0x1a'));var db=require(_0x18ce('0x1b'))['db'];function respondWithStatusCode(_0x5e8c23,_0xbd514b){_0xbd514b=_0xbd514b||0xcc;return function(_0x402ba4){if(_0x402ba4){return _0x5e8c23[_0x18ce('0x1c')](_0xbd514b);}return _0x5e8c23[_0x18ce('0x1d')](_0xbd514b)[_0x18ce('0x1e')]();};}function respondWithResult(_0x5daf04,_0x176797){_0x176797=_0x176797||0xc8;return function(_0xdd4626){if(_0xdd4626){return _0x5daf04[_0x18ce('0x1d')](_0x176797)[_0x18ce('0x1f')](_0xdd4626);}};}function respondWithFilteredResult(_0x46e346,_0x36b5da){return function(_0x17460e){if(_0x17460e){var _0x4a934f=typeof _0x36b5da[_0x18ce('0x20')]===_0x18ce('0x21')&&typeof _0x36b5da[_0x18ce('0x22')]===_0x18ce('0x21');var _0x1edc10=_0x17460e[_0x18ce('0x23')];var _0x482458=_0x4a934f?0x0:_0x36b5da[_0x18ce('0x20')];var _0x29c691=_0x4a934f?_0x17460e[_0x18ce('0x23')]:_0x36b5da['offset']+_0x36b5da[_0x18ce('0x22')];var _0x2fa3d4;if(_0x29c691>=_0x1edc10){_0x29c691=_0x1edc10;_0x2fa3d4=0xc8;}else{_0x2fa3d4=0xce;}_0x46e346[_0x18ce('0x1d')](_0x2fa3d4);return _0x46e346['set'](_0x18ce('0x24'),_0x482458+'-'+_0x29c691+'/'+_0x1edc10)[_0x18ce('0x1f')](_0x17460e);}return null;};}function patchUpdates(_0x5d22cd){return function(_0x29c1ab){try{jsonpatch[_0x18ce('0x25')](_0x29c1ab,_0x5d22cd,!![]);}catch(_0x16802e){return BPromise[_0x18ce('0x26')](_0x16802e);}return _0x29c1ab[_0x18ce('0x27')]();};}function saveUpdates(_0xd41f29,_0x35abf9){return function(_0x545459){if(_0x545459){return _0x545459[_0x18ce('0x28')](_0xd41f29)['then'](function(_0x482c90){return _0x482c90;});}return null;};}function removeEntity(_0x5d2299,_0x32e910){return function(_0x576ecc){if(_0x576ecc){return _0x576ecc[_0x18ce('0x29')]()[_0x18ce('0x2a')](function(){_0x5d2299[_0x18ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53abbd,_0x55e17c){return function(_0x317812){if(!_0x317812){_0x53abbd[_0x18ce('0x1c')](0x194);}return _0x317812;};}function handleError(_0x12dbd2,_0x461113){_0x461113=_0x461113||0x1f4;return function(_0x62b2bd){logger[_0x18ce('0x2b')](_0x62b2bd['stack']);if(_0x62b2bd['name']){delete _0x62b2bd['name'];}_0x12dbd2[_0x18ce('0x1d')](_0x461113)[_0x18ce('0x2c')](_0x62b2bd);};}exports[_0x18ce('0x2d')]=function(_0x5f3ec2,_0x1a87f6){var _0xf2683f={},_0x1988e4={},_0x5ef96c={'count':0x0,'rows':[]};var _0x56d296=_['map'](db[_0x18ce('0x2e')][_0x18ce('0x2f')],function(_0x5c2d96){return{'name':_0x5c2d96['fieldName'],'type':_0x5c2d96[_0x18ce('0x30')][_0x18ce('0x31')]};});_0x1988e4[_0x18ce('0x32')]=_['map'](_0x56d296,'name');_0x1988e4[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x5f3ec2[_0x18ce('0x33')]);_0x1988e4[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x1988e4[_0x18ce('0x32')],_0x1988e4[_0x18ce('0x33')]);_0xf2683f[_0x18ce('0x37')]=_['intersection'](_0x1988e4['model'],qs[_0x18ce('0x38')](_0x5f3ec2[_0x18ce('0x33')]['fields']));_0xf2683f[_0x18ce('0x37')]=_0xf2683f['attributes'][_0x18ce('0x39')]?_0xf2683f['attributes']:_0x1988e4[_0x18ce('0x32')];if(!_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3a')]('nolimit')){_0xf2683f['limit']=qs[_0x18ce('0x22')](_0x5f3ec2[_0x18ce('0x33')]['limit']);_0xf2683f['offset']=qs[_0x18ce('0x20')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x20')]);}_0xf2683f[_0x18ce('0x3b')]=qs[_0x18ce('0x3c')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3c')]);_0xf2683f[_0x18ce('0x3d')]=qs[_0x18ce('0x35')](_[_0x18ce('0x3e')](_0x5f3ec2[_0x18ce('0x33')],_0x1988e4[_0x18ce('0x35')]),_0x56d296);if(_0x5f3ec2[_0x18ce('0x33')]['filter']){_0xf2683f[_0x18ce('0x3d')]=_[_0x18ce('0x3f')](_0xf2683f[_0x18ce('0x3d')],{'$or':_[_0x18ce('0x40')](_0x56d296,function(_0x1e67dd){if(_0x1e67dd[_0x18ce('0x30')]!==_0x18ce('0x41')){var _0x27c55a={};_0x27c55a[_0x1e67dd[_0x18ce('0x42')]]={'$like':'%'+_0x5f3ec2[_0x18ce('0x33')]['filter']+'%'};return _0x27c55a;}})});}_0xf2683f=_['merge']({},_0xf2683f,_0x5f3ec2[_0x18ce('0x43')]);var _0x23486c={'where':_0xf2683f[_0x18ce('0x3d')]};return db[_0x18ce('0x2e')][_0x18ce('0x23')](_0x23486c)[_0x18ce('0x2a')](function(_0x2eba88){_0x5ef96c['count']=_0x2eba88;if(_0x5f3ec2['query'][_0x18ce('0x44')]){_0xf2683f[_0x18ce('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x18ce('0x46')](_0xf2683f);})[_0x18ce('0x2a')](function(_0x2941ce){_0x5ef96c[_0x18ce('0x47')]=_0x2941ce;return _0x5ef96c;})[_0x18ce('0x2a')](respondWithFilteredResult(_0x1a87f6,_0xf2683f))[_0x18ce('0x48')](handleError(_0x1a87f6,null));};exports[_0x18ce('0x49')]=function(_0x2a96a7,_0x33b409){var _0x1d6d5f={'raw':!![],'where':{'id':_0x2a96a7[_0x18ce('0x4a')]['id']}},_0x3885e6={};_0x3885e6['model']=_[_0x18ce('0x34')](db[_0x18ce('0x2e')][_0x18ce('0x2f')]);_0x3885e6[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x2a96a7[_0x18ce('0x33')]);_0x3885e6[_0x18ce('0x35')]=_['intersection'](_0x3885e6['model'],_0x3885e6[_0x18ce('0x33')]);_0x1d6d5f[_0x18ce('0x37')]=_[_0x18ce('0x36')](_0x3885e6[_0x18ce('0x32')],qs['fields'](_0x2a96a7[_0x18ce('0x33')][_0x18ce('0x38')]));_0x1d6d5f[_0x18ce('0x37')]=_0x1d6d5f['attributes']['length']?_0x1d6d5f[_0x18ce('0x37')]:_0x3885e6[_0x18ce('0x32')];if(_0x2a96a7['query'][_0x18ce('0x44')]){_0x1d6d5f[_0x18ce('0x45')]=[{'all':!![]}];}_0x1d6d5f=_[_0x18ce('0x3f')]({},_0x1d6d5f,_0x2a96a7[_0x18ce('0x43')]);return db[_0x18ce('0x2e')][_0x18ce('0x4b')](_0x1d6d5f)[_0x18ce('0x2a')](handleEntityNotFound(_0x33b409,null))['then'](respondWithResult(_0x33b409,null))[_0x18ce('0x48')](handleError(_0x33b409,null));};exports[_0x18ce('0x4c')]=function(_0x476c6a,_0x1e445d){return db[_0x18ce('0x2e')][_0x18ce('0x4c')](_0x476c6a[_0x18ce('0x4d')],{})[_0x18ce('0x2a')](respondWithResult(_0x1e445d,0xc9))[_0x18ce('0x48')](handleError(_0x1e445d,null));};exports[_0x18ce('0x28')]=function(_0x1211d0,_0x3f9960){if(_0x1211d0[_0x18ce('0x4d')]['id']){delete _0x1211d0[_0x18ce('0x4d')]['id'];}return db['Cdr'][_0x18ce('0x4b')]({'where':{'id':_0x1211d0[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f9960,null))[_0x18ce('0x2a')](saveUpdates(_0x1211d0['body'],null))[_0x18ce('0x2a')](respondWithResult(_0x3f9960,null))['catch'](handleError(_0x3f9960,null));};exports[_0x18ce('0x29')]=function(_0x188f57,_0x3d5b1b){return db[_0x18ce('0x2e')]['find']({'where':{'id':_0x188f57[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d5b1b,null))['then'](removeEntity(_0x3d5b1b,null))[_0x18ce('0x48')](handleError(_0x3d5b1b,null));};exports[_0x18ce('0x4e')]=function(_0x8aa4a7,_0x5f164a){return db['Cdr'][_0x18ce('0x4e')]()[_0x18ce('0x2a')](respondWithResult(_0x5f164a,null))[_0x18ce('0x48')](handleError(_0x5f164a,null));}; \ No newline at end of file +var _0x5fc3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','Cdr','fieldName','type','model','query','keys','filters'];(function(_0x2b5a7c,_0x223e71){var _0x1a407c=function(_0x341466){while(--_0x341466){_0x2b5a7c['push'](_0x2b5a7c['shift']());}};_0x1a407c(++_0x223e71);}(_0x5fc3,0xa8));var _0x35fc=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x5fc3[_0x334599];return _0x4cdff2;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26'));_0x9f3c8a[_0x35fc('0x2d')]=_[_0x35fc('0x2e')](_0x26b7cb[_0x35fc('0x2d')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x9f3c8a[_0x35fc('0x2c')],_0x9f3c8a[_0x35fc('0x2d')]);_0x383837['attributes']=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs['fields'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x31')]));_0x383837[_0x35fc('0x32')]=_0x383837[_0x35fc('0x32')][_0x35fc('0x33')]?_0x383837[_0x35fc('0x32')]:_0x9f3c8a['model'];if(!_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x34')](_0x35fc('0x35'))){_0x383837[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x26b7cb[_0x35fc('0x2d')]['limit']);_0x383837[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x26b7cb[_0x35fc('0x2d')]['offset']);}_0x383837[_0x35fc('0x36')]=qs['sort'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x37')]);_0x383837[_0x35fc('0x38')]=qs[_0x35fc('0x2f')](_['pick'](_0x26b7cb['query'],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2d')]['filter']){_0x383837[_0x35fc('0x38')]=_['merge'](_0x383837[_0x35fc('0x38')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x2ca9ac){if(_0x2ca9ac[_0x35fc('0x2b')]!==_0x35fc('0x39')){var _0x3313fa={};_0x3313fa[_0x2ca9ac[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb['query'][_0x35fc('0x3a')]+'%'};return _0x3313fa;}})});}_0x383837=_[_0x35fc('0x3b')]({},_0x383837,_0x26b7cb['options']);var _0x1feda5={'where':_0x383837[_0x35fc('0x38')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1feda5)[_0x35fc('0x24')](function(_0x31d926){_0x3735da['count']=_0x31d926;if(_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x3c')]){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x35fc('0x3e')](_0x383837);})[_0x35fc('0x24')](function(_0x596919){_0x3735da[_0x35fc('0x3f')]=_0x596919;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x40')](handleError(_0x645eac,null));};exports[_0x35fc('0x41')]=function(_0x331439,_0x2a1cf6){var _0x211b70={'raw':!![],'where':{'id':_0x331439['params']['id']}},_0x3ec51f={};_0x3ec51f['model']=_[_0x35fc('0x2e')](db[_0x35fc('0x29')]['rawAttributes']);_0x3ec51f['query']=_['keys'](_0x331439[_0x35fc('0x2d')]);_0x3ec51f[_0x35fc('0x2f')]=_['intersection'](_0x3ec51f[_0x35fc('0x2c')],_0x3ec51f[_0x35fc('0x2d')]);_0x211b70[_0x35fc('0x32')]=_[_0x35fc('0x30')](_0x3ec51f['model'],qs['fields'](_0x331439['query']['fields']));_0x211b70['attributes']=_0x211b70[_0x35fc('0x32')][_0x35fc('0x33')]?_0x211b70['attributes']:_0x3ec51f[_0x35fc('0x2c')];if(_0x331439['query'][_0x35fc('0x3c')]){_0x211b70[_0x35fc('0x3d')]=[{'all':!![]}];}_0x211b70=_[_0x35fc('0x3b')]({},_0x211b70,_0x331439[_0x35fc('0x42')]);return db[_0x35fc('0x29')]['find'](_0x211b70)[_0x35fc('0x24')](handleEntityNotFound(_0x2a1cf6,null))[_0x35fc('0x24')](respondWithResult(_0x2a1cf6,null))['catch'](handleError(_0x2a1cf6,null));};exports[_0x35fc('0x43')]=function(_0x298b7b,_0x2a8a09){return db[_0x35fc('0x29')]['create'](_0x298b7b[_0x35fc('0x44')],{})['then'](respondWithResult(_0x2a8a09,0xc9))['catch'](handleError(_0x2a8a09,null));};exports[_0x35fc('0x23')]=function(_0x9db7e8,_0x18dc78){if(_0x9db7e8[_0x35fc('0x44')]['id']){delete _0x9db7e8[_0x35fc('0x44')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x9db7e8[_0x35fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x24')](saveUpdates(_0x9db7e8[_0x35fc('0x44')],null))[_0x35fc('0x24')](respondWithResult(_0x18dc78,null))[_0x35fc('0x40')](handleError(_0x18dc78,null));};exports[_0x35fc('0x25')]=function(_0x1e3221,_0x1b8229){return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x1e3221[_0x35fc('0x46')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x1b8229,null))[_0x35fc('0x24')](removeEntity(_0x1b8229,null))[_0x35fc('0x40')](handleError(_0x1b8229,null));};exports[_0x35fc('0x47')]=function(_0x59c666,_0x553ed6){return db[_0x35fc('0x29')][_0x35fc('0x47')]()[_0x35fc('0x24')](respondWithResult(_0x553ed6,null))[_0x35fc('0x40')](handleError(_0x553ed6,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index f194d4a..e40201d 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(_0x4a7f34,_0x246929){var _0x5b0d32=function(_0x4ae36d){while(--_0x4ae36d){_0x4a7f34['push'](_0x4a7f34['shift']());}};_0x5b0d32(++_0x246929);}(_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':'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x54b82a,_0x3ea2d3){var _0x3447ed=function(_0x3e0a42){while(--_0x3e0a42){_0x54b82a['push'](_0x54b82a['shift']());}};_0x3447ed(++_0x3ea2d3);}(_0x7a54,0x106));var _0x47a5=function(_0x2b987c,_0x17b58e){_0x2b987c=_0x2b987c-0x0;var _0x258c25=_0x7a54[_0x2b987c];return _0x258c25;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 0c886d4..4bdf7ca 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 _0xee51=['debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1964eb,_0x5bb316){var _0x2c74c3=function(_0x55e8e6){while(--_0x55e8e6){_0x1964eb['push'](_0x1964eb['shift']());}};_0x2c74c3(++_0x5bb316);}(_0xee51,0x16e));var _0x1ee5=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0xee51[_0x2867a6];return _0x4afc2b;};'use strict';var _=require(_0x1ee5('0x0'));var util=require(_0x1ee5('0x1'));var moment=require(_0x1ee5('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ee5('0x3'));var fs=require('fs');var Redis=require(_0x1ee5('0x4'));var db=require(_0x1ee5('0x5'))['db'];var utils=require(_0x1ee5('0x6'));var logger=require(_0x1ee5('0x7'))('rpc');var config=require(_0x1ee5('0x8'));var jayson=require(_0x1ee5('0x9'));var client=jayson[_0x1ee5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58d3a1,_0x5c4a7d,_0x4564da){return new BPromise(function(_0x50709b,_0x413dcd){return client[_0x1ee5('0xb')](_0x58d3a1,_0x4564da)['then'](function(_0x413c96){logger['info'](_0x1ee5('0xc'),_0x5c4a7d,_0x1ee5('0xd'));logger[_0x1ee5('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5c4a7d,_0x1ee5('0xd'),JSON[_0x1ee5('0xf')](_0x413c96));if(_0x413c96[_0x1ee5('0x10')]){if(_0x413c96['error'][_0x1ee5('0x11')]===0x1f4){logger[_0x1ee5('0x10')](_0x1ee5('0xc'),_0x5c4a7d,_0x413c96[_0x1ee5('0x10')][_0x1ee5('0x12')]);return _0x413dcd(_0x413c96[_0x1ee5('0x10')]['message']);}logger[_0x1ee5('0x10')](_0x1ee5('0xc'),_0x5c4a7d,_0x413c96['error'][_0x1ee5('0x12')]);return _0x50709b(_0x413c96[_0x1ee5('0x10')]['message']);}else{logger['info'](_0x1ee5('0xc'),_0x5c4a7d,_0x1ee5('0xd'));_0x50709b(_0x413c96[_0x1ee5('0x13')][_0x1ee5('0x12')]);}})['catch'](function(_0x26a781){logger[_0x1ee5('0x10')]('Cdr,\x20%s,\x20%s',_0x5c4a7d,_0x26a781);_0x413dcd(_0x26a781);});});} \ No newline at end of file +var _0xf8f7=['Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x565472,_0x56f47){var _0x34d5ef=function(_0x2150f6){while(--_0x2150f6){_0x565472['push'](_0x565472['shift']());}};_0x34d5ef(++_0x56f47);}(_0xf8f7,0x163));var _0x7f8f=function(_0x32a3d4,_0x2779f1){_0x32a3d4=_0x32a3d4-0x0;var _0x332a6f=_0xf8f7[_0x32a3d4];return _0x332a6f;};'use strict';var _=require('lodash');var util=require(_0x7f8f('0x0'));var moment=require('moment');var BPromise=require(_0x7f8f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f8f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f8f('0x3'));var logger=require(_0x7f8f('0x4'))(_0x7f8f('0x5'));var config=require(_0x7f8f('0x6'));var jayson=require(_0x7f8f('0x7'));var client=jayson[_0x7f8f('0x8')][_0x7f8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53a4c4,_0x7e95d1,_0x1ed517){return new BPromise(function(_0x3aa327,_0x1c2284){return client[_0x7f8f('0xa')](_0x53a4c4,_0x1ed517)[_0x7f8f('0xb')](function(_0x224f52){logger[_0x7f8f('0xc')](_0x7f8f('0xd'),_0x7e95d1,'request\x20sent');logger[_0x7f8f('0xe')](_0x7f8f('0xf'),_0x7e95d1,_0x7f8f('0x10'),JSON[_0x7f8f('0x11')](_0x224f52));if(_0x224f52[_0x7f8f('0x12')]){if(_0x224f52['error'][_0x7f8f('0x13')]===0x1f4){logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);return _0x1c2284(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52['error'][_0x7f8f('0x14')]);return _0x3aa327(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}else{logger['info'](_0x7f8f('0xd'),_0x7e95d1,_0x7f8f('0x10'));_0x3aa327(_0x224f52[_0x7f8f('0x15')][_0x7f8f('0x14')]);}})[_0x7f8f('0x16')](function(_0x3c0b71){logger['error']('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x3c0b71);_0x1c2284(_0x3c0b71);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3879ae0..cc883db 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(_0x40c5e0,_0x3b77ad){var _0x47ee12=function(_0x3c7009){while(--_0x3c7009){_0x40c5e0['push'](_0x40c5e0['shift']());}};_0x47ee12(++_0x3b77ad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x524021,_0x25d5ea){var _0x269c3e=function(_0x2418a5){while(--_0x2418a5){_0x524021['push'](_0x524021['shift']());}};_0x269c3e(++_0x25d5ea);}(_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 b1b36c1..45eed2f 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 _0x1790=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x48d7a0,_0x1e2ba8){var _0x28a502=function(_0x3dc381){while(--_0x3dc381){_0x48d7a0['push'](_0x48d7a0['shift']());}};_0x28a502(++_0x1e2ba8);}(_0x1790,0x1a4));var _0x0179=function(_0x522279,_0x385259){_0x522279=_0x522279-0x0;var _0x477f7c=_0x1790[_0x522279];return _0x477f7c;};'use strict';var Sequelize=require('sequelize');module[_0x0179('0x0')]={'priority':{'type':Sequelize[_0x0179('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0179('0x2')],'allowNull':![],'defaultValue':_0x0179('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0179('0x2')],'defaultValue':_0x0179('0x4')}}; \ No newline at end of file +var _0x2dfb=['TEXT','STRING','exports','INTEGER','noop'];(function(_0x39f3dc,_0x535b20){var _0x1362af=function(_0x4d4870){while(--_0x4d4870){_0x39f3dc['push'](_0x39f3dc['shift']());}};_0x1362af(++_0x535b20);}(_0x2dfb,0x16f));var _0xb2df=function(_0xbf84f7,_0x26643b){_0xbf84f7=_0xbf84f7-0x0;var _0x55ef36=_0x2dfb[_0xbf84f7];return _0x55ef36;};'use strict';var Sequelize=require('sequelize');module[_0xb2df('0x0')]={'priority':{'type':Sequelize[_0xb2df('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2df('0x2')},'appdata':{'type':Sequelize[_0xb2df('0x3')]()},'description':{'type':Sequelize[_0xb2df('0x4')]},'interval':{'type':Sequelize[_0xb2df('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2181d21..1f6b6c8 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 _0x85b5=['attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','params','destroy','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','show','model','keys','rawAttributes','query','filters','intersection'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x85b5,0x7f));var _0x585b=function(_0x190f8e,_0x4919b9){_0x190f8e=_0x190f8e-0x0;var _0x11819f=_0x85b5[_0x190f8e];return _0x11819f;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={'raw':!![],'where':{'id':_0x205ffe['params']['id']}},_0x5dad9a={};_0x5dad9a[_0x585b('0x26')]=_[_0x585b('0x27')](db['ChatApplication'][_0x585b('0x28')]);_0x5dad9a[_0x585b('0x29')]=_['keys'](_0x205ffe[_0x585b('0x29')]);_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],_0x5dad9a[_0x585b('0x29')]);_0x2cf48a[_0x585b('0x2c')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],qs[_0x585b('0x2d')](_0x205ffe[_0x585b('0x29')]['fields']));_0x2cf48a[_0x585b('0x2c')]=_0x2cf48a[_0x585b('0x2c')][_0x585b('0x2e')]?_0x2cf48a['attributes']:_0x5dad9a[_0x585b('0x26')];if(_0x205ffe[_0x585b('0x29')][_0x585b('0x2f')]){_0x2cf48a['include']=[{'all':!![]}];}_0x2cf48a=_[_0x585b('0x30')]({},_0x2cf48a,_0x205ffe[_0x585b('0x31')]);return db[_0x585b('0x32')][_0x585b('0x33')](_0x2cf48a)['then'](handleEntityNotFound(_0x19786,null))['then'](respondWithResult(_0x19786,null))[_0x585b('0x34')](handleError(_0x19786,null));};exports[_0x585b('0x35')]=function(_0x411914,_0x31918f){if(_0x411914[_0x585b('0x36')]['id']){delete _0x411914['body']['id'];}return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x411914[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x31918f,null))[_0x585b('0x20')](saveUpdates(_0x411914['body'],null))['then'](respondWithResult(_0x31918f,null))['catch'](handleError(_0x31918f,null));};exports[_0x585b('0x38')]=function(_0x199e54,_0x2c4b9f){return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x199e54[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x2c4b9f,null))[_0x585b('0x20')](removeEntity(_0x2c4b9f,null))[_0x585b('0x34')](handleError(_0x2c4b9f,null));}; \ No newline at end of file +var _0x5f6a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','update','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','name','send'];(function(_0xa149e2,_0x571fff){var _0x556c0c=function(_0x5aca0a){while(--_0x5aca0a){_0xa149e2['push'](_0xa149e2['shift']());}};_0x556c0c(++_0x571fff);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x2a4cdc,_0x45c9cb){_0x2a4cdc=_0x2a4cdc-0x0;var _0x14de55=_0x5f6a[_0x2a4cdc];return _0x14de55;};'use strict';var emlformat=require(_0xa5f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f6('0x1'));var rp=require(_0xa5f6('0x2'));var moment=require(_0xa5f6('0x3'));var BPromise=require(_0xa5f6('0x4'));var Mustache=require('mustache');var util=require(_0xa5f6('0x5'));var path=require(_0xa5f6('0x6'));var sox=require(_0xa5f6('0x7'));var csv=require(_0xa5f6('0x8'));var ejs=require(_0xa5f6('0x9'));var fs=require('fs');var fs_extra=require(_0xa5f6('0xa'));var _=require(_0xa5f6('0xb'));var squel=require(_0xa5f6('0xc'));var crypto=require(_0xa5f6('0xd'));var jsforce=require(_0xa5f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5f6('0xf'));var Redis=require(_0xa5f6('0x10'));var authService=require(_0xa5f6('0x11'));var qs=require(_0xa5f6('0x12'));var as=require(_0xa5f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5f6('0x14'))(_0xa5f6('0x15'));var utils=require('../../config/utils');var config=require(_0xa5f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5f6('0x17'))['db'];function respondWithStatusCode(_0x483f66,_0x13c988){_0x13c988=_0x13c988||0xcc;return function(_0xc8eb34){if(_0xc8eb34){return _0x483f66['sendStatus'](_0x13c988);}return _0x483f66[_0xa5f6('0x18')](_0x13c988)[_0xa5f6('0x19')]();};}function respondWithResult(_0x2919fd,_0xd8faf3){_0xd8faf3=_0xd8faf3||0xc8;return function(_0x5c507e){if(_0x5c507e){return _0x2919fd[_0xa5f6('0x18')](_0xd8faf3)[_0xa5f6('0x1a')](_0x5c507e);}};}function respondWithFilteredResult(_0x17f7f7,_0x5dc17b){return function(_0x3b4780){if(_0x3b4780){var _0x3b2b23=typeof _0x5dc17b[_0xa5f6('0x1b')]===_0xa5f6('0x1c')&&typeof _0x5dc17b[_0xa5f6('0x1d')]==='undefined';var _0x2cc215=_0x3b4780[_0xa5f6('0x1e')];var _0x4ee2cc=_0x3b2b23?0x0:_0x5dc17b[_0xa5f6('0x1b')];var _0x20f35d=_0x3b2b23?_0x3b4780[_0xa5f6('0x1e')]:_0x5dc17b['offset']+_0x5dc17b['limit'];var _0x57a416;if(_0x20f35d>=_0x2cc215){_0x20f35d=_0x2cc215;_0x57a416=0xc8;}else{_0x57a416=0xce;}_0x17f7f7[_0xa5f6('0x18')](_0x57a416);return _0x17f7f7['set'](_0xa5f6('0x1f'),_0x4ee2cc+'-'+_0x20f35d+'/'+_0x2cc215)[_0xa5f6('0x1a')](_0x3b4780);}return null;};}function patchUpdates(_0x29f8fb){return function(_0x5b2a48){try{jsonpatch[_0xa5f6('0x20')](_0x5b2a48,_0x29f8fb,!![]);}catch(_0x55f457){return BPromise[_0xa5f6('0x21')](_0x55f457);}return _0x5b2a48[_0xa5f6('0x22')]();};}function saveUpdates(_0x30caba,_0x471628){return function(_0x37ff20){if(_0x37ff20){return _0x37ff20['update'](_0x30caba)['then'](function(_0x41b66b){return _0x41b66b;});}return null;};}function removeEntity(_0x49e609,_0x4441cc){return function(_0x50e9ba){if(_0x50e9ba){return _0x50e9ba[_0xa5f6('0x23')]()[_0xa5f6('0x24')](function(){_0x49e609[_0xa5f6('0x18')](0xcc)[_0xa5f6('0x19')]();});}};}function handleEntityNotFound(_0x3ef9fb,_0x220992){return function(_0x7613c4){if(!_0x7613c4){_0x3ef9fb[_0xa5f6('0x25')](0x194);}return _0x7613c4;};}function handleError(_0x1c08d3,_0x1ded63){_0x1ded63=_0x1ded63||0x1f4;return function(_0x1e02d9){logger['error'](_0x1e02d9['stack']);if(_0x1e02d9[_0xa5f6('0x26')]){delete _0x1e02d9[_0xa5f6('0x26')];}_0x1c08d3[_0xa5f6('0x18')](_0x1ded63)[_0xa5f6('0x27')](_0x1e02d9);};}exports[_0xa5f6('0x28')]=function(_0x8cab41,_0x5ac06e){var _0x273192={'raw':!![],'where':{'id':_0x8cab41[_0xa5f6('0x29')]['id']}},_0x43fe1d={};_0x43fe1d[_0xa5f6('0x2a')]=_[_0xa5f6('0x2b')](db[_0xa5f6('0x2c')][_0xa5f6('0x2d')]);_0x43fe1d[_0xa5f6('0x2e')]=_['keys'](_0x8cab41[_0xa5f6('0x2e')]);_0x43fe1d[_0xa5f6('0x2f')]=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],_0x43fe1d[_0xa5f6('0x2e')]);_0x273192['attributes']=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],qs[_0xa5f6('0x31')](_0x8cab41['query'][_0xa5f6('0x31')]));_0x273192[_0xa5f6('0x32')]=_0x273192[_0xa5f6('0x32')][_0xa5f6('0x33')]?_0x273192[_0xa5f6('0x32')]:_0x43fe1d['model'];if(_0x8cab41[_0xa5f6('0x2e')][_0xa5f6('0x34')]){_0x273192[_0xa5f6('0x35')]=[{'all':!![]}];}_0x273192=_[_0xa5f6('0x36')]({},_0x273192,_0x8cab41['options']);return db[_0xa5f6('0x2c')][_0xa5f6('0x37')](_0x273192)[_0xa5f6('0x24')](handleEntityNotFound(_0x5ac06e,null))[_0xa5f6('0x24')](respondWithResult(_0x5ac06e,null))['catch'](handleError(_0x5ac06e,null));};exports[_0xa5f6('0x38')]=function(_0x42bba2,_0x3ff708){if(_0x42bba2[_0xa5f6('0x39')]['id']){delete _0x42bba2[_0xa5f6('0x39')]['id'];}return db[_0xa5f6('0x2c')]['find']({'where':{'id':_0x42bba2[_0xa5f6('0x29')]['id']}})['then'](handleEntityNotFound(_0x3ff708,null))[_0xa5f6('0x24')](saveUpdates(_0x42bba2['body'],null))['then'](respondWithResult(_0x3ff708,null))[_0xa5f6('0x3a')](handleError(_0x3ff708,null));};exports['destroy']=function(_0x115a73,_0x357dee){return db['ChatApplication'][_0xa5f6('0x37')]({'where':{'id':_0x115a73['params']['id']}})['then'](handleEntityNotFound(_0x357dee,null))['then'](removeEntity(_0x357dee,null))[_0xa5f6('0x3a')](handleError(_0x357dee,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 5f449b2..57c002a 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 _0x7576=['exports','chat_applications','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes'];(function(_0x59c568,_0x29bff0){var _0x48c741=function(_0xccde92){while(--_0xccde92){_0x59c568['push'](_0x59c568['shift']());}};_0x48c741(++_0x29bff0);}(_0x7576,0x1d8));var _0x6757=function(_0x144bb0,_0xfcf538){_0x144bb0=_0x144bb0-0x0;var _0x526122=_0x7576[_0x144bb0];return _0x526122;};'use strict';var _=require(_0x6757('0x0'));var util=require('util');var logger=require(_0x6757('0x1'))('api');var moment=require(_0x6757('0x2'));var BPromise=require(_0x6757('0x3'));var rp=require(_0x6757('0x4'));var fs=require('fs');var path=require(_0x6757('0x5'));var rimraf=require(_0x6757('0x6'));var config=require('../../config/environment');var attributes=require(_0x6757('0x7'));module[_0x6757('0x8')]=function(_0x217dfc,_0x1d9431){return _0x217dfc['define']('ChatApplication',attributes,{'tableName':_0x6757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3c75=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x57f2f4,_0x4addf1){var _0x4d147b=function(_0x171249){while(--_0x171249){_0x57f2f4['push'](_0x57f2f4['shift']());}};_0x4d147b(++_0x4addf1);}(_0x3c75,0xa8));var _0x53c7=function(_0x9fc983,_0xc0a1af){_0x9fc983=_0x9fc983-0x0;var _0x5d8ed9=_0x3c75[_0x9fc983];return _0x5d8ed9;};'use strict';var _=require('lodash');var util=require(_0x53c7('0x0'));var logger=require(_0x53c7('0x1'))(_0x53c7('0x2'));var moment=require(_0x53c7('0x3'));var BPromise=require(_0x53c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c7('0x5'));var rimraf=require(_0x53c7('0x6'));var config=require(_0x53c7('0x7'));var attributes=require(_0x53c7('0x8'));module[_0x53c7('0x9')]=function(_0x1c3e5a,_0x3238da){return _0x1c3e5a['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53c7('0xa'),'collate':_0x53c7('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index cb42a67..690eb6b 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 _0x8b3f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x13ca07,_0x22b8ef){var _0x48782e=function(_0x1c7850){while(--_0x1c7850){_0x13ca07['push'](_0x13ca07['shift']());}};_0x48782e(++_0x22b8ef);}(_0x8b3f,0x14c));var _0xf8b3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8b3f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf8b3('0x0'));var util=require(_0xf8b3('0x1'));var moment=require(_0xf8b3('0x2'));var BPromise=require(_0xf8b3('0x3'));var rs=require(_0xf8b3('0x4'));var fs=require('fs');var Redis=require(_0xf8b3('0x5'));var db=require(_0xf8b3('0x6'))['db'];var utils=require(_0xf8b3('0x7'));var logger=require(_0xf8b3('0x8'))('rpc');var config=require(_0xf8b3('0x9'));var jayson=require(_0xf8b3('0xa'));var client=jayson[_0xf8b3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4eb3,_0x2b2d55,_0x455ecd){return new BPromise(function(_0x41c5b7,_0x24c3b1){return client['request'](_0x4f4eb3,_0x455ecd)[_0xf8b3('0xc')](function(_0x3509b){logger[_0xf8b3('0xd')](_0xf8b3('0xe'),_0x2b2d55,_0xf8b3('0xf'));logger[_0xf8b3('0x10')](_0xf8b3('0x11'),_0x2b2d55,_0xf8b3('0xf'),JSON[_0xf8b3('0x12')](_0x3509b));if(_0x3509b[_0xf8b3('0x13')]){if(_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x14')]===0x1f4){logger[_0xf8b3('0x13')](_0xf8b3('0xe'),_0x2b2d55,_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);return _0x24c3b1(_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);}logger[_0xf8b3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2b2d55,_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);return _0x41c5b7(_0x3509b[_0xf8b3('0x13')]['message']);}else{logger[_0xf8b3('0xd')](_0xf8b3('0xe'),_0x2b2d55,_0xf8b3('0xf'));_0x41c5b7(_0x3509b[_0xf8b3('0x16')][_0xf8b3('0x15')]);}})[_0xf8b3('0x17')](function(_0x5d6039){logger[_0xf8b3('0x13')](_0xf8b3('0xe'),_0x2b2d55,_0x5d6039);_0x24c3b1(_0x5d6039);});});} \ No newline at end of file +var _0x5c81=['request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5a5848,_0x3b8fb2){var _0x9fe6d7=function(_0x5aac17){while(--_0x5aac17){_0x5a5848['push'](_0x5a5848['shift']());}};_0x9fe6d7(++_0x3b8fb2);}(_0x5c81,0x7e));var _0x15c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c81[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x15c8('0x0'));var util=require(_0x15c8('0x1'));var moment=require(_0x15c8('0x2'));var BPromise=require(_0x15c8('0x3'));var rs=require(_0x15c8('0x4'));var fs=require('fs');var Redis=require(_0x15c8('0x5'));var db=require(_0x15c8('0x6'))['db'];var utils=require(_0x15c8('0x7'));var logger=require(_0x15c8('0x8'))(_0x15c8('0x9'));var config=require(_0x15c8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x15c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc685b0,_0x19d851,_0x39bcd9){return new BPromise(function(_0x2c0ab0,_0x3e6435){return client[_0x15c8('0xc')](_0xc685b0,_0x39bcd9)[_0x15c8('0xd')](function(_0x3bb956){logger[_0x15c8('0xe')]('ChatApplication,\x20%s,\x20%s',_0x19d851,_0x15c8('0xf'));logger[_0x15c8('0x10')](_0x15c8('0x11'),_0x19d851,_0x15c8('0xf'),JSON[_0x15c8('0x12')](_0x3bb956));if(_0x3bb956[_0x15c8('0x13')]){if(_0x3bb956['error']['code']===0x1f4){logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);return _0x3e6435(_0x3bb956[_0x15c8('0x13')]['message']);}logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')]['message']);return _0x2c0ab0(_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);}else{logger[_0x15c8('0xe')](_0x15c8('0x14'),_0x19d851,_0x15c8('0xf'));_0x2c0ab0(_0x3bb956[_0x15c8('0x16')][_0x15c8('0x15')]);}})['catch'](function(_0xe891a9){logger[_0x15c8('0x13')](_0x15c8('0x14'),_0x19d851,_0xe891a9);_0x3e6435(_0xe891a9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3a10e50..9eb57bd 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 _0xdcaa=['connect-timeout','express','Router','fs-extra','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','util','path'];(function(_0x6a3773,_0x2ddb5d){var _0x51d80a=function(_0x4c77fa){while(--_0x4c77fa){_0x6a3773['push'](_0x6a3773['shift']());}};_0x51d80a(++_0x2ddb5d);}(_0xdcaa,0x14e));var _0xadca=function(_0xc08b7,_0x28a0d9){_0xc08b7=_0xc08b7-0x0;var _0x1da626=_0xdcaa[_0xc08b7];return _0x1da626;};'use strict';var multer=require('multer');var util=require(_0xadca('0x0'));var path=require(_0xadca('0x1'));var timeout=require(_0xadca('0x2'));var express=require(_0xadca('0x3'));var router=express[_0xadca('0x4')]();var fs_extra=require(_0xadca('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xadca('0x6'));router[_0xadca('0x7')](_0xadca('0x8'),auth[_0xadca('0x9')](),controller[_0xadca('0xa')]);router[_0xadca('0xb')]('/:id',auth[_0xadca('0x9')](),controller['update']);router[_0xadca('0xc')](_0xadca('0x8'),auth[_0xadca('0x9')](),controller['destroy']);module[_0xadca('0xd')]=router; \ No newline at end of file +var _0x4cc7=['put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4cc7,0x134));var _0x74cc=function(_0x580f5e,_0x2b92fd){_0x580f5e=_0x580f5e-0x0;var _0x5b7812=_0x4cc7[_0x580f5e];return _0x5b7812;};'use strict';var multer=require(_0x74cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x74cc('0x1'));var express=require(_0x74cc('0x2'));var router=express[_0x74cc('0x3')]();var fs_extra=require(_0x74cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x74cc('0x5'));var config=require(_0x74cc('0x6'));var controller=require(_0x74cc('0x7'));router[_0x74cc('0x8')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xb')]);router[_0x74cc('0xc')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller['update']);router[_0x74cc('0xd')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xe')]);module[_0x74cc('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 47de148..5205047 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 _0xb1d2=['STRING','BOOLEAN'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb1d2,0x116));var _0x2b1d=function(_0x1bc368,_0x3900b8){_0x1bc368=_0x1bc368-0x0;var _0x18808d=_0xb1d2[_0x1bc368];return _0x18808d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b1d('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x2b1d('0x0')]},'write':{'type':Sequelize[_0x2b1d('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4b36=['STRING','BOOLEAN','sequelize'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4b36,0xcb));var _0x64b3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4b36[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x64b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x64b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x64b3('0x1')]},'write':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8daf782..9181857 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 _0x3229=['sort','nolimit','removeMembers','ChatGroupId','findOne','pick','$gte','format','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers'];(function(_0x228058,_0x5f30e8){var _0x2ad92d=function(_0x459963){while(--_0x459963){_0x228058['push'](_0x228058['shift']());}};_0x2ad92d(++_0x5f30e8);}(_0x3229,0x17d));var _0x9322=function(_0x32a7f8,_0x1bbc99){_0x32a7f8=_0x32a7f8-0x0;var _0x399dc2=_0x3229[_0x32a7f8];return _0x399dc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9322('0x0'));var zipdir=require(_0x9322('0x1'));var jsonpatch=require(_0x9322('0x2'));var rp=require(_0x9322('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9322('0x4'));var util=require(_0x9322('0x5'));var path=require('path');var sox=require(_0x9322('0x6'));var csv=require(_0x9322('0x7'));var ejs=require(_0x9322('0x8'));var fs=require('fs');var fs_extra=require(_0x9322('0x9'));var _=require(_0x9322('0xa'));var squel=require(_0x9322('0xb'));var crypto=require(_0x9322('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9322('0xd'));var toCsv=require(_0x9322('0x7'));var querystring=require('querystring');var Papa=require(_0x9322('0xe'));var Redis=require(_0x9322('0xf'));var authService=require(_0x9322('0x10'));var qs=require(_0x9322('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9322('0x12'));var logger=require(_0x9322('0x13'))(_0x9322('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9322('0x15')]=_[_0x9322('0x16')](config[_0x9322('0x15')],{'host':_0x9322('0x17'),'port':0x18eb});var socket=require(_0x9322('0x18'))(new Redis(config[_0x9322('0x15')]));require('./chatGroup.socket')[_0x9322('0x19')](socket);function respondWithStatusCode(_0x2b191a,_0x2e0e83){_0x2e0e83=_0x2e0e83||0xcc;return function(_0x1ff072){if(_0x1ff072){return _0x2b191a[_0x9322('0x1a')](_0x2e0e83);}return _0x2b191a[_0x9322('0x1b')](_0x2e0e83)[_0x9322('0x1c')]();};}function respondWithResult(_0x3b3a47,_0x221336){_0x221336=_0x221336||0xc8;return function(_0xa29a68){if(_0xa29a68){return _0x3b3a47[_0x9322('0x1b')](_0x221336)['json'](_0xa29a68);}};}function respondWithFilteredResult(_0x19c8f7,_0x7f0e59){return function(_0x18b09e){if(_0x18b09e){var _0x198456=typeof _0x7f0e59[_0x9322('0x1d')]===_0x9322('0x1e')&&typeof _0x7f0e59['limit']===_0x9322('0x1e');var _0x33bd18=_0x18b09e['count'];var _0xd033ea=_0x198456?0x0:_0x7f0e59[_0x9322('0x1d')];var _0x5e192c=_0x198456?_0x18b09e[_0x9322('0x1f')]:_0x7f0e59[_0x9322('0x1d')]+_0x7f0e59[_0x9322('0x20')];var _0x4b4dfe;if(_0x5e192c>=_0x33bd18){_0x5e192c=_0x33bd18;_0x4b4dfe=0xc8;}else{_0x4b4dfe=0xce;}_0x19c8f7['status'](_0x4b4dfe);return _0x19c8f7[_0x9322('0x21')](_0x9322('0x22'),_0xd033ea+'-'+_0x5e192c+'/'+_0x33bd18)[_0x9322('0x23')](_0x18b09e);}return null;};}function patchUpdates(_0x308ac1){return function(_0x841ab9){try{jsonpatch[_0x9322('0x24')](_0x841ab9,_0x308ac1,!![]);}catch(_0x5af7ab){return BPromise[_0x9322('0x25')](_0x5af7ab);}return _0x841ab9[_0x9322('0x26')]();};}function saveUpdates(_0x4cce0b,_0x3ad72d){return function(_0x9239fb){if(_0x9239fb){return _0x9239fb[_0x9322('0x27')](_0x4cce0b)['then'](function(_0x1e92cb){return _0x1e92cb;});}return null;};}function removeEntity(_0x53bfe2,_0x779295){return function(_0x509bd1){if(_0x509bd1){return _0x509bd1[_0x9322('0x28')]()[_0x9322('0x29')](function(){_0x53bfe2[_0x9322('0x1b')](0xcc)[_0x9322('0x1c')]();});}};}function handleEntityNotFound(_0x5ff0f9,_0x3418a7){return function(_0x2d26d8){if(!_0x2d26d8){_0x5ff0f9[_0x9322('0x1a')](0x194);}return _0x2d26d8;};}function handleError(_0x4fb3df,_0x2e3334){_0x2e3334=_0x2e3334||0x1f4;return function(_0x47fe63){logger[_0x9322('0x2a')](_0x47fe63[_0x9322('0x2b')]);if(_0x47fe63[_0x9322('0x2c')]){delete _0x47fe63[_0x9322('0x2c')];}_0x4fb3df[_0x9322('0x1b')](_0x2e3334)['send'](_0x47fe63);};}exports[_0x9322('0x2d')]=function(_0x41d8f8,_0x721d91){var _0x324096={},_0x3bdd8f={},_0x2ed329={'count':0x0,'rows':[]};var _0x84642d=_[_0x9322('0x2e')](db[_0x9322('0x2f')][_0x9322('0x30')],function(_0x52e25e){return{'name':_0x52e25e[_0x9322('0x31')],'type':_0x52e25e[_0x9322('0x32')]['key']};});_0x3bdd8f[_0x9322('0x33')]=_['map'](_0x84642d,_0x9322('0x2c'));_0x3bdd8f[_0x9322('0x34')]=_[_0x9322('0x35')](_0x41d8f8[_0x9322('0x34')]);_0x3bdd8f[_0x9322('0x36')]=_['intersection'](_0x3bdd8f[_0x9322('0x33')],_0x3bdd8f[_0x9322('0x34')]);_0x324096[_0x9322('0x37')]=_[_0x9322('0x38')](_0x3bdd8f['model'],qs[_0x9322('0x39')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x39')]));_0x324096[_0x9322('0x37')]=_0x324096[_0x9322('0x37')]['length']?_0x324096[_0x9322('0x37')]:_0x3bdd8f[_0x9322('0x33')];if(!_0x41d8f8[_0x9322('0x34')][_0x9322('0x3a')]('nolimit')){_0x324096[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x20')]);_0x324096[_0x9322('0x1d')]=qs[_0x9322('0x1d')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x1d')]);}_0x324096[_0x9322('0x3b')]=qs['sort'](_0x41d8f8['query']['sort']);_0x324096[_0x9322('0x3c')]=qs['filters'](_['pick'](_0x41d8f8[_0x9322('0x34')],_0x3bdd8f[_0x9322('0x36')]),_0x84642d);if(_0x41d8f8[_0x9322('0x34')][_0x9322('0x3d')]){_0x324096[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x324096['where'],{'$or':_[_0x9322('0x2e')](_0x84642d,function(_0x364cad){if(_0x364cad[_0x9322('0x32')]!==_0x9322('0x3f')){var _0x1aa8fe={};_0x1aa8fe[_0x364cad[_0x9322('0x2c')]]={'$like':'%'+_0x41d8f8[_0x9322('0x34')]['filter']+'%'};return _0x1aa8fe;}})});}_0x324096=_['merge']({},_0x324096,_0x41d8f8[_0x9322('0x40')]);var _0x5cc57f={'where':_0x324096[_0x9322('0x3c')]};return db[_0x9322('0x2f')][_0x9322('0x1f')](_0x5cc57f)[_0x9322('0x29')](function(_0x31f970){_0x2ed329[_0x9322('0x1f')]=_0x31f970;if(_0x41d8f8[_0x9322('0x34')][_0x9322('0x41')]){_0x324096['include']=[{'all':!![]}];}return db[_0x9322('0x2f')][_0x9322('0x42')](_0x324096);})[_0x9322('0x29')](function(_0x320a35){_0x2ed329[_0x9322('0x43')]=_0x320a35;return _0x2ed329;})[_0x9322('0x29')](respondWithFilteredResult(_0x721d91,_0x324096))['catch'](handleError(_0x721d91,null));};exports['show']=function(_0x38c28b,_0xaf6745){var _0x57993c={'raw':!![],'where':{'id':_0x38c28b[_0x9322('0x44')]['id']}},_0xf4db25={};_0xf4db25[_0x9322('0x33')]=_[_0x9322('0x35')](db[_0x9322('0x2f')]['rawAttributes']);_0xf4db25[_0x9322('0x34')]=_[_0x9322('0x35')](_0x38c28b[_0x9322('0x34')]);_0xf4db25[_0x9322('0x36')]=_[_0x9322('0x38')](_0xf4db25[_0x9322('0x33')],_0xf4db25[_0x9322('0x34')]);_0x57993c[_0x9322('0x37')]=_['intersection'](_0xf4db25['model'],qs['fields'](_0x38c28b[_0x9322('0x34')][_0x9322('0x39')]));_0x57993c[_0x9322('0x37')]=_0x57993c[_0x9322('0x37')][_0x9322('0x45')]?_0x57993c[_0x9322('0x37')]:_0xf4db25[_0x9322('0x33')];if(_0x38c28b[_0x9322('0x34')]['includeAll']){_0x57993c[_0x9322('0x46')]=[{'all':!![]}];}_0x57993c=_[_0x9322('0x3e')]({},_0x57993c,_0x38c28b[_0x9322('0x40')]);return db[_0x9322('0x2f')][_0x9322('0x47')](_0x57993c)['then'](handleEntityNotFound(_0xaf6745,null))[_0x9322('0x29')](respondWithResult(_0xaf6745,null))[_0x9322('0x48')](handleError(_0xaf6745,null));};exports[_0x9322('0x49')]=function(_0xf058dd,_0x5ce7f1){return db[_0x9322('0x2f')][_0x9322('0x49')](_0xf058dd[_0x9322('0x4a')],{})[_0x9322('0x29')](respondWithResult(_0x5ce7f1,0xc9))[_0x9322('0x48')](handleError(_0x5ce7f1,null));};exports[_0x9322('0x27')]=function(_0x232fa0,_0x43ced9){if(_0x232fa0[_0x9322('0x4a')]['id']){delete _0x232fa0[_0x9322('0x4a')]['id'];}return db[_0x9322('0x2f')]['find']({'where':{'id':_0x232fa0['params']['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x43ced9,null))[_0x9322('0x29')](saveUpdates(_0x232fa0['body'],null))[_0x9322('0x29')](respondWithResult(_0x43ced9,null))[_0x9322('0x48')](handleError(_0x43ced9,null));};exports[_0x9322('0x28')]=function(_0x5e0b58,_0x13bfe0){return db['ChatGroup'][_0x9322('0x47')]({'where':{'id':_0x5e0b58[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x13bfe0,null))[_0x9322('0x29')](removeEntity(_0x13bfe0,null))['catch'](handleError(_0x13bfe0,null));};exports['describe']=function(_0x2e902a,_0x1703b8){return db[_0x9322('0x2f')][_0x9322('0x4b')]()['then'](respondWithResult(_0x1703b8,null))['catch'](handleError(_0x1703b8,null));};exports[_0x9322('0x4c')]=function(_0x5aca32,_0x1f8d90,_0x3f511e){return db[_0x9322('0x4d')][_0x9322('0x1f')]({'where':{'ChatGroupId':_0x5aca32[_0x9322('0x44')]['id'],'ToId':_0x5aca32[_0x9322('0x4e')]['id'],'read':![]}})[_0x9322('0x29')](function(_0x576b97){return{'id':_[_0x9322('0x4f')](_0x5aca32[_0x9322('0x44')]['id']),'count':_0x576b97};})[_0x9322('0x29')](respondWithResult(_0x1f8d90,null))[_0x9322('0x48')](handleError(_0x1f8d90,null));};exports[_0x9322('0x50')]=function(_0x290e4f,_0x51af7f,_0x50914a){return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x290e4f[_0x9322('0x44')]['id']}})['then'](handleEntityNotFound(_0x51af7f,null))[_0x9322('0x29')](function(_0x12b8e7){if(_0x12b8e7){return _0x12b8e7['addMembers'](_0x290e4f[_0x9322('0x4a')]['ids'],_[_0x9322('0x51')](_0x290e4f[_0x9322('0x4a')],[_0x9322('0x52'),'id'])||{});}})['then'](respondWithResult(_0x51af7f,null))['catch'](handleError(_0x51af7f,null));};exports[_0x9322('0x53')]=function(_0x318c8f,_0x4569fc,_0x223062){var _0x49f458={};var _0x172433={};var _0x4b17c3;var _0x185145;return db[_0x9322('0x2f')]['findOne']({'where':{'id':_0x318c8f['params']['id']}})['then'](handleEntityNotFound(_0x4569fc,null))['then'](function(_0x565575){if(_0x565575){_0x4b17c3=_0x565575;_0x172433[_0x9322('0x33')]=_[_0x9322('0x35')](db['User'][_0x9322('0x30')]);_0x172433[_0x9322('0x34')]=_['keys'](_0x318c8f[_0x9322('0x34')]);_0x172433[_0x9322('0x36')]=_['intersection'](_0x172433[_0x9322('0x33')],_0x172433[_0x9322('0x34')]);_0x49f458[_0x9322('0x37')]=_[_0x9322('0x38')](_0x172433[_0x9322('0x33')],qs['fields'](_0x318c8f[_0x9322('0x34')][_0x9322('0x39')]));_0x49f458[_0x9322('0x37')]=_0x49f458[_0x9322('0x37')][_0x9322('0x45')]?_0x49f458[_0x9322('0x37')]:_0x172433['model'];_0x49f458['order']=qs[_0x9322('0x54')](_0x318c8f[_0x9322('0x34')][_0x9322('0x54')]);_0x49f458[_0x9322('0x3c')]=qs[_0x9322('0x36')](_['pick'](_0x318c8f['query'],_0x172433[_0x9322('0x36')]));if(_0x318c8f['query'][_0x9322('0x3d')]){_0x49f458['where']=_[_0x9322('0x3e')](_0x49f458[_0x9322('0x3c')],{'$or':_['map'](_0x49f458[_0x9322('0x37')],function(_0x1e8462){var _0x236059={};_0x236059[_0x1e8462]={'$like':'%'+_0x318c8f[_0x9322('0x34')][_0x9322('0x3d')]+'%'};return _0x236059;})});}_0x49f458=_[_0x9322('0x3e')]({},_0x49f458,_0x318c8f['options']);return _0x4b17c3[_0x9322('0x53')](_0x49f458);}})[_0x9322('0x29')](function(_0x470e9b){if(_0x470e9b){_0x185145=_0x470e9b[_0x9322('0x45')];if(!_0x318c8f[_0x9322('0x34')][_0x9322('0x3a')](_0x9322('0x55'))){_0x49f458[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x318c8f[_0x9322('0x34')]['limit']);_0x49f458[_0x9322('0x1d')]=qs['offset'](_0x318c8f['query'][_0x9322('0x1d')]);}return _0x4b17c3['getMembers'](_0x49f458);}})['then'](function(_0x163647){if(_0x163647){return _0x163647?{'count':_0x185145,'rows':_0x163647}:null;}})[_0x9322('0x29')](respondWithResult(_0x4569fc,null))[_0x9322('0x48')](handleError(_0x4569fc,null));};exports[_0x9322('0x56')]=function(_0x606e4b,_0x5939ca,_0x22f7bd){return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x606e4b['params']['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x5939ca,null))[_0x9322('0x29')](function(_0x1be0f5){if(_0x1be0f5){return _0x1be0f5[_0x9322('0x56')](_0x606e4b['query'][_0x9322('0x52')]);}})['then'](respondWithStatusCode(_0x5939ca,null))[_0x9322('0x48')](handleError(_0x5939ca,null));};exports['addMessage']=function(_0x152c22,_0x1ee132,_0x2d8c1d){if(_0x152c22[_0x9322('0x4a')]['id']){delete _0x152c22[_0x9322('0x4a')]['id'];}return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x152c22[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x1ee132,null))[_0x9322('0x29')](function(_0xb93ab){if(_0xb93ab){_0x152c22[_0x9322('0x4a')][_0x9322('0x57')]=_0xb93ab['id'];return db['ChatInternalMessage'][_0x9322('0x49')](_0x152c22[_0x9322('0x4a')]);}})[_0x9322('0x29')](respondWithResult(_0x1ee132,null))[_0x9322('0x48')](handleError(_0x1ee132,null));};exports['getMessages']=function(_0x3588d1,_0x38290b,_0x1e99fd){var _0x4d17b4={};var _0x1bf68a={};var _0x4d189b;var _0x50fa22;return db[_0x9322('0x2f')][_0x9322('0x58')]({'where':{'id':_0x3588d1[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x38290b,null))[_0x9322('0x29')](function(_0xfa3837){if(_0xfa3837){_0x4d189b=_0xfa3837;_0x1bf68a[_0x9322('0x33')]=_[_0x9322('0x35')](db[_0x9322('0x4d')]['rawAttributes']);_0x1bf68a['query']=_[_0x9322('0x35')](_0x3588d1[_0x9322('0x34')]);_0x1bf68a['filters']=_[_0x9322('0x38')](_0x1bf68a[_0x9322('0x33')],_0x1bf68a['query']);_0x4d17b4['attributes']=_[_0x9322('0x38')](_0x1bf68a[_0x9322('0x33')],qs[_0x9322('0x39')](_0x3588d1['query']['fields']));_0x4d17b4[_0x9322('0x37')]=_0x4d17b4['attributes']['length']?_0x4d17b4[_0x9322('0x37')]:_0x1bf68a[_0x9322('0x33')];_0x4d17b4[_0x9322('0x3b')]=qs['sort'](_0x3588d1['query'][_0x9322('0x54')]);_0x4d17b4[_0x9322('0x3c')]=qs[_0x9322('0x36')](_[_0x9322('0x59')](_0x3588d1['query'],_0x1bf68a[_0x9322('0x36')]));if(_0x3588d1[_0x9322('0x34')][_0x9322('0x3d')]){_0x4d17b4[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x4d17b4[_0x9322('0x3c')],{'$or':_[_0x9322('0x2e')](_0x4d17b4[_0x9322('0x37')],function(_0x3e8c6c){var _0x24213d={};_0x24213d[_0x3e8c6c]={'$like':'%'+_0x3588d1['query'][_0x9322('0x3d')]+'%'};return _0x24213d;})});}if(_0x3588d1[_0x9322('0x34')][_0x9322('0x5a')]){var _0x4214c0=_0x3588d1[_0x9322('0x34')]['$gte']['split'](',');var _0x5053dc={};_0x5053dc[_0x4214c0[0x0]]={'$gte':moment(_0x4214c0[0x1])[_0x9322('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d17b4[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x4d17b4['where'],_0x5053dc);}_0x4d17b4=_[_0x9322('0x3e')]({},_0x4d17b4,_0x3588d1[_0x9322('0x40')]);return _0x4d189b[_0x9322('0x5c')](_0x4d17b4);}})[_0x9322('0x29')](function(_0x1846ea){if(_0x1846ea){_0x50fa22=_0x1846ea['length'];if(!_0x3588d1[_0x9322('0x34')][_0x9322('0x3a')](_0x9322('0x55'))){_0x4d17b4[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x3588d1['query']['limit']);_0x4d17b4[_0x9322('0x1d')]=qs['offset'](_0x3588d1[_0x9322('0x34')]['offset']);}return _0x4d189b[_0x9322('0x5c')](_0x4d17b4);}})[_0x9322('0x29')](function(_0x1eccd3){if(_0x1eccd3){return _0x1eccd3?{'count':_0x50fa22,'rows':_0x1eccd3}:null;}})[_0x9322('0x29')](respondWithResult(_0x38290b,null))[_0x9322('0x48')](handleError(_0x38290b,null));}; \ No newline at end of file +var _0x304b=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model'];(function(_0x4592de,_0x4233e6){var _0x27a791=function(_0x2d0f98){while(--_0x2d0f98){_0x4592de['push'](_0x4592de['shift']());}};_0x27a791(++_0x4233e6);}(_0x304b,0x15e));var _0xb304=function(_0x3a1695,_0x5a565d){_0x3a1695=_0x3a1695-0x0;var _0x5ddbb5=_0x304b[_0x3a1695];return _0x5ddbb5;};'use strict';var emlformat=require(_0xb304('0x0'));var rimraf=require(_0xb304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb304('0x2'));var rp=require(_0xb304('0x3'));var moment=require('moment');var BPromise=require(_0xb304('0x4'));var Mustache=require(_0xb304('0x5'));var util=require(_0xb304('0x6'));var path=require(_0xb304('0x7'));var sox=require(_0xb304('0x8'));var csv=require(_0xb304('0x9'));var ejs=require(_0xb304('0xa'));var fs=require('fs');var fs_extra=require(_0xb304('0xb'));var _=require(_0xb304('0xc'));var squel=require(_0xb304('0xd'));var crypto=require(_0xb304('0xe'));var jsforce=require(_0xb304('0xf'));var deskjs=require(_0xb304('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb304('0x11'));var Redis=require(_0xb304('0x12'));var authService=require(_0xb304('0x13'));var qs=require(_0xb304('0x14'));var as=require(_0xb304('0x15'));var hardwareService=require(_0xb304('0x16'));var logger=require(_0xb304('0x17'))(_0xb304('0x18'));var utils=require('../../config/utils');var config=require(_0xb304('0x19'));var licenseUtil=require(_0xb304('0x1a'));var db=require(_0xb304('0x1b'))['db'];config['redis']=_[_0xb304('0x1c')](config[_0xb304('0x1d')],{'host':_0xb304('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb304('0x1f'))[_0xb304('0x20')](socket);function respondWithStatusCode(_0x335bf8,_0x2a93be){_0x2a93be=_0x2a93be||0xcc;return function(_0x34aeff){if(_0x34aeff){return _0x335bf8[_0xb304('0x21')](_0x2a93be);}return _0x335bf8[_0xb304('0x22')](_0x2a93be)[_0xb304('0x23')]();};}function respondWithResult(_0x52c186,_0x5d8f05){_0x5d8f05=_0x5d8f05||0xc8;return function(_0x21967a){if(_0x21967a){return _0x52c186[_0xb304('0x22')](_0x5d8f05)[_0xb304('0x24')](_0x21967a);}};}function respondWithFilteredResult(_0x3a5401,_0x25abbf){return function(_0x36e7f7){if(_0x36e7f7){var _0x59b2a1=typeof _0x25abbf['offset']===_0xb304('0x25')&&typeof _0x25abbf[_0xb304('0x26')]===_0xb304('0x25');var _0xa9ea8f=_0x36e7f7['count'];var _0x9395f3=_0x59b2a1?0x0:_0x25abbf[_0xb304('0x27')];var _0x5d2c72=_0x59b2a1?_0x36e7f7[_0xb304('0x28')]:_0x25abbf[_0xb304('0x27')]+_0x25abbf[_0xb304('0x26')];var _0x4978da;if(_0x5d2c72>=_0xa9ea8f){_0x5d2c72=_0xa9ea8f;_0x4978da=0xc8;}else{_0x4978da=0xce;}_0x3a5401[_0xb304('0x22')](_0x4978da);return _0x3a5401[_0xb304('0x29')]('Content-Range',_0x9395f3+'-'+_0x5d2c72+'/'+_0xa9ea8f)[_0xb304('0x24')](_0x36e7f7);}return null;};}function patchUpdates(_0x54c94f){return function(_0x5994c1){try{jsonpatch[_0xb304('0x2a')](_0x5994c1,_0x54c94f,!![]);}catch(_0x28278c){return BPromise['reject'](_0x28278c);}return _0x5994c1[_0xb304('0x2b')]();};}function saveUpdates(_0x124b23,_0x897ffa){return function(_0x2d9066){if(_0x2d9066){return _0x2d9066[_0xb304('0x2c')](_0x124b23)['then'](function(_0xfb6ecc){return _0xfb6ecc;});}return null;};}function removeEntity(_0x2f5b6c,_0x1adb2a){return function(_0x1d500b){if(_0x1d500b){return _0x1d500b[_0xb304('0x2d')]()[_0xb304('0x2e')](function(){_0x2f5b6c[_0xb304('0x22')](0xcc)[_0xb304('0x23')]();});}};}function handleEntityNotFound(_0x37dfe6,_0x3b61e4){return function(_0x5d6fd8){if(!_0x5d6fd8){_0x37dfe6[_0xb304('0x21')](0x194);}return _0x5d6fd8;};}function handleError(_0x1ded80,_0x754bb8){_0x754bb8=_0x754bb8||0x1f4;return function(_0x2e1a01){logger[_0xb304('0x2f')](_0x2e1a01[_0xb304('0x30')]);if(_0x2e1a01[_0xb304('0x31')]){delete _0x2e1a01[_0xb304('0x31')];}_0x1ded80['status'](_0x754bb8)[_0xb304('0x32')](_0x2e1a01);};}exports[_0xb304('0x33')]=function(_0x5f1d6b,_0x39ae9d){var _0x65a5f1={},_0xe3bab={},_0xf18cd8={'count':0x0,'rows':[]};var _0x3b15af=_[_0xb304('0x34')](db[_0xb304('0x35')][_0xb304('0x36')],function(_0x538285){return{'name':_0x538285[_0xb304('0x37')],'type':_0x538285['type'][_0xb304('0x38')]};});_0xe3bab[_0xb304('0x39')]=_[_0xb304('0x34')](_0x3b15af,'name');_0xe3bab[_0xb304('0x3a')]=_['keys'](_0x5f1d6b[_0xb304('0x3a')]);_0xe3bab[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0xe3bab['model'],_0xe3bab['query']);_0x65a5f1[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0xe3bab[_0xb304('0x39')],qs['fields'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x3e')]));_0x65a5f1[_0xb304('0x3d')]=_0x65a5f1['attributes'][_0xb304('0x3f')]?_0x65a5f1['attributes']:_0xe3bab[_0xb304('0x39')];if(!_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x65a5f1[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x26')]);_0x65a5f1[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x27')]);}_0x65a5f1['order']=qs['sort'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x42')]);_0x65a5f1[_0xb304('0x43')]=qs[_0xb304('0x3b')](_['pick'](_0x5f1d6b[_0xb304('0x3a')],_0xe3bab[_0xb304('0x3b')]),_0x3b15af);if(_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]){_0x65a5f1[_0xb304('0x43')]=_[_0xb304('0x45')](_0x65a5f1[_0xb304('0x43')],{'$or':_['map'](_0x3b15af,function(_0x5d2dd9){if(_0x5d2dd9['type']!==_0xb304('0x46')){var _0x1f2ac3={};_0x1f2ac3[_0x5d2dd9[_0xb304('0x31')]]={'$like':'%'+_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]+'%'};return _0x1f2ac3;}})});}_0x65a5f1=_[_0xb304('0x45')]({},_0x65a5f1,_0x5f1d6b[_0xb304('0x47')]);var _0x48284e={'where':_0x65a5f1[_0xb304('0x43')]};return db[_0xb304('0x35')][_0xb304('0x28')](_0x48284e)[_0xb304('0x2e')](function(_0x13c72d){_0xf18cd8[_0xb304('0x28')]=_0x13c72d;if(_0x5f1d6b['query']['includeAll']){_0x65a5f1['include']=[{'all':!![]}];}return db[_0xb304('0x35')][_0xb304('0x48')](_0x65a5f1);})[_0xb304('0x2e')](function(_0x1cb582){_0xf18cd8[_0xb304('0x49')]=_0x1cb582;return _0xf18cd8;})[_0xb304('0x2e')](respondWithFilteredResult(_0x39ae9d,_0x65a5f1))[_0xb304('0x4a')](handleError(_0x39ae9d,null));};exports[_0xb304('0x4b')]=function(_0x2228bd,_0x20ab6e){var _0x20b295={'raw':!![],'where':{'id':_0x2228bd['params']['id']}},_0x17019e={};_0x17019e['model']=_[_0xb304('0x4c')](db[_0xb304('0x35')][_0xb304('0x36')]);_0x17019e[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2228bd[_0xb304('0x3a')]);_0x17019e['filters']=_['intersection'](_0x17019e[_0xb304('0x39')],_0x17019e[_0xb304('0x3a')]);_0x20b295['attributes']=_[_0xb304('0x3c')](_0x17019e[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x2228bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x20b295[_0xb304('0x3d')]=_0x20b295[_0xb304('0x3d')][_0xb304('0x3f')]?_0x20b295[_0xb304('0x3d')]:_0x17019e['model'];if(_0x2228bd[_0xb304('0x3a')][_0xb304('0x4d')]){_0x20b295[_0xb304('0x4e')]=[{'all':!![]}];}_0x20b295=_['merge']({},_0x20b295,_0x2228bd[_0xb304('0x47')]);return db[_0xb304('0x35')][_0xb304('0x4f')](_0x20b295)['then'](handleEntityNotFound(_0x20ab6e,null))[_0xb304('0x2e')](respondWithResult(_0x20ab6e,null))[_0xb304('0x4a')](handleError(_0x20ab6e,null));};exports[_0xb304('0x50')]=function(_0x2f1b45,_0x1158c3){return db[_0xb304('0x35')]['create'](_0x2f1b45[_0xb304('0x51')],{})['then'](respondWithResult(_0x1158c3,0xc9))[_0xb304('0x4a')](handleError(_0x1158c3,null));};exports[_0xb304('0x2c')]=function(_0x2bb54f,_0x37d74d){if(_0x2bb54f[_0xb304('0x51')]['id']){delete _0x2bb54f[_0xb304('0x51')]['id'];}return db[_0xb304('0x35')]['find']({'where':{'id':_0x2bb54f['params']['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x37d74d,null))['then'](saveUpdates(_0x2bb54f[_0xb304('0x51')],null))[_0xb304('0x2e')](respondWithResult(_0x37d74d,null))['catch'](handleError(_0x37d74d,null));};exports[_0xb304('0x2d')]=function(_0x6d1e2e,_0x36c76c){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x6d1e2e[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x36c76c,null))[_0xb304('0x2e')](removeEntity(_0x36c76c,null))['catch'](handleError(_0x36c76c,null));};exports[_0xb304('0x53')]=function(_0x1956b4,_0x35a1f7){return db[_0xb304('0x35')][_0xb304('0x53')]()[_0xb304('0x2e')](respondWithResult(_0x35a1f7,null))[_0xb304('0x4a')](handleError(_0x35a1f7,null));};exports[_0xb304('0x54')]=function(_0x36e942,_0x70563f,_0x8dd461){return db[_0xb304('0x55')][_0xb304('0x28')]({'where':{'ChatGroupId':_0x36e942[_0xb304('0x52')]['id'],'ToId':_0x36e942['user']['id'],'read':![]}})['then'](function(_0x42bf41){return{'id':_[_0xb304('0x56')](_0x36e942[_0xb304('0x52')]['id']),'count':_0x42bf41};})['then'](respondWithResult(_0x70563f,null))[_0xb304('0x4a')](handleError(_0x70563f,null));};exports[_0xb304('0x57')]=function(_0x4bd0d2,_0x58b67b,_0x2e2912){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x4bd0d2[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x58b67b,null))[_0xb304('0x2e')](function(_0x5537de){if(_0x5537de){return _0x5537de[_0xb304('0x57')](_0x4bd0d2['body'][_0xb304('0x58')],_['omit'](_0x4bd0d2[_0xb304('0x51')],[_0xb304('0x58'),'id'])||{});}})[_0xb304('0x2e')](respondWithResult(_0x58b67b,null))['catch'](handleError(_0x58b67b,null));};exports[_0xb304('0x59')]=function(_0x31f214,_0xb22ed3,_0x3fcf6a){var _0x420df8={};var _0x201094={};var _0x4c67e4;var _0x1ee244;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x31f214[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0xb22ed3,null))['then'](function(_0x1bcb54){if(_0x1bcb54){_0x4c67e4=_0x1bcb54;_0x201094[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x5b')][_0xb304('0x36')]);_0x201094[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x31f214['query']);_0x201094['filters']=_['intersection'](_0x201094[_0xb304('0x39')],_0x201094[_0xb304('0x3a')]);_0x420df8['attributes']=_[_0xb304('0x3c')](_0x201094[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x31f214['query'][_0xb304('0x3e')]));_0x420df8[_0xb304('0x3d')]=_0x420df8[_0xb304('0x3d')][_0xb304('0x3f')]?_0x420df8[_0xb304('0x3d')]:_0x201094['model'];_0x420df8[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x31f214[_0xb304('0x3a')][_0xb304('0x42')]);_0x420df8[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x31f214[_0xb304('0x3a')],_0x201094[_0xb304('0x3b')]));if(_0x31f214[_0xb304('0x3a')][_0xb304('0x44')]){_0x420df8['where']=_[_0xb304('0x45')](_0x420df8[_0xb304('0x43')],{'$or':_[_0xb304('0x34')](_0x420df8[_0xb304('0x3d')],function(_0xfc8164){var _0xc6db3f={};_0xc6db3f[_0xfc8164]={'$like':'%'+_0x31f214[_0xb304('0x3a')]['filter']+'%'};return _0xc6db3f;})});}_0x420df8=_[_0xb304('0x45')]({},_0x420df8,_0x31f214['options']);return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0x49621a){if(_0x49621a){_0x1ee244=_0x49621a['length'];if(!_0x31f214[_0xb304('0x3a')]['hasOwnProperty'](_0xb304('0x41'))){_0x420df8['limit']=qs[_0xb304('0x26')](_0x31f214[_0xb304('0x3a')][_0xb304('0x26')]);_0x420df8[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x31f214[_0xb304('0x3a')][_0xb304('0x27')]);}return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0xf0d979){if(_0xf0d979){return _0xf0d979?{'count':_0x1ee244,'rows':_0xf0d979}:null;}})[_0xb304('0x2e')](respondWithResult(_0xb22ed3,null))[_0xb304('0x4a')](handleError(_0xb22ed3,null));};exports[_0xb304('0x5e')]=function(_0x27272b,_0x35c99c,_0x45ec35){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x27272b[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x35c99c,null))[_0xb304('0x2e')](function(_0x4b71ad){if(_0x4b71ad){return _0x4b71ad[_0xb304('0x5e')](_0x27272b[_0xb304('0x3a')][_0xb304('0x58')]);}})[_0xb304('0x2e')](respondWithStatusCode(_0x35c99c,null))[_0xb304('0x4a')](handleError(_0x35c99c,null));};exports[_0xb304('0x5f')]=function(_0xf09f2a,_0x542fd8,_0x17613b){if(_0xf09f2a[_0xb304('0x51')]['id']){delete _0xf09f2a['body']['id'];}return db['ChatGroup'][_0xb304('0x4f')]({'where':{'id':_0xf09f2a[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x542fd8,null))[_0xb304('0x2e')](function(_0x2b34d4){if(_0x2b34d4){_0xf09f2a[_0xb304('0x51')][_0xb304('0x60')]=_0x2b34d4['id'];return db[_0xb304('0x55')][_0xb304('0x50')](_0xf09f2a['body']);}})[_0xb304('0x2e')](respondWithResult(_0x542fd8,null))['catch'](handleError(_0x542fd8,null));};exports['getMessages']=function(_0x2785bd,_0x30e20a,_0xbd4262){var _0x8cfe73={};var _0x437471={};var _0x585e13;var _0x177d16;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x2785bd[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x30e20a,null))[_0xb304('0x2e')](function(_0x34f811){if(_0x34f811){_0x585e13=_0x34f811;_0x437471[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x55')][_0xb304('0x36')]);_0x437471[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2785bd['query']);_0x437471[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0x437471[_0xb304('0x39')],_0x437471[_0xb304('0x3a')]);_0x8cfe73[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0x437471['model'],qs['fields'](_0x2785bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x8cfe73[_0xb304('0x3d')]=_0x8cfe73[_0xb304('0x3d')][_0xb304('0x3f')]?_0x8cfe73[_0xb304('0x3d')]:_0x437471[_0xb304('0x39')];_0x8cfe73[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x2785bd[_0xb304('0x3a')]['sort']);_0x8cfe73[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x2785bd['query'],_0x437471['filters']));if(_0x2785bd[_0xb304('0x3a')][_0xb304('0x44')]){_0x8cfe73['where']=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],{'$or':_['map'](_0x8cfe73[_0xb304('0x3d')],function(_0x2080c2){var _0xbb2636={};_0xbb2636[_0x2080c2]={'$like':'%'+_0x2785bd['query'][_0xb304('0x44')]+'%'};return _0xbb2636;})});}if(_0x2785bd['query'][_0xb304('0x61')]){var _0x53e355=_0x2785bd[_0xb304('0x3a')][_0xb304('0x61')][_0xb304('0x62')](',');var _0x591cf6={};_0x591cf6[_0x53e355[0x0]]={'$gte':moment(_0x53e355[0x1])[_0xb304('0x63')](_0xb304('0x64'))};_0x8cfe73[_0xb304('0x43')]=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],_0x591cf6);}_0x8cfe73=_[_0xb304('0x45')]({},_0x8cfe73,_0x2785bd[_0xb304('0x47')]);return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x2355fd){if(_0x2355fd){_0x177d16=_0x2355fd['length'];if(!_0x2785bd[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x8cfe73[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x2785bd[_0xb304('0x3a')]['limit']);_0x8cfe73[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x2785bd['query'][_0xb304('0x27')]);}return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x507f06){if(_0x507f06){return _0x507f06?{'count':_0x177d16,'rows':_0x507f06}:null;}})[_0xb304('0x2e')](respondWithResult(_0x30e20a,null))[_0xb304('0x4a')](handleError(_0x30e20a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a90a65d..457059f 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 _0x8357=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x2c9e54,_0x178247){var _0x25d074=function(_0x14e87e){while(--_0x14e87e){_0x2c9e54['push'](_0x2c9e54['shift']());}};_0x25d074(++_0x178247);}(_0x8357,0x140));var _0x7835=function(_0x5c5b95,_0x3994b4){_0x5c5b95=_0x5c5b95-0x0;var _0x26a867=_0x8357[_0x5c5b95];return _0x26a867;};'use strict';var EventEmitter=require(_0x7835('0x0'));var ChatGroup=require(_0x7835('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7835('0x2')](0x0);var events={'afterCreate':_0x7835('0x3'),'afterUpdate':_0x7835('0x4'),'afterDestroy':'remove'};function emitEvent(_0x468407){return function(_0x2f2cbe,_0x5e12bb,_0x2b1a89){ChatGroupEvents[_0x7835('0x5')](_0x468407+':'+_0x2f2cbe['id'],_0x2f2cbe);ChatGroupEvents[_0x7835('0x5')](_0x468407,_0x2f2cbe);_0x2b1a89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7835('0x6')](e,emitEvent(event));}}module[_0x7835('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x582b=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','save'];(function(_0x5dca91,_0x3e6d9a){var _0x24ce62=function(_0x5d8a40){while(--_0x5d8a40){_0x5dca91['push'](_0x5dca91['shift']());}};_0x24ce62(++_0x3e6d9a);}(_0x582b,0x185));var _0xb582=function(_0x4bad9a,_0x2547bc){_0x4bad9a=_0x4bad9a-0x0;var _0x326988=_0x582b[_0x4bad9a];return _0x326988;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xb582('0x0'))['db'][_0xb582('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb582('0x2'),'afterUpdate':'update','afterDestroy':_0xb582('0x3')};function emitEvent(_0x13f2bd){return function(_0x43b5ac,_0x223f44,_0xfe601a){ChatGroupEvents[_0xb582('0x4')](_0x13f2bd+':'+_0x43b5ac['id'],_0x43b5ac);ChatGroupEvents[_0xb582('0x4')](_0x13f2bd,_0x43b5ac);_0xfe601a(null);};}for(var e in events){if(events[_0xb582('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xb582('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 c9f4bbd..2c78a73 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 _0x971a=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x971a,0x177));var _0xa971=function(_0x18cabd,_0x4c086d){_0x18cabd=_0x18cabd-0x0;var _0x737f87=_0x971a[_0x18cabd];return _0x737f87;};'use strict';var _=require('lodash');var util=require(_0xa971('0x0'));var logger=require(_0xa971('0x1'))(_0xa971('0x2'));var moment=require('moment');var BPromise=require(_0xa971('0x3'));var rp=require(_0xa971('0x4'));var fs=require('fs');var path=require(_0xa971('0x5'));var rimraf=require(_0xa971('0x6'));var config=require(_0xa971('0x7'));var attributes=require(_0xa971('0x8'));module[_0xa971('0x9')]=function(_0x536b51,_0x449d8b){return _0x536b51[_0xa971('0xa')](_0xa971('0xb'),attributes,{'tableName':_0xa971('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec47=['path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xec47,0x102));var _0x7ec4=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xec47[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x7ec4('0x0'));var util=require(_0x7ec4('0x1'));var logger=require(_0x7ec4('0x2'))(_0x7ec4('0x3'));var moment=require(_0x7ec4('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ec4('0x5'));var fs=require('fs');var path=require(_0x7ec4('0x6'));var rimraf=require(_0x7ec4('0x7'));var config=require(_0x7ec4('0x8'));var attributes=require('./chatGroup.attributes');module[_0x7ec4('0x9')]=function(_0x45333f,_0x531638){return _0x45333f[_0x7ec4('0xa')](_0x7ec4('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 651a181..80ce822 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 _0x3d5d=['util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x224d08,_0xce2e9f){var _0x24c699=function(_0x2a851f){while(--_0x2a851f){_0x224d08['push'](_0x224d08['shift']());}};_0x24c699(++_0xce2e9f);}(_0x3d5d,0x104));var _0xd3d5=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x3d5d[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd3d5('0x2'));var fs=require('fs');var Redis=require(_0xd3d5('0x3'));var db=require(_0xd3d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});config['redis']=_[_0xd3d5('0xa')](config[_0xd3d5('0xb')],{'host':_0xd3d5('0xc'),'port':0x18eb});var socket=require(_0xd3d5('0xd'))(new Redis(config['redis']));require(_0xd3d5('0xe'))[_0xd3d5('0xf')](socket);function respondWithRpcPromise(_0x209305,_0x5c66cf,_0x3e64c4){return new BPromise(function(_0x3fba26,_0x5a2468){return client[_0xd3d5('0x10')](_0x209305,_0x3e64c4)[_0xd3d5('0x11')](function(_0x3e8301){logger[_0xd3d5('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,'request\x20sent');logger[_0xd3d5('0x13')](_0xd3d5('0x14'),_0x5c66cf,_0xd3d5('0x15'),JSON[_0xd3d5('0x16')](_0x3e8301));if(_0x3e8301[_0xd3d5('0x17')]){if(_0x3e8301['error'][_0xd3d5('0x18')]===0x1f4){logger[_0xd3d5('0x17')](_0xd3d5('0x19'),_0x5c66cf,_0x3e8301['error'][_0xd3d5('0x1a')]);return _0x5a2468(_0x3e8301['error']['message']);}logger[_0xd3d5('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,_0x3e8301[_0xd3d5('0x17')][_0xd3d5('0x1a')]);return _0x3fba26(_0x3e8301[_0xd3d5('0x17')]['message']);}else{logger[_0xd3d5('0x12')](_0xd3d5('0x19'),_0x5c66cf,_0xd3d5('0x15'));_0x3fba26(_0x3e8301[_0xd3d5('0x1b')][_0xd3d5('0x1a')]);}})[_0xd3d5('0x1c')](function(_0x42e079){logger[_0xd3d5('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,_0x42e079);_0x5a2468(_0x42e079);});});} \ No newline at end of file +var _0xd765=['request\x20sent','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x22d7bb,_0x4c158e){var _0x40a737=function(_0xd85bab){while(--_0xd85bab){_0x22d7bb['push'](_0x22d7bb['shift']());}};_0x40a737(++_0x4c158e);}(_0xd765,0xdf));var _0x5d76=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd765[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var moment=require(_0x5d76('0x2'));var BPromise=require(_0x5d76('0x3'));var rs=require(_0x5d76('0x4'));var fs=require('fs');var Redis=require(_0x5d76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d76('0x6'));var logger=require('../../config/logger')(_0x5d76('0x7'));var config=require(_0x5d76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5d76('0x9')][_0x5d76('0xa')]({'port':0x232a});config[_0x5d76('0xb')]=_[_0x5d76('0xc')](config[_0x5d76('0xb')],{'host':_0x5d76('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5d76('0xe'))[_0x5d76('0xf')](socket);function respondWithRpcPromise(_0x339e41,_0x31c85f,_0x48f1db){return new BPromise(function(_0x504b8b,_0x7345d5){return client[_0x5d76('0x10')](_0x339e41,_0x48f1db)[_0x5d76('0x11')](function(_0x545dfd){logger['info']('ChatGroup,\x20%s,\x20%s',_0x31c85f,'request\x20sent');logger[_0x5d76('0x12')](_0x5d76('0x13'),_0x31c85f,_0x5d76('0x14'),JSON['stringify'](_0x545dfd));if(_0x545dfd[_0x5d76('0x15')]){if(_0x545dfd[_0x5d76('0x15')]['code']===0x1f4){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);return _0x7345d5(_0x545dfd[_0x5d76('0x15')]['message']);}logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')]['message']);return _0x504b8b(_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);}else{logger[_0x5d76('0x18')]('ChatGroup,\x20%s,\x20%s',_0x31c85f,_0x5d76('0x14'));_0x504b8b(_0x545dfd[_0x5d76('0x19')]['message']);}})[_0x5d76('0x1a')](function(_0x335ee0){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x335ee0);_0x7345d5(_0x335ee0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 76466f3..7ae010c 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 _0xa0ae=['chatGroup:','./chatGroup.events','update','emit','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa0ae,0xe7));var _0xea0a=function(_0x28e4ec,_0x22f691){_0x28e4ec=_0x28e4ec-0x0;var _0x161a64=_0xa0ae[_0x28e4ec];return _0x161a64;};'use strict';var ChatGroupEvents=require(_0xea0a('0x0'));var events=['save','remove',_0xea0a('0x1')];function createListener(_0x3b624f,_0x57a0f4){return function(_0x4d9058){_0x57a0f4[_0xea0a('0x2')](_0x3b624f,_0x4d9058);};}function removeListener(_0x1ef389,_0x6891b9){return function(){ChatGroupEvents['removeListener'](_0x1ef389,_0x6891b9);};}exports[_0xea0a('0x3')]=function(_0x7489cd){for(var _0x2590b8=0x0,_0x158447=events['length'];_0x2590b8<_0x158447;_0x2590b8++){var _0x57376b=events[_0x2590b8];var _0x55d26f=createListener(_0xea0a('0x4')+_0x57376b,_0x7489cd);ChatGroupEvents['on'](_0x57376b,_0x55d26f);}}; \ No newline at end of file +var _0xf1cd=['removeListener','register','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x4f03c3,_0x205978){var _0x2b82d1=function(_0xc5038b){while(--_0xc5038b){_0x4f03c3['push'](_0x4f03c3['shift']());}};_0x2b82d1(++_0x205978);}(_0xf1cd,0x100));var _0xdf1c=function(_0x3a3527,_0x1e6c15){_0x3a3527=_0x3a3527-0x0;var _0x4fcf4e=_0xf1cd[_0x3a3527];return _0x4fcf4e;};'use strict';var ChatGroupEvents=require(_0xdf1c('0x0'));var events=[_0xdf1c('0x1'),'remove','update'];function createListener(_0x431bdf,_0x466960){return function(_0x119407){_0x466960[_0xdf1c('0x2')](_0x431bdf,_0x119407);};}function removeListener(_0x395f11,_0x1c0c26){return function(){ChatGroupEvents[_0xdf1c('0x3')](_0x395f11,_0x1c0c26);};}exports[_0xdf1c('0x4')]=function(_0x456b69){for(var _0x576e8e=0x0,_0x4e9adc=events[_0xdf1c('0x5')];_0x576e8e<_0x4e9adc;_0x576e8e++){var _0x3bfb49=events[_0x576e8e];var _0x29eb66=createListener(_0xdf1c('0x6')+_0x3bfb49,_0x456b69);ChatGroupEvents['on'](_0x3bfb49,_0x29eb66);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0afe456..fd81aee 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 _0x8e03=['create','/:id/members','addMessage','put','update','destroy','delete','removeMembers','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post'];(function(_0x5983f3,_0x216373){var _0x1c597f=function(_0x1fb2a7){while(--_0x1fb2a7){_0x5983f3['push'](_0x5983f3['shift']());}};_0x1c597f(++_0x216373);}(_0x8e03,0x74));var _0x38e0=function(_0x26006e,_0x19c18c){_0x26006e=_0x26006e-0x0;var _0x669312=_0x8e03[_0x26006e];return _0x669312;};'use strict';var multer=require(_0x38e0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38e0('0x1'));var router=express[_0x38e0('0x2')]();var fs_extra=require(_0x38e0('0x3'));var auth=require(_0x38e0('0x4'));var interaction=require(_0x38e0('0x5'));var config=require(_0x38e0('0x6'));var controller=require('./chatGroup.controller');router[_0x38e0('0x7')]('/',auth[_0x38e0('0x8')](),controller[_0x38e0('0x9')]);router['get'](_0x38e0('0xa'),auth['isAuthenticated'](),controller[_0x38e0('0xb')]);router[_0x38e0('0x7')](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller['show']);router['get'](_0x38e0('0xd'),auth[_0x38e0('0x8')](),controller[_0x38e0('0xe')]);router[_0x38e0('0x7')]('/:id/members',auth[_0x38e0('0x8')](),controller[_0x38e0('0xf')]);router[_0x38e0('0x7')](_0x38e0('0x10'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x11')]);router[_0x38e0('0x12')]('/',auth[_0x38e0('0x8')](),controller[_0x38e0('0x13')]);router[_0x38e0('0x12')](_0x38e0('0x14'),auth[_0x38e0('0x8')](),controller['addMembers']);router['post'](_0x38e0('0x10'),auth['isAuthenticated'](),controller[_0x38e0('0x15')]);router[_0x38e0('0x16')](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x17')]);router['delete'](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x18')]);router[_0x38e0('0x19')](_0x38e0('0x14'),auth['isAuthenticated'](),controller[_0x38e0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7c16=['addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x5b3a6a,_0x11d9e2){var _0x5315c3=function(_0xd781b){while(--_0xd781b){_0x5b3a6a['push'](_0x5b3a6a['shift']());}};_0x5315c3(++_0x11d9e2);}(_0x7c16,0x1c7));var _0x67c1=function(_0x36bab3,_0x19ce33){_0x36bab3=_0x36bab3-0x0;var _0x2d3989=_0x7c16[_0x36bab3];return _0x2d3989;};'use strict';var multer=require(_0x67c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x67c1('0x1'));var express=require(_0x67c1('0x2'));var router=express[_0x67c1('0x3')]();var fs_extra=require(_0x67c1('0x4'));var auth=require(_0x67c1('0x5'));var interaction=require(_0x67c1('0x6'));var config=require('../../config/environment');var controller=require(_0x67c1('0x7'));router[_0x67c1('0x8')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0xa')]);router[_0x67c1('0x8')](_0x67c1('0xb'),auth['isAuthenticated'](),controller[_0x67c1('0xc')]);router['get'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller['show']);router['get'](_0x67c1('0xe'),auth[_0x67c1('0x9')](),controller[_0x67c1('0xf')]);router[_0x67c1('0x8')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller['getMembers']);router['get'](_0x67c1('0x11'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x12')]);router[_0x67c1('0x13')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0x14')]);router[_0x67c1('0x13')](_0x67c1('0x10'),auth['isAuthenticated'](),controller[_0x67c1('0x15')]);router[_0x67c1('0x13')]('/:id/messages',auth[_0x67c1('0x9')](),controller[_0x67c1('0x16')]);router['put'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x17')]);router[_0x67c1('0x18')](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x19')]);router[_0x67c1('0x18')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x1a')]);module[_0x67c1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 8f42e62..44d0fe1 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 _0x0db9=['long','DATE','BOOLEAN','sequelize','ENUM','star','TEXT','STRING'];(function(_0x50cd58,_0x563fa0){var _0x15594a=function(_0x145cc9){while(--_0x145cc9){_0x50cd58['push'](_0x50cd58['shift']());}};_0x15594a(++_0x563fa0);}(_0x0db9,0xa3));var _0x90db=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x0db9[_0x289a67];return _0x572b49;};'use strict';var Sequelize=require(_0x90db('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x90db('0x1')](_0x90db('0x2'),'thumb'),'defaultValue':_0x90db('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x90db('0x3')]},'mailTranscript':{'type':Sequelize[_0x90db('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x90db('0x4')]},'secondDisposition':{'type':Sequelize[_0x90db('0x4')]},'thirdDisposition':{'type':Sequelize[_0x90db('0x4')]},'note':{'type':Sequelize[_0x90db('0x4')]},'browserName':{'type':Sequelize[_0x90db('0x4')]},'browserVersion':{'type':Sequelize[_0x90db('0x4')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x90db('0x4')]},'deviceModel':{'type':Sequelize[_0x90db('0x4')]},'deviceVendor':{'type':Sequelize[_0x90db('0x4')]},'deviceType':{'type':Sequelize[_0x90db('0x4')]},'referer':{'type':Sequelize[_0x90db('0x3')]},'customerIp':{'type':Sequelize[_0x90db('0x4')]},'formData':{'type':Sequelize[_0x90db('0x3')](_0x90db('0x5'))},'read1stAt':{'type':Sequelize[_0x90db('0x6')]},'lastMsgAt':{'type':Sequelize[_0x90db('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x90db('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x90db('0x4')]},'customerPort':{'type':Sequelize[_0x90db('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x90db('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x90db('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x3de3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x11e346,_0x1ba6d1){var _0x3b9dbd=function(_0xadaf5a){while(--_0xadaf5a){_0x11e346['push'](_0x11e346['shift']());}};_0x3b9dbd(++_0x1ba6d1);}(_0x3de3,0x1ce));var _0x33de=function(_0x1440ec,_0x4b6aff){_0x1440ec=_0x1440ec-0x0;var _0x13203b=_0x3de3[_0x1440ec];return _0x13203b;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'closed':{'type':Sequelize[_0x33de('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33de('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x33de('0x3'),_0x33de('0x4')),'defaultValue':_0x33de('0x3')},'ratingMessage':{'type':Sequelize[_0x33de('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x33de('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33de('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33de('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x33de('0x6')]},'browserName':{'type':Sequelize[_0x33de('0x6')]},'browserVersion':{'type':Sequelize[_0x33de('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x33de('0x6')]},'deviceModel':{'type':Sequelize[_0x33de('0x6')]},'deviceVendor':{'type':Sequelize[_0x33de('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33de('0x5')]},'customerIp':{'type':Sequelize[_0x33de('0x6')]},'formData':{'type':Sequelize[_0x33de('0x5')](_0x33de('0x8'))},'read1stAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x33de('0x9')]('in',_0x33de('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x33de('0x6')]},'customerPort':{'type':Sequelize[_0x33de('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x33de('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f6f0941..140cc33 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 _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x2fc67b,_0x404917){var _0x2ca4b4=function(_0x39a5ba){while(--_0x39a5ba){_0x2fc67b['push'](_0x2fc67b['shift']());}};_0x2ca4b4(++_0x404917);}(_0xef0f,0x168));var _0xfef0=function(_0x4917de,_0x4cca9b){_0x4917de=_0x4917de-0x0;var _0x11d892=_0xef0f[_0x4917de];return _0x11d892;};'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 pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('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',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));}; \ No newline at end of file +var _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','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/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x43bc8f,_0x24a26a){_0x43bc8f=_0x43bc8f-0x0;var _0x34f552=_0xd7d1[_0x43bc8f];return _0x34f552;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4dbd23c..d40ed4e 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 _0x6eec=['setMaxListeners','save','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x3dda1e,_0x17a46c){var _0x4b8cee=function(_0x7b86e6){while(--_0x7b86e6){_0x3dda1e['push'](_0x3dda1e['shift']());}};_0x4b8cee(++_0x17a46c);}(_0x6eec,0x106));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc6ee('0x0'));var ChatInteraction=require(_0xc6ee('0x1'))['db'][_0xc6ee('0x2')];var ChatMessage=require(_0xc6ee('0x1'))['db'][_0xc6ee('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc6ee('0x4')](0x0);var events={'afterCreate':_0xc6ee('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21c022){return function(_0x2be781,_0x38ca93,_0x1a3bbd){_0x2be781[_0xc6ee('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e9732){_0x2be781[_0xc6ee('0x7')](_0xc6ee('0x8'),_0x5e9732[_0xc6ee('0x9')](function(_0x4a9edf){return{'id':_0x4a9edf['id']};}));return ChatMessage[_0xc6ee('0xa')]({'where':{'ChatInteractionId':_0x2be781['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc6ee('0xb')](function(_0x3f4276){_0x2be781[_0xc6ee('0x7')](_0xc6ee('0xc'),_0x3f4276[_0xc6ee('0xd')]);ChatInteractionEvents[_0xc6ee('0xe')](_0x21c022+':'+_0x2be781['id'],_0x2be781);ChatInteractionEvents['emit'](_0x21c022,_0x2be781);_0x1a3bbd(null);})[_0xc6ee('0xf')](_0x1a3bbd(null));};}for(var e in events){if(events[_0xc6ee('0x10')](e)){var event=events[e];ChatInteraction[_0xc6ee('0x11')](e,emitEvent(event));}}module[_0xc6ee('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xf12d=['Users','map','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue'];(function(_0x5efbce,_0x3d9ebd){var _0x28f15c=function(_0x20045b){while(--_0x20045b){_0x5efbce['push'](_0x5efbce['shift']());}};_0x28f15c(++_0x3d9ebd);}(_0xf12d,0x119));var _0xdf12=function(_0x35f3d4,_0x1ab86d){_0x35f3d4=_0x35f3d4-0x0;var _0x27c69b=_0xf12d[_0x35f3d4];return _0x27c69b;};'use strict';var EventEmitter=require(_0xdf12('0x0'));var ChatInteraction=require(_0xdf12('0x1'))['db'][_0xdf12('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xdf12('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf12('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf12('0x5'),'afterDestroy':'remove'};function emitEvent(_0x376365){return function(_0x115a71,_0x3061d9,_0x109355){_0x115a71[_0xdf12('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x877239){_0x115a71[_0xdf12('0x7')](_0xdf12('0x8'),_0x877239[_0xdf12('0x9')](function(_0xdf393b){return{'id':_0xdf393b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x115a71['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf12('0xa')](function(_0x1c254d){_0x115a71[_0xdf12('0x7')](_0xdf12('0xb'),_0x1c254d[_0xdf12('0xc')]);ChatInteractionEvents['emit'](_0x376365+':'+_0x115a71['id'],_0x115a71);ChatInteractionEvents[_0xdf12('0xd')](_0x376365,_0x115a71);_0x109355(null);})[_0xdf12('0xe')](_0x109355(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdf12('0xf')](e,emitEvent(event));}}module[_0xdf12('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 2d6554f..1003461 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 _0xa446=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions'];(function(_0x2cefd2,_0x3eed48){var _0x528537=function(_0x4a529b){while(--_0x4a529b){_0x2cefd2['push'](_0x2cefd2['shift']());}};_0x528537(++_0x3eed48);}(_0xa446,0x185));var _0x6a44=function(_0xc59fc6,_0x1938fd){_0xc59fc6=_0xc59fc6-0x0;var _0xd96754=_0xa446[_0xc59fc6];return _0xd96754;};'use strict';var _=require(_0x6a44('0x0'));var util=require(_0x6a44('0x1'));var logger=require(_0x6a44('0x2'))('api');var moment=require(_0x6a44('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a44('0x4'));var rimraf=require(_0x6a44('0x5'));var config=require(_0x6a44('0x6'));var attributes=require(_0x6a44('0x7'));module[_0x6a44('0x8')]=function(_0x3c3252,_0x5e4f23){return _0x3c3252['define'](_0x6a44('0x9'),attributes,{'tableName':_0x6a44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46fdb2,_0x51a29c,_0x36cf42){if(_0x46fdb2['changed'](_0x6a44('0xb'))){_0x46fdb2[_0x6a44('0xc')]=moment()[_0x6a44('0xd')](_0x6a44('0xe'));}_0x36cf42(null,_0x46fdb2);}},'charset':'utf8mb4','collate':_0x6a44('0xf')});}; \ No newline at end of file +var _0x867a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x867a,0x1b4));var _0xa867=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x867a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa867('0x0'));var logger=require(_0xa867('0x1'))(_0xa867('0x2'));var moment=require(_0xa867('0x3'));var BPromise=require(_0xa867('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa867('0x5'));var rimraf=require(_0xa867('0x6'));var config=require(_0xa867('0x7'));var attributes=require(_0xa867('0x8'));module[_0xa867('0x9')]=function(_0x13997b,_0x2d6c4f){return _0x13997b[_0xa867('0xa')]('ChatInteraction',attributes,{'tableName':_0xa867('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48fa8f,_0x52297f,_0xa27cd5){if(_0x48fa8f['changed']('closed')){_0x48fa8f[_0xa867('0xc')]=moment()[_0xa867('0xd')](_0xa867('0xe'));}_0xa27cd5(null,_0x48fa8f);}},'charset':'utf8mb4','collate':_0xa867('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a757226..c39665a 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 _0x113b=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatInteraction.socket','then'];(function(_0x30fa58,_0x51af0e){var _0x4598a8=function(_0x5d9e1f){while(--_0x5d9e1f){_0x30fa58['push'](_0x30fa58['shift']());}};_0x4598a8(++_0x51af0e);}(_0x113b,0x15f));var _0xb113=function(_0x211f5f,_0xc6daac){_0x211f5f=_0x211f5f-0x0;var _0x4feb86=_0x113b[_0x211f5f];return _0x4feb86;};'use strict';var _=require(_0xb113('0x0'));var util=require(_0xb113('0x1'));var moment=require(_0xb113('0x2'));var BPromise=require(_0xb113('0x3'));var rs=require(_0xb113('0x4'));var fs=require('fs');var Redis=require(_0xb113('0x5'));var db=require(_0xb113('0x6'))['db'];var utils=require(_0xb113('0x7'));var logger=require(_0xb113('0x8'))(_0xb113('0x9'));var config=require(_0xb113('0xa'));var jayson=require(_0xb113('0xb'));var client=jayson['client'][_0xb113('0xc')]({'port':0x232a});config['redis']=_[_0xb113('0xd')](config[_0xb113('0xe')],{'host':_0xb113('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb113('0xe')]));require(_0xb113('0x10'))['register'](socket);function respondWithRpcPromise(_0x562c62,_0x313e00,_0xa33b64){return new BPromise(function(_0x148bde,_0x58ad74){return client['request'](_0x562c62,_0xa33b64)[_0xb113('0x11')](function(_0x1e69b0){logger['info'](_0xb113('0x12'),_0x313e00,_0xb113('0x13'));logger[_0xb113('0x14')](_0xb113('0x15'),_0x313e00,_0xb113('0x13'),JSON[_0xb113('0x16')](_0x1e69b0));if(_0x1e69b0[_0xb113('0x17')]){if(_0x1e69b0[_0xb113('0x17')]['code']===0x1f4){logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x1e69b0['error'][_0xb113('0x18')]);return _0x58ad74(_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);}logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);return _0x148bde(_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);}else{logger[_0xb113('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x313e00,_0xb113('0x13'));_0x148bde(_0x1e69b0['result']['message']);}})[_0xb113('0x1a')](function(_0x44e629){logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x44e629);_0x58ad74(_0x44e629);});});}exports[_0xb113('0x1b')]=function(_0x3fa7cd){var _0x12c467=this;return new Promise(function(_0x362ad1,_0x53a476){return db[_0xb113('0x1c')]['update'](_0x3fa7cd[_0xb113('0x1d')],{'raw':_0x3fa7cd['options']?_0x3fa7cd[_0xb113('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa7cd['options']?_0x3fa7cd[_0xb113('0x1e')]['where']||null:null,'attributes':_0x3fa7cd[_0xb113('0x1e')]?_0x3fa7cd[_0xb113('0x1e')][_0xb113('0x1f')]||null:null,'limit':_0x3fa7cd[_0xb113('0x1e')]?_0x3fa7cd[_0xb113('0x1e')][_0xb113('0x20')]||null:null})['then'](function(_0x58b1ff){logger[_0xb113('0x19')](_0xb113('0x1b'),_0x3fa7cd);logger[_0xb113('0x14')](_0xb113('0x1b'),_0x3fa7cd,JSON[_0xb113('0x16')](_0x58b1ff));_0x362ad1(_0x58b1ff);})[_0xb113('0x1a')](function(_0x370945){logger[_0xb113('0x17')](_0xb113('0x1b'),_0x370945[_0xb113('0x18')],_0x3fa7cd);_0x53a476(_0x12c467[_0xb113('0x17')](0x1f4,_0x370945[_0xb113('0x18')]));});});};exports[_0xb113('0x21')]=function(_0x1f6c13){return new Promise(function(_0x1cbd8c,_0x4b7685){return db['ChatInteraction'][_0xb113('0x22')]({'where':_0x1f6c13[_0xb113('0x1e')]?_0x1f6c13[_0xb113('0x1e')][_0xb113('0x23')]||null:null})[_0xb113('0x11')](function(_0x1f0a01){if(_0x1f0a01){return _0x1f0a01[_0xb113('0x24')](_0x1f6c13[_0xb113('0x1d')][_0xb113('0x25')],_[_0xb113('0x26')](_0x1f6c13[_0xb113('0x1d')],[_0xb113('0x25'),'id'])||{});}})[_0xb113('0x27')](function(_0x379651){logger[_0xb113('0x19')](_0xb113('0x28'),_0x1f6c13);logger[_0xb113('0x14')]('AddTags',_0x1f6c13,JSON[_0xb113('0x16')](_0x379651));_0x1cbd8c(_0x379651);})[_0xb113('0x1a')](function(_0x3601d3){logger[_0xb113('0x17')](_0xb113('0x28'),_0x3601d3['message'],_0x1f6c13);_0x4b7685(_this[_0xb113('0x17')](0x1f4,_0x3601d3[_0xb113('0x18')]));});});}; \ No newline at end of file +var _0xdafe=['stringify','catch','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes'];(function(_0x150961,_0x211501){var _0x5e210c=function(_0x186414){while(--_0x186414){_0x150961['push'](_0x150961['shift']());}};_0x5e210c(++_0x211501);}(_0xdafe,0x182));var _0xedaf=function(_0x209609,_0x31ef4e){_0x209609=_0x209609-0x0;var _0x4aa468=_0xdafe[_0x209609];return _0x4aa468;};'use strict';var _=require(_0xedaf('0x0'));var util=require('util');var moment=require(_0xedaf('0x1'));var BPromise=require(_0xedaf('0x2'));var rs=require(_0xedaf('0x3'));var fs=require('fs');var Redis=require(_0xedaf('0x4'));var db=require(_0xedaf('0x5'))['db'];var utils=require(_0xedaf('0x6'));var logger=require(_0xedaf('0x7'))(_0xedaf('0x8'));var config=require(_0xedaf('0x9'));var jayson=require(_0xedaf('0xa'));var client=jayson[_0xedaf('0xb')][_0xedaf('0xc')]({'port':0x232a});config[_0xedaf('0xd')]=_['defaults'](config[_0xedaf('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xedaf('0xe'))(new Redis(config[_0xedaf('0xd')]));require(_0xedaf('0xf'))[_0xedaf('0x10')](socket);function respondWithRpcPromise(_0x4869f9,_0x32603c,_0x1a6df9){return new BPromise(function(_0x4a5a9b,_0x4bfafe){return client['request'](_0x4869f9,_0x1a6df9)[_0xedaf('0x11')](function(_0x134a28){logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));logger[_0xedaf('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x32603c,_0xedaf('0x14'),JSON['stringify'](_0x134a28));if(_0x134a28[_0xedaf('0x16')]){if(_0x134a28['error'][_0xedaf('0x17')]===0x1f4){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);return _0x4bfafe(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')]['message']);return _0x4a5a9b(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}else{logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));_0x4a5a9b(_0x134a28[_0xedaf('0x19')]['message']);}})['catch'](function(_0x233617){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x233617);_0x4bfafe(_0x233617);});});}exports[_0xedaf('0x1a')]=function(_0x4633ae){var _0x45a5b2=this;return new Promise(function(_0x5445f7,_0x33138d){return db[_0xedaf('0x1b')][_0xedaf('0x1c')](_0x4633ae[_0xedaf('0x1d')],{'raw':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null,'attributes':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae['options'][_0xedaf('0x21')]||null:null,'limit':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')]['limit']||null:null})['then'](function(_0x4ee380){logger[_0xedaf('0x12')](_0xedaf('0x1a'),_0x4633ae);logger['debug'](_0xedaf('0x1a'),_0x4633ae,JSON[_0xedaf('0x22')](_0x4ee380));_0x5445f7(_0x4ee380);})[_0xedaf('0x23')](function(_0x4a780f){logger['error'](_0xedaf('0x1a'),_0x4a780f[_0xedaf('0x18')],_0x4633ae);_0x33138d(_0x45a5b2['error'](0x1f4,_0x4a780f[_0xedaf('0x18')]));});});};exports[_0xedaf('0x24')]=function(_0x23f02e){return new Promise(function(_0x5c375f,_0x2a8b7d){return db[_0xedaf('0x1b')]['find']({'where':_0x23f02e[_0xedaf('0x1e')]?_0x23f02e[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null})[_0xedaf('0x11')](function(_0x3c0347){if(_0x3c0347){return _0x3c0347[_0xedaf('0x25')](_0x23f02e['body'][_0xedaf('0x26')],_[_0xedaf('0x27')](_0x23f02e[_0xedaf('0x1d')],[_0xedaf('0x26'),'id'])||{});}})[_0xedaf('0x28')](function(_0x4b41a3){logger['info']('AddTags',_0x23f02e);logger[_0xedaf('0x15')](_0xedaf('0x29'),_0x23f02e,JSON['stringify'](_0x4b41a3));_0x5c375f(_0x4b41a3);})[_0xedaf('0x23')](function(_0xfbb947){logger[_0xedaf('0x16')](_0xedaf('0x29'),_0xfbb947['message'],_0x23f02e);_0x2a8b7d(_this[_0xedaf('0x16')](0x1f4,_0xfbb947[_0xedaf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e49d1bf..e60a67f 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 _0x9500=['chatInteraction:','./chatInteraction.events','save','update','register','length'];(function(_0x5870c1,_0x173ba3){var _0x344685=function(_0x1984be){while(--_0x1984be){_0x5870c1['push'](_0x5870c1['shift']());}};_0x344685(++_0x173ba3);}(_0x9500,0x8b));var _0x0950=function(_0x1808f9,_0x322e07){_0x1808f9=_0x1808f9-0x0;var _0x2ffc89=_0x9500[_0x1808f9];return _0x2ffc89;};'use strict';var ChatInteractionEvents=require(_0x0950('0x0'));var events=[_0x0950('0x1'),'remove',_0x0950('0x2')];function createListener(_0x11f820,_0x49838d){return function(_0x1f6a8c){_0x49838d['emit'](_0x11f820,_0x1f6a8c);};}function removeListener(_0x388800,_0x1dd076){return function(){ChatInteractionEvents['removeListener'](_0x388800,_0x1dd076);};}exports[_0x0950('0x3')]=function(_0x2d1b1b){for(var _0xe88794=0x0,_0x228bdb=events[_0x0950('0x4')];_0xe88794<_0x228bdb;_0xe88794++){var _0x213e67=events[_0xe88794];var _0x53f009=createListener(_0x0950('0x5')+_0x213e67,_0x2d1b1b);ChatInteractionEvents['on'](_0x213e67,_0x53f009);}}; \ No newline at end of file +var _0x9865=['emit','removeListener','register','./chatInteraction.events','save','remove'];(function(_0x459cd7,_0x3a1c34){var _0x125653=function(_0x26c7e0){while(--_0x26c7e0){_0x459cd7['push'](_0x459cd7['shift']());}};_0x125653(++_0x3a1c34);}(_0x9865,0x1dd));var _0x5986=function(_0x12be85,_0x4a5721){_0x12be85=_0x12be85-0x0;var _0x5a1135=_0x9865[_0x12be85];return _0x5a1135;};'use strict';var ChatInteractionEvents=require(_0x5986('0x0'));var events=[_0x5986('0x1'),_0x5986('0x2'),'update'];function createListener(_0x2fac99,_0x13474e){return function(_0x16ba5f){_0x13474e[_0x5986('0x3')](_0x2fac99,_0x16ba5f);};}function removeListener(_0x38b430,_0xe8aa39){return function(){ChatInteractionEvents[_0x5986('0x4')](_0x38b430,_0xe8aa39);};}exports[_0x5986('0x5')]=function(_0x1f5e19){for(var _0x5757e5=0x0,_0x4c53ff=events['length'];_0x5757e5<_0x4c53ff;_0x5757e5++){var _0x5c3e3c=events[_0x5757e5];var _0x3ebd8b=createListener('chatInteraction:'+_0x5c3e3c,_0x1f5e19);ChatInteractionEvents['on'](_0x5c3e3c,_0x3ebd8b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4b9a1d0..a5ad6e4 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 _0xeb0d=['format','%s-%s','now','originalname','replace','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','show','isAuthenticated','getMessages','/:id/my_messages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xeb0d,0x17e));var _0xdeb0=function(_0x587a71,_0x332e22){_0x587a71=_0x587a71-0x0;var _0x4b9fea=_0xeb0d[_0x587a71];return _0x4b9fea;};'use strict';var multer=require(_0xdeb0('0x0'));var util=require(_0xdeb0('0x1'));var path=require(_0xdeb0('0x2'));var timeout=require(_0xdeb0('0x3'));var express=require(_0xdeb0('0x4'));var router=express['Router']();var fs_extra=require(_0xdeb0('0x5'));var auth=require(_0xdeb0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdeb0('0x7'));var controller=require(_0xdeb0('0x8'));router[_0xdeb0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdeb0('0x9')](_0xdeb0('0xa'),auth['isAuthenticated'](),controller[_0xdeb0('0xb')]);router[_0xdeb0('0x9')](_0xdeb0('0xc'),auth[_0xdeb0('0xd')](),controller[_0xdeb0('0xe')]);router['get']('/:id/attachment_download',auth[_0xdeb0('0xd')](),controller['attachmentDownload']);router[_0xdeb0('0x9')]('/:id/messages',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x10')]);router[_0xdeb0('0x9')](_0xdeb0('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get']('/:id/download',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x12')]);router[_0xdeb0('0x13')]('/',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x14')]);router[_0xdeb0('0x13')](_0xdeb0('0x15'),auth['isAuthenticated'](),controller[_0xdeb0('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf33cc,_0x2eaeae,_0x201eb3){_0x201eb3(null,path[_0xdeb0('0x17')](config[_0xdeb0('0x18')],_0xdeb0('0x19')));},'filename':function(_0x3b1bc0,_0x1f99ad,_0x4e3799){_0x4e3799(null,util[_0xdeb0('0x1a')](_0xdeb0('0x1b'),Date[_0xdeb0('0x1c')](),_0x1f99ad[_0xdeb0('0x1d')][_0xdeb0('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdeb0('0x13')]('/:id/attachment_upload',upload[_0xdeb0('0x1f')]('file'),controller[_0xdeb0('0x20')]);router['post'](_0xdeb0('0x21'),auth[_0xdeb0('0xd')](),controller[_0xdeb0('0x22')]);router[_0xdeb0('0x13')]('/:id/tags',auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')](_0xdeb0('0x24'),_0xdeb0('0x25')),controller[_0xdeb0('0x26')]);router[_0xdeb0('0x27')](_0xdeb0('0xc'),auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')](_0xdeb0('0x24'),_0xdeb0('0x28')),controller['update']);router[_0xdeb0('0x27')](_0xdeb0('0x29'),controller[_0xdeb0('0x2a')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xdeb0('0x2b')]);router['put'](_0xdeb0('0x2c'),controller[_0xdeb0('0x2d')]);router[_0xdeb0('0x2e')](_0xdeb0('0xc'),auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')]('chat',_0xdeb0('0x2f')),controller[_0xdeb0('0x30')]);router['delete'](_0xdeb0('0x31'),auth[_0xdeb0('0xf')](),controller['removeTags']);module[_0xdeb0('0x32')]=router; \ No newline at end of file +var _0xf6f6=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','destroy','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated'];(function(_0x1ecdaa,_0x32a5f5){var _0x141bb7=function(_0x496b1a){while(--_0x496b1a){_0x1ecdaa['push'](_0x1ecdaa['shift']());}};_0x141bb7(++_0x32a5f5);}(_0xf6f6,0xaf));var _0x6f6f=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xf6f6[_0x4c7935];return _0x30651d;};'use strict';var multer=require(_0x6f6f('0x0'));var util=require('util');var path=require(_0x6f6f('0x1'));var timeout=require(_0x6f6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f6f('0x3'));var auth=require(_0x6f6f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f6f('0x5'));var controller=require(_0x6f6f('0x6'));router[_0x6f6f('0x7')]('/',auth[_0x6f6f('0x8')](),controller['index']);router[_0x6f6f('0x7')]('/describe',auth[_0x6f6f('0x8')](),controller['describe']);router[_0x6f6f('0x7')](_0x6f6f('0x9'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xb')]);router[_0x6f6f('0x7')](_0x6f6f('0xc'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xd')]);router[_0x6f6f('0x7')](_0x6f6f('0xe'),auth['isAuthenticated'](),controller[_0x6f6f('0xf')]);router[_0x6f6f('0x7')](_0x6f6f('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x11')]);router['get'](_0x6f6f('0x12'),auth[_0x6f6f('0x8')](),controller[_0x6f6f('0x13')]);router[_0x6f6f('0x14')]('/',auth[_0x6f6f('0x8')](),controller['create']);router[_0x6f6f('0x14')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x6f6f('0x15')]);var upload=multer({'storage':multer[_0x6f6f('0x16')]({'destination':function(_0x44fa82,_0x4c855e,_0x47bad1){_0x47bad1(null,path['join'](config[_0x6f6f('0x17')],_0x6f6f('0x18')));},'filename':function(_0x280c8f,_0x396ba6,_0x29a2b8){_0x29a2b8(null,util[_0x6f6f('0x19')](_0x6f6f('0x1a'),Date[_0x6f6f('0x1b')](),_0x396ba6['originalname'][_0x6f6f('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6f6f('0x14')](_0x6f6f('0x1d'),upload['single'](_0x6f6f('0x1e')),controller[_0x6f6f('0x1f')]);router[_0x6f6f('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x20')]);router[_0x6f6f('0x14')](_0x6f6f('0x21'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:addtags'),controller['addTags']);router[_0x6f6f('0x24')](_0x6f6f('0x9'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:update'),controller[_0x6f6f('0x25')]);router[_0x6f6f('0x24')](_0x6f6f('0x26'),controller[_0x6f6f('0x27')]);router[_0x6f6f('0x24')]('/:id/abandon',auth[_0x6f6f('0xa')](),controller[_0x6f6f('0x28')]);router[_0x6f6f('0x24')](_0x6f6f('0x29'),controller['close']);router[_0x6f6f('0x2a')](_0x6f6f('0x9'),auth['isAuthenticated'](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:destroy'),controller[_0x6f6f('0x2b')]);router[_0x6f6f('0x2a')](_0x6f6f('0x21'),auth['isAuthenticated'](),controller[_0x6f6f('0x2c')]);module[_0x6f6f('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ca540b5..b7c6451 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 _0xac2d=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xac2d,0x1f4));var _0xdac2=function(_0x2f0f05,_0x2ef4e2){_0x2f0f05=_0x2f0f05-0x0;var _0x59ce36=_0xac2d[_0x2f0f05];return _0x59ce36;};'use strict';var Sequelize=require('sequelize');module[_0xdac2('0x0')]={'body':{'type':Sequelize[_0xdac2('0x1')](_0xdac2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdac2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdac2('0x4')]}}; \ No newline at end of file +var _0x75b2=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e14b7,_0x405dbc){var _0x4570f6=function(_0x29d285){while(--_0x29d285){_0x3e14b7['push'](_0x3e14b7['shift']());}};_0x4570f6(++_0x405dbc);}(_0x75b2,0x1c0));var _0x275b=function(_0x125597,_0x1d5ddd){_0x125597=_0x125597-0x0;var _0x5a6818=_0x75b2[_0x125597];return _0x5a6818;};'use strict';var Sequelize=require(_0x275b('0x0'));module[_0x275b('0x1')]={'body':{'type':Sequelize[_0x275b('0x2')](_0x275b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x275b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x275b('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9f9242f..9bd14be 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 _0x3bc8=['fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','ChatInternalMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','describe','messages','lastMessageAt','lastMessage','getUsers','User','agent','admin','user'];(function(_0x4dba31,_0x3ce4c5){var _0x35cec6=function(_0x2f272d){while(--_0x2f272d){_0x4dba31['push'](_0x4dba31['shift']());}};_0x35cec6(++_0x3ce4c5);}(_0x3bc8,0x160));var _0x83bc=function(_0x5d7ff4,_0x1384c1){_0x5d7ff4=_0x5d7ff4-0x0;var _0x3edd41=_0x3bc8[_0x5d7ff4];return _0x3edd41;};'use strict';var emlformat=require(_0x83bc('0x0'));var rimraf=require(_0x83bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x83bc('0x2'));var moment=require(_0x83bc('0x3'));var BPromise=require(_0x83bc('0x4'));var Mustache=require(_0x83bc('0x5'));var util=require(_0x83bc('0x6'));var path=require(_0x83bc('0x7'));var sox=require(_0x83bc('0x8'));var csv=require('to-csv');var ejs=require(_0x83bc('0x9'));var fs=require('fs');var fs_extra=require(_0x83bc('0xa'));var _=require(_0x83bc('0xb'));var squel=require(_0x83bc('0xc'));var crypto=require(_0x83bc('0xd'));var jsforce=require(_0x83bc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x83bc('0xf'));var querystring=require(_0x83bc('0x10'));var Papa=require('papaparse');var Redis=require(_0x83bc('0x11'));var authService=require(_0x83bc('0x12'));var qs=require(_0x83bc('0x13'));var as=require(_0x83bc('0x14'));var hardwareService=require(_0x83bc('0x15'));var logger=require(_0x83bc('0x16'))(_0x83bc('0x17'));var utils=require('../../config/utils');var config=require(_0x83bc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x83bc('0x19'))['db'];config[_0x83bc('0x1a')]=_['defaults'](config[_0x83bc('0x1a')],{'host':_0x83bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83bc('0x1a')]));require(_0x83bc('0x1c'))[_0x83bc('0x1d')](socket);function respondWithStatusCode(_0x2dca73,_0x43ef1b){_0x43ef1b=_0x43ef1b||0xcc;return function(_0xe95bef){if(_0xe95bef){return _0x2dca73[_0x83bc('0x1e')](_0x43ef1b);}return _0x2dca73['status'](_0x43ef1b)[_0x83bc('0x1f')]();};}function respondWithResult(_0xfcb918,_0x4aa4eb){_0x4aa4eb=_0x4aa4eb||0xc8;return function(_0x34a759){if(_0x34a759){return _0xfcb918[_0x83bc('0x20')](_0x4aa4eb)[_0x83bc('0x21')](_0x34a759);}};}function respondWithFilteredResult(_0x22fdf3,_0x19f246){return function(_0x2b7afa){if(_0x2b7afa){var _0x381642=typeof _0x19f246[_0x83bc('0x22')]===_0x83bc('0x23')&&typeof _0x19f246[_0x83bc('0x24')]==='undefined';var _0x1272f4=_0x2b7afa[_0x83bc('0x25')];var _0x424d65=_0x381642?0x0:_0x19f246[_0x83bc('0x22')];var _0x2216f4=_0x381642?_0x2b7afa[_0x83bc('0x25')]:_0x19f246[_0x83bc('0x22')]+_0x19f246[_0x83bc('0x24')];var _0x526014;if(_0x2216f4>=_0x1272f4){_0x2216f4=_0x1272f4;_0x526014=0xc8;}else{_0x526014=0xce;}_0x22fdf3['status'](_0x526014);return _0x22fdf3[_0x83bc('0x26')](_0x83bc('0x27'),_0x424d65+'-'+_0x2216f4+'/'+_0x1272f4)[_0x83bc('0x21')](_0x2b7afa);}return null;};}function patchUpdates(_0x134ab2){return function(_0x298a99){try{jsonpatch['apply'](_0x298a99,_0x134ab2,!![]);}catch(_0x3b606c){return BPromise[_0x83bc('0x28')](_0x3b606c);}return _0x298a99['save']();};}function saveUpdates(_0x1c4246,_0x14a684){return function(_0x381d17){if(_0x381d17){return _0x381d17[_0x83bc('0x29')](_0x1c4246)[_0x83bc('0x2a')](function(_0x3a6d8d){return _0x3a6d8d;});}return null;};}function removeEntity(_0x43ae7f,_0x10bd13){return function(_0x3a4b90){if(_0x3a4b90){return _0x3a4b90[_0x83bc('0x2b')]()['then'](function(){_0x43ae7f[_0x83bc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4330ec,_0x148709){return function(_0x2f01ef){if(!_0x2f01ef){_0x4330ec[_0x83bc('0x1e')](0x194);}return _0x2f01ef;};}function handleError(_0x162960,_0x2ca0c6){_0x2ca0c6=_0x2ca0c6||0x1f4;return function(_0x1a5de){logger[_0x83bc('0x2c')](_0x1a5de['stack']);if(_0x1a5de['name']){delete _0x1a5de[_0x83bc('0x2d')];}_0x162960['status'](_0x2ca0c6)[_0x83bc('0x2e')](_0x1a5de);};}exports['index']=function(_0x4daa60,_0x369b88){var _0x5724ff={},_0x2d0c01={},_0x4ce7ea={'count':0x0,'rows':[]};var _0x37faf2=_['map'](db[_0x83bc('0x2f')][_0x83bc('0x30')],function(_0x160900){return{'name':_0x160900['fieldName'],'type':_0x160900[_0x83bc('0x31')][_0x83bc('0x32')]};});_0x2d0c01[_0x83bc('0x33')]=_[_0x83bc('0x34')](_0x37faf2,_0x83bc('0x2d'));_0x2d0c01['query']=_[_0x83bc('0x35')](_0x4daa60[_0x83bc('0x36')]);_0x2d0c01[_0x83bc('0x37')]=_[_0x83bc('0x38')](_0x2d0c01['model'],_0x2d0c01[_0x83bc('0x36')]);_0x5724ff[_0x83bc('0x39')]=_['intersection'](_0x2d0c01[_0x83bc('0x33')],qs[_0x83bc('0x3a')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x3a')]));_0x5724ff[_0x83bc('0x39')]=_0x5724ff['attributes'][_0x83bc('0x3b')]?_0x5724ff[_0x83bc('0x39')]:_0x2d0c01[_0x83bc('0x33')];if(!_0x4daa60['query'][_0x83bc('0x3c')](_0x83bc('0x3d'))){_0x5724ff['limit']=qs['limit'](_0x4daa60['query'][_0x83bc('0x24')]);_0x5724ff[_0x83bc('0x22')]=qs[_0x83bc('0x22')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x22')]);}_0x5724ff[_0x83bc('0x3e')]=qs[_0x83bc('0x3f')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x3f')]);_0x5724ff[_0x83bc('0x40')]=qs[_0x83bc('0x37')](_[_0x83bc('0x41')](_0x4daa60[_0x83bc('0x36')],_0x2d0c01[_0x83bc('0x37')]),_0x37faf2);if(_0x4daa60[_0x83bc('0x36')][_0x83bc('0x42')]){_0x5724ff[_0x83bc('0x40')]=_[_0x83bc('0x43')](_0x5724ff['where'],{'$or':_['map'](_0x37faf2,function(_0x5202ca){if(_0x5202ca[_0x83bc('0x31')]!==_0x83bc('0x44')){var _0x5fcc26={};_0x5fcc26[_0x5202ca[_0x83bc('0x2d')]]={'$like':'%'+_0x4daa60[_0x83bc('0x36')][_0x83bc('0x42')]+'%'};return _0x5fcc26;}})});}_0x5724ff=_['merge']({},_0x5724ff,_0x4daa60['options']);var _0x3925dc={'where':_0x5724ff[_0x83bc('0x40')]};return db[_0x83bc('0x2f')]['count'](_0x3925dc)[_0x83bc('0x2a')](function(_0x2c7f62){_0x4ce7ea[_0x83bc('0x25')]=_0x2c7f62;if(_0x4daa60[_0x83bc('0x36')][_0x83bc('0x45')]){_0x5724ff[_0x83bc('0x46')]=[{'all':!![]}];}return db[_0x83bc('0x2f')][_0x83bc('0x47')](_0x5724ff);})[_0x83bc('0x2a')](function(_0xaef749){_0x4ce7ea[_0x83bc('0x48')]=_0xaef749;return _0x4ce7ea;})[_0x83bc('0x2a')](respondWithFilteredResult(_0x369b88,_0x5724ff))[_0x83bc('0x49')](handleError(_0x369b88,null));};exports[_0x83bc('0x4a')]=function(_0x5f0cd5,_0x1ea4fb){var _0x3328e9={'raw':!![],'where':{'id':_0x5f0cd5['params']['id']}},_0x36a1b2={};_0x36a1b2[_0x83bc('0x33')]=_[_0x83bc('0x35')](db[_0x83bc('0x2f')][_0x83bc('0x30')]);_0x36a1b2[_0x83bc('0x36')]=_[_0x83bc('0x35')](_0x5f0cd5[_0x83bc('0x36')]);_0x36a1b2['filters']=_[_0x83bc('0x38')](_0x36a1b2[_0x83bc('0x33')],_0x36a1b2[_0x83bc('0x36')]);_0x3328e9['attributes']=_[_0x83bc('0x38')](_0x36a1b2[_0x83bc('0x33')],qs['fields'](_0x5f0cd5[_0x83bc('0x36')]['fields']));_0x3328e9[_0x83bc('0x39')]=_0x3328e9[_0x83bc('0x39')][_0x83bc('0x3b')]?_0x3328e9['attributes']:_0x36a1b2['model'];if(_0x5f0cd5['query']['includeAll']){_0x3328e9['include']=[{'all':!![]}];}_0x3328e9=_[_0x83bc('0x43')]({},_0x3328e9,_0x5f0cd5[_0x83bc('0x4b')]);return db[_0x83bc('0x2f')][_0x83bc('0x4c')](_0x3328e9)[_0x83bc('0x2a')](handleEntityNotFound(_0x1ea4fb,null))[_0x83bc('0x2a')](respondWithResult(_0x1ea4fb,null))[_0x83bc('0x49')](handleError(_0x1ea4fb,null));};exports['create']=function(_0x43cf9e,_0x1dc7bb){return db[_0x83bc('0x2f')][_0x83bc('0x4d')](_0x43cf9e[_0x83bc('0x4e')],{})[_0x83bc('0x2a')](respondWithResult(_0x1dc7bb,0xc9))[_0x83bc('0x49')](handleError(_0x1dc7bb,null));};exports[_0x83bc('0x29')]=function(_0x4a9eb7,_0x3774de){if(_0x4a9eb7[_0x83bc('0x4e')]['id']){delete _0x4a9eb7['body']['id'];}return db[_0x83bc('0x2f')]['find']({'where':{'id':_0x4a9eb7['params']['id']}})[_0x83bc('0x2a')](handleEntityNotFound(_0x3774de,null))[_0x83bc('0x2a')](saveUpdates(_0x4a9eb7[_0x83bc('0x4e')],null))[_0x83bc('0x2a')](respondWithResult(_0x3774de,null))[_0x83bc('0x49')](handleError(_0x3774de,null));};exports[_0x83bc('0x2b')]=function(_0x47464a,_0x2529c9){return db['ChatInternalMessage']['find']({'where':{'id':_0x47464a['params']['id']}})[_0x83bc('0x2a')](handleEntityNotFound(_0x2529c9,null))['then'](removeEntity(_0x2529c9,null))[_0x83bc('0x49')](handleError(_0x2529c9,null));};exports[_0x83bc('0x4f')]=function(_0x3ffd6c,_0xc3887d){return db['ChatInternalMessage'][_0x83bc('0x4f')]()[_0x83bc('0x2a')](respondWithResult(_0xc3887d,null))[_0x83bc('0x49')](handleError(_0xc3887d,null));};function wrapUser(_0x384135){return function(_0x3dd356){var _0x389f55=_0x384135['get']({'plain':!![]});_0x389f55[_0x83bc('0x50')]=[];if(_0x3dd356){_0x389f55[_0x83bc('0x51')]=_0x3dd356['createdAt'];_0x389f55['lastMessage']=_0x3dd356;}else{_0x389f55[_0x83bc('0x51')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x389f55[_0x83bc('0x52')]={};}return _0x389f55;};}exports[_0x83bc('0x53')]=function(_0x19993b,_0x4a66b5,_0x14afbc){var _0x2151a5=[];return db[_0x83bc('0x54')][_0x83bc('0x47')]({'where':{'role':[_0x83bc('0x55'),_0x83bc('0x56'),_0x83bc('0x57')]},'attributes':['id',_0x83bc('0x58'),_0x83bc('0x2d'),_0x83bc('0x59'),'userpic',_0x83bc('0x5a'),'online',_0x83bc('0x5b'),_0x83bc('0x5c'),_0x83bc('0x5d')],'order':qs[_0x83bc('0x3f')](_0x83bc('0x5e')),'include':[{'model':db[_0x83bc('0x5f')],'as':_0x83bc('0x60'),'attributes':['id',_0x83bc('0x2d'),_0x83bc('0x31')],'through':{'attributes':[]}}]})[_0x83bc('0x2a')](function(_0x211b09){if(_0x211b09){var _0x11e988=_0x19993b['user']['get']({'plain':!![]});if(!_0x11e988)throw new Error(_0x83bc('0x61'));if(_0x11e988['role']===_0x83bc('0x57')){return db[_0x83bc('0x62')][_0x83bc('0x4c')]({'where':{'name':_0x83bc('0x63'),'userProfileId':_0x11e988[_0x83bc('0x64')]},'raw':!![]})[_0x83bc('0x2a')](function(_0x176e08){if(_0x176e08){if(_0x176e08[_0x83bc('0x65')]===0x0){return db[_0x83bc('0x66')][_0x83bc('0x47')]({'where':{'sectionId':_0x176e08['id']},'raw':!![]})[_0x83bc('0x2a')](function(_0x2c4495){var _0x5e65cf=[];if(_['isEmpty'](_0x2c4495)){_0x5e65cf=_[_0x83bc('0x42')](_0x211b09,function(_0x59fa74){if(_0x59fa74['role']!==_0x83bc('0x55')){return _0x59fa74;}});return _0x5e65cf;}else{for(var _0x5837bf=0x0;_0x5837bf<_0x211b09['length'];_0x5837bf++){var _0x5bd859=_0x211b09[_0x5837bf];if(_0x5bd859[_0x83bc('0x59')]===_0x83bc('0x55')){var _0x4665ad=_[_0x83bc('0x4c')](_0x2c4495,function(_0x40d219){return _0x40d219[_0x83bc('0x67')]===_0x5bd859['id'];});if(_0x4665ad)_0x5e65cf[_0x83bc('0x68')](_0x5bd859);}else{_0x5e65cf[_0x83bc('0x68')](_0x5bd859);}}return _0x5e65cf;}});}else{return _0x211b09;}}else{var _0x3c8eb4=_[_0x83bc('0x42')](_0x211b09,function(_0xa3610b){if(_0xa3610b['role']!=='agent'){return _0xa3610b;}});return _0x3c8eb4;}});}else{return _0x211b09;}}})[_0x83bc('0x2a')](function(_0x4ee8c4){var _0x196ba2=[];if(_0x4ee8c4){_0x2151a5=_0x4ee8c4;for(var _0x2fbc3d=0x0;_0x2fbc3d<_0x4ee8c4[_0x83bc('0x3b')];_0x2fbc3d+=0x1){_0x2151a5[_0x2fbc3d]['messages']=[];_0x196ba2[_0x83bc('0x68')](db[_0x83bc('0x2f')]['find']({'where':{'FromId':[_0x19993b[_0x83bc('0x57')]['id'],_0x4ee8c4[_0x2fbc3d]['id']],'ToId':[_0x19993b['user']['id'],_0x4ee8c4[_0x2fbc3d]['id']],'ChatGroupId':null},'attributes':['id',_0x83bc('0x69'),_0x83bc('0x6a'),'ToId',_0x83bc('0x6b'),'body'],'order':qs['sort'](_0x83bc('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x83bc('0x2a')](wrapUser(_0x4ee8c4[_0x2fbc3d])));}return BPromise[_0x83bc('0x6d')](_0x196ba2);}return[];})[_0x83bc('0x2a')](function(_0x1a12f7){return{'rows':_0x1a12f7,'count':_0x1a12f7[_0x83bc('0x3b')]};})[_0x83bc('0x2a')](respondWithResult(_0x4a66b5,null))['catch'](handleError(_0x4a66b5,null));}; \ No newline at end of file +var _0xe3cb=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','describe','get','messages','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatInternalMessage','type','model'];(function(_0x14e26d,_0x124ef0){var _0xef0fe2=function(_0x3103db){while(--_0x3103db){_0x14e26d['push'](_0x14e26d['shift']());}};_0xef0fe2(++_0x124ef0);}(_0xe3cb,0x11c));var _0xbe3c=function(_0x3ccd94,_0x3d8018){_0x3ccd94=_0x3ccd94-0x0;var _0x49686c=_0xe3cb[_0x3ccd94];return _0x49686c;};'use strict';var emlformat=require(_0xbe3c('0x0'));var rimraf=require(_0xbe3c('0x1'));var zipdir=require(_0xbe3c('0x2'));var jsonpatch=require(_0xbe3c('0x3'));var rp=require('request-promise');var moment=require(_0xbe3c('0x4'));var BPromise=require(_0xbe3c('0x5'));var Mustache=require(_0xbe3c('0x6'));var util=require(_0xbe3c('0x7'));var path=require(_0xbe3c('0x8'));var sox=require(_0xbe3c('0x9'));var csv=require('to-csv');var ejs=require(_0xbe3c('0xa'));var fs=require('fs');var fs_extra=require(_0xbe3c('0xb'));var _=require(_0xbe3c('0xc'));var squel=require(_0xbe3c('0xd'));var crypto=require(_0xbe3c('0xe'));var jsforce=require(_0xbe3c('0xf'));var deskjs=require(_0xbe3c('0x10'));var toCsv=require(_0xbe3c('0x11'));var querystring=require(_0xbe3c('0x12'));var Papa=require(_0xbe3c('0x13'));var Redis=require(_0xbe3c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xbe3c('0x15'));var as=require(_0xbe3c('0x16'));var hardwareService=require(_0xbe3c('0x17'));var logger=require('../../config/logger')(_0xbe3c('0x18'));var utils=require('../../config/utils');var config=require(_0xbe3c('0x19'));var licenseUtil=require(_0xbe3c('0x1a'));var db=require(_0xbe3c('0x1b'))['db'];config[_0xbe3c('0x1c')]=_[_0xbe3c('0x1d')](config['redis'],{'host':_0xbe3c('0x1e'),'port':0x18eb});var socket=require(_0xbe3c('0x1f'))(new Redis(config[_0xbe3c('0x1c')]));require('./chatInternalMessage.socket')[_0xbe3c('0x20')](socket);function respondWithStatusCode(_0x502029,_0x128858){_0x128858=_0x128858||0xcc;return function(_0x15172f){if(_0x15172f){return _0x502029[_0xbe3c('0x21')](_0x128858);}return _0x502029[_0xbe3c('0x22')](_0x128858)[_0xbe3c('0x23')]();};}function respondWithResult(_0x75609f,_0x1aff71){_0x1aff71=_0x1aff71||0xc8;return function(_0x1d2b38){if(_0x1d2b38){return _0x75609f['status'](_0x1aff71)[_0xbe3c('0x24')](_0x1d2b38);}};}function respondWithFilteredResult(_0x55a3a9,_0x5b762e){return function(_0x19afc2){if(_0x19afc2){var _0xb33d7b=typeof _0x5b762e['offset']===_0xbe3c('0x25')&&typeof _0x5b762e[_0xbe3c('0x26')]===_0xbe3c('0x25');var _0x2219ca=_0x19afc2[_0xbe3c('0x27')];var _0x326745=_0xb33d7b?0x0:_0x5b762e[_0xbe3c('0x28')];var _0x1b0470=_0xb33d7b?_0x19afc2[_0xbe3c('0x27')]:_0x5b762e[_0xbe3c('0x28')]+_0x5b762e[_0xbe3c('0x26')];var _0x4a09b8;if(_0x1b0470>=_0x2219ca){_0x1b0470=_0x2219ca;_0x4a09b8=0xc8;}else{_0x4a09b8=0xce;}_0x55a3a9[_0xbe3c('0x22')](_0x4a09b8);return _0x55a3a9['set'](_0xbe3c('0x29'),_0x326745+'-'+_0x1b0470+'/'+_0x2219ca)[_0xbe3c('0x24')](_0x19afc2);}return null;};}function patchUpdates(_0x7ebad7){return function(_0x117d15){try{jsonpatch[_0xbe3c('0x2a')](_0x117d15,_0x7ebad7,!![]);}catch(_0x1ace9d){return BPromise[_0xbe3c('0x2b')](_0x1ace9d);}return _0x117d15[_0xbe3c('0x2c')]();};}function saveUpdates(_0x507368,_0x5a5643){return function(_0x4a61c4){if(_0x4a61c4){return _0x4a61c4[_0xbe3c('0x2d')](_0x507368)[_0xbe3c('0x2e')](function(_0x2e005c){return _0x2e005c;});}return null;};}function removeEntity(_0x17657f,_0x48abb9){return function(_0x331566){if(_0x331566){return _0x331566[_0xbe3c('0x2f')]()[_0xbe3c('0x2e')](function(){_0x17657f[_0xbe3c('0x22')](0xcc)[_0xbe3c('0x23')]();});}};}function handleEntityNotFound(_0x433665,_0x5b152c){return function(_0x3dfde7){if(!_0x3dfde7){_0x433665[_0xbe3c('0x21')](0x194);}return _0x3dfde7;};}function handleError(_0xc79910,_0x161cf1){_0x161cf1=_0x161cf1||0x1f4;return function(_0x1928f4){logger[_0xbe3c('0x30')](_0x1928f4[_0xbe3c('0x31')]);if(_0x1928f4[_0xbe3c('0x32')]){delete _0x1928f4['name'];}_0xc79910['status'](_0x161cf1)['send'](_0x1928f4);};}exports['index']=function(_0x4bf8d4,_0x410113){var _0x1ee5e8={},_0x24804e={},_0x1ece8d={'count':0x0,'rows':[]};var _0x9f2d1e=_[_0xbe3c('0x33')](db[_0xbe3c('0x34')]['rawAttributes'],function(_0x42707d){return{'name':_0x42707d['fieldName'],'type':_0x42707d[_0xbe3c('0x35')]['key']};});_0x24804e[_0xbe3c('0x36')]=_[_0xbe3c('0x33')](_0x9f2d1e,_0xbe3c('0x32'));_0x24804e[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x4bf8d4[_0xbe3c('0x37')]);_0x24804e[_0xbe3c('0x39')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],_0x24804e[_0xbe3c('0x37')]);_0x1ee5e8[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],qs['fields'](_0x4bf8d4['query'][_0xbe3c('0x3c')]));_0x1ee5e8[_0xbe3c('0x3b')]=_0x1ee5e8['attributes'][_0xbe3c('0x3d')]?_0x1ee5e8[_0xbe3c('0x3b')]:_0x24804e[_0xbe3c('0x36')];if(!_0x4bf8d4['query'][_0xbe3c('0x3e')](_0xbe3c('0x3f'))){_0x1ee5e8[_0xbe3c('0x26')]=qs[_0xbe3c('0x26')](_0x4bf8d4['query'][_0xbe3c('0x26')]);_0x1ee5e8[_0xbe3c('0x28')]=qs[_0xbe3c('0x28')](_0x4bf8d4[_0xbe3c('0x37')]['offset']);}_0x1ee5e8[_0xbe3c('0x40')]=qs[_0xbe3c('0x41')](_0x4bf8d4['query'][_0xbe3c('0x41')]);_0x1ee5e8['where']=qs['filters'](_[_0xbe3c('0x42')](_0x4bf8d4[_0xbe3c('0x37')],_0x24804e['filters']),_0x9f2d1e);if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x43')]){_0x1ee5e8['where']=_[_0xbe3c('0x44')](_0x1ee5e8[_0xbe3c('0x45')],{'$or':_[_0xbe3c('0x33')](_0x9f2d1e,function(_0xd84bdf){if(_0xd84bdf[_0xbe3c('0x35')]!==_0xbe3c('0x46')){var _0x3b24bb={};_0x3b24bb[_0xd84bdf[_0xbe3c('0x32')]]={'$like':'%'+_0x4bf8d4['query']['filter']+'%'};return _0x3b24bb;}})});}_0x1ee5e8=_['merge']({},_0x1ee5e8,_0x4bf8d4[_0xbe3c('0x47')]);var _0x30db93={'where':_0x1ee5e8['where']};return db[_0xbe3c('0x34')]['count'](_0x30db93)['then'](function(_0x47ae32){_0x1ece8d[_0xbe3c('0x27')]=_0x47ae32;if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x1ee5e8[_0xbe3c('0x49')]=[{'all':!![]}];}return db[_0xbe3c('0x34')][_0xbe3c('0x4a')](_0x1ee5e8);})[_0xbe3c('0x2e')](function(_0x53ef9b){_0x1ece8d[_0xbe3c('0x4b')]=_0x53ef9b;return _0x1ece8d;})[_0xbe3c('0x2e')](respondWithFilteredResult(_0x410113,_0x1ee5e8))[_0xbe3c('0x4c')](handleError(_0x410113,null));};exports['show']=function(_0x3d62ff,_0x216f85){var _0x40c542={'raw':!![],'where':{'id':_0x3d62ff[_0xbe3c('0x4d')]['id']}},_0x435493={};_0x435493['model']=_[_0xbe3c('0x38')](db[_0xbe3c('0x34')][_0xbe3c('0x4e')]);_0x435493[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x3d62ff['query']);_0x435493['filters']=_[_0xbe3c('0x3a')](_0x435493['model'],_0x435493[_0xbe3c('0x37')]);_0x40c542[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x435493[_0xbe3c('0x36')],qs[_0xbe3c('0x3c')](_0x3d62ff['query'][_0xbe3c('0x3c')]));_0x40c542[_0xbe3c('0x3b')]=_0x40c542['attributes'][_0xbe3c('0x3d')]?_0x40c542['attributes']:_0x435493[_0xbe3c('0x36')];if(_0x3d62ff[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x40c542['include']=[{'all':!![]}];}_0x40c542=_[_0xbe3c('0x44')]({},_0x40c542,_0x3d62ff['options']);return db['ChatInternalMessage']['find'](_0x40c542)['then'](handleEntityNotFound(_0x216f85,null))['then'](respondWithResult(_0x216f85,null))[_0xbe3c('0x4c')](handleError(_0x216f85,null));};exports[_0xbe3c('0x4f')]=function(_0x2a6bdb,_0x5b5d78){return db['ChatInternalMessage']['create'](_0x2a6bdb[_0xbe3c('0x50')],{})[_0xbe3c('0x2e')](respondWithResult(_0x5b5d78,0xc9))[_0xbe3c('0x4c')](handleError(_0x5b5d78,null));};exports[_0xbe3c('0x2d')]=function(_0x33bac2,_0x2d66f4){if(_0x33bac2['body']['id']){delete _0x33bac2['body']['id'];}return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x33bac2[_0xbe3c('0x4d')]['id']}})[_0xbe3c('0x2e')](handleEntityNotFound(_0x2d66f4,null))['then'](saveUpdates(_0x33bac2['body'],null))[_0xbe3c('0x2e')](respondWithResult(_0x2d66f4,null))['catch'](handleError(_0x2d66f4,null));};exports[_0xbe3c('0x2f')]=function(_0x5336d0,_0x36d4b5){return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x5336d0[_0xbe3c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36d4b5,null))[_0xbe3c('0x2e')](removeEntity(_0x36d4b5,null))[_0xbe3c('0x4c')](handleError(_0x36d4b5,null));};exports[_0xbe3c('0x51')]=function(_0x1ad725,_0x1bc3b5){return db[_0xbe3c('0x34')][_0xbe3c('0x51')]()[_0xbe3c('0x2e')](respondWithResult(_0x1bc3b5,null))['catch'](handleError(_0x1bc3b5,null));};function wrapUser(_0x33fdd0){return function(_0x35fc4a){var _0x380501=_0x33fdd0[_0xbe3c('0x52')]({'plain':!![]});_0x380501[_0xbe3c('0x53')]=[];if(_0x35fc4a){_0x380501['lastMessageAt']=_0x35fc4a[_0xbe3c('0x54')];_0x380501[_0xbe3c('0x55')]=_0x35fc4a;}else{_0x380501['lastMessageAt']=moment(0x0)[_0xbe3c('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x380501[_0xbe3c('0x55')]={};}return _0x380501;};}exports[_0xbe3c('0x57')]=function(_0x41af49,_0x2c2439,_0x5e7164){var _0x4c7012=[];return db[_0xbe3c('0x58')][_0xbe3c('0x4a')]({'where':{'role':[_0xbe3c('0x59'),_0xbe3c('0x5a'),'user']},'attributes':['id',_0xbe3c('0x5b'),_0xbe3c('0x32'),'role','userpic',_0xbe3c('0x5c'),_0xbe3c('0x5d'),_0xbe3c('0x5e'),_0xbe3c('0x5f'),'showWebBar'],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x60')),'include':[{'model':db[_0xbe3c('0x61')],'as':'VoiceQueues','attributes':['id',_0xbe3c('0x32'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x31572f){if(_0x31572f){var _0x114473=_0x41af49[_0xbe3c('0x62')]['get']({'plain':!![]});if(!_0x114473)throw new Error(_0xbe3c('0x63'));if(_0x114473[_0xbe3c('0x64')]===_0xbe3c('0x62')){return db[_0xbe3c('0x65')][_0xbe3c('0x66')]({'where':{'name':_0xbe3c('0x67'),'userProfileId':_0x114473['userProfileId']},'raw':!![]})[_0xbe3c('0x2e')](function(_0x389dbd){if(_0x389dbd){if(_0x389dbd[_0xbe3c('0x68')]===0x0){return db[_0xbe3c('0x69')][_0xbe3c('0x4a')]({'where':{'sectionId':_0x389dbd['id']},'raw':!![]})['then'](function(_0x577e87){var _0x52eed0=[];if(_[_0xbe3c('0x6a')](_0x577e87)){_0x52eed0=_[_0xbe3c('0x43')](_0x31572f,function(_0x916437){if(_0x916437[_0xbe3c('0x64')]!==_0xbe3c('0x59')){return _0x916437;}});return _0x52eed0;}else{for(var _0x4473e8=0x0;_0x4473e8<_0x31572f['length'];_0x4473e8++){var _0x3fe62b=_0x31572f[_0x4473e8];if(_0x3fe62b[_0xbe3c('0x64')]===_0xbe3c('0x59')){var _0x9d6caf=_['find'](_0x577e87,function(_0x1f5d0e){return _0x1f5d0e[_0xbe3c('0x6b')]===_0x3fe62b['id'];});if(_0x9d6caf)_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}else{_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}}return _0x52eed0;}});}else{return _0x31572f;}}else{var _0xcf8a7f=_['filter'](_0x31572f,function(_0x28171a){if(_0x28171a['role']!==_0xbe3c('0x59')){return _0x28171a;}});return _0xcf8a7f;}});}else{return _0x31572f;}}})[_0xbe3c('0x2e')](function(_0x359d94){var _0x504af7=[];if(_0x359d94){_0x4c7012=_0x359d94;for(var _0x12b923=0x0;_0x12b923<_0x359d94[_0xbe3c('0x3d')];_0x12b923+=0x1){_0x4c7012[_0x12b923][_0xbe3c('0x53')]=[];_0x504af7[_0xbe3c('0x6c')](db['ChatInternalMessage'][_0xbe3c('0x66')]({'where':{'FromId':[_0x41af49['user']['id'],_0x359d94[_0x12b923]['id']],'ToId':[_0x41af49[_0xbe3c('0x62')]['id'],_0x359d94[_0x12b923]['id']],'ChatGroupId':null},'attributes':['id',_0xbe3c('0x54'),'FromId',_0xbe3c('0x6d'),_0xbe3c('0x6e'),_0xbe3c('0x50')],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbe3c('0x2e')](wrapUser(_0x359d94[_0x12b923])));}return BPromise[_0xbe3c('0x70')](_0x504af7);}return[];})[_0xbe3c('0x2e')](function(_0x1ba77c){return{'rows':_0x1ba77c,'count':_0x1ba77c[_0xbe3c('0x3d')]};})[_0xbe3c('0x2e')](respondWithResult(_0x2c2439,null))[_0xbe3c('0x4c')](handleError(_0x2c2439,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7fd5ef0..546ff8e 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 _0xed53=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x9c9f1c,_0x326a86){var _0x7e30d2=function(_0x44d78e){while(--_0x44d78e){_0x9c9f1c['push'](_0x9c9f1c['shift']());}};_0x7e30d2(++_0x326a86);}(_0xed53,0xf9));var _0x3ed5=function(_0x1bc9b0,_0x3ff7fe){_0x1bc9b0=_0x1bc9b0-0x0;var _0xb8efcc=_0xed53[_0x1bc9b0];return _0xb8efcc;};'use strict';var EventEmitter=require(_0x3ed5('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3ed5('0x1')](0x0);var events={'afterCreate':_0x3ed5('0x2'),'afterUpdate':_0x3ed5('0x3'),'afterDestroy':_0x3ed5('0x4')};function emitEvent(_0x38d682){return function(_0x185c13,_0x439f64,_0x2485a9){ChatInternalMessageEvents[_0x3ed5('0x5')](_0x38d682+':'+_0x185c13['id'],_0x185c13);ChatInternalMessageEvents[_0x3ed5('0x5')](_0x38d682,_0x185c13);_0x2485a9(null);};}for(var e in events){if(events[_0x3ed5('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3ed5('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x3bc0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3bc0,0xec));var _0x03bc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x3bc0[_0xe73080];return _0x12cbc4;};'use strict';var EventEmitter=require(_0x03bc('0x0'));var ChatInternalMessage=require(_0x03bc('0x1'))['db'][_0x03bc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03bc('0x3')](0x0);var events={'afterCreate':_0x03bc('0x4'),'afterUpdate':_0x03bc('0x5'),'afterDestroy':_0x03bc('0x6')};function emitEvent(_0x4a7840){return function(_0x59a8a0,_0x2caa44,_0x4668d3){ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840+':'+_0x59a8a0['id'],_0x59a8a0);ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840,_0x59a8a0);_0x4668d3(null);};}for(var e in events){if(events[_0x03bc('0x8')](e)){var event=events[e];ChatInternalMessage[_0x03bc('0x9')](e,emitEvent(event));}}module[_0x03bc('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7ed06d0..b0ec637 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 _0xb080=['utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4'];(function(_0x1c052f,_0xc383d3){var _0x1829b1=function(_0x1d31c2){while(--_0x1d31c2){_0x1c052f['push'](_0x1c052f['shift']());}};_0x1829b1(++_0xc383d3);}(_0xb080,0xfe));var _0x0b08=function(_0x361600,_0x2934b2){_0x361600=_0x361600-0x0;var _0x4c3bfe=_0xb080[_0x361600];return _0x4c3bfe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b08('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0b08('0x1'));var rp=require(_0x0b08('0x2'));var fs=require('fs');var path=require(_0x0b08('0x3'));var rimraf=require('rimraf');var config=require(_0x0b08('0x4'));var attributes=require(_0x0b08('0x5'));module[_0x0b08('0x6')]=function(_0x3a546b,_0xd78b82){return _0x3a546b[_0x0b08('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x0b08('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b08('0x9'),'collate':_0x0b08('0xa')});}; \ No newline at end of file +var _0xa85b=['exports','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x19708b,_0xe342c1){var _0xebb783=function(_0x1fa024){while(--_0x1fa024){_0x19708b['push'](_0x19708b['shift']());}};_0xebb783(++_0xe342c1);}(_0xa85b,0x1ce));var _0xba85=function(_0x5da099,_0x4c0874){_0x5da099=_0x5da099-0x0;var _0x2336db=_0xa85b[_0x5da099];return _0x2336db;};'use strict';var _=require(_0xba85('0x0'));var util=require('util');var logger=require(_0xba85('0x1'))(_0xba85('0x2'));var moment=require(_0xba85('0x3'));var BPromise=require('bluebird');var rp=require(_0xba85('0x4'));var fs=require('fs');var path=require(_0xba85('0x5'));var rimraf=require(_0xba85('0x6'));var config=require('../../config/environment');var attributes=require(_0xba85('0x7'));module[_0xba85('0x8')]=function(_0x5e0bf5,_0x3fb318){return _0x5e0bf5['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba85('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6dd92d7..85cf001 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 _0x24f5=['http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x24f5,0x1ee));var _0x524f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x24f5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var moment=require(_0x524f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x524f('0x3'));var db=require(_0x524f('0x4'))['db'];var utils=require(_0x524f('0x5'));var logger=require(_0x524f('0x6'))(_0x524f('0x7'));var config=require(_0x524f('0x8'));var jayson=require(_0x524f('0x9'));var client=jayson['client'][_0x524f('0xa')]({'port':0x232a});config[_0x524f('0xb')]=_['defaults'](config['redis'],{'host':_0x524f('0xc'),'port':0x18eb});var socket=require(_0x524f('0xd'))(new Redis(config[_0x524f('0xb')]));require(_0x524f('0xe'))['register'](socket);function respondWithRpcPromise(_0x2543bc,_0x6a84e2,_0x7d62ad){return new BPromise(function(_0x5b1328,_0x39b202){return client[_0x524f('0xf')](_0x2543bc,_0x7d62ad)[_0x524f('0x10')](function(_0x5c9580){logger[_0x524f('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x6a84e2,_0x524f('0x12'));logger[_0x524f('0x13')](_0x524f('0x14'),_0x6a84e2,_0x524f('0x12'),JSON[_0x524f('0x15')](_0x5c9580));if(_0x5c9580[_0x524f('0x16')]){if(_0x5c9580['error'][_0x524f('0x17')]===0x1f4){logger[_0x524f('0x16')](_0x524f('0x18'),_0x6a84e2,_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);return _0x39b202(_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);}logger[_0x524f('0x16')](_0x524f('0x18'),_0x6a84e2,_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);return _0x5b1328(_0x5c9580[_0x524f('0x16')]['message']);}else{logger[_0x524f('0x11')](_0x524f('0x18'),_0x6a84e2,_0x524f('0x12'));_0x5b1328(_0x5c9580[_0x524f('0x1a')]['message']);}})[_0x524f('0x1b')](function(_0x23e594){logger['error'](_0x524f('0x18'),_0x6a84e2,_0x23e594);_0x39b202(_0x23e594);});});} \ No newline at end of file +var _0x7fac=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x223394,_0x2a99ca){var _0x2eb43b=function(_0xfddc3d){while(--_0xfddc3d){_0x223394['push'](_0x223394['shift']());}};_0x2eb43b(++_0x2a99ca);}(_0x7fac,0x137));var _0xc7fa=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x7fac[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xc7fa('0x0'));var util=require('util');var moment=require(_0xc7fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7fa('0x2'));var fs=require('fs');var Redis=require(_0xc7fa('0x3'));var db=require(_0xc7fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7fa('0x5'))(_0xc7fa('0x6'));var config=require(_0xc7fa('0x7'));var jayson=require(_0xc7fa('0x8'));var client=jayson[_0xc7fa('0x9')][_0xc7fa('0xa')]({'port':0x232a});config[_0xc7fa('0xb')]=_[_0xc7fa('0xc')](config[_0xc7fa('0xb')],{'host':_0xc7fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7fa('0xb')]));require(_0xc7fa('0xe'))[_0xc7fa('0xf')](socket);function respondWithRpcPromise(_0x30aa72,_0x58b60a,_0x40ad16){return new BPromise(function(_0x8c070c,_0x882892){return client[_0xc7fa('0x10')](_0x30aa72,_0x40ad16)[_0xc7fa('0x11')](function(_0x1e78a2){logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));logger['debug'](_0xc7fa('0x15'),_0x58b60a,_0xc7fa('0x14'),JSON[_0xc7fa('0x16')](_0x1e78a2));if(_0x1e78a2[_0xc7fa('0x17')]){if(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x18')]===0x1f4){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);return _0x882892(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);}logger[_0xc7fa('0x17')](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2['error'][_0xc7fa('0x19')]);return _0x8c070c(_0x1e78a2['error'][_0xc7fa('0x19')]);}else{logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));_0x8c070c(_0x1e78a2['result'][_0xc7fa('0x19')]);}})[_0xc7fa('0x1a')](function(_0x922fa2){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x922fa2);_0x882892(_0x922fa2);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index add7062..2406ad2 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 _0xc0ff=['update','emit','removeListener','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x44433d,_0xf56466){var _0x2a5fce=function(_0x4d1d79){while(--_0x4d1d79){_0x44433d['push'](_0x44433d['shift']());}};_0x2a5fce(++_0xf56466);}(_0xc0ff,0x1d2));var _0xfc0f=function(_0x2acd64,_0x4e8ce8){_0x2acd64=_0x2acd64-0x0;var _0x3d3fce=_0xc0ff[_0x2acd64];return _0x3d3fce;};'use strict';var ChatInternalMessageEvents=require(_0xfc0f('0x0'));var events=[_0xfc0f('0x1'),'remove',_0xfc0f('0x2')];function createListener(_0x3535d6,_0x5b67e1){return function(_0x430e47){_0x5b67e1[_0xfc0f('0x3')](_0x3535d6,_0x430e47);};}function removeListener(_0x3a0713,_0x2d36db){return function(){ChatInternalMessageEvents[_0xfc0f('0x4')](_0x3a0713,_0x2d36db);};}exports['register']=function(_0x1956fc){for(var _0x7b5341=0x0,_0x558b6e=events['length'];_0x7b5341<_0x558b6e;_0x7b5341++){var _0x3d46ca=events[_0x7b5341];var _0x109e67=createListener(_0xfc0f('0x5')+_0x3d46ca,_0x1956fc);ChatInternalMessageEvents['on'](_0x3d46ca,_0x109e67);}}; \ No newline at end of file +var _0x534c=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','length'];(function(_0x15c80a,_0xa0a750){var _0x153e1f=function(_0x15dca1){while(--_0x15dca1){_0x15c80a['push'](_0x15c80a['shift']());}};_0x153e1f(++_0xa0a750);}(_0x534c,0xfd));var _0xc534=function(_0xfe3bae,_0x5d97fa){_0xfe3bae=_0xfe3bae-0x0;var _0x5c3f54=_0x534c[_0xfe3bae];return _0x5c3f54;};'use strict';var ChatInternalMessageEvents=require(_0xc534('0x0'));var events=[_0xc534('0x1'),_0xc534('0x2'),'update'];function createListener(_0x10b2b5,_0x598e66){return function(_0x2ef186){_0x598e66[_0xc534('0x3')](_0x10b2b5,_0x2ef186);};}function removeListener(_0x5ad847,_0x5cd356){return function(){ChatInternalMessageEvents['removeListener'](_0x5ad847,_0x5cd356);};}exports['register']=function(_0x3a9138){for(var _0x456655=0x0,_0x78c61e=events[_0xc534('0x4')];_0x456655<_0x78c61e;_0x456655++){var _0x309685=events[_0x456655];var _0x467fd7=createListener(_0xc534('0x5')+_0x309685,_0x3a9138);ChatInternalMessageEvents['on'](_0x309685,_0x467fd7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5f18c97..17da2ec 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 _0x3436=['isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','index','/describe'];(function(_0x58f1c7,_0x1f2630){var _0x57adbe=function(_0x110138){while(--_0x110138){_0x58f1c7['push'](_0x58f1c7['shift']());}};_0x57adbe(++_0x1f2630);}(_0x3436,0x1b6));var _0x6343=function(_0x337eb3,_0x399261){_0x337eb3=_0x337eb3-0x0;var _0x2877a6=_0x3436[_0x337eb3];return _0x2877a6;};'use strict';var multer=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var path=require(_0x6343('0x2'));var timeout=require(_0x6343('0x3'));var express=require(_0x6343('0x4'));var router=express[_0x6343('0x5')]();var fs_extra=require(_0x6343('0x6'));var auth=require(_0x6343('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6343('0x8'));router[_0x6343('0x9')]('/',auth['isAuthenticated'](),controller[_0x6343('0xa')]);router[_0x6343('0x9')](_0x6343('0xb'),auth[_0x6343('0xc')](),controller[_0x6343('0xd')]);router[_0x6343('0x9')](_0x6343('0xe'),auth[_0x6343('0xc')](),controller[_0x6343('0xf')]);router[_0x6343('0x9')](_0x6343('0x10'),auth[_0x6343('0xc')](),controller[_0x6343('0x11')]);router[_0x6343('0x12')]('/',auth[_0x6343('0xc')](),controller[_0x6343('0x13')]);router[_0x6343('0x14')](_0x6343('0x10'),controller[_0x6343('0x15')]);router[_0x6343('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6343('0x17')]);module[_0x6343('0x18')]=router; \ No newline at end of file +var _0xf197=['path','Router','../../config/environment','isAuthenticated','index','get','/describe','describe','getUsers','show','post','put','update','delete','/:id','exports','multer','util'];(function(_0x4cf8a9,_0xb488cf){var _0x3528e2=function(_0x4c065d){while(--_0x4c065d){_0x4cf8a9['push'](_0x4cf8a9['shift']());}};_0x3528e2(++_0xb488cf);}(_0xf197,0x130));var _0x7f19=function(_0x442435,_0x57c938){_0x442435=_0x442435-0x0;var _0x459823=_0xf197[_0x442435];return _0x459823;};'use strict';var multer=require(_0x7f19('0x0'));var util=require(_0x7f19('0x1'));var path=require(_0x7f19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f19('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f19('0x4'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x7f19('0x5')](),controller[_0x7f19('0x6')]);router[_0x7f19('0x7')](_0x7f19('0x8'),auth[_0x7f19('0x5')](),controller[_0x7f19('0x9')]);router[_0x7f19('0x7')]('/users',auth[_0x7f19('0x5')](),controller[_0x7f19('0xa')]);router[_0x7f19('0x7')]('/:id',auth[_0x7f19('0x5')](),controller[_0x7f19('0xb')]);router[_0x7f19('0xc')]('/',auth[_0x7f19('0x5')](),controller['create']);router[_0x7f19('0xd')]('/:id',controller[_0x7f19('0xe')]);router[_0x7f19('0xf')](_0x7f19('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f19('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 76af87c..4e5c2e1 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 _0x351d=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x4744b1,_0x1f53ed){var _0xa1e07=function(_0x3a1e89){while(--_0x3a1e89){_0x4744b1['push'](_0x4744b1['shift']());}};_0xa1e07(++_0x1f53ed);}(_0x351d,0x90));var _0xd351=function(_0x4c533d,_0x3cc214){_0x4c533d=_0x4c533d-0x0;var _0x49b304=_0x351d[_0x4c533d];return _0x49b304;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'body':{'type':Sequelize[_0xd351('0x1')](_0xd351('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd351('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd351('0x4')]('in','out'),'defaultValue':_0xd351('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd351('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd351('0x1')]}}; \ No newline at end of file +var _0x1cc3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0x1cc3,0x11b));var _0x31cc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1cc3[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x31cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x31cc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x31cc('0x4')]('in',_0x31cc('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x31cc('0x6')]},'providerName':{'type':Sequelize[_0x31cc('0x7')]},'providerResponse':{'type':Sequelize[_0x31cc('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6ff3f20..4bcf98a 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 _0x3ea5=['../../config/license/util','redis','defaults','./chatMessage.socket','register','http','client','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','length','find','create','body','params','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','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/environment'];(function(_0x37b507,_0x10c37c){var _0x3a5aca=function(_0x82557f){while(--_0x82557f){_0x37b507['push'](_0x37b507['shift']());}};_0x3a5aca(++_0x10c37c);}(_0x3ea5,0x6b));var _0x53ea=function(_0x1c6c83,_0x2b099c){_0x1c6c83=_0x1c6c83-0x0;var _0x2d7849=_0x3ea5[_0x1c6c83];return _0x2d7849;};'use strict';var emlformat=require(_0x53ea('0x0'));var rimraf=require(_0x53ea('0x1'));var zipdir=require(_0x53ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53ea('0x3'));var moment=require(_0x53ea('0x4'));var BPromise=require(_0x53ea('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53ea('0x7'));var fs=require('fs');var fs_extra=require(_0x53ea('0x8'));var _=require(_0x53ea('0x9'));var squel=require(_0x53ea('0xa'));var crypto=require(_0x53ea('0xb'));var jsforce=require(_0x53ea('0xc'));var deskjs=require(_0x53ea('0xd'));var toCsv=require(_0x53ea('0xe'));var querystring=require(_0x53ea('0xf'));var Papa=require(_0x53ea('0x10'));var Redis=require(_0x53ea('0x11'));var authService=require(_0x53ea('0x12'));var qs=require(_0x53ea('0x13'));var as=require(_0x53ea('0x14'));var hardwareService=require(_0x53ea('0x15'));var logger=require(_0x53ea('0x16'))(_0x53ea('0x17'));var utils=require(_0x53ea('0x18'));var config=require(_0x53ea('0x19'));var licenseUtil=require(_0x53ea('0x1a'));var db=require('../../mysqldb')['db'];config[_0x53ea('0x1b')]=_[_0x53ea('0x1c')](config[_0x53ea('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53ea('0x1b')]));require(_0x53ea('0x1d'))[_0x53ea('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x53ea('0x1f')]({'port':0x232c});var client9002=jayson[_0x53ea('0x20')][_0x53ea('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4a65b1,_0x7e227e,_0x56534a,_0xa1747a){return new BPromise(function(_0x4bce34,_0xd79bc3){var _0x20a17d=_0xa1747a||client;return _0x20a17d['request'](_0x4a65b1,_0x56534a)[_0x53ea('0x21')](function(_0x224da9){logger[_0x53ea('0x22')](_0x53ea('0x23'),_0x7e227e,'request\x20sent');logger[_0x53ea('0x24')](_0x53ea('0x25'),_0x7e227e,_0x53ea('0x26'),JSON[_0x53ea('0x27')](_0x224da9));if(_0x224da9[_0x53ea('0x28')]){if(_0x224da9[_0x53ea('0x28')][_0x53ea('0x29')]===0x1f4){logger[_0x53ea('0x28')](_0x53ea('0x23'),_0x7e227e,_0x224da9['error'][_0x53ea('0x2a')]);return _0xd79bc3(_0x224da9[_0x53ea('0x28')][_0x53ea('0x2a')]);}logger[_0x53ea('0x28')]('ChatMessage,\x20%s,\x20%s',_0x7e227e,_0x224da9[_0x53ea('0x28')][_0x53ea('0x2a')]);return _0x4bce34(_0x224da9[_0x53ea('0x28')]['message']);}else{logger[_0x53ea('0x22')](_0x53ea('0x23'),_0x7e227e,_0x53ea('0x26'));_0x4bce34(_0x224da9[_0x53ea('0x2b')][_0x53ea('0x2a')]);}})[_0x53ea('0x2c')](function(_0x1fbecd){logger['error'](_0x53ea('0x23'),_0x7e227e,_0x1fbecd);_0xd79bc3(_0x1fbecd);});});}function respondWithStatusCode(_0x32e820,_0x4e3505){_0x4e3505=_0x4e3505||0xcc;return function(_0x16ef01){if(_0x16ef01){return _0x32e820['sendStatus'](_0x4e3505);}return _0x32e820[_0x53ea('0x2d')](_0x4e3505)[_0x53ea('0x2e')]();};}function respondWithResult(_0x4bc7d7,_0x4d7b12){_0x4d7b12=_0x4d7b12||0xc8;return function(_0x333a70){if(_0x333a70){return _0x4bc7d7[_0x53ea('0x2d')](_0x4d7b12)['json'](_0x333a70);}};}function respondWithFilteredResult(_0x47fcac,_0x5e69c2){return function(_0x8236b3){if(_0x8236b3){var _0x2cac2a=typeof _0x5e69c2[_0x53ea('0x2f')]===_0x53ea('0x30')&&typeof _0x5e69c2['limit']==='undefined';var _0x54da81=_0x8236b3['count'];var _0x5ea80f=_0x2cac2a?0x0:_0x5e69c2[_0x53ea('0x2f')];var _0x2a32de=_0x2cac2a?_0x8236b3[_0x53ea('0x31')]:_0x5e69c2[_0x53ea('0x2f')]+_0x5e69c2[_0x53ea('0x32')];var _0x23dcfb;if(_0x2a32de>=_0x54da81){_0x2a32de=_0x54da81;_0x23dcfb=0xc8;}else{_0x23dcfb=0xce;}_0x47fcac['status'](_0x23dcfb);return _0x47fcac['set'](_0x53ea('0x33'),_0x5ea80f+'-'+_0x2a32de+'/'+_0x54da81)[_0x53ea('0x34')](_0x8236b3);}return null;};}function patchUpdates(_0x37b641){return function(_0x418340){try{jsonpatch[_0x53ea('0x35')](_0x418340,_0x37b641,!![]);}catch(_0x24f441){return BPromise[_0x53ea('0x36')](_0x24f441);}return _0x418340[_0x53ea('0x37')]();};}function saveUpdates(_0xa78cdd,_0x31be8a){return function(_0x2c1b2b){if(_0x2c1b2b){return _0x2c1b2b[_0x53ea('0x38')](_0xa78cdd)[_0x53ea('0x21')](function(_0x3e78cf){return _0x3e78cf;});}return null;};}function removeEntity(_0x37118a,_0x2d6526){return function(_0xa57c37){if(_0xa57c37){return _0xa57c37[_0x53ea('0x39')]()[_0x53ea('0x21')](function(){_0x37118a[_0x53ea('0x2d')](0xcc)[_0x53ea('0x2e')]();});}};}function handleEntityNotFound(_0x217e2a,_0x1db91f){return function(_0xf5c0d1){if(!_0xf5c0d1){_0x217e2a[_0x53ea('0x3a')](0x194);}return _0xf5c0d1;};}function handleError(_0x125609,_0x53a666){_0x53a666=_0x53a666||0x1f4;return function(_0xd17c12){logger[_0x53ea('0x28')](_0xd17c12[_0x53ea('0x3b')]);if(_0xd17c12[_0x53ea('0x3c')]){delete _0xd17c12['name'];}_0x125609[_0x53ea('0x2d')](_0x53a666)[_0x53ea('0x3d')](_0xd17c12);};}exports[_0x53ea('0x3e')]=function(_0x2236c1,_0x2818dc){var _0x56f3bd={},_0xab010e={},_0x545c9b={'count':0x0,'rows':[]};var _0x311ad9=_[_0x53ea('0x3f')](db[_0x53ea('0x40')][_0x53ea('0x41')],function(_0x197f6c){return{'name':_0x197f6c['fieldName'],'type':_0x197f6c[_0x53ea('0x42')][_0x53ea('0x43')]};});_0xab010e['model']=_[_0x53ea('0x3f')](_0x311ad9,_0x53ea('0x3c'));_0xab010e[_0x53ea('0x44')]=_[_0x53ea('0x45')](_0x2236c1[_0x53ea('0x44')]);_0xab010e[_0x53ea('0x46')]=_[_0x53ea('0x47')](_0xab010e[_0x53ea('0x48')],_0xab010e[_0x53ea('0x44')]);_0x56f3bd['attributes']=_[_0x53ea('0x47')](_0xab010e[_0x53ea('0x48')],qs[_0x53ea('0x49')](_0x2236c1[_0x53ea('0x44')][_0x53ea('0x49')]));_0x56f3bd[_0x53ea('0x4a')]=_0x56f3bd['attributes']['length']?_0x56f3bd['attributes']:_0xab010e[_0x53ea('0x48')];if(!_0x2236c1[_0x53ea('0x44')][_0x53ea('0x4b')]('nolimit')){_0x56f3bd[_0x53ea('0x32')]=qs[_0x53ea('0x32')](_0x2236c1[_0x53ea('0x44')][_0x53ea('0x32')]);_0x56f3bd['offset']=qs[_0x53ea('0x2f')](_0x2236c1['query'][_0x53ea('0x2f')]);}_0x56f3bd['order']=qs[_0x53ea('0x4c')](_0x2236c1[_0x53ea('0x44')]['sort']);_0x56f3bd['where']=qs[_0x53ea('0x46')](_['pick'](_0x2236c1[_0x53ea('0x44')],_0xab010e[_0x53ea('0x46')]),_0x311ad9);if(_0x2236c1['query'][_0x53ea('0x4d')]){_0x56f3bd[_0x53ea('0x4e')]=_[_0x53ea('0x4f')](_0x56f3bd[_0x53ea('0x4e')],{'$or':_[_0x53ea('0x3f')](_0x311ad9,function(_0x47919c){if(_0x47919c[_0x53ea('0x42')]!=='VIRTUAL'){var _0x2685ad={};_0x2685ad[_0x47919c['name']]={'$like':'%'+_0x2236c1[_0x53ea('0x44')]['filter']+'%'};return _0x2685ad;}})});}_0x56f3bd=_['merge']({},_0x56f3bd,_0x2236c1[_0x53ea('0x50')]);var _0x3ad9b3={'where':_0x56f3bd['where']};return db[_0x53ea('0x40')][_0x53ea('0x31')](_0x3ad9b3)[_0x53ea('0x21')](function(_0xf15658){_0x545c9b['count']=_0xf15658;if(_0x2236c1['query'][_0x53ea('0x51')]){_0x56f3bd[_0x53ea('0x52')]=[{'all':!![]}];}return db[_0x53ea('0x40')][_0x53ea('0x53')](_0x56f3bd);})[_0x53ea('0x21')](function(_0xcd8cd5){_0x545c9b[_0x53ea('0x54')]=_0xcd8cd5;return _0x545c9b;})[_0x53ea('0x21')](respondWithFilteredResult(_0x2818dc,_0x56f3bd))[_0x53ea('0x2c')](handleError(_0x2818dc,null));};exports[_0x53ea('0x55')]=function(_0x2967df,_0x3eec17){var _0x1f20d7={'raw':!![],'where':{'id':_0x2967df['params']['id']}},_0x4cbd3d={};_0x4cbd3d[_0x53ea('0x48')]=_[_0x53ea('0x45')](db[_0x53ea('0x40')]['rawAttributes']);_0x4cbd3d[_0x53ea('0x44')]=_[_0x53ea('0x45')](_0x2967df[_0x53ea('0x44')]);_0x4cbd3d[_0x53ea('0x46')]=_[_0x53ea('0x47')](_0x4cbd3d[_0x53ea('0x48')],_0x4cbd3d[_0x53ea('0x44')]);_0x1f20d7['attributes']=_[_0x53ea('0x47')](_0x4cbd3d[_0x53ea('0x48')],qs[_0x53ea('0x49')](_0x2967df[_0x53ea('0x44')][_0x53ea('0x49')]));_0x1f20d7[_0x53ea('0x4a')]=_0x1f20d7['attributes'][_0x53ea('0x56')]?_0x1f20d7[_0x53ea('0x4a')]:_0x4cbd3d[_0x53ea('0x48')];if(_0x2967df[_0x53ea('0x44')][_0x53ea('0x51')]){_0x1f20d7[_0x53ea('0x52')]=[{'all':!![]}];}_0x1f20d7=_['merge']({},_0x1f20d7,_0x2967df[_0x53ea('0x50')]);return db[_0x53ea('0x40')][_0x53ea('0x57')](_0x1f20d7)['then'](handleEntityNotFound(_0x3eec17,null))[_0x53ea('0x21')](respondWithResult(_0x3eec17,null))[_0x53ea('0x2c')](handleError(_0x3eec17,null));};exports[_0x53ea('0x58')]=function(_0x1df92d,_0x2bd0e2){return db[_0x53ea('0x40')][_0x53ea('0x58')](_0x1df92d[_0x53ea('0x59')],{})[_0x53ea('0x21')](respondWithResult(_0x2bd0e2,0xc9))['catch'](handleError(_0x2bd0e2,null));};exports[_0x53ea('0x38')]=function(_0x2facc0,_0x95e93a){if(_0x2facc0[_0x53ea('0x59')]['id']){delete _0x2facc0['body']['id'];}return db[_0x53ea('0x40')]['find']({'where':{'id':_0x2facc0[_0x53ea('0x5a')]['id']}})[_0x53ea('0x21')](handleEntityNotFound(_0x95e93a,null))[_0x53ea('0x21')](saveUpdates(_0x2facc0[_0x53ea('0x59')],null))[_0x53ea('0x21')](respondWithResult(_0x95e93a,null))['catch'](handleError(_0x95e93a,null));};exports[_0x53ea('0x39')]=function(_0x25bdf1,_0x32d668){return db['ChatMessage'][_0x53ea('0x57')]({'where':{'id':_0x25bdf1[_0x53ea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x32d668,null))[_0x53ea('0x21')](removeEntity(_0x32d668,null))[_0x53ea('0x2c')](handleError(_0x32d668,null));};exports[_0x53ea('0x5b')]=function(_0x4ee1b4,_0x52b6c8){return db[_0x53ea('0x40')][_0x53ea('0x5b')]()[_0x53ea('0x21')](respondWithResult(_0x52b6c8,null))['catch'](handleError(_0x52b6c8,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x53ea('0x5c')]=function(_0x2f549c,_0x1b8eae,_0xb05a8d){var _0x203a7e={'agent':{},'channel':_0x53ea('0x5d')};if(_0x2f549c[_0x53ea('0x59')]['id']){delete _0x2f549c[_0x53ea('0x59')]['id'];}_0x2f549c['body']['read']=!![];_0x2f549c[_0x53ea('0x59')][_0x53ea('0x5e')]=moment()[_0x53ea('0x5f')](_0x53ea('0x60'));_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')]=_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')]||_0x2f549c['user']['id'];_0x203a7e['agent']['id']=_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')];return db[_0x53ea('0x40')][_0x53ea('0x57')]({'where':{'id':_0x2f549c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b8eae,null))[_0x53ea('0x21')](saveUpdates(_0x2f549c[_0x53ea('0x59')],null))['then'](function(_0x17e103){if(_0x17e103){_0x203a7e[_0x53ea('0x2a')]=_0x17e103['get']({'plain':!![]});return db['ChatInteraction'][_0x53ea('0x57')]({'where':{'id':_0x17e103[_0x53ea('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1b8eae,null))[_0x53ea('0x21')](function(_0x49073e){if(_0x49073e){return _0x49073e['update']({'UserId':_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')],'read1stAt':_[_0x53ea('0x63')](_0x49073e[_0x53ea('0x64')])?moment()[_0x53ea('0x5f')](_0x53ea('0x60')):undefined});}return null;})[_0x53ea('0x21')](function(_0x2d86a1){if(_0x2d86a1){_0x203a7e[_0x53ea('0x65')]=_0x2d86a1[_0x53ea('0x66')]({'plain':!![]});interaction_log[_0x53ea('0x22')](_0x53ea('0x67'),_0x2f549c[_0x53ea('0x68')]['id'],_0x2f549c[_0x53ea('0x68')][_0x53ea('0x3c')],_0x2f549c[_0x53ea('0x68')][_0x53ea('0x69')],_0x203a7e[_0x53ea('0x65')]['id'],_0x2f549c[_0x53ea('0x59')]?JSON['stringify'](_0x2f549c[_0x53ea('0x59')]):'null');return respondWithRpcPromise(_0x53ea('0x6a'),_0x53ea('0x6b'),_0x203a7e);}return null;})[_0x53ea('0x21')](function(_0x18a3df){var _0x2b3a50=_0x53ea('0x6c')+_0x18a3df[_0x53ea('0x2a')]['ContactId'];return db[_0x53ea('0x6d')][_0x53ea('0x44')](_0x2b3a50,{'type':db[_0x53ea('0x6e')][_0x53ea('0x6f')][_0x53ea('0x70')],'raw':!![]})['then'](function(_0x31e0a3){return _0x31e0a3;});})[_0x53ea('0x21')](function(_0x5565d4){if(_0x5565d4){_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x71')]=_0x5565d4[0x0];if(!_0x2f549c['body'][_0x53ea('0x61')])return;return db[_0x53ea('0x72')]['find']({'where':{'id':_0x2f549c['body'][_0x53ea('0x61')],'role':_0x53ea('0x73')},'attributes':['id',_0x53ea('0x3c'),_0x53ea('0x74'),_0x53ea('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x414196){if(!_0x414196)return null;_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x73')]=_0x414196;return _0x203a7e;})[_0x53ea('0x21')](function(_0x355393){if(_0x355393){if(_0x2f549c[_0x53ea('0x59')][_0x53ea('0x76')]){_0x203a7e['message'][_0x53ea('0x77')]=util[_0x53ea('0x5f')]('SIP/%s',_0x2f549c[_0x53ea('0x68')][_0x53ea('0x3c')]);_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x78')]=_0x203a7e[_0x53ea('0x78')];_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x79')]=_0x203a7e[_0x53ea('0x78')];_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x7a')]=_0x53ea('0x5c');return respondWithRpcPromise(_0x53ea('0x7b'),_0x53ea('0x7b'),{'event':_0x53ea('0x7c'),'message':_[_0x53ea('0x4f')](_0x203a7e[_0x53ea('0x2a')],JSON['parse'](_0x203a7e[_0x53ea('0x65')][_0x53ea('0x7d')]))},client9002)[_0x53ea('0x21')](function(){return _0x203a7e;});}return _0x203a7e;}return null;})['then'](respondWithResult(_0x1b8eae,null))[_0x53ea('0x2c')](handleError(_0x1b8eae,null));};var interaction_log=require(_0x53ea('0x16'))(_0x53ea('0x7e'));exports['reject']=function(_0x31f3cc,_0x540625,_0x831c19){var _0x427e49={'agent':{},'channel':'chat'};if(_0x31f3cc[_0x53ea('0x59')]['id']){delete _0x31f3cc['body']['id'];}_0x31f3cc['body'][_0x53ea('0x61')]=_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')]||_0x31f3cc['user']['id'];_0x427e49[_0x53ea('0x73')]['id']=_0x31f3cc[_0x53ea('0x59')]['UserId'];return db[_0x53ea('0x40')][_0x53ea('0x57')]({'where':{'id':_0x31f3cc['params']['id'],'UserId':null}})[_0x53ea('0x21')](handleEntityNotFound(_0x540625,null))[_0x53ea('0x21')](function(_0xf3bced){if(_0xf3bced){_0x427e49[_0x53ea('0x2a')]=_0xf3bced[_0x53ea('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x53ea('0x57')]({'where':{'id':_0xf3bced[_0x53ea('0x62')]}});}return null;})[_0x53ea('0x21')](handleEntityNotFound(_0x540625,null))['then'](function(_0x1da709){if(_0x1da709){_0x427e49['interaction']=_0x1da709['get']({'plain':!![]});interaction_log[_0x53ea('0x22')](_0x53ea('0x7f'),_0x31f3cc[_0x53ea('0x68')]['id'],_0x31f3cc['user']['name'],_0x31f3cc[_0x53ea('0x68')][_0x53ea('0x69')],_0x427e49[_0x53ea('0x65')]['id'],_0x31f3cc['body']?JSON[_0x53ea('0x27')](_0x31f3cc[_0x53ea('0x59')]):_0x53ea('0x80'));return respondWithRpcPromise('RejectMessage',_0x53ea('0x81'),_0x427e49);}return null;})[_0x53ea('0x21')](function(_0x5f1239){var _0x5b9067=_0x53ea('0x6c')+_0x5f1239[_0x53ea('0x2a')][_0x53ea('0x82')];return db[_0x53ea('0x6d')]['query'](_0x5b9067,{'type':db[_0x53ea('0x6e')][_0x53ea('0x6f')][_0x53ea('0x70')],'raw':!![]})[_0x53ea('0x21')](function(_0x5b4f96){return _0x5b4f96;});})['then'](function(_0x48457a){if(_0x48457a){_0x427e49[_0x53ea('0x2a')][_0x53ea('0x71')]=_0x48457a[0x0];if(!_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')])return;return db[_0x53ea('0x72')]['find']({'where':{'id':_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')],'role':_0x53ea('0x73')},'attributes':['id','name','fullname',_0x53ea('0x75'),'internal'],'raw':!![]});}return null;})[_0x53ea('0x21')](function(_0x1867e6){if(!_0x1867e6)return null;_0x427e49['message'][_0x53ea('0x73')]=_0x1867e6;return _0x427e49;})[_0x53ea('0x21')](function(_0x31b769){if(_0x31b769){_0x31b769[_0x53ea('0x2a')]['interface']=util[_0x53ea('0x5f')](_0x53ea('0x83'),_0x31f3cc[_0x53ea('0x68')][_0x53ea('0x3c')]);_0x31b769['message'][_0x53ea('0x78')]=_0x427e49[_0x53ea('0x78')];_0x31b769[_0x53ea('0x2a')]['motionChannel']=_0x427e49['channel'];_0x31b769[_0x53ea('0x2a')][_0x53ea('0x7a')]='reject';respondWithRpcPromise(_0x53ea('0x7b'),_0x53ea('0x7b'),{'event':_0x53ea('0x84'),'message':_[_0x53ea('0x4f')](_0x427e49[_0x53ea('0x2a')],JSON['parse'](_0x427e49['interaction'][_0x53ea('0x7d')]))},client9002);return _0x427e49;}return null;})[_0x53ea('0x21')](respondWithResult(_0x540625,null))[_0x53ea('0x2c')](handleError(_0x540625,null));}; \ No newline at end of file +var _0xc73e=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE: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','sequelize','Sequelize','QueryTypes','SELECT','contact','User','find','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','fullname','internal','interface','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','params','create','body','destroy','describe','chat-interactions','accept','read','format'];(function(_0x59fc33,_0x2e182d){var _0x39066f=function(_0x4d843d){while(--_0x4d843d){_0x59fc33['push'](_0x59fc33['shift']());}};_0x39066f(++_0x2e182d);}(_0xc73e,0xaf));var _0xec73=function(_0x55b351,_0x1bb062){_0x55b351=_0x55b351-0x0;var _0x3f684f=_0xc73e[_0x55b351];return _0x3f684f;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec73('0x1'));var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require(_0xec73('0x4'));var BPromise=require(_0xec73('0x5'));var Mustache=require(_0xec73('0x6'));var util=require(_0xec73('0x7'));var path=require(_0xec73('0x8'));var sox=require(_0xec73('0x9'));var csv=require(_0xec73('0xa'));var ejs=require(_0xec73('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec73('0xc'));var squel=require(_0xec73('0xd'));var crypto=require('crypto');var jsforce=require(_0xec73('0xe'));var deskjs=require(_0xec73('0xf'));var toCsv=require(_0xec73('0xa'));var querystring=require(_0xec73('0x10'));var Papa=require('papaparse');var Redis=require(_0xec73('0x11'));var authService=require(_0xec73('0x12'));var qs=require(_0xec73('0x13'));var as=require(_0xec73('0x14'));var hardwareService=require(_0xec73('0x15'));var logger=require(_0xec73('0x16'))(_0xec73('0x17'));var utils=require(_0xec73('0x18'));var config=require(_0xec73('0x19'));var licenseUtil=require(_0xec73('0x1a'));var db=require(_0xec73('0x1b'))['db'];config[_0xec73('0x1c')]=_[_0xec73('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec73('0x1e'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xec73('0x1f')](socket);var jayson=require(_0xec73('0x20'));var client=jayson['client'][_0xec73('0x21')]({'port':0x232c});var client9002=jayson[_0xec73('0x22')][_0xec73('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3311fa,_0x2e8afc,_0x5e09a4,_0x47eaf9){return new BPromise(function(_0x15dedc,_0x1ec343){var _0xf4a610=_0x47eaf9||client;return _0xf4a610['request'](_0x3311fa,_0x5e09a4)[_0xec73('0x23')](function(_0x24223c){logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2e8afc,_0xec73('0x26'),JSON['stringify'](_0x24223c));if(_0x24223c['error']){if(_0x24223c[_0xec73('0x27')]['code']===0x1f4){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x1ec343(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x15dedc(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}else{logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));_0x15dedc(_0x24223c[_0xec73('0x29')][_0xec73('0x28')]);}})[_0xec73('0x2a')](function(_0x4ada95){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x4ada95);_0x1ec343(_0x4ada95);});});}function respondWithStatusCode(_0x4ea73e,_0x580114){_0x580114=_0x580114||0xcc;return function(_0x4eb256){if(_0x4eb256){return _0x4ea73e[_0xec73('0x2b')](_0x580114);}return _0x4ea73e['status'](_0x580114)[_0xec73('0x2c')]();};}function respondWithResult(_0x50b9df,_0x2e427b){_0x2e427b=_0x2e427b||0xc8;return function(_0x5c73cc){if(_0x5c73cc){return _0x50b9df[_0xec73('0x2d')](_0x2e427b)[_0xec73('0x2e')](_0x5c73cc);}};}function respondWithFilteredResult(_0x1a6b16,_0x63aa){return function(_0x3eaf78){if(_0x3eaf78){var _0x21e957=typeof _0x63aa[_0xec73('0x2f')]===_0xec73('0x30')&&typeof _0x63aa[_0xec73('0x31')]===_0xec73('0x30');var _0x19ff12=_0x3eaf78[_0xec73('0x32')];var _0x474efc=_0x21e957?0x0:_0x63aa[_0xec73('0x2f')];var _0x10d863=_0x21e957?_0x3eaf78[_0xec73('0x32')]:_0x63aa[_0xec73('0x2f')]+_0x63aa[_0xec73('0x31')];var _0x31f287;if(_0x10d863>=_0x19ff12){_0x10d863=_0x19ff12;_0x31f287=0xc8;}else{_0x31f287=0xce;}_0x1a6b16[_0xec73('0x2d')](_0x31f287);return _0x1a6b16[_0xec73('0x33')](_0xec73('0x34'),_0x474efc+'-'+_0x10d863+'/'+_0x19ff12)['json'](_0x3eaf78);}return null;};}function patchUpdates(_0x607075){return function(_0x3cf268){try{jsonpatch[_0xec73('0x35')](_0x3cf268,_0x607075,!![]);}catch(_0x3b042b){return BPromise['reject'](_0x3b042b);}return _0x3cf268[_0xec73('0x36')]();};}function saveUpdates(_0x1ad54b,_0x2acc15){return function(_0x4699a0){if(_0x4699a0){return _0x4699a0[_0xec73('0x37')](_0x1ad54b)[_0xec73('0x23')](function(_0x6944b1){return _0x6944b1;});}return null;};}function removeEntity(_0x4cfa86,_0x334c44){return function(_0x397334){if(_0x397334){return _0x397334['destroy']()[_0xec73('0x23')](function(){_0x4cfa86[_0xec73('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a11a8,_0x133772){return function(_0x3494aa){if(!_0x3494aa){_0x4a11a8['sendStatus'](0x194);}return _0x3494aa;};}function handleError(_0x208055,_0x169865){_0x169865=_0x169865||0x1f4;return function(_0x1b3302){logger['error'](_0x1b3302[_0xec73('0x38')]);if(_0x1b3302['name']){delete _0x1b3302[_0xec73('0x39')];}_0x208055[_0xec73('0x2d')](_0x169865)['send'](_0x1b3302);};}exports[_0xec73('0x3a')]=function(_0x1a3a67,_0x527758){var _0x889c14={},_0x59b3d9={},_0x438a3f={'count':0x0,'rows':[]};var _0x58d3f0=_[_0xec73('0x3b')](db[_0xec73('0x3c')][_0xec73('0x3d')],function(_0x351044){return{'name':_0x351044[_0xec73('0x3e')],'type':_0x351044[_0xec73('0x3f')][_0xec73('0x40')]};});_0x59b3d9[_0xec73('0x41')]=_[_0xec73('0x3b')](_0x58d3f0,_0xec73('0x39'));_0x59b3d9[_0xec73('0x42')]=_[_0xec73('0x43')](_0x1a3a67[_0xec73('0x42')]);_0x59b3d9['filters']=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],_0x59b3d9['query']);_0x889c14[_0xec73('0x45')]=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],qs['fields'](_0x1a3a67['query']['fields']));_0x889c14['attributes']=_0x889c14[_0xec73('0x45')][_0xec73('0x46')]?_0x889c14[_0xec73('0x45')]:_0x59b3d9[_0xec73('0x41')];if(!_0x1a3a67[_0xec73('0x42')]['hasOwnProperty'](_0xec73('0x47'))){_0x889c14[_0xec73('0x31')]=qs[_0xec73('0x31')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x31')]);_0x889c14[_0xec73('0x2f')]=qs[_0xec73('0x2f')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x2f')]);}_0x889c14['order']=qs[_0xec73('0x48')](_0x1a3a67['query'][_0xec73('0x48')]);_0x889c14['where']=qs[_0xec73('0x49')](_[_0xec73('0x4a')](_0x1a3a67[_0xec73('0x42')],_0x59b3d9['filters']),_0x58d3f0);if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]){_0x889c14[_0xec73('0x4c')]=_[_0xec73('0x4d')](_0x889c14['where'],{'$or':_[_0xec73('0x3b')](_0x58d3f0,function(_0x30d90c){if(_0x30d90c[_0xec73('0x3f')]!=='VIRTUAL'){var _0x31790a={};_0x31790a[_0x30d90c[_0xec73('0x39')]]={'$like':'%'+_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]+'%'};return _0x31790a;}})});}_0x889c14=_[_0xec73('0x4d')]({},_0x889c14,_0x1a3a67[_0xec73('0x4e')]);var _0x26e6a7={'where':_0x889c14[_0xec73('0x4c')]};return db[_0xec73('0x3c')][_0xec73('0x32')](_0x26e6a7)[_0xec73('0x23')](function(_0x37a835){_0x438a3f[_0xec73('0x32')]=_0x37a835;if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4f')]){_0x889c14[_0xec73('0x50')]=[{'all':!![]}];}return db[_0xec73('0x3c')]['findAll'](_0x889c14);})[_0xec73('0x23')](function(_0x19321d){_0x438a3f[_0xec73('0x51')]=_0x19321d;return _0x438a3f;})[_0xec73('0x23')](respondWithFilteredResult(_0x527758,_0x889c14))[_0xec73('0x2a')](handleError(_0x527758,null));};exports['show']=function(_0x4bca59,_0x4a9cd5){var _0x1ed829={'raw':!![],'where':{'id':_0x4bca59[_0xec73('0x52')]['id']}},_0x2266f6={};_0x2266f6[_0xec73('0x41')]=_[_0xec73('0x43')](db[_0xec73('0x3c')][_0xec73('0x3d')]);_0x2266f6['query']=_[_0xec73('0x43')](_0x4bca59[_0xec73('0x42')]);_0x2266f6[_0xec73('0x49')]=_[_0xec73('0x44')](_0x2266f6[_0xec73('0x41')],_0x2266f6[_0xec73('0x42')]);_0x1ed829[_0xec73('0x45')]=_['intersection'](_0x2266f6[_0xec73('0x41')],qs['fields'](_0x4bca59[_0xec73('0x42')]['fields']));_0x1ed829[_0xec73('0x45')]=_0x1ed829[_0xec73('0x45')][_0xec73('0x46')]?_0x1ed829['attributes']:_0x2266f6[_0xec73('0x41')];if(_0x4bca59[_0xec73('0x42')][_0xec73('0x4f')]){_0x1ed829[_0xec73('0x50')]=[{'all':!![]}];}_0x1ed829=_[_0xec73('0x4d')]({},_0x1ed829,_0x4bca59[_0xec73('0x4e')]);return db['ChatMessage']['find'](_0x1ed829)['then'](handleEntityNotFound(_0x4a9cd5,null))[_0xec73('0x23')](respondWithResult(_0x4a9cd5,null))[_0xec73('0x2a')](handleError(_0x4a9cd5,null));};exports[_0xec73('0x53')]=function(_0x8922cf,_0x5bb3c8){return db[_0xec73('0x3c')]['create'](_0x8922cf[_0xec73('0x54')],{})[_0xec73('0x23')](respondWithResult(_0x5bb3c8,0xc9))[_0xec73('0x2a')](handleError(_0x5bb3c8,null));};exports[_0xec73('0x37')]=function(_0xf335dd,_0x371061){if(_0xf335dd[_0xec73('0x54')]['id']){delete _0xf335dd[_0xec73('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xf335dd[_0xec73('0x52')]['id']}})['then'](handleEntityNotFound(_0x371061,null))[_0xec73('0x23')](saveUpdates(_0xf335dd[_0xec73('0x54')],null))[_0xec73('0x23')](respondWithResult(_0x371061,null))[_0xec73('0x2a')](handleError(_0x371061,null));};exports[_0xec73('0x55')]=function(_0x1d40d3,_0x229e28){return db[_0xec73('0x3c')]['find']({'where':{'id':_0x1d40d3['params']['id']}})['then'](handleEntityNotFound(_0x229e28,null))['then'](removeEntity(_0x229e28,null))[_0xec73('0x2a')](handleError(_0x229e28,null));};exports[_0xec73('0x56')]=function(_0x594163,_0x443b39){return db[_0xec73('0x3c')][_0xec73('0x56')]()[_0xec73('0x23')](respondWithResult(_0x443b39,null))[_0xec73('0x2a')](handleError(_0x443b39,null));};var interaction_log=require(_0xec73('0x16'))(_0xec73('0x57'));exports[_0xec73('0x58')]=function(_0x438c27,_0x496e57,_0x2e1295){var _0x3168bd={'agent':{},'channel':'chat'};if(_0x438c27[_0xec73('0x54')]['id']){delete _0x438c27['body']['id'];}_0x438c27[_0xec73('0x54')][_0xec73('0x59')]=!![];_0x438c27[_0xec73('0x54')]['readAt']=moment()[_0xec73('0x5a')](_0xec73('0x5b'));_0x438c27['body'][_0xec73('0x5c')]=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')]||_0x438c27[_0xec73('0x5d')]['id'];_0x3168bd[_0xec73('0x5e')]['id']=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')]['find']({'where':{'id':_0x438c27['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x496e57,null))[_0xec73('0x23')](saveUpdates(_0x438c27[_0xec73('0x54')],null))[_0xec73('0x23')](function(_0x154054){if(_0x154054){_0x3168bd['message']=_0x154054[_0xec73('0x5f')]({'plain':!![]});return db[_0xec73('0x60')]['find']({'where':{'id':_0x154054[_0xec73('0x61')]}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x496e57,null))['then'](function(_0x419603){if(_0x419603){return _0x419603['update']({'UserId':_0x438c27[_0xec73('0x54')]['UserId'],'read1stAt':_[_0xec73('0x62')](_0x419603['read1stAt'])?moment()[_0xec73('0x5a')](_0xec73('0x5b')):undefined});}return null;})[_0xec73('0x23')](function(_0x1cb479){if(_0x1cb479){_0x3168bd[_0xec73('0x63')]=_0x1cb479[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x64'),_0x438c27['user']['id'],_0x438c27[_0xec73('0x5d')][_0xec73('0x39')],_0x438c27[_0xec73('0x5d')][_0xec73('0x65')],_0x3168bd['interaction']['id'],_0x438c27[_0xec73('0x54')]?JSON[_0xec73('0x66')](_0x438c27[_0xec73('0x54')]):_0xec73('0x67'));return respondWithRpcPromise(_0xec73('0x68'),_0xec73('0x69'),_0x3168bd);}return null;})[_0xec73('0x23')](function(_0x262a34){var _0x2f3527=_0xec73('0x6a')+_0x262a34['message']['ContactId'];return db[_0xec73('0x6b')][_0xec73('0x42')](_0x2f3527,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')][_0xec73('0x6e')],'raw':!![]})['then'](function(_0x305898){return _0x305898;});})['then'](function(_0x437ac4){if(_0x437ac4){_0x3168bd[_0xec73('0x28')][_0xec73('0x6f')]=_0x437ac4[0x0];if(!_0x438c27[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x438c27[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id','name','fullname',_0xec73('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4fa439){if(!_0x4fa439)return null;_0x3168bd[_0xec73('0x28')]['agent']=_0x4fa439;return _0x3168bd;})[_0xec73('0x23')](function(_0x5070e9){if(_0x5070e9){if(_0x438c27['body'][_0xec73('0x73')]){_0x3168bd[_0xec73('0x28')]['interface']=util[_0xec73('0x5a')](_0xec73('0x74'),_0x438c27[_0xec73('0x5d')][_0xec73('0x39')]);_0x3168bd[_0xec73('0x28')][_0xec73('0x75')]=_0x3168bd[_0xec73('0x75')];_0x3168bd[_0xec73('0x28')]['motionChannel']=_0x3168bd[_0xec73('0x75')];_0x3168bd['message'][_0xec73('0x76')]=_0xec73('0x58');return respondWithRpcPromise('EventManager',_0xec73('0x77'),{'event':_0xec73('0x78'),'message':_['merge'](_0x3168bd[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3168bd[_0xec73('0x63')][_0xec73('0x7a')]))},client9002)[_0xec73('0x23')](function(){return _0x3168bd;});}return _0x3168bd;}return null;})[_0xec73('0x23')](respondWithResult(_0x496e57,null))['catch'](handleError(_0x496e57,null));};var interaction_log=require(_0xec73('0x16'))('chat-interactions');exports[_0xec73('0x7b')]=function(_0x25c0a5,_0x34901a,_0x89984c){var _0x3ca2d3={'agent':{},'channel':_0xec73('0x7c')};if(_0x25c0a5['body']['id']){delete _0x25c0a5['body']['id'];}_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')]=_0x25c0a5['body'][_0xec73('0x5c')]||_0x25c0a5[_0xec73('0x5d')]['id'];_0x3ca2d3[_0xec73('0x5e')]['id']=_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x52')]['id'],'UserId':null}})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x4b1d0c){if(_0x4b1d0c){_0x3ca2d3[_0xec73('0x28')]=_0x4b1d0c['get']({'plain':!![]});return db[_0xec73('0x60')][_0xec73('0x71')]({'where':{'id':_0x4b1d0c['ChatInteractionId']}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x488b63){if(_0x488b63){_0x3ca2d3[_0xec73('0x63')]=_0x488b63[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x7d'),_0x25c0a5[_0xec73('0x5d')]['id'],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x65')],_0x3ca2d3[_0xec73('0x63')]['id'],_0x25c0a5[_0xec73('0x54')]?JSON['stringify'](_0x25c0a5[_0xec73('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xec73('0x7e'),_0x3ca2d3);}return null;})[_0xec73('0x23')](function(_0x1b7e9d){var _0x46c9a7=_0xec73('0x6a')+_0x1b7e9d['message'][_0xec73('0x7f')];return db['sequelize']['query'](_0x46c9a7,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5a9d39){return _0x5a9d39;});})[_0xec73('0x23')](function(_0x569b1d){if(_0x569b1d){_0x3ca2d3[_0xec73('0x28')]['contact']=_0x569b1d[0x0];if(!_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id',_0xec73('0x39'),_0xec73('0x80'),_0xec73('0x72'),_0xec73('0x81')],'raw':!![]});}return null;})[_0xec73('0x23')](function(_0x50f9cc){if(!_0x50f9cc)return null;_0x3ca2d3['message'][_0xec73('0x5e')]=_0x50f9cc;return _0x3ca2d3;})[_0xec73('0x23')](function(_0x45e3e0){if(_0x45e3e0){_0x45e3e0[_0xec73('0x28')][_0xec73('0x82')]=util['format'](_0xec73('0x74'),_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')]);_0x45e3e0[_0xec73('0x28')][_0xec73('0x75')]=_0x3ca2d3['channel'];_0x45e3e0[_0xec73('0x28')][_0xec73('0x83')]=_0x3ca2d3[_0xec73('0x75')];_0x45e3e0[_0xec73('0x28')][_0xec73('0x76')]=_0xec73('0x7b');respondWithRpcPromise('EventManager','EventManager',{'event':_0xec73('0x84'),'message':_[_0xec73('0x4d')](_0x3ca2d3[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3ca2d3[_0xec73('0x63')][_0xec73('0x7a')]))},client9002);return _0x3ca2d3;}return null;})[_0xec73('0x23')](respondWithResult(_0x34901a,null))[_0xec73('0x2a')](handleError(_0x34901a,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 611f63b..debfe73 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 _0xa606=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3e32d6,_0x37c0bb){var _0x52af90=function(_0x185bc1){while(--_0x185bc1){_0x3e32d6['push'](_0x3e32d6['shift']());}};_0x52af90(++_0x37c0bb);}(_0xa606,0x1c2));var _0x6a60=function(_0xb5b334,_0x5ac5db){_0xb5b334=_0xb5b334-0x0;var _0x33f163=_0xa606[_0xb5b334];return _0x33f163;};'use strict';var EventEmitter=require(_0x6a60('0x0'));var ChatMessage=require(_0x6a60('0x1'))['db'][_0x6a60('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6a60('0x3')](0x0);var events={'afterCreate':_0x6a60('0x4'),'afterUpdate':_0x6a60('0x5'),'afterDestroy':'remove'};function emitEvent(_0x183c5f){return function(_0x1906d1,_0x2ba824,_0x400e83){ChatMessageEvents[_0x6a60('0x6')](_0x183c5f+':'+_0x1906d1['id'],_0x1906d1);ChatMessageEvents['emit'](_0x183c5f,_0x1906d1);_0x400e83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6a60('0x7')](e,emitEvent(event));}}module[_0x6a60('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x3b79=['hasOwnProperty','events','../../mysqldb','ChatMessage','save','update','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b79,0x112));var _0x93b7=function(_0x7538f2,_0x3f02cb){_0x7538f2=_0x7538f2-0x0;var _0x3e34c0=_0x3b79[_0x7538f2];return _0x3e34c0;};'use strict';var EventEmitter=require(_0x93b7('0x0'));var ChatMessage=require(_0x93b7('0x1'))['db'][_0x93b7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b7('0x3'),'afterUpdate':_0x93b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x64dc6a){return function(_0x315c84,_0x300c6b,_0x50b17c){ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a+':'+_0x315c84['id'],_0x315c84);ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a,_0x315c84);_0x50b17c(null);};}for(var e in events){if(events[_0x93b7('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 672e0ea..f050514 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 _0x1340=['createdAt','error','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update'];(function(_0x5da3fa,_0x3ebbe2){var _0x23f911=function(_0x2cc4b7){while(--_0x2cc4b7){_0x5da3fa['push'](_0x5da3fa['shift']());}};_0x23f911(++_0x3ebbe2);}(_0x1340,0xab));var _0x0134=function(_0x346cf3,_0x567c74){_0x346cf3=_0x346cf3-0x0;var _0x5e70ca=_0x1340[_0x346cf3];return _0x5e70ca;};'use strict';var _=require(_0x0134('0x0'));var util=require('util');var logger=require(_0x0134('0x1'))('api');var moment=require(_0x0134('0x2'));var BPromise=require(_0x0134('0x3'));var rp=require(_0x0134('0x4'));var fs=require('fs');var path=require(_0x0134('0x5'));var rimraf=require(_0x0134('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x3c1d6b,_0x4020b2){return _0x3c1d6b[_0x0134('0x7')]('ChatMessage',attributes,{'tableName':_0x0134('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x0134('0x9')],'type':_0x0134('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x19afd9,_0x2fa26f,_0x7c9059){var _0x5c0476=_0x3c1d6b[_0x0134('0xb')];var _0x2954dd=_0x19afd9[_0x0134('0xc')]({'plain':!![]});if(_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()==='in'||_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()==='out'&&!_0x2954dd[_0x0134('0xf')]&&!_[_0x0134('0x10')](_0x2954dd[_0x0134('0x11')])){_0x5c0476['ChatInteraction'][_0x0134('0x12')]({'where':{'id':_0x2954dd['ChatInteractionId']}})[_0x0134('0x13')](function(_0x1546b8){if(_0x1546b8){_0x1546b8[_0x0134('0x14')]({'lastMsgAt':_0x2954dd[_0x0134('0x15')],'lastMsgDirection':_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()});}})['catch'](function(_0x30f748){console[_0x0134('0x16')](_0x30f748);});}_0x7c9059();}},'charset':_0x0134('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xda72=['direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','toLowerCase'];(function(_0x161530,_0x2d2f6d){var _0x5d58e6=function(_0x1ef75e){while(--_0x1ef75e){_0x161530['push'](_0x161530['shift']());}};_0x5d58e6(++_0x2d2f6d);}(_0xda72,0x7e));var _0x2da7=function(_0x293b44,_0x47fe5d){_0x293b44=_0x293b44-0x0;var _0x4a42eb=_0xda72[_0x293b44];return _0x4a42eb;};'use strict';var _=require('lodash');var util=require(_0x2da7('0x0'));var logger=require(_0x2da7('0x1'))(_0x2da7('0x2'));var moment=require('moment');var BPromise=require(_0x2da7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2da7('0x4'));var rimraf=require(_0x2da7('0x5'));var config=require(_0x2da7('0x6'));var attributes=require('./chatMessage.attributes');module[_0x2da7('0x7')]=function(_0x1bf00a,_0x5e5adb){return _0x1bf00a['define'](_0x2da7('0x8'),attributes,{'tableName':_0x2da7('0x9'),'paranoid':![],'indexes':[{'name':_0x2da7('0xa'),'fields':['body'],'type':_0x2da7('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d4de7,_0x1e9847,_0x4f56de){var _0x5f12f3=_0x1bf00a['models'];var _0x305f24=_0x4d4de7[_0x2da7('0xc')]({'plain':!![]});if(_0x305f24['direction'][_0x2da7('0xd')]()==='in'||_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()===_0x2da7('0xf')&&!_0x305f24['secret']&&!_[_0x2da7('0x10')](_0x305f24[_0x2da7('0x11')])){_0x5f12f3[_0x2da7('0x12')][_0x2da7('0x13')]({'where':{'id':_0x305f24[_0x2da7('0x14')]}})[_0x2da7('0x15')](function(_0x44b814){if(_0x44b814){_0x44b814[_0x2da7('0x16')]({'lastMsgAt':_0x305f24[_0x2da7('0x17')],'lastMsgDirection':_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()});}})[_0x2da7('0x18')](function(_0x4be0a9){console[_0x2da7('0x19')](_0x4be0a9);});}_0x4f56de();}},'charset':_0x2da7('0x1a'),'collate':_0x2da7('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f5d696f..2c65316 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 _0x14f1=['ChatMessage','create','body','options','CreateChatMessage','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x14f1,0x71));var _0x114f=function(_0x2e2234,_0x5240a0){_0x2e2234=_0x2e2234-0x0;var _0x44f2d6=_0x14f1[_0x2e2234];return _0x44f2d6;};'use strict';var _=require(_0x114f('0x0'));var util=require('util');var moment=require(_0x114f('0x1'));var BPromise=require(_0x114f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x114f('0x3'));var db=require(_0x114f('0x4'))['db'];var utils=require(_0x114f('0x5'));var logger=require(_0x114f('0x6'))(_0x114f('0x7'));var config=require(_0x114f('0x8'));var jayson=require(_0x114f('0x9'));var client=jayson[_0x114f('0xa')][_0x114f('0xb')]({'port':0x232a});config[_0x114f('0xc')]=_[_0x114f('0xd')](config[_0x114f('0xc')],{'host':_0x114f('0xe'),'port':0x18eb});var socket=require(_0x114f('0xf'))(new Redis(config[_0x114f('0xc')]));require(_0x114f('0x10'))[_0x114f('0x11')](socket);function respondWithRpcPromise(_0x49593b,_0x22dd83,_0x18a0de){return new BPromise(function(_0x2fce4d,_0x4cf410){return client[_0x114f('0x12')](_0x49593b,_0x18a0de)[_0x114f('0x13')](function(_0x4f6f91){logger[_0x114f('0x14')](_0x114f('0x15'),_0x22dd83,'request\x20sent');logger[_0x114f('0x16')](_0x114f('0x17'),_0x22dd83,_0x114f('0x18'),JSON[_0x114f('0x19')](_0x4f6f91));if(_0x4f6f91[_0x114f('0x1a')]){if(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1b')]===0x1f4){logger[_0x114f('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);return _0x4cf410(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);}logger[_0x114f('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x4f6f91[_0x114f('0x1a')]['message']);return _0x2fce4d(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);}else{logger[_0x114f('0x14')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x114f('0x18'));_0x2fce4d(_0x4f6f91[_0x114f('0x1d')][_0x114f('0x1c')]);}})[_0x114f('0x1e')](function(_0x562637){logger[_0x114f('0x1a')](_0x114f('0x15'),_0x22dd83,_0x562637);_0x4cf410(_0x562637);});});}exports['CreateChatMessage']=function(_0x5970be){var _0x140f42=this;return new Promise(function(_0x24e0d3,_0x50244f){return db[_0x114f('0x1f')][_0x114f('0x20')](_0x5970be[_0x114f('0x21')],{'raw':_0x5970be[_0x114f('0x22')]?_0x5970be['options']['raw']===undefined?!![]:![]:!![]})[_0x114f('0x13')](function(_0x4dae99){logger[_0x114f('0x14')](_0x114f('0x23'),_0x5970be);logger[_0x114f('0x16')]('CreateChatMessage',_0x5970be,JSON[_0x114f('0x19')](_0x4dae99));_0x24e0d3(_0x4dae99);})[_0x114f('0x1e')](function(_0x3b747d){logger[_0x114f('0x1a')](_0x114f('0x23'),_0x3b747d[_0x114f('0x1c')],_0x5970be);_0x50244f(_0x140f42[_0x114f('0x1a')](0x1f4,_0x3b747d[_0x114f('0x1c')]));});});}; \ No newline at end of file +var _0xc52c=['body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc52c,0x144));var _0xcc52=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xc52c[_0xf2662b];return _0x257dc7;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var rs=require(_0xcc52('0x4'));var fs=require('fs');var Redis=require(_0xcc52('0x5'));var db=require(_0xcc52('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var jayson=require(_0xcc52('0x9'));var client=jayson['client'][_0xcc52('0xa')]({'port':0x232a});config[_0xcc52('0xb')]=_[_0xcc52('0xc')](config[_0xcc52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xcc52('0xd')](socket);function respondWithRpcPromise(_0x463999,_0x139154,_0xc44204){return new BPromise(function(_0x38bf62,_0x4242b7){return client['request'](_0x463999,_0xc44204)[_0xcc52('0xe')](function(_0x1af4dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x139154,'request\x20sent');logger[_0xcc52('0xf')](_0xcc52('0x10'),_0x139154,_0xcc52('0x11'),JSON[_0xcc52('0x12')](_0x1af4dd));if(_0x1af4dd[_0xcc52('0x13')]){if(_0x1af4dd['error']['code']===0x1f4){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd[_0xcc52('0x13')][_0xcc52('0x15')]);return _0x4242b7(_0x1af4dd[_0xcc52('0x13')]['message']);}logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd['error'][_0xcc52('0x15')]);return _0x38bf62(_0x1af4dd[_0xcc52('0x13')]['message']);}else{logger['info'](_0xcc52('0x14'),_0x139154,_0xcc52('0x11'));_0x38bf62(_0x1af4dd['result'][_0xcc52('0x15')]);}})['catch'](function(_0x4015ed){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x4015ed);_0x4242b7(_0x4015ed);});});}exports[_0xcc52('0x16')]=function(_0x1072c6){var _0x40ea65=this;return new Promise(function(_0x1c3206,_0x2805e5){return db['ChatMessage'][_0xcc52('0x17')](_0x1072c6[_0xcc52('0x18')],{'raw':_0x1072c6[_0xcc52('0x19')]?_0x1072c6[_0xcc52('0x19')][_0xcc52('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30c328){logger[_0xcc52('0x1b')](_0xcc52('0x16'),_0x1072c6);logger[_0xcc52('0xf')]('CreateChatMessage',_0x1072c6,JSON[_0xcc52('0x12')](_0x30c328));_0x1c3206(_0x30c328);})[_0xcc52('0x1c')](function(_0x425d76){logger['error']('CreateChatMessage',_0x425d76[_0xcc52('0x15')],_0x1072c6);_0x2805e5(_0x40ea65[_0xcc52('0x13')](0x1f4,_0x425d76[_0xcc52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f681725..8b27cc5 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 _0x37c5=['remove','update','emit','removeListener','chatMessage:','save'];(function(_0x4dc4a9,_0x30d8bd){var _0x4cde6c=function(_0x16d036){while(--_0x16d036){_0x4dc4a9['push'](_0x4dc4a9['shift']());}};_0x4cde6c(++_0x30d8bd);}(_0x37c5,0xa7));var _0x537c=function(_0x147136,_0x503ee8){_0x147136=_0x147136-0x0;var _0x36638e=_0x37c5[_0x147136];return _0x36638e;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){ChatMessageEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);ChatMessageEvents['on'](_0x36bf4a,_0x67f986);}}; \ No newline at end of file +var _0xa9b1=['chatMessage:','remove','update','emit','register','length'];(function(_0x27ff37,_0x2f9194){var _0x525816=function(_0x59fdaa){while(--_0x59fdaa){_0x27ff37['push'](_0x27ff37['shift']());}};_0x525816(++_0x2f9194);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x1a9b('0x0'),_0x1a9b('0x1')];function createListener(_0x11c1ff,_0x3f42db){return function(_0xc88712){_0x3f42db[_0x1a9b('0x2')](_0x11c1ff,_0xc88712);};}function removeListener(_0x52f55f,_0x57b453){return function(){ChatMessageEvents['removeListener'](_0x52f55f,_0x57b453);};}exports[_0x1a9b('0x3')]=function(_0x15861d){for(var _0x1a78b6=0x0,_0xc55657=events[_0x1a9b('0x4')];_0x1a78b6<_0xc55657;_0x1a78b6++){var _0x16c344=events[_0x1a78b6];var _0x263b84=createListener(_0x1a9b('0x5')+_0x16c344,_0x15861d);ChatMessageEvents['on'](_0x16c344,_0x263b84);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 7b788f6..6fc6b92 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 _0x35ab=['accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0x35ab,0x101));var _0xb35a=function(_0x56d49a,_0x419ef9){_0x56d49a=_0x56d49a-0x0;var _0x2fe15f=_0x35ab[_0x56d49a];return _0x2fe15f;};'use strict';var multer=require('multer');var util=require(_0xb35a('0x0'));var path=require(_0xb35a('0x1'));var timeout=require(_0xb35a('0x2'));var express=require(_0xb35a('0x3'));var router=express[_0xb35a('0x4')]();var fs_extra=require(_0xb35a('0x5'));var auth=require(_0xb35a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb35a('0x7'));var controller=require(_0xb35a('0x8'));router['get']('/',auth[_0xb35a('0x9')](),controller[_0xb35a('0xa')]);router[_0xb35a('0xb')](_0xb35a('0xc'),auth[_0xb35a('0x9')](),controller['describe']);router['get'](_0xb35a('0xd'),auth[_0xb35a('0x9')](),controller[_0xb35a('0xe')]);router[_0xb35a('0xf')]('/',auth[_0xb35a('0x9')](),interaction[_0xb35a('0x10')](_0xb35a('0x11'),_0xb35a('0x12')),controller[_0xb35a('0x13')]);router['put'](_0xb35a('0xd'),controller[_0xb35a('0x14')]);router[_0xb35a('0x15')](_0xb35a('0x16'),auth[_0xb35a('0x9')](),controller[_0xb35a('0x17')]);router[_0xb35a('0x15')](_0xb35a('0x18'),auth[_0xb35a('0x9')](),controller[_0xb35a('0x19')]);router[_0xb35a('0x1a')]('/:id',auth[_0xb35a('0x9')](),controller[_0xb35a('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x6df0=['chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','post','tracked'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0x6df0,0x8c));var _0x06df=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x6df0[_0x2aee2f];return _0x19337f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06df('0x0'));var timeout=require(_0x06df('0x1'));var express=require('express');var router=express[_0x06df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x06df('0x3'));var interaction=require(_0x06df('0x4'));var config=require(_0x06df('0x5'));var controller=require(_0x06df('0x6'));router[_0x06df('0x7')]('/',auth['isAuthenticated'](),controller[_0x06df('0x8')]);router[_0x06df('0x7')](_0x06df('0x9'),auth[_0x06df('0xa')](),controller['describe']);router[_0x06df('0x7')](_0x06df('0xb'),auth[_0x06df('0xa')](),controller['show']);router[_0x06df('0xc')]('/',auth['isAuthenticated'](),interaction[_0x06df('0xd')]('chat',_0x06df('0xe')),controller[_0x06df('0xf')]);router[_0x06df('0x10')]('/:id',controller[_0x06df('0x11')]);router[_0x06df('0x10')](_0x06df('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x06df('0x13'),auth[_0x06df('0xa')](),controller[_0x06df('0x14')]);router[_0x06df('0x15')](_0x06df('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 47fdf6a..6704ffe 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 _0xc8c5=['sequelize','exports','TEXT','medium'];(function(_0x3358e5,_0x382eea){var _0x405068=function(_0x515a35){while(--_0x515a35){_0x3358e5['push'](_0x3358e5['shift']());}};_0x405068(++_0x382eea);}(_0xc8c5,0x120));var _0x5c8c=function(_0x3a44e4,_0x3ab711){_0x3a44e4=_0x3a44e4-0x0;var _0x2c94c1=_0xc8c5[_0x3a44e4];return _0x2c94c1;};'use strict';var Sequelize=require(_0x5c8c('0x0'));module[_0x5c8c('0x1')]={'body':{'type':Sequelize[_0x5c8c('0x2')](_0x5c8c('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5fcc=['sequelize','TEXT','medium'];(function(_0x5b2002,_0x1a5b3c){var _0x54683f=function(_0x552edc){while(--_0x552edc){_0x5b2002['push'](_0x5b2002['shift']());}};_0x54683f(++_0x1a5b3c);}(_0x5fcc,0x12c));var _0xc5fc=function(_0x1b5463,_0x5716f8){_0x1b5463=_0x1b5463-0x0;var _0x33a19d=_0x5fcc[_0x1b5463];return _0x33a19d;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module['exports']={'body':{'type':Sequelize[_0xc5fc('0x1')](_0xc5fc('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9642397..a7c1902 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(_0x1dcd0e,_0x47e39d){var _0xf97eb9=function(_0x1b1b92){while(--_0x1b1b92){_0x1dcd0e['push'](_0x1dcd0e['shift']());}};_0xf97eb9(++_0x47e39d);}(_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){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(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x7a54,0x106));var _0x47a5=function(_0x366ab2,_0x1ac782){_0x366ab2=_0x366ab2-0x0;var _0x12f965=_0x7a54[_0x366ab2];return _0x12f965;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0525f19..883e5d4 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 _0xea55=['util','api','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x883c67,_0x36280e){var _0x5cabbb=function(_0x13a1cb){while(--_0x13a1cb){_0x883c67['push'](_0x883c67['shift']());}};_0x5cabbb(++_0x36280e);}(_0xea55,0x9b));var _0x5ea5=function(_0x29d2c4,_0x388d74){_0x29d2c4=_0x29d2c4-0x0;var _0x367d36=_0xea55[_0x29d2c4];return _0x367d36;};'use strict';var _=require(_0x5ea5('0x0'));var util=require(_0x5ea5('0x1'));var logger=require('../../config/logger')(_0x5ea5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ea5('0x3'));var rimraf=require(_0x5ea5('0x4'));var config=require(_0x5ea5('0x5'));var attributes=require(_0x5ea5('0x6'));module[_0x5ea5('0x7')]=function(_0x557ea6,_0x52edaf){return _0x557ea6[_0x5ea5('0x8')](_0x5ea5('0x9'),attributes,{'tableName':_0x5ea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5ea5('0xb')});}; \ No newline at end of file +var _0x0679=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x1cb715,_0x41950d){var _0x37dfff=function(_0xfccda1){while(--_0xfccda1){_0x1cb715['push'](_0x1cb715['shift']());}};_0x37dfff(++_0x41950d);}(_0x0679,0x7f));var _0x9067=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0679[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9067('0x2'));var fs=require('fs');var path=require(_0x9067('0x3'));var rimraf=require(_0x9067('0x4'));var config=require(_0x9067('0x5'));var attributes=require(_0x9067('0x6'));module[_0x9067('0x7')]=function(_0x141c3c,_0x39d74c){return _0x141c3c[_0x9067('0x8')](_0x9067('0x9'),attributes,{'tableName':_0x9067('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9067('0xb'),'collate':_0x9067('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4a78199..9d40973 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 _0x45a0=['result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x19de1d,_0x260b0d){var _0x4b7411=function(_0x3e38d3){while(--_0x3e38d3){_0x19de1d['push'](_0x19de1d['shift']());}};_0x4b7411(++_0x260b0d);}(_0x45a0,0x1e8));var _0x045a=function(_0xd31f7b,_0x4f1ede){_0xd31f7b=_0xd31f7b-0x0;var _0xfdf0f1=_0x45a0[_0xd31f7b];return _0xfdf0f1;};'use strict';var _=require(_0x045a('0x0'));var util=require(_0x045a('0x1'));var moment=require('moment');var BPromise=require(_0x045a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x045a('0x3'));var logger=require(_0x045a('0x4'))(_0x045a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x045a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2af007,_0x9bc14b,_0x31014f){return new BPromise(function(_0x35cad9,_0x104ba2){return client[_0x045a('0x7')](_0x2af007,_0x31014f)['then'](function(_0xb9ac24){logger[_0x045a('0x8')](_0x045a('0x9'),_0x9bc14b,_0x045a('0xa'));logger[_0x045a('0xb')](_0x045a('0xc'),_0x9bc14b,_0x045a('0xa'),JSON[_0x045a('0xd')](_0xb9ac24));if(_0xb9ac24[_0x045a('0xe')]){if(_0xb9ac24['error']['code']===0x1f4){logger[_0x045a('0xe')](_0x045a('0x9'),_0x9bc14b,_0xb9ac24[_0x045a('0xe')]['message']);return _0x104ba2(_0xb9ac24[_0x045a('0xe')][_0x045a('0xf')]);}logger['error'](_0x045a('0x9'),_0x9bc14b,_0xb9ac24[_0x045a('0xe')]['message']);return _0x35cad9(_0xb9ac24['error']['message']);}else{logger[_0x045a('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9bc14b,_0x045a('0xa'));_0x35cad9(_0xb9ac24[_0x045a('0x10')][_0x045a('0xf')]);}})[_0x045a('0x11')](function(_0x52025c){logger['error'](_0x045a('0x9'),_0x9bc14b,_0x52025c);_0x104ba2(_0x52025c);});});} \ No newline at end of file +var _0x3b2a=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0xe96a60,_0x5756e9){var _0x1da175=function(_0x4b3a8e){while(--_0x4b3a8e){_0xe96a60['push'](_0xe96a60['shift']());}};_0x1da175(++_0x5756e9);}(_0x3b2a,0x90));var _0xa3b2=function(_0x55a345,_0x5d3188){_0x55a345=_0x55a345-0x0;var _0xd74d62=_0x3b2a[_0x55a345];return _0xd74d62;};'use strict';var _=require('lodash');var util=require(_0xa3b2('0x0'));var moment=require('moment');var BPromise=require(_0xa3b2('0x1'));var rs=require(_0xa3b2('0x2'));var fs=require('fs');var Redis=require(_0xa3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa3b2('0x4'))(_0xa3b2('0x5'));var config=require(_0xa3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3b2('0x7')][_0xa3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59dc01,_0xc01ac1,_0x42a74c){return new BPromise(function(_0xa63d94,_0xe1ef79){return client[_0xa3b2('0x9')](_0x59dc01,_0x42a74c)[_0xa3b2('0xa')](function(_0x198b5a){logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));logger[_0xa3b2('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xc01ac1,_0xa3b2('0xd'),JSON[_0xa3b2('0xf')](_0x198b5a));if(_0x198b5a[_0xa3b2('0x10')]){if(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x11')]===0x1f4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a['error']['message']);return _0xe1ef79(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}logger[_0xa3b2('0x10')](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);return _0xa63d94(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}else{logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));_0xa63d94(_0x198b5a[_0xa3b2('0x13')][_0xa3b2('0x12')]);}})[_0xa3b2('0x14')](function(_0x5132e4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x5132e4);_0xe1ef79(_0x5132e4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 57633c9..d79605a 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 _0xe340=['index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./chatOfflineMessage.controller','isAuthenticated'];(function(_0x1fae35,_0x385d6a){var _0x22f1a7=function(_0x181ef9){while(--_0x181ef9){_0x1fae35['push'](_0x1fae35['shift']());}};_0x22f1a7(++_0x385d6a);}(_0xe340,0xb5));var _0x0e34=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe340[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0e34('0x0'));var util=require('util');var path=require(_0x0e34('0x1'));var timeout=require(_0x0e34('0x2'));var express=require('express');var router=express[_0x0e34('0x3')]();var fs_extra=require(_0x0e34('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e34('0x5'));var controller=require(_0x0e34('0x6'));router['get']('/',auth[_0x0e34('0x7')](),controller[_0x0e34('0x8')]);router['get'](_0x0e34('0x9'),auth[_0x0e34('0x7')](),controller[_0x0e34('0xa')]);router[_0x0e34('0xb')](_0x0e34('0xc'),auth[_0x0e34('0x7')](),controller[_0x0e34('0xd')]);router[_0x0e34('0xe')]('/',auth[_0x0e34('0x7')](),controller[_0x0e34('0xf')]);router[_0x0e34('0x10')](_0x0e34('0xc'),auth['isAuthenticated'](),controller[_0x0e34('0x11')]);router[_0x0e34('0x12')](_0x0e34('0xc'),auth[_0x0e34('0x7')](),controller[_0x0e34('0x13')]);module[_0x0e34('0x14')]=router; \ No newline at end of file +var _0x5a48=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5a48,0x64));var _0x85a4=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x5a48[_0x591781];return _0x315bd9;};'use strict';var multer=require(_0x85a4('0x0'));var util=require('util');var path=require(_0x85a4('0x1'));var timeout=require(_0x85a4('0x2'));var express=require(_0x85a4('0x3'));var router=express[_0x85a4('0x4')]();var fs_extra=require(_0x85a4('0x5'));var auth=require(_0x85a4('0x6'));var interaction=require(_0x85a4('0x7'));var config=require(_0x85a4('0x8'));var controller=require(_0x85a4('0x9'));router[_0x85a4('0xa')]('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xc')]);router['get']('/describe',auth[_0x85a4('0xb')](),controller['describe']);router['get'](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller['show']);router['post']('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xe')]);router[_0x85a4('0xf')]('/:id',auth[_0x85a4('0xb')](),controller[_0x85a4('0x10')]);router[_0x85a4('0x11')](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller[_0x85a4('0x12')]);module[_0x85a4('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 770d824..13aaa24 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 _0xff8e=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xff8e,0x170));var _0xeff8=function(_0x4b8d30,_0x3a0870){_0x4b8d30=_0x4b8d30-0x0;var _0xd1a650=_0xff8e[_0x4b8d30];return _0xd1a650;};'use strict';var Sequelize=require('sequelize');module[_0xeff8('0x0')]={'name':{'type':Sequelize[_0xeff8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeff8('0x2')](_0xeff8('0x3'),_0xeff8('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xeff8('0x1')]},'timeout':{'type':Sequelize[_0xeff8('0x5')]}}; \ No newline at end of file +var _0x2c57=['STRING','mouseOver','timeout','sequelize','exports'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0x2c57,0xc6));var _0x72c5=function(_0x10ab93,_0x1fcb57){_0x10ab93=_0x10ab93-0x0;var _0x1a8a68=_0x2c57[_0x10ab93];return _0x1a8a68;};'use strict';var Sequelize=require(_0x72c5('0x0'));module[_0x72c5('0x1')]={'name':{'type':Sequelize[_0x72c5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x72c5('0x3'),_0x72c5('0x4')),'defaultValue':_0x72c5('0x3')},'selector':{'type':Sequelize[_0x72c5('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 34441e4..6fba67b 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 _0x41d9=['find','create','body','catch','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','then','sendStatus','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options'];(function(_0x43f5f3,_0x3c0f41){var _0x53dc4c=function(_0x2031e0){while(--_0x2031e0){_0x43f5f3['push'](_0x43f5f3['shift']());}};_0x53dc4c(++_0x3c0f41);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require(_0x941d('0x6'));var Mustache=require('mustache');var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require('sox');var csv=require(_0x941d('0x9'));var ejs=require(_0x941d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x941d('0xb'));var squel=require('squel');var crypto=require(_0x941d('0xc'));var jsforce=require(_0x941d('0xd'));var deskjs=require(_0x941d('0xe'));var toCsv=require(_0x941d('0x9'));var querystring=require(_0x941d('0xf'));var Papa=require('papaparse');var Redis=require(_0x941d('0x10'));var authService=require(_0x941d('0x11'));var qs=require(_0x941d('0x12'));var as=require(_0x941d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x14'))(_0x941d('0x15'));var utils=require(_0x941d('0x16'));var config=require(_0x941d('0x17'));var licenseUtil=require(_0x941d('0x18'));var db=require(_0x941d('0x19'))['db'];function respondWithStatusCode(_0x4d93c4,_0x192331){_0x192331=_0x192331||0xcc;return function(_0x55c5aa){if(_0x55c5aa){return _0x4d93c4['sendStatus'](_0x192331);}return _0x4d93c4[_0x941d('0x1a')](_0x192331)[_0x941d('0x1b')]();};}function respondWithResult(_0xbd3711,_0x2aa972){_0x2aa972=_0x2aa972||0xc8;return function(_0x20a6ab){if(_0x20a6ab){return _0xbd3711[_0x941d('0x1a')](_0x2aa972)[_0x941d('0x1c')](_0x20a6ab);}};}function respondWithFilteredResult(_0x45d85d,_0x369b0b){return function(_0x1f1aeb){if(_0x1f1aeb){var _0x7df80e=typeof _0x369b0b['offset']===_0x941d('0x1d')&&typeof _0x369b0b[_0x941d('0x1e')]===_0x941d('0x1d');var _0x2e5c4f=_0x1f1aeb[_0x941d('0x1f')];var _0x3ac25f=_0x7df80e?0x0:_0x369b0b[_0x941d('0x20')];var _0x2c6ce5=_0x7df80e?_0x1f1aeb[_0x941d('0x1f')]:_0x369b0b['offset']+_0x369b0b[_0x941d('0x1e')];var _0x57f5e6;if(_0x2c6ce5>=_0x2e5c4f){_0x2c6ce5=_0x2e5c4f;_0x57f5e6=0xc8;}else{_0x57f5e6=0xce;}_0x45d85d[_0x941d('0x1a')](_0x57f5e6);return _0x45d85d[_0x941d('0x21')]('Content-Range',_0x3ac25f+'-'+_0x2c6ce5+'/'+_0x2e5c4f)[_0x941d('0x1c')](_0x1f1aeb);}return null;};}function patchUpdates(_0x5ac2e6){return function(_0x526708){try{jsonpatch[_0x941d('0x22')](_0x526708,_0x5ac2e6,!![]);}catch(_0xf6636){return BPromise[_0x941d('0x23')](_0xf6636);}return _0x526708['save']();};}function saveUpdates(_0x1309af,_0x3baf0b){return function(_0xc19c76){if(_0xc19c76){return _0xc19c76['update'](_0x1309af)['then'](function(_0x520bb2){return _0x520bb2;});}return null;};}function removeEntity(_0x306557,_0x26b7b6){return function(_0xd72c49){if(_0xd72c49){return _0xd72c49[_0x941d('0x24')]()[_0x941d('0x25')](function(){_0x306557['status'](0xcc)[_0x941d('0x1b')]();});}};}function handleEntityNotFound(_0x43a443,_0x11c2c9){return function(_0x48baff){if(!_0x48baff){_0x43a443[_0x941d('0x26')](0x194);}return _0x48baff;};}function handleError(_0x1ce2fe,_0x3190d4){_0x3190d4=_0x3190d4||0x1f4;return function(_0x3a72d7){logger[_0x941d('0x27')](_0x3a72d7[_0x941d('0x28')]);if(_0x3a72d7[_0x941d('0x29')]){delete _0x3a72d7[_0x941d('0x29')];}_0x1ce2fe[_0x941d('0x1a')](_0x3190d4)[_0x941d('0x2a')](_0x3a72d7);};}exports[_0x941d('0x2b')]=function(_0x1cacc4,_0x4cf929){var _0x30615a={'raw':!![],'where':{'id':_0x1cacc4['params']['id']}},_0x42050d={};_0x42050d[_0x941d('0x2c')]=_[_0x941d('0x2d')](db[_0x941d('0x2e')][_0x941d('0x2f')]);_0x42050d[_0x941d('0x30')]=_[_0x941d('0x2d')](_0x1cacc4[_0x941d('0x30')]);_0x42050d['filters']=_['intersection'](_0x42050d[_0x941d('0x2c')],_0x42050d[_0x941d('0x30')]);_0x30615a[_0x941d('0x31')]=_['intersection'](_0x42050d['model'],qs[_0x941d('0x32')](_0x1cacc4[_0x941d('0x30')][_0x941d('0x32')]));_0x30615a['attributes']=_0x30615a[_0x941d('0x31')][_0x941d('0x33')]?_0x30615a[_0x941d('0x31')]:_0x42050d[_0x941d('0x2c')];if(_0x1cacc4['query'][_0x941d('0x34')]){_0x30615a[_0x941d('0x35')]=[{'all':!![]}];}_0x30615a=_[_0x941d('0x36')]({},_0x30615a,_0x1cacc4[_0x941d('0x37')]);return db[_0x941d('0x2e')][_0x941d('0x38')](_0x30615a)['then'](handleEntityNotFound(_0x4cf929,null))['then'](respondWithResult(_0x4cf929,null))['catch'](handleError(_0x4cf929,null));};exports[_0x941d('0x39')]=function(_0x558846,_0x204259){return db[_0x941d('0x2e')][_0x941d('0x39')](_0x558846[_0x941d('0x3a')],{})[_0x941d('0x25')](respondWithResult(_0x204259,0xc9))[_0x941d('0x3b')](handleError(_0x204259,null));};exports[_0x941d('0x3c')]=function(_0x32d072,_0x202c89){if(_0x32d072[_0x941d('0x3a')]['id']){delete _0x32d072['body']['id'];}return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0x32d072[_0x941d('0x3d')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x202c89,null))[_0x941d('0x25')](saveUpdates(_0x32d072[_0x941d('0x3a')],null))[_0x941d('0x25')](respondWithResult(_0x202c89,null))[_0x941d('0x3b')](handleError(_0x202c89,null));};exports[_0x941d('0x24')]=function(_0xcdd784,_0x37b04c){return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0xcdd784['params']['id']}})['then'](handleEntityNotFound(_0x37b04c,null))[_0x941d('0x25')](removeEntity(_0x37b04c,null))[_0x941d('0x3b')](handleError(_0x37b04c,null));}; \ No newline at end of file +var _0x556b=['ChatProactiveAction','rawAttributes','query','intersection','model','fields','attributes','includeAll','merge','options','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','send','show'];(function(_0x4ada2b,_0x129e77){var _0x27b275=function(_0x90cf7b){while(--_0x90cf7b){_0x4ada2b['push'](_0x4ada2b['shift']());}};_0x27b275(++_0x129e77);}(_0x556b,0x1d7));var _0xb556=function(_0x4ae509,_0x27c36a){_0x4ae509=_0x4ae509-0x0;var _0x10e96e=_0x556b[_0x4ae509];return _0x10e96e;};'use strict';var emlformat=require(_0xb556('0x0'));var rimraf=require(_0xb556('0x1'));var zipdir=require(_0xb556('0x2'));var jsonpatch=require(_0xb556('0x3'));var rp=require(_0xb556('0x4'));var moment=require('moment');var BPromise=require(_0xb556('0x5'));var Mustache=require(_0xb556('0x6'));var util=require(_0xb556('0x7'));var path=require(_0xb556('0x8'));var sox=require(_0xb556('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb556('0xa'));var squel=require(_0xb556('0xb'));var crypto=require(_0xb556('0xc'));var jsforce=require(_0xb556('0xd'));var deskjs=require(_0xb556('0xe'));var toCsv=require(_0xb556('0xf'));var querystring=require(_0xb556('0x10'));var Papa=require(_0xb556('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb556('0x13'));var logger=require(_0xb556('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb556('0x15'));var licenseUtil=require(_0xb556('0x16'));var db=require(_0xb556('0x17'))['db'];function respondWithStatusCode(_0x40d9f2,_0xef593){_0xef593=_0xef593||0xcc;return function(_0x383401){if(_0x383401){return _0x40d9f2['sendStatus'](_0xef593);}return _0x40d9f2['status'](_0xef593)[_0xb556('0x18')]();};}function respondWithResult(_0x5a002a,_0x29fa7e){_0x29fa7e=_0x29fa7e||0xc8;return function(_0x52ff5e){if(_0x52ff5e){return _0x5a002a['status'](_0x29fa7e)['json'](_0x52ff5e);}};}function respondWithFilteredResult(_0x39305f,_0x9c69d9){return function(_0xffd07){if(_0xffd07){var _0x329bd0=typeof _0x9c69d9[_0xb556('0x19')]===_0xb556('0x1a')&&typeof _0x9c69d9[_0xb556('0x1b')]===_0xb556('0x1a');var _0xcfaa19=_0xffd07['count'];var _0x475808=_0x329bd0?0x0:_0x9c69d9[_0xb556('0x19')];var _0xb378b2=_0x329bd0?_0xffd07[_0xb556('0x1c')]:_0x9c69d9['offset']+_0x9c69d9[_0xb556('0x1b')];var _0x355b15;if(_0xb378b2>=_0xcfaa19){_0xb378b2=_0xcfaa19;_0x355b15=0xc8;}else{_0x355b15=0xce;}_0x39305f[_0xb556('0x1d')](_0x355b15);return _0x39305f[_0xb556('0x1e')]('Content-Range',_0x475808+'-'+_0xb378b2+'/'+_0xcfaa19)[_0xb556('0x1f')](_0xffd07);}return null;};}function patchUpdates(_0x3f1f30){return function(_0xa840e7){try{jsonpatch[_0xb556('0x20')](_0xa840e7,_0x3f1f30,!![]);}catch(_0x49d0b5){return BPromise[_0xb556('0x21')](_0x49d0b5);}return _0xa840e7[_0xb556('0x22')]();};}function saveUpdates(_0x21a3b6,_0x126af6){return function(_0x420ddb){if(_0x420ddb){return _0x420ddb[_0xb556('0x23')](_0x21a3b6)[_0xb556('0x24')](function(_0x5f10a5){return _0x5f10a5;});}return null;};}function removeEntity(_0x33797a,_0x3d5ae7){return function(_0x12b195){if(_0x12b195){return _0x12b195[_0xb556('0x25')]()[_0xb556('0x24')](function(){_0x33797a[_0xb556('0x1d')](0xcc)[_0xb556('0x18')]();});}};}function handleEntityNotFound(_0x442264,_0x22abed){return function(_0x184e87){if(!_0x184e87){_0x442264[_0xb556('0x26')](0x194);}return _0x184e87;};}function handleError(_0x3a328c,_0xb89dbe){_0xb89dbe=_0xb89dbe||0x1f4;return function(_0x1962b1){logger['error'](_0x1962b1[_0xb556('0x27')]);if(_0x1962b1['name']){delete _0x1962b1['name'];}_0x3a328c['status'](_0xb89dbe)[_0xb556('0x28')](_0x1962b1);};}exports[_0xb556('0x29')]=function(_0x27fd7e,_0x58180c){var _0x19544e={'raw':!![],'where':{'id':_0x27fd7e['params']['id']}},_0x3c9a87={};_0x3c9a87['model']=_['keys'](db[_0xb556('0x2a')][_0xb556('0x2b')]);_0x3c9a87['query']=_['keys'](_0x27fd7e[_0xb556('0x2c')]);_0x3c9a87['filters']=_[_0xb556('0x2d')](_0x3c9a87['model'],_0x3c9a87[_0xb556('0x2c')]);_0x19544e['attributes']=_[_0xb556('0x2d')](_0x3c9a87[_0xb556('0x2e')],qs['fields'](_0x27fd7e['query'][_0xb556('0x2f')]));_0x19544e[_0xb556('0x30')]=_0x19544e[_0xb556('0x30')]['length']?_0x19544e[_0xb556('0x30')]:_0x3c9a87[_0xb556('0x2e')];if(_0x27fd7e[_0xb556('0x2c')][_0xb556('0x31')]){_0x19544e['include']=[{'all':!![]}];}_0x19544e=_[_0xb556('0x32')]({},_0x19544e,_0x27fd7e[_0xb556('0x33')]);return db['ChatProactiveAction']['find'](_0x19544e)[_0xb556('0x24')](handleEntityNotFound(_0x58180c,null))[_0xb556('0x24')](respondWithResult(_0x58180c,null))[_0xb556('0x34')](handleError(_0x58180c,null));};exports['create']=function(_0x272ffe,_0x2af3fa){return db['ChatProactiveAction'][_0xb556('0x35')](_0x272ffe[_0xb556('0x36')],{})[_0xb556('0x24')](respondWithResult(_0x2af3fa,0xc9))['catch'](handleError(_0x2af3fa,null));};exports['update']=function(_0x34273c,_0x2db02e){if(_0x34273c[_0xb556('0x36')]['id']){delete _0x34273c['body']['id'];}return db[_0xb556('0x2a')][_0xb556('0x37')]({'where':{'id':_0x34273c['params']['id']}})['then'](handleEntityNotFound(_0x2db02e,null))[_0xb556('0x24')](saveUpdates(_0x34273c[_0xb556('0x36')],null))['then'](respondWithResult(_0x2db02e,null))['catch'](handleError(_0x2db02e,null));};exports[_0xb556('0x25')]=function(_0x13d1d5,_0x38c26d){return db[_0xb556('0x2a')]['find']({'where':{'id':_0x13d1d5[_0xb556('0x38')]['id']}})['then'](handleEntityNotFound(_0x38c26d,null))['then'](removeEntity(_0x38c26d,null))[_0xb556('0x34')](handleError(_0x38c26d,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b2ee2b8..475d323 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 _0x2a63=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xe8f1f9,_0x212021){var _0x16995e=function(_0x11cd04){while(--_0x11cd04){_0xe8f1f9['push'](_0xe8f1f9['shift']());}};_0x16995e(++_0x212021);}(_0x2a63,0x87));var _0x32a6=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x2a63[_0x14915a];return _0x2f683c;};'use strict';var _=require(_0x32a6('0x0'));var util=require(_0x32a6('0x1'));var logger=require(_0x32a6('0x2'))(_0x32a6('0x3'));var moment=require(_0x32a6('0x4'));var BPromise=require(_0x32a6('0x5'));var rp=require(_0x32a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32a6('0x7'));var attributes=require(_0x32a6('0x8'));module[_0x32a6('0x9')]=function(_0x5a1e3b,_0x103b18){return _0x5a1e3b[_0x32a6('0xa')](_0x32a6('0xb'),attributes,{'tableName':_0x32a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6140=['bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','../../config/logger'];(function(_0x34a459,_0x136cd9){var _0x500f8b=function(_0xdcad7f){while(--_0xdcad7f){_0x34a459['push'](_0x34a459['shift']());}};_0x500f8b(++_0x136cd9);}(_0x6140,0x1d6));var _0x0614=function(_0x4345be,_0x1e1dd6){_0x4345be=_0x4345be-0x0;var _0xf851a1=_0x6140[_0x4345be];return _0xf851a1;};'use strict';var _=require('lodash');var util=require(_0x0614('0x0'));var logger=require(_0x0614('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0614('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0614('0x3'));var attributes=require(_0x0614('0x4'));module[_0x0614('0x5')]=function(_0x324dde,_0x4dd7f1){return _0x324dde[_0x0614('0x6')](_0x0614('0x7'),attributes,{'tableName':'chat_proactive_actions','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 c32ef84..969b2c8 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 _0x26a1=['code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31c32e,_0x4c2442){var _0x3d39b1=function(_0x5e3c03){while(--_0x5e3c03){_0x31c32e['push'](_0x31c32e['shift']());}};_0x3d39b1(++_0x4c2442);}(_0x26a1,0x115));var _0x126a=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x26a1[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x126a('0x0'));var BPromise=require('bluebird');var rs=require(_0x126a('0x1'));var fs=require('fs');var Redis=require(_0x126a('0x2'));var db=require(_0x126a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x126a('0x4'))(_0x126a('0x5'));var config=require(_0x126a('0x6'));var jayson=require(_0x126a('0x7'));var client=jayson['client'][_0x126a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2de2d9,_0x552442,_0x5d0659){return new BPromise(function(_0x176594,_0x1b45d2){return client[_0x126a('0x9')](_0x2de2d9,_0x5d0659)[_0x126a('0xa')](function(_0x4925be){logger[_0x126a('0xb')](_0x126a('0xc'),_0x552442,_0x126a('0xd'));logger['debug'](_0x126a('0xe'),_0x552442,_0x126a('0xd'),JSON[_0x126a('0xf')](_0x4925be));if(_0x4925be[_0x126a('0x10')]){if(_0x4925be['error'][_0x126a('0x11')]===0x1f4){logger[_0x126a('0x10')](_0x126a('0xc'),_0x552442,_0x4925be[_0x126a('0x10')]['message']);return _0x1b45d2(_0x4925be[_0x126a('0x10')][_0x126a('0x12')]);}logger[_0x126a('0x10')](_0x126a('0xc'),_0x552442,_0x4925be['error']['message']);return _0x176594(_0x4925be[_0x126a('0x10')][_0x126a('0x12')]);}else{logger['info'](_0x126a('0xc'),_0x552442,'request\x20sent');_0x176594(_0x4925be[_0x126a('0x13')][_0x126a('0x12')]);}})[_0x126a('0x14')](function(_0x3c06f3){logger['error'](_0x126a('0xc'),_0x552442,_0x3c06f3);_0x1b45d2(_0x3c06f3);});});} \ No newline at end of file +var _0xff7e=['../../config/logger','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0xff7e,0x163));var _0xeff7=function(_0x4ac7f3,_0x580162){_0x4ac7f3=_0x4ac7f3-0x0;var _0x5690f1=_0xff7e[_0x4ac7f3];return _0x5690f1;};'use strict';var _=require(_0xeff7('0x0'));var util=require(_0xeff7('0x1'));var moment=require(_0xeff7('0x2'));var BPromise=require(_0xeff7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeff7('0x4'));var logger=require(_0xeff7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeff7('0x6'));var client=jayson['client'][_0xeff7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45a825,_0x422243,_0x16876c){return new BPromise(function(_0x392f3f,_0x136a47){return client[_0xeff7('0x8')](_0x45a825,_0x16876c)['then'](function(_0xc61a7f){logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');logger[_0xeff7('0xb')](_0xeff7('0xc'),_0x422243,_0xeff7('0xd'),JSON[_0xeff7('0xe')](_0xc61a7f));if(_0xc61a7f[_0xeff7('0xf')]){if(_0xc61a7f[_0xeff7('0xf')]['code']===0x1f4){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')]['message']);return _0x136a47(_0xc61a7f['error'][_0xeff7('0x10')]);}logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);return _0x392f3f(_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);}else{logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');_0x392f3f(_0xc61a7f[_0xeff7('0x11')][_0xeff7('0x10')]);}})['catch'](function(_0x5f3b6d){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0x5f3b6d);_0x136a47(_0x5f3b6d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c6eae9e..c13d473 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x54eb07,_0x335479){var _0x2b1bbb=function(_0x726a1e){while(--_0x726a1e){_0x54eb07['push'](_0x54eb07['shift']());}};_0x2b1bbb(++_0x335479);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4c56ad,_0x58b96f){_0x4c56ad=_0x4c56ad-0x0;var _0x216c05=_0xd8fb[_0x4c56ad];return _0x216c05;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file +var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x370c84,_0x1163e0){var _0x4cca44=function(_0x3b53a7){while(--_0x3b53a7){_0x370c84['push'](_0x370c84['shift']());}};_0x4cca44(++_0x1163e0);}(_0x53ec,0x192));var _0xc53e=function(_0x3d3d96,_0x28998e){_0x3d3d96=_0x3d3d96-0x0;var _0x2e479a=_0x53ec[_0x3d3d96];return _0x2e479a;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 8a6d35b..fc31f52 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 _0x2628=['exports','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x5afa3a,_0x886fc7){var _0x43b612=function(_0xac89ec){while(--_0xac89ec){_0x5afa3a['push'](_0x5afa3a['shift']());}};_0x43b612(++_0x886fc7);}(_0x2628,0x15c));var _0x8262=function(_0x2693e7,_0x5c450b){_0x2693e7=_0x2693e7-0x0;var _0x1944c9=_0x2628[_0x2693e7];return _0x1944c9;};'use strict';var Sequelize=require('sequelize');module[_0x8262('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8262('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8262('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8262('0x3')](_0x8262('0x4'),'beepall',_0x8262('0x5'))}}; \ No newline at end of file +var _0x948b=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x61711c,_0x5b2962){var _0x4cf0e9=function(_0x179352){while(--_0x179352){_0x61711c['push'](_0x61711c['shift']());}};_0x4cf0e9(++_0x5b2962);}(_0x948b,0x15c));var _0xb948=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x948b[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb948('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb948('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb948('0x2')](_0xb948('0x3'),_0xb948('0x4'),_0xb948('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index ab701ce..1ac4930 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 _0x6c20=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','query','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','createdAt','format','%s/%s','chatPause','Team','getTeams','hasOwnProperty','User','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','userChatQueue:save','getAgents','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x569ea2,_0x4857f1){var _0xda711=function(_0xcada49){while(--_0xcada49){_0x569ea2['push'](_0x569ea2['shift']());}};_0xda711(++_0x4857f1);}(_0x6c20,0x88));var _0x06c2=function(_0x2775f4,_0x10ddd4){_0x2775f4=_0x2775f4-0x0;var _0x377a51=_0x6c20[_0x2775f4];return _0x377a51;};'use strict';var emlformat=require(_0x06c2('0x0'));var rimraf=require(_0x06c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x06c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x06c2('0x3'));var util=require(_0x06c2('0x4'));var path=require(_0x06c2('0x5'));var sox=require(_0x06c2('0x6'));var csv=require(_0x06c2('0x7'));var ejs=require(_0x06c2('0x8'));var fs=require('fs');var fs_extra=require(_0x06c2('0x9'));var _=require(_0x06c2('0xa'));var squel=require(_0x06c2('0xb'));var crypto=require('crypto');var jsforce=require(_0x06c2('0xc'));var deskjs=require(_0x06c2('0xd'));var toCsv=require(_0x06c2('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06c2('0xe'));var qs=require(_0x06c2('0xf'));var as=require(_0x06c2('0x10'));var hardwareService=require(_0x06c2('0x11'));var logger=require(_0x06c2('0x12'))(_0x06c2('0x13'));var utils=require(_0x06c2('0x14'));var config=require(_0x06c2('0x15'));var licenseUtil=require(_0x06c2('0x16'));var db=require(_0x06c2('0x17'))['db'];config['redis']=_[_0x06c2('0x18')](config[_0x06c2('0x19')],{'host':_0x06c2('0x1a'),'port':0x18eb});var socket=require(_0x06c2('0x1b'))(new Redis(config['redis']));require(_0x06c2('0x1c'))['register'](socket);var jayson=require(_0x06c2('0x1d'));var client=jayson[_0x06c2('0x1e')][_0x06c2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3ca58e,_0x574a8b,_0x946f15,_0x224baa){return new BPromise(function(_0x112ab2,_0x1df697){var _0x5cec76=_0x224baa||client;return _0x5cec76['request'](_0x3ca58e,_0x946f15)['then'](function(_0x4bf48d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x574a8b,_0x06c2('0x20'));logger[_0x06c2('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x574a8b,'request\x20sent',JSON['stringify'](_0x4bf48d));if(_0x4bf48d[_0x06c2('0x22')]){if(_0x4bf48d[_0x06c2('0x22')][_0x06c2('0x23')]===0x1f4){logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x4bf48d[_0x06c2('0x22')][_0x06c2('0x25')]);return _0x1df697(_0x4bf48d['error'][_0x06c2('0x25')]);}logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x4bf48d[_0x06c2('0x22')]['message']);return _0x112ab2(_0x4bf48d['error'][_0x06c2('0x25')]);}else{logger['info'](_0x06c2('0x24'),_0x574a8b,_0x06c2('0x20'));_0x112ab2(_0x4bf48d[_0x06c2('0x26')][_0x06c2('0x25')]);}})['catch'](function(_0x2d8373){logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x2d8373);_0x1df697(_0x2d8373);});});}function respondWithStatusCode(_0xb56c17,_0x86da7a){_0x86da7a=_0x86da7a||0xcc;return function(_0x30bece){if(_0x30bece){return _0xb56c17[_0x06c2('0x27')](_0x86da7a);}return _0xb56c17[_0x06c2('0x28')](_0x86da7a)[_0x06c2('0x29')]();};}function respondWithResult(_0x413125,_0x391f87){_0x391f87=_0x391f87||0xc8;return function(_0x4c12ca){if(_0x4c12ca){return _0x413125[_0x06c2('0x28')](_0x391f87)[_0x06c2('0x2a')](_0x4c12ca);}};}function respondWithFilteredResult(_0x23ea70,_0x222124){return function(_0xe2b961){if(_0xe2b961){var _0x2c6a15=typeof _0x222124[_0x06c2('0x2b')]==='undefined'&&typeof _0x222124[_0x06c2('0x2c')]===_0x06c2('0x2d');var _0x2425ad=_0xe2b961[_0x06c2('0x2e')];var _0xe6b93c=_0x2c6a15?0x0:_0x222124['offset'];var _0x3e4d7f=_0x2c6a15?_0xe2b961[_0x06c2('0x2e')]:_0x222124['offset']+_0x222124[_0x06c2('0x2c')];var _0x5bd948;if(_0x3e4d7f>=_0x2425ad){_0x3e4d7f=_0x2425ad;_0x5bd948=0xc8;}else{_0x5bd948=0xce;}_0x23ea70[_0x06c2('0x28')](_0x5bd948);return _0x23ea70[_0x06c2('0x2f')](_0x06c2('0x30'),_0xe6b93c+'-'+_0x3e4d7f+'/'+_0x2425ad)['json'](_0xe2b961);}return null;};}function patchUpdates(_0x30fb98){return function(_0x414cc3){try{jsonpatch[_0x06c2('0x31')](_0x414cc3,_0x30fb98,!![]);}catch(_0x5be2cd){return BPromise[_0x06c2('0x32')](_0x5be2cd);}return _0x414cc3[_0x06c2('0x33')]();};}function saveUpdates(_0x5a69c1,_0x5bb12a){return function(_0x286ba4){if(_0x286ba4){return _0x286ba4['update'](_0x5a69c1)[_0x06c2('0x34')](function(_0x445a18){return _0x445a18;});}return null;};}function removeEntity(_0x2e5d4c,_0x5eee96){return function(_0xfd4e47){if(_0xfd4e47){return _0xfd4e47[_0x06c2('0x35')]()[_0x06c2('0x34')](function(){var _0x232c15=_0xfd4e47[_0x06c2('0x36')]({'plain':!![]});var _0x5dec20=_0x06c2('0x37');return db[_0x06c2('0x38')][_0x06c2('0x35')]({'where':{'type':_0x5dec20,'resourceId':_0x232c15['id']}})[_0x06c2('0x34')](function(){return _0xfd4e47;});})[_0x06c2('0x34')](function(){_0x2e5d4c[_0x06c2('0x28')](0xcc)[_0x06c2('0x29')]();});}};}function handleEntityNotFound(_0x1ad475,_0x1fe07a){return function(_0x110415){if(!_0x110415){_0x1ad475['sendStatus'](0x194);}return _0x110415;};}function handleError(_0x21a593,_0x2ccc33){_0x2ccc33=_0x2ccc33||0x1f4;return function(_0x1e053f){logger[_0x06c2('0x22')](_0x1e053f[_0x06c2('0x39')]);if(_0x1e053f[_0x06c2('0x3a')]){delete _0x1e053f['name'];}_0x21a593['status'](_0x2ccc33)['send'](_0x1e053f);};}exports[_0x06c2('0x3b')]=function(_0x22bd8c,_0x15260b){var _0x3c1bc0={},_0x271c20={},_0x1a5abf={'count':0x0,'rows':[]};var _0x5d5f19=_[_0x06c2('0x3c')](db[_0x06c2('0x3d')][_0x06c2('0x3e')],function(_0x315d89){return{'name':_0x315d89[_0x06c2('0x3f')],'type':_0x315d89[_0x06c2('0x40')]['key']};});_0x271c20['model']=_[_0x06c2('0x3c')](_0x5d5f19,_0x06c2('0x3a'));_0x271c20[_0x06c2('0x41')]=_['keys'](_0x22bd8c[_0x06c2('0x41')]);_0x271c20['filters']=_[_0x06c2('0x42')](_0x271c20['model'],_0x271c20[_0x06c2('0x41')]);_0x3c1bc0[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x271c20[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x22bd8c[_0x06c2('0x41')]['fields']));_0x3c1bc0['attributes']=_0x3c1bc0['attributes']['length']?_0x3c1bc0[_0x06c2('0x43')]:_0x271c20[_0x06c2('0x44')];if(!_0x22bd8c['query']['hasOwnProperty'](_0x06c2('0x46'))){_0x3c1bc0[_0x06c2('0x2c')]=qs[_0x06c2('0x2c')](_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x3c1bc0[_0x06c2('0x2b')]=qs[_0x06c2('0x2b')](_0x22bd8c['query'][_0x06c2('0x2b')]);}_0x3c1bc0[_0x06c2('0x47')]=qs[_0x06c2('0x48')](_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x48')]);_0x3c1bc0[_0x06c2('0x49')]=qs['filters'](_[_0x06c2('0x4a')](_0x22bd8c[_0x06c2('0x41')],_0x271c20[_0x06c2('0x4b')]),_0x5d5f19);if(_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x4c')]){_0x3c1bc0[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0x3c1bc0[_0x06c2('0x49')],{'$or':_[_0x06c2('0x3c')](_0x5d5f19,function(_0x1168b5){if(_0x1168b5['type']!==_0x06c2('0x4e')){var _0x23e01e={};_0x23e01e[_0x1168b5[_0x06c2('0x3a')]]={'$like':'%'+_0x22bd8c[_0x06c2('0x41')]['filter']+'%'};return _0x23e01e;}})});}_0x3c1bc0=_[_0x06c2('0x4d')]({},_0x3c1bc0,_0x22bd8c[_0x06c2('0x4f')]);var _0x2ce4b6={'where':_0x3c1bc0['where']};return db['ChatQueue']['count'](_0x2ce4b6)[_0x06c2('0x34')](function(_0x13929e){_0x1a5abf[_0x06c2('0x2e')]=_0x13929e;if(_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x50')]){_0x3c1bc0[_0x06c2('0x51')]=[{'all':!![]}];}return db[_0x06c2('0x3d')][_0x06c2('0x52')](_0x3c1bc0);})[_0x06c2('0x34')](function(_0x4d1cad){_0x1a5abf[_0x06c2('0x53')]=_0x4d1cad;return _0x1a5abf;})['then'](respondWithFilteredResult(_0x15260b,_0x3c1bc0))[_0x06c2('0x54')](handleError(_0x15260b,null));};exports['show']=function(_0x5f0168,_0x23434a){var _0x1c53ef={'raw':!![],'where':{'id':_0x5f0168[_0x06c2('0x55')]['id']}},_0x38290e={};_0x38290e['model']=_['keys'](db[_0x06c2('0x3d')][_0x06c2('0x3e')]);_0x38290e[_0x06c2('0x41')]=_[_0x06c2('0x56')](_0x5f0168['query']);_0x38290e[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x38290e[_0x06c2('0x44')],_0x38290e[_0x06c2('0x41')]);_0x1c53ef[_0x06c2('0x43')]=_['intersection'](_0x38290e[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x5f0168['query'][_0x06c2('0x45')]));_0x1c53ef[_0x06c2('0x43')]=_0x1c53ef['attributes'][_0x06c2('0x57')]?_0x1c53ef[_0x06c2('0x43')]:_0x38290e[_0x06c2('0x44')];if(_0x5f0168['query'][_0x06c2('0x50')]){_0x1c53ef[_0x06c2('0x51')]=[{'all':!![]}];}_0x1c53ef=_[_0x06c2('0x4d')]({},_0x1c53ef,_0x5f0168['options']);return db[_0x06c2('0x3d')][_0x06c2('0x58')](_0x1c53ef)['then'](handleEntityNotFound(_0x23434a,null))['then'](respondWithResult(_0x23434a,null))[_0x06c2('0x54')](handleError(_0x23434a,null));};exports[_0x06c2('0x59')]=function(_0x4cd26a,_0x2c4bf0){return db[_0x06c2('0x3d')]['create'](_0x4cd26a[_0x06c2('0x5a')],{})[_0x06c2('0x34')](function(_0x55a9f4){var _0x3d10b5=_0x4cd26a[_0x06c2('0x5b')][_0x06c2('0x36')]({'plain':!![]});if(!_0x3d10b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d10b5[_0x06c2('0x5c')]===_0x06c2('0x5b')){var _0x151571=_0x55a9f4[_0x06c2('0x36')]({'plain':!![]});var _0x1f1fbc=_0x06c2('0x37');return db[_0x06c2('0x5d')][_0x06c2('0x58')]({'where':{'name':_0x1f1fbc,'userProfileId':_0x3d10b5[_0x06c2('0x5e')]},'raw':!![]})[_0x06c2('0x34')](function(_0x3e9d4b){if(_0x3e9d4b&&_0x3e9d4b[_0x06c2('0x5f')]===0x0){return db[_0x06c2('0x38')]['create']({'name':_0x151571[_0x06c2('0x3a')],'resourceId':_0x151571['id'],'type':_0x3e9d4b[_0x06c2('0x3a')],'sectionId':_0x3e9d4b['id']},{})[_0x06c2('0x34')](function(){return _0x55a9f4;});}else{return _0x55a9f4;}})['catch'](function(_0x46b368){logger[_0x06c2('0x22')](_0x06c2('0x60'),_0x46b368);throw _0x46b368;});}return _0x55a9f4;})['then'](respondWithResult(_0x2c4bf0,0xc9))[_0x06c2('0x54')](handleError(_0x2c4bf0,null));};exports['update']=function(_0x1c1676,_0x48f88d){if(_0x1c1676['body']['id']){delete _0x1c1676['body']['id'];}return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x1c1676['params']['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x48f88d,null))[_0x06c2('0x34')](saveUpdates(_0x1c1676[_0x06c2('0x5a')],null))['then'](respondWithResult(_0x48f88d,null))[_0x06c2('0x54')](handleError(_0x48f88d,null));};exports[_0x06c2('0x35')]=function(_0x1a9e22,_0x3e02a6){return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x1a9e22[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x3e02a6,null))[_0x06c2('0x34')](removeEntity(_0x3e02a6,null))['catch'](handleError(_0x3e02a6,null));};exports[_0x06c2('0x61')]=function(_0x56a045,_0xf7d689){return db[_0x06c2('0x3d')]['describe']()[_0x06c2('0x34')](respondWithResult(_0xf7d689,null))[_0x06c2('0x54')](handleError(_0xf7d689,null));};exports[_0x06c2('0x62')]=function(_0x120669,_0x417b31,_0x5aa919){var _0x3244b8={'raw':!![],'where':{}},_0x2b41e9={},_0x60887e;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x120669['params']['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x417b31,null))[_0x06c2('0x34')](function(_0x27484d){if(_0x27484d){_0x60887e=_0x27484d[_0x06c2('0x36')]({'plain':!![]});_0x2b41e9['model']=_[_0x06c2('0x56')](db[_0x06c2('0x64')]['rawAttributes']);_0x2b41e9[_0x06c2('0x41')]=_[_0x06c2('0x56')](_0x120669[_0x06c2('0x41')]);_0x2b41e9['filters']=_[_0x06c2('0x42')](_0x2b41e9[_0x06c2('0x44')],_0x2b41e9['query']);_0x3244b8[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x2b41e9[_0x06c2('0x44')],qs['fields'](_0x120669[_0x06c2('0x41')][_0x06c2('0x45')]));_0x3244b8['attributes']=_0x3244b8['attributes']['length']?_0x3244b8[_0x06c2('0x43')]:_0x2b41e9[_0x06c2('0x44')];if(!_0x120669[_0x06c2('0x41')]['hasOwnProperty']('nolimit')){_0x3244b8[_0x06c2('0x2c')]=qs[_0x06c2('0x2c')](_0x120669[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x3244b8['offset']=qs[_0x06c2('0x2b')](_0x120669[_0x06c2('0x41')][_0x06c2('0x2b')]);}_0x3244b8[_0x06c2('0x47')]=qs['sort'](_0x120669[_0x06c2('0x41')][_0x06c2('0x48')]);_0x3244b8[_0x06c2('0x49')]=qs[_0x06c2('0x4b')](_[_0x06c2('0x4a')](_0x120669[_0x06c2('0x41')],_0x2b41e9[_0x06c2('0x4b')]));_0x3244b8[_0x06c2('0x49')][_0x06c2('0x65')]=_0x27484d['id'];if(_0x120669[_0x06c2('0x41')]['filter']){_0x3244b8['where']=_[_0x06c2('0x4d')](_0x3244b8[_0x06c2('0x49')],{'$or':_[_0x06c2('0x3c')](_0x3244b8['attributes'],function(_0x21950b){var _0x1adce9={};_0x1adce9[_0x21950b]={'$like':'%'+_0x120669[_0x06c2('0x41')][_0x06c2('0x4c')]+'%'};return _0x1adce9;})});}_0x3244b8=_[_0x06c2('0x4d')]({},_0x3244b8,_0x120669[_0x06c2('0x4f')]);return db['UserChatQueue']['findAll'](_0x3244b8);}})[_0x06c2('0x34')](function(_0x5f409b){if(_0x5f409b){return db['User'][_0x06c2('0x66')]({'where':{'id':_[_0x06c2('0x3c')](_0x5f409b,_0x06c2('0x67')),'role':_0x06c2('0x68')},'attributes':['id',_0x06c2('0x3a'),'chatPause','updatedAt',_0x06c2('0x69')]});}})[_0x06c2('0x34')](function(_0x26e380){if(_0x26e380){return{'count':_0x26e380[_0x06c2('0x2e')],'rows':_[_0x06c2('0x3c')](_0x26e380['rows'],function(_0x232ff2){return{'membername':_0x232ff2[_0x06c2('0x3a')],'UserId':_0x232ff2['id'],'queue_name':_0x60887e[_0x06c2('0x3a')],'ChatQueueId':_0x60887e['id'],'interface':util[_0x06c2('0x6a')](_0x06c2('0x6b'),'SIP',_0x232ff2[_0x06c2('0x3a')]),'penalty':0x0,'paused':_0x232ff2[_0x06c2('0x6c')],'createdAt':_0x232ff2[_0x06c2('0x69')],'updatedAt':_0x232ff2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x417b31,_0x3244b8))[_0x06c2('0x54')](handleError(_0x417b31,null));};exports['getTeams']=function(_0x7f8da1,_0x597918,_0x4ebea2){var _0xdd9b03={};var _0x21e6a1={};var _0x3729e6;var _0x2f7523;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x7f8da1[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x597918,null))['then'](function(_0x27ea45){if(_0x27ea45){_0x3729e6=_0x27ea45;_0x21e6a1[_0x06c2('0x44')]=_[_0x06c2('0x56')](db[_0x06c2('0x6d')][_0x06c2('0x3e')]);_0x21e6a1['query']=_[_0x06c2('0x56')](_0x7f8da1[_0x06c2('0x41')]);_0x21e6a1[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x21e6a1[_0x06c2('0x44')],_0x21e6a1[_0x06c2('0x41')]);_0xdd9b03['attributes']=_['intersection'](_0x21e6a1[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x45')]));_0xdd9b03['attributes']=_0xdd9b03[_0x06c2('0x43')][_0x06c2('0x57')]?_0xdd9b03[_0x06c2('0x43')]:_0x21e6a1['model'];_0xdd9b03['order']=qs[_0x06c2('0x48')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x48')]);_0xdd9b03['where']=qs[_0x06c2('0x4b')](_[_0x06c2('0x4a')](_0x7f8da1[_0x06c2('0x41')],_0x21e6a1['filters']));if(_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x4c')]){_0xdd9b03[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0xdd9b03['where'],{'$or':_[_0x06c2('0x3c')](_0xdd9b03[_0x06c2('0x43')],function(_0x3a099d){var _0x1f4346={};_0x1f4346[_0x3a099d]={'$like':'%'+_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x4c')]+'%'};return _0x1f4346;})});}_0xdd9b03=_[_0x06c2('0x4d')]({},_0xdd9b03,_0x7f8da1[_0x06c2('0x4f')]);return _0x3729e6[_0x06c2('0x6e')](_0xdd9b03);}})['then'](function(_0x4d7cd){if(_0x4d7cd){_0x2f7523=_0x4d7cd[_0x06c2('0x57')];if(!_0x7f8da1['query'][_0x06c2('0x6f')]('nolimit')){_0xdd9b03['limit']=qs[_0x06c2('0x2c')](_0x7f8da1['query'][_0x06c2('0x2c')]);_0xdd9b03[_0x06c2('0x2b')]=qs[_0x06c2('0x2b')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x2b')]);}return _0x3729e6[_0x06c2('0x6e')](_0xdd9b03);}})[_0x06c2('0x34')](function(_0x47a31f){if(_0x47a31f){return _0x47a31f?{'count':_0x2f7523,'rows':_0x47a31f}:null;}})[_0x06c2('0x34')](respondWithResult(_0x597918,null))[_0x06c2('0x54')](handleError(_0x597918,null));};exports['addTeams']=function(_0x495be6,_0x3aadcd,_0x606986){var _0x50543a=_0x495be6[_0x06c2('0x5a')]['ids'];return db[_0x06c2('0x6d')][_0x06c2('0x52')]({'where':{'id':_0x50543a},'attributes':['id'],'include':[{'model':db[_0x06c2('0x70')],'as':_0x06c2('0x71'),'attributes':['id',_0x06c2('0x3a'),_0x06c2('0x72'),_0x06c2('0x73'),'interface'],'raw':!![]}]})[_0x06c2('0x34')](function(_0x5b2845){if(_0x5b2845){var _0x1c5ca9=_[_0x06c2('0x74')](_0x5b2845,function(_0x5479f){var _0x5813a9=_0x5479f['get']({'plain':!![]});return _0x5813a9[_0x06c2('0x71')];});return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x495be6[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](function(_0x2ee3ee){return db[_0x06c2('0x75')][_0x06c2('0x76')](function(_0x405f1c){return _0x2ee3ee[_0x06c2('0x77')](_0x50543a,{'transaction':_0x405f1c})['then'](function(){return BPromise[_0x06c2('0x78')](_0x1c5ca9,function(_0x22d245){return db[_0x06c2('0x64')][_0x06c2('0x79')]({'where':{'UserId':_0x22d245['id'],'ChatQueueId':_0x495be6[_0x06c2('0x55')]['id']},'transaction':_0x405f1c});});})[_0x06c2('0x34')](function(){_0x1c5ca9['forEach'](function(_0x18c54f){socket[_0x06c2('0x7a')]('userChatQueue:save',{'UserId':_0x18c54f['id'],'ChatQueueId':_0x2ee3ee['id']});});});});});}})[_0x06c2('0x34')](respondWithStatusCode(_0x3aadcd,null))[_0x06c2('0x54')](handleError(_0x3aadcd,null));};exports[_0x06c2('0x7b')]=function(_0x25c4ad,_0x47f407,_0xf757af){return db[_0x06c2('0x6d')][_0x06c2('0x52')]({'where':{'id':_0x25c4ad['query'][_0x06c2('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x06c2('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x06c2('0x34')](handleEntityNotFound(_0x47f407,null))[_0x06c2('0x34')](function(_0x4930bb){var _0x27cd20=_['map'](_0x4930bb,'id');var _0x35e575=[];var _0x328cbe=[];var _0x2ecf6b=squel[_0x06c2('0x7d')]();_0x2ecf6b[_0x06c2('0x7e')](_0x06c2('0x7f'))[_0x06c2('0x80')](_0x06c2('0x81'),'tq')[_0x06c2('0x82')](_0x06c2('0x83'),'ut',_0x06c2('0x84'))[_0x06c2('0x49')](_0x06c2('0x85'),_0x25c4ad[_0x06c2('0x55')]['id']);for(var _0x2c6746=0x0;_0x2c6746<_0x4930bb[_0x06c2('0x57')];_0x2c6746+=0x1){let _0x1989ac=_0x4930bb[_0x2c6746];for(var _0x3ae042=0x0;_0x3ae042<_0x1989ac['Agents'][_0x06c2('0x57')];_0x3ae042+=0x1){let _0x377885=_0x1989ac[_0x06c2('0x71')][_0x3ae042];var _0xc753c2=_0x2ecf6b[_0x06c2('0x86')]();_0xc753c2['where'](_0x06c2('0x87'),_0x377885['id']);_0x328cbe[_0x06c2('0x88')](db['sequelize']['query'](_0xc753c2[_0x06c2('0x89')](),{'type':db['sequelize'][_0x06c2('0x8a')][_0x06c2('0x8b')]})['then'](function(_0x44ad5f){if(_0x44ad5f[_0x06c2('0x57')]===0x1){return _0x377885['id'];}else{var _0xb6f3a0=_['every'](_['map'](_0x44ad5f,'TeamId'),function(_0x9579b7){return _[_0x06c2('0x8c')](_0x27cd20,_0x9579b7);});if(_0xb6f3a0){return _0x377885['id'];}}}));}}return BPromise[_0x06c2('0x8d')](_0x328cbe)[_0x06c2('0x34')](function(_0x269f57){_0x35e575=_(_0x35e575)[_0x06c2('0x8e')](_0x269f57)['compact']()[_0x06c2('0x8f')]();return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x25c4ad[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](function(_0x509780){return db['sequelize'][_0x06c2('0x76')](function(_0xd95746){return _0x509780[_0x06c2('0x7b')](_0x25c4ad[_0x06c2('0x41')][_0x06c2('0x7c')],{'transaction':_0xd95746})['then'](function(){if(!_[_0x06c2('0x90')](_0x35e575)){return _0x509780[_0x06c2('0x91')](_0x35e575,{'transaction':_0xd95746});}})[_0x06c2('0x34')](function(){_0x35e575[_0x06c2('0x92')](function(_0x5e39e6){socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':_0x5e39e6,'ChatQueueId':_0x509780['id']});});});});});});})[_0x06c2('0x34')](respondWithStatusCode(_0x47f407,null))[_0x06c2('0x54')](handleError(_0x47f407,null));};exports['addAgents']=function(_0x2cd3c2,_0x2dd6c0,_0x957c56){return db['ChatQueue'][_0x06c2('0x58')]({'where':{'id':_0x2cd3c2[_0x06c2('0x55')]['id']}})['then'](handleEntityNotFound(_0x2dd6c0,null))['then'](function(_0x544e55){if(_0x544e55){return _0x544e55[_0x06c2('0x94')](_0x2cd3c2[_0x06c2('0x5a')][_0x06c2('0x7c')],_['omit'](_0x2cd3c2[_0x06c2('0x5a')],[_0x06c2('0x7c'),'id'])||{})[_0x06c2('0x95')](function(_0x677295){for(var _0x37906e=0x0;_0x37906e<_0x2cd3c2['body'][_0x06c2('0x7c')][_0x06c2('0x57')];_0x37906e+=0x1){socket['emit'](_0x06c2('0x96'),{'UserId':Number(_0x2cd3c2[_0x06c2('0x5a')][_0x06c2('0x7c')][_0x37906e]),'ChatQueueId':Number(_0x2cd3c2[_0x06c2('0x55')]['id'])});}return _0x677295;});}})['then'](respondWithResult(_0x2dd6c0,null))[_0x06c2('0x54')](handleError(_0x2dd6c0,null));};exports[_0x06c2('0x91')]=function(_0x20ece4,_0x1388f9,_0x13ba26){return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x20ece4[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x1388f9,null))['then'](function(_0x15d832){if(_0x15d832){return _0x15d832[_0x06c2('0x91')](_0x20ece4[_0x06c2('0x41')]['ids'])[_0x06c2('0x34')](function(){if(_['isArray'](_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')])){for(var _0x2f008a=0x0;_0x2f008a<_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')][_0x06c2('0x57')];_0x2f008a+=0x1){socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':Number(_0x20ece4[_0x06c2('0x41')]['ids'][_0x2f008a]),'ChatQueueId':Number(_0x20ece4[_0x06c2('0x55')]['id'])});}}else{socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':Number(_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')]),'ChatQueueId':Number(_0x20ece4['params']['id'])});}});}})[_0x06c2('0x34')](respondWithStatusCode(_0x1388f9,null))['catch'](handleError(_0x1388f9,null));};exports['getAgents']=function(_0x28a0dc,_0x48a717,_0x4b7fc5){var _0x19a592={};var _0x3d16a7={};var _0xde813d;var _0x392502;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x28a0dc[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x48a717,null))[_0x06c2('0x34')](function(_0x55229c){if(_0x55229c){_0xde813d=_0x55229c;_0x3d16a7[_0x06c2('0x44')]=_['keys'](db[_0x06c2('0x70')]['rawAttributes']);_0x3d16a7['query']=_[_0x06c2('0x56')](_0x28a0dc[_0x06c2('0x41')]);_0x3d16a7[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x3d16a7[_0x06c2('0x44')],_0x3d16a7[_0x06c2('0x41')]);_0x19a592[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x3d16a7[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x28a0dc['query']['fields']));_0x19a592[_0x06c2('0x43')]=_0x19a592[_0x06c2('0x43')]['length']?_0x19a592[_0x06c2('0x43')]:_0x3d16a7[_0x06c2('0x44')];_0x19a592[_0x06c2('0x47')]=qs[_0x06c2('0x48')](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x48')]);_0x19a592[_0x06c2('0x49')]=qs[_0x06c2('0x4b')](_['pick'](_0x28a0dc['query'],_0x3d16a7['filters']));if(_0x28a0dc['query'][_0x06c2('0x4c')]){_0x19a592[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0x19a592['where'],{'$or':_[_0x06c2('0x3c')](_0x19a592[_0x06c2('0x43')],function(_0x59c9bc){var _0x202801={};_0x202801[_0x59c9bc]={'$like':'%'+_0x28a0dc[_0x06c2('0x41')]['filter']+'%'};return _0x202801;})});}_0x19a592=_['merge']({},_0x19a592,_0x28a0dc[_0x06c2('0x4f')]);return _0xde813d[_0x06c2('0x97')](_0x19a592);}})[_0x06c2('0x34')](function(_0x5ced2e){if(_0x5ced2e){_0x392502=_0x5ced2e['length'];if(!_0x28a0dc['query']['hasOwnProperty'](_0x06c2('0x46'))){_0x19a592[_0x06c2('0x2c')]=qs['limit'](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x19a592[_0x06c2('0x2b')]=qs['offset'](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x2b')]);}return _0xde813d[_0x06c2('0x97')](_0x19a592);}})['then'](function(_0x44aee2){if(_0x44aee2){return _0x44aee2?{'count':_0x392502,'rows':_0x44aee2}:null;}})[_0x06c2('0x34')](respondWithResult(_0x48a717,null))[_0x06c2('0x54')](handleError(_0x48a717,null));}; \ No newline at end of file +var _0x6ddb=['options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','UserId','chatPause','rows','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','transaction','findOrCreate','emit','userChatQueue:save','field','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','compact','removeTeams','removeAgents','forEach','userChatQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','destroy','get','end','stack','send','index','map','ChatQueue','rawAttributes','key','model','name','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ddb,0x1d1));var _0xb6dd=function(_0x2f4445,_0x5ced13){_0x2f4445=_0x2f4445-0x0;var _0x570b2e=_0x6ddb[_0x2f4445];return _0x570b2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6dd('0x0'));var zipdir=require(_0xb6dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb6dd('0x3'));var sox=require('sox');var csv=require(_0xb6dd('0x4'));var ejs=require(_0xb6dd('0x5'));var fs=require('fs');var fs_extra=require(_0xb6dd('0x6'));var _=require(_0xb6dd('0x7'));var squel=require(_0xb6dd('0x8'));var crypto=require(_0xb6dd('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb6dd('0xa'));var toCsv=require(_0xb6dd('0x4'));var querystring=require(_0xb6dd('0xb'));var Papa=require('papaparse');var Redis=require(_0xb6dd('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb6dd('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6dd('0xe'));var logger=require(_0xb6dd('0xf'))('api');var utils=require(_0xb6dd('0x10'));var config=require(_0xb6dd('0x11'));var licenseUtil=require(_0xb6dd('0x12'));var db=require(_0xb6dd('0x13'))['db'];config[_0xb6dd('0x14')]=_[_0xb6dd('0x15')](config[_0xb6dd('0x14')],{'host':_0xb6dd('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6dd('0x14')]));require(_0xb6dd('0x17'))[_0xb6dd('0x18')](socket);var jayson=require(_0xb6dd('0x19'));var client=jayson['client'][_0xb6dd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x980006,_0x30de7e,_0x5ce4e4,_0xbf1fdb){return new BPromise(function(_0x519132,_0x2b9178){var _0x2adf59=_0xbf1fdb||client;return _0x2adf59[_0xb6dd('0x1b')](_0x980006,_0x5ce4e4)[_0xb6dd('0x1c')](function(_0x530d48){logger[_0xb6dd('0x1d')](_0xb6dd('0x1e'),_0x30de7e,_0xb6dd('0x1f'));logger[_0xb6dd('0x20')](_0xb6dd('0x21'),_0x30de7e,_0xb6dd('0x1f'),JSON['stringify'](_0x530d48));if(_0x530d48[_0xb6dd('0x22')]){if(_0x530d48[_0xb6dd('0x22')]['code']===0x1f4){logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x2b9178(_0x530d48['error'][_0xb6dd('0x23')]);}logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x519132(_0x530d48[_0xb6dd('0x22')][_0xb6dd('0x23')]);}else{logger[_0xb6dd('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x30de7e,_0xb6dd('0x1f'));_0x519132(_0x530d48[_0xb6dd('0x24')][_0xb6dd('0x23')]);}})[_0xb6dd('0x25')](function(_0x21da18){logger['error'](_0xb6dd('0x1e'),_0x30de7e,_0x21da18);_0x2b9178(_0x21da18);});});}function respondWithStatusCode(_0x6f4209,_0x56fd6f){_0x56fd6f=_0x56fd6f||0xcc;return function(_0x123d65){if(_0x123d65){return _0x6f4209[_0xb6dd('0x26')](_0x56fd6f);}return _0x6f4209[_0xb6dd('0x27')](_0x56fd6f)['end']();};}function respondWithResult(_0x4e8b67,_0x5dd003){_0x5dd003=_0x5dd003||0xc8;return function(_0x4e2113){if(_0x4e2113){return _0x4e8b67[_0xb6dd('0x27')](_0x5dd003)[_0xb6dd('0x28')](_0x4e2113);}};}function respondWithFilteredResult(_0x3b9548,_0x27a391){return function(_0x154f08){if(_0x154f08){var _0x2c792e=typeof _0x27a391['offset']===_0xb6dd('0x29')&&typeof _0x27a391[_0xb6dd('0x2a')]===_0xb6dd('0x29');var _0xc3dddc=_0x154f08[_0xb6dd('0x2b')];var _0x590f9=_0x2c792e?0x0:_0x27a391['offset'];var _0x48cdbc=_0x2c792e?_0x154f08['count']:_0x27a391[_0xb6dd('0x2c')]+_0x27a391['limit'];var _0x492d51;if(_0x48cdbc>=_0xc3dddc){_0x48cdbc=_0xc3dddc;_0x492d51=0xc8;}else{_0x492d51=0xce;}_0x3b9548[_0xb6dd('0x27')](_0x492d51);return _0x3b9548[_0xb6dd('0x2d')]('Content-Range',_0x590f9+'-'+_0x48cdbc+'/'+_0xc3dddc)[_0xb6dd('0x28')](_0x154f08);}return null;};}function patchUpdates(_0x2fb15f){return function(_0x16d1a4){try{jsonpatch[_0xb6dd('0x2e')](_0x16d1a4,_0x2fb15f,!![]);}catch(_0x2d5d41){return BPromise[_0xb6dd('0x2f')](_0x2d5d41);}return _0x16d1a4['save']();};}function saveUpdates(_0x54651e,_0x4d9ea1){return function(_0x455b48){if(_0x455b48){return _0x455b48['update'](_0x54651e)[_0xb6dd('0x1c')](function(_0x36452a){return _0x36452a;});}return null;};}function removeEntity(_0x3be45f,_0xdb9101){return function(_0x303670){if(_0x303670){return _0x303670[_0xb6dd('0x30')]()[_0xb6dd('0x1c')](function(){var _0x5dfb20=_0x303670[_0xb6dd('0x31')]({'plain':!![]});var _0x2a0865='ChatQueues';return db['UserProfileResource'][_0xb6dd('0x30')]({'where':{'type':_0x2a0865,'resourceId':_0x5dfb20['id']}})[_0xb6dd('0x1c')](function(){return _0x303670;});})[_0xb6dd('0x1c')](function(){_0x3be45f[_0xb6dd('0x27')](0xcc)[_0xb6dd('0x32')]();});}};}function handleEntityNotFound(_0x1ec873,_0x4d7faf){return function(_0x2ea282){if(!_0x2ea282){_0x1ec873['sendStatus'](0x194);}return _0x2ea282;};}function handleError(_0x15707f,_0x25d182){_0x25d182=_0x25d182||0x1f4;return function(_0x126fac){logger[_0xb6dd('0x22')](_0x126fac[_0xb6dd('0x33')]);if(_0x126fac['name']){delete _0x126fac['name'];}_0x15707f[_0xb6dd('0x27')](_0x25d182)[_0xb6dd('0x34')](_0x126fac);};}exports[_0xb6dd('0x35')]=function(_0x12f9f8,_0x3081b5){var _0x2c6052={},_0x44b1a3={},_0x41b267={'count':0x0,'rows':[]};var _0x3f5565=_[_0xb6dd('0x36')](db[_0xb6dd('0x37')][_0xb6dd('0x38')],function(_0x14079f){return{'name':_0x14079f['fieldName'],'type':_0x14079f['type'][_0xb6dd('0x39')]};});_0x44b1a3[_0xb6dd('0x3a')]=_['map'](_0x3f5565,_0xb6dd('0x3b'));_0x44b1a3['query']=_[_0xb6dd('0x3c')](_0x12f9f8['query']);_0x44b1a3[_0xb6dd('0x3d')]=_['intersection'](_0x44b1a3[_0xb6dd('0x3a')],_0x44b1a3[_0xb6dd('0x3e')]);_0x2c6052[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x44b1a3[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x2c6052[_0xb6dd('0x3f')]=_0x2c6052[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x2c6052[_0xb6dd('0x3f')]:_0x44b1a3[_0xb6dd('0x3a')];if(!_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x2c6052[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x2c6052[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x12f9f8[_0xb6dd('0x3e')]['offset']);}_0x2c6052['order']=qs[_0xb6dd('0x45')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x2c6052[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x12f9f8[_0xb6dd('0x3e')],_0x44b1a3['filters']),_0x3f5565);if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x2c6052[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x2c6052[_0xb6dd('0x46')],{'$or':_['map'](_0x3f5565,function(_0x2fc37f){if(_0x2fc37f[_0xb6dd('0x4a')]!=='VIRTUAL'){var _0x3eacaf={};_0x3eacaf[_0x2fc37f[_0xb6dd('0x3b')]]={'$like':'%'+_0x12f9f8['query'][_0xb6dd('0x48')]+'%'};return _0x3eacaf;}})});}_0x2c6052=_[_0xb6dd('0x49')]({},_0x2c6052,_0x12f9f8[_0xb6dd('0x4b')]);var _0x45b423={'where':_0x2c6052[_0xb6dd('0x46')]};return db[_0xb6dd('0x37')][_0xb6dd('0x2b')](_0x45b423)['then'](function(_0x1381a0){_0x41b267[_0xb6dd('0x2b')]=_0x1381a0;if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x2c6052[_0xb6dd('0x4d')]=[{'all':!![]}];}return db[_0xb6dd('0x37')][_0xb6dd('0x4e')](_0x2c6052);})[_0xb6dd('0x1c')](function(_0x1cbe17){_0x41b267['rows']=_0x1cbe17;return _0x41b267;})['then'](respondWithFilteredResult(_0x3081b5,_0x2c6052))['catch'](handleError(_0x3081b5,null));};exports[_0xb6dd('0x4f')]=function(_0x42cfe6,_0x311964){var _0x5cb8dd={'raw':!![],'where':{'id':_0x42cfe6[_0xb6dd('0x50')]['id']}},_0x331319={};_0x331319['model']=_['keys'](db['ChatQueue'][_0xb6dd('0x38')]);_0x331319[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x42cfe6[_0xb6dd('0x3e')]);_0x331319[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],_0x331319[_0xb6dd('0x3e')]);_0x5cb8dd[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x42cfe6[_0xb6dd('0x3e')]['fields']));_0x5cb8dd[_0xb6dd('0x3f')]=_0x5cb8dd[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x5cb8dd['attributes']:_0x331319[_0xb6dd('0x3a')];if(_0x42cfe6[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x5cb8dd[_0xb6dd('0x4d')]=[{'all':!![]}];}_0x5cb8dd=_[_0xb6dd('0x49')]({},_0x5cb8dd,_0x42cfe6['options']);return db[_0xb6dd('0x37')][_0xb6dd('0x51')](_0x5cb8dd)[_0xb6dd('0x1c')](handleEntityNotFound(_0x311964,null))[_0xb6dd('0x1c')](respondWithResult(_0x311964,null))[_0xb6dd('0x25')](handleError(_0x311964,null));};exports['create']=function(_0x3a8cec,_0x3a74d4){return db['ChatQueue'][_0xb6dd('0x52')](_0x3a8cec[_0xb6dd('0x53')],{})['then'](function(_0x4e0bb7){var _0x13bb69=_0x3a8cec[_0xb6dd('0x54')][_0xb6dd('0x31')]({'plain':!![]});if(!_0x13bb69)throw new Error(_0xb6dd('0x55'));if(_0x13bb69[_0xb6dd('0x56')]===_0xb6dd('0x54')){var _0x15e262=_0x4e0bb7['get']({'plain':!![]});var _0xbc31a6=_0xb6dd('0x57');return db[_0xb6dd('0x58')][_0xb6dd('0x51')]({'where':{'name':_0xbc31a6,'userProfileId':_0x13bb69[_0xb6dd('0x59')]},'raw':!![]})[_0xb6dd('0x1c')](function(_0x5a5ef9){if(_0x5a5ef9&&_0x5a5ef9[_0xb6dd('0x5a')]===0x0){return db[_0xb6dd('0x5b')][_0xb6dd('0x52')]({'name':_0x15e262[_0xb6dd('0x3b')],'resourceId':_0x15e262['id'],'type':_0x5a5ef9['name'],'sectionId':_0x5a5ef9['id']},{})[_0xb6dd('0x1c')](function(){return _0x4e0bb7;});}else{return _0x4e0bb7;}})[_0xb6dd('0x25')](function(_0x5af82d){logger['error'](_0xb6dd('0x5c'),_0x5af82d);throw _0x5af82d;});}return _0x4e0bb7;})['then'](respondWithResult(_0x3a74d4,0xc9))[_0xb6dd('0x25')](handleError(_0x3a74d4,null));};exports['update']=function(_0x11b558,_0x31476b){if(_0x11b558[_0xb6dd('0x53')]['id']){delete _0x11b558[_0xb6dd('0x53')]['id'];}return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x11b558[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x31476b,null))['then'](saveUpdates(_0x11b558[_0xb6dd('0x53')],null))[_0xb6dd('0x1c')](respondWithResult(_0x31476b,null))[_0xb6dd('0x25')](handleError(_0x31476b,null));};exports[_0xb6dd('0x30')]=function(_0xdde89c,_0xec0e54){return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0xdde89c[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0xec0e54,null))[_0xb6dd('0x1c')](removeEntity(_0xec0e54,null))[_0xb6dd('0x25')](handleError(_0xec0e54,null));};exports[_0xb6dd('0x5d')]=function(_0x40008a,_0x2b0caa){return db[_0xb6dd('0x37')]['describe']()[_0xb6dd('0x1c')](respondWithResult(_0x2b0caa,null))[_0xb6dd('0x25')](handleError(_0x2b0caa,null));};exports[_0xb6dd('0x5e')]=function(_0x913d32,_0x2dc156,_0x14cb41){var _0x37da2c={'raw':!![],'where':{}},_0x35afef={},_0xb512b9;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x913d32[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x2dc156,null))[_0xb6dd('0x1c')](function(_0x3fb06f){if(_0x3fb06f){_0xb512b9=_0x3fb06f[_0xb6dd('0x31')]({'plain':!![]});_0x35afef['model']=_[_0xb6dd('0x3c')](db[_0xb6dd('0x60')][_0xb6dd('0x38')]);_0x35afef[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x913d32[_0xb6dd('0x3e')]);_0x35afef['filters']=_[_0xb6dd('0x40')](_0x35afef[_0xb6dd('0x3a')],_0x35afef[_0xb6dd('0x3e')]);_0x37da2c[_0xb6dd('0x3f')]=_['intersection'](_0x35afef[_0xb6dd('0x3a')],qs['fields'](_0x913d32[_0xb6dd('0x3e')]['fields']));_0x37da2c[_0xb6dd('0x3f')]=_0x37da2c['attributes'][_0xb6dd('0x42')]?_0x37da2c['attributes']:_0x35afef['model'];if(!_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x37da2c[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x37da2c[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}_0x37da2c[_0xb6dd('0x61')]=qs[_0xb6dd('0x45')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x37da2c[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x913d32['query'],_0x35afef['filters']));_0x37da2c[_0xb6dd('0x46')][_0xb6dd('0x62')]=_0x3fb06f['id'];if(_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x37da2c[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x37da2c['where'],{'$or':_[_0xb6dd('0x36')](_0x37da2c['attributes'],function(_0x59af98){var _0x34ef6e={};_0x34ef6e[_0x59af98]={'$like':'%'+_0x913d32['query'][_0xb6dd('0x48')]+'%'};return _0x34ef6e;})});}_0x37da2c=_[_0xb6dd('0x49')]({},_0x37da2c,_0x913d32[_0xb6dd('0x4b')]);return db[_0xb6dd('0x60')][_0xb6dd('0x4e')](_0x37da2c);}})[_0xb6dd('0x1c')](function(_0x3293d5){if(_0x3293d5){return db[_0xb6dd('0x63')]['findAndCountAll']({'where':{'id':_[_0xb6dd('0x36')](_0x3293d5,_0xb6dd('0x64')),'role':'agent'},'attributes':['id','name',_0xb6dd('0x65'),'updatedAt','createdAt']});}})[_0xb6dd('0x1c')](function(_0x1ab21c){if(_0x1ab21c){return{'count':_0x1ab21c[_0xb6dd('0x2b')],'rows':_[_0xb6dd('0x36')](_0x1ab21c[_0xb6dd('0x66')],function(_0x391bc0){return{'membername':_0x391bc0[_0xb6dd('0x3b')],'UserId':_0x391bc0['id'],'queue_name':_0xb512b9[_0xb6dd('0x3b')],'ChatQueueId':_0xb512b9['id'],'interface':util['format'](_0xb6dd('0x67'),_0xb6dd('0x68'),_0x391bc0['name']),'penalty':0x0,'paused':_0x391bc0[_0xb6dd('0x65')],'createdAt':_0x391bc0['createdAt'],'updatedAt':_0x391bc0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb6dd('0x1c')](respondWithFilteredResult(_0x2dc156,_0x37da2c))[_0xb6dd('0x25')](handleError(_0x2dc156,null));};exports[_0xb6dd('0x69')]=function(_0xd5d37a,_0x58d620,_0x5c098a){var _0x50221d={};var _0x56306b={};var _0x50d296;var _0x5f4d0b;return db[_0xb6dd('0x37')]['findOne']({'where':{'id':_0xd5d37a[_0xb6dd('0x50')]['id']}})['then'](handleEntityNotFound(_0x58d620,null))[_0xb6dd('0x1c')](function(_0x4be74a){if(_0x4be74a){_0x50d296=_0x4be74a;_0x56306b[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db['Team'][_0xb6dd('0x38')]);_0x56306b['query']=_[_0xb6dd('0x3c')](_0xd5d37a[_0xb6dd('0x3e')]);_0x56306b[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x56306b[_0xb6dd('0x3a')],_0x56306b[_0xb6dd('0x3e')]);_0x50221d[_0xb6dd('0x3f')]=_['intersection'](_0x56306b[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x50221d[_0xb6dd('0x3f')]=_0x50221d[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x50221d['attributes']:_0x56306b[_0xb6dd('0x3a')];_0x50221d['order']=qs[_0xb6dd('0x45')](_0xd5d37a[_0xb6dd('0x3e')]['sort']);_0x50221d[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0xd5d37a[_0xb6dd('0x3e')],_0x56306b['filters']));if(_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x50221d[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x50221d['where'],{'$or':_[_0xb6dd('0x36')](_0x50221d[_0xb6dd('0x3f')],function(_0x39489b){var _0x1ad1c6={};_0x1ad1c6[_0x39489b]={'$like':'%'+_0xd5d37a[_0xb6dd('0x3e')]['filter']+'%'};return _0x1ad1c6;})});}_0x50221d=_[_0xb6dd('0x49')]({},_0x50221d,_0xd5d37a[_0xb6dd('0x4b')]);return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x23358c){if(_0x23358c){_0x5f4d0b=_0x23358c['length'];if(!_0xd5d37a['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x50221d[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x50221d[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x46c12a){if(_0x46c12a){return _0x46c12a?{'count':_0x5f4d0b,'rows':_0x46c12a}:null;}})['then'](respondWithResult(_0x58d620,null))['catch'](handleError(_0x58d620,null));};exports[_0xb6dd('0x6a')]=function(_0x460028,_0x1fafe9,_0x20ad37){var _0x3ad4fc=_0x460028[_0xb6dd('0x53')][_0xb6dd('0x6b')];return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x3ad4fc},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':_0xb6dd('0x6d'),'attributes':['id',_0xb6dd('0x3b'),'online',_0xb6dd('0x6e'),_0xb6dd('0x6f')],'raw':!![]}]})[_0xb6dd('0x1c')](function(_0x515f90){if(_0x515f90){var _0xd0d196=_['flatMap'](_0x515f90,function(_0x23f927){var _0x45d812=_0x23f927[_0xb6dd('0x31')]({'plain':!![]});return _0x45d812[_0xb6dd('0x6d')];});return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x460028[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](function(_0x10c044){return db[_0xb6dd('0x70')][_0xb6dd('0x71')](function(_0xbe871a){return _0x10c044[_0xb6dd('0x6a')](_0x3ad4fc,{'transaction':_0xbe871a})['then'](function(){return BPromise['each'](_0xd0d196,function(_0x14ec80){return db[_0xb6dd('0x60')][_0xb6dd('0x72')]({'where':{'UserId':_0x14ec80['id'],'ChatQueueId':_0x460028['params']['id']},'transaction':_0xbe871a});});})[_0xb6dd('0x1c')](function(){_0xd0d196['forEach'](function(_0x5156de){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':_0x5156de['id'],'ChatQueueId':_0x10c044['id']});});});});});}})['then'](respondWithStatusCode(_0x1fafe9,null))[_0xb6dd('0x25')](handleError(_0x1fafe9,null));};exports['removeTeams']=function(_0x21b78c,_0x46c7e2,_0x1d2be9){return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x21b78c[_0xb6dd('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46c7e2,null))['then'](function(_0x1006e1){var _0x310222=_[_0xb6dd('0x36')](_0x1006e1,'id');var _0x1dabba=[];var _0xcd75d7=[];var _0x1c92ec=squel['select']();_0x1c92ec[_0xb6dd('0x75')](_0xb6dd('0x76'))['from']('team_has_chat_queues','tq')[_0xb6dd('0x77')](_0xb6dd('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb6dd('0x46')](_0xb6dd('0x79'),_0x21b78c[_0xb6dd('0x50')]['id']);for(var _0x35d5f7=0x0;_0x35d5f7<_0x1006e1[_0xb6dd('0x42')];_0x35d5f7+=0x1){let _0x4f9a7=_0x1006e1[_0x35d5f7];for(var _0x2dc497=0x0;_0x2dc497<_0x4f9a7['Agents'][_0xb6dd('0x42')];_0x2dc497+=0x1){let _0x4d2909=_0x4f9a7[_0xb6dd('0x6d')][_0x2dc497];var _0x41cee7=_0x1c92ec['clone']();_0x41cee7[_0xb6dd('0x46')](_0xb6dd('0x7a'),_0x4d2909['id']);_0xcd75d7[_0xb6dd('0x7b')](db['sequelize']['query'](_0x41cee7['toString'](),{'type':db[_0xb6dd('0x70')][_0xb6dd('0x7c')]['SELECT']})[_0xb6dd('0x1c')](function(_0x39c09b){if(_0x39c09b[_0xb6dd('0x42')]===0x1){return _0x4d2909['id'];}else{var _0x33b2e4=_['every'](_[_0xb6dd('0x36')](_0x39c09b,_0xb6dd('0x7d')),function(_0x4419f0){return _[_0xb6dd('0x7e')](_0x310222,_0x4419f0);});if(_0x33b2e4){return _0x4d2909['id'];}}}));}}return BPromise['all'](_0xcd75d7)['then'](function(_0x4871b9){_0x1dabba=_(_0x1dabba)['union'](_0x4871b9)[_0xb6dd('0x7f')]()['value']();return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x21b78c['params']['id']}})[_0xb6dd('0x1c')](function(_0x3fd1c5){return db['sequelize'][_0xb6dd('0x71')](function(_0x1d61b6){return _0x3fd1c5[_0xb6dd('0x80')](_0x21b78c[_0xb6dd('0x3e')][_0xb6dd('0x6b')],{'transaction':_0x1d61b6})['then'](function(){if(!_['isEmpty'](_0x1dabba)){return _0x3fd1c5[_0xb6dd('0x81')](_0x1dabba,{'transaction':_0x1d61b6});}})['then'](function(){_0x1dabba[_0xb6dd('0x82')](function(_0x26cd8d){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':_0x26cd8d,'ChatQueueId':_0x3fd1c5['id']});});});});});});})[_0xb6dd('0x1c')](respondWithStatusCode(_0x46c7e2,null))[_0xb6dd('0x25')](handleError(_0x46c7e2,null));};exports[_0xb6dd('0x84')]=function(_0x993cbd,_0x52688a,_0x540f73){return db[_0xb6dd('0x37')]['find']({'where':{'id':_0x993cbd[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x52688a,null))['then'](function(_0x42b31e){if(_0x42b31e){return _0x42b31e[_0xb6dd('0x84')](_0x993cbd[_0xb6dd('0x53')]['ids'],_['omit'](_0x993cbd[_0xb6dd('0x53')],[_0xb6dd('0x6b'),'id'])||{})[_0xb6dd('0x85')](function(_0xfbfc6d){for(var _0x197c8c=0x0;_0x197c8c<_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x197c8c+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':Number(_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0x197c8c]),'ChatQueueId':Number(_0x993cbd[_0xb6dd('0x50')]['id'])});}return _0xfbfc6d;});}})[_0xb6dd('0x1c')](respondWithResult(_0x52688a,null))[_0xb6dd('0x25')](handleError(_0x52688a,null));};exports[_0xb6dd('0x81')]=function(_0x1a0309,_0x230619,_0x3ea4e3){return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x1a0309[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x230619,null))[_0xb6dd('0x1c')](function(_0x375f4d){if(_0x375f4d){return _0x375f4d[_0xb6dd('0x81')](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])[_0xb6dd('0x1c')](function(){if(_['isArray'](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])){for(var _0x3dd365=0x0;_0x3dd365<_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x3dd365+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309['query']['ids'][_0x3dd365]),'ChatQueueId':Number(_0x1a0309['params']['id'])});}}else{socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')]),'ChatQueueId':Number(_0x1a0309[_0xb6dd('0x50')]['id'])});}});}})[_0xb6dd('0x1c')](respondWithStatusCode(_0x230619,null))[_0xb6dd('0x25')](handleError(_0x230619,null));};exports[_0xb6dd('0x86')]=function(_0x6a6cb3,_0x39185d,_0x439247){var _0x3343cb={};var _0x3345f5={};var _0x49f929;var _0x38816f;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x6a6cb3[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x39185d,null))[_0xb6dd('0x1c')](function(_0x5ced20){if(_0x5ced20){_0x49f929=_0x5ced20;_0x3345f5[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db[_0xb6dd('0x63')][_0xb6dd('0x38')]);_0x3345f5[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x6a6cb3[_0xb6dd('0x3e')]);_0x3345f5[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x3345f5[_0xb6dd('0x3a')],_0x3345f5['query']);_0x3343cb[_0xb6dd('0x3f')]=_['intersection'](_0x3345f5[_0xb6dd('0x3a')],qs['fields'](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x3343cb[_0xb6dd('0x3f')]=_0x3343cb['attributes'][_0xb6dd('0x42')]?_0x3343cb[_0xb6dd('0x3f')]:_0x3345f5[_0xb6dd('0x3a')];_0x3343cb['order']=qs[_0xb6dd('0x45')](_0x6a6cb3[_0xb6dd('0x3e')]['sort']);_0x3343cb['where']=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x6a6cb3['query'],_0x3345f5['filters']));if(_0x6a6cb3[_0xb6dd('0x3e')]['filter']){_0x3343cb[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x3343cb['where'],{'$or':_[_0xb6dd('0x36')](_0x3343cb[_0xb6dd('0x3f')],function(_0x35b745){var _0x254592={};_0x254592[_0x35b745]={'$like':'%'+_0x6a6cb3['query'][_0xb6dd('0x48')]+'%'};return _0x254592;})});}_0x3343cb=_['merge']({},_0x3343cb,_0x6a6cb3[_0xb6dd('0x4b')]);return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})['then'](function(_0x5bd415){if(_0x5bd415){_0x38816f=_0x5bd415[_0xb6dd('0x42')];if(!_0x6a6cb3['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x3343cb[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x6a6cb3['query'][_0xb6dd('0x2a')]);_0x3343cb[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})[_0xb6dd('0x1c')](function(_0x3764ac){if(_0x3764ac){return _0x3764ac?{'count':_0x38816f,'rows':_0x3764ac}:null;}})[_0xb6dd('0x1c')](respondWithResult(_0x39185d,null))[_0xb6dd('0x25')](handleError(_0x39185d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 55bbd1c..e35ff64 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 _0x049e=['hasOwnProperty','hook','events','setMaxListeners','save','remove','emit'];(function(_0x3dd8cf,_0x1e1219){var _0x13a125=function(_0x544297){while(--_0x544297){_0x3dd8cf['push'](_0x3dd8cf['shift']());}};_0x13a125(++_0x1e1219);}(_0x049e,0x72));var _0xe049=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x049e[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0xe049('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe049('0x1')](0x0);var events={'afterCreate':_0xe049('0x2'),'afterUpdate':'update','afterDestroy':_0xe049('0x3')};function emitEvent(_0x22c752){return function(_0x14fa69,_0x23a950,_0x1379cb){ChatQueueEvents[_0xe049('0x4')](_0x22c752+':'+_0x14fa69['id'],_0x14fa69);ChatQueueEvents[_0xe049('0x4')](_0x22c752,_0x14fa69);_0x1379cb(null);};}for(var e in events){if(events[_0xe049('0x5')](e)){var event=events[e];ChatQueue[_0xe049('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xa31c=['update','remove','emit','hook','exports','../../mysqldb','save'];(function(_0x50bffc,_0x8eb3ac){var _0x36747b=function(_0x283736){while(--_0x283736){_0x50bffc['push'](_0x50bffc['shift']());}};_0x36747b(++_0x8eb3ac);}(_0xa31c,0x11d));var _0xca31=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0xa31c[_0x219fa0];return _0xc603fb;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xca31('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca31('0x1'),'afterUpdate':_0xca31('0x2'),'afterDestroy':_0xca31('0x3')};function emitEvent(_0x234c47){return function(_0x95fe68,_0x36282a,_0x21cb6a){ChatQueueEvents[_0xca31('0x4')](_0x234c47+':'+_0x95fe68['id'],_0x95fe68);ChatQueueEvents[_0xca31('0x4')](_0x234c47,_0x95fe68);_0x21cb6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xca31('0x5')](e,emitEvent(event));}}module[_0xca31('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 9c198e8..7485c01 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 _0xcf0f=['api','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x4b4027,_0x282103){var _0x1544c7=function(_0x556639){while(--_0x556639){_0x4b4027['push'](_0x4b4027['shift']());}};_0x1544c7(++_0x282103);}(_0xcf0f,0x99));var _0xfcf0=function(_0x44f9a5,_0x5952a1){_0x44f9a5=_0x44f9a5-0x0;var _0x41ca9a=_0xcf0f[_0x44f9a5];return _0x41ca9a;};'use strict';var _=require(_0xfcf0('0x0'));var util=require(_0xfcf0('0x1'));var logger=require(_0xfcf0('0x2'))(_0xfcf0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcf0('0x4'));var fs=require('fs');var path=require(_0xfcf0('0x5'));var rimraf=require(_0xfcf0('0x6'));var config=require(_0xfcf0('0x7'));var attributes=require(_0xfcf0('0x8'));module[_0xfcf0('0x9')]=function(_0x684f86,_0x3c3fb6){return _0x684f86[_0xfcf0('0xa')](_0xfcf0('0xb'),attributes,{'tableName':_0xfcf0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ecb=['./chatQueue.attributes','exports','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x224523,_0x4a351a){var _0x4a1a35=function(_0x342cd1){while(--_0x342cd1){_0x224523['push'](_0x224523['shift']());}};_0x4a1a35(++_0x4a351a);}(_0x5ecb,0x87));var _0xb5ec=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x5ecb[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xb5ec('0x0'));var util=require(_0xb5ec('0x1'));var logger=require(_0xb5ec('0x2'))(_0xb5ec('0x3'));var moment=require(_0xb5ec('0x4'));var BPromise=require(_0xb5ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ec('0x6'));var rimraf=require(_0xb5ec('0x7'));var config=require(_0xb5ec('0x8'));var attributes=require(_0xb5ec('0x9'));module[_0xb5ec('0xa')]=function(_0x165383,_0x5a706e){return _0x165383['define'](_0xb5ec('0xb'),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 a612b96..fe292b9 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 _0xa81d=['include','map','model','GetChatQueue','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes'];(function(_0xf8c877,_0x149b7c){var _0x31c063=function(_0x5e089f){while(--_0x5e089f){_0xf8c877['push'](_0xf8c877['shift']());}};_0x31c063(++_0x149b7c);}(_0xa81d,0x11e));var _0xda81=function(_0x382f44,_0x3a1b12){_0x382f44=_0x382f44-0x0;var _0x2fe454=_0xa81d[_0x382f44];return _0x2fe454;};'use strict';var _=require(_0xda81('0x0'));var util=require(_0xda81('0x1'));var moment=require('moment');var BPromise=require(_0xda81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda81('0x3'));var db=require(_0xda81('0x4'))['db'];var utils=require(_0xda81('0x5'));var logger=require(_0xda81('0x6'))(_0xda81('0x7'));var config=require(_0xda81('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda81('0x9')]({'port':0x232a});config['redis']=_[_0xda81('0xa')](config[_0xda81('0xb')],{'host':_0xda81('0xc'),'port':0x18eb});var socket=require(_0xda81('0xd'))(new Redis(config[_0xda81('0xb')]));require(_0xda81('0xe'))['register'](socket);function respondWithRpcPromise(_0x4db7f3,_0xd1bd2a,_0x5af9c5){return new BPromise(function(_0xb545b5,_0x21afe9){return client[_0xda81('0xf')](_0x4db7f3,_0x5af9c5)[_0xda81('0x10')](function(_0x420c67){logger[_0xda81('0x11')](_0xda81('0x12'),_0xd1bd2a,_0xda81('0x13'));logger[_0xda81('0x14')](_0xda81('0x15'),_0xd1bd2a,'request\x20sent',JSON[_0xda81('0x16')](_0x420c67));if(_0x420c67[_0xda81('0x17')]){if(_0x420c67['error'][_0xda81('0x18')]===0x1f4){logger['error'](_0xda81('0x12'),_0xd1bd2a,_0x420c67['error'][_0xda81('0x19')]);return _0x21afe9(_0x420c67[_0xda81('0x17')][_0xda81('0x19')]);}logger[_0xda81('0x17')](_0xda81('0x12'),_0xd1bd2a,_0x420c67[_0xda81('0x17')]['message']);return _0xb545b5(_0x420c67[_0xda81('0x17')][_0xda81('0x19')]);}else{logger[_0xda81('0x11')](_0xda81('0x12'),_0xd1bd2a,_0xda81('0x13'));_0xb545b5(_0x420c67[_0xda81('0x1a')][_0xda81('0x19')]);}})[_0xda81('0x1b')](function(_0x415465){logger[_0xda81('0x17')](_0xda81('0x12'),_0xd1bd2a,_0x415465);_0x21afe9(_0x415465);});});}exports['GetChatQueue']=function(_0x186539){var _0x50b080=this;return new Promise(function(_0x291b6d,_0x2353bd){return db[_0xda81('0x1c')][_0xda81('0x1d')]({'raw':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x1f')]===undefined?!![]:![]:!![],'where':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x20')]||null:null,'attributes':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x21')]||null:null,'limit':_0x186539[_0xda81('0x1e')]?_0x186539['options']['limit']||null:null,'include':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x22')]?_[_0xda81('0x23')](_0x186539[_0xda81('0x1e')]['include'],function(_0x2caa71){return{'model':db[_0x2caa71[_0xda81('0x24')]],'as':_0x2caa71['as'],'attributes':_0x2caa71[_0xda81('0x21')],'include':_0x2caa71[_0xda81('0x22')]?_[_0xda81('0x23')](_0x2caa71[_0xda81('0x22')],function(_0x3e8a14){return{'model':db[_0x3e8a14[_0xda81('0x24')]],'as':_0x3e8a14['as'],'attributes':_0x3e8a14[_0xda81('0x21')],'include':_0x3e8a14[_0xda81('0x22')]?_[_0xda81('0x23')](_0x3e8a14['include'],function(_0x3948af){return{'model':db[_0x3948af[_0xda81('0x24')]],'as':_0x3948af['as'],'attributes':_0x3948af[_0xda81('0x21')]};}):[]};}):[]};}):[]:[]})[_0xda81('0x10')](function(_0x3d2e9b){logger[_0xda81('0x11')](_0xda81('0x25'),_0x186539);logger[_0xda81('0x14')](_0xda81('0x25'),_0x186539,JSON[_0xda81('0x16')](_0x3d2e9b));_0x291b6d(_0x3d2e9b);})[_0xda81('0x1b')](function(_0x3337f6){logger[_0xda81('0x17')](_0xda81('0x25'),_0x3337f6['message'],_0x186539);_0x2353bd(_0x50b080[_0xda81('0x17')](0x1f4,_0x3337f6[_0xda81('0x19')]));});});};exports[_0xda81('0x26')]=function(_0x5d939b){var _0x39d43f=this;return new Promise(function(_0x23edc3,_0x3d656c){return db[_0xda81('0x1c')][_0xda81('0x27')]({'raw':_0x5d939b[_0xda81('0x1e')]?_0x5d939b[_0xda81('0x1e')][_0xda81('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d939b['options']?_0x5d939b[_0xda81('0x1e')][_0xda81('0x20')]||null:null,'attributes':_0x5d939b['options']?_0x5d939b['options'][_0xda81('0x21')]||null:null,'include':_0x5d939b['options']?_0x5d939b[_0xda81('0x1e')][_0xda81('0x22')]?_[_0xda81('0x23')](_0x5d939b[_0xda81('0x1e')][_0xda81('0x22')],function(_0x58d4e3){return{'model':db[_0x58d4e3[_0xda81('0x24')]],'as':_0x58d4e3['as'],'attributes':_0x58d4e3[_0xda81('0x21')],'include':_0x58d4e3['include']?_['map'](_0x58d4e3[_0xda81('0x22')],function(_0x46b8b3){return{'model':db[_0x46b8b3[_0xda81('0x24')]],'as':_0x46b8b3['as'],'attributes':_0x46b8b3[_0xda81('0x21')],'include':_0x46b8b3[_0xda81('0x22')]?_[_0xda81('0x23')](_0x46b8b3['include'],function(_0x5acdeb){return{'model':db[_0x5acdeb[_0xda81('0x24')]],'as':_0x5acdeb['as'],'attributes':_0x5acdeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xda81('0x10')](function(_0x3c8648){logger['info'](_0xda81('0x26'),_0x5d939b);logger['debug'](_0xda81('0x26'),_0x5d939b,JSON[_0xda81('0x16')](_0x3c8648));_0x23edc3(_0x3c8648);})[_0xda81('0x1b')](function(_0x1b9090){logger[_0xda81('0x17')](_0xda81('0x26'),_0x1b9090['message'],_0x5d939b);_0x3d656c(_0x39d43f[_0xda81('0x17')](0x1f4,_0x1b9090[_0xda81('0x19')]));});});}; \ No newline at end of file +var _0x71af=['attributes','GetChatQueue','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','include','map','model'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0x71af,0x194));var _0xf71a=function(_0x1cb354,_0x5f057d){_0x1cb354=_0x1cb354-0x0;var _0x4f9b3c=_0x71af[_0x1cb354];return _0x4f9b3c;};'use strict';var _=require(_0xf71a('0x0'));var util=require(_0xf71a('0x1'));var moment=require('moment');var BPromise=require(_0xf71a('0x2'));var rs=require(_0xf71a('0x3'));var fs=require('fs');var Redis=require(_0xf71a('0x4'));var db=require(_0xf71a('0x5'))['db'];var utils=require(_0xf71a('0x6'));var logger=require(_0xf71a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf71a('0x8'));var client=jayson[_0xf71a('0x9')][_0xf71a('0xa')]({'port':0x232a});config[_0xf71a('0xb')]=_[_0xf71a('0xc')](config[_0xf71a('0xb')],{'host':_0xf71a('0xd'),'port':0x18eb});var socket=require(_0xf71a('0xe'))(new Redis(config[_0xf71a('0xb')]));require(_0xf71a('0xf'))['register'](socket);function respondWithRpcPromise(_0x318a72,_0xbac86d,_0x53869b){return new BPromise(function(_0x331793,_0x42802f){return client[_0xf71a('0x10')](_0x318a72,_0x53869b)[_0xf71a('0x11')](function(_0x1d9575){logger['info'](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));logger[_0xf71a('0x14')](_0xf71a('0x15'),_0xbac86d,_0xf71a('0x13'),JSON[_0xf71a('0x16')](_0x1d9575));if(_0x1d9575[_0xf71a('0x17')]){if(_0x1d9575[_0xf71a('0x17')][_0xf71a('0x18')]===0x1f4){logger['error'](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x42802f(_0x1d9575[_0xf71a('0x17')]['message']);}logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x331793(_0x1d9575['error'][_0xf71a('0x19')]);}else{logger[_0xf71a('0x1a')](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));_0x331793(_0x1d9575['result'][_0xf71a('0x19')]);}})[_0xf71a('0x1b')](function(_0x3e61a9){logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x3e61a9);_0x42802f(_0x3e61a9);});});}exports['GetChatQueue']=function(_0x189e22){var _0x566b6d=this;return new Promise(function(_0x51ecda,_0x40d8ac){return db[_0xf71a('0x1c')][_0xf71a('0x1d')]({'raw':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x189e22['options']?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')]['attributes']||null:null,'limit':_0x189e22[_0xf71a('0x1e')]?_0x189e22['options']['limit']||null:null,'include':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x189e22[_0xf71a('0x1e')]['include'],function(_0x596a8a){return{'model':db[_0x596a8a[_0xf71a('0x23')]],'as':_0x596a8a['as'],'attributes':_0x596a8a[_0xf71a('0x24')],'include':_0x596a8a[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x596a8a[_0xf71a('0x21')],function(_0x1351a6){return{'model':db[_0x1351a6[_0xf71a('0x23')]],'as':_0x1351a6['as'],'attributes':_0x1351a6[_0xf71a('0x24')],'include':_0x1351a6[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x1351a6[_0xf71a('0x21')],function(_0x17980a){return{'model':db[_0x17980a['model']],'as':_0x17980a['as'],'attributes':_0x17980a[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x41cdef){logger[_0xf71a('0x1a')]('GetChatQueue',_0x189e22);logger['debug']('GetChatQueue',_0x189e22,JSON['stringify'](_0x41cdef));_0x51ecda(_0x41cdef);})[_0xf71a('0x1b')](function(_0x2836a6){logger[_0xf71a('0x17')](_0xf71a('0x25'),_0x2836a6[_0xf71a('0x19')],_0x189e22);_0x40d8ac(_0x566b6d[_0xf71a('0x17')](0x1f4,_0x2836a6[_0xf71a('0x19')]));});});};exports[_0xf71a('0x26')]=function(_0x5841ea){var _0x470eeb=this;return new Promise(function(_0x213b36,_0x38fde9){return db[_0xf71a('0x1c')][_0xf71a('0x27')]({'raw':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x24')]||null:null,'include':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')],function(_0xbb7507){return{'model':db[_0xbb7507['model']],'as':_0xbb7507['as'],'attributes':_0xbb7507['attributes'],'include':_0xbb7507[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0xbb7507[_0xf71a('0x21')],function(_0x4d4188){return{'model':db[_0x4d4188[_0xf71a('0x23')]],'as':_0x4d4188['as'],'attributes':_0x4d4188['attributes'],'include':_0x4d4188[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x4d4188[_0xf71a('0x21')],function(_0x1073ca){return{'model':db[_0x1073ca['model']],'as':_0x1073ca['as'],'attributes':_0x1073ca[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x591347){logger[_0xf71a('0x1a')]('ShowChatQueue',_0x5841ea);logger[_0xf71a('0x14')](_0xf71a('0x26'),_0x5841ea,JSON[_0xf71a('0x16')](_0x591347));_0x213b36(_0x591347);})[_0xf71a('0x1b')](function(_0x352336){logger[_0xf71a('0x17')]('ShowChatQueue',_0x352336[_0xf71a('0x19')],_0x5841ea);_0x38fde9(_0x470eeb[_0xf71a('0x17')](0x1f4,_0x352336['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3aa7c0c..c89a189 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x72b1,0x16e));var _0x172b=function(_0x29fe42,_0x5d2482){_0x29fe42=_0x29fe42-0x0;var _0xd286f7=_0x72b1[_0x29fe42];return _0xd286f7;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}}; \ No newline at end of file +var _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x2252dd,_0x170894){var _0x30244f=function(_0x4c20bc){while(--_0x4c20bc){_0x2252dd['push'](_0x2252dd['shift']());}};_0x30244f(++_0x170894);}(_0x8ce3,0xc3));var _0x38ce=function(_0xc84cea,_0x7058f1){_0xc84cea=_0xc84cea-0x0;var _0x572c6c=_0x8ce3[_0xc84cea];return _0x572c6c;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5323254..37f2657 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f4157,_0x27aa4c){var _0x23a1b1=function(_0x24212f){while(--_0x24212f){_0x4f4157['push'](_0x4f4157['shift']());}};_0x23a1b1(++_0x27aa4c);}(_0x55ca,0x126));var _0xa55c=function(_0x50ce0c,_0x541b68){_0x50ce0c=_0x50ce0c-0x0;var _0x3c988c=_0x55ca[_0x50ce0c];return _0x3c988c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x221b5d,_0x3705c7){_0x221b5d=_0x221b5d-0x0;var _0x3b970a=_0x3e74[_0x221b5d];return _0x3b970a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index a32b919..39cc382 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 _0x37b4=['moment','sequelize','exports','STRING','DATE'];(function(_0x5af32b,_0x518fde){var _0x4e59b1=function(_0x3c5d2a){while(--_0x3c5d2a){_0x5af32b['push'](_0x5af32b['shift']());}};_0x4e59b1(++_0x518fde);}(_0x37b4,0x16d));var _0x437b=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x37b4[_0x319a03];return _0x3b6704;};'use strict';var moment=require(_0x437b('0x0'));var Sequelize=require(_0x437b('0x1'));module[_0x437b('0x2')]={'uniqueid':{'type':Sequelize[_0x437b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x437b('0x3')]},'joinAt':{'type':Sequelize[_0x437b('0x4')]},'leaveAt':{'type':Sequelize[_0x437b('0x4')]},'acceptAt':{'type':Sequelize[_0x437b('0x4')]},'exitAt':{'type':Sequelize[_0x437b('0x4')]},'reason':{'type':Sequelize[_0x437b('0x3')]}}; \ No newline at end of file +var _0x75e2=['moment','exports','STRING','DATE'];(function(_0x43f707,_0x5b4f4e){var _0x364654=function(_0xc8e531){while(--_0xc8e531){_0x43f707['push'](_0x43f707['shift']());}};_0x364654(++_0x5b4f4e);}(_0x75e2,0x16c));var _0x275e=function(_0x497d6d,_0xff7558){_0x497d6d=_0x497d6d-0x0;var _0x4a1d9a=_0x75e2[_0x497d6d];return _0x4a1d9a;};'use strict';var moment=require(_0x275e('0x0'));var Sequelize=require('sequelize');module[_0x275e('0x1')]={'uniqueid':{'type':Sequelize[_0x275e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x275e('0x2')]},'joinAt':{'type':Sequelize[_0x275e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x275e('0x3')]},'exitAt':{'type':Sequelize[_0x275e('0x3')]},'reason':{'type':Sequelize[_0x275e('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 9ce3f72..4f4a65f 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 _0xd48e=['create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','ChatQueueReport','count','includeAll','include','rows','catch','show','params','keys','find'];(function(_0x564aa8,_0x4a5555){var _0x50a6ca=function(_0x319001){while(--_0x319001){_0x564aa8['push'](_0x564aa8['shift']());}};_0x50a6ca(++_0x4a5555);}(_0xd48e,0x93));var _0xed48=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xd48e[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed48('0x0'));var zipdir=require(_0xed48('0x1'));var jsonpatch=require(_0xed48('0x2'));var rp=require(_0xed48('0x3'));var moment=require(_0xed48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed48('0x5'));var util=require(_0xed48('0x6'));var path=require(_0xed48('0x7'));var sox=require('sox');var csv=require(_0xed48('0x8'));var ejs=require(_0xed48('0x9'));var fs=require('fs');var fs_extra=require(_0xed48('0xa'));var _=require('lodash');var squel=require(_0xed48('0xb'));var crypto=require(_0xed48('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed48('0xd'));var Papa=require(_0xed48('0xe'));var Redis=require(_0xed48('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed48('0x10'));var hardwareService=require(_0xed48('0x11'));var logger=require(_0xed48('0x12'))('api');var utils=require(_0xed48('0x13'));var config=require(_0xed48('0x14'));var licenseUtil=require(_0xed48('0x15'));var db=require(_0xed48('0x16'))['db'];function respondWithStatusCode(_0x7ee238,_0xaf4b6d){_0xaf4b6d=_0xaf4b6d||0xcc;return function(_0x30bb80){if(_0x30bb80){return _0x7ee238[_0xed48('0x17')](_0xaf4b6d);}return _0x7ee238[_0xed48('0x18')](_0xaf4b6d)[_0xed48('0x19')]();};}function respondWithResult(_0x408ce8,_0x24e67c){_0x24e67c=_0x24e67c||0xc8;return function(_0x429024){if(_0x429024){return _0x408ce8['status'](_0x24e67c)[_0xed48('0x1a')](_0x429024);}};}function respondWithFilteredResult(_0x4a0296,_0x3bf0b7){return function(_0x4d23d9){if(_0x4d23d9){var _0x4d896f=typeof _0x3bf0b7[_0xed48('0x1b')]===_0xed48('0x1c')&&typeof _0x3bf0b7[_0xed48('0x1d')]===_0xed48('0x1c');var _0x1d0d94=_0x4d23d9['count'];var _0x355224=_0x4d896f?0x0:_0x3bf0b7['offset'];var _0x10c4a8=_0x4d896f?_0x4d23d9['count']:_0x3bf0b7[_0xed48('0x1b')]+_0x3bf0b7[_0xed48('0x1d')];var _0x122bf1;if(_0x10c4a8>=_0x1d0d94){_0x10c4a8=_0x1d0d94;_0x122bf1=0xc8;}else{_0x122bf1=0xce;}_0x4a0296['status'](_0x122bf1);return _0x4a0296['set'](_0xed48('0x1e'),_0x355224+'-'+_0x10c4a8+'/'+_0x1d0d94)[_0xed48('0x1a')](_0x4d23d9);}return null;};}function patchUpdates(_0x225d0f){return function(_0x54288f){try{jsonpatch[_0xed48('0x1f')](_0x54288f,_0x225d0f,!![]);}catch(_0x35f451){return BPromise[_0xed48('0x20')](_0x35f451);}return _0x54288f['save']();};}function saveUpdates(_0x277efb,_0x1bda45){return function(_0x13cb25){if(_0x13cb25){return _0x13cb25[_0xed48('0x21')](_0x277efb)[_0xed48('0x22')](function(_0x17a39b){return _0x17a39b;});}return null;};}function removeEntity(_0x4a6d93,_0x2683e4){return function(_0x4b829b){if(_0x4b829b){return _0x4b829b[_0xed48('0x23')]()[_0xed48('0x22')](function(){_0x4a6d93[_0xed48('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b460f,_0x51f67f){return function(_0x350c3c){if(!_0x350c3c){_0x4b460f[_0xed48('0x17')](0x194);}return _0x350c3c;};}function handleError(_0x277ef8,_0x26bff5){_0x26bff5=_0x26bff5||0x1f4;return function(_0x28dbf6){logger[_0xed48('0x24')](_0x28dbf6['stack']);if(_0x28dbf6[_0xed48('0x25')]){delete _0x28dbf6[_0xed48('0x25')];}_0x277ef8[_0xed48('0x18')](_0x26bff5)['send'](_0x28dbf6);};}exports[_0xed48('0x26')]=function(_0x2352a4,_0x5c66e4){var _0x2baff3={},_0x5ed24d={},_0x52a315={'count':0x0,'rows':[]};var _0x391e46=_['map'](db['ChatQueueReport'][_0xed48('0x27')],function(_0x982fdd){return{'name':_0x982fdd[_0xed48('0x28')],'type':_0x982fdd['type'][_0xed48('0x29')]};});_0x5ed24d[_0xed48('0x2a')]=_[_0xed48('0x2b')](_0x391e46,_0xed48('0x25'));_0x5ed24d['query']=_['keys'](_0x2352a4[_0xed48('0x2c')]);_0x5ed24d['filters']=_[_0xed48('0x2d')](_0x5ed24d[_0xed48('0x2a')],_0x5ed24d[_0xed48('0x2c')]);_0x2baff3[_0xed48('0x2e')]=_['intersection'](_0x5ed24d['model'],qs[_0xed48('0x2f')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x2f')]));_0x2baff3[_0xed48('0x2e')]=_0x2baff3[_0xed48('0x2e')][_0xed48('0x30')]?_0x2baff3[_0xed48('0x2e')]:_0x5ed24d[_0xed48('0x2a')];if(!_0x2352a4[_0xed48('0x2c')][_0xed48('0x31')](_0xed48('0x32'))){_0x2baff3[_0xed48('0x1d')]=qs['limit'](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1d')]);_0x2baff3[_0xed48('0x1b')]=qs[_0xed48('0x1b')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1b')]);}_0x2baff3[_0xed48('0x33')]=qs[_0xed48('0x34')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x34')]);_0x2baff3['where']=qs[_0xed48('0x35')](_[_0xed48('0x36')](_0x2352a4[_0xed48('0x2c')],_0x5ed24d[_0xed48('0x35')]),_0x391e46);if(_0x2352a4['query'][_0xed48('0x37')]){_0x2baff3[_0xed48('0x38')]=_['merge'](_0x2baff3[_0xed48('0x38')],{'$or':_[_0xed48('0x2b')](_0x391e46,function(_0x104f65){if(_0x104f65['type']!=='VIRTUAL'){var _0x3281c2={};_0x3281c2[_0x104f65['name']]={'$like':'%'+_0x2352a4[_0xed48('0x2c')][_0xed48('0x37')]+'%'};return _0x3281c2;}})});}_0x2baff3=_[_0xed48('0x39')]({},_0x2baff3,_0x2352a4[_0xed48('0x3a')]);var _0x2a3bfc={'where':_0x2baff3[_0xed48('0x38')]};return db[_0xed48('0x3b')][_0xed48('0x3c')](_0x2a3bfc)[_0xed48('0x22')](function(_0x5b1b8c){_0x52a315[_0xed48('0x3c')]=_0x5b1b8c;if(_0x2352a4[_0xed48('0x2c')][_0xed48('0x3d')]){_0x2baff3[_0xed48('0x3e')]=[{'all':!![]}];}return db[_0xed48('0x3b')]['findAll'](_0x2baff3);})[_0xed48('0x22')](function(_0x1af81d){_0x52a315[_0xed48('0x3f')]=_0x1af81d;return _0x52a315;})[_0xed48('0x22')](respondWithFilteredResult(_0x5c66e4,_0x2baff3))[_0xed48('0x40')](handleError(_0x5c66e4,null));};exports[_0xed48('0x41')]=function(_0x13d84b,_0x1af430){var _0x1d4d1d={'raw':!![],'where':{'id':_0x13d84b[_0xed48('0x42')]['id']}},_0x28014f={};_0x28014f[_0xed48('0x2a')]=_[_0xed48('0x43')](db[_0xed48('0x3b')][_0xed48('0x27')]);_0x28014f[_0xed48('0x2c')]=_[_0xed48('0x43')](_0x13d84b[_0xed48('0x2c')]);_0x28014f['filters']=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],_0x28014f[_0xed48('0x2c')]);_0x1d4d1d[_0xed48('0x2e')]=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],qs['fields'](_0x13d84b[_0xed48('0x2c')]['fields']));_0x1d4d1d[_0xed48('0x2e')]=_0x1d4d1d[_0xed48('0x2e')]['length']?_0x1d4d1d['attributes']:_0x28014f[_0xed48('0x2a')];if(_0x13d84b['query'][_0xed48('0x3d')]){_0x1d4d1d['include']=[{'all':!![]}];}_0x1d4d1d=_['merge']({},_0x1d4d1d,_0x13d84b['options']);return db[_0xed48('0x3b')][_0xed48('0x44')](_0x1d4d1d)[_0xed48('0x22')](handleEntityNotFound(_0x1af430,null))[_0xed48('0x22')](respondWithResult(_0x1af430,null))[_0xed48('0x40')](handleError(_0x1af430,null));};exports[_0xed48('0x45')]=function(_0x5b02a0,_0x51d9d6){return db[_0xed48('0x3b')][_0xed48('0x45')](_0x5b02a0[_0xed48('0x46')],{})[_0xed48('0x22')](respondWithResult(_0x51d9d6,0xc9))[_0xed48('0x40')](handleError(_0x51d9d6,null));};exports[_0xed48('0x21')]=function(_0x505ef9,_0x25fee5){if(_0x505ef9['body']['id']){delete _0x505ef9['body']['id'];}return db['ChatQueueReport'][_0xed48('0x44')]({'where':{'id':_0x505ef9[_0xed48('0x42')]['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x25fee5,null))[_0xed48('0x22')](saveUpdates(_0x505ef9[_0xed48('0x46')],null))[_0xed48('0x22')](respondWithResult(_0x25fee5,null))[_0xed48('0x40')](handleError(_0x25fee5,null));};exports[_0xed48('0x23')]=function(_0x16b21e,_0x3d62a2){return db[_0xed48('0x3b')][_0xed48('0x44')]({'where':{'id':_0x16b21e['params']['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x3d62a2,null))[_0xed48('0x22')](removeEntity(_0x3d62a2,null))[_0xed48('0x40')](handleError(_0x3d62a2,null));};exports[_0xed48('0x47')]=function(_0x1f30ec,_0x143920){return db[_0xed48('0x3b')][_0xed48('0x47')]()[_0xed48('0x22')](respondWithResult(_0x143920,null))[_0xed48('0x40')](handleError(_0x143920,null));}; \ No newline at end of file +var _0xbe3b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','type','key','map','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','ChatQueueReport','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','request-promise','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1586c6,_0x59e7da){_0x1586c6=_0x1586c6-0x0;var _0x957ef1=_0xbe3b[_0x1586c6];return _0x957ef1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbe3('0x0'));var zipdir=require(_0xbbe3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbe3('0x3'));var util=require('util');var path=require('path');var sox=require(_0xbbe3('0x4'));var csv=require(_0xbbe3('0x5'));var ejs=require(_0xbbe3('0x6'));var fs=require('fs');var fs_extra=require(_0xbbe3('0x7'));var _=require('lodash');var squel=require(_0xbbe3('0x8'));var crypto=require(_0xbbe3('0x9'));var jsforce=require(_0xbbe3('0xa'));var deskjs=require(_0xbbe3('0xb'));var toCsv=require(_0xbbe3('0x5'));var querystring=require('querystring');var Papa=require(_0xbbe3('0xc'));var Redis=require(_0xbbe3('0xd'));var authService=require(_0xbbe3('0xe'));var qs=require(_0xbbe3('0xf'));var as=require(_0xbbe3('0x10'));var hardwareService=require(_0xbbe3('0x11'));var logger=require(_0xbbe3('0x12'))(_0xbbe3('0x13'));var utils=require('../../config/utils');var config=require(_0xbbe3('0x14'));var licenseUtil=require(_0xbbe3('0x15'));var db=require(_0xbbe3('0x16'))['db'];function respondWithStatusCode(_0x464538,_0x5ea5b7){_0x5ea5b7=_0x5ea5b7||0xcc;return function(_0x5bd27e){if(_0x5bd27e){return _0x464538[_0xbbe3('0x17')](_0x5ea5b7);}return _0x464538[_0xbbe3('0x18')](_0x5ea5b7)[_0xbbe3('0x19')]();};}function respondWithResult(_0x32b786,_0x1e1552){_0x1e1552=_0x1e1552||0xc8;return function(_0x2df26d){if(_0x2df26d){return _0x32b786['status'](_0x1e1552)[_0xbbe3('0x1a')](_0x2df26d);}};}function respondWithFilteredResult(_0x5ba69a,_0x41b8ba){return function(_0x12a90c){if(_0x12a90c){var _0x46c91b=typeof _0x41b8ba[_0xbbe3('0x1b')]===_0xbbe3('0x1c')&&typeof _0x41b8ba[_0xbbe3('0x1d')]===_0xbbe3('0x1c');var _0x14b84a=_0x12a90c[_0xbbe3('0x1e')];var _0x2ad70e=_0x46c91b?0x0:_0x41b8ba[_0xbbe3('0x1b')];var _0x3de02e=_0x46c91b?_0x12a90c['count']:_0x41b8ba['offset']+_0x41b8ba['limit'];var _0x39d104;if(_0x3de02e>=_0x14b84a){_0x3de02e=_0x14b84a;_0x39d104=0xc8;}else{_0x39d104=0xce;}_0x5ba69a[_0xbbe3('0x18')](_0x39d104);return _0x5ba69a[_0xbbe3('0x1f')](_0xbbe3('0x20'),_0x2ad70e+'-'+_0x3de02e+'/'+_0x14b84a)[_0xbbe3('0x1a')](_0x12a90c);}return null;};}function patchUpdates(_0x4d13da){return function(_0x25f694){try{jsonpatch[_0xbbe3('0x21')](_0x25f694,_0x4d13da,!![]);}catch(_0x46cb49){return BPromise[_0xbbe3('0x22')](_0x46cb49);}return _0x25f694['save']();};}function saveUpdates(_0x545084,_0x4a5d39){return function(_0x5e78dc){if(_0x5e78dc){return _0x5e78dc[_0xbbe3('0x23')](_0x545084)[_0xbbe3('0x24')](function(_0x1e2464){return _0x1e2464;});}return null;};}function removeEntity(_0x4997bf,_0x224bad){return function(_0x190611){if(_0x190611){return _0x190611['destroy']()['then'](function(){_0x4997bf[_0xbbe3('0x18')](0xcc)[_0xbbe3('0x19')]();});}};}function handleEntityNotFound(_0x4df833,_0x2dd461){return function(_0xa09178){if(!_0xa09178){_0x4df833[_0xbbe3('0x17')](0x194);}return _0xa09178;};}function handleError(_0x20988d,_0x541b28){_0x541b28=_0x541b28||0x1f4;return function(_0x1784a4){logger[_0xbbe3('0x25')](_0x1784a4[_0xbbe3('0x26')]);if(_0x1784a4['name']){delete _0x1784a4[_0xbbe3('0x27')];}_0x20988d['status'](_0x541b28)[_0xbbe3('0x28')](_0x1784a4);};}exports[_0xbbe3('0x29')]=function(_0x3e9cf9,_0x158fef){var _0x15b311={},_0x503ba5={},_0x57d480={'count':0x0,'rows':[]};var _0x46fcb3=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0xf29abc){return{'name':_0xf29abc['fieldName'],'type':_0xf29abc[_0xbbe3('0x2a')][_0xbbe3('0x2b')]};});_0x503ba5['model']=_[_0xbbe3('0x2c')](_0x46fcb3,_0xbbe3('0x27'));_0x503ba5['query']=_[_0xbbe3('0x2d')](_0x3e9cf9[_0xbbe3('0x2e')]);_0x503ba5['filters']=_['intersection'](_0x503ba5[_0xbbe3('0x2f')],_0x503ba5['query']);_0x15b311[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x503ba5['model'],qs[_0xbbe3('0x32')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x15b311[_0xbbe3('0x30')]=_0x15b311[_0xbbe3('0x30')][_0xbbe3('0x33')]?_0x15b311['attributes']:_0x503ba5[_0xbbe3('0x2f')];if(!_0x3e9cf9['query'][_0xbbe3('0x34')](_0xbbe3('0x35'))){_0x15b311['limit']=qs[_0xbbe3('0x1d')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1d')]);_0x15b311['offset']=qs[_0xbbe3('0x1b')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1b')]);}_0x15b311['order']=qs[_0xbbe3('0x36')](_0x3e9cf9['query'][_0xbbe3('0x36')]);_0x15b311[_0xbbe3('0x37')]=qs[_0xbbe3('0x38')](_[_0xbbe3('0x39')](_0x3e9cf9[_0xbbe3('0x2e')],_0x503ba5[_0xbbe3('0x38')]),_0x46fcb3);if(_0x3e9cf9[_0xbbe3('0x2e')]['filter']){_0x15b311[_0xbbe3('0x37')]=_[_0xbbe3('0x3a')](_0x15b311[_0xbbe3('0x37')],{'$or':_[_0xbbe3('0x2c')](_0x46fcb3,function(_0x55f88a){if(_0x55f88a[_0xbbe3('0x2a')]!=='VIRTUAL'){var _0x45fff0={};_0x45fff0[_0x55f88a['name']]={'$like':'%'+_0x3e9cf9['query'][_0xbbe3('0x3b')]+'%'};return _0x45fff0;}})});}_0x15b311=_[_0xbbe3('0x3a')]({},_0x15b311,_0x3e9cf9[_0xbbe3('0x3c')]);var _0x10091f={'where':_0x15b311[_0xbbe3('0x37')]};return db[_0xbbe3('0x3d')][_0xbbe3('0x1e')](_0x10091f)[_0xbbe3('0x24')](function(_0x704ecf){_0x57d480[_0xbbe3('0x1e')]=_0x704ecf;if(_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x3e')]){_0x15b311[_0xbbe3('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbbe3('0x40')](_0x15b311);})['then'](function(_0x579a42){_0x57d480[_0xbbe3('0x41')]=_0x579a42;return _0x57d480;})[_0xbbe3('0x24')](respondWithFilteredResult(_0x158fef,_0x15b311))['catch'](handleError(_0x158fef,null));};exports['show']=function(_0x52e815,_0x163dd2){var _0x24e080={'raw':!![],'where':{'id':_0x52e815[_0xbbe3('0x42')]['id']}},_0x22a62c={};_0x22a62c[_0xbbe3('0x2f')]=_[_0xbbe3('0x2d')](db[_0xbbe3('0x3d')][_0xbbe3('0x43')]);_0x22a62c[_0xbbe3('0x2e')]=_['keys'](_0x52e815['query']);_0x22a62c[_0xbbe3('0x38')]=_[_0xbbe3('0x31')](_0x22a62c['model'],_0x22a62c[_0xbbe3('0x2e')]);_0x24e080[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x22a62c[_0xbbe3('0x2f')],qs[_0xbbe3('0x32')](_0x52e815[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x24e080['attributes']=_0x24e080['attributes']['length']?_0x24e080['attributes']:_0x22a62c['model'];if(_0x52e815[_0xbbe3('0x2e')]['includeAll']){_0x24e080[_0xbbe3('0x3f')]=[{'all':!![]}];}_0x24e080=_['merge']({},_0x24e080,_0x52e815[_0xbbe3('0x3c')]);return db[_0xbbe3('0x3d')][_0xbbe3('0x44')](_0x24e080)['then'](handleEntityNotFound(_0x163dd2,null))[_0xbbe3('0x24')](respondWithResult(_0x163dd2,null))[_0xbbe3('0x45')](handleError(_0x163dd2,null));};exports[_0xbbe3('0x46')]=function(_0x560e57,_0x4b9b51){return db[_0xbbe3('0x3d')]['create'](_0x560e57[_0xbbe3('0x47')],{})['then'](respondWithResult(_0x4b9b51,0xc9))[_0xbbe3('0x45')](handleError(_0x4b9b51,null));};exports[_0xbbe3('0x23')]=function(_0x291f1a,_0x1ddc51){if(_0x291f1a[_0xbbe3('0x47')]['id']){delete _0x291f1a[_0xbbe3('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x291f1a[_0xbbe3('0x42')]['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x1ddc51,null))[_0xbbe3('0x24')](saveUpdates(_0x291f1a[_0xbbe3('0x47')],null))[_0xbbe3('0x24')](respondWithResult(_0x1ddc51,null))[_0xbbe3('0x45')](handleError(_0x1ddc51,null));};exports['destroy']=function(_0x4da713,_0x449beb){return db['ChatQueueReport']['find']({'where':{'id':_0x4da713['params']['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x449beb,null))[_0xbbe3('0x24')](removeEntity(_0x449beb,null))['catch'](handleError(_0x449beb,null));};exports[_0xbbe3('0x48')]=function(_0x1cc61b,_0x454bb7){return db['ChatQueueReport'][_0xbbe3('0x48')]()[_0xbbe3('0x24')](respondWithResult(_0x454bb7,null))['catch'](handleError(_0x454bb7,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7a3ac95..5d6f94a 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(_0x4077c1,_0x8e99bf){var _0x37a8f1=function(_0x2bf4aa){while(--_0x2bf4aa){_0x4077c1['push'](_0x4077c1['shift']());}};_0x37a8f1(++_0x8e99bf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xcb91[_0x204ad4];return _0x50675f;};'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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x179ea1,_0x367ffc){var _0x314d33=function(_0x2b94a7){while(--_0x2b94a7){_0x179ea1['push'](_0x179ea1['shift']());}};_0x314d33(++_0x367ffc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c53855a..6e5f65e 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 _0x31a3=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5aa9a9,_0x5ac877){var _0x277581=function(_0x2d5f1d){while(--_0x2d5f1d){_0x5aa9a9['push'](_0x5aa9a9['shift']());}};_0x277581(++_0x5ac877);}(_0x31a3,0x183));var _0x331a=function(_0xb9c2da,_0x5e481a){_0xb9c2da=_0xb9c2da-0x0;var _0x195d1d=_0x31a3[_0xb9c2da];return _0x195d1d;};'use strict';var _=require(_0x331a('0x0'));var util=require(_0x331a('0x1'));var moment=require(_0x331a('0x2'));var BPromise=require(_0x331a('0x3'));var rs=require(_0x331a('0x4'));var fs=require('fs');var Redis=require(_0x331a('0x5'));var db=require(_0x331a('0x6'))['db'];var utils=require(_0x331a('0x7'));var logger=require(_0x331a('0x8'))(_0x331a('0x9'));var config=require(_0x331a('0xa'));var jayson=require(_0x331a('0xb'));var client=jayson[_0x331a('0xc')][_0x331a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x435bbd,_0x27a66f,_0x30de49){return new BPromise(function(_0x300633,_0x51aad5){return client['request'](_0x435bbd,_0x30de49)[_0x331a('0xe')](function(_0x27b061){logger[_0x331a('0xf')](_0x331a('0x10'),_0x27a66f,_0x331a('0x11'));logger[_0x331a('0x12')](_0x331a('0x13'),_0x27a66f,_0x331a('0x11'),JSON['stringify'](_0x27b061));if(_0x27b061[_0x331a('0x14')]){if(_0x27b061[_0x331a('0x14')][_0x331a('0x15')]===0x1f4){logger[_0x331a('0x14')](_0x331a('0x10'),_0x27a66f,_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);return _0x51aad5(_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);}logger[_0x331a('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x27a66f,_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);return _0x300633(_0x27b061['error'][_0x331a('0x16')]);}else{logger['info'](_0x331a('0x10'),_0x27a66f,_0x331a('0x11'));_0x300633(_0x27b061[_0x331a('0x17')][_0x331a('0x16')]);}})[_0x331a('0x18')](function(_0x56e04e){logger[_0x331a('0x14')](_0x331a('0x10'),_0x27a66f,_0x56e04e);_0x51aad5(_0x56e04e);});});}exports[_0x331a('0x19')]=function(_0x12e44f){var _0x50c44d=this;return new Promise(function(_0x471e66,_0x3d134c){return db[_0x331a('0x1a')][_0x331a('0x1b')](_0x12e44f[_0x331a('0x1c')],{'raw':_0x12e44f['options']?_0x12e44f[_0x331a('0x1d')][_0x331a('0x1e')]===undefined?!![]:![]:!![]})[_0x331a('0xe')](function(_0x1a60ce){logger[_0x331a('0xf')](_0x331a('0x19'),_0x12e44f);logger[_0x331a('0x12')](_0x331a('0x19'),_0x12e44f,JSON[_0x331a('0x1f')](_0x1a60ce));_0x471e66(_0x1a60ce);})[_0x331a('0x18')](function(_0x194114){logger[_0x331a('0x14')](_0x331a('0x19'),_0x194114[_0x331a('0x16')],_0x12e44f);_0x3d134c(_0x50c44d[_0x331a('0x14')](0x1f4,_0x194114[_0x331a('0x16')]));});});};exports[_0x331a('0x20')]=function(_0x651d19){var _0x1714ab=this;return new Promise(function(_0x23a8de,_0xde0c39){return db[_0x331a('0x1a')][_0x331a('0x21')](_0x651d19[_0x331a('0x1c')],{'raw':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x22')]||null:null,'attributes':_0x651d19['options']?_0x651d19[_0x331a('0x1d')][_0x331a('0x23')]||null:null,'limit':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x24')]||null:null})[_0x331a('0xe')](function(_0x53869f){logger[_0x331a('0xf')](_0x331a('0x20'),_0x651d19);logger[_0x331a('0x12')](_0x331a('0x20'),_0x651d19,JSON[_0x331a('0x1f')](_0x53869f));_0x23a8de(_0x53869f);})[_0x331a('0x18')](function(_0x1e3a84){logger['error'](_0x331a('0x20'),_0x1e3a84[_0x331a('0x16')],_0x651d19);_0xde0c39(_0x1714ab['error'](0x1f4,_0x1e3a84[_0x331a('0x16')]));});});}; \ No newline at end of file +var _0x9007=['info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','options','raw','ChatQueueReport','update','where','limit','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x59a5f4,_0x2b1063){var _0x3d3a6f=function(_0x630d89){while(--_0x630d89){_0x59a5f4['push'](_0x59a5f4['shift']());}};_0x3d3a6f(++_0x2b1063);}(_0x9007,0x1db));var _0x7900=function(_0x2c9cf9,_0x2bed45){_0x2c9cf9=_0x2c9cf9-0x0;var _0x560d6d=_0x9007[_0x2c9cf9];return _0x560d6d;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var moment=require(_0x7900('0x2'));var BPromise=require('bluebird');var rs=require(_0x7900('0x3'));var fs=require('fs');var Redis=require(_0x7900('0x4'));var db=require(_0x7900('0x5'))['db'];var utils=require(_0x7900('0x6'));var logger=require(_0x7900('0x7'))(_0x7900('0x8'));var config=require(_0x7900('0x9'));var jayson=require(_0x7900('0xa'));var client=jayson[_0x7900('0xb')][_0x7900('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x537274,_0x237967,_0x5a75ab){return new BPromise(function(_0x39508a,_0x385913){return client[_0x7900('0xd')](_0x537274,_0x5a75ab)[_0x7900('0xe')](function(_0x32be3f){logger[_0x7900('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x7900('0x10'));logger[_0x7900('0x11')](_0x7900('0x12'),_0x237967,_0x7900('0x10'),JSON[_0x7900('0x13')](_0x32be3f));if(_0x32be3f[_0x7900('0x14')]){if(_0x32be3f[_0x7900('0x14')][_0x7900('0x15')]===0x1f4){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x32be3f['error'][_0x7900('0x17')]);return _0x385913(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);return _0x39508a(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}else{logger[_0x7900('0xf')](_0x7900('0x16'),_0x237967,_0x7900('0x10'));_0x39508a(_0x32be3f[_0x7900('0x18')]['message']);}})[_0x7900('0x19')](function(_0x45e83c){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x45e83c);_0x385913(_0x45e83c);});});}exports[_0x7900('0x1a')]=function(_0x1baf93){var _0xd3645c=this;return new Promise(function(_0x12fb13,_0x2fcf84){return db['ChatQueueReport'][_0x7900('0x1b')](_0x1baf93['body'],{'raw':_0x1baf93[_0x7900('0x1c')]?_0x1baf93[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x318e13){logger[_0x7900('0xf')](_0x7900('0x1a'),_0x1baf93);logger['debug'](_0x7900('0x1a'),_0x1baf93,JSON[_0x7900('0x13')](_0x318e13));_0x12fb13(_0x318e13);})[_0x7900('0x19')](function(_0x4795f1){logger[_0x7900('0x14')](_0x7900('0x1a'),_0x4795f1[_0x7900('0x17')],_0x1baf93);_0x2fcf84(_0xd3645c[_0x7900('0x14')](0x1f4,_0x4795f1[_0x7900('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0xeebcda){var _0x3e43ca=this;return new Promise(function(_0x19ae4f,_0x3fb249){return db[_0x7900('0x1e')][_0x7900('0x1f')](_0xeebcda['body'],{'raw':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeebcda[_0x7900('0x1c')]?_0xeebcda['options'][_0x7900('0x20')]||null:null,'attributes':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')]['attributes']||null:null,'limit':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x21')]||null:null})['then'](function(_0x11d0fd){logger[_0x7900('0xf')](_0x7900('0x22'),_0xeebcda);logger[_0x7900('0x11')](_0x7900('0x22'),_0xeebcda,JSON[_0x7900('0x13')](_0x11d0fd));_0x19ae4f(_0x11d0fd);})['catch'](function(_0x5d4a48){logger[_0x7900('0x14')]('UpdateChatQueueReport',_0x5d4a48[_0x7900('0x17')],_0xeebcda);_0x3fb249(_0x3e43ca[_0x7900('0x14')](0x1f4,_0x5d4a48[_0x7900('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index ba3f7a8..244b109 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 _0x18ac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x245cbf,_0x4ff281){var _0x1f3c4b=function(_0x29b237){while(--_0x29b237){_0x245cbf['push'](_0x245cbf['shift']());}};_0x1f3c4b(++_0x4ff281);}(_0x18ac,0xa3));var _0xc18a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x18ac[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xc18a('0x0'));var util=require(_0xc18a('0x1'));var path=require(_0xc18a('0x2'));var timeout=require(_0xc18a('0x3'));var express=require(_0xc18a('0x4'));var router=express[_0xc18a('0x5')]();var fs_extra=require(_0xc18a('0x6'));var auth=require(_0xc18a('0x7'));var interaction=require(_0xc18a('0x8'));var config=require(_0xc18a('0x9'));var controller=require('./chatQueueReport.controller');router[_0xc18a('0xa')]('/',auth[_0xc18a('0xb')](),controller[_0xc18a('0xc')]);router[_0xc18a('0xa')](_0xc18a('0xd'),auth['isAuthenticated'](),controller[_0xc18a('0xe')]);router[_0xc18a('0xa')](_0xc18a('0xf'),auth[_0xc18a('0xb')](),controller['show']);router[_0xc18a('0x10')]('/',auth[_0xc18a('0xb')](),controller['create']);router[_0xc18a('0x11')](_0xc18a('0xf'),auth['isAuthenticated'](),controller[_0xc18a('0x12')]);router[_0xc18a('0x13')](_0xc18a('0xf'),auth['isAuthenticated'](),controller[_0xc18a('0x14')]);module['exports']=router; \ No newline at end of file +var _0x75dc=['describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x36d9b5,_0x38491f){var _0x2ec0bb=function(_0x378da9){while(--_0x378da9){_0x36d9b5['push'](_0x36d9b5['shift']());}};_0x2ec0bb(++_0x38491f);}(_0x75dc,0x1db));var _0xc75d=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0x75dc[_0x44e7b9];return _0x1de7ac;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require(_0xc75d('0x2'));var express=require(_0xc75d('0x3'));var router=express[_0xc75d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc75d('0x5'));var controller=require(_0xc75d('0x6'));router[_0xc75d('0x7')]('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0x9')]);router[_0xc75d('0x7')](_0xc75d('0xa'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xb')]);router[_0xc75d('0x7')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xd')]);router['post']('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0xe')]);router[_0xc75d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc75d('0x10')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index ae16080..cc67038 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1812a0,_0x10afb1){var _0x52783a=function(_0x49d34e){while(--_0x49d34e){_0x1812a0['push'](_0x1812a0['shift']());}};_0x52783a(++_0x10afb1);}(_0xe706,0xa3));var _0x6e70=function(_0x40c402,_0x42ee7d){_0x40c402=_0x40c402-0x0;var _0x4e7680=_0xe706[_0x40c402];return _0x4e7680;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5d1caf,_0x1fc81e){var _0xc452cf=function(_0x5c36fb){while(--_0x5c36fb){_0x5d1caf['push'](_0x5d1caf['shift']());}};_0xc452cf(++_0x1fc81e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x608daf,_0x589a32){_0x608daf=_0x608daf-0x0;var _0x1bc560=_0xf4eb[_0x608daf];return _0x1bc560;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7ce8566..80de743 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 _0xe741=['../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x22816e,_0x4651e){var _0x86babe=function(_0x47cd1c){while(--_0x47cd1c){_0x22816e['push'](_0x22816e['shift']());}};_0x86babe(++_0x4651e);}(_0xe741,0x7c));var _0x1e74=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xe741[_0x26462c];return _0x509a42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e74('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e74('0x1'));var rp=require(_0x1e74('0x2'));var moment=require(_0x1e74('0x3'));var BPromise=require(_0x1e74('0x4'));var Mustache=require(_0x1e74('0x5'));var util=require(_0x1e74('0x6'));var path=require(_0x1e74('0x7'));var sox=require('sox');var csv=require(_0x1e74('0x8'));var ejs=require(_0x1e74('0x9'));var fs=require('fs');var fs_extra=require(_0x1e74('0xa'));var _=require(_0x1e74('0xb'));var squel=require('squel');var crypto=require(_0x1e74('0xc'));var jsforce=require(_0x1e74('0xd'));var deskjs=require(_0x1e74('0xe'));var toCsv=require(_0x1e74('0x8'));var querystring=require(_0x1e74('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e74('0x10'));var authService=require(_0x1e74('0x11'));var qs=require(_0x1e74('0x12'));var as=require(_0x1e74('0x13'));var hardwareService=require(_0x1e74('0x14'));var logger=require('../../config/logger')(_0x1e74('0x15'));var utils=require('../../config/utils');var config=require(_0x1e74('0x16'));var licenseUtil=require(_0x1e74('0x17'));var db=require(_0x1e74('0x18'))['db'];function respondWithStatusCode(_0x121aa2,_0x4a7ad3){_0x4a7ad3=_0x4a7ad3||0xcc;return function(_0x329490){if(_0x329490){return _0x121aa2[_0x1e74('0x19')](_0x4a7ad3);}return _0x121aa2[_0x1e74('0x1a')](_0x4a7ad3)[_0x1e74('0x1b')]();};}function respondWithResult(_0x1b8031,_0x86733f){_0x86733f=_0x86733f||0xc8;return function(_0x465fc6){if(_0x465fc6){return _0x1b8031[_0x1e74('0x1a')](_0x86733f)[_0x1e74('0x1c')](_0x465fc6);}};}function respondWithFilteredResult(_0x300b05,_0x35f983){return function(_0x360aab){if(_0x360aab){var _0x55daf6=typeof _0x35f983['offset']==='undefined'&&typeof _0x35f983[_0x1e74('0x1d')]===_0x1e74('0x1e');var _0x5e264e=_0x360aab[_0x1e74('0x1f')];var _0x3872a0=_0x55daf6?0x0:_0x35f983[_0x1e74('0x20')];var _0x131091=_0x55daf6?_0x360aab[_0x1e74('0x1f')]:_0x35f983['offset']+_0x35f983[_0x1e74('0x1d')];var _0x14e403;if(_0x131091>=_0x5e264e){_0x131091=_0x5e264e;_0x14e403=0xc8;}else{_0x14e403=0xce;}_0x300b05[_0x1e74('0x1a')](_0x14e403);return _0x300b05['set']('Content-Range',_0x3872a0+'-'+_0x131091+'/'+_0x5e264e)['json'](_0x360aab);}return null;};}function patchUpdates(_0x50f19a){return function(_0x2ebabf){try{jsonpatch[_0x1e74('0x21')](_0x2ebabf,_0x50f19a,!![]);}catch(_0x4dbc18){return BPromise[_0x1e74('0x22')](_0x4dbc18);}return _0x2ebabf['save']();};}function saveUpdates(_0x11bafa,_0x11c4c8){return function(_0x1813cc){if(_0x1813cc){return _0x1813cc[_0x1e74('0x23')](_0x11bafa)[_0x1e74('0x24')](function(_0x33c8c3){return _0x33c8c3;});}return null;};}function removeEntity(_0x294e97,_0x20d086){return function(_0x2cecdc){if(_0x2cecdc){return _0x2cecdc[_0x1e74('0x25')]()[_0x1e74('0x24')](function(){_0x294e97[_0x1e74('0x1a')](0xcc)[_0x1e74('0x1b')]();});}};}function handleEntityNotFound(_0x585afa,_0x300258){return function(_0x49bd26){if(!_0x49bd26){_0x585afa['sendStatus'](0x194);}return _0x49bd26;};}function handleError(_0x2b1692,_0x56c4b4){_0x56c4b4=_0x56c4b4||0x1f4;return function(_0x278b2c){logger[_0x1e74('0x26')](_0x278b2c[_0x1e74('0x27')]);if(_0x278b2c[_0x1e74('0x28')]){delete _0x278b2c[_0x1e74('0x28')];}_0x2b1692[_0x1e74('0x1a')](_0x56c4b4)[_0x1e74('0x29')](_0x278b2c);};}exports[_0x1e74('0x2a')]=function(_0x47213e,_0x2b20b2){var _0x200e1a={},_0x2c6f4b={},_0x32da80={'count':0x0,'rows':[]};var _0x2d7381=_[_0x1e74('0x2b')](db[_0x1e74('0x2c')]['rawAttributes'],function(_0x59d415){return{'name':_0x59d415['fieldName'],'type':_0x59d415[_0x1e74('0x2d')][_0x1e74('0x2e')]};});_0x2c6f4b[_0x1e74('0x2f')]=_[_0x1e74('0x2b')](_0x2d7381,_0x1e74('0x28'));_0x2c6f4b['query']=_[_0x1e74('0x30')](_0x47213e[_0x1e74('0x31')]);_0x2c6f4b[_0x1e74('0x32')]=_[_0x1e74('0x33')](_0x2c6f4b['model'],_0x2c6f4b['query']);_0x200e1a[_0x1e74('0x34')]=_[_0x1e74('0x33')](_0x2c6f4b[_0x1e74('0x2f')],qs[_0x1e74('0x35')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x35')]));_0x200e1a[_0x1e74('0x34')]=_0x200e1a[_0x1e74('0x34')][_0x1e74('0x36')]?_0x200e1a['attributes']:_0x2c6f4b[_0x1e74('0x2f')];if(!_0x47213e[_0x1e74('0x31')][_0x1e74('0x37')]('nolimit')){_0x200e1a[_0x1e74('0x1d')]=qs[_0x1e74('0x1d')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x1d')]);_0x200e1a['offset']=qs[_0x1e74('0x20')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x20')]);}_0x200e1a[_0x1e74('0x38')]=qs[_0x1e74('0x39')](_0x47213e[_0x1e74('0x31')]['sort']);_0x200e1a[_0x1e74('0x3a')]=qs[_0x1e74('0x32')](_[_0x1e74('0x3b')](_0x47213e[_0x1e74('0x31')],_0x2c6f4b[_0x1e74('0x32')]),_0x2d7381);if(_0x47213e[_0x1e74('0x31')]['filter']){_0x200e1a[_0x1e74('0x3a')]=_[_0x1e74('0x3c')](_0x200e1a['where'],{'$or':_[_0x1e74('0x2b')](_0x2d7381,function(_0x4a4d1d){if(_0x4a4d1d[_0x1e74('0x2d')]!==_0x1e74('0x3d')){var _0x3bfb3e={};_0x3bfb3e[_0x4a4d1d[_0x1e74('0x28')]]={'$like':'%'+_0x47213e[_0x1e74('0x31')]['filter']+'%'};return _0x3bfb3e;}})});}_0x200e1a=_[_0x1e74('0x3c')]({},_0x200e1a,_0x47213e['options']);var _0x5afa22={'where':_0x200e1a['where']};return db['ChatTransferReport'][_0x1e74('0x1f')](_0x5afa22)[_0x1e74('0x24')](function(_0x44ce35){_0x32da80['count']=_0x44ce35;if(_0x47213e[_0x1e74('0x31')][_0x1e74('0x3e')]){_0x200e1a[_0x1e74('0x3f')]=[{'all':!![]}];}return db[_0x1e74('0x2c')][_0x1e74('0x40')](_0x200e1a);})[_0x1e74('0x24')](function(_0x43a84c){_0x32da80[_0x1e74('0x41')]=_0x43a84c;return _0x32da80;})[_0x1e74('0x24')](respondWithFilteredResult(_0x2b20b2,_0x200e1a))[_0x1e74('0x42')](handleError(_0x2b20b2,null));};exports['show']=function(_0x4f7b7b,_0x59d190){var _0x536812={'raw':!![],'where':{'id':_0x4f7b7b[_0x1e74('0x43')]['id']}},_0x5775d0={};_0x5775d0[_0x1e74('0x2f')]=_[_0x1e74('0x30')](db[_0x1e74('0x2c')]['rawAttributes']);_0x5775d0[_0x1e74('0x31')]=_[_0x1e74('0x30')](_0x4f7b7b[_0x1e74('0x31')]);_0x5775d0['filters']=_[_0x1e74('0x33')](_0x5775d0[_0x1e74('0x2f')],_0x5775d0[_0x1e74('0x31')]);_0x536812[_0x1e74('0x34')]=_[_0x1e74('0x33')](_0x5775d0[_0x1e74('0x2f')],qs[_0x1e74('0x35')](_0x4f7b7b['query'][_0x1e74('0x35')]));_0x536812['attributes']=_0x536812[_0x1e74('0x34')]['length']?_0x536812[_0x1e74('0x34')]:_0x5775d0[_0x1e74('0x2f')];if(_0x4f7b7b[_0x1e74('0x31')][_0x1e74('0x3e')]){_0x536812[_0x1e74('0x3f')]=[{'all':!![]}];}_0x536812=_['merge']({},_0x536812,_0x4f7b7b['options']);return db[_0x1e74('0x2c')]['find'](_0x536812)[_0x1e74('0x24')](handleEntityNotFound(_0x59d190,null))[_0x1e74('0x24')](respondWithResult(_0x59d190,null))['catch'](handleError(_0x59d190,null));};exports[_0x1e74('0x44')]=function(_0x2ee30a,_0x4d3a11){return db[_0x1e74('0x2c')][_0x1e74('0x44')](_0x2ee30a[_0x1e74('0x45')],{})[_0x1e74('0x24')](respondWithResult(_0x4d3a11,0xc9))[_0x1e74('0x42')](handleError(_0x4d3a11,null));};exports['update']=function(_0x1feedd,_0x2d6a87){if(_0x1feedd[_0x1e74('0x45')]['id']){delete _0x1feedd[_0x1e74('0x45')]['id'];}return db[_0x1e74('0x2c')][_0x1e74('0x46')]({'where':{'id':_0x1feedd[_0x1e74('0x43')]['id']}})[_0x1e74('0x24')](handleEntityNotFound(_0x2d6a87,null))['then'](saveUpdates(_0x1feedd[_0x1e74('0x45')],null))[_0x1e74('0x24')](respondWithResult(_0x2d6a87,null))[_0x1e74('0x42')](handleError(_0x2d6a87,null));};exports[_0x1e74('0x25')]=function(_0x286c32,_0x4aa5f4){return db[_0x1e74('0x2c')]['find']({'where':{'id':_0x286c32[_0x1e74('0x43')]['id']}})[_0x1e74('0x24')](handleEntityNotFound(_0x4aa5f4,null))['then'](removeEntity(_0x4aa5f4,null))[_0x1e74('0x42')](handleError(_0x4aa5f4,null));};exports['describe']=function(_0x3996c8,_0x2d7dca){return db['ChatTransferReport'][_0x1e74('0x47')]()[_0x1e74('0x24')](respondWithResult(_0x2d7dca,null))[_0x1e74('0x42')](handleError(_0x2d7dca,null));}; \ No newline at end of file +var _0x7919=['order','sort','where','pick','type','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x469346,_0x4ee770){var _0x3b1b6d=function(_0x2bea74){while(--_0x2bea74){_0x469346['push'](_0x469346['shift']());}};_0x3b1b6d(++_0x4ee770);}(_0x7919,0x1db));var _0x9791=function(_0x53b0d1,_0xffa3c9){_0x53b0d1=_0x53b0d1-0x0;var _0x37bc3d=_0x7919[_0x53b0d1];return _0x37bc3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9791('0x0'));var zipdir=require(_0x9791('0x1'));var jsonpatch=require(_0x9791('0x2'));var rp=require(_0x9791('0x3'));var moment=require(_0x9791('0x4'));var BPromise=require(_0x9791('0x5'));var Mustache=require(_0x9791('0x6'));var util=require(_0x9791('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9791('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9791('0x9'));var squel=require(_0x9791('0xa'));var crypto=require(_0x9791('0xb'));var jsforce=require(_0x9791('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9791('0xd'));var Papa=require(_0x9791('0xe'));var Redis=require(_0x9791('0xf'));var authService=require(_0x9791('0x10'));var qs=require(_0x9791('0x11'));var as=require(_0x9791('0x12'));var hardwareService=require(_0x9791('0x13'));var logger=require(_0x9791('0x14'))(_0x9791('0x15'));var utils=require(_0x9791('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8b6ef5,_0x1f2e63){_0x1f2e63=_0x1f2e63||0xcc;return function(_0x51d8e0){if(_0x51d8e0){return _0x8b6ef5[_0x9791('0x17')](_0x1f2e63);}return _0x8b6ef5[_0x9791('0x18')](_0x1f2e63)[_0x9791('0x19')]();};}function respondWithResult(_0x40f5cc,_0x535652){_0x535652=_0x535652||0xc8;return function(_0xd2bdd3){if(_0xd2bdd3){return _0x40f5cc[_0x9791('0x18')](_0x535652)[_0x9791('0x1a')](_0xd2bdd3);}};}function respondWithFilteredResult(_0x2fafe6,_0x308117){return function(_0xf9f120){if(_0xf9f120){var _0x4c9a8c=typeof _0x308117[_0x9791('0x1b')]===_0x9791('0x1c')&&typeof _0x308117[_0x9791('0x1d')]===_0x9791('0x1c');var _0x2e48a2=_0xf9f120['count'];var _0x5c4ab8=_0x4c9a8c?0x0:_0x308117[_0x9791('0x1b')];var _0x19b151=_0x4c9a8c?_0xf9f120[_0x9791('0x1e')]:_0x308117[_0x9791('0x1b')]+_0x308117[_0x9791('0x1d')];var _0x594ec2;if(_0x19b151>=_0x2e48a2){_0x19b151=_0x2e48a2;_0x594ec2=0xc8;}else{_0x594ec2=0xce;}_0x2fafe6[_0x9791('0x18')](_0x594ec2);return _0x2fafe6[_0x9791('0x1f')](_0x9791('0x20'),_0x5c4ab8+'-'+_0x19b151+'/'+_0x2e48a2)[_0x9791('0x1a')](_0xf9f120);}return null;};}function patchUpdates(_0xe3da4f){return function(_0x2eb577){try{jsonpatch[_0x9791('0x21')](_0x2eb577,_0xe3da4f,!![]);}catch(_0x164ca3){return BPromise[_0x9791('0x22')](_0x164ca3);}return _0x2eb577['save']();};}function saveUpdates(_0x4bcbd6,_0x1fcf42){return function(_0x1eb66e){if(_0x1eb66e){return _0x1eb66e[_0x9791('0x23')](_0x4bcbd6)[_0x9791('0x24')](function(_0x3294a9){return _0x3294a9;});}return null;};}function removeEntity(_0x392a87,_0x1ea05b){return function(_0x46cf2f){if(_0x46cf2f){return _0x46cf2f[_0x9791('0x25')]()[_0x9791('0x24')](function(){_0x392a87[_0x9791('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1338,_0xe032a){return function(_0x481845){if(!_0x481845){_0x2b1338[_0x9791('0x17')](0x194);}return _0x481845;};}function handleError(_0x2adf38,_0x1c70af){_0x1c70af=_0x1c70af||0x1f4;return function(_0x1b4ace){logger[_0x9791('0x26')](_0x1b4ace[_0x9791('0x27')]);if(_0x1b4ace[_0x9791('0x28')]){delete _0x1b4ace['name'];}_0x2adf38[_0x9791('0x18')](_0x1c70af)['send'](_0x1b4ace);};}exports[_0x9791('0x29')]=function(_0x2e9fbb,_0x1bafe3){var _0x55d741={},_0x2ed874={},_0x5e0d68={'count':0x0,'rows':[]};var _0x3c453b=_[_0x9791('0x2a')](db[_0x9791('0x2b')][_0x9791('0x2c')],function(_0x2cd647){return{'name':_0x2cd647[_0x9791('0x2d')],'type':_0x2cd647['type'][_0x9791('0x2e')]};});_0x2ed874['model']=_[_0x9791('0x2a')](_0x3c453b,_0x9791('0x28'));_0x2ed874[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x2e9fbb['query']);_0x2ed874[_0x9791('0x31')]=_['intersection'](_0x2ed874[_0x9791('0x32')],_0x2ed874[_0x9791('0x2f')]);_0x55d741[_0x9791('0x33')]=_[_0x9791('0x34')](_0x2ed874['model'],qs[_0x9791('0x35')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x35')]));_0x55d741[_0x9791('0x33')]=_0x55d741[_0x9791('0x33')][_0x9791('0x36')]?_0x55d741[_0x9791('0x33')]:_0x2ed874[_0x9791('0x32')];if(!_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x37')](_0x9791('0x38'))){_0x55d741['limit']=qs['limit'](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1d')]);_0x55d741['offset']=qs[_0x9791('0x1b')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1b')]);}_0x55d741[_0x9791('0x39')]=qs[_0x9791('0x3a')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x3a')]);_0x55d741[_0x9791('0x3b')]=qs[_0x9791('0x31')](_[_0x9791('0x3c')](_0x2e9fbb[_0x9791('0x2f')],_0x2ed874[_0x9791('0x31')]),_0x3c453b);if(_0x2e9fbb[_0x9791('0x2f')]['filter']){_0x55d741[_0x9791('0x3b')]=_['merge'](_0x55d741[_0x9791('0x3b')],{'$or':_[_0x9791('0x2a')](_0x3c453b,function(_0x48e1b3){if(_0x48e1b3[_0x9791('0x3d')]!=='VIRTUAL'){var _0x206f14={};_0x206f14[_0x48e1b3[_0x9791('0x28')]]={'$like':'%'+_0x2e9fbb['query'][_0x9791('0x3e')]+'%'};return _0x206f14;}})});}_0x55d741=_[_0x9791('0x3f')]({},_0x55d741,_0x2e9fbb[_0x9791('0x40')]);var _0x349cbd={'where':_0x55d741[_0x9791('0x3b')]};return db[_0x9791('0x2b')]['count'](_0x349cbd)[_0x9791('0x24')](function(_0x5cb980){_0x5e0d68[_0x9791('0x1e')]=_0x5cb980;if(_0x2e9fbb['query']['includeAll']){_0x55d741[_0x9791('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9791('0x42')](_0x55d741);})[_0x9791('0x24')](function(_0x2c4511){_0x5e0d68[_0x9791('0x43')]=_0x2c4511;return _0x5e0d68;})[_0x9791('0x24')](respondWithFilteredResult(_0x1bafe3,_0x55d741))[_0x9791('0x44')](handleError(_0x1bafe3,null));};exports[_0x9791('0x45')]=function(_0x21242e,_0x6512a8){var _0x5de9d8={'raw':!![],'where':{'id':_0x21242e[_0x9791('0x46')]['id']}},_0x4deca1={};_0x4deca1['model']=_[_0x9791('0x30')](db['ChatTransferReport'][_0x9791('0x2c')]);_0x4deca1[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x21242e[_0x9791('0x2f')]);_0x4deca1[_0x9791('0x31')]=_[_0x9791('0x34')](_0x4deca1[_0x9791('0x32')],_0x4deca1['query']);_0x5de9d8[_0x9791('0x33')]=_['intersection'](_0x4deca1['model'],qs[_0x9791('0x35')](_0x21242e[_0x9791('0x2f')][_0x9791('0x35')]));_0x5de9d8[_0x9791('0x33')]=_0x5de9d8[_0x9791('0x33')][_0x9791('0x36')]?_0x5de9d8[_0x9791('0x33')]:_0x4deca1['model'];if(_0x21242e['query'][_0x9791('0x47')]){_0x5de9d8['include']=[{'all':!![]}];}_0x5de9d8=_[_0x9791('0x3f')]({},_0x5de9d8,_0x21242e[_0x9791('0x40')]);return db[_0x9791('0x2b')]['find'](_0x5de9d8)[_0x9791('0x24')](handleEntityNotFound(_0x6512a8,null))[_0x9791('0x24')](respondWithResult(_0x6512a8,null))[_0x9791('0x44')](handleError(_0x6512a8,null));};exports['create']=function(_0x230522,_0x29dc19){return db[_0x9791('0x2b')][_0x9791('0x48')](_0x230522[_0x9791('0x49')],{})[_0x9791('0x24')](respondWithResult(_0x29dc19,0xc9))['catch'](handleError(_0x29dc19,null));};exports[_0x9791('0x23')]=function(_0x239682,_0x227314){if(_0x239682[_0x9791('0x49')]['id']){delete _0x239682[_0x9791('0x49')]['id'];}return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x239682[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x227314,null))[_0x9791('0x24')](saveUpdates(_0x239682[_0x9791('0x49')],null))[_0x9791('0x24')](respondWithResult(_0x227314,null))[_0x9791('0x44')](handleError(_0x227314,null));};exports['destroy']=function(_0x5d836c,_0x2affe5){return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x5d836c[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x2affe5,null))['then'](removeEntity(_0x2affe5,null))[_0x9791('0x44')](handleError(_0x2affe5,null));};exports[_0x9791('0x4b')]=function(_0x411208,_0x10aeff){return db[_0x9791('0x2b')][_0x9791('0x4b')]()[_0x9791('0x24')](respondWithResult(_0x10aeff,null))[_0x9791('0x44')](handleError(_0x10aeff,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d7f305e..278fb20 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 _0xcdc9=['../../config/environment','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x188dbb,_0x1d7d93){var _0x5d6e30=function(_0x4748e2){while(--_0x4748e2){_0x188dbb['push'](_0x188dbb['shift']());}};_0x5d6e30(++_0x1d7d93);}(_0xcdc9,0x19f));var _0x9cdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdc9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x9cdc('0x0'));var util=require(_0x9cdc('0x1'));var logger=require(_0x9cdc('0x2'))('api');var moment=require(_0x9cdc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cdc('0x4'));var rimraf=require('rimraf');var config=require(_0x9cdc('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x9cdc('0x6')]=function(_0x57a088,_0x2331d8){return _0x57a088[_0x9cdc('0x7')]('ChatTransferReport',attributes,{'tableName':_0x9cdc('0x8'),'paranoid':![],'indexes':[{'name':_0x9cdc('0x9'),'fields':[_0x9cdc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xece2=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x4b41d7,_0x281be8){var _0x52eecd=function(_0x491658){while(--_0x491658){_0x4b41d7['push'](_0x4b41d7['shift']());}};_0x52eecd(++_0x281be8);}(_0xece2,0x79));var _0x2ece=function(_0x3b3e4c,_0x1a90b7){_0x3b3e4c=_0x3b3e4c-0x0;var _0x53f518=_0xece2[_0x3b3e4c];return _0x53f518;};'use strict';var _=require(_0x2ece('0x0'));var util=require('util');var logger=require(_0x2ece('0x1'))('api');var moment=require(_0x2ece('0x2'));var BPromise=require('bluebird');var rp=require(_0x2ece('0x3'));var fs=require('fs');var path=require(_0x2ece('0x4'));var rimraf=require(_0x2ece('0x5'));var config=require(_0x2ece('0x6'));var attributes=require(_0x2ece('0x7'));module[_0x2ece('0x8')]=function(_0x142ffd,_0x45e030){return _0x142ffd[_0x2ece('0x9')](_0x2ece('0xa'),attributes,{'tableName':_0x2ece('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ece('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a85cfe6..59fd3ac 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 _0x4e3b=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4cf8ff,_0x48eafe){var _0x13fa12=function(_0x270923){while(--_0x270923){_0x4cf8ff['push'](_0x4cf8ff['shift']());}};_0x13fa12(++_0x48eafe);}(_0x4e3b,0x15c));var _0xb4e3=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x4e3b[_0x29632e];return _0x426e04;};'use strict';var _=require(_0xb4e3('0x0'));var util=require(_0xb4e3('0x1'));var moment=require(_0xb4e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4e3('0x4'))['db'];var utils=require(_0xb4e3('0x5'));var logger=require('../../config/logger')(_0xb4e3('0x6'));var config=require(_0xb4e3('0x7'));var jayson=require(_0xb4e3('0x8'));var client=jayson['client'][_0xb4e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16ee9a,_0x25cd72,_0x5e91df){return new BPromise(function(_0x4dd862,_0x48d9b3){return client[_0xb4e3('0xa')](_0x16ee9a,_0x5e91df)[_0xb4e3('0xb')](function(_0x3784bb){logger[_0xb4e3('0xc')](_0xb4e3('0xd'),_0x25cd72,_0xb4e3('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x25cd72,'request\x20sent',JSON[_0xb4e3('0xf')](_0x3784bb));if(_0x3784bb[_0xb4e3('0x10')]){if(_0x3784bb[_0xb4e3('0x10')]['code']===0x1f4){logger[_0xb4e3('0x10')](_0xb4e3('0xd'),_0x25cd72,_0x3784bb['error']['message']);return _0x48d9b3(_0x3784bb[_0xb4e3('0x10')][_0xb4e3('0x11')]);}logger[_0xb4e3('0x10')](_0xb4e3('0xd'),_0x25cd72,_0x3784bb[_0xb4e3('0x10')][_0xb4e3('0x11')]);return _0x4dd862(_0x3784bb['error'][_0xb4e3('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x25cd72,'request\x20sent');_0x4dd862(_0x3784bb[_0xb4e3('0x12')][_0xb4e3('0x11')]);}})[_0xb4e3('0x13')](function(_0x464628){logger[_0xb4e3('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x25cd72,_0x464628);_0x48d9b3(_0x464628);});});} \ No newline at end of file +var _0xcd89=['debug','stringify','error','code','message','catch','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xcd89,0xde));var _0x9cd8=function(_0x5a2e1d,_0x301293){_0x5a2e1d=_0x5a2e1d-0x0;var _0xdde36f=_0xcd89[_0x5a2e1d];return _0xdde36f;};'use strict';var _=require(_0x9cd8('0x0'));var util=require('util');var moment=require(_0x9cd8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cd8('0x2'))['db'];var utils=require(_0x9cd8('0x3'));var logger=require('../../config/logger')(_0x9cd8('0x4'));var config=require(_0x9cd8('0x5'));var jayson=require(_0x9cd8('0x6'));var client=jayson['client'][_0x9cd8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d87ac,_0x5b47d1,_0xab85ad){return new BPromise(function(_0x456420,_0x19b443){return client[_0x9cd8('0x8')](_0x3d87ac,_0xab85ad)[_0x9cd8('0x9')](function(_0x2041b7){logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));logger[_0x9cd8('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b47d1,'request\x20sent',JSON[_0x9cd8('0xd')](_0x2041b7));if(_0x2041b7[_0x9cd8('0xe')]){if(_0x2041b7['error'][_0x9cd8('0xf')]===0x1f4){logger[_0x9cd8('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5b47d1,_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);return _0x19b443(_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);}logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x2041b7[_0x9cd8('0xe')]['message']);return _0x456420(_0x2041b7[_0x9cd8('0xe')]['message']);}else{logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));_0x456420(_0x2041b7['result'][_0x9cd8('0x10')]);}})[_0x9cd8('0x11')](function(_0x5b1061){logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x5b1061);_0x19b443(_0x5b1061);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 4fcb91e..436e6c1 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 _0xd0be=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','delete','destroy'];(function(_0x572bc3,_0xc1b9e1){var _0x1d6401=function(_0x5bfb49){while(--_0x5bfb49){_0x572bc3['push'](_0x572bc3['shift']());}};_0x1d6401(++_0xc1b9e1);}(_0xd0be,0x155));var _0xed0b=function(_0x164d16,_0x2f39a9){_0x164d16=_0x164d16-0x0;var _0x2cff6b=_0xd0be[_0x164d16];return _0x2cff6b;};'use strict';var multer=require(_0xed0b('0x0'));var util=require(_0xed0b('0x1'));var path=require(_0xed0b('0x2'));var timeout=require(_0xed0b('0x3'));var express=require(_0xed0b('0x4'));var router=express[_0xed0b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed0b('0x7'));var controller=require(_0xed0b('0x8'));router[_0xed0b('0x9')]('/',auth['isAuthenticated'](),controller[_0xed0b('0xa')]);router[_0xed0b('0x9')]('/describe',auth[_0xed0b('0xb')](),controller[_0xed0b('0xc')]);router['get'](_0xed0b('0xd'),auth[_0xed0b('0xb')](),controller[_0xed0b('0xe')]);router[_0xed0b('0xf')]('/',auth[_0xed0b('0xb')](),controller['create']);router['put'](_0xed0b('0xd'),auth[_0xed0b('0xb')](),controller[_0xed0b('0x10')]);router[_0xed0b('0x11')](_0xed0b('0xd'),auth['isAuthenticated'](),controller[_0xed0b('0x12')]);module[_0xed0b('0x13')]=router; \ No newline at end of file +var _0x3fee=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x2c398d,_0x1fc888){var _0x29e856=function(_0x149dc4){while(--_0x149dc4){_0x2c398d['push'](_0x2c398d['shift']());}};_0x29e856(++_0x1fc888);}(_0x3fee,0x11f));var _0xe3fe=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3fee[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xe3fe('0x0'));var util=require(_0xe3fe('0x1'));var path=require(_0xe3fe('0x2'));var timeout=require(_0xe3fe('0x3'));var express=require(_0xe3fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe3fe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xe3fe('0x6')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x8')]);router[_0xe3fe('0x6')](_0xe3fe('0x9'),auth['isAuthenticated'](),controller[_0xe3fe('0xa')]);router[_0xe3fe('0x6')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xc')]);router[_0xe3fe('0xd')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xe')]);router[_0xe3fe('0xf')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x10')]);router[_0xe3fe('0x11')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller['destroy']);module[_0xe3fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 589e130..ed4959c 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 _0xf93e=['STRING','address','email','#011F6A','#ffffff','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','BOOLEAN','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xf93e,0x94));var _0xef93=function(_0xa58627,_0x55cd20){_0xa58627=_0xa58627-0x0;var _0x581f40=_0xf93e[_0xa58627];return _0x581f40;};'use strict';var Sequelize=require(_0xef93('0x0'));var rs=require('randomstring');module[_0xef93('0x1')]={'name':{'type':Sequelize[_0xef93('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'unique':_0xef93('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x4')},'mapKeyOffline':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x4')},'key':{'type':Sequelize[_0xef93('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef93('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xef93('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xef93('0x7')]('rounded',_0xef93('0x8')),'defaultValue':_0xef93('0x9')},'header_online':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0xb')},'offline_chat_button':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xef93('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x14')},'placeholderMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x15')},'closingMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x16')},'closingMessageButton':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xc')},'skipMessageButton':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x18')},'ratingType':{'type':Sequelize[_0xef93('0x7')](_0xef93('0x19'),_0xef93('0x1a')),'defaultValue':_0xef93('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return JSON[_0xef93('0x1b')]({'items':[{'type':_0xef93('0x1c'),'variable':null,'config':{'placeholder':_0xef93('0x1d'),'type':_0xef93('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xef93('0x1c'),'props':{'title':_0xef93('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xef93('0x4'),'type':_0xef93('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xef93('0x1f')](_0xef93('0x20'))?JSON[_0xef93('0x21')](this[_0xef93('0x1f')](_0xef93('0x20'))):{};},'set':function(_0x4f93fe){return this['setDataValue']('onlineForm',JSON[_0xef93('0x1b')](_0x4f93fe));}},'offlineForm':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xef93('0x1c'),'props':{'title':_0xef93('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xef93('0x4'),'type':_0xef93('0x4')},'variable':null},{'type':_0xef93('0x22'),'config':{'placeholder':_0xef93('0x23')},'props':{'title':'Comments','helpText':_0xef93('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xef93('0x1f')](_0xef93('0x25'))?JSON[_0xef93('0x21')](this['getDataValue']('offlineForm')):{};},'set':function(_0x549b5e){return this[_0xef93('0x26')](_0xef93('0x25'),JSON['stringify'](_0x549b5e));}},'token':{'type':Sequelize[_0xef93('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xef93('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xef93('0x2')]},'waitingTitle':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x28')},'offlineMessageBody':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xef93('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xef93('0x2')]},'notificationTemplate':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xef93('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef93('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x2c')},'systemAvatar':{'type':Sequelize[_0xef93('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef93('0xe')],'comment':_0xef93('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef93('0x2e'),'set':function(_0x29c470){if(!_0x29c470)this['setDataValue'](_0xef93('0x2f'),null);this[_0xef93('0x26')](_0xef93('0x30'),_0x29c470);}},'vidaooEscalation':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xef93('0x2')]},'vidaooTopic':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x31')},'vidaooNote':{'type':Sequelize[_0xef93('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xef93('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xef93('0x10')]}}; \ No newline at end of file +var _0x16dd=['Chat','Send','Contact\x20us','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','TEXT','name','text','input','getDataValue','onlineForm','parse','stringify','textarea','Comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!'];(function(_0x4f0b97,_0x3ff57b){var _0x4d24b3=function(_0x5333fe){while(--_0x5333fe){_0x4f0b97['push'](_0x4f0b97['shift']());}};_0x4d24b3(++_0x3ff57b);}(_0x16dd,0x144));var _0xd16d=function(_0x4cb048,_0x3eeba5){_0x4cb048=_0x4cb048-0x0;var _0x278aaf=_0x16dd[_0x4cb048];return _0x278aaf;};'use strict';var Sequelize=require(_0xd16d('0x0'));var rs=require('randomstring');module[_0xd16d('0x1')]={'name':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![],'unique':_0xd16d('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'key':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x5')},'customerAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd16d('0xa')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xe')},'download_transcript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xf')},'closingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x10')},'closingMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'skipMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0x11')},'ratingType':{'type':Sequelize[_0xd16d('0xa')]('star',_0xd16d('0x12')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd16d('0x14'),'type':_0xd16d('0x15'),'required':!![]},'props':{'title':_0xd16d('0x14'),'helpText':''}},{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':_0xd16d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd16d('0x17')](_0xd16d('0x18'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x18'))):{};},'set':function(_0x27d3e4){return this['setDataValue'](_0xd16d('0x18'),JSON[_0xd16d('0x1a')](_0x27d3e4));}},'offlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON[_0xd16d('0x1a')]({'items':[{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':'email'},'variable':null},{'type':_0xd16d('0x1b'),'config':{'placeholder':_0xd16d('0x1c')},'props':{'title':_0xd16d('0x1c'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd16d('0x1d'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x1d'))):{};},'set':function(_0x1d5e0c){return this[_0xd16d('0x1e')](_0xd16d('0x1d'),JSON[_0xd16d('0x1a')](_0x1d5e0c));}},'token':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd16d('0x2')]},'forwardOffline':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd16d('0x2')]},'waitingTitle':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x1f')},'waitingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x21')},'offlineMessageBody':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x23')},'skipUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x24')},'sendUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd16d('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd16d('0x25');}},'notificationSound':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x27')},'verticalAlignment':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x28')},'defaultTitle':{'type':Sequelize[_0xd16d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x2a')},'systemAvatar':{'type':Sequelize[_0xd16d('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd16d('0x8')],'comment':_0xd16d('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd16d('0x2c'),'set':function(_0x4a33ba){if(!_0x4a33ba)this[_0xd16d('0x1e')]('mandatoryDispositionPauseId',null);this[_0xd16d('0x1e')](_0xd16d('0x2d'),_0x4a33ba);}},'vidaooEscalation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd16d('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x2e')},'vidaooNote':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return _0xd16d('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd16d('0x13')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e6a038b..3013270 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 _0xf43e=['Applications','account','applications','list','orderBy','customerIp','headers','cf-connecting-ip','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','contact','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-forwarded-for','connection','remoteAddress','replace','render','alignment','color','textColor','color_button','backgroundColor','addApplications','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','findOne','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','user-agent-parser','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0xf43e,0x1c7));var _0xef43=function(_0x3c980f,_0x7c2386){_0x3c980f=_0x3c980f-0x0;var _0x10733f=_0xf43e[_0x3c980f];return _0x10733f;};'use strict';var emlformat=require(_0xef43('0x0'));var rimraf=require(_0xef43('0x1'));var zipdir=require(_0xef43('0x2'));var jsonpatch=require(_0xef43('0x3'));var rp=require(_0xef43('0x4'));var moment=require(_0xef43('0x5'));var BPromise=require(_0xef43('0x6'));var Mustache=require(_0xef43('0x7'));var util=require('util');var path=require(_0xef43('0x8'));var sox=require(_0xef43('0x9'));var csv=require(_0xef43('0xa'));var ejs=require(_0xef43('0xb'));var fs=require('fs');var fs_extra=require(_0xef43('0xc'));var _=require('lodash');var squel=require(_0xef43('0xd'));var crypto=require('crypto');var jsforce=require(_0xef43('0xe'));var deskjs=require(_0xef43('0xf'));var toCsv=require(_0xef43('0xa'));var querystring=require(_0xef43('0x10'));var Papa=require(_0xef43('0x11'));var Redis=require(_0xef43('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xef43('0x13'));var hardwareService=require(_0xef43('0x14'));var logger=require(_0xef43('0x15'))(_0xef43('0x16'));var utils=require(_0xef43('0x17'));var config=require(_0xef43('0x18'));var licenseUtil=require(_0xef43('0x19'));var db=require(_0xef43('0x1a'))['db'];config[_0xef43('0x1b')]=_[_0xef43('0x1c')](config[_0xef43('0x1b')],{'host':_0xef43('0x1d'),'port':0x18eb});var socket=require(_0xef43('0x1e'))(new Redis(config[_0xef43('0x1b')]));require(_0xef43('0x1f'))[_0xef43('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xef43('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0xef43('0x22')]({'port':0x232a});var client9003=jayson[_0xef43('0x21')]['http']({'port':0x232b});var client9001=jayson[_0xef43('0x21')][_0xef43('0x22')]({'port':0x2329});function respondWithRpcPromise(_0xacc112,_0x1f4c3,_0x5b30a6,_0x1b1bc3){return new BPromise(function(_0x2157ca,_0x260c75){var _0x565c81=_0x1b1bc3||client;return _0x565c81['request'](_0xacc112,_0x5b30a6)[_0xef43('0x23')](function(_0x5646f7){logger[_0xef43('0x24')](_0xef43('0x25'),_0x1f4c3,_0xef43('0x26'));logger['debug'](_0xef43('0x27'),_0x1f4c3,'request\x20sent',JSON[_0xef43('0x28')](_0x5646f7));if(_0x5646f7[_0xef43('0x29')]){if(_0x5646f7[_0xef43('0x29')][_0xef43('0x2a')]===0x1f4){logger[_0xef43('0x29')](_0xef43('0x25'),_0x1f4c3,_0x5646f7[_0xef43('0x29')]['message']);return _0x260c75(_0x5646f7[_0xef43('0x29')][_0xef43('0x2b')]);}logger['error'](_0xef43('0x25'),_0x1f4c3,_0x5646f7[_0xef43('0x29')][_0xef43('0x2b')]);return _0x2157ca(_0x5646f7[_0xef43('0x29')]['message']);}else{logger[_0xef43('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1f4c3,_0xef43('0x26'));_0x2157ca(_0x5646f7[_0xef43('0x2c')][_0xef43('0x2b')]);}})[_0xef43('0x2d')](function(_0x200aaf){logger['error'](_0xef43('0x25'),_0x1f4c3,_0x200aaf);_0x260c75(_0x200aaf);});});}function respondWithStatusCode(_0x2f9979,_0x3eff93){_0x3eff93=_0x3eff93||0xcc;return function(_0xfb9cab){if(_0xfb9cab){return _0x2f9979[_0xef43('0x2e')](_0x3eff93);}return _0x2f9979[_0xef43('0x2f')](_0x3eff93)[_0xef43('0x30')]();};}function respondWithResult(_0x49f132,_0x27a1d9){_0x27a1d9=_0x27a1d9||0xc8;return function(_0x1b0ed9){if(_0x1b0ed9){return _0x49f132['status'](_0x27a1d9)[_0xef43('0x31')](_0x1b0ed9);}};}function respondWithFilteredResult(_0x158e7b,_0x23575c){return function(_0x5b5918){if(_0x5b5918){var _0x36c018=typeof _0x23575c['offset']===_0xef43('0x32')&&typeof _0x23575c[_0xef43('0x33')]===_0xef43('0x32');var _0xefd7f9=_0x5b5918['count'];var _0x370807=_0x36c018?0x0:_0x23575c[_0xef43('0x34')];var _0x3bbda0=_0x36c018?_0x5b5918[_0xef43('0x35')]:_0x23575c[_0xef43('0x34')]+_0x23575c['limit'];var _0x228a4f;if(_0x3bbda0>=_0xefd7f9){_0x3bbda0=_0xefd7f9;_0x228a4f=0xc8;}else{_0x228a4f=0xce;}_0x158e7b['status'](_0x228a4f);return _0x158e7b[_0xef43('0x36')]('Content-Range',_0x370807+'-'+_0x3bbda0+'/'+_0xefd7f9)['json'](_0x5b5918);}return null;};}function patchUpdates(_0xd558a0){return function(_0x30ee25){try{jsonpatch[_0xef43('0x37')](_0x30ee25,_0xd558a0,!![]);}catch(_0x26bac4){return BPromise[_0xef43('0x38')](_0x26bac4);}return _0x30ee25[_0xef43('0x39')]();};}function saveUpdates(_0x274c91,_0x49117c){return function(_0x2bc110){if(_0x2bc110){return _0x2bc110[_0xef43('0x3a')](_0x274c91)[_0xef43('0x23')](function(_0x177f47){return _0x177f47;});}return null;};}function removeEntity(_0x2d9d9a,_0x20f7a){return function(_0x47b6af){if(_0x47b6af){return _0x47b6af[_0xef43('0x3b')]()['then'](function(){var _0x17162f=_0x47b6af['get']({'plain':!![]});var _0x323442=_0xef43('0x3c');return db[_0xef43('0x3d')]['destroy']({'where':{'type':_0x323442,'resourceId':_0x17162f['id']}})[_0xef43('0x23')](function(){return _0x47b6af;});})[_0xef43('0x23')](function(){_0x2d9d9a[_0xef43('0x2f')](0xcc)[_0xef43('0x30')]();});}};}function handleEntityNotFound(_0x4585b9,_0x58fde9){return function(_0x226e2f){if(!_0x226e2f){_0x4585b9['sendStatus'](0x194);}return _0x226e2f;};}function handleError(_0x29f89f,_0x13904c){_0x13904c=_0x13904c||0x1f4;return function(_0x15ba4a){logger['error'](_0x15ba4a['stack']);if(_0x15ba4a[_0xef43('0x3e')]){delete _0x15ba4a[_0xef43('0x3e')];}_0x29f89f['status'](_0x13904c)[_0xef43('0x3f')](_0x15ba4a);};}exports[_0xef43('0x40')]=function(_0x1d7374,_0x280632){var _0x47e894={'include':[{'model':db[_0xef43('0x41')],'as':_0xef43('0x42')}]},_0x5bd1ff={},_0x34dd4f={'count':0x0,'rows':[]};var _0x4c0a84=_[_0xef43('0x43')](db[_0xef43('0x44')][_0xef43('0x45')],function(_0x5000cd){return{'name':_0x5000cd[_0xef43('0x46')],'type':_0x5000cd[_0xef43('0x47')][_0xef43('0x48')]};});_0x5bd1ff[_0xef43('0x49')]=_[_0xef43('0x43')](_0x4c0a84,_0xef43('0x3e'));_0x5bd1ff['query']=_['keys'](_0x1d7374[_0xef43('0x4a')]);_0x5bd1ff[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x5bd1ff[_0xef43('0x49')],_0x5bd1ff['query']);_0x47e894[_0xef43('0x4d')]=_['intersection'](_0x5bd1ff['model'],qs[_0xef43('0x4e')](_0x1d7374['query']['fields']));_0x47e894[_0xef43('0x4d')]=_0x47e894['attributes'][_0xef43('0x4f')]?_0x47e894[_0xef43('0x4d')]:_0x5bd1ff['model'];if(!_0x1d7374[_0xef43('0x4a')]['hasOwnProperty'](_0xef43('0x50'))){_0x47e894[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x1d7374[_0xef43('0x4a')]['limit']);_0x47e894[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x1d7374[_0xef43('0x4a')]['offset']);}_0x47e894[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x1d7374['query'][_0xef43('0x52')]);_0x47e894['where']=qs['filters'](_[_0xef43('0x53')](_0x1d7374[_0xef43('0x4a')],_0x5bd1ff[_0xef43('0x4b')]),_0x4c0a84);if(_0x1d7374[_0xef43('0x4a')][_0xef43('0x54')]){_0x47e894[_0xef43('0x55')]=_['merge'](_0x47e894[_0xef43('0x55')],{'$or':_['map'](_0x4c0a84,function(_0x35f00f){if(_0x35f00f[_0xef43('0x47')]!=='VIRTUAL'){var _0x3e9a05={};_0x3e9a05[_0x35f00f['name']]={'$like':'%'+_0x1d7374[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x3e9a05;}})});}_0x47e894=_[_0xef43('0x56')]({},_0x47e894,_0x1d7374[_0xef43('0x57')]);var _0x3d6731={'where':_0x47e894[_0xef43('0x55')]};return db[_0xef43('0x44')]['count'](_0x3d6731)[_0xef43('0x23')](function(_0xa929c2){_0x34dd4f[_0xef43('0x35')]=_0xa929c2;if(_0x1d7374[_0xef43('0x4a')][_0xef43('0x58')]){_0x47e894[_0xef43('0x59')]=[{'all':!![]}];}return db[_0xef43('0x44')]['findAll'](_0x47e894);})[_0xef43('0x23')](function(_0x406d21){_0x34dd4f[_0xef43('0x5a')]=_0x406d21;return _0x34dd4f;})['then'](respondWithFilteredResult(_0x280632,_0x47e894))[_0xef43('0x2d')](handleError(_0x280632,null));};exports['show']=function(_0x36cfe0,_0x2b59bb){var _0x542428={'raw':![],'where':{'id':_0x36cfe0[_0xef43('0x5b')]['id']},'include':[{'model':db[_0xef43('0x41')],'as':_0xef43('0x42')}]},_0xf5cce9={};_0xf5cce9[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x44')][_0xef43('0x45')]);_0xf5cce9[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x36cfe0[_0xef43('0x4a')]);_0xf5cce9['filters']=_['intersection'](_0xf5cce9[_0xef43('0x49')],_0xf5cce9[_0xef43('0x4a')]);_0x542428[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0xf5cce9['model'],qs['fields'](_0x36cfe0['query'][_0xef43('0x4e')]));_0x542428[_0xef43('0x4d')]=_0x542428[_0xef43('0x4d')][_0xef43('0x4f')]?_0x542428[_0xef43('0x4d')]:_0xf5cce9[_0xef43('0x49')];if(_0x36cfe0[_0xef43('0x4a')]['includeAll']){_0x542428['include']=[{'all':!![]}];}_0x542428=_['merge']({},_0x542428,_0x36cfe0['options']);return db[_0xef43('0x44')]['find'](_0x542428)[_0xef43('0x23')](handleEntityNotFound(_0x2b59bb,null))[_0xef43('0x23')](respondWithResult(_0x2b59bb,null))[_0xef43('0x2d')](handleError(_0x2b59bb,null));};exports[_0xef43('0x5d')]=function(_0x48fc9d,_0x2e0c60){return db['ChatWebsite'][_0xef43('0x5d')](_0x48fc9d[_0xef43('0x5e')],{})[_0xef43('0x23')](function(_0x4fca79){var _0x373910=_0x48fc9d[_0xef43('0x5f')][_0xef43('0x60')]({'plain':!![]});if(!_0x373910)throw new Error(_0xef43('0x61'));if(_0x373910[_0xef43('0x62')]===_0xef43('0x5f')){var _0x5b77ee=_0x4fca79[_0xef43('0x60')]({'plain':!![]});var _0x39ae9e=_0xef43('0x3c');return db[_0xef43('0x63')][_0xef43('0x64')]({'where':{'name':_0x39ae9e,'userProfileId':_0x373910[_0xef43('0x65')]},'raw':!![]})[_0xef43('0x23')](function(_0x4bd50b){if(_0x4bd50b&&_0x4bd50b[_0xef43('0x66')]===0x0){return db[_0xef43('0x3d')][_0xef43('0x5d')]({'name':_0x5b77ee[_0xef43('0x3e')],'resourceId':_0x5b77ee['id'],'type':_0x4bd50b[_0xef43('0x3e')],'sectionId':_0x4bd50b['id']},{})[_0xef43('0x23')](function(){return _0x4fca79;});}else{return _0x4fca79;}})[_0xef43('0x2d')](function(_0x1b8248){logger[_0xef43('0x29')](_0xef43('0x67'),_0x1b8248);throw _0x1b8248;});}return _0x4fca79;})[_0xef43('0x23')](respondWithResult(_0x2e0c60,0xc9))[_0xef43('0x2d')](handleError(_0x2e0c60,null));};exports['update']=function(_0x3485a5,_0x2752ac){if(_0x3485a5[_0xef43('0x5e')]['id']){delete _0x3485a5[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x3485a5[_0xef43('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2752ac,null))['then'](saveUpdates(_0x3485a5[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x2752ac,null))['catch'](handleError(_0x2752ac,null));};exports['destroy']=function(_0x18af37,_0x3995d7){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x18af37[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x3995d7,null))[_0xef43('0x23')](removeEntity(_0x3995d7,null))[_0xef43('0x2d')](handleError(_0x3995d7,null));};exports[_0xef43('0x68')]=function(_0x348735,_0x32814f){return db[_0xef43('0x44')][_0xef43('0x68')]()[_0xef43('0x23')](respondWithResult(_0x32814f,null))[_0xef43('0x2d')](handleError(_0x32814f,null));};exports['addDisposition']=function(_0xaa160f,_0x4f8e75,_0x3c4e15){if(_0xaa160f[_0xef43('0x5e')]['id']){delete _0xaa160f[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')]['find']({'where':{'id':_0xaa160f['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x4f8e75,null))['then'](function(_0x28fe29){if(_0x28fe29){_0xaa160f[_0xef43('0x5e')][_0xef43('0x69')]=_0x28fe29['id'];return db[_0xef43('0x6a')][_0xef43('0x5d')](_0xaa160f[_0xef43('0x5e')]);}})[_0xef43('0x23')](respondWithResult(_0x4f8e75,null))[_0xef43('0x2d')](handleError(_0x4f8e75,null));};exports['getDispositions']=function(_0x268949,_0x16fb58,_0x292f1f){var _0x4d3f87={'raw':![],'where':{}};var _0x14e9ad={};var _0x1a1a65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xef43('0x6b')]({'where':{'id':_0x268949[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16fb58,null))['then'](function(_0x29c304){if(_0x29c304){_0x14e9ad[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x6a')][_0xef43('0x45')]);_0x14e9ad[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x268949[_0xef43('0x4a')]);_0x14e9ad[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x14e9ad[_0xef43('0x49')],_0x14e9ad[_0xef43('0x4a')]);_0x4d3f87['attributes']=_['intersection'](_0x14e9ad['model'],qs[_0xef43('0x4e')](_0x268949[_0xef43('0x4a')][_0xef43('0x4e')]));_0x4d3f87[_0xef43('0x4d')]=_0x4d3f87['attributes'][_0xef43('0x4f')]?_0x4d3f87['attributes']:_0x14e9ad['model'];if(!_0x268949[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x4d3f87[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x268949[_0xef43('0x4a')]['limit']);_0x4d3f87[_0xef43('0x34')]=qs['offset'](_0x268949[_0xef43('0x4a')][_0xef43('0x34')]);}_0x4d3f87[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x268949[_0xef43('0x4a')][_0xef43('0x52')]);_0x4d3f87[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x268949[_0xef43('0x4a')],_0x14e9ad[_0xef43('0x4b')]));_0x4d3f87[_0xef43('0x55')][_0xef43('0x69')]=_0x29c304['id'];if(_0x268949['query']['filter']){_0x4d3f87[_0xef43('0x55')]=_[_0xef43('0x56')](_0x4d3f87['where'],{'$or':_[_0xef43('0x43')](_0x4d3f87[_0xef43('0x4d')],function(_0x39d243){var _0x31fe79={};_0x31fe79[_0x39d243]={'$like':'%'+_0x268949[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x31fe79;})});}_0x4d3f87=_[_0xef43('0x56')]({},_0x4d3f87,_0x268949[_0xef43('0x57')]);return db['Disposition']['count']({'where':_0x4d3f87[_0xef43('0x55')]})[_0xef43('0x23')](function(_0x34c9ac){_0x1a1a65['count']=_0x34c9ac;if(_0x268949[_0xef43('0x4a')][_0xef43('0x58')]){_0x4d3f87[_0xef43('0x59')]=[{'all':!![]}];}return db[_0xef43('0x6a')][_0xef43('0x6d')](_0x4d3f87);})[_0xef43('0x23')](function(_0x11f004){_0x1a1a65[_0xef43('0x5a')]=_0x11f004;return _0x1a1a65;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x16fb58,_0x4d3f87))['catch'](handleError(_0x16fb58,null));};exports['removeDispositions']=function(_0x5727c6,_0x622dba,_0x5067d9){return db['ChatWebsite']['find']({'where':{'id':_0x5727c6[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x622dba,null))[_0xef43('0x23')](function(_0xd23b94){if(_0xd23b94){return _0xd23b94[_0xef43('0x6e')](_0x5727c6[_0xef43('0x4a')][_0xef43('0x6f')]);}})[_0xef43('0x23')](respondWithStatusCode(_0x622dba,null))[_0xef43('0x2d')](handleError(_0x622dba,null));};exports[_0xef43('0x70')]=function(_0x4fe2b7,_0x26e360,_0x3ed7bf){if(_0x4fe2b7[_0xef43('0x5e')]['id']){delete _0x4fe2b7[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x4fe2b7['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x26e360,null))['then'](function(_0x24710f){if(_0x24710f){_0x4fe2b7[_0xef43('0x5e')][_0xef43('0x69')]=_0x24710f['id'];return db['CannedAnswer']['create'](_0x4fe2b7[_0xef43('0x5e')]);}})['then'](respondWithResult(_0x26e360,null))[_0xef43('0x2d')](handleError(_0x26e360,null));};exports[_0xef43('0x71')]=function(_0x275a44,_0x886a70,_0xb2af9){var _0x29034b={'raw':![],'where':{}};var _0x64b2b4={};var _0x4e3342={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x275a44[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x886a70,null))[_0xef43('0x23')](function(_0x26988a){if(_0x26988a){_0x64b2b4[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x72')][_0xef43('0x45')]);_0x64b2b4[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x275a44[_0xef43('0x4a')]);_0x64b2b4[_0xef43('0x4b')]=_['intersection'](_0x64b2b4[_0xef43('0x49')],_0x64b2b4[_0xef43('0x4a')]);_0x29034b[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x64b2b4[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x275a44[_0xef43('0x4a')][_0xef43('0x4e')]));_0x29034b[_0xef43('0x4d')]=_0x29034b['attributes']['length']?_0x29034b[_0xef43('0x4d')]:_0x64b2b4[_0xef43('0x49')];if(!_0x275a44[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x29034b['limit']=qs[_0xef43('0x33')](_0x275a44[_0xef43('0x4a')][_0xef43('0x33')]);_0x29034b[_0xef43('0x34')]=qs['offset'](_0x275a44[_0xef43('0x4a')][_0xef43('0x34')]);}_0x29034b[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x275a44['query'][_0xef43('0x52')]);_0x29034b[_0xef43('0x55')]=qs['filters'](_['pick'](_0x275a44[_0xef43('0x4a')],_0x64b2b4[_0xef43('0x4b')]));_0x29034b[_0xef43('0x55')][_0xef43('0x69')]=_0x26988a['id'];if(_0x275a44['query'][_0xef43('0x54')]){_0x29034b['where']=_['merge'](_0x29034b[_0xef43('0x55')],{'$or':_['map'](_0x29034b['attributes'],function(_0x204686){var _0x13d5e8={};_0x13d5e8[_0x204686]={'$like':'%'+_0x275a44[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x13d5e8;})});}_0x29034b=_[_0xef43('0x56')]({},_0x29034b,_0x275a44[_0xef43('0x57')]);return db['CannedAnswer']['count']({'where':_0x29034b[_0xef43('0x55')]})[_0xef43('0x23')](function(_0x221382){_0x4e3342['count']=_0x221382;if(_0x275a44[_0xef43('0x4a')][_0xef43('0x58')]){_0x29034b[_0xef43('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0xef43('0x6d')](_0x29034b);})['then'](function(_0x4ed227){_0x4e3342[_0xef43('0x5a')]=_0x4ed227;return _0x4e3342;});}})['then'](respondWithFilteredResult(_0x886a70,_0x29034b))[_0xef43('0x2d')](handleError(_0x886a70,null));};exports[_0xef43('0x73')]=function(_0x2532b2,_0x2dbde3,_0x38b70d){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x2532b2[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x2dbde3,null))['then'](function(_0xf72e20){if(_0xf72e20){return _0xf72e20[_0xef43('0x73')](_0x2532b2[_0xef43('0x4a')]['ids']);}})[_0xef43('0x23')](respondWithStatusCode(_0x2dbde3,null))['catch'](handleError(_0x2dbde3,null));};exports['addLogo']=function(_0x52fec6,_0x49c602,_0x4d80f9){_0x52fec6[_0xef43('0x5e')][_0xef43('0x74')]=_0x52fec6[_0xef43('0x75')][_0xef43('0x76')];return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x52fec6[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x49c602,null))[_0xef43('0x23')](saveUpdates(_0x52fec6[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x49c602,null))[_0xef43('0x2d')](handleError(_0x49c602,null));};exports[_0xef43('0x77')]=function(_0x36fe72,_0x16aebf,_0x15a268){_0x36fe72[_0xef43('0x5e')][_0xef43('0x78')]=_0x36fe72[_0xef43('0x75')][_0xef43('0x76')];return db['ChatWebsite']['find']({'where':{'id':_0x36fe72[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16aebf,null))['then'](saveUpdates(_0x36fe72[_0xef43('0x5e')],null))['then'](respondWithResult(_0x16aebf,null))[_0xef43('0x2d')](handleError(_0x16aebf,null));};exports[_0xef43('0x79')]=function(_0x40babe,_0x3dd709,_0x4ea999){_0x40babe[_0xef43('0x5e')][_0xef43('0x7a')]=_0x40babe['file'][_0xef43('0x76')];return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x40babe[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3dd709,null))['then'](saveUpdates(_0x40babe[_0xef43('0x5e')],null))['then'](respondWithResult(_0x3dd709,null))[_0xef43('0x2d')](handleError(_0x3dd709,null));};exports[_0xef43('0x7b')]=function(_0x86ea3c,_0x55bb4f,_0x2ca233){_0x86ea3c[_0xef43('0x5e')]['systemAvatar']=_0x86ea3c['file'][_0xef43('0x76')];return db[_0xef43('0x44')]['find']({'where':{'id':_0x86ea3c[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55bb4f,null))[_0xef43('0x23')](saveUpdates(_0x86ea3c[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x55bb4f,null))[_0xef43('0x2d')](handleError(_0x55bb4f,null));};exports[_0xef43('0x7c')]=function(_0xe4139f,_0x315b5d,_0x57b1cc){var _0x2f026c=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x7f'));var _0x4b1ec2={'where':{'id':_0xe4139f[_0xef43('0x5b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x46f5ba=![];return require(_0xef43('0x19'))[_0xef43('0x80')]()['then'](function(_0x27d269){if(_0x27d269){_0x46f5ba=_0x27d269[_0xef43('0x81')];}})['then'](function(){return db['ChatWebsite'][_0xef43('0x64')](_0x4b1ec2);})['then'](handleEntityNotFound(_0x315b5d,null))['then'](function(_0x297e07){if(_0x297e07){if(!_[_0xef43('0x82')](_0x297e07[_0xef43('0x74')])){if(fs[_0xef43('0x83')](path[_0xef43('0x7d')](config['root'],'server/files/images/logos/',_0x297e07[_0xef43('0x74')]))&&_0x46f5ba){_0x2f026c=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x84'),_0x297e07[_0xef43('0x74')]);}}return _0x315b5d[_0xef43('0x85')](_0x2f026c);}})[_0xef43('0x2d')](handleError(_0x315b5d,null));};exports[_0xef43('0x86')]=function(_0x1de6ff,_0x2c99ea,_0x4e9c3a){var _0x3ec9ae=path['join'](config[_0xef43('0x7e')],'server/files/images/avatars/default_avatar.png');var _0x2ea535={'where':{'id':_0x1de6ff[_0xef43('0x5b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x2ea535)[_0xef43('0x23')](handleEntityNotFound(_0x2c99ea,null))[_0xef43('0x23')](function(_0x5b3637){if(_0x5b3637){if(!_[_0xef43('0x82')](_0x5b3637[_0xef43('0x78')])){if(fs['existsSync'](path['join'](config[_0xef43('0x7e')],_0xef43('0x87'),_0x5b3637[_0xef43('0x78')]))){_0x3ec9ae=path[_0xef43('0x7d')](config['root'],_0xef43('0x87'),_0x5b3637[_0xef43('0x78')]);}}return _0x2c99ea[_0xef43('0x85')](_0x3ec9ae);}})[_0xef43('0x2d')](handleError(_0x2c99ea,null));};exports[_0xef43('0x88')]=function(_0x169c11,_0x10c19d,_0x3c911f){var _0x48807f=path['join'](config[_0xef43('0x7e')],_0xef43('0x89'));var _0x3fea5c={'where':{'id':_0x169c11[_0xef43('0x5b')]['id']},'attributes':['id',_0xef43('0x7a'),_0xef43('0x8a')],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x3fea5c)['then'](handleEntityNotFound(_0x10c19d,null))[_0xef43('0x23')](function(_0x41a641){if(_0x41a641){if(!_[_0xef43('0x82')](_0x41a641['customerAvatar'])){if(fs[_0xef43('0x83')](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x41a641[_0xef43('0x7a')]))&&_0x41a641[_0xef43('0x8a')]){_0x48807f=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x41a641[_0xef43('0x7a')]);}}return _0x10c19d[_0xef43('0x85')](_0x48807f);}})[_0xef43('0x2d')](handleError(_0x10c19d,null));};exports['getSystemAvatar']=function(_0x1a8add,_0x39bbef,_0x18c8c3){var _0x1bc8d7=path[_0xef43('0x7d')](config[_0xef43('0x7e')],'server/files/images/avatars/system_avatar.png');var _0x329a85={'where':{'id':_0x1a8add[_0xef43('0x5b')]['id']},'attributes':['id',_0xef43('0x8b')],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x329a85)[_0xef43('0x23')](handleEntityNotFound(_0x39bbef,null))['then'](function(_0x32b1dd){if(_0x32b1dd){if(!_[_0xef43('0x82')](_0x32b1dd[_0xef43('0x8b')])){if(fs[_0xef43('0x83')](path['join'](config[_0xef43('0x7e')],_0xef43('0x87'),_0x32b1dd[_0xef43('0x8b')]))){_0x1bc8d7=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x32b1dd['systemAvatar']);}}return _0x39bbef[_0xef43('0x85')](_0x1bc8d7);}})[_0xef43('0x2d')](handleError(_0x39bbef,null));};exports['notify']=function(_0x1dd6ef,_0x277fc1,_0xa08434){var _0x44665b=require(_0xef43('0x8c'));var _0x130336=new _0x44665b();var _0x46fe9c=_0x130336['setUA'](_0x1dd6ef['headers']['user-agent'])[_0xef43('0x8d')]();var _0x5cd84f={'body':_0x1dd6ef['body'],'channel':_0xef43('0x8e')};var _0x400cd0=[];var _0x27f67b=[];var _0x4b1635={};var _0x36dbae=![];return db[_0xef43('0x8f')][_0xef43('0x68')]()[_0xef43('0x23')](function(_0x2633dd){if(!_0x2633dd){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x92'));}_0x400cd0=_[_0xef43('0x93')](_['keys'](_0x2633dd),['createdAt',_0xef43('0x94')]);_0x27f67b=_['difference'](_[_0xef43('0x5c')](_0x2633dd),[_0xef43('0x95'),_0xef43('0x94'),_0xef43('0x96'),_0xef43('0x97')]);if(_0x1dd6ef[_0xef43('0x5e')]['id']){delete _0x1dd6ef['body']['id'];}if(_[_0xef43('0x82')](_0x1dd6ef['body'][_0xef43('0x98')])){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x99'));}if(_[_0xef43('0x82')](_0x1dd6ef[_0xef43('0x5e')]['body'])||_0x1dd6ef['body'][_0xef43('0x5e')]===''){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xef43('0x82')](_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x9a')])){throw new db[(_0xef43('0x90'))]['ValidationError'](_0xef43('0x9b')+_0x27f67b);}if(!_[_0xef43('0x9c')](_0x27f67b,_0x1dd6ef[_0xef43('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0xef43('0x91'))](_0xef43('0x9d')+_0x27f67b);}_0x4b1635[_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x9a')]]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x98')];})[_0xef43('0x23')](function(){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x1dd6ef[_0xef43('0x5b')]['id']},'include':[{'model':db[_0xef43('0x9e')],'as':_0xef43('0x9f'),'include':[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xa0'),'where':_0x4b1635,'limit':0x1,'order':[[_0xef43('0x94'),_0xef43('0xa1')]]}]},{'model':db[_0xef43('0xa2')],'as':_0xef43('0xa3')}]});})[_0xef43('0x23')](handleEntityNotFound(_0x277fc1,null))[_0xef43('0x23')](function(_0x4de32e){if(_0x4de32e&&_0x4de32e['List']){_0x5cd84f[_0xef43('0xa4')]=_0x4de32e;_0x5cd84f[_0xef43('0xa5')]=_0x4de32e[_0xef43('0xa3')];_0x5cd84f[_0xef43('0xa6')]=_0x4de32e[_0xef43('0x9f')];_0x5cd84f[_0xef43('0xa5')]=_[_0xef43('0xa7')](_0x5cd84f['applications'],['priority'],['asc']);if(_0x5cd84f[_0xef43('0xa4')][_0xef43('0xa3')]){delete _0x5cd84f[_0xef43('0xa4')][_0xef43('0xa3')];}if(_0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')]&&_0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')][_0xef43('0xa0')][_0xef43('0x4f')]){return _0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')]['Contacts'][0x0];}var _0xf7c850=_[_0xef43('0x1c')](_0x1dd6ef[_0xef43('0x5e')],{'firstName':_0x1dd6ef[_0xef43('0x5e')]['from'],'ListId':_0x4de32e[_0xef43('0x97')]});_0xf7c850[_0x1dd6ef['body'][_0xef43('0x9a')]]=_0x1dd6ef['body'][_0xef43('0x98')];return db[_0xef43('0x8f')][_0xef43('0x5d')](_0xf7c850,{'fields':_0x400cd0,'raw':!![]});}})[_0xef43('0x23')](handleEntityNotFound(_0x277fc1,null))[_0xef43('0x23')](function(_0x5b6cd5){_0x5cd84f['contact']=_0x5b6cd5;var _0x17f862=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xa8')];if(_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xaa')]){_0x17f862=_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xaa')];}else if(_0x1dd6ef[_0xef43('0xa9')]['x-forwarded-for']){_0x17f862=_['first'](_0x1dd6ef[_0xef43('0xa9')]['x-forwarded-for']['split'](','));}if(_0x5b6cd5){var _0x9e8494={'ContactId':_0x5b6cd5['id'],'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'from':(_0x5b6cd5[_0xef43('0xab')]||'')+'\x20'+(_0x5b6cd5[_0xef43('0xac')]||''),'customerIp':_0x17f862,'customerPort':_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xad')]?_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xad')]:null,'referer':_0x1dd6ef[_0xef43('0x5e')]['referer'],'browserName':_0x46fe9c[_0xef43('0xae')][_0xef43('0x3e')]&&_0x46fe9c[_0xef43('0xae')][_0xef43('0xaf')]?util[_0xef43('0xb0')]('%s\x20%s',_0x46fe9c[_0xef43('0xae')][_0xef43('0x3e')],_0x46fe9c[_0xef43('0xae')][_0xef43('0xaf')]):_0xef43('0xb1'),'browserVersion':_0x46fe9c['browser']['version']||_0xef43('0xb1'),'osName':util[_0xef43('0xb0')](_0xef43('0xb2'),_0x46fe9c['os'][_0xef43('0x3e')],_0x46fe9c['os'][_0xef43('0xaf')]),'osVersion':_0x46fe9c['os'][_0xef43('0xaf')],'deviceModel':_0x46fe9c['device'][_0xef43('0x49')]&&_0x46fe9c[_0xef43('0xb3')]['vendor']?util[_0xef43('0xb0')](_0xef43('0xb4'),_0x46fe9c[_0xef43('0xb3')][_0xef43('0x49')],_0x46fe9c['device'][_0xef43('0xb5')],_0x46fe9c['device'][_0xef43('0x47')]):null,'deviceVendor':_0x46fe9c[_0xef43('0xb3')][_0xef43('0xb5')],'deviceType':_0x46fe9c[_0xef43('0xb3')][_0xef43('0x47')],'formData':JSON[_0xef43('0x28')](_0x1dd6ef[_0xef43('0x5e')])};var _0x27d1a={'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'closed':![]};if(_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')]){_0x27d1a[_0xef43('0xb6')]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')];return db['ChatInteraction'][_0xef43('0x64')]({'where':_0x27d1a})[_0xef43('0x23')](function(_0xbb04de){if(_0xbb04de){return[_0xbb04de,![]];}_0x9e8494[_0xef43('0xb6')]=_0x1dd6ef['body'][_0xef43('0xb6')];_0x9e8494[_0xef43('0xb7')]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb7')];return db[_0xef43('0xb8')]['create'](_0x9e8494)[_0xef43('0x23')](function(_0x3760b8){return[_0x3760b8,!![]];});});}_0x27d1a[_0xef43('0xb9')]=_0x5b6cd5['id'];if(_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xba')]&&_0x1dd6ef[_0xef43('0x5e')]['interaction']['id']){_0x27d1a['id']=_0x1dd6ef[_0xef43('0x5e')]['interaction']['id'];return db[_0xef43('0xb8')][_0xef43('0x64')]({'where':_0x27d1a})[_0xef43('0x23')](function(_0x1261d6){if(_0x1261d6){return[_0x1261d6,![]];}return db[_0xef43('0xb8')]['create'](_0x9e8494)[_0xef43('0x23')](function(_0x158dc8){return[_0x158dc8,!![]];});});}return db[_0xef43('0xb8')][_0xef43('0x5d')](_0x9e8494)['then'](function(_0x3db783){return[_0x3db783,!![]];});}})['spread'](function(_0x238de5,_0x185d6a){if(_0x238de5){_0x36dbae=_0x185d6a;if(!_0x185d6a){var _0x314a68={'from':(_0x5cd84f[_0xef43('0xbb')][_0xef43('0xab')]||'')+'\x20'+(_0x5cd84f[_0xef43('0xbb')][_0xef43('0xac')]||'')};if(_0x1dd6ef[_0xef43('0x5e')]['threadId']&&_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xbc')]&&_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')]!=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xbc')]){_0x314a68[_0xef43('0xb6')]=_0x1dd6ef[_0xef43('0x5e')]['messageId'];}return _0x238de5[_0xef43('0x3a')](_0x314a68);}else{return _0x238de5;}}})[_0xef43('0x23')](function(_0x2b0425){_0x5cd84f[_0xef43('0xba')]=_0x2b0425[_0xef43('0x60')]({'plain':!![]});_0x5cd84f[_0xef43('0xba')][_0xef43('0xbd')]=_0x36dbae;if(_0x5cd84f[_0xef43('0xba')][_0xef43('0xbd')]){if(_0x5cd84f[_0xef43('0xa4')]['autoclose']){_0x5cd84f[_0xef43('0xa5')]['push']({'id':0x0,'priority':_0x5cd84f[_0xef43('0xa5')][_0xef43('0x4f')]+0x1,'app':_0xef43('0xbe'),'appdata':_0xef43('0xbf'),'interval':_0xef43('0xc0')});}}return db[_0xef43('0xc1')]['create']({'body':_0x1dd6ef[_0xef43('0x5e')]['body'],'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'ChatInteractionId':_0x2b0425['id'],'direction':'in','ContactId':_0x5cd84f[_0xef43('0xbb')]['id'],'AttachmentId':_0x1dd6ef[_0xef43('0x5e')]['AttachmentId']});})[_0xef43('0x23')](function(_0x1d6c6e){_0x5cd84f['message']=_0x1d6c6e;if(_0x5cd84f['interaction'][_0xef43('0xc2')]){return db['User'][_0xef43('0x64')]({'attributes':['id',_0xef43('0x3e')],'where':{'id':_0x5cd84f[_0xef43('0xba')][_0xef43('0xc2')]}})[_0xef43('0x23')](function(_0x179ba8){if(_0x179ba8){_0x5cd84f[_0xef43('0xa5')][_0xef43('0xc3')]({'id':0x0,'priority':0x0,'app':_0xef43('0xc4'),'appdata':_0x179ba8[_0xef43('0x3e')]+','+(_0x5cd84f[_0xef43('0xa4')][_0xef43('0xc5')]||0xa),'interval':_0xef43('0xc0')});_0x5cd84f[_0xef43('0xc6')]=!![];}return respondWithRpcPromise(_0xef43('0xc7'),_0xef43('0xc8'),_0x5cd84f);});}return respondWithRpcPromise(_0xef43('0xc7'),_0xef43('0xc8'),_0x5cd84f);})[_0xef43('0x23')](function(_0x34f43c){respondWithRpcPromise(_0xef43('0xc9'),_0xef43('0xc9'),{'event':_0xef43('0xca'),'message':_0x34f43c},client9002);return _0x34f43c;})['then'](respondWithResult(_0x277fc1,null))[_0xef43('0x2d')](handleError(_0x277fc1,null));};exports[_0xef43('0xcb')]=function(_0xbb5bbb,_0x18d960,_0x599797){var _0x11d576,_0x4bc60d,_0x46f8ae;var _0x1a9c63=[];var _0x329fdb=[];var _0x559c54={};var _0x2f282b=_0xbb5bbb[_0xef43('0xcc')]||[];var _0x48b23d=[];var _0x18d6ac;return db[_0xef43('0x8f')][_0xef43('0x68')]()[_0xef43('0x23')](function(_0x171007){if(!_0x171007){throw new db['Sequelize'][(_0xef43('0x91'))]('no\x20available\x20attributes');}_0x329fdb=_[_0xef43('0x93')](_[_0xef43('0x5c')](_0x171007),['createdAt',_0xef43('0x94')]);_0x1a9c63=_[_0xef43('0x93')](_[_0xef43('0x5c')](_0x171007),['createdAt','updatedAt','CompanyId',_0xef43('0x97')]);if(_0xbb5bbb['body']['id']){delete _0xbb5bbb[_0xef43('0x5e')]['id'];}if(_[_0xef43('0x82')](_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x98')])){throw _0x18d960[_0xef43('0x2f')](0x1f4)[_0xef43('0x3f')](new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x99')));}if(_['isNil'](_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x5e')])||_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x5e')]===''){throw _0x18d960[_0xef43('0x2f')](0x1f4)['send'](new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0xcd')));}if(_[_0xef43('0x82')](_0xbb5bbb['body']['mapKeyOffline'])){throw _0x18d960[_0xef43('0x2f')](0x1f4)[_0xef43('0x3f')](new db['Sequelize'][(_0xef43('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a9c63));}if(!_['includes'](_0x1a9c63,_0xbb5bbb['body'][_0xef43('0xce')])){throw _0x18d960['status'](0x1f4)[_0xef43('0x3f')](new db['Sequelize'][(_0xef43('0x91'))](_0xef43('0xcf')+_0x1a9c63));}_0x559c54[_0xbb5bbb[_0xef43('0x5e')][_0xef43('0xce')]]=_0xbb5bbb['body'][_0xef43('0x98')];})[_0xef43('0x23')](function(){return db[_0xef43('0x44')]['find']({'where':{'id':_0xbb5bbb[_0xef43('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xef43('0x9f')},{'model':db[_0xef43('0xd0')],'as':_0xef43('0xd0')}]});})[_0xef43('0x23')](handleEntityNotFound(_0x18d960,null))[_0xef43('0x23')](function(_0x16a801){if(_0x16a801&&_0x16a801[_0xef43('0x9f')]){_0x4bc60d=_0x16a801;var _0x47dd00=_[_0xef43('0x1c')](_0xbb5bbb[_0xef43('0x5e')],{'firstName':_0xbb5bbb['body']['from'],'phone':_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x98')],'ListId':_0x16a801[_0xef43('0x97')]});_0x47dd00[_0xbb5bbb[_0xef43('0x5e')]['mapKeyOffline']]=_0xbb5bbb[_0xef43('0x5e')]['from'];return db[_0xef43('0x8f')][_0xef43('0xd1')]({'where':_0x559c54,'defaults':_0x47dd00});}})['spread'](function(_0x40a5b3){if(_0x40a5b3){_0x46f8ae=_0x40a5b3;var _0x50a555=fs['readFileSync'](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd2')),_0xef43('0xd3'));var _0x42155d=ejs['render'](_0x50a555,{'body':_['toPairs'](_0xbb5bbb[_0xef43('0x5e')]['body']),'bodyTitle':_0x4bc60d[_0xef43('0xd4')]});return db[_0xef43('0xd5')][_0xef43('0x5d')]({'body':_0x42155d,'ContactId':_0x40a5b3['id'],'ChatWebsiteId':_0x4bc60d['id']});}})['then'](function(_0x3259fb){_0x18d6ac=_0x3259fb;if(_0x2f282b['length']){var _0x41bec6=_0x2f282b[_0xef43('0x43')](function(_0x577cc2){return{'name':_0x577cc2[_0xef43('0xd6')],'basename':_0x577cc2['filename'],'type':_0x577cc2[_0xef43('0xd7')],'ChatOfflineMessageId':_0x3259fb['id']};});_0x48b23d=_0x41bec6[_0xef43('0x43')](_0x3e2e9a=>{var _0x51f683={'filename':_0x3e2e9a[_0xef43('0x3e')],'path':path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd8'),'files',_0xef43('0xd9'),'offline-chat',_0x3e2e9a[_0xef43('0xda')])};return _0x51f683;});if(!_0x4bc60d[_0xef43('0xdb')]){return db[_0xef43('0xdc')][_0xef43('0xdd')](function(_0x9968e4){return db[_0xef43('0xde')][_0xef43('0xdf')](_0x41bec6,{'transaction':_0x9968e4});});}}})[_0xef43('0x23')](function(){if(_0x18d6ac){_0x11d576=_0x18d6ac;return db[_0xef43('0xd0')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xef43('0xe0')],'as':_0xef43('0xe1'),'raw':!![]}]});}})[_0xef43('0x23')](function(_0x3c7fa0){if(_0x3c7fa0&&_0x3c7fa0[_0xef43('0xe1')]&&_0x4bc60d[_0xef43('0xe2')]&&_0x4bc60d[_0xef43('0xe3')]){var _0x2e8a1b={'tls':{'rejectUnauthorized':![]}};if(_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe4')]){_0x2e8a1b[_0xef43('0xe4')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe4')];}else{_0x2e8a1b[_0xef43('0xe5')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe5')];_0x2e8a1b[_0xef43('0xe6')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe6')];_0x2e8a1b['secure']=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe7')];}if(_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe8')]){_0x2e8a1b[_0xef43('0xe9')]={'user':_0x3c7fa0[_0xef43('0xe1')]['user'],'pass':_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xea')]};}return respondWithRpcPromise(_0xef43('0xeb'),_0xef43('0xec'),{'account':_0x2e8a1b,'message':{'from':util[_0xef43('0xb0')]('\x22%s\x22\x20<%s>',_0x3c7fa0[_0xef43('0x3e')],_0x3c7fa0[_0xef43('0xed')]||_0x3c7fa0[_0xef43('0xe1')][_0xef43('0x5f')]),'to':_0x4bc60d[_0xef43('0xe3')],'subject':_0x4bc60d['offlineMessageSubject'],'html':_0x11d576[_0xef43('0x5e')],'attachments':_0x48b23d}},client9003)[_0xef43('0x23')](function(){return _0x11d576;})[_0xef43('0x2d')](function(_0x5cc67f){console[_0xef43('0x29')](_0x5cc67f);});}})[_0xef43('0x23')](function(){if(_0x4bc60d&&_0x4bc60d[_0xef43('0xdb')]&&_0x4bc60d[_0xef43('0xee')]){var _0xfb52d7=[];if(_0x2f282b[_0xef43('0x4f')]){_0xfb52d7=_0x2f282b['map'](function(_0x127984){return{'name':_0x127984[_0xef43('0xd6')],'basename':_0x127984['filename'],'type':_0x127984['mimetype'],'ChatOfflineMessageId':_0x18d6ac['id']};});}var _0x468ff7;if(!_[_0xef43('0x82')](_0x4bc60d[_0xef43('0xef')])){var _0x58cb90=_['map'](_0xbb5bbb[_0xef43('0x5e')],function(_0x1fc5df){return _0x1fc5df;});var _0x2b960c=_[_0xef43('0xf0')](_0x58cb90)[0x0];var _0x41795e=_['mapValues'](_0x2b960c,function(_0x2c273e){return _0x2c273e;});_0x468ff7=_0x41795e[0x1][_0x4bc60d['subjectOffline']];}var _0x5d7919={'from':_0x46f8ae[_0xef43('0xed')],'firstName':_0x46f8ae[_0xef43('0xab')],'lastName':_0x46f8ae['lastName'],'mapKey':_0xef43('0xed'),'message':{'from':_0x46f8ae[_0xef43('0xed')],'to':_0x4bc60d[_0xef43('0xd0')][_0xef43('0xed')],'cc':'','subject':_['isNil'](_0x468ff7)?_0x4bc60d[_0xef43('0xf1')]:_0x468ff7,'messageId':'','sentAt':new Date(),'attach':_0xfb52d7[_0xef43('0x4f')],'attachments':_0xfb52d7,'originChannel':_0xef43('0xf2'),'ChatWebsiteId':_0x4bc60d['id'],'ChatOfflineMessageId':_0x11d576['id'],'originTo':_0x4bc60d[_0xef43('0xd0')][_0xef43('0xed')]},'body':_0x11d576[_0xef43('0x5e')]};var _0x5bb369={'account':{'id':_0x4bc60d[_0xef43('0xee')]},'body':_0x5d7919,'log':_0xef43('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0xef43('0xf4'),_0x5bb369,client9001)[_0xef43('0x23')](function(){return _0x11d576;})['catch'](function(_0x573525){console[_0xef43('0x29')](_0x573525);});}return;})[_0xef43('0x23')](function(){if(_0x11d576){return _0x11d576;}})[_0xef43('0x23')](respondWithResult(_0x18d960,null))[_0xef43('0x2d')](function(_0x3c0b3c){console[_0xef43('0x29')](_0xef43('0x2d'),_0x3c0b3c);for(var _0x2bc0ab of _0x2f282b){var _0x336d2b=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd8'),_0xef43('0xcc'),_0xef43('0xd9'),'offline-chat',_0x2bc0ab[_0xef43('0x76')]);fs_extra[_0xef43('0xf5')](_0x336d2b)[_0xef43('0x2d')](function(_0x2fdc13){console[_0xef43('0x29')](_0xef43('0xf6'),_0x336d2b,_0x2fdc13);});}});};exports[_0xef43('0xf7')]=function(_0x301758,_0x4cd5aa,_0x35e1fe){return db[_0xef43('0xb8')]['find']({'where':{'id':_0x301758['params']['id']}})['then'](handleEntityNotFound(_0x4cd5aa,null))[_0xef43('0x23')](function(_0x103277){if(_0x103277){return _0x103277[_0xef43('0xf7')](_0x301758[_0xef43('0x5e')][_0xef43('0x6f')],_[_0xef43('0xf8')](_0x301758[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{});}})[_0xef43('0x23')](respondWithResult(_0x4cd5aa,null))[_0xef43('0x2d')](handleError(_0x4cd5aa,null));};exports[_0xef43('0xf9')]=function(_0xf1449b,_0x23605a,_0x1f4680){var _0x18c3cf={'raw':![],'where':{}};var _0x1f392f={};var _0x9cbf76={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0xf1449b[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x23605a,null))[_0xef43('0x23')](function(_0x2ec982){if(_0x2ec982){_0x1f392f[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0xb8')][_0xef43('0x45')]);_0x1f392f[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0xf1449b['query']);_0x1f392f[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x1f392f['model'],_0x1f392f[_0xef43('0x4a')]);_0x18c3cf[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x1f392f[_0xef43('0x49')],qs[_0xef43('0x4e')](_0xf1449b['query']['fields']));_0x18c3cf[_0xef43('0x4d')]=_0x18c3cf[_0xef43('0x4d')][_0xef43('0x4f')]?_0x18c3cf[_0xef43('0x4d')]:_0x1f392f[_0xef43('0x49')];if(!_0xf1449b[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x18c3cf['limit']=qs[_0xef43('0x33')](_0xf1449b[_0xef43('0x4a')][_0xef43('0x33')]);_0x18c3cf['offset']=qs['offset'](_0xf1449b['query'][_0xef43('0x34')]);}_0x18c3cf[_0xef43('0x51')]=qs[_0xef43('0x52')](_0xf1449b[_0xef43('0x4a')][_0xef43('0x52')]);_0x18c3cf[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0xf1449b[_0xef43('0x4a')],_0x1f392f[_0xef43('0x4b')]));_0x18c3cf[_0xef43('0x55')][_0xef43('0x69')]=_0x2ec982['id'];if(_0xf1449b['query'][_0xef43('0x54')]){_0x18c3cf[_0xef43('0x55')]=_[_0xef43('0x56')](_0x18c3cf[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x18c3cf['attributes'],function(_0x3faa30){var _0x332eea={};_0x332eea[_0x3faa30]={'$like':'%'+_0xf1449b[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x332eea;})});}_0x18c3cf=_[_0xef43('0x56')]({},_0x18c3cf,_0xf1449b[_0xef43('0x57')]);return db[_0xef43('0xb8')][_0xef43('0x35')]({'where':_0x18c3cf['where']})[_0xef43('0x23')](function(_0x160991){_0x9cbf76[_0xef43('0x35')]=_0x160991;if(_0xf1449b['query']['includeAll']){_0x18c3cf[_0xef43('0x59')]=[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xfa'),'required':![]},{'model':db['User'],'as':_0xef43('0xfb'),'attributes':[_0xef43('0x3e'),_0xef43('0xfc'),_0xef43('0xfd')],'required':![]},{'model':db[_0xef43('0xfe')],'as':_0xef43('0xff'),'attributes':['id','name','color'],'where':_0xf1449b['query'][_0xef43('0x100')]?{'id':_0xf1449b[_0xef43('0x4a')][_0xef43('0x100')]}:undefined,'required':_0xf1449b[_0xef43('0x4a')][_0xef43('0x100')]?!![]:![]}];}return db['ChatInteraction'][_0xef43('0x6d')](_0x18c3cf);})[_0xef43('0x23')](function(_0x3d0662){_0x9cbf76[_0xef43('0x5a')]=_0x3d0662;return _0x9cbf76;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x23605a,_0x18c3cf))['catch'](handleError(_0x23605a,null));};function iftimePromise(_0x52ce76,_0x2d4e17){return respondWithRpcPromise(_0xef43('0x101'),_0xef43('0x102'),{'command':_0x2d4e17[_0xef43('0x103')]?util['format'](_0xef43('0x104'),_0x52ce76[_0xef43('0x105')],_0x2d4e17[_0xef43('0x103')]):util[_0xef43('0xb0')](_0xef43('0x106'),_0x52ce76[_0xef43('0x105')])},client9002)[_0xef43('0x23')](function(_0x4835b5){var _0x22a933=_0x4835b5&&_0x4835b5[_0xef43('0x107')]('true')>=0x0?!![]:![];logger[_0xef43('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2d4e17['id'],_0x52ce76['id'],_0x52ce76[_0xef43('0x105')],_0x22a933?_0xef43('0x108'):_0xef43('0x109'),_0x2d4e17[_0xef43('0x103')]?_0x2d4e17[_0xef43('0x103')]:_0xef43('0x10a'));return _0x22a933;})[_0xef43('0x2d')](function(_0x1aa895){logger[_0xef43('0x29')](_0xef43('0x10b'),_0x2d4e17['id'],_0x52ce76['id'],_0x52ce76[_0xef43('0x105')],util['inspect'](_0x1aa895,{'showHidden':![],'depth':null}),_0x2d4e17['timezone']?_0x2d4e17[_0xef43('0x103')]:_0xef43('0x10a'));return![];});}exports[_0xef43('0x102')]=function(_0x24649a,_0xecfe2b,_0xe35f95){var _0x160853=0x0;var _0x37dee9=0x0;var _0x2eb6d1=![];var _0x3c34a3;var _0x40f07d;return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x24649a['params']['id']},'include':[{'model':db[_0xef43('0x10c')],'as':_0xef43('0x10c'),'include':[{'model':db[_0xef43('0x10c')],'as':_0xef43('0x10d'),'attributes':['id',_0xef43('0x105')],'raw':!![]}]}]})[_0xef43('0x23')](handleEntityNotFound(_0xecfe2b,null))[_0xef43('0x23')](function(_0x14c96c){if(_0x14c96c){_0x3c34a3=_0x14c96c;return _0x14c96c[_0xef43('0x10e')]({'raw':!![]});}})[_0xef43('0x23')](function(_0x3c680e){if(_0x3c34a3){if(_0x3c680e){_0x40f07d=_0x3c680e;}}return require(_0xef43('0x19'))['getLicense']();})[_0xef43('0x23')](function(_0x294169){if(_0x294169){_0x37dee9=_0x294169[_0xef43('0x10f')];_0x2eb6d1=_0x294169[_0xef43('0x81')];}})[_0xef43('0x23')](function(){return db[_0xef43('0xb8')][_0xef43('0x35')]({'where':{'closed':![]}});})[_0xef43('0x23')](function(_0x393691){_0x160853=_0x393691;if(_0x37dee9&&_0x393691>_0x37dee9){return db[_0xef43('0x110')][_0xef43('0x6b')]({'where':{'id':0x1}})[_0xef43('0x23')](function(_0x51a13a){if(_0x51a13a){_0x51a13a['increment'](_0xef43('0x111'));}});}})['then'](function(){if(_0x3c34a3[_0xef43('0x10c')]&&_0x3c34a3[_0xef43('0x10c')][_0xef43('0x10d')]){var _0x46aa09=[];for(var _0x952e87=0x0;_0x952e87<_0x3c34a3[_0xef43('0x10c')]['Intervals'][_0xef43('0x4f')];_0x952e87++){var _0x2d2229=_0x3c34a3[_0xef43('0x10c')][_0xef43('0x10d')][_0x952e87][_0xef43('0x60')]({'plain':!![]});_0x46aa09['push'](iftimePromise(_0x2d2229,_0x3c34a3));}return BPromise[_0xef43('0x112')](_0x46aa09)[_0xef43('0x23')](function(_0x521314){return _[_0xef43('0x113')](_0x521314);});}else{return!![];}})['then'](function(_0x4530b8){var _0x51796c=fs[_0xef43('0x114')](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x115')),'utf8');var _0x3072f6={'remote':_0x3c34a3[_0xef43('0x116')],'query':querystring[_0xef43('0x28')](_[_0xef43('0x56')](_0x3c34a3['get']({'plain':!![]}),{'customerIp':_0x24649a[_0xef43('0xa9')][_0xef43('0x117')]||_0x24649a[_0xef43('0xa9')]['x-real-ip']||_0x24649a[_0xef43('0x118')][_0xef43('0x119')]||_0x24649a['ip'],'referer':_0x24649a[_0xef43('0xa9')]['referer'],'openedInteractions':_0x160853,'maxInteractions':_0x37dee9,'virtual':_0x2eb6d1[_0xef43('0x10f')],'online':_0x4530b8,'custom':_0x2eb6d1}))[_0xef43('0x11a')](/'/g,'\x5c\x27')};_0xecfe2b[_0xef43('0x3f')](ejs[_0xef43('0x11b')](Mustache[_0xef43('0x11b')](_0x51796c,_0x3072f6),{'proactiveActions':_0x40f07d,'alignment':_0x3c34a3[_0xef43('0x11c')],'verticalAlignment':_0x3c34a3['verticalAlignment'],'div_color':_0x3c34a3[_0xef43('0x11d')],'text_color':_0x3c34a3[_0xef43('0x11e')],'button_color':_0x3c34a3[_0xef43('0x11f')],'background_color':_0x3c34a3[_0xef43('0x120')]}));})['catch'](handleError(_0xecfe2b,null));};exports[_0xef43('0x121')]=function(_0x1d1fca,_0x246354,_0x5617a7){return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x1d1fca['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x246354,null))[_0xef43('0x23')](function(_0x88a076){if(_0x88a076){return db['sequelize'][_0xef43('0xdd')](function(_0x28031b){return db[_0xef43('0xa2')][_0xef43('0x3b')]({'where':{'ChatWebsiteId':_0x1d1fca['params']['id']},'transaction':_0x28031b})[_0xef43('0x23')](function(_0x323aee){var _0x54dcec=_['map'](_0x1d1fca[_0xef43('0x5e')],function(_0x339349){_0x339349[_0xef43('0x69')]=_0x1d1fca[_0xef43('0x5b')]['id'];return _0x339349;});return db[_0xef43('0xa2')][_0xef43('0xdf')](_0x54dcec,{'transaction':_0x28031b});});})[_0xef43('0x23')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x1d1fca[_0xef43('0x5b')]['id']},'order':_0xef43('0x122')});});}})[_0xef43('0x23')](respondWithResult(_0x246354,null))[_0xef43('0x2d')](handleError(_0x246354,null));};exports['getApplications']=function(_0x33435f,_0x406308,_0x540380){var _0x551961={};var _0x59cd56={};var _0x3079c0;var _0x69f270;return db['ChatWebsite'][_0xef43('0x6b')]({'where':{'id':_0x33435f[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x406308,null))[_0xef43('0x23')](function(_0xb8c45d){if(_0xb8c45d){_0x3079c0=_0xb8c45d;_0x59cd56[_0xef43('0x49')]=_['keys'](db[_0xef43('0xa2')][_0xef43('0x45')]);_0x59cd56[_0xef43('0x4a')]=_['keys'](_0x33435f[_0xef43('0x4a')]);_0x59cd56[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x59cd56[_0xef43('0x49')],_0x59cd56[_0xef43('0x4a')]);_0x551961['attributes']=_[_0xef43('0x4c')](_0x59cd56[_0xef43('0x49')],qs['fields'](_0x33435f['query'][_0xef43('0x4e')]));_0x551961[_0xef43('0x4d')]=_0x551961['attributes'][_0xef43('0x4f')]?_0x551961[_0xef43('0x4d')]:_0x59cd56[_0xef43('0x49')];_0x551961['order']=qs['sort'](_0x33435f[_0xef43('0x4a')]['sort']);_0x551961['where']=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x33435f[_0xef43('0x4a')],_0x59cd56['filters']));if(_0x33435f['query']['filter']){_0x551961[_0xef43('0x55')]=_['merge'](_0x551961[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x551961[_0xef43('0x4d')],function(_0x3449b8){var _0x5e0fad={};_0x5e0fad[_0x3449b8]={'$like':'%'+_0x33435f[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x5e0fad;})});}_0x551961=_[_0xef43('0x56')]({},_0x551961,_0x33435f['options']);return _0x3079c0[_0xef43('0x123')](_0x551961);}})[_0xef43('0x23')](function(_0x295b00){if(_0x295b00){_0x69f270=_0x295b00['length'];if(!_0x33435f['query'][_0xef43('0x6c')]('nolimit')){_0x551961[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x33435f[_0xef43('0x4a')]['limit']);_0x551961[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x33435f[_0xef43('0x4a')][_0xef43('0x34')]);}return _0x3079c0[_0xef43('0x123')](_0x551961);}})['then'](function(_0x147aef){if(_0x147aef){return _0x147aef?{'count':_0x69f270,'rows':_0x147aef}:null;}})['then'](respondWithResult(_0x406308,null))[_0xef43('0x2d')](handleError(_0x406308,null));};exports[_0xef43('0x124')]=function(_0x4734e7,_0x26e821,_0x25cae3){return db['chatProactiveAction'][_0xef43('0x64')]({'where':{'id':_0x4734e7[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x26e821,null))[_0xef43('0x23')](function(_0x2d11fa){if(_0x2d11fa){return _0x2d11fa[_0xef43('0x124')](_0x4734e7[_0xef43('0x5e')][_0xef43('0x6f')],_['omit'](_0x4734e7[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{});}})[_0xef43('0x23')](respondWithResult(_0x26e821,null))[_0xef43('0x2d')](handleError(_0x26e821,null));};exports[_0xef43('0x10e')]=function(_0x571f84,_0x489123,_0x2aaa14){var _0x41dab1={};var _0x4de597={};var _0x11b5f0;var _0x409157;return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x571f84[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x489123,null))['then'](function(_0x540c83){if(_0x540c83){_0x11b5f0=_0x540c83;_0x4de597['model']=_['keys'](db[_0xef43('0x125')][_0xef43('0x45')]);_0x4de597[_0xef43('0x4a')]=_['keys'](_0x571f84[_0xef43('0x4a')]);_0x4de597['filters']=_[_0xef43('0x4c')](_0x4de597['model'],_0x4de597[_0xef43('0x4a')]);_0x41dab1[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x4de597[_0xef43('0x49')],qs['fields'](_0x571f84[_0xef43('0x4a')][_0xef43('0x4e')]));_0x41dab1[_0xef43('0x4d')]=_0x41dab1[_0xef43('0x4d')][_0xef43('0x4f')]?_0x41dab1[_0xef43('0x4d')]:_0x4de597[_0xef43('0x49')];_0x41dab1[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x571f84[_0xef43('0x4a')]['sort']);_0x41dab1[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x571f84[_0xef43('0x4a')],_0x4de597[_0xef43('0x4b')]));if(_0x571f84['query'][_0xef43('0x54')]){_0x41dab1[_0xef43('0x55')]=_[_0xef43('0x56')](_0x41dab1['where'],{'$or':_[_0xef43('0x43')](_0x41dab1[_0xef43('0x4d')],function(_0x2fec3f){var _0x49362c={};_0x49362c[_0x2fec3f]={'$like':'%'+_0x571f84['query']['filter']+'%'};return _0x49362c;})});}_0x41dab1=_[_0xef43('0x56')]({},_0x41dab1,_0x571f84['options']);return _0x11b5f0[_0xef43('0x10e')](_0x41dab1);}})[_0xef43('0x23')](function(_0x406571){if(_0x406571){_0x409157=_0x406571[_0xef43('0x4f')];if(!_0x571f84[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x41dab1[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x571f84[_0xef43('0x4a')][_0xef43('0x33')]);_0x41dab1[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x571f84['query']['offset']);}return _0x11b5f0[_0xef43('0x10e')](_0x41dab1);}})[_0xef43('0x23')](function(_0x2ec050){if(_0x2ec050){return _0x2ec050?{'count':_0x409157,'rows':_0x2ec050}:null;}})[_0xef43('0x23')](respondWithResult(_0x489123,null))[_0xef43('0x2d')](handleError(_0x489123,null));};exports[_0xef43('0x126')]=function(_0x1a44cd,_0x9a97c,_0x596e27){var _0x2089b8=_0x1a44cd['query'][_0xef43('0x127')]==='false'?_0xef43('0x128'):_0xef43('0x129');return db[_0xef43('0x44')][_0xef43('0x64')]({'attributes':['id',_0x2089b8],'where':{'id':_0x1a44cd[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9a97c,null))[_0xef43('0x23')](function(_0x47d53f){if(_0x47d53f){var _0x5e1a6e=_0x47d53f[_0x2089b8];var _0x126ea5=_0x5e1a6e&&_0x5e1a6e[_0xef43('0x12a')]?_0x5e1a6e[_0xef43('0x12a')]:[];_0x9a97c[_0xef43('0x3f')]({'fromKey':_[_0xef43('0x82')](_0x5e1a6e[_0xef43('0x12b')])?undefined:_0x5e1a6e['fromKey'],'count':_0x126ea5['length'],'rows':_0x126ea5});}})['catch'](handleError(_0x9a97c,null));};exports[_0xef43('0x12c')]=function(_0x56614e,_0x57834a,_0x535f5d){var _0x3c9407={'raw':![],'where':{}};var _0x3d9a5c={};var _0x2ad057={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x56614e['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x57834a,null))['then'](function(_0x27e951){if(_0x27e951){_0x3d9a5c['model']=_['keys'](db['ChatOfflineMessage'][_0xef43('0x45')]);_0x3d9a5c['query']=_['keys'](_0x56614e[_0xef43('0x4a')]);_0x3d9a5c[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x3d9a5c[_0xef43('0x49')],_0x3d9a5c[_0xef43('0x4a')]);_0x3c9407[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x3d9a5c[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x56614e[_0xef43('0x4a')][_0xef43('0x4e')]));_0x3c9407[_0xef43('0x4d')]=_0x3c9407['attributes'][_0xef43('0x4f')]?_0x3c9407['attributes']:_0x3d9a5c[_0xef43('0x49')];if(!_0x56614e[_0xef43('0x4a')]['hasOwnProperty'](_0xef43('0x50'))){_0x3c9407[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x56614e[_0xef43('0x4a')][_0xef43('0x33')]);_0x3c9407[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x56614e['query'][_0xef43('0x34')]);}_0x3c9407['order']=qs[_0xef43('0x52')](_0x56614e[_0xef43('0x4a')]['sort']);_0x3c9407[_0xef43('0x55')]=qs['filters'](_[_0xef43('0x53')](_0x56614e[_0xef43('0x4a')],_0x3d9a5c[_0xef43('0x4b')]));_0x3c9407[_0xef43('0x55')][_0xef43('0x69')]=_0x27e951['id'];if(_0x56614e[_0xef43('0x4a')][_0xef43('0x54')]){_0x3c9407['where']=_[_0xef43('0x56')](_0x3c9407[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x3c9407['attributes'],function(_0x23deec){var _0x198197={};_0x198197[_0x23deec]={'$like':'%'+_0x56614e[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x198197;})});}_0x3c9407=_[_0xef43('0x56')]({},_0x3c9407,_0x56614e[_0xef43('0x57')]);return db[_0xef43('0xd5')][_0xef43('0x35')]({'where':_0x3c9407['where']})[_0xef43('0x23')](function(_0x55f789){_0x2ad057['count']=_0x55f789;if(_0x56614e[_0xef43('0x4a')]['includeAll']){_0x3c9407['include']=[{'all':!![]}];}else{_0x3c9407[_0xef43('0x59')]=[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xfa'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xef43('0xd5')]['findAll'](_0x3c9407);})[_0xef43('0x23')](function(_0xd5eb1a){_0x2ad057['rows']=_0xd5eb1a;return _0x2ad057;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x57834a,_0x3c9407))[_0xef43('0x2d')](handleError(_0x57834a,null));};exports[_0xef43('0x12d')]=function(_0x38fd26,_0x1553ba,_0x2394f0){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x38fd26['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x1553ba,null))[_0xef43('0x23')](function(_0x83e63c){if(_0x83e63c){return _0x83e63c[_0xef43('0x12d')](_0x38fd26[_0xef43('0x5e')][_0xef43('0x6f')],_['omit'](_0x38fd26[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{})[_0xef43('0x12e')](function(_0x3fd086){for(var _0x4eb7e6=0x0;_0x4eb7e6<_0x38fd26['body']['ids'][_0xef43('0x4f')];_0x4eb7e6+=0x1){socket[_0xef43('0x12f')](_0xef43('0x130'),{'UserId':Number(_0x38fd26['body']['ids'][_0x4eb7e6]),'ChatWebsiteId':Number(_0x38fd26['params']['id'])});}return _0x3fd086;});}})[_0xef43('0x23')](respondWithResult(_0x1553ba,null))[_0xef43('0x2d')](handleError(_0x1553ba,null));};exports['removeAgents']=function(_0x23cf0e,_0x48040d,_0x17c674){return db[_0xef43('0x44')]['find']({'where':{'id':_0x23cf0e['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x48040d,null))['then'](function(_0x26c87a){if(_0x26c87a){return _0x26c87a['removeAgents'](_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')])[_0xef43('0x23')](function(){if(_[_0xef43('0x131')](_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')])){for(var _0x5a9f34=0x0;_0x5a9f34<_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')]['length'];_0x5a9f34+=0x1){socket[_0xef43('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')][_0x5a9f34]),'ChatWebsiteId':Number(_0x23cf0e[_0xef43('0x5b')]['id'])});}}else{socket[_0xef43('0x12f')](_0xef43('0x132'),{'UserId':Number(_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')]),'ChatWebsiteId':Number(_0x23cf0e['params']['id'])});}});}})[_0xef43('0x23')](respondWithStatusCode(_0x48040d,null))['catch'](handleError(_0x48040d,null));};exports[_0xef43('0x133')]=function(_0x92122e,_0x126454,_0x439a42){var _0x53cbd3={};var _0x57527d={};var _0x2542c3;var _0x4a04df;return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x92122e[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x126454,null))['then'](function(_0xe169ca){if(_0xe169ca){_0x2542c3=_0xe169ca;_0x57527d[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x134')]['rawAttributes']);_0x57527d[_0xef43('0x4a')]=_['keys'](_0x92122e['query']);_0x57527d[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x57527d['model'],_0x57527d[_0xef43('0x4a')]);_0x53cbd3[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x57527d[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x92122e[_0xef43('0x4a')][_0xef43('0x4e')]));_0x53cbd3['attributes']=_0x53cbd3[_0xef43('0x4d')][_0xef43('0x4f')]?_0x53cbd3[_0xef43('0x4d')]:_0x57527d[_0xef43('0x49')];_0x53cbd3['order']=qs['sort'](_0x92122e[_0xef43('0x4a')]['sort']);_0x53cbd3[_0xef43('0x55')]=qs[_0xef43('0x4b')](_['pick'](_0x92122e[_0xef43('0x4a')],_0x57527d[_0xef43('0x4b')]));if(_0x92122e[_0xef43('0x4a')][_0xef43('0x54')]){_0x53cbd3['where']=_['merge'](_0x53cbd3[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x53cbd3[_0xef43('0x4d')],function(_0x1d5d1a){var _0x320068={};_0x320068[_0x1d5d1a]={'$like':'%'+_0x92122e['query']['filter']+'%'};return _0x320068;})});}_0x53cbd3=_[_0xef43('0x56')]({},_0x53cbd3,_0x92122e['options']);return _0x2542c3['getAgents'](_0x53cbd3);}})[_0xef43('0x23')](function(_0x568eb7){if(_0x568eb7){_0x4a04df=_0x568eb7[_0xef43('0x4f')];if(!_0x92122e[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x53cbd3['limit']=qs[_0xef43('0x33')](_0x92122e[_0xef43('0x4a')]['limit']);_0x53cbd3[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x92122e['query'][_0xef43('0x34')]);}return _0x2542c3[_0xef43('0x133')](_0x53cbd3);}})['then'](function(_0x1c5693){if(_0x1c5693){return _0x1c5693?{'count':_0x4a04df,'rows':_0x1c5693}:null;}})[_0xef43('0x23')](respondWithResult(_0x126454,null))[_0xef43('0x2d')](handleError(_0x126454,null));}; \ No newline at end of file +var _0xc04f=['color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','findOne','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','ChatWebsite','rows','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','asc','from','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','sendMail','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags'];(function(_0x160085,_0x5c8fd2){var _0x2f61d3=function(_0x374fba){while(--_0x374fba){_0x160085['push'](_0x160085['shift']());}};_0x2f61d3(++_0x5c8fd2);}(_0xc04f,0x165));var _0xfc04=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0xc04f[_0x2331f8];return _0x244773;};'use strict';var emlformat=require(_0xfc04('0x0'));var rimraf=require(_0xfc04('0x1'));var zipdir=require(_0xfc04('0x2'));var jsonpatch=require(_0xfc04('0x3'));var rp=require(_0xfc04('0x4'));var moment=require(_0xfc04('0x5'));var BPromise=require(_0xfc04('0x6'));var Mustache=require(_0xfc04('0x7'));var util=require('util');var path=require('path');var sox=require(_0xfc04('0x8'));var csv=require(_0xfc04('0x9'));var ejs=require(_0xfc04('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc04('0xb'));var squel=require(_0xfc04('0xc'));var crypto=require('crypto');var jsforce=require(_0xfc04('0xd'));var deskjs=require(_0xfc04('0xe'));var toCsv=require(_0xfc04('0x9'));var querystring=require(_0xfc04('0xf'));var Papa=require(_0xfc04('0x10'));var Redis=require(_0xfc04('0x11'));var authService=require(_0xfc04('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc04('0x13'));var logger=require('../../config/logger')(_0xfc04('0x14'));var utils=require(_0xfc04('0x15'));var config=require(_0xfc04('0x16'));var licenseUtil=require(_0xfc04('0x17'));var db=require(_0xfc04('0x18'))['db'];config[_0xfc04('0x19')]=_[_0xfc04('0x1a')](config[_0xfc04('0x19')],{'host':_0xfc04('0x1b'),'port':0x18eb});var socket=require(_0xfc04('0x1c'))(new Redis(config[_0xfc04('0x19')]));require(_0xfc04('0x1d'))[_0xfc04('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfc04('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xfc04('0x1f')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0xfc04('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5df5bb,_0x5e8c00,_0x39b177,_0x3e1aa1){return new BPromise(function(_0x13f951,_0x403f70){var _0x46162d=_0x3e1aa1||client;return _0x46162d[_0xfc04('0x21')](_0x5df5bb,_0x39b177)[_0xfc04('0x22')](function(_0x31d2e5){logger[_0xfc04('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5e8c00,_0xfc04('0x24'));logger[_0xfc04('0x25')](_0xfc04('0x26'),_0x5e8c00,_0xfc04('0x24'),JSON['stringify'](_0x31d2e5));if(_0x31d2e5[_0xfc04('0x27')]){if(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x28')]===0x1f4){logger['error'](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x403f70(_0x31d2e5[_0xfc04('0x27')]['message']);}logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x13f951(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x2a')]);}else{logger['info'](_0xfc04('0x29'),_0x5e8c00,'request\x20sent');_0x13f951(_0x31d2e5[_0xfc04('0x2b')][_0xfc04('0x2a')]);}})[_0xfc04('0x2c')](function(_0x3579f1){logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x3579f1);_0x403f70(_0x3579f1);});});}function respondWithStatusCode(_0x7224d0,_0x2ae4a2){_0x2ae4a2=_0x2ae4a2||0xcc;return function(_0x5f09ba){if(_0x5f09ba){return _0x7224d0['sendStatus'](_0x2ae4a2);}return _0x7224d0[_0xfc04('0x2d')](_0x2ae4a2)[_0xfc04('0x2e')]();};}function respondWithResult(_0x3fdbed,_0x2b8264){_0x2b8264=_0x2b8264||0xc8;return function(_0x1fd986){if(_0x1fd986){return _0x3fdbed[_0xfc04('0x2d')](_0x2b8264)[_0xfc04('0x2f')](_0x1fd986);}};}function respondWithFilteredResult(_0x5ea5d1,_0x42525e){return function(_0x5d2b36){if(_0x5d2b36){var _0x44b659=typeof _0x42525e[_0xfc04('0x30')]===_0xfc04('0x31')&&typeof _0x42525e[_0xfc04('0x32')]===_0xfc04('0x31');var _0x3bbd4f=_0x5d2b36[_0xfc04('0x33')];var _0x48c848=_0x44b659?0x0:_0x42525e[_0xfc04('0x30')];var _0x202c61=_0x44b659?_0x5d2b36[_0xfc04('0x33')]:_0x42525e[_0xfc04('0x30')]+_0x42525e['limit'];var _0x5bbbc2;if(_0x202c61>=_0x3bbd4f){_0x202c61=_0x3bbd4f;_0x5bbbc2=0xc8;}else{_0x5bbbc2=0xce;}_0x5ea5d1[_0xfc04('0x2d')](_0x5bbbc2);return _0x5ea5d1['set'](_0xfc04('0x34'),_0x48c848+'-'+_0x202c61+'/'+_0x3bbd4f)[_0xfc04('0x2f')](_0x5d2b36);}return null;};}function patchUpdates(_0x390d1d){return function(_0x2e0d36){try{jsonpatch[_0xfc04('0x35')](_0x2e0d36,_0x390d1d,!![]);}catch(_0xab5f87){return BPromise[_0xfc04('0x36')](_0xab5f87);}return _0x2e0d36[_0xfc04('0x37')]();};}function saveUpdates(_0x530af7,_0x833d8){return function(_0x18f868){if(_0x18f868){return _0x18f868[_0xfc04('0x38')](_0x530af7)['then'](function(_0x142e54){return _0x142e54;});}return null;};}function removeEntity(_0x1b80f0,_0x29b787){return function(_0x5ebfce){if(_0x5ebfce){return _0x5ebfce[_0xfc04('0x39')]()[_0xfc04('0x22')](function(){var _0x29fc1d=_0x5ebfce[_0xfc04('0x3a')]({'plain':!![]});var _0x5abaaa='ChatWebsites';return db[_0xfc04('0x3b')][_0xfc04('0x39')]({'where':{'type':_0x5abaaa,'resourceId':_0x29fc1d['id']}})[_0xfc04('0x22')](function(){return _0x5ebfce;});})[_0xfc04('0x22')](function(){_0x1b80f0[_0xfc04('0x2d')](0xcc)[_0xfc04('0x2e')]();});}};}function handleEntityNotFound(_0x3e050e,_0x10adf4){return function(_0xf8870c){if(!_0xf8870c){_0x3e050e[_0xfc04('0x3c')](0x194);}return _0xf8870c;};}function handleError(_0x52576e,_0x34c3fe){_0x34c3fe=_0x34c3fe||0x1f4;return function(_0xacb3de){logger['error'](_0xacb3de[_0xfc04('0x3d')]);if(_0xacb3de[_0xfc04('0x3e')]){delete _0xacb3de[_0xfc04('0x3e')];}_0x52576e[_0xfc04('0x2d')](_0x34c3fe)[_0xfc04('0x3f')](_0xacb3de);};}exports[_0xfc04('0x40')]=function(_0x20863d,_0x57cef0){var _0x2b0a7e={'include':[{'model':db[_0xfc04('0x41')],'as':'mandatoryDispositionPause'}]},_0x120424={},_0x4b539b={'count':0x0,'rows':[]};var _0x4a6285=_[_0xfc04('0x42')](db['ChatWebsite'][_0xfc04('0x43')],function(_0x38309e){return{'name':_0x38309e[_0xfc04('0x44')],'type':_0x38309e['type'][_0xfc04('0x45')]};});_0x120424[_0xfc04('0x46')]=_['map'](_0x4a6285,_0xfc04('0x3e'));_0x120424[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x20863d[_0xfc04('0x47')]);_0x120424[_0xfc04('0x49')]=_['intersection'](_0x120424[_0xfc04('0x46')],_0x120424[_0xfc04('0x47')]);_0x2b0a7e['attributes']=_[_0xfc04('0x4a')](_0x120424['model'],qs[_0xfc04('0x4b')](_0x20863d['query'][_0xfc04('0x4b')]));_0x2b0a7e[_0xfc04('0x4c')]=_0x2b0a7e['attributes'][_0xfc04('0x4d')]?_0x2b0a7e['attributes']:_0x120424[_0xfc04('0x46')];if(!_0x20863d[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x2b0a7e[_0xfc04('0x32')]=qs['limit'](_0x20863d['query'][_0xfc04('0x32')]);_0x2b0a7e[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x20863d[_0xfc04('0x47')]['offset']);}_0x2b0a7e[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x20863d[_0xfc04('0x47')][_0xfc04('0x51')]);_0x2b0a7e[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x20863d[_0xfc04('0x47')],_0x120424[_0xfc04('0x49')]),_0x4a6285);if(_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x2b0a7e[_0xfc04('0x52')]=_['merge'](_0x2b0a7e['where'],{'$or':_[_0xfc04('0x42')](_0x4a6285,function(_0x4bd8cf){if(_0x4bd8cf[_0xfc04('0x55')]!==_0xfc04('0x56')){var _0x137b2c={};_0x137b2c[_0x4bd8cf[_0xfc04('0x3e')]]={'$like':'%'+_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x137b2c;}})});}_0x2b0a7e=_[_0xfc04('0x57')]({},_0x2b0a7e,_0x20863d[_0xfc04('0x58')]);var _0x57ee42={'where':_0x2b0a7e[_0xfc04('0x52')]};return db['ChatWebsite'][_0xfc04('0x33')](_0x57ee42)[_0xfc04('0x22')](function(_0x4eb103){_0x4b539b['count']=_0x4eb103;if(_0x20863d['query'][_0xfc04('0x59')]){_0x2b0a7e['include']=[{'all':!![]}];}return db[_0xfc04('0x5a')]['findAll'](_0x2b0a7e);})['then'](function(_0x586975){_0x4b539b[_0xfc04('0x5b')]=_0x586975;return _0x4b539b;})[_0xfc04('0x22')](respondWithFilteredResult(_0x57cef0,_0x2b0a7e))[_0xfc04('0x2c')](handleError(_0x57cef0,null));};exports[_0xfc04('0x5c')]=function(_0x19ca83,_0x5e090a){var _0x3ec12b={'raw':![],'where':{'id':_0x19ca83[_0xfc04('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2300a0={};_0x2300a0[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x5a')][_0xfc04('0x43')]);_0x2300a0[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x19ca83['query']);_0x2300a0['filters']=_['intersection'](_0x2300a0['model'],_0x2300a0['query']);_0x3ec12b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2300a0['model'],qs[_0xfc04('0x4b')](_0x19ca83['query']['fields']));_0x3ec12b[_0xfc04('0x4c')]=_0x3ec12b[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x3ec12b['attributes']:_0x2300a0[_0xfc04('0x46')];if(_0x19ca83[_0xfc04('0x47')][_0xfc04('0x59')]){_0x3ec12b[_0xfc04('0x5e')]=[{'all':!![]}];}_0x3ec12b=_[_0xfc04('0x57')]({},_0x3ec12b,_0x19ca83['options']);return db[_0xfc04('0x5a')]['find'](_0x3ec12b)[_0xfc04('0x22')](handleEntityNotFound(_0x5e090a,null))['then'](respondWithResult(_0x5e090a,null))['catch'](handleError(_0x5e090a,null));};exports[_0xfc04('0x5f')]=function(_0x171ced,_0x7445de){return db['ChatWebsite'][_0xfc04('0x5f')](_0x171ced['body'],{})[_0xfc04('0x22')](function(_0x1d2d66){var _0x10f94a=_0x171ced[_0xfc04('0x60')]['get']({'plain':!![]});if(!_0x10f94a)throw new Error(_0xfc04('0x61'));if(_0x10f94a[_0xfc04('0x62')]===_0xfc04('0x60')){var _0x5854c0=_0x1d2d66[_0xfc04('0x3a')]({'plain':!![]});var _0x1ed749='ChatWebsites';return db['UserProfileSection'][_0xfc04('0x63')]({'where':{'name':_0x1ed749,'userProfileId':_0x10f94a[_0xfc04('0x64')]},'raw':!![]})[_0xfc04('0x22')](function(_0x51569e){if(_0x51569e&&_0x51569e[_0xfc04('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x5854c0[_0xfc04('0x3e')],'resourceId':_0x5854c0['id'],'type':_0x51569e[_0xfc04('0x3e')],'sectionId':_0x51569e['id']},{})[_0xfc04('0x22')](function(){return _0x1d2d66;});}else{return _0x1d2d66;}})[_0xfc04('0x2c')](function(_0x47f75c){logger[_0xfc04('0x27')](_0xfc04('0x66'),_0x47f75c);throw _0x47f75c;});}return _0x1d2d66;})[_0xfc04('0x22')](respondWithResult(_0x7445de,0xc9))[_0xfc04('0x2c')](handleError(_0x7445de,null));};exports[_0xfc04('0x38')]=function(_0x2f879f,_0x460a82){if(_0x2f879f[_0xfc04('0x67')]['id']){delete _0x2f879f['body']['id'];}return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x2f879f['params']['id']},'include':[{'model':db[_0xfc04('0x41')],'as':_0xfc04('0x68')}]})[_0xfc04('0x22')](handleEntityNotFound(_0x460a82,null))[_0xfc04('0x22')](saveUpdates(_0x2f879f['body'],null))['then'](respondWithResult(_0x460a82,null))[_0xfc04('0x2c')](handleError(_0x460a82,null));};exports[_0xfc04('0x39')]=function(_0xde6582,_0x4239a2){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xde6582[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x4239a2,null))['then'](removeEntity(_0x4239a2,null))[_0xfc04('0x2c')](handleError(_0x4239a2,null));};exports['describe']=function(_0x2ad72c,_0x10d275){return db['ChatWebsite'][_0xfc04('0x69')]()[_0xfc04('0x22')](respondWithResult(_0x10d275,null))[_0xfc04('0x2c')](handleError(_0x10d275,null));};exports[_0xfc04('0x6a')]=function(_0x530320,_0x20bb9a,_0x18e662){if(_0x530320[_0xfc04('0x67')]['id']){delete _0x530320[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x530320[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x20bb9a,null))[_0xfc04('0x22')](function(_0x3d8971){if(_0x3d8971){_0x530320['body'][_0xfc04('0x6b')]=_0x3d8971['id'];return db[_0xfc04('0x6c')][_0xfc04('0x5f')](_0x530320[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x20bb9a,null))[_0xfc04('0x2c')](handleError(_0x20bb9a,null));};exports[_0xfc04('0x6d')]=function(_0x60be3d,_0x5d8ba8,_0x327db7){var _0x5c20bf={'raw':![],'where':{}};var _0x223e4f={};var _0x504750={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0x60be3d[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x5d8ba8,null))[_0xfc04('0x22')](function(_0x1362a7){if(_0x1362a7){_0x223e4f[_0xfc04('0x46')]=_['keys'](db['Disposition'][_0xfc04('0x43')]);_0x223e4f[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x60be3d[_0xfc04('0x47')]);_0x223e4f['filters']=_[_0xfc04('0x4a')](_0x223e4f[_0xfc04('0x46')],_0x223e4f[_0xfc04('0x47')]);_0x5c20bf[_0xfc04('0x4c')]=_['intersection'](_0x223e4f[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x60be3d[_0xfc04('0x47')]['fields']));_0x5c20bf['attributes']=_0x5c20bf[_0xfc04('0x4c')]['length']?_0x5c20bf[_0xfc04('0x4c')]:_0x223e4f[_0xfc04('0x46')];if(!_0x60be3d['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x5c20bf[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x60be3d[_0xfc04('0x47')]['limit']);_0x5c20bf['offset']=qs[_0xfc04('0x30')](_0x60be3d[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x5c20bf['order']=qs[_0xfc04('0x51')](_0x60be3d[_0xfc04('0x47')]['sort']);_0x5c20bf[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x60be3d[_0xfc04('0x47')],_0x223e4f[_0xfc04('0x49')]));_0x5c20bf['where']['ChatWebsiteId']=_0x1362a7['id'];if(_0x60be3d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x5c20bf['where']=_[_0xfc04('0x57')](_0x5c20bf['where'],{'$or':_['map'](_0x5c20bf[_0xfc04('0x4c')],function(_0x2e473e){var _0x413268={};_0x413268[_0x2e473e]={'$like':'%'+_0x60be3d[_0xfc04('0x47')]['filter']+'%'};return _0x413268;})});}_0x5c20bf=_[_0xfc04('0x57')]({},_0x5c20bf,_0x60be3d['options']);return db[_0xfc04('0x6c')]['count']({'where':_0x5c20bf['where']})[_0xfc04('0x22')](function(_0x38cee5){_0x504750[_0xfc04('0x33')]=_0x38cee5;if(_0x60be3d['query'][_0xfc04('0x59')]){_0x5c20bf['include']=[{'all':!![]}];}return db[_0xfc04('0x6c')][_0xfc04('0x6e')](_0x5c20bf);})[_0xfc04('0x22')](function(_0x59a2e3){_0x504750['rows']=_0x59a2e3;return _0x504750;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x5d8ba8,_0x5c20bf))[_0xfc04('0x2c')](handleError(_0x5d8ba8,null));};exports['removeDispositions']=function(_0xfa1bc3,_0x4719d0,_0x295f3a){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xfa1bc3[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4719d0,null))[_0xfc04('0x22')](function(_0x3cb129){if(_0x3cb129){return _0x3cb129[_0xfc04('0x6f')](_0xfa1bc3[_0xfc04('0x47')][_0xfc04('0x70')]);}})[_0xfc04('0x22')](respondWithStatusCode(_0x4719d0,null))['catch'](handleError(_0x4719d0,null));};exports[_0xfc04('0x71')]=function(_0x23ce7a,_0x4ab686,_0x24c0bd){if(_0x23ce7a[_0xfc04('0x67')]['id']){delete _0x23ce7a[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x23ce7a[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4ab686,null))[_0xfc04('0x22')](function(_0x552d6e){if(_0x552d6e){_0x23ce7a[_0xfc04('0x67')][_0xfc04('0x6b')]=_0x552d6e['id'];return db[_0xfc04('0x72')][_0xfc04('0x5f')](_0x23ce7a[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x4ab686,null))[_0xfc04('0x2c')](handleError(_0x4ab686,null));};exports[_0xfc04('0x73')]=function(_0x79dd9e,_0x19e961,_0x4c5a1b){var _0x23df0a={'raw':![],'where':{}};var _0x4a71b5={};var _0x328ec6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x79dd9e[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19e961,null))['then'](function(_0x5852fa){if(_0x5852fa){_0x4a71b5[_0xfc04('0x46')]=_['keys'](db['CannedAnswer'][_0xfc04('0x43')]);_0x4a71b5['query']=_[_0xfc04('0x48')](_0x79dd9e[_0xfc04('0x47')]);_0x4a71b5[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x4a71b5[_0xfc04('0x46')],_0x4a71b5[_0xfc04('0x47')]);_0x23df0a[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x4a71b5['model'],qs['fields'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x23df0a[_0xfc04('0x4c')]=_0x23df0a['attributes'][_0xfc04('0x4d')]?_0x23df0a['attributes']:_0x4a71b5['model'];if(!_0x79dd9e['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x23df0a[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x32')]);_0x23df0a[_0xfc04('0x30')]=qs['offset'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x23df0a[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x51')]);_0x23df0a[_0xfc04('0x52')]=qs['filters'](_[_0xfc04('0x53')](_0x79dd9e[_0xfc04('0x47')],_0x4a71b5[_0xfc04('0x49')]));_0x23df0a[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x5852fa['id'];if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]){_0x23df0a['where']=_[_0xfc04('0x57')](_0x23df0a[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x23df0a[_0xfc04('0x4c')],function(_0x3f46a7){var _0x1a0120={};_0x1a0120[_0x3f46a7]={'$like':'%'+_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x1a0120;})});}_0x23df0a=_['merge']({},_0x23df0a,_0x79dd9e['options']);return db['CannedAnswer'][_0xfc04('0x33')]({'where':_0x23df0a['where']})[_0xfc04('0x22')](function(_0x18be60){_0x328ec6['count']=_0x18be60;if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x59')]){_0x23df0a[_0xfc04('0x5e')]=[{'all':!![]}];}return db[_0xfc04('0x72')][_0xfc04('0x6e')](_0x23df0a);})[_0xfc04('0x22')](function(_0x448655){_0x328ec6[_0xfc04('0x5b')]=_0x448655;return _0x328ec6;});}})['then'](respondWithFilteredResult(_0x19e961,_0x23df0a))[_0xfc04('0x2c')](handleError(_0x19e961,null));};exports[_0xfc04('0x74')]=function(_0x242562,_0xf75fb6,_0x56470c){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x242562[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xf75fb6,null))[_0xfc04('0x22')](function(_0x45302c){if(_0x45302c){return _0x45302c[_0xfc04('0x74')](_0x242562[_0xfc04('0x47')][_0xfc04('0x70')]);}})['then'](respondWithStatusCode(_0xf75fb6,null))[_0xfc04('0x2c')](handleError(_0xf75fb6,null));};exports[_0xfc04('0x75')]=function(_0x2554f3,_0x21684b,_0x36cd28){_0x2554f3[_0xfc04('0x67')][_0xfc04('0x76')]=_0x2554f3[_0xfc04('0x77')][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x2554f3[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x21684b,null))[_0xfc04('0x22')](saveUpdates(_0x2554f3['body'],null))[_0xfc04('0x22')](respondWithResult(_0x21684b,null))[_0xfc04('0x2c')](handleError(_0x21684b,null));};exports[_0xfc04('0x79')]=function(_0x115469,_0xdb620d,_0x1fe7c2){_0x115469[_0xfc04('0x67')][_0xfc04('0x7a')]=_0x115469[_0xfc04('0x77')][_0xfc04('0x78')];return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x115469[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xdb620d,null))[_0xfc04('0x22')](saveUpdates(_0x115469[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0xdb620d,null))[_0xfc04('0x2c')](handleError(_0xdb620d,null));};exports['addCustomerAvatar']=function(_0x1c11ca,_0x49179e,_0x335315){_0x1c11ca['body'][_0xfc04('0x7b')]=_0x1c11ca[_0xfc04('0x77')]['filename'];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x1c11ca[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x49179e,null))[_0xfc04('0x22')](saveUpdates(_0x1c11ca['body'],null))[_0xfc04('0x22')](respondWithResult(_0x49179e,null))[_0xfc04('0x2c')](handleError(_0x49179e,null));};exports[_0xfc04('0x7c')]=function(_0x15a5f1,_0x3a3d1a,_0x40db3f){_0x15a5f1[_0xfc04('0x67')]['systemAvatar']=_0x15a5f1['file'][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x15a5f1['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3a3d1a,null))[_0xfc04('0x22')](saveUpdates(_0x15a5f1[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0x3a3d1a,null))[_0xfc04('0x2c')](handleError(_0x3a3d1a,null));};exports[_0xfc04('0x7d')]=function(_0x50fa63,_0x3fa8d1,_0x209946){var _0x1c34c3=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x80'));var _0x3d603e={'where':{'id':_0x50fa63[_0xfc04('0x5d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33a855=![];return require(_0xfc04('0x17'))[_0xfc04('0x81')]()[_0xfc04('0x22')](function(_0x365b24){if(_0x365b24){_0x33a855=_0x365b24[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x3d603e);})[_0xfc04('0x22')](handleEntityNotFound(_0x3fa8d1,null))[_0xfc04('0x22')](function(_0x5e5a7a){if(_0x5e5a7a){if(!_['isNil'](_0x5e5a7a[_0xfc04('0x76')])){if(fs['existsSync'](path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]))&&_0x33a855){_0x1c34c3=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]);}}return _0x3fa8d1['download'](_0x1c34c3);}})['catch'](handleError(_0x3fa8d1,null));};exports[_0xfc04('0x84')]=function(_0x2742cd,_0x1d2cc3,_0x1bdd4f){var _0x5f195a=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x85'));var _0x517954={'where':{'id':_0x2742cd[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7a')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x517954)[_0xfc04('0x22')](handleEntityNotFound(_0x1d2cc3,null))[_0xfc04('0x22')](function(_0x14e4fe){if(_0x14e4fe){if(!_[_0xfc04('0x86')](_0x14e4fe[_0xfc04('0x7a')])){if(fs[_0xfc04('0x87')](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]))){_0x5f195a=path['join'](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]);}}return _0x1d2cc3[_0xfc04('0x89')](_0x5f195a);}})[_0xfc04('0x2c')](handleError(_0x1d2cc3,null));};exports[_0xfc04('0x8a')]=function(_0x1c5dae,_0x1c40fc,_0x3f7094){var _0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x8b'));var _0x427a80={'where':{'id':_0x1c5dae[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7b'),_0xfc04('0x8c')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x427a80)[_0xfc04('0x22')](handleEntityNotFound(_0x1c40fc,null))['then'](function(_0xb07993){if(_0xb07993){if(!_[_0xfc04('0x86')](_0xb07993['customerAvatar'])){if(fs['existsSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]))&&_0xb07993[_0xfc04('0x8c')]){_0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]);}}return _0x1c40fc[_0xfc04('0x89')](_0x34806b);}})[_0xfc04('0x2c')](handleError(_0x1c40fc,null));};exports['getSystemAvatar']=function(_0x3c3516,_0x344d5f,_0x32f04d){var _0x3c84a5=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x1a20fd={'where':{'id':_0x3c3516[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x8d')],'raw':!![]};return db['ChatWebsite'][_0xfc04('0x63')](_0x1a20fd)[_0xfc04('0x22')](handleEntityNotFound(_0x344d5f,null))['then'](function(_0x332c55){if(_0x332c55){if(!_[_0xfc04('0x86')](_0x332c55[_0xfc04('0x8d')])){if(fs['existsSync'](path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55['systemAvatar']))){_0x3c84a5=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55[_0xfc04('0x8d')]);}}return _0x344d5f[_0xfc04('0x89')](_0x3c84a5);}})[_0xfc04('0x2c')](handleError(_0x344d5f,null));};exports[_0xfc04('0x8e')]=function(_0x3610cd,_0x2ef341,_0x1ae391){var _0x5e9092=require('user-agent-parser');var _0x156611=new _0x5e9092();var _0x461408=_0x156611[_0xfc04('0x8f')](_0x3610cd[_0xfc04('0x90')][_0xfc04('0x91')])[_0xfc04('0x92')]();var _0x48a19f={'body':_0x3610cd[_0xfc04('0x67')],'channel':'chat'};var _0x4eaac9=[];var _0x1fcf7c=[];var _0x4240c5={};var _0x56e5bf=![];return db[_0xfc04('0x93')][_0xfc04('0x69')]()[_0xfc04('0x22')](function(_0xecb567){if(!_0xecb567){throw new db['Sequelize'][(_0xfc04('0x94'))]('no\x20available\x20attributes');}_0x4eaac9=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x1fcf7c=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3610cd[_0xfc04('0x67')]['id']){delete _0x3610cd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')]['from'])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')])||_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')]===''){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9e')+_0x1fcf7c);}if(!_['includes'](_0x1fcf7c,_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fcf7c);}_0x4240c5[_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')]]=_0x3610cd[_0xfc04('0x67')]['from'];})['then'](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3610cd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':'List','include':[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xa0'),'where':_0x4240c5,'limit':0x1,'order':[[_0xfc04('0x97'),_0xfc04('0xa1')]]}]},{'model':db[_0xfc04('0xa2')],'as':_0xfc04('0xa3')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))[_0xfc04('0x22')](function(_0x414bf7){if(_0x414bf7&&_0x414bf7[_0xfc04('0xa4')]){_0x48a19f[_0xfc04('0xa5')]=_0x414bf7;_0x48a19f['applications']=_0x414bf7['Applications'];_0x48a19f[_0xfc04('0xa6')]=_0x414bf7[_0xfc04('0xa4')];_0x48a19f[_0xfc04('0xa7')]=_[_0xfc04('0xa8')](_0x48a19f[_0xfc04('0xa7')],['priority'],[_0xfc04('0xa9')]);if(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa3')]){delete _0x48a19f[_0xfc04('0xa5')]['Applications'];}if(_0x48a19f[_0xfc04('0xa5')]['List']&&_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa4')][_0xfc04('0xa0')][_0xfc04('0x4d')]){return _0x48a19f['account'][_0xfc04('0xa4')]['Contacts'][0x0];}var _0x35588e=_[_0xfc04('0x1a')](_0x3610cd['body'],{'firstName':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x414bf7['ListId']});_0x35588e[_0x3610cd['body'][_0xfc04('0x9d')]]=_0x3610cd['body'][_0xfc04('0xaa')];return db['CmContact'][_0xfc04('0x5f')](_0x35588e,{'fields':_0x4eaac9,'raw':!![]});}})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))['then'](function(_0x19d902){_0x48a19f['contact']=_0x19d902;var _0x2fbeb8=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xab')];if(_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')]){_0x2fbeb8=_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')];}else if(_0x3610cd['headers']['x-forwarded-for']){_0x2fbeb8=_[_0xfc04('0xad')](_0x3610cd['headers'][_0xfc04('0xae')][_0xfc04('0xaf')](','));}if(_0x19d902){var _0x268065={'ContactId':_0x19d902['id'],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'from':(_0x19d902[_0xfc04('0xb0')]||'')+'\x20'+(_0x19d902[_0xfc04('0xb1')]||''),'customerIp':_0x2fbeb8,'customerPort':_0x3610cd['headers'][_0xfc04('0xb2')]?_0x3610cd[_0xfc04('0x90')][_0xfc04('0xb2')]:null,'referer':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xb3')],'browserName':_0x461408['browser'][_0xfc04('0x3e')]&&_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]?util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408[_0xfc04('0xb4')][_0xfc04('0x3e')],_0x461408['browser'][_0xfc04('0xb5')]):_0xfc04('0xb8'),'browserVersion':_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]||_0xfc04('0xb8'),'osName':util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408['os'][_0xfc04('0x3e')],_0x461408['os'][_0xfc04('0xb5')]),'osVersion':_0x461408['os'][_0xfc04('0xb5')],'deviceModel':_0x461408['device']['model']&&_0x461408[_0xfc04('0xb9')]['vendor']?util[_0xfc04('0xb6')](_0xfc04('0xba'),_0x461408[_0xfc04('0xb9')]['model'],_0x461408[_0xfc04('0xb9')]['vendor'],_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')]):null,'deviceVendor':_0x461408[_0xfc04('0xb9')][_0xfc04('0xbb')],'deviceType':_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')],'formData':JSON['stringify'](_0x3610cd[_0xfc04('0x67')])};var _0x2ca0af={'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'closed':![]};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]){_0x2ca0af['threadId']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')];return db[_0xfc04('0xbd')]['find']({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x17d1ea){if(_0x17d1ea){return[_0x17d1ea,![]];}_0x268065[_0xfc04('0xbc')]=_0x3610cd['body']['threadId'];_0x268065['externalUrl']=_0x3610cd['body'][_0xfc04('0xbe')];return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x226f0a){return[_0x226f0a,!![]];});});}_0x2ca0af[_0xfc04('0xbf')]=_0x19d902['id'];if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id']){_0x2ca0af['id']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id'];return db[_0xfc04('0xbd')][_0xfc04('0x63')]({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x3cb86a){if(_0x3cb86a){return[_0x3cb86a,![]];}return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)['then'](function(_0xd2b3de){return[_0xd2b3de,!![]];});});}return db['ChatInteraction'][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x161d95){return[_0x161d95,!![]];});}})[_0xfc04('0xc1')](function(_0x49958c,_0x2fd701){if(_0x49958c){_0x56e5bf=_0x2fd701;if(!_0x2fd701){var _0x1d25dc={'from':(_0x48a19f[_0xfc04('0xc2')]['firstName']||'')+'\x20'+(_0x48a19f[_0xfc04('0xc2')][_0xfc04('0xb1')]||'')};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]&&_0x3610cd['body']['threadId']!=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]){_0x1d25dc[_0xfc04('0xbc')]=_0x3610cd['body'][_0xfc04('0xc3')];}return _0x49958c[_0xfc04('0x38')](_0x1d25dc);}else{return _0x49958c;}}})[_0xfc04('0x22')](function(_0x29f6b8){_0x48a19f['interaction']=_0x29f6b8[_0xfc04('0x3a')]({'plain':!![]});_0x48a19f['interaction'][_0xfc04('0xc4')]=_0x56e5bf;if(_0x48a19f['interaction'][_0xfc04('0xc4')]){if(_0x48a19f[_0xfc04('0xa5')]['autoclose']){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xc5')]({'id':0x0,'priority':_0x48a19f[_0xfc04('0xa7')][_0xfc04('0x4d')]+0x1,'app':_0xfc04('0xc6'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xfc04('0xc7')][_0xfc04('0x5f')]({'body':_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'ChatInteractionId':_0x29f6b8['id'],'direction':'in','ContactId':_0x48a19f[_0xfc04('0xc2')]['id'],'AttachmentId':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc8')]});})[_0xfc04('0x22')](function(_0x532a74){_0x48a19f[_0xfc04('0x2a')]=_0x532a74;if(_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]){return db[_0xfc04('0xca')][_0xfc04('0x63')]({'attributes':['id','name'],'where':{'id':_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]}})[_0xfc04('0x22')](function(_0x586a3f){if(_0x586a3f){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x586a3f[_0xfc04('0x3e')]+','+(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xcc')]||0xa),'interval':_0xfc04('0xcd')});_0x48a19f['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfc04('0xce'),_0xfc04('0xcf'),_0x48a19f);});}return respondWithRpcPromise(_0xfc04('0xce'),'startRouting',_0x48a19f);})[_0xfc04('0x22')](function(_0x5c2e16){respondWithRpcPromise('EventManager',_0xfc04('0xd0'),{'event':_0xfc04('0x8e'),'message':_0x5c2e16},client9002);return _0x5c2e16;})['then'](respondWithResult(_0x2ef341,null))[_0xfc04('0x2c')](handleError(_0x2ef341,null));};exports['offline']=function(_0x3ab9dd,_0x332d6b,_0x515444){var _0x3a53b6,_0x295b34,_0xca2025;var _0x37cb57=[];var _0x843d8b=[];var _0x2f2231={};var _0x2b64cd=_0x3ab9dd[_0xfc04('0xd1')]||[];var _0x4ba4a3=[];var _0x375e57;return db[_0xfc04('0x93')][_0xfc04('0x69')]()['then'](function(_0x3e717d){if(!_0x3e717d){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd2'));}_0x843d8b=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x37cb57=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3ab9dd[_0xfc04('0x67')]['id']){delete _0x3ab9dd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0xaa')])){throw _0x332d6b['status'](0x1f4)['send'](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b')));}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0x67')])||_0x3ab9dd['body']['body']===''){throw _0x332d6b[_0xfc04('0x2d')](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c')));}if(_[_0xfc04('0x86')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd4')+_0x37cb57));}if(!_[_0xfc04('0xd5')](_0x37cb57,_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))]['ValidationError'](_0xfc04('0xd6')+_0x37cb57));}_0x2f2231[_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')]]=_0x3ab9dd[_0xfc04('0x67')]['from'];})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3ab9dd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':_0xfc04('0xa4')},{'model':db['MailAccount'],'as':_0xfc04('0xd7')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x332d6b,null))[_0xfc04('0x22')](function(_0x1cbc51){if(_0x1cbc51&&_0x1cbc51[_0xfc04('0xa4')]){_0x295b34=_0x1cbc51;var _0x3e3c46=_[_0xfc04('0x1a')](_0x3ab9dd[_0xfc04('0x67')],{'firstName':_0x3ab9dd[_0xfc04('0x67')]['from'],'phone':_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x1cbc51[_0xfc04('0x99')]});_0x3e3c46[_0x3ab9dd[_0xfc04('0x67')]['mapKeyOffline']]=_0x3ab9dd[_0xfc04('0x67')]['from'];return db['CmContact'][_0xfc04('0xd8')]({'where':_0x2f2231,'defaults':_0x3e3c46});}})[_0xfc04('0xc1')](function(_0x1fbc9b){if(_0x1fbc9b){_0xca2025=_0x1fbc9b;var _0x6d08a0=fs[_0xfc04('0xd9')](path[_0xfc04('0x7e')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xfc04('0xda'));var _0x5d9c9c=ejs[_0xfc04('0xdb')](_0x6d08a0,{'body':_[_0xfc04('0xdc')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0x67')]),'bodyTitle':_0x295b34[_0xfc04('0xdd')]});return db[_0xfc04('0xde')][_0xfc04('0x5f')]({'body':_0x5d9c9c,'ContactId':_0x1fbc9b['id'],'ChatWebsiteId':_0x295b34['id']});}})[_0xfc04('0x22')](function(_0xb159a1){_0x375e57=_0xb159a1;if(_0x2b64cd['length']){var _0x3234b3=_0x2b64cd[_0xfc04('0x42')](function(_0x33aa84){return{'name':_0x33aa84['originalname'],'basename':_0x33aa84[_0xfc04('0x78')],'type':_0x33aa84[_0xfc04('0xdf')],'ChatOfflineMessageId':_0xb159a1['id']};});_0x4ba4a3=_0x3234b3[_0xfc04('0x42')](_0x5cc30d=>{var _0x50c124={'filename':_0x5cc30d['name'],'path':path[_0xfc04('0x7e')](config['root'],_0xfc04('0xe0'),'files',_0xfc04('0xe1'),_0xfc04('0xe2'),_0x5cc30d[_0xfc04('0xe3')])};return _0x50c124;});if(!_0x295b34[_0xfc04('0xe4')]){return db['sequelize'][_0xfc04('0xe5')](function(_0x5d07a4){return db['Attachment'][_0xfc04('0xe6')](_0x3234b3,{'transaction':_0x5d07a4});});}}})['then'](function(){if(_0x375e57){_0x3a53b6=_0x375e57;return db[_0xfc04('0xd7')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xfc04('0xe7')],'as':_0xfc04('0xe8'),'raw':!![]}]});}})['then'](function(_0x51cf68){if(_0x51cf68&&_0x51cf68['Smtp']&&_0x295b34['forwardOffline']&&_0x295b34[_0xfc04('0xe9')]){var _0xc222b3={'tls':{'rejectUnauthorized':![]}};if(_0x51cf68[_0xfc04('0xe8')]['service']){_0xc222b3[_0xfc04('0xea')]=_0x51cf68['Smtp'][_0xfc04('0xea')];}else{_0xc222b3[_0xfc04('0xeb')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xeb')];_0xc222b3[_0xfc04('0xec')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xec')];_0xc222b3['secure']=_0x51cf68['Smtp'][_0xfc04('0xed')];}if(_0x51cf68[_0xfc04('0xe8')]['authentication']){_0xc222b3[_0xfc04('0xee')]={'user':_0x51cf68['Smtp'][_0xfc04('0x60')],'pass':_0x51cf68['Smtp'][_0xfc04('0xef')]};}return respondWithRpcPromise('SendMail',_0xfc04('0xf0'),{'account':_0xc222b3,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x51cf68[_0xfc04('0x3e')],_0x51cf68[_0xfc04('0xf1')]||_0x51cf68['Smtp'][_0xfc04('0x60')]),'to':_0x295b34['forwardOfflineAddress'],'subject':_0x295b34['offlineMessageSubject'],'html':_0x3a53b6['body'],'attachments':_0x4ba4a3}},client9003)[_0xfc04('0x22')](function(){return _0x3a53b6;})['catch'](function(_0x13ad14){console['error'](_0x13ad14);});}})['then'](function(){if(_0x295b34&&_0x295b34[_0xfc04('0xe4')]&&_0x295b34['MailAccountId']){var _0x26b203=[];if(_0x2b64cd['length']){_0x26b203=_0x2b64cd[_0xfc04('0x42')](function(_0x56d1a8){return{'name':_0x56d1a8['originalname'],'basename':_0x56d1a8[_0xfc04('0x78')],'type':_0x56d1a8['mimetype'],'ChatOfflineMessageId':_0x375e57['id']};});}var _0x4e9fae;if(!_['isNil'](_0x295b34[_0xfc04('0xf2')])){var _0x3c9f73=_['map'](_0x3ab9dd[_0xfc04('0x67')],function(_0x1e736f){return _0x1e736f;});var _0x2f215e=_[_0xfc04('0xf3')](_0x3c9f73)[0x0];var _0x2cfd60=_[_0xfc04('0xf4')](_0x2f215e,function(_0x27d3f4){return _0x27d3f4;});_0x4e9fae=_0x2cfd60[0x1][_0x295b34[_0xfc04('0xf2')]];}var _0x218341={'from':_0xca2025['email'],'firstName':_0xca2025[_0xfc04('0xb0')],'lastName':_0xca2025[_0xfc04('0xb1')],'mapKey':_0xfc04('0xf1'),'message':{'from':_0xca2025[_0xfc04('0xf1')],'to':_0x295b34[_0xfc04('0xd7')][_0xfc04('0xf1')],'cc':'','subject':_[_0xfc04('0x86')](_0x4e9fae)?_0x295b34[_0xfc04('0xf5')]:_0x4e9fae,'messageId':'','sentAt':new Date(),'attach':_0x26b203[_0xfc04('0x4d')],'attachments':_0x26b203,'originChannel':_0xfc04('0xf6'),'ChatWebsiteId':_0x295b34['id'],'ChatOfflineMessageId':_0x3a53b6['id'],'originTo':_0x295b34[_0xfc04('0xd7')]['email']},'body':_0x3a53b6[_0xfc04('0x67')]};var _0x5c1924={'account':{'id':_0x295b34[_0xfc04('0xf7')]},'body':_0x218341,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xfc04('0xf8'),_0x5c1924,client9001)[_0xfc04('0x22')](function(){return _0x3a53b6;})[_0xfc04('0x2c')](function(_0x58e085){console[_0xfc04('0x27')](_0x58e085);});}return;})['then'](function(){if(_0x3a53b6){return _0x3a53b6;}})['then'](respondWithResult(_0x332d6b,null))[_0xfc04('0x2c')](function(_0x2fb138){console['error'](_0xfc04('0x2c'),_0x2fb138);for(var _0x14dfc3 of _0x2b64cd){var _0x1d6b67=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0xe0'),_0xfc04('0xd1'),'attachments','offline-chat',_0x14dfc3[_0xfc04('0x78')]);fs_extra['remove'](_0x1d6b67)[_0xfc04('0x2c')](function(_0x921364){console[_0xfc04('0x27')](_0xfc04('0xf9'),_0x1d6b67,_0x921364);});}});};exports[_0xfc04('0xfa')]=function(_0x279702,_0x560b65,_0x19ce19){return db[_0xfc04('0xbd')]['find']({'where':{'id':_0x279702[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x560b65,null))['then'](function(_0x4bba70){if(_0x4bba70){return _0x4bba70[_0xfc04('0xfa')](_0x279702[_0xfc04('0x67')][_0xfc04('0x70')],_[_0xfc04('0xfb')](_0x279702[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})[_0xfc04('0x22')](respondWithResult(_0x560b65,null))['catch'](handleError(_0x560b65,null));};exports[_0xfc04('0xfc')]=function(_0xd11fb,_0x2d3dda,_0x590501){var _0x4de7b7={'raw':![],'where':{}};var _0x3abe26={};var _0x284ab9={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0xd11fb[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2d3dda,null))[_0xfc04('0x22')](function(_0x43160c){if(_0x43160c){_0x3abe26[_0xfc04('0x46')]=_[_0xfc04('0x48')](db['ChatInteraction'][_0xfc04('0x43')]);_0x3abe26['query']=_['keys'](_0xd11fb[_0xfc04('0x47')]);_0x3abe26[_0xfc04('0x49')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],_0x3abe26[_0xfc04('0x47')]);_0x4de7b7[_0xfc04('0x4c')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x4de7b7[_0xfc04('0x4c')]=_0x4de7b7[_0xfc04('0x4c')]['length']?_0x4de7b7[_0xfc04('0x4c')]:_0x3abe26[_0xfc04('0x46')];if(!_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x4de7b7[_0xfc04('0x32')]=qs['limit'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4de7b7[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x4de7b7[_0xfc04('0x50')]=qs['sort'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4de7b7[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0xd11fb[_0xfc04('0x47')],_0x3abe26[_0xfc04('0x49')]));_0x4de7b7[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x43160c['id'];if(_0xd11fb['query'][_0xfc04('0x54')]){_0x4de7b7[_0xfc04('0x52')]=_['merge'](_0x4de7b7[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x4de7b7['attributes'],function(_0x435600){var _0x5731c0={};_0x5731c0[_0x435600]={'$like':'%'+_0xd11fb[_0xfc04('0x47')]['filter']+'%'};return _0x5731c0;})});}_0x4de7b7=_[_0xfc04('0x57')]({},_0x4de7b7,_0xd11fb[_0xfc04('0x58')]);return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':_0x4de7b7[_0xfc04('0x52')]})[_0xfc04('0x22')](function(_0x45ce8c){_0x284ab9['count']=_0x45ce8c;if(_0xd11fb['query'][_0xfc04('0x59')]){_0x4de7b7[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xfd'),'required':![]},{'model':db[_0xfc04('0xca')],'as':_0xfc04('0xfe'),'attributes':[_0xfc04('0x3e'),_0xfc04('0xff'),_0xfc04('0x100')],'required':![]},{'model':db[_0xfc04('0x101')],'as':_0xfc04('0x102'),'attributes':['id',_0xfc04('0x3e'),_0xfc04('0x103')],'where':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?{'id':_0xd11fb['query'][_0xfc04('0x104')]}:undefined,'required':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?!![]:![]}];}return db[_0xfc04('0xbd')][_0xfc04('0x6e')](_0x4de7b7);})[_0xfc04('0x22')](function(_0x4f2dca){_0x284ab9['rows']=_0x4f2dca;return _0x284ab9;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x2d3dda,_0x4de7b7))[_0xfc04('0x2c')](handleError(_0x2d3dda,null));};function iftimePromise(_0x49b35c,_0x423b1a){return respondWithRpcPromise(_0xfc04('0x105'),_0xfc04('0x106'),{'command':_0x423b1a[_0xfc04('0x107')]?util[_0xfc04('0xb6')](_0xfc04('0x108'),_0x49b35c[_0xfc04('0x109')],_0x423b1a[_0xfc04('0x107')]):util[_0xfc04('0xb6')](_0xfc04('0x10a'),_0x49b35c['interval'])},client9002)[_0xfc04('0x22')](function(_0x37e748){var _0x4dfcdf=_0x37e748&&_0x37e748[_0xfc04('0x10b')]('true')>=0x0?!![]:![];logger[_0xfc04('0x23')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c['interval'],_0x4dfcdf?_0xfc04('0x10d'):'OFFLINE',_0x423b1a[_0xfc04('0x107')]?_0x423b1a[_0xfc04('0x107')]:_0xfc04('0x10e'));return _0x4dfcdf;})[_0xfc04('0x2c')](function(_0x18a6b4){logger[_0xfc04('0x27')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c[_0xfc04('0x109')],util[_0xfc04('0x10f')](_0x18a6b4,{'showHidden':![],'depth':null}),_0x423b1a['timezone']?_0x423b1a['timezone']:'No\x20timezone');return![];});}exports[_0xfc04('0x106')]=function(_0x18c462,_0x1afa9f,_0x22ed68){var _0x22c8cf=0x0;var _0x2ed40b=0x0;var _0x1b8422=![];var _0x528e8f;var _0x4ba54c;return db['ChatWebsite']['find']({'where':{'id':_0x18c462['params']['id']},'include':[{'model':db['Interval'],'as':_0xfc04('0x110'),'include':[{'model':db[_0xfc04('0x110')],'as':_0xfc04('0x111'),'attributes':['id',_0xfc04('0x109')],'raw':!![]}]}]})[_0xfc04('0x22')](handleEntityNotFound(_0x1afa9f,null))[_0xfc04('0x22')](function(_0x110b18){if(_0x110b18){_0x528e8f=_0x110b18;return _0x110b18['getProactiveActions']({'raw':!![]});}})[_0xfc04('0x22')](function(_0x344550){if(_0x528e8f){if(_0x344550){_0x4ba54c=_0x344550;}}return require(_0xfc04('0x17'))[_0xfc04('0x81')]();})['then'](function(_0x39fc75){if(_0x39fc75){_0x2ed40b=_0x39fc75['virtual'];_0x1b8422=_0x39fc75[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':{'closed':![]}});})['then'](function(_0x381e8f){_0x22c8cf=_0x381e8f;if(_0x2ed40b&&_0x381e8f>_0x2ed40b){return db['License']['findOne']({'where':{'id':0x1}})[_0xfc04('0x22')](function(_0x21d0a6){if(_0x21d0a6){_0x21d0a6[_0xfc04('0x112')](_0xfc04('0x113'));}});}})['then'](function(){if(_0x528e8f['Interval']&&_0x528e8f[_0xfc04('0x110')][_0xfc04('0x111')]){var _0x525a37=[];for(var _0xcec488=0x0;_0xcec488<_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xfc04('0x4d')];_0xcec488++){var _0x40e63c=_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xcec488][_0xfc04('0x3a')]({'plain':!![]});_0x525a37[_0xfc04('0xc5')](iftimePromise(_0x40e63c,_0x528e8f));}return BPromise['all'](_0x525a37)['then'](function(_0x553a9d){return _['some'](_0x553a9d);});}else{return!![];}})[_0xfc04('0x22')](function(_0x7fe9a5){var _0x17f5b0=fs['readFileSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x114')),_0xfc04('0xda'));var _0x4e0bc4={'remote':_0x528e8f[_0xfc04('0x115')],'query':querystring['stringify'](_['merge'](_0x528e8f[_0xfc04('0x3a')]({'plain':!![]}),{'customerIp':_0x18c462['headers'][_0xfc04('0xae')]||_0x18c462[_0xfc04('0x90')][_0xfc04('0x116')]||_0x18c462[_0xfc04('0x117')][_0xfc04('0x118')]||_0x18c462['ip'],'referer':_0x18c462[_0xfc04('0x90')][_0xfc04('0xb3')],'openedInteractions':_0x22c8cf,'maxInteractions':_0x2ed40b,'virtual':_0x1b8422['virtual'],'online':_0x7fe9a5,'custom':_0x1b8422}))[_0xfc04('0x119')](/'/g,'\x5c\x27')};_0x1afa9f[_0xfc04('0x3f')](ejs[_0xfc04('0xdb')](Mustache[_0xfc04('0xdb')](_0x17f5b0,_0x4e0bc4),{'proactiveActions':_0x4ba54c,'alignment':_0x528e8f[_0xfc04('0x11a')],'verticalAlignment':_0x528e8f[_0xfc04('0x11b')],'div_color':_0x528e8f[_0xfc04('0x103')],'text_color':_0x528e8f[_0xfc04('0x11c')],'button_color':_0x528e8f[_0xfc04('0x11d')],'background_color':_0x528e8f[_0xfc04('0x11e')]}));})[_0xfc04('0x2c')](handleError(_0x1afa9f,null));};exports[_0xfc04('0x11f')]=function(_0x3a59e9,_0x39056d,_0x2c70be){return db['ChatWebsite']['findOne']({'where':{'id':_0x3a59e9['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x39056d,null))[_0xfc04('0x22')](function(_0x24c2e3){if(_0x24c2e3){return db[_0xfc04('0x120')][_0xfc04('0xe5')](function(_0x5cb436){return db[_0xfc04('0xa2')][_0xfc04('0x39')]({'where':{'ChatWebsiteId':_0x3a59e9[_0xfc04('0x5d')]['id']},'transaction':_0x5cb436})['then'](function(_0x2a0a3){var _0x19cd20=_['map'](_0x3a59e9[_0xfc04('0x67')],function(_0x21f5cf){_0x21f5cf[_0xfc04('0x6b')]=_0x3a59e9['params']['id'];return _0x21f5cf;});return db['ChatApplication'][_0xfc04('0xe6')](_0x19cd20,{'transaction':_0x5cb436});});})['then'](function(){return db['ChatApplication'][_0xfc04('0x121')]({'where':{'ChatWebsiteId':_0x3a59e9['params']['id']},'order':'priority'});});}})[_0xfc04('0x22')](respondWithResult(_0x39056d,null))[_0xfc04('0x2c')](handleError(_0x39056d,null));};exports['getApplications']=function(_0x3898e5,_0x21430d,_0x5b5c22){var _0x3cf178={};var _0xa638a7={};var _0x574cae;var _0x28925b;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x3898e5['params']['id']}})['then'](handleEntityNotFound(_0x21430d,null))['then'](function(_0x6facfe){if(_0x6facfe){_0x574cae=_0x6facfe;_0xa638a7[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0xa2')]['rawAttributes']);_0xa638a7[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x3898e5[_0xfc04('0x47')]);_0xa638a7[_0xfc04('0x49')]=_['intersection'](_0xa638a7[_0xfc04('0x46')],_0xa638a7['query']);_0x3cf178[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0xa638a7[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x3cf178[_0xfc04('0x4c')]=_0x3cf178['attributes']['length']?_0x3cf178['attributes']:_0xa638a7['model'];_0x3cf178[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x51')]);_0x3cf178[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_['pick'](_0x3898e5[_0xfc04('0x47')],_0xa638a7[_0xfc04('0x49')]));if(_0x3898e5['query'][_0xfc04('0x54')]){_0x3cf178[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x3cf178[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x3cf178[_0xfc04('0x4c')],function(_0x56f0f5){var _0x50cf7c={};_0x50cf7c[_0x56f0f5]={'$like':'%'+_0x3898e5[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x50cf7c;})});}_0x3cf178=_[_0xfc04('0x57')]({},_0x3cf178,_0x3898e5['options']);return _0x574cae['getApplications'](_0x3cf178);}})['then'](function(_0x339aca){if(_0x339aca){_0x28925b=_0x339aca[_0xfc04('0x4d')];if(!_0x3898e5['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x3cf178['limit']=qs[_0xfc04('0x32')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x32')]);_0x3cf178['offset']=qs[_0xfc04('0x30')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x574cae['getApplications'](_0x3cf178);}})[_0xfc04('0x22')](function(_0x34a2ba){if(_0x34a2ba){return _0x34a2ba?{'count':_0x28925b,'rows':_0x34a2ba}:null;}})[_0xfc04('0x22')](respondWithResult(_0x21430d,null))[_0xfc04('0x2c')](handleError(_0x21430d,null));};exports[_0xfc04('0x123')]=function(_0x339192,_0x3d08ae,_0x1e7fae){return db[_0xfc04('0x124')][_0xfc04('0x63')]({'where':{'id':_0x339192[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3d08ae,null))[_0xfc04('0x22')](function(_0x344a3d){if(_0x344a3d){return _0x344a3d['addProactiveActions'](_0x339192[_0xfc04('0x67')][_0xfc04('0x70')],_['omit'](_0x339192[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3d08ae,null))[_0xfc04('0x2c')](handleError(_0x3d08ae,null));};exports[_0xfc04('0x125')]=function(_0x5b6193,_0x2dc7e0,_0x2f5aea){var _0x22016b={};var _0x194577={};var _0x1f9730;var _0x37ddfb;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x5b6193['params']['id']}})['then'](handleEntityNotFound(_0x2dc7e0,null))[_0xfc04('0x22')](function(_0x1792d5){if(_0x1792d5){_0x1f9730=_0x1792d5;_0x194577[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x126')][_0xfc04('0x43')]);_0x194577[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x5b6193[_0xfc04('0x47')]);_0x194577[_0xfc04('0x49')]=_['intersection'](_0x194577['model'],_0x194577[_0xfc04('0x47')]);_0x22016b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x194577[_0xfc04('0x46')],qs['fields'](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x22016b['attributes']=_0x22016b[_0xfc04('0x4c')]['length']?_0x22016b['attributes']:_0x194577[_0xfc04('0x46')];_0x22016b[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x5b6193[_0xfc04('0x47')]['sort']);_0x22016b[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x5b6193[_0xfc04('0x47')],_0x194577[_0xfc04('0x49')]));if(_0x5b6193['query'][_0xfc04('0x54')]){_0x22016b[_0xfc04('0x52')]=_['merge'](_0x22016b[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x22016b[_0xfc04('0x4c')],function(_0x265eef){var _0x5a6d92={};_0x5a6d92[_0x265eef]={'$like':'%'+_0x5b6193[_0xfc04('0x47')]['filter']+'%'};return _0x5a6d92;})});}_0x22016b=_[_0xfc04('0x57')]({},_0x22016b,_0x5b6193['options']);return _0x1f9730['getProactiveActions'](_0x22016b);}})[_0xfc04('0x22')](function(_0x442aa6){if(_0x442aa6){_0x37ddfb=_0x442aa6['length'];if(!_0x5b6193[_0xfc04('0x47')]['hasOwnProperty']('nolimit')){_0x22016b[_0xfc04('0x32')]=qs['limit'](_0x5b6193['query'][_0xfc04('0x32')]);_0x22016b[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x1f9730[_0xfc04('0x125')](_0x22016b);}})[_0xfc04('0x22')](function(_0x1086bc){if(_0x1086bc){return _0x1086bc?{'count':_0x37ddfb,'rows':_0x1086bc}:null;}})['then'](respondWithResult(_0x2dc7e0,null))['catch'](handleError(_0x2dc7e0,null));};exports[_0xfc04('0x127')]=function(_0xb28a49,_0x506bf4,_0x176f7f){var _0x3b2f7d=_0xb28a49['query'][_0xfc04('0x128')]===_0xfc04('0x129')?_0xfc04('0x12a'):'onlineForm';return db['ChatWebsite'][_0xfc04('0x63')]({'attributes':['id',_0x3b2f7d],'where':{'id':_0xb28a49['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x506bf4,null))['then'](function(_0x399679){if(_0x399679){var _0x2c0ba8=_0x399679[_0x3b2f7d];var _0x1e051c=_0x2c0ba8&&_0x2c0ba8[_0xfc04('0x12b')]?_0x2c0ba8[_0xfc04('0x12b')]:[];_0x506bf4[_0xfc04('0x3f')]({'fromKey':_[_0xfc04('0x86')](_0x2c0ba8['fromKey'])?undefined:_0x2c0ba8['fromKey'],'count':_0x1e051c['length'],'rows':_0x1e051c});}})['catch'](handleError(_0x506bf4,null));};exports[_0xfc04('0x12c')]=function(_0x496f22,_0x597cc2,_0xbb1255){var _0x4427c5={'raw':![],'where':{}};var _0x2320f0={};var _0x55d937={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x496f22[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x597cc2,null))['then'](function(_0x421152){if(_0x421152){_0x2320f0[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xde')][_0xfc04('0x43')]);_0x2320f0['query']=_[_0xfc04('0x48')](_0x496f22[_0xfc04('0x47')]);_0x2320f0[_0xfc04('0x49')]=_['intersection'](_0x2320f0[_0xfc04('0x46')],_0x2320f0[_0xfc04('0x47')]);_0x4427c5[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2320f0[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x496f22[_0xfc04('0x47')]['fields']));_0x4427c5[_0xfc04('0x4c')]=_0x4427c5[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x4427c5[_0xfc04('0x4c')]:_0x2320f0[_0xfc04('0x46')];if(!_0x496f22['query']['hasOwnProperty']('nolimit')){_0x4427c5['limit']=qs[_0xfc04('0x32')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4427c5['offset']=qs[_0xfc04('0x30')](_0x496f22['query'][_0xfc04('0x30')]);}_0x4427c5[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4427c5['where']=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x496f22[_0xfc04('0x47')],_0x2320f0[_0xfc04('0x49')]));_0x4427c5[_0xfc04('0x52')]['ChatWebsiteId']=_0x421152['id'];if(_0x496f22['query'][_0xfc04('0x54')]){_0x4427c5[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x4427c5['where'],{'$or':_['map'](_0x4427c5[_0xfc04('0x4c')],function(_0x363a99){var _0x2ca98f={};_0x2ca98f[_0x363a99]={'$like':'%'+_0x496f22[_0xfc04('0x47')]['filter']+'%'};return _0x2ca98f;})});}_0x4427c5=_['merge']({},_0x4427c5,_0x496f22[_0xfc04('0x58')]);return db['ChatOfflineMessage'][_0xfc04('0x33')]({'where':_0x4427c5['where']})['then'](function(_0x501ca1){_0x55d937['count']=_0x501ca1;if(_0x496f22[_0xfc04('0x47')][_0xfc04('0x59')]){_0x4427c5[_0xfc04('0x5e')]=[{'all':!![]}];}else{_0x4427c5[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xfc04('0xde')][_0xfc04('0x6e')](_0x4427c5);})[_0xfc04('0x22')](function(_0x24d194){_0x55d937[_0xfc04('0x5b')]=_0x24d194;return _0x55d937;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x597cc2,_0x4427c5))[_0xfc04('0x2c')](handleError(_0x597cc2,null));};exports['addAgents']=function(_0x25d77,_0x2329de,_0x5beece){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x25d77['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2329de,null))['then'](function(_0x18e5eb){if(_0x18e5eb){return _0x18e5eb[_0xfc04('0x12d')](_0x25d77[_0xfc04('0x67')]['ids'],_[_0xfc04('0xfb')](_0x25d77[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{})[_0xfc04('0xc1')](function(_0x22e36b){for(var _0x474341=0x0;_0x474341<_0x25d77[_0xfc04('0x67')]['ids'][_0xfc04('0x4d')];_0x474341+=0x1){socket['emit'](_0xfc04('0x12e'),{'UserId':Number(_0x25d77[_0xfc04('0x67')]['ids'][_0x474341]),'ChatWebsiteId':Number(_0x25d77[_0xfc04('0x5d')]['id'])});}return _0x22e36b;});}})[_0xfc04('0x22')](respondWithResult(_0x2329de,null))['catch'](handleError(_0x2329de,null));};exports[_0xfc04('0x12f')]=function(_0xb16b8f,_0x2a2e2d,_0x1f1a7a){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0xb16b8f[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2a2e2d,null))[_0xfc04('0x22')](function(_0x31f579){if(_0x31f579){return _0x31f579[_0xfc04('0x12f')](_0xb16b8f[_0xfc04('0x47')]['ids'])['then'](function(){if(_[_0xfc04('0x130')](_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')])){for(var _0x48304f=0x0;_0x48304f<_0xb16b8f[_0xfc04('0x47')]['ids']['length'];_0x48304f+=0x1){socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f['query']['ids'][_0x48304f]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}}else{socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a2e2d,null))['catch'](handleError(_0x2a2e2d,null));};exports[_0xfc04('0x133')]=function(_0x4f0ed0,_0xbb0f91,_0x4398f4){var _0x1624d0={};var _0x3e8dea={};var _0x154f95;var _0x1d15b8;return db['ChatWebsite']['findOne']({'where':{'id':_0x4f0ed0[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xbb0f91,null))['then'](function(_0x1d120b){if(_0x1d120b){_0x154f95=_0x1d120b;_0x3e8dea[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xca')][_0xfc04('0x43')]);_0x3e8dea[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x4f0ed0[_0xfc04('0x47')]);_0x3e8dea[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x3e8dea['model'],_0x3e8dea[_0xfc04('0x47')]);_0x1624d0[_0xfc04('0x4c')]=_['intersection'](_0x3e8dea[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x4f0ed0['query']['fields']));_0x1624d0[_0xfc04('0x4c')]=_0x1624d0[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x1624d0[_0xfc04('0x4c')]:_0x3e8dea[_0xfc04('0x46')];_0x1624d0[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x51')]);_0x1624d0[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x4f0ed0[_0xfc04('0x47')],_0x3e8dea[_0xfc04('0x49')]));if(_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]){_0x1624d0[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x1624d0['where'],{'$or':_[_0xfc04('0x42')](_0x1624d0[_0xfc04('0x4c')],function(_0x3f2e2e){var _0xe6baf={};_0xe6baf[_0x3f2e2e]={'$like':'%'+_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0xe6baf;})});}_0x1624d0=_[_0xfc04('0x57')]({},_0x1624d0,_0x4f0ed0['options']);return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2ae1a1){if(_0x2ae1a1){_0x1d15b8=_0x2ae1a1['length'];if(!_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x4e')]('nolimit')){_0x1624d0['limit']=qs[_0xfc04('0x32')](_0x4f0ed0[_0xfc04('0x47')]['limit']);_0x1624d0[_0xfc04('0x30')]=qs['offset'](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2599fd){if(_0x2599fd){return _0x2599fd?{'count':_0x1d15b8,'rows':_0x2599fd}:null;}})[_0xfc04('0x22')](respondWithResult(_0xbb0f91,null))['catch'](handleError(_0xbb0f91,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index fc97dbc..2705604 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 _0x35d0=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x35d0,0xf9));var _0x035d=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x35d0[_0x330723];return _0x60c546;};'use strict';var EventEmitter=require(_0x035d('0x0'));var ChatWebsite=require(_0x035d('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x035d('0x2')](0x0);var events={'afterCreate':_0x035d('0x3'),'afterUpdate':_0x035d('0x4'),'afterDestroy':_0x035d('0x5')};function emitEvent(_0x12fb05){return function(_0x16388a,_0x51fe09,_0x2a4bb2){ChatWebsiteEvents[_0x035d('0x6')](_0x12fb05+':'+_0x16388a['id'],_0x16388a);ChatWebsiteEvents[_0x035d('0x6')](_0x12fb05,_0x16388a);_0x2a4bb2(null);};}for(var e in events){if(events[_0x035d('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x035d('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe0c3=['events','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x1cdac4,_0x45db76){var _0xa4a3cb=function(_0x32a0f0){while(--_0x32a0f0){_0x1cdac4['push'](_0x1cdac4['shift']());}};_0xa4a3cb(++_0x45db76);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3e0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':_0x3e0c('0x3'),'afterUpdate':_0x3e0c('0x4'),'afterDestroy':_0x3e0c('0x5')};function emitEvent(_0x410ec4){return function(_0x31851c,_0x26c964,_0x1a026f){ChatWebsiteEvents['emit'](_0x410ec4+':'+_0x31851c['id'],_0x31851c);ChatWebsiteEvents['emit'](_0x410ec4,_0x31851c);_0x1a026f(null);};}for(var e in events){if(events[_0x3e0c('0x6')](e)){var event=events[e];ChatWebsite[_0x3e0c('0x7')](e,emitEvent(event));}}module[_0x3e0c('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index d044126..ff39b1c 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 _0x7825=['define','ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4f2dd0,_0x4cb95c){var _0x440de5=function(_0x977a8e){while(--_0x977a8e){_0x4f2dd0['push'](_0x4f2dd0['shift']());}};_0x440de5(++_0x4cb95c);}(_0x7825,0x122));var _0x5782=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0x7825[_0x54597a];return _0x5a764f;};'use strict';var _=require(_0x5782('0x0'));var util=require(_0x5782('0x1'));var logger=require(_0x5782('0x2'))('api');var moment=require(_0x5782('0x3'));var BPromise=require(_0x5782('0x4'));var rp=require(_0x5782('0x5'));var fs=require('fs');var path=require(_0x5782('0x6'));var rimraf=require('rimraf');var config=require(_0x5782('0x7'));var attributes=require(_0x5782('0x8'));module[_0x5782('0x9')]=function(_0x5035ee,_0x59e4f6){return _0x5035ee[_0x5782('0xa')](_0x5782('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6766=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6766,0x1f2));var _0x6676=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x6766[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x6676('0x0'));var util=require(_0x6676('0x1'));var logger=require(_0x6676('0x2'))(_0x6676('0x3'));var moment=require(_0x6676('0x4'));var BPromise=require(_0x6676('0x5'));var rp=require(_0x6676('0x6'));var fs=require('fs');var path=require(_0x6676('0x7'));var rimraf=require(_0x6676('0x8'));var config=require(_0x6676('0x9'));var attributes=require(_0x6676('0xa'));module['exports']=function(_0x14c67c,_0x319e6){return _0x14c67c[_0x6676('0xb')](_0x6676('0xc'),attributes,{'tableName':'chat_websites','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 231137e..4498946 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 _0x5a1c=['error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4ca90b,_0x21164d){var _0x55ab04=function(_0x36fe20){while(--_0x36fe20){_0x4ca90b['push'](_0x4ca90b['shift']());}};_0x55ab04(++_0x21164d);}(_0x5a1c,0xd6));var _0xc5a1=function(_0x74658d,_0x2e04ca){_0x74658d=_0x74658d-0x0;var _0x2c5d24=_0x5a1c[_0x74658d];return _0x2c5d24;};'use strict';var _=require('lodash');var util=require(_0xc5a1('0x0'));var moment=require('moment');var BPromise=require(_0xc5a1('0x1'));var rs=require(_0xc5a1('0x2'));var fs=require('fs');var Redis=require(_0xc5a1('0x3'));var db=require(_0xc5a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a1('0x7'));var client=jayson[_0xc5a1('0x8')][_0xc5a1('0x9')]({'port':0x232a});config[_0xc5a1('0xa')]=_[_0xc5a1('0xb')](config[_0xc5a1('0xa')],{'host':_0xc5a1('0xc'),'port':0x18eb});var socket=require(_0xc5a1('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xc5a1('0xe')](socket);function respondWithRpcPromise(_0x1e3032,_0x2afd71,_0x3421bc){return new BPromise(function(_0x57c2ee,_0xb6d372){return client[_0xc5a1('0xf')](_0x1e3032,_0x3421bc)[_0xc5a1('0x10')](function(_0x459e09){logger[_0xc5a1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,'request\x20sent');logger['debug'](_0xc5a1('0x12'),_0x2afd71,_0xc5a1('0x13'),JSON['stringify'](_0x459e09));if(_0x459e09['error']){if(_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x15')]===0x1f4){logger[_0xc5a1('0x14')](_0xc5a1('0x16'),_0x2afd71,_0x459e09[_0xc5a1('0x14')]['message']);return _0xb6d372(_0x459e09['error'][_0xc5a1('0x17')]);}logger[_0xc5a1('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x17')]);return _0x57c2ee(_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x17')]);}else{logger[_0xc5a1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,'request\x20sent');_0x57c2ee(_0x459e09[_0xc5a1('0x18')][_0xc5a1('0x17')]);}})[_0xc5a1('0x19')](function(_0x1a017c){logger[_0xc5a1('0x14')](_0xc5a1('0x16'),_0x2afd71,_0x1a017c);_0xb6d372(_0x1a017c);});});} \ No newline at end of file +var _0xaab5=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2bd5ec,_0x467020){var _0x5cebbb=function(_0x3ff0c7){while(--_0x3ff0c7){_0x2bd5ec['push'](_0x2bd5ec['shift']());}};_0x5cebbb(++_0x467020);}(_0xaab5,0x1e0));var _0x5aab=function(_0x40e65b,_0x51a4c1){_0x40e65b=_0x40e65b-0x0;var _0x329dba=_0xaab5[_0x40e65b];return _0x329dba;};'use strict';var _=require('lodash');var util=require(_0x5aab('0x0'));var moment=require(_0x5aab('0x1'));var BPromise=require(_0x5aab('0x2'));var rs=require(_0x5aab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5aab('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5aab('0x5'));var jayson=require(_0x5aab('0x6'));var client=jayson[_0x5aab('0x7')][_0x5aab('0x8')]({'port':0x232a});config[_0x5aab('0x9')]=_[_0x5aab('0xa')](config[_0x5aab('0x9')],{'host':_0x5aab('0xb'),'port':0x18eb});var socket=require(_0x5aab('0xc'))(new Redis(config[_0x5aab('0x9')]));require(_0x5aab('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ca3f3,_0x156757,_0x5f1334){return new BPromise(function(_0xb88f24,_0x128bb6){return client['request'](_0x1ca3f3,_0x5f1334)['then'](function(_0xeeaac9){logger[_0x5aab('0xe')](_0x5aab('0xf'),_0x156757,_0x5aab('0x10'));logger[_0x5aab('0x11')](_0x5aab('0x12'),_0x156757,_0x5aab('0x10'),JSON[_0x5aab('0x13')](_0xeeaac9));if(_0xeeaac9[_0x5aab('0x14')]){if(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x15')]===0x1f4){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9['error']['message']);return _0x128bb6(_0xeeaac9[_0x5aab('0x14')]['message']);}logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9[_0x5aab('0x14')]['message']);return _0xb88f24(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x16')]);}else{logger['info'](_0x5aab('0xf'),_0x156757,'request\x20sent');_0xb88f24(_0xeeaac9['result'][_0x5aab('0x16')]);}})[_0x5aab('0x17')](function(_0x2a4398){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0x2a4398);_0x128bb6(_0x2a4398);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a719c67..cf04254 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 _0xe6a8=['removeListener','register','length','chatWebsite:','./chatWebsite.events','emit'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xe6a8,0x1c6));var _0x8e6a=function(_0x24378d,_0x253b49){_0x24378d=_0x24378d-0x0;var _0x56c4e0=_0xe6a8[_0x24378d];return _0x56c4e0;};'use strict';var ChatWebsiteEvents=require(_0x8e6a('0x0'));var events=['save','remove','update'];function createListener(_0x51fbb5,_0x1c1ff0){return function(_0x4fbe7d){_0x1c1ff0[_0x8e6a('0x1')](_0x51fbb5,_0x4fbe7d);};}function removeListener(_0x631e69,_0x32661d){return function(){ChatWebsiteEvents[_0x8e6a('0x2')](_0x631e69,_0x32661d);};}exports[_0x8e6a('0x3')]=function(_0x4a30f3){for(var _0x41d48b=0x0,_0x367889=events[_0x8e6a('0x4')];_0x41d48b<_0x367889;_0x41d48b++){var _0x403bfd=events[_0x41d48b];var _0x207977=createListener(_0x8e6a('0x5')+_0x403bfd,_0x4a30f3);ChatWebsiteEvents['on'](_0x403bfd,_0x207977);}}; \ No newline at end of file +var _0xe9f0=['./chatWebsite.events','save','remove','update','emit','removeListener','length','chatWebsite:'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0xe9f0,0x140));var _0x0e9f=function(_0x1ee568,_0x5593b7){_0x1ee568=_0x1ee568-0x0;var _0x52c783=_0xe9f0[_0x1ee568];return _0x52c783;};'use strict';var ChatWebsiteEvents=require(_0x0e9f('0x0'));var events=[_0x0e9f('0x1'),_0x0e9f('0x2'),_0x0e9f('0x3')];function createListener(_0x4258b8,_0x36a4bc){return function(_0x1ef4e5){_0x36a4bc[_0x0e9f('0x4')](_0x4258b8,_0x1ef4e5);};}function removeListener(_0x49487e,_0x578c92){return function(){ChatWebsiteEvents[_0x0e9f('0x5')](_0x49487e,_0x578c92);};}exports['register']=function(_0x11f26c){for(var _0x9b7ee1=0x0,_0x300e9e=events[_0x0e9f('0x6')];_0x9b7ee1<_0x300e9e;_0x9b7ee1++){var _0x19e41d=events[_0x9b7ee1];var _0x28da26=createListener(_0x0e9f('0x7')+_0x19e41d,_0x11f26c);ChatWebsiteEvents['on'](_0x19e41d,_0x28da26);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ce3f9ba..2bb364e 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 _0xa6e5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','util','connect-timeout'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa6e5,0x1a7));var _0x5a6e=function(_0xb5f5b3,_0x97d715){_0xb5f5b3=_0xb5f5b3-0x0;var _0x38d5b0=_0xa6e5[_0xb5f5b3];return _0x38d5b0;};'use strict';var multer=require(_0x5a6e('0x0'));var util=require(_0x5a6e('0x1'));var path=require('path');var timeout=require(_0x5a6e('0x2'));var express=require('express');var router=express[_0x5a6e('0x3')]();var fs_extra=require(_0x5a6e('0x4'));var auth=require(_0x5a6e('0x5'));var interaction=require(_0x5a6e('0x6'));var config=require(_0x5a6e('0x7'));var controller=require(_0x5a6e('0x8'));router[_0x5a6e('0x9')]('/',auth['isAuthenticated'](),controller[_0x5a6e('0xa')]);router[_0x5a6e('0x9')]('/describe',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0xc')]);router['get'](_0x5a6e('0xd'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5a6e('0xf')]);router['get'](_0x5a6e('0x10'),auth[_0x5a6e('0xb')](),controller['getAnswers']);router[_0x5a6e('0x9')](_0x5a6e('0x11'),controller[_0x5a6e('0x12')]);router[_0x5a6e('0x9')](_0x5a6e('0x13'),controller[_0x5a6e('0x14')]);router[_0x5a6e('0x9')](_0x5a6e('0x15'),controller[_0x5a6e('0x16')]);router[_0x5a6e('0x9')](_0x5a6e('0x17'),controller['getSystemAvatar']);router[_0x5a6e('0x9')]('/:id/interactions',auth[_0x5a6e('0xb')](),controller['getInteractions']);router['get'](_0x5a6e('0x18'),controller[_0x5a6e('0x19')]);router[_0x5a6e('0x9')](_0x5a6e('0x1a'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x1b')]);router['get'](_0x5a6e('0x1c'),auth['isAuthenticated'](),controller[_0x5a6e('0x1d')]);router[_0x5a6e('0x9')]('/:id/fields',controller[_0x5a6e('0x1e')]);router[_0x5a6e('0x9')]('/:id/offline_messages',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x1f')]);router[_0x5a6e('0x9')](_0x5a6e('0x20'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x21')]);router[_0x5a6e('0x22')]('/',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x23')]);router[_0x5a6e('0x22')](_0x5a6e('0x24'),auth['isAuthenticated'](),controller[_0x5a6e('0x25')]);router['post'](_0x5a6e('0x10'),auth['isAuthenticated'](),controller[_0x5a6e('0x26')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x3f4d5e,_0x59c536,_0x6f700f){_0x6f700f(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],'server/files/images/logos/'));},'filename':function(_0x7e65a4,_0x3fb317,_0x5d94b6){_0x5d94b6(null,util['format'](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x3fb317[_0x5a6e('0x2c')]));}})});router[_0x5a6e('0x22')](_0x5a6e('0x11'),upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x2f')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x5d7cc5,_0x1590ed,_0x4d5a64){_0x4d5a64(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0xef61e9,_0x4c4c9f,_0x16a52a){_0x16a52a(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x4c4c9f['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x5a6e('0x2e')),controller[_0x5a6e('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12904e,_0x475b76,_0x1b0965){_0x1b0965(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0x419fa0,_0x2668ac,_0x46646e){_0x46646e(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x2668ac[_0x5a6e('0x2c')]));}})});router[_0x5a6e('0x22')]('/:id/customer_avatar',upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x33')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x431b70,_0x21a147,_0x103987){_0x103987(null,path['join'](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0x120af2,_0x16da75,_0xdfdee7){_0xdfdee7(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date['now'](),_0x16da75[_0x5a6e('0x2c')]));}})});router['post'](_0x5a6e('0x17'),upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x34')]);router[_0x5a6e('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x321d3f,_0x1bda36,_0x5dbecb){const _0x49a0a7=path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x35'),_0x5a6e('0x36'),_0x5a6e('0x37'));fs_extra[_0x5a6e('0x38')](_0x49a0a7,function(){_0x5dbecb(null,_0x49a0a7);});},'filename':function(_0x3a8cfc,_0x1c0184,_0x5e9685){const _0x4dbcc7=_0x1c0184['originalname'][_0x5a6e('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2fb44e=path[_0x5a6e('0x3a')](_0x4dbcc7);const _0x1106df=Date[_0x5a6e('0x2b')]()+'-'+_0x4dbcc7[_0x5a6e('0x39')](_0x2fb44e,'')+_0x2fb44e;_0x5e9685(null,_0x1106df);}})});router[_0x5a6e('0x22')]('/:id/offline',offlineUploadMulter[_0x5a6e('0x3b')](),controller[_0x5a6e('0x3c')]);router['post'](_0x5a6e('0x3d'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x5a6e('0x22')](_0x5a6e('0x1a'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x3e')]);router[_0x5a6e('0x22')](_0x5a6e('0x1c'),auth['isAuthenticated'](),controller[_0x5a6e('0x3f')]);router[_0x5a6e('0x22')]('/:id/users',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x40')]);router[_0x5a6e('0x41')](_0x5a6e('0xd'),auth['isAuthenticated'](),controller[_0x5a6e('0x42')]);router[_0x5a6e('0x43')](_0x5a6e('0xd'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x44')]);router['delete'](_0x5a6e('0x24'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5a6e('0x43')](_0x5a6e('0x10'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x45')]);router[_0x5a6e('0x43')]('/:id/users',auth[_0x5a6e('0xb')](),controller['removeAgents']);module[_0x5a6e('0x46')]=router; \ No newline at end of file +var _0x3982=['describe','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','notify','server/files','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','put','/:id','update','destroy','/:id/dispositions','removeDispositions','removeAnswers','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe'];(function(_0x331e77,_0x114123){var _0x5b1b95=function(_0x1691ae){while(--_0x1691ae){_0x331e77['push'](_0x331e77['shift']());}};_0x5b1b95(++_0x114123);}(_0x3982,0x196));var _0x2398=function(_0x2bf68c,_0x18920b){_0x2bf68c=_0x2bf68c-0x0;var _0x54c487=_0x3982[_0x2bf68c];return _0x54c487;};'use strict';var multer=require(_0x2398('0x0'));var util=require(_0x2398('0x1'));var path=require(_0x2398('0x2'));var timeout=require(_0x2398('0x3'));var express=require(_0x2398('0x4'));var router=express[_0x2398('0x5')]();var fs_extra=require(_0x2398('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2398('0x7'));var config=require(_0x2398('0x8'));var controller=require(_0x2398('0x9'));router['get']('/',auth[_0x2398('0xa')](),controller[_0x2398('0xb')]);router[_0x2398('0xc')](_0x2398('0xd'),auth[_0x2398('0xa')](),controller[_0x2398('0xe')]);router['get']('/:id',auth[_0x2398('0xa')](),controller['show']);router[_0x2398('0xc')]('/:id/dispositions',auth[_0x2398('0xa')](),controller['getDispositions']);router[_0x2398('0xc')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x10')]);router[_0x2398('0xc')](_0x2398('0x11'),controller['getLogo']);router[_0x2398('0xc')](_0x2398('0x12'),controller[_0x2398('0x13')]);router[_0x2398('0xc')](_0x2398('0x14'),controller['getCustomerAvatar']);router[_0x2398('0xc')](_0x2398('0x15'),controller['getSystemAvatar']);router[_0x2398('0xc')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2398('0x16')]);router['get'](_0x2398('0x17'),controller[_0x2398('0x18')]);router['get'](_0x2398('0x19'),auth['isAuthenticated'](),controller[_0x2398('0x1a')]);router[_0x2398('0xc')](_0x2398('0x1b'),auth[_0x2398('0xa')](),controller[_0x2398('0x1c')]);router['get'](_0x2398('0x1d'),controller[_0x2398('0x1e')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2398('0x1f')]);router[_0x2398('0xc')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller[_0x2398('0x21')]);router[_0x2398('0x22')]('/',auth[_0x2398('0xa')](),controller['create']);router[_0x2398('0x22')]('/:id/dispositions',auth[_0x2398('0xa')](),controller[_0x2398('0x23')]);router[_0x2398('0x22')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x24')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x460ecc,_0x497ad3,_0x195dbb){_0x195dbb(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x28')));},'filename':function(_0x4763d9,_0x38d99d,_0x5647d6){_0x5647d6(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x38d99d[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x11'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller[_0x2398('0x2f')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x137609,_0x47e9f4,_0x246673){_0x246673(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x2d4f45,_0x146874,_0xeb3da0){_0xeb3da0(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date['now'](),_0x146874[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x12'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x4127f8,_0x169c00,_0x1025a5){_0x1025a5(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x336bf1,_0x5e2354,_0x6b3add){_0x6b3add(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x5e2354[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x14'),upload[_0x2398('0x2d')]('file'),controller[_0x2398('0x31')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x15c7b0,_0x207d00,_0x34fc5a){_0x34fc5a(null,path['join'](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0xc03907,_0x44f176,_0x40afa2){_0x40afa2(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x44f176[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x15'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addSystemAvatar']);router[_0x2398('0x22')]('/:id/notify',controller[_0x2398('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x3a5bf7,_0x5c937d,_0x34a0c5){const _0x500dca=path['join'](config[_0x2398('0x27')],_0x2398('0x33'),'attachments',_0x2398('0x34'));fs_extra[_0x2398('0x35')](_0x500dca,function(){_0x34a0c5(null,_0x500dca);});},'filename':function(_0x158980,_0x513f8d,_0x33c658){const _0x5bde9f=_0x513f8d[_0x2398('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x57d52a=path[_0x2398('0x36')](_0x5bde9f);const _0x88d459=Date['now']()+'-'+_0x5bde9f[_0x2398('0x37')](_0x57d52a,'')+_0x57d52a;_0x33c658(null,_0x88d459);}})});router[_0x2398('0x22')](_0x2398('0x38'),offlineUploadMulter[_0x2398('0x39')](),controller[_0x2398('0x3a')]);router[_0x2398('0x22')](_0x2398('0x3b'),auth[_0x2398('0xa')](),controller[_0x2398('0x3c')]);router[_0x2398('0x22')]('/:id/applications',auth[_0x2398('0xa')](),controller['addApplications']);router[_0x2398('0x22')](_0x2398('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2398('0x22')](_0x2398('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2398('0x3d')](_0x2398('0x3e'),auth[_0x2398('0xa')](),controller[_0x2398('0x3f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2398('0x40')]);router['delete'](_0x2398('0x41'),auth[_0x2398('0xa')](),controller[_0x2398('0x42')]);router['delete'](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x43')]);router[_0x2398('0x44')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller['removeAgents']);module[_0x2398('0x45')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index aa87988..8264e56 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 _0x7d10=['AmazonAWS','Google','exports','STRING'];(function(_0x53a020,_0x5d8f62){var _0x26b9d5=function(_0x3c28aa){while(--_0x3c28aa){_0x53a020['push'](_0x53a020['shift']());}};_0x26b9d5(++_0x5d8f62);}(_0x7d10,0x1ce));var _0x07d1=function(_0x326aef,_0x57184f){_0x326aef=_0x326aef-0x0;var _0x41536e=_0x7d10[_0x326aef];return _0x41536e;};'use strict';var Sequelize=require('sequelize');module[_0x07d1('0x0')]={'name':{'type':Sequelize[_0x07d1('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x07d1('0x2'),_0x07d1('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x07d1('0x1')]}}; \ No newline at end of file +var _0x7eff=['ENUM','Google','exports','STRING'];(function(_0x2596e6,_0x1d37fb){var _0x1d37d6=function(_0x3ce9b7){while(--_0x3ce9b7){_0x2596e6['push'](_0x2596e6['shift']());}};_0x1d37d6(++_0x1d37fb);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf7ef('0x0')]={'name':{'type':Sequelize[_0xf7ef('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf7ef('0x2')]('AmazonAWS',_0xf7ef('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf7ef('0x1')]},'data2':{'type':Sequelize[_0xf7ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c9f472e..f2cdbe4 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0x2abf5c,_0x4fecaf){_0x2abf5c=_0x2abf5c-0x0;var _0x3677eb=_0xadb5[_0x2abf5c];return _0x3677eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ee191,_0x2b8c91){_0x1ee191=_0x1ee191-0x0;var _0x5288bc=_0x5f2f[_0x1ee191];return _0x5288bc;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 977ef4d..21665b3 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 _0x5a60=['cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5a60,0x1f0));var _0x05a6=function(_0x325b0c,_0x33747f){_0x325b0c=_0x325b0c-0x0;var _0x8e3945=_0x5a60[_0x325b0c];return _0x8e3945;};'use strict';var _=require('lodash');var util=require(_0x05a6('0x0'));var logger=require(_0x05a6('0x1'))(_0x05a6('0x2'));var moment=require(_0x05a6('0x3'));var BPromise=require(_0x05a6('0x4'));var rp=require(_0x05a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05a6('0x6'));var config=require(_0x05a6('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x05a6('0x8')]=function(_0xd8dd87,_0xe35541){return _0xd8dd87[_0x05a6('0x9')]('CloudProvider',attributes,{'tableName':_0x05a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb85c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util'];(function(_0x33d6b0,_0x183044){var _0x41d3d9=function(_0x5aead0){while(--_0x5aead0){_0x33d6b0['push'](_0x33d6b0['shift']());}};_0x41d3d9(++_0x183044);}(_0xb85c,0x197));var _0xcb85=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb85c[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0xcb85('0x0'));var logger=require(_0xcb85('0x1'))(_0xcb85('0x2'));var moment=require(_0xcb85('0x3'));var BPromise=require(_0xcb85('0x4'));var rp=require(_0xcb85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb85('0x6'));var config=require(_0xcb85('0x7'));var attributes=require(_0xcb85('0x8'));module[_0xcb85('0x9')]=function(_0xadfd76,_0x24fd74){return _0xadfd76[_0xcb85('0xa')](_0xcb85('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2ed6ff0..15e1c03 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 _0xcf3d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x15dc42,_0x345727){var _0x7bb3b5=function(_0x25c7d7){while(--_0x25c7d7){_0x15dc42['push'](_0x15dc42['shift']());}};_0x7bb3b5(++_0x345727);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x19f8e6,_0xaf2ce1){_0x19f8e6=_0x19f8e6-0x0;var _0x2f76d9=_0xcf3d[_0x19f8e6];return _0x2f76d9;};'use strict';var _=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var moment=require(_0xdcf3('0x2'));var BPromise=require(_0xdcf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcf3('0x5'));var logger=require(_0xdcf3('0x6'))(_0xdcf3('0x7'));var config=require(_0xdcf3('0x8'));var jayson=require(_0xdcf3('0x9'));var client=jayson[_0xdcf3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43f8d5,_0x47dde8,_0x2cd0af){return new BPromise(function(_0x45c5bd,_0x55fe3a){return client['request'](_0x43f8d5,_0x2cd0af)['then'](function(_0x4515a2){logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));logger[_0xdcf3('0xe')](_0xdcf3('0xf'),_0x47dde8,_0xdcf3('0xd'),JSON[_0xdcf3('0x10')](_0x4515a2));if(_0x4515a2[_0xdcf3('0x11')]){if(_0x4515a2['error'][_0xdcf3('0x12')]===0x1f4){logger[_0xdcf3('0x11')]('CloudProvider,\x20%s,\x20%s',_0x47dde8,_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);return _0x55fe3a(_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);}logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x4515a2[_0xdcf3('0x11')]['message']);return _0x45c5bd(_0x4515a2[_0xdcf3('0x11')]['message']);}else{logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));_0x45c5bd(_0x4515a2[_0xdcf3('0x14')]['message']);}})[_0xdcf3('0x15')](function(_0x24cce5){logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x24cce5);_0x55fe3a(_0x24cce5);});});} \ No newline at end of file +var _0x531a=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x19fabd,_0x4cf7d5){var _0x2fa7d8=function(_0x121c85){while(--_0x121c85){_0x19fabd['push'](_0x19fabd['shift']());}};_0x2fa7d8(++_0x4cf7d5);}(_0x531a,0x100));var _0xa531=function(_0x3e6aed,_0x97a2f1){_0x3e6aed=_0x3e6aed-0x0;var _0x3220dd=_0x531a[_0x3e6aed];return _0x3220dd;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 0b0f788..4fd9bfe 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 _0x41ca=['../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','fs-extra'];(function(_0x308f6d,_0x9277bc){var _0xb3921e=function(_0x1b4e22){while(--_0x1b4e22){_0x308f6d['push'](_0x308f6d['shift']());}};_0xb3921e(++_0x9277bc);}(_0x41ca,0x195));var _0xa41c=function(_0x152c88,_0x5949dd){_0x152c88=_0x152c88-0x0;var _0x3fa8b6=_0x41ca[_0x152c88];return _0x3fa8b6;};'use strict';var multer=require(_0xa41c('0x0'));var util=require(_0xa41c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa41c('0x2'));var auth=require(_0xa41c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa41c('0x4'));router[_0xa41c('0x5')]('/',auth[_0xa41c('0x6')](),controller[_0xa41c('0x7')]);router['get'](_0xa41c('0x8'),auth['isAuthenticated'](),controller[_0xa41c('0x9')]);router[_0xa41c('0xa')]('/',auth[_0xa41c('0x6')](),controller[_0xa41c('0xb')]);router[_0xa41c('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa41c('0xd')]);router[_0xa41c('0xe')](_0xa41c('0x8'),auth[_0xa41c('0x6')](),controller[_0xa41c('0xf')]);module[_0xa41c('0x10')]=router; \ No newline at end of file +var _0x4ba1=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x1ef49c,_0x55c959){var _0x1936ef=function(_0x1d23d4){while(--_0x1d23d4){_0x1ef49c['push'](_0x1ef49c['shift']());}};_0x1936ef(++_0x55c959);}(_0x4ba1,0x159));var _0x14ba=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4ba1[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var path=require(_0x14ba('0x2'));var timeout=require(_0x14ba('0x3'));var express=require(_0x14ba('0x4'));var router=express['Router']();var fs_extra=require(_0x14ba('0x5'));var auth=require(_0x14ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x14ba('0x7'));var controller=require(_0x14ba('0x8'));router[_0x14ba('0x9')]('/',auth[_0x14ba('0xa')](),controller[_0x14ba('0xb')]);router[_0x14ba('0x9')](_0x14ba('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x14ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x14ba('0xe')]);router[_0x14ba('0xf')](_0x14ba('0xc'),auth['isAuthenticated'](),controller[_0x14ba('0x10')]);router[_0x14ba('0x11')](_0x14ba('0xc'),auth[_0x14ba('0xa')](),controller[_0x14ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 8fbbdf2..374aef4 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 _0xe68d=['name','sequelize','STRING'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0xe68d,0xcd));var _0xde68=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0xe68d[_0x8e8ca7];return _0x561381;};'use strict';var Sequelize=require(_0xde68('0x0'));module['exports']={'name':{'type':Sequelize[_0xde68('0x1')],'unique':_0xde68('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xde68('0x1')]},'website':{'type':Sequelize[_0xde68('0x1')]},'phone':{'type':Sequelize[_0xde68('0x1')]},'fax':{'type':Sequelize[_0xde68('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xde68('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xde68('0x1')]},'email':{'type':Sequelize[_0xde68('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xde68('0x1')]},'sStreet':{'type':Sequelize[_0xde68('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xde68('0x1')]},'sCountry':{'type':Sequelize[_0xde68('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x68de=['STRING','sequelize','exports'];(function(_0x2eb067,_0x1b0899){var _0xf87aaf=function(_0x7f9ce3){while(--_0x7f9ce3){_0x2eb067['push'](_0x2eb067['shift']());}};_0xf87aaf(++_0x1b0899);}(_0x68de,0xfa));var _0xe68d=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x68de[_0x1b25c1];return _0x1e4447;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'name':{'type':Sequelize[_0xe68d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe68d('0x2')]},'companyId':{'type':Sequelize[_0xe68d('0x2')]},'website':{'type':Sequelize[_0xe68d('0x2')]},'phone':{'type':Sequelize[_0xe68d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe68d('0x2')]},'street':{'type':Sequelize[_0xe68d('0x2')]},'postalCode':{'type':Sequelize[_0xe68d('0x2')]},'city':{'type':Sequelize[_0xe68d('0x2')]},'country':{'type':Sequelize[_0xe68d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe68d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe68d('0x2')]},'sCity':{'type':Sequelize[_0xe68d('0x2')]},'sCountry':{'type':Sequelize[_0xe68d('0x2')]},'description':{'type':Sequelize[_0xe68d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6bfc426..d042390 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 _0x6abf=['apply','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x4a42f0,_0x2da65d){var _0x3dc532=function(_0xb60cdf){while(--_0xb60cdf){_0x4a42f0['push'](_0x4a42f0['shift']());}};_0x3dc532(++_0x2da65d);}(_0x6abf,0x90));var _0xf6ab=function(_0x23270f,_0x5a8ffb){_0x23270f=_0x23270f-0x0;var _0x6a062b=_0x6abf[_0x23270f];return _0x6a062b;};'use strict';var emlformat=require(_0xf6ab('0x0'));var rimraf=require(_0xf6ab('0x1'));var zipdir=require(_0xf6ab('0x2'));var jsonpatch=require(_0xf6ab('0x3'));var rp=require(_0xf6ab('0x4'));var moment=require(_0xf6ab('0x5'));var BPromise=require(_0xf6ab('0x6'));var Mustache=require(_0xf6ab('0x7'));var util=require(_0xf6ab('0x8'));var path=require('path');var sox=require(_0xf6ab('0x9'));var csv=require(_0xf6ab('0xa'));var ejs=require(_0xf6ab('0xb'));var fs=require('fs');var fs_extra=require(_0xf6ab('0xc'));var _=require(_0xf6ab('0xd'));var squel=require(_0xf6ab('0xe'));var crypto=require(_0xf6ab('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf6ab('0x10'));var toCsv=require(_0xf6ab('0xa'));var querystring=require(_0xf6ab('0x11'));var Papa=require('papaparse');var Redis=require(_0xf6ab('0x12'));var authService=require(_0xf6ab('0x13'));var qs=require(_0xf6ab('0x14'));var as=require(_0xf6ab('0x15'));var hardwareService=require(_0xf6ab('0x16'));var logger=require(_0xf6ab('0x17'))(_0xf6ab('0x18'));var utils=require(_0xf6ab('0x19'));var config=require(_0xf6ab('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6ab('0x1b'))['db'];function respondWithStatusCode(_0x2cf7b5,_0x20beb8){_0x20beb8=_0x20beb8||0xcc;return function(_0x12dd75){if(_0x12dd75){return _0x2cf7b5[_0xf6ab('0x1c')](_0x20beb8);}return _0x2cf7b5['status'](_0x20beb8)[_0xf6ab('0x1d')]();};}function respondWithResult(_0x17149a,_0x3e51ad){_0x3e51ad=_0x3e51ad||0xc8;return function(_0x4c3992){if(_0x4c3992){return _0x17149a[_0xf6ab('0x1e')](_0x3e51ad)[_0xf6ab('0x1f')](_0x4c3992);}};}function respondWithFilteredResult(_0x23e839,_0x56e36f){return function(_0x25ff20){if(_0x25ff20){var _0x3979d5=typeof _0x56e36f['offset']===_0xf6ab('0x20')&&typeof _0x56e36f[_0xf6ab('0x21')]===_0xf6ab('0x20');var _0x170bd2=_0x25ff20[_0xf6ab('0x22')];var _0x25b157=_0x3979d5?0x0:_0x56e36f['offset'];var _0x302a15=_0x3979d5?_0x25ff20[_0xf6ab('0x22')]:_0x56e36f[_0xf6ab('0x23')]+_0x56e36f[_0xf6ab('0x21')];var _0x464d34;if(_0x302a15>=_0x170bd2){_0x302a15=_0x170bd2;_0x464d34=0xc8;}else{_0x464d34=0xce;}_0x23e839[_0xf6ab('0x1e')](_0x464d34);return _0x23e839[_0xf6ab('0x24')](_0xf6ab('0x25'),_0x25b157+'-'+_0x302a15+'/'+_0x170bd2)['json'](_0x25ff20);}return null;};}function patchUpdates(_0xcba4da){return function(_0x3066da){try{jsonpatch[_0xf6ab('0x26')](_0x3066da,_0xcba4da,!![]);}catch(_0xb6b24a){return BPromise['reject'](_0xb6b24a);}return _0x3066da['save']();};}function saveUpdates(_0x5be73d,_0x2a9bfd){return function(_0x3f77b4){if(_0x3f77b4){return _0x3f77b4[_0xf6ab('0x27')](_0x5be73d)[_0xf6ab('0x28')](function(_0x1bb3d9){return _0x1bb3d9;});}return null;};}function removeEntity(_0xcf3532,_0x269a27){return function(_0x54f75e){if(_0x54f75e){return _0x54f75e[_0xf6ab('0x29')]()[_0xf6ab('0x28')](function(){var _0x28734d=_0x54f75e[_0xf6ab('0x2a')]({'plain':!![]});var _0x556076=_0xf6ab('0x2b');return db['UserProfileResource'][_0xf6ab('0x29')]({'where':{'type':_0x556076,'resourceId':_0x28734d['id']}})['then'](function(){return _0x54f75e;});})[_0xf6ab('0x28')](function(){_0xcf3532[_0xf6ab('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404493,_0x360c80){return function(_0x118391){if(!_0x118391){_0x404493[_0xf6ab('0x1c')](0x194);}return _0x118391;};}function handleError(_0xc4ab96,_0xcf814c){_0xcf814c=_0xcf814c||0x1f4;return function(_0x2b2ad2){logger[_0xf6ab('0x2c')](_0x2b2ad2[_0xf6ab('0x2d')]);if(_0x2b2ad2[_0xf6ab('0x2e')]){delete _0x2b2ad2[_0xf6ab('0x2e')];}_0xc4ab96[_0xf6ab('0x1e')](_0xcf814c)[_0xf6ab('0x2f')](_0x2b2ad2);};}exports[_0xf6ab('0x30')]=function(_0x3ab182,_0x480ee5){var _0x3501c5={},_0x4940d5={},_0x335dd5={'count':0x0,'rows':[]};return db[_0xf6ab('0x31')][_0xf6ab('0x32')]()['then'](function(_0x374a7c){_0x4940d5['model']=_[_0xf6ab('0x33')](_0x374a7c);_0x4940d5[_0xf6ab('0x34')]=_[_0xf6ab('0x33')](_0x3ab182[_0xf6ab('0x34')]);_0x4940d5[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x4940d5[_0xf6ab('0x37')],_0x4940d5[_0xf6ab('0x34')]);_0x3501c5[_0xf6ab('0x38')]=_[_0xf6ab('0x36')](_0x4940d5[_0xf6ab('0x37')],qs['fields'](_0x3ab182[_0xf6ab('0x34')]['fields']));_0x3501c5[_0xf6ab('0x38')]=_0x3501c5[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0x3501c5['attributes']:_0x4940d5[_0xf6ab('0x37')];if(!_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x3a')](_0xf6ab('0x3b'))){_0x3501c5[_0xf6ab('0x21')]=qs[_0xf6ab('0x21')](_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x21')]);_0x3501c5[_0xf6ab('0x23')]=qs[_0xf6ab('0x23')](_0x3ab182['query'][_0xf6ab('0x23')]);}_0x3501c5[_0xf6ab('0x3c')]=qs[_0xf6ab('0x3d')](_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x3d')]);_0x3501c5[_0xf6ab('0x3e')]=qs[_0xf6ab('0x35')](_['pick'](_0x3ab182[_0xf6ab('0x34')],_0x4940d5[_0xf6ab('0x35')]),_0x374a7c);if(_0x3ab182['query'][_0xf6ab('0x3f')]){_0x3501c5['where']=_[_0xf6ab('0x40')](_0x3501c5[_0xf6ab('0x3e')],{'$or':_[_0xf6ab('0x41')](_0x3501c5[_0xf6ab('0x38')],function(_0x3eb7e3){var _0xdcb9d1={};_0xdcb9d1[_0x3eb7e3]={'$like':'%'+_0x3ab182['query'][_0xf6ab('0x3f')]+'%'};return _0xdcb9d1;})});}_0x3501c5=_['merge']({},_0x3501c5,_0x3ab182[_0xf6ab('0x42')]);var _0x428c8b={'where':_0x3501c5[_0xf6ab('0x3e')]};return db['CmCompany']['count'](_0x428c8b)[_0xf6ab('0x28')](function(_0x315087){_0x335dd5[_0xf6ab('0x22')]=_0x315087;if(_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x43')]){_0x3501c5['include']=[{'all':!![]}];}return db[_0xf6ab('0x31')][_0xf6ab('0x44')](_0x3501c5);})['then'](function(_0x192151){_0x335dd5[_0xf6ab('0x45')]=_0x192151;return _0x335dd5;})[_0xf6ab('0x28')](respondWithFilteredResult(_0x480ee5,_0x3501c5))['catch'](handleError(_0x480ee5,null));})[_0xf6ab('0x46')](handleError(_0x480ee5,null));};exports[_0xf6ab('0x47')]=function(_0x14de97,_0x357fb1){var _0xff7cc4={'raw':![],'where':{'id':_0x14de97[_0xf6ab('0x48')]['id']}},_0x17247e={};_0x17247e[_0xf6ab('0x37')]=_['keys'](db[_0xf6ab('0x31')][_0xf6ab('0x49')]);_0x17247e[_0xf6ab('0x34')]=_[_0xf6ab('0x33')](_0x14de97['query']);_0x17247e[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x17247e[_0xf6ab('0x37')],_0x17247e['query']);_0xff7cc4[_0xf6ab('0x38')]=_[_0xf6ab('0x36')](_0x17247e['model'],qs[_0xf6ab('0x4a')](_0x14de97[_0xf6ab('0x34')][_0xf6ab('0x4a')]));_0xff7cc4[_0xf6ab('0x38')]=_0xff7cc4[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0xff7cc4['attributes']:_0x17247e['model'];if(_0x14de97['query'][_0xf6ab('0x43')]){_0xff7cc4[_0xf6ab('0x4b')]=[{'all':!![]}];}_0xff7cc4=_[_0xf6ab('0x40')]({},_0xff7cc4,_0x14de97['options']);return db[_0xf6ab('0x31')][_0xf6ab('0x4c')](_0xff7cc4)[_0xf6ab('0x28')](handleEntityNotFound(_0x357fb1,null))[_0xf6ab('0x28')](respondWithResult(_0x357fb1,null))[_0xf6ab('0x46')](handleError(_0x357fb1,null));};exports[_0xf6ab('0x4d')]=function(_0x208e1,_0xf67702){return db[_0xf6ab('0x31')]['create'](_0x208e1['body'],{})[_0xf6ab('0x28')](function(_0x4ffe9a){var _0x597cf0=_0x208e1[_0xf6ab('0x4e')][_0xf6ab('0x2a')]({'plain':!![]});if(!_0x597cf0)throw new Error(_0xf6ab('0x4f'));if(_0x597cf0[_0xf6ab('0x50')]===_0xf6ab('0x4e')){var _0x35b005=_0x4ffe9a['get']({'plain':!![]});var _0x17addb=_0xf6ab('0x2b');return db['UserProfileSection'][_0xf6ab('0x4c')]({'where':{'name':_0x17addb,'userProfileId':_0x597cf0[_0xf6ab('0x51')]},'raw':!![]})[_0xf6ab('0x28')](function(_0x11fb8d){if(_0x11fb8d&&_0x11fb8d[_0xf6ab('0x52')]===0x0){return db['UserProfileResource'][_0xf6ab('0x4d')]({'name':_0x35b005[_0xf6ab('0x2e')],'resourceId':_0x35b005['id'],'type':_0x11fb8d[_0xf6ab('0x2e')],'sectionId':_0x11fb8d['id']},{})[_0xf6ab('0x28')](function(){return _0x4ffe9a;});}else{return _0x4ffe9a;}})['catch'](function(_0x362a2c){logger[_0xf6ab('0x2c')](_0xf6ab('0x53'),_0x362a2c);throw _0x362a2c;});}return _0x4ffe9a;})['then'](respondWithResult(_0xf67702,0xc9))[_0xf6ab('0x46')](handleError(_0xf67702,null));};exports[_0xf6ab('0x27')]=function(_0x1dde52,_0x1231de){if(_0x1dde52[_0xf6ab('0x54')]['id']){delete _0x1dde52[_0xf6ab('0x54')]['id'];}return db[_0xf6ab('0x31')][_0xf6ab('0x4c')]({'where':{'id':_0x1dde52[_0xf6ab('0x48')]['id']}})[_0xf6ab('0x28')](handleEntityNotFound(_0x1231de,null))[_0xf6ab('0x28')](saveUpdates(_0x1dde52[_0xf6ab('0x54')],null))['then'](respondWithResult(_0x1231de,null))[_0xf6ab('0x46')](handleError(_0x1231de,null));};exports[_0xf6ab('0x29')]=function(_0x6d7349,_0x1e9903){return db['CmCompany']['find']({'where':{'id':_0x6d7349['params']['id']}})['then'](handleEntityNotFound(_0x1e9903,null))[_0xf6ab('0x28')](removeEntity(_0x1e9903,null))[_0xf6ab('0x46')](handleError(_0x1e9903,null));};exports[_0xf6ab('0x32')]=function(_0x48faa1,_0x380c3f){return db[_0xf6ab('0x31')][_0xf6ab('0x32')]()['then'](respondWithResult(_0x380c3f,null))[_0xf6ab('0x46')](handleError(_0x380c3f,null));};exports[_0xf6ab('0x55')]=function(_0x1001a1,_0x35d68c,_0x52fd77){return db[_0xf6ab('0x56')]['find']({'where':{'id':_0x1001a1[_0xf6ab('0x48')]['id']}})[_0xf6ab('0x28')](handleEntityNotFound(_0x35d68c,null))['then'](function(_0x103b16){if(_0x103b16){return _0x103b16[_0xf6ab('0x55')](_0x1001a1['body']['ids'],_[_0xf6ab('0x57')](_0x1001a1['body'],[_0xf6ab('0x58'),'id'])||{});}})[_0xf6ab('0x28')](respondWithResult(_0x35d68c,null))['catch'](handleError(_0x35d68c,null));};exports[_0xf6ab('0x59')]=function(_0x55f95c,_0x440692,_0x2af1bc){var _0x1165fb={};var _0x560fb2={};var _0x29dd16;var _0x576870;return db[_0xf6ab('0x31')][_0xf6ab('0x5a')]({'where':{'id':_0x55f95c[_0xf6ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x440692,null))[_0xf6ab('0x28')](function(_0x148cca){if(_0x148cca){_0x29dd16=_0x148cca;_0x560fb2['model']=_[_0xf6ab('0x33')](db[_0xf6ab('0x56')]['rawAttributes']);_0x560fb2['query']=_['keys'](_0x55f95c[_0xf6ab('0x34')]);_0x560fb2[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x560fb2[_0xf6ab('0x37')],_0x560fb2[_0xf6ab('0x34')]);_0x1165fb[_0xf6ab('0x38')]=_['intersection'](_0x560fb2[_0xf6ab('0x37')],qs['fields'](_0x55f95c[_0xf6ab('0x34')]['fields']));_0x1165fb[_0xf6ab('0x38')]=_0x1165fb[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0x1165fb['attributes']:_0x560fb2['model'];_0x1165fb['order']=qs[_0xf6ab('0x3d')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x3d')]);_0x1165fb[_0xf6ab('0x3e')]=qs['filters'](_['pick'](_0x55f95c['query'],_0x560fb2[_0xf6ab('0x35')]));if(_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x3f')]){_0x1165fb[_0xf6ab('0x3e')]=_[_0xf6ab('0x40')](_0x1165fb['where'],{'$or':_[_0xf6ab('0x41')](_0x1165fb[_0xf6ab('0x38')],function(_0x36f68b){var _0x43f377={};_0x43f377[_0x36f68b]={'$like':'%'+_0x55f95c['query'][_0xf6ab('0x3f')]+'%'};return _0x43f377;})});}_0x1165fb=_['merge']({},_0x1165fb,_0x55f95c[_0xf6ab('0x42')]);return _0x29dd16[_0xf6ab('0x59')](_0x1165fb);}})[_0xf6ab('0x28')](function(_0x1c4fc7){if(_0x1c4fc7){_0x576870=_0x1c4fc7[_0xf6ab('0x39')];if(!_0x55f95c['query'][_0xf6ab('0x3a')](_0xf6ab('0x3b'))){_0x1165fb[_0xf6ab('0x21')]=qs[_0xf6ab('0x21')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x21')]);_0x1165fb[_0xf6ab('0x23')]=qs[_0xf6ab('0x23')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x23')]);}return _0x29dd16[_0xf6ab('0x59')](_0x1165fb);}})[_0xf6ab('0x28')](function(_0x48a197){if(_0x48a197){return _0x48a197?{'count':_0x576870,'rows':_0x48a197}:null;}})[_0xf6ab('0x28')](respondWithResult(_0x440692,null))['catch'](handleError(_0x440692,null));}; \ No newline at end of file +var _0x20c3=['hasOwnProperty','nolimit','pick','where','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','CmCompany','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','filter','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','Companies','UserProfileResource','destroy','sendStatus','error','stack','send','index','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1e701a,_0x44b807){var _0x497de0=function(_0x1a2de6){while(--_0x1a2de6){_0x1e701a['push'](_0x1e701a['shift']());}};_0x497de0(++_0x44b807);}(_0x20c3,0x7b));var _0x320c=function(_0x5d9171,_0x5ccd64){_0x5d9171=_0x5d9171-0x0;var _0x49aa7b=_0x20c3[_0x5d9171];return _0x49aa7b;};'use strict';var emlformat=require(_0x320c('0x0'));var rimraf=require(_0x320c('0x1'));var zipdir=require(_0x320c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x320c('0x3'));var BPromise=require(_0x320c('0x4'));var Mustache=require(_0x320c('0x5'));var util=require(_0x320c('0x6'));var path=require(_0x320c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x320c('0x8'));var fs=require('fs');var fs_extra=require(_0x320c('0x9'));var _=require(_0x320c('0xa'));var squel=require(_0x320c('0xb'));var crypto=require('crypto');var jsforce=require(_0x320c('0xc'));var deskjs=require(_0x320c('0xd'));var toCsv=require(_0x320c('0xe'));var querystring=require(_0x320c('0xf'));var Papa=require('papaparse');var Redis=require(_0x320c('0x10'));var authService=require(_0x320c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x320c('0x12'))('api');var utils=require(_0x320c('0x13'));var config=require(_0x320c('0x14'));var licenseUtil=require(_0x320c('0x15'));var db=require(_0x320c('0x16'))['db'];function respondWithStatusCode(_0x2aa04e,_0x4bf946){_0x4bf946=_0x4bf946||0xcc;return function(_0x53a7c7){if(_0x53a7c7){return _0x2aa04e['sendStatus'](_0x4bf946);}return _0x2aa04e[_0x320c('0x17')](_0x4bf946)[_0x320c('0x18')]();};}function respondWithResult(_0x64752e,_0x85bdd9){_0x85bdd9=_0x85bdd9||0xc8;return function(_0x586e99){if(_0x586e99){return _0x64752e[_0x320c('0x17')](_0x85bdd9)[_0x320c('0x19')](_0x586e99);}};}function respondWithFilteredResult(_0x3832c7,_0x40ed90){return function(_0x4ef851){if(_0x4ef851){var _0x1d314f=typeof _0x40ed90['offset']===_0x320c('0x1a')&&typeof _0x40ed90['limit']==='undefined';var _0x3cf5b5=_0x4ef851[_0x320c('0x1b')];var _0x457e78=_0x1d314f?0x0:_0x40ed90[_0x320c('0x1c')];var _0x5c01a2=_0x1d314f?_0x4ef851[_0x320c('0x1b')]:_0x40ed90[_0x320c('0x1c')]+_0x40ed90[_0x320c('0x1d')];var _0xa813c;if(_0x5c01a2>=_0x3cf5b5){_0x5c01a2=_0x3cf5b5;_0xa813c=0xc8;}else{_0xa813c=0xce;}_0x3832c7[_0x320c('0x17')](_0xa813c);return _0x3832c7[_0x320c('0x1e')](_0x320c('0x1f'),_0x457e78+'-'+_0x5c01a2+'/'+_0x3cf5b5)[_0x320c('0x19')](_0x4ef851);}return null;};}function patchUpdates(_0x432efe){return function(_0x46cebb){try{jsonpatch['apply'](_0x46cebb,_0x432efe,!![]);}catch(_0x34953d){return BPromise['reject'](_0x34953d);}return _0x46cebb[_0x320c('0x20')]();};}function saveUpdates(_0x1dc3ba,_0x2be585){return function(_0x5170e6){if(_0x5170e6){return _0x5170e6[_0x320c('0x21')](_0x1dc3ba)['then'](function(_0x27cbc1){return _0x27cbc1;});}return null;};}function removeEntity(_0x42cbf4,_0x875f2){return function(_0x7bb72f){if(_0x7bb72f){return _0x7bb72f['destroy']()[_0x320c('0x22')](function(){var _0x9a3674=_0x7bb72f['get']({'plain':!![]});var _0x2dbd84=_0x320c('0x23');return db[_0x320c('0x24')][_0x320c('0x25')]({'where':{'type':_0x2dbd84,'resourceId':_0x9a3674['id']}})[_0x320c('0x22')](function(){return _0x7bb72f;});})[_0x320c('0x22')](function(){_0x42cbf4[_0x320c('0x17')](0xcc)[_0x320c('0x18')]();});}};}function handleEntityNotFound(_0x23385a,_0x45cc91){return function(_0xa70f06){if(!_0xa70f06){_0x23385a[_0x320c('0x26')](0x194);}return _0xa70f06;};}function handleError(_0xef7eca,_0x337830){_0x337830=_0x337830||0x1f4;return function(_0x564e3b){logger[_0x320c('0x27')](_0x564e3b[_0x320c('0x28')]);if(_0x564e3b['name']){delete _0x564e3b['name'];}_0xef7eca[_0x320c('0x17')](_0x337830)[_0x320c('0x29')](_0x564e3b);};}exports[_0x320c('0x2a')]=function(_0x4c8a6d,_0x155d35){var _0x5bf607={},_0x33ec2d={},_0x3abd09={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x320c('0x22')](function(_0x42a5ac){_0x33ec2d[_0x320c('0x2b')]=_[_0x320c('0x2c')](_0x42a5ac);_0x33ec2d[_0x320c('0x2d')]=_[_0x320c('0x2c')](_0x4c8a6d[_0x320c('0x2d')]);_0x33ec2d[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x33ec2d[_0x320c('0x2b')],_0x33ec2d[_0x320c('0x2d')]);_0x5bf607[_0x320c('0x30')]=_['intersection'](_0x33ec2d[_0x320c('0x2b')],qs[_0x320c('0x31')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x31')]));_0x5bf607['attributes']=_0x5bf607['attributes'][_0x320c('0x32')]?_0x5bf607['attributes']:_0x33ec2d[_0x320c('0x2b')];if(!_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x33')](_0x320c('0x34'))){_0x5bf607['limit']=qs[_0x320c('0x1d')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1d')]);_0x5bf607['offset']=qs[_0x320c('0x1c')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1c')]);}_0x5bf607['order']=qs['sort'](_0x4c8a6d[_0x320c('0x2d')]['sort']);_0x5bf607['where']=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x4c8a6d[_0x320c('0x2d')],_0x33ec2d[_0x320c('0x2e')]),_0x42a5ac);if(_0x4c8a6d[_0x320c('0x2d')]['filter']){_0x5bf607[_0x320c('0x36')]=_[_0x320c('0x37')](_0x5bf607[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x5bf607[_0x320c('0x30')],function(_0x2cd283){var _0x3afb1d={};_0x3afb1d[_0x2cd283]={'$like':'%'+_0x4c8a6d[_0x320c('0x2d')]['filter']+'%'};return _0x3afb1d;})});}_0x5bf607=_[_0x320c('0x37')]({},_0x5bf607,_0x4c8a6d[_0x320c('0x39')]);var _0x20c9e0={'where':_0x5bf607[_0x320c('0x36')]};return db['CmCompany'][_0x320c('0x1b')](_0x20c9e0)[_0x320c('0x22')](function(_0xaf3168){_0x3abd09[_0x320c('0x1b')]=_0xaf3168;if(_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x3a')]){_0x5bf607['include']=[{'all':!![]}];}return db['CmCompany'][_0x320c('0x3b')](_0x5bf607);})[_0x320c('0x22')](function(_0x1815b5){_0x3abd09[_0x320c('0x3c')]=_0x1815b5;return _0x3abd09;})[_0x320c('0x22')](respondWithFilteredResult(_0x155d35,_0x5bf607))[_0x320c('0x3d')](handleError(_0x155d35,null));})[_0x320c('0x3d')](handleError(_0x155d35,null));};exports[_0x320c('0x3e')]=function(_0x5efc34,_0x592b8e){var _0x7aa1f9={'raw':![],'where':{'id':_0x5efc34[_0x320c('0x3f')]['id']}},_0x1af88b={};_0x1af88b[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmCompany'][_0x320c('0x40')]);_0x1af88b[_0x320c('0x2d')]=_['keys'](_0x5efc34[_0x320c('0x2d')]);_0x1af88b[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x1af88b['model'],_0x1af88b[_0x320c('0x2d')]);_0x7aa1f9[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x1af88b['model'],qs['fields'](_0x5efc34[_0x320c('0x2d')][_0x320c('0x31')]));_0x7aa1f9['attributes']=_0x7aa1f9[_0x320c('0x30')]['length']?_0x7aa1f9[_0x320c('0x30')]:_0x1af88b[_0x320c('0x2b')];if(_0x5efc34[_0x320c('0x2d')]['includeAll']){_0x7aa1f9[_0x320c('0x41')]=[{'all':!![]}];}_0x7aa1f9=_[_0x320c('0x37')]({},_0x7aa1f9,_0x5efc34[_0x320c('0x39')]);return db[_0x320c('0x42')][_0x320c('0x43')](_0x7aa1f9)[_0x320c('0x22')](handleEntityNotFound(_0x592b8e,null))[_0x320c('0x22')](respondWithResult(_0x592b8e,null))[_0x320c('0x3d')](handleError(_0x592b8e,null));};exports['create']=function(_0x1a4ac9,_0x5105e0){return db[_0x320c('0x42')][_0x320c('0x44')](_0x1a4ac9[_0x320c('0x45')],{})['then'](function(_0x367f68){var _0x1a2fc4=_0x1a4ac9[_0x320c('0x46')]['get']({'plain':!![]});if(!_0x1a2fc4)throw new Error(_0x320c('0x47'));if(_0x1a2fc4['role']===_0x320c('0x46')){var _0x32e47f=_0x367f68[_0x320c('0x48')]({'plain':!![]});var _0x1b0053=_0x320c('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1b0053,'userProfileId':_0x1a2fc4[_0x320c('0x49')]},'raw':!![]})[_0x320c('0x22')](function(_0x2fe99d){if(_0x2fe99d&&_0x2fe99d[_0x320c('0x4a')]===0x0){return db[_0x320c('0x24')][_0x320c('0x44')]({'name':_0x32e47f[_0x320c('0x4b')],'resourceId':_0x32e47f['id'],'type':_0x2fe99d[_0x320c('0x4b')],'sectionId':_0x2fe99d['id']},{})[_0x320c('0x22')](function(){return _0x367f68;});}else{return _0x367f68;}})[_0x320c('0x3d')](function(_0x9c7b31){logger[_0x320c('0x27')](_0x320c('0x4c'),_0x9c7b31);throw _0x9c7b31;});}return _0x367f68;})[_0x320c('0x22')](respondWithResult(_0x5105e0,0xc9))['catch'](handleError(_0x5105e0,null));};exports[_0x320c('0x21')]=function(_0x549c74,_0x43225f){if(_0x549c74[_0x320c('0x45')]['id']){delete _0x549c74['body']['id'];}return db[_0x320c('0x42')][_0x320c('0x43')]({'where':{'id':_0x549c74[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x43225f,null))['then'](saveUpdates(_0x549c74[_0x320c('0x45')],null))[_0x320c('0x22')](respondWithResult(_0x43225f,null))[_0x320c('0x3d')](handleError(_0x43225f,null));};exports[_0x320c('0x25')]=function(_0x51b331,_0x533d3a){return db['CmCompany'][_0x320c('0x43')]({'where':{'id':_0x51b331[_0x320c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x533d3a,null))[_0x320c('0x22')](removeEntity(_0x533d3a,null))[_0x320c('0x3d')](handleError(_0x533d3a,null));};exports[_0x320c('0x4d')]=function(_0x266d76,_0x33af2b){return db[_0x320c('0x42')]['describe']()[_0x320c('0x22')](respondWithResult(_0x33af2b,null))[_0x320c('0x3d')](handleError(_0x33af2b,null));};exports[_0x320c('0x4e')]=function(_0x2177cb,_0x45d8ee,_0x115bb2){return db[_0x320c('0x4f')][_0x320c('0x43')]({'where':{'id':_0x2177cb[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x45d8ee,null))['then'](function(_0x598cb2){if(_0x598cb2){return _0x598cb2['addContacts'](_0x2177cb[_0x320c('0x45')][_0x320c('0x50')],_[_0x320c('0x51')](_0x2177cb[_0x320c('0x45')],[_0x320c('0x50'),'id'])||{});}})['then'](respondWithResult(_0x45d8ee,null))['catch'](handleError(_0x45d8ee,null));};exports[_0x320c('0x52')]=function(_0x3fbe02,_0x122af7,_0x455969){var _0x485194={};var _0x3c7c51={};var _0x12d3e9;var _0x34c50f;return db[_0x320c('0x42')][_0x320c('0x53')]({'where':{'id':_0x3fbe02[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x122af7,null))[_0x320c('0x22')](function(_0x21367b){if(_0x21367b){_0x12d3e9=_0x21367b;_0x3c7c51[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmContact'][_0x320c('0x40')]);_0x3c7c51[_0x320c('0x2d')]=_['keys'](_0x3fbe02[_0x320c('0x2d')]);_0x3c7c51[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x3c7c51[_0x320c('0x2b')],_0x3c7c51[_0x320c('0x2d')]);_0x485194[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x3c7c51['model'],qs[_0x320c('0x31')](_0x3fbe02['query'][_0x320c('0x31')]));_0x485194[_0x320c('0x30')]=_0x485194[_0x320c('0x30')][_0x320c('0x32')]?_0x485194['attributes']:_0x3c7c51[_0x320c('0x2b')];_0x485194[_0x320c('0x54')]=qs[_0x320c('0x55')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x55')]);_0x485194[_0x320c('0x36')]=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x3fbe02[_0x320c('0x2d')],_0x3c7c51['filters']));if(_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]){_0x485194['where']=_[_0x320c('0x37')](_0x485194[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x485194[_0x320c('0x30')],function(_0x3eedce){var _0x570cbb={};_0x570cbb[_0x3eedce]={'$like':'%'+_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]+'%'};return _0x570cbb;})});}_0x485194=_[_0x320c('0x37')]({},_0x485194,_0x3fbe02['options']);return _0x12d3e9['getContacts'](_0x485194);}})[_0x320c('0x22')](function(_0x53b04d){if(_0x53b04d){_0x34c50f=_0x53b04d[_0x320c('0x32')];if(!_0x3fbe02[_0x320c('0x2d')]['hasOwnProperty'](_0x320c('0x34'))){_0x485194['limit']=qs[_0x320c('0x1d')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x1d')]);_0x485194['offset']=qs[_0x320c('0x1c')](_0x3fbe02[_0x320c('0x2d')]['offset']);}return _0x12d3e9[_0x320c('0x52')](_0x485194);}})[_0x320c('0x22')](function(_0x46c3a8){if(_0x46c3a8){return _0x46c3a8?{'count':_0x34c50f,'rows':_0x46c3a8}:null;}})[_0x320c('0x22')](respondWithResult(_0x122af7,null))[_0x320c('0x3d')](handleError(_0x122af7,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 731420d..5eb8823 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 _0x641e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_companies','lodash'];(function(_0xaa66b4,_0x5bad46){var _0x1a7e0a=function(_0x134dc8){while(--_0x134dc8){_0xaa66b4['push'](_0xaa66b4['shift']());}};_0x1a7e0a(++_0x5bad46);}(_0x641e,0x78));var _0xe641=function(_0x13ce69,_0x4fea29){_0x13ce69=_0x13ce69-0x0;var _0x312d53=_0x641e[_0x13ce69];return _0x312d53;};'use strict';var _=require(_0xe641('0x0'));var util=require(_0xe641('0x1'));var logger=require(_0xe641('0x2'))('api');var moment=require(_0xe641('0x3'));var BPromise=require(_0xe641('0x4'));var rp=require(_0xe641('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe641('0x6'));var config=require(_0xe641('0x7'));var attributes=require('./cmCompany.attributes');module[_0xe641('0x8')]=function(_0x6b819c,_0x4c5d03){return _0x6b819c[_0xe641('0x9')]('CmCompany',attributes,{'tableName':_0xe641('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5872=['request-promise','path','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x17f461,_0x4ecbdd){var _0x37ec91=function(_0x161819){while(--_0x161819){_0x17f461['push'](_0x17f461['shift']());}};_0x37ec91(++_0x4ecbdd);}(_0x5872,0x1be));var _0x2587=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x5872[_0x46800d];return _0x3824cd;};'use strict';var _=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var logger=require(_0x2587('0x2'))(_0x2587('0x3'));var moment=require(_0x2587('0x4'));var BPromise=require('bluebird');var rp=require(_0x2587('0x5'));var fs=require('fs');var path=require(_0x2587('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2587('0x7'));module[_0x2587('0x8')]=function(_0x53d2de,_0x530b8c){return _0x53d2de['define'](_0x2587('0x9'),attributes,{'tableName':_0x2587('0xa'),'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 8da7fa7..30b01c3 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 _0xb902=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x2f81ef,_0x33953a){var _0x1ca14d=function(_0x35a783){while(--_0x35a783){_0x2f81ef['push'](_0x2f81ef['shift']());}};_0x1ca14d(++_0x33953a);}(_0xb902,0xcd));var _0x2b90=function(_0x232853,_0x33464a){_0x232853=_0x232853-0x0;var _0x3d5434=_0xb902[_0x232853];return _0x3d5434;};'use strict';var _=require(_0x2b90('0x0'));var util=require(_0x2b90('0x1'));var moment=require(_0x2b90('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b90('0x3'));var db=require(_0x2b90('0x4'))['db'];var utils=require(_0x2b90('0x5'));var logger=require(_0x2b90('0x6'))(_0x2b90('0x7'));var config=require(_0x2b90('0x8'));var jayson=require(_0x2b90('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9123,_0x1131f9,_0x507e7a){return new BPromise(function(_0x2deea8,_0x2406c7){return client[_0x2b90('0xa')](_0x1d9123,_0x507e7a)[_0x2b90('0xb')](function(_0x33ed32){logger[_0x2b90('0xc')](_0x2b90('0xd'),_0x1131f9,_0x2b90('0xe'));logger[_0x2b90('0xf')](_0x2b90('0x10'),_0x1131f9,_0x2b90('0xe'),JSON[_0x2b90('0x11')](_0x33ed32));if(_0x33ed32[_0x2b90('0x12')]){if(_0x33ed32[_0x2b90('0x12')][_0x2b90('0x13')]===0x1f4){logger[_0x2b90('0x12')]('CmCompany,\x20%s,\x20%s',_0x1131f9,_0x33ed32['error'][_0x2b90('0x14')]);return _0x2406c7(_0x33ed32[_0x2b90('0x12')][_0x2b90('0x14')]);}logger[_0x2b90('0x12')](_0x2b90('0xd'),_0x1131f9,_0x33ed32[_0x2b90('0x12')][_0x2b90('0x14')]);return _0x2deea8(_0x33ed32['error'][_0x2b90('0x14')]);}else{logger[_0x2b90('0xc')]('CmCompany,\x20%s,\x20%s',_0x1131f9,_0x2b90('0xe'));_0x2deea8(_0x33ed32[_0x2b90('0x15')][_0x2b90('0x14')]);}})['catch'](function(_0x20425a){logger[_0x2b90('0x12')](_0x2b90('0xd'),_0x1131f9,_0x20425a);_0x2406c7(_0x20425a);});});} \ No newline at end of file +var _0xa6a5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ca72,_0x396df6){var _0x14dbc2=function(_0x5e68b3){while(--_0x5e68b3){_0x2ca72['push'](_0x2ca72['shift']());}};_0x14dbc2(++_0x396df6);}(_0xa6a5,0xd1));var _0x5a6a=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa6a5[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x5a6a('0x0'));var moment=require(_0x5a6a('0x1'));var BPromise=require(_0x5a6a('0x2'));var rs=require(_0x5a6a('0x3'));var fs=require('fs');var Redis=require(_0x5a6a('0x4'));var db=require(_0x5a6a('0x5'))['db'];var utils=require(_0x5a6a('0x6'));var logger=require(_0x5a6a('0x7'))(_0x5a6a('0x8'));var config=require(_0x5a6a('0x9'));var jayson=require(_0x5a6a('0xa'));var client=jayson[_0x5a6a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a87f2,_0x14fa40,_0x535d97){return new BPromise(function(_0x25d9a3,_0x57e0f9){return client[_0x5a6a('0xc')](_0x3a87f2,_0x535d97)[_0x5a6a('0xd')](function(_0x57b902){logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));logger[_0x5a6a('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x14fa40,_0x5a6a('0x10'),JSON[_0x5a6a('0x12')](_0x57b902));if(_0x57b902[_0x5a6a('0x13')]){if(_0x57b902['error'][_0x5a6a('0x14')]===0x1f4){logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')]['message']);return _0x57e0f9(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);return _0x25d9a3(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}else{logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));_0x25d9a3(_0x57b902[_0x5a6a('0x16')][_0x5a6a('0x15')]);}})[_0x5a6a('0x17')](function(_0x1754cb){logger[_0x5a6a('0x13')]('CmCompany,\x20%s,\x20%s',_0x14fa40,_0x1754cb);_0x57e0f9(_0x1754cb);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9ee0319..953d1b4 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 _0x3a20=['addContacts','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','post'];(function(_0x19b805,_0x22c6f0){var _0x16b28e=function(_0x1fd3ed){while(--_0x1fd3ed){_0x19b805['push'](_0x19b805['shift']());}};_0x16b28e(++_0x22c6f0);}(_0x3a20,0x1a9));var _0x03a2=function(_0x56a20e,_0x231ac3){_0x56a20e=_0x56a20e-0x0;var _0x254a55=_0x3a20[_0x56a20e];return _0x254a55;};'use strict';var multer=require(_0x03a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03a2('0x1'));var express=require(_0x03a2('0x2'));var router=express[_0x03a2('0x3')]();var fs_extra=require(_0x03a2('0x4'));var auth=require(_0x03a2('0x5'));var interaction=require(_0x03a2('0x6'));var config=require(_0x03a2('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x03a2('0x8')](_0x03a2('0x9'),auth['isAuthenticated'](),controller[_0x03a2('0xa')]);router[_0x03a2('0x8')](_0x03a2('0xb'),auth[_0x03a2('0xc')](),controller[_0x03a2('0xd')]);router[_0x03a2('0x8')](_0x03a2('0xe'),auth[_0x03a2('0xc')](),controller['getContacts']);router[_0x03a2('0xf')]('/',auth[_0x03a2('0xc')](),controller['create']);router[_0x03a2('0xf')](_0x03a2('0xe'),auth['isAuthenticated'](),controller[_0x03a2('0x10')]);router[_0x03a2('0x11')]('/:id',auth[_0x03a2('0xc')](),controller['update']);router[_0x03a2('0x12')]('/:id',auth[_0x03a2('0xc')](),controller[_0x03a2('0x13')]);module[_0x03a2('0x14')]=router; \ No newline at end of file +var _0xa775=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','post','addContacts','put','update','destroy','exports','multer'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0xa775,0xf6));var _0x5a77=function(_0x55a233,_0x524fb7){_0x55a233=_0x55a233-0x0;var _0x39ae55=_0xa775[_0x55a233];return _0x39ae55;};'use strict';var multer=require(_0x5a77('0x0'));var util=require('util');var path=require(_0x5a77('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a77('0x2')]();var fs_extra=require(_0x5a77('0x3'));var auth=require(_0x5a77('0x4'));var interaction=require(_0x5a77('0x5'));var config=require('../../config/environment');var controller=require(_0x5a77('0x6'));router[_0x5a77('0x7')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0x9')]);router[_0x5a77('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xb')]);router[_0x5a77('0x7')](_0x5a77('0xc'),auth[_0x5a77('0x8')](),controller['getContacts']);router[_0x5a77('0xd')]('/',auth[_0x5a77('0x8')](),controller['create']);router[_0x5a77('0xd')]('/:id/contacts',auth[_0x5a77('0x8')](),controller[_0x5a77('0xe')]);router[_0x5a77('0xf')](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x10')]);router['delete'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x11')]);module[_0x5a77('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 50d1c32..78d669d 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 _0x5c95=['STRING','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports'];(function(_0x570091,_0x37a273){var _0x5638d6=function(_0x280662){while(--_0x280662){_0x570091['push'](_0x570091['shift']());}};_0x5638d6(++_0x37a273);}(_0x5c95,0x1a8));var _0x55c9=function(_0x3214d1,_0x3c61ad){_0x3214d1=_0x3214d1-0x0;var _0x520948=_0x5c95[_0x3214d1];return _0x520948;};'use strict';var _=require(_0x55c9('0x0'));var Sequelize=require(_0x55c9('0x1'));module[_0x55c9('0x2')]={'firstName':{'type':Sequelize[_0x55c9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x55c9('0x3')]},'street':{'type':Sequelize[_0x55c9('0x3')]},'postalCode':{'type':Sequelize[_0x55c9('0x3')]},'city':{'type':Sequelize[_0x55c9('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x55c9('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x55c9('0x3')]},'mobile':{'type':Sequelize[_0x55c9('0x3')]},'fax':{'type':Sequelize[_0x55c9('0x3')]},'email':{'type':Sequelize[_0x55c9('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x55c9('0x3')]},'fb_data':{'type':Sequelize[_0x55c9('0x3')]},'twitter':{'type':Sequelize[_0x55c9('0x3')]},'skype':{'type':Sequelize[_0x55c9('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x55c9('0x3')]},'line':{'type':Sequelize[_0x55c9('0x3')]},'wechat':{'type':Sequelize[_0x55c9('0x3')]},'telegram':{'type':Sequelize[_0x55c9('0x3')]},'UserId':{'type':Sequelize[_0x55c9('0x4')]},'priority':{'type':Sequelize[_0x55c9('0x4')](0x2)[_0x55c9('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x55c9('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xfec9=['TEXT','INTEGER','UNSIGNED','NOW','lodash','exports','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xfec9,0x146));var _0x9fec=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0xfec9[_0x4dcb47];return _0x352b40;};'use strict';var _=require(_0x9fec('0x0'));var Sequelize=require('sequelize');module[_0x9fec('0x1')]={'firstName':{'type':Sequelize[_0x9fec('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9fec('0x2')]},'street':{'type':Sequelize[_0x9fec('0x2')]},'postalCode':{'type':Sequelize[_0x9fec('0x2')]},'city':{'type':Sequelize[_0x9fec('0x2')]},'country':{'type':Sequelize[_0x9fec('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9fec('0x2')]},'description':{'type':Sequelize[_0x9fec('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9fec('0x2')]},'fax':{'type':Sequelize[_0x9fec('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9fec('0x2')]},'facebook':{'type':Sequelize[_0x9fec('0x2')]},'fb_data':{'type':Sequelize[_0x9fec('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x9fec('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x9fec('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x9fec('0x2')]},'telegram':{'type':Sequelize[_0x9fec('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x9fec('0x4')](0x2)[_0x9fec('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9fec('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a53b45b..6f09f31 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 _0xd81f=['create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','join','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','options','include','getHopperHistories','includeAll','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','browserName','customerPort','osName','ratingType','referer','mail','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','stack','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','then','fieldType','type','model','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','value','datetime','castTo','DATE','buildExpression','start','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','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.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','SELECT','clone','t.id\x20IN\x20?','user','role','agent','User','c.ListId\x20IN\x20?','sequelize','toString','CmContact','c.phone','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','columnName','displayName','analytics','findAll','alias','custom','values','merge','body','get','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x3cbfe3,_0x2a1db6){var _0x2888b0=function(_0x1898ec){while(--_0x1898ec){_0x3cbfe3['push'](_0x3cbfe3['shift']());}};_0x2888b0(++_0x2a1db6);}(_0xd81f,0x86));var _0xfd81=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xd81f[_0x174ef5];return _0x1cc379;};'use strict';var moment=require(_0xfd81('0x0'));var BPromise=require(_0xfd81('0x1'));var util=require(_0xfd81('0x2'));var path=require(_0xfd81('0x3'));var fs=require('fs');var _=require(_0xfd81('0x4'));var squel=require(_0xfd81('0x5'));var Papa=require('papaparse');var Redis=require(_0xfd81('0x6'));var qs=require(_0xfd81('0x7'));var as=require(_0xfd81('0x8'));var logger=require(_0xfd81('0x9'))(_0xfd81('0xa'));var config=require(_0xfd81('0xb'));var db=require('../../mysqldb')['db'];config[_0xfd81('0xc')]=_[_0xfd81('0xd')](config[_0xfd81('0xc')],{'host':_0xfd81('0xe'),'port':0x18eb});var socket=require(_0xfd81('0xf'))(new Redis(config[_0xfd81('0xc')]));require(_0xfd81('0x10'))['register'](socket);function respondWithResult(_0x3c0a16,_0x45c1f6){_0x45c1f6=_0x45c1f6||0xc8;return function(_0xa8128c){if(_0xa8128c){return _0x3c0a16[_0xfd81('0x11')](_0x45c1f6)[_0xfd81('0x12')](_0xa8128c);}};}function respondWithFilteredResult(_0x535258,_0x3ca5a0){return function(_0x463dee){if(_0x463dee){var _0x7af2f6=typeof _0x3ca5a0[_0xfd81('0x13')]===_0xfd81('0x14')&&typeof _0x3ca5a0['limit']===_0xfd81('0x14');var _0x29d9c0=_0x463dee[_0xfd81('0x15')];var _0x4abc75=_0x7af2f6?0x0:_0x3ca5a0['offset'];var _0x316770=_0x7af2f6?_0x463dee[_0xfd81('0x15')]:_0x3ca5a0[_0xfd81('0x13')]+_0x3ca5a0['limit'];var _0x1b1ed3;if(_0x316770>=_0x29d9c0){_0x316770=_0x29d9c0;_0x1b1ed3=0xc8;}else{_0x1b1ed3=0xce;}_0x535258[_0xfd81('0x11')](_0x1b1ed3);return _0x535258[_0xfd81('0x16')](_0xfd81('0x17'),_0x4abc75+'-'+_0x316770+'/'+_0x29d9c0)[_0xfd81('0x12')](_0x463dee);}return null;};}function saveUpdates(_0x587dfe){return function(_0x572af4){if(_0x572af4){return _0x572af4[_0xfd81('0x18')](_0x587dfe)['then'](function(_0x23d264){return _0x23d264;});}return null;};}function removeEntity(_0x214283){return function(_0x1e6902){if(_0x1e6902){return _0x1e6902[_0xfd81('0x19')]()['then'](function(){_0x214283['status'](0xcc)[_0xfd81('0x1a')]();});}};}function handleEntityNotFound(_0xd22cd4){return function(_0x3ee099){if(!_0x3ee099){_0xd22cd4['sendStatus'](0x194);}return _0x3ee099;};}function handleError(_0x4fa85d,_0x3cf000){_0x3cf000=_0x3cf000||0x1f4;return function(_0x19d54e){logger['error'](_0x19d54e[_0xfd81('0x1b')]);if(_0x19d54e['name']){delete _0x19d54e[_0xfd81('0x1c')];}_0x4fa85d[_0xfd81('0x11')](_0x3cf000)[_0xfd81('0x1d')](_0x19d54e);};}exports[_0xfd81('0x1e')]=function(_0x53795e,_0xb0b8b6){var _0x1dc5b7={},_0x8b81ab={},_0x23148f={'count':0x0,'rows':[]};return db['CmContact'][_0xfd81('0x1f')]()['then'](function(_0x205b1b){var _0x1cc324=[];for(var _0x301998=0x0;_0x3019980x1){_0x3d6aba['or'](_0xfd81('0x61'),qs[_0xfd81('0x62')](_0x5241b7),null);}else{if(qs['isNumeric'](_0x5241b7)){_0x3d6aba['or'](_0xfd81('0x63'),_0x5241b7+'%');_0x3d6aba['or'](_0xfd81('0x64'),_0x5241b7+'%');_0x3d6aba['or']('c.mobile\x20LIKE\x20?',_0x5241b7+'%');_0x3d6aba['or'](_0xfd81('0x65'),_0x5241b7+'%');}else if(qs[_0xfd81('0x66')](_0x5241b7)){_0x3d6aba['or']('c.email\x20LIKE\x20?',_0x5241b7+'%');}else{_0x3d6aba['or'](_0xfd81('0x67'),'%'+_0x5241b7+'%');_0x3d6aba['or'](_0xfd81('0x68'),'%'+_0x5241b7+'%');_0x3d6aba['or']('c.email\x20LIKE\x20?','%'+_0x5241b7+'%');}}}}_0x30f564[_0xfd81('0x34')](_0x3d6aba);_0x30f564[_0xfd81('0x69')](_0xfd81('0x6a'));var _0x252531={'type':db['Sequelize']['QueryTypes'][_0xfd81('0x6b')],'raw':!![]};var _0x57ab29=_0x30f564[_0xfd81('0x6c')]()['field']('c.id');if(_0x1dc5b7[_0xfd81('0x32')]){_0x1dc5b7[_0xfd81('0x32')][_0xfd81('0x4b')](function(_0x24c9b8){_0x30f564['order']('c.'+_0x24c9b8[0x0],_0x24c9b8[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfd81('0x59')](_0x19435b)){_0x30f564['having'](_0xc3858c);_0x57ab29[_0xfd81('0x34')](_0xfd81('0x6d'),_0x19435b);}BPromise['resolve']()[_0xfd81('0x28')](function(){if(!_0x36ab74)return;if(_0x53795e[_0xfd81('0x6e')][_0xfd81('0x6f')]!==_0xfd81('0x70'))return;if(!_['some'](_0x36ab74[_0xfd81('0x46')],['field',_0xfd81('0x71')])){return _0x53795e[_0xfd81('0x6e')]['getLists']({'attributes':['id'],'raw':!![]})[_0xfd81('0x28')](function(_0x31a3f1){if(_[_0xfd81('0x59')](_0x31a3f1)){_0x57ab29[_0xfd81('0x34')]('c.ListId\x20IS\x20NULL');_0x30f564[_0xfd81('0x34')]('c.ListId\x20IS\x20NULL');}else{_0x57ab29[_0xfd81('0x34')](_0xfd81('0x72'),_[_0xfd81('0x4a')](_0x31a3f1,'id'));_0x30f564[_0xfd81('0x34')]('c.ListId\x20IN\x20?',_[_0xfd81('0x4a')](_0x31a3f1,'id'));}});}})[_0xfd81('0x28')](function(){if(_0x53795e[_0xfd81('0x6e')][_0xfd81('0x6f')]===_0xfd81('0x70')&&!_0x36ab74&&!_0x53795e[_0xfd81('0x2c')][_0xfd81('0x5a')])return[];return db[_0xfd81('0x73')][_0xfd81('0x2c')](_0x57ab29[_0xfd81('0x74')](),_0x252531);})[_0xfd81('0x28')](function(_0x2fa2e7){_0x23148f[_0xfd81('0x15')]=_0x2fa2e7[_0xfd81('0x21')];if(_0x23148f[_0xfd81('0x15')]===0x0)return[];return db[_0xfd81('0x73')][_0xfd81('0x2c')](_0x2d12d8[_0xfd81('0x74')](),_0x252531)[_0xfd81('0x28')](function(_0x384c2a){_0x22d664=_['keyBy'](_0x384c2a,'id');_0x252531=_['merge'](_0x252531,{'model':db[_0xfd81('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53795e[_0xfd81('0x2c')]['fields']){_0x1dc5b7['attributes'][_0xfd81('0x4b')](function(_0x3144e1){_0x30f564[_0xfd81('0x38')]('c.'+_0x3144e1);});}else{_0x30f564[_0xfd81('0x38')]('c.id');_0x30f564[_0xfd81('0x38')]('c.firstName');_0x30f564['field']('c.lastName');_0x30f564['field'](_0xfd81('0x76'));_0x30f564[_0xfd81('0x38')]('c.mobile');_0x30f564[_0xfd81('0x38')]('c.fax');_0x30f564['field'](_0xfd81('0x77'));_0x30f564[_0xfd81('0x38')]('c.ListId');_0x30f564[_0xfd81('0x38')](_0xfd81('0x78'));_0x30f564['field'](_0xfd81('0x79'));_0x30f564['field'](_0xfd81('0x7a'));_0x30f564[_0xfd81('0x38')](_0xfd81('0x7b'),_0xfd81('0x7c'));}if(_0x1dc5b7[_0xfd81('0x31')])_0x30f564['limit'](_0x1dc5b7[_0xfd81('0x31')]);if(_0x1dc5b7[_0xfd81('0x13')])_0x30f564[_0xfd81('0x13')](_0x1dc5b7[_0xfd81('0x13')]);return db[_0xfd81('0x73')][_0xfd81('0x2c')](_0x30f564[_0xfd81('0x74')](),_0x252531);});})[_0xfd81('0x28')](function(_0x148722){_0x148722['forEach'](function(_0x29d1d5){if(_0x29d1d5[_0xfd81('0x7c')]){_0x29d1d5[_0xfd81('0x7d')]=[];_0x29d1d5[_0xfd81('0x7c')][_0xfd81('0x49')](',')[_0xfd81('0x4b')](function(_0x201e95){_0x29d1d5[_0xfd81('0x7d')][_0xfd81('0x24')](_0x22d664[_0x201e95]);});}delete _0x29d1d5['TagIds'];});_0x23148f[_0xfd81('0x7e')]=_0x148722;return _0x23148f;})[_0xfd81('0x28')](respondWithFilteredResult(_0xb0b8b6,_0x1dc5b7));})['catch'](handleError(_0xb0b8b6,null));};exports[_0xfd81('0x19')]=function(_0x1aa17c,_0x59a506){return db['CmContact'][_0xfd81('0x47')]({'where':{'id':_0x1aa17c[_0xfd81('0x7f')]['id']}})[_0xfd81('0x28')](handleEntityNotFound(_0x59a506,null))['then'](removeEntity(_0x59a506,null))[_0xfd81('0x80')](handleError(_0x59a506,null));};exports[_0xfd81('0x1f')]=function(_0x4db276,_0x11d326){return db[_0xfd81('0x75')][_0xfd81('0x1f')]()[_0xfd81('0x28')](function(_0x4d8e03){delete _0x4d8e03[_0xfd81('0x81')];for(var _0x57844b=0x0;_0x57844b=_0x280542){_0x59a1aa=_0x280542;_0x3f6b6b=0xc8;}else{_0x3f6b6b=0xce;}_0x285301[_0xed46('0xf')](_0x3f6b6b);return _0x285301[_0xed46('0x14')]('Content-Range',_0x384f3e+'-'+_0x59a1aa+'/'+_0x280542)[_0xed46('0x15')](_0x21a8d5);}return null;};}function saveUpdates(_0x12cb8a){return function(_0x5a7578){if(_0x5a7578){return _0x5a7578['update'](_0x12cb8a)[_0xed46('0x16')](function(_0x1cedde){return _0x1cedde;});}return null;};}function removeEntity(_0x2908c3){return function(_0x1de4e0){if(_0x1de4e0){return _0x1de4e0[_0xed46('0x17')]()[_0xed46('0x16')](function(){_0x2908c3['status'](0xcc)[_0xed46('0x18')]();});}};}function handleEntityNotFound(_0x3e1dfa){return function(_0x521846){if(!_0x521846){_0x3e1dfa[_0xed46('0x19')](0x194);}return _0x521846;};}function handleError(_0x2a2a1b,_0x5ad15e){_0x5ad15e=_0x5ad15e||0x1f4;return function(_0x158100){logger['error'](_0x158100['stack']);if(_0x158100['name']){delete _0x158100[_0xed46('0x1a')];}_0x2a2a1b[_0xed46('0xf')](_0x5ad15e)[_0xed46('0x1b')](_0x158100);};}exports[_0xed46('0x1c')]=function(_0x2126e0,_0x550785){var _0x8789c0={},_0xe25b6b={},_0x3984d3={'count':0x0,'rows':[]};return db[_0xed46('0x1d')][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x39ef32){var _0x479616=[];for(var _0x4316e6=0x0;_0x4316e60x1){_0x1d843c['or'](_0xed46('0x54'),qs[_0xed46('0x55')](_0x448370),null);}else{if(qs['isNumeric'](_0x448370)){_0x1d843c['or'](_0xed46('0x56'),_0x448370+'%');_0x1d843c['or']('c.phone\x20LIKE\x20?',_0x448370+'%');_0x1d843c['or'](_0xed46('0x57'),_0x448370+'%');_0x1d843c['or']('c.fax\x20LIKE\x20?',_0x448370+'%');}else if(qs[_0xed46('0x58')](_0x448370)){_0x1d843c['or'](_0xed46('0x59'),_0x448370+'%');}else{_0x1d843c['or'](_0xed46('0x5a'),'%'+_0x448370+'%');_0x1d843c['or'](_0xed46('0x5b'),'%'+_0x448370+'%');_0x1d843c['or']('c.email\x20LIKE\x20?','%'+_0x448370+'%');}}}}_0x2c6933[_0xed46('0x30')](_0x1d843c);_0x2c6933[_0xed46('0x5c')]('c.id');var _0x455abf={'type':db[_0xed46('0x5d')][_0xed46('0x5e')][_0xed46('0x5f')],'raw':!![]};var _0x336ce3=_0x2c6933[_0xed46('0x60')]()[_0xed46('0x33')]('c.id');if(_0x8789c0[_0xed46('0x61')]){_0x8789c0[_0xed46('0x61')][_0xed46('0x4c')](function(_0x12a6a4){_0x2c6933[_0xed46('0x61')]('c.'+_0x12a6a4[0x0],_0x12a6a4[0x1]===_0xed46('0x62')?![]:!![]);});}if(!_[_0xed46('0x4b')](_0xcba9b8)){_0x2c6933[_0xed46('0x63')](_0x771a9d);_0x336ce3['where'](_0xed46('0x64'),_0xcba9b8);}BPromise[_0xed46('0x65')]()[_0xed46('0x16')](function(){if(!_0x3c0d6f)return;if(_0x2126e0[_0xed46('0x66')][_0xed46('0x67')]!==_0xed46('0x68'))return;if(!_[_0xed46('0x69')](_0x3c0d6f[_0xed46('0x3f')],[_0xed46('0x33'),'User'])){return _0x2126e0[_0xed46('0x66')][_0xed46('0x6a')]({'attributes':['id'],'raw':!![]})[_0xed46('0x16')](function(_0x2687d1){if(_[_0xed46('0x4b')](_0x2687d1)){_0x336ce3['where']('c.ListId\x20IS\x20NULL');_0x2c6933[_0xed46('0x30')](_0xed46('0x6b'));}else{_0x336ce3[_0xed46('0x30')](_0xed46('0x6c'),_[_0xed46('0x42')](_0x2687d1,'id'));_0x2c6933['where'](_0xed46('0x6c'),_['map'](_0x2687d1,'id'));}});}})['then'](function(){if(_0x2126e0['user']['role']===_0xed46('0x68')&&!_0x3c0d6f&&!_0x2126e0[_0xed46('0x28')][_0xed46('0x4d')])return[];return db['sequelize'][_0xed46('0x28')](_0x336ce3['toString'](),_0x455abf);})['then'](function(_0x38ec5c){_0x3984d3['count']=_0x38ec5c[_0xed46('0x20')];if(_0x3984d3[_0xed46('0x12')]===0x0)return[];return db['sequelize']['query'](_0xc8972c['toString'](),_0x455abf)[_0xed46('0x16')](function(_0x1d660d){_0x3a7d58=_[_0xed46('0x6d')](_0x1d660d,'id');_0x455abf=_[_0xed46('0x6e')](_0x455abf,{'model':db[_0xed46('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2126e0['query'][_0xed46('0x2c')]){_0x8789c0[_0xed46('0x2b')]['forEach'](function(_0x13e1ef){_0x2c6933[_0xed46('0x33')]('c.'+_0x13e1ef);});}else{_0x2c6933[_0xed46('0x33')](_0xed46('0x6f'));_0x2c6933[_0xed46('0x33')](_0xed46('0x70'));_0x2c6933['field'](_0xed46('0x71'));_0x2c6933[_0xed46('0x33')](_0xed46('0x72'));_0x2c6933['field']('c.mobile');_0x2c6933[_0xed46('0x33')]('c.fax');_0x2c6933['field'](_0xed46('0x73'));_0x2c6933[_0xed46('0x33')](_0xed46('0x74'));_0x2c6933['field']('c.createdAt');_0x2c6933[_0xed46('0x33')](_0xed46('0x75'));_0x2c6933[_0xed46('0x33')](_0xed46('0x76'));_0x2c6933['field'](_0xed46('0x77'),_0xed46('0x78'));}if(_0x8789c0[_0xed46('0x13')])_0x2c6933[_0xed46('0x13')](_0x8789c0[_0xed46('0x13')]);if(_0x8789c0[_0xed46('0x10')])_0x2c6933[_0xed46('0x10')](_0x8789c0[_0xed46('0x10')]);return db[_0xed46('0x79')][_0xed46('0x28')](_0x2c6933['toString'](),_0x455abf);});})[_0xed46('0x16')](function(_0x3cbed0){_0x3cbed0[_0xed46('0x4c')](function(_0x49c8d1){if(_0x49c8d1[_0xed46('0x78')]){_0x49c8d1[_0xed46('0x7a')]=[];_0x49c8d1['TagIds'][_0xed46('0x41')](',')[_0xed46('0x4c')](function(_0x3d1756){_0x49c8d1['Tags']['push'](_0x3a7d58[_0x3d1756]);});}delete _0x49c8d1['TagIds'];});_0x3984d3[_0xed46('0x7b')]=_0x3cbed0;return _0x3984d3;})[_0xed46('0x16')](respondWithFilteredResult(_0x550785,_0x8789c0));})[_0xed46('0x7c')](handleError(_0x550785,null));};exports[_0xed46('0x17')]=function(_0x3b8ec0,_0x22228f){return db[_0xed46('0x1d')][_0xed46('0x7d')]({'where':{'id':_0x3b8ec0[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x22228f,null))['then'](removeEntity(_0x22228f,null))[_0xed46('0x7c')](handleError(_0x22228f,null));};exports['describe']=function(_0x4b4126,_0x3e32c4){return db[_0xed46('0x1d')][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x4031ad){delete _0x4031ad[_0xed46('0x7f')];for(var _0x45dded=0x0;_0x45dded{}\s\\|]/g,'-');_0x6ddf65(null,util[_0x269a('0x21')]('%s-%s%s',path[_0x269a('0x22')](_0x15923b[_0x269a('0x1f')],path[_0x269a('0x23')](_0x15923b[_0x269a('0x1f')])),Date[_0x269a('0x24')](),path[_0x269a('0x23')](_0x15923b[_0x269a('0x1f')])));}})});router['post'](_0x269a('0x25'),upload[_0x269a('0x26')](_0x269a('0x27')),controller[_0x269a('0x28')]);var upload=multer({'storage':multer[_0x269a('0x1b')]({'destination':function(_0x2c6f20,_0x119304,_0x151e2c){_0x151e2c(null,path[_0x269a('0x1c')](config[_0x269a('0x1d')],_0x269a('0x1e')));},'filename':function(_0x45a550,_0x3617c8,_0x17e8b5){_0x3617c8[_0x269a('0x1f')]=_0x3617c8[_0x269a('0x1f')][_0x269a('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17e8b5(null,util[_0x269a('0x21')](_0x269a('0x29'),path[_0x269a('0x22')](_0x3617c8[_0x269a('0x1f')],path[_0x269a('0x23')](_0x3617c8[_0x269a('0x1f')])),Date[_0x269a('0x24')](),path[_0x269a('0x23')](_0x3617c8['originalname'])));}})});router[_0x269a('0x18')](_0x269a('0x2a'),upload[_0x269a('0x26')](_0x269a('0x27')),controller[_0x269a('0x2b')]);router[_0x269a('0x18')](_0x269a('0x2c'),auth['isAuthenticated'](),controller[_0x269a('0x2d')]);router[_0x269a('0x2e')](_0x269a('0xd'),auth[_0x269a('0xb')](),controller[_0x269a('0x2f')]);router[_0x269a('0x30')](_0x269a('0xd'),auth[_0x269a('0xb')](),controller[_0x269a('0x31')]);module[_0x269a('0x32')]=router; \ No newline at end of file +var _0xa90e=['/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','/upload','upload','/upload/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get'];(function(_0x52969d,_0xe22051){var _0x2a27bd=function(_0x381578){while(--_0x381578){_0x52969d['push'](_0x52969d['shift']());}};_0x2a27bd(++_0xe22051);}(_0xa90e,0x89));var _0xea90=function(_0xd98ce4,_0x2a9a9d){_0xd98ce4=_0xd98ce4-0x0;var _0x4dfc16=_0xa90e[_0xd98ce4];return _0x4dfc16;};'use strict';var multer=require(_0xea90('0x0'));var util=require(_0xea90('0x1'));var path=require(_0xea90('0x2'));var timeout=require(_0xea90('0x3'));var express=require(_0xea90('0x4'));var router=express[_0xea90('0x5')]();var fs_extra=require(_0xea90('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xea90('0x7'));var config=require(_0xea90('0x8'));var controller=require(_0xea90('0x9'));router['get']('/',auth[_0xea90('0xa')](),controller[_0xea90('0xb')]);router[_0xea90('0xc')]('/describe',auth[_0xea90('0xa')](),controller['describe']);router['get'](_0xea90('0xd'),auth[_0xea90('0xa')](),controller['show']);router[_0xea90('0xc')](_0xea90('0xe'),auth[_0xea90('0xa')](),controller[_0xea90('0xf')]);router['get'](_0xea90('0x10'),auth[_0xea90('0xa')](),controller[_0xea90('0x11')]);router[_0xea90('0xc')](_0xea90('0x12'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xea90('0xc')](_0xea90('0x13'),auth['isAuthenticated'](),controller[_0xea90('0x14')]);router[_0xea90('0xc')](_0xea90('0x15'),auth[_0xea90('0xa')](),controller[_0xea90('0x16')]);router[_0xea90('0xc')](_0xea90('0x17'),auth[_0xea90('0xa')](),controller[_0xea90('0x18')]);router['post'](_0xea90('0x19'),auth[_0xea90('0xa')](),controller[_0xea90('0x1a')]);router[_0xea90('0x1b')]('/',auth[_0xea90('0xa')](),controller[_0xea90('0x1c')]);router['post'](_0xea90('0x1d'),auth['isAuthenticated'](),controller[_0xea90('0x1e')]);router[_0xea90('0x1b')](_0xea90('0xe'),auth['isAuthenticated'](),controller[_0xea90('0x1f')]);var upload=multer({'storage':multer[_0xea90('0x20')]({'destination':function(_0x588096,_0x88338e,_0x3185ce){_0x3185ce(null,path[_0xea90('0x21')](config[_0xea90('0x22')],_0xea90('0x23')));},'filename':function(_0x143b12,_0x1b784b,_0x193b4d){_0x1b784b[_0xea90('0x24')]=_0x1b784b[_0xea90('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x193b4d(null,util[_0xea90('0x25')](_0xea90('0x26'),path['basename'](_0x1b784b[_0xea90('0x24')],path[_0xea90('0x27')](_0x1b784b[_0xea90('0x24')])),Date[_0xea90('0x28')](),path[_0xea90('0x27')](_0x1b784b[_0xea90('0x24')])));}})});router[_0xea90('0x1b')](_0xea90('0x29'),upload[_0xea90('0x2a')](_0xea90('0x2b')),controller[_0xea90('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49b555,_0x335305,_0x420442){_0x420442(null,path[_0xea90('0x21')](config['root'],_0xea90('0x23')));},'filename':function(_0x2c8a9f,_0x17f4c8,_0x322978){_0x17f4c8['originalname']=_0x17f4c8[_0xea90('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x322978(null,util['format']('%s-%s%s',path['basename'](_0x17f4c8['originalname'],path[_0xea90('0x27')](_0x17f4c8[_0xea90('0x24')])),Date[_0xea90('0x28')](),path[_0xea90('0x27')](_0x17f4c8[_0xea90('0x24')])));}})});router[_0xea90('0x1b')](_0xea90('0x2d'),upload[_0xea90('0x2a')](_0xea90('0x2b')),controller[_0xea90('0x2e')]);router[_0xea90('0x1b')](_0xea90('0x2f'),auth[_0xea90('0xa')](),controller['import']);router['put'](_0xea90('0xd'),auth[_0xea90('0xa')](),controller['update']);router[_0xea90('0x30')]('/:id',auth[_0xea90('0xa')](),controller[_0xea90('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ee514a2..da746b3 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 _0x01cc=['isArray','values','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','TEXT','long','getDataValue','type','select','parse'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x01cc,0x19c));var _0xc01c=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x01cc[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0xc01c('0x0'));var _=require(_0xc01c('0x1'));module[_0xc01c('0x2')]={'name':{'type':Sequelize[_0xc01c('0x3')],'get':function(_0x162f0e){return this['getDataValue'](_0xc01c('0x4'));}},'alias':{'type':Sequelize[_0xc01c('0x5')],'allowNull':![],'set':function(_0x10f11d){this[_0xc01c('0x6')](_0xc01c('0x4'),_0x10f11d?_0x10f11d:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xc01c('0x7')](_0xc01c('0x8')),'get':function(){if(this[_0xc01c('0x9')](_0xc01c('0xa'))===_0xc01c('0xb')){return JSON[_0xc01c('0xc')](this[_0xc01c('0x9')]('values'));}else{return this[_0xc01c('0x9')]('values');}},'set':function(_0x3a6976){if(Array[_0xc01c('0xd')](_0x3a6976)){this[_0xc01c('0x6')]('values',JSON['stringify'](_0x3a6976));}else{this[_0xc01c('0x6')](_0xc01c('0xe'),_0x3a6976);}}},'required':{'type':Sequelize[_0xc01c('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc01c('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xc01c('0x10'))}}; \ No newline at end of file +var _0x487b=['sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','parse','values','isArray','BOOLEAN','ENUM','voice'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x487b,0x19e));var _0xb487=function(_0x351145,_0x574f81){_0x351145=_0x351145-0x0;var _0xc4db5d=_0x487b[_0x351145];return _0xc4db5d;};'use strict';var Sequelize=require(_0xb487('0x0'));var _=require(_0xb487('0x1'));module[_0xb487('0x2')]={'name':{'type':Sequelize[_0xb487('0x3')],'get':function(_0x5aba2d){return this[_0xb487('0x4')]('alias');}},'alias':{'type':Sequelize[_0xb487('0x5')],'allowNull':![],'set':function(_0x33c224){this[_0xb487('0x6')](_0xb487('0x7'),_0x33c224?_0x33c224:this[_0xb487('0x4')](_0xb487('0x8')));}},'type':{'type':Sequelize[_0xb487('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb487('0x9')]('long'),'get':function(){if(this['getDataValue'](_0xb487('0xa'))===_0xb487('0xb')){return JSON[_0xb487('0xc')](this[_0xb487('0x4')]('values'));}else{return this[_0xb487('0x4')](_0xb487('0xd'));}},'set':function(_0x19abe3){if(Array[_0xb487('0xe')](_0x19abe3)){this[_0xb487('0x6')]('values',JSON['stringify'](_0x19abe3));}else{this[_0xb487('0x6')](_0xb487('0xd'),_0x19abe3);}}},'required':{'type':Sequelize[_0xb487('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb487('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xb487('0x10')](_0xb487('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 62ecc8a..030fa64 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 _0x5460=['Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction'];(function(_0x415260,_0x135fcb){var _0x490f21=function(_0x28d91c){while(--_0x28d91c){_0x415260['push'](_0x415260['shift']());}};_0x490f21(++_0x135fcb);}(_0x5460,0x177));var _0x0546=function(_0x2ba3ee,_0x34a4a1){_0x2ba3ee=_0x2ba3ee-0x0;var _0x572417=_0x5460[_0x2ba3ee];return _0x572417;};'use strict';var emlformat=require(_0x0546('0x0'));var rimraf=require(_0x0546('0x1'));var zipdir=require(_0x0546('0x2'));var jsonpatch=require(_0x0546('0x3'));var rp=require(_0x0546('0x4'));var moment=require(_0x0546('0x5'));var BPromise=require(_0x0546('0x6'));var Mustache=require(_0x0546('0x7'));var util=require(_0x0546('0x8'));var path=require(_0x0546('0x9'));var sox=require(_0x0546('0xa'));var csv=require('to-csv');var ejs=require(_0x0546('0xb'));var fs=require('fs');var fs_extra=require(_0x0546('0xc'));var _=require(_0x0546('0xd'));var squel=require(_0x0546('0xe'));var crypto=require(_0x0546('0xf'));var jsforce=require(_0x0546('0x10'));var deskjs=require(_0x0546('0x11'));var toCsv=require(_0x0546('0x12'));var querystring=require(_0x0546('0x13'));var Papa=require(_0x0546('0x14'));var Redis=require(_0x0546('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0546('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0546('0x17'));var config=require(_0x0546('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0546('0x19'))['db'];function respondWithStatusCode(_0x16be76,_0x4d6199){_0x4d6199=_0x4d6199||0xcc;return function(_0x20bd5c){if(_0x20bd5c){return _0x16be76['sendStatus'](_0x4d6199);}return _0x16be76['status'](_0x4d6199)['end']();};}function respondWithResult(_0x113fab,_0x8f3a){_0x8f3a=_0x8f3a||0xc8;return function(_0x141ad6){if(_0x141ad6){return _0x113fab['status'](_0x8f3a)[_0x0546('0x1a')](_0x141ad6);}};}function respondWithFilteredResult(_0x526eae,_0x1b9f48){return function(_0x69da8f){if(_0x69da8f){var _0xd852e9=typeof _0x1b9f48[_0x0546('0x1b')]===_0x0546('0x1c')&&typeof _0x1b9f48[_0x0546('0x1d')]===_0x0546('0x1c');var _0x3bd7e7=_0x69da8f[_0x0546('0x1e')];var _0x41bce3=_0xd852e9?0x0:_0x1b9f48[_0x0546('0x1b')];var _0x1b56c6=_0xd852e9?_0x69da8f[_0x0546('0x1e')]:_0x1b9f48[_0x0546('0x1b')]+_0x1b9f48[_0x0546('0x1d')];var _0x449980;if(_0x1b56c6>=_0x3bd7e7){_0x1b56c6=_0x3bd7e7;_0x449980=0xc8;}else{_0x449980=0xce;}_0x526eae[_0x0546('0x1f')](_0x449980);return _0x526eae[_0x0546('0x20')](_0x0546('0x21'),_0x41bce3+'-'+_0x1b56c6+'/'+_0x3bd7e7)[_0x0546('0x1a')](_0x69da8f);}return null;};}function patchUpdates(_0x4f6ecd){return function(_0x9c1b1d){try{jsonpatch[_0x0546('0x22')](_0x9c1b1d,_0x4f6ecd,!![]);}catch(_0x3c30cf){return BPromise[_0x0546('0x23')](_0x3c30cf);}return _0x9c1b1d['save']();};}function saveUpdates(_0x472714,_0xf96907){return function(_0x35186c){if(_0x35186c){return _0x35186c[_0x0546('0x24')](_0x472714)[_0x0546('0x25')](function(_0x59acf1){return _0x59acf1;});}return null;};}function removeEntity(_0x1f01e2,_0x45a4c0){return function(_0xc86eaf){if(_0xc86eaf){return _0xc86eaf[_0x0546('0x26')]()[_0x0546('0x25')](function(){_0x1f01e2['status'](0xcc)[_0x0546('0x27')]();});}};}function handleEntityNotFound(_0x5aeec0,_0x5ca9e2){return function(_0x30b9fe){if(!_0x30b9fe){_0x5aeec0[_0x0546('0x28')](0x194);}return _0x30b9fe;};}function handleError(_0x58e6a7,_0xcd578d){_0xcd578d=_0xcd578d||0x1f4;return function(_0x18bb9a){logger[_0x0546('0x29')](_0x18bb9a[_0x0546('0x2a')]);if(_0x18bb9a[_0x0546('0x2b')]){delete _0x18bb9a[_0x0546('0x2b')];}_0x58e6a7['status'](_0xcd578d)[_0x0546('0x2c')](_0x18bb9a);};}exports[_0x0546('0x2d')]=function(_0x5834e5,_0x347b08){var _0x3ca12a={},_0x1e2861={},_0x24957e={'count':0x0,'rows':[]};var _0x1eb702=_[_0x0546('0x2e')](db[_0x0546('0x2f')][_0x0546('0x30')],function(_0x2e3ca8){return{'name':_0x2e3ca8[_0x0546('0x31')],'type':_0x2e3ca8[_0x0546('0x32')][_0x0546('0x33')]};});_0x1e2861[_0x0546('0x34')]=_[_0x0546('0x35')](_[_0x0546('0x2e')](_0x1eb702,_0x0546('0x2b')),[_0x0546('0x2b')]);_0x1e2861[_0x0546('0x36')]=_[_0x0546('0x37')](_0x5834e5['query']);_0x1e2861[_0x0546('0x38')]=_[_0x0546('0x39')](_0x1e2861['model'],_0x1e2861[_0x0546('0x36')]);_0x3ca12a[_0x0546('0x3a')]=_[_0x0546('0x39')](_0x1e2861['model'],qs[_0x0546('0x3b')](_0x5834e5[_0x0546('0x36')][_0x0546('0x3b')]));_0x3ca12a['attributes']=_0x3ca12a[_0x0546('0x3a')][_0x0546('0x3c')]?_0x3ca12a[_0x0546('0x3a')]:_0x1e2861[_0x0546('0x34')];if(!_0x5834e5[_0x0546('0x36')]['hasOwnProperty'](_0x0546('0x3d'))){_0x3ca12a['limit']=qs[_0x0546('0x1d')](_0x5834e5[_0x0546('0x36')]['limit']);_0x3ca12a[_0x0546('0x1b')]=qs['offset'](_0x5834e5[_0x0546('0x36')]['offset']);}_0x3ca12a[_0x0546('0x3e')]=qs[_0x0546('0x3f')](_0x5834e5['query'][_0x0546('0x3f')]);_0x3ca12a[_0x0546('0x40')]=qs[_0x0546('0x38')](_[_0x0546('0x41')](_0x5834e5[_0x0546('0x36')],_0x1e2861[_0x0546('0x38')]),_0x1eb702);if(_0x5834e5[_0x0546('0x36')]['filter']){_0x3ca12a[_0x0546('0x40')]=_[_0x0546('0x42')](_0x3ca12a[_0x0546('0x40')],{'$or':_[_0x0546('0x2e')](_0x1eb702,function(_0x5cc97f){if(_0x5cc97f['type']!=='VIRTUAL'){var _0x1b7ede={};_0x1b7ede[_0x5cc97f[_0x0546('0x2b')]]={'$like':'%'+_0x5834e5['query'][_0x0546('0x43')]+'%'};return _0x1b7ede;}})});}_0x3ca12a=_[_0x0546('0x42')]({},_0x3ca12a,_0x5834e5[_0x0546('0x44')]);var _0x4bfae0={'where':_0x3ca12a[_0x0546('0x40')]};return db[_0x0546('0x2f')][_0x0546('0x1e')](_0x4bfae0)[_0x0546('0x25')](function(_0x53b606){_0x24957e[_0x0546('0x1e')]=_0x53b606;if(_0x5834e5[_0x0546('0x36')][_0x0546('0x45')]){_0x3ca12a[_0x0546('0x46')]=[{'all':!![]}];}return db[_0x0546('0x2f')][_0x0546('0x47')](_0x3ca12a);})[_0x0546('0x25')](function(_0x275882){_0x24957e['rows']=_0x275882;return _0x24957e;})[_0x0546('0x25')](respondWithFilteredResult(_0x347b08,_0x3ca12a))[_0x0546('0x48')](handleError(_0x347b08,null));};exports[_0x0546('0x49')]=function(_0x61fb69,_0x434b1f){var _0x3171ec={'raw':!![],'where':{'id':_0x61fb69[_0x0546('0x4a')]['id']}},_0x54ad30={};_0x54ad30['model']=_['keys'](db[_0x0546('0x2f')][_0x0546('0x30')]);_0x54ad30['query']=_[_0x0546('0x37')](_0x61fb69[_0x0546('0x36')]);_0x54ad30[_0x0546('0x38')]=_['intersection'](_0x54ad30[_0x0546('0x34')],_0x54ad30['query']);_0x3171ec[_0x0546('0x3a')]=_[_0x0546('0x39')](_0x54ad30['model'],qs[_0x0546('0x3b')](_0x61fb69[_0x0546('0x36')]['fields']));_0x3171ec[_0x0546('0x3a')]=_0x3171ec['attributes'][_0x0546('0x3c')]?_0x3171ec[_0x0546('0x3a')]:_0x54ad30[_0x0546('0x34')];if(_0x61fb69[_0x0546('0x36')][_0x0546('0x45')]){_0x3171ec[_0x0546('0x46')]=[{'all':!![]}];}_0x3171ec=_[_0x0546('0x42')]({},_0x3171ec,_0x61fb69['options']);return db[_0x0546('0x2f')][_0x0546('0x4b')](_0x3171ec)[_0x0546('0x25')](handleEntityNotFound(_0x434b1f,null))['then'](respondWithResult(_0x434b1f,null))[_0x0546('0x48')](handleError(_0x434b1f,null));};exports['update']=function(_0x5f3fe6,_0x54a56d){if(_0x5f3fe6[_0x0546('0x4c')]['id']){delete _0x5f3fe6['body']['id'];}return db[_0x0546('0x2f')][_0x0546('0x4b')]({'where':{'id':_0x5f3fe6[_0x0546('0x4a')]['id']}})[_0x0546('0x25')](handleEntityNotFound(_0x54a56d,null))[_0x0546('0x25')](saveUpdates(_0x5f3fe6[_0x0546('0x4c')],null))[_0x0546('0x25')](respondWithResult(_0x54a56d,null))[_0x0546('0x48')](handleError(_0x54a56d,null));};exports['destroy']=function(_0x555fb0,_0x15cef2){return db[_0x0546('0x2f')]['find']({'where':{'id':_0x555fb0[_0x0546('0x4a')]['id']}})[_0x0546('0x25')](handleEntityNotFound(_0x15cef2,null))[_0x0546('0x25')](removeEntity(_0x15cef2,null))[_0x0546('0x48')](handleError(_0x15cef2,null));};exports[_0x0546('0x4d')]=function(_0x3edd57,_0x95668c){var _0x34da68;return db[_0x0546('0x4e')][_0x0546('0x4f')](function(_0x1f5945){return db[_0x0546('0x2f')][_0x0546('0x4d')](_0x3edd57[_0x0546('0x4c')],{'transaction':_0x1f5945})[_0x0546('0x25')](function(_0x467a20){_0x34da68=_0x467a20;var _0x386eec={'type':db[_0x0546('0x50')][_0x0546('0x51')],'transaction':_0x1f5945};switch(_0x3edd57[_0x0546('0x4c')][_0x0546('0x32')]){case _0x0546('0x52'):_0x386eec[_0x0546('0x32')]=db[_0x0546('0x50')]['TEXT'];break;case _0x0546('0x53'):_0x386eec['type']=db[_0x0546('0x50')][_0x0546('0x54')];break;case _0x0546('0x55'):_0x386eec[_0x0546('0x32')]=db[_0x0546('0x50')][_0x0546('0x56')];_0x386eec[_0x0546('0x57')]=![];break;default:}return db['sequelize']['queryInterface'][_0x0546('0x58')](_0x0546('0x59'),util[_0x0546('0x5a')]('cf_%d',_0x34da68['id']),_0x386eec);})[_0x0546('0x25')](function(){return _0x34da68;});})[_0x0546('0x25')](respondWithResult(_0x95668c,0xc9))[_0x0546('0x48')](handleError(_0x95668c,null));}; \ No newline at end of file +var _0x06ea=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','body','transaction','create','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x49d236,_0x4998f4){var _0x57dd2b=function(_0x1127eb){while(--_0x1127eb){_0x49d236['push'](_0x49d236['shift']());}};_0x57dd2b(++_0x4998f4);}(_0x06ea,0x9b));var _0xa06e=function(_0x3121ee,_0x1fb011){_0x3121ee=_0x3121ee-0x0;var _0x55b96c=_0x06ea[_0x3121ee];return _0x55b96c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa06e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa06e('0x1'));var BPromise=require(_0xa06e('0x2'));var Mustache=require(_0xa06e('0x3'));var util=require(_0xa06e('0x4'));var path=require(_0xa06e('0x5'));var sox=require(_0xa06e('0x6'));var csv=require(_0xa06e('0x7'));var ejs=require(_0xa06e('0x8'));var fs=require('fs');var fs_extra=require(_0xa06e('0x9'));var _=require(_0xa06e('0xa'));var squel=require('squel');var crypto=require(_0xa06e('0xb'));var jsforce=require(_0xa06e('0xc'));var deskjs=require(_0xa06e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa06e('0xe'));var Redis=require(_0xa06e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa06e('0x10'));var as=require(_0xa06e('0x11'));var hardwareService=require(_0xa06e('0x12'));var logger=require(_0xa06e('0x13'))(_0xa06e('0x14'));var utils=require(_0xa06e('0x15'));var config=require(_0xa06e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa06e('0x17'))['db'];function respondWithStatusCode(_0x151f41,_0x21ecc6){_0x21ecc6=_0x21ecc6||0xcc;return function(_0x1876d1){if(_0x1876d1){return _0x151f41[_0xa06e('0x18')](_0x21ecc6);}return _0x151f41[_0xa06e('0x19')](_0x21ecc6)[_0xa06e('0x1a')]();};}function respondWithResult(_0x22f987,_0x5ee41e){_0x5ee41e=_0x5ee41e||0xc8;return function(_0x1f056d){if(_0x1f056d){return _0x22f987[_0xa06e('0x19')](_0x5ee41e)['json'](_0x1f056d);}};}function respondWithFilteredResult(_0x22fbca,_0x118d69){return function(_0x323f21){if(_0x323f21){var _0x2a21d6=typeof _0x118d69[_0xa06e('0x1b')]==='undefined'&&typeof _0x118d69[_0xa06e('0x1c')]===_0xa06e('0x1d');var _0x3a60eb=_0x323f21[_0xa06e('0x1e')];var _0x3f2800=_0x2a21d6?0x0:_0x118d69[_0xa06e('0x1b')];var _0x118abd=_0x2a21d6?_0x323f21['count']:_0x118d69[_0xa06e('0x1b')]+_0x118d69['limit'];var _0x4b1ed2;if(_0x118abd>=_0x3a60eb){_0x118abd=_0x3a60eb;_0x4b1ed2=0xc8;}else{_0x4b1ed2=0xce;}_0x22fbca[_0xa06e('0x19')](_0x4b1ed2);return _0x22fbca[_0xa06e('0x1f')](_0xa06e('0x20'),_0x3f2800+'-'+_0x118abd+'/'+_0x3a60eb)[_0xa06e('0x21')](_0x323f21);}return null;};}function patchUpdates(_0x571ec4){return function(_0x4ff572){try{jsonpatch[_0xa06e('0x22')](_0x4ff572,_0x571ec4,!![]);}catch(_0x3c4ef6){return BPromise['reject'](_0x3c4ef6);}return _0x4ff572[_0xa06e('0x23')]();};}function saveUpdates(_0x3d7dcc,_0x25e590){return function(_0x264159){if(_0x264159){return _0x264159[_0xa06e('0x24')](_0x3d7dcc)['then'](function(_0x8952a3){return _0x8952a3;});}return null;};}function removeEntity(_0x1c85a1,_0x2693ae){return function(_0x252f36){if(_0x252f36){return _0x252f36[_0xa06e('0x25')]()[_0xa06e('0x26')](function(){_0x1c85a1['status'](0xcc)[_0xa06e('0x1a')]();});}};}function handleEntityNotFound(_0x439a68,_0x5068d3){return function(_0x5c544a){if(!_0x5c544a){_0x439a68[_0xa06e('0x18')](0x194);}return _0x5c544a;};}function handleError(_0x57cbf0,_0x49fdcf){_0x49fdcf=_0x49fdcf||0x1f4;return function(_0x570609){logger['error'](_0x570609['stack']);if(_0x570609[_0xa06e('0x27')]){delete _0x570609['name'];}_0x57cbf0['status'](_0x49fdcf)[_0xa06e('0x28')](_0x570609);};}exports[_0xa06e('0x29')]=function(_0x158ec5,_0x280f13){var _0x24e8fe={},_0x3886b9={},_0x2b5965={'count':0x0,'rows':[]};var _0xbcf657=_['map'](db[_0xa06e('0x2a')][_0xa06e('0x2b')],function(_0x477882){return{'name':_0x477882[_0xa06e('0x2c')],'type':_0x477882[_0xa06e('0x2d')][_0xa06e('0x2e')]};});_0x3886b9[_0xa06e('0x2f')]=_[_0xa06e('0x30')](_[_0xa06e('0x31')](_0xbcf657,'name'),[_0xa06e('0x27')]);_0x3886b9[_0xa06e('0x32')]=_[_0xa06e('0x33')](_0x158ec5[_0xa06e('0x32')]);_0x3886b9[_0xa06e('0x34')]=_['intersection'](_0x3886b9['model'],_0x3886b9[_0xa06e('0x32')]);_0x24e8fe[_0xa06e('0x35')]=_[_0xa06e('0x36')](_0x3886b9[_0xa06e('0x2f')],qs['fields'](_0x158ec5['query'][_0xa06e('0x37')]));_0x24e8fe[_0xa06e('0x35')]=_0x24e8fe[_0xa06e('0x35')]['length']?_0x24e8fe['attributes']:_0x3886b9[_0xa06e('0x2f')];if(!_0x158ec5[_0xa06e('0x32')][_0xa06e('0x38')](_0xa06e('0x39'))){_0x24e8fe[_0xa06e('0x1c')]=qs[_0xa06e('0x1c')](_0x158ec5[_0xa06e('0x32')][_0xa06e('0x1c')]);_0x24e8fe[_0xa06e('0x1b')]=qs[_0xa06e('0x1b')](_0x158ec5['query'][_0xa06e('0x1b')]);}_0x24e8fe['order']=qs[_0xa06e('0x3a')](_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3a')]);_0x24e8fe[_0xa06e('0x3b')]=qs['filters'](_['pick'](_0x158ec5[_0xa06e('0x32')],_0x3886b9[_0xa06e('0x34')]),_0xbcf657);if(_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3c')]){_0x24e8fe[_0xa06e('0x3b')]=_[_0xa06e('0x3d')](_0x24e8fe[_0xa06e('0x3b')],{'$or':_['map'](_0xbcf657,function(_0x4501ee){if(_0x4501ee[_0xa06e('0x2d')]!=='VIRTUAL'){var _0x4fbbb2={};_0x4fbbb2[_0x4501ee[_0xa06e('0x27')]]={'$like':'%'+_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3c')]+'%'};return _0x4fbbb2;}})});}_0x24e8fe=_[_0xa06e('0x3d')]({},_0x24e8fe,_0x158ec5[_0xa06e('0x3e')]);var _0x319635={'where':_0x24e8fe[_0xa06e('0x3b')]};return db['CmCustomField'][_0xa06e('0x1e')](_0x319635)[_0xa06e('0x26')](function(_0x427fa2){_0x2b5965['count']=_0x427fa2;if(_0x158ec5['query'][_0xa06e('0x3f')]){_0x24e8fe[_0xa06e('0x40')]=[{'all':!![]}];}return db[_0xa06e('0x2a')]['findAll'](_0x24e8fe);})[_0xa06e('0x26')](function(_0x3a3f7a){_0x2b5965[_0xa06e('0x41')]=_0x3a3f7a;return _0x2b5965;})[_0xa06e('0x26')](respondWithFilteredResult(_0x280f13,_0x24e8fe))[_0xa06e('0x42')](handleError(_0x280f13,null));};exports[_0xa06e('0x43')]=function(_0x395f42,_0x433b42){var _0x291551={'raw':!![],'where':{'id':_0x395f42[_0xa06e('0x44')]['id']}},_0x5630e7={};_0x5630e7[_0xa06e('0x2f')]=_[_0xa06e('0x33')](db['CmCustomField']['rawAttributes']);_0x5630e7['query']=_[_0xa06e('0x33')](_0x395f42[_0xa06e('0x32')]);_0x5630e7['filters']=_[_0xa06e('0x36')](_0x5630e7[_0xa06e('0x2f')],_0x5630e7['query']);_0x291551[_0xa06e('0x35')]=_['intersection'](_0x5630e7[_0xa06e('0x2f')],qs[_0xa06e('0x37')](_0x395f42['query']['fields']));_0x291551[_0xa06e('0x35')]=_0x291551['attributes'][_0xa06e('0x45')]?_0x291551['attributes']:_0x5630e7[_0xa06e('0x2f')];if(_0x395f42[_0xa06e('0x32')][_0xa06e('0x3f')]){_0x291551[_0xa06e('0x40')]=[{'all':!![]}];}_0x291551=_[_0xa06e('0x3d')]({},_0x291551,_0x395f42[_0xa06e('0x3e')]);return db[_0xa06e('0x2a')][_0xa06e('0x46')](_0x291551)[_0xa06e('0x26')](handleEntityNotFound(_0x433b42,null))[_0xa06e('0x26')](respondWithResult(_0x433b42,null))[_0xa06e('0x42')](handleError(_0x433b42,null));};exports[_0xa06e('0x24')]=function(_0xe2404c,_0x16921d){if(_0xe2404c[_0xa06e('0x47')]['id']){delete _0xe2404c[_0xa06e('0x47')]['id'];}return db[_0xa06e('0x2a')][_0xa06e('0x46')]({'where':{'id':_0xe2404c['params']['id']}})[_0xa06e('0x26')](handleEntityNotFound(_0x16921d,null))[_0xa06e('0x26')](saveUpdates(_0xe2404c[_0xa06e('0x47')],null))['then'](respondWithResult(_0x16921d,null))['catch'](handleError(_0x16921d,null));};exports[_0xa06e('0x25')]=function(_0x558ddf,_0x90039){return db[_0xa06e('0x2a')][_0xa06e('0x46')]({'where':{'id':_0x558ddf[_0xa06e('0x44')]['id']}})[_0xa06e('0x26')](handleEntityNotFound(_0x90039,null))['then'](removeEntity(_0x90039,null))[_0xa06e('0x42')](handleError(_0x90039,null));};exports['create']=function(_0x355d4e,_0x13b4e6){var _0x345505;return db['sequelize'][_0xa06e('0x48')](function(_0x233c9d){return db[_0xa06e('0x2a')][_0xa06e('0x49')](_0x355d4e[_0xa06e('0x47')],{'transaction':_0x233c9d})['then'](function(_0x1945c4){_0x345505=_0x1945c4;var _0x1a9f21={'type':db['Sequelize'][_0xa06e('0x4a')],'transaction':_0x233c9d};switch(_0x355d4e[_0xa06e('0x47')]['type']){case _0xa06e('0x4b'):_0x1a9f21[_0xa06e('0x2d')]=db['Sequelize'][_0xa06e('0x4a')];break;case _0xa06e('0x4c'):_0x1a9f21['type']=db[_0xa06e('0x4d')][_0xa06e('0x4e')];break;case _0xa06e('0x4f'):_0x1a9f21[_0xa06e('0x2d')]=db[_0xa06e('0x4d')][_0xa06e('0x50')];_0x1a9f21[_0xa06e('0x51')]=![];break;default:}return db[_0xa06e('0x52')][_0xa06e('0x53')][_0xa06e('0x54')](_0xa06e('0x55'),util[_0xa06e('0x56')](_0xa06e('0x57'),_0x345505['id']),_0x1a9f21);})[_0xa06e('0x26')](function(){return _0x345505;});})[_0xa06e('0x26')](respondWithResult(_0x13b4e6,0xc9))['catch'](handleError(_0x13b4e6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0af3ec0..bb6d82b 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 _0xdab8=['CmCustomField','cm_custom_fields','lodash','../../config/logger','api','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x10127f,_0x55f92f){var _0x164d1c=function(_0x443b32){while(--_0x443b32){_0x10127f['push'](_0x10127f['shift']());}};_0x164d1c(++_0x55f92f);}(_0xdab8,0xd2));var _0x8dab=function(_0x237468,_0x2640f1){_0x237468=_0x237468-0x0;var _0x24aae1=_0xdab8[_0x237468];return _0x24aae1;};'use strict';var _=require(_0x8dab('0x0'));var util=require('util');var logger=require(_0x8dab('0x1'))(_0x8dab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8dab('0x3'));var attributes=require(_0x8dab('0x4'));module[_0x8dab('0x5')]=function(_0x281690,_0x973090){return _0x281690['define'](_0x8dab('0x6'),attributes,{'tableName':_0x8dab('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8657=['path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3d67b6,_0x482b88){var _0x185095=function(_0x1c7e98){while(--_0x1c7e98){_0x3d67b6['push'](_0x3d67b6['shift']());}};_0x185095(++_0x482b88);}(_0x8657,0x1b6));var _0x7865=function(_0x253df7,_0x2af793){_0x253df7=_0x253df7-0x0;var _0x12bd19=_0x8657[_0x253df7];return _0x12bd19;};'use strict';var _=require(_0x7865('0x0'));var util=require(_0x7865('0x1'));var logger=require(_0x7865('0x2'))(_0x7865('0x3'));var moment=require('moment');var BPromise=require(_0x7865('0x4'));var rp=require(_0x7865('0x5'));var fs=require('fs');var path=require(_0x7865('0x6'));var rimraf=require(_0x7865('0x7'));var config=require(_0x7865('0x8'));var attributes=require(_0x7865('0x9'));module['exports']=function(_0x350165,_0x49d012){return _0x350165[_0x7865('0xa')](_0x7865('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 96b1b6e..1269223 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 _0xc9a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x30abdf,_0x2fe412){var _0x5b9f63=function(_0x3e76d9){while(--_0x3e76d9){_0x30abdf['push'](_0x30abdf['shift']());}};_0x5b9f63(++_0x2fe412);}(_0xc9a7,0x1ca));var _0x7c9a=function(_0x5853be,_0x181484){_0x5853be=_0x5853be-0x0;var _0x2d0586=_0xc9a7[_0x5853be];return _0x2d0586;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c9a('0x0'));var BPromise=require(_0x7c9a('0x1'));var rs=require(_0x7c9a('0x2'));var fs=require('fs');var Redis=require(_0x7c9a('0x3'));var db=require(_0x7c9a('0x4'))['db'];var utils=require(_0x7c9a('0x5'));var logger=require(_0x7c9a('0x6'))(_0x7c9a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c9a('0x8')][_0x7c9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce2b1,_0x560194,_0x237953){return new BPromise(function(_0x4d73e7,_0x2c8b95){return client['request'](_0x3ce2b1,_0x237953)[_0x7c9a('0xa')](function(_0x153ec5){logger[_0x7c9a('0xb')](_0x7c9a('0xc'),_0x560194,_0x7c9a('0xd'));logger[_0x7c9a('0xe')](_0x7c9a('0xf'),_0x560194,_0x7c9a('0xd'),JSON[_0x7c9a('0x10')](_0x153ec5));if(_0x153ec5[_0x7c9a('0x11')]){if(_0x153ec5[_0x7c9a('0x11')][_0x7c9a('0x12')]===0x1f4){logger['error'](_0x7c9a('0xc'),_0x560194,_0x153ec5[_0x7c9a('0x11')]['message']);return _0x2c8b95(_0x153ec5[_0x7c9a('0x11')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x560194,_0x153ec5[_0x7c9a('0x11')][_0x7c9a('0x13')]);return _0x4d73e7(_0x153ec5['error']['message']);}else{logger[_0x7c9a('0xb')](_0x7c9a('0xc'),_0x560194,_0x7c9a('0xd'));_0x4d73e7(_0x153ec5[_0x7c9a('0x14')][_0x7c9a('0x13')]);}})[_0x7c9a('0x15')](function(_0x56ab33){logger[_0x7c9a('0x11')](_0x7c9a('0xc'),_0x560194,_0x56ab33);_0x2c8b95(_0x56ab33);});});} \ No newline at end of file +var _0x23e9=['CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x4a68f1,_0x194e22){var _0x208ca5=function(_0x410254){while(--_0x410254){_0x4a68f1['push'](_0x4a68f1['shift']());}};_0x208ca5(++_0x194e22);}(_0x23e9,0xaa));var _0x923e=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x23e9[_0x599e60];return _0x468e19;};'use strict';var _=require('lodash');var util=require(_0x923e('0x0'));var moment=require(_0x923e('0x1'));var BPromise=require(_0x923e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x923e('0x3'))['db'];var utils=require(_0x923e('0x4'));var logger=require('../../config/logger')(_0x923e('0x5'));var config=require('../../config/environment');var jayson=require(_0x923e('0x6'));var client=jayson['client'][_0x923e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19819f,_0x42fe0c,_0x3ede86){return new BPromise(function(_0x420271,_0x192e8b){return client[_0x923e('0x8')](_0x19819f,_0x3ede86)[_0x923e('0x9')](function(_0x2123a3){logger['info'](_0x923e('0xa'),_0x42fe0c,'request\x20sent');logger[_0x923e('0xb')](_0x923e('0xc'),_0x42fe0c,_0x923e('0xd'),JSON['stringify'](_0x2123a3));if(_0x2123a3[_0x923e('0xe')]){if(_0x2123a3[_0x923e('0xe')]['code']===0x1f4){logger['error'](_0x923e('0xa'),_0x42fe0c,_0x2123a3['error'][_0x923e('0xf')]);return _0x192e8b(_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);}logger[_0x923e('0xe')](_0x923e('0xa'),_0x42fe0c,_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);return _0x420271(_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);}else{logger[_0x923e('0x10')](_0x923e('0xa'),_0x42fe0c,_0x923e('0xd'));_0x420271(_0x2123a3['result']['message']);}})[_0x923e('0x11')](function(_0x57780d){logger[_0x923e('0xe')](_0x923e('0xa'),_0x42fe0c,_0x57780d);_0x192e8b(_0x57780d);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 699f5b5..a54f76b 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 _0x5577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x378142,_0x1d6104){var _0x2ab91e=function(_0x15cca4){while(--_0x15cca4){_0x378142['push'](_0x378142['shift']());}};_0x2ab91e(++_0x1d6104);}(_0x5577,0x1b4));var _0x7557=function(_0x3a82a4,_0x184279){_0x3a82a4=_0x3a82a4-0x0;var _0x2c656b=_0x5577[_0x3a82a4];return _0x2c656b;};'use strict';var multer=require(_0x7557('0x0'));var util=require('util');var path=require(_0x7557('0x1'));var timeout=require(_0x7557('0x2'));var express=require('express');var router=express[_0x7557('0x3')]();var fs_extra=require(_0x7557('0x4'));var auth=require(_0x7557('0x5'));var interaction=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var controller=require(_0x7557('0x8'));router['get']('/',auth[_0x7557('0x9')](),controller[_0x7557('0xa')]);router[_0x7557('0xb')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0xd')]);router[_0x7557('0xe')]('/',auth[_0x7557('0x9')](),controller[_0x7557('0xf')]);router[_0x7557('0x10')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0x11')]);router[_0x7557('0x12')](_0x7557('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7557('0x13')]=router; \ No newline at end of file +var _0xab3f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x16d830,_0x10e8a7){var _0x1dcf53=function(_0x3b4f23){while(--_0x3b4f23){_0x16d830['push'](_0x16d830['shift']());}};_0x1dcf53(++_0x10e8a7);}(_0xab3f,0x72));var _0xfab3=function(_0x489e5a,_0x6c58ae){_0x489e5a=_0x489e5a-0x0;var _0x3c58ae=_0xab3f[_0x489e5a];return _0x3c58ae;};'use strict';var multer=require(_0xfab3('0x0'));var util=require('util');var path=require(_0xfab3('0x1'));var timeout=require(_0xfab3('0x2'));var express=require(_0xfab3('0x3'));var router=express[_0xfab3('0x4')]();var fs_extra=require(_0xfab3('0x5'));var auth=require(_0xfab3('0x6'));var interaction=require(_0xfab3('0x7'));var config=require(_0xfab3('0x8'));var controller=require(_0xfab3('0x9'));router[_0xfab3('0xa')]('/',auth[_0xfab3('0xb')](),controller['index']);router[_0xfab3('0xa')](_0xfab3('0xc'),auth[_0xfab3('0xb')](),controller[_0xfab3('0xd')]);router[_0xfab3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfab3('0xf')]('/:id',auth[_0xfab3('0xb')](),controller['update']);router[_0xfab3('0x10')]('/:id',auth[_0xfab3('0xb')](),controller[_0xfab3('0x11')]);module[_0xfab3('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b3fbd7b..95f80bd 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 _0x0340=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','exports','STRING'];(function(_0x16a199,_0x206bf2){var _0x2166fd=function(_0x4c0b03){while(--_0x4c0b03){_0x16a199['push'](_0x16a199['shift']());}};_0x2166fd(++_0x206bf2);}(_0x0340,0x8e));var _0x0034=function(_0x3c9471,_0x1ad7cf){_0x3c9471=_0x3c9471-0x0;var _0x1c3c48=_0x0340[_0x3c9471];return _0x1c3c48;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0034('0x0')]={'phone':{'type':Sequelize[_0x0034('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0034('0x2')],'defaultValue':moment()[_0x0034('0x3')](_0x0034('0x4'))},'countbusyretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0034('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0034('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0034('0x2')]},'priority':{'type':Sequelize[_0x0034('0x5')](0x2)[_0x0034('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0034('0x5')],'unique':_0x0034('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x0034('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0034('0x8')},'CampaignId':{'type':Sequelize[_0x0034('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0034('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5cc=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x38e6b7,_0x5b3c41){var _0x369ee0=function(_0x186a87){while(--_0x186a87){_0x38e6b7['push'](_0x38e6b7['shift']());}};_0x369ee0(++_0x5b3c41);}(_0xe5cc,0x174));var _0xce5c=function(_0x57d98e,_0x2cdedb){_0x57d98e=_0x57d98e-0x0;var _0x5e3656=_0xe5cc[_0x57d98e];return _0x5e3656;};'use strict';var moment=require('moment');var Sequelize=require(_0xce5c('0x0'));module[_0xce5c('0x1')]={'phone':{'type':Sequelize[_0xce5c('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xce5c('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xce5c('0x4')](_0xce5c('0x5'))},'countbusyretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xce5c('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce5c('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xce5c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xce5c('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xce5c('0x6')],'unique':_0xce5c('0x9')},'UserId':{'type':Sequelize[_0xce5c('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xce5c('0x9')},'CampaignId':{'type':Sequelize[_0xce5c('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f2f3ff0..48d3704 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 _0x569a=['preview','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','isEmpty','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','Company','CmList','List','dialActive','getOpenContacts','isNumber','CmHopper,\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','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$notILike','$contains','$any','attributes','fields','length','order','sort','where','pick','filter','merge','map','options','CmHopper','includeAll','include','findAll','catch','show','params','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound'];(function(_0x3d1742,_0x22b62c){var _0x24b61f=function(_0x15ea9c){while(--_0x15ea9c){_0x3d1742['push'](_0x3d1742['shift']());}};_0x24b61f(++_0x22b62c);}(_0x569a,0xa9));var _0xa569=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x569a[_0xa3463d];return _0x50fd67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa569('0x0'));var zipdir=require(_0xa569('0x1'));var jsonpatch=require(_0xa569('0x2'));var rp=require(_0xa569('0x3'));var moment=require('moment');var BPromise=require(_0xa569('0x4'));var Mustache=require(_0xa569('0x5'));var util=require(_0xa569('0x6'));var path=require(_0xa569('0x7'));var sox=require(_0xa569('0x8'));var csv=require(_0xa569('0x9'));var ejs=require(_0xa569('0xa'));var fs=require('fs');var fs_extra=require(_0xa569('0xb'));var _=require(_0xa569('0xc'));var squel=require(_0xa569('0xd'));var crypto=require(_0xa569('0xe'));var jsforce=require(_0xa569('0xf'));var deskjs=require(_0xa569('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa569('0x11'));var Papa=require(_0xa569('0x12'));var Redis=require(_0xa569('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa569('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa569('0x15'));var logger=require(_0xa569('0x16'))(_0xa569('0x17'));var utils=require('../../config/utils');var config=require(_0xa569('0x18'));var licenseUtil=require(_0xa569('0x19'));var db=require(_0xa569('0x1a'))['db'];function respondWithStatusCode(_0x138a60,_0x478a91){_0x478a91=_0x478a91||0xcc;return function(_0x3f42f8){if(_0x3f42f8){return _0x138a60[_0xa569('0x1b')](_0x478a91);}return _0x138a60[_0xa569('0x1c')](_0x478a91)[_0xa569('0x1d')]();};}function respondWithResult(_0xf17b7b,_0x4ff67b){_0x4ff67b=_0x4ff67b||0xc8;return function(_0xb09f37){if(_0xb09f37){return _0xf17b7b[_0xa569('0x1c')](_0x4ff67b)[_0xa569('0x1e')](_0xb09f37);}};}function respondWithFilteredResult(_0x2bb227,_0x42fbb3){return function(_0x2e784c){if(_0x2e784c){var _0x48f604=typeof _0x42fbb3[_0xa569('0x1f')]===_0xa569('0x20')&&typeof _0x42fbb3[_0xa569('0x21')]==='undefined';var _0x48a9ac=_0x2e784c[_0xa569('0x22')];var _0x555089=_0x48f604?0x0:_0x42fbb3[_0xa569('0x1f')];var _0x33eb2a=_0x48f604?_0x2e784c['count']:_0x42fbb3['offset']+_0x42fbb3[_0xa569('0x21')];var _0x4fab5d;if(_0x33eb2a>=_0x48a9ac){_0x33eb2a=_0x48a9ac;_0x4fab5d=0xc8;}else{_0x4fab5d=0xce;}_0x2bb227[_0xa569('0x1c')](_0x4fab5d);return _0x2bb227[_0xa569('0x23')](_0xa569('0x24'),_0x555089+'-'+_0x33eb2a+'/'+_0x48a9ac)[_0xa569('0x1e')](_0x2e784c);}return null;};}function patchUpdates(_0x4635af){return function(_0x5eee9f){try{jsonpatch[_0xa569('0x25')](_0x5eee9f,_0x4635af,!![]);}catch(_0x56cdfc){return BPromise['reject'](_0x56cdfc);}return _0x5eee9f['save']();};}function saveUpdates(_0x5427db,_0x7348e6){return function(_0x5c2261){if(_0x5c2261){return _0x5c2261[_0xa569('0x26')](_0x5427db)[_0xa569('0x27')](function(_0x53e14e){return _0x53e14e;});}return null;};}function removeEntity(_0x450ff4,_0x2c42e0){return function(_0x527c83){if(_0x527c83){return _0x527c83[_0xa569('0x28')]()[_0xa569('0x27')](function(){_0x450ff4['status'](0xcc)[_0xa569('0x1d')]();});}};}function handleEntityNotFound(_0x3c5e6e,_0x280dc9){return function(_0x195cd5){if(!_0x195cd5){_0x3c5e6e[_0xa569('0x1b')](0x194);}return _0x195cd5;};}function handleError(_0x4a24cd,_0x1db582){_0x1db582=_0x1db582||0x1f4;return function(_0x2aaad0){logger['error'](_0x2aaad0['stack']);if(_0x2aaad0[_0xa569('0x29')]){delete _0x2aaad0[_0xa569('0x29')];}_0x4a24cd[_0xa569('0x1c')](_0x1db582)[_0xa569('0x2a')](_0x2aaad0);};}exports[_0xa569('0x2b')]=function(_0x158f31,_0x1459d6){var _0x3b5a37={},_0x4615c6={},_0x529613={'count':0x0,'rows':[]};var _0x30e3f7=_['map'](db['CmHopper'][_0xa569('0x2c')],function(_0x38df0b){return{'name':_0x38df0b['fieldName'],'type':_0x38df0b[_0xa569('0x2d')]['key']};});_0x4615c6[_0xa569('0x2e')]=_['map'](_0x30e3f7,'name');_0x4615c6[_0xa569('0x2f')]=_[_0xa569('0x30')](_0x158f31[_0xa569('0x2f')]);_0x4615c6[_0xa569('0x31')]=_[_0xa569('0x32')](_0x4615c6[_0xa569('0x2e')],_0x4615c6['query']);_0x4615c6[_0xa569('0x31')]=_['concat'](_0x4615c6['filters'],[_0xa569('0x33'),_0xa569('0x34'),_0xa569('0x35'),_0xa569('0x36'),'$lt',_0xa569('0x37'),_0xa569('0x38'),_0xa569('0x39'),_0xa569('0x3a'),_0xa569('0x3b'),_0xa569('0x3c'),'$in',_0xa569('0x3d'),_0xa569('0x3e'),_0xa569('0x3f'),'$iLike',_0xa569('0x40'),_0xa569('0x3e'),'$overlap',_0xa569('0x41'),'$contained',_0xa569('0x42')]);_0x3b5a37[_0xa569('0x43')]=_[_0xa569('0x32')](_0x4615c6[_0xa569('0x2e')],qs[_0xa569('0x44')](_0x158f31[_0xa569('0x2f')]['fields']));_0x3b5a37[_0xa569('0x43')]=_0x3b5a37[_0xa569('0x43')][_0xa569('0x45')]?_0x3b5a37['attributes']:_0x4615c6['model'];if(!_0x158f31['query']['hasOwnProperty']('nolimit')){_0x3b5a37[_0xa569('0x21')]=qs[_0xa569('0x21')](_0x158f31['query'][_0xa569('0x21')]);_0x3b5a37['offset']=qs[_0xa569('0x1f')](_0x158f31[_0xa569('0x2f')][_0xa569('0x1f')]);}_0x3b5a37[_0xa569('0x46')]=qs['sort'](_0x158f31['query'][_0xa569('0x47')]);_0x3b5a37[_0xa569('0x48')]=qs['filters'](_[_0xa569('0x49')](_0x158f31[_0xa569('0x2f')],_0x4615c6[_0xa569('0x31')]),_0x30e3f7);if(_0x158f31['query'][_0xa569('0x4a')]){_0x3b5a37[_0xa569('0x48')]=_[_0xa569('0x4b')](_0x3b5a37[_0xa569('0x48')],{'$or':_[_0xa569('0x4c')](_0x30e3f7,function(_0x165f1d){if(_0x165f1d[_0xa569('0x2d')]!=='VIRTUAL'){var _0x17c924={};_0x17c924[_0x165f1d[_0xa569('0x29')]]={'$like':'%'+_0x158f31[_0xa569('0x2f')][_0xa569('0x4a')]+'%'};return _0x17c924;}})});}_0x3b5a37=_[_0xa569('0x4b')]({},_0x3b5a37,_0x158f31[_0xa569('0x4d')]);var _0x3f389a={'where':_0x3b5a37[_0xa569('0x48')]};return db[_0xa569('0x4e')][_0xa569('0x22')](_0x3f389a)['then'](function(_0x3a40ac){_0x529613[_0xa569('0x22')]=_0x3a40ac;if(_0x158f31[_0xa569('0x2f')][_0xa569('0x4f')]){_0x3b5a37[_0xa569('0x50')]=[{'all':!![]}];}return db[_0xa569('0x4e')][_0xa569('0x51')](_0x3b5a37);})['then'](function(_0x349036){_0x529613['rows']=_0x349036;return _0x529613;})[_0xa569('0x27')](respondWithFilteredResult(_0x1459d6,_0x3b5a37))[_0xa569('0x52')](handleError(_0x1459d6,null));};exports[_0xa569('0x53')]=function(_0x377581,_0x3c67d1){var _0x37e89e={'raw':!![],'where':{'id':_0x377581[_0xa569('0x54')]['id']}},_0x2cc9cc={};_0x2cc9cc[_0xa569('0x2e')]=_[_0xa569('0x30')](db[_0xa569('0x4e')]['rawAttributes']);_0x2cc9cc[_0xa569('0x2f')]=_[_0xa569('0x30')](_0x377581[_0xa569('0x2f')]);_0x2cc9cc[_0xa569('0x31')]=_[_0xa569('0x32')](_0x2cc9cc['model'],_0x2cc9cc['query']);_0x37e89e['attributes']=_[_0xa569('0x32')](_0x2cc9cc[_0xa569('0x2e')],qs[_0xa569('0x44')](_0x377581[_0xa569('0x2f')][_0xa569('0x44')]));_0x37e89e[_0xa569('0x43')]=_0x37e89e[_0xa569('0x43')][_0xa569('0x45')]?_0x37e89e[_0xa569('0x43')]:_0x2cc9cc['model'];if(_0x377581[_0xa569('0x2f')]['includeAll']){_0x37e89e[_0xa569('0x50')]=[{'all':!![]}];}_0x37e89e=_[_0xa569('0x4b')]({},_0x37e89e,_0x377581['options']);return db[_0xa569('0x4e')][_0xa569('0x55')](_0x37e89e)[_0xa569('0x27')](handleEntityNotFound(_0x3c67d1,null))['then'](respondWithResult(_0x3c67d1,null))[_0xa569('0x52')](handleError(_0x3c67d1,null));};exports[_0xa569('0x56')]=function(_0x173f47,_0x2c97d8){return db[_0xa569('0x4e')][_0xa569('0x56')](_0x173f47['body'],{})[_0xa569('0x27')](respondWithResult(_0x2c97d8,0xc9))[_0xa569('0x52')](handleError(_0x2c97d8,null));};exports['update']=function(_0x2a2513,_0x374cb1){if(_0x2a2513[_0xa569('0x57')]['id']){delete _0x2a2513[_0xa569('0x57')]['id'];}return db[_0xa569('0x4e')]['find']({'where':{'id':_0x2a2513[_0xa569('0x54')]['id']}})[_0xa569('0x27')](handleEntityNotFound(_0x374cb1,null))['then'](saveUpdates(_0x2a2513[_0xa569('0x57')],null))[_0xa569('0x27')](respondWithResult(_0x374cb1,null))[_0xa569('0x52')](handleError(_0x374cb1,null));};exports['describe']=function(_0x49d42a,_0x45da5f){return db[_0xa569('0x4e')][_0xa569('0x58')]()['then'](respondWithResult(_0x45da5f,null))[_0xa569('0x52')](handleError(_0x45da5f,null));};exports['destroy']=function(_0x559522,_0x22669a){var _0x1ed157;return db[_0xa569('0x4e')][_0xa569('0x55')]({'where':{'id':_0x559522[_0xa569('0x54')]['id']}})[_0xa569('0x27')](handleEntityNotFound(_0x22669a,null))['then'](function(_0x54c07e){if(_0x54c07e){return _0x54c07e[_0xa569('0x28')]()[_0xa569('0x27')](function(_0x4955a3){return _0x4955a3;});}})[_0xa569('0x27')](function(_0x5e73aa){_0x1ed157=_0x5e73aa;if(_0x5e73aa){if(_0x5e73aa[_0xa569('0x59')]||_0x5e73aa['CampaignId']){return db[_0x5e73aa['VoiceQueueId']?_0xa569('0x5a'):_0xa569('0x5b')][_0xa569('0x55')]({'where':{'id':_0x5e73aa['VoiceQueueId']?_0x5e73aa[_0xa569('0x59')]:_0x5e73aa[_0xa569('0x5c')]},'attributes':['id',_0xa569('0x29')],'raw':!![]});}}})[_0xa569('0x27')](function(_0x5da818){var _0x4c59a5={};if(_0x5da818){_[_0xa569('0x4b')](_0x4c59a5,_[_0xa569('0x5d')](_0x1ed157[_0xa569('0x5e')],[_0xa569('0x5f'),_0xa569('0x60'),'id']));_0x4c59a5['state']=0x15;_0x4c59a5['statedesc']=_0xa569('0x61');_0x4c59a5[_0xa569('0x62')]=_0x5da818[_0xa569('0x29')];_0x4c59a5[_0xa569('0x63')]=_0x559522[_0xa569('0x64')][_0xa569('0x29')];_0x4c59a5[_0xa569('0x65')]=_0x559522[_0xa569('0x64')]['id'];_0x4c59a5[_0xa569('0x61')]=!![];_0x4c59a5[_0xa569('0x66')]=moment()[_0xa569('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c59a5[_0xa569('0x68')]=_0x1ed157[_0xa569('0x69')];_0x4c59a5[_0xa569('0x6a')]=_0x1ed157[_0xa569('0x59')]?'queue':_0xa569('0x6b');return db['CmContact'][_0xa569('0x55')]({'where':{'id':_0x4c59a5[_0xa569('0x6c')]},'attributes':[_0xa569('0x6d'),_0xa569('0x6e')]})[_0xa569('0x27')](function(_0x22e490){if(!_[_0xa569('0x6f')](_0x22669a)&&!_[_0xa569('0x6f')](_0x22e490['firstName'])){_0x4c59a5[_0xa569('0x70')]=_0x22e490[_0xa569('0x6d')];if(!_[_0xa569('0x6f')](_0x22e490[_0xa569('0x6e')])){_0x4c59a5[_0xa569('0x70')]+='\x20'+_0x22e490[_0xa569('0x6e')];}}})['finally'](function(){return db[_0xa569('0x71')]['create'](_0x4c59a5);});}})['then'](function(){return _0x22669a[_0xa569('0x1c')](0xcc)[_0xa569('0x1d')]();})['catch'](handleError(_0x22669a,null));};exports[_0xa569('0x72')]=function(_0x15f17d,_0x26f7fa,_0x3a5e7c){var _0x219489=[];return db['CmContact'][_0xa569('0x58')]()[_0xa569('0x27')](function(_0x289bbc){_0x219489=_['keys'](_0x289bbc);return _0x15f17d['user'][_0xa569('0x73')]({'where':{'type':_0xa569('0x74'),'dialActive':!![],'dialMethod':_0xa569('0x75')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xa569('0x27')](function(_0x1ec7dc){if(_0x1ec7dc&&_0x1ec7dc[_0xa569('0x45')]){return db[_0xa569('0x76')][_0xa569('0x77')](function(_0x2f8d94){var _0x412c03={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa569('0x67')](_0xa569('0x78'))},'VoiceQueueId':{'$in':_['map'](_0x1ec7dc,'id')},'$or':[{'UserId':null},{'UserId':_0x15f17d['user']['id']}]};var _0x349748=[];if(_0x15f17d[_0xa569('0x57')][_0xa569('0x79')]&&_0x15f17d[_0xa569('0x57')][_0xa569('0x79')]===_0xa569('0x7a')){if(!_['isEmpty'](_0x15f17d[_0xa569('0x57')][_0xa569('0x7b')])){_0x412c03['id']={'$in':_0x15f17d[_0xa569('0x57')][_0xa569('0x7b')]};}_0x349748=[[_0xa569('0x7c'),_0xa569('0x7d')],[_0xa569('0x7e'),_0x1ec7dc[0x0]['dialOrderByScheduledAt']===_0xa569('0x7d')?_0xa569('0x7f'):_0xa569('0x7d')],db[_0xa569('0x76')][_0xa569('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa569('0x7f')]];}else{if(!_[_0xa569('0x81')](_0x15f17d[_0xa569('0x57')][_0xa569('0x7b')])){_0x412c03['id']={'$notIn':_0x15f17d[_0xa569('0x57')][_0xa569('0x7b')]};}_0x349748=[['priority','DESC'],['scheduledAt',_0x1ec7dc[0x0][_0xa569('0x82')]],db['sequelize'][_0xa569('0x80')](_0xa569('0x83')),['id',_0xa569('0x7d')]];}return db[_0xa569('0x4e')][_0xa569('0x84')]({'attributes':['id',_0xa569('0x85')],'where':_0x412c03,'order':_0x349748,'transaction':_0x2f8d94,'lock':_0x2f8d94[_0xa569('0x86')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xa569('0x87'),'attributes':_0x219489,'include':[{'model':db['CmCompany'],'as':_0xa569('0x88'),'attributes':['id',_0xa569('0x29')]}]},{'model':db[_0xa569('0x89')],'as':_0xa569('0x8a'),'attributes':['id',_0xa569('0x29')]},{'model':db[_0xa569('0x5a')],'as':'Queue','attributes':['id','name',_0xa569('0x8b')]}]})[_0xa569('0x27')](function(_0x51dbd8){if(_0x51dbd8){return _0x51dbd8[_0xa569('0x26')]({'UserId':_0x15f17d[_0xa569('0x64')]['id']},{'transaction':_0x2f8d94});}});});}})[_0xa569('0x27')](handleEntityNotFound(_0x26f7fa,null))[_0xa569('0x27')](respondWithResult(_0x26f7fa,null))['catch'](handleError(_0x26f7fa,null));};exports[_0xa569('0x8c')]=function(_0x517804,_0x18b2c4,_0x278d93){return _0x517804['user'][_0xa569('0x73')]({'where':{'type':_0xa569('0x74'),'dialActive':!![],'dialMethod':_0xa569('0x75')},'attributes':['id'],'raw':!![]})[_0xa569('0x27')](function(_0x3a347c){if(_0x3a347c&&_0x3a347c[_0xa569('0x45')]){return db[_0xa569('0x4e')][_0xa569('0x22')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa569('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3a347c,'id')},'$or':[{'UserId':null},{'UserId':_0x517804[_0xa569('0x64')]['id']}]}});}return 0x0;})[_0xa569('0x27')](function(_0x4a8c4c){if(!_[_0xa569('0x6f')](_0x4a8c4c)&&_[_0xa569('0x8d')](_0x4a8c4c)){return _0x18b2c4['status'](0xc8)[_0xa569('0x1e')]({'contacts':_0x4a8c4c});}else{logger['error'](_0xa569('0x8e'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x18b2c4[_0xa569('0x1b')](0x194);}})[_0xa569('0x52')](handleError(_0x18b2c4,null));}; \ No newline at end of file +var _0x9de2=['$eq','$between','$in','$notIn','$like','$iLike','$overlap','$contains','$any','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','fields','find','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','calleridname','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getOpenContacts','getVoiceQueues','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','$and','$or','$gt','$gte','$lte'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0x9de2,0x18b));var _0x29de=function(_0x55573e,_0x700c78){_0x55573e=_0x55573e-0x0;var _0x41259b=_0x9de2[_0x55573e];return _0x41259b;};'use strict';var emlformat=require(_0x29de('0x0'));var rimraf=require(_0x29de('0x1'));var zipdir=require(_0x29de('0x2'));var jsonpatch=require(_0x29de('0x3'));var rp=require(_0x29de('0x4'));var moment=require(_0x29de('0x5'));var BPromise=require(_0x29de('0x6'));var Mustache=require(_0x29de('0x7'));var util=require(_0x29de('0x8'));var path=require(_0x29de('0x9'));var sox=require(_0x29de('0xa'));var csv=require(_0x29de('0xb'));var ejs=require(_0x29de('0xc'));var fs=require('fs');var fs_extra=require(_0x29de('0xd'));var _=require(_0x29de('0xe'));var squel=require('squel');var crypto=require(_0x29de('0xf'));var jsforce=require(_0x29de('0x10'));var deskjs=require(_0x29de('0x11'));var toCsv=require('to-csv');var querystring=require(_0x29de('0x12'));var Papa=require(_0x29de('0x13'));var Redis=require(_0x29de('0x14'));var authService=require(_0x29de('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29de('0x16'))(_0x29de('0x17'));var utils=require(_0x29de('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x29de('0x19'));var db=require(_0x29de('0x1a'))['db'];function respondWithStatusCode(_0x4ea5c3,_0x493f78){_0x493f78=_0x493f78||0xcc;return function(_0x3426b7){if(_0x3426b7){return _0x4ea5c3[_0x29de('0x1b')](_0x493f78);}return _0x4ea5c3[_0x29de('0x1c')](_0x493f78)[_0x29de('0x1d')]();};}function respondWithResult(_0x16f4b6,_0x611b8){_0x611b8=_0x611b8||0xc8;return function(_0x127e14){if(_0x127e14){return _0x16f4b6[_0x29de('0x1c')](_0x611b8)[_0x29de('0x1e')](_0x127e14);}};}function respondWithFilteredResult(_0x5e397d,_0x4fd9cb){return function(_0xfee42d){if(_0xfee42d){var _0x10f4d3=typeof _0x4fd9cb[_0x29de('0x1f')]===_0x29de('0x20')&&typeof _0x4fd9cb[_0x29de('0x21')]===_0x29de('0x20');var _0x8333cb=_0xfee42d[_0x29de('0x22')];var _0x351ce1=_0x10f4d3?0x0:_0x4fd9cb[_0x29de('0x1f')];var _0xae4f9=_0x10f4d3?_0xfee42d[_0x29de('0x22')]:_0x4fd9cb[_0x29de('0x1f')]+_0x4fd9cb[_0x29de('0x21')];var _0x5b3156;if(_0xae4f9>=_0x8333cb){_0xae4f9=_0x8333cb;_0x5b3156=0xc8;}else{_0x5b3156=0xce;}_0x5e397d['status'](_0x5b3156);return _0x5e397d[_0x29de('0x23')](_0x29de('0x24'),_0x351ce1+'-'+_0xae4f9+'/'+_0x8333cb)[_0x29de('0x1e')](_0xfee42d);}return null;};}function patchUpdates(_0x4c8c11){return function(_0x3d58c9){try{jsonpatch[_0x29de('0x25')](_0x3d58c9,_0x4c8c11,!![]);}catch(_0x2c08b3){return BPromise['reject'](_0x2c08b3);}return _0x3d58c9[_0x29de('0x26')]();};}function saveUpdates(_0x3caa06,_0x1e1330){return function(_0x53edaa){if(_0x53edaa){return _0x53edaa[_0x29de('0x27')](_0x3caa06)['then'](function(_0x232095){return _0x232095;});}return null;};}function removeEntity(_0x4e8081,_0x1fcf8c){return function(_0x530052){if(_0x530052){return _0x530052['destroy']()[_0x29de('0x28')](function(){_0x4e8081[_0x29de('0x1c')](0xcc)[_0x29de('0x1d')]();});}};}function handleEntityNotFound(_0x25ec12,_0x2c00d5){return function(_0x292d05){if(!_0x292d05){_0x25ec12[_0x29de('0x1b')](0x194);}return _0x292d05;};}function handleError(_0x7813c,_0x160187){_0x160187=_0x160187||0x1f4;return function(_0x345368){logger['error'](_0x345368['stack']);if(_0x345368[_0x29de('0x29')]){delete _0x345368[_0x29de('0x29')];}_0x7813c[_0x29de('0x1c')](_0x160187)[_0x29de('0x2a')](_0x345368);};}exports[_0x29de('0x2b')]=function(_0x5a53ab,_0x3d5a13){var _0x45add4={},_0x1a5325={},_0x45606f={'count':0x0,'rows':[]};var _0x359f3d=_[_0x29de('0x2c')](db[_0x29de('0x2d')][_0x29de('0x2e')],function(_0x5a4263){return{'name':_0x5a4263[_0x29de('0x2f')],'type':_0x5a4263['type'][_0x29de('0x30')]};});_0x1a5325[_0x29de('0x31')]=_[_0x29de('0x2c')](_0x359f3d,'name');_0x1a5325[_0x29de('0x32')]=_[_0x29de('0x33')](_0x5a53ab[_0x29de('0x32')]);_0x1a5325[_0x29de('0x34')]=_['intersection'](_0x1a5325[_0x29de('0x31')],_0x1a5325[_0x29de('0x32')]);_0x1a5325[_0x29de('0x34')]=_['concat'](_0x1a5325['filters'],[_0x29de('0x35'),_0x29de('0x36'),_0x29de('0x37'),_0x29de('0x38'),'$lt',_0x29de('0x39'),'$ne',_0x29de('0x3a'),'$not',_0x29de('0x3b'),'$notBetween',_0x29de('0x3c'),_0x29de('0x3d'),_0x29de('0x3e'),'$notLike',_0x29de('0x3f'),'$notILike','$like',_0x29de('0x40'),_0x29de('0x41'),'$contained',_0x29de('0x42')]);_0x45add4[_0x29de('0x43')]=_[_0x29de('0x44')](_0x1a5325[_0x29de('0x31')],qs['fields'](_0x5a53ab['query']['fields']));_0x45add4[_0x29de('0x43')]=_0x45add4[_0x29de('0x43')][_0x29de('0x45')]?_0x45add4[_0x29de('0x43')]:_0x1a5325[_0x29de('0x31')];if(!_0x5a53ab['query'][_0x29de('0x46')](_0x29de('0x47'))){_0x45add4[_0x29de('0x21')]=qs[_0x29de('0x21')](_0x5a53ab[_0x29de('0x32')][_0x29de('0x21')]);_0x45add4[_0x29de('0x1f')]=qs[_0x29de('0x1f')](_0x5a53ab['query']['offset']);}_0x45add4[_0x29de('0x48')]=qs[_0x29de('0x49')](_0x5a53ab[_0x29de('0x32')][_0x29de('0x49')]);_0x45add4[_0x29de('0x4a')]=qs[_0x29de('0x34')](_[_0x29de('0x4b')](_0x5a53ab[_0x29de('0x32')],_0x1a5325[_0x29de('0x34')]),_0x359f3d);if(_0x5a53ab[_0x29de('0x32')][_0x29de('0x4c')]){_0x45add4[_0x29de('0x4a')]=_[_0x29de('0x4d')](_0x45add4[_0x29de('0x4a')],{'$or':_['map'](_0x359f3d,function(_0x393062){if(_0x393062[_0x29de('0x4e')]!==_0x29de('0x4f')){var _0x7ff1fd={};_0x7ff1fd[_0x393062['name']]={'$like':'%'+_0x5a53ab[_0x29de('0x32')]['filter']+'%'};return _0x7ff1fd;}})});}_0x45add4=_[_0x29de('0x4d')]({},_0x45add4,_0x5a53ab[_0x29de('0x50')]);var _0x3150bb={'where':_0x45add4[_0x29de('0x4a')]};return db[_0x29de('0x2d')][_0x29de('0x22')](_0x3150bb)['then'](function(_0x1023e6){_0x45606f[_0x29de('0x22')]=_0x1023e6;if(_0x5a53ab[_0x29de('0x32')][_0x29de('0x51')]){_0x45add4[_0x29de('0x52')]=[{'all':!![]}];}return db[_0x29de('0x2d')]['findAll'](_0x45add4);})[_0x29de('0x28')](function(_0x572982){_0x45606f[_0x29de('0x53')]=_0x572982;return _0x45606f;})[_0x29de('0x28')](respondWithFilteredResult(_0x3d5a13,_0x45add4))[_0x29de('0x54')](handleError(_0x3d5a13,null));};exports['show']=function(_0x58e188,_0x4c13a1){var _0x5826e1={'raw':!![],'where':{'id':_0x58e188['params']['id']}},_0x7ff0ba={};_0x7ff0ba[_0x29de('0x31')]=_[_0x29de('0x33')](db['CmHopper']['rawAttributes']);_0x7ff0ba[_0x29de('0x32')]=_[_0x29de('0x33')](_0x58e188['query']);_0x7ff0ba[_0x29de('0x34')]=_[_0x29de('0x44')](_0x7ff0ba[_0x29de('0x31')],_0x7ff0ba[_0x29de('0x32')]);_0x5826e1[_0x29de('0x43')]=_[_0x29de('0x44')](_0x7ff0ba['model'],qs[_0x29de('0x55')](_0x58e188[_0x29de('0x32')][_0x29de('0x55')]));_0x5826e1['attributes']=_0x5826e1[_0x29de('0x43')]['length']?_0x5826e1['attributes']:_0x7ff0ba[_0x29de('0x31')];if(_0x58e188[_0x29de('0x32')][_0x29de('0x51')]){_0x5826e1[_0x29de('0x52')]=[{'all':!![]}];}_0x5826e1=_['merge']({},_0x5826e1,_0x58e188[_0x29de('0x50')]);return db['CmHopper'][_0x29de('0x56')](_0x5826e1)[_0x29de('0x28')](handleEntityNotFound(_0x4c13a1,null))[_0x29de('0x28')](respondWithResult(_0x4c13a1,null))[_0x29de('0x54')](handleError(_0x4c13a1,null));};exports[_0x29de('0x57')]=function(_0x12e6e2,_0x3e1775){return db['CmHopper'][_0x29de('0x57')](_0x12e6e2[_0x29de('0x58')],{})[_0x29de('0x28')](respondWithResult(_0x3e1775,0xc9))['catch'](handleError(_0x3e1775,null));};exports['update']=function(_0x53c25c,_0x47c13f){if(_0x53c25c[_0x29de('0x58')]['id']){delete _0x53c25c[_0x29de('0x58')]['id'];}return db[_0x29de('0x2d')][_0x29de('0x56')]({'where':{'id':_0x53c25c[_0x29de('0x59')]['id']}})[_0x29de('0x28')](handleEntityNotFound(_0x47c13f,null))['then'](saveUpdates(_0x53c25c[_0x29de('0x58')],null))[_0x29de('0x28')](respondWithResult(_0x47c13f,null))[_0x29de('0x54')](handleError(_0x47c13f,null));};exports[_0x29de('0x5a')]=function(_0x1b9fe5,_0x226a03){return db[_0x29de('0x2d')][_0x29de('0x5a')]()[_0x29de('0x28')](respondWithResult(_0x226a03,null))[_0x29de('0x54')](handleError(_0x226a03,null));};exports[_0x29de('0x5b')]=function(_0x409605,_0x1b476c){var _0x3f5982;return db[_0x29de('0x2d')]['find']({'where':{'id':_0x409605[_0x29de('0x59')]['id']}})[_0x29de('0x28')](handleEntityNotFound(_0x1b476c,null))[_0x29de('0x28')](function(_0x2895d8){if(_0x2895d8){return _0x2895d8[_0x29de('0x5b')]()[_0x29de('0x28')](function(_0x35b3b3){return _0x35b3b3;});}})['then'](function(_0x19b1ec){_0x3f5982=_0x19b1ec;if(_0x19b1ec){if(_0x19b1ec['VoiceQueueId']||_0x19b1ec[_0x29de('0x5c')]){return db[_0x19b1ec[_0x29de('0x5d')]?_0x29de('0x5e'):_0x29de('0x5f')]['find']({'where':{'id':_0x19b1ec[_0x29de('0x5d')]?_0x19b1ec['VoiceQueueId']:_0x19b1ec['CampaignId']},'attributes':['id',_0x29de('0x29')],'raw':!![]});}}})[_0x29de('0x28')](function(_0x4c513a){var _0x4638fe={};if(_0x4c513a){_[_0x29de('0x4d')](_0x4638fe,_['omit'](_0x3f5982[_0x29de('0x60')],[_0x29de('0x61'),_0x29de('0x62'),'id']));_0x4638fe[_0x29de('0x63')]=0x15;_0x4638fe[_0x29de('0x64')]=_0x29de('0x65');_0x4638fe[_0x29de('0x66')]=_0x4c513a['name'];_0x4638fe[_0x29de('0x67')]=_0x409605[_0x29de('0x68')][_0x29de('0x29')];_0x4638fe[_0x29de('0x69')]=_0x409605[_0x29de('0x68')]['id'];_0x4638fe[_0x29de('0x65')]=!![];_0x4638fe[_0x29de('0x6a')]=moment()[_0x29de('0x6b')](_0x29de('0x6c'));_0x4638fe[_0x29de('0x6d')]=_0x3f5982[_0x29de('0x6e')];_0x4638fe[_0x29de('0x6f')]=_0x3f5982[_0x29de('0x5d')]?_0x29de('0x70'):_0x29de('0x71');return db[_0x29de('0x72')][_0x29de('0x56')]({'where':{'id':_0x4638fe['ContactId']},'attributes':['firstName',_0x29de('0x73')]})[_0x29de('0x28')](function(_0x21e2e8){if(!_[_0x29de('0x74')](_0x1b476c)&&!_[_0x29de('0x74')](_0x21e2e8[_0x29de('0x75')])){_0x4638fe[_0x29de('0x76')]=_0x21e2e8[_0x29de('0x75')];if(!_['isNil'](_0x21e2e8[_0x29de('0x73')])){_0x4638fe['calleridname']+='\x20'+_0x21e2e8['lastName'];}}})['finally'](function(){return db[_0x29de('0x77')]['create'](_0x4638fe);});}})[_0x29de('0x28')](function(){return _0x1b476c[_0x29de('0x1c')](0xcc)['end']();})[_0x29de('0x54')](handleError(_0x1b476c,null));};exports[_0x29de('0x78')]=function(_0x59e8b3,_0x383732,_0x9bb5df){var _0x5c7075=[];return db[_0x29de('0x72')]['describe']()['then'](function(_0x76d0f1){_0x5c7075=_[_0x29de('0x33')](_0x76d0f1);return _0x59e8b3['user']['getVoiceQueues']({'where':{'type':_0x29de('0x79'),'dialActive':!![],'dialMethod':_0x29de('0x7a')},'attributes':['id',_0x29de('0x7b')],'raw':!![]});})[_0x29de('0x28')](function(_0x4314ec){if(_0x4314ec&&_0x4314ec[_0x29de('0x45')]){return db['sequelize'][_0x29de('0x7c')](function(_0x26a649){var _0x525ebd={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x29de('0x6b')](_0x29de('0x6c'))},'VoiceQueueId':{'$in':_[_0x29de('0x2c')](_0x4314ec,'id')},'$or':[{'UserId':null},{'UserId':_0x59e8b3[_0x29de('0x68')]['id']}]};var _0x138377=[];if(_0x59e8b3[_0x29de('0x58')][_0x29de('0x7d')]&&_0x59e8b3[_0x29de('0x58')][_0x29de('0x7d')]===_0x29de('0x7e')){if(!_[_0x29de('0x7f')](_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')])){_0x525ebd['id']={'$in':_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')]};}_0x138377=[['priority',_0x29de('0x81')],[_0x29de('0x82'),_0x4314ec[0x0][_0x29de('0x7b')]==='ASC'?_0x29de('0x83'):_0x29de('0x81')],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x29de('0x83')]];}else{if(!_['isEmpty'](_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')])){_0x525ebd['id']={'$notIn':_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')]};}_0x138377=[[_0x29de('0x84'),_0x29de('0x83')],[_0x29de('0x82'),_0x4314ec[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x29de('0x85')](_0x29de('0x86')),['id',_0x29de('0x81')]];}return db[_0x29de('0x2d')][_0x29de('0x87')]({'attributes':['id',_0x29de('0x88')],'where':_0x525ebd,'order':_0x138377,'transaction':_0x26a649,'lock':_0x26a649[_0x29de('0x89')][_0x29de('0x8a')],'include':[{'model':db[_0x29de('0x72')],'as':_0x29de('0x8b'),'attributes':_0x5c7075,'include':[{'model':db[_0x29de('0x8c')],'as':_0x29de('0x8d'),'attributes':['id',_0x29de('0x29')]}]},{'model':db[_0x29de('0x8e')],'as':_0x29de('0x8f'),'attributes':['id',_0x29de('0x29')]},{'model':db[_0x29de('0x5e')],'as':'Queue','attributes':['id',_0x29de('0x29'),_0x29de('0x90')]}]})[_0x29de('0x28')](function(_0x4fc473){if(_0x4fc473){return _0x4fc473[_0x29de('0x27')]({'UserId':_0x59e8b3[_0x29de('0x68')]['id']},{'transaction':_0x26a649});}});});}})[_0x29de('0x28')](handleEntityNotFound(_0x383732,null))['then'](respondWithResult(_0x383732,null))[_0x29de('0x54')](handleError(_0x383732,null));};exports[_0x29de('0x91')]=function(_0x198a2d,_0x4e7f9f,_0x56b030){return _0x198a2d[_0x29de('0x68')][_0x29de('0x92')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x29de('0x7a')},'attributes':['id'],'raw':!![]})[_0x29de('0x28')](function(_0x42bda5){if(_0x42bda5&&_0x42bda5[_0x29de('0x45')]){return db[_0x29de('0x2d')][_0x29de('0x22')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x29de('0x6b')](_0x29de('0x6c'))},'VoiceQueueId':{'$in':_[_0x29de('0x2c')](_0x42bda5,'id')},'$or':[{'UserId':null},{'UserId':_0x198a2d[_0x29de('0x68')]['id']}]}});}return 0x0;})[_0x29de('0x28')](function(_0x129c34){if(!_['isNil'](_0x129c34)&&_[_0x29de('0x93')](_0x129c34)){return _0x4e7f9f[_0x29de('0x1c')](0xc8)[_0x29de('0x1e')]({'contacts':_0x129c34});}else{logger[_0x29de('0x94')](_0x29de('0x95'),_0x29de('0x91'),0x194,_0x29de('0x96'));_0x4e7f9f[_0x29de('0x1b')](0x194);}})['catch'](handleError(_0x4e7f9f,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3f8dd9f..7061fe1 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 _0x9536=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9536,0x179));var _0x6953=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x9536[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['scheduledat']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x21120c,_0x352f55){var _0x2cd561=function(_0xe5f298){while(--_0xe5f298){_0x21120c['push'](_0x21120c['shift']());}};_0x2cd561(++_0x352f55);}(_0xeda8,0x104));var _0x8eda=function(_0xac95e2,_0x2bfc1a){_0xac95e2=_0xac95e2-0x0;var _0x2ddb52=_0xeda8[_0xac95e2];return _0x2ddb52;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 8cfa7dd..8812ffc 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 _0x39bf=['CmHopper','findAll','options','where','limit','map','include','model','attributes','ShowCmHopper','find','body','raw','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','order','Contact','keys','User','Agent','name','includes','push','MoveContactManagedDialer','transaction','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','describe','UserId','LOCK','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetCmHopper'];(function(_0x53c4d4,_0x13b531){var _0x82443=function(_0x64b8af){while(--_0x64b8af){_0x53c4d4['push'](_0x53c4d4['shift']());}};_0x82443(++_0x13b531);}(_0x39bf,0x13f));var _0xf39b=function(_0x2a7497,_0x425bcb){_0x2a7497=_0x2a7497-0x0;var _0x46cf6d=_0x39bf[_0x2a7497];return _0x46cf6d;};'use strict';var _=require(_0xf39b('0x0'));var util=require(_0xf39b('0x1'));var moment=require(_0xf39b('0x2'));var BPromise=require(_0xf39b('0x3'));var rs=require(_0xf39b('0x4'));var fs=require('fs');var Redis=require(_0xf39b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf39b('0x6'));var logger=require(_0xf39b('0x7'))(_0xf39b('0x8'));var config=require(_0xf39b('0x9'));var jayson=require(_0xf39b('0xa'));var client=jayson[_0xf39b('0xb')][_0xf39b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41431f,_0x9e33d5,_0x201ad2){return new BPromise(function(_0x3109ec,_0x33136b){return client[_0xf39b('0xd')](_0x41431f,_0x201ad2)[_0xf39b('0xe')](function(_0x4cbcd0){logger['info'](_0xf39b('0xf'),_0x9e33d5,_0xf39b('0x10'));logger[_0xf39b('0x11')](_0xf39b('0x12'),_0x9e33d5,'request\x20sent',JSON[_0xf39b('0x13')](_0x4cbcd0));if(_0x4cbcd0[_0xf39b('0x14')]){if(_0x4cbcd0[_0xf39b('0x14')][_0xf39b('0x15')]===0x1f4){logger[_0xf39b('0x14')]('CmHopper,\x20%s,\x20%s',_0x9e33d5,_0x4cbcd0['error'][_0xf39b('0x16')]);return _0x33136b(_0x4cbcd0[_0xf39b('0x14')]['message']);}logger[_0xf39b('0x14')](_0xf39b('0xf'),_0x9e33d5,_0x4cbcd0['error'][_0xf39b('0x16')]);return _0x3109ec(_0x4cbcd0['error']['message']);}else{logger[_0xf39b('0x17')](_0xf39b('0xf'),_0x9e33d5,_0xf39b('0x10'));_0x3109ec(_0x4cbcd0['result']['message']);}})[_0xf39b('0x18')](function(_0x82f554){logger[_0xf39b('0x14')](_0xf39b('0xf'),_0x9e33d5,_0x82f554);_0x33136b(_0x82f554);});});}exports[_0xf39b('0x19')]=function(_0xe46f78){var _0x5cb0c8=this;return new Promise(function(_0x47a1ea,_0x53fa03){return db[_0xf39b('0x1a')][_0xf39b('0x1b')]({'raw':_0xe46f78[_0xf39b('0x1c')]?_0xe46f78['options']['raw']===undefined?!![]:![]:!![],'where':_0xe46f78['options']?_0xe46f78[_0xf39b('0x1c')][_0xf39b('0x1d')]||null:null,'attributes':_0xe46f78['options']?_0xe46f78[_0xf39b('0x1c')]['attributes']||null:null,'limit':_0xe46f78['options']?_0xe46f78[_0xf39b('0x1c')][_0xf39b('0x1e')]||null:null,'include':_0xe46f78['options']?_0xe46f78[_0xf39b('0x1c')]['include']?_[_0xf39b('0x1f')](_0xe46f78[_0xf39b('0x1c')][_0xf39b('0x20')],function(_0x7db2ef){return{'model':db[_0x7db2ef[_0xf39b('0x21')]],'as':_0x7db2ef['as'],'attributes':_0x7db2ef[_0xf39b('0x22')],'include':_0x7db2ef['include']?_['map'](_0x7db2ef['include'],function(_0x3faa57){return{'model':db[_0x3faa57[_0xf39b('0x21')]],'as':_0x3faa57['as'],'attributes':_0x3faa57[_0xf39b('0x22')],'include':_0x3faa57[_0xf39b('0x20')]?_[_0xf39b('0x1f')](_0x3faa57[_0xf39b('0x20')],function(_0x40a5d9){return{'model':db[_0x40a5d9[_0xf39b('0x21')]],'as':_0x40a5d9['as'],'attributes':_0x40a5d9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x486184){logger['info'](_0xf39b('0x19'),_0xe46f78);logger['debug'](_0xf39b('0x19'),_0xe46f78,JSON[_0xf39b('0x13')](_0x486184));_0x47a1ea(_0x486184);})[_0xf39b('0x18')](function(_0x4876ec){logger[_0xf39b('0x14')](_0xf39b('0x19'),_0x4876ec[_0xf39b('0x16')],_0xe46f78);_0x53fa03(_0x5cb0c8[_0xf39b('0x14')](0x1f4,_0x4876ec[_0xf39b('0x16')]));});});};exports[_0xf39b('0x23')]=function(_0x5155c7){var _0x185796=this;return new Promise(function(_0x188098,_0x1b76ef){return db['CmHopper'][_0xf39b('0x24')]({'raw':_0x5155c7[_0xf39b('0x1c')]?_0x5155c7[_0xf39b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5155c7['options']?_0x5155c7['options'][_0xf39b('0x1d')]||null:null,'attributes':_0x5155c7['options']?_0x5155c7[_0xf39b('0x1c')][_0xf39b('0x22')]||null:null,'include':_0x5155c7['options']?_0x5155c7[_0xf39b('0x1c')][_0xf39b('0x20')]?_[_0xf39b('0x1f')](_0x5155c7[_0xf39b('0x1c')]['include'],function(_0xba3eba){return{'model':db[_0xba3eba[_0xf39b('0x21')]],'as':_0xba3eba['as'],'attributes':_0xba3eba[_0xf39b('0x22')],'include':_0xba3eba[_0xf39b('0x20')]?_['map'](_0xba3eba[_0xf39b('0x20')],function(_0x10b336){return{'model':db[_0x10b336[_0xf39b('0x21')]],'as':_0x10b336['as'],'attributes':_0x10b336[_0xf39b('0x22')],'include':_0x10b336[_0xf39b('0x20')]?_[_0xf39b('0x1f')](_0x10b336['include'],function(_0x2b70a9){return{'model':db[_0x2b70a9[_0xf39b('0x21')]],'as':_0x2b70a9['as'],'attributes':_0x2b70a9['attributes']};}):[]};}):[]};}):[]:[]})[_0xf39b('0xe')](function(_0x585504){logger[_0xf39b('0x17')](_0xf39b('0x23'),_0x5155c7);logger[_0xf39b('0x11')]('ShowCmHopper',_0x5155c7,JSON[_0xf39b('0x13')](_0x585504));_0x188098(_0x585504);})[_0xf39b('0x18')](function(_0x134098){logger[_0xf39b('0x14')](_0xf39b('0x23'),_0x134098[_0xf39b('0x16')],_0x5155c7);_0x1b76ef(_0x185796[_0xf39b('0x14')](0x1f4,_0x134098[_0xf39b('0x16')]));});});};exports['CreateCmHopper']=function(_0x3ec8bd){var _0x44c7a5=this;return new Promise(function(_0x50bdc8,_0x25dc91){return db['CmHopper']['create'](_0x3ec8bd[_0xf39b('0x25')],{'raw':_0x3ec8bd[_0xf39b('0x1c')]?_0x3ec8bd[_0xf39b('0x1c')][_0xf39b('0x26')]===undefined?!![]:![]:!![]})['then'](function(_0x23a7c8){logger[_0xf39b('0x17')](_0xf39b('0x27'),_0x3ec8bd);logger['debug'](_0xf39b('0x27'),_0x3ec8bd,JSON[_0xf39b('0x13')](_0x23a7c8));_0x50bdc8(_0x23a7c8);})[_0xf39b('0x18')](function(_0x48e1ff){logger['error'](_0xf39b('0x27'),_0x48e1ff[_0xf39b('0x16')],_0x3ec8bd);_0x25dc91(_0x44c7a5[_0xf39b('0x14')](0x1f4,_0x48e1ff[_0xf39b('0x16')]));});});};exports[_0xf39b('0x28')]=function(_0x5462fb){var _0x5713c0=this;return new Promise(function(_0x1db352,_0x4e5dbb){return db['CmHopper'][_0xf39b('0x29')](_0x5462fb[_0xf39b('0x25')],{'raw':_0x5462fb['options']?_0x5462fb[_0xf39b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5462fb[_0xf39b('0x1c')]?_0x5462fb[_0xf39b('0x1c')][_0xf39b('0x1d')]||null:null,'attributes':_0x5462fb[_0xf39b('0x1c')]?_0x5462fb['options'][_0xf39b('0x22')]||null:null,'limit':_0x5462fb[_0xf39b('0x1c')]?_0x5462fb[_0xf39b('0x1c')][_0xf39b('0x1e')]||null:null})[_0xf39b('0xe')](function(_0x44226d){logger[_0xf39b('0x17')](_0xf39b('0x28'),_0x5462fb);logger[_0xf39b('0x11')]('UpdateCmHopper',_0x5462fb,JSON['stringify'](_0x44226d));_0x1db352(_0x44226d);})['catch'](function(_0xa569b6){logger[_0xf39b('0x14')](_0xf39b('0x28'),_0xa569b6[_0xf39b('0x16')],_0x5462fb);_0x4e5dbb(_0x5713c0[_0xf39b('0x14')](0x1f4,_0xa569b6[_0xf39b('0x16')]));});});};exports[_0xf39b('0x2a')]=function(_0x4b1d16){var _0x4a5755=this;return new Promise(function(_0x15e87d,_0x56fce7){return db[_0xf39b('0x1a')][_0xf39b('0x2b')]({'where':_0x4b1d16[_0xf39b('0x1c')]?_0x4b1d16[_0xf39b('0x1c')][_0xf39b('0x1d')]||null:null})[_0xf39b('0xe')](function(_0x8a44b0){logger[_0xf39b('0x17')](_0xf39b('0x2a'),_0x4b1d16);logger['debug'](_0xf39b('0x2a'),_0x4b1d16,JSON[_0xf39b('0x13')](_0x8a44b0));_0x15e87d(_0x8a44b0);})['catch'](function(_0x59be5f){logger['error']('DestroyCmHopper',_0x59be5f[_0xf39b('0x16')],_0x4b1d16);_0x56fce7(_0x4a5755[_0xf39b('0x14')](0x1f4,_0x59be5f['message']));});});};exports[_0xf39b('0x2c')]=function(_0x56e6fc){var _0x520dbc=this;return new Promise(function(_0x12fc2a,_0x161ca7){return db[_0xf39b('0x2d')]['describe']()['then'](function(_0x550221){return db[_0xf39b('0x2e')]['transaction'](function(_0xa3d52f){return db[_0xf39b('0x1a')][_0xf39b('0x1b')]({'where':_0x56e6fc[_0xf39b('0x1c')]?_0x56e6fc[_0xf39b('0x1c')]['where']||null:null,'attributes':_0x56e6fc[_0xf39b('0x1c')]?_0x56e6fc[_0xf39b('0x1c')][_0xf39b('0x22')]||null:null,'limit':_0x56e6fc[_0xf39b('0x1c')]?_0x56e6fc[_0xf39b('0x1c')]['limit']||null:null,'order':_0x56e6fc[_0xf39b('0x1c')]?_0x56e6fc[_0xf39b('0x1c')][_0xf39b('0x2f')]||null:null,'transaction':_0xa3d52f,'lock':_0xa3d52f['LOCK']['UPDATE'],'include':[{'model':db[_0xf39b('0x2d')],'as':_0xf39b('0x30'),'attributes':_[_0xf39b('0x31')](_0x550221)},{'model':db[_0xf39b('0x32')],'as':_0xf39b('0x33'),'attributes':['id',_0xf39b('0x34'),'voicePause']}]})[_0xf39b('0xe')](function(_0x13ae58){var _0x34b5ca=[];var _0x55877a=[];for(var _0x1b951b=0x0;_0x1b951b<_0x13ae58['length'];_0x1b951b+=0x1){var _0x214be5=_0x13ae58[_0x1b951b]['UserId'];if(_0x214be5===null){_0x34b5ca['push'](_0x13ae58[_0x1b951b][_0xf39b('0x29')](_0x56e6fc[_0xf39b('0x25')],{'transaction':_0xa3d52f}));}else if(!_0x55877a[_0xf39b('0x35')](_0x214be5)){_0x55877a[_0xf39b('0x36')](_0x214be5);_0x34b5ca[_0xf39b('0x36')](_0x13ae58[_0x1b951b][_0xf39b('0x29')](_0x56e6fc[_0xf39b('0x25')],{'transaction':_0xa3d52f}));}}return BPromise['all'](_0x34b5ca);});})['then'](function(_0x120f4a){logger['info'](_0xf39b('0x2c'),_0x56e6fc);logger[_0xf39b('0x11')]('GetContactDialer',_0x56e6fc,JSON[_0xf39b('0x13')](_0x120f4a));_0x12fc2a(_0x120f4a);})[_0xf39b('0x18')](function(_0x73d1c4){logger['error'](_0xf39b('0x2c'),_0x73d1c4[_0xf39b('0x16')],_0x56e6fc);_0x161ca7(_0x520dbc['error'](0x1f4,_0x73d1c4[_0xf39b('0x16')]));});});});};exports[_0xf39b('0x37')]=function(_0x53c881){var _0x2be589=this;return new Promise(function(_0x8cd772,_0x34e8ad){return db[_0xf39b('0x2e')][_0xf39b('0x38')](function(_0x22c4fa){return db['CmHopperFinal']['create'](_0x53c881['body'],{'raw':_0x53c881[_0xf39b('0x1c')]?_0x53c881['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x22c4fa})[_0xf39b('0xe')](function(){return db[_0xf39b('0x1a')][_0xf39b('0x2b')]({'where':_0x53c881[_0xf39b('0x1c')]?_0x53c881[_0xf39b('0x1c')]['where']||null:null,'transaction':_0x22c4fa});});})['then'](function(_0x31eb12){logger[_0xf39b('0x17')](_0xf39b('0x37'),_0x53c881);logger[_0xf39b('0x11')](_0xf39b('0x37'),_0x53c881,JSON[_0xf39b('0x13')](_0x31eb12));_0x8cd772(_0x31eb12);})[_0xf39b('0x18')](function(_0x3ef2c4){logger['error'](_0xf39b('0x37'),_0x3ef2c4[_0xf39b('0x16')],_0x53c881);_0x34e8ad(_0x2be589['error'](0x1f4,_0x3ef2c4[_0xf39b('0x16')]));});});};exports['CountReScheduled']=function(_0x4d82c3){var _0x33f67b=this;return new Promise(function(_0x4ca691,_0x22aef7){return db[_0xf39b('0x1a')]['findAll']({'raw':_0x4d82c3['options']?_0x4d82c3['options'][_0xf39b('0x26')]===undefined?!![]:![]:!![],'where':_0x4d82c3['options']?_0x4d82c3['options'][_0xf39b('0x1d')]||null:null,'attributes':[[db[_0xf39b('0x2e')]['fn'](_0xf39b('0x39'),db[_0xf39b('0x2e')]['fn']('IF',db[_0xf39b('0x2e')]['literal'](_0xf39b('0x3a')+util[_0xf39b('0x3b')](_0xf39b('0x3c'),moment()[_0xf39b('0x3b')](_0xf39b('0x3d')))+_0xf39b('0x3e')))),'contactsRescheduled']]})[_0xf39b('0xe')](function(_0x2a73a7){logger[_0xf39b('0x17')](_0xf39b('0x3f'),_0x4d82c3);logger[_0xf39b('0x11')](_0xf39b('0x3f'),_0x4d82c3,JSON[_0xf39b('0x13')](_0x2a73a7));_0x4ca691(_0x2a73a7);})[_0xf39b('0x18')](function(_0x3ba72f){logger[_0xf39b('0x14')](_0xf39b('0x3f'),_0x3ba72f[_0xf39b('0x16')],_0x4d82c3);_0x22aef7(_0x33f67b[_0xf39b('0x14')](0x1f4,_0x3ba72f[_0xf39b('0x16')]));});});};exports[_0xf39b('0x40')]=function(_0x1d3bad){var _0xce0deb=this;return new Promise(function(_0x4b6fa1,_0x215fec){return db[_0xf39b('0x2d')][_0xf39b('0x41')]()[_0xf39b('0xe')](function(_0xfd7ede){return db[_0xf39b('0x2e')][_0xf39b('0x38')](function(_0x80267c){return db['CmHopper']['findAll']({'where':_0x1d3bad['options']?_0x1d3bad['options'][_0xf39b('0x1d')]||null:null,'attributes':_0x1d3bad['options']?_0x1d3bad[_0xf39b('0x1c')][_0xf39b('0x22')]||null:null,'limit':0x1,'order':_0x1d3bad[_0xf39b('0x1c')]?_0x1d3bad[_0xf39b('0x1c')][_0xf39b('0x2f')]||null:null,'group':db['CmHopper'][_0xf39b('0x42')],'transaction':_0x80267c,'lock':_0x80267c[_0xf39b('0x43')]['UPDATE'],'include':_0x1d3bad['options']?_0x1d3bad[_0xf39b('0x1c')][_0xf39b('0x20')]?_[_0xf39b('0x1f')](_0x1d3bad[_0xf39b('0x1c')][_0xf39b('0x20')],function(_0x3ea547){return{'model':db[_0x3ea547['model']],'as':_0x3ea547['as'],'attributes':_0x3ea547['attributes'],'include':_0x3ea547[_0xf39b('0x20')]?_[_0xf39b('0x1f')](_0x3ea547[_0xf39b('0x20')],function(_0x371fb8){return{'model':db[_0x371fb8[_0xf39b('0x21')]],'as':_0x371fb8['as'],'attributes':_0x371fb8['attributes'],'include':_0x371fb8['include']?_[_0xf39b('0x1f')](_0x371fb8[_0xf39b('0x20')],function(_0x2681b0){return{'model':db[_0x2681b0['model']],'as':_0x2681b0['as'],'attributes':_0x2681b0[_0xf39b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf39b('0xe')](function(_0x25430c){var _0x4a3598=[];for(var _0xc0647a=0x0;_0xc0647a<_0x25430c['length'];_0xc0647a+=0x1){_0x4a3598[_0xf39b('0x36')](_0x25430c[_0xc0647a][_0xf39b('0x29')](_0x1d3bad[_0xf39b('0x25')],{'transaction':_0x80267c}));}return BPromise['all'](_0x4a3598);});})[_0xf39b('0xe')](function(_0x3bc573){logger['info'](_0xf39b('0x40'),_0x1d3bad);logger[_0xf39b('0x11')](_0xf39b('0x40'),_0x1d3bad,JSON[_0xf39b('0x13')](_0x3bc573));_0x4b6fa1(_0x3bc573);})[_0xf39b('0x18')](function(_0x407526){logger[_0xf39b('0x14')](_0xf39b('0x40'),_0x407526[_0xf39b('0x16')],_0x1d3bad);_0x215fec(_0xce0deb[_0xf39b('0x14')](0x1f4,_0x407526[_0xf39b('0x16')]));});});});};exports[_0xf39b('0x44')]=function(_0x25abdb){var _0x12bfce=this;return new Promise(function(_0x2a08fa,_0xddb7c6){db[_0xf39b('0x2d')][_0xf39b('0x41')]()[_0xf39b('0xe')](function(_0x263028){return db['CmHopper'][_0xf39b('0x1b')]({'raw':_0x25abdb[_0xf39b('0x1c')]?_0x25abdb[_0xf39b('0x1c')][_0xf39b('0x26')]===undefined?!![]:![]:!![],'where':_0x25abdb[_0xf39b('0x1c')]?_0x25abdb[_0xf39b('0x1c')][_0xf39b('0x1d')]||null:null,'attributes':_0x25abdb[_0xf39b('0x1c')]?_0x25abdb['options'][_0xf39b('0x22')]||null:null,'limit':_0x25abdb[_0xf39b('0x1c')]?_0x25abdb[_0xf39b('0x1c')]['limit']||null:null,'include':_0x25abdb[_0xf39b('0x1c')]?_0x25abdb[_0xf39b('0x1c')]['include']?_['map'](_0x25abdb['options']['include'],function(_0x5d8076){return{'model':db[_0x5d8076[_0xf39b('0x21')]],'as':_0x5d8076['as'],'attributes':_0x5d8076['as']==='Contact'?_['keys'](_0x263028):_0x5d8076[_0xf39b('0x22')],'include':_0x5d8076['include']?_[_0xf39b('0x1f')](_0x5d8076['include'],function(_0x1cb295){return{'model':db[_0x1cb295[_0xf39b('0x21')]],'as':_0x1cb295['as'],'attributes':_0x1cb295['attributes'],'include':_0x1cb295['include']?_[_0xf39b('0x1f')](_0x1cb295[_0xf39b('0x20')],function(_0x38063a){return{'model':db[_0x38063a[_0xf39b('0x21')]],'as':_0x38063a['as'],'attributes':_0x38063a[_0xf39b('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d876){logger[_0xf39b('0x17')](_0xf39b('0x19'),_0x25abdb);logger[_0xf39b('0x11')](_0xf39b('0x19'),_0x25abdb,JSON[_0xf39b('0x13')](_0x24d876));_0x2a08fa(_0x24d876);})[_0xf39b('0x18')](function(_0x48e71e){logger[_0xf39b('0x14')]('GetCmHopper',_0x48e71e[_0xf39b('0x16')],_0x25abdb);_0xddb7c6(_0x12bfce[_0xf39b('0x14')](0x1f4,_0x48e71e['message']));});});});}; \ No newline at end of file +var _0xf3b9=['literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','LOCK','all','GetCmHopperPreview','keys','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','options','raw','where','limit','include','map','model','attributes','GetCmHopper','ShowCmHopper','find','CreateCmHopper','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','findAll','UPDATE','CmContact','Contact','User','Agent','voicePause','length','push','MoveContactManagedDialer','transaction','create','COUNT'];(function(_0x75f3fd,_0x1bcfa1){var _0x40c64d=function(_0x39a019){while(--_0x39a019){_0x75f3fd['push'](_0x75f3fd['shift']());}};_0x40c64d(++_0x1bcfa1);}(_0xf3b9,0x1be));var _0x9f3b=function(_0x823229,_0x1710e2){_0x823229=_0x823229-0x0;var _0x2d2103=_0xf3b9[_0x823229];return _0x2d2103;};'use strict';var _=require(_0x9f3b('0x0'));var util=require(_0x9f3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f3b('0x2'));var fs=require('fs');var Redis=require(_0x9f3b('0x3'));var db=require(_0x9f3b('0x4'))['db'];var utils=require(_0x9f3b('0x5'));var logger=require(_0x9f3b('0x6'))(_0x9f3b('0x7'));var config=require(_0x9f3b('0x8'));var jayson=require(_0x9f3b('0x9'));var client=jayson[_0x9f3b('0xa')][_0x9f3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a5e15,_0x42d921,_0x259307){return new BPromise(function(_0x2fbbf9,_0x6a2f2b){return client[_0x9f3b('0xc')](_0x1a5e15,_0x259307)[_0x9f3b('0xd')](function(_0xe42fd0){logger[_0x9f3b('0xe')](_0x9f3b('0xf'),_0x42d921,_0x9f3b('0x10'));logger[_0x9f3b('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x42d921,'request\x20sent',JSON[_0x9f3b('0x12')](_0xe42fd0));if(_0xe42fd0[_0x9f3b('0x13')]){if(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x14')]===0x1f4){logger['error'](_0x9f3b('0xf'),_0x42d921,_0xe42fd0['error'][_0x9f3b('0x15')]);return _0x6a2f2b(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x15')]);}logger['error'](_0x9f3b('0xf'),_0x42d921,_0xe42fd0['error'][_0x9f3b('0x15')]);return _0x2fbbf9(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x15')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x42d921,'request\x20sent');_0x2fbbf9(_0xe42fd0[_0x9f3b('0x16')]['message']);}})[_0x9f3b('0x17')](function(_0x1bb4cc){logger[_0x9f3b('0x13')]('CmHopper,\x20%s,\x20%s',_0x42d921,_0x1bb4cc);_0x6a2f2b(_0x1bb4cc);});});}exports['GetCmHopper']=function(_0x5c5b93){var _0xbce5a2=this;return new Promise(function(_0x5975eb,_0x595a6c){return db[_0x9f3b('0x18')]['findAll']({'raw':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c5b93['options']?_0x5c5b93['options'][_0x9f3b('0x1b')]||null:null,'attributes':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')]['attributes']||null:null,'limit':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'include':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x5c5b93['options'][_0x9f3b('0x1d')],function(_0x47869a){return{'model':db[_0x47869a[_0x9f3b('0x1f')]],'as':_0x47869a['as'],'attributes':_0x47869a[_0x9f3b('0x20')],'include':_0x47869a[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x47869a[_0x9f3b('0x1d')],function(_0x31bd57){return{'model':db[_0x31bd57[_0x9f3b('0x1f')]],'as':_0x31bd57['as'],'attributes':_0x31bd57['attributes'],'include':_0x31bd57[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x31bd57['include'],function(_0x53f1b7){return{'model':db[_0x53f1b7[_0x9f3b('0x1f')]],'as':_0x53f1b7['as'],'attributes':_0x53f1b7[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0xa9a118){logger['info'](_0x9f3b('0x21'),_0x5c5b93);logger[_0x9f3b('0x11')](_0x9f3b('0x21'),_0x5c5b93,JSON[_0x9f3b('0x12')](_0xa9a118));_0x5975eb(_0xa9a118);})[_0x9f3b('0x17')](function(_0x161266){logger[_0x9f3b('0x13')]('GetCmHopper',_0x161266[_0x9f3b('0x15')],_0x5c5b93);_0x595a6c(_0xbce5a2['error'](0x1f4,_0x161266[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x22')]=function(_0x2bcd0a){var _0x4ad01e=this;return new Promise(function(_0x1fc013,_0x5304bf){return db[_0x9f3b('0x18')][_0x9f3b('0x23')]({'raw':_0x2bcd0a['options']?_0x2bcd0a['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a[_0x9f3b('0x19')]['where']||null:null,'attributes':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a['options'][_0x9f3b('0x20')]||null:null,'include':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x2bcd0a[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0x197a82){return{'model':db[_0x197a82['model']],'as':_0x197a82['as'],'attributes':_0x197a82[_0x9f3b('0x20')],'include':_0x197a82['include']?_['map'](_0x197a82[_0x9f3b('0x1d')],function(_0x1ec8d9){return{'model':db[_0x1ec8d9['model']],'as':_0x1ec8d9['as'],'attributes':_0x1ec8d9[_0x9f3b('0x20')],'include':_0x1ec8d9[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x1ec8d9[_0x9f3b('0x1d')],function(_0x16afa9){return{'model':db[_0x16afa9['model']],'as':_0x16afa9['as'],'attributes':_0x16afa9[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0xe3a4b5){logger['info'](_0x9f3b('0x22'),_0x2bcd0a);logger[_0x9f3b('0x11')](_0x9f3b('0x22'),_0x2bcd0a,JSON[_0x9f3b('0x12')](_0xe3a4b5));_0x1fc013(_0xe3a4b5);})[_0x9f3b('0x17')](function(_0x44e8f4){logger[_0x9f3b('0x13')](_0x9f3b('0x22'),_0x44e8f4['message'],_0x2bcd0a);_0x5304bf(_0x4ad01e[_0x9f3b('0x13')](0x1f4,_0x44e8f4[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x24')]=function(_0x449937){var _0x5a5df4=this;return new Promise(function(_0x5c97ff,_0x84f20b){return db[_0x9f3b('0x18')]['create'](_0x449937[_0x9f3b('0x25')],{'raw':_0x449937[_0x9f3b('0x19')]?_0x449937[_0x9f3b('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58d12a){logger[_0x9f3b('0xe')](_0x9f3b('0x24'),_0x449937);logger[_0x9f3b('0x11')]('CreateCmHopper',_0x449937,JSON[_0x9f3b('0x12')](_0x58d12a));_0x5c97ff(_0x58d12a);})[_0x9f3b('0x17')](function(_0x2250ad){logger[_0x9f3b('0x13')](_0x9f3b('0x24'),_0x2250ad[_0x9f3b('0x15')],_0x449937);_0x84f20b(_0x5a5df4['error'](0x1f4,_0x2250ad['message']));});});};exports['UpdateCmHopper']=function(_0x2dd274){var _0x2488bd=this;return new Promise(function(_0x539c7e,_0x36580b){return db[_0x9f3b('0x18')][_0x9f3b('0x26')](_0x2dd274[_0x9f3b('0x25')],{'raw':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')]['attributes']||null:null,'limit':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null})[_0x9f3b('0xd')](function(_0x5cceab){logger[_0x9f3b('0xe')](_0x9f3b('0x27'),_0x2dd274);logger['debug'](_0x9f3b('0x27'),_0x2dd274,JSON['stringify'](_0x5cceab));_0x539c7e(_0x5cceab);})[_0x9f3b('0x17')](function(_0x591e72){logger[_0x9f3b('0x13')](_0x9f3b('0x27'),_0x591e72[_0x9f3b('0x15')],_0x2dd274);_0x36580b(_0x2488bd[_0x9f3b('0x13')](0x1f4,_0x591e72[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x28')]=function(_0x273652){var _0x4c42f3=this;return new Promise(function(_0x257636,_0x55a66e){return db['CmHopper'][_0x9f3b('0x29')]({'where':_0x273652[_0x9f3b('0x19')]?_0x273652[_0x9f3b('0x19')]['where']||null:null})[_0x9f3b('0xd')](function(_0xbee772){logger[_0x9f3b('0xe')]('DestroyCmHopper',_0x273652);logger['debug'](_0x9f3b('0x28'),_0x273652,JSON[_0x9f3b('0x12')](_0xbee772));_0x257636(_0xbee772);})[_0x9f3b('0x17')](function(_0x5475bc){logger['error']('DestroyCmHopper',_0x5475bc[_0x9f3b('0x15')],_0x273652);_0x55a66e(_0x4c42f3['error'](0x1f4,_0x5475bc[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x2a')]=function(_0x5399fc){var _0x2d5846=this;return new Promise(function(_0x5a9419,_0x3356bb){return db['CmContact'][_0x9f3b('0x2b')]()[_0x9f3b('0xd')](function(_0x3839cc){return db[_0x9f3b('0x2c')]['transaction'](function(_0x3239d){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'where':_0x5399fc[_0x9f3b('0x19')]?_0x5399fc[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':_0x5399fc['options']?_0x5399fc['options'][_0x9f3b('0x20')]||null:null,'limit':_0x5399fc['options']?_0x5399fc[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'order':_0x5399fc[_0x9f3b('0x19')]?_0x5399fc[_0x9f3b('0x19')]['order']||null:null,'transaction':_0x3239d,'lock':_0x3239d['LOCK'][_0x9f3b('0x2e')],'include':[{'model':db[_0x9f3b('0x2f')],'as':_0x9f3b('0x30'),'attributes':_['keys'](_0x3839cc)},{'model':db[_0x9f3b('0x31')],'as':_0x9f3b('0x32'),'attributes':['id','name',_0x9f3b('0x33')]}]})[_0x9f3b('0xd')](function(_0x282be8){var _0x4567ce=[];var _0x5d0de3=[];for(var _0x4cd325=0x0;_0x4cd325<_0x282be8[_0x9f3b('0x34')];_0x4cd325+=0x1){var _0x6d9b57=_0x282be8[_0x4cd325]['UserId'];if(_0x6d9b57===null){_0x4567ce['push'](_0x282be8[_0x4cd325][_0x9f3b('0x26')](_0x5399fc[_0x9f3b('0x25')],{'transaction':_0x3239d}));}else if(!_0x5d0de3['includes'](_0x6d9b57)){_0x5d0de3[_0x9f3b('0x35')](_0x6d9b57);_0x4567ce[_0x9f3b('0x35')](_0x282be8[_0x4cd325][_0x9f3b('0x26')](_0x5399fc[_0x9f3b('0x25')],{'transaction':_0x3239d}));}}return BPromise['all'](_0x4567ce);});})[_0x9f3b('0xd')](function(_0x346a26){logger['info'](_0x9f3b('0x2a'),_0x5399fc);logger[_0x9f3b('0x11')]('GetContactDialer',_0x5399fc,JSON[_0x9f3b('0x12')](_0x346a26));_0x5a9419(_0x346a26);})['catch'](function(_0x3dff88){logger['error'](_0x9f3b('0x2a'),_0x3dff88[_0x9f3b('0x15')],_0x5399fc);_0x3356bb(_0x2d5846[_0x9f3b('0x13')](0x1f4,_0x3dff88[_0x9f3b('0x15')]));});});});};exports[_0x9f3b('0x36')]=function(_0x33088d){var _0x5316c1=this;return new Promise(function(_0x441398,_0x25f9d8){return db[_0x9f3b('0x2c')][_0x9f3b('0x37')](function(_0x56df40){return db['CmHopperFinal'][_0x9f3b('0x38')](_0x33088d['body'],{'raw':_0x33088d[_0x9f3b('0x19')]?_0x33088d[_0x9f3b('0x19')][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x56df40})[_0x9f3b('0xd')](function(){return db[_0x9f3b('0x18')][_0x9f3b('0x29')]({'where':_0x33088d[_0x9f3b('0x19')]?_0x33088d['options'][_0x9f3b('0x1b')]||null:null,'transaction':_0x56df40});});})[_0x9f3b('0xd')](function(_0x36a811){logger['info'](_0x9f3b('0x36'),_0x33088d);logger[_0x9f3b('0x11')]('MoveContactManagedDialer',_0x33088d,JSON['stringify'](_0x36a811));_0x441398(_0x36a811);})[_0x9f3b('0x17')](function(_0x462af7){logger[_0x9f3b('0x13')](_0x9f3b('0x36'),_0x462af7[_0x9f3b('0x15')],_0x33088d);_0x25f9d8(_0x5316c1['error'](0x1f4,_0x462af7[_0x9f3b('0x15')]));});});};exports['CountReScheduled']=function(_0x41e4d6){var _0x35ccbe=this;return new Promise(function(_0x4d6581,_0x10ffd5){return db[_0x9f3b('0x18')]['findAll']({'raw':_0x41e4d6[_0x9f3b('0x19')]?_0x41e4d6[_0x9f3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x41e4d6[_0x9f3b('0x19')]?_0x41e4d6[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':[[db[_0x9f3b('0x2c')]['fn'](_0x9f3b('0x39'),db['sequelize']['fn']('IF',db[_0x9f3b('0x2c')][_0x9f3b('0x3a')](_0x9f3b('0x3b')+util[_0x9f3b('0x3c')](_0x9f3b('0x3d'),moment()['format'](_0x9f3b('0x3e')))+_0x9f3b('0x3f')))),_0x9f3b('0x40')]]})['then'](function(_0x1638d1){logger[_0x9f3b('0xe')](_0x9f3b('0x41'),_0x41e4d6);logger[_0x9f3b('0x11')](_0x9f3b('0x41'),_0x41e4d6,JSON[_0x9f3b('0x12')](_0x1638d1));_0x4d6581(_0x1638d1);})[_0x9f3b('0x17')](function(_0x34a222){logger[_0x9f3b('0x13')]('CountReScheduled',_0x34a222['message'],_0x41e4d6);_0x10ffd5(_0x35ccbe[_0x9f3b('0x13')](0x1f4,_0x34a222[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x42')]=function(_0x385146){var _0x1714f0=this;return new Promise(function(_0x1fd4a3,_0x3eca2c){return db[_0x9f3b('0x2f')][_0x9f3b('0x2b')]()[_0x9f3b('0xd')](function(_0xf8330a){return db[_0x9f3b('0x2c')][_0x9f3b('0x37')](function(_0x55e0da){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'where':_0x385146[_0x9f3b('0x19')]?_0x385146[_0x9f3b('0x19')]['where']||null:null,'attributes':_0x385146[_0x9f3b('0x19')]?_0x385146[_0x9f3b('0x19')][_0x9f3b('0x20')]||null:null,'limit':0x1,'order':_0x385146[_0x9f3b('0x19')]?_0x385146['options'][_0x9f3b('0x43')]||null:null,'group':db[_0x9f3b('0x18')]['UserId'],'transaction':_0x55e0da,'lock':_0x55e0da[_0x9f3b('0x44')][_0x9f3b('0x2e')],'include':_0x385146[_0x9f3b('0x19')]?_0x385146['options'][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x385146[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0x417409){return{'model':db[_0x417409['model']],'as':_0x417409['as'],'attributes':_0x417409[_0x9f3b('0x20')],'include':_0x417409['include']?_[_0x9f3b('0x1e')](_0x417409[_0x9f3b('0x1d')],function(_0x3bbdd7){return{'model':db[_0x3bbdd7[_0x9f3b('0x1f')]],'as':_0x3bbdd7['as'],'attributes':_0x3bbdd7['attributes'],'include':_0x3bbdd7[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x3bbdd7[_0x9f3b('0x1d')],function(_0x11c9a9){return{'model':db[_0x11c9a9['model']],'as':_0x11c9a9['as'],'attributes':_0x11c9a9[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0x502afd){var _0x2e095d=[];for(var _0x1860b9=0x0;_0x1860b9<_0x502afd[_0x9f3b('0x34')];_0x1860b9+=0x1){_0x2e095d[_0x9f3b('0x35')](_0x502afd[_0x1860b9][_0x9f3b('0x26')](_0x385146[_0x9f3b('0x25')],{'transaction':_0x55e0da}));}return BPromise[_0x9f3b('0x45')](_0x2e095d);});})[_0x9f3b('0xd')](function(_0x13b5e0){logger[_0x9f3b('0xe')]('GetContactRecallMe',_0x385146);logger[_0x9f3b('0x11')]('GetContactRecallMe',_0x385146,JSON[_0x9f3b('0x12')](_0x13b5e0));_0x1fd4a3(_0x13b5e0);})[_0x9f3b('0x17')](function(_0x5f4f79){logger['error'](_0x9f3b('0x42'),_0x5f4f79['message'],_0x385146);_0x3eca2c(_0x1714f0[_0x9f3b('0x13')](0x1f4,_0x5f4f79[_0x9f3b('0x15')]));});});});};exports[_0x9f3b('0x46')]=function(_0x4483a2){var _0x1578bf=this;return new Promise(function(_0x51f521,_0x37a3ae){db['CmContact']['describe']()['then'](function(_0x1ea800){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'raw':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2['options'][_0x9f3b('0x1b')]||null:null,'attributes':_0x4483a2['options']?_0x4483a2['options']['attributes']||null:null,'limit':_0x4483a2['options']?_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'include':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_['map'](_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0xfd6dc2){return{'model':db[_0xfd6dc2[_0x9f3b('0x1f')]],'as':_0xfd6dc2['as'],'attributes':_0xfd6dc2['as']===_0x9f3b('0x30')?_[_0x9f3b('0x47')](_0x1ea800):_0xfd6dc2[_0x9f3b('0x20')],'include':_0xfd6dc2['include']?_[_0x9f3b('0x1e')](_0xfd6dc2[_0x9f3b('0x1d')],function(_0x1147e9){return{'model':db[_0x1147e9[_0x9f3b('0x1f')]],'as':_0x1147e9['as'],'attributes':_0x1147e9[_0x9f3b('0x20')],'include':_0x1147e9[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x1147e9[_0x9f3b('0x1d')],function(_0x2cd00a){return{'model':db[_0x2cd00a[_0x9f3b('0x1f')]],'as':_0x2cd00a['as'],'attributes':_0x2cd00a[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0x4637b4){logger[_0x9f3b('0xe')](_0x9f3b('0x21'),_0x4483a2);logger['debug'](_0x9f3b('0x21'),_0x4483a2,JSON[_0x9f3b('0x12')](_0x4637b4));_0x51f521(_0x4637b4);})[_0x9f3b('0x17')](function(_0x225d53){logger['error'](_0x9f3b('0x21'),_0x225d53[_0x9f3b('0x15')],_0x4483a2);_0x37a3ae(_0x1578bf[_0x9f3b('0x13')](0x1f4,_0x225d53[_0x9f3b('0x15')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4d8c786..463c4de 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 _0x9f59=['show','post','/preview','getPreview','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getOpenContacts','/:id'];(function(_0x3772a4,_0x194faf){var _0x51fd75=function(_0x202f16){while(--_0x202f16){_0x3772a4['push'](_0x3772a4['shift']());}};_0x51fd75(++_0x194faf);}(_0x9f59,0x69));var _0x99f5=function(_0x5d607e,_0x21c2d1){_0x5d607e=_0x5d607e-0x0;var _0x9c5852=_0x9f59[_0x5d607e];return _0x9c5852;};'use strict';var multer=require('multer');var util=require(_0x99f5('0x0'));var path=require(_0x99f5('0x1'));var timeout=require(_0x99f5('0x2'));var express=require(_0x99f5('0x3'));var router=express[_0x99f5('0x4')]();var fs_extra=require(_0x99f5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x99f5('0x6'));var config=require(_0x99f5('0x7'));var controller=require('./cmHopper.controller');router[_0x99f5('0x8')]('/',auth[_0x99f5('0x9')](),controller[_0x99f5('0xa')]);router[_0x99f5('0x8')](_0x99f5('0xb'),auth[_0x99f5('0x9')](),controller[_0x99f5('0xc')]);router[_0x99f5('0x8')]('/opencontacts',auth['isAuthenticated'](),controller[_0x99f5('0xd')]);router[_0x99f5('0x8')](_0x99f5('0xe'),auth[_0x99f5('0x9')](),controller[_0x99f5('0xf')]);router['post']('/',auth[_0x99f5('0x9')](),controller['create']);router[_0x99f5('0x10')](_0x99f5('0x11'),auth['isAuthenticated'](),controller[_0x99f5('0x12')]);router[_0x99f5('0x13')](_0x99f5('0xe'),auth[_0x99f5('0x9')](),controller[_0x99f5('0x14')]);router[_0x99f5('0x15')](_0x99f5('0xe'),auth[_0x99f5('0x9')](),controller[_0x99f5('0x16')]);module[_0x99f5('0x17')]=router; \ No newline at end of file +var _0xbf49=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x398b3d,_0x53a2a0){var _0x4230e7=function(_0x209e4c){while(--_0x209e4c){_0x398b3d['push'](_0x398b3d['shift']());}};_0x4230e7(++_0x53a2a0);}(_0xbf49,0x1f0));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9bf4('0x0'));var path=require(_0x9bf4('0x1'));var timeout=require('connect-timeout');var express=require(_0x9bf4('0x2'));var router=express['Router']();var fs_extra=require(_0x9bf4('0x3'));var auth=require(_0x9bf4('0x4'));var interaction=require(_0x9bf4('0x5'));var config=require(_0x9bf4('0x6'));var controller=require('./cmHopper.controller');router[_0x9bf4('0x7')]('/',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x9')]);router[_0x9bf4('0x7')](_0x9bf4('0xa'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0xb')]);router['get'](_0x9bf4('0xc'),auth['isAuthenticated'](),controller[_0x9bf4('0xd')]);router['get'](_0x9bf4('0xe'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0xf')]);router[_0x9bf4('0x10')]('/',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x11')]);router[_0x9bf4('0x10')](_0x9bf4('0x12'),auth['isAuthenticated'](),controller[_0x9bf4('0x13')]);router[_0x9bf4('0x14')]('/:id',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x15')]);router[_0x9bf4('0x16')](_0x9bf4('0xe'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x17')]);module[_0x9bf4('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 1ea4038..d3b2f3a 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 _0x1f22=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x2ce226,_0x18ecc5){var _0x7e34b3=function(_0x2c4794){while(--_0x2c4794){_0x2ce226['push'](_0x2ce226['shift']());}};_0x7e34b3(++_0x18ecc5);}(_0x1f22,0x136));var _0x21f2=function(_0x44c508,_0x2bc708){_0x44c508=_0x44c508-0x0;var _0x10f167=_0x1f22[_0x44c508];return _0x10f167;};'use strict';var moment=require(_0x21f2('0x0'));var Sequelize=require(_0x21f2('0x1'));module[_0x21f2('0x2')]={'phone':{'type':Sequelize[_0x21f2('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x21f2('0x4')],'unique':_0x21f2('0x5')},'ListId':{'type':Sequelize[_0x21f2('0x4')],'unique':_0x21f2('0x5')},'VoiceQueueId':{'type':Sequelize[_0x21f2('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xd714=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x4276fb,_0x51bab2){var _0x6469dc=function(_0x3cdc42){while(--_0x3cdc42){_0x4276fb['push'](_0x4276fb['shift']());}};_0x6469dc(++_0x51bab2);}(_0xd714,0x1e4));var _0x4d71=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xd714[_0x2142c8];return _0x4286e9;};'use strict';var moment=require(_0x4d71('0x0'));var Sequelize=require(_0x4d71('0x1'));module['exports']={'phone':{'type':Sequelize[_0x4d71('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4d71('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4d71('0x4')},'VoiceQueueId':{'type':Sequelize[_0x4d71('0x3')],'unique':_0x4d71('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e436134..54aa40b 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 _0x7c7a=['order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','keys','rawAttributes','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','stack','name','index','map','CmHopperBlack','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xe7b356,_0x2054c0){var _0x1dcc59=function(_0x79c370){while(--_0x79c370){_0xe7b356['push'](_0xe7b356['shift']());}};_0x1dcc59(++_0x2054c0);}(_0x7c7a,0x1d4));var _0xa7c7=function(_0x550000,_0x21050c){_0x550000=_0x550000-0x0;var _0x43fa29=_0x7c7a[_0x550000];return _0x43fa29;};'use strict';var emlformat=require(_0xa7c7('0x0'));var rimraf=require(_0xa7c7('0x1'));var zipdir=require(_0xa7c7('0x2'));var jsonpatch=require(_0xa7c7('0x3'));var rp=require(_0xa7c7('0x4'));var moment=require(_0xa7c7('0x5'));var BPromise=require(_0xa7c7('0x6'));var Mustache=require(_0xa7c7('0x7'));var util=require(_0xa7c7('0x8'));var path=require('path');var sox=require(_0xa7c7('0x9'));var csv=require(_0xa7c7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa7c7('0xb'));var crypto=require(_0xa7c7('0xc'));var jsforce=require(_0xa7c7('0xd'));var deskjs=require(_0xa7c7('0xe'));var toCsv=require(_0xa7c7('0xa'));var querystring=require(_0xa7c7('0xf'));var Papa=require(_0xa7c7('0x10'));var Redis=require(_0xa7c7('0x11'));var authService=require(_0xa7c7('0x12'));var qs=require(_0xa7c7('0x13'));var as=require(_0xa7c7('0x14'));var hardwareService=require(_0xa7c7('0x15'));var logger=require(_0xa7c7('0x16'))(_0xa7c7('0x17'));var utils=require(_0xa7c7('0x18'));var config=require(_0xa7c7('0x19'));var licenseUtil=require(_0xa7c7('0x1a'));var db=require(_0xa7c7('0x1b'))['db'];function respondWithStatusCode(_0x3a2734,_0x19d009){_0x19d009=_0x19d009||0xcc;return function(_0x2a78de){if(_0x2a78de){return _0x3a2734[_0xa7c7('0x1c')](_0x19d009);}return _0x3a2734[_0xa7c7('0x1d')](_0x19d009)[_0xa7c7('0x1e')]();};}function respondWithResult(_0x5153b1,_0x10d3af){_0x10d3af=_0x10d3af||0xc8;return function(_0x357f26){if(_0x357f26){return _0x5153b1[_0xa7c7('0x1d')](_0x10d3af)['json'](_0x357f26);}};}function respondWithFilteredResult(_0x372804,_0x40cfbb){return function(_0x29cb3a){if(_0x29cb3a){var _0x40edba=typeof _0x40cfbb[_0xa7c7('0x1f')]==='undefined'&&typeof _0x40cfbb['limit']===_0xa7c7('0x20');var _0x4566c6=_0x29cb3a[_0xa7c7('0x21')];var _0x244e2d=_0x40edba?0x0:_0x40cfbb[_0xa7c7('0x1f')];var _0x5e21a4=_0x40edba?_0x29cb3a[_0xa7c7('0x21')]:_0x40cfbb[_0xa7c7('0x1f')]+_0x40cfbb[_0xa7c7('0x22')];var _0x4ac36a;if(_0x5e21a4>=_0x4566c6){_0x5e21a4=_0x4566c6;_0x4ac36a=0xc8;}else{_0x4ac36a=0xce;}_0x372804['status'](_0x4ac36a);return _0x372804['set'](_0xa7c7('0x23'),_0x244e2d+'-'+_0x5e21a4+'/'+_0x4566c6)['json'](_0x29cb3a);}return null;};}function patchUpdates(_0x224937){return function(_0x4f7a6e){try{jsonpatch[_0xa7c7('0x24')](_0x4f7a6e,_0x224937,!![]);}catch(_0x35fa9c){return BPromise['reject'](_0x35fa9c);}return _0x4f7a6e[_0xa7c7('0x25')]();};}function saveUpdates(_0xfde5ef,_0x3ab4bc){return function(_0x51a92a){if(_0x51a92a){return _0x51a92a[_0xa7c7('0x26')](_0xfde5ef)['then'](function(_0x23999f){return _0x23999f;});}return null;};}function removeEntity(_0xbb5243,_0xb925c6){return function(_0x2c906b){if(_0x2c906b){return _0x2c906b[_0xa7c7('0x27')]()[_0xa7c7('0x28')](function(){_0xbb5243[_0xa7c7('0x1d')](0xcc)[_0xa7c7('0x1e')]();});}};}function handleEntityNotFound(_0x2582e7,_0x4e79cb){return function(_0x2814ca){if(!_0x2814ca){_0x2582e7['sendStatus'](0x194);}return _0x2814ca;};}function handleError(_0x452f42,_0xbb86af){_0xbb86af=_0xbb86af||0x1f4;return function(_0x3634eb){logger['error'](_0x3634eb[_0xa7c7('0x29')]);if(_0x3634eb[_0xa7c7('0x2a')]){delete _0x3634eb['name'];}_0x452f42[_0xa7c7('0x1d')](_0xbb86af)['send'](_0x3634eb);};}exports[_0xa7c7('0x2b')]=function(_0x5f4df8,_0x3a6003){var _0x526d2f={},_0x44efc9={},_0x2cc831={'count':0x0,'rows':[]};var _0x23b66a=_[_0xa7c7('0x2c')](db[_0xa7c7('0x2d')]['rawAttributes'],function(_0x491487){return{'name':_0x491487[_0xa7c7('0x2e')],'type':_0x491487['type'][_0xa7c7('0x2f')]};});_0x44efc9[_0xa7c7('0x30')]=_[_0xa7c7('0x2c')](_0x23b66a,_0xa7c7('0x2a'));_0x44efc9[_0xa7c7('0x31')]=_['keys'](_0x5f4df8['query']);_0x44efc9[_0xa7c7('0x32')]=_[_0xa7c7('0x33')](_0x44efc9['model'],_0x44efc9[_0xa7c7('0x31')]);_0x526d2f[_0xa7c7('0x34')]=_[_0xa7c7('0x33')](_0x44efc9[_0xa7c7('0x30')],qs[_0xa7c7('0x35')](_0x5f4df8[_0xa7c7('0x31')][_0xa7c7('0x35')]));_0x526d2f['attributes']=_0x526d2f[_0xa7c7('0x34')][_0xa7c7('0x36')]?_0x526d2f[_0xa7c7('0x34')]:_0x44efc9[_0xa7c7('0x30')];if(!_0x5f4df8[_0xa7c7('0x31')][_0xa7c7('0x37')](_0xa7c7('0x38'))){_0x526d2f[_0xa7c7('0x22')]=qs['limit'](_0x5f4df8[_0xa7c7('0x31')][_0xa7c7('0x22')]);_0x526d2f[_0xa7c7('0x1f')]=qs[_0xa7c7('0x1f')](_0x5f4df8[_0xa7c7('0x31')][_0xa7c7('0x1f')]);}_0x526d2f[_0xa7c7('0x39')]=qs[_0xa7c7('0x3a')](_0x5f4df8[_0xa7c7('0x31')][_0xa7c7('0x3a')]);_0x526d2f[_0xa7c7('0x3b')]=qs[_0xa7c7('0x32')](_[_0xa7c7('0x3c')](_0x5f4df8['query'],_0x44efc9['filters']),_0x23b66a);if(_0x5f4df8['query'][_0xa7c7('0x3d')]){_0x526d2f[_0xa7c7('0x3b')]=_[_0xa7c7('0x3e')](_0x526d2f[_0xa7c7('0x3b')],{'$or':_['map'](_0x23b66a,function(_0x40e9c){if(_0x40e9c[_0xa7c7('0x3f')]!=='VIRTUAL'){var _0x12f974={};_0x12f974[_0x40e9c['name']]={'$like':'%'+_0x5f4df8[_0xa7c7('0x31')]['filter']+'%'};return _0x12f974;}})});}_0x526d2f=_[_0xa7c7('0x3e')]({},_0x526d2f,_0x5f4df8[_0xa7c7('0x40')]);var _0x39ad6d={'where':_0x526d2f[_0xa7c7('0x3b')]};return db['CmHopperBlack'][_0xa7c7('0x21')](_0x39ad6d)[_0xa7c7('0x28')](function(_0x31678b){_0x2cc831[_0xa7c7('0x21')]=_0x31678b;if(_0x5f4df8[_0xa7c7('0x31')]['includeAll']){_0x526d2f[_0xa7c7('0x41')]=[{'all':!![]}];}return db[_0xa7c7('0x2d')][_0xa7c7('0x42')](_0x526d2f);})[_0xa7c7('0x28')](function(_0x3c4c26){_0x2cc831['rows']=_0x3c4c26;return _0x2cc831;})[_0xa7c7('0x28')](respondWithFilteredResult(_0x3a6003,_0x526d2f))[_0xa7c7('0x43')](handleError(_0x3a6003,null));};exports[_0xa7c7('0x44')]=function(_0x1c760a,_0x26c43d){var _0x2868ff={'raw':!![],'where':{'id':_0x1c760a['params']['id']}},_0x46d2e6={};_0x46d2e6['model']=_[_0xa7c7('0x45')](db['CmHopperBlack'][_0xa7c7('0x46')]);_0x46d2e6[_0xa7c7('0x31')]=_[_0xa7c7('0x45')](_0x1c760a[_0xa7c7('0x31')]);_0x46d2e6[_0xa7c7('0x32')]=_[_0xa7c7('0x33')](_0x46d2e6[_0xa7c7('0x30')],_0x46d2e6[_0xa7c7('0x31')]);_0x2868ff[_0xa7c7('0x34')]=_[_0xa7c7('0x33')](_0x46d2e6['model'],qs[_0xa7c7('0x35')](_0x1c760a['query'][_0xa7c7('0x35')]));_0x2868ff[_0xa7c7('0x34')]=_0x2868ff[_0xa7c7('0x34')][_0xa7c7('0x36')]?_0x2868ff[_0xa7c7('0x34')]:_0x46d2e6['model'];if(_0x1c760a['query']['includeAll']){_0x2868ff[_0xa7c7('0x41')]=[{'all':!![]}];}_0x2868ff=_[_0xa7c7('0x3e')]({},_0x2868ff,_0x1c760a[_0xa7c7('0x40')]);return db[_0xa7c7('0x2d')][_0xa7c7('0x47')](_0x2868ff)[_0xa7c7('0x28')](handleEntityNotFound(_0x26c43d,null))['then'](respondWithResult(_0x26c43d,null))[_0xa7c7('0x43')](handleError(_0x26c43d,null));};exports[_0xa7c7('0x26')]=function(_0x3d6d5b,_0x541105){if(_0x3d6d5b[_0xa7c7('0x48')]['id']){delete _0x3d6d5b[_0xa7c7('0x48')]['id'];}return db[_0xa7c7('0x2d')][_0xa7c7('0x47')]({'where':{'id':_0x3d6d5b['params']['id']}})['then'](handleEntityNotFound(_0x541105,null))[_0xa7c7('0x28')](saveUpdates(_0x3d6d5b[_0xa7c7('0x48')],null))[_0xa7c7('0x28')](respondWithResult(_0x541105,null))[_0xa7c7('0x43')](handleError(_0x541105,null));};exports[_0xa7c7('0x27')]=function(_0x48d739,_0x4736aa){return db['CmHopperBlack'][_0xa7c7('0x47')]({'where':{'id':_0x48d739[_0xa7c7('0x49')]['id']}})['then'](handleEntityNotFound(_0x4736aa,null))['then'](removeEntity(_0x4736aa,null))[_0xa7c7('0x43')](handleError(_0x4736aa,null));};exports[_0xa7c7('0x4a')]=function(_0xd220f8,_0x507c96){return db[_0xa7c7('0x2d')][_0xa7c7('0x4a')]()[_0xa7c7('0x28')](respondWithResult(_0x507c96,null))[_0xa7c7('0x43')](handleError(_0x507c96,null));}; \ No newline at end of file +var _0x39bd=['sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','intersection','find','catch','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5eb7d2,_0x3327a4){var _0x6d7f92=function(_0x225660){while(--_0x225660){_0x5eb7d2['push'](_0x5eb7d2['shift']());}};_0x6d7f92(++_0x3327a4);}(_0x39bd,0x7c));var _0xd39b=function(_0x367d24,_0x309534){_0x367d24=_0x367d24-0x0;var _0x4432d9=_0x39bd[_0x367d24];return _0x4432d9;};'use strict';var emlformat=require(_0xd39b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd39b('0x1'));var rp=require('request-promise');var moment=require(_0xd39b('0x2'));var BPromise=require(_0xd39b('0x3'));var Mustache=require(_0xd39b('0x4'));var util=require(_0xd39b('0x5'));var path=require(_0xd39b('0x6'));var sox=require(_0xd39b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd39b('0x8'));var _=require(_0xd39b('0x9'));var squel=require(_0xd39b('0xa'));var crypto=require(_0xd39b('0xb'));var jsforce=require(_0xd39b('0xc'));var deskjs=require(_0xd39b('0xd'));var toCsv=require(_0xd39b('0xe'));var querystring=require('querystring');var Papa=require(_0xd39b('0xf'));var Redis=require(_0xd39b('0x10'));var authService=require(_0xd39b('0x11'));var qs=require(_0xd39b('0x12'));var as=require(_0xd39b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd39b('0x14'))(_0xd39b('0x15'));var utils=require(_0xd39b('0x16'));var config=require(_0xd39b('0x17'));var licenseUtil=require(_0xd39b('0x18'));var db=require(_0xd39b('0x19'))['db'];function respondWithStatusCode(_0x1c41d6,_0x33ba97){_0x33ba97=_0x33ba97||0xcc;return function(_0x35c576){if(_0x35c576){return _0x1c41d6[_0xd39b('0x1a')](_0x33ba97);}return _0x1c41d6[_0xd39b('0x1b')](_0x33ba97)['end']();};}function respondWithResult(_0x51ade2,_0x4d12b9){_0x4d12b9=_0x4d12b9||0xc8;return function(_0x2af409){if(_0x2af409){return _0x51ade2['status'](_0x4d12b9)['json'](_0x2af409);}};}function respondWithFilteredResult(_0x55b3ba,_0x341d60){return function(_0x2def47){if(_0x2def47){var _0x13db19=typeof _0x341d60['offset']===_0xd39b('0x1c')&&typeof _0x341d60[_0xd39b('0x1d')]===_0xd39b('0x1c');var _0x3407d3=_0x2def47['count'];var _0x3921ad=_0x13db19?0x0:_0x341d60[_0xd39b('0x1e')];var _0x13d83c=_0x13db19?_0x2def47['count']:_0x341d60[_0xd39b('0x1e')]+_0x341d60['limit'];var _0x96732c;if(_0x13d83c>=_0x3407d3){_0x13d83c=_0x3407d3;_0x96732c=0xc8;}else{_0x96732c=0xce;}_0x55b3ba['status'](_0x96732c);return _0x55b3ba[_0xd39b('0x1f')](_0xd39b('0x20'),_0x3921ad+'-'+_0x13d83c+'/'+_0x3407d3)[_0xd39b('0x21')](_0x2def47);}return null;};}function patchUpdates(_0x995406){return function(_0x5a2cd6){try{jsonpatch[_0xd39b('0x22')](_0x5a2cd6,_0x995406,!![]);}catch(_0x5a0d5b){return BPromise[_0xd39b('0x23')](_0x5a0d5b);}return _0x5a2cd6[_0xd39b('0x24')]();};}function saveUpdates(_0x243657,_0x4d947c){return function(_0x21d108){if(_0x21d108){return _0x21d108[_0xd39b('0x25')](_0x243657)[_0xd39b('0x26')](function(_0x10950a){return _0x10950a;});}return null;};}function removeEntity(_0x5092ad,_0x1f3c93){return function(_0x5949bb){if(_0x5949bb){return _0x5949bb[_0xd39b('0x27')]()[_0xd39b('0x26')](function(){_0x5092ad[_0xd39b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a54a,_0x5d2ac5){return function(_0x240567){if(!_0x240567){_0x46a54a['sendStatus'](0x194);}return _0x240567;};}function handleError(_0x14c18c,_0x405558){_0x405558=_0x405558||0x1f4;return function(_0x2a2fc0){logger[_0xd39b('0x28')](_0x2a2fc0['stack']);if(_0x2a2fc0[_0xd39b('0x29')]){delete _0x2a2fc0[_0xd39b('0x29')];}_0x14c18c[_0xd39b('0x1b')](_0x405558)['send'](_0x2a2fc0);};}exports[_0xd39b('0x2a')]=function(_0x109eca,_0x3d1a41){var _0x3dff89={},_0x71270f={},_0x36cafd={'count':0x0,'rows':[]};var _0x272bfc=_[_0xd39b('0x2b')](db[_0xd39b('0x2c')][_0xd39b('0x2d')],function(_0x1d0f1b){return{'name':_0x1d0f1b[_0xd39b('0x2e')],'type':_0x1d0f1b['type'][_0xd39b('0x2f')]};});_0x71270f[_0xd39b('0x30')]=_['map'](_0x272bfc,_0xd39b('0x29'));_0x71270f['query']=_[_0xd39b('0x31')](_0x109eca[_0xd39b('0x32')]);_0x71270f[_0xd39b('0x33')]=_['intersection'](_0x71270f['model'],_0x71270f[_0xd39b('0x32')]);_0x3dff89[_0xd39b('0x34')]=_['intersection'](_0x71270f[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x35')]));_0x3dff89['attributes']=_0x3dff89[_0xd39b('0x34')][_0xd39b('0x36')]?_0x3dff89['attributes']:_0x71270f['model'];if(!_0x109eca['query']['hasOwnProperty'](_0xd39b('0x37'))){_0x3dff89[_0xd39b('0x1d')]=qs[_0xd39b('0x1d')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x1d')]);_0x3dff89[_0xd39b('0x1e')]=qs[_0xd39b('0x1e')](_0x109eca[_0xd39b('0x32')]['offset']);}_0x3dff89[_0xd39b('0x38')]=qs[_0xd39b('0x39')](_0x109eca[_0xd39b('0x32')]['sort']);_0x3dff89[_0xd39b('0x3a')]=qs[_0xd39b('0x33')](_['pick'](_0x109eca['query'],_0x71270f['filters']),_0x272bfc);if(_0x109eca['query'][_0xd39b('0x3b')]){_0x3dff89[_0xd39b('0x3a')]=_[_0xd39b('0x3c')](_0x3dff89[_0xd39b('0x3a')],{'$or':_[_0xd39b('0x2b')](_0x272bfc,function(_0x322f49){if(_0x322f49[_0xd39b('0x3d')]!==_0xd39b('0x3e')){var _0x533905={};_0x533905[_0x322f49[_0xd39b('0x29')]]={'$like':'%'+_0x109eca[_0xd39b('0x32')]['filter']+'%'};return _0x533905;}})});}_0x3dff89=_[_0xd39b('0x3c')]({},_0x3dff89,_0x109eca['options']);var _0x9cb3a6={'where':_0x3dff89[_0xd39b('0x3a')]};return db[_0xd39b('0x2c')][_0xd39b('0x3f')](_0x9cb3a6)['then'](function(_0x3a4567){_0x36cafd[_0xd39b('0x3f')]=_0x3a4567;if(_0x109eca[_0xd39b('0x32')][_0xd39b('0x40')]){_0x3dff89[_0xd39b('0x41')]=[{'all':!![]}];}return db[_0xd39b('0x2c')][_0xd39b('0x42')](_0x3dff89);})[_0xd39b('0x26')](function(_0xd083ad){_0x36cafd[_0xd39b('0x43')]=_0xd083ad;return _0x36cafd;})[_0xd39b('0x26')](respondWithFilteredResult(_0x3d1a41,_0x3dff89))['catch'](handleError(_0x3d1a41,null));};exports[_0xd39b('0x44')]=function(_0x2657f5,_0x487c75){var _0x35ab7f={'raw':!![],'where':{'id':_0x2657f5['params']['id']}},_0x49f112={};_0x49f112['model']=_['keys'](db[_0xd39b('0x2c')][_0xd39b('0x2d')]);_0x49f112[_0xd39b('0x32')]=_[_0xd39b('0x31')](_0x2657f5[_0xd39b('0x32')]);_0x49f112[_0xd39b('0x33')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],_0x49f112[_0xd39b('0x32')]);_0x35ab7f[_0xd39b('0x34')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x2657f5['query'][_0xd39b('0x35')]));_0x35ab7f[_0xd39b('0x34')]=_0x35ab7f[_0xd39b('0x34')][_0xd39b('0x36')]?_0x35ab7f[_0xd39b('0x34')]:_0x49f112[_0xd39b('0x30')];if(_0x2657f5[_0xd39b('0x32')][_0xd39b('0x40')]){_0x35ab7f[_0xd39b('0x41')]=[{'all':!![]}];}_0x35ab7f=_[_0xd39b('0x3c')]({},_0x35ab7f,_0x2657f5['options']);return db[_0xd39b('0x2c')][_0xd39b('0x46')](_0x35ab7f)[_0xd39b('0x26')](handleEntityNotFound(_0x487c75,null))[_0xd39b('0x26')](respondWithResult(_0x487c75,null))[_0xd39b('0x47')](handleError(_0x487c75,null));};exports[_0xd39b('0x25')]=function(_0x2f2db1,_0x189ba8){if(_0x2f2db1['body']['id']){delete _0x2f2db1[_0xd39b('0x48')]['id'];}return db[_0xd39b('0x2c')]['find']({'where':{'id':_0x2f2db1[_0xd39b('0x49')]['id']}})[_0xd39b('0x26')](handleEntityNotFound(_0x189ba8,null))[_0xd39b('0x26')](saveUpdates(_0x2f2db1[_0xd39b('0x48')],null))[_0xd39b('0x26')](respondWithResult(_0x189ba8,null))[_0xd39b('0x47')](handleError(_0x189ba8,null));};exports[_0xd39b('0x27')]=function(_0x3e9f07,_0x34e74c){return db['CmHopperBlack'][_0xd39b('0x46')]({'where':{'id':_0x3e9f07[_0xd39b('0x49')]['id']}})[_0xd39b('0x26')](handleEntityNotFound(_0x34e74c,null))[_0xd39b('0x26')](removeEntity(_0x34e74c,null))[_0xd39b('0x47')](handleError(_0x34e74c,null));};exports[_0xd39b('0x4a')]=function(_0x3a8d4c,_0x3552f4){return db['CmHopperBlack'][_0xd39b('0x4a')]()[_0xd39b('0x26')](respondWithResult(_0x3552f4,null))[_0xd39b('0x47')](handleError(_0x3552f4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 42b8e1d..03e76b3 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 _0xbbb5=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define'];(function(_0xbb4d87,_0x2b5f49){var _0x250d61=function(_0x4a3bd6){while(--_0x4a3bd6){_0xbb4d87['push'](_0xbb4d87['shift']());}};_0x250d61(++_0x2b5f49);}(_0xbbb5,0x92));var _0x5bbb=function(_0xb98dca,_0x4621b5){_0xb98dca=_0xb98dca-0x0;var _0xc3f08d=_0xbbb5[_0xb98dca];return _0xc3f08d;};'use strict';var _=require(_0x5bbb('0x0'));var util=require(_0x5bbb('0x1'));var logger=require(_0x5bbb('0x2'))('api');var moment=require(_0x5bbb('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bbb('0x4'));var fs=require('fs');var path=require(_0x5bbb('0x5'));var rimraf=require(_0x5bbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x5bbb('0x7'));module[_0x5bbb('0x8')]=function(_0x33ae04,_0x17c7d3){return _0x33ae04[_0x5bbb('0x9')](_0x5bbb('0xa'),attributes,{'tableName':_0x5bbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd8f=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api'];(function(_0x4c7f57,_0x259bba){var _0x30b8e3=function(_0x88bb69){while(--_0x88bb69){_0x4c7f57['push'](_0x4c7f57['shift']());}};_0x30b8e3(++_0x259bba);}(_0xbd8f,0xc0));var _0xfbd8=function(_0x3f9a64,_0x224930){_0x3f9a64=_0x3f9a64-0x0;var _0x353b88=_0xbd8f[_0x3f9a64];return _0x353b88;};'use strict';var _=require(_0xfbd8('0x0'));var util=require(_0xfbd8('0x1'));var logger=require('../../config/logger')(_0xfbd8('0x2'));var moment=require(_0xfbd8('0x3'));var BPromise=require(_0xfbd8('0x4'));var rp=require(_0xfbd8('0x5'));var fs=require('fs');var path=require(_0xfbd8('0x6'));var rimraf=require(_0xfbd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xfbd8('0x8'));module[_0xfbd8('0x9')]=function(_0x591c2f,_0x47c840){return _0x591c2f[_0xfbd8('0xa')](_0xfbd8('0xb'),attributes,{'tableName':_0xfbd8('0xc'),'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 63d1655..cf1cce8 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 _0xba71=['options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','body','stringify','DestroyCmHopperBlack','CmHopperBlack','destroy','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopperBlack'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0xba71,0x15c));var _0x1ba7=function(_0x5dcce2,_0x420f67){_0x5dcce2=_0x5dcce2-0x0;var _0x3744c6=_0xba71[_0x5dcce2];return _0x3744c6;};'use strict';var _=require('lodash');var util=require(_0x1ba7('0x0'));var moment=require(_0x1ba7('0x1'));var BPromise=require(_0x1ba7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ba7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ba7('0x4'));var logger=require(_0x1ba7('0x5'))(_0x1ba7('0x6'));var config=require('../../config/environment');var jayson=require(_0x1ba7('0x7'));var client=jayson[_0x1ba7('0x8')][_0x1ba7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x402348,_0x2799e5,_0x4bb049){return new BPromise(function(_0x58a1b1,_0x34d3c1){return client[_0x1ba7('0xa')](_0x402348,_0x4bb049)[_0x1ba7('0xb')](function(_0x27f5ca){logger['info'](_0x1ba7('0xc'),_0x2799e5,_0x1ba7('0xd'));logger['debug'](_0x1ba7('0xe'),_0x2799e5,'request\x20sent',JSON['stringify'](_0x27f5ca));if(_0x27f5ca[_0x1ba7('0xf')]){if(_0x27f5ca['error'][_0x1ba7('0x10')]===0x1f4){logger[_0x1ba7('0xf')](_0x1ba7('0xc'),_0x2799e5,_0x27f5ca[_0x1ba7('0xf')][_0x1ba7('0x11')]);return _0x34d3c1(_0x27f5ca[_0x1ba7('0xf')][_0x1ba7('0x11')]);}logger[_0x1ba7('0xf')](_0x1ba7('0xc'),_0x2799e5,_0x27f5ca['error'][_0x1ba7('0x11')]);return _0x58a1b1(_0x27f5ca[_0x1ba7('0xf')][_0x1ba7('0x11')]);}else{logger[_0x1ba7('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2799e5,'request\x20sent');_0x58a1b1(_0x27f5ca[_0x1ba7('0x13')][_0x1ba7('0x11')]);}})[_0x1ba7('0x14')](function(_0x3a5280){logger[_0x1ba7('0xf')](_0x1ba7('0xc'),_0x2799e5,_0x3a5280);_0x34d3c1(_0x3a5280);});});}exports[_0x1ba7('0x15')]=function(_0x42a3d3){var _0x1f6e22=this;return new Promise(function(_0x2e378c,_0x4f9157){return db['CmHopperBlack']['findAll']({'raw':_0x42a3d3['options']?_0x42a3d3[_0x1ba7('0x16')][_0x1ba7('0x17')]===undefined?!![]:![]:!![],'where':_0x42a3d3[_0x1ba7('0x16')]?_0x42a3d3[_0x1ba7('0x16')][_0x1ba7('0x18')]||null:null,'attributes':_0x42a3d3[_0x1ba7('0x16')]?_0x42a3d3['options'][_0x1ba7('0x19')]||null:null,'limit':_0x42a3d3[_0x1ba7('0x16')]?_0x42a3d3[_0x1ba7('0x16')][_0x1ba7('0x1a')]||null:null,'include':_0x42a3d3['options']?_0x42a3d3[_0x1ba7('0x16')][_0x1ba7('0x1b')]?_['map'](_0x42a3d3[_0x1ba7('0x16')][_0x1ba7('0x1b')],function(_0x360b2a){return{'model':db[_0x360b2a['model']],'as':_0x360b2a['as'],'attributes':_0x360b2a['attributes'],'include':_0x360b2a[_0x1ba7('0x1b')]?_[_0x1ba7('0x1c')](_0x360b2a[_0x1ba7('0x1b')],function(_0x314ffe){return{'model':db[_0x314ffe[_0x1ba7('0x1d')]],'as':_0x314ffe['as'],'attributes':_0x314ffe[_0x1ba7('0x19')],'include':_0x314ffe['include']?_[_0x1ba7('0x1c')](_0x314ffe[_0x1ba7('0x1b')],function(_0x7a5265){return{'model':db[_0x7a5265[_0x1ba7('0x1d')]],'as':_0x7a5265['as'],'attributes':_0x7a5265[_0x1ba7('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9fa86a){logger['info']('GetCmHopperBlack',_0x42a3d3);logger[_0x1ba7('0x1e')]('GetCmHopperBlack',_0x42a3d3,JSON['stringify'](_0x9fa86a));_0x2e378c(_0x9fa86a);})['catch'](function(_0x44c688){logger['error'](_0x1ba7('0x15'),_0x44c688[_0x1ba7('0x11')],_0x42a3d3);_0x4f9157(_0x1f6e22['error'](0x1f4,_0x44c688['message']));});});};exports[_0x1ba7('0x1f')]=function(_0x33693e){var _0x4bbcef=this;return new Promise(function(_0xf55404,_0x3b4a52){return db['CmHopperBlack']['update'](_0x33693e[_0x1ba7('0x20')],{'raw':_0x33693e[_0x1ba7('0x16')]?_0x33693e[_0x1ba7('0x16')][_0x1ba7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33693e[_0x1ba7('0x16')]?_0x33693e[_0x1ba7('0x16')][_0x1ba7('0x18')]||null:null,'attributes':_0x33693e[_0x1ba7('0x16')]?_0x33693e[_0x1ba7('0x16')][_0x1ba7('0x19')]||null:null,'limit':_0x33693e['options']?_0x33693e[_0x1ba7('0x16')][_0x1ba7('0x1a')]||null:null})[_0x1ba7('0xb')](function(_0x494751){logger[_0x1ba7('0x12')](_0x1ba7('0x1f'),_0x33693e);logger[_0x1ba7('0x1e')](_0x1ba7('0x1f'),_0x33693e,JSON[_0x1ba7('0x21')](_0x494751));_0xf55404(_0x494751);})[_0x1ba7('0x14')](function(_0x5db2fb){logger['error'](_0x1ba7('0x1f'),_0x5db2fb[_0x1ba7('0x11')],_0x33693e);_0x3b4a52(_0x4bbcef['error'](0x1f4,_0x5db2fb['message']));});});};exports[_0x1ba7('0x22')]=function(_0x2e7081){var _0x5836c5=this;return new Promise(function(_0x4722e2,_0x52571a){return db[_0x1ba7('0x23')][_0x1ba7('0x24')]({'where':_0x2e7081[_0x1ba7('0x16')]?_0x2e7081[_0x1ba7('0x16')][_0x1ba7('0x18')]||null:null})[_0x1ba7('0xb')](function(_0xfb0b6d){logger[_0x1ba7('0x12')]('DestroyCmHopperBlack',_0x2e7081);logger['debug']('DestroyCmHopperBlack',_0x2e7081,JSON['stringify'](_0xfb0b6d));_0x4722e2(_0xfb0b6d);})[_0x1ba7('0x14')](function(_0x4541c6){logger[_0x1ba7('0xf')](_0x1ba7('0x22'),_0x4541c6[_0x1ba7('0x11')],_0x2e7081);_0x52571a(_0x5836c5[_0x1ba7('0xf')](0x1f4,_0x4541c6[_0x1ba7('0x11')]));});});}; \ No newline at end of file +var _0x8e36=['map','include','model','attributes','then','debug','UpdateCmHopperBlack','CmHopperBlack','raw','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','options','where'];(function(_0x32a0bb,_0x21b192){var _0x40b1f8=function(_0x2d84c4){while(--_0x2d84c4){_0x32a0bb['push'](_0x32a0bb['shift']());}};_0x40b1f8(++_0x21b192);}(_0x8e36,0x1ed));var _0x68e3=function(_0x5a5c76,_0x201fd6){_0x5a5c76=_0x5a5c76-0x0;var _0x2f800e=_0x8e36[_0x5a5c76];return _0x2f800e;};'use strict';var _=require(_0x68e3('0x0'));var util=require(_0x68e3('0x1'));var moment=require(_0x68e3('0x2'));var BPromise=require(_0x68e3('0x3'));var rs=require(_0x68e3('0x4'));var fs=require('fs');var Redis=require(_0x68e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x68e3('0x6'));var logger=require(_0x68e3('0x7'))(_0x68e3('0x8'));var config=require(_0x68e3('0x9'));var jayson=require(_0x68e3('0xa'));var client=jayson['client'][_0x68e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106346,_0x13ba03,_0x2ec115){return new BPromise(function(_0x3cde24,_0x5ae712){return client['request'](_0x106346,_0x2ec115)['then'](function(_0x1fff91){logger['info'](_0x68e3('0xc'),_0x13ba03,_0x68e3('0xd'));logger['debug'](_0x68e3('0xe'),_0x13ba03,_0x68e3('0xd'),JSON[_0x68e3('0xf')](_0x1fff91));if(_0x1fff91[_0x68e3('0x10')]){if(_0x1fff91[_0x68e3('0x10')][_0x68e3('0x11')]===0x1f4){logger[_0x68e3('0x10')](_0x68e3('0xc'),_0x13ba03,_0x1fff91[_0x68e3('0x10')][_0x68e3('0x12')]);return _0x5ae712(_0x1fff91[_0x68e3('0x10')]['message']);}logger[_0x68e3('0x10')](_0x68e3('0xc'),_0x13ba03,_0x1fff91[_0x68e3('0x10')]['message']);return _0x3cde24(_0x1fff91[_0x68e3('0x10')][_0x68e3('0x12')]);}else{logger[_0x68e3('0x13')](_0x68e3('0xc'),_0x13ba03,_0x68e3('0xd'));_0x3cde24(_0x1fff91[_0x68e3('0x14')]['message']);}})[_0x68e3('0x15')](function(_0x16f680){logger['error'](_0x68e3('0xc'),_0x13ba03,_0x16f680);_0x5ae712(_0x16f680);});});}exports[_0x68e3('0x16')]=function(_0xd7a41e){var _0xfe3135=this;return new Promise(function(_0xc560a,_0x3a3239){return db['CmHopperBlack']['findAll']({'raw':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xd7a41e['options']?_0xd7a41e[_0x68e3('0x17')][_0x68e3('0x18')]||null:null,'attributes':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['attributes']||null:null,'limit':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e['options']['limit']||null:null,'include':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['include']?_[_0x68e3('0x19')](_0xd7a41e[_0x68e3('0x17')][_0x68e3('0x1a')],function(_0x1f938c){return{'model':db[_0x1f938c[_0x68e3('0x1b')]],'as':_0x1f938c['as'],'attributes':_0x1f938c['attributes'],'include':_0x1f938c[_0x68e3('0x1a')]?_[_0x68e3('0x19')](_0x1f938c['include'],function(_0x3a4714){return{'model':db[_0x3a4714['model']],'as':_0x3a4714['as'],'attributes':_0x3a4714[_0x68e3('0x1c')],'include':_0x3a4714[_0x68e3('0x1a')]?_[_0x68e3('0x19')](_0x3a4714['include'],function(_0x1f3633){return{'model':db[_0x1f3633['model']],'as':_0x1f3633['as'],'attributes':_0x1f3633[_0x68e3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68e3('0x1d')](function(_0x5509b3){logger[_0x68e3('0x13')]('GetCmHopperBlack',_0xd7a41e);logger[_0x68e3('0x1e')](_0x68e3('0x16'),_0xd7a41e,JSON[_0x68e3('0xf')](_0x5509b3));_0xc560a(_0x5509b3);})[_0x68e3('0x15')](function(_0x5436be){logger[_0x68e3('0x10')]('GetCmHopperBlack',_0x5436be['message'],_0xd7a41e);_0x3a3239(_0xfe3135[_0x68e3('0x10')](0x1f4,_0x5436be['message']));});});};exports[_0x68e3('0x1f')]=function(_0xdbe496){var _0x2caa62=this;return new Promise(function(_0x4d20c1,_0x101648){return db[_0x68e3('0x20')]['update'](_0xdbe496['body'],{'raw':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x18')]||null:null,'attributes':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x1c')]||null:null,'limit':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x22')]||null:null})['then'](function(_0x208444){logger['info']('UpdateCmHopperBlack',_0xdbe496);logger[_0x68e3('0x1e')](_0x68e3('0x1f'),_0xdbe496,JSON[_0x68e3('0xf')](_0x208444));_0x4d20c1(_0x208444);})[_0x68e3('0x15')](function(_0x5b7b0b){logger[_0x68e3('0x10')]('UpdateCmHopperBlack',_0x5b7b0b[_0x68e3('0x12')],_0xdbe496);_0x101648(_0x2caa62['error'](0x1f4,_0x5b7b0b[_0x68e3('0x12')]));});});};exports[_0x68e3('0x23')]=function(_0x539d46){var _0x19707d=this;return new Promise(function(_0x38584a,_0x4cb714){return db[_0x68e3('0x20')][_0x68e3('0x24')]({'where':_0x539d46[_0x68e3('0x17')]?_0x539d46[_0x68e3('0x17')]['where']||null:null})[_0x68e3('0x1d')](function(_0x184fc9){logger[_0x68e3('0x13')](_0x68e3('0x23'),_0x539d46);logger[_0x68e3('0x1e')](_0x68e3('0x23'),_0x539d46,JSON[_0x68e3('0xf')](_0x184fc9));_0x38584a(_0x184fc9);})[_0x68e3('0x15')](function(_0x57dd9e){logger[_0x68e3('0x10')]('DestroyCmHopperBlack',_0x57dd9e[_0x68e3('0x12')],_0x539d46);_0x4cb714(_0x19707d[_0x68e3('0x10')](0x1f4,_0x57dd9e[_0x68e3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2f072f8..37d2dc0 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 _0xed1c=['describe','/:id','show','put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x3afc5a,_0x46f71a){var _0x1a8a60=function(_0x3cfb55){while(--_0x3cfb55){_0x3afc5a['push'](_0x3afc5a['shift']());}};_0x1a8a60(++_0x46f71a);}(_0xed1c,0xe4));var _0xced1=function(_0x551acc,_0x2e7f27){_0x551acc=_0x551acc-0x0;var _0x8219cc=_0xed1c[_0x551acc];return _0x8219cc;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/:id',auth[_0xced1('0x7')](),controller['update']);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);module[_0xced1('0x10')]=router; \ No newline at end of file +var _0x7b84=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7b84,0x17c));var _0x47b8=function(_0x5ba06c,_0x3b6312){_0x5ba06c=_0x5ba06c-0x0;var _0x8e1e71=_0x7b84[_0x5ba06c];return _0x8e1e71;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);module[_0x47b8('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 240ef74..0fb6bb8 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 _0x9d0f=['sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9d0f,0x104));var _0xf9d0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9d0f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf9d0('0x0'));var moment=require(_0xf9d0('0x1'));module[_0xf9d0('0x2')]={'state':{'type':Sequelize[_0xf9d0('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xf9d0('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf9d0('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf9d0('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf9d0('0x4')]},'calleridnum':{'type':Sequelize[_0xf9d0('0x4')]},'calleridname':{'type':Sequelize[_0xf9d0('0x4')]},'starttime':{'type':Sequelize[_0xf9d0('0x5')]},'responsetime':{'type':Sequelize[_0xf9d0('0x5')]},'answertime':{'type':Sequelize[_0xf9d0('0x5')]},'droptime':{'type':Sequelize[_0xf9d0('0x5')]},'endtime':{'type':Sequelize[_0xf9d0('0x5')]},'ringtime':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf9d0('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf9d0('0x4')]},'membername':{'type':Sequelize[_0xf9d0('0x4')]},'reason':{'type':Sequelize[_0xf9d0('0x4')]},'disposition':{'type':Sequelize[_0xf9d0('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xc305bf){var _0x476442=this['getDataValue'](_0xf9d0('0x6'));if(_0x476442&&_0xc305bf){this[_0xf9d0('0x7')](_0xf9d0('0x8'),moment(_0xc305bf)[_0xf9d0('0x9')](moment(_0x476442),_0xf9d0('0xa')));}return this[_0xf9d0('0x7')](_0xf9d0('0xb'),_0xc305bf);}},'amd':{'type':Sequelize[_0xf9d0('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf9d0('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf9d0('0x5')]},'callback':{'type':Sequelize[_0xf9d0('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf9d0('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf9d0('0x5')]},'deleted':{'type':Sequelize[_0xf9d0('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xf9d0('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf9d0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x345b=['exports','INTEGER','STRING','DATE','endtime','setDataValue','diff','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x29efbb,_0x293036){var _0x4b1456=function(_0x32ff20){while(--_0x32ff20){_0x29efbb['push'](_0x29efbb['shift']());}};_0x4b1456(++_0x293036);}(_0x345b,0x98));var _0xb345=function(_0x3162d8,_0x4003e2){_0x3162d8=_0x3162d8-0x0;var _0x2a0d90=_0x345b[_0x3162d8];return _0x2a0d90;};'use strict';var Sequelize=require(_0xb345('0x0'));var moment=require(_0xb345('0x1'));module[_0xb345('0x2')]={'state':{'type':Sequelize[_0xb345('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xb345('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb345('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb345('0x4')]},'calleridnum':{'type':Sequelize[_0xb345('0x4')]},'calleridname':{'type':Sequelize[_0xb345('0x4')]},'starttime':{'type':Sequelize[_0xb345('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb345('0x5')]},'droptime':{'type':Sequelize[_0xb345('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb345('0x4')]},'campaign':{'type':Sequelize[_0xb345('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb345('0x4')]},'reason':{'type':Sequelize[_0xb345('0x4')]},'disposition':{'type':Sequelize[_0xb345('0x4')]},'secondDisposition':{'type':Sequelize[_0xb345('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb345('0x4')]},'dispositionat':{'type':Sequelize[_0xb345('0x5')],'set':function(_0x49838f){var _0x528b92=this['getDataValue'](_0xb345('0x6'));if(_0x528b92&&_0x49838f){this[_0xb345('0x7')]('followuptime',moment(_0x49838f)[_0xb345('0x8')](moment(_0x528b92),'seconds'));}return this[_0xb345('0x7')](_0xb345('0x9'),_0x49838f);}},'amd':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb345('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xb345('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb345('0x5')]},'recallme':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb345('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 a4800ce..d15869f 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 _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x174b6a,_0x4b67a3){var _0x43a659=function(_0x2959e9){while(--_0x2959e9){_0x174b6a['push'](_0x174b6a['shift']());}};_0x43a659(++_0x4b67a3);}(_0x5fab,0x177));var _0xb5fa=function(_0x123df5,_0x5a535b){_0x123df5=_0x123df5-0x0;var _0x115fc5=_0x5fab[_0x123df5];return _0x115fc5;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file +var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x5ebd54,_0x928763){var _0x5f53f5=function(_0x380b5f){while(--_0x380b5f){_0x5ebd54['push'](_0x5ebd54['shift']());}};_0x5f53f5(++_0x928763);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index e1a56fc..b42a821 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 _0x5125=['moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api'];(function(_0xe5f9e6,_0x3bd6c6){var _0x3699aa=function(_0x22f29b){while(--_0x22f29b){_0xe5f9e6['push'](_0xe5f9e6['shift']());}};_0x3699aa(++_0x3bd6c6);}(_0x5125,0x15b));var _0x5512=function(_0x16b543,_0x489c8c){_0x16b543=_0x16b543-0x0;var _0x2b058c=_0x5125[_0x16b543];return _0x2b058c;};'use strict';var _=require(_0x5512('0x0'));var util=require(_0x5512('0x1'));var logger=require('../../config/logger')(_0x5512('0x2'));var moment=require(_0x5512('0x3'));var BPromise=require(_0x5512('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5512('0x5'));var rimraf=require(_0x5512('0x6'));var config=require(_0x5512('0x7'));var attributes=require(_0x5512('0x8'));module['exports']=function(_0x106aa2,_0xff0ca6){return _0x106aa2[_0x5512('0x9')](_0x5512('0xa'),attributes,{'tableName':_0x5512('0xb'),'paranoid':![],'indexes':[{'name':_0x5512('0xc'),'fields':[_0x5512('0xc')]},{'name':_0x5512('0xd'),'fields':[_0x5512('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24c9=['exports','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e6747,_0x3db877){var _0x154a35=function(_0x227ee0){while(--_0x227ee0){_0x2e6747['push'](_0x2e6747['shift']());}};_0x154a35(++_0x3db877);}(_0x24c9,0x1cc));var _0x924c=function(_0x470d7d,_0x3cfccb){_0x470d7d=_0x470d7d-0x0;var _0x2181b2=_0x24c9[_0x470d7d];return _0x2181b2;};'use strict';var _=require(_0x924c('0x0'));var util=require(_0x924c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x924c('0x2'));var BPromise=require(_0x924c('0x3'));var rp=require(_0x924c('0x4'));var fs=require('fs');var path=require(_0x924c('0x5'));var rimraf=require(_0x924c('0x6'));var config=require(_0x924c('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x924c('0x8')]=function(_0x5e1c79,_0x3d032c){return _0x5e1c79[_0x924c('0x9')](_0x924c('0xa'),attributes,{'tableName':_0x924c('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x924c('0xc'),'fields':[_0x924c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 21f85f2..d142fb3 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5eec26,_0x66763d){var _0x43855e=function(_0x178fd8){while(--_0x178fd8){_0x5eec26['push'](_0x5eec26['shift']());}};_0x43855e(++_0x66763d);}(_0xb10b,0x12a));var _0xbb10=function(_0x768458,_0x3d0933){_0x768458=_0x768458-0x0;var _0x31385c=_0xb10b[_0x768458];return _0x31385c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x555095,_0x5d32e8){var _0x13d776=function(_0x1396ba){while(--_0x1396ba){_0x555095['push'](_0x555095['shift']());}};_0x13d776(++_0x5d32e8);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab268,_0x146628){_0x5ab268=_0x5ab268-0x0;var _0x4b6c89=_0x7a54[_0x5ab268];return _0x4b6c89;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index b76b404..f255bac 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 _0x7af9=['util','path','connect-timeout','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','get','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x7af9,0x7c));var _0x97af=function(_0x26ede8,_0x217956){_0x26ede8=_0x26ede8-0x0;var _0x20dc58=_0x7af9[_0x26ede8];return _0x20dc58;};'use strict';var multer=require(_0x97af('0x0'));var util=require(_0x97af('0x1'));var path=require(_0x97af('0x2'));var timeout=require(_0x97af('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x97af('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x97af('0x5'));var config=require('../../config/environment');var controller=require(_0x97af('0x6'));router['get']('/',auth[_0x97af('0x7')](),controller[_0x97af('0x8')]);router['get'](_0x97af('0x9'),auth[_0x97af('0x7')](),controller[_0x97af('0xa')]);router[_0x97af('0xb')](_0x97af('0xc'),auth['isAuthenticated'](),controller[_0x97af('0xd')]);router[_0x97af('0xb')]('/voice/queue/countAttributes/:id',auth[_0x97af('0x7')](),controller[_0x97af('0xe')]);router['get'](_0x97af('0xf'),auth[_0x97af('0x7')](),controller[_0x97af('0x10')]);router[_0x97af('0x11')]('/voice/queue/moveContacts/:id',auth[_0x97af('0x7')](),controller[_0x97af('0x12')]);router[_0x97af('0x11')](_0x97af('0x13'),auth[_0x97af('0x7')](),controller[_0x97af('0x14')]);router[_0x97af('0x11')]('/checkContactHopper',auth[_0x97af('0x7')](),controller[_0x97af('0x15')]);router[_0x97af('0x16')]('/:id',auth[_0x97af('0x7')](),controller[_0x97af('0x17')]);module[_0x97af('0x18')]=router; \ No newline at end of file +var _0x32f4=['show','/voice/queue/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe'];(function(_0x177f03,_0x23208f){var _0x85dc43=function(_0x4e49ac){while(--_0x4e49ac){_0x177f03['push'](_0x177f03['shift']());}};_0x85dc43(++_0x23208f);}(_0x32f4,0x154));var _0x432f=function(_0x9cede6,_0x435984){_0x9cede6=_0x9cede6-0x0;var _0x48aa48=_0x32f4[_0x9cede6];return _0x48aa48;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0x9')](_0x432f('0xd'),auth[_0x432f('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x432f('0x9')]('/campaign/countAttributes/:id',auth[_0x432f('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x432f('0xe')](_0x432f('0xf'),auth['isAuthenticated'](),controller[_0x432f('0x10')]);router[_0x432f('0xe')]('/voice/campaign/moveContacts/:id',auth[_0x432f('0xa')](),controller[_0x432f('0x11')]);router['post']('/checkContactHopper',auth[_0x432f('0xa')](),controller[_0x432f('0x12')]);router[_0x432f('0x13')](_0x432f('0x14'),auth[_0x432f('0xa')](),controller['update']);module[_0x432f('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 162041b..344ac7a 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 _0xd86b=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2d4a77,_0x867c75){var _0x1c6908=function(_0x5f17f9){while(--_0x5f17f9){_0x2d4a77['push'](_0x2d4a77['shift']());}};_0x1c6908(++_0x867c75);}(_0xd86b,0xe5));var _0xbd86=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xd86b[_0x2652ef];return _0x2db578;};'use strict';var Sequelize=require(_0xbd86('0x0'));module[_0xbd86('0x1')]={'state':{'type':Sequelize[_0xbd86('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbd86('0x3')]},'scheduledat':{'type':Sequelize[_0xbd86('0x4')]},'countbusyretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xbd86('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbd86('0x3')]},'calleridnum':{'type':Sequelize[_0xbd86('0x3')]},'calleridname':{'type':Sequelize[_0xbd86('0x3')]},'starttime':{'type':Sequelize[_0xbd86('0x4')]},'responsetime':{'type':Sequelize[_0xbd86('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbd86('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbd86('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbd86('0x3')]},'membername':{'type':Sequelize[_0xbd86('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xbd86('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbd86('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbd86('0x4')]},'edited':{'type':Sequelize[_0xbd86('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbd86('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x722d=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3fb8f2,_0x282fc6){var _0x3fa5c6=function(_0xd503){while(--_0xd503){_0x3fb8f2['push'](_0x3fb8f2['shift']());}};_0x3fa5c6(++_0x282fc6);}(_0x722d,0x121));var _0xd722=function(_0x2f0bf1,_0x183ef1){_0x2f0bf1=_0x2f0bf1-0x0;var _0xf1df38=_0x722d[_0x2f0bf1];return _0xf1df38;};'use strict';var Sequelize=require(_0xd722('0x0'));module[_0xd722('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd722('0x2')]},'scheduledat':{'type':Sequelize[_0xd722('0x3')]},'countbusyretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd722('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd722('0x2')]},'calleridname':{'type':Sequelize[_0xd722('0x2')]},'starttime':{'type':Sequelize[_0xd722('0x3')]},'responsetime':{'type':Sequelize[_0xd722('0x3')]},'answertime':{'type':Sequelize[_0xd722('0x3')]},'droptime':{'type':Sequelize[_0xd722('0x3')]},'endtime':{'type':Sequelize[_0xd722('0x3')]},'ringtime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd722('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd722('0x2')]},'membername':{'type':Sequelize[_0xd722('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd722('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd722('0x3')]},'recallme':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd722('0x3')]},'edited':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 148bd02..fe99cea 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 _0x8447=['find','create','body','describe','update','uniqueid','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','CmHopperHistory','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes'];(function(_0x1e85a8,_0x3f8d0e){var _0x34a8ea=function(_0x12d2ea){while(--_0x12d2ea){_0x1e85a8['push'](_0x1e85a8['shift']());}};_0x34a8ea(++_0x3f8d0e);}(_0x8447,0x1ce));var _0x7844=function(_0x123c2e,_0x310018){_0x123c2e=_0x123c2e-0x0;var _0xf929a8=_0x8447[_0x123c2e];return _0xf929a8;};'use strict';var emlformat=require(_0x7844('0x0'));var rimraf=require(_0x7844('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7844('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7844('0x3'));var util=require(_0x7844('0x4'));var path=require(_0x7844('0x5'));var sox=require(_0x7844('0x6'));var csv=require(_0x7844('0x7'));var ejs=require(_0x7844('0x8'));var fs=require('fs');var fs_extra=require(_0x7844('0x9'));var _=require('lodash');var squel=require(_0x7844('0xa'));var crypto=require(_0x7844('0xb'));var jsforce=require(_0x7844('0xc'));var deskjs=require(_0x7844('0xd'));var toCsv=require(_0x7844('0x7'));var querystring=require('querystring');var Papa=require(_0x7844('0xe'));var Redis=require(_0x7844('0xf'));var authService=require(_0x7844('0x10'));var qs=require(_0x7844('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7844('0x12'));var logger=require('../../config/logger')(_0x7844('0x13'));var utils=require(_0x7844('0x14'));var config=require(_0x7844('0x15'));var licenseUtil=require(_0x7844('0x16'));var db=require(_0x7844('0x17'))['db'];function respondWithStatusCode(_0xb38ccd,_0x17a6db){_0x17a6db=_0x17a6db||0xcc;return function(_0x332222){if(_0x332222){return _0xb38ccd['sendStatus'](_0x17a6db);}return _0xb38ccd['status'](_0x17a6db)[_0x7844('0x18')]();};}function respondWithResult(_0x3f2c30,_0x21815a){_0x21815a=_0x21815a||0xc8;return function(_0x430e31){if(_0x430e31){return _0x3f2c30['status'](_0x21815a)['json'](_0x430e31);}};}function respondWithFilteredResult(_0xeef8d,_0x5092ac){return function(_0xe013b5){if(_0xe013b5){var _0x3a00ec=typeof _0x5092ac[_0x7844('0x19')]==='undefined'&&typeof _0x5092ac[_0x7844('0x1a')]===_0x7844('0x1b');var _0x18f859=_0xe013b5[_0x7844('0x1c')];var _0x5b3253=_0x3a00ec?0x0:_0x5092ac[_0x7844('0x19')];var _0x176217=_0x3a00ec?_0xe013b5[_0x7844('0x1c')]:_0x5092ac[_0x7844('0x19')]+_0x5092ac[_0x7844('0x1a')];var _0x2d193e;if(_0x176217>=_0x18f859){_0x176217=_0x18f859;_0x2d193e=0xc8;}else{_0x2d193e=0xce;}_0xeef8d[_0x7844('0x1d')](_0x2d193e);return _0xeef8d[_0x7844('0x1e')](_0x7844('0x1f'),_0x5b3253+'-'+_0x176217+'/'+_0x18f859)[_0x7844('0x20')](_0xe013b5);}return null;};}function patchUpdates(_0x4955e1){return function(_0x5eceb7){try{jsonpatch[_0x7844('0x21')](_0x5eceb7,_0x4955e1,!![]);}catch(_0x529661){return BPromise[_0x7844('0x22')](_0x529661);}return _0x5eceb7['save']();};}function saveUpdates(_0x55fdc9,_0x1f9da2){return function(_0xf6b8d3){if(_0xf6b8d3){return _0xf6b8d3['update'](_0x55fdc9)[_0x7844('0x23')](function(_0xa78ef1){return _0xa78ef1;});}return null;};}function removeEntity(_0x58bd68,_0x447c55){return function(_0x318d03){if(_0x318d03){return _0x318d03[_0x7844('0x24')]()[_0x7844('0x23')](function(){_0x58bd68[_0x7844('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7f2d,_0x34c3f1){return function(_0x5124f5){if(!_0x5124f5){_0x2f7f2d[_0x7844('0x25')](0x194);}return _0x5124f5;};}function handleError(_0x363996,_0x4c48e4){_0x4c48e4=_0x4c48e4||0x1f4;return function(_0x4b2d02){logger['error'](_0x4b2d02[_0x7844('0x26')]);if(_0x4b2d02[_0x7844('0x27')]){delete _0x4b2d02[_0x7844('0x27')];}_0x363996[_0x7844('0x1d')](_0x4c48e4)[_0x7844('0x28')](_0x4b2d02);};}exports[_0x7844('0x29')]=function(_0x345317,_0x1632cc){var _0x415524={},_0x3a9f13={},_0x1f5186={'count':0x0,'rows':[]};var _0x548a86=_[_0x7844('0x2a')](db[_0x7844('0x2b')]['rawAttributes'],function(_0x340c51){return{'name':_0x340c51[_0x7844('0x2c')],'type':_0x340c51['type']['key']};});_0x3a9f13[_0x7844('0x2d')]=_[_0x7844('0x2a')](_0x548a86,_0x7844('0x27'));_0x3a9f13[_0x7844('0x2e')]=_['keys'](_0x345317[_0x7844('0x2e')]);_0x3a9f13[_0x7844('0x2f')]=_[_0x7844('0x30')](_0x3a9f13[_0x7844('0x2d')],_0x3a9f13['query']);_0x415524[_0x7844('0x31')]=_[_0x7844('0x30')](_0x3a9f13[_0x7844('0x2d')],qs[_0x7844('0x32')](_0x345317['query'][_0x7844('0x32')]));_0x415524[_0x7844('0x31')]=_0x415524[_0x7844('0x31')]['length']?_0x415524['attributes']:_0x3a9f13[_0x7844('0x2d')];if(!_0x345317[_0x7844('0x2e')][_0x7844('0x33')](_0x7844('0x34'))){_0x415524[_0x7844('0x1a')]=qs[_0x7844('0x1a')](_0x345317[_0x7844('0x2e')][_0x7844('0x1a')]);_0x415524[_0x7844('0x19')]=qs[_0x7844('0x19')](_0x345317['query'][_0x7844('0x19')]);}_0x415524[_0x7844('0x35')]=qs[_0x7844('0x36')](_0x345317[_0x7844('0x2e')][_0x7844('0x36')]);_0x415524['where']=qs['filters'](_[_0x7844('0x37')](_0x345317[_0x7844('0x2e')],_0x3a9f13[_0x7844('0x2f')]),_0x548a86);if(_0x345317['query'][_0x7844('0x38')]){_0x415524[_0x7844('0x39')]=_['merge'](_0x415524['where'],{'$or':_[_0x7844('0x2a')](_0x548a86,function(_0x5140f1){if(_0x5140f1[_0x7844('0x3a')]!==_0x7844('0x3b')){var _0x59d334={};_0x59d334[_0x5140f1[_0x7844('0x27')]]={'$like':'%'+_0x345317[_0x7844('0x2e')][_0x7844('0x38')]+'%'};return _0x59d334;}})});}_0x415524=_[_0x7844('0x3c')]({},_0x415524,_0x345317['options']);var _0x41279e={'where':_0x415524[_0x7844('0x39')]};return db['CmHopperHistory'][_0x7844('0x1c')](_0x41279e)[_0x7844('0x23')](function(_0x5ce2e7){_0x1f5186[_0x7844('0x1c')]=_0x5ce2e7;if(_0x345317[_0x7844('0x2e')][_0x7844('0x3d')]){_0x415524[_0x7844('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7844('0x3f')](_0x415524);})[_0x7844('0x23')](function(_0x42defc){_0x1f5186[_0x7844('0x40')]=_0x42defc;return _0x1f5186;})[_0x7844('0x23')](respondWithFilteredResult(_0x1632cc,_0x415524))[_0x7844('0x41')](handleError(_0x1632cc,null));};exports[_0x7844('0x42')]=function(_0x4563c2,_0x5e5db2){var _0xec975e={'raw':!![],'where':{'id':_0x4563c2[_0x7844('0x43')]['id']}},_0x205400={};_0x205400[_0x7844('0x2d')]=_[_0x7844('0x44')](db[_0x7844('0x2b')][_0x7844('0x45')]);_0x205400[_0x7844('0x2e')]=_['keys'](_0x4563c2[_0x7844('0x2e')]);_0x205400[_0x7844('0x2f')]=_[_0x7844('0x30')](_0x205400['model'],_0x205400[_0x7844('0x2e')]);_0xec975e[_0x7844('0x31')]=_['intersection'](_0x205400['model'],qs[_0x7844('0x32')](_0x4563c2[_0x7844('0x2e')][_0x7844('0x32')]));_0xec975e[_0x7844('0x31')]=_0xec975e[_0x7844('0x31')]['length']?_0xec975e[_0x7844('0x31')]:_0x205400[_0x7844('0x2d')];if(_0x4563c2['query'][_0x7844('0x3d')]){_0xec975e[_0x7844('0x3e')]=[{'all':!![]}];}_0xec975e=_[_0x7844('0x3c')]({},_0xec975e,_0x4563c2['options']);return db[_0x7844('0x2b')][_0x7844('0x46')](_0xec975e)[_0x7844('0x23')](handleEntityNotFound(_0x5e5db2,null))['then'](respondWithResult(_0x5e5db2,null))['catch'](handleError(_0x5e5db2,null));};exports[_0x7844('0x47')]=function(_0x1b7816,_0x162031){return db['CmHopperHistory']['create'](_0x1b7816[_0x7844('0x48')],{})[_0x7844('0x23')](respondWithResult(_0x162031,0xc9))[_0x7844('0x41')](handleError(_0x162031,null));};exports[_0x7844('0x49')]=function(_0x47ebda,_0x477c7f){return db[_0x7844('0x2b')][_0x7844('0x49')]()[_0x7844('0x23')](respondWithResult(_0x477c7f,null))[_0x7844('0x41')](handleError(_0x477c7f,null));};exports[_0x7844('0x4a')]=function(_0x40c90e,_0x5e612b){if(_0x40c90e[_0x7844('0x48')]['uniqueid']){delete _0x40c90e[_0x7844('0x48')][_0x7844('0x4b')];}return db[_0x7844('0x2b')][_0x7844('0x46')]({'where':{'uniqueid':_0x40c90e[_0x7844('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e612b,null))['then'](saveUpdates(_0x40c90e[_0x7844('0x48')],null))[_0x7844('0x23')](respondWithResult(_0x5e612b,null))[_0x7844('0x41')](handleError(_0x5e612b,null));}; \ No newline at end of file +var _0x58de=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','name','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','rimraf','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x12410c,_0x1874d){var _0xc075d=function(_0x47da7a){while(--_0x47da7a){_0x12410c['push'](_0x12410c['shift']());}};_0xc075d(++_0x1874d);}(_0x58de,0x83));var _0xe58d=function(_0x46a23c,_0x2221d8){_0x46a23c=_0x46a23c-0x0;var _0x5a09a8=_0x58de[_0x46a23c];return _0x5a09a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe58d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe58d('0x1'));var BPromise=require(_0xe58d('0x2'));var Mustache=require(_0xe58d('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe58d('0x4'));var csv=require('to-csv');var ejs=require(_0xe58d('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe58d('0x6'));var crypto=require(_0xe58d('0x7'));var jsforce=require(_0xe58d('0x8'));var deskjs=require(_0xe58d('0x9'));var toCsv=require(_0xe58d('0xa'));var querystring=require('querystring');var Papa=require(_0xe58d('0xb'));var Redis=require(_0xe58d('0xc'));var authService=require(_0xe58d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe58d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe58d('0xf'))(_0xe58d('0x10'));var utils=require('../../config/utils');var config=require(_0xe58d('0x11'));var licenseUtil=require(_0xe58d('0x12'));var db=require(_0xe58d('0x13'))['db'];function respondWithStatusCode(_0xaf2d33,_0x56f2f4){_0x56f2f4=_0x56f2f4||0xcc;return function(_0x1e93ff){if(_0x1e93ff){return _0xaf2d33[_0xe58d('0x14')](_0x56f2f4);}return _0xaf2d33['status'](_0x56f2f4)[_0xe58d('0x15')]();};}function respondWithResult(_0x14bdbc,_0x10cde9){_0x10cde9=_0x10cde9||0xc8;return function(_0x46816a){if(_0x46816a){return _0x14bdbc[_0xe58d('0x16')](_0x10cde9)[_0xe58d('0x17')](_0x46816a);}};}function respondWithFilteredResult(_0x292c8d,_0x29174d){return function(_0x159d1d){if(_0x159d1d){var _0x3936bf=typeof _0x29174d[_0xe58d('0x18')]===_0xe58d('0x19')&&typeof _0x29174d[_0xe58d('0x1a')]===_0xe58d('0x19');var _0x34f23b=_0x159d1d[_0xe58d('0x1b')];var _0x34b11a=_0x3936bf?0x0:_0x29174d[_0xe58d('0x18')];var _0x3ec193=_0x3936bf?_0x159d1d[_0xe58d('0x1b')]:_0x29174d[_0xe58d('0x18')]+_0x29174d[_0xe58d('0x1a')];var _0x10c262;if(_0x3ec193>=_0x34f23b){_0x3ec193=_0x34f23b;_0x10c262=0xc8;}else{_0x10c262=0xce;}_0x292c8d['status'](_0x10c262);return _0x292c8d[_0xe58d('0x1c')]('Content-Range',_0x34b11a+'-'+_0x3ec193+'/'+_0x34f23b)['json'](_0x159d1d);}return null;};}function patchUpdates(_0x1f931f){return function(_0x4b3320){try{jsonpatch['apply'](_0x4b3320,_0x1f931f,!![]);}catch(_0x5b7361){return BPromise[_0xe58d('0x1d')](_0x5b7361);}return _0x4b3320[_0xe58d('0x1e')]();};}function saveUpdates(_0x303836,_0x21d4f3){return function(_0x2950a2){if(_0x2950a2){return _0x2950a2[_0xe58d('0x1f')](_0x303836)['then'](function(_0x5d6ba2){return _0x5d6ba2;});}return null;};}function removeEntity(_0x36e1ec,_0x34bc9b){return function(_0x18f04a){if(_0x18f04a){return _0x18f04a[_0xe58d('0x20')]()[_0xe58d('0x21')](function(){_0x36e1ec['status'](0xcc)[_0xe58d('0x15')]();});}};}function handleEntityNotFound(_0x368991,_0x6a9dbe){return function(_0x549d12){if(!_0x549d12){_0x368991['sendStatus'](0x194);}return _0x549d12;};}function handleError(_0x26402b,_0x59be93){_0x59be93=_0x59be93||0x1f4;return function(_0xcd16c0){logger[_0xe58d('0x22')](_0xcd16c0['stack']);if(_0xcd16c0[_0xe58d('0x23')]){delete _0xcd16c0['name'];}_0x26402b[_0xe58d('0x16')](_0x59be93)['send'](_0xcd16c0);};}exports[_0xe58d('0x24')]=function(_0x18da20,_0x211cde){var _0x24d4ba={},_0x2450f6={},_0x5374d4={'count':0x0,'rows':[]};var _0x12ff2b=_[_0xe58d('0x25')](db[_0xe58d('0x26')][_0xe58d('0x27')],function(_0x2a9237){return{'name':_0x2a9237[_0xe58d('0x28')],'type':_0x2a9237['type'][_0xe58d('0x29')]};});_0x2450f6[_0xe58d('0x2a')]=_['map'](_0x12ff2b,'name');_0x2450f6['query']=_[_0xe58d('0x2b')](_0x18da20[_0xe58d('0x2c')]);_0x2450f6[_0xe58d('0x2d')]=_[_0xe58d('0x2e')](_0x2450f6[_0xe58d('0x2a')],_0x2450f6[_0xe58d('0x2c')]);_0x24d4ba['attributes']=_[_0xe58d('0x2e')](_0x2450f6['model'],qs[_0xe58d('0x2f')](_0x18da20['query'][_0xe58d('0x2f')]));_0x24d4ba[_0xe58d('0x30')]=_0x24d4ba['attributes'][_0xe58d('0x31')]?_0x24d4ba[_0xe58d('0x30')]:_0x2450f6['model'];if(!_0x18da20[_0xe58d('0x2c')][_0xe58d('0x32')](_0xe58d('0x33'))){_0x24d4ba[_0xe58d('0x1a')]=qs['limit'](_0x18da20[_0xe58d('0x2c')][_0xe58d('0x1a')]);_0x24d4ba[_0xe58d('0x18')]=qs[_0xe58d('0x18')](_0x18da20[_0xe58d('0x2c')][_0xe58d('0x18')]);}_0x24d4ba[_0xe58d('0x34')]=qs[_0xe58d('0x35')](_0x18da20[_0xe58d('0x2c')]['sort']);_0x24d4ba['where']=qs[_0xe58d('0x2d')](_['pick'](_0x18da20[_0xe58d('0x2c')],_0x2450f6[_0xe58d('0x2d')]),_0x12ff2b);if(_0x18da20['query'][_0xe58d('0x36')]){_0x24d4ba[_0xe58d('0x37')]=_[_0xe58d('0x38')](_0x24d4ba['where'],{'$or':_[_0xe58d('0x25')](_0x12ff2b,function(_0x20a8df){if(_0x20a8df['type']!==_0xe58d('0x39')){var _0x50abee={};_0x50abee[_0x20a8df[_0xe58d('0x23')]]={'$like':'%'+_0x18da20[_0xe58d('0x2c')][_0xe58d('0x36')]+'%'};return _0x50abee;}})});}_0x24d4ba=_['merge']({},_0x24d4ba,_0x18da20[_0xe58d('0x3a')]);var _0x19635b={'where':_0x24d4ba['where']};return db['CmHopperHistory'][_0xe58d('0x1b')](_0x19635b)[_0xe58d('0x21')](function(_0x3b913b){_0x5374d4['count']=_0x3b913b;if(_0x18da20['query'][_0xe58d('0x3b')]){_0x24d4ba[_0xe58d('0x3c')]=[{'all':!![]}];}return db[_0xe58d('0x26')][_0xe58d('0x3d')](_0x24d4ba);})[_0xe58d('0x21')](function(_0x488bdd){_0x5374d4[_0xe58d('0x3e')]=_0x488bdd;return _0x5374d4;})['then'](respondWithFilteredResult(_0x211cde,_0x24d4ba))[_0xe58d('0x3f')](handleError(_0x211cde,null));};exports[_0xe58d('0x40')]=function(_0x21c4e7,_0x73abe3){var _0xea5ffe={'raw':!![],'where':{'id':_0x21c4e7[_0xe58d('0x41')]['id']}},_0x359cc3={};_0x359cc3[_0xe58d('0x2a')]=_['keys'](db['CmHopperHistory'][_0xe58d('0x27')]);_0x359cc3[_0xe58d('0x2c')]=_[_0xe58d('0x2b')](_0x21c4e7['query']);_0x359cc3[_0xe58d('0x2d')]=_['intersection'](_0x359cc3[_0xe58d('0x2a')],_0x359cc3['query']);_0xea5ffe[_0xe58d('0x30')]=_[_0xe58d('0x2e')](_0x359cc3[_0xe58d('0x2a')],qs[_0xe58d('0x2f')](_0x21c4e7[_0xe58d('0x2c')][_0xe58d('0x2f')]));_0xea5ffe[_0xe58d('0x30')]=_0xea5ffe[_0xe58d('0x30')][_0xe58d('0x31')]?_0xea5ffe[_0xe58d('0x30')]:_0x359cc3[_0xe58d('0x2a')];if(_0x21c4e7[_0xe58d('0x2c')][_0xe58d('0x3b')]){_0xea5ffe[_0xe58d('0x3c')]=[{'all':!![]}];}_0xea5ffe=_['merge']({},_0xea5ffe,_0x21c4e7[_0xe58d('0x3a')]);return db[_0xe58d('0x26')]['find'](_0xea5ffe)[_0xe58d('0x21')](handleEntityNotFound(_0x73abe3,null))['then'](respondWithResult(_0x73abe3,null))['catch'](handleError(_0x73abe3,null));};exports['create']=function(_0x3823b0,_0x2d4fd8){return db[_0xe58d('0x26')][_0xe58d('0x42')](_0x3823b0[_0xe58d('0x43')],{})[_0xe58d('0x21')](respondWithResult(_0x2d4fd8,0xc9))['catch'](handleError(_0x2d4fd8,null));};exports[_0xe58d('0x44')]=function(_0xa7b680,_0x2c0cdf){return db[_0xe58d('0x26')][_0xe58d('0x44')]()[_0xe58d('0x21')](respondWithResult(_0x2c0cdf,null))['catch'](handleError(_0x2c0cdf,null));};exports[_0xe58d('0x1f')]=function(_0x1521ab,_0x1db3bc){if(_0x1521ab[_0xe58d('0x43')][_0xe58d('0x45')]){delete _0x1521ab[_0xe58d('0x43')]['uniqueid'];}return db['CmHopperHistory'][_0xe58d('0x46')]({'where':{'uniqueid':_0x1521ab[_0xe58d('0x41')]['id']}})[_0xe58d('0x21')](handleEntityNotFound(_0x1db3bc,null))['then'](saveUpdates(_0x1521ab[_0xe58d('0x43')],null))['then'](respondWithResult(_0x1db3bc,null))[_0xe58d('0x3f')](handleError(_0x1db3bc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index feede67..009ed11 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 _0x2c91=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x184525,_0x4527ca){var _0x1f4e19=function(_0x49c638){while(--_0x49c638){_0x184525['push'](_0x184525['shift']());}};_0x1f4e19(++_0x4527ca);}(_0x2c91,0x158));var _0x12c9=function(_0x444d99,_0x2bccc8){_0x444d99=_0x444d99-0x0;var _0x5ba3a2=_0x2c91[_0x444d99];return _0x5ba3a2;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var logger=require(_0x12c9('0x2'))(_0x12c9('0x3'));var moment=require(_0x12c9('0x4'));var BPromise=require(_0x12c9('0x5'));var rp=require(_0x12c9('0x6'));var fs=require('fs');var path=require(_0x12c9('0x7'));var rimraf=require('rimraf');var config=require(_0x12c9('0x8'));var attributes=require(_0x12c9('0x9'));module[_0x12c9('0xa')]=function(_0x38bd43,_0x14c359){return _0x38bd43[_0x12c9('0xb')](_0x12c9('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x12c9('0xd'),'fields':[_0x12c9('0xd')]},{'name':'uniqueid','fields':[_0x12c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0dc=['bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xe0dc,0x190));var _0xce0d=function(_0x5229a1,_0x5349f8){_0x5229a1=_0x5229a1-0x0;var _0xc4cb55=_0xe0dc[_0x5229a1];return _0xc4cb55;};'use strict';var _=require(_0xce0d('0x0'));var util=require('util');var logger=require(_0xce0d('0x1'))(_0xce0d('0x2'));var moment=require('moment');var BPromise=require(_0xce0d('0x3'));var rp=require(_0xce0d('0x4'));var fs=require('fs');var path=require(_0xce0d('0x5'));var rimraf=require(_0xce0d('0x6'));var config=require('../../config/environment');var attributes=require(_0xce0d('0x7'));module['exports']=function(_0x3e7888,_0x33f430){return _0x3e7888[_0xce0d('0x8')](_0xce0d('0x9'),attributes,{'tableName':_0xce0d('0xa'),'paranoid':![],'indexes':[{'name':_0xce0d('0xb'),'fields':[_0xce0d('0xb')]},{'name':_0xce0d('0xc'),'fields':[_0xce0d('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 2cb9cce..5ebd9b0 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 _0x1752=['col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundReCallsDay','debug','stringify','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','AvgHandleTime','findAll','sequelize','COUNT'];(function(_0x1f3c43,_0x287665){var _0x2d316d=function(_0x12ea21){while(--_0x12ea21){_0x1f3c43['push'](_0x1f3c43['shift']());}};_0x2d316d(++_0x287665);}(_0x1752,0xa5));var _0x2175=function(_0x16a050,_0x3d246c){_0x16a050=_0x16a050-0x0;var _0x5c1b85=_0x1752[_0x16a050];return _0x5c1b85;};'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']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1bd937,_0x2175('0x10'),JSON['stringify'](_0x407a71));if(_0x407a71['error']){if(_0x407a71['error']['code']===0x1f4){logger[_0x2175('0x11')]('CmHopperHistory,\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')]('CmHopperHistory,\x20%s,\x20%s',_0x1bd937,'request\x20sent');_0x672ff1(_0x407a71[_0x2175('0x13')][_0x2175('0x12')]);}})[_0x2175('0x14')](function(_0x4e7cf1){logger['error']('CmHopperHistory,\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']('CreateCmHopperHistory',_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']));});});};exports[_0x2175('0x1a')]=function(_0x3d849e){var _0xa6ef48=this;return new Promise(function(_0x140032,_0x495887){return db['CmHopperHistory'][_0x2175('0x1b')]({'raw':_0x3d849e[_0x2175('0x18')]?_0x3d849e[_0x2175('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3d849e[_0x2175('0x18')]?_0x3d849e['options']['where']||null:null,'attributes':[[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')][_0x2175('0x1e')]('id')),_0x2175('0x1f')],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')](_0x2175('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x2175('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0x2175('0x22')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')](_0x2175('0x23')))),_0x2175('0x24')],[db['sequelize']['fn'](_0x2175('0x25'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x26')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')](_0x2175('0x27')))),_0x2175('0x28')]]})[_0x2175('0xd')](function(_0x25cce5){logger[_0x2175('0xe')](_0x2175('0x1a'),_0x3d849e);logger['debug']('AvgHandleTime',_0x3d849e,JSON['stringify'](_0x25cce5));_0x140032(_0x25cce5);})['catch'](function(_0x536dd1){logger[_0x2175('0x11')](_0x2175('0x1a'),_0x536dd1['message'],_0x3d849e);_0x495887(_0xa6ef48[_0x2175('0x11')](0x1f4,_0x536dd1[_0x2175('0x12')]));});});};exports[_0x2175('0x29')]=function(_0x1843d9){var _0x8c78fb=this;return new Promise(function(_0x162042,_0x5af516){return db[_0x2175('0x16')][_0x2175('0x1b')]({'raw':_0x1843d9[_0x2175('0x18')]?_0x1843d9[_0x2175('0x18')][_0x2175('0x19')]===undefined?!![]:![]:!![],'where':_0x1843d9[_0x2175('0x18')]?_0x1843d9[_0x2175('0x18')][_0x2175('0x2a')]||null:null,'attributes':[[_0x2175('0x2b'),_0x2175('0x2c')],[db[_0x2175('0x1c')]['fn']('COUNT',db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x2175('0x1c')]['fn']('COUNT',db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x21')))),_0x2175('0x2d')],[db['sequelize']['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x2175('0x2e')],[db['sequelize']['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x2175('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x2175('0x1c')]['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x30')))),_0x2175('0x31')],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x32')))),_0x2175('0x33')],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x34')))),_0x2175('0x35')],[db['sequelize']['fn'](_0x2175('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x2175('0x20')](_0x2175('0x36')))),_0x2175('0x37')],[db['sequelize']['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')](_0x2175('0x38')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')](_0x2175('0x39')))),'outboundRejectCallsDay'],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x2175('0x3a')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2175('0x1c')][_0x2175('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x2175('0x1c')]['fn']('IF',db[_0x2175('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x2175('0x3b')]],'group':[_0x2175('0x2b')]})[_0x2175('0xd')](function(_0xce807c){logger[_0x2175('0xe')]('GetVoiceQueueHopperHistory',_0x1843d9);logger[_0x2175('0x3c')]('GetVoiceQueueHopperHistory',_0x1843d9,JSON[_0x2175('0x3d')](_0xce807c));_0x162042(_0xce807c);})[_0x2175('0x14')](function(_0x265dc7){logger[_0x2175('0x11')](_0x2175('0x29'),_0x265dc7[_0x2175('0x12')],_0x1843d9);_0x5af516(_0x8c78fb[_0x2175('0x11')](0x1f4,_0x265dc7[_0x2175('0x12')]));});});};exports[_0x2175('0x3e')]=function(_0x470dde){var _0x1f967d=this;return new Promise(function(_0x172844,_0x29e926){return db[_0x2175('0x16')][_0x2175('0x1b')]({'raw':_0x470dde['options']?_0x470dde[_0x2175('0x18')][_0x2175('0x19')]===undefined?!![]:![]:!![],'where':_0x470dde[_0x2175('0x18')]?_0x470dde[_0x2175('0x18')]['where']||null:null,'attributes':[[_0x2175('0x2b'),'name'],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')][_0x2175('0x1e')]('id')),_0x2175('0x3f')],[db[_0x2175('0x1c')]['fn'](_0x2175('0x1d'),db[_0x2175('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x2175('0x21')))),_0x2175('0x40')]],'group':['campaign']})['then'](function(_0x3e9e8d){logger[_0x2175('0xe')](_0x2175('0x3e'),_0x470dde);logger[_0x2175('0x3c')]('GetCampaignHopperHistory',_0x470dde,JSON[_0x2175('0x3d')](_0x3e9e8d));_0x172844(_0x3e9e8d);})['catch'](function(_0x4136eb){logger[_0x2175('0x11')]('GetCampaignHopperHistory',_0x4136eb[_0x2175('0x12')],_0x470dde);_0x29e926(_0x1f967d[_0x2175('0x11')](0x1f4,_0x4136eb[_0x2175('0x12')]));});});}; \ No newline at end of file +var _0xf109=['info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','create','options','raw','stringify','AvgHandleTime','findAll','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrAnswerCallsDay','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xf109,0xce));var _0x9f10=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xf109[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});}exports[_0x9f10('0x17')]=function(_0x509fba){var _0x150813=this;return new Promise(function(_0x53bfbd,_0xe221d0){return db['CmHopperHistory'][_0x9f10('0x18')](_0x509fba['body'],{'raw':_0x509fba['options']?_0x509fba[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![]})[_0x9f10('0xc')](function(_0x3a78be){logger[_0x9f10('0xd')](_0x9f10('0x17'),_0x509fba);logger[_0x9f10('0xf')]('CreateCmHopperHistory',_0x509fba,JSON[_0x9f10('0x1b')](_0x3a78be));_0x53bfbd(_0x3a78be);})['catch'](function(_0x293990){logger[_0x9f10('0x11')](_0x9f10('0x17'),_0x293990['message'],_0x509fba);_0xe221d0(_0x150813[_0x9f10('0x11')](0x1f4,_0x293990[_0x9f10('0x14')]));});});};exports[_0x9f10('0x1c')]=function(_0x4d21c5){var _0x36821e=this;return new Promise(function(_0x37e9ac,_0x44b99d){return db['CmHopperHistory'][_0x9f10('0x1d')]({'raw':_0x4d21c5[_0x9f10('0x19')]?_0x4d21c5[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d21c5['options']?_0x4d21c5['options']['where']||null:null,'attributes':[[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')][_0x9f10('0x1f')]('id')),_0x9f10('0x20')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x23')))),_0x9f10('0x24')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x25')))),_0x9f10('0x26')],[db['sequelize']['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x28'),db[_0x9f10('0x1e')]['fn']('IF',db['sequelize'][_0x9f10('0x22')](_0x9f10('0x29')))),_0x9f10('0x2a')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x28'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x2b')))),_0x9f10('0x2c')]]})[_0x9f10('0xc')](function(_0x11ee9c){logger[_0x9f10('0xd')](_0x9f10('0x1c'),_0x4d21c5);logger['debug'](_0x9f10('0x1c'),_0x4d21c5,JSON[_0x9f10('0x1b')](_0x11ee9c));_0x37e9ac(_0x11ee9c);})[_0x9f10('0x16')](function(_0x5e63b1){logger[_0x9f10('0x11')](_0x9f10('0x1c'),_0x5e63b1['message'],_0x4d21c5);_0x44b99d(_0x36821e[_0x9f10('0x11')](0x1f4,_0x5e63b1['message']));});});};exports[_0x9f10('0x2d')]=function(_0x1b7a66){var _0x26df66=this;return new Promise(function(_0xc17ea2,_0x20605a){return db[_0x9f10('0x2e')][_0x9f10('0x1d')]({'raw':_0x1b7a66[_0x9f10('0x19')]?_0x1b7a66['options'][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b7a66[_0x9f10('0x19')]?_0x1b7a66[_0x9f10('0x19')]['where']||null:null,'attributes':[[_0x9f10('0x2f'),_0x9f10('0x30')],[db['sequelize']['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x9f10('0x31')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x32')))),_0x9f10('0x33')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x9f10('0x34')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db['sequelize'][_0x9f10('0x22')](_0x9f10('0x35')))),_0x9f10('0x36')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x37')))),_0x9f10('0x38')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x39')))),_0x9f10('0x3a')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x3b')))),_0x9f10('0x3c')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x3d')))),_0x9f10('0x3e')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x3f')))),_0x9f10('0x40')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x41')))),_0x9f10('0x42')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x43')))),'outboundRejectCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x44')))),_0x9f10('0x45')]],'group':['campaign']})[_0x9f10('0xc')](function(_0x63abfb){logger[_0x9f10('0xd')](_0x9f10('0x2d'),_0x1b7a66);logger['debug']('GetVoiceQueueHopperHistory',_0x1b7a66,JSON[_0x9f10('0x1b')](_0x63abfb));_0xc17ea2(_0x63abfb);})[_0x9f10('0x16')](function(_0x4bd874){logger['error'](_0x9f10('0x2d'),_0x4bd874[_0x9f10('0x14')],_0x1b7a66);_0x20605a(_0x26df66[_0x9f10('0x11')](0x1f4,_0x4bd874['message']));});});};exports[_0x9f10('0x46')]=function(_0x44a5d9){var _0x7611e8=this;return new Promise(function(_0x4c3d18,_0x37ae9c){return db[_0x9f10('0x2e')][_0x9f10('0x1d')]({'raw':_0x44a5d9['options']?_0x44a5d9[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x44a5d9['options']?_0x44a5d9[_0x9f10('0x19')][_0x9f10('0x47')]||null:null,'attributes':[[_0x9f10('0x2f'),_0x9f10('0x30')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['col']('id')),'ivrTotalCallsDays'],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x23')))),_0x9f10('0x48')]],'group':['campaign']})['then'](function(_0x4245be){logger[_0x9f10('0xd')](_0x9f10('0x46'),_0x44a5d9);logger[_0x9f10('0xf')](_0x9f10('0x46'),_0x44a5d9,JSON[_0x9f10('0x1b')](_0x4245be));_0x4c3d18(_0x4245be);})[_0x9f10('0x16')](function(_0x526184){logger[_0x9f10('0x11')](_0x9f10('0x46'),_0x526184['message'],_0x44a5d9);_0x37ae9c(_0x7611e8[_0x9f10('0x11')](0x1f4,_0x526184[_0x9f10('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 9bd2d23..f50c632 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 _0x0297=['get','/:id','post','update','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','/describe','isAuthenticated'];(function(_0x18da0b,_0x4daedb){var _0xbe65c7=function(_0x6ee25c){while(--_0x6ee25c){_0x18da0b['push'](_0x18da0b['shift']());}};_0xbe65c7(++_0x4daedb);}(_0x0297,0x170));var _0x7029=function(_0x2a2fdb,_0x5b5d57){_0x2a2fdb=_0x2a2fdb-0x0;var _0x34fbbf=_0x0297[_0x2a2fdb];return _0x34fbbf;};'use strict';var multer=require(_0x7029('0x0'));var util=require(_0x7029('0x1'));var path=require('path');var timeout=require(_0x7029('0x2'));var express=require('express');var router=express[_0x7029('0x3')]();var fs_extra=require(_0x7029('0x4'));var auth=require(_0x7029('0x5'));var interaction=require(_0x7029('0x6'));var config=require('../../config/environment');var controller=require(_0x7029('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7029('0x8'),auth[_0x7029('0x9')](),controller['describe']);router[_0x7029('0xa')](_0x7029('0xb'),auth[_0x7029('0x9')](),controller['show']);router[_0x7029('0xc')]('/',auth[_0x7029('0x9')](),controller['create']);router['put'](_0x7029('0xb'),auth[_0x7029('0x9')](),controller[_0x7029('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7bf9=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','multer','util','path','connect-timeout'];(function(_0x56a0aa,_0x49cb8a){var _0x56754f=function(_0x44272e){while(--_0x44272e){_0x56a0aa['push'](_0x56a0aa['shift']());}};_0x56754f(++_0x49cb8a);}(_0x7bf9,0xec));var _0x97bf=function(_0xdb027c,_0x555595){_0xdb027c=_0xdb027c-0x0;var _0x7b4cf3=_0x7bf9[_0xdb027c];return _0x7b4cf3;};'use strict';var multer=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var path=require(_0x97bf('0x2'));var timeout=require(_0x97bf('0x3'));var express=require(_0x97bf('0x4'));var router=express[_0x97bf('0x5')]();var fs_extra=require(_0x97bf('0x6'));var auth=require(_0x97bf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x97bf('0x8'));var controller=require(_0x97bf('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x97bf('0xa')]);router[_0x97bf('0xb')](_0x97bf('0xc'),auth[_0x97bf('0xd')](),controller[_0x97bf('0xe')]);router[_0x97bf('0xb')](_0x97bf('0xf'),auth[_0x97bf('0xd')](),controller['show']);router[_0x97bf('0x10')]('/',auth[_0x97bf('0xd')](),controller[_0x97bf('0x11')]);router[_0x97bf('0x12')](_0x97bf('0xf'),auth[_0x97bf('0xd')](),controller[_0x97bf('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f8b06e8..b2e2932 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 _0xdab2=['sequelize','exports','name','STRING'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2dab('0x0'));module[_0x2dab('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2dab('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2dab('0x3')]},'dialPrefix':{'type':Sequelize[_0x2dab('0x3')]}}; \ No newline at end of file +var _0x86f4=['STRING','name','sequelize','exports'];(function(_0x2f7089,_0x4f71db){var _0x49abb7=function(_0x43c74e){while(--_0x43c74e){_0x2f7089['push'](_0x2f7089['shift']());}};_0x49abb7(++_0x4f71db);}(_0x86f4,0x18a));var _0x486f=function(_0x5600f5,_0x78c4be){_0x5600f5=_0x5600f5-0x0;var _0x50a8e6=_0x86f4[_0x5600f5];return _0x50a8e6;};'use strict';var Sequelize=require(_0x486f('0x0'));module[_0x486f('0x1')]={'name':{'type':Sequelize[_0x486f('0x2')],'unique':_0x486f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x486f('0x2')]},'dialPrefix':{'type':Sequelize[_0x486f('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0a698e0..0d4b47d 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 _0xfbb8=['findOne','ListId','merge','removeDispositions','addContacts','CmContact','tags','isArray','push','success','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','ids','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','findAll','rows','catch','show','params','keys','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xfbb8,0x160));var _0x8fbb=function(_0xf4129c,_0x44fcf1){_0xf4129c=_0xf4129c-0x0;var _0x426611=_0xfbb8[_0xf4129c];return _0x426611;};'use strict';var emlformat=require(_0x8fbb('0x0'));var rimraf=require(_0x8fbb('0x1'));var zipdir=require(_0x8fbb('0x2'));var jsonpatch=require(_0x8fbb('0x3'));var rp=require('request-promise');var moment=require(_0x8fbb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fbb('0x5'));var util=require(_0x8fbb('0x6'));var path=require('path');var sox=require(_0x8fbb('0x7'));var csv=require('to-csv');var ejs=require(_0x8fbb('0x8'));var fs=require('fs');var fs_extra=require(_0x8fbb('0x9'));var _=require('lodash');var squel=require(_0x8fbb('0xa'));var crypto=require('crypto');var jsforce=require(_0x8fbb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8fbb('0xc'));var querystring=require(_0x8fbb('0xd'));var Papa=require(_0x8fbb('0xe'));var Redis=require(_0x8fbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8fbb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fbb('0x11'));var logger=require(_0x8fbb('0x12'))(_0x8fbb('0x13'));var utils=require(_0x8fbb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8fbb('0x15'));var db=require(_0x8fbb('0x16'))['db'];config[_0x8fbb('0x17')]=_[_0x8fbb('0x18')](config[_0x8fbb('0x17')],{'host':_0x8fbb('0x19'),'port':0x18eb});var socket=require(_0x8fbb('0x1a'))(new Redis(config[_0x8fbb('0x17')]));require(_0x8fbb('0x1b'))[_0x8fbb('0x1c')](socket);function respondWithStatusCode(_0x2b449f,_0x295f5a){_0x295f5a=_0x295f5a||0xcc;return function(_0x463192){if(_0x463192){return _0x2b449f[_0x8fbb('0x1d')](_0x295f5a);}return _0x2b449f[_0x8fbb('0x1e')](_0x295f5a)[_0x8fbb('0x1f')]();};}function respondWithResult(_0x2e8dbb,_0x425cd2){_0x425cd2=_0x425cd2||0xc8;return function(_0x3c2ded){if(_0x3c2ded){return _0x2e8dbb['status'](_0x425cd2)[_0x8fbb('0x20')](_0x3c2ded);}};}function respondWithFilteredResult(_0x58a769,_0x387ed5){return function(_0x4f5f65){if(_0x4f5f65){var _0x198eac=typeof _0x387ed5[_0x8fbb('0x21')]===_0x8fbb('0x22')&&typeof _0x387ed5[_0x8fbb('0x23')]===_0x8fbb('0x22');var _0x3503f7=_0x4f5f65[_0x8fbb('0x24')];var _0x1293e6=_0x198eac?0x0:_0x387ed5[_0x8fbb('0x21')];var _0x40a88c=_0x198eac?_0x4f5f65[_0x8fbb('0x24')]:_0x387ed5[_0x8fbb('0x21')]+_0x387ed5[_0x8fbb('0x23')];var _0x3432a5;if(_0x40a88c>=_0x3503f7){_0x40a88c=_0x3503f7;_0x3432a5=0xc8;}else{_0x3432a5=0xce;}_0x58a769[_0x8fbb('0x1e')](_0x3432a5);return _0x58a769[_0x8fbb('0x25')](_0x8fbb('0x26'),_0x1293e6+'-'+_0x40a88c+'/'+_0x3503f7)[_0x8fbb('0x20')](_0x4f5f65);}return null;};}function patchUpdates(_0x22891e){return function(_0x1c0f22){try{jsonpatch['apply'](_0x1c0f22,_0x22891e,!![]);}catch(_0x388588){return BPromise[_0x8fbb('0x27')](_0x388588);}return _0x1c0f22[_0x8fbb('0x28')]();};}function saveUpdates(_0x1ef2c2,_0x446b7f){return function(_0x4580d6){if(_0x4580d6){return _0x4580d6[_0x8fbb('0x29')](_0x1ef2c2)[_0x8fbb('0x2a')](function(_0x5246db){return _0x5246db;});}return null;};}function removeEntity(_0x2c411f,_0x1ae994){return function(_0x101214){if(_0x101214){return _0x101214[_0x8fbb('0x2b')]()['then'](function(){var _0x2d03c3=_0x101214[_0x8fbb('0x2c')]({'plain':!![]});var _0x4607ae=_0x8fbb('0x2d');return db[_0x8fbb('0x2e')]['destroy']({'where':{'type':_0x4607ae,'resourceId':_0x2d03c3['id']}})['then'](function(){return _0x101214;});})[_0x8fbb('0x2a')](function(){_0x2c411f['status'](0xcc)[_0x8fbb('0x1f')]();});}};}function handleEntityNotFound(_0x68943f,_0x58081b){return function(_0x258404){if(!_0x258404){_0x68943f[_0x8fbb('0x1d')](0x194);}return _0x258404;};}function handleError(_0xc1b0c5,_0x461cdd){_0x461cdd=_0x461cdd||0x1f4;return function(_0x535017){logger[_0x8fbb('0x2f')](_0x535017[_0x8fbb('0x30')]);if(_0x535017['name']){delete _0x535017[_0x8fbb('0x31')];}_0xc1b0c5[_0x8fbb('0x1e')](_0x461cdd)[_0x8fbb('0x32')](_0x535017);};}exports[_0x8fbb('0x33')]=function(_0x320fe8,_0x18b782){var _0x37386a={},_0x3ede53={},_0x3297d6={'count':0x0,'rows':[]};var _0x4421d0=_[_0x8fbb('0x34')](db[_0x8fbb('0x35')][_0x8fbb('0x36')],function(_0x2b69ae){return{'name':_0x2b69ae[_0x8fbb('0x37')],'type':_0x2b69ae[_0x8fbb('0x38')]['key']};});_0x3ede53[_0x8fbb('0x39')]=_[_0x8fbb('0x34')](_0x4421d0,_0x8fbb('0x31'));_0x3ede53[_0x8fbb('0x3a')]=_['keys'](_0x320fe8[_0x8fbb('0x3a')]);_0x3ede53[_0x8fbb('0x3b')]=_[_0x8fbb('0x3c')](_0x3ede53[_0x8fbb('0x39')],_0x3ede53[_0x8fbb('0x3a')]);_0x37386a['attributes']=_[_0x8fbb('0x3c')](_0x3ede53[_0x8fbb('0x39')],qs[_0x8fbb('0x3d')](_0x320fe8[_0x8fbb('0x3a')][_0x8fbb('0x3d')]));_0x37386a['attributes']=_0x37386a[_0x8fbb('0x3e')]['length']?_0x37386a[_0x8fbb('0x3e')]:_0x3ede53[_0x8fbb('0x39')];if(!_0x320fe8['query'][_0x8fbb('0x3f')](_0x8fbb('0x40'))){_0x37386a[_0x8fbb('0x23')]=qs[_0x8fbb('0x23')](_0x320fe8[_0x8fbb('0x3a')][_0x8fbb('0x23')]);_0x37386a[_0x8fbb('0x21')]=qs[_0x8fbb('0x21')](_0x320fe8[_0x8fbb('0x3a')]['offset']);}_0x37386a[_0x8fbb('0x41')]=qs[_0x8fbb('0x42')](_0x320fe8[_0x8fbb('0x3a')]['sort']);_0x37386a[_0x8fbb('0x43')]=qs[_0x8fbb('0x3b')](_[_0x8fbb('0x44')](_0x320fe8[_0x8fbb('0x3a')],_0x3ede53[_0x8fbb('0x3b')]),_0x4421d0);if(_0x320fe8[_0x8fbb('0x3a')][_0x8fbb('0x45')]){_0x37386a[_0x8fbb('0x43')]=_['merge'](_0x37386a[_0x8fbb('0x43')],{'$or':_[_0x8fbb('0x34')](_0x4421d0,function(_0x30905e){if(_0x30905e[_0x8fbb('0x38')]!==_0x8fbb('0x46')){var _0x48ceee={};_0x48ceee[_0x30905e[_0x8fbb('0x31')]]={'$like':'%'+_0x320fe8['query']['filter']+'%'};return _0x48ceee;}})});}_0x37386a=_['merge']({},_0x37386a,_0x320fe8['options']);var _0x18f7e2={'where':_0x37386a['where']};return db[_0x8fbb('0x35')][_0x8fbb('0x24')](_0x18f7e2)[_0x8fbb('0x2a')](function(_0x1fb458){_0x3297d6[_0x8fbb('0x24')]=_0x1fb458;if(_0x320fe8['query']['includeAll']){_0x37386a['include']=[{'all':!![]}];}return db[_0x8fbb('0x35')][_0x8fbb('0x47')](_0x37386a);})[_0x8fbb('0x2a')](function(_0x849ce8){_0x3297d6[_0x8fbb('0x48')]=_0x849ce8;return _0x3297d6;})[_0x8fbb('0x2a')](respondWithFilteredResult(_0x18b782,_0x37386a))[_0x8fbb('0x49')](handleError(_0x18b782,null));};exports[_0x8fbb('0x4a')]=function(_0x304f32,_0x1456e3){var _0x587408={'raw':![],'where':{'id':_0x304f32[_0x8fbb('0x4b')]['id']}},_0x1fb3d2={};_0x1fb3d2['model']=_[_0x8fbb('0x4c')](db['CmList']['rawAttributes']);_0x1fb3d2['query']=_['keys'](_0x304f32[_0x8fbb('0x3a')]);_0x1fb3d2['filters']=_[_0x8fbb('0x3c')](_0x1fb3d2[_0x8fbb('0x39')],_0x1fb3d2[_0x8fbb('0x3a')]);_0x587408[_0x8fbb('0x3e')]=_['intersection'](_0x1fb3d2[_0x8fbb('0x39')],qs[_0x8fbb('0x3d')](_0x304f32['query']['fields']));_0x587408[_0x8fbb('0x3e')]=_0x587408[_0x8fbb('0x3e')][_0x8fbb('0x4d')]?_0x587408['attributes']:_0x1fb3d2[_0x8fbb('0x39')];if(_0x304f32['query'][_0x8fbb('0x4e')]){_0x587408[_0x8fbb('0x4f')]=[{'all':!![]}];}_0x587408=_['merge']({},_0x587408,_0x304f32[_0x8fbb('0x50')]);return db[_0x8fbb('0x35')]['find'](_0x587408)['then'](handleEntityNotFound(_0x1456e3,null))[_0x8fbb('0x2a')](respondWithResult(_0x1456e3,null))[_0x8fbb('0x49')](handleError(_0x1456e3,null));};exports[_0x8fbb('0x51')]=function(_0x2f2006,_0xe55599){return db[_0x8fbb('0x35')][_0x8fbb('0x51')](_0x2f2006['body'],{})[_0x8fbb('0x2a')](function(_0x43aadf){var _0x5c76f9=_0x2f2006[_0x8fbb('0x52')][_0x8fbb('0x2c')]({'plain':!![]});if(!_0x5c76f9)throw new Error(_0x8fbb('0x53'));if(_0x5c76f9['role']==='user'){var _0xc3979a=_0x43aadf['get']({'plain':!![]});var _0x937dd8=_0x8fbb('0x2d');return db[_0x8fbb('0x54')][_0x8fbb('0x55')]({'where':{'name':_0x937dd8,'userProfileId':_0x5c76f9[_0x8fbb('0x56')]},'raw':!![]})[_0x8fbb('0x2a')](function(_0x49831b){if(_0x49831b&&_0x49831b['autoAssociation']===0x0){return db[_0x8fbb('0x2e')][_0x8fbb('0x51')]({'name':_0xc3979a[_0x8fbb('0x31')],'resourceId':_0xc3979a['id'],'type':_0x49831b['name'],'sectionId':_0x49831b['id']},{})[_0x8fbb('0x2a')](function(){return _0x43aadf;});}else{return _0x43aadf;}})[_0x8fbb('0x49')](function(_0x37d858){logger[_0x8fbb('0x2f')](_0x8fbb('0x57'),_0x37d858);throw _0x37d858;});}return _0x43aadf;})['then'](respondWithResult(_0xe55599,0xc9))[_0x8fbb('0x49')](handleError(_0xe55599,null));};exports[_0x8fbb('0x29')]=function(_0x1fb2e9,_0x5cef7f){if(_0x1fb2e9[_0x8fbb('0x58')]['id']){delete _0x1fb2e9['body']['id'];}return db['CmList'][_0x8fbb('0x55')]({'where':{'id':_0x1fb2e9[_0x8fbb('0x4b')]['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x5cef7f,null))[_0x8fbb('0x2a')](saveUpdates(_0x1fb2e9['body'],null))[_0x8fbb('0x2a')](respondWithResult(_0x5cef7f,null))['catch'](handleError(_0x5cef7f,null));};exports[_0x8fbb('0x2b')]=function(_0xee24c7,_0x248014){return db[_0x8fbb('0x35')][_0x8fbb('0x55')]({'where':{'id':_0xee24c7['params']['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x248014,null))['then'](removeEntity(_0x248014,null))[_0x8fbb('0x49')](handleError(_0x248014,null));};exports[_0x8fbb('0x59')]=function(_0x31aae4,_0x5e3888){return db[_0x8fbb('0x35')][_0x8fbb('0x59')]()[_0x8fbb('0x2a')](respondWithResult(_0x5e3888,null))[_0x8fbb('0x49')](handleError(_0x5e3888,null));};exports[_0x8fbb('0x5a')]=function(_0x1ee8a4,_0x5582c8,_0x30468b){if(_0x1ee8a4[_0x8fbb('0x58')]['id']){delete _0x1ee8a4[_0x8fbb('0x58')]['id'];}return db[_0x8fbb('0x35')][_0x8fbb('0x55')]({'where':{'id':_0x1ee8a4[_0x8fbb('0x4b')]['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x5582c8,null))[_0x8fbb('0x2a')](function(_0x3fcd78){if(_0x3fcd78){_0x1ee8a4[_0x8fbb('0x58')]['ListId']=_0x3fcd78['id'];return db[_0x8fbb('0x5b')][_0x8fbb('0x51')](_0x1ee8a4[_0x8fbb('0x58')]);}})[_0x8fbb('0x2a')](respondWithResult(_0x5582c8,null))[_0x8fbb('0x49')](handleError(_0x5582c8,null));};exports['getDispositions']=function(_0x1d172e,_0x478cb2,_0x59d985){var _0xcef8a7={'raw':![],'where':{}};var _0x32cf71={};var _0x4b7cc7={'count':0x0,'rows':[]};return db[_0x8fbb('0x35')][_0x8fbb('0x5c')]({'where':{'id':_0x1d172e['params']['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x478cb2,null))[_0x8fbb('0x2a')](function(_0x33e86){if(_0x33e86){_0x32cf71[_0x8fbb('0x39')]=_[_0x8fbb('0x4c')](db[_0x8fbb('0x5b')][_0x8fbb('0x36')]);_0x32cf71[_0x8fbb('0x3a')]=_['keys'](_0x1d172e[_0x8fbb('0x3a')]);_0x32cf71['filters']=_[_0x8fbb('0x3c')](_0x32cf71[_0x8fbb('0x39')],_0x32cf71[_0x8fbb('0x3a')]);_0xcef8a7['attributes']=_[_0x8fbb('0x3c')](_0x32cf71[_0x8fbb('0x39')],qs[_0x8fbb('0x3d')](_0x1d172e[_0x8fbb('0x3a')][_0x8fbb('0x3d')]));_0xcef8a7['attributes']=_0xcef8a7[_0x8fbb('0x3e')][_0x8fbb('0x4d')]?_0xcef8a7[_0x8fbb('0x3e')]:_0x32cf71['model'];if(!_0x1d172e[_0x8fbb('0x3a')][_0x8fbb('0x3f')]('nolimit')){_0xcef8a7['limit']=qs[_0x8fbb('0x23')](_0x1d172e['query'][_0x8fbb('0x23')]);_0xcef8a7['offset']=qs['offset'](_0x1d172e[_0x8fbb('0x3a')][_0x8fbb('0x21')]);}_0xcef8a7[_0x8fbb('0x41')]=qs[_0x8fbb('0x42')](_0x1d172e[_0x8fbb('0x3a')]['sort']);_0xcef8a7[_0x8fbb('0x43')]=qs['filters'](_['pick'](_0x1d172e[_0x8fbb('0x3a')],_0x32cf71['filters']));_0xcef8a7[_0x8fbb('0x43')][_0x8fbb('0x5d')]=_0x33e86['id'];if(_0x1d172e['query'][_0x8fbb('0x45')]){_0xcef8a7[_0x8fbb('0x43')]=_[_0x8fbb('0x5e')](_0xcef8a7['where'],{'$or':_[_0x8fbb('0x34')](_0xcef8a7[_0x8fbb('0x3e')],function(_0x2c7009){var _0x282543={};_0x282543[_0x2c7009]={'$like':'%'+_0x1d172e['query']['filter']+'%'};return _0x282543;})});}_0xcef8a7=_['merge']({},_0xcef8a7,_0x1d172e[_0x8fbb('0x50')]);return db[_0x8fbb('0x5b')][_0x8fbb('0x24')]({'where':_0xcef8a7['where']})[_0x8fbb('0x2a')](function(_0x25877b){_0x4b7cc7[_0x8fbb('0x24')]=_0x25877b;if(_0x1d172e['query'][_0x8fbb('0x4e')]){_0xcef8a7['include']=[{'all':!![]}];}return db[_0x8fbb('0x5b')][_0x8fbb('0x47')](_0xcef8a7);})[_0x8fbb('0x2a')](function(_0x554440){_0x4b7cc7['rows']=_0x554440;return _0x4b7cc7;});}})[_0x8fbb('0x2a')](respondWithFilteredResult(_0x478cb2,_0xcef8a7))[_0x8fbb('0x49')](handleError(_0x478cb2,null));};exports[_0x8fbb('0x5f')]=function(_0x37d832,_0x1079b4,_0x30c502){return db[_0x8fbb('0x35')]['find']({'where':{'id':_0x37d832['params']['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x1079b4,null))[_0x8fbb('0x2a')](function(_0x2c9777){if(_0x2c9777){return _0x2c9777[_0x8fbb('0x5f')](_0x37d832[_0x8fbb('0x3a')]['ids']);}})[_0x8fbb('0x2a')](respondWithStatusCode(_0x1079b4,null))[_0x8fbb('0x49')](handleError(_0x1079b4,null));};exports[_0x8fbb('0x60')]=function(_0x198263,_0xac9b86,_0x25111a){return db['CmList'][_0x8fbb('0x55')]({'where':{'id':_0x198263[_0x8fbb('0x4b')]['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0xac9b86,null))[_0x8fbb('0x2a')](function(_0x2ab985){if(_0x2ab985){var _0x47d7dd=[];var _0x501f58={'success':[],'errors':[]};return db[_0x8fbb('0x61')][_0x8fbb('0x59')]()[_0x8fbb('0x2a')](function(_0x5656b1){if(_0x198263[_0x8fbb('0x58')][_0x8fbb('0x62')]&&_[_0x8fbb('0x63')](_0x198263[_0x8fbb('0x58')]['tags'])){if(_0x198263[_0x8fbb('0x58')][_0x8fbb('0x62')][_0x8fbb('0x4d')]){_0x198263[_0x8fbb('0x58')][_0x8fbb('0x62')]=_0x198263[_0x8fbb('0x58')]['tags']['join'](';')+';';}else{_0x198263[_0x8fbb('0x58')][_0x8fbb('0x62')]=null;}}else{_0x198263[_0x8fbb('0x58')][_0x8fbb('0x62')]=null;}if(_0x198263[_0x8fbb('0x58')]&&_['isArray'](_0x198263['body'])){for(var _0x183a29=0x0;_0x183a29<_0x198263['body'][_0x8fbb('0x4d')];_0x183a29+=0x1){_0x198263[_0x8fbb('0x58')][_0x183a29]['ListId']=_0x198263[_0x8fbb('0x4b')]['id'];_0x47d7dd[_0x8fbb('0x64')](_0x198263[_0x8fbb('0x58')][_0x183a29]);}return BPromise['each'](_0x47d7dd,function(_0x35b6c0){return db[_0x8fbb('0x61')][_0x8fbb('0x51')](_['omit'](_0x35b6c0,['ids','id'])||{},{'fields':_[_0x8fbb('0x4c')](_0x5656b1),'raw':!![]})[_0x8fbb('0x2a')](function(_0x58d1e2){_0x501f58[_0x8fbb('0x65')][_0x8fbb('0x64')](_0x58d1e2['dataValues']);})[_0x8fbb('0x49')](function(_0x4c0573){_0x501f58[_0x8fbb('0x66')][_0x8fbb('0x64')]({'data':_0x35b6c0,'error':_0x4c0573['message']});});})[_0x8fbb('0x2a')](function(_0x1ad6be){return _0x501f58;})[_0x8fbb('0x49')](function(_0x4e2dfe){return _0x4e2dfe;});}else{_0xac9b86[_0x8fbb('0x1e')](0x190)[_0x8fbb('0x20')]({'message':_0x8fbb('0x67')});}});}})['then'](respondWithResult(_0xac9b86,null))[_0x8fbb('0x49')](handleError(_0xac9b86,null));};exports[_0x8fbb('0x68')]=function(_0x185826,_0x214f18,_0x4255c7){var _0x1af251;return db[_0x8fbb('0x35')]['find']({'where':{'id':_0x185826[_0x8fbb('0x4b')]['id']},'include':[{'model':db[_0x8fbb('0x69')],'as':_0x8fbb('0x6a')}]})['then'](handleEntityNotFound(_0x214f18,null))['then'](function(_0x5adfee){if(_0x5adfee){_0x1af251=_0x5adfee;return db[_0x8fbb('0x61')]['rawAttributes'];}})[_0x8fbb('0x2a')](function(_0x225b39){if(_0x225b39){var _0xae1825={};var _0xd85a8a={};_0xd85a8a[_0x8fbb('0x39')]=_[_0x8fbb('0x6b')](_['keys'](_0x225b39),_[_0x8fbb('0x34')](_0x1af251[_0x8fbb('0x6a')],function(_0x69f7a){return util['format'](_0x8fbb('0x6c'),_0x69f7a['id']);}));_0xd85a8a[_0x8fbb('0x3a')]=_[_0x8fbb('0x4c')](_0x185826['query']);_0xd85a8a[_0x8fbb('0x3b')]=_['intersection'](_0xd85a8a[_0x8fbb('0x39')],_0xd85a8a[_0x8fbb('0x3a')]);_0xae1825[_0x8fbb('0x3e')]=_[_0x8fbb('0x3c')](_0xd85a8a['model'],qs[_0x8fbb('0x3d')](_0x185826['query']['fields']));_0xae1825['attributes']=_0xae1825[_0x8fbb('0x3e')][_0x8fbb('0x4d')]?_0xae1825[_0x8fbb('0x3e')]:_0xd85a8a['model'];if(!_0x185826[_0x8fbb('0x3a')][_0x8fbb('0x3f')](_0x8fbb('0x40'))){_0xae1825[_0x8fbb('0x23')]=qs[_0x8fbb('0x23')](_0x185826[_0x8fbb('0x3a')][_0x8fbb('0x23')]);_0xae1825[_0x8fbb('0x21')]=qs[_0x8fbb('0x21')](_0x185826['query']['offset']);}_0xae1825[_0x8fbb('0x41')]=qs[_0x8fbb('0x42')](_0x185826[_0x8fbb('0x3a')]['sort']);_0xae1825[_0x8fbb('0x43')]=qs[_0x8fbb('0x3b')](_[_0x8fbb('0x44')](_0x185826[_0x8fbb('0x3a')],_0xd85a8a['filters']));_0xae1825[_0x8fbb('0x6d')]=!![];if(_0x185826['query'][_0x8fbb('0x45')]){_0xae1825[_0x8fbb('0x43')]=_['merge'](_0xae1825[_0x8fbb('0x43')],{'$or':_['map'](_0xae1825['attributes'],function(_0x14ca98){var _0x43c975={};_0x43c975[_0x14ca98]={'$like':'%'+_0x185826[_0x8fbb('0x3a')][_0x8fbb('0x45')]+'%'};return _0x43c975;})});}_0xae1825=_[_0x8fbb('0x5e')]({},_0xae1825,_0x185826['options']);return _0x1af251['getContacts'](_0xae1825);}})[_0x8fbb('0x2a')](respondWithResult(_0x214f18,null))[_0x8fbb('0x49')](handleError(_0x214f18,null));};exports[_0x8fbb('0x6e')]=function(_0x50f924,_0x22ad17,_0x9d05c4){var _0x5a32e8;return db[_0x8fbb('0x35')][_0x8fbb('0x55')]({'where':{'id':_0x50f924['params']['id']},'include':[{'model':db[_0x8fbb('0x69')],'as':_0x8fbb('0x6a')}]})[_0x8fbb('0x2a')](handleEntityNotFound(_0x22ad17,null))[_0x8fbb('0x2a')](function(_0x41bbd1){if(_0x41bbd1){_0x5a32e8=_0x41bbd1;return db[_0x8fbb('0x61')][_0x8fbb('0x36')];}})[_0x8fbb('0x2a')](function(_0x257910){if(_0x257910){var _0x3d352e={};var _0x2356ea={};_0x2356ea[_0x8fbb('0x39')]=_['concat'](_['keys'](_0x257910),_[_0x8fbb('0x34')](_0x5a32e8[_0x8fbb('0x6a')],function(_0xcf0f7a){return util[_0x8fbb('0x6f')](_0x8fbb('0x6c'),_0xcf0f7a['id']);}));_0x2356ea[_0x8fbb('0x3a')]=_[_0x8fbb('0x4c')](_0x50f924[_0x8fbb('0x3a')]);_0x2356ea['filters']=_[_0x8fbb('0x3c')](_0x2356ea['model'],_0x2356ea[_0x8fbb('0x3a')]);_0x3d352e['attributes']=_[_0x8fbb('0x3c')](_0x2356ea['model'],qs[_0x8fbb('0x3d')](_0x50f924[_0x8fbb('0x3a')][_0x8fbb('0x3d')]));_0x3d352e[_0x8fbb('0x3e')]=_0x3d352e[_0x8fbb('0x3e')]['length']?_0x3d352e[_0x8fbb('0x3e')]:_0x2356ea[_0x8fbb('0x39')];if(!_0x50f924[_0x8fbb('0x3a')][_0x8fbb('0x3f')](_0x8fbb('0x40'))){_0x3d352e[_0x8fbb('0x23')]=qs[_0x8fbb('0x23')](_0x50f924[_0x8fbb('0x3a')][_0x8fbb('0x23')]);_0x3d352e[_0x8fbb('0x21')]=qs['offset'](_0x50f924['query'][_0x8fbb('0x21')]);}_0x3d352e[_0x8fbb('0x41')]=qs[_0x8fbb('0x42')](_0x50f924['query'][_0x8fbb('0x42')]);_0x3d352e[_0x8fbb('0x43')]=qs[_0x8fbb('0x3b')](_[_0x8fbb('0x44')](_0x50f924[_0x8fbb('0x3a')],_0x2356ea[_0x8fbb('0x3b')]));_0x3d352e['raw']=!![];if(_0x50f924[_0x8fbb('0x3a')][_0x8fbb('0x45')]){_0x3d352e[_0x8fbb('0x43')]=_[_0x8fbb('0x5e')](_0x3d352e[_0x8fbb('0x43')],{'$or':_['map'](_0x3d352e['attributes'],function(_0x22d0be){var _0x1bf5a7={};_0x1bf5a7[_0x22d0be]={'$like':'%'+_0x50f924[_0x8fbb('0x3a')][_0x8fbb('0x45')]+'%'};return _0x1bf5a7;})});}_0x3d352e=_['merge']({},_0x3d352e,_0x50f924['options']);return _0x5a32e8[_0x8fbb('0x68')](_0x3d352e);}})[_0x8fbb('0x2a')](function(_0xefe5b5){if(!_[_0x8fbb('0x70')](_0xefe5b5)){var _0x147fe7=toCsv(_0xefe5b5);var _0x4e72f1=Date[_0x8fbb('0x71')]();fs[_0x8fbb('0x72')](util[_0x8fbb('0x6f')](_0x8fbb('0x73'),_0x5a32e8['id'],_0x4e72f1),_0x147fe7);_0x22ad17['setHeader'](_0x8fbb('0x74'),_0x8fbb('0x75')+util[_0x8fbb('0x6f')](_0x8fbb('0x76'),_0x5a32e8['id'],_0x4e72f1));_0x22ad17[_0x8fbb('0x77')](_0x8fbb('0x78'),_0x8fbb('0x79'));return _0x22ad17[_0x8fbb('0x7a')](util[_0x8fbb('0x6f')](_0x8fbb('0x73'),_0x5a32e8['id'],_0x4e72f1));}else{return _0x22ad17[_0x8fbb('0x1d')](0xcc);}})[_0x8fbb('0x49')](handleError(_0x22ad17,null));};exports[_0x8fbb('0x7b')]=function(_0x4009c5,_0x30b4ec,_0x273717){var _0x4a47b2;delete _0x4009c5[_0x8fbb('0x58')]['id'];return db[_0x8fbb('0x35')][_0x8fbb('0x5c')]({'where':{'id':_0x4009c5[_0x8fbb('0x4b')]['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x30b4ec,null))[_0x8fbb('0x2a')](function(_0x2b8280){if(_0x2b8280){return db[_0x8fbb('0x7c')][_0x8fbb('0x7d')](function(_0x306ed3){return db[_0x8fbb('0x69')][_0x8fbb('0x51')](_0x4009c5[_0x8fbb('0x58')],{'transaction':_0x306ed3})[_0x8fbb('0x2a')](function(_0x4538ea){_0x4a47b2=_0x4538ea;return _0x2b8280[_0x8fbb('0x7e')](_0x4538ea,{'transaction':_0x306ed3});})['then'](function(){var _0x12c0f0={'type':db[_0x8fbb('0x7f')][_0x8fbb('0x80')],'transaction':_0x306ed3};switch(_0x4009c5[_0x8fbb('0x58')]['type']){case _0x8fbb('0x81'):_0x12c0f0[_0x8fbb('0x38')]=db[_0x8fbb('0x7f')][_0x8fbb('0x80')];break;case _0x8fbb('0x82'):_0x12c0f0[_0x8fbb('0x38')]=db[_0x8fbb('0x7f')][_0x8fbb('0x83')];break;case _0x8fbb('0x84'):_0x12c0f0[_0x8fbb('0x38')]=db[_0x8fbb('0x7f')][_0x8fbb('0x85')];_0x12c0f0[_0x8fbb('0x86')]=![];break;default:}return db[_0x8fbb('0x7c')][_0x8fbb('0x87')][_0x8fbb('0x88')](_0x8fbb('0x89'),util[_0x8fbb('0x6f')](_0x8fbb('0x8a'),_0x4a47b2['id']),_0x12c0f0);})[_0x8fbb('0x2a')](function(){return _0x4a47b2;});});}})[_0x8fbb('0x2a')](respondWithResult(_0x30b4ec,null))[_0x8fbb('0x49')](handleError(_0x30b4ec,null));};exports[_0x8fbb('0x8b')]=function(_0x4530fc,_0x421b6e,_0x6aa813){var _0x199f7a={};var _0x433b8f={};var _0x38c49e;var _0x4c9716;return db[_0x8fbb('0x35')]['findOne']({'where':{'id':_0x4530fc[_0x8fbb('0x4b')]['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x421b6e,null))[_0x8fbb('0x2a')](function(_0x3c0af6){if(_0x3c0af6){_0x38c49e=_0x3c0af6;_0x433b8f[_0x8fbb('0x39')]=_[_0x8fbb('0x4c')](db[_0x8fbb('0x69')][_0x8fbb('0x36')]);_0x433b8f[_0x8fbb('0x3a')]=_[_0x8fbb('0x4c')](_0x4530fc[_0x8fbb('0x3a')]);_0x433b8f[_0x8fbb('0x3b')]=_[_0x8fbb('0x3c')](_0x433b8f[_0x8fbb('0x39')],_0x433b8f[_0x8fbb('0x3a')]);_0x199f7a[_0x8fbb('0x3e')]=_['intersection'](_0x433b8f[_0x8fbb('0x39')],qs[_0x8fbb('0x3d')](_0x4530fc[_0x8fbb('0x3a')]['fields']));_0x199f7a[_0x8fbb('0x3e')]=_0x199f7a[_0x8fbb('0x3e')][_0x8fbb('0x4d')]?_0x199f7a[_0x8fbb('0x3e')]:_0x433b8f[_0x8fbb('0x39')];_0x199f7a[_0x8fbb('0x41')]=qs['sort'](_0x4530fc['query'][_0x8fbb('0x42')]);_0x199f7a['where']=qs[_0x8fbb('0x3b')](_[_0x8fbb('0x44')](_0x4530fc[_0x8fbb('0x3a')],_0x433b8f[_0x8fbb('0x3b')]));_0x199f7a[_0x8fbb('0x43')]=_[_0x8fbb('0x5e')](_0x199f7a[_0x8fbb('0x43')],{'$or':[{'ListId':_0x3c0af6['id']},{'ListId':null}]});if(_0x4530fc[_0x8fbb('0x3a')][_0x8fbb('0x45')]){_0x199f7a[_0x8fbb('0x43')]=_['merge'](_0x199f7a[_0x8fbb('0x43')],{'$or':_[_0x8fbb('0x34')](_0x199f7a[_0x8fbb('0x3e')],function(_0xdcebb1){var _0x61cb53={};_0x61cb53[_0xdcebb1]={'$like':'%'+_0x4530fc['query'][_0x8fbb('0x45')]+'%'};return _0x61cb53;})});}_0x199f7a=_[_0x8fbb('0x5e')]({},_0x199f7a,_0x4530fc[_0x8fbb('0x50')]);return db[_0x8fbb('0x69')][_0x8fbb('0x8c')](_0x199f7a);}})[_0x8fbb('0x2a')](respondWithResult(_0x421b6e,null))['catch'](handleError(_0x421b6e,null));};exports['addAgents']=function(_0x91e19e,_0x4e42e1,_0x2dfdb4){return db[_0x8fbb('0x35')][_0x8fbb('0x55')]({'where':{'id':_0x91e19e['params']['id']}})[_0x8fbb('0x2a')](handleEntityNotFound(_0x4e42e1,null))['then'](function(_0x2e1e95){if(_0x2e1e95){return _0x2e1e95['addAgents'](_0x91e19e[_0x8fbb('0x58')][_0x8fbb('0x8d')],_['omit'](_0x91e19e[_0x8fbb('0x58')],[_0x8fbb('0x8d'),'id'])||{})['spread'](function(_0x3f4c6f){for(var _0x654c8f=0x0;_0x654c8f<_0x91e19e[_0x8fbb('0x58')][_0x8fbb('0x8d')][_0x8fbb('0x4d')];_0x654c8f+=0x1){socket[_0x8fbb('0x8e')](_0x8fbb('0x8f'),{'UserId':Number(_0x91e19e['body']['ids'][_0x654c8f]),'CmListId':Number(_0x91e19e[_0x8fbb('0x4b')]['id'])});}return _0x3f4c6f;});}})[_0x8fbb('0x2a')](respondWithResult(_0x4e42e1,null))['catch'](handleError(_0x4e42e1,null));};exports[_0x8fbb('0x90')]=function(_0x435e11,_0x3d3e8a,_0x71875b){return db[_0x8fbb('0x35')]['find']({'where':{'id':_0x435e11[_0x8fbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d3e8a,null))[_0x8fbb('0x2a')](function(_0x35d246){if(_0x35d246){return _0x35d246['removeAgents'](_0x435e11['query'][_0x8fbb('0x8d')])[_0x8fbb('0x2a')](function(){if(_[_0x8fbb('0x63')](_0x435e11[_0x8fbb('0x3a')][_0x8fbb('0x8d')])){for(var _0x565206=0x0;_0x565206<_0x435e11[_0x8fbb('0x3a')]['ids'][_0x8fbb('0x4d')];_0x565206+=0x1){socket[_0x8fbb('0x8e')](_0x8fbb('0x91'),{'UserId':Number(_0x435e11[_0x8fbb('0x3a')][_0x8fbb('0x8d')][_0x565206]),'CmListId':Number(_0x435e11['params']['id'])});}}else{socket[_0x8fbb('0x8e')](_0x8fbb('0x91'),{'UserId':Number(_0x435e11[_0x8fbb('0x3a')][_0x8fbb('0x8d')]),'CmListId':Number(_0x435e11[_0x8fbb('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3e8a,null))['catch'](handleError(_0x3d3e8a,null));};exports[_0x8fbb('0x92')]=function(_0x55d685,_0x2de859,_0x55f12b){var _0x2873a7={};var _0x81eaab={};var _0x2119b0;var _0x2887d0;return db[_0x8fbb('0x35')][_0x8fbb('0x5c')]({'where':{'id':_0x55d685[_0x8fbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2de859,null))[_0x8fbb('0x2a')](function(_0x5c321c){if(_0x5c321c){_0x2119b0=_0x5c321c;_0x81eaab[_0x8fbb('0x39')]=_['keys'](db[_0x8fbb('0x93')][_0x8fbb('0x36')]);_0x81eaab[_0x8fbb('0x3a')]=_[_0x8fbb('0x4c')](_0x55d685['query']);_0x81eaab[_0x8fbb('0x3b')]=_['intersection'](_0x81eaab['model'],_0x81eaab['query']);_0x2873a7[_0x8fbb('0x3e')]=_[_0x8fbb('0x3c')](_0x81eaab[_0x8fbb('0x39')],qs[_0x8fbb('0x3d')](_0x55d685[_0x8fbb('0x3a')][_0x8fbb('0x3d')]));_0x2873a7[_0x8fbb('0x3e')]=_0x2873a7[_0x8fbb('0x3e')][_0x8fbb('0x4d')]?_0x2873a7['attributes']:_0x81eaab[_0x8fbb('0x39')];_0x2873a7[_0x8fbb('0x41')]=qs[_0x8fbb('0x42')](_0x55d685[_0x8fbb('0x3a')]['sort']);_0x2873a7[_0x8fbb('0x43')]=qs[_0x8fbb('0x3b')](_['pick'](_0x55d685[_0x8fbb('0x3a')],_0x81eaab[_0x8fbb('0x3b')]));if(_0x55d685[_0x8fbb('0x3a')][_0x8fbb('0x45')]){_0x2873a7[_0x8fbb('0x43')]=_['merge'](_0x2873a7[_0x8fbb('0x43')],{'$or':_[_0x8fbb('0x34')](_0x2873a7[_0x8fbb('0x3e')],function(_0x1e4730){var _0x49c115={};_0x49c115[_0x1e4730]={'$like':'%'+_0x55d685[_0x8fbb('0x3a')][_0x8fbb('0x45')]+'%'};return _0x49c115;})});}_0x2873a7=_[_0x8fbb('0x5e')]({},_0x2873a7,_0x55d685[_0x8fbb('0x50')]);return _0x2119b0[_0x8fbb('0x92')](_0x2873a7);}})[_0x8fbb('0x2a')](function(_0x321aa1){if(_0x321aa1){_0x2887d0=_0x321aa1['length'];if(!_0x55d685[_0x8fbb('0x3a')][_0x8fbb('0x3f')](_0x8fbb('0x40'))){_0x2873a7[_0x8fbb('0x23')]=qs[_0x8fbb('0x23')](_0x55d685[_0x8fbb('0x3a')]['limit']);_0x2873a7[_0x8fbb('0x21')]=qs[_0x8fbb('0x21')](_0x55d685[_0x8fbb('0x3a')][_0x8fbb('0x21')]);}return _0x2119b0[_0x8fbb('0x92')](_0x2873a7);}})[_0x8fbb('0x2a')](function(_0x1b7efc){if(_0x1b7efc){return _0x1b7efc?{'count':_0x2887d0,'rows':_0x1b7efc}:null;}})[_0x8fbb('0x2a')](respondWithResult(_0x2de859,null))[_0x8fbb('0x49')](handleError(_0x2de859,null));}; \ No newline at end of file +var _0xb9ad=['bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addDisposition','ListId','Disposition','getDispositions','findOne','filter','removeDispositions','ids','describe','tags','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmContact','now','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0xb9ad,0x1b1));var _0xdb9a=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb9ad[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xdb9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb9a('0x1'));var jsonpatch=require(_0xdb9a('0x2'));var rp=require(_0xdb9a('0x3'));var moment=require(_0xdb9a('0x4'));var BPromise=require(_0xdb9a('0x5'));var Mustache=require(_0xdb9a('0x6'));var util=require(_0xdb9a('0x7'));var path=require(_0xdb9a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb9a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb9a('0xa'));var squel=require(_0xdb9a('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb9a('0xc'));var deskjs=require(_0xdb9a('0xd'));var toCsv=require(_0xdb9a('0xe'));var querystring=require(_0xdb9a('0xf'));var Papa=require(_0xdb9a('0x10'));var Redis=require('ioredis');var authService=require(_0xdb9a('0x11'));var qs=require(_0xdb9a('0x12'));var as=require(_0xdb9a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb9a('0x14'))('api');var utils=require(_0xdb9a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdb9a('0x16'));var db=require(_0xdb9a('0x17'))['db'];config['redis']=_[_0xdb9a('0x18')](config[_0xdb9a('0x19')],{'host':_0xdb9a('0x1a'),'port':0x18eb});var socket=require(_0xdb9a('0x1b'))(new Redis(config[_0xdb9a('0x19')]));require(_0xdb9a('0x1c'))['register'](socket);function respondWithStatusCode(_0x542fcb,_0x3498c8){_0x3498c8=_0x3498c8||0xcc;return function(_0x429fab){if(_0x429fab){return _0x542fcb[_0xdb9a('0x1d')](_0x3498c8);}return _0x542fcb[_0xdb9a('0x1e')](_0x3498c8)[_0xdb9a('0x1f')]();};}function respondWithResult(_0x121dfd,_0x334d49){_0x334d49=_0x334d49||0xc8;return function(_0x44e188){if(_0x44e188){return _0x121dfd['status'](_0x334d49)[_0xdb9a('0x20')](_0x44e188);}};}function respondWithFilteredResult(_0x1c7d20,_0x15376c){return function(_0xe707f2){if(_0xe707f2){var _0x422a8b=typeof _0x15376c[_0xdb9a('0x21')]===_0xdb9a('0x22')&&typeof _0x15376c[_0xdb9a('0x23')]===_0xdb9a('0x22');var _0x47990b=_0xe707f2[_0xdb9a('0x24')];var _0x3cb1ec=_0x422a8b?0x0:_0x15376c[_0xdb9a('0x21')];var _0x42f208=_0x422a8b?_0xe707f2[_0xdb9a('0x24')]:_0x15376c[_0xdb9a('0x21')]+_0x15376c['limit'];var _0x59b3f5;if(_0x42f208>=_0x47990b){_0x42f208=_0x47990b;_0x59b3f5=0xc8;}else{_0x59b3f5=0xce;}_0x1c7d20['status'](_0x59b3f5);return _0x1c7d20[_0xdb9a('0x25')](_0xdb9a('0x26'),_0x3cb1ec+'-'+_0x42f208+'/'+_0x47990b)[_0xdb9a('0x20')](_0xe707f2);}return null;};}function patchUpdates(_0x16207b){return function(_0x398f1e){try{jsonpatch[_0xdb9a('0x27')](_0x398f1e,_0x16207b,!![]);}catch(_0x49b476){return BPromise[_0xdb9a('0x28')](_0x49b476);}return _0x398f1e[_0xdb9a('0x29')]();};}function saveUpdates(_0x540cf8,_0x379b5f){return function(_0x570562){if(_0x570562){return _0x570562[_0xdb9a('0x2a')](_0x540cf8)[_0xdb9a('0x2b')](function(_0x5ca072){return _0x5ca072;});}return null;};}function removeEntity(_0x1fdeef,_0x82cd02){return function(_0x5bef56){if(_0x5bef56){return _0x5bef56['destroy']()[_0xdb9a('0x2b')](function(){var _0x54cb2a=_0x5bef56[_0xdb9a('0x2c')]({'plain':!![]});var _0x1b7b0a=_0xdb9a('0x2d');return db[_0xdb9a('0x2e')]['destroy']({'where':{'type':_0x1b7b0a,'resourceId':_0x54cb2a['id']}})['then'](function(){return _0x5bef56;});})['then'](function(){_0x1fdeef[_0xdb9a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d899,_0x1e733b){return function(_0x55aeca){if(!_0x55aeca){_0x43d899['sendStatus'](0x194);}return _0x55aeca;};}function handleError(_0xaa770c,_0x2595ec){_0x2595ec=_0x2595ec||0x1f4;return function(_0x45892a){logger[_0xdb9a('0x2f')](_0x45892a[_0xdb9a('0x30')]);if(_0x45892a[_0xdb9a('0x31')]){delete _0x45892a[_0xdb9a('0x31')];}_0xaa770c[_0xdb9a('0x1e')](_0x2595ec)['send'](_0x45892a);};}exports[_0xdb9a('0x32')]=function(_0x43493b,_0x135ef1){var _0x5a9638={},_0x3bb55a={},_0x1460c2={'count':0x0,'rows':[]};var _0x24317c=_[_0xdb9a('0x33')](db[_0xdb9a('0x34')][_0xdb9a('0x35')],function(_0xaa027d){return{'name':_0xaa027d[_0xdb9a('0x36')],'type':_0xaa027d[_0xdb9a('0x37')]['key']};});_0x3bb55a['model']=_[_0xdb9a('0x33')](_0x24317c,_0xdb9a('0x31'));_0x3bb55a[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x43493b[_0xdb9a('0x38')]);_0x3bb55a[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0x3bb55a[_0xdb9a('0x3c')],_0x3bb55a[_0xdb9a('0x38')]);_0x5a9638['attributes']=_[_0xdb9a('0x3b')](_0x3bb55a[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x5a9638[_0xdb9a('0x3e')]=_0x5a9638['attributes'][_0xdb9a('0x3f')]?_0x5a9638[_0xdb9a('0x3e')]:_0x3bb55a[_0xdb9a('0x3c')];if(!_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x5a9638[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x43493b[_0xdb9a('0x38')]['limit']);_0x5a9638['offset']=qs[_0xdb9a('0x21')](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x21')]);}_0x5a9638[_0xdb9a('0x42')]=qs['sort'](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x5a9638[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x43493b[_0xdb9a('0x38')],_0x3bb55a[_0xdb9a('0x3a')]),_0x24317c);if(_0x43493b[_0xdb9a('0x38')]['filter']){_0x5a9638[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5a9638[_0xdb9a('0x44')],{'$or':_['map'](_0x24317c,function(_0x36b160){if(_0x36b160[_0xdb9a('0x37')]!==_0xdb9a('0x47')){var _0x9c9eac={};_0x9c9eac[_0x36b160[_0xdb9a('0x31')]]={'$like':'%'+_0x43493b[_0xdb9a('0x38')]['filter']+'%'};return _0x9c9eac;}})});}_0x5a9638=_[_0xdb9a('0x46')]({},_0x5a9638,_0x43493b['options']);var _0x2b330a={'where':_0x5a9638['where']};return db[_0xdb9a('0x34')][_0xdb9a('0x24')](_0x2b330a)[_0xdb9a('0x2b')](function(_0x1dcede){_0x1460c2['count']=_0x1dcede;if(_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x5a9638['include']=[{'all':!![]}];}return db[_0xdb9a('0x34')][_0xdb9a('0x49')](_0x5a9638);})[_0xdb9a('0x2b')](function(_0x2239e8){_0x1460c2[_0xdb9a('0x4a')]=_0x2239e8;return _0x1460c2;})[_0xdb9a('0x2b')](respondWithFilteredResult(_0x135ef1,_0x5a9638))[_0xdb9a('0x4b')](handleError(_0x135ef1,null));};exports['show']=function(_0x1b52b1,_0x3f19db){var _0x1ccd36={'raw':![],'where':{'id':_0x1b52b1[_0xdb9a('0x4c')]['id']}},_0x3e7c45={};_0x3e7c45['model']=_[_0xdb9a('0x39')](db[_0xdb9a('0x34')][_0xdb9a('0x35')]);_0x3e7c45[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x1b52b1[_0xdb9a('0x38')]);_0x3e7c45['filters']=_[_0xdb9a('0x3b')](_0x3e7c45[_0xdb9a('0x3c')],_0x3e7c45['query']);_0x1ccd36[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x3e7c45[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x1b52b1[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x1ccd36[_0xdb9a('0x3e')]=_0x1ccd36['attributes'][_0xdb9a('0x3f')]?_0x1ccd36[_0xdb9a('0x3e')]:_0x3e7c45['model'];if(_0x1b52b1[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x1ccd36[_0xdb9a('0x4d')]=[{'all':!![]}];}_0x1ccd36=_['merge']({},_0x1ccd36,_0x1b52b1[_0xdb9a('0x4e')]);return db[_0xdb9a('0x34')][_0xdb9a('0x4f')](_0x1ccd36)[_0xdb9a('0x2b')](handleEntityNotFound(_0x3f19db,null))[_0xdb9a('0x2b')](respondWithResult(_0x3f19db,null))['catch'](handleError(_0x3f19db,null));};exports['create']=function(_0x4b7077,_0x1c5d4b){return db['CmList'][_0xdb9a('0x50')](_0x4b7077[_0xdb9a('0x51')],{})[_0xdb9a('0x2b')](function(_0x254ec9){var _0x29ff41=_0x4b7077[_0xdb9a('0x52')]['get']({'plain':!![]});if(!_0x29ff41)throw new Error(_0xdb9a('0x53'));if(_0x29ff41[_0xdb9a('0x54')]===_0xdb9a('0x52')){var _0x4c55e7=_0x254ec9[_0xdb9a('0x2c')]({'plain':!![]});var _0x4d3c02=_0xdb9a('0x2d');return db[_0xdb9a('0x55')]['find']({'where':{'name':_0x4d3c02,'userProfileId':_0x29ff41[_0xdb9a('0x56')]},'raw':!![]})['then'](function(_0x32096e){if(_0x32096e&&_0x32096e['autoAssociation']===0x0){return db[_0xdb9a('0x2e')]['create']({'name':_0x4c55e7[_0xdb9a('0x31')],'resourceId':_0x4c55e7['id'],'type':_0x32096e[_0xdb9a('0x31')],'sectionId':_0x32096e['id']},{})[_0xdb9a('0x2b')](function(){return _0x254ec9;});}else{return _0x254ec9;}})['catch'](function(_0x2549c1){logger[_0xdb9a('0x2f')](_0xdb9a('0x57'),_0x2549c1);throw _0x2549c1;});}return _0x254ec9;})[_0xdb9a('0x2b')](respondWithResult(_0x1c5d4b,0xc9))[_0xdb9a('0x4b')](handleError(_0x1c5d4b,null));};exports['update']=function(_0x5d44e4,_0x8c5622){if(_0x5d44e4[_0xdb9a('0x51')]['id']){delete _0x5d44e4[_0xdb9a('0x51')]['id'];}return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x5d44e4[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x8c5622,null))[_0xdb9a('0x2b')](saveUpdates(_0x5d44e4[_0xdb9a('0x51')],null))[_0xdb9a('0x2b')](respondWithResult(_0x8c5622,null))[_0xdb9a('0x4b')](handleError(_0x8c5622,null));};exports[_0xdb9a('0x58')]=function(_0x2e1fdf,_0x37fbad){return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x2e1fdf[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x37fbad,null))['then'](removeEntity(_0x37fbad,null))['catch'](handleError(_0x37fbad,null));};exports['describe']=function(_0x37e6f0,_0x3412b9){return db[_0xdb9a('0x34')]['describe']()[_0xdb9a('0x2b')](respondWithResult(_0x3412b9,null))['catch'](handleError(_0x3412b9,null));};exports[_0xdb9a('0x59')]=function(_0x370251,_0x4466ef,_0x5e0c92){if(_0x370251[_0xdb9a('0x51')]['id']){delete _0x370251[_0xdb9a('0x51')]['id'];}return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x370251[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4466ef,null))[_0xdb9a('0x2b')](function(_0x3b3f4f){if(_0x3b3f4f){_0x370251['body'][_0xdb9a('0x5a')]=_0x3b3f4f['id'];return db[_0xdb9a('0x5b')]['create'](_0x370251[_0xdb9a('0x51')]);}})[_0xdb9a('0x2b')](respondWithResult(_0x4466ef,null))[_0xdb9a('0x4b')](handleError(_0x4466ef,null));};exports[_0xdb9a('0x5c')]=function(_0x430936,_0x8c7f1a,_0x3125ab){var _0x14bb39={'raw':![],'where':{}};var _0x5523f9={};var _0x75ac5e={'count':0x0,'rows':[]};return db[_0xdb9a('0x34')][_0xdb9a('0x5d')]({'where':{'id':_0x430936['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x8c7f1a,null))[_0xdb9a('0x2b')](function(_0x48edc3){if(_0x48edc3){_0x5523f9[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db[_0xdb9a('0x5b')]['rawAttributes']);_0x5523f9[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x430936[_0xdb9a('0x38')]);_0x5523f9[_0xdb9a('0x3a')]=_['intersection'](_0x5523f9[_0xdb9a('0x3c')],_0x5523f9['query']);_0x14bb39[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x5523f9[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x430936['query'][_0xdb9a('0x3d')]));_0x14bb39[_0xdb9a('0x3e')]=_0x14bb39[_0xdb9a('0x3e')][_0xdb9a('0x3f')]?_0x14bb39[_0xdb9a('0x3e')]:_0x5523f9[_0xdb9a('0x3c')];if(!_0x430936[_0xdb9a('0x38')][_0xdb9a('0x40')]('nolimit')){_0x14bb39[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x430936['query'][_0xdb9a('0x23')]);_0x14bb39[_0xdb9a('0x21')]=qs['offset'](_0x430936[_0xdb9a('0x38')]['offset']);}_0x14bb39[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x430936[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x14bb39[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x430936['query'],_0x5523f9[_0xdb9a('0x3a')]));_0x14bb39[_0xdb9a('0x44')][_0xdb9a('0x5a')]=_0x48edc3['id'];if(_0x430936['query'][_0xdb9a('0x5e')]){_0x14bb39[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x14bb39['where'],{'$or':_['map'](_0x14bb39['attributes'],function(_0x52fe77){var _0x924be4={};_0x924be4[_0x52fe77]={'$like':'%'+_0x430936[_0xdb9a('0x38')]['filter']+'%'};return _0x924be4;})});}_0x14bb39=_[_0xdb9a('0x46')]({},_0x14bb39,_0x430936['options']);return db['Disposition'][_0xdb9a('0x24')]({'where':_0x14bb39[_0xdb9a('0x44')]})[_0xdb9a('0x2b')](function(_0x324330){_0x75ac5e[_0xdb9a('0x24')]=_0x324330;if(_0x430936[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x14bb39[_0xdb9a('0x4d')]=[{'all':!![]}];}return db[_0xdb9a('0x5b')][_0xdb9a('0x49')](_0x14bb39);})[_0xdb9a('0x2b')](function(_0x33a23d){_0x75ac5e[_0xdb9a('0x4a')]=_0x33a23d;return _0x75ac5e;});}})[_0xdb9a('0x2b')](respondWithFilteredResult(_0x8c7f1a,_0x14bb39))[_0xdb9a('0x4b')](handleError(_0x8c7f1a,null));};exports[_0xdb9a('0x5f')]=function(_0x513a18,_0x4a4690,_0x707118){return db['CmList']['find']({'where':{'id':_0x513a18[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4a4690,null))[_0xdb9a('0x2b')](function(_0x59b83d){if(_0x59b83d){return _0x59b83d['removeDispositions'](_0x513a18['query'][_0xdb9a('0x60')]);}})[_0xdb9a('0x2b')](respondWithStatusCode(_0x4a4690,null))[_0xdb9a('0x4b')](handleError(_0x4a4690,null));};exports['addContacts']=function(_0xbaf4c7,_0x4f6341,_0x11cbf0){return db[_0xdb9a('0x34')]['find']({'where':{'id':_0xbaf4c7[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4f6341,null))[_0xdb9a('0x2b')](function(_0x293890){if(_0x293890){var _0x54fade=[];var _0x5b256f={'success':[],'errors':[]};return db['CmContact'][_0xdb9a('0x61')]()[_0xdb9a('0x2b')](function(_0x145977){if(_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]&&_[_0xdb9a('0x63')](_0xbaf4c7[_0xdb9a('0x51')]['tags'])){if(_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]['length']){_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]['join'](';')+';';}else{_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=null;}}else{_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=null;}if(_0xbaf4c7['body']&&_[_0xdb9a('0x63')](_0xbaf4c7[_0xdb9a('0x51')])){for(var _0x1f802c=0x0;_0x1f802c<_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x3f')];_0x1f802c+=0x1){_0xbaf4c7['body'][_0x1f802c]['ListId']=_0xbaf4c7[_0xdb9a('0x4c')]['id'];_0x54fade[_0xdb9a('0x64')](_0xbaf4c7[_0xdb9a('0x51')][_0x1f802c]);}return BPromise[_0xdb9a('0x65')](_0x54fade,function(_0x56146a){return db['CmContact']['create'](_[_0xdb9a('0x66')](_0x56146a,[_0xdb9a('0x60'),'id'])||{},{'fields':_['keys'](_0x145977),'raw':!![]})[_0xdb9a('0x2b')](function(_0x3103bc){_0x5b256f[_0xdb9a('0x67')][_0xdb9a('0x64')](_0x3103bc[_0xdb9a('0x68')]);})[_0xdb9a('0x4b')](function(_0x274b5e){_0x5b256f[_0xdb9a('0x69')]['push']({'data':_0x56146a,'error':_0x274b5e[_0xdb9a('0x6a')]});});})[_0xdb9a('0x2b')](function(_0xa95c31){return _0x5b256f;})[_0xdb9a('0x4b')](function(_0x1e488b){return _0x1e488b;});}else{_0x4f6341[_0xdb9a('0x1e')](0x190)['json']({'message':_0xdb9a('0x6b')});}});}})['then'](respondWithResult(_0x4f6341,null))[_0xdb9a('0x4b')](handleError(_0x4f6341,null));};exports[_0xdb9a('0x6c')]=function(_0x3e36fc,_0x36a093,_0x4e7d59){var _0x38693a;return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x3e36fc['params']['id']},'include':[{'model':db[_0xdb9a('0x6d')],'as':_0xdb9a('0x6e')}]})['then'](handleEntityNotFound(_0x36a093,null))[_0xdb9a('0x2b')](function(_0x18bbcc){if(_0x18bbcc){_0x38693a=_0x18bbcc;return db['CmContact'][_0xdb9a('0x35')];}})[_0xdb9a('0x2b')](function(_0x5cca43){if(_0x5cca43){var _0x4c0180={};var _0x3732ca={};_0x3732ca[_0xdb9a('0x3c')]=_[_0xdb9a('0x6f')](_[_0xdb9a('0x39')](_0x5cca43),_['map'](_0x38693a['CustomFields'],function(_0x14d24c){return util[_0xdb9a('0x70')](_0xdb9a('0x71'),_0x14d24c['id']);}));_0x3732ca[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x3e36fc[_0xdb9a('0x38')]);_0x3732ca['filters']=_[_0xdb9a('0x3b')](_0x3732ca[_0xdb9a('0x3c')],_0x3732ca['query']);_0x4c0180['attributes']=_['intersection'](_0x3732ca['model'],qs[_0xdb9a('0x3d')](_0x3e36fc[_0xdb9a('0x38')]['fields']));_0x4c0180['attributes']=_0x4c0180['attributes'][_0xdb9a('0x3f')]?_0x4c0180['attributes']:_0x3732ca[_0xdb9a('0x3c')];if(!_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x40')]('nolimit')){_0x4c0180[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x23')]);_0x4c0180[_0xdb9a('0x21')]=qs[_0xdb9a('0x21')](_0x3e36fc['query'][_0xdb9a('0x21')]);}_0x4c0180[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x4c0180[_0xdb9a('0x44')]=qs['filters'](_[_0xdb9a('0x45')](_0x3e36fc[_0xdb9a('0x38')],_0x3732ca[_0xdb9a('0x3a')]));_0x4c0180[_0xdb9a('0x72')]=!![];if(_0x3e36fc['query']['filter']){_0x4c0180[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x4c0180['where'],{'$or':_[_0xdb9a('0x33')](_0x4c0180[_0xdb9a('0x3e')],function(_0x5918a8){var _0x51fd92={};_0x51fd92[_0x5918a8]={'$like':'%'+_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x51fd92;})});}_0x4c0180=_[_0xdb9a('0x46')]({},_0x4c0180,_0x3e36fc['options']);return _0x38693a['getContacts'](_0x4c0180);}})[_0xdb9a('0x2b')](respondWithResult(_0x36a093,null))[_0xdb9a('0x4b')](handleError(_0x36a093,null));};exports[_0xdb9a('0x73')]=function(_0x652482,_0x1dbdd4,_0x3a8a76){var _0x5292a0;return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x652482[_0xdb9a('0x4c')]['id']},'include':[{'model':db[_0xdb9a('0x6d')],'as':_0xdb9a('0x6e')}]})[_0xdb9a('0x2b')](handleEntityNotFound(_0x1dbdd4,null))[_0xdb9a('0x2b')](function(_0x1aab1d){if(_0x1aab1d){_0x5292a0=_0x1aab1d;return db[_0xdb9a('0x74')][_0xdb9a('0x35')];}})[_0xdb9a('0x2b')](function(_0xf3704a){if(_0xf3704a){var _0x31ad26={};var _0x366fdc={};_0x366fdc[_0xdb9a('0x3c')]=_['concat'](_[_0xdb9a('0x39')](_0xf3704a),_[_0xdb9a('0x33')](_0x5292a0['CustomFields'],function(_0x396f99){return util['format']('cf_%d',_0x396f99['id']);}));_0x366fdc[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x652482[_0xdb9a('0x38')]);_0x366fdc[_0xdb9a('0x3a')]=_['intersection'](_0x366fdc[_0xdb9a('0x3c')],_0x366fdc[_0xdb9a('0x38')]);_0x31ad26[_0xdb9a('0x3e')]=_['intersection'](_0x366fdc['model'],qs[_0xdb9a('0x3d')](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x31ad26[_0xdb9a('0x3e')]=_0x31ad26[_0xdb9a('0x3e')]['length']?_0x31ad26[_0xdb9a('0x3e')]:_0x366fdc[_0xdb9a('0x3c')];if(!_0x652482[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x31ad26[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x652482[_0xdb9a('0x38')]['limit']);_0x31ad26['offset']=qs['offset'](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x21')]);}_0x31ad26[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x31ad26[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x652482['query'],_0x366fdc['filters']));_0x31ad26['raw']=!![];if(_0x652482[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x31ad26[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x31ad26[_0xdb9a('0x44')],{'$or':_['map'](_0x31ad26[_0xdb9a('0x3e')],function(_0x1b0615){var _0x4f6069={};_0x4f6069[_0x1b0615]={'$like':'%'+_0x652482[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x4f6069;})});}_0x31ad26=_[_0xdb9a('0x46')]({},_0x31ad26,_0x652482[_0xdb9a('0x4e')]);return _0x5292a0[_0xdb9a('0x6c')](_0x31ad26);}})[_0xdb9a('0x2b')](function(_0x37e163){if(!_['isEmpty'](_0x37e163)){var _0x251b9e=toCsv(_0x37e163);var _0x13451b=Date[_0xdb9a('0x75')]();fs['writeFileSync'](util[_0xdb9a('0x70')]('/tmp/list_%d_%s.csv',_0x5292a0['id'],_0x13451b),_0x251b9e);_0x1dbdd4[_0xdb9a('0x76')](_0xdb9a('0x77'),_0xdb9a('0x78')+util[_0xdb9a('0x70')]('list_%d_%s.csv',_0x5292a0['id'],_0x13451b));_0x1dbdd4[_0xdb9a('0x76')]('Content-type',_0xdb9a('0x79'));return _0x1dbdd4[_0xdb9a('0x7a')](util[_0xdb9a('0x70')](_0xdb9a('0x7b'),_0x5292a0['id'],_0x13451b));}else{return _0x1dbdd4[_0xdb9a('0x1d')](0xcc);}})[_0xdb9a('0x4b')](handleError(_0x1dbdd4,null));};exports[_0xdb9a('0x7c')]=function(_0x32c586,_0x1f8d2e,_0x1470b2){var _0x487b4b;delete _0x32c586[_0xdb9a('0x51')]['id'];return db[_0xdb9a('0x34')]['findOne']({'where':{'id':_0x32c586['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x1f8d2e,null))[_0xdb9a('0x2b')](function(_0x436e7c){if(_0x436e7c){return db['sequelize'][_0xdb9a('0x7d')](function(_0x2d3d50){return db[_0xdb9a('0x6d')][_0xdb9a('0x50')](_0x32c586[_0xdb9a('0x51')],{'transaction':_0x2d3d50})['then'](function(_0x4cba46){_0x487b4b=_0x4cba46;return _0x436e7c[_0xdb9a('0x7e')](_0x4cba46,{'transaction':_0x2d3d50});})[_0xdb9a('0x2b')](function(){var _0x265e60={'type':db[_0xdb9a('0x7f')]['TEXT'],'transaction':_0x2d3d50};switch(_0x32c586[_0xdb9a('0x51')][_0xdb9a('0x37')]){case _0xdb9a('0x80'):_0x265e60['type']=db[_0xdb9a('0x7f')][_0xdb9a('0x81')];break;case _0xdb9a('0x82'):_0x265e60[_0xdb9a('0x37')]=db['Sequelize'][_0xdb9a('0x83')];break;case'switch':_0x265e60[_0xdb9a('0x37')]=db[_0xdb9a('0x7f')][_0xdb9a('0x84')];_0x265e60[_0xdb9a('0x85')]=![];break;default:}return db['sequelize'][_0xdb9a('0x86')][_0xdb9a('0x87')](_0xdb9a('0x88'),util['format'](_0xdb9a('0x89'),_0x487b4b['id']),_0x265e60);})['then'](function(){return _0x487b4b;});});}})[_0xdb9a('0x2b')](respondWithResult(_0x1f8d2e,null))[_0xdb9a('0x4b')](handleError(_0x1f8d2e,null));};exports[_0xdb9a('0x8a')]=function(_0x1eb66e,_0x408de8,_0x1e348d){var _0x5863fd={};var _0xfd5675={};var _0x2203bf;var _0x5cc033;return db[_0xdb9a('0x34')][_0xdb9a('0x5d')]({'where':{'id':_0x1eb66e['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x408de8,null))['then'](function(_0x455107){if(_0x455107){_0x2203bf=_0x455107;_0xfd5675[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db['CmCustomField'][_0xdb9a('0x35')]);_0xfd5675[_0xdb9a('0x38')]=_['keys'](_0x1eb66e[_0xdb9a('0x38')]);_0xfd5675[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0xfd5675['model'],_0xfd5675[_0xdb9a('0x38')]);_0x5863fd[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0xfd5675['model'],qs['fields'](_0x1eb66e['query'][_0xdb9a('0x3d')]));_0x5863fd[_0xdb9a('0x3e')]=_0x5863fd['attributes']['length']?_0x5863fd['attributes']:_0xfd5675['model'];_0x5863fd[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x1eb66e['query'][_0xdb9a('0x43')]);_0x5863fd[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_['pick'](_0x1eb66e[_0xdb9a('0x38')],_0xfd5675[_0xdb9a('0x3a')]));_0x5863fd[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5863fd[_0xdb9a('0x44')],{'$or':[{'ListId':_0x455107['id']},{'ListId':null}]});if(_0x1eb66e[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x5863fd[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5863fd[_0xdb9a('0x44')],{'$or':_[_0xdb9a('0x33')](_0x5863fd[_0xdb9a('0x3e')],function(_0x3af669){var _0x26b9e4={};_0x26b9e4[_0x3af669]={'$like':'%'+_0x1eb66e[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x26b9e4;})});}_0x5863fd=_[_0xdb9a('0x46')]({},_0x5863fd,_0x1eb66e['options']);return db['CmCustomField']['findAndCountAll'](_0x5863fd);}})[_0xdb9a('0x2b')](respondWithResult(_0x408de8,null))[_0xdb9a('0x4b')](handleError(_0x408de8,null));};exports[_0xdb9a('0x8b')]=function(_0x3cfb3f,_0x20b8e4,_0x5dbb47){return db[_0xdb9a('0x34')]['find']({'where':{'id':_0x3cfb3f['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x20b8e4,null))['then'](function(_0x1209b5){if(_0x1209b5){return _0x1209b5[_0xdb9a('0x8b')](_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')],_[_0xdb9a('0x66')](_0x3cfb3f['body'],[_0xdb9a('0x60'),'id'])||{})['spread'](function(_0x572805){for(var _0x3a63ca=0x0;_0x3a63ca<_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')][_0xdb9a('0x3f')];_0x3a63ca+=0x1){socket[_0xdb9a('0x8c')](_0xdb9a('0x8d'),{'UserId':Number(_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')][_0x3a63ca]),'CmListId':Number(_0x3cfb3f[_0xdb9a('0x4c')]['id'])});}return _0x572805;});}})[_0xdb9a('0x2b')](respondWithResult(_0x20b8e4,null))[_0xdb9a('0x4b')](handleError(_0x20b8e4,null));};exports[_0xdb9a('0x8e')]=function(_0x542c6e,_0x4b7f7f,_0x2b0425){return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x542c6e['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4b7f7f,null))[_0xdb9a('0x2b')](function(_0x493481){if(_0x493481){return _0x493481['removeAgents'](_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')])['then'](function(){if(_[_0xdb9a('0x63')](_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')])){for(var _0x5ec4c0=0x0;_0x5ec4c0<_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')][_0xdb9a('0x3f')];_0x5ec4c0+=0x1){socket[_0xdb9a('0x8c')]('userCmList:remove',{'UserId':Number(_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')][_0x5ec4c0]),'CmListId':Number(_0x542c6e['params']['id'])});}}else{socket['emit'](_0xdb9a('0x8f'),{'UserId':Number(_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')]),'CmListId':Number(_0x542c6e[_0xdb9a('0x4c')]['id'])});}});}})[_0xdb9a('0x2b')](respondWithStatusCode(_0x4b7f7f,null))[_0xdb9a('0x4b')](handleError(_0x4b7f7f,null));};exports['getAgents']=function(_0x30afba,_0x2c5bb8,_0x49fad1){var _0x181e1f={};var _0x4caca9={};var _0x367e69;var _0x523498;return db[_0xdb9a('0x34')]['findOne']({'where':{'id':_0x30afba[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x2c5bb8,null))[_0xdb9a('0x2b')](function(_0x1622c9){if(_0x1622c9){_0x367e69=_0x1622c9;_0x4caca9[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db[_0xdb9a('0x90')]['rawAttributes']);_0x4caca9['query']=_[_0xdb9a('0x39')](_0x30afba[_0xdb9a('0x38')]);_0x4caca9[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0x4caca9[_0xdb9a('0x3c')],_0x4caca9[_0xdb9a('0x38')]);_0x181e1f[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x4caca9[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x30afba['query']['fields']));_0x181e1f['attributes']=_0x181e1f[_0xdb9a('0x3e')][_0xdb9a('0x3f')]?_0x181e1f['attributes']:_0x4caca9[_0xdb9a('0x3c')];_0x181e1f['order']=qs[_0xdb9a('0x43')](_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x181e1f[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x30afba[_0xdb9a('0x38')],_0x4caca9[_0xdb9a('0x3a')]));if(_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x181e1f['where']=_[_0xdb9a('0x46')](_0x181e1f[_0xdb9a('0x44')],{'$or':_[_0xdb9a('0x33')](_0x181e1f['attributes'],function(_0x4364fb){var _0x28b5d3={};_0x28b5d3[_0x4364fb]={'$like':'%'+_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x28b5d3;})});}_0x181e1f=_['merge']({},_0x181e1f,_0x30afba[_0xdb9a('0x4e')]);return _0x367e69[_0xdb9a('0x91')](_0x181e1f);}})[_0xdb9a('0x2b')](function(_0x519aab){if(_0x519aab){_0x523498=_0x519aab[_0xdb9a('0x3f')];if(!_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x181e1f[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x30afba[_0xdb9a('0x38')]['limit']);_0x181e1f['offset']=qs[_0xdb9a('0x21')](_0x30afba['query'][_0xdb9a('0x21')]);}return _0x367e69[_0xdb9a('0x91')](_0x181e1f);}})[_0xdb9a('0x2b')](function(_0x5a9311){if(_0x5a9311){return _0x5a9311?{'count':_0x523498,'rows':_0x5a9311}:null;}})[_0xdb9a('0x2b')](respondWithResult(_0x2c5bb8,null))[_0xdb9a('0x4b')](handleError(_0x2c5bb8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index f4f965c..53fe8f8 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x55ca,0x126));var _0xa55c=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x55ca[_0x621bee];return _0x3076c8;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x5fc3,0xa8));var _0x35fc=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x5fc3[_0x496738];return _0xee1381;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d57b889..2d81ffc 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 _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x14c3c7,_0x203dac){var _0x24303a=function(_0x19c07b){while(--_0x19c07b){_0x14c3c7['push'](_0x14c3c7['shift']());}};_0x24303a(++_0x203dac);}(_0x702d,0x147));var _0xd702=function(_0x141ee7,_0x3dad7b){_0x141ee7=_0x141ee7-0x0;var _0x15094b=_0x702d[_0x141ee7];return _0x15094b;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2547=['rimraf','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc25778,_0xf5d1f6){var _0x314223=function(_0x5e15bc){while(--_0x5e15bc){_0xc25778['push'](_0xc25778['shift']());}};_0x314223(++_0xf5d1f6);}(_0x2547,0x1cd));var _0x7254=function(_0x1519b5,_0x2b43b0){_0x1519b5=_0x1519b5-0x0;var _0x17da29=_0x2547[_0x1519b5];return _0x17da29;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('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 3928ff1..2e59923 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 _0x1b9b=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x506204,_0x4b1e27){var _0x54dbfb=function(_0x43f3ea){while(--_0x43f3ea){_0x506204['push'](_0x506204['shift']());}};_0x54dbfb(++_0x4b1e27);}(_0x1b9b,0x1a1));var _0xb1b9=function(_0x18d5b4,_0x40d3c5){_0x18d5b4=_0x18d5b4-0x0;var _0x1ad906=_0x1b9b[_0x18d5b4];return _0x1ad906;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb1b9('0x0'));var BPromise=require(_0xb1b9('0x1'));var rs=require(_0xb1b9('0x2'));var fs=require('fs');var Redis=require(_0xb1b9('0x3'));var db=require(_0xb1b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1b9('0x5'))(_0xb1b9('0x6'));var config=require(_0xb1b9('0x7'));var jayson=require(_0xb1b9('0x8'));var client=jayson[_0xb1b9('0x9')][_0xb1b9('0xa')]({'port':0x232a});config[_0xb1b9('0xb')]=_['defaults'](config[_0xb1b9('0xb')],{'host':_0xb1b9('0xc'),'port':0x18eb});var socket=require(_0xb1b9('0xd'))(new Redis(config[_0xb1b9('0xb')]));require('./cmList.socket')[_0xb1b9('0xe')](socket);function respondWithRpcPromise(_0x298c74,_0x1f515a,_0x5a3c84){return new BPromise(function(_0x3de380,_0x54eedd){return client[_0xb1b9('0xf')](_0x298c74,_0x5a3c84)[_0xb1b9('0x10')](function(_0x42878d){logger[_0xb1b9('0x11')](_0xb1b9('0x12'),_0x1f515a,_0xb1b9('0x13'));logger[_0xb1b9('0x14')](_0xb1b9('0x15'),_0x1f515a,_0xb1b9('0x13'),JSON[_0xb1b9('0x16')](_0x42878d));if(_0x42878d[_0xb1b9('0x17')]){if(_0x42878d['error'][_0xb1b9('0x18')]===0x1f4){logger[_0xb1b9('0x17')](_0xb1b9('0x12'),_0x1f515a,_0x42878d[_0xb1b9('0x17')][_0xb1b9('0x19')]);return _0x54eedd(_0x42878d[_0xb1b9('0x17')][_0xb1b9('0x19')]);}logger[_0xb1b9('0x17')](_0xb1b9('0x12'),_0x1f515a,_0x42878d[_0xb1b9('0x17')][_0xb1b9('0x19')]);return _0x3de380(_0x42878d[_0xb1b9('0x17')][_0xb1b9('0x19')]);}else{logger[_0xb1b9('0x11')](_0xb1b9('0x12'),_0x1f515a,'request\x20sent');_0x3de380(_0x42878d[_0xb1b9('0x1a')][_0xb1b9('0x19')]);}})[_0xb1b9('0x1b')](function(_0x46a482){logger[_0xb1b9('0x17')](_0xb1b9('0x12'),_0x1f515a,_0x46a482);_0x54eedd(_0x46a482);});});} \ No newline at end of file +var _0x4bb3=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./cmList.socket','request','then','info','request\x20sent','debug'];(function(_0x36b1ce,_0x179492){var _0x32034f=function(_0x45a018){while(--_0x45a018){_0x36b1ce['push'](_0x36b1ce['shift']());}};_0x32034f(++_0x179492);}(_0x4bb3,0x67));var _0x34bb=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0x4bb3[_0x2353fe];return _0x4d43f6;};'use strict';var _=require(_0x34bb('0x0'));var util=require(_0x34bb('0x1'));var moment=require(_0x34bb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bb('0x3'))['db'];var utils=require(_0x34bb('0x4'));var logger=require('../../config/logger')(_0x34bb('0x5'));var config=require(_0x34bb('0x6'));var jayson=require(_0x34bb('0x7'));var client=jayson[_0x34bb('0x8')]['http']({'port':0x232a});config[_0x34bb('0x9')]=_[_0x34bb('0xa')](config[_0x34bb('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34bb('0x9')]));require(_0x34bb('0xb'))['register'](socket);function respondWithRpcPromise(_0x47d8c3,_0x3e19bc,_0x26fc80){return new BPromise(function(_0x113bf5,_0x11c619){return client[_0x34bb('0xc')](_0x47d8c3,_0x26fc80)[_0x34bb('0xd')](function(_0x4f1673){logger[_0x34bb('0xe')]('CmList,\x20%s,\x20%s',_0x3e19bc,_0x34bb('0xf'));logger[_0x34bb('0x10')](_0x34bb('0x11'),_0x3e19bc,'request\x20sent',JSON[_0x34bb('0x12')](_0x4f1673));if(_0x4f1673[_0x34bb('0x13')]){if(_0x4f1673[_0x34bb('0x13')]['code']===0x1f4){logger['error'](_0x34bb('0x14'),_0x3e19bc,_0x4f1673[_0x34bb('0x13')][_0x34bb('0x15')]);return _0x11c619(_0x4f1673[_0x34bb('0x13')]['message']);}logger[_0x34bb('0x13')](_0x34bb('0x14'),_0x3e19bc,_0x4f1673[_0x34bb('0x13')][_0x34bb('0x15')]);return _0x113bf5(_0x4f1673['error'][_0x34bb('0x15')]);}else{logger[_0x34bb('0xe')](_0x34bb('0x14'),_0x3e19bc,_0x34bb('0xf'));_0x113bf5(_0x4f1673[_0x34bb('0x16')][_0x34bb('0x15')]);}})[_0x34bb('0x17')](function(_0x457517){logger[_0x34bb('0x13')]('CmList,\x20%s,\x20%s',_0x3e19bc,_0x457517);_0x11c619(_0x457517);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1b773a5..607c442 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 _0x6d34=['cmList:','./cmList.events','save','update','register'];(function(_0x3d640c,_0x1e456a){var _0x472772=function(_0x5f2155){while(--_0x5f2155){_0x3d640c['push'](_0x3d640c['shift']());}};_0x472772(++_0x1e456a);}(_0x6d34,0xa6));var _0x46d3=function(_0x28f64e,_0x4bb70f){_0x28f64e=_0x28f64e-0x0;var _0x44311c=_0x6d34[_0x28f64e];return _0x44311c;};'use strict';var CmListEvents=require(_0x46d3('0x0'));var events=[_0x46d3('0x1'),'remove',_0x46d3('0x2')];function createListener(_0x23b0cd,_0x36d299){return function(_0x3e9ac2){_0x36d299['emit'](_0x23b0cd,_0x3e9ac2);};}function removeListener(_0x3a0ab,_0x54fbc8){return function(){CmListEvents['removeListener'](_0x3a0ab,_0x54fbc8);};}exports[_0x46d3('0x3')]=function(_0x1bd16e){for(var _0x52cbb7=0x0,_0x2788db=events['length'];_0x52cbb7<_0x2788db;_0x52cbb7++){var _0x4f1176=events[_0x52cbb7];var _0x51a149=createListener(_0x46d3('0x4')+_0x4f1176,_0x1bd16e);CmListEvents['on'](_0x4f1176,_0x51a149);}}; \ No newline at end of file +var _0xe7eb=['removeListener','register','./cmList.events','save','remove','update','emit'];(function(_0x55daed,_0x892a6d){var _0x5d5451=function(_0x5e5e93){while(--_0x5e5e93){_0x55daed['push'](_0x55daed['shift']());}};_0x5d5451(++_0x892a6d);}(_0xe7eb,0x16e));var _0xbe7e=function(_0x2bdddb,_0x40181b){_0x2bdddb=_0x2bdddb-0x0;var _0x237a67=_0xe7eb[_0x2bdddb];return _0x237a67;};'use strict';var CmListEvents=require(_0xbe7e('0x0'));var events=[_0xbe7e('0x1'),_0xbe7e('0x2'),_0xbe7e('0x3')];function createListener(_0x3dba57,_0x383c58){return function(_0x594303){_0x383c58[_0xbe7e('0x4')](_0x3dba57,_0x594303);};}function removeListener(_0x18a6ac,_0x16b0a7){return function(){CmListEvents[_0xbe7e('0x5')](_0x18a6ac,_0x16b0a7);};}exports[_0xbe7e('0x6')]=function(_0x22ba4c){for(var _0x3db7b9=0x0,_0x3f3675=events['length'];_0x3db7b9<_0x3f3675;_0x3db7b9++){var _0x1c1b15=events[_0x3db7b9];var _0x2f3bb8=createListener('cmList:'+_0x1c1b15,_0x22ba4c);CmListEvents['on'](_0x1c1b15,_0x2f3bb8);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index db373fb..fa3e13e 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 _0xe248=['/:id/fields','getCustomFields','/:id/users','getAgents','addDisposition','post','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv'];(function(_0x29318f,_0x1e1f1b){var _0xdff758=function(_0x5b01ee){while(--_0x5b01ee){_0x29318f['push'](_0x29318f['shift']());}};_0xdff758(++_0x1e1f1b);}(_0xe248,0x149));var _0x8e24=function(_0x37e3d1,_0x168a19){_0x37e3d1=_0x37e3d1-0x0;var _0x482fcf=_0xe248[_0x37e3d1];return _0x482fcf;};'use strict';var multer=require(_0x8e24('0x0'));var util=require(_0x8e24('0x1'));var path=require(_0x8e24('0x2'));var timeout=require(_0x8e24('0x3'));var express=require(_0x8e24('0x4'));var router=express['Router']();var fs_extra=require(_0x8e24('0x5'));var auth=require(_0x8e24('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8e24('0x7'));var controller=require(_0x8e24('0x8'));router[_0x8e24('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e24('0xa')]);router[_0x8e24('0x9')](_0x8e24('0xb'),auth['isAuthenticated'](),controller[_0x8e24('0xc')]);router[_0x8e24('0x9')](_0x8e24('0xd'),auth[_0x8e24('0xe')](),controller[_0x8e24('0xf')]);router['get'](_0x8e24('0x10'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x11')]);router['get'](_0x8e24('0x12'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x13')]);router[_0x8e24('0x9')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x8e24('0x14')]);router[_0x8e24('0x9')](_0x8e24('0x15'),auth['isAuthenticated'](),controller[_0x8e24('0x16')]);router['get'](_0x8e24('0x17'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x18')]);router['post']('/',auth[_0x8e24('0xe')](),controller['create']);router['post'](_0x8e24('0x10'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x19')]);router[_0x8e24('0x1a')](_0x8e24('0x12'),auth[_0x8e24('0xe')](),controller['addContacts']);router[_0x8e24('0x1a')](_0x8e24('0x15'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x1b')]);router[_0x8e24('0x1a')](_0x8e24('0x17'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x1c')]);router[_0x8e24('0x1d')](_0x8e24('0xd'),auth[_0x8e24('0xe')](),controller[_0x8e24('0x1e')]);router[_0x8e24('0x1f')]('/:id',auth[_0x8e24('0xe')](),controller['destroy']);router[_0x8e24('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8e24('0x20')]);router[_0x8e24('0x1f')](_0x8e24('0x17'),auth['isAuthenticated'](),controller[_0x8e24('0x21')]);module[_0x8e24('0x22')]=router; \ No newline at end of file +var _0x9663=['/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2ae19a,_0x2e72a4){var _0x2b2b18=function(_0x891615){while(--_0x891615){_0x2ae19a['push'](_0x2ae19a['shift']());}};_0x2b2b18(++_0x2e72a4);}(_0x9663,0x6b));var _0x3966=function(_0x597978,_0x4f830b){_0x597978=_0x597978-0x0;var _0x8f9fe6=_0x9663[_0x597978];return _0x8f9fe6;};'use strict';var multer=require(_0x3966('0x0'));var util=require(_0x3966('0x1'));var path=require(_0x3966('0x2'));var timeout=require(_0x3966('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3966('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3966('0x5'));router[_0x3966('0x6')]('/',auth[_0x3966('0x7')](),controller[_0x3966('0x8')]);router[_0x3966('0x6')]('/describe',auth[_0x3966('0x7')](),controller['describe']);router[_0x3966('0x6')](_0x3966('0x9'),auth[_0x3966('0x7')](),controller[_0x3966('0xa')]);router[_0x3966('0x6')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller[_0x3966('0xc')]);router[_0x3966('0x6')](_0x3966('0xd'),auth[_0x3966('0x7')](),controller['getContacts']);router[_0x3966('0x6')](_0x3966('0xe'),auth[_0x3966('0x7')](),controller['getContactsCsv']);router[_0x3966('0x6')](_0x3966('0xf'),auth[_0x3966('0x7')](),controller[_0x3966('0x10')]);router[_0x3966('0x6')](_0x3966('0x11'),auth[_0x3966('0x7')](),controller[_0x3966('0x12')]);router['post']('/',auth[_0x3966('0x7')](),controller[_0x3966('0x13')]);router[_0x3966('0x14')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller['addDisposition']);router[_0x3966('0x14')]('/:id/contacts',auth[_0x3966('0x7')](),controller['addContacts']);router[_0x3966('0x14')](_0x3966('0xf'),auth[_0x3966('0x7')](),controller[_0x3966('0x15')]);router[_0x3966('0x14')](_0x3966('0x11'),auth[_0x3966('0x7')](),controller[_0x3966('0x16')]);router[_0x3966('0x17')](_0x3966('0x9'),auth['isAuthenticated'](),controller[_0x3966('0x18')]);router[_0x3966('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x3966('0x1a')]);router[_0x3966('0x19')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller[_0x3966('0x1b')]);router[_0x3966('0x19')]('/:id/users',auth[_0x3966('0x7')](),controller[_0x3966('0x1c')]);module[_0x3966('0x1d')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e8524a0..a603066 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 _0x9d23=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x222d38,_0x5793e8){var _0x5de24b=function(_0x3ffd91){while(--_0x3ffd91){_0x222d38['push'](_0x222d38['shift']());}};_0x5de24b(++_0x5793e8);}(_0x9d23,0x8b));var _0x39d2=function(_0x72e4be,_0x51edeb){_0x72e4be=_0x72e4be-0x0;var _0x19e939=_0x9d23[_0x72e4be];return _0x19e939;};'use strict';var Sequelize=require(_0x39d2('0x0'));module[_0x39d2('0x1')]={'name':{'type':Sequelize[_0x39d2('0x2')],'get':function(_0x5eebb7){return this[_0x39d2('0x3')](_0x39d2('0x4'));}},'field':{'type':Sequelize[_0x39d2('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x39d2('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x39d2('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x7ea1=['field','STRING','exports'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x7ea1,0x113));var _0x17ea=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0x7ea1[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require('sequelize');module[_0x17ea('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1e26ff){return this['getDataValue'](_0x17ea('0x1'));}},'field':{'type':Sequelize[_0x17ea('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x17ea('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 00cca09..81b10e5 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(_0x12409d,_0x4c9b4b){var _0x457072=function(_0x2d3c53){while(--_0x2d3c53){_0x12409d['push'](_0x12409d['shift']());}};_0x457072(++_0x4c9b4b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4638d1,_0x51327b){var _0x22f079=function(_0x36ccce){while(--_0x36ccce){_0x4638d1['push'](_0x4638d1['shift']());}};_0x22f079(++_0x51327b);}(_0x7a54,0x106));var _0x47a5=function(_0xbdb3bf,_0x44f068){_0xbdb3bf=_0xbdb3bf-0x0;var _0x48a7ec=_0x7a54[_0xbdb3bf];return _0x48a7ec;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index b5d913b..c88c5dd 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 _0x6f5a=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0xb98e6e,_0xe56cbc){var _0x26751c=function(_0x123ccc){while(--_0x123ccc){_0xb98e6e['push'](_0xb98e6e['shift']());}};_0x26751c(++_0xe56cbc);}(_0x6f5a,0x127));var _0xa6f5=function(_0x48cf17,_0x29534c){_0x48cf17=_0x48cf17-0x0;var _0x3b8b26=_0x6f5a[_0x48cf17];return _0x3b8b26;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))(_0xa6f5('0x3'));var moment=require(_0xa6f5('0x4'));var BPromise=require(_0xa6f5('0x5'));var rp=require(_0xa6f5('0x6'));var fs=require('fs');var path=require(_0xa6f5('0x7'));var rimraf=require(_0xa6f5('0x8'));var config=require(_0xa6f5('0x9'));var attributes=require(_0xa6f5('0xa'));module[_0xa6f5('0xb')]=function(_0xc07a3c,_0xeae153){return _0xc07a3c[_0xa6f5('0xc')](_0xa6f5('0xd'),attributes,{'tableName':_0xa6f5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe7a=['../../config/environment','./condition.attributes','exports','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2b91ac,_0x310741){var _0xe88814=function(_0x59c51b){while(--_0x59c51b){_0x2b91ac['push'](_0x2b91ac['shift']());}};_0xe88814(++_0x310741);}(_0xfe7a,0x160));var _0xafe7=function(_0x4de297,_0x51262e){_0x4de297=_0x4de297-0x0;var _0x3c2bf0=_0xfe7a[_0x4de297];return _0x3c2bf0;};'use strict';var _=require(_0xafe7('0x0'));var util=require(_0xafe7('0x1'));var logger=require(_0xafe7('0x2'))(_0xafe7('0x3'));var moment=require(_0xafe7('0x4'));var BPromise=require(_0xafe7('0x5'));var rp=require(_0xafe7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafe7('0x7'));var config=require(_0xafe7('0x8'));var attributes=require(_0xafe7('0x9'));module[_0xafe7('0xa')]=function(_0x26b9cb,_0x1c9313){return _0x26b9cb['define']('Condition',attributes,{'tableName':_0xafe7('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 c8f7197..1af13d2 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 _0x20c6=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x2d079c,_0x36e234){var _0x511159=function(_0x1dbcb8){while(--_0x1dbcb8){_0x2d079c['push'](_0x2d079c['shift']());}};_0x511159(++_0x36e234);}(_0x20c6,0x147));var _0x620c=function(_0x28821e,_0x43d56c){_0x28821e=_0x28821e-0x0;var _0x29d248=_0x20c6[_0x28821e];return _0x29d248;};'use strict';var _=require(_0x620c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620c('0x1'));var db=require(_0x620c('0x2'))['db'];var utils=require(_0x620c('0x3'));var logger=require(_0x620c('0x4'))(_0x620c('0x5'));var config=require(_0x620c('0x6'));var jayson=require(_0x620c('0x7'));var client=jayson[_0x620c('0x8')][_0x620c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x574935,_0x3737e0,_0x210fd7){return new BPromise(function(_0x46e162,_0x649b0f){return client['request'](_0x574935,_0x210fd7)[_0x620c('0xa')](function(_0x57f946){logger['info'](_0x620c('0xb'),_0x3737e0,_0x620c('0xc'));logger['debug'](_0x620c('0xd'),_0x3737e0,_0x620c('0xc'),JSON[_0x620c('0xe')](_0x57f946));if(_0x57f946[_0x620c('0xf')]){if(_0x57f946[_0x620c('0xf')][_0x620c('0x10')]===0x1f4){logger[_0x620c('0xf')](_0x620c('0xb'),_0x3737e0,_0x57f946[_0x620c('0xf')]['message']);return _0x649b0f(_0x57f946[_0x620c('0xf')][_0x620c('0x11')]);}logger[_0x620c('0xf')](_0x620c('0xb'),_0x3737e0,_0x57f946[_0x620c('0xf')][_0x620c('0x11')]);return _0x46e162(_0x57f946[_0x620c('0xf')][_0x620c('0x11')]);}else{logger[_0x620c('0x12')](_0x620c('0xb'),_0x3737e0,_0x620c('0xc'));_0x46e162(_0x57f946[_0x620c('0x13')][_0x620c('0x11')]);}})['catch'](function(_0x5df1bd){logger[_0x620c('0xf')](_0x620c('0xb'),_0x3737e0,_0x5df1bd);_0x649b0f(_0x5df1bd);});});} \ No newline at end of file +var _0x3320=['request','then','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3564af,_0x43a7d4){var _0x46d2da=function(_0x2a5290){while(--_0x2a5290){_0x3564af['push'](_0x3564af['shift']());}};_0x46d2da(++_0x43a7d4);}(_0x3320,0x68));var _0x0332=function(_0x694b9d,_0x352d80){_0x694b9d=_0x694b9d-0x0;var _0x137ca8=_0x3320[_0x694b9d];return _0x137ca8;};'use strict';var _=require(_0x0332('0x0'));var util=require(_0x0332('0x1'));var moment=require('moment');var BPromise=require(_0x0332('0x2'));var rs=require(_0x0332('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0332('0x4'));var logger=require(_0x0332('0x5'))(_0x0332('0x6'));var config=require(_0x0332('0x7'));var jayson=require(_0x0332('0x8'));var client=jayson[_0x0332('0x9')][_0x0332('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265a25,_0x45efcc,_0x36eebb){return new BPromise(function(_0x3e08c5,_0x30c80d){return client[_0x0332('0xb')](_0x265a25,_0x36eebb)[_0x0332('0xc')](function(_0x171b83){logger['info']('Condition,\x20%s,\x20%s',_0x45efcc,'request\x20sent');logger[_0x0332('0xd')](_0x0332('0xe'),_0x45efcc,_0x0332('0xf'),JSON[_0x0332('0x10')](_0x171b83));if(_0x171b83[_0x0332('0x11')]){if(_0x171b83[_0x0332('0x11')][_0x0332('0x12')]===0x1f4){logger[_0x0332('0x11')]('Condition,\x20%s,\x20%s',_0x45efcc,_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);return _0x30c80d(_0x171b83['error'][_0x0332('0x13')]);}logger['error'](_0x0332('0x14'),_0x45efcc,_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);return _0x3e08c5(_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);}else{logger['info'](_0x0332('0x14'),_0x45efcc,'request\x20sent');_0x3e08c5(_0x171b83[_0x0332('0x15')]['message']);}})[_0x0332('0x16')](function(_0x9c2a5a){logger[_0x0332('0x11')](_0x0332('0x14'),_0x45efcc,_0x9c2a5a);_0x30c80d(_0x9c2a5a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1e2f403..78fce77 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 _0xd75b=['../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xd75b,0x69));var _0xbd75=function(_0x2b37bb,_0x51eb92){_0x2b37bb=_0x2b37bb-0x0;var _0x5cf003=_0xd75b[_0x2b37bb];return _0x5cf003;};'use strict';var multer=require(_0xbd75('0x0'));var util=require(_0xbd75('0x1'));var path=require(_0xbd75('0x2'));var timeout=require(_0xbd75('0x3'));var express=require(_0xbd75('0x4'));var router=express[_0xbd75('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd75('0x6'));var interaction=require(_0xbd75('0x7'));var config=require(_0xbd75('0x8'));var controller=require(_0xbd75('0x9'));router[_0xbd75('0xa')]('/:id',auth[_0xbd75('0xb')](),controller[_0xbd75('0xc')]);router['delete'](_0xbd75('0xd'),auth[_0xbd75('0xb')](),controller[_0xbd75('0xe')]);module[_0xbd75('0xf')]=router; \ No newline at end of file +var _0xb48c=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb48c,0x116));var _0xcb48=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb48c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcb48('0x0'));var util=require(_0xcb48('0x1'));var path=require(_0xcb48('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb48('0x3'));var router=express[_0xcb48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb48('0x5'));var interaction=require(_0xcb48('0x6'));var config=require(_0xcb48('0x7'));var controller=require(_0xcb48('0x8'));router['put'](_0xcb48('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcb48('0x9'),auth['isAuthenticated'](),controller[_0xcb48('0xa')]);module[_0xcb48('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index b12e84f..bd50057 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(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe706,0xa3));var _0x6e70=function(_0x228d7c,_0xf01e7d){_0x228d7c=_0x228d7c-0x0;var _0x1ffa97=_0xe706[_0x228d7c];return _0x1ffa97;};'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 _0x757a=['exports','STRING'];(function(_0x325212,_0x125fd6){var _0x166738=function(_0x4e6393){while(--_0x4e6393){_0x325212['push'](_0x325212['shift']());}};_0x166738(++_0x125fd6);}(_0x757a,0xde));var _0xa757=function(_0x51a543,_0x22e6d7){_0x51a543=_0x51a543-0x0;var _0x3df0bb=_0x757a[_0x51a543];return _0x3df0bb;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 5569986..9de8f88 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 _0xe308=['custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','web-report','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','sendStatus','end','status','offset','undefined','count','limit','json','apply','reject','update','destroy','get','CustomDashboards','stack','name','index','map','Dashboard','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','create','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','iframe','attrUrl','attrs','value','https://'];(function(_0x5439b,_0x56595f){var _0x188f50=function(_0x8643eb){while(--_0x8643eb){_0x5439b['push'](_0x5439b['shift']());}};_0x188f50(++_0x56595f);}(_0xe308,0xff));var _0x8e30=function(_0x362258,_0x324d23){_0x362258=_0x362258-0x0;var _0x550079=_0xe308[_0x362258];return _0x550079;};'use strict';var emlformat=require(_0x8e30('0x0'));var rimraf=require(_0x8e30('0x1'));var zipdir=require(_0x8e30('0x2'));var jsonpatch=require(_0x8e30('0x3'));var rp=require('request-promise');var moment=require(_0x8e30('0x4'));var BPromise=require(_0x8e30('0x5'));var Mustache=require('mustache');var util=require(_0x8e30('0x6'));var path=require(_0x8e30('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e30('0x8'));var fs=require('fs');var fs_extra=require(_0x8e30('0x9'));var _=require(_0x8e30('0xa'));var squel=require('squel');var crypto=require(_0x8e30('0xb'));var jsforce=require(_0x8e30('0xc'));var deskjs=require(_0x8e30('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e30('0xe'));var Papa=require(_0x8e30('0xf'));var Redis=require(_0x8e30('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8e30('0x11'));var hardwareService=require(_0x8e30('0x12'));var logger=require(_0x8e30('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8e30('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e30('0x15'))['db'];config['redis']=_['defaults'](config[_0x8e30('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e30('0x16')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x2502f0,_0x15369f){_0x15369f=_0x15369f||0xcc;return function(_0x4227fd){if(_0x4227fd){return _0x2502f0[_0x8e30('0x17')](_0x15369f);}return _0x2502f0['status'](_0x15369f)[_0x8e30('0x18')]();};}function respondWithResult(_0x46ce94,_0x2eb006){_0x2eb006=_0x2eb006||0xc8;return function(_0x546ed7){if(_0x546ed7){return _0x46ce94[_0x8e30('0x19')](_0x2eb006)['json'](_0x546ed7);}};}function respondWithFilteredResult(_0x23f0cb,_0x2fab3e){return function(_0x39b420){if(_0x39b420){var _0x1927f3=typeof _0x2fab3e[_0x8e30('0x1a')]===_0x8e30('0x1b')&&typeof _0x2fab3e['limit']==='undefined';var _0x120a88=_0x39b420[_0x8e30('0x1c')];var _0x246749=_0x1927f3?0x0:_0x2fab3e[_0x8e30('0x1a')];var _0x6204=_0x1927f3?_0x39b420[_0x8e30('0x1c')]:_0x2fab3e['offset']+_0x2fab3e[_0x8e30('0x1d')];var _0x48da33;if(_0x6204>=_0x120a88){_0x6204=_0x120a88;_0x48da33=0xc8;}else{_0x48da33=0xce;}_0x23f0cb[_0x8e30('0x19')](_0x48da33);return _0x23f0cb['set']('Content-Range',_0x246749+'-'+_0x6204+'/'+_0x120a88)[_0x8e30('0x1e')](_0x39b420);}return null;};}function patchUpdates(_0x523bbb){return function(_0xfc000b){try{jsonpatch[_0x8e30('0x1f')](_0xfc000b,_0x523bbb,!![]);}catch(_0x163c70){return BPromise[_0x8e30('0x20')](_0x163c70);}return _0xfc000b['save']();};}function saveUpdates(_0xb3e7a6,_0x5a15e1){return function(_0x2a8306){if(_0x2a8306){return _0x2a8306[_0x8e30('0x21')](_0xb3e7a6)['then'](function(_0xb56562){return _0xb56562;});}return null;};}function removeEntity(_0x36a6fc,_0x5626cf){return function(_0x4d9f54){if(_0x4d9f54){return _0x4d9f54[_0x8e30('0x22')]()['then'](function(){var _0x5f418d=_0x4d9f54[_0x8e30('0x23')]({'plain':!![]});var _0xb1167=_0x8e30('0x24');return db['UserProfileResource'][_0x8e30('0x22')]({'where':{'type':_0xb1167,'resourceId':_0x5f418d['id']}})['then'](function(){return _0x4d9f54;});})['then'](function(){_0x36a6fc[_0x8e30('0x19')](0xcc)[_0x8e30('0x18')]();});}};}function handleEntityNotFound(_0x1d2938,_0x18c8b8){return function(_0x57636d){if(!_0x57636d){_0x1d2938[_0x8e30('0x17')](0x194);}return _0x57636d;};}function handleError(_0x35fd8b,_0x7fa695){_0x7fa695=_0x7fa695||0x1f4;return function(_0x3b27f9){logger['error'](_0x3b27f9[_0x8e30('0x25')]);if(_0x3b27f9[_0x8e30('0x26')]){delete _0x3b27f9['name'];}_0x35fd8b[_0x8e30('0x19')](_0x7fa695)['send'](_0x3b27f9);};}exports[_0x8e30('0x27')]=function(_0x26e2d3,_0x4aa833){var _0x11f86b={},_0x53ebb9={},_0x97c5f5={'count':0x0,'rows':[]};var _0xf352ef=_[_0x8e30('0x28')](db[_0x8e30('0x29')]['rawAttributes'],function(_0x499679){return{'name':_0x499679[_0x8e30('0x2a')],'type':_0x499679[_0x8e30('0x2b')][_0x8e30('0x2c')]};});_0x53ebb9[_0x8e30('0x2d')]=_[_0x8e30('0x28')](_0xf352ef,_0x8e30('0x26'));_0x53ebb9['query']=_['keys'](_0x26e2d3['query']);_0x53ebb9[_0x8e30('0x2e')]=_[_0x8e30('0x2f')](_0x53ebb9['model'],_0x53ebb9[_0x8e30('0x30')]);_0x11f86b[_0x8e30('0x31')]=_[_0x8e30('0x2f')](_0x53ebb9[_0x8e30('0x2d')],qs[_0x8e30('0x32')](_0x26e2d3['query'][_0x8e30('0x32')]));_0x11f86b['attributes']=_0x11f86b[_0x8e30('0x31')]['length']?_0x11f86b['attributes']:_0x53ebb9[_0x8e30('0x2d')];if(!_0x26e2d3['query'][_0x8e30('0x33')](_0x8e30('0x34'))){_0x11f86b[_0x8e30('0x1d')]=qs[_0x8e30('0x1d')](_0x26e2d3[_0x8e30('0x30')][_0x8e30('0x1d')]);_0x11f86b[_0x8e30('0x1a')]=qs[_0x8e30('0x1a')](_0x26e2d3[_0x8e30('0x30')][_0x8e30('0x1a')]);}_0x11f86b[_0x8e30('0x35')]=qs[_0x8e30('0x36')](_0x26e2d3[_0x8e30('0x30')][_0x8e30('0x36')]);_0x11f86b[_0x8e30('0x37')]=qs[_0x8e30('0x2e')](_[_0x8e30('0x38')](_0x26e2d3[_0x8e30('0x30')],_0x53ebb9[_0x8e30('0x2e')]),_0xf352ef);if(_0x26e2d3[_0x8e30('0x30')][_0x8e30('0x39')]){_0x11f86b[_0x8e30('0x37')]=_[_0x8e30('0x3a')](_0x11f86b[_0x8e30('0x37')],{'$or':_['map'](_0xf352ef,function(_0x474294){if(_0x474294[_0x8e30('0x2b')]!==_0x8e30('0x3b')){var _0x29a890={};_0x29a890[_0x474294[_0x8e30('0x26')]]={'$like':'%'+_0x26e2d3['query'][_0x8e30('0x39')]+'%'};return _0x29a890;}})});}_0x11f86b=_[_0x8e30('0x3a')]({},_0x11f86b,_0x26e2d3[_0x8e30('0x3c')]);var _0x4ecb72={'where':_0x11f86b['where']};return db[_0x8e30('0x29')][_0x8e30('0x1c')](_0x4ecb72)[_0x8e30('0x3d')](function(_0x5a70fa){_0x97c5f5[_0x8e30('0x1c')]=_0x5a70fa;if(_0x26e2d3['query'][_0x8e30('0x3e')]){_0x11f86b[_0x8e30('0x3f')]=[{'all':!![]}];}return db[_0x8e30('0x29')][_0x8e30('0x40')](_0x11f86b);})['then'](function(_0x34d3cd){_0x97c5f5[_0x8e30('0x41')]=_0x34d3cd;return _0x97c5f5;})['then'](respondWithFilteredResult(_0x4aa833,_0x11f86b))[_0x8e30('0x42')](handleError(_0x4aa833,null));};exports[_0x8e30('0x43')]=function(_0x326321,_0x3fc78b){var _0x2230ed={'raw':![],'where':{'id':_0x326321[_0x8e30('0x44')]['id']}},_0x3957a9={};_0x3957a9[_0x8e30('0x2d')]=_['keys'](db['Dashboard'][_0x8e30('0x45')]);_0x3957a9[_0x8e30('0x30')]=_[_0x8e30('0x46')](_0x326321[_0x8e30('0x30')]);_0x3957a9[_0x8e30('0x2e')]=_[_0x8e30('0x2f')](_0x3957a9[_0x8e30('0x2d')],_0x3957a9[_0x8e30('0x30')]);_0x2230ed['attributes']=_[_0x8e30('0x2f')](_0x3957a9[_0x8e30('0x2d')],qs[_0x8e30('0x32')](_0x326321['query'][_0x8e30('0x32')]));_0x2230ed[_0x8e30('0x31')]=_0x2230ed[_0x8e30('0x31')][_0x8e30('0x47')]?_0x2230ed[_0x8e30('0x31')]:_0x3957a9[_0x8e30('0x2d')];if(_0x326321['query'][_0x8e30('0x3e')]){_0x2230ed[_0x8e30('0x3f')]=[{'all':!![]}];}_0x2230ed=_[_0x8e30('0x3a')]({},_0x2230ed,_0x326321['options']);return db[_0x8e30('0x29')]['find'](_0x2230ed)[_0x8e30('0x3d')](handleEntityNotFound(_0x3fc78b,null))[_0x8e30('0x3d')](respondWithResult(_0x3fc78b,null))[_0x8e30('0x42')](handleError(_0x3fc78b,null));};exports[_0x8e30('0x48')]=function(_0x8319bf,_0x13d5c7){return db[_0x8e30('0x29')][_0x8e30('0x48')](_0x8319bf['body'],{})[_0x8e30('0x3d')](function(_0x383421){var _0x19e318=_0x8319bf['user'][_0x8e30('0x23')]({'plain':!![]});if(!_0x19e318)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19e318['role']==='user'){var _0x928146=_0x383421[_0x8e30('0x23')]({'plain':!![]});var _0x52dbd9='CustomDashboards';return db[_0x8e30('0x49')][_0x8e30('0x4a')]({'where':{'name':_0x52dbd9,'userProfileId':_0x19e318[_0x8e30('0x4b')]},'raw':!![]})['then'](function(_0x5daf13){if(_0x5daf13&&_0x5daf13['autoAssociation']===0x0){return db[_0x8e30('0x4c')]['create']({'name':_0x928146[_0x8e30('0x26')],'resourceId':_0x928146['id'],'type':_0x5daf13[_0x8e30('0x26')],'sectionId':_0x5daf13['id']},{})['then'](function(){return _0x383421;});}else{return _0x383421;}})[_0x8e30('0x42')](function(_0x5dde96){logger[_0x8e30('0x4d')](_0x8e30('0x4e'),_0x5dde96);throw _0x5dde96;});}return _0x383421;})[_0x8e30('0x3d')](respondWithResult(_0x13d5c7,0xc9))[_0x8e30('0x42')](handleError(_0x13d5c7,null));};exports[_0x8e30('0x4f')]=function(_0x412baf,_0x1609a5){var _0x1bfd4d={'where':{'id':_0x412baf[_0x8e30('0x44')]['id']}},_0x399504={};_0x399504[_0x8e30('0x2d')]=_['keys'](db[_0x8e30('0x29')]['rawAttributes']);_0x1bfd4d['attributes']=_[_0x8e30('0x2f')](_0x399504[_0x8e30('0x2d')],qs[_0x8e30('0x32')](_0x412baf[_0x8e30('0x30')][_0x8e30('0x32')]));_0x1bfd4d[_0x8e30('0x31')]=_0x1bfd4d[_0x8e30('0x31')]['length']?_0x1bfd4d[_0x8e30('0x31')]:_0x399504['model'];if(_0x412baf[_0x8e30('0x30')]['includeAll']){_0x1bfd4d[_0x8e30('0x3f')]=[{'all':!![]}];}_0x1bfd4d=_[_0x8e30('0x3a')]({},_0x1bfd4d,_0x412baf[_0x8e30('0x3c')]);return db['Dashboard'][_0x8e30('0x4a')](_0x1bfd4d)['then'](handleEntityNotFound(_0x1609a5,null))[_0x8e30('0x3d')](function(_0x434920){if(_0x434920){var _0x1f6783=_0x434920[_0x8e30('0x23')]({'plain':!![]});_0x1f6783=qs[_0x8e30('0x50')](_0x1f6783,['id',_0x8e30('0x51'),'updatedAt']);_0x412baf[_0x8e30('0x52')]=_[_0x8e30('0x50')](_0x412baf[_0x8e30('0x52')],['id','createdAt',_0x8e30('0x53')]);return db[_0x8e30('0x29')][_0x8e30('0x48')](_['merge'](_0x1f6783,_0x412baf[_0x8e30('0x52')]),{'include':_0x412baf[_0x8e30('0x30')][_0x8e30('0x3e')]?[{'all':!![]}]:undefined})[_0x8e30('0x3d')](function(_0x2680bc){var _0x308c5a=_0x412baf[_0x8e30('0x54')][_0x8e30('0x23')]({'plain':!![]});if(!_0x308c5a)throw new Error(_0x8e30('0x55'));if(_0x308c5a[_0x8e30('0x56')]===_0x8e30('0x54')){var _0x2fa9ac=_0x2680bc[_0x8e30('0x23')]({'plain':!![]});var _0x11ecaa='CustomDashboards';return db[_0x8e30('0x49')][_0x8e30('0x4a')]({'where':{'name':_0x11ecaa,'userProfileId':_0x308c5a[_0x8e30('0x4b')]},'raw':!![]})[_0x8e30('0x3d')](function(_0xa85116){if(_0xa85116&&_0xa85116[_0x8e30('0x57')]===0x0){return db['UserProfileResource'][_0x8e30('0x48')]({'name':_0x2fa9ac[_0x8e30('0x26')],'resourceId':_0x2fa9ac['id'],'type':_0xa85116[_0x8e30('0x26')],'sectionId':_0xa85116['id']},{})[_0x8e30('0x3d')](function(){return _0x2680bc;});}else{return _0x2680bc;}})[_0x8e30('0x42')](function(_0x5c3e1e){logger[_0x8e30('0x4d')](_0x8e30('0x4e'),_0x5c3e1e);throw _0x5c3e1e;});}return _0x2680bc;});}})[_0x8e30('0x3d')](respondWithResult(_0x1609a5,0xc9))[_0x8e30('0x42')](handleError(_0x1609a5,null));};exports[_0x8e30('0x21')]=function(_0x1834fc,_0x5a10b5){if(_0x1834fc[_0x8e30('0x52')]['id']){delete _0x1834fc[_0x8e30('0x52')]['id'];}return db[_0x8e30('0x29')]['find']({'where':{'id':_0x1834fc[_0x8e30('0x44')]['id']}})[_0x8e30('0x3d')](handleEntityNotFound(_0x5a10b5,null))[_0x8e30('0x3d')](saveUpdates(_0x1834fc[_0x8e30('0x52')],null))[_0x8e30('0x3d')](respondWithResult(_0x5a10b5,null))['catch'](handleError(_0x5a10b5,null));};exports[_0x8e30('0x22')]=function(_0x28959e,_0x41fc23){return db[_0x8e30('0x29')][_0x8e30('0x4a')]({'where':{'id':_0x28959e[_0x8e30('0x44')]['id']}})[_0x8e30('0x3d')](handleEntityNotFound(_0x41fc23,null))['then'](removeEntity(_0x41fc23,null))[_0x8e30('0x42')](handleError(_0x41fc23,null));};function widgetAttributes(_0x428eb0){try{switch(_0x428eb0['type']){case _0x8e30('0x58'):return[{'name':'attrUrl','value':_0x428eb0[_0x8e30('0x59')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0['attrs'][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x5b')]:undefined)||_0x8e30('0x5c')}];case _0x8e30('0x5d'):return[{'name':_0x8e30('0x5e'),'value':_0x428eb0['attrPath']||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x0]?_0x428eb0['attrs'][0x0]['value']:undefined)||''}];case _0x8e30('0x5f'):return[{'name':_0x8e30('0x60'),'value':_0x428eb0[_0x8e30('0x60')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x5b')]:undefined)||_0x8e30('0x61')},{'name':_0x8e30('0x62'),'value':_0x428eb0[_0x8e30('0x62')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x1]?_0x428eb0['attrs'][0x1]['value']:undefined)||_0x8e30('0x63')},{'name':_0x8e30('0x64'),'value':_0x428eb0[_0x8e30('0x64')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x2]?_0x428eb0['attrs'][0x2][_0x8e30('0x5b')]:undefined)||0xc}];case _0x8e30('0x65'):return[{'name':_0x8e30('0x66'),'value':_0x428eb0[_0x8e30('0x66')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x5b')]:undefined)||_0x8e30('0x67')},{'name':_0x8e30('0x68'),'value':_0x428eb0[_0x8e30('0x68')]||(_0x428eb0['attrs']&&_0x428eb0[_0x8e30('0x5a')][0x1]?_0x428eb0[_0x8e30('0x5a')][0x1][_0x8e30('0x5b')]:undefined)||[]},{'name':_0x8e30('0x64'),'value':_0x428eb0[_0x8e30('0x64')]||(_0x428eb0['attrs']&&_0x428eb0[_0x8e30('0x5a')][0x2]?_0x428eb0[_0x8e30('0x5a')][0x2][_0x8e30('0x5b')]:undefined)||0x14}];case _0x8e30('0x69'):case'pie-chart':return[{'name':_0x8e30('0x6a'),'value':_0x428eb0['attrSerie1']||(_0x428eb0['attrs']&&_0x428eb0[_0x8e30('0x5a')][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x5b')]:undefined)||_0x8e30('0x67')},{'name':_0x8e30('0x6b'),'value':_0x428eb0['attrSerie2']||(_0x428eb0['attrs']&&_0x428eb0['attrs'][0x1]?_0x428eb0['attrs'][0x1][_0x8e30('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x428eb0['attrSerie3']||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x2]?_0x428eb0[_0x8e30('0x5a')][0x2]['value']:undefined)||null},{'name':_0x8e30('0x68'),'value':_0x428eb0[_0x8e30('0x68')]||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x3]?_0x428eb0[_0x8e30('0x5a')][0x3][_0x8e30('0x5b')]:undefined)||[]}];case _0x8e30('0x6c'):return[{'name':'attrReport','type':_0x428eb0['reportType']||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x2b')]:undefined)||null,'value':_0x428eb0['attrReport']||(_0x428eb0['attrs']&&_0x428eb0['attrs'][0x0]?_0x428eb0[_0x8e30('0x5a')][0x0][_0x8e30('0x5b')]:undefined)||null},{'name':_0x8e30('0x6d'),'value':_0x428eb0['attrRefresh']||(_0x428eb0[_0x8e30('0x5a')]&&_0x428eb0[_0x8e30('0x5a')][0x1]?_0x428eb0[_0x8e30('0x5a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x25dc0b){logger['error'](_0x8e30('0x6e'),JSON['stringify'](_0x25dc0b));return[];}}exports[_0x8e30('0x6f')]=function(_0x1905cc,_0xc42cb6,_0x79dee9){if(_0x1905cc['body']['id']){delete _0x1905cc[_0x8e30('0x52')]['id'];}return db[_0x8e30('0x29')]['find']({'where':{'id':_0x1905cc['params']['id']}})[_0x8e30('0x3d')](handleEntityNotFound(_0xc42cb6,null))[_0x8e30('0x3d')](function(_0x5d5e8f){if(_0x5d5e8f){_0x1905cc[_0x8e30('0x52')][_0x8e30('0x70')]=_0x5d5e8f['id'];_0x1905cc[_0x8e30('0x52')]['attrs']=widgetAttributes(_0x1905cc[_0x8e30('0x52')]);return db[_0x8e30('0x71')]['create'](_0x1905cc[_0x8e30('0x52')]);}})[_0x8e30('0x3d')](respondWithResult(_0xc42cb6,null))[_0x8e30('0x42')](handleError(_0xc42cb6,null));};exports[_0x8e30('0x72')]=function(_0x3546e7,_0x23f3be,_0x14d1b7){var _0x431816={};var _0x4b70d4={};var _0x49b35c;var _0x38727b;return db['Dashboard'][_0x8e30('0x73')]({'where':{'id':_0x3546e7['params']['id']}})['then'](handleEntityNotFound(_0x23f3be,null))[_0x8e30('0x3d')](function(_0x3d073e){if(_0x3d073e){_0x49b35c=_0x3d073e;_0x4b70d4[_0x8e30('0x2d')]=_[_0x8e30('0x46')](db[_0x8e30('0x71')][_0x8e30('0x45')]);_0x4b70d4[_0x8e30('0x30')]=_[_0x8e30('0x46')](_0x3546e7['query']);_0x4b70d4[_0x8e30('0x2e')]=_[_0x8e30('0x2f')](_0x4b70d4['model'],_0x4b70d4['query']);_0x431816[_0x8e30('0x31')]=_[_0x8e30('0x2f')](_0x4b70d4[_0x8e30('0x2d')],qs[_0x8e30('0x32')](_0x3546e7['query'][_0x8e30('0x32')]));_0x431816[_0x8e30('0x31')]=_0x431816[_0x8e30('0x31')]['length']?_0x431816[_0x8e30('0x31')]:_0x4b70d4[_0x8e30('0x2d')];_0x431816[_0x8e30('0x35')]=qs[_0x8e30('0x36')](_0x3546e7[_0x8e30('0x30')][_0x8e30('0x36')]);_0x431816[_0x8e30('0x37')]=qs['filters'](_[_0x8e30('0x38')](_0x3546e7[_0x8e30('0x30')],_0x4b70d4['filters']));if(_0x3546e7['query']['filter']){_0x431816[_0x8e30('0x37')]=_[_0x8e30('0x3a')](_0x431816[_0x8e30('0x37')],{'$or':_[_0x8e30('0x28')](_0x431816['attributes'],function(_0x248ffd){var _0x10f46b={};_0x10f46b[_0x248ffd]={'$like':'%'+_0x3546e7[_0x8e30('0x30')][_0x8e30('0x39')]+'%'};return _0x10f46b;})});}_0x431816=_[_0x8e30('0x3a')]({},_0x431816,_0x3546e7[_0x8e30('0x3c')]);return _0x49b35c[_0x8e30('0x72')](_0x431816);}})[_0x8e30('0x3d')](function(_0x1ebef4){if(_0x1ebef4){_0x38727b=_0x1ebef4[_0x8e30('0x47')];if(!_0x3546e7[_0x8e30('0x30')]['hasOwnProperty'](_0x8e30('0x34'))){_0x431816[_0x8e30('0x1d')]=qs[_0x8e30('0x1d')](_0x3546e7[_0x8e30('0x30')][_0x8e30('0x1d')]);_0x431816[_0x8e30('0x1a')]=qs['offset'](_0x3546e7[_0x8e30('0x30')][_0x8e30('0x1a')]);}return _0x49b35c[_0x8e30('0x72')](_0x431816);}})['then'](function(_0xbe3a7b){if(_0xbe3a7b){return _0xbe3a7b?{'count':_0x38727b,'rows':_0xbe3a7b}:null;}})[_0x8e30('0x3d')](respondWithResult(_0x23f3be,null))[_0x8e30('0x42')](handleError(_0x23f3be,null));}; \ No newline at end of file +var _0x4d6f=['autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x4d6f,0x11c));var _0xf4d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d6f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf4d6('0x0'));var rimraf=require(_0xf4d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4d6('0x2'));var rp=require(_0xf4d6('0x3'));var moment=require(_0xf4d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4d6('0x5'));var util=require(_0xf4d6('0x6'));var path=require(_0xf4d6('0x7'));var sox=require(_0xf4d6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4d6('0x9'));var _=require(_0xf4d6('0xa'));var squel=require(_0xf4d6('0xb'));var crypto=require(_0xf4d6('0xc'));var jsforce=require(_0xf4d6('0xd'));var deskjs=require(_0xf4d6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4d6('0xf'));var Papa=require(_0xf4d6('0x10'));var Redis=require('ioredis');var authService=require(_0xf4d6('0x11'));var qs=require(_0xf4d6('0x12'));var as=require(_0xf4d6('0x13'));var hardwareService=require(_0xf4d6('0x14'));var logger=require(_0xf4d6('0x15'))(_0xf4d6('0x16'));var utils=require(_0xf4d6('0x17'));var config=require(_0xf4d6('0x18'));var licenseUtil=require(_0xf4d6('0x19'));var db=require(_0xf4d6('0x1a'))['db'];config[_0xf4d6('0x1b')]=_[_0xf4d6('0x1c')](config[_0xf4d6('0x1b')],{'host':_0xf4d6('0x1d'),'port':0x18eb});var socket=require(_0xf4d6('0x1e'))(new Redis(config[_0xf4d6('0x1b')]));require(_0xf4d6('0x1f'))['register'](socket);function respondWithStatusCode(_0x259e7d,_0x106c22){_0x106c22=_0x106c22||0xcc;return function(_0x192ee8){if(_0x192ee8){return _0x259e7d[_0xf4d6('0x20')](_0x106c22);}return _0x259e7d[_0xf4d6('0x21')](_0x106c22)['end']();};}function respondWithResult(_0x5b759a,_0x14ab99){_0x14ab99=_0x14ab99||0xc8;return function(_0x16bb81){if(_0x16bb81){return _0x5b759a['status'](_0x14ab99)[_0xf4d6('0x22')](_0x16bb81);}};}function respondWithFilteredResult(_0x20e8ed,_0x3dffcf){return function(_0x863fab){if(_0x863fab){var _0x64485=typeof _0x3dffcf['offset']===_0xf4d6('0x23')&&typeof _0x3dffcf[_0xf4d6('0x24')]===_0xf4d6('0x23');var _0x2c3ee0=_0x863fab[_0xf4d6('0x25')];var _0x2725b6=_0x64485?0x0:_0x3dffcf['offset'];var _0x2957c1=_0x64485?_0x863fab[_0xf4d6('0x25')]:_0x3dffcf[_0xf4d6('0x26')]+_0x3dffcf['limit'];var _0x244cf3;if(_0x2957c1>=_0x2c3ee0){_0x2957c1=_0x2c3ee0;_0x244cf3=0xc8;}else{_0x244cf3=0xce;}_0x20e8ed[_0xf4d6('0x21')](_0x244cf3);return _0x20e8ed[_0xf4d6('0x27')]('Content-Range',_0x2725b6+'-'+_0x2957c1+'/'+_0x2c3ee0)[_0xf4d6('0x22')](_0x863fab);}return null;};}function patchUpdates(_0x4a8c39){return function(_0x117840){try{jsonpatch[_0xf4d6('0x28')](_0x117840,_0x4a8c39,!![]);}catch(_0x55f453){return BPromise[_0xf4d6('0x29')](_0x55f453);}return _0x117840[_0xf4d6('0x2a')]();};}function saveUpdates(_0x2d6c6e,_0x27e28c){return function(_0x454c8b){if(_0x454c8b){return _0x454c8b[_0xf4d6('0x2b')](_0x2d6c6e)[_0xf4d6('0x2c')](function(_0x5e3a6c){return _0x5e3a6c;});}return null;};}function removeEntity(_0x3d4ba7,_0x18f79a){return function(_0x266ba0){if(_0x266ba0){return _0x266ba0['destroy']()[_0xf4d6('0x2c')](function(){var _0x568f7d=_0x266ba0['get']({'plain':!![]});var _0xe794b0=_0xf4d6('0x2d');return db[_0xf4d6('0x2e')][_0xf4d6('0x2f')]({'where':{'type':_0xe794b0,'resourceId':_0x568f7d['id']}})['then'](function(){return _0x266ba0;});})['then'](function(){_0x3d4ba7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x374804,_0x3f495d){return function(_0x56a43f){if(!_0x56a43f){_0x374804[_0xf4d6('0x20')](0x194);}return _0x56a43f;};}function handleError(_0x42315b,_0x2d2d7c){_0x2d2d7c=_0x2d2d7c||0x1f4;return function(_0x99f4c8){logger[_0xf4d6('0x30')](_0x99f4c8[_0xf4d6('0x31')]);if(_0x99f4c8['name']){delete _0x99f4c8[_0xf4d6('0x32')];}_0x42315b['status'](_0x2d2d7c)[_0xf4d6('0x33')](_0x99f4c8);};}exports[_0xf4d6('0x34')]=function(_0x582b82,_0x7eacda){var _0x204f29={},_0x4c17e6={},_0x138054={'count':0x0,'rows':[]};var _0x19ad44=_[_0xf4d6('0x35')](db[_0xf4d6('0x36')][_0xf4d6('0x37')],function(_0x50e770){return{'name':_0x50e770[_0xf4d6('0x38')],'type':_0x50e770['type'][_0xf4d6('0x39')]};});_0x4c17e6[_0xf4d6('0x3a')]=_[_0xf4d6('0x35')](_0x19ad44,'name');_0x4c17e6['query']=_[_0xf4d6('0x3b')](_0x582b82[_0xf4d6('0x3c')]);_0x4c17e6['filters']=_[_0xf4d6('0x3d')](_0x4c17e6[_0xf4d6('0x3a')],_0x4c17e6[_0xf4d6('0x3c')]);_0x204f29['attributes']=_[_0xf4d6('0x3d')](_0x4c17e6['model'],qs['fields'](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x3e')]));_0x204f29['attributes']=_0x204f29[_0xf4d6('0x3f')]['length']?_0x204f29['attributes']:_0x4c17e6[_0xf4d6('0x3a')];if(!_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x40')](_0xf4d6('0x41'))){_0x204f29[_0xf4d6('0x24')]=qs[_0xf4d6('0x24')](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x24')]);_0x204f29[_0xf4d6('0x26')]=qs['offset'](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x26')]);}_0x204f29[_0xf4d6('0x42')]=qs[_0xf4d6('0x43')](_0x582b82['query'][_0xf4d6('0x43')]);_0x204f29[_0xf4d6('0x44')]=qs[_0xf4d6('0x45')](_[_0xf4d6('0x46')](_0x582b82[_0xf4d6('0x3c')],_0x4c17e6[_0xf4d6('0x45')]),_0x19ad44);if(_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x47')]){_0x204f29[_0xf4d6('0x44')]=_[_0xf4d6('0x48')](_0x204f29['where'],{'$or':_[_0xf4d6('0x35')](_0x19ad44,function(_0x11f627){if(_0x11f627[_0xf4d6('0x49')]!==_0xf4d6('0x4a')){var _0x576370={};_0x576370[_0x11f627['name']]={'$like':'%'+_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x47')]+'%'};return _0x576370;}})});}_0x204f29=_[_0xf4d6('0x48')]({},_0x204f29,_0x582b82[_0xf4d6('0x4b')]);var _0x2c0f6a={'where':_0x204f29[_0xf4d6('0x44')]};return db['Dashboard'][_0xf4d6('0x25')](_0x2c0f6a)[_0xf4d6('0x2c')](function(_0x168455){_0x138054[_0xf4d6('0x25')]=_0x168455;if(_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x4c')]){_0x204f29[_0xf4d6('0x4d')]=[{'all':!![]}];}return db[_0xf4d6('0x36')][_0xf4d6('0x4e')](_0x204f29);})['then'](function(_0x51c832){_0x138054[_0xf4d6('0x4f')]=_0x51c832;return _0x138054;})['then'](respondWithFilteredResult(_0x7eacda,_0x204f29))['catch'](handleError(_0x7eacda,null));};exports[_0xf4d6('0x50')]=function(_0x1af6d7,_0x246500){var _0x500264={'raw':![],'where':{'id':_0x1af6d7['params']['id']}},_0x5cf9d6={};_0x5cf9d6[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db['Dashboard'][_0xf4d6('0x37')]);_0x5cf9d6['query']=_['keys'](_0x1af6d7[_0xf4d6('0x3c')]);_0x5cf9d6[_0xf4d6('0x45')]=_[_0xf4d6('0x3d')](_0x5cf9d6[_0xf4d6('0x3a')],_0x5cf9d6[_0xf4d6('0x3c')]);_0x500264[_0xf4d6('0x3f')]=_[_0xf4d6('0x3d')](_0x5cf9d6[_0xf4d6('0x3a')],qs[_0xf4d6('0x3e')](_0x1af6d7[_0xf4d6('0x3c')]['fields']));_0x500264['attributes']=_0x500264[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x500264[_0xf4d6('0x3f')]:_0x5cf9d6[_0xf4d6('0x3a')];if(_0x1af6d7[_0xf4d6('0x3c')][_0xf4d6('0x4c')]){_0x500264[_0xf4d6('0x4d')]=[{'all':!![]}];}_0x500264=_[_0xf4d6('0x48')]({},_0x500264,_0x1af6d7['options']);return db[_0xf4d6('0x36')][_0xf4d6('0x52')](_0x500264)[_0xf4d6('0x2c')](handleEntityNotFound(_0x246500,null))['then'](respondWithResult(_0x246500,null))[_0xf4d6('0x53')](handleError(_0x246500,null));};exports[_0xf4d6('0x54')]=function(_0x34b0f8,_0x524922){return db[_0xf4d6('0x36')][_0xf4d6('0x54')](_0x34b0f8[_0xf4d6('0x55')],{})['then'](function(_0x4a3a2d){var _0x19aef4=_0x34b0f8[_0xf4d6('0x56')][_0xf4d6('0x57')]({'plain':!![]});if(!_0x19aef4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19aef4[_0xf4d6('0x58')]==='user'){var _0x3b7150=_0x4a3a2d['get']({'plain':!![]});var _0x574488='CustomDashboards';return db[_0xf4d6('0x59')][_0xf4d6('0x52')]({'where':{'name':_0x574488,'userProfileId':_0x19aef4['userProfileId']},'raw':!![]})[_0xf4d6('0x2c')](function(_0x394d7c){if(_0x394d7c&&_0x394d7c['autoAssociation']===0x0){return db[_0xf4d6('0x2e')]['create']({'name':_0x3b7150[_0xf4d6('0x32')],'resourceId':_0x3b7150['id'],'type':_0x394d7c['name'],'sectionId':_0x394d7c['id']},{})[_0xf4d6('0x2c')](function(){return _0x4a3a2d;});}else{return _0x4a3a2d;}})[_0xf4d6('0x53')](function(_0x57c44a){logger[_0xf4d6('0x30')](_0xf4d6('0x5a'),_0x57c44a);throw _0x57c44a;});}return _0x4a3a2d;})[_0xf4d6('0x2c')](respondWithResult(_0x524922,0xc9))[_0xf4d6('0x53')](handleError(_0x524922,null));};exports[_0xf4d6('0x5b')]=function(_0x1658e8,_0x3bc3a2){var _0x302b43={'where':{'id':_0x1658e8[_0xf4d6('0x5c')]['id']}},_0x18536f={};_0x18536f[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db[_0xf4d6('0x36')][_0xf4d6('0x37')]);_0x302b43['attributes']=_[_0xf4d6('0x3d')](_0x18536f[_0xf4d6('0x3a')],qs[_0xf4d6('0x3e')](_0x1658e8[_0xf4d6('0x3c')][_0xf4d6('0x3e')]));_0x302b43['attributes']=_0x302b43[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x302b43[_0xf4d6('0x3f')]:_0x18536f[_0xf4d6('0x3a')];if(_0x1658e8['query']['includeAll']){_0x302b43[_0xf4d6('0x4d')]=[{'all':!![]}];}_0x302b43=_[_0xf4d6('0x48')]({},_0x302b43,_0x1658e8[_0xf4d6('0x4b')]);return db[_0xf4d6('0x36')]['find'](_0x302b43)['then'](handleEntityNotFound(_0x3bc3a2,null))[_0xf4d6('0x2c')](function(_0x26480f){if(_0x26480f){var _0x56cd2a=_0x26480f[_0xf4d6('0x57')]({'plain':!![]});_0x56cd2a=qs['omit'](_0x56cd2a,['id',_0xf4d6('0x5d'),_0xf4d6('0x5e')]);_0x1658e8[_0xf4d6('0x55')]=_[_0xf4d6('0x5f')](_0x1658e8[_0xf4d6('0x55')],['id',_0xf4d6('0x5d'),_0xf4d6('0x5e')]);return db[_0xf4d6('0x36')][_0xf4d6('0x54')](_['merge'](_0x56cd2a,_0x1658e8['body']),{'include':_0x1658e8['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf4d6('0x2c')](function(_0x50e146){var _0x3fc7b9=_0x1658e8[_0xf4d6('0x56')]['get']({'plain':!![]});if(!_0x3fc7b9)throw new Error(_0xf4d6('0x60'));if(_0x3fc7b9[_0xf4d6('0x58')]===_0xf4d6('0x56')){var _0x169991=_0x50e146['get']({'plain':!![]});var _0x30dbb1=_0xf4d6('0x2d');return db[_0xf4d6('0x59')][_0xf4d6('0x52')]({'where':{'name':_0x30dbb1,'userProfileId':_0x3fc7b9['userProfileId']},'raw':!![]})[_0xf4d6('0x2c')](function(_0x1c1bcf){if(_0x1c1bcf&&_0x1c1bcf[_0xf4d6('0x61')]===0x0){return db['UserProfileResource'][_0xf4d6('0x54')]({'name':_0x169991[_0xf4d6('0x32')],'resourceId':_0x169991['id'],'type':_0x1c1bcf['name'],'sectionId':_0x1c1bcf['id']},{})[_0xf4d6('0x2c')](function(){return _0x50e146;});}else{return _0x50e146;}})[_0xf4d6('0x53')](function(_0x18f89f){logger[_0xf4d6('0x30')](_0xf4d6('0x5a'),_0x18f89f);throw _0x18f89f;});}return _0x50e146;});}})[_0xf4d6('0x2c')](respondWithResult(_0x3bc3a2,0xc9))[_0xf4d6('0x53')](handleError(_0x3bc3a2,null));};exports[_0xf4d6('0x2b')]=function(_0x181b0a,_0x32eb33){if(_0x181b0a[_0xf4d6('0x55')]['id']){delete _0x181b0a[_0xf4d6('0x55')]['id'];}return db[_0xf4d6('0x36')]['find']({'where':{'id':_0x181b0a[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x32eb33,null))[_0xf4d6('0x2c')](saveUpdates(_0x181b0a['body'],null))['then'](respondWithResult(_0x32eb33,null))['catch'](handleError(_0x32eb33,null));};exports[_0xf4d6('0x2f')]=function(_0x4508dc,_0x2087c1){return db[_0xf4d6('0x36')]['find']({'where':{'id':_0x4508dc[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x2087c1,null))[_0xf4d6('0x2c')](removeEntity(_0x2087c1,null))['catch'](handleError(_0x2087c1,null));};function widgetAttributes(_0x39d2e5){try{switch(_0x39d2e5[_0xf4d6('0x49')]){case _0xf4d6('0x62'):return[{'name':_0xf4d6('0x63'),'value':_0x39d2e5['attrUrl']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x66')}];case _0xf4d6('0x67'):return[{'name':'attrPath','value':_0x39d2e5[_0xf4d6('0x68')]||(_0x39d2e5['attrs']&&_0x39d2e5['attrs'][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||''}];case'clock':return[{'name':_0xf4d6('0x69'),'value':_0x39d2e5['attrHourFormat']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6a')},{'name':'attrTimezone','value':_0x39d2e5['attrTimezone']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5[_0xf4d6('0x64')][0x1][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6b')},{'name':_0xf4d6('0x6c'),'value':_0x39d2e5[_0xf4d6('0x6c')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2][_0xf4d6('0x65')]:undefined)||0xc}];case _0xf4d6('0x6d'):return[{'name':_0xf4d6('0x6e'),'value':_0x39d2e5[_0xf4d6('0x6e')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6f')},{'name':_0xf4d6('0x70'),'value':_0x39d2e5[_0xf4d6('0x70')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5['attrs'][0x1][_0xf4d6('0x65')]:undefined)||[]},{'name':'attrFontSize','value':_0x39d2e5[_0xf4d6('0x6c')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2][_0xf4d6('0x65')]:undefined)||0x14}];case _0xf4d6('0x71'):case'pie-chart':return[{'name':_0xf4d6('0x72'),'value':_0x39d2e5[_0xf4d6('0x72')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6f')},{'name':_0xf4d6('0x73'),'value':_0x39d2e5[_0xf4d6('0x73')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5['attrs'][0x1][_0xf4d6('0x65')]:undefined)||null},{'name':'attrSerie3','value':_0x39d2e5[_0xf4d6('0x74')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2]['value']:undefined)||null},{'name':_0xf4d6('0x70'),'value':_0x39d2e5['attrVoiceQueues']||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x3]?_0x39d2e5[_0xf4d6('0x64')][0x3]['value']:undefined)||[]}];case _0xf4d6('0x75'):return[{'name':_0xf4d6('0x76'),'type':_0x39d2e5[_0xf4d6('0x77')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x49')]:undefined)||null,'value':_0x39d2e5[_0xf4d6('0x76')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0]['value']:undefined)||null},{'name':_0xf4d6('0x78'),'value':_0x39d2e5[_0xf4d6('0x78')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5[_0xf4d6('0x64')][0x1][_0xf4d6('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x2f2769){logger[_0xf4d6('0x30')](_0xf4d6('0x79'),JSON['stringify'](_0x2f2769));return[];}}exports[_0xf4d6('0x7a')]=function(_0x332940,_0x485a88,_0x12a5ae){if(_0x332940[_0xf4d6('0x55')]['id']){delete _0x332940[_0xf4d6('0x55')]['id'];}return db[_0xf4d6('0x36')][_0xf4d6('0x52')]({'where':{'id':_0x332940[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x485a88,null))[_0xf4d6('0x2c')](function(_0x3b12f1){if(_0x3b12f1){_0x332940['body'][_0xf4d6('0x7b')]=_0x3b12f1['id'];_0x332940['body'][_0xf4d6('0x64')]=widgetAttributes(_0x332940[_0xf4d6('0x55')]);return db[_0xf4d6('0x7c')][_0xf4d6('0x54')](_0x332940[_0xf4d6('0x55')]);}})[_0xf4d6('0x2c')](respondWithResult(_0x485a88,null))['catch'](handleError(_0x485a88,null));};exports[_0xf4d6('0x7d')]=function(_0xbf0740,_0x236c1b,_0x330803){var _0x15f14f={};var _0x352677={};var _0x31f71b;var _0x2c1f20;return db[_0xf4d6('0x36')][_0xf4d6('0x7e')]({'where':{'id':_0xbf0740['params']['id']}})['then'](handleEntityNotFound(_0x236c1b,null))[_0xf4d6('0x2c')](function(_0x98ded3){if(_0x98ded3){_0x31f71b=_0x98ded3;_0x352677[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db['DashboardItem'][_0xf4d6('0x37')]);_0x352677['query']=_[_0xf4d6('0x3b')](_0xbf0740[_0xf4d6('0x3c')]);_0x352677[_0xf4d6('0x45')]=_['intersection'](_0x352677[_0xf4d6('0x3a')],_0x352677[_0xf4d6('0x3c')]);_0x15f14f['attributes']=_[_0xf4d6('0x3d')](_0x352677['model'],qs[_0xf4d6('0x3e')](_0xbf0740[_0xf4d6('0x3c')]['fields']));_0x15f14f[_0xf4d6('0x3f')]=_0x15f14f[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x15f14f[_0xf4d6('0x3f')]:_0x352677[_0xf4d6('0x3a')];_0x15f14f[_0xf4d6('0x42')]=qs[_0xf4d6('0x43')](_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x43')]);_0x15f14f[_0xf4d6('0x44')]=qs['filters'](_[_0xf4d6('0x46')](_0xbf0740['query'],_0x352677[_0xf4d6('0x45')]));if(_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x47')]){_0x15f14f[_0xf4d6('0x44')]=_['merge'](_0x15f14f[_0xf4d6('0x44')],{'$or':_[_0xf4d6('0x35')](_0x15f14f[_0xf4d6('0x3f')],function(_0x11e79c){var _0x59780f={};_0x59780f[_0x11e79c]={'$like':'%'+_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x47')]+'%'};return _0x59780f;})});}_0x15f14f=_[_0xf4d6('0x48')]({},_0x15f14f,_0xbf0740[_0xf4d6('0x4b')]);return _0x31f71b[_0xf4d6('0x7d')](_0x15f14f);}})[_0xf4d6('0x2c')](function(_0x16df74){if(_0x16df74){_0x2c1f20=_0x16df74['length'];if(!_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x40')]('nolimit')){_0x15f14f['limit']=qs[_0xf4d6('0x24')](_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x24')]);_0x15f14f[_0xf4d6('0x26')]=qs[_0xf4d6('0x26')](_0xbf0740['query'][_0xf4d6('0x26')]);}return _0x31f71b[_0xf4d6('0x7d')](_0x15f14f);}})[_0xf4d6('0x2c')](function(_0x18bc31){if(_0x18bc31){return _0x18bc31?{'count':_0x2c1f20,'rows':_0x18bc31}:null;}})['then'](respondWithResult(_0x236c1b,null))['catch'](handleError(_0x236c1b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 2404246..3a8d15c 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 _0x8598=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x47ae52,_0x4d1100){var _0x4aaf91=function(_0x2f21fb){while(--_0x2f21fb){_0x47ae52['push'](_0x47ae52['shift']());}};_0x4aaf91(++_0x4d1100);}(_0x8598,0x17f));var _0x8859=function(_0x5ad820,_0x955136){_0x5ad820=_0x5ad820-0x0;var _0x1969d3=_0x8598[_0x5ad820];return _0x1969d3;};'use strict';var EventEmitter=require(_0x8859('0x0'));var Dashboard=require(_0x8859('0x1'))['db'][_0x8859('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8859('0x3')](0x0);var events={'afterCreate':_0x8859('0x4'),'afterUpdate':_0x8859('0x5'),'afterDestroy':_0x8859('0x6')};function emitEvent(_0x4a9b9e){return function(_0x478c09,_0x2afb9b,_0x103c87){DashboardEvents['emit'](_0x4a9b9e+':'+_0x478c09['id'],_0x478c09);DashboardEvents[_0x8859('0x7')](_0x4a9b9e,_0x478c09);_0x103c87(null);};}for(var e in events){if(events[_0x8859('0x8')](e)){var event=events[e];Dashboard[_0x8859('0x9')](e,emitEvent(event));}}module[_0x8859('0xa')]=DashboardEvents; \ No newline at end of file +var _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0x9f02,0x68));var _0x29f0=function(_0x1ded00,_0x4973f1){_0x1ded00=_0x1ded00-0x0;var _0x40e2b5=_0x9f02[_0x1ded00];return _0x40e2b5;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){DashboardEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);DashboardEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];Dashboard[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 488e018..99ac671 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 _0x3560=['Dashboard','dashboards','lodash','util','../../config/logger','bluebird','path','../../config/environment','define'];(function(_0x6ffca4,_0x187a3b){var _0xb6b153=function(_0x170538){while(--_0x170538){_0x6ffca4['push'](_0x6ffca4['shift']());}};_0xb6b153(++_0x187a3b);}(_0x3560,0x1a9));var _0x0356=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0x3560[_0x21233e];return _0x3752c9;};'use strict';var _=require(_0x0356('0x0'));var util=require(_0x0356('0x1'));var logger=require(_0x0356('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0356('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0356('0x4'));var rimraf=require('rimraf');var config=require(_0x0356('0x5'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x34a1d8,_0xa2373f){return _0x34a1d8[_0x0356('0x6')](_0x0356('0x7'),attributes,{'tableName':_0x0356('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86e6=['request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x86e6,0x1c2));var _0x686e=function(_0x5484c9,_0x4f3d11){_0x5484c9=_0x5484c9-0x0;var _0x4a2e78=_0x86e6[_0x5484c9];return _0x4a2e78;};'use strict';var _=require(_0x686e('0x0'));var util=require('util');var logger=require(_0x686e('0x1'))(_0x686e('0x2'));var moment=require(_0x686e('0x3'));var BPromise=require(_0x686e('0x4'));var rp=require(_0x686e('0x5'));var fs=require('fs');var path=require(_0x686e('0x6'));var rimraf=require(_0x686e('0x7'));var config=require('../../config/environment');var attributes=require(_0x686e('0x8'));module[_0x686e('0x9')]=function(_0x148e6d,_0x5672cb){return _0x148e6d[_0x686e('0xa')](_0x686e('0xb'),attributes,{'tableName':_0x686e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 05d0a24..efbe0ad 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 _0x31dc=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x1d9c5c,_0x2bb599){var _0x354a16=function(_0x2d22ba){while(--_0x2d22ba){_0x1d9c5c['push'](_0x1d9c5c['shift']());}};_0x354a16(++_0x2bb599);}(_0x31dc,0xeb));var _0xc31d=function(_0x43ec83,_0x15c436){_0x43ec83=_0x43ec83-0x0;var _0x3ae207=_0x31dc[_0x43ec83];return _0x3ae207;};'use strict';var _=require('lodash');var util=require(_0xc31d('0x0'));var moment=require(_0xc31d('0x1'));var BPromise=require(_0xc31d('0x2'));var rs=require(_0xc31d('0x3'));var fs=require('fs');var Redis=require(_0xc31d('0x4'));var db=require(_0xc31d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc31d('0x6'))(_0xc31d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc31d('0x8')][_0xc31d('0x9')]({'port':0x232a});config[_0xc31d('0xa')]=_['defaults'](config[_0xc31d('0xa')],{'host':_0xc31d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xc31d('0xc')](socket);function respondWithRpcPromise(_0x2b344a,_0x39f1b8,_0x33749b){return new BPromise(function(_0x5e161e,_0x126789){return client[_0xc31d('0xd')](_0x2b344a,_0x33749b)['then'](function(_0x16efa9){logger[_0xc31d('0xe')](_0xc31d('0xf'),_0x39f1b8,_0xc31d('0x10'));logger['debug'](_0xc31d('0x11'),_0x39f1b8,_0xc31d('0x10'),JSON[_0xc31d('0x12')](_0x16efa9));if(_0x16efa9[_0xc31d('0x13')]){if(_0x16efa9[_0xc31d('0x13')]['code']===0x1f4){logger[_0xc31d('0x13')](_0xc31d('0xf'),_0x39f1b8,_0x16efa9[_0xc31d('0x13')][_0xc31d('0x14')]);return _0x126789(_0x16efa9[_0xc31d('0x13')][_0xc31d('0x14')]);}logger[_0xc31d('0x13')]('Dashboard,\x20%s,\x20%s',_0x39f1b8,_0x16efa9[_0xc31d('0x13')][_0xc31d('0x14')]);return _0x5e161e(_0x16efa9[_0xc31d('0x13')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x39f1b8,_0xc31d('0x10'));_0x5e161e(_0x16efa9[_0xc31d('0x15')]['message']);}})[_0xc31d('0x16')](function(_0x47f2de){logger[_0xc31d('0x13')](_0xc31d('0xf'),_0x39f1b8,_0x47f2de);_0x126789(_0x47f2de);});});} \ No newline at end of file +var _0x2a37=['http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xa0a3c5,_0x4c4618){var _0x42f6bd=function(_0x56f56a){while(--_0x56f56a){_0xa0a3c5['push'](_0xa0a3c5['shift']());}};_0x42f6bd(++_0x4c4618);}(_0x2a37,0xcf));var _0x72a3=function(_0x20fcd4,_0xcbea7){_0x20fcd4=_0x20fcd4-0x0;var _0x432eaa=_0x2a37[_0x20fcd4];return _0x432eaa;};'use strict';var _=require(_0x72a3('0x0'));var util=require(_0x72a3('0x1'));var moment=require(_0x72a3('0x2'));var BPromise=require(_0x72a3('0x3'));var rs=require(_0x72a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x72a3('0x6'))(_0x72a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x72a3('0x8'));var client=jayson['client'][_0x72a3('0x9')]({'port':0x232a});config[_0x72a3('0xa')]=_[_0x72a3('0xb')](config[_0x72a3('0xa')],{'host':_0x72a3('0xc'),'port':0x18eb});var socket=require(_0x72a3('0xd'))(new Redis(config[_0x72a3('0xa')]));require(_0x72a3('0xe'))[_0x72a3('0xf')](socket);function respondWithRpcPromise(_0xc50d48,_0x32eea0,_0xa73a1d){return new BPromise(function(_0x46a106,_0x34fdd0){return client[_0x72a3('0x10')](_0xc50d48,_0xa73a1d)[_0x72a3('0x11')](function(_0x465a82){logger[_0x72a3('0x12')](_0x72a3('0x13'),_0x32eea0,_0x72a3('0x14'));logger['debug'](_0x72a3('0x15'),_0x32eea0,'request\x20sent',JSON[_0x72a3('0x16')](_0x465a82));if(_0x465a82[_0x72a3('0x17')]){if(_0x465a82[_0x72a3('0x17')][_0x72a3('0x18')]===0x1f4){logger[_0x72a3('0x17')]('Dashboard,\x20%s,\x20%s',_0x32eea0,_0x465a82[_0x72a3('0x17')]['message']);return _0x34fdd0(_0x465a82['error'][_0x72a3('0x19')]);}logger[_0x72a3('0x17')](_0x72a3('0x13'),_0x32eea0,_0x465a82['error'][_0x72a3('0x19')]);return _0x46a106(_0x465a82['error'][_0x72a3('0x19')]);}else{logger['info'](_0x72a3('0x13'),_0x32eea0,_0x72a3('0x14'));_0x46a106(_0x465a82[_0x72a3('0x1a')][_0x72a3('0x19')]);}})['catch'](function(_0xd407ae){logger[_0x72a3('0x17')](_0x72a3('0x13'),_0x32eea0,_0xd407ae);_0x34fdd0(_0xd407ae);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1cf4da7..d74436f 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 _0xec0a=['register','length','dashboard:','save','remove','update','emit','removeListener'];(function(_0x5524e2,_0x23c52f){var _0x801bcb=function(_0x63436a){while(--_0x63436a){_0x5524e2['push'](_0x5524e2['shift']());}};_0x801bcb(++_0x23c52f);}(_0xec0a,0x9b));var _0xaec0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xec0a[_0x432682];return _0x463d05;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xaec0('0x0'),_0xaec0('0x1'),_0xaec0('0x2')];function createListener(_0x4c6f2b,_0x1cc84b){return function(_0xcb9360){_0x1cc84b[_0xaec0('0x3')](_0x4c6f2b,_0xcb9360);};}function removeListener(_0x251eac,_0x5bfad8){return function(){DashboardEvents[_0xaec0('0x4')](_0x251eac,_0x5bfad8);};}exports[_0xaec0('0x5')]=function(_0x33c3ef){for(var _0x222300=0x0,_0x11a5e9=events[_0xaec0('0x6')];_0x222300<_0x11a5e9;_0x222300++){var _0x2d8e09=events[_0x222300];var _0x3a1b08=createListener(_0xaec0('0x7')+_0x2d8e09,_0x33c3ef);DashboardEvents['on'](_0x2d8e09,_0x3a1b08);}}; \ No newline at end of file +var _0x117a=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0x117a,0x126));var _0xa117=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x117a[_0x2e76a7];return _0x454cde;};'use strict';var DashboardEvents=require(_0xa117('0x0'));var events=[_0xa117('0x1'),_0xa117('0x2'),_0xa117('0x3')];function createListener(_0x42101e,_0x1a4646){return function(_0x2329a3){_0x1a4646[_0xa117('0x4')](_0x42101e,_0x2329a3);};}function removeListener(_0x1d2369,_0x4ad5c6){return function(){DashboardEvents[_0xa117('0x5')](_0x1d2369,_0x4ad5c6);};}exports[_0xa117('0x6')]=function(_0x208de8){for(var _0x4ee0f6=0x0,_0x38e2bf=events[_0xa117('0x7')];_0x4ee0f6<_0x38e2bf;_0x4ee0f6++){var _0x29b3a2=events[_0x4ee0f6];var _0x85dae1=createListener(_0xa117('0x8')+_0x29b3a2,_0x208de8);DashboardEvents['on'](_0x29b3a2,_0x85dae1);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d396bea..6a12f67 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 _0x417c=['/:id','isAuthenticated','show','getItems','create','post','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x415999,_0x2e0e6e){var _0x3ae498=function(_0x21329c){while(--_0x21329c){_0x415999['push'](_0x415999['shift']());}};_0x3ae498(++_0x2e0e6e);}(_0x417c,0x77));var _0xc417=function(_0x1a030b,_0x454eb7){_0x1a030b=_0x1a030b-0x0;var _0x376820=_0x417c[_0x1a030b];return _0x376820;};'use strict';var multer=require(_0xc417('0x0'));var util=require(_0xc417('0x1'));var path=require(_0xc417('0x2'));var timeout=require(_0xc417('0x3'));var express=require(_0xc417('0x4'));var router=express[_0xc417('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc417('0x6'));var interaction=require(_0xc417('0x7'));var config=require(_0xc417('0x8'));var controller=require(_0xc417('0x9'));router[_0xc417('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc417('0xa')](_0xc417('0xb'),auth[_0xc417('0xc')](),controller[_0xc417('0xd')]);router[_0xc417('0xa')]('/:id/items',auth[_0xc417('0xc')](),controller[_0xc417('0xe')]);router['post']('/',auth[_0xc417('0xc')](),controller[_0xc417('0xf')]);router[_0xc417('0x10')](_0xc417('0x11'),auth[_0xc417('0xc')](),controller[_0xc417('0x12')]);router[_0xc417('0x10')](_0xc417('0x13'),auth[_0xc417('0xc')](),controller[_0xc417('0x14')]);router[_0xc417('0x15')](_0xc417('0xb'),auth[_0xc417('0xc')](),controller[_0xc417('0x16')]);router[_0xc417('0x17')](_0xc417('0xb'),auth[_0xc417('0xc')](),controller[_0xc417('0x18')]);module[_0xc417('0x19')]=router; \ No newline at end of file +var _0xd98a=['get','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0xd98a,0xcd));var _0xad98=function(_0x4c0744,_0x2d6c65){_0x4c0744=_0x4c0744-0x0;var _0xda5533=_0xd98a[_0x4c0744];return _0xda5533;};'use strict';var multer=require(_0xad98('0x0'));var util=require('util');var path=require(_0xad98('0x1'));var timeout=require(_0xad98('0x2'));var express=require(_0xad98('0x3'));var router=express[_0xad98('0x4')]();var fs_extra=require(_0xad98('0x5'));var auth=require(_0xad98('0x6'));var interaction=require(_0xad98('0x7'));var config=require(_0xad98('0x8'));var controller=require(_0xad98('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xad98('0xa')]);router[_0xad98('0xb')]('/:id',auth[_0xad98('0xc')](),controller[_0xad98('0xd')]);router[_0xad98('0xb')](_0xad98('0xe'),auth[_0xad98('0xc')](),controller[_0xad98('0xf')]);router['post']('/',auth[_0xad98('0xc')](),controller['create']);router[_0xad98('0x10')](_0xad98('0x11'),auth[_0xad98('0xc')](),controller[_0xad98('0x12')]);router[_0xad98('0x10')]('/:id/items',auth['isAuthenticated'](),controller[_0xad98('0x13')]);router[_0xad98('0x14')](_0xad98('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xad98('0x16')](_0xad98('0x15'),auth[_0xad98('0xc')](),controller[_0xad98('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 68313f1..fa70c0c 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 _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x3d78b5,_0x4936ed){var _0x380d7b=function(_0x1b7bf8){while(--_0x1b7bf8){_0x3d78b5['push'](_0x3d78b5['shift']());}};_0x380d7b(++_0x4936ed);}(_0x814b,0x1a2));var _0xb814=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x814b[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1623=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','exports','STRING','TEXT','long'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x1623,0xab));var _0x3162=function(_0x2222db,_0x552930){_0x2222db=_0x2222db-0x0;var _0x3d0042=_0x1623[_0x2222db];return _0x3d0042;};'use strict';var Sequelize=require(_0x3162('0x0'));var squel=require('squel');var _=require('lodash');module[_0x3162('0x1')]={'title':{'type':Sequelize[_0x3162('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3162('0x5')));}catch(_0x4b77c4){return[];}},'set':function(_0x1b55f2){try{this[_0x3162('0x6')]('attrs',JSON[_0x3162('0x7')](_0x1b55f2));}catch(_0x2dc07e){this[_0x3162('0x6')](_0x3162('0x5'),JSON[_0x3162('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3162('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':_0x3162('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3162('0x2')]},'titleFontSize':{'type':Sequelize[_0x3162('0x8')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 78465d0..05b8db1 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 _0x4ac5=['set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','keys','query','intersection','attributes','fields','length','include','merge','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','status','undefined','limit','offset'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x4ac5,0x1ed));var _0x54ac=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x4ac5[_0x3f3a47];return _0x57a682;};'use strict';var emlformat=require(_0x54ac('0x0'));var rimraf=require(_0x54ac('0x1'));var zipdir=require(_0x54ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x54ac('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x54ac('0x4'));var sox=require(_0x54ac('0x5'));var csv=require(_0x54ac('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54ac('0x7'));var squel=require('squel');var crypto=require(_0x54ac('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x54ac('0x9'));var toCsv=require('to-csv');var querystring=require(_0x54ac('0xa'));var Papa=require(_0x54ac('0xb'));var Redis=require(_0x54ac('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54ac('0xd'));var logger=require(_0x54ac('0xe'))(_0x54ac('0xf'));var utils=require(_0x54ac('0x10'));var config=require(_0x54ac('0x11'));var licenseUtil=require(_0x54ac('0x12'));var db=require(_0x54ac('0x13'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x54ac('0x14'))(new Redis(config[_0x54ac('0x15')]));require(_0x54ac('0x16'))[_0x54ac('0x17')](socket);function respondWithStatusCode(_0x4f2d5b,_0x184821){_0x184821=_0x184821||0xcc;return function(_0x3eee6d){if(_0x3eee6d){return _0x4f2d5b[_0x54ac('0x18')](_0x184821);}return _0x4f2d5b[_0x54ac('0x19')](_0x184821)['end']();};}function respondWithResult(_0x5dc85c,_0x400c12){_0x400c12=_0x400c12||0xc8;return function(_0x51a14d){if(_0x51a14d){return _0x5dc85c[_0x54ac('0x19')](_0x400c12)['json'](_0x51a14d);}};}function respondWithFilteredResult(_0x3c8195,_0x5d8e3c){return function(_0x535433){if(_0x535433){var _0x4bdb27=typeof _0x5d8e3c['offset']===_0x54ac('0x1a')&&typeof _0x5d8e3c[_0x54ac('0x1b')]===_0x54ac('0x1a');var _0x389194=_0x535433['count'];var _0xa41bcf=_0x4bdb27?0x0:_0x5d8e3c[_0x54ac('0x1c')];var _0x356565=_0x4bdb27?_0x535433['count']:_0x5d8e3c['offset']+_0x5d8e3c[_0x54ac('0x1b')];var _0x3bddce;if(_0x356565>=_0x389194){_0x356565=_0x389194;_0x3bddce=0xc8;}else{_0x3bddce=0xce;}_0x3c8195[_0x54ac('0x19')](_0x3bddce);return _0x3c8195[_0x54ac('0x1d')](_0x54ac('0x1e'),_0xa41bcf+'-'+_0x356565+'/'+_0x389194)[_0x54ac('0x1f')](_0x535433);}return null;};}function patchUpdates(_0x1b0185){return function(_0x4dcf3b){try{jsonpatch[_0x54ac('0x20')](_0x4dcf3b,_0x1b0185,!![]);}catch(_0x180e80){return BPromise[_0x54ac('0x21')](_0x180e80);}return _0x4dcf3b[_0x54ac('0x22')]();};}function saveUpdates(_0x324d16,_0x511926){return function(_0x58f31f){if(_0x58f31f){return _0x58f31f[_0x54ac('0x23')](_0x324d16)['then'](function(_0x2b1bf0){return _0x2b1bf0;});}return null;};}function removeEntity(_0x44e063,_0x2ec379){return function(_0x4a6232){if(_0x4a6232){return _0x4a6232[_0x54ac('0x24')]()[_0x54ac('0x25')](function(){_0x44e063[_0x54ac('0x19')](0xcc)[_0x54ac('0x26')]();});}};}function handleEntityNotFound(_0x241647,_0x81e8b0){return function(_0x2f5db6){if(!_0x2f5db6){_0x241647[_0x54ac('0x18')](0x194);}return _0x2f5db6;};}function handleError(_0x29b5e9,_0x2e6726){_0x2e6726=_0x2e6726||0x1f4;return function(_0x354054){logger[_0x54ac('0x27')](_0x354054[_0x54ac('0x28')]);if(_0x354054[_0x54ac('0x29')]){delete _0x354054[_0x54ac('0x29')];}_0x29b5e9['status'](_0x2e6726)[_0x54ac('0x2a')](_0x354054);};}exports[_0x54ac('0x2b')]=function(_0x166b5c,_0x3b10ab){var _0x25331e={'raw':![],'where':{'id':_0x166b5c[_0x54ac('0x2c')]['id']}},_0x2f7607={};_0x2f7607[_0x54ac('0x2d')]=_['keys'](db[_0x54ac('0x2e')][_0x54ac('0x2f')]);_0x2f7607['query']=_[_0x54ac('0x30')](_0x166b5c[_0x54ac('0x31')]);_0x2f7607['filters']=_[_0x54ac('0x32')](_0x2f7607[_0x54ac('0x2d')],_0x2f7607[_0x54ac('0x31')]);_0x25331e[_0x54ac('0x33')]=_[_0x54ac('0x32')](_0x2f7607[_0x54ac('0x2d')],qs[_0x54ac('0x34')](_0x166b5c[_0x54ac('0x31')][_0x54ac('0x34')]));_0x25331e['attributes']=_0x25331e[_0x54ac('0x33')][_0x54ac('0x35')]?_0x25331e[_0x54ac('0x33')]:_0x2f7607[_0x54ac('0x2d')];if(_0x166b5c[_0x54ac('0x31')]['includeAll']){_0x25331e[_0x54ac('0x36')]=[{'all':!![]}];}_0x25331e=_[_0x54ac('0x37')]({},_0x25331e,_0x166b5c['options']);return db[_0x54ac('0x2e')][_0x54ac('0x38')](_0x25331e)[_0x54ac('0x25')](handleEntityNotFound(_0x3b10ab,null))[_0x54ac('0x25')](respondWithResult(_0x3b10ab,null))[_0x54ac('0x39')](handleError(_0x3b10ab,null));};exports[_0x54ac('0x24')]=function(_0x1b77b1,_0x17b80e){return db[_0x54ac('0x2e')][_0x54ac('0x38')]({'where':{'id':_0x1b77b1[_0x54ac('0x2c')]['id']}})[_0x54ac('0x25')](handleEntityNotFound(_0x17b80e,null))[_0x54ac('0x25')](removeEntity(_0x17b80e,null))[_0x54ac('0x39')](handleError(_0x17b80e,null));};function widgetAttributes(_0x1eb2e9){try{switch(_0x1eb2e9['type']){case _0x54ac('0x3a'):return[{'name':_0x54ac('0x3b'),'value':_0x1eb2e9[_0x54ac('0x3b')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9['attrs'][0x0]?_0x1eb2e9['attrs'][0x0][_0x54ac('0x3d')]:undefined)||_0x54ac('0x3e')}];case _0x54ac('0x3f'):return[{'name':'attrPath','value':_0x1eb2e9[_0x54ac('0x40')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x0]?_0x1eb2e9[_0x54ac('0x3c')][0x0][_0x54ac('0x3d')]:undefined)||''}];case _0x54ac('0x41'):return[{'name':_0x54ac('0x42'),'value':_0x1eb2e9['attrHourFormat']||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x0]?_0x1eb2e9[_0x54ac('0x3c')][0x0]['value']:undefined)||_0x54ac('0x43')},{'name':_0x54ac('0x44'),'value':_0x1eb2e9[_0x54ac('0x44')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9['attrs'][0x1]?_0x1eb2e9[_0x54ac('0x3c')][0x1][_0x54ac('0x3d')]:undefined)||'0.00'},{'name':_0x54ac('0x45'),'value':_0x1eb2e9[_0x54ac('0x45')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x2]?_0x1eb2e9['attrs'][0x2][_0x54ac('0x3d')]:undefined)||0xc}];case _0x54ac('0x46'):return[{'name':_0x54ac('0x47'),'value':_0x1eb2e9[_0x54ac('0x47')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9['attrs'][0x0]?_0x1eb2e9[_0x54ac('0x3c')][0x0]['value']:undefined)||_0x54ac('0x48')},{'name':_0x54ac('0x49'),'value':_0x1eb2e9[_0x54ac('0x49')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x1]?_0x1eb2e9[_0x54ac('0x3c')][0x1][_0x54ac('0x3d')]:undefined)||[]},{'name':_0x54ac('0x45'),'value':_0x1eb2e9[_0x54ac('0x45')]||(_0x1eb2e9['attrs']&&_0x1eb2e9[_0x54ac('0x3c')][0x2]?_0x1eb2e9[_0x54ac('0x3c')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x54ac('0x4a'):return[{'name':'attrSerie1','value':_0x1eb2e9[_0x54ac('0x4b')]||(_0x1eb2e9['attrs']&&_0x1eb2e9['attrs'][0x0]?_0x1eb2e9[_0x54ac('0x3c')][0x0]['value']:undefined)||_0x54ac('0x48')},{'name':_0x54ac('0x4c'),'value':_0x1eb2e9[_0x54ac('0x4c')]||(_0x1eb2e9['attrs']&&_0x1eb2e9[_0x54ac('0x3c')][0x1]?_0x1eb2e9[_0x54ac('0x3c')][0x1][_0x54ac('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x1eb2e9[_0x54ac('0x4d')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x2]?_0x1eb2e9['attrs'][0x2][_0x54ac('0x3d')]:undefined)||null},{'name':_0x54ac('0x49'),'value':_0x1eb2e9[_0x54ac('0x49')]||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x3]?_0x1eb2e9[_0x54ac('0x3c')][0x3][_0x54ac('0x3d')]:undefined)||[]}];case _0x54ac('0x4e'):return[{'name':_0x54ac('0x4f'),'type':_0x1eb2e9[_0x54ac('0x50')]||(_0x1eb2e9['attrs']&&_0x1eb2e9[_0x54ac('0x3c')][0x0]?_0x1eb2e9['attrs'][0x0][_0x54ac('0x51')]:undefined)||null,'value':_0x1eb2e9[_0x54ac('0x4f')]||(_0x1eb2e9['attrs']&&_0x1eb2e9[_0x54ac('0x3c')][0x0]?_0x1eb2e9['attrs'][0x0][_0x54ac('0x3d')]:undefined)||null},{'name':_0x54ac('0x52'),'value':_0x1eb2e9['attrRefresh']||(_0x1eb2e9[_0x54ac('0x3c')]&&_0x1eb2e9[_0x54ac('0x3c')][0x1]?_0x1eb2e9[_0x54ac('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x437893){logger[_0x54ac('0x27')](_0x54ac('0x53'),JSON[_0x54ac('0x54')](_0x437893));return[];}}exports['create']=function(_0x2a647f,_0x19709e){if(_0x2a647f['body']){_0x2a647f['body'][_0x54ac('0x3c')]=widgetAttributes(_0x2a647f['body']);}return db[_0x54ac('0x2e')][_0x54ac('0x55')](_0x2a647f[_0x54ac('0x56')],{})[_0x54ac('0x25')](respondWithResult(_0x19709e,0xc9))[_0x54ac('0x39')](handleError(_0x19709e,null));};exports[_0x54ac('0x23')]=function(_0x4a1987,_0x520a34){if(_0x4a1987[_0x54ac('0x56')]['id']){delete _0x4a1987['body']['id'];}_0x4a1987[_0x54ac('0x56')][_0x54ac('0x3c')]=widgetAttributes(_0x4a1987['body']);return db[_0x54ac('0x2e')]['find']({'where':{'id':_0x4a1987[_0x54ac('0x2c')]['id']}})[_0x54ac('0x25')](handleEntityNotFound(_0x520a34,null))[_0x54ac('0x25')](saveUpdates(_0x4a1987[_0x54ac('0x56')],null))[_0x54ac('0x25')](respondWithResult(_0x520a34,null))[_0x54ac('0x39')](handleError(_0x520a34,null));}; \ No newline at end of file +var _0xa243=['sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','DashboardItem','find','catch','iframe','attrUrl','attrs','https://','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x5ee800,_0x2c551f){var _0x386ba6=function(_0x304227){while(--_0x304227){_0x5ee800['push'](_0x5ee800['shift']());}};_0x386ba6(++_0x2c551f);}(_0xa243,0x19d));var _0x3a24=function(_0x48a057,_0x497e13){_0x48a057=_0x48a057-0x0;var _0x1a5c74=_0xa243[_0x48a057];return _0x1a5c74;};'use strict';var emlformat=require(_0x3a24('0x0'));var rimraf=require(_0x3a24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a24('0x2'));var rp=require(_0x3a24('0x3'));var moment=require('moment');var BPromise=require(_0x3a24('0x4'));var Mustache=require(_0x3a24('0x5'));var util=require('util');var path=require(_0x3a24('0x6'));var sox=require('sox');var csv=require(_0x3a24('0x7'));var ejs=require(_0x3a24('0x8'));var fs=require('fs');var fs_extra=require(_0x3a24('0x9'));var _=require('lodash');var squel=require(_0x3a24('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a24('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3a24('0xc'));var Papa=require(_0x3a24('0xd'));var Redis=require('ioredis');var authService=require(_0x3a24('0xe'));var qs=require(_0x3a24('0xf'));var as=require(_0x3a24('0x10'));var hardwareService=require(_0x3a24('0x11'));var logger=require(_0x3a24('0x12'))(_0x3a24('0x13'));var utils=require(_0x3a24('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a24('0x15'))['db'];config[_0x3a24('0x16')]=_[_0x3a24('0x17')](config[_0x3a24('0x16')],{'host':_0x3a24('0x18'),'port':0x18eb});var socket=require(_0x3a24('0x19'))(new Redis(config[_0x3a24('0x16')]));require('./dashboardItem.socket')[_0x3a24('0x1a')](socket);function respondWithStatusCode(_0x35a279,_0xfeaaa4){_0xfeaaa4=_0xfeaaa4||0xcc;return function(_0x3410f0){if(_0x3410f0){return _0x35a279[_0x3a24('0x1b')](_0xfeaaa4);}return _0x35a279['status'](_0xfeaaa4)[_0x3a24('0x1c')]();};}function respondWithResult(_0x1875e0,_0x3222c6){_0x3222c6=_0x3222c6||0xc8;return function(_0xd3c583){if(_0xd3c583){return _0x1875e0[_0x3a24('0x1d')](_0x3222c6)[_0x3a24('0x1e')](_0xd3c583);}};}function respondWithFilteredResult(_0x12557c,_0x2d40a9){return function(_0x1015ba){if(_0x1015ba){var _0x2fe169=typeof _0x2d40a9['offset']===_0x3a24('0x1f')&&typeof _0x2d40a9['limit']===_0x3a24('0x1f');var _0xb2da14=_0x1015ba[_0x3a24('0x20')];var _0xed0421=_0x2fe169?0x0:_0x2d40a9[_0x3a24('0x21')];var _0x157d32=_0x2fe169?_0x1015ba[_0x3a24('0x20')]:_0x2d40a9[_0x3a24('0x21')]+_0x2d40a9[_0x3a24('0x22')];var _0x3d02a8;if(_0x157d32>=_0xb2da14){_0x157d32=_0xb2da14;_0x3d02a8=0xc8;}else{_0x3d02a8=0xce;}_0x12557c[_0x3a24('0x1d')](_0x3d02a8);return _0x12557c[_0x3a24('0x23')](_0x3a24('0x24'),_0xed0421+'-'+_0x157d32+'/'+_0xb2da14)[_0x3a24('0x1e')](_0x1015ba);}return null;};}function patchUpdates(_0x90bb2a){return function(_0x261ee2){try{jsonpatch[_0x3a24('0x25')](_0x261ee2,_0x90bb2a,!![]);}catch(_0x3b15db){return BPromise[_0x3a24('0x26')](_0x3b15db);}return _0x261ee2[_0x3a24('0x27')]();};}function saveUpdates(_0x390a54,_0x5ac14b){return function(_0x35de7a){if(_0x35de7a){return _0x35de7a['update'](_0x390a54)[_0x3a24('0x28')](function(_0x4e9587){return _0x4e9587;});}return null;};}function removeEntity(_0x3f8d7e,_0x57853b){return function(_0x357861){if(_0x357861){return _0x357861['destroy']()[_0x3a24('0x28')](function(){_0x3f8d7e[_0x3a24('0x1d')](0xcc)[_0x3a24('0x1c')]();});}};}function handleEntityNotFound(_0x4d18aa,_0x20c35a){return function(_0x193f72){if(!_0x193f72){_0x4d18aa['sendStatus'](0x194);}return _0x193f72;};}function handleError(_0x855e7e,_0x26dc86){_0x26dc86=_0x26dc86||0x1f4;return function(_0x29b356){logger[_0x3a24('0x29')](_0x29b356[_0x3a24('0x2a')]);if(_0x29b356[_0x3a24('0x2b')]){delete _0x29b356[_0x3a24('0x2b')];}_0x855e7e[_0x3a24('0x1d')](_0x26dc86)['send'](_0x29b356);};}exports[_0x3a24('0x2c')]=function(_0x1b0f60,_0x378571){var _0x3f481a={'raw':![],'where':{'id':_0x1b0f60[_0x3a24('0x2d')]['id']}},_0x2e40ec={};_0x2e40ec[_0x3a24('0x2e')]=_[_0x3a24('0x2f')](db['DashboardItem'][_0x3a24('0x30')]);_0x2e40ec['query']=_[_0x3a24('0x2f')](_0x1b0f60[_0x3a24('0x31')]);_0x2e40ec[_0x3a24('0x32')]=_[_0x3a24('0x33')](_0x2e40ec[_0x3a24('0x2e')],_0x2e40ec['query']);_0x3f481a[_0x3a24('0x34')]=_[_0x3a24('0x33')](_0x2e40ec[_0x3a24('0x2e')],qs['fields'](_0x1b0f60[_0x3a24('0x31')]['fields']));_0x3f481a[_0x3a24('0x34')]=_0x3f481a[_0x3a24('0x34')][_0x3a24('0x35')]?_0x3f481a[_0x3a24('0x34')]:_0x2e40ec[_0x3a24('0x2e')];if(_0x1b0f60[_0x3a24('0x31')][_0x3a24('0x36')]){_0x3f481a[_0x3a24('0x37')]=[{'all':!![]}];}_0x3f481a=_[_0x3a24('0x38')]({},_0x3f481a,_0x1b0f60[_0x3a24('0x39')]);return db[_0x3a24('0x3a')][_0x3a24('0x3b')](_0x3f481a)[_0x3a24('0x28')](handleEntityNotFound(_0x378571,null))['then'](respondWithResult(_0x378571,null))[_0x3a24('0x3c')](handleError(_0x378571,null));};exports['destroy']=function(_0xe162e8,_0x4d14b2){return db['DashboardItem']['find']({'where':{'id':_0xe162e8[_0x3a24('0x2d')]['id']}})[_0x3a24('0x28')](handleEntityNotFound(_0x4d14b2,null))[_0x3a24('0x28')](removeEntity(_0x4d14b2,null))[_0x3a24('0x3c')](handleError(_0x4d14b2,null));};function widgetAttributes(_0x1f3bcc){try{switch(_0x1f3bcc['type']){case _0x3a24('0x3d'):return[{'name':_0x3a24('0x3e'),'value':_0x1f3bcc[_0x3a24('0x3e')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||_0x3a24('0x40')}];case'custom':return[{'name':_0x3a24('0x41'),'value':_0x1f3bcc[_0x3a24('0x41')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0][_0x3a24('0x42')]:undefined)||''}];case'clock':return[{'name':_0x3a24('0x43'),'value':_0x1f3bcc[_0x3a24('0x43')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0][_0x3a24('0x42')]:undefined)||_0x3a24('0x44')},{'name':_0x3a24('0x45'),'value':_0x1f3bcc[_0x3a24('0x45')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc['attrs'][0x1]['value']:undefined)||_0x3a24('0x46')},{'name':_0x3a24('0x47'),'value':_0x1f3bcc['attrFontSize']||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2][_0x3a24('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x3a24('0x48'),'value':_0x1f3bcc[_0x3a24('0x48')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||_0x3a24('0x49')},{'name':'attrVoiceQueues','value':_0x1f3bcc[_0x3a24('0x4a')]||(_0x1f3bcc['attrs']&&_0x1f3bcc['attrs'][0x1]?_0x1f3bcc[_0x3a24('0x3f')][0x1]['value']:undefined)||[]},{'name':_0x3a24('0x47'),'value':_0x1f3bcc[_0x3a24('0x47')]||(_0x1f3bcc['attrs']&&_0x1f3bcc['attrs'][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2]['value']:undefined)||0x14}];case _0x3a24('0x4b'):case _0x3a24('0x4c'):return[{'name':_0x3a24('0x4d'),'value':_0x1f3bcc[_0x3a24('0x4d')]||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc['attrs'][0x0]['value']:undefined)||_0x3a24('0x49')},{'name':'attrSerie2','value':_0x1f3bcc[_0x3a24('0x4e')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc[_0x3a24('0x3f')][0x1][_0x3a24('0x42')]:undefined)||null},{'name':_0x3a24('0x4f'),'value':_0x1f3bcc['attrSerie3']||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2]['value']:undefined)||null},{'name':_0x3a24('0x4a'),'value':_0x1f3bcc[_0x3a24('0x4a')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x3]?_0x1f3bcc[_0x3a24('0x3f')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x1f3bcc[_0x3a24('0x50')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc['attrs'][0x0]?_0x1f3bcc['attrs'][0x0][_0x3a24('0x51')]:undefined)||null,'value':_0x1f3bcc['attrReport']||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||null},{'name':_0x3a24('0x52'),'value':_0x1f3bcc[_0x3a24('0x52')]||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3270cc){logger[_0x3a24('0x29')](_0x3a24('0x53'),JSON[_0x3a24('0x54')](_0x3270cc));return[];}}exports['create']=function(_0x149c74,_0x1fadae){if(_0x149c74[_0x3a24('0x55')]){_0x149c74[_0x3a24('0x55')]['attrs']=widgetAttributes(_0x149c74[_0x3a24('0x55')]);}return db['DashboardItem'][_0x3a24('0x56')](_0x149c74[_0x3a24('0x55')],{})[_0x3a24('0x28')](respondWithResult(_0x1fadae,0xc9))['catch'](handleError(_0x1fadae,null));};exports[_0x3a24('0x57')]=function(_0x40000f,_0x11d5a7){if(_0x40000f['body']['id']){delete _0x40000f[_0x3a24('0x55')]['id'];}_0x40000f['body'][_0x3a24('0x3f')]=widgetAttributes(_0x40000f[_0x3a24('0x55')]);return db['DashboardItem']['find']({'where':{'id':_0x40000f[_0x3a24('0x2d')]['id']}})[_0x3a24('0x28')](handleEntityNotFound(_0x11d5a7,null))[_0x3a24('0x28')](saveUpdates(_0x40000f['body'],null))['then'](respondWithResult(_0x11d5a7,null))[_0x3a24('0x3c')](handleError(_0x11d5a7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f3ecdd4..2af9573 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 _0x531a=['exports','events','DashboardItem','setMaxListeners','save','update','emit','hook'];(function(_0x8079e,_0x550d94){var _0x582fd3=function(_0xf21ebc){while(--_0xf21ebc){_0x8079e['push'](_0x8079e['shift']());}};_0x582fd3(++_0x550d94);}(_0x531a,0x79));var _0xa531=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x531a[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0xa531('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xa531('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa531('0x2')](0x0);var events={'afterCreate':_0xa531('0x3'),'afterUpdate':_0xa531('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5144c8){return function(_0x3807b8,_0x2f2b7a,_0x34dc3c){DashboardItemEvents[_0xa531('0x5')](_0x5144c8+':'+_0x3807b8['id'],_0x3807b8);DashboardItemEvents['emit'](_0x5144c8,_0x3807b8);_0x34dc3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xa531('0x6')](e,emitEvent(event));}}module[_0xa531('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x9bc8=['save','update','remove','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x456671,_0x5e92e2){var _0x43789d=function(_0x3dc021){while(--_0x3dc021){_0x456671['push'](_0x456671['shift']());}};_0x43789d(++_0x5e92e2);}(_0x9bc8,0xa6));var _0x89bc=function(_0x2d7ffc,_0x17fffe){_0x2d7ffc=_0x2d7ffc-0x0;var _0x106b28=_0x9bc8[_0x2d7ffc];return _0x106b28;};'use strict';var EventEmitter=require(_0x89bc('0x0'));var DashboardItem=require(_0x89bc('0x1'))['db'][_0x89bc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x89bc('0x3')](0x0);var events={'afterCreate':_0x89bc('0x4'),'afterUpdate':_0x89bc('0x5'),'afterDestroy':_0x89bc('0x6')};function emitEvent(_0x1bdd2f){return function(_0x490c9a,_0x5b5f98,_0x5d6caf){DashboardItemEvents[_0x89bc('0x7')](_0x1bdd2f+':'+_0x490c9a['id'],_0x490c9a);DashboardItemEvents[_0x89bc('0x7')](_0x1bdd2f,_0x490c9a);_0x5d6caf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x89bc('0x8')](e,emitEvent(event));}}module[_0x89bc('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0e35079..3ce3315 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 _0x5745=['define','DashboardItem','dashboard_items','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x587071,_0x172c7b){var _0x43cb3d=function(_0x1b0e22){while(--_0x1b0e22){_0x587071['push'](_0x587071['shift']());}};_0x43cb3d(++_0x172c7b);}(_0x5745,0x1bf));var _0x5574=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5745[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x5574('0x0'));var util=require(_0x5574('0x1'));var logger=require(_0x5574('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5574('0x3'));var rp=require(_0x5574('0x4'));var fs=require('fs');var path=require(_0x5574('0x5'));var rimraf=require(_0x5574('0x6'));var config=require(_0x5574('0x7'));var attributes=require(_0x5574('0x8'));module['exports']=function(_0x208cf3,_0x352a74){return _0x208cf3[_0x5574('0x9')](_0x5574('0xa'),attributes,{'tableName':_0x5574('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b19=['../../config/logger','bluebird','rimraf','../../config/environment','define','DashboardItem','dashboard_items','lodash'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x7b19,0x1df));var _0x97b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x97b1('0x0'));var util=require('util');var logger=require(_0x97b1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x97b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97b1('0x3'));var config=require(_0x97b1('0x4'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x277466,_0x27238){return _0x277466[_0x97b1('0x5')](_0x97b1('0x6'),attributes,{'tableName':_0x97b1('0x7'),'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 ffa0bfd..571bf15 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 _0x6808=['message','info','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x10aa0d,_0x499c14){var _0x242ed2=function(_0x4ece6f){while(--_0x4ece6f){_0x10aa0d['push'](_0x10aa0d['shift']());}};_0x242ed2(++_0x499c14);}(_0x6808,0x1a3));var _0x8680=function(_0x2e4675,_0x1f4807){_0x2e4675=_0x2e4675-0x0;var _0x17671e=_0x6808[_0x2e4675];return _0x17671e;};'use strict';var _=require(_0x8680('0x0'));var util=require(_0x8680('0x1'));var moment=require('moment');var BPromise=require(_0x8680('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8680('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8680('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8680('0x5'));var jayson=require(_0x8680('0x6'));var client=jayson[_0x8680('0x7')][_0x8680('0x8')]({'port':0x232a});config[_0x8680('0x9')]=_[_0x8680('0xa')](config[_0x8680('0x9')],{'host':_0x8680('0xb'),'port':0x18eb});var socket=require(_0x8680('0xc'))(new Redis(config[_0x8680('0x9')]));require(_0x8680('0xd'))[_0x8680('0xe')](socket);function respondWithRpcPromise(_0x265f0e,_0x4ce4a5,_0x9c8317){return new BPromise(function(_0x431c05,_0x555f1f){return client[_0x8680('0xf')](_0x265f0e,_0x9c8317)[_0x8680('0x10')](function(_0x13480e){logger['info'](_0x8680('0x11'),_0x4ce4a5,_0x8680('0x12'));logger[_0x8680('0x13')](_0x8680('0x14'),_0x4ce4a5,_0x8680('0x12'),JSON[_0x8680('0x15')](_0x13480e));if(_0x13480e[_0x8680('0x16')]){if(_0x13480e[_0x8680('0x16')]['code']===0x1f4){logger['error'](_0x8680('0x11'),_0x4ce4a5,_0x13480e[_0x8680('0x16')]['message']);return _0x555f1f(_0x13480e[_0x8680('0x16')][_0x8680('0x17')]);}logger['error'](_0x8680('0x11'),_0x4ce4a5,_0x13480e['error'][_0x8680('0x17')]);return _0x431c05(_0x13480e['error']['message']);}else{logger[_0x8680('0x18')]('DashboardItem,\x20%s,\x20%s',_0x4ce4a5,_0x8680('0x12'));_0x431c05(_0x13480e['result'][_0x8680('0x17')]);}})[_0x8680('0x19')](function(_0x611625){logger['error'](_0x8680('0x11'),_0x4ce4a5,_0x611625);_0x555f1f(_0x611625);});});} \ No newline at end of file +var _0x10da=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x115977,_0x14bb0f){var _0x1e1c2b=function(_0x14aa4a){while(--_0x14aa4a){_0x115977['push'](_0x115977['shift']());}};_0x1e1c2b(++_0x14bb0f);}(_0x10da,0x66));var _0xa10d=function(_0x263fa7,_0x364151){_0x263fa7=_0x263fa7-0x0;var _0x4fad10=_0x10da[_0x263fa7];return _0x4fad10;};'use strict';var _=require(_0xa10d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa10d('0x1'));var rs=require(_0xa10d('0x2'));var fs=require('fs');var Redis=require(_0xa10d('0x3'));var db=require(_0xa10d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa10d('0x5'))(_0xa10d('0x6'));var config=require(_0xa10d('0x7'));var jayson=require(_0xa10d('0x8'));var client=jayson[_0xa10d('0x9')][_0xa10d('0xa')]({'port':0x232a});config[_0xa10d('0xb')]=_[_0xa10d('0xc')](config['redis'],{'host':_0xa10d('0xd'),'port':0x18eb});var socket=require(_0xa10d('0xe'))(new Redis(config[_0xa10d('0xb')]));require('./dashboardItem.socket')[_0xa10d('0xf')](socket);function respondWithRpcPromise(_0xb6c120,_0x374a81,_0x1dbb01){return new BPromise(function(_0x283b11,_0x41acbd){return client[_0xa10d('0x10')](_0xb6c120,_0x1dbb01)[_0xa10d('0x11')](function(_0x31f719){logger[_0xa10d('0x12')](_0xa10d('0x13'),_0x374a81,'request\x20sent');logger[_0xa10d('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x374a81,_0xa10d('0x15'),JSON['stringify'](_0x31f719));if(_0x31f719[_0xa10d('0x16')]){if(_0x31f719[_0xa10d('0x16')][_0xa10d('0x17')]===0x1f4){logger[_0xa10d('0x16')](_0xa10d('0x13'),_0x374a81,_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);return _0x41acbd(_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);}logger['error'](_0xa10d('0x13'),_0x374a81,_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);return _0x283b11(_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);}else{logger[_0xa10d('0x12')]('DashboardItem,\x20%s,\x20%s',_0x374a81,_0xa10d('0x15'));_0x283b11(_0x31f719[_0xa10d('0x19')][_0xa10d('0x18')]);}})[_0xa10d('0x1a')](function(_0x5a7705){logger['error'](_0xa10d('0x13'),_0x374a81,_0x5a7705);_0x41acbd(_0x5a7705);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3964524..025b5f8 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 _0xf179=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x8c08a2,_0x2e2248){var _0x1ef942=function(_0x353626){while(--_0x353626){_0x8c08a2['push'](_0x8c08a2['shift']());}};_0x1ef942(++_0x2e2248);}(_0xf179,0x161));var _0x9f17=function(_0x25810f,_0x2c24a5){_0x25810f=_0x25810f-0x0;var _0x583da2=_0xf179[_0x25810f];return _0x583da2;};'use strict';var DashboardItemEvents=require(_0x9f17('0x0'));var events=[_0x9f17('0x1'),_0x9f17('0x2'),_0x9f17('0x3')];function createListener(_0x54ed92,_0x72b0b4){return function(_0x29c872){_0x72b0b4[_0x9f17('0x4')](_0x54ed92,_0x29c872);};}function removeListener(_0x1e1a12,_0x484088){return function(){DashboardItemEvents[_0x9f17('0x5')](_0x1e1a12,_0x484088);};}exports[_0x9f17('0x6')]=function(_0x1361f2){for(var _0x2f8257=0x0,_0x472a12=events['length'];_0x2f8257<_0x472a12;_0x2f8257++){var _0x2e0dd0=events[_0x2f8257];var _0x7eadde=createListener(_0x9f17('0x7')+_0x2e0dd0,_0x1361f2);DashboardItemEvents['on'](_0x2e0dd0,_0x7eadde);}}; \ No newline at end of file +var _0xf8d0=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x1dae40,_0x3193a0){var _0x93c15c=function(_0x12f67d){while(--_0x12f67d){_0x1dae40['push'](_0x1dae40['shift']());}};_0x93c15c(++_0x3193a0);}(_0xf8d0,0xc2));var _0x0f8d=function(_0x1faa5c,_0x4b6ee2){_0x1faa5c=_0x1faa5c-0x0;var _0x5c54fd=_0xf8d0[_0x1faa5c];return _0x5c54fd;};'use strict';var DashboardItemEvents=require(_0x0f8d('0x0'));var events=[_0x0f8d('0x1'),_0x0f8d('0x2'),_0x0f8d('0x3')];function createListener(_0x253b59,_0xd55505){return function(_0x24a9e9){_0xd55505[_0x0f8d('0x4')](_0x253b59,_0x24a9e9);};}function removeListener(_0x34752a,_0x1cc2c7){return function(){DashboardItemEvents[_0x0f8d('0x5')](_0x34752a,_0x1cc2c7);};}exports[_0x0f8d('0x6')]=function(_0x44a93c){for(var _0x4f48b2=0x0,_0x496a47=events['length'];_0x4f48b2<_0x496a47;_0x4f48b2++){var _0x478efa=events[_0x4f48b2];var _0x3a1796=createListener(_0x0f8d('0x7')+_0x478efa,_0x44a93c);DashboardItemEvents['on'](_0x478efa,_0x3a1796);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 620b3b3..d0fc246 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 _0xd197=['./dashboardItem.controller','get','isAuthenticated','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xd197,0x14d));var _0x7d19=function(_0x463341,_0xd2ab83){_0x463341=_0x463341-0x0;var _0x1e9e40=_0xd197[_0x463341];return _0x1e9e40;};'use strict';var multer=require(_0x7d19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7d19('0x1'));var express=require(_0x7d19('0x2'));var router=express[_0x7d19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d19('0x4'));var interaction=require(_0x7d19('0x5'));var config=require(_0x7d19('0x6'));var controller=require(_0x7d19('0x7'));router[_0x7d19('0x8')]('/:id',auth[_0x7d19('0x9')](),controller['show']);router[_0x7d19('0xa')]('/',auth[_0x7d19('0x9')](),controller['create']);router[_0x7d19('0xb')](_0x7d19('0xc'),auth[_0x7d19('0x9')](),controller[_0x7d19('0xd')]);router[_0x7d19('0xe')](_0x7d19('0xc'),auth[_0x7d19('0x9')](),controller[_0x7d19('0xf')]);module[_0x7d19('0x10')]=router; \ No newline at end of file +var _0x7681=['./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x37f2a7,_0x4c881c){var _0x5d6541=function(_0x5ed84a){while(--_0x5ed84a){_0x37f2a7['push'](_0x37f2a7['shift']());}};_0x5d6541(++_0x4c881c);}(_0x7681,0x128));var _0x1768=function(_0xc69bd0,_0x4d1aa3){_0xc69bd0=_0xc69bd0-0x0;var _0x454d11=_0x7681[_0xc69bd0];return _0x454d11;};'use strict';var multer=require(_0x1768('0x0'));var util=require('util');var path=require(_0x1768('0x1'));var timeout=require(_0x1768('0x2'));var express=require(_0x1768('0x3'));var router=express[_0x1768('0x4')]();var fs_extra=require(_0x1768('0x5'));var auth=require(_0x1768('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1768('0x7'));var controller=require(_0x1768('0x8'));router[_0x1768('0x9')]('/:id',auth[_0x1768('0xa')](),controller[_0x1768('0xb')]);router[_0x1768('0xc')]('/',auth['isAuthenticated'](),controller[_0x1768('0xd')]);router[_0x1768('0xe')](_0x1768('0xf'),auth['isAuthenticated'](),controller[_0x1768('0x10')]);router[_0x1768('0x11')](_0x1768('0xf'),auth[_0x1768('0xa')](),controller[_0x1768('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 77f696e..44e08e3 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 _0x7035=['sequelize','STRING','ENUM','first','second','third'];(function(_0x59b04c,_0x10d5e2){var _0x5e1acd=function(_0x14fc63){while(--_0x14fc63){_0x59b04c['push'](_0x59b04c['shift']());}};_0x5e1acd(++_0x10d5e2);}(_0x7035,0x156));var _0x5703=function(_0x204258,_0x32b542){_0x204258=_0x204258-0x0;var _0x46ceaf=_0x7035[_0x204258];return _0x46ceaf;};'use strict';var Sequelize=require(_0x5703('0x0'));module['exports']={'name':{'type':Sequelize[_0x5703('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x5703('0x2')](_0x5703('0x3'),_0x5703('0x4'),_0x5703('0x5')),'allowNull':![],'defaultValue':_0x5703('0x3')},'description':{'type':Sequelize[_0x5703('0x1')]}}; \ No newline at end of file +var _0x6115=['first','sequelize','STRING'];(function(_0x37fff5,_0x2e32a4){var _0x51c788=function(_0x3738bd){while(--_0x3738bd){_0x37fff5['push'](_0x37fff5['shift']());}};_0x51c788(++_0x2e32a4);}(_0x6115,0x13f));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5611('0x0'));module['exports']={'name':{'type':Sequelize[_0x5611('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second','third'),'allowNull':![],'defaultValue':_0x5611('0x2')},'description':{'type':Sequelize[_0x5611('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ae7c582..a2123c2 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 _0xbc5d=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','Disposition','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','find'];(function(_0x17cb62,_0x448fc0){var _0x15ccff=function(_0x751e44){while(--_0x751e44){_0x17cb62['push'](_0x17cb62['shift']());}};_0x15ccff(++_0x448fc0);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x2ea619,_0x357f04){_0x2ea619=_0x2ea619-0x0;var _0x482187=_0xbc5d[_0x2ea619];return _0x482187;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbc5('0x0'));var zipdir=require(_0xdbc5('0x1'));var jsonpatch=require(_0xdbc5('0x2'));var rp=require(_0xdbc5('0x3'));var moment=require(_0xdbc5('0x4'));var BPromise=require(_0xdbc5('0x5'));var Mustache=require(_0xdbc5('0x6'));var util=require(_0xdbc5('0x7'));var path=require(_0xdbc5('0x8'));var sox=require(_0xdbc5('0x9'));var csv=require('to-csv');var ejs=require(_0xdbc5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbc5('0xb'));var squel=require(_0xdbc5('0xc'));var crypto=require(_0xdbc5('0xd'));var jsforce=require(_0xdbc5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdbc5('0xf'));var authService=require(_0xdbc5('0x10'));var qs=require(_0xdbc5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbc5('0x12'));var logger=require(_0xdbc5('0x13'))(_0xdbc5('0x14'));var utils=require('../../config/utils');var config=require(_0xdbc5('0x15'));var licenseUtil=require(_0xdbc5('0x16'));var db=require(_0xdbc5('0x17'))['db'];function respondWithStatusCode(_0x101cc2,_0xee31ad){_0xee31ad=_0xee31ad||0xcc;return function(_0x4cbd22){if(_0x4cbd22){return _0x101cc2[_0xdbc5('0x18')](_0xee31ad);}return _0x101cc2[_0xdbc5('0x19')](_0xee31ad)[_0xdbc5('0x1a')]();};}function respondWithResult(_0x3d273b,_0x1cce30){_0x1cce30=_0x1cce30||0xc8;return function(_0x1ef662){if(_0x1ef662){return _0x3d273b[_0xdbc5('0x19')](_0x1cce30)['json'](_0x1ef662);}};}function respondWithFilteredResult(_0x517f4c,_0x576591){return function(_0x2b3553){if(_0x2b3553){var _0x52285c=typeof _0x576591['offset']===_0xdbc5('0x1b')&&typeof _0x576591[_0xdbc5('0x1c')]===_0xdbc5('0x1b');var _0x142477=_0x2b3553[_0xdbc5('0x1d')];var _0x41a8c4=_0x52285c?0x0:_0x576591['offset'];var _0x4d793d=_0x52285c?_0x2b3553['count']:_0x576591[_0xdbc5('0x1e')]+_0x576591[_0xdbc5('0x1c')];var _0x44e01a;if(_0x4d793d>=_0x142477){_0x4d793d=_0x142477;_0x44e01a=0xc8;}else{_0x44e01a=0xce;}_0x517f4c['status'](_0x44e01a);return _0x517f4c['set'](_0xdbc5('0x1f'),_0x41a8c4+'-'+_0x4d793d+'/'+_0x142477)[_0xdbc5('0x20')](_0x2b3553);}return null;};}function patchUpdates(_0x4758d2){return function(_0x4fbad3){try{jsonpatch[_0xdbc5('0x21')](_0x4fbad3,_0x4758d2,!![]);}catch(_0x80ace){return BPromise[_0xdbc5('0x22')](_0x80ace);}return _0x4fbad3[_0xdbc5('0x23')]();};}function saveUpdates(_0x43fc97,_0x43d1e2){return function(_0xf7ea79){if(_0xf7ea79){return _0xf7ea79[_0xdbc5('0x24')](_0x43fc97)[_0xdbc5('0x25')](function(_0x225d75){return _0x225d75;});}return null;};}function removeEntity(_0xb8b87c,_0x20f611){return function(_0x36a5da){if(_0x36a5da){return _0x36a5da[_0xdbc5('0x26')]()[_0xdbc5('0x25')](function(){var _0x337d5e=_0x36a5da[_0xdbc5('0x27')]({'plain':!![]});var _0x864959='Dispositions';return db[_0xdbc5('0x28')][_0xdbc5('0x26')]({'where':{'type':_0x864959,'resourceId':_0x337d5e['id']}})[_0xdbc5('0x25')](function(){return _0x36a5da;});})[_0xdbc5('0x25')](function(){_0xb8b87c[_0xdbc5('0x19')](0xcc)[_0xdbc5('0x1a')]();});}};}function handleEntityNotFound(_0x4b82e4,_0x5d5d11){return function(_0x2601aa){if(!_0x2601aa){_0x4b82e4[_0xdbc5('0x18')](0x194);}return _0x2601aa;};}function handleError(_0x24d2d5,_0x447cff){_0x447cff=_0x447cff||0x1f4;return function(_0x2940ec){logger['error'](_0x2940ec['stack']);if(_0x2940ec[_0xdbc5('0x29')]){delete _0x2940ec['name'];}_0x24d2d5[_0xdbc5('0x19')](_0x447cff)[_0xdbc5('0x2a')](_0x2940ec);};}exports[_0xdbc5('0x2b')]=function(_0x19a486,_0x2847da){var _0x4262b9={},_0x5c3b5a={},_0x215303={'count':0x0,'rows':[]};var _0x44d1a8=_['map'](db[_0xdbc5('0x2c')][_0xdbc5('0x2d')],function(_0x1a0605){return{'name':_0x1a0605[_0xdbc5('0x2e')],'type':_0x1a0605[_0xdbc5('0x2f')]['key']};});_0x5c3b5a[_0xdbc5('0x30')]=_['map'](_0x44d1a8,'name');_0x5c3b5a['query']=_[_0xdbc5('0x31')](_0x19a486[_0xdbc5('0x32')]);_0x5c3b5a[_0xdbc5('0x33')]=_[_0xdbc5('0x34')](_0x5c3b5a[_0xdbc5('0x30')],_0x5c3b5a[_0xdbc5('0x32')]);_0x4262b9[_0xdbc5('0x35')]=_['intersection'](_0x5c3b5a['model'],qs[_0xdbc5('0x36')](_0x19a486[_0xdbc5('0x32')][_0xdbc5('0x36')]));_0x4262b9[_0xdbc5('0x35')]=_0x4262b9[_0xdbc5('0x35')]['length']?_0x4262b9[_0xdbc5('0x35')]:_0x5c3b5a['model'];if(!_0x19a486[_0xdbc5('0x32')]['hasOwnProperty'](_0xdbc5('0x37'))){_0x4262b9['limit']=qs[_0xdbc5('0x1c')](_0x19a486[_0xdbc5('0x32')]['limit']);_0x4262b9[_0xdbc5('0x1e')]=qs['offset'](_0x19a486['query'][_0xdbc5('0x1e')]);}_0x4262b9[_0xdbc5('0x38')]=qs[_0xdbc5('0x39')](_0x19a486[_0xdbc5('0x32')][_0xdbc5('0x39')]);_0x4262b9[_0xdbc5('0x3a')]=qs[_0xdbc5('0x33')](_[_0xdbc5('0x3b')](_0x19a486[_0xdbc5('0x32')],_0x5c3b5a[_0xdbc5('0x33')]),_0x44d1a8);if(_0x19a486[_0xdbc5('0x32')][_0xdbc5('0x3c')]){_0x4262b9[_0xdbc5('0x3a')]=_[_0xdbc5('0x3d')](_0x4262b9[_0xdbc5('0x3a')],{'$or':_['map'](_0x44d1a8,function(_0x23647c){if(_0x23647c[_0xdbc5('0x2f')]!==_0xdbc5('0x3e')){var _0x6a3794={};_0x6a3794[_0x23647c[_0xdbc5('0x29')]]={'$like':'%'+_0x19a486[_0xdbc5('0x32')]['filter']+'%'};return _0x6a3794;}})});}_0x4262b9=_[_0xdbc5('0x3d')]({},_0x4262b9,_0x19a486['options']);var _0x47b318={'where':_0x4262b9[_0xdbc5('0x3a')]};return db['Disposition']['count'](_0x47b318)[_0xdbc5('0x25')](function(_0x96e832){_0x215303['count']=_0x96e832;if(_0x19a486[_0xdbc5('0x32')][_0xdbc5('0x3f')]){_0x4262b9[_0xdbc5('0x40')]=[{'all':!![]}];}return db[_0xdbc5('0x2c')]['findAll'](_0x4262b9);})['then'](function(_0x1a7155){_0x215303[_0xdbc5('0x41')]=_0x1a7155;return _0x215303;})['then'](respondWithFilteredResult(_0x2847da,_0x4262b9))[_0xdbc5('0x42')](handleError(_0x2847da,null));};exports[_0xdbc5('0x43')]=function(_0x27e299,_0x5799de){var _0x199455={'raw':!![],'where':{'id':_0x27e299[_0xdbc5('0x44')]['id']}},_0x5d9d89={};_0x5d9d89[_0xdbc5('0x30')]=_['keys'](db[_0xdbc5('0x2c')][_0xdbc5('0x2d')]);_0x5d9d89['query']=_['keys'](_0x27e299['query']);_0x5d9d89[_0xdbc5('0x33')]=_[_0xdbc5('0x34')](_0x5d9d89[_0xdbc5('0x30')],_0x5d9d89[_0xdbc5('0x32')]);_0x199455['attributes']=_[_0xdbc5('0x34')](_0x5d9d89[_0xdbc5('0x30')],qs[_0xdbc5('0x36')](_0x27e299[_0xdbc5('0x32')]['fields']));_0x199455['attributes']=_0x199455[_0xdbc5('0x35')]['length']?_0x199455[_0xdbc5('0x35')]:_0x5d9d89[_0xdbc5('0x30')];if(_0x27e299[_0xdbc5('0x32')]['includeAll']){_0x199455[_0xdbc5('0x40')]=[{'all':!![]}];}_0x199455=_['merge']({},_0x199455,_0x27e299[_0xdbc5('0x45')]);return db[_0xdbc5('0x2c')]['find'](_0x199455)[_0xdbc5('0x25')](handleEntityNotFound(_0x5799de,null))['then'](respondWithResult(_0x5799de,null))[_0xdbc5('0x42')](handleError(_0x5799de,null));};exports[_0xdbc5('0x46')]=function(_0x5662be,_0x4eb179){return db[_0xdbc5('0x2c')]['create'](_0x5662be[_0xdbc5('0x47')],{})[_0xdbc5('0x25')](function(_0x3f0c06){var _0x1e237e=_0x5662be[_0xdbc5('0x48')]['get']({'plain':!![]});if(!_0x1e237e)throw new Error(_0xdbc5('0x49'));if(_0x1e237e[_0xdbc5('0x4a')]===_0xdbc5('0x48')){var _0x33741b=_0x3f0c06[_0xdbc5('0x27')]({'plain':!![]});var _0x39562c=_0xdbc5('0x4b');return db[_0xdbc5('0x4c')][_0xdbc5('0x4d')]({'where':{'name':_0x39562c,'userProfileId':_0x1e237e[_0xdbc5('0x4e')]},'raw':!![]})[_0xdbc5('0x25')](function(_0x54f299){if(_0x54f299&&_0x54f299[_0xdbc5('0x4f')]===0x0){return db[_0xdbc5('0x28')][_0xdbc5('0x46')]({'name':_0x33741b[_0xdbc5('0x29')],'resourceId':_0x33741b['id'],'type':_0x54f299[_0xdbc5('0x29')],'sectionId':_0x54f299['id']},{})[_0xdbc5('0x25')](function(){return _0x3f0c06;});}else{return _0x3f0c06;}})[_0xdbc5('0x42')](function(_0x511643){logger[_0xdbc5('0x50')](_0xdbc5('0x51'),_0x511643);throw _0x511643;});}return _0x3f0c06;})[_0xdbc5('0x25')](respondWithResult(_0x4eb179,0xc9))[_0xdbc5('0x42')](handleError(_0x4eb179,null));};exports['update']=function(_0xfac033,_0x549cea){if(_0xfac033[_0xdbc5('0x47')]['id']){delete _0xfac033[_0xdbc5('0x47')]['id'];}return db[_0xdbc5('0x2c')]['find']({'where':{'id':_0xfac033['params']['id']}})[_0xdbc5('0x25')](handleEntityNotFound(_0x549cea,null))[_0xdbc5('0x25')](saveUpdates(_0xfac033['body'],null))[_0xdbc5('0x25')](respondWithResult(_0x549cea,null))[_0xdbc5('0x42')](handleError(_0x549cea,null));};exports[_0xdbc5('0x26')]=function(_0x2fb5dd,_0x2b6422){return db['Disposition'][_0xdbc5('0x4d')]({'where':{'id':_0x2fb5dd['params']['id']}})[_0xdbc5('0x25')](handleEntityNotFound(_0x2b6422,null))[_0xdbc5('0x25')](removeEntity(_0x2b6422,null))['catch'](handleError(_0x2b6422,null));}; \ No newline at end of file +var _0x4044=['model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','stack','name','index','map','Disposition','rawAttributes','fieldName','key'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4044,0xcb));var _0x4404=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4044[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4404('0x0'));var rimraf=require(_0x4404('0x1'));var zipdir=require(_0x4404('0x2'));var jsonpatch=require(_0x4404('0x3'));var rp=require(_0x4404('0x4'));var moment=require(_0x4404('0x5'));var BPromise=require(_0x4404('0x6'));var Mustache=require(_0x4404('0x7'));var util=require(_0x4404('0x8'));var path=require(_0x4404('0x9'));var sox=require(_0x4404('0xa'));var csv=require(_0x4404('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4404('0xc'));var squel=require(_0x4404('0xd'));var crypto=require('crypto');var jsforce=require(_0x4404('0xe'));var deskjs=require(_0x4404('0xf'));var toCsv=require(_0x4404('0xb'));var querystring=require(_0x4404('0x10'));var Papa=require(_0x4404('0x11'));var Redis=require(_0x4404('0x12'));var authService=require(_0x4404('0x13'));var qs=require(_0x4404('0x14'));var as=require(_0x4404('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4404('0x16'))(_0x4404('0x17'));var utils=require(_0x4404('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4404('0x19'));var db=require(_0x4404('0x1a'))['db'];function respondWithStatusCode(_0x2eabcd,_0x8cb16f){_0x8cb16f=_0x8cb16f||0xcc;return function(_0x161ff7){if(_0x161ff7){return _0x2eabcd[_0x4404('0x1b')](_0x8cb16f);}return _0x2eabcd[_0x4404('0x1c')](_0x8cb16f)[_0x4404('0x1d')]();};}function respondWithResult(_0x3ad991,_0x43ee2f){_0x43ee2f=_0x43ee2f||0xc8;return function(_0x376305){if(_0x376305){return _0x3ad991[_0x4404('0x1c')](_0x43ee2f)[_0x4404('0x1e')](_0x376305);}};}function respondWithFilteredResult(_0x31f4dc,_0x3a883b){return function(_0x33b72c){if(_0x33b72c){var _0x5bbe49=typeof _0x3a883b[_0x4404('0x1f')]===_0x4404('0x20')&&typeof _0x3a883b[_0x4404('0x21')]===_0x4404('0x20');var _0x45965f=_0x33b72c[_0x4404('0x22')];var _0x21dea7=_0x5bbe49?0x0:_0x3a883b[_0x4404('0x1f')];var _0x3e46ae=_0x5bbe49?_0x33b72c[_0x4404('0x22')]:_0x3a883b[_0x4404('0x1f')]+_0x3a883b[_0x4404('0x21')];var _0x3cf7ba;if(_0x3e46ae>=_0x45965f){_0x3e46ae=_0x45965f;_0x3cf7ba=0xc8;}else{_0x3cf7ba=0xce;}_0x31f4dc['status'](_0x3cf7ba);return _0x31f4dc['set'](_0x4404('0x23'),_0x21dea7+'-'+_0x3e46ae+'/'+_0x45965f)[_0x4404('0x1e')](_0x33b72c);}return null;};}function patchUpdates(_0x179ad6){return function(_0x2fa6e8){try{jsonpatch[_0x4404('0x24')](_0x2fa6e8,_0x179ad6,!![]);}catch(_0x31778b){return BPromise[_0x4404('0x25')](_0x31778b);}return _0x2fa6e8[_0x4404('0x26')]();};}function saveUpdates(_0x4f2736,_0x57c5b4){return function(_0x454973){if(_0x454973){return _0x454973[_0x4404('0x27')](_0x4f2736)[_0x4404('0x28')](function(_0x23f235){return _0x23f235;});}return null;};}function removeEntity(_0x1fb2af,_0x1f74e1){return function(_0x2f99f8){if(_0x2f99f8){return _0x2f99f8[_0x4404('0x29')]()[_0x4404('0x28')](function(){var _0x25731f=_0x2f99f8['get']({'plain':!![]});var _0x33e3db=_0x4404('0x2a');return db[_0x4404('0x2b')][_0x4404('0x29')]({'where':{'type':_0x33e3db,'resourceId':_0x25731f['id']}})[_0x4404('0x28')](function(){return _0x2f99f8;});})[_0x4404('0x28')](function(){_0x1fb2af['status'](0xcc)[_0x4404('0x1d')]();});}};}function handleEntityNotFound(_0x2001c0,_0x53b79c){return function(_0x5bddb7){if(!_0x5bddb7){_0x2001c0[_0x4404('0x1b')](0x194);}return _0x5bddb7;};}function handleError(_0x46a13e,_0x2de456){_0x2de456=_0x2de456||0x1f4;return function(_0x3983af){logger['error'](_0x3983af[_0x4404('0x2c')]);if(_0x3983af[_0x4404('0x2d')]){delete _0x3983af[_0x4404('0x2d')];}_0x46a13e[_0x4404('0x1c')](_0x2de456)['send'](_0x3983af);};}exports[_0x4404('0x2e')]=function(_0x5f1f15,_0x2fd4c9){var _0x20c190={},_0x334aa4={},_0x3ccdc6={'count':0x0,'rows':[]};var _0xb0f44=_[_0x4404('0x2f')](db[_0x4404('0x30')][_0x4404('0x31')],function(_0x25a452){return{'name':_0x25a452[_0x4404('0x32')],'type':_0x25a452['type'][_0x4404('0x33')]};});_0x334aa4[_0x4404('0x34')]=_['map'](_0xb0f44,_0x4404('0x2d'));_0x334aa4[_0x4404('0x35')]=_['keys'](_0x5f1f15[_0x4404('0x35')]);_0x334aa4[_0x4404('0x36')]=_['intersection'](_0x334aa4[_0x4404('0x34')],_0x334aa4[_0x4404('0x35')]);_0x20c190[_0x4404('0x37')]=_[_0x4404('0x38')](_0x334aa4[_0x4404('0x34')],qs[_0x4404('0x39')](_0x5f1f15[_0x4404('0x35')][_0x4404('0x39')]));_0x20c190[_0x4404('0x37')]=_0x20c190[_0x4404('0x37')][_0x4404('0x3a')]?_0x20c190[_0x4404('0x37')]:_0x334aa4['model'];if(!_0x5f1f15[_0x4404('0x35')]['hasOwnProperty'](_0x4404('0x3b'))){_0x20c190['limit']=qs[_0x4404('0x21')](_0x5f1f15[_0x4404('0x35')]['limit']);_0x20c190[_0x4404('0x1f')]=qs['offset'](_0x5f1f15[_0x4404('0x35')][_0x4404('0x1f')]);}_0x20c190[_0x4404('0x3c')]=qs[_0x4404('0x3d')](_0x5f1f15[_0x4404('0x35')]['sort']);_0x20c190[_0x4404('0x3e')]=qs['filters'](_[_0x4404('0x3f')](_0x5f1f15[_0x4404('0x35')],_0x334aa4[_0x4404('0x36')]),_0xb0f44);if(_0x5f1f15[_0x4404('0x35')][_0x4404('0x40')]){_0x20c190[_0x4404('0x3e')]=_[_0x4404('0x41')](_0x20c190[_0x4404('0x3e')],{'$or':_[_0x4404('0x2f')](_0xb0f44,function(_0x366520){if(_0x366520['type']!==_0x4404('0x42')){var _0x30d933={};_0x30d933[_0x366520[_0x4404('0x2d')]]={'$like':'%'+_0x5f1f15[_0x4404('0x35')]['filter']+'%'};return _0x30d933;}})});}_0x20c190=_[_0x4404('0x41')]({},_0x20c190,_0x5f1f15[_0x4404('0x43')]);var _0x180970={'where':_0x20c190[_0x4404('0x3e')]};return db['Disposition'][_0x4404('0x22')](_0x180970)[_0x4404('0x28')](function(_0x3c7b55){_0x3ccdc6[_0x4404('0x22')]=_0x3c7b55;if(_0x5f1f15[_0x4404('0x35')]['includeAll']){_0x20c190[_0x4404('0x44')]=[{'all':!![]}];}return db[_0x4404('0x30')][_0x4404('0x45')](_0x20c190);})[_0x4404('0x28')](function(_0x4d44a0){_0x3ccdc6[_0x4404('0x46')]=_0x4d44a0;return _0x3ccdc6;})['then'](respondWithFilteredResult(_0x2fd4c9,_0x20c190))['catch'](handleError(_0x2fd4c9,null));};exports[_0x4404('0x47')]=function(_0x22d2c2,_0xef872d){var _0x42cb1e={'raw':!![],'where':{'id':_0x22d2c2[_0x4404('0x48')]['id']}},_0x2fcb61={};_0x2fcb61['model']=_[_0x4404('0x49')](db[_0x4404('0x30')][_0x4404('0x31')]);_0x2fcb61[_0x4404('0x35')]=_[_0x4404('0x49')](_0x22d2c2[_0x4404('0x35')]);_0x2fcb61[_0x4404('0x36')]=_[_0x4404('0x38')](_0x2fcb61[_0x4404('0x34')],_0x2fcb61[_0x4404('0x35')]);_0x42cb1e[_0x4404('0x37')]=_['intersection'](_0x2fcb61['model'],qs[_0x4404('0x39')](_0x22d2c2[_0x4404('0x35')][_0x4404('0x39')]));_0x42cb1e[_0x4404('0x37')]=_0x42cb1e[_0x4404('0x37')]['length']?_0x42cb1e['attributes']:_0x2fcb61['model'];if(_0x22d2c2[_0x4404('0x35')]['includeAll']){_0x42cb1e['include']=[{'all':!![]}];}_0x42cb1e=_['merge']({},_0x42cb1e,_0x22d2c2[_0x4404('0x43')]);return db[_0x4404('0x30')][_0x4404('0x4a')](_0x42cb1e)[_0x4404('0x28')](handleEntityNotFound(_0xef872d,null))['then'](respondWithResult(_0xef872d,null))[_0x4404('0x4b')](handleError(_0xef872d,null));};exports[_0x4404('0x4c')]=function(_0x25dbff,_0x334f9c){return db[_0x4404('0x30')][_0x4404('0x4c')](_0x25dbff[_0x4404('0x4d')],{})[_0x4404('0x28')](function(_0x33e487){var _0x53a2cf=_0x25dbff[_0x4404('0x4e')][_0x4404('0x4f')]({'plain':!![]});if(!_0x53a2cf)throw new Error(_0x4404('0x50'));if(_0x53a2cf[_0x4404('0x51')]==='user'){var _0x33ae2b=_0x33e487[_0x4404('0x4f')]({'plain':!![]});var _0x44d82b=_0x4404('0x2a');return db[_0x4404('0x52')]['find']({'where':{'name':_0x44d82b,'userProfileId':_0x53a2cf[_0x4404('0x53')]},'raw':!![]})['then'](function(_0x99956){if(_0x99956&&_0x99956[_0x4404('0x54')]===0x0){return db['UserProfileResource'][_0x4404('0x4c')]({'name':_0x33ae2b[_0x4404('0x2d')],'resourceId':_0x33ae2b['id'],'type':_0x99956[_0x4404('0x2d')],'sectionId':_0x99956['id']},{})[_0x4404('0x28')](function(){return _0x33e487;});}else{return _0x33e487;}})['catch'](function(_0x3da024){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3da024);throw _0x3da024;});}return _0x33e487;})[_0x4404('0x28')](respondWithResult(_0x334f9c,0xc9))[_0x4404('0x4b')](handleError(_0x334f9c,null));};exports[_0x4404('0x27')]=function(_0xd1da79,_0x5d788b){if(_0xd1da79[_0x4404('0x4d')]['id']){delete _0xd1da79[_0x4404('0x4d')]['id'];}return db['Disposition']['find']({'where':{'id':_0xd1da79[_0x4404('0x48')]['id']}})[_0x4404('0x28')](handleEntityNotFound(_0x5d788b,null))[_0x4404('0x28')](saveUpdates(_0xd1da79[_0x4404('0x4d')],null))[_0x4404('0x28')](respondWithResult(_0x5d788b,null))[_0x4404('0x4b')](handleError(_0x5d788b,null));};exports[_0x4404('0x29')]=function(_0x4c9351,_0x2755d4){return db[_0x4404('0x30')][_0x4404('0x4a')]({'where':{'id':_0x4c9351[_0x4404('0x48')]['id']}})[_0x4404('0x28')](handleEntityNotFound(_0x2755d4,null))[_0x4404('0x28')](removeEntity(_0x2755d4,null))[_0x4404('0x4b')](handleError(_0x2755d4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index fe365d2..fa674db 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 _0xc893=['util','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','define','Disposition','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc893,0x1da));var _0x3c89=function(_0x3ee26b,_0x5d73bd){_0x3ee26b=_0x3ee26b-0x0;var _0x4376a3=_0xc893[_0x3ee26b];return _0x4376a3;};'use strict';var _=require(_0x3c89('0x0'));var util=require(_0x3c89('0x1'));var logger=require('../../config/logger')(_0x3c89('0x2'));var moment=require(_0x3c89('0x3'));var BPromise=require(_0x3c89('0x4'));var rp=require(_0x3c89('0x5'));var fs=require('fs');var path=require(_0x3c89('0x6'));var rimraf=require(_0x3c89('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c89('0x8'));module['exports']=function(_0x74109f,_0x27b112){return _0x74109f[_0x3c89('0x9')](_0x3c89('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x3c89('0xb'),'fields':['name',_0x3c89('0xc')]},{'unique':!![],'name':_0x3c89('0xd'),'fields':[_0x3c89('0xe'),_0x3c89('0xf')]},{'unique':!![],'name':_0x3c89('0x10'),'fields':[_0x3c89('0xe'),_0x3c89('0x11')]},{'unique':!![],'name':_0x3c89('0x12'),'fields':['name',_0x3c89('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0x3c89('0xe'),_0x3c89('0x14')]},{'unique':!![],'name':_0x3c89('0x15'),'fields':[_0x3c89('0xe'),_0x3c89('0x16')]},{'unique':!![],'name':_0x3c89('0x17'),'fields':[_0x3c89('0xe'),_0x3c89('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25d3=['moment','rimraf','./disposition.attributes','exports','define','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x25d3,0x1b2));var _0x325d=function(_0x30dfef,_0x334867){_0x30dfef=_0x30dfef-0x0;var _0x3a7d6d=_0x25d3[_0x30dfef];return _0x3a7d6d;};'use strict';var _=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var logger=require(_0x325d('0x2'))('api');var moment=require(_0x325d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x325d('0x4'));var config=require('../../config/environment');var attributes=require(_0x325d('0x5'));module[_0x325d('0x6')]=function(_0x535e88,_0x483d29){return _0x535e88[_0x325d('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x325d('0x8'),'fields':[_0x325d('0x9'),_0x325d('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x325d('0x9'),_0x325d('0xb')]},{'unique':!![],'name':_0x325d('0xc'),'fields':['name',_0x325d('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0x325d('0x9'),'SmsAccountId']},{'unique':!![],'name':_0x325d('0xe'),'fields':[_0x325d('0x9'),_0x325d('0xf')]},{'unique':!![],'name':_0x325d('0x10'),'fields':[_0x325d('0x9'),_0x325d('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x325d('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8f11792..c422690 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(_0x40eaa7,_0x3830b3){var _0x2054ee=function(_0x4d58be){while(--_0x4d58be){_0x40eaa7['push'](_0x40eaa7['shift']());}};_0x2054ee(++_0x3830b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x1b83fe,_0xcfc1bc){var _0x4c1722=function(_0x1208be){while(--_0x1208be){_0x1b83fe['push'](_0x1b83fe['shift']());}};_0x4c1722(++_0xcfc1bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 dc81ac8..dc258db 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 _0x2d34=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x2d34,0x136));var _0x42d3=function(_0x110a14,_0x2704c9){_0x110a14=_0x110a14-0x0;var _0x4fb223=_0x2d34[_0x110a14];return _0x4fb223;};'use strict';var multer=require(_0x42d3('0x0'));var util=require(_0x42d3('0x1'));var path=require(_0x42d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x42d3('0x3'));var router=express[_0x42d3('0x4')]();var fs_extra=require(_0x42d3('0x5'));var auth=require(_0x42d3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x42d3('0x7'));var controller=require(_0x42d3('0x8'));router[_0x42d3('0x9')]('/',auth[_0x42d3('0xa')](),controller[_0x42d3('0xb')]);router['get']('/:id',auth[_0x42d3('0xa')](),controller[_0x42d3('0xc')]);router[_0x42d3('0xd')]('/',auth['isAuthenticated'](),controller[_0x42d3('0xe')]);router[_0x42d3('0xf')](_0x42d3('0x10'),auth[_0x42d3('0xa')](),controller[_0x42d3('0x11')]);router[_0x42d3('0x12')](_0x42d3('0x10'),auth['isAuthenticated'](),controller[_0x42d3('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc26e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','update','delete','/:id','destroy','util','path','express','fs-extra','../../components/auth/service'];(function(_0x2f7cd0,_0x547a97){var _0x4dc774=function(_0x573760){while(--_0x573760){_0x2f7cd0['push'](_0x2f7cd0['shift']());}};_0x4dc774(++_0x547a97);}(_0xc26e,0x109));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xec26('0x0'));var path=require(_0xec26('0x1'));var timeout=require('connect-timeout');var express=require(_0xec26('0x2'));var router=express['Router']();var fs_extra=require(_0xec26('0x3'));var auth=require(_0xec26('0x4'));var interaction=require(_0xec26('0x5'));var config=require(_0xec26('0x6'));var controller=require('./disposition.controller');router[_0xec26('0x7')]('/',auth[_0xec26('0x8')](),controller['index']);router[_0xec26('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xec26('0x9')]);router['post']('/',auth[_0xec26('0x8')](),controller[_0xec26('0xa')]);router['put']('/:id',auth[_0xec26('0x8')](),controller[_0xec26('0xb')]);router[_0xec26('0xc')](_0xec26('0xd'),auth[_0xec26('0x8')](),controller[_0xec26('0xe')]);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 2d1cdb4..6bf5972 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 _0x6444=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','SIP','DADHI','TEXT'];(function(_0x2ea1c6,_0x2eea21){var _0xfd90cf=function(_0x5cd98b){while(--_0x5cd98b){_0x2ea1c6['push'](_0x2ea1c6['shift']());}};_0xfd90cf(++_0x2eea21);}(_0x6444,0x97));var _0x4644=function(_0x3363a6,_0x231ca1){_0x3363a6=_0x3363a6-0x0;var _0x2881c9=_0x6444[_0x3363a6];return _0x2881c9;};'use strict';var Sequelize=require(_0x4644('0x0'));module[_0x4644('0x1')]={'name':{'type':Sequelize[_0x4644('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4644('0x2')]},'ecm':{'type':Sequelize[_0x4644('0x3')](_0x4644('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x4644('0x2')],'defaultValue':_0x4644('0x5')},'localstationid':{'type':Sequelize[_0x4644('0x2')],'unique':_0x4644('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0x4644('0x7'),_0x4644('0x8'),_0x4644('0x9'),_0x4644('0xa'),_0x4644('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x4644('0x3')](_0x4644('0xc'),_0x4644('0x7'),_0x4644('0x8'),_0x4644('0x9'),_0x4644('0xa'),_0x4644('0xb')),'defaultValue':_0x4644('0xb')},'modem':{'type':Sequelize[_0x4644('0x2')],'defaultValue':_0x4644('0xd')},'gateway':{'type':Sequelize[_0x4644('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4644('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4644('0x3')](_0x4644('0xe'),'IAX',_0x4644('0xf'),'KHOMP'),'defaultValue':_0x4644('0xe')},'key':{'type':Sequelize[_0x4644('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4644('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4644('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4644('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4644('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4644('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4644('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4644('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x4644('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4644('0x14'),'set':function(_0x92f27a){if(!_0x92f27a)this[_0x4644('0x15')](_0x4644('0x16'),null);this[_0x4644('0x15')](_0x4644('0x17'),_0x92f27a);}}}; \ No newline at end of file +var _0xf7ac=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','yes','localstationid','ENUM','9600','14400','4800','v17,v27,v29','INTEGER','SIP','TEXT'];(function(_0x5246fd,_0x3e0234){var _0x427e84=function(_0x422d56){while(--_0x422d56){_0x5246fd['push'](_0x5246fd['shift']());}};_0x427e84(++_0x3e0234);}(_0xf7ac,0x9d));var _0xcf7a=function(_0x2ca794,_0x3e0030){_0x2ca794=_0x2ca794-0x0;var _0x27b67b=_0xf7ac[_0x2ca794];return _0x27b67b;};'use strict';var Sequelize=require(_0xcf7a('0x0'));module[_0xcf7a('0x1')]={'name':{'type':Sequelize[_0xcf7a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xcf7a('0x3'),'no'),'defaultValue':_0xcf7a('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xcf7a('0x4')},'minrate':{'type':Sequelize[_0xcf7a('0x5')]('2400','4800','7200',_0xcf7a('0x6'),'12000',_0xcf7a('0x7')),'defaultValue':_0xcf7a('0x8')},'maxrate':{'type':Sequelize[_0xcf7a('0x5')]('2400',_0xcf7a('0x8'),'7200',_0xcf7a('0x6'),'12000',_0xcf7a('0x7')),'defaultValue':_0xcf7a('0x7')},'modem':{'type':Sequelize[_0xcf7a('0x2')],'defaultValue':_0xcf7a('0x9')},'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[_0xcf7a('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcf7a('0x5')]('SIP','IAX','DADHI','KHOMP'),'defaultValue':_0xcf7a('0xb')},'key':{'type':Sequelize[_0xcf7a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcf7a('0xc')],'defaultValue':function(){return _0xcf7a('0xd');}},'notificationSound':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':![],'comment':_0xcf7a('0xf'),'set':function(_0x43df0b){if(!_0x43df0b)this[_0xcf7a('0x10')]('mandatoryDispositionPauseId',null);this[_0xcf7a('0x10')]('mandatoryDisposition',_0x43df0b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f1038f8..98ae18a 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 _0xb3f9=['UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','findById','FaxMessage','split','CmList','List','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','Contacts','ListId','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','offset','count','set','json','destroy','get','FaxAccounts'];(function(_0x6105e8,_0x85369c){var _0x36328e=function(_0x517179){while(--_0x517179){_0x6105e8['push'](_0x6105e8['shift']());}};_0x36328e(++_0x85369c);}(_0xb3f9,0x148));var _0x9b3f=function(_0x1aabb3,_0x4ce0a4){_0x1aabb3=_0x1aabb3-0x0;var _0x3e8da9=_0xb3f9[_0x1aabb3];return _0x3e8da9;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b3f('0x2'));var moment=require(_0x9b3f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9b3f('0x4'));var util=require(_0x9b3f('0x5'));var path=require(_0x9b3f('0x6'));var sox=require(_0x9b3f('0x7'));var csv=require(_0x9b3f('0x8'));var ejs=require(_0x9b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x9b3f('0xa'));var _=require(_0x9b3f('0xb'));var squel=require('squel');var crypto=require(_0x9b3f('0xc'));var jsforce=require(_0x9b3f('0xd'));var deskjs=require(_0x9b3f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9b3f('0xf'));var Papa=require(_0x9b3f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9b3f('0x11'));var as=require(_0x9b3f('0x12'));var hardwareService=require(_0x9b3f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9b3f('0x14'));var config=require(_0x9b3f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b3f('0x16'))['db'];config['redis']=_[_0x9b3f('0x17')](config[_0x9b3f('0x18')],{'host':_0x9b3f('0x19'),'port':0x18eb});var socket=require(_0x9b3f('0x1a'))(new Redis(config[_0x9b3f('0x18')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x9b3f('0x1b'));var client=jayson[_0x9b3f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x9b3f('0x1c')][_0x9b3f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1af23c,_0x576dcb,_0x38a299,_0x5337ab){return new BPromise(function(_0x225ebd,_0x350e59){var _0x2f00b5=_0x5337ab||client;return _0x2f00b5['request'](_0x1af23c,_0x38a299)[_0x9b3f('0x1e')](function(_0x16f499){logger[_0x9b3f('0x1f')](_0x9b3f('0x20'),_0x576dcb,_0x9b3f('0x21'));logger['debug'](_0x9b3f('0x22'),_0x576dcb,_0x9b3f('0x21'),JSON['stringify'](_0x16f499));if(_0x16f499[_0x9b3f('0x23')]){if(_0x16f499[_0x9b3f('0x23')][_0x9b3f('0x24')]===0x1f4){logger[_0x9b3f('0x23')]('FaxAccount,\x20%s,\x20%s',_0x576dcb,_0x16f499[_0x9b3f('0x23')][_0x9b3f('0x25')]);return _0x350e59(_0x16f499[_0x9b3f('0x23')]['message']);}logger[_0x9b3f('0x23')]('FaxAccount,\x20%s,\x20%s',_0x576dcb,_0x16f499[_0x9b3f('0x23')][_0x9b3f('0x25')]);return _0x225ebd(_0x16f499[_0x9b3f('0x23')][_0x9b3f('0x25')]);}else{logger[_0x9b3f('0x1f')](_0x9b3f('0x20'),_0x576dcb,_0x9b3f('0x21'));_0x225ebd(_0x16f499[_0x9b3f('0x26')][_0x9b3f('0x25')]);}})['catch'](function(_0xc0926a){logger[_0x9b3f('0x23')](_0x9b3f('0x20'),_0x576dcb,_0xc0926a);_0x350e59(_0xc0926a);});});}function respondWithStatusCode(_0x3f719c,_0x2b887f){_0x2b887f=_0x2b887f||0xcc;return function(_0x3878b7){if(_0x3878b7){return _0x3f719c[_0x9b3f('0x27')](_0x2b887f);}return _0x3f719c[_0x9b3f('0x28')](_0x2b887f)['end']();};}function respondWithResult(_0xc39b49,_0x34e91a){_0x34e91a=_0x34e91a||0xc8;return function(_0x2df63e){if(_0x2df63e){return _0xc39b49[_0x9b3f('0x28')](_0x34e91a)['json'](_0x2df63e);}};}function respondWithFilteredResult(_0x4a89d6,_0x4a02f9){return function(_0x422670){if(_0x422670){var _0x44d43c=typeof _0x4a02f9[_0x9b3f('0x29')]==='undefined'&&typeof _0x4a02f9['limit']==='undefined';var _0x5a0839=_0x422670[_0x9b3f('0x2a')];var _0x48f6be=_0x44d43c?0x0:_0x4a02f9[_0x9b3f('0x29')];var _0x305aac=_0x44d43c?_0x422670[_0x9b3f('0x2a')]:_0x4a02f9[_0x9b3f('0x29')]+_0x4a02f9['limit'];var _0x22f102;if(_0x305aac>=_0x5a0839){_0x305aac=_0x5a0839;_0x22f102=0xc8;}else{_0x22f102=0xce;}_0x4a89d6[_0x9b3f('0x28')](_0x22f102);return _0x4a89d6[_0x9b3f('0x2b')]('Content-Range',_0x48f6be+'-'+_0x305aac+'/'+_0x5a0839)[_0x9b3f('0x2c')](_0x422670);}return null;};}function patchUpdates(_0x4ba21e){return function(_0x1a1316){try{jsonpatch['apply'](_0x1a1316,_0x4ba21e,!![]);}catch(_0x46e314){return BPromise['reject'](_0x46e314);}return _0x1a1316['save']();};}function saveUpdates(_0x4e9865,_0x2974b2){return function(_0x2b7315){if(_0x2b7315){return _0x2b7315['update'](_0x4e9865)['then'](function(_0x3249d3){return _0x3249d3;});}return null;};}function removeEntity(_0x1cade9,_0xf6a0c7){return function(_0x9fc4e7){if(_0x9fc4e7){return _0x9fc4e7[_0x9b3f('0x2d')]()['then'](function(){var _0x5f2ef9=_0x9fc4e7[_0x9b3f('0x2e')]({'plain':!![]});var _0x44fd98=_0x9b3f('0x2f');return db[_0x9b3f('0x30')]['destroy']({'where':{'type':_0x44fd98,'resourceId':_0x5f2ef9['id']}})['then'](function(){return _0x9fc4e7;});})[_0x9b3f('0x1e')](function(){_0x1cade9[_0x9b3f('0x28')](0xcc)[_0x9b3f('0x31')]();});}};}function handleEntityNotFound(_0x440ca1,_0x702eb5){return function(_0x28d5f8){if(!_0x28d5f8){_0x440ca1[_0x9b3f('0x27')](0x194);}return _0x28d5f8;};}function handleError(_0x5e2378,_0x5911c9){_0x5911c9=_0x5911c9||0x1f4;return function(_0xa02a7b){logger[_0x9b3f('0x23')](_0xa02a7b[_0x9b3f('0x32')]);if(_0xa02a7b['name']){delete _0xa02a7b[_0x9b3f('0x33')];}_0x5e2378[_0x9b3f('0x28')](_0x5911c9)[_0x9b3f('0x34')](_0xa02a7b);};}exports[_0x9b3f('0x35')]=function(_0x5de8e6,_0x113b2c){var _0x383aa6={'include':[{'model':db[_0x9b3f('0x36')],'as':_0x9b3f('0x37')}]},_0x3cca3d={},_0x2ff342={'count':0x0,'rows':[]};var _0x3fa86c=_['map'](db[_0x9b3f('0x38')][_0x9b3f('0x39')],function(_0x81341){return{'name':_0x81341[_0x9b3f('0x3a')],'type':_0x81341[_0x9b3f('0x3b')][_0x9b3f('0x3c')]};});_0x3cca3d['model']=_[_0x9b3f('0x3d')](_0x3fa86c,_0x9b3f('0x33'));_0x3cca3d[_0x9b3f('0x3e')]=_[_0x9b3f('0x3f')](_0x5de8e6['query']);_0x3cca3d['filters']=_[_0x9b3f('0x40')](_0x3cca3d[_0x9b3f('0x41')],_0x3cca3d[_0x9b3f('0x3e')]);_0x383aa6['attributes']=_[_0x9b3f('0x40')](_0x3cca3d[_0x9b3f('0x41')],qs[_0x9b3f('0x42')](_0x5de8e6[_0x9b3f('0x3e')][_0x9b3f('0x42')]));_0x383aa6[_0x9b3f('0x43')]=_0x383aa6['attributes'][_0x9b3f('0x44')]?_0x383aa6[_0x9b3f('0x43')]:_0x3cca3d['model'];if(!_0x5de8e6['query'][_0x9b3f('0x45')](_0x9b3f('0x46'))){_0x383aa6['limit']=qs[_0x9b3f('0x47')](_0x5de8e6[_0x9b3f('0x3e')][_0x9b3f('0x47')]);_0x383aa6[_0x9b3f('0x29')]=qs[_0x9b3f('0x29')](_0x5de8e6[_0x9b3f('0x3e')]['offset']);}_0x383aa6[_0x9b3f('0x48')]=qs[_0x9b3f('0x49')](_0x5de8e6[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x383aa6[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4b')](_[_0x9b3f('0x4c')](_0x5de8e6[_0x9b3f('0x3e')],_0x3cca3d['filters']),_0x3fa86c);if(_0x5de8e6[_0x9b3f('0x3e')]['filter']){_0x383aa6[_0x9b3f('0x4a')]=_[_0x9b3f('0x4d')](_0x383aa6[_0x9b3f('0x4a')],{'$or':_['map'](_0x3fa86c,function(_0x3aea69){if(_0x3aea69['type']!==_0x9b3f('0x4e')){var _0x2e1dda={};_0x2e1dda[_0x3aea69[_0x9b3f('0x33')]]={'$like':'%'+_0x5de8e6[_0x9b3f('0x3e')][_0x9b3f('0x4f')]+'%'};return _0x2e1dda;}})});}_0x383aa6=_['merge']({},_0x383aa6,_0x5de8e6[_0x9b3f('0x50')]);var _0x15a55e={'where':_0x383aa6['where']};return db[_0x9b3f('0x38')]['count'](_0x15a55e)[_0x9b3f('0x1e')](function(_0x5a02c6){_0x2ff342['count']=_0x5a02c6;if(_0x5de8e6['query'][_0x9b3f('0x51')]){_0x383aa6[_0x9b3f('0x52')]=[{'all':!![]}];}return db[_0x9b3f('0x38')][_0x9b3f('0x53')](_0x383aa6);})[_0x9b3f('0x1e')](function(_0x1818bd){_0x2ff342[_0x9b3f('0x54')]=_0x1818bd;return _0x2ff342;})[_0x9b3f('0x1e')](respondWithFilteredResult(_0x113b2c,_0x383aa6))[_0x9b3f('0x55')](handleError(_0x113b2c,null));};exports[_0x9b3f('0x56')]=function(_0x1f9f3d,_0x34e52f){var _0x42b77e={'raw':![],'where':{'id':_0x1f9f3d[_0x9b3f('0x57')]['id']},'include':[{'model':db[_0x9b3f('0x36')],'as':'mandatoryDispositionPause'}]},_0x3bad2b={};_0x3bad2b[_0x9b3f('0x41')]=_[_0x9b3f('0x3f')](db[_0x9b3f('0x38')][_0x9b3f('0x39')]);_0x3bad2b['query']=_[_0x9b3f('0x3f')](_0x1f9f3d[_0x9b3f('0x3e')]);_0x3bad2b[_0x9b3f('0x4b')]=_['intersection'](_0x3bad2b[_0x9b3f('0x41')],_0x3bad2b[_0x9b3f('0x3e')]);_0x42b77e['attributes']=_[_0x9b3f('0x40')](_0x3bad2b[_0x9b3f('0x41')],qs[_0x9b3f('0x42')](_0x1f9f3d[_0x9b3f('0x3e')][_0x9b3f('0x42')]));_0x42b77e[_0x9b3f('0x43')]=_0x42b77e['attributes']['length']?_0x42b77e[_0x9b3f('0x43')]:_0x3bad2b[_0x9b3f('0x41')];if(_0x1f9f3d[_0x9b3f('0x3e')]['includeAll']){_0x42b77e[_0x9b3f('0x52')]=[{'all':!![]}];}_0x42b77e=_[_0x9b3f('0x4d')]({},_0x42b77e,_0x1f9f3d[_0x9b3f('0x50')]);return db[_0x9b3f('0x38')][_0x9b3f('0x58')](_0x42b77e)['then'](handleEntityNotFound(_0x34e52f,null))[_0x9b3f('0x1e')](respondWithResult(_0x34e52f,null))[_0x9b3f('0x55')](handleError(_0x34e52f,null));};exports[_0x9b3f('0x59')]=function(_0x195ce7,_0x26d34a){return db['FaxAccount'][_0x9b3f('0x59')](_0x195ce7['body'],{})['then'](function(_0x2d1fd4){var _0x1b53c4=_0x195ce7['user'][_0x9b3f('0x2e')]({'plain':!![]});if(!_0x1b53c4)throw new Error(_0x9b3f('0x5a'));if(_0x1b53c4['role']===_0x9b3f('0x5b')){var _0x4fd820=_0x2d1fd4['get']({'plain':!![]});var _0x48bbbe=_0x9b3f('0x2f');return db[_0x9b3f('0x5c')][_0x9b3f('0x58')]({'where':{'name':_0x48bbbe,'userProfileId':_0x1b53c4[_0x9b3f('0x5d')]},'raw':!![]})[_0x9b3f('0x1e')](function(_0x467fb6){if(_0x467fb6&&_0x467fb6[_0x9b3f('0x5e')]===0x0){return db[_0x9b3f('0x30')][_0x9b3f('0x59')]({'name':_0x4fd820[_0x9b3f('0x33')],'resourceId':_0x4fd820['id'],'type':_0x467fb6['name'],'sectionId':_0x467fb6['id']},{})[_0x9b3f('0x1e')](function(){return _0x2d1fd4;});}else{return _0x2d1fd4;}})['catch'](function(_0x2a28e0){logger['error'](_0x9b3f('0x5f'),_0x2a28e0);throw _0x2a28e0;});}return _0x2d1fd4;})['then'](respondWithResult(_0x26d34a,0xc9))[_0x9b3f('0x55')](handleError(_0x26d34a,null));};exports['update']=function(_0x15ffce,_0x3212be){if(_0x15ffce[_0x9b3f('0x60')]['id']){delete _0x15ffce[_0x9b3f('0x60')]['id'];}return db['FaxAccount'][_0x9b3f('0x58')]({'where':{'id':_0x15ffce['params']['id']},'include':[{'model':db[_0x9b3f('0x36')],'as':'mandatoryDispositionPause'}]})[_0x9b3f('0x1e')](handleEntityNotFound(_0x3212be,null))[_0x9b3f('0x1e')](saveUpdates(_0x15ffce[_0x9b3f('0x60')],null))['then'](respondWithResult(_0x3212be,null))[_0x9b3f('0x55')](handleError(_0x3212be,null));};exports[_0x9b3f('0x2d')]=function(_0x1bf088,_0x5495c6){return db['FaxAccount'][_0x9b3f('0x58')]({'where':{'id':_0x1bf088[_0x9b3f('0x57')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x5495c6,null))['then'](removeEntity(_0x5495c6,null))[_0x9b3f('0x55')](handleError(_0x5495c6,null));};exports['describe']=function(_0x220d68,_0x180db9){return db[_0x9b3f('0x38')][_0x9b3f('0x61')]()[_0x9b3f('0x1e')](respondWithResult(_0x180db9,null))[_0x9b3f('0x55')](handleError(_0x180db9,null));};exports[_0x9b3f('0x62')]=function(_0xd230fb,_0x2940e7,_0x4fe23b){if(_0xd230fb[_0x9b3f('0x60')]['id']){delete _0xd230fb[_0x9b3f('0x60')]['id'];}return db[_0x9b3f('0x38')]['find']({'where':{'id':_0xd230fb[_0x9b3f('0x57')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x2940e7,null))[_0x9b3f('0x1e')](function(_0x59ba72){if(_0x59ba72){_0xd230fb[_0x9b3f('0x60')][_0x9b3f('0x63')]=_0x59ba72['id'];return db[_0x9b3f('0x64')]['create'](_0xd230fb[_0x9b3f('0x60')]);}})[_0x9b3f('0x1e')](respondWithResult(_0x2940e7,null))[_0x9b3f('0x55')](handleError(_0x2940e7,null));};exports[_0x9b3f('0x65')]=function(_0x4c7ddb,_0x393911,_0x5c0764){var _0x3cc0b3={'raw':![],'where':{}};var _0x4ff1a7={};var _0x38ea7f={'count':0x0,'rows':[]};return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0x4c7ddb['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x393911,null))[_0x9b3f('0x1e')](function(_0x3186e3){if(_0x3186e3){_0x4ff1a7[_0x9b3f('0x41')]=_[_0x9b3f('0x3f')](db['Disposition'][_0x9b3f('0x39')]);_0x4ff1a7['query']=_[_0x9b3f('0x3f')](_0x4c7ddb[_0x9b3f('0x3e')]);_0x4ff1a7[_0x9b3f('0x4b')]=_['intersection'](_0x4ff1a7[_0x9b3f('0x41')],_0x4ff1a7[_0x9b3f('0x3e')]);_0x3cc0b3[_0x9b3f('0x43')]=_['intersection'](_0x4ff1a7[_0x9b3f('0x41')],qs['fields'](_0x4c7ddb['query']['fields']));_0x3cc0b3[_0x9b3f('0x43')]=_0x3cc0b3['attributes'][_0x9b3f('0x44')]?_0x3cc0b3['attributes']:_0x4ff1a7[_0x9b3f('0x41')];if(!_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x45')](_0x9b3f('0x46'))){_0x3cc0b3[_0x9b3f('0x47')]=qs[_0x9b3f('0x47')](_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x47')]);_0x3cc0b3['offset']=qs[_0x9b3f('0x29')](_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x29')]);}_0x3cc0b3['order']=qs['sort'](_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x3cc0b3[_0x9b3f('0x4a')]=qs['filters'](_[_0x9b3f('0x4c')](_0x4c7ddb[_0x9b3f('0x3e')],_0x4ff1a7[_0x9b3f('0x4b')]));_0x3cc0b3[_0x9b3f('0x4a')]['FaxAccountId']=_0x3186e3['id'];if(_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x4f')]){_0x3cc0b3['where']=_[_0x9b3f('0x4d')](_0x3cc0b3[_0x9b3f('0x4a')],{'$or':_[_0x9b3f('0x3d')](_0x3cc0b3[_0x9b3f('0x43')],function(_0x2d44da){var _0x2bb56c={};_0x2bb56c[_0x2d44da]={'$like':'%'+_0x4c7ddb[_0x9b3f('0x3e')]['filter']+'%'};return _0x2bb56c;})});}_0x3cc0b3=_[_0x9b3f('0x4d')]({},_0x3cc0b3,_0x4c7ddb[_0x9b3f('0x50')]);return db[_0x9b3f('0x64')][_0x9b3f('0x2a')]({'where':_0x3cc0b3[_0x9b3f('0x4a')]})['then'](function(_0x313d01){_0x38ea7f[_0x9b3f('0x2a')]=_0x313d01;if(_0x4c7ddb[_0x9b3f('0x3e')][_0x9b3f('0x51')]){_0x3cc0b3[_0x9b3f('0x52')]=[{'all':!![]}];}return db[_0x9b3f('0x64')][_0x9b3f('0x53')](_0x3cc0b3);})[_0x9b3f('0x1e')](function(_0x376d67){_0x38ea7f['rows']=_0x376d67;return _0x38ea7f;});}})['then'](respondWithFilteredResult(_0x393911,_0x3cc0b3))['catch'](handleError(_0x393911,null));};exports[_0x9b3f('0x67')]=function(_0x2abecc,_0x1d4732,_0x4ff537){return db['FaxAccount'][_0x9b3f('0x58')]({'where':{'id':_0x2abecc['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x1d4732,null))[_0x9b3f('0x1e')](function(_0x565d42){if(_0x565d42){return _0x565d42['removeDispositions'](_0x2abecc[_0x9b3f('0x3e')]['ids']);}})[_0x9b3f('0x1e')](respondWithStatusCode(_0x1d4732,null))[_0x9b3f('0x55')](handleError(_0x1d4732,null));};exports['addAnswer']=function(_0x174758,_0x3e1f7d,_0x40ff2b){if(_0x174758[_0x9b3f('0x60')]['id']){delete _0x174758['body']['id'];}return db['FaxAccount'][_0x9b3f('0x58')]({'where':{'id':_0x174758[_0x9b3f('0x57')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x3e1f7d,null))['then'](function(_0x40e0dd){if(_0x40e0dd){_0x174758[_0x9b3f('0x60')][_0x9b3f('0x63')]=_0x40e0dd['id'];return db[_0x9b3f('0x68')][_0x9b3f('0x59')](_0x174758[_0x9b3f('0x60')]);}})[_0x9b3f('0x1e')](respondWithResult(_0x3e1f7d,null))[_0x9b3f('0x55')](handleError(_0x3e1f7d,null));};exports[_0x9b3f('0x69')]=function(_0x561219,_0x314e48,_0x143857){var _0x4dc63f={'raw':![],'where':{}};var _0x5f5c5e={};var _0x570310={'count':0x0,'rows':[]};return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0x561219[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x314e48,null))['then'](function(_0x396109){if(_0x396109){_0x5f5c5e['model']=_[_0x9b3f('0x3f')](db[_0x9b3f('0x68')][_0x9b3f('0x39')]);_0x5f5c5e[_0x9b3f('0x3e')]=_[_0x9b3f('0x3f')](_0x561219[_0x9b3f('0x3e')]);_0x5f5c5e[_0x9b3f('0x4b')]=_[_0x9b3f('0x40')](_0x5f5c5e[_0x9b3f('0x41')],_0x5f5c5e[_0x9b3f('0x3e')]);_0x4dc63f[_0x9b3f('0x43')]=_[_0x9b3f('0x40')](_0x5f5c5e[_0x9b3f('0x41')],qs['fields'](_0x561219[_0x9b3f('0x3e')][_0x9b3f('0x42')]));_0x4dc63f[_0x9b3f('0x43')]=_0x4dc63f[_0x9b3f('0x43')][_0x9b3f('0x44')]?_0x4dc63f[_0x9b3f('0x43')]:_0x5f5c5e[_0x9b3f('0x41')];if(!_0x561219[_0x9b3f('0x3e')][_0x9b3f('0x45')](_0x9b3f('0x46'))){_0x4dc63f[_0x9b3f('0x47')]=qs['limit'](_0x561219[_0x9b3f('0x3e')]['limit']);_0x4dc63f[_0x9b3f('0x29')]=qs[_0x9b3f('0x29')](_0x561219['query'][_0x9b3f('0x29')]);}_0x4dc63f[_0x9b3f('0x48')]=qs[_0x9b3f('0x49')](_0x561219[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x4dc63f[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4b')](_[_0x9b3f('0x4c')](_0x561219['query'],_0x5f5c5e[_0x9b3f('0x4b')]));_0x4dc63f['where']['FaxAccountId']=_0x396109['id'];if(_0x561219[_0x9b3f('0x3e')][_0x9b3f('0x4f')]){_0x4dc63f['where']=_['merge'](_0x4dc63f[_0x9b3f('0x4a')],{'$or':_['map'](_0x4dc63f['attributes'],function(_0x5c5452){var _0x5752bc={};_0x5752bc[_0x5c5452]={'$like':'%'+_0x561219['query'][_0x9b3f('0x4f')]+'%'};return _0x5752bc;})});}_0x4dc63f=_[_0x9b3f('0x4d')]({},_0x4dc63f,_0x561219[_0x9b3f('0x50')]);return db[_0x9b3f('0x68')][_0x9b3f('0x2a')]({'where':_0x4dc63f['where']})[_0x9b3f('0x1e')](function(_0xd1e1d3){_0x570310[_0x9b3f('0x2a')]=_0xd1e1d3;if(_0x561219[_0x9b3f('0x3e')][_0x9b3f('0x51')]){_0x4dc63f[_0x9b3f('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9b3f('0x53')](_0x4dc63f);})[_0x9b3f('0x1e')](function(_0x2967a3){_0x570310[_0x9b3f('0x54')]=_0x2967a3;return _0x570310;});}})[_0x9b3f('0x1e')](respondWithFilteredResult(_0x314e48,_0x4dc63f))[_0x9b3f('0x55')](handleError(_0x314e48,null));};exports[_0x9b3f('0x6a')]=function(_0x109fad,_0x6927b4,_0x3ddc24){return db['FaxAccount'][_0x9b3f('0x58')]({'where':{'id':_0x109fad[_0x9b3f('0x57')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x6927b4,null))[_0x9b3f('0x1e')](function(_0x4f2371){if(_0x4f2371){return _0x4f2371[_0x9b3f('0x6a')](_0x109fad[_0x9b3f('0x3e')][_0x9b3f('0x6b')]);}})[_0x9b3f('0x1e')](respondWithStatusCode(_0x6927b4,null))[_0x9b3f('0x55')](handleError(_0x6927b4,null));};exports['addInteraction']=function(_0x130234,_0xc1ac80,_0x47a5a4){return db[_0x9b3f('0x6c')][_0x9b3f('0x58')]({'where':{'id':_0x130234[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0xc1ac80,null))[_0x9b3f('0x1e')](function(_0x563485){if(_0x563485){return _0x563485[_0x9b3f('0x6d')](_0x130234['body'][_0x9b3f('0x6b')],_['omit'](_0x130234[_0x9b3f('0x60')],['ids','id'])||{});}})[_0x9b3f('0x1e')](respondWithResult(_0xc1ac80,null))[_0x9b3f('0x55')](handleError(_0xc1ac80,null));};exports[_0x9b3f('0x6e')]=function(_0x58f544,_0x70f05f,_0x3bb508){var _0x530e49={'raw':![],'where':{}};var _0x102f34={};var _0xeed4ec={'count':0x0,'rows':[]};return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0x58f544[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x70f05f,null))[_0x9b3f('0x1e')](function(_0x11a55a){if(_0x11a55a){_0x102f34[_0x9b3f('0x41')]=_[_0x9b3f('0x3f')](db[_0x9b3f('0x6c')][_0x9b3f('0x39')]);_0x102f34[_0x9b3f('0x3e')]=_['keys'](_0x58f544[_0x9b3f('0x3e')]);_0x102f34[_0x9b3f('0x4b')]=_[_0x9b3f('0x40')](_0x102f34['model'],_0x102f34['query']);_0x530e49[_0x9b3f('0x43')]=_[_0x9b3f('0x40')](_0x102f34[_0x9b3f('0x41')],qs[_0x9b3f('0x42')](_0x58f544[_0x9b3f('0x3e')]['fields']));_0x530e49[_0x9b3f('0x43')]=_0x530e49['attributes'][_0x9b3f('0x44')]?_0x530e49[_0x9b3f('0x43')]:_0x102f34[_0x9b3f('0x41')];if(!_0x58f544['query'][_0x9b3f('0x45')](_0x9b3f('0x46'))){_0x530e49[_0x9b3f('0x47')]=qs[_0x9b3f('0x47')](_0x58f544[_0x9b3f('0x3e')]['limit']);_0x530e49[_0x9b3f('0x29')]=qs[_0x9b3f('0x29')](_0x58f544[_0x9b3f('0x3e')][_0x9b3f('0x29')]);}_0x530e49['order']=qs[_0x9b3f('0x49')](_0x58f544[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x530e49['where']=qs[_0x9b3f('0x4b')](_[_0x9b3f('0x4c')](_0x58f544[_0x9b3f('0x3e')],_0x102f34[_0x9b3f('0x4b')]));_0x530e49[_0x9b3f('0x4a')][_0x9b3f('0x63')]=_0x11a55a['id'];if(_0x58f544[_0x9b3f('0x3e')]['filter']){_0x530e49[_0x9b3f('0x4a')]=_[_0x9b3f('0x4d')](_0x530e49[_0x9b3f('0x4a')],{'$or':_[_0x9b3f('0x3d')](_0x530e49[_0x9b3f('0x43')],function(_0x5c6fa3){var _0x554313={};_0x554313[_0x5c6fa3]={'$like':'%'+_0x58f544['query'][_0x9b3f('0x4f')]+'%'};return _0x554313;})});}_0x530e49=_[_0x9b3f('0x4d')]({},_0x530e49,_0x58f544['options']);return db[_0x9b3f('0x6c')][_0x9b3f('0x2a')]({'where':_0x530e49[_0x9b3f('0x4a')]})[_0x9b3f('0x1e')](function(_0x1935e1){_0xeed4ec[_0x9b3f('0x2a')]=_0x1935e1;if(_0x58f544['query'][_0x9b3f('0x51')]){_0x530e49[_0x9b3f('0x52')]=[{'model':db[_0x9b3f('0x6f')],'as':_0x9b3f('0x70'),'required':![]},{'model':db[_0x9b3f('0x71')],'as':_0x9b3f('0x72'),'attributes':[_0x9b3f('0x33'),_0x9b3f('0x73'),_0x9b3f('0x74')],'required':![]},{'model':db[_0x9b3f('0x75')],'as':'Tags','attributes':['id',_0x9b3f('0x33'),_0x9b3f('0x76')],'where':_0x58f544['query']['tag']?{'id':_0x58f544['query'][_0x9b3f('0x77')]}:undefined,'required':_0x58f544[_0x9b3f('0x3e')]['tag']?!![]:![]}];}return db[_0x9b3f('0x6c')]['findAll'](_0x530e49);})[_0x9b3f('0x1e')](function(_0xcc0318){_0xeed4ec['rows']=_0xcc0318;return _0xeed4ec;});}})[_0x9b3f('0x1e')](respondWithFilteredResult(_0x70f05f,_0x530e49))[_0x9b3f('0x55')](handleError(_0x70f05f,null));};exports['addApplications']=function(_0x254f79,_0x1809e5,_0x272fb6){return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0x254f79['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x1809e5,null))[_0x9b3f('0x1e')](function(_0x8362ae){if(_0x8362ae){return db['sequelize'][_0x9b3f('0x78')](function(_0x13e409){return db[_0x9b3f('0x79')][_0x9b3f('0x2d')]({'where':{'FaxAccountId':_0x254f79[_0x9b3f('0x57')]['id']},'transaction':_0x13e409})[_0x9b3f('0x1e')](function(_0x254ad2){var _0x11793d=_[_0x9b3f('0x3d')](_0x254f79[_0x9b3f('0x60')],function(_0x37d197){_0x37d197['FaxAccountId']=_0x254f79[_0x9b3f('0x57')]['id'];return _0x37d197;});return db[_0x9b3f('0x79')][_0x9b3f('0x7a')](_0x11793d,{'transaction':_0x13e409});});})[_0x9b3f('0x1e')](function(){return db[_0x9b3f('0x79')][_0x9b3f('0x7b')]({'where':{'FaxAccountId':_0x254f79[_0x9b3f('0x57')]['id']},'order':_0x9b3f('0x7c')});});}})[_0x9b3f('0x1e')](respondWithResult(_0x1809e5,null))[_0x9b3f('0x55')](handleError(_0x1809e5,null));};exports['getApplications']=function(_0x184385,_0xea92fc,_0x20132b){var _0x30b43d={};var _0x26bfd8={};var _0xf41841;var _0x363673;return db['FaxAccount'][_0x9b3f('0x66')]({'where':{'id':_0x184385[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0xea92fc,null))[_0x9b3f('0x1e')](function(_0x13cc9d){if(_0x13cc9d){_0xf41841=_0x13cc9d;_0x26bfd8['model']=_[_0x9b3f('0x3f')](db[_0x9b3f('0x79')]['rawAttributes']);_0x26bfd8[_0x9b3f('0x3e')]=_['keys'](_0x184385[_0x9b3f('0x3e')]);_0x26bfd8[_0x9b3f('0x4b')]=_[_0x9b3f('0x40')](_0x26bfd8[_0x9b3f('0x41')],_0x26bfd8[_0x9b3f('0x3e')]);_0x30b43d[_0x9b3f('0x43')]=_[_0x9b3f('0x40')](_0x26bfd8[_0x9b3f('0x41')],qs[_0x9b3f('0x42')](_0x184385[_0x9b3f('0x3e')][_0x9b3f('0x42')]));_0x30b43d[_0x9b3f('0x43')]=_0x30b43d[_0x9b3f('0x43')][_0x9b3f('0x44')]?_0x30b43d[_0x9b3f('0x43')]:_0x26bfd8[_0x9b3f('0x41')];_0x30b43d[_0x9b3f('0x48')]=qs[_0x9b3f('0x49')](_0x184385[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x30b43d[_0x9b3f('0x4a')]=qs['filters'](_[_0x9b3f('0x4c')](_0x184385[_0x9b3f('0x3e')],_0x26bfd8[_0x9b3f('0x4b')]));if(_0x184385[_0x9b3f('0x3e')][_0x9b3f('0x4f')]){_0x30b43d['where']=_['merge'](_0x30b43d[_0x9b3f('0x4a')],{'$or':_['map'](_0x30b43d[_0x9b3f('0x43')],function(_0x43d652){var _0x28c3fa={};_0x28c3fa[_0x43d652]={'$like':'%'+_0x184385[_0x9b3f('0x3e')]['filter']+'%'};return _0x28c3fa;})});}_0x30b43d=_['merge']({},_0x30b43d,_0x184385[_0x9b3f('0x50')]);return _0xf41841[_0x9b3f('0x7d')](_0x30b43d);}})['then'](function(_0x47ec7d){if(_0x47ec7d){_0x363673=_0x47ec7d[_0x9b3f('0x44')];if(!_0x184385[_0x9b3f('0x3e')][_0x9b3f('0x45')]('nolimit')){_0x30b43d[_0x9b3f('0x47')]=qs[_0x9b3f('0x47')](_0x184385[_0x9b3f('0x3e')]['limit']);_0x30b43d['offset']=qs[_0x9b3f('0x29')](_0x184385[_0x9b3f('0x3e')][_0x9b3f('0x29')]);}return _0xf41841[_0x9b3f('0x7d')](_0x30b43d);}})[_0x9b3f('0x1e')](function(_0x4c8d6b){if(_0x4c8d6b){return _0x4c8d6b?{'count':_0x363673,'rows':_0x4c8d6b}:null;}})['then'](respondWithResult(_0xea92fc,null))['catch'](handleError(_0xea92fc,null));};function Extension(_0xf46ebe,_0x3e4a65,_0x264804,_0x5287b6){this[_0x9b3f('0x7e')]=_0x9b3f('0x7f');this[_0x9b3f('0x80')]=_0xf46ebe[_0x9b3f('0x81')];this[_0x9b3f('0x82')]=_0x5287b6;this[_0x9b3f('0x3b')]='system';this[_0x9b3f('0x83')]='Fax\x20Extension';this[_0x9b3f('0x63')]=_0xf46ebe['id'];this[_0x9b3f('0x7c')]=_0x3e4a65;this['appdata']=_0x264804;}function createExtensionsReciveFax(_0x565f29){var _0x2e8dd4=0x1;var _0x40d029=[];_0x40d029[_0x9b3f('0x84')](new Extension(_0x565f29,_0x2e8dd4,'',_0x9b3f('0x85')));_0x2e8dd4+=0x1;_0x40d029[_0x9b3f('0x84')](new Extension(_0x565f29,_0x2e8dd4,_0x9b3f('0x86'),_0x9b3f('0x87')));_0x2e8dd4+=0x1;for(var _0x4e1c38 in _0x565f29){if(_0x565f29['hasOwnProperty'](_0x4e1c38)&&(_0x4e1c38===_0x9b3f('0x88')||_0x4e1c38==='localstationid'||_0x4e1c38==='gateway'||_0x4e1c38===_0x9b3f('0x89')||_0x4e1c38==='headerinfo'||_0x4e1c38===_0x9b3f('0x8a')||_0x4e1c38===_0x9b3f('0x8b')||_0x4e1c38===_0x9b3f('0x8c')||_0x4e1c38===_0x9b3f('0x8d'))){_0x40d029[_0x9b3f('0x84')](new Extension(_0x565f29,_0x2e8dd4,_0x9b3f('0x8e')+_0x4e1c38+')='+_0x565f29[_0x4e1c38],'Set'));_0x2e8dd4+=0x1;}}_0x40d029[_0x9b3f('0x84')](new Extension(_0x565f29,_0x2e8dd4,'6',_0x9b3f('0x8f')));_0x2e8dd4+=0x1;_0x40d029[_0x9b3f('0x84')](new Extension(_0x565f29,_0x2e8dd4,_0x9b3f('0x90'),_0x9b3f('0x91')));_0x2e8dd4=0x0;return _0x40d029;}exports[_0x9b3f('0x92')]=function(_0x5861b1,_0x53324f,_0x5ee5c9){var _0x191d8b;return db[_0x9b3f('0x93')]['transaction'](function(_0x4b974b){return db['FaxAccount']['create'](_0x5861b1[_0x9b3f('0x60')],{'transaction':_0x4b974b})[_0x9b3f('0x1e')](function(_0x30b077){_0x191d8b=_0x30b077[_0x9b3f('0x2e')]({'plain':!![]});return db[_0x9b3f('0x94')][_0x9b3f('0x7a')](createExtensionsReciveFax(_0x191d8b),{'transaction':_0x4b974b});});})[_0x9b3f('0x1e')](function(){return _0x191d8b;})[_0x9b3f('0x1e')](respondWithResult(_0x53324f,null))['catch'](handleError(_0x53324f,null));};exports[_0x9b3f('0x95')]=function(_0x28398d,_0x2eaa1b,_0x294da0){var _0x5f2099;return db[_0x9b3f('0x93')]['transaction'](function(_0x4b4132){return db['FaxAccount']['update'](_0x28398d[_0x9b3f('0x60')],{'where':{'id':_0x28398d[_0x9b3f('0x60')]['id']},'transaction':_0x4b4132})[_0x9b3f('0x1e')](function(_0xa22def){return db[_0x9b3f('0x94')][_0x9b3f('0x2d')]({'where':{'FaxAccountId':_0x28398d['body']['id']},'transaction':_0x4b4132})['then'](function(_0x188449){return db[_0x9b3f('0x94')]['bulkCreate'](createExtensionsReciveFax(_[_0x9b3f('0x96')](_0x28398d['body'],[_0x9b3f('0x97'),_0x9b3f('0x3c'),_0x9b3f('0x98'),_0x9b3f('0x99'),'TrunkId','ListId'])),{'transaction':_0x4b4132});});});})[_0x9b3f('0x1e')](function(){return db['FaxAccount'][_0x9b3f('0x9a')](_0x28398d[_0x9b3f('0x60')]['id']);})[_0x9b3f('0x1e')](respondWithResult(_0x2eaa1b,null))[_0x9b3f('0x55')](handleError(_0x2eaa1b,null));};exports['getMessages']=function(_0x865e4a,_0x2c1b19,_0x2ee66e){var _0x2e91c0={'raw':!![],'where':{}};var _0x5dbdc8={};var _0x5b4a39={'count':0x0,'rows':[]};return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0x865e4a['params']['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x2c1b19,null))[_0x9b3f('0x1e')](function(_0x467324){if(_0x467324){_0x5dbdc8['model']=_[_0x9b3f('0x3f')](db[_0x9b3f('0x9b')][_0x9b3f('0x39')]);_0x5dbdc8[_0x9b3f('0x3e')]=_['keys'](_0x865e4a['query']);_0x5dbdc8[_0x9b3f('0x4b')]=_[_0x9b3f('0x40')](_0x5dbdc8['model'],_0x5dbdc8[_0x9b3f('0x3e')]);_0x2e91c0[_0x9b3f('0x43')]=_['intersection'](_0x5dbdc8[_0x9b3f('0x41')],qs[_0x9b3f('0x42')](_0x865e4a['query'][_0x9b3f('0x42')]));_0x2e91c0['attributes']=_0x2e91c0[_0x9b3f('0x43')][_0x9b3f('0x44')]?_0x2e91c0[_0x9b3f('0x43')]:_0x5dbdc8[_0x9b3f('0x41')];if(!_0x865e4a[_0x9b3f('0x3e')][_0x9b3f('0x45')]('nolimit')){_0x2e91c0['limit']=qs[_0x9b3f('0x47')](_0x865e4a[_0x9b3f('0x3e')][_0x9b3f('0x47')]);_0x2e91c0[_0x9b3f('0x29')]=qs[_0x9b3f('0x29')](_0x865e4a[_0x9b3f('0x3e')][_0x9b3f('0x29')]);}_0x2e91c0['order']=qs[_0x9b3f('0x49')](_0x865e4a['query'][_0x9b3f('0x49')]);_0x2e91c0[_0x9b3f('0x4a')]=qs[_0x9b3f('0x4b')](_[_0x9b3f('0x4c')](_0x865e4a['query'],_0x5dbdc8[_0x9b3f('0x4b')]));_0x2e91c0[_0x9b3f('0x4a')][_0x9b3f('0x63')]=_0x467324['id'];if(_0x865e4a[_0x9b3f('0x3e')][_0x9b3f('0x4f')]){_0x2e91c0[_0x9b3f('0x4a')]=_['merge'](_0x2e91c0[_0x9b3f('0x4a')],{'$or':_[_0x9b3f('0x3d')](_0x2e91c0['attributes'],function(_0x233e76){var _0x3f74c3={};_0x3f74c3[_0x233e76]={'$like':'%'+_0x865e4a[_0x9b3f('0x3e')][_0x9b3f('0x4f')]+'%'};return _0x3f74c3;})});}if(_0x865e4a[_0x9b3f('0x3e')]['$gte']){var _0x4ecdc8=_0x865e4a[_0x9b3f('0x3e')]['$gte'][_0x9b3f('0x9c')](',');var _0x30adee={};_0x30adee[_0x4ecdc8[0x0]]={'$gte':moment(_0x4ecdc8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2e91c0['where']=_[_0x9b3f('0x4d')](_0x2e91c0[_0x9b3f('0x4a')],_0x30adee);}_0x2e91c0=_[_0x9b3f('0x4d')]({},_0x2e91c0,_0x865e4a['options']);return db[_0x9b3f('0x9b')]['count']({'where':_0x2e91c0['where']})[_0x9b3f('0x1e')](function(_0x4a0e26){_0x5b4a39[_0x9b3f('0x2a')]=_0x4a0e26;if(_0x865e4a['query'][_0x9b3f('0x51')]){_0x2e91c0[_0x9b3f('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2e91c0);})[_0x9b3f('0x1e')](function(_0x1f78bb){_0x5b4a39[_0x9b3f('0x54')]=_0x1f78bb;return _0x5b4a39;});}})[_0x9b3f('0x1e')](respondWithFilteredResult(_0x2c1b19,_0x2e91c0))[_0x9b3f('0x55')](handleError(_0x2c1b19,null));};exports[_0x9b3f('0x34')]=function(_0x48d1b8,_0x2811a2,_0x6144d6){var _0x75f636,_0x12ef6f={},_0x224d2a;if(_0x48d1b8[_0x9b3f('0x60')]['to']){_0x224d2a=_0x48d1b8['body']['to'][0x0];}return db[_0x9b3f('0x38')][_0x9b3f('0x58')]({'where':{'id':_0x48d1b8[_0x9b3f('0x57')]['id']},'include':[{'model':db[_0x9b3f('0x9d')],'as':_0x9b3f('0x9e'),'include':[{'model':db[_0x9b3f('0x6f')],'as':'Contacts','where':{'fax':_0x224d2a},'limit':0x1,'order':[[_0x9b3f('0x99'),_0x9b3f('0x9f')]]}]}]})[_0x9b3f('0x1e')](handleEntityNotFound(_0x2811a2,null))['then'](function(_0x510a99){_0x75f636=_0x510a99;if(_0x48d1b8[_0x9b3f('0x60')]['attachments']&&_0x48d1b8[_0x9b3f('0x60')]['attachments']['length']){for(var _0x5b81db=0x0;_0x5b81db<_0x48d1b8[_0x9b3f('0x60')]['attachments'][_0x9b3f('0x44')];_0x5b81db+=0x1){_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][_0x5b81db]={'filename':_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][_0x5b81db][_0x9b3f('0x33')],'id':_0x48d1b8['body'][_0x9b3f('0xa0')][_0x5b81db]['id'],'path':path[_0x9b3f('0xa1')](config['root'],_0x9b3f('0xa2'),_0x48d1b8[_0x9b3f('0x60')]['attachments'][_0x5b81db][_0x9b3f('0xa3')])};}}return respondWithRpcPromise('CheckAfterSend',_0x9b3f('0xa4'),{'FaxAccountId':_[_0x9b3f('0xa5')](_0x48d1b8['params']['id'])?undefined:_0x48d1b8['params']['id'],'path':_['isNil'](_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][0x0]['path'])?undefined:_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][0x0]['path'],'fax':_['isNil'](_0x48d1b8[_0x9b3f('0x60')]['to'][0x0])?undefined:_0x48d1b8[_0x9b3f('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x75f636){if(_[_0x9b3f('0xa5')](_0x48d1b8['body'][_0x9b3f('0xa6')])){_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa6')]=util[_0x9b3f('0xa7')](_0x9b3f('0xa8'),_0x75f636[_0x9b3f('0x33')],_0x75f636['fax']);}if(_0x75f636[_0x9b3f('0x9e')]){if(_0x75f636[_0x9b3f('0x9e')][_0x9b3f('0xa9')][_0x9b3f('0x44')]){return _0x75f636[_0x9b3f('0x9e')][_0x9b3f('0xa9')][0x0];}else{return db[_0x9b3f('0x6f')][_0x9b3f('0x59')](_['defaults'](_0x48d1b8['body'],{'firstName':_0x48d1b8[_0x9b3f('0x60')]['to'][0x0],'phone':_0x48d1b8['body']['to'][0x0],'fax':_0x48d1b8['body']['to'][0x0],'ListId':_0x75f636[_0x9b3f('0xaa')]}));}}else{throw new Error(_0x9b3f('0xab'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x9b3f('0x1e')](function(_0x1fd2c6){if(_0x1fd2c6){return db[_0x9b3f('0x6c')][_0x9b3f('0x58')]({'where':{'ContactId':_0x1fd2c6['id'],'closed':![],'FaxAccountId':_0x75f636['id']}})['then'](function(_0x3e2592){if(_0x3e2592){return[_0x3e2592,![]];}return db[_0x9b3f('0x6c')][_0x9b3f('0x59')]({'UserId':_0x48d1b8[_0x9b3f('0x5b')]['id'],'ContactId':_0x1fd2c6['id'],'FaxAccountId':_0x75f636['id'],'fax':_0x48d1b8[_0x9b3f('0x60')]['to'][0x0],'firstMsgDirection':_0x9b3f('0xac'),'Messages':[_[_0x9b3f('0x4d')](_0x48d1b8[_0x9b3f('0x60')],{'read':![],'body':_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][0x0][_0x9b3f('0xad')],'FaxAccountId':_0x75f636['id'],'UserId':_0x48d1b8[_0x9b3f('0x5b')]['id'],'ContactId':_0x1fd2c6['id'],'AttachmentId':_0x48d1b8[_0x9b3f('0x60')][_0x9b3f('0xa0')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x9b3f('0x1e')](function(_0x5743ee){return[_0x5743ee,!![]];});});}else{throw new Error(_0x9b3f('0xae'));}})[_0x9b3f('0xaf')](function(_0x4f4f92,_0x140985){if(_0x140985){return _0x4f4f92;}return db[_0x9b3f('0x9b')][_0x9b3f('0x59')]({'direction':_0x9b3f('0xac'),'read':![],'body':_0x48d1b8['body'][_0x9b3f('0xa0')][0x0]['filename'],'FaxAccountId':_0x75f636['id'],'FaxInteractionId':_0x4f4f92['id'],'UserId':_0x48d1b8[_0x9b3f('0x5b')]['id'],'ContactId':_0x4f4f92[_0x9b3f('0xb0')],'AttachmentId':_0x48d1b8['body']['attachments'][0x0]['id']})['then'](function(_0x113bc5){_0x4f4f92[_0x9b3f('0xb1')][_0x9b3f('0xb2')]=[];_0x4f4f92['dataValues'][_0x9b3f('0xb2')][_0x9b3f('0x84')](_0x113bc5[_0x9b3f('0xb1')]);return _0x4f4f92;});})['then'](function(_0x2d8f61){respondWithRpcPromise(_0x9b3f('0xb3'),'SendFax',{'FaxAccountId':_[_0x9b3f('0xa5')](_0x48d1b8['params']['id'])?undefined:_0x48d1b8[_0x9b3f('0x57')]['id'],'path':_['isNil'](_0x48d1b8[_0x9b3f('0x60')]['attachments'][0x0][_0x9b3f('0x6')])?undefined:_0x48d1b8[_0x9b3f('0x60')]['attachments'][0x0][_0x9b3f('0x6')],'fax':_[_0x9b3f('0xa5')](_0x48d1b8[_0x9b3f('0x60')]['to'][0x0])?undefined:_0x48d1b8[_0x9b3f('0x60')]['to'][0x0],'AttachmentId':_0x48d1b8[_0x9b3f('0x60')]['attachments'][0x0]['id']},client9002)['then'](function(_0x13ec7d){logger[_0x9b3f('0x1f')]('SendFaxRpc,\x20%s',_0x13ec7d);})[_0x9b3f('0x55')](function(_0x4f9016){logger[_0x9b3f('0x1f')](_0x9b3f('0xb4'),_0x4f9016);});return _0x2d8f61;})['then'](respondWithResult(_0x2811a2,null))[_0x9b3f('0x55')](handleError(_0x2811a2,null));};exports[_0x9b3f('0xb5')]=function(_0x8362,_0x5a62e1,_0x2c1dc4){return db[_0x9b3f('0x38')][_0x9b3f('0x58')]({'where':{'id':_0x8362[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a62e1,null))[_0x9b3f('0x1e')](function(_0x59a40f){if(_0x59a40f){return _0x59a40f[_0x9b3f('0xb5')](_0x8362[_0x9b3f('0x60')]['ids'],_[_0x9b3f('0x96')](_0x8362[_0x9b3f('0x60')],[_0x9b3f('0x6b'),'id'])||{})[_0x9b3f('0xaf')](function(_0x42e2f4){for(var _0x5d13fa=0x0;_0x5d13fa<_0x8362[_0x9b3f('0x60')][_0x9b3f('0x6b')][_0x9b3f('0x44')];_0x5d13fa+=0x1){socket[_0x9b3f('0xb6')](_0x9b3f('0xb7'),{'UserId':Number(_0x8362[_0x9b3f('0x60')]['ids'][_0x5d13fa]),'FaxAccountId':Number(_0x8362[_0x9b3f('0x57')]['id'])});}return _0x42e2f4;});}})['then'](respondWithResult(_0x5a62e1,null))[_0x9b3f('0x55')](handleError(_0x5a62e1,null));};exports[_0x9b3f('0xb8')]=function(_0x4a7a2a,_0x3f9b2a,_0x21aada){return db[_0x9b3f('0x38')][_0x9b3f('0x58')]({'where':{'id':_0x4a7a2a[_0x9b3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f9b2a,null))[_0x9b3f('0x1e')](function(_0x203e24){if(_0x203e24){return _0x203e24[_0x9b3f('0xb8')](_0x4a7a2a[_0x9b3f('0x3e')][_0x9b3f('0x6b')])['then'](function(){if(_[_0x9b3f('0xb9')](_0x4a7a2a[_0x9b3f('0x3e')][_0x9b3f('0x6b')])){for(var _0x25c7af=0x0;_0x25c7af<_0x4a7a2a[_0x9b3f('0x3e')]['ids'][_0x9b3f('0x44')];_0x25c7af+=0x1){socket[_0x9b3f('0xb6')](_0x9b3f('0xba'),{'UserId':Number(_0x4a7a2a['query']['ids'][_0x25c7af]),'FaxAccountId':Number(_0x4a7a2a[_0x9b3f('0x57')]['id'])});}}else{socket[_0x9b3f('0xb6')](_0x9b3f('0xba'),{'UserId':Number(_0x4a7a2a[_0x9b3f('0x3e')][_0x9b3f('0x6b')]),'FaxAccountId':Number(_0x4a7a2a[_0x9b3f('0x57')]['id'])});}});}})[_0x9b3f('0x1e')](respondWithStatusCode(_0x3f9b2a,null))[_0x9b3f('0x55')](handleError(_0x3f9b2a,null));};exports[_0x9b3f('0xbb')]=function(_0xa3a27,_0x187b6b,_0x57b63e){var _0x23917c={};var _0x54d679={};var _0x16bcc7;var _0x1d7462;return db[_0x9b3f('0x38')][_0x9b3f('0x66')]({'where':{'id':_0xa3a27[_0x9b3f('0x57')]['id']}})[_0x9b3f('0x1e')](handleEntityNotFound(_0x187b6b,null))['then'](function(_0x3ec8c8){if(_0x3ec8c8){_0x16bcc7=_0x3ec8c8;_0x54d679[_0x9b3f('0x41')]=_[_0x9b3f('0x3f')](db[_0x9b3f('0x71')][_0x9b3f('0x39')]);_0x54d679['query']=_['keys'](_0xa3a27[_0x9b3f('0x3e')]);_0x54d679['filters']=_[_0x9b3f('0x40')](_0x54d679[_0x9b3f('0x41')],_0x54d679['query']);_0x23917c['attributes']=_[_0x9b3f('0x40')](_0x54d679[_0x9b3f('0x41')],qs['fields'](_0xa3a27['query'][_0x9b3f('0x42')]));_0x23917c[_0x9b3f('0x43')]=_0x23917c[_0x9b3f('0x43')][_0x9b3f('0x44')]?_0x23917c[_0x9b3f('0x43')]:_0x54d679[_0x9b3f('0x41')];_0x23917c[_0x9b3f('0x48')]=qs[_0x9b3f('0x49')](_0xa3a27[_0x9b3f('0x3e')][_0x9b3f('0x49')]);_0x23917c['where']=qs[_0x9b3f('0x4b')](_['pick'](_0xa3a27[_0x9b3f('0x3e')],_0x54d679[_0x9b3f('0x4b')]));if(_0xa3a27[_0x9b3f('0x3e')][_0x9b3f('0x4f')]){_0x23917c[_0x9b3f('0x4a')]=_['merge'](_0x23917c[_0x9b3f('0x4a')],{'$or':_['map'](_0x23917c['attributes'],function(_0xfc4eb4){var _0x172fb8={};_0x172fb8[_0xfc4eb4]={'$like':'%'+_0xa3a27[_0x9b3f('0x3e')][_0x9b3f('0x4f')]+'%'};return _0x172fb8;})});}_0x23917c=_[_0x9b3f('0x4d')]({},_0x23917c,_0xa3a27[_0x9b3f('0x50')]);return _0x16bcc7[_0x9b3f('0xbb')](_0x23917c);}})['then'](function(_0x3c3005){if(_0x3c3005){_0x1d7462=_0x3c3005[_0x9b3f('0x44')];if(!_0xa3a27[_0x9b3f('0x3e')]['hasOwnProperty']('nolimit')){_0x23917c[_0x9b3f('0x47')]=qs['limit'](_0xa3a27['query'][_0x9b3f('0x47')]);_0x23917c[_0x9b3f('0x29')]=qs[_0x9b3f('0x29')](_0xa3a27['query'][_0x9b3f('0x29')]);}return _0x16bcc7['getAgents'](_0x23917c);}})[_0x9b3f('0x1e')](function(_0x4158cd){if(_0x4158cd){return _0x4158cd?{'count':_0x1d7462,'rows':_0x4158cd}:null;}})['then'](respondWithResult(_0x187b6b,null))[_0x9b3f('0x55')](handleError(_0x187b6b,null));}; \ No newline at end of file +var _0xf42f=['minrate','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','bulkCreate','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','then','stack','name','index','Pause','map','FaxAccount','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','omit','findOne','FaxInteraction','Contact','User','Owner','fullname','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','headerinfo','maxrate'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0xf42f,0x1ab));var _0xff42=function(_0x5cd2ba,_0x32b007){_0x5cd2ba=_0x5cd2ba-0x0;var _0x46bc68=_0xf42f[_0x5cd2ba];return _0x46bc68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff42('0x0'));var zipdir=require(_0xff42('0x1'));var jsonpatch=require(_0xff42('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff42('0x3'));var Mustache=require(_0xff42('0x4'));var util=require(_0xff42('0x5'));var path=require(_0xff42('0x6'));var sox=require(_0xff42('0x7'));var csv=require(_0xff42('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff42('0x9'));var _=require(_0xff42('0xa'));var squel=require(_0xff42('0xb'));var crypto=require(_0xff42('0xc'));var jsforce=require(_0xff42('0xd'));var deskjs=require(_0xff42('0xe'));var toCsv=require(_0xff42('0x8'));var querystring=require(_0xff42('0xf'));var Papa=require('papaparse');var Redis=require(_0xff42('0x10'));var authService=require(_0xff42('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff42('0x13'))(_0xff42('0x14'));var utils=require(_0xff42('0x15'));var config=require(_0xff42('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xff42('0x17'))['db'];config[_0xff42('0x18')]=_[_0xff42('0x19')](config['redis'],{'host':_0xff42('0x1a'),'port':0x18eb});var socket=require(_0xff42('0x1b'))(new Redis(config[_0xff42('0x18')]));require(_0xff42('0x1c'))[_0xff42('0x1d')](socket);var jayson=require(_0xff42('0x1e'));var client=jayson[_0xff42('0x1f')][_0xff42('0x20')]({'port':0x232c});var client9002=jayson[_0xff42('0x1f')][_0xff42('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x56bad2,_0x76bc8a,_0xbb1ebe,_0x5cacab){return new BPromise(function(_0x1c3218,_0x4bd868){var _0x3f16e7=_0x5cacab||client;return _0x3f16e7['request'](_0x56bad2,_0xbb1ebe)['then'](function(_0x5baee7){logger[_0xff42('0x21')](_0xff42('0x22'),_0x76bc8a,_0xff42('0x23'));logger['debug'](_0xff42('0x24'),_0x76bc8a,_0xff42('0x23'),JSON[_0xff42('0x25')](_0x5baee7));if(_0x5baee7[_0xff42('0x26')]){if(_0x5baee7[_0xff42('0x26')][_0xff42('0x27')]===0x1f4){logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x5baee7['error'][_0xff42('0x28')]);return _0x4bd868(_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);}logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);return _0x1c3218(_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);}else{logger[_0xff42('0x21')](_0xff42('0x22'),_0x76bc8a,'request\x20sent');_0x1c3218(_0x5baee7['result'][_0xff42('0x28')]);}})[_0xff42('0x29')](function(_0x58e40e){logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x58e40e);_0x4bd868(_0x58e40e);});});}function respondWithStatusCode(_0x50e8c1,_0x328d72){_0x328d72=_0x328d72||0xcc;return function(_0x41be68){if(_0x41be68){return _0x50e8c1[_0xff42('0x2a')](_0x328d72);}return _0x50e8c1['status'](_0x328d72)[_0xff42('0x2b')]();};}function respondWithResult(_0x19e0c2,_0x4380c4){_0x4380c4=_0x4380c4||0xc8;return function(_0x396efb){if(_0x396efb){return _0x19e0c2[_0xff42('0x2c')](_0x4380c4)[_0xff42('0x2d')](_0x396efb);}};}function respondWithFilteredResult(_0x4f6931,_0x27b162){return function(_0x161234){if(_0x161234){var _0x1d0fa9=typeof _0x27b162['offset']==='undefined'&&typeof _0x27b162[_0xff42('0x2e')]===_0xff42('0x2f');var _0x476f88=_0x161234[_0xff42('0x30')];var _0x1deefb=_0x1d0fa9?0x0:_0x27b162[_0xff42('0x31')];var _0x2a42ee=_0x1d0fa9?_0x161234[_0xff42('0x30')]:_0x27b162[_0xff42('0x31')]+_0x27b162['limit'];var _0x4e0aa6;if(_0x2a42ee>=_0x476f88){_0x2a42ee=_0x476f88;_0x4e0aa6=0xc8;}else{_0x4e0aa6=0xce;}_0x4f6931[_0xff42('0x2c')](_0x4e0aa6);return _0x4f6931[_0xff42('0x32')]('Content-Range',_0x1deefb+'-'+_0x2a42ee+'/'+_0x476f88)['json'](_0x161234);}return null;};}function patchUpdates(_0x552797){return function(_0x47c4c3){try{jsonpatch[_0xff42('0x33')](_0x47c4c3,_0x552797,!![]);}catch(_0x5dd14f){return BPromise[_0xff42('0x34')](_0x5dd14f);}return _0x47c4c3[_0xff42('0x35')]();};}function saveUpdates(_0x5a0832,_0x5b9cbb){return function(_0x19a3b5){if(_0x19a3b5){return _0x19a3b5[_0xff42('0x36')](_0x5a0832)['then'](function(_0x3eda62){return _0x3eda62;});}return null;};}function removeEntity(_0x1a044f,_0x31eea5){return function(_0x114011){if(_0x114011){return _0x114011[_0xff42('0x37')]()['then'](function(){var _0x4494fa=_0x114011[_0xff42('0x38')]({'plain':!![]});var _0x43ed21=_0xff42('0x39');return db[_0xff42('0x3a')][_0xff42('0x37')]({'where':{'type':_0x43ed21,'resourceId':_0x4494fa['id']}})['then'](function(){return _0x114011;});})[_0xff42('0x3b')](function(){_0x1a044f[_0xff42('0x2c')](0xcc)[_0xff42('0x2b')]();});}};}function handleEntityNotFound(_0x27203b,_0x3f6a94){return function(_0x4395f6){if(!_0x4395f6){_0x27203b[_0xff42('0x2a')](0x194);}return _0x4395f6;};}function handleError(_0x1259da,_0x510c4c){_0x510c4c=_0x510c4c||0x1f4;return function(_0x352ae2){logger[_0xff42('0x26')](_0x352ae2[_0xff42('0x3c')]);if(_0x352ae2[_0xff42('0x3d')]){delete _0x352ae2[_0xff42('0x3d')];}_0x1259da[_0xff42('0x2c')](_0x510c4c)['send'](_0x352ae2);};}exports[_0xff42('0x3e')]=function(_0x108d3f,_0x10e90a){var _0x2022c3={'include':[{'model':db[_0xff42('0x3f')],'as':'mandatoryDispositionPause'}]},_0x40e75e={},_0x13fba8={'count':0x0,'rows':[]};var _0x4ff9dc=_[_0xff42('0x40')](db[_0xff42('0x41')]['rawAttributes'],function(_0x585129){return{'name':_0x585129['fieldName'],'type':_0x585129['type'][_0xff42('0x42')]};});_0x40e75e['model']=_['map'](_0x4ff9dc,_0xff42('0x3d'));_0x40e75e[_0xff42('0x43')]=_['keys'](_0x108d3f[_0xff42('0x43')]);_0x40e75e[_0xff42('0x44')]=_[_0xff42('0x45')](_0x40e75e[_0xff42('0x46')],_0x40e75e[_0xff42('0x43')]);_0x2022c3['attributes']=_[_0xff42('0x45')](_0x40e75e[_0xff42('0x46')],qs[_0xff42('0x47')](_0x108d3f[_0xff42('0x43')]['fields']));_0x2022c3[_0xff42('0x48')]=_0x2022c3[_0xff42('0x48')][_0xff42('0x49')]?_0x2022c3['attributes']:_0x40e75e[_0xff42('0x46')];if(!_0x108d3f[_0xff42('0x43')][_0xff42('0x4a')]('nolimit')){_0x2022c3[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x108d3f['query'][_0xff42('0x2e')]);_0x2022c3[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x108d3f[_0xff42('0x43')][_0xff42('0x31')]);}_0x2022c3[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x108d3f[_0xff42('0x43')][_0xff42('0x4c')]);_0x2022c3[_0xff42('0x4d')]=qs[_0xff42('0x44')](_['pick'](_0x108d3f['query'],_0x40e75e[_0xff42('0x44')]),_0x4ff9dc);if(_0x108d3f[_0xff42('0x43')][_0xff42('0x4e')]){_0x2022c3[_0xff42('0x4d')]=_[_0xff42('0x4f')](_0x2022c3['where'],{'$or':_['map'](_0x4ff9dc,function(_0xd3bbeb){if(_0xd3bbeb['type']!==_0xff42('0x50')){var _0x3c8d23={};_0x3c8d23[_0xd3bbeb[_0xff42('0x3d')]]={'$like':'%'+_0x108d3f[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x3c8d23;}})});}_0x2022c3=_[_0xff42('0x4f')]({},_0x2022c3,_0x108d3f['options']);var _0x5bd324={'where':_0x2022c3[_0xff42('0x4d')]};return db[_0xff42('0x41')][_0xff42('0x30')](_0x5bd324)['then'](function(_0x341ec7){_0x13fba8[_0xff42('0x30')]=_0x341ec7;if(_0x108d3f['query']['includeAll']){_0x2022c3[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x41')]['findAll'](_0x2022c3);})[_0xff42('0x3b')](function(_0x492f67){_0x13fba8[_0xff42('0x52')]=_0x492f67;return _0x13fba8;})[_0xff42('0x3b')](respondWithFilteredResult(_0x10e90a,_0x2022c3))[_0xff42('0x29')](handleError(_0x10e90a,null));};exports[_0xff42('0x53')]=function(_0x3a3c10,_0x41bba8){var _0x142300={'raw':![],'where':{'id':_0x3a3c10[_0xff42('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xff42('0x55')}]},_0x1fc2ba={};_0x1fc2ba[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x41')][_0xff42('0x57')]);_0x1fc2ba['query']=_[_0xff42('0x56')](_0x3a3c10['query']);_0x1fc2ba[_0xff42('0x44')]=_[_0xff42('0x45')](_0x1fc2ba[_0xff42('0x46')],_0x1fc2ba['query']);_0x142300['attributes']=_[_0xff42('0x45')](_0x1fc2ba[_0xff42('0x46')],qs[_0xff42('0x47')](_0x3a3c10[_0xff42('0x43')][_0xff42('0x47')]));_0x142300['attributes']=_0x142300[_0xff42('0x48')][_0xff42('0x49')]?_0x142300[_0xff42('0x48')]:_0x1fc2ba[_0xff42('0x46')];if(_0x3a3c10[_0xff42('0x43')][_0xff42('0x58')]){_0x142300[_0xff42('0x51')]=[{'all':!![]}];}_0x142300=_[_0xff42('0x4f')]({},_0x142300,_0x3a3c10[_0xff42('0x59')]);return db[_0xff42('0x41')]['find'](_0x142300)[_0xff42('0x3b')](handleEntityNotFound(_0x41bba8,null))[_0xff42('0x3b')](respondWithResult(_0x41bba8,null))['catch'](handleError(_0x41bba8,null));};exports['create']=function(_0x2b86d2,_0x511e1e){return db[_0xff42('0x41')][_0xff42('0x5a')](_0x2b86d2[_0xff42('0x5b')],{})[_0xff42('0x3b')](function(_0x102c33){var _0x2343a6=_0x2b86d2[_0xff42('0x5c')][_0xff42('0x38')]({'plain':!![]});if(!_0x2343a6)throw new Error(_0xff42('0x5d'));if(_0x2343a6[_0xff42('0x5e')]===_0xff42('0x5c')){var _0x412542=_0x102c33['get']({'plain':!![]});var _0x3e062c=_0xff42('0x39');return db['UserProfileSection'][_0xff42('0x5f')]({'where':{'name':_0x3e062c,'userProfileId':_0x2343a6[_0xff42('0x60')]},'raw':!![]})['then'](function(_0x1f85c8){if(_0x1f85c8&&_0x1f85c8[_0xff42('0x61')]===0x0){return db[_0xff42('0x3a')][_0xff42('0x5a')]({'name':_0x412542[_0xff42('0x3d')],'resourceId':_0x412542['id'],'type':_0x1f85c8[_0xff42('0x3d')],'sectionId':_0x1f85c8['id']},{})[_0xff42('0x3b')](function(){return _0x102c33;});}else{return _0x102c33;}})[_0xff42('0x29')](function(_0x5bf116){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf116);throw _0x5bf116;});}return _0x102c33;})['then'](respondWithResult(_0x511e1e,0xc9))[_0xff42('0x29')](handleError(_0x511e1e,null));};exports[_0xff42('0x36')]=function(_0x20e1c6,_0x20a293){if(_0x20e1c6[_0xff42('0x5b')]['id']){delete _0x20e1c6['body']['id'];}return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x20e1c6[_0xff42('0x54')]['id']},'include':[{'model':db[_0xff42('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xff42('0x3b')](handleEntityNotFound(_0x20a293,null))[_0xff42('0x3b')](saveUpdates(_0x20e1c6['body'],null))[_0xff42('0x3b')](respondWithResult(_0x20a293,null))['catch'](handleError(_0x20a293,null));};exports[_0xff42('0x37')]=function(_0x2f9df3,_0x45b216){return db['FaxAccount']['find']({'where':{'id':_0x2f9df3[_0xff42('0x54')]['id']}})['then'](handleEntityNotFound(_0x45b216,null))[_0xff42('0x3b')](removeEntity(_0x45b216,null))[_0xff42('0x29')](handleError(_0x45b216,null));};exports[_0xff42('0x62')]=function(_0x2c7010,_0x202e09){return db['FaxAccount'][_0xff42('0x62')]()['then'](respondWithResult(_0x202e09,null))[_0xff42('0x29')](handleError(_0x202e09,null));};exports['addDisposition']=function(_0x2cb519,_0x4b7da2,_0x4563ab){if(_0x2cb519[_0xff42('0x5b')]['id']){delete _0x2cb519[_0xff42('0x5b')]['id'];}return db['FaxAccount'][_0xff42('0x5f')]({'where':{'id':_0x2cb519[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x4b7da2,null))[_0xff42('0x3b')](function(_0x116883){if(_0x116883){_0x2cb519[_0xff42('0x5b')][_0xff42('0x63')]=_0x116883['id'];return db[_0xff42('0x64')][_0xff42('0x5a')](_0x2cb519[_0xff42('0x5b')]);}})[_0xff42('0x3b')](respondWithResult(_0x4b7da2,null))[_0xff42('0x29')](handleError(_0x4b7da2,null));};exports[_0xff42('0x65')]=function(_0x1fb53e,_0xc5d25,_0x360a58){var _0x248b95={'raw':![],'where':{}};var _0x7ab4e9={};var _0x47200b={'count':0x0,'rows':[]};return db[_0xff42('0x41')]['findOne']({'where':{'id':_0x1fb53e[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0xc5d25,null))['then'](function(_0x4f4c52){if(_0x4f4c52){_0x7ab4e9[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x64')][_0xff42('0x57')]);_0x7ab4e9[_0xff42('0x43')]=_[_0xff42('0x56')](_0x1fb53e[_0xff42('0x43')]);_0x7ab4e9[_0xff42('0x44')]=_[_0xff42('0x45')](_0x7ab4e9['model'],_0x7ab4e9['query']);_0x248b95[_0xff42('0x48')]=_['intersection'](_0x7ab4e9[_0xff42('0x46')],qs[_0xff42('0x47')](_0x1fb53e[_0xff42('0x43')][_0xff42('0x47')]));_0x248b95['attributes']=_0x248b95[_0xff42('0x48')][_0xff42('0x49')]?_0x248b95[_0xff42('0x48')]:_0x7ab4e9['model'];if(!_0x1fb53e[_0xff42('0x43')][_0xff42('0x4a')]('nolimit')){_0x248b95[_0xff42('0x2e')]=qs['limit'](_0x1fb53e[_0xff42('0x43')]['limit']);_0x248b95['offset']=qs[_0xff42('0x31')](_0x1fb53e['query'][_0xff42('0x31')]);}_0x248b95[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x1fb53e[_0xff42('0x43')][_0xff42('0x4c')]);_0x248b95[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0x1fb53e[_0xff42('0x43')],_0x7ab4e9[_0xff42('0x44')]));_0x248b95[_0xff42('0x4d')][_0xff42('0x63')]=_0x4f4c52['id'];if(_0x1fb53e[_0xff42('0x43')]['filter']){_0x248b95[_0xff42('0x4d')]=_['merge'](_0x248b95[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x248b95[_0xff42('0x48')],function(_0x2e24ff){var _0x4a5226={};_0x4a5226[_0x2e24ff]={'$like':'%'+_0x1fb53e[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4a5226;})});}_0x248b95=_[_0xff42('0x4f')]({},_0x248b95,_0x1fb53e[_0xff42('0x59')]);return db['Disposition'][_0xff42('0x30')]({'where':_0x248b95[_0xff42('0x4d')]})[_0xff42('0x3b')](function(_0x4821e9){_0x47200b['count']=_0x4821e9;if(_0x1fb53e[_0xff42('0x43')]['includeAll']){_0x248b95[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x64')][_0xff42('0x67')](_0x248b95);})[_0xff42('0x3b')](function(_0x48e058){_0x47200b['rows']=_0x48e058;return _0x47200b;});}})[_0xff42('0x3b')](respondWithFilteredResult(_0xc5d25,_0x248b95))[_0xff42('0x29')](handleError(_0xc5d25,null));};exports[_0xff42('0x68')]=function(_0x1e7fb9,_0x43fb73,_0x3d04e7){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x1e7fb9[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x43fb73,null))[_0xff42('0x3b')](function(_0x42769b){if(_0x42769b){return _0x42769b['removeDispositions'](_0x1e7fb9[_0xff42('0x43')][_0xff42('0x69')]);}})[_0xff42('0x3b')](respondWithStatusCode(_0x43fb73,null))[_0xff42('0x29')](handleError(_0x43fb73,null));};exports[_0xff42('0x6a')]=function(_0x1b904,_0x11341e,_0x26278f){if(_0x1b904[_0xff42('0x5b')]['id']){delete _0x1b904[_0xff42('0x5b')]['id'];}return db[_0xff42('0x41')]['find']({'where':{'id':_0x1b904[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x11341e,null))[_0xff42('0x3b')](function(_0x3864d8){if(_0x3864d8){_0x1b904[_0xff42('0x5b')][_0xff42('0x63')]=_0x3864d8['id'];return db[_0xff42('0x6b')][_0xff42('0x5a')](_0x1b904[_0xff42('0x5b')]);}})[_0xff42('0x3b')](respondWithResult(_0x11341e,null))['catch'](handleError(_0x11341e,null));};exports[_0xff42('0x6c')]=function(_0xa1e519,_0x4b74f3,_0x4c9791){var _0x2eacfd={'raw':![],'where':{}};var _0x25a4b5={};var _0x38a6aa={'count':0x0,'rows':[]};return db[_0xff42('0x41')]['findOne']({'where':{'id':_0xa1e519[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x4b74f3,null))[_0xff42('0x3b')](function(_0x4a8f39){if(_0x4a8f39){_0x25a4b5[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x6b')][_0xff42('0x57')]);_0x25a4b5['query']=_['keys'](_0xa1e519[_0xff42('0x43')]);_0x25a4b5[_0xff42('0x44')]=_['intersection'](_0x25a4b5[_0xff42('0x46')],_0x25a4b5[_0xff42('0x43')]);_0x2eacfd['attributes']=_[_0xff42('0x45')](_0x25a4b5['model'],qs[_0xff42('0x47')](_0xa1e519[_0xff42('0x43')]['fields']));_0x2eacfd['attributes']=_0x2eacfd['attributes'][_0xff42('0x49')]?_0x2eacfd['attributes']:_0x25a4b5[_0xff42('0x46')];if(!_0xa1e519[_0xff42('0x43')]['hasOwnProperty'](_0xff42('0x6d'))){_0x2eacfd['limit']=qs[_0xff42('0x2e')](_0xa1e519['query'][_0xff42('0x2e')]);_0x2eacfd['offset']=qs['offset'](_0xa1e519[_0xff42('0x43')]['offset']);}_0x2eacfd[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0xa1e519[_0xff42('0x43')]['sort']);_0x2eacfd[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0xa1e519[_0xff42('0x43')],_0x25a4b5[_0xff42('0x44')]));_0x2eacfd[_0xff42('0x4d')][_0xff42('0x63')]=_0x4a8f39['id'];if(_0xa1e519[_0xff42('0x43')][_0xff42('0x4e')]){_0x2eacfd['where']=_[_0xff42('0x4f')](_0x2eacfd[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x2eacfd['attributes'],function(_0x556d15){var _0x4e1136={};_0x4e1136[_0x556d15]={'$like':'%'+_0xa1e519[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4e1136;})});}_0x2eacfd=_['merge']({},_0x2eacfd,_0xa1e519[_0xff42('0x59')]);return db[_0xff42('0x6b')]['count']({'where':_0x2eacfd[_0xff42('0x4d')]})['then'](function(_0x169980){_0x38a6aa[_0xff42('0x30')]=_0x169980;if(_0xa1e519[_0xff42('0x43')][_0xff42('0x58')]){_0x2eacfd[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x6b')][_0xff42('0x67')](_0x2eacfd);})[_0xff42('0x3b')](function(_0x457344){_0x38a6aa['rows']=_0x457344;return _0x38a6aa;});}})['then'](respondWithFilteredResult(_0x4b74f3,_0x2eacfd))[_0xff42('0x29')](handleError(_0x4b74f3,null));};exports[_0xff42('0x6e')]=function(_0x369efc,_0x2b6232,_0x2f1ee8){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x369efc[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2b6232,null))[_0xff42('0x3b')](function(_0x5ae098){if(_0x5ae098){return _0x5ae098['removeAnswers'](_0x369efc['query']['ids']);}})[_0xff42('0x3b')](respondWithStatusCode(_0x2b6232,null))[_0xff42('0x29')](handleError(_0x2b6232,null));};exports[_0xff42('0x6f')]=function(_0x3c6b47,_0x14b02d,_0x28fa33){return db['FaxInteraction']['find']({'where':{'id':_0x3c6b47[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x14b02d,null))[_0xff42('0x3b')](function(_0x1c5f4d){if(_0x1c5f4d){return _0x1c5f4d[_0xff42('0x6f')](_0x3c6b47['body'][_0xff42('0x69')],_[_0xff42('0x70')](_0x3c6b47[_0xff42('0x5b')],[_0xff42('0x69'),'id'])||{});}})[_0xff42('0x3b')](respondWithResult(_0x14b02d,null))[_0xff42('0x29')](handleError(_0x14b02d,null));};exports['getInteractions']=function(_0x4d7875,_0x25d9b1,_0x54a07d){var _0x1dc0d4={'raw':![],'where':{}};var _0x2d60a4={};var _0x4f4f0d={'count':0x0,'rows':[]};return db[_0xff42('0x41')][_0xff42('0x71')]({'where':{'id':_0x4d7875[_0xff42('0x54')]['id']}})['then'](handleEntityNotFound(_0x25d9b1,null))[_0xff42('0x3b')](function(_0x271e91){if(_0x271e91){_0x2d60a4[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x72')][_0xff42('0x57')]);_0x2d60a4[_0xff42('0x43')]=_['keys'](_0x4d7875[_0xff42('0x43')]);_0x2d60a4[_0xff42('0x44')]=_[_0xff42('0x45')](_0x2d60a4[_0xff42('0x46')],_0x2d60a4['query']);_0x1dc0d4[_0xff42('0x48')]=_[_0xff42('0x45')](_0x2d60a4[_0xff42('0x46')],qs[_0xff42('0x47')](_0x4d7875[_0xff42('0x43')][_0xff42('0x47')]));_0x1dc0d4[_0xff42('0x48')]=_0x1dc0d4[_0xff42('0x48')][_0xff42('0x49')]?_0x1dc0d4[_0xff42('0x48')]:_0x2d60a4[_0xff42('0x46')];if(!_0x4d7875[_0xff42('0x43')][_0xff42('0x4a')](_0xff42('0x6d'))){_0x1dc0d4[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x4d7875[_0xff42('0x43')][_0xff42('0x2e')]);_0x1dc0d4[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x4d7875[_0xff42('0x43')]['offset']);}_0x1dc0d4[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x4d7875['query'][_0xff42('0x4c')]);_0x1dc0d4[_0xff42('0x4d')]=qs['filters'](_[_0xff42('0x66')](_0x4d7875[_0xff42('0x43')],_0x2d60a4['filters']));_0x1dc0d4[_0xff42('0x4d')]['FaxAccountId']=_0x271e91['id'];if(_0x4d7875[_0xff42('0x43')][_0xff42('0x4e')]){_0x1dc0d4[_0xff42('0x4d')]=_['merge'](_0x1dc0d4[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x1dc0d4[_0xff42('0x48')],function(_0x5a1843){var _0x399fba={};_0x399fba[_0x5a1843]={'$like':'%'+_0x4d7875[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x399fba;})});}_0x1dc0d4=_['merge']({},_0x1dc0d4,_0x4d7875['options']);return db[_0xff42('0x72')]['count']({'where':_0x1dc0d4[_0xff42('0x4d')]})[_0xff42('0x3b')](function(_0x2b356c){_0x4f4f0d['count']=_0x2b356c;if(_0x4d7875[_0xff42('0x43')][_0xff42('0x58')]){_0x1dc0d4[_0xff42('0x51')]=[{'model':db['CmContact'],'as':_0xff42('0x73'),'required':![]},{'model':db[_0xff42('0x74')],'as':_0xff42('0x75'),'attributes':['name',_0xff42('0x76'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xff42('0x3d'),_0xff42('0x77')],'where':_0x4d7875['query']['tag']?{'id':_0x4d7875[_0xff42('0x43')][_0xff42('0x78')]}:undefined,'required':_0x4d7875['query'][_0xff42('0x78')]?!![]:![]}];}return db[_0xff42('0x72')][_0xff42('0x67')](_0x1dc0d4);})[_0xff42('0x3b')](function(_0x3409f2){_0x4f4f0d['rows']=_0x3409f2;return _0x4f4f0d;});}})[_0xff42('0x3b')](respondWithFilteredResult(_0x25d9b1,_0x1dc0d4))['catch'](handleError(_0x25d9b1,null));};exports['addApplications']=function(_0x34e2d9,_0x2dccef,_0x3925c1){return db['FaxAccount']['findOne']({'where':{'id':_0x34e2d9['params']['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2dccef,null))['then'](function(_0x2e11c2){if(_0x2e11c2){return db[_0xff42('0x79')][_0xff42('0x7a')](function(_0x5b17c9){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x34e2d9['params']['id']},'transaction':_0x5b17c9})[_0xff42('0x3b')](function(_0x1d0c13){var _0x44fba2=_['map'](_0x34e2d9[_0xff42('0x5b')],function(_0x5c3b9b){_0x5c3b9b[_0xff42('0x63')]=_0x34e2d9['params']['id'];return _0x5c3b9b;});return db[_0xff42('0x7b')]['bulkCreate'](_0x44fba2,{'transaction':_0x5b17c9});});})['then'](function(){return db[_0xff42('0x7b')][_0xff42('0x7c')]({'where':{'FaxAccountId':_0x34e2d9[_0xff42('0x54')]['id']},'order':_0xff42('0x7d')});});}})[_0xff42('0x3b')](respondWithResult(_0x2dccef,null))[_0xff42('0x29')](handleError(_0x2dccef,null));};exports[_0xff42('0x7e')]=function(_0x5a9e31,_0x5a1cd8,_0x4b3263){var _0x540376={};var _0x42fdc3={};var _0x2b0fea;var _0x35ff64;return db[_0xff42('0x41')][_0xff42('0x71')]({'where':{'id':_0x5a9e31[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x5a1cd8,null))[_0xff42('0x3b')](function(_0x3f56c6){if(_0x3f56c6){_0x2b0fea=_0x3f56c6;_0x42fdc3[_0xff42('0x46')]=_['keys'](db[_0xff42('0x7b')]['rawAttributes']);_0x42fdc3[_0xff42('0x43')]=_[_0xff42('0x56')](_0x5a9e31[_0xff42('0x43')]);_0x42fdc3['filters']=_[_0xff42('0x45')](_0x42fdc3[_0xff42('0x46')],_0x42fdc3[_0xff42('0x43')]);_0x540376['attributes']=_[_0xff42('0x45')](_0x42fdc3[_0xff42('0x46')],qs[_0xff42('0x47')](_0x5a9e31['query'][_0xff42('0x47')]));_0x540376[_0xff42('0x48')]=_0x540376[_0xff42('0x48')][_0xff42('0x49')]?_0x540376[_0xff42('0x48')]:_0x42fdc3[_0xff42('0x46')];_0x540376['order']=qs['sort'](_0x5a9e31[_0xff42('0x43')][_0xff42('0x4c')]);_0x540376[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0x5a9e31['query'],_0x42fdc3[_0xff42('0x44')]));if(_0x5a9e31['query'][_0xff42('0x4e')]){_0x540376['where']=_[_0xff42('0x4f')](_0x540376['where'],{'$or':_[_0xff42('0x40')](_0x540376[_0xff42('0x48')],function(_0x17cd07){var _0x14a2ca={};_0x14a2ca[_0x17cd07]={'$like':'%'+_0x5a9e31['query'][_0xff42('0x4e')]+'%'};return _0x14a2ca;})});}_0x540376=_['merge']({},_0x540376,_0x5a9e31[_0xff42('0x59')]);return _0x2b0fea[_0xff42('0x7e')](_0x540376);}})['then'](function(_0x93691f){if(_0x93691f){_0x35ff64=_0x93691f[_0xff42('0x49')];if(!_0x5a9e31['query'][_0xff42('0x4a')](_0xff42('0x6d'))){_0x540376[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x5a9e31[_0xff42('0x43')][_0xff42('0x2e')]);_0x540376[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x5a9e31['query']['offset']);}return _0x2b0fea[_0xff42('0x7e')](_0x540376);}})[_0xff42('0x3b')](function(_0x150dd8){if(_0x150dd8){return _0x150dd8?{'count':_0x35ff64,'rows':_0x150dd8}:null;}})[_0xff42('0x3b')](respondWithResult(_0x5a1cd8,null))[_0xff42('0x29')](handleError(_0x5a1cd8,null));};function Extension(_0x21ad30,_0x2b7a78,_0x1b8114,_0xb50946){this[_0xff42('0x7f')]=_0xff42('0x80');this[_0xff42('0x81')]=_0x21ad30[_0xff42('0x82')];this[_0xff42('0x83')]=_0xb50946;this['type']=_0xff42('0x84');this[_0xff42('0x85')]=_0xff42('0x86');this[_0xff42('0x63')]=_0x21ad30['id'];this[_0xff42('0x7d')]=_0x2b7a78;this['appdata']=_0x1b8114;}function createExtensionsReciveFax(_0xd865f0){var _0x4de3d9=0x1;var _0x4e89b3=[];_0x4e89b3['push'](new Extension(_0xd865f0,_0x4de3d9,'','Answer'));_0x4de3d9+=0x1;_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x88'),'Set'));_0x4de3d9+=0x1;for(var _0x545eab in _0xd865f0){if(_0xd865f0[_0xff42('0x4a')](_0x545eab)&&(_0x545eab===_0xff42('0x89')||_0x545eab===_0xff42('0x82')||_0x545eab==='gateway'||_0x545eab==='faxdetect'||_0x545eab===_0xff42('0x8a')||_0x545eab===_0xff42('0x8b')||_0x545eab===_0xff42('0x8c')||_0x545eab==='modem'||_0x545eab===_0xff42('0x8d'))){_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x8e')+_0x545eab+')='+_0xd865f0[_0x545eab],_0xff42('0x8f')));_0x4de3d9+=0x1;}}_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,'6',_0xff42('0x90')));_0x4de3d9+=0x1;_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x91'),_0xff42('0x92')));_0x4de3d9=0x0;return _0x4e89b3;}exports['addAccountApplications']=function(_0x943d07,_0x19fed5,_0x1f9a21){var _0x5da55e;return db['sequelize'][_0xff42('0x7a')](function(_0x26f9aa){return db[_0xff42('0x41')][_0xff42('0x5a')](_0x943d07[_0xff42('0x5b')],{'transaction':_0x26f9aa})['then'](function(_0x2a6c6f){_0x5da55e=_0x2a6c6f['get']({'plain':!![]});return db[_0xff42('0x93')]['bulkCreate'](createExtensionsReciveFax(_0x5da55e),{'transaction':_0x26f9aa});});})[_0xff42('0x3b')](function(){return _0x5da55e;})['then'](respondWithResult(_0x19fed5,null))[_0xff42('0x29')](handleError(_0x19fed5,null));};exports[_0xff42('0x94')]=function(_0xfa47ec,_0x17ee0c,_0x3380fb){var _0x1151e5;return db[_0xff42('0x79')][_0xff42('0x7a')](function(_0x213034){return db[_0xff42('0x41')][_0xff42('0x36')](_0xfa47ec[_0xff42('0x5b')],{'where':{'id':_0xfa47ec[_0xff42('0x5b')]['id']},'transaction':_0x213034})[_0xff42('0x3b')](function(_0x5d7679){return db[_0xff42('0x93')]['destroy']({'where':{'FaxAccountId':_0xfa47ec['body']['id']},'transaction':_0x213034})[_0xff42('0x3b')](function(_0x204b5b){return db['VoiceExtension'][_0xff42('0x95')](createExtensionsReciveFax(_[_0xff42('0x70')](_0xfa47ec[_0xff42('0x5b')],['tech',_0xff42('0x42'),_0xff42('0x96'),_0xff42('0x97'),'TrunkId','ListId'])),{'transaction':_0x213034});});});})['then'](function(){return db[_0xff42('0x41')][_0xff42('0x98')](_0xfa47ec['body']['id']);})['then'](respondWithResult(_0x17ee0c,null))[_0xff42('0x29')](handleError(_0x17ee0c,null));};exports[_0xff42('0x99')]=function(_0x1a9c3d,_0x1af310,_0x3d329b){var _0xa98529={'raw':!![],'where':{}};var _0x514d3b={};var _0x2f1793={'count':0x0,'rows':[]};return db['FaxAccount'][_0xff42('0x71')]({'where':{'id':_0x1a9c3d[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x1af310,null))[_0xff42('0x3b')](function(_0x5aed59){if(_0x5aed59){_0x514d3b[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x9a')][_0xff42('0x57')]);_0x514d3b[_0xff42('0x43')]=_[_0xff42('0x56')](_0x1a9c3d[_0xff42('0x43')]);_0x514d3b['filters']=_[_0xff42('0x45')](_0x514d3b[_0xff42('0x46')],_0x514d3b[_0xff42('0x43')]);_0xa98529[_0xff42('0x48')]=_[_0xff42('0x45')](_0x514d3b['model'],qs['fields'](_0x1a9c3d[_0xff42('0x43')][_0xff42('0x47')]));_0xa98529[_0xff42('0x48')]=_0xa98529[_0xff42('0x48')][_0xff42('0x49')]?_0xa98529[_0xff42('0x48')]:_0x514d3b[_0xff42('0x46')];if(!_0x1a9c3d['query'][_0xff42('0x4a')](_0xff42('0x6d'))){_0xa98529['limit']=qs[_0xff42('0x2e')](_0x1a9c3d[_0xff42('0x43')]['limit']);_0xa98529['offset']=qs[_0xff42('0x31')](_0x1a9c3d[_0xff42('0x43')][_0xff42('0x31')]);}_0xa98529[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x1a9c3d[_0xff42('0x43')]['sort']);_0xa98529[_0xff42('0x4d')]=qs[_0xff42('0x44')](_['pick'](_0x1a9c3d['query'],_0x514d3b[_0xff42('0x44')]));_0xa98529[_0xff42('0x4d')][_0xff42('0x63')]=_0x5aed59['id'];if(_0x1a9c3d['query'][_0xff42('0x4e')]){_0xa98529[_0xff42('0x4d')]=_[_0xff42('0x4f')](_0xa98529[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0xa98529['attributes'],function(_0x47485f){var _0x4a17e0={};_0x4a17e0[_0x47485f]={'$like':'%'+_0x1a9c3d[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4a17e0;})});}if(_0x1a9c3d[_0xff42('0x43')][_0xff42('0x9b')]){var _0x2dfa0f=_0x1a9c3d[_0xff42('0x43')][_0xff42('0x9b')][_0xff42('0x9c')](',');var _0x335cc3={};_0x335cc3[_0x2dfa0f[0x0]]={'$gte':moment(_0x2dfa0f[0x1])[_0xff42('0x9d')](_0xff42('0x9e'))};_0xa98529['where']=_[_0xff42('0x4f')](_0xa98529['where'],_0x335cc3);}_0xa98529=_['merge']({},_0xa98529,_0x1a9c3d[_0xff42('0x59')]);return db[_0xff42('0x9a')][_0xff42('0x30')]({'where':_0xa98529['where']})[_0xff42('0x3b')](function(_0x473748){_0x2f1793[_0xff42('0x30')]=_0x473748;if(_0x1a9c3d[_0xff42('0x43')][_0xff42('0x58')]){_0xa98529[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x9a')][_0xff42('0x67')](_0xa98529);})[_0xff42('0x3b')](function(_0x352050){_0x2f1793['rows']=_0x352050;return _0x2f1793;});}})['then'](respondWithFilteredResult(_0x1af310,_0xa98529))['catch'](handleError(_0x1af310,null));};exports['send']=function(_0x429601,_0x111dc3,_0x2d1cd5){var _0xb8d8a3,_0x203758={},_0x1836ef;if(_0x429601[_0xff42('0x5b')]['to']){_0x1836ef=_0x429601[_0xff42('0x5b')]['to'][0x0];}return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x429601[_0xff42('0x54')]['id']},'include':[{'model':db[_0xff42('0x9f')],'as':_0xff42('0xa0'),'include':[{'model':db[_0xff42('0xa1')],'as':_0xff42('0xa2'),'where':{'fax':_0x1836ef},'limit':0x1,'order':[[_0xff42('0x97'),_0xff42('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x111dc3,null))[_0xff42('0x3b')](function(_0x403b8c){_0xb8d8a3=_0x403b8c;if(_0x429601[_0xff42('0x5b')]['attachments']&&_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0xff42('0x49')]){for(var _0x21566e=0x0;_0x21566e<_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0xff42('0x49')];_0x21566e+=0x1){_0x429601['body'][_0xff42('0xa4')][_0x21566e]={'filename':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0x21566e]['name'],'id':_0x429601['body'][_0xff42('0xa4')][_0x21566e]['id'],'path':path[_0xff42('0xa5')](config['root'],_0xff42('0xa6'),_0x429601['body'][_0xff42('0xa4')][_0x21566e][_0xff42('0xa7')])};}}return respondWithRpcPromise(_0xff42('0xa8'),_0xff42('0xa8'),{'FaxAccountId':_[_0xff42('0xa9')](_0x429601[_0xff42('0x54')]['id'])?undefined:_0x429601[_0xff42('0x54')]['id'],'path':_['isNil'](_0x429601['body']['attachments'][0x0]['path'])?undefined:_0x429601[_0xff42('0x5b')]['attachments'][0x0][_0xff42('0x6')],'fax':_['isNil'](_0x429601[_0xff42('0x5b')]['to'][0x0])?undefined:_0x429601[_0xff42('0x5b')]['to'][0x0]},client9002);})[_0xff42('0x3b')](function(){if(_0xb8d8a3){if(_[_0xff42('0xa9')](_0x429601[_0xff42('0x5b')][_0xff42('0xaa')])){_0x429601[_0xff42('0x5b')][_0xff42('0xaa')]=util[_0xff42('0x9d')](_0xff42('0xab'),_0xb8d8a3[_0xff42('0x3d')],_0xb8d8a3[_0xff42('0xac')]);}if(_0xb8d8a3[_0xff42('0xa0')]){if(_0xb8d8a3['List'][_0xff42('0xa2')][_0xff42('0x49')]){return _0xb8d8a3['List'][_0xff42('0xa2')][0x0];}else{return db['CmContact'][_0xff42('0x5a')](_['defaults'](_0x429601[_0xff42('0x5b')],{'firstName':_0x429601['body']['to'][0x0],'phone':_0x429601[_0xff42('0x5b')]['to'][0x0],'fax':_0x429601[_0xff42('0x5b')]['to'][0x0],'ListId':_0xb8d8a3[_0xff42('0xad')]}));}}else{throw new Error(_0xff42('0xae'));}}else{throw new Error(_0xff42('0xaf'));}})[_0xff42('0x3b')](function(_0x1c9ef6){if(_0x1c9ef6){return db[_0xff42('0x72')][_0xff42('0x5f')]({'where':{'ContactId':_0x1c9ef6['id'],'closed':![],'FaxAccountId':_0xb8d8a3['id']}})[_0xff42('0x3b')](function(_0x5ee1c7){if(_0x5ee1c7){return[_0x5ee1c7,![]];}return db[_0xff42('0x72')]['create']({'UserId':_0x429601[_0xff42('0x5c')]['id'],'ContactId':_0x1c9ef6['id'],'FaxAccountId':_0xb8d8a3['id'],'fax':_0x429601['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x429601[_0xff42('0x5b')],{'read':![],'body':_0x429601['body'][_0xff42('0xa4')][0x0]['filename'],'FaxAccountId':_0xb8d8a3['id'],'UserId':_0x429601['user']['id'],'ContactId':_0x1c9ef6['id'],'AttachmentId':_0x429601['body'][_0xff42('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xff42('0x9a')],'as':_0xff42('0xb0')}]})[_0xff42('0x3b')](function(_0x434a33){return[_0x434a33,!![]];});});}else{throw new Error(_0xff42('0xb1'));}})[_0xff42('0xb2')](function(_0x20df2c,_0x499e04){if(_0x499e04){return _0x20df2c;}return db[_0xff42('0x9a')][_0xff42('0x5a')]({'direction':'out','read':![],'body':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0][_0xff42('0xb3')],'FaxAccountId':_0xb8d8a3['id'],'FaxInteractionId':_0x20df2c['id'],'UserId':_0x429601['user']['id'],'ContactId':_0x20df2c[_0xff42('0xb4')],'AttachmentId':_0x429601[_0xff42('0x5b')]['attachments'][0x0]['id']})[_0xff42('0x3b')](function(_0x47b13e){_0x20df2c['dataValues'][_0xff42('0xb0')]=[];_0x20df2c[_0xff42('0xb5')]['Messages']['push'](_0x47b13e[_0xff42('0xb5')]);return _0x20df2c;});})[_0xff42('0x3b')](function(_0x4e7e34){respondWithRpcPromise(_0xff42('0xb6'),_0xff42('0xb6'),{'FaxAccountId':_['isNil'](_0x429601[_0xff42('0x54')]['id'])?undefined:_0x429601[_0xff42('0x54')]['id'],'path':_[_0xff42('0xa9')](_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0]['path'])?undefined:_0x429601[_0xff42('0x5b')]['attachments'][0x0][_0xff42('0x6')],'fax':_[_0xff42('0xa9')](_0x429601['body']['to'][0x0])?undefined:_0x429601['body']['to'][0x0],'AttachmentId':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0]['id']},client9002)[_0xff42('0x3b')](function(_0x29ca4b){logger[_0xff42('0x21')](_0xff42('0xb7'),_0x29ca4b);})[_0xff42('0x29')](function(_0x4c87b0){logger[_0xff42('0x21')]('SendFaxRpc,\x20%s',_0x4c87b0);});return _0x4e7e34;})[_0xff42('0x3b')](respondWithResult(_0x111dc3,null))[_0xff42('0x29')](handleError(_0x111dc3,null));};exports[_0xff42('0xb8')]=function(_0x57678a,_0x2ff249,_0x1e3e8d){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x57678a['params']['id']}})['then'](handleEntityNotFound(_0x2ff249,null))[_0xff42('0x3b')](function(_0x593383){if(_0x593383){return _0x593383[_0xff42('0xb8')](_0x57678a['body'][_0xff42('0x69')],_[_0xff42('0x70')](_0x57678a[_0xff42('0x5b')],['ids','id'])||{})['spread'](function(_0x582a00){for(var _0x22186c=0x0;_0x22186c<_0x57678a[_0xff42('0x5b')]['ids'][_0xff42('0x49')];_0x22186c+=0x1){socket[_0xff42('0xb9')](_0xff42('0xba'),{'UserId':Number(_0x57678a[_0xff42('0x5b')][_0xff42('0x69')][_0x22186c]),'FaxAccountId':Number(_0x57678a[_0xff42('0x54')]['id'])});}return _0x582a00;});}})['then'](respondWithResult(_0x2ff249,null))['catch'](handleError(_0x2ff249,null));};exports[_0xff42('0xbb')]=function(_0x31aeda,_0x486d6e,_0x1edd50){return db['FaxAccount'][_0xff42('0x5f')]({'where':{'id':_0x31aeda[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x486d6e,null))['then'](function(_0x4bc57e){if(_0x4bc57e){return _0x4bc57e[_0xff42('0xbb')](_0x31aeda[_0xff42('0x43')][_0xff42('0x69')])[_0xff42('0x3b')](function(){if(_['isArray'](_0x31aeda[_0xff42('0x43')][_0xff42('0x69')])){for(var _0x327099=0x0;_0x327099<_0x31aeda[_0xff42('0x43')][_0xff42('0x69')]['length'];_0x327099+=0x1){socket[_0xff42('0xb9')](_0xff42('0xbc'),{'UserId':Number(_0x31aeda[_0xff42('0x43')][_0xff42('0x69')][_0x327099]),'FaxAccountId':Number(_0x31aeda[_0xff42('0x54')]['id'])});}}else{socket[_0xff42('0xb9')](_0xff42('0xbc'),{'UserId':Number(_0x31aeda[_0xff42('0x43')][_0xff42('0x69')]),'FaxAccountId':Number(_0x31aeda['params']['id'])});}});}})[_0xff42('0x3b')](respondWithStatusCode(_0x486d6e,null))[_0xff42('0x29')](handleError(_0x486d6e,null));};exports['getAgents']=function(_0x25f741,_0x2ab51f,_0x3d8de4){var _0x3ff19b={};var _0x4a8af3={};var _0x33c1ad;var _0x3e22fe;return db['FaxAccount'][_0xff42('0x71')]({'where':{'id':_0x25f741[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2ab51f,null))[_0xff42('0x3b')](function(_0x85e40a){if(_0x85e40a){_0x33c1ad=_0x85e40a;_0x4a8af3[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x74')]['rawAttributes']);_0x4a8af3[_0xff42('0x43')]=_[_0xff42('0x56')](_0x25f741[_0xff42('0x43')]);_0x4a8af3[_0xff42('0x44')]=_[_0xff42('0x45')](_0x4a8af3[_0xff42('0x46')],_0x4a8af3[_0xff42('0x43')]);_0x3ff19b[_0xff42('0x48')]=_[_0xff42('0x45')](_0x4a8af3[_0xff42('0x46')],qs[_0xff42('0x47')](_0x25f741[_0xff42('0x43')][_0xff42('0x47')]));_0x3ff19b[_0xff42('0x48')]=_0x3ff19b['attributes']['length']?_0x3ff19b['attributes']:_0x4a8af3[_0xff42('0x46')];_0x3ff19b[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x25f741[_0xff42('0x43')][_0xff42('0x4c')]);_0x3ff19b['where']=qs[_0xff42('0x44')](_['pick'](_0x25f741[_0xff42('0x43')],_0x4a8af3[_0xff42('0x44')]));if(_0x25f741[_0xff42('0x43')][_0xff42('0x4e')]){_0x3ff19b[_0xff42('0x4d')]=_['merge'](_0x3ff19b['where'],{'$or':_[_0xff42('0x40')](_0x3ff19b['attributes'],function(_0x562e09){var _0x1f345d={};_0x1f345d[_0x562e09]={'$like':'%'+_0x25f741[_0xff42('0x43')]['filter']+'%'};return _0x1f345d;})});}_0x3ff19b=_[_0xff42('0x4f')]({},_0x3ff19b,_0x25f741[_0xff42('0x59')]);return _0x33c1ad['getAgents'](_0x3ff19b);}})['then'](function(_0x539a79){if(_0x539a79){_0x3e22fe=_0x539a79[_0xff42('0x49')];if(!_0x25f741['query'][_0xff42('0x4a')]('nolimit')){_0x3ff19b[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x25f741[_0xff42('0x43')][_0xff42('0x2e')]);_0x3ff19b[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x25f741[_0xff42('0x43')]['offset']);}return _0x33c1ad['getAgents'](_0x3ff19b);}})[_0xff42('0x3b')](function(_0x290daa){if(_0x290daa){return _0x290daa?{'count':_0x3e22fe,'rows':_0x290daa}:null;}})[_0xff42('0x3b')](respondWithResult(_0x2ab51f,null))[_0xff42('0x29')](handleError(_0x2ab51f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 3db5e2d..58a77ab 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 _0xc4bf=['../../mysqldb','setMaxListeners','update','remove','emit','hook'];(function(_0x44345d,_0x4ed973){var _0x4f6ceb=function(_0x57ec04){while(--_0x57ec04){_0x44345d['push'](_0x44345d['shift']());}};_0x4f6ceb(++_0x4ed973);}(_0xc4bf,0x1c8));var _0xfc4b=function(_0x57171b,_0xfe67c6){_0x57171b=_0x57171b-0x0;var _0x33a2c8=_0xc4bf[_0x57171b];return _0x33a2c8;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xfc4b('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfc4b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc4b('0x2'),'afterDestroy':_0xfc4b('0x3')};function emitEvent(_0x153a77){return function(_0x287dc0,_0x3f5c95,_0x1b1365){FaxAccountEvents[_0xfc4b('0x4')](_0x153a77+':'+_0x287dc0['id'],_0x287dc0);FaxAccountEvents['emit'](_0x153a77,_0x287dc0);_0x1b1365(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xfc4b('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x442e=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount','save'];(function(_0x20057a,_0x4d8685){var _0x31c79b=function(_0xc2b2f2){while(--_0xc2b2f2){_0x20057a['push'](_0x20057a['shift']());}};_0x31c79b(++_0x4d8685);}(_0x442e,0x1d1));var _0xe442=function(_0x14b7df,_0x550c08){_0x14b7df=_0x14b7df-0x0;var _0x46830d=_0x442e[_0x14b7df];return _0x46830d;};'use strict';var EventEmitter=require(_0xe442('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe442('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe442('0x2'),'afterUpdate':_0xe442('0x3'),'afterDestroy':_0xe442('0x4')};function emitEvent(_0x5f31f6){return function(_0x105ecf,_0x304838,_0xbd9e5){FaxAccountEvents[_0xe442('0x5')](_0x5f31f6+':'+_0x105ecf['id'],_0x105ecf);FaxAccountEvents['emit'](_0x5f31f6,_0x105ecf);_0xbd9e5(null);};}for(var e in events){if(events[_0xe442('0x6')](e)){var event=events[e];FaxAccount[_0xe442('0x7')](e,emitEvent(event));}}module[_0xe442('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 344322d..e9bccc6 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 _0x9694=['FaxAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x32fa53,_0x1c95f4){var _0x14faf8=function(_0x59b878){while(--_0x59b878){_0x32fa53['push'](_0x32fa53['shift']());}};_0x14faf8(++_0x1c95f4);}(_0x9694,0x79));var _0x4969=function(_0x210b24,_0x11eea6){_0x210b24=_0x210b24-0x0;var _0x267fad=_0x9694[_0x210b24];return _0x267fad;};'use strict';var _=require(_0x4969('0x0'));var util=require(_0x4969('0x1'));var logger=require(_0x4969('0x2'))(_0x4969('0x3'));var moment=require(_0x4969('0x4'));var BPromise=require('bluebird');var rp=require(_0x4969('0x5'));var fs=require('fs');var path=require(_0x4969('0x6'));var rimraf=require(_0x4969('0x7'));var config=require(_0x4969('0x8'));var attributes=require(_0x4969('0x9'));module[_0x4969('0xa')]=function(_0x5c691a,_0x3ac606){return _0x5c691a['define'](_0x4969('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff9a=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xbb6ed5,_0xcdaf35){var _0x269302=function(_0x151647){while(--_0x151647){_0xbb6ed5['push'](_0xbb6ed5['shift']());}};_0x269302(++_0xcdaf35);}(_0xff9a,0x88));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var logger=require(_0xaff9('0x2'))(_0xaff9('0x3'));var moment=require('moment');var BPromise=require(_0xaff9('0x4'));var rp=require(_0xaff9('0x5'));var fs=require('fs');var path=require(_0xaff9('0x6'));var rimraf=require(_0xaff9('0x7'));var config=require('../../config/environment');var attributes=require(_0xaff9('0x8'));module[_0xaff9('0x9')]=function(_0x343bbb,_0x1ed4e7){return _0x343bbb[_0xaff9('0xa')]('FaxAccount',attributes,{'tableName':_0xaff9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 9b1bfa9..0602a42 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 _0xd5cc=['client','http','defaults','localhost','redis','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','length','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd5cc,0x101));var _0xcd5c=function(_0x452136,_0x311b4a){_0x452136=_0x452136-0x0;var _0x128128=_0xd5cc[_0x452136];return _0x128128;};'use strict';var _=require(_0xcd5c('0x0'));var util=require(_0xcd5c('0x1'));var moment=require(_0xcd5c('0x2'));var BPromise=require(_0xcd5c('0x3'));var rs=require(_0xcd5c('0x4'));var fs=require('fs');var Redis=require(_0xcd5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd5c('0x6'))(_0xcd5c('0x7'));var config=require(_0xcd5c('0x8'));var jayson=require(_0xcd5c('0x9'));var client=jayson[_0xcd5c('0xa')][_0xcd5c('0xb')]({'port':0x232c});config['redis']=_[_0xcd5c('0xc')](config['redis'],{'host':_0xcd5c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd5c('0xe')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x28c691,_0x215ef3,_0x240452){return new BPromise(function(_0x21779b,_0x4fe440){return client['request'](_0x28c691,_0x240452)[_0xcd5c('0xf')](function(_0x1fc508){logger[_0xcd5c('0x10')](_0xcd5c('0x11'),_0x215ef3,_0xcd5c('0x12'));logger[_0xcd5c('0x13')](_0xcd5c('0x14'),_0x215ef3,_0xcd5c('0x12'),JSON['stringify'](_0x1fc508));if(_0x1fc508['error']){if(_0x1fc508[_0xcd5c('0x15')][_0xcd5c('0x16')]===0x1f4){logger[_0xcd5c('0x15')](_0xcd5c('0x11'),_0x215ef3,_0x1fc508['error'][_0xcd5c('0x17')]);return _0x4fe440(_0x1fc508[_0xcd5c('0x15')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x215ef3,_0x1fc508[_0xcd5c('0x15')][_0xcd5c('0x17')]);return _0x21779b(_0x1fc508[_0xcd5c('0x15')][_0xcd5c('0x17')]);}else{logger[_0xcd5c('0x10')](_0xcd5c('0x11'),_0x215ef3,'request\x20sent');_0x21779b(_0x1fc508[_0xcd5c('0x18')][_0xcd5c('0x17')]);}})[_0xcd5c('0x19')](function(_0x342c60){logger['error']('FaxAccount,\x20%s,\x20%s',_0x215ef3,_0x342c60);_0x4fe440(_0x342c60);});});}exports['GetFaxAccount']=function(_0x37e4c6){var _0x1320fc=this;return new Promise(function(_0x259f89,_0xb3b670){return db['FaxAccount'][_0xcd5c('0x1a')]({'raw':_0x37e4c6[_0xcd5c('0x1b')]?_0x37e4c6['options'][_0xcd5c('0x1c')]===undefined?!![]:![]:!![],'where':_0x37e4c6[_0xcd5c('0x1b')]?_0x37e4c6[_0xcd5c('0x1b')][_0xcd5c('0x1d')]||null:null,'attributes':_0x37e4c6['options']?_0x37e4c6[_0xcd5c('0x1b')][_0xcd5c('0x1e')]||null:null,'limit':_0x37e4c6[_0xcd5c('0x1b')]?_0x37e4c6[_0xcd5c('0x1b')][_0xcd5c('0x1f')]||null:null,'include':_0x37e4c6[_0xcd5c('0x1b')]?_0x37e4c6[_0xcd5c('0x1b')][_0xcd5c('0x20')]?_[_0xcd5c('0x21')](_0x37e4c6['options'][_0xcd5c('0x20')],function(_0x42a2ed){return{'model':db[_0x42a2ed['model']],'as':_0x42a2ed['as'],'attributes':_0x42a2ed['attributes'],'include':_0x42a2ed['include']?_[_0xcd5c('0x21')](_0x42a2ed[_0xcd5c('0x20')],function(_0x111146){return{'model':db[_0x111146[_0xcd5c('0x22')]],'as':_0x111146['as'],'attributes':_0x111146[_0xcd5c('0x1e')],'include':_0x111146[_0xcd5c('0x20')]?_[_0xcd5c('0x21')](_0x111146[_0xcd5c('0x20')],function(_0x26ac3a){return{'model':db[_0x26ac3a[_0xcd5c('0x22')]],'as':_0x26ac3a['as'],'attributes':_0x26ac3a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4db2e4){logger[_0xcd5c('0x10')](_0xcd5c('0x23'),_0x37e4c6);logger[_0xcd5c('0x13')](_0xcd5c('0x23'),_0x37e4c6,JSON[_0xcd5c('0x24')](_0x4db2e4));_0x259f89(_0x4db2e4);})[_0xcd5c('0x19')](function(_0x3f0870){logger[_0xcd5c('0x15')](_0xcd5c('0x23'),_0x3f0870['message'],_0x37e4c6);_0xb3b670(_0x1320fc['error'](0x1f4,_0x3f0870[_0xcd5c('0x17')]));});});};exports[_0xcd5c('0x25')]=function(_0x39f08e,_0x59de37,_0x1a3e4e){var _0x2d90fe=this;return new Promise(function(_0x19f0be,_0x256ca3){var _0x34386d={'body':_0x39f08e[_0xcd5c('0x26')],'channel':_0xcd5c('0x27')};var _0x4ed50b=[];var _0x11ae2f=[];var _0x14a0b7={};return db[_0xcd5c('0x28')]['describe']()[_0xcd5c('0xf')](function(_0xd269b2){if(!_0xd269b2){throw new db[(_0xcd5c('0x29'))][(_0xcd5c('0x2a'))]('no\x20available\x20attributes');}_0x4ed50b=_[_0xcd5c('0x2b')](_[_0xcd5c('0x2c')](_0xd269b2),[_0xcd5c('0x2d'),_0xcd5c('0x2e')]);_0x11ae2f=_[_0xcd5c('0x2b')](_[_0xcd5c('0x2c')](_0xd269b2),[_0xcd5c('0x2d'),_0xcd5c('0x2e'),'CompanyId',_0xcd5c('0x2f')]);if(_0x39f08e['body']['id']){delete _0x39f08e['body']['id'];}if(_[_0xcd5c('0x30')](_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x31')])){throw new db[(_0xcd5c('0x29'))][(_0xcd5c('0x2a'))](_0xcd5c('0x32'));}if(_[_0xcd5c('0x30')](_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x26')])||_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x26')]===''){throw new db[(_0xcd5c('0x29'))][(_0xcd5c('0x2a'))](_0xcd5c('0x33'));}if(_[_0xcd5c('0x30')](_0x39f08e['body'][_0xcd5c('0x34')])){throw new db[(_0xcd5c('0x29'))][(_0xcd5c('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11ae2f);}if(!_[_0xcd5c('0x35')](_0x11ae2f,_0x39f08e['body'][_0xcd5c('0x34')])){throw new db[(_0xcd5c('0x29'))][(_0xcd5c('0x2a'))](_0xcd5c('0x36')+_0x11ae2f);}_0x14a0b7[_0x39f08e[_0xcd5c('0x26')]['mapKey']]=_0x39f08e['body'][_0xcd5c('0x31')];})[_0xcd5c('0xf')](function(){return db[_0xcd5c('0x37')][_0xcd5c('0x38')]({'where':{'id':_0x39f08e[_0xcd5c('0x39')]['id']},'include':[{'model':db[_0xcd5c('0x3a')],'as':_0xcd5c('0x3b'),'include':[{'model':db[_0xcd5c('0x28')],'as':_0xcd5c('0x3c'),'where':_0x14a0b7,'limit':0x1,'order':[[_0xcd5c('0x2e'),_0xcd5c('0x3d')]]}]},{'model':db[_0xcd5c('0x3e')],'as':_0xcd5c('0x3f')}]});})[_0xcd5c('0xf')](function(_0x5b7ef7){if(_0x5b7ef7&&_0x5b7ef7[_0xcd5c('0x3b')]){var _0x2a2303=_0x5b7ef7[_0xcd5c('0x40')]({'plain':!![]});_0x34386d[_0xcd5c('0x39')]=_0x2a2303;_0x34386d[_0xcd5c('0x41')]=_0x2a2303[_0xcd5c('0x3f')];_0x34386d[_0xcd5c('0x42')]=_0x2a2303[_0xcd5c('0x3b')];_0x34386d[_0xcd5c('0x41')]=_[_0xcd5c('0x43')](_0x34386d[_0xcd5c('0x41')],[_0xcd5c('0x44')],['asc']);if(_0x34386d['account'][_0xcd5c('0x3f')]){delete _0x34386d[_0xcd5c('0x39')][_0xcd5c('0x3f')];}if(_0x34386d[_0xcd5c('0x39')]['List']&&_0x34386d[_0xcd5c('0x39')]['List'][_0xcd5c('0x3c')][_0xcd5c('0x45')]){return _0x34386d['account'][_0xcd5c('0x3b')][_0xcd5c('0x3c')][0x0];}var _0x4a0584=_[_0xcd5c('0xc')](_0x39f08e[_0xcd5c('0x26')],{'firstName':_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x31')],'ListId':_0x2a2303['ListId']});_0x4a0584[_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x34')]]=_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x31')];return db[_0xcd5c('0x28')][_0xcd5c('0x46')](_0x4a0584,{'fields':_0x4ed50b,'raw':!![]});}})['then'](function(_0x232e8b){_0x34386d['contact']=_0x232e8b;if(_0x232e8b){var _0x34e707={'ContactId':_0x232e8b['id'],'FaxAccountId':_0x39f08e[_0xcd5c('0x39')]['id'],'fax':_0x232e8b[_0xcd5c('0x27')]};return db[_0xcd5c('0x47')][_0xcd5c('0x38')]({'where':{'ContactId':_0x232e8b['id'],'closed':![],'FaxAccountId':_0x39f08e[_0xcd5c('0x39')]['id']}})[_0xcd5c('0xf')](function(_0x454a59){if(_0x454a59){return[_0x454a59,![]];}return db[_0xcd5c('0x47')]['create'](_0x34e707)[_0xcd5c('0xf')](function(_0x34c018){return[_0x34c018,!![]];});});}else{throw new Error(_0xcd5c('0x48'));}})['spread'](function(_0x20b38c,_0x5454a9){var _0x3001b4=_0x20b38c['get']({'plain':!![]});if(_0x5454a9){if(_0x34386d[_0xcd5c('0x39')][_0xcd5c('0x49')]){_0x34386d[_0xcd5c('0x41')][_0xcd5c('0x4a')]({'id':0x0,'priority':_0x34386d['applications'][_0xcd5c('0x45')]+0x1,'app':_0xcd5c('0x4b'),'appdata':_0xcd5c('0x4c'),'interval':_0xcd5c('0x4d')});}_0x3001b4[_0xcd5c('0x4e')]=!![];}else{_0x3001b4['created']=![];}_0x34386d[_0xcd5c('0x4f')]=_0x3001b4;return db['FaxMessage']['create']({'body':_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x26')],'FaxAccountId':_0x39f08e[_0xcd5c('0x39')]['id'],'FaxInteractionId':_0x20b38c['id'],'direction':'in','ContactId':_0x20b38c[_0xcd5c('0x50')],'AttachmentId':_0x39f08e[_0xcd5c('0x26')][_0xcd5c('0x51')]});})[_0xcd5c('0xf')](function(_0x31dcec){_0x34386d[_0xcd5c('0x17')]=_0x31dcec;if(_0x34386d['interaction'][_0xcd5c('0x52')]){return db[_0xcd5c('0x53')][_0xcd5c('0x38')]({'attributes':['id',_0xcd5c('0x54')],'where':{'id':_0x34386d['interaction'][_0xcd5c('0x52')]}})[_0xcd5c('0xf')](function(_0x51b36c){if(_0x51b36c){_0x34386d[_0xcd5c('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcd5c('0x55'),'appdata':_0x51b36c[_0xcd5c('0x54')]+','+(_0x34386d['account'][_0xcd5c('0x56')]||0xa),'interval':_0xcd5c('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x34386d);});}return respondWithRpcPromise(_0xcd5c('0x57'),_0xcd5c('0x58'),_0x34386d);})['then'](function(_0x4696d9){_0x19f0be(_0x4696d9);})[_0xcd5c('0x19')](function(_0x337895){_0x256ca3(_0x2d90fe[_0xcd5c('0x15')](0x1f4,_0x337895['message']));});});}; \ No newline at end of file +var _0x550d=['length','ListId','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','startRouting','Start','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','findAll','options','where','limit','map','include','attributes','model','debug','NotifyFaxAccount','body','fax','CmContact','Sequelize','difference','createdAt','updatedAt','keys','CompanyId','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','List','Contacts','DESC','FaxApplication','applications','Applications','list','orderBy','asc'];(function(_0x57a52,_0x3e2f4b){var _0x3604d7=function(_0x547ea0){while(--_0x547ea0){_0x57a52['push'](_0x57a52['shift']());}};_0x3604d7(++_0x3e2f4b);}(_0x550d,0x116));var _0xd550=function(_0x12ea60,_0x526b72){_0x12ea60=_0x12ea60-0x0;var _0xb55f2=_0x550d[_0x12ea60];return _0xb55f2;};'use strict';var _=require(_0xd550('0x0'));var util=require(_0xd550('0x1'));var moment=require(_0xd550('0x2'));var BPromise=require('bluebird');var rs=require(_0xd550('0x3'));var fs=require('fs');var Redis=require(_0xd550('0x4'));var db=require(_0xd550('0x5'))['db'];var utils=require(_0xd550('0x6'));var logger=require(_0xd550('0x7'))(_0xd550('0x8'));var config=require('../../config/environment');var jayson=require(_0xd550('0x9'));var client=jayson[_0xd550('0xa')][_0xd550('0xb')]({'port':0x232c});config[_0xd550('0xc')]=_[_0xd550('0xd')](config['redis'],{'host':_0xd550('0xe'),'port':0x18eb});var socket=require(_0xd550('0xf'))(new Redis(config[_0xd550('0xc')]));require(_0xd550('0x10'))[_0xd550('0x11')](socket);function respondWithRpcPromise(_0xa132f3,_0x460c07,_0x16150d){return new BPromise(function(_0x5e58ab,_0x5eada3){return client['request'](_0xa132f3,_0x16150d)[_0xd550('0x12')](function(_0x2356c7){logger[_0xd550('0x13')](_0xd550('0x14'),_0x460c07,_0xd550('0x15'));logger['debug'](_0xd550('0x16'),_0x460c07,_0xd550('0x15'),JSON[_0xd550('0x17')](_0x2356c7));if(_0x2356c7[_0xd550('0x18')]){if(_0x2356c7['error'][_0xd550('0x19')]===0x1f4){logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x2356c7[_0xd550('0x18')][_0xd550('0x1a')]);return _0x5eada3(_0x2356c7['error']['message']);}logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x2356c7['error']['message']);return _0x5e58ab(_0x2356c7[_0xd550('0x18')][_0xd550('0x1a')]);}else{logger[_0xd550('0x13')]('FaxAccount,\x20%s,\x20%s',_0x460c07,_0xd550('0x15'));_0x5e58ab(_0x2356c7['result']['message']);}})['catch'](function(_0x1ed8e9){logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x1ed8e9);_0x5eada3(_0x1ed8e9);});});}exports[_0xd550('0x1b')]=function(_0x4606f7){var _0x38615b=this;return new Promise(function(_0x2c2383,_0x415183){return db[_0xd550('0x1c')][_0xd550('0x1d')]({'raw':_0x4606f7[_0xd550('0x1e')]?_0x4606f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x4606f7['options']?_0x4606f7[_0xd550('0x1e')][_0xd550('0x1f')]||null:null,'attributes':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')]['attributes']||null:null,'limit':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')][_0xd550('0x20')]||null:null,'include':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')]['include']?_[_0xd550('0x21')](_0x4606f7[_0xd550('0x1e')][_0xd550('0x22')],function(_0x1c267e){return{'model':db[_0x1c267e['model']],'as':_0x1c267e['as'],'attributes':_0x1c267e[_0xd550('0x23')],'include':_0x1c267e[_0xd550('0x22')]?_[_0xd550('0x21')](_0x1c267e[_0xd550('0x22')],function(_0x24c6e1){return{'model':db[_0x24c6e1[_0xd550('0x24')]],'as':_0x24c6e1['as'],'attributes':_0x24c6e1['attributes'],'include':_0x24c6e1['include']?_[_0xd550('0x21')](_0x24c6e1[_0xd550('0x22')],function(_0x43f3dd){return{'model':db[_0x43f3dd['model']],'as':_0x43f3dd['as'],'attributes':_0x43f3dd[_0xd550('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd550('0x12')](function(_0x27ade5){logger[_0xd550('0x13')](_0xd550('0x1b'),_0x4606f7);logger[_0xd550('0x25')]('GetFaxAccount',_0x4606f7,JSON['stringify'](_0x27ade5));_0x2c2383(_0x27ade5);})['catch'](function(_0x4da3be){logger[_0xd550('0x18')](_0xd550('0x1b'),_0x4da3be[_0xd550('0x1a')],_0x4606f7);_0x415183(_0x38615b['error'](0x1f4,_0x4da3be[_0xd550('0x1a')]));});});};exports[_0xd550('0x26')]=function(_0x1bc79e,_0x47cd21,_0x61b849){var _0x2dd21f=this;return new Promise(function(_0x3bb470,_0x28aa77){var _0x551577={'body':_0x1bc79e[_0xd550('0x27')],'channel':_0xd550('0x28')};var _0x1c01e7=[];var _0x3ca836=[];var _0xe7541a={};return db[_0xd550('0x29')]['describe']()[_0xd550('0x12')](function(_0x1d9f2b){if(!_0x1d9f2b){throw new db[(_0xd550('0x2a'))]['ValidationError']('no\x20available\x20attributes');}_0x1c01e7=_[_0xd550('0x2b')](_['keys'](_0x1d9f2b),[_0xd550('0x2c'),_0xd550('0x2d')]);_0x3ca836=_[_0xd550('0x2b')](_[_0xd550('0x2e')](_0x1d9f2b),[_0xd550('0x2c'),_0xd550('0x2d'),_0xd550('0x2f'),'ListId']);if(_0x1bc79e[_0xd550('0x27')]['id']){delete _0x1bc79e['body']['id'];}if(_['isNil'](_0x1bc79e['body']['from'])){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x31'));}if(_[_0xd550('0x32')](_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')])||_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')]===''){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x33'));}if(_[_0xd550('0x32')](_0x1bc79e['body']['mapKey'])){throw new db[(_0xd550('0x2a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ca836);}if(!_['includes'](_0x3ca836,_0x1bc79e['body'][_0xd550('0x34')])){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x35')+_0x3ca836);}_0xe7541a[_0x1bc79e['body']['mapKey']]=_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')];})['then'](function(){return db[_0xd550('0x1c')][_0xd550('0x37')]({'where':{'id':_0x1bc79e[_0xd550('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0xd550('0x39'),'include':[{'model':db[_0xd550('0x29')],'as':_0xd550('0x3a'),'where':_0xe7541a,'limit':0x1,'order':[[_0xd550('0x2d'),_0xd550('0x3b')]]}]},{'model':db[_0xd550('0x3c')],'as':'Applications'}]});})[_0xd550('0x12')](function(_0x3c96be){if(_0x3c96be&&_0x3c96be[_0xd550('0x39')]){var _0x2a99bc=_0x3c96be['get']({'plain':!![]});_0x551577['account']=_0x2a99bc;_0x551577[_0xd550('0x3d')]=_0x2a99bc[_0xd550('0x3e')];_0x551577[_0xd550('0x3f')]=_0x2a99bc[_0xd550('0x39')];_0x551577['applications']=_[_0xd550('0x40')](_0x551577['applications'],['priority'],[_0xd550('0x41')]);if(_0x551577[_0xd550('0x38')][_0xd550('0x3e')]){delete _0x551577[_0xd550('0x38')]['Applications'];}if(_0x551577['account'][_0xd550('0x39')]&&_0x551577[_0xd550('0x38')]['List'][_0xd550('0x3a')][_0xd550('0x42')]){return _0x551577[_0xd550('0x38')][_0xd550('0x39')][_0xd550('0x3a')][0x0];}var _0x262ff9=_[_0xd550('0xd')](_0x1bc79e[_0xd550('0x27')],{'firstName':_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')],'ListId':_0x2a99bc[_0xd550('0x43')]});_0x262ff9[_0x1bc79e[_0xd550('0x27')]['mapKey']]=_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')];return db['CmContact']['create'](_0x262ff9,{'fields':_0x1c01e7,'raw':!![]});}})[_0xd550('0x12')](function(_0x51b8ab){_0x551577['contact']=_0x51b8ab;if(_0x51b8ab){var _0x3a78af={'ContactId':_0x51b8ab['id'],'FaxAccountId':_0x1bc79e[_0xd550('0x38')]['id'],'fax':_0x51b8ab['fax']};return db[_0xd550('0x44')][_0xd550('0x37')]({'where':{'ContactId':_0x51b8ab['id'],'closed':![],'FaxAccountId':_0x1bc79e[_0xd550('0x38')]['id']}})[_0xd550('0x12')](function(_0x2b9f3c){if(_0x2b9f3c){return[_0x2b9f3c,![]];}return db[_0xd550('0x44')][_0xd550('0x45')](_0x3a78af)[_0xd550('0x12')](function(_0x1a7e7d){return[_0x1a7e7d,!![]];});});}else{throw new Error(_0xd550('0x46'));}})[_0xd550('0x47')](function(_0x15c7fa,_0x22b8e8){var _0x402619=_0x15c7fa['get']({'plain':!![]});if(_0x22b8e8){if(_0x551577[_0xd550('0x38')][_0xd550('0x48')]){_0x551577['applications']['push']({'id':0x0,'priority':_0x551577[_0xd550('0x3d')][_0xd550('0x42')]+0x1,'app':_0xd550('0x49'),'appdata':'unmanaged','interval':_0xd550('0x4a')});}_0x402619[_0xd550('0x4b')]=!![];}else{_0x402619['created']=![];}_0x551577[_0xd550('0x4c')]=_0x402619;return db[_0xd550('0x4d')]['create']({'body':_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')],'FaxAccountId':_0x1bc79e['account']['id'],'FaxInteractionId':_0x15c7fa['id'],'direction':'in','ContactId':_0x15c7fa['ContactId'],'AttachmentId':_0x1bc79e[_0xd550('0x27')][_0xd550('0x4e')]});})[_0xd550('0x12')](function(_0x397f75){_0x551577[_0xd550('0x1a')]=_0x397f75;if(_0x551577['interaction'][_0xd550('0x4f')]){return db[_0xd550('0x50')][_0xd550('0x37')]({'attributes':['id',_0xd550('0x51')],'where':{'id':_0x551577['interaction'][_0xd550('0x4f')]}})['then'](function(_0x43a28c){if(_0x43a28c){_0x551577[_0xd550('0x3d')][_0xd550('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43a28c['name']+','+(_0x551577[_0xd550('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xd550('0x53'),_0x551577);});}return respondWithRpcPromise(_0xd550('0x54'),_0xd550('0x53'),_0x551577);})[_0xd550('0x12')](function(_0x50d15f){_0x3bb470(_0x50d15f);})[_0xd550('0x55')](function(_0x593879){_0x28aa77(_0x2dd21f[_0xd550('0x18')](0x1f4,_0x593879[_0xd550('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 67e1dd8..17375db 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 _0xbf28=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0x40c30a,_0x69c038){var _0x35d6d9=function(_0x1b2ca2){while(--_0x1b2ca2){_0x40c30a['push'](_0x40c30a['shift']());}};_0x35d6d9(++_0x69c038);}(_0xbf28,0x14d));var _0x8bf2=function(_0x4133b7,_0x2e3bd7){_0x4133b7=_0x4133b7-0x0;var _0x107cdc=_0xbf28[_0x4133b7];return _0x107cdc;};'use strict';var FaxAccountEvents=require(_0x8bf2('0x0'));var events=['save',_0x8bf2('0x1'),_0x8bf2('0x2')];function createListener(_0x3cf8ad,_0x1cc7f9){return function(_0x51e3b1){_0x1cc7f9[_0x8bf2('0x3')](_0x3cf8ad,_0x51e3b1);};}function removeListener(_0x5044bb,_0x4d501d){return function(){FaxAccountEvents[_0x8bf2('0x4')](_0x5044bb,_0x4d501d);};}exports[_0x8bf2('0x5')]=function(_0x2155fe){for(var _0x102aef=0x0,_0x2b50ce=events[_0x8bf2('0x6')];_0x102aef<_0x2b50ce;_0x102aef++){var _0x43b110=events[_0x102aef];var _0x4389b6=createListener(_0x8bf2('0x7')+_0x43b110,_0x2155fe);FaxAccountEvents['on'](_0x43b110,_0x4389b6);}}; \ No newline at end of file +var _0x712a=['remove','update','removeListener','register','faxAccount:','./faxAccount.events','save'];(function(_0x2a1b1f,_0x307251){var _0x5e0390=function(_0x1018be){while(--_0x1018be){_0x2a1b1f['push'](_0x2a1b1f['shift']());}};_0x5e0390(++_0x307251);}(_0x712a,0x139));var _0xa712=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x712a[_0x22b68a];return _0x1ac67a;};'use strict';var FaxAccountEvents=require(_0xa712('0x0'));var events=[_0xa712('0x1'),_0xa712('0x2'),_0xa712('0x3')];function createListener(_0x49eca2,_0x3c1e3a){return function(_0xa80be){_0x3c1e3a['emit'](_0x49eca2,_0xa80be);};}function removeListener(_0xb5a801,_0x355987){return function(){FaxAccountEvents[_0xa712('0x4')](_0xb5a801,_0x355987);};}exports[_0xa712('0x5')]=function(_0x3dfb7c){for(var _0x447cb0=0x0,_0x242099=events['length'];_0x447cb0<_0x242099;_0x447cb0++){var _0x4fbe43=events[_0x447cb0];var _0x301150=createListener(_0xa712('0x6')+_0x4fbe43,_0x3dfb7c);FaxAccountEvents['on'](_0x4fbe43,_0x301150);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2f75c81..28208fb 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(_0x2c09e2,_0x100b38){var _0x2a1416=function(_0x46b7e2){while(--_0x46b7e2){_0x2c09e2['push'](_0x2c09e2['shift']());}};_0x2a1416(++_0x100b38);}(_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/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(_0x4688f3,_0x36fa36){var _0x3cb0b9=function(_0x50daea){while(--_0x50daea){_0x4688f3['push'](_0x4688f3['shift']());}};_0x3cb0b9(++_0x36fa36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 950b45a..13e831b 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 _0x88b3=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0x88b3,0x82));var _0x388b=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x88b3[_0x622035];return _0x326cf2;};'use strict';var Sequelize=require(_0x388b('0x0'));module[_0x388b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x388b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x388b('0x3')]()},'description':{'type':Sequelize[_0x388b('0x2')]},'interval':{'type':Sequelize[_0x388b('0x2')],'defaultValue':_0x388b('0x4')}}; \ No newline at end of file +var _0xcba6=['TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x1c280a,_0x405606){var _0x5910bd=function(_0x31fde1){while(--_0x31fde1){_0x1c280a['push'](_0x1c280a['shift']());}};_0x5910bd(++_0x405606);}(_0xcba6,0xfd));var _0x6cba=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xcba6[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0x6cba('0x0'));module[_0x6cba('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6cba('0x2')]()},'description':{'type':Sequelize[_0x6cba('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6cba('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b811f1e..a6e6bad 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 _0xbcf4=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','destroy','then','sendStatus','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys'];(function(_0x22bef2,_0x54f207){var _0xe33934=function(_0x20fd53){while(--_0x20fd53){_0x22bef2['push'](_0x22bef2['shift']());}};_0xe33934(++_0x54f207);}(_0xbcf4,0x17f));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4bcf('0x0'));var rimraf=require(_0x4bcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4bcf('0x2'));var moment=require('moment');var BPromise=require(_0x4bcf('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4bcf('0x4'));var csv=require(_0x4bcf('0x5'));var ejs=require(_0x4bcf('0x6'));var fs=require('fs');var fs_extra=require(_0x4bcf('0x7'));var _=require(_0x4bcf('0x8'));var squel=require(_0x4bcf('0x9'));var crypto=require(_0x4bcf('0xa'));var jsforce=require(_0x4bcf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4bcf('0x5'));var querystring=require(_0x4bcf('0xc'));var Papa=require('papaparse');var Redis=require(_0x4bcf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4bcf('0xe'));var as=require(_0x4bcf('0xf'));var hardwareService=require(_0x4bcf('0x10'));var logger=require(_0x4bcf('0x11'))(_0x4bcf('0x12'));var utils=require('../../config/utils');var config=require(_0x4bcf('0x13'));var licenseUtil=require(_0x4bcf('0x14'));var db=require(_0x4bcf('0x15'))['db'];function respondWithStatusCode(_0x4e024a,_0xef8816){_0xef8816=_0xef8816||0xcc;return function(_0x4fb08f){if(_0x4fb08f){return _0x4e024a['sendStatus'](_0xef8816);}return _0x4e024a['status'](_0xef8816)[_0x4bcf('0x16')]();};}function respondWithResult(_0xbefcde,_0x2ac469){_0x2ac469=_0x2ac469||0xc8;return function(_0x31cb9d){if(_0x31cb9d){return _0xbefcde[_0x4bcf('0x17')](_0x2ac469)['json'](_0x31cb9d);}};}function respondWithFilteredResult(_0x4c817c,_0x343991){return function(_0x28f533){if(_0x28f533){var _0x1490ea=typeof _0x343991['offset']===_0x4bcf('0x18')&&typeof _0x343991['limit']===_0x4bcf('0x18');var _0x37e7a3=_0x28f533[_0x4bcf('0x19')];var _0x29e34c=_0x1490ea?0x0:_0x343991[_0x4bcf('0x1a')];var _0x62c10=_0x1490ea?_0x28f533[_0x4bcf('0x19')]:_0x343991['offset']+_0x343991[_0x4bcf('0x1b')];var _0x5d5f87;if(_0x62c10>=_0x37e7a3){_0x62c10=_0x37e7a3;_0x5d5f87=0xc8;}else{_0x5d5f87=0xce;}_0x4c817c['status'](_0x5d5f87);return _0x4c817c[_0x4bcf('0x1c')](_0x4bcf('0x1d'),_0x29e34c+'-'+_0x62c10+'/'+_0x37e7a3)[_0x4bcf('0x1e')](_0x28f533);}return null;};}function patchUpdates(_0x3c79a6){return function(_0x3713cd){try{jsonpatch[_0x4bcf('0x1f')](_0x3713cd,_0x3c79a6,!![]);}catch(_0x44ced4){return BPromise['reject'](_0x44ced4);}return _0x3713cd[_0x4bcf('0x20')]();};}function saveUpdates(_0x7bc84c,_0x32e11f){return function(_0x1a2b9e){if(_0x1a2b9e){return _0x1a2b9e['update'](_0x7bc84c)['then'](function(_0x466452){return _0x466452;});}return null;};}function removeEntity(_0x5a05dc,_0x163a8d){return function(_0x540d9e){if(_0x540d9e){return _0x540d9e[_0x4bcf('0x21')]()[_0x4bcf('0x22')](function(){_0x5a05dc[_0x4bcf('0x17')](0xcc)[_0x4bcf('0x16')]();});}};}function handleEntityNotFound(_0x5b7d05,_0x3f860f){return function(_0x26987c){if(!_0x26987c){_0x5b7d05[_0x4bcf('0x23')](0x194);}return _0x26987c;};}function handleError(_0x35692c,_0x58dbdb){_0x58dbdb=_0x58dbdb||0x1f4;return function(_0x5e1dae){logger[_0x4bcf('0x24')](_0x5e1dae[_0x4bcf('0x25')]);if(_0x5e1dae[_0x4bcf('0x26')]){delete _0x5e1dae[_0x4bcf('0x26')];}_0x35692c[_0x4bcf('0x17')](_0x58dbdb)[_0x4bcf('0x27')](_0x5e1dae);};}exports[_0x4bcf('0x28')]=function(_0x3dff9b,_0x4d3244){var _0x21f7fa={},_0x51d5e2={},_0xfd5683={'count':0x0,'rows':[]};var _0x4800cc=_[_0x4bcf('0x29')](db[_0x4bcf('0x2a')][_0x4bcf('0x2b')],function(_0x2e1390){return{'name':_0x2e1390[_0x4bcf('0x2c')],'type':_0x2e1390['type'][_0x4bcf('0x2d')]};});_0x51d5e2[_0x4bcf('0x2e')]=_[_0x4bcf('0x29')](_0x4800cc,'name');_0x51d5e2[_0x4bcf('0x2f')]=_[_0x4bcf('0x30')](_0x3dff9b[_0x4bcf('0x2f')]);_0x51d5e2[_0x4bcf('0x31')]=_['intersection'](_0x51d5e2['model'],_0x51d5e2[_0x4bcf('0x2f')]);_0x21f7fa[_0x4bcf('0x32')]=_[_0x4bcf('0x33')](_0x51d5e2[_0x4bcf('0x2e')],qs['fields'](_0x3dff9b[_0x4bcf('0x2f')][_0x4bcf('0x34')]));_0x21f7fa[_0x4bcf('0x32')]=_0x21f7fa[_0x4bcf('0x32')][_0x4bcf('0x35')]?_0x21f7fa[_0x4bcf('0x32')]:_0x51d5e2[_0x4bcf('0x2e')];if(!_0x3dff9b['query'][_0x4bcf('0x36')]('nolimit')){_0x21f7fa['limit']=qs[_0x4bcf('0x1b')](_0x3dff9b[_0x4bcf('0x2f')][_0x4bcf('0x1b')]);_0x21f7fa[_0x4bcf('0x1a')]=qs[_0x4bcf('0x1a')](_0x3dff9b['query']['offset']);}_0x21f7fa[_0x4bcf('0x37')]=qs[_0x4bcf('0x38')](_0x3dff9b[_0x4bcf('0x2f')][_0x4bcf('0x38')]);_0x21f7fa[_0x4bcf('0x39')]=qs['filters'](_[_0x4bcf('0x3a')](_0x3dff9b[_0x4bcf('0x2f')],_0x51d5e2[_0x4bcf('0x31')]),_0x4800cc);if(_0x3dff9b[_0x4bcf('0x2f')][_0x4bcf('0x3b')]){_0x21f7fa[_0x4bcf('0x39')]=_['merge'](_0x21f7fa[_0x4bcf('0x39')],{'$or':_[_0x4bcf('0x29')](_0x4800cc,function(_0x566133){if(_0x566133['type']!==_0x4bcf('0x3c')){var _0x51fddc={};_0x51fddc[_0x566133[_0x4bcf('0x26')]]={'$like':'%'+_0x3dff9b['query'][_0x4bcf('0x3b')]+'%'};return _0x51fddc;}})});}_0x21f7fa=_['merge']({},_0x21f7fa,_0x3dff9b[_0x4bcf('0x3d')]);var _0xab5216={'where':_0x21f7fa[_0x4bcf('0x39')]};return db['FaxApplication'][_0x4bcf('0x19')](_0xab5216)[_0x4bcf('0x22')](function(_0x17448f){_0xfd5683['count']=_0x17448f;if(_0x3dff9b['query'][_0x4bcf('0x3e')]){_0x21f7fa[_0x4bcf('0x3f')]=[{'all':!![]}];}return db[_0x4bcf('0x2a')][_0x4bcf('0x40')](_0x21f7fa);})[_0x4bcf('0x22')](function(_0x4b596b){_0xfd5683[_0x4bcf('0x41')]=_0x4b596b;return _0xfd5683;})[_0x4bcf('0x22')](respondWithFilteredResult(_0x4d3244,_0x21f7fa))[_0x4bcf('0x42')](handleError(_0x4d3244,null));};exports[_0x4bcf('0x43')]=function(_0x53eb20,_0x2822dc){var _0x1152f6={'raw':!![],'where':{'id':_0x53eb20['params']['id']}},_0x48c2e7={};_0x48c2e7['model']=_['keys'](db[_0x4bcf('0x2a')][_0x4bcf('0x2b')]);_0x48c2e7[_0x4bcf('0x2f')]=_['keys'](_0x53eb20['query']);_0x48c2e7[_0x4bcf('0x31')]=_[_0x4bcf('0x33')](_0x48c2e7[_0x4bcf('0x2e')],_0x48c2e7['query']);_0x1152f6['attributes']=_['intersection'](_0x48c2e7[_0x4bcf('0x2e')],qs[_0x4bcf('0x34')](_0x53eb20['query'][_0x4bcf('0x34')]));_0x1152f6[_0x4bcf('0x32')]=_0x1152f6['attributes'][_0x4bcf('0x35')]?_0x1152f6['attributes']:_0x48c2e7['model'];if(_0x53eb20[_0x4bcf('0x2f')]['includeAll']){_0x1152f6[_0x4bcf('0x3f')]=[{'all':!![]}];}_0x1152f6=_['merge']({},_0x1152f6,_0x53eb20[_0x4bcf('0x3d')]);return db[_0x4bcf('0x2a')]['find'](_0x1152f6)[_0x4bcf('0x22')](handleEntityNotFound(_0x2822dc,null))[_0x4bcf('0x22')](respondWithResult(_0x2822dc,null))[_0x4bcf('0x42')](handleError(_0x2822dc,null));};exports[_0x4bcf('0x44')]=function(_0x135729,_0xfaae2e){return db[_0x4bcf('0x2a')][_0x4bcf('0x44')](_0x135729['body'],{})[_0x4bcf('0x22')](respondWithResult(_0xfaae2e,0xc9))[_0x4bcf('0x42')](handleError(_0xfaae2e,null));};exports['update']=function(_0x988bff,_0x2b06cf){if(_0x988bff['body']['id']){delete _0x988bff[_0x4bcf('0x45')]['id'];}return db[_0x4bcf('0x2a')][_0x4bcf('0x46')]({'where':{'id':_0x988bff[_0x4bcf('0x47')]['id']}})[_0x4bcf('0x22')](handleEntityNotFound(_0x2b06cf,null))[_0x4bcf('0x22')](saveUpdates(_0x988bff[_0x4bcf('0x45')],null))[_0x4bcf('0x22')](respondWithResult(_0x2b06cf,null))['catch'](handleError(_0x2b06cf,null));};exports[_0x4bcf('0x21')]=function(_0xb634e9,_0x5020eb){return db[_0x4bcf('0x2a')]['find']({'where':{'id':_0xb634e9[_0x4bcf('0x47')]['id']}})[_0x4bcf('0x22')](handleEntityNotFound(_0x5020eb,null))[_0x4bcf('0x22')](removeEntity(_0x5020eb,null))['catch'](handleError(_0x5020eb,null));}; \ No newline at end of file +var _0xeea5=['limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','FaxApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','options','count','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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/environment','../../mysqldb','end','status','json','offset','undefined'];(function(_0x65b37e,_0x22500b){var _0x485d15=function(_0x31d35f){while(--_0x31d35f){_0x65b37e['push'](_0x65b37e['shift']());}};_0x485d15(++_0x22500b);}(_0xeea5,0x158));var _0x5eea=function(_0x40f993,_0x488687){_0x40f993=_0x40f993-0x0;var _0x364845=_0xeea5[_0x40f993];return _0x364845;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eea('0x0'));var zipdir=require(_0x5eea('0x1'));var jsonpatch=require(_0x5eea('0x2'));var rp=require(_0x5eea('0x3'));var moment=require(_0x5eea('0x4'));var BPromise=require(_0x5eea('0x5'));var Mustache=require('mustache');var util=require(_0x5eea('0x6'));var path=require(_0x5eea('0x7'));var sox=require(_0x5eea('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5eea('0x9'));var squel=require(_0x5eea('0xa'));var crypto=require(_0x5eea('0xb'));var jsforce=require(_0x5eea('0xc'));var deskjs=require(_0x5eea('0xd'));var toCsv=require(_0x5eea('0xe'));var querystring=require(_0x5eea('0xf'));var Papa=require(_0x5eea('0x10'));var Redis=require(_0x5eea('0x11'));var authService=require(_0x5eea('0x12'));var qs=require(_0x5eea('0x13'));var as=require(_0x5eea('0x14'));var hardwareService=require(_0x5eea('0x15'));var logger=require(_0x5eea('0x16'))(_0x5eea('0x17'));var utils=require('../../config/utils');var config=require(_0x5eea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5eea('0x19'))['db'];function respondWithStatusCode(_0x1c1495,_0x3a6792){_0x3a6792=_0x3a6792||0xcc;return function(_0x2b6ee0){if(_0x2b6ee0){return _0x1c1495['sendStatus'](_0x3a6792);}return _0x1c1495['status'](_0x3a6792)[_0x5eea('0x1a')]();};}function respondWithResult(_0x488b87,_0x3edeec){_0x3edeec=_0x3edeec||0xc8;return function(_0x383145){if(_0x383145){return _0x488b87[_0x5eea('0x1b')](_0x3edeec)[_0x5eea('0x1c')](_0x383145);}};}function respondWithFilteredResult(_0x435b26,_0x3b3731){return function(_0x458b08){if(_0x458b08){var _0x4932da=typeof _0x3b3731[_0x5eea('0x1d')]===_0x5eea('0x1e')&&typeof _0x3b3731[_0x5eea('0x1f')]===_0x5eea('0x1e');var _0x313944=_0x458b08['count'];var _0x39c371=_0x4932da?0x0:_0x3b3731[_0x5eea('0x1d')];var _0x4bcd19=_0x4932da?_0x458b08['count']:_0x3b3731[_0x5eea('0x1d')]+_0x3b3731[_0x5eea('0x1f')];var _0x46ecf2;if(_0x4bcd19>=_0x313944){_0x4bcd19=_0x313944;_0x46ecf2=0xc8;}else{_0x46ecf2=0xce;}_0x435b26[_0x5eea('0x1b')](_0x46ecf2);return _0x435b26[_0x5eea('0x20')](_0x5eea('0x21'),_0x39c371+'-'+_0x4bcd19+'/'+_0x313944)[_0x5eea('0x1c')](_0x458b08);}return null;};}function patchUpdates(_0x33b3d7){return function(_0x4fb199){try{jsonpatch[_0x5eea('0x22')](_0x4fb199,_0x33b3d7,!![]);}catch(_0x23a96a){return BPromise[_0x5eea('0x23')](_0x23a96a);}return _0x4fb199[_0x5eea('0x24')]();};}function saveUpdates(_0x54384e,_0x5e6beb){return function(_0x96912e){if(_0x96912e){return _0x96912e[_0x5eea('0x25')](_0x54384e)[_0x5eea('0x26')](function(_0x1c1c64){return _0x1c1c64;});}return null;};}function removeEntity(_0x26aecd,_0xf58942){return function(_0xcc9dd9){if(_0xcc9dd9){return _0xcc9dd9['destroy']()[_0x5eea('0x26')](function(){_0x26aecd[_0x5eea('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24552f,_0x46aeb8){return function(_0x1ddde5){if(!_0x1ddde5){_0x24552f[_0x5eea('0x27')](0x194);}return _0x1ddde5;};}function handleError(_0x3de4a8,_0x25f558){_0x25f558=_0x25f558||0x1f4;return function(_0x2cd105){logger[_0x5eea('0x28')](_0x2cd105[_0x5eea('0x29')]);if(_0x2cd105[_0x5eea('0x2a')]){delete _0x2cd105[_0x5eea('0x2a')];}_0x3de4a8['status'](_0x25f558)[_0x5eea('0x2b')](_0x2cd105);};}exports[_0x5eea('0x2c')]=function(_0x42c04a,_0x310490){var _0x2490e9={},_0x2e307e={},_0xeed37a={'count':0x0,'rows':[]};var _0x518f44=_['map'](db[_0x5eea('0x2d')]['rawAttributes'],function(_0x4fccef){return{'name':_0x4fccef[_0x5eea('0x2e')],'type':_0x4fccef[_0x5eea('0x2f')]['key']};});_0x2e307e[_0x5eea('0x30')]=_['map'](_0x518f44,'name');_0x2e307e[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x42c04a[_0x5eea('0x31')]);_0x2e307e[_0x5eea('0x33')]=_[_0x5eea('0x34')](_0x2e307e[_0x5eea('0x30')],_0x2e307e[_0x5eea('0x31')]);_0x2490e9[_0x5eea('0x35')]=_[_0x5eea('0x34')](_0x2e307e[_0x5eea('0x30')],qs[_0x5eea('0x36')](_0x42c04a[_0x5eea('0x31')][_0x5eea('0x36')]));_0x2490e9[_0x5eea('0x35')]=_0x2490e9['attributes'][_0x5eea('0x37')]?_0x2490e9[_0x5eea('0x35')]:_0x2e307e[_0x5eea('0x30')];if(!_0x42c04a[_0x5eea('0x31')]['hasOwnProperty']('nolimit')){_0x2490e9['limit']=qs['limit'](_0x42c04a[_0x5eea('0x31')][_0x5eea('0x1f')]);_0x2490e9[_0x5eea('0x1d')]=qs[_0x5eea('0x1d')](_0x42c04a['query'][_0x5eea('0x1d')]);}_0x2490e9[_0x5eea('0x38')]=qs[_0x5eea('0x39')](_0x42c04a['query'][_0x5eea('0x39')]);_0x2490e9[_0x5eea('0x3a')]=qs[_0x5eea('0x33')](_[_0x5eea('0x3b')](_0x42c04a[_0x5eea('0x31')],_0x2e307e[_0x5eea('0x33')]),_0x518f44);if(_0x42c04a[_0x5eea('0x31')][_0x5eea('0x3c')]){_0x2490e9['where']=_[_0x5eea('0x3d')](_0x2490e9['where'],{'$or':_[_0x5eea('0x3e')](_0x518f44,function(_0xa21ae5){if(_0xa21ae5['type']!=='VIRTUAL'){var _0x5db541={};_0x5db541[_0xa21ae5[_0x5eea('0x2a')]]={'$like':'%'+_0x42c04a[_0x5eea('0x31')]['filter']+'%'};return _0x5db541;}})});}_0x2490e9=_[_0x5eea('0x3d')]({},_0x2490e9,_0x42c04a[_0x5eea('0x3f')]);var _0x571557={'where':_0x2490e9[_0x5eea('0x3a')]};return db[_0x5eea('0x2d')][_0x5eea('0x40')](_0x571557)[_0x5eea('0x26')](function(_0x514fd4){_0xeed37a['count']=_0x514fd4;if(_0x42c04a[_0x5eea('0x31')][_0x5eea('0x41')]){_0x2490e9['include']=[{'all':!![]}];}return db[_0x5eea('0x2d')][_0x5eea('0x42')](_0x2490e9);})['then'](function(_0x39d579){_0xeed37a['rows']=_0x39d579;return _0xeed37a;})[_0x5eea('0x26')](respondWithFilteredResult(_0x310490,_0x2490e9))[_0x5eea('0x43')](handleError(_0x310490,null));};exports['show']=function(_0x86be70,_0x51f718){var _0x30705c={'raw':!![],'where':{'id':_0x86be70[_0x5eea('0x44')]['id']}},_0x379b14={};_0x379b14[_0x5eea('0x30')]=_[_0x5eea('0x32')](db[_0x5eea('0x2d')][_0x5eea('0x45')]);_0x379b14[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x86be70[_0x5eea('0x31')]);_0x379b14[_0x5eea('0x33')]=_[_0x5eea('0x34')](_0x379b14[_0x5eea('0x30')],_0x379b14[_0x5eea('0x31')]);_0x30705c['attributes']=_['intersection'](_0x379b14[_0x5eea('0x30')],qs[_0x5eea('0x36')](_0x86be70[_0x5eea('0x31')][_0x5eea('0x36')]));_0x30705c[_0x5eea('0x35')]=_0x30705c[_0x5eea('0x35')]['length']?_0x30705c[_0x5eea('0x35')]:_0x379b14[_0x5eea('0x30')];if(_0x86be70[_0x5eea('0x31')][_0x5eea('0x41')]){_0x30705c[_0x5eea('0x46')]=[{'all':!![]}];}_0x30705c=_['merge']({},_0x30705c,_0x86be70[_0x5eea('0x3f')]);return db['FaxApplication'][_0x5eea('0x47')](_0x30705c)['then'](handleEntityNotFound(_0x51f718,null))['then'](respondWithResult(_0x51f718,null))[_0x5eea('0x43')](handleError(_0x51f718,null));};exports['create']=function(_0x20d41f,_0x338c9d){return db[_0x5eea('0x2d')][_0x5eea('0x48')](_0x20d41f[_0x5eea('0x49')],{})[_0x5eea('0x26')](respondWithResult(_0x338c9d,0xc9))[_0x5eea('0x43')](handleError(_0x338c9d,null));};exports[_0x5eea('0x25')]=function(_0x549f48,_0x31651c){if(_0x549f48[_0x5eea('0x49')]['id']){delete _0x549f48[_0x5eea('0x49')]['id'];}return db[_0x5eea('0x2d')][_0x5eea('0x47')]({'where':{'id':_0x549f48[_0x5eea('0x44')]['id']}})[_0x5eea('0x26')](handleEntityNotFound(_0x31651c,null))[_0x5eea('0x26')](saveUpdates(_0x549f48[_0x5eea('0x49')],null))[_0x5eea('0x26')](respondWithResult(_0x31651c,null))[_0x5eea('0x43')](handleError(_0x31651c,null));};exports[_0x5eea('0x4a')]=function(_0x5a7623,_0x162ef2){return db['FaxApplication']['find']({'where':{'id':_0x5a7623[_0x5eea('0x44')]['id']}})[_0x5eea('0x26')](handleEntityNotFound(_0x162ef2,null))['then'](removeEntity(_0x162ef2,null))['catch'](handleError(_0x162ef2,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 988a38d..1c27535 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 _0x394c=['./faxApplication.attributes','exports','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x24dc71,_0x17b0cd){var _0x4ad0bf=function(_0x29e5cf){while(--_0x29e5cf){_0x24dc71['push'](_0x24dc71['shift']());}};_0x4ad0bf(++_0x17b0cd);}(_0x394c,0x109));var _0xc394=function(_0x315b7c,_0x19ff8e){_0x315b7c=_0x315b7c-0x0;var _0x3a99eb=_0x394c[_0x315b7c];return _0x3a99eb;};'use strict';var _=require(_0xc394('0x0'));var util=require(_0xc394('0x1'));var logger=require(_0xc394('0x2'))('api');var moment=require(_0xc394('0x3'));var BPromise=require(_0xc394('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc394('0x5'));var rimraf=require(_0xc394('0x6'));var config=require(_0xc394('0x7'));var attributes=require(_0xc394('0x8'));module[_0xc394('0x9')]=function(_0x4023fd,_0x2c05aa){return _0x4023fd['define']('FaxApplication',attributes,{'tableName':_0xc394('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc394('0xb'),'collate':_0xc394('0xc')});}; \ No newline at end of file +var _0x8df8=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8df8,0x19a));var _0x88df=function(_0x5e509a,_0xaf5ac4){_0x5e509a=_0x5e509a-0x0;var _0x1b33ad=_0x8df8[_0x5e509a];return _0x1b33ad;};'use strict';var _=require('lodash');var util=require(_0x88df('0x0'));var logger=require(_0x88df('0x1'))('api');var moment=require(_0x88df('0x2'));var BPromise=require(_0x88df('0x3'));var rp=require(_0x88df('0x4'));var fs=require('fs');var path=require(_0x88df('0x5'));var rimraf=require('rimraf');var config=require(_0x88df('0x6'));var attributes=require(_0x88df('0x7'));module[_0x88df('0x8')]=function(_0x2f4a6f,_0x55eb32){return _0x2f4a6f[_0x88df('0x9')](_0x88df('0xa'),attributes,{'tableName':_0x88df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x88df('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7c56835..166b836 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 _0x83fe=['ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','debug','lodash','util','moment'];(function(_0x176683,_0x168eb1){var _0x41ab61=function(_0x30b18e){while(--_0x30b18e){_0x176683['push'](_0x176683['shift']());}};_0x41ab61(++_0x168eb1);}(_0x83fe,0xc5));var _0xe83f=function(_0x58494f,_0x5e3a89){_0x58494f=_0x58494f-0x0;var _0x2f0783=_0x83fe[_0x58494f];return _0x2f0783;};'use strict';var _=require(_0xe83f('0x0'));var util=require(_0xe83f('0x1'));var moment=require(_0xe83f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe83f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe83f('0x4'));var logger=require(_0xe83f('0x5'))('rpc');var config=require(_0xe83f('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3fc2,_0x6a6412,_0x2b53fb){return new BPromise(function(_0x2f34a9,_0x1dab19){return client[_0xe83f('0x7')](_0x4a3fc2,_0x2b53fb)[_0xe83f('0x8')](function(_0xcc017c){logger['info'](_0xe83f('0x9'),_0x6a6412,_0xe83f('0xa'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x6a6412,'request\x20sent',JSON[_0xe83f('0xb')](_0xcc017c));if(_0xcc017c[_0xe83f('0xc')]){if(_0xcc017c['error'][_0xe83f('0xd')]===0x1f4){logger[_0xe83f('0xc')](_0xe83f('0x9'),_0x6a6412,_0xcc017c['error'][_0xe83f('0xe')]);return _0x1dab19(_0xcc017c[_0xe83f('0xc')][_0xe83f('0xe')]);}logger[_0xe83f('0xc')](_0xe83f('0x9'),_0x6a6412,_0xcc017c['error'][_0xe83f('0xe')]);return _0x2f34a9(_0xcc017c['error'][_0xe83f('0xe')]);}else{logger[_0xe83f('0xf')](_0xe83f('0x9'),_0x6a6412,_0xe83f('0xa'));_0x2f34a9(_0xcc017c[_0xe83f('0x10')][_0xe83f('0xe')]);}})['catch'](function(_0xb74a25){logger[_0xe83f('0xc')]('FaxApplication,\x20%s,\x20%s',_0x6a6412,_0xb74a25);_0x1dab19(_0xb74a25);});});}exports[_0xe83f('0x11')]=function(_0x2a2a48){var _0x48ae40=this;return new Promise(function(_0x23900c,_0x445455){return db[_0xe83f('0x12')]['update'](_0x2a2a48[_0xe83f('0x13')],{'raw':_0x2a2a48[_0xe83f('0x14')]?_0x2a2a48[_0xe83f('0x14')][_0xe83f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2a48[_0xe83f('0x14')]?_0x2a2a48[_0xe83f('0x14')][_0xe83f('0x16')]||null:null,'attributes':_0x2a2a48[_0xe83f('0x14')]?_0x2a2a48['options']['attributes']||null:null,'limit':_0x2a2a48['options']?_0x2a2a48[_0xe83f('0x14')][_0xe83f('0x17')]||null:null})[_0xe83f('0x8')](function(_0x5eefcc){logger['info']('UpdateFaxApplication',_0x2a2a48);logger[_0xe83f('0x18')]('UpdateFaxApplication',_0x2a2a48,JSON[_0xe83f('0xb')](_0x5eefcc));_0x23900c(_0x5eefcc);})['catch'](function(_0x22c623){logger[_0xe83f('0xc')](_0xe83f('0x11'),_0x22c623['message'],_0x2a2a48);_0x445455(_0x48ae40[_0xe83f('0xc')](0x1f4,_0x22c623[_0xe83f('0xe')]));});});}; \ No newline at end of file +var _0xdd05=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4329b6,_0x995f74){var _0x25cbe6=function(_0x460a5f){while(--_0x460a5f){_0x4329b6['push'](_0x4329b6['shift']());}};_0x25cbe6(++_0x995f74);}(_0xdd05,0xcb));var _0x5dd0=function(_0x4d1ce8,_0x1a778e){_0x4d1ce8=_0x4d1ce8-0x0;var _0x129384=_0xdd05[_0x4d1ce8];return _0x129384;};'use strict';var _=require(_0x5dd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5dd0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dd0('0x2'));var db=require(_0x5dd0('0x3'))['db'];var utils=require(_0x5dd0('0x4'));var logger=require(_0x5dd0('0x5'))(_0x5dd0('0x6'));var config=require(_0x5dd0('0x7'));var jayson=require(_0x5dd0('0x8'));var client=jayson[_0x5dd0('0x9')][_0x5dd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575d4b,_0x250920,_0x4a666d){return new BPromise(function(_0x2ec8e1,_0x302fdc){return client[_0x5dd0('0xb')](_0x575d4b,_0x4a666d)[_0x5dd0('0xc')](function(_0x53a540){logger[_0x5dd0('0xd')](_0x5dd0('0xe'),_0x250920,_0x5dd0('0xf'));logger['debug'](_0x5dd0('0x10'),_0x250920,_0x5dd0('0xf'),JSON[_0x5dd0('0x11')](_0x53a540));if(_0x53a540[_0x5dd0('0x12')]){if(_0x53a540[_0x5dd0('0x12')]['code']===0x1f4){logger[_0x5dd0('0x12')](_0x5dd0('0xe'),_0x250920,_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);return _0x302fdc(_0x53a540[_0x5dd0('0x12')]['message']);}logger['error'](_0x5dd0('0xe'),_0x250920,_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);return _0x2ec8e1(_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);}else{logger[_0x5dd0('0xd')](_0x5dd0('0xe'),_0x250920,_0x5dd0('0xf'));_0x2ec8e1(_0x53a540[_0x5dd0('0x14')][_0x5dd0('0x13')]);}})[_0x5dd0('0x15')](function(_0x2eed58){logger[_0x5dd0('0x12')]('FaxApplication,\x20%s,\x20%s',_0x250920,_0x2eed58);_0x302fdc(_0x2eed58);});});}exports[_0x5dd0('0x16')]=function(_0x76343a){var _0x37db81=this;return new Promise(function(_0x50420c,_0x4579db){return db[_0x5dd0('0x17')]['update'](_0x76343a['body'],{'raw':_0x76343a[_0x5dd0('0x18')]?_0x76343a['options'][_0x5dd0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x76343a['options']?_0x76343a['options']['where']||null:null,'attributes':_0x76343a[_0x5dd0('0x18')]?_0x76343a[_0x5dd0('0x18')][_0x5dd0('0x1a')]||null:null,'limit':_0x76343a[_0x5dd0('0x18')]?_0x76343a[_0x5dd0('0x18')]['limit']||null:null})[_0x5dd0('0xc')](function(_0xf8725f){logger['info'](_0x5dd0('0x16'),_0x76343a);logger['debug'](_0x5dd0('0x16'),_0x76343a,JSON['stringify'](_0xf8725f));_0x50420c(_0xf8725f);})['catch'](function(_0x4e76bd){logger[_0x5dd0('0x12')](_0x5dd0('0x16'),_0x4e76bd[_0x5dd0('0x13')],_0x76343a);_0x4579db(_0x37db81[_0x5dd0('0x12')](0x1f4,_0x4e76bd[_0x5dd0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index aaee8bb..058f0c5 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 _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0xd15ad3,_0x303230){var _0x28dfe3=function(_0x135098){while(--_0x135098){_0xd15ad3['push'](_0xd15ad3['shift']());}};_0x28dfe3(++_0x303230);}(_0x4213,0x77));var _0x3421=function(_0x507c0d,_0x1b2648){_0x507c0d=_0x507c0d-0x0;var _0x468de6=_0x4213[_0x507c0d];return _0x468de6;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x47eb27,_0x22d4fc){var _0xe8cae8=function(_0x2fd189){while(--_0x2fd189){_0x47eb27['push'](_0x47eb27['shift']());}};_0xe8cae8(++_0x22d4fc);}(_0x2032,0xd9));var _0x2203=function(_0x10e5fb,_0x380dc7){_0x10e5fb=_0x10e5fb-0x0;var _0x1a2d3e=_0x2032[_0x10e5fb];return _0x1a2d3e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 0dbbb71..c949962 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 _0x6dbe=['sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x2f1629,_0x42e29e){var _0x15d647=function(_0x161338){while(--_0x161338){_0x2f1629['push'](_0x2f1629['shift']());}};_0x15d647(++_0x42e29e);}(_0x6dbe,0x1b0));var _0xe6db=function(_0x1e9031,_0x25d9a6){_0x1e9031=_0x1e9031-0x0;var _0x5b75fc=_0x6dbe[_0x1e9031];return _0x5b75fc;};'use strict';var Sequelize=require(_0xe6db('0x0'));module[_0xe6db('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe6db('0x2')]},'disposition':{'type':Sequelize[_0xe6db('0x3')]},'secondDisposition':{'type':Sequelize[_0xe6db('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xe6db('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe6db('0x4')]('in',_0xe6db('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe6db('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe6db('0x4')]('in',_0xe6db('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3be0=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x209a3e,_0x139a0b){var _0x59d268=function(_0x42849c){while(--_0x42849c){_0x209a3e['push'](_0x209a3e['shift']());}};_0x59d268(++_0x139a0b);}(_0x3be0,0x136));var _0x03be=function(_0x47d7ec,_0x17f197){_0x47d7ec=_0x47d7ec-0x0;var _0x98674a=_0x3be0[_0x47d7ec];return _0x98674a;};'use strict';var Sequelize=require(_0x03be('0x0'));module[_0x03be('0x1')]={'closed':{'type':Sequelize[_0x03be('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x03be('0x3')]},'disposition':{'type':Sequelize[_0x03be('0x4')]},'secondDisposition':{'type':Sequelize[_0x03be('0x4')]},'thirdDisposition':{'type':Sequelize[_0x03be('0x4')]},'note':{'type':Sequelize[_0x03be('0x4')]},'read1stAt':{'type':Sequelize[_0x03be('0x3')]},'fax':{'type':Sequelize[_0x03be('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x03be('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x03be('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x03be('0x5')]('in',_0x03be('0x6')),'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 9df3edf..9152b60 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 _0x07ce=['hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','root','server','files','tmp','join','Attachment','Messages','mkdirSync','basename','createReadStream','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','Users','fullname','TagIds','Tags','split','forEach','catch','index','map','FaxInteraction','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','start','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','merge','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','show','params','rawAttributes','includeAll','include','options','create','destroy','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x07ce,0xf1));var _0xe07c=function(_0x3f5ceb,_0x12fdd8){_0x3f5ceb=_0x3f5ceb-0x0;var _0x59f5dd=_0x07ce[_0x3f5ceb];return _0x59f5dd;};'use strict';var emlformat=require(_0xe07c('0x0'));var rimraf=require(_0xe07c('0x1'));var zipdir=require(_0xe07c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe07c('0x3'));var moment=require(_0xe07c('0x4'));var BPromise=require(_0xe07c('0x5'));var Mustache=require(_0xe07c('0x6'));var util=require(_0xe07c('0x7'));var path=require(_0xe07c('0x8'));var sox=require(_0xe07c('0x9'));var csv=require(_0xe07c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe07c('0xb'));var _=require(_0xe07c('0xc'));var squel=require(_0xe07c('0xd'));var crypto=require('crypto');var jsforce=require(_0xe07c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe07c('0xa'));var querystring=require(_0xe07c('0xf'));var Papa=require(_0xe07c('0x10'));var Redis=require(_0xe07c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe07c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe07c('0x13'));var logger=require(_0xe07c('0x14'))(_0xe07c('0x15'));var utils=require('../../config/utils');var config=require(_0xe07c('0x16'));var licenseUtil=require(_0xe07c('0x17'));var db=require(_0xe07c('0x18'))['db'];config[_0xe07c('0x19')]=_[_0xe07c('0x1a')](config[_0xe07c('0x19')],{'host':_0xe07c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe07c('0x19')]));require(_0xe07c('0x1c'))['register'](socket);function respondWithStatusCode(_0x401f6a,_0x1e5544){_0x1e5544=_0x1e5544||0xcc;return function(_0xa5ca19){if(_0xa5ca19){return _0x401f6a[_0xe07c('0x1d')](_0x1e5544);}return _0x401f6a[_0xe07c('0x1e')](_0x1e5544)[_0xe07c('0x1f')]();};}function respondWithResult(_0x82df85,_0x426751){_0x426751=_0x426751||0xc8;return function(_0x2a829f){if(_0x2a829f){return _0x82df85[_0xe07c('0x1e')](_0x426751)[_0xe07c('0x20')](_0x2a829f);}};}function respondWithFilteredResult(_0x590189,_0x320b67){return function(_0x49e124){if(_0x49e124){var _0x5f23fb=typeof _0x320b67['offset']===_0xe07c('0x21')&&typeof _0x320b67[_0xe07c('0x22')]===_0xe07c('0x21');var _0x27d3b8=_0x49e124['count'];var _0x18b82f=_0x5f23fb?0x0:_0x320b67['offset'];var _0xfd6e10=_0x5f23fb?_0x49e124[_0xe07c('0x23')]:_0x320b67[_0xe07c('0x24')]+_0x320b67[_0xe07c('0x22')];var _0x52e78d;if(_0xfd6e10>=_0x27d3b8){_0xfd6e10=_0x27d3b8;_0x52e78d=0xc8;}else{_0x52e78d=0xce;}_0x590189[_0xe07c('0x1e')](_0x52e78d);return _0x590189[_0xe07c('0x25')](_0xe07c('0x26'),_0x18b82f+'-'+_0xfd6e10+'/'+_0x27d3b8)['json'](_0x49e124);}return null;};}function patchUpdates(_0x44526c){return function(_0x9ac074){try{jsonpatch[_0xe07c('0x27')](_0x9ac074,_0x44526c,!![]);}catch(_0x1e2a87){return BPromise[_0xe07c('0x28')](_0x1e2a87);}return _0x9ac074['save']();};}function saveUpdates(_0x311809,_0x138ed0){return function(_0x28d9a9){if(_0x28d9a9){return _0x28d9a9[_0xe07c('0x29')](_0x311809)[_0xe07c('0x2a')](function(_0x369664){return _0x369664;});}return null;};}function removeEntity(_0x5f3705,_0x1881f1){return function(_0x16f7ac){if(_0x16f7ac){return _0x16f7ac['destroy']()[_0xe07c('0x2a')](function(){_0x5f3705['status'](0xcc)[_0xe07c('0x1f')]();});}};}function handleEntityNotFound(_0x3f29c3,_0x56b5fe){return function(_0x2cbb62){if(!_0x2cbb62){_0x3f29c3[_0xe07c('0x1d')](0x194);}return _0x2cbb62;};}function handleError(_0x16d168,_0xf80062){_0xf80062=_0xf80062||0x1f4;return function(_0x49783f){logger[_0xe07c('0x2b')](_0x49783f[_0xe07c('0x2c')]);if(_0x49783f[_0xe07c('0x2d')]){delete _0x49783f[_0xe07c('0x2d')];}_0x16d168[_0xe07c('0x1e')](_0xf80062)['send'](_0x49783f);};}function getInteractionUsers(_0x48c9fe,_0x3a419e){return new BPromise(function(_0x5e0bb5,_0x4a2b13){try{if(_0x3a419e[_0x48c9fe['id']]){_0x48c9fe[_0xe07c('0x2e')]=_['map'](_0x3a419e[_0x48c9fe['id']],function(_0x2f1f6d){return{'id':_0x2f1f6d['id'],'fullname':_0x2f1f6d[_0xe07c('0x2f')]};});}}catch(_0xa3de3a){_0x4a2b13(_0xa3de3a);}_0x5e0bb5(_0x48c9fe);});}function getInteractionTags(_0x4566cd,_0x25ffc4){return new BPromise(function(_0x2a4543,_0x6f09fc){try{if(_0x4566cd[_0xe07c('0x30')]){_0x4566cd[_0xe07c('0x31')]=[];_0x4566cd[_0xe07c('0x30')][_0xe07c('0x32')](',')[_0xe07c('0x33')](function(_0x37d64a){_0x4566cd[_0xe07c('0x31')]['push'](_0x25ffc4[_0x37d64a]);});}delete _0x4566cd[_0xe07c('0x30')];}catch(_0x5bbe12){_0x6f09fc(_0x5bbe12);}_0x2a4543(_0x4566cd);});}function updateFaxInteraction(_0x3fc324,_0x37f6ec,_0x726b4e){return new BPromise(function(_0x428fc2,_0x4932a0){return getInteractionUsers(_0x3fc324,_0x726b4e)[_0xe07c('0x2a')](function(_0x4945b4){return getInteractionTags(_0x4945b4,_0x37f6ec);})[_0xe07c('0x2a')](function(_0x1eeb61){_0x428fc2(_0x1eeb61);})[_0xe07c('0x34')](function(_0x207838){_0x4932a0(_0x207838);});});}exports[_0xe07c('0x35')]=function(_0xa5eb26,_0x12c8e4){var _0x6c23e4={},_0x342687={},_0x380320={'count':0x0,'rows':[]};var _0x3780da=_[_0xe07c('0x36')](db[_0xe07c('0x37')]['rawAttributes'],function(_0x45bcab){return{'name':_0x45bcab[_0xe07c('0x38')],'type':_0x45bcab[_0xe07c('0x39')]['key']};});_0x342687[_0xe07c('0x3a')]=_['map'](_0x3780da,_0xe07c('0x2d'));_0x342687[_0xe07c('0x3b')]=_[_0xe07c('0x3c')](_0xa5eb26[_0xe07c('0x3b')]);_0x342687[_0xe07c('0x3d')]=_[_0xe07c('0x3e')](_0x342687[_0xe07c('0x3a')],_0x342687['query']);_0x6c23e4['attributes']=_[_0xe07c('0x3e')](_0x342687[_0xe07c('0x3a')],qs[_0xe07c('0x3f')](_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x3f')]));_0x6c23e4[_0xe07c('0x40')]=_0x6c23e4[_0xe07c('0x40')][_0xe07c('0x41')]?_0x6c23e4[_0xe07c('0x40')]:_0x342687['model'];if(!_0xa5eb26[_0xe07c('0x3b')]['hasOwnProperty'](_0xe07c('0x42'))){_0x6c23e4[_0xe07c('0x22')]=qs[_0xe07c('0x22')](_0xa5eb26[_0xe07c('0x3b')]['limit']);_0x6c23e4[_0xe07c('0x24')]=qs[_0xe07c('0x24')](_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x24')]);}_0x6c23e4[_0xe07c('0x43')]=qs['sort'](_0xa5eb26['query'][_0xe07c('0x44')]);_0x6c23e4[_0xe07c('0x45')]=qs[_0xe07c('0x3d')](_[_0xe07c('0x46')](_0xa5eb26[_0xe07c('0x3b')],_0x342687[_0xe07c('0x3d')]),_0x3780da);var _0x5e50cd=[];var _0x16ebca=squel[_0xe07c('0x47')]()[_0xe07c('0x48')]('id')[_0xe07c('0x48')]('name')[_0xe07c('0x48')](_0xe07c('0x49'))['from'](_0xe07c('0x4a'));var _0x36c5c0=squel[_0xe07c('0x47')]()['field'](_0xe07c('0x4b'))[_0xe07c('0x48')](_0xe07c('0x4c'))[_0xe07c('0x48')](_0xe07c('0x4d'))[_0xe07c('0x4e')](_0xe07c('0x4f'),'ui')['left_join'](_0xe07c('0x50'),'u',_0xe07c('0x51'));var _0x5d89cf=squel[_0xe07c('0x47')]()[_0xe07c('0x4e')](_0xe07c('0x52'),'i')[_0xe07c('0x53')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe07c('0x53')](_0xe07c('0x50'),'o',_0xe07c('0x54'))['left_join'](_0xe07c('0x55'),'a',_0xe07c('0x56'))['left_join'](_0xe07c('0x57'),'me',_0xe07c('0x58'))[_0xe07c('0x53')](_0xe07c('0x59'),'it',_0xe07c('0x5a'))[_0xe07c('0x53')]('tools_tags','t',_0xe07c('0x5b'));var _0x521491=squel[_0xe07c('0x5c')]();var _0xcbfc87=[];var _0x7a473f=squel['expr']();var _0x3cb7f9;if(_0xa5eb26['query'][_0xe07c('0x5d')]){_0x3cb7f9=as[_0xe07c('0x5e')](_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x5d')]);var _0x32132f=_0x3cb7f9[_0xe07c('0x5f')];for(var _0x14c64e=0x0;_0x14c64e<_0x3cb7f9[_0xe07c('0x60')]['length'];_0x14c64e++){var _0x598251=_0x3cb7f9[_0xe07c('0x60')][_0x14c64e];var _0x395ad7='i';var _0xfe38a3=_[_0xe07c('0x61')](_0x3780da,[_0xe07c('0x2d'),_0x598251[_0xe07c('0x48')]]);if(!_0xfe38a3){switch(_0x598251['field']){case _0xe07c('0x62'):if(_0x598251[_0xe07c('0x63')]==0x1){_0x5d89cf['having']('`'+_0x598251['field']+_0xe07c('0x64'));}else{_0x5d89cf[_0xe07c('0x65')]('`'+_0x598251[_0xe07c('0x48')]+'`\x20>\x200');}break;case _0xe07c('0x66'):if(_0x598251[_0xe07c('0x67')]===_0xe07c('0x68')){if(_0x598251[_0xe07c('0x63')][_0xe07c('0x32')]('\x20')[_0xe07c('0x41')]>0x1){_0x521491[_0x32132f](_0xe07c('0x69'),qs[_0xe07c('0x6a')](_0x598251[_0xe07c('0x63')]),null);}else{var _0x3f2783='%'+_0x598251[_0xe07c('0x63')]+'%';_0x521491[_0x32132f](_0xe07c('0x6b'),_0x3f2783,_0x3f2783,_0x3f2783);}}else{_0xfe38a3=_['find'](_0x3780da,[_0xe07c('0x2d'),'ContactId']);_0x598251[_0xe07c('0x48')]=_0xe07c('0x6c');_0x2c71a6=as['buildExpression'](_0x395ad7,_0xfe38a3[_0xe07c('0x39')],_0x598251);_0x521491[_0x32132f](_0x2c71a6[_0xe07c('0x6d')],_0x2c71a6[_0xe07c('0x63')]['start'],_0x2c71a6['value'][_0xe07c('0x1f')]);}break;case _0xe07c('0x6e'):var _0x454c2e=_0x598251[_0xe07c('0x63')]['split'](',')[_0xe07c('0x36')](function(_0x224554){return Number(_0x224554);});_0x454c2e[_0xe07c('0x33')](function(_0x157c6a){_0x7a473f['or'](_0xe07c('0x6f'),'%,'+_0x157c6a+',%');});_0xcbfc87=_[_0xe07c('0x70')](_0xcbfc87,_0x454c2e);break;case _0xe07c('0x71'):if(_0x598251[_0xe07c('0x67')]==='$substring'){_0x521491[_0x32132f](_0xe07c('0x72'),'%'+_0x598251[_0xe07c('0x63')]+'%',null);}else{_0xfe38a3=_['find'](_0x3780da,[_0xe07c('0x2d'),_0xe07c('0x73')]);_0x598251[_0xe07c('0x48')]=_0xe07c('0x73');_0x2c71a6=as[_0xe07c('0x74')](_0x395ad7,_0xfe38a3[_0xe07c('0x39')],_0x598251);_0x521491[_0x32132f](_0x2c71a6['text'],_0x2c71a6[_0xe07c('0x63')]['start'],_0x2c71a6[_0xe07c('0x63')][_0xe07c('0x1f')]);}break;case _0xe07c('0x75'):_0x2c71a6=as[_0xe07c('0x74')]('me',null,_0x598251);_0x521491[_0x32132f](_0x2c71a6[_0xe07c('0x6d')],_0x2c71a6[_0xe07c('0x63')][_0xe07c('0x76')],_0x2c71a6[_0xe07c('0x63')][_0xe07c('0x1f')]);break;}}else{var _0x2c71a6=as[_0xe07c('0x74')](_0x395ad7,_0xfe38a3[_0xe07c('0x39')],_0x598251);_0x521491[_0x32132f](_0x2c71a6['text'],_0x2c71a6[_0xe07c('0x63')][_0xe07c('0x76')],_0x2c71a6[_0xe07c('0x63')]['end']);}}}else{var _0x2edd68=_(_0xa5eb26['query'])[_0xe07c('0x3c')]()['map'](function(_0x3e94d8){return _[_0xe07c('0x77')](_0x3780da,[_0xe07c('0x2d'),_0x3e94d8])?_0x3e94d8:undefined;})[_0xe07c('0x78')]()['value']();if(!_[_0xe07c('0x79')](_0x2edd68)){_0x2edd68[_0xe07c('0x33')](function(_0x47bcd7){if(_0x47bcd7===_0xe07c('0x7a')){_0x5d89cf[_0xe07c('0x45')](_0xe07c('0x7b'),[][_0xe07c('0x7c')](_0xa5eb26[_0xe07c('0x3b')][_0x47bcd7]));}else if(_0x47bcd7===_0xe07c('0x7d')){var _0x278809=JSON[_0xe07c('0x7e')](_0xa5eb26[_0xe07c('0x3b')][_0x47bcd7])[_0xe07c('0x7f')];var _0x16530f=JSON['parse'](_0xa5eb26[_0xe07c('0x3b')][_0x47bcd7])[_0xe07c('0x80')];_0x5d89cf[_0xe07c('0x45')](_0xe07c('0x81'),_0x278809,_0x16530f);}else{if(_0xa5eb26[_0xe07c('0x3b')][_0x47bcd7]===_0xe07c('0x82')){_0x5d89cf[_0xe07c('0x45')]('i.'+_0x47bcd7+_0xe07c('0x83'));}else{_0x5d89cf[_0xe07c('0x45')]('i.'+_0x47bcd7+_0xe07c('0x84'),_0xa5eb26[_0xe07c('0x3b')][_0x47bcd7]);}}});}if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x85')]){if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x85')]==0x1){_0x5d89cf[_0xe07c('0x65')](_0xe07c('0x86'));}else{_0x5d89cf[_0xe07c('0x65')]('`unreadMessages`\x20>\x200');}}if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x87')]){_0xcbfc87=_[_0xe07c('0x88')](_0xa5eb26[_0xe07c('0x3b')]['tag'])?_0xa5eb26['query']['tag']:new Array(_0xa5eb26[_0xe07c('0x3b')]['tag']);_0xcbfc87[_0xe07c('0x33')](function(_0x48f6a9){_0x7a473f['or'](_0xe07c('0x6f'),'%,'+_0x48f6a9+',%');});}if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x89')]){var _0x3e24ff=_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x89')]['replace']('\x5c','\x5c\x5c')[_0xe07c('0x8a')](/'/g,'\x27\x27');if(qs[_0xe07c('0x8b')](_0x3e24ff)){_0x521491['or'](_0xe07c('0x8c'),_0x3e24ff+'%')['or'](_0xe07c('0x8d'),_0x3e24ff+'%');}_0x521491['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e24ff+'%');}}_0x5d89cf[_0xe07c('0x45')](_0x521491);_0x5d89cf['group']('i.id');var _0x22411a={'type':db[_0xe07c('0x8e')][_0xe07c('0x8f')][_0xe07c('0x90')],'raw':!![]};var _0x78880=_0x5d89cf[_0xe07c('0x91')]();_0x78880[_0xe07c('0x48')](_0xe07c('0x92'));_0x78880['field'](_0xe07c('0x93'),_0xe07c('0x62'));if(_0x6c23e4['order']){_0x6c23e4[_0xe07c('0x43')][_0xe07c('0x33')](function(_0x665f59){var _0x5cacfe=_0x665f59[0x0]===_0xe07c('0x94')?_0x665f59[0x0]:'i.'+_0x665f59[0x0];_0x5d89cf[_0xe07c('0x43')](_0x5cacfe,_0x665f59[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe07c('0x79')](_0xcbfc87)){_0x5d89cf['having'](_0x7a473f);_0x78880['where'](_0xe07c('0x95'),_0xcbfc87);}BPromise[_0xe07c('0x96')]()[_0xe07c('0x2a')](function(){if(!_0x3cb7f9){if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x7a')])return;_0x78880[_0xe07c('0x45')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x5d89cf[_0xe07c('0x45')](_0xe07c('0x97'));return;}if(_0xa5eb26[_0xe07c('0x98')]['role']!==_0xe07c('0x99'))return;return _0xa5eb26[_0xe07c('0x98')][_0xe07c('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e5e00){if(_[_0xe07c('0x79')](_0x1e5e00)){_0x78880[_0xe07c('0x45')](_0xe07c('0x9b'));_0x5d89cf[_0xe07c('0x45')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x78880['where'](_0xe07c('0x7b'),_[_0xe07c('0x36')](_0x1e5e00,'id'));_0x5d89cf['where'](_0xe07c('0x7b'),_[_0xe07c('0x36')](_0x1e5e00,'id'));}});})[_0xe07c('0x2a')](function(){if(_0xa5eb26[_0xe07c('0x98')][_0xe07c('0x9c')]===_0xe07c('0x99')&&!_0x3cb7f9&&!_0xa5eb26['query'][_0xe07c('0x7a')])return[];return db[_0xe07c('0x9d')][_0xe07c('0x3b')](_0x78880[_0xe07c('0x9e')](),_0x22411a);})[_0xe07c('0x2a')](function(_0x50dbc8){_0x380320[_0xe07c('0x23')]=_0x50dbc8[_0xe07c('0x41')];if(_0x380320[_0xe07c('0x23')]===0x0)return[];return db[_0xe07c('0x9d')][_0xe07c('0x3b')](_0x16ebca[_0xe07c('0x9e')](),_0x22411a)['then'](function(_0x57d921){_0x5e50cd=_['keyBy'](_0x57d921,'id');_0x22411a=_[_0xe07c('0x9f')](_0x22411a,{'model':db[_0xe07c('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa5eb26[_0xe07c('0x3b')][_0xe07c('0x3f')]){_0x6c23e4[_0xe07c('0x40')][_0xe07c('0x33')](function(_0x5f2cc7){_0x5d89cf[_0xe07c('0x48')]('i.'+_0x5f2cc7);});}else{_0x5d89cf[_0xe07c('0x48')](_0xe07c('0x93'),'unreadMessages');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa0'),'Account.key');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa1'),'Account.mandatoryDisposition');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa2'),'contactName');_0x5d89cf[_0xe07c('0x48')]('i.*');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa3'),_0xe07c('0xa4'));_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa5'),'Contact.lastName');_0x5d89cf[_0xe07c('0x48')]('c.email','Contact.email');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa6'),_0xe07c('0xa7'));_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xa8'),_0xe07c('0xa9'));_0x5d89cf[_0xe07c('0x48')]('c.fax','Contact.fax');_0x5d89cf['field'](_0xe07c('0xaa'),_0xe07c('0xab'));_0x5d89cf['field'](_0xe07c('0xac'),'Owner.internal');_0x5d89cf[_0xe07c('0x48')](_0xe07c('0xad'),_0xe07c('0x30'));}if(_0x6c23e4[_0xe07c('0x22')])_0x5d89cf[_0xe07c('0x22')](_0x6c23e4[_0xe07c('0x22')]);if(_0x6c23e4[_0xe07c('0x24')])_0x5d89cf[_0xe07c('0x24')](_0x6c23e4[_0xe07c('0x24')]);return db[_0xe07c('0x9d')][_0xe07c('0x3b')](_0x5d89cf[_0xe07c('0x9e')](),_0x22411a);})[_0xe07c('0x2a')](function(_0x55c440){if(_0x55c440[_0xe07c('0x41')]>0x0)_0x36c5c0['where'](_0xe07c('0xae'),_[_0xe07c('0x36')](_0x55c440,'id'));return db[_0xe07c('0x9d')][_0xe07c('0x3b')](_0x36c5c0[_0xe07c('0x9e')](),_0x22411a)[_0xe07c('0x2a')](function(_0x1de115){var _0x37fc11=_[_0xe07c('0xaf')](_0x1de115,'FaxInteractionId');var _0x5a2c8a=[];_0x55c440[_0xe07c('0x33')](function(_0x57a65f){_0x5a2c8a[_0xe07c('0xb0')](updateFaxInteraction(_0x57a65f,_0x5e50cd,_0x37fc11));});return BPromise[_0xe07c('0xb1')](_0x5a2c8a);});});})[_0xe07c('0x2a')](function(_0x2a2923){_0x380320['rows']=_0x2a2923;return _0x380320;})[_0xe07c('0x2a')](respondWithFilteredResult(_0x12c8e4,_0x6c23e4))['catch'](handleError(_0x12c8e4,null));};exports[_0xe07c('0xb2')]=function(_0x449fcc,_0x4fafca){var _0x2ac8ed={'raw':![],'where':{'id':_0x449fcc[_0xe07c('0xb3')]['id']}},_0xa4732={};_0xa4732[_0xe07c('0x3a')]=_[_0xe07c('0x3c')](db['FaxInteraction'][_0xe07c('0xb4')]);_0xa4732[_0xe07c('0x3b')]=_[_0xe07c('0x3c')](_0x449fcc[_0xe07c('0x3b')]);_0xa4732['filters']=_['intersection'](_0xa4732[_0xe07c('0x3a')],_0xa4732[_0xe07c('0x3b')]);_0x2ac8ed['attributes']=_[_0xe07c('0x3e')](_0xa4732[_0xe07c('0x3a')],qs['fields'](_0x449fcc[_0xe07c('0x3b')][_0xe07c('0x3f')]));_0x2ac8ed['attributes']=_0x2ac8ed[_0xe07c('0x40')][_0xe07c('0x41')]?_0x2ac8ed['attributes']:_0xa4732['model'];if(_0x449fcc['query'][_0xe07c('0xb5')]){_0x2ac8ed[_0xe07c('0xb6')]=[{'all':!![]}];}_0x2ac8ed=_[_0xe07c('0x9f')]({},_0x2ac8ed,_0x449fcc[_0xe07c('0xb7')]);return db[_0xe07c('0x37')][_0xe07c('0x61')](_0x2ac8ed)[_0xe07c('0x2a')](handleEntityNotFound(_0x4fafca,null))[_0xe07c('0x2a')](respondWithResult(_0x4fafca,null))[_0xe07c('0x34')](handleError(_0x4fafca,null));};exports[_0xe07c('0xb8')]=function(_0x30011c,_0x43c4b6){return db[_0xe07c('0x37')][_0xe07c('0xb8')](_0x30011c[_0xe07c('0x75')],{})[_0xe07c('0x2a')](respondWithResult(_0x43c4b6,0xc9))[_0xe07c('0x34')](handleError(_0x43c4b6,null));};exports[_0xe07c('0x29')]=function(_0x2cc5a1,_0x56d51a){if(_0x2cc5a1[_0xe07c('0x75')]['id']){delete _0x2cc5a1[_0xe07c('0x75')]['id'];}return db[_0xe07c('0x37')][_0xe07c('0x61')]({'where':{'id':_0x2cc5a1[_0xe07c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x56d51a,null))[_0xe07c('0x2a')](saveUpdates(_0x2cc5a1['body'],null))[_0xe07c('0x2a')](respondWithResult(_0x56d51a,null))['catch'](handleError(_0x56d51a,null));};exports[_0xe07c('0xb9')]=function(_0x4c5286,_0x380643){return db[_0xe07c('0x37')][_0xe07c('0x61')]({'where':{'id':_0x4c5286['params']['id']}})[_0xe07c('0x2a')](handleEntityNotFound(_0x380643,null))[_0xe07c('0x2a')](removeEntity(_0x380643,null))[_0xe07c('0x34')](handleError(_0x380643,null));};exports[_0xe07c('0xba')]=function(_0x50a1ab,_0x5327e9){return db[_0xe07c('0x37')][_0xe07c('0xba')]()[_0xe07c('0x2a')](respondWithResult(_0x5327e9,null))[_0xe07c('0x34')](handleError(_0x5327e9,null));};exports[_0xe07c('0xbb')]=function(_0x485021,_0x291312,_0x5763d4){return db[_0xe07c('0xbc')][_0xe07c('0x61')]({'where':{'id':_0x485021[_0xe07c('0xb3')]['id']}})[_0xe07c('0x2a')](handleEntityNotFound(_0x291312,null))[_0xe07c('0x2a')](function(_0x587ec0){if(_0x587ec0){return _0x587ec0[_0xe07c('0xbb')](_0x485021['body']['ids'],_[_0xe07c('0xbd')](_0x485021['body'],[_0xe07c('0xbe'),'id'])||{});}})[_0xe07c('0x2a')](respondWithResult(_0x291312,null))[_0xe07c('0x34')](handleError(_0x291312,null));};exports[_0xe07c('0xbf')]=function(_0x4fb54a,_0xa6664e,_0x50a9d1){var _0x34faa7={'raw':![],'where':{}};var _0x1b0e33={};var _0x1b573b={'count':0x0,'rows':[]};return db[_0xe07c('0x37')][_0xe07c('0xc0')]({'where':{'id':_0x4fb54a[_0xe07c('0xb3')]['id']}})[_0xe07c('0x2a')](handleEntityNotFound(_0xa6664e,null))[_0xe07c('0x2a')](function(_0x4d5589){if(_0x4d5589){_0x1b0e33[_0xe07c('0x3a')]=_[_0xe07c('0x3c')](db[_0xe07c('0xbc')][_0xe07c('0xb4')]);_0x1b0e33['query']=_[_0xe07c('0x3c')](_0x4fb54a['query']);_0x1b0e33[_0xe07c('0x3d')]=_[_0xe07c('0x3e')](_0x1b0e33['model'],_0x1b0e33[_0xe07c('0x3b')]);_0x34faa7[_0xe07c('0x40')]=_[_0xe07c('0x3e')](_0x1b0e33[_0xe07c('0x3a')],qs[_0xe07c('0x3f')](_0x4fb54a[_0xe07c('0x3b')]['fields']));_0x34faa7[_0xe07c('0x40')]=_0x34faa7['attributes']['length']?_0x34faa7['attributes']:_0x1b0e33[_0xe07c('0x3a')];if(!_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0xc1')](_0xe07c('0x42'))){_0x34faa7[_0xe07c('0x22')]=qs['limit'](_0x4fb54a['query'][_0xe07c('0x22')]);_0x34faa7[_0xe07c('0x24')]=qs[_0xe07c('0x24')](_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0x24')]);}_0x34faa7[_0xe07c('0x43')]=qs[_0xe07c('0x44')](_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0x44')]);_0x34faa7[_0xe07c('0x45')]=qs[_0xe07c('0x3d')](_[_0xe07c('0x46')](_0x4fb54a[_0xe07c('0x3b')],_0x1b0e33[_0xe07c('0x3d')]));_0x34faa7[_0xe07c('0x45')]['FaxInteractionId']=_0x4d5589['id'];if(_0x4fb54a['query']['filter']){_0x34faa7['where']=_['merge'](_0x34faa7[_0xe07c('0x45')],{'$or':_['map'](_0x34faa7[_0xe07c('0x40')],function(_0x50523c){var _0x2e5acc={};_0x2e5acc[_0x50523c]={'$like':'%'+_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0x89')]+'%'};return _0x2e5acc;})});}if(_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0x7f')]){var _0x3da2a7=_0x4fb54a[_0xe07c('0x3b')][_0xe07c('0x7f')]['split'](',');var _0x575032={};_0x575032[_0x3da2a7[0x0]]={'$gte':moment(_0x3da2a7[0x1])[_0xe07c('0xc2')](_0xe07c('0xc3'))};_0x34faa7[_0xe07c('0x45')]=_[_0xe07c('0x9f')](_0x34faa7[_0xe07c('0x45')],_0x575032);}_0x34faa7=_['merge']({},_0x34faa7,_0x4fb54a[_0xe07c('0xb7')]);return db['FaxMessage']['count']({'where':_0x34faa7['where']})[_0xe07c('0x2a')](function(_0x579cb0){_0x1b573b[_0xe07c('0x23')]=_0x579cb0;if(_0x4fb54a[_0xe07c('0x3b')]['includeAll']){_0x34faa7[_0xe07c('0xb6')]=[{'all':!![]}];}return db['FaxMessage'][_0xe07c('0xc4')](_0x34faa7);})[_0xe07c('0x2a')](function(_0x3a5405){_0x1b573b[_0xe07c('0xc5')]=_0x3a5405;return _0x1b573b;});}})[_0xe07c('0x2a')](respondWithFilteredResult(_0xa6664e,_0x34faa7))[_0xe07c('0x34')](handleError(_0xa6664e,null));};exports[_0xe07c('0xc6')]=function(_0x565fb4,_0x2305bd,_0x16c990){return db['FaxInteraction']['find']({'where':{'id':_0x565fb4[_0xe07c('0xb3')]['id']}})[_0xe07c('0x2a')](handleEntityNotFound(_0x2305bd,null))[_0xe07c('0x2a')](function(_0xa67645){if(_0xa67645){return _0xa67645['setTags'](_0x565fb4[_0xe07c('0x75')]['ids'],_['omit'](_0x565fb4['body'],[_0xe07c('0xbe'),'id'])||{})[_0xe07c('0xc7')](function(){return db[_0xe07c('0x6e')]['findAll']({'attributes':['id',_0xe07c('0x2d'),_0xe07c('0x49')],'where':{'id':_0x565fb4[_0xe07c('0x75')][_0xe07c('0xbe')]}});})['then'](function(_0x207927){socket[_0xe07c('0xc8')](_0xe07c('0xc9'),{'id':Number(_0x565fb4['params']['id']),'tags':_0x207927||[]});return{'id':Number(_0x565fb4[_0xe07c('0xb3')]['id']),'tags':_0x207927||[]};});}})['then'](respondWithResult(_0x2305bd,null))[_0xe07c('0x34')](handleError(_0x2305bd,null));};exports[_0xe07c('0xca')]=function(_0x2c2e5b,_0x19213a,_0x4b369c){return db[_0xe07c('0x37')][_0xe07c('0x61')]({'where':{'id':_0x2c2e5b[_0xe07c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x19213a,null))['then'](function(_0x31d2f2){if(_0x31d2f2){return _0x31d2f2[_0xe07c('0xca')](_0x2c2e5b[_0xe07c('0x3b')]['ids']);}})[_0xe07c('0x2a')](respondWithStatusCode(_0x19213a,null))[_0xe07c('0x34')](handleError(_0x19213a,null));};exports['download']=function(_0x464bb8,_0x153256){var _0x1b434f=moment()[_0xe07c('0xcb')]()['toString']();var _0x5bf0e5=path['join'](config[_0xe07c('0xcc')],_0xe07c('0xcd'),_0xe07c('0xce'),_0xe07c('0xcf'));var _0x1a578f=path[_0xe07c('0xd0')](config['root'],_0xe07c('0xcd'),_0xe07c('0xce'),'attachments');var _0x3ab29e=path[_0xe07c('0xd0')](_0x5bf0e5,_0x1b434f);var _0x1e3761=util[_0xe07c('0xc2')]('transcript-%d-%s.zip',_0x464bb8[_0xe07c('0xb3')]['id'],_0x1b434f);var _0x22245c=path[_0xe07c('0xd0')](_0x5bf0e5,_0x1e3761);var _0x4e51c9=[];_0x4e51c9[_0xe07c('0xb0')]({'model':db['Attachment'],'as':_0xe07c('0xd1'),'raw':!![]});var _0x2aaef5=[{'model':db[_0xe07c('0xbc')],'as':_0xe07c('0xd2'),'attributes':['id',_0xe07c('0x75'),'createdAt'],'include':_0x4e51c9}];return db[_0xe07c('0x37')][_0xe07c('0x61')]({'where':{'id':_0x464bb8[_0xe07c('0xb3')]['id']},'include':_0x2aaef5})[_0xe07c('0x2a')](handleEntityNotFound(_0x153256,null))[_0xe07c('0x2a')](function(_0x1d16fa){if(_0x1d16fa&&_0x1d16fa[_0xe07c('0xd2')]){var _0x5be032=_0x1d16fa['get']({'plain':!![]});fs[_0xe07c('0xd3')](_0x3ab29e);for(var _0x5e734a=0x0;_0x5e734a<_0x5be032[_0xe07c('0xd2')][_0xe07c('0x41')];_0x5e734a++){var _0x310714=_0x5be032[_0xe07c('0xd2')][_0x5e734a][_0xe07c('0xd1')];if(_0x310714){var _0x3c4604=path[_0xe07c('0xd0')](_0x1a578f,_0x310714[_0xe07c('0xd4')]);if(fs['existsSync'](_0x3c4604)){fs[_0xe07c('0xd5')](_0x3c4604)['pipe'](fs[_0xe07c('0xd6')](path[_0xe07c('0xd0')](_0x3ab29e,_0x310714[_0xe07c('0xd4')])));}}}return BPromise[_0xe07c('0x96')]()[_0xe07c('0x2a')](function(){return new BPromise(function(_0x31f458,_0x4b8264){zipdir(_0x3ab29e,{'saveTo':_0x22245c},function(_0x205f41,_0x40e772){if(_0x205f41)return _0x4b8264(_0x205f41);return _0x31f458(_0x40e772);});})[_0xe07c('0x2a')](function(){return new BPromise(function(_0x1f9b59,_0x550fe4){rimraf(_0x3ab29e,function(_0x1f4f65){if(_0x1f4f65)_0x550fe4(_0x1f4f65);return _0x1f9b59();});});})[_0xe07c('0x2a')](function(){return _0x153256['download'](_0x22245c,_0x1e3761,function(_0x434da7){if(_0x434da7){console[_0xe07c('0xd7')]('err',_0x434da7);}else{fs[_0xe07c('0xd8')](_0x22245c);}});});});}else{return _0x153256[_0xe07c('0x1d')](0xc8);}})[_0xe07c('0x34')](handleError(_0x153256,null));}; \ No newline at end of file +var _0x7ef4=['send','fullname','TagIds','split','forEach','Tags','catch','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','createdAt','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','FaxAccountId','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','join','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','json','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x7ef4,0x179));var _0x47ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7ef4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x47ef('0x0'));var rimraf=require(_0x47ef('0x1'));var zipdir=require(_0x47ef('0x2'));var jsonpatch=require(_0x47ef('0x3'));var rp=require(_0x47ef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47ef('0x5'));var path=require(_0x47ef('0x6'));var sox=require('sox');var csv=require(_0x47ef('0x7'));var ejs=require(_0x47ef('0x8'));var fs=require('fs');var fs_extra=require(_0x47ef('0x9'));var _=require(_0x47ef('0xa'));var squel=require(_0x47ef('0xb'));var crypto=require(_0x47ef('0xc'));var jsforce=require(_0x47ef('0xd'));var deskjs=require(_0x47ef('0xe'));var toCsv=require(_0x47ef('0x7'));var querystring=require(_0x47ef('0xf'));var Papa=require(_0x47ef('0x10'));var Redis=require(_0x47ef('0x11'));var authService=require(_0x47ef('0x12'));var qs=require(_0x47ef('0x13'));var as=require(_0x47ef('0x14'));var hardwareService=require(_0x47ef('0x15'));var logger=require(_0x47ef('0x16'))(_0x47ef('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x47ef('0x18'));var db=require(_0x47ef('0x19'))['db'];config[_0x47ef('0x1a')]=_['defaults'](config['redis'],{'host':_0x47ef('0x1b'),'port':0x18eb});var socket=require(_0x47ef('0x1c'))(new Redis(config[_0x47ef('0x1a')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5cbe05,_0x24d684){_0x24d684=_0x24d684||0xcc;return function(_0x4325ca){if(_0x4325ca){return _0x5cbe05['sendStatus'](_0x24d684);}return _0x5cbe05['status'](_0x24d684)['end']();};}function respondWithResult(_0x205ff7,_0x19b1e1){_0x19b1e1=_0x19b1e1||0xc8;return function(_0x1d1381){if(_0x1d1381){return _0x205ff7['status'](_0x19b1e1)[_0x47ef('0x1d')](_0x1d1381);}};}function respondWithFilteredResult(_0x3b78ea,_0x178bfd){return function(_0x4eb7ee){if(_0x4eb7ee){var _0x4df94b=typeof _0x178bfd[_0x47ef('0x1e')]===_0x47ef('0x1f')&&typeof _0x178bfd[_0x47ef('0x20')]===_0x47ef('0x1f');var _0x299e4a=_0x4eb7ee[_0x47ef('0x21')];var _0x12bdf6=_0x4df94b?0x0:_0x178bfd[_0x47ef('0x1e')];var _0x89c25c=_0x4df94b?_0x4eb7ee[_0x47ef('0x21')]:_0x178bfd[_0x47ef('0x1e')]+_0x178bfd[_0x47ef('0x20')];var _0x4528d1;if(_0x89c25c>=_0x299e4a){_0x89c25c=_0x299e4a;_0x4528d1=0xc8;}else{_0x4528d1=0xce;}_0x3b78ea[_0x47ef('0x22')](_0x4528d1);return _0x3b78ea['set']('Content-Range',_0x12bdf6+'-'+_0x89c25c+'/'+_0x299e4a)['json'](_0x4eb7ee);}return null;};}function patchUpdates(_0x44991b){return function(_0x2d367c){try{jsonpatch[_0x47ef('0x23')](_0x2d367c,_0x44991b,!![]);}catch(_0x4f978a){return BPromise[_0x47ef('0x24')](_0x4f978a);}return _0x2d367c[_0x47ef('0x25')]();};}function saveUpdates(_0x574b5c,_0x3458c6){return function(_0x281b46){if(_0x281b46){return _0x281b46[_0x47ef('0x26')](_0x574b5c)[_0x47ef('0x27')](function(_0x22ded6){return _0x22ded6;});}return null;};}function removeEntity(_0x2bc96f,_0x286942){return function(_0x47eb36){if(_0x47eb36){return _0x47eb36[_0x47ef('0x28')]()[_0x47ef('0x27')](function(){_0x2bc96f['status'](0xcc)[_0x47ef('0x29')]();});}};}function handleEntityNotFound(_0x24acdd,_0x207988){return function(_0x1ab789){if(!_0x1ab789){_0x24acdd['sendStatus'](0x194);}return _0x1ab789;};}function handleError(_0x3d7fb4,_0x35a375){_0x35a375=_0x35a375||0x1f4;return function(_0x4e38b4){logger[_0x47ef('0x2a')](_0x4e38b4[_0x47ef('0x2b')]);if(_0x4e38b4[_0x47ef('0x2c')]){delete _0x4e38b4[_0x47ef('0x2c')];}_0x3d7fb4['status'](_0x35a375)[_0x47ef('0x2d')](_0x4e38b4);};}function getInteractionUsers(_0x580eb5,_0x48ce0e){return new BPromise(function(_0x4e783b,_0x56397b){try{if(_0x48ce0e[_0x580eb5['id']]){_0x580eb5['Users']=_['map'](_0x48ce0e[_0x580eb5['id']],function(_0x13eeb8){return{'id':_0x13eeb8['id'],'fullname':_0x13eeb8[_0x47ef('0x2e')]};});}}catch(_0x56ef3a){_0x56397b(_0x56ef3a);}_0x4e783b(_0x580eb5);});}function getInteractionTags(_0x264f4d,_0x5b2ca5){return new BPromise(function(_0x275626,_0x450e3b){try{if(_0x264f4d[_0x47ef('0x2f')]){_0x264f4d['Tags']=[];_0x264f4d[_0x47ef('0x2f')][_0x47ef('0x30')](',')[_0x47ef('0x31')](function(_0x79fcf2){_0x264f4d[_0x47ef('0x32')]['push'](_0x5b2ca5[_0x79fcf2]);});}delete _0x264f4d[_0x47ef('0x2f')];}catch(_0x2d4790){_0x450e3b(_0x2d4790);}_0x275626(_0x264f4d);});}function updateFaxInteraction(_0x49a46f,_0x17fbcc,_0x4592c1){return new BPromise(function(_0x156136,_0x21bf0d){return getInteractionUsers(_0x49a46f,_0x4592c1)[_0x47ef('0x27')](function(_0x5ad040){return getInteractionTags(_0x5ad040,_0x17fbcc);})[_0x47ef('0x27')](function(_0x5e2104){_0x156136(_0x5e2104);})[_0x47ef('0x33')](function(_0x2bd465){_0x21bf0d(_0x2bd465);});});}exports[_0x47ef('0x34')]=function(_0x53d151,_0x4022fb){var _0x35a505={},_0x1dc764={},_0x1f811a={'count':0x0,'rows':[]};var _0x2f15d0=_[_0x47ef('0x35')](db['FaxInteraction'][_0x47ef('0x36')],function(_0x5f3230){return{'name':_0x5f3230[_0x47ef('0x37')],'type':_0x5f3230[_0x47ef('0x38')]['key']};});_0x1dc764[_0x47ef('0x39')]=_[_0x47ef('0x35')](_0x2f15d0,_0x47ef('0x2c'));_0x1dc764[_0x47ef('0x3a')]=_[_0x47ef('0x3b')](_0x53d151[_0x47ef('0x3a')]);_0x1dc764[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x1dc764[_0x47ef('0x39')],_0x1dc764[_0x47ef('0x3a')]);_0x35a505[_0x47ef('0x3e')]=_['intersection'](_0x1dc764['model'],qs[_0x47ef('0x3f')](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x3f')]));_0x35a505['attributes']=_0x35a505[_0x47ef('0x3e')][_0x47ef('0x40')]?_0x35a505[_0x47ef('0x3e')]:_0x1dc764['model'];if(!_0x53d151[_0x47ef('0x3a')][_0x47ef('0x41')](_0x47ef('0x42'))){_0x35a505[_0x47ef('0x20')]=qs[_0x47ef('0x20')](_0x53d151['query'][_0x47ef('0x20')]);_0x35a505[_0x47ef('0x1e')]=qs['offset'](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x1e')]);}_0x35a505[_0x47ef('0x43')]=qs['sort'](_0x53d151['query'][_0x47ef('0x44')]);_0x35a505[_0x47ef('0x45')]=qs[_0x47ef('0x3c')](_[_0x47ef('0x46')](_0x53d151[_0x47ef('0x3a')],_0x1dc764[_0x47ef('0x3c')]),_0x2f15d0);var _0x3b520c=[];var _0x474563=squel[_0x47ef('0x47')]()[_0x47ef('0x48')]('id')[_0x47ef('0x48')]('name')[_0x47ef('0x48')](_0x47ef('0x49'))[_0x47ef('0x4a')](_0x47ef('0x4b'));var _0x1dbc71=squel['select']()[_0x47ef('0x48')](_0x47ef('0x4c'))[_0x47ef('0x48')](_0x47ef('0x4d'))[_0x47ef('0x48')](_0x47ef('0x4e'))['from'](_0x47ef('0x4f'),'ui')[_0x47ef('0x50')](_0x47ef('0x51'),'u',_0x47ef('0x52'));var _0x40fd34=squel[_0x47ef('0x47')]()[_0x47ef('0x4a')]('fax_interactions','i')[_0x47ef('0x50')](_0x47ef('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x47ef('0x51'),'o',_0x47ef('0x54'))[_0x47ef('0x50')](_0x47ef('0x55'),'a',_0x47ef('0x56'))[_0x47ef('0x50')]('fax_messages','me',_0x47ef('0x57'))['left_join'](_0x47ef('0x58'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x47ef('0x50')](_0x47ef('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x230f64=squel[_0x47ef('0x59')]();var _0x587c20=[];var _0x43143f=squel['expr']();var _0x179bec;if(_0x53d151[_0x47ef('0x3a')][_0x47ef('0x5a')]){_0x179bec=as[_0x47ef('0x5b')](_0x53d151['query']['search']);var _0x27a910=_0x179bec[_0x47ef('0x5c')];for(var _0x1698fd=0x0;_0x1698fd<_0x179bec[_0x47ef('0x5d')][_0x47ef('0x40')];_0x1698fd++){var _0x1f98a4=_0x179bec[_0x47ef('0x5d')][_0x1698fd];var _0x548ec6='i';var _0x12a4f6=_['find'](_0x2f15d0,[_0x47ef('0x2c'),_0x1f98a4[_0x47ef('0x48')]]);if(!_0x12a4f6){switch(_0x1f98a4[_0x47ef('0x48')]){case _0x47ef('0x5e'):if(_0x1f98a4[_0x47ef('0x5f')]==0x1){_0x40fd34[_0x47ef('0x60')]('`'+_0x1f98a4[_0x47ef('0x48')]+_0x47ef('0x61'));}else{_0x40fd34[_0x47ef('0x60')]('`'+_0x1f98a4['field']+_0x47ef('0x62'));}break;case _0x47ef('0x63'):if(_0x1f98a4[_0x47ef('0x64')]===_0x47ef('0x65')){if(_0x1f98a4[_0x47ef('0x5f')][_0x47ef('0x30')]('\x20')[_0x47ef('0x40')]>0x1){_0x230f64[_0x27a910]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47ef('0x66')](_0x1f98a4['value']),null);}else{var _0x35e56e='%'+_0x1f98a4[_0x47ef('0x5f')]+'%';_0x230f64[_0x27a910](_0x47ef('0x67'),_0x35e56e,_0x35e56e,_0x35e56e);}}else{_0x12a4f6=_[_0x47ef('0x68')](_0x2f15d0,[_0x47ef('0x2c'),'ContactId']);_0x1f98a4[_0x47ef('0x48')]='ContactId';_0x14c33d=as['buildExpression'](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d[_0x47ef('0x69')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x6a')],_0x14c33d['value'][_0x47ef('0x29')]);}break;case _0x47ef('0x6b'):var _0x140435=_0x1f98a4[_0x47ef('0x5f')][_0x47ef('0x30')](',')[_0x47ef('0x35')](function(_0x204b97){return Number(_0x204b97);});_0x140435[_0x47ef('0x31')](function(_0x1e153f){_0x43143f['or'](_0x47ef('0x6c'),'%,'+_0x1e153f+',%');});_0x587c20=_[_0x47ef('0x6d')](_0x587c20,_0x140435);break;case _0x47ef('0x6e'):if(_0x1f98a4[_0x47ef('0x64')]==='$substring'){_0x230f64[_0x27a910](_0x47ef('0x6f'),'%'+_0x1f98a4[_0x47ef('0x5f')]+'%',null);}else{_0x12a4f6=_['find'](_0x2f15d0,[_0x47ef('0x2c'),_0x47ef('0x70')]);_0x1f98a4['field']=_0x47ef('0x70');_0x14c33d=as[_0x47ef('0x71')](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d[_0x47ef('0x69')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x29')]);}break;case _0x47ef('0x72'):_0x14c33d=as[_0x47ef('0x71')]('me',null,_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d['text'],_0x14c33d['value'][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x29')]);break;}}else{var _0x14c33d=as['buildExpression'](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d['text'],_0x14c33d['value'][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')]['end']);}}}else{var _0x1190a3=_(_0x53d151['query'])[_0x47ef('0x3b')]()[_0x47ef('0x35')](function(_0xb5659f){return _[_0x47ef('0x73')](_0x2f15d0,[_0x47ef('0x2c'),_0xb5659f])?_0xb5659f:undefined;})[_0x47ef('0x74')]()[_0x47ef('0x5f')]();if(!_[_0x47ef('0x75')](_0x1190a3)){_0x1190a3['forEach'](function(_0xc36192){if(_0xc36192==='FaxAccountId'){_0x40fd34[_0x47ef('0x45')](_0x47ef('0x76'),[]['concat'](_0x53d151[_0x47ef('0x3a')][_0xc36192]));}else if(_0xc36192===_0x47ef('0x77')){var _0x407085=JSON['parse'](_0x53d151['query'][_0xc36192])['$gte'];var _0x58671e=JSON['parse'](_0x53d151['query'][_0xc36192])['$lte'];_0x40fd34[_0x47ef('0x45')](_0x47ef('0x78'),_0x407085,_0x58671e);}else{if(_0x53d151[_0x47ef('0x3a')][_0xc36192]===_0x47ef('0x79')){_0x40fd34[_0x47ef('0x45')]('i.'+_0xc36192+'\x20IS\x20NULL');}else{_0x40fd34[_0x47ef('0x45')]('i.'+_0xc36192+_0x47ef('0x7a'),_0x53d151['query'][_0xc36192]);}}});}if(_0x53d151[_0x47ef('0x3a')]['read']){if(_0x53d151[_0x47ef('0x3a')]['read']==0x1){_0x40fd34[_0x47ef('0x60')]('`unreadMessages`\x20=\x200');}else{_0x40fd34[_0x47ef('0x60')](_0x47ef('0x7b'));}}if(_0x53d151[_0x47ef('0x3a')]['tag']){_0x587c20=_[_0x47ef('0x7c')](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7d')])?_0x53d151['query'][_0x47ef('0x7d')]:new Array(_0x53d151['query'][_0x47ef('0x7d')]);_0x587c20['forEach'](function(_0x34713d){_0x43143f['or'](_0x47ef('0x6c'),'%,'+_0x34713d+',%');});}if(_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7e')]){var _0x202c8c=_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7e')][_0x47ef('0x7f')]('\x5c','\x5c\x5c')[_0x47ef('0x7f')](/'/g,'\x27\x27');if(qs[_0x47ef('0x80')](_0x202c8c)){_0x230f64['or'](_0x47ef('0x81'),_0x202c8c+'%')['or'](_0x47ef('0x82'),_0x202c8c+'%');}_0x230f64['or'](_0x47ef('0x83'),_0x202c8c+'%');}}_0x40fd34[_0x47ef('0x45')](_0x230f64);_0x40fd34[_0x47ef('0x84')]('i.id');var _0x335466={'type':db[_0x47ef('0x85')][_0x47ef('0x86')][_0x47ef('0x87')],'raw':!![]};var _0x2c0357=_0x40fd34[_0x47ef('0x88')]();_0x2c0357[_0x47ef('0x48')]('i.id');_0x2c0357[_0x47ef('0x48')](_0x47ef('0x89'),_0x47ef('0x5e'));if(_0x35a505['order']){_0x35a505['order'][_0x47ef('0x31')](function(_0x11df04){var _0x692aa9=_0x11df04[0x0]===_0x47ef('0x8a')?_0x11df04[0x0]:'i.'+_0x11df04[0x0];_0x40fd34[_0x47ef('0x43')](_0x692aa9,_0x11df04[0x1]===_0x47ef('0x8b')?![]:!![]);});}if(!_[_0x47ef('0x75')](_0x587c20)){_0x40fd34[_0x47ef('0x60')](_0x43143f);_0x2c0357['where'](_0x47ef('0x8c'),_0x587c20);}BPromise[_0x47ef('0x8d')]()[_0x47ef('0x27')](function(){if(!_0x179bec){if(_0x53d151[_0x47ef('0x3a')]['FaxAccountId'])return;_0x2c0357[_0x47ef('0x45')](_0x47ef('0x8e'));_0x40fd34[_0x47ef('0x45')](_0x47ef('0x8e'));return;}if(_0x53d151[_0x47ef('0x8f')][_0x47ef('0x90')]!==_0x47ef('0x91'))return;return _0x53d151[_0x47ef('0x8f')][_0x47ef('0x92')]({'attributes':['id'],'raw':!![]})[_0x47ef('0x27')](function(_0x10960c){if(_[_0x47ef('0x75')](_0x10960c)){_0x2c0357[_0x47ef('0x45')](_0x47ef('0x93'));_0x40fd34[_0x47ef('0x45')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x2c0357[_0x47ef('0x45')](_0x47ef('0x76'),_[_0x47ef('0x35')](_0x10960c,'id'));_0x40fd34[_0x47ef('0x45')](_0x47ef('0x76'),_[_0x47ef('0x35')](_0x10960c,'id'));}});})['then'](function(){if(_0x53d151[_0x47ef('0x8f')]['role']===_0x47ef('0x91')&&!_0x179bec&&!_0x53d151['query'][_0x47ef('0x94')])return[];return db[_0x47ef('0x95')][_0x47ef('0x3a')](_0x2c0357[_0x47ef('0x96')](),_0x335466);})[_0x47ef('0x27')](function(_0x94c48c){_0x1f811a[_0x47ef('0x21')]=_0x94c48c[_0x47ef('0x40')];if(_0x1f811a['count']===0x0)return[];return db[_0x47ef('0x95')]['query'](_0x474563[_0x47ef('0x96')](),_0x335466)[_0x47ef('0x27')](function(_0x268b3b){_0x3b520c=_[_0x47ef('0x97')](_0x268b3b,'id');_0x335466=_[_0x47ef('0x98')](_0x335466,{'model':db[_0x47ef('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53d151['query'][_0x47ef('0x3f')]){_0x35a505[_0x47ef('0x3e')]['forEach'](function(_0x4585d9){_0x40fd34[_0x47ef('0x48')]('i.'+_0x4585d9);});}else{_0x40fd34[_0x47ef('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47ef('0x5e'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0x9a'),_0x47ef('0x9b'));_0x40fd34['field'](_0x47ef('0x9c'),_0x47ef('0x9d'));_0x40fd34[_0x47ef('0x48')]('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',_0x47ef('0x8a'));_0x40fd34[_0x47ef('0x48')]('i.*');_0x40fd34[_0x47ef('0x48')](_0x47ef('0x9e'),_0x47ef('0x9f'));_0x40fd34['field'](_0x47ef('0xa0'),'Contact.lastName');_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa1'),_0x47ef('0xa2'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa3'),'Contact.phone');_0x40fd34[_0x47ef('0x48')]('c.mobile','Contact.mobile');_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa4'),_0x47ef('0xa5'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa6'),_0x47ef('0xa7'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa8'),'Owner.internal');_0x40fd34[_0x47ef('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x47ef('0x2f'));}if(_0x35a505[_0x47ef('0x20')])_0x40fd34[_0x47ef('0x20')](_0x35a505[_0x47ef('0x20')]);if(_0x35a505[_0x47ef('0x1e')])_0x40fd34[_0x47ef('0x1e')](_0x35a505[_0x47ef('0x1e')]);return db['sequelize'][_0x47ef('0x3a')](_0x40fd34[_0x47ef('0x96')](),_0x335466);})[_0x47ef('0x27')](function(_0xe90d89){if(_0xe90d89[_0x47ef('0x40')]>0x0)_0x1dbc71[_0x47ef('0x45')](_0x47ef('0xa9'),_[_0x47ef('0x35')](_0xe90d89,'id'));return db['sequelize']['query'](_0x1dbc71[_0x47ef('0x96')](),_0x335466)[_0x47ef('0x27')](function(_0x2954b9){var _0x57ed79=_[_0x47ef('0xaa')](_0x2954b9,'FaxInteractionId');var _0x460b15=[];_0xe90d89[_0x47ef('0x31')](function(_0x1ab1f1){_0x460b15[_0x47ef('0xab')](updateFaxInteraction(_0x1ab1f1,_0x3b520c,_0x57ed79));});return BPromise[_0x47ef('0xac')](_0x460b15);});});})[_0x47ef('0x27')](function(_0x5269b9){_0x1f811a[_0x47ef('0xad')]=_0x5269b9;return _0x1f811a;})['then'](respondWithFilteredResult(_0x4022fb,_0x35a505))[_0x47ef('0x33')](handleError(_0x4022fb,null));};exports[_0x47ef('0xae')]=function(_0x5e4baf,_0x3d0edd){var _0x851623={'raw':![],'where':{'id':_0x5e4baf[_0x47ef('0xaf')]['id']}},_0x41687e={};_0x41687e[_0x47ef('0x39')]=_[_0x47ef('0x3b')](db[_0x47ef('0x99')][_0x47ef('0x36')]);_0x41687e['query']=_[_0x47ef('0x3b')](_0x5e4baf[_0x47ef('0x3a')]);_0x41687e[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x41687e[_0x47ef('0x39')],_0x41687e['query']);_0x851623[_0x47ef('0x3e')]=_['intersection'](_0x41687e[_0x47ef('0x39')],qs[_0x47ef('0x3f')](_0x5e4baf['query']['fields']));_0x851623[_0x47ef('0x3e')]=_0x851623[_0x47ef('0x3e')]['length']?_0x851623['attributes']:_0x41687e[_0x47ef('0x39')];if(_0x5e4baf[_0x47ef('0x3a')][_0x47ef('0xb0')]){_0x851623[_0x47ef('0xb1')]=[{'all':!![]}];}_0x851623=_[_0x47ef('0x98')]({},_0x851623,_0x5e4baf[_0x47ef('0xb2')]);return db[_0x47ef('0x99')][_0x47ef('0x68')](_0x851623)[_0x47ef('0x27')](handleEntityNotFound(_0x3d0edd,null))[_0x47ef('0x27')](respondWithResult(_0x3d0edd,null))[_0x47ef('0x33')](handleError(_0x3d0edd,null));};exports[_0x47ef('0xb3')]=function(_0x5cbaa2,_0xd1026f){return db[_0x47ef('0x99')][_0x47ef('0xb3')](_0x5cbaa2['body'],{})['then'](respondWithResult(_0xd1026f,0xc9))['catch'](handleError(_0xd1026f,null));};exports['update']=function(_0x33cd19,_0x5c71eb){if(_0x33cd19[_0x47ef('0x72')]['id']){delete _0x33cd19[_0x47ef('0x72')]['id'];}return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x33cd19[_0x47ef('0xaf')]['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x5c71eb,null))[_0x47ef('0x27')](saveUpdates(_0x33cd19[_0x47ef('0x72')],null))['then'](respondWithResult(_0x5c71eb,null))['catch'](handleError(_0x5c71eb,null));};exports[_0x47ef('0x28')]=function(_0x1a103d,_0x1863c0){return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x1a103d[_0x47ef('0xaf')]['id']}})['then'](handleEntityNotFound(_0x1863c0,null))[_0x47ef('0x27')](removeEntity(_0x1863c0,null))[_0x47ef('0x33')](handleError(_0x1863c0,null));};exports[_0x47ef('0xb4')]=function(_0x44c733,_0x46c4f1){return db[_0x47ef('0x99')][_0x47ef('0xb4')]()[_0x47ef('0x27')](respondWithResult(_0x46c4f1,null))[_0x47ef('0x33')](handleError(_0x46c4f1,null));};exports[_0x47ef('0xb5')]=function(_0x89b8e5,_0x38fe44,_0x3f29f3){return db[_0x47ef('0xb6')][_0x47ef('0x68')]({'where':{'id':_0x89b8e5[_0x47ef('0xaf')]['id']}})['then'](handleEntityNotFound(_0x38fe44,null))[_0x47ef('0x27')](function(_0xce441c){if(_0xce441c){return _0xce441c[_0x47ef('0xb5')](_0x89b8e5[_0x47ef('0x72')][_0x47ef('0xb7')],_[_0x47ef('0xb8')](_0x89b8e5['body'],[_0x47ef('0xb7'),'id'])||{});}})[_0x47ef('0x27')](respondWithResult(_0x38fe44,null))[_0x47ef('0x33')](handleError(_0x38fe44,null));};exports['getMessages']=function(_0x16fb20,_0x10d462,_0x109a21){var _0x53bde7={'raw':![],'where':{}};var _0x56df13={};var _0x4f3ad9={'count':0x0,'rows':[]};return db[_0x47ef('0x99')]['findOne']({'where':{'id':_0x16fb20['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x10d462,null))[_0x47ef('0x27')](function(_0x25cb9d){if(_0x25cb9d){_0x56df13['model']=_[_0x47ef('0x3b')](db[_0x47ef('0xb6')]['rawAttributes']);_0x56df13[_0x47ef('0x3a')]=_[_0x47ef('0x3b')](_0x16fb20['query']);_0x56df13[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x56df13[_0x47ef('0x39')],_0x56df13['query']);_0x53bde7['attributes']=_[_0x47ef('0x3d')](_0x56df13[_0x47ef('0x39')],qs[_0x47ef('0x3f')](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x3f')]));_0x53bde7['attributes']=_0x53bde7[_0x47ef('0x3e')]['length']?_0x53bde7[_0x47ef('0x3e')]:_0x56df13[_0x47ef('0x39')];if(!_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x41')](_0x47ef('0x42'))){_0x53bde7[_0x47ef('0x20')]=qs[_0x47ef('0x20')](_0x16fb20['query'][_0x47ef('0x20')]);_0x53bde7[_0x47ef('0x1e')]=qs['offset'](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x1e')]);}_0x53bde7[_0x47ef('0x43')]=qs[_0x47ef('0x44')](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x44')]);_0x53bde7['where']=qs[_0x47ef('0x3c')](_['pick'](_0x16fb20[_0x47ef('0x3a')],_0x56df13[_0x47ef('0x3c')]));_0x53bde7[_0x47ef('0x45')][_0x47ef('0xb9')]=_0x25cb9d['id'];if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x7e')]){_0x53bde7['where']=_[_0x47ef('0x98')](_0x53bde7['where'],{'$or':_[_0x47ef('0x35')](_0x53bde7['attributes'],function(_0x3c62f2){var _0x60decd={};_0x60decd[_0x3c62f2]={'$like':'%'+_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x7e')]+'%'};return _0x60decd;})});}if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xba')]){var _0x2a7187=_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xba')]['split'](',');var _0x2336d0={};_0x2336d0[_0x2a7187[0x0]]={'$gte':moment(_0x2a7187[0x1])[_0x47ef('0xbb')](_0x47ef('0xbc'))};_0x53bde7[_0x47ef('0x45')]=_[_0x47ef('0x98')](_0x53bde7['where'],_0x2336d0);}_0x53bde7=_['merge']({},_0x53bde7,_0x16fb20['options']);return db['FaxMessage'][_0x47ef('0x21')]({'where':_0x53bde7['where']})[_0x47ef('0x27')](function(_0xcdc6a8){_0x4f3ad9[_0x47ef('0x21')]=_0xcdc6a8;if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xb0')]){_0x53bde7[_0x47ef('0xb1')]=[{'all':!![]}];}return db[_0x47ef('0xb6')][_0x47ef('0xbd')](_0x53bde7);})['then'](function(_0x26f2c9){_0x4f3ad9[_0x47ef('0xad')]=_0x26f2c9;return _0x4f3ad9;});}})['then'](respondWithFilteredResult(_0x10d462,_0x53bde7))[_0x47ef('0x33')](handleError(_0x10d462,null));};exports['addTags']=function(_0x88e13a,_0x11538b,_0x51c551){return db['FaxInteraction'][_0x47ef('0x68')]({'where':{'id':_0x88e13a['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x11538b,null))['then'](function(_0x23ee35){if(_0x23ee35){return _0x23ee35['setTags'](_0x88e13a[_0x47ef('0x72')][_0x47ef('0xb7')],_[_0x47ef('0xb8')](_0x88e13a[_0x47ef('0x72')],[_0x47ef('0xb7'),'id'])||{})[_0x47ef('0xbe')](function(){return db[_0x47ef('0x6b')][_0x47ef('0xbd')]({'attributes':['id','name',_0x47ef('0x49')],'where':{'id':_0x88e13a['body'][_0x47ef('0xb7')]}});})[_0x47ef('0x27')](function(_0x1aa953){socket[_0x47ef('0xbf')](_0x47ef('0xc0'),{'id':Number(_0x88e13a[_0x47ef('0xaf')]['id']),'tags':_0x1aa953||[]});return{'id':Number(_0x88e13a['params']['id']),'tags':_0x1aa953||[]};});}})[_0x47ef('0x27')](respondWithResult(_0x11538b,null))['catch'](handleError(_0x11538b,null));};exports[_0x47ef('0xc1')]=function(_0x359150,_0x5196ed,_0x5cc439){return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x359150['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x5196ed,null))['then'](function(_0x56ea9d){if(_0x56ea9d){return _0x56ea9d['removeTags'](_0x359150['query']['ids']);}})[_0x47ef('0x27')](respondWithStatusCode(_0x5196ed,null))[_0x47ef('0x33')](handleError(_0x5196ed,null));};exports[_0x47ef('0xc2')]=function(_0x511bee,_0x4c7ebc){var _0x7c3e07=moment()[_0x47ef('0xc3')]()[_0x47ef('0x96')]();var _0x2b5813=path['join'](config[_0x47ef('0xc4')],_0x47ef('0xc5'),_0x47ef('0xc6'),'tmp');var _0x169441=path[_0x47ef('0xc7')](config['root'],_0x47ef('0xc5'),_0x47ef('0xc6'),'attachments');var _0x48019a=path[_0x47ef('0xc7')](_0x2b5813,_0x7c3e07);var _0x577767=util[_0x47ef('0xbb')](_0x47ef('0xc8'),_0x511bee[_0x47ef('0xaf')]['id'],_0x7c3e07);var _0x5cfaa9=path[_0x47ef('0xc7')](_0x2b5813,_0x577767);var _0x9196c9=[];_0x9196c9[_0x47ef('0xab')]({'model':db['Attachment'],'as':_0x47ef('0xc9'),'raw':!![]});var _0x6fd94e=[{'model':db[_0x47ef('0xb6')],'as':_0x47ef('0xca'),'attributes':['id',_0x47ef('0x72'),_0x47ef('0x77')],'include':_0x9196c9}];return db[_0x47ef('0x99')]['find']({'where':{'id':_0x511bee[_0x47ef('0xaf')]['id']},'include':_0x6fd94e})['then'](handleEntityNotFound(_0x4c7ebc,null))[_0x47ef('0x27')](function(_0x176aa7){if(_0x176aa7&&_0x176aa7['Messages']){var _0x2ee782=_0x176aa7['get']({'plain':!![]});fs[_0x47ef('0xcb')](_0x48019a);for(var _0x1e6111=0x0;_0x1e6111<_0x2ee782['Messages'][_0x47ef('0x40')];_0x1e6111++){var _0x4d08e1=_0x2ee782[_0x47ef('0xca')][_0x1e6111]['Attachment'];if(_0x4d08e1){var _0x13717f=path[_0x47ef('0xc7')](_0x169441,_0x4d08e1[_0x47ef('0xcc')]);if(fs['existsSync'](_0x13717f)){fs[_0x47ef('0xcd')](_0x13717f)[_0x47ef('0xce')](fs['createWriteStream'](path[_0x47ef('0xc7')](_0x48019a,_0x4d08e1[_0x47ef('0xcc')])));}}}return BPromise[_0x47ef('0x8d')]()[_0x47ef('0x27')](function(){return new BPromise(function(_0xf307e6,_0x19b884){zipdir(_0x48019a,{'saveTo':_0x5cfaa9},function(_0x327d4a,_0x3e3b6e){if(_0x327d4a)return _0x19b884(_0x327d4a);return _0xf307e6(_0x3e3b6e);});})[_0x47ef('0x27')](function(){return new BPromise(function(_0x134252,_0x5ede2e){rimraf(_0x48019a,function(_0x3b1273){if(_0x3b1273)_0x5ede2e(_0x3b1273);return _0x134252();});});})['then'](function(){return _0x4c7ebc[_0x47ef('0xc2')](_0x5cfaa9,_0x577767,function(_0x404bff){if(_0x404bff){console[_0x47ef('0xcf')](_0x47ef('0xd0'),_0x404bff);}else{fs[_0x47ef('0xd1')](_0x5cfaa9);}});});});}else{return _0x4c7ebc[_0x47ef('0xd2')](0xc8);}})['catch'](handleError(_0x4c7ebc,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c08f673..a389f5a 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 _0x61fe=['setMaxListeners','save','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x61fe,0xce));var _0xe61f=function(_0x1e258f,_0x4dee7f){_0x1e258f=_0x1e258f-0x0;var _0x2cb83b=_0x61fe[_0x1e258f];return _0x2cb83b;};'use strict';var EventEmitter=require(_0xe61f('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xe61f('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe61f('0x2')](0x0);var events={'afterCreate':_0xe61f('0x3'),'afterUpdate':_0xe61f('0x4'),'afterDestroy':_0xe61f('0x5')};function emitEvent(_0x416d5b){return function(_0x46a848,_0x7dda15,_0x4593d5){_0x46a848['getUsers']({'attributes':['id'],'raw':!![]})[_0xe61f('0x6')](function(_0x12225a){_0x46a848['setDataValue']('Users',_0x12225a[_0xe61f('0x7')](function(_0x126c7a){return{'id':_0x126c7a['id']};}));return FaxMessage[_0xe61f('0x8')]({'where':{'FaxInteractionId':_0x46a848['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe61f('0x6')](function(_0x3ca3d8){_0x46a848[_0xe61f('0x9')](_0xe61f('0xa'),_0x3ca3d8[_0xe61f('0xb')]);FaxInteractionEvents[_0xe61f('0xc')](_0x416d5b+':'+_0x46a848['id'],_0x46a848);FaxInteractionEvents['emit'](_0x416d5b,_0x46a848);_0x4593d5(null);})['catch'](_0x4593d5(null));};}for(var e in events){if(events[_0xe61f('0xd')](e)){var event=events[e];FaxInteraction[_0xe61f('0xe')](e,emitEvent(event));}}module[_0xe61f('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x8fdf=['length','emit','catch','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','Users','findAll','setDataValue','unreadMessages'];(function(_0x36cef1,_0x140a7c){var _0x1d333d=function(_0x51a4c4){while(--_0x51a4c4){_0x36cef1['push'](_0x36cef1['shift']());}};_0x1d333d(++_0x140a7c);}(_0x8fdf,0x1f4));var _0xf8fd=function(_0x1d66c2,_0x1167e2){_0x1d66c2=_0x1d66c2-0x0;var _0x4c443c=_0x8fdf[_0x1d66c2];return _0x4c443c;};'use strict';var EventEmitter=require(_0xf8fd('0x0'));var FaxInteraction=require(_0xf8fd('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xf8fd('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf8fd('0x2')](0x0);var events={'afterCreate':_0xf8fd('0x3'),'afterUpdate':_0xf8fd('0x4'),'afterDestroy':_0xf8fd('0x5')};function emitEvent(_0x38a245){return function(_0x145a2d,_0x7bd052,_0x1987a4){_0x145a2d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x518d17){_0x145a2d['setDataValue'](_0xf8fd('0x6'),_0x518d17['map'](function(_0x1bb1e6){return{'id':_0x1bb1e6['id']};}));return FaxMessage[_0xf8fd('0x7')]({'where':{'FaxInteractionId':_0x145a2d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xde5c5e){_0x145a2d[_0xf8fd('0x8')](_0xf8fd('0x9'),_0xde5c5e[_0xf8fd('0xa')]);FaxInteractionEvents[_0xf8fd('0xb')](_0x38a245+':'+_0x145a2d['id'],_0x145a2d);FaxInteractionEvents[_0xf8fd('0xb')](_0x38a245,_0x145a2d);_0x1987a4(null);})[_0xf8fd('0xc')](_0x1987a4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf8fd('0xd')](e,emitEvent(event));}}module[_0xf8fd('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 7330634..f386f72 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 _0x96d4=['api','moment','request-promise','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x36513d,_0x21c4b2){var _0x519f13=function(_0x52a708){while(--_0x52a708){_0x36513d['push'](_0x36513d['shift']());}};_0x519f13(++_0x21c4b2);}(_0x96d4,0x18d));var _0x496d=function(_0x262eb0,_0x5a84a7){_0x262eb0=_0x262eb0-0x0;var _0x37cf9f=_0x96d4[_0x262eb0];return _0x37cf9f;};'use strict';var _=require(_0x496d('0x0'));var util=require(_0x496d('0x1'));var logger=require(_0x496d('0x2'))(_0x496d('0x3'));var moment=require(_0x496d('0x4'));var BPromise=require('bluebird');var rp=require(_0x496d('0x5'));var fs=require('fs');var path=require(_0x496d('0x6'));var rimraf=require(_0x496d('0x7'));var config=require(_0x496d('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x21fd55,_0x5ab625){return _0x21fd55[_0x496d('0x9')](_0x496d('0xa'),attributes,{'tableName':_0x496d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42f126,_0x141d1c,_0x17ff9f){if(_0x42f126[_0x496d('0xc')](_0x496d('0xd'))){_0x42f126[_0x496d('0xe')]=moment()[_0x496d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x17ff9f(null,_0x42f126);}}});}; \ No newline at end of file +var _0x242c=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2f60f5,_0xcbf7cb){var _0x28ec03=function(_0x54928a){while(--_0x54928a){_0x2f60f5['push'](_0x2f60f5['shift']());}};_0x28ec03(++_0xcbf7cb);}(_0x242c,0xfb));var _0xc242=function(_0x275983,_0x2e8bb0){_0x275983=_0x275983-0x0;var _0x234332=_0x242c[_0x275983];return _0x234332;};'use strict';var _=require(_0xc242('0x0'));var util=require(_0xc242('0x1'));var logger=require(_0xc242('0x2'))(_0xc242('0x3'));var moment=require(_0xc242('0x4'));var BPromise=require('bluebird');var rp=require(_0xc242('0x5'));var fs=require('fs');var path=require(_0xc242('0x6'));var rimraf=require(_0xc242('0x7'));var config=require(_0xc242('0x8'));var attributes=require(_0xc242('0x9'));module['exports']=function(_0x143325,_0x1cc0cd){return _0x143325[_0xc242('0xa')](_0xc242('0xb'),attributes,{'tableName':_0xc242('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3374e9,_0x47f994,_0x4d8087){if(_0x3374e9[_0xc242('0xd')](_0xc242('0xe'))){_0x3374e9[_0xc242('0xf')]=moment()[_0xc242('0x10')](_0xc242('0x11'));}_0x4d8087(null,_0x3374e9);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index f2de227..86b897e 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 _0x022b=['attributes','limit','catch','AddTagsToFaxInteraction','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','body','options','raw','where'];(function(_0x6f6f18,_0x406aee){var _0x57c18c=function(_0x289369){while(--_0x289369){_0x6f6f18['push'](_0x6f6f18['shift']());}};_0x57c18c(++_0x406aee);}(_0x022b,0x127));var _0xb022=function(_0x449761,_0x4e521c){_0x449761=_0x449761-0x0;var _0x39730a=_0x022b[_0x449761];return _0x39730a;};'use strict';var _=require(_0xb022('0x0'));var util=require(_0xb022('0x1'));var moment=require(_0xb022('0x2'));var BPromise=require(_0xb022('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb022('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb022('0x5'));var logger=require('../../config/logger')(_0xb022('0x6'));var config=require(_0xb022('0x7'));var jayson=require(_0xb022('0x8'));var client=jayson[_0xb022('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb022('0xa'),'port':0x18eb});var socket=require(_0xb022('0xb'))(new Redis(config[_0xb022('0xc')]));require(_0xb022('0xd'))[_0xb022('0xe')](socket);function respondWithRpcPromise(_0x3179c9,_0x3acb05,_0x4da426){return new BPromise(function(_0x485e3b,_0x566c39){return client[_0xb022('0xf')](_0x3179c9,_0x4da426)[_0xb022('0x10')](function(_0x34881d){logger[_0xb022('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x3acb05,_0xb022('0x12'));logger[_0xb022('0x13')](_0xb022('0x14'),_0x3acb05,_0xb022('0x12'),JSON[_0xb022('0x15')](_0x34881d));if(_0x34881d['error']){if(_0x34881d[_0xb022('0x16')][_0xb022('0x17')]===0x1f4){logger[_0xb022('0x16')](_0xb022('0x18'),_0x3acb05,_0x34881d['error'][_0xb022('0x19')]);return _0x566c39(_0x34881d[_0xb022('0x16')][_0xb022('0x19')]);}logger[_0xb022('0x16')](_0xb022('0x18'),_0x3acb05,_0x34881d[_0xb022('0x16')][_0xb022('0x19')]);return _0x485e3b(_0x34881d['error'][_0xb022('0x19')]);}else{logger[_0xb022('0x11')](_0xb022('0x18'),_0x3acb05,_0xb022('0x12'));_0x485e3b(_0x34881d[_0xb022('0x1a')][_0xb022('0x19')]);}})['catch'](function(_0x35189b){logger[_0xb022('0x16')](_0xb022('0x18'),_0x3acb05,_0x35189b);_0x566c39(_0x35189b);});});}exports[_0xb022('0x1b')]=function(_0x414f87){var _0x361674=this;return new Promise(function(_0x229ff9,_0x5ed0cd){return db[_0xb022('0x1c')]['update'](_0x414f87[_0xb022('0x1d')],{'raw':_0x414f87[_0xb022('0x1e')]?_0x414f87[_0xb022('0x1e')][_0xb022('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414f87[_0xb022('0x1e')]?_0x414f87[_0xb022('0x1e')][_0xb022('0x20')]||null:null,'attributes':_0x414f87[_0xb022('0x1e')]?_0x414f87[_0xb022('0x1e')][_0xb022('0x21')]||null:null,'limit':_0x414f87[_0xb022('0x1e')]?_0x414f87[_0xb022('0x1e')][_0xb022('0x22')]||null:null})[_0xb022('0x10')](function(_0x3dbf10){logger[_0xb022('0x11')](_0xb022('0x1b'),_0x414f87);logger[_0xb022('0x13')](_0xb022('0x1b'),_0x414f87,JSON[_0xb022('0x15')](_0x3dbf10));_0x229ff9(_0x3dbf10);})[_0xb022('0x23')](function(_0x42bef3){logger[_0xb022('0x16')](_0xb022('0x1b'),_0x42bef3['message'],_0x414f87);_0x5ed0cd(_0x361674['error'](0x1f4,_0x42bef3[_0xb022('0x19')]));});});};exports[_0xb022('0x24')]=function(_0x2a6e92){return new Promise(function(_0x5b4387,_0xce6e6c){return db[_0xb022('0x1c')]['find']({'where':_0x2a6e92['options']?_0x2a6e92[_0xb022('0x1e')][_0xb022('0x20')]||null:null})['then'](function(_0x4f6e48){if(_0x4f6e48){return _0x4f6e48[_0xb022('0x25')](_0x2a6e92['body'][_0xb022('0x26')],_[_0xb022('0x27')](_0x2a6e92[_0xb022('0x1d')],[_0xb022('0x26'),'id'])||{});}})['spread'](function(_0x4e7f38){logger['info']('AddTags',_0x2a6e92);logger[_0xb022('0x13')](_0xb022('0x28'),_0x2a6e92,JSON['stringify'](_0x4e7f38));_0x5b4387(_0x4e7f38);})[_0xb022('0x23')](function(_0x3d1c0c){logger[_0xb022('0x16')](_0xb022('0x28'),_0x3d1c0c[_0xb022('0x19')],_0x2a6e92);_0xce6e6c(_this['error'](0x1f4,_0x3d1c0c['message']));});});}; \ No newline at end of file +var _0x0deb=['client','http','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','AddTagsToFaxInteraction','find','where','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x0deb,0x8c));var _0xb0de=function(_0x2490c1,_0x5ebf4d){_0x2490c1=_0x2490c1-0x0;var _0x5b140b=_0x0deb[_0x2490c1];return _0x5b140b;};'use strict';var _=require(_0xb0de('0x0'));var util=require(_0xb0de('0x1'));var moment=require(_0xb0de('0x2'));var BPromise=require(_0xb0de('0x3'));var rs=require(_0xb0de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0de('0x5'));var logger=require(_0xb0de('0x6'))('rpc');var config=require(_0xb0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb0de('0x8')][_0xb0de('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb0de('0xa'),'port':0x18eb});var socket=require(_0xb0de('0xb'))(new Redis(config['redis']));require(_0xb0de('0xc'))[_0xb0de('0xd')](socket);function respondWithRpcPromise(_0x429e96,_0x550556,_0x405514){return new BPromise(function(_0x33afa8,_0x5682c7){return client[_0xb0de('0xe')](_0x429e96,_0x405514)[_0xb0de('0xf')](function(_0xa0b5bf){logger[_0xb0de('0x10')](_0xb0de('0x11'),_0x550556,'request\x20sent');logger[_0xb0de('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x550556,_0xb0de('0x13'),JSON[_0xb0de('0x14')](_0xa0b5bf));if(_0xa0b5bf[_0xb0de('0x15')]){if(_0xa0b5bf[_0xb0de('0x15')]['code']===0x1f4){logger[_0xb0de('0x15')](_0xb0de('0x11'),_0x550556,_0xa0b5bf['error'][_0xb0de('0x16')]);return _0x5682c7(_0xa0b5bf[_0xb0de('0x15')][_0xb0de('0x16')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x550556,_0xa0b5bf[_0xb0de('0x15')][_0xb0de('0x16')]);return _0x33afa8(_0xa0b5bf['error'][_0xb0de('0x16')]);}else{logger[_0xb0de('0x10')](_0xb0de('0x11'),_0x550556,_0xb0de('0x13'));_0x33afa8(_0xa0b5bf['result'][_0xb0de('0x16')]);}})[_0xb0de('0x17')](function(_0x35d4a7){logger[_0xb0de('0x15')](_0xb0de('0x11'),_0x550556,_0x35d4a7);_0x5682c7(_0x35d4a7);});});}exports[_0xb0de('0x18')]=function(_0x51c3d9){var _0x346f10=this;return new Promise(function(_0x31f8fc,_0x237a9b){return db[_0xb0de('0x19')][_0xb0de('0x1a')](_0x51c3d9[_0xb0de('0x1b')],{'raw':_0x51c3d9['options']?_0x51c3d9[_0xb0de('0x1c')][_0xb0de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c3d9['options']?_0x51c3d9['options']['where']||null:null,'attributes':_0x51c3d9[_0xb0de('0x1c')]?_0x51c3d9[_0xb0de('0x1c')]['attributes']||null:null,'limit':_0x51c3d9[_0xb0de('0x1c')]?_0x51c3d9[_0xb0de('0x1c')][_0xb0de('0x1e')]||null:null})['then'](function(_0x4e737c){logger[_0xb0de('0x10')]('UpdateFaxInteraction',_0x51c3d9);logger['debug'](_0xb0de('0x18'),_0x51c3d9,JSON[_0xb0de('0x14')](_0x4e737c));_0x31f8fc(_0x4e737c);})[_0xb0de('0x17')](function(_0x449987){logger['error'](_0xb0de('0x18'),_0x449987[_0xb0de('0x16')],_0x51c3d9);_0x237a9b(_0x346f10[_0xb0de('0x15')](0x1f4,_0x449987[_0xb0de('0x16')]));});});};exports[_0xb0de('0x1f')]=function(_0x1bcd4e){return new Promise(function(_0x19896d,_0x4a6bc6){return db[_0xb0de('0x19')][_0xb0de('0x20')]({'where':_0x1bcd4e[_0xb0de('0x1c')]?_0x1bcd4e['options'][_0xb0de('0x21')]||null:null})[_0xb0de('0xf')](function(_0x17084e){if(_0x17084e){return _0x17084e['addTags'](_0x1bcd4e[_0xb0de('0x1b')]['ids'],_[_0xb0de('0x22')](_0x1bcd4e[_0xb0de('0x1b')],['ids','id'])||{});}})[_0xb0de('0x23')](function(_0x59569e){logger['info']('AddTags',_0x1bcd4e);logger[_0xb0de('0x12')](_0xb0de('0x24'),_0x1bcd4e,JSON[_0xb0de('0x14')](_0x59569e));_0x19896d(_0x59569e);})[_0xb0de('0x17')](function(_0x436583){logger['error'](_0xb0de('0x24'),_0x436583[_0xb0de('0x16')],_0x1bcd4e);_0x4a6bc6(_this[_0xb0de('0x15')](0x1f4,_0x436583[_0xb0de('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2dace27..ef9f31c 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 _0x5715=['register','faxInteraction:','remove','emit','removeListener'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x5715,0x1c9));var _0x5571=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x5715[_0x3792e6];return _0x441e44;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x5571('0x0'),'update'];function createListener(_0x4dcb4c,_0x4c2d1f){return function(_0x4c692e){_0x4c2d1f[_0x5571('0x1')](_0x4dcb4c,_0x4c692e);};}function removeListener(_0x4e02fc,_0x491e02){return function(){FaxInteractionEvents[_0x5571('0x2')](_0x4e02fc,_0x491e02);};}exports[_0x5571('0x3')]=function(_0x1ac5be){for(var _0x2a3536=0x0,_0x24ff56=events['length'];_0x2a3536<_0x24ff56;_0x2a3536++){var _0x5c4235=events[_0x2a3536];var _0x4d842f=createListener(_0x5571('0x4')+_0x5c4235,_0x1ac5be);FaxInteractionEvents['on'](_0x5c4235,_0x4d842f);}}; \ No newline at end of file +var _0xee74=['./faxInteraction.events','save','remove','update','removeListener','register','length','faxInteraction:'];(function(_0x5ad0d1,_0x50161b){var _0x266f22=function(_0x2d676d){while(--_0x2d676d){_0x5ad0d1['push'](_0x5ad0d1['shift']());}};_0x266f22(++_0x50161b);}(_0xee74,0x108));var _0x4ee7=function(_0x379a8f,_0x473f24){_0x379a8f=_0x379a8f-0x0;var _0x226fe7=_0xee74[_0x379a8f];return _0x226fe7;};'use strict';var FaxInteractionEvents=require(_0x4ee7('0x0'));var events=[_0x4ee7('0x1'),_0x4ee7('0x2'),_0x4ee7('0x3')];function createListener(_0x3284e8,_0x1b07ee){return function(_0x27faf5){_0x1b07ee['emit'](_0x3284e8,_0x27faf5);};}function removeListener(_0x421d2b,_0x3ead84){return function(){FaxInteractionEvents[_0x4ee7('0x4')](_0x421d2b,_0x3ead84);};}exports[_0x4ee7('0x5')]=function(_0x5ddec7){for(var _0x50eae4=0x0,_0xda57ea=events[_0x4ee7('0x6')];_0x50eae4<_0xda57ea;_0x50eae4++){var _0x5833af=events[_0x50eae4];var _0x1f3275=createListener(_0x4ee7('0x7')+_0x5833af,_0x5ddec7);FaxInteractionEvents['on'](_0x5833af,_0x1f3275);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 0f97613..b01365b 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 _0xa4c3=['addTags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','get','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags'];(function(_0x2aec3d,_0x325aea){var _0x2b7984=function(_0x1e4e40){while(--_0x1e4e40){_0x2aec3d['push'](_0x2aec3d['shift']());}};_0x2b7984(++_0x325aea);}(_0xa4c3,0xb4));var _0x3a4c=function(_0x4a50ad,_0x3df8da){_0x4a50ad=_0x4a50ad-0x0;var _0x3f601e=_0xa4c3[_0x4a50ad];return _0x3f601e;};'use strict';var multer=require(_0x3a4c('0x0'));var util=require(_0x3a4c('0x1'));var path=require(_0x3a4c('0x2'));var timeout=require(_0x3a4c('0x3'));var express=require(_0x3a4c('0x4'));var router=express['Router']();var fs_extra=require(_0x3a4c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3a4c('0x6'));var config=require(_0x3a4c('0x7'));var controller=require(_0x3a4c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3a4c('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3a4c('0xa')](_0x3a4c('0xb'),auth[_0x3a4c('0xc')](),controller[_0x3a4c('0xd')]);router[_0x3a4c('0xa')](_0x3a4c('0xe'),auth[_0x3a4c('0xc')](),controller[_0x3a4c('0xf')]);router[_0x3a4c('0xa')](_0x3a4c('0x10'),auth['isAuthenticated'](),controller[_0x3a4c('0x11')]);router[_0x3a4c('0x12')]('/',auth[_0x3a4c('0xc')](),controller[_0x3a4c('0x13')]);router[_0x3a4c('0x12')](_0x3a4c('0xe'),auth['isAuthenticated'](),controller[_0x3a4c('0x14')]);router[_0x3a4c('0x12')](_0x3a4c('0x15'),auth[_0x3a4c('0xc')](),interaction['tracked'](_0x3a4c('0x16'),_0x3a4c('0x17')),controller[_0x3a4c('0x18')]);router[_0x3a4c('0x19')]('/:id',auth[_0x3a4c('0xc')](),interaction[_0x3a4c('0x1a')](_0x3a4c('0x16'),_0x3a4c('0x1b')),controller[_0x3a4c('0x1c')]);router[_0x3a4c('0x1d')](_0x3a4c('0xb'),auth['isAuthenticated'](),interaction[_0x3a4c('0x1a')]('fax',_0x3a4c('0x1e')),controller[_0x3a4c('0x1f')]);router['delete']('/:id/tags',auth[_0x3a4c('0xc')](),controller[_0x3a4c('0x20')]);module[_0x3a4c('0x21')]=router; \ No newline at end of file +var _0x27c0=['fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','util','connect-timeout'];(function(_0x5c604c,_0x3c638f){var _0x565a0e=function(_0x363a79){while(--_0x363a79){_0x5c604c['push'](_0x5c604c['shift']());}};_0x565a0e(++_0x3c638f);}(_0x27c0,0x8f));var _0x027c=function(_0xa78009,_0x6f957){_0xa78009=_0xa78009-0x0;var _0x13c5ec=_0x27c0[_0xa78009];return _0x13c5ec;};'use strict';var multer=require('multer');var util=require(_0x027c('0x0'));var path=require('path');var timeout=require(_0x027c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x027c('0x2'));var auth=require(_0x027c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x027c('0x4'));var controller=require(_0x027c('0x5'));router[_0x027c('0x6')]('/',auth[_0x027c('0x7')](),controller[_0x027c('0x8')]);router[_0x027c('0x6')](_0x027c('0x9'),auth[_0x027c('0x7')](),controller[_0x027c('0xa')]);router[_0x027c('0x6')](_0x027c('0xb'),auth[_0x027c('0x7')](),controller[_0x027c('0xc')]);router[_0x027c('0x6')](_0x027c('0xd'),auth[_0x027c('0x7')](),controller['getMessages']);router[_0x027c('0x6')](_0x027c('0xe'),auth['isAuthenticated'](),controller[_0x027c('0xf')]);router[_0x027c('0x10')]('/',auth[_0x027c('0x7')](),controller['create']);router[_0x027c('0x10')](_0x027c('0xd'),auth[_0x027c('0x7')](),controller[_0x027c('0x11')]);router['post'](_0x027c('0x12'),auth[_0x027c('0x7')](),interaction['tracked'](_0x027c('0x13'),_0x027c('0x14')),controller[_0x027c('0x15')]);router[_0x027c('0x16')](_0x027c('0xb'),auth[_0x027c('0x7')](),interaction['tracked']('fax','faxinteraction:update'),controller[_0x027c('0x17')]);router[_0x027c('0x18')]('/:id',auth[_0x027c('0x7')](),interaction[_0x027c('0x19')](_0x027c('0x13'),_0x027c('0x1a')),controller[_0x027c('0x1b')]);router[_0x027c('0x18')](_0x027c('0x12'),auth[_0x027c('0x7')](),controller[_0x027c('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 2f2db2b..d5ff10c 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 _0x826a=['TEXT','exports','medium','ENUM','out'];(function(_0x55db36,_0x1d583f){var _0x48b18e=function(_0xc7db7a){while(--_0xc7db7a){_0x55db36['push'](_0x55db36['shift']());}};_0x48b18e(++_0x1d583f);}(_0x826a,0x1aa));var _0xa826=function(_0x5be914,_0x623e4e){_0x5be914=_0x5be914-0x0;var _0x4c62a1=_0x826a[_0x5be914];return _0x4c62a1;};'use strict';var Sequelize=require('sequelize');module[_0xa826('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa826('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa826('0x2')]('in',_0xa826('0x3')),'defaultValue':_0xa826('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa826('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x207d=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x485b5d,_0x5692b6){var _0xa90291=function(_0x57ea35){while(--_0x57ea35){_0x485b5d['push'](_0x485b5d['shift']());}};_0xa90291(++_0x5692b6);}(_0x207d,0x10d));var _0xd207=function(_0xe7108,_0x3ea674){_0xe7108=_0xe7108-0x0;var _0x2e0701=_0x207d[_0xe7108];return _0x2e0701;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'body':{'type':Sequelize[_0xd207('0x2')](_0xd207('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd207('0x4')]('in','out'),'defaultValue':_0xd207('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd207('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index cd16402..796394e 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 _0x1846=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','interface','format','SIP/%s','channel','motionChannel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','Sequelize','fullname','email','internal','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','basename','download','join','server','attachments','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','map','FaxMessage','rawAttributes','fieldName','type','key'];(function(_0x376511,_0x2eea33){var _0x248448=function(_0x165a8a){while(--_0x165a8a){_0x376511['push'](_0x376511['shift']());}};_0x248448(++_0x2eea33);}(_0x1846,0x1eb));var _0x6184=function(_0x1af2ef,_0x292578){_0x1af2ef=_0x1af2ef-0x0;var _0x55fbc2=_0x1846[_0x1af2ef];return _0x55fbc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6184('0x0'));var zipdir=require(_0x6184('0x1'));var jsonpatch=require(_0x6184('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6184('0x3'));var Mustache=require(_0x6184('0x4'));var util=require(_0x6184('0x5'));var path=require(_0x6184('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6184('0x7'));var fs=require('fs');var fs_extra=require(_0x6184('0x8'));var _=require(_0x6184('0x9'));var squel=require(_0x6184('0xa'));var crypto=require(_0x6184('0xb'));var jsforce=require(_0x6184('0xc'));var deskjs=require(_0x6184('0xd'));var toCsv=require(_0x6184('0xe'));var querystring=require(_0x6184('0xf'));var Papa=require(_0x6184('0x10'));var Redis=require(_0x6184('0x11'));var authService=require(_0x6184('0x12'));var qs=require(_0x6184('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6184('0x14'));var logger=require('../../config/logger')(_0x6184('0x15'));var utils=require(_0x6184('0x16'));var config=require(_0x6184('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6184('0x18'))['db'];config[_0x6184('0x19')]=_[_0x6184('0x1a')](config[_0x6184('0x19')],{'host':_0x6184('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6184('0x19')]));require(_0x6184('0x1c'))['register'](socket);var jayson=require(_0x6184('0x1d'));var client=jayson[_0x6184('0x1e')][_0x6184('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x6184('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xc0c626,_0x55c5cb,_0x2c47d2,_0x35db75){return new BPromise(function(_0x40303b,_0x12c589){var _0x45d734=_0x35db75||client;return _0x45d734[_0x6184('0x20')](_0xc0c626,_0x2c47d2)[_0x6184('0x21')](function(_0xac2809){logger[_0x6184('0x22')](_0x6184('0x23'),_0x55c5cb,'request\x20sent');logger[_0x6184('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x55c5cb,_0x6184('0x25'),JSON['stringify'](_0xac2809));if(_0xac2809[_0x6184('0x26')]){if(_0xac2809[_0x6184('0x26')][_0x6184('0x27')]===0x1f4){logger[_0x6184('0x26')](_0x6184('0x23'),_0x55c5cb,_0xac2809['error'][_0x6184('0x28')]);return _0x12c589(_0xac2809['error']['message']);}logger[_0x6184('0x26')](_0x6184('0x23'),_0x55c5cb,_0xac2809[_0x6184('0x26')]['message']);return _0x40303b(_0xac2809[_0x6184('0x26')][_0x6184('0x28')]);}else{logger[_0x6184('0x22')](_0x6184('0x23'),_0x55c5cb,_0x6184('0x25'));_0x40303b(_0xac2809['result']['message']);}})[_0x6184('0x29')](function(_0x567678){logger['error'](_0x6184('0x23'),_0x55c5cb,_0x567678);_0x12c589(_0x567678);});});}function respondWithStatusCode(_0x38073a,_0x19a25a){_0x19a25a=_0x19a25a||0xcc;return function(_0x269d80){if(_0x269d80){return _0x38073a[_0x6184('0x2a')](_0x19a25a);}return _0x38073a[_0x6184('0x2b')](_0x19a25a)[_0x6184('0x2c')]();};}function respondWithResult(_0x2945f2,_0x2ebe93){_0x2ebe93=_0x2ebe93||0xc8;return function(_0x3d3b4c){if(_0x3d3b4c){return _0x2945f2[_0x6184('0x2b')](_0x2ebe93)[_0x6184('0x2d')](_0x3d3b4c);}};}function respondWithFilteredResult(_0x15ad62,_0x2128e4){return function(_0x2c7908){if(_0x2c7908){var _0x340488=typeof _0x2128e4[_0x6184('0x2e')]===_0x6184('0x2f')&&typeof _0x2128e4[_0x6184('0x30')]==='undefined';var _0x9db3ac=_0x2c7908[_0x6184('0x31')];var _0x132e7b=_0x340488?0x0:_0x2128e4['offset'];var _0x480503=_0x340488?_0x2c7908[_0x6184('0x31')]:_0x2128e4[_0x6184('0x2e')]+_0x2128e4[_0x6184('0x30')];var _0xfa56c3;if(_0x480503>=_0x9db3ac){_0x480503=_0x9db3ac;_0xfa56c3=0xc8;}else{_0xfa56c3=0xce;}_0x15ad62[_0x6184('0x2b')](_0xfa56c3);return _0x15ad62[_0x6184('0x32')](_0x6184('0x33'),_0x132e7b+'-'+_0x480503+'/'+_0x9db3ac)[_0x6184('0x2d')](_0x2c7908);}return null;};}function patchUpdates(_0x491d97){return function(_0x2244f4){try{jsonpatch[_0x6184('0x34')](_0x2244f4,_0x491d97,!![]);}catch(_0x2a67ec){return BPromise[_0x6184('0x35')](_0x2a67ec);}return _0x2244f4[_0x6184('0x36')]();};}function saveUpdates(_0x51ba51,_0x13f32f){return function(_0x4dd328){if(_0x4dd328){return _0x4dd328[_0x6184('0x37')](_0x51ba51)[_0x6184('0x21')](function(_0x1e1287){return _0x1e1287;});}return null;};}function removeEntity(_0x2f608e,_0x301743){return function(_0x14613c){if(_0x14613c){return _0x14613c[_0x6184('0x38')]()[_0x6184('0x21')](function(){_0x2f608e[_0x6184('0x2b')](0xcc)[_0x6184('0x2c')]();});}};}function handleEntityNotFound(_0x3d4978,_0x487e74){return function(_0x29ec19){if(!_0x29ec19){_0x3d4978[_0x6184('0x2a')](0x194);}return _0x29ec19;};}function handleError(_0xc3cd82,_0x375aa3){_0x375aa3=_0x375aa3||0x1f4;return function(_0x5c5d5b){logger[_0x6184('0x26')](_0x5c5d5b['stack']);if(_0x5c5d5b[_0x6184('0x39')]){delete _0x5c5d5b[_0x6184('0x39')];}_0xc3cd82['status'](_0x375aa3)[_0x6184('0x3a')](_0x5c5d5b);};}exports['index']=function(_0x589bc0,_0x1cc9c2){var _0x49f882={},_0x16272e={},_0x112631={'count':0x0,'rows':[]};var _0x15266f=_[_0x6184('0x3b')](db[_0x6184('0x3c')][_0x6184('0x3d')],function(_0x451ead){return{'name':_0x451ead[_0x6184('0x3e')],'type':_0x451ead[_0x6184('0x3f')][_0x6184('0x40')]};});_0x16272e[_0x6184('0x41')]=_[_0x6184('0x3b')](_0x15266f,_0x6184('0x39'));_0x16272e[_0x6184('0x42')]=_[_0x6184('0x43')](_0x589bc0[_0x6184('0x42')]);_0x16272e[_0x6184('0x44')]=_[_0x6184('0x45')](_0x16272e[_0x6184('0x41')],_0x16272e[_0x6184('0x42')]);_0x49f882[_0x6184('0x46')]=_['intersection'](_0x16272e[_0x6184('0x41')],qs[_0x6184('0x47')](_0x589bc0[_0x6184('0x42')][_0x6184('0x47')]));_0x49f882[_0x6184('0x46')]=_0x49f882[_0x6184('0x46')][_0x6184('0x48')]?_0x49f882['attributes']:_0x16272e[_0x6184('0x41')];if(!_0x589bc0[_0x6184('0x42')][_0x6184('0x49')]('nolimit')){_0x49f882['limit']=qs[_0x6184('0x30')](_0x589bc0[_0x6184('0x42')][_0x6184('0x30')]);_0x49f882[_0x6184('0x2e')]=qs[_0x6184('0x2e')](_0x589bc0[_0x6184('0x42')][_0x6184('0x2e')]);}_0x49f882['order']=qs[_0x6184('0x4a')](_0x589bc0['query'][_0x6184('0x4a')]);_0x49f882[_0x6184('0x4b')]=qs[_0x6184('0x44')](_['pick'](_0x589bc0[_0x6184('0x42')],_0x16272e[_0x6184('0x44')]),_0x15266f);if(_0x589bc0[_0x6184('0x42')]['filter']){_0x49f882[_0x6184('0x4b')]=_['merge'](_0x49f882[_0x6184('0x4b')],{'$or':_[_0x6184('0x3b')](_0x15266f,function(_0x4327f5){if(_0x4327f5[_0x6184('0x3f')]!==_0x6184('0x4c')){var _0x236dc6={};_0x236dc6[_0x4327f5[_0x6184('0x39')]]={'$like':'%'+_0x589bc0['query'][_0x6184('0x4d')]+'%'};return _0x236dc6;}})});}_0x49f882=_[_0x6184('0x4e')]({},_0x49f882,_0x589bc0[_0x6184('0x4f')]);var _0x706502={'where':_0x49f882[_0x6184('0x4b')]};return db['FaxMessage']['count'](_0x706502)[_0x6184('0x21')](function(_0x5b0ecb){_0x112631['count']=_0x5b0ecb;if(_0x589bc0[_0x6184('0x42')][_0x6184('0x50')]){_0x49f882[_0x6184('0x51')]=[{'all':!![]}];}return db[_0x6184('0x3c')][_0x6184('0x52')](_0x49f882);})['then'](function(_0x39db16){_0x112631['rows']=_0x39db16;return _0x112631;})[_0x6184('0x21')](respondWithFilteredResult(_0x1cc9c2,_0x49f882))['catch'](handleError(_0x1cc9c2,null));};exports[_0x6184('0x53')]=function(_0x28e6ea,_0x29763c){var _0x68a9f6={'raw':!![],'where':{'id':_0x28e6ea[_0x6184('0x54')]['id']}},_0x5e26a4={};_0x5e26a4[_0x6184('0x41')]=_[_0x6184('0x43')](db[_0x6184('0x3c')]['rawAttributes']);_0x5e26a4[_0x6184('0x42')]=_[_0x6184('0x43')](_0x28e6ea['query']);_0x5e26a4[_0x6184('0x44')]=_[_0x6184('0x45')](_0x5e26a4['model'],_0x5e26a4[_0x6184('0x42')]);_0x68a9f6['attributes']=_['intersection'](_0x5e26a4[_0x6184('0x41')],qs[_0x6184('0x47')](_0x28e6ea[_0x6184('0x42')][_0x6184('0x47')]));_0x68a9f6[_0x6184('0x46')]=_0x68a9f6[_0x6184('0x46')]['length']?_0x68a9f6['attributes']:_0x5e26a4[_0x6184('0x41')];if(_0x28e6ea[_0x6184('0x42')][_0x6184('0x50')]){_0x68a9f6[_0x6184('0x51')]=[{'all':!![]}];}_0x68a9f6=_[_0x6184('0x4e')]({},_0x68a9f6,_0x28e6ea[_0x6184('0x4f')]);return db[_0x6184('0x3c')][_0x6184('0x55')](_0x68a9f6)[_0x6184('0x21')](handleEntityNotFound(_0x29763c,null))['then'](respondWithResult(_0x29763c,null))[_0x6184('0x29')](handleError(_0x29763c,null));};exports['update']=function(_0x3889d6,_0x33331c){if(_0x3889d6['body']['id']){delete _0x3889d6['body']['id'];}return db['FaxMessage'][_0x6184('0x55')]({'where':{'id':_0x3889d6[_0x6184('0x54')]['id']}})[_0x6184('0x21')](handleEntityNotFound(_0x33331c,null))[_0x6184('0x21')](saveUpdates(_0x3889d6[_0x6184('0x56')],null))['then'](respondWithResult(_0x33331c,null))[_0x6184('0x29')](handleError(_0x33331c,null));};exports[_0x6184('0x38')]=function(_0x5c3a06,_0x2cdde6){return db[_0x6184('0x3c')][_0x6184('0x55')]({'where':{'id':_0x5c3a06[_0x6184('0x54')]['id']}})[_0x6184('0x21')](handleEntityNotFound(_0x2cdde6,null))['then'](removeEntity(_0x2cdde6,null))[_0x6184('0x29')](handleError(_0x2cdde6,null));};exports[_0x6184('0x57')]=function(_0x405898,_0x52e624){return db[_0x6184('0x3c')][_0x6184('0x57')]()['then'](respondWithResult(_0x52e624,null))['catch'](handleError(_0x52e624,null));};var interaction_log=require(_0x6184('0x58'))(_0x6184('0x59'));exports[_0x6184('0x5a')]=function(_0x2db24e,_0x4afc83,_0x2250ba){var _0x31e4b7={'agent':{},'channel':_0x6184('0x5b')};if(_0x2db24e[_0x6184('0x56')]['id']){delete _0x2db24e['body']['id'];}_0x2db24e['body'][_0x6184('0x5c')]=!![];_0x2db24e[_0x6184('0x56')][_0x6184('0x5d')]=moment()['format'](_0x6184('0x5e'));_0x2db24e[_0x6184('0x56')]['UserId']=_0x2db24e[_0x6184('0x56')][_0x6184('0x5f')]||_0x2db24e[_0x6184('0x60')]['id'];_0x31e4b7[_0x6184('0x61')]['id']=_0x2db24e[_0x6184('0x56')]['UserId'];return db[_0x6184('0x3c')]['find']({'where':{'id':_0x2db24e[_0x6184('0x54')]['id'],'UserId':null}})[_0x6184('0x21')](handleEntityNotFound(_0x4afc83,null))['then'](saveUpdates(_0x2db24e[_0x6184('0x56')],null))[_0x6184('0x21')](function(_0x1599c2){if(_0x1599c2){_0x31e4b7['message']=_0x1599c2['get']({'plain':!![]});return db[_0x6184('0x62')][_0x6184('0x55')]({'where':{'id':_0x1599c2[_0x6184('0x63')]}});}return null;})[_0x6184('0x21')](handleEntityNotFound(_0x4afc83,null))[_0x6184('0x21')](function(_0x3513f4){if(_0x3513f4){return _0x3513f4[_0x6184('0x37')]({'UserId':_0x2db24e[_0x6184('0x56')]['UserId'],'read1stAt':_[_0x6184('0x64')](_0x3513f4[_0x6184('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6184('0x21')](function(_0x49dd09){if(_0x49dd09){_0x31e4b7[_0x6184('0x66')]=_0x49dd09[_0x6184('0x67')]({'plain':!![]});interaction_log[_0x6184('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2db24e[_0x6184('0x60')]['id'],_0x2db24e[_0x6184('0x60')]['name'],_0x2db24e[_0x6184('0x60')]['role'],_0x31e4b7[_0x6184('0x66')]['id'],_0x2db24e[_0x6184('0x56')]?JSON[_0x6184('0x68')](_0x2db24e['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x6184('0x69'),_0x31e4b7);}return null;})['then'](function(_0x5ef199){var _0x102d2b=_0x6184('0x6a')+_0x5ef199[_0x6184('0x28')][_0x6184('0x6b')];return db['sequelize'][_0x6184('0x42')](_0x102d2b,{'type':db['Sequelize'][_0x6184('0x6c')][_0x6184('0x6d')],'raw':!![]})['then'](function(_0x52d9a2){return _0x52d9a2;});})['then'](function(_0x2c92f3){if(_0x2c92f3){_0x31e4b7[_0x6184('0x28')][_0x6184('0x6e')]=_0x2c92f3[0x0];if(!_0x2db24e[_0x6184('0x56')][_0x6184('0x5f')])return;return db[_0x6184('0x6f')][_0x6184('0x55')]({'where':{'id':_0x2db24e[_0x6184('0x56')][_0x6184('0x5f')],'role':_0x6184('0x61')},'attributes':['id',_0x6184('0x39'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x6184('0x21')](function(_0x59705a){if(!_0x59705a)return null;_0x31e4b7['message'][_0x6184('0x61')]=_0x59705a;return _0x31e4b7;})[_0x6184('0x21')](function(_0x5945d3){if(_0x5945d3){if(_0x2db24e[_0x6184('0x56')]['manual']){_0x31e4b7[_0x6184('0x28')][_0x6184('0x70')]=util[_0x6184('0x71')](_0x6184('0x72'),_0x2db24e[_0x6184('0x60')][_0x6184('0x39')]);_0x31e4b7['message'][_0x6184('0x73')]=_0x31e4b7[_0x6184('0x73')];_0x31e4b7[_0x6184('0x28')][_0x6184('0x74')]=_0x31e4b7[_0x6184('0x73')];_0x31e4b7[_0x6184('0x28')][_0x6184('0x75')]=_0x6184('0x5a');return respondWithRpcPromise(_0x6184('0x76'),_0x6184('0x76'),{'event':'acceptmessage','message':_0x31e4b7[_0x6184('0x28')]},client9002)[_0x6184('0x21')](function(){return _0x31e4b7;});}return _0x31e4b7;}return null;})['then'](respondWithResult(_0x4afc83,null))[_0x6184('0x29')](handleError(_0x4afc83,null));};var interaction_log=require(_0x6184('0x58'))(_0x6184('0x59'));exports['reject']=function(_0x51a4cf,_0x35e19d,_0x5a8e2f){var _0x353b66={'agent':{},'channel':_0x6184('0x5b')};if(_0x51a4cf[_0x6184('0x56')]['id']){delete _0x51a4cf[_0x6184('0x56')]['id'];}_0x51a4cf['body'][_0x6184('0x5f')]=_0x51a4cf[_0x6184('0x56')][_0x6184('0x5f')]||_0x51a4cf[_0x6184('0x60')]['id'];_0x353b66[_0x6184('0x61')]['id']=_0x51a4cf[_0x6184('0x56')][_0x6184('0x5f')];return db['FaxMessage'][_0x6184('0x55')]({'where':{'id':_0x51a4cf[_0x6184('0x54')]['id'],'UserId':null}})[_0x6184('0x21')](handleEntityNotFound(_0x35e19d,null))[_0x6184('0x21')](function(_0x511d5c){if(_0x511d5c){_0x353b66[_0x6184('0x28')]=_0x511d5c[_0x6184('0x67')]({'plain':!![]});return db['FaxInteraction'][_0x6184('0x55')]({'where':{'id':_0x511d5c[_0x6184('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x35e19d,null))[_0x6184('0x21')](function(_0x268b62){if(_0x268b62){_0x353b66[_0x6184('0x66')]=_0x268b62['get']({'plain':!![]});interaction_log[_0x6184('0x22')](_0x6184('0x77'),_0x51a4cf['user']['id'],_0x51a4cf[_0x6184('0x60')]['name'],_0x51a4cf[_0x6184('0x60')][_0x6184('0x78')],_0x353b66[_0x6184('0x66')]['id'],_0x51a4cf[_0x6184('0x56')]?JSON['stringify'](_0x51a4cf[_0x6184('0x56')]):'null');return respondWithRpcPromise(_0x6184('0x79'),'rejectMessage',_0x353b66);}return null;})['then'](function(_0x369847){var _0x5612ab=_0x6184('0x6a')+_0x369847[_0x6184('0x28')][_0x6184('0x6b')];return db[_0x6184('0x7a')][_0x6184('0x42')](_0x5612ab,{'type':db[_0x6184('0x7b')][_0x6184('0x6c')][_0x6184('0x6d')],'raw':!![]})['then'](function(_0x203e94){return _0x203e94;});})[_0x6184('0x21')](function(_0x472ee2){if(_0x472ee2){_0x353b66['message']['contact']=_0x472ee2[0x0];if(!_0x51a4cf[_0x6184('0x56')][_0x6184('0x5f')])return;return db[_0x6184('0x6f')]['find']({'where':{'id':_0x51a4cf[_0x6184('0x56')][_0x6184('0x5f')],'role':_0x6184('0x61')},'attributes':['id','name',_0x6184('0x7c'),_0x6184('0x7d'),_0x6184('0x7e')],'raw':!![]});}return null;})[_0x6184('0x21')](function(_0x2d35af){if(!_0x2d35af)return null;_0x353b66[_0x6184('0x28')][_0x6184('0x61')]=_0x2d35af;return _0x353b66;})[_0x6184('0x21')](function(_0x2a2a4d){if(_0x2a2a4d){_0x2a2a4d[_0x6184('0x28')][_0x6184('0x70')]=util[_0x6184('0x71')](_0x6184('0x72'),_0x51a4cf[_0x6184('0x60')]['name']);_0x2a2a4d[_0x6184('0x28')][_0x6184('0x73')]=_0x353b66[_0x6184('0x73')];_0x2a2a4d[_0x6184('0x28')][_0x6184('0x74')]=_0x353b66[_0x6184('0x73')];_0x2a2a4d[_0x6184('0x28')][_0x6184('0x75')]='reject';respondWithRpcPromise(_0x6184('0x76'),_0x6184('0x76'),{'event':_0x6184('0x7f'),'message':_0x2a2a4d['message']},client9002);return _0x353b66;}return null;})['then'](respondWithResult(_0x35e19d,null))[_0x6184('0x29')](handleError(_0x35e19d,null));};exports[_0x6184('0x80')]=function(_0x3f6c80,_0x529967){var _0x41cbaf;return db[_0x6184('0x3c')][_0x6184('0x80')](_0x3f6c80[_0x6184('0x56')],{})[_0x6184('0x21')](function(_0x5e333a){_0x41cbaf=_0x5e333a;return db[_0x6184('0x81')]['findOne']({'where':{'id':_0x41cbaf[_0x6184('0x6b')]}});})[_0x6184('0x21')](function(_0x4b2748){if(_[_0x6184('0x64')](_0x4b2748)){return;}else{_0x41cbaf[_0x6184('0x5b')]=_0x4b2748[_0x6184('0x5b')];return db[_0x6184('0x82')][_0x6184('0x83')]({'where':{'id':_0x41cbaf[_0x6184('0x84')]}});}})[_0x6184('0x21')](function(_0xf6e41d){return respondWithRpcPromise(_0x6184('0x85'),'SendFax',{'FaxAccountId':_[_0x6184('0x64')](_0x3f6c80[_0x6184('0x56')])?undefined:_0x3f6c80[_0x6184('0x56')]['FaxAccountId'],'path':_[_0x6184('0x64')](_0xf6e41d)?undefined:util[_0x6184('0x71')]('/var/opt/motion2/server/files/attachments/%s',_0xf6e41d[_0x6184('0x86')]),'fax':_[_0x6184('0x64')](_0x41cbaf[_0x6184('0x5b')])?undefined:_0x41cbaf[_0x6184('0x5b')],'AttachmentId':_0x41cbaf['AttachmentId']},client9002);})[_0x6184('0x21')](respondWithResult(_0x529967,0xc9))[_0x6184('0x29')](handleError(_0x529967,null));};exports[_0x6184('0x87')]=function(_0x157076,_0xb83e74){var _0x2cc5f0=path[_0x6184('0x88')](config['root'],_0x6184('0x89'),'files',_0x6184('0x8a'));return db[_0x6184('0x3c')][_0x6184('0x55')]({'where':{'id':_0x157076['params']['id']},'include':[{'model':db[_0x6184('0x82')],'as':_0x6184('0x82')}]})[_0x6184('0x21')](handleEntityNotFound(_0xb83e74,null))[_0x6184('0x21')](function(_0x32051e){if(_0x32051e){return _0xb83e74[_0x6184('0x87')](path[_0x6184('0x88')](_0x2cc5f0,_0x32051e[_0x6184('0x82')][_0x6184('0x86')]));}})[_0x6184('0x29')](handleError(_0xb83e74,null));}; \ No newline at end of file +var _0xda75=['api','../../config/environment','redis','defaults','localhost','./faxMessage.socket','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','FaxMessage,\x20%s,\x20%s','error','message','status','offset','undefined','count','limit','set','Content-Range','apply','save','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxMessage','include','findAll','rows','catch','show','params','keys','includeAll','find','body','destroy','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','event','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2bf169,_0x14b015){var _0x8318a1=function(_0x5b22af){while(--_0x5b22af){_0x2bf169['push'](_0x2bf169['shift']());}};_0x8318a1(++_0x14b015);}(_0xda75,0x192));var _0x5da7=function(_0x5f2108,_0x2e2cd5){_0x5f2108=_0x5f2108-0x0;var _0x10ef49=_0xda75[_0x5f2108];return _0x10ef49;};'use strict';var emlformat=require(_0x5da7('0x0'));var rimraf=require(_0x5da7('0x1'));var zipdir=require(_0x5da7('0x2'));var jsonpatch=require(_0x5da7('0x3'));var rp=require(_0x5da7('0x4'));var moment=require(_0x5da7('0x5'));var BPromise=require(_0x5da7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5da7('0x7'));var sox=require(_0x5da7('0x8'));var csv=require(_0x5da7('0x9'));var ejs=require(_0x5da7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5da7('0xb'));var squel=require(_0x5da7('0xc'));var crypto=require('crypto');var jsforce=require(_0x5da7('0xd'));var deskjs=require(_0x5da7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5da7('0xf'));var Papa=require(_0x5da7('0x10'));var Redis=require('ioredis');var authService=require(_0x5da7('0x11'));var qs=require(_0x5da7('0x12'));var as=require(_0x5da7('0x13'));var hardwareService=require(_0x5da7('0x14'));var logger=require('../../config/logger')(_0x5da7('0x15'));var utils=require('../../config/utils');var config=require(_0x5da7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5da7('0x17')]=_[_0x5da7('0x18')](config[_0x5da7('0x17')],{'host':_0x5da7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5da7('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5da7('0x1b')][_0x5da7('0x1c')]({'port':0x232c});var client9002=jayson[_0x5da7('0x1b')][_0x5da7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x189ded,_0x47020a,_0x1cd060,_0x5e785f){return new BPromise(function(_0x107059,_0x344a85){var _0x1e1e17=_0x5e785f||client;return _0x1e1e17[_0x5da7('0x1d')](_0x189ded,_0x1cd060)[_0x5da7('0x1e')](function(_0x558615){logger[_0x5da7('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x47020a,_0x5da7('0x20'));logger[_0x5da7('0x21')](_0x5da7('0x22'),_0x47020a,_0x5da7('0x20'),JSON[_0x5da7('0x23')](_0x558615));if(_0x558615['error']){if(_0x558615['error']['code']===0x1f4){logger['error'](_0x5da7('0x24'),_0x47020a,_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);return _0x344a85(_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);}logger[_0x5da7('0x25')](_0x5da7('0x24'),_0x47020a,_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);return _0x107059(_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);}else{logger[_0x5da7('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x47020a,_0x5da7('0x20'));_0x107059(_0x558615['result'][_0x5da7('0x26')]);}})['catch'](function(_0x3a4857){logger['error'](_0x5da7('0x24'),_0x47020a,_0x3a4857);_0x344a85(_0x3a4857);});});}function respondWithStatusCode(_0x2d4919,_0x21703b){_0x21703b=_0x21703b||0xcc;return function(_0xc90c91){if(_0xc90c91){return _0x2d4919['sendStatus'](_0x21703b);}return _0x2d4919[_0x5da7('0x27')](_0x21703b)['end']();};}function respondWithResult(_0x16f67b,_0x5a81f1){_0x5a81f1=_0x5a81f1||0xc8;return function(_0x1570f5){if(_0x1570f5){return _0x16f67b['status'](_0x5a81f1)['json'](_0x1570f5);}};}function respondWithFilteredResult(_0x3aeaf4,_0x61b5ee){return function(_0x5bb836){if(_0x5bb836){var _0x1305e3=typeof _0x61b5ee[_0x5da7('0x28')]===_0x5da7('0x29')&&typeof _0x61b5ee['limit']===_0x5da7('0x29');var _0x5396aa=_0x5bb836[_0x5da7('0x2a')];var _0x51fcef=_0x1305e3?0x0:_0x61b5ee[_0x5da7('0x28')];var _0x3331dc=_0x1305e3?_0x5bb836[_0x5da7('0x2a')]:_0x61b5ee['offset']+_0x61b5ee[_0x5da7('0x2b')];var _0x472954;if(_0x3331dc>=_0x5396aa){_0x3331dc=_0x5396aa;_0x472954=0xc8;}else{_0x472954=0xce;}_0x3aeaf4['status'](_0x472954);return _0x3aeaf4[_0x5da7('0x2c')](_0x5da7('0x2d'),_0x51fcef+'-'+_0x3331dc+'/'+_0x5396aa)['json'](_0x5bb836);}return null;};}function patchUpdates(_0x48d9de){return function(_0x1c771e){try{jsonpatch[_0x5da7('0x2e')](_0x1c771e,_0x48d9de,!![]);}catch(_0x24120e){return BPromise['reject'](_0x24120e);}return _0x1c771e[_0x5da7('0x2f')]();};}function saveUpdates(_0x14f4ff,_0x2352a3){return function(_0x994403){if(_0x994403){return _0x994403['update'](_0x14f4ff)[_0x5da7('0x1e')](function(_0x427b1a){return _0x427b1a;});}return null;};}function removeEntity(_0x352f88,_0xc7dc61){return function(_0x16eee7){if(_0x16eee7){return _0x16eee7['destroy']()[_0x5da7('0x1e')](function(){_0x352f88['status'](0xcc)[_0x5da7('0x30')]();});}};}function handleEntityNotFound(_0x3f642c,_0x373690){return function(_0x218bf7){if(!_0x218bf7){_0x3f642c[_0x5da7('0x31')](0x194);}return _0x218bf7;};}function handleError(_0x1a78aa,_0x4f8e68){_0x4f8e68=_0x4f8e68||0x1f4;return function(_0xb163bf){logger[_0x5da7('0x25')](_0xb163bf[_0x5da7('0x32')]);if(_0xb163bf[_0x5da7('0x33')]){delete _0xb163bf[_0x5da7('0x33')];}_0x1a78aa[_0x5da7('0x27')](_0x4f8e68)[_0x5da7('0x34')](_0xb163bf);};}exports[_0x5da7('0x35')]=function(_0x8d0fe5,_0x4bcadd){var _0x3843b3={},_0x220bcc={},_0x5c8fed={'count':0x0,'rows':[]};var _0x188220=_[_0x5da7('0x36')](db['FaxMessage'][_0x5da7('0x37')],function(_0x51f030){return{'name':_0x51f030[_0x5da7('0x38')],'type':_0x51f030['type']['key']};});_0x220bcc[_0x5da7('0x39')]=_[_0x5da7('0x36')](_0x188220,'name');_0x220bcc[_0x5da7('0x3a')]=_['keys'](_0x8d0fe5[_0x5da7('0x3a')]);_0x220bcc[_0x5da7('0x3b')]=_[_0x5da7('0x3c')](_0x220bcc[_0x5da7('0x39')],_0x220bcc['query']);_0x3843b3['attributes']=_[_0x5da7('0x3c')](_0x220bcc[_0x5da7('0x39')],qs[_0x5da7('0x3d')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x3d')]));_0x3843b3[_0x5da7('0x3e')]=_0x3843b3[_0x5da7('0x3e')][_0x5da7('0x3f')]?_0x3843b3[_0x5da7('0x3e')]:_0x220bcc['model'];if(!_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x40')](_0x5da7('0x41'))){_0x3843b3['limit']=qs[_0x5da7('0x2b')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x2b')]);_0x3843b3[_0x5da7('0x28')]=qs[_0x5da7('0x28')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x28')]);}_0x3843b3[_0x5da7('0x42')]=qs['sort'](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x43')]);_0x3843b3['where']=qs[_0x5da7('0x3b')](_[_0x5da7('0x44')](_0x8d0fe5[_0x5da7('0x3a')],_0x220bcc[_0x5da7('0x3b')]),_0x188220);if(_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x45')]){_0x3843b3[_0x5da7('0x46')]=_[_0x5da7('0x47')](_0x3843b3[_0x5da7('0x46')],{'$or':_[_0x5da7('0x36')](_0x188220,function(_0x599b31){if(_0x599b31['type']!==_0x5da7('0x48')){var _0x570939={};_0x570939[_0x599b31[_0x5da7('0x33')]]={'$like':'%'+_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x45')]+'%'};return _0x570939;}})});}_0x3843b3=_[_0x5da7('0x47')]({},_0x3843b3,_0x8d0fe5[_0x5da7('0x49')]);var _0x573bf4={'where':_0x3843b3[_0x5da7('0x46')]};return db[_0x5da7('0x4a')][_0x5da7('0x2a')](_0x573bf4)[_0x5da7('0x1e')](function(_0x1132e9){_0x5c8fed[_0x5da7('0x2a')]=_0x1132e9;if(_0x8d0fe5[_0x5da7('0x3a')]['includeAll']){_0x3843b3[_0x5da7('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x5da7('0x4c')](_0x3843b3);})['then'](function(_0x372b53){_0x5c8fed[_0x5da7('0x4d')]=_0x372b53;return _0x5c8fed;})[_0x5da7('0x1e')](respondWithFilteredResult(_0x4bcadd,_0x3843b3))[_0x5da7('0x4e')](handleError(_0x4bcadd,null));};exports[_0x5da7('0x4f')]=function(_0x5c5985,_0x8cc459){var _0x3a4c3b={'raw':!![],'where':{'id':_0x5c5985[_0x5da7('0x50')]['id']}},_0x1e21eb={};_0x1e21eb[_0x5da7('0x39')]=_[_0x5da7('0x51')](db[_0x5da7('0x4a')][_0x5da7('0x37')]);_0x1e21eb[_0x5da7('0x3a')]=_['keys'](_0x5c5985[_0x5da7('0x3a')]);_0x1e21eb[_0x5da7('0x3b')]=_[_0x5da7('0x3c')](_0x1e21eb[_0x5da7('0x39')],_0x1e21eb[_0x5da7('0x3a')]);_0x3a4c3b['attributes']=_[_0x5da7('0x3c')](_0x1e21eb[_0x5da7('0x39')],qs[_0x5da7('0x3d')](_0x5c5985[_0x5da7('0x3a')][_0x5da7('0x3d')]));_0x3a4c3b[_0x5da7('0x3e')]=_0x3a4c3b[_0x5da7('0x3e')][_0x5da7('0x3f')]?_0x3a4c3b[_0x5da7('0x3e')]:_0x1e21eb[_0x5da7('0x39')];if(_0x5c5985[_0x5da7('0x3a')][_0x5da7('0x52')]){_0x3a4c3b['include']=[{'all':!![]}];}_0x3a4c3b=_[_0x5da7('0x47')]({},_0x3a4c3b,_0x5c5985[_0x5da7('0x49')]);return db['FaxMessage'][_0x5da7('0x53')](_0x3a4c3b)[_0x5da7('0x1e')](handleEntityNotFound(_0x8cc459,null))[_0x5da7('0x1e')](respondWithResult(_0x8cc459,null))[_0x5da7('0x4e')](handleError(_0x8cc459,null));};exports['update']=function(_0x2bc9ec,_0x483054){if(_0x2bc9ec[_0x5da7('0x54')]['id']){delete _0x2bc9ec[_0x5da7('0x54')]['id'];}return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x2bc9ec[_0x5da7('0x50')]['id']}})[_0x5da7('0x1e')](handleEntityNotFound(_0x483054,null))['then'](saveUpdates(_0x2bc9ec[_0x5da7('0x54')],null))[_0x5da7('0x1e')](respondWithResult(_0x483054,null))[_0x5da7('0x4e')](handleError(_0x483054,null));};exports[_0x5da7('0x55')]=function(_0x3b448c,_0x3bbbbf){return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x3b448c[_0x5da7('0x50')]['id']}})[_0x5da7('0x1e')](handleEntityNotFound(_0x3bbbbf,null))['then'](removeEntity(_0x3bbbbf,null))['catch'](handleError(_0x3bbbbf,null));};exports[_0x5da7('0x56')]=function(_0x3ed599,_0xebf879){return db[_0x5da7('0x4a')][_0x5da7('0x56')]()[_0x5da7('0x1e')](respondWithResult(_0xebf879,null))['catch'](handleError(_0xebf879,null));};var interaction_log=require(_0x5da7('0x57'))(_0x5da7('0x58'));exports[_0x5da7('0x59')]=function(_0x331e7e,_0x5f56c3,_0x570a6a){var _0xd0d0b={'agent':{},'channel':_0x5da7('0x5a')};if(_0x331e7e[_0x5da7('0x54')]['id']){delete _0x331e7e[_0x5da7('0x54')]['id'];}_0x331e7e['body']['read']=!![];_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5b')]=moment()['format'](_0x5da7('0x5c'));_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5d')]=_0x331e7e[_0x5da7('0x54')]['UserId']||_0x331e7e[_0x5da7('0x5e')]['id'];_0xd0d0b['agent']['id']=_0x331e7e[_0x5da7('0x54')]['UserId'];return db[_0x5da7('0x4a')]['find']({'where':{'id':_0x331e7e[_0x5da7('0x50')]['id'],'UserId':null}})[_0x5da7('0x1e')](handleEntityNotFound(_0x5f56c3,null))[_0x5da7('0x1e')](saveUpdates(_0x331e7e[_0x5da7('0x54')],null))[_0x5da7('0x1e')](function(_0x4bf235){if(_0x4bf235){_0xd0d0b['message']=_0x4bf235[_0x5da7('0x5f')]({'plain':!![]});return db[_0x5da7('0x60')]['find']({'where':{'id':_0x4bf235['FaxInteractionId']}});}return null;})[_0x5da7('0x1e')](handleEntityNotFound(_0x5f56c3,null))[_0x5da7('0x1e')](function(_0x1e222d){if(_0x1e222d){return _0x1e222d['update']({'UserId':_0x331e7e['body'][_0x5da7('0x5d')],'read1stAt':_['isNil'](_0x1e222d[_0x5da7('0x61')])?moment()[_0x5da7('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5da7('0x1e')](function(_0x1ee95e){if(_0x1ee95e){_0xd0d0b[_0x5da7('0x63')]=_0x1ee95e[_0x5da7('0x5f')]({'plain':!![]});interaction_log[_0x5da7('0x1f')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x331e7e[_0x5da7('0x5e')]['id'],_0x331e7e['user']['name'],_0x331e7e[_0x5da7('0x5e')][_0x5da7('0x64')],_0xd0d0b['interaction']['id'],_0x331e7e[_0x5da7('0x54')]?JSON[_0x5da7('0x23')](_0x331e7e[_0x5da7('0x54')]):_0x5da7('0x65'));return respondWithRpcPromise(_0x5da7('0x66'),_0x5da7('0x67'),_0xd0d0b);}return null;})[_0x5da7('0x1e')](function(_0x33ac5a){var _0x1196a5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33ac5a[_0x5da7('0x26')][_0x5da7('0x68')];return db[_0x5da7('0x69')][_0x5da7('0x3a')](_0x1196a5,{'type':db[_0x5da7('0x6a')][_0x5da7('0x6b')][_0x5da7('0x6c')],'raw':!![]})[_0x5da7('0x1e')](function(_0x3638c6){return _0x3638c6;});})['then'](function(_0x405588){if(_0x405588){_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x6d')]=_0x405588[0x0];if(!_0x331e7e[_0x5da7('0x54')]['UserId'])return;return db[_0x5da7('0x6e')][_0x5da7('0x53')]({'where':{'id':_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5d')],'role':_0x5da7('0x6f')},'attributes':['id',_0x5da7('0x33'),_0x5da7('0x70'),_0x5da7('0x71'),_0x5da7('0x72')],'raw':!![]});}return null;})[_0x5da7('0x1e')](function(_0x3a5229){if(!_0x3a5229)return null;_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x6f')]=_0x3a5229;return _0xd0d0b;})[_0x5da7('0x1e')](function(_0x27d2ce){if(_0x27d2ce){if(_0x331e7e[_0x5da7('0x54')][_0x5da7('0x73')]){_0xd0d0b[_0x5da7('0x26')]['interface']=util[_0x5da7('0x62')](_0x5da7('0x74'),_0x331e7e['user'][_0x5da7('0x33')]);_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x75')]=_0xd0d0b[_0x5da7('0x75')];_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x76')]=_0xd0d0b[_0x5da7('0x75')];_0xd0d0b['message']['event']='accept';return respondWithRpcPromise(_0x5da7('0x77'),_0x5da7('0x77'),{'event':_0x5da7('0x78'),'message':_0xd0d0b[_0x5da7('0x26')]},client9002)[_0x5da7('0x1e')](function(){return _0xd0d0b;});}return _0xd0d0b;}return null;})[_0x5da7('0x1e')](respondWithResult(_0x5f56c3,null))[_0x5da7('0x4e')](handleError(_0x5f56c3,null));};var interaction_log=require(_0x5da7('0x57'))(_0x5da7('0x58'));exports[_0x5da7('0x79')]=function(_0x1aa3c8,_0x1dbecc,_0x5dc491){var _0x1faccb={'agent':{},'channel':_0x5da7('0x5a')};if(_0x1aa3c8[_0x5da7('0x54')]['id']){delete _0x1aa3c8['body']['id'];}_0x1aa3c8['body'][_0x5da7('0x5d')]=_0x1aa3c8['body']['UserId']||_0x1aa3c8[_0x5da7('0x5e')]['id'];_0x1faccb['agent']['id']=_0x1aa3c8[_0x5da7('0x54')][_0x5da7('0x5d')];return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x1aa3c8[_0x5da7('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1dbecc,null))[_0x5da7('0x1e')](function(_0x59c8fd){if(_0x59c8fd){_0x1faccb[_0x5da7('0x26')]=_0x59c8fd[_0x5da7('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x5da7('0x53')]({'where':{'id':_0x59c8fd['FaxInteractionId']}});}return null;})[_0x5da7('0x1e')](handleEntityNotFound(_0x1dbecc,null))[_0x5da7('0x1e')](function(_0x3afa66){if(_0x3afa66){_0x1faccb[_0x5da7('0x63')]=_0x3afa66[_0x5da7('0x5f')]({'plain':!![]});interaction_log[_0x5da7('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aa3c8[_0x5da7('0x5e')]['id'],_0x1aa3c8[_0x5da7('0x5e')]['name'],_0x1aa3c8[_0x5da7('0x5e')][_0x5da7('0x64')],_0x1faccb['interaction']['id'],_0x1aa3c8[_0x5da7('0x54')]?JSON[_0x5da7('0x23')](_0x1aa3c8[_0x5da7('0x54')]):_0x5da7('0x65'));return respondWithRpcPromise(_0x5da7('0x7a'),_0x5da7('0x7b'),_0x1faccb);}return null;})[_0x5da7('0x1e')](function(_0x570ca5){var _0x437c87='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x570ca5[_0x5da7('0x26')]['ContactId'];return db[_0x5da7('0x69')][_0x5da7('0x3a')](_0x437c87,{'type':db[_0x5da7('0x6a')][_0x5da7('0x6b')][_0x5da7('0x6c')],'raw':!![]})[_0x5da7('0x1e')](function(_0x360de1){return _0x360de1;});})[_0x5da7('0x1e')](function(_0x212770){if(_0x212770){_0x1faccb[_0x5da7('0x26')]['contact']=_0x212770[0x0];if(!_0x1aa3c8[_0x5da7('0x54')][_0x5da7('0x5d')])return;return db[_0x5da7('0x6e')][_0x5da7('0x53')]({'where':{'id':_0x1aa3c8['body']['UserId'],'role':_0x5da7('0x6f')},'attributes':['id','name',_0x5da7('0x70'),_0x5da7('0x71'),_0x5da7('0x72')],'raw':!![]});}return null;})[_0x5da7('0x1e')](function(_0x2b7048){if(!_0x2b7048)return null;_0x1faccb[_0x5da7('0x26')]['agent']=_0x2b7048;return _0x1faccb;})['then'](function(_0x49e25e){if(_0x49e25e){_0x49e25e['message']['interface']=util['format'](_0x5da7('0x74'),_0x1aa3c8[_0x5da7('0x5e')][_0x5da7('0x33')]);_0x49e25e[_0x5da7('0x26')][_0x5da7('0x75')]=_0x1faccb[_0x5da7('0x75')];_0x49e25e['message'][_0x5da7('0x76')]=_0x1faccb['channel'];_0x49e25e[_0x5da7('0x26')][_0x5da7('0x7c')]=_0x5da7('0x79');respondWithRpcPromise(_0x5da7('0x77'),_0x5da7('0x77'),{'event':_0x5da7('0x7d'),'message':_0x49e25e[_0x5da7('0x26')]},client9002);return _0x1faccb;}return null;})['then'](respondWithResult(_0x1dbecc,null))['catch'](handleError(_0x1dbecc,null));};exports[_0x5da7('0x7e')]=function(_0x228e08,_0x2016e5){var _0x2e6c56;return db[_0x5da7('0x4a')]['create'](_0x228e08[_0x5da7('0x54')],{})[_0x5da7('0x1e')](function(_0x1adb9e){_0x2e6c56=_0x1adb9e;return db[_0x5da7('0x7f')][_0x5da7('0x80')]({'where':{'id':_0x2e6c56[_0x5da7('0x68')]}});})['then'](function(_0x50a4dc){if(_[_0x5da7('0x81')](_0x50a4dc)){return;}else{_0x2e6c56[_0x5da7('0x5a')]=_0x50a4dc[_0x5da7('0x5a')];return db[_0x5da7('0x82')]['findOne']({'where':{'id':_0x2e6c56[_0x5da7('0x83')]}});}})['then'](function(_0x4859c2){return respondWithRpcPromise(_0x5da7('0x84'),'SendFax',{'FaxAccountId':_[_0x5da7('0x81')](_0x228e08[_0x5da7('0x54')])?undefined:_0x228e08[_0x5da7('0x54')][_0x5da7('0x85')],'path':_[_0x5da7('0x81')](_0x4859c2)?undefined:util[_0x5da7('0x62')](_0x5da7('0x86'),_0x4859c2[_0x5da7('0x87')]),'fax':_[_0x5da7('0x81')](_0x2e6c56[_0x5da7('0x5a')])?undefined:_0x2e6c56['fax'],'AttachmentId':_0x2e6c56['AttachmentId']},client9002);})['then'](respondWithResult(_0x2016e5,0xc9))['catch'](handleError(_0x2016e5,null));};exports[_0x5da7('0x88')]=function(_0x4a715e,_0x446b43){var _0x801712=path[_0x5da7('0x89')](config['root'],_0x5da7('0x8a'),_0x5da7('0x8b'),_0x5da7('0x8c'));return db['FaxMessage'][_0x5da7('0x53')]({'where':{'id':_0x4a715e[_0x5da7('0x50')]['id']},'include':[{'model':db[_0x5da7('0x82')],'as':_0x5da7('0x82')}]})['then'](handleEntityNotFound(_0x446b43,null))['then'](function(_0xe0698b){if(_0xe0698b){return _0x446b43['download'](path['join'](_0x801712,_0xe0698b['Attachment'][_0x5da7('0x87')]));}})[_0x5da7('0x4e')](handleError(_0x446b43,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 91d91a2..c54e9db 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 _0xed5c=['remove','emit','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x494f7f,_0x34a09b){var _0x18ebe4=function(_0x178e2e){while(--_0x178e2e){_0x494f7f['push'](_0x494f7f['shift']());}};_0x18ebe4(++_0x34a09b);}(_0xed5c,0x81));var _0xced5=function(_0x128257,_0x2f233a){_0x128257=_0x128257-0x0;var _0x525231=_0xed5c[_0x128257];return _0x525231;};'use strict';var EventEmitter=require(_0xced5('0x0'));var FaxMessage=require(_0xced5('0x1'))['db'][_0xced5('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xced5('0x3')](0x0);var events={'afterCreate':_0xced5('0x4'),'afterUpdate':_0xced5('0x5'),'afterDestroy':_0xced5('0x6')};function emitEvent(_0x395c27){return function(_0x2b8184,_0x2ec4f9,_0x583a62){FaxMessageEvents[_0xced5('0x7')](_0x395c27+':'+_0x2b8184['id'],_0x2b8184);FaxMessageEvents[_0xced5('0x7')](_0x395c27,_0x2b8184);_0x583a62(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xced5('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x6209=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6209,0x1e8));var _0x9620=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6209[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x9620('0x0'));var FaxMessage=require(_0x9620('0x1'))['db'][_0x9620('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9620('0x3')](0x0);var events={'afterCreate':_0x9620('0x4'),'afterUpdate':_0x9620('0x5'),'afterDestroy':_0x9620('0x6')};function emitEvent(_0x5deb40){return function(_0x2869e2,_0x17dc92,_0x2fa00b){FaxMessageEvents['emit'](_0x5deb40+':'+_0x2869e2['id'],_0x2869e2);FaxMessageEvents[_0x9620('0x7')](_0x5deb40,_0x2869e2);_0x2fa00b(null);};}for(var e in events){if(events[_0x9620('0x8')](e)){var event=events[e];FaxMessage[_0x9620('0x9')](e,emitEvent(event));}}module[_0x9620('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c404d1b..fefd483 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 _0x674d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','FULLTEXT','get','direction','toLowerCase','out','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error'];(function(_0x4dbacd,_0x1c409f){var _0x107d1b=function(_0x2043bf){while(--_0x2043bf){_0x4dbacd['push'](_0x4dbacd['shift']());}};_0x107d1b(++_0x1c409f);}(_0x674d,0x1b1));var _0xd674=function(_0x4d1ce8,_0x1a778e){_0x4d1ce8=_0x4d1ce8-0x0;var _0x129384=_0x674d[_0x4d1ce8];return _0x129384;};'use strict';var _=require(_0xd674('0x0'));var util=require(_0xd674('0x1'));var logger=require(_0xd674('0x2'))(_0xd674('0x3'));var moment=require('moment');var BPromise=require(_0xd674('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd674('0x5'));module[_0xd674('0x6')]=function(_0x5165fd,_0x4b5d43){return _0x5165fd[_0xd674('0x7')]('FaxMessage',attributes,{'tableName':_0xd674('0x8'),'paranoid':![],'indexes':[{'name':_0xd674('0x9'),'fields':['body'],'type':_0xd674('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dd34e,_0x319e01,_0x2041d9){var _0x543ee7=_0x5165fd['models'];var _0x44f316=_0x5dd34e[_0xd674('0xb')]({'plain':!![]});if(_0x44f316[_0xd674('0xc')]['toLowerCase']()==='in'||_0x44f316['direction'][_0xd674('0xd')]()===_0xd674('0xe')&&!_0x44f316['secret']&&!_['isNil'](_0x44f316['UserId'])){_0x543ee7[_0xd674('0xf')][_0xd674('0x10')]({'where':{'id':_0x44f316[_0xd674('0x11')]}})[_0xd674('0x12')](function(_0x4d5a00){if(_0x4d5a00){_0x4d5a00[_0xd674('0x13')]({'lastMsgAt':_0x44f316[_0xd674('0x14')],'lastMsgDirection':_0x44f316[_0xd674('0xc')]['toLowerCase']()});}})[_0xd674('0x15')](function(_0x484b0b){console[_0xd674('0x16')](_0x484b0b);});}_0x2041d9();}},'charset':'utf8mb4','collate':_0xd674('0x17')});}; \ No newline at end of file +var _0x0b62=['toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','fti_fax_messages','FULLTEXT','models','get','direction'];(function(_0x2990f2,_0x3793a8){var _0xd6d649=function(_0xad8bad){while(--_0xad8bad){_0x2990f2['push'](_0x2990f2['shift']());}};_0xd6d649(++_0x3793a8);}(_0x0b62,0xec));var _0x20b6=function(_0x4e30ba,_0x5932a1){_0x4e30ba=_0x4e30ba-0x0;var _0x1c8ac4=_0x0b62[_0x4e30ba];return _0x1c8ac4;};'use strict';var _=require('lodash');var util=require(_0x20b6('0x0'));var logger=require(_0x20b6('0x1'))(_0x20b6('0x2'));var moment=require(_0x20b6('0x3'));var BPromise=require(_0x20b6('0x4'));var rp=require(_0x20b6('0x5'));var fs=require('fs');var path=require(_0x20b6('0x6'));var rimraf=require(_0x20b6('0x7'));var config=require('../../config/environment');var attributes=require(_0x20b6('0x8'));module[_0x20b6('0x9')]=function(_0x596944,_0x340f6e){return _0x596944[_0x20b6('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x20b6('0xb'),'fields':['body'],'type':_0x20b6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x120a6a,_0x1224a9,_0x4dc19d){var _0x1fd4ac=_0x596944[_0x20b6('0xd')];var _0x130f1d=_0x120a6a[_0x20b6('0xe')]({'plain':!![]});if(_0x130f1d[_0x20b6('0xf')][_0x20b6('0x10')]()==='in'||_0x130f1d[_0x20b6('0xf')][_0x20b6('0x10')]()===_0x20b6('0x11')&&!_0x130f1d[_0x20b6('0x12')]&&!_[_0x20b6('0x13')](_0x130f1d[_0x20b6('0x14')])){_0x1fd4ac['FaxInteraction']['findOne']({'where':{'id':_0x130f1d[_0x20b6('0x15')]}})[_0x20b6('0x16')](function(_0xbe2c09){if(_0xbe2c09){_0xbe2c09[_0x20b6('0x17')]({'lastMsgAt':_0x130f1d[_0x20b6('0x18')],'lastMsgDirection':_0x130f1d[_0x20b6('0xf')]['toLowerCase']()});}})[_0x20b6('0x19')](function(_0x28c447){console[_0x20b6('0x1a')](_0x28c447);});}_0x4dc19d();}},'charset':_0x20b6('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index f5f927b..c4ee9e7 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 _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbd50,0x196));var _0x0bd5=function(_0x1d0c7a,_0x39d7a8){_0x1d0c7a=_0x1d0c7a-0x0;var _0x3edec4=_0xbd50[_0x1d0c7a];return _0x3edec4;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});}; \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4cad64,_0x13a1d1){var _0x1ebb2d=function(_0x564d94){while(--_0x564d94){_0x4cad64['push'](_0x4cad64['shift']());}};_0x1ebb2d(++_0x13a1d1);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4c9c47,_0x28a81c){_0x4c9c47=_0x4c9c47-0x0;var _0x47563e=_0xd2ea[_0x4c9c47];return _0x47563e;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d04da5b..6717352 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 _0x4146=['removeListener','length','faxMessage:','./faxMessage.events','update','emit'];(function(_0x243119,_0xfb6070){var _0x16749b=function(_0x376cea){while(--_0x376cea){_0x243119['push'](_0x243119['shift']());}};_0x16749b(++_0xfb6070);}(_0x4146,0x1e3));var _0x6414=function(_0x52efad,_0x567969){_0x52efad=_0x52efad-0x0;var _0x7681be=_0x4146[_0x52efad];return _0x7681be;};'use strict';var FaxMessageEvents=require(_0x6414('0x0'));var events=['save','remove',_0x6414('0x1')];function createListener(_0x4324c1,_0xa9e9b1){return function(_0xa4f0b4){_0xa9e9b1[_0x6414('0x2')](_0x4324c1,_0xa4f0b4);};}function removeListener(_0x581b35,_0x446d4c){return function(){FaxMessageEvents[_0x6414('0x3')](_0x581b35,_0x446d4c);};}exports['register']=function(_0x57805a){for(var _0x126fa6=0x0,_0x388899=events[_0x6414('0x4')];_0x126fa6<_0x388899;_0x126fa6++){var _0x4b1efe=events[_0x126fa6];var _0x931ca3=createListener(_0x6414('0x5')+_0x4b1efe,_0x57805a);FaxMessageEvents['on'](_0x4b1efe,_0x931ca3);}}; \ No newline at end of file +var _0xc986=['removeListener','length','faxMessage:','./faxMessage.events','save','update','emit'];(function(_0x60c642,_0xd270ca){var _0xd32484=function(_0x1234b6){while(--_0x1234b6){_0x60c642['push'](_0x60c642['shift']());}};_0xd32484(++_0xd270ca);}(_0xc986,0x176));var _0x6c98=function(_0xc19b38,_0x535577){_0xc19b38=_0xc19b38-0x0;var _0x2d3082=_0xc986[_0xc19b38];return _0x2d3082;};'use strict';var FaxMessageEvents=require(_0x6c98('0x0'));var events=[_0x6c98('0x1'),'remove',_0x6c98('0x2')];function createListener(_0x503301,_0x5aa80b){return function(_0x3692a9){_0x5aa80b[_0x6c98('0x3')](_0x503301,_0x3692a9);};}function removeListener(_0x5c0b05,_0x3a4159){return function(){FaxMessageEvents[_0x6c98('0x4')](_0x5c0b05,_0x3a4159);};}exports['register']=function(_0x5c4a39){for(var _0xcccd6d=0x0,_0x158ff6=events[_0x6c98('0x5')];_0xcccd6d<_0x158ff6;_0xcccd6d++){var _0x308d13=events[_0xcccd6d];var _0x248f9c=createListener(_0x6c98('0x6')+_0x308d13,_0x5c4a39);FaxMessageEvents['on'](_0x308d13,_0x248f9c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b40cc4a..9c81634 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 _0x878f=['update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','/:id','/:id/download','isAuthenticated','post','fax','create','put'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x878f,0x173));var _0xf878=function(_0x3fca2a,_0x1c4daa){_0x3fca2a=_0x3fca2a-0x0;var _0x45fe88=_0x878f[_0x3fca2a];return _0x45fe88;};'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['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['download']);router[_0xf878('0xf')]('/',auth[_0xf878('0xe')](),interaction['tracked'](_0xf878('0x10'),'faxmessage:create'),controller[_0xf878('0x11')]);router[_0xf878('0x12')](_0xf878('0xc'),auth['isAuthenticated'](),controller[_0xf878('0x13')]);router[_0xf878('0x12')](_0xf878('0x14'),auth['isAuthenticated'](),controller[_0xf878('0x15')]);router[_0xf878('0x12')](_0xf878('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xf878('0x17')](_0xf878('0xc'),auth[_0xf878('0xe')](),controller[_0xf878('0x18')]);module[_0xf878('0x19')]=router; \ No newline at end of file +var _0xd87e=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','/describe','describe','get','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer'];(function(_0x4452d2,_0x623e6d){var _0x361c20=function(_0x32e340){while(--_0x32e340){_0x4452d2['push'](_0x4452d2['shift']());}};_0x361c20(++_0x623e6d);}(_0xd87e,0x1bf));var _0xed87=function(_0x3aac36,_0x287fe1){_0x3aac36=_0x3aac36-0x0;var _0x519fe0=_0xd87e[_0x3aac36];return _0x519fe0;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),interaction[_0xed87('0x10')](_0xed87('0x11'),'faxmessage:create'),controller[_0xed87('0x12')]);router[_0xed87('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed87('0x14')]);router[_0xed87('0x13')](_0xed87('0x15'),auth[_0xed87('0x8')](),controller[_0xed87('0x16')]);router[_0xed87('0x13')]('/:id/reject',auth[_0xed87('0x8')](),controller[_0xed87('0x17')]);router[_0xed87('0x18')](_0xed87('0x19'),auth[_0xed87('0x8')](),controller[_0xed87('0x1a')]);module[_0xed87('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0be5f96..b5d01b2 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 _0xc376=['roundrobin','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5250e2,_0xc8ab54){var _0xcbde45=function(_0x326996){while(--_0x326996){_0x5250e2['push'](_0x5250e2['shift']());}};_0xcbde45(++_0xc8ab54);}(_0xc376,0x14b));var _0x6c37=function(_0x4a2183,_0x53e74d){_0x4a2183=_0x4a2183-0x0;var _0xc7c01d=_0xc376[_0x4a2183];return _0xc7c01d;};'use strict';var Sequelize=require('sequelize');module[_0x6c37('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c37('0x1')]},'timeout':{'type':Sequelize[_0x6c37('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6c37('0x3')](_0x6c37('0x4'),'beepall',_0x6c37('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xca9b=['ENUM','beepall','roundrobin','INTEGER','sequelize','exports','STRING','name'];(function(_0x51b51a,_0x2f156c){var _0x40bcd6=function(_0x429572){while(--_0x429572){_0x51b51a['push'](_0x51b51a['shift']());}};_0x40bcd6(++_0x2f156c);}(_0xca9b,0x194));var _0xbca9=function(_0x6ac095,_0x5e6e99){_0x6ac095=_0x6ac095-0x0;var _0x37cb75=_0xca9b[_0x6ac095];return _0x37cb75;};'use strict';var Sequelize=require(_0xbca9('0x0'));module[_0xbca9('0x1')]={'name':{'type':Sequelize[_0xbca9('0x2')],'unique':_0xbca9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbca9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbca9('0x4')]('rrmemory',_0xbca9('0x5'),_0xbca9('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbca9('0x7')],'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 9c3952f..429b554 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 _0x0fab=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','options','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','spread','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','reject','save','update','then','FaxQueues','UserProfileResource','destroy','stack','name','send','index','map','FaxQueue','type','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rawAttributes','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0fab,0x1d0));var _0xb0fa=function(_0x589082,_0x422c84){_0x589082=_0x589082-0x0;var _0x3d4a59=_0x0fab[_0x589082];return _0x3d4a59;};'use strict';var emlformat=require(_0xb0fa('0x0'));var rimraf=require(_0xb0fa('0x1'));var zipdir=require(_0xb0fa('0x2'));var jsonpatch=require(_0xb0fa('0x3'));var rp=require(_0xb0fa('0x4'));var moment=require(_0xb0fa('0x5'));var BPromise=require(_0xb0fa('0x6'));var Mustache=require(_0xb0fa('0x7'));var util=require('util');var path=require(_0xb0fa('0x8'));var sox=require('sox');var csv=require(_0xb0fa('0x9'));var ejs=require(_0xb0fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb0fa('0xb'));var jsforce=require(_0xb0fa('0xc'));var deskjs=require(_0xb0fa('0xd'));var toCsv=require(_0xb0fa('0x9'));var querystring=require(_0xb0fa('0xe'));var Papa=require(_0xb0fa('0xf'));var Redis=require(_0xb0fa('0x10'));var authService=require(_0xb0fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb0fa('0x12'));var hardwareService=require(_0xb0fa('0x13'));var logger=require(_0xb0fa('0x14'))(_0xb0fa('0x15'));var utils=require(_0xb0fa('0x16'));var config=require(_0xb0fa('0x17'));var licenseUtil=require(_0xb0fa('0x18'));var db=require('../../mysqldb')['db'];config[_0xb0fa('0x19')]=_[_0xb0fa('0x1a')](config[_0xb0fa('0x19')],{'host':_0xb0fa('0x1b'),'port':0x18eb});var socket=require(_0xb0fa('0x1c'))(new Redis(config['redis']));require(_0xb0fa('0x1d'))[_0xb0fa('0x1e')](socket);function respondWithStatusCode(_0x219a1c,_0x4240e0){_0x4240e0=_0x4240e0||0xcc;return function(_0x3e2233){if(_0x3e2233){return _0x219a1c[_0xb0fa('0x1f')](_0x4240e0);}return _0x219a1c[_0xb0fa('0x20')](_0x4240e0)['end']();};}function respondWithResult(_0x438d3d,_0x15b9e5){_0x15b9e5=_0x15b9e5||0xc8;return function(_0x1bb36a){if(_0x1bb36a){return _0x438d3d[_0xb0fa('0x20')](_0x15b9e5)['json'](_0x1bb36a);}};}function respondWithFilteredResult(_0x3f8d08,_0x133791){return function(_0x4d2d8c){if(_0x4d2d8c){var _0x310ad0=typeof _0x133791[_0xb0fa('0x21')]===_0xb0fa('0x22')&&typeof _0x133791[_0xb0fa('0x23')]==='undefined';var _0x362cc1=_0x4d2d8c[_0xb0fa('0x24')];var _0x2ee6b3=_0x310ad0?0x0:_0x133791[_0xb0fa('0x21')];var _0x471c4a=_0x310ad0?_0x4d2d8c[_0xb0fa('0x24')]:_0x133791[_0xb0fa('0x21')]+_0x133791[_0xb0fa('0x23')];var _0x38ed49;if(_0x471c4a>=_0x362cc1){_0x471c4a=_0x362cc1;_0x38ed49=0xc8;}else{_0x38ed49=0xce;}_0x3f8d08[_0xb0fa('0x20')](_0x38ed49);return _0x3f8d08['set'](_0xb0fa('0x25'),_0x2ee6b3+'-'+_0x471c4a+'/'+_0x362cc1)['json'](_0x4d2d8c);}return null;};}function patchUpdates(_0x44f5e2){return function(_0x18fed3){try{jsonpatch['apply'](_0x18fed3,_0x44f5e2,!![]);}catch(_0x5e4933){return BPromise[_0xb0fa('0x26')](_0x5e4933);}return _0x18fed3[_0xb0fa('0x27')]();};}function saveUpdates(_0x19b7be,_0x3619f8){return function(_0x14b165){if(_0x14b165){return _0x14b165[_0xb0fa('0x28')](_0x19b7be)[_0xb0fa('0x29')](function(_0x479de1){return _0x479de1;});}return null;};}function removeEntity(_0x3a5764,_0x3205b6){return function(_0x55bee7){if(_0x55bee7){return _0x55bee7['destroy']()[_0xb0fa('0x29')](function(){var _0x285edd=_0x55bee7['get']({'plain':!![]});var _0x4eee2b=_0xb0fa('0x2a');return db[_0xb0fa('0x2b')][_0xb0fa('0x2c')]({'where':{'type':_0x4eee2b,'resourceId':_0x285edd['id']}})['then'](function(){return _0x55bee7;});})[_0xb0fa('0x29')](function(){_0x3a5764[_0xb0fa('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a5321,_0x3033d3){return function(_0x3fc9c7){if(!_0x3fc9c7){_0x1a5321[_0xb0fa('0x1f')](0x194);}return _0x3fc9c7;};}function handleError(_0x26e2f0,_0x2012fc){_0x2012fc=_0x2012fc||0x1f4;return function(_0x4d001e){logger['error'](_0x4d001e[_0xb0fa('0x2d')]);if(_0x4d001e[_0xb0fa('0x2e')]){delete _0x4d001e[_0xb0fa('0x2e')];}_0x26e2f0[_0xb0fa('0x20')](_0x2012fc)[_0xb0fa('0x2f')](_0x4d001e);};}exports[_0xb0fa('0x30')]=function(_0x246059,_0x4c3f91){var _0x58ad70={},_0x3c4d55={},_0x5c4cd1={'count':0x0,'rows':[]};var _0x1be0a1=_[_0xb0fa('0x31')](db[_0xb0fa('0x32')]['rawAttributes'],function(_0xccaada){return{'name':_0xccaada['fieldName'],'type':_0xccaada[_0xb0fa('0x33')]['key']};});_0x3c4d55[_0xb0fa('0x34')]=_[_0xb0fa('0x31')](_0x1be0a1,_0xb0fa('0x2e'));_0x3c4d55[_0xb0fa('0x35')]=_[_0xb0fa('0x36')](_0x246059['query']);_0x3c4d55[_0xb0fa('0x37')]=_['intersection'](_0x3c4d55[_0xb0fa('0x34')],_0x3c4d55[_0xb0fa('0x35')]);_0x58ad70['attributes']=_[_0xb0fa('0x38')](_0x3c4d55['model'],qs[_0xb0fa('0x39')](_0x246059[_0xb0fa('0x35')][_0xb0fa('0x39')]));_0x58ad70['attributes']=_0x58ad70['attributes'][_0xb0fa('0x3a')]?_0x58ad70[_0xb0fa('0x3b')]:_0x3c4d55['model'];if(!_0x246059[_0xb0fa('0x35')]['hasOwnProperty'](_0xb0fa('0x3c'))){_0x58ad70[_0xb0fa('0x23')]=qs[_0xb0fa('0x23')](_0x246059[_0xb0fa('0x35')][_0xb0fa('0x23')]);_0x58ad70[_0xb0fa('0x21')]=qs[_0xb0fa('0x21')](_0x246059[_0xb0fa('0x35')][_0xb0fa('0x21')]);}_0x58ad70[_0xb0fa('0x3d')]=qs[_0xb0fa('0x3e')](_0x246059[_0xb0fa('0x35')][_0xb0fa('0x3e')]);_0x58ad70[_0xb0fa('0x3f')]=qs['filters'](_[_0xb0fa('0x40')](_0x246059[_0xb0fa('0x35')],_0x3c4d55['filters']),_0x1be0a1);if(_0x246059[_0xb0fa('0x35')][_0xb0fa('0x41')]){_0x58ad70[_0xb0fa('0x3f')]=_[_0xb0fa('0x42')](_0x58ad70['where'],{'$or':_['map'](_0x1be0a1,function(_0x5a359f){if(_0x5a359f[_0xb0fa('0x33')]!=='VIRTUAL'){var _0x35bad4={};_0x35bad4[_0x5a359f['name']]={'$like':'%'+_0x246059['query'][_0xb0fa('0x41')]+'%'};return _0x35bad4;}})});}_0x58ad70=_['merge']({},_0x58ad70,_0x246059['options']);var _0x4916f1={'where':_0x58ad70[_0xb0fa('0x3f')]};return db['FaxQueue'][_0xb0fa('0x24')](_0x4916f1)[_0xb0fa('0x29')](function(_0x237f88){_0x5c4cd1[_0xb0fa('0x24')]=_0x237f88;if(_0x246059[_0xb0fa('0x35')][_0xb0fa('0x43')]){_0x58ad70[_0xb0fa('0x44')]=[{'all':!![]}];}return db[_0xb0fa('0x32')][_0xb0fa('0x45')](_0x58ad70);})[_0xb0fa('0x29')](function(_0x11ed31){_0x5c4cd1['rows']=_0x11ed31;return _0x5c4cd1;})[_0xb0fa('0x29')](respondWithFilteredResult(_0x4c3f91,_0x58ad70))['catch'](handleError(_0x4c3f91,null));};exports['show']=function(_0x2dd0bb,_0x43d384){var _0x465435={'raw':!![],'where':{'id':_0x2dd0bb['params']['id']}},_0x402f5e={};_0x402f5e[_0xb0fa('0x34')]=_[_0xb0fa('0x36')](db[_0xb0fa('0x32')][_0xb0fa('0x46')]);_0x402f5e['query']=_[_0xb0fa('0x36')](_0x2dd0bb['query']);_0x402f5e[_0xb0fa('0x37')]=_['intersection'](_0x402f5e[_0xb0fa('0x34')],_0x402f5e[_0xb0fa('0x35')]);_0x465435['attributes']=_[_0xb0fa('0x38')](_0x402f5e[_0xb0fa('0x34')],qs[_0xb0fa('0x39')](_0x2dd0bb[_0xb0fa('0x35')][_0xb0fa('0x39')]));_0x465435[_0xb0fa('0x3b')]=_0x465435[_0xb0fa('0x3b')][_0xb0fa('0x3a')]?_0x465435[_0xb0fa('0x3b')]:_0x402f5e[_0xb0fa('0x34')];if(_0x2dd0bb[_0xb0fa('0x35')]['includeAll']){_0x465435['include']=[{'all':!![]}];}_0x465435=_['merge']({},_0x465435,_0x2dd0bb['options']);return db['FaxQueue'][_0xb0fa('0x47')](_0x465435)[_0xb0fa('0x29')](handleEntityNotFound(_0x43d384,null))[_0xb0fa('0x29')](respondWithResult(_0x43d384,null))[_0xb0fa('0x48')](handleError(_0x43d384,null));};exports[_0xb0fa('0x49')]=function(_0x1a4302,_0x42dcf2){return db[_0xb0fa('0x32')][_0xb0fa('0x49')](_0x1a4302[_0xb0fa('0x4a')],{})['then'](function(_0xaf68cf){var _0x2ecd12=_0x1a4302[_0xb0fa('0x4b')][_0xb0fa('0x4c')]({'plain':!![]});if(!_0x2ecd12)throw new Error(_0xb0fa('0x4d'));if(_0x2ecd12[_0xb0fa('0x4e')]==='user'){var _0xf8f6d0=_0xaf68cf[_0xb0fa('0x4c')]({'plain':!![]});var _0xe53254=_0xb0fa('0x2a');return db[_0xb0fa('0x4f')][_0xb0fa('0x47')]({'where':{'name':_0xe53254,'userProfileId':_0x2ecd12['userProfileId']},'raw':!![]})[_0xb0fa('0x29')](function(_0x50bec5){if(_0x50bec5&&_0x50bec5['autoAssociation']===0x0){return db[_0xb0fa('0x2b')][_0xb0fa('0x49')]({'name':_0xf8f6d0[_0xb0fa('0x2e')],'resourceId':_0xf8f6d0['id'],'type':_0x50bec5[_0xb0fa('0x2e')],'sectionId':_0x50bec5['id']},{})[_0xb0fa('0x29')](function(){return _0xaf68cf;});}else{return _0xaf68cf;}})[_0xb0fa('0x48')](function(_0x2bb695){logger['error'](_0xb0fa('0x50'),_0x2bb695);throw _0x2bb695;});}return _0xaf68cf;})[_0xb0fa('0x29')](respondWithResult(_0x42dcf2,0xc9))['catch'](handleError(_0x42dcf2,null));};exports[_0xb0fa('0x28')]=function(_0x3999a6,_0x29fd0f){if(_0x3999a6[_0xb0fa('0x4a')]['id']){delete _0x3999a6[_0xb0fa('0x4a')]['id'];}return db[_0xb0fa('0x32')]['find']({'where':{'id':_0x3999a6[_0xb0fa('0x51')]['id']}})['then'](handleEntityNotFound(_0x29fd0f,null))[_0xb0fa('0x29')](saveUpdates(_0x3999a6[_0xb0fa('0x4a')],null))[_0xb0fa('0x29')](respondWithResult(_0x29fd0f,null))[_0xb0fa('0x48')](handleError(_0x29fd0f,null));};exports['destroy']=function(_0x423518,_0xff5f8a){return db['FaxQueue'][_0xb0fa('0x47')]({'where':{'id':_0x423518['params']['id']}})[_0xb0fa('0x29')](handleEntityNotFound(_0xff5f8a,null))['then'](removeEntity(_0xff5f8a,null))['catch'](handleError(_0xff5f8a,null));};exports[_0xb0fa('0x52')]=function(_0x531ea2,_0x4d9120){return db[_0xb0fa('0x32')][_0xb0fa('0x52')]()['then'](respondWithResult(_0x4d9120,null))[_0xb0fa('0x48')](handleError(_0x4d9120,null));};exports['getMembers']=function(_0xb02cee,_0x3b905d,_0x1fec6a){var _0x3932b6={'raw':!![],'where':{}},_0x1c9355={},_0x31e62d;return db[_0xb0fa('0x32')][_0xb0fa('0x53')]({'where':{'id':_0xb02cee[_0xb0fa('0x51')]['id']}})[_0xb0fa('0x29')](handleEntityNotFound(_0x3b905d,null))[_0xb0fa('0x29')](function(_0x3ddbc7){if(_0x3ddbc7){_0x31e62d=_0x3ddbc7[_0xb0fa('0x4c')]({'plain':!![]});_0x1c9355['model']=_[_0xb0fa('0x36')](db[_0xb0fa('0x54')][_0xb0fa('0x46')]);_0x1c9355['query']=_[_0xb0fa('0x36')](_0xb02cee[_0xb0fa('0x35')]);_0x1c9355[_0xb0fa('0x37')]=_[_0xb0fa('0x38')](_0x1c9355[_0xb0fa('0x34')],_0x1c9355[_0xb0fa('0x35')]);_0x3932b6[_0xb0fa('0x3b')]=_['intersection'](_0x1c9355[_0xb0fa('0x34')],qs[_0xb0fa('0x39')](_0xb02cee[_0xb0fa('0x35')][_0xb0fa('0x39')]));_0x3932b6[_0xb0fa('0x3b')]=_0x3932b6[_0xb0fa('0x3b')]['length']?_0x3932b6[_0xb0fa('0x3b')]:_0x1c9355[_0xb0fa('0x34')];if(!_0xb02cee[_0xb0fa('0x35')][_0xb0fa('0x55')](_0xb0fa('0x3c'))){_0x3932b6['limit']=qs[_0xb0fa('0x23')](_0xb02cee[_0xb0fa('0x35')][_0xb0fa('0x23')]);_0x3932b6['offset']=qs[_0xb0fa('0x21')](_0xb02cee[_0xb0fa('0x35')][_0xb0fa('0x21')]);}_0x3932b6[_0xb0fa('0x3d')]=qs[_0xb0fa('0x3e')](_0xb02cee[_0xb0fa('0x35')]['sort']);_0x3932b6['where']=qs[_0xb0fa('0x37')](_['pick'](_0xb02cee[_0xb0fa('0x35')],_0x1c9355[_0xb0fa('0x37')]));_0x3932b6[_0xb0fa('0x3f')][_0xb0fa('0x56')]=_0x3ddbc7['id'];if(_0xb02cee['query'][_0xb0fa('0x41')]){_0x3932b6[_0xb0fa('0x3f')]=_[_0xb0fa('0x42')](_0x3932b6[_0xb0fa('0x3f')],{'$or':_[_0xb0fa('0x31')](_0x3932b6['attributes'],function(_0x29969d){var _0x100153={};_0x100153[_0x29969d]={'$like':'%'+_0xb02cee['query'][_0xb0fa('0x41')]+'%'};return _0x100153;})});}_0x3932b6=_[_0xb0fa('0x42')]({},_0x3932b6,_0xb02cee[_0xb0fa('0x57')]);return db[_0xb0fa('0x54')][_0xb0fa('0x45')](_0x3932b6);}})[_0xb0fa('0x29')](function(_0x530c9e){if(_0x530c9e){return db[_0xb0fa('0x58')][_0xb0fa('0x59')]({'where':{'id':_[_0xb0fa('0x31')](_0x530c9e,_0xb0fa('0x5a')),'role':_0xb0fa('0x5b')},'attributes':['id',_0xb0fa('0x2e'),_0xb0fa('0x5c'),_0xb0fa('0x5d'),_0xb0fa('0x5e')]});}})[_0xb0fa('0x29')](function(_0x5c63fe){if(_0x5c63fe){return{'count':_0x5c63fe[_0xb0fa('0x24')],'rows':_[_0xb0fa('0x31')](_0x5c63fe[_0xb0fa('0x5f')],function(_0x3e7234){return{'membername':_0x3e7234[_0xb0fa('0x2e')],'UserId':_0x3e7234['id'],'queue_name':_0x31e62d[_0xb0fa('0x2e')],'FaxQueueId':_0x31e62d['id'],'interface':util[_0xb0fa('0x60')](_0xb0fa('0x61'),_0xb0fa('0x62'),_0x3e7234[_0xb0fa('0x2e')]),'penalty':0x0,'paused':_0x3e7234['faxPause'],'createdAt':_0x3e7234[_0xb0fa('0x5e')],'updatedAt':_0x3e7234[_0xb0fa('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0fa('0x29')](respondWithFilteredResult(_0x3b905d,_0x3932b6))[_0xb0fa('0x48')](handleError(_0x3b905d,null));};exports[_0xb0fa('0x63')]=function(_0x34838f,_0x3cc28e,_0x2d6569){var _0x2f6cc7={};var _0xd44c39={};var _0x13e0f3;var _0x2c25e8;return db[_0xb0fa('0x32')][_0xb0fa('0x53')]({'where':{'id':_0x34838f['params']['id']}})['then'](handleEntityNotFound(_0x3cc28e,null))['then'](function(_0x1a857b){if(_0x1a857b){_0x13e0f3=_0x1a857b;_0xd44c39[_0xb0fa('0x34')]=_[_0xb0fa('0x36')](db[_0xb0fa('0x64')]['rawAttributes']);_0xd44c39[_0xb0fa('0x35')]=_[_0xb0fa('0x36')](_0x34838f[_0xb0fa('0x35')]);_0xd44c39[_0xb0fa('0x37')]=_[_0xb0fa('0x38')](_0xd44c39[_0xb0fa('0x34')],_0xd44c39['query']);_0x2f6cc7[_0xb0fa('0x3b')]=_['intersection'](_0xd44c39[_0xb0fa('0x34')],qs[_0xb0fa('0x39')](_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x39')]));_0x2f6cc7[_0xb0fa('0x3b')]=_0x2f6cc7[_0xb0fa('0x3b')][_0xb0fa('0x3a')]?_0x2f6cc7[_0xb0fa('0x3b')]:_0xd44c39['model'];_0x2f6cc7['order']=qs[_0xb0fa('0x3e')](_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x3e')]);_0x2f6cc7['where']=qs[_0xb0fa('0x37')](_['pick'](_0x34838f[_0xb0fa('0x35')],_0xd44c39[_0xb0fa('0x37')]));if(_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x41')]){_0x2f6cc7['where']=_['merge'](_0x2f6cc7['where'],{'$or':_['map'](_0x2f6cc7[_0xb0fa('0x3b')],function(_0x31a043){var _0x28a8bc={};_0x28a8bc[_0x31a043]={'$like':'%'+_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x41')]+'%'};return _0x28a8bc;})});}_0x2f6cc7=_['merge']({},_0x2f6cc7,_0x34838f[_0xb0fa('0x57')]);return _0x13e0f3['getTeams'](_0x2f6cc7);}})['then'](function(_0x3fbec3){if(_0x3fbec3){_0x2c25e8=_0x3fbec3['length'];if(!_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x55')](_0xb0fa('0x3c'))){_0x2f6cc7[_0xb0fa('0x23')]=qs[_0xb0fa('0x23')](_0x34838f['query'][_0xb0fa('0x23')]);_0x2f6cc7[_0xb0fa('0x21')]=qs[_0xb0fa('0x21')](_0x34838f[_0xb0fa('0x35')][_0xb0fa('0x21')]);}return _0x13e0f3[_0xb0fa('0x63')](_0x2f6cc7);}})[_0xb0fa('0x29')](function(_0x2dec31){if(_0x2dec31){return _0x2dec31?{'count':_0x2c25e8,'rows':_0x2dec31}:null;}})[_0xb0fa('0x29')](respondWithResult(_0x3cc28e,null))[_0xb0fa('0x48')](handleError(_0x3cc28e,null));};exports[_0xb0fa('0x65')]=function(_0x2147c8,_0xb6ee68,_0x40bd61){var _0x276303=_0x2147c8['body'][_0xb0fa('0x66')];return db[_0xb0fa('0x64')]['findAll']({'where':{'id':_0x276303},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb0fa('0x2e'),_0xb0fa('0x67'),_0xb0fa('0x68'),'interface'],'raw':!![]}]})[_0xb0fa('0x29')](function(_0x5dcad6){if(_0x5dcad6){var _0x4b1ff0=_[_0xb0fa('0x69')](_0x5dcad6,function(_0xa64cc){var _0x5a4b85=_0xa64cc[_0xb0fa('0x4c')]({'plain':!![]});return _0x5a4b85[_0xb0fa('0x6a')];});return db[_0xb0fa('0x32')]['find']({'where':{'id':_0x2147c8[_0xb0fa('0x51')]['id']}})['then'](function(_0x225a8a){return db[_0xb0fa('0x6b')][_0xb0fa('0x6c')](function(_0x40cc80){return _0x225a8a['addTeams'](_0x276303,{'transaction':_0x40cc80})['then'](function(){return BPromise['each'](_0x4b1ff0,function(_0x44fd65){return db[_0xb0fa('0x54')][_0xb0fa('0x6d')]({'where':{'UserId':_0x44fd65['id'],'FaxQueueId':_0x2147c8[_0xb0fa('0x51')]['id']},'transaction':_0x40cc80});});})['then'](function(){_0x4b1ff0[_0xb0fa('0x6e')](function(_0x6bc765){socket[_0xb0fa('0x6f')]('userFaxQueue:save',{'UserId':_0x6bc765['id'],'FaxQueueId':_0x225a8a['id']});});});});});}})[_0xb0fa('0x29')](respondWithStatusCode(_0xb6ee68,null))[_0xb0fa('0x48')](handleError(_0xb6ee68,null));};exports[_0xb0fa('0x70')]=function(_0x55c8b8,_0x58497d,_0x3e42d4){return db[_0xb0fa('0x64')][_0xb0fa('0x45')]({'where':{'id':_0x55c8b8['query'][_0xb0fa('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb0fa('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x58497d,null))[_0xb0fa('0x29')](function(_0x284bbb){var _0x59b7aa=_[_0xb0fa('0x31')](_0x284bbb,'id');var _0x469596=[];var _0x31d926=[];var _0xc91e07=squel[_0xb0fa('0x71')]();_0xc91e07[_0xb0fa('0x72')]('tq.TeamId')[_0xb0fa('0x73')]('team_has_fax_queues','tq')['join'](_0xb0fa('0x74'),'ut',_0xb0fa('0x75'))['where']('FaxQueueId\x20=\x20?',_0x55c8b8[_0xb0fa('0x51')]['id']);for(var _0x3a2a9d=0x0;_0x3a2a9d<_0x284bbb['length'];_0x3a2a9d+=0x1){let _0x2972d0=_0x284bbb[_0x3a2a9d];for(var _0x4fdafe=0x0;_0x4fdafe<_0x2972d0[_0xb0fa('0x6a')][_0xb0fa('0x3a')];_0x4fdafe+=0x1){let _0x458996=_0x2972d0[_0xb0fa('0x6a')][_0x4fdafe];var _0x17e47e=_0xc91e07[_0xb0fa('0x76')]();_0x17e47e[_0xb0fa('0x3f')](_0xb0fa('0x77'),_0x458996['id']);_0x31d926['push'](db['sequelize'][_0xb0fa('0x35')](_0x17e47e['toString'](),{'type':db['sequelize'][_0xb0fa('0x78')][_0xb0fa('0x79')]})[_0xb0fa('0x29')](function(_0x4708b0){if(_0x4708b0[_0xb0fa('0x3a')]===0x1){return _0x458996['id'];}else{var _0xed7b25=_[_0xb0fa('0x7a')](_[_0xb0fa('0x31')](_0x4708b0,_0xb0fa('0x7b')),function(_0x144860){return _[_0xb0fa('0x7c')](_0x59b7aa,_0x144860);});if(_0xed7b25){return _0x458996['id'];}}}));}}return BPromise[_0xb0fa('0x7d')](_0x31d926)[_0xb0fa('0x29')](function(_0x5b37c0){_0x469596=_(_0x469596)['union'](_0x5b37c0)[_0xb0fa('0x7e')]()[_0xb0fa('0x7f')]();return db['FaxQueue']['find']({'where':{'id':_0x55c8b8['params']['id']}})[_0xb0fa('0x29')](function(_0x3d56f6){return db['sequelize'][_0xb0fa('0x6c')](function(_0x1b899d){return _0x3d56f6[_0xb0fa('0x70')](_0x55c8b8[_0xb0fa('0x35')][_0xb0fa('0x66')],{'transaction':_0x1b899d})[_0xb0fa('0x29')](function(){if(!_[_0xb0fa('0x80')](_0x469596)){return _0x3d56f6[_0xb0fa('0x81')](_0x469596,{'transaction':_0x1b899d});}})[_0xb0fa('0x29')](function(){_0x469596[_0xb0fa('0x6e')](function(_0x52a5b3){socket[_0xb0fa('0x6f')]('userFaxQueue:remove',{'UserId':_0x52a5b3,'FaxQueueId':_0x3d56f6['id']});});});});});});})[_0xb0fa('0x29')](respondWithStatusCode(_0x58497d,null))[_0xb0fa('0x48')](handleError(_0x58497d,null));};exports[_0xb0fa('0x82')]=function(_0x3a8cf6,_0x18627c,_0x4ce28a){return db[_0xb0fa('0x32')][_0xb0fa('0x47')]({'where':{'id':_0x3a8cf6['params']['id']}})[_0xb0fa('0x29')](handleEntityNotFound(_0x18627c,null))['then'](function(_0x2c72f2){if(_0x2c72f2){return _0x2c72f2[_0xb0fa('0x82')](_0x3a8cf6[_0xb0fa('0x4a')][_0xb0fa('0x66')],_['omit'](_0x3a8cf6['body'],[_0xb0fa('0x66'),'id'])||{})[_0xb0fa('0x83')](function(_0xe966cd){for(var _0x370c34=0x0;_0x370c34<_0x3a8cf6[_0xb0fa('0x4a')][_0xb0fa('0x66')][_0xb0fa('0x3a')];_0x370c34+=0x1){socket[_0xb0fa('0x6f')](_0xb0fa('0x84'),{'UserId':Number(_0x3a8cf6[_0xb0fa('0x4a')]['ids'][_0x370c34]),'FaxQueueId':Number(_0x3a8cf6[_0xb0fa('0x51')]['id'])});}return _0xe966cd;});}})['then'](respondWithResult(_0x18627c,null))[_0xb0fa('0x48')](handleError(_0x18627c,null));};exports[_0xb0fa('0x81')]=function(_0x1452ca,_0x16935c,_0x353c69){return db[_0xb0fa('0x32')][_0xb0fa('0x47')]({'where':{'id':_0x1452ca[_0xb0fa('0x51')]['id']}})[_0xb0fa('0x29')](handleEntityNotFound(_0x16935c,null))[_0xb0fa('0x29')](function(_0x2db365){if(_0x2db365){return _0x2db365[_0xb0fa('0x81')](_0x1452ca[_0xb0fa('0x35')][_0xb0fa('0x66')])[_0xb0fa('0x29')](function(){if(_[_0xb0fa('0x85')](_0x1452ca[_0xb0fa('0x35')][_0xb0fa('0x66')])){for(var _0x181d81=0x0;_0x181d81<_0x1452ca[_0xb0fa('0x35')][_0xb0fa('0x66')][_0xb0fa('0x3a')];_0x181d81+=0x1){socket[_0xb0fa('0x6f')](_0xb0fa('0x86'),{'UserId':Number(_0x1452ca[_0xb0fa('0x35')][_0xb0fa('0x66')][_0x181d81]),'FaxQueueId':Number(_0x1452ca[_0xb0fa('0x51')]['id'])});}}else{socket[_0xb0fa('0x6f')](_0xb0fa('0x86'),{'UserId':Number(_0x1452ca[_0xb0fa('0x35')][_0xb0fa('0x66')]),'FaxQueueId':Number(_0x1452ca[_0xb0fa('0x51')]['id'])});}});}})[_0xb0fa('0x29')](respondWithStatusCode(_0x16935c,null))['catch'](handleError(_0x16935c,null));};exports[_0xb0fa('0x87')]=function(_0x5b07c5,_0x537ea3,_0x266e79){var _0x50227d={};var _0x1386b0={};var _0x2fe54d;var _0x459fe2;return db[_0xb0fa('0x32')][_0xb0fa('0x53')]({'where':{'id':_0x5b07c5['params']['id']}})[_0xb0fa('0x29')](handleEntityNotFound(_0x537ea3,null))['then'](function(_0x4dbcce){if(_0x4dbcce){_0x2fe54d=_0x4dbcce;_0x1386b0[_0xb0fa('0x34')]=_[_0xb0fa('0x36')](db['User'][_0xb0fa('0x46')]);_0x1386b0[_0xb0fa('0x35')]=_[_0xb0fa('0x36')](_0x5b07c5['query']);_0x1386b0[_0xb0fa('0x37')]=_['intersection'](_0x1386b0[_0xb0fa('0x34')],_0x1386b0[_0xb0fa('0x35')]);_0x50227d[_0xb0fa('0x3b')]=_[_0xb0fa('0x38')](_0x1386b0[_0xb0fa('0x34')],qs['fields'](_0x5b07c5[_0xb0fa('0x35')][_0xb0fa('0x39')]));_0x50227d['attributes']=_0x50227d[_0xb0fa('0x3b')][_0xb0fa('0x3a')]?_0x50227d['attributes']:_0x1386b0[_0xb0fa('0x34')];_0x50227d['order']=qs[_0xb0fa('0x3e')](_0x5b07c5[_0xb0fa('0x35')]['sort']);_0x50227d[_0xb0fa('0x3f')]=qs[_0xb0fa('0x37')](_[_0xb0fa('0x40')](_0x5b07c5[_0xb0fa('0x35')],_0x1386b0['filters']));if(_0x5b07c5[_0xb0fa('0x35')][_0xb0fa('0x41')]){_0x50227d[_0xb0fa('0x3f')]=_[_0xb0fa('0x42')](_0x50227d[_0xb0fa('0x3f')],{'$or':_['map'](_0x50227d['attributes'],function(_0x20d3d7){var _0x1287ae={};_0x1287ae[_0x20d3d7]={'$like':'%'+_0x5b07c5[_0xb0fa('0x35')][_0xb0fa('0x41')]+'%'};return _0x1287ae;})});}_0x50227d=_[_0xb0fa('0x42')]({},_0x50227d,_0x5b07c5[_0xb0fa('0x57')]);return _0x2fe54d[_0xb0fa('0x87')](_0x50227d);}})['then'](function(_0x14f1dd){if(_0x14f1dd){_0x459fe2=_0x14f1dd[_0xb0fa('0x3a')];if(!_0x5b07c5[_0xb0fa('0x35')]['hasOwnProperty'](_0xb0fa('0x3c'))){_0x50227d[_0xb0fa('0x23')]=qs[_0xb0fa('0x23')](_0x5b07c5[_0xb0fa('0x35')][_0xb0fa('0x23')]);_0x50227d['offset']=qs['offset'](_0x5b07c5['query'][_0xb0fa('0x21')]);}return _0x2fe54d['getAgents'](_0x50227d);}})[_0xb0fa('0x29')](function(_0x1c5556){if(_0x1c5556){return _0x1c5556?{'count':_0x459fe2,'rows':_0x1c5556}:null;}})['then'](respondWithResult(_0x537ea3,null))[_0xb0fa('0x48')](handleError(_0x537ea3,null));}; \ No newline at end of file +var _0x9ec6=['getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','SIP','getTeams','addTeams','ids','findAll','User','Agents','voicePause','interface','flatMap','sequelize','each','userFaxQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','transaction','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray'];(function(_0x591142,_0x17f4c7){var _0x5e7a97=function(_0x43dbe1){while(--_0x43dbe1){_0x591142['push'](_0x591142['shift']());}};_0x5e7a97(++_0x17f4c7);}(_0x9ec6,0x117));var _0x69ec=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0x9ec6[_0x1a014b];return _0x462258;};'use strict';var emlformat=require(_0x69ec('0x0'));var rimraf=require(_0x69ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69ec('0x2'));var moment=require(_0x69ec('0x3'));var BPromise=require(_0x69ec('0x4'));var Mustache=require(_0x69ec('0x5'));var util=require(_0x69ec('0x6'));var path=require(_0x69ec('0x7'));var sox=require(_0x69ec('0x8'));var csv=require('to-csv');var ejs=require(_0x69ec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x69ec('0xa'));var crypto=require(_0x69ec('0xb'));var jsforce=require(_0x69ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x69ec('0xd'));var querystring=require(_0x69ec('0xe'));var Papa=require(_0x69ec('0xf'));var Redis=require(_0x69ec('0x10'));var authService=require(_0x69ec('0x11'));var qs=require(_0x69ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69ec('0x13'));var logger=require(_0x69ec('0x14'))(_0x69ec('0x15'));var utils=require('../../config/utils');var config=require(_0x69ec('0x16'));var licenseUtil=require(_0x69ec('0x17'));var db=require('../../mysqldb')['db'];config[_0x69ec('0x18')]=_[_0x69ec('0x19')](config[_0x69ec('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x69ec('0x1a'))(new Redis(config['redis']));require(_0x69ec('0x1b'))['register'](socket);function respondWithStatusCode(_0xb7dded,_0x2d3180){_0x2d3180=_0x2d3180||0xcc;return function(_0x23a385){if(_0x23a385){return _0xb7dded[_0x69ec('0x1c')](_0x2d3180);}return _0xb7dded[_0x69ec('0x1d')](_0x2d3180)[_0x69ec('0x1e')]();};}function respondWithResult(_0x55ee13,_0xc4f90f){_0xc4f90f=_0xc4f90f||0xc8;return function(_0x3c15aa){if(_0x3c15aa){return _0x55ee13[_0x69ec('0x1d')](_0xc4f90f)['json'](_0x3c15aa);}};}function respondWithFilteredResult(_0x520697,_0x427510){return function(_0x3ad73b){if(_0x3ad73b){var _0x313c80=typeof _0x427510[_0x69ec('0x1f')]===_0x69ec('0x20')&&typeof _0x427510[_0x69ec('0x21')]===_0x69ec('0x20');var _0x28ffe3=_0x3ad73b[_0x69ec('0x22')];var _0x3be7c3=_0x313c80?0x0:_0x427510[_0x69ec('0x1f')];var _0x2ef538=_0x313c80?_0x3ad73b[_0x69ec('0x22')]:_0x427510[_0x69ec('0x1f')]+_0x427510[_0x69ec('0x21')];var _0x29c80f;if(_0x2ef538>=_0x28ffe3){_0x2ef538=_0x28ffe3;_0x29c80f=0xc8;}else{_0x29c80f=0xce;}_0x520697['status'](_0x29c80f);return _0x520697[_0x69ec('0x23')]('Content-Range',_0x3be7c3+'-'+_0x2ef538+'/'+_0x28ffe3)['json'](_0x3ad73b);}return null;};}function patchUpdates(_0x5e4764){return function(_0x4a5972){try{jsonpatch[_0x69ec('0x24')](_0x4a5972,_0x5e4764,!![]);}catch(_0x29c404){return BPromise[_0x69ec('0x25')](_0x29c404);}return _0x4a5972['save']();};}function saveUpdates(_0x313673,_0x3de3f9){return function(_0x3c4660){if(_0x3c4660){return _0x3c4660[_0x69ec('0x26')](_0x313673)[_0x69ec('0x27')](function(_0x18f2e8){return _0x18f2e8;});}return null;};}function removeEntity(_0x5e9b53,_0x3cf22e){return function(_0x5e3c63){if(_0x5e3c63){return _0x5e3c63[_0x69ec('0x28')]()[_0x69ec('0x27')](function(){var _0x5cdcf4=_0x5e3c63[_0x69ec('0x29')]({'plain':!![]});var _0x517e4a='FaxQueues';return db[_0x69ec('0x2a')][_0x69ec('0x28')]({'where':{'type':_0x517e4a,'resourceId':_0x5cdcf4['id']}})[_0x69ec('0x27')](function(){return _0x5e3c63;});})[_0x69ec('0x27')](function(){_0x5e9b53['status'](0xcc)[_0x69ec('0x1e')]();});}};}function handleEntityNotFound(_0x4456e0,_0x200ce0){return function(_0x4ce5a5){if(!_0x4ce5a5){_0x4456e0[_0x69ec('0x1c')](0x194);}return _0x4ce5a5;};}function handleError(_0x5bdf82,_0x1883a4){_0x1883a4=_0x1883a4||0x1f4;return function(_0xea2925){logger['error'](_0xea2925[_0x69ec('0x2b')]);if(_0xea2925['name']){delete _0xea2925[_0x69ec('0x2c')];}_0x5bdf82[_0x69ec('0x1d')](_0x1883a4)['send'](_0xea2925);};}exports['index']=function(_0x5bf4a5,_0x2767e6){var _0x1c14a9={},_0x309110={},_0x270e02={'count':0x0,'rows':[]};var _0x5f228c=_[_0x69ec('0x2d')](db[_0x69ec('0x2e')][_0x69ec('0x2f')],function(_0x1bcccc){return{'name':_0x1bcccc[_0x69ec('0x30')],'type':_0x1bcccc[_0x69ec('0x31')][_0x69ec('0x32')]};});_0x309110[_0x69ec('0x33')]=_[_0x69ec('0x2d')](_0x5f228c,_0x69ec('0x2c'));_0x309110[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x5bf4a5['query']);_0x309110[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x309110['model'],_0x309110[_0x69ec('0x34')]);_0x1c14a9[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x309110[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x5bf4a5[_0x69ec('0x34')]['fields']));_0x1c14a9[_0x69ec('0x38')]=_0x1c14a9[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x1c14a9[_0x69ec('0x38')]:_0x309110['model'];if(!_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x3b')](_0x69ec('0x3c'))){_0x1c14a9['limit']=qs['limit'](_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x21')]);_0x1c14a9[_0x69ec('0x1f')]=qs['offset'](_0x5bf4a5[_0x69ec('0x34')]['offset']);}_0x1c14a9[_0x69ec('0x3d')]=qs[_0x69ec('0x3e')](_0x5bf4a5['query']['sort']);_0x1c14a9[_0x69ec('0x3f')]=qs[_0x69ec('0x36')](_[_0x69ec('0x40')](_0x5bf4a5[_0x69ec('0x34')],_0x309110[_0x69ec('0x36')]),_0x5f228c);if(_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x41')]){_0x1c14a9[_0x69ec('0x3f')]=_['merge'](_0x1c14a9['where'],{'$or':_[_0x69ec('0x2d')](_0x5f228c,function(_0x5c96c3){if(_0x5c96c3[_0x69ec('0x31')]!==_0x69ec('0x42')){var _0x5e82bd={};_0x5e82bd[_0x5c96c3[_0x69ec('0x2c')]]={'$like':'%'+_0x5bf4a5['query'][_0x69ec('0x41')]+'%'};return _0x5e82bd;}})});}_0x1c14a9=_[_0x69ec('0x43')]({},_0x1c14a9,_0x5bf4a5[_0x69ec('0x44')]);var _0xcd651d={'where':_0x1c14a9[_0x69ec('0x3f')]};return db[_0x69ec('0x2e')][_0x69ec('0x22')](_0xcd651d)[_0x69ec('0x27')](function(_0x49216a){_0x270e02[_0x69ec('0x22')]=_0x49216a;if(_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x45')]){_0x1c14a9['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x1c14a9);})[_0x69ec('0x27')](function(_0x373f64){_0x270e02['rows']=_0x373f64;return _0x270e02;})['then'](respondWithFilteredResult(_0x2767e6,_0x1c14a9))[_0x69ec('0x46')](handleError(_0x2767e6,null));};exports['show']=function(_0x4c8d7e,_0x13864a){var _0x39a06e={'raw':!![],'where':{'id':_0x4c8d7e['params']['id']}},_0x4846fd={};_0x4846fd['model']=_[_0x69ec('0x35')](db['FaxQueue']['rawAttributes']);_0x4846fd['query']=_[_0x69ec('0x35')](_0x4c8d7e[_0x69ec('0x34')]);_0x4846fd[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x4846fd['model'],_0x4846fd[_0x69ec('0x34')]);_0x39a06e[_0x69ec('0x38')]=_['intersection'](_0x4846fd[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x4c8d7e[_0x69ec('0x34')][_0x69ec('0x39')]));_0x39a06e[_0x69ec('0x38')]=_0x39a06e[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x39a06e[_0x69ec('0x38')]:_0x4846fd['model'];if(_0x4c8d7e[_0x69ec('0x34')]['includeAll']){_0x39a06e[_0x69ec('0x47')]=[{'all':!![]}];}_0x39a06e=_['merge']({},_0x39a06e,_0x4c8d7e['options']);return db['FaxQueue'][_0x69ec('0x48')](_0x39a06e)[_0x69ec('0x27')](handleEntityNotFound(_0x13864a,null))[_0x69ec('0x27')](respondWithResult(_0x13864a,null))['catch'](handleError(_0x13864a,null));};exports[_0x69ec('0x49')]=function(_0x3f28b8,_0x3dcbcf){return db[_0x69ec('0x2e')][_0x69ec('0x49')](_0x3f28b8[_0x69ec('0x4a')],{})[_0x69ec('0x27')](function(_0x4e31f3){var _0x3fabd7=_0x3f28b8[_0x69ec('0x4b')]['get']({'plain':!![]});if(!_0x3fabd7)throw new Error(_0x69ec('0x4c'));if(_0x3fabd7[_0x69ec('0x4d')]===_0x69ec('0x4b')){var _0xfd5451=_0x4e31f3[_0x69ec('0x29')]({'plain':!![]});var _0x44d551=_0x69ec('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x44d551,'userProfileId':_0x3fabd7['userProfileId']},'raw':!![]})[_0x69ec('0x27')](function(_0x46c841){if(_0x46c841&&_0x46c841[_0x69ec('0x4f')]===0x0){return db[_0x69ec('0x2a')][_0x69ec('0x49')]({'name':_0xfd5451[_0x69ec('0x2c')],'resourceId':_0xfd5451['id'],'type':_0x46c841[_0x69ec('0x2c')],'sectionId':_0x46c841['id']},{})[_0x69ec('0x27')](function(){return _0x4e31f3;});}else{return _0x4e31f3;}})['catch'](function(_0x2bf067){logger[_0x69ec('0x50')](_0x69ec('0x51'),_0x2bf067);throw _0x2bf067;});}return _0x4e31f3;})[_0x69ec('0x27')](respondWithResult(_0x3dcbcf,0xc9))[_0x69ec('0x46')](handleError(_0x3dcbcf,null));};exports[_0x69ec('0x26')]=function(_0x2f41bf,_0x31b4bf){if(_0x2f41bf['body']['id']){delete _0x2f41bf[_0x69ec('0x4a')]['id'];}return db['FaxQueue'][_0x69ec('0x48')]({'where':{'id':_0x2f41bf[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x31b4bf,null))[_0x69ec('0x27')](saveUpdates(_0x2f41bf['body'],null))[_0x69ec('0x27')](respondWithResult(_0x31b4bf,null))['catch'](handleError(_0x31b4bf,null));};exports[_0x69ec('0x28')]=function(_0x18da00,_0x1d3e69){return db[_0x69ec('0x2e')]['find']({'where':{'id':_0x18da00['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x1d3e69,null))['then'](removeEntity(_0x1d3e69,null))[_0x69ec('0x46')](handleError(_0x1d3e69,null));};exports[_0x69ec('0x53')]=function(_0x6ea0a,_0x1805e3){return db['FaxQueue'][_0x69ec('0x53')]()[_0x69ec('0x27')](respondWithResult(_0x1805e3,null))[_0x69ec('0x46')](handleError(_0x1805e3,null));};exports[_0x69ec('0x54')]=function(_0x301151,_0x2afdef,_0x4435cc){var _0x2f3edf={'raw':!![],'where':{}},_0x131a29={},_0x28e266;return db['FaxQueue'][_0x69ec('0x55')]({'where':{'id':_0x301151['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x2afdef,null))[_0x69ec('0x27')](function(_0x2e4404){if(_0x2e4404){_0x28e266=_0x2e4404[_0x69ec('0x29')]({'plain':!![]});_0x131a29[_0x69ec('0x33')]=_[_0x69ec('0x35')](db[_0x69ec('0x56')]['rawAttributes']);_0x131a29[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x301151[_0x69ec('0x34')]);_0x131a29['filters']=_[_0x69ec('0x37')](_0x131a29[_0x69ec('0x33')],_0x131a29[_0x69ec('0x34')]);_0x2f3edf[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x131a29[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x301151[_0x69ec('0x34')][_0x69ec('0x39')]));_0x2f3edf[_0x69ec('0x38')]=_0x2f3edf[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x2f3edf[_0x69ec('0x38')]:_0x131a29[_0x69ec('0x33')];if(!_0x301151[_0x69ec('0x34')][_0x69ec('0x3b')]('nolimit')){_0x2f3edf['limit']=qs[_0x69ec('0x21')](_0x301151[_0x69ec('0x34')]['limit']);_0x2f3edf['offset']=qs['offset'](_0x301151['query'][_0x69ec('0x1f')]);}_0x2f3edf[_0x69ec('0x3d')]=qs[_0x69ec('0x3e')](_0x301151[_0x69ec('0x34')][_0x69ec('0x3e')]);_0x2f3edf[_0x69ec('0x3f')]=qs[_0x69ec('0x36')](_[_0x69ec('0x40')](_0x301151[_0x69ec('0x34')],_0x131a29[_0x69ec('0x36')]));_0x2f3edf['where'][_0x69ec('0x57')]=_0x2e4404['id'];if(_0x301151[_0x69ec('0x34')][_0x69ec('0x41')]){_0x2f3edf['where']=_[_0x69ec('0x43')](_0x2f3edf[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x2f3edf[_0x69ec('0x38')],function(_0x236f00){var _0x239135={};_0x239135[_0x236f00]={'$like':'%'+_0x301151['query'][_0x69ec('0x41')]+'%'};return _0x239135;})});}_0x2f3edf=_[_0x69ec('0x43')]({},_0x2f3edf,_0x301151[_0x69ec('0x44')]);return db[_0x69ec('0x56')]['findAll'](_0x2f3edf);}})[_0x69ec('0x27')](function(_0x53ebdd){if(_0x53ebdd){return db['User'][_0x69ec('0x58')]({'where':{'id':_[_0x69ec('0x2d')](_0x53ebdd,_0x69ec('0x59')),'role':_0x69ec('0x5a')},'attributes':['id',_0x69ec('0x2c'),_0x69ec('0x5b'),_0x69ec('0x5c'),_0x69ec('0x5d')]});}})[_0x69ec('0x27')](function(_0x2fc1ad){if(_0x2fc1ad){return{'count':_0x2fc1ad[_0x69ec('0x22')],'rows':_['map'](_0x2fc1ad[_0x69ec('0x5e')],function(_0x7edd3e){return{'membername':_0x7edd3e[_0x69ec('0x2c')],'UserId':_0x7edd3e['id'],'queue_name':_0x28e266[_0x69ec('0x2c')],'FaxQueueId':_0x28e266['id'],'interface':util['format']('%s/%s',_0x69ec('0x5f'),_0x7edd3e[_0x69ec('0x2c')]),'penalty':0x0,'paused':_0x7edd3e[_0x69ec('0x5b')],'createdAt':_0x7edd3e[_0x69ec('0x5d')],'updatedAt':_0x7edd3e[_0x69ec('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2afdef,_0x2f3edf))['catch'](handleError(_0x2afdef,null));};exports['getTeams']=function(_0x55d4fc,_0x3d1d89,_0x32a7b1){var _0x2c475a={};var _0x170bf7={};var _0x27f510;var _0x31e457;return db['FaxQueue'][_0x69ec('0x55')]({'where':{'id':_0x55d4fc[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x3d1d89,null))[_0x69ec('0x27')](function(_0x46088d){if(_0x46088d){_0x27f510=_0x46088d;_0x170bf7['model']=_['keys'](db['Team'][_0x69ec('0x2f')]);_0x170bf7[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x55d4fc[_0x69ec('0x34')]);_0x170bf7[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x170bf7[_0x69ec('0x33')],_0x170bf7['query']);_0x2c475a[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x170bf7[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x55d4fc[_0x69ec('0x34')][_0x69ec('0x39')]));_0x2c475a['attributes']=_0x2c475a[_0x69ec('0x38')]['length']?_0x2c475a['attributes']:_0x170bf7[_0x69ec('0x33')];_0x2c475a['order']=qs['sort'](_0x55d4fc['query'][_0x69ec('0x3e')]);_0x2c475a[_0x69ec('0x3f')]=qs['filters'](_[_0x69ec('0x40')](_0x55d4fc[_0x69ec('0x34')],_0x170bf7[_0x69ec('0x36')]));if(_0x55d4fc[_0x69ec('0x34')]['filter']){_0x2c475a[_0x69ec('0x3f')]=_[_0x69ec('0x43')](_0x2c475a[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x2c475a['attributes'],function(_0x1ac3c4){var _0x496a16={};_0x496a16[_0x1ac3c4]={'$like':'%'+_0x55d4fc[_0x69ec('0x34')][_0x69ec('0x41')]+'%'};return _0x496a16;})});}_0x2c475a=_['merge']({},_0x2c475a,_0x55d4fc[_0x69ec('0x44')]);return _0x27f510[_0x69ec('0x60')](_0x2c475a);}})[_0x69ec('0x27')](function(_0x5812dc){if(_0x5812dc){_0x31e457=_0x5812dc[_0x69ec('0x3a')];if(!_0x55d4fc[_0x69ec('0x34')]['hasOwnProperty']('nolimit')){_0x2c475a[_0x69ec('0x21')]=qs[_0x69ec('0x21')](_0x55d4fc[_0x69ec('0x34')]['limit']);_0x2c475a[_0x69ec('0x1f')]=qs[_0x69ec('0x1f')](_0x55d4fc[_0x69ec('0x34')]['offset']);}return _0x27f510[_0x69ec('0x60')](_0x2c475a);}})['then'](function(_0x337137){if(_0x337137){return _0x337137?{'count':_0x31e457,'rows':_0x337137}:null;}})[_0x69ec('0x27')](respondWithResult(_0x3d1d89,null))[_0x69ec('0x46')](handleError(_0x3d1d89,null));};exports[_0x69ec('0x61')]=function(_0x23976f,_0x292724,_0x9dd177){var _0x5305d5=_0x23976f[_0x69ec('0x4a')][_0x69ec('0x62')];return db['Team'][_0x69ec('0x63')]({'where':{'id':_0x5305d5},'attributes':['id'],'include':[{'model':db[_0x69ec('0x64')],'as':_0x69ec('0x65'),'attributes':['id',_0x69ec('0x2c'),'online',_0x69ec('0x66'),_0x69ec('0x67')],'raw':!![]}]})[_0x69ec('0x27')](function(_0x755c17){if(_0x755c17){var _0x31fb75=_[_0x69ec('0x68')](_0x755c17,function(_0xb883a4){var _0x3ad319=_0xb883a4[_0x69ec('0x29')]({'plain':!![]});return _0x3ad319[_0x69ec('0x65')];});return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x23976f[_0x69ec('0x52')]['id']}})['then'](function(_0x4539e3){return db[_0x69ec('0x69')]['transaction'](function(_0x5c12ba){return _0x4539e3[_0x69ec('0x61')](_0x5305d5,{'transaction':_0x5c12ba})[_0x69ec('0x27')](function(){return BPromise[_0x69ec('0x6a')](_0x31fb75,function(_0xaca918){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0xaca918['id'],'FaxQueueId':_0x23976f[_0x69ec('0x52')]['id']},'transaction':_0x5c12ba});});})[_0x69ec('0x27')](function(){_0x31fb75['forEach'](function(_0x589377){socket['emit'](_0x69ec('0x6b'),{'UserId':_0x589377['id'],'FaxQueueId':_0x4539e3['id']});});});});});}})['then'](respondWithStatusCode(_0x292724,null))['catch'](handleError(_0x292724,null));};exports[_0x69ec('0x6c')]=function(_0x4d6c0d,_0x404927,_0x48769c){return db[_0x69ec('0x6d')][_0x69ec('0x63')]({'where':{'id':_0x4d6c0d['query'][_0x69ec('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x69ec('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x404927,null))['then'](function(_0x330143){var _0x2af2ad=_[_0x69ec('0x2d')](_0x330143,'id');var _0x54284c=[];var _0x3d464f=[];var _0x35b2e0=squel[_0x69ec('0x6e')]();_0x35b2e0[_0x69ec('0x6f')](_0x69ec('0x70'))[_0x69ec('0x71')](_0x69ec('0x72'),'tq')['join'](_0x69ec('0x73'),'ut',_0x69ec('0x74'))[_0x69ec('0x3f')](_0x69ec('0x75'),_0x4d6c0d[_0x69ec('0x52')]['id']);for(var _0x5dd11c=0x0;_0x5dd11c<_0x330143[_0x69ec('0x3a')];_0x5dd11c+=0x1){let _0x202d39=_0x330143[_0x5dd11c];for(var _0x3a3739=0x0;_0x3a3739<_0x202d39['Agents']['length'];_0x3a3739+=0x1){let _0x13029d=_0x202d39[_0x69ec('0x65')][_0x3a3739];var _0x474f76=_0x35b2e0[_0x69ec('0x76')]();_0x474f76[_0x69ec('0x3f')](_0x69ec('0x77'),_0x13029d['id']);_0x3d464f[_0x69ec('0x78')](db[_0x69ec('0x69')][_0x69ec('0x34')](_0x474f76[_0x69ec('0x79')](),{'type':db[_0x69ec('0x69')][_0x69ec('0x7a')][_0x69ec('0x7b')]})['then'](function(_0x4bb3b3){if(_0x4bb3b3['length']===0x1){return _0x13029d['id'];}else{var _0x41e87a=_[_0x69ec('0x7c')](_[_0x69ec('0x2d')](_0x4bb3b3,'TeamId'),function(_0x209bcd){return _['includes'](_0x2af2ad,_0x209bcd);});if(_0x41e87a){return _0x13029d['id'];}}}));}}return BPromise[_0x69ec('0x7d')](_0x3d464f)[_0x69ec('0x27')](function(_0x5ef484){_0x54284c=_(_0x54284c)[_0x69ec('0x7e')](_0x5ef484)[_0x69ec('0x7f')]()['value']();return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x4d6c0d[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](function(_0x28c487){return db[_0x69ec('0x69')][_0x69ec('0x80')](function(_0x55b504){return _0x28c487[_0x69ec('0x6c')](_0x4d6c0d[_0x69ec('0x34')]['ids'],{'transaction':_0x55b504})['then'](function(){if(!_[_0x69ec('0x81')](_0x54284c)){return _0x28c487['removeAgents'](_0x54284c,{'transaction':_0x55b504});}})[_0x69ec('0x27')](function(){_0x54284c[_0x69ec('0x82')](function(_0x589dd7){socket['emit'](_0x69ec('0x83'),{'UserId':_0x589dd7,'FaxQueueId':_0x28c487['id']});});});});});});})[_0x69ec('0x27')](respondWithStatusCode(_0x404927,null))['catch'](handleError(_0x404927,null));};exports[_0x69ec('0x84')]=function(_0x5c3af1,_0xbc7d8d,_0x5ba1ad){return db['FaxQueue'][_0x69ec('0x48')]({'where':{'id':_0x5c3af1[_0x69ec('0x52')]['id']}})['then'](handleEntityNotFound(_0xbc7d8d,null))[_0x69ec('0x27')](function(_0x235c17){if(_0x235c17){return _0x235c17[_0x69ec('0x84')](_0x5c3af1[_0x69ec('0x4a')][_0x69ec('0x62')],_[_0x69ec('0x85')](_0x5c3af1[_0x69ec('0x4a')],[_0x69ec('0x62'),'id'])||{})[_0x69ec('0x86')](function(_0x29f4c3){for(var _0x8e3b92=0x0;_0x8e3b92<_0x5c3af1['body']['ids'][_0x69ec('0x3a')];_0x8e3b92+=0x1){socket[_0x69ec('0x87')](_0x69ec('0x6b'),{'UserId':Number(_0x5c3af1[_0x69ec('0x4a')]['ids'][_0x8e3b92]),'FaxQueueId':Number(_0x5c3af1[_0x69ec('0x52')]['id'])});}return _0x29f4c3;});}})[_0x69ec('0x27')](respondWithResult(_0xbc7d8d,null))[_0x69ec('0x46')](handleError(_0xbc7d8d,null));};exports[_0x69ec('0x88')]=function(_0x32f09b,_0x5d9f92,_0x565780){return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x32f09b['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x5d9f92,null))['then'](function(_0x464c82){if(_0x464c82){return _0x464c82['removeAgents'](_0x32f09b['query']['ids'])[_0x69ec('0x27')](function(){if(_[_0x69ec('0x89')](_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')])){for(var _0x4c6d9e=0x0;_0x4c6d9e<_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')]['length'];_0x4c6d9e+=0x1){socket[_0x69ec('0x87')](_0x69ec('0x83'),{'UserId':Number(_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')][_0x4c6d9e]),'FaxQueueId':Number(_0x32f09b[_0x69ec('0x52')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')]),'FaxQueueId':Number(_0x32f09b['params']['id'])});}});}})[_0x69ec('0x27')](respondWithStatusCode(_0x5d9f92,null))[_0x69ec('0x46')](handleError(_0x5d9f92,null));};exports[_0x69ec('0x8a')]=function(_0x2b829b,_0x1b372e,_0x2d610c){var _0x198f49={};var _0x10cd0c={};var _0x11a1ab;var _0x5cad0c;return db[_0x69ec('0x2e')][_0x69ec('0x55')]({'where':{'id':_0x2b829b[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x1b372e,null))[_0x69ec('0x27')](function(_0x535971){if(_0x535971){_0x11a1ab=_0x535971;_0x10cd0c[_0x69ec('0x33')]=_[_0x69ec('0x35')](db[_0x69ec('0x64')][_0x69ec('0x2f')]);_0x10cd0c[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x2b829b['query']);_0x10cd0c[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x10cd0c[_0x69ec('0x33')],_0x10cd0c[_0x69ec('0x34')]);_0x198f49['attributes']=_['intersection'](_0x10cd0c[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x2b829b['query'][_0x69ec('0x39')]));_0x198f49[_0x69ec('0x38')]=_0x198f49[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x198f49['attributes']:_0x10cd0c[_0x69ec('0x33')];_0x198f49['order']=qs[_0x69ec('0x3e')](_0x2b829b[_0x69ec('0x34')][_0x69ec('0x3e')]);_0x198f49[_0x69ec('0x3f')]=qs['filters'](_[_0x69ec('0x40')](_0x2b829b[_0x69ec('0x34')],_0x10cd0c['filters']));if(_0x2b829b['query'][_0x69ec('0x41')]){_0x198f49[_0x69ec('0x3f')]=_[_0x69ec('0x43')](_0x198f49[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x198f49['attributes'],function(_0x2296b5){var _0x589354={};_0x589354[_0x2296b5]={'$like':'%'+_0x2b829b['query'][_0x69ec('0x41')]+'%'};return _0x589354;})});}_0x198f49=_[_0x69ec('0x43')]({},_0x198f49,_0x2b829b[_0x69ec('0x44')]);return _0x11a1ab[_0x69ec('0x8a')](_0x198f49);}})['then'](function(_0x3f1204){if(_0x3f1204){_0x5cad0c=_0x3f1204['length'];if(!_0x2b829b[_0x69ec('0x34')][_0x69ec('0x3b')](_0x69ec('0x3c'))){_0x198f49['limit']=qs[_0x69ec('0x21')](_0x2b829b[_0x69ec('0x34')]['limit']);_0x198f49[_0x69ec('0x1f')]=qs['offset'](_0x2b829b[_0x69ec('0x34')]['offset']);}return _0x11a1ab[_0x69ec('0x8a')](_0x198f49);}})[_0x69ec('0x27')](function(_0x553c3a){if(_0x553c3a){return _0x553c3a?{'count':_0x5cad0c,'rows':_0x553c3a}:null;}})[_0x69ec('0x27')](respondWithResult(_0x1b372e,null))[_0x69ec('0x46')](handleError(_0x1b372e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3d3a0c2..67ad7e6 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 _0xc5d9=['events','../../mysqldb','save','update','remove','emit','hook'];(function(_0x52417a,_0x536ff6){var _0x48bbcc=function(_0x19930e){while(--_0x19930e){_0x52417a['push'](_0x52417a['shift']());}};_0x48bbcc(++_0x536ff6);}(_0xc5d9,0x118));var _0x9c5d=function(_0x5ea41f,_0x19a5c3){_0x5ea41f=_0x5ea41f-0x0;var _0x41162b=_0xc5d9[_0x5ea41f];return _0x41162b;};'use strict';var EventEmitter=require(_0x9c5d('0x0'));var FaxQueue=require(_0x9c5d('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c5d('0x2'),'afterUpdate':_0x9c5d('0x3'),'afterDestroy':_0x9c5d('0x4')};function emitEvent(_0x2a8347){return function(_0xaa4361,_0x45d7e8,_0x106b26){FaxQueueEvents[_0x9c5d('0x5')](_0x2a8347+':'+_0xaa4361['id'],_0xaa4361);FaxQueueEvents['emit'](_0x2a8347,_0xaa4361);_0x106b26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x9c5d('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x882c=['events','FaxQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x540e86,_0xffb59a){var _0x1afd39=function(_0x23e266){while(--_0x23e266){_0x540e86['push'](_0x540e86['shift']());}};_0x1afd39(++_0xffb59a);}(_0x882c,0x19e));var _0xc882=function(_0x3e4e85,_0x3472c3){_0x3e4e85=_0x3e4e85-0x0;var _0x3102c6=_0x882c[_0x3e4e85];return _0x3102c6;};'use strict';var EventEmitter=require(_0xc882('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xc882('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc882('0x2')](0x0);var events={'afterCreate':_0xc882('0x3'),'afterUpdate':_0xc882('0x4'),'afterDestroy':_0xc882('0x5')};function emitEvent(_0x3fbf70){return function(_0x183be7,_0x230cc5,_0x299018){FaxQueueEvents['emit'](_0x3fbf70+':'+_0x183be7['id'],_0x183be7);FaxQueueEvents['emit'](_0x3fbf70,_0x183be7);_0x299018(null);};}for(var e in events){if(events[_0xc882('0x6')](e)){var event=events[e];FaxQueue[_0xc882('0x7')](e,emitEvent(event));}}module[_0xc882('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 551fb17..31747bf 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 _0xa1ab=['api','bluebird','request-promise','rimraf','exports','FaxQueue','fax_queues','lodash','util'];(function(_0x5f9444,_0x4b1435){var _0xe454a=function(_0x11955b){while(--_0x11955b){_0x5f9444['push'](_0x5f9444['shift']());}};_0xe454a(++_0x4b1435);}(_0xa1ab,0xc4));var _0xba1a=function(_0x11d21a,_0x5d02f7){_0x11d21a=_0x11d21a-0x0;var _0x19cb54=_0xa1ab[_0x11d21a];return _0x19cb54;};'use strict';var _=require(_0xba1a('0x0'));var util=require(_0xba1a('0x1'));var logger=require('../../config/logger')(_0xba1a('0x2'));var moment=require('moment');var BPromise=require(_0xba1a('0x3'));var rp=require(_0xba1a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba1a('0x5'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xba1a('0x6')]=function(_0x2e9c28,_0x47fe47){return _0x2e9c28['define'](_0xba1a('0x7'),attributes,{'tableName':_0xba1a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfb8=['request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcfb8,0x94));var _0x8cfb=function(_0x3cb1c7,_0x229b64){_0x3cb1c7=_0x3cb1c7-0x0;var _0x4db120=_0xcfb8[_0x3cb1c7];return _0x4db120;};'use strict';var _=require(_0x8cfb('0x0'));var util=require(_0x8cfb('0x1'));var logger=require(_0x8cfb('0x2'))(_0x8cfb('0x3'));var moment=require(_0x8cfb('0x4'));var BPromise=require(_0x8cfb('0x5'));var rp=require(_0x8cfb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cfb('0x7'));var config=require(_0x8cfb('0x8'));var attributes=require(_0x8cfb('0x9'));module[_0x8cfb('0xa')]=function(_0x37e44b,_0x319b95){return _0x37e44b[_0x8cfb('0xb')](_0x8cfb('0xc'),attributes,{'tableName':_0x8cfb('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 cf1e943..8b05f76 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 _0xd545=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetFaxQueue','catch','ShowFaxQueue','find','then','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0xd545,0x161));var _0x5d54=function(_0x326732,_0x363cb7){_0x326732=_0x326732-0x0;var _0x1be7e4=_0xd545[_0x326732];return _0x1be7e4;};'use strict';var _=require(_0x5d54('0x0'));var util=require('util');var moment=require(_0x5d54('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d54('0x2'));var fs=require('fs');var Redis=require(_0x5d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d54('0x4'));var logger=require(_0x5d54('0x5'))(_0x5d54('0x6'));var config=require(_0x5d54('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d54('0x8')]['http']({'port':0x232a});config[_0x5d54('0x9')]=_[_0x5d54('0xa')](config['redis'],{'host':_0x5d54('0xb'),'port':0x18eb});var socket=require(_0x5d54('0xc'))(new Redis(config[_0x5d54('0x9')]));require(_0x5d54('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d1bad,_0x4b1e0b,_0x361f1f){return new BPromise(function(_0x419333,_0x477032){return client[_0x5d54('0xe')](_0x5d1bad,_0x361f1f)['then'](function(_0x581920){logger[_0x5d54('0xf')](_0x5d54('0x10'),_0x4b1e0b,'request\x20sent');logger[_0x5d54('0x11')](_0x5d54('0x12'),_0x4b1e0b,'request\x20sent',JSON[_0x5d54('0x13')](_0x581920));if(_0x581920[_0x5d54('0x14')]){if(_0x581920[_0x5d54('0x14')][_0x5d54('0x15')]===0x1f4){logger['error'](_0x5d54('0x10'),_0x4b1e0b,_0x581920[_0x5d54('0x14')][_0x5d54('0x16')]);return _0x477032(_0x581920[_0x5d54('0x14')][_0x5d54('0x16')]);}logger['error'](_0x5d54('0x10'),_0x4b1e0b,_0x581920[_0x5d54('0x14')][_0x5d54('0x16')]);return _0x419333(_0x581920[_0x5d54('0x14')][_0x5d54('0x16')]);}else{logger[_0x5d54('0xf')]('FaxQueue,\x20%s,\x20%s',_0x4b1e0b,_0x5d54('0x17'));_0x419333(_0x581920[_0x5d54('0x18')][_0x5d54('0x16')]);}})['catch'](function(_0x291b8d){logger['error'](_0x5d54('0x10'),_0x4b1e0b,_0x291b8d);_0x477032(_0x291b8d);});});}exports['GetFaxQueue']=function(_0x289cc4){var _0xb18f88=this;return new Promise(function(_0x328438,_0x818023){return db[_0x5d54('0x19')][_0x5d54('0x1a')]({'raw':_0x289cc4[_0x5d54('0x1b')]?_0x289cc4[_0x5d54('0x1b')][_0x5d54('0x1c')]===undefined?!![]:![]:!![],'where':_0x289cc4[_0x5d54('0x1b')]?_0x289cc4['options'][_0x5d54('0x1d')]||null:null,'attributes':_0x289cc4[_0x5d54('0x1b')]?_0x289cc4[_0x5d54('0x1b')][_0x5d54('0x1e')]||null:null,'limit':_0x289cc4[_0x5d54('0x1b')]?_0x289cc4[_0x5d54('0x1b')][_0x5d54('0x1f')]||null:null,'include':_0x289cc4['options']?_0x289cc4['options']['include']?_[_0x5d54('0x20')](_0x289cc4[_0x5d54('0x1b')][_0x5d54('0x21')],function(_0x4521a7){return{'model':db[_0x4521a7[_0x5d54('0x22')]],'as':_0x4521a7['as'],'attributes':_0x4521a7[_0x5d54('0x1e')],'include':_0x4521a7[_0x5d54('0x21')]?_['map'](_0x4521a7['include'],function(_0x50c6e5){return{'model':db[_0x50c6e5[_0x5d54('0x22')]],'as':_0x50c6e5['as'],'attributes':_0x50c6e5[_0x5d54('0x1e')],'include':_0x50c6e5['include']?_[_0x5d54('0x20')](_0x50c6e5[_0x5d54('0x21')],function(_0x3bb2cc){return{'model':db[_0x3bb2cc[_0x5d54('0x22')]],'as':_0x3bb2cc['as'],'attributes':_0x3bb2cc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c64ec){logger['info']('GetFaxQueue',_0x289cc4);logger[_0x5d54('0x11')](_0x5d54('0x23'),_0x289cc4,JSON[_0x5d54('0x13')](_0x2c64ec));_0x328438(_0x2c64ec);})[_0x5d54('0x24')](function(_0x4a9df2){logger['error'](_0x5d54('0x23'),_0x4a9df2['message'],_0x289cc4);_0x818023(_0xb18f88['error'](0x1f4,_0x4a9df2[_0x5d54('0x16')]));});});};exports[_0x5d54('0x25')]=function(_0x420191){var _0x2fe683=this;return new Promise(function(_0x495d38,_0x236539){return db['FaxQueue'][_0x5d54('0x26')]({'raw':_0x420191['options']?_0x420191[_0x5d54('0x1b')][_0x5d54('0x1c')]===undefined?!![]:![]:!![],'where':_0x420191[_0x5d54('0x1b')]?_0x420191['options'][_0x5d54('0x1d')]||null:null,'attributes':_0x420191[_0x5d54('0x1b')]?_0x420191[_0x5d54('0x1b')][_0x5d54('0x1e')]||null:null,'include':_0x420191['options']?_0x420191['options']['include']?_['map'](_0x420191[_0x5d54('0x1b')]['include'],function(_0x3cf249){return{'model':db[_0x3cf249[_0x5d54('0x22')]],'as':_0x3cf249['as'],'attributes':_0x3cf249[_0x5d54('0x1e')],'include':_0x3cf249[_0x5d54('0x21')]?_['map'](_0x3cf249[_0x5d54('0x21')],function(_0x2c0fdd){return{'model':db[_0x2c0fdd[_0x5d54('0x22')]],'as':_0x2c0fdd['as'],'attributes':_0x2c0fdd[_0x5d54('0x1e')],'include':_0x2c0fdd['include']?_[_0x5d54('0x20')](_0x2c0fdd[_0x5d54('0x21')],function(_0x481954){return{'model':db[_0x481954[_0x5d54('0x22')]],'as':_0x481954['as'],'attributes':_0x481954[_0x5d54('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d54('0x27')](function(_0x57eca9){logger[_0x5d54('0xf')](_0x5d54('0x25'),_0x420191);logger[_0x5d54('0x11')]('ShowFaxQueue',_0x420191,JSON['stringify'](_0x57eca9));_0x495d38(_0x57eca9);})[_0x5d54('0x24')](function(_0x9efd8a){logger[_0x5d54('0x14')](_0x5d54('0x25'),_0x9efd8a['message'],_0x420191);_0x236539(_0x2fe683[_0x5d54('0x14')](0x1f4,_0x9efd8a[_0x5d54('0x16')]));});});}; \ No newline at end of file +var _0x64ef=['info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowFaxQueue','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then'];(function(_0x34144b,_0x231870){var _0x49cb8a=function(_0x31e92d){while(--_0x31e92d){_0x34144b['push'](_0x34144b['shift']());}};_0x49cb8a(++_0x231870);}(_0x64ef,0x136));var _0xf64e=function(_0xf1a97c,_0x388439){_0xf1a97c=_0xf1a97c-0x0;var _0x5e722c=_0x64ef[_0xf1a97c];return _0x5e722c;};'use strict';var _=require(_0xf64e('0x0'));var util=require('util');var moment=require(_0xf64e('0x1'));var BPromise=require(_0xf64e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf64e('0x3'));var db=require(_0xf64e('0x4'))['db'];var utils=require(_0xf64e('0x5'));var logger=require(_0xf64e('0x6'))(_0xf64e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf64e('0x8'));var client=jayson['client'][_0xf64e('0x9')]({'port':0x232a});config[_0xf64e('0xa')]=_[_0xf64e('0xb')](config[_0xf64e('0xa')],{'host':_0xf64e('0xc'),'port':0x18eb});var socket=require(_0xf64e('0xd'))(new Redis(config['redis']));require(_0xf64e('0xe'))[_0xf64e('0xf')](socket);function respondWithRpcPromise(_0x3766f,_0x1df27a,_0x4f55ca){return new BPromise(function(_0x57dede,_0x18cb7c){return client[_0xf64e('0x10')](_0x3766f,_0x4f55ca)[_0xf64e('0x11')](function(_0x234241){logger[_0xf64e('0x12')](_0xf64e('0x13'),_0x1df27a,_0xf64e('0x14'));logger['debug'](_0xf64e('0x15'),_0x1df27a,_0xf64e('0x14'),JSON['stringify'](_0x234241));if(_0x234241[_0xf64e('0x16')]){if(_0x234241[_0xf64e('0x16')][_0xf64e('0x17')]===0x1f4){logger[_0xf64e('0x16')](_0xf64e('0x13'),_0x1df27a,_0x234241[_0xf64e('0x16')][_0xf64e('0x18')]);return _0x18cb7c(_0x234241[_0xf64e('0x16')]['message']);}logger['error'](_0xf64e('0x13'),_0x1df27a,_0x234241['error'][_0xf64e('0x18')]);return _0x57dede(_0x234241['error']['message']);}else{logger[_0xf64e('0x12')](_0xf64e('0x13'),_0x1df27a,_0xf64e('0x14'));_0x57dede(_0x234241[_0xf64e('0x19')]['message']);}})[_0xf64e('0x1a')](function(_0x242250){logger[_0xf64e('0x16')](_0xf64e('0x13'),_0x1df27a,_0x242250);_0x18cb7c(_0x242250);});});}exports[_0xf64e('0x1b')]=function(_0x291971){var _0x31f68d=this;return new Promise(function(_0x537902,_0x32e64c){return db[_0xf64e('0x1c')][_0xf64e('0x1d')]({'raw':_0x291971[_0xf64e('0x1e')]?_0x291971[_0xf64e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x291971['options']?_0x291971[_0xf64e('0x1e')][_0xf64e('0x1f')]||null:null,'attributes':_0x291971['options']?_0x291971[_0xf64e('0x1e')][_0xf64e('0x20')]||null:null,'limit':_0x291971[_0xf64e('0x1e')]?_0x291971[_0xf64e('0x1e')][_0xf64e('0x21')]||null:null,'include':_0x291971['options']?_0x291971['options'][_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x291971[_0xf64e('0x1e')][_0xf64e('0x22')],function(_0x506381){return{'model':db[_0x506381['model']],'as':_0x506381['as'],'attributes':_0x506381[_0xf64e('0x20')],'include':_0x506381[_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x506381[_0xf64e('0x22')],function(_0x50f295){return{'model':db[_0x50f295[_0xf64e('0x24')]],'as':_0x50f295['as'],'attributes':_0x50f295[_0xf64e('0x20')],'include':_0x50f295[_0xf64e('0x22')]?_['map'](_0x50f295[_0xf64e('0x22')],function(_0x4003ef){return{'model':db[_0x4003ef[_0xf64e('0x24')]],'as':_0x4003ef['as'],'attributes':_0x4003ef[_0xf64e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf64e('0x11')](function(_0x113fda){logger[_0xf64e('0x12')](_0xf64e('0x1b'),_0x291971);logger[_0xf64e('0x25')]('GetFaxQueue',_0x291971,JSON[_0xf64e('0x26')](_0x113fda));_0x537902(_0x113fda);})[_0xf64e('0x1a')](function(_0x49b990){logger['error'](_0xf64e('0x1b'),_0x49b990['message'],_0x291971);_0x32e64c(_0x31f68d['error'](0x1f4,_0x49b990[_0xf64e('0x18')]));});});};exports[_0xf64e('0x27')]=function(_0x104a54){var _0x544e11=this;return new Promise(function(_0x5503db,_0x156f36){return db[_0xf64e('0x1c')]['find']({'raw':_0x104a54[_0xf64e('0x1e')]?_0x104a54['options'][_0xf64e('0x28')]===undefined?!![]:![]:!![],'where':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')]['where']||null:null,'attributes':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')][_0xf64e('0x20')]||null:null,'include':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')][_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x104a54['options'][_0xf64e('0x22')],function(_0x2b74f7){return{'model':db[_0x2b74f7['model']],'as':_0x2b74f7['as'],'attributes':_0x2b74f7[_0xf64e('0x20')],'include':_0x2b74f7[_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x2b74f7[_0xf64e('0x22')],function(_0x5cedaf){return{'model':db[_0x5cedaf[_0xf64e('0x24')]],'as':_0x5cedaf['as'],'attributes':_0x5cedaf[_0xf64e('0x20')],'include':_0x5cedaf['include']?_[_0xf64e('0x23')](_0x5cedaf[_0xf64e('0x22')],function(_0x559ad8){return{'model':db[_0x559ad8['model']],'as':_0x559ad8['as'],'attributes':_0x559ad8['attributes']};}):[]};}):[]};}):[]:[]})[_0xf64e('0x11')](function(_0x5f28d7){logger[_0xf64e('0x12')](_0xf64e('0x27'),_0x104a54);logger['debug']('ShowFaxQueue',_0x104a54,JSON[_0xf64e('0x26')](_0x5f28d7));_0x5503db(_0x5f28d7);})['catch'](function(_0x4271e0){logger[_0xf64e('0x16')](_0xf64e('0x27'),_0x4271e0[_0xf64e('0x18')],_0x104a54);_0x156f36(_0x544e11[_0xf64e('0x16')](0x1f4,_0x4271e0['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 298a9f9..934e228 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 _0xc12c=['emit','removeListener','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc12c,0xb3));var _0xcc12=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc12c[_0x134c2e];return _0x2825db;};'use strict';var FaxQueueEvents=require(_0xcc12('0x0'));var events=['save',_0xcc12('0x1'),_0xcc12('0x2')];function createListener(_0x16eee4,_0x468301){return function(_0x2a97b9){_0x468301[_0xcc12('0x3')](_0x16eee4,_0x2a97b9);};}function removeListener(_0x2062cd,_0xcaba74){return function(){FaxQueueEvents[_0xcc12('0x4')](_0x2062cd,_0xcaba74);};}exports['register']=function(_0x19a2bc){for(var _0x2f59e3=0x0,_0x32f4ce=events[_0xcc12('0x5')];_0x2f59e3<_0x32f4ce;_0x2f59e3++){var _0x21cf30=events[_0x2f59e3];var _0x1c12f5=createListener(_0xcc12('0x6')+_0x21cf30,_0x19a2bc);FaxQueueEvents['on'](_0x21cf30,_0x1c12f5);}}; \ No newline at end of file +var _0x2fac=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x2fac,0x1a5));var _0xc2fa=function(_0x1a5949,_0x3f6077){_0x1a5949=_0x1a5949-0x0;var _0x1be6ff=_0x2fac[_0x1a5949];return _0x1be6ff;};'use strict';var FaxQueueEvents=require(_0xc2fa('0x0'));var events=[_0xc2fa('0x1'),_0xc2fa('0x2'),_0xc2fa('0x3')];function createListener(_0x46b2ff,_0x1b01a5){return function(_0x357857){_0x1b01a5[_0xc2fa('0x4')](_0x46b2ff,_0x357857);};}function removeListener(_0x158644,_0xf67859){return function(){FaxQueueEvents[_0xc2fa('0x5')](_0x158644,_0xf67859);};}exports[_0xc2fa('0x6')]=function(_0x356c25){for(var _0x39d0c3=0x0,_0x2fa51e=events[_0xc2fa('0x7')];_0x39d0c3<_0x2fa51e;_0x39d0c3++){var _0x110a2e=events[_0x39d0c3];var _0x5703c6=createListener(_0xc2fa('0x8')+_0x110a2e,_0x356c25);FaxQueueEvents['on'](_0x110a2e,_0x5703c6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7412ace..314699f 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 _0x8f9d=['getMembers','/:id/teams','getTeams','post','create','addTeams','addAgents','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['get']('/:id/members',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0xb')](_0xd8f9('0x10'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);router[_0xd8f9('0xb')]('/:id/users',auth[_0xd8f9('0x9')](),controller['getAgents']);router[_0xd8f9('0x12')]('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x13')]);router['post'](_0xd8f9('0x10'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x14')]);router[_0xd8f9('0x12')]('/:id/users',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x15')]);router[_0xd8f9('0x16')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x17')]);router[_0xd8f9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xd8f9('0x19')]);router[_0xd8f9('0x18')]('/:id/teams',auth[_0xd8f9('0x9')](),controller['removeTeams']);router[_0xd8f9('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xd8f9('0x1a')]=router; \ No newline at end of file +var _0x2675=['index','/describe','describe','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id','update','delete','destroy','removeTeams','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated'];(function(_0x9b14ee,_0x574340){var _0xc3fa3c=function(_0x44476d){while(--_0x44476d){_0x9b14ee['push'](_0x9b14ee['shift']());}};_0xc3fa3c(++_0x574340);}(_0x2675,0x75));var _0x5267=function(_0x1b3afa,_0x2a755a){_0x1b3afa=_0x1b3afa-0x0;var _0xbde4e9=_0x2675[_0x1b3afa];return _0xbde4e9;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMembers']);router[_0x5267('0x6')]('/:id/teams',auth[_0x5267('0x7')](),controller['getTeams']);router[_0x5267('0x6')](_0x5267('0xc'),auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xe')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xf')]);router[_0x5267('0xe')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x11')]);router[_0x5267('0xe')](_0x5267('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5267('0x12')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x14')]);router[_0x5267('0x15')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x16')]);router[_0x5267('0x15')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x17')]);router['delete'](_0x5267('0xc'),auth[_0x5267('0x7')](),controller['removeAgents']);module[_0x5267('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index bfb6a6c..9df9943 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 _0x2303=['STRING','moment','sequelize','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2303,0x75));var _0x3230=function(_0x3e39ca,_0x5c3e07){_0x3e39ca=_0x3e39ca-0x0;var _0x291d0f=_0x2303[_0x3e39ca];return _0x291d0f;};'use strict';var moment=require(_0x3230('0x0'));var Sequelize=require(_0x3230('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3230('0x2')]},'acceptAt':{'type':Sequelize[_0x3230('0x2')]},'exitAt':{'type':Sequelize[_0x3230('0x2')]},'reason':{'type':Sequelize[_0x3230('0x3')]}}; \ No newline at end of file +var _0xed5a=['DATE','moment','exports','STRING'];(function(_0x548d2b,_0x4547ac){var _0x150241=function(_0x2a1edf){while(--_0x2a1edf){_0x548d2b['push'](_0x548d2b['shift']());}};_0x150241(++_0x4547ac);}(_0xed5a,0x1f1));var _0xaed5=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xed5a[_0x48b810];return _0x23c17d;};'use strict';var moment=require(_0xaed5('0x0'));var Sequelize=require('sequelize');module[_0xaed5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaed5('0x2')]},'joinAt':{'type':Sequelize[_0xaed5('0x3')]},'leaveAt':{'type':Sequelize[_0xaed5('0x3')]},'acceptAt':{'type':Sequelize[_0xaed5('0x3')]},'exitAt':{'type':Sequelize[_0xaed5('0x3')]},'reason':{'type':Sequelize[_0xaed5('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1f0875b..bda1d2b 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 _0xbe45=['pick','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x25cdbc,_0x1000f2){var _0x13b5fd=function(_0x4f8259){while(--_0x4f8259){_0x25cdbc['push'](_0x25cdbc['shift']());}};_0x13b5fd(++_0x1000f2);}(_0xbe45,0xf0));var _0x5be4=function(_0x232db8,_0x47e4a5){_0x232db8=_0x232db8-0x0;var _0x171cdd=_0xbe45[_0x232db8];return _0x171cdd;};'use strict';var emlformat=require(_0x5be4('0x0'));var rimraf=require(_0x5be4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be4('0x2'));var rp=require(_0x5be4('0x3'));var moment=require(_0x5be4('0x4'));var BPromise=require(_0x5be4('0x5'));var Mustache=require(_0x5be4('0x6'));var util=require(_0x5be4('0x7'));var path=require('path');var sox=require(_0x5be4('0x8'));var csv=require(_0x5be4('0x9'));var ejs=require(_0x5be4('0xa'));var fs=require('fs');var fs_extra=require(_0x5be4('0xb'));var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0x9'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5be4('0x18'))['db'];function respondWithStatusCode(_0x43a60f,_0x1d7960){_0x1d7960=_0x1d7960||0xcc;return function(_0x5c6615){if(_0x5c6615){return _0x43a60f[_0x5be4('0x19')](_0x1d7960);}return _0x43a60f['status'](_0x1d7960)[_0x5be4('0x1a')]();};}function respondWithResult(_0x2afee8,_0x2dd93e){_0x2dd93e=_0x2dd93e||0xc8;return function(_0x335842){if(_0x335842){return _0x2afee8[_0x5be4('0x1b')](_0x2dd93e)[_0x5be4('0x1c')](_0x335842);}};}function respondWithFilteredResult(_0x3980fc,_0x5ebe65){return function(_0x3e830e){if(_0x3e830e){var _0x8466a7=typeof _0x5ebe65[_0x5be4('0x1d')]===_0x5be4('0x1e')&&typeof _0x5ebe65[_0x5be4('0x1f')]===_0x5be4('0x1e');var _0x94f434=_0x3e830e[_0x5be4('0x20')];var _0x51662a=_0x8466a7?0x0:_0x5ebe65[_0x5be4('0x1d')];var _0x50b970=_0x8466a7?_0x3e830e['count']:_0x5ebe65[_0x5be4('0x1d')]+_0x5ebe65[_0x5be4('0x1f')];var _0x4cce93;if(_0x50b970>=_0x94f434){_0x50b970=_0x94f434;_0x4cce93=0xc8;}else{_0x4cce93=0xce;}_0x3980fc[_0x5be4('0x1b')](_0x4cce93);return _0x3980fc[_0x5be4('0x21')]('Content-Range',_0x51662a+'-'+_0x50b970+'/'+_0x94f434)['json'](_0x3e830e);}return null;};}function patchUpdates(_0x2690be){return function(_0x207948){try{jsonpatch['apply'](_0x207948,_0x2690be,!![]);}catch(_0x553f59){return BPromise[_0x5be4('0x22')](_0x553f59);}return _0x207948[_0x5be4('0x23')]();};}function saveUpdates(_0x2843e3,_0x3ccd67){return function(_0xa20552){if(_0xa20552){return _0xa20552['update'](_0x2843e3)[_0x5be4('0x24')](function(_0x51d7a7){return _0x51d7a7;});}return null;};}function removeEntity(_0x242005,_0x12b9cd){return function(_0x4d6eff){if(_0x4d6eff){return _0x4d6eff[_0x5be4('0x25')]()[_0x5be4('0x24')](function(){_0x242005['status'](0xcc)[_0x5be4('0x1a')]();});}};}function handleEntityNotFound(_0x2b2e2c,_0x353a65){return function(_0x39cf54){if(!_0x39cf54){_0x2b2e2c[_0x5be4('0x19')](0x194);}return _0x39cf54;};}function handleError(_0x13779f,_0x112728){_0x112728=_0x112728||0x1f4;return function(_0x5b49ea){logger['error'](_0x5b49ea[_0x5be4('0x26')]);if(_0x5b49ea[_0x5be4('0x27')]){delete _0x5b49ea[_0x5be4('0x27')];}_0x13779f['status'](_0x112728)[_0x5be4('0x28')](_0x5b49ea);};}exports[_0x5be4('0x29')]=function(_0x3bd842,_0x412ef6){var _0x16f3bf={},_0x1e0485={},_0x4b9029={'count':0x0,'rows':[]};var _0x1661c2=_[_0x5be4('0x2a')](db['FaxQueueReport'][_0x5be4('0x2b')],function(_0x49780a){return{'name':_0x49780a[_0x5be4('0x2c')],'type':_0x49780a[_0x5be4('0x2d')]['key']};});_0x1e0485[_0x5be4('0x2e')]=_['map'](_0x1661c2,'name');_0x1e0485[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x3bd842[_0x5be4('0x2f')]);_0x1e0485[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],_0x1e0485[_0x5be4('0x2f')]);_0x16f3bf[_0x5be4('0x33')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],qs[_0x5be4('0x34')](_0x3bd842[_0x5be4('0x2f')]['fields']));_0x16f3bf['attributes']=_0x16f3bf[_0x5be4('0x33')][_0x5be4('0x35')]?_0x16f3bf[_0x5be4('0x33')]:_0x1e0485[_0x5be4('0x2e')];if(!_0x3bd842['query'][_0x5be4('0x36')]('nolimit')){_0x16f3bf[_0x5be4('0x1f')]=qs['limit'](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x1f')]);_0x16f3bf['offset']=qs['offset'](_0x3bd842[_0x5be4('0x2f')]['offset']);}_0x16f3bf['order']=qs[_0x5be4('0x37')](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x37')]);_0x16f3bf['where']=qs[_0x5be4('0x31')](_[_0x5be4('0x38')](_0x3bd842['query'],_0x1e0485[_0x5be4('0x31')]),_0x1661c2);if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x39')]){_0x16f3bf[_0x5be4('0x3a')]=_['merge'](_0x16f3bf[_0x5be4('0x3a')],{'$or':_[_0x5be4('0x2a')](_0x1661c2,function(_0x178500){if(_0x178500[_0x5be4('0x2d')]!==_0x5be4('0x3b')){var _0x3ddba4={};_0x3ddba4[_0x178500[_0x5be4('0x27')]]={'$like':'%'+_0x3bd842[_0x5be4('0x2f')]['filter']+'%'};return _0x3ddba4;}})});}_0x16f3bf=_[_0x5be4('0x3c')]({},_0x16f3bf,_0x3bd842[_0x5be4('0x3d')]);var _0x348c30={'where':_0x16f3bf[_0x5be4('0x3a')]};return db[_0x5be4('0x3e')]['count'](_0x348c30)[_0x5be4('0x24')](function(_0x344411){_0x4b9029['count']=_0x344411;if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x3f')]){_0x16f3bf['include']=[{'all':!![]}];}return db[_0x5be4('0x3e')][_0x5be4('0x40')](_0x16f3bf);})[_0x5be4('0x24')](function(_0x1d480c){_0x4b9029[_0x5be4('0x41')]=_0x1d480c;return _0x4b9029;})[_0x5be4('0x24')](respondWithFilteredResult(_0x412ef6,_0x16f3bf))[_0x5be4('0x42')](handleError(_0x412ef6,null));};exports[_0x5be4('0x43')]=function(_0x2313d6,_0x53974f){var _0x1add45={'raw':!![],'where':{'id':_0x2313d6[_0x5be4('0x44')]['id']}},_0x536473={};_0x536473[_0x5be4('0x2e')]=_['keys'](db[_0x5be4('0x3e')]['rawAttributes']);_0x536473['query']=_[_0x5be4('0x30')](_0x2313d6[_0x5be4('0x2f')]);_0x536473[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x536473[_0x5be4('0x2e')],_0x536473[_0x5be4('0x2f')]);_0x1add45[_0x5be4('0x33')]=_['intersection'](_0x536473[_0x5be4('0x2e')],qs['fields'](_0x2313d6[_0x5be4('0x2f')]['fields']));_0x1add45[_0x5be4('0x33')]=_0x1add45[_0x5be4('0x33')]['length']?_0x1add45[_0x5be4('0x33')]:_0x536473[_0x5be4('0x2e')];if(_0x2313d6[_0x5be4('0x2f')]['includeAll']){_0x1add45[_0x5be4('0x45')]=[{'all':!![]}];}_0x1add45=_[_0x5be4('0x3c')]({},_0x1add45,_0x2313d6['options']);return db[_0x5be4('0x3e')]['find'](_0x1add45)['then'](handleEntityNotFound(_0x53974f,null))[_0x5be4('0x24')](respondWithResult(_0x53974f,null))[_0x5be4('0x42')](handleError(_0x53974f,null));};exports['create']=function(_0x47734f,_0x57f25d){return db['FaxQueueReport'][_0x5be4('0x46')](_0x47734f[_0x5be4('0x47')],{})[_0x5be4('0x24')](respondWithResult(_0x57f25d,0xc9))['catch'](handleError(_0x57f25d,null));};exports['update']=function(_0x378ae7,_0x2fb7cd){if(_0x378ae7[_0x5be4('0x47')]['id']){delete _0x378ae7[_0x5be4('0x47')]['id'];}return db['FaxQueueReport'][_0x5be4('0x48')]({'where':{'id':_0x378ae7[_0x5be4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fb7cd,null))[_0x5be4('0x24')](saveUpdates(_0x378ae7[_0x5be4('0x47')],null))[_0x5be4('0x24')](respondWithResult(_0x2fb7cd,null))['catch'](handleError(_0x2fb7cd,null));};exports[_0x5be4('0x25')]=function(_0x3481c9,_0xc9ca2f){return db[_0x5be4('0x3e')][_0x5be4('0x48')]({'where':{'id':_0x3481c9[_0x5be4('0x44')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0xc9ca2f,null))[_0x5be4('0x24')](removeEntity(_0xc9ca2f,null))[_0x5be4('0x42')](handleError(_0xc9ca2f,null));};exports[_0x5be4('0x49')]=function(_0x5f0999,_0x2caec3){return db['FaxQueueReport'][_0x5be4('0x49')]()[_0x5be4('0x24')](respondWithResult(_0x2caec3,null))[_0x5be4('0x42')](handleError(_0x2caec3,null));}; \ No newline at end of file +var _0xc125=['set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','FaxQueueReport','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset'];(function(_0x2b4f7c,_0x318404){var _0x2f9e22=function(_0x156be8){while(--_0x156be8){_0x2b4f7c['push'](_0x2b4f7c['shift']());}};_0x2f9e22(++_0x318404);}(_0xc125,0x150));var _0x5c12=function(_0x140549,_0x2752b9){_0x140549=_0x140549-0x0;var _0x30e476=_0xc125[_0x140549];return _0x30e476;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c12('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c12('0x1'));var rp=require(_0x5c12('0x2'));var moment=require(_0x5c12('0x3'));var BPromise=require(_0x5c12('0x4'));var Mustache=require(_0x5c12('0x5'));var util=require(_0x5c12('0x6'));var path=require(_0x5c12('0x7'));var sox=require(_0x5c12('0x8'));var csv=require(_0x5c12('0x9'));var ejs=require(_0x5c12('0xa'));var fs=require('fs');var fs_extra=require(_0x5c12('0xb'));var _=require(_0x5c12('0xc'));var squel=require('squel');var crypto=require(_0x5c12('0xd'));var jsforce=require(_0x5c12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c12('0x9'));var querystring=require(_0x5c12('0xf'));var Papa=require(_0x5c12('0x10'));var Redis=require(_0x5c12('0x11'));var authService=require(_0x5c12('0x12'));var qs=require(_0x5c12('0x13'));var as=require(_0x5c12('0x14'));var hardwareService=require(_0x5c12('0x15'));var logger=require('../../config/logger')(_0x5c12('0x16'));var utils=require(_0x5c12('0x17'));var config=require(_0x5c12('0x18'));var licenseUtil=require(_0x5c12('0x19'));var db=require(_0x5c12('0x1a'))['db'];function respondWithStatusCode(_0x4a1279,_0x4f40ae){_0x4f40ae=_0x4f40ae||0xcc;return function(_0x40d80b){if(_0x40d80b){return _0x4a1279['sendStatus'](_0x4f40ae);}return _0x4a1279[_0x5c12('0x1b')](_0x4f40ae)[_0x5c12('0x1c')]();};}function respondWithResult(_0x448667,_0x4a9910){_0x4a9910=_0x4a9910||0xc8;return function(_0x5676a9){if(_0x5676a9){return _0x448667[_0x5c12('0x1b')](_0x4a9910)[_0x5c12('0x1d')](_0x5676a9);}};}function respondWithFilteredResult(_0x5cb237,_0x460ff1){return function(_0xf18ba2){if(_0xf18ba2){var _0x244216=typeof _0x460ff1['offset']==='undefined'&&typeof _0x460ff1[_0x5c12('0x1e')]===_0x5c12('0x1f');var _0x319cc8=_0xf18ba2[_0x5c12('0x20')];var _0x1bd895=_0x244216?0x0:_0x460ff1[_0x5c12('0x21')];var _0x16543f=_0x244216?_0xf18ba2[_0x5c12('0x20')]:_0x460ff1['offset']+_0x460ff1['limit'];var _0x2f7d71;if(_0x16543f>=_0x319cc8){_0x16543f=_0x319cc8;_0x2f7d71=0xc8;}else{_0x2f7d71=0xce;}_0x5cb237[_0x5c12('0x1b')](_0x2f7d71);return _0x5cb237[_0x5c12('0x22')](_0x5c12('0x23'),_0x1bd895+'-'+_0x16543f+'/'+_0x319cc8)['json'](_0xf18ba2);}return null;};}function patchUpdates(_0x3ea1b5){return function(_0x4c096d){try{jsonpatch[_0x5c12('0x24')](_0x4c096d,_0x3ea1b5,!![]);}catch(_0x26aa3f){return BPromise['reject'](_0x26aa3f);}return _0x4c096d['save']();};}function saveUpdates(_0xa1ad8f,_0x5f7e40){return function(_0x5b0552){if(_0x5b0552){return _0x5b0552[_0x5c12('0x25')](_0xa1ad8f)['then'](function(_0xfa7c1e){return _0xfa7c1e;});}return null;};}function removeEntity(_0x7bc2ff,_0x1d9e30){return function(_0x40f6ab){if(_0x40f6ab){return _0x40f6ab[_0x5c12('0x26')]()[_0x5c12('0x27')](function(){_0x7bc2ff[_0x5c12('0x1b')](0xcc)[_0x5c12('0x1c')]();});}};}function handleEntityNotFound(_0xca0f79,_0x1d6d76){return function(_0x23e787){if(!_0x23e787){_0xca0f79[_0x5c12('0x28')](0x194);}return _0x23e787;};}function handleError(_0x146bce,_0x598c2b){_0x598c2b=_0x598c2b||0x1f4;return function(_0x37979e){logger[_0x5c12('0x29')](_0x37979e[_0x5c12('0x2a')]);if(_0x37979e[_0x5c12('0x2b')]){delete _0x37979e[_0x5c12('0x2b')];}_0x146bce[_0x5c12('0x1b')](_0x598c2b)['send'](_0x37979e);};}exports[_0x5c12('0x2c')]=function(_0x3e9bf5,_0x4d21b6){var _0x5939a8={},_0x5815d4={},_0x130be5={'count':0x0,'rows':[]};var _0x2dded3=_['map'](db[_0x5c12('0x2d')][_0x5c12('0x2e')],function(_0xdb38eb){return{'name':_0xdb38eb['fieldName'],'type':_0xdb38eb[_0x5c12('0x2f')]['key']};});_0x5815d4[_0x5c12('0x30')]=_[_0x5c12('0x31')](_0x2dded3,_0x5c12('0x2b'));_0x5815d4[_0x5c12('0x32')]=_[_0x5c12('0x33')](_0x3e9bf5[_0x5c12('0x32')]);_0x5815d4[_0x5c12('0x34')]=_['intersection'](_0x5815d4['model'],_0x5815d4[_0x5c12('0x32')]);_0x5939a8[_0x5c12('0x35')]=_[_0x5c12('0x36')](_0x5815d4[_0x5c12('0x30')],qs['fields'](_0x3e9bf5['query'][_0x5c12('0x37')]));_0x5939a8[_0x5c12('0x35')]=_0x5939a8['attributes']['length']?_0x5939a8['attributes']:_0x5815d4[_0x5c12('0x30')];if(!_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x38')](_0x5c12('0x39'))){_0x5939a8[_0x5c12('0x1e')]=qs['limit'](_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x1e')]);_0x5939a8['offset']=qs[_0x5c12('0x21')](_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x21')]);}_0x5939a8[_0x5c12('0x3a')]=qs[_0x5c12('0x3b')](_0x3e9bf5['query'][_0x5c12('0x3b')]);_0x5939a8[_0x5c12('0x3c')]=qs['filters'](_[_0x5c12('0x3d')](_0x3e9bf5[_0x5c12('0x32')],_0x5815d4[_0x5c12('0x34')]),_0x2dded3);if(_0x3e9bf5['query'][_0x5c12('0x3e')]){_0x5939a8[_0x5c12('0x3c')]=_[_0x5c12('0x3f')](_0x5939a8['where'],{'$or':_[_0x5c12('0x31')](_0x2dded3,function(_0x52e976){if(_0x52e976['type']!=='VIRTUAL'){var _0x1b377f={};_0x1b377f[_0x52e976[_0x5c12('0x2b')]]={'$like':'%'+_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x3e')]+'%'};return _0x1b377f;}})});}_0x5939a8=_[_0x5c12('0x3f')]({},_0x5939a8,_0x3e9bf5[_0x5c12('0x40')]);var _0x1c1f22={'where':_0x5939a8['where']};return db[_0x5c12('0x2d')][_0x5c12('0x20')](_0x1c1f22)[_0x5c12('0x27')](function(_0x47fece){_0x130be5['count']=_0x47fece;if(_0x3e9bf5['query'][_0x5c12('0x41')]){_0x5939a8['include']=[{'all':!![]}];}return db[_0x5c12('0x2d')][_0x5c12('0x42')](_0x5939a8);})[_0x5c12('0x27')](function(_0x2d3bf8){_0x130be5[_0x5c12('0x43')]=_0x2d3bf8;return _0x130be5;})[_0x5c12('0x27')](respondWithFilteredResult(_0x4d21b6,_0x5939a8))[_0x5c12('0x44')](handleError(_0x4d21b6,null));};exports['show']=function(_0x44da8b,_0x217dbe){var _0x4c1225={'raw':!![],'where':{'id':_0x44da8b[_0x5c12('0x45')]['id']}},_0x312d55={};_0x312d55[_0x5c12('0x30')]=_[_0x5c12('0x33')](db[_0x5c12('0x2d')][_0x5c12('0x2e')]);_0x312d55[_0x5c12('0x32')]=_['keys'](_0x44da8b['query']);_0x312d55[_0x5c12('0x34')]=_[_0x5c12('0x36')](_0x312d55[_0x5c12('0x30')],_0x312d55[_0x5c12('0x32')]);_0x4c1225[_0x5c12('0x35')]=_[_0x5c12('0x36')](_0x312d55[_0x5c12('0x30')],qs[_0x5c12('0x37')](_0x44da8b[_0x5c12('0x32')][_0x5c12('0x37')]));_0x4c1225[_0x5c12('0x35')]=_0x4c1225[_0x5c12('0x35')]['length']?_0x4c1225['attributes']:_0x312d55[_0x5c12('0x30')];if(_0x44da8b[_0x5c12('0x32')][_0x5c12('0x41')]){_0x4c1225['include']=[{'all':!![]}];}_0x4c1225=_[_0x5c12('0x3f')]({},_0x4c1225,_0x44da8b[_0x5c12('0x40')]);return db[_0x5c12('0x2d')][_0x5c12('0x46')](_0x4c1225)[_0x5c12('0x27')](handleEntityNotFound(_0x217dbe,null))[_0x5c12('0x27')](respondWithResult(_0x217dbe,null))['catch'](handleError(_0x217dbe,null));};exports[_0x5c12('0x47')]=function(_0x11801c,_0x36ac79){return db['FaxQueueReport']['create'](_0x11801c[_0x5c12('0x48')],{})[_0x5c12('0x27')](respondWithResult(_0x36ac79,0xc9))[_0x5c12('0x44')](handleError(_0x36ac79,null));};exports[_0x5c12('0x25')]=function(_0x3f80d5,_0x1908c7){if(_0x3f80d5[_0x5c12('0x48')]['id']){delete _0x3f80d5['body']['id'];}return db[_0x5c12('0x2d')][_0x5c12('0x46')]({'where':{'id':_0x3f80d5['params']['id']}})['then'](handleEntityNotFound(_0x1908c7,null))[_0x5c12('0x27')](saveUpdates(_0x3f80d5[_0x5c12('0x48')],null))[_0x5c12('0x27')](respondWithResult(_0x1908c7,null))[_0x5c12('0x44')](handleError(_0x1908c7,null));};exports['destroy']=function(_0x461529,_0x48ac1b){return db['FaxQueueReport'][_0x5c12('0x46')]({'where':{'id':_0x461529['params']['id']}})[_0x5c12('0x27')](handleEntityNotFound(_0x48ac1b,null))[_0x5c12('0x27')](removeEntity(_0x48ac1b,null))[_0x5c12('0x44')](handleError(_0x48ac1b,null));};exports['describe']=function(_0x42ffbc,_0x5083ba){return db[_0x5c12('0x2d')][_0x5c12('0x49')]()[_0x5c12('0x27')](respondWithResult(_0x5083ba,null))[_0x5c12('0x44')](handleError(_0x5083ba,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e0ee2a8..0c5ea71 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14658e,_0x3cfaae){_0x14658e=_0x14658e-0x0;var _0x37a465=_0x1cb9[_0x14658e];return _0x37a465;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x172be5,_0x51cae2){var _0x3662b1=function(_0x29db51){while(--_0x29db51){_0x172be5['push'](_0x172be5['shift']());}};_0x3662b1(++_0x51cae2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x5fc3[_0x3438cf];return _0x278698;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2646e3f..2378faf 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 _0x53b5=['limit','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxQueueReport','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x53b5,0x64));var _0x553b=function(_0x2f361e,_0x5321c4){_0x2f361e=_0x2f361e-0x0;var _0x1d60a4=_0x53b5[_0x2f361e];return _0x1d60a4;};'use strict';var _=require(_0x553b('0x0'));var util=require(_0x553b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x553b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x553b('0x3'))['db'];var utils=require(_0x553b('0x4'));var logger=require(_0x553b('0x5'))(_0x553b('0x6'));var config=require(_0x553b('0x7'));var jayson=require(_0x553b('0x8'));var client=jayson[_0x553b('0x9')][_0x553b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x113a72,_0x5f3c19,_0x31c39f){return new BPromise(function(_0x4b1130,_0x206b48){return client[_0x553b('0xb')](_0x113a72,_0x31c39f)[_0x553b('0xc')](function(_0x3abdbb){logger[_0x553b('0xd')](_0x553b('0xe'),_0x5f3c19,_0x553b('0xf'));logger[_0x553b('0x10')](_0x553b('0x11'),_0x5f3c19,_0x553b('0xf'),JSON[_0x553b('0x12')](_0x3abdbb));if(_0x3abdbb[_0x553b('0x13')]){if(_0x3abdbb['error']['code']===0x1f4){logger['error'](_0x553b('0xe'),_0x5f3c19,_0x3abdbb[_0x553b('0x13')][_0x553b('0x14')]);return _0x206b48(_0x3abdbb[_0x553b('0x13')][_0x553b('0x14')]);}logger[_0x553b('0x13')](_0x553b('0xe'),_0x5f3c19,_0x3abdbb[_0x553b('0x13')][_0x553b('0x14')]);return _0x4b1130(_0x3abdbb[_0x553b('0x13')][_0x553b('0x14')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5f3c19,_0x553b('0xf'));_0x4b1130(_0x3abdbb[_0x553b('0x15')][_0x553b('0x14')]);}})[_0x553b('0x16')](function(_0x106f17){logger[_0x553b('0x13')](_0x553b('0xe'),_0x5f3c19,_0x106f17);_0x206b48(_0x106f17);});});}exports['CreateFaxQueueReport']=function(_0xf55993){var _0x5ade80=this;return new Promise(function(_0x2ab0e9,_0x21ec1c){return db[_0x553b('0x17')]['create'](_0xf55993[_0x553b('0x18')],{'raw':_0xf55993['options']?_0xf55993[_0x553b('0x19')][_0x553b('0x1a')]===undefined?!![]:![]:!![]})[_0x553b('0xc')](function(_0x13af17){logger[_0x553b('0xd')](_0x553b('0x1b'),_0xf55993);logger[_0x553b('0x10')](_0x553b('0x1b'),_0xf55993,JSON[_0x553b('0x12')](_0x13af17));_0x2ab0e9(_0x13af17);})['catch'](function(_0x288382){logger[_0x553b('0x13')](_0x553b('0x1b'),_0x288382['message'],_0xf55993);_0x21ec1c(_0x5ade80['error'](0x1f4,_0x288382[_0x553b('0x14')]));});});};exports[_0x553b('0x1c')]=function(_0xf82171){var _0x392f4e=this;return new Promise(function(_0x88f510,_0x39bcf6){return db[_0x553b('0x17')][_0x553b('0x1d')](_0xf82171['body'],{'raw':_0xf82171[_0x553b('0x19')]?_0xf82171['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf82171[_0x553b('0x19')]?_0xf82171[_0x553b('0x19')][_0x553b('0x1e')]||null:null,'attributes':_0xf82171[_0x553b('0x19')]?_0xf82171[_0x553b('0x19')][_0x553b('0x1f')]||null:null,'limit':_0xf82171[_0x553b('0x19')]?_0xf82171['options'][_0x553b('0x20')]||null:null})['then'](function(_0x14fbcb){logger[_0x553b('0xd')](_0x553b('0x1c'),_0xf82171);logger['debug']('UpdateFaxQueueReport',_0xf82171,JSON['stringify'](_0x14fbcb));_0x88f510(_0x14fbcb);})[_0x553b('0x16')](function(_0x309186){logger[_0x553b('0x13')](_0x553b('0x1c'),_0x309186['message'],_0xf82171);_0x39bcf6(_0x392f4e[_0x553b('0x13')](0x1f4,_0x309186[_0x553b('0x14')]));});});}; \ No newline at end of file +var _0xf7cd=['FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','UpdateFaxQueueReport','update','where','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2555fa,_0x4c53c1){var _0x1cd62d=function(_0xd395a){while(--_0xd395a){_0x2555fa['push'](_0x2555fa['shift']());}};_0x1cd62d(++_0x4c53c1);}(_0xf7cd,0x1ef));var _0xdf7c=function(_0x1ffe40,_0xa78028){_0x1ffe40=_0x1ffe40-0x0;var _0x5385e5=_0xf7cd[_0x1ffe40];return _0x5385e5;};'use strict';var _=require('lodash');var util=require(_0xdf7c('0x0'));var moment=require(_0xdf7c('0x1'));var BPromise=require(_0xdf7c('0x2'));var rs=require(_0xdf7c('0x3'));var fs=require('fs');var Redis=require(_0xdf7c('0x4'));var db=require(_0xdf7c('0x5'))['db'];var utils=require(_0xdf7c('0x6'));var logger=require(_0xdf7c('0x7'))(_0xdf7c('0x8'));var config=require(_0xdf7c('0x9'));var jayson=require(_0xdf7c('0xa'));var client=jayson['client'][_0xdf7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca9358,_0x1caca5,_0x2d7a40){return new BPromise(function(_0x570725,_0x777575){return client[_0xdf7c('0xc')](_0xca9358,_0x2d7a40)[_0xdf7c('0xd')](function(_0x4a3e7e){logger[_0xdf7c('0xe')](_0xdf7c('0xf'),_0x1caca5,'request\x20sent');logger[_0xdf7c('0x10')](_0xdf7c('0x11'),_0x1caca5,_0xdf7c('0x12'),JSON[_0xdf7c('0x13')](_0x4a3e7e));if(_0x4a3e7e[_0xdf7c('0x14')]){if(_0x4a3e7e['error'][_0xdf7c('0x15')]===0x1f4){logger['error'](_0xdf7c('0xf'),_0x1caca5,_0x4a3e7e[_0xdf7c('0x14')][_0xdf7c('0x16')]);return _0x777575(_0x4a3e7e[_0xdf7c('0x14')]['message']);}logger[_0xdf7c('0x14')](_0xdf7c('0xf'),_0x1caca5,_0x4a3e7e[_0xdf7c('0x14')][_0xdf7c('0x16')]);return _0x570725(_0x4a3e7e['error'][_0xdf7c('0x16')]);}else{logger[_0xdf7c('0xe')](_0xdf7c('0xf'),_0x1caca5,_0xdf7c('0x12'));_0x570725(_0x4a3e7e[_0xdf7c('0x17')]['message']);}})['catch'](function(_0x15893e){logger[_0xdf7c('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x1caca5,_0x15893e);_0x777575(_0x15893e);});});}exports[_0xdf7c('0x18')]=function(_0x34b78b){var _0x41c8fd=this;return new Promise(function(_0xdd006d,_0x3e0ae1){return db[_0xdf7c('0x19')][_0xdf7c('0x1a')](_0x34b78b['body'],{'raw':_0x34b78b['options']?_0x34b78b[_0xdf7c('0x1b')][_0xdf7c('0x1c')]===undefined?!![]:![]:!![]})[_0xdf7c('0xd')](function(_0x18b65b){logger[_0xdf7c('0xe')](_0xdf7c('0x18'),_0x34b78b);logger[_0xdf7c('0x10')]('CreateFaxQueueReport',_0x34b78b,JSON[_0xdf7c('0x13')](_0x18b65b));_0xdd006d(_0x18b65b);})['catch'](function(_0x382442){logger[_0xdf7c('0x14')](_0xdf7c('0x18'),_0x382442[_0xdf7c('0x16')],_0x34b78b);_0x3e0ae1(_0x41c8fd[_0xdf7c('0x14')](0x1f4,_0x382442[_0xdf7c('0x16')]));});});};exports[_0xdf7c('0x1d')]=function(_0x24e7d0){var _0x49c74c=this;return new Promise(function(_0x3b5538,_0x564b71){return db[_0xdf7c('0x19')][_0xdf7c('0x1e')](_0x24e7d0['body'],{'raw':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x1f')]||null:null,'attributes':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x20')]||null:null,'limit':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')]['limit']||null:null})[_0xdf7c('0xd')](function(_0x5b0254){logger[_0xdf7c('0xe')](_0xdf7c('0x1d'),_0x24e7d0);logger['debug'](_0xdf7c('0x1d'),_0x24e7d0,JSON[_0xdf7c('0x13')](_0x5b0254));_0x3b5538(_0x5b0254);})[_0xdf7c('0x21')](function(_0x55801e){logger['error'](_0xdf7c('0x1d'),_0x55801e[_0xdf7c('0x16')],_0x24e7d0);_0x564b71(_0x49c74c[_0xdf7c('0x14')](0x1f4,_0x55801e[_0xdf7c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 55cd20a..ea88613 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 _0x37c4=['express','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x17ffed,_0xf982ce){var _0x21b9ef=function(_0x54b644){while(--_0x54b644){_0x17ffed['push'](_0x17ffed['shift']());}};_0x21b9ef(++_0xf982ce);}(_0x37c4,0x178));var _0x437c=function(_0x560f5c,_0x2c63f1){_0x560f5c=_0x560f5c-0x0;var _0xf88353=_0x37c4[_0x560f5c];return _0xf88353;};'use strict';var multer=require(_0x437c('0x0'));var util=require(_0x437c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x437c('0x2'));var router=express['Router']();var fs_extra=require(_0x437c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x437c('0x4'));var controller=require(_0x437c('0x5'));router[_0x437c('0x6')]('/',auth[_0x437c('0x7')](),controller[_0x437c('0x8')]);router[_0x437c('0x6')](_0x437c('0x9'),auth[_0x437c('0x7')](),controller[_0x437c('0xa')]);router[_0x437c('0x6')](_0x437c('0xb'),auth['isAuthenticated'](),controller[_0x437c('0xc')]);router[_0x437c('0xd')]('/',auth['isAuthenticated'](),controller[_0x437c('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x437c('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x437c('0x10')]);module[_0x437c('0x11')]=router; \ No newline at end of file +var _0x01e3=['/describe','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x585c86,_0x1489e4){var _0x1100bc=function(_0x7bf28){while(--_0x7bf28){_0x585c86['push'](_0x585c86['shift']());}};_0x1100bc(++_0x1489e4);}(_0x01e3,0xf9));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x301e('0x0'));var util=require('util');var path=require(_0x301e('0x1'));var timeout=require(_0x301e('0x2'));var express=require(_0x301e('0x3'));var router=express[_0x301e('0x4')]();var fs_extra=require(_0x301e('0x5'));var auth=require(_0x301e('0x6'));var interaction=require(_0x301e('0x7'));var config=require(_0x301e('0x8'));var controller=require(_0x301e('0x9'));router[_0x301e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x301e('0xa')](_0x301e('0xb'),auth[_0x301e('0xc')](),controller['describe']);router[_0x301e('0xa')](_0x301e('0xd'),auth[_0x301e('0xc')](),controller[_0x301e('0xe')]);router[_0x301e('0xf')]('/',auth[_0x301e('0xc')](),controller[_0x301e('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x301e('0x11')](_0x301e('0xd'),auth[_0x301e('0xc')](),controller[_0x301e('0x12')]);module[_0x301e('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 28101a4..77cac38 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3175cc,_0x2aed1c){var _0x232482=function(_0x1a3e39){while(--_0x1a3e39){_0x3175cc['push'](_0x3175cc['shift']());}};_0x232482(++_0x2aed1c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x230822,_0x53f4b7){_0x230822=_0x230822-0x0;var _0x2c42e0=_0xf4eb[_0x230822];return _0x2c42e0;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4312f0,_0x47772f){_0x4312f0=_0x4312f0-0x0;var _0x3d89f4=_0x9bde[_0x4312f0];return _0x3d89f4;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index fd4aaec..1c2a015 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 _0x69d8=['filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x69d8,0x1ea));var _0x869d=function(_0x3222ad,_0x2df6b3){_0x3222ad=_0x3222ad-0x0;var _0x69314b=_0x69d8[_0x3222ad];return _0x69314b;};'use strict';var emlformat=require(_0x869d('0x0'));var rimraf=require(_0x869d('0x1'));var zipdir=require(_0x869d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x869d('0x3'));var moment=require(_0x869d('0x4'));var BPromise=require(_0x869d('0x5'));var Mustache=require(_0x869d('0x6'));var util=require('util');var path=require(_0x869d('0x7'));var sox=require('sox');var csv=require(_0x869d('0x8'));var ejs=require(_0x869d('0x9'));var fs=require('fs');var fs_extra=require(_0x869d('0xa'));var _=require('lodash');var squel=require(_0x869d('0xb'));var crypto=require('crypto');var jsforce=require(_0x869d('0xc'));var deskjs=require(_0x869d('0xd'));var toCsv=require(_0x869d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x869d('0xe'));var qs=require(_0x869d('0xf'));var as=require(_0x869d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x869d('0x11'))('api');var utils=require(_0x869d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x869d('0x13'))['db'];function respondWithStatusCode(_0x5119a9,_0x513c13){_0x513c13=_0x513c13||0xcc;return function(_0x430358){if(_0x430358){return _0x5119a9[_0x869d('0x14')](_0x513c13);}return _0x5119a9['status'](_0x513c13)[_0x869d('0x15')]();};}function respondWithResult(_0x23ad9c,_0x3b62ef){_0x3b62ef=_0x3b62ef||0xc8;return function(_0x5cef09){if(_0x5cef09){return _0x23ad9c[_0x869d('0x16')](_0x3b62ef)[_0x869d('0x17')](_0x5cef09);}};}function respondWithFilteredResult(_0x3053c9,_0x3f191e){return function(_0xe1ea94){if(_0xe1ea94){var _0x19ae17=typeof _0x3f191e[_0x869d('0x18')]===_0x869d('0x19')&&typeof _0x3f191e[_0x869d('0x1a')]===_0x869d('0x19');var _0x10129e=_0xe1ea94[_0x869d('0x1b')];var _0x56f5e2=_0x19ae17?0x0:_0x3f191e[_0x869d('0x18')];var _0x40cfbc=_0x19ae17?_0xe1ea94['count']:_0x3f191e[_0x869d('0x18')]+_0x3f191e[_0x869d('0x1a')];var _0x3ad8b8;if(_0x40cfbc>=_0x10129e){_0x40cfbc=_0x10129e;_0x3ad8b8=0xc8;}else{_0x3ad8b8=0xce;}_0x3053c9[_0x869d('0x16')](_0x3ad8b8);return _0x3053c9['set'](_0x869d('0x1c'),_0x56f5e2+'-'+_0x40cfbc+'/'+_0x10129e)[_0x869d('0x17')](_0xe1ea94);}return null;};}function patchUpdates(_0xfd175){return function(_0x203b6f){try{jsonpatch['apply'](_0x203b6f,_0xfd175,!![]);}catch(_0x2a4635){return BPromise[_0x869d('0x1d')](_0x2a4635);}return _0x203b6f[_0x869d('0x1e')]();};}function saveUpdates(_0x55f7c2,_0x415a00){return function(_0x153497){if(_0x153497){return _0x153497[_0x869d('0x1f')](_0x55f7c2)[_0x869d('0x20')](function(_0xc85b87){return _0xc85b87;});}return null;};}function removeEntity(_0x46b444,_0x497f63){return function(_0x1cd45c){if(_0x1cd45c){return _0x1cd45c['destroy']()['then'](function(){_0x46b444[_0x869d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525d27,_0x16f1ac){return function(_0x475e59){if(!_0x475e59){_0x525d27[_0x869d('0x14')](0x194);}return _0x475e59;};}function handleError(_0x2f16e9,_0x20b1ff){_0x20b1ff=_0x20b1ff||0x1f4;return function(_0x384fdb){logger[_0x869d('0x21')](_0x384fdb['stack']);if(_0x384fdb['name']){delete _0x384fdb[_0x869d('0x22')];}_0x2f16e9[_0x869d('0x16')](_0x20b1ff)[_0x869d('0x23')](_0x384fdb);};}exports['index']=function(_0x1ebb18,_0x3d666a){var _0x129704={},_0x17c714={},_0x51996e={'count':0x0,'rows':[]};var _0x51ae25=_[_0x869d('0x24')](db[_0x869d('0x25')][_0x869d('0x26')],function(_0x3770bd){return{'name':_0x3770bd[_0x869d('0x27')],'type':_0x3770bd[_0x869d('0x28')]['key']};});_0x17c714[_0x869d('0x29')]=_[_0x869d('0x24')](_0x51ae25,'name');_0x17c714[_0x869d('0x2a')]=_[_0x869d('0x2b')](_0x1ebb18[_0x869d('0x2a')]);_0x17c714['filters']=_[_0x869d('0x2c')](_0x17c714[_0x869d('0x29')],_0x17c714[_0x869d('0x2a')]);_0x129704[_0x869d('0x2d')]=_['intersection'](_0x17c714[_0x869d('0x29')],qs[_0x869d('0x2e')](_0x1ebb18[_0x869d('0x2a')]['fields']));_0x129704[_0x869d('0x2d')]=_0x129704['attributes'][_0x869d('0x2f')]?_0x129704[_0x869d('0x2d')]:_0x17c714[_0x869d('0x29')];if(!_0x1ebb18[_0x869d('0x2a')]['hasOwnProperty']('nolimit')){_0x129704[_0x869d('0x1a')]=qs['limit'](_0x1ebb18[_0x869d('0x2a')]['limit']);_0x129704['offset']=qs['offset'](_0x1ebb18['query'][_0x869d('0x18')]);}_0x129704[_0x869d('0x30')]=qs[_0x869d('0x31')](_0x1ebb18[_0x869d('0x2a')][_0x869d('0x31')]);_0x129704[_0x869d('0x32')]=qs[_0x869d('0x33')](_[_0x869d('0x34')](_0x1ebb18['query'],_0x17c714[_0x869d('0x33')]),_0x51ae25);if(_0x1ebb18[_0x869d('0x2a')]['filter']){_0x129704['where']=_[_0x869d('0x35')](_0x129704[_0x869d('0x32')],{'$or':_['map'](_0x51ae25,function(_0x4e70ff){if(_0x4e70ff[_0x869d('0x28')]!=='VIRTUAL'){var _0x19ab0e={};_0x19ab0e[_0x4e70ff[_0x869d('0x22')]]={'$like':'%'+_0x1ebb18[_0x869d('0x2a')][_0x869d('0x36')]+'%'};return _0x19ab0e;}})});}_0x129704=_['merge']({},_0x129704,_0x1ebb18[_0x869d('0x37')]);var _0xf58d73={'where':_0x129704[_0x869d('0x32')]};return db[_0x869d('0x25')]['count'](_0xf58d73)['then'](function(_0x5663e1){_0x51996e['count']=_0x5663e1;if(_0x1ebb18[_0x869d('0x2a')][_0x869d('0x38')]){_0x129704['include']=[{'all':!![]}];}return db[_0x869d('0x25')][_0x869d('0x39')](_0x129704);})[_0x869d('0x20')](function(_0x21dfef){_0x51996e[_0x869d('0x3a')]=_0x21dfef;return _0x51996e;})[_0x869d('0x20')](respondWithFilteredResult(_0x3d666a,_0x129704))[_0x869d('0x3b')](handleError(_0x3d666a,null));};exports[_0x869d('0x3c')]=function(_0x22ccc9,_0x612555){var _0x96fbfd={'raw':!![],'where':{'id':_0x22ccc9[_0x869d('0x3d')]['id']}},_0x43886a={};_0x43886a[_0x869d('0x29')]=_[_0x869d('0x2b')](db[_0x869d('0x25')]['rawAttributes']);_0x43886a[_0x869d('0x2a')]=_[_0x869d('0x2b')](_0x22ccc9[_0x869d('0x2a')]);_0x43886a['filters']=_['intersection'](_0x43886a['model'],_0x43886a[_0x869d('0x2a')]);_0x96fbfd['attributes']=_[_0x869d('0x2c')](_0x43886a[_0x869d('0x29')],qs['fields'](_0x22ccc9[_0x869d('0x2a')][_0x869d('0x2e')]));_0x96fbfd[_0x869d('0x2d')]=_0x96fbfd[_0x869d('0x2d')][_0x869d('0x2f')]?_0x96fbfd[_0x869d('0x2d')]:_0x43886a['model'];if(_0x22ccc9[_0x869d('0x2a')][_0x869d('0x38')]){_0x96fbfd[_0x869d('0x3e')]=[{'all':!![]}];}_0x96fbfd=_[_0x869d('0x35')]({},_0x96fbfd,_0x22ccc9[_0x869d('0x37')]);return db[_0x869d('0x25')][_0x869d('0x3f')](_0x96fbfd)[_0x869d('0x20')](handleEntityNotFound(_0x612555,null))['then'](respondWithResult(_0x612555,null))[_0x869d('0x3b')](handleError(_0x612555,null));};exports['create']=function(_0x222bf5,_0x166d92){return db['FaxTransferReport'][_0x869d('0x40')](_0x222bf5['body'],{})[_0x869d('0x20')](respondWithResult(_0x166d92,0xc9))['catch'](handleError(_0x166d92,null));};exports['update']=function(_0x3b8dc1,_0x10a859){if(_0x3b8dc1[_0x869d('0x41')]['id']){delete _0x3b8dc1['body']['id'];}return db[_0x869d('0x25')]['find']({'where':{'id':_0x3b8dc1[_0x869d('0x3d')]['id']}})[_0x869d('0x20')](handleEntityNotFound(_0x10a859,null))[_0x869d('0x20')](saveUpdates(_0x3b8dc1['body'],null))[_0x869d('0x20')](respondWithResult(_0x10a859,null))[_0x869d('0x3b')](handleError(_0x10a859,null));};exports[_0x869d('0x42')]=function(_0x229f51,_0x51c850){return db[_0x869d('0x25')]['find']({'where':{'id':_0x229f51[_0x869d('0x3d')]['id']}})[_0x869d('0x20')](handleEntityNotFound(_0x51c850,null))[_0x869d('0x20')](removeEntity(_0x51c850,null))[_0x869d('0x3b')](handleError(_0x51c850,null));};exports[_0x869d('0x43')]=function(_0x3d49e1,_0x441969){return db[_0x869d('0x25')]['describe']()[_0x869d('0x20')](respondWithResult(_0x441969,null))[_0x869d('0x3b')](handleError(_0x441969,null));}; \ No newline at end of file +var _0xa357=['rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','FaxTransferReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','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','status','end','undefined','limit','count','offset','set','apply','reject','update','then','error','stack','name','send','index'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0xa357,0x172));var _0x7a35=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xa357[_0x1b1a3b];return _0x385347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a35('0x1'));var moment=require('moment');var BPromise=require(_0x7a35('0x2'));var Mustache=require('mustache');var util=require(_0x7a35('0x3'));var path=require(_0x7a35('0x4'));var sox=require('sox');var csv=require(_0x7a35('0x5'));var ejs=require(_0x7a35('0x6'));var fs=require('fs');var fs_extra=require(_0x7a35('0x7'));var _=require(_0x7a35('0x8'));var squel=require(_0x7a35('0x9'));var crypto=require('crypto');var jsforce=require(_0x7a35('0xa'));var deskjs=require(_0x7a35('0xb'));var toCsv=require(_0x7a35('0x5'));var querystring=require('querystring');var Papa=require(_0x7a35('0xc'));var Redis=require('ioredis');var authService=require(_0x7a35('0xd'));var qs=require(_0x7a35('0xe'));var as=require(_0x7a35('0xf'));var hardwareService=require(_0x7a35('0x10'));var logger=require(_0x7a35('0x11'))(_0x7a35('0x12'));var utils=require(_0x7a35('0x13'));var config=require(_0x7a35('0x14'));var licenseUtil=require(_0x7a35('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58895d,_0x4c7bd3){_0x4c7bd3=_0x4c7bd3||0xcc;return function(_0x58b163){if(_0x58b163){return _0x58895d['sendStatus'](_0x4c7bd3);}return _0x58895d[_0x7a35('0x16')](_0x4c7bd3)[_0x7a35('0x17')]();};}function respondWithResult(_0x391164,_0x24880c){_0x24880c=_0x24880c||0xc8;return function(_0x139ef8){if(_0x139ef8){return _0x391164[_0x7a35('0x16')](_0x24880c)['json'](_0x139ef8);}};}function respondWithFilteredResult(_0x54d5fb,_0x338afc){return function(_0x4ca4c3){if(_0x4ca4c3){var _0x6085a2=typeof _0x338afc['offset']===_0x7a35('0x18')&&typeof _0x338afc[_0x7a35('0x19')]==='undefined';var _0x7a4462=_0x4ca4c3[_0x7a35('0x1a')];var _0x1486fc=_0x6085a2?0x0:_0x338afc[_0x7a35('0x1b')];var _0x3a16ea=_0x6085a2?_0x4ca4c3['count']:_0x338afc['offset']+_0x338afc[_0x7a35('0x19')];var _0x220751;if(_0x3a16ea>=_0x7a4462){_0x3a16ea=_0x7a4462;_0x220751=0xc8;}else{_0x220751=0xce;}_0x54d5fb['status'](_0x220751);return _0x54d5fb[_0x7a35('0x1c')]('Content-Range',_0x1486fc+'-'+_0x3a16ea+'/'+_0x7a4462)['json'](_0x4ca4c3);}return null;};}function patchUpdates(_0x41e576){return function(_0x3bac30){try{jsonpatch[_0x7a35('0x1d')](_0x3bac30,_0x41e576,!![]);}catch(_0x48c606){return BPromise[_0x7a35('0x1e')](_0x48c606);}return _0x3bac30['save']();};}function saveUpdates(_0x43dca9,_0x4ec9c8){return function(_0x6fb75e){if(_0x6fb75e){return _0x6fb75e[_0x7a35('0x1f')](_0x43dca9)[_0x7a35('0x20')](function(_0x3d5494){return _0x3d5494;});}return null;};}function removeEntity(_0x69981d,_0x54a8fd){return function(_0x55b5cb){if(_0x55b5cb){return _0x55b5cb['destroy']()['then'](function(){_0x69981d[_0x7a35('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190a28,_0x38100d){return function(_0x180781){if(!_0x180781){_0x190a28['sendStatus'](0x194);}return _0x180781;};}function handleError(_0x6680b6,_0x15030e){_0x15030e=_0x15030e||0x1f4;return function(_0x2e00bb){logger[_0x7a35('0x21')](_0x2e00bb[_0x7a35('0x22')]);if(_0x2e00bb['name']){delete _0x2e00bb[_0x7a35('0x23')];}_0x6680b6[_0x7a35('0x16')](_0x15030e)[_0x7a35('0x24')](_0x2e00bb);};}exports[_0x7a35('0x25')]=function(_0x32b73d,_0x548a83){var _0x15d2e4={},_0x1e3f8e={},_0x335901={'count':0x0,'rows':[]};var _0x1ea3d4=_['map'](db['FaxTransferReport'][_0x7a35('0x26')],function(_0x399d21){return{'name':_0x399d21['fieldName'],'type':_0x399d21[_0x7a35('0x27')][_0x7a35('0x28')]};});_0x1e3f8e['model']=_['map'](_0x1ea3d4,_0x7a35('0x23'));_0x1e3f8e[_0x7a35('0x29')]=_['keys'](_0x32b73d[_0x7a35('0x29')]);_0x1e3f8e[_0x7a35('0x2a')]=_[_0x7a35('0x2b')](_0x1e3f8e[_0x7a35('0x2c')],_0x1e3f8e[_0x7a35('0x29')]);_0x15d2e4[_0x7a35('0x2d')]=_[_0x7a35('0x2b')](_0x1e3f8e[_0x7a35('0x2c')],qs[_0x7a35('0x2e')](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x2e')]));_0x15d2e4['attributes']=_0x15d2e4['attributes'][_0x7a35('0x2f')]?_0x15d2e4[_0x7a35('0x2d')]:_0x1e3f8e[_0x7a35('0x2c')];if(!_0x32b73d[_0x7a35('0x29')][_0x7a35('0x30')](_0x7a35('0x31'))){_0x15d2e4[_0x7a35('0x19')]=qs[_0x7a35('0x19')](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x19')]);_0x15d2e4['offset']=qs['offset'](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x1b')]);}_0x15d2e4['order']=qs['sort'](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x32')]);_0x15d2e4[_0x7a35('0x33')]=qs[_0x7a35('0x2a')](_['pick'](_0x32b73d[_0x7a35('0x29')],_0x1e3f8e['filters']),_0x1ea3d4);if(_0x32b73d['query'][_0x7a35('0x34')]){_0x15d2e4[_0x7a35('0x33')]=_[_0x7a35('0x35')](_0x15d2e4['where'],{'$or':_['map'](_0x1ea3d4,function(_0x266804){if(_0x266804[_0x7a35('0x27')]!=='VIRTUAL'){var _0x205447={};_0x205447[_0x266804[_0x7a35('0x23')]]={'$like':'%'+_0x32b73d[_0x7a35('0x29')][_0x7a35('0x34')]+'%'};return _0x205447;}})});}_0x15d2e4=_[_0x7a35('0x35')]({},_0x15d2e4,_0x32b73d[_0x7a35('0x36')]);var _0x449db6={'where':_0x15d2e4['where']};return db[_0x7a35('0x37')][_0x7a35('0x1a')](_0x449db6)[_0x7a35('0x20')](function(_0x6779ae){_0x335901[_0x7a35('0x1a')]=_0x6779ae;if(_0x32b73d[_0x7a35('0x29')]['includeAll']){_0x15d2e4[_0x7a35('0x38')]=[{'all':!![]}];}return db[_0x7a35('0x37')][_0x7a35('0x39')](_0x15d2e4);})['then'](function(_0x1687be){_0x335901[_0x7a35('0x3a')]=_0x1687be;return _0x335901;})[_0x7a35('0x20')](respondWithFilteredResult(_0x548a83,_0x15d2e4))[_0x7a35('0x3b')](handleError(_0x548a83,null));};exports[_0x7a35('0x3c')]=function(_0xb3a061,_0x1d99da){var _0x1537e9={'raw':!![],'where':{'id':_0xb3a061[_0x7a35('0x3d')]['id']}},_0x13272b={};_0x13272b['model']=_[_0x7a35('0x3e')](db[_0x7a35('0x37')]['rawAttributes']);_0x13272b[_0x7a35('0x29')]=_[_0x7a35('0x3e')](_0xb3a061[_0x7a35('0x29')]);_0x13272b[_0x7a35('0x2a')]=_[_0x7a35('0x2b')](_0x13272b[_0x7a35('0x2c')],_0x13272b[_0x7a35('0x29')]);_0x1537e9['attributes']=_[_0x7a35('0x2b')](_0x13272b['model'],qs[_0x7a35('0x2e')](_0xb3a061[_0x7a35('0x29')]['fields']));_0x1537e9[_0x7a35('0x2d')]=_0x1537e9[_0x7a35('0x2d')][_0x7a35('0x2f')]?_0x1537e9[_0x7a35('0x2d')]:_0x13272b[_0x7a35('0x2c')];if(_0xb3a061['query'][_0x7a35('0x3f')]){_0x1537e9[_0x7a35('0x38')]=[{'all':!![]}];}_0x1537e9=_[_0x7a35('0x35')]({},_0x1537e9,_0xb3a061[_0x7a35('0x36')]);return db[_0x7a35('0x37')][_0x7a35('0x40')](_0x1537e9)[_0x7a35('0x20')](handleEntityNotFound(_0x1d99da,null))[_0x7a35('0x20')](respondWithResult(_0x1d99da,null))['catch'](handleError(_0x1d99da,null));};exports[_0x7a35('0x41')]=function(_0x302faf,_0x22754c){return db[_0x7a35('0x37')]['create'](_0x302faf[_0x7a35('0x42')],{})[_0x7a35('0x20')](respondWithResult(_0x22754c,0xc9))[_0x7a35('0x3b')](handleError(_0x22754c,null));};exports[_0x7a35('0x1f')]=function(_0x7370e,_0xcff456){if(_0x7370e['body']['id']){delete _0x7370e['body']['id'];}return db[_0x7a35('0x37')][_0x7a35('0x40')]({'where':{'id':_0x7370e[_0x7a35('0x3d')]['id']}})[_0x7a35('0x20')](handleEntityNotFound(_0xcff456,null))['then'](saveUpdates(_0x7370e['body'],null))['then'](respondWithResult(_0xcff456,null))[_0x7a35('0x3b')](handleError(_0xcff456,null));};exports['destroy']=function(_0x596131,_0x5bc4ed){return db[_0x7a35('0x37')][_0x7a35('0x40')]({'where':{'id':_0x596131[_0x7a35('0x3d')]['id']}})[_0x7a35('0x20')](handleEntityNotFound(_0x5bc4ed,null))[_0x7a35('0x20')](removeEntity(_0x5bc4ed,null))[_0x7a35('0x3b')](handleError(_0x5bc4ed,null));};exports[_0x7a35('0x43')]=function(_0x1b0803,_0x188a66){return db['FaxTransferReport'][_0x7a35('0x43')]()[_0x7a35('0x20')](respondWithResult(_0x188a66,null))[_0x7a35('0x3b')](handleError(_0x188a66,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 690a6ab..67d8709 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 _0x0276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger'];(function(_0x584e87,_0x693b2d){var _0x298e6e=function(_0x1f9a89){while(--_0x1f9a89){_0x584e87['push'](_0x584e87['shift']());}};_0x298e6e(++_0x693b2d);}(_0x0276,0x15c));var _0x6027=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x0276[_0x545a3a];return _0x5a5493;};'use strict';var _=require(_0x6027('0x0'));var util=require('util');var logger=require(_0x6027('0x1'))(_0x6027('0x2'));var moment=require(_0x6027('0x3'));var BPromise=require(_0x6027('0x4'));var rp=require(_0x6027('0x5'));var fs=require('fs');var path=require(_0x6027('0x6'));var rimraf=require(_0x6027('0x7'));var config=require(_0x6027('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0x6027('0x9')]=function(_0x5b0bff,_0x329802){return _0x5b0bff[_0x6027('0xa')](_0x6027('0xb'),attributes,{'tableName':_0x6027('0xc'),'paranoid':![],'indexes':[{'name':_0x6027('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3a3=['define','report_fax_transfer','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x484195,_0x25a4d2){var _0xd057ff=function(_0x4a1b2b){while(--_0x4a1b2b){_0x484195['push'](_0x484195['shift']());}};_0xd057ff(++_0x25a4d2);}(_0xa3a3,0x141));var _0x3a3a=function(_0x35bb5b,_0x5f5200){_0x35bb5b=_0x35bb5b-0x0;var _0x53a08a=_0xa3a3[_0x35bb5b];return _0x53a08a;};'use strict';var _=require('lodash');var util=require(_0x3a3a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3a3a('0x1'));var BPromise=require(_0x3a3a('0x2'));var rp=require(_0x3a3a('0x3'));var fs=require('fs');var path=require(_0x3a3a('0x4'));var rimraf=require(_0x3a3a('0x5'));var config=require(_0x3a3a('0x6'));var attributes=require(_0x3a3a('0x7'));module[_0x3a3a('0x8')]=function(_0x36b63d,_0x497a1b){return _0x36b63d[_0x3a3a('0x9')]('FaxTransferReport',attributes,{'tableName':_0x3a3a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','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 58096d0..29d099e 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 _0x51d9=['then','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x329808,_0x343255){var _0x1bbad0=function(_0x458c5b){while(--_0x458c5b){_0x329808['push'](_0x329808['shift']());}};_0x1bbad0(++_0x343255);}(_0x51d9,0x113));var _0x951d=function(_0x5c7a4b,_0x4237b0){_0x5c7a4b=_0x5c7a4b-0x0;var _0x3b1115=_0x51d9[_0x5c7a4b];return _0x3b1115;};'use strict';var _=require(_0x951d('0x0'));var util=require(_0x951d('0x1'));var moment=require(_0x951d('0x2'));var BPromise=require('bluebird');var rs=require(_0x951d('0x3'));var fs=require('fs');var Redis=require(_0x951d('0x4'));var db=require(_0x951d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x951d('0x6'))(_0x951d('0x7'));var config=require(_0x951d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x951d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d217f,_0x49f575,_0x4d9ca3){return new BPromise(function(_0x5d59fd,_0xdcdcdd){return client['request'](_0x2d217f,_0x4d9ca3)[_0x951d('0xa')](function(_0x1ee3dc){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x49f575,_0x951d('0xb'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x49f575,_0x951d('0xb'),JSON[_0x951d('0xc')](_0x1ee3dc));if(_0x1ee3dc[_0x951d('0xd')]){if(_0x1ee3dc['error'][_0x951d('0xe')]===0x1f4){logger[_0x951d('0xd')](_0x951d('0xf'),_0x49f575,_0x1ee3dc[_0x951d('0xd')]['message']);return _0xdcdcdd(_0x1ee3dc[_0x951d('0xd')][_0x951d('0x10')]);}logger[_0x951d('0xd')](_0x951d('0xf'),_0x49f575,_0x1ee3dc[_0x951d('0xd')][_0x951d('0x10')]);return _0x5d59fd(_0x1ee3dc[_0x951d('0xd')]['message']);}else{logger['info'](_0x951d('0xf'),_0x49f575,'request\x20sent');_0x5d59fd(_0x1ee3dc[_0x951d('0x11')][_0x951d('0x10')]);}})[_0x951d('0x12')](function(_0x4c8cf6){logger['error'](_0x951d('0xf'),_0x49f575,_0x4c8cf6);_0xdcdcdd(_0x4c8cf6);});});} \ No newline at end of file +var _0xe01b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3c23fb,_0x44e8a0){var _0x1ba956=function(_0x2dafb4){while(--_0x2dafb4){_0x3c23fb['push'](_0x3c23fb['shift']());}};_0x1ba956(++_0x44e8a0);}(_0xe01b,0x7e));var _0xbe01=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xe01b[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xbe01('0x0'));var util=require(_0xbe01('0x1'));var moment=require('moment');var BPromise=require(_0xbe01('0x2'));var rs=require(_0xbe01('0x3'));var fs=require('fs');var Redis=require(_0xbe01('0x4'));var db=require(_0xbe01('0x5'))['db'];var utils=require(_0xbe01('0x6'));var logger=require(_0xbe01('0x7'))(_0xbe01('0x8'));var config=require(_0xbe01('0x9'));var jayson=require(_0xbe01('0xa'));var client=jayson[_0xbe01('0xb')][_0xbe01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c93ac,_0x3e4327,_0x175a69){return new BPromise(function(_0x496d2c,_0xe13df3){return client[_0xbe01('0xd')](_0x2c93ac,_0x175a69)[_0xbe01('0xe')](function(_0x39de6c){logger[_0xbe01('0xf')](_0xbe01('0x10'),_0x3e4327,_0xbe01('0x11'));logger[_0xbe01('0x12')](_0xbe01('0x13'),_0x3e4327,'request\x20sent',JSON['stringify'](_0x39de6c));if(_0x39de6c['error']){if(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x15')]===0x1f4){logger[_0xbe01('0x14')](_0xbe01('0x10'),_0x3e4327,_0x39de6c['error'][_0xbe01('0x16')]);return _0xe13df3(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);}logger[_0xbe01('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x3e4327,_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);return _0x496d2c(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);}else{logger[_0xbe01('0xf')](_0xbe01('0x10'),_0x3e4327,_0xbe01('0x11'));_0x496d2c(_0x39de6c[_0xbe01('0x17')][_0xbe01('0x16')]);}})[_0xbe01('0x18')](function(_0x3c046c){logger[_0xbe01('0x14')](_0xbe01('0x10'),_0x3e4327,_0x3c046c);_0xe13df3(_0x3c046c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 440223e..e2dab2d 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 _0x57e6=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4cea15,_0x50df10){var _0x3e8c3d=function(_0x4d912f){while(--_0x4d912f){_0x4cea15['push'](_0x4cea15['shift']());}};_0x3e8c3d(++_0x50df10);}(_0x57e6,0x76));var _0x657e=function(_0x3cf053,_0x7a9947){_0x3cf053=_0x3cf053-0x0;var _0x3b55a0=_0x57e6[_0x3cf053];return _0x3b55a0;};'use strict';var multer=require(_0x657e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x657e('0x1'));var express=require(_0x657e('0x2'));var router=express[_0x657e('0x3')]();var fs_extra=require(_0x657e('0x4'));var auth=require(_0x657e('0x5'));var interaction=require(_0x657e('0x6'));var config=require(_0x657e('0x7'));var controller=require(_0x657e('0x8'));router[_0x657e('0x9')]('/',auth[_0x657e('0xa')](),controller[_0x657e('0xb')]);router[_0x657e('0x9')](_0x657e('0xc'),auth[_0x657e('0xa')](),controller[_0x657e('0xd')]);router[_0x657e('0x9')](_0x657e('0xe'),auth[_0x657e('0xa')](),controller[_0x657e('0xf')]);router[_0x657e('0x10')]('/',auth['isAuthenticated'](),controller[_0x657e('0x11')]);router[_0x657e('0x12')](_0x657e('0xe'),auth['isAuthenticated'](),controller[_0x657e('0x13')]);router['delete'](_0x657e('0xe'),auth[_0x657e('0xa')](),controller['destroy']);module[_0x657e('0x14')]=router; \ No newline at end of file +var _0x8ea1=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy'];(function(_0x133c1c,_0x52fd1f){var _0x138a82=function(_0x28e94a){while(--_0x28e94a){_0x133c1c['push'](_0x133c1c['shift']());}};_0x138a82(++_0x52fd1f);}(_0x8ea1,0x169));var _0x18ea=function(_0x5b3c61,_0x3eb2aa){_0x5b3c61=_0x5b3c61-0x0;var _0x153389=_0x8ea1[_0x5b3c61];return _0x153389;};'use strict';var multer=require('multer');var util=require(_0x18ea('0x0'));var path=require(_0x18ea('0x1'));var timeout=require(_0x18ea('0x2'));var express=require(_0x18ea('0x3'));var router=express[_0x18ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x18ea('0x5'));var interaction=require(_0x18ea('0x6'));var config=require(_0x18ea('0x7'));var controller=require(_0x18ea('0x8'));router[_0x18ea('0x9')]('/',auth[_0x18ea('0xa')](),controller[_0x18ea('0xb')]);router[_0x18ea('0x9')]('/describe',auth[_0x18ea('0xa')](),controller[_0x18ea('0xc')]);router['get'](_0x18ea('0xd'),auth[_0x18ea('0xa')](),controller[_0x18ea('0xe')]);router[_0x18ea('0xf')]('/',auth[_0x18ea('0xa')](),controller['create']);router[_0x18ea('0x10')](_0x18ea('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x18ea('0x11')]('/:id',auth[_0x18ea('0xa')](),controller[_0x18ea('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 723117f..40bfd72 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 _0x472c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x39f73b,_0x46435d){var _0x17fb32=function(_0x386012){while(--_0x386012){_0x39f73b['push'](_0x39f73b['shift']());}};_0x17fb32(++_0x46435d);}(_0x472c,0xd9));var _0xc472=function(_0x2ba3d9,_0xf3bb5){_0x2ba3d9=_0x2ba3d9-0x0;var _0x50ba16=_0x472c[_0x2ba3d9];return _0x50ba16;};'use strict';var multer=require(_0xc472('0x0'));var util=require(_0xc472('0x1'));var path=require('path');var timeout=require(_0xc472('0x2'));var express=require(_0xc472('0x3'));var router=express['Router']();var fs_extra=require(_0xc472('0x4'));var auth=require(_0xc472('0x5'));var interaction=require(_0xc472('0x6'));var config=require(_0xc472('0x7'));var controller=require(_0xc472('0x8'));router[_0xc472('0x9')]('/',auth[_0xc472('0xa')](),controller['index']);router['get'](_0xc472('0xb'),auth[_0xc472('0xa')](),controller['show']);router['get'](_0xc472('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc472('0x9')](_0xc472('0xd'),auth[_0xc472('0xa')](),controller[_0xc472('0xe')]);router[_0xc472('0xf')]('/',auth[_0xc472('0xa')](),controller[_0xc472('0x10')]);router[_0xc472('0xf')]('/:id/configurations',auth[_0xc472('0xa')](),controller[_0xc472('0x11')]);router[_0xc472('0x12')](_0xc472('0xb'),auth['isAuthenticated'](),controller[_0xc472('0x13')]);router[_0xc472('0x14')](_0xc472('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc472('0x15')]=router; \ No newline at end of file +var _0x244b=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update'];(function(_0x46fdfc,_0x43cdbd){var _0x54eef3=function(_0x4cdbe5){while(--_0x4cdbe5){_0x46fdfc['push'](_0x46fdfc['shift']());}};_0x54eef3(++_0x43cdbd);}(_0x244b,0x1ba));var _0xb244=function(_0x1af4c8,_0x1ddb77){_0x1af4c8=_0x1af4c8-0x0;var _0x34d739=_0x244b[_0x1af4c8];return _0x34d739;};'use strict';var multer=require(_0xb244('0x0'));var util=require('util');var path=require(_0xb244('0x1'));var timeout=require(_0xb244('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb244('0x3'));var auth=require(_0xb244('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xb244('0x5')](),controller[_0xb244('0x6')]);router[_0xb244('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb244('0x7')](_0xb244('0x8'),auth[_0xb244('0x5')](),controller[_0xb244('0x9')]);router['get'](_0xb244('0xa'),auth['isAuthenticated'](),controller[_0xb244('0xb')]);router[_0xb244('0xc')]('/',auth[_0xb244('0x5')](),controller[_0xb244('0xd')]);router[_0xb244('0xc')](_0xb244('0x8'),auth['isAuthenticated'](),controller[_0xb244('0xe')]);router[_0xb244('0xf')](_0xb244('0x10'),auth[_0xb244('0x5')](),controller[_0xb244('0x11')]);router['delete'](_0xb244('0x10'),auth[_0xb244('0x5')](),controller[_0xb244('0x12')]);module[_0xb244('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f07ab4d..9f09340 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 _0x1b1b=['integrationTab','newTab','exports','STRING','ENUM','basic'];(function(_0x5b71a2,_0x541cee){var _0x22e1b6=function(_0x415448){while(--_0x415448){_0x5b71a2['push'](_0x5b71a2['shift']());}};_0x22e1b6(++_0x541cee);}(_0x1b1b,0xe6));var _0xb1b1=function(_0x28ea86,_0x7402c6){_0x28ea86=_0x28ea86-0x0;var _0x25a519=_0x1b1b[_0x28ea86];return _0x25a519;};'use strict';var Sequelize=require('sequelize');module[_0xb1b1('0x0')]={'name':{'type':Sequelize[_0xb1b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb1b1('0x1')]},'remoteUri':{'type':Sequelize[_0xb1b1('0x1')]},'authType':{'type':Sequelize[_0xb1b1('0x2')]('basic'),'defaultValue':_0xb1b1('0x3')},'password':{'type':Sequelize[_0xb1b1('0x1')]},'consumerKey':{'type':Sequelize[_0xb1b1('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xb1b1('0x1')]},'serverUrl':{'type':Sequelize[_0xb1b1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb1b1('0x2')](_0xb1b1('0x4'),_0xb1b1('0x5')),'defaultValue':_0xb1b1('0x4')}}; \ No newline at end of file +var _0x3e96=['sequelize','STRING','ENUM','basic','newTab'];(function(_0x47f47a,_0xdca6ab){var _0x382697=function(_0x4e0d5d){while(--_0x4e0d5d){_0x47f47a['push'](_0x47f47a['shift']());}};_0x382697(++_0xdca6ab);}(_0x3e96,0x64));var _0x63e9=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x3e96[_0x419550];return _0x55f9ef;};'use strict';var Sequelize=require(_0x63e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x63e9('0x1')]},'authType':{'type':Sequelize[_0x63e9('0x2')](_0x63e9('0x3')),'defaultValue':_0x63e9('0x3')},'password':{'type':Sequelize[_0x63e9('0x1')]},'consumerKey':{'type':Sequelize[_0x63e9('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x63e9('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x63e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x63e9('0x2')]('integrationTab',_0x63e9('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3c6636f..3d39aa5 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 _0xbfef=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../components/integrations/configuration','status','offset','undefined','count','json','apply','reject','save','then','destroy','end','name','send','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','getConfigurations','DeskConfiguration','nolimit','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','remoteUri','username','consumerKey','consumerSecret','tokenSecret','slice','lastIndexOf','GET','%s/custom_fields','application/json','authType','headers','Authorization','Basic\x20%s','format','password','toString','base64','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir'];(function(_0x4b3ef1,_0x1dad38){var _0x34d3b4=function(_0x1da4fe){while(--_0x1da4fe){_0x4b3ef1['push'](_0x4b3ef1['shift']());}};_0x34d3b4(++_0x1dad38);}(_0xbfef,0x13e));var _0xfbfe=function(_0x281b7c,_0xc5f6db){_0x281b7c=_0x281b7c-0x0;var _0x3e0577=_0xbfef[_0x281b7c];return _0x3e0577;};'use strict';var emlformat=require(_0xfbfe('0x0'));var rimraf=require(_0xfbfe('0x1'));var zipdir=require(_0xfbfe('0x2'));var jsonpatch=require(_0xfbfe('0x3'));var rp=require(_0xfbfe('0x4'));var moment=require(_0xfbfe('0x5'));var BPromise=require(_0xfbfe('0x6'));var Mustache=require(_0xfbfe('0x7'));var util=require(_0xfbfe('0x8'));var path=require(_0xfbfe('0x9'));var sox=require(_0xfbfe('0xa'));var csv=require(_0xfbfe('0xb'));var ejs=require(_0xfbfe('0xc'));var fs=require('fs');var fs_extra=require(_0xfbfe('0xd'));var _=require(_0xfbfe('0xe'));var squel=require('squel');var crypto=require(_0xfbfe('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfbfe('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfbfe('0x10'));var authService=require(_0xfbfe('0x11'));var qs=require(_0xfbfe('0x12'));var as=require(_0xfbfe('0x13'));var hardwareService=require(_0xfbfe('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfbfe('0x15'));var config=require(_0xfbfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfbfe('0x17'));function respondWithStatusCode(_0x329592,_0x9ca99){_0x9ca99=_0x9ca99||0xcc;return function(_0xc9b4af){if(_0xc9b4af){return _0x329592['sendStatus'](_0x9ca99);}return _0x329592[_0xfbfe('0x18')](_0x9ca99)['end']();};}function respondWithResult(_0x607266,_0xe90397){_0xe90397=_0xe90397||0xc8;return function(_0x4a8907){if(_0x4a8907){return _0x607266['status'](_0xe90397)['json'](_0x4a8907);}};}function respondWithFilteredResult(_0x304c6d,_0x5851f0){return function(_0x61455f){if(_0x61455f){var _0x480db6=typeof _0x5851f0[_0xfbfe('0x19')]==='undefined'&&typeof _0x5851f0['limit']===_0xfbfe('0x1a');var _0x5e67fc=_0x61455f[_0xfbfe('0x1b')];var _0x5a77d3=_0x480db6?0x0:_0x5851f0['offset'];var _0x2cad1a=_0x480db6?_0x61455f[_0xfbfe('0x1b')]:_0x5851f0['offset']+_0x5851f0['limit'];var _0x163dc3;if(_0x2cad1a>=_0x5e67fc){_0x2cad1a=_0x5e67fc;_0x163dc3=0xc8;}else{_0x163dc3=0xce;}_0x304c6d[_0xfbfe('0x18')](_0x163dc3);return _0x304c6d['set']('Content-Range',_0x5a77d3+'-'+_0x2cad1a+'/'+_0x5e67fc)[_0xfbfe('0x1c')](_0x61455f);}return null;};}function patchUpdates(_0x4f3510){return function(_0x3717b1){try{jsonpatch[_0xfbfe('0x1d')](_0x3717b1,_0x4f3510,!![]);}catch(_0x2cc593){return BPromise[_0xfbfe('0x1e')](_0x2cc593);}return _0x3717b1[_0xfbfe('0x1f')]();};}function saveUpdates(_0x158a3e,_0x2b564a){return function(_0x2d64fb){if(_0x2d64fb){return _0x2d64fb['update'](_0x158a3e)[_0xfbfe('0x20')](function(_0x5c53e3){return _0x5c53e3;});}return null;};}function removeEntity(_0x6abdd8,_0x533027){return function(_0x4a1ce0){if(_0x4a1ce0){return _0x4a1ce0[_0xfbfe('0x21')]()['then'](function(){_0x6abdd8[_0xfbfe('0x18')](0xcc)[_0xfbfe('0x22')]();});}};}function handleEntityNotFound(_0x5af887,_0x2d5d63){return function(_0x4af8d9){if(!_0x4af8d9){_0x5af887['sendStatus'](0x194);}return _0x4af8d9;};}function handleError(_0x2ca4ff,_0x55bf34){_0x55bf34=_0x55bf34||0x1f4;return function(_0x6b7e7){logger['error'](_0x6b7e7['stack']);if(_0x6b7e7[_0xfbfe('0x23')]){delete _0x6b7e7[_0xfbfe('0x23')];}_0x2ca4ff[_0xfbfe('0x18')](_0x55bf34)[_0xfbfe('0x24')](_0x6b7e7);};}exports['index']=function(_0x20bd9c,_0x4728f0){var _0x4f1a36={},_0x1ab11f={},_0xd1442={'count':0x0,'rows':[]};var _0x56c920=_['map'](db[_0xfbfe('0x25')][_0xfbfe('0x26')],function(_0x233ae3){return{'name':_0x233ae3[_0xfbfe('0x27')],'type':_0x233ae3[_0xfbfe('0x28')][_0xfbfe('0x29')]};});_0x1ab11f[_0xfbfe('0x2a')]=_[_0xfbfe('0x2b')](_0x56c920,_0xfbfe('0x23'));_0x1ab11f[_0xfbfe('0x2c')]=_[_0xfbfe('0x2d')](_0x20bd9c[_0xfbfe('0x2c')]);_0x1ab11f[_0xfbfe('0x2e')]=_['intersection'](_0x1ab11f[_0xfbfe('0x2a')],_0x1ab11f['query']);_0x4f1a36[_0xfbfe('0x2f')]=_[_0xfbfe('0x30')](_0x1ab11f['model'],qs[_0xfbfe('0x31')](_0x20bd9c[_0xfbfe('0x2c')][_0xfbfe('0x31')]));_0x4f1a36[_0xfbfe('0x2f')]=_0x4f1a36[_0xfbfe('0x2f')][_0xfbfe('0x32')]?_0x4f1a36[_0xfbfe('0x2f')]:_0x1ab11f[_0xfbfe('0x2a')];if(!_0x20bd9c[_0xfbfe('0x2c')][_0xfbfe('0x33')]('nolimit')){_0x4f1a36[_0xfbfe('0x34')]=qs['limit'](_0x20bd9c['query'][_0xfbfe('0x34')]);_0x4f1a36[_0xfbfe('0x19')]=qs[_0xfbfe('0x19')](_0x20bd9c[_0xfbfe('0x2c')][_0xfbfe('0x19')]);}_0x4f1a36[_0xfbfe('0x35')]=qs[_0xfbfe('0x36')](_0x20bd9c[_0xfbfe('0x2c')][_0xfbfe('0x36')]);_0x4f1a36[_0xfbfe('0x37')]=qs[_0xfbfe('0x2e')](_[_0xfbfe('0x38')](_0x20bd9c[_0xfbfe('0x2c')],_0x1ab11f['filters']),_0x56c920);if(_0x20bd9c[_0xfbfe('0x2c')][_0xfbfe('0x39')]){_0x4f1a36[_0xfbfe('0x37')]=_['merge'](_0x4f1a36['where'],{'$or':_[_0xfbfe('0x2b')](_0x56c920,function(_0x44aeb9){if(_0x44aeb9[_0xfbfe('0x28')]!=='VIRTUAL'){var _0x44b907={};_0x44b907[_0x44aeb9[_0xfbfe('0x23')]]={'$like':'%'+_0x20bd9c[_0xfbfe('0x2c')]['filter']+'%'};return _0x44b907;}})});}_0x4f1a36=_[_0xfbfe('0x3a')]({},_0x4f1a36,_0x20bd9c['options']);var _0x12a9b4={'where':_0x4f1a36['where']};return db[_0xfbfe('0x25')][_0xfbfe('0x1b')](_0x12a9b4)[_0xfbfe('0x20')](function(_0x3a38f4){_0xd1442[_0xfbfe('0x1b')]=_0x3a38f4;if(_0x20bd9c['query'][_0xfbfe('0x3b')]){_0x4f1a36[_0xfbfe('0x3c')]=[{'all':!![]}];}return db[_0xfbfe('0x25')][_0xfbfe('0x3d')](_0x4f1a36);})[_0xfbfe('0x20')](function(_0x254b8b){_0xd1442[_0xfbfe('0x3e')]=_0x254b8b;return _0xd1442;})[_0xfbfe('0x20')](respondWithFilteredResult(_0x4728f0,_0x4f1a36))[_0xfbfe('0x3f')](handleError(_0x4728f0,null));};exports[_0xfbfe('0x40')]=function(_0x1fa7d5,_0x349369){var _0x2d9f2f={'raw':![],'where':{'id':_0x1fa7d5[_0xfbfe('0x41')]['id']}},_0x4ff965={};_0x4ff965[_0xfbfe('0x2a')]=_[_0xfbfe('0x2d')](db['DeskAccount']['rawAttributes']);_0x4ff965[_0xfbfe('0x2c')]=_[_0xfbfe('0x2d')](_0x1fa7d5[_0xfbfe('0x2c')]);_0x4ff965[_0xfbfe('0x2e')]=_[_0xfbfe('0x30')](_0x4ff965[_0xfbfe('0x2a')],_0x4ff965[_0xfbfe('0x2c')]);_0x2d9f2f[_0xfbfe('0x2f')]=_[_0xfbfe('0x30')](_0x4ff965[_0xfbfe('0x2a')],qs[_0xfbfe('0x31')](_0x1fa7d5['query']['fields']));_0x2d9f2f[_0xfbfe('0x2f')]=_0x2d9f2f['attributes'][_0xfbfe('0x32')]?_0x2d9f2f[_0xfbfe('0x2f')]:_0x4ff965[_0xfbfe('0x2a')];if(_0x1fa7d5[_0xfbfe('0x2c')][_0xfbfe('0x3b')]){_0x2d9f2f[_0xfbfe('0x3c')]=[{'all':!![]}];}_0x2d9f2f=_[_0xfbfe('0x3a')]({},_0x2d9f2f,_0x1fa7d5[_0xfbfe('0x42')]);return db[_0xfbfe('0x25')][_0xfbfe('0x43')](_0x2d9f2f)[_0xfbfe('0x20')](handleEntityNotFound(_0x349369,null))['then'](respondWithResult(_0x349369,null))['catch'](handleError(_0x349369,null));};exports[_0xfbfe('0x44')]=function(_0x668f1b,_0x4fa77d){return db[_0xfbfe('0x25')]['create'](_0x668f1b[_0xfbfe('0x45')],{})[_0xfbfe('0x20')](respondWithResult(_0x4fa77d,0xc9))[_0xfbfe('0x3f')](handleError(_0x4fa77d,null));};exports[_0xfbfe('0x46')]=function(_0x165351,_0x3a1472){if(_0x165351[_0xfbfe('0x45')]['id']){delete _0x165351[_0xfbfe('0x45')]['id'];}return db[_0xfbfe('0x25')][_0xfbfe('0x43')]({'where':{'id':_0x165351[_0xfbfe('0x41')]['id']}})[_0xfbfe('0x20')](handleEntityNotFound(_0x3a1472,null))[_0xfbfe('0x20')](saveUpdates(_0x165351[_0xfbfe('0x45')],null))[_0xfbfe('0x20')](respondWithResult(_0x3a1472,null))[_0xfbfe('0x3f')](handleError(_0x3a1472,null));};exports[_0xfbfe('0x21')]=function(_0x3b608a,_0x2c1ebb){return db[_0xfbfe('0x25')][_0xfbfe('0x43')]({'where':{'id':_0x3b608a[_0xfbfe('0x41')]['id']}})[_0xfbfe('0x20')](handleEntityNotFound(_0x2c1ebb,null))[_0xfbfe('0x20')](removeEntity(_0x2c1ebb,null))[_0xfbfe('0x3f')](handleError(_0x2c1ebb,null));};exports[_0xfbfe('0x47')]=function(_0x124133,_0x261c9f,_0x223378){var _0x3f3416={};var _0x6651ef={};var _0x4b8cdc;var _0x56793b;return db[_0xfbfe('0x25')]['findOne']({'where':{'id':_0x124133[_0xfbfe('0x41')]['id']}})[_0xfbfe('0x20')](handleEntityNotFound(_0x261c9f,null))[_0xfbfe('0x20')](function(_0x3870b1){if(_0x3870b1){_0x4b8cdc=_0x3870b1;_0x6651ef[_0xfbfe('0x2a')]=_[_0xfbfe('0x2d')](db[_0xfbfe('0x48')]['rawAttributes']);_0x6651ef['query']=_[_0xfbfe('0x2d')](_0x124133[_0xfbfe('0x2c')]);_0x6651ef[_0xfbfe('0x2e')]=_[_0xfbfe('0x30')](_0x6651ef[_0xfbfe('0x2a')],_0x6651ef['query']);_0x3f3416[_0xfbfe('0x2f')]=_[_0xfbfe('0x30')](_0x6651ef[_0xfbfe('0x2a')],qs[_0xfbfe('0x31')](_0x124133[_0xfbfe('0x2c')]['fields']));_0x3f3416[_0xfbfe('0x2f')]=_0x3f3416[_0xfbfe('0x2f')][_0xfbfe('0x32')]?_0x3f3416['attributes']:_0x6651ef[_0xfbfe('0x2a')];_0x3f3416[_0xfbfe('0x35')]=qs[_0xfbfe('0x36')](_0x124133[_0xfbfe('0x2c')]['sort']);_0x3f3416['where']=qs[_0xfbfe('0x2e')](_[_0xfbfe('0x38')](_0x124133[_0xfbfe('0x2c')],_0x6651ef[_0xfbfe('0x2e')]));if(_0x124133['query']['filter']){_0x3f3416[_0xfbfe('0x37')]=_[_0xfbfe('0x3a')](_0x3f3416['where'],{'$or':_[_0xfbfe('0x2b')](_0x3f3416[_0xfbfe('0x2f')],function(_0x131969){var _0x4c7add={};_0x4c7add[_0x131969]={'$like':'%'+_0x124133[_0xfbfe('0x2c')][_0xfbfe('0x39')]+'%'};return _0x4c7add;})});}_0x3f3416=_[_0xfbfe('0x3a')]({},_0x3f3416,_0x124133[_0xfbfe('0x42')]);return _0x4b8cdc[_0xfbfe('0x47')](_0x3f3416);}})[_0xfbfe('0x20')](function(_0x29e261){if(_0x29e261){_0x56793b=_0x29e261[_0xfbfe('0x32')];if(!_0x124133[_0xfbfe('0x2c')][_0xfbfe('0x33')](_0xfbfe('0x49'))){_0x3f3416[_0xfbfe('0x34')]=qs['limit'](_0x124133['query'][_0xfbfe('0x34')]);_0x3f3416['offset']=qs[_0xfbfe('0x19')](_0x124133[_0xfbfe('0x2c')]['offset']);}return _0x4b8cdc['getConfigurations'](_0x3f3416);}})[_0xfbfe('0x20')](function(_0x42de5c){if(_0x42de5c){return _0x42de5c?{'count':_0x56793b,'rows':_0x42de5c}:null;}})['then'](respondWithResult(_0x261c9f,null))[_0xfbfe('0x3f')](handleError(_0x261c9f,null));};exports['addConfiguration']=function(_0x3bbe25,_0x427656,_0x3ae2d0){if(_0x3bbe25[_0xfbfe('0x45')]['id']){delete _0x3bbe25[_0xfbfe('0x45')]['id'];}return db[_0xfbfe('0x25')][_0xfbfe('0x4a')]({'where':{'id':_0x3bbe25[_0xfbfe('0x41')]['id']}})[_0xfbfe('0x20')](handleEntityNotFound(_0x427656,null))[_0xfbfe('0x20')](function(_0x348a8a){if(_0x348a8a){_0x3bbe25[_0xfbfe('0x45')][_0xfbfe('0x4b')]=_0x348a8a['id'];_0x3bbe25[_0xfbfe('0x45')][_0xfbfe('0x4c')]=integrations[_0xfbfe('0x4d')](_0x3bbe25[_0xfbfe('0x45')][_0xfbfe('0x4e')],_0x3bbe25['body']['type']);_0x3bbe25[_0xfbfe('0x45')]['Descriptions']=integrations[_0xfbfe('0x4f')](_0x3bbe25[_0xfbfe('0x45')][_0xfbfe('0x4e')],_0x3bbe25[_0xfbfe('0x45')][_0xfbfe('0x28')]);return db['DeskConfiguration'][_0xfbfe('0x44')](_0x3bbe25['body'],{'include':[{'model':db[_0xfbfe('0x50')],'as':_0xfbfe('0x4c')},{'model':db[_0xfbfe('0x50')],'as':_0xfbfe('0x51')}]});}return null;})[_0xfbfe('0x20')](respondWithResult(_0x427656,null))[_0xfbfe('0x3f')](handleError(_0x427656,null));};exports['getFields']=function(_0x3dfc0a,_0x3d09b2,_0x13a9fd){var _0x594a9a=[{'name':_0xfbfe('0x52'),'label':_0xfbfe('0x52'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2cffa8='';return db[_0xfbfe('0x25')]['findOne']({'where':{'id':_0x3dfc0a[_0xfbfe('0x41')]['id']},'attributes':['id',_0xfbfe('0x53'),'authType',_0xfbfe('0x54'),'password',_0xfbfe('0x55'),_0xfbfe('0x56'),'token',_0xfbfe('0x57')]})[_0xfbfe('0x20')](handleEntityNotFound(_0x3d09b2,null))[_0xfbfe('0x20')](function(_0x3dc128){if(_0x3dc128){_0x2cffa8=_0x3dc128[_0xfbfe('0x53')];var _0x2d314f=_0x2cffa8[_0xfbfe('0x58')](-0x1);if(_0x2d314f==='/'){_0x2cffa8=_0x2cffa8['substring'](0x0,_0x2cffa8[_0xfbfe('0x59')](_0x2d314f));}var _0x46560a={'method':_0xfbfe('0x5a'),'uri':util['format'](_0xfbfe('0x5b'),_0x2cffa8),'headers':{'Content-Type':_0xfbfe('0x5c'),'Accept':_0xfbfe('0x5c')},'json':!![]};if(_0x3dc128[_0xfbfe('0x5d')]==='basic'){_0x46560a[_0xfbfe('0x5e')][_0xfbfe('0x5f')]=util['format'](_0xfbfe('0x60'),new Buffer(util[_0xfbfe('0x61')]('%s:%s',_0x3dc128[_0xfbfe('0x54')],_0x3dc128[_0xfbfe('0x62')]))[_0xfbfe('0x63')](_0xfbfe('0x64')));}return rp(_0x46560a)[_0xfbfe('0x20')](function(_0x12d2c5){return _0x594a9a['concat'](_[_0xfbfe('0x2b')](_0x12d2c5['_embedded']['entries'],function(_0x2c1ed1){return{'id':_0x2c1ed1['name'],'name':_0x2c1ed1[_0xfbfe('0x23')],'type':_0x2c1ed1[_0xfbfe('0x28')],'active':_0x2c1ed1['active'],'label':_0x2c1ed1[_0xfbfe('0x65')],'custom':!![]};}));});}})[_0xfbfe('0x20')](function(_0x344f91){return{'count':_0x344f91[_0xfbfe('0x32')],'rows':_0x344f91};})[_0xfbfe('0x20')](respondWithResult(_0x3d09b2,null))[_0xfbfe('0x3f')](function(_0x26383a){var _0x188661=_0x3dfc0a[_0xfbfe('0x2c')][_0xfbfe('0x66')]?0x1f4:_0x26383a[_0xfbfe('0x67')]||0x1f4;logger[_0xfbfe('0x68')](_0xfbfe('0x69'),'getFields',_0x188661,JSON[_0xfbfe('0x6a')](_0x26383a));delete _0x26383a[_0xfbfe('0x23')];if(_0x188661===0x191){_0x188661=0x190;}_0x3d09b2['status'](_0x188661)['send'](_0x3dfc0a[_0xfbfe('0x2c')][_0xfbfe('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x26383a[_0xfbfe('0x67')]}:_0x26383a);});}; \ No newline at end of file +var _0xac26=['attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','DeskField','priority','remoteUri','authType','username','password','token','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','statusCode','error','stringify','send','test','Wrong\x20credentials','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','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','../../components/integrations/configuration','sendStatus','json','limit','undefined','count','offset','status','Content-Range','apply','reject','then','destroy','end','stack','name','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac26,0x1f0));var _0x6ac2=function(_0x18316e,_0xa84b48){_0x18316e=_0x18316e-0x0;var _0x3be979=_0xac26[_0x18316e];return _0x3be979;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ac2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ac2('0x1'));var moment=require(_0x6ac2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6ac2('0x3'));var util=require(_0x6ac2('0x4'));var path=require(_0x6ac2('0x5'));var sox=require(_0x6ac2('0x6'));var csv=require('to-csv');var ejs=require(_0x6ac2('0x7'));var fs=require('fs');var fs_extra=require(_0x6ac2('0x8'));var _=require('lodash');var squel=require(_0x6ac2('0x9'));var crypto=require('crypto');var jsforce=require(_0x6ac2('0xa'));var deskjs=require(_0x6ac2('0xb'));var toCsv=require(_0x6ac2('0xc'));var querystring=require(_0x6ac2('0xd'));var Papa=require(_0x6ac2('0xe'));var Redis=require(_0x6ac2('0xf'));var authService=require(_0x6ac2('0x10'));var qs=require(_0x6ac2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ac2('0x12'));var logger=require(_0x6ac2('0x13'))(_0x6ac2('0x14'));var utils=require(_0x6ac2('0x15'));var config=require(_0x6ac2('0x16'));var licenseUtil=require(_0x6ac2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6ac2('0x18'));function respondWithStatusCode(_0x3a0b0c,_0x2eb14c){_0x2eb14c=_0x2eb14c||0xcc;return function(_0x4cc73e){if(_0x4cc73e){return _0x3a0b0c[_0x6ac2('0x19')](_0x2eb14c);}return _0x3a0b0c['status'](_0x2eb14c)['end']();};}function respondWithResult(_0x4abf12,_0x2e268e){_0x2e268e=_0x2e268e||0xc8;return function(_0x3fc1e9){if(_0x3fc1e9){return _0x4abf12['status'](_0x2e268e)[_0x6ac2('0x1a')](_0x3fc1e9);}};}function respondWithFilteredResult(_0x46b8c6,_0x13c983){return function(_0x5dab5e){if(_0x5dab5e){var _0x332116=typeof _0x13c983['offset']==='undefined'&&typeof _0x13c983[_0x6ac2('0x1b')]===_0x6ac2('0x1c');var _0x310fc2=_0x5dab5e[_0x6ac2('0x1d')];var _0x347240=_0x332116?0x0:_0x13c983[_0x6ac2('0x1e')];var _0x51c496=_0x332116?_0x5dab5e['count']:_0x13c983[_0x6ac2('0x1e')]+_0x13c983[_0x6ac2('0x1b')];var _0x567bab;if(_0x51c496>=_0x310fc2){_0x51c496=_0x310fc2;_0x567bab=0xc8;}else{_0x567bab=0xce;}_0x46b8c6[_0x6ac2('0x1f')](_0x567bab);return _0x46b8c6['set'](_0x6ac2('0x20'),_0x347240+'-'+_0x51c496+'/'+_0x310fc2)['json'](_0x5dab5e);}return null;};}function patchUpdates(_0x443fc2){return function(_0x30bfd1){try{jsonpatch[_0x6ac2('0x21')](_0x30bfd1,_0x443fc2,!![]);}catch(_0x10577d){return BPromise[_0x6ac2('0x22')](_0x10577d);}return _0x30bfd1['save']();};}function saveUpdates(_0x124c3a,_0x2f559b){return function(_0x18db6f){if(_0x18db6f){return _0x18db6f['update'](_0x124c3a)[_0x6ac2('0x23')](function(_0xf4cc42){return _0xf4cc42;});}return null;};}function removeEntity(_0x4b0e45,_0x578576){return function(_0x497595){if(_0x497595){return _0x497595[_0x6ac2('0x24')]()[_0x6ac2('0x23')](function(){_0x4b0e45[_0x6ac2('0x1f')](0xcc)[_0x6ac2('0x25')]();});}};}function handleEntityNotFound(_0x21e514,_0x1f2894){return function(_0x483903){if(!_0x483903){_0x21e514[_0x6ac2('0x19')](0x194);}return _0x483903;};}function handleError(_0x5d78bb,_0x1212aa){_0x1212aa=_0x1212aa||0x1f4;return function(_0x3a7723){logger['error'](_0x3a7723[_0x6ac2('0x26')]);if(_0x3a7723[_0x6ac2('0x27')]){delete _0x3a7723[_0x6ac2('0x27')];}_0x5d78bb[_0x6ac2('0x1f')](_0x1212aa)['send'](_0x3a7723);};}exports['index']=function(_0x254ba8,_0x5c0c5e){var _0x297208={},_0x5c1f8e={},_0xcd59fa={'count':0x0,'rows':[]};var _0x19135b=_[_0x6ac2('0x28')](db[_0x6ac2('0x29')][_0x6ac2('0x2a')],function(_0x374d0c){return{'name':_0x374d0c[_0x6ac2('0x2b')],'type':_0x374d0c['type'][_0x6ac2('0x2c')]};});_0x5c1f8e[_0x6ac2('0x2d')]=_['map'](_0x19135b,'name');_0x5c1f8e[_0x6ac2('0x2e')]=_[_0x6ac2('0x2f')](_0x254ba8['query']);_0x5c1f8e['filters']=_[_0x6ac2('0x30')](_0x5c1f8e[_0x6ac2('0x2d')],_0x5c1f8e['query']);_0x297208[_0x6ac2('0x31')]=_[_0x6ac2('0x30')](_0x5c1f8e[_0x6ac2('0x2d')],qs['fields'](_0x254ba8[_0x6ac2('0x2e')]['fields']));_0x297208[_0x6ac2('0x31')]=_0x297208['attributes'][_0x6ac2('0x32')]?_0x297208['attributes']:_0x5c1f8e[_0x6ac2('0x2d')];if(!_0x254ba8['query']['hasOwnProperty'](_0x6ac2('0x33'))){_0x297208[_0x6ac2('0x1b')]=qs['limit'](_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x1b')]);_0x297208[_0x6ac2('0x1e')]=qs[_0x6ac2('0x1e')](_0x254ba8[_0x6ac2('0x2e')]['offset']);}_0x297208['order']=qs[_0x6ac2('0x34')](_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x34')]);_0x297208[_0x6ac2('0x35')]=qs['filters'](_['pick'](_0x254ba8['query'],_0x5c1f8e[_0x6ac2('0x36')]),_0x19135b);if(_0x254ba8[_0x6ac2('0x2e')]['filter']){_0x297208[_0x6ac2('0x35')]=_[_0x6ac2('0x37')](_0x297208[_0x6ac2('0x35')],{'$or':_[_0x6ac2('0x28')](_0x19135b,function(_0x487fa7){if(_0x487fa7['type']!==_0x6ac2('0x38')){var _0x1e6c6f={};_0x1e6c6f[_0x487fa7[_0x6ac2('0x27')]]={'$like':'%'+_0x254ba8['query'][_0x6ac2('0x39')]+'%'};return _0x1e6c6f;}})});}_0x297208=_[_0x6ac2('0x37')]({},_0x297208,_0x254ba8[_0x6ac2('0x3a')]);var _0x384aa7={'where':_0x297208[_0x6ac2('0x35')]};return db[_0x6ac2('0x29')][_0x6ac2('0x1d')](_0x384aa7)[_0x6ac2('0x23')](function(_0x48b4f9){_0xcd59fa[_0x6ac2('0x1d')]=_0x48b4f9;if(_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x3b')]){_0x297208[_0x6ac2('0x3c')]=[{'all':!![]}];}return db[_0x6ac2('0x29')][_0x6ac2('0x3d')](_0x297208);})['then'](function(_0x23a66d){_0xcd59fa[_0x6ac2('0x3e')]=_0x23a66d;return _0xcd59fa;})['then'](respondWithFilteredResult(_0x5c0c5e,_0x297208))[_0x6ac2('0x3f')](handleError(_0x5c0c5e,null));};exports['show']=function(_0xc6366,_0x168036){var _0x174932={'raw':![],'where':{'id':_0xc6366[_0x6ac2('0x40')]['id']}},_0x170a8d={};_0x170a8d[_0x6ac2('0x2d')]=_['keys'](db[_0x6ac2('0x29')][_0x6ac2('0x2a')]);_0x170a8d[_0x6ac2('0x2e')]=_['keys'](_0xc6366[_0x6ac2('0x2e')]);_0x170a8d[_0x6ac2('0x36')]=_[_0x6ac2('0x30')](_0x170a8d[_0x6ac2('0x2d')],_0x170a8d['query']);_0x174932[_0x6ac2('0x31')]=_['intersection'](_0x170a8d[_0x6ac2('0x2d')],qs[_0x6ac2('0x41')](_0xc6366[_0x6ac2('0x2e')][_0x6ac2('0x41')]));_0x174932[_0x6ac2('0x31')]=_0x174932[_0x6ac2('0x31')][_0x6ac2('0x32')]?_0x174932[_0x6ac2('0x31')]:_0x170a8d['model'];if(_0xc6366[_0x6ac2('0x2e')][_0x6ac2('0x3b')]){_0x174932[_0x6ac2('0x3c')]=[{'all':!![]}];}_0x174932=_[_0x6ac2('0x37')]({},_0x174932,_0xc6366[_0x6ac2('0x3a')]);return db[_0x6ac2('0x29')][_0x6ac2('0x42')](_0x174932)[_0x6ac2('0x23')](handleEntityNotFound(_0x168036,null))[_0x6ac2('0x23')](respondWithResult(_0x168036,null))[_0x6ac2('0x3f')](handleError(_0x168036,null));};exports[_0x6ac2('0x43')]=function(_0xb33c7e,_0x4d5dca){return db[_0x6ac2('0x29')]['create'](_0xb33c7e[_0x6ac2('0x44')],{})[_0x6ac2('0x23')](respondWithResult(_0x4d5dca,0xc9))[_0x6ac2('0x3f')](handleError(_0x4d5dca,null));};exports['update']=function(_0x4063f9,_0xb49f32){if(_0x4063f9[_0x6ac2('0x44')]['id']){delete _0x4063f9[_0x6ac2('0x44')]['id'];}return db[_0x6ac2('0x29')]['find']({'where':{'id':_0x4063f9[_0x6ac2('0x40')]['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0xb49f32,null))[_0x6ac2('0x23')](saveUpdates(_0x4063f9[_0x6ac2('0x44')],null))['then'](respondWithResult(_0xb49f32,null))[_0x6ac2('0x3f')](handleError(_0xb49f32,null));};exports[_0x6ac2('0x24')]=function(_0x1e6b12,_0x21f426){return db['DeskAccount'][_0x6ac2('0x42')]({'where':{'id':_0x1e6b12['params']['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x21f426,null))[_0x6ac2('0x23')](removeEntity(_0x21f426,null))['catch'](handleError(_0x21f426,null));};exports[_0x6ac2('0x45')]=function(_0x875a25,_0x231bbd,_0x3e42cb){var _0x2214af={};var _0x2cb6bd={};var _0x4df512;var _0x5d6b6c;return db['DeskAccount'][_0x6ac2('0x46')]({'where':{'id':_0x875a25['params']['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x231bbd,null))[_0x6ac2('0x23')](function(_0x594b93){if(_0x594b93){_0x4df512=_0x594b93;_0x2cb6bd['model']=_['keys'](db['DeskConfiguration'][_0x6ac2('0x2a')]);_0x2cb6bd[_0x6ac2('0x2e')]=_[_0x6ac2('0x2f')](_0x875a25[_0x6ac2('0x2e')]);_0x2cb6bd[_0x6ac2('0x36')]=_[_0x6ac2('0x30')](_0x2cb6bd[_0x6ac2('0x2d')],_0x2cb6bd[_0x6ac2('0x2e')]);_0x2214af[_0x6ac2('0x31')]=_[_0x6ac2('0x30')](_0x2cb6bd[_0x6ac2('0x2d')],qs[_0x6ac2('0x41')](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x41')]));_0x2214af[_0x6ac2('0x31')]=_0x2214af[_0x6ac2('0x31')][_0x6ac2('0x32')]?_0x2214af[_0x6ac2('0x31')]:_0x2cb6bd[_0x6ac2('0x2d')];_0x2214af[_0x6ac2('0x47')]=qs['sort'](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x34')]);_0x2214af[_0x6ac2('0x35')]=qs[_0x6ac2('0x36')](_[_0x6ac2('0x48')](_0x875a25[_0x6ac2('0x2e')],_0x2cb6bd[_0x6ac2('0x36')]));if(_0x875a25[_0x6ac2('0x2e')]['filter']){_0x2214af['where']=_[_0x6ac2('0x37')](_0x2214af['where'],{'$or':_['map'](_0x2214af['attributes'],function(_0x5b288e){var _0x2cb239={};_0x2cb239[_0x5b288e]={'$like':'%'+_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x39')]+'%'};return _0x2cb239;})});}_0x2214af=_[_0x6ac2('0x37')]({},_0x2214af,_0x875a25[_0x6ac2('0x3a')]);return _0x4df512[_0x6ac2('0x45')](_0x2214af);}})[_0x6ac2('0x23')](function(_0x583a7a){if(_0x583a7a){_0x5d6b6c=_0x583a7a['length'];if(!_0x875a25[_0x6ac2('0x2e')]['hasOwnProperty']('nolimit')){_0x2214af[_0x6ac2('0x1b')]=qs[_0x6ac2('0x1b')](_0x875a25[_0x6ac2('0x2e')]['limit']);_0x2214af[_0x6ac2('0x1e')]=qs[_0x6ac2('0x1e')](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x1e')]);}return _0x4df512[_0x6ac2('0x45')](_0x2214af);}})[_0x6ac2('0x23')](function(_0x25262a){if(_0x25262a){return _0x25262a?{'count':_0x5d6b6c,'rows':_0x25262a}:null;}})[_0x6ac2('0x23')](respondWithResult(_0x231bbd,null))[_0x6ac2('0x3f')](handleError(_0x231bbd,null));};exports[_0x6ac2('0x49')]=function(_0x5c8044,_0x4a954f,_0x12dbe){if(_0x5c8044[_0x6ac2('0x44')]['id']){delete _0x5c8044[_0x6ac2('0x44')]['id'];}return db[_0x6ac2('0x29')][_0x6ac2('0x46')]({'where':{'id':_0x5c8044[_0x6ac2('0x40')]['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x4a954f,null))[_0x6ac2('0x23')](function(_0x329a5b){if(_0x329a5b){_0x5c8044['body'][_0x6ac2('0x4a')]=_0x329a5b['id'];_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4b')]=integrations[_0x6ac2('0x4c')](_0x5c8044[_0x6ac2('0x44')]['channel'],_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4d')]);_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4e')]=integrations[_0x6ac2('0x4f')](_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x50')],_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4d')]);return db['DeskConfiguration'][_0x6ac2('0x43')](_0x5c8044['body'],{'include':[{'model':db[_0x6ac2('0x51')],'as':_0x6ac2('0x4b')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4a954f,null))['catch'](handleError(_0x4a954f,null));};exports['getFields']=function(_0x3be5ff,_0x417f85,_0xcfabde){var _0x24deee=[{'name':_0x6ac2('0x52'),'label':_0x6ac2('0x52'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x571e4c='';return db['DeskAccount']['findOne']({'where':{'id':_0x3be5ff[_0x6ac2('0x40')]['id']},'attributes':['id',_0x6ac2('0x53'),_0x6ac2('0x54'),_0x6ac2('0x55'),_0x6ac2('0x56'),'consumerKey','consumerSecret',_0x6ac2('0x57'),'tokenSecret']})[_0x6ac2('0x23')](handleEntityNotFound(_0x417f85,null))[_0x6ac2('0x23')](function(_0x36f742){if(_0x36f742){_0x571e4c=_0x36f742[_0x6ac2('0x53')];var _0x3afbc7=_0x571e4c['slice'](-0x1);if(_0x3afbc7==='/'){_0x571e4c=_0x571e4c[_0x6ac2('0x58')](0x0,_0x571e4c[_0x6ac2('0x59')](_0x3afbc7));}var _0x4960d0={'method':'GET','uri':util[_0x6ac2('0x5a')](_0x6ac2('0x5b'),_0x571e4c),'headers':{'Content-Type':_0x6ac2('0x5c'),'Accept':_0x6ac2('0x5c')},'json':!![]};if(_0x36f742[_0x6ac2('0x54')]===_0x6ac2('0x5d')){_0x4960d0[_0x6ac2('0x5e')]['Authorization']=util[_0x6ac2('0x5a')](_0x6ac2('0x5f'),new Buffer(util[_0x6ac2('0x5a')](_0x6ac2('0x60'),_0x36f742[_0x6ac2('0x55')],_0x36f742['password']))[_0x6ac2('0x61')](_0x6ac2('0x62')));}return rp(_0x4960d0)[_0x6ac2('0x23')](function(_0xebb803){return _0x24deee[_0x6ac2('0x63')](_[_0x6ac2('0x28')](_0xebb803[_0x6ac2('0x64')]['entries'],function(_0xb9fec5){return{'id':_0xb9fec5[_0x6ac2('0x27')],'name':_0xb9fec5[_0x6ac2('0x27')],'type':_0xb9fec5[_0x6ac2('0x4d')],'active':_0xb9fec5[_0x6ac2('0x65')],'label':_0xb9fec5[_0x6ac2('0x66')],'custom':!![]};}));});}})[_0x6ac2('0x23')](function(_0x4530b5){return{'count':_0x4530b5[_0x6ac2('0x32')],'rows':_0x4530b5};})[_0x6ac2('0x23')](respondWithResult(_0x417f85,null))[_0x6ac2('0x3f')](function(_0x31e49a){var _0x515870=_0x3be5ff['query']['test']?0x1f4:_0x31e49a[_0x6ac2('0x67')]||0x1f4;logger[_0x6ac2('0x68')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x515870,JSON[_0x6ac2('0x69')](_0x31e49a));delete _0x31e49a[_0x6ac2('0x27')];if(_0x515870===0x191){_0x515870=0x190;}_0x417f85[_0x6ac2('0x1f')](_0x515870)[_0x6ac2('0x6a')](_0x3be5ff[_0x6ac2('0x2e')][_0x6ac2('0x6b')]?{'message':_0x6ac2('0x6c'),'statusCode':_0x31e49a[_0x6ac2('0x67')]}:_0x31e49a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c542eb0..3bf5311 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 _0x90dc=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0x2cfd6f,_0xa7a373){var _0x2b1e12=function(_0x47b4dd){while(--_0x47b4dd){_0x2cfd6f['push'](_0x2cfd6f['shift']());}};_0x2b1e12(++_0xa7a373);}(_0x90dc,0xb4));var _0xc90d=function(_0x1e6c05,_0x2a098f){_0x1e6c05=_0x1e6c05-0x0;var _0x478840=_0x90dc[_0x1e6c05];return _0x478840;};'use strict';var _=require(_0xc90d('0x0'));var util=require(_0xc90d('0x1'));var logger=require(_0xc90d('0x2'))('api');var moment=require(_0xc90d('0x3'));var BPromise=require(_0xc90d('0x4'));var rp=require(_0xc90d('0x5'));var fs=require('fs');var path=require(_0xc90d('0x6'));var rimraf=require('rimraf');var config=require(_0xc90d('0x7'));var attributes=require(_0xc90d('0x8'));var integrations=require(_0xc90d('0x9'));module[_0xc90d('0xa')]=function(_0x3f25c1,_0x501fc5){return _0x3f25c1[_0xc90d('0xb')]('DeskAccount',attributes,{'tableName':_0xc90d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcd0=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','int_desk_accounts','api','moment'];(function(_0x16bb8e,_0x4f2d87){var _0x55b01a=function(_0x243a21){while(--_0x243a21){_0x16bb8e['push'](_0x16bb8e['shift']());}};_0x55b01a(++_0x4f2d87);}(_0xbcd0,0xf0));var _0x0bcd=function(_0x5b1bb7,_0x15748c){_0x5b1bb7=_0x5b1bb7-0x0;var _0x4f3b78=_0xbcd0[_0x5b1bb7];return _0x4f3b78;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0bcd('0x0'));var moment=require(_0x0bcd('0x1'));var BPromise=require(_0x0bcd('0x2'));var rp=require(_0x0bcd('0x3'));var fs=require('fs');var path=require(_0x0bcd('0x4'));var rimraf=require(_0x0bcd('0x5'));var config=require(_0x0bcd('0x6'));var attributes=require(_0x0bcd('0x7'));var integrations=require(_0x0bcd('0x8'));module['exports']=function(_0x1f3520,_0x589c24){return _0x1f3520[_0x0bcd('0x9')]('DeskAccount',attributes,{'tableName':_0x0bcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index d5eba57..e16623f 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 _0x69fb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','DeskAccount,\x20%s,\x20%s','GetDeskAccount','raw','options','attributes','map','model','include','catch','ShowDeskAccount','DeskAccount','find','lodash','util'];(function(_0x527fb4,_0xc15f2e){var _0x4d50cd=function(_0xb9ecaa){while(--_0xb9ecaa){_0x527fb4['push'](_0x527fb4['shift']());}};_0x4d50cd(++_0xc15f2e);}(_0x69fb,0x99));var _0xb69f=function(_0x1a6bde,_0x3e8809){_0x1a6bde=_0x1a6bde-0x0;var _0x490911=_0x69fb[_0x1a6bde];return _0x490911;};'use strict';var _=require(_0xb69f('0x0'));var util=require(_0xb69f('0x1'));var moment=require('moment');var BPromise=require(_0xb69f('0x2'));var rs=require(_0xb69f('0x3'));var fs=require('fs');var Redis=require(_0xb69f('0x4'));var db=require(_0xb69f('0x5'))['db'];var utils=require(_0xb69f('0x6'));var logger=require(_0xb69f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb69f('0x8'));var client=jayson[_0xb69f('0x9')][_0xb69f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f478,_0x373db2,_0x568329){return new BPromise(function(_0xd5646f,_0x5a6909){return client[_0xb69f('0xb')](_0x24f478,_0x568329)[_0xb69f('0xc')](function(_0x1b6a84){logger[_0xb69f('0xd')]('DeskAccount,\x20%s,\x20%s',_0x373db2,_0xb69f('0xe'));logger[_0xb69f('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x373db2,'request\x20sent',JSON[_0xb69f('0x10')](_0x1b6a84));if(_0x1b6a84['error']){if(_0x1b6a84[_0xb69f('0x11')]['code']===0x1f4){logger[_0xb69f('0x11')]('DeskAccount,\x20%s,\x20%s',_0x373db2,_0x1b6a84[_0xb69f('0x11')][_0xb69f('0x12')]);return _0x5a6909(_0x1b6a84[_0xb69f('0x11')][_0xb69f('0x12')]);}logger[_0xb69f('0x11')]('DeskAccount,\x20%s,\x20%s',_0x373db2,_0x1b6a84[_0xb69f('0x11')][_0xb69f('0x12')]);return _0xd5646f(_0x1b6a84[_0xb69f('0x11')][_0xb69f('0x12')]);}else{logger[_0xb69f('0xd')]('DeskAccount,\x20%s,\x20%s',_0x373db2,_0xb69f('0xe'));_0xd5646f(_0x1b6a84['result'][_0xb69f('0x12')]);}})['catch'](function(_0x2984b0){logger[_0xb69f('0x11')](_0xb69f('0x13'),_0x373db2,_0x2984b0);_0x5a6909(_0x2984b0);});});}exports[_0xb69f('0x14')]=function(_0x850769){var _0x3ef97c=this;return new Promise(function(_0x27c48a,_0x4ec61b){return db['DeskAccount']['findAll']({'raw':_0x850769['options']?_0x850769['options'][_0xb69f('0x15')]===undefined?!![]:![]:!![],'where':_0x850769['options']?_0x850769[_0xb69f('0x16')]['where']||null:null,'attributes':_0x850769['options']?_0x850769[_0xb69f('0x16')][_0xb69f('0x17')]||null:null,'limit':_0x850769[_0xb69f('0x16')]?_0x850769['options']['limit']||null:null,'include':_0x850769[_0xb69f('0x16')]?_0x850769['options']['include']?_[_0xb69f('0x18')](_0x850769['options']['include'],function(_0x3405ad){return{'model':db[_0x3405ad[_0xb69f('0x19')]],'as':_0x3405ad['as'],'attributes':_0x3405ad['attributes'],'include':_0x3405ad[_0xb69f('0x1a')]?_['map'](_0x3405ad[_0xb69f('0x1a')],function(_0x544561){return{'model':db[_0x544561['model']],'as':_0x544561['as'],'attributes':_0x544561['attributes'],'include':_0x544561[_0xb69f('0x1a')]?_['map'](_0x544561['include'],function(_0x1ba39e){return{'model':db[_0x1ba39e['model']],'as':_0x1ba39e['as'],'attributes':_0x1ba39e[_0xb69f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb69f('0xc')](function(_0x3a7090){logger['info'](_0xb69f('0x14'),_0x850769);logger[_0xb69f('0xf')](_0xb69f('0x14'),_0x850769,JSON[_0xb69f('0x10')](_0x3a7090));_0x27c48a(_0x3a7090);})[_0xb69f('0x1b')](function(_0x364fe0){logger['error'](_0xb69f('0x14'),_0x364fe0[_0xb69f('0x12')],_0x850769);_0x4ec61b(_0x3ef97c['error'](0x1f4,_0x364fe0[_0xb69f('0x12')]));});});};exports[_0xb69f('0x1c')]=function(_0x39379c){var _0x3692e8=this;return new Promise(function(_0x43fe0b,_0x470fad){return db[_0xb69f('0x1d')][_0xb69f('0x1e')]({'raw':_0x39379c[_0xb69f('0x16')]?_0x39379c[_0xb69f('0x16')][_0xb69f('0x15')]===undefined?!![]:![]:!![],'where':_0x39379c[_0xb69f('0x16')]?_0x39379c[_0xb69f('0x16')]['where']||null:null,'attributes':_0x39379c[_0xb69f('0x16')]?_0x39379c[_0xb69f('0x16')][_0xb69f('0x17')]||null:null,'include':_0x39379c[_0xb69f('0x16')]?_0x39379c[_0xb69f('0x16')][_0xb69f('0x1a')]?_[_0xb69f('0x18')](_0x39379c[_0xb69f('0x16')][_0xb69f('0x1a')],function(_0x3969c7){return{'model':db[_0x3969c7[_0xb69f('0x19')]],'as':_0x3969c7['as'],'attributes':_0x3969c7[_0xb69f('0x17')],'include':_0x3969c7[_0xb69f('0x1a')]?_[_0xb69f('0x18')](_0x3969c7['include'],function(_0x4542b7){return{'model':db[_0x4542b7[_0xb69f('0x19')]],'as':_0x4542b7['as'],'attributes':_0x4542b7['attributes'],'include':_0x4542b7[_0xb69f('0x1a')]?_[_0xb69f('0x18')](_0x4542b7['include'],function(_0x450585){return{'model':db[_0x450585['model']],'as':_0x450585['as'],'attributes':_0x450585[_0xb69f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb69f('0xc')](function(_0x197d00){logger[_0xb69f('0xd')](_0xb69f('0x1c'),_0x39379c);logger['debug']('ShowDeskAccount',_0x39379c,JSON['stringify'](_0x197d00));_0x43fe0b(_0x197d00);})[_0xb69f('0x1b')](function(_0x5bb255){logger['error'](_0xb69f('0x1c'),_0x5bb255[_0xb69f('0x12')],_0x39379c);_0x470fad(_0x3692e8['error'](0x1f4,_0x5bb255['message']));});});}; \ No newline at end of file +var _0x02f6=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','DeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1730dd,_0x3cacb2){var _0x15a53c=function(_0x470500){while(--_0x470500){_0x1730dd['push'](_0x1730dd['shift']());}};_0x15a53c(++_0x3cacb2);}(_0x02f6,0xc2));var _0x602f=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0x02f6[_0x187718];return _0x29ddf4;};'use strict';var _=require('lodash');var util=require(_0x602f('0x0'));var moment=require(_0x602f('0x1'));var BPromise=require(_0x602f('0x2'));var rs=require(_0x602f('0x3'));var fs=require('fs');var Redis=require(_0x602f('0x4'));var db=require(_0x602f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x602f('0x6'))(_0x602f('0x7'));var config=require(_0x602f('0x8'));var jayson=require(_0x602f('0x9'));var client=jayson[_0x602f('0xa')][_0x602f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e8d50,_0xd656c2,_0x157ce4){return new BPromise(function(_0x1ced19,_0x218a0b){return client['request'](_0x1e8d50,_0x157ce4)[_0x602f('0xc')](function(_0x3f381f){logger[_0x602f('0xd')](_0x602f('0xe'),_0xd656c2,_0x602f('0xf'));logger[_0x602f('0x10')](_0x602f('0x11'),_0xd656c2,_0x602f('0xf'),JSON[_0x602f('0x12')](_0x3f381f));if(_0x3f381f[_0x602f('0x13')]){if(_0x3f381f['error'][_0x602f('0x14')]===0x1f4){logger[_0x602f('0x13')]('DeskAccount,\x20%s,\x20%s',_0xd656c2,_0x3f381f['error'][_0x602f('0x15')]);return _0x218a0b(_0x3f381f['error'][_0x602f('0x15')]);}logger[_0x602f('0x13')](_0x602f('0xe'),_0xd656c2,_0x3f381f[_0x602f('0x13')][_0x602f('0x15')]);return _0x1ced19(_0x3f381f[_0x602f('0x13')][_0x602f('0x15')]);}else{logger[_0x602f('0xd')](_0x602f('0xe'),_0xd656c2,_0x602f('0xf'));_0x1ced19(_0x3f381f[_0x602f('0x16')]['message']);}})[_0x602f('0x17')](function(_0x272edf){logger[_0x602f('0x13')](_0x602f('0xe'),_0xd656c2,_0x272edf);_0x218a0b(_0x272edf);});});}exports[_0x602f('0x18')]=function(_0x23d956){var _0x12e023=this;return new Promise(function(_0x154c3a,_0x4b39f2){return db['DeskAccount']['findAll']({'raw':_0x23d956[_0x602f('0x19')]?_0x23d956['options'][_0x602f('0x1a')]===undefined?!![]:![]:!![],'where':_0x23d956['options']?_0x23d956[_0x602f('0x19')][_0x602f('0x1b')]||null:null,'attributes':_0x23d956[_0x602f('0x19')]?_0x23d956[_0x602f('0x19')][_0x602f('0x1c')]||null:null,'limit':_0x23d956[_0x602f('0x19')]?_0x23d956['options'][_0x602f('0x1d')]||null:null,'include':_0x23d956[_0x602f('0x19')]?_0x23d956[_0x602f('0x19')][_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x23d956[_0x602f('0x19')][_0x602f('0x1e')],function(_0x4be19d){return{'model':db[_0x4be19d[_0x602f('0x20')]],'as':_0x4be19d['as'],'attributes':_0x4be19d['attributes'],'include':_0x4be19d[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x4be19d[_0x602f('0x1e')],function(_0x33e7c7){return{'model':db[_0x33e7c7[_0x602f('0x20')]],'as':_0x33e7c7['as'],'attributes':_0x33e7c7[_0x602f('0x1c')],'include':_0x33e7c7[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x33e7c7['include'],function(_0x32edff){return{'model':db[_0x32edff[_0x602f('0x20')]],'as':_0x32edff['as'],'attributes':_0x32edff[_0x602f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x602f('0xc')](function(_0x226c8b){logger[_0x602f('0xd')](_0x602f('0x18'),_0x23d956);logger[_0x602f('0x10')](_0x602f('0x18'),_0x23d956,JSON[_0x602f('0x12')](_0x226c8b));_0x154c3a(_0x226c8b);})[_0x602f('0x17')](function(_0xc51851){logger[_0x602f('0x13')](_0x602f('0x18'),_0xc51851['message'],_0x23d956);_0x4b39f2(_0x12e023[_0x602f('0x13')](0x1f4,_0xc51851[_0x602f('0x15')]));});});};exports[_0x602f('0x21')]=function(_0x2cb770){var _0xe339e9=this;return new Promise(function(_0x41f869,_0x27e7fb){return db[_0x602f('0x22')]['find']({'raw':_0x2cb770['options']?_0x2cb770['options']['raw']===undefined?!![]:![]:!![],'where':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1b')]||null:null,'attributes':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1c')]||null:null,'include':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x2cb770[_0x602f('0x19')][_0x602f('0x1e')],function(_0x17c474){return{'model':db[_0x17c474[_0x602f('0x20')]],'as':_0x17c474['as'],'attributes':_0x17c474[_0x602f('0x1c')],'include':_0x17c474[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x17c474[_0x602f('0x1e')],function(_0x499325){return{'model':db[_0x499325[_0x602f('0x20')]],'as':_0x499325['as'],'attributes':_0x499325[_0x602f('0x1c')],'include':_0x499325[_0x602f('0x1e')]?_['map'](_0x499325['include'],function(_0xb054e3){return{'model':db[_0xb054e3[_0x602f('0x20')]],'as':_0xb054e3['as'],'attributes':_0xb054e3[_0x602f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x602f('0xc')](function(_0x1dcc0d){logger[_0x602f('0xd')](_0x602f('0x21'),_0x2cb770);logger[_0x602f('0x10')](_0x602f('0x21'),_0x2cb770,JSON['stringify'](_0x1dcc0d));_0x41f869(_0x1dcc0d);})['catch'](function(_0x1f4d32){logger[_0x602f('0x13')]('ShowDeskAccount',_0x1f4d32[_0x602f('0x15')],_0x2cb770);_0x27e7fb(_0xe339e9[_0x602f('0x13')](0x1f4,_0x1f4d32[_0x602f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9ed9d37..20f40d8 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4941c0,_0x48b4dc){var _0xd12354=function(_0x2e0b37){while(--_0x2e0b37){_0x4941c0['push'](_0x4941c0['shift']());}};_0xd12354(++_0x48b4dc);}(_0x008c,0x188));var _0xc008=function(_0x46b579,_0x566d72){_0x46b579=_0x46b579-0x0;var _0x373a12=_0x008c[_0x46b579];return _0x373a12;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x566827,_0x26dd8a){var _0x2c48b4=function(_0x473030){while(--_0x473030){_0x566827['push'](_0x566827['shift']());}};_0x2c48b4(++_0x26dd8a);}(_0x3e74,0x175));var _0x43e7=function(_0x286caa,_0x572db5){_0x286caa=_0x286caa-0x0;var _0x70848d=_0x3e74[_0x286caa];return _0x70848d;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6671c59..519d104 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 _0x5265=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5265,0x1ab));var _0x5526=function(_0xb41e85,_0xfe6af7){_0xb41e85=_0xb41e85-0x0;var _0x499fe1=_0x5265[_0xb41e85];return _0x499fe1;};'use strict';var Sequelize=require(_0x5526('0x0'));module[_0x5526('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x663c=['sequelize','STRING'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x663c,0xe8));var _0xc663=function(_0x37306a,_0x435902){_0x37306a=_0x37306a-0x0;var _0x552039=_0x663c[_0x37306a];return _0x552039;};'use strict';var Sequelize=require(_0xc663('0x0'));module['exports']={'name':{'type':Sequelize[_0xc663('0x1')]},'description':{'type':Sequelize[_0xc663('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 983ccee..776c874 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 _0x9880=['hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','includeAll','catch','create','body','find','params','destroy','findOne','getFields','nolimit','getSubjects','DeskField','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','update','then','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1609aa,_0x31c26c){var _0x32205d=function(_0x59a6f){while(--_0x59a6f){_0x1609aa['push'](_0x1609aa['shift']());}};_0x32205d(++_0x31c26c);}(_0x9880,0xc5));var _0x0988=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x9880[_0x1627ae];return _0x34b38f;};'use strict';var emlformat=require(_0x0988('0x0'));var rimraf=require(_0x0988('0x1'));var zipdir=require(_0x0988('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0988('0x3'));var moment=require(_0x0988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0988('0x5'));var util=require(_0x0988('0x6'));var path=require(_0x0988('0x7'));var sox=require(_0x0988('0x8'));var csv=require(_0x0988('0x9'));var ejs=require(_0x0988('0xa'));var fs=require('fs');var fs_extra=require(_0x0988('0xb'));var _=require('lodash');var squel=require(_0x0988('0xc'));var crypto=require(_0x0988('0xd'));var jsforce=require(_0x0988('0xe'));var deskjs=require(_0x0988('0xf'));var toCsv=require(_0x0988('0x9'));var querystring=require(_0x0988('0x10'));var Papa=require(_0x0988('0x11'));var Redis=require(_0x0988('0x12'));var authService=require(_0x0988('0x13'));var qs=require(_0x0988('0x14'));var as=require(_0x0988('0x15'));var hardwareService=require(_0x0988('0x16'));var logger=require(_0x0988('0x17'))(_0x0988('0x18'));var utils=require(_0x0988('0x19'));var config=require(_0x0988('0x1a'));var licenseUtil=require(_0x0988('0x1b'));var db=require(_0x0988('0x1c'))['db'];function respondWithStatusCode(_0x39db73,_0x412122){_0x412122=_0x412122||0xcc;return function(_0x3ae8fe){if(_0x3ae8fe){return _0x39db73[_0x0988('0x1d')](_0x412122);}return _0x39db73['status'](_0x412122)[_0x0988('0x1e')]();};}function respondWithResult(_0x510a9c,_0x2676bd){_0x2676bd=_0x2676bd||0xc8;return function(_0x28578e){if(_0x28578e){return _0x510a9c['status'](_0x2676bd)['json'](_0x28578e);}};}function respondWithFilteredResult(_0x3c5874,_0x3fa767){return function(_0x1e1dee){if(_0x1e1dee){var _0x1f90a3=typeof _0x3fa767[_0x0988('0x1f')]==='undefined'&&typeof _0x3fa767[_0x0988('0x20')]===_0x0988('0x21');var _0x46f4fc=_0x1e1dee[_0x0988('0x22')];var _0x1b320c=_0x1f90a3?0x0:_0x3fa767[_0x0988('0x1f')];var _0x224e26=_0x1f90a3?_0x1e1dee[_0x0988('0x22')]:_0x3fa767[_0x0988('0x1f')]+_0x3fa767['limit'];var _0x57fffa;if(_0x224e26>=_0x46f4fc){_0x224e26=_0x46f4fc;_0x57fffa=0xc8;}else{_0x57fffa=0xce;}_0x3c5874[_0x0988('0x23')](_0x57fffa);return _0x3c5874[_0x0988('0x24')](_0x0988('0x25'),_0x1b320c+'-'+_0x224e26+'/'+_0x46f4fc)[_0x0988('0x26')](_0x1e1dee);}return null;};}function patchUpdates(_0x3af650){return function(_0x1ebb80){try{jsonpatch[_0x0988('0x27')](_0x1ebb80,_0x3af650,!![]);}catch(_0x4d7371){return BPromise['reject'](_0x4d7371);}return _0x1ebb80['save']();};}function saveUpdates(_0x36edf3,_0x59615a){return function(_0x4b19f8){if(_0x4b19f8){return _0x4b19f8[_0x0988('0x28')](_0x36edf3)[_0x0988('0x29')](function(_0x48d81a){return _0x48d81a;});}return null;};}function removeEntity(_0x219c29,_0x2a02da){return function(_0x1c184d){if(_0x1c184d){return _0x1c184d['destroy']()['then'](function(){_0x219c29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25fa00,_0x4fd286){return function(_0x231a7d){if(!_0x231a7d){_0x25fa00[_0x0988('0x1d')](0x194);}return _0x231a7d;};}function handleError(_0x29a3de,_0x362df6){_0x362df6=_0x362df6||0x1f4;return function(_0x527ade){logger['error'](_0x527ade[_0x0988('0x2a')]);if(_0x527ade[_0x0988('0x2b')]){delete _0x527ade[_0x0988('0x2b')];}_0x29a3de[_0x0988('0x23')](_0x362df6)[_0x0988('0x2c')](_0x527ade);};}exports[_0x0988('0x2d')]=function(_0x373cf2,_0x3f7f98){var _0x59dc07={},_0xeaa688={},_0x4ec048={'count':0x0,'rows':[]};var _0x53ac45=_[_0x0988('0x2e')](db[_0x0988('0x2f')][_0x0988('0x30')],function(_0x23b4f1){return{'name':_0x23b4f1[_0x0988('0x31')],'type':_0x23b4f1['type']['key']};});_0xeaa688[_0x0988('0x32')]=_[_0x0988('0x2e')](_0x53ac45,'name');_0xeaa688[_0x0988('0x33')]=_[_0x0988('0x34')](_0x373cf2[_0x0988('0x33')]);_0xeaa688[_0x0988('0x35')]=_[_0x0988('0x36')](_0xeaa688[_0x0988('0x32')],_0xeaa688['query']);_0x59dc07[_0x0988('0x37')]=_[_0x0988('0x36')](_0xeaa688[_0x0988('0x32')],qs[_0x0988('0x38')](_0x373cf2[_0x0988('0x33')][_0x0988('0x38')]));_0x59dc07[_0x0988('0x37')]=_0x59dc07['attributes'][_0x0988('0x39')]?_0x59dc07[_0x0988('0x37')]:_0xeaa688[_0x0988('0x32')];if(!_0x373cf2['query'][_0x0988('0x3a')]('nolimit')){_0x59dc07[_0x0988('0x20')]=qs['limit'](_0x373cf2[_0x0988('0x33')]['limit']);_0x59dc07[_0x0988('0x1f')]=qs[_0x0988('0x1f')](_0x373cf2[_0x0988('0x33')]['offset']);}_0x59dc07[_0x0988('0x3b')]=qs[_0x0988('0x3c')](_0x373cf2['query'][_0x0988('0x3c')]);_0x59dc07['where']=qs[_0x0988('0x35')](_[_0x0988('0x3d')](_0x373cf2['query'],_0xeaa688['filters']),_0x53ac45);if(_0x373cf2[_0x0988('0x33')][_0x0988('0x3e')]){_0x59dc07[_0x0988('0x3f')]=_['merge'](_0x59dc07[_0x0988('0x3f')],{'$or':_['map'](_0x53ac45,function(_0x5db2cb){if(_0x5db2cb['type']!==_0x0988('0x40')){var _0x3c97c6={};_0x3c97c6[_0x5db2cb[_0x0988('0x2b')]]={'$like':'%'+_0x373cf2[_0x0988('0x33')][_0x0988('0x3e')]+'%'};return _0x3c97c6;}})});}_0x59dc07=_[_0x0988('0x41')]({},_0x59dc07,_0x373cf2[_0x0988('0x42')]);var _0x11c690={'where':_0x59dc07['where']};return db[_0x0988('0x2f')][_0x0988('0x22')](_0x11c690)[_0x0988('0x29')](function(_0x3a5fe0){_0x4ec048['count']=_0x3a5fe0;if(_0x373cf2['query']['includeAll']){_0x59dc07[_0x0988('0x43')]=[{'all':!![]}];}return db[_0x0988('0x2f')][_0x0988('0x44')](_0x59dc07);})[_0x0988('0x29')](function(_0x310ef7){_0x4ec048[_0x0988('0x45')]=_0x310ef7;return _0x4ec048;})['then'](respondWithFilteredResult(_0x3f7f98,_0x59dc07))['catch'](handleError(_0x3f7f98,null));};exports['show']=function(_0x327606,_0x1ea03a){var _0x440d1={'raw':![],'where':{'id':_0x327606['params']['id']}},_0x25acb2={};_0x25acb2[_0x0988('0x32')]=_[_0x0988('0x34')](db[_0x0988('0x2f')][_0x0988('0x30')]);_0x25acb2[_0x0988('0x33')]=_['keys'](_0x327606[_0x0988('0x33')]);_0x25acb2['filters']=_['intersection'](_0x25acb2['model'],_0x25acb2['query']);_0x440d1[_0x0988('0x37')]=_[_0x0988('0x36')](_0x25acb2[_0x0988('0x32')],qs[_0x0988('0x38')](_0x327606['query'][_0x0988('0x38')]));_0x440d1[_0x0988('0x37')]=_0x440d1[_0x0988('0x37')]['length']?_0x440d1[_0x0988('0x37')]:_0x25acb2['model'];if(_0x327606[_0x0988('0x33')][_0x0988('0x46')]){_0x440d1[_0x0988('0x43')]=[{'all':!![]}];}_0x440d1=_['merge']({},_0x440d1,_0x327606['options']);return db[_0x0988('0x2f')]['find'](_0x440d1)[_0x0988('0x29')](handleEntityNotFound(_0x1ea03a,null))[_0x0988('0x29')](respondWithResult(_0x1ea03a,null))[_0x0988('0x47')](handleError(_0x1ea03a,null));};exports['create']=function(_0x4ac4a4,_0x1b3857){return db[_0x0988('0x2f')][_0x0988('0x48')](_0x4ac4a4[_0x0988('0x49')],{})[_0x0988('0x29')](respondWithResult(_0x1b3857,0xc9))[_0x0988('0x47')](handleError(_0x1b3857,null));};exports[_0x0988('0x28')]=function(_0x4f2de7,_0x1a095f){if(_0x4f2de7['body']['id']){delete _0x4f2de7[_0x0988('0x49')]['id'];}return db['DeskConfiguration'][_0x0988('0x4a')]({'where':{'id':_0x4f2de7[_0x0988('0x4b')]['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x1a095f,null))[_0x0988('0x29')](saveUpdates(_0x4f2de7[_0x0988('0x49')],null))[_0x0988('0x29')](respondWithResult(_0x1a095f,null))[_0x0988('0x47')](handleError(_0x1a095f,null));};exports[_0x0988('0x4c')]=function(_0x283502,_0x25e823){return db[_0x0988('0x2f')][_0x0988('0x4a')]({'where':{'id':_0x283502[_0x0988('0x4b')]['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x25e823,null))[_0x0988('0x29')](removeEntity(_0x25e823,null))[_0x0988('0x47')](handleError(_0x25e823,null));};exports['getFields']=function(_0x561d4f,_0x591cd0,_0x37783f){var _0x1f8b5e={};var _0x5348c1={};var _0x16824a;var _0x58fabc;return db[_0x0988('0x2f')][_0x0988('0x4d')]({'where':{'id':_0x561d4f[_0x0988('0x4b')]['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x591cd0,null))[_0x0988('0x29')](function(_0x1cd6a7){if(_0x1cd6a7){_0x16824a=_0x1cd6a7;_0x5348c1[_0x0988('0x32')]=_[_0x0988('0x34')](db['DeskField'][_0x0988('0x30')]);_0x5348c1[_0x0988('0x33')]=_[_0x0988('0x34')](_0x561d4f[_0x0988('0x33')]);_0x5348c1[_0x0988('0x35')]=_[_0x0988('0x36')](_0x5348c1[_0x0988('0x32')],_0x5348c1[_0x0988('0x33')]);_0x1f8b5e['attributes']=_[_0x0988('0x36')](_0x5348c1['model'],qs[_0x0988('0x38')](_0x561d4f[_0x0988('0x33')][_0x0988('0x38')]));_0x1f8b5e[_0x0988('0x37')]=_0x1f8b5e[_0x0988('0x37')]['length']?_0x1f8b5e['attributes']:_0x5348c1[_0x0988('0x32')];_0x1f8b5e['order']=qs['sort'](_0x561d4f[_0x0988('0x33')][_0x0988('0x3c')]);_0x1f8b5e[_0x0988('0x3f')]=qs[_0x0988('0x35')](_[_0x0988('0x3d')](_0x561d4f[_0x0988('0x33')],_0x5348c1[_0x0988('0x35')]));if(_0x561d4f['query']['filter']){_0x1f8b5e[_0x0988('0x3f')]=_[_0x0988('0x41')](_0x1f8b5e[_0x0988('0x3f')],{'$or':_[_0x0988('0x2e')](_0x1f8b5e[_0x0988('0x37')],function(_0x452691){var _0x60f7b4={};_0x60f7b4[_0x452691]={'$like':'%'+_0x561d4f[_0x0988('0x33')][_0x0988('0x3e')]+'%'};return _0x60f7b4;})});}_0x1f8b5e=_[_0x0988('0x41')]({},_0x1f8b5e,_0x561d4f['options']);return _0x16824a[_0x0988('0x4e')](_0x1f8b5e);}})[_0x0988('0x29')](function(_0xc3519){if(_0xc3519){_0x58fabc=_0xc3519[_0x0988('0x39')];if(!_0x561d4f[_0x0988('0x33')][_0x0988('0x3a')](_0x0988('0x4f'))){_0x1f8b5e[_0x0988('0x20')]=qs[_0x0988('0x20')](_0x561d4f['query'][_0x0988('0x20')]);_0x1f8b5e[_0x0988('0x1f')]=qs[_0x0988('0x1f')](_0x561d4f[_0x0988('0x33')][_0x0988('0x1f')]);}return _0x16824a['getFields'](_0x1f8b5e);}})['then'](function(_0x2ecf22){if(_0x2ecf22){return _0x2ecf22?{'count':_0x58fabc,'rows':_0x2ecf22}:null;}})[_0x0988('0x29')](respondWithResult(_0x591cd0,null))[_0x0988('0x47')](handleError(_0x591cd0,null));};exports[_0x0988('0x50')]=function(_0x361727,_0x5204b6,_0x25dd48){var _0x2700ee={};var _0xe382bd={};var _0x265eec;var _0x405dc0;return db[_0x0988('0x2f')]['findOne']({'where':{'id':_0x361727['params']['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x5204b6,null))[_0x0988('0x29')](function(_0x484a96){if(_0x484a96){_0x265eec=_0x484a96;_0xe382bd[_0x0988('0x32')]=_['keys'](db[_0x0988('0x51')][_0x0988('0x30')]);_0xe382bd['query']=_['keys'](_0x361727['query']);_0xe382bd[_0x0988('0x35')]=_[_0x0988('0x36')](_0xe382bd[_0x0988('0x32')],_0xe382bd[_0x0988('0x33')]);_0x2700ee[_0x0988('0x37')]=_[_0x0988('0x36')](_0xe382bd[_0x0988('0x32')],qs[_0x0988('0x38')](_0x361727[_0x0988('0x33')][_0x0988('0x38')]));_0x2700ee['attributes']=_0x2700ee[_0x0988('0x37')][_0x0988('0x39')]?_0x2700ee[_0x0988('0x37')]:_0xe382bd[_0x0988('0x32')];_0x2700ee[_0x0988('0x3b')]=qs[_0x0988('0x3c')](_0x361727['query']['sort']);_0x2700ee['where']=qs[_0x0988('0x35')](_[_0x0988('0x3d')](_0x361727['query'],_0xe382bd[_0x0988('0x35')]));if(_0x361727['query'][_0x0988('0x3e')]){_0x2700ee[_0x0988('0x3f')]=_[_0x0988('0x41')](_0x2700ee['where'],{'$or':_[_0x0988('0x2e')](_0x2700ee[_0x0988('0x37')],function(_0xf0b2f7){var _0x14f672={};_0x14f672[_0xf0b2f7]={'$like':'%'+_0x361727[_0x0988('0x33')][_0x0988('0x3e')]+'%'};return _0x14f672;})});}_0x2700ee=_[_0x0988('0x41')]({},_0x2700ee,_0x361727[_0x0988('0x42')]);return _0x265eec[_0x0988('0x50')](_0x2700ee);}})[_0x0988('0x29')](function(_0x359d6b){if(_0x359d6b){_0x405dc0=_0x359d6b[_0x0988('0x39')];if(!_0x361727['query'][_0x0988('0x3a')](_0x0988('0x4f'))){_0x2700ee['limit']=qs['limit'](_0x361727[_0x0988('0x33')]['limit']);_0x2700ee[_0x0988('0x1f')]=qs[_0x0988('0x1f')](_0x361727['query'][_0x0988('0x1f')]);}return _0x265eec[_0x0988('0x50')](_0x2700ee);}})[_0x0988('0x29')](function(_0x4bf840){if(_0x4bf840){return _0x4bf840?{'count':_0x405dc0,'rows':_0x4bf840}:null;}})['then'](respondWithResult(_0x5204b6,null))[_0x0988('0x47')](handleError(_0x5204b6,null));};exports[_0x0988('0x52')]=function(_0x1c351a,_0x5456ba,_0x5ba082){var _0x29d89d={};var _0x5b0cee={};var _0x469b93;var _0x130fa8;return db[_0x0988('0x2f')][_0x0988('0x4d')]({'where':{'id':_0x1c351a[_0x0988('0x4b')]['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x5456ba,null))[_0x0988('0x29')](function(_0xf0c5){if(_0xf0c5){_0x469b93=_0xf0c5;_0x5b0cee[_0x0988('0x32')]=_[_0x0988('0x34')](db[_0x0988('0x51')][_0x0988('0x30')]);_0x5b0cee[_0x0988('0x33')]=_[_0x0988('0x34')](_0x1c351a['query']);_0x5b0cee[_0x0988('0x35')]=_['intersection'](_0x5b0cee[_0x0988('0x32')],_0x5b0cee['query']);_0x29d89d[_0x0988('0x37')]=_[_0x0988('0x36')](_0x5b0cee['model'],qs[_0x0988('0x38')](_0x1c351a['query'][_0x0988('0x38')]));_0x29d89d['attributes']=_0x29d89d['attributes']['length']?_0x29d89d[_0x0988('0x37')]:_0x5b0cee['model'];_0x29d89d[_0x0988('0x3b')]=qs[_0x0988('0x3c')](_0x1c351a[_0x0988('0x33')][_0x0988('0x3c')]);_0x29d89d[_0x0988('0x3f')]=qs['filters'](_['pick'](_0x1c351a[_0x0988('0x33')],_0x5b0cee[_0x0988('0x35')]));if(_0x1c351a[_0x0988('0x33')][_0x0988('0x3e')]){_0x29d89d[_0x0988('0x3f')]=_[_0x0988('0x41')](_0x29d89d[_0x0988('0x3f')],{'$or':_[_0x0988('0x2e')](_0x29d89d[_0x0988('0x37')],function(_0x2404f3){var _0x5d9a51={};_0x5d9a51[_0x2404f3]={'$like':'%'+_0x1c351a[_0x0988('0x33')]['filter']+'%'};return _0x5d9a51;})});}_0x29d89d=_[_0x0988('0x41')]({},_0x29d89d,_0x1c351a['options']);return _0x469b93['getDescriptions'](_0x29d89d);}})[_0x0988('0x29')](function(_0x105888){if(_0x105888){_0x130fa8=_0x105888[_0x0988('0x39')];if(!_0x1c351a['query']['hasOwnProperty']('nolimit')){_0x29d89d[_0x0988('0x20')]=qs[_0x0988('0x20')](_0x1c351a['query'][_0x0988('0x20')]);_0x29d89d['offset']=qs[_0x0988('0x1f')](_0x1c351a[_0x0988('0x33')][_0x0988('0x1f')]);}return _0x469b93[_0x0988('0x52')](_0x29d89d);}})['then'](function(_0x5974a2){if(_0x5974a2){return _0x5974a2?{'count':_0x130fa8,'rows':_0x5974a2}:null;}})[_0x0988('0x29')](respondWithResult(_0x5456ba,null))['catch'](handleError(_0x5456ba,null));};exports[_0x0988('0x53')]=function(_0x3b3fb3,_0xddae2e,_0x4a5fe6){var _0x5d8ed9={};var _0x31f12f={};var _0x486cdd;var _0x2c4730;return db[_0x0988('0x2f')][_0x0988('0x4d')]({'where':{'id':_0x3b3fb3[_0x0988('0x4b')]['id']}})['then'](handleEntityNotFound(_0xddae2e,null))['then'](function(_0x58dad8){if(_0x58dad8){_0x486cdd=_0x58dad8;_0x31f12f[_0x0988('0x32')]=_[_0x0988('0x34')](db['Tag'][_0x0988('0x30')]);_0x31f12f[_0x0988('0x33')]=_['keys'](_0x3b3fb3['query']);_0x31f12f[_0x0988('0x35')]=_[_0x0988('0x36')](_0x31f12f[_0x0988('0x32')],_0x31f12f['query']);_0x5d8ed9[_0x0988('0x37')]=_['intersection'](_0x31f12f[_0x0988('0x32')],qs[_0x0988('0x38')](_0x3b3fb3[_0x0988('0x33')][_0x0988('0x38')]));_0x5d8ed9[_0x0988('0x37')]=_0x5d8ed9[_0x0988('0x37')][_0x0988('0x39')]?_0x5d8ed9[_0x0988('0x37')]:_0x31f12f[_0x0988('0x32')];_0x5d8ed9[_0x0988('0x3b')]=qs['sort'](_0x3b3fb3['query'][_0x0988('0x3c')]);_0x5d8ed9[_0x0988('0x3f')]=qs[_0x0988('0x35')](_[_0x0988('0x3d')](_0x3b3fb3['query'],_0x31f12f[_0x0988('0x35')]));if(_0x3b3fb3[_0x0988('0x33')][_0x0988('0x3e')]){_0x5d8ed9[_0x0988('0x3f')]=_[_0x0988('0x41')](_0x5d8ed9[_0x0988('0x3f')],{'$or':_['map'](_0x5d8ed9[_0x0988('0x37')],function(_0x2ca798){var _0x57e45d={};_0x57e45d[_0x2ca798]={'$like':'%'+_0x3b3fb3[_0x0988('0x33')][_0x0988('0x3e')]+'%'};return _0x57e45d;})});}_0x5d8ed9=_[_0x0988('0x41')]({},_0x5d8ed9,_0x3b3fb3[_0x0988('0x42')]);return _0x486cdd[_0x0988('0x53')](_0x5d8ed9);}})[_0x0988('0x29')](function(_0x4681cf){if(_0x4681cf){_0x2c4730=_0x4681cf[_0x0988('0x39')];if(!_0x3b3fb3[_0x0988('0x33')][_0x0988('0x3a')](_0x0988('0x4f'))){_0x5d8ed9[_0x0988('0x20')]=qs[_0x0988('0x20')](_0x3b3fb3[_0x0988('0x33')][_0x0988('0x20')]);_0x5d8ed9['offset']=qs[_0x0988('0x1f')](_0x3b3fb3[_0x0988('0x33')][_0x0988('0x1f')]);}return _0x486cdd[_0x0988('0x53')](_0x5d8ed9);}})['then'](function(_0x3292d5){if(_0x3292d5){return _0x3292d5?{'count':_0x2c4730,'rows':_0x3292d5}:null;}})['then'](respondWithResult(_0xddae2e,null))[_0x0988('0x47')](handleError(_0xddae2e,null));};exports[_0x0988('0x54')]=function(_0x49efd7,_0x5ba9f6,_0x61f105){if(_0x49efd7['body']['id']){delete _0x49efd7['body']['id'];}return db[_0x0988('0x2f')]['findOne']({'where':{'id':_0x49efd7['params']['id']}})[_0x0988('0x29')](handleEntityNotFound(_0x5ba9f6,null))[_0x0988('0x29')](function(_0x35aa61){if(_0x35aa61){return _0x35aa61['setTags'](_0x49efd7[_0x0988('0x49')]['ids']||[]);}return null;})[_0x0988('0x29')](respondWithResult(_0x5ba9f6,null))[_0x0988('0x47')](handleError(_0x5ba9f6,null));}; \ No newline at end of file +var _0x8632=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','DeskField','pick','options','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv'];(function(_0x4cdff0,_0x41336e){var _0x34eac2=function(_0x199353){while(--_0x199353){_0x4cdff0['push'](_0x4cdff0['shift']());}};_0x34eac2(++_0x41336e);}(_0x8632,0x18a));var _0x2863=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x8632[_0x10852d];return _0x13a8d6;};'use strict';var emlformat=require(_0x2863('0x0'));var rimraf=require(_0x2863('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2863('0x2'));var util=require(_0x2863('0x3'));var path=require(_0x2863('0x4'));var sox=require(_0x2863('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2863('0x6'));var _=require('lodash');var squel=require(_0x2863('0x7'));var crypto=require(_0x2863('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2863('0x9'));var toCsv=require(_0x2863('0xa'));var querystring=require('querystring');var Papa=require(_0x2863('0xb'));var Redis=require(_0x2863('0xc'));var authService=require(_0x2863('0xd'));var qs=require(_0x2863('0xe'));var as=require(_0x2863('0xf'));var hardwareService=require(_0x2863('0x10'));var logger=require(_0x2863('0x11'))(_0x2863('0x12'));var utils=require(_0x2863('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2863('0x14'))['db'];function respondWithStatusCode(_0x37bb46,_0x137756){_0x137756=_0x137756||0xcc;return function(_0x43ec7d){if(_0x43ec7d){return _0x37bb46[_0x2863('0x15')](_0x137756);}return _0x37bb46[_0x2863('0x16')](_0x137756)[_0x2863('0x17')]();};}function respondWithResult(_0x1db833,_0x3b6601){_0x3b6601=_0x3b6601||0xc8;return function(_0x459698){if(_0x459698){return _0x1db833['status'](_0x3b6601)['json'](_0x459698);}};}function respondWithFilteredResult(_0x2abaca,_0x4f27c0){return function(_0x2d3e6d){if(_0x2d3e6d){var _0x5b15b5=typeof _0x4f27c0[_0x2863('0x18')]==='undefined'&&typeof _0x4f27c0[_0x2863('0x19')]==='undefined';var _0x561abc=_0x2d3e6d[_0x2863('0x1a')];var _0x5daa8b=_0x5b15b5?0x0:_0x4f27c0[_0x2863('0x18')];var _0x25009c=_0x5b15b5?_0x2d3e6d['count']:_0x4f27c0[_0x2863('0x18')]+_0x4f27c0[_0x2863('0x19')];var _0xdc3384;if(_0x25009c>=_0x561abc){_0x25009c=_0x561abc;_0xdc3384=0xc8;}else{_0xdc3384=0xce;}_0x2abaca['status'](_0xdc3384);return _0x2abaca[_0x2863('0x1b')](_0x2863('0x1c'),_0x5daa8b+'-'+_0x25009c+'/'+_0x561abc)['json'](_0x2d3e6d);}return null;};}function patchUpdates(_0x277cce){return function(_0xaffa35){try{jsonpatch[_0x2863('0x1d')](_0xaffa35,_0x277cce,!![]);}catch(_0x59d577){return BPromise[_0x2863('0x1e')](_0x59d577);}return _0xaffa35['save']();};}function saveUpdates(_0x18eab0,_0x33022a){return function(_0x59f4d2){if(_0x59f4d2){return _0x59f4d2[_0x2863('0x1f')](_0x18eab0)[_0x2863('0x20')](function(_0x357e1a){return _0x357e1a;});}return null;};}function removeEntity(_0x16fa08,_0xa67c37){return function(_0x5ee45c){if(_0x5ee45c){return _0x5ee45c[_0x2863('0x21')]()[_0x2863('0x20')](function(){_0x16fa08[_0x2863('0x16')](0xcc)[_0x2863('0x17')]();});}};}function handleEntityNotFound(_0x2e952d,_0x5d4c82){return function(_0x1e4de0){if(!_0x1e4de0){_0x2e952d[_0x2863('0x15')](0x194);}return _0x1e4de0;};}function handleError(_0x22cd9a,_0x5ebf72){_0x5ebf72=_0x5ebf72||0x1f4;return function(_0x23751c){logger[_0x2863('0x22')](_0x23751c[_0x2863('0x23')]);if(_0x23751c[_0x2863('0x24')]){delete _0x23751c['name'];}_0x22cd9a[_0x2863('0x16')](_0x5ebf72)[_0x2863('0x25')](_0x23751c);};}exports[_0x2863('0x26')]=function(_0x2c9f3e,_0x4d7e89){var _0x1e93c9={},_0x2c40e2={},_0x14fe65={'count':0x0,'rows':[]};var _0x3da9ad=_[_0x2863('0x27')](db['DeskConfiguration'][_0x2863('0x28')],function(_0x9e0bca){return{'name':_0x9e0bca[_0x2863('0x29')],'type':_0x9e0bca[_0x2863('0x2a')][_0x2863('0x2b')]};});_0x2c40e2['model']=_[_0x2863('0x27')](_0x3da9ad,'name');_0x2c40e2[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x2c9f3e[_0x2863('0x2c')]);_0x2c40e2['filters']=_[_0x2863('0x2e')](_0x2c40e2[_0x2863('0x2f')],_0x2c40e2['query']);_0x1e93c9[_0x2863('0x30')]=_[_0x2863('0x2e')](_0x2c40e2[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x31')]));_0x1e93c9[_0x2863('0x30')]=_0x1e93c9['attributes'][_0x2863('0x32')]?_0x1e93c9[_0x2863('0x30')]:_0x2c40e2[_0x2863('0x2f')];if(!_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x1e93c9[_0x2863('0x19')]=qs[_0x2863('0x19')](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x19')]);_0x1e93c9[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x2c9f3e[_0x2863('0x2c')]['offset']);}_0x1e93c9[_0x2863('0x35')]=qs['sort'](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x36')]);_0x1e93c9[_0x2863('0x37')]=qs['filters'](_['pick'](_0x2c9f3e[_0x2863('0x2c')],_0x2c40e2[_0x2863('0x38')]),_0x3da9ad);if(_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x39')]){_0x1e93c9['where']=_[_0x2863('0x3a')](_0x1e93c9[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x3da9ad,function(_0x2f03a5){if(_0x2f03a5['type']!=='VIRTUAL'){var _0x205850={};_0x205850[_0x2f03a5[_0x2863('0x24')]]={'$like':'%'+_0x2c9f3e['query']['filter']+'%'};return _0x205850;}})});}_0x1e93c9=_['merge']({},_0x1e93c9,_0x2c9f3e['options']);var _0x534bea={'where':_0x1e93c9[_0x2863('0x37')]};return db[_0x2863('0x3b')][_0x2863('0x1a')](_0x534bea)[_0x2863('0x20')](function(_0x1c84ef){_0x14fe65[_0x2863('0x1a')]=_0x1c84ef;if(_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x3c')]){_0x1e93c9[_0x2863('0x3d')]=[{'all':!![]}];}return db[_0x2863('0x3b')][_0x2863('0x3e')](_0x1e93c9);})[_0x2863('0x20')](function(_0x4a51f3){_0x14fe65[_0x2863('0x3f')]=_0x4a51f3;return _0x14fe65;})[_0x2863('0x20')](respondWithFilteredResult(_0x4d7e89,_0x1e93c9))[_0x2863('0x40')](handleError(_0x4d7e89,null));};exports[_0x2863('0x41')]=function(_0x498c75,_0x94928){var _0x565777={'raw':![],'where':{'id':_0x498c75[_0x2863('0x42')]['id']}},_0x4f0597={};_0x4f0597['model']=_[_0x2863('0x2d')](db[_0x2863('0x3b')][_0x2863('0x28')]);_0x4f0597['query']=_[_0x2863('0x2d')](_0x498c75[_0x2863('0x2c')]);_0x4f0597[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x4f0597['model'],_0x4f0597[_0x2863('0x2c')]);_0x565777[_0x2863('0x30')]=_['intersection'](_0x4f0597[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x498c75[_0x2863('0x2c')][_0x2863('0x31')]));_0x565777[_0x2863('0x30')]=_0x565777['attributes'][_0x2863('0x32')]?_0x565777['attributes']:_0x4f0597[_0x2863('0x2f')];if(_0x498c75[_0x2863('0x2c')][_0x2863('0x3c')]){_0x565777[_0x2863('0x3d')]=[{'all':!![]}];}_0x565777=_[_0x2863('0x3a')]({},_0x565777,_0x498c75['options']);return db[_0x2863('0x3b')][_0x2863('0x43')](_0x565777)['then'](handleEntityNotFound(_0x94928,null))[_0x2863('0x20')](respondWithResult(_0x94928,null))['catch'](handleError(_0x94928,null));};exports[_0x2863('0x44')]=function(_0x48353d,_0x2144bf){return db[_0x2863('0x3b')][_0x2863('0x44')](_0x48353d[_0x2863('0x45')],{})['then'](respondWithResult(_0x2144bf,0xc9))[_0x2863('0x40')](handleError(_0x2144bf,null));};exports['update']=function(_0x1ac3c8,_0xc413b0){if(_0x1ac3c8[_0x2863('0x45')]['id']){delete _0x1ac3c8[_0x2863('0x45')]['id'];}return db[_0x2863('0x3b')][_0x2863('0x43')]({'where':{'id':_0x1ac3c8[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0xc413b0,null))[_0x2863('0x20')](saveUpdates(_0x1ac3c8[_0x2863('0x45')],null))[_0x2863('0x20')](respondWithResult(_0xc413b0,null))[_0x2863('0x40')](handleError(_0xc413b0,null));};exports[_0x2863('0x21')]=function(_0x2f0a1b,_0x40062){return db[_0x2863('0x3b')][_0x2863('0x43')]({'where':{'id':_0x2f0a1b[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0x40062,null))['then'](removeEntity(_0x40062,null))[_0x2863('0x40')](handleError(_0x40062,null));};exports['getFields']=function(_0x3d3daa,_0x172d91,_0x4999d4){var _0xdf6b2e={};var _0x442375={};var _0x464d14;var _0x220511;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x3d3daa[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0x172d91,null))[_0x2863('0x20')](function(_0x34582f){if(_0x34582f){_0x464d14=_0x34582f;_0x442375['model']=_[_0x2863('0x2d')](db[_0x2863('0x47')][_0x2863('0x28')]);_0x442375['query']=_['keys'](_0x3d3daa[_0x2863('0x2c')]);_0x442375[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x442375['model'],_0x442375[_0x2863('0x2c')]);_0xdf6b2e['attributes']=_[_0x2863('0x2e')](_0x442375[_0x2863('0x2f')],qs['fields'](_0x3d3daa['query'][_0x2863('0x31')]));_0xdf6b2e[_0x2863('0x30')]=_0xdf6b2e['attributes']['length']?_0xdf6b2e[_0x2863('0x30')]:_0x442375[_0x2863('0x2f')];_0xdf6b2e[_0x2863('0x35')]=qs[_0x2863('0x36')](_0x3d3daa[_0x2863('0x2c')]['sort']);_0xdf6b2e[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x3d3daa[_0x2863('0x2c')],_0x442375[_0x2863('0x38')]));if(_0x3d3daa['query'][_0x2863('0x39')]){_0xdf6b2e[_0x2863('0x37')]=_['merge'](_0xdf6b2e[_0x2863('0x37')],{'$or':_['map'](_0xdf6b2e[_0x2863('0x30')],function(_0xf1f169){var _0x1b892e={};_0x1b892e[_0xf1f169]={'$like':'%'+_0x3d3daa[_0x2863('0x2c')]['filter']+'%'};return _0x1b892e;})});}_0xdf6b2e=_[_0x2863('0x3a')]({},_0xdf6b2e,_0x3d3daa[_0x2863('0x49')]);return _0x464d14[_0x2863('0x4a')](_0xdf6b2e);}})['then'](function(_0x5642c6){if(_0x5642c6){_0x220511=_0x5642c6[_0x2863('0x32')];if(!_0x3d3daa[_0x2863('0x2c')]['hasOwnProperty'](_0x2863('0x34'))){_0xdf6b2e['limit']=qs[_0x2863('0x19')](_0x3d3daa[_0x2863('0x2c')][_0x2863('0x19')]);_0xdf6b2e[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x3d3daa['query'][_0x2863('0x18')]);}return _0x464d14['getFields'](_0xdf6b2e);}})['then'](function(_0x5cd9f9){if(_0x5cd9f9){return _0x5cd9f9?{'count':_0x220511,'rows':_0x5cd9f9}:null;}})[_0x2863('0x20')](respondWithResult(_0x172d91,null))[_0x2863('0x40')](handleError(_0x172d91,null));};exports[_0x2863('0x4b')]=function(_0x4a43f8,_0x38f386,_0x410d61){var _0x29aa1c={};var _0x2b0dd8={};var _0x3f2f63;var _0x30a276;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x4a43f8[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0x38f386,null))[_0x2863('0x20')](function(_0x2989bd){if(_0x2989bd){_0x3f2f63=_0x2989bd;_0x2b0dd8[_0x2863('0x2f')]=_['keys'](db[_0x2863('0x47')]['rawAttributes']);_0x2b0dd8[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x4a43f8[_0x2863('0x2c')]);_0x2b0dd8[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x2b0dd8[_0x2863('0x2f')],_0x2b0dd8['query']);_0x29aa1c[_0x2863('0x30')]=_[_0x2863('0x2e')](_0x2b0dd8['model'],qs['fields'](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x31')]));_0x29aa1c['attributes']=_0x29aa1c[_0x2863('0x30')][_0x2863('0x32')]?_0x29aa1c[_0x2863('0x30')]:_0x2b0dd8[_0x2863('0x2f')];_0x29aa1c[_0x2863('0x35')]=qs['sort'](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x36')]);_0x29aa1c[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x4a43f8['query'],_0x2b0dd8[_0x2863('0x38')]));if(_0x4a43f8[_0x2863('0x2c')][_0x2863('0x39')]){_0x29aa1c[_0x2863('0x37')]=_[_0x2863('0x3a')](_0x29aa1c[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x29aa1c['attributes'],function(_0x10bebc){var _0xbe1567={};_0xbe1567[_0x10bebc]={'$like':'%'+_0x4a43f8['query']['filter']+'%'};return _0xbe1567;})});}_0x29aa1c=_[_0x2863('0x3a')]({},_0x29aa1c,_0x4a43f8[_0x2863('0x49')]);return _0x3f2f63[_0x2863('0x4b')](_0x29aa1c);}})[_0x2863('0x20')](function(_0x1f3ac7){if(_0x1f3ac7){_0x30a276=_0x1f3ac7[_0x2863('0x32')];if(!_0x4a43f8[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x29aa1c[_0x2863('0x19')]=qs[_0x2863('0x19')](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x19')]);_0x29aa1c['offset']=qs[_0x2863('0x18')](_0x4a43f8[_0x2863('0x2c')]['offset']);}return _0x3f2f63[_0x2863('0x4b')](_0x29aa1c);}})[_0x2863('0x20')](function(_0x42e486){if(_0x42e486){return _0x42e486?{'count':_0x30a276,'rows':_0x42e486}:null;}})['then'](respondWithResult(_0x38f386,null))['catch'](handleError(_0x38f386,null));};exports[_0x2863('0x4c')]=function(_0x5bab18,_0xbeee4b,_0x1317e4){var _0x519cb4={};var _0x499201={};var _0x58fa37;var _0x41c434;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x5bab18[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0xbeee4b,null))['then'](function(_0x589d7e){if(_0x589d7e){_0x58fa37=_0x589d7e;_0x499201[_0x2863('0x2f')]=_[_0x2863('0x2d')](db['DeskField'][_0x2863('0x28')]);_0x499201[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x5bab18[_0x2863('0x2c')]);_0x499201[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x499201[_0x2863('0x2f')],_0x499201[_0x2863('0x2c')]);_0x519cb4['attributes']=_[_0x2863('0x2e')](_0x499201[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x31')]));_0x519cb4['attributes']=_0x519cb4[_0x2863('0x30')]['length']?_0x519cb4[_0x2863('0x30')]:_0x499201[_0x2863('0x2f')];_0x519cb4[_0x2863('0x35')]=qs[_0x2863('0x36')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x36')]);_0x519cb4[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x5bab18[_0x2863('0x2c')],_0x499201['filters']));if(_0x5bab18[_0x2863('0x2c')][_0x2863('0x39')]){_0x519cb4['where']=_[_0x2863('0x3a')](_0x519cb4[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x519cb4[_0x2863('0x30')],function(_0x59287f){var _0x9143ba={};_0x9143ba[_0x59287f]={'$like':'%'+_0x5bab18['query'][_0x2863('0x39')]+'%'};return _0x9143ba;})});}_0x519cb4=_[_0x2863('0x3a')]({},_0x519cb4,_0x5bab18[_0x2863('0x49')]);return _0x58fa37[_0x2863('0x4c')](_0x519cb4);}})['then'](function(_0x17e89a){if(_0x17e89a){_0x41c434=_0x17e89a[_0x2863('0x32')];if(!_0x5bab18['query'][_0x2863('0x33')](_0x2863('0x34'))){_0x519cb4['limit']=qs[_0x2863('0x19')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x19')]);_0x519cb4[_0x2863('0x18')]=qs['offset'](_0x5bab18[_0x2863('0x2c')][_0x2863('0x18')]);}return _0x58fa37['getDescriptions'](_0x519cb4);}})[_0x2863('0x20')](function(_0x2da7a5){if(_0x2da7a5){return _0x2da7a5?{'count':_0x41c434,'rows':_0x2da7a5}:null;}})[_0x2863('0x20')](respondWithResult(_0xbeee4b,null))[_0x2863('0x40')](handleError(_0xbeee4b,null));};exports[_0x2863('0x4d')]=function(_0x52d183,_0xed1a24,_0x1a60d1){var _0x3e9543={};var _0x3bd33c={};var _0x1a2ce8;var _0x165aa4;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x52d183[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0xed1a24,null))['then'](function(_0x57541a){if(_0x57541a){_0x1a2ce8=_0x57541a;_0x3bd33c[_0x2863('0x2f')]=_[_0x2863('0x2d')](db[_0x2863('0x4e')][_0x2863('0x28')]);_0x3bd33c['query']=_[_0x2863('0x2d')](_0x52d183['query']);_0x3bd33c[_0x2863('0x38')]=_['intersection'](_0x3bd33c[_0x2863('0x2f')],_0x3bd33c[_0x2863('0x2c')]);_0x3e9543['attributes']=_[_0x2863('0x2e')](_0x3bd33c['model'],qs['fields'](_0x52d183[_0x2863('0x2c')][_0x2863('0x31')]));_0x3e9543[_0x2863('0x30')]=_0x3e9543['attributes'][_0x2863('0x32')]?_0x3e9543[_0x2863('0x30')]:_0x3bd33c[_0x2863('0x2f')];_0x3e9543['order']=qs['sort'](_0x52d183['query']['sort']);_0x3e9543[_0x2863('0x37')]=qs['filters'](_['pick'](_0x52d183['query'],_0x3bd33c['filters']));if(_0x52d183[_0x2863('0x2c')][_0x2863('0x39')]){_0x3e9543['where']=_[_0x2863('0x3a')](_0x3e9543[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x3e9543[_0x2863('0x30')],function(_0x11398e){var _0x4b0456={};_0x4b0456[_0x11398e]={'$like':'%'+_0x52d183[_0x2863('0x2c')][_0x2863('0x39')]+'%'};return _0x4b0456;})});}_0x3e9543=_['merge']({},_0x3e9543,_0x52d183[_0x2863('0x49')]);return _0x1a2ce8['getTags'](_0x3e9543);}})[_0x2863('0x20')](function(_0x464158){if(_0x464158){_0x165aa4=_0x464158[_0x2863('0x32')];if(!_0x52d183[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x3e9543[_0x2863('0x19')]=qs['limit'](_0x52d183['query'][_0x2863('0x19')]);_0x3e9543[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x52d183[_0x2863('0x2c')][_0x2863('0x18')]);}return _0x1a2ce8[_0x2863('0x4d')](_0x3e9543);}})['then'](function(_0x365628){if(_0x365628){return _0x365628?{'count':_0x165aa4,'rows':_0x365628}:null;}})[_0x2863('0x20')](respondWithResult(_0xed1a24,null))[_0x2863('0x40')](handleError(_0xed1a24,null));};exports[_0x2863('0x4f')]=function(_0x61d35f,_0x24b7bd,_0x521533){if(_0x61d35f[_0x2863('0x45')]['id']){delete _0x61d35f[_0x2863('0x45')]['id'];}return db[_0x2863('0x3b')]['findOne']({'where':{'id':_0x61d35f[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0x24b7bd,null))['then'](function(_0x5e7dcf){if(_0x5e7dcf){return _0x5e7dcf[_0x2863('0x4f')](_0x61d35f['body'][_0x2863('0x50')]||[]);}return null;})[_0x2863('0x20')](respondWithResult(_0x24b7bd,null))[_0x2863('0x40')](handleError(_0x24b7bd,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5b0abdb..9afbb86 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 _0x26b7=['path','rimraf','../../config/environment','exports','lodash','api','moment','bluebird','request-promise'];(function(_0x271296,_0x41f1c4){var _0xb0f7d5=function(_0x96c4c3){while(--_0x96c4c3){_0x271296['push'](_0x271296['shift']());}};_0xb0f7d5(++_0x41f1c4);}(_0x26b7,0x124));var _0x726b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x26b7[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x726b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x726b('0x1'));var moment=require(_0x726b('0x2'));var BPromise=require(_0x726b('0x3'));var rp=require(_0x726b('0x4'));var fs=require('fs');var path=require(_0x726b('0x5'));var rimraf=require(_0x726b('0x6'));var config=require(_0x726b('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x726b('0x8')]=function(_0x865c40,_0x5e0f75){return _0x865c40['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfdb=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x270c1e,_0x1b44cb){var _0xd77473=function(_0x50aeda){while(--_0x50aeda){_0x270c1e['push'](_0x270c1e['shift']());}};_0xd77473(++_0x1b44cb);}(_0xbfdb,0x13a));var _0xbbfd=function(_0x1b6b61,_0x1ebdfd){_0x1b6b61=_0x1b6b61-0x0;var _0x578b5b=_0xbfdb[_0x1b6b61];return _0x578b5b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbfd('0x0'));var moment=require(_0xbbfd('0x1'));var BPromise=require(_0xbbfd('0x2'));var rp=require(_0xbbfd('0x3'));var fs=require('fs');var path=require(_0xbbfd('0x4'));var rimraf=require('rimraf');var config=require(_0xbbfd('0x5'));var attributes=require(_0xbbfd('0x6'));module[_0xbbfd('0x7')]=function(_0x5a1363,_0x1ffae0){return _0x5a1363[_0xbbfd('0x8')](_0xbbfd('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5c455be..c7025e1 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 _0xc48d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x122f9a,_0x14c371){var _0xe66693=function(_0x2053e3){while(--_0x2053e3){_0x122f9a['push'](_0x122f9a['shift']());}};_0xe66693(++_0x14c371);}(_0xc48d,0x11a));var _0xdc48=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xc48d[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc48('0x2'));var fs=require('fs');var Redis=require(_0xdc48('0x3'));var db=require(_0xdc48('0x4'))['db'];var utils=require(_0xdc48('0x5'));var logger=require(_0xdc48('0x6'))(_0xdc48('0x7'));var config=require(_0xdc48('0x8'));var jayson=require(_0xdc48('0x9'));var client=jayson[_0xdc48('0xa')][_0xdc48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x517796,_0x1487ca,_0x44e5c1){return new BPromise(function(_0x33c834,_0x4d025a){return client[_0xdc48('0xc')](_0x517796,_0x44e5c1)[_0xdc48('0xd')](function(_0x44d7b8){logger[_0xdc48('0xe')](_0xdc48('0xf'),_0x1487ca,_0xdc48('0x10'));logger[_0xdc48('0x11')](_0xdc48('0x12'),_0x1487ca,_0xdc48('0x10'),JSON[_0xdc48('0x13')](_0x44d7b8));if(_0x44d7b8[_0xdc48('0x14')]){if(_0x44d7b8[_0xdc48('0x14')]['code']===0x1f4){logger[_0xdc48('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x1487ca,_0x44d7b8[_0xdc48('0x14')]['message']);return _0x4d025a(_0x44d7b8[_0xdc48('0x14')][_0xdc48('0x15')]);}logger[_0xdc48('0x14')](_0xdc48('0xf'),_0x1487ca,_0x44d7b8['error'][_0xdc48('0x15')]);return _0x33c834(_0x44d7b8[_0xdc48('0x14')][_0xdc48('0x15')]);}else{logger[_0xdc48('0xe')](_0xdc48('0xf'),_0x1487ca,_0xdc48('0x10'));_0x33c834(_0x44d7b8[_0xdc48('0x16')][_0xdc48('0x15')]);}})[_0xdc48('0x17')](function(_0x3914bb){logger[_0xdc48('0x14')](_0xdc48('0xf'),_0x1487ca,_0x3914bb);_0x4d025a(_0x3914bb);});});} \ No newline at end of file +var _0xdca4=['http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x69e5a9,_0x51afa7){var _0x28a0d1=function(_0x1ac166){while(--_0x1ac166){_0x69e5a9['push'](_0x69e5a9['shift']());}};_0x28a0d1(++_0x51afa7);}(_0xdca4,0x138));var _0x4dca=function(_0x169db3,_0x3ce092){_0x169db3=_0x169db3-0x0;var _0x499e19=_0xdca4[_0x169db3];return _0x499e19;};'use strict';var _=require(_0x4dca('0x0'));var util=require('util');var moment=require(_0x4dca('0x1'));var BPromise=require('bluebird');var rs=require(_0x4dca('0x2'));var fs=require('fs');var Redis=require(_0x4dca('0x3'));var db=require(_0x4dca('0x4'))['db'];var utils=require(_0x4dca('0x5'));var logger=require(_0x4dca('0x6'))(_0x4dca('0x7'));var config=require(_0x4dca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4dca('0x9')][_0x4dca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ecf67,_0x3209c4,_0x56017c){return new BPromise(function(_0x2e66ad,_0x35966b){return client[_0x4dca('0xb')](_0x3ecf67,_0x56017c)[_0x4dca('0xc')](function(_0x1e1e56){logger[_0x4dca('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3209c4,_0x4dca('0xe'));logger[_0x4dca('0xf')](_0x4dca('0x10'),_0x3209c4,'request\x20sent',JSON[_0x4dca('0x11')](_0x1e1e56));if(_0x1e1e56[_0x4dca('0x12')]){if(_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x13')]===0x1f4){logger[_0x4dca('0x12')](_0x4dca('0x14'),_0x3209c4,_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);return _0x35966b(_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);}logger[_0x4dca('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3209c4,_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);return _0x2e66ad(_0x1e1e56[_0x4dca('0x12')]['message']);}else{logger[_0x4dca('0xd')](_0x4dca('0x14'),_0x3209c4,'request\x20sent');_0x2e66ad(_0x1e1e56[_0x4dca('0x16')][_0x4dca('0x15')]);}})['catch'](function(_0x327050){logger[_0x4dca('0x12')](_0x4dca('0x14'),_0x3209c4,_0x327050);_0x35966b(_0x327050);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f337c23..14c55e3 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 _0x6629=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6629,0x1c2));var _0x9662=function(_0x246935,_0xcc02bb){_0x246935=_0x246935-0x0;var _0x440de7=_0x6629[_0x246935];return _0x440de7;};'use strict';var multer=require(_0x9662('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9662('0x1'));var express=require(_0x9662('0x2'));var router=express[_0x9662('0x3')]();var fs_extra=require(_0x9662('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9662('0x5'));var config=require(_0x9662('0x6'));var controller=require(_0x9662('0x7'));router['get']('/',auth[_0x9662('0x8')](),controller[_0x9662('0x9')]);router[_0x9662('0xa')]('/:id',auth[_0x9662('0x8')](),controller['show']);router[_0x9662('0xb')]('/',auth[_0x9662('0x8')](),controller[_0x9662('0xc')]);router[_0x9662('0xd')](_0x9662('0xe'),auth[_0x9662('0x8')](),controller[_0x9662('0xf')]);router[_0x9662('0x10')](_0x9662('0xe'),auth[_0x9662('0x8')](),controller[_0x9662('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc468=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get'];(function(_0x4d88b8,_0x195547){var _0x32f725=function(_0x32145a){while(--_0x32145a){_0x4d88b8['push'](_0x4d88b8['shift']());}};_0x32f725(++_0x195547);}(_0xc468,0xd0));var _0x8c46=function(_0x423b1c,_0x403585){_0x423b1c=_0x423b1c-0x0;var _0xa050b6=_0xc468[_0x423b1c];return _0xa050b6;};'use strict';var multer=require(_0x8c46('0x0'));var util=require('util');var path=require(_0x8c46('0x1'));var timeout=require(_0x8c46('0x2'));var express=require(_0x8c46('0x3'));var router=express[_0x8c46('0x4')]();var fs_extra=require(_0x8c46('0x5'));var auth=require(_0x8c46('0x6'));var interaction=require(_0x8c46('0x7'));var config=require(_0x8c46('0x8'));var controller=require(_0x8c46('0x9'));router['get']('/',auth[_0x8c46('0xa')](),controller['index']);router[_0x8c46('0xb')](_0x8c46('0xc'),auth[_0x8c46('0xa')](),controller[_0x8c46('0xd')]);router['post']('/',auth[_0x8c46('0xa')](),controller[_0x8c46('0xe')]);router[_0x8c46('0xf')]('/:id',auth[_0x8c46('0xa')](),controller[_0x8c46('0x10')]);router[_0x8c46('0x11')]('/:id',auth[_0x8c46('0xa')](),controller[_0x8c46('0x12')]);module[_0x8c46('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 ee986c2..02140f5 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 _0x95ed=['sequelize','variable','keyValue','string','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x31438d,_0x31c750){var _0xe845ac=function(_0x24003a){while(--_0x24003a){_0x31438d['push'](_0x31438d['shift']());}};_0xe845ac(++_0x31c750);}(_0x95ed,0xd0));var _0xd95e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x95ed[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0xd95e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xd95e('0x1'),'customVariable',_0xd95e('0x2'),'picklist'),'defaultValue':_0xd95e('0x3')},'content':{'type':Sequelize[_0xd95e('0x4')]},'key':{'type':Sequelize[_0xd95e('0x4')]},'keyType':{'type':Sequelize[_0xd95e('0x5')](_0xd95e('0x3'),_0xd95e('0x1'),_0xd95e('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd95e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd95e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd95e('0x4')]}}; \ No newline at end of file +var _0xb639=['customVariable','keyValue','STRING','ENUM','sequelize','string','variable'];(function(_0x1f9559,_0x27ad92){var _0x1715fe=function(_0x457563){while(--_0x457563){_0x1f9559['push'](_0x1f9559['shift']());}};_0x1715fe(++_0x27ad92);}(_0xb639,0x1c4));var _0x9b63=function(_0x156b75,_0x2778d7){_0x156b75=_0x156b75-0x0;var _0x472179=_0xb639[_0x156b75];return _0x472179;};'use strict';var Sequelize=require(_0x9b63('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x9b63('0x1'),_0x9b63('0x2'),_0x9b63('0x3'),_0x9b63('0x4'),'picklist'),'defaultValue':_0x9b63('0x1')},'content':{'type':Sequelize[_0x9b63('0x5')]},'key':{'type':Sequelize[_0x9b63('0x5')]},'keyType':{'type':Sequelize[_0x9b63('0x6')](_0x9b63('0x1'),_0x9b63('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x9b63('0x5')]},'idField':{'type':Sequelize[_0x9b63('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b63('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d22f8f9..19a0746 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 _0xcbd3=['error','stack','name','send','index','DeskField','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x3c76c8,_0x490269){_0x3c76c8=_0x3c76c8-0x0;var _0x5dcc43=_0xcbd3[_0x3c76c8];return _0x5dcc43;};'use strict';var emlformat=require(_0x3cbd('0x0'));var rimraf=require(_0x3cbd('0x1'));var zipdir=require(_0x3cbd('0x2'));var jsonpatch=require(_0x3cbd('0x3'));var rp=require(_0x3cbd('0x4'));var moment=require(_0x3cbd('0x5'));var BPromise=require(_0x3cbd('0x6'));var Mustache=require(_0x3cbd('0x7'));var util=require(_0x3cbd('0x8'));var path=require(_0x3cbd('0x9'));var sox=require('sox');var csv=require(_0x3cbd('0xa'));var ejs=require(_0x3cbd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cbd('0xc'));var squel=require('squel');var crypto=require(_0x3cbd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3cbd('0xe'));var toCsv=require(_0x3cbd('0xa'));var querystring=require(_0x3cbd('0xf'));var Papa=require(_0x3cbd('0x10'));var Redis=require(_0x3cbd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3cbd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cbd('0x13'));var logger=require(_0x3cbd('0x14'))(_0x3cbd('0x15'));var utils=require('../../config/utils');var config=require(_0x3cbd('0x16'));var licenseUtil=require(_0x3cbd('0x17'));var db=require(_0x3cbd('0x18'))['db'];function respondWithStatusCode(_0x1addbc,_0x5e74a3){_0x5e74a3=_0x5e74a3||0xcc;return function(_0x5f4395){if(_0x5f4395){return _0x1addbc[_0x3cbd('0x19')](_0x5e74a3);}return _0x1addbc[_0x3cbd('0x1a')](_0x5e74a3)['end']();};}function respondWithResult(_0x4d3465,_0x50315c){_0x50315c=_0x50315c||0xc8;return function(_0x1fa41c){if(_0x1fa41c){return _0x4d3465['status'](_0x50315c)['json'](_0x1fa41c);}};}function respondWithFilteredResult(_0x301038,_0x282446){return function(_0x3509cd){if(_0x3509cd){var _0x396411=typeof _0x282446[_0x3cbd('0x1b')]===_0x3cbd('0x1c')&&typeof _0x282446['limit']===_0x3cbd('0x1c');var _0xc54a96=_0x3509cd[_0x3cbd('0x1d')];var _0x53774e=_0x396411?0x0:_0x282446['offset'];var _0x1727dd=_0x396411?_0x3509cd['count']:_0x282446[_0x3cbd('0x1b')]+_0x282446[_0x3cbd('0x1e')];var _0x4badba;if(_0x1727dd>=_0xc54a96){_0x1727dd=_0xc54a96;_0x4badba=0xc8;}else{_0x4badba=0xce;}_0x301038['status'](_0x4badba);return _0x301038[_0x3cbd('0x1f')](_0x3cbd('0x20'),_0x53774e+'-'+_0x1727dd+'/'+_0xc54a96)[_0x3cbd('0x21')](_0x3509cd);}return null;};}function patchUpdates(_0x226050){return function(_0x22de64){try{jsonpatch[_0x3cbd('0x22')](_0x22de64,_0x226050,!![]);}catch(_0x2bfd5f){return BPromise[_0x3cbd('0x23')](_0x2bfd5f);}return _0x22de64[_0x3cbd('0x24')]();};}function saveUpdates(_0x4ce3de,_0x543b51){return function(_0x375f0d){if(_0x375f0d){return _0x375f0d[_0x3cbd('0x25')](_0x4ce3de)[_0x3cbd('0x26')](function(_0x196afd){return _0x196afd;});}return null;};}function removeEntity(_0x269d4a,_0x57b408){return function(_0x420c46){if(_0x420c46){return _0x420c46[_0x3cbd('0x27')]()[_0x3cbd('0x26')](function(){_0x269d4a[_0x3cbd('0x1a')](0xcc)[_0x3cbd('0x28')]();});}};}function handleEntityNotFound(_0x3828aa,_0x4696af){return function(_0x1debc2){if(!_0x1debc2){_0x3828aa[_0x3cbd('0x19')](0x194);}return _0x1debc2;};}function handleError(_0x41efa1,_0x3009f3){_0x3009f3=_0x3009f3||0x1f4;return function(_0x1b3ec1){logger[_0x3cbd('0x29')](_0x1b3ec1[_0x3cbd('0x2a')]);if(_0x1b3ec1[_0x3cbd('0x2b')]){delete _0x1b3ec1[_0x3cbd('0x2b')];}_0x41efa1[_0x3cbd('0x1a')](_0x3009f3)[_0x3cbd('0x2c')](_0x1b3ec1);};}exports[_0x3cbd('0x2d')]=function(_0x517338,_0x298241){var _0x473731={},_0xb101c7={},_0x4b06e4={'count':0x0,'rows':[]};var _0x25a1da=_['map'](db[_0x3cbd('0x2e')][_0x3cbd('0x2f')],function(_0x3d2aaa){return{'name':_0x3d2aaa[_0x3cbd('0x30')],'type':_0x3d2aaa['type'][_0x3cbd('0x31')]};});_0xb101c7[_0x3cbd('0x32')]=_[_0x3cbd('0x33')](_0x25a1da,_0x3cbd('0x2b'));_0xb101c7[_0x3cbd('0x34')]=_['keys'](_0x517338['query']);_0xb101c7[_0x3cbd('0x35')]=_['intersection'](_0xb101c7[_0x3cbd('0x32')],_0xb101c7[_0x3cbd('0x34')]);_0x473731['attributes']=_[_0x3cbd('0x36')](_0xb101c7[_0x3cbd('0x32')],qs[_0x3cbd('0x37')](_0x517338[_0x3cbd('0x34')][_0x3cbd('0x37')]));_0x473731[_0x3cbd('0x38')]=_0x473731[_0x3cbd('0x38')][_0x3cbd('0x39')]?_0x473731[_0x3cbd('0x38')]:_0xb101c7[_0x3cbd('0x32')];if(!_0x517338[_0x3cbd('0x34')][_0x3cbd('0x3a')](_0x3cbd('0x3b'))){_0x473731['limit']=qs[_0x3cbd('0x1e')](_0x517338['query'][_0x3cbd('0x1e')]);_0x473731[_0x3cbd('0x1b')]=qs[_0x3cbd('0x1b')](_0x517338['query'][_0x3cbd('0x1b')]);}_0x473731['order']=qs[_0x3cbd('0x3c')](_0x517338['query'][_0x3cbd('0x3c')]);_0x473731[_0x3cbd('0x3d')]=qs[_0x3cbd('0x35')](_[_0x3cbd('0x3e')](_0x517338[_0x3cbd('0x34')],_0xb101c7[_0x3cbd('0x35')]),_0x25a1da);if(_0x517338[_0x3cbd('0x34')][_0x3cbd('0x3f')]){_0x473731[_0x3cbd('0x3d')]=_[_0x3cbd('0x40')](_0x473731['where'],{'$or':_[_0x3cbd('0x33')](_0x25a1da,function(_0x4afa57){if(_0x4afa57[_0x3cbd('0x41')]!=='VIRTUAL'){var _0x108244={};_0x108244[_0x4afa57[_0x3cbd('0x2b')]]={'$like':'%'+_0x517338[_0x3cbd('0x34')][_0x3cbd('0x3f')]+'%'};return _0x108244;}})});}_0x473731=_[_0x3cbd('0x40')]({},_0x473731,_0x517338[_0x3cbd('0x42')]);var _0x172de0={'where':_0x473731[_0x3cbd('0x3d')]};return db[_0x3cbd('0x2e')]['count'](_0x172de0)['then'](function(_0x2972e0){_0x4b06e4['count']=_0x2972e0;if(_0x517338[_0x3cbd('0x34')][_0x3cbd('0x43')]){_0x473731[_0x3cbd('0x44')]=[{'all':!![]}];}return db[_0x3cbd('0x2e')][_0x3cbd('0x45')](_0x473731);})[_0x3cbd('0x26')](function(_0x465aca){_0x4b06e4[_0x3cbd('0x46')]=_0x465aca;return _0x4b06e4;})[_0x3cbd('0x26')](respondWithFilteredResult(_0x298241,_0x473731))['catch'](handleError(_0x298241,null));};exports['show']=function(_0x563919,_0x1bf6cf){var _0x32d260={'raw':!![],'where':{'id':_0x563919[_0x3cbd('0x47')]['id']}},_0x2903f0={};_0x2903f0[_0x3cbd('0x32')]=_[_0x3cbd('0x48')](db[_0x3cbd('0x2e')]['rawAttributes']);_0x2903f0['query']=_[_0x3cbd('0x48')](_0x563919['query']);_0x2903f0[_0x3cbd('0x35')]=_[_0x3cbd('0x36')](_0x2903f0[_0x3cbd('0x32')],_0x2903f0[_0x3cbd('0x34')]);_0x32d260['attributes']=_['intersection'](_0x2903f0[_0x3cbd('0x32')],qs['fields'](_0x563919[_0x3cbd('0x34')][_0x3cbd('0x37')]));_0x32d260[_0x3cbd('0x38')]=_0x32d260[_0x3cbd('0x38')][_0x3cbd('0x39')]?_0x32d260['attributes']:_0x2903f0[_0x3cbd('0x32')];if(_0x563919[_0x3cbd('0x34')]['includeAll']){_0x32d260[_0x3cbd('0x44')]=[{'all':!![]}];}_0x32d260=_[_0x3cbd('0x40')]({},_0x32d260,_0x563919[_0x3cbd('0x42')]);return db['DeskField']['find'](_0x32d260)[_0x3cbd('0x26')](handleEntityNotFound(_0x1bf6cf,null))[_0x3cbd('0x26')](respondWithResult(_0x1bf6cf,null))[_0x3cbd('0x49')](handleError(_0x1bf6cf,null));};exports['create']=function(_0x21b43b,_0x3dd330){return db['DeskField']['create'](_0x21b43b['body'],{})[_0x3cbd('0x26')](respondWithResult(_0x3dd330,0xc9))[_0x3cbd('0x49')](handleError(_0x3dd330,null));};exports[_0x3cbd('0x25')]=function(_0x333da7,_0x238e05){if(_0x333da7[_0x3cbd('0x4a')]['id']){delete _0x333da7[_0x3cbd('0x4a')]['id'];}return db[_0x3cbd('0x2e')]['find']({'where':{'id':_0x333da7[_0x3cbd('0x47')]['id']}})[_0x3cbd('0x26')](handleEntityNotFound(_0x238e05,null))[_0x3cbd('0x26')](saveUpdates(_0x333da7[_0x3cbd('0x4a')],null))[_0x3cbd('0x26')](respondWithResult(_0x238e05,null))[_0x3cbd('0x49')](handleError(_0x238e05,null));};exports['destroy']=function(_0x5a3191,_0x18c450){return db[_0x3cbd('0x2e')][_0x3cbd('0x4b')]({'where':{'id':_0x5a3191[_0x3cbd('0x47')]['id']}})[_0x3cbd('0x26')](handleEntityNotFound(_0x18c450,null))[_0x3cbd('0x26')](removeEntity(_0x18c450,null))[_0x3cbd('0x49')](handleError(_0x18c450,null));}; \ No newline at end of file +var _0x573a=['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','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto'];(function(_0x3c6675,_0x2d8ce3){var _0x2bb20d=function(_0x21574a){while(--_0x21574a){_0x3c6675['push'](_0x3c6675['shift']());}};_0x2bb20d(++_0x2d8ce3);}(_0x573a,0x124));var _0xa573=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x573a[_0x2405bc];return _0x5272d4;};'use strict';var emlformat=require(_0xa573('0x0'));var rimraf=require(_0xa573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa573('0x2'));var rp=require(_0xa573('0x3'));var moment=require(_0xa573('0x4'));var BPromise=require(_0xa573('0x5'));var Mustache=require(_0xa573('0x6'));var util=require('util');var path=require(_0xa573('0x7'));var sox=require('sox');var csv=require(_0xa573('0x8'));var ejs=require(_0xa573('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa573('0xa'));var crypto=require(_0xa573('0xb'));var jsforce=require(_0xa573('0xc'));var deskjs=require(_0xa573('0xd'));var toCsv=require(_0xa573('0x8'));var querystring=require(_0xa573('0xe'));var Papa=require(_0xa573('0xf'));var Redis=require(_0xa573('0x10'));var authService=require(_0xa573('0x11'));var qs=require(_0xa573('0x12'));var as=require(_0xa573('0x13'));var hardwareService=require(_0xa573('0x14'));var logger=require(_0xa573('0x15'))('api');var utils=require(_0xa573('0x16'));var config=require(_0xa573('0x17'));var licenseUtil=require(_0xa573('0x18'));var db=require(_0xa573('0x19'))['db'];function respondWithStatusCode(_0x38a8ba,_0x3423ed){_0x3423ed=_0x3423ed||0xcc;return function(_0x2dda47){if(_0x2dda47){return _0x38a8ba[_0xa573('0x1a')](_0x3423ed);}return _0x38a8ba[_0xa573('0x1b')](_0x3423ed)[_0xa573('0x1c')]();};}function respondWithResult(_0x5d14d6,_0x1b5253){_0x1b5253=_0x1b5253||0xc8;return function(_0x1ccd64){if(_0x1ccd64){return _0x5d14d6[_0xa573('0x1b')](_0x1b5253)[_0xa573('0x1d')](_0x1ccd64);}};}function respondWithFilteredResult(_0x32c68c,_0x332d8b){return function(_0x19fc97){if(_0x19fc97){var _0x23da4b=typeof _0x332d8b[_0xa573('0x1e')]===_0xa573('0x1f')&&typeof _0x332d8b[_0xa573('0x20')]===_0xa573('0x1f');var _0xe40bdd=_0x19fc97[_0xa573('0x21')];var _0x305c47=_0x23da4b?0x0:_0x332d8b[_0xa573('0x1e')];var _0x470591=_0x23da4b?_0x19fc97[_0xa573('0x21')]:_0x332d8b[_0xa573('0x1e')]+_0x332d8b[_0xa573('0x20')];var _0x2163be;if(_0x470591>=_0xe40bdd){_0x470591=_0xe40bdd;_0x2163be=0xc8;}else{_0x2163be=0xce;}_0x32c68c[_0xa573('0x1b')](_0x2163be);return _0x32c68c[_0xa573('0x22')](_0xa573('0x23'),_0x305c47+'-'+_0x470591+'/'+_0xe40bdd)[_0xa573('0x1d')](_0x19fc97);}return null;};}function patchUpdates(_0x2f4944){return function(_0x5bdb30){try{jsonpatch['apply'](_0x5bdb30,_0x2f4944,!![]);}catch(_0x535e33){return BPromise[_0xa573('0x24')](_0x535e33);}return _0x5bdb30[_0xa573('0x25')]();};}function saveUpdates(_0x453592,_0x2b9149){return function(_0x333fd8){if(_0x333fd8){return _0x333fd8[_0xa573('0x26')](_0x453592)['then'](function(_0x568baa){return _0x568baa;});}return null;};}function removeEntity(_0x305075,_0x4e5840){return function(_0x424270){if(_0x424270){return _0x424270[_0xa573('0x27')]()[_0xa573('0x28')](function(){_0x305075[_0xa573('0x1b')](0xcc)[_0xa573('0x1c')]();});}};}function handleEntityNotFound(_0x533747,_0x4bf797){return function(_0x5842b3){if(!_0x5842b3){_0x533747[_0xa573('0x1a')](0x194);}return _0x5842b3;};}function handleError(_0x588b1f,_0x5c1404){_0x5c1404=_0x5c1404||0x1f4;return function(_0x12d0b1){logger[_0xa573('0x29')](_0x12d0b1[_0xa573('0x2a')]);if(_0x12d0b1[_0xa573('0x2b')]){delete _0x12d0b1['name'];}_0x588b1f['status'](_0x5c1404)[_0xa573('0x2c')](_0x12d0b1);};}exports['index']=function(_0x3f4631,_0x41f9ac){var _0x18148f={},_0x13596f={},_0x33ad90={'count':0x0,'rows':[]};var _0x47fcd6=_[_0xa573('0x2d')](db[_0xa573('0x2e')][_0xa573('0x2f')],function(_0x2aa460){return{'name':_0x2aa460[_0xa573('0x30')],'type':_0x2aa460[_0xa573('0x31')][_0xa573('0x32')]};});_0x13596f[_0xa573('0x33')]=_['map'](_0x47fcd6,_0xa573('0x2b'));_0x13596f['query']=_[_0xa573('0x34')](_0x3f4631[_0xa573('0x35')]);_0x13596f[_0xa573('0x36')]=_[_0xa573('0x37')](_0x13596f['model'],_0x13596f[_0xa573('0x35')]);_0x18148f['attributes']=_[_0xa573('0x37')](_0x13596f['model'],qs[_0xa573('0x38')](_0x3f4631[_0xa573('0x35')][_0xa573('0x38')]));_0x18148f[_0xa573('0x39')]=_0x18148f[_0xa573('0x39')][_0xa573('0x3a')]?_0x18148f[_0xa573('0x39')]:_0x13596f[_0xa573('0x33')];if(!_0x3f4631[_0xa573('0x35')][_0xa573('0x3b')]('nolimit')){_0x18148f[_0xa573('0x20')]=qs[_0xa573('0x20')](_0x3f4631[_0xa573('0x35')]['limit']);_0x18148f[_0xa573('0x1e')]=qs['offset'](_0x3f4631[_0xa573('0x35')]['offset']);}_0x18148f['order']=qs[_0xa573('0x3c')](_0x3f4631[_0xa573('0x35')][_0xa573('0x3c')]);_0x18148f[_0xa573('0x3d')]=qs[_0xa573('0x36')](_['pick'](_0x3f4631['query'],_0x13596f[_0xa573('0x36')]),_0x47fcd6);if(_0x3f4631[_0xa573('0x35')][_0xa573('0x3e')]){_0x18148f[_0xa573('0x3d')]=_['merge'](_0x18148f[_0xa573('0x3d')],{'$or':_['map'](_0x47fcd6,function(_0x4d42b6){if(_0x4d42b6['type']!==_0xa573('0x3f')){var _0x57965e={};_0x57965e[_0x4d42b6[_0xa573('0x2b')]]={'$like':'%'+_0x3f4631[_0xa573('0x35')][_0xa573('0x3e')]+'%'};return _0x57965e;}})});}_0x18148f=_[_0xa573('0x40')]({},_0x18148f,_0x3f4631[_0xa573('0x41')]);var _0x43c8ac={'where':_0x18148f[_0xa573('0x3d')]};return db[_0xa573('0x2e')][_0xa573('0x21')](_0x43c8ac)[_0xa573('0x28')](function(_0x27bece){_0x33ad90[_0xa573('0x21')]=_0x27bece;if(_0x3f4631['query'][_0xa573('0x42')]){_0x18148f[_0xa573('0x43')]=[{'all':!![]}];}return db[_0xa573('0x2e')][_0xa573('0x44')](_0x18148f);})[_0xa573('0x28')](function(_0x118efd){_0x33ad90[_0xa573('0x45')]=_0x118efd;return _0x33ad90;})[_0xa573('0x28')](respondWithFilteredResult(_0x41f9ac,_0x18148f))[_0xa573('0x46')](handleError(_0x41f9ac,null));};exports[_0xa573('0x47')]=function(_0x287204,_0x665dc2){var _0x39d2f8={'raw':!![],'where':{'id':_0x287204[_0xa573('0x48')]['id']}},_0x368490={};_0x368490['model']=_[_0xa573('0x34')](db['DeskField']['rawAttributes']);_0x368490[_0xa573('0x35')]=_['keys'](_0x287204[_0xa573('0x35')]);_0x368490[_0xa573('0x36')]=_[_0xa573('0x37')](_0x368490[_0xa573('0x33')],_0x368490[_0xa573('0x35')]);_0x39d2f8[_0xa573('0x39')]=_[_0xa573('0x37')](_0x368490['model'],qs[_0xa573('0x38')](_0x287204[_0xa573('0x35')]['fields']));_0x39d2f8[_0xa573('0x39')]=_0x39d2f8[_0xa573('0x39')][_0xa573('0x3a')]?_0x39d2f8[_0xa573('0x39')]:_0x368490[_0xa573('0x33')];if(_0x287204[_0xa573('0x35')]['includeAll']){_0x39d2f8[_0xa573('0x43')]=[{'all':!![]}];}_0x39d2f8=_[_0xa573('0x40')]({},_0x39d2f8,_0x287204[_0xa573('0x41')]);return db[_0xa573('0x2e')]['find'](_0x39d2f8)[_0xa573('0x28')](handleEntityNotFound(_0x665dc2,null))[_0xa573('0x28')](respondWithResult(_0x665dc2,null))[_0xa573('0x46')](handleError(_0x665dc2,null));};exports[_0xa573('0x49')]=function(_0x2e3e08,_0x315e3d){return db['DeskField']['create'](_0x2e3e08[_0xa573('0x4a')],{})[_0xa573('0x28')](respondWithResult(_0x315e3d,0xc9))[_0xa573('0x46')](handleError(_0x315e3d,null));};exports[_0xa573('0x26')]=function(_0x9fea38,_0x53f64d){if(_0x9fea38[_0xa573('0x4a')]['id']){delete _0x9fea38[_0xa573('0x4a')]['id'];}return db['DeskField'][_0xa573('0x4b')]({'where':{'id':_0x9fea38[_0xa573('0x48')]['id']}})[_0xa573('0x28')](handleEntityNotFound(_0x53f64d,null))[_0xa573('0x28')](saveUpdates(_0x9fea38[_0xa573('0x4a')],null))[_0xa573('0x28')](respondWithResult(_0x53f64d,null))[_0xa573('0x46')](handleError(_0x53f64d,null));};exports[_0xa573('0x27')]=function(_0x5917cc,_0x5216ef){return db[_0xa573('0x2e')][_0xa573('0x4b')]({'where':{'id':_0x5917cc['params']['id']}})[_0xa573('0x28')](handleEntityNotFound(_0x5216ef,null))[_0xa573('0x28')](removeEntity(_0x5216ef,null))[_0xa573('0x46')](handleError(_0x5216ef,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6c7203e..774ffa5 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 _0x3f3e=['int_desk_fields','desk_unique_index','idField','lodash','../../config/logger','api','bluebird','request-promise','path','./intDeskField.attributes','exports','DeskField'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x3f3e,0xcf));var _0xe3f3=function(_0x5e1b5f,_0x4e3253){_0x5e1b5f=_0x5e1b5f-0x0;var _0x551ae5=_0x3f3e[_0x5e1b5f];return _0x551ae5;};'use strict';var _=require(_0xe3f3('0x0'));var util=require('util');var logger=require(_0xe3f3('0x1'))(_0xe3f3('0x2'));var moment=require('moment');var BPromise=require(_0xe3f3('0x3'));var rp=require(_0xe3f3('0x4'));var fs=require('fs');var path=require(_0xe3f3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe3f3('0x6'));module[_0xe3f3('0x7')]=function(_0x233727,_0x178a80){return _0x233727['define'](_0xe3f3('0x8'),attributes,{'tableName':_0xe3f3('0x9'),'paranoid':![],'indexes':[{'name':_0xe3f3('0xa'),'fields':[_0xe3f3('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc952=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','idField','FieldId'];(function(_0x193109,_0x50a9ca){var _0x4af109=function(_0x21c390){while(--_0x21c390){_0x193109['push'](_0x193109['shift']());}};_0x4af109(++_0x50a9ca);}(_0xc952,0x1a2));var _0x2c95=function(_0x3cb370,_0x381159){_0x3cb370=_0x3cb370-0x0;var _0x1721e7=_0xc952[_0x3cb370];return _0x1721e7;};'use strict';var _=require(_0x2c95('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2c95('0x1'));var moment=require(_0x2c95('0x2'));var BPromise=require(_0x2c95('0x3'));var rp=require(_0x2c95('0x4'));var fs=require('fs');var path=require(_0x2c95('0x5'));var rimraf=require(_0x2c95('0x6'));var config=require(_0x2c95('0x7'));var attributes=require(_0x2c95('0x8'));module['exports']=function(_0x3e57e2,_0x5c6921){return _0x3e57e2['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x2c95('0x9'),_0x2c95('0xa')],'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 7bf22d7..e959b19 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 _0x81f4=['info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x13ed18,_0x53a5a9){var _0x31dd07=function(_0x5625a0){while(--_0x5625a0){_0x13ed18['push'](_0x13ed18['shift']());}};_0x31dd07(++_0x53a5a9);}(_0x81f4,0x1c1));var _0x481f=function(_0x3b6fa6,_0x36d745){_0x3b6fa6=_0x3b6fa6-0x0;var _0x510a40=_0x81f4[_0x3b6fa6];return _0x510a40;};'use strict';var _=require('lodash');var util=require(_0x481f('0x0'));var moment=require(_0x481f('0x1'));var BPromise=require(_0x481f('0x2'));var rs=require(_0x481f('0x3'));var fs=require('fs');var Redis=require(_0x481f('0x4'));var db=require(_0x481f('0x5'))['db'];var utils=require(_0x481f('0x6'));var logger=require('../../config/logger')(_0x481f('0x7'));var config=require(_0x481f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x481f('0x9')][_0x481f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1299b8,_0x3500eb,_0x281b02){return new BPromise(function(_0xda624d,_0x48015b){return client[_0x481f('0xb')](_0x1299b8,_0x281b02)[_0x481f('0xc')](function(_0x113cc6){logger[_0x481f('0xd')](_0x481f('0xe'),_0x3500eb,_0x481f('0xf'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x3500eb,'request\x20sent',JSON[_0x481f('0x10')](_0x113cc6));if(_0x113cc6[_0x481f('0x11')]){if(_0x113cc6['error'][_0x481f('0x12')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x3500eb,_0x113cc6[_0x481f('0x11')]['message']);return _0x48015b(_0x113cc6[_0x481f('0x11')][_0x481f('0x13')]);}logger[_0x481f('0x11')](_0x481f('0xe'),_0x3500eb,_0x113cc6['error'][_0x481f('0x13')]);return _0xda624d(_0x113cc6[_0x481f('0x11')]['message']);}else{logger[_0x481f('0xd')](_0x481f('0xe'),_0x3500eb,_0x481f('0xf'));_0xda624d(_0x113cc6[_0x481f('0x14')][_0x481f('0x13')]);}})['catch'](function(_0x3ec49a){logger[_0x481f('0x11')](_0x481f('0xe'),_0x3500eb,_0x3ec49a);_0x48015b(_0x3ec49a);});});} \ No newline at end of file +var _0x85cc=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird'];(function(_0xb90fb5,_0x11e894){var _0x52875c=function(_0x5c5dec){while(--_0x5c5dec){_0xb90fb5['push'](_0xb90fb5['shift']());}};_0x52875c(++_0x11e894);}(_0x85cc,0x1a1));var _0xc85c=function(_0x6c66a4,_0x2473fe){_0x6c66a4=_0x6c66a4-0x0;var _0x247d8d=_0x85cc[_0x6c66a4];return _0x247d8d;};'use strict';var _=require(_0xc85c('0x0'));var util=require('util');var moment=require(_0xc85c('0x1'));var BPromise=require(_0xc85c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc85c('0x3'));var db=require(_0xc85c('0x4'))['db'];var utils=require(_0xc85c('0x5'));var logger=require('../../config/logger')(_0xc85c('0x6'));var config=require('../../config/environment');var jayson=require(_0xc85c('0x7'));var client=jayson[_0xc85c('0x8')][_0xc85c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x313d37,_0x11ebfb,_0xa9e7ac){return new BPromise(function(_0x5786b3,_0x26ab16){return client['request'](_0x313d37,_0xa9e7ac)[_0xc85c('0xa')](function(_0x26839d){logger['info'](_0xc85c('0xb'),_0x11ebfb,_0xc85c('0xc'));logger[_0xc85c('0xd')](_0xc85c('0xe'),_0x11ebfb,_0xc85c('0xc'),JSON['stringify'](_0x26839d));if(_0x26839d[_0xc85c('0xf')]){if(_0x26839d[_0xc85c('0xf')][_0xc85c('0x10')]===0x1f4){logger['error'](_0xc85c('0xb'),_0x11ebfb,_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);return _0x26ab16(_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);}logger['error'](_0xc85c('0xb'),_0x11ebfb,_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);return _0x5786b3(_0x26839d['error']['message']);}else{logger[_0xc85c('0x12')]('DeskField,\x20%s,\x20%s',_0x11ebfb,_0xc85c('0xc'));_0x5786b3(_0x26839d[_0xc85c('0x13')][_0xc85c('0x11')]);}})[_0xc85c('0x14')](function(_0xdcf8f1){logger['error']('DeskField,\x20%s,\x20%s',_0x11ebfb,_0xdcf8f1);_0x26ab16(_0xdcf8f1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6865c55..2332954 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 _0xddcf=['get','isAuthenticated','index','/:id','show','getConfigurations','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x76b208,_0x1ff1a3){var _0xa22a7b=function(_0x43ecce){while(--_0x43ecce){_0x76b208['push'](_0x76b208['shift']());}};_0xa22a7b(++_0x1ff1a3);}(_0xddcf,0x14f));var _0xfddc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xddcf[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xfddc('0x0'));var util=require(_0xfddc('0x1'));var path=require(_0xfddc('0x2'));var timeout=require('connect-timeout');var express=require(_0xfddc('0x3'));var router=express['Router']();var fs_extra=require(_0xfddc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfddc('0x5'));var config=require('../../config/environment');var controller=require(_0xfddc('0x6'));router[_0xfddc('0x7')]('/',auth[_0xfddc('0x8')](),controller[_0xfddc('0x9')]);router['get'](_0xfddc('0xa'),auth[_0xfddc('0x8')](),controller[_0xfddc('0xb')]);router[_0xfddc('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfddc('0xc')]);router[_0xfddc('0x7')]('/:id/fields',auth[_0xfddc('0x8')](),controller['getFields']);router[_0xfddc('0xd')]('/',auth[_0xfddc('0x8')](),controller[_0xfddc('0xe')]);router['post']('/:id/configurations',auth[_0xfddc('0x8')](),controller['addConfiguration']);router[_0xfddc('0xf')](_0xfddc('0xa'),auth[_0xfddc('0x8')](),controller[_0xfddc('0x10')]);router['delete'](_0xfddc('0xa'),auth[_0xfddc('0x8')](),controller[_0xfddc('0x11')]);module[_0xfddc('0x12')]=router; \ No newline at end of file +var _0xd317=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','update','destroy','util','path','connect-timeout'];(function(_0x49682d,_0x3d3d62){var _0xdbd8ec=function(_0x412ccd){while(--_0x412ccd){_0x49682d['push'](_0x49682d['shift']());}};_0xdbd8ec(++_0x3d3d62);}(_0xd317,0x75));var _0x7d31=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd317[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x7d31('0x0'));var path=require(_0x7d31('0x1'));var timeout=require(_0x7d31('0x2'));var express=require(_0x7d31('0x3'));var router=express[_0x7d31('0x4')]();var fs_extra=require(_0x7d31('0x5'));var auth=require(_0x7d31('0x6'));var interaction=require(_0x7d31('0x7'));var config=require(_0x7d31('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x7d31('0x9')]('/',auth[_0x7d31('0xa')](),controller[_0x7d31('0xb')]);router[_0x7d31('0x9')](_0x7d31('0xc'),auth[_0x7d31('0xa')](),controller[_0x7d31('0xd')]);router['get'](_0x7d31('0xe'),auth[_0x7d31('0xa')](),controller['getConfigurations']);router[_0x7d31('0x9')](_0x7d31('0xf'),auth[_0x7d31('0xa')](),controller['getFields']);router[_0x7d31('0x10')]('/',auth[_0x7d31('0xa')](),controller['create']);router[_0x7d31('0x10')](_0x7d31('0xe'),auth[_0x7d31('0xa')](),controller[_0x7d31('0x11')]);router['put'](_0x7d31('0xc'),auth[_0x7d31('0xa')](),controller[_0x7d31('0x12')]);router['delete']('/:id',auth[_0x7d31('0xa')](),controller[_0x7d31('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e947eac..298a4e9 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 _0x5edb=['STRING','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5edb,0x187));var _0xb5ed=function(_0x55ebd7,_0x1a3892){_0x55ebd7=_0x55ebd7-0x0;var _0x2eed03=_0x5edb[_0x55ebd7];return _0x2eed03;};'use strict';var Sequelize=require(_0xb5ed('0x0'));module[_0xb5ed('0x1')]={'name':{'type':Sequelize[_0xb5ed('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb5ed('0x2')]},'remoteUri':{'type':Sequelize[_0xb5ed('0x2')]},'tenantId':{'type':Sequelize[_0xb5ed('0x2')]},'clientId':{'type':Sequelize[_0xb5ed('0x2')]},'clientSecret':{'type':Sequelize[_0xb5ed('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5ed('0x2')]}}; \ No newline at end of file +var _0x3468=['sequelize','exports','STRING'];(function(_0x2c9112,_0x298c93){var _0x190813=function(_0x54649a){while(--_0x54649a){_0x2c9112['push'](_0x2c9112['shift']());}};_0x190813(++_0x298c93);}(_0x3468,0x14d));var _0x8346=function(_0x54d9d6,_0x165635){_0x54d9d6=_0x54d9d6-0x0;var _0x1b2b84=_0x3468[_0x54d9d6];return _0x1b2b84;};'use strict';var Sequelize=require(_0x8346('0x0'));module[_0x8346('0x1')]={'name':{'type':Sequelize[_0x8346('0x2')]},'username':{'type':Sequelize[_0x8346('0x2')]},'password':{'type':Sequelize[_0x8346('0x2')]},'remoteUri':{'type':Sequelize[_0x8346('0x2')]},'tenantId':{'type':Sequelize[_0x8346('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8346('0x2')]},'serverUrl':{'type':Sequelize[_0x8346('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8346('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0343f3c..e41e34d 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 _0x425d=['subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','error','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','catch','show','include','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname'];(function(_0x4185d8,_0x221f3f){var _0x7b878c=function(_0x25e199){while(--_0x25e199){_0x4185d8['push'](_0x4185d8['shift']());}};_0x7b878c(++_0x221f3f);}(_0x425d,0x1e0));var _0xd425=function(_0x37aed4,_0x254b7d){_0x37aed4=_0x37aed4-0x0;var _0x1ec4f3=_0x425d[_0x37aed4];return _0x1ec4f3;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var integrations=require(_0xd425('0x1d'));function respondWithStatusCode(_0x3cacf7,_0x3b5de8){_0x3b5de8=_0x3b5de8||0xcc;return function(_0x18eafb){if(_0x18eafb){return _0x3cacf7['sendStatus'](_0x3b5de8);}return _0x3cacf7[_0xd425('0x1e')](_0x3b5de8)[_0xd425('0x1f')]();};}function respondWithResult(_0x336dc3,_0x5d3d60){_0x5d3d60=_0x5d3d60||0xc8;return function(_0x309263){if(_0x309263){return _0x336dc3[_0xd425('0x1e')](_0x5d3d60)[_0xd425('0x20')](_0x309263);}};}function respondWithFilteredResult(_0x41f34d,_0x1fc822){return function(_0x538a0a){if(_0x538a0a){var _0x278626=typeof _0x1fc822[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x1fc822[_0xd425('0x23')]==='undefined';var _0x19d7d4=_0x538a0a[_0xd425('0x24')];var _0x467a6c=_0x278626?0x0:_0x1fc822[_0xd425('0x21')];var _0x4e88fa=_0x278626?_0x538a0a['count']:_0x1fc822['offset']+_0x1fc822['limit'];var _0x427304;if(_0x4e88fa>=_0x19d7d4){_0x4e88fa=_0x19d7d4;_0x427304=0xc8;}else{_0x427304=0xce;}_0x41f34d[_0xd425('0x1e')](_0x427304);return _0x41f34d[_0xd425('0x25')]('Content-Range',_0x467a6c+'-'+_0x4e88fa+'/'+_0x19d7d4)[_0xd425('0x20')](_0x538a0a);}return null;};}function patchUpdates(_0x7e982e){return function(_0x5f1e7e){try{jsonpatch[_0xd425('0x26')](_0x5f1e7e,_0x7e982e,!![]);}catch(_0xf2d0ce){return BPromise[_0xd425('0x27')](_0xf2d0ce);}return _0x5f1e7e[_0xd425('0x28')]();};}function saveUpdates(_0x3e93db,_0xb240c4){return function(_0x2480a0){if(_0x2480a0){return _0x2480a0[_0xd425('0x29')](_0x3e93db)[_0xd425('0x2a')](function(_0x2b030b){return _0x2b030b;});}return null;};}function removeEntity(_0x151ad9,_0x40e84b){return function(_0x47f44a){if(_0x47f44a){return _0x47f44a[_0xd425('0x2b')]()[_0xd425('0x2a')](function(){_0x151ad9[_0xd425('0x1e')](0xcc)[_0xd425('0x1f')]();});}};}function handleEntityNotFound(_0x2afcdb,_0x400dd7){return function(_0x3c3402){if(!_0x3c3402){_0x2afcdb['sendStatus'](0x194);}return _0x3c3402;};}function handleError(_0x12f951,_0x177de2){_0x177de2=_0x177de2||0x1f4;return function(_0x1d8861){logger['error'](_0x1d8861[_0xd425('0x2c')]);if(_0x1d8861[_0xd425('0x2d')]){delete _0x1d8861[_0xd425('0x2d')];}_0x12f951[_0xd425('0x1e')](_0x177de2)[_0xd425('0x2e')](_0x1d8861);};}exports[_0xd425('0x2f')]=function(_0x2fd17a,_0x37b63c){var _0x24da23={},_0x1cac61={},_0x482ba6={'count':0x0,'rows':[]};var _0x471e3e=_[_0xd425('0x30')](db[_0xd425('0x31')][_0xd425('0x32')],function(_0x3275b1){return{'name':_0x3275b1[_0xd425('0x33')],'type':_0x3275b1[_0xd425('0x34')][_0xd425('0x35')]};});_0x1cac61[_0xd425('0x36')]=_[_0xd425('0x30')](_0x471e3e,_0xd425('0x2d'));_0x1cac61['query']=_[_0xd425('0x37')](_0x2fd17a[_0xd425('0x38')]);_0x1cac61[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x1cac61[_0xd425('0x36')],_0x1cac61['query']);_0x24da23[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x1cac61['model'],qs['fields'](_0x2fd17a['query'][_0xd425('0x3c')]));_0x24da23[_0xd425('0x3b')]=_0x24da23[_0xd425('0x3b')][_0xd425('0x3d')]?_0x24da23['attributes']:_0x1cac61[_0xd425('0x36')];if(!_0x2fd17a[_0xd425('0x38')][_0xd425('0x3e')](_0xd425('0x3f'))){_0x24da23[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x2fd17a[_0xd425('0x38')]['limit']);_0x24da23[_0xd425('0x21')]=qs['offset'](_0x2fd17a[_0xd425('0x38')][_0xd425('0x21')]);}_0x24da23[_0xd425('0x40')]=qs['sort'](_0x2fd17a[_0xd425('0x38')][_0xd425('0x41')]);_0x24da23[_0xd425('0x42')]=qs[_0xd425('0x39')](_['pick'](_0x2fd17a[_0xd425('0x38')],_0x1cac61[_0xd425('0x39')]),_0x471e3e);if(_0x2fd17a['query']['filter']){_0x24da23['where']=_[_0xd425('0x43')](_0x24da23[_0xd425('0x42')],{'$or':_[_0xd425('0x30')](_0x471e3e,function(_0x588688){if(_0x588688['type']!=='VIRTUAL'){var _0x2fcfb9={};_0x2fcfb9[_0x588688[_0xd425('0x2d')]]={'$like':'%'+_0x2fd17a[_0xd425('0x38')][_0xd425('0x44')]+'%'};return _0x2fcfb9;}})});}_0x24da23=_[_0xd425('0x43')]({},_0x24da23,_0x2fd17a[_0xd425('0x45')]);var _0xeda414={'where':_0x24da23['where']};return db[_0xd425('0x31')][_0xd425('0x24')](_0xeda414)[_0xd425('0x2a')](function(_0x552fd0){_0x482ba6[_0xd425('0x24')]=_0x552fd0;if(_0x2fd17a[_0xd425('0x38')][_0xd425('0x46')]){_0x24da23['include']=[{'all':!![]}];}return db[_0xd425('0x31')][_0xd425('0x47')](_0x24da23);})[_0xd425('0x2a')](function(_0x2d7a2f){_0x482ba6['rows']=_0x2d7a2f;return _0x482ba6;})[_0xd425('0x2a')](respondWithFilteredResult(_0x37b63c,_0x24da23))[_0xd425('0x48')](handleError(_0x37b63c,null));};exports[_0xd425('0x49')]=function(_0x41b25e,_0x3f24fb){var _0x2f6bf7={'raw':![],'where':{'id':_0x41b25e['params']['id']}},_0x2d799b={};_0x2d799b[_0xd425('0x36')]=_[_0xd425('0x37')](db['Dynamics365Account'][_0xd425('0x32')]);_0x2d799b['query']=_['keys'](_0x41b25e[_0xd425('0x38')]);_0x2d799b['filters']=_[_0xd425('0x3a')](_0x2d799b['model'],_0x2d799b[_0xd425('0x38')]);_0x2f6bf7[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x2d799b[_0xd425('0x36')],qs[_0xd425('0x3c')](_0x41b25e['query'][_0xd425('0x3c')]));_0x2f6bf7['attributes']=_0x2f6bf7[_0xd425('0x3b')]['length']?_0x2f6bf7[_0xd425('0x3b')]:_0x2d799b[_0xd425('0x36')];if(_0x41b25e[_0xd425('0x38')][_0xd425('0x46')]){_0x2f6bf7[_0xd425('0x4a')]=[{'all':!![]}];}_0x2f6bf7=_['merge']({},_0x2f6bf7,_0x41b25e[_0xd425('0x45')]);return db[_0xd425('0x31')][_0xd425('0x4b')](_0x2f6bf7)[_0xd425('0x2a')](handleEntityNotFound(_0x3f24fb,null))[_0xd425('0x2a')](respondWithResult(_0x3f24fb,null))['catch'](handleError(_0x3f24fb,null));};exports[_0xd425('0x4c')]=function(_0x177704,_0x1450f2){return db[_0xd425('0x31')][_0xd425('0x4c')](_0x177704[_0xd425('0x4d')],{})['then'](respondWithResult(_0x1450f2,0xc9))[_0xd425('0x48')](handleError(_0x1450f2,null));};exports[_0xd425('0x29')]=function(_0x5bfac6,_0x3f305){if(_0x5bfac6[_0xd425('0x4d')]['id']){delete _0x5bfac6[_0xd425('0x4d')]['id'];}return db[_0xd425('0x31')]['find']({'where':{'id':_0x5bfac6[_0xd425('0x4e')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x3f305,null))[_0xd425('0x2a')](saveUpdates(_0x5bfac6[_0xd425('0x4d')],null))[_0xd425('0x2a')](respondWithResult(_0x3f305,null))['catch'](handleError(_0x3f305,null));};exports['destroy']=function(_0x381bdb,_0x5496d8){return db[_0xd425('0x31')][_0xd425('0x4b')]({'where':{'id':_0x381bdb['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5496d8,null))['then'](removeEntity(_0x5496d8,null))['catch'](handleError(_0x5496d8,null));};exports[_0xd425('0x4f')]=function(_0x111905,_0xe6451f,_0x1bcd39){var _0x3981e6={};var _0x1eb482={};var _0xeb3586;var _0x4118fe;return db['Dynamics365Account'][_0xd425('0x50')]({'where':{'id':_0x111905[_0xd425('0x4e')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0xe6451f,null))[_0xd425('0x2a')](function(_0x7b1080){if(_0x7b1080){_0xeb3586=_0x7b1080;_0x1eb482[_0xd425('0x36')]=_[_0xd425('0x37')](db[_0xd425('0x51')]['rawAttributes']);_0x1eb482['query']=_['keys'](_0x111905[_0xd425('0x38')]);_0x1eb482[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x1eb482[_0xd425('0x36')],_0x1eb482['query']);_0x3981e6['attributes']=_['intersection'](_0x1eb482['model'],qs[_0xd425('0x3c')](_0x111905[_0xd425('0x38')]['fields']));_0x3981e6[_0xd425('0x3b')]=_0x3981e6[_0xd425('0x3b')][_0xd425('0x3d')]?_0x3981e6['attributes']:_0x1eb482['model'];_0x3981e6[_0xd425('0x40')]=qs['sort'](_0x111905['query']['sort']);_0x3981e6[_0xd425('0x42')]=qs[_0xd425('0x39')](_[_0xd425('0x52')](_0x111905['query'],_0x1eb482[_0xd425('0x39')]));if(_0x111905['query'][_0xd425('0x44')]){_0x3981e6[_0xd425('0x42')]=_[_0xd425('0x43')](_0x3981e6[_0xd425('0x42')],{'$or':_[_0xd425('0x30')](_0x3981e6[_0xd425('0x3b')],function(_0xa21f7c){var _0x3ca6a6={};_0x3ca6a6[_0xa21f7c]={'$like':'%'+_0x111905[_0xd425('0x38')]['filter']+'%'};return _0x3ca6a6;})});}_0x3981e6=_[_0xd425('0x43')]({},_0x3981e6,_0x111905[_0xd425('0x45')]);return _0xeb3586[_0xd425('0x4f')](_0x3981e6);}})[_0xd425('0x2a')](function(_0x5c4df8){if(_0x5c4df8){_0x4118fe=_0x5c4df8['length'];if(!_0x111905[_0xd425('0x38')][_0xd425('0x3e')](_0xd425('0x3f'))){_0x3981e6[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x111905[_0xd425('0x38')][_0xd425('0x23')]);_0x3981e6[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x111905[_0xd425('0x38')][_0xd425('0x21')]);}return _0xeb3586[_0xd425('0x4f')](_0x3981e6);}})[_0xd425('0x2a')](function(_0x28979e){if(_0x28979e){return _0x28979e?{'count':_0x4118fe,'rows':_0x28979e}:null;}})['then'](respondWithResult(_0xe6451f,null))[_0xd425('0x48')](handleError(_0xe6451f,null));};exports[_0xd425('0x53')]=function(_0xd2f2e8,_0x4fd793,_0x5aff3c){if(_0xd2f2e8['body']['id']){delete _0xd2f2e8[_0xd425('0x4d')]['id'];}return db[_0xd425('0x31')][_0xd425('0x50')]({'where':{'id':_0xd2f2e8['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x4fd793,null))['then'](function(_0x2811a4){if(_0x2811a4){_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x54')]=_0x2811a4['id'];_0xd2f2e8['body'][_0xd425('0x55')]=integrations[_0xd425('0x56')](_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x57')],_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x34')]);_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x58')]=integrations[_0xd425('0x59')](_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x57')],_0xd2f2e8[_0xd425('0x4d')][_0xd425('0x34')]);return db[_0xd425('0x51')][_0xd425('0x4c')](_0xd2f2e8[_0xd425('0x4d')],{'include':[{'model':db[_0xd425('0x5a')],'as':_0xd425('0x55')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xd425('0x2a')](respondWithResult(_0x4fd793,null))['catch'](handleError(_0x4fd793,null));};exports[_0xd425('0x5b')]=function(_0x1e1a3f,_0xb407bb,_0x1ae1e3){var _0x4c7000=_0x1e1a3f[_0xd425('0x38')][_0xd425('0x5c')];var _0x50b81c=_0x4c7000===_0xd425('0x5d')?_0xd425('0x5e'):_0xd425('0x5f');var _0x4c9d96='';var _0x4c8d7f='';var _0x3ccffe='';var _0x5b1104='';var _0x5e76f5='';var _0x174081='';var _0x4a9215='';var _0x20f6ec='';var _0x46fd93=[_0xd425('0x60'),_0xd425('0x61'),_0xd425('0x62'),_0xd425('0x63'),_0xd425('0x64'),'subject',_0xd425('0x65'),_0xd425('0x66'),_0xd425('0x67'),_0xd425('0x68')];var _0xfcba08=['accountidname',_0xd425('0x69'),_0xd425('0x6a'),'billedserviceunits',_0xd425('0x6b'),_0xd425('0x6c'),'contractdetailidname',_0xd425('0x6d'),_0xd425('0x6e'),_0xd425('0x6f'),_0xd425('0x70'),_0xd425('0x71'),'createdon',_0xd425('0x72'),'createdonbehalfbyyominame',_0xd425('0x73'),_0xd425('0x74'),'customeridyominame',_0xd425('0x75'),_0xd425('0x76'),_0xd425('0x77'),_0xd425('0x78'),'escalatedon','exchangerate',_0xd425('0x79'),_0xd425('0x7a'),_0xd425('0x7b'),'influencescore',_0xd425('0x7c'),_0xd425('0x7d'),'masteridname',_0xd425('0x7e'),'modifiedbyexternalpartyyominame',_0xd425('0x7f'),_0xd425('0x80'),_0xd425('0x81'),_0xd425('0x82'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xd425('0x83'),_0xd425('0x84'),'onholdtime',_0xd425('0x85'),_0xd425('0x86'),'owneridtype',_0xd425('0x87'),_0xd425('0x88'),_0xd425('0x89'),_0xd425('0x8a'),_0xd425('0x8b'),_0xd425('0x8c'),_0xd425('0x8d'),'resolveby','resolvebykpiidname',_0xd425('0x8e'),'responsiblecontactidname',_0xd425('0x8f'),_0xd425('0x90'),'slainvokedidname',_0xd425('0x91'),_0xd425('0x92'),'statecode','statuscode',_0xd425('0x93'),_0xd425('0x94'),_0xd425('0x95'),_0xd425('0x96'),_0xd425('0x97'),_0xd425('0x98'),_0xd425('0x99')];var _0x4425a5=_0x46fd93['concat'](_0xfcba08);return db[_0xd425('0x31')][_0xd425('0x50')]({'where':{'id':_0x1e1a3f['params']['id']},'attributes':['id',_0xd425('0x9a'),_0xd425('0x9b'),_0xd425('0x9c'),_0xd425('0x9d'),_0xd425('0x9e'),_0xd425('0x9f')]})[_0xd425('0x2a')](handleEntityNotFound(_0xb407bb,null))[_0xd425('0x2a')](function(_0x334062){if(_0x334062){_0x20f6ec=_0x334062[_0xd425('0x9c')];var _0x14cebc=_0x20f6ec['slice'](-0x1);if(_0x14cebc==='/'){_0x20f6ec=_0x20f6ec[_0xd425('0xa0')](0x0,_0x20f6ec['lastIndexOf'](_0x14cebc));}_0x4a9215=util['format'](_0xd425('0xa1'),_0x20f6ec);var _0x533bf1={'method':_0xd425('0xa2'),'uri':_0xd425('0xa3')+_0x334062[_0xd425('0x9d')]+_0xd425('0xa4'),'form':{'client_id':_0x334062[_0xd425('0x9e')],'resource':_0x20f6ec,'username':_0x334062[_0xd425('0x9a')],'password':_0x334062[_0xd425('0x9b')],'grant_type':'password','client_secret':_0x334062[_0xd425('0x9f')]},'json':!![]};return rp(_0x533bf1);}})[_0xd425('0x2a')](function(_0x2ef6dc){_0x174081=_0x2ef6dc[_0xd425('0xa5')];var _0x3c40bd={'method':'GET','uri':encodeURI(_0x4a9215+_0xd425('0xa6')+_0x50b81c+'\x27'),'headers':{'Authorization':_0xd425('0xa7')+_0x174081,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0x3c40bd);})[_0xd425('0x2a')](function(_0x1a5f86){var _0x35d401=_0x1a5f86[_0xd425('0xa9')][0x0];var _0x4147eb=_0x35d401[_0xd425('0xaa')];var _0x334226={'method':_0xd425('0xab'),'uri':_0x4a9215+_0xd425('0xac')+_0x4147eb+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd425('0xa7')+_0x174081,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x334226);})[_0xd425('0x2a')](function(_0x18576e){_0x4c9d96=_0x18576e;_0x4c8d7f=_0x4c9d96[_0xd425('0xad')];_0x4c8d7f=_[_0xd425('0xae')](_0x4c8d7f,function(_0xf06395){return!_0x4425a5['includes'](_0xf06395[_0xd425('0xaf')]);});var _0x23fce6=[];var _0x28d433=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x1ea134){if(_0x1ea134[_0xd425('0xb1')]){var _0x5451a1=_0x1ea134['@odata.type'][_0xd425('0xa0')](_0x1ea134['@odata.type'][_0xd425('0xb2')]('.')+0x1);if(_0x5451a1===_0xd425('0xb3')){_0x23fce6['push'](getSelectList(_0x4a9215,_0x4c7000,_0x28d433,_0x4c9d96[_0xd425('0xaa')],_0x1ea134[_0xd425('0xaa')],_0x174081));}}});return Promise['all'](_0x23fce6);})[_0xd425('0x2a')](function(_0x8c2e48){_0x3ccffe=_0x8c2e48[0x0];var _0xca2955=[];var _0x2dcf7b=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x218f79){if(!_['isNil'](_0x218f79[_0xd425('0xb1')])){var _0x52d700=_0x218f79[_0xd425('0xb1')]['substring'](_0x218f79[_0xd425('0xb1')][_0xd425('0xb2')]('.')+0x1);if(_0x52d700===_0xd425('0xb4')){_0xca2955[_0xd425('0xb5')](getBooleanList(_0x4a9215,_0x4c7000,_0x2dcf7b,_0x4c9d96['MetadataId'],_0x218f79['MetadataId'],_0x174081));}}});return Promise['all'](_0xca2955);})['then'](function(_0x2bbad4){_0x5b1104=_0x2bbad4[0x0];var _0x54649c=[];var _0x48b98c=[];_0x4c8d7f[_0xd425('0xb0')](function(_0x3ed4c2){if(_0x3ed4c2[_0xd425('0xb1')]){var _0x284f4b=_0x3ed4c2[_0xd425('0xb1')]['substring'](_0x3ed4c2[_0xd425('0xb1')][_0xd425('0xb2')]('.')+0x1);if(_0x284f4b===_0xd425('0xb6')||_0x284f4b===_0xd425('0xb7')||_0x284f4b===_0xd425('0xb8')||_0x284f4b==='IntegerAttributeMetadata'||_0x284f4b===_0xd425('0xb9')||_0x284f4b===_0xd425('0xba')||_0x284f4b===_0xd425('0xbb')||_0x284f4b==='EntityNameAttributeMetadata'||_0x284f4b===_0xd425('0xbc')||_0x284f4b===_0xd425('0xbd')){_0x54649c[_0xd425('0xb5')](getInputList(_0x4a9215,_0x4c7000,_0x284f4b,_0x48b98c,_0x4c9d96[_0xd425('0xaa')],_0x3ed4c2[_0xd425('0xaa')],_0x174081));}}});return Promise['all'](_0x54649c);})[_0xd425('0x2a')](function(_0x52016e){_0x5e76f5=_0x52016e[0x0];var _0xd086f1=_0x3ccffe[_0xd425('0xbe')](_0x5b1104)['concat'](_0x5e76f5);var _0x4de1d0={'count':_0xd086f1[_0xd425('0x3d')],'rows':_0xd086f1};return _0x4de1d0;})['then'](respondWithResult(_0xb407bb,null))[_0xd425('0x48')](function(_0x224eba){var _0x3308e1=_0x1e1a3f[_0xd425('0x38')]['test']?0x1f4:_0x224eba[_0xd425('0xbf')]||0x1f4;logger[_0xd425('0xc0')](_0x224eba[_0xd425('0x2c')]);delete _0x224eba[_0xd425('0x2d')];if(_0x3308e1===0x191){_0x3308e1=0x190;}_0xb407bb[_0xd425('0x1e')](_0x3308e1)[_0xd425('0x2e')](_0x1e1a3f['query'][_0xd425('0xc1')]?{'message':_0xd425('0xc2'),'statusCode':_0x224eba[_0xd425('0xbf')]}:_0x224eba);});};function getSelectList(_0x45dcba,_0x1c6f22,_0x1594e0,_0x5a6b44,_0x289aad,_0x2fd014){var _0x5bd5f0={'method':_0xd425('0xab'),'uri':_0x45dcba+_0xd425('0xac')+_0x5a6b44+')/Attributes('+_0x289aad+_0xd425('0xc3')+_0xd425('0xc4'),'headers':{'Authorization':_0xd425('0xa7')+_0x2fd014,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0x5bd5f0)['then'](function(_0x437aff){var _0x364b1c=[];var _0x587247=_0x437aff[_0xd425('0xc5')][_0xd425('0xc6')];_0x587247[_0xd425('0xb0')](function(_0x19af43){_0x364b1c[_0xd425('0xb5')]({'name':_0x19af43[_0xd425('0xc7')][_0xd425('0xc8')]['Label'],'value':String(_0x19af43[_0xd425('0xc9')])});});var _0x55d9d2={'id':_0x1c6f22+'_'+_0x437aff[_0xd425('0xaf')],'name':_0x437aff[_0xd425('0xca')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x364b1c};_0x1594e0[_0xd425('0xb5')](_0x55d9d2);return _0x1594e0;});}function getBooleanList(_0x166633,_0x26612e,_0x4de528,_0x30fb5d,_0x53a7f9,_0x55f08b){var _0xb8acb9={'method':_0xd425('0xab'),'uri':_0x166633+_0xd425('0xac')+_0x30fb5d+_0xd425('0xcb')+_0x53a7f9+_0xd425('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x55f08b,'If-None-Match':null,'OData-Version':_0xd425('0xa8')},'json':!![]};return rp(_0xb8acb9)[_0xd425('0x2a')](function(_0x19d488){var _0x542e6b=[];_0x542e6b[_0xd425('0xb5')]({'name':_0x19d488[_0xd425('0xc5')][_0xd425('0xcd')][_0xd425('0xc7')][_0xd425('0xc8')][_0xd425('0xc7')],'value':'true'},{'name':_0x19d488['OptionSet']['FalseOption'][_0xd425('0xc7')]['UserLocalizedLabel'][_0xd425('0xc7')],'value':_0xd425('0xce')});var _0x310085={'id':_0x26612e+'_'+_0x19d488[_0xd425('0xaf')],'name':_0x19d488[_0xd425('0xca')][_0xd425('0xc8')][_0xd425('0xc7')],'custom':![],'options':_0x542e6b};_0x4de528[_0xd425('0xb5')](_0x310085);return _0x4de528;});}function getInputList(_0x30defc,_0x465015,_0x234a9e,_0x4abc48,_0x381d0b,_0x2956ea,_0x112433){var _0x6e6f55={'method':_0xd425('0xab'),'uri':_0x30defc+_0xd425('0xac')+_0x381d0b+')/Attributes('+_0x2956ea+_0xd425('0xcf')+_0x234a9e+_0xd425('0xd0'),'headers':{'Authorization':_0xd425('0xa7')+_0x112433,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x6e6f55)[_0xd425('0x2a')](function(_0x45b627){var _0x47d918={'id':_0x465015+'_'+_0x45b627[_0xd425('0xaf')],'name':_0x45b627[_0xd425('0xca')]['UserLocalizedLabel']?_0x45b627[_0xd425('0xca')][_0xd425('0xc8')]['Label']:_0x45b627[_0xd425('0xaf')],'custom':![],'options':[]};_0x4abc48[_0xd425('0xb5')](_0x47d918);return _0x4abc48;});} \ No newline at end of file +var _0x7f42=['kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','responsiblecontactidyominame','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','/oauth2/token','clientId','access_token','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','stack','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','findOne','Dynamics365Configuration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','ticketType','incident','Incident','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','influencescore'];(function(_0x1a007a,_0x5f3509){var _0x1b3ea8=function(_0x26e958){while(--_0x26e958){_0x1a007a['push'](_0x1a007a['shift']());}};_0x1b3ea8(++_0x5f3509);}(_0x7f42,0x1dd));var _0x27f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f42[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x27f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27f4('0x1'));var jsonpatch=require(_0x27f4('0x2'));var rp=require('request-promise');var moment=require(_0x27f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27f4('0x4'));var util=require('util');var path=require(_0x27f4('0x5'));var sox=require('sox');var csv=require(_0x27f4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27f4('0x7'));var _=require(_0x27f4('0x8'));var squel=require(_0x27f4('0x9'));var crypto=require(_0x27f4('0xa'));var jsforce=require(_0x27f4('0xb'));var deskjs=require(_0x27f4('0xc'));var toCsv=require(_0x27f4('0x6'));var querystring=require(_0x27f4('0xd'));var Papa=require(_0x27f4('0xe'));var Redis=require(_0x27f4('0xf'));var authService=require(_0x27f4('0x10'));var qs=require(_0x27f4('0x11'));var as=require(_0x27f4('0x12'));var hardwareService=require(_0x27f4('0x13'));var logger=require(_0x27f4('0x14'))(_0x27f4('0x15'));var utils=require(_0x27f4('0x16'));var config=require(_0x27f4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x27f4('0x18'));function respondWithStatusCode(_0x1347ea,_0x27cdaa){_0x27cdaa=_0x27cdaa||0xcc;return function(_0x1fed6b){if(_0x1fed6b){return _0x1347ea[_0x27f4('0x19')](_0x27cdaa);}return _0x1347ea[_0x27f4('0x1a')](_0x27cdaa)[_0x27f4('0x1b')]();};}function respondWithResult(_0x40393e,_0x5cd1bd){_0x5cd1bd=_0x5cd1bd||0xc8;return function(_0x4a8ff6){if(_0x4a8ff6){return _0x40393e[_0x27f4('0x1a')](_0x5cd1bd)[_0x27f4('0x1c')](_0x4a8ff6);}};}function respondWithFilteredResult(_0x10f24a,_0x2e8264){return function(_0x4e0e5b){if(_0x4e0e5b){var _0x185ed6=typeof _0x2e8264[_0x27f4('0x1d')]===_0x27f4('0x1e')&&typeof _0x2e8264['limit']===_0x27f4('0x1e');var _0x11b6f7=_0x4e0e5b[_0x27f4('0x1f')];var _0x49e6c0=_0x185ed6?0x0:_0x2e8264[_0x27f4('0x1d')];var _0xe4a7b6=_0x185ed6?_0x4e0e5b['count']:_0x2e8264['offset']+_0x2e8264[_0x27f4('0x20')];var _0x2957a1;if(_0xe4a7b6>=_0x11b6f7){_0xe4a7b6=_0x11b6f7;_0x2957a1=0xc8;}else{_0x2957a1=0xce;}_0x10f24a[_0x27f4('0x1a')](_0x2957a1);return _0x10f24a[_0x27f4('0x21')](_0x27f4('0x22'),_0x49e6c0+'-'+_0xe4a7b6+'/'+_0x11b6f7)[_0x27f4('0x1c')](_0x4e0e5b);}return null;};}function patchUpdates(_0x28e88c){return function(_0x16dd8a){try{jsonpatch[_0x27f4('0x23')](_0x16dd8a,_0x28e88c,!![]);}catch(_0x3ceba6){return BPromise[_0x27f4('0x24')](_0x3ceba6);}return _0x16dd8a[_0x27f4('0x25')]();};}function saveUpdates(_0x22f794,_0x4035f4){return function(_0x2fbe70){if(_0x2fbe70){return _0x2fbe70['update'](_0x22f794)[_0x27f4('0x26')](function(_0x112803){return _0x112803;});}return null;};}function removeEntity(_0x202e8f,_0x3e1dca){return function(_0x45fefa){if(_0x45fefa){return _0x45fefa[_0x27f4('0x27')]()[_0x27f4('0x26')](function(){_0x202e8f[_0x27f4('0x1a')](0xcc)[_0x27f4('0x1b')]();});}};}function handleEntityNotFound(_0x34c943,_0x2fe71b){return function(_0x1e24c3){if(!_0x1e24c3){_0x34c943[_0x27f4('0x19')](0x194);}return _0x1e24c3;};}function handleError(_0x400d8d,_0x2b9e38){_0x2b9e38=_0x2b9e38||0x1f4;return function(_0x19068a){logger[_0x27f4('0x28')](_0x19068a['stack']);if(_0x19068a[_0x27f4('0x29')]){delete _0x19068a['name'];}_0x400d8d[_0x27f4('0x1a')](_0x2b9e38)[_0x27f4('0x2a')](_0x19068a);};}exports[_0x27f4('0x2b')]=function(_0x48beb5,_0x38eb1c){var _0x351dba={},_0x4874f2={},_0x350767={'count':0x0,'rows':[]};var _0x26a2c2=_['map'](db[_0x27f4('0x2c')][_0x27f4('0x2d')],function(_0x5a241e){return{'name':_0x5a241e[_0x27f4('0x2e')],'type':_0x5a241e[_0x27f4('0x2f')]['key']};});_0x4874f2[_0x27f4('0x30')]=_[_0x27f4('0x31')](_0x26a2c2,_0x27f4('0x29'));_0x4874f2['query']=_['keys'](_0x48beb5['query']);_0x4874f2['filters']=_[_0x27f4('0x32')](_0x4874f2[_0x27f4('0x30')],_0x4874f2[_0x27f4('0x33')]);_0x351dba[_0x27f4('0x34')]=_[_0x27f4('0x32')](_0x4874f2[_0x27f4('0x30')],qs[_0x27f4('0x35')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x35')]));_0x351dba[_0x27f4('0x34')]=_0x351dba[_0x27f4('0x34')]['length']?_0x351dba[_0x27f4('0x34')]:_0x4874f2[_0x27f4('0x30')];if(!_0x48beb5[_0x27f4('0x33')]['hasOwnProperty'](_0x27f4('0x36'))){_0x351dba[_0x27f4('0x20')]=qs[_0x27f4('0x20')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x20')]);_0x351dba[_0x27f4('0x1d')]=qs[_0x27f4('0x1d')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x1d')]);}_0x351dba[_0x27f4('0x37')]=qs[_0x27f4('0x38')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x38')]);_0x351dba[_0x27f4('0x39')]=qs[_0x27f4('0x3a')](_[_0x27f4('0x3b')](_0x48beb5['query'],_0x4874f2['filters']),_0x26a2c2);if(_0x48beb5[_0x27f4('0x33')][_0x27f4('0x3c')]){_0x351dba[_0x27f4('0x39')]=_['merge'](_0x351dba[_0x27f4('0x39')],{'$or':_[_0x27f4('0x31')](_0x26a2c2,function(_0x210126){if(_0x210126['type']!==_0x27f4('0x3d')){var _0x187ab8={};_0x187ab8[_0x210126['name']]={'$like':'%'+_0x48beb5[_0x27f4('0x33')][_0x27f4('0x3c')]+'%'};return _0x187ab8;}})});}_0x351dba=_[_0x27f4('0x3e')]({},_0x351dba,_0x48beb5[_0x27f4('0x3f')]);var _0x1f1a9e={'where':_0x351dba['where']};return db[_0x27f4('0x2c')][_0x27f4('0x1f')](_0x1f1a9e)[_0x27f4('0x26')](function(_0x30b68a){_0x350767['count']=_0x30b68a;if(_0x48beb5[_0x27f4('0x33')][_0x27f4('0x40')]){_0x351dba[_0x27f4('0x41')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x27f4('0x42')](_0x351dba);})['then'](function(_0x32f87f){_0x350767[_0x27f4('0x43')]=_0x32f87f;return _0x350767;})[_0x27f4('0x26')](respondWithFilteredResult(_0x38eb1c,_0x351dba))[_0x27f4('0x44')](handleError(_0x38eb1c,null));};exports['show']=function(_0x290c58,_0x3f7051){var _0x28fc2d={'raw':![],'where':{'id':_0x290c58[_0x27f4('0x45')]['id']}},_0xbbcd3={};_0xbbcd3['model']=_[_0x27f4('0x46')](db['Dynamics365Account']['rawAttributes']);_0xbbcd3['query']=_[_0x27f4('0x46')](_0x290c58[_0x27f4('0x33')]);_0xbbcd3[_0x27f4('0x3a')]=_[_0x27f4('0x32')](_0xbbcd3['model'],_0xbbcd3[_0x27f4('0x33')]);_0x28fc2d[_0x27f4('0x34')]=_[_0x27f4('0x32')](_0xbbcd3[_0x27f4('0x30')],qs['fields'](_0x290c58['query'][_0x27f4('0x35')]));_0x28fc2d[_0x27f4('0x34')]=_0x28fc2d[_0x27f4('0x34')][_0x27f4('0x47')]?_0x28fc2d['attributes']:_0xbbcd3[_0x27f4('0x30')];if(_0x290c58['query']['includeAll']){_0x28fc2d['include']=[{'all':!![]}];}_0x28fc2d=_[_0x27f4('0x3e')]({},_0x28fc2d,_0x290c58['options']);return db[_0x27f4('0x2c')][_0x27f4('0x48')](_0x28fc2d)['then'](handleEntityNotFound(_0x3f7051,null))[_0x27f4('0x26')](respondWithResult(_0x3f7051,null))[_0x27f4('0x44')](handleError(_0x3f7051,null));};exports['create']=function(_0x1f424a,_0x9b2015){return db[_0x27f4('0x2c')][_0x27f4('0x49')](_0x1f424a[_0x27f4('0x4a')],{})[_0x27f4('0x26')](respondWithResult(_0x9b2015,0xc9))[_0x27f4('0x44')](handleError(_0x9b2015,null));};exports[_0x27f4('0x4b')]=function(_0x505d5a,_0xd94538){if(_0x505d5a['body']['id']){delete _0x505d5a[_0x27f4('0x4a')]['id'];}return db[_0x27f4('0x2c')][_0x27f4('0x48')]({'where':{'id':_0x505d5a['params']['id']}})['then'](handleEntityNotFound(_0xd94538,null))[_0x27f4('0x26')](saveUpdates(_0x505d5a[_0x27f4('0x4a')],null))['then'](respondWithResult(_0xd94538,null))[_0x27f4('0x44')](handleError(_0xd94538,null));};exports['destroy']=function(_0x4714df,_0x21bb87){return db[_0x27f4('0x2c')][_0x27f4('0x48')]({'where':{'id':_0x4714df[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x21bb87,null))[_0x27f4('0x26')](removeEntity(_0x21bb87,null))['catch'](handleError(_0x21bb87,null));};exports['getConfigurations']=function(_0x1d3284,_0x4d65fa,_0x2d54b0){var _0x1ddae2={};var _0x580903={};var _0x2b0719;var _0x102b48;return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x1d3284[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x4d65fa,null))[_0x27f4('0x26')](function(_0x31964f){if(_0x31964f){_0x2b0719=_0x31964f;_0x580903[_0x27f4('0x30')]=_[_0x27f4('0x46')](db[_0x27f4('0x4d')][_0x27f4('0x2d')]);_0x580903[_0x27f4('0x33')]=_[_0x27f4('0x46')](_0x1d3284[_0x27f4('0x33')]);_0x580903['filters']=_[_0x27f4('0x32')](_0x580903[_0x27f4('0x30')],_0x580903['query']);_0x1ddae2[_0x27f4('0x34')]=_['intersection'](_0x580903['model'],qs[_0x27f4('0x35')](_0x1d3284['query']['fields']));_0x1ddae2['attributes']=_0x1ddae2['attributes'][_0x27f4('0x47')]?_0x1ddae2['attributes']:_0x580903[_0x27f4('0x30')];_0x1ddae2['order']=qs[_0x27f4('0x38')](_0x1d3284[_0x27f4('0x33')][_0x27f4('0x38')]);_0x1ddae2[_0x27f4('0x39')]=qs['filters'](_[_0x27f4('0x3b')](_0x1d3284[_0x27f4('0x33')],_0x580903['filters']));if(_0x1d3284[_0x27f4('0x33')][_0x27f4('0x3c')]){_0x1ddae2['where']=_['merge'](_0x1ddae2[_0x27f4('0x39')],{'$or':_[_0x27f4('0x31')](_0x1ddae2['attributes'],function(_0x4784d1){var _0x5c4b99={};_0x5c4b99[_0x4784d1]={'$like':'%'+_0x1d3284[_0x27f4('0x33')][_0x27f4('0x3c')]+'%'};return _0x5c4b99;})});}_0x1ddae2=_[_0x27f4('0x3e')]({},_0x1ddae2,_0x1d3284[_0x27f4('0x3f')]);return _0x2b0719[_0x27f4('0x4e')](_0x1ddae2);}})['then'](function(_0x1deb54){if(_0x1deb54){_0x102b48=_0x1deb54['length'];if(!_0x1d3284[_0x27f4('0x33')][_0x27f4('0x4f')](_0x27f4('0x36'))){_0x1ddae2['limit']=qs[_0x27f4('0x20')](_0x1d3284[_0x27f4('0x33')]['limit']);_0x1ddae2[_0x27f4('0x1d')]=qs[_0x27f4('0x1d')](_0x1d3284[_0x27f4('0x33')][_0x27f4('0x1d')]);}return _0x2b0719[_0x27f4('0x4e')](_0x1ddae2);}})[_0x27f4('0x26')](function(_0xb1731e){if(_0xb1731e){return _0xb1731e?{'count':_0x102b48,'rows':_0xb1731e}:null;}})[_0x27f4('0x26')](respondWithResult(_0x4d65fa,null))[_0x27f4('0x44')](handleError(_0x4d65fa,null));};exports[_0x27f4('0x50')]=function(_0x155e80,_0x489d79,_0x110ce1){if(_0x155e80[_0x27f4('0x4a')]['id']){delete _0x155e80[_0x27f4('0x4a')]['id'];}return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x155e80[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x489d79,null))['then'](function(_0x1728b7){if(_0x1728b7){_0x155e80['body'][_0x27f4('0x51')]=_0x1728b7['id'];_0x155e80[_0x27f4('0x4a')][_0x27f4('0x52')]=integrations['getSubjects'](_0x155e80[_0x27f4('0x4a')][_0x27f4('0x53')],_0x155e80[_0x27f4('0x4a')][_0x27f4('0x2f')]);_0x155e80[_0x27f4('0x4a')]['Descriptions']=integrations[_0x27f4('0x54')](_0x155e80[_0x27f4('0x4a')][_0x27f4('0x53')],_0x155e80[_0x27f4('0x4a')][_0x27f4('0x2f')]);return db[_0x27f4('0x4d')][_0x27f4('0x49')](_0x155e80[_0x27f4('0x4a')],{'include':[{'model':db[_0x27f4('0x55')],'as':'Subjects'},{'model':db[_0x27f4('0x55')],'as':_0x27f4('0x56')}]});}return null;})[_0x27f4('0x26')](respondWithResult(_0x489d79,null))['catch'](handleError(_0x489d79,null));};exports['getFields']=function(_0x271f9e,_0x17bc43,_0x1e8b82){var _0x19b3d3=_0x271f9e['query'][_0x27f4('0x57')];var _0x574a1b=_0x19b3d3===_0x27f4('0x58')?_0x27f4('0x59'):'PhoneCall';var _0x4fdcf6='';var _0x210e90='';var _0x38efe5='';var _0x5995f7='';var _0x231653='';var _0x178cfe='';var _0x2d9e3b='';var _0x3275e1='';var _0x1699d3=[_0x27f4('0x5a'),_0x27f4('0x5b'),'customerid',_0x27f4('0x5c'),_0x27f4('0x5d'),_0x27f4('0x5e'),_0x27f4('0x5f'),_0x27f4('0x60'),'directioncode','phonecall_activity_parties'];var _0x39e9e4=['accountidname',_0x27f4('0x61'),_0x27f4('0x62'),_0x27f4('0x63'),'contactidname',_0x27f4('0x64'),_0x27f4('0x65'),'contractidname','createdbyexternalpartyname',_0x27f4('0x66'),_0x27f4('0x67'),_0x27f4('0x68'),_0x27f4('0x69'),_0x27f4('0x6a'),_0x27f4('0x6b'),'customeridname',_0x27f4('0x6c'),_0x27f4('0x6d'),_0x27f4('0x6e'),'entitlementidname',_0x27f4('0x6f'),_0x27f4('0x70'),'escalatedon','exchangerate',_0x27f4('0x71'),_0x27f4('0x72'),_0x27f4('0x73'),_0x27f4('0x74'),_0x27f4('0x75'),_0x27f4('0x76'),'masteridname',_0x27f4('0x77'),_0x27f4('0x78'),_0x27f4('0x79'),_0x27f4('0x7a'),'modifiedon',_0x27f4('0x7b'),_0x27f4('0x7c'),_0x27f4('0x7d'),_0x27f4('0x7e'),_0x27f4('0x7f'),_0x27f4('0x80'),_0x27f4('0x81'),_0x27f4('0x82'),'owneridtype',_0x27f4('0x83'),'parentcaseidname',_0x27f4('0x84'),'primarycontactidyominame',_0x27f4('0x85'),_0x27f4('0x86'),_0x27f4('0x87'),'resolveby','resolvebykpiidname',_0x27f4('0x88'),_0x27f4('0x89'),_0x27f4('0x8a'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode',_0x27f4('0x8b'),_0x27f4('0x8c'),_0x27f4('0x8d'),_0x27f4('0x8e'),_0x27f4('0x8f'),_0x27f4('0x90'),'versionnumber'];var _0x2504b7=_0x1699d3['concat'](_0x39e9e4);return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x271f9e[_0x27f4('0x45')]['id']},'attributes':['id',_0x27f4('0x91'),_0x27f4('0x92'),_0x27f4('0x93'),_0x27f4('0x94'),'clientId',_0x27f4('0x95')]})['then'](handleEntityNotFound(_0x17bc43,null))[_0x27f4('0x26')](function(_0x5dbbec){if(_0x5dbbec){_0x3275e1=_0x5dbbec[_0x27f4('0x93')];var _0x1e53a6=_0x3275e1[_0x27f4('0x96')](-0x1);if(_0x1e53a6==='/'){_0x3275e1=_0x3275e1[_0x27f4('0x97')](0x0,_0x3275e1[_0x27f4('0x98')](_0x1e53a6));}_0x2d9e3b=util['format'](_0x27f4('0x99'),_0x3275e1);var _0x6dd064={'method':_0x27f4('0x9a'),'uri':'https://login.microsoftonline.com/'+_0x5dbbec[_0x27f4('0x94')]+_0x27f4('0x9b'),'form':{'client_id':_0x5dbbec[_0x27f4('0x9c')],'resource':_0x3275e1,'username':_0x5dbbec[_0x27f4('0x91')],'password':_0x5dbbec[_0x27f4('0x92')],'grant_type':_0x27f4('0x92'),'client_secret':_0x5dbbec[_0x27f4('0x95')]},'json':!![]};return rp(_0x6dd064);}})['then'](function(_0x2ce2a8){_0x178cfe=_0x2ce2a8[_0x27f4('0x9d')];var _0x51ccd2={'method':'GET','uri':encodeURI(_0x2d9e3b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x574a1b+'\x27'),'headers':{'Authorization':_0x27f4('0x9e')+_0x178cfe,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x51ccd2);})[_0x27f4('0x26')](function(_0x139c6e){var _0x27a360=_0x139c6e[_0x27f4('0xa0')][0x0];var _0x354007=_0x27a360[_0x27f4('0xa1')];var _0x220a4b={'method':_0x27f4('0xa2'),'uri':_0x2d9e3b+_0x27f4('0xa3')+_0x354007+_0x27f4('0xa4'),'headers':{'Authorization':_0x27f4('0x9e')+_0x178cfe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x220a4b);})[_0x27f4('0x26')](function(_0x3e4a0e){_0x4fdcf6=_0x3e4a0e;_0x210e90=_0x4fdcf6[_0x27f4('0xa5')];_0x210e90=_['remove'](_0x210e90,function(_0x39f5bc){return!_0x2504b7[_0x27f4('0xa6')](_0x39f5bc[_0x27f4('0xa7')]);});var _0x337811=[];var _0xc89d88=[];_0x210e90[_0x27f4('0xa8')](function(_0x14829f){if(_0x14829f[_0x27f4('0xa9')]){var _0x4ea92a=_0x14829f[_0x27f4('0xa9')]['substring'](_0x14829f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x4ea92a==='PicklistAttributeMetadata'){_0x337811[_0x27f4('0xaa')](getSelectList(_0x2d9e3b,_0x19b3d3,_0xc89d88,_0x4fdcf6['MetadataId'],_0x14829f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x337811);})[_0x27f4('0x26')](function(_0x1eebe4){_0x38efe5=_0x1eebe4[0x0];var _0x56431=[];var _0x240708=[];_0x210e90[_0x27f4('0xa8')](function(_0x47b64f){if(!_[_0x27f4('0xac')](_0x47b64f['@odata.type'])){var _0x2e82ae=_0x47b64f['@odata.type'][_0x27f4('0x97')](_0x47b64f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x2e82ae==='BooleanAttributeMetadata'){_0x56431[_0x27f4('0xaa')](getBooleanList(_0x2d9e3b,_0x19b3d3,_0x240708,_0x4fdcf6[_0x27f4('0xa1')],_0x47b64f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x56431);})['then'](function(_0x2008a4){_0x5995f7=_0x2008a4[0x0];var _0x3f7b15=[];var _0x3b11bd=[];_0x210e90['forEach'](function(_0x30607f){if(_0x30607f[_0x27f4('0xa9')]){var _0x33605d=_0x30607f[_0x27f4('0xa9')][_0x27f4('0x97')](_0x30607f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x33605d===_0x27f4('0xad')||_0x33605d==='DoubleAttributeMetadata'||_0x33605d===_0x27f4('0xae')||_0x33605d==='IntegerAttributeMetadata'||_0x33605d===_0x27f4('0xaf')||_0x33605d===_0x27f4('0xb0')||_0x33605d===_0x27f4('0xb1')||_0x33605d===_0x27f4('0xb2')||_0x33605d===_0x27f4('0xb3')||_0x33605d===_0x27f4('0xb4')){_0x3f7b15[_0x27f4('0xaa')](getInputList(_0x2d9e3b,_0x19b3d3,_0x33605d,_0x3b11bd,_0x4fdcf6['MetadataId'],_0x30607f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x3f7b15);})[_0x27f4('0x26')](function(_0x2e94d4){_0x231653=_0x2e94d4[0x0];var _0x400d81=_0x38efe5[_0x27f4('0xb5')](_0x5995f7)['concat'](_0x231653);var _0x3716e1={'count':_0x400d81['length'],'rows':_0x400d81};return _0x3716e1;})[_0x27f4('0x26')](respondWithResult(_0x17bc43,null))['catch'](function(_0x2a6a90){var _0x4bb880=_0x271f9e['query'][_0x27f4('0xb6')]?0x1f4:_0x2a6a90['statusCode']||0x1f4;logger[_0x27f4('0x28')](_0x2a6a90[_0x27f4('0xb7')]);delete _0x2a6a90['name'];if(_0x4bb880===0x191){_0x4bb880=0x190;}_0x17bc43[_0x27f4('0x1a')](_0x4bb880)['send'](_0x271f9e[_0x27f4('0x33')][_0x27f4('0xb6')]?{'message':_0x27f4('0xb8'),'statusCode':_0x2a6a90[_0x27f4('0xb9')]}:_0x2a6a90);});};function getSelectList(_0x2b5539,_0x14195e,_0x4a478e,_0x431959,_0xb6553f,_0x18e5e1){var _0x343724={'method':_0x27f4('0xa2'),'uri':_0x2b5539+_0x27f4('0xa3')+_0x431959+_0x27f4('0xba')+_0xb6553f+_0x27f4('0xbb')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x27f4('0x9e')+_0x18e5e1,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x343724)[_0x27f4('0x26')](function(_0xd07b9d){var _0x3a6399=[];var _0x1e8d1b=_0xd07b9d[_0x27f4('0xbc')][_0x27f4('0xbd')];_0x1e8d1b[_0x27f4('0xa8')](function(_0x32506a){_0x3a6399['push']({'name':_0x32506a[_0x27f4('0xbe')][_0x27f4('0xbf')][_0x27f4('0xbe')],'value':String(_0x32506a[_0x27f4('0xc0')])});});var _0x57d11f={'id':_0x14195e+'_'+_0xd07b9d[_0x27f4('0xa7')],'name':_0xd07b9d[_0x27f4('0xc1')][_0x27f4('0xbf')][_0x27f4('0xbe')],'custom':![],'options':_0x3a6399};_0x4a478e[_0x27f4('0xaa')](_0x57d11f);return _0x4a478e;});}function getBooleanList(_0x2b5926,_0x1fbbb7,_0x4a4a19,_0x19b143,_0x2deb4c,_0x548abe){var _0x4fe687={'method':'GET','uri':_0x2b5926+_0x27f4('0xa3')+_0x19b143+')/Attributes('+_0x2deb4c+_0x27f4('0xc2'),'headers':{'Authorization':_0x27f4('0x9e')+_0x548abe,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x4fe687)['then'](function(_0x4e72df){var _0x10025d=[];_0x10025d[_0x27f4('0xaa')]({'name':_0x4e72df[_0x27f4('0xbc')]['TrueOption'][_0x27f4('0xbe')][_0x27f4('0xbf')][_0x27f4('0xbe')],'value':_0x27f4('0xc3')},{'name':_0x4e72df[_0x27f4('0xbc')]['FalseOption'][_0x27f4('0xbe')][_0x27f4('0xbf')]['Label'],'value':_0x27f4('0xc4')});var _0x1d7082={'id':_0x1fbbb7+'_'+_0x4e72df[_0x27f4('0xa7')],'name':_0x4e72df[_0x27f4('0xc1')]['UserLocalizedLabel'][_0x27f4('0xbe')],'custom':![],'options':_0x10025d};_0x4a4a19[_0x27f4('0xaa')](_0x1d7082);return _0x4a4a19;});}function getInputList(_0xcf7a35,_0x328ab3,_0x5815fd,_0x533b20,_0x338a6d,_0x2e171f,_0x585975){var _0x3129f8={'method':_0x27f4('0xa2'),'uri':_0xcf7a35+_0x27f4('0xa3')+_0x338a6d+_0x27f4('0xba')+_0x2e171f+')/Microsoft.Dynamics.CRM.'+_0x5815fd+_0x27f4('0xc5'),'headers':{'Authorization':_0x27f4('0x9e')+_0x585975,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x3129f8)['then'](function(_0x23300e){var _0x48239a={'id':_0x328ab3+'_'+_0x23300e[_0x27f4('0xa7')],'name':_0x23300e[_0x27f4('0xc1')][_0x27f4('0xbf')]?_0x23300e[_0x27f4('0xc1')][_0x27f4('0xbf')]['Label']:_0x23300e[_0x27f4('0xa7')],'custom':![],'options':[]};_0x533b20[_0x27f4('0xaa')](_0x48239a);return _0x533b20;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e5790d4..b8718a0 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x508754,_0x790cff){var _0x14367d=function(_0x3cce38){while(--_0x3cce38){_0x508754['push'](_0x508754['shift']());}};_0x14367d(++_0x790cff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x6a22b8,_0x2582f6){var _0x4e89d4=function(_0x451fe5){while(--_0x451fe5){_0x6a22b8['push'](_0x6a22b8['shift']());}};_0x4e89d4(++_0x2582f6);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 8ed3964..a5982e4 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 _0x1be9=['GetDynamics365Account','stringify','ShowDynamics365Account','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','Dynamics365Account','findAll','raw','options','where','include','map','attributes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1be9,0x1e4));var _0x91be=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1be9[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x91be('0x0'));var util=require(_0x91be('0x1'));var moment=require('moment');var BPromise=require(_0x91be('0x2'));var rs=require(_0x91be('0x3'));var fs=require('fs');var Redis=require(_0x91be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91be('0x5'));var logger=require('../../config/logger')(_0x91be('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x91be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5820da,_0x20f46c,_0xd033e0){return new BPromise(function(_0x306b7c,_0x35606d){return client[_0x91be('0x8')](_0x5820da,_0xd033e0)[_0x91be('0x9')](function(_0x187db0){logger[_0x91be('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x20f46c,_0x91be('0xb'));logger[_0x91be('0xc')](_0x91be('0xd'),_0x20f46c,'request\x20sent',JSON['stringify'](_0x187db0));if(_0x187db0[_0x91be('0xe')]){if(_0x187db0['error'][_0x91be('0xf')]===0x1f4){logger[_0x91be('0xe')](_0x91be('0x10'),_0x20f46c,_0x187db0[_0x91be('0xe')][_0x91be('0x11')]);return _0x35606d(_0x187db0['error']['message']);}logger['error'](_0x91be('0x10'),_0x20f46c,_0x187db0[_0x91be('0xe')][_0x91be('0x11')]);return _0x306b7c(_0x187db0['error'][_0x91be('0x11')]);}else{logger['info'](_0x91be('0x10'),_0x20f46c,_0x91be('0xb'));_0x306b7c(_0x187db0[_0x91be('0x12')][_0x91be('0x11')]);}})[_0x91be('0x13')](function(_0xbd0544){logger['error'](_0x91be('0x10'),_0x20f46c,_0xbd0544);_0x35606d(_0xbd0544);});});}exports['GetDynamics365Account']=function(_0x4ee624){var _0x1066e9=this;return new Promise(function(_0x35f28f,_0x543612){return db[_0x91be('0x14')][_0x91be('0x15')]({'raw':_0x4ee624['options']?_0x4ee624['options'][_0x91be('0x16')]===undefined?!![]:![]:!![],'where':_0x4ee624['options']?_0x4ee624[_0x91be('0x17')][_0x91be('0x18')]||null:null,'attributes':_0x4ee624[_0x91be('0x17')]?_0x4ee624['options']['attributes']||null:null,'limit':_0x4ee624[_0x91be('0x17')]?_0x4ee624[_0x91be('0x17')]['limit']||null:null,'include':_0x4ee624[_0x91be('0x17')]?_0x4ee624['options'][_0x91be('0x19')]?_[_0x91be('0x1a')](_0x4ee624[_0x91be('0x17')][_0x91be('0x19')],function(_0x1fa3e2){return{'model':db[_0x1fa3e2['model']],'as':_0x1fa3e2['as'],'attributes':_0x1fa3e2[_0x91be('0x1b')],'include':_0x1fa3e2[_0x91be('0x19')]?_[_0x91be('0x1a')](_0x1fa3e2[_0x91be('0x19')],function(_0x566609){return{'model':db[_0x566609['model']],'as':_0x566609['as'],'attributes':_0x566609[_0x91be('0x1b')],'include':_0x566609[_0x91be('0x19')]?_['map'](_0x566609[_0x91be('0x19')],function(_0x54aea9){return{'model':db[_0x54aea9['model']],'as':_0x54aea9['as'],'attributes':_0x54aea9[_0x91be('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x91be('0x9')](function(_0x31b678){logger[_0x91be('0xa')](_0x91be('0x1c'),_0x4ee624);logger[_0x91be('0xc')](_0x91be('0x1c'),_0x4ee624,JSON[_0x91be('0x1d')](_0x31b678));_0x35f28f(_0x31b678);})[_0x91be('0x13')](function(_0x117f68){logger['error'](_0x91be('0x1c'),_0x117f68[_0x91be('0x11')],_0x4ee624);_0x543612(_0x1066e9[_0x91be('0xe')](0x1f4,_0x117f68[_0x91be('0x11')]));});});};exports[_0x91be('0x1e')]=function(_0x32d4e2){var _0x2d2bcd=this;return new Promise(function(_0x7ecb99,_0x1ec3eb){return db[_0x91be('0x14')]['find']({'raw':_0x32d4e2[_0x91be('0x17')]?_0x32d4e2[_0x91be('0x17')][_0x91be('0x16')]===undefined?!![]:![]:!![],'where':_0x32d4e2['options']?_0x32d4e2['options'][_0x91be('0x18')]||null:null,'attributes':_0x32d4e2[_0x91be('0x17')]?_0x32d4e2[_0x91be('0x17')]['attributes']||null:null,'include':_0x32d4e2['options']?_0x32d4e2[_0x91be('0x17')][_0x91be('0x19')]?_[_0x91be('0x1a')](_0x32d4e2[_0x91be('0x17')][_0x91be('0x19')],function(_0x44652e){return{'model':db[_0x44652e[_0x91be('0x1f')]],'as':_0x44652e['as'],'attributes':_0x44652e[_0x91be('0x1b')],'include':_0x44652e[_0x91be('0x19')]?_[_0x91be('0x1a')](_0x44652e[_0x91be('0x19')],function(_0x3d68d3){return{'model':db[_0x3d68d3[_0x91be('0x1f')]],'as':_0x3d68d3['as'],'attributes':_0x3d68d3[_0x91be('0x1b')],'include':_0x3d68d3[_0x91be('0x19')]?_[_0x91be('0x1a')](_0x3d68d3[_0x91be('0x19')],function(_0x13b450){return{'model':db[_0x13b450[_0x91be('0x1f')]],'as':_0x13b450['as'],'attributes':_0x13b450['attributes']};}):[]};}):[]};}):[]:[]})[_0x91be('0x9')](function(_0x133e90){logger[_0x91be('0xa')](_0x91be('0x1e'),_0x32d4e2);logger[_0x91be('0xc')](_0x91be('0x1e'),_0x32d4e2,JSON[_0x91be('0x1d')](_0x133e90));_0x7ecb99(_0x133e90);})[_0x91be('0x13')](function(_0x1d73f1){logger[_0x91be('0xe')](_0x91be('0x1e'),_0x1d73f1['message'],_0x32d4e2);_0x1ec3eb(_0x2d2bcd[_0x91be('0xe')](0x1f4,_0x1d73f1[_0x91be('0x11')]));});});}; \ No newline at end of file +var _0x2a01=['jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDynamics365Account','options','where','attributes','limit','include','model','ShowDynamics365Account','Dynamics365Account','find','map','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x2a01,0x119));var _0x12a0=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x2a01[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0x12a0('0x0'));var moment=require(_0x12a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x12a0('0x3'));var logger=require(_0x12a0('0x4'))(_0x12a0('0x5'));var config=require(_0x12a0('0x6'));var jayson=require(_0x12a0('0x7'));var client=jayson[_0x12a0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1074b6,_0xf4e5a7,_0x3f0b88){return new BPromise(function(_0x5a6f7f,_0x32a907){return client[_0x12a0('0x9')](_0x1074b6,_0x3f0b88)[_0x12a0('0xa')](function(_0x3714a9){logger[_0x12a0('0xb')](_0x12a0('0xc'),_0xf4e5a7,_0x12a0('0xd'));logger[_0x12a0('0xe')](_0x12a0('0xf'),_0xf4e5a7,'request\x20sent',JSON[_0x12a0('0x10')](_0x3714a9));if(_0x3714a9[_0x12a0('0x11')]){if(_0x3714a9[_0x12a0('0x11')]['code']===0x1f4){logger[_0x12a0('0x11')](_0x12a0('0xc'),_0xf4e5a7,_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);return _0x32a907(_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);}logger[_0x12a0('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0xf4e5a7,_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);return _0x5a6f7f(_0x3714a9['error']['message']);}else{logger[_0x12a0('0xb')](_0x12a0('0xc'),_0xf4e5a7,_0x12a0('0xd'));_0x5a6f7f(_0x3714a9[_0x12a0('0x13')][_0x12a0('0x12')]);}})[_0x12a0('0x14')](function(_0xa42c10){logger[_0x12a0('0x11')](_0x12a0('0xc'),_0xf4e5a7,_0xa42c10);_0x32a907(_0xa42c10);});});}exports[_0x12a0('0x15')]=function(_0xbaa831){var _0x5dac4b=this;return new Promise(function(_0x18999b,_0xa33638){return db['Dynamics365Account']['findAll']({'raw':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options']['raw']===undefined?!![]:![]:!![],'where':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options'][_0x12a0('0x17')]||null:null,'attributes':_0xbaa831['options']?_0xbaa831[_0x12a0('0x16')][_0x12a0('0x18')]||null:null,'limit':_0xbaa831['options']?_0xbaa831['options'][_0x12a0('0x19')]||null:null,'include':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options']['include']?_['map'](_0xbaa831['options'][_0x12a0('0x1a')],function(_0x41d898){return{'model':db[_0x41d898[_0x12a0('0x1b')]],'as':_0x41d898['as'],'attributes':_0x41d898[_0x12a0('0x18')],'include':_0x41d898['include']?_['map'](_0x41d898['include'],function(_0x5900bf){return{'model':db[_0x5900bf['model']],'as':_0x5900bf['as'],'attributes':_0x5900bf['attributes'],'include':_0x5900bf['include']?_['map'](_0x5900bf['include'],function(_0x56ce82){return{'model':db[_0x56ce82[_0x12a0('0x1b')]],'as':_0x56ce82['as'],'attributes':_0x56ce82[_0x12a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x12a0('0xa')](function(_0x36a9f6){logger[_0x12a0('0xb')](_0x12a0('0x15'),_0xbaa831);logger['debug'](_0x12a0('0x15'),_0xbaa831,JSON['stringify'](_0x36a9f6));_0x18999b(_0x36a9f6);})['catch'](function(_0x51b588){logger[_0x12a0('0x11')](_0x12a0('0x15'),_0x51b588[_0x12a0('0x12')],_0xbaa831);_0xa33638(_0x5dac4b[_0x12a0('0x11')](0x1f4,_0x51b588[_0x12a0('0x12')]));});});};exports[_0x12a0('0x1c')]=function(_0x5a4464){var _0x276f02=this;return new Promise(function(_0x44aeaf,_0xc3546e){return db[_0x12a0('0x1d')][_0x12a0('0x1e')]({'raw':_0x5a4464['options']?_0x5a4464[_0x12a0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5a4464['options']?_0x5a4464[_0x12a0('0x16')][_0x12a0('0x17')]||null:null,'attributes':_0x5a4464[_0x12a0('0x16')]?_0x5a4464[_0x12a0('0x16')][_0x12a0('0x18')]||null:null,'include':_0x5a4464[_0x12a0('0x16')]?_0x5a4464[_0x12a0('0x16')]['include']?_['map'](_0x5a4464[_0x12a0('0x16')][_0x12a0('0x1a')],function(_0x202e13){return{'model':db[_0x202e13[_0x12a0('0x1b')]],'as':_0x202e13['as'],'attributes':_0x202e13[_0x12a0('0x18')],'include':_0x202e13['include']?_[_0x12a0('0x1f')](_0x202e13[_0x12a0('0x1a')],function(_0xaa71be){return{'model':db[_0xaa71be[_0x12a0('0x1b')]],'as':_0xaa71be['as'],'attributes':_0xaa71be['attributes'],'include':_0xaa71be['include']?_[_0x12a0('0x1f')](_0xaa71be[_0x12a0('0x1a')],function(_0x1c430e){return{'model':db[_0x1c430e[_0x12a0('0x1b')]],'as':_0x1c430e['as'],'attributes':_0x1c430e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4adcdb){logger[_0x12a0('0xb')](_0x12a0('0x1c'),_0x5a4464);logger[_0x12a0('0xe')](_0x12a0('0x1c'),_0x5a4464,JSON[_0x12a0('0x10')](_0x4adcdb));_0x44aeaf(_0x4adcdb);})[_0x12a0('0x14')](function(_0x831fed){logger[_0x12a0('0x11')](_0x12a0('0x1c'),_0x831fed[_0x12a0('0x12')],_0x5a4464);_0xc3546e(_0x276f02[_0x12a0('0x11')](0x1f4,_0x831fed[_0x12a0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ef97459..08ebfad 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 _0x8de9=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','util','path'];(function(_0x523f1b,_0x38dbf0){var _0x88d700=function(_0x5a241c){while(--_0x5a241c){_0x523f1b['push'](_0x523f1b['shift']());}};_0x88d700(++_0x38dbf0);}(_0x8de9,0x1e2));var _0x98de=function(_0x337438,_0x157dec){_0x337438=_0x337438-0x0;var _0xfcffc2=_0x8de9[_0x337438];return _0xfcffc2;};'use strict';var multer=require('multer');var util=require(_0x98de('0x0'));var path=require(_0x98de('0x1'));var timeout=require(_0x98de('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x98de('0x3'));var auth=require(_0x98de('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x98de('0x5'));var controller=require(_0x98de('0x6'));router[_0x98de('0x7')]('/',auth[_0x98de('0x8')](),controller[_0x98de('0x9')]);router[_0x98de('0x7')](_0x98de('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x98de('0x7')](_0x98de('0xb'),auth[_0x98de('0x8')](),controller['getFields']);router[_0x98de('0x7')](_0x98de('0xc'),auth[_0x98de('0x8')](),controller[_0x98de('0xd')]);router['get'](_0x98de('0xe'),auth[_0x98de('0x8')](),controller[_0x98de('0xf')]);router[_0x98de('0x10')]('/',auth['isAuthenticated'](),controller[_0x98de('0x11')]);router[_0x98de('0x12')]('/:id',auth[_0x98de('0x8')](),controller[_0x98de('0x13')]);router[_0x98de('0x14')](_0x98de('0xa'),auth[_0x98de('0x8')](),controller[_0x98de('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1a3e=['/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1a3e,0xad));var _0xe1a3=function(_0x2bdeb7,_0x333bfb){_0x2bdeb7=_0x2bdeb7-0x0;var _0xf286eb=_0x1a3e[_0x2bdeb7];return _0xf286eb;};'use strict';var multer=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var path=require(_0xe1a3('0x2'));var timeout=require(_0xe1a3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe1a3('0x4'));var auth=require(_0xe1a3('0x5'));var interaction=require(_0xe1a3('0x6'));var config=require(_0xe1a3('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0xe1a3('0x8')]('/',auth[_0xe1a3('0x9')](),controller[_0xe1a3('0xa')]);router[_0xe1a3('0x8')](_0xe1a3('0xb'),auth['isAuthenticated'](),controller[_0xe1a3('0xc')]);router[_0xe1a3('0x8')](_0xe1a3('0xd'),auth[_0xe1a3('0x9')](),controller['getFields']);router['get'](_0xe1a3('0xe'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0xf')]);router[_0xe1a3('0x8')]('/:id/descriptions',auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x10')]);router[_0xe1a3('0x11')]('/',auth['isAuthenticated'](),controller[_0xe1a3('0x12')]);router['put'](_0xe1a3('0xb'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x13')]);router[_0xe1a3('0x14')](_0xe1a3('0xb'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x15')]);module[_0xe1a3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 89946e0..dcc0a79 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 _0x003b=['STRING','ENUM','incident','exports'];(function(_0x441515,_0x46b126){var _0xa7a8c8=function(_0x298007){while(--_0x298007){_0x441515['push'](_0x441515['shift']());}};_0xa7a8c8(++_0x46b126);}(_0x003b,0x197));var _0xb003=function(_0x268458,_0x545e1e){_0x268458=_0x268458-0x0;var _0x3e6df7=_0x003b[_0x268458];return _0x3e6df7;};'use strict';var Sequelize=require('sequelize');module[_0xb003('0x0')]={'name':{'type':Sequelize[_0xb003('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb003('0x2')](_0xb003('0x3'),'phonecall'),'defaultValue':_0xb003('0x3')}}; \ No newline at end of file +var _0x1157=['exports','STRING','ENUM','incident','sequelize'];(function(_0x337ed3,_0x2f1606){var _0x3fc3e5=function(_0x58b63c){while(--_0x58b63c){_0x337ed3['push'](_0x337ed3['shift']());}};_0x3fc3e5(++_0x2f1606);}(_0x1157,0xe0));var _0x7115=function(_0x516b4e,_0x75e8f3){_0x516b4e=_0x516b4e-0x0;var _0x58d624=_0x1157[_0x516b4e];return _0x58d624;};'use strict';var Sequelize=require(_0x7115('0x0'));module[_0x7115('0x1')]={'name':{'type':Sequelize[_0x7115('0x2')]},'description':{'type':Sequelize[_0x7115('0x2')]},'ticketType':{'type':Sequelize[_0x7115('0x3')](_0x7115('0x4'),'phonecall'),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 1040587..46f62c3 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 _0xdf76=['options','create','body','find','Dynamics365Field','order','pick','getFields','getSubjects','findOne','getDescriptions','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','length'];(function(_0x2ebd15,_0x392b05){var _0x273716=function(_0x40d1a6){while(--_0x40d1a6){_0x2ebd15['push'](_0x2ebd15['shift']());}};_0x273716(++_0x392b05);}(_0xdf76,0xef));var _0x6df7=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xdf76[_0x35181c];return _0xe14bf9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6df7('0x0'));var zipdir=require(_0x6df7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6df7('0x2'));var BPromise=require(_0x6df7('0x3'));var Mustache=require('mustache');var util=require(_0x6df7('0x4'));var path=require(_0x6df7('0x5'));var sox=require(_0x6df7('0x6'));var csv=require(_0x6df7('0x7'));var ejs=require(_0x6df7('0x8'));var fs=require('fs');var fs_extra=require(_0x6df7('0x9'));var _=require(_0x6df7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6df7('0xb'));var deskjs=require(_0x6df7('0xc'));var toCsv=require(_0x6df7('0x7'));var querystring=require(_0x6df7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6df7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6df7('0xf'));var logger=require(_0x6df7('0x10'))(_0x6df7('0x11'));var utils=require(_0x6df7('0x12'));var config=require(_0x6df7('0x13'));var licenseUtil=require(_0x6df7('0x14'));var db=require(_0x6df7('0x15'))['db'];function respondWithStatusCode(_0x415add,_0x32870f){_0x32870f=_0x32870f||0xcc;return function(_0x50ebe8){if(_0x50ebe8){return _0x415add['sendStatus'](_0x32870f);}return _0x415add['status'](_0x32870f)[_0x6df7('0x16')]();};}function respondWithResult(_0x2a7335,_0x5c9e4f){_0x5c9e4f=_0x5c9e4f||0xc8;return function(_0x17174f){if(_0x17174f){return _0x2a7335[_0x6df7('0x17')](_0x5c9e4f)[_0x6df7('0x18')](_0x17174f);}};}function respondWithFilteredResult(_0x31b312,_0x9ff69d){return function(_0xcd519a){if(_0xcd519a){var _0x22fc10=typeof _0x9ff69d['offset']===_0x6df7('0x19')&&typeof _0x9ff69d[_0x6df7('0x1a')]===_0x6df7('0x19');var _0x44b95d=_0xcd519a[_0x6df7('0x1b')];var _0x4c7acb=_0x22fc10?0x0:_0x9ff69d[_0x6df7('0x1c')];var _0x379b6a=_0x22fc10?_0xcd519a[_0x6df7('0x1b')]:_0x9ff69d[_0x6df7('0x1c')]+_0x9ff69d[_0x6df7('0x1a')];var _0x25fa86;if(_0x379b6a>=_0x44b95d){_0x379b6a=_0x44b95d;_0x25fa86=0xc8;}else{_0x25fa86=0xce;}_0x31b312['status'](_0x25fa86);return _0x31b312['set'](_0x6df7('0x1d'),_0x4c7acb+'-'+_0x379b6a+'/'+_0x44b95d)[_0x6df7('0x18')](_0xcd519a);}return null;};}function patchUpdates(_0x54805b){return function(_0x885eb8){try{jsonpatch['apply'](_0x885eb8,_0x54805b,!![]);}catch(_0x7c72fa){return BPromise[_0x6df7('0x1e')](_0x7c72fa);}return _0x885eb8[_0x6df7('0x1f')]();};}function saveUpdates(_0x22e10d,_0x3be821){return function(_0x418af2){if(_0x418af2){return _0x418af2[_0x6df7('0x20')](_0x22e10d)[_0x6df7('0x21')](function(_0x4adee0){return _0x4adee0;});}return null;};}function removeEntity(_0x363a71,_0x33b268){return function(_0xb2434b){if(_0xb2434b){return _0xb2434b['destroy']()[_0x6df7('0x21')](function(){_0x363a71[_0x6df7('0x17')](0xcc)[_0x6df7('0x16')]();});}};}function handleEntityNotFound(_0x3a6b2b,_0x23c095){return function(_0x4aede2){if(!_0x4aede2){_0x3a6b2b[_0x6df7('0x22')](0x194);}return _0x4aede2;};}function handleError(_0x4bd3cd,_0x3ce4b8){_0x3ce4b8=_0x3ce4b8||0x1f4;return function(_0x4f7a25){logger[_0x6df7('0x23')](_0x4f7a25[_0x6df7('0x24')]);if(_0x4f7a25[_0x6df7('0x25')]){delete _0x4f7a25[_0x6df7('0x25')];}_0x4bd3cd[_0x6df7('0x17')](_0x3ce4b8)[_0x6df7('0x26')](_0x4f7a25);};}exports['index']=function(_0x3951f9,_0x1e6f66){var _0x31a1cb={},_0x1c7159={},_0x551765={'count':0x0,'rows':[]};var _0x1d5c5e=_['map'](db[_0x6df7('0x27')][_0x6df7('0x28')],function(_0x4321c8){return{'name':_0x4321c8[_0x6df7('0x29')],'type':_0x4321c8[_0x6df7('0x2a')]['key']};});_0x1c7159['model']=_[_0x6df7('0x2b')](_0x1d5c5e,_0x6df7('0x25'));_0x1c7159[_0x6df7('0x2c')]=_[_0x6df7('0x2d')](_0x3951f9[_0x6df7('0x2c')]);_0x1c7159[_0x6df7('0x2e')]=_[_0x6df7('0x2f')](_0x1c7159['model'],_0x1c7159[_0x6df7('0x2c')]);_0x31a1cb[_0x6df7('0x30')]=_['intersection'](_0x1c7159[_0x6df7('0x31')],qs[_0x6df7('0x32')](_0x3951f9[_0x6df7('0x2c')][_0x6df7('0x32')]));_0x31a1cb[_0x6df7('0x30')]=_0x31a1cb[_0x6df7('0x30')]['length']?_0x31a1cb['attributes']:_0x1c7159[_0x6df7('0x31')];if(!_0x3951f9[_0x6df7('0x2c')][_0x6df7('0x33')](_0x6df7('0x34'))){_0x31a1cb[_0x6df7('0x1a')]=qs[_0x6df7('0x1a')](_0x3951f9['query'][_0x6df7('0x1a')]);_0x31a1cb[_0x6df7('0x1c')]=qs[_0x6df7('0x1c')](_0x3951f9[_0x6df7('0x2c')][_0x6df7('0x1c')]);}_0x31a1cb['order']=qs[_0x6df7('0x35')](_0x3951f9[_0x6df7('0x2c')][_0x6df7('0x35')]);_0x31a1cb['where']=qs['filters'](_['pick'](_0x3951f9[_0x6df7('0x2c')],_0x1c7159[_0x6df7('0x2e')]),_0x1d5c5e);if(_0x3951f9['query'][_0x6df7('0x36')]){_0x31a1cb['where']=_[_0x6df7('0x37')](_0x31a1cb[_0x6df7('0x38')],{'$or':_[_0x6df7('0x2b')](_0x1d5c5e,function(_0x2f27af){if(_0x2f27af[_0x6df7('0x2a')]!==_0x6df7('0x39')){var _0x13a1d1={};_0x13a1d1[_0x2f27af['name']]={'$like':'%'+_0x3951f9[_0x6df7('0x2c')]['filter']+'%'};return _0x13a1d1;}})});}_0x31a1cb=_[_0x6df7('0x37')]({},_0x31a1cb,_0x3951f9['options']);var _0x2d7fe3={'where':_0x31a1cb['where']};return db[_0x6df7('0x27')]['count'](_0x2d7fe3)[_0x6df7('0x21')](function(_0x3f1009){_0x551765[_0x6df7('0x1b')]=_0x3f1009;if(_0x3951f9[_0x6df7('0x2c')][_0x6df7('0x3a')]){_0x31a1cb[_0x6df7('0x3b')]=[{'all':!![]}];}return db[_0x6df7('0x27')][_0x6df7('0x3c')](_0x31a1cb);})['then'](function(_0x51be79){_0x551765['rows']=_0x51be79;return _0x551765;})[_0x6df7('0x21')](respondWithFilteredResult(_0x1e6f66,_0x31a1cb))[_0x6df7('0x3d')](handleError(_0x1e6f66,null));};exports[_0x6df7('0x3e')]=function(_0x5b7214,_0x481d70){var _0x204561={'raw':![],'where':{'id':_0x5b7214[_0x6df7('0x3f')]['id']}},_0x350df9={};_0x350df9[_0x6df7('0x31')]=_[_0x6df7('0x2d')](db['Dynamics365Configuration'][_0x6df7('0x28')]);_0x350df9[_0x6df7('0x2c')]=_[_0x6df7('0x2d')](_0x5b7214[_0x6df7('0x2c')]);_0x350df9[_0x6df7('0x2e')]=_[_0x6df7('0x2f')](_0x350df9['model'],_0x350df9[_0x6df7('0x2c')]);_0x204561[_0x6df7('0x30')]=_['intersection'](_0x350df9[_0x6df7('0x31')],qs[_0x6df7('0x32')](_0x5b7214[_0x6df7('0x2c')]['fields']));_0x204561['attributes']=_0x204561[_0x6df7('0x30')][_0x6df7('0x40')]?_0x204561[_0x6df7('0x30')]:_0x350df9[_0x6df7('0x31')];if(_0x5b7214[_0x6df7('0x2c')][_0x6df7('0x3a')]){_0x204561[_0x6df7('0x3b')]=[{'all':!![]}];}_0x204561=_[_0x6df7('0x37')]({},_0x204561,_0x5b7214[_0x6df7('0x41')]);return db[_0x6df7('0x27')]['find'](_0x204561)[_0x6df7('0x21')](handleEntityNotFound(_0x481d70,null))['then'](respondWithResult(_0x481d70,null))['catch'](handleError(_0x481d70,null));};exports[_0x6df7('0x42')]=function(_0x3c5f5b,_0x296119){return db[_0x6df7('0x27')][_0x6df7('0x42')](_0x3c5f5b[_0x6df7('0x43')],{})[_0x6df7('0x21')](respondWithResult(_0x296119,0xc9))[_0x6df7('0x3d')](handleError(_0x296119,null));};exports['update']=function(_0x2fc618,_0x418410){if(_0x2fc618[_0x6df7('0x43')]['id']){delete _0x2fc618[_0x6df7('0x43')]['id'];}return db[_0x6df7('0x27')][_0x6df7('0x44')]({'where':{'id':_0x2fc618[_0x6df7('0x3f')]['id']}})[_0x6df7('0x21')](handleEntityNotFound(_0x418410,null))['then'](saveUpdates(_0x2fc618[_0x6df7('0x43')],null))[_0x6df7('0x21')](respondWithResult(_0x418410,null))[_0x6df7('0x3d')](handleError(_0x418410,null));};exports['destroy']=function(_0x21b97d,_0x12b891){return db[_0x6df7('0x27')][_0x6df7('0x44')]({'where':{'id':_0x21b97d[_0x6df7('0x3f')]['id']}})[_0x6df7('0x21')](handleEntityNotFound(_0x12b891,null))[_0x6df7('0x21')](removeEntity(_0x12b891,null))['catch'](handleError(_0x12b891,null));};exports['getFields']=function(_0x586383,_0x230d4e,_0x4eeff1){var _0x343075={};var _0x267759={};var _0x1abe26;var _0x31fb0a;return db[_0x6df7('0x27')]['findOne']({'where':{'id':_0x586383[_0x6df7('0x3f')]['id']}})[_0x6df7('0x21')](handleEntityNotFound(_0x230d4e,null))['then'](function(_0x37e551){if(_0x37e551){_0x1abe26=_0x37e551;_0x267759[_0x6df7('0x31')]=_[_0x6df7('0x2d')](db[_0x6df7('0x45')]['rawAttributes']);_0x267759['query']=_['keys'](_0x586383[_0x6df7('0x2c')]);_0x267759['filters']=_[_0x6df7('0x2f')](_0x267759[_0x6df7('0x31')],_0x267759[_0x6df7('0x2c')]);_0x343075[_0x6df7('0x30')]=_[_0x6df7('0x2f')](_0x267759[_0x6df7('0x31')],qs['fields'](_0x586383[_0x6df7('0x2c')][_0x6df7('0x32')]));_0x343075[_0x6df7('0x30')]=_0x343075['attributes']['length']?_0x343075[_0x6df7('0x30')]:_0x267759[_0x6df7('0x31')];_0x343075[_0x6df7('0x46')]=qs[_0x6df7('0x35')](_0x586383[_0x6df7('0x2c')][_0x6df7('0x35')]);_0x343075[_0x6df7('0x38')]=qs['filters'](_[_0x6df7('0x47')](_0x586383[_0x6df7('0x2c')],_0x267759['filters']));if(_0x586383[_0x6df7('0x2c')][_0x6df7('0x36')]){_0x343075[_0x6df7('0x38')]=_[_0x6df7('0x37')](_0x343075[_0x6df7('0x38')],{'$or':_[_0x6df7('0x2b')](_0x343075[_0x6df7('0x30')],function(_0x24646e){var _0x37f5d6={};_0x37f5d6[_0x24646e]={'$like':'%'+_0x586383['query'][_0x6df7('0x36')]+'%'};return _0x37f5d6;})});}_0x343075=_[_0x6df7('0x37')]({},_0x343075,_0x586383[_0x6df7('0x41')]);return _0x1abe26[_0x6df7('0x48')](_0x343075);}})[_0x6df7('0x21')](function(_0x32b51c){if(_0x32b51c){_0x31fb0a=_0x32b51c['length'];if(!_0x586383[_0x6df7('0x2c')][_0x6df7('0x33')](_0x6df7('0x34'))){_0x343075[_0x6df7('0x1a')]=qs[_0x6df7('0x1a')](_0x586383[_0x6df7('0x2c')][_0x6df7('0x1a')]);_0x343075[_0x6df7('0x1c')]=qs[_0x6df7('0x1c')](_0x586383[_0x6df7('0x2c')]['offset']);}return _0x1abe26[_0x6df7('0x48')](_0x343075);}})[_0x6df7('0x21')](function(_0x41c55b){if(_0x41c55b){return _0x41c55b?{'count':_0x31fb0a,'rows':_0x41c55b}:null;}})[_0x6df7('0x21')](respondWithResult(_0x230d4e,null))['catch'](handleError(_0x230d4e,null));};exports[_0x6df7('0x49')]=function(_0x30c47e,_0xae6f14,_0x5af113){var _0x1681f0={};var _0x2fc8de={};var _0x3f09a8;var _0x3d3c4f;return db[_0x6df7('0x27')][_0x6df7('0x4a')]({'where':{'id':_0x30c47e[_0x6df7('0x3f')]['id']}})[_0x6df7('0x21')](handleEntityNotFound(_0xae6f14,null))['then'](function(_0x528bef){if(_0x528bef){_0x3f09a8=_0x528bef;_0x2fc8de['model']=_[_0x6df7('0x2d')](db[_0x6df7('0x45')]['rawAttributes']);_0x2fc8de[_0x6df7('0x2c')]=_[_0x6df7('0x2d')](_0x30c47e[_0x6df7('0x2c')]);_0x2fc8de['filters']=_['intersection'](_0x2fc8de['model'],_0x2fc8de[_0x6df7('0x2c')]);_0x1681f0[_0x6df7('0x30')]=_['intersection'](_0x2fc8de[_0x6df7('0x31')],qs['fields'](_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x32')]));_0x1681f0[_0x6df7('0x30')]=_0x1681f0[_0x6df7('0x30')]['length']?_0x1681f0['attributes']:_0x2fc8de[_0x6df7('0x31')];_0x1681f0['order']=qs['sort'](_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x35')]);_0x1681f0[_0x6df7('0x38')]=qs[_0x6df7('0x2e')](_[_0x6df7('0x47')](_0x30c47e[_0x6df7('0x2c')],_0x2fc8de[_0x6df7('0x2e')]));if(_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x36')]){_0x1681f0[_0x6df7('0x38')]=_['merge'](_0x1681f0['where'],{'$or':_[_0x6df7('0x2b')](_0x1681f0[_0x6df7('0x30')],function(_0x5956da){var _0x1a52c2={};_0x1a52c2[_0x5956da]={'$like':'%'+_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x36')]+'%'};return _0x1a52c2;})});}_0x1681f0=_[_0x6df7('0x37')]({},_0x1681f0,_0x30c47e['options']);return _0x3f09a8['getSubjects'](_0x1681f0);}})[_0x6df7('0x21')](function(_0x25c0b2){if(_0x25c0b2){_0x3d3c4f=_0x25c0b2[_0x6df7('0x40')];if(!_0x30c47e[_0x6df7('0x2c')]['hasOwnProperty'](_0x6df7('0x34'))){_0x1681f0['limit']=qs[_0x6df7('0x1a')](_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x1a')]);_0x1681f0[_0x6df7('0x1c')]=qs[_0x6df7('0x1c')](_0x30c47e[_0x6df7('0x2c')][_0x6df7('0x1c')]);}return _0x3f09a8['getSubjects'](_0x1681f0);}})[_0x6df7('0x21')](function(_0x408887){if(_0x408887){return _0x408887?{'count':_0x3d3c4f,'rows':_0x408887}:null;}})[_0x6df7('0x21')](respondWithResult(_0xae6f14,null))['catch'](handleError(_0xae6f14,null));};exports[_0x6df7('0x4b')]=function(_0x156130,_0x5a484c,_0x558a2d){var _0x3b285a={};var _0x361c8f={};var _0x36d617;var _0x36dec5;return db['Dynamics365Configuration'][_0x6df7('0x4a')]({'where':{'id':_0x156130[_0x6df7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5a484c,null))['then'](function(_0x26ef7e){if(_0x26ef7e){_0x36d617=_0x26ef7e;_0x361c8f[_0x6df7('0x31')]=_[_0x6df7('0x2d')](db[_0x6df7('0x45')][_0x6df7('0x28')]);_0x361c8f[_0x6df7('0x2c')]=_[_0x6df7('0x2d')](_0x156130['query']);_0x361c8f[_0x6df7('0x2e')]=_[_0x6df7('0x2f')](_0x361c8f[_0x6df7('0x31')],_0x361c8f['query']);_0x3b285a[_0x6df7('0x30')]=_[_0x6df7('0x2f')](_0x361c8f[_0x6df7('0x31')],qs[_0x6df7('0x32')](_0x156130[_0x6df7('0x2c')][_0x6df7('0x32')]));_0x3b285a[_0x6df7('0x30')]=_0x3b285a['attributes'][_0x6df7('0x40')]?_0x3b285a[_0x6df7('0x30')]:_0x361c8f[_0x6df7('0x31')];_0x3b285a[_0x6df7('0x46')]=qs[_0x6df7('0x35')](_0x156130['query']['sort']);_0x3b285a[_0x6df7('0x38')]=qs['filters'](_[_0x6df7('0x47')](_0x156130[_0x6df7('0x2c')],_0x361c8f['filters']));if(_0x156130[_0x6df7('0x2c')][_0x6df7('0x36')]){_0x3b285a[_0x6df7('0x38')]=_[_0x6df7('0x37')](_0x3b285a['where'],{'$or':_[_0x6df7('0x2b')](_0x3b285a[_0x6df7('0x30')],function(_0x3fa1b2){var _0x1dbb42={};_0x1dbb42[_0x3fa1b2]={'$like':'%'+_0x156130['query']['filter']+'%'};return _0x1dbb42;})});}_0x3b285a=_[_0x6df7('0x37')]({},_0x3b285a,_0x156130[_0x6df7('0x41')]);return _0x36d617[_0x6df7('0x4b')](_0x3b285a);}})[_0x6df7('0x21')](function(_0x5a8549){if(_0x5a8549){_0x36dec5=_0x5a8549['length'];if(!_0x156130[_0x6df7('0x2c')][_0x6df7('0x33')](_0x6df7('0x34'))){_0x3b285a[_0x6df7('0x1a')]=qs[_0x6df7('0x1a')](_0x156130[_0x6df7('0x2c')][_0x6df7('0x1a')]);_0x3b285a[_0x6df7('0x1c')]=qs[_0x6df7('0x1c')](_0x156130[_0x6df7('0x2c')][_0x6df7('0x1c')]);}return _0x36d617[_0x6df7('0x4b')](_0x3b285a);}})[_0x6df7('0x21')](function(_0x3a912b){if(_0x3a912b){return _0x3a912b?{'count':_0x36dec5,'rows':_0x3a912b}:null;}})['then'](respondWithResult(_0x5a484c,null))['catch'](handleError(_0x5a484c,null));}; \ No newline at end of file +var _0x6d4d=['json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','findOne','Dynamics365Field','order','pick','getFields','hasOwnProperty','getSubjects','nolimit','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x4b6ff9,_0xa8b4ac){var _0x53cad0=function(_0x3d90f5){while(--_0x3d90f5){_0x4b6ff9['push'](_0x4b6ff9['shift']());}};_0x53cad0(++_0xa8b4ac);}(_0x6d4d,0x11f));var _0xd6d4=function(_0x42642f,_0x16a458){_0x42642f=_0x42642f-0x0;var _0x57c5e8=_0x6d4d[_0x42642f];return _0x57c5e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6d4('0x1'));var rp=require('request-promise');var moment=require(_0xd6d4('0x2'));var BPromise=require(_0xd6d4('0x3'));var Mustache=require(_0xd6d4('0x4'));var util=require(_0xd6d4('0x5'));var path=require(_0xd6d4('0x6'));var sox=require(_0xd6d4('0x7'));var csv=require(_0xd6d4('0x8'));var ejs=require(_0xd6d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd6d4('0xa'));var _=require(_0xd6d4('0xb'));var squel=require(_0xd6d4('0xc'));var crypto=require(_0xd6d4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd6d4('0x8'));var querystring=require(_0xd6d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xd6d4('0xf'));var authService=require(_0xd6d4('0x10'));var qs=require(_0xd6d4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d4('0x12'));var logger=require(_0xd6d4('0x13'))(_0xd6d4('0x14'));var utils=require('../../config/utils');var config=require(_0xd6d4('0x15'));var licenseUtil=require(_0xd6d4('0x16'));var db=require(_0xd6d4('0x17'))['db'];function respondWithStatusCode(_0x1e2ce0,_0x52eb54){_0x52eb54=_0x52eb54||0xcc;return function(_0x27eb0a){if(_0x27eb0a){return _0x1e2ce0['sendStatus'](_0x52eb54);}return _0x1e2ce0['status'](_0x52eb54)['end']();};}function respondWithResult(_0xdfb497,_0x192150){_0x192150=_0x192150||0xc8;return function(_0x2d8317){if(_0x2d8317){return _0xdfb497[_0xd6d4('0x18')](_0x192150)[_0xd6d4('0x19')](_0x2d8317);}};}function respondWithFilteredResult(_0x241ea5,_0xfedcdd){return function(_0x44bab4){if(_0x44bab4){var _0x233a64=typeof _0xfedcdd[_0xd6d4('0x1a')]===_0xd6d4('0x1b')&&typeof _0xfedcdd[_0xd6d4('0x1c')]===_0xd6d4('0x1b');var _0x564112=_0x44bab4[_0xd6d4('0x1d')];var _0x2de46c=_0x233a64?0x0:_0xfedcdd[_0xd6d4('0x1a')];var _0x19b475=_0x233a64?_0x44bab4['count']:_0xfedcdd[_0xd6d4('0x1a')]+_0xfedcdd[_0xd6d4('0x1c')];var _0x1f6cab;if(_0x19b475>=_0x564112){_0x19b475=_0x564112;_0x1f6cab=0xc8;}else{_0x1f6cab=0xce;}_0x241ea5[_0xd6d4('0x18')](_0x1f6cab);return _0x241ea5[_0xd6d4('0x1e')]('Content-Range',_0x2de46c+'-'+_0x19b475+'/'+_0x564112)[_0xd6d4('0x19')](_0x44bab4);}return null;};}function patchUpdates(_0x12d2f0){return function(_0x8bf3eb){try{jsonpatch[_0xd6d4('0x1f')](_0x8bf3eb,_0x12d2f0,!![]);}catch(_0x3fe811){return BPromise[_0xd6d4('0x20')](_0x3fe811);}return _0x8bf3eb['save']();};}function saveUpdates(_0x311dc5,_0x31132a){return function(_0x2f6c2e){if(_0x2f6c2e){return _0x2f6c2e[_0xd6d4('0x21')](_0x311dc5)[_0xd6d4('0x22')](function(_0x14dc53){return _0x14dc53;});}return null;};}function removeEntity(_0x13ad41,_0x1f41c0){return function(_0x5cce8e){if(_0x5cce8e){return _0x5cce8e[_0xd6d4('0x23')]()['then'](function(){_0x13ad41[_0xd6d4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e201e,_0x1f329f){return function(_0x1b2662){if(!_0x1b2662){_0x4e201e['sendStatus'](0x194);}return _0x1b2662;};}function handleError(_0x513b69,_0x53ee1c){_0x53ee1c=_0x53ee1c||0x1f4;return function(_0x4a42ae){logger[_0xd6d4('0x24')](_0x4a42ae[_0xd6d4('0x25')]);if(_0x4a42ae['name']){delete _0x4a42ae[_0xd6d4('0x26')];}_0x513b69[_0xd6d4('0x18')](_0x53ee1c)['send'](_0x4a42ae);};}exports[_0xd6d4('0x27')]=function(_0x4b66df,_0x4d4b96){var _0x5f18fe={},_0x331d5f={},_0x49efc7={'count':0x0,'rows':[]};var _0x4f2371=_['map'](db[_0xd6d4('0x28')][_0xd6d4('0x29')],function(_0x1a2933){return{'name':_0x1a2933[_0xd6d4('0x2a')],'type':_0x1a2933[_0xd6d4('0x2b')][_0xd6d4('0x2c')]};});_0x331d5f['model']=_[_0xd6d4('0x2d')](_0x4f2371,_0xd6d4('0x26'));_0x331d5f[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x4b66df[_0xd6d4('0x2e')]);_0x331d5f['filters']=_[_0xd6d4('0x30')](_0x331d5f[_0xd6d4('0x31')],_0x331d5f['query']);_0x5f18fe[_0xd6d4('0x32')]=_['intersection'](_0x331d5f[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x4b66df[_0xd6d4('0x2e')]['fields']));_0x5f18fe[_0xd6d4('0x32')]=_0x5f18fe[_0xd6d4('0x32')]['length']?_0x5f18fe[_0xd6d4('0x32')]:_0x331d5f[_0xd6d4('0x31')];if(!_0x4b66df[_0xd6d4('0x2e')]['hasOwnProperty']('nolimit')){_0x5f18fe[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x4b66df['query'][_0xd6d4('0x1c')]);_0x5f18fe[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x4b66df['query'][_0xd6d4('0x1a')]);}_0x5f18fe['order']=qs[_0xd6d4('0x34')](_0x4b66df[_0xd6d4('0x2e')]['sort']);_0x5f18fe[_0xd6d4('0x35')]=qs[_0xd6d4('0x36')](_['pick'](_0x4b66df[_0xd6d4('0x2e')],_0x331d5f[_0xd6d4('0x36')]),_0x4f2371);if(_0x4b66df[_0xd6d4('0x2e')]['filter']){_0x5f18fe[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0x5f18fe[_0xd6d4('0x35')],{'$or':_[_0xd6d4('0x2d')](_0x4f2371,function(_0x175e75){if(_0x175e75[_0xd6d4('0x2b')]!==_0xd6d4('0x38')){var _0x4e573e={};_0x4e573e[_0x175e75[_0xd6d4('0x26')]]={'$like':'%'+_0x4b66df[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x4e573e;}})});}_0x5f18fe=_[_0xd6d4('0x37')]({},_0x5f18fe,_0x4b66df[_0xd6d4('0x3a')]);var _0x3cdc57={'where':_0x5f18fe[_0xd6d4('0x35')]};return db[_0xd6d4('0x28')][_0xd6d4('0x1d')](_0x3cdc57)[_0xd6d4('0x22')](function(_0x10648d){_0x49efc7['count']=_0x10648d;if(_0x4b66df[_0xd6d4('0x2e')]['includeAll']){_0x5f18fe[_0xd6d4('0x3b')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd6d4('0x3c')](_0x5f18fe);})[_0xd6d4('0x22')](function(_0x26258e){_0x49efc7['rows']=_0x26258e;return _0x49efc7;})[_0xd6d4('0x22')](respondWithFilteredResult(_0x4d4b96,_0x5f18fe))[_0xd6d4('0x3d')](handleError(_0x4d4b96,null));};exports[_0xd6d4('0x3e')]=function(_0x5040c7,_0x15c30e){var _0x2562aa={'raw':![],'where':{'id':_0x5040c7[_0xd6d4('0x3f')]['id']}},_0x4486d6={};_0x4486d6['model']=_[_0xd6d4('0x2f')](db[_0xd6d4('0x28')][_0xd6d4('0x29')]);_0x4486d6[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x5040c7[_0xd6d4('0x2e')]);_0x4486d6[_0xd6d4('0x36')]=_['intersection'](_0x4486d6[_0xd6d4('0x31')],_0x4486d6['query']);_0x2562aa[_0xd6d4('0x32')]=_[_0xd6d4('0x30')](_0x4486d6[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x5040c7[_0xd6d4('0x2e')][_0xd6d4('0x33')]));_0x2562aa['attributes']=_0x2562aa['attributes'][_0xd6d4('0x40')]?_0x2562aa[_0xd6d4('0x32')]:_0x4486d6[_0xd6d4('0x31')];if(_0x5040c7[_0xd6d4('0x2e')][_0xd6d4('0x41')]){_0x2562aa['include']=[{'all':!![]}];}_0x2562aa=_[_0xd6d4('0x37')]({},_0x2562aa,_0x5040c7[_0xd6d4('0x3a')]);return db[_0xd6d4('0x28')][_0xd6d4('0x42')](_0x2562aa)[_0xd6d4('0x22')](handleEntityNotFound(_0x15c30e,null))[_0xd6d4('0x22')](respondWithResult(_0x15c30e,null))[_0xd6d4('0x3d')](handleError(_0x15c30e,null));};exports[_0xd6d4('0x43')]=function(_0x191112,_0x498907){return db[_0xd6d4('0x28')][_0xd6d4('0x43')](_0x191112['body'],{})[_0xd6d4('0x22')](respondWithResult(_0x498907,0xc9))[_0xd6d4('0x3d')](handleError(_0x498907,null));};exports['update']=function(_0x1482db,_0x5827d7){if(_0x1482db['body']['id']){delete _0x1482db[_0xd6d4('0x44')]['id'];}return db['Dynamics365Configuration'][_0xd6d4('0x42')]({'where':{'id':_0x1482db[_0xd6d4('0x3f')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x5827d7,null))[_0xd6d4('0x22')](saveUpdates(_0x1482db[_0xd6d4('0x44')],null))[_0xd6d4('0x22')](respondWithResult(_0x5827d7,null))[_0xd6d4('0x3d')](handleError(_0x5827d7,null));};exports[_0xd6d4('0x23')]=function(_0x2db78f,_0x14718a){return db[_0xd6d4('0x28')][_0xd6d4('0x42')]({'where':{'id':_0x2db78f['params']['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x14718a,null))[_0xd6d4('0x22')](removeEntity(_0x14718a,null))[_0xd6d4('0x3d')](handleError(_0x14718a,null));};exports['getFields']=function(_0x383649,_0x36100d,_0x31c5c2){var _0xc1913b={};var _0x29776a={};var _0x3d6b22;var _0x5e8839;return db[_0xd6d4('0x28')][_0xd6d4('0x45')]({'where':{'id':_0x383649['params']['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x36100d,null))[_0xd6d4('0x22')](function(_0x5b9881){if(_0x5b9881){_0x3d6b22=_0x5b9881;_0x29776a[_0xd6d4('0x31')]=_[_0xd6d4('0x2f')](db[_0xd6d4('0x46')][_0xd6d4('0x29')]);_0x29776a[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x383649[_0xd6d4('0x2e')]);_0x29776a[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0x29776a['model'],_0x29776a['query']);_0xc1913b[_0xd6d4('0x32')]=_['intersection'](_0x29776a[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x383649[_0xd6d4('0x2e')]['fields']));_0xc1913b[_0xd6d4('0x32')]=_0xc1913b[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0xc1913b[_0xd6d4('0x32')]:_0x29776a[_0xd6d4('0x31')];_0xc1913b[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x34')]);_0xc1913b['where']=qs['filters'](_[_0xd6d4('0x48')](_0x383649[_0xd6d4('0x2e')],_0x29776a[_0xd6d4('0x36')]));if(_0x383649['query'][_0xd6d4('0x39')]){_0xc1913b[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0xc1913b['where'],{'$or':_['map'](_0xc1913b[_0xd6d4('0x32')],function(_0x349b05){var _0x48e973={};_0x48e973[_0x349b05]={'$like':'%'+_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x48e973;})});}_0xc1913b=_[_0xd6d4('0x37')]({},_0xc1913b,_0x383649['options']);return _0x3d6b22[_0xd6d4('0x49')](_0xc1913b);}})['then'](function(_0x2ef623){if(_0x2ef623){_0x5e8839=_0x2ef623[_0xd6d4('0x40')];if(!_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x4a')]('nolimit')){_0xc1913b[_0xd6d4('0x1c')]=qs['limit'](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x1c')]);_0xc1913b[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x3d6b22[_0xd6d4('0x49')](_0xc1913b);}})['then'](function(_0x4799ee){if(_0x4799ee){return _0x4799ee?{'count':_0x5e8839,'rows':_0x4799ee}:null;}})['then'](respondWithResult(_0x36100d,null))['catch'](handleError(_0x36100d,null));};exports[_0xd6d4('0x4b')]=function(_0x1c898e,_0x1bfce3,_0x4b2b85){var _0x9cf133={};var _0x31f065={};var _0x2482fc;var _0x1952ab;return db['Dynamics365Configuration'][_0xd6d4('0x45')]({'where':{'id':_0x1c898e[_0xd6d4('0x3f')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x1bfce3,null))[_0xd6d4('0x22')](function(_0x165de4){if(_0x165de4){_0x2482fc=_0x165de4;_0x31f065[_0xd6d4('0x31')]=_[_0xd6d4('0x2f')](db['Dynamics365Field'][_0xd6d4('0x29')]);_0x31f065[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x1c898e[_0xd6d4('0x2e')]);_0x31f065[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0x31f065['model'],_0x31f065[_0xd6d4('0x2e')]);_0x9cf133[_0xd6d4('0x32')]=_[_0xd6d4('0x30')](_0x31f065['model'],qs['fields'](_0x1c898e['query']['fields']));_0x9cf133[_0xd6d4('0x32')]=_0x9cf133[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0x9cf133[_0xd6d4('0x32')]:_0x31f065['model'];_0x9cf133[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x1c898e['query'][_0xd6d4('0x34')]);_0x9cf133['where']=qs[_0xd6d4('0x36')](_[_0xd6d4('0x48')](_0x1c898e[_0xd6d4('0x2e')],_0x31f065[_0xd6d4('0x36')]));if(_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x39')]){_0x9cf133[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0x9cf133[_0xd6d4('0x35')],{'$or':_['map'](_0x9cf133['attributes'],function(_0x26e8e2){var _0x3fa954={};_0x3fa954[_0x26e8e2]={'$like':'%'+_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x3fa954;})});}_0x9cf133=_[_0xd6d4('0x37')]({},_0x9cf133,_0x1c898e['options']);return _0x2482fc[_0xd6d4('0x4b')](_0x9cf133);}})['then'](function(_0x3433d8){if(_0x3433d8){_0x1952ab=_0x3433d8[_0xd6d4('0x40')];if(!_0x1c898e['query'][_0xd6d4('0x4a')](_0xd6d4('0x4c'))){_0x9cf133[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x1c')]);_0x9cf133[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x2482fc[_0xd6d4('0x4b')](_0x9cf133);}})[_0xd6d4('0x22')](function(_0x105032){if(_0x105032){return _0x105032?{'count':_0x1952ab,'rows':_0x105032}:null;}})[_0xd6d4('0x22')](respondWithResult(_0x1bfce3,null))[_0xd6d4('0x3d')](handleError(_0x1bfce3,null));};exports['getDescriptions']=function(_0x9e74ef,_0xa28944,_0x55b9a9){var _0x54347b={};var _0xdf8f7b={};var _0x40c9d5;var _0x5b6e76;return db[_0xd6d4('0x28')][_0xd6d4('0x45')]({'where':{'id':_0x9e74ef[_0xd6d4('0x3f')]['id']}})['then'](handleEntityNotFound(_0xa28944,null))[_0xd6d4('0x22')](function(_0x2d53c6){if(_0x2d53c6){_0x40c9d5=_0x2d53c6;_0xdf8f7b[_0xd6d4('0x31')]=_['keys'](db[_0xd6d4('0x46')][_0xd6d4('0x29')]);_0xdf8f7b['query']=_[_0xd6d4('0x2f')](_0x9e74ef[_0xd6d4('0x2e')]);_0xdf8f7b[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0xdf8f7b['model'],_0xdf8f7b[_0xd6d4('0x2e')]);_0x54347b[_0xd6d4('0x32')]=_['intersection'](_0xdf8f7b[_0xd6d4('0x31')],qs['fields'](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x33')]));_0x54347b[_0xd6d4('0x32')]=_0x54347b[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0x54347b[_0xd6d4('0x32')]:_0xdf8f7b['model'];_0x54347b[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x34')]);_0x54347b[_0xd6d4('0x35')]=qs[_0xd6d4('0x36')](_['pick'](_0x9e74ef[_0xd6d4('0x2e')],_0xdf8f7b[_0xd6d4('0x36')]));if(_0x9e74ef['query']['filter']){_0x54347b[_0xd6d4('0x35')]=_['merge'](_0x54347b['where'],{'$or':_[_0xd6d4('0x2d')](_0x54347b[_0xd6d4('0x32')],function(_0x44571a){var _0x318762={};_0x318762[_0x44571a]={'$like':'%'+_0x9e74ef[_0xd6d4('0x2e')]['filter']+'%'};return _0x318762;})});}_0x54347b=_[_0xd6d4('0x37')]({},_0x54347b,_0x9e74ef[_0xd6d4('0x3a')]);return _0x40c9d5[_0xd6d4('0x4d')](_0x54347b);}})[_0xd6d4('0x22')](function(_0x59d7c7){if(_0x59d7c7){_0x5b6e76=_0x59d7c7['length'];if(!_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x4a')](_0xd6d4('0x4c'))){_0x54347b[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x9e74ef[_0xd6d4('0x2e')]['limit']);_0x54347b[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x40c9d5[_0xd6d4('0x4d')](_0x54347b);}})[_0xd6d4('0x22')](function(_0x2b0a19){if(_0x2b0a19){return _0x2b0a19?{'count':_0x5b6e76,'rows':_0x2b0a19}:null;}})[_0xd6d4('0x22')](respondWithResult(_0xa28944,null))['catch'](handleError(_0xa28944,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 361d86c..cc3b319 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xe5b3,0x133));var _0x3e5b=function(_0x287eaf,_0x41d318){_0x287eaf=_0x287eaf-0x0;var _0x321683=_0xe5b3[_0x287eaf];return _0x321683;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xe14d,0x1ee));var _0xde14=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xe14d[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 7003b8a..daaf9ad 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 _0xbf8f=['message','info','result','Dynamics365Configuration,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbf8f,0x10c));var _0xfbf8=function(_0x27ceb0,_0x490faa){_0x27ceb0=_0x27ceb0-0x0;var _0x158e12=_0xbf8f[_0x27ceb0];return _0x158e12;};'use strict';var _=require(_0xfbf8('0x0'));var util=require(_0xfbf8('0x1'));var moment=require(_0xfbf8('0x2'));var BPromise=require(_0xfbf8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbf8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbf8('0x5'));var logger=require(_0xfbf8('0x6'))(_0xfbf8('0x7'));var config=require(_0xfbf8('0x8'));var jayson=require(_0xfbf8('0x9'));var client=jayson[_0xfbf8('0xa')][_0xfbf8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fc26a,_0x5b3228,_0x18650f){return new BPromise(function(_0x483b59,_0x102d30){return client['request'](_0x4fc26a,_0x18650f)['then'](function(_0x441009){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3228,'request\x20sent');logger[_0xfbf8('0xc')](_0xfbf8('0xd'),_0x5b3228,_0xfbf8('0xe'),JSON[_0xfbf8('0xf')](_0x441009));if(_0x441009[_0xfbf8('0x10')]){if(_0x441009[_0xfbf8('0x10')][_0xfbf8('0x11')]===0x1f4){logger[_0xfbf8('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3228,_0x441009[_0xfbf8('0x10')][_0xfbf8('0x12')]);return _0x102d30(_0x441009[_0xfbf8('0x10')]['message']);}logger[_0xfbf8('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3228,_0x441009[_0xfbf8('0x10')]['message']);return _0x483b59(_0x441009[_0xfbf8('0x10')]['message']);}else{logger[_0xfbf8('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3228,'request\x20sent');_0x483b59(_0x441009[_0xfbf8('0x14')][_0xfbf8('0x12')]);}})['catch'](function(_0x546c6d){logger[_0xfbf8('0x10')](_0xfbf8('0x15'),_0x5b3228,_0x546c6d);_0x102d30(_0x546c6d);});});} \ No newline at end of file +var _0xd0d7=['../../config/logger','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x16d6fa,_0xff299f){var _0x4a875e=function(_0x2d6f88){while(--_0x2d6f88){_0x16d6fa['push'](_0x16d6fa['shift']());}};_0x4a875e(++_0xff299f);}(_0xd0d7,0x120));var _0x7d0d=function(_0x3b58e2,_0x4fbf5f){_0x3b58e2=_0x3b58e2-0x0;var _0x5a6677=_0xd0d7[_0x3b58e2];return _0x5a6677;};'use strict';var _=require(_0x7d0d('0x0'));var util=require(_0x7d0d('0x1'));var moment=require(_0x7d0d('0x2'));var BPromise=require(_0x7d0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d0d('0x4'))['db'];var utils=require(_0x7d0d('0x5'));var logger=require(_0x7d0d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d0d('0x7'));var client=jayson[_0x7d0d('0x8')][_0x7d0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229a38,_0x2ee01b,_0x484791){return new BPromise(function(_0x3681ed,_0x129cbb){return client[_0x7d0d('0xa')](_0x229a38,_0x484791)[_0x7d0d('0xb')](function(_0xd9f079){logger['info'](_0x7d0d('0xc'),_0x2ee01b,_0x7d0d('0xd'));logger['debug'](_0x7d0d('0xe'),_0x2ee01b,_0x7d0d('0xd'),JSON[_0x7d0d('0xf')](_0xd9f079));if(_0xd9f079[_0x7d0d('0x10')]){if(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x11')]===0x1f4){logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);return _0x129cbb(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);}logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0xd9f079['error'][_0x7d0d('0x12')]);return _0x3681ed(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);}else{logger['info'](_0x7d0d('0xc'),_0x2ee01b,_0x7d0d('0xd'));_0x3681ed(_0xd9f079[_0x7d0d('0x13')]['message']);}})[_0x7d0d('0x14')](function(_0x226548){logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0x226548);_0x129cbb(_0x226548);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4370f2b..57b5c5d 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 _0xab23=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0xab23,0x10e));var _0x3ab2=function(_0x727b36,_0x42a6e6){_0x727b36=_0x727b36-0x0;var _0x3dd084=_0xab23[_0x727b36];return _0x3dd084;};'use strict';var multer=require(_0x3ab2('0x0'));var util=require('util');var path=require(_0x3ab2('0x1'));var timeout=require(_0x3ab2('0x2'));var express=require(_0x3ab2('0x3'));var router=express[_0x3ab2('0x4')]();var fs_extra=require(_0x3ab2('0x5'));var auth=require(_0x3ab2('0x6'));var interaction=require(_0x3ab2('0x7'));var config=require(_0x3ab2('0x8'));var controller=require(_0x3ab2('0x9'));router['get']('/',auth[_0x3ab2('0xa')](),controller[_0x3ab2('0xb')]);router[_0x3ab2('0xc')](_0x3ab2('0xd'),auth[_0x3ab2('0xa')](),controller[_0x3ab2('0xe')]);router[_0x3ab2('0xf')]('/',auth[_0x3ab2('0xa')](),controller[_0x3ab2('0x10')]);router[_0x3ab2('0x11')](_0x3ab2('0xd'),auth[_0x3ab2('0xa')](),controller[_0x3ab2('0x12')]);router[_0x3ab2('0x13')](_0x3ab2('0xd'),auth[_0x3ab2('0xa')](),controller[_0x3ab2('0x14')]);module[_0x3ab2('0x15')]=router; \ No newline at end of file +var _0xd956=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd956,0xf3));var _0x6d95=function(_0xe65463,_0x42e927){_0xe65463=_0xe65463-0x0;var _0x1a4fee=_0xd956[_0xe65463];return _0x1a4fee;};'use strict';var multer=require(_0x6d95('0x0'));var util=require(_0x6d95('0x1'));var path=require(_0x6d95('0x2'));var timeout=require(_0x6d95('0x3'));var express=require(_0x6d95('0x4'));var router=express[_0x6d95('0x5')]();var fs_extra=require(_0x6d95('0x6'));var auth=require(_0x6d95('0x7'));var interaction=require(_0x6d95('0x8'));var config=require(_0x6d95('0x9'));var controller=require(_0x6d95('0xa'));router[_0x6d95('0xb')]('/',auth[_0x6d95('0xc')](),controller['index']);router[_0x6d95('0xb')]('/:id',auth[_0x6d95('0xc')](),controller[_0x6d95('0xd')]);router[_0x6d95('0xe')]('/',auth[_0x6d95('0xc')](),controller[_0x6d95('0xf')]);router['put'](_0x6d95('0x10'),auth[_0x6d95('0xc')](),controller['update']);router[_0x6d95('0x11')]('/:id',auth[_0x6d95('0xc')](),controller[_0x6d95('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8854fab..9795d35 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 _0xb3e2=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x2aa8b8,_0x1c0e0b){var _0x18c608=function(_0x345f9e){while(--_0x345f9e){_0x2aa8b8['push'](_0x2aa8b8['shift']());}};_0x18c608(++_0x1c0e0b);}(_0xb3e2,0x124));var _0x2b3e=function(_0x1e6471,_0x505895){_0x1e6471=_0x1e6471-0x0;var _0x1639e1=_0xb3e2[_0x1e6471];return _0x1639e1;};'use strict';var Sequelize=require(_0x2b3e('0x0'));module[_0x2b3e('0x1')]={'type':{'type':Sequelize[_0x2b3e('0x2')]('string','variable',_0x2b3e('0x3'),'keyValue',_0x2b3e('0x4')),'defaultValue':_0x2b3e('0x5')},'content':{'type':Sequelize[_0x2b3e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2b3e('0x5'),'variable',_0x2b3e('0x3'))},'keyContent':{'type':Sequelize[_0x2b3e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2b3e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b3e('0x6')]}}; \ No newline at end of file +var _0x0c35=['keyValue','picklist','STRING','BOOLEAN','sequelize','string','variable'];(function(_0x22795e,_0x11640f){var _0x2ea9bc=function(_0x256cfa){while(--_0x256cfa){_0x22795e['push'](_0x22795e['shift']());}};_0x2ea9bc(++_0x11640f);}(_0x0c35,0x89));var _0x50c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c35[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x50c3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x50c3('0x1'),_0x50c3('0x2'),'customVariable',_0x50c3('0x3'),_0x50c3('0x4')),'defaultValue':_0x50c3('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x50c3('0x1'),_0x50c3('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x50c3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x50c3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 588df6c..9238ca5 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 _0x420d=['fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','stack','name','send','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x420d,0x12a));var _0xd420=function(_0x4c1ea9,_0x132032){_0x4c1ea9=_0x4c1ea9-0x0;var _0x1c2ebb=_0x420d[_0x4c1ea9];return _0x1c2ebb;};'use strict';var emlformat=require(_0xd420('0x0'));var rimraf=require(_0xd420('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd420('0x2'));var rp=require(_0xd420('0x3'));var moment=require(_0xd420('0x4'));var BPromise=require(_0xd420('0x5'));var Mustache=require(_0xd420('0x6'));var util=require('util');var path=require(_0xd420('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd420('0x8'));var fs=require('fs');var fs_extra=require(_0xd420('0x9'));var _=require(_0xd420('0xa'));var squel=require('squel');var crypto=require(_0xd420('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd420('0xc'));var toCsv=require(_0xd420('0xd'));var querystring=require(_0xd420('0xe'));var Papa=require(_0xd420('0xf'));var Redis=require(_0xd420('0x10'));var authService=require(_0xd420('0x11'));var qs=require(_0xd420('0x12'));var as=require(_0xd420('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd420('0x14'))(_0xd420('0x15'));var utils=require(_0xd420('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd420('0x17'));var db=require(_0xd420('0x18'))['db'];function respondWithStatusCode(_0x15bbe0,_0x27e354){_0x27e354=_0x27e354||0xcc;return function(_0x59d0b2){if(_0x59d0b2){return _0x15bbe0[_0xd420('0x19')](_0x27e354);}return _0x15bbe0[_0xd420('0x1a')](_0x27e354)['end']();};}function respondWithResult(_0x519015,_0x1a6312){_0x1a6312=_0x1a6312||0xc8;return function(_0x469f82){if(_0x469f82){return _0x519015[_0xd420('0x1a')](_0x1a6312)[_0xd420('0x1b')](_0x469f82);}};}function respondWithFilteredResult(_0x270c87,_0x1ee49b){return function(_0x199d0e){if(_0x199d0e){var _0x5e6b27=typeof _0x1ee49b[_0xd420('0x1c')]===_0xd420('0x1d')&&typeof _0x1ee49b[_0xd420('0x1e')]===_0xd420('0x1d');var _0x53a0cf=_0x199d0e['count'];var _0x4a8d24=_0x5e6b27?0x0:_0x1ee49b[_0xd420('0x1c')];var _0x59e135=_0x5e6b27?_0x199d0e[_0xd420('0x1f')]:_0x1ee49b[_0xd420('0x1c')]+_0x1ee49b['limit'];var _0x5864f4;if(_0x59e135>=_0x53a0cf){_0x59e135=_0x53a0cf;_0x5864f4=0xc8;}else{_0x5864f4=0xce;}_0x270c87['status'](_0x5864f4);return _0x270c87[_0xd420('0x20')](_0xd420('0x21'),_0x4a8d24+'-'+_0x59e135+'/'+_0x53a0cf)[_0xd420('0x1b')](_0x199d0e);}return null;};}function patchUpdates(_0x2be132){return function(_0x4c7c68){try{jsonpatch[_0xd420('0x22')](_0x4c7c68,_0x2be132,!![]);}catch(_0x1d4730){return BPromise['reject'](_0x1d4730);}return _0x4c7c68['save']();};}function saveUpdates(_0x4a5ab2,_0x4ff80a){return function(_0x1300ce){if(_0x1300ce){return _0x1300ce[_0xd420('0x23')](_0x4a5ab2)['then'](function(_0x97998f){return _0x97998f;});}return null;};}function removeEntity(_0x49afc7,_0x98919){return function(_0x3c306e){if(_0x3c306e){return _0x3c306e[_0xd420('0x24')]()[_0xd420('0x25')](function(){_0x49afc7[_0xd420('0x1a')](0xcc)[_0xd420('0x26')]();});}};}function handleEntityNotFound(_0x53c4b5,_0x1baad8){return function(_0x38bea7){if(!_0x38bea7){_0x53c4b5[_0xd420('0x19')](0x194);}return _0x38bea7;};}function handleError(_0x8aea14,_0x493c1d){_0x493c1d=_0x493c1d||0x1f4;return function(_0xb4f58b){logger['error'](_0xb4f58b[_0xd420('0x27')]);if(_0xb4f58b[_0xd420('0x28')]){delete _0xb4f58b[_0xd420('0x28')];}_0x8aea14[_0xd420('0x1a')](_0x493c1d)[_0xd420('0x29')](_0xb4f58b);};}exports[_0xd420('0x2a')]=function(_0x2fdf5d,_0xc2617c){var _0x19dc8e={},_0x211748={},_0x2b74bf={'count':0x0,'rows':[]};var _0x52f04f=_[_0xd420('0x2b')](db['Dynamics365Field'][_0xd420('0x2c')],function(_0x4ec5e9){return{'name':_0x4ec5e9['fieldName'],'type':_0x4ec5e9['type'][_0xd420('0x2d')]};});_0x211748['model']=_[_0xd420('0x2b')](_0x52f04f,'name');_0x211748[_0xd420('0x2e')]=_[_0xd420('0x2f')](_0x2fdf5d[_0xd420('0x2e')]);_0x211748['filters']=_[_0xd420('0x30')](_0x211748[_0xd420('0x31')],_0x211748[_0xd420('0x2e')]);_0x19dc8e[_0xd420('0x32')]=_['intersection'](_0x211748[_0xd420('0x31')],qs[_0xd420('0x33')](_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x33')]));_0x19dc8e['attributes']=_0x19dc8e[_0xd420('0x32')][_0xd420('0x34')]?_0x19dc8e[_0xd420('0x32')]:_0x211748[_0xd420('0x31')];if(!_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x35')](_0xd420('0x36'))){_0x19dc8e[_0xd420('0x1e')]=qs['limit'](_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x1e')]);_0x19dc8e[_0xd420('0x1c')]=qs[_0xd420('0x1c')](_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x1c')]);}_0x19dc8e[_0xd420('0x37')]=qs[_0xd420('0x38')](_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x38')]);_0x19dc8e[_0xd420('0x39')]=qs[_0xd420('0x3a')](_[_0xd420('0x3b')](_0x2fdf5d[_0xd420('0x2e')],_0x211748['filters']),_0x52f04f);if(_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x3c')]){_0x19dc8e['where']=_[_0xd420('0x3d')](_0x19dc8e[_0xd420('0x39')],{'$or':_[_0xd420('0x2b')](_0x52f04f,function(_0x337471){if(_0x337471[_0xd420('0x3e')]!=='VIRTUAL'){var _0x133081={};_0x133081[_0x337471[_0xd420('0x28')]]={'$like':'%'+_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x3c')]+'%'};return _0x133081;}})});}_0x19dc8e=_[_0xd420('0x3d')]({},_0x19dc8e,_0x2fdf5d[_0xd420('0x3f')]);var _0x474740={'where':_0x19dc8e[_0xd420('0x39')]};return db[_0xd420('0x40')]['count'](_0x474740)[_0xd420('0x25')](function(_0x490540){_0x2b74bf[_0xd420('0x1f')]=_0x490540;if(_0x2fdf5d[_0xd420('0x2e')][_0xd420('0x41')]){_0x19dc8e[_0xd420('0x42')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xd420('0x43')](_0x19dc8e);})[_0xd420('0x25')](function(_0x5dea2a){_0x2b74bf[_0xd420('0x44')]=_0x5dea2a;return _0x2b74bf;})[_0xd420('0x25')](respondWithFilteredResult(_0xc2617c,_0x19dc8e))[_0xd420('0x45')](handleError(_0xc2617c,null));};exports[_0xd420('0x46')]=function(_0x29f553,_0x54459f){var _0x490d80={'raw':!![],'where':{'id':_0x29f553[_0xd420('0x47')]['id']}},_0x59be30={};_0x59be30[_0xd420('0x31')]=_[_0xd420('0x2f')](db[_0xd420('0x40')][_0xd420('0x2c')]);_0x59be30['query']=_[_0xd420('0x2f')](_0x29f553['query']);_0x59be30[_0xd420('0x3a')]=_['intersection'](_0x59be30[_0xd420('0x31')],_0x59be30['query']);_0x490d80[_0xd420('0x32')]=_[_0xd420('0x30')](_0x59be30['model'],qs[_0xd420('0x33')](_0x29f553['query'][_0xd420('0x33')]));_0x490d80[_0xd420('0x32')]=_0x490d80[_0xd420('0x32')][_0xd420('0x34')]?_0x490d80[_0xd420('0x32')]:_0x59be30[_0xd420('0x31')];if(_0x29f553['query'][_0xd420('0x41')]){_0x490d80[_0xd420('0x42')]=[{'all':!![]}];}_0x490d80=_[_0xd420('0x3d')]({},_0x490d80,_0x29f553[_0xd420('0x3f')]);return db[_0xd420('0x40')][_0xd420('0x48')](_0x490d80)['then'](handleEntityNotFound(_0x54459f,null))[_0xd420('0x25')](respondWithResult(_0x54459f,null))[_0xd420('0x45')](handleError(_0x54459f,null));};exports[_0xd420('0x49')]=function(_0x1fd208,_0x161805){return db[_0xd420('0x40')][_0xd420('0x49')](_0x1fd208[_0xd420('0x4a')],{})[_0xd420('0x25')](respondWithResult(_0x161805,0xc9))['catch'](handleError(_0x161805,null));};exports[_0xd420('0x23')]=function(_0x2ab840,_0x1612d7){if(_0x2ab840[_0xd420('0x4a')]['id']){delete _0x2ab840[_0xd420('0x4a')]['id'];}return db[_0xd420('0x40')]['find']({'where':{'id':_0x2ab840[_0xd420('0x47')]['id']}})[_0xd420('0x25')](handleEntityNotFound(_0x1612d7,null))[_0xd420('0x25')](saveUpdates(_0x2ab840[_0xd420('0x4a')],null))[_0xd420('0x25')](respondWithResult(_0x1612d7,null))[_0xd420('0x45')](handleError(_0x1612d7,null));};exports[_0xd420('0x24')]=function(_0x40c4e4,_0x421cb8){return db[_0xd420('0x40')][_0xd420('0x48')]({'where':{'id':_0x40c4e4[_0xd420('0x47')]['id']}})[_0xd420('0x25')](handleEntityNotFound(_0x421cb8,null))[_0xd420('0x25')](removeEntity(_0x421cb8,null))['catch'](handleError(_0x421cb8,null));}; \ No newline at end of file +var _0x21fb=['find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21fb,0x13e));var _0xb21f=function(_0x9ca94e,_0x2d3caa){_0x9ca94e=_0x9ca94e-0x0;var _0x1f9d8a=_0x21fb[_0x9ca94e];return _0x1f9d8a;};'use strict';var emlformat=require(_0xb21f('0x0'));var rimraf=require(_0xb21f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb21f('0x2'));var rp=require(_0xb21f('0x3'));var moment=require(_0xb21f('0x4'));var BPromise=require(_0xb21f('0x5'));var Mustache=require(_0xb21f('0x6'));var util=require(_0xb21f('0x7'));var path=require(_0xb21f('0x8'));var sox=require(_0xb21f('0x9'));var csv=require(_0xb21f('0xa'));var ejs=require(_0xb21f('0xb'));var fs=require('fs');var fs_extra=require(_0xb21f('0xc'));var _=require(_0xb21f('0xd'));var squel=require(_0xb21f('0xe'));var crypto=require(_0xb21f('0xf'));var jsforce=require(_0xb21f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb21f('0xa'));var querystring=require(_0xb21f('0x11'));var Papa=require(_0xb21f('0x12'));var Redis=require(_0xb21f('0x13'));var authService=require(_0xb21f('0x14'));var qs=require(_0xb21f('0x15'));var as=require(_0xb21f('0x16'));var hardwareService=require(_0xb21f('0x17'));var logger=require(_0xb21f('0x18'))(_0xb21f('0x19'));var utils=require(_0xb21f('0x1a'));var config=require(_0xb21f('0x1b'));var licenseUtil=require(_0xb21f('0x1c'));var db=require(_0xb21f('0x1d'))['db'];function respondWithStatusCode(_0x1dcb15,_0x4e27a8){_0x4e27a8=_0x4e27a8||0xcc;return function(_0x228d2b){if(_0x228d2b){return _0x1dcb15[_0xb21f('0x1e')](_0x4e27a8);}return _0x1dcb15[_0xb21f('0x1f')](_0x4e27a8)[_0xb21f('0x20')]();};}function respondWithResult(_0x3a7eb0,_0x4ce353){_0x4ce353=_0x4ce353||0xc8;return function(_0x5abbce){if(_0x5abbce){return _0x3a7eb0[_0xb21f('0x1f')](_0x4ce353)[_0xb21f('0x21')](_0x5abbce);}};}function respondWithFilteredResult(_0x3381c9,_0x12dae5){return function(_0x5656cb){if(_0x5656cb){var _0x161ad2=typeof _0x12dae5[_0xb21f('0x22')]==='undefined'&&typeof _0x12dae5[_0xb21f('0x23')]==='undefined';var _0x2b5b5e=_0x5656cb['count'];var _0x188370=_0x161ad2?0x0:_0x12dae5['offset'];var _0x466c1d=_0x161ad2?_0x5656cb[_0xb21f('0x24')]:_0x12dae5[_0xb21f('0x22')]+_0x12dae5['limit'];var _0x21afff;if(_0x466c1d>=_0x2b5b5e){_0x466c1d=_0x2b5b5e;_0x21afff=0xc8;}else{_0x21afff=0xce;}_0x3381c9['status'](_0x21afff);return _0x3381c9['set'](_0xb21f('0x25'),_0x188370+'-'+_0x466c1d+'/'+_0x2b5b5e)[_0xb21f('0x21')](_0x5656cb);}return null;};}function patchUpdates(_0x3f30b0){return function(_0x39e1bf){try{jsonpatch['apply'](_0x39e1bf,_0x3f30b0,!![]);}catch(_0x4bdc27){return BPromise[_0xb21f('0x26')](_0x4bdc27);}return _0x39e1bf[_0xb21f('0x27')]();};}function saveUpdates(_0xed4af7,_0x2ec215){return function(_0x2d9c0f){if(_0x2d9c0f){return _0x2d9c0f[_0xb21f('0x28')](_0xed4af7)[_0xb21f('0x29')](function(_0x162e27){return _0x162e27;});}return null;};}function removeEntity(_0xc9c99d,_0x8a162d){return function(_0x135fe3){if(_0x135fe3){return _0x135fe3['destroy']()[_0xb21f('0x29')](function(){_0xc9c99d[_0xb21f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b92ed,_0x4ccd2f){return function(_0x3671e8){if(!_0x3671e8){_0x4b92ed[_0xb21f('0x1e')](0x194);}return _0x3671e8;};}function handleError(_0x17b433,_0x19cd9f){_0x19cd9f=_0x19cd9f||0x1f4;return function(_0xc4e39e){logger[_0xb21f('0x2a')](_0xc4e39e[_0xb21f('0x2b')]);if(_0xc4e39e['name']){delete _0xc4e39e[_0xb21f('0x2c')];}_0x17b433[_0xb21f('0x1f')](_0x19cd9f)[_0xb21f('0x2d')](_0xc4e39e);};}exports[_0xb21f('0x2e')]=function(_0x1d6bfc,_0x331e76){var _0x259ed6={},_0x41ffee={},_0x263bd2={'count':0x0,'rows':[]};var _0x963de1=_[_0xb21f('0x2f')](db[_0xb21f('0x30')]['rawAttributes'],function(_0x37c866){return{'name':_0x37c866[_0xb21f('0x31')],'type':_0x37c866[_0xb21f('0x32')][_0xb21f('0x33')]};});_0x41ffee[_0xb21f('0x34')]=_[_0xb21f('0x2f')](_0x963de1,'name');_0x41ffee[_0xb21f('0x35')]=_[_0xb21f('0x36')](_0x1d6bfc[_0xb21f('0x35')]);_0x41ffee[_0xb21f('0x37')]=_['intersection'](_0x41ffee[_0xb21f('0x34')],_0x41ffee['query']);_0x259ed6[_0xb21f('0x38')]=_[_0xb21f('0x39')](_0x41ffee[_0xb21f('0x34')],qs[_0xb21f('0x3a')](_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x3a')]));_0x259ed6['attributes']=_0x259ed6[_0xb21f('0x38')][_0xb21f('0x3b')]?_0x259ed6[_0xb21f('0x38')]:_0x41ffee[_0xb21f('0x34')];if(!_0x1d6bfc['query'][_0xb21f('0x3c')]('nolimit')){_0x259ed6[_0xb21f('0x23')]=qs['limit'](_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x23')]);_0x259ed6[_0xb21f('0x22')]=qs[_0xb21f('0x22')](_0x1d6bfc['query'][_0xb21f('0x22')]);}_0x259ed6[_0xb21f('0x3d')]=qs[_0xb21f('0x3e')](_0x1d6bfc[_0xb21f('0x35')]['sort']);_0x259ed6['where']=qs[_0xb21f('0x37')](_[_0xb21f('0x3f')](_0x1d6bfc[_0xb21f('0x35')],_0x41ffee[_0xb21f('0x37')]),_0x963de1);if(_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x40')]){_0x259ed6[_0xb21f('0x41')]=_[_0xb21f('0x42')](_0x259ed6[_0xb21f('0x41')],{'$or':_[_0xb21f('0x2f')](_0x963de1,function(_0x4b48a0){if(_0x4b48a0[_0xb21f('0x32')]!==_0xb21f('0x43')){var _0x3103f8={};_0x3103f8[_0x4b48a0[_0xb21f('0x2c')]]={'$like':'%'+_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x40')]+'%'};return _0x3103f8;}})});}_0x259ed6=_[_0xb21f('0x42')]({},_0x259ed6,_0x1d6bfc[_0xb21f('0x44')]);var _0x193dff={'where':_0x259ed6[_0xb21f('0x41')]};return db[_0xb21f('0x30')][_0xb21f('0x24')](_0x193dff)[_0xb21f('0x29')](function(_0x14b5a9){_0x263bd2[_0xb21f('0x24')]=_0x14b5a9;if(_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x45')]){_0x259ed6[_0xb21f('0x46')]=[{'all':!![]}];}return db[_0xb21f('0x30')]['findAll'](_0x259ed6);})[_0xb21f('0x29')](function(_0xe6f3e1){_0x263bd2[_0xb21f('0x47')]=_0xe6f3e1;return _0x263bd2;})[_0xb21f('0x29')](respondWithFilteredResult(_0x331e76,_0x259ed6))['catch'](handleError(_0x331e76,null));};exports[_0xb21f('0x48')]=function(_0x4ae518,_0x11da1f){var _0x170e39={'raw':!![],'where':{'id':_0x4ae518[_0xb21f('0x49')]['id']}},_0x1d6313={};_0x1d6313[_0xb21f('0x34')]=_[_0xb21f('0x36')](db[_0xb21f('0x30')][_0xb21f('0x4a')]);_0x1d6313[_0xb21f('0x35')]=_[_0xb21f('0x36')](_0x4ae518[_0xb21f('0x35')]);_0x1d6313[_0xb21f('0x37')]=_[_0xb21f('0x39')](_0x1d6313[_0xb21f('0x34')],_0x1d6313[_0xb21f('0x35')]);_0x170e39[_0xb21f('0x38')]=_[_0xb21f('0x39')](_0x1d6313[_0xb21f('0x34')],qs[_0xb21f('0x3a')](_0x4ae518['query'][_0xb21f('0x3a')]));_0x170e39['attributes']=_0x170e39[_0xb21f('0x38')][_0xb21f('0x3b')]?_0x170e39['attributes']:_0x1d6313[_0xb21f('0x34')];if(_0x4ae518['query']['includeAll']){_0x170e39[_0xb21f('0x46')]=[{'all':!![]}];}_0x170e39=_[_0xb21f('0x42')]({},_0x170e39,_0x4ae518['options']);return db[_0xb21f('0x30')]['find'](_0x170e39)[_0xb21f('0x29')](handleEntityNotFound(_0x11da1f,null))[_0xb21f('0x29')](respondWithResult(_0x11da1f,null))['catch'](handleError(_0x11da1f,null));};exports['create']=function(_0x3dfb1d,_0x2f1521){return db['Dynamics365Field'][_0xb21f('0x4b')](_0x3dfb1d[_0xb21f('0x4c')],{})['then'](respondWithResult(_0x2f1521,0xc9))['catch'](handleError(_0x2f1521,null));};exports['update']=function(_0x183a68,_0x47c907){if(_0x183a68[_0xb21f('0x4c')]['id']){delete _0x183a68['body']['id'];}return db[_0xb21f('0x30')][_0xb21f('0x4d')]({'where':{'id':_0x183a68[_0xb21f('0x49')]['id']}})['then'](handleEntityNotFound(_0x47c907,null))[_0xb21f('0x29')](saveUpdates(_0x183a68[_0xb21f('0x4c')],null))[_0xb21f('0x29')](respondWithResult(_0x47c907,null))[_0xb21f('0x4e')](handleError(_0x47c907,null));};exports['destroy']=function(_0x356269,_0x5a249a){return db[_0xb21f('0x30')][_0xb21f('0x4d')]({'where':{'id':_0x356269['params']['id']}})[_0xb21f('0x29')](handleEntityNotFound(_0x5a249a,null))[_0xb21f('0x29')](removeEntity(_0x5a249a,null))[_0xb21f('0x4e')](handleError(_0x5a249a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index f0a2b47..9c6f238 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 _0x1487=['../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','api','bluebird','path'];(function(_0x52bb25,_0x51cc54){var _0x27fc73=function(_0x6e74cc){while(--_0x6e74cc){_0x52bb25['push'](_0x52bb25['shift']());}};_0x27fc73(++_0x51cc54);}(_0x1487,0x193));var _0x7148=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x1487[_0x12e3e3];return _0x26602e;};'use strict';var _=require(_0x7148('0x0'));var util=require(_0x7148('0x1'));var logger=require('../../config/logger')(_0x7148('0x2'));var moment=require('moment');var BPromise=require(_0x7148('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7148('0x4'));var rimraf=require('rimraf');var config=require(_0x7148('0x5'));var attributes=require(_0x7148('0x6'));module['exports']=function(_0x151be9,_0x41af5a){return _0x151be9[_0x7148('0x7')](_0x7148('0x8'),attributes,{'tableName':_0x7148('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7148('0xa'),_0x7148('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb0b=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x14dd4f,_0x26964e){var _0xdf6c68=function(_0x4f7d22){while(--_0x4f7d22){_0x14dd4f['push'](_0x14dd4f['shift']());}};_0xdf6c68(++_0x26964e);}(_0xfb0b,0x166));var _0xbfb0=function(_0x1463b7,_0x28f54e){_0x1463b7=_0x1463b7-0x0;var _0x5eeeab=_0xfb0b[_0x1463b7];return _0x5eeeab;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbfb0('0x2'));var BPromise=require(_0xbfb0('0x3'));var rp=require(_0xbfb0('0x4'));var fs=require('fs');var path=require(_0xbfb0('0x5'));var rimraf=require(_0xbfb0('0x6'));var config=require(_0xbfb0('0x7'));var attributes=require(_0xbfb0('0x8'));module[_0xbfb0('0x9')]=function(_0x479251,_0x503ff7){return _0x479251[_0xbfb0('0xa')](_0xbfb0('0xb'),attributes,{'tableName':_0xbfb0('0xc'),'paranoid':![],'indexes':[{'name':_0xbfb0('0xd'),'fields':[_0xbfb0('0xe'),_0xbfb0('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 45b7e25..d6de86d 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 _0x903d=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4e8a48,_0x12ffe2){var _0x3d5d35=function(_0x5abaa2){while(--_0x5abaa2){_0x4e8a48['push'](_0x4e8a48['shift']());}};_0x3d5d35(++_0x12ffe2);}(_0x903d,0xf4));var _0xd903=function(_0x1badb7,_0x27c5a1){_0x1badb7=_0x1badb7-0x0;var _0x2152aa=_0x903d[_0x1badb7];return _0x2152aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd903('0x0'));var BPromise=require(_0xd903('0x1'));var rs=require(_0xd903('0x2'));var fs=require('fs');var Redis=require(_0xd903('0x3'));var db=require(_0xd903('0x4'))['db'];var utils=require(_0xd903('0x5'));var logger=require('../../config/logger')(_0xd903('0x6'));var config=require(_0xd903('0x7'));var jayson=require(_0xd903('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e83b9,_0x529f,_0x37414b){return new BPromise(function(_0x49df1d,_0x35dba0){return client[_0xd903('0x9')](_0x4e83b9,_0x37414b)[_0xd903('0xa')](function(_0x4f1bba){logger['info'](_0xd903('0xb'),_0x529f,'request\x20sent');logger[_0xd903('0xc')](_0xd903('0xd'),_0x529f,_0xd903('0xe'),JSON[_0xd903('0xf')](_0x4f1bba));if(_0x4f1bba[_0xd903('0x10')]){if(_0x4f1bba[_0xd903('0x10')][_0xd903('0x11')]===0x1f4){logger[_0xd903('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x529f,_0x4f1bba[_0xd903('0x10')]['message']);return _0x35dba0(_0x4f1bba[_0xd903('0x10')][_0xd903('0x12')]);}logger[_0xd903('0x10')](_0xd903('0xb'),_0x529f,_0x4f1bba[_0xd903('0x10')][_0xd903('0x12')]);return _0x49df1d(_0x4f1bba[_0xd903('0x10')][_0xd903('0x12')]);}else{logger[_0xd903('0x13')](_0xd903('0xb'),_0x529f,_0xd903('0xe'));_0x49df1d(_0x4f1bba[_0xd903('0x14')][_0xd903('0x12')]);}})[_0xd903('0x15')](function(_0xe10b47){logger[_0xd903('0x10')](_0xd903('0xb'),_0x529f,_0xe10b47);_0x35dba0(_0xe10b47);});});} \ No newline at end of file +var _0xd5f1=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd5f1,0x78));var _0x1d5f=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0xd5f1[_0x4066c2];return _0x3870a0;};'use strict';var _=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var moment=require(_0x1d5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d5f('0x3'));var fs=require('fs');var Redis=require(_0x1d5f('0x4'));var db=require(_0x1d5f('0x5'))['db'];var utils=require(_0x1d5f('0x6'));var logger=require(_0x1d5f('0x7'))(_0x1d5f('0x8'));var config=require(_0x1d5f('0x9'));var jayson=require(_0x1d5f('0xa'));var client=jayson[_0x1d5f('0xb')][_0x1d5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2200d6,_0x1dbe26,_0x21f6d9){return new BPromise(function(_0x3120a1,_0x59392f){return client[_0x1d5f('0xd')](_0x2200d6,_0x21f6d9)[_0x1d5f('0xe')](function(_0x97a85c){logger[_0x1d5f('0xf')](_0x1d5f('0x10'),_0x1dbe26,_0x1d5f('0x11'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1dbe26,'request\x20sent',JSON[_0x1d5f('0x12')](_0x97a85c));if(_0x97a85c[_0x1d5f('0x13')]){if(_0x97a85c[_0x1d5f('0x13')][_0x1d5f('0x14')]===0x1f4){logger[_0x1d5f('0x13')](_0x1d5f('0x10'),_0x1dbe26,_0x97a85c[_0x1d5f('0x13')]['message']);return _0x59392f(_0x97a85c[_0x1d5f('0x13')]['message']);}logger[_0x1d5f('0x13')](_0x1d5f('0x10'),_0x1dbe26,_0x97a85c['error']['message']);return _0x3120a1(_0x97a85c['error'][_0x1d5f('0x15')]);}else{logger[_0x1d5f('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x1dbe26,_0x1d5f('0x11'));_0x3120a1(_0x97a85c[_0x1d5f('0x16')][_0x1d5f('0x15')]);}})[_0x1d5f('0x17')](function(_0x3a0032){logger[_0x1d5f('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x1dbe26,_0x3a0032);_0x59392f(_0x3a0032);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 30fb70b..d652ba9 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 _0x9e36=['update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x1a922f,_0x560289){var _0x4ccb1c=function(_0x21ac6c){while(--_0x21ac6c){_0x1a922f['push'](_0x1a922f['shift']());}};_0x4ccb1c(++_0x560289);}(_0x9e36,0xea));var _0x69e3=function(_0x4bbfeb,_0x2bd851){_0x4bbfeb=_0x4bbfeb-0x0;var _0x2df4a3=_0x9e36[_0x4bbfeb];return _0x2df4a3;};'use strict';var multer=require(_0x69e3('0x0'));var util=require(_0x69e3('0x1'));var path=require(_0x69e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x69e3('0x3'));var router=express[_0x69e3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x69e3('0x5'));var config=require(_0x69e3('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x69e3('0x7')]);router[_0x69e3('0x8')](_0x69e3('0x9'),auth[_0x69e3('0xa')](),controller[_0x69e3('0xb')]);router[_0x69e3('0x8')]('/:id/configurations',auth[_0x69e3('0xa')](),controller['getConfigurations']);router['get'](_0x69e3('0xc'),auth[_0x69e3('0xa')](),controller[_0x69e3('0xd')]);router[_0x69e3('0xe')]('/',auth[_0x69e3('0xa')](),controller[_0x69e3('0xf')]);router[_0x69e3('0xe')]('/:id/configurations',auth[_0x69e3('0xa')](),controller[_0x69e3('0x10')]);router[_0x69e3('0x11')](_0x69e3('0x9'),auth['isAuthenticated'](),controller[_0x69e3('0x12')]);router['delete'](_0x69e3('0x9'),auth[_0x69e3('0xa')](),controller[_0x69e3('0x13')]);module[_0x69e3('0x14')]=router; \ No newline at end of file +var _0x1889=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x5f65e5,_0x53b531){var _0x4da00d=function(_0x47baf1){while(--_0x47baf1){_0x5f65e5['push'](_0x5f65e5['shift']());}};_0x4da00d(++_0x53b531);}(_0x1889,0xdd));var _0x9188=function(_0x351dd1,_0x46fb55){_0x351dd1=_0x351dd1-0x0;var _0x1fd43d=_0x1889[_0x351dd1];return _0x1fd43d;};'use strict';var multer=require(_0x9188('0x0'));var util=require(_0x9188('0x1'));var path=require(_0x9188('0x2'));var timeout=require(_0x9188('0x3'));var express=require('express');var router=express[_0x9188('0x4')]();var fs_extra=require(_0x9188('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9188('0x6'));var controller=require(_0x9188('0x7'));router[_0x9188('0x8')]('/',auth[_0x9188('0x9')](),controller[_0x9188('0xa')]);router[_0x9188('0x8')](_0x9188('0xb'),auth[_0x9188('0x9')](),controller[_0x9188('0xc')]);router['get'](_0x9188('0xd'),auth['isAuthenticated'](),controller[_0x9188('0xe')]);router['get'](_0x9188('0xf'),auth[_0x9188('0x9')](),controller[_0x9188('0x10')]);router['post']('/',auth[_0x9188('0x9')](),controller[_0x9188('0x11')]);router[_0x9188('0x12')]('/:id/configurations',auth[_0x9188('0x9')](),controller[_0x9188('0x13')]);router[_0x9188('0x14')](_0x9188('0xb'),auth[_0x9188('0x9')](),controller[_0x9188('0x15')]);router['delete'](_0x9188('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9188('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 7e76a68..d2a5573 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 _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x311c0f,_0x1af0d1){var _0x3303bf=function(_0x2db392){while(--_0x2db392){_0x311c0f['push'](_0x311c0f['shift']());}};_0x3303bf(++_0x1af0d1);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6d38=['exports','STRING','remoteUri'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x6d38,0x1ef));var _0x86d3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6d38[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'name':{'type':Sequelize[_0x86d3('0x1')]},'description':{'type':Sequelize[_0x86d3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x86d3('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x86d3('0x2')},'serverUrl':{'type':Sequelize[_0x86d3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index dbfd3c0..e37eb9a 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 _0x780f=['request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','send','index','map','FreshdeskAccount','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','toString','base64','requester','agent','description','priority','group','ticket_type','company','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1432c3,_0x46036f){var _0x4e71bd=function(_0x3678be){while(--_0x3678be){_0x1432c3['push'](_0x1432c3['shift']());}};_0x4e71bd(++_0x46036f);}(_0x780f,0x6c));var _0xf780=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x780f[_0x57db49];return _0xd0636f;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require(_0xf780('0x1'));var zipdir=require(_0xf780('0x2'));var jsonpatch=require(_0xf780('0x3'));var rp=require(_0xf780('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf780('0x5'));var util=require(_0xf780('0x6'));var path=require(_0xf780('0x7'));var sox=require(_0xf780('0x8'));var csv=require('to-csv');var ejs=require(_0xf780('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf780('0xa'));var squel=require(_0xf780('0xb'));var crypto=require(_0xf780('0xc'));var jsforce=require(_0xf780('0xd'));var deskjs=require(_0xf780('0xe'));var toCsv=require(_0xf780('0xf'));var querystring=require('querystring');var Papa=require(_0xf780('0x10'));var Redis=require(_0xf780('0x11'));var authService=require(_0xf780('0x12'));var qs=require(_0xf780('0x13'));var as=require(_0xf780('0x14'));var hardwareService=require(_0xf780('0x15'));var logger=require(_0xf780('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf780('0x17'));var licenseUtil=require(_0xf780('0x18'));var db=require(_0xf780('0x19'))['db'];var integrations=require(_0xf780('0x1a'));function respondWithStatusCode(_0x5f04e1,_0x24aa4f){_0x24aa4f=_0x24aa4f||0xcc;return function(_0xcf2da6){if(_0xcf2da6){return _0x5f04e1[_0xf780('0x1b')](_0x24aa4f);}return _0x5f04e1[_0xf780('0x1c')](_0x24aa4f)['end']();};}function respondWithResult(_0x5a64bc,_0x4be599){_0x4be599=_0x4be599||0xc8;return function(_0x2a19fb){if(_0x2a19fb){return _0x5a64bc[_0xf780('0x1c')](_0x4be599)[_0xf780('0x1d')](_0x2a19fb);}};}function respondWithFilteredResult(_0x187b6d,_0x206d34){return function(_0x335ba6){if(_0x335ba6){var _0x422ef4=typeof _0x206d34['offset']===_0xf780('0x1e')&&typeof _0x206d34[_0xf780('0x1f')]===_0xf780('0x1e');var _0x113834=_0x335ba6[_0xf780('0x20')];var _0x188554=_0x422ef4?0x0:_0x206d34['offset'];var _0x3ede41=_0x422ef4?_0x335ba6[_0xf780('0x20')]:_0x206d34['offset']+_0x206d34[_0xf780('0x1f')];var _0x3fe0a7;if(_0x3ede41>=_0x113834){_0x3ede41=_0x113834;_0x3fe0a7=0xc8;}else{_0x3fe0a7=0xce;}_0x187b6d['status'](_0x3fe0a7);return _0x187b6d[_0xf780('0x21')](_0xf780('0x22'),_0x188554+'-'+_0x3ede41+'/'+_0x113834)[_0xf780('0x1d')](_0x335ba6);}return null;};}function patchUpdates(_0x4065bb){return function(_0x352cf1){try{jsonpatch[_0xf780('0x23')](_0x352cf1,_0x4065bb,!![]);}catch(_0x504f6f){return BPromise[_0xf780('0x24')](_0x504f6f);}return _0x352cf1['save']();};}function saveUpdates(_0x5853ea,_0x45d80e){return function(_0x51b921){if(_0x51b921){return _0x51b921[_0xf780('0x25')](_0x5853ea)['then'](function(_0x2fcb2d){return _0x2fcb2d;});}return null;};}function removeEntity(_0x373dce,_0x4f59b1){return function(_0x3a8327){if(_0x3a8327){return _0x3a8327['destroy']()[_0xf780('0x26')](function(){_0x373dce[_0xf780('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589208,_0x3710bb){return function(_0x1ef4f1){if(!_0x1ef4f1){_0x589208[_0xf780('0x1b')](0x194);}return _0x1ef4f1;};}function handleError(_0x40d9c9,_0x458c76){_0x458c76=_0x458c76||0x1f4;return function(_0x2bd6cf){logger[_0xf780('0x27')](_0x2bd6cf['stack']);if(_0x2bd6cf['name']){delete _0x2bd6cf['name'];}_0x40d9c9[_0xf780('0x1c')](_0x458c76)[_0xf780('0x28')](_0x2bd6cf);};}exports[_0xf780('0x29')]=function(_0x4ef8c3,_0x4ed256){var _0x36bc63={},_0x149190={},_0x2b832d={'count':0x0,'rows':[]};var _0x5e6b25=_[_0xf780('0x2a')](db[_0xf780('0x2b')][_0xf780('0x2c')],function(_0x302594){return{'name':_0x302594['fieldName'],'type':_0x302594[_0xf780('0x2d')]['key']};});_0x149190[_0xf780('0x2e')]=_[_0xf780('0x2a')](_0x5e6b25,_0xf780('0x2f'));_0x149190[_0xf780('0x30')]=_[_0xf780('0x31')](_0x4ef8c3[_0xf780('0x30')]);_0x149190[_0xf780('0x32')]=_[_0xf780('0x33')](_0x149190['model'],_0x149190[_0xf780('0x30')]);_0x36bc63[_0xf780('0x34')]=_[_0xf780('0x33')](_0x149190[_0xf780('0x2e')],qs[_0xf780('0x35')](_0x4ef8c3['query'][_0xf780('0x35')]));_0x36bc63['attributes']=_0x36bc63[_0xf780('0x34')][_0xf780('0x36')]?_0x36bc63[_0xf780('0x34')]:_0x149190['model'];if(!_0x4ef8c3[_0xf780('0x30')][_0xf780('0x37')](_0xf780('0x38'))){_0x36bc63[_0xf780('0x1f')]=qs['limit'](_0x4ef8c3[_0xf780('0x30')]['limit']);_0x36bc63[_0xf780('0x39')]=qs['offset'](_0x4ef8c3['query'][_0xf780('0x39')]);}_0x36bc63['order']=qs[_0xf780('0x3a')](_0x4ef8c3[_0xf780('0x30')][_0xf780('0x3a')]);_0x36bc63[_0xf780('0x3b')]=qs['filters'](_[_0xf780('0x3c')](_0x4ef8c3[_0xf780('0x30')],_0x149190[_0xf780('0x32')]),_0x5e6b25);if(_0x4ef8c3[_0xf780('0x30')]['filter']){_0x36bc63[_0xf780('0x3b')]=_[_0xf780('0x3d')](_0x36bc63[_0xf780('0x3b')],{'$or':_[_0xf780('0x2a')](_0x5e6b25,function(_0x1a5ebf){if(_0x1a5ebf['type']!=='VIRTUAL'){var _0x3297c9={};_0x3297c9[_0x1a5ebf[_0xf780('0x2f')]]={'$like':'%'+_0x4ef8c3[_0xf780('0x30')][_0xf780('0x3e')]+'%'};return _0x3297c9;}})});}_0x36bc63=_[_0xf780('0x3d')]({},_0x36bc63,_0x4ef8c3['options']);var _0x1c8eb3={'where':_0x36bc63['where']};return db[_0xf780('0x2b')][_0xf780('0x20')](_0x1c8eb3)[_0xf780('0x26')](function(_0x120465){_0x2b832d['count']=_0x120465;if(_0x4ef8c3[_0xf780('0x30')][_0xf780('0x3f')]){_0x36bc63[_0xf780('0x40')]=[{'all':!![]}];}return db[_0xf780('0x2b')][_0xf780('0x41')](_0x36bc63);})[_0xf780('0x26')](function(_0x2109dc){_0x2b832d[_0xf780('0x42')]=_0x2109dc;return _0x2b832d;})[_0xf780('0x26')](respondWithFilteredResult(_0x4ed256,_0x36bc63))[_0xf780('0x43')](handleError(_0x4ed256,null));};exports[_0xf780('0x44')]=function(_0x30a036,_0x406a9e){var _0x42a710={'raw':![],'where':{'id':_0x30a036[_0xf780('0x45')]['id']}},_0x558b9a={};_0x558b9a['model']=_[_0xf780('0x31')](db[_0xf780('0x2b')]['rawAttributes']);_0x558b9a['query']=_['keys'](_0x30a036['query']);_0x558b9a[_0xf780('0x32')]=_['intersection'](_0x558b9a[_0xf780('0x2e')],_0x558b9a[_0xf780('0x30')]);_0x42a710[_0xf780('0x34')]=_[_0xf780('0x33')](_0x558b9a[_0xf780('0x2e')],qs['fields'](_0x30a036['query']['fields']));_0x42a710['attributes']=_0x42a710[_0xf780('0x34')][_0xf780('0x36')]?_0x42a710[_0xf780('0x34')]:_0x558b9a[_0xf780('0x2e')];if(_0x30a036[_0xf780('0x30')][_0xf780('0x3f')]){_0x42a710['include']=[{'all':!![]}];}_0x42a710=_[_0xf780('0x3d')]({},_0x42a710,_0x30a036[_0xf780('0x46')]);return db[_0xf780('0x2b')][_0xf780('0x47')](_0x42a710)[_0xf780('0x26')](handleEntityNotFound(_0x406a9e,null))[_0xf780('0x26')](respondWithResult(_0x406a9e,null))['catch'](handleError(_0x406a9e,null));};exports[_0xf780('0x48')]=function(_0x5c4170,_0x2f08f3){return db['FreshdeskAccount'][_0xf780('0x48')](_0x5c4170['body'],{})['then'](respondWithResult(_0x2f08f3,0xc9))[_0xf780('0x43')](handleError(_0x2f08f3,null));};exports[_0xf780('0x25')]=function(_0x189717,_0x2946a1){if(_0x189717['body']['id']){delete _0x189717[_0xf780('0x49')]['id'];}return db[_0xf780('0x2b')][_0xf780('0x47')]({'where':{'id':_0x189717[_0xf780('0x45')]['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x2946a1,null))['then'](saveUpdates(_0x189717[_0xf780('0x49')],null))['then'](respondWithResult(_0x2946a1,null))[_0xf780('0x43')](handleError(_0x2946a1,null));};exports[_0xf780('0x4a')]=function(_0x22c52d,_0x45ae96){return db[_0xf780('0x2b')]['find']({'where':{'id':_0x22c52d['params']['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x45ae96,null))[_0xf780('0x26')](removeEntity(_0x45ae96,null))[_0xf780('0x43')](handleError(_0x45ae96,null));};exports[_0xf780('0x4b')]=function(_0x4eebe5,_0x4094d5,_0x476354){var _0x180507={};var _0x3f71d2={};var _0x42bcc6;var _0x3b98c7;return db['FreshdeskAccount'][_0xf780('0x4c')]({'where':{'id':_0x4eebe5[_0xf780('0x45')]['id']}})['then'](handleEntityNotFound(_0x4094d5,null))[_0xf780('0x26')](function(_0x1f1907){if(_0x1f1907){_0x42bcc6=_0x1f1907;_0x3f71d2[_0xf780('0x2e')]=_[_0xf780('0x31')](db[_0xf780('0x4d')][_0xf780('0x2c')]);_0x3f71d2[_0xf780('0x30')]=_[_0xf780('0x31')](_0x4eebe5[_0xf780('0x30')]);_0x3f71d2[_0xf780('0x32')]=_[_0xf780('0x33')](_0x3f71d2[_0xf780('0x2e')],_0x3f71d2['query']);_0x180507[_0xf780('0x34')]=_['intersection'](_0x3f71d2[_0xf780('0x2e')],qs[_0xf780('0x35')](_0x4eebe5['query']['fields']));_0x180507['attributes']=_0x180507[_0xf780('0x34')][_0xf780('0x36')]?_0x180507[_0xf780('0x34')]:_0x3f71d2['model'];_0x180507['order']=qs['sort'](_0x4eebe5[_0xf780('0x30')]['sort']);_0x180507[_0xf780('0x3b')]=qs[_0xf780('0x32')](_[_0xf780('0x3c')](_0x4eebe5['query'],_0x3f71d2[_0xf780('0x32')]));if(_0x4eebe5['query'][_0xf780('0x3e')]){_0x180507[_0xf780('0x3b')]=_['merge'](_0x180507[_0xf780('0x3b')],{'$or':_[_0xf780('0x2a')](_0x180507[_0xf780('0x34')],function(_0x1c6799){var _0x2abf0e={};_0x2abf0e[_0x1c6799]={'$like':'%'+_0x4eebe5[_0xf780('0x30')][_0xf780('0x3e')]+'%'};return _0x2abf0e;})});}_0x180507=_['merge']({},_0x180507,_0x4eebe5['options']);return _0x42bcc6[_0xf780('0x4b')](_0x180507);}})[_0xf780('0x26')](function(_0x586545){if(_0x586545){_0x3b98c7=_0x586545[_0xf780('0x36')];if(!_0x4eebe5[_0xf780('0x30')][_0xf780('0x37')](_0xf780('0x38'))){_0x180507[_0xf780('0x1f')]=qs['limit'](_0x4eebe5['query'][_0xf780('0x1f')]);_0x180507['offset']=qs[_0xf780('0x39')](_0x4eebe5['query'][_0xf780('0x39')]);}return _0x42bcc6[_0xf780('0x4b')](_0x180507);}})[_0xf780('0x26')](function(_0x42ec59){if(_0x42ec59){return _0x42ec59?{'count':_0x3b98c7,'rows':_0x42ec59}:null;}})[_0xf780('0x26')](respondWithResult(_0x4094d5,null))['catch'](handleError(_0x4094d5,null));};exports[_0xf780('0x4e')]=function(_0x20dc15,_0x2a9180,_0x4a420f){if(_0x20dc15['body']['id']){delete _0x20dc15[_0xf780('0x49')]['id'];}return db[_0xf780('0x2b')][_0xf780('0x4c')]({'where':{'id':_0x20dc15['params']['id']}})['then'](handleEntityNotFound(_0x2a9180,null))[_0xf780('0x26')](function(_0x24bdcb){if(_0x24bdcb){_0x20dc15[_0xf780('0x49')][_0xf780('0x4f')]=_0x24bdcb['id'];_0x20dc15[_0xf780('0x49')][_0xf780('0x50')]=integrations['getSubjects'](_0x20dc15[_0xf780('0x49')][_0xf780('0x51')],_0x20dc15[_0xf780('0x49')]['type']);_0x20dc15['body'][_0xf780('0x52')]=integrations['getDescriptions'](_0x20dc15[_0xf780('0x49')][_0xf780('0x51')],_0x20dc15[_0xf780('0x49')][_0xf780('0x2d')]);return db[_0xf780('0x4d')][_0xf780('0x48')](_0x20dc15[_0xf780('0x49')],{'include':[{'model':db[_0xf780('0x53')],'as':_0xf780('0x50')},{'model':db[_0xf780('0x53')],'as':_0xf780('0x52')}]});}return null;})[_0xf780('0x26')](respondWithResult(_0x2a9180,null))[_0xf780('0x43')](handleError(_0x2a9180,null));};exports[_0xf780('0x54')]=function(_0x4110fb,_0x2ee4ae,_0x5a64aa){var _0x70e8ad='';return db['FreshdeskAccount'][_0xf780('0x4c')]({'where':{'id':_0x4110fb[_0xf780('0x45')]['id']},'attributes':['id',_0xf780('0x55'),'apiKey']})[_0xf780('0x26')](handleEntityNotFound(_0x2ee4ae,null))[_0xf780('0x26')](function(_0x1aad32){if(_0x1aad32){_0x70e8ad=_0x1aad32[_0xf780('0x55')];var _0x3371f7=_0x70e8ad[_0xf780('0x56')](-0x1);if(_0x3371f7==='/'){_0x70e8ad=_0x70e8ad[_0xf780('0x57')](0x0,_0x70e8ad[_0xf780('0x58')](_0x3371f7));}return rp({'method':_0xf780('0x59'),'uri':util[_0xf780('0x5a')](_0xf780('0x5b'),_0x70e8ad,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xf780('0x5a')]('Basic\x20%s',new Buffer(util['format'](_0xf780('0x5c'),_0x1aad32['apiKey']))[_0xf780('0x5d')](_0xf780('0x5e')))},'json':!![]});}})['then'](function(_0x46636a){if(_0x46636a){var _0x380601=[_0xf780('0x5f'),'subject',_0xf780('0x60'),_0xf780('0x61'),_0xf780('0x1c'),_0xf780('0x62'),_0xf780('0x63'),'source',_0xf780('0x64'),_0xf780('0x63'),_0xf780('0x65')];_['remove'](_0x46636a,function(_0x297052){return _0x380601['includes'](_0x297052[_0xf780('0x2f')])||!_0x297052[_0xf780('0x66')]&&_0x297052[_0xf780('0x2d')]!==_0xf780('0x67')&&_0x297052[_0xf780('0x2d')]!==_0xf780('0x68');});return{'count':_0x46636a[_0xf780('0x36')],'rows':_['map'](_0x46636a,function(_0x439082){return{'id':_0x439082[_0xf780('0x2f')],'name':_0x439082[_0xf780('0x69')],'custom':!_0x439082['default'],'options':_0x439082[_0xf780('0x6a')]?_[_0xf780('0x2a')](_0x439082[_0xf780('0x6a')],function(_0x5a8e82){return{'name':_[_0xf780('0x6b')](_0x5a8e82),'value':_0x5a8e82};}):[]};})};}})[_0xf780('0x26')](respondWithResult(_0x2ee4ae,null))[_0xf780('0x43')](function(_0x3d6dfb){var _0x4c527e=_0x4110fb[_0xf780('0x30')][_0xf780('0x6c')]?0x1f4:_0x3d6dfb[_0xf780('0x6d')]||0x1f4;logger[_0xf780('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xf780('0x54'),_0x4c527e,JSON[_0xf780('0x6e')](_0x3d6dfb));delete _0x3d6dfb[_0xf780('0x2f')];if(_0x4c527e===0x191){_0x4c527e=0x190;}_0x2ee4ae[_0xf780('0x1c')](_0x4c527e)['send'](_0x4110fb[_0xf780('0x30')]['test']?{'message':_0xf780('0x6f'),'statusCode':_0x3d6dfb[_0xf780('0x6d')]}:_0x3d6dfb);});}; \ No newline at end of file +var _0x8164=['substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','statusCode','error','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','sendStatus','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','getConfigurations','FreshdeskConfiguration','order','sort','pick','addConfiguration','findOne','AccountId','Subjects','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice'];(function(_0x13d60e,_0x67a91c){var _0x134524=function(_0x22a37b){while(--_0x22a37b){_0x13d60e['push'](_0x13d60e['shift']());}};_0x134524(++_0x67a91c);}(_0x8164,0x170));var _0x4816=function(_0x4ec3de,_0x1c67c4){_0x4ec3de=_0x4ec3de-0x0;var _0x37478a=_0x8164[_0x4ec3de];return _0x37478a;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4816('0x15'));function respondWithStatusCode(_0x51a5f8,_0x5c4d42){_0x5c4d42=_0x5c4d42||0xcc;return function(_0x45a360){if(_0x45a360){return _0x51a5f8['sendStatus'](_0x5c4d42);}return _0x51a5f8[_0x4816('0x16')](_0x5c4d42)[_0x4816('0x17')]();};}function respondWithResult(_0x13a685,_0x316f36){_0x316f36=_0x316f36||0xc8;return function(_0x42fc52){if(_0x42fc52){return _0x13a685[_0x4816('0x16')](_0x316f36)[_0x4816('0x18')](_0x42fc52);}};}function respondWithFilteredResult(_0x2a58b7,_0x45c006){return function(_0x21354c){if(_0x21354c){var _0x1ce1fb=typeof _0x45c006[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x45c006[_0x4816('0x1b')]===_0x4816('0x1a');var _0x5c446b=_0x21354c['count'];var _0x5b54d4=_0x1ce1fb?0x0:_0x45c006[_0x4816('0x19')];var _0x354fdd=_0x1ce1fb?_0x21354c[_0x4816('0x1c')]:_0x45c006[_0x4816('0x19')]+_0x45c006[_0x4816('0x1b')];var _0x37effd;if(_0x354fdd>=_0x5c446b){_0x354fdd=_0x5c446b;_0x37effd=0xc8;}else{_0x37effd=0xce;}_0x2a58b7[_0x4816('0x16')](_0x37effd);return _0x2a58b7[_0x4816('0x1d')](_0x4816('0x1e'),_0x5b54d4+'-'+_0x354fdd+'/'+_0x5c446b)['json'](_0x21354c);}return null;};}function patchUpdates(_0x1ab50d){return function(_0x583a99){try{jsonpatch['apply'](_0x583a99,_0x1ab50d,!![]);}catch(_0x233902){return BPromise[_0x4816('0x1f')](_0x233902);}return _0x583a99['save']();};}function saveUpdates(_0x2bbaf4,_0x576221){return function(_0x46eb06){if(_0x46eb06){return _0x46eb06[_0x4816('0x20')](_0x2bbaf4)['then'](function(_0x504851){return _0x504851;});}return null;};}function removeEntity(_0xe484b2,_0x2c8dc4){return function(_0x394ecd){if(_0x394ecd){return _0x394ecd['destroy']()[_0x4816('0x21')](function(){_0xe484b2[_0x4816('0x16')](0xcc)[_0x4816('0x17')]();});}};}function handleEntityNotFound(_0x3f07f1,_0x571a05){return function(_0x565651){if(!_0x565651){_0x3f07f1[_0x4816('0x22')](0x194);}return _0x565651;};}function handleError(_0x47701a,_0x590349){_0x590349=_0x590349||0x1f4;return function(_0x3c96ce){logger['error'](_0x3c96ce['stack']);if(_0x3c96ce[_0x4816('0x23')]){delete _0x3c96ce[_0x4816('0x23')];}_0x47701a[_0x4816('0x16')](_0x590349)['send'](_0x3c96ce);};}exports[_0x4816('0x24')]=function(_0x521259,_0x39ddbd){var _0x229086={},_0x49c337={},_0x8ca388={'count':0x0,'rows':[]};var _0x34ba85=_[_0x4816('0x25')](db[_0x4816('0x26')][_0x4816('0x27')],function(_0x332af7){return{'name':_0x332af7[_0x4816('0x28')],'type':_0x332af7[_0x4816('0x29')][_0x4816('0x2a')]};});_0x49c337['model']=_[_0x4816('0x25')](_0x34ba85,_0x4816('0x23'));_0x49c337['query']=_['keys'](_0x521259[_0x4816('0x2b')]);_0x49c337[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x49c337[_0x4816('0x2e')],_0x49c337[_0x4816('0x2b')]);_0x229086['attributes']=_['intersection'](_0x49c337['model'],qs[_0x4816('0x2f')](_0x521259[_0x4816('0x2b')][_0x4816('0x2f')]));_0x229086[_0x4816('0x30')]=_0x229086[_0x4816('0x30')][_0x4816('0x31')]?_0x229086['attributes']:_0x49c337[_0x4816('0x2e')];if(!_0x521259['query'][_0x4816('0x32')](_0x4816('0x33'))){_0x229086[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x521259[_0x4816('0x2b')]['limit']);_0x229086[_0x4816('0x19')]=qs['offset'](_0x521259['query'][_0x4816('0x19')]);}_0x229086['order']=qs['sort'](_0x521259['query']['sort']);_0x229086[_0x4816('0x34')]=qs[_0x4816('0x2c')](_['pick'](_0x521259[_0x4816('0x2b')],_0x49c337[_0x4816('0x2c')]),_0x34ba85);if(_0x521259['query'][_0x4816('0x35')]){_0x229086[_0x4816('0x34')]=_[_0x4816('0x36')](_0x229086[_0x4816('0x34')],{'$or':_['map'](_0x34ba85,function(_0x30ed56){if(_0x30ed56[_0x4816('0x29')]!==_0x4816('0x37')){var _0x442a63={};_0x442a63[_0x30ed56[_0x4816('0x23')]]={'$like':'%'+_0x521259[_0x4816('0x2b')][_0x4816('0x35')]+'%'};return _0x442a63;}})});}_0x229086=_[_0x4816('0x36')]({},_0x229086,_0x521259[_0x4816('0x38')]);var _0x2d5752={'where':_0x229086[_0x4816('0x34')]};return db[_0x4816('0x26')][_0x4816('0x1c')](_0x2d5752)['then'](function(_0x3fa20c){_0x8ca388[_0x4816('0x1c')]=_0x3fa20c;if(_0x521259[_0x4816('0x2b')][_0x4816('0x39')]){_0x229086[_0x4816('0x3a')]=[{'all':!![]}];}return db[_0x4816('0x26')][_0x4816('0x3b')](_0x229086);})['then'](function(_0x39b205){_0x8ca388['rows']=_0x39b205;return _0x8ca388;})['then'](respondWithFilteredResult(_0x39ddbd,_0x229086))[_0x4816('0x3c')](handleError(_0x39ddbd,null));};exports[_0x4816('0x3d')]=function(_0x560170,_0x23d3a1){var _0x432bce={'raw':![],'where':{'id':_0x560170['params']['id']}},_0x476765={};_0x476765[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x26')][_0x4816('0x27')]);_0x476765[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x560170['query']);_0x476765[_0x4816('0x2c')]=_['intersection'](_0x476765['model'],_0x476765['query']);_0x432bce[_0x4816('0x30')]=_[_0x4816('0x2d')](_0x476765[_0x4816('0x2e')],qs[_0x4816('0x2f')](_0x560170[_0x4816('0x2b')][_0x4816('0x2f')]));_0x432bce[_0x4816('0x30')]=_0x432bce[_0x4816('0x30')][_0x4816('0x31')]?_0x432bce[_0x4816('0x30')]:_0x476765['model'];if(_0x560170['query'][_0x4816('0x39')]){_0x432bce[_0x4816('0x3a')]=[{'all':!![]}];}_0x432bce=_[_0x4816('0x36')]({},_0x432bce,_0x560170[_0x4816('0x38')]);return db[_0x4816('0x26')][_0x4816('0x3f')](_0x432bce)[_0x4816('0x21')](handleEntityNotFound(_0x23d3a1,null))[_0x4816('0x21')](respondWithResult(_0x23d3a1,null))['catch'](handleError(_0x23d3a1,null));};exports[_0x4816('0x40')]=function(_0x1ea828,_0x31993a){return db['FreshdeskAccount']['create'](_0x1ea828[_0x4816('0x41')],{})[_0x4816('0x21')](respondWithResult(_0x31993a,0xc9))[_0x4816('0x3c')](handleError(_0x31993a,null));};exports['update']=function(_0x247adb,_0x41ce8f){if(_0x247adb[_0x4816('0x41')]['id']){delete _0x247adb[_0x4816('0x41')]['id'];}return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x247adb[_0x4816('0x42')]['id']}})['then'](handleEntityNotFound(_0x41ce8f,null))[_0x4816('0x21')](saveUpdates(_0x247adb[_0x4816('0x41')],null))[_0x4816('0x21')](respondWithResult(_0x41ce8f,null))[_0x4816('0x3c')](handleError(_0x41ce8f,null));};exports[_0x4816('0x43')]=function(_0x47112a,_0x309778){return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x47112a[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x309778,null))[_0x4816('0x21')](removeEntity(_0x309778,null))[_0x4816('0x3c')](handleError(_0x309778,null));};exports[_0x4816('0x44')]=function(_0x2930f4,_0x433ac5,_0x306e86){var _0x11272b={};var _0x2e619f={};var _0x56321c;var _0x1702bf;return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2930f4[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x433ac5,null))['then'](function(_0x3604e6){if(_0x3604e6){_0x56321c=_0x3604e6;_0x2e619f[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x45')][_0x4816('0x27')]);_0x2e619f[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x2930f4[_0x4816('0x2b')]);_0x2e619f[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x2e619f['model'],_0x2e619f[_0x4816('0x2b')]);_0x11272b['attributes']=_[_0x4816('0x2d')](_0x2e619f[_0x4816('0x2e')],qs['fields'](_0x2930f4[_0x4816('0x2b')][_0x4816('0x2f')]));_0x11272b[_0x4816('0x30')]=_0x11272b[_0x4816('0x30')][_0x4816('0x31')]?_0x11272b['attributes']:_0x2e619f[_0x4816('0x2e')];_0x11272b[_0x4816('0x46')]=qs[_0x4816('0x47')](_0x2930f4[_0x4816('0x2b')][_0x4816('0x47')]);_0x11272b[_0x4816('0x34')]=qs['filters'](_[_0x4816('0x48')](_0x2930f4[_0x4816('0x2b')],_0x2e619f[_0x4816('0x2c')]));if(_0x2930f4['query'][_0x4816('0x35')]){_0x11272b[_0x4816('0x34')]=_[_0x4816('0x36')](_0x11272b['where'],{'$or':_[_0x4816('0x25')](_0x11272b[_0x4816('0x30')],function(_0xa67f45){var _0xfb9e4a={};_0xfb9e4a[_0xa67f45]={'$like':'%'+_0x2930f4['query'][_0x4816('0x35')]+'%'};return _0xfb9e4a;})});}_0x11272b=_[_0x4816('0x36')]({},_0x11272b,_0x2930f4[_0x4816('0x38')]);return _0x56321c['getConfigurations'](_0x11272b);}})['then'](function(_0x2a9d8b){if(_0x2a9d8b){_0x1702bf=_0x2a9d8b[_0x4816('0x31')];if(!_0x2930f4[_0x4816('0x2b')][_0x4816('0x32')](_0x4816('0x33'))){_0x11272b[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x2930f4['query'][_0x4816('0x1b')]);_0x11272b[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x2930f4['query'][_0x4816('0x19')]);}return _0x56321c[_0x4816('0x44')](_0x11272b);}})[_0x4816('0x21')](function(_0x2c2a8c){if(_0x2c2a8c){return _0x2c2a8c?{'count':_0x1702bf,'rows':_0x2c2a8c}:null;}})[_0x4816('0x21')](respondWithResult(_0x433ac5,null))[_0x4816('0x3c')](handleError(_0x433ac5,null));};exports[_0x4816('0x49')]=function(_0x52cf85,_0x171c2b,_0x11e6f9){if(_0x52cf85[_0x4816('0x41')]['id']){delete _0x52cf85['body']['id'];}return db[_0x4816('0x26')][_0x4816('0x4a')]({'where':{'id':_0x52cf85['params']['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x171c2b,null))[_0x4816('0x21')](function(_0x211a2b){if(_0x211a2b){_0x52cf85[_0x4816('0x41')][_0x4816('0x4b')]=_0x211a2b['id'];_0x52cf85[_0x4816('0x41')][_0x4816('0x4c')]=integrations['getSubjects'](_0x52cf85[_0x4816('0x41')]['channel'],_0x52cf85['body']['type']);_0x52cf85['body']['Descriptions']=integrations[_0x4816('0x4d')](_0x52cf85[_0x4816('0x41')][_0x4816('0x4e')],_0x52cf85['body'][_0x4816('0x29')]);return db[_0x4816('0x45')][_0x4816('0x40')](_0x52cf85[_0x4816('0x41')],{'include':[{'model':db[_0x4816('0x4f')],'as':_0x4816('0x4c')},{'model':db[_0x4816('0x4f')],'as':'Descriptions'}]});}return null;})[_0x4816('0x21')](respondWithResult(_0x171c2b,null))['catch'](handleError(_0x171c2b,null));};exports[_0x4816('0x50')]=function(_0x2cbc59,_0x5277dc,_0x3002b7){var _0x9165c8='';return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2cbc59[_0x4816('0x42')]['id']},'attributes':['id',_0x4816('0x51'),_0x4816('0x52')]})['then'](handleEntityNotFound(_0x5277dc,null))[_0x4816('0x21')](function(_0x1540cf){if(_0x1540cf){_0x9165c8=_0x1540cf[_0x4816('0x51')];var _0x5742fa=_0x9165c8[_0x4816('0x53')](-0x1);if(_0x5742fa==='/'){_0x9165c8=_0x9165c8[_0x4816('0x54')](0x0,_0x9165c8[_0x4816('0x55')](_0x5742fa));}return rp({'method':_0x4816('0x56'),'uri':util[_0x4816('0x57')](_0x4816('0x58'),_0x9165c8,_0x4816('0x59')),'headers':{'Authorization':util['format'](_0x4816('0x5a'),new Buffer(util[_0x4816('0x57')](_0x4816('0x5b'),_0x1540cf[_0x4816('0x52')]))[_0x4816('0x5c')](_0x4816('0x5d')))},'json':!![]});}})[_0x4816('0x21')](function(_0x4abba0){if(_0x4abba0){var _0x1d41a3=[_0x4816('0x5e'),_0x4816('0x5f'),_0x4816('0x60'),'description',_0x4816('0x16'),_0x4816('0x61'),_0x4816('0x62'),_0x4816('0x63'),_0x4816('0x64'),_0x4816('0x62'),_0x4816('0x65')];_[_0x4816('0x66')](_0x4abba0,function(_0x28419c){return _0x1d41a3[_0x4816('0x67')](_0x28419c[_0x4816('0x23')])||!_0x28419c[_0x4816('0x68')]&&_0x28419c[_0x4816('0x29')]!=='custom_text'&&_0x28419c[_0x4816('0x29')]!==_0x4816('0x69');});return{'count':_0x4abba0[_0x4816('0x31')],'rows':_[_0x4816('0x25')](_0x4abba0,function(_0x21fe50){return{'id':_0x21fe50[_0x4816('0x23')],'name':_0x21fe50[_0x4816('0x6a')],'custom':!_0x21fe50[_0x4816('0x68')],'options':_0x21fe50[_0x4816('0x6b')]?_[_0x4816('0x25')](_0x21fe50[_0x4816('0x6b')],function(_0x2bf3aa){return{'name':_[_0x4816('0x6c')](_0x2bf3aa),'value':_0x2bf3aa};}):[]};})};}})['then'](respondWithResult(_0x5277dc,null))[_0x4816('0x3c')](function(_0x2dca54){var _0xad3f8e=_0x2cbc59['query']['test']?0x1f4:_0x2dca54[_0x4816('0x6d')]||0x1f4;logger[_0x4816('0x6e')]('getFields,\x20%s,\x20%s,\x20%s',_0x4816('0x50'),_0xad3f8e,JSON[_0x4816('0x6f')](_0x2dca54));delete _0x2dca54[_0x4816('0x23')];if(_0xad3f8e===0x191){_0xad3f8e=0x190;}_0x5277dc[_0x4816('0x16')](_0xad3f8e)['send'](_0x2cbc59[_0x4816('0x2b')][_0x4816('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x2dca54[_0x4816('0x6d')]}:_0x2dca54);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1586452..e817795 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 _0xfff6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x2e96db,_0x30e7bf){var _0x2922fe=function(_0x20de6f){while(--_0x20de6f){_0x2e96db['push'](_0x2e96db['shift']());}};_0x2922fe(++_0x30e7bf);}(_0xfff6,0x1cf));var _0x6fff=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfff6[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6fff('0x0'));var util=require(_0x6fff('0x1'));var logger=require(_0x6fff('0x2'))(_0x6fff('0x3'));var moment=require(_0x6fff('0x4'));var BPromise=require(_0x6fff('0x5'));var rp=require(_0x6fff('0x6'));var fs=require('fs');var path=require(_0x6fff('0x7'));var rimraf=require(_0x6fff('0x8'));var config=require('../../config/environment');var attributes=require(_0x6fff('0x9'));var integrations=require(_0x6fff('0xa'));module[_0x6fff('0xb')]=function(_0x4bb8e0,_0xda11d1){return _0x4bb8e0[_0x6fff('0xc')](_0x6fff('0xd'),attributes,{'tableName':_0x6fff('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b72=['request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5186b7,_0x949724){var _0x138be6=function(_0x2b3f82){while(--_0x2b3f82){_0x5186b7['push'](_0x5186b7['shift']());}};_0x138be6(++_0x949724);}(_0x5b72,0x14a));var _0x25b7=function(_0x4f2d54,_0x2ead29){_0x4f2d54=_0x4f2d54-0x0;var _0x13f7db=_0x5b72[_0x4f2d54];return _0x13f7db;};'use strict';var _=require(_0x25b7('0x0'));var util=require(_0x25b7('0x1'));var logger=require(_0x25b7('0x2'))(_0x25b7('0x3'));var moment=require(_0x25b7('0x4'));var BPromise=require(_0x25b7('0x5'));var rp=require(_0x25b7('0x6'));var fs=require('fs');var path=require(_0x25b7('0x7'));var rimraf=require('rimraf');var config=require(_0x25b7('0x8'));var attributes=require(_0x25b7('0x9'));var integrations=require(_0x25b7('0xa'));module[_0x25b7('0xb')]=function(_0x56bfa0,_0xddae6d){return _0x56bfa0['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 0443a3c..2cd9d47 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 _0x68de=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x27b917,_0x3cdedb){var _0x404989=function(_0x19a3f8){while(--_0x19a3f8){_0x27b917['push'](_0x27b917['shift']());}};_0x404989(++_0x3cdedb);}(_0x68de,0xfa));var _0xe68d=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x68de[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xe68d('0x0'));var util=require(_0xe68d('0x1'));var moment=require(_0xe68d('0x2'));var BPromise=require('bluebird');var rs=require(_0xe68d('0x3'));var fs=require('fs');var Redis=require(_0xe68d('0x4'));var db=require(_0xe68d('0x5'))['db'];var utils=require(_0xe68d('0x6'));var logger=require('../../config/logger')(_0xe68d('0x7'));var config=require(_0xe68d('0x8'));var jayson=require(_0xe68d('0x9'));var client=jayson[_0xe68d('0xa')][_0xe68d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cd0b5,_0x2d750e,_0x4e46f3){return new BPromise(function(_0x2cf142,_0x243771){return client[_0xe68d('0xc')](_0x5cd0b5,_0x4e46f3)[_0xe68d('0xd')](function(_0x16fe37){logger[_0xe68d('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x2d750e,_0xe68d('0xf'));logger[_0xe68d('0x10')](_0xe68d('0x11'),_0x2d750e,'request\x20sent',JSON[_0xe68d('0x12')](_0x16fe37));if(_0x16fe37['error']){if(_0x16fe37['error'][_0xe68d('0x13')]===0x1f4){logger[_0xe68d('0x14')](_0xe68d('0x15'),_0x2d750e,_0x16fe37['error'][_0xe68d('0x16')]);return _0x243771(_0x16fe37['error'][_0xe68d('0x16')]);}logger[_0xe68d('0x14')](_0xe68d('0x15'),_0x2d750e,_0x16fe37[_0xe68d('0x14')]['message']);return _0x2cf142(_0x16fe37['error'][_0xe68d('0x16')]);}else{logger[_0xe68d('0xe')](_0xe68d('0x15'),_0x2d750e,_0xe68d('0xf'));_0x2cf142(_0x16fe37[_0xe68d('0x17')][_0xe68d('0x16')]);}})[_0xe68d('0x18')](function(_0x1e3e24){logger[_0xe68d('0x14')](_0xe68d('0x15'),_0x2d750e,_0x1e3e24);_0x243771(_0x1e3e24);});});}exports[_0xe68d('0x19')]=function(_0x3c877c){var _0x16cd23=this;return new Promise(function(_0x1a0780,_0x263ba9){return db['FreshdeskAccount'][_0xe68d('0x1a')]({'raw':_0x3c877c[_0xe68d('0x1b')]?_0x3c877c[_0xe68d('0x1b')][_0xe68d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c877c[_0xe68d('0x1b')]?_0x3c877c[_0xe68d('0x1b')][_0xe68d('0x1d')]||null:null,'attributes':_0x3c877c[_0xe68d('0x1b')]?_0x3c877c[_0xe68d('0x1b')][_0xe68d('0x1e')]||null:null,'limit':_0x3c877c[_0xe68d('0x1b')]?_0x3c877c[_0xe68d('0x1b')][_0xe68d('0x1f')]||null:null,'include':_0x3c877c['options']?_0x3c877c[_0xe68d('0x1b')]['include']?_[_0xe68d('0x20')](_0x3c877c['options']['include'],function(_0x24fe19){return{'model':db[_0x24fe19[_0xe68d('0x21')]],'as':_0x24fe19['as'],'attributes':_0x24fe19[_0xe68d('0x1e')],'include':_0x24fe19[_0xe68d('0x22')]?_['map'](_0x24fe19['include'],function(_0x53b957){return{'model':db[_0x53b957['model']],'as':_0x53b957['as'],'attributes':_0x53b957[_0xe68d('0x1e')],'include':_0x53b957[_0xe68d('0x22')]?_[_0xe68d('0x20')](_0x53b957[_0xe68d('0x22')],function(_0x9ae1f4){return{'model':db[_0x9ae1f4[_0xe68d('0x21')]],'as':_0x9ae1f4['as'],'attributes':_0x9ae1f4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe68d('0xd')](function(_0x5203fb){logger['info'](_0xe68d('0x19'),_0x3c877c);logger['debug'](_0xe68d('0x19'),_0x3c877c,JSON[_0xe68d('0x12')](_0x5203fb));_0x1a0780(_0x5203fb);})['catch'](function(_0x497a43){logger[_0xe68d('0x14')](_0xe68d('0x19'),_0x497a43[_0xe68d('0x16')],_0x3c877c);_0x263ba9(_0x16cd23[_0xe68d('0x14')](0x1f4,_0x497a43[_0xe68d('0x16')]));});});};exports[_0xe68d('0x23')]=function(_0x4167da){var _0x53bc4d=this;return new Promise(function(_0x2eb3b6,_0x1fc4f2){return db[_0xe68d('0x24')][_0xe68d('0x25')]({'raw':_0x4167da[_0xe68d('0x1b')]?_0x4167da[_0xe68d('0x1b')][_0xe68d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4167da[_0xe68d('0x1b')]?_0x4167da[_0xe68d('0x1b')][_0xe68d('0x1d')]||null:null,'attributes':_0x4167da[_0xe68d('0x1b')]?_0x4167da['options']['attributes']||null:null,'include':_0x4167da[_0xe68d('0x1b')]?_0x4167da[_0xe68d('0x1b')][_0xe68d('0x22')]?_[_0xe68d('0x20')](_0x4167da['options'][_0xe68d('0x22')],function(_0x2d5414){return{'model':db[_0x2d5414['model']],'as':_0x2d5414['as'],'attributes':_0x2d5414['attributes'],'include':_0x2d5414[_0xe68d('0x22')]?_[_0xe68d('0x20')](_0x2d5414[_0xe68d('0x22')],function(_0x43402e){return{'model':db[_0x43402e[_0xe68d('0x21')]],'as':_0x43402e['as'],'attributes':_0x43402e[_0xe68d('0x1e')],'include':_0x43402e[_0xe68d('0x22')]?_[_0xe68d('0x20')](_0x43402e['include'],function(_0x3fd3f0){return{'model':db[_0x3fd3f0[_0xe68d('0x21')]],'as':_0x3fd3f0['as'],'attributes':_0x3fd3f0[_0xe68d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x599dcc){logger[_0xe68d('0xe')]('ShowFreshdeskAccount',_0x4167da);logger['debug'](_0xe68d('0x23'),_0x4167da,JSON[_0xe68d('0x12')](_0x599dcc));_0x2eb3b6(_0x599dcc);})[_0xe68d('0x18')](function(_0x379b17){logger[_0xe68d('0x14')](_0xe68d('0x23'),_0x379b17[_0xe68d('0x16')],_0x4167da);_0x1fc4f2(_0x53bc4d['error'](0x1f4,_0x379b17[_0xe68d('0x16')]));});});}; \ No newline at end of file +var _0x40ea=['result','catch','GetFreshdeskAccount','raw','options','where','limit','include','attributes','map','model','ShowFreshdeskAccount','FreshdeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0x40ea,0x99));var _0xa40e=function(_0x5b8e08,_0x3131d9){_0x5b8e08=_0x5b8e08-0x0;var _0x31f09b=_0x40ea[_0x5b8e08];return _0x31f09b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa40e('0x0'));var BPromise=require(_0xa40e('0x1'));var rs=require(_0xa40e('0x2'));var fs=require('fs');var Redis=require(_0xa40e('0x3'));var db=require(_0xa40e('0x4'))['db'];var utils=require(_0xa40e('0x5'));var logger=require(_0xa40e('0x6'))(_0xa40e('0x7'));var config=require(_0xa40e('0x8'));var jayson=require(_0xa40e('0x9'));var client=jayson['client'][_0xa40e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x990486,_0x531b88,_0x4dc534){return new BPromise(function(_0x5624ef,_0x1651ec){return client[_0xa40e('0xb')](_0x990486,_0x4dc534)[_0xa40e('0xc')](function(_0x15523e){logger['info'](_0xa40e('0xd'),_0x531b88,_0xa40e('0xe'));logger[_0xa40e('0xf')](_0xa40e('0x10'),_0x531b88,_0xa40e('0xe'),JSON[_0xa40e('0x11')](_0x15523e));if(_0x15523e[_0xa40e('0x12')]){if(_0x15523e[_0xa40e('0x12')][_0xa40e('0x13')]===0x1f4){logger[_0xa40e('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);return _0x1651ec(_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);}logger[_0xa40e('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);return _0x5624ef(_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);}else{logger[_0xa40e('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0xa40e('0xe'));_0x5624ef(_0x15523e[_0xa40e('0x16')][_0xa40e('0x14')]);}})[_0xa40e('0x17')](function(_0x353659){logger[_0xa40e('0x12')](_0xa40e('0xd'),_0x531b88,_0x353659);_0x1651ec(_0x353659);});});}exports[_0xa40e('0x18')]=function(_0x1e70b8){var _0x2930bd=this;return new Promise(function(_0x33bf2a,_0x9daf9f){return db['FreshdeskAccount']['findAll']({'raw':_0x1e70b8['options']?_0x1e70b8['options'][_0xa40e('0x19')]===undefined?!![]:![]:!![],'where':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options'][_0xa40e('0x1b')]||null:null,'attributes':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options']['attributes']||null:null,'limit':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options'][_0xa40e('0x1c')]||null:null,'include':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8[_0xa40e('0x1a')][_0xa40e('0x1d')]?_['map'](_0x1e70b8[_0xa40e('0x1a')][_0xa40e('0x1d')],function(_0xfe9c86){return{'model':db[_0xfe9c86['model']],'as':_0xfe9c86['as'],'attributes':_0xfe9c86[_0xa40e('0x1e')],'include':_0xfe9c86[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0xfe9c86['include'],function(_0x3b21ab){return{'model':db[_0x3b21ab[_0xa40e('0x20')]],'as':_0x3b21ab['as'],'attributes':_0x3b21ab[_0xa40e('0x1e')],'include':_0x3b21ab[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x3b21ab[_0xa40e('0x1d')],function(_0x47ecf4){return{'model':db[_0x47ecf4[_0xa40e('0x20')]],'as':_0x47ecf4['as'],'attributes':_0x47ecf4['attributes']};}):[]};}):[]};}):[]:[]})[_0xa40e('0xc')](function(_0x85e951){logger['info'](_0xa40e('0x18'),_0x1e70b8);logger[_0xa40e('0xf')](_0xa40e('0x18'),_0x1e70b8,JSON[_0xa40e('0x11')](_0x85e951));_0x33bf2a(_0x85e951);})['catch'](function(_0x2a6ba7){logger[_0xa40e('0x12')]('GetFreshdeskAccount',_0x2a6ba7[_0xa40e('0x14')],_0x1e70b8);_0x9daf9f(_0x2930bd[_0xa40e('0x12')](0x1f4,_0x2a6ba7[_0xa40e('0x14')]));});});};exports[_0xa40e('0x21')]=function(_0x33853a){var _0x40a727=this;return new Promise(function(_0x4a83bd,_0x4a5003){return db[_0xa40e('0x22')]['find']({'raw':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x19')]===undefined?!![]:![]:!![],'where':_0x33853a[_0xa40e('0x1a')]?_0x33853a['options'][_0xa40e('0x1b')]||null:null,'attributes':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1e')]||null:null,'include':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1d')],function(_0x3b694b){return{'model':db[_0x3b694b['model']],'as':_0x3b694b['as'],'attributes':_0x3b694b[_0xa40e('0x1e')],'include':_0x3b694b['include']?_[_0xa40e('0x1f')](_0x3b694b[_0xa40e('0x1d')],function(_0x40bdd9){return{'model':db[_0x40bdd9[_0xa40e('0x20')]],'as':_0x40bdd9['as'],'attributes':_0x40bdd9[_0xa40e('0x1e')],'include':_0x40bdd9[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x40bdd9[_0xa40e('0x1d')],function(_0x5a9ab5){return{'model':db[_0x5a9ab5[_0xa40e('0x20')]],'as':_0x5a9ab5['as'],'attributes':_0x5a9ab5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56b726){logger['info']('ShowFreshdeskAccount',_0x33853a);logger[_0xa40e('0xf')]('ShowFreshdeskAccount',_0x33853a,JSON[_0xa40e('0x11')](_0x56b726));_0x4a83bd(_0x56b726);})[_0xa40e('0x17')](function(_0x1d006d){logger[_0xa40e('0x12')](_0xa40e('0x21'),_0x1d006d[_0xa40e('0x14')],_0x33853a);_0x4a5003(_0x40a727['error'](0x1f4,_0x1d006d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 893506c..8e7b860 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 _0xf1b0=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0xd6f5a1,_0x11d4c2){var _0x3305ac=function(_0x349e96){while(--_0x349e96){_0xd6f5a1['push'](_0xd6f5a1['shift']());}};_0x3305ac(++_0x11d4c2);}(_0xf1b0,0x1bd));var _0x0f1b=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0xf1b0[_0x3b87f4];return _0x63d16e;};'use strict';var multer=require('multer');var util=require(_0x0f1b('0x0'));var path=require(_0x0f1b('0x1'));var timeout=require(_0x0f1b('0x2'));var express=require(_0x0f1b('0x3'));var router=express[_0x0f1b('0x4')]();var fs_extra=require(_0x0f1b('0x5'));var auth=require(_0x0f1b('0x6'));var interaction=require(_0x0f1b('0x7'));var config=require(_0x0f1b('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x0f1b('0x9')](),controller[_0x0f1b('0xa')]);router[_0x0f1b('0xb')](_0x0f1b('0xc'),auth[_0x0f1b('0x9')](),controller[_0x0f1b('0xd')]);router[_0x0f1b('0xb')](_0x0f1b('0xe'),auth['isAuthenticated'](),controller[_0x0f1b('0xf')]);router[_0x0f1b('0xb')](_0x0f1b('0x10'),auth[_0x0f1b('0x9')](),controller[_0x0f1b('0x11')]);router[_0x0f1b('0xb')](_0x0f1b('0x12'),auth['isAuthenticated'](),controller[_0x0f1b('0x13')]);router[_0x0f1b('0xb')]('/:id/tags',auth[_0x0f1b('0x9')](),controller['getTags']);router[_0x0f1b('0x14')]('/',auth[_0x0f1b('0x9')](),controller[_0x0f1b('0x15')]);router[_0x0f1b('0x14')](_0x0f1b('0x16'),auth[_0x0f1b('0x9')](),controller[_0x0f1b('0x17')]);router[_0x0f1b('0x18')](_0x0f1b('0xc'),auth[_0x0f1b('0x9')](),controller[_0x0f1b('0x19')]);router[_0x0f1b('0x1a')](_0x0f1b('0xc'),auth[_0x0f1b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4e1c=['Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x4e1c,0x17c));var _0xc4e1=function(_0xa46b86,_0x5c1465){_0xa46b86=_0xa46b86-0x0;var _0x417360=_0x4e1c[_0xa46b86];return _0x417360;};'use strict';var multer=require('multer');var util=require(_0xc4e1('0x0'));var path=require(_0xc4e1('0x1'));var timeout=require(_0xc4e1('0x2'));var express=require(_0xc4e1('0x3'));var router=express[_0xc4e1('0x4')]();var fs_extra=require(_0xc4e1('0x5'));var auth=require(_0xc4e1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc4e1('0x7'));router[_0xc4e1('0x8')]('/',auth['isAuthenticated'](),controller[_0xc4e1('0x9')]);router[_0xc4e1('0x8')](_0xc4e1('0xa'),auth[_0xc4e1('0xb')](),controller['show']);router[_0xc4e1('0x8')](_0xc4e1('0xc'),auth[_0xc4e1('0xb')](),controller['getFields']);router[_0xc4e1('0x8')](_0xc4e1('0xd'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xe')]);router[_0xc4e1('0x8')](_0xc4e1('0xf'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x10')]);router[_0xc4e1('0x8')](_0xc4e1('0x11'),auth[_0xc4e1('0xb')](),controller['getTags']);router[_0xc4e1('0x12')]('/',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x13')]);router[_0xc4e1('0x12')](_0xc4e1('0x11'),auth[_0xc4e1('0xb')](),controller['setTags']);router[_0xc4e1('0x14')](_0xc4e1('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc4e1('0x15')](_0xc4e1('0xa'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x16')]);module[_0xc4e1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8fcadcf..7135c65 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 _0xd0e8=['exports','STRING','sequelize'];(function(_0x29bb65,_0x186c34){var _0x377289=function(_0x18e1ff){while(--_0x18e1ff){_0x29bb65['push'](_0x29bb65['shift']());}};_0x377289(++_0x186c34);}(_0xd0e8,0x1a3));var _0x8d0e=function(_0x44e4dd,_0x4779aa){_0x44e4dd=_0x44e4dd-0x0;var _0x42c267=_0xd0e8[_0x44e4dd];return _0x42c267;};'use strict';var Sequelize=require(_0x8d0e('0x0'));module[_0x8d0e('0x1')]={'name':{'type':Sequelize[_0x8d0e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e10=['exports','STRING'];(function(_0x458f10,_0x291210){var _0x198bb=function(_0x5b1e59){while(--_0x5b1e59){_0x458f10['push'](_0x458f10['shift']());}};_0x198bb(++_0x291210);}(_0x8e10,0x1ea));var _0x08e1=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8e10[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0x08e1('0x0')]={'name':{'type':Sequelize[_0x08e1('0x1')]},'description':{'type':Sequelize[_0x08e1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1a8bbc7..a17f80a 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 _0x60ad=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','name','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','show','params','intersection','includeAll','find','catch','create','update','body','FreshdeskField','order','pick','findOne','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xedd155,_0x2f2571){var _0x51d28b=function(_0xfc0dcf){while(--_0xfc0dcf){_0xedd155['push'](_0xedd155['shift']());}};_0x51d28b(++_0x2f2571);}(_0x60ad,0x1ee));var _0xd60a=function(_0x5c4a08,_0x496991){_0x5c4a08=_0x5c4a08-0x0;var _0x20ba74=_0x60ad[_0x5c4a08];return _0x20ba74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd60a('0x0'));var zipdir=require(_0xd60a('0x1'));var jsonpatch=require(_0xd60a('0x2'));var rp=require(_0xd60a('0x3'));var moment=require('moment');var BPromise=require(_0xd60a('0x4'));var Mustache=require(_0xd60a('0x5'));var util=require(_0xd60a('0x6'));var path=require(_0xd60a('0x7'));var sox=require(_0xd60a('0x8'));var csv=require(_0xd60a('0x9'));var ejs=require(_0xd60a('0xa'));var fs=require('fs');var fs_extra=require(_0xd60a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd60a('0xc'));var jsforce=require(_0xd60a('0xd'));var deskjs=require(_0xd60a('0xe'));var toCsv=require(_0xd60a('0x9'));var querystring=require('querystring');var Papa=require(_0xd60a('0xf'));var Redis=require(_0xd60a('0x10'));var authService=require(_0xd60a('0x11'));var qs=require(_0xd60a('0x12'));var as=require(_0xd60a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd60a('0x14'))(_0xd60a('0x15'));var utils=require(_0xd60a('0x16'));var config=require(_0xd60a('0x17'));var licenseUtil=require(_0xd60a('0x18'));var db=require(_0xd60a('0x19'))['db'];function respondWithStatusCode(_0x5d67d0,_0xf0becc){_0xf0becc=_0xf0becc||0xcc;return function(_0x25b873){if(_0x25b873){return _0x5d67d0['sendStatus'](_0xf0becc);}return _0x5d67d0[_0xd60a('0x1a')](_0xf0becc)[_0xd60a('0x1b')]();};}function respondWithResult(_0x37b278,_0x5a86d0){_0x5a86d0=_0x5a86d0||0xc8;return function(_0x4fea1a){if(_0x4fea1a){return _0x37b278[_0xd60a('0x1a')](_0x5a86d0)[_0xd60a('0x1c')](_0x4fea1a);}};}function respondWithFilteredResult(_0x388068,_0x3b17a9){return function(_0x54a2fc){if(_0x54a2fc){var _0x3035ad=typeof _0x3b17a9[_0xd60a('0x1d')]===_0xd60a('0x1e')&&typeof _0x3b17a9[_0xd60a('0x1f')]==='undefined';var _0x24b09e=_0x54a2fc[_0xd60a('0x20')];var _0x3ad6a7=_0x3035ad?0x0:_0x3b17a9['offset'];var _0x1dc36d=_0x3035ad?_0x54a2fc[_0xd60a('0x20')]:_0x3b17a9[_0xd60a('0x1d')]+_0x3b17a9[_0xd60a('0x1f')];var _0xd377c5;if(_0x1dc36d>=_0x24b09e){_0x1dc36d=_0x24b09e;_0xd377c5=0xc8;}else{_0xd377c5=0xce;}_0x388068[_0xd60a('0x1a')](_0xd377c5);return _0x388068['set'](_0xd60a('0x21'),_0x3ad6a7+'-'+_0x1dc36d+'/'+_0x24b09e)[_0xd60a('0x1c')](_0x54a2fc);}return null;};}function patchUpdates(_0x9f9cb2){return function(_0x315a13){try{jsonpatch[_0xd60a('0x22')](_0x315a13,_0x9f9cb2,!![]);}catch(_0x1b0c4f){return BPromise[_0xd60a('0x23')](_0x1b0c4f);}return _0x315a13[_0xd60a('0x24')]();};}function saveUpdates(_0x562c72,_0x32818a){return function(_0x470d93){if(_0x470d93){return _0x470d93['update'](_0x562c72)[_0xd60a('0x25')](function(_0x3fc5d7){return _0x3fc5d7;});}return null;};}function removeEntity(_0x504db1,_0x1bf35a){return function(_0x3ffe12){if(_0x3ffe12){return _0x3ffe12[_0xd60a('0x26')]()[_0xd60a('0x25')](function(){_0x504db1[_0xd60a('0x1a')](0xcc)[_0xd60a('0x1b')]();});}};}function handleEntityNotFound(_0x375d10,_0x3b5457){return function(_0x3e5108){if(!_0x3e5108){_0x375d10[_0xd60a('0x27')](0x194);}return _0x3e5108;};}function handleError(_0x1c25fa,_0x539f9d){_0x539f9d=_0x539f9d||0x1f4;return function(_0x52d4af){logger['error'](_0x52d4af['stack']);if(_0x52d4af[_0xd60a('0x28')]){delete _0x52d4af[_0xd60a('0x28')];}_0x1c25fa[_0xd60a('0x1a')](_0x539f9d)['send'](_0x52d4af);};}exports[_0xd60a('0x29')]=function(_0x36dce6,_0x1777b1){var _0x38e8b3={},_0x317f6f={},_0x431702={'count':0x0,'rows':[]};var _0x3c39ab=_['map'](db[_0xd60a('0x2a')][_0xd60a('0x2b')],function(_0xe198af){return{'name':_0xe198af[_0xd60a('0x2c')],'type':_0xe198af['type'][_0xd60a('0x2d')]};});_0x317f6f[_0xd60a('0x2e')]=_[_0xd60a('0x2f')](_0x3c39ab,_0xd60a('0x28'));_0x317f6f['query']=_[_0xd60a('0x30')](_0x36dce6[_0xd60a('0x31')]);_0x317f6f[_0xd60a('0x32')]=_['intersection'](_0x317f6f[_0xd60a('0x2e')],_0x317f6f[_0xd60a('0x31')]);_0x38e8b3['attributes']=_['intersection'](_0x317f6f[_0xd60a('0x2e')],qs[_0xd60a('0x33')](_0x36dce6['query'][_0xd60a('0x33')]));_0x38e8b3[_0xd60a('0x34')]=_0x38e8b3['attributes'][_0xd60a('0x35')]?_0x38e8b3[_0xd60a('0x34')]:_0x317f6f['model'];if(!_0x36dce6[_0xd60a('0x31')][_0xd60a('0x36')](_0xd60a('0x37'))){_0x38e8b3[_0xd60a('0x1f')]=qs[_0xd60a('0x1f')](_0x36dce6['query'][_0xd60a('0x1f')]);_0x38e8b3[_0xd60a('0x1d')]=qs[_0xd60a('0x1d')](_0x36dce6['query']['offset']);}_0x38e8b3['order']=qs[_0xd60a('0x38')](_0x36dce6[_0xd60a('0x31')][_0xd60a('0x38')]);_0x38e8b3[_0xd60a('0x39')]=qs['filters'](_['pick'](_0x36dce6[_0xd60a('0x31')],_0x317f6f[_0xd60a('0x32')]),_0x3c39ab);if(_0x36dce6[_0xd60a('0x31')][_0xd60a('0x3a')]){_0x38e8b3[_0xd60a('0x39')]=_[_0xd60a('0x3b')](_0x38e8b3[_0xd60a('0x39')],{'$or':_[_0xd60a('0x2f')](_0x3c39ab,function(_0x5826b8){if(_0x5826b8[_0xd60a('0x3c')]!==_0xd60a('0x3d')){var _0xdabcd2={};_0xdabcd2[_0x5826b8['name']]={'$like':'%'+_0x36dce6[_0xd60a('0x31')][_0xd60a('0x3a')]+'%'};return _0xdabcd2;}})});}_0x38e8b3=_['merge']({},_0x38e8b3,_0x36dce6[_0xd60a('0x3e')]);var _0x2c53bf={'where':_0x38e8b3['where']};return db[_0xd60a('0x2a')][_0xd60a('0x20')](_0x2c53bf)['then'](function(_0x42fce2){_0x431702['count']=_0x42fce2;if(_0x36dce6[_0xd60a('0x31')]['includeAll']){_0x38e8b3[_0xd60a('0x3f')]=[{'all':!![]}];}return db[_0xd60a('0x2a')][_0xd60a('0x40')](_0x38e8b3);})[_0xd60a('0x25')](function(_0x5ea004){_0x431702['rows']=_0x5ea004;return _0x431702;})[_0xd60a('0x25')](respondWithFilteredResult(_0x1777b1,_0x38e8b3))['catch'](handleError(_0x1777b1,null));};exports[_0xd60a('0x41')]=function(_0x4a5ff3,_0x2d3888){var _0x334a86={'raw':![],'where':{'id':_0x4a5ff3[_0xd60a('0x42')]['id']}},_0x1e8de0={};_0x1e8de0[_0xd60a('0x2e')]=_['keys'](db[_0xd60a('0x2a')][_0xd60a('0x2b')]);_0x1e8de0['query']=_[_0xd60a('0x30')](_0x4a5ff3[_0xd60a('0x31')]);_0x1e8de0[_0xd60a('0x32')]=_[_0xd60a('0x43')](_0x1e8de0[_0xd60a('0x2e')],_0x1e8de0[_0xd60a('0x31')]);_0x334a86[_0xd60a('0x34')]=_[_0xd60a('0x43')](_0x1e8de0[_0xd60a('0x2e')],qs[_0xd60a('0x33')](_0x4a5ff3[_0xd60a('0x31')][_0xd60a('0x33')]));_0x334a86[_0xd60a('0x34')]=_0x334a86[_0xd60a('0x34')][_0xd60a('0x35')]?_0x334a86[_0xd60a('0x34')]:_0x1e8de0[_0xd60a('0x2e')];if(_0x4a5ff3['query'][_0xd60a('0x44')]){_0x334a86[_0xd60a('0x3f')]=[{'all':!![]}];}_0x334a86=_['merge']({},_0x334a86,_0x4a5ff3[_0xd60a('0x3e')]);return db[_0xd60a('0x2a')][_0xd60a('0x45')](_0x334a86)[_0xd60a('0x25')](handleEntityNotFound(_0x2d3888,null))[_0xd60a('0x25')](respondWithResult(_0x2d3888,null))[_0xd60a('0x46')](handleError(_0x2d3888,null));};exports[_0xd60a('0x47')]=function(_0x41cc47,_0x3654c1){return db[_0xd60a('0x2a')][_0xd60a('0x47')](_0x41cc47['body'],{})['then'](respondWithResult(_0x3654c1,0xc9))['catch'](handleError(_0x3654c1,null));};exports[_0xd60a('0x48')]=function(_0x34f4d7,_0x5886bb){if(_0x34f4d7[_0xd60a('0x49')]['id']){delete _0x34f4d7[_0xd60a('0x49')]['id'];}return db[_0xd60a('0x2a')][_0xd60a('0x45')]({'where':{'id':_0x34f4d7['params']['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x5886bb,null))[_0xd60a('0x25')](saveUpdates(_0x34f4d7[_0xd60a('0x49')],null))[_0xd60a('0x25')](respondWithResult(_0x5886bb,null))[_0xd60a('0x46')](handleError(_0x5886bb,null));};exports[_0xd60a('0x26')]=function(_0x3f16b8,_0x3dbaf0){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3f16b8[_0xd60a('0x42')]['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x3dbaf0,null))['then'](removeEntity(_0x3dbaf0,null))['catch'](handleError(_0x3dbaf0,null));};exports['getFields']=function(_0x2566eb,_0x330bf7,_0x4785eb){var _0x448b91={};var _0x1d9e57={};var _0x7ec49;var _0x585559;return db[_0xd60a('0x2a')]['findOne']({'where':{'id':_0x2566eb['params']['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x330bf7,null))['then'](function(_0x193d95){if(_0x193d95){_0x7ec49=_0x193d95;_0x1d9e57['model']=_[_0xd60a('0x30')](db[_0xd60a('0x4a')]['rawAttributes']);_0x1d9e57[_0xd60a('0x31')]=_['keys'](_0x2566eb['query']);_0x1d9e57[_0xd60a('0x32')]=_[_0xd60a('0x43')](_0x1d9e57[_0xd60a('0x2e')],_0x1d9e57[_0xd60a('0x31')]);_0x448b91[_0xd60a('0x34')]=_[_0xd60a('0x43')](_0x1d9e57[_0xd60a('0x2e')],qs[_0xd60a('0x33')](_0x2566eb[_0xd60a('0x31')][_0xd60a('0x33')]));_0x448b91[_0xd60a('0x34')]=_0x448b91['attributes']['length']?_0x448b91[_0xd60a('0x34')]:_0x1d9e57[_0xd60a('0x2e')];_0x448b91[_0xd60a('0x4b')]=qs[_0xd60a('0x38')](_0x2566eb['query'][_0xd60a('0x38')]);_0x448b91[_0xd60a('0x39')]=qs[_0xd60a('0x32')](_[_0xd60a('0x4c')](_0x2566eb[_0xd60a('0x31')],_0x1d9e57['filters']));if(_0x2566eb['query']['filter']){_0x448b91[_0xd60a('0x39')]=_[_0xd60a('0x3b')](_0x448b91[_0xd60a('0x39')],{'$or':_['map'](_0x448b91['attributes'],function(_0xbf027c){var _0x4d1bf0={};_0x4d1bf0[_0xbf027c]={'$like':'%'+_0x2566eb[_0xd60a('0x31')][_0xd60a('0x3a')]+'%'};return _0x4d1bf0;})});}_0x448b91=_[_0xd60a('0x3b')]({},_0x448b91,_0x2566eb[_0xd60a('0x3e')]);return _0x7ec49['getFields'](_0x448b91);}})[_0xd60a('0x25')](function(_0x519956){if(_0x519956){_0x585559=_0x519956[_0xd60a('0x35')];if(!_0x2566eb[_0xd60a('0x31')]['hasOwnProperty']('nolimit')){_0x448b91['limit']=qs[_0xd60a('0x1f')](_0x2566eb[_0xd60a('0x31')][_0xd60a('0x1f')]);_0x448b91[_0xd60a('0x1d')]=qs[_0xd60a('0x1d')](_0x2566eb[_0xd60a('0x31')][_0xd60a('0x1d')]);}return _0x7ec49['getFields'](_0x448b91);}})[_0xd60a('0x25')](function(_0x4f48fc){if(_0x4f48fc){return _0x4f48fc?{'count':_0x585559,'rows':_0x4f48fc}:null;}})[_0xd60a('0x25')](respondWithResult(_0x330bf7,null))[_0xd60a('0x46')](handleError(_0x330bf7,null));};exports['getSubjects']=function(_0x4a3568,_0x5aab7c,_0x4c4092){var _0xbd1b4={};var _0x29b8ff={};var _0x2c7b87;var _0x2cee51;return db[_0xd60a('0x2a')][_0xd60a('0x4d')]({'where':{'id':_0x4a3568['params']['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x5aab7c,null))[_0xd60a('0x25')](function(_0x5c48a0){if(_0x5c48a0){_0x2c7b87=_0x5c48a0;_0x29b8ff[_0xd60a('0x2e')]=_[_0xd60a('0x30')](db[_0xd60a('0x4a')]['rawAttributes']);_0x29b8ff[_0xd60a('0x31')]=_[_0xd60a('0x30')](_0x4a3568[_0xd60a('0x31')]);_0x29b8ff[_0xd60a('0x32')]=_[_0xd60a('0x43')](_0x29b8ff[_0xd60a('0x2e')],_0x29b8ff[_0xd60a('0x31')]);_0xbd1b4['attributes']=_[_0xd60a('0x43')](_0x29b8ff['model'],qs['fields'](_0x4a3568[_0xd60a('0x31')]['fields']));_0xbd1b4[_0xd60a('0x34')]=_0xbd1b4['attributes'][_0xd60a('0x35')]?_0xbd1b4[_0xd60a('0x34')]:_0x29b8ff[_0xd60a('0x2e')];_0xbd1b4[_0xd60a('0x4b')]=qs[_0xd60a('0x38')](_0x4a3568[_0xd60a('0x31')][_0xd60a('0x38')]);_0xbd1b4[_0xd60a('0x39')]=qs[_0xd60a('0x32')](_[_0xd60a('0x4c')](_0x4a3568['query'],_0x29b8ff[_0xd60a('0x32')]));if(_0x4a3568[_0xd60a('0x31')][_0xd60a('0x3a')]){_0xbd1b4['where']=_[_0xd60a('0x3b')](_0xbd1b4[_0xd60a('0x39')],{'$or':_[_0xd60a('0x2f')](_0xbd1b4[_0xd60a('0x34')],function(_0x50bef4){var _0x71f8da={};_0x71f8da[_0x50bef4]={'$like':'%'+_0x4a3568[_0xd60a('0x31')][_0xd60a('0x3a')]+'%'};return _0x71f8da;})});}_0xbd1b4=_[_0xd60a('0x3b')]({},_0xbd1b4,_0x4a3568[_0xd60a('0x3e')]);return _0x2c7b87['getSubjects'](_0xbd1b4);}})[_0xd60a('0x25')](function(_0x262660){if(_0x262660){_0x2cee51=_0x262660[_0xd60a('0x35')];if(!_0x4a3568[_0xd60a('0x31')]['hasOwnProperty'](_0xd60a('0x37'))){_0xbd1b4['limit']=qs[_0xd60a('0x1f')](_0x4a3568['query']['limit']);_0xbd1b4['offset']=qs[_0xd60a('0x1d')](_0x4a3568[_0xd60a('0x31')]['offset']);}return _0x2c7b87[_0xd60a('0x4e')](_0xbd1b4);}})[_0xd60a('0x25')](function(_0x2f2e1a){if(_0x2f2e1a){return _0x2f2e1a?{'count':_0x2cee51,'rows':_0x2f2e1a}:null;}})[_0xd60a('0x25')](respondWithResult(_0x5aab7c,null))[_0xd60a('0x46')](handleError(_0x5aab7c,null));};exports[_0xd60a('0x4f')]=function(_0xc1f00c,_0x14412f,_0x42a8ce){var _0x273778={};var _0x40889e={};var _0x1adaee;var _0x100b3d;return db[_0xd60a('0x2a')][_0xd60a('0x4d')]({'where':{'id':_0xc1f00c[_0xd60a('0x42')]['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x14412f,null))[_0xd60a('0x25')](function(_0x10d19b){if(_0x10d19b){_0x1adaee=_0x10d19b;_0x40889e[_0xd60a('0x2e')]=_[_0xd60a('0x30')](db[_0xd60a('0x4a')]['rawAttributes']);_0x40889e[_0xd60a('0x31')]=_[_0xd60a('0x30')](_0xc1f00c[_0xd60a('0x31')]);_0x40889e[_0xd60a('0x32')]=_[_0xd60a('0x43')](_0x40889e[_0xd60a('0x2e')],_0x40889e[_0xd60a('0x31')]);_0x273778['attributes']=_['intersection'](_0x40889e[_0xd60a('0x2e')],qs[_0xd60a('0x33')](_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x33')]));_0x273778[_0xd60a('0x34')]=_0x273778[_0xd60a('0x34')][_0xd60a('0x35')]?_0x273778['attributes']:_0x40889e[_0xd60a('0x2e')];_0x273778[_0xd60a('0x4b')]=qs[_0xd60a('0x38')](_0xc1f00c[_0xd60a('0x31')]['sort']);_0x273778[_0xd60a('0x39')]=qs[_0xd60a('0x32')](_['pick'](_0xc1f00c[_0xd60a('0x31')],_0x40889e[_0xd60a('0x32')]));if(_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x3a')]){_0x273778[_0xd60a('0x39')]=_[_0xd60a('0x3b')](_0x273778['where'],{'$or':_[_0xd60a('0x2f')](_0x273778[_0xd60a('0x34')],function(_0x2adb0d){var _0x14720b={};_0x14720b[_0x2adb0d]={'$like':'%'+_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x3a')]+'%'};return _0x14720b;})});}_0x273778=_[_0xd60a('0x3b')]({},_0x273778,_0xc1f00c[_0xd60a('0x3e')]);return _0x1adaee['getDescriptions'](_0x273778);}})[_0xd60a('0x25')](function(_0x5876e4){if(_0x5876e4){_0x100b3d=_0x5876e4[_0xd60a('0x35')];if(!_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x36')](_0xd60a('0x37'))){_0x273778[_0xd60a('0x1f')]=qs['limit'](_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x1f')]);_0x273778[_0xd60a('0x1d')]=qs[_0xd60a('0x1d')](_0xc1f00c[_0xd60a('0x31')][_0xd60a('0x1d')]);}return _0x1adaee[_0xd60a('0x4f')](_0x273778);}})[_0xd60a('0x25')](function(_0x2ee900){if(_0x2ee900){return _0x2ee900?{'count':_0x100b3d,'rows':_0x2ee900}:null;}})[_0xd60a('0x25')](respondWithResult(_0x14412f,null))[_0xd60a('0x46')](handleError(_0x14412f,null));};exports[_0xd60a('0x50')]=function(_0x172531,_0xe05745,_0x3b7fa4){var _0x40ceba={};var _0x5fdbc6={};var _0xf3520e;var _0x2a8f92;return db[_0xd60a('0x2a')]['findOne']({'where':{'id':_0x172531[_0xd60a('0x42')]['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0xe05745,null))[_0xd60a('0x25')](function(_0x4f6e0e){if(_0x4f6e0e){_0xf3520e=_0x4f6e0e;_0x5fdbc6[_0xd60a('0x2e')]=_['keys'](db['Tag'][_0xd60a('0x2b')]);_0x5fdbc6[_0xd60a('0x31')]=_[_0xd60a('0x30')](_0x172531[_0xd60a('0x31')]);_0x5fdbc6[_0xd60a('0x32')]=_[_0xd60a('0x43')](_0x5fdbc6[_0xd60a('0x2e')],_0x5fdbc6['query']);_0x40ceba[_0xd60a('0x34')]=_[_0xd60a('0x43')](_0x5fdbc6[_0xd60a('0x2e')],qs[_0xd60a('0x33')](_0x172531[_0xd60a('0x31')][_0xd60a('0x33')]));_0x40ceba[_0xd60a('0x34')]=_0x40ceba['attributes'][_0xd60a('0x35')]?_0x40ceba[_0xd60a('0x34')]:_0x5fdbc6[_0xd60a('0x2e')];_0x40ceba[_0xd60a('0x4b')]=qs[_0xd60a('0x38')](_0x172531[_0xd60a('0x31')]['sort']);_0x40ceba[_0xd60a('0x39')]=qs[_0xd60a('0x32')](_[_0xd60a('0x4c')](_0x172531[_0xd60a('0x31')],_0x5fdbc6[_0xd60a('0x32')]));if(_0x172531[_0xd60a('0x31')][_0xd60a('0x3a')]){_0x40ceba[_0xd60a('0x39')]=_['merge'](_0x40ceba[_0xd60a('0x39')],{'$or':_[_0xd60a('0x2f')](_0x40ceba[_0xd60a('0x34')],function(_0x4f77e0){var _0x4036d6={};_0x4036d6[_0x4f77e0]={'$like':'%'+_0x172531[_0xd60a('0x31')][_0xd60a('0x3a')]+'%'};return _0x4036d6;})});}_0x40ceba=_['merge']({},_0x40ceba,_0x172531[_0xd60a('0x3e')]);return _0xf3520e[_0xd60a('0x50')](_0x40ceba);}})[_0xd60a('0x25')](function(_0x311e77){if(_0x311e77){_0x2a8f92=_0x311e77['length'];if(!_0x172531[_0xd60a('0x31')][_0xd60a('0x36')](_0xd60a('0x37'))){_0x40ceba[_0xd60a('0x1f')]=qs[_0xd60a('0x1f')](_0x172531['query'][_0xd60a('0x1f')]);_0x40ceba[_0xd60a('0x1d')]=qs['offset'](_0x172531['query']['offset']);}return _0xf3520e['getTags'](_0x40ceba);}})[_0xd60a('0x25')](function(_0x185047){if(_0x185047){return _0x185047?{'count':_0x2a8f92,'rows':_0x185047}:null;}})[_0xd60a('0x25')](respondWithResult(_0xe05745,null))['catch'](handleError(_0xe05745,null));};exports[_0xd60a('0x51')]=function(_0x249b3c,_0x5a2773,_0x37708e){if(_0x249b3c[_0xd60a('0x49')]['id']){delete _0x249b3c['body']['id'];}return db[_0xd60a('0x2a')]['findOne']({'where':{'id':_0x249b3c[_0xd60a('0x42')]['id']}})[_0xd60a('0x25')](handleEntityNotFound(_0x5a2773,null))[_0xd60a('0x25')](function(_0x341513){if(_0x341513){return _0x341513[_0xd60a('0x51')](_0x249b3c[_0xd60a('0x49')][_0xd60a('0x52')]||[]);}return null;})[_0xd60a('0x25')](respondWithResult(_0x5a2773,null))[_0xd60a('0x46')](handleError(_0x5a2773,null));}; \ No newline at end of file +var _0x809c=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x37f9c1,_0x217be1){var _0x27b999=function(_0x185289){while(--_0x185289){_0x37f9c1['push'](_0x37f9c1['shift']());}};_0x27b999(++_0x217be1);}(_0x809c,0x69));var _0xc809=function(_0x58a45f,_0x42dd71){_0x58a45f=_0x58a45f-0x0;var _0x2daa1b=_0x809c[_0x58a45f];return _0x2daa1b;};'use strict';var emlformat=require(_0xc809('0x0'));var rimraf=require(_0xc809('0x1'));var zipdir=require(_0xc809('0x2'));var jsonpatch=require(_0xc809('0x3'));var rp=require(_0xc809('0x4'));var moment=require('moment');var BPromise=require(_0xc809('0x5'));var Mustache=require(_0xc809('0x6'));var util=require('util');var path=require(_0xc809('0x7'));var sox=require('sox');var csv=require(_0xc809('0x8'));var ejs=require(_0xc809('0x9'));var fs=require('fs');var fs_extra=require(_0xc809('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc809('0xb'));var deskjs=require(_0xc809('0xc'));var toCsv=require(_0xc809('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc809('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc809('0xe'));var as=require(_0xc809('0xf'));var hardwareService=require(_0xc809('0x10'));var logger=require(_0xc809('0x11'))(_0xc809('0x12'));var utils=require(_0xc809('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc809('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x875dae,_0x3a186a){_0x3a186a=_0x3a186a||0xcc;return function(_0xb798cb){if(_0xb798cb){return _0x875dae[_0xc809('0x15')](_0x3a186a);}return _0x875dae[_0xc809('0x16')](_0x3a186a)['end']();};}function respondWithResult(_0x4a84af,_0x38ccc6){_0x38ccc6=_0x38ccc6||0xc8;return function(_0x5e8900){if(_0x5e8900){return _0x4a84af[_0xc809('0x16')](_0x38ccc6)[_0xc809('0x17')](_0x5e8900);}};}function respondWithFilteredResult(_0x3f2428,_0x152198){return function(_0x51e204){if(_0x51e204){var _0x2128bb=typeof _0x152198[_0xc809('0x18')]===_0xc809('0x19')&&typeof _0x152198[_0xc809('0x1a')]==='undefined';var _0x10a414=_0x51e204[_0xc809('0x1b')];var _0x36855a=_0x2128bb?0x0:_0x152198[_0xc809('0x18')];var _0x3b1359=_0x2128bb?_0x51e204['count']:_0x152198[_0xc809('0x18')]+_0x152198[_0xc809('0x1a')];var _0x25d852;if(_0x3b1359>=_0x10a414){_0x3b1359=_0x10a414;_0x25d852=0xc8;}else{_0x25d852=0xce;}_0x3f2428[_0xc809('0x16')](_0x25d852);return _0x3f2428['set'](_0xc809('0x1c'),_0x36855a+'-'+_0x3b1359+'/'+_0x10a414)[_0xc809('0x17')](_0x51e204);}return null;};}function patchUpdates(_0x27fbc1){return function(_0x42d6a6){try{jsonpatch['apply'](_0x42d6a6,_0x27fbc1,!![]);}catch(_0x4769e0){return BPromise['reject'](_0x4769e0);}return _0x42d6a6[_0xc809('0x1d')]();};}function saveUpdates(_0x34028e,_0x13108a){return function(_0x14eb1c){if(_0x14eb1c){return _0x14eb1c[_0xc809('0x1e')](_0x34028e)['then'](function(_0x4b4325){return _0x4b4325;});}return null;};}function removeEntity(_0x5ed97a,_0x1f02c3){return function(_0x40a122){if(_0x40a122){return _0x40a122[_0xc809('0x1f')]()[_0xc809('0x20')](function(){_0x5ed97a[_0xc809('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x254722,_0xb471ab){return function(_0x2c51e7){if(!_0x2c51e7){_0x254722[_0xc809('0x15')](0x194);}return _0x2c51e7;};}function handleError(_0x3bcbf0,_0x277a68){_0x277a68=_0x277a68||0x1f4;return function(_0x2356a4){logger['error'](_0x2356a4['stack']);if(_0x2356a4[_0xc809('0x21')]){delete _0x2356a4[_0xc809('0x21')];}_0x3bcbf0['status'](_0x277a68)['send'](_0x2356a4);};}exports[_0xc809('0x22')]=function(_0x1bc4ba,_0x50bc9d){var _0x1c5948={},_0x4ca63d={},_0x3502a7={'count':0x0,'rows':[]};var _0x5c61f6=_[_0xc809('0x23')](db['FreshdeskConfiguration'][_0xc809('0x24')],function(_0x189c98){return{'name':_0x189c98[_0xc809('0x25')],'type':_0x189c98[_0xc809('0x26')][_0xc809('0x27')]};});_0x4ca63d['model']=_[_0xc809('0x23')](_0x5c61f6,_0xc809('0x21'));_0x4ca63d[_0xc809('0x28')]=_['keys'](_0x1bc4ba['query']);_0x4ca63d[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x4ca63d[_0xc809('0x2b')],_0x4ca63d['query']);_0x1c5948[_0xc809('0x2c')]=_['intersection'](_0x4ca63d[_0xc809('0x2b')],qs['fields'](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x2d')]));_0x1c5948[_0xc809('0x2c')]=_0x1c5948['attributes'][_0xc809('0x2e')]?_0x1c5948[_0xc809('0x2c')]:_0x4ca63d[_0xc809('0x2b')];if(!_0x1bc4ba[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x1c5948[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x1a')]);_0x1c5948['offset']=qs['offset'](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x18')]);}_0x1c5948[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x1bc4ba['query'][_0xc809('0x32')]);_0x1c5948[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x1bc4ba[_0xc809('0x28')],_0x4ca63d['filters']),_0x5c61f6);if(_0x1bc4ba[_0xc809('0x28')]['filter']){_0x1c5948['where']=_[_0xc809('0x35')](_0x1c5948[_0xc809('0x33')],{'$or':_['map'](_0x5c61f6,function(_0x17ec15){if(_0x17ec15[_0xc809('0x26')]!==_0xc809('0x36')){var _0x52f267={};_0x52f267[_0x17ec15[_0xc809('0x21')]]={'$like':'%'+_0x1bc4ba['query'][_0xc809('0x37')]+'%'};return _0x52f267;}})});}_0x1c5948=_['merge']({},_0x1c5948,_0x1bc4ba['options']);var _0x54d38e={'where':_0x1c5948[_0xc809('0x33')]};return db[_0xc809('0x38')][_0xc809('0x1b')](_0x54d38e)[_0xc809('0x20')](function(_0x33f13a){_0x3502a7[_0xc809('0x1b')]=_0x33f13a;if(_0x1bc4ba[_0xc809('0x28')][_0xc809('0x39')]){_0x1c5948[_0xc809('0x3a')]=[{'all':!![]}];}return db[_0xc809('0x38')][_0xc809('0x3b')](_0x1c5948);})['then'](function(_0x43c21d){_0x3502a7['rows']=_0x43c21d;return _0x3502a7;})[_0xc809('0x20')](respondWithFilteredResult(_0x50bc9d,_0x1c5948))[_0xc809('0x3c')](handleError(_0x50bc9d,null));};exports[_0xc809('0x3d')]=function(_0x1dc11f,_0x57f9ca){var _0x58fef4={'raw':![],'where':{'id':_0x1dc11f[_0xc809('0x3e')]['id']}},_0x2d44f6={};_0x2d44f6['model']=_[_0xc809('0x3f')](db['FreshdeskConfiguration'][_0xc809('0x24')]);_0x2d44f6[_0xc809('0x28')]=_['keys'](_0x1dc11f['query']);_0x2d44f6['filters']=_[_0xc809('0x2a')](_0x2d44f6[_0xc809('0x2b')],_0x2d44f6[_0xc809('0x28')]);_0x58fef4[_0xc809('0x2c')]=_['intersection'](_0x2d44f6[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x1dc11f['query']['fields']));_0x58fef4['attributes']=_0x58fef4[_0xc809('0x2c')]['length']?_0x58fef4[_0xc809('0x2c')]:_0x2d44f6[_0xc809('0x2b')];if(_0x1dc11f[_0xc809('0x28')][_0xc809('0x39')]){_0x58fef4[_0xc809('0x3a')]=[{'all':!![]}];}_0x58fef4=_[_0xc809('0x35')]({},_0x58fef4,_0x1dc11f[_0xc809('0x40')]);return db[_0xc809('0x38')][_0xc809('0x41')](_0x58fef4)[_0xc809('0x20')](handleEntityNotFound(_0x57f9ca,null))[_0xc809('0x20')](respondWithResult(_0x57f9ca,null))[_0xc809('0x3c')](handleError(_0x57f9ca,null));};exports[_0xc809('0x42')]=function(_0x57b3c3,_0x19fe7c){return db[_0xc809('0x38')]['create'](_0x57b3c3[_0xc809('0x43')],{})[_0xc809('0x20')](respondWithResult(_0x19fe7c,0xc9))[_0xc809('0x3c')](handleError(_0x19fe7c,null));};exports[_0xc809('0x1e')]=function(_0x201ea2,_0x2a9a58){if(_0x201ea2[_0xc809('0x43')]['id']){delete _0x201ea2[_0xc809('0x43')]['id'];}return db[_0xc809('0x38')][_0xc809('0x41')]({'where':{'id':_0x201ea2[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x2a9a58,null))[_0xc809('0x20')](saveUpdates(_0x201ea2['body'],null))[_0xc809('0x20')](respondWithResult(_0x2a9a58,null))['catch'](handleError(_0x2a9a58,null));};exports[_0xc809('0x1f')]=function(_0x26ecfe,_0x12c73a){return db[_0xc809('0x38')][_0xc809('0x41')]({'where':{'id':_0x26ecfe[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x12c73a,null))['then'](removeEntity(_0x12c73a,null))[_0xc809('0x3c')](handleError(_0x12c73a,null));};exports[_0xc809('0x44')]=function(_0xea74a0,_0x5f0941,_0x1e51e1){var _0x42dac2={};var _0x4a9c3a={};var _0x1fe98b;var _0xf889d6;return db[_0xc809('0x38')]['findOne']({'where':{'id':_0xea74a0[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x5f0941,null))[_0xc809('0x20')](function(_0x260483){if(_0x260483){_0x1fe98b=_0x260483;_0x4a9c3a[_0xc809('0x2b')]=_['keys'](db[_0xc809('0x45')]['rawAttributes']);_0x4a9c3a[_0xc809('0x28')]=_['keys'](_0xea74a0[_0xc809('0x28')]);_0x4a9c3a[_0xc809('0x29')]=_['intersection'](_0x4a9c3a[_0xc809('0x2b')],_0x4a9c3a[_0xc809('0x28')]);_0x42dac2[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x4a9c3a[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0xea74a0[_0xc809('0x28')][_0xc809('0x2d')]));_0x42dac2[_0xc809('0x2c')]=_0x42dac2[_0xc809('0x2c')][_0xc809('0x2e')]?_0x42dac2[_0xc809('0x2c')]:_0x4a9c3a[_0xc809('0x2b')];_0x42dac2['order']=qs[_0xc809('0x32')](_0xea74a0['query'][_0xc809('0x32')]);_0x42dac2[_0xc809('0x33')]=qs['filters'](_[_0xc809('0x34')](_0xea74a0[_0xc809('0x28')],_0x4a9c3a[_0xc809('0x29')]));if(_0xea74a0[_0xc809('0x28')][_0xc809('0x37')]){_0x42dac2['where']=_[_0xc809('0x35')](_0x42dac2[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x42dac2[_0xc809('0x2c')],function(_0x526fc5){var _0x29fbd5={};_0x29fbd5[_0x526fc5]={'$like':'%'+_0xea74a0[_0xc809('0x28')][_0xc809('0x37')]+'%'};return _0x29fbd5;})});}_0x42dac2=_[_0xc809('0x35')]({},_0x42dac2,_0xea74a0['options']);return _0x1fe98b[_0xc809('0x44')](_0x42dac2);}})[_0xc809('0x20')](function(_0x2e6fd0){if(_0x2e6fd0){_0xf889d6=_0x2e6fd0['length'];if(!_0xea74a0[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x42dac2[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0xea74a0[_0xc809('0x28')][_0xc809('0x1a')]);_0x42dac2[_0xc809('0x18')]=qs['offset'](_0xea74a0[_0xc809('0x28')][_0xc809('0x18')]);}return _0x1fe98b[_0xc809('0x44')](_0x42dac2);}})[_0xc809('0x20')](function(_0x523f57){if(_0x523f57){return _0x523f57?{'count':_0xf889d6,'rows':_0x523f57}:null;}})[_0xc809('0x20')](respondWithResult(_0x5f0941,null))[_0xc809('0x3c')](handleError(_0x5f0941,null));};exports[_0xc809('0x46')]=function(_0x45af6f,_0x383bee,_0x5130cd){var _0x5eb9a3={};var _0x222867={};var _0x491259;var _0x1b272b;return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x45af6f[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x383bee,null))['then'](function(_0xe10f1b){if(_0xe10f1b){_0x491259=_0xe10f1b;_0x222867['model']=_[_0xc809('0x3f')](db[_0xc809('0x45')][_0xc809('0x24')]);_0x222867[_0xc809('0x28')]=_[_0xc809('0x3f')](_0x45af6f['query']);_0x222867[_0xc809('0x29')]=_['intersection'](_0x222867[_0xc809('0x2b')],_0x222867['query']);_0x5eb9a3[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x222867[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x45af6f['query'][_0xc809('0x2d')]));_0x5eb9a3['attributes']=_0x5eb9a3['attributes'][_0xc809('0x2e')]?_0x5eb9a3[_0xc809('0x2c')]:_0x222867[_0xc809('0x2b')];_0x5eb9a3[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x45af6f[_0xc809('0x28')][_0xc809('0x32')]);_0x5eb9a3[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x45af6f[_0xc809('0x28')],_0x222867['filters']));if(_0x45af6f['query'][_0xc809('0x37')]){_0x5eb9a3[_0xc809('0x33')]=_['merge'](_0x5eb9a3[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x5eb9a3['attributes'],function(_0x67c8e7){var _0x53fed9={};_0x53fed9[_0x67c8e7]={'$like':'%'+_0x45af6f[_0xc809('0x28')][_0xc809('0x37')]+'%'};return _0x53fed9;})});}_0x5eb9a3=_[_0xc809('0x35')]({},_0x5eb9a3,_0x45af6f[_0xc809('0x40')]);return _0x491259[_0xc809('0x46')](_0x5eb9a3);}})[_0xc809('0x20')](function(_0xbcec8e){if(_0xbcec8e){_0x1b272b=_0xbcec8e['length'];if(!_0x45af6f[_0xc809('0x28')][_0xc809('0x2f')]('nolimit')){_0x5eb9a3['limit']=qs[_0xc809('0x1a')](_0x45af6f[_0xc809('0x28')][_0xc809('0x1a')]);_0x5eb9a3['offset']=qs[_0xc809('0x18')](_0x45af6f[_0xc809('0x28')]['offset']);}return _0x491259['getSubjects'](_0x5eb9a3);}})[_0xc809('0x20')](function(_0x494747){if(_0x494747){return _0x494747?{'count':_0x1b272b,'rows':_0x494747}:null;}})[_0xc809('0x20')](respondWithResult(_0x383bee,null))[_0xc809('0x3c')](handleError(_0x383bee,null));};exports[_0xc809('0x48')]=function(_0x613713,_0x16c8ae,_0x43f913){var _0x5b5fe5={};var _0x222dde={};var _0x68a657;var _0x50718d;return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x613713['params']['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x16c8ae,null))[_0xc809('0x20')](function(_0x4a8d14){if(_0x4a8d14){_0x68a657=_0x4a8d14;_0x222dde[_0xc809('0x2b')]=_[_0xc809('0x3f')](db[_0xc809('0x45')][_0xc809('0x24')]);_0x222dde[_0xc809('0x28')]=_['keys'](_0x613713['query']);_0x222dde[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x222dde[_0xc809('0x2b')],_0x222dde[_0xc809('0x28')]);_0x5b5fe5['attributes']=_['intersection'](_0x222dde['model'],qs['fields'](_0x613713['query'][_0xc809('0x2d')]));_0x5b5fe5[_0xc809('0x2c')]=_0x5b5fe5[_0xc809('0x2c')][_0xc809('0x2e')]?_0x5b5fe5[_0xc809('0x2c')]:_0x222dde[_0xc809('0x2b')];_0x5b5fe5[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x613713[_0xc809('0x28')][_0xc809('0x32')]);_0x5b5fe5[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x613713[_0xc809('0x28')],_0x222dde[_0xc809('0x29')]));if(_0x613713[_0xc809('0x28')][_0xc809('0x37')]){_0x5b5fe5[_0xc809('0x33')]=_[_0xc809('0x35')](_0x5b5fe5[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x5b5fe5[_0xc809('0x2c')],function(_0xc59426){var _0x24cbfc={};_0x24cbfc[_0xc59426]={'$like':'%'+_0x613713['query'][_0xc809('0x37')]+'%'};return _0x24cbfc;})});}_0x5b5fe5=_[_0xc809('0x35')]({},_0x5b5fe5,_0x613713[_0xc809('0x40')]);return _0x68a657['getDescriptions'](_0x5b5fe5);}})['then'](function(_0x4b1797){if(_0x4b1797){_0x50718d=_0x4b1797[_0xc809('0x2e')];if(!_0x613713[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x5b5fe5[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0x613713[_0xc809('0x28')][_0xc809('0x1a')]);_0x5b5fe5[_0xc809('0x18')]=qs['offset'](_0x613713[_0xc809('0x28')][_0xc809('0x18')]);}return _0x68a657['getDescriptions'](_0x5b5fe5);}})[_0xc809('0x20')](function(_0x430f78){if(_0x430f78){return _0x430f78?{'count':_0x50718d,'rows':_0x430f78}:null;}})[_0xc809('0x20')](respondWithResult(_0x16c8ae,null))[_0xc809('0x3c')](handleError(_0x16c8ae,null));};exports[_0xc809('0x49')]=function(_0x5cbae3,_0x2177f4,_0x399c4e){var _0x3b40da={};var _0x417ba3={};var _0x3b92a2;var _0x281d53;return db[_0xc809('0x38')][_0xc809('0x47')]({'where':{'id':_0x5cbae3[_0xc809('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2177f4,null))[_0xc809('0x20')](function(_0x330482){if(_0x330482){_0x3b92a2=_0x330482;_0x417ba3[_0xc809('0x2b')]=_[_0xc809('0x3f')](db[_0xc809('0x4a')][_0xc809('0x24')]);_0x417ba3['query']=_[_0xc809('0x3f')](_0x5cbae3[_0xc809('0x28')]);_0x417ba3[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x417ba3[_0xc809('0x2b')],_0x417ba3[_0xc809('0x28')]);_0x3b40da[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x417ba3[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x5cbae3['query']['fields']));_0x3b40da['attributes']=_0x3b40da[_0xc809('0x2c')]['length']?_0x3b40da[_0xc809('0x2c')]:_0x417ba3[_0xc809('0x2b')];_0x3b40da[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x5cbae3['query'][_0xc809('0x32')]);_0x3b40da[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x5cbae3['query'],_0x417ba3['filters']));if(_0x5cbae3[_0xc809('0x28')][_0xc809('0x37')]){_0x3b40da[_0xc809('0x33')]=_[_0xc809('0x35')](_0x3b40da[_0xc809('0x33')],{'$or':_['map'](_0x3b40da[_0xc809('0x2c')],function(_0x6246c5){var _0x497d3b={};_0x497d3b[_0x6246c5]={'$like':'%'+_0x5cbae3[_0xc809('0x28')]['filter']+'%'};return _0x497d3b;})});}_0x3b40da=_[_0xc809('0x35')]({},_0x3b40da,_0x5cbae3[_0xc809('0x40')]);return _0x3b92a2[_0xc809('0x49')](_0x3b40da);}})[_0xc809('0x20')](function(_0x349188){if(_0x349188){_0x281d53=_0x349188[_0xc809('0x2e')];if(!_0x5cbae3[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x3b40da['limit']=qs[_0xc809('0x1a')](_0x5cbae3[_0xc809('0x28')]['limit']);_0x3b40da[_0xc809('0x18')]=qs['offset'](_0x5cbae3[_0xc809('0x28')][_0xc809('0x18')]);}return _0x3b92a2[_0xc809('0x49')](_0x3b40da);}})['then'](function(_0x58eff3){if(_0x58eff3){return _0x58eff3?{'count':_0x281d53,'rows':_0x58eff3}:null;}})[_0xc809('0x20')](respondWithResult(_0x2177f4,null))['catch'](handleError(_0x2177f4,null));};exports['setTags']=function(_0x147953,_0x51c7bc,_0x36c364){if(_0x147953[_0xc809('0x43')]['id']){delete _0x147953[_0xc809('0x43')]['id'];}return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x147953[_0xc809('0x3e')]['id']}})['then'](handleEntityNotFound(_0x51c7bc,null))[_0xc809('0x20')](function(_0x5f473d){if(_0x5f473d){return _0x5f473d['setTags'](_0x147953['body'][_0xc809('0x4b')]||[]);}return null;})[_0xc809('0x20')](respondWithResult(_0x51c7bc,null))['catch'](handleError(_0x51c7bc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2f6d209..f37004d 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 _0xc363=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x54e5fd,_0x10232e){var _0x39f2c8=function(_0xf636c6){while(--_0xf636c6){_0x54e5fd['push'](_0x54e5fd['shift']());}};_0x39f2c8(++_0x10232e);}(_0xc363,0x140));var _0x3c36=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0xc363[_0x4392af];return _0x9fa8eb;};'use strict';var _=require(_0x3c36('0x0'));var util=require(_0x3c36('0x1'));var logger=require('../../config/logger')(_0x3c36('0x2'));var moment=require(_0x3c36('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c36('0x4'));var fs=require('fs');var path=require(_0x3c36('0x5'));var rimraf=require(_0x3c36('0x6'));var config=require(_0x3c36('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x3c36('0x8')]=function(_0x674bf1,_0xffdb21){return _0x674bf1[_0x3c36('0x9')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59e4=['../../config/logger','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0xada7af,_0x19e596){var _0x1769a4=function(_0x529d4a){while(--_0x529d4a){_0xada7af['push'](_0xada7af['shift']());}};_0x1769a4(++_0x19e596);}(_0x59e4,0xe5));var _0x459e=function(_0x5acb94,_0x389dbc){_0x5acb94=_0x5acb94-0x0;var _0x11800a=_0x59e4[_0x5acb94];return _0x11800a;};'use strict';var _=require(_0x459e('0x0'));var util=require(_0x459e('0x1'));var logger=require(_0x459e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x459e('0x3'));var rimraf=require(_0x459e('0x4'));var config=require(_0x459e('0x5'));var attributes=require(_0x459e('0x6'));module[_0x459e('0x7')]=function(_0x78e54,_0x325f7f){return _0x78e54[_0x459e('0x8')](_0x459e('0x9'),attributes,{'tableName':_0x459e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5fe78f0..0d51548 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 _0xb2cf=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xb2cf,0xd3));var _0xfb2c=function(_0x8b8707,_0x2520db){_0x8b8707=_0x8b8707-0x0;var _0x3e2d7d=_0xb2cf[_0x8b8707];return _0x3e2d7d;};'use strict';var _=require(_0xfb2c('0x0'));var util=require(_0xfb2c('0x1'));var moment=require(_0xfb2c('0x2'));var BPromise=require(_0xfb2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb2c('0x5'));var logger=require(_0xfb2c('0x6'))(_0xfb2c('0x7'));var config=require(_0xfb2c('0x8'));var jayson=require(_0xfb2c('0x9'));var client=jayson[_0xfb2c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf7da5f,_0x1da968,_0x189ed0){return new BPromise(function(_0x2a3357,_0x434ff1){return client['request'](_0xf7da5f,_0x189ed0)[_0xfb2c('0xb')](function(_0x8573df){logger['info'](_0xfb2c('0xc'),_0x1da968,_0xfb2c('0xd'));logger['debug'](_0xfb2c('0xe'),_0x1da968,_0xfb2c('0xd'),JSON[_0xfb2c('0xf')](_0x8573df));if(_0x8573df[_0xfb2c('0x10')]){if(_0x8573df[_0xfb2c('0x10')]['code']===0x1f4){logger[_0xfb2c('0x10')](_0xfb2c('0xc'),_0x1da968,_0x8573df['error'][_0xfb2c('0x11')]);return _0x434ff1(_0x8573df[_0xfb2c('0x10')][_0xfb2c('0x11')]);}logger['error'](_0xfb2c('0xc'),_0x1da968,_0x8573df[_0xfb2c('0x10')]['message']);return _0x2a3357(_0x8573df['error'][_0xfb2c('0x11')]);}else{logger[_0xfb2c('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1da968,_0xfb2c('0xd'));_0x2a3357(_0x8573df[_0xfb2c('0x13')][_0xfb2c('0x11')]);}})[_0xfb2c('0x14')](function(_0x2886a2){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1da968,_0x2886a2);_0x434ff1(_0x2886a2);});});} \ No newline at end of file +var _0x4727=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d3625,_0x4e11f5){var _0x6fb216=function(_0x55a815){while(--_0x55a815){_0x1d3625['push'](_0x1d3625['shift']());}};_0x6fb216(++_0x4e11f5);}(_0x4727,0xf6));var _0x7472=function(_0x45e3ef,_0x558886){_0x45e3ef=_0x45e3ef-0x0;var _0x43d68e=_0x4727[_0x45e3ef];return _0x43d68e;};'use strict';var _=require(_0x7472('0x0'));var util=require('util');var moment=require(_0x7472('0x1'));var BPromise=require(_0x7472('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7472('0x3'));var db=require(_0x7472('0x4'))['db'];var utils=require(_0x7472('0x5'));var logger=require(_0x7472('0x6'))(_0x7472('0x7'));var config=require(_0x7472('0x8'));var jayson=require(_0x7472('0x9'));var client=jayson[_0x7472('0xa')][_0x7472('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d99d7,_0x465867,_0x3d71bc){return new BPromise(function(_0xbb6fd9,_0x350566){return client[_0x7472('0xc')](_0x1d99d7,_0x3d71bc)['then'](function(_0x3ca9af){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x465867,_0x7472('0xd'));logger[_0x7472('0xe')](_0x7472('0xf'),_0x465867,_0x7472('0xd'),JSON[_0x7472('0x10')](_0x3ca9af));if(_0x3ca9af[_0x7472('0x11')]){if(_0x3ca9af[_0x7472('0x11')][_0x7472('0x12')]===0x1f4){logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);return _0x350566(_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);}logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);return _0xbb6fd9(_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);}else{logger['info'](_0x7472('0x13'),_0x465867,'request\x20sent');_0xbb6fd9(_0x3ca9af[_0x7472('0x15')][_0x7472('0x14')]);}})[_0x7472('0x16')](function(_0x13a7d6){logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x13a7d6);_0x350566(_0x13a7d6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d4f58f8..04ef013 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 _0x66c8=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','multer','path'];(function(_0x1b5ed1,_0x1899f4){var _0xfb3953=function(_0xc8e2eb){while(--_0xc8e2eb){_0x1b5ed1['push'](_0x1b5ed1['shift']());}};_0xfb3953(++_0x1899f4);}(_0x66c8,0x1c9));var _0x866c=function(_0x444315,_0x46ce81){_0x444315=_0x444315-0x0;var _0x4985c2=_0x66c8[_0x444315];return _0x4985c2;};'use strict';var multer=require(_0x866c('0x0'));var util=require('util');var path=require(_0x866c('0x1'));var timeout=require('connect-timeout');var express=require(_0x866c('0x2'));var router=express['Router']();var fs_extra=require(_0x866c('0x3'));var auth=require(_0x866c('0x4'));var interaction=require(_0x866c('0x5'));var config=require(_0x866c('0x6'));var controller=require(_0x866c('0x7'));router[_0x866c('0x8')]('/',auth[_0x866c('0x9')](),controller[_0x866c('0xa')]);router[_0x866c('0x8')](_0x866c('0xb'),auth['isAuthenticated'](),controller[_0x866c('0xc')]);router['post']('/',auth[_0x866c('0x9')](),controller[_0x866c('0xd')]);router[_0x866c('0xe')](_0x866c('0xb'),auth[_0x866c('0x9')](),controller[_0x866c('0xf')]);router['delete'](_0x866c('0xb'),auth[_0x866c('0x9')](),controller['destroy']);module[_0x866c('0x10')]=router; \ No newline at end of file +var _0xbeae=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create','put','destroy','exports','multer'];(function(_0x423eba,_0xb6826c){var _0x138f29=function(_0x22e9e3){while(--_0x22e9e3){_0x423eba['push'](_0x423eba['shift']());}};_0x138f29(++_0xb6826c);}(_0xbeae,0x6f));var _0xebea=function(_0x493030,_0x29ec7e){_0x493030=_0x493030-0x0;var _0x56f5e4=_0xbeae[_0x493030];return _0x56f5e4;};'use strict';var multer=require(_0xebea('0x0'));var util=require(_0xebea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebea('0x2')]();var fs_extra=require(_0xebea('0x3'));var auth=require(_0xebea('0x4'));var interaction=require(_0xebea('0x5'));var config=require(_0xebea('0x6'));var controller=require(_0xebea('0x7'));router[_0xebea('0x8')]('/',auth[_0xebea('0x9')](),controller[_0xebea('0xa')]);router[_0xebea('0x8')](_0xebea('0xb'),auth[_0xebea('0x9')](),controller['show']);router['post']('/',auth[_0xebea('0x9')](),controller[_0xebea('0xc')]);router[_0xebea('0xd')](_0xebea('0xb'),auth[_0xebea('0x9')](),controller['update']);router['delete'](_0xebea('0xb'),auth[_0xebea('0x9')](),controller[_0xebea('0xe')]);module[_0xebea('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 78c9b11..2bd126c 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 _0x6a6f=['STRING','ENUM','variable','BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist'];(function(_0x18474f,_0x51e0f9){var _0xab5297=function(_0x4b2327){while(--_0x4b2327){_0x18474f['push'](_0x18474f['shift']());}};_0xab5297(++_0x51e0f9);}(_0x6a6f,0xfe));var _0xf6a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6a6('0x0'));module[_0xf6a6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf6a6('0x2'),'variable',_0xf6a6('0x3'),_0xf6a6('0x4'),_0xf6a6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf6a6('0x6')]},'key':{'type':Sequelize[_0xf6a6('0x6')]},'keyType':{'type':Sequelize[_0xf6a6('0x7')](_0xf6a6('0x2'),_0xf6a6('0x8'),_0xf6a6('0x3'))},'keyContent':{'type':Sequelize[_0xf6a6('0x6')]},'idField':{'type':Sequelize[_0xf6a6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf6a6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf6a6('0x6')]}}; \ No newline at end of file +var _0x3ff9=['picklist','string','STRING','ENUM','BOOLEAN','variable','customVariable','keyValue'];(function(_0x44bcb6,_0x16e9a3){var _0x49ac0f=function(_0x418622){while(--_0x418622){_0x44bcb6['push'](_0x44bcb6['shift']());}};_0x49ac0f(++_0x16e9a3);}(_0x3ff9,0x8d));var _0x93ff=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3ff9[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x93ff('0x0'),_0x93ff('0x1'),_0x93ff('0x2'),_0x93ff('0x3')),'defaultValue':_0x93ff('0x4')},'content':{'type':Sequelize[_0x93ff('0x5')]},'key':{'type':Sequelize[_0x93ff('0x5')]},'keyType':{'type':Sequelize[_0x93ff('0x6')](_0x93ff('0x4'),'variable',_0x93ff('0x1'))},'keyContent':{'type':Sequelize[_0x93ff('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x93ff('0x7')],'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 f7c6095..937d98e 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 _0x1b32=['lodash','squel','jsforce','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','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','findAll','rows','show','params','fields','length','includeAll','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1f5d35,_0x13db91){var _0x27355a=function(_0x1a3932){while(--_0x1a3932){_0x1f5d35['push'](_0x1f5d35['shift']());}};_0x27355a(++_0x13db91);}(_0x1b32,0x85));var _0x21b3=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x1b32[_0x220f3f];return _0x1f170e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21b3('0x0'));var zipdir=require(_0x21b3('0x1'));var jsonpatch=require(_0x21b3('0x2'));var rp=require(_0x21b3('0x3'));var moment=require(_0x21b3('0x4'));var BPromise=require(_0x21b3('0x5'));var Mustache=require(_0x21b3('0x6'));var util=require(_0x21b3('0x7'));var path=require(_0x21b3('0x8'));var sox=require(_0x21b3('0x9'));var csv=require(_0x21b3('0xa'));var ejs=require(_0x21b3('0xb'));var fs=require('fs');var fs_extra=require(_0x21b3('0xc'));var _=require(_0x21b3('0xd'));var squel=require(_0x21b3('0xe'));var crypto=require('crypto');var jsforce=require(_0x21b3('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x21b3('0x10'));var Redis=require(_0x21b3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x21b3('0x12'));var hardwareService=require(_0x21b3('0x13'));var logger=require(_0x21b3('0x14'))('api');var utils=require(_0x21b3('0x15'));var config=require(_0x21b3('0x16'));var licenseUtil=require(_0x21b3('0x17'));var db=require(_0x21b3('0x18'))['db'];function respondWithStatusCode(_0x40cc5a,_0x2c7abb){_0x2c7abb=_0x2c7abb||0xcc;return function(_0x3bff49){if(_0x3bff49){return _0x40cc5a[_0x21b3('0x19')](_0x2c7abb);}return _0x40cc5a[_0x21b3('0x1a')](_0x2c7abb)['end']();};}function respondWithResult(_0xa537ad,_0x810f46){_0x810f46=_0x810f46||0xc8;return function(_0x43bede){if(_0x43bede){return _0xa537ad['status'](_0x810f46)[_0x21b3('0x1b')](_0x43bede);}};}function respondWithFilteredResult(_0x4c931d,_0x3f7b4a){return function(_0x579a37){if(_0x579a37){var _0x15662a=typeof _0x3f7b4a[_0x21b3('0x1c')]===_0x21b3('0x1d')&&typeof _0x3f7b4a[_0x21b3('0x1e')]==='undefined';var _0x3f7e7a=_0x579a37['count'];var _0x408c17=_0x15662a?0x0:_0x3f7b4a[_0x21b3('0x1c')];var _0xaf1eba=_0x15662a?_0x579a37[_0x21b3('0x1f')]:_0x3f7b4a['offset']+_0x3f7b4a[_0x21b3('0x1e')];var _0x1e31bb;if(_0xaf1eba>=_0x3f7e7a){_0xaf1eba=_0x3f7e7a;_0x1e31bb=0xc8;}else{_0x1e31bb=0xce;}_0x4c931d[_0x21b3('0x1a')](_0x1e31bb);return _0x4c931d['set'](_0x21b3('0x20'),_0x408c17+'-'+_0xaf1eba+'/'+_0x3f7e7a)[_0x21b3('0x1b')](_0x579a37);}return null;};}function patchUpdates(_0x2f996d){return function(_0x3fe141){try{jsonpatch[_0x21b3('0x21')](_0x3fe141,_0x2f996d,!![]);}catch(_0x1be234){return BPromise[_0x21b3('0x22')](_0x1be234);}return _0x3fe141['save']();};}function saveUpdates(_0xbb78f3,_0x54695b){return function(_0x139672){if(_0x139672){return _0x139672[_0x21b3('0x23')](_0xbb78f3)[_0x21b3('0x24')](function(_0x4fcb87){return _0x4fcb87;});}return null;};}function removeEntity(_0x19ba2c,_0x5bda6e){return function(_0x3ee234){if(_0x3ee234){return _0x3ee234[_0x21b3('0x25')]()[_0x21b3('0x24')](function(){_0x19ba2c[_0x21b3('0x1a')](0xcc)[_0x21b3('0x26')]();});}};}function handleEntityNotFound(_0x2e3221,_0x58822d){return function(_0x5b752c){if(!_0x5b752c){_0x2e3221['sendStatus'](0x194);}return _0x5b752c;};}function handleError(_0x3ca89d,_0x2e3758){_0x2e3758=_0x2e3758||0x1f4;return function(_0x3c1a3b){logger[_0x21b3('0x27')](_0x3c1a3b[_0x21b3('0x28')]);if(_0x3c1a3b['name']){delete _0x3c1a3b[_0x21b3('0x29')];}_0x3ca89d['status'](_0x2e3758)[_0x21b3('0x2a')](_0x3c1a3b);};}exports['index']=function(_0x469e42,_0xf48fc7){var _0x81ee7e={},_0x4f6432={},_0x291e52={'count':0x0,'rows':[]};var _0x300977=_[_0x21b3('0x2b')](db[_0x21b3('0x2c')][_0x21b3('0x2d')],function(_0x210c49){return{'name':_0x210c49[_0x21b3('0x2e')],'type':_0x210c49['type']['key']};});_0x4f6432[_0x21b3('0x2f')]=_[_0x21b3('0x2b')](_0x300977,'name');_0x4f6432[_0x21b3('0x30')]=_[_0x21b3('0x31')](_0x469e42[_0x21b3('0x30')]);_0x4f6432[_0x21b3('0x32')]=_[_0x21b3('0x33')](_0x4f6432[_0x21b3('0x2f')],_0x4f6432[_0x21b3('0x30')]);_0x81ee7e[_0x21b3('0x34')]=_[_0x21b3('0x33')](_0x4f6432['model'],qs['fields'](_0x469e42[_0x21b3('0x30')]['fields']));_0x81ee7e[_0x21b3('0x34')]=_0x81ee7e[_0x21b3('0x34')]['length']?_0x81ee7e[_0x21b3('0x34')]:_0x4f6432[_0x21b3('0x2f')];if(!_0x469e42[_0x21b3('0x30')][_0x21b3('0x35')]('nolimit')){_0x81ee7e[_0x21b3('0x1e')]=qs[_0x21b3('0x1e')](_0x469e42[_0x21b3('0x30')][_0x21b3('0x1e')]);_0x81ee7e['offset']=qs[_0x21b3('0x1c')](_0x469e42['query'][_0x21b3('0x1c')]);}_0x81ee7e[_0x21b3('0x36')]=qs[_0x21b3('0x37')](_0x469e42[_0x21b3('0x30')][_0x21b3('0x37')]);_0x81ee7e[_0x21b3('0x38')]=qs[_0x21b3('0x32')](_['pick'](_0x469e42['query'],_0x4f6432[_0x21b3('0x32')]),_0x300977);if(_0x469e42[_0x21b3('0x30')][_0x21b3('0x39')]){_0x81ee7e[_0x21b3('0x38')]=_['merge'](_0x81ee7e[_0x21b3('0x38')],{'$or':_[_0x21b3('0x2b')](_0x300977,function(_0x128564){if(_0x128564[_0x21b3('0x3a')]!==_0x21b3('0x3b')){var _0xb028ca={};_0xb028ca[_0x128564[_0x21b3('0x29')]]={'$like':'%'+_0x469e42[_0x21b3('0x30')][_0x21b3('0x39')]+'%'};return _0xb028ca;}})});}_0x81ee7e=_[_0x21b3('0x3c')]({},_0x81ee7e,_0x469e42[_0x21b3('0x3d')]);var _0x4facfc={'where':_0x81ee7e[_0x21b3('0x38')]};return db[_0x21b3('0x2c')]['count'](_0x4facfc)[_0x21b3('0x24')](function(_0x5f2623){_0x291e52[_0x21b3('0x1f')]=_0x5f2623;if(_0x469e42[_0x21b3('0x30')]['includeAll']){_0x81ee7e['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x21b3('0x3e')](_0x81ee7e);})[_0x21b3('0x24')](function(_0x3e6501){_0x291e52[_0x21b3('0x3f')]=_0x3e6501;return _0x291e52;})['then'](respondWithFilteredResult(_0xf48fc7,_0x81ee7e))['catch'](handleError(_0xf48fc7,null));};exports[_0x21b3('0x40')]=function(_0x492eaf,_0x1c97e7){var _0x28adbc={'raw':!![],'where':{'id':_0x492eaf[_0x21b3('0x41')]['id']}},_0x306bf2={};_0x306bf2[_0x21b3('0x2f')]=_['keys'](db[_0x21b3('0x2c')][_0x21b3('0x2d')]);_0x306bf2[_0x21b3('0x30')]=_[_0x21b3('0x31')](_0x492eaf[_0x21b3('0x30')]);_0x306bf2[_0x21b3('0x32')]=_['intersection'](_0x306bf2['model'],_0x306bf2[_0x21b3('0x30')]);_0x28adbc[_0x21b3('0x34')]=_[_0x21b3('0x33')](_0x306bf2['model'],qs[_0x21b3('0x42')](_0x492eaf[_0x21b3('0x30')][_0x21b3('0x42')]));_0x28adbc[_0x21b3('0x34')]=_0x28adbc[_0x21b3('0x34')][_0x21b3('0x43')]?_0x28adbc['attributes']:_0x306bf2[_0x21b3('0x2f')];if(_0x492eaf[_0x21b3('0x30')][_0x21b3('0x44')]){_0x28adbc['include']=[{'all':!![]}];}_0x28adbc=_['merge']({},_0x28adbc,_0x492eaf['options']);return db[_0x21b3('0x2c')][_0x21b3('0x45')](_0x28adbc)[_0x21b3('0x24')](handleEntityNotFound(_0x1c97e7,null))[_0x21b3('0x24')](respondWithResult(_0x1c97e7,null))[_0x21b3('0x46')](handleError(_0x1c97e7,null));};exports[_0x21b3('0x47')]=function(_0xc51c1d,_0x30d48b){return db[_0x21b3('0x2c')]['create'](_0xc51c1d['body'],{})['then'](respondWithResult(_0x30d48b,0xc9))[_0x21b3('0x46')](handleError(_0x30d48b,null));};exports[_0x21b3('0x23')]=function(_0x4046cd,_0x2e4add){if(_0x4046cd[_0x21b3('0x48')]['id']){delete _0x4046cd[_0x21b3('0x48')]['id'];}return db[_0x21b3('0x2c')][_0x21b3('0x45')]({'where':{'id':_0x4046cd[_0x21b3('0x41')]['id']}})[_0x21b3('0x24')](handleEntityNotFound(_0x2e4add,null))['then'](saveUpdates(_0x4046cd[_0x21b3('0x48')],null))[_0x21b3('0x24')](respondWithResult(_0x2e4add,null))[_0x21b3('0x46')](handleError(_0x2e4add,null));};exports[_0x21b3('0x25')]=function(_0x34509e,_0x2c7019){return db[_0x21b3('0x2c')][_0x21b3('0x45')]({'where':{'id':_0x34509e[_0x21b3('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c7019,null))[_0x21b3('0x24')](removeEntity(_0x2c7019,null))[_0x21b3('0x46')](handleError(_0x2c7019,null));}; \ No newline at end of file +var _0xc788=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','type','key','map','query','filters','intersection','attributes','model','fields','length','nolimit','offset','sort','where','pick','filter','merge','options','includeAll','include','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x4e58c1,_0x4cb68f){var _0x2993e=function(_0x15bde3){while(--_0x15bde3){_0x4e58c1['push'](_0x4e58c1['shift']());}};_0x2993e(++_0x4cb68f);}(_0xc788,0xc4));var _0x8c78=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0xc788[_0xca18be];return _0x2815ad;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){_0x215940['status'](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x458763,_0x1d1cef){return function(_0x49cccb){if(!_0x49cccb){_0x458763[_0x8c78('0x18')](0x194);}return _0x49cccb;};}function handleError(_0x5d7445,_0xe85d05){_0xe85d05=_0xe85d05||0x1f4;return function(_0x24f9a7){logger[_0x8c78('0x26')](_0x24f9a7['stack']);if(_0x24f9a7[_0x8c78('0x27')]){delete _0x24f9a7[_0x8c78('0x27')];}_0x5d7445['status'](_0xe85d05)[_0x8c78('0x28')](_0x24f9a7);};}exports[_0x8c78('0x29')]=function(_0x394c1d,_0x36e8e5){var _0x253776={},_0x2ab5cc={},_0x5ba7d4={'count':0x0,'rows':[]};var _0x1c3039=_['map'](db[_0x8c78('0x2a')][_0x8c78('0x2b')],function(_0xb69c52){return{'name':_0xb69c52['fieldName'],'type':_0xb69c52[_0x8c78('0x2c')][_0x8c78('0x2d')]};});_0x2ab5cc['model']=_[_0x8c78('0x2e')](_0x1c3039,_0x8c78('0x27'));_0x2ab5cc[_0x8c78('0x2f')]=_['keys'](_0x394c1d[_0x8c78('0x2f')]);_0x2ab5cc[_0x8c78('0x30')]=_[_0x8c78('0x31')](_0x2ab5cc['model'],_0x2ab5cc[_0x8c78('0x2f')]);_0x253776[_0x8c78('0x32')]=_['intersection'](_0x2ab5cc[_0x8c78('0x33')],qs[_0x8c78('0x34')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x34')]));_0x253776[_0x8c78('0x32')]=_0x253776[_0x8c78('0x32')][_0x8c78('0x35')]?_0x253776[_0x8c78('0x32')]:_0x2ab5cc[_0x8c78('0x33')];if(!_0x394c1d[_0x8c78('0x2f')]['hasOwnProperty'](_0x8c78('0x36'))){_0x253776[_0x8c78('0x1d')]=qs[_0x8c78('0x1d')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x1d')]);_0x253776['offset']=qs[_0x8c78('0x37')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x37')]);}_0x253776['order']=qs[_0x8c78('0x38')](_0x394c1d[_0x8c78('0x2f')]['sort']);_0x253776[_0x8c78('0x39')]=qs['filters'](_[_0x8c78('0x3a')](_0x394c1d[_0x8c78('0x2f')],_0x2ab5cc[_0x8c78('0x30')]),_0x1c3039);if(_0x394c1d[_0x8c78('0x2f')]['filter']){_0x253776[_0x8c78('0x39')]=_['merge'](_0x253776[_0x8c78('0x39')],{'$or':_[_0x8c78('0x2e')](_0x1c3039,function(_0x2dbd5e){if(_0x2dbd5e['type']!=='VIRTUAL'){var _0x3a3694={};_0x3a3694[_0x2dbd5e[_0x8c78('0x27')]]={'$like':'%'+_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x3b')]+'%'};return _0x3a3694;}})});}_0x253776=_[_0x8c78('0x3c')]({},_0x253776,_0x394c1d[_0x8c78('0x3d')]);var _0x326b34={'where':_0x253776[_0x8c78('0x39')]};return db[_0x8c78('0x2a')][_0x8c78('0x1e')](_0x326b34)[_0x8c78('0x24')](function(_0x426401){_0x5ba7d4[_0x8c78('0x1e')]=_0x426401;if(_0x394c1d['query'][_0x8c78('0x3e')]){_0x253776[_0x8c78('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x253776);})[_0x8c78('0x24')](function(_0x1612d5){_0x5ba7d4['rows']=_0x1612d5;return _0x5ba7d4;})[_0x8c78('0x24')](respondWithFilteredResult(_0x36e8e5,_0x253776))[_0x8c78('0x40')](handleError(_0x36e8e5,null));};exports['show']=function(_0x348a2f,_0x27603f){var _0x57e2c7={'raw':!![],'where':{'id':_0x348a2f[_0x8c78('0x41')]['id']}},_0x10d521={};_0x10d521[_0x8c78('0x33')]=_[_0x8c78('0x42')](db[_0x8c78('0x2a')]['rawAttributes']);_0x10d521['query']=_[_0x8c78('0x42')](_0x348a2f[_0x8c78('0x2f')]);_0x10d521[_0x8c78('0x30')]=_[_0x8c78('0x31')](_0x10d521[_0x8c78('0x33')],_0x10d521[_0x8c78('0x2f')]);_0x57e2c7[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x10d521[_0x8c78('0x33')],qs[_0x8c78('0x34')](_0x348a2f[_0x8c78('0x2f')]['fields']));_0x57e2c7[_0x8c78('0x32')]=_0x57e2c7[_0x8c78('0x32')][_0x8c78('0x35')]?_0x57e2c7[_0x8c78('0x32')]:_0x10d521[_0x8c78('0x33')];if(_0x348a2f['query'][_0x8c78('0x3e')]){_0x57e2c7[_0x8c78('0x3f')]=[{'all':!![]}];}_0x57e2c7=_[_0x8c78('0x3c')]({},_0x57e2c7,_0x348a2f[_0x8c78('0x3d')]);return db[_0x8c78('0x2a')]['find'](_0x57e2c7)[_0x8c78('0x24')](handleEntityNotFound(_0x27603f,null))['then'](respondWithResult(_0x27603f,null))['catch'](handleError(_0x27603f,null));};exports[_0x8c78('0x43')]=function(_0x33fbba,_0x61e20){return db['FreshdeskField'][_0x8c78('0x43')](_0x33fbba[_0x8c78('0x44')],{})[_0x8c78('0x24')](respondWithResult(_0x61e20,0xc9))[_0x8c78('0x40')](handleError(_0x61e20,null));};exports[_0x8c78('0x23')]=function(_0x38083e,_0x26103c){if(_0x38083e[_0x8c78('0x44')]['id']){delete _0x38083e[_0x8c78('0x44')]['id'];}return db['FreshdeskField'][_0x8c78('0x45')]({'where':{'id':_0x38083e[_0x8c78('0x41')]['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x26103c,null))[_0x8c78('0x24')](saveUpdates(_0x38083e['body'],null))[_0x8c78('0x24')](respondWithResult(_0x26103c,null))[_0x8c78('0x40')](handleError(_0x26103c,null));};exports[_0x8c78('0x25')]=function(_0x431125,_0x53e75c){return db[_0x8c78('0x2a')][_0x8c78('0x45')]({'where':{'id':_0x431125[_0x8c78('0x41')]['id']}})['then'](handleEntityNotFound(_0x53e75c,null))[_0x8c78('0x24')](removeEntity(_0x53e75c,null))['catch'](handleError(_0x53e75c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4d416b9..e68333d 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 _0xc511=['idField','FieldId','lodash','../../config/logger','api','moment','bluebird','rimraf','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x54bdc2,_0x14453d){var _0x53d749=function(_0x39e7bd){while(--_0x39e7bd){_0x54bdc2['push'](_0x54bdc2['shift']());}};_0x53d749(++_0x14453d);}(_0xc511,0x10a));var _0x1c51=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xc511[_0x506172];return _0x2723c0;};'use strict';var _=require(_0x1c51('0x0'));var util=require('util');var logger=require(_0x1c51('0x1'))(_0x1c51('0x2'));var moment=require(_0x1c51('0x3'));var BPromise=require(_0x1c51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1c51('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x167aac,_0x2f2f97){return _0x167aac[_0x1c51('0x6')](_0x1c51('0x7'),attributes,{'tableName':_0x1c51('0x8'),'paranoid':![],'indexes':[{'name':_0x1c51('0x9'),'fields':[_0x1c51('0xa'),_0x1c51('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1904=['FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define'];(function(_0x310170,_0x391a8a){var _0x11d7f8=function(_0x4921cf){while(--_0x4921cf){_0x310170['push'](_0x310170['shift']());}};_0x11d7f8(++_0x391a8a);}(_0x1904,0x1b1));var _0x4190=function(_0x1550d0,_0xc6f629){_0x1550d0=_0x1550d0-0x0;var _0x2efba2=_0x1904[_0x1550d0];return _0x2efba2;};'use strict';var _=require(_0x4190('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4190('0x1'));var BPromise=require(_0x4190('0x2'));var rp=require(_0x4190('0x3'));var fs=require('fs');var path=require(_0x4190('0x4'));var rimraf=require(_0x4190('0x5'));var config=require('../../config/environment');var attributes=require(_0x4190('0x6'));module[_0x4190('0x7')]=function(_0x4dce03,_0x18db79){return _0x4dce03[_0x4190('0x8')](_0x4190('0x9'),attributes,{'tableName':_0x4190('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x4190('0xb'),_0x4190('0xc')],'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 28f2916..ab4fe80 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 _0xb1a2=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client'];(function(_0x5b9dd9,_0x3098bf){var _0x38cf3c=function(_0x610f27){while(--_0x610f27){_0x5b9dd9['push'](_0x5b9dd9['shift']());}};_0x38cf3c(++_0x3098bf);}(_0xb1a2,0xdc));var _0x2b1a=function(_0xcbb179,_0x5d9cd5){_0xcbb179=_0xcbb179-0x0;var _0x153f14=_0xb1a2[_0xcbb179];return _0x153f14;};'use strict';var _=require(_0x2b1a('0x0'));var util=require(_0x2b1a('0x1'));var moment=require('moment');var BPromise=require(_0x2b1a('0x2'));var rs=require(_0x2b1a('0x3'));var fs=require('fs');var Redis=require(_0x2b1a('0x4'));var db=require(_0x2b1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b1a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2b1a('0x7')][_0x2b1a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x176e0f,_0x52ec5f,_0x438447){return new BPromise(function(_0x13e55a,_0x47cd1e){return client[_0x2b1a('0x9')](_0x176e0f,_0x438447)[_0x2b1a('0xa')](function(_0x44ebc2){logger['info'](_0x2b1a('0xb'),_0x52ec5f,_0x2b1a('0xc'));logger['debug'](_0x2b1a('0xd'),_0x52ec5f,_0x2b1a('0xc'),JSON['stringify'](_0x44ebc2));if(_0x44ebc2[_0x2b1a('0xe')]){if(_0x44ebc2[_0x2b1a('0xe')][_0x2b1a('0xf')]===0x1f4){logger[_0x2b1a('0xe')](_0x2b1a('0xb'),_0x52ec5f,_0x44ebc2[_0x2b1a('0xe')][_0x2b1a('0x10')]);return _0x47cd1e(_0x44ebc2['error'][_0x2b1a('0x10')]);}logger[_0x2b1a('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x52ec5f,_0x44ebc2[_0x2b1a('0xe')][_0x2b1a('0x10')]);return _0x13e55a(_0x44ebc2[_0x2b1a('0xe')][_0x2b1a('0x10')]);}else{logger[_0x2b1a('0x11')](_0x2b1a('0xb'),_0x52ec5f,'request\x20sent');_0x13e55a(_0x44ebc2[_0x2b1a('0x12')][_0x2b1a('0x10')]);}})['catch'](function(_0xbe3e06){logger[_0x2b1a('0xe')](_0x2b1a('0xb'),_0x52ec5f,_0xbe3e06);_0x47cd1e(_0xbe3e06);});});} \ No newline at end of file +var _0x3940=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x3940,0x1b9));var _0x0394=function(_0x59de3d,_0x131b92){_0x59de3d=_0x59de3d-0x0;var _0x4f4dac=_0x3940[_0x59de3d];return _0x4f4dac;};'use strict';var _=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var moment=require(_0x0394('0x2'));var BPromise=require(_0x0394('0x3'));var rs=require(_0x0394('0x4'));var fs=require('fs');var Redis=require(_0x0394('0x5'));var db=require(_0x0394('0x6'))['db'];var utils=require(_0x0394('0x7'));var logger=require(_0x0394('0x8'))(_0x0394('0x9'));var config=require(_0x0394('0xa'));var jayson=require(_0x0394('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39fe6b,_0x2d365b,_0x40aa7a){return new BPromise(function(_0x547c8f,_0x2bdc32){return client[_0x0394('0xc')](_0x39fe6b,_0x40aa7a)[_0x0394('0xd')](function(_0x4e18fd){logger['info'](_0x0394('0xe'),_0x2d365b,_0x0394('0xf'));logger[_0x0394('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2d365b,'request\x20sent',JSON['stringify'](_0x4e18fd));if(_0x4e18fd[_0x0394('0x11')]){if(_0x4e18fd['error'][_0x0394('0x12')]===0x1f4){logger[_0x0394('0x11')](_0x0394('0xe'),_0x2d365b,_0x4e18fd['error']['message']);return _0x2bdc32(_0x4e18fd[_0x0394('0x11')][_0x0394('0x13')]);}logger[_0x0394('0x11')](_0x0394('0xe'),_0x2d365b,_0x4e18fd[_0x0394('0x11')][_0x0394('0x13')]);return _0x547c8f(_0x4e18fd[_0x0394('0x11')]['message']);}else{logger[_0x0394('0x14')](_0x0394('0xe'),_0x2d365b,_0x0394('0xf'));_0x547c8f(_0x4e18fd['result'][_0x0394('0x13')]);}})['catch'](function(_0x2087fd){logger['error'](_0x0394('0xe'),_0x2d365b,_0x2087fd);_0x2bdc32(_0x2087fd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 5be4293..0858202 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 _0x593e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_0x593e,0xcb));var _0xe593=function(_0x230ad4,_0x3ae909){_0x230ad4=_0x230ad4-0x0;var _0x385c73=_0x593e[_0x230ad4];return _0x385c73;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var fs_extra=require(_0xe593('0x6'));var auth=require(_0xe593('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x8'));var controller=require(_0xe593('0x9'));router[_0xe593('0xa')]('/',auth[_0xe593('0xb')](),controller[_0xe593('0xc')]);router[_0xe593('0xa')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0xe')]);router[_0xe593('0xa')]('/:id/configurations',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),controller['create']);router[_0xe593('0x11')](_0xe593('0x12'),auth[_0xe593('0xb')](),controller[_0xe593('0x13')]);router[_0xe593('0x14')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0x15')]);router[_0xe593('0x16')](_0xe593('0xd'),auth['isAuthenticated'](),controller[_0xe593('0x17')]);module[_0xe593('0x18')]=router; \ No newline at end of file +var _0xb688=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0xcefab6,_0x66648b){var _0xa382d4=function(_0x25c45d){while(--_0x25c45d){_0xcefab6['push'](_0xcefab6['shift']());}};_0xa382d4(++_0x66648b);}(_0xb688,0xcf));var _0x8b68=function(_0x1c3158,_0x5ebb9e){_0x1c3158=_0x1c3158-0x0;var _0x55cfee=_0xb688[_0x1c3158];return _0x55cfee;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')]('/',auth[_0x8b68('0xc')](),controller['create']);router[_0x8b68('0x12')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 61336f3..2777942 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 _0x9f0e=['STRING','remoteUri','sequelize','exports'];(function(_0x505df1,_0x5819ec){var _0x45f68f=function(_0x380f75){while(--_0x380f75){_0x505df1['push'](_0x505df1['shift']());}};_0x45f68f(++_0x5819ec);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3b86a5,_0x52360c){_0x3b86a5=_0x3b86a5-0x0;var _0x517165=_0x9f0e[_0x3b86a5];return _0x517165;};'use strict';var Sequelize=require(_0xe9f0('0x0'));module[_0xe9f0('0x1')]={'name':{'type':Sequelize[_0xe9f0('0x2')]},'description':{'type':Sequelize[_0xe9f0('0x2')]},'username':{'type':Sequelize[_0xe9f0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe9f0('0x2')],'unique':_0xe9f0('0x3')},'serverUrl':{'type':Sequelize[_0xe9f0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6a55=['STRING','sequelize'];(function(_0x40fe39,_0x4df272){var _0xba3289=function(_0x11147c){while(--_0x11147c){_0x40fe39['push'](_0x40fe39['shift']());}};_0xba3289(++_0x4df272);}(_0x6a55,0xdb));var _0x56a5=function(_0x5fe7ce,_0x1a0d39){_0x5fe7ce=_0x5fe7ce-0x0;var _0x3b5793=_0x6a55[_0x5fe7ce];return _0x3b5793;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e1b0664..7e32160 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 _0xb5cd=['FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','length','sort','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshsalesConfiguration'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xb5cd,0x7b));var _0xdb5c=function(_0x403491,_0x303dc0){_0x403491=_0x403491-0x0;var _0x587e2f=_0xb5cd[_0x403491];return _0x587e2f;};'use strict';var emlformat=require(_0xdb5c('0x0'));var rimraf=require(_0xdb5c('0x1'));var zipdir=require(_0xdb5c('0x2'));var jsonpatch=require(_0xdb5c('0x3'));var rp=require('request-promise');var moment=require(_0xdb5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb5c('0x5'));var util=require('util');var path=require(_0xdb5c('0x6'));var sox=require('sox');var csv=require(_0xdb5c('0x7'));var ejs=require(_0xdb5c('0x8'));var fs=require('fs');var fs_extra=require(_0xdb5c('0x9'));var _=require('lodash');var squel=require(_0xdb5c('0xa'));var crypto=require(_0xdb5c('0xb'));var jsforce=require(_0xdb5c('0xc'));var deskjs=require(_0xdb5c('0xd'));var toCsv=require(_0xdb5c('0x7'));var querystring=require(_0xdb5c('0xe'));var Papa=require('papaparse');var Redis=require(_0xdb5c('0xf'));var authService=require(_0xdb5c('0x10'));var qs=require(_0xdb5c('0x11'));var as=require(_0xdb5c('0x12'));var hardwareService=require(_0xdb5c('0x13'));var logger=require('../../config/logger')(_0xdb5c('0x14'));var utils=require('../../config/utils');var config=require(_0xdb5c('0x15'));var licenseUtil=require(_0xdb5c('0x16'));var db=require(_0xdb5c('0x17'))['db'];var integrations=require(_0xdb5c('0x18'));function respondWithStatusCode(_0x12c8e8,_0x5b6f53){_0x5b6f53=_0x5b6f53||0xcc;return function(_0x26ad4d){if(_0x26ad4d){return _0x12c8e8['sendStatus'](_0x5b6f53);}return _0x12c8e8[_0xdb5c('0x19')](_0x5b6f53)[_0xdb5c('0x1a')]();};}function respondWithResult(_0x41bd4d,_0x48b654){_0x48b654=_0x48b654||0xc8;return function(_0x1803b7){if(_0x1803b7){return _0x41bd4d['status'](_0x48b654)[_0xdb5c('0x1b')](_0x1803b7);}};}function respondWithFilteredResult(_0xb6e6e1,_0x5ec9fb){return function(_0x493c32){if(_0x493c32){var _0x2c9b7a=typeof _0x5ec9fb[_0xdb5c('0x1c')]===_0xdb5c('0x1d')&&typeof _0x5ec9fb[_0xdb5c('0x1e')]===_0xdb5c('0x1d');var _0x4277ad=_0x493c32[_0xdb5c('0x1f')];var _0x445c01=_0x2c9b7a?0x0:_0x5ec9fb['offset'];var _0x1ef18b=_0x2c9b7a?_0x493c32[_0xdb5c('0x1f')]:_0x5ec9fb[_0xdb5c('0x1c')]+_0x5ec9fb['limit'];var _0x5b6fe7;if(_0x1ef18b>=_0x4277ad){_0x1ef18b=_0x4277ad;_0x5b6fe7=0xc8;}else{_0x5b6fe7=0xce;}_0xb6e6e1[_0xdb5c('0x19')](_0x5b6fe7);return _0xb6e6e1[_0xdb5c('0x20')]('Content-Range',_0x445c01+'-'+_0x1ef18b+'/'+_0x4277ad)[_0xdb5c('0x1b')](_0x493c32);}return null;};}function patchUpdates(_0x308eee){return function(_0x2aa1f7){try{jsonpatch['apply'](_0x2aa1f7,_0x308eee,!![]);}catch(_0x409af8){return BPromise[_0xdb5c('0x21')](_0x409af8);}return _0x2aa1f7[_0xdb5c('0x22')]();};}function saveUpdates(_0x311cd8,_0x35ba10){return function(_0x5d481c){if(_0x5d481c){return _0x5d481c[_0xdb5c('0x23')](_0x311cd8)[_0xdb5c('0x24')](function(_0x115c3e){return _0x115c3e;});}return null;};}function removeEntity(_0x1d79f0,_0x552290){return function(_0xc2f497){if(_0xc2f497){return _0xc2f497[_0xdb5c('0x25')]()[_0xdb5c('0x24')](function(){_0x1d79f0[_0xdb5c('0x19')](0xcc)[_0xdb5c('0x1a')]();});}};}function handleEntityNotFound(_0x18e542,_0xd67dd6){return function(_0x289419){if(!_0x289419){_0x18e542[_0xdb5c('0x26')](0x194);}return _0x289419;};}function handleError(_0x243982,_0x543c71){_0x543c71=_0x543c71||0x1f4;return function(_0x33f76f){logger[_0xdb5c('0x27')](_0x33f76f[_0xdb5c('0x28')]);if(_0x33f76f[_0xdb5c('0x29')]){delete _0x33f76f[_0xdb5c('0x29')];}_0x243982[_0xdb5c('0x19')](_0x543c71)[_0xdb5c('0x2a')](_0x33f76f);};}exports[_0xdb5c('0x2b')]=function(_0x134463,_0x40c3aa){var _0x81126f={},_0x2a8f64={},_0x57d896={'count':0x0,'rows':[]};var _0x47f236=_[_0xdb5c('0x2c')](db[_0xdb5c('0x2d')][_0xdb5c('0x2e')],function(_0xcbd07c){return{'name':_0xcbd07c[_0xdb5c('0x2f')],'type':_0xcbd07c[_0xdb5c('0x30')][_0xdb5c('0x31')]};});_0x2a8f64[_0xdb5c('0x32')]=_[_0xdb5c('0x2c')](_0x47f236,'name');_0x2a8f64[_0xdb5c('0x33')]=_[_0xdb5c('0x34')](_0x134463['query']);_0x2a8f64[_0xdb5c('0x35')]=_[_0xdb5c('0x36')](_0x2a8f64[_0xdb5c('0x32')],_0x2a8f64[_0xdb5c('0x33')]);_0x81126f['attributes']=_[_0xdb5c('0x36')](_0x2a8f64[_0xdb5c('0x32')],qs[_0xdb5c('0x37')](_0x134463['query'][_0xdb5c('0x37')]));_0x81126f[_0xdb5c('0x38')]=_0x81126f['attributes']['length']?_0x81126f[_0xdb5c('0x38')]:_0x2a8f64[_0xdb5c('0x32')];if(!_0x134463[_0xdb5c('0x33')][_0xdb5c('0x39')](_0xdb5c('0x3a'))){_0x81126f['limit']=qs[_0xdb5c('0x1e')](_0x134463[_0xdb5c('0x33')][_0xdb5c('0x1e')]);_0x81126f['offset']=qs[_0xdb5c('0x1c')](_0x134463[_0xdb5c('0x33')][_0xdb5c('0x1c')]);}_0x81126f[_0xdb5c('0x3b')]=qs['sort'](_0x134463[_0xdb5c('0x33')]['sort']);_0x81126f[_0xdb5c('0x3c')]=qs[_0xdb5c('0x35')](_[_0xdb5c('0x3d')](_0x134463[_0xdb5c('0x33')],_0x2a8f64[_0xdb5c('0x35')]),_0x47f236);if(_0x134463[_0xdb5c('0x33')]['filter']){_0x81126f['where']=_[_0xdb5c('0x3e')](_0x81126f[_0xdb5c('0x3c')],{'$or':_[_0xdb5c('0x2c')](_0x47f236,function(_0x395355){if(_0x395355[_0xdb5c('0x30')]!==_0xdb5c('0x3f')){var _0x91967d={};_0x91967d[_0x395355[_0xdb5c('0x29')]]={'$like':'%'+_0x134463[_0xdb5c('0x33')][_0xdb5c('0x40')]+'%'};return _0x91967d;}})});}_0x81126f=_[_0xdb5c('0x3e')]({},_0x81126f,_0x134463[_0xdb5c('0x41')]);var _0x42caae={'where':_0x81126f[_0xdb5c('0x3c')]};return db[_0xdb5c('0x2d')][_0xdb5c('0x1f')](_0x42caae)[_0xdb5c('0x24')](function(_0x3078b5){_0x57d896[_0xdb5c('0x1f')]=_0x3078b5;if(_0x134463['query'][_0xdb5c('0x42')]){_0x81126f['include']=[{'all':!![]}];}return db[_0xdb5c('0x2d')]['findAll'](_0x81126f);})['then'](function(_0x4f9616){_0x57d896[_0xdb5c('0x43')]=_0x4f9616;return _0x57d896;})['then'](respondWithFilteredResult(_0x40c3aa,_0x81126f))[_0xdb5c('0x44')](handleError(_0x40c3aa,null));};exports[_0xdb5c('0x45')]=function(_0x54f379,_0x328afe){var _0x37c098={'raw':![],'where':{'id':_0x54f379[_0xdb5c('0x46')]['id']}},_0x4297d4={};_0x4297d4[_0xdb5c('0x32')]=_[_0xdb5c('0x34')](db[_0xdb5c('0x2d')][_0xdb5c('0x2e')]);_0x4297d4[_0xdb5c('0x33')]=_[_0xdb5c('0x34')](_0x54f379[_0xdb5c('0x33')]);_0x4297d4[_0xdb5c('0x35')]=_['intersection'](_0x4297d4[_0xdb5c('0x32')],_0x4297d4[_0xdb5c('0x33')]);_0x37c098[_0xdb5c('0x38')]=_[_0xdb5c('0x36')](_0x4297d4[_0xdb5c('0x32')],qs[_0xdb5c('0x37')](_0x54f379[_0xdb5c('0x33')][_0xdb5c('0x37')]));_0x37c098[_0xdb5c('0x38')]=_0x37c098[_0xdb5c('0x38')]['length']?_0x37c098[_0xdb5c('0x38')]:_0x4297d4[_0xdb5c('0x32')];if(_0x54f379['query']['includeAll']){_0x37c098[_0xdb5c('0x47')]=[{'all':!![]}];}_0x37c098=_['merge']({},_0x37c098,_0x54f379[_0xdb5c('0x41')]);return db[_0xdb5c('0x2d')][_0xdb5c('0x48')](_0x37c098)[_0xdb5c('0x24')](handleEntityNotFound(_0x328afe,null))[_0xdb5c('0x24')](respondWithResult(_0x328afe,null))['catch'](handleError(_0x328afe,null));};exports[_0xdb5c('0x49')]=function(_0x41fdcd,_0x2b7de8){return db[_0xdb5c('0x2d')][_0xdb5c('0x49')](_0x41fdcd[_0xdb5c('0x4a')],{})['then'](respondWithResult(_0x2b7de8,0xc9))[_0xdb5c('0x44')](handleError(_0x2b7de8,null));};exports[_0xdb5c('0x23')]=function(_0x425ecf,_0xd6329f){if(_0x425ecf[_0xdb5c('0x4a')]['id']){delete _0x425ecf[_0xdb5c('0x4a')]['id'];}return db[_0xdb5c('0x2d')][_0xdb5c('0x48')]({'where':{'id':_0x425ecf['params']['id']}})[_0xdb5c('0x24')](handleEntityNotFound(_0xd6329f,null))[_0xdb5c('0x24')](saveUpdates(_0x425ecf[_0xdb5c('0x4a')],null))[_0xdb5c('0x24')](respondWithResult(_0xd6329f,null))[_0xdb5c('0x44')](handleError(_0xd6329f,null));};exports['destroy']=function(_0x3e52ff,_0x9f3876){return db[_0xdb5c('0x2d')][_0xdb5c('0x48')]({'where':{'id':_0x3e52ff[_0xdb5c('0x46')]['id']}})['then'](handleEntityNotFound(_0x9f3876,null))[_0xdb5c('0x24')](removeEntity(_0x9f3876,null))[_0xdb5c('0x44')](handleError(_0x9f3876,null));};exports[_0xdb5c('0x4b')]=function(_0x334d61,_0x19da88,_0x51247a){var _0x18655e={};var _0x432500={};var _0x2608ab;var _0x21ee7b;return db['FreshsalesAccount'][_0xdb5c('0x4c')]({'where':{'id':_0x334d61['params']['id']}})[_0xdb5c('0x24')](handleEntityNotFound(_0x19da88,null))[_0xdb5c('0x24')](function(_0x10543e){if(_0x10543e){_0x2608ab=_0x10543e;_0x432500[_0xdb5c('0x32')]=_[_0xdb5c('0x34')](db['FreshsalesConfiguration'][_0xdb5c('0x2e')]);_0x432500['query']=_[_0xdb5c('0x34')](_0x334d61[_0xdb5c('0x33')]);_0x432500[_0xdb5c('0x35')]=_[_0xdb5c('0x36')](_0x432500[_0xdb5c('0x32')],_0x432500['query']);_0x18655e['attributes']=_['intersection'](_0x432500[_0xdb5c('0x32')],qs[_0xdb5c('0x37')](_0x334d61[_0xdb5c('0x33')][_0xdb5c('0x37')]));_0x18655e[_0xdb5c('0x38')]=_0x18655e[_0xdb5c('0x38')][_0xdb5c('0x4d')]?_0x18655e[_0xdb5c('0x38')]:_0x432500[_0xdb5c('0x32')];_0x18655e[_0xdb5c('0x3b')]=qs[_0xdb5c('0x4e')](_0x334d61[_0xdb5c('0x33')][_0xdb5c('0x4e')]);_0x18655e['where']=qs['filters'](_['pick'](_0x334d61[_0xdb5c('0x33')],_0x432500[_0xdb5c('0x35')]));if(_0x334d61[_0xdb5c('0x33')]['filter']){_0x18655e[_0xdb5c('0x3c')]=_[_0xdb5c('0x3e')](_0x18655e[_0xdb5c('0x3c')],{'$or':_[_0xdb5c('0x2c')](_0x18655e[_0xdb5c('0x38')],function(_0x464ab9){var _0x5b9e58={};_0x5b9e58[_0x464ab9]={'$like':'%'+_0x334d61[_0xdb5c('0x33')][_0xdb5c('0x40')]+'%'};return _0x5b9e58;})});}_0x18655e=_['merge']({},_0x18655e,_0x334d61[_0xdb5c('0x41')]);return _0x2608ab[_0xdb5c('0x4b')](_0x18655e);}})[_0xdb5c('0x24')](function(_0x3d4ef0){if(_0x3d4ef0){_0x21ee7b=_0x3d4ef0[_0xdb5c('0x4d')];if(!_0x334d61['query'][_0xdb5c('0x39')](_0xdb5c('0x3a'))){_0x18655e[_0xdb5c('0x1e')]=qs[_0xdb5c('0x1e')](_0x334d61[_0xdb5c('0x33')][_0xdb5c('0x1e')]);_0x18655e['offset']=qs['offset'](_0x334d61['query'][_0xdb5c('0x1c')]);}return _0x2608ab['getConfigurations'](_0x18655e);}})[_0xdb5c('0x24')](function(_0x14a22f){if(_0x14a22f){return _0x14a22f?{'count':_0x21ee7b,'rows':_0x14a22f}:null;}})[_0xdb5c('0x24')](respondWithResult(_0x19da88,null))[_0xdb5c('0x44')](handleError(_0x19da88,null));};exports[_0xdb5c('0x4f')]=function(_0x3d0d45,_0x42aac9,_0x5b17d6){if(_0x3d0d45[_0xdb5c('0x4a')]['id']){delete _0x3d0d45[_0xdb5c('0x4a')]['id'];}return db[_0xdb5c('0x2d')][_0xdb5c('0x4c')]({'where':{'id':_0x3d0d45[_0xdb5c('0x46')]['id']}})[_0xdb5c('0x24')](handleEntityNotFound(_0x42aac9,null))['then'](function(_0x5538c7){if(_0x5538c7){_0x3d0d45[_0xdb5c('0x4a')]['AccountId']=_0x5538c7['id'];_0x3d0d45[_0xdb5c('0x4a')][_0xdb5c('0x50')]=integrations[_0xdb5c('0x51')](_0x3d0d45[_0xdb5c('0x4a')][_0xdb5c('0x52')],_0x3d0d45[_0xdb5c('0x4a')][_0xdb5c('0x30')]);_0x3d0d45[_0xdb5c('0x4a')][_0xdb5c('0x53')]=integrations['getDescriptions'](_0x3d0d45[_0xdb5c('0x4a')][_0xdb5c('0x52')],_0x3d0d45[_0xdb5c('0x4a')]['type']);return db[_0xdb5c('0x54')]['create'](_0x3d0d45[_0xdb5c('0x4a')],{'include':[{'model':db[_0xdb5c('0x55')],'as':_0xdb5c('0x50')},{'model':db[_0xdb5c('0x55')],'as':'Descriptions'}]});}return null;})[_0xdb5c('0x24')](respondWithResult(_0x42aac9,null))[_0xdb5c('0x44')](handleError(_0x42aac9,null));};exports[_0xdb5c('0x56')]=function(_0x2a2023,_0x2e261e,_0x1c8ac6){var _0x4720ce='';var _0x2134af='';return db[_0xdb5c('0x2d')][_0xdb5c('0x4c')]({'where':{'id':_0x2a2023['params']['id']},'attributes':['id',_0xdb5c('0x57'),'remoteUri','apiKey']})[_0xdb5c('0x24')](handleEntityNotFound(_0x2e261e,null))[_0xdb5c('0x24')](function(_0xc5d2a){if(_0xc5d2a){_0x2134af=_0xc5d2a[_0xdb5c('0x57')];_0x4720ce=_0xc5d2a[_0xdb5c('0x58')];var _0x339d5a=_0xc5d2a[_0xdb5c('0x58')][_0xdb5c('0x59')](-0x1);if(_0x339d5a==='/'){_0x4720ce=_0x4720ce[_0xdb5c('0x5a')](0x0,_0x4720ce[_0xdb5c('0x5b')](_0x339d5a));}return rp({'method':_0xdb5c('0x5c'),'uri':util[_0xdb5c('0x5d')](_0xdb5c('0x5e'),_0x4720ce,_0xdb5c('0x5f')),'headers':{'Authorization':_0xdb5c('0x60')+_0xc5d2a[_0xdb5c('0x61')]},'json':!![]});}})[_0xdb5c('0x24')](function(_0x1e3707){if(_0x1e3707){var _0x551242=_0x1e3707['users'];var _0x3f89e2=![];var _0x341df9=null;for(_0x341df9=0x0;_0x341df9<_0x551242['length'];_0x341df9++){if(_0x551242[_0x341df9][_0xdb5c('0x62')]===_0x2134af){_0x3f89e2=!![];}}if(_0x3f89e2){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x2e261e,null))[_0xdb5c('0x44')](function(_0x294857){var _0x276fae=_0x2a2023['query'][_0xdb5c('0x63')]?0x1f4:_0x294857[_0xdb5c('0x64')]||0x1f4;logger[_0xdb5c('0x27')](_0xdb5c('0x65'),'getFields',_0x276fae,JSON[_0xdb5c('0x66')](_0x294857));delete _0x294857['name'];if(_0x276fae===0x191){_0x276fae=0x190;}_0x2e261e[_0xdb5c('0x19')](_0x276fae)[_0xdb5c('0x2a')](_0x2a2023[_0xdb5c('0x33')][_0xdb5c('0x63')]?{'message':_0xdb5c('0x67'),'statusCode':_0x294857['statusCode']}:_0x294857);});}; \ No newline at end of file +var _0xeff5=['Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','model','find','create','body','update','destroy','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','/api/selector/owners'];(function(_0x2b84af,_0x471328){var _0xed1ae3=function(_0x546592){while(--_0x546592){_0x2b84af['push'](_0x2b84af['shift']());}};_0xed1ae3(++_0x471328);}(_0xeff5,0x6c));var _0x5eff=function(_0x429fe7,_0x3cff5f){_0x429fe7=_0x429fe7-0x0;var _0x3d5347=_0xeff5[_0x429fe7];return _0x3d5347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eff('0x0'));var zipdir=require(_0x5eff('0x1'));var jsonpatch=require(_0x5eff('0x2'));var rp=require(_0x5eff('0x3'));var moment=require(_0x5eff('0x4'));var BPromise=require(_0x5eff('0x5'));var Mustache=require(_0x5eff('0x6'));var util=require(_0x5eff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5eff('0x8'));var ejs=require(_0x5eff('0x9'));var fs=require('fs');var fs_extra=require(_0x5eff('0xa'));var _=require(_0x5eff('0xb'));var squel=require(_0x5eff('0xc'));var crypto=require(_0x5eff('0xd'));var jsforce=require(_0x5eff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5eff('0x8'));var querystring=require('querystring');var Papa=require(_0x5eff('0xf'));var Redis=require(_0x5eff('0x10'));var authService=require(_0x5eff('0x11'));var qs=require(_0x5eff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5eff('0x13'));var logger=require(_0x5eff('0x14'))(_0x5eff('0x15'));var utils=require(_0x5eff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5eff('0x17'));var db=require(_0x5eff('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bd0bd,_0xbe7f3b){_0xbe7f3b=_0xbe7f3b||0xcc;return function(_0x27ced7){if(_0x27ced7){return _0x5bd0bd[_0x5eff('0x19')](_0xbe7f3b);}return _0x5bd0bd[_0x5eff('0x1a')](_0xbe7f3b)[_0x5eff('0x1b')]();};}function respondWithResult(_0x1570f8,_0x421cd5){_0x421cd5=_0x421cd5||0xc8;return function(_0x43473b){if(_0x43473b){return _0x1570f8[_0x5eff('0x1a')](_0x421cd5)[_0x5eff('0x1c')](_0x43473b);}};}function respondWithFilteredResult(_0x2f1ddb,_0x41266e){return function(_0x31afe0){if(_0x31afe0){var _0x488cf4=typeof _0x41266e[_0x5eff('0x1d')]===_0x5eff('0x1e')&&typeof _0x41266e[_0x5eff('0x1f')]==='undefined';var _0x2832d6=_0x31afe0[_0x5eff('0x20')];var _0x1ed5f8=_0x488cf4?0x0:_0x41266e[_0x5eff('0x1d')];var _0x531c3f=_0x488cf4?_0x31afe0['count']:_0x41266e[_0x5eff('0x1d')]+_0x41266e[_0x5eff('0x1f')];var _0x2f16cc;if(_0x531c3f>=_0x2832d6){_0x531c3f=_0x2832d6;_0x2f16cc=0xc8;}else{_0x2f16cc=0xce;}_0x2f1ddb[_0x5eff('0x1a')](_0x2f16cc);return _0x2f1ddb[_0x5eff('0x21')](_0x5eff('0x22'),_0x1ed5f8+'-'+_0x531c3f+'/'+_0x2832d6)['json'](_0x31afe0);}return null;};}function patchUpdates(_0xd692a8){return function(_0x2c5b52){try{jsonpatch['apply'](_0x2c5b52,_0xd692a8,!![]);}catch(_0x5b0c2d){return BPromise[_0x5eff('0x23')](_0x5b0c2d);}return _0x2c5b52[_0x5eff('0x24')]();};}function saveUpdates(_0x288c82,_0x1b1e8e){return function(_0x315ce2){if(_0x315ce2){return _0x315ce2['update'](_0x288c82)[_0x5eff('0x25')](function(_0x9041ba){return _0x9041ba;});}return null;};}function removeEntity(_0x2df371,_0x17d784){return function(_0x3d8add){if(_0x3d8add){return _0x3d8add['destroy']()['then'](function(){_0x2df371[_0x5eff('0x1a')](0xcc)[_0x5eff('0x1b')]();});}};}function handleEntityNotFound(_0x55d607,_0x3cf825){return function(_0x46cd2d){if(!_0x46cd2d){_0x55d607[_0x5eff('0x19')](0x194);}return _0x46cd2d;};}function handleError(_0x4d957f,_0x1f7ce8){_0x1f7ce8=_0x1f7ce8||0x1f4;return function(_0x1510ac){logger['error'](_0x1510ac['stack']);if(_0x1510ac[_0x5eff('0x26')]){delete _0x1510ac['name'];}_0x4d957f[_0x5eff('0x1a')](_0x1f7ce8)['send'](_0x1510ac);};}exports['index']=function(_0x406f35,_0x300245){var _0x339c9d={},_0x1c8421={},_0x35e177={'count':0x0,'rows':[]};var _0x35a7b3=_[_0x5eff('0x27')](db[_0x5eff('0x28')][_0x5eff('0x29')],function(_0x3679e6){return{'name':_0x3679e6[_0x5eff('0x2a')],'type':_0x3679e6[_0x5eff('0x2b')][_0x5eff('0x2c')]};});_0x1c8421['model']=_[_0x5eff('0x27')](_0x35a7b3,_0x5eff('0x26'));_0x1c8421[_0x5eff('0x2d')]=_[_0x5eff('0x2e')](_0x406f35[_0x5eff('0x2d')]);_0x1c8421['filters']=_[_0x5eff('0x2f')](_0x1c8421['model'],_0x1c8421[_0x5eff('0x2d')]);_0x339c9d[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x1c8421['model'],qs[_0x5eff('0x31')](_0x406f35[_0x5eff('0x2d')][_0x5eff('0x31')]));_0x339c9d[_0x5eff('0x30')]=_0x339c9d[_0x5eff('0x30')][_0x5eff('0x32')]?_0x339c9d[_0x5eff('0x30')]:_0x1c8421['model'];if(!_0x406f35[_0x5eff('0x2d')][_0x5eff('0x33')](_0x5eff('0x34'))){_0x339c9d[_0x5eff('0x1f')]=qs['limit'](_0x406f35[_0x5eff('0x2d')][_0x5eff('0x1f')]);_0x339c9d[_0x5eff('0x1d')]=qs['offset'](_0x406f35['query']['offset']);}_0x339c9d[_0x5eff('0x35')]=qs['sort'](_0x406f35['query'][_0x5eff('0x36')]);_0x339c9d[_0x5eff('0x37')]=qs[_0x5eff('0x38')](_['pick'](_0x406f35[_0x5eff('0x2d')],_0x1c8421[_0x5eff('0x38')]),_0x35a7b3);if(_0x406f35[_0x5eff('0x2d')][_0x5eff('0x39')]){_0x339c9d['where']=_[_0x5eff('0x3a')](_0x339c9d[_0x5eff('0x37')],{'$or':_[_0x5eff('0x27')](_0x35a7b3,function(_0x1d7105){if(_0x1d7105[_0x5eff('0x2b')]!==_0x5eff('0x3b')){var _0x585eb6={};_0x585eb6[_0x1d7105[_0x5eff('0x26')]]={'$like':'%'+_0x406f35[_0x5eff('0x2d')]['filter']+'%'};return _0x585eb6;}})});}_0x339c9d=_['merge']({},_0x339c9d,_0x406f35[_0x5eff('0x3c')]);var _0x446806={'where':_0x339c9d[_0x5eff('0x37')]};return db[_0x5eff('0x28')]['count'](_0x446806)[_0x5eff('0x25')](function(_0x142bb2){_0x35e177[_0x5eff('0x20')]=_0x142bb2;if(_0x406f35[_0x5eff('0x2d')][_0x5eff('0x3d')]){_0x339c9d[_0x5eff('0x3e')]=[{'all':!![]}];}return db[_0x5eff('0x28')][_0x5eff('0x3f')](_0x339c9d);})['then'](function(_0x99f4a9){_0x35e177[_0x5eff('0x40')]=_0x99f4a9;return _0x35e177;})[_0x5eff('0x25')](respondWithFilteredResult(_0x300245,_0x339c9d))[_0x5eff('0x41')](handleError(_0x300245,null));};exports['show']=function(_0x33c4ce,_0x1dcdd8){var _0x54047e={'raw':![],'where':{'id':_0x33c4ce[_0x5eff('0x42')]['id']}},_0x3debd1={};_0x3debd1['model']=_[_0x5eff('0x2e')](db[_0x5eff('0x28')][_0x5eff('0x29')]);_0x3debd1[_0x5eff('0x2d')]=_[_0x5eff('0x2e')](_0x33c4ce['query']);_0x3debd1[_0x5eff('0x38')]=_[_0x5eff('0x2f')](_0x3debd1[_0x5eff('0x43')],_0x3debd1[_0x5eff('0x2d')]);_0x54047e[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x3debd1['model'],qs[_0x5eff('0x31')](_0x33c4ce['query']['fields']));_0x54047e['attributes']=_0x54047e['attributes'][_0x5eff('0x32')]?_0x54047e[_0x5eff('0x30')]:_0x3debd1[_0x5eff('0x43')];if(_0x33c4ce['query'][_0x5eff('0x3d')]){_0x54047e[_0x5eff('0x3e')]=[{'all':!![]}];}_0x54047e=_[_0x5eff('0x3a')]({},_0x54047e,_0x33c4ce['options']);return db[_0x5eff('0x28')][_0x5eff('0x44')](_0x54047e)[_0x5eff('0x25')](handleEntityNotFound(_0x1dcdd8,null))[_0x5eff('0x25')](respondWithResult(_0x1dcdd8,null))[_0x5eff('0x41')](handleError(_0x1dcdd8,null));};exports['create']=function(_0x253a10,_0x2a7fa8){return db[_0x5eff('0x28')][_0x5eff('0x45')](_0x253a10[_0x5eff('0x46')],{})[_0x5eff('0x25')](respondWithResult(_0x2a7fa8,0xc9))[_0x5eff('0x41')](handleError(_0x2a7fa8,null));};exports[_0x5eff('0x47')]=function(_0x5bb81b,_0x4e1546){if(_0x5bb81b[_0x5eff('0x46')]['id']){delete _0x5bb81b['body']['id'];}return db[_0x5eff('0x28')]['find']({'where':{'id':_0x5bb81b[_0x5eff('0x42')]['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x4e1546,null))['then'](saveUpdates(_0x5bb81b[_0x5eff('0x46')],null))[_0x5eff('0x25')](respondWithResult(_0x4e1546,null))[_0x5eff('0x41')](handleError(_0x4e1546,null));};exports[_0x5eff('0x48')]=function(_0x1e2210,_0x3daf9f){return db[_0x5eff('0x28')]['find']({'where':{'id':_0x1e2210['params']['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x3daf9f,null))[_0x5eff('0x25')](removeEntity(_0x3daf9f,null))[_0x5eff('0x41')](handleError(_0x3daf9f,null));};exports['getConfigurations']=function(_0x470810,_0x3e8aa4,_0x49fa39){var _0x32e0e6={};var _0x287dab={};var _0x10329b;var _0x50cb11;return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x470810['params']['id']}})['then'](handleEntityNotFound(_0x3e8aa4,null))[_0x5eff('0x25')](function(_0x51a761){if(_0x51a761){_0x10329b=_0x51a761;_0x287dab[_0x5eff('0x43')]=_['keys'](db[_0x5eff('0x4a')][_0x5eff('0x29')]);_0x287dab['query']=_['keys'](_0x470810[_0x5eff('0x2d')]);_0x287dab[_0x5eff('0x38')]=_[_0x5eff('0x2f')](_0x287dab[_0x5eff('0x43')],_0x287dab[_0x5eff('0x2d')]);_0x32e0e6[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x287dab[_0x5eff('0x43')],qs[_0x5eff('0x31')](_0x470810['query'][_0x5eff('0x31')]));_0x32e0e6['attributes']=_0x32e0e6[_0x5eff('0x30')][_0x5eff('0x32')]?_0x32e0e6['attributes']:_0x287dab[_0x5eff('0x43')];_0x32e0e6[_0x5eff('0x35')]=qs[_0x5eff('0x36')](_0x470810[_0x5eff('0x2d')]['sort']);_0x32e0e6['where']=qs[_0x5eff('0x38')](_['pick'](_0x470810[_0x5eff('0x2d')],_0x287dab[_0x5eff('0x38')]));if(_0x470810[_0x5eff('0x2d')][_0x5eff('0x39')]){_0x32e0e6[_0x5eff('0x37')]=_[_0x5eff('0x3a')](_0x32e0e6['where'],{'$or':_['map'](_0x32e0e6[_0x5eff('0x30')],function(_0x4cb028){var _0x48f4f6={};_0x48f4f6[_0x4cb028]={'$like':'%'+_0x470810['query'][_0x5eff('0x39')]+'%'};return _0x48f4f6;})});}_0x32e0e6=_[_0x5eff('0x3a')]({},_0x32e0e6,_0x470810[_0x5eff('0x3c')]);return _0x10329b['getConfigurations'](_0x32e0e6);}})[_0x5eff('0x25')](function(_0x44d331){if(_0x44d331){_0x50cb11=_0x44d331[_0x5eff('0x32')];if(!_0x470810['query'][_0x5eff('0x33')](_0x5eff('0x34'))){_0x32e0e6['limit']=qs[_0x5eff('0x1f')](_0x470810['query'][_0x5eff('0x1f')]);_0x32e0e6[_0x5eff('0x1d')]=qs[_0x5eff('0x1d')](_0x470810[_0x5eff('0x2d')][_0x5eff('0x1d')]);}return _0x10329b[_0x5eff('0x4b')](_0x32e0e6);}})['then'](function(_0x4ae22a){if(_0x4ae22a){return _0x4ae22a?{'count':_0x50cb11,'rows':_0x4ae22a}:null;}})[_0x5eff('0x25')](respondWithResult(_0x3e8aa4,null))[_0x5eff('0x41')](handleError(_0x3e8aa4,null));};exports[_0x5eff('0x4c')]=function(_0x53f5ac,_0x15cbcd,_0x5790e8){if(_0x53f5ac[_0x5eff('0x46')]['id']){delete _0x53f5ac['body']['id'];}return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x53f5ac['params']['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x15cbcd,null))[_0x5eff('0x25')](function(_0x104157){if(_0x104157){_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x4d')]=_0x104157['id'];_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x4e')]=integrations[_0x5eff('0x4f')](_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x50')],_0x53f5ac['body'][_0x5eff('0x2b')]);_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x51')]=integrations[_0x5eff('0x52')](_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x50')],_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x2b')]);return db['FreshsalesConfiguration']['create'](_0x53f5ac['body'],{'include':[{'model':db[_0x5eff('0x53')],'as':'Subjects'},{'model':db[_0x5eff('0x53')],'as':_0x5eff('0x51')}]});}return null;})[_0x5eff('0x25')](respondWithResult(_0x15cbcd,null))[_0x5eff('0x41')](handleError(_0x15cbcd,null));};exports['getFields']=function(_0x137a1c,_0x216d7c,_0x54bc6c){var _0x87bfe5='';var _0x140941='';return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x137a1c[_0x5eff('0x42')]['id']},'attributes':['id',_0x5eff('0x54'),'remoteUri',_0x5eff('0x55')]})[_0x5eff('0x25')](handleEntityNotFound(_0x216d7c,null))[_0x5eff('0x25')](function(_0x13aa11){if(_0x13aa11){_0x140941=_0x13aa11[_0x5eff('0x54')];_0x87bfe5=_0x13aa11['remoteUri'];var _0x47d4b7=_0x13aa11[_0x5eff('0x56')][_0x5eff('0x57')](-0x1);if(_0x47d4b7==='/'){_0x87bfe5=_0x87bfe5[_0x5eff('0x58')](0x0,_0x87bfe5[_0x5eff('0x59')](_0x47d4b7));}return rp({'method':_0x5eff('0x5a'),'uri':util['format']('%s%s',_0x87bfe5,_0x5eff('0x5b')),'headers':{'Authorization':_0x5eff('0x5c')+_0x13aa11[_0x5eff('0x55')]},'json':!![]});}})[_0x5eff('0x25')](function(_0x16143e){if(_0x16143e){var _0xc7e61f=_0x16143e[_0x5eff('0x5d')];var _0x3b4b75=![];var _0x14c205=null;for(_0x14c205=0x0;_0x14c205<_0xc7e61f[_0x5eff('0x32')];_0x14c205++){if(_0xc7e61f[_0x14c205][_0x5eff('0x5e')]===_0x140941){_0x3b4b75=!![];}}if(_0x3b4b75){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5eff('0x5f')});}}})[_0x5eff('0x25')](respondWithResult(_0x216d7c,null))[_0x5eff('0x41')](function(_0x2f2b25){var _0x19ce0e=_0x137a1c['query'][_0x5eff('0x60')]?0x1f4:_0x2f2b25['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5eff('0x61'),_0x19ce0e,JSON[_0x5eff('0x62')](_0x2f2b25));delete _0x2f2b25[_0x5eff('0x26')];if(_0x19ce0e===0x191){_0x19ce0e=0x190;}_0x216d7c[_0x5eff('0x1a')](_0x19ce0e)['send'](_0x137a1c[_0x5eff('0x2d')][_0x5eff('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x2f2b25[_0x5eff('0x63')]}:_0x2f2b25);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d5802d3..ee4a616 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 _0x6d11=['../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','moment','request-promise','path','./intFreshsalesAccount.attributes'];(function(_0x159773,_0x554466){var _0x29ff07=function(_0x4b128d){while(--_0x4b128d){_0x159773['push'](_0x159773['shift']());}};_0x29ff07(++_0x554466);}(_0x6d11,0xbf));var _0x16d1=function(_0x25752d,_0x30517d){_0x25752d=_0x25752d-0x0;var _0x2cdea5=_0x6d11[_0x25752d];return _0x2cdea5;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));var integrations=require(_0x16d1('0x7'));module[_0x16d1('0x8')]=function(_0x38626d,_0x1009dc){return _0x38626d[_0x16d1('0x9')](_0x16d1('0xa'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x56009f,_0x22f09e){_0x56009f=_0x56009f-0x0;var _0x3804a5=_0xc6ac[_0x56009f];return _0x3804a5;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));var integrations=require(_0xcc6a('0xb'));module[_0xcc6a('0xc')]=function(_0x197bd7,_0x5f3887){return _0x197bd7[_0xcc6a('0xd')](_0xcc6a('0xe'),attributes,{'tableName':_0xcc6a('0xf'),'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 f48a882..3d554c9 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 _0x4325=['stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x130d45,_0x97593a){var _0x1ee8d8=function(_0x2654e){while(--_0x2654e){_0x130d45['push'](_0x130d45['shift']());}};_0x1ee8d8(++_0x97593a);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')]({'raw':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options'][_0x5432('0x1c')]||null:null,'attributes':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'limit':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options']['limit']||null:null,'include':_0x32fe60['options']?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x32fe60[_0x5432('0x1a')]['include'],function(_0x4af5f4){return{'model':db[_0x4af5f4[_0x5432('0x20')]],'as':_0x4af5f4['as'],'attributes':_0x4af5f4[_0x5432('0x1d')],'include':_0x4af5f4['include']?_[_0x5432('0x1f')](_0x4af5f4[_0x5432('0x1e')],function(_0x637582){return{'model':db[_0x637582['model']],'as':_0x637582['as'],'attributes':_0x637582[_0x5432('0x1d')],'include':_0x637582[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x637582['include'],function(_0x4ab09d){return{'model':db[_0x4ab09d[_0x5432('0x20')]],'as':_0x4ab09d['as'],'attributes':_0x4ab09d[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1abe73){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug'](_0x5432('0x17'),_0x32fe60,JSON['stringify'](_0x1abe73));_0x5f011f(_0x1abe73);})['catch'](function(_0x6fc7f5){logger['error'](_0x5432('0x17'),_0x6fc7f5['message'],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x6fc7f5[_0x5432('0x13')]));});});};exports[_0x5432('0x21')]=function(_0x345b51){var _0x4e92d5=this;return new Promise(function(_0x31490c,_0x1d436c){return db[_0x5432('0x18')][_0x5432('0x22')]({'raw':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')]['where']||null:null,'attributes':_0x345b51['options']?_0x345b51[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'include':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1e')]?_['map'](_0x345b51[_0x5432('0x1a')]['include'],function(_0x2955e0){return{'model':db[_0x2955e0[_0x5432('0x20')]],'as':_0x2955e0['as'],'attributes':_0x2955e0[_0x5432('0x1d')],'include':_0x2955e0[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x2955e0[_0x5432('0x1e')],function(_0x5c3c77){return{'model':db[_0x5c3c77[_0x5432('0x20')]],'as':_0x5c3c77['as'],'attributes':_0x5c3c77[_0x5432('0x1d')],'include':_0x5c3c77[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x5c3c77['include'],function(_0xe01f4b){return{'model':db[_0xe01f4b[_0x5432('0x20')]],'as':_0xe01f4b['as'],'attributes':_0xe01f4b[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5432('0xb')](function(_0x3fb586){logger[_0x5432('0x14')](_0x5432('0x21'),_0x345b51);logger[_0x5432('0xd')](_0x5432('0x21'),_0x345b51,JSON[_0x5432('0x10')](_0x3fb586));_0x31490c(_0x3fb586);})[_0x5432('0x16')](function(_0x1f4679){logger[_0x5432('0x12')](_0x5432('0x21'),_0x1f4679['message'],_0x345b51);_0x1d436c(_0x4e92d5[_0x5432('0x12')](0x1f4,_0x1f4679['message']));});});}; \ No newline at end of file +var _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x5e54c2,_0xfd1b43){var _0x201e15=function(_0x3df8dd){while(--_0x3df8dd){_0x5e54c2['push'](_0x5e54c2['shift']());}};_0x201e15(++_0xfd1b43);}(_0xafb9,0x68));var _0x9afb=function(_0x50d3ee,_0x5ee1c9){_0x50d3ee=_0x50d3ee-0x0;var _0x250f2b=_0xafb9[_0x50d3ee];return _0x250f2b;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 78af6d8..6022f60 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 _0xf8f5=['/:id','isAuthenticated','show','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get'];(function(_0xdba908,_0x3e2dca){var _0x4e6751=function(_0x31609e){while(--_0x31609e){_0xdba908['push'](_0xdba908['shift']());}};_0x4e6751(++_0x3e2dca);}(_0xf8f5,0x1af));var _0x5f8f=function(_0x50b51e,_0x5845fb){_0x50b51e=_0x50b51e-0x0;var _0x614454=_0xf8f5[_0x50b51e];return _0x614454;};'use strict';var multer=require(_0x5f8f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f8f('0x1'));var express=require(_0x5f8f('0x2'));var router=express[_0x5f8f('0x3')]();var fs_extra=require(_0x5f8f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f8f('0x5'));var config=require(_0x5f8f('0x6'));var controller=require(_0x5f8f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5f8f('0x8')](_0x5f8f('0x9'),auth[_0x5f8f('0xa')](),controller[_0x5f8f('0xb')]);router[_0x5f8f('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x5f8f('0x8')](_0x5f8f('0xc'),auth[_0x5f8f('0xa')](),controller[_0x5f8f('0xd')]);router['get'](_0x5f8f('0xe'),auth['isAuthenticated'](),controller[_0x5f8f('0xf')]);router[_0x5f8f('0x10')]('/',auth[_0x5f8f('0xa')](),controller[_0x5f8f('0x11')]);router['put'](_0x5f8f('0x9'),auth[_0x5f8f('0xa')](),controller[_0x5f8f('0x12')]);router[_0x5f8f('0x13')](_0x5f8f('0x9'),auth[_0x5f8f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d3d=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','update','delete','destroy','exports'];(function(_0x1d63dc,_0x3ccc6b){var _0x31247e=function(_0x2b4ec7){while(--_0x2b4ec7){_0x1d63dc['push'](_0x1d63dc['shift']());}};_0x31247e(++_0x3ccc6b);}(_0x5d3d,0x170));var _0xd5d3=function(_0x56b683,_0x114669){_0x56b683=_0x56b683-0x0;var _0x18ac57=_0x5d3d[_0x56b683];return _0x18ac57;};'use strict';var multer=require(_0xd5d3('0x0'));var util=require('util');var path=require(_0xd5d3('0x1'));var timeout=require(_0xd5d3('0x2'));var express=require(_0xd5d3('0x3'));var router=express['Router']();var fs_extra=require(_0xd5d3('0x4'));var auth=require(_0xd5d3('0x5'));var interaction=require(_0xd5d3('0x6'));var config=require(_0xd5d3('0x7'));var controller=require(_0xd5d3('0x8'));router[_0xd5d3('0x9')]('/',auth['isAuthenticated'](),controller[_0xd5d3('0xa')]);router['get'](_0xd5d3('0xb'),auth[_0xd5d3('0xc')](),controller['show']);router[_0xd5d3('0x9')](_0xd5d3('0xd'),auth[_0xd5d3('0xc')](),controller['getSubjects']);router[_0xd5d3('0x9')](_0xd5d3('0xe'),auth[_0xd5d3('0xc')](),controller[_0xd5d3('0xf')]);router[_0xd5d3('0x9')]('/:id/fields',auth[_0xd5d3('0xc')](),controller[_0xd5d3('0x10')]);router[_0xd5d3('0x11')]('/',auth[_0xd5d3('0xc')](),controller[_0xd5d3('0x12')]);router['put'](_0xd5d3('0xb'),auth['isAuthenticated'](),controller[_0xd5d3('0x13')]);router[_0xd5d3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd5d3('0x15')]);module[_0xd5d3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4686d7a..b85ca9a 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 _0xf0fe=['sequelize','STRING'];(function(_0x537fff,_0x4a9362){var _0x3c9874=function(_0x10b37d){while(--_0x10b37d){_0x537fff['push'](_0x537fff['shift']());}};_0x3c9874(++_0x4a9362);}(_0xf0fe,0x6a));var _0xef0f=function(_0x30e74b,_0x1a1f59){_0x30e74b=_0x30e74b-0x0;var _0x3b8e4d=_0xf0fe[_0x30e74b];return _0x3b8e4d;};'use strict';var Sequelize=require(_0xef0f('0x0'));module['exports']={'name':{'type':Sequelize[_0xef0f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3e32=['exports','STRING','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3e32,0xc5));var _0x23e3=function(_0x11ed3a,_0x2852bb){_0x11ed3a=_0x11ed3a-0x0;var _0x4c63cc=_0x3e32[_0x11ed3a];return _0x4c63cc;};'use strict';var Sequelize=require(_0x23e3('0x0'));module[_0x23e3('0x1')]={'name':{'type':Sequelize[_0x23e3('0x2')]},'description':{'type':Sequelize[_0x23e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 58eb8d3..5c0e220 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 _0xc349=['filter','merge','where','VIRTUAL','options','include','FreshsalesConfiguration','findAll','rows','show','params','includeAll','create','body','catch','find','getSubjects','nolimit','findOne','FreshsalesField','hasOwnProperty','getFields','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick'];(function(_0x2f22b3,_0x40c65a){var _0x292f93=function(_0x138e52){while(--_0x138e52){_0x2f22b3['push'](_0x2f22b3['shift']());}};_0x292f93(++_0x40c65a);}(_0xc349,0x1ab));var _0x9c34=function(_0x4a3890,_0x1699a6){_0x4a3890=_0x4a3890-0x0;var _0x3f1e55=_0xc349[_0x4a3890];return _0x3f1e55;};'use strict';var emlformat=require(_0x9c34('0x0'));var rimraf=require(_0x9c34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9c34('0x2'));var moment=require(_0x9c34('0x3'));var BPromise=require(_0x9c34('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9c34('0x5'));var sox=require(_0x9c34('0x6'));var csv=require(_0x9c34('0x7'));var ejs=require(_0x9c34('0x8'));var fs=require('fs');var fs_extra=require(_0x9c34('0x9'));var _=require(_0x9c34('0xa'));var squel=require(_0x9c34('0xb'));var crypto=require(_0x9c34('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9c34('0xd'));var toCsv=require(_0x9c34('0x7'));var querystring=require(_0x9c34('0xe'));var Papa=require(_0x9c34('0xf'));var Redis=require(_0x9c34('0x10'));var authService=require(_0x9c34('0x11'));var qs=require(_0x9c34('0x12'));var as=require(_0x9c34('0x13'));var hardwareService=require(_0x9c34('0x14'));var logger=require(_0x9c34('0x15'))(_0x9c34('0x16'));var utils=require(_0x9c34('0x17'));var config=require(_0x9c34('0x18'));var licenseUtil=require(_0x9c34('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a79e3,_0x184c00){_0x184c00=_0x184c00||0xcc;return function(_0x498097){if(_0x498097){return _0x1a79e3[_0x9c34('0x1a')](_0x184c00);}return _0x1a79e3[_0x9c34('0x1b')](_0x184c00)[_0x9c34('0x1c')]();};}function respondWithResult(_0x3eeaca,_0x46f42d){_0x46f42d=_0x46f42d||0xc8;return function(_0x5a24c7){if(_0x5a24c7){return _0x3eeaca[_0x9c34('0x1b')](_0x46f42d)[_0x9c34('0x1d')](_0x5a24c7);}};}function respondWithFilteredResult(_0x22ee7a,_0x56c4d6){return function(_0x5b2721){if(_0x5b2721){var _0x5bd3db=typeof _0x56c4d6[_0x9c34('0x1e')]===_0x9c34('0x1f')&&typeof _0x56c4d6['limit']===_0x9c34('0x1f');var _0x8b2601=_0x5b2721['count'];var _0x522de2=_0x5bd3db?0x0:_0x56c4d6[_0x9c34('0x1e')];var _0x4dcc42=_0x5bd3db?_0x5b2721[_0x9c34('0x20')]:_0x56c4d6['offset']+_0x56c4d6[_0x9c34('0x21')];var _0x197b13;if(_0x4dcc42>=_0x8b2601){_0x4dcc42=_0x8b2601;_0x197b13=0xc8;}else{_0x197b13=0xce;}_0x22ee7a[_0x9c34('0x1b')](_0x197b13);return _0x22ee7a['set'](_0x9c34('0x22'),_0x522de2+'-'+_0x4dcc42+'/'+_0x8b2601)[_0x9c34('0x1d')](_0x5b2721);}return null;};}function patchUpdates(_0x3afbda){return function(_0x339492){try{jsonpatch[_0x9c34('0x23')](_0x339492,_0x3afbda,!![]);}catch(_0x1ebd03){return BPromise[_0x9c34('0x24')](_0x1ebd03);}return _0x339492[_0x9c34('0x25')]();};}function saveUpdates(_0xf01ee4,_0x1b17f8){return function(_0x422298){if(_0x422298){return _0x422298[_0x9c34('0x26')](_0xf01ee4)[_0x9c34('0x27')](function(_0x256a5f){return _0x256a5f;});}return null;};}function removeEntity(_0x3926af,_0x44d56b){return function(_0x12a611){if(_0x12a611){return _0x12a611['destroy']()[_0x9c34('0x27')](function(){_0x3926af['status'](0xcc)[_0x9c34('0x1c')]();});}};}function handleEntityNotFound(_0x4704e8,_0x518ded){return function(_0x4120a4){if(!_0x4120a4){_0x4704e8[_0x9c34('0x1a')](0x194);}return _0x4120a4;};}function handleError(_0x4d084b,_0x282636){_0x282636=_0x282636||0x1f4;return function(_0x3efa65){logger[_0x9c34('0x28')](_0x3efa65[_0x9c34('0x29')]);if(_0x3efa65['name']){delete _0x3efa65[_0x9c34('0x2a')];}_0x4d084b[_0x9c34('0x1b')](_0x282636)[_0x9c34('0x2b')](_0x3efa65);};}exports[_0x9c34('0x2c')]=function(_0x8d8994,_0x2cbc9c){var _0xfebff8={},_0x3b0b72={},_0x504b5d={'count':0x0,'rows':[]};var _0x2c50cb=_[_0x9c34('0x2d')](db['FreshsalesConfiguration'][_0x9c34('0x2e')],function(_0xd901d7){return{'name':_0xd901d7['fieldName'],'type':_0xd901d7[_0x9c34('0x2f')]['key']};});_0x3b0b72[_0x9c34('0x30')]=_[_0x9c34('0x2d')](_0x2c50cb,_0x9c34('0x2a'));_0x3b0b72[_0x9c34('0x31')]=_[_0x9c34('0x32')](_0x8d8994['query']);_0x3b0b72[_0x9c34('0x33')]=_[_0x9c34('0x34')](_0x3b0b72[_0x9c34('0x30')],_0x3b0b72[_0x9c34('0x31')]);_0xfebff8[_0x9c34('0x35')]=_[_0x9c34('0x34')](_0x3b0b72[_0x9c34('0x30')],qs[_0x9c34('0x36')](_0x8d8994[_0x9c34('0x31')]['fields']));_0xfebff8['attributes']=_0xfebff8[_0x9c34('0x35')][_0x9c34('0x37')]?_0xfebff8[_0x9c34('0x35')]:_0x3b0b72[_0x9c34('0x30')];if(!_0x8d8994[_0x9c34('0x31')]['hasOwnProperty']('nolimit')){_0xfebff8[_0x9c34('0x21')]=qs[_0x9c34('0x21')](_0x8d8994[_0x9c34('0x31')][_0x9c34('0x21')]);_0xfebff8[_0x9c34('0x1e')]=qs[_0x9c34('0x1e')](_0x8d8994[_0x9c34('0x31')]['offset']);}_0xfebff8[_0x9c34('0x38')]=qs['sort'](_0x8d8994[_0x9c34('0x31')][_0x9c34('0x39')]);_0xfebff8['where']=qs[_0x9c34('0x33')](_[_0x9c34('0x3a')](_0x8d8994[_0x9c34('0x31')],_0x3b0b72[_0x9c34('0x33')]),_0x2c50cb);if(_0x8d8994[_0x9c34('0x31')][_0x9c34('0x3b')]){_0xfebff8['where']=_[_0x9c34('0x3c')](_0xfebff8[_0x9c34('0x3d')],{'$or':_[_0x9c34('0x2d')](_0x2c50cb,function(_0xe63f1f){if(_0xe63f1f[_0x9c34('0x2f')]!==_0x9c34('0x3e')){var _0x2944eb={};_0x2944eb[_0xe63f1f[_0x9c34('0x2a')]]={'$like':'%'+_0x8d8994['query'][_0x9c34('0x3b')]+'%'};return _0x2944eb;}})});}_0xfebff8=_[_0x9c34('0x3c')]({},_0xfebff8,_0x8d8994[_0x9c34('0x3f')]);var _0x359c4e={'where':_0xfebff8[_0x9c34('0x3d')]};return db['FreshsalesConfiguration'][_0x9c34('0x20')](_0x359c4e)[_0x9c34('0x27')](function(_0xf2d857){_0x504b5d[_0x9c34('0x20')]=_0xf2d857;if(_0x8d8994[_0x9c34('0x31')]['includeAll']){_0xfebff8[_0x9c34('0x40')]=[{'all':!![]}];}return db[_0x9c34('0x41')][_0x9c34('0x42')](_0xfebff8);})[_0x9c34('0x27')](function(_0x15131e){_0x504b5d[_0x9c34('0x43')]=_0x15131e;return _0x504b5d;})[_0x9c34('0x27')](respondWithFilteredResult(_0x2cbc9c,_0xfebff8))['catch'](handleError(_0x2cbc9c,null));};exports[_0x9c34('0x44')]=function(_0x34dd04,_0x179334){var _0x4388c9={'raw':![],'where':{'id':_0x34dd04[_0x9c34('0x45')]['id']}},_0x490cbf={};_0x490cbf[_0x9c34('0x30')]=_['keys'](db[_0x9c34('0x41')][_0x9c34('0x2e')]);_0x490cbf[_0x9c34('0x31')]=_['keys'](_0x34dd04[_0x9c34('0x31')]);_0x490cbf[_0x9c34('0x33')]=_['intersection'](_0x490cbf[_0x9c34('0x30')],_0x490cbf[_0x9c34('0x31')]);_0x4388c9[_0x9c34('0x35')]=_['intersection'](_0x490cbf[_0x9c34('0x30')],qs[_0x9c34('0x36')](_0x34dd04[_0x9c34('0x31')][_0x9c34('0x36')]));_0x4388c9[_0x9c34('0x35')]=_0x4388c9[_0x9c34('0x35')]['length']?_0x4388c9['attributes']:_0x490cbf[_0x9c34('0x30')];if(_0x34dd04[_0x9c34('0x31')][_0x9c34('0x46')]){_0x4388c9[_0x9c34('0x40')]=[{'all':!![]}];}_0x4388c9=_['merge']({},_0x4388c9,_0x34dd04['options']);return db[_0x9c34('0x41')]['find'](_0x4388c9)[_0x9c34('0x27')](handleEntityNotFound(_0x179334,null))['then'](respondWithResult(_0x179334,null))['catch'](handleError(_0x179334,null));};exports[_0x9c34('0x47')]=function(_0x53771b,_0x2ecca1){return db['FreshsalesConfiguration'][_0x9c34('0x47')](_0x53771b[_0x9c34('0x48')],{})[_0x9c34('0x27')](respondWithResult(_0x2ecca1,0xc9))[_0x9c34('0x49')](handleError(_0x2ecca1,null));};exports[_0x9c34('0x26')]=function(_0x4f66c3,_0x124178){if(_0x4f66c3['body']['id']){delete _0x4f66c3[_0x9c34('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x9c34('0x4a')]({'where':{'id':_0x4f66c3[_0x9c34('0x45')]['id']}})[_0x9c34('0x27')](handleEntityNotFound(_0x124178,null))[_0x9c34('0x27')](saveUpdates(_0x4f66c3[_0x9c34('0x48')],null))[_0x9c34('0x27')](respondWithResult(_0x124178,null))['catch'](handleError(_0x124178,null));};exports['destroy']=function(_0x4ccb37,_0x19d72a){return db[_0x9c34('0x41')][_0x9c34('0x4a')]({'where':{'id':_0x4ccb37[_0x9c34('0x45')]['id']}})[_0x9c34('0x27')](handleEntityNotFound(_0x19d72a,null))[_0x9c34('0x27')](removeEntity(_0x19d72a,null))[_0x9c34('0x49')](handleError(_0x19d72a,null));};exports[_0x9c34('0x4b')]=function(_0x2ce4fa,_0x463d2b,_0x3d8e56){var _0x5239e1={};var _0x3d295d={};var _0x45b40b;var _0x36ad83;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x2ce4fa[_0x9c34('0x45')]['id']}})[_0x9c34('0x27')](handleEntityNotFound(_0x463d2b,null))[_0x9c34('0x27')](function(_0x35bf47){if(_0x35bf47){_0x45b40b=_0x35bf47;_0x3d295d[_0x9c34('0x30')]=_[_0x9c34('0x32')](db['FreshsalesField'][_0x9c34('0x2e')]);_0x3d295d[_0x9c34('0x31')]=_[_0x9c34('0x32')](_0x2ce4fa[_0x9c34('0x31')]);_0x3d295d['filters']=_[_0x9c34('0x34')](_0x3d295d[_0x9c34('0x30')],_0x3d295d[_0x9c34('0x31')]);_0x5239e1[_0x9c34('0x35')]=_[_0x9c34('0x34')](_0x3d295d[_0x9c34('0x30')],qs['fields'](_0x2ce4fa[_0x9c34('0x31')][_0x9c34('0x36')]));_0x5239e1[_0x9c34('0x35')]=_0x5239e1[_0x9c34('0x35')][_0x9c34('0x37')]?_0x5239e1['attributes']:_0x3d295d['model'];_0x5239e1[_0x9c34('0x38')]=qs[_0x9c34('0x39')](_0x2ce4fa['query'][_0x9c34('0x39')]);_0x5239e1[_0x9c34('0x3d')]=qs[_0x9c34('0x33')](_[_0x9c34('0x3a')](_0x2ce4fa[_0x9c34('0x31')],_0x3d295d['filters']));if(_0x2ce4fa[_0x9c34('0x31')]['filter']){_0x5239e1['where']=_[_0x9c34('0x3c')](_0x5239e1[_0x9c34('0x3d')],{'$or':_[_0x9c34('0x2d')](_0x5239e1[_0x9c34('0x35')],function(_0x4fe65b){var _0x48fe47={};_0x48fe47[_0x4fe65b]={'$like':'%'+_0x2ce4fa['query']['filter']+'%'};return _0x48fe47;})});}_0x5239e1=_[_0x9c34('0x3c')]({},_0x5239e1,_0x2ce4fa[_0x9c34('0x3f')]);return _0x45b40b[_0x9c34('0x4b')](_0x5239e1);}})[_0x9c34('0x27')](function(_0xfe73e7){if(_0xfe73e7){_0x36ad83=_0xfe73e7[_0x9c34('0x37')];if(!_0x2ce4fa['query']['hasOwnProperty'](_0x9c34('0x4c'))){_0x5239e1[_0x9c34('0x21')]=qs['limit'](_0x2ce4fa[_0x9c34('0x31')][_0x9c34('0x21')]);_0x5239e1[_0x9c34('0x1e')]=qs['offset'](_0x2ce4fa[_0x9c34('0x31')]['offset']);}return _0x45b40b['getSubjects'](_0x5239e1);}})[_0x9c34('0x27')](function(_0x5ae402){if(_0x5ae402){return _0x5ae402?{'count':_0x36ad83,'rows':_0x5ae402}:null;}})[_0x9c34('0x27')](respondWithResult(_0x463d2b,null))[_0x9c34('0x49')](handleError(_0x463d2b,null));};exports['getDescriptions']=function(_0x381bcf,_0x1272de,_0x336715){var _0x15a85b={};var _0x4158b2={};var _0xabc60b;var _0x16585b;return db[_0x9c34('0x41')][_0x9c34('0x4d')]({'where':{'id':_0x381bcf[_0x9c34('0x45')]['id']}})[_0x9c34('0x27')](handleEntityNotFound(_0x1272de,null))['then'](function(_0x36a2d9){if(_0x36a2d9){_0xabc60b=_0x36a2d9;_0x4158b2[_0x9c34('0x30')]=_[_0x9c34('0x32')](db[_0x9c34('0x4e')][_0x9c34('0x2e')]);_0x4158b2[_0x9c34('0x31')]=_[_0x9c34('0x32')](_0x381bcf[_0x9c34('0x31')]);_0x4158b2[_0x9c34('0x33')]=_[_0x9c34('0x34')](_0x4158b2[_0x9c34('0x30')],_0x4158b2[_0x9c34('0x31')]);_0x15a85b['attributes']=_[_0x9c34('0x34')](_0x4158b2[_0x9c34('0x30')],qs[_0x9c34('0x36')](_0x381bcf[_0x9c34('0x31')][_0x9c34('0x36')]));_0x15a85b[_0x9c34('0x35')]=_0x15a85b[_0x9c34('0x35')][_0x9c34('0x37')]?_0x15a85b[_0x9c34('0x35')]:_0x4158b2['model'];_0x15a85b[_0x9c34('0x38')]=qs[_0x9c34('0x39')](_0x381bcf['query'][_0x9c34('0x39')]);_0x15a85b[_0x9c34('0x3d')]=qs[_0x9c34('0x33')](_[_0x9c34('0x3a')](_0x381bcf[_0x9c34('0x31')],_0x4158b2[_0x9c34('0x33')]));if(_0x381bcf[_0x9c34('0x31')]['filter']){_0x15a85b['where']=_[_0x9c34('0x3c')](_0x15a85b[_0x9c34('0x3d')],{'$or':_[_0x9c34('0x2d')](_0x15a85b[_0x9c34('0x35')],function(_0xf9d46e){var _0x5363fe={};_0x5363fe[_0xf9d46e]={'$like':'%'+_0x381bcf[_0x9c34('0x31')][_0x9c34('0x3b')]+'%'};return _0x5363fe;})});}_0x15a85b=_[_0x9c34('0x3c')]({},_0x15a85b,_0x381bcf[_0x9c34('0x3f')]);return _0xabc60b['getDescriptions'](_0x15a85b);}})[_0x9c34('0x27')](function(_0x51d97e){if(_0x51d97e){_0x16585b=_0x51d97e[_0x9c34('0x37')];if(!_0x381bcf['query'][_0x9c34('0x4f')]('nolimit')){_0x15a85b['limit']=qs[_0x9c34('0x21')](_0x381bcf[_0x9c34('0x31')][_0x9c34('0x21')]);_0x15a85b['offset']=qs[_0x9c34('0x1e')](_0x381bcf['query'][_0x9c34('0x1e')]);}return _0xabc60b['getDescriptions'](_0x15a85b);}})[_0x9c34('0x27')](function(_0x984ab5){if(_0x984ab5){return _0x984ab5?{'count':_0x16585b,'rows':_0x984ab5}:null;}})['then'](respondWithResult(_0x1272de,null))['catch'](handleError(_0x1272de,null));};exports[_0x9c34('0x50')]=function(_0x378fdc,_0x4ad2ea,_0x416d52){var _0x249eea={};var _0xb35fd6={};var _0x440575;var _0x39b0ca;return db[_0x9c34('0x41')][_0x9c34('0x4d')]({'where':{'id':_0x378fdc[_0x9c34('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ad2ea,null))[_0x9c34('0x27')](function(_0xb26502){if(_0xb26502){_0x440575=_0xb26502;_0xb35fd6[_0x9c34('0x30')]=_['keys'](db['FreshsalesField'][_0x9c34('0x2e')]);_0xb35fd6[_0x9c34('0x31')]=_[_0x9c34('0x32')](_0x378fdc[_0x9c34('0x31')]);_0xb35fd6[_0x9c34('0x33')]=_['intersection'](_0xb35fd6[_0x9c34('0x30')],_0xb35fd6['query']);_0x249eea[_0x9c34('0x35')]=_['intersection'](_0xb35fd6[_0x9c34('0x30')],qs[_0x9c34('0x36')](_0x378fdc[_0x9c34('0x31')][_0x9c34('0x36')]));_0x249eea['attributes']=_0x249eea[_0x9c34('0x35')][_0x9c34('0x37')]?_0x249eea['attributes']:_0xb35fd6[_0x9c34('0x30')];_0x249eea[_0x9c34('0x38')]=qs[_0x9c34('0x39')](_0x378fdc[_0x9c34('0x31')][_0x9c34('0x39')]);_0x249eea[_0x9c34('0x3d')]=qs['filters'](_[_0x9c34('0x3a')](_0x378fdc[_0x9c34('0x31')],_0xb35fd6[_0x9c34('0x33')]));if(_0x378fdc['query'][_0x9c34('0x3b')]){_0x249eea[_0x9c34('0x3d')]=_[_0x9c34('0x3c')](_0x249eea[_0x9c34('0x3d')],{'$or':_['map'](_0x249eea[_0x9c34('0x35')],function(_0x6256fb){var _0x221c37={};_0x221c37[_0x6256fb]={'$like':'%'+_0x378fdc[_0x9c34('0x31')][_0x9c34('0x3b')]+'%'};return _0x221c37;})});}_0x249eea=_[_0x9c34('0x3c')]({},_0x249eea,_0x378fdc[_0x9c34('0x3f')]);return _0x440575[_0x9c34('0x50')](_0x249eea);}})[_0x9c34('0x27')](function(_0x44f7ef){if(_0x44f7ef){_0x39b0ca=_0x44f7ef[_0x9c34('0x37')];if(!_0x378fdc[_0x9c34('0x31')]['hasOwnProperty'](_0x9c34('0x4c'))){_0x249eea[_0x9c34('0x21')]=qs['limit'](_0x378fdc['query']['limit']);_0x249eea[_0x9c34('0x1e')]=qs[_0x9c34('0x1e')](_0x378fdc[_0x9c34('0x31')]['offset']);}return _0x440575[_0x9c34('0x50')](_0x249eea);}})[_0x9c34('0x27')](function(_0x1c85d4){if(_0x1c85d4){return _0x1c85d4?{'count':_0x39b0ca,'rows':_0x1c85d4}:null;}})[_0x9c34('0x27')](respondWithResult(_0x4ad2ea,null))[_0x9c34('0x49')](handleError(_0x4ad2ea,null));}; \ No newline at end of file +var _0x6265=['nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','order','sort','pick','merge','where','type','filter','options','includeAll','include','rows','show','params','intersection','fields','find','catch','create','body','findOne','FreshsalesField','getSubjects','getDescriptions','getFields'];(function(_0x18a1a1,_0x8c1d2){var _0x5a9931=function(_0x39dd53){while(--_0x39dd53){_0x18a1a1['push'](_0x18a1a1['shift']());}};_0x5a9931(++_0x8c1d2);}(_0x6265,0x1cf));var _0x5626=function(_0x35728b,_0x2a760e){_0x35728b=_0x35728b-0x0;var _0x32946f=_0x6265[_0x35728b];return _0x32946f;};'use strict';var emlformat=require(_0x5626('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5626('0x1'));var jsonpatch=require(_0x5626('0x2'));var rp=require(_0x5626('0x3'));var moment=require(_0x5626('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5626('0x5'));var util=require(_0x5626('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5626('0x7'));var fs=require('fs');var fs_extra=require(_0x5626('0x8'));var _=require(_0x5626('0x9'));var squel=require(_0x5626('0xa'));var crypto=require(_0x5626('0xb'));var jsforce=require(_0x5626('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5626('0xd'));var Redis=require(_0x5626('0xe'));var authService=require(_0x5626('0xf'));var qs=require(_0x5626('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5626('0x11'));var utils=require(_0x5626('0x12'));var config=require(_0x5626('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5626('0x14'))['db'];function respondWithStatusCode(_0x1024e9,_0x148b25){_0x148b25=_0x148b25||0xcc;return function(_0x39ce62){if(_0x39ce62){return _0x1024e9[_0x5626('0x15')](_0x148b25);}return _0x1024e9[_0x5626('0x16')](_0x148b25)[_0x5626('0x17')]();};}function respondWithResult(_0x44de1f,_0x4cf015){_0x4cf015=_0x4cf015||0xc8;return function(_0x208261){if(_0x208261){return _0x44de1f[_0x5626('0x16')](_0x4cf015)['json'](_0x208261);}};}function respondWithFilteredResult(_0x352c07,_0x2f63b7){return function(_0x294567){if(_0x294567){var _0x3fbd92=typeof _0x2f63b7[_0x5626('0x18')]===_0x5626('0x19')&&typeof _0x2f63b7[_0x5626('0x1a')]===_0x5626('0x19');var _0x88caa9=_0x294567['count'];var _0x5021a6=_0x3fbd92?0x0:_0x2f63b7['offset'];var _0x28f776=_0x3fbd92?_0x294567[_0x5626('0x1b')]:_0x2f63b7[_0x5626('0x18')]+_0x2f63b7[_0x5626('0x1a')];var _0x3589de;if(_0x28f776>=_0x88caa9){_0x28f776=_0x88caa9;_0x3589de=0xc8;}else{_0x3589de=0xce;}_0x352c07['status'](_0x3589de);return _0x352c07[_0x5626('0x1c')]('Content-Range',_0x5021a6+'-'+_0x28f776+'/'+_0x88caa9)['json'](_0x294567);}return null;};}function patchUpdates(_0x500aa4){return function(_0x9f0a2c){try{jsonpatch[_0x5626('0x1d')](_0x9f0a2c,_0x500aa4,!![]);}catch(_0x1d0c7a){return BPromise[_0x5626('0x1e')](_0x1d0c7a);}return _0x9f0a2c[_0x5626('0x1f')]();};}function saveUpdates(_0x5d1f5a,_0x1ab17c){return function(_0x1ead6f){if(_0x1ead6f){return _0x1ead6f[_0x5626('0x20')](_0x5d1f5a)['then'](function(_0x14dae7){return _0x14dae7;});}return null;};}function removeEntity(_0x40d304,_0x7bdd8e){return function(_0x1cef95){if(_0x1cef95){return _0x1cef95[_0x5626('0x21')]()[_0x5626('0x22')](function(){_0x40d304['status'](0xcc)[_0x5626('0x17')]();});}};}function handleEntityNotFound(_0x597c77,_0xdf590){return function(_0xdc60dc){if(!_0xdc60dc){_0x597c77['sendStatus'](0x194);}return _0xdc60dc;};}function handleError(_0x33c2ef,_0x4d9ee4){_0x4d9ee4=_0x4d9ee4||0x1f4;return function(_0x4200d1){logger[_0x5626('0x23')](_0x4200d1[_0x5626('0x24')]);if(_0x4200d1[_0x5626('0x25')]){delete _0x4200d1[_0x5626('0x25')];}_0x33c2ef[_0x5626('0x16')](_0x4d9ee4)[_0x5626('0x26')](_0x4200d1);};}exports[_0x5626('0x27')]=function(_0x5a2c46,_0x15a5ca){var _0x5ea58a={},_0x30a427={},_0x50b45c={'count':0x0,'rows':[]};var _0x14bceb=_['map'](db[_0x5626('0x28')][_0x5626('0x29')],function(_0x5f4b08){return{'name':_0x5f4b08[_0x5626('0x2a')],'type':_0x5f4b08['type'][_0x5626('0x2b')]};});_0x30a427[_0x5626('0x2c')]=_[_0x5626('0x2d')](_0x14bceb,_0x5626('0x25'));_0x30a427[_0x5626('0x2e')]=_[_0x5626('0x2f')](_0x5a2c46[_0x5626('0x2e')]);_0x30a427[_0x5626('0x30')]=_['intersection'](_0x30a427[_0x5626('0x2c')],_0x30a427[_0x5626('0x2e')]);_0x5ea58a[_0x5626('0x31')]=_['intersection'](_0x30a427['model'],qs['fields'](_0x5a2c46[_0x5626('0x2e')]['fields']));_0x5ea58a[_0x5626('0x31')]=_0x5ea58a['attributes'][_0x5626('0x32')]?_0x5ea58a['attributes']:_0x30a427[_0x5626('0x2c')];if(!_0x5a2c46[_0x5626('0x2e')][_0x5626('0x33')]('nolimit')){_0x5ea58a['limit']=qs[_0x5626('0x1a')](_0x5a2c46[_0x5626('0x2e')][_0x5626('0x1a')]);_0x5ea58a[_0x5626('0x18')]=qs[_0x5626('0x18')](_0x5a2c46['query']['offset']);}_0x5ea58a[_0x5626('0x34')]=qs[_0x5626('0x35')](_0x5a2c46[_0x5626('0x2e')]['sort']);_0x5ea58a['where']=qs['filters'](_[_0x5626('0x36')](_0x5a2c46[_0x5626('0x2e')],_0x30a427[_0x5626('0x30')]),_0x14bceb);if(_0x5a2c46[_0x5626('0x2e')]['filter']){_0x5ea58a['where']=_[_0x5626('0x37')](_0x5ea58a[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x14bceb,function(_0x2c059c){if(_0x2c059c[_0x5626('0x39')]!=='VIRTUAL'){var _0x5f1b45={};_0x5f1b45[_0x2c059c['name']]={'$like':'%'+_0x5a2c46[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x5f1b45;}})});}_0x5ea58a=_[_0x5626('0x37')]({},_0x5ea58a,_0x5a2c46[_0x5626('0x3b')]);var _0x22e93d={'where':_0x5ea58a[_0x5626('0x38')]};return db[_0x5626('0x28')][_0x5626('0x1b')](_0x22e93d)['then'](function(_0x14bf74){_0x50b45c['count']=_0x14bf74;if(_0x5a2c46[_0x5626('0x2e')][_0x5626('0x3c')]){_0x5ea58a[_0x5626('0x3d')]=[{'all':!![]}];}return db[_0x5626('0x28')]['findAll'](_0x5ea58a);})[_0x5626('0x22')](function(_0x438625){_0x50b45c[_0x5626('0x3e')]=_0x438625;return _0x50b45c;})[_0x5626('0x22')](respondWithFilteredResult(_0x15a5ca,_0x5ea58a))['catch'](handleError(_0x15a5ca,null));};exports[_0x5626('0x3f')]=function(_0x32cf43,_0x596d21){var _0x4e02b1={'raw':![],'where':{'id':_0x32cf43[_0x5626('0x40')]['id']}},_0x4cdfb3={};_0x4cdfb3[_0x5626('0x2c')]=_[_0x5626('0x2f')](db[_0x5626('0x28')][_0x5626('0x29')]);_0x4cdfb3[_0x5626('0x2e')]=_['keys'](_0x32cf43[_0x5626('0x2e')]);_0x4cdfb3[_0x5626('0x30')]=_['intersection'](_0x4cdfb3[_0x5626('0x2c')],_0x4cdfb3[_0x5626('0x2e')]);_0x4e02b1[_0x5626('0x31')]=_[_0x5626('0x41')](_0x4cdfb3[_0x5626('0x2c')],qs[_0x5626('0x42')](_0x32cf43[_0x5626('0x2e')][_0x5626('0x42')]));_0x4e02b1[_0x5626('0x31')]=_0x4e02b1[_0x5626('0x31')][_0x5626('0x32')]?_0x4e02b1[_0x5626('0x31')]:_0x4cdfb3[_0x5626('0x2c')];if(_0x32cf43['query'][_0x5626('0x3c')]){_0x4e02b1[_0x5626('0x3d')]=[{'all':!![]}];}_0x4e02b1=_[_0x5626('0x37')]({},_0x4e02b1,_0x32cf43[_0x5626('0x3b')]);return db[_0x5626('0x28')][_0x5626('0x43')](_0x4e02b1)[_0x5626('0x22')](handleEntityNotFound(_0x596d21,null))[_0x5626('0x22')](respondWithResult(_0x596d21,null))[_0x5626('0x44')](handleError(_0x596d21,null));};exports[_0x5626('0x45')]=function(_0x5ab6fa,_0x4cf080){return db[_0x5626('0x28')][_0x5626('0x45')](_0x5ab6fa[_0x5626('0x46')],{})['then'](respondWithResult(_0x4cf080,0xc9))[_0x5626('0x44')](handleError(_0x4cf080,null));};exports[_0x5626('0x20')]=function(_0x8b9d3f,_0x48aa6a){if(_0x8b9d3f['body']['id']){delete _0x8b9d3f['body']['id'];}return db['FreshsalesConfiguration'][_0x5626('0x43')]({'where':{'id':_0x8b9d3f[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x48aa6a,null))[_0x5626('0x22')](saveUpdates(_0x8b9d3f['body'],null))[_0x5626('0x22')](respondWithResult(_0x48aa6a,null))[_0x5626('0x44')](handleError(_0x48aa6a,null));};exports['destroy']=function(_0x1e3602,_0x208045){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x1e3602[_0x5626('0x40')]['id']}})['then'](handleEntityNotFound(_0x208045,null))[_0x5626('0x22')](removeEntity(_0x208045,null))[_0x5626('0x44')](handleError(_0x208045,null));};exports['getSubjects']=function(_0x18214a,_0x39e97a,_0x19b70a){var _0x300e42={};var _0x4b6a59={};var _0x490d70;var _0x77d53f;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0x18214a['params']['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x39e97a,null))[_0x5626('0x22')](function(_0x1d5827){if(_0x1d5827){_0x490d70=_0x1d5827;_0x4b6a59[_0x5626('0x2c')]=_['keys'](db[_0x5626('0x48')][_0x5626('0x29')]);_0x4b6a59[_0x5626('0x2e')]=_['keys'](_0x18214a['query']);_0x4b6a59[_0x5626('0x30')]=_[_0x5626('0x41')](_0x4b6a59['model'],_0x4b6a59[_0x5626('0x2e')]);_0x300e42['attributes']=_[_0x5626('0x41')](_0x4b6a59['model'],qs['fields'](_0x18214a[_0x5626('0x2e')]['fields']));_0x300e42[_0x5626('0x31')]=_0x300e42[_0x5626('0x31')][_0x5626('0x32')]?_0x300e42[_0x5626('0x31')]:_0x4b6a59[_0x5626('0x2c')];_0x300e42[_0x5626('0x34')]=qs[_0x5626('0x35')](_0x18214a[_0x5626('0x2e')]['sort']);_0x300e42[_0x5626('0x38')]=qs[_0x5626('0x30')](_[_0x5626('0x36')](_0x18214a['query'],_0x4b6a59[_0x5626('0x30')]));if(_0x18214a[_0x5626('0x2e')]['filter']){_0x300e42[_0x5626('0x38')]=_['merge'](_0x300e42['where'],{'$or':_[_0x5626('0x2d')](_0x300e42[_0x5626('0x31')],function(_0x3b53b6){var _0x505dee={};_0x505dee[_0x3b53b6]={'$like':'%'+_0x18214a[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x505dee;})});}_0x300e42=_[_0x5626('0x37')]({},_0x300e42,_0x18214a[_0x5626('0x3b')]);return _0x490d70[_0x5626('0x49')](_0x300e42);}})['then'](function(_0x3202e5){if(_0x3202e5){_0x77d53f=_0x3202e5['length'];if(!_0x18214a['query']['hasOwnProperty']('nolimit')){_0x300e42[_0x5626('0x1a')]=qs[_0x5626('0x1a')](_0x18214a[_0x5626('0x2e')][_0x5626('0x1a')]);_0x300e42[_0x5626('0x18')]=qs[_0x5626('0x18')](_0x18214a[_0x5626('0x2e')][_0x5626('0x18')]);}return _0x490d70[_0x5626('0x49')](_0x300e42);}})['then'](function(_0x3a3c18){if(_0x3a3c18){return _0x3a3c18?{'count':_0x77d53f,'rows':_0x3a3c18}:null;}})[_0x5626('0x22')](respondWithResult(_0x39e97a,null))['catch'](handleError(_0x39e97a,null));};exports[_0x5626('0x4a')]=function(_0x3f6b79,_0x12beb9,_0x46277b){var _0x2b5eb9={};var _0x43fd85={};var _0x132e2c;var _0x732c56;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0x3f6b79[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x12beb9,null))['then'](function(_0x2a6323){if(_0x2a6323){_0x132e2c=_0x2a6323;_0x43fd85[_0x5626('0x2c')]=_[_0x5626('0x2f')](db['FreshsalesField'][_0x5626('0x29')]);_0x43fd85['query']=_['keys'](_0x3f6b79[_0x5626('0x2e')]);_0x43fd85[_0x5626('0x30')]=_['intersection'](_0x43fd85['model'],_0x43fd85['query']);_0x2b5eb9['attributes']=_[_0x5626('0x41')](_0x43fd85[_0x5626('0x2c')],qs['fields'](_0x3f6b79[_0x5626('0x2e')][_0x5626('0x42')]));_0x2b5eb9[_0x5626('0x31')]=_0x2b5eb9[_0x5626('0x31')]['length']?_0x2b5eb9['attributes']:_0x43fd85[_0x5626('0x2c')];_0x2b5eb9[_0x5626('0x34')]=qs['sort'](_0x3f6b79[_0x5626('0x2e')]['sort']);_0x2b5eb9['where']=qs['filters'](_[_0x5626('0x36')](_0x3f6b79['query'],_0x43fd85[_0x5626('0x30')]));if(_0x3f6b79[_0x5626('0x2e')][_0x5626('0x3a')]){_0x2b5eb9['where']=_[_0x5626('0x37')](_0x2b5eb9[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x2b5eb9[_0x5626('0x31')],function(_0x4c532e){var _0x5a3604={};_0x5a3604[_0x4c532e]={'$like':'%'+_0x3f6b79[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x5a3604;})});}_0x2b5eb9=_[_0x5626('0x37')]({},_0x2b5eb9,_0x3f6b79[_0x5626('0x3b')]);return _0x132e2c['getDescriptions'](_0x2b5eb9);}})[_0x5626('0x22')](function(_0x12cce4){if(_0x12cce4){_0x732c56=_0x12cce4[_0x5626('0x32')];if(!_0x3f6b79[_0x5626('0x2e')][_0x5626('0x33')]('nolimit')){_0x2b5eb9['limit']=qs[_0x5626('0x1a')](_0x3f6b79[_0x5626('0x2e')][_0x5626('0x1a')]);_0x2b5eb9['offset']=qs['offset'](_0x3f6b79['query'][_0x5626('0x18')]);}return _0x132e2c[_0x5626('0x4a')](_0x2b5eb9);}})[_0x5626('0x22')](function(_0xd24741){if(_0xd24741){return _0xd24741?{'count':_0x732c56,'rows':_0xd24741}:null;}})['then'](respondWithResult(_0x12beb9,null))[_0x5626('0x44')](handleError(_0x12beb9,null));};exports[_0x5626('0x4b')]=function(_0xcbc53e,_0x40b46e,_0x1adfd7){var _0x3cc626={};var _0x13054e={};var _0x51120b;var _0x32df5f;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0xcbc53e[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x40b46e,null))[_0x5626('0x22')](function(_0x210814){if(_0x210814){_0x51120b=_0x210814;_0x13054e['model']=_[_0x5626('0x2f')](db['FreshsalesField'][_0x5626('0x29')]);_0x13054e[_0x5626('0x2e')]=_['keys'](_0xcbc53e[_0x5626('0x2e')]);_0x13054e[_0x5626('0x30')]=_[_0x5626('0x41')](_0x13054e[_0x5626('0x2c')],_0x13054e['query']);_0x3cc626['attributes']=_[_0x5626('0x41')](_0x13054e[_0x5626('0x2c')],qs['fields'](_0xcbc53e[_0x5626('0x2e')][_0x5626('0x42')]));_0x3cc626[_0x5626('0x31')]=_0x3cc626['attributes'][_0x5626('0x32')]?_0x3cc626[_0x5626('0x31')]:_0x13054e[_0x5626('0x2c')];_0x3cc626[_0x5626('0x34')]=qs[_0x5626('0x35')](_0xcbc53e['query'][_0x5626('0x35')]);_0x3cc626[_0x5626('0x38')]=qs[_0x5626('0x30')](_['pick'](_0xcbc53e['query'],_0x13054e[_0x5626('0x30')]));if(_0xcbc53e[_0x5626('0x2e')][_0x5626('0x3a')]){_0x3cc626[_0x5626('0x38')]=_[_0x5626('0x37')](_0x3cc626[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x3cc626[_0x5626('0x31')],function(_0x54fd0b){var _0x5697d8={};_0x5697d8[_0x54fd0b]={'$like':'%'+_0xcbc53e['query'][_0x5626('0x3a')]+'%'};return _0x5697d8;})});}_0x3cc626=_[_0x5626('0x37')]({},_0x3cc626,_0xcbc53e['options']);return _0x51120b[_0x5626('0x4b')](_0x3cc626);}})[_0x5626('0x22')](function(_0x134e88){if(_0x134e88){_0x32df5f=_0x134e88[_0x5626('0x32')];if(!_0xcbc53e[_0x5626('0x2e')][_0x5626('0x33')](_0x5626('0x4c'))){_0x3cc626[_0x5626('0x1a')]=qs[_0x5626('0x1a')](_0xcbc53e[_0x5626('0x2e')][_0x5626('0x1a')]);_0x3cc626[_0x5626('0x18')]=qs['offset'](_0xcbc53e[_0x5626('0x2e')]['offset']);}return _0x51120b[_0x5626('0x4b')](_0x3cc626);}})[_0x5626('0x22')](function(_0x1a5347){if(_0x1a5347){return _0x1a5347?{'count':_0x32df5f,'rows':_0x1a5347}:null;}})[_0x5626('0x22')](respondWithResult(_0x40b46e,null))[_0x5626('0x44')](handleError(_0x40b46e,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1848947..66d2ddf 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 _0xf469=['int_freshsales_configurations','util','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf469,0xb5));var _0x9f46=function(_0x54304c,_0x1d57d2){_0x54304c=_0x54304c-0x0;var _0x5f32e6=_0xf469[_0x54304c];return _0x5f32e6;};'use strict';var _=require('lodash');var util=require(_0x9f46('0x0'));var logger=require('../../config/logger')(_0x9f46('0x1'));var moment=require(_0x9f46('0x2'));var BPromise=require(_0x9f46('0x3'));var rp=require(_0x9f46('0x4'));var fs=require('fs');var path=require(_0x9f46('0x5'));var rimraf=require('rimraf');var config=require(_0x9f46('0x6'));var attributes=require(_0x9f46('0x7'));module[_0x9f46('0x8')]=function(_0x1e0e14,_0x539805){return _0x1e0e14[_0x9f46('0x9')](_0x9f46('0xa'),attributes,{'tableName':_0x9f46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf250=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment'];(function(_0x22a81b,_0x51edff){var _0x4540aa=function(_0x10b676){while(--_0x10b676){_0x22a81b['push'](_0x22a81b['shift']());}};_0x4540aa(++_0x51edff);}(_0xf250,0x184));var _0x0f25=function(_0x3642e7,_0x16358e){_0x3642e7=_0x3642e7-0x0;var _0x31e3dd=_0xf250[_0x3642e7];return _0x31e3dd;};'use strict';var _=require(_0x0f25('0x0'));var util=require('util');var logger=require(_0x0f25('0x1'))(_0x0f25('0x2'));var moment=require(_0x0f25('0x3'));var BPromise=require(_0x0f25('0x4'));var rp=require(_0x0f25('0x5'));var fs=require('fs');var path=require(_0x0f25('0x6'));var rimraf=require(_0x0f25('0x7'));var config=require(_0x0f25('0x8'));var attributes=require(_0x0f25('0x9'));module[_0x0f25('0xa')]=function(_0x1ab08e,_0x49e173){return _0x1ab08e[_0x0f25('0xb')](_0x0f25('0xc'),attributes,{'tableName':_0x0f25('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 c64b44d..ef23a86 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 _0x8898=['then','debug','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x222077,_0x180f7c){var _0x59bf61=function(_0x1f4703){while(--_0x1f4703){_0x222077['push'](_0x222077['shift']());}};_0x59bf61(++_0x180f7c);}(_0x8898,0x6b));var _0x8889=function(_0x45388d,_0x35416e){_0x45388d=_0x45388d-0x0;var _0x1cb043=_0x8898[_0x45388d];return _0x1cb043;};'use strict';var _=require(_0x8889('0x0'));var util=require(_0x8889('0x1'));var moment=require(_0x8889('0x2'));var BPromise=require(_0x8889('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8889('0x4'));var db=require(_0x8889('0x5'))['db'];var utils=require(_0x8889('0x6'));var logger=require(_0x8889('0x7'))('rpc');var config=require(_0x8889('0x8'));var jayson=require(_0x8889('0x9'));var client=jayson[_0x8889('0xa')][_0x8889('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3698fd,_0x3c84f8,_0x43ca83){return new BPromise(function(_0x5f9bae,_0x1722a1){return client[_0x8889('0xc')](_0x3698fd,_0x43ca83)[_0x8889('0xd')](function(_0x3af231){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3c84f8,'request\x20sent');logger[_0x8889('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3c84f8,'request\x20sent',JSON[_0x8889('0xf')](_0x3af231));if(_0x3af231['error']){if(_0x3af231[_0x8889('0x10')][_0x8889('0x11')]===0x1f4){logger[_0x8889('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3c84f8,_0x3af231['error'][_0x8889('0x12')]);return _0x1722a1(_0x3af231[_0x8889('0x10')][_0x8889('0x12')]);}logger[_0x8889('0x10')](_0x8889('0x13'),_0x3c84f8,_0x3af231[_0x8889('0x10')][_0x8889('0x12')]);return _0x5f9bae(_0x3af231[_0x8889('0x10')][_0x8889('0x12')]);}else{logger[_0x8889('0x14')](_0x8889('0x13'),_0x3c84f8,_0x8889('0x15'));_0x5f9bae(_0x3af231[_0x8889('0x16')][_0x8889('0x12')]);}})[_0x8889('0x17')](function(_0x3a900b){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3c84f8,_0x3a900b);_0x1722a1(_0x3a900b);});});} \ No newline at end of file +var _0xf5e4=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x109b8d,_0x13784f){var _0x19b81e=function(_0x1d66c3){while(--_0x1d66c3){_0x109b8d['push'](_0x109b8d['shift']());}};_0x19b81e(++_0x13784f);}(_0xf5e4,0x7a));var _0x4f5e=function(_0x157a7e,_0x3edf06){_0x157a7e=_0x157a7e-0x0;var _0x383d25=_0xf5e4[_0x157a7e];return _0x383d25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f5e('0x0'));var BPromise=require('bluebird');var rs=require(_0x4f5e('0x1'));var fs=require('fs');var Redis=require(_0x4f5e('0x2'));var db=require(_0x4f5e('0x3'))['db'];var utils=require(_0x4f5e('0x4'));var logger=require(_0x4f5e('0x5'))(_0x4f5e('0x6'));var config=require(_0x4f5e('0x7'));var jayson=require(_0x4f5e('0x8'));var client=jayson['client'][_0x4f5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dd3be,_0x44c780,_0x2fa858){return new BPromise(function(_0x79e276,_0x8fa2c6){return client['request'](_0x1dd3be,_0x2fa858)[_0x4f5e('0xa')](function(_0x21fa6f){logger[_0x4f5e('0xb')](_0x4f5e('0xc'),_0x44c780,_0x4f5e('0xd'));logger[_0x4f5e('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x44c780,_0x4f5e('0xd'),JSON['stringify'](_0x21fa6f));if(_0x21fa6f[_0x4f5e('0xf')]){if(_0x21fa6f[_0x4f5e('0xf')]['code']===0x1f4){logger[_0x4f5e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x44c780,_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);return _0x8fa2c6(_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);}logger[_0x4f5e('0xf')](_0x4f5e('0xc'),_0x44c780,_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);return _0x79e276(_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);}else{logger[_0x4f5e('0xb')](_0x4f5e('0xc'),_0x44c780,_0x4f5e('0xd'));_0x79e276(_0x21fa6f[_0x4f5e('0x11')]['message']);}})[_0x4f5e('0x12')](function(_0x5d3710){logger[_0x4f5e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x44c780,_0x5d3710);_0x8fa2c6(_0x5d3710);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a2ee5cd..4caf962 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 _0x3036=['get','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express','fs-extra','./intFreshsalesField.controller','isAuthenticated','index'];(function(_0x272f1f,_0x393f59){var _0x487711=function(_0xa8235c){while(--_0xa8235c){_0x272f1f['push'](_0x272f1f['shift']());}};_0x487711(++_0x393f59);}(_0x3036,0x1a9));var _0x6303=function(_0x500261,_0x481c7c){_0x500261=_0x500261-0x0;var _0x5ae675=_0x3036[_0x500261];return _0x5ae675;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6303('0x0'));var timeout=require(_0x6303('0x1'));var express=require(_0x6303('0x2'));var router=express['Router']();var fs_extra=require(_0x6303('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6303('0x4'));router['get']('/',auth[_0x6303('0x5')](),controller[_0x6303('0x6')]);router[_0x6303('0x7')]('/:id',auth[_0x6303('0x5')](),controller[_0x6303('0x8')]);router[_0x6303('0x9')]('/',auth[_0x6303('0x5')](),controller[_0x6303('0xa')]);router[_0x6303('0xb')](_0x6303('0xc'),auth[_0x6303('0x5')](),controller[_0x6303('0xd')]);router['delete'](_0x6303('0xc'),auth[_0x6303('0x5')](),controller[_0x6303('0xe')]);module[_0x6303('0xf')]=router; \ No newline at end of file +var _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x526399,_0x1bac7b){var _0x2a814c=function(_0x43dc3a){while(--_0x43dc3a){_0x526399['push'](_0x526399['shift']());}};_0x2a814c(++_0x1bac7b);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xa1fd[_0x4a8bad];return _0x30cf32;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 23240fc..1d97078 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 _0x4032=['string','keyValue','picklist','STRING','variable','BOOLEAN','exports','ENUM'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x4032,0x1c6));var _0x2403=function(_0x2437ea,_0x10ff81){_0x2437ea=_0x2437ea-0x0;var _0x4572ac=_0x4032[_0x2437ea];return _0x4572ac;};'use strict';var Sequelize=require('sequelize');module[_0x2403('0x0')]={'type':{'type':Sequelize[_0x2403('0x1')](_0x2403('0x2'),'variable','customVariable',_0x2403('0x3'),_0x2403('0x4')),'defaultValue':_0x2403('0x2')},'content':{'type':Sequelize[_0x2403('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2403('0x1')](_0x2403('0x2'),_0x2403('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x2403('0x5')]},'idField':{'type':Sequelize[_0x2403('0x5')]},'nameField':{'type':Sequelize[_0x2403('0x5')]},'customField':{'type':Sequelize[_0x2403('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2403('0x5')]}}; \ No newline at end of file +var _0x2901=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x531607,_0x73fa88){var _0x1b1fbb=function(_0x4af491){while(--_0x4af491){_0x531607['push'](_0x531607['shift']());}};_0x1b1fbb(++_0x73fa88);}(_0x2901,0xb3));var _0x1290=function(_0xb1ec0b,_0x47e760){_0xb1ec0b=_0xb1ec0b-0x0;var _0x3e0293=_0x2901[_0xb1ec0b];return _0x3e0293;};'use strict';var Sequelize=require(_0x1290('0x0'));module[_0x1290('0x1')]={'type':{'type':Sequelize[_0x1290('0x2')]('string',_0x1290('0x3'),_0x1290('0x4'),_0x1290('0x5'),_0x1290('0x6')),'defaultValue':_0x1290('0x7')},'content':{'type':Sequelize[_0x1290('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1290('0x2')]('string',_0x1290('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1290('0x8')]},'idField':{'type':Sequelize[_0x1290('0x8')]},'nameField':{'type':Sequelize[_0x1290('0x8')]},'customField':{'type':Sequelize[_0x1290('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1290('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f2693c1..5b27226 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 _0x2185=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','request-promise','mustache','sox','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','FreshsalesField','rawAttributes','fieldName','type','key','model','query'];(function(_0x49f30d,_0x50300a){var _0x2c75fa=function(_0x3a880a){while(--_0x3a880a){_0x49f30d['push'](_0x49f30d['shift']());}};_0x2c75fa(++_0x50300a);}(_0x2185,0x1db));var _0x5218=function(_0x33de06,_0x9fc633){_0x33de06=_0x33de06-0x0;var _0x3d28f9=_0x2185[_0x33de06];return _0x3d28f9;};'use strict';var emlformat=require(_0x5218('0x0'));var rimraf=require(_0x5218('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5218('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5218('0x3'));var util=require('util');var path=require('path');var sox=require(_0x5218('0x4'));var csv=require('to-csv');var ejs=require(_0x5218('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5218('0x6'));var squel=require(_0x5218('0x7'));var crypto=require(_0x5218('0x8'));var jsforce=require(_0x5218('0x9'));var deskjs=require(_0x5218('0xa'));var toCsv=require(_0x5218('0xb'));var querystring=require(_0x5218('0xc'));var Papa=require(_0x5218('0xd'));var Redis=require(_0x5218('0xe'));var authService=require(_0x5218('0xf'));var qs=require(_0x5218('0x10'));var as=require(_0x5218('0x11'));var hardwareService=require(_0x5218('0x12'));var logger=require(_0x5218('0x13'))(_0x5218('0x14'));var utils=require(_0x5218('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5218('0x16'));var db=require(_0x5218('0x17'))['db'];function respondWithStatusCode(_0x3dc97e,_0x1d265d){_0x1d265d=_0x1d265d||0xcc;return function(_0x4bd437){if(_0x4bd437){return _0x3dc97e[_0x5218('0x18')](_0x1d265d);}return _0x3dc97e[_0x5218('0x19')](_0x1d265d)[_0x5218('0x1a')]();};}function respondWithResult(_0x1275b7,_0x89a7d1){_0x89a7d1=_0x89a7d1||0xc8;return function(_0x234a47){if(_0x234a47){return _0x1275b7[_0x5218('0x19')](_0x89a7d1)[_0x5218('0x1b')](_0x234a47);}};}function respondWithFilteredResult(_0x4853a0,_0x212980){return function(_0x9d2528){if(_0x9d2528){var _0x551532=typeof _0x212980[_0x5218('0x1c')]===_0x5218('0x1d')&&typeof _0x212980[_0x5218('0x1e')]===_0x5218('0x1d');var _0x4a7231=_0x9d2528[_0x5218('0x1f')];var _0x1fa610=_0x551532?0x0:_0x212980[_0x5218('0x1c')];var _0x206870=_0x551532?_0x9d2528[_0x5218('0x1f')]:_0x212980['offset']+_0x212980[_0x5218('0x1e')];var _0x11314c;if(_0x206870>=_0x4a7231){_0x206870=_0x4a7231;_0x11314c=0xc8;}else{_0x11314c=0xce;}_0x4853a0[_0x5218('0x19')](_0x11314c);return _0x4853a0[_0x5218('0x20')](_0x5218('0x21'),_0x1fa610+'-'+_0x206870+'/'+_0x4a7231)[_0x5218('0x1b')](_0x9d2528);}return null;};}function patchUpdates(_0xd72ce5){return function(_0x20f65f){try{jsonpatch[_0x5218('0x22')](_0x20f65f,_0xd72ce5,!![]);}catch(_0x40c460){return BPromise[_0x5218('0x23')](_0x40c460);}return _0x20f65f[_0x5218('0x24')]();};}function saveUpdates(_0x36a69b,_0x1f6715){return function(_0x21ee59){if(_0x21ee59){return _0x21ee59[_0x5218('0x25')](_0x36a69b)['then'](function(_0x3c5586){return _0x3c5586;});}return null;};}function removeEntity(_0x29a290,_0x188ac9){return function(_0x5a9062){if(_0x5a9062){return _0x5a9062[_0x5218('0x26')]()[_0x5218('0x27')](function(){_0x29a290['status'](0xcc)[_0x5218('0x1a')]();});}};}function handleEntityNotFound(_0x1929a2,_0x2ad913){return function(_0x494269){if(!_0x494269){_0x1929a2[_0x5218('0x18')](0x194);}return _0x494269;};}function handleError(_0xa2badd,_0x3cb1e3){_0x3cb1e3=_0x3cb1e3||0x1f4;return function(_0x131d5e){logger[_0x5218('0x28')](_0x131d5e['stack']);if(_0x131d5e[_0x5218('0x29')]){delete _0x131d5e['name'];}_0xa2badd['status'](_0x3cb1e3)[_0x5218('0x2a')](_0x131d5e);};}exports['index']=function(_0x1350e8,_0x3cc526){var _0x9f53b5={},_0xdf18d5={},_0x5eda6b={'count':0x0,'rows':[]};var _0x459595=_['map'](db[_0x5218('0x2b')][_0x5218('0x2c')],function(_0x17c120){return{'name':_0x17c120[_0x5218('0x2d')],'type':_0x17c120[_0x5218('0x2e')][_0x5218('0x2f')]};});_0xdf18d5[_0x5218('0x30')]=_['map'](_0x459595,_0x5218('0x29'));_0xdf18d5[_0x5218('0x31')]=_[_0x5218('0x32')](_0x1350e8[_0x5218('0x31')]);_0xdf18d5[_0x5218('0x33')]=_[_0x5218('0x34')](_0xdf18d5[_0x5218('0x30')],_0xdf18d5['query']);_0x9f53b5['attributes']=_['intersection'](_0xdf18d5[_0x5218('0x30')],qs[_0x5218('0x35')](_0x1350e8['query'][_0x5218('0x35')]));_0x9f53b5[_0x5218('0x36')]=_0x9f53b5[_0x5218('0x36')][_0x5218('0x37')]?_0x9f53b5['attributes']:_0xdf18d5[_0x5218('0x30')];if(!_0x1350e8[_0x5218('0x31')][_0x5218('0x38')](_0x5218('0x39'))){_0x9f53b5[_0x5218('0x1e')]=qs[_0x5218('0x1e')](_0x1350e8[_0x5218('0x31')][_0x5218('0x1e')]);_0x9f53b5[_0x5218('0x1c')]=qs['offset'](_0x1350e8[_0x5218('0x31')][_0x5218('0x1c')]);}_0x9f53b5['order']=qs[_0x5218('0x3a')](_0x1350e8[_0x5218('0x31')][_0x5218('0x3a')]);_0x9f53b5[_0x5218('0x3b')]=qs[_0x5218('0x33')](_[_0x5218('0x3c')](_0x1350e8[_0x5218('0x31')],_0xdf18d5[_0x5218('0x33')]),_0x459595);if(_0x1350e8[_0x5218('0x31')]['filter']){_0x9f53b5[_0x5218('0x3b')]=_[_0x5218('0x3d')](_0x9f53b5['where'],{'$or':_[_0x5218('0x3e')](_0x459595,function(_0x330440){if(_0x330440[_0x5218('0x2e')]!==_0x5218('0x3f')){var _0x3968b2={};_0x3968b2[_0x330440[_0x5218('0x29')]]={'$like':'%'+_0x1350e8['query'][_0x5218('0x40')]+'%'};return _0x3968b2;}})});}_0x9f53b5=_['merge']({},_0x9f53b5,_0x1350e8['options']);var _0x4fadb1={'where':_0x9f53b5['where']};return db[_0x5218('0x2b')][_0x5218('0x1f')](_0x4fadb1)[_0x5218('0x27')](function(_0x4471e7){_0x5eda6b[_0x5218('0x1f')]=_0x4471e7;if(_0x1350e8[_0x5218('0x31')][_0x5218('0x41')]){_0x9f53b5[_0x5218('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0x5218('0x43')](_0x9f53b5);})[_0x5218('0x27')](function(_0x37cbc){_0x5eda6b['rows']=_0x37cbc;return _0x5eda6b;})[_0x5218('0x27')](respondWithFilteredResult(_0x3cc526,_0x9f53b5))[_0x5218('0x44')](handleError(_0x3cc526,null));};exports[_0x5218('0x45')]=function(_0x38463c,_0x18e600){var _0x22ea0d={'raw':!![],'where':{'id':_0x38463c[_0x5218('0x46')]['id']}},_0x1d6d20={};_0x1d6d20[_0x5218('0x30')]=_[_0x5218('0x32')](db[_0x5218('0x2b')][_0x5218('0x2c')]);_0x1d6d20[_0x5218('0x31')]=_['keys'](_0x38463c['query']);_0x1d6d20['filters']=_[_0x5218('0x34')](_0x1d6d20[_0x5218('0x30')],_0x1d6d20[_0x5218('0x31')]);_0x22ea0d['attributes']=_['intersection'](_0x1d6d20['model'],qs[_0x5218('0x35')](_0x38463c[_0x5218('0x31')][_0x5218('0x35')]));_0x22ea0d[_0x5218('0x36')]=_0x22ea0d[_0x5218('0x36')][_0x5218('0x37')]?_0x22ea0d[_0x5218('0x36')]:_0x1d6d20[_0x5218('0x30')];if(_0x38463c[_0x5218('0x31')][_0x5218('0x41')]){_0x22ea0d[_0x5218('0x42')]=[{'all':!![]}];}_0x22ea0d=_[_0x5218('0x3d')]({},_0x22ea0d,_0x38463c[_0x5218('0x47')]);return db[_0x5218('0x2b')]['find'](_0x22ea0d)['then'](handleEntityNotFound(_0x18e600,null))['then'](respondWithResult(_0x18e600,null))[_0x5218('0x44')](handleError(_0x18e600,null));};exports[_0x5218('0x48')]=function(_0x3744c8,_0x7b6c31){return db['FreshsalesField']['create'](_0x3744c8[_0x5218('0x49')],{})[_0x5218('0x27')](respondWithResult(_0x7b6c31,0xc9))[_0x5218('0x44')](handleError(_0x7b6c31,null));};exports[_0x5218('0x25')]=function(_0x3930eb,_0x26acd9){if(_0x3930eb[_0x5218('0x49')]['id']){delete _0x3930eb['body']['id'];}return db['FreshsalesField'][_0x5218('0x4a')]({'where':{'id':_0x3930eb['params']['id']}})[_0x5218('0x27')](handleEntityNotFound(_0x26acd9,null))[_0x5218('0x27')](saveUpdates(_0x3930eb[_0x5218('0x49')],null))[_0x5218('0x27')](respondWithResult(_0x26acd9,null))[_0x5218('0x44')](handleError(_0x26acd9,null));};exports['destroy']=function(_0x45446d,_0x1fb189){return db[_0x5218('0x2b')]['find']({'where':{'id':_0x45446d[_0x5218('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fb189,null))[_0x5218('0x27')](removeEntity(_0x1fb189,null))[_0x5218('0x44')](handleError(_0x1fb189,null));}; \ No newline at end of file +var _0xa98b=['status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','FreshsalesField','include','findAll','catch','show','params','includeAll','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xa98b,0xcc));var _0xba98=function(_0x20e407,_0x9021a7){_0x20e407=_0x20e407-0x0;var _0x147b7f=_0xa98b[_0x20e407];return _0x147b7f;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require(_0xba98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba98('0x2'));var rp=require(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var Mustache=require(_0xba98('0x6'));var util=require(_0xba98('0x7'));var path=require(_0xba98('0x8'));var sox=require(_0xba98('0x9'));var csv=require(_0xba98('0xa'));var ejs=require(_0xba98('0xb'));var fs=require('fs');var fs_extra=require(_0xba98('0xc'));var _=require(_0xba98('0xd'));var squel=require(_0xba98('0xe'));var crypto=require(_0xba98('0xf'));var jsforce=require(_0xba98('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xba98('0xa'));var querystring=require(_0xba98('0x11'));var Papa=require(_0xba98('0x12'));var Redis=require('ioredis');var authService=require(_0xba98('0x13'));var qs=require(_0xba98('0x14'));var as=require(_0xba98('0x15'));var hardwareService=require(_0xba98('0x16'));var logger=require(_0xba98('0x17'))(_0xba98('0x18'));var utils=require(_0xba98('0x19'));var config=require(_0xba98('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34ec1d,_0x1cdfa2){_0x1cdfa2=_0x1cdfa2||0xcc;return function(_0x185704){if(_0x185704){return _0x34ec1d['sendStatus'](_0x1cdfa2);}return _0x34ec1d[_0xba98('0x1b')](_0x1cdfa2)[_0xba98('0x1c')]();};}function respondWithResult(_0x5c6547,_0x5756a3){_0x5756a3=_0x5756a3||0xc8;return function(_0x425d51){if(_0x425d51){return _0x5c6547[_0xba98('0x1b')](_0x5756a3)['json'](_0x425d51);}};}function respondWithFilteredResult(_0x14723f,_0x6f828){return function(_0x1b8093){if(_0x1b8093){var _0x380dd4=typeof _0x6f828[_0xba98('0x1d')]==='undefined'&&typeof _0x6f828[_0xba98('0x1e')]===_0xba98('0x1f');var _0x3ae726=_0x1b8093[_0xba98('0x20')];var _0x3a9fd3=_0x380dd4?0x0:_0x6f828['offset'];var _0x2327d0=_0x380dd4?_0x1b8093[_0xba98('0x20')]:_0x6f828['offset']+_0x6f828[_0xba98('0x1e')];var _0x265a4e;if(_0x2327d0>=_0x3ae726){_0x2327d0=_0x3ae726;_0x265a4e=0xc8;}else{_0x265a4e=0xce;}_0x14723f[_0xba98('0x1b')](_0x265a4e);return _0x14723f[_0xba98('0x21')](_0xba98('0x22'),_0x3a9fd3+'-'+_0x2327d0+'/'+_0x3ae726)[_0xba98('0x23')](_0x1b8093);}return null;};}function patchUpdates(_0x1e67f8){return function(_0x4cb753){try{jsonpatch[_0xba98('0x24')](_0x4cb753,_0x1e67f8,!![]);}catch(_0x277010){return BPromise['reject'](_0x277010);}return _0x4cb753[_0xba98('0x25')]();};}function saveUpdates(_0x371e1b,_0x40c7cc){return function(_0x25aab8){if(_0x25aab8){return _0x25aab8[_0xba98('0x26')](_0x371e1b)[_0xba98('0x27')](function(_0x1edad9){return _0x1edad9;});}return null;};}function removeEntity(_0x59c264,_0x3c9988){return function(_0x23e55b){if(_0x23e55b){return _0x23e55b['destroy']()[_0xba98('0x27')](function(){_0x59c264[_0xba98('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e28fa,_0x4fe515){return function(_0x57cc11){if(!_0x57cc11){_0x3e28fa['sendStatus'](0x194);}return _0x57cc11;};}function handleError(_0x574ae3,_0x399671){_0x399671=_0x399671||0x1f4;return function(_0x680448){logger['error'](_0x680448[_0xba98('0x28')]);if(_0x680448[_0xba98('0x29')]){delete _0x680448[_0xba98('0x29')];}_0x574ae3['status'](_0x399671)[_0xba98('0x2a')](_0x680448);};}exports['index']=function(_0xe56603,_0x1de971){var _0xd6304a={},_0xee26ba={},_0x4da45d={'count':0x0,'rows':[]};var _0x35be89=_[_0xba98('0x2b')](db['FreshsalesField'][_0xba98('0x2c')],function(_0x3ea09e){return{'name':_0x3ea09e[_0xba98('0x2d')],'type':_0x3ea09e[_0xba98('0x2e')][_0xba98('0x2f')]};});_0xee26ba['model']=_[_0xba98('0x2b')](_0x35be89,'name');_0xee26ba[_0xba98('0x30')]=_[_0xba98('0x31')](_0xe56603[_0xba98('0x30')]);_0xee26ba['filters']=_['intersection'](_0xee26ba['model'],_0xee26ba[_0xba98('0x30')]);_0xd6304a[_0xba98('0x32')]=_[_0xba98('0x33')](_0xee26ba[_0xba98('0x34')],qs[_0xba98('0x35')](_0xe56603[_0xba98('0x30')][_0xba98('0x35')]));_0xd6304a[_0xba98('0x32')]=_0xd6304a[_0xba98('0x32')][_0xba98('0x36')]?_0xd6304a[_0xba98('0x32')]:_0xee26ba[_0xba98('0x34')];if(!_0xe56603['query'][_0xba98('0x37')](_0xba98('0x38'))){_0xd6304a[_0xba98('0x1e')]=qs['limit'](_0xe56603[_0xba98('0x30')][_0xba98('0x1e')]);_0xd6304a[_0xba98('0x1d')]=qs['offset'](_0xe56603[_0xba98('0x30')][_0xba98('0x1d')]);}_0xd6304a[_0xba98('0x39')]=qs['sort'](_0xe56603[_0xba98('0x30')][_0xba98('0x3a')]);_0xd6304a[_0xba98('0x3b')]=qs[_0xba98('0x3c')](_[_0xba98('0x3d')](_0xe56603[_0xba98('0x30')],_0xee26ba[_0xba98('0x3c')]),_0x35be89);if(_0xe56603[_0xba98('0x30')]['filter']){_0xd6304a[_0xba98('0x3b')]=_[_0xba98('0x3e')](_0xd6304a[_0xba98('0x3b')],{'$or':_['map'](_0x35be89,function(_0x1b3223){if(_0x1b3223[_0xba98('0x2e')]!==_0xba98('0x3f')){var _0x278f54={};_0x278f54[_0x1b3223[_0xba98('0x29')]]={'$like':'%'+_0xe56603[_0xba98('0x30')][_0xba98('0x40')]+'%'};return _0x278f54;}})});}_0xd6304a=_['merge']({},_0xd6304a,_0xe56603[_0xba98('0x41')]);var _0x5d7c79={'where':_0xd6304a[_0xba98('0x3b')]};return db[_0xba98('0x42')][_0xba98('0x20')](_0x5d7c79)['then'](function(_0x1077d3){_0x4da45d[_0xba98('0x20')]=_0x1077d3;if(_0xe56603[_0xba98('0x30')]['includeAll']){_0xd6304a[_0xba98('0x43')]=[{'all':!![]}];}return db[_0xba98('0x42')][_0xba98('0x44')](_0xd6304a);})['then'](function(_0x20f481){_0x4da45d['rows']=_0x20f481;return _0x4da45d;})[_0xba98('0x27')](respondWithFilteredResult(_0x1de971,_0xd6304a))[_0xba98('0x45')](handleError(_0x1de971,null));};exports[_0xba98('0x46')]=function(_0xd808e4,_0x5442e3){var _0x5a79b4={'raw':!![],'where':{'id':_0xd808e4[_0xba98('0x47')]['id']}},_0x20b0a7={};_0x20b0a7[_0xba98('0x34')]=_[_0xba98('0x31')](db[_0xba98('0x42')][_0xba98('0x2c')]);_0x20b0a7[_0xba98('0x30')]=_['keys'](_0xd808e4[_0xba98('0x30')]);_0x20b0a7[_0xba98('0x3c')]=_[_0xba98('0x33')](_0x20b0a7[_0xba98('0x34')],_0x20b0a7['query']);_0x5a79b4[_0xba98('0x32')]=_[_0xba98('0x33')](_0x20b0a7[_0xba98('0x34')],qs[_0xba98('0x35')](_0xd808e4[_0xba98('0x30')][_0xba98('0x35')]));_0x5a79b4[_0xba98('0x32')]=_0x5a79b4[_0xba98('0x32')][_0xba98('0x36')]?_0x5a79b4[_0xba98('0x32')]:_0x20b0a7[_0xba98('0x34')];if(_0xd808e4[_0xba98('0x30')][_0xba98('0x48')]){_0x5a79b4[_0xba98('0x43')]=[{'all':!![]}];}_0x5a79b4=_[_0xba98('0x3e')]({},_0x5a79b4,_0xd808e4['options']);return db[_0xba98('0x42')]['find'](_0x5a79b4)[_0xba98('0x27')](handleEntityNotFound(_0x5442e3,null))[_0xba98('0x27')](respondWithResult(_0x5442e3,null))['catch'](handleError(_0x5442e3,null));};exports['create']=function(_0x19cc40,_0x400101){return db['FreshsalesField'][_0xba98('0x49')](_0x19cc40[_0xba98('0x4a')],{})[_0xba98('0x27')](respondWithResult(_0x400101,0xc9))[_0xba98('0x45')](handleError(_0x400101,null));};exports[_0xba98('0x26')]=function(_0x3c6606,_0x540ef1){if(_0x3c6606[_0xba98('0x4a')]['id']){delete _0x3c6606[_0xba98('0x4a')]['id'];}return db['FreshsalesField'][_0xba98('0x4b')]({'where':{'id':_0x3c6606[_0xba98('0x47')]['id']}})['then'](handleEntityNotFound(_0x540ef1,null))['then'](saveUpdates(_0x3c6606[_0xba98('0x4a')],null))['then'](respondWithResult(_0x540ef1,null))[_0xba98('0x45')](handleError(_0x540ef1,null));};exports[_0xba98('0x4c')]=function(_0xc78478,_0x463462){return db[_0xba98('0x42')][_0xba98('0x4b')]({'where':{'id':_0xc78478[_0xba98('0x47')]['id']}})[_0xba98('0x27')](handleEntityNotFound(_0x463462,null))[_0xba98('0x27')](removeEntity(_0x463462,null))[_0xba98('0x45')](handleError(_0x463462,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index f08ceb1..43f287c 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 _0x3e22=['util','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x5430e7,_0x5051c5){var _0x5dfd45=function(_0x182942){while(--_0x182942){_0x5430e7['push'](_0x5430e7['shift']());}};_0x5dfd45(++_0x5051c5);}(_0x3e22,0xa8));var _0x23e2=function(_0x2c0c28,_0x394236){_0x2c0c28=_0x2c0c28-0x0;var _0x2e7a1d=_0x3e22[_0x2c0c28];return _0x2e7a1d;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var logger=require('../../config/logger')(_0x23e2('0x1'));var moment=require(_0x23e2('0x2'));var BPromise=require(_0x23e2('0x3'));var rp=require(_0x23e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23e2('0x5'));var attributes=require(_0x23e2('0x6'));module['exports']=function(_0x287f8f,_0x433a85){return _0x287f8f[_0x23e2('0x7')](_0x23e2('0x8'),attributes,{'tableName':_0x23e2('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x23e2('0xa'),_0x23e2('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63a6=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','idField','FieldId','util'];(function(_0xfd377f,_0x375ef1){var _0x2de2a2=function(_0x3abe53){while(--_0x3abe53){_0xfd377f['push'](_0xfd377f['shift']());}};_0x2de2a2(++_0x375ef1);}(_0x63a6,0x1c7));var _0x663a=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x63a6[_0x243b2f];return _0xcb3c2d;};'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':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x663a('0xa'),_0x663a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index dfb9ada..c2a21c7 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x39fee5,_0x33f715){_0x39fee5=_0x39fee5-0x0;var _0x43c19d=_0x3f8a[_0x39fee5];return _0x43c19d;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x3b5b67,_0x2f1f83){var _0x35c69=function(_0x502f9f){while(--_0x502f9f){_0x3b5b67['push'](_0x3b5b67['shift']());}};_0x35c69(++_0x2f1f83);}(_0x4c60,0xc1));var _0x04c6=function(_0x3009be,_0x20844d){_0x3009be=_0x3009be-0x0;var _0x3ce6b9=_0x4c60[_0x3009be];return _0x3ce6b9;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 89232f4..69c90a1 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(_0x36156b,_0x25cc26){var _0x5db905=function(_0x14206f){while(--_0x14206f){_0x36156b['push'](_0x36156b['shift']());}};_0x5db905(++_0x25cc26);}(_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('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(_0x4a8e0d,_0x1fdc67){var _0xf54ee2=function(_0x207da9){while(--_0x207da9){_0x4a8e0d['push'](_0x4a8e0d['shift']());}};_0xf54ee2(++_0x1fdc67);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index f05a8f8..5f2f98e 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 _0x5d0a=['exports','username','STRING','ENUM','newTab','sequelize'];(function(_0x281a7d,_0x4d57d9){var _0x33f01a=function(_0x3d59fd){while(--_0x3d59fd){_0x281a7d['push'](_0x281a7d['shift']());}};_0x33f01a(++_0x4d57d9);}(_0x5d0a,0x173));var _0xa5d0=function(_0xd46eb6,_0x108309){_0xd46eb6=_0xd46eb6-0x0;var _0x3c31c1=_0x5d0a[_0xd46eb6];return _0x3c31c1;};'use strict';var Sequelize=require(_0xa5d0('0x0'));module[_0xa5d0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xa5d0('0x2')},'remoteUri':{'type':Sequelize[_0xa5d0('0x3')]},'password':{'type':Sequelize[_0xa5d0('0x3')]},'clientId':{'type':Sequelize[_0xa5d0('0x3')]},'clientSecret':{'type':Sequelize[_0xa5d0('0x3')]},'securityToken':{'type':Sequelize[_0xa5d0('0x3')]},'serverUrl':{'type':Sequelize[_0xa5d0('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa5d0('0x4')]('integrationTab',_0xa5d0('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd26f=['newTab','integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xd26f,0x113));var _0xfd26=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd26f[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x3')},'remoteUri':{'type':Sequelize[_0xfd26('0x2')]},'password':{'type':Sequelize[_0xfd26('0x2')]},'clientId':{'type':Sequelize[_0xfd26('0x2')]},'clientSecret':{'type':Sequelize[_0xfd26('0x2')]},'securityToken':{'type':Sequelize[_0xfd26('0x2')]},'serverUrl':{'type':Sequelize[_0xfd26('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfd26('0x4')]('integrationTab',_0xfd26('0x5')),'defaultValue':_0xfd26('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f265ace..4b2ab40 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 _0xe3c0=['fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','includeAll','find','catch','create','body','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','username','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0x3964fc,_0x383c2b){var _0x69b65=function(_0x509781){while(--_0x509781){_0x3964fc['push'](_0x3964fc['shift']());}};_0x69b65(++_0x383c2b);}(_0xe3c0,0x170));var _0x0e3c=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xe3c0[_0x20c9b2];return _0x2c6030;};'use strict';var emlformat=require(_0x0e3c('0x0'));var rimraf=require(_0x0e3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e3c('0x2'));var rp=require(_0x0e3c('0x3'));var moment=require(_0x0e3c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e3c('0x5'));var path=require(_0x0e3c('0x6'));var sox=require(_0x0e3c('0x7'));var csv=require(_0x0e3c('0x8'));var ejs=require(_0x0e3c('0x9'));var fs=require('fs');var fs_extra=require(_0x0e3c('0xa'));var _=require(_0x0e3c('0xb'));var squel=require('squel');var crypto=require(_0x0e3c('0xc'));var jsforce=require(_0x0e3c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0e3c('0x8'));var querystring=require('querystring');var Papa=require(_0x0e3c('0xe'));var Redis=require(_0x0e3c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e3c('0x10'));var logger=require(_0x0e3c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x0e3c('0x12'));var licenseUtil=require(_0x0e3c('0x13'));var db=require(_0x0e3c('0x14'))['db'];var integrations=require(_0x0e3c('0x15'));function respondWithStatusCode(_0x30bb69,_0xa87af8){_0xa87af8=_0xa87af8||0xcc;return function(_0xd707b4){if(_0xd707b4){return _0x30bb69[_0x0e3c('0x16')](_0xa87af8);}return _0x30bb69[_0x0e3c('0x17')](_0xa87af8)[_0x0e3c('0x18')]();};}function respondWithResult(_0xca83c,_0x395b48){_0x395b48=_0x395b48||0xc8;return function(_0x5a509d){if(_0x5a509d){return _0xca83c[_0x0e3c('0x17')](_0x395b48)[_0x0e3c('0x19')](_0x5a509d);}};}function respondWithFilteredResult(_0x1ca40a,_0x1b0951){return function(_0x5b69e4){if(_0x5b69e4){var _0x5230cb=typeof _0x1b0951['offset']==='undefined'&&typeof _0x1b0951['limit']===_0x0e3c('0x1a');var _0x2e30ef=_0x5b69e4[_0x0e3c('0x1b')];var _0x4f3a43=_0x5230cb?0x0:_0x1b0951['offset'];var _0x105add=_0x5230cb?_0x5b69e4[_0x0e3c('0x1b')]:_0x1b0951['offset']+_0x1b0951[_0x0e3c('0x1c')];var _0xf3a0f9;if(_0x105add>=_0x2e30ef){_0x105add=_0x2e30ef;_0xf3a0f9=0xc8;}else{_0xf3a0f9=0xce;}_0x1ca40a[_0x0e3c('0x17')](_0xf3a0f9);return _0x1ca40a[_0x0e3c('0x1d')](_0x0e3c('0x1e'),_0x4f3a43+'-'+_0x105add+'/'+_0x2e30ef)[_0x0e3c('0x19')](_0x5b69e4);}return null;};}function patchUpdates(_0x218a67){return function(_0x45b201){try{jsonpatch[_0x0e3c('0x1f')](_0x45b201,_0x218a67,!![]);}catch(_0x2d3600){return BPromise[_0x0e3c('0x20')](_0x2d3600);}return _0x45b201[_0x0e3c('0x21')]();};}function saveUpdates(_0xa4ae3,_0x1ba7b4){return function(_0x296dcd){if(_0x296dcd){return _0x296dcd[_0x0e3c('0x22')](_0xa4ae3)['then'](function(_0x2dc8a3){return _0x2dc8a3;});}return null;};}function removeEntity(_0x5b7000,_0x3b93c8){return function(_0xd4a4f9){if(_0xd4a4f9){return _0xd4a4f9[_0x0e3c('0x23')]()[_0x0e3c('0x24')](function(){_0x5b7000['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d1923,_0x37aa63){return function(_0x485954){if(!_0x485954){_0x4d1923['sendStatus'](0x194);}return _0x485954;};}function handleError(_0x45d074,_0x5b9e70){_0x5b9e70=_0x5b9e70||0x1f4;return function(_0x5dbc74){logger[_0x0e3c('0x25')](_0x5dbc74[_0x0e3c('0x26')]);if(_0x5dbc74[_0x0e3c('0x27')]){delete _0x5dbc74[_0x0e3c('0x27')];}_0x45d074['status'](_0x5b9e70)['send'](_0x5dbc74);};}exports['index']=function(_0x5532d6,_0x540038){var _0x10748c={},_0x530b81={},_0x3e74f3={'count':0x0,'rows':[]};var _0x107ade=_[_0x0e3c('0x28')](db[_0x0e3c('0x29')][_0x0e3c('0x2a')],function(_0x52e289){return{'name':_0x52e289[_0x0e3c('0x2b')],'type':_0x52e289[_0x0e3c('0x2c')][_0x0e3c('0x2d')]};});_0x530b81[_0x0e3c('0x2e')]=_[_0x0e3c('0x28')](_0x107ade,'name');_0x530b81[_0x0e3c('0x2f')]=_[_0x0e3c('0x30')](_0x5532d6['query']);_0x530b81['filters']=_[_0x0e3c('0x31')](_0x530b81[_0x0e3c('0x2e')],_0x530b81[_0x0e3c('0x2f')]);_0x10748c[_0x0e3c('0x32')]=_[_0x0e3c('0x31')](_0x530b81[_0x0e3c('0x2e')],qs[_0x0e3c('0x33')](_0x5532d6[_0x0e3c('0x2f')][_0x0e3c('0x33')]));_0x10748c['attributes']=_0x10748c[_0x0e3c('0x32')][_0x0e3c('0x34')]?_0x10748c[_0x0e3c('0x32')]:_0x530b81[_0x0e3c('0x2e')];if(!_0x5532d6[_0x0e3c('0x2f')][_0x0e3c('0x35')](_0x0e3c('0x36'))){_0x10748c[_0x0e3c('0x1c')]=qs[_0x0e3c('0x1c')](_0x5532d6['query'][_0x0e3c('0x1c')]);_0x10748c[_0x0e3c('0x37')]=qs[_0x0e3c('0x37')](_0x5532d6[_0x0e3c('0x2f')]['offset']);}_0x10748c[_0x0e3c('0x38')]=qs[_0x0e3c('0x39')](_0x5532d6[_0x0e3c('0x2f')]['sort']);_0x10748c['where']=qs[_0x0e3c('0x3a')](_[_0x0e3c('0x3b')](_0x5532d6[_0x0e3c('0x2f')],_0x530b81[_0x0e3c('0x3a')]),_0x107ade);if(_0x5532d6[_0x0e3c('0x2f')][_0x0e3c('0x3c')]){_0x10748c[_0x0e3c('0x3d')]=_[_0x0e3c('0x3e')](_0x10748c[_0x0e3c('0x3d')],{'$or':_[_0x0e3c('0x28')](_0x107ade,function(_0x43b43c){if(_0x43b43c[_0x0e3c('0x2c')]!==_0x0e3c('0x3f')){var _0x40a5f1={};_0x40a5f1[_0x43b43c[_0x0e3c('0x27')]]={'$like':'%'+_0x5532d6[_0x0e3c('0x2f')][_0x0e3c('0x3c')]+'%'};return _0x40a5f1;}})});}_0x10748c=_[_0x0e3c('0x3e')]({},_0x10748c,_0x5532d6[_0x0e3c('0x40')]);var _0x2cc55d={'where':_0x10748c[_0x0e3c('0x3d')]};return db[_0x0e3c('0x29')][_0x0e3c('0x1b')](_0x2cc55d)['then'](function(_0x1e7d66){_0x3e74f3[_0x0e3c('0x1b')]=_0x1e7d66;if(_0x5532d6[_0x0e3c('0x2f')]['includeAll']){_0x10748c[_0x0e3c('0x41')]=[{'all':!![]}];}return db[_0x0e3c('0x29')][_0x0e3c('0x42')](_0x10748c);})[_0x0e3c('0x24')](function(_0xf0a43c){_0x3e74f3[_0x0e3c('0x43')]=_0xf0a43c;return _0x3e74f3;})[_0x0e3c('0x24')](respondWithFilteredResult(_0x540038,_0x10748c))['catch'](handleError(_0x540038,null));};exports['show']=function(_0x614276,_0x397c99){var _0x5c22a5={'raw':![],'where':{'id':_0x614276['params']['id']}},_0x125754={};_0x125754[_0x0e3c('0x2e')]=_[_0x0e3c('0x30')](db['SalesforceAccount'][_0x0e3c('0x2a')]);_0x125754[_0x0e3c('0x2f')]=_[_0x0e3c('0x30')](_0x614276[_0x0e3c('0x2f')]);_0x125754[_0x0e3c('0x3a')]=_['intersection'](_0x125754[_0x0e3c('0x2e')],_0x125754['query']);_0x5c22a5['attributes']=_[_0x0e3c('0x31')](_0x125754['model'],qs['fields'](_0x614276[_0x0e3c('0x2f')][_0x0e3c('0x33')]));_0x5c22a5[_0x0e3c('0x32')]=_0x5c22a5['attributes']['length']?_0x5c22a5[_0x0e3c('0x32')]:_0x125754[_0x0e3c('0x2e')];if(_0x614276[_0x0e3c('0x2f')][_0x0e3c('0x44')]){_0x5c22a5[_0x0e3c('0x41')]=[{'all':!![]}];}_0x5c22a5=_['merge']({},_0x5c22a5,_0x614276['options']);return db[_0x0e3c('0x29')][_0x0e3c('0x45')](_0x5c22a5)[_0x0e3c('0x24')](handleEntityNotFound(_0x397c99,null))[_0x0e3c('0x24')](respondWithResult(_0x397c99,null))[_0x0e3c('0x46')](handleError(_0x397c99,null));};exports[_0x0e3c('0x47')]=function(_0x48e9d2,_0x2c22e7){return db[_0x0e3c('0x29')][_0x0e3c('0x47')](_0x48e9d2[_0x0e3c('0x48')],{})[_0x0e3c('0x24')](respondWithResult(_0x2c22e7,0xc9))[_0x0e3c('0x46')](handleError(_0x2c22e7,null));};exports[_0x0e3c('0x22')]=function(_0x3901f8,_0x16235c){if(_0x3901f8['body']['id']){delete _0x3901f8[_0x0e3c('0x48')]['id'];}return db[_0x0e3c('0x29')][_0x0e3c('0x45')]({'where':{'id':_0x3901f8[_0x0e3c('0x49')]['id']}})[_0x0e3c('0x24')](handleEntityNotFound(_0x16235c,null))[_0x0e3c('0x24')](saveUpdates(_0x3901f8['body'],null))[_0x0e3c('0x24')](respondWithResult(_0x16235c,null))[_0x0e3c('0x46')](handleError(_0x16235c,null));};exports[_0x0e3c('0x23')]=function(_0x33b148,_0x247bff){return db[_0x0e3c('0x29')][_0x0e3c('0x45')]({'where':{'id':_0x33b148['params']['id']}})[_0x0e3c('0x24')](handleEntityNotFound(_0x247bff,null))[_0x0e3c('0x24')](removeEntity(_0x247bff,null))['catch'](handleError(_0x247bff,null));};exports['getConfigurations']=function(_0xad300a,_0x584b25,_0x2d086e){var _0x123dda={};var _0x51699f={};var _0x2402fc;var _0x13afe3;return db[_0x0e3c('0x29')][_0x0e3c('0x4a')]({'where':{'id':_0xad300a[_0x0e3c('0x49')]['id']}})[_0x0e3c('0x24')](handleEntityNotFound(_0x584b25,null))[_0x0e3c('0x24')](function(_0x5e6139){if(_0x5e6139){_0x2402fc=_0x5e6139;_0x51699f[_0x0e3c('0x2e')]=_[_0x0e3c('0x30')](db[_0x0e3c('0x4b')][_0x0e3c('0x2a')]);_0x51699f[_0x0e3c('0x2f')]=_[_0x0e3c('0x30')](_0xad300a['query']);_0x51699f[_0x0e3c('0x3a')]=_[_0x0e3c('0x31')](_0x51699f[_0x0e3c('0x2e')],_0x51699f[_0x0e3c('0x2f')]);_0x123dda['attributes']=_[_0x0e3c('0x31')](_0x51699f[_0x0e3c('0x2e')],qs[_0x0e3c('0x33')](_0xad300a[_0x0e3c('0x2f')][_0x0e3c('0x33')]));_0x123dda[_0x0e3c('0x32')]=_0x123dda[_0x0e3c('0x32')]['length']?_0x123dda[_0x0e3c('0x32')]:_0x51699f[_0x0e3c('0x2e')];_0x123dda[_0x0e3c('0x38')]=qs[_0x0e3c('0x39')](_0xad300a[_0x0e3c('0x2f')][_0x0e3c('0x39')]);_0x123dda[_0x0e3c('0x3d')]=qs[_0x0e3c('0x3a')](_['pick'](_0xad300a[_0x0e3c('0x2f')],_0x51699f['filters']));if(_0xad300a[_0x0e3c('0x2f')][_0x0e3c('0x3c')]){_0x123dda[_0x0e3c('0x3d')]=_[_0x0e3c('0x3e')](_0x123dda[_0x0e3c('0x3d')],{'$or':_[_0x0e3c('0x28')](_0x123dda['attributes'],function(_0x2ed99c){var _0x3c222e={};_0x3c222e[_0x2ed99c]={'$like':'%'+_0xad300a['query'][_0x0e3c('0x3c')]+'%'};return _0x3c222e;})});}_0x123dda=_[_0x0e3c('0x3e')]({},_0x123dda,_0xad300a[_0x0e3c('0x40')]);return _0x2402fc[_0x0e3c('0x4c')](_0x123dda);}})[_0x0e3c('0x24')](function(_0x50fe0c){if(_0x50fe0c){_0x13afe3=_0x50fe0c[_0x0e3c('0x34')];if(!_0xad300a[_0x0e3c('0x2f')][_0x0e3c('0x35')](_0x0e3c('0x36'))){_0x123dda[_0x0e3c('0x1c')]=qs[_0x0e3c('0x1c')](_0xad300a['query'][_0x0e3c('0x1c')]);_0x123dda[_0x0e3c('0x37')]=qs[_0x0e3c('0x37')](_0xad300a[_0x0e3c('0x2f')][_0x0e3c('0x37')]);}return _0x2402fc[_0x0e3c('0x4c')](_0x123dda);}})[_0x0e3c('0x24')](function(_0x53b363){if(_0x53b363){return _0x53b363?{'count':_0x13afe3,'rows':_0x53b363}:null;}})[_0x0e3c('0x24')](respondWithResult(_0x584b25,null))[_0x0e3c('0x46')](handleError(_0x584b25,null));};exports[_0x0e3c('0x4d')]=function(_0x56293e,_0x33aee8,_0x3a3172){if(_0x56293e[_0x0e3c('0x48')]['id']){delete _0x56293e['body']['id'];}return db[_0x0e3c('0x29')][_0x0e3c('0x4a')]({'where':{'id':_0x56293e[_0x0e3c('0x49')]['id']}})['then'](handleEntityNotFound(_0x33aee8,null))[_0x0e3c('0x24')](function(_0x750bf1){if(_0x750bf1){_0x56293e['body'][_0x0e3c('0x4e')]=_0x750bf1['id'];_0x56293e[_0x0e3c('0x48')]['Subjects']=integrations[_0x0e3c('0x4f')](_0x56293e[_0x0e3c('0x48')][_0x0e3c('0x50')],_0x56293e[_0x0e3c('0x48')]['type']);_0x56293e[_0x0e3c('0x48')][_0x0e3c('0x51')]=integrations['getDescriptions'](_0x56293e[_0x0e3c('0x48')]['channel'],_0x56293e['body'][_0x0e3c('0x2c')]);return db[_0x0e3c('0x4b')]['create'](_0x56293e[_0x0e3c('0x48')],{'include':[{'model':db[_0x0e3c('0x52')],'as':_0x0e3c('0x53')},{'model':db['SalesforceField'],'as':_0x0e3c('0x51')}]});}return null;})['then'](respondWithResult(_0x33aee8,null))[_0x0e3c('0x46')](handleError(_0x33aee8,null));};exports[_0x0e3c('0x54')]=function(_0x5a3d43,_0x48cf7f,_0x528d4c){var _0x556d22;var _0x14ba34='';var _0x199c6a=_0x0e3c('0x55');return db[_0x0e3c('0x29')][_0x0e3c('0x4a')]({'where':{'id':_0x5a3d43[_0x0e3c('0x49')]['id']},'attributes':['id',_0x0e3c('0x56'),_0x0e3c('0x57'),_0x0e3c('0x58'),'username',_0x0e3c('0x59'),_0x0e3c('0x5a')]})['then'](handleEntityNotFound(_0x48cf7f,null))[_0x0e3c('0x24')](function(_0x5a778e){if(_0x5a778e){_0x14ba34=_0x5a778e['remoteUri'];var _0xc6be10=_0x14ba34[_0x0e3c('0x5b')](-0x1);if(_0xc6be10==='/'){_0x14ba34=_0x14ba34[_0x0e3c('0x5c')](0x0,_0x14ba34[_0x0e3c('0x5d')](_0xc6be10));}_0x556d22=new jsforce[(_0x0e3c('0x5e'))]({'oauth2':{'loginUrl':_0x14ba34,'clientId':_0x5a778e[_0x0e3c('0x57')],'clientSecret':_0x5a778e[_0x0e3c('0x58')]}});return _0x556d22[_0x0e3c('0x5f')](_0x5a778e[_0x0e3c('0x60')],_0x5a778e[_0x0e3c('0x59')][_0x0e3c('0x61')](_0x5a778e[_0x0e3c('0x5a')]));}})['then'](function(_0x3321b7){if(_0x3321b7){if(!_[_0x0e3c('0x62')](_0x5a3d43[_0x0e3c('0x2f')][_0x0e3c('0x63')])){_0x199c6a=_0x5a3d43[_0x0e3c('0x2f')]['ticketType'];}return _0x556d22['sobject'](_0x199c6a)[_0x0e3c('0x64')]();}})[_0x0e3c('0x24')](function(_0x2b76c2){var _0x1c34bf=[_0x0e3c('0x65'),_0x0e3c('0x66'),_0x0e3c('0x67'),_0x0e3c('0x68'),_0x0e3c('0x69'),'Description'];var _0x3e40a1=[_0x0e3c('0x6a'),'int',_0x0e3c('0x6b'),_0x0e3c('0x6c'),_0x0e3c('0x6d'),_0x0e3c('0x6e'),_0x0e3c('0x6f')];if(_0x2b76c2){_[_0x0e3c('0x70')](_0x2b76c2[_0x0e3c('0x33')],function(_0x38a444){return _0x1c34bf[_0x0e3c('0x71')](_0x38a444[_0x0e3c('0x27')])||!_0x3e40a1[_0x0e3c('0x71')](_0x38a444[_0x0e3c('0x2c')]);});return{'count':_0x2b76c2['fields'][_0x0e3c('0x34')],'rows':_['map'](_0x2b76c2[_0x0e3c('0x33')],function(_0x15410e){return{'id':_0x15410e[_0x0e3c('0x27')],'name':_0x15410e[_0x0e3c('0x72')],'custom':_0x15410e[_0x0e3c('0x73')],'options':_0x15410e['picklistValues'][_0x0e3c('0x34')]>0x0?_[_0x0e3c('0x28')](_0x15410e[_0x0e3c('0x74')],function(_0x52b557){return{'name':_0x52b557[_0x0e3c('0x72')],'value':_0x52b557['value']};}):_0x15410e[_0x0e3c('0x2c')]==_0x0e3c('0x6c')?[{'name':_0x0e3c('0x75'),'value':_0x0e3c('0x76')},{'name':_0x0e3c('0x77'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x48cf7f,null))[_0x0e3c('0x46')](function(_0x39a915){var _0x46a623=_0x5a3d43[_0x0e3c('0x2f')][_0x0e3c('0x78')]?0x1f4:_0x39a915[_0x0e3c('0x79')]||0x1f4;logger[_0x0e3c('0x25')](_0x0e3c('0x7a'),_0x0e3c('0x54'),_0x46a623,JSON[_0x0e3c('0x7b')](_0x39a915));delete _0x39a915[_0x0e3c('0x27')];if(_0x46a623===0x191){_0x46a623=0x190;}_0x48cf7f[_0x0e3c('0x17')](_0x46a623)[_0x0e3c('0x7c')](_0x5a3d43[_0x0e3c('0x2f')][_0x0e3c('0x78')]?{'message':_0x0e3c('0x7d'),'statusCode':_0x39a915[_0x0e3c('0x79')]}:_0x39a915);});}; \ No newline at end of file +var _0x824e=['SalesforceAccount','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','getConfigurations','SalesforceConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','string','picklist','email','remove','includes','label','custom','picklistValues','True','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map'];(function(_0x5c40e3,_0x14e4c1){var _0x3cddb8=function(_0x4c1e8d){while(--_0x4c1e8d){_0x5c40e3['push'](_0x5c40e3['shift']());}};_0x3cddb8(++_0x14e4c1);}(_0x824e,0xc4));var _0xe824=function(_0x157d23,_0x4027b9){_0x157d23=_0x157d23-0x0;var _0x5b93cc=_0x824e[_0x157d23];return _0x5b93cc;};'use strict';var emlformat=require(_0xe824('0x0'));var rimraf=require(_0xe824('0x1'));var zipdir=require(_0xe824('0x2'));var jsonpatch=require(_0xe824('0x3'));var rp=require(_0xe824('0x4'));var moment=require(_0xe824('0x5'));var BPromise=require(_0xe824('0x6'));var Mustache=require(_0xe824('0x7'));var util=require(_0xe824('0x8'));var path=require('path');var sox=require(_0xe824('0x9'));var csv=require('to-csv');var ejs=require(_0xe824('0xa'));var fs=require('fs');var fs_extra=require(_0xe824('0xb'));var _=require('lodash');var squel=require(_0xe824('0xc'));var crypto=require(_0xe824('0xd'));var jsforce=require(_0xe824('0xe'));var deskjs=require(_0xe824('0xf'));var toCsv=require(_0xe824('0x10'));var querystring=require(_0xe824('0x11'));var Papa=require(_0xe824('0x12'));var Redis=require(_0xe824('0x13'));var authService=require(_0xe824('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe824('0x15'));var hardwareService=require(_0xe824('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe824('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe824('0x18'))['db'];var integrations=require(_0xe824('0x19'));function respondWithStatusCode(_0xd7dbd1,_0x476bbc){_0x476bbc=_0x476bbc||0xcc;return function(_0x507704){if(_0x507704){return _0xd7dbd1['sendStatus'](_0x476bbc);}return _0xd7dbd1[_0xe824('0x1a')](_0x476bbc)[_0xe824('0x1b')]();};}function respondWithResult(_0x2e0713,_0x25dea6){_0x25dea6=_0x25dea6||0xc8;return function(_0x506de6){if(_0x506de6){return _0x2e0713[_0xe824('0x1a')](_0x25dea6)['json'](_0x506de6);}};}function respondWithFilteredResult(_0x46c971,_0x4bf02d){return function(_0x52887a){if(_0x52887a){var _0x184d27=typeof _0x4bf02d['offset']===_0xe824('0x1c')&&typeof _0x4bf02d[_0xe824('0x1d')]===_0xe824('0x1c');var _0x52ddfc=_0x52887a[_0xe824('0x1e')];var _0x279bc5=_0x184d27?0x0:_0x4bf02d[_0xe824('0x1f')];var _0x3be7e7=_0x184d27?_0x52887a['count']:_0x4bf02d[_0xe824('0x1f')]+_0x4bf02d['limit'];var _0x5e38c6;if(_0x3be7e7>=_0x52ddfc){_0x3be7e7=_0x52ddfc;_0x5e38c6=0xc8;}else{_0x5e38c6=0xce;}_0x46c971['status'](_0x5e38c6);return _0x46c971[_0xe824('0x20')]('Content-Range',_0x279bc5+'-'+_0x3be7e7+'/'+_0x52ddfc)['json'](_0x52887a);}return null;};}function patchUpdates(_0x7b42f3){return function(_0x48b120){try{jsonpatch[_0xe824('0x21')](_0x48b120,_0x7b42f3,!![]);}catch(_0x11655c){return BPromise[_0xe824('0x22')](_0x11655c);}return _0x48b120['save']();};}function saveUpdates(_0x1c4c7e,_0x7ac1e7){return function(_0x598893){if(_0x598893){return _0x598893[_0xe824('0x23')](_0x1c4c7e)[_0xe824('0x24')](function(_0x3f0416){return _0x3f0416;});}return null;};}function removeEntity(_0x58cfbe,_0xf221bf){return function(_0x285fdd){if(_0x285fdd){return _0x285fdd[_0xe824('0x25')]()[_0xe824('0x24')](function(){_0x58cfbe[_0xe824('0x1a')](0xcc)[_0xe824('0x1b')]();});}};}function handleEntityNotFound(_0x2e9a46,_0x44b78b){return function(_0x2d864c){if(!_0x2d864c){_0x2e9a46[_0xe824('0x26')](0x194);}return _0x2d864c;};}function handleError(_0x495259,_0x100b8a){_0x100b8a=_0x100b8a||0x1f4;return function(_0x5c3f98){logger[_0xe824('0x27')](_0x5c3f98[_0xe824('0x28')]);if(_0x5c3f98[_0xe824('0x29')]){delete _0x5c3f98[_0xe824('0x29')];}_0x495259['status'](_0x100b8a)['send'](_0x5c3f98);};}exports[_0xe824('0x2a')]=function(_0x1bf0dc,_0x36e146){var _0x187bf5={},_0x30187b={},_0x582ffc={'count':0x0,'rows':[]};var _0x222cd9=_[_0xe824('0x2b')](db[_0xe824('0x2c')]['rawAttributes'],function(_0x51fc89){return{'name':_0x51fc89['fieldName'],'type':_0x51fc89[_0xe824('0x2d')][_0xe824('0x2e')]};});_0x30187b[_0xe824('0x2f')]=_[_0xe824('0x2b')](_0x222cd9,'name');_0x30187b['query']=_['keys'](_0x1bf0dc[_0xe824('0x30')]);_0x30187b[_0xe824('0x31')]=_[_0xe824('0x32')](_0x30187b[_0xe824('0x2f')],_0x30187b['query']);_0x187bf5['attributes']=_[_0xe824('0x32')](_0x30187b['model'],qs['fields'](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x33')]));_0x187bf5[_0xe824('0x34')]=_0x187bf5['attributes'][_0xe824('0x35')]?_0x187bf5[_0xe824('0x34')]:_0x30187b['model'];if(!_0x1bf0dc['query'][_0xe824('0x36')](_0xe824('0x37'))){_0x187bf5['limit']=qs[_0xe824('0x1d')](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x1d')]);_0x187bf5[_0xe824('0x1f')]=qs[_0xe824('0x1f')](_0x1bf0dc['query'][_0xe824('0x1f')]);}_0x187bf5[_0xe824('0x38')]=qs['sort'](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x39')]);_0x187bf5[_0xe824('0x3a')]=qs[_0xe824('0x31')](_['pick'](_0x1bf0dc['query'],_0x30187b[_0xe824('0x31')]),_0x222cd9);if(_0x1bf0dc[_0xe824('0x30')]['filter']){_0x187bf5['where']=_[_0xe824('0x3b')](_0x187bf5[_0xe824('0x3a')],{'$or':_[_0xe824('0x2b')](_0x222cd9,function(_0x2302bc){if(_0x2302bc[_0xe824('0x2d')]!==_0xe824('0x3c')){var _0x3f18da={};_0x3f18da[_0x2302bc[_0xe824('0x29')]]={'$like':'%'+_0x1bf0dc[_0xe824('0x30')][_0xe824('0x3d')]+'%'};return _0x3f18da;}})});}_0x187bf5=_[_0xe824('0x3b')]({},_0x187bf5,_0x1bf0dc[_0xe824('0x3e')]);var _0x4324b7={'where':_0x187bf5['where']};return db[_0xe824('0x2c')][_0xe824('0x1e')](_0x4324b7)[_0xe824('0x24')](function(_0x239c86){_0x582ffc[_0xe824('0x1e')]=_0x239c86;if(_0x1bf0dc['query'][_0xe824('0x3f')]){_0x187bf5['include']=[{'all':!![]}];}return db[_0xe824('0x2c')][_0xe824('0x40')](_0x187bf5);})[_0xe824('0x24')](function(_0x47cd74){_0x582ffc[_0xe824('0x41')]=_0x47cd74;return _0x582ffc;})[_0xe824('0x24')](respondWithFilteredResult(_0x36e146,_0x187bf5))[_0xe824('0x42')](handleError(_0x36e146,null));};exports[_0xe824('0x43')]=function(_0xc0f0f5,_0x36b300){var _0xa09c8b={'raw':![],'where':{'id':_0xc0f0f5['params']['id']}},_0xbb5cae={};_0xbb5cae[_0xe824('0x2f')]=_[_0xe824('0x44')](db[_0xe824('0x2c')][_0xe824('0x45')]);_0xbb5cae['query']=_[_0xe824('0x44')](_0xc0f0f5[_0xe824('0x30')]);_0xbb5cae['filters']=_['intersection'](_0xbb5cae[_0xe824('0x2f')],_0xbb5cae[_0xe824('0x30')]);_0xa09c8b[_0xe824('0x34')]=_[_0xe824('0x32')](_0xbb5cae[_0xe824('0x2f')],qs[_0xe824('0x33')](_0xc0f0f5[_0xe824('0x30')][_0xe824('0x33')]));_0xa09c8b[_0xe824('0x34')]=_0xa09c8b[_0xe824('0x34')][_0xe824('0x35')]?_0xa09c8b[_0xe824('0x34')]:_0xbb5cae[_0xe824('0x2f')];if(_0xc0f0f5[_0xe824('0x30')][_0xe824('0x3f')]){_0xa09c8b[_0xe824('0x46')]=[{'all':!![]}];}_0xa09c8b=_['merge']({},_0xa09c8b,_0xc0f0f5[_0xe824('0x3e')]);return db[_0xe824('0x2c')][_0xe824('0x47')](_0xa09c8b)[_0xe824('0x24')](handleEntityNotFound(_0x36b300,null))[_0xe824('0x24')](respondWithResult(_0x36b300,null))[_0xe824('0x42')](handleError(_0x36b300,null));};exports[_0xe824('0x48')]=function(_0x4a5348,_0x257180){return db['SalesforceAccount'][_0xe824('0x48')](_0x4a5348[_0xe824('0x49')],{})[_0xe824('0x24')](respondWithResult(_0x257180,0xc9))[_0xe824('0x42')](handleError(_0x257180,null));};exports[_0xe824('0x23')]=function(_0x128a81,_0x4aa30b){if(_0x128a81[_0xe824('0x49')]['id']){delete _0x128a81[_0xe824('0x49')]['id'];}return db[_0xe824('0x2c')][_0xe824('0x47')]({'where':{'id':_0x128a81[_0xe824('0x4a')]['id']}})[_0xe824('0x24')](handleEntityNotFound(_0x4aa30b,null))[_0xe824('0x24')](saveUpdates(_0x128a81[_0xe824('0x49')],null))[_0xe824('0x24')](respondWithResult(_0x4aa30b,null))[_0xe824('0x42')](handleError(_0x4aa30b,null));};exports[_0xe824('0x25')]=function(_0xc6bd17,_0x2d8ec9){return db[_0xe824('0x2c')][_0xe824('0x47')]({'where':{'id':_0xc6bd17[_0xe824('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d8ec9,null))[_0xe824('0x24')](removeEntity(_0x2d8ec9,null))[_0xe824('0x42')](handleError(_0x2d8ec9,null));};exports[_0xe824('0x4b')]=function(_0x45c94d,_0x5759f7,_0x4d6045){var _0xf2c50={};var _0x4acbab={};var _0x1b2f05;var _0x1224b2;return db[_0xe824('0x2c')]['findOne']({'where':{'id':_0x45c94d['params']['id']}})['then'](handleEntityNotFound(_0x5759f7,null))[_0xe824('0x24')](function(_0x34b2fe){if(_0x34b2fe){_0x1b2f05=_0x34b2fe;_0x4acbab[_0xe824('0x2f')]=_[_0xe824('0x44')](db[_0xe824('0x4c')]['rawAttributes']);_0x4acbab[_0xe824('0x30')]=_[_0xe824('0x44')](_0x45c94d['query']);_0x4acbab['filters']=_[_0xe824('0x32')](_0x4acbab['model'],_0x4acbab[_0xe824('0x30')]);_0xf2c50[_0xe824('0x34')]=_['intersection'](_0x4acbab[_0xe824('0x2f')],qs[_0xe824('0x33')](_0x45c94d['query']['fields']));_0xf2c50[_0xe824('0x34')]=_0xf2c50['attributes'][_0xe824('0x35')]?_0xf2c50['attributes']:_0x4acbab[_0xe824('0x2f')];_0xf2c50['order']=qs[_0xe824('0x39')](_0x45c94d[_0xe824('0x30')][_0xe824('0x39')]);_0xf2c50[_0xe824('0x3a')]=qs[_0xe824('0x31')](_[_0xe824('0x4d')](_0x45c94d['query'],_0x4acbab[_0xe824('0x31')]));if(_0x45c94d[_0xe824('0x30')][_0xe824('0x3d')]){_0xf2c50[_0xe824('0x3a')]=_['merge'](_0xf2c50[_0xe824('0x3a')],{'$or':_[_0xe824('0x2b')](_0xf2c50[_0xe824('0x34')],function(_0x40c858){var _0x4f12f3={};_0x4f12f3[_0x40c858]={'$like':'%'+_0x45c94d[_0xe824('0x30')][_0xe824('0x3d')]+'%'};return _0x4f12f3;})});}_0xf2c50=_[_0xe824('0x3b')]({},_0xf2c50,_0x45c94d[_0xe824('0x3e')]);return _0x1b2f05[_0xe824('0x4b')](_0xf2c50);}})[_0xe824('0x24')](function(_0x14b104){if(_0x14b104){_0x1224b2=_0x14b104[_0xe824('0x35')];if(!_0x45c94d['query'][_0xe824('0x36')](_0xe824('0x37'))){_0xf2c50['limit']=qs[_0xe824('0x1d')](_0x45c94d[_0xe824('0x30')][_0xe824('0x1d')]);_0xf2c50[_0xe824('0x1f')]=qs[_0xe824('0x1f')](_0x45c94d[_0xe824('0x30')]['offset']);}return _0x1b2f05[_0xe824('0x4b')](_0xf2c50);}})[_0xe824('0x24')](function(_0x100aff){if(_0x100aff){return _0x100aff?{'count':_0x1224b2,'rows':_0x100aff}:null;}})[_0xe824('0x24')](respondWithResult(_0x5759f7,null))['catch'](handleError(_0x5759f7,null));};exports[_0xe824('0x4e')]=function(_0x29b3ef,_0x1f392d,_0x3d4c41){if(_0x29b3ef[_0xe824('0x49')]['id']){delete _0x29b3ef[_0xe824('0x49')]['id'];}return db[_0xe824('0x2c')][_0xe824('0x4f')]({'where':{'id':_0x29b3ef['params']['id']}})['then'](handleEntityNotFound(_0x1f392d,null))[_0xe824('0x24')](function(_0x5b0eee){if(_0x5b0eee){_0x29b3ef['body'][_0xe824('0x50')]=_0x5b0eee['id'];_0x29b3ef[_0xe824('0x49')][_0xe824('0x51')]=integrations[_0xe824('0x52')](_0x29b3ef[_0xe824('0x49')]['channel'],_0x29b3ef[_0xe824('0x49')][_0xe824('0x2d')]);_0x29b3ef['body'][_0xe824('0x53')]=integrations['getDescriptions'](_0x29b3ef[_0xe824('0x49')]['channel'],_0x29b3ef[_0xe824('0x49')][_0xe824('0x2d')]);return db[_0xe824('0x4c')][_0xe824('0x48')](_0x29b3ef['body'],{'include':[{'model':db[_0xe824('0x54')],'as':'Subjects'},{'model':db[_0xe824('0x54')],'as':'Descriptions'}]});}return null;})[_0xe824('0x24')](respondWithResult(_0x1f392d,null))[_0xe824('0x42')](handleError(_0x1f392d,null));};exports['getFields']=function(_0x116429,_0x4ee88c,_0x87bbdb){var _0x1bc5b9;var _0x4ab1b3='';var _0x587241=_0xe824('0x55');return db[_0xe824('0x2c')][_0xe824('0x4f')]({'where':{'id':_0x116429[_0xe824('0x4a')]['id']},'attributes':['id','remoteUri',_0xe824('0x56'),_0xe824('0x57'),_0xe824('0x58'),_0xe824('0x59'),_0xe824('0x5a')]})[_0xe824('0x24')](handleEntityNotFound(_0x4ee88c,null))[_0xe824('0x24')](function(_0x2d9ba6){if(_0x2d9ba6){_0x4ab1b3=_0x2d9ba6[_0xe824('0x5b')];var _0x1283a6=_0x4ab1b3[_0xe824('0x5c')](-0x1);if(_0x1283a6==='/'){_0x4ab1b3=_0x4ab1b3['substring'](0x0,_0x4ab1b3[_0xe824('0x5d')](_0x1283a6));}_0x1bc5b9=new jsforce[(_0xe824('0x5e'))]({'oauth2':{'loginUrl':_0x4ab1b3,'clientId':_0x2d9ba6[_0xe824('0x56')],'clientSecret':_0x2d9ba6[_0xe824('0x57')]}});return _0x1bc5b9['login'](_0x2d9ba6[_0xe824('0x58')],_0x2d9ba6['password'][_0xe824('0x5f')](_0x2d9ba6[_0xe824('0x5a')]));}})[_0xe824('0x24')](function(_0xf42ea1){if(_0xf42ea1){if(!_[_0xe824('0x60')](_0x116429[_0xe824('0x30')][_0xe824('0x61')])){_0x587241=_0x116429[_0xe824('0x30')][_0xe824('0x61')];}return _0x1bc5b9[_0xe824('0x62')](_0x587241)[_0xe824('0x63')]();}})['then'](function(_0x36bd99){var _0x383558=[_0xe824('0x64'),_0xe824('0x65'),'IsReminderSet',_0xe824('0x66'),_0xe824('0x67'),'Description'];var _0x5be038=[_0xe824('0x68'),'int',_0xe824('0x69'),'boolean',_0xe824('0x6a'),'textarea','phone'];if(_0x36bd99){_[_0xe824('0x6b')](_0x36bd99[_0xe824('0x33')],function(_0xdb93e7){return _0x383558[_0xe824('0x6c')](_0xdb93e7['name'])||!_0x5be038['includes'](_0xdb93e7['type']);});return{'count':_0x36bd99[_0xe824('0x33')][_0xe824('0x35')],'rows':_[_0xe824('0x2b')](_0x36bd99[_0xe824('0x33')],function(_0x26cbaa){return{'id':_0x26cbaa[_0xe824('0x29')],'name':_0x26cbaa[_0xe824('0x6d')],'custom':_0x26cbaa[_0xe824('0x6e')],'options':_0x26cbaa['picklistValues'][_0xe824('0x35')]>0x0?_[_0xe824('0x2b')](_0x26cbaa[_0xe824('0x6f')],function(_0x333650){return{'name':_0x333650['label'],'value':_0x333650['value']};}):_0x26cbaa[_0xe824('0x2d')]=='boolean'?[{'name':_0xe824('0x70'),'value':'true'},{'name':_0xe824('0x71'),'value':_0xe824('0x72')}]:[]};})};}})['then'](respondWithResult(_0x4ee88c,null))[_0xe824('0x42')](function(_0x37eb4d){var _0x55cca1=_0x116429['query']['test']?0x1f4:_0x37eb4d['statusCode']||0x1f4;logger[_0xe824('0x27')](_0xe824('0x73'),'getFields',_0x55cca1,JSON[_0xe824('0x74')](_0x37eb4d));delete _0x37eb4d[_0xe824('0x29')];if(_0x55cca1===0x191){_0x55cca1=0x190;}_0x4ee88c['status'](_0x55cca1)['send'](_0x116429[_0xe824('0x30')][_0xe824('0x75')]?{'message':_0xe824('0x76'),'statusCode':_0x37eb4d[_0xe824('0x77')]}:_0x37eb4d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index d94f410..942e788 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 _0x5912=['int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x51950d,_0x23f4ca){var _0xe2441=function(_0x2a2839){while(--_0x2a2839){_0x51950d['push'](_0x51950d['shift']());}};_0xe2441(++_0x23f4ca);}(_0x5912,0x1cf));var _0x2591=function(_0x56c06e,_0x43a567){_0x56c06e=_0x56c06e-0x0;var _0x46471f=_0x5912[_0x56c06e];return _0x46471f;};'use strict';var _=require(_0x2591('0x0'));var util=require('util');var logger=require(_0x2591('0x1'))(_0x2591('0x2'));var moment=require(_0x2591('0x3'));var BPromise=require(_0x2591('0x4'));var rp=require(_0x2591('0x5'));var fs=require('fs');var path=require(_0x2591('0x6'));var rimraf=require(_0x2591('0x7'));var config=require('../../config/environment');var attributes=require(_0x2591('0x8'));var integrations=require(_0x2591('0x9'));module[_0x2591('0xa')]=function(_0x4c3d3e,_0x41598e){return _0x4c3d3e[_0x2591('0xb')](_0x2591('0xc'),attributes,{'tableName':_0x2591('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0af9=['exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x1e2ee8,_0x51bb43){var _0x1134b5=function(_0x1fec42){while(--_0x1fec42){_0x1e2ee8['push'](_0x1e2ee8['shift']());}};_0x1134b5(++_0x51bb43);}(_0x0af9,0xb9));var _0x90af=function(_0x41c9fe,_0x12c7e4){_0x41c9fe=_0x41c9fe-0x0;var _0x146d93=_0x0af9[_0x41c9fe];return _0x146d93;};'use strict';var _=require(_0x90af('0x0'));var util=require(_0x90af('0x1'));var logger=require(_0x90af('0x2'))(_0x90af('0x3'));var moment=require('moment');var BPromise=require(_0x90af('0x4'));var rp=require(_0x90af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90af('0x6'));var config=require(_0x90af('0x7'));var attributes=require(_0x90af('0x8'));var integrations=require(_0x90af('0x9'));module[_0x90af('0xa')]=function(_0x29a4c7,_0xec8217){return _0x29a4c7[_0x90af('0xb')]('SalesforceAccount',attributes,{'tableName':_0x90af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 7c65e70..3cce495 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 _0x84cd=['limit','map','include','model','GetSalesforceAccount','catch','find','ShowSalesforceAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','findAll','options','where','attributes'];(function(_0x3a7fe5,_0x371426){var _0x18ed66=function(_0x4f6a16){while(--_0x4f6a16){_0x3a7fe5['push'](_0x3a7fe5['shift']());}};_0x18ed66(++_0x371426);}(_0x84cd,0xb2));var _0xd84c=function(_0x2a539c,_0x345db4){_0x2a539c=_0x2a539c-0x0;var _0x5ed013=_0x84cd[_0x2a539c];return _0x5ed013;};'use strict';var _=require(_0xd84c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd84c('0x1'));var rs=require(_0xd84c('0x2'));var fs=require('fs');var Redis=require(_0xd84c('0x3'));var db=require(_0xd84c('0x4'))['db'];var utils=require(_0xd84c('0x5'));var logger=require(_0xd84c('0x6'))(_0xd84c('0x7'));var config=require(_0xd84c('0x8'));var jayson=require(_0xd84c('0x9'));var client=jayson['client'][_0xd84c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b06c7,_0x21d7a9,_0x17337a){return new BPromise(function(_0x5b9c59,_0x5bacf7){return client[_0xd84c('0xb')](_0x1b06c7,_0x17337a)[_0xd84c('0xc')](function(_0x5e2e0b){logger['info'](_0xd84c('0xd'),_0x21d7a9,_0xd84c('0xe'));logger[_0xd84c('0xf')](_0xd84c('0x10'),_0x21d7a9,_0xd84c('0xe'),JSON[_0xd84c('0x11')](_0x5e2e0b));if(_0x5e2e0b[_0xd84c('0x12')]){if(_0x5e2e0b['error']['code']===0x1f4){logger[_0xd84c('0x12')](_0xd84c('0xd'),_0x21d7a9,_0x5e2e0b['error'][_0xd84c('0x13')]);return _0x5bacf7(_0x5e2e0b['error'][_0xd84c('0x13')]);}logger[_0xd84c('0x12')](_0xd84c('0xd'),_0x21d7a9,_0x5e2e0b['error'][_0xd84c('0x13')]);return _0x5b9c59(_0x5e2e0b[_0xd84c('0x12')][_0xd84c('0x13')]);}else{logger[_0xd84c('0x14')](_0xd84c('0xd'),_0x21d7a9,'request\x20sent');_0x5b9c59(_0x5e2e0b[_0xd84c('0x15')][_0xd84c('0x13')]);}})['catch'](function(_0x4a48bf){logger['error'](_0xd84c('0xd'),_0x21d7a9,_0x4a48bf);_0x5bacf7(_0x4a48bf);});});}exports['GetSalesforceAccount']=function(_0x3d8eda){var _0x4e1b15=this;return new Promise(function(_0x5c82c3,_0x3e7995){return db['SalesforceAccount'][_0xd84c('0x16')]({'raw':_0x3d8eda[_0xd84c('0x17')]?_0x3d8eda[_0xd84c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3d8eda['options']?_0x3d8eda[_0xd84c('0x17')][_0xd84c('0x18')]||null:null,'attributes':_0x3d8eda[_0xd84c('0x17')]?_0x3d8eda[_0xd84c('0x17')][_0xd84c('0x19')]||null:null,'limit':_0x3d8eda[_0xd84c('0x17')]?_0x3d8eda[_0xd84c('0x17')][_0xd84c('0x1a')]||null:null,'include':_0x3d8eda['options']?_0x3d8eda['options']['include']?_[_0xd84c('0x1b')](_0x3d8eda['options'][_0xd84c('0x1c')],function(_0x4c3204){return{'model':db[_0x4c3204['model']],'as':_0x4c3204['as'],'attributes':_0x4c3204[_0xd84c('0x19')],'include':_0x4c3204[_0xd84c('0x1c')]?_[_0xd84c('0x1b')](_0x4c3204[_0xd84c('0x1c')],function(_0x8e8c66){return{'model':db[_0x8e8c66['model']],'as':_0x8e8c66['as'],'attributes':_0x8e8c66[_0xd84c('0x19')],'include':_0x8e8c66[_0xd84c('0x1c')]?_['map'](_0x8e8c66[_0xd84c('0x1c')],function(_0x3c9f75){return{'model':db[_0x3c9f75[_0xd84c('0x1d')]],'as':_0x3c9f75['as'],'attributes':_0x3c9f75[_0xd84c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd84c('0xc')](function(_0x33245d){logger[_0xd84c('0x14')](_0xd84c('0x1e'),_0x3d8eda);logger[_0xd84c('0xf')](_0xd84c('0x1e'),_0x3d8eda,JSON[_0xd84c('0x11')](_0x33245d));_0x5c82c3(_0x33245d);})[_0xd84c('0x1f')](function(_0x3d5f19){logger['error']('GetSalesforceAccount',_0x3d5f19[_0xd84c('0x13')],_0x3d8eda);_0x3e7995(_0x4e1b15[_0xd84c('0x12')](0x1f4,_0x3d5f19[_0xd84c('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x58d730){var _0x5706a0=this;return new Promise(function(_0x9a3bba,_0x1ea6e4){return db['SalesforceAccount'][_0xd84c('0x20')]({'raw':_0x58d730[_0xd84c('0x17')]?_0x58d730['options']['raw']===undefined?!![]:![]:!![],'where':_0x58d730[_0xd84c('0x17')]?_0x58d730[_0xd84c('0x17')][_0xd84c('0x18')]||null:null,'attributes':_0x58d730[_0xd84c('0x17')]?_0x58d730['options'][_0xd84c('0x19')]||null:null,'include':_0x58d730[_0xd84c('0x17')]?_0x58d730[_0xd84c('0x17')][_0xd84c('0x1c')]?_[_0xd84c('0x1b')](_0x58d730[_0xd84c('0x17')]['include'],function(_0x395afc){return{'model':db[_0x395afc[_0xd84c('0x1d')]],'as':_0x395afc['as'],'attributes':_0x395afc[_0xd84c('0x19')],'include':_0x395afc['include']?_[_0xd84c('0x1b')](_0x395afc[_0xd84c('0x1c')],function(_0x548e89){return{'model':db[_0x548e89[_0xd84c('0x1d')]],'as':_0x548e89['as'],'attributes':_0x548e89[_0xd84c('0x19')],'include':_0x548e89[_0xd84c('0x1c')]?_[_0xd84c('0x1b')](_0x548e89['include'],function(_0x33ff96){return{'model':db[_0x33ff96[_0xd84c('0x1d')]],'as':_0x33ff96['as'],'attributes':_0x33ff96['attributes']};}):[]};}):[]};}):[]:[]})[_0xd84c('0xc')](function(_0x3c5b61){logger['info']('ShowSalesforceAccount',_0x58d730);logger[_0xd84c('0xf')]('ShowSalesforceAccount',_0x58d730,JSON[_0xd84c('0x11')](_0x3c5b61));_0x9a3bba(_0x3c5b61);})['catch'](function(_0x1cb2c9){logger[_0xd84c('0x12')](_0xd84c('0x21'),_0x1cb2c9[_0xd84c('0x13')],_0x58d730);_0x1ea6e4(_0x5706a0[_0xd84c('0x12')](0x1f4,_0x1cb2c9[_0xd84c('0x13')]));});});}; \ No newline at end of file +var _0x2bae=['attributes','limit','include','map','model','GetSalesforceAccount','debug','catch','ShowSalesforceAccount','where','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','SalesforceAccount','findAll','options','raw'];(function(_0xea9b1d,_0x422a8d){var _0x2a2ee6=function(_0x2a09a4){while(--_0x2a09a4){_0xea9b1d['push'](_0xea9b1d['shift']());}};_0x2a2ee6(++_0x422a8d);}(_0x2bae,0xe2));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2ba('0x3'));var fs=require('fs');var Redis=require(_0xe2ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2ba('0x5'));var logger=require(_0xe2ba('0x6'))(_0xe2ba('0x7'));var config=require(_0xe2ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe2ba('0x9')][_0xe2ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35ec31,_0x5a8154,_0x3a6bfd){return new BPromise(function(_0x2409b,_0x608b0f){return client[_0xe2ba('0xb')](_0x35ec31,_0x3a6bfd)[_0xe2ba('0xc')](function(_0x3ab464){logger[_0xe2ba('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));logger['debug'](_0xe2ba('0xf'),_0x5a8154,_0xe2ba('0xe'),JSON[_0xe2ba('0x10')](_0x3ab464));if(_0x3ab464[_0xe2ba('0x11')]){if(_0x3ab464[_0xe2ba('0x11')][_0xe2ba('0x12')]===0x1f4){logger[_0xe2ba('0x11')](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error'][_0xe2ba('0x14')]);return _0x608b0f(_0x3ab464[_0xe2ba('0x11')]['message']);}logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error']['message']);return _0x2409b(_0x3ab464['error'][_0xe2ba('0x14')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));_0x2409b(_0x3ab464[_0xe2ba('0x15')][_0xe2ba('0x14')]);}})['catch'](function(_0x29c4f6){logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x29c4f6);_0x608b0f(_0x29c4f6);});});}exports['GetSalesforceAccount']=function(_0x337454){var _0x2ef082=this;return new Promise(function(_0x526667,_0x472c03){return db[_0xe2ba('0x16')][_0xe2ba('0x17')]({'raw':_0x337454[_0xe2ba('0x18')]?_0x337454['options'][_0xe2ba('0x19')]===undefined?!![]:![]:!![],'where':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')]['where']||null:null,'attributes':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')][_0xe2ba('0x1a')]||null:null,'limit':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')][_0xe2ba('0x1b')]||null:null,'include':_0x337454[_0xe2ba('0x18')]?_0x337454['options'][_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x337454['options'][_0xe2ba('0x1c')],function(_0x1df864){return{'model':db[_0x1df864[_0xe2ba('0x1e')]],'as':_0x1df864['as'],'attributes':_0x1df864[_0xe2ba('0x1a')],'include':_0x1df864[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x1df864['include'],function(_0x4ec4f7){return{'model':db[_0x4ec4f7[_0xe2ba('0x1e')]],'as':_0x4ec4f7['as'],'attributes':_0x4ec4f7[_0xe2ba('0x1a')],'include':_0x4ec4f7[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x4ec4f7[_0xe2ba('0x1c')],function(_0x5d88c7){return{'model':db[_0x5d88c7[_0xe2ba('0x1e')]],'as':_0x5d88c7['as'],'attributes':_0x5d88c7[_0xe2ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2ba('0xc')](function(_0x59b99a){logger[_0xe2ba('0xd')](_0xe2ba('0x1f'),_0x337454);logger[_0xe2ba('0x20')](_0xe2ba('0x1f'),_0x337454,JSON[_0xe2ba('0x10')](_0x59b99a));_0x526667(_0x59b99a);})[_0xe2ba('0x21')](function(_0x3535bf){logger['error'](_0xe2ba('0x1f'),_0x3535bf[_0xe2ba('0x14')],_0x337454);_0x472c03(_0x2ef082[_0xe2ba('0x11')](0x1f4,_0x3535bf['message']));});});};exports[_0xe2ba('0x22')]=function(_0x145e5e){var _0x389e3c=this;return new Promise(function(_0x240cdd,_0xa1f582){return db[_0xe2ba('0x16')]['find']({'raw':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')][_0xe2ba('0x23')]||null:null,'attributes':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e['options'][_0xe2ba('0x1a')]||null:null,'include':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')][_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x145e5e[_0xe2ba('0x18')]['include'],function(_0x1509be){return{'model':db[_0x1509be[_0xe2ba('0x1e')]],'as':_0x1509be['as'],'attributes':_0x1509be[_0xe2ba('0x1a')],'include':_0x1509be[_0xe2ba('0x1c')]?_['map'](_0x1509be['include'],function(_0x291f41){return{'model':db[_0x291f41[_0xe2ba('0x1e')]],'as':_0x291f41['as'],'attributes':_0x291f41[_0xe2ba('0x1a')],'include':_0x291f41[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x291f41[_0xe2ba('0x1c')],function(_0x4d4c39){return{'model':db[_0x4d4c39[_0xe2ba('0x1e')]],'as':_0x4d4c39['as'],'attributes':_0x4d4c39[_0xe2ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2ba('0xc')](function(_0x5443bf){logger[_0xe2ba('0xd')](_0xe2ba('0x22'),_0x145e5e);logger[_0xe2ba('0x20')]('ShowSalesforceAccount',_0x145e5e,JSON[_0xe2ba('0x10')](_0x5443bf));_0x240cdd(_0x5443bf);})[_0xe2ba('0x21')](function(_0x5e8272){logger[_0xe2ba('0x11')](_0xe2ba('0x22'),_0x5e8272['message'],_0x145e5e);_0xa1f582(_0x389e3c[_0xe2ba('0x11')](0x1f4,_0x5e8272[_0xe2ba('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cf2d2a0..60b1c81 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 _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(_0x104a95,_0xe173a7){var _0x5455a0=function(_0x121cbc){while(--_0x121cbc){_0x104a95['push'](_0x104a95['shift']());}};_0x5455a0(++_0xe173a7);}(_0xadb5,0xad));var _0x5adb=function(_0x164e43,_0x59e14f){_0x164e43=_0x164e43-0x0;var _0x1f4502=_0xadb5[_0x164e43];return _0x1f4502;};'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 +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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb28,0x106));var _0x8db2=function(_0x13806a,_0x15b16e){_0x13806a=_0x13806a-0x0;var _0x3064dd=_0xdb28[_0x13806a];return _0x3064dd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 82d6c3d..6649eb2 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 _0x87cb=['ENUM','contact_lead','contact','lead','account','nothing','sequelize','STRING','Task'];(function(_0x55afb8,_0x1c17d2){var _0x4528d3=function(_0xe380ec){while(--_0xe380ec){_0x55afb8['push'](_0x55afb8['shift']());}};_0x4528d3(++_0x1c17d2);}(_0x87cb,0xc3));var _0xb87c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x87cb[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xb87c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb87c('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xb87c('0x2'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xb87c('0x3')](_0xb87c('0x4'),_0xb87c('0x5'),_0xb87c('0x6'),'account_contact_lead',_0xb87c('0x7')),'defaultValue':_0xb87c('0x4')},'moduleCreate':{'type':Sequelize[_0xb87c('0x3')](_0xb87c('0x8'),'contact','lead','account'),'defaultValue':_0xb87c('0x6')},'leadId':{'type':Sequelize[_0xb87c('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xb87c('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xb87c('0x1')]}}; \ No newline at end of file +var _0x1fc2=['lead','account_contact_lead','account','nothing','contact','sequelize','exports','STRING','Task','ENUM','contact_lead'];(function(_0xed1e61,_0xfefacc){var _0x2ef513=function(_0x4f861d){while(--_0x4f861d){_0xed1e61['push'](_0xed1e61['shift']());}};_0x2ef513(++_0xfefacc);}(_0x1fc2,0x123));var _0x21fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1fc2[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x21fc('0x0'));module[_0x21fc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21fc('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task','Case'),'defaultValue':_0x21fc('0x3')},'moduleSearch':{'type':Sequelize[_0x21fc('0x4')](_0x21fc('0x5'),'contact',_0x21fc('0x6'),_0x21fc('0x7'),_0x21fc('0x8')),'defaultValue':_0x21fc('0x5')},'moduleCreate':{'type':Sequelize[_0x21fc('0x4')](_0x21fc('0x9'),_0x21fc('0xa'),_0x21fc('0x6'),_0x21fc('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index fd4567b..05ed98a 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 _0xfd25=['index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','create','body','find','destroy','params','getFields','length','order','getSubjects','findOne','pick','getDescriptions','SalesforceField','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','stack','name','send'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfd25,0x169));var _0x5fd2=function(_0x34b81b,_0x266cb8){_0x34b81b=_0x34b81b-0x0;var _0x38cf88=_0xfd25[_0x34b81b];return _0x38cf88;};'use strict';var emlformat=require(_0x5fd2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5fd2('0x1'));var rp=require(_0x5fd2('0x2'));var moment=require(_0x5fd2('0x3'));var BPromise=require(_0x5fd2('0x4'));var Mustache=require(_0x5fd2('0x5'));var util=require(_0x5fd2('0x6'));var path=require('path');var sox=require(_0x5fd2('0x7'));var csv=require(_0x5fd2('0x8'));var ejs=require(_0x5fd2('0x9'));var fs=require('fs');var fs_extra=require(_0x5fd2('0xa'));var _=require(_0x5fd2('0xb'));var squel=require('squel');var crypto=require(_0x5fd2('0xc'));var jsforce=require(_0x5fd2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5fd2('0x8'));var querystring=require(_0x5fd2('0xe'));var Papa=require(_0x5fd2('0xf'));var Redis=require(_0x5fd2('0x10'));var authService=require(_0x5fd2('0x11'));var qs=require(_0x5fd2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fd2('0x13'))(_0x5fd2('0x14'));var utils=require('../../config/utils');var config=require(_0x5fd2('0x15'));var licenseUtil=require(_0x5fd2('0x16'));var db=require(_0x5fd2('0x17'))['db'];function respondWithStatusCode(_0x3aa4b5,_0x2b8bcc){_0x2b8bcc=_0x2b8bcc||0xcc;return function(_0x21e26d){if(_0x21e26d){return _0x3aa4b5[_0x5fd2('0x18')](_0x2b8bcc);}return _0x3aa4b5[_0x5fd2('0x19')](_0x2b8bcc)['end']();};}function respondWithResult(_0x1f3475,_0x411f65){_0x411f65=_0x411f65||0xc8;return function(_0x2228b2){if(_0x2228b2){return _0x1f3475[_0x5fd2('0x19')](_0x411f65)[_0x5fd2('0x1a')](_0x2228b2);}};}function respondWithFilteredResult(_0x34abb6,_0x200534){return function(_0x477e44){if(_0x477e44){var _0x55e5a9=typeof _0x200534['offset']===_0x5fd2('0x1b')&&typeof _0x200534[_0x5fd2('0x1c')]===_0x5fd2('0x1b');var _0x1f7d40=_0x477e44['count'];var _0x14170b=_0x55e5a9?0x0:_0x200534[_0x5fd2('0x1d')];var _0x5353f8=_0x55e5a9?_0x477e44['count']:_0x200534['offset']+_0x200534[_0x5fd2('0x1c')];var _0x4e46d1;if(_0x5353f8>=_0x1f7d40){_0x5353f8=_0x1f7d40;_0x4e46d1=0xc8;}else{_0x4e46d1=0xce;}_0x34abb6['status'](_0x4e46d1);return _0x34abb6[_0x5fd2('0x1e')](_0x5fd2('0x1f'),_0x14170b+'-'+_0x5353f8+'/'+_0x1f7d40)['json'](_0x477e44);}return null;};}function patchUpdates(_0x2b36bf){return function(_0x5bfe32){try{jsonpatch['apply'](_0x5bfe32,_0x2b36bf,!![]);}catch(_0x2908b9){return BPromise[_0x5fd2('0x20')](_0x2908b9);}return _0x5bfe32[_0x5fd2('0x21')]();};}function saveUpdates(_0x308be5,_0x490398){return function(_0x32889c){if(_0x32889c){return _0x32889c[_0x5fd2('0x22')](_0x308be5)[_0x5fd2('0x23')](function(_0x314bba){return _0x314bba;});}return null;};}function removeEntity(_0x23fe9b,_0x258b68){return function(_0x80e69a){if(_0x80e69a){return _0x80e69a['destroy']()['then'](function(){_0x23fe9b[_0x5fd2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f9e4,_0x377434){return function(_0x48cb79){if(!_0x48cb79){_0x18f9e4[_0x5fd2('0x18')](0x194);}return _0x48cb79;};}function handleError(_0x14b29f,_0x1862ec){_0x1862ec=_0x1862ec||0x1f4;return function(_0x10cfa7){logger['error'](_0x10cfa7[_0x5fd2('0x24')]);if(_0x10cfa7[_0x5fd2('0x25')]){delete _0x10cfa7[_0x5fd2('0x25')];}_0x14b29f[_0x5fd2('0x19')](_0x1862ec)[_0x5fd2('0x26')](_0x10cfa7);};}exports[_0x5fd2('0x27')]=function(_0x3988cb,_0x40d2d7){var _0x3fbf27={},_0x76278f={},_0x449257={'count':0x0,'rows':[]};var _0x2dd0e4=_[_0x5fd2('0x28')](db[_0x5fd2('0x29')][_0x5fd2('0x2a')],function(_0x3f7f4f){return{'name':_0x3f7f4f[_0x5fd2('0x2b')],'type':_0x3f7f4f[_0x5fd2('0x2c')]['key']};});_0x76278f[_0x5fd2('0x2d')]=_['map'](_0x2dd0e4,'name');_0x76278f[_0x5fd2('0x2e')]=_[_0x5fd2('0x2f')](_0x3988cb['query']);_0x76278f[_0x5fd2('0x30')]=_[_0x5fd2('0x31')](_0x76278f['model'],_0x76278f[_0x5fd2('0x2e')]);_0x3fbf27[_0x5fd2('0x32')]=_['intersection'](_0x76278f[_0x5fd2('0x2d')],qs[_0x5fd2('0x33')](_0x3988cb[_0x5fd2('0x2e')]['fields']));_0x3fbf27[_0x5fd2('0x32')]=_0x3fbf27[_0x5fd2('0x32')]['length']?_0x3fbf27[_0x5fd2('0x32')]:_0x76278f[_0x5fd2('0x2d')];if(!_0x3988cb[_0x5fd2('0x2e')][_0x5fd2('0x34')](_0x5fd2('0x35'))){_0x3fbf27['limit']=qs['limit'](_0x3988cb[_0x5fd2('0x2e')]['limit']);_0x3fbf27[_0x5fd2('0x1d')]=qs[_0x5fd2('0x1d')](_0x3988cb[_0x5fd2('0x2e')][_0x5fd2('0x1d')]);}_0x3fbf27['order']=qs[_0x5fd2('0x36')](_0x3988cb[_0x5fd2('0x2e')][_0x5fd2('0x36')]);_0x3fbf27[_0x5fd2('0x37')]=qs['filters'](_['pick'](_0x3988cb[_0x5fd2('0x2e')],_0x76278f[_0x5fd2('0x30')]),_0x2dd0e4);if(_0x3988cb[_0x5fd2('0x2e')][_0x5fd2('0x38')]){_0x3fbf27[_0x5fd2('0x37')]=_[_0x5fd2('0x39')](_0x3fbf27[_0x5fd2('0x37')],{'$or':_[_0x5fd2('0x28')](_0x2dd0e4,function(_0x9560ce){if(_0x9560ce[_0x5fd2('0x2c')]!==_0x5fd2('0x3a')){var _0x52106e={};_0x52106e[_0x9560ce[_0x5fd2('0x25')]]={'$like':'%'+_0x3988cb[_0x5fd2('0x2e')][_0x5fd2('0x38')]+'%'};return _0x52106e;}})});}_0x3fbf27=_[_0x5fd2('0x39')]({},_0x3fbf27,_0x3988cb[_0x5fd2('0x3b')]);var _0x5a0fec={'where':_0x3fbf27[_0x5fd2('0x37')]};return db[_0x5fd2('0x29')][_0x5fd2('0x3c')](_0x5a0fec)['then'](function(_0x3b39e1){_0x449257[_0x5fd2('0x3c')]=_0x3b39e1;if(_0x3988cb[_0x5fd2('0x2e')]['includeAll']){_0x3fbf27[_0x5fd2('0x3d')]=[{'all':!![]}];}return db[_0x5fd2('0x29')][_0x5fd2('0x3e')](_0x3fbf27);})['then'](function(_0xc4236c){_0x449257[_0x5fd2('0x3f')]=_0xc4236c;return _0x449257;})[_0x5fd2('0x23')](respondWithFilteredResult(_0x40d2d7,_0x3fbf27))[_0x5fd2('0x40')](handleError(_0x40d2d7,null));};exports[_0x5fd2('0x41')]=function(_0x5ae7c4,_0x4fa53a){var _0x57ae07={'raw':![],'where':{'id':_0x5ae7c4['params']['id']}},_0x426619={};_0x426619[_0x5fd2('0x2d')]=_[_0x5fd2('0x2f')](db['SalesforceConfiguration'][_0x5fd2('0x2a')]);_0x426619['query']=_['keys'](_0x5ae7c4[_0x5fd2('0x2e')]);_0x426619[_0x5fd2('0x30')]=_[_0x5fd2('0x31')](_0x426619['model'],_0x426619[_0x5fd2('0x2e')]);_0x57ae07['attributes']=_[_0x5fd2('0x31')](_0x426619['model'],qs[_0x5fd2('0x33')](_0x5ae7c4[_0x5fd2('0x2e')]['fields']));_0x57ae07['attributes']=_0x57ae07[_0x5fd2('0x32')]['length']?_0x57ae07[_0x5fd2('0x32')]:_0x426619[_0x5fd2('0x2d')];if(_0x5ae7c4['query'][_0x5fd2('0x42')]){_0x57ae07[_0x5fd2('0x3d')]=[{'all':!![]}];}_0x57ae07=_[_0x5fd2('0x39')]({},_0x57ae07,_0x5ae7c4[_0x5fd2('0x3b')]);return db[_0x5fd2('0x29')]['find'](_0x57ae07)[_0x5fd2('0x23')](handleEntityNotFound(_0x4fa53a,null))[_0x5fd2('0x23')](respondWithResult(_0x4fa53a,null))[_0x5fd2('0x40')](handleError(_0x4fa53a,null));};exports[_0x5fd2('0x43')]=function(_0x5320f4,_0x5e3d06){return db[_0x5fd2('0x29')][_0x5fd2('0x43')](_0x5320f4[_0x5fd2('0x44')],{})[_0x5fd2('0x23')](respondWithResult(_0x5e3d06,0xc9))[_0x5fd2('0x40')](handleError(_0x5e3d06,null));};exports[_0x5fd2('0x22')]=function(_0x1ff56d,_0x69d0b2){if(_0x1ff56d[_0x5fd2('0x44')]['id']){delete _0x1ff56d[_0x5fd2('0x44')]['id'];}return db['SalesforceConfiguration'][_0x5fd2('0x45')]({'where':{'id':_0x1ff56d['params']['id']}})['then'](handleEntityNotFound(_0x69d0b2,null))[_0x5fd2('0x23')](saveUpdates(_0x1ff56d[_0x5fd2('0x44')],null))['then'](respondWithResult(_0x69d0b2,null))[_0x5fd2('0x40')](handleError(_0x69d0b2,null));};exports[_0x5fd2('0x46')]=function(_0x268772,_0x1f5a8f){return db[_0x5fd2('0x29')]['find']({'where':{'id':_0x268772[_0x5fd2('0x47')]['id']}})[_0x5fd2('0x23')](handleEntityNotFound(_0x1f5a8f,null))[_0x5fd2('0x23')](removeEntity(_0x1f5a8f,null))['catch'](handleError(_0x1f5a8f,null));};exports[_0x5fd2('0x48')]=function(_0x5489b7,_0x5e331e,_0x2ed760){var _0x24853b={};var _0x574c11={};var _0x4ecfac;var _0x3cf3ec;return db[_0x5fd2('0x29')]['findOne']({'where':{'id':_0x5489b7[_0x5fd2('0x47')]['id']}})[_0x5fd2('0x23')](handleEntityNotFound(_0x5e331e,null))['then'](function(_0xb5fca2){if(_0xb5fca2){_0x4ecfac=_0xb5fca2;_0x574c11[_0x5fd2('0x2d')]=_[_0x5fd2('0x2f')](db['SalesforceField'][_0x5fd2('0x2a')]);_0x574c11[_0x5fd2('0x2e')]=_[_0x5fd2('0x2f')](_0x5489b7[_0x5fd2('0x2e')]);_0x574c11[_0x5fd2('0x30')]=_[_0x5fd2('0x31')](_0x574c11[_0x5fd2('0x2d')],_0x574c11[_0x5fd2('0x2e')]);_0x24853b[_0x5fd2('0x32')]=_['intersection'](_0x574c11[_0x5fd2('0x2d')],qs['fields'](_0x5489b7[_0x5fd2('0x2e')]['fields']));_0x24853b[_0x5fd2('0x32')]=_0x24853b[_0x5fd2('0x32')][_0x5fd2('0x49')]?_0x24853b['attributes']:_0x574c11[_0x5fd2('0x2d')];_0x24853b[_0x5fd2('0x4a')]=qs[_0x5fd2('0x36')](_0x5489b7[_0x5fd2('0x2e')][_0x5fd2('0x36')]);_0x24853b[_0x5fd2('0x37')]=qs[_0x5fd2('0x30')](_['pick'](_0x5489b7[_0x5fd2('0x2e')],_0x574c11[_0x5fd2('0x30')]));if(_0x5489b7[_0x5fd2('0x2e')][_0x5fd2('0x38')]){_0x24853b[_0x5fd2('0x37')]=_['merge'](_0x24853b['where'],{'$or':_['map'](_0x24853b[_0x5fd2('0x32')],function(_0x36d3ab){var _0x5bb801={};_0x5bb801[_0x36d3ab]={'$like':'%'+_0x5489b7['query'][_0x5fd2('0x38')]+'%'};return _0x5bb801;})});}_0x24853b=_[_0x5fd2('0x39')]({},_0x24853b,_0x5489b7[_0x5fd2('0x3b')]);return _0x4ecfac[_0x5fd2('0x48')](_0x24853b);}})[_0x5fd2('0x23')](function(_0x2d080c){if(_0x2d080c){_0x3cf3ec=_0x2d080c[_0x5fd2('0x49')];if(!_0x5489b7[_0x5fd2('0x2e')][_0x5fd2('0x34')](_0x5fd2('0x35'))){_0x24853b[_0x5fd2('0x1c')]=qs[_0x5fd2('0x1c')](_0x5489b7[_0x5fd2('0x2e')][_0x5fd2('0x1c')]);_0x24853b['offset']=qs[_0x5fd2('0x1d')](_0x5489b7[_0x5fd2('0x2e')][_0x5fd2('0x1d')]);}return _0x4ecfac[_0x5fd2('0x48')](_0x24853b);}})['then'](function(_0x594d97){if(_0x594d97){return _0x594d97?{'count':_0x3cf3ec,'rows':_0x594d97}:null;}})[_0x5fd2('0x23')](respondWithResult(_0x5e331e,null))['catch'](handleError(_0x5e331e,null));};exports[_0x5fd2('0x4b')]=function(_0x39ee75,_0x992e71,_0x867728){var _0x4f6252={};var _0x469023={};var _0x2d0333;var _0x2b73ab;return db[_0x5fd2('0x29')][_0x5fd2('0x4c')]({'where':{'id':_0x39ee75[_0x5fd2('0x47')]['id']}})[_0x5fd2('0x23')](handleEntityNotFound(_0x992e71,null))[_0x5fd2('0x23')](function(_0x5c98fd){if(_0x5c98fd){_0x2d0333=_0x5c98fd;_0x469023[_0x5fd2('0x2d')]=_[_0x5fd2('0x2f')](db['SalesforceField'][_0x5fd2('0x2a')]);_0x469023[_0x5fd2('0x2e')]=_[_0x5fd2('0x2f')](_0x39ee75[_0x5fd2('0x2e')]);_0x469023[_0x5fd2('0x30')]=_[_0x5fd2('0x31')](_0x469023[_0x5fd2('0x2d')],_0x469023[_0x5fd2('0x2e')]);_0x4f6252[_0x5fd2('0x32')]=_['intersection'](_0x469023[_0x5fd2('0x2d')],qs[_0x5fd2('0x33')](_0x39ee75[_0x5fd2('0x2e')][_0x5fd2('0x33')]));_0x4f6252[_0x5fd2('0x32')]=_0x4f6252[_0x5fd2('0x32')][_0x5fd2('0x49')]?_0x4f6252['attributes']:_0x469023['model'];_0x4f6252[_0x5fd2('0x4a')]=qs['sort'](_0x39ee75[_0x5fd2('0x2e')][_0x5fd2('0x36')]);_0x4f6252[_0x5fd2('0x37')]=qs[_0x5fd2('0x30')](_[_0x5fd2('0x4d')](_0x39ee75['query'],_0x469023[_0x5fd2('0x30')]));if(_0x39ee75['query'][_0x5fd2('0x38')]){_0x4f6252[_0x5fd2('0x37')]=_[_0x5fd2('0x39')](_0x4f6252['where'],{'$or':_[_0x5fd2('0x28')](_0x4f6252[_0x5fd2('0x32')],function(_0x35c21f){var _0x68f1d3={};_0x68f1d3[_0x35c21f]={'$like':'%'+_0x39ee75[_0x5fd2('0x2e')][_0x5fd2('0x38')]+'%'};return _0x68f1d3;})});}_0x4f6252=_[_0x5fd2('0x39')]({},_0x4f6252,_0x39ee75['options']);return _0x2d0333[_0x5fd2('0x4b')](_0x4f6252);}})[_0x5fd2('0x23')](function(_0x1c6823){if(_0x1c6823){_0x2b73ab=_0x1c6823[_0x5fd2('0x49')];if(!_0x39ee75[_0x5fd2('0x2e')][_0x5fd2('0x34')](_0x5fd2('0x35'))){_0x4f6252[_0x5fd2('0x1c')]=qs[_0x5fd2('0x1c')](_0x39ee75[_0x5fd2('0x2e')]['limit']);_0x4f6252[_0x5fd2('0x1d')]=qs['offset'](_0x39ee75[_0x5fd2('0x2e')][_0x5fd2('0x1d')]);}return _0x2d0333['getSubjects'](_0x4f6252);}})[_0x5fd2('0x23')](function(_0x421c1b){if(_0x421c1b){return _0x421c1b?{'count':_0x2b73ab,'rows':_0x421c1b}:null;}})[_0x5fd2('0x23')](respondWithResult(_0x992e71,null))[_0x5fd2('0x40')](handleError(_0x992e71,null));};exports[_0x5fd2('0x4e')]=function(_0x32e564,_0x27352b,_0x1c4401){var _0x50b46a={};var _0x369cd7={};var _0x2d4b0a;var _0x4fd632;return db[_0x5fd2('0x29')]['findOne']({'where':{'id':_0x32e564[_0x5fd2('0x47')]['id']}})[_0x5fd2('0x23')](handleEntityNotFound(_0x27352b,null))['then'](function(_0x3d5599){if(_0x3d5599){_0x2d4b0a=_0x3d5599;_0x369cd7[_0x5fd2('0x2d')]=_[_0x5fd2('0x2f')](db[_0x5fd2('0x4f')][_0x5fd2('0x2a')]);_0x369cd7[_0x5fd2('0x2e')]=_[_0x5fd2('0x2f')](_0x32e564[_0x5fd2('0x2e')]);_0x369cd7[_0x5fd2('0x30')]=_[_0x5fd2('0x31')](_0x369cd7['model'],_0x369cd7[_0x5fd2('0x2e')]);_0x50b46a[_0x5fd2('0x32')]=_[_0x5fd2('0x31')](_0x369cd7[_0x5fd2('0x2d')],qs[_0x5fd2('0x33')](_0x32e564[_0x5fd2('0x2e')][_0x5fd2('0x33')]));_0x50b46a[_0x5fd2('0x32')]=_0x50b46a[_0x5fd2('0x32')][_0x5fd2('0x49')]?_0x50b46a[_0x5fd2('0x32')]:_0x369cd7[_0x5fd2('0x2d')];_0x50b46a[_0x5fd2('0x4a')]=qs[_0x5fd2('0x36')](_0x32e564[_0x5fd2('0x2e')][_0x5fd2('0x36')]);_0x50b46a['where']=qs['filters'](_['pick'](_0x32e564['query'],_0x369cd7['filters']));if(_0x32e564[_0x5fd2('0x2e')]['filter']){_0x50b46a[_0x5fd2('0x37')]=_[_0x5fd2('0x39')](_0x50b46a[_0x5fd2('0x37')],{'$or':_[_0x5fd2('0x28')](_0x50b46a[_0x5fd2('0x32')],function(_0x2f6d5c){var _0x208674={};_0x208674[_0x2f6d5c]={'$like':'%'+_0x32e564[_0x5fd2('0x2e')][_0x5fd2('0x38')]+'%'};return _0x208674;})});}_0x50b46a=_[_0x5fd2('0x39')]({},_0x50b46a,_0x32e564['options']);return _0x2d4b0a[_0x5fd2('0x4e')](_0x50b46a);}})['then'](function(_0x32bf99){if(_0x32bf99){_0x4fd632=_0x32bf99[_0x5fd2('0x49')];if(!_0x32e564['query']['hasOwnProperty'](_0x5fd2('0x35'))){_0x50b46a[_0x5fd2('0x1c')]=qs[_0x5fd2('0x1c')](_0x32e564[_0x5fd2('0x2e')][_0x5fd2('0x1c')]);_0x50b46a[_0x5fd2('0x1d')]=qs['offset'](_0x32e564[_0x5fd2('0x2e')]['offset']);}return _0x2d4b0a['getDescriptions'](_0x50b46a);}})['then'](function(_0x2b461b){if(_0x2b461b){return _0x2b461b?{'count':_0x4fd632,'rows':_0x2b461b}:null;}})[_0x5fd2('0x23')](respondWithResult(_0x27352b,null))['catch'](handleError(_0x27352b,null));}; \ No newline at end of file +var _0x1220=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1220,0x8a));var _0x0122=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1220[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x0122('0x0'));var rimraf=require(_0x0122('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0122('0x2'));var BPromise=require(_0x0122('0x3'));var Mustache=require(_0x0122('0x4'));var util=require(_0x0122('0x5'));var path=require(_0x0122('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0122('0x7'));var fs=require('fs');var fs_extra=require(_0x0122('0x8'));var _=require(_0x0122('0x9'));var squel=require(_0x0122('0xa'));var crypto=require('crypto');var jsforce=require(_0x0122('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0122('0xc'));var authService=require(_0x0122('0xd'));var qs=require(_0x0122('0xe'));var as=require(_0x0122('0xf'));var hardwareService=require(_0x0122('0x10'));var logger=require(_0x0122('0x11'))(_0x0122('0x12'));var utils=require(_0x0122('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0122('0x14'));var db=require(_0x0122('0x15'))['db'];function respondWithStatusCode(_0x417daa,_0x35ae04){_0x35ae04=_0x35ae04||0xcc;return function(_0x31f2a1){if(_0x31f2a1){return _0x417daa[_0x0122('0x16')](_0x35ae04);}return _0x417daa[_0x0122('0x17')](_0x35ae04)[_0x0122('0x18')]();};}function respondWithResult(_0x190f80,_0x3877b1){_0x3877b1=_0x3877b1||0xc8;return function(_0x4091e7){if(_0x4091e7){return _0x190f80[_0x0122('0x17')](_0x3877b1)[_0x0122('0x19')](_0x4091e7);}};}function respondWithFilteredResult(_0x551ec8,_0x186e98){return function(_0x27a9ac){if(_0x27a9ac){var _0x4d33ff=typeof _0x186e98[_0x0122('0x1a')]===_0x0122('0x1b')&&typeof _0x186e98[_0x0122('0x1c')]==='undefined';var _0x271e3f=_0x27a9ac[_0x0122('0x1d')];var _0x1a0d6e=_0x4d33ff?0x0:_0x186e98[_0x0122('0x1a')];var _0x4547cc=_0x4d33ff?_0x27a9ac[_0x0122('0x1d')]:_0x186e98['offset']+_0x186e98[_0x0122('0x1c')];var _0x20f4fb;if(_0x4547cc>=_0x271e3f){_0x4547cc=_0x271e3f;_0x20f4fb=0xc8;}else{_0x20f4fb=0xce;}_0x551ec8[_0x0122('0x17')](_0x20f4fb);return _0x551ec8['set'](_0x0122('0x1e'),_0x1a0d6e+'-'+_0x4547cc+'/'+_0x271e3f)['json'](_0x27a9ac);}return null;};}function patchUpdates(_0xdda6b1){return function(_0x29a508){try{jsonpatch['apply'](_0x29a508,_0xdda6b1,!![]);}catch(_0x132ec0){return BPromise[_0x0122('0x1f')](_0x132ec0);}return _0x29a508[_0x0122('0x20')]();};}function saveUpdates(_0x30a5bd,_0x43ff4c){return function(_0x4d08e6){if(_0x4d08e6){return _0x4d08e6[_0x0122('0x21')](_0x30a5bd)[_0x0122('0x22')](function(_0x2bac93){return _0x2bac93;});}return null;};}function removeEntity(_0x3b65b1,_0x530455){return function(_0x477b87){if(_0x477b87){return _0x477b87[_0x0122('0x23')]()[_0x0122('0x22')](function(){_0x3b65b1[_0x0122('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29150b,_0x3a077c){return function(_0xbe4b7f){if(!_0xbe4b7f){_0x29150b[_0x0122('0x16')](0x194);}return _0xbe4b7f;};}function handleError(_0x600375,_0x89fd93){_0x89fd93=_0x89fd93||0x1f4;return function(_0x590459){logger[_0x0122('0x24')](_0x590459[_0x0122('0x25')]);if(_0x590459[_0x0122('0x26')]){delete _0x590459[_0x0122('0x26')];}_0x600375['status'](_0x89fd93)['send'](_0x590459);};}exports[_0x0122('0x27')]=function(_0x533cc2,_0x1a3708){var _0x20cea1={},_0x562415={},_0x5ba5a7={'count':0x0,'rows':[]};var _0x1e4036=_[_0x0122('0x28')](db['SalesforceConfiguration'][_0x0122('0x29')],function(_0x49207a){return{'name':_0x49207a[_0x0122('0x2a')],'type':_0x49207a[_0x0122('0x2b')][_0x0122('0x2c')]};});_0x562415[_0x0122('0x2d')]=_[_0x0122('0x28')](_0x1e4036,_0x0122('0x26'));_0x562415['query']=_[_0x0122('0x2e')](_0x533cc2[_0x0122('0x2f')]);_0x562415['filters']=_[_0x0122('0x30')](_0x562415[_0x0122('0x2d')],_0x562415[_0x0122('0x2f')]);_0x20cea1[_0x0122('0x31')]=_[_0x0122('0x30')](_0x562415[_0x0122('0x2d')],qs['fields'](_0x533cc2['query'][_0x0122('0x32')]));_0x20cea1[_0x0122('0x31')]=_0x20cea1[_0x0122('0x31')][_0x0122('0x33')]?_0x20cea1[_0x0122('0x31')]:_0x562415[_0x0122('0x2d')];if(!_0x533cc2[_0x0122('0x2f')][_0x0122('0x34')](_0x0122('0x35'))){_0x20cea1['limit']=qs[_0x0122('0x1c')](_0x533cc2[_0x0122('0x2f')][_0x0122('0x1c')]);_0x20cea1[_0x0122('0x1a')]=qs['offset'](_0x533cc2[_0x0122('0x2f')][_0x0122('0x1a')]);}_0x20cea1['order']=qs[_0x0122('0x36')](_0x533cc2[_0x0122('0x2f')][_0x0122('0x36')]);_0x20cea1[_0x0122('0x37')]=qs[_0x0122('0x38')](_[_0x0122('0x39')](_0x533cc2[_0x0122('0x2f')],_0x562415[_0x0122('0x38')]),_0x1e4036);if(_0x533cc2['query'][_0x0122('0x3a')]){_0x20cea1[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x20cea1[_0x0122('0x37')],{'$or':_[_0x0122('0x28')](_0x1e4036,function(_0x38c92a){if(_0x38c92a[_0x0122('0x2b')]!==_0x0122('0x3c')){var _0x31ddc5={};_0x31ddc5[_0x38c92a['name']]={'$like':'%'+_0x533cc2[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x31ddc5;}})});}_0x20cea1=_[_0x0122('0x3b')]({},_0x20cea1,_0x533cc2['options']);var _0x5cb4ee={'where':_0x20cea1[_0x0122('0x37')]};return db[_0x0122('0x3d')][_0x0122('0x1d')](_0x5cb4ee)[_0x0122('0x22')](function(_0x21d32d){_0x5ba5a7['count']=_0x21d32d;if(_0x533cc2[_0x0122('0x2f')][_0x0122('0x3e')]){_0x20cea1[_0x0122('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x20cea1);})[_0x0122('0x22')](function(_0x564822){_0x5ba5a7[_0x0122('0x40')]=_0x564822;return _0x5ba5a7;})[_0x0122('0x22')](respondWithFilteredResult(_0x1a3708,_0x20cea1))[_0x0122('0x41')](handleError(_0x1a3708,null));};exports[_0x0122('0x42')]=function(_0x520062,_0x2496d9){var _0x107cb9={'raw':![],'where':{'id':_0x520062[_0x0122('0x43')]['id']}},_0xa8013c={};_0xa8013c[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x3d')][_0x0122('0x29')]);_0xa8013c[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x520062[_0x0122('0x2f')]);_0xa8013c[_0x0122('0x38')]=_[_0x0122('0x30')](_0xa8013c['model'],_0xa8013c[_0x0122('0x2f')]);_0x107cb9[_0x0122('0x31')]=_[_0x0122('0x30')](_0xa8013c[_0x0122('0x2d')],qs['fields'](_0x520062['query']['fields']));_0x107cb9[_0x0122('0x31')]=_0x107cb9[_0x0122('0x31')][_0x0122('0x33')]?_0x107cb9['attributes']:_0xa8013c[_0x0122('0x2d')];if(_0x520062[_0x0122('0x2f')]['includeAll']){_0x107cb9['include']=[{'all':!![]}];}_0x107cb9=_[_0x0122('0x3b')]({},_0x107cb9,_0x520062[_0x0122('0x44')]);return db[_0x0122('0x3d')][_0x0122('0x45')](_0x107cb9)[_0x0122('0x22')](handleEntityNotFound(_0x2496d9,null))[_0x0122('0x22')](respondWithResult(_0x2496d9,null))[_0x0122('0x41')](handleError(_0x2496d9,null));};exports['create']=function(_0x2a20bd,_0x18513f){return db[_0x0122('0x3d')][_0x0122('0x46')](_0x2a20bd[_0x0122('0x47')],{})[_0x0122('0x22')](respondWithResult(_0x18513f,0xc9))[_0x0122('0x41')](handleError(_0x18513f,null));};exports[_0x0122('0x21')]=function(_0x326e03,_0x58528d){if(_0x326e03[_0x0122('0x47')]['id']){delete _0x326e03[_0x0122('0x47')]['id'];}return db[_0x0122('0x3d')]['find']({'where':{'id':_0x326e03[_0x0122('0x43')]['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x58528d,null))[_0x0122('0x22')](saveUpdates(_0x326e03[_0x0122('0x47')],null))[_0x0122('0x22')](respondWithResult(_0x58528d,null))['catch'](handleError(_0x58528d,null));};exports[_0x0122('0x23')]=function(_0x399f44,_0x2ab92c){return db[_0x0122('0x3d')][_0x0122('0x45')]({'where':{'id':_0x399f44[_0x0122('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ab92c,null))[_0x0122('0x22')](removeEntity(_0x2ab92c,null))['catch'](handleError(_0x2ab92c,null));};exports[_0x0122('0x48')]=function(_0x4e7500,_0x27b5ea,_0x343bfa){var _0x36f54e={};var _0xdc3b58={};var _0x2cd6ae;var _0x474ad4;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4e7500['params']['id']}})['then'](handleEntityNotFound(_0x27b5ea,null))[_0x0122('0x22')](function(_0x1c5925){if(_0x1c5925){_0x2cd6ae=_0x1c5925;_0xdc3b58[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x4a')][_0x0122('0x29')]);_0xdc3b58[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x4e7500[_0x0122('0x2f')]);_0xdc3b58['filters']=_[_0x0122('0x30')](_0xdc3b58['model'],_0xdc3b58[_0x0122('0x2f')]);_0x36f54e[_0x0122('0x31')]=_[_0x0122('0x30')](_0xdc3b58[_0x0122('0x2d')],qs['fields'](_0x4e7500[_0x0122('0x2f')][_0x0122('0x32')]));_0x36f54e[_0x0122('0x31')]=_0x36f54e['attributes']['length']?_0x36f54e[_0x0122('0x31')]:_0xdc3b58[_0x0122('0x2d')];_0x36f54e[_0x0122('0x4b')]=qs[_0x0122('0x36')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x36')]);_0x36f54e['where']=qs['filters'](_[_0x0122('0x39')](_0x4e7500[_0x0122('0x2f')],_0xdc3b58[_0x0122('0x38')]));if(_0x4e7500[_0x0122('0x2f')][_0x0122('0x3a')]){_0x36f54e[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x36f54e[_0x0122('0x37')],{'$or':_['map'](_0x36f54e[_0x0122('0x31')],function(_0x168ecc){var _0x515f90={};_0x515f90[_0x168ecc]={'$like':'%'+_0x4e7500[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x515f90;})});}_0x36f54e=_['merge']({},_0x36f54e,_0x4e7500['options']);return _0x2cd6ae['getFields'](_0x36f54e);}})[_0x0122('0x22')](function(_0x3a14f9){if(_0x3a14f9){_0x474ad4=_0x3a14f9[_0x0122('0x33')];if(!_0x4e7500['query']['hasOwnProperty']('nolimit')){_0x36f54e[_0x0122('0x1c')]=qs[_0x0122('0x1c')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x1c')]);_0x36f54e['offset']=qs[_0x0122('0x1a')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x1a')]);}return _0x2cd6ae[_0x0122('0x48')](_0x36f54e);}})['then'](function(_0x1d6ba8){if(_0x1d6ba8){return _0x1d6ba8?{'count':_0x474ad4,'rows':_0x1d6ba8}:null;}})['then'](respondWithResult(_0x27b5ea,null))['catch'](handleError(_0x27b5ea,null));};exports['getSubjects']=function(_0x4a6a78,_0x1f8227,_0x279838){var _0x31fd48={};var _0x7afefd={};var _0x1b64ee;var _0x3b6fdf;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4a6a78[_0x0122('0x43')]['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x1f8227,null))[_0x0122('0x22')](function(_0x1046b6){if(_0x1046b6){_0x1b64ee=_0x1046b6;_0x7afefd['model']=_['keys'](db[_0x0122('0x4a')][_0x0122('0x29')]);_0x7afefd[_0x0122('0x2f')]=_['keys'](_0x4a6a78['query']);_0x7afefd[_0x0122('0x38')]=_[_0x0122('0x30')](_0x7afefd[_0x0122('0x2d')],_0x7afefd[_0x0122('0x2f')]);_0x31fd48[_0x0122('0x31')]=_['intersection'](_0x7afefd[_0x0122('0x2d')],qs[_0x0122('0x32')](_0x4a6a78[_0x0122('0x2f')]['fields']));_0x31fd48[_0x0122('0x31')]=_0x31fd48['attributes']['length']?_0x31fd48[_0x0122('0x31')]:_0x7afefd[_0x0122('0x2d')];_0x31fd48[_0x0122('0x4b')]=qs[_0x0122('0x36')](_0x4a6a78[_0x0122('0x2f')][_0x0122('0x36')]);_0x31fd48[_0x0122('0x37')]=qs[_0x0122('0x38')](_[_0x0122('0x39')](_0x4a6a78['query'],_0x7afefd[_0x0122('0x38')]));if(_0x4a6a78['query']['filter']){_0x31fd48[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x31fd48[_0x0122('0x37')],{'$or':_['map'](_0x31fd48[_0x0122('0x31')],function(_0x2d129e){var _0x4a6a2a={};_0x4a6a2a[_0x2d129e]={'$like':'%'+_0x4a6a78[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x4a6a2a;})});}_0x31fd48=_['merge']({},_0x31fd48,_0x4a6a78[_0x0122('0x44')]);return _0x1b64ee[_0x0122('0x4c')](_0x31fd48);}})[_0x0122('0x22')](function(_0x510574){if(_0x510574){_0x3b6fdf=_0x510574[_0x0122('0x33')];if(!_0x4a6a78[_0x0122('0x2f')][_0x0122('0x34')]('nolimit')){_0x31fd48[_0x0122('0x1c')]=qs[_0x0122('0x1c')](_0x4a6a78[_0x0122('0x2f')][_0x0122('0x1c')]);_0x31fd48['offset']=qs[_0x0122('0x1a')](_0x4a6a78['query'][_0x0122('0x1a')]);}return _0x1b64ee[_0x0122('0x4c')](_0x31fd48);}})[_0x0122('0x22')](function(_0x183e50){if(_0x183e50){return _0x183e50?{'count':_0x3b6fdf,'rows':_0x183e50}:null;}})[_0x0122('0x22')](respondWithResult(_0x1f8227,null))[_0x0122('0x41')](handleError(_0x1f8227,null));};exports[_0x0122('0x4d')]=function(_0x4af89f,_0x2be0a1,_0x3a7fd8){var _0x14c38e={};var _0x52b8c8={};var _0x378bcc;var _0x19e91c;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4af89f['params']['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x2be0a1,null))['then'](function(_0x31e451){if(_0x31e451){_0x378bcc=_0x31e451;_0x52b8c8[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x4a')]['rawAttributes']);_0x52b8c8[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x4af89f[_0x0122('0x2f')]);_0x52b8c8[_0x0122('0x38')]=_[_0x0122('0x30')](_0x52b8c8[_0x0122('0x2d')],_0x52b8c8[_0x0122('0x2f')]);_0x14c38e[_0x0122('0x31')]=_[_0x0122('0x30')](_0x52b8c8['model'],qs[_0x0122('0x32')](_0x4af89f[_0x0122('0x2f')]['fields']));_0x14c38e['attributes']=_0x14c38e[_0x0122('0x31')]['length']?_0x14c38e[_0x0122('0x31')]:_0x52b8c8['model'];_0x14c38e[_0x0122('0x4b')]=qs['sort'](_0x4af89f[_0x0122('0x2f')][_0x0122('0x36')]);_0x14c38e[_0x0122('0x37')]=qs[_0x0122('0x38')](_['pick'](_0x4af89f[_0x0122('0x2f')],_0x52b8c8[_0x0122('0x38')]));if(_0x4af89f['query']['filter']){_0x14c38e[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x14c38e['where'],{'$or':_[_0x0122('0x28')](_0x14c38e['attributes'],function(_0x4e0780){var _0x53e3c4={};_0x53e3c4[_0x4e0780]={'$like':'%'+_0x4af89f[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x53e3c4;})});}_0x14c38e=_[_0x0122('0x3b')]({},_0x14c38e,_0x4af89f[_0x0122('0x44')]);return _0x378bcc['getDescriptions'](_0x14c38e);}})[_0x0122('0x22')](function(_0x27a12e){if(_0x27a12e){_0x19e91c=_0x27a12e[_0x0122('0x33')];if(!_0x4af89f[_0x0122('0x2f')][_0x0122('0x34')](_0x0122('0x35'))){_0x14c38e[_0x0122('0x1c')]=qs['limit'](_0x4af89f[_0x0122('0x2f')][_0x0122('0x1c')]);_0x14c38e[_0x0122('0x1a')]=qs[_0x0122('0x1a')](_0x4af89f[_0x0122('0x2f')]['offset']);}return _0x378bcc[_0x0122('0x4d')](_0x14c38e);}})[_0x0122('0x22')](function(_0x387361){if(_0x387361){return _0x387361?{'count':_0x19e91c,'rows':_0x387361}:null;}})[_0x0122('0x22')](respondWithResult(_0x2be0a1,null))['catch'](handleError(_0x2be0a1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 61f98c2..7f5be74 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 _0xb90b=['exports','util','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes'];(function(_0x216b50,_0x1d935f){var _0x4a17fa=function(_0x226c6d){while(--_0x226c6d){_0x216b50['push'](_0x216b50['shift']());}};_0x4a17fa(++_0x1d935f);}(_0xb90b,0xac));var _0xbb90=function(_0x2e5c3c,_0x1dcc68){_0x2e5c3c=_0x2e5c3c-0x0;var _0x25b5da=_0xb90b[_0x2e5c3c];return _0x25b5da;};'use strict';var _=require('lodash');var util=require(_0xbb90('0x0'));var logger=require('../../config/logger')(_0xbb90('0x1'));var moment=require(_0xbb90('0x2'));var BPromise=require(_0xbb90('0x3'));var rp=require(_0xbb90('0x4'));var fs=require('fs');var path=require(_0xbb90('0x5'));var rimraf=require(_0xbb90('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb90('0x7'));module[_0xbb90('0x8')]=function(_0xabeaed,_0x519137){return _0xabeaed['define']('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d9f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations'];(function(_0x101946,_0x168aca){var _0x4d9f29=function(_0x3daf39){while(--_0x3daf39){_0x101946['push'](_0x101946['shift']());}};_0x4d9f29(++_0x168aca);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0x7d9f[_0x299027];return _0x1bc622;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 14a6ad8..b2b9c80 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 _0xf817=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4dabc5,_0x56682){var _0x4f47b5=function(_0x2face1){while(--_0x2face1){_0x4dabc5['push'](_0x4dabc5['shift']());}};_0x4f47b5(++_0x56682);}(_0xf817,0x15f));var _0x7f81=function(_0x689a76,_0x2b5ce9){_0x689a76=_0x689a76-0x0;var _0x473e8e=_0xf817[_0x689a76];return _0x473e8e;};'use strict';var _=require(_0x7f81('0x0'));var util=require('util');var moment=require(_0x7f81('0x1'));var BPromise=require(_0x7f81('0x2'));var rs=require(_0x7f81('0x3'));var fs=require('fs');var Redis=require(_0x7f81('0x4'));var db=require(_0x7f81('0x5'))['db'];var utils=require(_0x7f81('0x6'));var logger=require(_0x7f81('0x7'))(_0x7f81('0x8'));var config=require(_0x7f81('0x9'));var jayson=require(_0x7f81('0xa'));var client=jayson[_0x7f81('0xb')][_0x7f81('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21530c,_0x4a43ad,_0x46f655){return new BPromise(function(_0x1c863d,_0x6ec037){return client[_0x7f81('0xd')](_0x21530c,_0x46f655)['then'](function(_0x11d8a6){logger['info'](_0x7f81('0xe'),_0x4a43ad,_0x7f81('0xf'));logger[_0x7f81('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4a43ad,_0x7f81('0xf'),JSON['stringify'](_0x11d8a6));if(_0x11d8a6[_0x7f81('0x11')]){if(_0x11d8a6[_0x7f81('0x11')]['code']===0x1f4){logger[_0x7f81('0x11')](_0x7f81('0xe'),_0x4a43ad,_0x11d8a6['error']['message']);return _0x6ec037(_0x11d8a6[_0x7f81('0x11')]['message']);}logger[_0x7f81('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4a43ad,_0x11d8a6[_0x7f81('0x11')][_0x7f81('0x12')]);return _0x1c863d(_0x11d8a6[_0x7f81('0x11')][_0x7f81('0x12')]);}else{logger[_0x7f81('0x13')](_0x7f81('0xe'),_0x4a43ad,_0x7f81('0xf'));_0x1c863d(_0x11d8a6['result']['message']);}})[_0x7f81('0x14')](function(_0x22cb8a){logger['error'](_0x7f81('0xe'),_0x4a43ad,_0x22cb8a);_0x6ec037(_0x22cb8a);});});} \ No newline at end of file +var _0xfed0=['jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4dcf15,_0x1cb30f){var _0x512f9e=function(_0x3df96b){while(--_0x3df96b){_0x4dcf15['push'](_0x4dcf15['shift']());}};_0x512f9e(++_0x1cb30f);}(_0xfed0,0xad));var _0x0fed=function(_0x539f2f,_0x263f39){_0x539f2f=_0x539f2f-0x0;var _0x1cd080=_0xfed0[_0x539f2f];return _0x1cd080;};'use strict';var _=require(_0x0fed('0x0'));var util=require(_0x0fed('0x1'));var moment=require(_0x0fed('0x2'));var BPromise=require(_0x0fed('0x3'));var rs=require(_0x0fed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0fed('0x5'));var logger=require(_0x0fed('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fed('0x7'));var client=jayson[_0x0fed('0x8')][_0x0fed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d44d8,_0x109c0b,_0x33b012){return new BPromise(function(_0x327b5b,_0x4c0fc2){return client[_0x0fed('0xa')](_0x1d44d8,_0x33b012)[_0x0fed('0xb')](function(_0xa9e8dd){logger['info'](_0x0fed('0xc'),_0x109c0b,_0x0fed('0xd'));logger[_0x0fed('0xe')](_0x0fed('0xf'),_0x109c0b,_0x0fed('0xd'),JSON[_0x0fed('0x10')](_0xa9e8dd));if(_0xa9e8dd[_0x0fed('0x11')]){if(_0xa9e8dd[_0x0fed('0x11')]['code']===0x1f4){logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0xa9e8dd[_0x0fed('0x11')]['message']);return _0x4c0fc2(_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);}logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);return _0x327b5b(_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);}else{logger['info'](_0x0fed('0xc'),_0x109c0b,'request\x20sent');_0x327b5b(_0xa9e8dd['result'][_0x0fed('0x12')]);}})[_0x0fed('0x13')](function(_0x538367){logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0x538367);_0x4c0fc2(_0x538367);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index bb12ee4..eb0eaaf 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 _0xd72b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer'];(function(_0x5f4b52,_0x180a0e){var _0x53e624=function(_0x4df67a){while(--_0x4df67a){_0x5f4b52['push'](_0x5f4b52['shift']());}};_0x53e624(++_0x180a0e);}(_0xd72b,0x18e));var _0xbd72=function(_0x3924c6,_0x37c75f){_0x3924c6=_0x3924c6-0x0;var _0x29a465=_0xd72b[_0x3924c6];return _0x29a465;};'use strict';var multer=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var path=require(_0xbd72('0x2'));var timeout=require(_0xbd72('0x3'));var express=require(_0xbd72('0x4'));var router=express[_0xbd72('0x5')]();var fs_extra=require(_0xbd72('0x6'));var auth=require(_0xbd72('0x7'));var interaction=require(_0xbd72('0x8'));var config=require(_0xbd72('0x9'));var controller=require(_0xbd72('0xa'));router[_0xbd72('0xb')]('/',auth[_0xbd72('0xc')](),controller[_0xbd72('0xd')]);router['get'](_0xbd72('0xe'),auth['isAuthenticated'](),controller[_0xbd72('0xf')]);router[_0xbd72('0x10')]('/',auth[_0xbd72('0xc')](),controller[_0xbd72('0x11')]);router[_0xbd72('0x12')]('/:id',auth[_0xbd72('0xc')](),controller[_0xbd72('0x13')]);router['delete'](_0xbd72('0xe'),auth[_0xbd72('0xc')](),controller['destroy']);module[_0xbd72('0x14')]=router; \ No newline at end of file +var _0x442b=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1e688e,_0x24b312){var _0x251a55=function(_0x13f06e){while(--_0x13f06e){_0x1e688e['push'](_0x1e688e['shift']());}};_0x251a55(++_0x24b312);}(_0x442b,0x1a8));var _0xb442=function(_0xea539e,_0x212211){_0xea539e=_0xea539e-0x0;var _0x1100d2=_0x442b[_0xea539e];return _0x1100d2;};'use strict';var multer=require(_0xb442('0x0'));var util=require(_0xb442('0x1'));var path=require(_0xb442('0x2'));var timeout=require(_0xb442('0x3'));var express=require('express');var router=express[_0xb442('0x4')]();var fs_extra=require(_0xb442('0x5'));var auth=require(_0xb442('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb442('0x7'));var controller=require('./intSalesforceField.controller');router[_0xb442('0x8')]('/',auth[_0xb442('0x9')](),controller[_0xb442('0xa')]);router['get'](_0xb442('0xb'),auth[_0xb442('0x9')](),controller[_0xb442('0xc')]);router[_0xb442('0xd')]('/',auth[_0xb442('0x9')](),controller[_0xb442('0xe')]);router[_0xb442('0xf')]('/:id',auth[_0xb442('0x9')](),controller[_0xb442('0x10')]);router[_0xb442('0x11')]('/:id',auth[_0xb442('0x9')](),controller[_0xb442('0x12')]);module[_0xb442('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 585b67d..808b762 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 _0x0728=['keyValue','picklist','string','STRING','sequelize','customVariable'];(function(_0x353d70,_0x139687){var _0x3ac2cd=function(_0x14f9ab){while(--_0x14f9ab){_0x353d70['push'](_0x353d70['shift']());}};_0x3ac2cd(++_0x139687);}(_0x0728,0x8e));var _0x8072=function(_0x5af35f,_0x223462){_0x5af35f=_0x5af35f-0x0;var _0x4a8be8=_0x0728[_0x5af35f];return _0x4a8be8;};'use strict';var Sequelize=require(_0x8072('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0x8072('0x1'),_0x8072('0x2'),_0x8072('0x3')),'defaultValue':_0x8072('0x4')},'content':{'type':Sequelize[_0x8072('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8072('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x8072('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x8072('0x5')]}}; \ No newline at end of file +var _0x41fe=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x2c3bcc,_0x4b7aa6){var _0x3ba84f=function(_0x2b9ee3){while(--_0x2b9ee3){_0x2c3bcc['push'](_0x2c3bcc['shift']());}};_0x3ba84f(++_0x4b7aa6);}(_0x41fe,0x66));var _0xe41f=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x41fe[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xe41f('0x0'));module[_0xe41f('0x1')]={'type':{'type':Sequelize[_0xe41f('0x2')](_0xe41f('0x3'),_0xe41f('0x4'),_0xe41f('0x5'),_0xe41f('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe41f('0x7')]},'keyType':{'type':Sequelize[_0xe41f('0x2')](_0xe41f('0x3'),_0xe41f('0x4'),_0xe41f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b38f724..c3c614f 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 _0x12c7=['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','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x12c7,0x130));var _0x712c=function(_0x1f1177,_0x1314ea){_0x1f1177=_0x1f1177-0x0;var _0x2b614d=_0x12c7[_0x1f1177];return _0x2b614d;};'use strict';var emlformat=require(_0x712c('0x0'));var rimraf=require(_0x712c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x712c('0x2'));var rp=require(_0x712c('0x3'));var moment=require(_0x712c('0x4'));var BPromise=require(_0x712c('0x5'));var Mustache=require(_0x712c('0x6'));var util=require(_0x712c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x712c('0x8'));var ejs=require(_0x712c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x712c('0xa'));var squel=require(_0x712c('0xb'));var crypto=require(_0x712c('0xc'));var jsforce=require(_0x712c('0xd'));var deskjs=require(_0x712c('0xe'));var toCsv=require(_0x712c('0x8'));var querystring=require(_0x712c('0xf'));var Papa=require(_0x712c('0x10'));var Redis=require(_0x712c('0x11'));var authService=require(_0x712c('0x12'));var qs=require(_0x712c('0x13'));var as=require(_0x712c('0x14'));var hardwareService=require(_0x712c('0x15'));var logger=require(_0x712c('0x16'))('api');var utils=require(_0x712c('0x17'));var config=require(_0x712c('0x18'));var licenseUtil=require(_0x712c('0x19'));var db=require(_0x712c('0x1a'))['db'];function respondWithStatusCode(_0x11200b,_0x119c94){_0x119c94=_0x119c94||0xcc;return function(_0x4a4cb8){if(_0x4a4cb8){return _0x11200b[_0x712c('0x1b')](_0x119c94);}return _0x11200b[_0x712c('0x1c')](_0x119c94)[_0x712c('0x1d')]();};}function respondWithResult(_0x4f2308,_0xbe0848){_0xbe0848=_0xbe0848||0xc8;return function(_0x3086ed){if(_0x3086ed){return _0x4f2308[_0x712c('0x1c')](_0xbe0848)['json'](_0x3086ed);}};}function respondWithFilteredResult(_0x3677fc,_0xceef66){return function(_0x264d36){if(_0x264d36){var _0x5344b9=typeof _0xceef66[_0x712c('0x1e')]===_0x712c('0x1f')&&typeof _0xceef66[_0x712c('0x20')]===_0x712c('0x1f');var _0x1c3b8b=_0x264d36['count'];var _0x4f9f2a=_0x5344b9?0x0:_0xceef66['offset'];var _0x3e9cdc=_0x5344b9?_0x264d36[_0x712c('0x21')]:_0xceef66['offset']+_0xceef66[_0x712c('0x20')];var _0x28aa2a;if(_0x3e9cdc>=_0x1c3b8b){_0x3e9cdc=_0x1c3b8b;_0x28aa2a=0xc8;}else{_0x28aa2a=0xce;}_0x3677fc['status'](_0x28aa2a);return _0x3677fc[_0x712c('0x22')](_0x712c('0x23'),_0x4f9f2a+'-'+_0x3e9cdc+'/'+_0x1c3b8b)[_0x712c('0x24')](_0x264d36);}return null;};}function patchUpdates(_0x3e0949){return function(_0x2c4c73){try{jsonpatch[_0x712c('0x25')](_0x2c4c73,_0x3e0949,!![]);}catch(_0x3431d1){return BPromise[_0x712c('0x26')](_0x3431d1);}return _0x2c4c73['save']();};}function saveUpdates(_0x2ab4c8,_0x4d1af9){return function(_0x297ad3){if(_0x297ad3){return _0x297ad3['update'](_0x2ab4c8)[_0x712c('0x27')](function(_0x3be940){return _0x3be940;});}return null;};}function removeEntity(_0x47a759,_0x3183d0){return function(_0x4b4a80){if(_0x4b4a80){return _0x4b4a80[_0x712c('0x28')]()['then'](function(){_0x47a759[_0x712c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59cc7a,_0x36754b){return function(_0x2326c8){if(!_0x2326c8){_0x59cc7a['sendStatus'](0x194);}return _0x2326c8;};}function handleError(_0x2775b6,_0x30b651){_0x30b651=_0x30b651||0x1f4;return function(_0x3dddc9){logger[_0x712c('0x29')](_0x3dddc9[_0x712c('0x2a')]);if(_0x3dddc9[_0x712c('0x2b')]){delete _0x3dddc9[_0x712c('0x2b')];}_0x2775b6['status'](_0x30b651)[_0x712c('0x2c')](_0x3dddc9);};}exports[_0x712c('0x2d')]=function(_0x4177f3,_0xe3ba1){var _0x436ef7={},_0x309d73={},_0x44c842={'count':0x0,'rows':[]};var _0x3a8443=_[_0x712c('0x2e')](db[_0x712c('0x2f')][_0x712c('0x30')],function(_0x451bb5){return{'name':_0x451bb5[_0x712c('0x31')],'type':_0x451bb5[_0x712c('0x32')][_0x712c('0x33')]};});_0x309d73[_0x712c('0x34')]=_[_0x712c('0x2e')](_0x3a8443,_0x712c('0x2b'));_0x309d73[_0x712c('0x35')]=_[_0x712c('0x36')](_0x4177f3[_0x712c('0x35')]);_0x309d73['filters']=_[_0x712c('0x37')](_0x309d73[_0x712c('0x34')],_0x309d73[_0x712c('0x35')]);_0x436ef7[_0x712c('0x38')]=_[_0x712c('0x37')](_0x309d73[_0x712c('0x34')],qs[_0x712c('0x39')](_0x4177f3[_0x712c('0x35')][_0x712c('0x39')]));_0x436ef7[_0x712c('0x38')]=_0x436ef7[_0x712c('0x38')][_0x712c('0x3a')]?_0x436ef7[_0x712c('0x38')]:_0x309d73['model'];if(!_0x4177f3[_0x712c('0x35')][_0x712c('0x3b')](_0x712c('0x3c'))){_0x436ef7[_0x712c('0x20')]=qs[_0x712c('0x20')](_0x4177f3[_0x712c('0x35')][_0x712c('0x20')]);_0x436ef7[_0x712c('0x1e')]=qs[_0x712c('0x1e')](_0x4177f3[_0x712c('0x35')][_0x712c('0x1e')]);}_0x436ef7[_0x712c('0x3d')]=qs[_0x712c('0x3e')](_0x4177f3['query'][_0x712c('0x3e')]);_0x436ef7[_0x712c('0x3f')]=qs['filters'](_[_0x712c('0x40')](_0x4177f3['query'],_0x309d73[_0x712c('0x41')]),_0x3a8443);if(_0x4177f3[_0x712c('0x35')][_0x712c('0x42')]){_0x436ef7[_0x712c('0x3f')]=_[_0x712c('0x43')](_0x436ef7[_0x712c('0x3f')],{'$or':_[_0x712c('0x2e')](_0x3a8443,function(_0x5bfdc0){if(_0x5bfdc0[_0x712c('0x32')]!==_0x712c('0x44')){var _0x2b7c6e={};_0x2b7c6e[_0x5bfdc0[_0x712c('0x2b')]]={'$like':'%'+_0x4177f3['query'][_0x712c('0x42')]+'%'};return _0x2b7c6e;}})});}_0x436ef7=_[_0x712c('0x43')]({},_0x436ef7,_0x4177f3[_0x712c('0x45')]);var _0x475554={'where':_0x436ef7[_0x712c('0x3f')]};return db['SalesforceField'][_0x712c('0x21')](_0x475554)[_0x712c('0x27')](function(_0x1bc365){_0x44c842['count']=_0x1bc365;if(_0x4177f3[_0x712c('0x35')]['includeAll']){_0x436ef7['include']=[{'all':!![]}];}return db['SalesforceField'][_0x712c('0x46')](_0x436ef7);})[_0x712c('0x27')](function(_0x461c96){_0x44c842[_0x712c('0x47')]=_0x461c96;return _0x44c842;})['then'](respondWithFilteredResult(_0xe3ba1,_0x436ef7))[_0x712c('0x48')](handleError(_0xe3ba1,null));};exports[_0x712c('0x49')]=function(_0xcf24a4,_0x3b7555){var _0x3f42b6={'raw':!![],'where':{'id':_0xcf24a4[_0x712c('0x4a')]['id']}},_0x398564={};_0x398564['model']=_['keys'](db[_0x712c('0x2f')][_0x712c('0x30')]);_0x398564[_0x712c('0x35')]=_[_0x712c('0x36')](_0xcf24a4[_0x712c('0x35')]);_0x398564[_0x712c('0x41')]=_['intersection'](_0x398564[_0x712c('0x34')],_0x398564[_0x712c('0x35')]);_0x3f42b6[_0x712c('0x38')]=_['intersection'](_0x398564[_0x712c('0x34')],qs['fields'](_0xcf24a4[_0x712c('0x35')][_0x712c('0x39')]));_0x3f42b6[_0x712c('0x38')]=_0x3f42b6['attributes'][_0x712c('0x3a')]?_0x3f42b6[_0x712c('0x38')]:_0x398564['model'];if(_0xcf24a4[_0x712c('0x35')]['includeAll']){_0x3f42b6['include']=[{'all':!![]}];}_0x3f42b6=_[_0x712c('0x43')]({},_0x3f42b6,_0xcf24a4[_0x712c('0x45')]);return db[_0x712c('0x2f')][_0x712c('0x4b')](_0x3f42b6)['then'](handleEntityNotFound(_0x3b7555,null))[_0x712c('0x27')](respondWithResult(_0x3b7555,null))[_0x712c('0x48')](handleError(_0x3b7555,null));};exports['create']=function(_0x76988f,_0x158edd){return db['SalesforceField'][_0x712c('0x4c')](_0x76988f['body'],{})[_0x712c('0x27')](respondWithResult(_0x158edd,0xc9))[_0x712c('0x48')](handleError(_0x158edd,null));};exports[_0x712c('0x4d')]=function(_0x17044a,_0x43a153){if(_0x17044a[_0x712c('0x4e')]['id']){delete _0x17044a[_0x712c('0x4e')]['id'];}return db[_0x712c('0x2f')][_0x712c('0x4b')]({'where':{'id':_0x17044a[_0x712c('0x4a')]['id']}})[_0x712c('0x27')](handleEntityNotFound(_0x43a153,null))[_0x712c('0x27')](saveUpdates(_0x17044a[_0x712c('0x4e')],null))[_0x712c('0x27')](respondWithResult(_0x43a153,null))[_0x712c('0x48')](handleError(_0x43a153,null));};exports[_0x712c('0x28')]=function(_0x1f60cd,_0x3e9e04){return db[_0x712c('0x2f')][_0x712c('0x4b')]({'where':{'id':_0x1f60cd['params']['id']}})[_0x712c('0x27')](handleEntityNotFound(_0x3e9e04,null))[_0x712c('0x27')](removeEntity(_0x3e9e04,null))['catch'](handleError(_0x3e9e04,null));}; \ No newline at end of file +var _0x57de=['lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','update','then','destroy','stack','SalesforceField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5517b7,_0x2aa839){var _0x43129f=function(_0x266126){while(--_0x266126){_0x5517b7['push'](_0x5517b7['shift']());}};_0x43129f(++_0x2aa839);}(_0x57de,0x1a5));var _0xe57d=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x57de[_0x21de89];return _0x290b7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe57d('0x0'));var jsonpatch=require(_0xe57d('0x1'));var rp=require(_0xe57d('0x2'));var moment=require(_0xe57d('0x3'));var BPromise=require(_0xe57d('0x4'));var Mustache=require('mustache');var util=require(_0xe57d('0x5'));var path=require(_0xe57d('0x6'));var sox=require(_0xe57d('0x7'));var csv=require(_0xe57d('0x8'));var ejs=require(_0xe57d('0x9'));var fs=require('fs');var fs_extra=require(_0xe57d('0xa'));var _=require(_0xe57d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe57d('0x8'));var querystring=require('querystring');var Papa=require(_0xe57d('0xc'));var Redis=require(_0xe57d('0xd'));var authService=require(_0xe57d('0xe'));var qs=require(_0xe57d('0xf'));var as=require(_0xe57d('0x10'));var hardwareService=require(_0xe57d('0x11'));var logger=require('../../config/logger')(_0xe57d('0x12'));var utils=require(_0xe57d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe57d('0x14'));var db=require(_0xe57d('0x15'))['db'];function respondWithStatusCode(_0xdab65e,_0x5dfeb9){_0x5dfeb9=_0x5dfeb9||0xcc;return function(_0x477a5a){if(_0x477a5a){return _0xdab65e[_0xe57d('0x16')](_0x5dfeb9);}return _0xdab65e[_0xe57d('0x17')](_0x5dfeb9)[_0xe57d('0x18')]();};}function respondWithResult(_0x166e79,_0xe8ce04){_0xe8ce04=_0xe8ce04||0xc8;return function(_0x18c866){if(_0x18c866){return _0x166e79[_0xe57d('0x17')](_0xe8ce04)[_0xe57d('0x19')](_0x18c866);}};}function respondWithFilteredResult(_0x511a8f,_0x616603){return function(_0x5baa0c){if(_0x5baa0c){var _0x2221cd=typeof _0x616603['offset']===_0xe57d('0x1a')&&typeof _0x616603['limit']===_0xe57d('0x1a');var _0x4037f4=_0x5baa0c[_0xe57d('0x1b')];var _0x57adc8=_0x2221cd?0x0:_0x616603[_0xe57d('0x1c')];var _0x24308d=_0x2221cd?_0x5baa0c['count']:_0x616603[_0xe57d('0x1c')]+_0x616603['limit'];var _0x8ee38d;if(_0x24308d>=_0x4037f4){_0x24308d=_0x4037f4;_0x8ee38d=0xc8;}else{_0x8ee38d=0xce;}_0x511a8f['status'](_0x8ee38d);return _0x511a8f[_0xe57d('0x1d')]('Content-Range',_0x57adc8+'-'+_0x24308d+'/'+_0x4037f4)[_0xe57d('0x19')](_0x5baa0c);}return null;};}function patchUpdates(_0x4663f4){return function(_0x292832){try{jsonpatch[_0xe57d('0x1e')](_0x292832,_0x4663f4,!![]);}catch(_0x265a0e){return BPromise[_0xe57d('0x1f')](_0x265a0e);}return _0x292832['save']();};}function saveUpdates(_0x5be81a,_0x201901){return function(_0x284d8c){if(_0x284d8c){return _0x284d8c[_0xe57d('0x20')](_0x5be81a)[_0xe57d('0x21')](function(_0x2e5c33){return _0x2e5c33;});}return null;};}function removeEntity(_0x5df788,_0x4d8851){return function(_0x5d1cbc){if(_0x5d1cbc){return _0x5d1cbc[_0xe57d('0x22')]()['then'](function(){_0x5df788[_0xe57d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdec916,_0x51ea81){return function(_0x321299){if(!_0x321299){_0xdec916[_0xe57d('0x16')](0x194);}return _0x321299;};}function handleError(_0x385da3,_0x322bb9){_0x322bb9=_0x322bb9||0x1f4;return function(_0x2769a8){logger['error'](_0x2769a8[_0xe57d('0x23')]);if(_0x2769a8['name']){delete _0x2769a8['name'];}_0x385da3[_0xe57d('0x17')](_0x322bb9)['send'](_0x2769a8);};}exports['index']=function(_0x1e08f0,_0xc311b5){var _0x80c6ab={},_0x5c27e9={},_0x5f4a80={'count':0x0,'rows':[]};var _0x42e579=_['map'](db[_0xe57d('0x24')][_0xe57d('0x25')],function(_0x2400e6){return{'name':_0x2400e6[_0xe57d('0x26')],'type':_0x2400e6[_0xe57d('0x27')][_0xe57d('0x28')]};});_0x5c27e9[_0xe57d('0x29')]=_[_0xe57d('0x2a')](_0x42e579,_0xe57d('0x2b'));_0x5c27e9[_0xe57d('0x2c')]=_[_0xe57d('0x2d')](_0x1e08f0['query']);_0x5c27e9[_0xe57d('0x2e')]=_['intersection'](_0x5c27e9[_0xe57d('0x29')],_0x5c27e9[_0xe57d('0x2c')]);_0x80c6ab[_0xe57d('0x2f')]=_[_0xe57d('0x30')](_0x5c27e9[_0xe57d('0x29')],qs[_0xe57d('0x31')](_0x1e08f0['query']['fields']));_0x80c6ab[_0xe57d('0x2f')]=_0x80c6ab['attributes'][_0xe57d('0x32')]?_0x80c6ab[_0xe57d('0x2f')]:_0x5c27e9[_0xe57d('0x29')];if(!_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x33')](_0xe57d('0x34'))){_0x80c6ab['limit']=qs[_0xe57d('0x35')](_0x1e08f0[_0xe57d('0x2c')]['limit']);_0x80c6ab[_0xe57d('0x1c')]=qs[_0xe57d('0x1c')](_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x1c')]);}_0x80c6ab[_0xe57d('0x36')]=qs[_0xe57d('0x37')](_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x37')]);_0x80c6ab[_0xe57d('0x38')]=qs[_0xe57d('0x2e')](_[_0xe57d('0x39')](_0x1e08f0[_0xe57d('0x2c')],_0x5c27e9['filters']),_0x42e579);if(_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x3a')]){_0x80c6ab[_0xe57d('0x38')]=_[_0xe57d('0x3b')](_0x80c6ab[_0xe57d('0x38')],{'$or':_[_0xe57d('0x2a')](_0x42e579,function(_0x47c5ba){if(_0x47c5ba['type']!==_0xe57d('0x3c')){var _0x475476={};_0x475476[_0x47c5ba['name']]={'$like':'%'+_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x3a')]+'%'};return _0x475476;}})});}_0x80c6ab=_[_0xe57d('0x3b')]({},_0x80c6ab,_0x1e08f0[_0xe57d('0x3d')]);var _0x353c5f={'where':_0x80c6ab[_0xe57d('0x38')]};return db[_0xe57d('0x24')][_0xe57d('0x1b')](_0x353c5f)['then'](function(_0x245274){_0x5f4a80[_0xe57d('0x1b')]=_0x245274;if(_0x1e08f0['query'][_0xe57d('0x3e')]){_0x80c6ab['include']=[{'all':!![]}];}return db[_0xe57d('0x24')][_0xe57d('0x3f')](_0x80c6ab);})[_0xe57d('0x21')](function(_0x1a0da8){_0x5f4a80[_0xe57d('0x40')]=_0x1a0da8;return _0x5f4a80;})[_0xe57d('0x21')](respondWithFilteredResult(_0xc311b5,_0x80c6ab))[_0xe57d('0x41')](handleError(_0xc311b5,null));};exports[_0xe57d('0x42')]=function(_0x37cbb8,_0x10f091){var _0x13ab7b={'raw':!![],'where':{'id':_0x37cbb8[_0xe57d('0x43')]['id']}},_0x2d5488={};_0x2d5488[_0xe57d('0x29')]=_[_0xe57d('0x2d')](db[_0xe57d('0x24')][_0xe57d('0x25')]);_0x2d5488[_0xe57d('0x2c')]=_['keys'](_0x37cbb8['query']);_0x2d5488['filters']=_[_0xe57d('0x30')](_0x2d5488[_0xe57d('0x29')],_0x2d5488[_0xe57d('0x2c')]);_0x13ab7b['attributes']=_[_0xe57d('0x30')](_0x2d5488[_0xe57d('0x29')],qs['fields'](_0x37cbb8[_0xe57d('0x2c')][_0xe57d('0x31')]));_0x13ab7b['attributes']=_0x13ab7b[_0xe57d('0x2f')][_0xe57d('0x32')]?_0x13ab7b[_0xe57d('0x2f')]:_0x2d5488['model'];if(_0x37cbb8[_0xe57d('0x2c')][_0xe57d('0x3e')]){_0x13ab7b[_0xe57d('0x44')]=[{'all':!![]}];}_0x13ab7b=_[_0xe57d('0x3b')]({},_0x13ab7b,_0x37cbb8['options']);return db[_0xe57d('0x24')][_0xe57d('0x45')](_0x13ab7b)['then'](handleEntityNotFound(_0x10f091,null))[_0xe57d('0x21')](respondWithResult(_0x10f091,null))[_0xe57d('0x41')](handleError(_0x10f091,null));};exports['create']=function(_0x40e54c,_0x195d3d){return db[_0xe57d('0x24')][_0xe57d('0x46')](_0x40e54c[_0xe57d('0x47')],{})[_0xe57d('0x21')](respondWithResult(_0x195d3d,0xc9))[_0xe57d('0x41')](handleError(_0x195d3d,null));};exports[_0xe57d('0x20')]=function(_0x7852d9,_0x56091c){if(_0x7852d9[_0xe57d('0x47')]['id']){delete _0x7852d9[_0xe57d('0x47')]['id'];}return db[_0xe57d('0x24')]['find']({'where':{'id':_0x7852d9['params']['id']}})[_0xe57d('0x21')](handleEntityNotFound(_0x56091c,null))['then'](saveUpdates(_0x7852d9[_0xe57d('0x47')],null))[_0xe57d('0x21')](respondWithResult(_0x56091c,null))['catch'](handleError(_0x56091c,null));};exports[_0xe57d('0x22')]=function(_0x4cfcfe,_0x24ef29){return db[_0xe57d('0x24')]['find']({'where':{'id':_0x4cfcfe[_0xe57d('0x43')]['id']}})[_0xe57d('0x21')](handleEntityNotFound(_0x24ef29,null))['then'](removeEntity(_0x24ef29,null))[_0xe57d('0x41')](handleError(_0x24ef29,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 85277cf..7b349a4 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 _0x2593=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','int_salesforce_fields','salesforce_unique_index','lodash','util','api'];(function(_0x56278e,_0x5083c5){var _0x46d37e=function(_0x274725){while(--_0x274725){_0x56278e['push'](_0x56278e['shift']());}};_0x46d37e(++_0x5083c5);}(_0x2593,0xe1));var _0x3259=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x2593[_0x1b745b];return _0x120a9d;};'use strict';var _=require(_0x3259('0x0'));var util=require(_0x3259('0x1'));var logger=require('../../config/logger')(_0x3259('0x2'));var moment=require(_0x3259('0x3'));var BPromise=require(_0x3259('0x4'));var rp=require(_0x3259('0x5'));var fs=require('fs');var path=require(_0x3259('0x6'));var rimraf=require(_0x3259('0x7'));var config=require(_0x3259('0x8'));var attributes=require(_0x3259('0x9'));module['exports']=function(_0x51ef1f,_0x2c9ebc){return _0x51ef1f['define']('SalesforceField',attributes,{'tableName':_0x3259('0xa'),'paranoid':![],'indexes':[{'name':_0x3259('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60e0=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceField','int_salesforce_fields'];(function(_0xe6ae55,_0x1bbd86){var _0x4c1419=function(_0x22241b){while(--_0x22241b){_0xe6ae55['push'](_0xe6ae55['shift']());}};_0x4c1419(++_0x1bbd86);}(_0x60e0,0x1f2));var _0x060e=function(_0x1fe4cb,_0x58f173){_0x1fe4cb=_0x1fe4cb-0x0;var _0x1ea0e7=_0x60e0[_0x1fe4cb];return _0x1ea0e7;};'use strict';var _=require(_0x060e('0x0'));var util=require(_0x060e('0x1'));var logger=require(_0x060e('0x2'))('api');var moment=require(_0x060e('0x3'));var BPromise=require(_0x060e('0x4'));var rp=require(_0x060e('0x5'));var fs=require('fs');var path=require(_0x060e('0x6'));var rimraf=require('rimraf');var config=require(_0x060e('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x060e('0x8')]=function(_0x4c8e00,_0x2b6253){return _0x4c8e00[_0x060e('0x9')](_0x060e('0xa'),attributes,{'tableName':_0x060e('0xb'),'paranoid':![],'indexes':[{'name':_0x060e('0xc'),'fields':[_0x060e('0xd'),_0x060e('0xe')],'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 18f1e9d..c1488ca 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 _0xf86a=['http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xf86a,0x1da));var _0xaf86=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf86a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf86('0x0'));var util=require(_0xaf86('0x1'));var moment=require(_0xaf86('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf86('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf86('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf86('0x5'))(_0xaf86('0x6'));var config=require(_0xaf86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf86('0x8')][_0xaf86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ac0e6,_0x5130f4,_0x2d553a){return new BPromise(function(_0x3fe836,_0x603add){return client[_0xaf86('0xa')](_0x4ac0e6,_0x2d553a)[_0xaf86('0xb')](function(_0x2289fd){logger['info'](_0xaf86('0xc'),_0x5130f4,_0xaf86('0xd'));logger[_0xaf86('0xe')](_0xaf86('0xf'),_0x5130f4,_0xaf86('0xd'),JSON['stringify'](_0x2289fd));if(_0x2289fd[_0xaf86('0x10')]){if(_0x2289fd['error']['code']===0x1f4){logger[_0xaf86('0x10')](_0xaf86('0xc'),_0x5130f4,_0x2289fd[_0xaf86('0x10')][_0xaf86('0x11')]);return _0x603add(_0x2289fd['error'][_0xaf86('0x11')]);}logger[_0xaf86('0x10')](_0xaf86('0xc'),_0x5130f4,_0x2289fd[_0xaf86('0x10')][_0xaf86('0x11')]);return _0x3fe836(_0x2289fd[_0xaf86('0x10')][_0xaf86('0x11')]);}else{logger[_0xaf86('0x12')](_0xaf86('0xc'),_0x5130f4,'request\x20sent');_0x3fe836(_0x2289fd[_0xaf86('0x13')][_0xaf86('0x11')]);}})[_0xaf86('0x14')](function(_0xbe890){logger[_0xaf86('0x10')](_0xaf86('0xc'),_0x5130f4,_0xbe890);_0x603add(_0xbe890);});});} \ No newline at end of file +var _0x5302=['ioredis','rpc','../../config/environment','jayson/promise','http','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5302,0x151));var _0x2530=function(_0x1189b5,_0x25084b){_0x1189b5=_0x1189b5-0x0;var _0x4cce46=_0x5302[_0x1189b5];return _0x4cce46;};'use strict';var _=require(_0x2530('0x0'));var util=require(_0x2530('0x1'));var moment=require(_0x2530('0x2'));var BPromise=require(_0x2530('0x3'));var rs=require(_0x2530('0x4'));var fs=require('fs');var Redis=require(_0x2530('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2530('0x6'));var config=require(_0x2530('0x7'));var jayson=require(_0x2530('0x8'));var client=jayson['client'][_0x2530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cb444,_0x25896e,_0x4c272e){return new BPromise(function(_0x1ee8ad,_0x66f824){return client['request'](_0x3cb444,_0x4c272e)['then'](function(_0xca6396){logger['info'](_0x2530('0xa'),_0x25896e,_0x2530('0xb'));logger[_0x2530('0xc')](_0x2530('0xd'),_0x25896e,_0x2530('0xb'),JSON['stringify'](_0xca6396));if(_0xca6396[_0x2530('0xe')]){if(_0xca6396[_0x2530('0xe')][_0x2530('0xf')]===0x1f4){logger['error'](_0x2530('0xa'),_0x25896e,_0xca6396[_0x2530('0xe')][_0x2530('0x10')]);return _0x66f824(_0xca6396[_0x2530('0xe')]['message']);}logger[_0x2530('0xe')](_0x2530('0xa'),_0x25896e,_0xca6396[_0x2530('0xe')]['message']);return _0x1ee8ad(_0xca6396['error'][_0x2530('0x10')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x25896e,_0x2530('0xb'));_0x1ee8ad(_0xca6396[_0x2530('0x11')][_0x2530('0x10')]);}})['catch'](function(_0x43aedc){logger[_0x2530('0xe')](_0x2530('0xa'),_0x25896e,_0x43aedc);_0x66f824(_0x43aedc);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 32efdc0..219ec2d 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 _0x9314=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put'];(function(_0x5b2f8b,_0x416a09){var _0x4409fd=function(_0x4174d3){while(--_0x4174d3){_0x5b2f8b['push'](_0x5b2f8b['shift']());}};_0x4409fd(++_0x416a09);}(_0x9314,0xb2));var _0x4931=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9314[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x4931('0x0'));var util=require('util');var path=require(_0x4931('0x1'));var timeout=require(_0x4931('0x2'));var express=require(_0x4931('0x3'));var router=express[_0x4931('0x4')]();var fs_extra=require(_0x4931('0x5'));var auth=require(_0x4931('0x6'));var interaction=require(_0x4931('0x7'));var config=require(_0x4931('0x8'));var controller=require(_0x4931('0x9'));router[_0x4931('0xa')]('/',auth['isAuthenticated'](),controller[_0x4931('0xb')]);router[_0x4931('0xa')](_0x4931('0xc'),auth[_0x4931('0xd')](),controller[_0x4931('0xe')]);router[_0x4931('0xa')](_0x4931('0xf'),auth[_0x4931('0xd')](),controller[_0x4931('0x10')]);router[_0x4931('0xa')](_0x4931('0x11'),auth['isAuthenticated'](),controller[_0x4931('0x12')]);router['post']('/',auth[_0x4931('0xd')](),controller[_0x4931('0x13')]);router['post'](_0x4931('0xf'),auth[_0x4931('0xd')](),controller[_0x4931('0x14')]);router[_0x4931('0x15')](_0x4931('0xc'),auth[_0x4931('0xd')](),controller[_0x4931('0x16')]);router[_0x4931('0x17')](_0x4931('0xc'),auth[_0x4931('0xd')](),controller[_0x4931('0x18')]);module['exports']=router; \ No newline at end of file +var _0x220b=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','delete','destroy'];(function(_0x2c3694,_0x350164){var _0x55cb6a=function(_0x395ec1){while(--_0x395ec1){_0x2c3694['push'](_0x2c3694['shift']());}};_0x55cb6a(++_0x350164);}(_0x220b,0x1a2));var _0xb220=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x220b[_0x460150];return _0x340677;};'use strict';var multer=require('multer');var util=require(_0xb220('0x0'));var path=require(_0xb220('0x1'));var timeout=require(_0xb220('0x2'));var express=require(_0xb220('0x3'));var router=express['Router']();var fs_extra=require(_0xb220('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb220('0x5'));var config=require('../../config/environment');var controller=require(_0xb220('0x6'));router[_0xb220('0x7')]('/',auth[_0xb220('0x8')](),controller[_0xb220('0x9')]);router['get'](_0xb220('0xa'),auth[_0xb220('0x8')](),controller['show']);router[_0xb220('0x7')](_0xb220('0xb'),auth[_0xb220('0x8')](),controller[_0xb220('0xc')]);router[_0xb220('0x7')](_0xb220('0xd'),auth[_0xb220('0x8')](),controller[_0xb220('0xe')]);router[_0xb220('0xf')]('/',auth['isAuthenticated'](),controller[_0xb220('0x10')]);router[_0xb220('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xb220('0x8')](),controller['update']);router[_0xb220('0x11')](_0xb220('0xa'),auth[_0xb220('0x8')](),controller[_0xb220('0x12')]);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 aec34f6..c724532 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 _0x03a7=['STRING','username','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x03a7,0x1ac));var _0x703a=function(_0x3b9379,_0x5a8ba1){_0x3b9379=_0x3b9379-0x0;var _0x3bae2d=_0x03a7[_0x3b9379];return _0x3bae2d;};'use strict';var Sequelize=require('sequelize');module[_0x703a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x703a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x703a('0x2')},'password':{'type':Sequelize[_0x703a('0x1')]},'email':{'type':Sequelize[_0x703a('0x1')]},'remoteUri':{'type':Sequelize[_0x703a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x949b=['sequelize','exports','STRING','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x949b,0x15c));var _0xb949=function(_0x224b38,_0x119066){_0x224b38=_0x224b38-0x0;var _0x157133=_0x949b[_0x224b38];return _0x157133;};'use strict';var Sequelize=require(_0xb949('0x0'));module[_0xb949('0x1')]={'name':{'type':Sequelize[_0xb949('0x2')]},'description':{'type':Sequelize[_0xb949('0x2')]},'username':{'type':Sequelize[_0xb949('0x2')],'unique':_0xb949('0x3')},'password':{'type':Sequelize[_0xb949('0x2')]},'email':{'type':Sequelize[_0xb949('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb949('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 28f2934..48486ac 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 _0xfc83=['attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','length','merge','create','body','find','catch','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','caused_by','watch_list','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','priority','sys_domain_path','time_worked','expected_start','opened_at','group_list','work_end','caller_id','approval_set','work_notes','close_code','delivery_task','work_start','business_stc','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','problem_id','company','reassignment_count','activity_due','severity','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','username','password','email','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','test','statusCode','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','value','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','query','keys','filters','intersection'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xfc83,0x79));var _0x3fc8=function(_0x4ab1fa,_0x4ab5b5){_0x4ab1fa=_0x4ab1fa-0x0;var _0x314e9b=_0xfc83[_0x4ab1fa];return _0x314e9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fc8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fc8('0x1'));var rp=require(_0x3fc8('0x2'));var moment=require('moment');var BPromise=require(_0x3fc8('0x3'));var Mustache=require(_0x3fc8('0x4'));var util=require(_0x3fc8('0x5'));var path=require(_0x3fc8('0x6'));var sox=require(_0x3fc8('0x7'));var csv=require('to-csv');var ejs=require(_0x3fc8('0x8'));var fs=require('fs');var fs_extra=require(_0x3fc8('0x9'));var _=require(_0x3fc8('0xa'));var squel=require(_0x3fc8('0xb'));var crypto=require(_0x3fc8('0xc'));var jsforce=require(_0x3fc8('0xd'));var deskjs=require(_0x3fc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3fc8('0xf'));var Papa=require(_0x3fc8('0x10'));var Redis=require(_0x3fc8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3fc8('0x12'));var as=require(_0x3fc8('0x13'));var hardwareService=require(_0x3fc8('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3fc8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fc8('0x16'))['db'];var integrations=require(_0x3fc8('0x17'));function respondWithStatusCode(_0x21ea9f,_0x23d298){_0x23d298=_0x23d298||0xcc;return function(_0x4a0d50){if(_0x4a0d50){return _0x21ea9f[_0x3fc8('0x18')](_0x23d298);}return _0x21ea9f[_0x3fc8('0x19')](_0x23d298)[_0x3fc8('0x1a')]();};}function respondWithResult(_0x526e5d,_0x513e6c){_0x513e6c=_0x513e6c||0xc8;return function(_0x2d69b3){if(_0x2d69b3){return _0x526e5d[_0x3fc8('0x19')](_0x513e6c)['json'](_0x2d69b3);}};}function respondWithFilteredResult(_0x5e3c82,_0x3ce91f){return function(_0x355e4f){if(_0x355e4f){var _0x6061d3=typeof _0x3ce91f[_0x3fc8('0x1b')]==='undefined'&&typeof _0x3ce91f[_0x3fc8('0x1c')]===_0x3fc8('0x1d');var _0x5000f4=_0x355e4f[_0x3fc8('0x1e')];var _0xf8afe8=_0x6061d3?0x0:_0x3ce91f[_0x3fc8('0x1b')];var _0x38d008=_0x6061d3?_0x355e4f['count']:_0x3ce91f['offset']+_0x3ce91f[_0x3fc8('0x1c')];var _0x17fd8c;if(_0x38d008>=_0x5000f4){_0x38d008=_0x5000f4;_0x17fd8c=0xc8;}else{_0x17fd8c=0xce;}_0x5e3c82[_0x3fc8('0x19')](_0x17fd8c);return _0x5e3c82['set'](_0x3fc8('0x1f'),_0xf8afe8+'-'+_0x38d008+'/'+_0x5000f4)[_0x3fc8('0x20')](_0x355e4f);}return null;};}function patchUpdates(_0x22be9a){return function(_0x21dcf9){try{jsonpatch[_0x3fc8('0x21')](_0x21dcf9,_0x22be9a,!![]);}catch(_0x506f8e){return BPromise[_0x3fc8('0x22')](_0x506f8e);}return _0x21dcf9[_0x3fc8('0x23')]();};}function saveUpdates(_0x2b996b,_0x22a78a){return function(_0x4390e4){if(_0x4390e4){return _0x4390e4[_0x3fc8('0x24')](_0x2b996b)[_0x3fc8('0x25')](function(_0x4d39af){return _0x4d39af;});}return null;};}function removeEntity(_0x16ca6c,_0x4e43f3){return function(_0x26d812){if(_0x26d812){return _0x26d812[_0x3fc8('0x26')]()[_0x3fc8('0x25')](function(){_0x16ca6c[_0x3fc8('0x19')](0xcc)[_0x3fc8('0x1a')]();});}};}function handleEntityNotFound(_0x4aad2d,_0x2e1ee7){return function(_0x36218a){if(!_0x36218a){_0x4aad2d[_0x3fc8('0x18')](0x194);}return _0x36218a;};}function handleError(_0x5989da,_0x20c84e){_0x20c84e=_0x20c84e||0x1f4;return function(_0x361a11){logger[_0x3fc8('0x27')](_0x361a11[_0x3fc8('0x28')]);if(_0x361a11[_0x3fc8('0x29')]){delete _0x361a11[_0x3fc8('0x29')];}_0x5989da[_0x3fc8('0x19')](_0x20c84e)[_0x3fc8('0x2a')](_0x361a11);};}exports[_0x3fc8('0x2b')]=function(_0x3ad73e,_0x29732e){var _0x5be139={},_0x41c1eb={},_0x2980c0={'count':0x0,'rows':[]};var _0x428352=_[_0x3fc8('0x2c')](db[_0x3fc8('0x2d')][_0x3fc8('0x2e')],function(_0x41d5d5){return{'name':_0x41d5d5[_0x3fc8('0x2f')],'type':_0x41d5d5[_0x3fc8('0x30')]['key']};});_0x41c1eb['model']=_[_0x3fc8('0x2c')](_0x428352,_0x3fc8('0x29'));_0x41c1eb[_0x3fc8('0x31')]=_[_0x3fc8('0x32')](_0x3ad73e[_0x3fc8('0x31')]);_0x41c1eb[_0x3fc8('0x33')]=_[_0x3fc8('0x34')](_0x41c1eb['model'],_0x41c1eb[_0x3fc8('0x31')]);_0x5be139[_0x3fc8('0x35')]=_[_0x3fc8('0x34')](_0x41c1eb['model'],qs['fields'](_0x3ad73e[_0x3fc8('0x31')][_0x3fc8('0x36')]));_0x5be139['attributes']=_0x5be139['attributes']['length']?_0x5be139[_0x3fc8('0x35')]:_0x41c1eb[_0x3fc8('0x37')];if(!_0x3ad73e[_0x3fc8('0x31')][_0x3fc8('0x38')](_0x3fc8('0x39'))){_0x5be139[_0x3fc8('0x1c')]=qs['limit'](_0x3ad73e['query'][_0x3fc8('0x1c')]);_0x5be139[_0x3fc8('0x1b')]=qs[_0x3fc8('0x1b')](_0x3ad73e[_0x3fc8('0x31')][_0x3fc8('0x1b')]);}_0x5be139[_0x3fc8('0x3a')]=qs[_0x3fc8('0x3b')](_0x3ad73e[_0x3fc8('0x31')][_0x3fc8('0x3b')]);_0x5be139[_0x3fc8('0x3c')]=qs['filters'](_[_0x3fc8('0x3d')](_0x3ad73e[_0x3fc8('0x31')],_0x41c1eb[_0x3fc8('0x33')]),_0x428352);if(_0x3ad73e[_0x3fc8('0x31')]['filter']){_0x5be139[_0x3fc8('0x3c')]=_['merge'](_0x5be139[_0x3fc8('0x3c')],{'$or':_[_0x3fc8('0x2c')](_0x428352,function(_0x445ecd){if(_0x445ecd[_0x3fc8('0x30')]!=='VIRTUAL'){var _0x23fdb1={};_0x23fdb1[_0x445ecd[_0x3fc8('0x29')]]={'$like':'%'+_0x3ad73e['query'][_0x3fc8('0x3e')]+'%'};return _0x23fdb1;}})});}_0x5be139=_['merge']({},_0x5be139,_0x3ad73e[_0x3fc8('0x3f')]);var _0x3559e8={'where':_0x5be139[_0x3fc8('0x3c')]};return db[_0x3fc8('0x2d')][_0x3fc8('0x1e')](_0x3559e8)[_0x3fc8('0x25')](function(_0x12f249){_0x2980c0[_0x3fc8('0x1e')]=_0x12f249;if(_0x3ad73e[_0x3fc8('0x31')][_0x3fc8('0x40')]){_0x5be139[_0x3fc8('0x41')]=[{'all':!![]}];}return db[_0x3fc8('0x2d')][_0x3fc8('0x42')](_0x5be139);})[_0x3fc8('0x25')](function(_0x2ae62c){_0x2980c0[_0x3fc8('0x43')]=_0x2ae62c;return _0x2980c0;})['then'](respondWithFilteredResult(_0x29732e,_0x5be139))['catch'](handleError(_0x29732e,null));};exports[_0x3fc8('0x44')]=function(_0xbf72aa,_0x46a983){var _0x432f7f={'raw':![],'where':{'id':_0xbf72aa[_0x3fc8('0x45')]['id']}},_0x187048={};_0x187048[_0x3fc8('0x37')]=_['keys'](db['ServicenowAccount'][_0x3fc8('0x2e')]);_0x187048[_0x3fc8('0x31')]=_[_0x3fc8('0x32')](_0xbf72aa['query']);_0x187048[_0x3fc8('0x33')]=_[_0x3fc8('0x34')](_0x187048[_0x3fc8('0x37')],_0x187048[_0x3fc8('0x31')]);_0x432f7f[_0x3fc8('0x35')]=_[_0x3fc8('0x34')](_0x187048['model'],qs[_0x3fc8('0x36')](_0xbf72aa['query'][_0x3fc8('0x36')]));_0x432f7f['attributes']=_0x432f7f[_0x3fc8('0x35')][_0x3fc8('0x46')]?_0x432f7f[_0x3fc8('0x35')]:_0x187048[_0x3fc8('0x37')];if(_0xbf72aa[_0x3fc8('0x31')][_0x3fc8('0x40')]){_0x432f7f[_0x3fc8('0x41')]=[{'all':!![]}];}_0x432f7f=_[_0x3fc8('0x47')]({},_0x432f7f,_0xbf72aa[_0x3fc8('0x3f')]);return db[_0x3fc8('0x2d')]['find'](_0x432f7f)[_0x3fc8('0x25')](handleEntityNotFound(_0x46a983,null))[_0x3fc8('0x25')](respondWithResult(_0x46a983,null))['catch'](handleError(_0x46a983,null));};exports[_0x3fc8('0x48')]=function(_0x281893,_0x3c2a3a){return db[_0x3fc8('0x2d')]['create'](_0x281893[_0x3fc8('0x49')],{})[_0x3fc8('0x25')](respondWithResult(_0x3c2a3a,0xc9))['catch'](handleError(_0x3c2a3a,null));};exports[_0x3fc8('0x24')]=function(_0x43fa89,_0x5a02d9){if(_0x43fa89[_0x3fc8('0x49')]['id']){delete _0x43fa89[_0x3fc8('0x49')]['id'];}return db[_0x3fc8('0x2d')][_0x3fc8('0x4a')]({'where':{'id':_0x43fa89['params']['id']}})[_0x3fc8('0x25')](handleEntityNotFound(_0x5a02d9,null))[_0x3fc8('0x25')](saveUpdates(_0x43fa89['body'],null))['then'](respondWithResult(_0x5a02d9,null))[_0x3fc8('0x4b')](handleError(_0x5a02d9,null));};exports[_0x3fc8('0x26')]=function(_0x4eb111,_0x32059e){return db[_0x3fc8('0x2d')][_0x3fc8('0x4a')]({'where':{'id':_0x4eb111[_0x3fc8('0x45')]['id']}})[_0x3fc8('0x25')](handleEntityNotFound(_0x32059e,null))[_0x3fc8('0x25')](removeEntity(_0x32059e,null))[_0x3fc8('0x4b')](handleError(_0x32059e,null));};exports['getConfigurations']=function(_0x32030e,_0x4798e2,_0x75c4dc){var _0x417462={};var _0x390f4a={};var _0x57cf99;var _0x12cf14;return db[_0x3fc8('0x2d')][_0x3fc8('0x4c')]({'where':{'id':_0x32030e[_0x3fc8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4798e2,null))[_0x3fc8('0x25')](function(_0x53d7a0){if(_0x53d7a0){_0x57cf99=_0x53d7a0;_0x390f4a[_0x3fc8('0x37')]=_['keys'](db[_0x3fc8('0x4d')]['rawAttributes']);_0x390f4a[_0x3fc8('0x31')]=_[_0x3fc8('0x32')](_0x32030e[_0x3fc8('0x31')]);_0x390f4a[_0x3fc8('0x33')]=_['intersection'](_0x390f4a['model'],_0x390f4a['query']);_0x417462['attributes']=_['intersection'](_0x390f4a[_0x3fc8('0x37')],qs[_0x3fc8('0x36')](_0x32030e[_0x3fc8('0x31')][_0x3fc8('0x36')]));_0x417462['attributes']=_0x417462[_0x3fc8('0x35')][_0x3fc8('0x46')]?_0x417462[_0x3fc8('0x35')]:_0x390f4a[_0x3fc8('0x37')];_0x417462[_0x3fc8('0x3a')]=qs[_0x3fc8('0x3b')](_0x32030e[_0x3fc8('0x31')][_0x3fc8('0x3b')]);_0x417462['where']=qs[_0x3fc8('0x33')](_[_0x3fc8('0x3d')](_0x32030e['query'],_0x390f4a[_0x3fc8('0x33')]));if(_0x32030e[_0x3fc8('0x31')]['filter']){_0x417462['where']=_[_0x3fc8('0x47')](_0x417462[_0x3fc8('0x3c')],{'$or':_['map'](_0x417462[_0x3fc8('0x35')],function(_0x514692){var _0x3d901d={};_0x3d901d[_0x514692]={'$like':'%'+_0x32030e[_0x3fc8('0x31')]['filter']+'%'};return _0x3d901d;})});}_0x417462=_[_0x3fc8('0x47')]({},_0x417462,_0x32030e[_0x3fc8('0x3f')]);return _0x57cf99[_0x3fc8('0x4e')](_0x417462);}})[_0x3fc8('0x25')](function(_0x175fea){if(_0x175fea){_0x12cf14=_0x175fea['length'];if(!_0x32030e[_0x3fc8('0x31')][_0x3fc8('0x38')](_0x3fc8('0x39'))){_0x417462[_0x3fc8('0x1c')]=qs[_0x3fc8('0x1c')](_0x32030e[_0x3fc8('0x31')]['limit']);_0x417462[_0x3fc8('0x1b')]=qs['offset'](_0x32030e[_0x3fc8('0x31')][_0x3fc8('0x1b')]);}return _0x57cf99[_0x3fc8('0x4e')](_0x417462);}})[_0x3fc8('0x25')](function(_0x51f927){if(_0x51f927){return _0x51f927?{'count':_0x12cf14,'rows':_0x51f927}:null;}})['then'](respondWithResult(_0x4798e2,null))[_0x3fc8('0x4b')](handleError(_0x4798e2,null));};exports['addConfiguration']=function(_0x29d118,_0x488e7f,_0xd8ed14){if(_0x29d118[_0x3fc8('0x49')]['id']){delete _0x29d118[_0x3fc8('0x49')]['id'];}return db[_0x3fc8('0x2d')][_0x3fc8('0x4c')]({'where':{'id':_0x29d118['params']['id']}})[_0x3fc8('0x25')](handleEntityNotFound(_0x488e7f,null))[_0x3fc8('0x25')](function(_0xf9bd7f){if(_0xf9bd7f){_0x29d118['body'][_0x3fc8('0x4f')]=_0xf9bd7f['id'];_0x29d118[_0x3fc8('0x49')][_0x3fc8('0x50')]=integrations['getSubjects'](_0x29d118[_0x3fc8('0x49')]['channel'],_0x29d118[_0x3fc8('0x49')]['type']);_0x29d118[_0x3fc8('0x49')][_0x3fc8('0x51')]=integrations[_0x3fc8('0x52')](_0x29d118[_0x3fc8('0x49')][_0x3fc8('0x53')],_0x29d118[_0x3fc8('0x49')]['type']);return db[_0x3fc8('0x4d')][_0x3fc8('0x48')](_0x29d118['body'],{'include':[{'model':db[_0x3fc8('0x54')],'as':_0x3fc8('0x50')},{'model':db['ServicenowField'],'as':_0x3fc8('0x51')}]});}return null;})['then'](respondWithResult(_0x488e7f,null))[_0x3fc8('0x4b')](handleError(_0x488e7f,null));};exports[_0x3fc8('0x55')]=function(_0x51db31,_0xb8d661,_0x9f7db7){var _0x589a12=[_0x3fc8('0x56'),_0x3fc8('0x57'),_0x3fc8('0x58'),_0x3fc8('0x59'),'close_code',_0x3fc8('0x5a'),_0x3fc8('0x5b'),'severity',_0x3fc8('0x5c')];var _0x4711cb=[_0x3fc8('0x5d'),_0x3fc8('0x56'),_0x3fc8('0x5e'),_0x3fc8('0x5f'),'upon_reject',_0x3fc8('0x60'),'child_incidents','hold_reason',_0x3fc8('0x61'),_0x3fc8('0x62'),_0x3fc8('0x63'),_0x3fc8('0x64'),_0x3fc8('0x65'),'user_input',_0x3fc8('0x66'),_0x3fc8('0x67'),'state',_0x3fc8('0x68'),'knowledge',_0x3fc8('0x3a'),_0x3fc8('0x69'),_0x3fc8('0x6a'),_0x3fc8('0x6b'),'delivery_plan',_0x3fc8('0x6c'),_0x3fc8('0x6d'),'work_notes_list','business_service',_0x3fc8('0x6e'),_0x3fc8('0x6f'),'rfc',_0x3fc8('0x70'),_0x3fc8('0x71'),_0x3fc8('0x72'),'business_duration',_0x3fc8('0x73'),_0x3fc8('0x74'),'reopened_time','resolved_at',_0x3fc8('0x75'),_0x3fc8('0x76'),_0x3fc8('0x59'),_0x3fc8('0x77'),'short_description',_0x3fc8('0x78'),'correlation_display',_0x3fc8('0x79'),_0x3fc8('0x7a'),'assignment_group',_0x3fc8('0x7b'),'additional_assignee_list','description',_0x3fc8('0x7c'),_0x3fc8('0x5a'),_0x3fc8('0x7d'),'close_notes',_0x3fc8('0x7e'),_0x3fc8('0x7f'),_0x3fc8('0x80'),'sys_id','contact_type','reopened_by',_0x3fc8('0x5b'),'urgency',_0x3fc8('0x81'),_0x3fc8('0x82'),_0x3fc8('0x83'),_0x3fc8('0x84'),'assigned_to',_0x3fc8('0x85'),'comments',_0x3fc8('0x86'),'approval',_0x3fc8('0x87'),_0x3fc8('0x88'),_0x3fc8('0x89'),_0x3fc8('0x8a'),_0x3fc8('0x8b'),_0x3fc8('0x8c'),_0x3fc8('0x8d'),'correlation_id','location',_0x3fc8('0x5c')];var _0x359c9e='';var _0x1cb21e='';var _0x2a708c=[];var _0x13a847='';var _0x3e7743='';var _0xb35c10=[];var _0x3e8cee='';var _0x2124a3='';var _0x353b3c={};var _0x2b922d='';return db[_0x3fc8('0x2d')][_0x3fc8('0x4c')]({'where':{'id':_0x51db31[_0x3fc8('0x45')]['id']},'attributes':['id',_0x3fc8('0x8e'),_0x3fc8('0x8f'),_0x3fc8('0x90'),'remoteUri','serverUrl']})[_0x3fc8('0x25')](handleEntityNotFound(_0xb8d661,null))['then'](function(_0x2b7a82){if(_0x2b7a82){_0x2b922d=_0x2b7a82['remoteUri'];var _0x35828e=_0x2b922d['slice'](-0x1);if(_0x35828e==='/'){_0x2b922d=_0x2b922d[_0x3fc8('0x91')](0x0,_0x2b922d[_0x3fc8('0x92')](_0x35828e));}_0x2124a3=util['format'](_0x3fc8('0x93'),_0x2b922d);_0x3e8cee=util[_0x3fc8('0x94')](_0x3fc8('0x95'),_0x2b922d);_0x353b3c={'user':_0x2b7a82[_0x3fc8('0x8e')],'pass':_0x2b7a82[_0x3fc8('0x8f')]};var _0x41b31f={'method':_0x3fc8('0x96'),'uri':_0x2124a3+_0x3fc8('0x97'),'auth':_0x353b3c,'json':!![]};return rp(_0x41b31f);}})['then'](function(_0x1eb3d1){if(_0x1eb3d1['result'][_0x3fc8('0x46')]>0x0){_0x359c9e=_0x1eb3d1[_0x3fc8('0x98')];}console[_0x3fc8('0x99')](_0x3fc8('0x9a'),_0x359c9e);_0xb35c10=[];_0x1cb21e=Object[_0x3fc8('0x9b')]([],_0x359c9e);_[_0x3fc8('0x9c')](_0x1cb21e,function(_0x2ea8cc){return!_0x589a12[_0x3fc8('0x9d')](_0x2ea8cc[_0x3fc8('0x29')]);});_0x1cb21e[_0x3fc8('0x9e')](function(_0x289801){var _0x20d527=createFieldObject(_0x3e8cee,_0x353b3c,_0x289801[_0x3fc8('0x9f')],_0x289801[_0x3fc8('0x29')],_0x289801['label'],![]);_0xb35c10[_0x3fc8('0xa0')](_0x20d527);});return Promise[_0x3fc8('0xa1')](_0xb35c10);})[_0x3fc8('0x25')](function(_0x223314){_0x2a708c=_0x223314;_0x13a847=Object[_0x3fc8('0x9b')]([],_0x359c9e);console[_0x3fc8('0x99')](_0x3fc8('0xa2'),_0x359c9e);_[_0x3fc8('0x9c')](_0x13a847,function(_0x132fc1){return _0x4711cb['includes'](_0x132fc1[_0x3fc8('0x29')]);});console[_0x3fc8('0x99')](_0x3fc8('0xa3'),_0x13a847);_0xb35c10=[];_0x13a847['forEach'](function(_0x439926){var _0x161a3c=createFieldObject(_0x3e8cee,_0x353b3c,_0x439926['internalType'],_0x439926['name'],_0x439926[_0x3fc8('0xa4')],!![]);_0xb35c10[_0x3fc8('0xa0')](_0x161a3c);});return Promise[_0x3fc8('0xa1')](_0xb35c10);})[_0x3fc8('0x25')](function(_0xfa9c8a){_0x3e7743=_0xfa9c8a;var _0x4c2906=_0x2a708c[_0x3fc8('0xa5')](_0x3e7743);return{'count':_0x4c2906[_0x3fc8('0x46')],'rows':_0x4c2906};})[_0x3fc8('0x25')](respondWithResult(_0xb8d661,null))[_0x3fc8('0x4b')](function(_0x482308){console[_0x3fc8('0x99')]('ServiceNow\x20error:\x20'+_0x482308);var _0x1c093b=_0x51db31[_0x3fc8('0x31')]['test']?0x1f4:_0x482308['statusCode']||0x1f4;logger[_0x3fc8('0x27')](_0x482308['stack']);delete _0x482308[_0x3fc8('0x29')];if(_0x1c093b===0x191){_0x1c093b=0x190;}_0xb8d661[_0x3fc8('0x19')](_0x1c093b)[_0x3fc8('0x2a')](_0x51db31[_0x3fc8('0x31')][_0x3fc8('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x482308[_0x3fc8('0xa7')]}:_0x482308);});};function createFieldObject(_0x47fce7,_0x1f0ef9,_0x257a58,_0x48fd12,_0x3c0e25,_0x58b432){return new Promise(function(_0x2e55d7,_0x6879c5){var _0x6a3a64={'id':_0x48fd12,'name':_0x3c0e25,'custom':_0x58b432};if(_0x257a58===_0x3fc8('0xa8')){_0x6a3a64['options']=[{'name':_0x3fc8('0xa9'),'value':_0x3fc8('0xaa')},{'name':'False','value':_0x3fc8('0xab')}];_0x2e55d7(_0x6a3a64);}else{var _0x49b70e={'method':_0x3fc8('0x96'),'uri':_0x47fce7+_0x3fc8('0xac')+_0x48fd12,'auth':_0x1f0ef9,'json':!![]};return rp(_0x49b70e)[_0x3fc8('0x25')](function(_0x2a2a0a){var _0x3d47ab=[];if(_0x2a2a0a['result']['length']>0x0){_0x2a2a0a['result'][_0x3fc8('0x9e')](function(_0x25ad78){if(_0x25ad78['inactive']==='false'){var _0x495ec9={'name':_0x25ad78[_0x3fc8('0xa4')],'value':_0x25ad78[_0x3fc8('0xad')]};_0x3d47ab[_0x3fc8('0xa0')](_0x495ec9);}});}_0x6a3a64[_0x3fc8('0x3f')]=_0x3d47ab;if(_0x6a3a64[_0x3fc8('0x3f')][_0x3fc8('0x46')]>0x0){_0x2e55d7(_0x6a3a64);}else{if(_0x58b432==![]){_0x2e55d7();}else{_0x2e55d7(_0x6a3a64);}}});}});} \ No newline at end of file +var _0x0ec7=['include','findAll','show','params','length','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','category','parent','caused_by','upon_reject','child_incidents','number','resolved_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','description','calendar_duration','notify','sys_class_name','close_notes','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','correlation_id','username','email','serverUrl','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x5412bb,_0x549bbe){var _0xe625b6=function(_0x2e1d03){while(--_0x2e1d03){_0x5412bb['push'](_0x5412bb['shift']());}};_0xe625b6(++_0x549bbe);}(_0x0ec7,0x1d8));var _0x70ec=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0ec7[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x70ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70ec('0x1'));var jsonpatch=require(_0x70ec('0x2'));var rp=require(_0x70ec('0x3'));var moment=require(_0x70ec('0x4'));var BPromise=require(_0x70ec('0x5'));var Mustache=require(_0x70ec('0x6'));var util=require(_0x70ec('0x7'));var path=require(_0x70ec('0x8'));var sox=require(_0x70ec('0x9'));var csv=require('to-csv');var ejs=require(_0x70ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x70ec('0xc'));var deskjs=require(_0x70ec('0xd'));var toCsv=require(_0x70ec('0xe'));var querystring=require(_0x70ec('0xf'));var Papa=require(_0x70ec('0x10'));var Redis=require(_0x70ec('0x11'));var authService=require(_0x70ec('0x12'));var qs=require(_0x70ec('0x13'));var as=require(_0x70ec('0x14'));var hardwareService=require(_0x70ec('0x15'));var logger=require(_0x70ec('0x16'))(_0x70ec('0x17'));var utils=require('../../config/utils');var config=require(_0x70ec('0x18'));var licenseUtil=require(_0x70ec('0x19'));var db=require(_0x70ec('0x1a'))['db'];var integrations=require(_0x70ec('0x1b'));function respondWithStatusCode(_0x1ff498,_0x342be6){_0x342be6=_0x342be6||0xcc;return function(_0x475afb){if(_0x475afb){return _0x1ff498[_0x70ec('0x1c')](_0x342be6);}return _0x1ff498[_0x70ec('0x1d')](_0x342be6)[_0x70ec('0x1e')]();};}function respondWithResult(_0x1fc47b,_0x3aadf4){_0x3aadf4=_0x3aadf4||0xc8;return function(_0x45c00a){if(_0x45c00a){return _0x1fc47b['status'](_0x3aadf4)[_0x70ec('0x1f')](_0x45c00a);}};}function respondWithFilteredResult(_0xa6952e,_0x1d7196){return function(_0x142804){if(_0x142804){var _0x4882ae=typeof _0x1d7196['offset']===_0x70ec('0x20')&&typeof _0x1d7196['limit']===_0x70ec('0x20');var _0x394704=_0x142804[_0x70ec('0x21')];var _0x5a9d39=_0x4882ae?0x0:_0x1d7196[_0x70ec('0x22')];var _0x55aa01=_0x4882ae?_0x142804[_0x70ec('0x21')]:_0x1d7196[_0x70ec('0x22')]+_0x1d7196[_0x70ec('0x23')];var _0x44be3f;if(_0x55aa01>=_0x394704){_0x55aa01=_0x394704;_0x44be3f=0xc8;}else{_0x44be3f=0xce;}_0xa6952e[_0x70ec('0x1d')](_0x44be3f);return _0xa6952e['set'](_0x70ec('0x24'),_0x5a9d39+'-'+_0x55aa01+'/'+_0x394704)[_0x70ec('0x1f')](_0x142804);}return null;};}function patchUpdates(_0x55e66a){return function(_0x35592d){try{jsonpatch[_0x70ec('0x25')](_0x35592d,_0x55e66a,!![]);}catch(_0x1de658){return BPromise[_0x70ec('0x26')](_0x1de658);}return _0x35592d[_0x70ec('0x27')]();};}function saveUpdates(_0x4dca5a,_0xd4dd27){return function(_0x3ebfe5){if(_0x3ebfe5){return _0x3ebfe5[_0x70ec('0x28')](_0x4dca5a)['then'](function(_0x4766d0){return _0x4766d0;});}return null;};}function removeEntity(_0x438005,_0x5d6d14){return function(_0x49c214){if(_0x49c214){return _0x49c214[_0x70ec('0x29')]()[_0x70ec('0x2a')](function(){_0x438005[_0x70ec('0x1d')](0xcc)[_0x70ec('0x1e')]();});}};}function handleEntityNotFound(_0x1714bb,_0x4df239){return function(_0x279aa2){if(!_0x279aa2){_0x1714bb['sendStatus'](0x194);}return _0x279aa2;};}function handleError(_0x45df14,_0x549c77){_0x549c77=_0x549c77||0x1f4;return function(_0x4a5eae){logger[_0x70ec('0x2b')](_0x4a5eae[_0x70ec('0x2c')]);if(_0x4a5eae[_0x70ec('0x2d')]){delete _0x4a5eae[_0x70ec('0x2d')];}_0x45df14['status'](_0x549c77)['send'](_0x4a5eae);};}exports['index']=function(_0x174837,_0x4f6a40){var _0x54c5c2={},_0x473008={},_0x4fc645={'count':0x0,'rows':[]};var _0x5c9eff=_[_0x70ec('0x2e')](db[_0x70ec('0x2f')][_0x70ec('0x30')],function(_0x4206a8){return{'name':_0x4206a8[_0x70ec('0x31')],'type':_0x4206a8[_0x70ec('0x32')]['key']};});_0x473008[_0x70ec('0x33')]=_[_0x70ec('0x2e')](_0x5c9eff,'name');_0x473008[_0x70ec('0x34')]=_[_0x70ec('0x35')](_0x174837[_0x70ec('0x34')]);_0x473008[_0x70ec('0x36')]=_[_0x70ec('0x37')](_0x473008['model'],_0x473008[_0x70ec('0x34')]);_0x54c5c2[_0x70ec('0x38')]=_[_0x70ec('0x37')](_0x473008[_0x70ec('0x33')],qs[_0x70ec('0x39')](_0x174837[_0x70ec('0x34')]['fields']));_0x54c5c2[_0x70ec('0x38')]=_0x54c5c2[_0x70ec('0x38')]['length']?_0x54c5c2[_0x70ec('0x38')]:_0x473008[_0x70ec('0x33')];if(!_0x174837[_0x70ec('0x34')][_0x70ec('0x3a')](_0x70ec('0x3b'))){_0x54c5c2['limit']=qs[_0x70ec('0x23')](_0x174837[_0x70ec('0x34')]['limit']);_0x54c5c2['offset']=qs['offset'](_0x174837[_0x70ec('0x34')]['offset']);}_0x54c5c2[_0x70ec('0x3c')]=qs['sort'](_0x174837[_0x70ec('0x34')][_0x70ec('0x3d')]);_0x54c5c2['where']=qs[_0x70ec('0x36')](_['pick'](_0x174837['query'],_0x473008['filters']),_0x5c9eff);if(_0x174837[_0x70ec('0x34')][_0x70ec('0x3e')]){_0x54c5c2[_0x70ec('0x3f')]=_[_0x70ec('0x40')](_0x54c5c2['where'],{'$or':_[_0x70ec('0x2e')](_0x5c9eff,function(_0x515125){if(_0x515125[_0x70ec('0x32')]!==_0x70ec('0x41')){var _0xa4a985={};_0xa4a985[_0x515125[_0x70ec('0x2d')]]={'$like':'%'+_0x174837['query'][_0x70ec('0x3e')]+'%'};return _0xa4a985;}})});}_0x54c5c2=_['merge']({},_0x54c5c2,_0x174837[_0x70ec('0x42')]);var _0x3a8eba={'where':_0x54c5c2[_0x70ec('0x3f')]};return db['ServicenowAccount'][_0x70ec('0x21')](_0x3a8eba)[_0x70ec('0x2a')](function(_0x2ffa62){_0x4fc645['count']=_0x2ffa62;if(_0x174837['query'][_0x70ec('0x43')]){_0x54c5c2[_0x70ec('0x44')]=[{'all':!![]}];}return db[_0x70ec('0x2f')][_0x70ec('0x45')](_0x54c5c2);})['then'](function(_0x12d8ad){_0x4fc645['rows']=_0x12d8ad;return _0x4fc645;})[_0x70ec('0x2a')](respondWithFilteredResult(_0x4f6a40,_0x54c5c2))['catch'](handleError(_0x4f6a40,null));};exports[_0x70ec('0x46')]=function(_0x1a2e65,_0x46f2e2){var _0x1a584a={'raw':![],'where':{'id':_0x1a2e65[_0x70ec('0x47')]['id']}},_0x161ef7={};_0x161ef7[_0x70ec('0x33')]=_[_0x70ec('0x35')](db['ServicenowAccount'][_0x70ec('0x30')]);_0x161ef7[_0x70ec('0x34')]=_['keys'](_0x1a2e65[_0x70ec('0x34')]);_0x161ef7['filters']=_[_0x70ec('0x37')](_0x161ef7[_0x70ec('0x33')],_0x161ef7[_0x70ec('0x34')]);_0x1a584a['attributes']=_[_0x70ec('0x37')](_0x161ef7[_0x70ec('0x33')],qs[_0x70ec('0x39')](_0x1a2e65[_0x70ec('0x34')][_0x70ec('0x39')]));_0x1a584a[_0x70ec('0x38')]=_0x1a584a[_0x70ec('0x38')][_0x70ec('0x48')]?_0x1a584a[_0x70ec('0x38')]:_0x161ef7[_0x70ec('0x33')];if(_0x1a2e65[_0x70ec('0x34')][_0x70ec('0x43')]){_0x1a584a[_0x70ec('0x44')]=[{'all':!![]}];}_0x1a584a=_['merge']({},_0x1a584a,_0x1a2e65[_0x70ec('0x42')]);return db[_0x70ec('0x2f')]['find'](_0x1a584a)[_0x70ec('0x2a')](handleEntityNotFound(_0x46f2e2,null))[_0x70ec('0x2a')](respondWithResult(_0x46f2e2,null))[_0x70ec('0x49')](handleError(_0x46f2e2,null));};exports[_0x70ec('0x4a')]=function(_0xfb2a88,_0x2a0b3a){return db['ServicenowAccount']['create'](_0xfb2a88[_0x70ec('0x4b')],{})[_0x70ec('0x2a')](respondWithResult(_0x2a0b3a,0xc9))[_0x70ec('0x49')](handleError(_0x2a0b3a,null));};exports[_0x70ec('0x28')]=function(_0x2da84b,_0x4b775a){if(_0x2da84b[_0x70ec('0x4b')]['id']){delete _0x2da84b[_0x70ec('0x4b')]['id'];}return db['ServicenowAccount'][_0x70ec('0x4c')]({'where':{'id':_0x2da84b[_0x70ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b775a,null))[_0x70ec('0x2a')](saveUpdates(_0x2da84b[_0x70ec('0x4b')],null))[_0x70ec('0x2a')](respondWithResult(_0x4b775a,null))[_0x70ec('0x49')](handleError(_0x4b775a,null));};exports[_0x70ec('0x29')]=function(_0x9dbe17,_0x4a6404){return db[_0x70ec('0x2f')]['find']({'where':{'id':_0x9dbe17[_0x70ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a6404,null))[_0x70ec('0x2a')](removeEntity(_0x4a6404,null))[_0x70ec('0x49')](handleError(_0x4a6404,null));};exports[_0x70ec('0x4d')]=function(_0x1b9d45,_0x3407d0,_0x4e44a4){var _0x1d68e3={};var _0xdcfc12={};var _0x3b949f;var _0x213e1f;return db[_0x70ec('0x2f')][_0x70ec('0x4e')]({'where':{'id':_0x1b9d45[_0x70ec('0x47')]['id']}})[_0x70ec('0x2a')](handleEntityNotFound(_0x3407d0,null))['then'](function(_0x3d4b45){if(_0x3d4b45){_0x3b949f=_0x3d4b45;_0xdcfc12[_0x70ec('0x33')]=_[_0x70ec('0x35')](db[_0x70ec('0x4f')][_0x70ec('0x30')]);_0xdcfc12[_0x70ec('0x34')]=_['keys'](_0x1b9d45[_0x70ec('0x34')]);_0xdcfc12[_0x70ec('0x36')]=_[_0x70ec('0x37')](_0xdcfc12[_0x70ec('0x33')],_0xdcfc12[_0x70ec('0x34')]);_0x1d68e3['attributes']=_[_0x70ec('0x37')](_0xdcfc12['model'],qs[_0x70ec('0x39')](_0x1b9d45['query'][_0x70ec('0x39')]));_0x1d68e3[_0x70ec('0x38')]=_0x1d68e3[_0x70ec('0x38')][_0x70ec('0x48')]?_0x1d68e3['attributes']:_0xdcfc12['model'];_0x1d68e3[_0x70ec('0x3c')]=qs[_0x70ec('0x3d')](_0x1b9d45[_0x70ec('0x34')]['sort']);_0x1d68e3[_0x70ec('0x3f')]=qs[_0x70ec('0x36')](_[_0x70ec('0x50')](_0x1b9d45['query'],_0xdcfc12[_0x70ec('0x36')]));if(_0x1b9d45[_0x70ec('0x34')]['filter']){_0x1d68e3['where']=_[_0x70ec('0x40')](_0x1d68e3[_0x70ec('0x3f')],{'$or':_[_0x70ec('0x2e')](_0x1d68e3[_0x70ec('0x38')],function(_0x51ffe4){var _0xd9b3f0={};_0xd9b3f0[_0x51ffe4]={'$like':'%'+_0x1b9d45['query'][_0x70ec('0x3e')]+'%'};return _0xd9b3f0;})});}_0x1d68e3=_[_0x70ec('0x40')]({},_0x1d68e3,_0x1b9d45[_0x70ec('0x42')]);return _0x3b949f[_0x70ec('0x4d')](_0x1d68e3);}})[_0x70ec('0x2a')](function(_0x11047e){if(_0x11047e){_0x213e1f=_0x11047e[_0x70ec('0x48')];if(!_0x1b9d45['query'][_0x70ec('0x3a')](_0x70ec('0x3b'))){_0x1d68e3[_0x70ec('0x23')]=qs[_0x70ec('0x23')](_0x1b9d45['query'][_0x70ec('0x23')]);_0x1d68e3['offset']=qs[_0x70ec('0x22')](_0x1b9d45['query'][_0x70ec('0x22')]);}return _0x3b949f[_0x70ec('0x4d')](_0x1d68e3);}})[_0x70ec('0x2a')](function(_0x67c7e6){if(_0x67c7e6){return _0x67c7e6?{'count':_0x213e1f,'rows':_0x67c7e6}:null;}})[_0x70ec('0x2a')](respondWithResult(_0x3407d0,null))[_0x70ec('0x49')](handleError(_0x3407d0,null));};exports['addConfiguration']=function(_0x4ef462,_0x1884db,_0xaf3914){if(_0x4ef462[_0x70ec('0x4b')]['id']){delete _0x4ef462[_0x70ec('0x4b')]['id'];}return db['ServicenowAccount'][_0x70ec('0x4e')]({'where':{'id':_0x4ef462[_0x70ec('0x47')]['id']}})[_0x70ec('0x2a')](handleEntityNotFound(_0x1884db,null))[_0x70ec('0x2a')](function(_0x4636d9){if(_0x4636d9){_0x4ef462['body'][_0x70ec('0x51')]=_0x4636d9['id'];_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x52')]=integrations[_0x70ec('0x53')](_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x54')],_0x4ef462['body']['type']);_0x4ef462['body']['Descriptions']=integrations[_0x70ec('0x55')](_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x54')],_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x32')]);return db['ServicenowConfiguration'][_0x70ec('0x4a')](_0x4ef462[_0x70ec('0x4b')],{'include':[{'model':db[_0x70ec('0x56')],'as':'Subjects'},{'model':db[_0x70ec('0x56')],'as':'Descriptions'}]});}return null;})[_0x70ec('0x2a')](respondWithResult(_0x1884db,null))[_0x70ec('0x49')](handleError(_0x1884db,null));};exports[_0x70ec('0x57')]=function(_0x5a002f,_0xddd51f,_0x4e89bd){var _0x5caa4c=[_0x70ec('0x58'),_0x70ec('0x59'),_0x70ec('0x5a'),_0x70ec('0x5b'),'close_code','notify','incident_state','severity',_0x70ec('0x5c')];var _0x5f3dc2=[_0x70ec('0x5d'),'made_sla',_0x70ec('0x5e'),'watch_list',_0x70ec('0x5f'),'sys_updated_on',_0x70ec('0x60'),_0x70ec('0x59'),'approval_history',_0x70ec('0x61'),_0x70ec('0x62'),'sys_updated_by',_0x70ec('0x63'),'user_input',_0x70ec('0x64'),'sys_domain',_0x70ec('0x65'),_0x70ec('0x66'),_0x70ec('0x5a'),'order',_0x70ec('0x67'),_0x70ec('0x68'),_0x70ec('0x69'),_0x70ec('0x6a'),_0x70ec('0x6b'),'active','work_notes_list','business_service','priority',_0x70ec('0x6c'),_0x70ec('0x6d'),_0x70ec('0x6e'),_0x70ec('0x6f'),_0x70ec('0x70'),_0x70ec('0x71'),_0x70ec('0x72'),_0x70ec('0x73'),_0x70ec('0x74'),'resolved_at','caller_id',_0x70ec('0x75'),_0x70ec('0x5b'),_0x70ec('0x76'),_0x70ec('0x77'),_0x70ec('0x78'),_0x70ec('0x79'),_0x70ec('0x7a'),'work_start',_0x70ec('0x7b'),'business_stc','additional_assignee_list',_0x70ec('0x7c'),_0x70ec('0x7d'),_0x70ec('0x7e'),_0x70ec('0x7f'),_0x70ec('0x80'),'closed_by','follow_up',_0x70ec('0x81'),'sys_id',_0x70ec('0x82'),_0x70ec('0x83'),'incident_state',_0x70ec('0x84'),_0x70ec('0x85'),_0x70ec('0x86'),_0x70ec('0x87'),_0x70ec('0x88'),_0x70ec('0x89'),_0x70ec('0x8a'),_0x70ec('0x8b'),_0x70ec('0x8c'),'approval',_0x70ec('0x8d'),_0x70ec('0x8e'),_0x70ec('0x8f'),'reopen_count',_0x70ec('0x90'),_0x70ec('0x91'),'upon_approval',_0x70ec('0x92'),'location',_0x70ec('0x5c')];var _0x1292af='';var _0x44044e='';var _0x1e4405=[];var _0x1403e5='';var _0x161a58='';var _0x7ece02=[];var _0x3a66eb='';var _0x13a1fa='';var _0x4407b1={};var _0x9dc9d9='';return db[_0x70ec('0x2f')]['findOne']({'where':{'id':_0x5a002f[_0x70ec('0x47')]['id']},'attributes':['id',_0x70ec('0x93'),'password',_0x70ec('0x94'),'remoteUri',_0x70ec('0x95')]})[_0x70ec('0x2a')](handleEntityNotFound(_0xddd51f,null))[_0x70ec('0x2a')](function(_0x55d8e6){if(_0x55d8e6){_0x9dc9d9=_0x55d8e6[_0x70ec('0x96')];var _0x74e8b0=_0x9dc9d9[_0x70ec('0x97')](-0x1);if(_0x74e8b0==='/'){_0x9dc9d9=_0x9dc9d9['substring'](0x0,_0x9dc9d9['lastIndexOf'](_0x74e8b0));}_0x13a1fa=util[_0x70ec('0x98')](_0x70ec('0x99'),_0x9dc9d9);_0x3a66eb=util['format'](_0x70ec('0x9a'),_0x9dc9d9);_0x4407b1={'user':_0x55d8e6['username'],'pass':_0x55d8e6['password']};var _0x12ab5f={'method':_0x70ec('0x9b'),'uri':_0x13a1fa+_0x70ec('0x9c'),'auth':_0x4407b1,'json':!![]};return rp(_0x12ab5f);}})[_0x70ec('0x2a')](function(_0x36c98e){if(_0x36c98e[_0x70ec('0x9d')]['length']>0x0){_0x1292af=_0x36c98e[_0x70ec('0x9d')];}console[_0x70ec('0x9e')](_0x70ec('0x9f'),_0x1292af);_0x7ece02=[];_0x44044e=Object[_0x70ec('0xa0')]([],_0x1292af);_['remove'](_0x44044e,function(_0x426bef){return!_0x5caa4c[_0x70ec('0xa1')](_0x426bef['name']);});_0x44044e['forEach'](function(_0x3b4f9e){var _0x6e2941=createFieldObject(_0x3a66eb,_0x4407b1,_0x3b4f9e['internalType'],_0x3b4f9e[_0x70ec('0x2d')],_0x3b4f9e[_0x70ec('0xa2')],![]);_0x7ece02[_0x70ec('0xa3')](_0x6e2941);});return Promise[_0x70ec('0xa4')](_0x7ece02);})[_0x70ec('0x2a')](function(_0x1bf7fc){_0x1e4405=_0x1bf7fc;_0x1403e5=Object[_0x70ec('0xa0')]([],_0x1292af);console[_0x70ec('0x9e')](_0x70ec('0xa5'),_0x1292af);_['remove'](_0x1403e5,function(_0x34ad16){return _0x5f3dc2[_0x70ec('0xa1')](_0x34ad16[_0x70ec('0x2d')]);});console[_0x70ec('0x9e')](_0x70ec('0xa6'),_0x1403e5);_0x7ece02=[];_0x1403e5[_0x70ec('0xa7')](function(_0x743769){var _0x4f8cd3=createFieldObject(_0x3a66eb,_0x4407b1,_0x743769[_0x70ec('0xa8')],_0x743769[_0x70ec('0x2d')],_0x743769[_0x70ec('0xa2')],!![]);_0x7ece02[_0x70ec('0xa3')](_0x4f8cd3);});return Promise[_0x70ec('0xa4')](_0x7ece02);})['then'](function(_0x37b2c4){_0x161a58=_0x37b2c4;var _0x5341f5=_0x1e4405[_0x70ec('0xa9')](_0x161a58);return{'count':_0x5341f5[_0x70ec('0x48')],'rows':_0x5341f5};})[_0x70ec('0x2a')](respondWithResult(_0xddd51f,null))[_0x70ec('0x49')](function(_0x5d966a){console['log'](_0x70ec('0xaa')+_0x5d966a);var _0x4f831b=_0x5a002f[_0x70ec('0x34')][_0x70ec('0xab')]?0x1f4:_0x5d966a[_0x70ec('0xac')]||0x1f4;logger[_0x70ec('0x2b')](_0x5d966a['stack']);delete _0x5d966a['name'];if(_0x4f831b===0x191){_0x4f831b=0x190;}_0xddd51f[_0x70ec('0x1d')](_0x4f831b)['send'](_0x5a002f[_0x70ec('0x34')][_0x70ec('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x5d966a[_0x70ec('0xac')]}:_0x5d966a);});};function createFieldObject(_0x16eee0,_0x3c084b,_0x2449fc,_0xbe6d1b,_0x11e349,_0x28f283){return new Promise(function(_0x186d19,_0x5cbdb0){var _0x32d7e9={'id':_0xbe6d1b,'name':_0x11e349,'custom':_0x28f283};if(_0x2449fc===_0x70ec('0xad')){_0x32d7e9[_0x70ec('0x42')]=[{'name':_0x70ec('0xae'),'value':_0x70ec('0xaf')},{'name':_0x70ec('0xb0'),'value':'false'}];_0x186d19(_0x32d7e9);}else{var _0x2b5904={'method':_0x70ec('0x9b'),'uri':_0x16eee0+_0x70ec('0xb1')+_0xbe6d1b,'auth':_0x3c084b,'json':!![]};return rp(_0x2b5904)[_0x70ec('0x2a')](function(_0x240d36){var _0x523965=[];if(_0x240d36[_0x70ec('0x9d')][_0x70ec('0x48')]>0x0){_0x240d36[_0x70ec('0x9d')]['forEach'](function(_0x359996){if(_0x359996[_0x70ec('0xb2')]==='false'){var _0x537139={'name':_0x359996[_0x70ec('0xa2')],'value':_0x359996[_0x70ec('0xb3')]};_0x523965['push'](_0x537139);}});}_0x32d7e9[_0x70ec('0x42')]=_0x523965;if(_0x32d7e9[_0x70ec('0x42')]['length']>0x0){_0x186d19(_0x32d7e9);}else{if(_0x28f283==![]){_0x186d19();}else{_0x186d19(_0x32d7e9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 2a0ef85..40760d7 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5496,0x175));var _0x6549=function(_0x1d1ecf,_0x708c08){_0x1d1ecf=_0x1d1ecf-0x0;var _0x1da0e7=_0x5496[_0x1d1ecf];return _0x1da0e7;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7da7,0x10d));var _0x77da=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x7da7[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 0162e6b..9ad6a78 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 _0x9adf=['code','message','result','ServicenowAccount','findAll','options','raw','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c4cbf,_0x1e6e6){var _0xa65774=function(_0x7827f4){while(--_0x7827f4){_0x4c4cbf['push'](_0x4c4cbf['shift']());}};_0xa65774(++_0x1e6e6);}(_0x9adf,0x1cc));var _0xf9ad=function(_0xc6ce5b,_0x13352b){_0xc6ce5b=_0xc6ce5b-0x0;var _0x14f90d=_0x9adf[_0xc6ce5b];return _0x14f90d;};'use strict';var _=require('lodash');var util=require(_0xf9ad('0x0'));var moment=require(_0xf9ad('0x1'));var BPromise=require(_0xf9ad('0x2'));var rs=require(_0xf9ad('0x3'));var fs=require('fs');var Redis=require(_0xf9ad('0x4'));var db=require(_0xf9ad('0x5'))['db'];var utils=require(_0xf9ad('0x6'));var logger=require(_0xf9ad('0x7'))(_0xf9ad('0x8'));var config=require(_0xf9ad('0x9'));var jayson=require(_0xf9ad('0xa'));var client=jayson[_0xf9ad('0xb')][_0xf9ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x142e4f,_0x3b4b68,_0x3a3e64){return new BPromise(function(_0x50b872,_0x266479){return client['request'](_0x142e4f,_0x3a3e64)[_0xf9ad('0xd')](function(_0x21b715){logger[_0xf9ad('0xe')](_0xf9ad('0xf'),_0x3b4b68,_0xf9ad('0x10'));logger[_0xf9ad('0x11')](_0xf9ad('0x12'),_0x3b4b68,_0xf9ad('0x10'),JSON[_0xf9ad('0x13')](_0x21b715));if(_0x21b715[_0xf9ad('0x14')]){if(_0x21b715[_0xf9ad('0x14')][_0xf9ad('0x15')]===0x1f4){logger[_0xf9ad('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x3b4b68,_0x21b715['error'][_0xf9ad('0x16')]);return _0x266479(_0x21b715[_0xf9ad('0x14')][_0xf9ad('0x16')]);}logger['error'](_0xf9ad('0xf'),_0x3b4b68,_0x21b715[_0xf9ad('0x14')]['message']);return _0x50b872(_0x21b715['error'][_0xf9ad('0x16')]);}else{logger[_0xf9ad('0xe')](_0xf9ad('0xf'),_0x3b4b68,_0xf9ad('0x10'));_0x50b872(_0x21b715[_0xf9ad('0x17')][_0xf9ad('0x16')]);}})['catch'](function(_0x297455){logger[_0xf9ad('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x3b4b68,_0x297455);_0x266479(_0x297455);});});}exports['GetServicenowAccount']=function(_0x2fd0be){var _0x18a186=this;return new Promise(function(_0x27b998,_0x470d83){return db[_0xf9ad('0x18')][_0xf9ad('0x19')]({'raw':_0x2fd0be[_0xf9ad('0x1a')]?_0x2fd0be[_0xf9ad('0x1a')][_0xf9ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x2fd0be[_0xf9ad('0x1a')]?_0x2fd0be[_0xf9ad('0x1a')]['where']||null:null,'attributes':_0x2fd0be[_0xf9ad('0x1a')]?_0x2fd0be['options'][_0xf9ad('0x1c')]||null:null,'limit':_0x2fd0be[_0xf9ad('0x1a')]?_0x2fd0be['options'][_0xf9ad('0x1d')]||null:null,'include':_0x2fd0be['options']?_0x2fd0be[_0xf9ad('0x1a')][_0xf9ad('0x1e')]?_[_0xf9ad('0x1f')](_0x2fd0be[_0xf9ad('0x1a')][_0xf9ad('0x1e')],function(_0x4937af){return{'model':db[_0x4937af[_0xf9ad('0x20')]],'as':_0x4937af['as'],'attributes':_0x4937af['attributes'],'include':_0x4937af['include']?_[_0xf9ad('0x1f')](_0x4937af['include'],function(_0x530e50){return{'model':db[_0x530e50[_0xf9ad('0x20')]],'as':_0x530e50['as'],'attributes':_0x530e50[_0xf9ad('0x1c')],'include':_0x530e50[_0xf9ad('0x1e')]?_[_0xf9ad('0x1f')](_0x530e50[_0xf9ad('0x1e')],function(_0x1a8666){return{'model':db[_0x1a8666['model']],'as':_0x1a8666['as'],'attributes':_0x1a8666[_0xf9ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf9ad('0xd')](function(_0x44bcc9){logger[_0xf9ad('0xe')](_0xf9ad('0x21'),_0x2fd0be);logger[_0xf9ad('0x11')](_0xf9ad('0x21'),_0x2fd0be,JSON[_0xf9ad('0x13')](_0x44bcc9));_0x27b998(_0x44bcc9);})['catch'](function(_0x53dacd){logger[_0xf9ad('0x14')](_0xf9ad('0x21'),_0x53dacd[_0xf9ad('0x16')],_0x2fd0be);_0x470d83(_0x18a186[_0xf9ad('0x14')](0x1f4,_0x53dacd[_0xf9ad('0x16')]));});});};exports[_0xf9ad('0x22')]=function(_0x196120){var _0x11963c=this;return new Promise(function(_0x237ce2,_0x38258d){return db[_0xf9ad('0x18')][_0xf9ad('0x23')]({'raw':_0x196120[_0xf9ad('0x1a')]?_0x196120[_0xf9ad('0x1a')][_0xf9ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x196120['options']?_0x196120['options']['where']||null:null,'attributes':_0x196120[_0xf9ad('0x1a')]?_0x196120[_0xf9ad('0x1a')][_0xf9ad('0x1c')]||null:null,'include':_0x196120[_0xf9ad('0x1a')]?_0x196120[_0xf9ad('0x1a')][_0xf9ad('0x1e')]?_['map'](_0x196120['options']['include'],function(_0x10fd43){return{'model':db[_0x10fd43['model']],'as':_0x10fd43['as'],'attributes':_0x10fd43[_0xf9ad('0x1c')],'include':_0x10fd43['include']?_[_0xf9ad('0x1f')](_0x10fd43[_0xf9ad('0x1e')],function(_0x3f64c7){return{'model':db[_0x3f64c7['model']],'as':_0x3f64c7['as'],'attributes':_0x3f64c7[_0xf9ad('0x1c')],'include':_0x3f64c7[_0xf9ad('0x1e')]?_[_0xf9ad('0x1f')](_0x3f64c7[_0xf9ad('0x1e')],function(_0x5b0728){return{'model':db[_0x5b0728[_0xf9ad('0x20')]],'as':_0x5b0728['as'],'attributes':_0x5b0728[_0xf9ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf9ad('0xd')](function(_0x1e8abf){logger[_0xf9ad('0xe')](_0xf9ad('0x22'),_0x196120);logger[_0xf9ad('0x11')]('ShowServicenowAccount',_0x196120,JSON[_0xf9ad('0x13')](_0x1e8abf));_0x237ce2(_0x1e8abf);})[_0xf9ad('0x24')](function(_0x572dbb){logger[_0xf9ad('0x14')](_0xf9ad('0x22'),_0x572dbb['message'],_0x196120);_0x38258d(_0x11963c[_0xf9ad('0x14')](0x1f4,_0x572dbb[_0xf9ad('0x16')]));});});}; \ No newline at end of file +var _0x867c=['../../config/environment','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ServicenowAccount','find','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51181e,_0xc4ea19){var _0x5b2483=function(_0x38852a){while(--_0x38852a){_0x51181e['push'](_0x51181e['shift']());}};_0x5b2483(++_0xc4ea19);}(_0x867c,0x88));var _0xc867=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x867c[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xc867('0x0'));var util=require('util');var moment=require(_0xc867('0x1'));var BPromise=require(_0xc867('0x2'));var rs=require(_0xc867('0x3'));var fs=require('fs');var Redis=require(_0xc867('0x4'));var db=require(_0xc867('0x5'))['db'];var utils=require(_0xc867('0x6'));var logger=require(_0xc867('0x7'))('rpc');var config=require(_0xc867('0x8'));var jayson=require(_0xc867('0x9'));var client=jayson['client'][_0xc867('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6acf53,_0x361641,_0x5e067f){return new BPromise(function(_0x49e0c7,_0x4fa052){return client['request'](_0x6acf53,_0x5e067f)[_0xc867('0xb')](function(_0x5cf565){logger[_0xc867('0xc')](_0xc867('0xd'),_0x361641,_0xc867('0xe'));logger[_0xc867('0xf')](_0xc867('0x10'),_0x361641,_0xc867('0xe'),JSON[_0xc867('0x11')](_0x5cf565));if(_0x5cf565[_0xc867('0x12')]){if(_0x5cf565[_0xc867('0x12')][_0xc867('0x13')]===0x1f4){logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);return _0x4fa052(_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);}logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x5cf565[_0xc867('0x12')]['message']);return _0x49e0c7(_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);}else{logger[_0xc867('0xc')](_0xc867('0xd'),_0x361641,_0xc867('0xe'));_0x49e0c7(_0x5cf565[_0xc867('0x15')][_0xc867('0x14')]);}})[_0xc867('0x16')](function(_0x1bc7f6){logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x1bc7f6);_0x4fa052(_0x1bc7f6);});});}exports['GetServicenowAccount']=function(_0x218c14){var _0x3f35ac=this;return new Promise(function(_0x1277c6,_0x4a39f5){return db['ServicenowAccount'][_0xc867('0x17')]({'raw':_0x218c14[_0xc867('0x18')]?_0x218c14['options'][_0xc867('0x19')]===undefined?!![]:![]:!![],'where':_0x218c14[_0xc867('0x18')]?_0x218c14[_0xc867('0x18')][_0xc867('0x1a')]||null:null,'attributes':_0x218c14[_0xc867('0x18')]?_0x218c14['options'][_0xc867('0x1b')]||null:null,'limit':_0x218c14['options']?_0x218c14[_0xc867('0x18')][_0xc867('0x1c')]||null:null,'include':_0x218c14[_0xc867('0x18')]?_0x218c14[_0xc867('0x18')][_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x218c14[_0xc867('0x18')]['include'],function(_0x151d43){return{'model':db[_0x151d43[_0xc867('0x1f')]],'as':_0x151d43['as'],'attributes':_0x151d43[_0xc867('0x1b')],'include':_0x151d43[_0xc867('0x1d')]?_['map'](_0x151d43[_0xc867('0x1d')],function(_0x59b030){return{'model':db[_0x59b030[_0xc867('0x1f')]],'as':_0x59b030['as'],'attributes':_0x59b030['attributes'],'include':_0x59b030['include']?_[_0xc867('0x1e')](_0x59b030['include'],function(_0x5a2835){return{'model':db[_0x5a2835[_0xc867('0x1f')]],'as':_0x5a2835['as'],'attributes':_0x5a2835[_0xc867('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc867('0xb')](function(_0x5a2632){logger['info']('GetServicenowAccount',_0x218c14);logger[_0xc867('0xf')](_0xc867('0x20'),_0x218c14,JSON[_0xc867('0x11')](_0x5a2632));_0x1277c6(_0x5a2632);})[_0xc867('0x16')](function(_0x2d2899){logger[_0xc867('0x12')](_0xc867('0x20'),_0x2d2899['message'],_0x218c14);_0x4a39f5(_0x3f35ac['error'](0x1f4,_0x2d2899['message']));});});};exports['ShowServicenowAccount']=function(_0x5e77b3){var _0x4aabbe=this;return new Promise(function(_0x193ce9,_0x1823a9){return db[_0xc867('0x21')][_0xc867('0x22')]({'raw':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3[_0xc867('0x18')][_0xc867('0x19')]===undefined?!![]:![]:!![],'where':_0x5e77b3['options']?_0x5e77b3['options'][_0xc867('0x1a')]||null:null,'attributes':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3['options']['attributes']||null:null,'include':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3[_0xc867('0x18')][_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x5e77b3[_0xc867('0x18')][_0xc867('0x1d')],function(_0xd3ab49){return{'model':db[_0xd3ab49[_0xc867('0x1f')]],'as':_0xd3ab49['as'],'attributes':_0xd3ab49[_0xc867('0x1b')],'include':_0xd3ab49['include']?_[_0xc867('0x1e')](_0xd3ab49[_0xc867('0x1d')],function(_0x22fb4c){return{'model':db[_0x22fb4c[_0xc867('0x1f')]],'as':_0x22fb4c['as'],'attributes':_0x22fb4c[_0xc867('0x1b')],'include':_0x22fb4c[_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x22fb4c[_0xc867('0x1d')],function(_0x265ca4){return{'model':db[_0x265ca4['model']],'as':_0x265ca4['as'],'attributes':_0x265ca4[_0xc867('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x374b93){logger[_0xc867('0xc')](_0xc867('0x23'),_0x5e77b3);logger[_0xc867('0xf')]('ShowServicenowAccount',_0x5e77b3,JSON[_0xc867('0x11')](_0x374b93));_0x193ce9(_0x374b93);})['catch'](function(_0x51a54c){logger['error'](_0xc867('0x23'),_0x51a54c[_0xc867('0x14')],_0x5e77b3);_0x1823a9(_0x4aabbe[_0xc867('0x12')](0x1f4,_0x51a54c[_0xc867('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 99ff930..9964ab6 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 _0xb6db=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','destroy'];(function(_0x2fb625,_0x355f8d){var _0x3b1743=function(_0x475126){while(--_0x475126){_0x2fb625['push'](_0x2fb625['shift']());}};_0x3b1743(++_0x355f8d);}(_0xb6db,0x165));var _0xbb6d=function(_0x5dc0e3,_0x1d2f57){_0x5dc0e3=_0x5dc0e3-0x0;var _0x1b92cd=_0xb6db[_0x5dc0e3];return _0x1b92cd;};'use strict';var multer=require(_0xbb6d('0x0'));var util=require(_0xbb6d('0x1'));var path=require(_0xbb6d('0x2'));var timeout=require(_0xbb6d('0x3'));var express=require('express');var router=express[_0xbb6d('0x4')]();var fs_extra=require(_0xbb6d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb6d('0x6'));var config=require('../../config/environment');var controller=require(_0xbb6d('0x7'));router['get']('/',auth[_0xbb6d('0x8')](),controller['index']);router[_0xbb6d('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbb6d('0x9')](_0xbb6d('0xa'),auth[_0xbb6d('0x8')](),controller[_0xbb6d('0xb')]);router[_0xbb6d('0x9')](_0xbb6d('0xc'),auth[_0xbb6d('0x8')](),controller[_0xbb6d('0xd')]);router[_0xbb6d('0x9')](_0xbb6d('0xe'),auth[_0xbb6d('0x8')](),controller[_0xbb6d('0xf')]);router[_0xbb6d('0x10')]('/',auth[_0xbb6d('0x8')](),controller[_0xbb6d('0x11')]);router[_0xbb6d('0x12')](_0xbb6d('0x13'),auth[_0xbb6d('0x8')](),controller['update']);router['delete'](_0xbb6d('0x13'),auth['isAuthenticated'](),controller[_0xbb6d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x716b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','post','create','put','update','delete','exports','multer','util'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x716b,0xda));var _0xb716=function(_0x166241,_0x227ee2){_0x166241=_0x166241-0x0;var _0x51fd00=_0x716b[_0x166241];return _0x51fd00;};'use strict';var multer=require(_0xb716('0x0'));var util=require(_0xb716('0x1'));var path=require('path');var timeout=require(_0xb716('0x2'));var express=require('express');var router=express[_0xb716('0x3')]();var fs_extra=require(_0xb716('0x4'));var auth=require(_0xb716('0x5'));var interaction=require(_0xb716('0x6'));var config=require(_0xb716('0x7'));var controller=require(_0xb716('0x8'));router[_0xb716('0x9')]('/',auth['isAuthenticated'](),controller[_0xb716('0xa')]);router[_0xb716('0x9')](_0xb716('0xb'),auth[_0xb716('0xc')](),controller['show']);router[_0xb716('0x9')](_0xb716('0xd'),auth[_0xb716('0xc')](),controller[_0xb716('0xe')]);router[_0xb716('0x9')]('/:id/subjects',auth[_0xb716('0xc')](),controller[_0xb716('0xf')]);router[_0xb716('0x9')]('/:id/descriptions',auth[_0xb716('0xc')](),controller['getDescriptions']);router[_0xb716('0x10')]('/',auth[_0xb716('0xc')](),controller[_0xb716('0x11')]);router[_0xb716('0x12')](_0xb716('0xb'),auth['isAuthenticated'](),controller[_0xb716('0x13')]);router[_0xb716('0x14')](_0xb716('0xb'),auth[_0xb716('0xc')](),controller['destroy']);module[_0xb716('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 6cf7501..fd479b0 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 _0xd27e=['sequelize','exports'];(function(_0xa26e2c,_0x1ffb98){var _0x524b0e=function(_0x224591){while(--_0x224591){_0xa26e2c['push'](_0xa26e2c['shift']());}};_0x524b0e(++_0x1ffb98);}(_0xd27e,0x1b8));var _0xed27=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd27e[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xed27('0x0'));module[_0xed27('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbd3b=['STRING'];(function(_0x46aa24,_0x1c3f11){var _0x5eef93=function(_0x2894d2){while(--_0x2894d2){_0x46aa24['push'](_0x46aa24['shift']());}};_0x5eef93(++_0x1c3f11);}(_0xbd3b,0x163));var _0xbbd3=function(_0x47195e,_0x347734){_0x47195e=_0x47195e-0x0;var _0x571abb=_0xbd3b[_0x47195e];return _0x571abb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbbd3('0x0')]},'description':{'type':Sequelize[_0xbbd3('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 36023ca..3428b1d 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 _0xd495=['apply','reject','save','update','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','then','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','getFields','getSubjects','findOne','ServicenowField','getDescriptions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0xd495,0x7f));var _0x5d49=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0xd495[_0x5df61d];return _0x24cc4c;};'use strict';var emlformat=require(_0x5d49('0x0'));var rimraf=require(_0x5d49('0x1'));var zipdir=require(_0x5d49('0x2'));var jsonpatch=require(_0x5d49('0x3'));var rp=require(_0x5d49('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d49('0x5'));var util=require(_0x5d49('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5d49('0x7'));var fs=require('fs');var fs_extra=require(_0x5d49('0x8'));var _=require(_0x5d49('0x9'));var squel=require(_0x5d49('0xa'));var crypto=require(_0x5d49('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d49('0xc'));var toCsv=require(_0x5d49('0xd'));var querystring=require(_0x5d49('0xe'));var Papa=require(_0x5d49('0xf'));var Redis=require(_0x5d49('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d49('0x12'))('api');var utils=require(_0x5d49('0x13'));var config=require(_0x5d49('0x14'));var licenseUtil=require(_0x5d49('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da3c0,_0x51b60a){_0x51b60a=_0x51b60a||0xcc;return function(_0xb60bba){if(_0xb60bba){return _0x1da3c0[_0x5d49('0x16')](_0x51b60a);}return _0x1da3c0['status'](_0x51b60a)[_0x5d49('0x17')]();};}function respondWithResult(_0x179f0f,_0x61dee8){_0x61dee8=_0x61dee8||0xc8;return function(_0x371f59){if(_0x371f59){return _0x179f0f[_0x5d49('0x18')](_0x61dee8)[_0x5d49('0x19')](_0x371f59);}};}function respondWithFilteredResult(_0x22787b,_0x3ebf43){return function(_0x1e2eed){if(_0x1e2eed){var _0x128ddf=typeof _0x3ebf43[_0x5d49('0x1a')]===_0x5d49('0x1b')&&typeof _0x3ebf43[_0x5d49('0x1c')]===_0x5d49('0x1b');var _0x2b45c1=_0x1e2eed[_0x5d49('0x1d')];var _0x361d76=_0x128ddf?0x0:_0x3ebf43[_0x5d49('0x1a')];var _0x3fb8ab=_0x128ddf?_0x1e2eed[_0x5d49('0x1d')]:_0x3ebf43[_0x5d49('0x1a')]+_0x3ebf43['limit'];var _0x5a8e1f;if(_0x3fb8ab>=_0x2b45c1){_0x3fb8ab=_0x2b45c1;_0x5a8e1f=0xc8;}else{_0x5a8e1f=0xce;}_0x22787b[_0x5d49('0x18')](_0x5a8e1f);return _0x22787b[_0x5d49('0x1e')]('Content-Range',_0x361d76+'-'+_0x3fb8ab+'/'+_0x2b45c1)[_0x5d49('0x19')](_0x1e2eed);}return null;};}function patchUpdates(_0xcb5907){return function(_0xffc08c){try{jsonpatch[_0x5d49('0x1f')](_0xffc08c,_0xcb5907,!![]);}catch(_0xd96494){return BPromise[_0x5d49('0x20')](_0xd96494);}return _0xffc08c[_0x5d49('0x21')]();};}function saveUpdates(_0x20d3ce,_0x1a279e){return function(_0x160a65){if(_0x160a65){return _0x160a65[_0x5d49('0x22')](_0x20d3ce)['then'](function(_0x40c61e){return _0x40c61e;});}return null;};}function removeEntity(_0x219292,_0x3e5194){return function(_0x25f870){if(_0x25f870){return _0x25f870['destroy']()['then'](function(){_0x219292[_0x5d49('0x18')](0xcc)[_0x5d49('0x17')]();});}};}function handleEntityNotFound(_0x4dc78b,_0x3d203c){return function(_0x550bfa){if(!_0x550bfa){_0x4dc78b[_0x5d49('0x16')](0x194);}return _0x550bfa;};}function handleError(_0x3f8c10,_0x1d7389){_0x1d7389=_0x1d7389||0x1f4;return function(_0x349741){logger[_0x5d49('0x23')](_0x349741[_0x5d49('0x24')]);if(_0x349741['name']){delete _0x349741[_0x5d49('0x25')];}_0x3f8c10[_0x5d49('0x18')](_0x1d7389)[_0x5d49('0x26')](_0x349741);};}exports[_0x5d49('0x27')]=function(_0x4a6a3a,_0x46d9fb){var _0x30c9ec={},_0x336de3={},_0x4b3ac5={'count':0x0,'rows':[]};var _0x25dc7c=_[_0x5d49('0x28')](db[_0x5d49('0x29')][_0x5d49('0x2a')],function(_0x2b6a4b){return{'name':_0x2b6a4b[_0x5d49('0x2b')],'type':_0x2b6a4b[_0x5d49('0x2c')][_0x5d49('0x2d')]};});_0x336de3[_0x5d49('0x2e')]=_[_0x5d49('0x28')](_0x25dc7c,_0x5d49('0x25'));_0x336de3[_0x5d49('0x2f')]=_['keys'](_0x4a6a3a[_0x5d49('0x2f')]);_0x336de3['filters']=_[_0x5d49('0x30')](_0x336de3[_0x5d49('0x2e')],_0x336de3[_0x5d49('0x2f')]);_0x30c9ec['attributes']=_[_0x5d49('0x30')](_0x336de3[_0x5d49('0x2e')],qs[_0x5d49('0x31')](_0x4a6a3a[_0x5d49('0x2f')]['fields']));_0x30c9ec[_0x5d49('0x32')]=_0x30c9ec[_0x5d49('0x32')][_0x5d49('0x33')]?_0x30c9ec[_0x5d49('0x32')]:_0x336de3[_0x5d49('0x2e')];if(!_0x4a6a3a[_0x5d49('0x2f')][_0x5d49('0x34')](_0x5d49('0x35'))){_0x30c9ec[_0x5d49('0x1c')]=qs[_0x5d49('0x1c')](_0x4a6a3a['query'][_0x5d49('0x1c')]);_0x30c9ec['offset']=qs['offset'](_0x4a6a3a[_0x5d49('0x2f')][_0x5d49('0x1a')]);}_0x30c9ec[_0x5d49('0x36')]=qs['sort'](_0x4a6a3a[_0x5d49('0x2f')][_0x5d49('0x37')]);_0x30c9ec[_0x5d49('0x38')]=qs[_0x5d49('0x39')](_['pick'](_0x4a6a3a['query'],_0x336de3[_0x5d49('0x39')]),_0x25dc7c);if(_0x4a6a3a[_0x5d49('0x2f')][_0x5d49('0x3a')]){_0x30c9ec[_0x5d49('0x38')]=_[_0x5d49('0x3b')](_0x30c9ec[_0x5d49('0x38')],{'$or':_[_0x5d49('0x28')](_0x25dc7c,function(_0x314095){if(_0x314095['type']!=='VIRTUAL'){var _0x208fb7={};_0x208fb7[_0x314095[_0x5d49('0x25')]]={'$like':'%'+_0x4a6a3a[_0x5d49('0x2f')]['filter']+'%'};return _0x208fb7;}})});}_0x30c9ec=_[_0x5d49('0x3b')]({},_0x30c9ec,_0x4a6a3a[_0x5d49('0x3c')]);var _0x4cd907={'where':_0x30c9ec[_0x5d49('0x38')]};return db['ServicenowConfiguration'][_0x5d49('0x1d')](_0x4cd907)[_0x5d49('0x3d')](function(_0x10e8b8){_0x4b3ac5[_0x5d49('0x1d')]=_0x10e8b8;if(_0x4a6a3a['query'][_0x5d49('0x3e')]){_0x30c9ec[_0x5d49('0x3f')]=[{'all':!![]}];}return db[_0x5d49('0x29')][_0x5d49('0x40')](_0x30c9ec);})[_0x5d49('0x3d')](function(_0x1c6770){_0x4b3ac5['rows']=_0x1c6770;return _0x4b3ac5;})[_0x5d49('0x3d')](respondWithFilteredResult(_0x46d9fb,_0x30c9ec))[_0x5d49('0x41')](handleError(_0x46d9fb,null));};exports[_0x5d49('0x42')]=function(_0x47aad3,_0x15a95e){var _0x260fd9={'raw':![],'where':{'id':_0x47aad3['params']['id']}},_0x57a132={};_0x57a132[_0x5d49('0x2e')]=_[_0x5d49('0x43')](db['ServicenowConfiguration'][_0x5d49('0x2a')]);_0x57a132[_0x5d49('0x2f')]=_[_0x5d49('0x43')](_0x47aad3[_0x5d49('0x2f')]);_0x57a132[_0x5d49('0x39')]=_[_0x5d49('0x30')](_0x57a132[_0x5d49('0x2e')],_0x57a132[_0x5d49('0x2f')]);_0x260fd9['attributes']=_['intersection'](_0x57a132[_0x5d49('0x2e')],qs[_0x5d49('0x31')](_0x47aad3[_0x5d49('0x2f')]['fields']));_0x260fd9[_0x5d49('0x32')]=_0x260fd9[_0x5d49('0x32')][_0x5d49('0x33')]?_0x260fd9[_0x5d49('0x32')]:_0x57a132[_0x5d49('0x2e')];if(_0x47aad3['query'][_0x5d49('0x3e')]){_0x260fd9[_0x5d49('0x3f')]=[{'all':!![]}];}_0x260fd9=_[_0x5d49('0x3b')]({},_0x260fd9,_0x47aad3['options']);return db[_0x5d49('0x29')][_0x5d49('0x44')](_0x260fd9)[_0x5d49('0x3d')](handleEntityNotFound(_0x15a95e,null))['then'](respondWithResult(_0x15a95e,null))[_0x5d49('0x41')](handleError(_0x15a95e,null));};exports[_0x5d49('0x45')]=function(_0x4f1df9,_0x491ca1){return db['ServicenowConfiguration'][_0x5d49('0x45')](_0x4f1df9[_0x5d49('0x46')],{})[_0x5d49('0x3d')](respondWithResult(_0x491ca1,0xc9))[_0x5d49('0x41')](handleError(_0x491ca1,null));};exports['update']=function(_0x53bc16,_0x317446){if(_0x53bc16['body']['id']){delete _0x53bc16['body']['id'];}return db[_0x5d49('0x29')][_0x5d49('0x44')]({'where':{'id':_0x53bc16[_0x5d49('0x47')]['id']}})['then'](handleEntityNotFound(_0x317446,null))['then'](saveUpdates(_0x53bc16[_0x5d49('0x46')],null))[_0x5d49('0x3d')](respondWithResult(_0x317446,null))['catch'](handleError(_0x317446,null));};exports[_0x5d49('0x48')]=function(_0x492fb7,_0x2caa1c){return db[_0x5d49('0x29')][_0x5d49('0x44')]({'where':{'id':_0x492fb7[_0x5d49('0x47')]['id']}})[_0x5d49('0x3d')](handleEntityNotFound(_0x2caa1c,null))[_0x5d49('0x3d')](removeEntity(_0x2caa1c,null))[_0x5d49('0x41')](handleError(_0x2caa1c,null));};exports[_0x5d49('0x49')]=function(_0xb459bc,_0x4df8b1,_0xfa1198){var _0x37f5d1={};var _0x591f58={};var _0x170abd;var _0x1ac432;return db[_0x5d49('0x29')]['findOne']({'where':{'id':_0xb459bc[_0x5d49('0x47')]['id']}})['then'](handleEntityNotFound(_0x4df8b1,null))['then'](function(_0x5e2ad6){if(_0x5e2ad6){_0x170abd=_0x5e2ad6;_0x591f58['model']=_[_0x5d49('0x43')](db['ServicenowField'][_0x5d49('0x2a')]);_0x591f58['query']=_[_0x5d49('0x43')](_0xb459bc[_0x5d49('0x2f')]);_0x591f58[_0x5d49('0x39')]=_[_0x5d49('0x30')](_0x591f58['model'],_0x591f58['query']);_0x37f5d1[_0x5d49('0x32')]=_[_0x5d49('0x30')](_0x591f58[_0x5d49('0x2e')],qs[_0x5d49('0x31')](_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x31')]));_0x37f5d1[_0x5d49('0x32')]=_0x37f5d1[_0x5d49('0x32')][_0x5d49('0x33')]?_0x37f5d1[_0x5d49('0x32')]:_0x591f58[_0x5d49('0x2e')];_0x37f5d1['order']=qs['sort'](_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x37')]);_0x37f5d1[_0x5d49('0x38')]=qs[_0x5d49('0x39')](_['pick'](_0xb459bc['query'],_0x591f58[_0x5d49('0x39')]));if(_0xb459bc['query'][_0x5d49('0x3a')]){_0x37f5d1[_0x5d49('0x38')]=_[_0x5d49('0x3b')](_0x37f5d1[_0x5d49('0x38')],{'$or':_[_0x5d49('0x28')](_0x37f5d1[_0x5d49('0x32')],function(_0x1d4b68){var _0x34a1e6={};_0x34a1e6[_0x1d4b68]={'$like':'%'+_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x3a')]+'%'};return _0x34a1e6;})});}_0x37f5d1=_['merge']({},_0x37f5d1,_0xb459bc[_0x5d49('0x3c')]);return _0x170abd[_0x5d49('0x49')](_0x37f5d1);}})['then'](function(_0x1d4bb5){if(_0x1d4bb5){_0x1ac432=_0x1d4bb5['length'];if(!_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x34')](_0x5d49('0x35'))){_0x37f5d1['limit']=qs[_0x5d49('0x1c')](_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x1c')]);_0x37f5d1['offset']=qs[_0x5d49('0x1a')](_0xb459bc[_0x5d49('0x2f')][_0x5d49('0x1a')]);}return _0x170abd[_0x5d49('0x49')](_0x37f5d1);}})['then'](function(_0x4e2075){if(_0x4e2075){return _0x4e2075?{'count':_0x1ac432,'rows':_0x4e2075}:null;}})[_0x5d49('0x3d')](respondWithResult(_0x4df8b1,null))['catch'](handleError(_0x4df8b1,null));};exports[_0x5d49('0x4a')]=function(_0x7ccfce,_0x5ee13a,_0x4f6ef2){var _0xcd0fed={};var _0x176caf={};var _0x473ebc;var _0x22ac24;return db[_0x5d49('0x29')][_0x5d49('0x4b')]({'where':{'id':_0x7ccfce[_0x5d49('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ee13a,null))[_0x5d49('0x3d')](function(_0x27c201){if(_0x27c201){_0x473ebc=_0x27c201;_0x176caf[_0x5d49('0x2e')]=_[_0x5d49('0x43')](db[_0x5d49('0x4c')][_0x5d49('0x2a')]);_0x176caf[_0x5d49('0x2f')]=_[_0x5d49('0x43')](_0x7ccfce[_0x5d49('0x2f')]);_0x176caf['filters']=_[_0x5d49('0x30')](_0x176caf[_0x5d49('0x2e')],_0x176caf[_0x5d49('0x2f')]);_0xcd0fed[_0x5d49('0x32')]=_['intersection'](_0x176caf['model'],qs[_0x5d49('0x31')](_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x31')]));_0xcd0fed['attributes']=_0xcd0fed[_0x5d49('0x32')]['length']?_0xcd0fed['attributes']:_0x176caf[_0x5d49('0x2e')];_0xcd0fed['order']=qs[_0x5d49('0x37')](_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x37')]);_0xcd0fed[_0x5d49('0x38')]=qs[_0x5d49('0x39')](_['pick'](_0x7ccfce['query'],_0x176caf[_0x5d49('0x39')]));if(_0x7ccfce['query'][_0x5d49('0x3a')]){_0xcd0fed[_0x5d49('0x38')]=_[_0x5d49('0x3b')](_0xcd0fed['where'],{'$or':_[_0x5d49('0x28')](_0xcd0fed[_0x5d49('0x32')],function(_0x4b5e54){var _0x139998={};_0x139998[_0x4b5e54]={'$like':'%'+_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x3a')]+'%'};return _0x139998;})});}_0xcd0fed=_[_0x5d49('0x3b')]({},_0xcd0fed,_0x7ccfce[_0x5d49('0x3c')]);return _0x473ebc[_0x5d49('0x4a')](_0xcd0fed);}})[_0x5d49('0x3d')](function(_0xb5ef85){if(_0xb5ef85){_0x22ac24=_0xb5ef85[_0x5d49('0x33')];if(!_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x34')]('nolimit')){_0xcd0fed[_0x5d49('0x1c')]=qs['limit'](_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x1c')]);_0xcd0fed[_0x5d49('0x1a')]=qs[_0x5d49('0x1a')](_0x7ccfce[_0x5d49('0x2f')][_0x5d49('0x1a')]);}return _0x473ebc['getSubjects'](_0xcd0fed);}})['then'](function(_0x88c7da){if(_0x88c7da){return _0x88c7da?{'count':_0x22ac24,'rows':_0x88c7da}:null;}})[_0x5d49('0x3d')](respondWithResult(_0x5ee13a,null))[_0x5d49('0x41')](handleError(_0x5ee13a,null));};exports[_0x5d49('0x4d')]=function(_0x21ad30,_0x2e4992,_0x42b7e6){var _0x55adda={};var _0x1c5e28={};var _0x3b8065;var _0x4ca092;return db[_0x5d49('0x29')][_0x5d49('0x4b')]({'where':{'id':_0x21ad30[_0x5d49('0x47')]['id']}})[_0x5d49('0x3d')](handleEntityNotFound(_0x2e4992,null))[_0x5d49('0x3d')](function(_0x4143c6){if(_0x4143c6){_0x3b8065=_0x4143c6;_0x1c5e28[_0x5d49('0x2e')]=_[_0x5d49('0x43')](db['ServicenowField'][_0x5d49('0x2a')]);_0x1c5e28[_0x5d49('0x2f')]=_[_0x5d49('0x43')](_0x21ad30['query']);_0x1c5e28['filters']=_[_0x5d49('0x30')](_0x1c5e28[_0x5d49('0x2e')],_0x1c5e28['query']);_0x55adda['attributes']=_[_0x5d49('0x30')](_0x1c5e28[_0x5d49('0x2e')],qs[_0x5d49('0x31')](_0x21ad30['query'][_0x5d49('0x31')]));_0x55adda['attributes']=_0x55adda[_0x5d49('0x32')][_0x5d49('0x33')]?_0x55adda['attributes']:_0x1c5e28[_0x5d49('0x2e')];_0x55adda['order']=qs[_0x5d49('0x37')](_0x21ad30[_0x5d49('0x2f')][_0x5d49('0x37')]);_0x55adda['where']=qs['filters'](_[_0x5d49('0x4e')](_0x21ad30[_0x5d49('0x2f')],_0x1c5e28[_0x5d49('0x39')]));if(_0x21ad30[_0x5d49('0x2f')][_0x5d49('0x3a')]){_0x55adda[_0x5d49('0x38')]=_[_0x5d49('0x3b')](_0x55adda[_0x5d49('0x38')],{'$or':_['map'](_0x55adda[_0x5d49('0x32')],function(_0x94dfe9){var _0x5cba04={};_0x5cba04[_0x94dfe9]={'$like':'%'+_0x21ad30[_0x5d49('0x2f')]['filter']+'%'};return _0x5cba04;})});}_0x55adda=_[_0x5d49('0x3b')]({},_0x55adda,_0x21ad30[_0x5d49('0x3c')]);return _0x3b8065[_0x5d49('0x4d')](_0x55adda);}})[_0x5d49('0x3d')](function(_0x45c773){if(_0x45c773){_0x4ca092=_0x45c773['length'];if(!_0x21ad30[_0x5d49('0x2f')][_0x5d49('0x34')]('nolimit')){_0x55adda[_0x5d49('0x1c')]=qs[_0x5d49('0x1c')](_0x21ad30[_0x5d49('0x2f')][_0x5d49('0x1c')]);_0x55adda[_0x5d49('0x1a')]=qs[_0x5d49('0x1a')](_0x21ad30['query']['offset']);}return _0x3b8065[_0x5d49('0x4d')](_0x55adda);}})['then'](function(_0x50b75f){if(_0x50b75f){return _0x50b75f?{'count':_0x4ca092,'rows':_0x50b75f}:null;}})[_0x5d49('0x3d')](respondWithResult(_0x2e4992,null))[_0x5d49('0x41')](handleError(_0x2e4992,null));}; \ No newline at end of file +var _0x1d79=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','stack','name','index','rawAttributes','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','ServicenowConfiguration','then','rows','catch','show','keys','intersection','length','includeAll','include','find','create','body','params','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1d79,0x15a));var _0x91d7=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1d79[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0x91d7('0x0'));var rimraf=require(_0x91d7('0x1'));var zipdir=require(_0x91d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x91d7('0x3'));var path=require(_0x91d7('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x91d7('0x5'));var _=require(_0x91d7('0x6'));var squel=require('squel');var crypto=require(_0x91d7('0x7'));var jsforce=require(_0x91d7('0x8'));var deskjs=require(_0x91d7('0x9'));var toCsv=require(_0x91d7('0xa'));var querystring=require('querystring');var Papa=require(_0x91d7('0xb'));var Redis=require(_0x91d7('0xc'));var authService=require(_0x91d7('0xd'));var qs=require(_0x91d7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91d7('0xf'));var logger=require('../../config/logger')(_0x91d7('0x10'));var utils=require(_0x91d7('0x11'));var config=require(_0x91d7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x91d7('0x13'))['db'];function respondWithStatusCode(_0x40d6a9,_0x10a4c2){_0x10a4c2=_0x10a4c2||0xcc;return function(_0x19db6c){if(_0x19db6c){return _0x40d6a9[_0x91d7('0x14')](_0x10a4c2);}return _0x40d6a9[_0x91d7('0x15')](_0x10a4c2)[_0x91d7('0x16')]();};}function respondWithResult(_0x4fdab2,_0x3b27b6){_0x3b27b6=_0x3b27b6||0xc8;return function(_0x21fe3b){if(_0x21fe3b){return _0x4fdab2[_0x91d7('0x15')](_0x3b27b6)[_0x91d7('0x17')](_0x21fe3b);}};}function respondWithFilteredResult(_0x2c8813,_0x3efbd8){return function(_0x201d20){if(_0x201d20){var _0x24d9eb=typeof _0x3efbd8[_0x91d7('0x18')]===_0x91d7('0x19')&&typeof _0x3efbd8[_0x91d7('0x1a')]===_0x91d7('0x19');var _0x4b43aa=_0x201d20[_0x91d7('0x1b')];var _0x23d284=_0x24d9eb?0x0:_0x3efbd8[_0x91d7('0x18')];var _0x14f134=_0x24d9eb?_0x201d20['count']:_0x3efbd8['offset']+_0x3efbd8['limit'];var _0x9076bf;if(_0x14f134>=_0x4b43aa){_0x14f134=_0x4b43aa;_0x9076bf=0xc8;}else{_0x9076bf=0xce;}_0x2c8813[_0x91d7('0x15')](_0x9076bf);return _0x2c8813['set']('Content-Range',_0x23d284+'-'+_0x14f134+'/'+_0x4b43aa)[_0x91d7('0x17')](_0x201d20);}return null;};}function patchUpdates(_0x35c986){return function(_0x17539e){try{jsonpatch['apply'](_0x17539e,_0x35c986,!![]);}catch(_0x286577){return BPromise[_0x91d7('0x1c')](_0x286577);}return _0x17539e[_0x91d7('0x1d')]();};}function saveUpdates(_0x105d27,_0x25bee9){return function(_0x1142f3){if(_0x1142f3){return _0x1142f3[_0x91d7('0x1e')](_0x105d27)['then'](function(_0x5dd24f){return _0x5dd24f;});}return null;};}function removeEntity(_0x5b1162,_0x92843b){return function(_0x5b734c){if(_0x5b734c){return _0x5b734c[_0x91d7('0x1f')]()['then'](function(){_0x5b1162['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x564383,_0xf35861){return function(_0x1a753a){if(!_0x1a753a){_0x564383[_0x91d7('0x14')](0x194);}return _0x1a753a;};}function handleError(_0x1cb695,_0x45c7fe){_0x45c7fe=_0x45c7fe||0x1f4;return function(_0x4ee741){logger['error'](_0x4ee741[_0x91d7('0x20')]);if(_0x4ee741[_0x91d7('0x21')]){delete _0x4ee741[_0x91d7('0x21')];}_0x1cb695[_0x91d7('0x15')](_0x45c7fe)['send'](_0x4ee741);};}exports[_0x91d7('0x22')]=function(_0x5f454a,_0x251f51){var _0x7d16da={},_0x21c0f0={},_0x40a5e3={'count':0x0,'rows':[]};var _0x2f93a0=_['map'](db['ServicenowConfiguration'][_0x91d7('0x23')],function(_0x168912){return{'name':_0x168912['fieldName'],'type':_0x168912['type'][_0x91d7('0x24')]};});_0x21c0f0[_0x91d7('0x25')]=_[_0x91d7('0x26')](_0x2f93a0,_0x91d7('0x21'));_0x21c0f0[_0x91d7('0x27')]=_['keys'](_0x5f454a[_0x91d7('0x27')]);_0x21c0f0[_0x91d7('0x28')]=_['intersection'](_0x21c0f0[_0x91d7('0x25')],_0x21c0f0[_0x91d7('0x27')]);_0x7d16da[_0x91d7('0x29')]=_['intersection'](_0x21c0f0['model'],qs[_0x91d7('0x2a')](_0x5f454a[_0x91d7('0x27')]['fields']));_0x7d16da['attributes']=_0x7d16da[_0x91d7('0x29')]['length']?_0x7d16da[_0x91d7('0x29')]:_0x21c0f0[_0x91d7('0x25')];if(!_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x7d16da[_0x91d7('0x1a')]=qs['limit'](_0x5f454a[_0x91d7('0x27')][_0x91d7('0x1a')]);_0x7d16da['offset']=qs[_0x91d7('0x18')](_0x5f454a[_0x91d7('0x27')]['offset']);}_0x7d16da[_0x91d7('0x2d')]=qs[_0x91d7('0x2e')](_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x7d16da['where']=qs[_0x91d7('0x28')](_['pick'](_0x5f454a[_0x91d7('0x27')],_0x21c0f0[_0x91d7('0x28')]),_0x2f93a0);if(_0x5f454a['query'][_0x91d7('0x2f')]){_0x7d16da['where']=_['merge'](_0x7d16da[_0x91d7('0x30')],{'$or':_[_0x91d7('0x26')](_0x2f93a0,function(_0x371e6f){if(_0x371e6f[_0x91d7('0x31')]!==_0x91d7('0x32')){var _0x4ef526={};_0x4ef526[_0x371e6f['name']]={'$like':'%'+_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x4ef526;}})});}_0x7d16da=_[_0x91d7('0x33')]({},_0x7d16da,_0x5f454a[_0x91d7('0x34')]);var _0x1fbfe2={'where':_0x7d16da['where']};return db[_0x91d7('0x35')][_0x91d7('0x1b')](_0x1fbfe2)[_0x91d7('0x36')](function(_0x5939ea){_0x40a5e3[_0x91d7('0x1b')]=_0x5939ea;if(_0x5f454a[_0x91d7('0x27')]['includeAll']){_0x7d16da['include']=[{'all':!![]}];}return db[_0x91d7('0x35')]['findAll'](_0x7d16da);})[_0x91d7('0x36')](function(_0x7df3c4){_0x40a5e3[_0x91d7('0x37')]=_0x7df3c4;return _0x40a5e3;})['then'](respondWithFilteredResult(_0x251f51,_0x7d16da))[_0x91d7('0x38')](handleError(_0x251f51,null));};exports[_0x91d7('0x39')]=function(_0x5bb728,_0xfbc3de){var _0x36cc22={'raw':![],'where':{'id':_0x5bb728['params']['id']}},_0x12c3c4={};_0x12c3c4[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db['ServicenowConfiguration'][_0x91d7('0x23')]);_0x12c3c4['query']=_[_0x91d7('0x3a')](_0x5bb728[_0x91d7('0x27')]);_0x12c3c4[_0x91d7('0x28')]=_['intersection'](_0x12c3c4[_0x91d7('0x25')],_0x12c3c4[_0x91d7('0x27')]);_0x36cc22[_0x91d7('0x29')]=_[_0x91d7('0x3b')](_0x12c3c4[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x5bb728['query'][_0x91d7('0x2a')]));_0x36cc22['attributes']=_0x36cc22['attributes'][_0x91d7('0x3c')]?_0x36cc22[_0x91d7('0x29')]:_0x12c3c4['model'];if(_0x5bb728[_0x91d7('0x27')][_0x91d7('0x3d')]){_0x36cc22[_0x91d7('0x3e')]=[{'all':!![]}];}_0x36cc22=_[_0x91d7('0x33')]({},_0x36cc22,_0x5bb728[_0x91d7('0x34')]);return db[_0x91d7('0x35')][_0x91d7('0x3f')](_0x36cc22)[_0x91d7('0x36')](handleEntityNotFound(_0xfbc3de,null))[_0x91d7('0x36')](respondWithResult(_0xfbc3de,null))[_0x91d7('0x38')](handleError(_0xfbc3de,null));};exports[_0x91d7('0x40')]=function(_0x155ce0,_0x31fb8f){return db[_0x91d7('0x35')][_0x91d7('0x40')](_0x155ce0[_0x91d7('0x41')],{})[_0x91d7('0x36')](respondWithResult(_0x31fb8f,0xc9))[_0x91d7('0x38')](handleError(_0x31fb8f,null));};exports[_0x91d7('0x1e')]=function(_0x1dd10d,_0x2b38b1){if(_0x1dd10d['body']['id']){delete _0x1dd10d[_0x91d7('0x41')]['id'];}return db['ServicenowConfiguration'][_0x91d7('0x3f')]({'where':{'id':_0x1dd10d[_0x91d7('0x42')]['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x2b38b1,null))[_0x91d7('0x36')](saveUpdates(_0x1dd10d[_0x91d7('0x41')],null))['then'](respondWithResult(_0x2b38b1,null))[_0x91d7('0x38')](handleError(_0x2b38b1,null));};exports[_0x91d7('0x1f')]=function(_0x3dfbae,_0xcaa74f){return db[_0x91d7('0x35')]['find']({'where':{'id':_0x3dfbae['params']['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0xcaa74f,null))['then'](removeEntity(_0xcaa74f,null))[_0x91d7('0x38')](handleError(_0xcaa74f,null));};exports['getFields']=function(_0xc4867b,_0x5116c5,_0x4ff77b){var _0x49b092={};var _0x261160={};var _0x277631;var _0xc80189;return db['ServicenowConfiguration'][_0x91d7('0x43')]({'where':{'id':_0xc4867b['params']['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x5116c5,null))['then'](function(_0xd710ba){if(_0xd710ba){_0x277631=_0xd710ba;_0x261160[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db[_0x91d7('0x44')][_0x91d7('0x23')]);_0x261160[_0x91d7('0x27')]=_[_0x91d7('0x3a')](_0xc4867b[_0x91d7('0x27')]);_0x261160[_0x91d7('0x28')]=_['intersection'](_0x261160[_0x91d7('0x25')],_0x261160['query']);_0x49b092[_0x91d7('0x29')]=_[_0x91d7('0x3b')](_0x261160['model'],qs[_0x91d7('0x2a')](_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2a')]));_0x49b092[_0x91d7('0x29')]=_0x49b092[_0x91d7('0x29')]['length']?_0x49b092[_0x91d7('0x29')]:_0x261160['model'];_0x49b092[_0x91d7('0x2d')]=qs[_0x91d7('0x2e')](_0xc4867b[_0x91d7('0x27')]['sort']);_0x49b092[_0x91d7('0x30')]=qs['filters'](_[_0x91d7('0x45')](_0xc4867b[_0x91d7('0x27')],_0x261160[_0x91d7('0x28')]));if(_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x49b092['where']=_[_0x91d7('0x33')](_0x49b092[_0x91d7('0x30')],{'$or':_[_0x91d7('0x26')](_0x49b092[_0x91d7('0x29')],function(_0x1f460e){var _0x333b2f={};_0x333b2f[_0x1f460e]={'$like':'%'+_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x333b2f;})});}_0x49b092=_[_0x91d7('0x33')]({},_0x49b092,_0xc4867b[_0x91d7('0x34')]);return _0x277631['getFields'](_0x49b092);}})[_0x91d7('0x36')](function(_0x34f6f1){if(_0x34f6f1){_0xc80189=_0x34f6f1[_0x91d7('0x3c')];if(!_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x49b092[_0x91d7('0x1a')]=qs[_0x91d7('0x1a')](_0xc4867b[_0x91d7('0x27')][_0x91d7('0x1a')]);_0x49b092['offset']=qs[_0x91d7('0x18')](_0xc4867b[_0x91d7('0x27')]['offset']);}return _0x277631[_0x91d7('0x46')](_0x49b092);}})[_0x91d7('0x36')](function(_0x42855e){if(_0x42855e){return _0x42855e?{'count':_0xc80189,'rows':_0x42855e}:null;}})[_0x91d7('0x36')](respondWithResult(_0x5116c5,null))[_0x91d7('0x38')](handleError(_0x5116c5,null));};exports[_0x91d7('0x47')]=function(_0x39ecfa,_0x4dad51,_0x52fa90){var _0x732d7d={};var _0x1b5e67={};var _0x3c861c;var _0x41d8dc;return db[_0x91d7('0x35')][_0x91d7('0x43')]({'where':{'id':_0x39ecfa[_0x91d7('0x42')]['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x4dad51,null))['then'](function(_0xc6ab59){if(_0xc6ab59){_0x3c861c=_0xc6ab59;_0x1b5e67['model']=_[_0x91d7('0x3a')](db[_0x91d7('0x44')]['rawAttributes']);_0x1b5e67[_0x91d7('0x27')]=_[_0x91d7('0x3a')](_0x39ecfa['query']);_0x1b5e67[_0x91d7('0x28')]=_[_0x91d7('0x3b')](_0x1b5e67['model'],_0x1b5e67[_0x91d7('0x27')]);_0x732d7d['attributes']=_['intersection'](_0x1b5e67[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2a')]));_0x732d7d['attributes']=_0x732d7d[_0x91d7('0x29')][_0x91d7('0x3c')]?_0x732d7d[_0x91d7('0x29')]:_0x1b5e67[_0x91d7('0x25')];_0x732d7d['order']=qs[_0x91d7('0x2e')](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x732d7d[_0x91d7('0x30')]=qs[_0x91d7('0x28')](_['pick'](_0x39ecfa[_0x91d7('0x27')],_0x1b5e67[_0x91d7('0x28')]));if(_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x732d7d[_0x91d7('0x30')]=_[_0x91d7('0x33')](_0x732d7d['where'],{'$or':_['map'](_0x732d7d[_0x91d7('0x29')],function(_0x722f16){var _0x66eebb={};_0x66eebb[_0x722f16]={'$like':'%'+_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x66eebb;})});}_0x732d7d=_['merge']({},_0x732d7d,_0x39ecfa[_0x91d7('0x34')]);return _0x3c861c[_0x91d7('0x47')](_0x732d7d);}})[_0x91d7('0x36')](function(_0x5ccc06){if(_0x5ccc06){_0x41d8dc=_0x5ccc06[_0x91d7('0x3c')];if(!_0x39ecfa['query']['hasOwnProperty']('nolimit')){_0x732d7d[_0x91d7('0x1a')]=qs[_0x91d7('0x1a')](_0x39ecfa['query'][_0x91d7('0x1a')]);_0x732d7d['offset']=qs['offset'](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x18')]);}return _0x3c861c[_0x91d7('0x47')](_0x732d7d);}})[_0x91d7('0x36')](function(_0x6cbe37){if(_0x6cbe37){return _0x6cbe37?{'count':_0x41d8dc,'rows':_0x6cbe37}:null;}})[_0x91d7('0x36')](respondWithResult(_0x4dad51,null))['catch'](handleError(_0x4dad51,null));};exports[_0x91d7('0x48')]=function(_0x2a4dec,_0x1d9657,_0x3494be){var _0x474889={};var _0x1eb200={};var _0x334564;var _0x28fe5d;return db[_0x91d7('0x35')][_0x91d7('0x43')]({'where':{'id':_0x2a4dec[_0x91d7('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9657,null))[_0x91d7('0x36')](function(_0x4933b6){if(_0x4933b6){_0x334564=_0x4933b6;_0x1eb200[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db['ServicenowField'][_0x91d7('0x23')]);_0x1eb200['query']=_[_0x91d7('0x3a')](_0x2a4dec[_0x91d7('0x27')]);_0x1eb200['filters']=_[_0x91d7('0x3b')](_0x1eb200[_0x91d7('0x25')],_0x1eb200[_0x91d7('0x27')]);_0x474889[_0x91d7('0x29')]=_['intersection'](_0x1eb200[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x2a4dec['query'][_0x91d7('0x2a')]));_0x474889[_0x91d7('0x29')]=_0x474889[_0x91d7('0x29')][_0x91d7('0x3c')]?_0x474889['attributes']:_0x1eb200[_0x91d7('0x25')];_0x474889[_0x91d7('0x2d')]=qs['sort'](_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x474889[_0x91d7('0x30')]=qs[_0x91d7('0x28')](_[_0x91d7('0x45')](_0x2a4dec[_0x91d7('0x27')],_0x1eb200[_0x91d7('0x28')]));if(_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x474889[_0x91d7('0x30')]=_[_0x91d7('0x33')](_0x474889['where'],{'$or':_[_0x91d7('0x26')](_0x474889[_0x91d7('0x29')],function(_0xe62a){var _0x20378f={};_0x20378f[_0xe62a]={'$like':'%'+_0x2a4dec[_0x91d7('0x27')]['filter']+'%'};return _0x20378f;})});}_0x474889=_[_0x91d7('0x33')]({},_0x474889,_0x2a4dec['options']);return _0x334564[_0x91d7('0x48')](_0x474889);}})['then'](function(_0x545831){if(_0x545831){_0x28fe5d=_0x545831[_0x91d7('0x3c')];if(!_0x2a4dec['query'][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x474889[_0x91d7('0x1a')]=qs['limit'](_0x2a4dec[_0x91d7('0x27')]['limit']);_0x474889[_0x91d7('0x18')]=qs[_0x91d7('0x18')](_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x18')]);}return _0x334564['getDescriptions'](_0x474889);}})['then'](function(_0x4c2a11){if(_0x4c2a11){return _0x4c2a11?{'count':_0x28fe5d,'rows':_0x4c2a11}:null;}})['then'](respondWithResult(_0x1d9657,null))['catch'](handleError(_0x1d9657,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 38eefe5..2cf506a 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 _0x6e1c=['ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e1c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6e1('0x1'));var moment=require(_0xc6e1('0x2'));var BPromise=require(_0xc6e1('0x3'));var rp=require(_0xc6e1('0x4'));var fs=require('fs');var path=require(_0xc6e1('0x5'));var rimraf=require(_0xc6e1('0x6'));var config=require(_0xc6e1('0x7'));var attributes=require(_0xc6e1('0x8'));module[_0xc6e1('0x9')]=function(_0x3e2d6c,_0x468a80){return _0x3e2d6c['define'](_0xc6e1('0xa'),attributes,{'tableName':_0xc6e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d37=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0xb8001f,_0x4acfca){var _0x231af5=function(_0x12a0a3){while(--_0x12a0a3){_0xb8001f['push'](_0xb8001f['shift']());}};_0x231af5(++_0x4acfca);}(_0x8d37,0x1d5));var _0x78d3=function(_0xcdc5c7,_0x42bd73){_0xcdc5c7=_0xcdc5c7-0x0;var _0xf2e401=_0x8d37[_0xcdc5c7];return _0xf2e401;};'use strict';var _=require(_0x78d3('0x0'));var util=require(_0x78d3('0x1'));var logger=require(_0x78d3('0x2'))(_0x78d3('0x3'));var moment=require(_0x78d3('0x4'));var BPromise=require('bluebird');var rp=require(_0x78d3('0x5'));var fs=require('fs');var path=require(_0x78d3('0x6'));var rimraf=require(_0x78d3('0x7'));var config=require(_0x78d3('0x8'));var attributes=require(_0x78d3('0x9'));module[_0x78d3('0xa')]=function(_0xe9d481,_0x24f7b9){return _0xe9d481['define'](_0x78d3('0xb'),attributes,{'tableName':_0x78d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index a7e62ae..28efef6 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 _0x04f2=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x04f2,0x8f));var _0x204f=function(_0x3d23df,_0x2f1ce0){_0x3d23df=_0x3d23df-0x0;var _0x13f824=_0x04f2[_0x3d23df];return _0x13f824;};'use strict';var _=require(_0x204f('0x0'));var util=require('util');var moment=require(_0x204f('0x1'));var BPromise=require(_0x204f('0x2'));var rs=require(_0x204f('0x3'));var fs=require('fs');var Redis=require(_0x204f('0x4'));var db=require(_0x204f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x204f('0x6'))(_0x204f('0x7'));var config=require(_0x204f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x204f('0x9')][_0x204f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43399a,_0x33c57c,_0x330607){return new BPromise(function(_0x19fd98,_0x15699c){return client['request'](_0x43399a,_0x330607)[_0x204f('0xb')](function(_0x4cca13){logger[_0x204f('0xc')](_0x204f('0xd'),_0x33c57c,_0x204f('0xe'));logger[_0x204f('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x33c57c,_0x204f('0xe'),JSON[_0x204f('0x10')](_0x4cca13));if(_0x4cca13[_0x204f('0x11')]){if(_0x4cca13[_0x204f('0x11')][_0x204f('0x12')]===0x1f4){logger[_0x204f('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x33c57c,_0x4cca13['error'][_0x204f('0x13')]);return _0x15699c(_0x4cca13['error']['message']);}logger[_0x204f('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x33c57c,_0x4cca13[_0x204f('0x11')][_0x204f('0x13')]);return _0x19fd98(_0x4cca13['error'][_0x204f('0x13')]);}else{logger['info'](_0x204f('0xd'),_0x33c57c,'request\x20sent');_0x19fd98(_0x4cca13[_0x204f('0x14')][_0x204f('0x13')]);}})[_0x204f('0x15')](function(_0x5066d4){logger['error'](_0x204f('0xd'),_0x33c57c,_0x5066d4);_0x15699c(_0x5066d4);});});} \ No newline at end of file +var _0x022a=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45bb07,_0x395b5c){var _0x143312=function(_0x3f5d14){while(--_0x3f5d14){_0x45bb07['push'](_0x45bb07['shift']());}};_0x143312(++_0x395b5c);}(_0x022a,0xfa));var _0xa022=function(_0x285db,_0x4f4926){_0x285db=_0x285db-0x0;var _0x2ebec6=_0x022a[_0x285db];return _0x2ebec6;};'use strict';var _=require(_0xa022('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa022('0x1'));var rs=require(_0xa022('0x2'));var fs=require('fs');var Redis=require(_0xa022('0x3'));var db=require(_0xa022('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa022('0x5'))(_0xa022('0x6'));var config=require(_0xa022('0x7'));var jayson=require(_0xa022('0x8'));var client=jayson[_0xa022('0x9')][_0xa022('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2271,_0x15088e,_0x3e0d58){return new BPromise(function(_0x4d6227,_0x566608){return client[_0xa022('0xb')](_0x3e2271,_0x3e0d58)[_0xa022('0xc')](function(_0x443481){logger[_0xa022('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15088e,'request\x20sent');logger[_0xa022('0xe')](_0xa022('0xf'),_0x15088e,_0xa022('0x10'),JSON[_0xa022('0x11')](_0x443481));if(_0x443481['error']){if(_0x443481[_0xa022('0x12')]['code']===0x1f4){logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x443481[_0xa022('0x12')]['message']);return _0x566608(_0x443481['error'][_0xa022('0x14')]);}logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x443481['error']['message']);return _0x4d6227(_0x443481[_0xa022('0x12')][_0xa022('0x14')]);}else{logger[_0xa022('0xd')](_0xa022('0x13'),_0x15088e,_0xa022('0x10'));_0x4d6227(_0x443481['result'][_0xa022('0x14')]);}})[_0xa022('0x15')](function(_0x3ac58b){logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x3ac58b);_0x566608(_0x3ac58b);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c04c444..ccf3f9f 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 _0xcca0=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports'];(function(_0x497948,_0x4ca60c){var _0x39bb36=function(_0x2ec88e){while(--_0x2ec88e){_0x497948['push'](_0x497948['shift']());}};_0x39bb36(++_0x4ca60c);}(_0xcca0,0x1cb));var _0x0cca=function(_0x33a17b,_0x4e04ff){_0x33a17b=_0x33a17b-0x0;var _0x57e182=_0xcca0[_0x33a17b];return _0x57e182;};'use strict';var multer=require(_0x0cca('0x0'));var util=require(_0x0cca('0x1'));var path=require('path');var timeout=require(_0x0cca('0x2'));var express=require(_0x0cca('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0cca('0x4'));var interaction=require(_0x0cca('0x5'));var config=require(_0x0cca('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x0cca('0x7')](),controller[_0x0cca('0x8')]);router[_0x0cca('0x9')](_0x0cca('0xa'),auth[_0x0cca('0x7')](),controller[_0x0cca('0xb')]);router[_0x0cca('0xc')]('/',auth[_0x0cca('0x7')](),controller['create']);router[_0x0cca('0xd')]('/:id',auth[_0x0cca('0x7')](),controller['update']);router[_0x0cca('0xe')](_0x0cca('0xa'),auth[_0x0cca('0x7')](),controller[_0x0cca('0xf')]);module[_0x0cca('0x10')]=router; \ No newline at end of file +var _0x6edd=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x6edd,0x1e3));var _0xd6ed=function(_0x1060c2,_0x4671c4){_0x1060c2=_0x1060c2-0x0;var _0x882b4=_0x6edd[_0x1060c2];return _0x882b4;};'use strict';var multer=require(_0xd6ed('0x0'));var util=require('util');var path=require(_0xd6ed('0x1'));var timeout=require(_0xd6ed('0x2'));var express=require(_0xd6ed('0x3'));var router=express[_0xd6ed('0x4')]();var fs_extra=require(_0xd6ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6ed('0x6'));var config=require(_0xd6ed('0x7'));var controller=require(_0xd6ed('0x8'));router[_0xd6ed('0x9')]('/',auth['isAuthenticated'](),controller[_0xd6ed('0xa')]);router['get'](_0xd6ed('0xb'),auth[_0xd6ed('0xc')](),controller['show']);router[_0xd6ed('0xd')]('/',auth['isAuthenticated'](),controller[_0xd6ed('0xe')]);router[_0xd6ed('0xf')](_0xd6ed('0xb'),auth[_0xd6ed('0xc')](),controller[_0xd6ed('0x10')]);router[_0xd6ed('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd6ed('0x12')]);module[_0xd6ed('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index cfc4bfc..a45c44a 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 _0xe7f6=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x4cdc72,_0x475299){var _0x327e37=function(_0x1ec22c){while(--_0x1ec22c){_0x4cdc72['push'](_0x4cdc72['shift']());}};_0x327e37(++_0x475299);}(_0xe7f6,0x12a));var _0x6e7f=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0xe7f6[_0x4191bc];return _0x1ffd4e;};'use strict';var Sequelize=require(_0x6e7f('0x0'));module[_0x6e7f('0x1')]={'type':{'type':Sequelize[_0x6e7f('0x2')](_0x6e7f('0x3'),_0x6e7f('0x4'),'customVariable',_0x6e7f('0x5'),_0x6e7f('0x6')),'defaultValue':_0x6e7f('0x3')},'content':{'type':Sequelize[_0x6e7f('0x7')]},'key':{'type':Sequelize[_0x6e7f('0x7')]},'keyType':{'type':Sequelize[_0x6e7f('0x2')]('string',_0x6e7f('0x4'),_0x6e7f('0x8'))},'keyContent':{'type':Sequelize[_0x6e7f('0x7')]},'idField':{'type':Sequelize[_0x6e7f('0x7')]},'nameField':{'type':Sequelize[_0x6e7f('0x7')]},'customField':{'type':Sequelize[_0x6e7f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e7f('0x7')]}}; \ No newline at end of file +var _0xda08=['picklist','STRING','ENUM','string','BOOLEAN','variable','customVariable'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xda08,0x1da));var _0x8da0=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xda08[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x8da0('0x0'),_0x8da0('0x1'),'keyValue',_0x8da0('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8da0('0x3')]},'key':{'type':Sequelize[_0x8da0('0x3')]},'keyType':{'type':Sequelize[_0x8da0('0x4')](_0x8da0('0x5'),_0x8da0('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x8da0('0x3')]},'idField':{'type':Sequelize[_0x8da0('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8da0('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8da0('0x3')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index fa2e562..1e45412 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 _0x6107=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','rows','catch','params','ServicenowField','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x3b9183,_0x9b8497){var _0xc5820d=function(_0x4a5fe9){while(--_0x4a5fe9){_0x3b9183['push'](_0x3b9183['shift']());}};_0xc5820d(++_0x9b8497);}(_0x6107,0xc6));var _0x7610=function(_0x388132,_0x8be4e){_0x388132=_0x388132-0x0;var _0x1518f2=_0x6107[_0x388132];return _0x1518f2;};'use strict';var emlformat=require(_0x7610('0x0'));var rimraf=require(_0x7610('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7610('0x2'));var rp=require(_0x7610('0x3'));var moment=require(_0x7610('0x4'));var BPromise=require(_0x7610('0x5'));var Mustache=require(_0x7610('0x6'));var util=require('util');var path=require(_0x7610('0x7'));var sox=require(_0x7610('0x8'));var csv=require('to-csv');var ejs=require(_0x7610('0x9'));var fs=require('fs');var fs_extra=require(_0x7610('0xa'));var _=require(_0x7610('0xb'));var squel=require(_0x7610('0xc'));var crypto=require(_0x7610('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7610('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7610('0xf'));var authService=require(_0x7610('0x10'));var qs=require(_0x7610('0x11'));var as=require(_0x7610('0x12'));var hardwareService=require(_0x7610('0x13'));var logger=require(_0x7610('0x14'))(_0x7610('0x15'));var utils=require(_0x7610('0x16'));var config=require(_0x7610('0x17'));var licenseUtil=require(_0x7610('0x18'));var db=require(_0x7610('0x19'))['db'];function respondWithStatusCode(_0x579775,_0x413f01){_0x413f01=_0x413f01||0xcc;return function(_0xb5bad2){if(_0xb5bad2){return _0x579775['sendStatus'](_0x413f01);}return _0x579775[_0x7610('0x1a')](_0x413f01)[_0x7610('0x1b')]();};}function respondWithResult(_0x5873a5,_0x56e574){_0x56e574=_0x56e574||0xc8;return function(_0x501226){if(_0x501226){return _0x5873a5['status'](_0x56e574)[_0x7610('0x1c')](_0x501226);}};}function respondWithFilteredResult(_0x393f9b,_0x5a82cf){return function(_0x58b95f){if(_0x58b95f){var _0x1d4c23=typeof _0x5a82cf['offset']===_0x7610('0x1d')&&typeof _0x5a82cf[_0x7610('0x1e')]==='undefined';var _0x13c53c=_0x58b95f[_0x7610('0x1f')];var _0x507df4=_0x1d4c23?0x0:_0x5a82cf[_0x7610('0x20')];var _0x2353f5=_0x1d4c23?_0x58b95f['count']:_0x5a82cf[_0x7610('0x20')]+_0x5a82cf[_0x7610('0x1e')];var _0x1e77ec;if(_0x2353f5>=_0x13c53c){_0x2353f5=_0x13c53c;_0x1e77ec=0xc8;}else{_0x1e77ec=0xce;}_0x393f9b[_0x7610('0x1a')](_0x1e77ec);return _0x393f9b[_0x7610('0x21')](_0x7610('0x22'),_0x507df4+'-'+_0x2353f5+'/'+_0x13c53c)[_0x7610('0x1c')](_0x58b95f);}return null;};}function patchUpdates(_0x53c7c0){return function(_0x4feee0){try{jsonpatch[_0x7610('0x23')](_0x4feee0,_0x53c7c0,!![]);}catch(_0x260f73){return BPromise['reject'](_0x260f73);}return _0x4feee0['save']();};}function saveUpdates(_0x1d8e8b,_0x26f225){return function(_0x1fcc8b){if(_0x1fcc8b){return _0x1fcc8b[_0x7610('0x24')](_0x1d8e8b)[_0x7610('0x25')](function(_0x268c8d){return _0x268c8d;});}return null;};}function removeEntity(_0x469b31,_0xd57606){return function(_0x3ddf02){if(_0x3ddf02){return _0x3ddf02[_0x7610('0x26')]()[_0x7610('0x25')](function(){_0x469b31[_0x7610('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5daa3d,_0x21e4f2){return function(_0x3e1610){if(!_0x3e1610){_0x5daa3d[_0x7610('0x27')](0x194);}return _0x3e1610;};}function handleError(_0x3b0af0,_0x20d92c){_0x20d92c=_0x20d92c||0x1f4;return function(_0x53ac9d){logger[_0x7610('0x28')](_0x53ac9d[_0x7610('0x29')]);if(_0x53ac9d[_0x7610('0x2a')]){delete _0x53ac9d[_0x7610('0x2a')];}_0x3b0af0[_0x7610('0x1a')](_0x20d92c)['send'](_0x53ac9d);};}exports[_0x7610('0x2b')]=function(_0x4f5373,_0x2ae22e){var _0x1994ed={},_0x3bd69d={},_0x599817={'count':0x0,'rows':[]};var _0x345046=_['map'](db['ServicenowField'][_0x7610('0x2c')],function(_0xd9f866){return{'name':_0xd9f866[_0x7610('0x2d')],'type':_0xd9f866[_0x7610('0x2e')][_0x7610('0x2f')]};});_0x3bd69d[_0x7610('0x30')]=_['map'](_0x345046,_0x7610('0x2a'));_0x3bd69d[_0x7610('0x31')]=_[_0x7610('0x32')](_0x4f5373[_0x7610('0x31')]);_0x3bd69d[_0x7610('0x33')]=_[_0x7610('0x34')](_0x3bd69d[_0x7610('0x30')],_0x3bd69d[_0x7610('0x31')]);_0x1994ed[_0x7610('0x35')]=_[_0x7610('0x34')](_0x3bd69d[_0x7610('0x30')],qs[_0x7610('0x36')](_0x4f5373[_0x7610('0x31')]['fields']));_0x1994ed[_0x7610('0x35')]=_0x1994ed[_0x7610('0x35')][_0x7610('0x37')]?_0x1994ed[_0x7610('0x35')]:_0x3bd69d['model'];if(!_0x4f5373[_0x7610('0x31')][_0x7610('0x38')]('nolimit')){_0x1994ed[_0x7610('0x1e')]=qs['limit'](_0x4f5373[_0x7610('0x31')][_0x7610('0x1e')]);_0x1994ed[_0x7610('0x20')]=qs[_0x7610('0x20')](_0x4f5373[_0x7610('0x31')][_0x7610('0x20')]);}_0x1994ed[_0x7610('0x39')]=qs[_0x7610('0x3a')](_0x4f5373[_0x7610('0x31')][_0x7610('0x3a')]);_0x1994ed[_0x7610('0x3b')]=qs['filters'](_[_0x7610('0x3c')](_0x4f5373[_0x7610('0x31')],_0x3bd69d['filters']),_0x345046);if(_0x4f5373[_0x7610('0x31')]['filter']){_0x1994ed[_0x7610('0x3b')]=_[_0x7610('0x3d')](_0x1994ed[_0x7610('0x3b')],{'$or':_['map'](_0x345046,function(_0x54d4f4){if(_0x54d4f4[_0x7610('0x2e')]!=='VIRTUAL'){var _0x4eec97={};_0x4eec97[_0x54d4f4[_0x7610('0x2a')]]={'$like':'%'+_0x4f5373[_0x7610('0x31')]['filter']+'%'};return _0x4eec97;}})});}_0x1994ed=_['merge']({},_0x1994ed,_0x4f5373['options']);var _0x1df66f={'where':_0x1994ed[_0x7610('0x3b')]};return db['ServicenowField'][_0x7610('0x1f')](_0x1df66f)['then'](function(_0x339d4f){_0x599817[_0x7610('0x1f')]=_0x339d4f;if(_0x4f5373[_0x7610('0x31')][_0x7610('0x3e')]){_0x1994ed['include']=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x1994ed);})[_0x7610('0x25')](function(_0x23b237){_0x599817[_0x7610('0x3f')]=_0x23b237;return _0x599817;})[_0x7610('0x25')](respondWithFilteredResult(_0x2ae22e,_0x1994ed))[_0x7610('0x40')](handleError(_0x2ae22e,null));};exports['show']=function(_0x3e43c1,_0x4419a9){var _0xcc876b={'raw':!![],'where':{'id':_0x3e43c1[_0x7610('0x41')]['id']}},_0x4de55f={};_0x4de55f['model']=_['keys'](db[_0x7610('0x42')]['rawAttributes']);_0x4de55f[_0x7610('0x31')]=_['keys'](_0x3e43c1[_0x7610('0x31')]);_0x4de55f[_0x7610('0x33')]=_[_0x7610('0x34')](_0x4de55f[_0x7610('0x30')],_0x4de55f[_0x7610('0x31')]);_0xcc876b['attributes']=_['intersection'](_0x4de55f[_0x7610('0x30')],qs['fields'](_0x3e43c1[_0x7610('0x31')][_0x7610('0x36')]));_0xcc876b[_0x7610('0x35')]=_0xcc876b[_0x7610('0x35')][_0x7610('0x37')]?_0xcc876b['attributes']:_0x4de55f[_0x7610('0x30')];if(_0x3e43c1[_0x7610('0x31')][_0x7610('0x3e')]){_0xcc876b['include']=[{'all':!![]}];}_0xcc876b=_[_0x7610('0x3d')]({},_0xcc876b,_0x3e43c1[_0x7610('0x43')]);return db['ServicenowField'][_0x7610('0x44')](_0xcc876b)['then'](handleEntityNotFound(_0x4419a9,null))[_0x7610('0x25')](respondWithResult(_0x4419a9,null))[_0x7610('0x40')](handleError(_0x4419a9,null));};exports[_0x7610('0x45')]=function(_0x56c54b,_0x3253c7){return db[_0x7610('0x42')]['create'](_0x56c54b[_0x7610('0x46')],{})['then'](respondWithResult(_0x3253c7,0xc9))['catch'](handleError(_0x3253c7,null));};exports[_0x7610('0x24')]=function(_0x2ab67e,_0x3593f3){if(_0x2ab67e[_0x7610('0x46')]['id']){delete _0x2ab67e[_0x7610('0x46')]['id'];}return db[_0x7610('0x42')][_0x7610('0x44')]({'where':{'id':_0x2ab67e['params']['id']}})[_0x7610('0x25')](handleEntityNotFound(_0x3593f3,null))[_0x7610('0x25')](saveUpdates(_0x2ab67e[_0x7610('0x46')],null))[_0x7610('0x25')](respondWithResult(_0x3593f3,null))['catch'](handleError(_0x3593f3,null));};exports[_0x7610('0x26')]=function(_0x38e755,_0x19e5dc){return db[_0x7610('0x42')][_0x7610('0x44')]({'where':{'id':_0x38e755[_0x7610('0x41')]['id']}})[_0x7610('0x25')](handleEntityNotFound(_0x19e5dc,null))[_0x7610('0x25')](removeEntity(_0x19e5dc,null))[_0x7610('0x40')](handleError(_0x19e5dc,null));}; \ No newline at end of file +var _0x855f=['then','destroy','stack','name','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x855f,0x14c));var _0xf855=function(_0x4002d0,_0x271b0d){_0x4002d0=_0x4002d0-0x0;var _0x344c88=_0x855f[_0x4002d0];return _0x344c88;};'use strict';var emlformat=require(_0xf855('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf855('0x1'));var jsonpatch=require(_0xf855('0x2'));var rp=require(_0xf855('0x3'));var moment=require('moment');var BPromise=require(_0xf855('0x4'));var Mustache=require('mustache');var util=require(_0xf855('0x5'));var path=require('path');var sox=require(_0xf855('0x6'));var csv=require(_0xf855('0x7'));var ejs=require(_0xf855('0x8'));var fs=require('fs');var fs_extra=require(_0xf855('0x9'));var _=require(_0xf855('0xa'));var squel=require(_0xf855('0xb'));var crypto=require(_0xf855('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf855('0xd'));var toCsv=require(_0xf855('0x7'));var querystring=require('querystring');var Papa=require(_0xf855('0xe'));var Redis=require('ioredis');var authService=require(_0xf855('0xf'));var qs=require(_0xf855('0x10'));var as=require(_0xf855('0x11'));var hardwareService=require(_0xf855('0x12'));var logger=require(_0xf855('0x13'))(_0xf855('0x14'));var utils=require(_0xf855('0x15'));var config=require(_0xf855('0x16'));var licenseUtil=require(_0xf855('0x17'));var db=require(_0xf855('0x18'))['db'];function respondWithStatusCode(_0x5a7658,_0x84bac7){_0x84bac7=_0x84bac7||0xcc;return function(_0x376cbd){if(_0x376cbd){return _0x5a7658[_0xf855('0x19')](_0x84bac7);}return _0x5a7658[_0xf855('0x1a')](_0x84bac7)[_0xf855('0x1b')]();};}function respondWithResult(_0x3b0b83,_0x32dd57){_0x32dd57=_0x32dd57||0xc8;return function(_0xae122d){if(_0xae122d){return _0x3b0b83[_0xf855('0x1a')](_0x32dd57)[_0xf855('0x1c')](_0xae122d);}};}function respondWithFilteredResult(_0x1a8d03,_0x324673){return function(_0x41a621){if(_0x41a621){var _0x152406=typeof _0x324673[_0xf855('0x1d')]==='undefined'&&typeof _0x324673[_0xf855('0x1e')]===_0xf855('0x1f');var _0x369364=_0x41a621[_0xf855('0x20')];var _0x41c319=_0x152406?0x0:_0x324673[_0xf855('0x1d')];var _0xeb4175=_0x152406?_0x41a621['count']:_0x324673[_0xf855('0x1d')]+_0x324673[_0xf855('0x1e')];var _0x416c27;if(_0xeb4175>=_0x369364){_0xeb4175=_0x369364;_0x416c27=0xc8;}else{_0x416c27=0xce;}_0x1a8d03[_0xf855('0x1a')](_0x416c27);return _0x1a8d03['set'](_0xf855('0x21'),_0x41c319+'-'+_0xeb4175+'/'+_0x369364)[_0xf855('0x1c')](_0x41a621);}return null;};}function patchUpdates(_0x29fa84){return function(_0x30927c){try{jsonpatch[_0xf855('0x22')](_0x30927c,_0x29fa84,!![]);}catch(_0xd19b41){return BPromise[_0xf855('0x23')](_0xd19b41);}return _0x30927c[_0xf855('0x24')]();};}function saveUpdates(_0x53e802,_0x309d92){return function(_0x249fba){if(_0x249fba){return _0x249fba[_0xf855('0x25')](_0x53e802)[_0xf855('0x26')](function(_0x3bc886){return _0x3bc886;});}return null;};}function removeEntity(_0x4a33a4,_0x472775){return function(_0x1c6e24){if(_0x1c6e24){return _0x1c6e24[_0xf855('0x27')]()['then'](function(){_0x4a33a4[_0xf855('0x1a')](0xcc)[_0xf855('0x1b')]();});}};}function handleEntityNotFound(_0x36db01,_0x1e2958){return function(_0xb41f53){if(!_0xb41f53){_0x36db01['sendStatus'](0x194);}return _0xb41f53;};}function handleError(_0x161498,_0x5cc7c4){_0x5cc7c4=_0x5cc7c4||0x1f4;return function(_0x287318){logger['error'](_0x287318[_0xf855('0x28')]);if(_0x287318[_0xf855('0x29')]){delete _0x287318[_0xf855('0x29')];}_0x161498['status'](_0x5cc7c4)['send'](_0x287318);};}exports['index']=function(_0x375f1a,_0x424a2b){var _0x5da4c4={},_0x40c006={},_0x38dc5f={'count':0x0,'rows':[]};var _0x397e01=_[_0xf855('0x2a')](db[_0xf855('0x2b')][_0xf855('0x2c')],function(_0x15eea7){return{'name':_0x15eea7[_0xf855('0x2d')],'type':_0x15eea7['type']['key']};});_0x40c006[_0xf855('0x2e')]=_[_0xf855('0x2a')](_0x397e01,_0xf855('0x29'));_0x40c006[_0xf855('0x2f')]=_[_0xf855('0x30')](_0x375f1a['query']);_0x40c006[_0xf855('0x31')]=_['intersection'](_0x40c006[_0xf855('0x2e')],_0x40c006['query']);_0x5da4c4['attributes']=_[_0xf855('0x32')](_0x40c006[_0xf855('0x2e')],qs[_0xf855('0x33')](_0x375f1a[_0xf855('0x2f')]['fields']));_0x5da4c4[_0xf855('0x34')]=_0x5da4c4[_0xf855('0x34')][_0xf855('0x35')]?_0x5da4c4[_0xf855('0x34')]:_0x40c006['model'];if(!_0x375f1a['query'][_0xf855('0x36')](_0xf855('0x37'))){_0x5da4c4[_0xf855('0x1e')]=qs[_0xf855('0x1e')](_0x375f1a[_0xf855('0x2f')][_0xf855('0x1e')]);_0x5da4c4[_0xf855('0x1d')]=qs[_0xf855('0x1d')](_0x375f1a[_0xf855('0x2f')]['offset']);}_0x5da4c4['order']=qs[_0xf855('0x38')](_0x375f1a[_0xf855('0x2f')][_0xf855('0x38')]);_0x5da4c4[_0xf855('0x39')]=qs[_0xf855('0x31')](_[_0xf855('0x3a')](_0x375f1a[_0xf855('0x2f')],_0x40c006[_0xf855('0x31')]),_0x397e01);if(_0x375f1a['query'][_0xf855('0x3b')]){_0x5da4c4['where']=_[_0xf855('0x3c')](_0x5da4c4['where'],{'$or':_[_0xf855('0x2a')](_0x397e01,function(_0x59e5a6){if(_0x59e5a6[_0xf855('0x3d')]!==_0xf855('0x3e')){var _0x421ad6={};_0x421ad6[_0x59e5a6[_0xf855('0x29')]]={'$like':'%'+_0x375f1a[_0xf855('0x2f')]['filter']+'%'};return _0x421ad6;}})});}_0x5da4c4=_[_0xf855('0x3c')]({},_0x5da4c4,_0x375f1a[_0xf855('0x3f')]);var _0x5a6c52={'where':_0x5da4c4[_0xf855('0x39')]};return db[_0xf855('0x2b')][_0xf855('0x20')](_0x5a6c52)[_0xf855('0x26')](function(_0x52babb){_0x38dc5f[_0xf855('0x20')]=_0x52babb;if(_0x375f1a['query']['includeAll']){_0x5da4c4['include']=[{'all':!![]}];}return db[_0xf855('0x2b')][_0xf855('0x40')](_0x5da4c4);})[_0xf855('0x26')](function(_0x592839){_0x38dc5f[_0xf855('0x41')]=_0x592839;return _0x38dc5f;})[_0xf855('0x26')](respondWithFilteredResult(_0x424a2b,_0x5da4c4))[_0xf855('0x42')](handleError(_0x424a2b,null));};exports[_0xf855('0x43')]=function(_0x3d0850,_0x2593cc){var _0x2e6e8c={'raw':!![],'where':{'id':_0x3d0850['params']['id']}},_0x23b7d6={};_0x23b7d6[_0xf855('0x2e')]=_['keys'](db[_0xf855('0x2b')][_0xf855('0x2c')]);_0x23b7d6['query']=_[_0xf855('0x30')](_0x3d0850[_0xf855('0x2f')]);_0x23b7d6[_0xf855('0x31')]=_['intersection'](_0x23b7d6['model'],_0x23b7d6[_0xf855('0x2f')]);_0x2e6e8c[_0xf855('0x34')]=_[_0xf855('0x32')](_0x23b7d6[_0xf855('0x2e')],qs['fields'](_0x3d0850[_0xf855('0x2f')][_0xf855('0x33')]));_0x2e6e8c[_0xf855('0x34')]=_0x2e6e8c[_0xf855('0x34')][_0xf855('0x35')]?_0x2e6e8c[_0xf855('0x34')]:_0x23b7d6['model'];if(_0x3d0850[_0xf855('0x2f')][_0xf855('0x44')]){_0x2e6e8c[_0xf855('0x45')]=[{'all':!![]}];}_0x2e6e8c=_[_0xf855('0x3c')]({},_0x2e6e8c,_0x3d0850[_0xf855('0x3f')]);return db[_0xf855('0x2b')][_0xf855('0x46')](_0x2e6e8c)[_0xf855('0x26')](handleEntityNotFound(_0x2593cc,null))[_0xf855('0x26')](respondWithResult(_0x2593cc,null))[_0xf855('0x42')](handleError(_0x2593cc,null));};exports[_0xf855('0x47')]=function(_0x3f6937,_0x53d0f7){return db[_0xf855('0x2b')][_0xf855('0x47')](_0x3f6937[_0xf855('0x48')],{})[_0xf855('0x26')](respondWithResult(_0x53d0f7,0xc9))[_0xf855('0x42')](handleError(_0x53d0f7,null));};exports['update']=function(_0x4a1ba4,_0x27a53e){if(_0x4a1ba4[_0xf855('0x48')]['id']){delete _0x4a1ba4[_0xf855('0x48')]['id'];}return db[_0xf855('0x2b')]['find']({'where':{'id':_0x4a1ba4[_0xf855('0x49')]['id']}})[_0xf855('0x26')](handleEntityNotFound(_0x27a53e,null))[_0xf855('0x26')](saveUpdates(_0x4a1ba4[_0xf855('0x48')],null))['then'](respondWithResult(_0x27a53e,null))[_0xf855('0x42')](handleError(_0x27a53e,null));};exports[_0xf855('0x27')]=function(_0x5c5b0d,_0xb3927d){return db[_0xf855('0x2b')][_0xf855('0x46')]({'where':{'id':_0x5c5b0d[_0xf855('0x49')]['id']}})['then'](handleEntityNotFound(_0xb3927d,null))[_0xf855('0x26')](removeEntity(_0xb3927d,null))[_0xf855('0x42')](handleError(_0xb3927d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 32dab88..2e0b285 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 _0x8490=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','idField'];(function(_0xcac346,_0x1a401d){var _0x4609c7=function(_0x51b5cd){while(--_0x51b5cd){_0xcac346['push'](_0xcac346['shift']());}};_0x4609c7(++_0x1a401d);}(_0x8490,0x6a));var _0x0849=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x8490[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x0849('0x0'));var util=require(_0x0849('0x1'));var logger=require(_0x0849('0x2'))(_0x0849('0x3'));var moment=require(_0x0849('0x4'));var BPromise=require(_0x0849('0x5'));var rp=require(_0x0849('0x6'));var fs=require('fs');var path=require(_0x0849('0x7'));var rimraf=require('rimraf');var config=require(_0x0849('0x8'));var attributes=require(_0x0849('0x9'));module['exports']=function(_0x36b782,_0x5c8fc8){return _0x36b782[_0x0849('0xa')](_0x0849('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x0849('0xc'),'fields':[_0x0849('0xd'),_0x0849('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc98=['util','moment','bluebird','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash'];(function(_0x120385,_0x54064d){var _0x1ccb0f=function(_0x3a36ea){while(--_0x3a36ea){_0x120385['push'](_0x120385['shift']());}};_0x1ccb0f(++_0x54064d);}(_0xcc98,0x8e));var _0x8cc9=function(_0xf892e4,_0xfe3e6){_0xf892e4=_0xf892e4-0x0;var _0x53d620=_0xcc98[_0xf892e4];return _0x53d620;};'use strict';var _=require(_0x8cc9('0x0'));var util=require(_0x8cc9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cc9('0x2'));var BPromise=require(_0x8cc9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cc9('0x4'));var rimraf=require(_0x8cc9('0x5'));var config=require(_0x8cc9('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x8cc9('0x7')]=function(_0x1e6ef4,_0x51d2b4){return _0x1e6ef4[_0x8cc9('0x8')](_0x8cc9('0x9'),attributes,{'tableName':_0x8cc9('0xa'),'paranoid':![],'indexes':[{'name':_0x8cc9('0xb'),'fields':[_0x8cc9('0xc'),'FieldId'],'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 d4ae260..7620f07 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x4461e8,_0x46f528){var _0x52eab1=function(_0x31d5a9){while(--_0x31d5a9){_0x4461e8['push'](_0x4461e8['shift']());}};_0x52eab1(++_0x46f528);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb7e7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x375efe,_0x27df2d){var _0x1d5db6=function(_0x43e15d){while(--_0x43e15d){_0x375efe['push'](_0x375efe['shift']());}};_0x1d5db6(++_0x27df2d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index a15e07e..e88dab1 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x339c0e,_0xdf07e7){var _0x119768=function(_0x5bae1c){while(--_0x5bae1c){_0x339c0e['push'](_0x339c0e['shift']());}};_0x119768(++_0xdf07e7);}(_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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3eb34a,_0x8ab133){var _0x2e75=function(_0x3a5dd4){while(--_0x3a5dd4){_0x3eb34a['push'](_0x3eb34a['shift']());}};_0x2e75(++_0x8ab133);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7779f77..9f69668 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(_0x4394d9,_0x5cd6a5){var _0x47489f=function(_0x21e1d8){while(--_0x21e1d8){_0x4394d9['push'](_0x4394d9['shift']());}};_0x47489f(++_0x5cd6a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x371979,_0x2887d8){var _0x4d1778=function(_0x1c638b){while(--_0x1c638b){_0x371979['push'](_0x371979['shift']());}};_0x4d1778(++_0x2887d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 e52e6e6..85621fb 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 _0x9304=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','update','body','params','getConfigurations','findOne','SugarcrmConfiguration','filters','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName'];(function(_0x41d042,_0x3062a5){var _0xb63ca=function(_0x4f63fa){while(--_0x4f63fa){_0x41d042['push'](_0x41d042['shift']());}};_0xb63ca(++_0x3062a5);}(_0x9304,0x1b5));var _0x4930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9304[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4930('0x1'));var moment=require(_0x4930('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4930('0x3'));var util=require('util');var path=require(_0x4930('0x4'));var sox=require(_0x4930('0x5'));var csv=require('to-csv');var ejs=require(_0x4930('0x6'));var fs=require('fs');var fs_extra=require(_0x4930('0x7'));var _=require('lodash');var squel=require(_0x4930('0x8'));var crypto=require('crypto');var jsforce=require(_0x4930('0x9'));var deskjs=require(_0x4930('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4930('0xb'));var Papa=require('papaparse');var Redis=require(_0x4930('0xc'));var authService=require(_0x4930('0xd'));var qs=require(_0x4930('0xe'));var as=require(_0x4930('0xf'));var hardwareService=require(_0x4930('0x10'));var logger=require(_0x4930('0x11'))(_0x4930('0x12'));var utils=require('../../config/utils');var config=require(_0x4930('0x13'));var licenseUtil=require(_0x4930('0x14'));var db=require(_0x4930('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4999f0,_0x2c80d0){_0x2c80d0=_0x2c80d0||0xcc;return function(_0xcd4fc4){if(_0xcd4fc4){return _0x4999f0['sendStatus'](_0x2c80d0);}return _0x4999f0[_0x4930('0x16')](_0x2c80d0)[_0x4930('0x17')]();};}function respondWithResult(_0x1df175,_0x485dc9){_0x485dc9=_0x485dc9||0xc8;return function(_0x4c427b){if(_0x4c427b){return _0x1df175['status'](_0x485dc9)[_0x4930('0x18')](_0x4c427b);}};}function respondWithFilteredResult(_0x32c4da,_0x2869d5){return function(_0x1d68bf){if(_0x1d68bf){var _0x5b134b=typeof _0x2869d5[_0x4930('0x19')]==='undefined'&&typeof _0x2869d5['limit']===_0x4930('0x1a');var _0x3dc18f=_0x1d68bf[_0x4930('0x1b')];var _0x2b00d8=_0x5b134b?0x0:_0x2869d5[_0x4930('0x19')];var _0x34e755=_0x5b134b?_0x1d68bf['count']:_0x2869d5[_0x4930('0x19')]+_0x2869d5['limit'];var _0x1c540d;if(_0x34e755>=_0x3dc18f){_0x34e755=_0x3dc18f;_0x1c540d=0xc8;}else{_0x1c540d=0xce;}_0x32c4da[_0x4930('0x16')](_0x1c540d);return _0x32c4da['set']('Content-Range',_0x2b00d8+'-'+_0x34e755+'/'+_0x3dc18f)['json'](_0x1d68bf);}return null;};}function patchUpdates(_0x21ed9d){return function(_0x8c708){try{jsonpatch[_0x4930('0x1c')](_0x8c708,_0x21ed9d,!![]);}catch(_0x56828b){return BPromise[_0x4930('0x1d')](_0x56828b);}return _0x8c708[_0x4930('0x1e')]();};}function saveUpdates(_0x1ddb8c,_0x117f6f){return function(_0x2fdf48){if(_0x2fdf48){return _0x2fdf48['update'](_0x1ddb8c)['then'](function(_0x385a1b){return _0x385a1b;});}return null;};}function removeEntity(_0x1f5074,_0x42a153){return function(_0x205b20){if(_0x205b20){return _0x205b20[_0x4930('0x1f')]()[_0x4930('0x20')](function(){_0x1f5074['status'](0xcc)[_0x4930('0x17')]();});}};}function handleEntityNotFound(_0x499ac3,_0x46686c){return function(_0x1238a8){if(!_0x1238a8){_0x499ac3[_0x4930('0x21')](0x194);}return _0x1238a8;};}function handleError(_0x317fea,_0xdfd466){_0xdfd466=_0xdfd466||0x1f4;return function(_0x3e5261){logger[_0x4930('0x22')](_0x3e5261[_0x4930('0x23')]);if(_0x3e5261['name']){delete _0x3e5261[_0x4930('0x24')];}_0x317fea[_0x4930('0x16')](_0xdfd466)[_0x4930('0x25')](_0x3e5261);};}exports[_0x4930('0x26')]=function(_0x932e31,_0x13f30b){var _0x23d4dd={},_0x27381b={},_0x9bd9dd={'count':0x0,'rows':[]};var _0xa555c2=_[_0x4930('0x27')](db[_0x4930('0x28')][_0x4930('0x29')],function(_0x22ad32){return{'name':_0x22ad32[_0x4930('0x2a')],'type':_0x22ad32['type']['key']};});_0x27381b[_0x4930('0x2b')]=_[_0x4930('0x27')](_0xa555c2,_0x4930('0x24'));_0x27381b[_0x4930('0x2c')]=_[_0x4930('0x2d')](_0x932e31[_0x4930('0x2c')]);_0x27381b['filters']=_[_0x4930('0x2e')](_0x27381b[_0x4930('0x2b')],_0x27381b['query']);_0x23d4dd[_0x4930('0x2f')]=_['intersection'](_0x27381b['model'],qs['fields'](_0x932e31['query'][_0x4930('0x30')]));_0x23d4dd[_0x4930('0x2f')]=_0x23d4dd[_0x4930('0x2f')][_0x4930('0x31')]?_0x23d4dd['attributes']:_0x27381b['model'];if(!_0x932e31[_0x4930('0x2c')][_0x4930('0x32')](_0x4930('0x33'))){_0x23d4dd[_0x4930('0x34')]=qs[_0x4930('0x34')](_0x932e31[_0x4930('0x2c')][_0x4930('0x34')]);_0x23d4dd[_0x4930('0x19')]=qs[_0x4930('0x19')](_0x932e31[_0x4930('0x2c')][_0x4930('0x19')]);}_0x23d4dd[_0x4930('0x35')]=qs['sort'](_0x932e31[_0x4930('0x2c')][_0x4930('0x36')]);_0x23d4dd['where']=qs['filters'](_['pick'](_0x932e31[_0x4930('0x2c')],_0x27381b['filters']),_0xa555c2);if(_0x932e31[_0x4930('0x2c')][_0x4930('0x37')]){_0x23d4dd[_0x4930('0x38')]=_[_0x4930('0x39')](_0x23d4dd[_0x4930('0x38')],{'$or':_['map'](_0xa555c2,function(_0x40916f){if(_0x40916f[_0x4930('0x3a')]!==_0x4930('0x3b')){var _0x33746d={};_0x33746d[_0x40916f[_0x4930('0x24')]]={'$like':'%'+_0x932e31[_0x4930('0x2c')]['filter']+'%'};return _0x33746d;}})});}_0x23d4dd=_['merge']({},_0x23d4dd,_0x932e31[_0x4930('0x3c')]);var _0x213a81={'where':_0x23d4dd['where']};return db[_0x4930('0x28')][_0x4930('0x1b')](_0x213a81)['then'](function(_0xcfe641){_0x9bd9dd[_0x4930('0x1b')]=_0xcfe641;if(_0x932e31[_0x4930('0x2c')][_0x4930('0x3d')]){_0x23d4dd[_0x4930('0x3e')]=[{'all':!![]}];}return db[_0x4930('0x28')][_0x4930('0x3f')](_0x23d4dd);})[_0x4930('0x20')](function(_0x250248){_0x9bd9dd['rows']=_0x250248;return _0x9bd9dd;})[_0x4930('0x20')](respondWithFilteredResult(_0x13f30b,_0x23d4dd))[_0x4930('0x40')](handleError(_0x13f30b,null));};exports[_0x4930('0x41')]=function(_0x497f9c,_0x339c1b){var _0x4cb078={'raw':![],'where':{'id':_0x497f9c['params']['id']}},_0x4b59fd={};_0x4b59fd[_0x4930('0x2b')]=_[_0x4930('0x2d')](db[_0x4930('0x28')][_0x4930('0x29')]);_0x4b59fd['query']=_['keys'](_0x497f9c[_0x4930('0x2c')]);_0x4b59fd['filters']=_[_0x4930('0x2e')](_0x4b59fd[_0x4930('0x2b')],_0x4b59fd['query']);_0x4cb078['attributes']=_['intersection'](_0x4b59fd[_0x4930('0x2b')],qs[_0x4930('0x30')](_0x497f9c['query']['fields']));_0x4cb078[_0x4930('0x2f')]=_0x4cb078['attributes'][_0x4930('0x31')]?_0x4cb078['attributes']:_0x4b59fd['model'];if(_0x497f9c[_0x4930('0x2c')][_0x4930('0x3d')]){_0x4cb078[_0x4930('0x3e')]=[{'all':!![]}];}_0x4cb078=_[_0x4930('0x39')]({},_0x4cb078,_0x497f9c['options']);return db['SugarcrmAccount'][_0x4930('0x42')](_0x4cb078)[_0x4930('0x20')](handleEntityNotFound(_0x339c1b,null))[_0x4930('0x20')](respondWithResult(_0x339c1b,null))[_0x4930('0x40')](handleError(_0x339c1b,null));};exports[_0x4930('0x43')]=function(_0x254890,_0x47af55){return db[_0x4930('0x28')]['create'](_0x254890['body'],{})[_0x4930('0x20')](respondWithResult(_0x47af55,0xc9))[_0x4930('0x40')](handleError(_0x47af55,null));};exports[_0x4930('0x44')]=function(_0x456bfe,_0x590c7b){if(_0x456bfe[_0x4930('0x45')]['id']){delete _0x456bfe[_0x4930('0x45')]['id'];}return db[_0x4930('0x28')][_0x4930('0x42')]({'where':{'id':_0x456bfe['params']['id']}})['then'](handleEntityNotFound(_0x590c7b,null))[_0x4930('0x20')](saveUpdates(_0x456bfe[_0x4930('0x45')],null))[_0x4930('0x20')](respondWithResult(_0x590c7b,null))[_0x4930('0x40')](handleError(_0x590c7b,null));};exports[_0x4930('0x1f')]=function(_0x255a68,_0x6163e3){return db[_0x4930('0x28')]['find']({'where':{'id':_0x255a68[_0x4930('0x46')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x6163e3,null))[_0x4930('0x20')](removeEntity(_0x6163e3,null))[_0x4930('0x40')](handleError(_0x6163e3,null));};exports[_0x4930('0x47')]=function(_0x5a6ed3,_0xfbf523,_0x491915){var _0x1d0a90={};var _0x42d5c6={};var _0x19cb5d;var _0x1206f9;return db[_0x4930('0x28')][_0x4930('0x48')]({'where':{'id':_0x5a6ed3['params']['id']}})['then'](handleEntityNotFound(_0xfbf523,null))[_0x4930('0x20')](function(_0x11521b){if(_0x11521b){_0x19cb5d=_0x11521b;_0x42d5c6[_0x4930('0x2b')]=_[_0x4930('0x2d')](db[_0x4930('0x49')][_0x4930('0x29')]);_0x42d5c6[_0x4930('0x2c')]=_['keys'](_0x5a6ed3[_0x4930('0x2c')]);_0x42d5c6[_0x4930('0x4a')]=_['intersection'](_0x42d5c6[_0x4930('0x2b')],_0x42d5c6[_0x4930('0x2c')]);_0x1d0a90[_0x4930('0x2f')]=_[_0x4930('0x2e')](_0x42d5c6[_0x4930('0x2b')],qs[_0x4930('0x30')](_0x5a6ed3['query'][_0x4930('0x30')]));_0x1d0a90[_0x4930('0x2f')]=_0x1d0a90[_0x4930('0x2f')][_0x4930('0x31')]?_0x1d0a90[_0x4930('0x2f')]:_0x42d5c6[_0x4930('0x2b')];_0x1d0a90[_0x4930('0x35')]=qs[_0x4930('0x36')](_0x5a6ed3[_0x4930('0x2c')][_0x4930('0x36')]);_0x1d0a90[_0x4930('0x38')]=qs[_0x4930('0x4a')](_[_0x4930('0x4b')](_0x5a6ed3[_0x4930('0x2c')],_0x42d5c6[_0x4930('0x4a')]));if(_0x5a6ed3['query'][_0x4930('0x37')]){_0x1d0a90['where']=_[_0x4930('0x39')](_0x1d0a90[_0x4930('0x38')],{'$or':_[_0x4930('0x27')](_0x1d0a90[_0x4930('0x2f')],function(_0x125d05){var _0x57a057={};_0x57a057[_0x125d05]={'$like':'%'+_0x5a6ed3['query']['filter']+'%'};return _0x57a057;})});}_0x1d0a90=_[_0x4930('0x39')]({},_0x1d0a90,_0x5a6ed3['options']);return _0x19cb5d[_0x4930('0x47')](_0x1d0a90);}})[_0x4930('0x20')](function(_0x1aa1aa){if(_0x1aa1aa){_0x1206f9=_0x1aa1aa[_0x4930('0x31')];if(!_0x5a6ed3[_0x4930('0x2c')][_0x4930('0x32')](_0x4930('0x33'))){_0x1d0a90[_0x4930('0x34')]=qs[_0x4930('0x34')](_0x5a6ed3[_0x4930('0x2c')][_0x4930('0x34')]);_0x1d0a90[_0x4930('0x19')]=qs[_0x4930('0x19')](_0x5a6ed3[_0x4930('0x2c')][_0x4930('0x19')]);}return _0x19cb5d[_0x4930('0x47')](_0x1d0a90);}})[_0x4930('0x20')](function(_0x57b4d7){if(_0x57b4d7){return _0x57b4d7?{'count':_0x1206f9,'rows':_0x57b4d7}:null;}})[_0x4930('0x20')](respondWithResult(_0xfbf523,null))[_0x4930('0x40')](handleError(_0xfbf523,null));};exports[_0x4930('0x4c')]=function(_0x179744,_0x110bd6,_0xe988f9){if(_0x179744[_0x4930('0x45')]['id']){delete _0x179744[_0x4930('0x45')]['id'];}return db[_0x4930('0x28')][_0x4930('0x48')]({'where':{'id':_0x179744[_0x4930('0x46')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x110bd6,null))[_0x4930('0x20')](function(_0x1ccdf6){if(_0x1ccdf6){_0x179744[_0x4930('0x45')][_0x4930('0x4d')]=_0x1ccdf6['id'];_0x179744[_0x4930('0x45')][_0x4930('0x4e')]=integrations[_0x4930('0x4f')](_0x179744[_0x4930('0x45')][_0x4930('0x50')],_0x179744[_0x4930('0x45')][_0x4930('0x3a')]);_0x179744[_0x4930('0x45')][_0x4930('0x51')]=integrations[_0x4930('0x52')](_0x179744[_0x4930('0x45')]['channel'],_0x179744['body'][_0x4930('0x3a')]);return db[_0x4930('0x49')][_0x4930('0x43')](_0x179744[_0x4930('0x45')],{'include':[{'model':db[_0x4930('0x53')],'as':_0x4930('0x4e')},{'model':db[_0x4930('0x53')],'as':'Descriptions'}]});}return null;})[_0x4930('0x20')](respondWithResult(_0x110bd6,null))[_0x4930('0x40')](handleError(_0x110bd6,null));};exports[_0x4930('0x54')]=function(_0x1cfe4f,_0x55553b,_0x1dd659){var _0xf49da9='';var _0x1284cb=['id',_0x4930('0x24'),_0x4930('0x55'),'created_by',_0x4930('0x56'),_0x4930('0x57'),_0x4930('0x58'),_0x4930('0x59'),_0x4930('0x5a'),_0x4930('0x5b'),'parent_name','direction'];return db[_0x4930('0x28')][_0x4930('0x48')]({'where':{'id':_0x1cfe4f[_0x4930('0x46')]['id']},'attributes':['id','username','password','remoteUri']})[_0x4930('0x20')](handleEntityNotFound(_0x55553b,null))['then'](function(_0x5ce686){if(_0x5ce686){_0xf49da9=_0x5ce686[_0x4930('0x5c')];var _0x8cd396=_0xf49da9[_0x4930('0x5d')](-0x1);if(_0x8cd396==='/'){_0xf49da9=_0xf49da9[_0x4930('0x5e')](0x0,_0xf49da9[_0x4930('0x5f')](_0x8cd396));}return rp({'method':_0x4930('0x60'),'uri':util[_0x4930('0x61')](_0x4930('0x62'),_0xf49da9,_0x4930('0x63')),'json':!![],'form':{'method':_0x4930('0x64'),'input_type':_0x4930('0x65'),'response_type':_0x4930('0x65'),'rest_data':JSON[_0x4930('0x66')]({'user_auth':{'user_name':_0x5ce686[_0x4930('0x67')],'password':_0x5ce686[_0x4930('0x68')],'encryption':_0x4930('0x69')},'application':_0x4930('0x6a')})}});}})['then'](function(_0x15b788){if(_0x15b788&&_0x15b788[_0x4930('0x24')]!==_0x4930('0x6b')&&_0x15b788[_0x4930('0x24')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x4930('0x61')](_0x4930('0x62'),_0xf49da9,_0x4930('0x63')),'json':!![],'form':{'method':_0x4930('0x6c'),'input_type':_0x4930('0x65'),'response_type':_0x4930('0x65'),'rest_data':JSON['stringify']({'session':_0x15b788['id'],'module_name':_0x4930('0x6d')})}})[_0x4930('0x20')](function(_0x56888a){if(_0x56888a){var _0x305992=_[_0x4930('0x6e')](_0x56888a[_0x4930('0x6f')]);_['remove'](_0x305992,function(_0x3a3ff2){return _0x1284cb[_0x4930('0x70')](_0x3a3ff2['name']);});return{'count':_0x305992['length'],'rows':_[_0x4930('0x27')](_0x305992,function(_0x5b52bd){return{'id':_0x5b52bd[_0x4930('0x24')],'name':_0x5b52bd[_0x4930('0x71')],'custom':_[_0x4930('0x72')](_0x5b52bd[_0x4930('0x24')],'_c')?!![]:![],'options':_0x5b52bd[_0x4930('0x3c')]?_[_0x4930('0x27')](_[_0x4930('0x6e')](_0x5b52bd[_0x4930('0x3c')]),function(_0x43078d){return{'name':_0x43078d[_0x4930('0x73')],'value':_0x43078d[_0x4930('0x24')]};}):[]};})};}})[_0x4930('0x20')](respondWithResult(_0x55553b,null))[_0x4930('0x40')](function(_0x86060d){var _0x5208ab=_0x1cfe4f['query'][_0x4930('0x74')]?0x1f4:_0x86060d[_0x4930('0x75')]||0x1f4;logger['error'](_0x4930('0x76'),_0x4930('0x54'),_0x5208ab,JSON['stringify'](_0x86060d));delete _0x86060d[_0x4930('0x24')];if(_0x5208ab===0x191){_0x5208ab=0x190;}_0x55553b['status'](_0x5208ab)['send'](_0x1cfe4f[_0x4930('0x2c')][_0x4930('0x74')]?{'message':_0x4930('0x77'),'statusCode':_0x86060d[_0x4930('0x75')]}:_0x86060d);});}else{var _0x73d245=0x1f4;_0x55553b[_0x4930('0x16')](_0x73d245)[_0x4930('0x25')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xb358=['status','json','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','SugarcrmAccount','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filters','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','length','include','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','stringify','Calls','values','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x527a9d,_0x588f28){var _0x28f4dd=function(_0x48d66a){while(--_0x48d66a){_0x527a9d['push'](_0x527a9d['shift']());}};_0x28f4dd(++_0x588f28);}(_0xb358,0x1b5));var _0x8b35=function(_0x181240,_0xa66624){_0x181240=_0x181240-0x0;var _0x1a2fb7=_0xb358[_0x181240];return _0x1a2fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b35('0x0'));var zipdir=require(_0x8b35('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b35('0x2'));var BPromise=require(_0x8b35('0x3'));var Mustache=require(_0x8b35('0x4'));var util=require(_0x8b35('0x5'));var path=require(_0x8b35('0x6'));var sox=require(_0x8b35('0x7'));var csv=require(_0x8b35('0x8'));var ejs=require(_0x8b35('0x9'));var fs=require('fs');var fs_extra=require(_0x8b35('0xa'));var _=require('lodash');var squel=require(_0x8b35('0xb'));var crypto=require(_0x8b35('0xc'));var jsforce=require(_0x8b35('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8b35('0x8'));var querystring=require(_0x8b35('0xe'));var Papa=require(_0x8b35('0xf'));var Redis=require(_0x8b35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b35('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8b35('0x12'));var config=require(_0x8b35('0x13'));var licenseUtil=require(_0x8b35('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5fd158,_0x2ae34e){_0x2ae34e=_0x2ae34e||0xcc;return function(_0x2276e4){if(_0x2276e4){return _0x5fd158[_0x8b35('0x15')](_0x2ae34e);}return _0x5fd158['status'](_0x2ae34e)[_0x8b35('0x16')]();};}function respondWithResult(_0x213e0a,_0x18439d){_0x18439d=_0x18439d||0xc8;return function(_0x2c9df2){if(_0x2c9df2){return _0x213e0a[_0x8b35('0x17')](_0x18439d)[_0x8b35('0x18')](_0x2c9df2);}};}function respondWithFilteredResult(_0x4c4539,_0x578450){return function(_0x5e53e7){if(_0x5e53e7){var _0x3b24cf=typeof _0x578450['offset']==='undefined'&&typeof _0x578450[_0x8b35('0x19')]==='undefined';var _0xdb2e64=_0x5e53e7[_0x8b35('0x1a')];var _0x3bc447=_0x3b24cf?0x0:_0x578450['offset'];var _0x277ba6=_0x3b24cf?_0x5e53e7[_0x8b35('0x1a')]:_0x578450['offset']+_0x578450[_0x8b35('0x19')];var _0x200fdb;if(_0x277ba6>=_0xdb2e64){_0x277ba6=_0xdb2e64;_0x200fdb=0xc8;}else{_0x200fdb=0xce;}_0x4c4539['status'](_0x200fdb);return _0x4c4539[_0x8b35('0x1b')](_0x8b35('0x1c'),_0x3bc447+'-'+_0x277ba6+'/'+_0xdb2e64)[_0x8b35('0x18')](_0x5e53e7);}return null;};}function patchUpdates(_0x401d70){return function(_0x5cd63b){try{jsonpatch[_0x8b35('0x1d')](_0x5cd63b,_0x401d70,!![]);}catch(_0x2d280c){return BPromise[_0x8b35('0x1e')](_0x2d280c);}return _0x5cd63b['save']();};}function saveUpdates(_0x111fd7,_0x101b41){return function(_0x3b8bf7){if(_0x3b8bf7){return _0x3b8bf7[_0x8b35('0x1f')](_0x111fd7)[_0x8b35('0x20')](function(_0x57556d){return _0x57556d;});}return null;};}function removeEntity(_0x313848,_0x1ffde2){return function(_0x5b739c){if(_0x5b739c){return _0x5b739c[_0x8b35('0x21')]()[_0x8b35('0x20')](function(){_0x313848[_0x8b35('0x17')](0xcc)[_0x8b35('0x16')]();});}};}function handleEntityNotFound(_0x59c38c,_0x457412){return function(_0x51ee59){if(!_0x51ee59){_0x59c38c[_0x8b35('0x15')](0x194);}return _0x51ee59;};}function handleError(_0x1ac81a,_0x4fb045){_0x4fb045=_0x4fb045||0x1f4;return function(_0x3fa112){logger[_0x8b35('0x22')](_0x3fa112['stack']);if(_0x3fa112[_0x8b35('0x23')]){delete _0x3fa112[_0x8b35('0x23')];}_0x1ac81a[_0x8b35('0x17')](_0x4fb045)[_0x8b35('0x24')](_0x3fa112);};}exports[_0x8b35('0x25')]=function(_0x320052,_0x3232a7){var _0x22bd9b={},_0x53dd49={},_0xb56d53={'count':0x0,'rows':[]};var _0x16057b=_[_0x8b35('0x26')](db[_0x8b35('0x27')]['rawAttributes'],function(_0x36e748){return{'name':_0x36e748['fieldName'],'type':_0x36e748[_0x8b35('0x28')][_0x8b35('0x29')]};});_0x53dd49['model']=_[_0x8b35('0x26')](_0x16057b,_0x8b35('0x23'));_0x53dd49['query']=_[_0x8b35('0x2a')](_0x320052[_0x8b35('0x2b')]);_0x53dd49['filters']=_[_0x8b35('0x2c')](_0x53dd49[_0x8b35('0x2d')],_0x53dd49['query']);_0x22bd9b[_0x8b35('0x2e')]=_[_0x8b35('0x2c')](_0x53dd49[_0x8b35('0x2d')],qs[_0x8b35('0x2f')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x2f')]));_0x22bd9b['attributes']=_0x22bd9b['attributes']['length']?_0x22bd9b['attributes']:_0x53dd49[_0x8b35('0x2d')];if(!_0x320052[_0x8b35('0x2b')][_0x8b35('0x30')]('nolimit')){_0x22bd9b[_0x8b35('0x19')]=qs[_0x8b35('0x19')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x19')]);_0x22bd9b[_0x8b35('0x31')]=qs[_0x8b35('0x31')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x31')]);}_0x22bd9b[_0x8b35('0x32')]=qs[_0x8b35('0x33')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x33')]);_0x22bd9b[_0x8b35('0x34')]=qs['filters'](_[_0x8b35('0x35')](_0x320052[_0x8b35('0x2b')],_0x53dd49[_0x8b35('0x36')]),_0x16057b);if(_0x320052[_0x8b35('0x2b')]['filter']){_0x22bd9b[_0x8b35('0x34')]=_[_0x8b35('0x37')](_0x22bd9b[_0x8b35('0x34')],{'$or':_[_0x8b35('0x26')](_0x16057b,function(_0x5b67a6){if(_0x5b67a6[_0x8b35('0x28')]!=='VIRTUAL'){var _0x1187fd={};_0x1187fd[_0x5b67a6['name']]={'$like':'%'+_0x320052[_0x8b35('0x2b')]['filter']+'%'};return _0x1187fd;}})});}_0x22bd9b=_[_0x8b35('0x37')]({},_0x22bd9b,_0x320052[_0x8b35('0x38')]);var _0x11911d={'where':_0x22bd9b[_0x8b35('0x34')]};return db[_0x8b35('0x27')][_0x8b35('0x1a')](_0x11911d)[_0x8b35('0x20')](function(_0x2037b3){_0xb56d53[_0x8b35('0x1a')]=_0x2037b3;if(_0x320052[_0x8b35('0x2b')][_0x8b35('0x39')]){_0x22bd9b['include']=[{'all':!![]}];}return db[_0x8b35('0x27')][_0x8b35('0x3a')](_0x22bd9b);})[_0x8b35('0x20')](function(_0xcade55){_0xb56d53[_0x8b35('0x3b')]=_0xcade55;return _0xb56d53;})[_0x8b35('0x20')](respondWithFilteredResult(_0x3232a7,_0x22bd9b))[_0x8b35('0x3c')](handleError(_0x3232a7,null));};exports['show']=function(_0x58679b,_0x24101b){var _0x1a1889={'raw':![],'where':{'id':_0x58679b[_0x8b35('0x3d')]['id']}},_0x4a0d0e={};_0x4a0d0e[_0x8b35('0x2d')]=_['keys'](db['SugarcrmAccount'][_0x8b35('0x3e')]);_0x4a0d0e[_0x8b35('0x2b')]=_[_0x8b35('0x2a')](_0x58679b[_0x8b35('0x2b')]);_0x4a0d0e[_0x8b35('0x36')]=_[_0x8b35('0x2c')](_0x4a0d0e[_0x8b35('0x2d')],_0x4a0d0e[_0x8b35('0x2b')]);_0x1a1889['attributes']=_['intersection'](_0x4a0d0e['model'],qs[_0x8b35('0x2f')](_0x58679b[_0x8b35('0x2b')]['fields']));_0x1a1889[_0x8b35('0x2e')]=_0x1a1889['attributes'][_0x8b35('0x3f')]?_0x1a1889[_0x8b35('0x2e')]:_0x4a0d0e[_0x8b35('0x2d')];if(_0x58679b[_0x8b35('0x2b')][_0x8b35('0x39')]){_0x1a1889[_0x8b35('0x40')]=[{'all':!![]}];}_0x1a1889=_[_0x8b35('0x37')]({},_0x1a1889,_0x58679b[_0x8b35('0x38')]);return db[_0x8b35('0x27')]['find'](_0x1a1889)[_0x8b35('0x20')](handleEntityNotFound(_0x24101b,null))['then'](respondWithResult(_0x24101b,null))['catch'](handleError(_0x24101b,null));};exports[_0x8b35('0x41')]=function(_0x48ff7f,_0x49025e){return db[_0x8b35('0x27')][_0x8b35('0x41')](_0x48ff7f[_0x8b35('0x42')],{})[_0x8b35('0x20')](respondWithResult(_0x49025e,0xc9))[_0x8b35('0x3c')](handleError(_0x49025e,null));};exports[_0x8b35('0x1f')]=function(_0x286562,_0x288452){if(_0x286562[_0x8b35('0x42')]['id']){delete _0x286562[_0x8b35('0x42')]['id'];}return db[_0x8b35('0x27')][_0x8b35('0x43')]({'where':{'id':_0x286562['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x288452,null))[_0x8b35('0x20')](saveUpdates(_0x286562[_0x8b35('0x42')],null))['then'](respondWithResult(_0x288452,null))[_0x8b35('0x3c')](handleError(_0x288452,null));};exports[_0x8b35('0x21')]=function(_0x3a4fe0,_0x321d82){return db[_0x8b35('0x27')][_0x8b35('0x43')]({'where':{'id':_0x3a4fe0[_0x8b35('0x3d')]['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x321d82,null))[_0x8b35('0x20')](removeEntity(_0x321d82,null))['catch'](handleError(_0x321d82,null));};exports[_0x8b35('0x44')]=function(_0x5c0d92,_0x2f2eef,_0x5f21b9){var _0xdc18e8={};var _0x5a8a10={};var _0x11ca90;var _0x4b9f5a;return db[_0x8b35('0x27')][_0x8b35('0x45')]({'where':{'id':_0x5c0d92['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x2f2eef,null))['then'](function(_0x1b22db){if(_0x1b22db){_0x11ca90=_0x1b22db;_0x5a8a10['model']=_[_0x8b35('0x2a')](db[_0x8b35('0x46')][_0x8b35('0x3e')]);_0x5a8a10[_0x8b35('0x2b')]=_[_0x8b35('0x2a')](_0x5c0d92[_0x8b35('0x2b')]);_0x5a8a10[_0x8b35('0x36')]=_[_0x8b35('0x2c')](_0x5a8a10[_0x8b35('0x2d')],_0x5a8a10['query']);_0xdc18e8[_0x8b35('0x2e')]=_['intersection'](_0x5a8a10['model'],qs['fields'](_0x5c0d92[_0x8b35('0x2b')]['fields']));_0xdc18e8['attributes']=_0xdc18e8[_0x8b35('0x2e')][_0x8b35('0x3f')]?_0xdc18e8[_0x8b35('0x2e')]:_0x5a8a10[_0x8b35('0x2d')];_0xdc18e8[_0x8b35('0x32')]=qs[_0x8b35('0x33')](_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x33')]);_0xdc18e8[_0x8b35('0x34')]=qs[_0x8b35('0x36')](_[_0x8b35('0x35')](_0x5c0d92['query'],_0x5a8a10['filters']));if(_0x5c0d92[_0x8b35('0x2b')]['filter']){_0xdc18e8['where']=_['merge'](_0xdc18e8[_0x8b35('0x34')],{'$or':_[_0x8b35('0x26')](_0xdc18e8[_0x8b35('0x2e')],function(_0x3ab961){var _0x174e85={};_0x174e85[_0x3ab961]={'$like':'%'+_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x47')]+'%'};return _0x174e85;})});}_0xdc18e8=_[_0x8b35('0x37')]({},_0xdc18e8,_0x5c0d92[_0x8b35('0x38')]);return _0x11ca90[_0x8b35('0x44')](_0xdc18e8);}})[_0x8b35('0x20')](function(_0x54e9c4){if(_0x54e9c4){_0x4b9f5a=_0x54e9c4['length'];if(!_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x30')](_0x8b35('0x48'))){_0xdc18e8[_0x8b35('0x19')]=qs['limit'](_0x5c0d92['query'][_0x8b35('0x19')]);_0xdc18e8[_0x8b35('0x31')]=qs['offset'](_0x5c0d92['query'][_0x8b35('0x31')]);}return _0x11ca90[_0x8b35('0x44')](_0xdc18e8);}})[_0x8b35('0x20')](function(_0x4502b7){if(_0x4502b7){return _0x4502b7?{'count':_0x4b9f5a,'rows':_0x4502b7}:null;}})[_0x8b35('0x20')](respondWithResult(_0x2f2eef,null))[_0x8b35('0x3c')](handleError(_0x2f2eef,null));};exports[_0x8b35('0x49')]=function(_0x2ed2f6,_0x24462a,_0x1231f3){if(_0x2ed2f6[_0x8b35('0x42')]['id']){delete _0x2ed2f6[_0x8b35('0x42')]['id'];}return db[_0x8b35('0x27')]['findOne']({'where':{'id':_0x2ed2f6['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x24462a,null))[_0x8b35('0x20')](function(_0x40d1e9){if(_0x40d1e9){_0x2ed2f6['body'][_0x8b35('0x4a')]=_0x40d1e9['id'];_0x2ed2f6['body'][_0x8b35('0x4b')]=integrations[_0x8b35('0x4c')](_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x4d')],_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x28')]);_0x2ed2f6['body'][_0x8b35('0x4e')]=integrations['getDescriptions'](_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x4d')],_0x2ed2f6['body'][_0x8b35('0x28')]);return db[_0x8b35('0x46')][_0x8b35('0x41')](_0x2ed2f6['body'],{'include':[{'model':db[_0x8b35('0x4f')],'as':_0x8b35('0x4b')},{'model':db[_0x8b35('0x4f')],'as':'Descriptions'}]});}return null;})[_0x8b35('0x20')](respondWithResult(_0x24462a,null))['catch'](handleError(_0x24462a,null));};exports[_0x8b35('0x50')]=function(_0x315c2d,_0x49b7f1,_0x20851b){var _0x4d8266='';var _0x12eb54=['id','name',_0x8b35('0x51'),'created_by',_0x8b35('0x52'),'date_start',_0x8b35('0x53'),_0x8b35('0x54'),_0x8b35('0x55'),'parent_type','parent_name',_0x8b35('0x56')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x315c2d[_0x8b35('0x3d')]['id']},'attributes':['id','username',_0x8b35('0x57'),_0x8b35('0x58')]})[_0x8b35('0x20')](handleEntityNotFound(_0x49b7f1,null))[_0x8b35('0x20')](function(_0x4514a8){if(_0x4514a8){_0x4d8266=_0x4514a8[_0x8b35('0x58')];var _0x53ebba=_0x4d8266[_0x8b35('0x59')](-0x1);if(_0x53ebba==='/'){_0x4d8266=_0x4d8266[_0x8b35('0x5a')](0x0,_0x4d8266[_0x8b35('0x5b')](_0x53ebba));}return rp({'method':_0x8b35('0x5c'),'uri':util['format'](_0x8b35('0x5d'),_0x4d8266,_0x8b35('0x5e')),'json':!![],'form':{'method':_0x8b35('0x5f'),'input_type':_0x8b35('0x60'),'response_type':_0x8b35('0x60'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4514a8[_0x8b35('0x61')],'password':_0x4514a8[_0x8b35('0x57')],'encryption':_0x8b35('0x62')},'application':_0x8b35('0x63')})}});}})['then'](function(_0x5ed099){if(_0x5ed099&&_0x5ed099['name']!==_0x8b35('0x64')&&_0x5ed099['name']!==_0x8b35('0x65')){return rp({'method':_0x8b35('0x5c'),'uri':util[_0x8b35('0x66')](_0x8b35('0x5d'),_0x4d8266,_0x8b35('0x5e')),'json':!![],'form':{'method':_0x8b35('0x67'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8b35('0x68')]({'session':_0x5ed099['id'],'module_name':_0x8b35('0x69')})}})['then'](function(_0x541052){if(_0x541052){var _0x24871f=_[_0x8b35('0x6a')](_0x541052['module_fields']);_[_0x8b35('0x6b')](_0x24871f,function(_0x91e709){return _0x12eb54[_0x8b35('0x6c')](_0x91e709['name']);});return{'count':_0x24871f[_0x8b35('0x3f')],'rows':_[_0x8b35('0x26')](_0x24871f,function(_0x24a463){return{'id':_0x24a463[_0x8b35('0x23')],'name':_0x24a463[_0x8b35('0x6d')],'custom':_['endsWith'](_0x24a463['name'],'_c')?!![]:![],'options':_0x24a463['options']?_[_0x8b35('0x26')](_['values'](_0x24a463[_0x8b35('0x38')]),function(_0x389257){return{'name':_0x389257[_0x8b35('0x6e')],'value':_0x389257[_0x8b35('0x23')]};}):[]};})};}})[_0x8b35('0x20')](respondWithResult(_0x49b7f1,null))[_0x8b35('0x3c')](function(_0x116f85){var _0x5a6771=_0x315c2d['query'][_0x8b35('0x6f')]?0x1f4:_0x116f85[_0x8b35('0x70')]||0x1f4;logger[_0x8b35('0x22')](_0x8b35('0x71'),_0x8b35('0x50'),_0x5a6771,JSON[_0x8b35('0x68')](_0x116f85));delete _0x116f85[_0x8b35('0x23')];if(_0x5a6771===0x191){_0x5a6771=0x190;}_0x49b7f1[_0x8b35('0x17')](_0x5a6771)[_0x8b35('0x24')](_0x315c2d[_0x8b35('0x2b')]['test']?{'message':_0x8b35('0x72'),'statusCode':_0x116f85[_0x8b35('0x70')]}:_0x116f85);});}else{var _0x190b99=0x1f4;_0x49b7f1['status'](_0x190b99)['send']({'message':_0x8b35('0x72'),'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 4fc34f0..35ae080 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 _0xab75=['int_sugarcrm_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x5520a0,_0x143ac0){var _0x4ed976=function(_0x5ae266){while(--_0x5ae266){_0x5520a0['push'](_0x5520a0['shift']());}};_0x4ed976(++_0x143ac0);}(_0xab75,0x11f));var _0x5ab7=function(_0x309e80,_0x13a6cd){_0x309e80=_0x309e80-0x0;var _0x2325b1=_0xab75[_0x309e80];return _0x2325b1;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var logger=require(_0x5ab7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ab7('0x3'));var rp=require(_0x5ab7('0x4'));var fs=require('fs');var path=require(_0x5ab7('0x5'));var rimraf=require('rimraf');var config=require(_0x5ab7('0x6'));var attributes=require(_0x5ab7('0x7'));var integrations=require(_0x5ab7('0x8'));module[_0x5ab7('0x9')]=function(_0x406ca2,_0x32b338){return _0x406ca2[_0x5ab7('0xa')](_0x5ab7('0xb'),attributes,{'tableName':_0x5ab7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x204c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0x1ab855,_0x448b59){var _0x46c4ae=function(_0x1a401d){while(--_0x1a401d){_0x1ab855['push'](_0x1ab855['shift']());}};_0x46c4ae(++_0x448b59);}(_0x204c,0xdc));var _0xc204=function(_0x220f3b,_0x34332d){_0x220f3b=_0x220f3b-0x0;var _0x752fb7=_0x204c[_0x220f3b];return _0x752fb7;};'use strict';var _=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var logger=require(_0xc204('0x2'))(_0xc204('0x3'));var moment=require(_0xc204('0x4'));var BPromise=require(_0xc204('0x5'));var rp=require(_0xc204('0x6'));var fs=require('fs');var path=require(_0xc204('0x7'));var rimraf=require(_0xc204('0x8'));var config=require(_0xc204('0x9'));var attributes=require(_0xc204('0xa'));var integrations=require(_0xc204('0xb'));module['exports']=function(_0x33557b,_0x34768a){return _0x33557b[_0xc204('0xc')]('SugarcrmAccount',attributes,{'tableName':_0xc204('0xd'),'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 160e9c0..39d94c3 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 _0x81ae=['include','map','model','attributes','then','stringify','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit'];(function(_0x5e14af,_0x530c51){var _0x7f41af=function(_0x41e21){while(--_0x41e21){_0x5e14af['push'](_0x5e14af['shift']());}};_0x7f41af(++_0x530c51);}(_0x81ae,0xfd));var _0xe81a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x81ae[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe81a('0x0'));var util=require('util');var moment=require(_0xe81a('0x1'));var BPromise=require(_0xe81a('0x2'));var rs=require(_0xe81a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe81a('0x4'))(_0xe81a('0x5'));var config=require(_0xe81a('0x6'));var jayson=require(_0xe81a('0x7'));var client=jayson[_0xe81a('0x8')][_0xe81a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7421cf,_0x9f0b49,_0x126fc7){return new BPromise(function(_0x230649,_0x57be35){return client[_0xe81a('0xa')](_0x7421cf,_0x126fc7)['then'](function(_0x51743a){logger[_0xe81a('0xb')](_0xe81a('0xc'),_0x9f0b49,_0xe81a('0xd'));logger[_0xe81a('0xe')](_0xe81a('0xf'),_0x9f0b49,'request\x20sent',JSON['stringify'](_0x51743a));if(_0x51743a[_0xe81a('0x10')]){if(_0x51743a[_0xe81a('0x10')]['code']===0x1f4){logger[_0xe81a('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x9f0b49,_0x51743a[_0xe81a('0x10')]['message']);return _0x57be35(_0x51743a[_0xe81a('0x10')][_0xe81a('0x11')]);}logger[_0xe81a('0x10')](_0xe81a('0xc'),_0x9f0b49,_0x51743a[_0xe81a('0x10')][_0xe81a('0x11')]);return _0x230649(_0x51743a['error'][_0xe81a('0x11')]);}else{logger[_0xe81a('0xb')](_0xe81a('0xc'),_0x9f0b49,'request\x20sent');_0x230649(_0x51743a[_0xe81a('0x12')][_0xe81a('0x11')]);}})[_0xe81a('0x13')](function(_0x12665c){logger[_0xe81a('0x10')](_0xe81a('0xc'),_0x9f0b49,_0x12665c);_0x57be35(_0x12665c);});});}exports[_0xe81a('0x14')]=function(_0x250036){var _0x4167c2=this;return new Promise(function(_0x375a8c,_0x44bc35){return db[_0xe81a('0x15')][_0xe81a('0x16')]({'raw':_0x250036[_0xe81a('0x17')]?_0x250036['options'][_0xe81a('0x18')]===undefined?!![]:![]:!![],'where':_0x250036[_0xe81a('0x17')]?_0x250036[_0xe81a('0x17')][_0xe81a('0x19')]||null:null,'attributes':_0x250036[_0xe81a('0x17')]?_0x250036[_0xe81a('0x17')]['attributes']||null:null,'limit':_0x250036[_0xe81a('0x17')]?_0x250036[_0xe81a('0x17')][_0xe81a('0x1a')]||null:null,'include':_0x250036[_0xe81a('0x17')]?_0x250036[_0xe81a('0x17')][_0xe81a('0x1b')]?_[_0xe81a('0x1c')](_0x250036[_0xe81a('0x17')]['include'],function(_0x499e62){return{'model':db[_0x499e62[_0xe81a('0x1d')]],'as':_0x499e62['as'],'attributes':_0x499e62[_0xe81a('0x1e')],'include':_0x499e62[_0xe81a('0x1b')]?_[_0xe81a('0x1c')](_0x499e62['include'],function(_0x71d3e8){return{'model':db[_0x71d3e8[_0xe81a('0x1d')]],'as':_0x71d3e8['as'],'attributes':_0x71d3e8['attributes'],'include':_0x71d3e8[_0xe81a('0x1b')]?_[_0xe81a('0x1c')](_0x71d3e8[_0xe81a('0x1b')],function(_0x2b3fe0){return{'model':db[_0x2b3fe0[_0xe81a('0x1d')]],'as':_0x2b3fe0['as'],'attributes':_0x2b3fe0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe81a('0x1f')](function(_0x466798){logger['info'](_0xe81a('0x14'),_0x250036);logger[_0xe81a('0xe')]('GetSugarcrmAccount',_0x250036,JSON[_0xe81a('0x20')](_0x466798));_0x375a8c(_0x466798);})['catch'](function(_0x2a9bbb){logger[_0xe81a('0x10')](_0xe81a('0x14'),_0x2a9bbb['message'],_0x250036);_0x44bc35(_0x4167c2['error'](0x1f4,_0x2a9bbb[_0xe81a('0x11')]));});});};exports[_0xe81a('0x21')]=function(_0x454c00){var _0x2c6ef5=this;return new Promise(function(_0x572188,_0x148cc2){return db['SugarcrmAccount'][_0xe81a('0x22')]({'raw':_0x454c00[_0xe81a('0x17')]?_0x454c00[_0xe81a('0x17')][_0xe81a('0x18')]===undefined?!![]:![]:!![],'where':_0x454c00[_0xe81a('0x17')]?_0x454c00[_0xe81a('0x17')][_0xe81a('0x19')]||null:null,'attributes':_0x454c00[_0xe81a('0x17')]?_0x454c00[_0xe81a('0x17')][_0xe81a('0x1e')]||null:null,'include':_0x454c00['options']?_0x454c00[_0xe81a('0x17')][_0xe81a('0x1b')]?_['map'](_0x454c00['options'][_0xe81a('0x1b')],function(_0x1d7570){return{'model':db[_0x1d7570[_0xe81a('0x1d')]],'as':_0x1d7570['as'],'attributes':_0x1d7570['attributes'],'include':_0x1d7570[_0xe81a('0x1b')]?_[_0xe81a('0x1c')](_0x1d7570[_0xe81a('0x1b')],function(_0x2c8657){return{'model':db[_0x2c8657[_0xe81a('0x1d')]],'as':_0x2c8657['as'],'attributes':_0x2c8657['attributes'],'include':_0x2c8657[_0xe81a('0x1b')]?_[_0xe81a('0x1c')](_0x2c8657[_0xe81a('0x1b')],function(_0x801d7e){return{'model':db[_0x801d7e['model']],'as':_0x801d7e['as'],'attributes':_0x801d7e[_0xe81a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe81a('0x1f')](function(_0x5ef93a){logger[_0xe81a('0xb')](_0xe81a('0x21'),_0x454c00);logger['debug'](_0xe81a('0x21'),_0x454c00,JSON['stringify'](_0x5ef93a));_0x572188(_0x5ef93a);})['catch'](function(_0xe26ec2){logger['error'](_0xe81a('0x21'),_0xe26ec2[_0xe81a('0x11')],_0x454c00);_0x148cc2(_0x2c6ef5[_0xe81a('0x10')](0x1f4,_0xe26ec2[_0xe81a('0x11')]));});});}; \ No newline at end of file +var _0x6540=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','include','model','map','stringify','catch','ShowSugarcrmAccount','find','where','lodash','moment','bluebird'];(function(_0x5958ae,_0x3f78c9){var _0x3aab8f=function(_0x142bc9){while(--_0x142bc9){_0x5958ae['push'](_0x5958ae['shift']());}};_0x3aab8f(++_0x3f78c9);}(_0x6540,0xa7));var _0x0654=function(_0x53abd0,_0x1f7900){_0x53abd0=_0x53abd0-0x0;var _0x5a0dcd=_0x6540[_0x53abd0];return _0x5a0dcd;};'use strict';var _=require(_0x0654('0x0'));var util=require('util');var moment=require(_0x0654('0x1'));var BPromise=require(_0x0654('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0654('0x3'));var db=require(_0x0654('0x4'))['db'];var utils=require(_0x0654('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0654('0x6'));var jayson=require(_0x0654('0x7'));var client=jayson[_0x0654('0x8')][_0x0654('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4068ac,_0x522723,_0x3b072c){return new BPromise(function(_0xf0c3f6,_0x4a65f3){return client[_0x0654('0xa')](_0x4068ac,_0x3b072c)[_0x0654('0xb')](function(_0x50ccc9){logger[_0x0654('0xc')](_0x0654('0xd'),_0x522723,_0x0654('0xe'));logger[_0x0654('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x522723,'request\x20sent',JSON['stringify'](_0x50ccc9));if(_0x50ccc9[_0x0654('0x10')]){if(_0x50ccc9['error'][_0x0654('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x522723,_0x50ccc9[_0x0654('0x10')][_0x0654('0x12')]);return _0x4a65f3(_0x50ccc9[_0x0654('0x10')]['message']);}logger[_0x0654('0x10')](_0x0654('0xd'),_0x522723,_0x50ccc9[_0x0654('0x10')][_0x0654('0x12')]);return _0xf0c3f6(_0x50ccc9[_0x0654('0x10')]['message']);}else{logger[_0x0654('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x522723,_0x0654('0xe'));_0xf0c3f6(_0x50ccc9[_0x0654('0x13')][_0x0654('0x12')]);}})['catch'](function(_0x4165a4){logger['error'](_0x0654('0xd'),_0x522723,_0x4165a4);_0x4a65f3(_0x4165a4);});});}exports[_0x0654('0x14')]=function(_0x4a26bd){var _0x329d6b=this;return new Promise(function(_0x51f60f,_0x5041d6){return db[_0x0654('0x15')][_0x0654('0x16')]({'raw':_0x4a26bd['options']?_0x4a26bd[_0x0654('0x17')][_0x0654('0x18')]===undefined?!![]:![]:!![],'where':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')]['where']||null:null,'attributes':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')][_0x0654('0x19')]||null:null,'limit':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')]['limit']||null:null,'include':_0x4a26bd['options']?_0x4a26bd[_0x0654('0x17')][_0x0654('0x1a')]?_['map'](_0x4a26bd[_0x0654('0x17')][_0x0654('0x1a')],function(_0x7c0ab0){return{'model':db[_0x7c0ab0[_0x0654('0x1b')]],'as':_0x7c0ab0['as'],'attributes':_0x7c0ab0[_0x0654('0x19')],'include':_0x7c0ab0['include']?_[_0x0654('0x1c')](_0x7c0ab0[_0x0654('0x1a')],function(_0x40057e){return{'model':db[_0x40057e[_0x0654('0x1b')]],'as':_0x40057e['as'],'attributes':_0x40057e[_0x0654('0x19')],'include':_0x40057e[_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x40057e['include'],function(_0x3e8bf3){return{'model':db[_0x3e8bf3[_0x0654('0x1b')]],'as':_0x3e8bf3['as'],'attributes':_0x3e8bf3[_0x0654('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0654('0xb')](function(_0x41bde4){logger[_0x0654('0xc')](_0x0654('0x14'),_0x4a26bd);logger[_0x0654('0xf')](_0x0654('0x14'),_0x4a26bd,JSON[_0x0654('0x1d')](_0x41bde4));_0x51f60f(_0x41bde4);})[_0x0654('0x1e')](function(_0x5f0884){logger['error'](_0x0654('0x14'),_0x5f0884['message'],_0x4a26bd);_0x5041d6(_0x329d6b[_0x0654('0x10')](0x1f4,_0x5f0884[_0x0654('0x12')]));});});};exports[_0x0654('0x1f')]=function(_0x200661){var _0x54bf6a=this;return new Promise(function(_0x12da7e,_0x2723d9){return db[_0x0654('0x15')][_0x0654('0x20')]({'raw':_0x200661[_0x0654('0x17')]?_0x200661['options'][_0x0654('0x18')]===undefined?!![]:![]:!![],'where':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x21')]||null:null,'attributes':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x19')]||null:null,'include':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x200661[_0x0654('0x17')][_0x0654('0x1a')],function(_0x490520){return{'model':db[_0x490520[_0x0654('0x1b')]],'as':_0x490520['as'],'attributes':_0x490520['attributes'],'include':_0x490520[_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x490520[_0x0654('0x1a')],function(_0x54086e){return{'model':db[_0x54086e[_0x0654('0x1b')]],'as':_0x54086e['as'],'attributes':_0x54086e['attributes'],'include':_0x54086e['include']?_['map'](_0x54086e[_0x0654('0x1a')],function(_0x5c0ce5){return{'model':db[_0x5c0ce5[_0x0654('0x1b')]],'as':_0x5c0ce5['as'],'attributes':_0x5c0ce5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0654('0xb')](function(_0x1fcb53){logger[_0x0654('0xc')]('ShowSugarcrmAccount',_0x200661);logger[_0x0654('0xf')](_0x0654('0x1f'),_0x200661,JSON[_0x0654('0x1d')](_0x1fcb53));_0x12da7e(_0x1fcb53);})[_0x0654('0x1e')](function(_0x35b52a){logger[_0x0654('0x10')](_0x0654('0x1f'),_0x35b52a[_0x0654('0x12')],_0x200661);_0x2723d9(_0x54bf6a['error'](0x1f4,_0x35b52a[_0x0654('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9864217..114e66a 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 _0x8936=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x8936,0x191));var _0x6893=function(_0x2b6482,_0x95e8a8){_0x2b6482=_0x2b6482-0x0;var _0x53e68f=_0x8936[_0x2b6482];return _0x53e68f;};'use strict';var multer=require(_0x6893('0x0'));var util=require(_0x6893('0x1'));var path=require(_0x6893('0x2'));var timeout=require('connect-timeout');var express=require(_0x6893('0x3'));var router=express[_0x6893('0x4')]();var fs_extra=require(_0x6893('0x5'));var auth=require(_0x6893('0x6'));var interaction=require(_0x6893('0x7'));var config=require('../../config/environment');var controller=require(_0x6893('0x8'));router[_0x6893('0x9')]('/',auth[_0x6893('0xa')](),controller[_0x6893('0xb')]);router['get'](_0x6893('0xc'),auth[_0x6893('0xa')](),controller[_0x6893('0xd')]);router['get']('/:id/fields',auth[_0x6893('0xa')](),controller[_0x6893('0xe')]);router[_0x6893('0x9')](_0x6893('0xf'),auth[_0x6893('0xa')](),controller['getSubjects']);router['get'](_0x6893('0x10'),auth[_0x6893('0xa')](),controller['getDescriptions']);router[_0x6893('0x11')]('/',auth['isAuthenticated'](),controller[_0x6893('0x12')]);router[_0x6893('0x13')](_0x6893('0xc'),auth[_0x6893('0xa')](),controller[_0x6893('0x14')]);router[_0x6893('0x15')](_0x6893('0xc'),auth[_0x6893('0xa')](),controller[_0x6893('0x16')]);module[_0x6893('0x17')]=router; \ No newline at end of file +var _0xbd72=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put'];(function(_0x352085,_0x1d0f79){var _0x7d4859=function(_0x17dda9){while(--_0x17dda9){_0x352085['push'](_0x352085['shift']());}};_0x7d4859(++_0x1d0f79);}(_0xbd72,0xa9));var _0x2bd7=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xbd72[_0x4fd109];return _0x30f0a6;};'use strict';var multer=require(_0x2bd7('0x0'));var util=require(_0x2bd7('0x1'));var path=require(_0x2bd7('0x2'));var timeout=require(_0x2bd7('0x3'));var express=require(_0x2bd7('0x4'));var router=express[_0x2bd7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2bd7('0x6'));var interaction=require(_0x2bd7('0x7'));var config=require('../../config/environment');var controller=require(_0x2bd7('0x8'));router['get']('/',auth[_0x2bd7('0x9')](),controller[_0x2bd7('0xa')]);router[_0x2bd7('0xb')](_0x2bd7('0xc'),auth[_0x2bd7('0x9')](),controller['show']);router[_0x2bd7('0xb')](_0x2bd7('0xd'),auth[_0x2bd7('0x9')](),controller[_0x2bd7('0xe')]);router[_0x2bd7('0xb')](_0x2bd7('0xf'),auth['isAuthenticated'](),controller[_0x2bd7('0x10')]);router[_0x2bd7('0xb')](_0x2bd7('0x11'),auth[_0x2bd7('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x2bd7('0x12')]);router[_0x2bd7('0x13')](_0x2bd7('0xc'),auth[_0x2bd7('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2bd7('0x9')](),controller['destroy']);module[_0x2bd7('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index b21ae15..d92976a 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 _0x6e40=['sequelize','exports','STRING'];(function(_0x322257,_0xd267a7){var _0x40aa7e=function(_0x482f39){while(--_0x482f39){_0x322257['push'](_0x322257['shift']());}};_0x40aa7e(++_0xd267a7);}(_0x6e40,0x147));var _0x06e4=function(_0x515b67,_0x36d509){_0x515b67=_0x515b67-0x0;var _0x4ca7e9=_0x6e40[_0x515b67];return _0x4ca7e9;};'use strict';var Sequelize=require(_0x06e4('0x0'));module[_0x06e4('0x1')]={'name':{'type':Sequelize[_0x06e4('0x2')]},'description':{'type':Sequelize[_0x06e4('0x2')]}}; \ No newline at end of file +var _0xf895=['exports','STRING'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xf895,0x1da));var _0x5f89=function(_0x49415b,_0x490392){_0x49415b=_0x49415b-0x0;var _0x3211b1=_0xf895[_0x49415b];return _0x3211b1;};'use strict';var Sequelize=require('sequelize');module[_0x5f89('0x0')]={'name':{'type':Sequelize[_0x5f89('0x1')]},'description':{'type':Sequelize[_0x5f89('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 431d2d0..4ba1ba2 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 _0x0f4e=['map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','getFields','keys','SugarcrmField','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','SugarcrmConfiguration','fieldName','key','model'];(function(_0x3b58d9,_0x27e4d0){var _0x142b81=function(_0x2753d6){while(--_0x2753d6){_0x3b58d9['push'](_0x3b58d9['shift']());}};_0x142b81(++_0x27e4d0);}(_0x0f4e,0x1d0));var _0xe0f4=function(_0x3497b5,_0x5775b8){_0x3497b5=_0x3497b5-0x0;var _0x9c5460=_0x0f4e[_0x3497b5];return _0x9c5460;};'use strict';var emlformat=require(_0xe0f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f4('0x1'));var jsonpatch=require(_0xe0f4('0x2'));var rp=require('request-promise');var moment=require(_0xe0f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe0f4('0x4'));var util=require(_0xe0f4('0x5'));var path=require(_0xe0f4('0x6'));var sox=require(_0xe0f4('0x7'));var csv=require(_0xe0f4('0x8'));var ejs=require(_0xe0f4('0x9'));var fs=require('fs');var fs_extra=require(_0xe0f4('0xa'));var _=require(_0xe0f4('0xb'));var squel=require(_0xe0f4('0xc'));var crypto=require(_0xe0f4('0xd'));var jsforce=require(_0xe0f4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe0f4('0x8'));var querystring=require(_0xe0f4('0xf'));var Papa=require(_0xe0f4('0x10'));var Redis=require(_0xe0f4('0x11'));var authService=require(_0xe0f4('0x12'));var qs=require(_0xe0f4('0x13'));var as=require(_0xe0f4('0x14'));var hardwareService=require(_0xe0f4('0x15'));var logger=require(_0xe0f4('0x16'))(_0xe0f4('0x17'));var utils=require(_0xe0f4('0x18'));var config=require(_0xe0f4('0x19'));var licenseUtil=require(_0xe0f4('0x1a'));var db=require(_0xe0f4('0x1b'))['db'];function respondWithStatusCode(_0x2ef71c,_0x117e6b){_0x117e6b=_0x117e6b||0xcc;return function(_0x1e7b88){if(_0x1e7b88){return _0x2ef71c[_0xe0f4('0x1c')](_0x117e6b);}return _0x2ef71c[_0xe0f4('0x1d')](_0x117e6b)[_0xe0f4('0x1e')]();};}function respondWithResult(_0x4fc38e,_0x12fd01){_0x12fd01=_0x12fd01||0xc8;return function(_0x37dd06){if(_0x37dd06){return _0x4fc38e['status'](_0x12fd01)[_0xe0f4('0x1f')](_0x37dd06);}};}function respondWithFilteredResult(_0x468e41,_0xa5dfc5){return function(_0x136e8f){if(_0x136e8f){var _0x3540e4=typeof _0xa5dfc5[_0xe0f4('0x20')]==='undefined'&&typeof _0xa5dfc5[_0xe0f4('0x21')]===_0xe0f4('0x22');var _0xa9bfa7=_0x136e8f[_0xe0f4('0x23')];var _0x21ecca=_0x3540e4?0x0:_0xa5dfc5[_0xe0f4('0x20')];var _0x471135=_0x3540e4?_0x136e8f[_0xe0f4('0x23')]:_0xa5dfc5[_0xe0f4('0x20')]+_0xa5dfc5[_0xe0f4('0x21')];var _0x2c547b;if(_0x471135>=_0xa9bfa7){_0x471135=_0xa9bfa7;_0x2c547b=0xc8;}else{_0x2c547b=0xce;}_0x468e41['status'](_0x2c547b);return _0x468e41[_0xe0f4('0x24')](_0xe0f4('0x25'),_0x21ecca+'-'+_0x471135+'/'+_0xa9bfa7)[_0xe0f4('0x1f')](_0x136e8f);}return null;};}function patchUpdates(_0x34f617){return function(_0x5dff68){try{jsonpatch[_0xe0f4('0x26')](_0x5dff68,_0x34f617,!![]);}catch(_0x570a36){return BPromise[_0xe0f4('0x27')](_0x570a36);}return _0x5dff68[_0xe0f4('0x28')]();};}function saveUpdates(_0x4b7c72,_0x365e48){return function(_0x7c9a02){if(_0x7c9a02){return _0x7c9a02[_0xe0f4('0x29')](_0x4b7c72)['then'](function(_0x28b244){return _0x28b244;});}return null;};}function removeEntity(_0x21c39c,_0x3f9bb9){return function(_0x5c1949){if(_0x5c1949){return _0x5c1949[_0xe0f4('0x2a')]()[_0xe0f4('0x2b')](function(){_0x21c39c[_0xe0f4('0x1d')](0xcc)[_0xe0f4('0x1e')]();});}};}function handleEntityNotFound(_0x40ee9f,_0x1a8dae){return function(_0x185756){if(!_0x185756){_0x40ee9f[_0xe0f4('0x1c')](0x194);}return _0x185756;};}function handleError(_0x4e0c3c,_0x3832a2){_0x3832a2=_0x3832a2||0x1f4;return function(_0x141107){logger['error'](_0x141107[_0xe0f4('0x2c')]);if(_0x141107[_0xe0f4('0x2d')]){delete _0x141107[_0xe0f4('0x2d')];}_0x4e0c3c['status'](_0x3832a2)[_0xe0f4('0x2e')](_0x141107);};}exports[_0xe0f4('0x2f')]=function(_0x133a86,_0x11af67){var _0x2a21dd={},_0x687070={},_0x4bf85b={'count':0x0,'rows':[]};var _0x4ef2cf=_['map'](db[_0xe0f4('0x30')]['rawAttributes'],function(_0x46b6ad){return{'name':_0x46b6ad[_0xe0f4('0x31')],'type':_0x46b6ad['type'][_0xe0f4('0x32')]};});_0x687070[_0xe0f4('0x33')]=_[_0xe0f4('0x34')](_0x4ef2cf,_0xe0f4('0x2d'));_0x687070['query']=_['keys'](_0x133a86['query']);_0x687070[_0xe0f4('0x35')]=_[_0xe0f4('0x36')](_0x687070[_0xe0f4('0x33')],_0x687070[_0xe0f4('0x37')]);_0x2a21dd['attributes']=_[_0xe0f4('0x36')](_0x687070[_0xe0f4('0x33')],qs['fields'](_0x133a86[_0xe0f4('0x37')][_0xe0f4('0x38')]));_0x2a21dd[_0xe0f4('0x39')]=_0x2a21dd['attributes'][_0xe0f4('0x3a')]?_0x2a21dd[_0xe0f4('0x39')]:_0x687070[_0xe0f4('0x33')];if(!_0x133a86[_0xe0f4('0x37')][_0xe0f4('0x3b')](_0xe0f4('0x3c'))){_0x2a21dd['limit']=qs[_0xe0f4('0x21')](_0x133a86[_0xe0f4('0x37')][_0xe0f4('0x21')]);_0x2a21dd[_0xe0f4('0x20')]=qs['offset'](_0x133a86[_0xe0f4('0x37')][_0xe0f4('0x20')]);}_0x2a21dd[_0xe0f4('0x3d')]=qs['sort'](_0x133a86['query'][_0xe0f4('0x3e')]);_0x2a21dd[_0xe0f4('0x3f')]=qs[_0xe0f4('0x35')](_[_0xe0f4('0x40')](_0x133a86[_0xe0f4('0x37')],_0x687070[_0xe0f4('0x35')]),_0x4ef2cf);if(_0x133a86[_0xe0f4('0x37')][_0xe0f4('0x41')]){_0x2a21dd[_0xe0f4('0x3f')]=_[_0xe0f4('0x42')](_0x2a21dd[_0xe0f4('0x3f')],{'$or':_[_0xe0f4('0x34')](_0x4ef2cf,function(_0x5d8f35){if(_0x5d8f35[_0xe0f4('0x43')]!=='VIRTUAL'){var _0x322e59={};_0x322e59[_0x5d8f35[_0xe0f4('0x2d')]]={'$like':'%'+_0x133a86['query'][_0xe0f4('0x41')]+'%'};return _0x322e59;}})});}_0x2a21dd=_[_0xe0f4('0x42')]({},_0x2a21dd,_0x133a86[_0xe0f4('0x44')]);var _0x52b152={'where':_0x2a21dd[_0xe0f4('0x3f')]};return db[_0xe0f4('0x30')][_0xe0f4('0x23')](_0x52b152)['then'](function(_0x13a553){_0x4bf85b[_0xe0f4('0x23')]=_0x13a553;if(_0x133a86[_0xe0f4('0x37')]['includeAll']){_0x2a21dd['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xe0f4('0x45')](_0x2a21dd);})[_0xe0f4('0x2b')](function(_0x1ff8c7){_0x4bf85b[_0xe0f4('0x46')]=_0x1ff8c7;return _0x4bf85b;})['then'](respondWithFilteredResult(_0x11af67,_0x2a21dd))[_0xe0f4('0x47')](handleError(_0x11af67,null));};exports[_0xe0f4('0x48')]=function(_0x50ffa4,_0x9541fb){var _0x4345b2={'raw':![],'where':{'id':_0x50ffa4['params']['id']}},_0x68f42a={};_0x68f42a[_0xe0f4('0x33')]=_['keys'](db[_0xe0f4('0x30')][_0xe0f4('0x49')]);_0x68f42a[_0xe0f4('0x37')]=_['keys'](_0x50ffa4['query']);_0x68f42a[_0xe0f4('0x35')]=_[_0xe0f4('0x36')](_0x68f42a['model'],_0x68f42a[_0xe0f4('0x37')]);_0x4345b2[_0xe0f4('0x39')]=_['intersection'](_0x68f42a[_0xe0f4('0x33')],qs[_0xe0f4('0x38')](_0x50ffa4[_0xe0f4('0x37')][_0xe0f4('0x38')]));_0x4345b2[_0xe0f4('0x39')]=_0x4345b2[_0xe0f4('0x39')][_0xe0f4('0x3a')]?_0x4345b2['attributes']:_0x68f42a[_0xe0f4('0x33')];if(_0x50ffa4[_0xe0f4('0x37')][_0xe0f4('0x4a')]){_0x4345b2[_0xe0f4('0x4b')]=[{'all':!![]}];}_0x4345b2=_[_0xe0f4('0x42')]({},_0x4345b2,_0x50ffa4[_0xe0f4('0x44')]);return db[_0xe0f4('0x30')][_0xe0f4('0x4c')](_0x4345b2)[_0xe0f4('0x2b')](handleEntityNotFound(_0x9541fb,null))[_0xe0f4('0x2b')](respondWithResult(_0x9541fb,null))[_0xe0f4('0x47')](handleError(_0x9541fb,null));};exports[_0xe0f4('0x4d')]=function(_0xf12d4d,_0x2911a4){return db[_0xe0f4('0x30')]['create'](_0xf12d4d['body'],{})[_0xe0f4('0x2b')](respondWithResult(_0x2911a4,0xc9))['catch'](handleError(_0x2911a4,null));};exports['update']=function(_0x177e72,_0x104494){if(_0x177e72[_0xe0f4('0x4e')]['id']){delete _0x177e72['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x177e72[_0xe0f4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x104494,null))[_0xe0f4('0x2b')](saveUpdates(_0x177e72['body'],null))[_0xe0f4('0x2b')](respondWithResult(_0x104494,null))[_0xe0f4('0x47')](handleError(_0x104494,null));};exports[_0xe0f4('0x2a')]=function(_0x2dcda7,_0x26c604){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2dcda7[_0xe0f4('0x4f')]['id']}})[_0xe0f4('0x2b')](handleEntityNotFound(_0x26c604,null))[_0xe0f4('0x2b')](removeEntity(_0x26c604,null))[_0xe0f4('0x47')](handleError(_0x26c604,null));};exports[_0xe0f4('0x50')]=function(_0x364aea,_0x608f6e,_0x92c1ea){var _0x38f220={};var _0x16c3e5={};var _0x4a3af5;var _0x5d5814;return db[_0xe0f4('0x30')]['findOne']({'where':{'id':_0x364aea[_0xe0f4('0x4f')]['id']}})[_0xe0f4('0x2b')](handleEntityNotFound(_0x608f6e,null))['then'](function(_0x1959dc){if(_0x1959dc){_0x4a3af5=_0x1959dc;_0x16c3e5[_0xe0f4('0x33')]=_[_0xe0f4('0x51')](db[_0xe0f4('0x52')][_0xe0f4('0x49')]);_0x16c3e5['query']=_[_0xe0f4('0x51')](_0x364aea['query']);_0x16c3e5['filters']=_[_0xe0f4('0x36')](_0x16c3e5[_0xe0f4('0x33')],_0x16c3e5['query']);_0x38f220['attributes']=_['intersection'](_0x16c3e5[_0xe0f4('0x33')],qs['fields'](_0x364aea[_0xe0f4('0x37')][_0xe0f4('0x38')]));_0x38f220[_0xe0f4('0x39')]=_0x38f220['attributes'][_0xe0f4('0x3a')]?_0x38f220['attributes']:_0x16c3e5[_0xe0f4('0x33')];_0x38f220[_0xe0f4('0x3d')]=qs[_0xe0f4('0x3e')](_0x364aea[_0xe0f4('0x37')][_0xe0f4('0x3e')]);_0x38f220['where']=qs[_0xe0f4('0x35')](_[_0xe0f4('0x40')](_0x364aea[_0xe0f4('0x37')],_0x16c3e5[_0xe0f4('0x35')]));if(_0x364aea[_0xe0f4('0x37')][_0xe0f4('0x41')]){_0x38f220[_0xe0f4('0x3f')]=_[_0xe0f4('0x42')](_0x38f220['where'],{'$or':_[_0xe0f4('0x34')](_0x38f220[_0xe0f4('0x39')],function(_0x214523){var _0x3b41fb={};_0x3b41fb[_0x214523]={'$like':'%'+_0x364aea['query'][_0xe0f4('0x41')]+'%'};return _0x3b41fb;})});}_0x38f220=_['merge']({},_0x38f220,_0x364aea[_0xe0f4('0x44')]);return _0x4a3af5[_0xe0f4('0x50')](_0x38f220);}})[_0xe0f4('0x2b')](function(_0x2da6bf){if(_0x2da6bf){_0x5d5814=_0x2da6bf[_0xe0f4('0x3a')];if(!_0x364aea['query'][_0xe0f4('0x3b')](_0xe0f4('0x3c'))){_0x38f220[_0xe0f4('0x21')]=qs[_0xe0f4('0x21')](_0x364aea[_0xe0f4('0x37')]['limit']);_0x38f220[_0xe0f4('0x20')]=qs[_0xe0f4('0x20')](_0x364aea[_0xe0f4('0x37')]['offset']);}return _0x4a3af5[_0xe0f4('0x50')](_0x38f220);}})['then'](function(_0x523f79){if(_0x523f79){return _0x523f79?{'count':_0x5d5814,'rows':_0x523f79}:null;}})[_0xe0f4('0x2b')](respondWithResult(_0x608f6e,null))[_0xe0f4('0x47')](handleError(_0x608f6e,null));};exports[_0xe0f4('0x53')]=function(_0x14383d,_0x5d263c,_0x10824d){var _0x13d44a={};var _0x5f2491={};var _0x272b63;var _0x662130;return db[_0xe0f4('0x30')]['findOne']({'where':{'id':_0x14383d[_0xe0f4('0x4f')]['id']}})[_0xe0f4('0x2b')](handleEntityNotFound(_0x5d263c,null))[_0xe0f4('0x2b')](function(_0x187580){if(_0x187580){_0x272b63=_0x187580;_0x5f2491[_0xe0f4('0x33')]=_[_0xe0f4('0x51')](db['SugarcrmField'][_0xe0f4('0x49')]);_0x5f2491[_0xe0f4('0x37')]=_[_0xe0f4('0x51')](_0x14383d[_0xe0f4('0x37')]);_0x5f2491[_0xe0f4('0x35')]=_[_0xe0f4('0x36')](_0x5f2491['model'],_0x5f2491[_0xe0f4('0x37')]);_0x13d44a['attributes']=_[_0xe0f4('0x36')](_0x5f2491[_0xe0f4('0x33')],qs['fields'](_0x14383d[_0xe0f4('0x37')][_0xe0f4('0x38')]));_0x13d44a['attributes']=_0x13d44a[_0xe0f4('0x39')]['length']?_0x13d44a['attributes']:_0x5f2491['model'];_0x13d44a['order']=qs[_0xe0f4('0x3e')](_0x14383d[_0xe0f4('0x37')][_0xe0f4('0x3e')]);_0x13d44a[_0xe0f4('0x3f')]=qs[_0xe0f4('0x35')](_[_0xe0f4('0x40')](_0x14383d[_0xe0f4('0x37')],_0x5f2491['filters']));if(_0x14383d['query']['filter']){_0x13d44a[_0xe0f4('0x3f')]=_[_0xe0f4('0x42')](_0x13d44a[_0xe0f4('0x3f')],{'$or':_[_0xe0f4('0x34')](_0x13d44a[_0xe0f4('0x39')],function(_0x3bb91e){var _0x1b2990={};_0x1b2990[_0x3bb91e]={'$like':'%'+_0x14383d[_0xe0f4('0x37')][_0xe0f4('0x41')]+'%'};return _0x1b2990;})});}_0x13d44a=_[_0xe0f4('0x42')]({},_0x13d44a,_0x14383d[_0xe0f4('0x44')]);return _0x272b63['getSubjects'](_0x13d44a);}})[_0xe0f4('0x2b')](function(_0x252f93){if(_0x252f93){_0x662130=_0x252f93[_0xe0f4('0x3a')];if(!_0x14383d['query']['hasOwnProperty'](_0xe0f4('0x3c'))){_0x13d44a[_0xe0f4('0x21')]=qs[_0xe0f4('0x21')](_0x14383d[_0xe0f4('0x37')]['limit']);_0x13d44a[_0xe0f4('0x20')]=qs[_0xe0f4('0x20')](_0x14383d[_0xe0f4('0x37')]['offset']);}return _0x272b63[_0xe0f4('0x53')](_0x13d44a);}})['then'](function(_0x514bb8){if(_0x514bb8){return _0x514bb8?{'count':_0x662130,'rows':_0x514bb8}:null;}})[_0xe0f4('0x2b')](respondWithResult(_0x5d263c,null))[_0xe0f4('0x47')](handleError(_0x5d263c,null));};exports[_0xe0f4('0x54')]=function(_0x2e6f25,_0x4fb466,_0x170cff){var _0x31429d={};var _0x3e4a01={};var _0x42a281;var _0x43ebc7;return db['SugarcrmConfiguration'][_0xe0f4('0x55')]({'where':{'id':_0x2e6f25[_0xe0f4('0x4f')]['id']}})[_0xe0f4('0x2b')](handleEntityNotFound(_0x4fb466,null))['then'](function(_0x38bcda){if(_0x38bcda){_0x42a281=_0x38bcda;_0x3e4a01[_0xe0f4('0x33')]=_['keys'](db[_0xe0f4('0x52')][_0xe0f4('0x49')]);_0x3e4a01[_0xe0f4('0x37')]=_[_0xe0f4('0x51')](_0x2e6f25['query']);_0x3e4a01[_0xe0f4('0x35')]=_['intersection'](_0x3e4a01[_0xe0f4('0x33')],_0x3e4a01[_0xe0f4('0x37')]);_0x31429d[_0xe0f4('0x39')]=_[_0xe0f4('0x36')](_0x3e4a01['model'],qs[_0xe0f4('0x38')](_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x38')]));_0x31429d[_0xe0f4('0x39')]=_0x31429d[_0xe0f4('0x39')]['length']?_0x31429d[_0xe0f4('0x39')]:_0x3e4a01[_0xe0f4('0x33')];_0x31429d[_0xe0f4('0x3d')]=qs[_0xe0f4('0x3e')](_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x3e')]);_0x31429d[_0xe0f4('0x3f')]=qs[_0xe0f4('0x35')](_[_0xe0f4('0x40')](_0x2e6f25[_0xe0f4('0x37')],_0x3e4a01['filters']));if(_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x41')]){_0x31429d[_0xe0f4('0x3f')]=_[_0xe0f4('0x42')](_0x31429d['where'],{'$or':_[_0xe0f4('0x34')](_0x31429d[_0xe0f4('0x39')],function(_0x156506){var _0x540684={};_0x540684[_0x156506]={'$like':'%'+_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x41')]+'%'};return _0x540684;})});}_0x31429d=_[_0xe0f4('0x42')]({},_0x31429d,_0x2e6f25[_0xe0f4('0x44')]);return _0x42a281['getDescriptions'](_0x31429d);}})[_0xe0f4('0x2b')](function(_0x4ecc6c){if(_0x4ecc6c){_0x43ebc7=_0x4ecc6c['length'];if(!_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x3b')]('nolimit')){_0x31429d[_0xe0f4('0x21')]=qs[_0xe0f4('0x21')](_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x21')]);_0x31429d[_0xe0f4('0x20')]=qs[_0xe0f4('0x20')](_0x2e6f25[_0xe0f4('0x37')][_0xe0f4('0x20')]);}return _0x42a281['getDescriptions'](_0x31429d);}})[_0xe0f4('0x2b')](function(_0xd2132f){if(_0xd2132f){return _0xd2132f?{'count':_0x43ebc7,'rows':_0xd2132f}:null;}})[_0xe0f4('0x2b')](respondWithResult(_0x4fb466,null))['catch'](handleError(_0x4fb466,null));}; \ No newline at end of file +var _0x6dcc=['ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','show','params','include','find','catch','body','getFields','findOne','getSubjects','getDescriptions','SugarcrmField','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6dcc,0x1dd));var _0xc6dc=function(_0x57c972,_0x510be5){_0x57c972=_0x57c972-0x0;var _0x2c5861=_0x6dcc[_0x57c972];return _0x2c5861;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6dc('0x1'));var rp=require(_0xc6dc('0x2'));var moment=require(_0xc6dc('0x3'));var BPromise=require(_0xc6dc('0x4'));var Mustache=require(_0xc6dc('0x5'));var util=require(_0xc6dc('0x6'));var path=require(_0xc6dc('0x7'));var sox=require(_0xc6dc('0x8'));var csv=require('to-csv');var ejs=require(_0xc6dc('0x9'));var fs=require('fs');var fs_extra=require(_0xc6dc('0xa'));var _=require('lodash');var squel=require(_0xc6dc('0xb'));var crypto=require(_0xc6dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc6dc('0xd'));var toCsv=require(_0xc6dc('0xe'));var querystring=require(_0xc6dc('0xf'));var Papa=require(_0xc6dc('0x10'));var Redis=require(_0xc6dc('0x11'));var authService=require(_0xc6dc('0x12'));var qs=require(_0xc6dc('0x13'));var as=require(_0xc6dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6dc('0x15'))(_0xc6dc('0x16'));var utils=require('../../config/utils');var config=require(_0xc6dc('0x17'));var licenseUtil=require(_0xc6dc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x135048,_0x52f07c){_0x52f07c=_0x52f07c||0xcc;return function(_0x27f859){if(_0x27f859){return _0x135048[_0xc6dc('0x19')](_0x52f07c);}return _0x135048[_0xc6dc('0x1a')](_0x52f07c)[_0xc6dc('0x1b')]();};}function respondWithResult(_0x2c769c,_0x228d8a){_0x228d8a=_0x228d8a||0xc8;return function(_0x13620d){if(_0x13620d){return _0x2c769c['status'](_0x228d8a)[_0xc6dc('0x1c')](_0x13620d);}};}function respondWithFilteredResult(_0x2383fc,_0x372bef){return function(_0x1c1ff6){if(_0x1c1ff6){var _0x1567b4=typeof _0x372bef[_0xc6dc('0x1d')]==='undefined'&&typeof _0x372bef['limit']==='undefined';var _0x1216d5=_0x1c1ff6[_0xc6dc('0x1e')];var _0x2e6232=_0x1567b4?0x0:_0x372bef[_0xc6dc('0x1d')];var _0x485fcd=_0x1567b4?_0x1c1ff6[_0xc6dc('0x1e')]:_0x372bef[_0xc6dc('0x1d')]+_0x372bef['limit'];var _0x592081;if(_0x485fcd>=_0x1216d5){_0x485fcd=_0x1216d5;_0x592081=0xc8;}else{_0x592081=0xce;}_0x2383fc[_0xc6dc('0x1a')](_0x592081);return _0x2383fc[_0xc6dc('0x1f')](_0xc6dc('0x20'),_0x2e6232+'-'+_0x485fcd+'/'+_0x1216d5)[_0xc6dc('0x1c')](_0x1c1ff6);}return null;};}function patchUpdates(_0x5cd769){return function(_0x48bb81){try{jsonpatch['apply'](_0x48bb81,_0x5cd769,!![]);}catch(_0x3fc6df){return BPromise['reject'](_0x3fc6df);}return _0x48bb81[_0xc6dc('0x21')]();};}function saveUpdates(_0x2dd6ea,_0x2a3463){return function(_0x23dbb3){if(_0x23dbb3){return _0x23dbb3[_0xc6dc('0x22')](_0x2dd6ea)[_0xc6dc('0x23')](function(_0x468f5c){return _0x468f5c;});}return null;};}function removeEntity(_0x52b529,_0x7c8546){return function(_0x5cb612){if(_0x5cb612){return _0x5cb612[_0xc6dc('0x24')]()['then'](function(){_0x52b529[_0xc6dc('0x1a')](0xcc)[_0xc6dc('0x1b')]();});}};}function handleEntityNotFound(_0x3464aa,_0x5d6e42){return function(_0x5b7e5b){if(!_0x5b7e5b){_0x3464aa['sendStatus'](0x194);}return _0x5b7e5b;};}function handleError(_0x13adad,_0x2b9e45){_0x2b9e45=_0x2b9e45||0x1f4;return function(_0x43251b){logger[_0xc6dc('0x25')](_0x43251b[_0xc6dc('0x26')]);if(_0x43251b[_0xc6dc('0x27')]){delete _0x43251b[_0xc6dc('0x27')];}_0x13adad[_0xc6dc('0x1a')](_0x2b9e45)[_0xc6dc('0x28')](_0x43251b);};}exports[_0xc6dc('0x29')]=function(_0x21e403,_0x17f334){var _0x11aeb8={},_0x4d75b3={},_0x23de14={'count':0x0,'rows':[]};var _0x59a42b=_[_0xc6dc('0x2a')](db['SugarcrmConfiguration'][_0xc6dc('0x2b')],function(_0x4029ed){return{'name':_0x4029ed[_0xc6dc('0x2c')],'type':_0x4029ed[_0xc6dc('0x2d')][_0xc6dc('0x2e')]};});_0x4d75b3[_0xc6dc('0x2f')]=_[_0xc6dc('0x2a')](_0x59a42b,_0xc6dc('0x27'));_0x4d75b3[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x21e403[_0xc6dc('0x30')]);_0x4d75b3[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x4d75b3['model'],_0x4d75b3[_0xc6dc('0x30')]);_0x11aeb8['attributes']=_['intersection'](_0x4d75b3[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x21e403[_0xc6dc('0x30')]['fields']));_0x11aeb8[_0xc6dc('0x35')]=_0x11aeb8[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x11aeb8[_0xc6dc('0x35')]:_0x4d75b3[_0xc6dc('0x2f')];if(!_0x21e403['query'][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x11aeb8[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x21e403['query']['limit']);_0x11aeb8[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}_0x11aeb8[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x11aeb8['where']=qs[_0xc6dc('0x32')](_[_0xc6dc('0x3c')](_0x21e403['query'],_0x4d75b3['filters']),_0x59a42b);if(_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x3d')]){_0x11aeb8[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x11aeb8['where'],{'$or':_[_0xc6dc('0x2a')](_0x59a42b,function(_0x5d33bb){if(_0x5d33bb[_0xc6dc('0x2d')]!==_0xc6dc('0x40')){var _0x52c062={};_0x52c062[_0x5d33bb[_0xc6dc('0x27')]]={'$like':'%'+_0x21e403['query'][_0xc6dc('0x3d')]+'%'};return _0x52c062;}})});}_0x11aeb8=_[_0xc6dc('0x3f')]({},_0x11aeb8,_0x21e403[_0xc6dc('0x41')]);var _0x2c7d04={'where':_0x11aeb8[_0xc6dc('0x3e')]};return db[_0xc6dc('0x42')][_0xc6dc('0x1e')](_0x2c7d04)[_0xc6dc('0x23')](function(_0x320cdd){_0x23de14[_0xc6dc('0x1e')]=_0x320cdd;if(_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x43')]){_0x11aeb8['include']=[{'all':!![]}];}return db[_0xc6dc('0x42')][_0xc6dc('0x44')](_0x11aeb8);})['then'](function(_0x1eff9d){_0x23de14[_0xc6dc('0x45')]=_0x1eff9d;return _0x23de14;})['then'](respondWithFilteredResult(_0x17f334,_0x11aeb8))['catch'](handleError(_0x17f334,null));};exports[_0xc6dc('0x46')]=function(_0x31ecd3,_0x530226){var _0x4ca247={'raw':![],'where':{'id':_0x31ecd3[_0xc6dc('0x47')]['id']}},_0x478d5c={};_0x478d5c['model']=_[_0xc6dc('0x31')](db[_0xc6dc('0x42')][_0xc6dc('0x2b')]);_0x478d5c[_0xc6dc('0x30')]=_['keys'](_0x31ecd3['query']);_0x478d5c['filters']=_[_0xc6dc('0x33')](_0x478d5c[_0xc6dc('0x2f')],_0x478d5c['query']);_0x4ca247['attributes']=_['intersection'](_0x478d5c[_0xc6dc('0x2f')],qs['fields'](_0x31ecd3[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x4ca247[_0xc6dc('0x35')]=_0x4ca247[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x4ca247[_0xc6dc('0x35')]:_0x478d5c[_0xc6dc('0x2f')];if(_0x31ecd3[_0xc6dc('0x30')][_0xc6dc('0x43')]){_0x4ca247[_0xc6dc('0x48')]=[{'all':!![]}];}_0x4ca247=_[_0xc6dc('0x3f')]({},_0x4ca247,_0x31ecd3[_0xc6dc('0x41')]);return db[_0xc6dc('0x42')][_0xc6dc('0x49')](_0x4ca247)[_0xc6dc('0x23')](handleEntityNotFound(_0x530226,null))[_0xc6dc('0x23')](respondWithResult(_0x530226,null))[_0xc6dc('0x4a')](handleError(_0x530226,null));};exports['create']=function(_0x4a6041,_0x59c954){return db[_0xc6dc('0x42')]['create'](_0x4a6041[_0xc6dc('0x4b')],{})[_0xc6dc('0x23')](respondWithResult(_0x59c954,0xc9))[_0xc6dc('0x4a')](handleError(_0x59c954,null));};exports['update']=function(_0x9d4b0b,_0x67672e){if(_0x9d4b0b[_0xc6dc('0x4b')]['id']){delete _0x9d4b0b['body']['id'];}return db[_0xc6dc('0x42')][_0xc6dc('0x49')]({'where':{'id':_0x9d4b0b[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x67672e,null))[_0xc6dc('0x23')](saveUpdates(_0x9d4b0b[_0xc6dc('0x4b')],null))['then'](respondWithResult(_0x67672e,null))[_0xc6dc('0x4a')](handleError(_0x67672e,null));};exports[_0xc6dc('0x24')]=function(_0x1f902b,_0x34c545){return db['SugarcrmConfiguration'][_0xc6dc('0x49')]({'where':{'id':_0x1f902b[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x34c545,null))['then'](removeEntity(_0x34c545,null))[_0xc6dc('0x4a')](handleError(_0x34c545,null));};exports[_0xc6dc('0x4c')]=function(_0x55bfcc,_0x28d2ba,_0x1351fd){var _0x472634={};var _0x5114ec={};var _0x5386e5;var _0x527132;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x55bfcc[_0xc6dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x28d2ba,null))[_0xc6dc('0x23')](function(_0x447b97){if(_0x447b97){_0x5386e5=_0x447b97;_0x5114ec[_0xc6dc('0x2f')]=_[_0xc6dc('0x31')](db['SugarcrmField']['rawAttributes']);_0x5114ec[_0xc6dc('0x30')]=_['keys'](_0x55bfcc[_0xc6dc('0x30')]);_0x5114ec[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x5114ec[_0xc6dc('0x2f')],_0x5114ec[_0xc6dc('0x30')]);_0x472634[_0xc6dc('0x35')]=_[_0xc6dc('0x33')](_0x5114ec[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x55bfcc['query'][_0xc6dc('0x34')]));_0x472634['attributes']=_0x472634[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x472634[_0xc6dc('0x35')]:_0x5114ec['model'];_0x472634['order']=qs[_0xc6dc('0x3b')](_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x472634[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_[_0xc6dc('0x3c')](_0x55bfcc[_0xc6dc('0x30')],_0x5114ec[_0xc6dc('0x32')]));if(_0x55bfcc['query']['filter']){_0x472634[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x472634['where'],{'$or':_[_0xc6dc('0x2a')](_0x472634['attributes'],function(_0x53f10c){var _0x56100b={};_0x56100b[_0x53f10c]={'$like':'%'+_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x3d')]+'%'};return _0x56100b;})});}_0x472634=_['merge']({},_0x472634,_0x55bfcc[_0xc6dc('0x41')]);return _0x5386e5['getFields'](_0x472634);}})[_0xc6dc('0x23')](function(_0x249288){if(_0x249288){_0x527132=_0x249288[_0xc6dc('0x36')];if(!_0x55bfcc[_0xc6dc('0x30')]['hasOwnProperty'](_0xc6dc('0x38'))){_0x472634[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x55bfcc[_0xc6dc('0x30')]['limit']);_0x472634['offset']=qs[_0xc6dc('0x1d')](_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x5386e5[_0xc6dc('0x4c')](_0x472634);}})[_0xc6dc('0x23')](function(_0x1b24d4){if(_0x1b24d4){return _0x1b24d4?{'count':_0x527132,'rows':_0x1b24d4}:null;}})[_0xc6dc('0x23')](respondWithResult(_0x28d2ba,null))['catch'](handleError(_0x28d2ba,null));};exports[_0xc6dc('0x4e')]=function(_0x36e04a,_0x45596e,_0xd4ff7){var _0x52e139={};var _0x587833={};var _0x11563c;var _0x41f419;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x36e04a[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x45596e,null))[_0xc6dc('0x23')](function(_0x51a9cb){if(_0x51a9cb){_0x11563c=_0x51a9cb;_0x587833['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x587833[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x36e04a[_0xc6dc('0x30')]);_0x587833[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x587833['model'],_0x587833['query']);_0x52e139[_0xc6dc('0x35')]=_[_0xc6dc('0x33')](_0x587833['model'],qs['fields'](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x52e139[_0xc6dc('0x35')]=_0x52e139['attributes']['length']?_0x52e139[_0xc6dc('0x35')]:_0x587833['model'];_0x52e139['order']=qs['sort'](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x52e139[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_['pick'](_0x36e04a[_0xc6dc('0x30')],_0x587833[_0xc6dc('0x32')]));if(_0x36e04a['query'][_0xc6dc('0x3d')]){_0x52e139[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x52e139[_0xc6dc('0x3e')],{'$or':_['map'](_0x52e139[_0xc6dc('0x35')],function(_0x43052d){var _0x6be5c7={};_0x6be5c7[_0x43052d]={'$like':'%'+_0x36e04a[_0xc6dc('0x30')]['filter']+'%'};return _0x6be5c7;})});}_0x52e139=_[_0xc6dc('0x3f')]({},_0x52e139,_0x36e04a[_0xc6dc('0x41')]);return _0x11563c[_0xc6dc('0x4e')](_0x52e139);}})['then'](function(_0x41fbe5){if(_0x41fbe5){_0x41f419=_0x41fbe5[_0xc6dc('0x36')];if(!_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x52e139[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x36e04a[_0xc6dc('0x30')]['limit']);_0x52e139[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x11563c[_0xc6dc('0x4e')](_0x52e139);}})['then'](function(_0x59019d){if(_0x59019d){return _0x59019d?{'count':_0x41f419,'rows':_0x59019d}:null;}})[_0xc6dc('0x23')](respondWithResult(_0x45596e,null))[_0xc6dc('0x4a')](handleError(_0x45596e,null));};exports[_0xc6dc('0x4f')]=function(_0x451662,_0xbe53c4,_0x9c99ee){var _0x2585c4={};var _0x5b36a5={};var _0x3039fa;var _0xc5dd02;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x451662[_0xc6dc('0x47')]['id']}})['then'](handleEntityNotFound(_0xbe53c4,null))['then'](function(_0xa57e3){if(_0xa57e3){_0x3039fa=_0xa57e3;_0x5b36a5[_0xc6dc('0x2f')]=_[_0xc6dc('0x31')](db[_0xc6dc('0x50')][_0xc6dc('0x2b')]);_0x5b36a5[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x451662[_0xc6dc('0x30')]);_0x5b36a5[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x5b36a5[_0xc6dc('0x2f')],_0x5b36a5['query']);_0x2585c4[_0xc6dc('0x35')]=_['intersection'](_0x5b36a5[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x2585c4['attributes']=_0x2585c4[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x2585c4['attributes']:_0x5b36a5[_0xc6dc('0x2f')];_0x2585c4[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x2585c4[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_['pick'](_0x451662['query'],_0x5b36a5[_0xc6dc('0x32')]));if(_0x451662['query'][_0xc6dc('0x3d')]){_0x2585c4['where']=_[_0xc6dc('0x3f')](_0x2585c4['where'],{'$or':_[_0xc6dc('0x2a')](_0x2585c4[_0xc6dc('0x35')],function(_0x4fae13){var _0x5e7c01={};_0x5e7c01[_0x4fae13]={'$like':'%'+_0x451662['query']['filter']+'%'};return _0x5e7c01;})});}_0x2585c4=_['merge']({},_0x2585c4,_0x451662[_0xc6dc('0x41')]);return _0x3039fa[_0xc6dc('0x4f')](_0x2585c4);}})[_0xc6dc('0x23')](function(_0x1b4c29){if(_0x1b4c29){_0xc5dd02=_0x1b4c29[_0xc6dc('0x36')];if(!_0x451662[_0xc6dc('0x30')][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x2585c4[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x451662['query'][_0xc6dc('0x39')]);_0x2585c4[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x3039fa[_0xc6dc('0x4f')](_0x2585c4);}})[_0xc6dc('0x23')](function(_0x49ef29){if(_0x49ef29){return _0x49ef29?{'count':_0xc5dd02,'rows':_0x49ef29}:null;}})[_0xc6dc('0x23')](respondWithResult(_0xbe53c4,null))[_0xc6dc('0x4a')](handleError(_0xbe53c4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 10d055b..b2775e2 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 _0xc3d8=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger'];(function(_0x466ec5,_0x198d73){var _0xddc4bd=function(_0xf6fa32){while(--_0xf6fa32){_0x466ec5['push'](_0x466ec5['shift']());}};_0xddc4bd(++_0x198d73);}(_0xc3d8,0x76));var _0x8c3d=function(_0x58cf05,_0x4608b7){_0x58cf05=_0x58cf05-0x0;var _0x4abad5=_0xc3d8[_0x58cf05];return _0x4abad5;};'use strict';var _=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var logger=require(_0x8c3d('0x2'))('api');var moment=require(_0x8c3d('0x3'));var BPromise=require(_0x8c3d('0x4'));var rp=require(_0x8c3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c3d('0x6'));var config=require(_0x8c3d('0x7'));var attributes=require(_0x8c3d('0x8'));module[_0x8c3d('0x9')]=function(_0x2b102d,_0x239606){return _0x2b102d['define'](_0x8c3d('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca8a,0xca));var _0xaca8=function(_0x599659,_0x18f67d){_0x599659=_0x599659-0x0;var _0x23a48c=_0xca8a[_0x599659];return _0x23a48c;};'use strict';var _=require(_0xaca8('0x0'));var util=require(_0xaca8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaca8('0x2'));var BPromise=require(_0xaca8('0x3'));var rp=require(_0xaca8('0x4'));var fs=require('fs');var path=require(_0xaca8('0x5'));var rimraf=require(_0xaca8('0x6'));var config=require(_0xaca8('0x7'));var attributes=require(_0xaca8('0x8'));module['exports']=function(_0x2c9fae,_0xc67782){return _0x2c9fae[_0xaca8('0x9')](_0xaca8('0xa'),attributes,{'tableName':_0xaca8('0xb'),'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 28560f7..2b64bfe 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 _0x0006=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird'];(function(_0x46eada,_0x299a09){var _0x5f2e42=function(_0xa6d94e){while(--_0xa6d94e){_0x46eada['push'](_0x46eada['shift']());}};_0x5f2e42(++_0x299a09);}(_0x0006,0x131));var _0x6000=function(_0x81256c,_0x270bc5){_0x81256c=_0x81256c-0x0;var _0x2905f4=_0x0006[_0x81256c];return _0x2905f4;};'use strict';var _=require('lodash');var util=require(_0x6000('0x0'));var moment=require(_0x6000('0x1'));var BPromise=require(_0x6000('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6000('0x3'));var db=require(_0x6000('0x4'))['db'];var utils=require(_0x6000('0x5'));var logger=require(_0x6000('0x6'))(_0x6000('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6000('0x8')][_0x6000('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe061f4,_0x2c4f76,_0x5bb62c){return new BPromise(function(_0x5cf4f6,_0x4f64c8){return client[_0x6000('0xa')](_0xe061f4,_0x5bb62c)[_0x6000('0xb')](function(_0x534a09){logger[_0x6000('0xc')](_0x6000('0xd'),_0x2c4f76,_0x6000('0xe'));logger[_0x6000('0xf')](_0x6000('0x10'),_0x2c4f76,'request\x20sent',JSON['stringify'](_0x534a09));if(_0x534a09[_0x6000('0x11')]){if(_0x534a09[_0x6000('0x11')][_0x6000('0x12')]===0x1f4){logger[_0x6000('0x11')](_0x6000('0xd'),_0x2c4f76,_0x534a09[_0x6000('0x11')]['message']);return _0x4f64c8(_0x534a09[_0x6000('0x11')]['message']);}logger[_0x6000('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2c4f76,_0x534a09['error'][_0x6000('0x13')]);return _0x5cf4f6(_0x534a09[_0x6000('0x11')][_0x6000('0x13')]);}else{logger[_0x6000('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2c4f76,_0x6000('0xe'));_0x5cf4f6(_0x534a09[_0x6000('0x14')][_0x6000('0x13')]);}})[_0x6000('0x15')](function(_0x353bfe){logger[_0x6000('0x11')](_0x6000('0xd'),_0x2c4f76,_0x353bfe);_0x4f64c8(_0x353bfe);});});} \ No newline at end of file +var _0x45ae=['error','code','message','catch','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5dcfd2,_0x413a91){var _0x39de1f=function(_0x1e6825){while(--_0x1e6825){_0x5dcfd2['push'](_0x5dcfd2['shift']());}};_0x39de1f(++_0x413a91);}(_0x45ae,0x130));var _0xe45a=function(_0x3cf563,_0x1d7718){_0x3cf563=_0x3cf563-0x0;var _0x225097=_0x45ae[_0x3cf563];return _0x225097;};'use strict';var _=require(_0xe45a('0x0'));var util=require(_0xe45a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe45a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe45a('0x3'))(_0xe45a('0x4'));var config=require(_0xe45a('0x5'));var jayson=require(_0xe45a('0x6'));var client=jayson[_0xe45a('0x7')][_0xe45a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd09acc,_0x402db8,_0x42012e){return new BPromise(function(_0x4f302f,_0x36039e){return client[_0xe45a('0x9')](_0xd09acc,_0x42012e)[_0xe45a('0xa')](function(_0x1d79ef){logger['info'](_0xe45a('0xb'),_0x402db8,'request\x20sent');logger[_0xe45a('0xc')](_0xe45a('0xd'),_0x402db8,_0xe45a('0xe'),JSON[_0xe45a('0xf')](_0x1d79ef));if(_0x1d79ef[_0xe45a('0x10')]){if(_0x1d79ef[_0xe45a('0x10')][_0xe45a('0x11')]===0x1f4){logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x1d79ef['error'][_0xe45a('0x12')]);return _0x36039e(_0x1d79ef[_0xe45a('0x10')]['message']);}logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x1d79ef['error'][_0xe45a('0x12')]);return _0x4f302f(_0x1d79ef[_0xe45a('0x10')][_0xe45a('0x12')]);}else{logger['info'](_0xe45a('0xb'),_0x402db8,_0xe45a('0xe'));_0x4f302f(_0x1d79ef['result']['message']);}})[_0xe45a('0x13')](function(_0x30903a){logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x30903a);_0x36039e(_0x30903a);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0c5640a..23e3a2a 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 _0xffda=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4fcdcf,_0x8e28c7){var _0x2f82ca=function(_0x5c0bd0){while(--_0x5c0bd0){_0x4fcdcf['push'](_0x4fcdcf['shift']());}};_0x2f82ca(++_0x8e28c7);}(_0xffda,0x12e));var _0xaffd=function(_0x2cce64,_0x102e84){_0x2cce64=_0x2cce64-0x0;var _0x547158=_0xffda[_0x2cce64];return _0x547158;};'use strict';var multer=require(_0xaffd('0x0'));var util=require(_0xaffd('0x1'));var path=require(_0xaffd('0x2'));var timeout=require(_0xaffd('0x3'));var express=require('express');var router=express[_0xaffd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaffd('0x5'));var interaction=require(_0xaffd('0x6'));var config=require(_0xaffd('0x7'));var controller=require('./intSugarcrmField.controller');router[_0xaffd('0x8')]('/',auth[_0xaffd('0x9')](),controller[_0xaffd('0xa')]);router[_0xaffd('0x8')](_0xaffd('0xb'),auth[_0xaffd('0x9')](),controller[_0xaffd('0xc')]);router[_0xaffd('0xd')]('/',auth[_0xaffd('0x9')](),controller['create']);router[_0xaffd('0xe')](_0xaffd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xaffd('0xf')](_0xaffd('0xb'),auth['isAuthenticated'](),controller[_0xaffd('0x10')]);module[_0xaffd('0x11')]=router; \ No newline at end of file +var _0x36dc=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x246058,_0x3345d2){var _0x1f329a=function(_0x21d64d){while(--_0x21d64d){_0x246058['push'](_0x246058['shift']());}};_0x1f329a(++_0x3345d2);}(_0x36dc,0x1b4));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xc36d('0x0'));var path=require(_0xc36d('0x1'));var timeout=require(_0xc36d('0x2'));var express=require(_0xc36d('0x3'));var router=express['Router']();var fs_extra=require(_0xc36d('0x4'));var auth=require(_0xc36d('0x5'));var interaction=require(_0xc36d('0x6'));var config=require(_0xc36d('0x7'));var controller=require(_0xc36d('0x8'));router[_0xc36d('0x9')]('/',auth[_0xc36d('0xa')](),controller[_0xc36d('0xb')]);router[_0xc36d('0x9')](_0xc36d('0xc'),auth[_0xc36d('0xa')](),controller[_0xc36d('0xd')]);router[_0xc36d('0xe')]('/',auth[_0xc36d('0xa')](),controller[_0xc36d('0xf')]);router['put'](_0xc36d('0xc'),auth[_0xc36d('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc36d('0xa')](),controller['destroy']);module[_0xc36d('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 a68fdf6..54adebe 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 _0x6994=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x4fc658,_0x293456){var _0x10c168=function(_0x20093f){while(--_0x20093f){_0x4fc658['push'](_0x4fc658['shift']());}};_0x10c168(++_0x293456);}(_0x6994,0x1c0));var _0x4699=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x6994[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require(_0x4699('0x0'));module[_0x4699('0x1')]={'type':{'type':Sequelize[_0x4699('0x2')](_0x4699('0x3'),_0x4699('0x4'),_0x4699('0x5'),_0x4699('0x6'),_0x4699('0x7')),'defaultValue':_0x4699('0x3')},'content':{'type':Sequelize[_0x4699('0x8')]},'key':{'type':Sequelize[_0x4699('0x8')]},'keyType':{'type':Sequelize[_0x4699('0x2')](_0x4699('0x3'),_0x4699('0x4'),_0x4699('0x5'))},'keyContent':{'type':Sequelize[_0x4699('0x8')]},'idField':{'type':Sequelize[_0x4699('0x8')]},'nameField':{'type':Sequelize[_0x4699('0x8')]},'customField':{'type':Sequelize[_0x4699('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1750=['ENUM','string','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x1750,0x136));var _0x0175=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1750[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0175('0x0'));module[_0x0175('0x1')]={'type':{'type':Sequelize[_0x0175('0x2')](_0x0175('0x3'),'variable','customVariable','keyValue',_0x0175('0x4')),'defaultValue':_0x0175('0x3')},'content':{'type':Sequelize[_0x0175('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0175('0x2')](_0x0175('0x3'),'variable',_0x0175('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0175('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0175('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0175('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 7876afd..3ed67a0 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 _0xec9a=['catch','show','params','keys','length','merge','find','create','update','body','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/environment','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','status','sendStatus','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows'];(function(_0x36cd8a,_0x46c74c){var _0x15b5ee=function(_0x20ed14){while(--_0x20ed14){_0x36cd8a['push'](_0x36cd8a['shift']());}};_0x15b5ee(++_0x46c74c);}(_0xec9a,0x1f4));var _0xaec9=function(_0x17de77,_0x520689){_0x17de77=_0x17de77-0x0;var _0x52e76b=_0xec9a[_0x17de77];return _0x52e76b;};'use strict';var emlformat=require(_0xaec9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaec9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaec9('0x2'));var moment=require(_0xaec9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaec9('0x4'));var util=require(_0xaec9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xaec9('0x6'));var ejs=require(_0xaec9('0x7'));var fs=require('fs');var fs_extra=require(_0xaec9('0x8'));var _=require(_0xaec9('0x9'));var squel=require(_0xaec9('0xa'));var crypto=require('crypto');var jsforce=require(_0xaec9('0xb'));var deskjs=require(_0xaec9('0xc'));var toCsv=require(_0xaec9('0x6'));var querystring=require(_0xaec9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaec9('0xe'));var logger=require(_0xaec9('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xaec9('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21e249,_0x19cdb0){_0x19cdb0=_0x19cdb0||0xcc;return function(_0xe8792f){if(_0xe8792f){return _0x21e249['sendStatus'](_0x19cdb0);}return _0x21e249['status'](_0x19cdb0)[_0xaec9('0x11')]();};}function respondWithResult(_0x2f877a,_0x5c146d){_0x5c146d=_0x5c146d||0xc8;return function(_0x2127b6){if(_0x2127b6){return _0x2f877a['status'](_0x5c146d)['json'](_0x2127b6);}};}function respondWithFilteredResult(_0x4e0afa,_0x579084){return function(_0x37a9b9){if(_0x37a9b9){var _0x4af713=typeof _0x579084[_0xaec9('0x12')]===_0xaec9('0x13')&&typeof _0x579084[_0xaec9('0x14')]==='undefined';var _0x4830e8=_0x37a9b9['count'];var _0x3602f5=_0x4af713?0x0:_0x579084['offset'];var _0x160b60=_0x4af713?_0x37a9b9[_0xaec9('0x15')]:_0x579084['offset']+_0x579084[_0xaec9('0x14')];var _0x38fc40;if(_0x160b60>=_0x4830e8){_0x160b60=_0x4830e8;_0x38fc40=0xc8;}else{_0x38fc40=0xce;}_0x4e0afa['status'](_0x38fc40);return _0x4e0afa[_0xaec9('0x16')](_0xaec9('0x17'),_0x3602f5+'-'+_0x160b60+'/'+_0x4830e8)[_0xaec9('0x18')](_0x37a9b9);}return null;};}function patchUpdates(_0x1d461a){return function(_0x5be42c){try{jsonpatch[_0xaec9('0x19')](_0x5be42c,_0x1d461a,!![]);}catch(_0x22f6e3){return BPromise['reject'](_0x22f6e3);}return _0x5be42c[_0xaec9('0x1a')]();};}function saveUpdates(_0x3dc425,_0x5ace00){return function(_0xf18a2d){if(_0xf18a2d){return _0xf18a2d['update'](_0x3dc425)[_0xaec9('0x1b')](function(_0x36ded1){return _0x36ded1;});}return null;};}function removeEntity(_0x4dc066,_0x5bef27){return function(_0x43dd36){if(_0x43dd36){return _0x43dd36[_0xaec9('0x1c')]()[_0xaec9('0x1b')](function(){_0x4dc066[_0xaec9('0x1d')](0xcc)[_0xaec9('0x11')]();});}};}function handleEntityNotFound(_0x10d42e,_0x579dbd){return function(_0x4408b3){if(!_0x4408b3){_0x10d42e[_0xaec9('0x1e')](0x194);}return _0x4408b3;};}function handleError(_0x3ee2fc,_0x1cfa32){_0x1cfa32=_0x1cfa32||0x1f4;return function(_0x3c2a51){logger[_0xaec9('0x1f')](_0x3c2a51[_0xaec9('0x20')]);if(_0x3c2a51['name']){delete _0x3c2a51[_0xaec9('0x21')];}_0x3ee2fc[_0xaec9('0x1d')](_0x1cfa32)[_0xaec9('0x22')](_0x3c2a51);};}exports[_0xaec9('0x23')]=function(_0x2de896,_0x2bc6f2){var _0x51bb7b={},_0x50125f={},_0x150390={'count':0x0,'rows':[]};var _0x4b5a0b=_['map'](db[_0xaec9('0x24')][_0xaec9('0x25')],function(_0x305e58){return{'name':_0x305e58[_0xaec9('0x26')],'type':_0x305e58[_0xaec9('0x27')][_0xaec9('0x28')]};});_0x50125f[_0xaec9('0x29')]=_[_0xaec9('0x2a')](_0x4b5a0b,_0xaec9('0x21'));_0x50125f[_0xaec9('0x2b')]=_['keys'](_0x2de896[_0xaec9('0x2b')]);_0x50125f['filters']=_[_0xaec9('0x2c')](_0x50125f[_0xaec9('0x29')],_0x50125f[_0xaec9('0x2b')]);_0x51bb7b[_0xaec9('0x2d')]=_['intersection'](_0x50125f[_0xaec9('0x29')],qs[_0xaec9('0x2e')](_0x2de896[_0xaec9('0x2b')][_0xaec9('0x2e')]));_0x51bb7b[_0xaec9('0x2d')]=_0x51bb7b[_0xaec9('0x2d')]['length']?_0x51bb7b[_0xaec9('0x2d')]:_0x50125f[_0xaec9('0x29')];if(!_0x2de896[_0xaec9('0x2b')][_0xaec9('0x2f')](_0xaec9('0x30'))){_0x51bb7b[_0xaec9('0x14')]=qs[_0xaec9('0x14')](_0x2de896[_0xaec9('0x2b')][_0xaec9('0x14')]);_0x51bb7b['offset']=qs[_0xaec9('0x12')](_0x2de896[_0xaec9('0x2b')][_0xaec9('0x12')]);}_0x51bb7b[_0xaec9('0x31')]=qs[_0xaec9('0x32')](_0x2de896['query']['sort']);_0x51bb7b[_0xaec9('0x33')]=qs[_0xaec9('0x34')](_[_0xaec9('0x35')](_0x2de896[_0xaec9('0x2b')],_0x50125f[_0xaec9('0x34')]),_0x4b5a0b);if(_0x2de896[_0xaec9('0x2b')]['filter']){_0x51bb7b['where']=_['merge'](_0x51bb7b[_0xaec9('0x33')],{'$or':_[_0xaec9('0x2a')](_0x4b5a0b,function(_0x1db732){if(_0x1db732[_0xaec9('0x27')]!=='VIRTUAL'){var _0x524ea6={};_0x524ea6[_0x1db732['name']]={'$like':'%'+_0x2de896['query'][_0xaec9('0x36')]+'%'};return _0x524ea6;}})});}_0x51bb7b=_['merge']({},_0x51bb7b,_0x2de896[_0xaec9('0x37')]);var _0x44845a={'where':_0x51bb7b[_0xaec9('0x33')]};return db[_0xaec9('0x24')]['count'](_0x44845a)[_0xaec9('0x1b')](function(_0x9d12d2){_0x150390[_0xaec9('0x15')]=_0x9d12d2;if(_0x2de896[_0xaec9('0x2b')][_0xaec9('0x38')]){_0x51bb7b[_0xaec9('0x39')]=[{'all':!![]}];}return db['SugarcrmField'][_0xaec9('0x3a')](_0x51bb7b);})[_0xaec9('0x1b')](function(_0x1f8f53){_0x150390[_0xaec9('0x3b')]=_0x1f8f53;return _0x150390;})[_0xaec9('0x1b')](respondWithFilteredResult(_0x2bc6f2,_0x51bb7b))[_0xaec9('0x3c')](handleError(_0x2bc6f2,null));};exports[_0xaec9('0x3d')]=function(_0x222ea1,_0x3f012f){var _0x23caad={'raw':!![],'where':{'id':_0x222ea1[_0xaec9('0x3e')]['id']}},_0x4cc5d4={};_0x4cc5d4['model']=_[_0xaec9('0x3f')](db['SugarcrmField'][_0xaec9('0x25')]);_0x4cc5d4['query']=_['keys'](_0x222ea1[_0xaec9('0x2b')]);_0x4cc5d4[_0xaec9('0x34')]=_[_0xaec9('0x2c')](_0x4cc5d4[_0xaec9('0x29')],_0x4cc5d4[_0xaec9('0x2b')]);_0x23caad[_0xaec9('0x2d')]=_[_0xaec9('0x2c')](_0x4cc5d4[_0xaec9('0x29')],qs[_0xaec9('0x2e')](_0x222ea1[_0xaec9('0x2b')][_0xaec9('0x2e')]));_0x23caad[_0xaec9('0x2d')]=_0x23caad[_0xaec9('0x2d')][_0xaec9('0x40')]?_0x23caad[_0xaec9('0x2d')]:_0x4cc5d4['model'];if(_0x222ea1['query'][_0xaec9('0x38')]){_0x23caad[_0xaec9('0x39')]=[{'all':!![]}];}_0x23caad=_[_0xaec9('0x41')]({},_0x23caad,_0x222ea1[_0xaec9('0x37')]);return db[_0xaec9('0x24')][_0xaec9('0x42')](_0x23caad)[_0xaec9('0x1b')](handleEntityNotFound(_0x3f012f,null))[_0xaec9('0x1b')](respondWithResult(_0x3f012f,null))[_0xaec9('0x3c')](handleError(_0x3f012f,null));};exports[_0xaec9('0x43')]=function(_0x3ecbf0,_0x1ba05d){return db[_0xaec9('0x24')]['create'](_0x3ecbf0['body'],{})[_0xaec9('0x1b')](respondWithResult(_0x1ba05d,0xc9))[_0xaec9('0x3c')](handleError(_0x1ba05d,null));};exports[_0xaec9('0x44')]=function(_0x3d5030,_0x28cff5){if(_0x3d5030[_0xaec9('0x45')]['id']){delete _0x3d5030[_0xaec9('0x45')]['id'];}return db[_0xaec9('0x24')][_0xaec9('0x42')]({'where':{'id':_0x3d5030['params']['id']}})[_0xaec9('0x1b')](handleEntityNotFound(_0x28cff5,null))[_0xaec9('0x1b')](saveUpdates(_0x3d5030[_0xaec9('0x45')],null))['then'](respondWithResult(_0x28cff5,null))[_0xaec9('0x3c')](handleError(_0x28cff5,null));};exports[_0xaec9('0x1c')]=function(_0x3af99c,_0x223f01){return db['SugarcrmField'][_0xaec9('0x42')]({'where':{'id':_0x3af99c[_0xaec9('0x3e')]['id']}})[_0xaec9('0x1b')](handleEntityNotFound(_0x223f01,null))[_0xaec9('0x1b')](removeEntity(_0x223f01,null))[_0xaec9('0x3c')](handleError(_0x223f01,null));}; \ No newline at end of file +var _0xeb04=['body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','SugarcrmField','catch','show','params','length','merge','find','create'];(function(_0x41adfd,_0x5aeed4){var _0x485071=function(_0x571c6c){while(--_0x571c6c){_0x41adfd['push'](_0x41adfd['shift']());}};_0x485071(++_0x5aeed4);}(_0xeb04,0x165));var _0x4eb0=function(_0x178757,_0xfc6070){_0x178757=_0x178757-0x0;var _0x3b9945=_0xeb04[_0x178757];return _0x3b9945;};'use strict';var emlformat=require(_0x4eb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4eb0('0x1'));var jsonpatch=require(_0x4eb0('0x2'));var rp=require(_0x4eb0('0x3'));var moment=require('moment');var BPromise=require(_0x4eb0('0x4'));var Mustache=require(_0x4eb0('0x5'));var util=require(_0x4eb0('0x6'));var path=require('path');var sox=require(_0x4eb0('0x7'));var csv=require(_0x4eb0('0x8'));var ejs=require(_0x4eb0('0x9'));var fs=require('fs');var fs_extra=require(_0x4eb0('0xa'));var _=require(_0x4eb0('0xb'));var squel=require(_0x4eb0('0xc'));var crypto=require('crypto');var jsforce=require(_0x4eb0('0xd'));var deskjs=require(_0x4eb0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4eb0('0xf'));var Papa=require('papaparse');var Redis=require(_0x4eb0('0x10'));var authService=require(_0x4eb0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb0('0x12'));var hardwareService=require(_0x4eb0('0x13'));var logger=require(_0x4eb0('0x14'))(_0x4eb0('0x15'));var utils=require(_0x4eb0('0x16'));var config=require(_0x4eb0('0x17'));var licenseUtil=require(_0x4eb0('0x18'));var db=require(_0x4eb0('0x19'))['db'];function respondWithStatusCode(_0xd97d9e,_0x535c82){_0x535c82=_0x535c82||0xcc;return function(_0x2e58f1){if(_0x2e58f1){return _0xd97d9e['sendStatus'](_0x535c82);}return _0xd97d9e[_0x4eb0('0x1a')](_0x535c82)[_0x4eb0('0x1b')]();};}function respondWithResult(_0x632130,_0xe144f8){_0xe144f8=_0xe144f8||0xc8;return function(_0x136c02){if(_0x136c02){return _0x632130[_0x4eb0('0x1a')](_0xe144f8)[_0x4eb0('0x1c')](_0x136c02);}};}function respondWithFilteredResult(_0x2c0999,_0x37df8f){return function(_0x967954){if(_0x967954){var _0x10648a=typeof _0x37df8f['offset']===_0x4eb0('0x1d')&&typeof _0x37df8f[_0x4eb0('0x1e')]===_0x4eb0('0x1d');var _0xc7c952=_0x967954[_0x4eb0('0x1f')];var _0x206f9c=_0x10648a?0x0:_0x37df8f[_0x4eb0('0x20')];var _0x3de868=_0x10648a?_0x967954[_0x4eb0('0x1f')]:_0x37df8f[_0x4eb0('0x20')]+_0x37df8f[_0x4eb0('0x1e')];var _0x4dba55;if(_0x3de868>=_0xc7c952){_0x3de868=_0xc7c952;_0x4dba55=0xc8;}else{_0x4dba55=0xce;}_0x2c0999[_0x4eb0('0x1a')](_0x4dba55);return _0x2c0999[_0x4eb0('0x21')]('Content-Range',_0x206f9c+'-'+_0x3de868+'/'+_0xc7c952)['json'](_0x967954);}return null;};}function patchUpdates(_0x359508){return function(_0x20a49a){try{jsonpatch[_0x4eb0('0x22')](_0x20a49a,_0x359508,!![]);}catch(_0x3c3083){return BPromise['reject'](_0x3c3083);}return _0x20a49a['save']();};}function saveUpdates(_0x3bdca1,_0x212b26){return function(_0x3787e9){if(_0x3787e9){return _0x3787e9[_0x4eb0('0x23')](_0x3bdca1)[_0x4eb0('0x24')](function(_0x44d22a){return _0x44d22a;});}return null;};}function removeEntity(_0x21a9ae,_0x16651d){return function(_0x10ce3a){if(_0x10ce3a){return _0x10ce3a['destroy']()[_0x4eb0('0x24')](function(){_0x21a9ae[_0x4eb0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e51e1,_0x14d2e3){return function(_0x81523f){if(!_0x81523f){_0x3e51e1['sendStatus'](0x194);}return _0x81523f;};}function handleError(_0x196eaf,_0x1ab9bf){_0x1ab9bf=_0x1ab9bf||0x1f4;return function(_0x5720db){logger[_0x4eb0('0x25')](_0x5720db[_0x4eb0('0x26')]);if(_0x5720db[_0x4eb0('0x27')]){delete _0x5720db[_0x4eb0('0x27')];}_0x196eaf['status'](_0x1ab9bf)[_0x4eb0('0x28')](_0x5720db);};}exports[_0x4eb0('0x29')]=function(_0x3cb1f1,_0x514db3){var _0x45d46a={},_0x58fb93={},_0x296392={'count':0x0,'rows':[]};var _0x45abdc=_['map'](db['SugarcrmField'][_0x4eb0('0x2a')],function(_0x2da044){return{'name':_0x2da044[_0x4eb0('0x2b')],'type':_0x2da044['type'][_0x4eb0('0x2c')]};});_0x58fb93[_0x4eb0('0x2d')]=_['map'](_0x45abdc,'name');_0x58fb93['query']=_[_0x4eb0('0x2e')](_0x3cb1f1[_0x4eb0('0x2f')]);_0x58fb93[_0x4eb0('0x30')]=_[_0x4eb0('0x31')](_0x58fb93['model'],_0x58fb93[_0x4eb0('0x2f')]);_0x45d46a[_0x4eb0('0x32')]=_[_0x4eb0('0x31')](_0x58fb93[_0x4eb0('0x2d')],qs[_0x4eb0('0x33')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x33')]));_0x45d46a[_0x4eb0('0x32')]=_0x45d46a[_0x4eb0('0x32')]['length']?_0x45d46a[_0x4eb0('0x32')]:_0x58fb93[_0x4eb0('0x2d')];if(!_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x34')](_0x4eb0('0x35'))){_0x45d46a['limit']=qs[_0x4eb0('0x1e')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x1e')]);_0x45d46a[_0x4eb0('0x20')]=qs[_0x4eb0('0x20')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x20')]);}_0x45d46a[_0x4eb0('0x36')]=qs[_0x4eb0('0x37')](_0x3cb1f1['query'][_0x4eb0('0x37')]);_0x45d46a['where']=qs[_0x4eb0('0x30')](_['pick'](_0x3cb1f1[_0x4eb0('0x2f')],_0x58fb93[_0x4eb0('0x30')]),_0x45abdc);if(_0x3cb1f1[_0x4eb0('0x2f')]['filter']){_0x45d46a['where']=_['merge'](_0x45d46a[_0x4eb0('0x38')],{'$or':_['map'](_0x45abdc,function(_0x4581e6){if(_0x4581e6['type']!==_0x4eb0('0x39')){var _0x267dc7={};_0x267dc7[_0x4581e6['name']]={'$like':'%'+_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x3a')]+'%'};return _0x267dc7;}})});}_0x45d46a=_['merge']({},_0x45d46a,_0x3cb1f1[_0x4eb0('0x3b')]);var _0x2f7dc3={'where':_0x45d46a[_0x4eb0('0x38')]};return db['SugarcrmField'][_0x4eb0('0x1f')](_0x2f7dc3)[_0x4eb0('0x24')](function(_0x1e7fca){_0x296392[_0x4eb0('0x1f')]=_0x1e7fca;if(_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x3c')]){_0x45d46a['include']=[{'all':!![]}];}return db[_0x4eb0('0x3d')]['findAll'](_0x45d46a);})['then'](function(_0x4627df){_0x296392['rows']=_0x4627df;return _0x296392;})[_0x4eb0('0x24')](respondWithFilteredResult(_0x514db3,_0x45d46a))[_0x4eb0('0x3e')](handleError(_0x514db3,null));};exports[_0x4eb0('0x3f')]=function(_0x32c6cd,_0xe56fa7){var _0xc03e72={'raw':!![],'where':{'id':_0x32c6cd[_0x4eb0('0x40')]['id']}},_0x3b3fa4={};_0x3b3fa4[_0x4eb0('0x2d')]=_['keys'](db[_0x4eb0('0x3d')][_0x4eb0('0x2a')]);_0x3b3fa4[_0x4eb0('0x2f')]=_['keys'](_0x32c6cd[_0x4eb0('0x2f')]);_0x3b3fa4[_0x4eb0('0x30')]=_[_0x4eb0('0x31')](_0x3b3fa4['model'],_0x3b3fa4[_0x4eb0('0x2f')]);_0xc03e72['attributes']=_[_0x4eb0('0x31')](_0x3b3fa4[_0x4eb0('0x2d')],qs[_0x4eb0('0x33')](_0x32c6cd[_0x4eb0('0x2f')][_0x4eb0('0x33')]));_0xc03e72[_0x4eb0('0x32')]=_0xc03e72[_0x4eb0('0x32')][_0x4eb0('0x41')]?_0xc03e72['attributes']:_0x3b3fa4[_0x4eb0('0x2d')];if(_0x32c6cd[_0x4eb0('0x2f')]['includeAll']){_0xc03e72['include']=[{'all':!![]}];}_0xc03e72=_[_0x4eb0('0x42')]({},_0xc03e72,_0x32c6cd[_0x4eb0('0x3b')]);return db[_0x4eb0('0x3d')][_0x4eb0('0x43')](_0xc03e72)['then'](handleEntityNotFound(_0xe56fa7,null))['then'](respondWithResult(_0xe56fa7,null))[_0x4eb0('0x3e')](handleError(_0xe56fa7,null));};exports[_0x4eb0('0x44')]=function(_0x2559ea,_0xc1f249){return db['SugarcrmField'][_0x4eb0('0x44')](_0x2559ea[_0x4eb0('0x45')],{})[_0x4eb0('0x24')](respondWithResult(_0xc1f249,0xc9))[_0x4eb0('0x3e')](handleError(_0xc1f249,null));};exports[_0x4eb0('0x23')]=function(_0x2388c9,_0x3c99e4){if(_0x2388c9[_0x4eb0('0x45')]['id']){delete _0x2388c9[_0x4eb0('0x45')]['id'];}return db[_0x4eb0('0x3d')][_0x4eb0('0x43')]({'where':{'id':_0x2388c9[_0x4eb0('0x40')]['id']}})[_0x4eb0('0x24')](handleEntityNotFound(_0x3c99e4,null))[_0x4eb0('0x24')](saveUpdates(_0x2388c9[_0x4eb0('0x45')],null))['then'](respondWithResult(_0x3c99e4,null))[_0x4eb0('0x3e')](handleError(_0x3c99e4,null));};exports[_0x4eb0('0x46')]=function(_0x33d809,_0x3e3d99){return db[_0x4eb0('0x3d')][_0x4eb0('0x43')]({'where':{'id':_0x33d809[_0x4eb0('0x40')]['id']}})[_0x4eb0('0x24')](handleEntityNotFound(_0x3e3d99,null))['then'](removeEntity(_0x3e3d99,null))['catch'](handleError(_0x3e3d99,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 03ee0c1..b73f703 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 _0x6a8e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x6a8e,0x76));var _0xe6a8=function(_0xfc5de,_0x210af9){_0xfc5de=_0xfc5de-0x0;var _0x25ece8=_0x6a8e[_0xfc5de];return _0x25ece8;};'use strict';var _=require(_0xe6a8('0x0'));var util=require(_0xe6a8('0x1'));var logger=require(_0xe6a8('0x2'))(_0xe6a8('0x3'));var moment=require(_0xe6a8('0x4'));var BPromise=require('bluebird');var rp=require(_0xe6a8('0x5'));var fs=require('fs');var path=require(_0xe6a8('0x6'));var rimraf=require(_0xe6a8('0x7'));var config=require(_0xe6a8('0x8'));var attributes=require(_0xe6a8('0x9'));module[_0xe6a8('0xa')]=function(_0x5f3338,_0x4c1013){return _0x5f3338[_0xe6a8('0xb')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xe6a8('0xc'),'fields':[_0xe6a8('0xd'),_0xe6a8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc68=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xf40b02,_0x325ed4){var _0x22b5a2=function(_0x427ebc){while(--_0x427ebc){_0xf40b02['push'](_0xf40b02['shift']());}};_0x22b5a2(++_0x325ed4);}(_0xfc68,0x11b));var _0x8fc6=function(_0x570b19,_0xe4cb1f){_0x570b19=_0x570b19-0x0;var _0x44c8ce=_0xfc68[_0x570b19];return _0x44c8ce;};'use strict';var _=require(_0x8fc6('0x0'));var util=require(_0x8fc6('0x1'));var logger=require(_0x8fc6('0x2'))(_0x8fc6('0x3'));var moment=require(_0x8fc6('0x4'));var BPromise=require('bluebird');var rp=require(_0x8fc6('0x5'));var fs=require('fs');var path=require(_0x8fc6('0x6'));var rimraf=require(_0x8fc6('0x7'));var config=require(_0x8fc6('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x8fc6('0x9')]=function(_0x4023f4,_0x17b4d5){return _0x4023f4[_0x8fc6('0xa')]('SugarcrmField',attributes,{'tableName':_0x8fc6('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x8fc6('0xc'),_0x8fc6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 524ec92..abdc560 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 _0xa2a3=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0xa2a3,0x17b));var _0x3a2a=function(_0x90e9ab,_0x426802){_0x90e9ab=_0x90e9ab-0x0;var _0xdfa58b=_0xa2a3[_0x90e9ab];return _0xdfa58b;};'use strict';var _=require(_0x3a2a('0x0'));var util=require('util');var moment=require(_0x3a2a('0x1'));var BPromise=require(_0x3a2a('0x2'));var rs=require(_0x3a2a('0x3'));var fs=require('fs');var Redis=require(_0x3a2a('0x4'));var db=require(_0x3a2a('0x5'))['db'];var utils=require(_0x3a2a('0x6'));var logger=require('../../config/logger')(_0x3a2a('0x7'));var config=require(_0x3a2a('0x8'));var jayson=require(_0x3a2a('0x9'));var client=jayson[_0x3a2a('0xa')][_0x3a2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd2db78,_0x51bf58,_0x46b4ae){return new BPromise(function(_0x96b939,_0x43c1c0){return client[_0x3a2a('0xc')](_0xd2db78,_0x46b4ae)[_0x3a2a('0xd')](function(_0x545d22){logger[_0x3a2a('0xe')](_0x3a2a('0xf'),_0x51bf58,'request\x20sent');logger[_0x3a2a('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x51bf58,'request\x20sent',JSON[_0x3a2a('0x11')](_0x545d22));if(_0x545d22[_0x3a2a('0x12')]){if(_0x545d22[_0x3a2a('0x12')][_0x3a2a('0x13')]===0x1f4){logger[_0x3a2a('0x12')](_0x3a2a('0xf'),_0x51bf58,_0x545d22['error'][_0x3a2a('0x14')]);return _0x43c1c0(_0x545d22[_0x3a2a('0x12')][_0x3a2a('0x14')]);}logger[_0x3a2a('0x12')](_0x3a2a('0xf'),_0x51bf58,_0x545d22['error'][_0x3a2a('0x14')]);return _0x96b939(_0x545d22[_0x3a2a('0x12')][_0x3a2a('0x14')]);}else{logger[_0x3a2a('0xe')](_0x3a2a('0xf'),_0x51bf58,_0x3a2a('0x15'));_0x96b939(_0x545d22[_0x3a2a('0x16')][_0x3a2a('0x14')]);}})[_0x3a2a('0x17')](function(_0x1cf040){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x51bf58,_0x1cf040);_0x43c1c0(_0x1cf040);});});} \ No newline at end of file +var _0x9875=['message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','SugarcrmField,\x20%s,\x20%s'];(function(_0x2bfdf4,_0x271b31){var _0x403cb8=function(_0x5eb04f){while(--_0x5eb04f){_0x2bfdf4['push'](_0x2bfdf4['shift']());}};_0x403cb8(++_0x271b31);}(_0x9875,0xc0));var _0x5987=function(_0x1b33c8,_0x351a00){_0x1b33c8=_0x1b33c8-0x0;var _0x3d6775=_0x9875[_0x1b33c8];return _0x3d6775;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5987('0x0'));var fs=require('fs');var Redis=require(_0x5987('0x1'));var db=require(_0x5987('0x2'))['db'];var utils=require(_0x5987('0x3'));var logger=require(_0x5987('0x4'))(_0x5987('0x5'));var config=require(_0x5987('0x6'));var jayson=require(_0x5987('0x7'));var client=jayson[_0x5987('0x8')][_0x5987('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x101691,_0x1a6471,_0x4bf012){return new BPromise(function(_0x1ff742,_0x4b65c6){return client[_0x5987('0xa')](_0x101691,_0x4bf012)[_0x5987('0xb')](function(_0x35e48f){logger[_0x5987('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'));logger[_0x5987('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'),JSON['stringify'](_0x35e48f));if(_0x35e48f[_0x5987('0xf')]){if(_0x35e48f['error'][_0x5987('0x10')]===0x1f4){logger[_0x5987('0xf')](_0x5987('0x11'),_0x1a6471,_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);return _0x4b65c6(_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);}logger['error'](_0x5987('0x11'),_0x1a6471,_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);return _0x1ff742(_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);}else{logger[_0x5987('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'));_0x1ff742(_0x35e48f[_0x5987('0x13')]['message']);}})[_0x5987('0x14')](function(_0xdf645d){logger[_0x5987('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0xdf645d);_0x4b65c6(_0xdf645d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ac6c47d..72e1c54 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 _0x57cf=['create','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/configurations','/:id/fields','getFields'];(function(_0x33aaed,_0x303d38){var _0x3e0341=function(_0x5445b3){while(--_0x5445b3){_0x33aaed['push'](_0x33aaed['shift']());}};_0x3e0341(++_0x303d38);}(_0x57cf,0x11b));var _0xf57c=function(_0x5ae93d,_0x48a929){_0x5ae93d=_0x5ae93d-0x0;var _0x3bc344=_0x57cf[_0x5ae93d];return _0x3bc344;};'use strict';var multer=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var path=require(_0xf57c('0x2'));var timeout=require(_0xf57c('0x3'));var express=require(_0xf57c('0x4'));var router=express[_0xf57c('0x5')]();var fs_extra=require(_0xf57c('0x6'));var auth=require(_0xf57c('0x7'));var interaction=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var controller=require('./intVtigerAccount.controller');router[_0xf57c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf57c('0xb')]);router['get']('/:id',auth[_0xf57c('0xc')](),controller['show']);router[_0xf57c('0xa')](_0xf57c('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf57c('0xa')](_0xf57c('0xe'),auth[_0xf57c('0xc')](),controller[_0xf57c('0xf')]);router['post']('/',auth[_0xf57c('0xc')](),controller[_0xf57c('0x10')]);router[_0xf57c('0x11')]('/:id/configurations',auth[_0xf57c('0xc')](),controller['addConfiguration']);router[_0xf57c('0x12')](_0xf57c('0x13'),auth['isAuthenticated'](),controller[_0xf57c('0x14')]);router['delete'](_0xf57c('0x13'),auth['isAuthenticated'](),controller[_0xf57c('0x15')]);module[_0xf57c('0x16')]=router; \ No newline at end of file +var _0x3edb=['fs-extra','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3edb,0x1c9));var _0xb3ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3edb[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb3ed('0x0'));var util=require(_0xb3ed('0x1'));var path=require('path');var timeout=require(_0xb3ed('0x2'));var express=require(_0xb3ed('0x3'));var router=express[_0xb3ed('0x4')]();var fs_extra=require(_0xb3ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb3ed('0x6'));var config=require('../../config/environment');var controller=require(_0xb3ed('0x7'));router['get']('/',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x9')]);router[_0xb3ed('0xa')]('/:id',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0xb')]);router[_0xb3ed('0xa')](_0xb3ed('0xc'),auth[_0xb3ed('0x8')](),controller[_0xb3ed('0xd')]);router['get'](_0xb3ed('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xb3ed('0xf')]('/',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x10')]);router[_0xb3ed('0xf')](_0xb3ed('0xc'),auth['isAuthenticated'](),controller[_0xb3ed('0x11')]);router['put']('/:id',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x12')]);router['delete'](_0xb3ed('0x13'),auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x14')]);module[_0xb3ed('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 69c212d..a662bd7 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 _0xe574=['HelpDesk','exports','STRING'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_0xe574,0xac));var _0x4e57=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe574[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x4e57('0x0')]={'name':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![],'defaultValue':_0x4e57('0x2')},'remoteUri':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5972=['STRING','HelpDesk','exports'];(function(_0x41b913,_0x5b0927){var _0x253f95=function(_0x116734){while(--_0x116734){_0x41b913['push'](_0x41b913['shift']());}};_0x253f95(++_0x5b0927);}(_0x5972,0x119));var _0x2597=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x5972[_0x2f3794];return _0x1c9fbe;};'use strict';var Sequelize=require('sequelize');module[_0x2597('0x0')]={'name':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2597('0x1')]},'username':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2597('0x1')],'allowNull':![],'defaultValue':_0x2597('0x2')},'remoteUri':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 4e8c3ed..0eccbca 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 _0xe37a=['destroy','then','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','success','POST','login','result','token','GET','describe','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe37a,0x1bd));var _0xae37=function(_0x3d4b7a,_0x49581f){_0x3d4b7a=_0x3d4b7a-0x0;var _0xa000c1=_0xe37a[_0x3d4b7a];return _0xa000c1;};'use strict';var emlformat=require(_0xae37('0x0'));var rimraf=require(_0xae37('0x1'));var zipdir=require(_0xae37('0x2'));var jsonpatch=require(_0xae37('0x3'));var rp=require(_0xae37('0x4'));var moment=require(_0xae37('0x5'));var BPromise=require(_0xae37('0x6'));var Mustache=require(_0xae37('0x7'));var util=require('util');var path=require(_0xae37('0x8'));var sox=require(_0xae37('0x9'));var csv=require(_0xae37('0xa'));var ejs=require(_0xae37('0xb'));var fs=require('fs');var fs_extra=require(_0xae37('0xc'));var _=require(_0xae37('0xd'));var squel=require(_0xae37('0xe'));var crypto=require(_0xae37('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xae37('0x10'));var toCsv=require(_0xae37('0xa'));var querystring=require('querystring');var Papa=require(_0xae37('0x11'));var Redis=require('ioredis');var authService=require(_0xae37('0x12'));var qs=require(_0xae37('0x13'));var as=require(_0xae37('0x14'));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('../../config/license/util');var db=require(_0xae37('0x15'))['db'];var integrations=require(_0xae37('0x16'));function respondWithStatusCode(_0x244815,_0x5e0ee8){_0x5e0ee8=_0x5e0ee8||0xcc;return function(_0x448544){if(_0x448544){return _0x244815[_0xae37('0x17')](_0x5e0ee8);}return _0x244815['status'](_0x5e0ee8)[_0xae37('0x18')]();};}function respondWithResult(_0x53727f,_0xedbe7){_0xedbe7=_0xedbe7||0xc8;return function(_0x1a4ab8){if(_0x1a4ab8){return _0x53727f[_0xae37('0x19')](_0xedbe7)[_0xae37('0x1a')](_0x1a4ab8);}};}function respondWithFilteredResult(_0x2c156a,_0x3fba5e){return function(_0x48bc06){if(_0x48bc06){var _0x3ba2dd=typeof _0x3fba5e['offset']===_0xae37('0x1b')&&typeof _0x3fba5e[_0xae37('0x1c')]==='undefined';var _0x5f36ff=_0x48bc06[_0xae37('0x1d')];var _0x1f3eba=_0x3ba2dd?0x0:_0x3fba5e[_0xae37('0x1e')];var _0x2cabb2=_0x3ba2dd?_0x48bc06[_0xae37('0x1d')]:_0x3fba5e['offset']+_0x3fba5e[_0xae37('0x1c')];var _0x415a3d;if(_0x2cabb2>=_0x5f36ff){_0x2cabb2=_0x5f36ff;_0x415a3d=0xc8;}else{_0x415a3d=0xce;}_0x2c156a[_0xae37('0x19')](_0x415a3d);return _0x2c156a[_0xae37('0x1f')](_0xae37('0x20'),_0x1f3eba+'-'+_0x2cabb2+'/'+_0x5f36ff)[_0xae37('0x1a')](_0x48bc06);}return null;};}function patchUpdates(_0x44f9ff){return function(_0x4041b9){try{jsonpatch['apply'](_0x4041b9,_0x44f9ff,!![]);}catch(_0x28d303){return BPromise['reject'](_0x28d303);}return _0x4041b9[_0xae37('0x21')]();};}function saveUpdates(_0x2c3ad6,_0x5e9913){return function(_0x4e3555){if(_0x4e3555){return _0x4e3555[_0xae37('0x22')](_0x2c3ad6)['then'](function(_0x26e008){return _0x26e008;});}return null;};}function removeEntity(_0x199679,_0x377b7c){return function(_0x1f9d7c){if(_0x1f9d7c){return _0x1f9d7c[_0xae37('0x23')]()[_0xae37('0x24')](function(){_0x199679['status'](0xcc)[_0xae37('0x18')]();});}};}function handleEntityNotFound(_0x283035,_0x4f6612){return function(_0x3e37af){if(!_0x3e37af){_0x283035['sendStatus'](0x194);}return _0x3e37af;};}function handleError(_0x500ee6,_0x3f42a4){_0x3f42a4=_0x3f42a4||0x1f4;return function(_0x3f9dc7){logger['error'](_0x3f9dc7['stack']);if(_0x3f9dc7[_0xae37('0x25')]){delete _0x3f9dc7['name'];}_0x500ee6['status'](_0x3f42a4)[_0xae37('0x26')](_0x3f9dc7);};}exports[_0xae37('0x27')]=function(_0x4443c3,_0x4f9f17){var _0x4297a7={},_0x37bc9a={},_0x188f6b={'count':0x0,'rows':[]};var _0x50956f=_[_0xae37('0x28')](db[_0xae37('0x29')][_0xae37('0x2a')],function(_0xb85e44){return{'name':_0xb85e44[_0xae37('0x2b')],'type':_0xb85e44[_0xae37('0x2c')][_0xae37('0x2d')]};});_0x37bc9a['model']=_['map'](_0x50956f,'name');_0x37bc9a[_0xae37('0x2e')]=_['keys'](_0x4443c3[_0xae37('0x2e')]);_0x37bc9a[_0xae37('0x2f')]=_[_0xae37('0x30')](_0x37bc9a[_0xae37('0x31')],_0x37bc9a[_0xae37('0x2e')]);_0x4297a7[_0xae37('0x32')]=_[_0xae37('0x30')](_0x37bc9a[_0xae37('0x31')],qs[_0xae37('0x33')](_0x4443c3[_0xae37('0x2e')][_0xae37('0x33')]));_0x4297a7[_0xae37('0x32')]=_0x4297a7['attributes'][_0xae37('0x34')]?_0x4297a7[_0xae37('0x32')]:_0x37bc9a['model'];if(!_0x4443c3['query']['hasOwnProperty'](_0xae37('0x35'))){_0x4297a7[_0xae37('0x1c')]=qs[_0xae37('0x1c')](_0x4443c3[_0xae37('0x2e')][_0xae37('0x1c')]);_0x4297a7[_0xae37('0x1e')]=qs[_0xae37('0x1e')](_0x4443c3[_0xae37('0x2e')]['offset']);}_0x4297a7['order']=qs['sort'](_0x4443c3[_0xae37('0x2e')][_0xae37('0x36')]);_0x4297a7[_0xae37('0x37')]=qs['filters'](_[_0xae37('0x38')](_0x4443c3[_0xae37('0x2e')],_0x37bc9a[_0xae37('0x2f')]),_0x50956f);if(_0x4443c3['query'][_0xae37('0x39')]){_0x4297a7[_0xae37('0x37')]=_[_0xae37('0x3a')](_0x4297a7[_0xae37('0x37')],{'$or':_[_0xae37('0x28')](_0x50956f,function(_0x18d20f){if(_0x18d20f[_0xae37('0x2c')]!==_0xae37('0x3b')){var _0x2774bb={};_0x2774bb[_0x18d20f['name']]={'$like':'%'+_0x4443c3[_0xae37('0x2e')][_0xae37('0x39')]+'%'};return _0x2774bb;}})});}_0x4297a7=_[_0xae37('0x3a')]({},_0x4297a7,_0x4443c3[_0xae37('0x3c')]);var _0x34275d={'where':_0x4297a7[_0xae37('0x37')]};return db[_0xae37('0x29')][_0xae37('0x1d')](_0x34275d)['then'](function(_0x10ee59){_0x188f6b['count']=_0x10ee59;if(_0x4443c3[_0xae37('0x2e')][_0xae37('0x3d')]){_0x4297a7[_0xae37('0x3e')]=[{'all':!![]}];}return db[_0xae37('0x29')][_0xae37('0x3f')](_0x4297a7);})[_0xae37('0x24')](function(_0x23bb86){_0x188f6b[_0xae37('0x40')]=_0x23bb86;return _0x188f6b;})[_0xae37('0x24')](respondWithFilteredResult(_0x4f9f17,_0x4297a7))[_0xae37('0x41')](handleError(_0x4f9f17,null));};exports[_0xae37('0x42')]=function(_0x40e94b,_0x3889ac){var _0x2749d6={'raw':![],'where':{'id':_0x40e94b[_0xae37('0x43')]['id']}},_0x6f1b6b={};_0x6f1b6b[_0xae37('0x31')]=_[_0xae37('0x44')](db[_0xae37('0x29')][_0xae37('0x2a')]);_0x6f1b6b['query']=_['keys'](_0x40e94b[_0xae37('0x2e')]);_0x6f1b6b[_0xae37('0x2f')]=_['intersection'](_0x6f1b6b[_0xae37('0x31')],_0x6f1b6b['query']);_0x2749d6[_0xae37('0x32')]=_['intersection'](_0x6f1b6b[_0xae37('0x31')],qs['fields'](_0x40e94b[_0xae37('0x2e')][_0xae37('0x33')]));_0x2749d6['attributes']=_0x2749d6[_0xae37('0x32')]['length']?_0x2749d6[_0xae37('0x32')]:_0x6f1b6b[_0xae37('0x31')];if(_0x40e94b[_0xae37('0x2e')]['includeAll']){_0x2749d6[_0xae37('0x3e')]=[{'all':!![]}];}_0x2749d6=_[_0xae37('0x3a')]({},_0x2749d6,_0x40e94b['options']);return db[_0xae37('0x29')][_0xae37('0x45')](_0x2749d6)['then'](handleEntityNotFound(_0x3889ac,null))['then'](respondWithResult(_0x3889ac,null))[_0xae37('0x41')](handleError(_0x3889ac,null));};exports[_0xae37('0x46')]=function(_0x57928c,_0x4ea15d){return db[_0xae37('0x29')][_0xae37('0x46')](_0x57928c[_0xae37('0x47')],{})['then'](respondWithResult(_0x4ea15d,0xc9))['catch'](handleError(_0x4ea15d,null));};exports[_0xae37('0x22')]=function(_0x532768,_0x35bcb2){if(_0x532768[_0xae37('0x47')]['id']){delete _0x532768['body']['id'];}return db['VtigerAccount'][_0xae37('0x45')]({'where':{'id':_0x532768[_0xae37('0x43')]['id']}})[_0xae37('0x24')](handleEntityNotFound(_0x35bcb2,null))['then'](saveUpdates(_0x532768['body'],null))[_0xae37('0x24')](respondWithResult(_0x35bcb2,null))[_0xae37('0x41')](handleError(_0x35bcb2,null));};exports[_0xae37('0x23')]=function(_0x4e5b45,_0x1bd731){return db['VtigerAccount'][_0xae37('0x45')]({'where':{'id':_0x4e5b45[_0xae37('0x43')]['id']}})['then'](handleEntityNotFound(_0x1bd731,null))[_0xae37('0x24')](removeEntity(_0x1bd731,null))['catch'](handleError(_0x1bd731,null));};exports[_0xae37('0x48')]=function(_0x26cb87,_0x1c3418,_0x2b1f7a){var _0x332e5e={};var _0x48bad9={};var _0x5d0440;var _0x50e6db;return db[_0xae37('0x29')][_0xae37('0x49')]({'where':{'id':_0x26cb87[_0xae37('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c3418,null))[_0xae37('0x24')](function(_0x4bf5ac){if(_0x4bf5ac){_0x5d0440=_0x4bf5ac;_0x48bad9[_0xae37('0x31')]=_[_0xae37('0x44')](db[_0xae37('0x4a')][_0xae37('0x2a')]);_0x48bad9['query']=_[_0xae37('0x44')](_0x26cb87[_0xae37('0x2e')]);_0x48bad9['filters']=_[_0xae37('0x30')](_0x48bad9[_0xae37('0x31')],_0x48bad9['query']);_0x332e5e['attributes']=_[_0xae37('0x30')](_0x48bad9[_0xae37('0x31')],qs[_0xae37('0x33')](_0x26cb87['query'][_0xae37('0x33')]));_0x332e5e[_0xae37('0x32')]=_0x332e5e[_0xae37('0x32')][_0xae37('0x34')]?_0x332e5e[_0xae37('0x32')]:_0x48bad9[_0xae37('0x31')];_0x332e5e[_0xae37('0x4b')]=qs[_0xae37('0x36')](_0x26cb87[_0xae37('0x2e')][_0xae37('0x36')]);_0x332e5e[_0xae37('0x37')]=qs[_0xae37('0x2f')](_[_0xae37('0x38')](_0x26cb87[_0xae37('0x2e')],_0x48bad9[_0xae37('0x2f')]));if(_0x26cb87['query'][_0xae37('0x39')]){_0x332e5e['where']=_[_0xae37('0x3a')](_0x332e5e[_0xae37('0x37')],{'$or':_[_0xae37('0x28')](_0x332e5e[_0xae37('0x32')],function(_0x280c41){var _0x312e92={};_0x312e92[_0x280c41]={'$like':'%'+_0x26cb87['query'][_0xae37('0x39')]+'%'};return _0x312e92;})});}_0x332e5e=_[_0xae37('0x3a')]({},_0x332e5e,_0x26cb87[_0xae37('0x3c')]);return _0x5d0440[_0xae37('0x48')](_0x332e5e);}})[_0xae37('0x24')](function(_0x11aef0){if(_0x11aef0){_0x50e6db=_0x11aef0[_0xae37('0x34')];if(!_0x26cb87[_0xae37('0x2e')][_0xae37('0x4c')](_0xae37('0x35'))){_0x332e5e[_0xae37('0x1c')]=qs[_0xae37('0x1c')](_0x26cb87[_0xae37('0x2e')][_0xae37('0x1c')]);_0x332e5e[_0xae37('0x1e')]=qs[_0xae37('0x1e')](_0x26cb87[_0xae37('0x2e')][_0xae37('0x1e')]);}return _0x5d0440[_0xae37('0x48')](_0x332e5e);}})[_0xae37('0x24')](function(_0xd378d5){if(_0xd378d5){return _0xd378d5?{'count':_0x50e6db,'rows':_0xd378d5}:null;}})['then'](respondWithResult(_0x1c3418,null))[_0xae37('0x41')](handleError(_0x1c3418,null));};exports[_0xae37('0x4d')]=function(_0x3cf6ea,_0x5e5c9b,_0x137cb7){if(_0x3cf6ea[_0xae37('0x47')]['id']){delete _0x3cf6ea['body']['id'];}return db[_0xae37('0x29')][_0xae37('0x49')]({'where':{'id':_0x3cf6ea[_0xae37('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e5c9b,null))[_0xae37('0x24')](function(_0x3aa2e3){if(_0x3aa2e3){_0x3cf6ea['body'][_0xae37('0x4e')]=_0x3aa2e3['id'];_0x3cf6ea[_0xae37('0x47')][_0xae37('0x4f')]=integrations[_0xae37('0x50')](_0x3cf6ea['body'][_0xae37('0x51')],_0x3cf6ea[_0xae37('0x47')]['type']);_0x3cf6ea['body'][_0xae37('0x52')]=integrations[_0xae37('0x53')](_0x3cf6ea[_0xae37('0x47')][_0xae37('0x51')],_0x3cf6ea[_0xae37('0x47')]['type']);return db[_0xae37('0x4a')][_0xae37('0x46')](_0x3cf6ea[_0xae37('0x47')],{'include':[{'model':db[_0xae37('0x54')],'as':_0xae37('0x4f')},{'model':db['VtigerField'],'as':_0xae37('0x52')}]});}return null;})[_0xae37('0x24')](respondWithResult(_0x5e5c9b,null))[_0xae37('0x41')](handleError(_0x5e5c9b,null));};var md5=require('md5');exports['getFields']=function(_0x477c42,_0x4b6e56,_0x4a104b){var _0x20bd9d=null;var _0x2ea61b=null;var _0x453e6b=null;var _0x1b10a4=null;var _0x31ec3c='';return db['VtigerAccount'][_0xae37('0x49')]({'where':{'id':_0x477c42['params']['id']},'attributes':['id','name',_0xae37('0x55'),_0xae37('0x56'),_0xae37('0x57'),'remoteUri','serverUrl',_0xae37('0x58')]})[_0xae37('0x24')](handleEntityNotFound(_0x4b6e56,null))[_0xae37('0x24')](function(_0x5ac7ca){if(_0x5ac7ca){_0x20bd9d=_0x5ac7ca[_0xae37('0x55')];_0x2ea61b=_0x5ac7ca['accessKey'];_0x453e6b=_0x5ac7ca['moduleName'];_0x31ec3c=_0x5ac7ca['remoteUri'];var _0x3f14ec=_0x31ec3c[_0xae37('0x59')](-0x1);if(_0x3f14ec==='/'){_0x31ec3c=_0x31ec3c[_0xae37('0x5a')](0x0,_0x31ec3c[_0xae37('0x5b')](_0x3f14ec));}_0x1b10a4=util[_0xae37('0x5c')](_0xae37('0x5d'),_0x31ec3c);var _0x370975={'method':'GET','uri':_0x1b10a4,'qs':{'operation':'getchallenge','username':_0x5ac7ca[_0xae37('0x55')]},'json':!![]};return rp(_0x370975);}})[_0xae37('0x24')](function(_0x5a1bdc){if(_0x5a1bdc[_0xae37('0x5e')]){var _0x500202={'method':_0xae37('0x5f'),'uri':_0x1b10a4,'form':{'operation':_0xae37('0x60'),'username':_0x20bd9d,'accessKey':md5(_0x5a1bdc[_0xae37('0x61')][_0xae37('0x62')]+_0x2ea61b)},'json':!![]};return rp(_0x500202);}})['then'](function(_0x3f1d08){if(_0x3f1d08[_0xae37('0x5e')]){var _0x571c25={'method':_0xae37('0x63'),'uri':_0x1b10a4,'qs':{'operation':_0xae37('0x64'),'username':_0x20bd9d,'sessionName':_0x3f1d08[_0xae37('0x61')]['sessionName'],'elementType':_0x453e6b},'json':!![]};return rp(_0x571c25);}})[_0xae37('0x24')](function(_0xcd2388){if(_0xcd2388[_0xae37('0x5e')]){var _0x1c76e2=[_0xae37('0x65'),_0xae37('0x66'),'owner'];_[_0xae37('0x67')](_0xcd2388[_0xae37('0x61')][_0xae37('0x33')],function(_0x4087b4){return _0x1c76e2[_0xae37('0x68')](_0x4087b4[_0xae37('0x2c')][_0xae37('0x25')]);});_[_0xae37('0x67')](_0xcd2388[_0xae37('0x61')][_0xae37('0x33')],function(_0x5a606d){return _0x5a606d[_0xae37('0x69')]===_0xae37('0x6a');});return{'count':_0xcd2388['result']['fields'][_0xae37('0x34')],'rows':_[_0xae37('0x28')](_0xcd2388[_0xae37('0x61')][_0xae37('0x33')],function(_0xc2887b){return{'id':_0xc2887b['name'],'name':_0xc2887b[_0xae37('0x6b')],'custom':_[_0xae37('0x6c')](_0xc2887b[_0xae37('0x25')],_0xae37('0x6d'))?!![]:![],'options':_0xc2887b[_0xae37('0x2c')][_0xae37('0x25')]===_0xae37('0x6e')&&_0xc2887b['type'][_0xae37('0x6f')][_0xae37('0x34')]>0x0?_[_0xae37('0x28')](_0xc2887b['type'][_0xae37('0x6f')],function(_0x5049c0){return{'name':_0x5049c0[_0xae37('0x6b')],'value':_0x5049c0[_0xae37('0x70')]};}):[]};})};}})['then'](respondWithResult(_0x4b6e56,null))[_0xae37('0x41')](function(_0x5d2482){console[_0xae37('0x71')](_0xae37('0x72')+_0x5d2482);var _0x30c1b9=_0x477c42[_0xae37('0x2e')][_0xae37('0x73')]?0x1f4:_0x5d2482['statusCode']||0x1f4;logger[_0xae37('0x74')](_0xae37('0x75'),'getFields',_0x30c1b9,JSON[_0xae37('0x76')](_0x5d2482));delete _0x5d2482['name'];if(_0x30c1b9===0x191){_0x30c1b9=0x190;}_0x4b6e56[_0xae37('0x19')](_0x30c1b9)[_0xae37('0x26')](_0x477c42[_0xae37('0x2e')][_0xae37('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x5d2482[_0xae37('0x77')]}:_0x5d2482);});}; \ No newline at end of file +var _0x5139=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','body','findOne','pick','getConfigurations','addConfiguration','Subjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','result','success','describe','sessionName','reference','owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5a240f,_0x1049bd){var _0x1c2664=function(_0x2cdb9){while(--_0x2cdb9){_0x5a240f['push'](_0x5a240f['shift']());}};_0x1c2664(++_0x1049bd);}(_0x5139,0xdc));var _0x9513=function(_0xf1a87d,_0x80b3a9){_0xf1a87d=_0xf1a87d-0x0;var _0x5e9155=_0x5139[_0xf1a87d];return _0x5e9155;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require(_0x9513('0x1'));var zipdir=require(_0x9513('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9513('0x3'));var moment=require(_0x9513('0x4'));var BPromise=require(_0x9513('0x5'));var Mustache=require('mustache');var util=require(_0x9513('0x6'));var path=require(_0x9513('0x7'));var sox=require(_0x9513('0x8'));var csv=require(_0x9513('0x9'));var ejs=require(_0x9513('0xa'));var fs=require('fs');var fs_extra=require(_0x9513('0xb'));var _=require(_0x9513('0xc'));var squel=require(_0x9513('0xd'));var crypto=require(_0x9513('0xe'));var jsforce=require(_0x9513('0xf'));var deskjs=require(_0x9513('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9513('0x11'));var Papa=require(_0x9513('0x12'));var Redis=require('ioredis');var authService=require(_0x9513('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9513('0x14'));var logger=require(_0x9513('0x15'))(_0x9513('0x16'));var utils=require(_0x9513('0x17'));var config=require(_0x9513('0x18'));var licenseUtil=require(_0x9513('0x19'));var db=require(_0x9513('0x1a'))['db'];var integrations=require(_0x9513('0x1b'));function respondWithStatusCode(_0x32f925,_0x3cf108){_0x3cf108=_0x3cf108||0xcc;return function(_0x133bd0){if(_0x133bd0){return _0x32f925[_0x9513('0x1c')](_0x3cf108);}return _0x32f925['status'](_0x3cf108)[_0x9513('0x1d')]();};}function respondWithResult(_0x13bf35,_0x5b6d3d){_0x5b6d3d=_0x5b6d3d||0xc8;return function(_0x1a410e){if(_0x1a410e){return _0x13bf35[_0x9513('0x1e')](_0x5b6d3d)['json'](_0x1a410e);}};}function respondWithFilteredResult(_0xaa8eea,_0x14ff4e){return function(_0x433e69){if(_0x433e69){var _0x2bca96=typeof _0x14ff4e[_0x9513('0x1f')]==='undefined'&&typeof _0x14ff4e['limit']==='undefined';var _0x4cd02b=_0x433e69[_0x9513('0x20')];var _0x418e34=_0x2bca96?0x0:_0x14ff4e[_0x9513('0x1f')];var _0x10212a=_0x2bca96?_0x433e69[_0x9513('0x20')]:_0x14ff4e[_0x9513('0x1f')]+_0x14ff4e['limit'];var _0x491999;if(_0x10212a>=_0x4cd02b){_0x10212a=_0x4cd02b;_0x491999=0xc8;}else{_0x491999=0xce;}_0xaa8eea['status'](_0x491999);return _0xaa8eea['set'](_0x9513('0x21'),_0x418e34+'-'+_0x10212a+'/'+_0x4cd02b)[_0x9513('0x22')](_0x433e69);}return null;};}function patchUpdates(_0x227781){return function(_0x334424){try{jsonpatch['apply'](_0x334424,_0x227781,!![]);}catch(_0x144694){return BPromise['reject'](_0x144694);}return _0x334424[_0x9513('0x23')]();};}function saveUpdates(_0x311c51,_0x9e1bb5){return function(_0x48ae49){if(_0x48ae49){return _0x48ae49[_0x9513('0x24')](_0x311c51)[_0x9513('0x25')](function(_0x2a62f3){return _0x2a62f3;});}return null;};}function removeEntity(_0x53c854,_0x18fd2a){return function(_0x1b50b5){if(_0x1b50b5){return _0x1b50b5[_0x9513('0x26')]()[_0x9513('0x25')](function(){_0x53c854['status'](0xcc)[_0x9513('0x1d')]();});}};}function handleEntityNotFound(_0x4f0cfe,_0x5c00a8){return function(_0x2c03a2){if(!_0x2c03a2){_0x4f0cfe[_0x9513('0x1c')](0x194);}return _0x2c03a2;};}function handleError(_0x547ce0,_0x2fa4e6){_0x2fa4e6=_0x2fa4e6||0x1f4;return function(_0x5c7269){logger[_0x9513('0x27')](_0x5c7269[_0x9513('0x28')]);if(_0x5c7269['name']){delete _0x5c7269[_0x9513('0x29')];}_0x547ce0[_0x9513('0x1e')](_0x2fa4e6)[_0x9513('0x2a')](_0x5c7269);};}exports[_0x9513('0x2b')]=function(_0x222b7d,_0x3b9da8){var _0x390b1b={},_0x451c4d={},_0x387e50={'count':0x0,'rows':[]};var _0x44248b=_[_0x9513('0x2c')](db[_0x9513('0x2d')][_0x9513('0x2e')],function(_0x42a62b){return{'name':_0x42a62b[_0x9513('0x2f')],'type':_0x42a62b[_0x9513('0x30')][_0x9513('0x31')]};});_0x451c4d[_0x9513('0x32')]=_[_0x9513('0x2c')](_0x44248b,_0x9513('0x29'));_0x451c4d['query']=_[_0x9513('0x33')](_0x222b7d['query']);_0x451c4d[_0x9513('0x34')]=_[_0x9513('0x35')](_0x451c4d[_0x9513('0x32')],_0x451c4d[_0x9513('0x36')]);_0x390b1b[_0x9513('0x37')]=_['intersection'](_0x451c4d[_0x9513('0x32')],qs['fields'](_0x222b7d[_0x9513('0x36')][_0x9513('0x38')]));_0x390b1b['attributes']=_0x390b1b['attributes'][_0x9513('0x39')]?_0x390b1b[_0x9513('0x37')]:_0x451c4d['model'];if(!_0x222b7d[_0x9513('0x36')]['hasOwnProperty'](_0x9513('0x3a'))){_0x390b1b[_0x9513('0x3b')]=qs[_0x9513('0x3b')](_0x222b7d[_0x9513('0x36')]['limit']);_0x390b1b['offset']=qs[_0x9513('0x1f')](_0x222b7d['query'][_0x9513('0x1f')]);}_0x390b1b[_0x9513('0x3c')]=qs['sort'](_0x222b7d[_0x9513('0x36')][_0x9513('0x3d')]);_0x390b1b[_0x9513('0x3e')]=qs[_0x9513('0x34')](_['pick'](_0x222b7d[_0x9513('0x36')],_0x451c4d['filters']),_0x44248b);if(_0x222b7d['query'][_0x9513('0x3f')]){_0x390b1b[_0x9513('0x3e')]=_[_0x9513('0x40')](_0x390b1b['where'],{'$or':_['map'](_0x44248b,function(_0x329e6a){if(_0x329e6a[_0x9513('0x30')]!==_0x9513('0x41')){var _0x3cf9e8={};_0x3cf9e8[_0x329e6a[_0x9513('0x29')]]={'$like':'%'+_0x222b7d[_0x9513('0x36')]['filter']+'%'};return _0x3cf9e8;}})});}_0x390b1b=_[_0x9513('0x40')]({},_0x390b1b,_0x222b7d[_0x9513('0x42')]);var _0x500510={'where':_0x390b1b[_0x9513('0x3e')]};return db[_0x9513('0x2d')][_0x9513('0x20')](_0x500510)[_0x9513('0x25')](function(_0x49729e){_0x387e50[_0x9513('0x20')]=_0x49729e;if(_0x222b7d[_0x9513('0x36')][_0x9513('0x43')]){_0x390b1b['include']=[{'all':!![]}];}return db[_0x9513('0x2d')][_0x9513('0x44')](_0x390b1b);})['then'](function(_0x25c416){_0x387e50['rows']=_0x25c416;return _0x387e50;})['then'](respondWithFilteredResult(_0x3b9da8,_0x390b1b))['catch'](handleError(_0x3b9da8,null));};exports[_0x9513('0x45')]=function(_0x1b5f67,_0x428011){var _0x4752aa={'raw':![],'where':{'id':_0x1b5f67[_0x9513('0x46')]['id']}},_0x839d5f={};_0x839d5f[_0x9513('0x32')]=_['keys'](db['VtigerAccount'][_0x9513('0x2e')]);_0x839d5f['query']=_['keys'](_0x1b5f67[_0x9513('0x36')]);_0x839d5f[_0x9513('0x34')]=_[_0x9513('0x35')](_0x839d5f[_0x9513('0x32')],_0x839d5f['query']);_0x4752aa[_0x9513('0x37')]=_['intersection'](_0x839d5f['model'],qs['fields'](_0x1b5f67[_0x9513('0x36')][_0x9513('0x38')]));_0x4752aa[_0x9513('0x37')]=_0x4752aa[_0x9513('0x37')][_0x9513('0x39')]?_0x4752aa['attributes']:_0x839d5f[_0x9513('0x32')];if(_0x1b5f67[_0x9513('0x36')][_0x9513('0x43')]){_0x4752aa['include']=[{'all':!![]}];}_0x4752aa=_[_0x9513('0x40')]({},_0x4752aa,_0x1b5f67[_0x9513('0x42')]);return db['VtigerAccount'][_0x9513('0x47')](_0x4752aa)[_0x9513('0x25')](handleEntityNotFound(_0x428011,null))['then'](respondWithResult(_0x428011,null))[_0x9513('0x48')](handleError(_0x428011,null));};exports[_0x9513('0x49')]=function(_0x113820,_0x21b05b){return db['VtigerAccount'][_0x9513('0x49')](_0x113820[_0x9513('0x4a')],{})[_0x9513('0x25')](respondWithResult(_0x21b05b,0xc9))[_0x9513('0x48')](handleError(_0x21b05b,null));};exports['update']=function(_0x45ad79,_0xa6adc6){if(_0x45ad79['body']['id']){delete _0x45ad79[_0x9513('0x4a')]['id'];}return db[_0x9513('0x2d')][_0x9513('0x47')]({'where':{'id':_0x45ad79['params']['id']}})[_0x9513('0x25')](handleEntityNotFound(_0xa6adc6,null))[_0x9513('0x25')](saveUpdates(_0x45ad79['body'],null))['then'](respondWithResult(_0xa6adc6,null))[_0x9513('0x48')](handleError(_0xa6adc6,null));};exports['destroy']=function(_0x501415,_0x244328){return db[_0x9513('0x2d')][_0x9513('0x47')]({'where':{'id':_0x501415[_0x9513('0x46')]['id']}})[_0x9513('0x25')](handleEntityNotFound(_0x244328,null))[_0x9513('0x25')](removeEntity(_0x244328,null))[_0x9513('0x48')](handleError(_0x244328,null));};exports['getConfigurations']=function(_0x3779ac,_0x476a7a,_0x184245){var _0x5bbfd5={};var _0x37b79a={};var _0x217d40;var _0x22687d;return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x3779ac['params']['id']}})['then'](handleEntityNotFound(_0x476a7a,null))[_0x9513('0x25')](function(_0x27fc5e){if(_0x27fc5e){_0x217d40=_0x27fc5e;_0x37b79a['model']=_[_0x9513('0x33')](db['VtigerConfiguration'][_0x9513('0x2e')]);_0x37b79a['query']=_[_0x9513('0x33')](_0x3779ac[_0x9513('0x36')]);_0x37b79a['filters']=_['intersection'](_0x37b79a[_0x9513('0x32')],_0x37b79a[_0x9513('0x36')]);_0x5bbfd5[_0x9513('0x37')]=_[_0x9513('0x35')](_0x37b79a[_0x9513('0x32')],qs[_0x9513('0x38')](_0x3779ac[_0x9513('0x36')][_0x9513('0x38')]));_0x5bbfd5['attributes']=_0x5bbfd5['attributes'][_0x9513('0x39')]?_0x5bbfd5[_0x9513('0x37')]:_0x37b79a[_0x9513('0x32')];_0x5bbfd5['order']=qs[_0x9513('0x3d')](_0x3779ac[_0x9513('0x36')]['sort']);_0x5bbfd5[_0x9513('0x3e')]=qs[_0x9513('0x34')](_[_0x9513('0x4c')](_0x3779ac['query'],_0x37b79a[_0x9513('0x34')]));if(_0x3779ac[_0x9513('0x36')][_0x9513('0x3f')]){_0x5bbfd5[_0x9513('0x3e')]=_[_0x9513('0x40')](_0x5bbfd5['where'],{'$or':_[_0x9513('0x2c')](_0x5bbfd5[_0x9513('0x37')],function(_0x247132){var _0x41e701={};_0x41e701[_0x247132]={'$like':'%'+_0x3779ac[_0x9513('0x36')][_0x9513('0x3f')]+'%'};return _0x41e701;})});}_0x5bbfd5=_[_0x9513('0x40')]({},_0x5bbfd5,_0x3779ac[_0x9513('0x42')]);return _0x217d40[_0x9513('0x4d')](_0x5bbfd5);}})[_0x9513('0x25')](function(_0x179bae){if(_0x179bae){_0x22687d=_0x179bae[_0x9513('0x39')];if(!_0x3779ac[_0x9513('0x36')]['hasOwnProperty'](_0x9513('0x3a'))){_0x5bbfd5[_0x9513('0x3b')]=qs[_0x9513('0x3b')](_0x3779ac[_0x9513('0x36')]['limit']);_0x5bbfd5['offset']=qs[_0x9513('0x1f')](_0x3779ac[_0x9513('0x36')][_0x9513('0x1f')]);}return _0x217d40['getConfigurations'](_0x5bbfd5);}})[_0x9513('0x25')](function(_0xbc2683){if(_0xbc2683){return _0xbc2683?{'count':_0x22687d,'rows':_0xbc2683}:null;}})[_0x9513('0x25')](respondWithResult(_0x476a7a,null))['catch'](handleError(_0x476a7a,null));};exports[_0x9513('0x4e')]=function(_0x5721c3,_0x55ae18,_0x1fc9c0){if(_0x5721c3[_0x9513('0x4a')]['id']){delete _0x5721c3[_0x9513('0x4a')]['id'];}return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x5721c3[_0x9513('0x46')]['id']}})['then'](handleEntityNotFound(_0x55ae18,null))[_0x9513('0x25')](function(_0x14b3f9){if(_0x14b3f9){_0x5721c3[_0x9513('0x4a')]['AccountId']=_0x14b3f9['id'];_0x5721c3[_0x9513('0x4a')][_0x9513('0x4f')]=integrations['getSubjects'](_0x5721c3[_0x9513('0x4a')][_0x9513('0x50')],_0x5721c3[_0x9513('0x4a')][_0x9513('0x30')]);_0x5721c3[_0x9513('0x4a')]['Descriptions']=integrations[_0x9513('0x51')](_0x5721c3['body'][_0x9513('0x50')],_0x5721c3[_0x9513('0x4a')][_0x9513('0x30')]);return db[_0x9513('0x52')][_0x9513('0x49')](_0x5721c3[_0x9513('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x9513('0x4f')},{'model':db[_0x9513('0x53')],'as':_0x9513('0x54')}]});}return null;})[_0x9513('0x25')](respondWithResult(_0x55ae18,null))['catch'](handleError(_0x55ae18,null));};var md5=require(_0x9513('0x55'));exports[_0x9513('0x56')]=function(_0x489cdb,_0x25fd8e,_0x584315){var _0xac24f2=null;var _0x206823=null;var _0xc3c3f0=null;var _0x599046=null;var _0x6bb495='';return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x489cdb[_0x9513('0x46')]['id']},'attributes':['id',_0x9513('0x29'),_0x9513('0x57'),'description',_0x9513('0x58'),_0x9513('0x59'),_0x9513('0x5a'),_0x9513('0x5b')]})['then'](handleEntityNotFound(_0x25fd8e,null))[_0x9513('0x25')](function(_0x30f3ab){if(_0x30f3ab){_0xac24f2=_0x30f3ab[_0x9513('0x57')];_0x206823=_0x30f3ab['accessKey'];_0xc3c3f0=_0x30f3ab[_0x9513('0x58')];_0x6bb495=_0x30f3ab[_0x9513('0x59')];var _0x8647ba=_0x6bb495[_0x9513('0x5c')](-0x1);if(_0x8647ba==='/'){_0x6bb495=_0x6bb495[_0x9513('0x5d')](0x0,_0x6bb495[_0x9513('0x5e')](_0x8647ba));}_0x599046=util[_0x9513('0x5f')](_0x9513('0x60'),_0x6bb495);var _0x11f628={'method':_0x9513('0x61'),'uri':_0x599046,'qs':{'operation':_0x9513('0x62'),'username':_0x30f3ab[_0x9513('0x57')]},'json':!![]};return rp(_0x11f628);}})['then'](function(_0x2fa24d){if(_0x2fa24d['success']){var _0x358ed3={'method':'POST','uri':_0x599046,'form':{'operation':_0x9513('0x63'),'username':_0xac24f2,'accessKey':md5(_0x2fa24d[_0x9513('0x64')]['token']+_0x206823)},'json':!![]};return rp(_0x358ed3);}})['then'](function(_0x6493e1){if(_0x6493e1[_0x9513('0x65')]){var _0x3776d6={'method':'GET','uri':_0x599046,'qs':{'operation':_0x9513('0x66'),'username':_0xac24f2,'sessionName':_0x6493e1['result'][_0x9513('0x67')],'elementType':_0xc3c3f0},'json':!![]};return rp(_0x3776d6);}})[_0x9513('0x25')](function(_0x55144a){if(_0x55144a[_0x9513('0x65')]){var _0x18597f=['autogenerated',_0x9513('0x68'),_0x9513('0x69')];_[_0x9513('0x6a')](_0x55144a[_0x9513('0x64')][_0x9513('0x38')],function(_0x5c41d4){return _0x18597f['includes'](_0x5c41d4[_0x9513('0x30')][_0x9513('0x29')]);});_[_0x9513('0x6a')](_0x55144a[_0x9513('0x64')]['fields'],function(_0x41b58f){return _0x41b58f[_0x9513('0x6b')]===_0x9513('0x6c');});return{'count':_0x55144a['result']['fields'][_0x9513('0x39')],'rows':_[_0x9513('0x2c')](_0x55144a[_0x9513('0x64')]['fields'],function(_0x1ff183){return{'id':_0x1ff183[_0x9513('0x29')],'name':_0x1ff183[_0x9513('0x6d')],'custom':_['startsWith'](_0x1ff183[_0x9513('0x29')],_0x9513('0x6e'))?!![]:![],'options':_0x1ff183[_0x9513('0x30')][_0x9513('0x29')]===_0x9513('0x6f')&&_0x1ff183[_0x9513('0x30')][_0x9513('0x70')]['length']>0x0?_[_0x9513('0x2c')](_0x1ff183[_0x9513('0x30')]['picklistValues'],function(_0x238133){return{'name':_0x238133['label'],'value':_0x238133[_0x9513('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x25fd8e,null))[_0x9513('0x48')](function(_0x1b88e4){console[_0x9513('0x72')](_0x9513('0x73')+_0x1b88e4);var _0x4dfd36=_0x489cdb[_0x9513('0x36')][_0x9513('0x74')]?0x1f4:_0x1b88e4[_0x9513('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9513('0x56'),_0x4dfd36,JSON['stringify'](_0x1b88e4));delete _0x1b88e4['name'];if(_0x4dfd36===0x191){_0x4dfd36=0x190;}_0x25fd8e[_0x9513('0x1e')](_0x4dfd36)['send'](_0x489cdb[_0x9513('0x36')]['test']?{'message':_0x9513('0x76'),'statusCode':_0x1b88e4['statusCode']}:_0x1b88e4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f7f5f2c..3c56a16 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 _0x81de=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f2422,_0x125fd2){var _0x4fb420=function(_0x1b8cc6){while(--_0x1b8cc6){_0x1f2422['push'](_0x1f2422['shift']());}};_0x4fb420(++_0x125fd2);}(_0x81de,0x70));var _0xe81d=function(_0x3b4fbe,_0x476304){_0x3b4fbe=_0x3b4fbe-0x0;var _0x5336ec=_0x81de[_0x3b4fbe];return _0x5336ec;};'use strict';var _=require(_0xe81d('0x0'));var util=require('util');var logger=require(_0xe81d('0x1'))(_0xe81d('0x2'));var moment=require(_0xe81d('0x3'));var BPromise=require(_0xe81d('0x4'));var rp=require(_0xe81d('0x5'));var fs=require('fs');var path=require(_0xe81d('0x6'));var rimraf=require(_0xe81d('0x7'));var config=require(_0xe81d('0x8'));var attributes=require(_0xe81d('0x9'));var integrations=require(_0xe81d('0xa'));module[_0xe81d('0xb')]=function(_0x1c9095,_0x5f2d9b){return _0x1c9095[_0xe81d('0xc')](_0xe81d('0xd'),attributes,{'tableName':_0xe81d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92dd=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x4a8c8e,_0x52362f){var _0x3846a7=function(_0x35a8ba){while(--_0x35a8ba){_0x4a8c8e['push'](_0x4a8c8e['shift']());}};_0x3846a7(++_0x52362f);}(_0x92dd,0x10b));var _0xd92d=function(_0x212bd4,_0x429dfd){_0x212bd4=_0x212bd4-0x0;var _0x2c197c=_0x92dd[_0x212bd4];return _0x2c197c;};'use strict';var _=require(_0xd92d('0x0'));var util=require(_0xd92d('0x1'));var logger=require(_0xd92d('0x2'))(_0xd92d('0x3'));var moment=require('moment');var BPromise=require(_0xd92d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd92d('0x5'));var rimraf=require(_0xd92d('0x6'));var config=require(_0xd92d('0x7'));var attributes=require(_0xd92d('0x8'));var integrations=require(_0xd92d('0x9'));module[_0xd92d('0xa')]=function(_0x339b04,_0x4b2296){return _0x339b04[_0xd92d('0xb')](_0xd92d('0xc'),attributes,{'tableName':_0xd92d('0xd'),'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 091a77a..cfd98a0 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 _0x1339=['stringify','error','code','message','result','catch','VtigerAccount','findAll','options','attributes','map','include','model','GetVtigerAccount','debug','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0x1339,0x1ed));var _0x9133=function(_0x2306f5,_0x5981c8){_0x2306f5=_0x2306f5-0x0;var _0x3f13e7=_0x1339[_0x2306f5];return _0x3f13e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['GetVtigerAccount']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')]({'raw':_0x1f3484['options']?_0x1f3484[_0x9133('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options']['where']||null:null,'attributes':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]||null:null,'limit':_0x1f3484['options']?_0x1f3484['options']['limit']||null:null,'include':_0x1f3484[_0x9133('0x19')]?_0x1f3484[_0x9133('0x19')]['include']?_[_0x9133('0x1b')](_0x1f3484[_0x9133('0x19')][_0x9133('0x1c')],function(_0x26190c){return{'model':db[_0x26190c['model']],'as':_0x26190c['as'],'attributes':_0x26190c[_0x9133('0x1a')],'include':_0x26190c['include']?_[_0x9133('0x1b')](_0x26190c[_0x9133('0x1c')],function(_0x3f278d){return{'model':db[_0x3f278d[_0x9133('0x1d')]],'as':_0x3f278d['as'],'attributes':_0x3f278d[_0x9133('0x1a')],'include':_0x3f278d[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x3f278d[_0x9133('0x1c')],function(_0x1b6b3e){return{'model':db[_0x1b6b3e[_0x9133('0x1d')]],'as':_0x1b6b3e['as'],'attributes':_0x1b6b3e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x477bf1){logger[_0x9133('0xd')](_0x9133('0x1e'),_0x1f3484);logger[_0x9133('0x1f')]('GetVtigerAccount',_0x1f3484,JSON['stringify'](_0x477bf1));_0x3c48ef(_0x477bf1);})[_0x9133('0x16')](function(_0x45966d){logger[_0x9133('0x12')](_0x9133('0x1e'),_0x45966d[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x45966d['message']));});});};exports['ShowVtigerAccount']=function(_0x5a27c1){var _0x1ad222=this;return new Promise(function(_0x4a4a8e,_0x43b5f3){return db[_0x9133('0x17')]['find']({'raw':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1['options'][_0x9133('0x20')]===undefined?!![]:![]:!![],'where':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')]['where']||null:null,'attributes':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1a')]||null:null,'include':_0x5a27c1['options']?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x5a27c1['options'][_0x9133('0x1c')],function(_0x20da68){return{'model':db[_0x20da68[_0x9133('0x1d')]],'as':_0x20da68['as'],'attributes':_0x20da68[_0x9133('0x1a')],'include':_0x20da68['include']?_[_0x9133('0x1b')](_0x20da68[_0x9133('0x1c')],function(_0x56719e){return{'model':db[_0x56719e[_0x9133('0x1d')]],'as':_0x56719e['as'],'attributes':_0x56719e[_0x9133('0x1a')],'include':_0x56719e[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x56719e[_0x9133('0x1c')],function(_0x2db377){return{'model':db[_0x2db377[_0x9133('0x1d')]],'as':_0x2db377['as'],'attributes':_0x2db377[_0x9133('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9133('0xc')](function(_0x335217){logger[_0x9133('0xd')]('ShowVtigerAccount',_0x5a27c1);logger[_0x9133('0x1f')](_0x9133('0x21'),_0x5a27c1,JSON['stringify'](_0x335217));_0x4a4a8e(_0x335217);})[_0x9133('0x16')](function(_0x3a2d1f){logger[_0x9133('0x12')](_0x9133('0x21'),_0x3a2d1f[_0x9133('0x14')],_0x5a27c1);_0x43b5f3(_0x1ad222[_0x9133('0x12')](0x1f4,_0x3a2d1f['message']));});});}; \ No newline at end of file +var _0xb9be=['VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','GetVtigerAccount'];(function(_0x4782f9,_0x674de){var _0x433e89=function(_0x385dcd){while(--_0x385dcd){_0x4782f9['push'](_0x4782f9['shift']());}};_0x433e89(++_0x674de);}(_0xb9be,0xc5));var _0xeb9b=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xb9be[_0x207811];return _0x170d56;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')]({'raw':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6['options']['where']||null:null,'attributes':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['attributes']||null:null,'limit':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1c')]||null:null,'include':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x46df93){return{'model':db[_0x46df93[_0xeb9b('0x1f')]],'as':_0x46df93['as'],'attributes':_0x46df93[_0xeb9b('0x20')],'include':_0x46df93[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x46df93[_0xeb9b('0x1d')],function(_0x434461){return{'model':db[_0x434461['model']],'as':_0x434461['as'],'attributes':_0x434461[_0xeb9b('0x20')],'include':_0x434461['include']?_[_0xeb9b('0x1e')](_0x434461['include'],function(_0x347ec1){return{'model':db[_0x347ec1[_0xeb9b('0x1f')]],'as':_0x347ec1['as'],'attributes':_0x347ec1[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb9b('0xd')](function(_0x52f6c1){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x52f6c1));_0x3cbe3e(_0x52f6c1);})['catch'](function(_0x2a4b51){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x2a4b51['message'],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x2a4b51['message']));});});};exports[_0xeb9b('0x21')]=function(_0x4c1331){var _0x411467=this;return new Promise(function(_0x54c659,_0x27578d){return db['VtigerAccount'][_0xeb9b('0x22')]({'raw':_0x4c1331['options']?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x23')]===undefined?!![]:![]:!![],'where':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x24')]||null:null,'attributes':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x20')]||null:null,'include':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')]['include']?_[_0xeb9b('0x1e')](_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x21ecfd){return{'model':db[_0x21ecfd[_0xeb9b('0x1f')]],'as':_0x21ecfd['as'],'attributes':_0x21ecfd[_0xeb9b('0x20')],'include':_0x21ecfd[_0xeb9b('0x1d')]?_['map'](_0x21ecfd[_0xeb9b('0x1d')],function(_0x2f3179){return{'model':db[_0x2f3179[_0xeb9b('0x1f')]],'as':_0x2f3179['as'],'attributes':_0x2f3179['attributes'],'include':_0x2f3179[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x2f3179[_0xeb9b('0x1d')],function(_0xab9ad5){return{'model':db[_0xab9ad5[_0xeb9b('0x1f')]],'as':_0xab9ad5['as'],'attributes':_0xab9ad5[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d235){logger[_0xeb9b('0xe')]('ShowVtigerAccount',_0x4c1331);logger[_0xeb9b('0x10')](_0xeb9b('0x21'),_0x4c1331,JSON[_0xeb9b('0x11')](_0x24d235));_0x54c659(_0x24d235);})[_0xeb9b('0x17')](function(_0x37c678){logger[_0xeb9b('0x12')](_0xeb9b('0x21'),_0x37c678['message'],_0x4c1331);_0x27578d(_0x411467[_0xeb9b('0x12')](0x1f4,_0x37c678[_0xeb9b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index b274efb..5bbbb23 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 _0x5eed=['isAuthenticated','getDescriptions','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','/:id/fields'];(function(_0x21f9b6,_0x5c1d3f){var _0x3dba48=function(_0x561a34){while(--_0x561a34){_0x21f9b6['push'](_0x21f9b6['shift']());}};_0x3dba48(++_0x5c1d3f);}(_0x5eed,0x15b));var _0xd5ee=function(_0x3a9787,_0x4e7085){_0x3a9787=_0x3a9787-0x0;var _0xd0bf99=_0x5eed[_0x3a9787];return _0xd0bf99;};'use strict';var multer=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var path=require('path');var timeout=require(_0xd5ee('0x2'));var express=require(_0xd5ee('0x3'));var router=express[_0xd5ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5ee('0x5'));var interaction=require(_0xd5ee('0x6'));var config=require(_0xd5ee('0x7'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd5ee('0x8')]);router[_0xd5ee('0x9')](_0xd5ee('0xa'),auth['isAuthenticated'](),controller[_0xd5ee('0xb')]);router[_0xd5ee('0x9')](_0xd5ee('0xc'),auth[_0xd5ee('0xd')](),controller['getFields']);router[_0xd5ee('0x9')]('/:id/subjects',auth[_0xd5ee('0xd')](),controller['getSubjects']);router[_0xd5ee('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd5ee('0xe')]);router[_0xd5ee('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd5ee('0x10')](_0xd5ee('0xa'),auth['isAuthenticated'](),controller[_0xd5ee('0x11')]);router[_0xd5ee('0x12')](_0xd5ee('0xa'),auth[_0xd5ee('0xd')](),controller[_0xd5ee('0x13')]);module['exports']=router; \ No newline at end of file +var _0x92d2=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','post','create','put','delete','destroy','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x92d2,0x9a));var _0x292d=function(_0x21521a,_0x51309e){_0x21521a=_0x21521a-0x0;var _0x3db020=_0x92d2[_0x21521a];return _0x3db020;};'use strict';var multer=require(_0x292d('0x0'));var util=require(_0x292d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x292d('0x2'));var router=express['Router']();var fs_extra=require(_0x292d('0x3'));var auth=require(_0x292d('0x4'));var interaction=require(_0x292d('0x5'));var config=require(_0x292d('0x6'));var controller=require(_0x292d('0x7'));router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller[_0x292d('0xa')]);router[_0x292d('0x8')](_0x292d('0xb'),auth['isAuthenticated'](),controller[_0x292d('0xc')]);router[_0x292d('0x8')](_0x292d('0xd'),auth[_0x292d('0x9')](),controller[_0x292d('0xe')]);router[_0x292d('0x8')]('/:id/subjects',auth[_0x292d('0x9')](),controller['getSubjects']);router[_0x292d('0x8')](_0x292d('0xf'),auth[_0x292d('0x9')](),controller['getDescriptions']);router[_0x292d('0x10')]('/',auth[_0x292d('0x9')](),controller[_0x292d('0x11')]);router[_0x292d('0x12')](_0x292d('0xb'),auth[_0x292d('0x9')](),controller['update']);router[_0x292d('0x13')]('/:id',auth[_0x292d('0x9')](),controller[_0x292d('0x14')]);module[_0x292d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index ceaf910..5253ae3 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 _0xb54c=['STRING','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb54c,0x14d));var _0xcb54=function(_0x3cb4e4,_0x41b1d2){_0x3cb4e4=_0x3cb4e4-0x0;var _0x34e13c=_0xb54c[_0x3cb4e4];return _0x34e13c;};'use strict';var Sequelize=require('sequelize');module[_0xcb54('0x0')]={'name':{'type':Sequelize[_0xcb54('0x1')]},'description':{'type':Sequelize[_0xcb54('0x1')]}}; \ No newline at end of file +var _0xd362=['sequelize','exports','STRING'];(function(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xd362,0xf3));var _0x2d36=function(_0x5bf493,_0x3c46bf){_0x5bf493=_0x5bf493-0x0;var _0x5e69b1=_0xd362[_0x5bf493];return _0x5e69b1;};'use strict';var Sequelize=require(_0x2d36('0x0'));module[_0x2d36('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d36('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index bc7fea3..b34ef05 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 _0x780c=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VtigerConfiguration','include','findAll','show','params','includeAll','find','create','body','catch','findOne','VtigerField','options','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x2d9da8,_0x521e7c){var _0x34ca6f=function(_0x426f77){while(--_0x426f77){_0x2d9da8['push'](_0x2d9da8['shift']());}};_0x34ca6f(++_0x521e7c);}(_0x780c,0x72));var _0xc780=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x780c[_0x235f49];return _0x551139;};'use strict';var emlformat=require(_0xc780('0x0'));var rimraf=require(_0xc780('0x1'));var zipdir=require(_0xc780('0x2'));var jsonpatch=require(_0xc780('0x3'));var rp=require(_0xc780('0x4'));var moment=require('moment');var BPromise=require(_0xc780('0x5'));var Mustache=require(_0xc780('0x6'));var util=require(_0xc780('0x7'));var path=require(_0xc780('0x8'));var sox=require(_0xc780('0x9'));var csv=require(_0xc780('0xa'));var ejs=require(_0xc780('0xb'));var fs=require('fs');var fs_extra=require(_0xc780('0xc'));var _=require(_0xc780('0xd'));var squel=require(_0xc780('0xe'));var crypto=require('crypto');var jsforce=require(_0xc780('0xf'));var deskjs=require(_0xc780('0x10'));var toCsv=require(_0xc780('0xa'));var querystring=require(_0xc780('0x11'));var Papa=require(_0xc780('0x12'));var Redis=require(_0xc780('0x13'));var authService=require(_0xc780('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc780('0x15'));var logger=require(_0xc780('0x16'))(_0xc780('0x17'));var utils=require('../../config/utils');var config=require(_0xc780('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc780('0x19'))['db'];function respondWithStatusCode(_0x3fd7e6,_0x46222e){_0x46222e=_0x46222e||0xcc;return function(_0x123fbd){if(_0x123fbd){return _0x3fd7e6[_0xc780('0x1a')](_0x46222e);}return _0x3fd7e6['status'](_0x46222e)[_0xc780('0x1b')]();};}function respondWithResult(_0x429ae4,_0xfbe616){_0xfbe616=_0xfbe616||0xc8;return function(_0x340d4c){if(_0x340d4c){return _0x429ae4[_0xc780('0x1c')](_0xfbe616)[_0xc780('0x1d')](_0x340d4c);}};}function respondWithFilteredResult(_0x228738,_0x181e38){return function(_0x4c75ba){if(_0x4c75ba){var _0x5211f4=typeof _0x181e38[_0xc780('0x1e')]==='undefined'&&typeof _0x181e38[_0xc780('0x1f')]==='undefined';var _0x3f7885=_0x4c75ba[_0xc780('0x20')];var _0x48bc11=_0x5211f4?0x0:_0x181e38[_0xc780('0x1e')];var _0x57277f=_0x5211f4?_0x4c75ba['count']:_0x181e38['offset']+_0x181e38[_0xc780('0x1f')];var _0xf2fad9;if(_0x57277f>=_0x3f7885){_0x57277f=_0x3f7885;_0xf2fad9=0xc8;}else{_0xf2fad9=0xce;}_0x228738['status'](_0xf2fad9);return _0x228738[_0xc780('0x21')](_0xc780('0x22'),_0x48bc11+'-'+_0x57277f+'/'+_0x3f7885)[_0xc780('0x1d')](_0x4c75ba);}return null;};}function patchUpdates(_0x2650fd){return function(_0x5260a3){try{jsonpatch[_0xc780('0x23')](_0x5260a3,_0x2650fd,!![]);}catch(_0x207de9){return BPromise[_0xc780('0x24')](_0x207de9);}return _0x5260a3['save']();};}function saveUpdates(_0x3c105d,_0x909032){return function(_0x5bd5b2){if(_0x5bd5b2){return _0x5bd5b2[_0xc780('0x25')](_0x3c105d)['then'](function(_0xdf793f){return _0xdf793f;});}return null;};}function removeEntity(_0x4ba992,_0x5b1541){return function(_0x3a78ed){if(_0x3a78ed){return _0x3a78ed[_0xc780('0x26')]()[_0xc780('0x27')](function(){_0x4ba992[_0xc780('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xee9d73,_0x1c41ca){return function(_0x836413){if(!_0x836413){_0xee9d73[_0xc780('0x1a')](0x194);}return _0x836413;};}function handleError(_0x3ab33b,_0x1ad72f){_0x1ad72f=_0x1ad72f||0x1f4;return function(_0x5e6afa){logger[_0xc780('0x28')](_0x5e6afa[_0xc780('0x29')]);if(_0x5e6afa[_0xc780('0x2a')]){delete _0x5e6afa[_0xc780('0x2a')];}_0x3ab33b['status'](_0x1ad72f)[_0xc780('0x2b')](_0x5e6afa);};}exports[_0xc780('0x2c')]=function(_0x150e1e,_0x493e3e){var _0x4d93c0={},_0x59549b={},_0x10d61f={'count':0x0,'rows':[]};var _0x1398e1=_[_0xc780('0x2d')](db['VtigerConfiguration'][_0xc780('0x2e')],function(_0x2ecce9){return{'name':_0x2ecce9[_0xc780('0x2f')],'type':_0x2ecce9[_0xc780('0x30')][_0xc780('0x31')]};});_0x59549b[_0xc780('0x32')]=_[_0xc780('0x2d')](_0x1398e1,_0xc780('0x2a'));_0x59549b[_0xc780('0x33')]=_[_0xc780('0x34')](_0x150e1e[_0xc780('0x33')]);_0x59549b[_0xc780('0x35')]=_[_0xc780('0x36')](_0x59549b['model'],_0x59549b[_0xc780('0x33')]);_0x4d93c0[_0xc780('0x37')]=_[_0xc780('0x36')](_0x59549b[_0xc780('0x32')],qs[_0xc780('0x38')](_0x150e1e[_0xc780('0x33')]['fields']));_0x4d93c0[_0xc780('0x37')]=_0x4d93c0[_0xc780('0x37')][_0xc780('0x39')]?_0x4d93c0[_0xc780('0x37')]:_0x59549b[_0xc780('0x32')];if(!_0x150e1e[_0xc780('0x33')][_0xc780('0x3a')](_0xc780('0x3b'))){_0x4d93c0[_0xc780('0x1f')]=qs[_0xc780('0x1f')](_0x150e1e[_0xc780('0x33')][_0xc780('0x1f')]);_0x4d93c0[_0xc780('0x1e')]=qs[_0xc780('0x1e')](_0x150e1e[_0xc780('0x33')][_0xc780('0x1e')]);}_0x4d93c0[_0xc780('0x3c')]=qs['sort'](_0x150e1e['query'][_0xc780('0x3d')]);_0x4d93c0['where']=qs[_0xc780('0x35')](_[_0xc780('0x3e')](_0x150e1e[_0xc780('0x33')],_0x59549b[_0xc780('0x35')]),_0x1398e1);if(_0x150e1e['query'][_0xc780('0x3f')]){_0x4d93c0[_0xc780('0x40')]=_[_0xc780('0x41')](_0x4d93c0[_0xc780('0x40')],{'$or':_[_0xc780('0x2d')](_0x1398e1,function(_0x5ffc17){if(_0x5ffc17[_0xc780('0x30')]!=='VIRTUAL'){var _0x4cbd37={};_0x4cbd37[_0x5ffc17['name']]={'$like':'%'+_0x150e1e[_0xc780('0x33')][_0xc780('0x3f')]+'%'};return _0x4cbd37;}})});}_0x4d93c0=_[_0xc780('0x41')]({},_0x4d93c0,_0x150e1e['options']);var _0x2eb637={'where':_0x4d93c0[_0xc780('0x40')]};return db[_0xc780('0x42')][_0xc780('0x20')](_0x2eb637)['then'](function(_0x40c1cc){_0x10d61f[_0xc780('0x20')]=_0x40c1cc;if(_0x150e1e[_0xc780('0x33')]['includeAll']){_0x4d93c0[_0xc780('0x43')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc780('0x44')](_0x4d93c0);})['then'](function(_0x1b592){_0x10d61f['rows']=_0x1b592;return _0x10d61f;})[_0xc780('0x27')](respondWithFilteredResult(_0x493e3e,_0x4d93c0))['catch'](handleError(_0x493e3e,null));};exports[_0xc780('0x45')]=function(_0x4815a0,_0x2154ed){var _0x276a54={'raw':![],'where':{'id':_0x4815a0[_0xc780('0x46')]['id']}},_0x5a623b={};_0x5a623b['model']=_[_0xc780('0x34')](db[_0xc780('0x42')][_0xc780('0x2e')]);_0x5a623b[_0xc780('0x33')]=_['keys'](_0x4815a0[_0xc780('0x33')]);_0x5a623b[_0xc780('0x35')]=_[_0xc780('0x36')](_0x5a623b[_0xc780('0x32')],_0x5a623b['query']);_0x276a54[_0xc780('0x37')]=_[_0xc780('0x36')](_0x5a623b[_0xc780('0x32')],qs[_0xc780('0x38')](_0x4815a0[_0xc780('0x33')][_0xc780('0x38')]));_0x276a54['attributes']=_0x276a54['attributes'][_0xc780('0x39')]?_0x276a54['attributes']:_0x5a623b[_0xc780('0x32')];if(_0x4815a0[_0xc780('0x33')][_0xc780('0x47')]){_0x276a54[_0xc780('0x43')]=[{'all':!![]}];}_0x276a54=_[_0xc780('0x41')]({},_0x276a54,_0x4815a0['options']);return db[_0xc780('0x42')][_0xc780('0x48')](_0x276a54)[_0xc780('0x27')](handleEntityNotFound(_0x2154ed,null))[_0xc780('0x27')](respondWithResult(_0x2154ed,null))['catch'](handleError(_0x2154ed,null));};exports[_0xc780('0x49')]=function(_0xedaaa2,_0x51059d){return db['VtigerConfiguration'][_0xc780('0x49')](_0xedaaa2[_0xc780('0x4a')],{})[_0xc780('0x27')](respondWithResult(_0x51059d,0xc9))[_0xc780('0x4b')](handleError(_0x51059d,null));};exports[_0xc780('0x25')]=function(_0x13358a,_0x36c135){if(_0x13358a[_0xc780('0x4a')]['id']){delete _0x13358a[_0xc780('0x4a')]['id'];}return db[_0xc780('0x42')][_0xc780('0x48')]({'where':{'id':_0x13358a[_0xc780('0x46')]['id']}})[_0xc780('0x27')](handleEntityNotFound(_0x36c135,null))['then'](saveUpdates(_0x13358a[_0xc780('0x4a')],null))['then'](respondWithResult(_0x36c135,null))[_0xc780('0x4b')](handleError(_0x36c135,null));};exports[_0xc780('0x26')]=function(_0x39ce06,_0x315f68){return db['VtigerConfiguration'][_0xc780('0x48')]({'where':{'id':_0x39ce06['params']['id']}})[_0xc780('0x27')](handleEntityNotFound(_0x315f68,null))[_0xc780('0x27')](removeEntity(_0x315f68,null))[_0xc780('0x4b')](handleError(_0x315f68,null));};exports['getFields']=function(_0xc6a2e0,_0xff2d57,_0x33b6ec){var _0x113ef8={};var _0xfce35a={};var _0x2e8f99;var _0x79c90e;return db[_0xc780('0x42')][_0xc780('0x4c')]({'where':{'id':_0xc6a2e0[_0xc780('0x46')]['id']}})[_0xc780('0x27')](handleEntityNotFound(_0xff2d57,null))[_0xc780('0x27')](function(_0x323db8){if(_0x323db8){_0x2e8f99=_0x323db8;_0xfce35a[_0xc780('0x32')]=_[_0xc780('0x34')](db[_0xc780('0x4d')][_0xc780('0x2e')]);_0xfce35a[_0xc780('0x33')]=_[_0xc780('0x34')](_0xc6a2e0['query']);_0xfce35a[_0xc780('0x35')]=_[_0xc780('0x36')](_0xfce35a[_0xc780('0x32')],_0xfce35a[_0xc780('0x33')]);_0x113ef8[_0xc780('0x37')]=_[_0xc780('0x36')](_0xfce35a[_0xc780('0x32')],qs[_0xc780('0x38')](_0xc6a2e0[_0xc780('0x33')][_0xc780('0x38')]));_0x113ef8['attributes']=_0x113ef8[_0xc780('0x37')]['length']?_0x113ef8['attributes']:_0xfce35a[_0xc780('0x32')];_0x113ef8['order']=qs[_0xc780('0x3d')](_0xc6a2e0[_0xc780('0x33')][_0xc780('0x3d')]);_0x113ef8[_0xc780('0x40')]=qs['filters'](_['pick'](_0xc6a2e0['query'],_0xfce35a[_0xc780('0x35')]));if(_0xc6a2e0[_0xc780('0x33')]['filter']){_0x113ef8[_0xc780('0x40')]=_[_0xc780('0x41')](_0x113ef8[_0xc780('0x40')],{'$or':_[_0xc780('0x2d')](_0x113ef8[_0xc780('0x37')],function(_0x277f4b){var _0x3c2b61={};_0x3c2b61[_0x277f4b]={'$like':'%'+_0xc6a2e0[_0xc780('0x33')][_0xc780('0x3f')]+'%'};return _0x3c2b61;})});}_0x113ef8=_['merge']({},_0x113ef8,_0xc6a2e0[_0xc780('0x4e')]);return _0x2e8f99[_0xc780('0x4f')](_0x113ef8);}})['then'](function(_0x21c545){if(_0x21c545){_0x79c90e=_0x21c545['length'];if(!_0xc6a2e0['query'][_0xc780('0x3a')](_0xc780('0x3b'))){_0x113ef8[_0xc780('0x1f')]=qs['limit'](_0xc6a2e0[_0xc780('0x33')][_0xc780('0x1f')]);_0x113ef8['offset']=qs['offset'](_0xc6a2e0[_0xc780('0x33')][_0xc780('0x1e')]);}return _0x2e8f99[_0xc780('0x4f')](_0x113ef8);}})[_0xc780('0x27')](function(_0x4bde06){if(_0x4bde06){return _0x4bde06?{'count':_0x79c90e,'rows':_0x4bde06}:null;}})[_0xc780('0x27')](respondWithResult(_0xff2d57,null))[_0xc780('0x4b')](handleError(_0xff2d57,null));};exports[_0xc780('0x50')]=function(_0x528c94,_0x46f036,_0x40826a){var _0x3b3305={};var _0x2af0e3={};var _0x1cfd91;var _0x19d93d;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x528c94['params']['id']}})[_0xc780('0x27')](handleEntityNotFound(_0x46f036,null))[_0xc780('0x27')](function(_0x34eeac){if(_0x34eeac){_0x1cfd91=_0x34eeac;_0x2af0e3[_0xc780('0x32')]=_[_0xc780('0x34')](db[_0xc780('0x4d')][_0xc780('0x2e')]);_0x2af0e3[_0xc780('0x33')]=_[_0xc780('0x34')](_0x528c94[_0xc780('0x33')]);_0x2af0e3['filters']=_[_0xc780('0x36')](_0x2af0e3[_0xc780('0x32')],_0x2af0e3['query']);_0x3b3305[_0xc780('0x37')]=_['intersection'](_0x2af0e3[_0xc780('0x32')],qs['fields'](_0x528c94['query']['fields']));_0x3b3305[_0xc780('0x37')]=_0x3b3305[_0xc780('0x37')]['length']?_0x3b3305[_0xc780('0x37')]:_0x2af0e3[_0xc780('0x32')];_0x3b3305[_0xc780('0x3c')]=qs['sort'](_0x528c94[_0xc780('0x33')][_0xc780('0x3d')]);_0x3b3305[_0xc780('0x40')]=qs['filters'](_[_0xc780('0x3e')](_0x528c94[_0xc780('0x33')],_0x2af0e3[_0xc780('0x35')]));if(_0x528c94[_0xc780('0x33')][_0xc780('0x3f')]){_0x3b3305['where']=_[_0xc780('0x41')](_0x3b3305[_0xc780('0x40')],{'$or':_['map'](_0x3b3305['attributes'],function(_0x4e2950){var _0xad45aa={};_0xad45aa[_0x4e2950]={'$like':'%'+_0x528c94['query'][_0xc780('0x3f')]+'%'};return _0xad45aa;})});}_0x3b3305=_[_0xc780('0x41')]({},_0x3b3305,_0x528c94[_0xc780('0x4e')]);return _0x1cfd91[_0xc780('0x50')](_0x3b3305);}})['then'](function(_0x588ef8){if(_0x588ef8){_0x19d93d=_0x588ef8['length'];if(!_0x528c94[_0xc780('0x33')][_0xc780('0x3a')](_0xc780('0x3b'))){_0x3b3305['limit']=qs[_0xc780('0x1f')](_0x528c94[_0xc780('0x33')][_0xc780('0x1f')]);_0x3b3305[_0xc780('0x1e')]=qs[_0xc780('0x1e')](_0x528c94[_0xc780('0x33')]['offset']);}return _0x1cfd91['getSubjects'](_0x3b3305);}})[_0xc780('0x27')](function(_0x247aa1){if(_0x247aa1){return _0x247aa1?{'count':_0x19d93d,'rows':_0x247aa1}:null;}})[_0xc780('0x27')](respondWithResult(_0x46f036,null))[_0xc780('0x4b')](handleError(_0x46f036,null));};exports['getDescriptions']=function(_0x1143c9,_0x3de771,_0x2ae7a5){var _0x40421b={};var _0x3f8ab8={};var _0x5867bf;var _0x5244a3;return db[_0xc780('0x42')][_0xc780('0x4c')]({'where':{'id':_0x1143c9['params']['id']}})[_0xc780('0x27')](handleEntityNotFound(_0x3de771,null))['then'](function(_0x473dca){if(_0x473dca){_0x5867bf=_0x473dca;_0x3f8ab8[_0xc780('0x32')]=_[_0xc780('0x34')](db[_0xc780('0x4d')][_0xc780('0x2e')]);_0x3f8ab8[_0xc780('0x33')]=_['keys'](_0x1143c9[_0xc780('0x33')]);_0x3f8ab8[_0xc780('0x35')]=_[_0xc780('0x36')](_0x3f8ab8[_0xc780('0x32')],_0x3f8ab8[_0xc780('0x33')]);_0x40421b['attributes']=_['intersection'](_0x3f8ab8[_0xc780('0x32')],qs[_0xc780('0x38')](_0x1143c9[_0xc780('0x33')][_0xc780('0x38')]));_0x40421b[_0xc780('0x37')]=_0x40421b['attributes']['length']?_0x40421b[_0xc780('0x37')]:_0x3f8ab8[_0xc780('0x32')];_0x40421b['order']=qs['sort'](_0x1143c9['query'][_0xc780('0x3d')]);_0x40421b['where']=qs['filters'](_[_0xc780('0x3e')](_0x1143c9['query'],_0x3f8ab8[_0xc780('0x35')]));if(_0x1143c9['query'][_0xc780('0x3f')]){_0x40421b[_0xc780('0x40')]=_[_0xc780('0x41')](_0x40421b[_0xc780('0x40')],{'$or':_[_0xc780('0x2d')](_0x40421b['attributes'],function(_0xfcc9e0){var _0x29969d={};_0x29969d[_0xfcc9e0]={'$like':'%'+_0x1143c9[_0xc780('0x33')][_0xc780('0x3f')]+'%'};return _0x29969d;})});}_0x40421b=_[_0xc780('0x41')]({},_0x40421b,_0x1143c9[_0xc780('0x4e')]);return _0x5867bf[_0xc780('0x51')](_0x40421b);}})[_0xc780('0x27')](function(_0x3e4afd){if(_0x3e4afd){_0x5244a3=_0x3e4afd[_0xc780('0x39')];if(!_0x1143c9[_0xc780('0x33')][_0xc780('0x3a')]('nolimit')){_0x40421b[_0xc780('0x1f')]=qs[_0xc780('0x1f')](_0x1143c9[_0xc780('0x33')][_0xc780('0x1f')]);_0x40421b[_0xc780('0x1e')]=qs['offset'](_0x1143c9[_0xc780('0x33')][_0xc780('0x1e')]);}return _0x5867bf['getDescriptions'](_0x40421b);}})[_0xc780('0x27')](function(_0x4617a9){if(_0x4617a9){return _0x4617a9?{'count':_0x5244a3,'rows':_0x4617a9}:null;}})['then'](respondWithResult(_0x3de771,null))[_0xc780('0x4b')](handleError(_0x3de771,null));}; \ No newline at end of file +var _0x124a=['fields','length','hasOwnProperty','order','sort','where','filter','merge','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','findOne','VtigerField','pick','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','offset','count','set','Content-Range','reject','sendStatus','stack','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes'];(function(_0x204ed6,_0x4cb63f){var _0x4c0f1a=function(_0x53e2ef){while(--_0x53e2ef){_0x204ed6['push'](_0x204ed6['shift']());}};_0x4c0f1a(++_0x4cb63f);}(_0x124a,0x1a6));var _0xa124=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x124a[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0xa124('0x0'));var rimraf=require(_0xa124('0x1'));var zipdir=require(_0xa124('0x2'));var jsonpatch=require(_0xa124('0x3'));var rp=require('request-promise');var moment=require(_0xa124('0x4'));var BPromise=require(_0xa124('0x5'));var Mustache=require(_0xa124('0x6'));var util=require(_0xa124('0x7'));var path=require('path');var sox=require(_0xa124('0x8'));var csv=require(_0xa124('0x9'));var ejs=require(_0xa124('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa124('0xb'));var squel=require(_0xa124('0xc'));var crypto=require(_0xa124('0xd'));var jsforce=require(_0xa124('0xe'));var deskjs=require(_0xa124('0xf'));var toCsv=require(_0xa124('0x9'));var querystring=require(_0xa124('0x10'));var Papa=require(_0xa124('0x11'));var Redis=require(_0xa124('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa124('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa124('0x14'));var logger=require(_0xa124('0x15'))(_0xa124('0x16'));var utils=require(_0xa124('0x17'));var config=require(_0xa124('0x18'));var licenseUtil=require(_0xa124('0x19'));var db=require(_0xa124('0x1a'))['db'];function respondWithStatusCode(_0x2bdeb8,_0x4ab646){_0x4ab646=_0x4ab646||0xcc;return function(_0x4c8300){if(_0x4c8300){return _0x2bdeb8['sendStatus'](_0x4ab646);}return _0x2bdeb8[_0xa124('0x1b')](_0x4ab646)[_0xa124('0x1c')]();};}function respondWithResult(_0x4e12ed,_0x101bb7){_0x101bb7=_0x101bb7||0xc8;return function(_0x35380d){if(_0x35380d){return _0x4e12ed[_0xa124('0x1b')](_0x101bb7)[_0xa124('0x1d')](_0x35380d);}};}function respondWithFilteredResult(_0x56c3c5,_0x1dc617){return function(_0x135de6){if(_0x135de6){var _0x5c40ab=typeof _0x1dc617['offset']==='undefined'&&typeof _0x1dc617[_0xa124('0x1e')]==='undefined';var _0x4c57b2=_0x135de6['count'];var _0x9f039a=_0x5c40ab?0x0:_0x1dc617[_0xa124('0x1f')];var _0x415b01=_0x5c40ab?_0x135de6[_0xa124('0x20')]:_0x1dc617[_0xa124('0x1f')]+_0x1dc617[_0xa124('0x1e')];var _0x259837;if(_0x415b01>=_0x4c57b2){_0x415b01=_0x4c57b2;_0x259837=0xc8;}else{_0x259837=0xce;}_0x56c3c5['status'](_0x259837);return _0x56c3c5[_0xa124('0x21')](_0xa124('0x22'),_0x9f039a+'-'+_0x415b01+'/'+_0x4c57b2)[_0xa124('0x1d')](_0x135de6);}return null;};}function patchUpdates(_0x169bc1){return function(_0x251603){try{jsonpatch['apply'](_0x251603,_0x169bc1,!![]);}catch(_0x5bd720){return BPromise[_0xa124('0x23')](_0x5bd720);}return _0x251603['save']();};}function saveUpdates(_0x52f34e,_0x29319e){return function(_0x20c5c6){if(_0x20c5c6){return _0x20c5c6['update'](_0x52f34e)['then'](function(_0x2e655b){return _0x2e655b;});}return null;};}function removeEntity(_0x364d1c,_0x5cb067){return function(_0x1d48aa){if(_0x1d48aa){return _0x1d48aa['destroy']()['then'](function(){_0x364d1c[_0xa124('0x1b')](0xcc)[_0xa124('0x1c')]();});}};}function handleEntityNotFound(_0x5b255a,_0xe2db63){return function(_0xae7092){if(!_0xae7092){_0x5b255a[_0xa124('0x24')](0x194);}return _0xae7092;};}function handleError(_0x1fcd3c,_0x31e121){_0x31e121=_0x31e121||0x1f4;return function(_0x36e2c6){logger['error'](_0x36e2c6[_0xa124('0x25')]);if(_0x36e2c6['name']){delete _0x36e2c6['name'];}_0x1fcd3c['status'](_0x31e121)[_0xa124('0x26')](_0x36e2c6);};}exports[_0xa124('0x27')]=function(_0x19ce48,_0x265e07){var _0x3a64af={},_0x1d3d30={},_0x4b15ba={'count':0x0,'rows':[]};var _0x5edbe9=_[_0xa124('0x28')](db[_0xa124('0x29')][_0xa124('0x2a')],function(_0x5a9c75){return{'name':_0x5a9c75[_0xa124('0x2b')],'type':_0x5a9c75[_0xa124('0x2c')]['key']};});_0x1d3d30[_0xa124('0x2d')]=_[_0xa124('0x28')](_0x5edbe9,_0xa124('0x2e'));_0x1d3d30[_0xa124('0x2f')]=_[_0xa124('0x30')](_0x19ce48[_0xa124('0x2f')]);_0x1d3d30[_0xa124('0x31')]=_[_0xa124('0x32')](_0x1d3d30[_0xa124('0x2d')],_0x1d3d30['query']);_0x3a64af[_0xa124('0x33')]=_['intersection'](_0x1d3d30[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x19ce48[_0xa124('0x2f')][_0xa124('0x34')]));_0x3a64af[_0xa124('0x33')]=_0x3a64af[_0xa124('0x33')][_0xa124('0x35')]?_0x3a64af[_0xa124('0x33')]:_0x1d3d30[_0xa124('0x2d')];if(!_0x19ce48[_0xa124('0x2f')][_0xa124('0x36')]('nolimit')){_0x3a64af[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0x19ce48['query']['limit']);_0x3a64af['offset']=qs[_0xa124('0x1f')](_0x19ce48['query'][_0xa124('0x1f')]);}_0x3a64af[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x19ce48[_0xa124('0x2f')][_0xa124('0x38')]);_0x3a64af[_0xa124('0x39')]=qs[_0xa124('0x31')](_['pick'](_0x19ce48[_0xa124('0x2f')],_0x1d3d30[_0xa124('0x31')]),_0x5edbe9);if(_0x19ce48['query'][_0xa124('0x3a')]){_0x3a64af[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x3a64af[_0xa124('0x39')],{'$or':_['map'](_0x5edbe9,function(_0x234a80){if(_0x234a80[_0xa124('0x2c')]!=='VIRTUAL'){var _0x1f8f23={};_0x1f8f23[_0x234a80[_0xa124('0x2e')]]={'$like':'%'+_0x19ce48[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x1f8f23;}})});}_0x3a64af=_[_0xa124('0x3b')]({},_0x3a64af,_0x19ce48['options']);var _0x536996={'where':_0x3a64af[_0xa124('0x39')]};return db[_0xa124('0x29')]['count'](_0x536996)[_0xa124('0x3c')](function(_0x4fcc95){_0x4b15ba['count']=_0x4fcc95;if(_0x19ce48[_0xa124('0x2f')][_0xa124('0x3d')]){_0x3a64af[_0xa124('0x3e')]=[{'all':!![]}];}return db[_0xa124('0x29')][_0xa124('0x3f')](_0x3a64af);})[_0xa124('0x3c')](function(_0x1579aa){_0x4b15ba[_0xa124('0x40')]=_0x1579aa;return _0x4b15ba;})[_0xa124('0x3c')](respondWithFilteredResult(_0x265e07,_0x3a64af))['catch'](handleError(_0x265e07,null));};exports[_0xa124('0x41')]=function(_0x3ad8c9,_0x1ec81f){var _0x334e76={'raw':![],'where':{'id':_0x3ad8c9[_0xa124('0x42')]['id']}},_0x5ad377={};_0x5ad377[_0xa124('0x2d')]=_[_0xa124('0x30')](db[_0xa124('0x29')][_0xa124('0x2a')]);_0x5ad377[_0xa124('0x2f')]=_[_0xa124('0x30')](_0x3ad8c9[_0xa124('0x2f')]);_0x5ad377[_0xa124('0x31')]=_[_0xa124('0x32')](_0x5ad377['model'],_0x5ad377[_0xa124('0x2f')]);_0x334e76[_0xa124('0x33')]=_[_0xa124('0x32')](_0x5ad377[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x3ad8c9[_0xa124('0x2f')]['fields']));_0x334e76[_0xa124('0x33')]=_0x334e76[_0xa124('0x33')][_0xa124('0x35')]?_0x334e76['attributes']:_0x5ad377['model'];if(_0x3ad8c9[_0xa124('0x2f')][_0xa124('0x3d')]){_0x334e76['include']=[{'all':!![]}];}_0x334e76=_['merge']({},_0x334e76,_0x3ad8c9[_0xa124('0x43')]);return db[_0xa124('0x29')]['find'](_0x334e76)['then'](handleEntityNotFound(_0x1ec81f,null))[_0xa124('0x3c')](respondWithResult(_0x1ec81f,null))[_0xa124('0x44')](handleError(_0x1ec81f,null));};exports[_0xa124('0x45')]=function(_0x3327e3,_0x44432c){return db['VtigerConfiguration']['create'](_0x3327e3[_0xa124('0x46')],{})['then'](respondWithResult(_0x44432c,0xc9))[_0xa124('0x44')](handleError(_0x44432c,null));};exports['update']=function(_0x4cf464,_0x39a594){if(_0x4cf464[_0xa124('0x46')]['id']){delete _0x4cf464[_0xa124('0x46')]['id'];}return db[_0xa124('0x29')][_0xa124('0x47')]({'where':{'id':_0x4cf464[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x39a594,null))[_0xa124('0x3c')](saveUpdates(_0x4cf464[_0xa124('0x46')],null))[_0xa124('0x3c')](respondWithResult(_0x39a594,null))[_0xa124('0x44')](handleError(_0x39a594,null));};exports['destroy']=function(_0x3b54b4,_0x4b8e97){return db['VtigerConfiguration'][_0xa124('0x47')]({'where':{'id':_0x3b54b4['params']['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x4b8e97,null))[_0xa124('0x3c')](removeEntity(_0x4b8e97,null))[_0xa124('0x44')](handleError(_0x4b8e97,null));};exports['getFields']=function(_0xcab365,_0x339569,_0x3b8d82){var _0x5519d3={};var _0x1eb90e={};var _0x38c557;var _0x1bd006;return db[_0xa124('0x29')][_0xa124('0x48')]({'where':{'id':_0xcab365['params']['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x339569,null))[_0xa124('0x3c')](function(_0x4bf607){if(_0x4bf607){_0x38c557=_0x4bf607;_0x1eb90e[_0xa124('0x2d')]=_[_0xa124('0x30')](db[_0xa124('0x49')]['rawAttributes']);_0x1eb90e[_0xa124('0x2f')]=_['keys'](_0xcab365[_0xa124('0x2f')]);_0x1eb90e['filters']=_[_0xa124('0x32')](_0x1eb90e[_0xa124('0x2d')],_0x1eb90e[_0xa124('0x2f')]);_0x5519d3[_0xa124('0x33')]=_[_0xa124('0x32')](_0x1eb90e['model'],qs[_0xa124('0x34')](_0xcab365['query'][_0xa124('0x34')]));_0x5519d3[_0xa124('0x33')]=_0x5519d3[_0xa124('0x33')][_0xa124('0x35')]?_0x5519d3[_0xa124('0x33')]:_0x1eb90e[_0xa124('0x2d')];_0x5519d3[_0xa124('0x37')]=qs[_0xa124('0x38')](_0xcab365[_0xa124('0x2f')][_0xa124('0x38')]);_0x5519d3[_0xa124('0x39')]=qs[_0xa124('0x31')](_[_0xa124('0x4a')](_0xcab365[_0xa124('0x2f')],_0x1eb90e['filters']));if(_0xcab365[_0xa124('0x2f')]['filter']){_0x5519d3[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x5519d3[_0xa124('0x39')],{'$or':_[_0xa124('0x28')](_0x5519d3[_0xa124('0x33')],function(_0x133650){var _0x12d952={};_0x12d952[_0x133650]={'$like':'%'+_0xcab365[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x12d952;})});}_0x5519d3=_[_0xa124('0x3b')]({},_0x5519d3,_0xcab365[_0xa124('0x43')]);return _0x38c557[_0xa124('0x4b')](_0x5519d3);}})['then'](function(_0x4a0fd7){if(_0x4a0fd7){_0x1bd006=_0x4a0fd7[_0xa124('0x35')];if(!_0xcab365[_0xa124('0x2f')]['hasOwnProperty'](_0xa124('0x4c'))){_0x5519d3[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0xcab365['query'][_0xa124('0x1e')]);_0x5519d3[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0xcab365[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x38c557['getFields'](_0x5519d3);}})[_0xa124('0x3c')](function(_0xe97116){if(_0xe97116){return _0xe97116?{'count':_0x1bd006,'rows':_0xe97116}:null;}})[_0xa124('0x3c')](respondWithResult(_0x339569,null))['catch'](handleError(_0x339569,null));};exports[_0xa124('0x4d')]=function(_0x144b66,_0x5b4466,_0x100ff0){var _0x2f43f4={};var _0x3540fe={};var _0x3ac944;var _0x578802;return db[_0xa124('0x29')][_0xa124('0x48')]({'where':{'id':_0x144b66[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x5b4466,null))['then'](function(_0x4219b8){if(_0x4219b8){_0x3ac944=_0x4219b8;_0x3540fe[_0xa124('0x2d')]=_['keys'](db[_0xa124('0x49')][_0xa124('0x2a')]);_0x3540fe['query']=_['keys'](_0x144b66['query']);_0x3540fe[_0xa124('0x31')]=_['intersection'](_0x3540fe[_0xa124('0x2d')],_0x3540fe[_0xa124('0x2f')]);_0x2f43f4[_0xa124('0x33')]=_[_0xa124('0x32')](_0x3540fe[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x144b66[_0xa124('0x2f')][_0xa124('0x34')]));_0x2f43f4[_0xa124('0x33')]=_0x2f43f4[_0xa124('0x33')]['length']?_0x2f43f4[_0xa124('0x33')]:_0x3540fe[_0xa124('0x2d')];_0x2f43f4[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x144b66[_0xa124('0x2f')]['sort']);_0x2f43f4['where']=qs[_0xa124('0x31')](_[_0xa124('0x4a')](_0x144b66[_0xa124('0x2f')],_0x3540fe[_0xa124('0x31')]));if(_0x144b66['query'][_0xa124('0x3a')]){_0x2f43f4[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x2f43f4[_0xa124('0x39')],{'$or':_[_0xa124('0x28')](_0x2f43f4[_0xa124('0x33')],function(_0x30b489){var _0x4db605={};_0x4db605[_0x30b489]={'$like':'%'+_0x144b66['query']['filter']+'%'};return _0x4db605;})});}_0x2f43f4=_['merge']({},_0x2f43f4,_0x144b66[_0xa124('0x43')]);return _0x3ac944[_0xa124('0x4d')](_0x2f43f4);}})[_0xa124('0x3c')](function(_0x4c4d05){if(_0x4c4d05){_0x578802=_0x4c4d05[_0xa124('0x35')];if(!_0x144b66['query'][_0xa124('0x36')](_0xa124('0x4c'))){_0x2f43f4['limit']=qs['limit'](_0x144b66[_0xa124('0x2f')][_0xa124('0x1e')]);_0x2f43f4[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0x144b66[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x3ac944[_0xa124('0x4d')](_0x2f43f4);}})[_0xa124('0x3c')](function(_0x1c3bf2){if(_0x1c3bf2){return _0x1c3bf2?{'count':_0x578802,'rows':_0x1c3bf2}:null;}})[_0xa124('0x3c')](respondWithResult(_0x5b4466,null))[_0xa124('0x44')](handleError(_0x5b4466,null));};exports[_0xa124('0x4e')]=function(_0x1d05b3,_0x373d55,_0x187763){var _0x24eb3b={};var _0x59ec1c={};var _0x2c7173;var _0x1130f0;return db['VtigerConfiguration'][_0xa124('0x48')]({'where':{'id':_0x1d05b3[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x373d55,null))[_0xa124('0x3c')](function(_0x563bf2){if(_0x563bf2){_0x2c7173=_0x563bf2;_0x59ec1c['model']=_['keys'](db[_0xa124('0x49')]['rawAttributes']);_0x59ec1c[_0xa124('0x2f')]=_['keys'](_0x1d05b3[_0xa124('0x2f')]);_0x59ec1c[_0xa124('0x31')]=_[_0xa124('0x32')](_0x59ec1c['model'],_0x59ec1c[_0xa124('0x2f')]);_0x24eb3b[_0xa124('0x33')]=_['intersection'](_0x59ec1c['model'],qs[_0xa124('0x34')](_0x1d05b3[_0xa124('0x2f')][_0xa124('0x34')]));_0x24eb3b[_0xa124('0x33')]=_0x24eb3b[_0xa124('0x33')][_0xa124('0x35')]?_0x24eb3b[_0xa124('0x33')]:_0x59ec1c[_0xa124('0x2d')];_0x24eb3b[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x1d05b3['query'][_0xa124('0x38')]);_0x24eb3b[_0xa124('0x39')]=qs['filters'](_['pick'](_0x1d05b3['query'],_0x59ec1c[_0xa124('0x31')]));if(_0x1d05b3[_0xa124('0x2f')]['filter']){_0x24eb3b[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x24eb3b['where'],{'$or':_[_0xa124('0x28')](_0x24eb3b[_0xa124('0x33')],function(_0x20f799){var _0x265633={};_0x265633[_0x20f799]={'$like':'%'+_0x1d05b3[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x265633;})});}_0x24eb3b=_[_0xa124('0x3b')]({},_0x24eb3b,_0x1d05b3[_0xa124('0x43')]);return _0x2c7173[_0xa124('0x4e')](_0x24eb3b);}})[_0xa124('0x3c')](function(_0xdf55a){if(_0xdf55a){_0x1130f0=_0xdf55a[_0xa124('0x35')];if(!_0x1d05b3[_0xa124('0x2f')]['hasOwnProperty'](_0xa124('0x4c'))){_0x24eb3b[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0x1d05b3['query'][_0xa124('0x1e')]);_0x24eb3b[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0x1d05b3[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x2c7173[_0xa124('0x4e')](_0x24eb3b);}})[_0xa124('0x3c')](function(_0x37249f){if(_0x37249f){return _0x37249f?{'count':_0x1130f0,'rows':_0x37249f}:null;}})['then'](respondWithResult(_0x373d55,null))[_0xa124('0x44')](handleError(_0x373d55,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1a91ef3..95f7d19 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 _0x46d1=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2bf15c,_0x142553){var _0x4afe96=function(_0x17c5f9){while(--_0x17c5f9){_0x2bf15c['push'](_0x2bf15c['shift']());}};_0x4afe96(++_0x142553);}(_0x46d1,0x157));var _0x146d=function(_0x599a4f,_0x328f44){_0x599a4f=_0x599a4f-0x0;var _0x1190b2=_0x46d1[_0x599a4f];return _0x1190b2;};'use strict';var _=require(_0x146d('0x0'));var util=require(_0x146d('0x1'));var logger=require(_0x146d('0x2'))(_0x146d('0x3'));var moment=require('moment');var BPromise=require(_0x146d('0x4'));var rp=require(_0x146d('0x5'));var fs=require('fs');var path=require(_0x146d('0x6'));var rimraf=require(_0x146d('0x7'));var config=require(_0x146d('0x8'));var attributes=require(_0x146d('0x9'));module[_0x146d('0xa')]=function(_0xd90134,_0x30654d){return _0xd90134[_0x146d('0xb')](_0x146d('0xc'),attributes,{'tableName':_0x146d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d80=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash'];(function(_0x186d1c,_0x5d29e2){var _0x5ca1a1=function(_0x5b3cf2){while(--_0x5b3cf2){_0x186d1c['push'](_0x186d1c['shift']());}};_0x5ca1a1(++_0x5d29e2);}(_0x1d80,0x1af));var _0x01d8=function(_0x271bf7,_0x317f07){_0x271bf7=_0x271bf7-0x0;var _0x153266=_0x1d80[_0x271bf7];return _0x153266;};'use strict';var _=require(_0x01d8('0x0'));var util=require(_0x01d8('0x1'));var logger=require('../../config/logger')(_0x01d8('0x2'));var moment=require(_0x01d8('0x3'));var BPromise=require(_0x01d8('0x4'));var rp=require(_0x01d8('0x5'));var fs=require('fs');var path=require(_0x01d8('0x6'));var rimraf=require(_0x01d8('0x7'));var config=require(_0x01d8('0x8'));var attributes=require(_0x01d8('0x9'));module[_0x01d8('0xa')]=function(_0x254401,_0x51fea1){return _0x254401['define'](_0x01d8('0xb'),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 4e02cff..136097d 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 _0x9675=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x2513fb,_0x2d2ae7){var _0x59f9d9=function(_0x5e5ac1){while(--_0x5e5ac1){_0x2513fb['push'](_0x2513fb['shift']());}};_0x59f9d9(++_0x2d2ae7);}(_0x9675,0xd1));var _0x5967=function(_0x59a6e7,_0x91a92d){_0x59a6e7=_0x59a6e7-0x0;var _0x2d2757=_0x9675[_0x59a6e7];return _0x2d2757;};'use strict';var _=require(_0x5967('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5967('0x1'));var fs=require('fs');var Redis=require(_0x5967('0x2'));var db=require(_0x5967('0x3'))['db'];var utils=require(_0x5967('0x4'));var logger=require(_0x5967('0x5'))(_0x5967('0x6'));var config=require('../../config/environment');var jayson=require(_0x5967('0x7'));var client=jayson['client'][_0x5967('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd02bb7,_0x460c8f,_0x219c4c){return new BPromise(function(_0x3bdd4a,_0x45d313){return client[_0x5967('0x9')](_0xd02bb7,_0x219c4c)[_0x5967('0xa')](function(_0x46ee39){logger['info'](_0x5967('0xb'),_0x460c8f,_0x5967('0xc'));logger[_0x5967('0xd')](_0x5967('0xe'),_0x460c8f,_0x5967('0xc'),JSON['stringify'](_0x46ee39));if(_0x46ee39['error']){if(_0x46ee39['error'][_0x5967('0xf')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x460c8f,_0x46ee39[_0x5967('0x10')][_0x5967('0x11')]);return _0x45d313(_0x46ee39[_0x5967('0x10')]['message']);}logger[_0x5967('0x10')](_0x5967('0xb'),_0x460c8f,_0x46ee39[_0x5967('0x10')][_0x5967('0x11')]);return _0x3bdd4a(_0x46ee39['error'][_0x5967('0x11')]);}else{logger[_0x5967('0x12')](_0x5967('0xb'),_0x460c8f,_0x5967('0xc'));_0x3bdd4a(_0x46ee39[_0x5967('0x13')][_0x5967('0x11')]);}})['catch'](function(_0x1314d4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x460c8f,_0x1314d4);_0x45d313(_0x1314d4);});});} \ No newline at end of file +var _0xf76c=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bb476,_0x495043){var _0x1a548d=function(_0x1655ff){while(--_0x1655ff){_0x2bb476['push'](_0x2bb476['shift']());}};_0x1a548d(++_0x495043);}(_0xf76c,0x1b9));var _0xcf76=function(_0x320e94,_0x4140b1){_0x320e94=_0x320e94-0x0;var _0x1002be=_0xf76c[_0x320e94];return _0x1002be;};'use strict';var _=require(_0xcf76('0x0'));var util=require('util');var moment=require(_0xcf76('0x1'));var BPromise=require(_0xcf76('0x2'));var rs=require(_0xcf76('0x3'));var fs=require('fs');var Redis=require(_0xcf76('0x4'));var db=require(_0xcf76('0x5'))['db'];var utils=require(_0xcf76('0x6'));var logger=require(_0xcf76('0x7'))(_0xcf76('0x8'));var config=require(_0xcf76('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e1a8,_0x5517ad,_0x2e9b86){return new BPromise(function(_0x38f1b7,_0x5698d6){return client[_0xcf76('0xb')](_0x32e1a8,_0x2e9b86)[_0xcf76('0xc')](function(_0x317549){logger[_0xcf76('0xd')](_0xcf76('0xe'),_0x5517ad,_0xcf76('0xf'));logger['debug'](_0xcf76('0x10'),_0x5517ad,_0xcf76('0xf'),JSON[_0xcf76('0x11')](_0x317549));if(_0x317549[_0xcf76('0x12')]){if(_0x317549[_0xcf76('0x12')][_0xcf76('0x13')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x5517ad,_0x317549[_0xcf76('0x12')][_0xcf76('0x14')]);return _0x5698d6(_0x317549[_0xcf76('0x12')][_0xcf76('0x14')]);}logger[_0xcf76('0x12')](_0xcf76('0xe'),_0x5517ad,_0x317549[_0xcf76('0x12')]['message']);return _0x38f1b7(_0x317549['error'][_0xcf76('0x14')]);}else{logger[_0xcf76('0xd')](_0xcf76('0xe'),_0x5517ad,_0xcf76('0xf'));_0x38f1b7(_0x317549[_0xcf76('0x15')][_0xcf76('0x14')]);}})[_0xcf76('0x16')](function(_0x6de17){logger[_0xcf76('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x5517ad,_0x6de17);_0x5698d6(_0x6de17);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2aaa0a7..aaf0196 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 _0xfa91=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xfa91,0x123));var _0x1fa9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xfa91[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x1fa9('0x0'));var util=require(_0x1fa9('0x1'));var path=require(_0x1fa9('0x2'));var timeout=require(_0x1fa9('0x3'));var express=require(_0x1fa9('0x4'));var router=express[_0x1fa9('0x5')]();var fs_extra=require(_0x1fa9('0x6'));var auth=require(_0x1fa9('0x7'));var interaction=require(_0x1fa9('0x8'));var config=require('../../config/environment');var controller=require(_0x1fa9('0x9'));router[_0x1fa9('0xa')]('/',auth[_0x1fa9('0xb')](),controller[_0x1fa9('0xc')]);router['get'](_0x1fa9('0xd'),auth['isAuthenticated'](),controller[_0x1fa9('0xe')]);router[_0x1fa9('0xf')]('/',auth[_0x1fa9('0xb')](),controller[_0x1fa9('0x10')]);router[_0x1fa9('0x11')](_0x1fa9('0xd'),auth['isAuthenticated'](),controller[_0x1fa9('0x12')]);router[_0x1fa9('0x13')](_0x1fa9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x1fa9('0x14')]=router; \ No newline at end of file +var _0x39f4=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get','show','post','create','put','delete','/:id'];(function(_0x52ce0c,_0x153a8a){var _0x17e015=function(_0x5de8a2){while(--_0x5de8a2){_0x52ce0c['push'](_0x52ce0c['shift']());}};_0x17e015(++_0x153a8a);}(_0x39f4,0x11f));var _0x439f=function(_0x3caa64,_0x2e85b1){_0x3caa64=_0x3caa64-0x0;var _0x504cd6=_0x39f4[_0x3caa64];return _0x504cd6;};'use strict';var multer=require(_0x439f('0x0'));var util=require(_0x439f('0x1'));var path=require(_0x439f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x439f('0x3')]();var fs_extra=require(_0x439f('0x4'));var auth=require(_0x439f('0x5'));var interaction=require(_0x439f('0x6'));var config=require(_0x439f('0x7'));var controller=require(_0x439f('0x8'));router['get']('/',auth[_0x439f('0x9')](),controller['index']);router[_0x439f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x439f('0xb')]);router[_0x439f('0xc')]('/',auth[_0x439f('0x9')](),controller[_0x439f('0xd')]);router[_0x439f('0xe')]('/:id',auth[_0x439f('0x9')](),controller['update']);router[_0x439f('0xf')](_0x439f('0x10'),auth['isAuthenticated'](),controller[_0x439f('0x11')]);module[_0x439f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index a22fe66..e9dc8e3 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 _0xed84=['STRING','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','variable'];(function(_0x4d2866,_0x51116c){var _0x521ff6=function(_0x4304be){while(--_0x4304be){_0x4d2866['push'](_0x4d2866['shift']());}};_0x521ff6(++_0x51116c);}(_0xed84,0x196));var _0x4ed8=function(_0x4eb427,_0xea690b){_0x4eb427=_0x4eb427-0x0;var _0x175954=_0xed84[_0x4eb427];return _0x175954;};'use strict';var Sequelize=require(_0x4ed8('0x0'));module[_0x4ed8('0x1')]={'type':{'type':Sequelize[_0x4ed8('0x2')](_0x4ed8('0x3'),'variable',_0x4ed8('0x4'),_0x4ed8('0x5'),_0x4ed8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4ed8('0x2')](_0x4ed8('0x3'),_0x4ed8('0x7'),_0x4ed8('0x4'))},'keyContent':{'type':Sequelize[_0x4ed8('0x8')]},'idField':{'type':Sequelize[_0x4ed8('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ed8('0x8')]}}; \ No newline at end of file +var _0x3d55=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x3d55,0x144));var _0x53d5=function(_0x74dd87,_0x2e91b0){_0x74dd87=_0x74dd87-0x0;var _0x36f969=_0x3d55[_0x74dd87];return _0x36f969;};'use strict';var Sequelize=require(_0x53d5('0x0'));module[_0x53d5('0x1')]={'type':{'type':Sequelize[_0x53d5('0x2')](_0x53d5('0x3'),_0x53d5('0x4'),'customVariable',_0x53d5('0x5'),_0x53d5('0x6')),'defaultValue':_0x53d5('0x3')},'content':{'type':Sequelize[_0x53d5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x53d5('0x2')](_0x53d5('0x3'),_0x53d5('0x4'),_0x53d5('0x8'))},'keyContent':{'type':Sequelize[_0x53d5('0x7')]},'idField':{'type':Sequelize[_0x53d5('0x7')]},'nameField':{'type':Sequelize[_0x53d5('0x7')]},'customField':{'type':Sequelize[_0x53d5('0x9')],'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 fddb7f9..78c47f6 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 _0x5540=['includeAll','findAll','rows','show','length','include','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','pick','where','VIRTUAL','merge','options'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x5540,0x92));var _0x0554=function(_0x31f14e,_0x45a3d2){_0x31f14e=_0x31f14e-0x0;var _0x2488e9=_0x5540[_0x31f14e];return _0x2488e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0554('0x0'));var zipdir=require(_0x0554('0x1'));var jsonpatch=require(_0x0554('0x2'));var rp=require(_0x0554('0x3'));var moment=require(_0x0554('0x4'));var BPromise=require(_0x0554('0x5'));var Mustache=require('mustache');var util=require(_0x0554('0x6'));var path=require(_0x0554('0x7'));var sox=require(_0x0554('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0554('0x9'));var _=require(_0x0554('0xa'));var squel=require(_0x0554('0xb'));var crypto=require('crypto');var jsforce=require(_0x0554('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0554('0xd'));var querystring=require(_0x0554('0xe'));var Papa=require(_0x0554('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0554('0x10'));var as=require(_0x0554('0x11'));var hardwareService=require(_0x0554('0x12'));var logger=require(_0x0554('0x13'))(_0x0554('0x14'));var utils=require(_0x0554('0x15'));var config=require(_0x0554('0x16'));var licenseUtil=require(_0x0554('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6c85b5,_0x4fa0bb){_0x4fa0bb=_0x4fa0bb||0xcc;return function(_0x54525c){if(_0x54525c){return _0x6c85b5[_0x0554('0x18')](_0x4fa0bb);}return _0x6c85b5[_0x0554('0x19')](_0x4fa0bb)['end']();};}function respondWithResult(_0x8408b5,_0xf29e18){_0xf29e18=_0xf29e18||0xc8;return function(_0x33b76d){if(_0x33b76d){return _0x8408b5[_0x0554('0x19')](_0xf29e18)['json'](_0x33b76d);}};}function respondWithFilteredResult(_0x3ca2b8,_0x578517){return function(_0x532e6f){if(_0x532e6f){var _0x5d319d=typeof _0x578517[_0x0554('0x1a')]===_0x0554('0x1b')&&typeof _0x578517[_0x0554('0x1c')]===_0x0554('0x1b');var _0x41c092=_0x532e6f['count'];var _0x3ab7de=_0x5d319d?0x0:_0x578517[_0x0554('0x1a')];var _0xe60901=_0x5d319d?_0x532e6f[_0x0554('0x1d')]:_0x578517[_0x0554('0x1a')]+_0x578517[_0x0554('0x1c')];var _0x52995d;if(_0xe60901>=_0x41c092){_0xe60901=_0x41c092;_0x52995d=0xc8;}else{_0x52995d=0xce;}_0x3ca2b8[_0x0554('0x19')](_0x52995d);return _0x3ca2b8[_0x0554('0x1e')](_0x0554('0x1f'),_0x3ab7de+'-'+_0xe60901+'/'+_0x41c092)[_0x0554('0x20')](_0x532e6f);}return null;};}function patchUpdates(_0x3737ec){return function(_0x10803a){try{jsonpatch['apply'](_0x10803a,_0x3737ec,!![]);}catch(_0x3093ee){return BPromise['reject'](_0x3093ee);}return _0x10803a[_0x0554('0x21')]();};}function saveUpdates(_0xb85cd,_0x178745){return function(_0x3f61f6){if(_0x3f61f6){return _0x3f61f6[_0x0554('0x22')](_0xb85cd)[_0x0554('0x23')](function(_0x427784){return _0x427784;});}return null;};}function removeEntity(_0x3f980c,_0x180012){return function(_0xa192ea){if(_0xa192ea){return _0xa192ea[_0x0554('0x24')]()['then'](function(){_0x3f980c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a0c28,_0x55b037){return function(_0x3ebf4a){if(!_0x3ebf4a){_0x6a0c28['sendStatus'](0x194);}return _0x3ebf4a;};}function handleError(_0x19c927,_0x5087a8){_0x5087a8=_0x5087a8||0x1f4;return function(_0x55c162){logger['error'](_0x55c162[_0x0554('0x25')]);if(_0x55c162['name']){delete _0x55c162[_0x0554('0x26')];}_0x19c927[_0x0554('0x19')](_0x5087a8)[_0x0554('0x27')](_0x55c162);};}exports['index']=function(_0x5c5e82,_0x11452b){var _0x2e1082={},_0x344a30={},_0x37a6be={'count':0x0,'rows':[]};var _0x1b15e6=_[_0x0554('0x28')](db[_0x0554('0x29')][_0x0554('0x2a')],function(_0x286a8c){return{'name':_0x286a8c[_0x0554('0x2b')],'type':_0x286a8c[_0x0554('0x2c')]['key']};});_0x344a30['model']=_['map'](_0x1b15e6,_0x0554('0x26'));_0x344a30['query']=_['keys'](_0x5c5e82[_0x0554('0x2d')]);_0x344a30[_0x0554('0x2e')]=_[_0x0554('0x2f')](_0x344a30[_0x0554('0x30')],_0x344a30[_0x0554('0x2d')]);_0x2e1082[_0x0554('0x31')]=_[_0x0554('0x2f')](_0x344a30['model'],qs[_0x0554('0x32')](_0x5c5e82[_0x0554('0x2d')][_0x0554('0x32')]));_0x2e1082[_0x0554('0x31')]=_0x2e1082['attributes']['length']?_0x2e1082[_0x0554('0x31')]:_0x344a30[_0x0554('0x30')];if(!_0x5c5e82['query']['hasOwnProperty'](_0x0554('0x33'))){_0x2e1082[_0x0554('0x1c')]=qs[_0x0554('0x1c')](_0x5c5e82[_0x0554('0x2d')][_0x0554('0x1c')]);_0x2e1082[_0x0554('0x1a')]=qs['offset'](_0x5c5e82[_0x0554('0x2d')][_0x0554('0x1a')]);}_0x2e1082[_0x0554('0x34')]=qs['sort'](_0x5c5e82[_0x0554('0x2d')]['sort']);_0x2e1082['where']=qs[_0x0554('0x2e')](_[_0x0554('0x35')](_0x5c5e82[_0x0554('0x2d')],_0x344a30['filters']),_0x1b15e6);if(_0x5c5e82[_0x0554('0x2d')]['filter']){_0x2e1082[_0x0554('0x36')]=_['merge'](_0x2e1082[_0x0554('0x36')],{'$or':_[_0x0554('0x28')](_0x1b15e6,function(_0xbef367){if(_0xbef367[_0x0554('0x2c')]!==_0x0554('0x37')){var _0x5b39af={};_0x5b39af[_0xbef367['name']]={'$like':'%'+_0x5c5e82[_0x0554('0x2d')]['filter']+'%'};return _0x5b39af;}})});}_0x2e1082=_[_0x0554('0x38')]({},_0x2e1082,_0x5c5e82[_0x0554('0x39')]);var _0x29e333={'where':_0x2e1082[_0x0554('0x36')]};return db['VtigerField'][_0x0554('0x1d')](_0x29e333)[_0x0554('0x23')](function(_0xb9e319){_0x37a6be[_0x0554('0x1d')]=_0xb9e319;if(_0x5c5e82[_0x0554('0x2d')][_0x0554('0x3a')]){_0x2e1082['include']=[{'all':!![]}];}return db[_0x0554('0x29')][_0x0554('0x3b')](_0x2e1082);})['then'](function(_0x548de4){_0x37a6be[_0x0554('0x3c')]=_0x548de4;return _0x37a6be;})[_0x0554('0x23')](respondWithFilteredResult(_0x11452b,_0x2e1082))['catch'](handleError(_0x11452b,null));};exports[_0x0554('0x3d')]=function(_0x17cade,_0x1e4037){var _0x5234ed={'raw':!![],'where':{'id':_0x17cade['params']['id']}},_0x351fb0={};_0x351fb0['model']=_['keys'](db[_0x0554('0x29')][_0x0554('0x2a')]);_0x351fb0[_0x0554('0x2d')]=_['keys'](_0x17cade[_0x0554('0x2d')]);_0x351fb0[_0x0554('0x2e')]=_[_0x0554('0x2f')](_0x351fb0[_0x0554('0x30')],_0x351fb0[_0x0554('0x2d')]);_0x5234ed[_0x0554('0x31')]=_[_0x0554('0x2f')](_0x351fb0[_0x0554('0x30')],qs[_0x0554('0x32')](_0x17cade[_0x0554('0x2d')][_0x0554('0x32')]));_0x5234ed['attributes']=_0x5234ed[_0x0554('0x31')][_0x0554('0x3e')]?_0x5234ed[_0x0554('0x31')]:_0x351fb0['model'];if(_0x17cade[_0x0554('0x2d')][_0x0554('0x3a')]){_0x5234ed[_0x0554('0x3f')]=[{'all':!![]}];}_0x5234ed=_[_0x0554('0x38')]({},_0x5234ed,_0x17cade[_0x0554('0x39')]);return db['VtigerField']['find'](_0x5234ed)[_0x0554('0x23')](handleEntityNotFound(_0x1e4037,null))['then'](respondWithResult(_0x1e4037,null))[_0x0554('0x40')](handleError(_0x1e4037,null));};exports[_0x0554('0x41')]=function(_0x426865,_0x30488b){return db[_0x0554('0x29')][_0x0554('0x41')](_0x426865['body'],{})[_0x0554('0x23')](respondWithResult(_0x30488b,0xc9))['catch'](handleError(_0x30488b,null));};exports['update']=function(_0x684270,_0x50aa24){if(_0x684270[_0x0554('0x42')]['id']){delete _0x684270[_0x0554('0x42')]['id'];}return db['VtigerField'][_0x0554('0x43')]({'where':{'id':_0x684270['params']['id']}})['then'](handleEntityNotFound(_0x50aa24,null))[_0x0554('0x23')](saveUpdates(_0x684270['body'],null))[_0x0554('0x23')](respondWithResult(_0x50aa24,null))['catch'](handleError(_0x50aa24,null));};exports[_0x0554('0x24')]=function(_0x1da29b,_0x2ed38b){return db[_0x0554('0x29')]['find']({'where':{'id':_0x1da29b['params']['id']}})['then'](handleEntityNotFound(_0x2ed38b,null))[_0x0554('0x23')](removeEntity(_0x2ed38b,null))[_0x0554('0x40')](handleError(_0x2ed38b,null));}; \ No newline at end of file +var _0x6ad9=['includeAll','find','create','body','update','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','count','include','findAll','rows','catch','show','keys'];(function(_0x2458f8,_0x14fee4){var _0x14d1a1=function(_0x119831){while(--_0x119831){_0x2458f8['push'](_0x2458f8['shift']());}};_0x14d1a1(++_0x14fee4);}(_0x6ad9,0xed));var _0x96ad=function(_0x18f6a7,_0x589942){_0x18f6a7=_0x18f6a7-0x0;var _0x5ad696=_0x6ad9[_0x18f6a7];return _0x5ad696;};'use strict';var emlformat=require(_0x96ad('0x0'));var rimraf=require(_0x96ad('0x1'));var zipdir=require(_0x96ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96ad('0x3'));var BPromise=require(_0x96ad('0x4'));var Mustache=require(_0x96ad('0x5'));var util=require(_0x96ad('0x6'));var path=require(_0x96ad('0x7'));var sox=require(_0x96ad('0x8'));var csv=require(_0x96ad('0x9'));var ejs=require(_0x96ad('0xa'));var fs=require('fs');var fs_extra=require(_0x96ad('0xb'));var _=require(_0x96ad('0xc'));var squel=require('squel');var crypto=require(_0x96ad('0xd'));var jsforce=require(_0x96ad('0xe'));var deskjs=require(_0x96ad('0xf'));var toCsv=require(_0x96ad('0x9'));var querystring=require(_0x96ad('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x96ad('0x11'));var as=require(_0x96ad('0x12'));var hardwareService=require(_0x96ad('0x13'));var logger=require(_0x96ad('0x14'))(_0x96ad('0x15'));var utils=require(_0x96ad('0x16'));var config=require(_0x96ad('0x17'));var licenseUtil=require(_0x96ad('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d9b20,_0x5eed96){_0x5eed96=_0x5eed96||0xcc;return function(_0x319874){if(_0x319874){return _0x2d9b20[_0x96ad('0x19')](_0x5eed96);}return _0x2d9b20[_0x96ad('0x1a')](_0x5eed96)['end']();};}function respondWithResult(_0x327bcb,_0x34e524){_0x34e524=_0x34e524||0xc8;return function(_0x411d10){if(_0x411d10){return _0x327bcb['status'](_0x34e524)['json'](_0x411d10);}};}function respondWithFilteredResult(_0x1c9979,_0x3471a3){return function(_0x48f13a){if(_0x48f13a){var _0x20f946=typeof _0x3471a3['offset']===_0x96ad('0x1b')&&typeof _0x3471a3[_0x96ad('0x1c')]===_0x96ad('0x1b');var _0x10decf=_0x48f13a['count'];var _0x58b208=_0x20f946?0x0:_0x3471a3[_0x96ad('0x1d')];var _0x322893=_0x20f946?_0x48f13a['count']:_0x3471a3['offset']+_0x3471a3['limit'];var _0x4904bd;if(_0x322893>=_0x10decf){_0x322893=_0x10decf;_0x4904bd=0xc8;}else{_0x4904bd=0xce;}_0x1c9979['status'](_0x4904bd);return _0x1c9979[_0x96ad('0x1e')](_0x96ad('0x1f'),_0x58b208+'-'+_0x322893+'/'+_0x10decf)[_0x96ad('0x20')](_0x48f13a);}return null;};}function patchUpdates(_0x35444a){return function(_0x29ea1a){try{jsonpatch[_0x96ad('0x21')](_0x29ea1a,_0x35444a,!![]);}catch(_0x136a3e){return BPromise[_0x96ad('0x22')](_0x136a3e);}return _0x29ea1a['save']();};}function saveUpdates(_0x4a04bb,_0x31b408){return function(_0xdf5583){if(_0xdf5583){return _0xdf5583['update'](_0x4a04bb)[_0x96ad('0x23')](function(_0x37ca4a){return _0x37ca4a;});}return null;};}function removeEntity(_0x45d64b,_0xf5f96d){return function(_0x24fe85){if(_0x24fe85){return _0x24fe85[_0x96ad('0x24')]()[_0x96ad('0x23')](function(){_0x45d64b[_0x96ad('0x1a')](0xcc)[_0x96ad('0x25')]();});}};}function handleEntityNotFound(_0x35c90e,_0x2bbed5){return function(_0x3addbc){if(!_0x3addbc){_0x35c90e['sendStatus'](0x194);}return _0x3addbc;};}function handleError(_0x5db083,_0x12a2c4){_0x12a2c4=_0x12a2c4||0x1f4;return function(_0x4f8c3b){logger[_0x96ad('0x26')](_0x4f8c3b[_0x96ad('0x27')]);if(_0x4f8c3b[_0x96ad('0x28')]){delete _0x4f8c3b[_0x96ad('0x28')];}_0x5db083['status'](_0x12a2c4)[_0x96ad('0x29')](_0x4f8c3b);};}exports[_0x96ad('0x2a')]=function(_0x1ee061,_0x5caf0d){var _0x4b38ba={},_0x27b58f={},_0x587880={'count':0x0,'rows':[]};var _0x17cc3e=_[_0x96ad('0x2b')](db[_0x96ad('0x2c')][_0x96ad('0x2d')],function(_0x1312db){return{'name':_0x1312db[_0x96ad('0x2e')],'type':_0x1312db[_0x96ad('0x2f')][_0x96ad('0x30')]};});_0x27b58f[_0x96ad('0x31')]=_[_0x96ad('0x2b')](_0x17cc3e,_0x96ad('0x28'));_0x27b58f[_0x96ad('0x32')]=_['keys'](_0x1ee061[_0x96ad('0x32')]);_0x27b58f['filters']=_['intersection'](_0x27b58f[_0x96ad('0x31')],_0x27b58f[_0x96ad('0x32')]);_0x4b38ba[_0x96ad('0x33')]=_[_0x96ad('0x34')](_0x27b58f['model'],qs[_0x96ad('0x35')](_0x1ee061[_0x96ad('0x32')]['fields']));_0x4b38ba['attributes']=_0x4b38ba[_0x96ad('0x33')][_0x96ad('0x36')]?_0x4b38ba['attributes']:_0x27b58f[_0x96ad('0x31')];if(!_0x1ee061[_0x96ad('0x32')][_0x96ad('0x37')](_0x96ad('0x38'))){_0x4b38ba[_0x96ad('0x1c')]=qs['limit'](_0x1ee061['query'][_0x96ad('0x1c')]);_0x4b38ba[_0x96ad('0x1d')]=qs[_0x96ad('0x1d')](_0x1ee061['query'][_0x96ad('0x1d')]);}_0x4b38ba['order']=qs[_0x96ad('0x39')](_0x1ee061[_0x96ad('0x32')][_0x96ad('0x39')]);_0x4b38ba[_0x96ad('0x3a')]=qs[_0x96ad('0x3b')](_[_0x96ad('0x3c')](_0x1ee061[_0x96ad('0x32')],_0x27b58f[_0x96ad('0x3b')]),_0x17cc3e);if(_0x1ee061[_0x96ad('0x32')]['filter']){_0x4b38ba[_0x96ad('0x3a')]=_[_0x96ad('0x3d')](_0x4b38ba[_0x96ad('0x3a')],{'$or':_[_0x96ad('0x2b')](_0x17cc3e,function(_0x4f4d61){if(_0x4f4d61[_0x96ad('0x2f')]!=='VIRTUAL'){var _0x508ef7={};_0x508ef7[_0x4f4d61[_0x96ad('0x28')]]={'$like':'%'+_0x1ee061['query'][_0x96ad('0x3e')]+'%'};return _0x508ef7;}})});}_0x4b38ba=_[_0x96ad('0x3d')]({},_0x4b38ba,_0x1ee061[_0x96ad('0x3f')]);var _0x3a6207={'where':_0x4b38ba['where']};return db[_0x96ad('0x2c')][_0x96ad('0x40')](_0x3a6207)['then'](function(_0x5b1b9c){_0x587880[_0x96ad('0x40')]=_0x5b1b9c;if(_0x1ee061[_0x96ad('0x32')]['includeAll']){_0x4b38ba[_0x96ad('0x41')]=[{'all':!![]}];}return db[_0x96ad('0x2c')][_0x96ad('0x42')](_0x4b38ba);})['then'](function(_0x1ff9aa){_0x587880[_0x96ad('0x43')]=_0x1ff9aa;return _0x587880;})[_0x96ad('0x23')](respondWithFilteredResult(_0x5caf0d,_0x4b38ba))[_0x96ad('0x44')](handleError(_0x5caf0d,null));};exports[_0x96ad('0x45')]=function(_0x1f7a8a,_0x1adaa8){var _0x1ab588={'raw':!![],'where':{'id':_0x1f7a8a['params']['id']}},_0x1ee661={};_0x1ee661['model']=_[_0x96ad('0x46')](db[_0x96ad('0x2c')][_0x96ad('0x2d')]);_0x1ee661[_0x96ad('0x32')]=_[_0x96ad('0x46')](_0x1f7a8a[_0x96ad('0x32')]);_0x1ee661[_0x96ad('0x3b')]=_[_0x96ad('0x34')](_0x1ee661[_0x96ad('0x31')],_0x1ee661[_0x96ad('0x32')]);_0x1ab588['attributes']=_[_0x96ad('0x34')](_0x1ee661['model'],qs['fields'](_0x1f7a8a[_0x96ad('0x32')][_0x96ad('0x35')]));_0x1ab588[_0x96ad('0x33')]=_0x1ab588[_0x96ad('0x33')][_0x96ad('0x36')]?_0x1ab588[_0x96ad('0x33')]:_0x1ee661[_0x96ad('0x31')];if(_0x1f7a8a[_0x96ad('0x32')][_0x96ad('0x47')]){_0x1ab588[_0x96ad('0x41')]=[{'all':!![]}];}_0x1ab588=_[_0x96ad('0x3d')]({},_0x1ab588,_0x1f7a8a[_0x96ad('0x3f')]);return db['VtigerField'][_0x96ad('0x48')](_0x1ab588)[_0x96ad('0x23')](handleEntityNotFound(_0x1adaa8,null))[_0x96ad('0x23')](respondWithResult(_0x1adaa8,null))[_0x96ad('0x44')](handleError(_0x1adaa8,null));};exports[_0x96ad('0x49')]=function(_0x49cc1b,_0x3fc9a1){return db[_0x96ad('0x2c')]['create'](_0x49cc1b[_0x96ad('0x4a')],{})['then'](respondWithResult(_0x3fc9a1,0xc9))[_0x96ad('0x44')](handleError(_0x3fc9a1,null));};exports[_0x96ad('0x4b')]=function(_0x4b449a,_0x328579){if(_0x4b449a[_0x96ad('0x4a')]['id']){delete _0x4b449a[_0x96ad('0x4a')]['id'];}return db[_0x96ad('0x2c')][_0x96ad('0x48')]({'where':{'id':_0x4b449a[_0x96ad('0x4c')]['id']}})['then'](handleEntityNotFound(_0x328579,null))[_0x96ad('0x23')](saveUpdates(_0x4b449a['body'],null))[_0x96ad('0x23')](respondWithResult(_0x328579,null))[_0x96ad('0x44')](handleError(_0x328579,null));};exports[_0x96ad('0x24')]=function(_0x49f2bf,_0x31e934){return db['VtigerField'][_0x96ad('0x48')]({'where':{'id':_0x49f2bf[_0x96ad('0x4c')]['id']}})['then'](handleEntityNotFound(_0x31e934,null))[_0x96ad('0x23')](removeEntity(_0x31e934,null))['catch'](handleError(_0x31e934,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 804242b..4baf415 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 _0x8370=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','FieldId','util','api','moment','bluebird','request-promise'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x8370,0xcb));var _0x0837=function(_0xb267b9,_0xef18eb){_0xb267b9=_0xb267b9-0x0;var _0x2d2033=_0x8370[_0xb267b9];return _0x2d2033;};'use strict';var _=require('lodash');var util=require(_0x0837('0x0'));var logger=require('../../config/logger')(_0x0837('0x1'));var moment=require(_0x0837('0x2'));var BPromise=require(_0x0837('0x3'));var rp=require(_0x0837('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0837('0x5'));var config=require(_0x0837('0x6'));var attributes=require(_0x0837('0x7'));module[_0x0837('0x8')]=function(_0x5eb0d2,_0x542d95){return _0x5eb0d2[_0x0837('0x9')](_0x0837('0xa'),attributes,{'tableName':_0x0837('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x0837('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ae7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','idField','FieldId'];(function(_0x86a3dc,_0x1b1e88){var _0x2172bb=function(_0x35658c){while(--_0x35658c){_0x86a3dc['push'](_0x86a3dc['shift']());}};_0x2172bb(++_0x1b1e88);}(_0x4ae7,0x1a4));var _0x74ae=function(_0x21215f,_0x4f7e90){_0x21215f=_0x21215f-0x0;var _0x1356c1=_0x4ae7[_0x21215f];return _0x1356c1;};'use strict';var _=require('lodash');var util=require(_0x74ae('0x0'));var logger=require(_0x74ae('0x1'))(_0x74ae('0x2'));var moment=require(_0x74ae('0x3'));var BPromise=require(_0x74ae('0x4'));var rp=require(_0x74ae('0x5'));var fs=require('fs');var path=require(_0x74ae('0x6'));var rimraf=require(_0x74ae('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x74ae('0x8')]=function(_0x4083e4,_0x863c72){return _0x4083e4[_0x74ae('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x74ae('0xa'),_0x74ae('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 20316a2..bbb8431 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 _0x213f=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x213f,0xdf));var _0xf213=function(_0x3827a7,_0xff4762){_0x3827a7=_0x3827a7-0x0;var _0x3fbb20=_0x213f[_0x3827a7];return _0x3fbb20;};'use strict';var _=require(_0xf213('0x0'));var util=require('util');var moment=require(_0xf213('0x1'));var BPromise=require(_0xf213('0x2'));var rs=require(_0xf213('0x3'));var fs=require('fs');var Redis=require(_0xf213('0x4'));var db=require(_0xf213('0x5'))['db'];var utils=require(_0xf213('0x6'));var logger=require(_0xf213('0x7'))('rpc');var config=require(_0xf213('0x8'));var jayson=require(_0xf213('0x9'));var client=jayson[_0xf213('0xa')][_0xf213('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51958c,_0x43792b,_0x8ef7ca){return new BPromise(function(_0x45a751,_0x3577f9){return client[_0xf213('0xc')](_0x51958c,_0x8ef7ca)['then'](function(_0x4f0cd8){logger[_0xf213('0xd')](_0xf213('0xe'),_0x43792b,'request\x20sent');logger[_0xf213('0xf')](_0xf213('0x10'),_0x43792b,_0xf213('0x11'),JSON[_0xf213('0x12')](_0x4f0cd8));if(_0x4f0cd8[_0xf213('0x13')]){if(_0x4f0cd8[_0xf213('0x13')][_0xf213('0x14')]===0x1f4){logger['error'](_0xf213('0xe'),_0x43792b,_0x4f0cd8['error'][_0xf213('0x15')]);return _0x3577f9(_0x4f0cd8[_0xf213('0x13')][_0xf213('0x15')]);}logger[_0xf213('0x13')](_0xf213('0xe'),_0x43792b,_0x4f0cd8[_0xf213('0x13')][_0xf213('0x15')]);return _0x45a751(_0x4f0cd8['error'][_0xf213('0x15')]);}else{logger['info'](_0xf213('0xe'),_0x43792b,_0xf213('0x11'));_0x45a751(_0x4f0cd8[_0xf213('0x16')]['message']);}})[_0xf213('0x17')](function(_0xd25e71){logger[_0xf213('0x13')]('VtigerField,\x20%s,\x20%s',_0x43792b,_0xd25e71);_0x3577f9(_0xd25e71);});});} \ No newline at end of file +var _0x42e7=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0x42e7,0x1d9));var _0x742e=function(_0x112ccf,_0x2ff84a){_0x112ccf=_0x112ccf-0x0;var _0x84dbc5=_0x42e7[_0x112ccf];return _0x84dbc5;};'use strict';var _=require(_0x742e('0x0'));var util=require(_0x742e('0x1'));var moment=require(_0x742e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x742e('0x3'));var db=require(_0x742e('0x4'))['db'];var utils=require(_0x742e('0x5'));var logger=require(_0x742e('0x6'))(_0x742e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58ce25,_0xcaa126,_0x4c4efc){return new BPromise(function(_0x502676,_0x58dbac){return client[_0x742e('0x8')](_0x58ce25,_0x4c4efc)['then'](function(_0x558360){logger[_0x742e('0x9')](_0x742e('0xa'),_0xcaa126,_0x742e('0xb'));logger[_0x742e('0xc')](_0x742e('0xd'),_0xcaa126,_0x742e('0xb'),JSON[_0x742e('0xe')](_0x558360));if(_0x558360[_0x742e('0xf')]){if(_0x558360[_0x742e('0xf')][_0x742e('0x10')]===0x1f4){logger[_0x742e('0xf')](_0x742e('0xa'),_0xcaa126,_0x558360[_0x742e('0xf')][_0x742e('0x11')]);return _0x58dbac(_0x558360[_0x742e('0xf')][_0x742e('0x11')]);}logger[_0x742e('0xf')]('VtigerField,\x20%s,\x20%s',_0xcaa126,_0x558360[_0x742e('0xf')][_0x742e('0x11')]);return _0x502676(_0x558360['error'][_0x742e('0x11')]);}else{logger[_0x742e('0x9')](_0x742e('0xa'),_0xcaa126,_0x742e('0xb'));_0x502676(_0x558360[_0x742e('0x12')][_0x742e('0x11')]);}})['catch'](function(_0x6b7c21){logger[_0x742e('0xf')](_0x742e('0xa'),_0xcaa126,_0x6b7c21);_0x58dbac(_0x6b7c21);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c04858c..05d6f4e 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 _0x0fe0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x0fe0,0x6f));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x00fe('0x0'));var util=require(_0x00fe('0x1'));var path=require(_0x00fe('0x2'));var timeout=require(_0x00fe('0x3'));var express=require(_0x00fe('0x4'));var router=express[_0x00fe('0x5')]();var fs_extra=require(_0x00fe('0x6'));var auth=require(_0x00fe('0x7'));var interaction=require(_0x00fe('0x8'));var config=require(_0x00fe('0x9'));var controller=require(_0x00fe('0xa'));router[_0x00fe('0xb')]('/',auth[_0x00fe('0xc')](),controller[_0x00fe('0xd')]);router[_0x00fe('0xb')](_0x00fe('0xe'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0x00fe('0xc')](),controller[_0x00fe('0xf')]);router[_0x00fe('0xb')](_0x00fe('0x10'),auth['isAuthenticated'](),controller[_0x00fe('0x11')]);router['post']('/',auth[_0x00fe('0xc')](),controller[_0x00fe('0x12')]);router[_0x00fe('0x13')](_0x00fe('0x14'),auth[_0x00fe('0xc')](),controller[_0x00fe('0x15')]);router[_0x00fe('0x16')](_0x00fe('0xe'),auth[_0x00fe('0xc')](),controller[_0x00fe('0x17')]);router[_0x00fe('0x18')](_0x00fe('0xe'),auth[_0x00fe('0xc')](),controller[_0x00fe('0x19')]);module[_0x00fe('0x1a')]=router; \ No newline at end of file +var _0x2158=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e4d41,_0x4b63c8){var _0x19ee3c=function(_0x5d68f8){while(--_0x5d68f8){_0x3e4d41['push'](_0x3e4d41['shift']());}};_0x19ee3c(++_0x4b63c8);}(_0x2158,0x10e));var _0x8215=function(_0x30ec38,_0x47093f){_0x30ec38=_0x30ec38-0x0;var _0x52b860=_0x2158[_0x30ec38];return _0x52b860;};'use strict';var multer=require('multer');var util=require(_0x8215('0x0'));var path=require('path');var timeout=require(_0x8215('0x1'));var express=require(_0x8215('0x2'));var router=express[_0x8215('0x3')]();var fs_extra=require(_0x8215('0x4'));var auth=require(_0x8215('0x5'));var interaction=require(_0x8215('0x6'));var config=require(_0x8215('0x7'));var controller=require(_0x8215('0x8'));router[_0x8215('0x9')]('/',auth[_0x8215('0xa')](),controller[_0x8215('0xb')]);router[_0x8215('0x9')](_0x8215('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8215('0xd'),auth[_0x8215('0xa')](),controller[_0x8215('0xe')]);router[_0x8215('0x9')](_0x8215('0xf'),auth[_0x8215('0xa')](),controller[_0x8215('0x10')]);router['post']('/',auth[_0x8215('0xa')](),controller[_0x8215('0x11')]);router[_0x8215('0x12')](_0x8215('0xd'),auth[_0x8215('0xa')](),controller['addConfiguration']);router['put'](_0x8215('0xc'),auth[_0x8215('0xa')](),controller[_0x8215('0x13')]);router[_0x8215('0x14')](_0x8215('0xc'),auth['isAuthenticated'](),controller[_0x8215('0x15')]);module[_0x8215('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c97f12e..5110f7e 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 _0xa899=['exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','sequelize'];(function(_0x113d52,_0x4a16e8){var _0x9c5450=function(_0x10d537){while(--_0x10d537){_0x113d52['push'](_0x113d52['shift']());}};_0x9c5450(++_0x4a16e8);}(_0xa899,0x155));var _0x9a89=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xa899[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x9a89('0x0'));module[_0x9a89('0x1')]={'name':{'type':Sequelize[_0x9a89('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9a89('0x2')],'unique':_0x9a89('0x3')},'password':{'type':Sequelize[_0x9a89('0x2')]},'token':{'type':Sequelize[_0x9a89('0x2')]},'remoteUri':{'type':Sequelize[_0x9a89('0x2')],'unique':_0x9a89('0x4')},'authType':{'type':Sequelize[_0x9a89('0x5')](_0x9a89('0x6'),_0x9a89('0x7')),'defaultValue':_0x9a89('0x6')},'serverUrl':{'type':Sequelize[_0x9a89('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a89('0x5')](_0x9a89('0x8'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf963=['ENUM','token','integrationTab','sequelize','STRING','remoteUri'];(function(_0x5f2c08,_0x3e2325){var _0x5e8c16=function(_0x4f7e36){while(--_0x4f7e36){_0x5f2c08['push'](_0x5f2c08['shift']());}};_0x5e8c16(++_0x3e2325);}(_0xf963,0x11d));var _0x3f96=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf963[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x3f96('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f96('0x1')]},'username':{'type':Sequelize[_0x3f96('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3f96('0x1')]},'remoteUri':{'type':Sequelize[_0x3f96('0x1')],'unique':_0x3f96('0x2')},'authType':{'type':Sequelize[_0x3f96('0x3')]('password',_0x3f96('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3f96('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f96('0x3')](_0x3f96('0x5'),'newTab'),'defaultValue':_0x3f96('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 8a0db0d..c9f48a1 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 _0x9348=['authType','remoteUri','substring','lastIndexOf','%s/%s','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','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','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','username','token'];(function(_0x2f8df1,_0x176beb){var _0x2dffb3=function(_0x1b068f){while(--_0x1b068f){_0x2f8df1['push'](_0x2f8df1['shift']());}};_0x2dffb3(++_0x176beb);}(_0x9348,0x10d));var _0x8934=function(_0xa5806c,_0x3b4007){_0xa5806c=_0xa5806c-0x0;var _0x374da9=_0x9348[_0xa5806c];return _0x374da9;};'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'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x68427d,_0x108eab){_0x108eab=_0x108eab||0xcc;return function(_0x46bca5){if(_0x46bca5){return _0x68427d[_0x8934('0x19')](_0x108eab);}return _0x68427d[_0x8934('0x1a')](_0x108eab)[_0x8934('0x1b')]();};}function respondWithResult(_0x5b560f,_0x254720){_0x254720=_0x254720||0xc8;return function(_0x38230a){if(_0x38230a){return _0x5b560f[_0x8934('0x1a')](_0x254720)[_0x8934('0x1c')](_0x38230a);}};}function respondWithFilteredResult(_0x34d4dc,_0x41e6a9){return function(_0x2a5b04){if(_0x2a5b04){var _0x357cf8=typeof _0x41e6a9['offset']===_0x8934('0x1d')&&typeof _0x41e6a9[_0x8934('0x1e')]===_0x8934('0x1d');var _0x5de8f0=_0x2a5b04['count'];var _0x597eed=_0x357cf8?0x0:_0x41e6a9[_0x8934('0x1f')];var _0x51f9ed=_0x357cf8?_0x2a5b04[_0x8934('0x20')]:_0x41e6a9[_0x8934('0x1f')]+_0x41e6a9[_0x8934('0x1e')];var _0x36c3b9;if(_0x51f9ed>=_0x5de8f0){_0x51f9ed=_0x5de8f0;_0x36c3b9=0xc8;}else{_0x36c3b9=0xce;}_0x34d4dc[_0x8934('0x1a')](_0x36c3b9);return _0x34d4dc['set'](_0x8934('0x21'),_0x597eed+'-'+_0x51f9ed+'/'+_0x5de8f0)['json'](_0x2a5b04);}return null;};}function patchUpdates(_0x476c6c){return function(_0x34f4e7){try{jsonpatch[_0x8934('0x22')](_0x34f4e7,_0x476c6c,!![]);}catch(_0x379445){return BPromise[_0x8934('0x23')](_0x379445);}return _0x34f4e7[_0x8934('0x24')]();};}function saveUpdates(_0x36fe20,_0x4f4a9b){return function(_0xe763c6){if(_0xe763c6){return _0xe763c6[_0x8934('0x25')](_0x36fe20)[_0x8934('0x26')](function(_0x343e09){return _0x343e09;});}return null;};}function removeEntity(_0x43b89a,_0x5e593b){return function(_0x3cf295){if(_0x3cf295){return _0x3cf295[_0x8934('0x27')]()[_0x8934('0x26')](function(){_0x43b89a['status'](0xcc)[_0x8934('0x1b')]();});}};}function handleEntityNotFound(_0x561df2,_0x14c5f0){return function(_0x1783ce){if(!_0x1783ce){_0x561df2[_0x8934('0x19')](0x194);}return _0x1783ce;};}function handleError(_0x5ef0ed,_0x1fd5eb){_0x1fd5eb=_0x1fd5eb||0x1f4;return function(_0x15910b){logger[_0x8934('0x28')](_0x15910b[_0x8934('0x29')]);if(_0x15910b['name']){delete _0x15910b[_0x8934('0x2a')];}_0x5ef0ed[_0x8934('0x1a')](_0x1fd5eb)[_0x8934('0x2b')](_0x15910b);};}exports[_0x8934('0x2c')]=function(_0x44972b,_0x20d448){var _0x3f328a={},_0x457634={},_0x9c6a71={'count':0x0,'rows':[]};var _0x18938a=_['map'](db[_0x8934('0x2d')][_0x8934('0x2e')],function(_0x54d28d){return{'name':_0x54d28d[_0x8934('0x2f')],'type':_0x54d28d[_0x8934('0x30')][_0x8934('0x31')]};});_0x457634[_0x8934('0x32')]=_['map'](_0x18938a,_0x8934('0x2a'));_0x457634[_0x8934('0x33')]=_[_0x8934('0x34')](_0x44972b[_0x8934('0x33')]);_0x457634[_0x8934('0x35')]=_['intersection'](_0x457634[_0x8934('0x32')],_0x457634['query']);_0x3f328a['attributes']=_[_0x8934('0x36')](_0x457634[_0x8934('0x32')],qs[_0x8934('0x37')](_0x44972b[_0x8934('0x33')]['fields']));_0x3f328a[_0x8934('0x38')]=_0x3f328a[_0x8934('0x38')][_0x8934('0x39')]?_0x3f328a[_0x8934('0x38')]:_0x457634[_0x8934('0x32')];if(!_0x44972b['query'][_0x8934('0x3a')](_0x8934('0x3b'))){_0x3f328a['limit']=qs['limit'](_0x44972b[_0x8934('0x33')][_0x8934('0x1e')]);_0x3f328a['offset']=qs['offset'](_0x44972b[_0x8934('0x33')][_0x8934('0x1f')]);}_0x3f328a[_0x8934('0x3c')]=qs[_0x8934('0x3d')](_0x44972b[_0x8934('0x33')][_0x8934('0x3d')]);_0x3f328a[_0x8934('0x3e')]=qs[_0x8934('0x35')](_[_0x8934('0x3f')](_0x44972b[_0x8934('0x33')],_0x457634[_0x8934('0x35')]),_0x18938a);if(_0x44972b['query'][_0x8934('0x40')]){_0x3f328a[_0x8934('0x3e')]=_['merge'](_0x3f328a[_0x8934('0x3e')],{'$or':_[_0x8934('0x41')](_0x18938a,function(_0x414091){if(_0x414091[_0x8934('0x30')]!==_0x8934('0x42')){var _0x5b0307={};_0x5b0307[_0x414091['name']]={'$like':'%'+_0x44972b['query'][_0x8934('0x40')]+'%'};return _0x5b0307;}})});}_0x3f328a=_[_0x8934('0x43')]({},_0x3f328a,_0x44972b[_0x8934('0x44')]);var _0x53581b={'where':_0x3f328a[_0x8934('0x3e')]};return db['ZendeskAccount']['count'](_0x53581b)[_0x8934('0x26')](function(_0x1f36d0){_0x9c6a71['count']=_0x1f36d0;if(_0x44972b['query'][_0x8934('0x45')]){_0x3f328a[_0x8934('0x46')]=[{'all':!![]}];}return db[_0x8934('0x2d')]['findAll'](_0x3f328a);})[_0x8934('0x26')](function(_0x5e543c){_0x9c6a71[_0x8934('0x47')]=_0x5e543c;return _0x9c6a71;})['then'](respondWithFilteredResult(_0x20d448,_0x3f328a))[_0x8934('0x48')](handleError(_0x20d448,null));};exports[_0x8934('0x49')]=function(_0x83be9e,_0x566d67){var _0xefdfab={'raw':![],'where':{'id':_0x83be9e[_0x8934('0x4a')]['id']}},_0x350d04={};_0x350d04[_0x8934('0x32')]=_['keys'](db[_0x8934('0x2d')][_0x8934('0x2e')]);_0x350d04[_0x8934('0x33')]=_[_0x8934('0x34')](_0x83be9e[_0x8934('0x33')]);_0x350d04[_0x8934('0x35')]=_[_0x8934('0x36')](_0x350d04[_0x8934('0x32')],_0x350d04['query']);_0xefdfab['attributes']=_['intersection'](_0x350d04[_0x8934('0x32')],qs[_0x8934('0x37')](_0x83be9e['query'][_0x8934('0x37')]));_0xefdfab['attributes']=_0xefdfab[_0x8934('0x38')][_0x8934('0x39')]?_0xefdfab['attributes']:_0x350d04[_0x8934('0x32')];if(_0x83be9e[_0x8934('0x33')][_0x8934('0x45')]){_0xefdfab[_0x8934('0x46')]=[{'all':!![]}];}_0xefdfab=_['merge']({},_0xefdfab,_0x83be9e[_0x8934('0x44')]);return db[_0x8934('0x2d')]['find'](_0xefdfab)[_0x8934('0x26')](handleEntityNotFound(_0x566d67,null))[_0x8934('0x26')](respondWithResult(_0x566d67,null))[_0x8934('0x48')](handleError(_0x566d67,null));};exports[_0x8934('0x4b')]=function(_0x406d0a,_0x419e30){return db[_0x8934('0x2d')][_0x8934('0x4b')](_0x406d0a[_0x8934('0x4c')],{})[_0x8934('0x26')](respondWithResult(_0x419e30,0xc9))[_0x8934('0x48')](handleError(_0x419e30,null));};exports[_0x8934('0x25')]=function(_0x2c322d,_0x2febf5){if(_0x2c322d[_0x8934('0x4c')]['id']){delete _0x2c322d[_0x8934('0x4c')]['id'];}return db[_0x8934('0x2d')][_0x8934('0x4d')]({'where':{'id':_0x2c322d['params']['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x2febf5,null))[_0x8934('0x26')](saveUpdates(_0x2c322d['body'],null))['then'](respondWithResult(_0x2febf5,null))['catch'](handleError(_0x2febf5,null));};exports['destroy']=function(_0x3610a0,_0x15310a){return db[_0x8934('0x2d')]['find']({'where':{'id':_0x3610a0['params']['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x15310a,null))['then'](removeEntity(_0x15310a,null))['catch'](handleError(_0x15310a,null));};exports[_0x8934('0x4e')]=function(_0x2778f9,_0x173bc1,_0x334f27){var _0x21ca17={};var _0x1b66d8={};var _0x3902fb;var _0x575bd7;return db[_0x8934('0x2d')]['findOne']({'where':{'id':_0x2778f9[_0x8934('0x4a')]['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x173bc1,null))[_0x8934('0x26')](function(_0x3df31e){if(_0x3df31e){_0x3902fb=_0x3df31e;_0x1b66d8[_0x8934('0x32')]=_[_0x8934('0x34')](db[_0x8934('0x4f')][_0x8934('0x2e')]);_0x1b66d8['query']=_[_0x8934('0x34')](_0x2778f9[_0x8934('0x33')]);_0x1b66d8[_0x8934('0x35')]=_[_0x8934('0x36')](_0x1b66d8[_0x8934('0x32')],_0x1b66d8['query']);_0x21ca17[_0x8934('0x38')]=_[_0x8934('0x36')](_0x1b66d8[_0x8934('0x32')],qs['fields'](_0x2778f9[_0x8934('0x33')][_0x8934('0x37')]));_0x21ca17[_0x8934('0x38')]=_0x21ca17['attributes']['length']?_0x21ca17['attributes']:_0x1b66d8[_0x8934('0x32')];_0x21ca17[_0x8934('0x3c')]=qs[_0x8934('0x3d')](_0x2778f9['query'][_0x8934('0x3d')]);_0x21ca17[_0x8934('0x3e')]=qs['filters'](_['pick'](_0x2778f9[_0x8934('0x33')],_0x1b66d8[_0x8934('0x35')]));if(_0x2778f9[_0x8934('0x33')][_0x8934('0x40')]){_0x21ca17['where']=_['merge'](_0x21ca17['where'],{'$or':_['map'](_0x21ca17[_0x8934('0x38')],function(_0x2b8837){var _0x18d08e={};_0x18d08e[_0x2b8837]={'$like':'%'+_0x2778f9[_0x8934('0x33')][_0x8934('0x40')]+'%'};return _0x18d08e;})});}_0x21ca17=_[_0x8934('0x43')]({},_0x21ca17,_0x2778f9['options']);return _0x3902fb[_0x8934('0x4e')](_0x21ca17);}})[_0x8934('0x26')](function(_0x4991bd){if(_0x4991bd){_0x575bd7=_0x4991bd[_0x8934('0x39')];if(!_0x2778f9['query'][_0x8934('0x3a')]('nolimit')){_0x21ca17[_0x8934('0x1e')]=qs[_0x8934('0x1e')](_0x2778f9[_0x8934('0x33')][_0x8934('0x1e')]);_0x21ca17[_0x8934('0x1f')]=qs[_0x8934('0x1f')](_0x2778f9[_0x8934('0x33')]['offset']);}return _0x3902fb['getConfigurations'](_0x21ca17);}})[_0x8934('0x26')](function(_0x3a0378){if(_0x3a0378){return _0x3a0378?{'count':_0x575bd7,'rows':_0x3a0378}:null;}})[_0x8934('0x26')](respondWithResult(_0x173bc1,null))[_0x8934('0x48')](handleError(_0x173bc1,null));};exports[_0x8934('0x50')]=function(_0x18850a,_0x35c437,_0x112957){if(_0x18850a[_0x8934('0x4c')]['id']){delete _0x18850a[_0x8934('0x4c')]['id'];}return db[_0x8934('0x2d')][_0x8934('0x51')]({'where':{'id':_0x18850a[_0x8934('0x4a')]['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x35c437,null))['then'](function(_0x5c2819){if(_0x5c2819){_0x18850a[_0x8934('0x4c')][_0x8934('0x52')]=_0x5c2819['id'];_0x18850a[_0x8934('0x4c')][_0x8934('0x53')]=integrations[_0x8934('0x54')](_0x18850a[_0x8934('0x4c')][_0x8934('0x55')],_0x18850a['body'][_0x8934('0x30')]);_0x18850a[_0x8934('0x4c')]['Descriptions']=integrations[_0x8934('0x56')](_0x18850a['body'][_0x8934('0x55')],_0x18850a[_0x8934('0x4c')][_0x8934('0x30')]);return db['ZendeskConfiguration'][_0x8934('0x4b')](_0x18850a[_0x8934('0x4c')],{'include':[{'model':db['ZendeskField'],'as':_0x8934('0x53')},{'model':db['ZendeskField'],'as':_0x8934('0x57')}]});}return null;})['then'](respondWithResult(_0x35c437,null))[_0x8934('0x48')](handleError(_0x35c437,null));};exports[_0x8934('0x58')]=function(_0x24b0ce,_0x5ea4fe,_0x196372){var _0xfbad9='';return db[_0x8934('0x2d')][_0x8934('0x51')]({'where':{'id':_0x24b0ce['params']['id']},'attributes':['id',_0x8934('0x59'),'password',_0x8934('0x5a'),_0x8934('0x5b'),_0x8934('0x5c')]})[_0x8934('0x26')](handleEntityNotFound(_0x5ea4fe,null))['then'](function(_0xc2799d){if(_0xc2799d){_0xfbad9=_0xc2799d[_0x8934('0x5c')];var _0xd880ba=_0xfbad9['slice'](-0x1);if(_0xd880ba==='/'){_0xfbad9=_0xfbad9[_0x8934('0x5d')](0x0,_0xfbad9[_0x8934('0x5e')](_0xd880ba));}var _0x2acd18={'method':'GET','uri':util['format'](_0x8934('0x5f'),_0xfbad9,_0x8934('0x60')),'json':!![]};switch(_0xc2799d[_0x8934('0x5b')]){case _0x8934('0x61'):_0x2acd18[_0x8934('0x62')]={'Authorization':util[_0x8934('0x63')](_0x8934('0x64'),new Buffer(util[_0x8934('0x63')](_0x8934('0x65'),_0xc2799d['username'],_0xc2799d[_0x8934('0x61')]))[_0x8934('0x66')](_0x8934('0x67')))};break;case _0x8934('0x5a'):_0x2acd18[_0x8934('0x62')]={'Authorization':util['format'](_0x8934('0x64'),new Buffer(util[_0x8934('0x63')]('%s/token:%s',_0xc2799d[_0x8934('0x59')],_0xc2799d['token']))['toString']('base64'))};break;default:throw new db[(_0x8934('0x68'))][(_0x8934('0x69'))](_0x8934('0x6a'));}return rp(_0x2acd18);}})['then'](function(_0x2c289b){if(_0x2c289b){var _0x1d3372=['subject',_0x8934('0x6b'),_0x8934('0x6c'),_0x8934('0x6d')];_[_0x8934('0x6e')](_0x2c289b[_0x8934('0x60')],function(_0x324722){return _0x1d3372[_0x8934('0x6f')](_0x324722[_0x8934('0x30')]);});return{'count':_0x2c289b[_0x8934('0x60')][_0x8934('0x39')],'rows':_['map'](_0x2c289b[_0x8934('0x60')],function(_0x31e7d1){return{'id':_0x31e7d1['id'],'name':_0x31e7d1[_0x8934('0x70')]>0x7?_0x31e7d1[_0x8934('0x71')]:_0x31e7d1[_0x8934('0x30')],'custom':_0x31e7d1[_0x8934('0x70')]>0x7?!![]:![],'options':_0x31e7d1[_0x8934('0x72')]?_0x31e7d1['system_field_options']:_0x31e7d1[_0x8934('0x73')]?_0x31e7d1[_0x8934('0x73')]:[]};})};}})[_0x8934('0x26')](respondWithResult(_0x5ea4fe,null))[_0x8934('0x48')](function(_0x9de459){var _0xdf0ab2=_0x24b0ce[_0x8934('0x33')][_0x8934('0x74')]?0x1f4:_0x9de459[_0x8934('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8934('0x58'),_0xdf0ab2,JSON[_0x8934('0x76')](_0x9de459));delete _0x9de459['name'];if(_0xdf0ab2===0x191){_0xdf0ab2=0x190;}_0x5ea4fe[_0x8934('0x1a')](_0xdf0ab2)[_0x8934('0x2b')](_0x24b0ce[_0x8934('0x33')][_0x8934('0x74')]?{'message':_0x8934('0x77'),'statusCode':_0x9de459[_0x8934('0x75')]}:_0x9de459);});}; \ No newline at end of file +var _0xb574=['slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','toString','base64','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','position','title','system_field_options','custom_field_options','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','ZendeskConfiguration','options','length','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','remoteUri'];(function(_0xf0c448,_0x4bd0cd){var _0x226f4a=function(_0x566c98){while(--_0x566c98){_0xf0c448['push'](_0xf0c448['shift']());}};_0x226f4a(++_0x4bd0cd);}(_0xb574,0x106));var _0x4b57=function(_0x217ac3,_0x5ba162){_0x217ac3=_0x217ac3-0x0;var _0x14d764=_0xb574[_0x217ac3];return _0x14d764;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];var integrations=require(_0x4b57('0x16'));function respondWithStatusCode(_0x43d066,_0xf8a6fc){_0xf8a6fc=_0xf8a6fc||0xcc;return function(_0x607276){if(_0x607276){return _0x43d066[_0x4b57('0x17')](_0xf8a6fc);}return _0x43d066[_0x4b57('0x18')](_0xf8a6fc)[_0x4b57('0x19')]();};}function respondWithResult(_0x31cced,_0x4e15be){_0x4e15be=_0x4e15be||0xc8;return function(_0x4a58dc){if(_0x4a58dc){return _0x31cced[_0x4b57('0x18')](_0x4e15be)[_0x4b57('0x1a')](_0x4a58dc);}};}function respondWithFilteredResult(_0x10b9ff,_0x58d6bd){return function(_0x284640){if(_0x284640){var _0x48bd13=typeof _0x58d6bd[_0x4b57('0x1b')]===_0x4b57('0x1c')&&typeof _0x58d6bd[_0x4b57('0x1d')]===_0x4b57('0x1c');var _0x20cf5e=_0x284640[_0x4b57('0x1e')];var _0x4ede42=_0x48bd13?0x0:_0x58d6bd[_0x4b57('0x1b')];var _0x1a0b72=_0x48bd13?_0x284640[_0x4b57('0x1e')]:_0x58d6bd[_0x4b57('0x1b')]+_0x58d6bd['limit'];var _0xb62450;if(_0x1a0b72>=_0x20cf5e){_0x1a0b72=_0x20cf5e;_0xb62450=0xc8;}else{_0xb62450=0xce;}_0x10b9ff[_0x4b57('0x18')](_0xb62450);return _0x10b9ff[_0x4b57('0x1f')](_0x4b57('0x20'),_0x4ede42+'-'+_0x1a0b72+'/'+_0x20cf5e)[_0x4b57('0x1a')](_0x284640);}return null;};}function patchUpdates(_0x4454c8){return function(_0x4f407d){try{jsonpatch[_0x4b57('0x21')](_0x4f407d,_0x4454c8,!![]);}catch(_0x131fed){return BPromise[_0x4b57('0x22')](_0x131fed);}return _0x4f407d['save']();};}function saveUpdates(_0x380554,_0x4a34b2){return function(_0x286c7d){if(_0x286c7d){return _0x286c7d[_0x4b57('0x23')](_0x380554)['then'](function(_0x271361){return _0x271361;});}return null;};}function removeEntity(_0x368c5f,_0x4d07c9){return function(_0x3e7b96){if(_0x3e7b96){return _0x3e7b96[_0x4b57('0x24')]()[_0x4b57('0x25')](function(){_0x368c5f[_0x4b57('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x156962,_0x51d0c3){return function(_0x131dab){if(!_0x131dab){_0x156962['sendStatus'](0x194);}return _0x131dab;};}function handleError(_0x36ceb1,_0x2dc9d8){_0x2dc9d8=_0x2dc9d8||0x1f4;return function(_0x4af2c8){logger[_0x4b57('0x26')](_0x4af2c8[_0x4b57('0x27')]);if(_0x4af2c8[_0x4b57('0x28')]){delete _0x4af2c8['name'];}_0x36ceb1['status'](_0x2dc9d8)[_0x4b57('0x29')](_0x4af2c8);};}exports['index']=function(_0x1ea0cb,_0x458f70){var _0x874cf7={},_0x3af22f={},_0x249461={'count':0x0,'rows':[]};var _0x2c20d2=_['map'](db[_0x4b57('0x2a')][_0x4b57('0x2b')],function(_0x68be27){return{'name':_0x68be27[_0x4b57('0x2c')],'type':_0x68be27['type'][_0x4b57('0x2d')]};});_0x3af22f[_0x4b57('0x2e')]=_['map'](_0x2c20d2,_0x4b57('0x28'));_0x3af22f[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x1ea0cb[_0x4b57('0x2f')]);_0x3af22f['filters']=_['intersection'](_0x3af22f['model'],_0x3af22f[_0x4b57('0x2f')]);_0x874cf7[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x3af22f[_0x4b57('0x2e')],qs[_0x4b57('0x33')](_0x1ea0cb['query'][_0x4b57('0x33')]));_0x874cf7[_0x4b57('0x31')]=_0x874cf7[_0x4b57('0x31')]['length']?_0x874cf7[_0x4b57('0x31')]:_0x3af22f[_0x4b57('0x2e')];if(!_0x1ea0cb[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x34'))){_0x874cf7[_0x4b57('0x1d')]=qs['limit'](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1d')]);_0x874cf7[_0x4b57('0x1b')]=qs[_0x4b57('0x1b')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1b')]);}_0x874cf7['order']=qs[_0x4b57('0x35')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x35')]);_0x874cf7[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x1ea0cb[_0x4b57('0x2f')],_0x3af22f['filters']),_0x2c20d2);if(_0x1ea0cb['query'][_0x4b57('0x39')]){_0x874cf7[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x874cf7['where'],{'$or':_[_0x4b57('0x3b')](_0x2c20d2,function(_0x1a3c3a){if(_0x1a3c3a[_0x4b57('0x3c')]!==_0x4b57('0x3d')){var _0x5487cc={};_0x5487cc[_0x1a3c3a[_0x4b57('0x28')]]={'$like':'%'+_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x39')]+'%'};return _0x5487cc;}})});}_0x874cf7=_[_0x4b57('0x3a')]({},_0x874cf7,_0x1ea0cb['options']);var _0x5766a6={'where':_0x874cf7['where']};return db[_0x4b57('0x2a')][_0x4b57('0x1e')](_0x5766a6)[_0x4b57('0x25')](function(_0x2e23d3){_0x249461['count']=_0x2e23d3;if(_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x3e')]){_0x874cf7[_0x4b57('0x3f')]=[{'all':!![]}];}return db[_0x4b57('0x2a')][_0x4b57('0x40')](_0x874cf7);})[_0x4b57('0x25')](function(_0x2d5a0c){_0x249461[_0x4b57('0x41')]=_0x2d5a0c;return _0x249461;})[_0x4b57('0x25')](respondWithFilteredResult(_0x458f70,_0x874cf7))['catch'](handleError(_0x458f70,null));};exports[_0x4b57('0x42')]=function(_0x3685fd,_0x3c5095){var _0x5b2f50={'raw':![],'where':{'id':_0x3685fd['params']['id']}},_0x44f988={};_0x44f988[_0x4b57('0x2e')]=_[_0x4b57('0x30')](db[_0x4b57('0x2a')][_0x4b57('0x2b')]);_0x44f988[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x3685fd[_0x4b57('0x2f')]);_0x44f988[_0x4b57('0x37')]=_[_0x4b57('0x32')](_0x44f988[_0x4b57('0x2e')],_0x44f988[_0x4b57('0x2f')]);_0x5b2f50[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x44f988['model'],qs['fields'](_0x3685fd[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x5b2f50[_0x4b57('0x31')]=_0x5b2f50[_0x4b57('0x31')]['length']?_0x5b2f50[_0x4b57('0x31')]:_0x44f988[_0x4b57('0x2e')];if(_0x3685fd['query'][_0x4b57('0x3e')]){_0x5b2f50['include']=[{'all':!![]}];}_0x5b2f50=_[_0x4b57('0x3a')]({},_0x5b2f50,_0x3685fd['options']);return db['ZendeskAccount'][_0x4b57('0x43')](_0x5b2f50)[_0x4b57('0x25')](handleEntityNotFound(_0x3c5095,null))['then'](respondWithResult(_0x3c5095,null))[_0x4b57('0x44')](handleError(_0x3c5095,null));};exports[_0x4b57('0x45')]=function(_0x2732ff,_0x1cf1f3){return db[_0x4b57('0x2a')][_0x4b57('0x45')](_0x2732ff['body'],{})[_0x4b57('0x25')](respondWithResult(_0x1cf1f3,0xc9))[_0x4b57('0x44')](handleError(_0x1cf1f3,null));};exports['update']=function(_0xd529fb,_0x23e852){if(_0xd529fb[_0x4b57('0x46')]['id']){delete _0xd529fb['body']['id'];}return db[_0x4b57('0x2a')]['find']({'where':{'id':_0xd529fb[_0x4b57('0x47')]['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x23e852,null))[_0x4b57('0x25')](saveUpdates(_0xd529fb[_0x4b57('0x46')],null))[_0x4b57('0x25')](respondWithResult(_0x23e852,null))[_0x4b57('0x44')](handleError(_0x23e852,null));};exports[_0x4b57('0x24')]=function(_0x3ec6ba,_0x5ab120){return db[_0x4b57('0x2a')][_0x4b57('0x43')]({'where':{'id':_0x3ec6ba[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ab120,null))[_0x4b57('0x25')](removeEntity(_0x5ab120,null))[_0x4b57('0x44')](handleError(_0x5ab120,null));};exports[_0x4b57('0x48')]=function(_0x488bea,_0x1579d1,_0x3d2336){var _0x343cec={};var _0xb56bf0={};var _0x44494f;var _0xb7c37c;return db[_0x4b57('0x2a')]['findOne']({'where':{'id':_0x488bea['params']['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x1579d1,null))[_0x4b57('0x25')](function(_0x3b4cbf){if(_0x3b4cbf){_0x44494f=_0x3b4cbf;_0xb56bf0[_0x4b57('0x2e')]=_['keys'](db[_0x4b57('0x49')][_0x4b57('0x2b')]);_0xb56bf0[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x488bea['query']);_0xb56bf0['filters']=_[_0x4b57('0x32')](_0xb56bf0[_0x4b57('0x2e')],_0xb56bf0['query']);_0x343cec['attributes']=_[_0x4b57('0x32')](_0xb56bf0['model'],qs[_0x4b57('0x33')](_0x488bea[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x343cec[_0x4b57('0x31')]=_0x343cec[_0x4b57('0x31')]['length']?_0x343cec['attributes']:_0xb56bf0['model'];_0x343cec['order']=qs[_0x4b57('0x35')](_0x488bea[_0x4b57('0x2f')]['sort']);_0x343cec[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x488bea[_0x4b57('0x2f')],_0xb56bf0[_0x4b57('0x37')]));if(_0x488bea[_0x4b57('0x2f')][_0x4b57('0x39')]){_0x343cec[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x343cec['where'],{'$or':_[_0x4b57('0x3b')](_0x343cec['attributes'],function(_0x10bd32){var _0x2f684b={};_0x2f684b[_0x10bd32]={'$like':'%'+_0x488bea['query'][_0x4b57('0x39')]+'%'};return _0x2f684b;})});}_0x343cec=_[_0x4b57('0x3a')]({},_0x343cec,_0x488bea[_0x4b57('0x4a')]);return _0x44494f[_0x4b57('0x48')](_0x343cec);}})[_0x4b57('0x25')](function(_0xc24706){if(_0xc24706){_0xb7c37c=_0xc24706[_0x4b57('0x4b')];if(!_0x488bea[_0x4b57('0x2f')][_0x4b57('0x4c')](_0x4b57('0x34'))){_0x343cec[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0x488bea['query'][_0x4b57('0x1d')]);_0x343cec[_0x4b57('0x1b')]=qs['offset'](_0x488bea[_0x4b57('0x2f')]['offset']);}return _0x44494f['getConfigurations'](_0x343cec);}})['then'](function(_0x1004ac){if(_0x1004ac){return _0x1004ac?{'count':_0xb7c37c,'rows':_0x1004ac}:null;}})['then'](respondWithResult(_0x1579d1,null))[_0x4b57('0x44')](handleError(_0x1579d1,null));};exports[_0x4b57('0x4d')]=function(_0x5e093a,_0x4cc278,_0x264c9f){if(_0x5e093a[_0x4b57('0x46')]['id']){delete _0x5e093a[_0x4b57('0x46')]['id'];}return db['ZendeskAccount'][_0x4b57('0x4e')]({'where':{'id':_0x5e093a[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cc278,null))[_0x4b57('0x25')](function(_0x119933){if(_0x119933){_0x5e093a['body'][_0x4b57('0x4f')]=_0x119933['id'];_0x5e093a[_0x4b57('0x46')][_0x4b57('0x50')]=integrations[_0x4b57('0x51')](_0x5e093a[_0x4b57('0x46')][_0x4b57('0x52')],_0x5e093a[_0x4b57('0x46')]['type']);_0x5e093a['body'][_0x4b57('0x53')]=integrations[_0x4b57('0x54')](_0x5e093a['body']['channel'],_0x5e093a[_0x4b57('0x46')][_0x4b57('0x3c')]);return db['ZendeskConfiguration']['create'](_0x5e093a['body'],{'include':[{'model':db[_0x4b57('0x55')],'as':_0x4b57('0x50')},{'model':db[_0x4b57('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4cc278,null))['catch'](handleError(_0x4cc278,null));};exports[_0x4b57('0x56')]=function(_0x59cd7c,_0x40cabe,_0x502313){var _0x13c680='';return db[_0x4b57('0x2a')][_0x4b57('0x4e')]({'where':{'id':_0x59cd7c[_0x4b57('0x47')]['id']},'attributes':['id','username',_0x4b57('0x57'),'token','authType',_0x4b57('0x58')]})[_0x4b57('0x25')](handleEntityNotFound(_0x40cabe,null))['then'](function(_0xf54f38){if(_0xf54f38){_0x13c680=_0xf54f38[_0x4b57('0x58')];var _0x355b5b=_0x13c680[_0x4b57('0x59')](-0x1);if(_0x355b5b==='/'){_0x13c680=_0x13c680[_0x4b57('0x5a')](0x0,_0x13c680[_0x4b57('0x5b')](_0x355b5b));}var _0x57e9eb={'method':_0x4b57('0x5c'),'uri':util[_0x4b57('0x5d')](_0x4b57('0x5e'),_0x13c680,_0x4b57('0x5f')),'json':!![]};switch(_0xf54f38[_0x4b57('0x60')]){case'password':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util[_0x4b57('0x5d')](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x57')]))[_0x4b57('0x63')](_0x4b57('0x64')))};break;case'token':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util['format'](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s/token:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x65')]))['toString'](_0x4b57('0x64')))};break;default:throw new db[(_0x4b57('0x66'))][(_0x4b57('0x67'))](_0x4b57('0x68'));}return rp(_0x57e9eb);}})[_0x4b57('0x25')](function(_0x489f3c){if(_0x489f3c){var _0x137532=[_0x4b57('0x69'),_0x4b57('0x6a'),'group','assignee'];_[_0x4b57('0x6b')](_0x489f3c[_0x4b57('0x5f')],function(_0x540a0a){return _0x137532[_0x4b57('0x6c')](_0x540a0a[_0x4b57('0x3c')]);});return{'count':_0x489f3c['ticket_fields'][_0x4b57('0x4b')],'rows':_[_0x4b57('0x3b')](_0x489f3c['ticket_fields'],function(_0xdef470){return{'id':_0xdef470['id'],'name':_0xdef470[_0x4b57('0x6d')]>0x7?_0xdef470[_0x4b57('0x6e')]:_0xdef470['type'],'custom':_0xdef470[_0x4b57('0x6d')]>0x7?!![]:![],'options':_0xdef470[_0x4b57('0x6f')]?_0xdef470[_0x4b57('0x6f')]:_0xdef470[_0x4b57('0x70')]?_0xdef470[_0x4b57('0x70')]:[]};})};}})[_0x4b57('0x25')](respondWithResult(_0x40cabe,null))[_0x4b57('0x44')](function(_0x4e4bbd){var _0x183b8c=_0x59cd7c[_0x4b57('0x2f')]['test']?0x1f4:_0x4e4bbd[_0x4b57('0x71')]||0x1f4;logger[_0x4b57('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x4b57('0x56'),_0x183b8c,JSON[_0x4b57('0x72')](_0x4e4bbd));delete _0x4e4bbd[_0x4b57('0x28')];if(_0x183b8c===0x191){_0x183b8c=0x190;}_0x40cabe[_0x4b57('0x18')](_0x183b8c)[_0x4b57('0x29')](_0x59cd7c[_0x4b57('0x2f')][_0x4b57('0x73')]?{'message':_0x4b57('0x74'),'statusCode':_0x4e4bbd[_0x4b57('0x71')]}:_0x4e4bbd);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 387124f..b3011b8 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 _0x482c=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e3f0f,_0x16c6c7){var _0xbd8d66=function(_0x3f4da4){while(--_0x3f4da4){_0x5e3f0f['push'](_0x5e3f0f['shift']());}};_0xbd8d66(++_0x16c6c7);}(_0x482c,0x8e));var _0xc482=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x482c[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xc482('0x0'));var util=require(_0xc482('0x1'));var logger=require(_0xc482('0x2'))(_0xc482('0x3'));var moment=require(_0xc482('0x4'));var BPromise=require(_0xc482('0x5'));var rp=require(_0xc482('0x6'));var fs=require('fs');var path=require(_0xc482('0x7'));var rimraf=require(_0xc482('0x8'));var config=require(_0xc482('0x9'));var attributes=require(_0xc482('0xa'));var integrations=require(_0xc482('0xb'));module['exports']=function(_0x49b49c,_0x17009f){return _0x49b49c[_0xc482('0xc')](_0xc482('0xd'),attributes,{'tableName':_0xc482('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x387c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x29f822,_0x59d977){var _0x2fe6f3=function(_0x355fb6){while(--_0x355fb6){_0x29f822['push'](_0x29f822['shift']());}};_0x2fe6f3(++_0x59d977);}(_0x387c,0x1a4));var _0xc387=function(_0xea6018,_0x4cf082){_0xea6018=_0xea6018-0x0;var _0x57b54d=_0x387c[_0xea6018];return _0x57b54d;};'use strict';var _=require(_0xc387('0x0'));var util=require(_0xc387('0x1'));var logger=require(_0xc387('0x2'))(_0xc387('0x3'));var moment=require('moment');var BPromise=require(_0xc387('0x4'));var rp=require(_0xc387('0x5'));var fs=require('fs');var path=require(_0xc387('0x6'));var rimraf=require(_0xc387('0x7'));var config=require(_0xc387('0x8'));var attributes=require(_0xc387('0x9'));var integrations=require(_0xc387('0xa'));module['exports']=function(_0x4d3a51,_0x23a2ad){return _0x4d3a51[_0xc387('0xb')](_0xc387('0xc'),attributes,{'tableName':_0xc387('0xd'),'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 c6edece..836bf67 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 _0x2f91=['GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','model','include','where','ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x482934,_0x5ad2b9){var _0x130ec2=function(_0x29a84e){while(--_0x29a84e){_0x482934['push'](_0x482934['shift']());}};_0x130ec2(++_0x5ad2b9);}(_0x2f91,0x98));var _0x12f9=function(_0x22da31,_0x5cc256){_0x22da31=_0x22da31-0x0;var _0x2c7e2c=_0x2f91[_0x22da31];return _0x2c7e2c;};'use strict';var _=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var moment=require(_0x12f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x12f9('0x3'));var fs=require('fs');var Redis=require(_0x12f9('0x4'));var db=require(_0x12f9('0x5'))['db'];var utils=require(_0x12f9('0x6'));var logger=require('../../config/logger')(_0x12f9('0x7'));var config=require(_0x12f9('0x8'));var jayson=require(_0x12f9('0x9'));var client=jayson[_0x12f9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7811e,_0x7b1ba,_0x4ea10c){return new BPromise(function(_0x5b892a,_0x4da69c){return client[_0x12f9('0xb')](_0x7811e,_0x4ea10c)[_0x12f9('0xc')](function(_0x42b029){logger[_0x12f9('0xd')](_0x12f9('0xe'),_0x7b1ba,_0x12f9('0xf'));logger[_0x12f9('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x7b1ba,'request\x20sent',JSON[_0x12f9('0x11')](_0x42b029));if(_0x42b029[_0x12f9('0x12')]){if(_0x42b029[_0x12f9('0x12')][_0x12f9('0x13')]===0x1f4){logger[_0x12f9('0x12')](_0x12f9('0xe'),_0x7b1ba,_0x42b029[_0x12f9('0x12')]['message']);return _0x4da69c(_0x42b029[_0x12f9('0x12')][_0x12f9('0x14')]);}logger[_0x12f9('0x12')](_0x12f9('0xe'),_0x7b1ba,_0x42b029[_0x12f9('0x12')][_0x12f9('0x14')]);return _0x5b892a(_0x42b029['error']['message']);}else{logger['info'](_0x12f9('0xe'),_0x7b1ba,_0x12f9('0xf'));_0x5b892a(_0x42b029[_0x12f9('0x15')][_0x12f9('0x14')]);}})[_0x12f9('0x16')](function(_0x6847f3){logger[_0x12f9('0x12')](_0x12f9('0xe'),_0x7b1ba,_0x6847f3);_0x4da69c(_0x6847f3);});});}exports[_0x12f9('0x17')]=function(_0x25fc24){var _0x74b655=this;return new Promise(function(_0x308a1e,_0x5a5807){return db[_0x12f9('0x18')][_0x12f9('0x19')]({'raw':_0x25fc24[_0x12f9('0x1a')]?_0x25fc24['options'][_0x12f9('0x1b')]===undefined?!![]:![]:!![],'where':_0x25fc24[_0x12f9('0x1a')]?_0x25fc24[_0x12f9('0x1a')]['where']||null:null,'attributes':_0x25fc24[_0x12f9('0x1a')]?_0x25fc24[_0x12f9('0x1a')][_0x12f9('0x1c')]||null:null,'limit':_0x25fc24[_0x12f9('0x1a')]?_0x25fc24['options'][_0x12f9('0x1d')]||null:null,'include':_0x25fc24[_0x12f9('0x1a')]?_0x25fc24[_0x12f9('0x1a')]['include']?_[_0x12f9('0x1e')](_0x25fc24[_0x12f9('0x1a')]['include'],function(_0x3d242a){return{'model':db[_0x3d242a[_0x12f9('0x1f')]],'as':_0x3d242a['as'],'attributes':_0x3d242a[_0x12f9('0x1c')],'include':_0x3d242a['include']?_[_0x12f9('0x1e')](_0x3d242a[_0x12f9('0x20')],function(_0x5c21d4){return{'model':db[_0x5c21d4[_0x12f9('0x1f')]],'as':_0x5c21d4['as'],'attributes':_0x5c21d4[_0x12f9('0x1c')],'include':_0x5c21d4[_0x12f9('0x20')]?_['map'](_0x5c21d4[_0x12f9('0x20')],function(_0x4080f8){return{'model':db[_0x4080f8[_0x12f9('0x1f')]],'as':_0x4080f8['as'],'attributes':_0x4080f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37551a){logger[_0x12f9('0xd')]('GetZendeskAccount',_0x25fc24);logger[_0x12f9('0x10')]('GetZendeskAccount',_0x25fc24,JSON[_0x12f9('0x11')](_0x37551a));_0x308a1e(_0x37551a);})['catch'](function(_0x3ab9ff){logger[_0x12f9('0x12')]('GetZendeskAccount',_0x3ab9ff[_0x12f9('0x14')],_0x25fc24);_0x5a5807(_0x74b655[_0x12f9('0x12')](0x1f4,_0x3ab9ff[_0x12f9('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x1b1266){var _0x24060c=this;return new Promise(function(_0x4ae6bd,_0x4117dc){return db[_0x12f9('0x18')]['find']({'raw':_0x1b1266[_0x12f9('0x1a')]?_0x1b1266['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b1266[_0x12f9('0x1a')]?_0x1b1266[_0x12f9('0x1a')][_0x12f9('0x21')]||null:null,'attributes':_0x1b1266[_0x12f9('0x1a')]?_0x1b1266[_0x12f9('0x1a')][_0x12f9('0x1c')]||null:null,'include':_0x1b1266[_0x12f9('0x1a')]?_0x1b1266[_0x12f9('0x1a')]['include']?_['map'](_0x1b1266['options'][_0x12f9('0x20')],function(_0x37459c){return{'model':db[_0x37459c['model']],'as':_0x37459c['as'],'attributes':_0x37459c[_0x12f9('0x1c')],'include':_0x37459c[_0x12f9('0x20')]?_[_0x12f9('0x1e')](_0x37459c[_0x12f9('0x20')],function(_0x23609a){return{'model':db[_0x23609a[_0x12f9('0x1f')]],'as':_0x23609a['as'],'attributes':_0x23609a[_0x12f9('0x1c')],'include':_0x23609a[_0x12f9('0x20')]?_[_0x12f9('0x1e')](_0x23609a[_0x12f9('0x20')],function(_0x5b9a7e){return{'model':db[_0x5b9a7e['model']],'as':_0x5b9a7e['as'],'attributes':_0x5b9a7e[_0x12f9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2323ef){logger[_0x12f9('0xd')]('ShowZendeskAccount',_0x1b1266);logger[_0x12f9('0x10')](_0x12f9('0x22'),_0x1b1266,JSON[_0x12f9('0x11')](_0x2323ef));_0x4ae6bd(_0x2323ef);})[_0x12f9('0x16')](function(_0x3530e4){logger[_0x12f9('0x12')](_0x12f9('0x22'),_0x3530e4[_0x12f9('0x14')],_0x1b1266);_0x4117dc(_0x24060c[_0x12f9('0x12')](0x1f4,_0x3530e4['message']));});});}; \ No newline at end of file +var _0x0efc=['client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','find','raw','ShowZendeskAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efc,0x1b2));var _0xc0ef=function(_0x9fe3ce,_0x24796e){_0x9fe3ce=_0x9fe3ce-0x0;var _0x7aa9a0=_0x0efc[_0x9fe3ce];return _0x7aa9a0;};'use strict';var _=require(_0xc0ef('0x0'));var util=require(_0xc0ef('0x1'));var moment=require('moment');var BPromise=require(_0xc0ef('0x2'));var rs=require(_0xc0ef('0x3'));var fs=require('fs');var Redis=require(_0xc0ef('0x4'));var db=require(_0xc0ef('0x5'))['db'];var utils=require(_0xc0ef('0x6'));var logger=require(_0xc0ef('0x7'))(_0xc0ef('0x8'));var config=require(_0xc0ef('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc0ef('0xa')][_0xc0ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d237f,_0x154f14,_0x7c5b0e){return new BPromise(function(_0x11b1ce,_0x5b5d09){return client[_0xc0ef('0xc')](_0x5d237f,_0x7c5b0e)[_0xc0ef('0xd')](function(_0x541d80){logger[_0xc0ef('0xe')](_0xc0ef('0xf'),_0x154f14,_0xc0ef('0x10'));logger[_0xc0ef('0x11')](_0xc0ef('0x12'),_0x154f14,'request\x20sent',JSON['stringify'](_0x541d80));if(_0x541d80[_0xc0ef('0x13')]){if(_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x14')]===0x1f4){logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x541d80[_0xc0ef('0x13')]['message']);return _0x5b5d09(_0x541d80['error'][_0xc0ef('0x15')]);}logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x15')]);return _0x11b1ce(_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x15')]);}else{logger[_0xc0ef('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x154f14,'request\x20sent');_0x11b1ce(_0x541d80[_0xc0ef('0x16')][_0xc0ef('0x15')]);}})['catch'](function(_0x1b1024){logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x1b1024);_0x5b5d09(_0x1b1024);});});}exports[_0xc0ef('0x17')]=function(_0x3c309e){var _0x340989=this;return new Promise(function(_0x9677d5,_0xcb6d50){return db[_0xc0ef('0x18')][_0xc0ef('0x19')]({'raw':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3c309e['options']?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1b')]||null:null,'attributes':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1c')]||null:null,'limit':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1d')]||null:null,'include':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1e')]?_['map'](_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1e')],function(_0x25c619){return{'model':db[_0x25c619[_0xc0ef('0x1f')]],'as':_0x25c619['as'],'attributes':_0x25c619[_0xc0ef('0x1c')],'include':_0x25c619[_0xc0ef('0x1e')]?_['map'](_0x25c619[_0xc0ef('0x1e')],function(_0x369601){return{'model':db[_0x369601[_0xc0ef('0x1f')]],'as':_0x369601['as'],'attributes':_0x369601[_0xc0ef('0x1c')],'include':_0x369601[_0xc0ef('0x1e')]?_[_0xc0ef('0x20')](_0x369601[_0xc0ef('0x1e')],function(_0x210591){return{'model':db[_0x210591['model']],'as':_0x210591['as'],'attributes':_0x210591[_0xc0ef('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0ef('0xd')](function(_0x7a19c){logger[_0xc0ef('0xe')](_0xc0ef('0x17'),_0x3c309e);logger[_0xc0ef('0x11')](_0xc0ef('0x17'),_0x3c309e,JSON['stringify'](_0x7a19c));_0x9677d5(_0x7a19c);})['catch'](function(_0x42b9cf){logger['error'](_0xc0ef('0x17'),_0x42b9cf[_0xc0ef('0x15')],_0x3c309e);_0xcb6d50(_0x340989['error'](0x1f4,_0x42b9cf[_0xc0ef('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x3db5c1){var _0x32f57b=this;return new Promise(function(_0x51991e,_0x1cba92){return db[_0xc0ef('0x18')][_0xc0ef('0x21')]({'raw':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1['options'][_0xc0ef('0x22')]===undefined?!![]:![]:!![],'where':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1[_0xc0ef('0x1a')]['where']||null:null,'attributes':_0x3db5c1['options']?_0x3db5c1[_0xc0ef('0x1a')][_0xc0ef('0x1c')]||null:null,'include':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1[_0xc0ef('0x1a')]['include']?_[_0xc0ef('0x20')](_0x3db5c1['options'][_0xc0ef('0x1e')],function(_0x39a551){return{'model':db[_0x39a551[_0xc0ef('0x1f')]],'as':_0x39a551['as'],'attributes':_0x39a551['attributes'],'include':_0x39a551['include']?_[_0xc0ef('0x20')](_0x39a551['include'],function(_0x200029){return{'model':db[_0x200029[_0xc0ef('0x1f')]],'as':_0x200029['as'],'attributes':_0x200029['attributes'],'include':_0x200029['include']?_['map'](_0x200029[_0xc0ef('0x1e')],function(_0x380077){return{'model':db[_0x380077[_0xc0ef('0x1f')]],'as':_0x380077['as'],'attributes':_0x380077[_0xc0ef('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0ef('0xd')](function(_0x3b52ed){logger[_0xc0ef('0xe')](_0xc0ef('0x23'),_0x3db5c1);logger[_0xc0ef('0x11')](_0xc0ef('0x23'),_0x3db5c1,JSON['stringify'](_0x3b52ed));_0x51991e(_0x3b52ed);})[_0xc0ef('0x24')](function(_0x8635ff){logger[_0xc0ef('0x13')](_0xc0ef('0x23'),_0x8635ff[_0xc0ef('0x15')],_0x3db5c1);_0x1cba92(_0x32f57b[_0xc0ef('0x13')](0x1f4,_0x8635ff[_0xc0ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c39925a..ed5a456 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 _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x177488,_0x3aeefa){var _0x328047=function(_0x56d0b6){while(--_0x56d0b6){_0x177488['push'](_0x177488['shift']());}};_0x328047(++_0x3aeefa);}(_0x087b,0x11a));var _0xb087=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x087b[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x4403d5,_0x5ce2a4){var _0x348285=function(_0x56046f){while(--_0x56046f){_0x4403d5['push'](_0x4403d5['shift']());}};_0x348285(++_0x5ce2a4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2630a6,_0x2a1431){_0x2630a6=_0x2630a6-0x0;var _0x46ffce=_0xf4eb[_0x2630a6];return _0x46ffce;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e0a11cb..6ff0983 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 _0x20a0=['exports','STRING','sequelize'];(function(_0x1bc3aa,_0x4a2626){var _0xdb0180=function(_0x13962d){while(--_0x13962d){_0x1bc3aa['push'](_0x1bc3aa['shift']());}};_0xdb0180(++_0x4a2626);}(_0x20a0,0x1b8));var _0x020a=function(_0x2d64c4,_0x289306){_0x2d64c4=_0x2d64c4-0x0;var _0x2fc036=_0x20a0[_0x2d64c4];return _0x2fc036;};'use strict';var Sequelize=require(_0x020a('0x0'));module[_0x020a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x020a('0x2')]}}; \ No newline at end of file +var _0x9a1f=['exports','STRING'];(function(_0x2b7bb0,_0x173e08){var _0x113fd6=function(_0x18cfa4){while(--_0x18cfa4){_0x2b7bb0['push'](_0x2b7bb0['shift']());}};_0x113fd6(++_0x173e08);}(_0x9a1f,0x12e));var _0xf9a1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x9a1f[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module[_0xf9a1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9a1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b32195f..09f24ac 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 _0x69a7=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','params','length','body','find','getFields','ZendeskField','order','nolimit','getSubjects','findOne','getDescriptions','getTags','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xab5395,_0x364cdf){var _0xf62b05=function(_0x34906b){while(--_0x34906b){_0xab5395['push'](_0xab5395['shift']());}};_0xf62b05(++_0x364cdf);}(_0x69a7,0x8e));var _0x769a=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0x69a7[_0x1e91eb];return _0x2af75a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x769a('0x0'));var zipdir=require(_0x769a('0x1'));var jsonpatch=require(_0x769a('0x2'));var rp=require(_0x769a('0x3'));var moment=require(_0x769a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x769a('0x5'));var path=require(_0x769a('0x6'));var sox=require(_0x769a('0x7'));var csv=require('to-csv');var ejs=require(_0x769a('0x8'));var fs=require('fs');var fs_extra=require(_0x769a('0x9'));var _=require(_0x769a('0xa'));var squel=require(_0x769a('0xb'));var crypto=require(_0x769a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x769a('0xd'));var querystring=require(_0x769a('0xe'));var Papa=require(_0x769a('0xf'));var Redis=require('ioredis');var authService=require(_0x769a('0x10'));var qs=require(_0x769a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x769a('0x12'));var logger=require(_0x769a('0x13'))(_0x769a('0x14'));var utils=require(_0x769a('0x15'));var config=require(_0x769a('0x16'));var licenseUtil=require(_0x769a('0x17'));var db=require(_0x769a('0x18'))['db'];function respondWithStatusCode(_0x1f0a2e,_0x4c7047){_0x4c7047=_0x4c7047||0xcc;return function(_0xcb0870){if(_0xcb0870){return _0x1f0a2e[_0x769a('0x19')](_0x4c7047);}return _0x1f0a2e[_0x769a('0x1a')](_0x4c7047)[_0x769a('0x1b')]();};}function respondWithResult(_0x55ecb5,_0x557339){_0x557339=_0x557339||0xc8;return function(_0x2131a7){if(_0x2131a7){return _0x55ecb5['status'](_0x557339)['json'](_0x2131a7);}};}function respondWithFilteredResult(_0x353e80,_0xa70a21){return function(_0x174336){if(_0x174336){var _0xcf560c=typeof _0xa70a21[_0x769a('0x1c')]==='undefined'&&typeof _0xa70a21[_0x769a('0x1d')]===_0x769a('0x1e');var _0x3d2043=_0x174336[_0x769a('0x1f')];var _0x3bc447=_0xcf560c?0x0:_0xa70a21[_0x769a('0x1c')];var _0x2dc2ef=_0xcf560c?_0x174336[_0x769a('0x1f')]:_0xa70a21[_0x769a('0x1c')]+_0xa70a21[_0x769a('0x1d')];var _0x258845;if(_0x2dc2ef>=_0x3d2043){_0x2dc2ef=_0x3d2043;_0x258845=0xc8;}else{_0x258845=0xce;}_0x353e80['status'](_0x258845);return _0x353e80[_0x769a('0x20')](_0x769a('0x21'),_0x3bc447+'-'+_0x2dc2ef+'/'+_0x3d2043)[_0x769a('0x22')](_0x174336);}return null;};}function patchUpdates(_0x479afc){return function(_0x21bf2d){try{jsonpatch[_0x769a('0x23')](_0x21bf2d,_0x479afc,!![]);}catch(_0x52952a){return BPromise[_0x769a('0x24')](_0x52952a);}return _0x21bf2d['save']();};}function saveUpdates(_0x348665,_0x47d272){return function(_0x3d66ad){if(_0x3d66ad){return _0x3d66ad[_0x769a('0x25')](_0x348665)[_0x769a('0x26')](function(_0x1a420c){return _0x1a420c;});}return null;};}function removeEntity(_0x10e6a4,_0x44b106){return function(_0x3c4c47){if(_0x3c4c47){return _0x3c4c47[_0x769a('0x27')]()[_0x769a('0x26')](function(){_0x10e6a4['status'](0xcc)[_0x769a('0x1b')]();});}};}function handleEntityNotFound(_0x2a2795,_0x362a0d){return function(_0x4b47f6){if(!_0x4b47f6){_0x2a2795[_0x769a('0x19')](0x194);}return _0x4b47f6;};}function handleError(_0xc42841,_0x2cc24a){_0x2cc24a=_0x2cc24a||0x1f4;return function(_0x25ce0c){logger[_0x769a('0x28')](_0x25ce0c[_0x769a('0x29')]);if(_0x25ce0c[_0x769a('0x2a')]){delete _0x25ce0c[_0x769a('0x2a')];}_0xc42841[_0x769a('0x1a')](_0x2cc24a)[_0x769a('0x2b')](_0x25ce0c);};}exports['index']=function(_0x3094ff,_0x580a75){var _0x4d1cb6={},_0x41bff1={},_0x2226f4={'count':0x0,'rows':[]};var _0x452bce=_[_0x769a('0x2c')](db[_0x769a('0x2d')][_0x769a('0x2e')],function(_0x2397e0){return{'name':_0x2397e0[_0x769a('0x2f')],'type':_0x2397e0[_0x769a('0x30')][_0x769a('0x31')]};});_0x41bff1[_0x769a('0x32')]=_[_0x769a('0x2c')](_0x452bce,_0x769a('0x2a'));_0x41bff1['query']=_[_0x769a('0x33')](_0x3094ff[_0x769a('0x34')]);_0x41bff1[_0x769a('0x35')]=_[_0x769a('0x36')](_0x41bff1[_0x769a('0x32')],_0x41bff1['query']);_0x4d1cb6[_0x769a('0x37')]=_[_0x769a('0x36')](_0x41bff1[_0x769a('0x32')],qs[_0x769a('0x38')](_0x3094ff[_0x769a('0x34')][_0x769a('0x38')]));_0x4d1cb6[_0x769a('0x37')]=_0x4d1cb6[_0x769a('0x37')]['length']?_0x4d1cb6[_0x769a('0x37')]:_0x41bff1[_0x769a('0x32')];if(!_0x3094ff['query'][_0x769a('0x39')]('nolimit')){_0x4d1cb6[_0x769a('0x1d')]=qs[_0x769a('0x1d')](_0x3094ff[_0x769a('0x34')]['limit']);_0x4d1cb6[_0x769a('0x1c')]=qs[_0x769a('0x1c')](_0x3094ff['query'][_0x769a('0x1c')]);}_0x4d1cb6['order']=qs['sort'](_0x3094ff[_0x769a('0x34')][_0x769a('0x3a')]);_0x4d1cb6['where']=qs['filters'](_[_0x769a('0x3b')](_0x3094ff[_0x769a('0x34')],_0x41bff1[_0x769a('0x35')]),_0x452bce);if(_0x3094ff[_0x769a('0x34')][_0x769a('0x3c')]){_0x4d1cb6['where']=_[_0x769a('0x3d')](_0x4d1cb6[_0x769a('0x3e')],{'$or':_[_0x769a('0x2c')](_0x452bce,function(_0x49caef){if(_0x49caef[_0x769a('0x30')]!=='VIRTUAL'){var _0x48d7b3={};_0x48d7b3[_0x49caef[_0x769a('0x2a')]]={'$like':'%'+_0x3094ff[_0x769a('0x34')]['filter']+'%'};return _0x48d7b3;}})});}_0x4d1cb6=_[_0x769a('0x3d')]({},_0x4d1cb6,_0x3094ff[_0x769a('0x3f')]);var _0x44bed9={'where':_0x4d1cb6[_0x769a('0x3e')]};return db['ZendeskConfiguration'][_0x769a('0x1f')](_0x44bed9)[_0x769a('0x26')](function(_0x1f8bcb){_0x2226f4['count']=_0x1f8bcb;if(_0x3094ff[_0x769a('0x34')][_0x769a('0x40')]){_0x4d1cb6[_0x769a('0x41')]=[{'all':!![]}];}return db[_0x769a('0x2d')][_0x769a('0x42')](_0x4d1cb6);})[_0x769a('0x26')](function(_0x4ab827){_0x2226f4[_0x769a('0x43')]=_0x4ab827;return _0x2226f4;})[_0x769a('0x26')](respondWithFilteredResult(_0x580a75,_0x4d1cb6))[_0x769a('0x44')](handleError(_0x580a75,null));};exports['show']=function(_0x1e872c,_0x57be9a){var _0x5db8a1={'raw':![],'where':{'id':_0x1e872c[_0x769a('0x45')]['id']}},_0x55edd0={};_0x55edd0[_0x769a('0x32')]=_['keys'](db[_0x769a('0x2d')][_0x769a('0x2e')]);_0x55edd0['query']=_[_0x769a('0x33')](_0x1e872c['query']);_0x55edd0[_0x769a('0x35')]=_['intersection'](_0x55edd0[_0x769a('0x32')],_0x55edd0[_0x769a('0x34')]);_0x5db8a1[_0x769a('0x37')]=_[_0x769a('0x36')](_0x55edd0[_0x769a('0x32')],qs[_0x769a('0x38')](_0x1e872c[_0x769a('0x34')][_0x769a('0x38')]));_0x5db8a1[_0x769a('0x37')]=_0x5db8a1[_0x769a('0x37')][_0x769a('0x46')]?_0x5db8a1[_0x769a('0x37')]:_0x55edd0[_0x769a('0x32')];if(_0x1e872c['query'][_0x769a('0x40')]){_0x5db8a1[_0x769a('0x41')]=[{'all':!![]}];}_0x5db8a1=_[_0x769a('0x3d')]({},_0x5db8a1,_0x1e872c[_0x769a('0x3f')]);return db['ZendeskConfiguration']['find'](_0x5db8a1)[_0x769a('0x26')](handleEntityNotFound(_0x57be9a,null))[_0x769a('0x26')](respondWithResult(_0x57be9a,null))[_0x769a('0x44')](handleError(_0x57be9a,null));};exports['create']=function(_0x5e54c2,_0x424cf2){return db[_0x769a('0x2d')]['create'](_0x5e54c2[_0x769a('0x47')],{})[_0x769a('0x26')](respondWithResult(_0x424cf2,0xc9))['catch'](handleError(_0x424cf2,null));};exports[_0x769a('0x25')]=function(_0x382c11,_0x51a652){if(_0x382c11[_0x769a('0x47')]['id']){delete _0x382c11[_0x769a('0x47')]['id'];}return db[_0x769a('0x2d')][_0x769a('0x48')]({'where':{'id':_0x382c11[_0x769a('0x45')]['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x51a652,null))[_0x769a('0x26')](saveUpdates(_0x382c11[_0x769a('0x47')],null))[_0x769a('0x26')](respondWithResult(_0x51a652,null))[_0x769a('0x44')](handleError(_0x51a652,null));};exports[_0x769a('0x27')]=function(_0x29f3c2,_0x20581a){return db[_0x769a('0x2d')][_0x769a('0x48')]({'where':{'id':_0x29f3c2[_0x769a('0x45')]['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x20581a,null))[_0x769a('0x26')](removeEntity(_0x20581a,null))['catch'](handleError(_0x20581a,null));};exports[_0x769a('0x49')]=function(_0x25183e,_0x1bb5b4,_0x441cad){var _0x57fd65={};var _0x3cf334={};var _0x7fe40b;var _0x1b486f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x25183e[_0x769a('0x45')]['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x1bb5b4,null))[_0x769a('0x26')](function(_0x5e7113){if(_0x5e7113){_0x7fe40b=_0x5e7113;_0x3cf334[_0x769a('0x32')]=_[_0x769a('0x33')](db[_0x769a('0x4a')][_0x769a('0x2e')]);_0x3cf334[_0x769a('0x34')]=_[_0x769a('0x33')](_0x25183e[_0x769a('0x34')]);_0x3cf334[_0x769a('0x35')]=_[_0x769a('0x36')](_0x3cf334['model'],_0x3cf334[_0x769a('0x34')]);_0x57fd65['attributes']=_[_0x769a('0x36')](_0x3cf334['model'],qs[_0x769a('0x38')](_0x25183e[_0x769a('0x34')]['fields']));_0x57fd65[_0x769a('0x37')]=_0x57fd65['attributes']['length']?_0x57fd65['attributes']:_0x3cf334[_0x769a('0x32')];_0x57fd65[_0x769a('0x4b')]=qs[_0x769a('0x3a')](_0x25183e[_0x769a('0x34')][_0x769a('0x3a')]);_0x57fd65['where']=qs[_0x769a('0x35')](_[_0x769a('0x3b')](_0x25183e['query'],_0x3cf334[_0x769a('0x35')]));if(_0x25183e[_0x769a('0x34')][_0x769a('0x3c')]){_0x57fd65['where']=_[_0x769a('0x3d')](_0x57fd65['where'],{'$or':_[_0x769a('0x2c')](_0x57fd65['attributes'],function(_0x262a91){var _0x102e39={};_0x102e39[_0x262a91]={'$like':'%'+_0x25183e['query'][_0x769a('0x3c')]+'%'};return _0x102e39;})});}_0x57fd65=_[_0x769a('0x3d')]({},_0x57fd65,_0x25183e[_0x769a('0x3f')]);return _0x7fe40b[_0x769a('0x49')](_0x57fd65);}})[_0x769a('0x26')](function(_0x1b0913){if(_0x1b0913){_0x1b486f=_0x1b0913['length'];if(!_0x25183e[_0x769a('0x34')][_0x769a('0x39')](_0x769a('0x4c'))){_0x57fd65[_0x769a('0x1d')]=qs['limit'](_0x25183e[_0x769a('0x34')]['limit']);_0x57fd65[_0x769a('0x1c')]=qs[_0x769a('0x1c')](_0x25183e[_0x769a('0x34')]['offset']);}return _0x7fe40b[_0x769a('0x49')](_0x57fd65);}})[_0x769a('0x26')](function(_0x116af0){if(_0x116af0){return _0x116af0?{'count':_0x1b486f,'rows':_0x116af0}:null;}})[_0x769a('0x26')](respondWithResult(_0x1bb5b4,null))[_0x769a('0x44')](handleError(_0x1bb5b4,null));};exports[_0x769a('0x4d')]=function(_0x2eb88e,_0x140e55,_0x2c425e){var _0x278c63={};var _0x4ec795={};var _0x2a7141;var _0x49a331;return db[_0x769a('0x2d')][_0x769a('0x4e')]({'where':{'id':_0x2eb88e[_0x769a('0x45')]['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x140e55,null))[_0x769a('0x26')](function(_0x47f81d){if(_0x47f81d){_0x2a7141=_0x47f81d;_0x4ec795[_0x769a('0x32')]=_[_0x769a('0x33')](db[_0x769a('0x4a')][_0x769a('0x2e')]);_0x4ec795[_0x769a('0x34')]=_[_0x769a('0x33')](_0x2eb88e[_0x769a('0x34')]);_0x4ec795['filters']=_['intersection'](_0x4ec795[_0x769a('0x32')],_0x4ec795[_0x769a('0x34')]);_0x278c63[_0x769a('0x37')]=_['intersection'](_0x4ec795['model'],qs['fields'](_0x2eb88e[_0x769a('0x34')][_0x769a('0x38')]));_0x278c63[_0x769a('0x37')]=_0x278c63[_0x769a('0x37')]['length']?_0x278c63[_0x769a('0x37')]:_0x4ec795[_0x769a('0x32')];_0x278c63[_0x769a('0x4b')]=qs[_0x769a('0x3a')](_0x2eb88e[_0x769a('0x34')][_0x769a('0x3a')]);_0x278c63[_0x769a('0x3e')]=qs[_0x769a('0x35')](_[_0x769a('0x3b')](_0x2eb88e[_0x769a('0x34')],_0x4ec795[_0x769a('0x35')]));if(_0x2eb88e['query']['filter']){_0x278c63[_0x769a('0x3e')]=_['merge'](_0x278c63['where'],{'$or':_[_0x769a('0x2c')](_0x278c63['attributes'],function(_0x2316d3){var _0x19866d={};_0x19866d[_0x2316d3]={'$like':'%'+_0x2eb88e[_0x769a('0x34')][_0x769a('0x3c')]+'%'};return _0x19866d;})});}_0x278c63=_[_0x769a('0x3d')]({},_0x278c63,_0x2eb88e[_0x769a('0x3f')]);return _0x2a7141[_0x769a('0x4d')](_0x278c63);}})[_0x769a('0x26')](function(_0x326bd1){if(_0x326bd1){_0x49a331=_0x326bd1[_0x769a('0x46')];if(!_0x2eb88e[_0x769a('0x34')][_0x769a('0x39')](_0x769a('0x4c'))){_0x278c63[_0x769a('0x1d')]=qs[_0x769a('0x1d')](_0x2eb88e['query']['limit']);_0x278c63[_0x769a('0x1c')]=qs[_0x769a('0x1c')](_0x2eb88e['query'][_0x769a('0x1c')]);}return _0x2a7141[_0x769a('0x4d')](_0x278c63);}})['then'](function(_0x18a95f){if(_0x18a95f){return _0x18a95f?{'count':_0x49a331,'rows':_0x18a95f}:null;}})[_0x769a('0x26')](respondWithResult(_0x140e55,null))[_0x769a('0x44')](handleError(_0x140e55,null));};exports[_0x769a('0x4f')]=function(_0x385215,_0x458afe,_0x59166c){var _0x4bc808={};var _0x1b545b={};var _0x4b754f;var _0x5d1a61;return db[_0x769a('0x2d')]['findOne']({'where':{'id':_0x385215['params']['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x458afe,null))['then'](function(_0x2f8c84){if(_0x2f8c84){_0x4b754f=_0x2f8c84;_0x1b545b[_0x769a('0x32')]=_[_0x769a('0x33')](db[_0x769a('0x4a')][_0x769a('0x2e')]);_0x1b545b[_0x769a('0x34')]=_['keys'](_0x385215['query']);_0x1b545b[_0x769a('0x35')]=_[_0x769a('0x36')](_0x1b545b[_0x769a('0x32')],_0x1b545b[_0x769a('0x34')]);_0x4bc808['attributes']=_[_0x769a('0x36')](_0x1b545b['model'],qs['fields'](_0x385215[_0x769a('0x34')][_0x769a('0x38')]));_0x4bc808[_0x769a('0x37')]=_0x4bc808[_0x769a('0x37')][_0x769a('0x46')]?_0x4bc808[_0x769a('0x37')]:_0x1b545b[_0x769a('0x32')];_0x4bc808[_0x769a('0x4b')]=qs[_0x769a('0x3a')](_0x385215[_0x769a('0x34')][_0x769a('0x3a')]);_0x4bc808[_0x769a('0x3e')]=qs[_0x769a('0x35')](_['pick'](_0x385215['query'],_0x1b545b[_0x769a('0x35')]));if(_0x385215['query']['filter']){_0x4bc808[_0x769a('0x3e')]=_[_0x769a('0x3d')](_0x4bc808['where'],{'$or':_[_0x769a('0x2c')](_0x4bc808[_0x769a('0x37')],function(_0x3cd0fc){var _0x3389a2={};_0x3389a2[_0x3cd0fc]={'$like':'%'+_0x385215[_0x769a('0x34')][_0x769a('0x3c')]+'%'};return _0x3389a2;})});}_0x4bc808=_['merge']({},_0x4bc808,_0x385215[_0x769a('0x3f')]);return _0x4b754f['getDescriptions'](_0x4bc808);}})[_0x769a('0x26')](function(_0x56690e){if(_0x56690e){_0x5d1a61=_0x56690e[_0x769a('0x46')];if(!_0x385215[_0x769a('0x34')][_0x769a('0x39')](_0x769a('0x4c'))){_0x4bc808[_0x769a('0x1d')]=qs[_0x769a('0x1d')](_0x385215[_0x769a('0x34')][_0x769a('0x1d')]);_0x4bc808[_0x769a('0x1c')]=qs['offset'](_0x385215[_0x769a('0x34')][_0x769a('0x1c')]);}return _0x4b754f[_0x769a('0x4f')](_0x4bc808);}})[_0x769a('0x26')](function(_0xad5d67){if(_0xad5d67){return _0xad5d67?{'count':_0x5d1a61,'rows':_0xad5d67}:null;}})[_0x769a('0x26')](respondWithResult(_0x458afe,null))[_0x769a('0x44')](handleError(_0x458afe,null));};exports[_0x769a('0x50')]=function(_0x53d23e,_0x4abe60,_0x3dfead){var _0x567cda={};var _0x54b5ab={};var _0x165aba;var _0x169566;return db[_0x769a('0x2d')]['findOne']({'where':{'id':_0x53d23e[_0x769a('0x45')]['id']}})['then'](handleEntityNotFound(_0x4abe60,null))[_0x769a('0x26')](function(_0x18d038){if(_0x18d038){_0x165aba=_0x18d038;_0x54b5ab[_0x769a('0x32')]=_['keys'](db['Tag'][_0x769a('0x2e')]);_0x54b5ab[_0x769a('0x34')]=_['keys'](_0x53d23e[_0x769a('0x34')]);_0x54b5ab[_0x769a('0x35')]=_[_0x769a('0x36')](_0x54b5ab[_0x769a('0x32')],_0x54b5ab[_0x769a('0x34')]);_0x567cda[_0x769a('0x37')]=_[_0x769a('0x36')](_0x54b5ab['model'],qs[_0x769a('0x38')](_0x53d23e[_0x769a('0x34')][_0x769a('0x38')]));_0x567cda[_0x769a('0x37')]=_0x567cda[_0x769a('0x37')][_0x769a('0x46')]?_0x567cda[_0x769a('0x37')]:_0x54b5ab[_0x769a('0x32')];_0x567cda['order']=qs[_0x769a('0x3a')](_0x53d23e[_0x769a('0x34')][_0x769a('0x3a')]);_0x567cda[_0x769a('0x3e')]=qs['filters'](_[_0x769a('0x3b')](_0x53d23e[_0x769a('0x34')],_0x54b5ab['filters']));if(_0x53d23e['query'][_0x769a('0x3c')]){_0x567cda[_0x769a('0x3e')]=_[_0x769a('0x3d')](_0x567cda[_0x769a('0x3e')],{'$or':_[_0x769a('0x2c')](_0x567cda['attributes'],function(_0xba6bd7){var _0x58738c={};_0x58738c[_0xba6bd7]={'$like':'%'+_0x53d23e['query'][_0x769a('0x3c')]+'%'};return _0x58738c;})});}_0x567cda=_[_0x769a('0x3d')]({},_0x567cda,_0x53d23e['options']);return _0x165aba[_0x769a('0x50')](_0x567cda);}})[_0x769a('0x26')](function(_0x264551){if(_0x264551){_0x169566=_0x264551[_0x769a('0x46')];if(!_0x53d23e[_0x769a('0x34')][_0x769a('0x39')](_0x769a('0x4c'))){_0x567cda[_0x769a('0x1d')]=qs[_0x769a('0x1d')](_0x53d23e[_0x769a('0x34')][_0x769a('0x1d')]);_0x567cda[_0x769a('0x1c')]=qs[_0x769a('0x1c')](_0x53d23e['query']['offset']);}return _0x165aba[_0x769a('0x50')](_0x567cda);}})['then'](function(_0x3f3c26){if(_0x3f3c26){return _0x3f3c26?{'count':_0x169566,'rows':_0x3f3c26}:null;}})['then'](respondWithResult(_0x4abe60,null))[_0x769a('0x44')](handleError(_0x4abe60,null));};exports['setTags']=function(_0x396fde,_0x456ff3,_0x1597bc){if(_0x396fde[_0x769a('0x47')]['id']){delete _0x396fde[_0x769a('0x47')]['id'];}return db[_0x769a('0x2d')]['findOne']({'where':{'id':_0x396fde[_0x769a('0x45')]['id']}})[_0x769a('0x26')](handleEntityNotFound(_0x456ff3,null))['then'](function(_0x51ecf5){if(_0x51ecf5){return _0x51ecf5[_0x769a('0x51')](_0x396fde[_0x769a('0x47')]['ids']||[]);}return null;})[_0x769a('0x26')](respondWithResult(_0x456ff3,null))[_0x769a('0x44')](handleError(_0x456ff3,null));}; \ No newline at end of file +var _0x435a=['../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','save','then','destroy','end','error','stack','name','send','ZendeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','order','merge','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x435a,0x1d0));var _0xa435=function(_0x1769e5,_0x449f13){_0x1769e5=_0x1769e5-0x0;var _0x153de8=_0x435a[_0x1769e5];return _0x153de8;};'use strict';var emlformat=require(_0xa435('0x0'));var rimraf=require(_0xa435('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa435('0x2'));var rp=require(_0xa435('0x3'));var moment=require(_0xa435('0x4'));var BPromise=require(_0xa435('0x5'));var Mustache=require(_0xa435('0x6'));var util=require(_0xa435('0x7'));var path=require(_0xa435('0x8'));var sox=require(_0xa435('0x9'));var csv=require(_0xa435('0xa'));var ejs=require(_0xa435('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa435('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa435('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa435('0xa'));var querystring=require('querystring');var Papa=require(_0xa435('0xe'));var Redis=require('ioredis');var authService=require(_0xa435('0xf'));var qs=require(_0xa435('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa435('0x11'));var logger=require(_0xa435('0x12'))(_0xa435('0x13'));var utils=require(_0xa435('0x14'));var config=require(_0xa435('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa435('0x16'))['db'];function respondWithStatusCode(_0x33057f,_0x126fa8){_0x126fa8=_0x126fa8||0xcc;return function(_0x3da2e2){if(_0x3da2e2){return _0x33057f[_0xa435('0x17')](_0x126fa8);}return _0x33057f[_0xa435('0x18')](_0x126fa8)['end']();};}function respondWithResult(_0x37b9e7,_0xa894){_0xa894=_0xa894||0xc8;return function(_0x3aa527){if(_0x3aa527){return _0x37b9e7[_0xa435('0x18')](_0xa894)[_0xa435('0x19')](_0x3aa527);}};}function respondWithFilteredResult(_0x3f20b1,_0x3edd11){return function(_0x1cc6f4){if(_0x1cc6f4){var _0x1767dc=typeof _0x3edd11['offset']===_0xa435('0x1a')&&typeof _0x3edd11[_0xa435('0x1b')]===_0xa435('0x1a');var _0x94d907=_0x1cc6f4['count'];var _0x59f8fd=_0x1767dc?0x0:_0x3edd11[_0xa435('0x1c')];var _0x33d02c=_0x1767dc?_0x1cc6f4[_0xa435('0x1d')]:_0x3edd11[_0xa435('0x1c')]+_0x3edd11[_0xa435('0x1b')];var _0x4ba853;if(_0x33d02c>=_0x94d907){_0x33d02c=_0x94d907;_0x4ba853=0xc8;}else{_0x4ba853=0xce;}_0x3f20b1[_0xa435('0x18')](_0x4ba853);return _0x3f20b1[_0xa435('0x1e')](_0xa435('0x1f'),_0x59f8fd+'-'+_0x33d02c+'/'+_0x94d907)['json'](_0x1cc6f4);}return null;};}function patchUpdates(_0x39d11e){return function(_0x2694c6){try{jsonpatch['apply'](_0x2694c6,_0x39d11e,!![]);}catch(_0x56fd86){return BPromise['reject'](_0x56fd86);}return _0x2694c6[_0xa435('0x20')]();};}function saveUpdates(_0x309f48,_0x442b39){return function(_0x33504d){if(_0x33504d){return _0x33504d['update'](_0x309f48)[_0xa435('0x21')](function(_0x76a890){return _0x76a890;});}return null;};}function removeEntity(_0x5017fc,_0x1b3496){return function(_0x433c9d){if(_0x433c9d){return _0x433c9d[_0xa435('0x22')]()[_0xa435('0x21')](function(){_0x5017fc['status'](0xcc)[_0xa435('0x23')]();});}};}function handleEntityNotFound(_0x5c7104,_0x80b96d){return function(_0x1e7c99){if(!_0x1e7c99){_0x5c7104[_0xa435('0x17')](0x194);}return _0x1e7c99;};}function handleError(_0x126c78,_0x3fa82d){_0x3fa82d=_0x3fa82d||0x1f4;return function(_0x5204b1){logger[_0xa435('0x24')](_0x5204b1[_0xa435('0x25')]);if(_0x5204b1['name']){delete _0x5204b1[_0xa435('0x26')];}_0x126c78[_0xa435('0x18')](_0x3fa82d)[_0xa435('0x27')](_0x5204b1);};}exports['index']=function(_0x231c2c,_0x388ced){var _0x1fec47={},_0x3f10c8={},_0x26cb48={'count':0x0,'rows':[]};var _0x3c9682=_['map'](db[_0xa435('0x28')][_0xa435('0x29')],function(_0x2f9493){return{'name':_0x2f9493['fieldName'],'type':_0x2f9493[_0xa435('0x2a')][_0xa435('0x2b')]};});_0x3f10c8[_0xa435('0x2c')]=_[_0xa435('0x2d')](_0x3c9682,'name');_0x3f10c8[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x231c2c['query']);_0x3f10c8[_0xa435('0x30')]=_['intersection'](_0x3f10c8[_0xa435('0x2c')],_0x3f10c8[_0xa435('0x2e')]);_0x1fec47['attributes']=_[_0xa435('0x31')](_0x3f10c8[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x231c2c[_0xa435('0x2e')][_0xa435('0x32')]));_0x1fec47[_0xa435('0x33')]=_0x1fec47[_0xa435('0x33')][_0xa435('0x34')]?_0x1fec47['attributes']:_0x3f10c8['model'];if(!_0x231c2c['query'][_0xa435('0x35')](_0xa435('0x36'))){_0x1fec47[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x231c2c['query'][_0xa435('0x1b')]);_0x1fec47['offset']=qs[_0xa435('0x1c')](_0x231c2c[_0xa435('0x2e')]['offset']);}_0x1fec47['order']=qs[_0xa435('0x37')](_0x231c2c['query'][_0xa435('0x37')]);_0x1fec47[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x231c2c['query'],_0x3f10c8[_0xa435('0x30')]),_0x3c9682);if(_0x231c2c['query'][_0xa435('0x3a')]){_0x1fec47[_0xa435('0x38')]=_['merge'](_0x1fec47[_0xa435('0x38')],{'$or':_['map'](_0x3c9682,function(_0x1b8846){if(_0x1b8846[_0xa435('0x2a')]!=='VIRTUAL'){var _0x11548a={};_0x11548a[_0x1b8846[_0xa435('0x26')]]={'$like':'%'+_0x231c2c[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x11548a;}})});}_0x1fec47=_['merge']({},_0x1fec47,_0x231c2c[_0xa435('0x3b')]);var _0x38fc30={'where':_0x1fec47[_0xa435('0x38')]};return db[_0xa435('0x28')][_0xa435('0x1d')](_0x38fc30)[_0xa435('0x21')](function(_0x1e6cb3){_0x26cb48[_0xa435('0x1d')]=_0x1e6cb3;if(_0x231c2c[_0xa435('0x2e')][_0xa435('0x3c')]){_0x1fec47[_0xa435('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xa435('0x3e')](_0x1fec47);})[_0xa435('0x21')](function(_0x483902){_0x26cb48[_0xa435('0x3f')]=_0x483902;return _0x26cb48;})[_0xa435('0x21')](respondWithFilteredResult(_0x388ced,_0x1fec47))[_0xa435('0x40')](handleError(_0x388ced,null));};exports[_0xa435('0x41')]=function(_0x25a5fb,_0x157097){var _0x25bcd3={'raw':![],'where':{'id':_0x25a5fb[_0xa435('0x42')]['id']}},_0x6b5984={};_0x6b5984[_0xa435('0x2c')]=_[_0xa435('0x2f')](db[_0xa435('0x28')][_0xa435('0x29')]);_0x6b5984[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x25a5fb['query']);_0x6b5984[_0xa435('0x30')]=_['intersection'](_0x6b5984['model'],_0x6b5984[_0xa435('0x2e')]);_0x25bcd3[_0xa435('0x33')]=_['intersection'](_0x6b5984[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x25a5fb[_0xa435('0x2e')][_0xa435('0x32')]));_0x25bcd3['attributes']=_0x25bcd3['attributes']['length']?_0x25bcd3[_0xa435('0x33')]:_0x6b5984[_0xa435('0x2c')];if(_0x25a5fb[_0xa435('0x2e')]['includeAll']){_0x25bcd3['include']=[{'all':!![]}];}_0x25bcd3=_['merge']({},_0x25bcd3,_0x25a5fb[_0xa435('0x3b')]);return db['ZendeskConfiguration'][_0xa435('0x43')](_0x25bcd3)[_0xa435('0x21')](handleEntityNotFound(_0x157097,null))[_0xa435('0x21')](respondWithResult(_0x157097,null))['catch'](handleError(_0x157097,null));};exports[_0xa435('0x44')]=function(_0x23b529,_0x27d7f7){return db[_0xa435('0x28')]['create'](_0x23b529[_0xa435('0x45')],{})[_0xa435('0x21')](respondWithResult(_0x27d7f7,0xc9))['catch'](handleError(_0x27d7f7,null));};exports['update']=function(_0x56c2bc,_0x5ebcdc){if(_0x56c2bc[_0xa435('0x45')]['id']){delete _0x56c2bc[_0xa435('0x45')]['id'];}return db[_0xa435('0x28')]['find']({'where':{'id':_0x56c2bc[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x5ebcdc,null))[_0xa435('0x21')](saveUpdates(_0x56c2bc['body'],null))[_0xa435('0x21')](respondWithResult(_0x5ebcdc,null))['catch'](handleError(_0x5ebcdc,null));};exports[_0xa435('0x22')]=function(_0x56ae62,_0x45e849){return db[_0xa435('0x28')][_0xa435('0x43')]({'where':{'id':_0x56ae62[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x45e849,null))[_0xa435('0x21')](removeEntity(_0x45e849,null))[_0xa435('0x40')](handleError(_0x45e849,null));};exports[_0xa435('0x46')]=function(_0x171231,_0x24ea35,_0x35c65c){var _0x1a51de={};var _0x4510a8={};var _0x2069ea;var _0x1a149;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x171231[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x24ea35,null))[_0xa435('0x21')](function(_0x38b33e){if(_0x38b33e){_0x2069ea=_0x38b33e;_0x4510a8['model']=_[_0xa435('0x2f')](db[_0xa435('0x48')]['rawAttributes']);_0x4510a8[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x171231[_0xa435('0x2e')]);_0x4510a8['filters']=_[_0xa435('0x31')](_0x4510a8[_0xa435('0x2c')],_0x4510a8['query']);_0x1a51de[_0xa435('0x33')]=_['intersection'](_0x4510a8[_0xa435('0x2c')],qs['fields'](_0x171231['query'][_0xa435('0x32')]));_0x1a51de['attributes']=_0x1a51de['attributes'][_0xa435('0x34')]?_0x1a51de[_0xa435('0x33')]:_0x4510a8[_0xa435('0x2c')];_0x1a51de[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x171231[_0xa435('0x2e')][_0xa435('0x37')]);_0x1a51de[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x171231[_0xa435('0x2e')],_0x4510a8['filters']));if(_0x171231[_0xa435('0x2e')]['filter']){_0x1a51de[_0xa435('0x38')]=_['merge'](_0x1a51de['where'],{'$or':_[_0xa435('0x2d')](_0x1a51de[_0xa435('0x33')],function(_0x113b31){var _0x549af9={};_0x549af9[_0x113b31]={'$like':'%'+_0x171231[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x549af9;})});}_0x1a51de=_[_0xa435('0x4a')]({},_0x1a51de,_0x171231[_0xa435('0x3b')]);return _0x2069ea[_0xa435('0x46')](_0x1a51de);}})[_0xa435('0x21')](function(_0x36f0dc){if(_0x36f0dc){_0x1a149=_0x36f0dc[_0xa435('0x34')];if(!_0x171231[_0xa435('0x2e')][_0xa435('0x35')](_0xa435('0x36'))){_0x1a51de[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x171231[_0xa435('0x2e')][_0xa435('0x1b')]);_0x1a51de[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x171231[_0xa435('0x2e')][_0xa435('0x1c')]);}return _0x2069ea[_0xa435('0x46')](_0x1a51de);}})[_0xa435('0x21')](function(_0x21b965){if(_0x21b965){return _0x21b965?{'count':_0x1a149,'rows':_0x21b965}:null;}})[_0xa435('0x21')](respondWithResult(_0x24ea35,null))[_0xa435('0x40')](handleError(_0x24ea35,null));};exports[_0xa435('0x4b')]=function(_0x18c31b,_0x895225,_0x51ae06){var _0x1ad0d4={};var _0x1f70eb={};var _0x5426dc;var _0x4b2d8a;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x18c31b['params']['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x895225,null))[_0xa435('0x21')](function(_0x4a75ff){if(_0x4a75ff){_0x5426dc=_0x4a75ff;_0x1f70eb[_0xa435('0x2c')]=_[_0xa435('0x2f')](db[_0xa435('0x48')]['rawAttributes']);_0x1f70eb[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x18c31b[_0xa435('0x2e')]);_0x1f70eb[_0xa435('0x30')]=_[_0xa435('0x31')](_0x1f70eb[_0xa435('0x2c')],_0x1f70eb[_0xa435('0x2e')]);_0x1ad0d4[_0xa435('0x33')]=_[_0xa435('0x31')](_0x1f70eb['model'],qs[_0xa435('0x32')](_0x18c31b[_0xa435('0x2e')][_0xa435('0x32')]));_0x1ad0d4[_0xa435('0x33')]=_0x1ad0d4['attributes']['length']?_0x1ad0d4[_0xa435('0x33')]:_0x1f70eb[_0xa435('0x2c')];_0x1ad0d4[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x18c31b[_0xa435('0x2e')][_0xa435('0x37')]);_0x1ad0d4[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x18c31b[_0xa435('0x2e')],_0x1f70eb[_0xa435('0x30')]));if(_0x18c31b[_0xa435('0x2e')]['filter']){_0x1ad0d4['where']=_['merge'](_0x1ad0d4[_0xa435('0x38')],{'$or':_['map'](_0x1ad0d4[_0xa435('0x33')],function(_0x47a938){var _0x1f056f={};_0x1f056f[_0x47a938]={'$like':'%'+_0x18c31b[_0xa435('0x2e')]['filter']+'%'};return _0x1f056f;})});}_0x1ad0d4=_[_0xa435('0x4a')]({},_0x1ad0d4,_0x18c31b[_0xa435('0x3b')]);return _0x5426dc[_0xa435('0x4b')](_0x1ad0d4);}})['then'](function(_0x276f3d){if(_0x276f3d){_0x4b2d8a=_0x276f3d[_0xa435('0x34')];if(!_0x18c31b['query'][_0xa435('0x35')](_0xa435('0x36'))){_0x1ad0d4[_0xa435('0x1b')]=qs['limit'](_0x18c31b[_0xa435('0x2e')]['limit']);_0x1ad0d4[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x18c31b[_0xa435('0x2e')]['offset']);}return _0x5426dc[_0xa435('0x4b')](_0x1ad0d4);}})[_0xa435('0x21')](function(_0x14c4de){if(_0x14c4de){return _0x14c4de?{'count':_0x4b2d8a,'rows':_0x14c4de}:null;}})[_0xa435('0x21')](respondWithResult(_0x895225,null))[_0xa435('0x40')](handleError(_0x895225,null));};exports['getDescriptions']=function(_0x524f36,_0x52b523,_0x2cdea7){var _0x3b8b96={};var _0x11d82={};var _0x27df5d;var _0x5f3684;return db[_0xa435('0x28')]['findOne']({'where':{'id':_0x524f36[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x52b523,null))['then'](function(_0x407bbb){if(_0x407bbb){_0x27df5d=_0x407bbb;_0x11d82[_0xa435('0x2c')]=_[_0xa435('0x2f')](db['ZendeskField'][_0xa435('0x29')]);_0x11d82['query']=_[_0xa435('0x2f')](_0x524f36['query']);_0x11d82[_0xa435('0x30')]=_[_0xa435('0x31')](_0x11d82[_0xa435('0x2c')],_0x11d82[_0xa435('0x2e')]);_0x3b8b96[_0xa435('0x33')]=_[_0xa435('0x31')](_0x11d82[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x524f36[_0xa435('0x2e')][_0xa435('0x32')]));_0x3b8b96[_0xa435('0x33')]=_0x3b8b96[_0xa435('0x33')]['length']?_0x3b8b96[_0xa435('0x33')]:_0x11d82[_0xa435('0x2c')];_0x3b8b96[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x524f36[_0xa435('0x2e')][_0xa435('0x37')]);_0x3b8b96[_0xa435('0x38')]=qs['filters'](_[_0xa435('0x39')](_0x524f36[_0xa435('0x2e')],_0x11d82[_0xa435('0x30')]));if(_0x524f36[_0xa435('0x2e')][_0xa435('0x3a')]){_0x3b8b96['where']=_['merge'](_0x3b8b96[_0xa435('0x38')],{'$or':_['map'](_0x3b8b96[_0xa435('0x33')],function(_0x14e67d){var _0x4982b2={};_0x4982b2[_0x14e67d]={'$like':'%'+_0x524f36['query']['filter']+'%'};return _0x4982b2;})});}_0x3b8b96=_['merge']({},_0x3b8b96,_0x524f36[_0xa435('0x3b')]);return _0x27df5d[_0xa435('0x4c')](_0x3b8b96);}})[_0xa435('0x21')](function(_0x1def53){if(_0x1def53){_0x5f3684=_0x1def53['length'];if(!_0x524f36['query']['hasOwnProperty'](_0xa435('0x36'))){_0x3b8b96[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x524f36['query'][_0xa435('0x1b')]);_0x3b8b96['offset']=qs[_0xa435('0x1c')](_0x524f36[_0xa435('0x2e')][_0xa435('0x1c')]);}return _0x27df5d['getDescriptions'](_0x3b8b96);}})[_0xa435('0x21')](function(_0x31f9dc){if(_0x31f9dc){return _0x31f9dc?{'count':_0x5f3684,'rows':_0x31f9dc}:null;}})[_0xa435('0x21')](respondWithResult(_0x52b523,null))['catch'](handleError(_0x52b523,null));};exports['getTags']=function(_0x3d8aab,_0x375651,_0x460b8a){var _0x576e32={};var _0xf3113f={};var _0x59eab6;var _0xbbcba3;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x3d8aab[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x375651,null))[_0xa435('0x21')](function(_0xd4c984){if(_0xd4c984){_0x59eab6=_0xd4c984;_0xf3113f['model']=_['keys'](db[_0xa435('0x4d')][_0xa435('0x29')]);_0xf3113f[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x3d8aab['query']);_0xf3113f[_0xa435('0x30')]=_[_0xa435('0x31')](_0xf3113f[_0xa435('0x2c')],_0xf3113f[_0xa435('0x2e')]);_0x576e32[_0xa435('0x33')]=_[_0xa435('0x31')](_0xf3113f[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x3d8aab[_0xa435('0x2e')][_0xa435('0x32')]));_0x576e32[_0xa435('0x33')]=_0x576e32[_0xa435('0x33')]['length']?_0x576e32[_0xa435('0x33')]:_0xf3113f[_0xa435('0x2c')];_0x576e32[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x3d8aab['query'][_0xa435('0x37')]);_0x576e32['where']=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x3d8aab[_0xa435('0x2e')],_0xf3113f['filters']));if(_0x3d8aab['query'][_0xa435('0x3a')]){_0x576e32['where']=_[_0xa435('0x4a')](_0x576e32['where'],{'$or':_[_0xa435('0x2d')](_0x576e32[_0xa435('0x33')],function(_0x24e94d){var _0x1fcf40={};_0x1fcf40[_0x24e94d]={'$like':'%'+_0x3d8aab[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x1fcf40;})});}_0x576e32=_['merge']({},_0x576e32,_0x3d8aab[_0xa435('0x3b')]);return _0x59eab6[_0xa435('0x4e')](_0x576e32);}})[_0xa435('0x21')](function(_0x29b161){if(_0x29b161){_0xbbcba3=_0x29b161[_0xa435('0x34')];if(!_0x3d8aab[_0xa435('0x2e')][_0xa435('0x35')](_0xa435('0x36'))){_0x576e32['limit']=qs[_0xa435('0x1b')](_0x3d8aab[_0xa435('0x2e')][_0xa435('0x1b')]);_0x576e32[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x3d8aab['query']['offset']);}return _0x59eab6[_0xa435('0x4e')](_0x576e32);}})['then'](function(_0x33f73e){if(_0x33f73e){return _0x33f73e?{'count':_0xbbcba3,'rows':_0x33f73e}:null;}})[_0xa435('0x21')](respondWithResult(_0x375651,null))[_0xa435('0x40')](handleError(_0x375651,null));};exports[_0xa435('0x4f')]=function(_0x345b97,_0x39bd1c,_0x9a0a9f){if(_0x345b97[_0xa435('0x45')]['id']){delete _0x345b97['body']['id'];}return db['ZendeskConfiguration'][_0xa435('0x47')]({'where':{'id':_0x345b97[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x39bd1c,null))[_0xa435('0x21')](function(_0x1aa1d9){if(_0x1aa1d9){return _0x1aa1d9['setTags'](_0x345b97[_0xa435('0x45')][_0xa435('0x50')]||[]);}return null;})[_0xa435('0x21')](respondWithResult(_0x39bd1c,null))[_0xa435('0x40')](handleError(_0x39bd1c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b1e90b4..a4e305d 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 _0x1eba=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x3878d3,_0x82d360){var _0x4fc9ad=function(_0x3d620d){while(--_0x3d620d){_0x3878d3['push'](_0x3878d3['shift']());}};_0x4fc9ad(++_0x82d360);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x1eba[_0x1a72b8];return _0x39f72d;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0xeb62('0xb'),'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 55582ff..48baa7c 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 _0x20ea=['jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1a3102,_0x31d050){var _0x45e398=function(_0x350250){while(--_0x350250){_0x1a3102['push'](_0x1a3102['shift']());}};_0x45e398(++_0x31d050);}(_0x20ea,0x1c2));var _0xa20e=function(_0x755d72,_0x52a145){_0x755d72=_0x755d72-0x0;var _0x37c3f8=_0x20ea[_0x755d72];return _0x37c3f8;};'use strict';var _=require(_0xa20e('0x0'));var util=require(_0xa20e('0x1'));var moment=require(_0xa20e('0x2'));var BPromise=require(_0xa20e('0x3'));var rs=require(_0xa20e('0x4'));var fs=require('fs');var Redis=require(_0xa20e('0x5'));var db=require(_0xa20e('0x6'))['db'];var utils=require(_0xa20e('0x7'));var logger=require(_0xa20e('0x8'))('rpc');var config=require(_0xa20e('0x9'));var jayson=require(_0xa20e('0xa'));var client=jayson[_0xa20e('0xb')][_0xa20e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e7345,_0x26983f,_0x38a923){return new BPromise(function(_0x2f221d,_0xe8076d){return client[_0xa20e('0xd')](_0x5e7345,_0x38a923)[_0xa20e('0xe')](function(_0x5338a0){logger[_0xa20e('0xf')](_0xa20e('0x10'),_0x26983f,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x26983f,_0xa20e('0x11'),JSON['stringify'](_0x5338a0));if(_0x5338a0['error']){if(_0x5338a0[_0xa20e('0x12')][_0xa20e('0x13')]===0x1f4){logger[_0xa20e('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x26983f,_0x5338a0[_0xa20e('0x12')]['message']);return _0xe8076d(_0x5338a0[_0xa20e('0x12')][_0xa20e('0x14')]);}logger[_0xa20e('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x26983f,_0x5338a0[_0xa20e('0x12')][_0xa20e('0x14')]);return _0x2f221d(_0x5338a0['error']['message']);}else{logger[_0xa20e('0xf')](_0xa20e('0x10'),_0x26983f,'request\x20sent');_0x2f221d(_0x5338a0[_0xa20e('0x15')]['message']);}})[_0xa20e('0x16')](function(_0x5a7bed){logger[_0xa20e('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x26983f,_0x5a7bed);_0xe8076d(_0x5a7bed);});});} \ No newline at end of file +var _0xe251=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x354c38,_0x47de41){var _0x38deb5=function(_0x3a8f8b){while(--_0x3a8f8b){_0x354c38['push'](_0x354c38['shift']());}};_0x38deb5(++_0x47de41);}(_0xe251,0x1e4));var _0x1e25=function(_0x20c993,_0xca841c){_0x20c993=_0x20c993-0x0;var _0x3fc1e2=_0xe251[_0x20c993];return _0x3fc1e2;};'use strict';var _=require(_0x1e25('0x0'));var util=require(_0x1e25('0x1'));var moment=require(_0x1e25('0x2'));var BPromise=require(_0x1e25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e25('0x4'));var db=require(_0x1e25('0x5'))['db'];var utils=require(_0x1e25('0x6'));var logger=require(_0x1e25('0x7'))(_0x1e25('0x8'));var config=require(_0x1e25('0x9'));var jayson=require(_0x1e25('0xa'));var client=jayson[_0x1e25('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3787c0,_0x2a54f0,_0x284378){return new BPromise(function(_0x27afe7,_0x2050df){return client[_0x1e25('0xc')](_0x3787c0,_0x284378)[_0x1e25('0xd')](function(_0x39032e){logger[_0x1e25('0xe')](_0x1e25('0xf'),_0x2a54f0,_0x1e25('0x10'));logger[_0x1e25('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2a54f0,_0x1e25('0x10'),JSON[_0x1e25('0x12')](_0x39032e));if(_0x39032e[_0x1e25('0x13')]){if(_0x39032e[_0x1e25('0x13')][_0x1e25('0x14')]===0x1f4){logger[_0x1e25('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);return _0x2050df(_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);}logger[_0x1e25('0x13')](_0x1e25('0xf'),_0x2a54f0,_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);return _0x27afe7(_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);}else{logger[_0x1e25('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x1e25('0x10'));_0x27afe7(_0x39032e['result'][_0x1e25('0x15')]);}})['catch'](function(_0x218f27){logger[_0x1e25('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x218f27);_0x2050df(_0x218f27);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 87fec34..640f6bf 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 _0xccf6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x5ee39d,_0x549a1d){var _0x38bccb=function(_0x49d7f1){while(--_0x49d7f1){_0x5ee39d['push'](_0x5ee39d['shift']());}};_0x38bccb(++_0x549a1d);}(_0xccf6,0xb9));var _0x6ccf=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xccf6[_0x585d81];return _0x1aca0d;};'use strict';var multer=require(_0x6ccf('0x0'));var util=require(_0x6ccf('0x1'));var path=require('path');var timeout=require(_0x6ccf('0x2'));var express=require(_0x6ccf('0x3'));var router=express[_0x6ccf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ccf('0x5'));var interaction=require(_0x6ccf('0x6'));var config=require('../../config/environment');var controller=require(_0x6ccf('0x7'));router[_0x6ccf('0x8')]('/',auth[_0x6ccf('0x9')](),controller[_0x6ccf('0xa')]);router[_0x6ccf('0x8')](_0x6ccf('0xb'),auth[_0x6ccf('0x9')](),controller[_0x6ccf('0xc')]);router['post']('/',auth[_0x6ccf('0x9')](),controller[_0x6ccf('0xd')]);router['put'](_0x6ccf('0xb'),auth['isAuthenticated'](),controller[_0x6ccf('0xe')]);router[_0x6ccf('0xf')](_0x6ccf('0xb'),auth[_0x6ccf('0x9')](),controller[_0x6ccf('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc667=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x3cf4ec,_0x445104){var _0x3cdfe2=function(_0x17c39e){while(--_0x17c39e){_0x3cf4ec['push'](_0x3cf4ec['shift']());}};_0x3cdfe2(++_0x445104);}(_0xc667,0x89));var _0x7c66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc667[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7c66('0x0'));var util=require(_0x7c66('0x1'));var path=require('path');var timeout=require(_0x7c66('0x2'));var express=require(_0x7c66('0x3'));var router=express[_0x7c66('0x4')]();var fs_extra=require(_0x7c66('0x5'));var auth=require(_0x7c66('0x6'));var interaction=require(_0x7c66('0x7'));var config=require(_0x7c66('0x8'));var controller=require(_0x7c66('0x9'));router[_0x7c66('0xa')]('/',auth[_0x7c66('0xb')](),controller[_0x7c66('0xc')]);router[_0x7c66('0xa')](_0x7c66('0xd'),auth[_0x7c66('0xb')](),controller[_0x7c66('0xe')]);router[_0x7c66('0xf')]('/',auth[_0x7c66('0xb')](),controller['create']);router[_0x7c66('0x10')](_0x7c66('0xd'),auth[_0x7c66('0xb')](),controller[_0x7c66('0x11')]);router[_0x7c66('0x12')](_0x7c66('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7c66('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index d319472..7b7b9fe 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 _0xc861=['variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x539bde,_0x14b7db){var _0x1718d4=function(_0x1d35e0){while(--_0x1d35e0){_0x539bde['push'](_0x539bde['shift']());}};_0x1718d4(++_0x14b7db);}(_0xc861,0x13d));var _0x1c86=function(_0x14310b,_0x4a82ba){_0x14310b=_0x14310b-0x0;var _0x128188=_0xc861[_0x14310b];return _0x128188;};'use strict';var Sequelize=require('sequelize');module[_0x1c86('0x0')]={'type':{'type':Sequelize[_0x1c86('0x1')](_0x1c86('0x2'),_0x1c86('0x3'),_0x1c86('0x4'),_0x1c86('0x5'),'picklist'),'defaultValue':_0x1c86('0x2')},'content':{'type':Sequelize[_0x1c86('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1c86('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1c86('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1c86('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c86('0x6')]}}; \ No newline at end of file +var _0xa50a=['picklist','string','STRING','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x11908c,_0x547af6){var _0x10cd4e=function(_0x2c0d66){while(--_0x2c0d66){_0x11908c['push'](_0x11908c['shift']());}};_0x10cd4e(++_0x547af6);}(_0xa50a,0x100));var _0xaa50=function(_0x2f48a7,_0x54ea3c){_0x2f48a7=_0x2f48a7-0x0;var _0x3546f6=_0xa50a[_0x2f48a7];return _0x3546f6;};'use strict';var Sequelize=require(_0xaa50('0x0'));module[_0xaa50('0x1')]={'type':{'type':Sequelize[_0xaa50('0x2')]('string',_0xaa50('0x3'),'customVariable',_0xaa50('0x4'),_0xaa50('0x5')),'defaultValue':_0xaa50('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa50('0x7')]},'keyType':{'type':Sequelize[_0xaa50('0x2')]('string',_0xaa50('0x3'),_0xaa50('0x8'))},'keyContent':{'type':Sequelize[_0xaa50('0x7')]},'idField':{'type':Sequelize[_0xaa50('0x7')]},'nameField':{'type':Sequelize[_0xaa50('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 0a2e6fa..4068b35 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 _0x8b19=['../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','params','keys','catch','create','body','find','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x3b151c,_0x1cb1c2){var _0x4369ba=function(_0x7e8895){while(--_0x7e8895){_0x3b151c['push'](_0x3b151c['shift']());}};_0x4369ba(++_0x1cb1c2);}(_0x8b19,0x1a1));var _0x98b1=function(_0x3d3f02,_0x562073){_0x3d3f02=_0x3d3f02-0x0;var _0x468d7f=_0x8b19[_0x3d3f02];return _0x468d7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x98b1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98b1('0x1'));var moment=require('moment');var BPromise=require(_0x98b1('0x2'));var Mustache=require(_0x98b1('0x3'));var util=require('util');var path=require(_0x98b1('0x4'));var sox=require(_0x98b1('0x5'));var csv=require(_0x98b1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98b1('0x7'));var _=require(_0x98b1('0x8'));var squel=require('squel');var crypto=require(_0x98b1('0x9'));var jsforce=require(_0x98b1('0xa'));var deskjs=require(_0x98b1('0xb'));var toCsv=require(_0x98b1('0x6'));var querystring=require(_0x98b1('0xc'));var Papa=require(_0x98b1('0xd'));var Redis=require(_0x98b1('0xe'));var authService=require(_0x98b1('0xf'));var qs=require(_0x98b1('0x10'));var as=require(_0x98b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98b1('0x12'))(_0x98b1('0x13'));var utils=require(_0x98b1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x98b1('0x15'));var db=require(_0x98b1('0x16'))['db'];function respondWithStatusCode(_0x2e4a65,_0x569b5e){_0x569b5e=_0x569b5e||0xcc;return function(_0x4b21bd){if(_0x4b21bd){return _0x2e4a65['sendStatus'](_0x569b5e);}return _0x2e4a65[_0x98b1('0x17')](_0x569b5e)[_0x98b1('0x18')]();};}function respondWithResult(_0xfb279b,_0x2ad173){_0x2ad173=_0x2ad173||0xc8;return function(_0x3298d9){if(_0x3298d9){return _0xfb279b[_0x98b1('0x17')](_0x2ad173)['json'](_0x3298d9);}};}function respondWithFilteredResult(_0x442680,_0x19ce84){return function(_0x1b2788){if(_0x1b2788){var _0x57fb61=typeof _0x19ce84[_0x98b1('0x19')]==='undefined'&&typeof _0x19ce84[_0x98b1('0x1a')]==='undefined';var _0x43341e=_0x1b2788[_0x98b1('0x1b')];var _0x3a4814=_0x57fb61?0x0:_0x19ce84['offset'];var _0x4a8e53=_0x57fb61?_0x1b2788[_0x98b1('0x1b')]:_0x19ce84[_0x98b1('0x19')]+_0x19ce84[_0x98b1('0x1a')];var _0x379f6a;if(_0x4a8e53>=_0x43341e){_0x4a8e53=_0x43341e;_0x379f6a=0xc8;}else{_0x379f6a=0xce;}_0x442680[_0x98b1('0x17')](_0x379f6a);return _0x442680[_0x98b1('0x1c')]('Content-Range',_0x3a4814+'-'+_0x4a8e53+'/'+_0x43341e)[_0x98b1('0x1d')](_0x1b2788);}return null;};}function patchUpdates(_0x4ae811){return function(_0x335fc5){try{jsonpatch[_0x98b1('0x1e')](_0x335fc5,_0x4ae811,!![]);}catch(_0x149836){return BPromise[_0x98b1('0x1f')](_0x149836);}return _0x335fc5[_0x98b1('0x20')]();};}function saveUpdates(_0x150ced,_0xa4c391){return function(_0x44d818){if(_0x44d818){return _0x44d818[_0x98b1('0x21')](_0x150ced)[_0x98b1('0x22')](function(_0x2d3f5d){return _0x2d3f5d;});}return null;};}function removeEntity(_0x257174,_0x57cf59){return function(_0x2f70e9){if(_0x2f70e9){return _0x2f70e9[_0x98b1('0x23')]()[_0x98b1('0x22')](function(){_0x257174[_0x98b1('0x17')](0xcc)[_0x98b1('0x18')]();});}};}function handleEntityNotFound(_0x5d7fdc,_0x2dbcb7){return function(_0x4e9225){if(!_0x4e9225){_0x5d7fdc[_0x98b1('0x24')](0x194);}return _0x4e9225;};}function handleError(_0x20b061,_0xdec995){_0xdec995=_0xdec995||0x1f4;return function(_0x55282f){logger['error'](_0x55282f[_0x98b1('0x25')]);if(_0x55282f[_0x98b1('0x26')]){delete _0x55282f['name'];}_0x20b061[_0x98b1('0x17')](_0xdec995)[_0x98b1('0x27')](_0x55282f);};}exports[_0x98b1('0x28')]=function(_0xdcc985,_0x2e37eb){var _0x1b4183={},_0x2ca8aa={},_0x27ec56={'count':0x0,'rows':[]};var _0x2b45ff=_[_0x98b1('0x29')](db[_0x98b1('0x2a')][_0x98b1('0x2b')],function(_0x164196){return{'name':_0x164196[_0x98b1('0x2c')],'type':_0x164196['type'][_0x98b1('0x2d')]};});_0x2ca8aa[_0x98b1('0x2e')]=_[_0x98b1('0x29')](_0x2b45ff,'name');_0x2ca8aa[_0x98b1('0x2f')]=_['keys'](_0xdcc985['query']);_0x2ca8aa[_0x98b1('0x30')]=_[_0x98b1('0x31')](_0x2ca8aa['model'],_0x2ca8aa[_0x98b1('0x2f')]);_0x1b4183[_0x98b1('0x32')]=_[_0x98b1('0x31')](_0x2ca8aa[_0x98b1('0x2e')],qs[_0x98b1('0x33')](_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x33')]));_0x1b4183[_0x98b1('0x32')]=_0x1b4183['attributes'][_0x98b1('0x34')]?_0x1b4183[_0x98b1('0x32')]:_0x2ca8aa[_0x98b1('0x2e')];if(!_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x35')](_0x98b1('0x36'))){_0x1b4183[_0x98b1('0x1a')]=qs['limit'](_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x1a')]);_0x1b4183['offset']=qs['offset'](_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x19')]);}_0x1b4183[_0x98b1('0x37')]=qs[_0x98b1('0x38')](_0xdcc985[_0x98b1('0x2f')]['sort']);_0x1b4183[_0x98b1('0x39')]=qs[_0x98b1('0x30')](_[_0x98b1('0x3a')](_0xdcc985[_0x98b1('0x2f')],_0x2ca8aa[_0x98b1('0x30')]),_0x2b45ff);if(_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x3b')]){_0x1b4183['where']=_['merge'](_0x1b4183[_0x98b1('0x39')],{'$or':_[_0x98b1('0x29')](_0x2b45ff,function(_0x3f92fb){if(_0x3f92fb[_0x98b1('0x3c')]!==_0x98b1('0x3d')){var _0x5f4322={};_0x5f4322[_0x3f92fb[_0x98b1('0x26')]]={'$like':'%'+_0xdcc985[_0x98b1('0x2f')]['filter']+'%'};return _0x5f4322;}})});}_0x1b4183=_[_0x98b1('0x3e')]({},_0x1b4183,_0xdcc985[_0x98b1('0x3f')]);var _0x17429a={'where':_0x1b4183['where']};return db[_0x98b1('0x2a')][_0x98b1('0x1b')](_0x17429a)[_0x98b1('0x22')](function(_0x56024d){_0x27ec56['count']=_0x56024d;if(_0xdcc985[_0x98b1('0x2f')][_0x98b1('0x40')]){_0x1b4183[_0x98b1('0x41')]=[{'all':!![]}];}return db[_0x98b1('0x2a')]['findAll'](_0x1b4183);})['then'](function(_0x288535){_0x27ec56[_0x98b1('0x42')]=_0x288535;return _0x27ec56;})[_0x98b1('0x22')](respondWithFilteredResult(_0x2e37eb,_0x1b4183))['catch'](handleError(_0x2e37eb,null));};exports['show']=function(_0x352ce4,_0x33ca5e){var _0xb53870={'raw':!![],'where':{'id':_0x352ce4[_0x98b1('0x43')]['id']}},_0x4be016={};_0x4be016['model']=_['keys'](db[_0x98b1('0x2a')][_0x98b1('0x2b')]);_0x4be016[_0x98b1('0x2f')]=_[_0x98b1('0x44')](_0x352ce4[_0x98b1('0x2f')]);_0x4be016['filters']=_[_0x98b1('0x31')](_0x4be016[_0x98b1('0x2e')],_0x4be016[_0x98b1('0x2f')]);_0xb53870['attributes']=_['intersection'](_0x4be016[_0x98b1('0x2e')],qs[_0x98b1('0x33')](_0x352ce4[_0x98b1('0x2f')]['fields']));_0xb53870[_0x98b1('0x32')]=_0xb53870['attributes'][_0x98b1('0x34')]?_0xb53870[_0x98b1('0x32')]:_0x4be016['model'];if(_0x352ce4[_0x98b1('0x2f')][_0x98b1('0x40')]){_0xb53870['include']=[{'all':!![]}];}_0xb53870=_[_0x98b1('0x3e')]({},_0xb53870,_0x352ce4['options']);return db[_0x98b1('0x2a')]['find'](_0xb53870)[_0x98b1('0x22')](handleEntityNotFound(_0x33ca5e,null))[_0x98b1('0x22')](respondWithResult(_0x33ca5e,null))[_0x98b1('0x45')](handleError(_0x33ca5e,null));};exports[_0x98b1('0x46')]=function(_0x449cfa,_0x415f01){return db['ZendeskField'][_0x98b1('0x46')](_0x449cfa[_0x98b1('0x47')],{})[_0x98b1('0x22')](respondWithResult(_0x415f01,0xc9))[_0x98b1('0x45')](handleError(_0x415f01,null));};exports[_0x98b1('0x21')]=function(_0x27e3a3,_0x2c1e9b){if(_0x27e3a3['body']['id']){delete _0x27e3a3[_0x98b1('0x47')]['id'];}return db['ZendeskField'][_0x98b1('0x48')]({'where':{'id':_0x27e3a3[_0x98b1('0x43')]['id']}})[_0x98b1('0x22')](handleEntityNotFound(_0x2c1e9b,null))[_0x98b1('0x22')](saveUpdates(_0x27e3a3[_0x98b1('0x47')],null))[_0x98b1('0x22')](respondWithResult(_0x2c1e9b,null))[_0x98b1('0x45')](handleError(_0x2c1e9b,null));};exports[_0x98b1('0x23')]=function(_0x3115a2,_0x3f9aab){return db[_0x98b1('0x2a')][_0x98b1('0x48')]({'where':{'id':_0x3115a2[_0x98b1('0x43')]['id']}})[_0x98b1('0x22')](handleEntityNotFound(_0x3f9aab,null))[_0x98b1('0x22')](removeEntity(_0x3f9aab,null))[_0x98b1('0x45')](handleError(_0x3f9aab,null));}; \ No newline at end of file +var _0xc072=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','ZendeskField','create','body','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc072,0x14e));var _0x2c07=function(_0x4e39da,_0x78ecc2){_0x4e39da=_0x4e39da-0x0;var _0x2eca2b=_0xc072[_0x4e39da];return _0x2eca2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c07('0x0'));var jsonpatch=require(_0x2c07('0x1'));var rp=require(_0x2c07('0x2'));var moment=require('moment');var BPromise=require(_0x2c07('0x3'));var Mustache=require(_0x2c07('0x4'));var util=require('util');var path=require(_0x2c07('0x5'));var sox=require(_0x2c07('0x6'));var csv=require(_0x2c07('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c07('0x8'));var _=require('lodash');var squel=require(_0x2c07('0x9'));var crypto=require(_0x2c07('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c07('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c07('0xc'));var Papa=require(_0x2c07('0xd'));var Redis=require(_0x2c07('0xe'));var authService=require(_0x2c07('0xf'));var qs=require(_0x2c07('0x10'));var as=require(_0x2c07('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c07('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c07('0x13'));var db=require(_0x2c07('0x14'))['db'];function respondWithStatusCode(_0x559ae7,_0x3a87a4){_0x3a87a4=_0x3a87a4||0xcc;return function(_0x2a9a8a){if(_0x2a9a8a){return _0x559ae7['sendStatus'](_0x3a87a4);}return _0x559ae7['status'](_0x3a87a4)['end']();};}function respondWithResult(_0xe6e9d,_0x48b5ca){_0x48b5ca=_0x48b5ca||0xc8;return function(_0x1f323e){if(_0x1f323e){return _0xe6e9d[_0x2c07('0x15')](_0x48b5ca)[_0x2c07('0x16')](_0x1f323e);}};}function respondWithFilteredResult(_0x3acb2a,_0x183cb4){return function(_0x146d74){if(_0x146d74){var _0xd6b472=typeof _0x183cb4[_0x2c07('0x17')]===_0x2c07('0x18')&&typeof _0x183cb4[_0x2c07('0x19')]===_0x2c07('0x18');var _0x2327e2=_0x146d74[_0x2c07('0x1a')];var _0x1de11c=_0xd6b472?0x0:_0x183cb4[_0x2c07('0x17')];var _0x59f9c3=_0xd6b472?_0x146d74[_0x2c07('0x1a')]:_0x183cb4[_0x2c07('0x17')]+_0x183cb4[_0x2c07('0x19')];var _0x39e598;if(_0x59f9c3>=_0x2327e2){_0x59f9c3=_0x2327e2;_0x39e598=0xc8;}else{_0x39e598=0xce;}_0x3acb2a[_0x2c07('0x15')](_0x39e598);return _0x3acb2a[_0x2c07('0x1b')](_0x2c07('0x1c'),_0x1de11c+'-'+_0x59f9c3+'/'+_0x2327e2)[_0x2c07('0x16')](_0x146d74);}return null;};}function patchUpdates(_0xe01103){return function(_0x1b2264){try{jsonpatch[_0x2c07('0x1d')](_0x1b2264,_0xe01103,!![]);}catch(_0x1f7db1){return BPromise[_0x2c07('0x1e')](_0x1f7db1);}return _0x1b2264[_0x2c07('0x1f')]();};}function saveUpdates(_0x6f5d6d,_0xa9159e){return function(_0x529307){if(_0x529307){return _0x529307[_0x2c07('0x20')](_0x6f5d6d)[_0x2c07('0x21')](function(_0x24409c){return _0x24409c;});}return null;};}function removeEntity(_0x5e77ca,_0x587188){return function(_0x57e0bc){if(_0x57e0bc){return _0x57e0bc[_0x2c07('0x22')]()[_0x2c07('0x21')](function(){_0x5e77ca[_0x2c07('0x15')](0xcc)[_0x2c07('0x23')]();});}};}function handleEntityNotFound(_0x4537c7,_0x4738c4){return function(_0x376a6e){if(!_0x376a6e){_0x4537c7[_0x2c07('0x24')](0x194);}return _0x376a6e;};}function handleError(_0x184863,_0x53460a){_0x53460a=_0x53460a||0x1f4;return function(_0x1d2f77){logger[_0x2c07('0x25')](_0x1d2f77['stack']);if(_0x1d2f77[_0x2c07('0x26')]){delete _0x1d2f77[_0x2c07('0x26')];}_0x184863[_0x2c07('0x15')](_0x53460a)['send'](_0x1d2f77);};}exports[_0x2c07('0x27')]=function(_0x11cb39,_0x2abd24){var _0x2507cc={},_0x403e51={},_0x3e9328={'count':0x0,'rows':[]};var _0x527878=_[_0x2c07('0x28')](db['ZendeskField'][_0x2c07('0x29')],function(_0xbcdbe3){return{'name':_0xbcdbe3[_0x2c07('0x2a')],'type':_0xbcdbe3[_0x2c07('0x2b')][_0x2c07('0x2c')]};});_0x403e51['model']=_[_0x2c07('0x28')](_0x527878,_0x2c07('0x26'));_0x403e51[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x11cb39[_0x2c07('0x2d')]);_0x403e51[_0x2c07('0x2f')]=_['intersection'](_0x403e51[_0x2c07('0x30')],_0x403e51['query']);_0x2507cc[_0x2c07('0x31')]=_['intersection'](_0x403e51['model'],qs[_0x2c07('0x32')](_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x2507cc[_0x2c07('0x31')]=_0x2507cc[_0x2c07('0x31')][_0x2c07('0x33')]?_0x2507cc[_0x2c07('0x31')]:_0x403e51['model'];if(!_0x11cb39['query'][_0x2c07('0x34')](_0x2c07('0x35'))){_0x2507cc[_0x2c07('0x19')]=qs[_0x2c07('0x19')](_0x11cb39['query'][_0x2c07('0x19')]);_0x2507cc[_0x2c07('0x17')]=qs[_0x2c07('0x17')](_0x11cb39['query'][_0x2c07('0x17')]);}_0x2507cc[_0x2c07('0x36')]=qs['sort'](_0x11cb39['query'][_0x2c07('0x37')]);_0x2507cc[_0x2c07('0x38')]=qs[_0x2c07('0x2f')](_[_0x2c07('0x39')](_0x11cb39[_0x2c07('0x2d')],_0x403e51[_0x2c07('0x2f')]),_0x527878);if(_0x11cb39['query'][_0x2c07('0x3a')]){_0x2507cc[_0x2c07('0x38')]=_['merge'](_0x2507cc[_0x2c07('0x38')],{'$or':_[_0x2c07('0x28')](_0x527878,function(_0x4b1d61){if(_0x4b1d61[_0x2c07('0x2b')]!=='VIRTUAL'){var _0x592d2a={};_0x592d2a[_0x4b1d61[_0x2c07('0x26')]]={'$like':'%'+_0x11cb39[_0x2c07('0x2d')]['filter']+'%'};return _0x592d2a;}})});}_0x2507cc=_[_0x2c07('0x3b')]({},_0x2507cc,_0x11cb39[_0x2c07('0x3c')]);var _0x2e7f27={'where':_0x2507cc[_0x2c07('0x38')]};return db['ZendeskField'][_0x2c07('0x1a')](_0x2e7f27)[_0x2c07('0x21')](function(_0xac217d){_0x3e9328[_0x2c07('0x1a')]=_0xac217d;if(_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x2507cc['include']=[{'all':!![]}];}return db['ZendeskField'][_0x2c07('0x3e')](_0x2507cc);})[_0x2c07('0x21')](function(_0x372b52){_0x3e9328['rows']=_0x372b52;return _0x3e9328;})[_0x2c07('0x21')](respondWithFilteredResult(_0x2abd24,_0x2507cc))[_0x2c07('0x3f')](handleError(_0x2abd24,null));};exports['show']=function(_0x28fb75,_0x26e312){var _0x27a178={'raw':!![],'where':{'id':_0x28fb75[_0x2c07('0x40')]['id']}},_0x1d5c61={};_0x1d5c61[_0x2c07('0x30')]=_[_0x2c07('0x2e')](db[_0x2c07('0x41')][_0x2c07('0x29')]);_0x1d5c61[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x28fb75['query']);_0x1d5c61[_0x2c07('0x2f')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],_0x1d5c61[_0x2c07('0x2d')]);_0x27a178[_0x2c07('0x31')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],qs[_0x2c07('0x32')](_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x27a178['attributes']=_0x27a178[_0x2c07('0x31')][_0x2c07('0x33')]?_0x27a178[_0x2c07('0x31')]:_0x1d5c61['model'];if(_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x27a178['include']=[{'all':!![]}];}_0x27a178=_[_0x2c07('0x3b')]({},_0x27a178,_0x28fb75[_0x2c07('0x3c')]);return db[_0x2c07('0x41')]['find'](_0x27a178)[_0x2c07('0x21')](handleEntityNotFound(_0x26e312,null))['then'](respondWithResult(_0x26e312,null))[_0x2c07('0x3f')](handleError(_0x26e312,null));};exports[_0x2c07('0x42')]=function(_0x5bd2ba,_0x11841b){return db[_0x2c07('0x41')][_0x2c07('0x42')](_0x5bd2ba[_0x2c07('0x43')],{})['then'](respondWithResult(_0x11841b,0xc9))[_0x2c07('0x3f')](handleError(_0x11841b,null));};exports['update']=function(_0x168d45,_0x353e8f){if(_0x168d45[_0x2c07('0x43')]['id']){delete _0x168d45['body']['id'];}return db[_0x2c07('0x41')]['find']({'where':{'id':_0x168d45[_0x2c07('0x40')]['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x353e8f,null))[_0x2c07('0x21')](saveUpdates(_0x168d45['body'],null))[_0x2c07('0x21')](respondWithResult(_0x353e8f,null))[_0x2c07('0x3f')](handleError(_0x353e8f,null));};exports[_0x2c07('0x22')]=function(_0x2734be,_0x8d8515){return db[_0x2c07('0x41')][_0x2c07('0x44')]({'where':{'id':_0x2734be['params']['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x8d8515,null))[_0x2c07('0x21')](removeEntity(_0x8d8515,null))[_0x2c07('0x3f')](handleError(_0x8d8515,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index dee8e74..d7b3985 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 _0xc1ed=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4404f4,_0x5286b8){var _0x2c04e6=function(_0x511e2a){while(--_0x511e2a){_0x4404f4['push'](_0x4404f4['shift']());}};_0x2c04e6(++_0x5286b8);}(_0xc1ed,0x129));var _0xdc1e=function(_0x3df0f4,_0x4ad464){_0x3df0f4=_0x3df0f4-0x0;var _0x562a3a=_0xc1ed[_0x3df0f4];return _0x562a3a;};'use strict';var _=require(_0xdc1e('0x0'));var util=require(_0xdc1e('0x1'));var logger=require(_0xdc1e('0x2'))(_0xdc1e('0x3'));var moment=require(_0xdc1e('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc1e('0x5'));var fs=require('fs');var path=require(_0xdc1e('0x6'));var rimraf=require(_0xdc1e('0x7'));var config=require(_0xdc1e('0x8'));var attributes=require(_0xdc1e('0x9'));module[_0xdc1e('0xa')]=function(_0x43cf5b,_0x444e7d){return _0x43cf5b[_0xdc1e('0xb')](_0xdc1e('0xc'),attributes,{'tableName':_0xdc1e('0xd'),'paranoid':![],'indexes':[{'name':_0xdc1e('0xe'),'fields':[_0xdc1e('0xf'),_0xdc1e('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f4=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb3f4,0xa3));var _0x4b3f=function(_0x14658f,_0x1c23a1){_0x14658f=_0x14658f-0x0;var _0x22b456=_0xb3f4[_0x14658f];return _0x22b456;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var logger=require(_0x4b3f('0x2'))(_0x4b3f('0x3'));var moment=require(_0x4b3f('0x4'));var BPromise=require(_0x4b3f('0x5'));var rp=require(_0x4b3f('0x6'));var fs=require('fs');var path=require(_0x4b3f('0x7'));var rimraf=require(_0x4b3f('0x8'));var config=require(_0x4b3f('0x9'));var attributes=require(_0x4b3f('0xa'));module[_0x4b3f('0xb')]=function(_0x340cd5,_0x363533){return _0x340cd5[_0x4b3f('0xc')]('ZendeskField',attributes,{'tableName':_0x4b3f('0xd'),'paranoid':![],'indexes':[{'name':_0x4b3f('0xe'),'fields':[_0x4b3f('0xf'),_0x4b3f('0x10')],'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 3d93071..1fb8022 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 _0x01df=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5c5b7a,_0x1b992a){var _0x51cd11=function(_0x378a3d){while(--_0x378a3d){_0x5c5b7a['push'](_0x5c5b7a['shift']());}};_0x51cd11(++_0x1b992a);}(_0x01df,0xf8));var _0xf01d=function(_0x3d5d2e,_0xc26344){_0x3d5d2e=_0x3d5d2e-0x0;var _0xe82ade=_0x01df[_0x3d5d2e];return _0xe82ade;};'use strict';var _=require(_0xf01d('0x0'));var util=require(_0xf01d('0x1'));var moment=require(_0xf01d('0x2'));var BPromise=require(_0xf01d('0x3'));var rs=require(_0xf01d('0x4'));var fs=require('fs');var Redis=require(_0xf01d('0x5'));var db=require(_0xf01d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf01d('0x7'))(_0xf01d('0x8'));var config=require(_0xf01d('0x9'));var jayson=require(_0xf01d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5504,_0x370b8a,_0x11eb20){return new BPromise(function(_0x17b057,_0x24dc72){return client['request'](_0x3d5504,_0x11eb20)[_0xf01d('0xb')](function(_0x2fd2be){logger['info'](_0xf01d('0xc'),_0x370b8a,'request\x20sent');logger[_0xf01d('0xd')](_0xf01d('0xe'),_0x370b8a,_0xf01d('0xf'),JSON['stringify'](_0x2fd2be));if(_0x2fd2be[_0xf01d('0x10')]){if(_0x2fd2be['error'][_0xf01d('0x11')]===0x1f4){logger[_0xf01d('0x10')](_0xf01d('0xc'),_0x370b8a,_0x2fd2be[_0xf01d('0x10')][_0xf01d('0x12')]);return _0x24dc72(_0x2fd2be[_0xf01d('0x10')][_0xf01d('0x12')]);}logger['error'](_0xf01d('0xc'),_0x370b8a,_0x2fd2be[_0xf01d('0x10')][_0xf01d('0x12')]);return _0x17b057(_0x2fd2be[_0xf01d('0x10')]['message']);}else{logger[_0xf01d('0x13')](_0xf01d('0xc'),_0x370b8a,_0xf01d('0xf'));_0x17b057(_0x2fd2be[_0xf01d('0x14')][_0xf01d('0x12')]);}})[_0xf01d('0x15')](function(_0x35f92f){logger[_0xf01d('0x10')](_0xf01d('0xc'),_0x370b8a,_0x35f92f);_0x24dc72(_0x35f92f);});});} \ No newline at end of file +var _0x7275=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x58eafd,_0x264a0a){var _0x192735=function(_0x2ae8fc){while(--_0x2ae8fc){_0x58eafd['push'](_0x58eafd['shift']());}};_0x192735(++_0x264a0a);}(_0x7275,0x193));var _0x5727=function(_0x413f60,_0x1865d0){_0x413f60=_0x413f60-0x0;var _0x519ed2=_0x7275[_0x413f60];return _0x519ed2;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));var BPromise=require(_0x5727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5727('0x4'));var db=require(_0x5727('0x5'))['db'];var utils=require(_0x5727('0x6'));var logger=require(_0x5727('0x7'))(_0x5727('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5727('0x9')][_0x5727('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55737a,_0x11a5d0,_0x3bb1c3){return new BPromise(function(_0x4fac67,_0x127b06){return client[_0x5727('0xb')](_0x55737a,_0x3bb1c3)[_0x5727('0xc')](function(_0x1ca0d3){logger['info'](_0x5727('0xd'),_0x11a5d0,_0x5727('0xe'));logger[_0x5727('0xf')](_0x5727('0x10'),_0x11a5d0,_0x5727('0xe'),JSON['stringify'](_0x1ca0d3));if(_0x1ca0d3['error']){if(_0x1ca0d3[_0x5727('0x11')][_0x5727('0x12')]===0x1f4){logger[_0x5727('0x11')](_0x5727('0xd'),_0x11a5d0,_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);return _0x127b06(_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);}logger['error'](_0x5727('0xd'),_0x11a5d0,_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);return _0x4fac67(_0x1ca0d3[_0x5727('0x11')]['message']);}else{logger['info'](_0x5727('0xd'),_0x11a5d0,_0x5727('0xe'));_0x4fac67(_0x1ca0d3[_0x5727('0x14')][_0x5727('0x13')]);}})['catch'](function(_0x509ab1){logger[_0x5727('0x11')](_0x5727('0xd'),_0x11a5d0,_0x509ab1);_0x127b06(_0x509ab1);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 7cb4c74..68c6e05 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 _0xb85c=['isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xb85c,0x1db));var _0xcb85=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb85c[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require(_0xcb85('0x0'));var path=require(_0xcb85('0x1'));var timeout=require(_0xcb85('0x2'));var express=require(_0xcb85('0x3'));var router=express[_0xcb85('0x4')]();var fs_extra=require(_0xcb85('0x5'));var auth=require(_0xcb85('0x6'));var interaction=require(_0xcb85('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xcb85('0x8')]('/',auth[_0xcb85('0x9')](),controller['index']);router[_0xcb85('0x8')](_0xcb85('0xa'),auth[_0xcb85('0x9')](),controller['show']);router[_0xcb85('0x8')]('/:id/configurations',auth[_0xcb85('0x9')](),controller[_0xcb85('0xb')]);router[_0xcb85('0x8')](_0xcb85('0xc'),auth[_0xcb85('0x9')](),controller[_0xcb85('0xd')]);router[_0xcb85('0xe')]('/',auth[_0xcb85('0x9')](),controller['create']);router[_0xcb85('0xe')](_0xcb85('0xf'),auth['isAuthenticated'](),controller[_0xcb85('0x10')]);router[_0xcb85('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xcb85('0x12')]);router[_0xcb85('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xcb85('0x14')]);module[_0xcb85('0x15')]=router; \ No newline at end of file +var _0x6b13=['get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x737b71,_0x407d82){var _0x1b32f3=function(_0x8d9ed8){while(--_0x8d9ed8){_0x737b71['push'](_0x737b71['shift']());}};_0x1b32f3(++_0x407d82);}(_0x6b13,0xd0));var _0x36b1=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x6b13[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require('multer');var util=require(_0x36b1('0x0'));var path=require(_0x36b1('0x1'));var timeout=require(_0x36b1('0x2'));var express=require('express');var router=express[_0x36b1('0x3')]();var fs_extra=require(_0x36b1('0x4'));var auth=require(_0x36b1('0x5'));var interaction=require(_0x36b1('0x6'));var config=require(_0x36b1('0x7'));var controller=require('./intZohoAccount.controller');router[_0x36b1('0x8')]('/',auth[_0x36b1('0x9')](),controller[_0x36b1('0xa')]);router[_0x36b1('0x8')](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller['show']);router[_0x36b1('0x8')](_0x36b1('0xc'),auth[_0x36b1('0x9')](),controller['getConfigurations']);router[_0x36b1('0x8')](_0x36b1('0xd'),auth[_0x36b1('0x9')](),controller[_0x36b1('0xe')]);router[_0x36b1('0xf')]('/',auth[_0x36b1('0x9')](),controller[_0x36b1('0x10')]);router['post'](_0x36b1('0xc'),auth[_0x36b1('0x9')](),controller['addConfiguration']);router['put'](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller[_0x36b1('0x11')]);router['delete'](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 3b41b95..dceec2d 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 _0x55e0=['STRING','sequelize','exports'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x55e0,0xdc));var _0x055e=function(_0x377576,_0x29f607){_0x377576=_0x377576-0x0;var _0x1ceacc=_0x55e0[_0x377576];return _0x1ceacc;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'name':{'type':Sequelize[_0x055e('0x2')]},'description':{'type':Sequelize[_0x055e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x055e('0x2')]},'clientSecret':{'type':Sequelize[_0x055e('0x2')]},'serverUrl':{'type':Sequelize[_0x055e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x055e('0x2')]},'refreshToken':{'type':Sequelize[_0x055e('0x2')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x34e8,0x12c));var _0x834e=function(_0x5523aa,_0x13e9d0){_0x5523aa=_0x5523aa-0x0;var _0x4bb1a1=_0x34e8[_0x5523aa];return _0x4bb1a1;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 94c824a..cb5b765 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 _0xd2e1=['https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientSecret','serverUrl','code','host','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','Wrong\x20credentials','zip-dir','fast-json-patch','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ZohoAccount','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','filter','includeAll','include','findAll','rows','catch','rawAttributes','filters','find','create','body','params','findOne','ZohoConfiguration','order','options','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','ZohoField','zone','https://accounts.zoho.com.au'];(function(_0x2f49f8,_0x344ea6){var _0x55f8ae=function(_0x496177){while(--_0x496177){_0x2f49f8['push'](_0x2f49f8['shift']());}};_0x55f8ae(++_0x344ea6);}(_0xd2e1,0x11e));var _0x1d2e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd2e1[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d2e('0x0'));var jsonpatch=require(_0x1d2e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d2e('0x2'));var Mustache=require(_0x1d2e('0x3'));var util=require('util');var path=require(_0x1d2e('0x4'));var sox=require(_0x1d2e('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d2e('0x6'));var _=require('lodash');var squel=require(_0x1d2e('0x7'));var crypto=require(_0x1d2e('0x8'));var jsforce=require(_0x1d2e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1d2e('0xa'));var querystring=require('querystring');var Papa=require(_0x1d2e('0xb'));var Redis=require(_0x1d2e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x1d2e('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d2e('0xe'));var logger=require(_0x1d2e('0xf'))(_0x1d2e('0x10'));var utils=require(_0x1d2e('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xbd3982,_0x587500){_0x587500=_0x587500||0xcc;return function(_0x5dcb9a){if(_0x5dcb9a){return _0xbd3982[_0x1d2e('0x12')](_0x587500);}return _0xbd3982[_0x1d2e('0x13')](_0x587500)['end']();};}function respondWithResult(_0x2fe637,_0x1e1daf){_0x1e1daf=_0x1e1daf||0xc8;return function(_0x261587){if(_0x261587){return _0x2fe637[_0x1d2e('0x13')](_0x1e1daf)['json'](_0x261587);}};}function respondWithFilteredResult(_0x3b8258,_0x3092c2){return function(_0x57e503){if(_0x57e503){var _0x5472ce=typeof _0x3092c2[_0x1d2e('0x14')]==='undefined'&&typeof _0x3092c2[_0x1d2e('0x15')]===_0x1d2e('0x16');var _0x5466c6=_0x57e503[_0x1d2e('0x17')];var _0xc6d93b=_0x5472ce?0x0:_0x3092c2[_0x1d2e('0x14')];var _0x22c368=_0x5472ce?_0x57e503[_0x1d2e('0x17')]:_0x3092c2['offset']+_0x3092c2[_0x1d2e('0x15')];var _0x543577;if(_0x22c368>=_0x5466c6){_0x22c368=_0x5466c6;_0x543577=0xc8;}else{_0x543577=0xce;}_0x3b8258[_0x1d2e('0x13')](_0x543577);return _0x3b8258[_0x1d2e('0x18')](_0x1d2e('0x19'),_0xc6d93b+'-'+_0x22c368+'/'+_0x5466c6)[_0x1d2e('0x1a')](_0x57e503);}return null;};}function patchUpdates(_0x297c8d){return function(_0x184839){try{jsonpatch[_0x1d2e('0x1b')](_0x184839,_0x297c8d,!![]);}catch(_0x546020){return BPromise[_0x1d2e('0x1c')](_0x546020);}return _0x184839[_0x1d2e('0x1d')]();};}function saveUpdates(_0x3fbc2e,_0x7098e5){return function(_0x59da8a){if(_0x59da8a){return _0x59da8a[_0x1d2e('0x1e')](_0x3fbc2e)['then'](function(_0x3c05d0){return _0x3c05d0;});}return null;};}function removeEntity(_0x312672,_0x47e6a0){return function(_0x2ad532){if(_0x2ad532){return _0x2ad532[_0x1d2e('0x1f')]()[_0x1d2e('0x20')](function(){_0x312672['status'](0xcc)[_0x1d2e('0x21')]();});}};}function handleEntityNotFound(_0x3ef7f0,_0x22bfc6){return function(_0x2663db){if(!_0x2663db){_0x3ef7f0[_0x1d2e('0x12')](0x194);}return _0x2663db;};}function handleError(_0x2cf17e,_0x2b0e7e){_0x2b0e7e=_0x2b0e7e||0x1f4;return function(_0x3a0d31){logger[_0x1d2e('0x22')](_0x3a0d31[_0x1d2e('0x23')]);if(_0x3a0d31[_0x1d2e('0x24')]){delete _0x3a0d31[_0x1d2e('0x24')];}_0x2cf17e[_0x1d2e('0x13')](_0x2b0e7e)[_0x1d2e('0x25')](_0x3a0d31);};}exports[_0x1d2e('0x26')]=function(_0x459eed,_0x598f3e){var _0x22dc8c={},_0x19dfbd={},_0x20d4bf={'count':0x0,'rows':[]};var _0x2ce07a=_['map'](db[_0x1d2e('0x27')]['rawAttributes'],function(_0x3cc400){return{'name':_0x3cc400[_0x1d2e('0x28')],'type':_0x3cc400[_0x1d2e('0x29')][_0x1d2e('0x2a')]};});_0x19dfbd['model']=_[_0x1d2e('0x2b')](_0x2ce07a,_0x1d2e('0x24'));_0x19dfbd[_0x1d2e('0x2c')]=_[_0x1d2e('0x2d')](_0x459eed[_0x1d2e('0x2c')]);_0x19dfbd['filters']=_[_0x1d2e('0x2e')](_0x19dfbd[_0x1d2e('0x2f')],_0x19dfbd[_0x1d2e('0x2c')]);_0x22dc8c[_0x1d2e('0x30')]=_[_0x1d2e('0x2e')](_0x19dfbd[_0x1d2e('0x2f')],qs[_0x1d2e('0x31')](_0x459eed[_0x1d2e('0x2c')]['fields']));_0x22dc8c[_0x1d2e('0x30')]=_0x22dc8c['attributes'][_0x1d2e('0x32')]?_0x22dc8c[_0x1d2e('0x30')]:_0x19dfbd[_0x1d2e('0x2f')];if(!_0x459eed[_0x1d2e('0x2c')][_0x1d2e('0x33')](_0x1d2e('0x34'))){_0x22dc8c[_0x1d2e('0x15')]=qs[_0x1d2e('0x15')](_0x459eed['query'][_0x1d2e('0x15')]);_0x22dc8c['offset']=qs[_0x1d2e('0x14')](_0x459eed[_0x1d2e('0x2c')]['offset']);}_0x22dc8c['order']=qs[_0x1d2e('0x35')](_0x459eed[_0x1d2e('0x2c')][_0x1d2e('0x35')]);_0x22dc8c['where']=qs['filters'](_[_0x1d2e('0x36')](_0x459eed[_0x1d2e('0x2c')],_0x19dfbd['filters']),_0x2ce07a);if(_0x459eed[_0x1d2e('0x2c')]['filter']){_0x22dc8c['where']=_[_0x1d2e('0x37')](_0x22dc8c[_0x1d2e('0x38')],{'$or':_[_0x1d2e('0x2b')](_0x2ce07a,function(_0x2a8a99){if(_0x2a8a99[_0x1d2e('0x29')]!=='VIRTUAL'){var _0x1d89d3={};_0x1d89d3[_0x2a8a99[_0x1d2e('0x24')]]={'$like':'%'+_0x459eed[_0x1d2e('0x2c')][_0x1d2e('0x39')]+'%'};return _0x1d89d3;}})});}_0x22dc8c=_[_0x1d2e('0x37')]({},_0x22dc8c,_0x459eed['options']);var _0x2e8a3e={'where':_0x22dc8c[_0x1d2e('0x38')]};return db[_0x1d2e('0x27')][_0x1d2e('0x17')](_0x2e8a3e)['then'](function(_0x4318ce){_0x20d4bf['count']=_0x4318ce;if(_0x459eed['query'][_0x1d2e('0x3a')]){_0x22dc8c[_0x1d2e('0x3b')]=[{'all':!![]}];}return db[_0x1d2e('0x27')][_0x1d2e('0x3c')](_0x22dc8c);})['then'](function(_0x2af488){_0x20d4bf[_0x1d2e('0x3d')]=_0x2af488;return _0x20d4bf;})[_0x1d2e('0x20')](respondWithFilteredResult(_0x598f3e,_0x22dc8c))[_0x1d2e('0x3e')](handleError(_0x598f3e,null));};exports['show']=function(_0x37f619,_0x357449){var _0x4bb03e={'raw':![],'where':{'id':_0x37f619['params']['id']}},_0x4a49b6={};_0x4a49b6['model']=_['keys'](db[_0x1d2e('0x27')][_0x1d2e('0x3f')]);_0x4a49b6[_0x1d2e('0x2c')]=_[_0x1d2e('0x2d')](_0x37f619[_0x1d2e('0x2c')]);_0x4a49b6[_0x1d2e('0x40')]=_['intersection'](_0x4a49b6['model'],_0x4a49b6['query']);_0x4bb03e[_0x1d2e('0x30')]=_[_0x1d2e('0x2e')](_0x4a49b6[_0x1d2e('0x2f')],qs[_0x1d2e('0x31')](_0x37f619[_0x1d2e('0x2c')]['fields']));_0x4bb03e['attributes']=_0x4bb03e[_0x1d2e('0x30')][_0x1d2e('0x32')]?_0x4bb03e['attributes']:_0x4a49b6[_0x1d2e('0x2f')];if(_0x37f619[_0x1d2e('0x2c')][_0x1d2e('0x3a')]){_0x4bb03e[_0x1d2e('0x3b')]=[{'all':!![]}];}_0x4bb03e=_[_0x1d2e('0x37')]({},_0x4bb03e,_0x37f619['options']);return db[_0x1d2e('0x27')][_0x1d2e('0x41')](_0x4bb03e)[_0x1d2e('0x20')](handleEntityNotFound(_0x357449,null))[_0x1d2e('0x20')](respondWithResult(_0x357449,null))[_0x1d2e('0x3e')](handleError(_0x357449,null));};exports[_0x1d2e('0x42')]=function(_0x1be520,_0x3948de){return db[_0x1d2e('0x27')][_0x1d2e('0x42')](_0x1be520[_0x1d2e('0x43')],{})['then'](respondWithResult(_0x3948de,0xc9))[_0x1d2e('0x3e')](handleError(_0x3948de,null));};exports[_0x1d2e('0x1e')]=function(_0x5201d1,_0x15f54d){if(_0x5201d1[_0x1d2e('0x43')]['id']){delete _0x5201d1[_0x1d2e('0x43')]['id'];}return db[_0x1d2e('0x27')][_0x1d2e('0x41')]({'where':{'id':_0x5201d1[_0x1d2e('0x44')]['id']}})[_0x1d2e('0x20')](handleEntityNotFound(_0x15f54d,null))[_0x1d2e('0x20')](saveUpdates(_0x5201d1[_0x1d2e('0x43')],null))['then'](respondWithResult(_0x15f54d,null))[_0x1d2e('0x3e')](handleError(_0x15f54d,null));};exports['destroy']=function(_0x2ef030,_0x177146){return db[_0x1d2e('0x27')][_0x1d2e('0x41')]({'where':{'id':_0x2ef030[_0x1d2e('0x44')]['id']}})['then'](handleEntityNotFound(_0x177146,null))['then'](removeEntity(_0x177146,null))[_0x1d2e('0x3e')](handleError(_0x177146,null));};exports['getConfigurations']=function(_0x2b30d2,_0x7995b9,_0x4d926d){var _0x4ffa16={};var _0x3dc4fe={};var _0x24cd35;var _0x396004;return db['ZohoAccount'][_0x1d2e('0x45')]({'where':{'id':_0x2b30d2[_0x1d2e('0x44')]['id']}})[_0x1d2e('0x20')](handleEntityNotFound(_0x7995b9,null))[_0x1d2e('0x20')](function(_0x38961c){if(_0x38961c){_0x24cd35=_0x38961c;_0x3dc4fe['model']=_[_0x1d2e('0x2d')](db[_0x1d2e('0x46')][_0x1d2e('0x3f')]);_0x3dc4fe[_0x1d2e('0x2c')]=_[_0x1d2e('0x2d')](_0x2b30d2[_0x1d2e('0x2c')]);_0x3dc4fe[_0x1d2e('0x40')]=_[_0x1d2e('0x2e')](_0x3dc4fe[_0x1d2e('0x2f')],_0x3dc4fe[_0x1d2e('0x2c')]);_0x4ffa16['attributes']=_[_0x1d2e('0x2e')](_0x3dc4fe[_0x1d2e('0x2f')],qs[_0x1d2e('0x31')](_0x2b30d2[_0x1d2e('0x2c')][_0x1d2e('0x31')]));_0x4ffa16[_0x1d2e('0x30')]=_0x4ffa16[_0x1d2e('0x30')][_0x1d2e('0x32')]?_0x4ffa16[_0x1d2e('0x30')]:_0x3dc4fe[_0x1d2e('0x2f')];_0x4ffa16[_0x1d2e('0x47')]=qs['sort'](_0x2b30d2[_0x1d2e('0x2c')][_0x1d2e('0x35')]);_0x4ffa16[_0x1d2e('0x38')]=qs['filters'](_[_0x1d2e('0x36')](_0x2b30d2[_0x1d2e('0x2c')],_0x3dc4fe['filters']));if(_0x2b30d2[_0x1d2e('0x2c')][_0x1d2e('0x39')]){_0x4ffa16[_0x1d2e('0x38')]=_[_0x1d2e('0x37')](_0x4ffa16[_0x1d2e('0x38')],{'$or':_[_0x1d2e('0x2b')](_0x4ffa16[_0x1d2e('0x30')],function(_0x12fc7b){var _0x5c9101={};_0x5c9101[_0x12fc7b]={'$like':'%'+_0x2b30d2['query']['filter']+'%'};return _0x5c9101;})});}_0x4ffa16=_[_0x1d2e('0x37')]({},_0x4ffa16,_0x2b30d2[_0x1d2e('0x48')]);return _0x24cd35[_0x1d2e('0x49')](_0x4ffa16);}})[_0x1d2e('0x20')](function(_0x349585){if(_0x349585){_0x396004=_0x349585[_0x1d2e('0x32')];if(!_0x2b30d2['query'][_0x1d2e('0x33')](_0x1d2e('0x34'))){_0x4ffa16['limit']=qs[_0x1d2e('0x15')](_0x2b30d2[_0x1d2e('0x2c')][_0x1d2e('0x15')]);_0x4ffa16[_0x1d2e('0x14')]=qs['offset'](_0x2b30d2[_0x1d2e('0x2c')][_0x1d2e('0x14')]);}return _0x24cd35[_0x1d2e('0x49')](_0x4ffa16);}})[_0x1d2e('0x20')](function(_0x4ed65b){if(_0x4ed65b){return _0x4ed65b?{'count':_0x396004,'rows':_0x4ed65b}:null;}})['then'](respondWithResult(_0x7995b9,null))[_0x1d2e('0x3e')](handleError(_0x7995b9,null));};exports[_0x1d2e('0x4a')]=function(_0x36b025,_0x29a01b,_0x174739){if(_0x36b025[_0x1d2e('0x43')]['id']){delete _0x36b025[_0x1d2e('0x43')]['id'];}return db[_0x1d2e('0x27')][_0x1d2e('0x45')]({'where':{'id':_0x36b025[_0x1d2e('0x44')]['id']}})[_0x1d2e('0x20')](handleEntityNotFound(_0x29a01b,null))[_0x1d2e('0x20')](function(_0x67a716){if(_0x67a716){_0x36b025['body']['AccountId']=_0x67a716['id'];_0x36b025['body']['Subjects']=integrations[_0x1d2e('0x4b')](_0x36b025[_0x1d2e('0x43')][_0x1d2e('0x4c')],_0x36b025[_0x1d2e('0x43')][_0x1d2e('0x29')]);_0x36b025[_0x1d2e('0x43')][_0x1d2e('0x4d')]=integrations[_0x1d2e('0x4e')](_0x36b025[_0x1d2e('0x43')][_0x1d2e('0x4c')],_0x36b025[_0x1d2e('0x43')]['type']);return db[_0x1d2e('0x46')][_0x1d2e('0x42')](_0x36b025[_0x1d2e('0x43')],{'include':[{'model':db['ZohoField'],'as':_0x1d2e('0x4f')},{'model':db[_0x1d2e('0x50')],'as':_0x1d2e('0x4d')}]});}return null;})[_0x1d2e('0x20')](respondWithResult(_0x29a01b,null))[_0x1d2e('0x3e')](handleError(_0x29a01b,null));};function getAccessToken(_0x4ca9d5){return new Promise(function(_0x667688,_0x118baa){var _0x2e951a;switch(_0x4ca9d5[_0x1d2e('0x51')]){case'US':_0x2e951a='https://accounts.zoho.com';break;case'AU':_0x2e951a=_0x1d2e('0x52');break;case'EU':_0x2e951a=_0x1d2e('0x53');break;case'IN':_0x2e951a='https://accounts.zoho.in';break;case'CN':_0x2e951a=_0x1d2e('0x54');break;default:_0x2e951a=_0x1d2e('0x53');break;}var _0x1167dd={'method':_0x1d2e('0x55'),'uri':_0x2e951a+_0x1d2e('0x56'),'qs':{'refresh_token':_0x4ca9d5[_0x1d2e('0x57')],'client_id':_0x4ca9d5[_0x1d2e('0x58')],'client_secret':_0x4ca9d5['clientSecret'],'grant_type':_0x1d2e('0x59')},'json':!![]};return rp(_0x1167dd)[_0x1d2e('0x20')](function(_0x193299){if(_0x193299['access_token']){_0x667688(_0x193299[_0x1d2e('0x5a')]);}else{_0x118baa(_0x1d2e('0x5b'));}})[_0x1d2e('0x3e')](function(_0x193d59){_0x118baa(_0x193d59);});});}exports['getFields']=function(_0x1aad8f,_0x111be6,_0x3dd3fe){var _0x1c7d30,_0x2c603e,_0x3045de,_0xae7f1a,_0x4408ce;return db['ZohoAccount'][_0x1d2e('0x45')]({'where':{'id':_0x1aad8f['params']['id']},'attributes':['id','host',_0x1d2e('0x51'),_0x1d2e('0x58'),_0x1d2e('0x5c'),_0x1d2e('0x5d'),_0x1d2e('0x5e'),_0x1d2e('0x57')]})['then'](handleEntityNotFound(_0x111be6,null))[_0x1d2e('0x20')](function(_0x35fae5){_0x4408ce=_0x35fae5;_0x1c7d30=_0x4408ce[_0x1d2e('0x5f')];_0x2c603e=_0x1c7d30===_0x1d2e('0x60')?'eu':_0x1d2e('0x61');_0x3045de=_0x4408ce[_0x1d2e('0x5d')];var _0x46f6f=_0x3045de['slice'](-0x1);if(_0x46f6f==='/'||_0x46f6f==='\x5c'||_0x46f6f===':'){_0x3045de=_0x3045de[_0x1d2e('0x62')](0x0,_0x3045de[_0x1d2e('0x63')](_0x46f6f));}if(!_0x4408ce[_0x1d2e('0x57')]){throw new Error(_0x1d2e('0x64'));}return getAccessToken(_0x4408ce);})[_0x1d2e('0x20')](function(_0x3475dd){if(_0x3475dd){return rp({'method':_0x1d2e('0x65'),'uri':util[_0x1d2e('0x66')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2c603e),'qs':{'module':_0x1d2e('0x67')},'headers':{'Authorization':_0x1d2e('0x68')+_0x3475dd},'json':!![]});}})[_0x1d2e('0x20')](function(_0x23a97d){if(_0x23a97d){if(_0x23a97d[_0x1d2e('0x69')]&&_0x23a97d[_0x1d2e('0x69')][_0x1d2e('0x22')]){throw new Error(_0x23a97d['response'][_0x1d2e('0x22')]['message']);}var _0x11a9f2=[];var _0x2ecbd9=[];var _0x1162b0=[_0x1d2e('0x6a'),'Subject','Description','WhoId',_0x1d2e('0x6b'),_0x1d2e('0x6c'),_0x1d2e('0x6d'),'Call_Type'];_0x2ecbd9=_[_0x1d2e('0x6e')](_0x23a97d[_0x1d2e('0x31')],function(_0x35454d){return _0x1162b0[_0x1d2e('0x6f')](_0x35454d[_0x1d2e('0x70')]);});for(var _0xf7c4fa=0x0;_0xf7c4fa<_0x2ecbd9['length'];_0xf7c4fa++){if(_0x2ecbd9[_0xf7c4fa][_0x1d2e('0x71')]===![]){_0x11a9f2[_0x1d2e('0x72')]({'id':_0x2ecbd9[_0xf7c4fa]['id'],'name':_0x2ecbd9[_0xf7c4fa][_0x1d2e('0x73')],'custom':_0x2ecbd9[_0xf7c4fa][_0x1d2e('0x74')],'options':_0x2ecbd9[_0xf7c4fa][_0x1d2e('0x75')]===_0x1d2e('0x76')&&_0x2ecbd9[_0xf7c4fa][_0x1d2e('0x77')][_0x1d2e('0x32')]>-0x1?_[_0x1d2e('0x2b')](_0x2ecbd9[_0xf7c4fa]['pick_list_values'],function(_0x1ec634){return{'name':_0x1ec634,'value':_0x1ec634};}):[]});}}return{'count':_0x11a9f2[_0x1d2e('0x32')],'rows':_0x11a9f2};}else{return{'count':0x0,'rows':[]};}})[_0x1d2e('0x20')](respondWithResult(_0x111be6,null))[_0x1d2e('0x3e')](function(_0x359e87){var _0x42096d=_0x1aad8f[_0x1d2e('0x2c')][_0x1d2e('0x78')]?0x1f4:_0x359e87[_0x1d2e('0x79')]||0x1f4;logger[_0x1d2e('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x42096d,JSON['stringify'](_0x359e87));delete _0x359e87[_0x1d2e('0x24')];if(_0x42096d===0x191){_0x42096d=0x190;}_0x111be6[_0x1d2e('0x13')](_0x42096d)[_0x1d2e('0x25')](_0x1aad8f['query'][_0x1d2e('0x78')]?{'message':_0x1d2e('0x7a'),'statusCode':_0x359e87[_0x1d2e('0x79')]}:_0x359e87);});}; \ No newline at end of file +var _0xabb2=['../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','length','catch','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x34bab7,_0xedfc66){var _0x8319f7=function(_0x31e9e5){while(--_0x31e9e5){_0x34bab7['push'](_0x34bab7['shift']());}};_0x8319f7(++_0xedfc66);}(_0xabb2,0xeb));var _0x2abb=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xabb2[_0x34bc6c];return _0x168820;};'use strict';var emlformat=require(_0x2abb('0x0'));var rimraf=require(_0x2abb('0x1'));var zipdir=require(_0x2abb('0x2'));var jsonpatch=require(_0x2abb('0x3'));var rp=require(_0x2abb('0x4'));var moment=require(_0x2abb('0x5'));var BPromise=require(_0x2abb('0x6'));var Mustache=require('mustache');var util=require(_0x2abb('0x7'));var path=require(_0x2abb('0x8'));var sox=require('sox');var csv=require(_0x2abb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2abb('0xa'));var _=require(_0x2abb('0xb'));var squel=require('squel');var crypto=require(_0x2abb('0xc'));var jsforce=require(_0x2abb('0xd'));var deskjs=require(_0x2abb('0xe'));var toCsv=require(_0x2abb('0x9'));var querystring=require('querystring');var Papa=require(_0x2abb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2abb('0x10'));var as=require(_0x2abb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2abb('0x12'))(_0x2abb('0x13'));var utils=require(_0x2abb('0x14'));var config=require(_0x2abb('0x15'));var licenseUtil=require(_0x2abb('0x16'));var db=require(_0x2abb('0x17'))['db'];var integrations=require(_0x2abb('0x18'));function respondWithStatusCode(_0x2e1aa7,_0x467677){_0x467677=_0x467677||0xcc;return function(_0x32dd32){if(_0x32dd32){return _0x2e1aa7[_0x2abb('0x19')](_0x467677);}return _0x2e1aa7['status'](_0x467677)[_0x2abb('0x1a')]();};}function respondWithResult(_0x545ad4,_0x1a73ad){_0x1a73ad=_0x1a73ad||0xc8;return function(_0x31c971){if(_0x31c971){return _0x545ad4[_0x2abb('0x1b')](_0x1a73ad)[_0x2abb('0x1c')](_0x31c971);}};}function respondWithFilteredResult(_0x4e48b3,_0x5087d8){return function(_0x3a219e){if(_0x3a219e){var _0x17647c=typeof _0x5087d8[_0x2abb('0x1d')]===_0x2abb('0x1e')&&typeof _0x5087d8[_0x2abb('0x1f')]==='undefined';var _0x3a6248=_0x3a219e[_0x2abb('0x20')];var _0x3e18dd=_0x17647c?0x0:_0x5087d8[_0x2abb('0x1d')];var _0x2f304e=_0x17647c?_0x3a219e[_0x2abb('0x20')]:_0x5087d8['offset']+_0x5087d8[_0x2abb('0x1f')];var _0x13c9f4;if(_0x2f304e>=_0x3a6248){_0x2f304e=_0x3a6248;_0x13c9f4=0xc8;}else{_0x13c9f4=0xce;}_0x4e48b3[_0x2abb('0x1b')](_0x13c9f4);return _0x4e48b3[_0x2abb('0x21')]('Content-Range',_0x3e18dd+'-'+_0x2f304e+'/'+_0x3a6248)[_0x2abb('0x1c')](_0x3a219e);}return null;};}function patchUpdates(_0xf2d379){return function(_0x26edd8){try{jsonpatch['apply'](_0x26edd8,_0xf2d379,!![]);}catch(_0x1a7df6){return BPromise[_0x2abb('0x22')](_0x1a7df6);}return _0x26edd8[_0x2abb('0x23')]();};}function saveUpdates(_0x7b19f6,_0x69e060){return function(_0x44c3e9){if(_0x44c3e9){return _0x44c3e9[_0x2abb('0x24')](_0x7b19f6)['then'](function(_0x53f52b){return _0x53f52b;});}return null;};}function removeEntity(_0x11681d,_0x35ce1e){return function(_0x5bb2cd){if(_0x5bb2cd){return _0x5bb2cd['destroy']()['then'](function(){_0x11681d[_0x2abb('0x1b')](0xcc)[_0x2abb('0x1a')]();});}};}function handleEntityNotFound(_0x40206f,_0x2e61cc){return function(_0x527aed){if(!_0x527aed){_0x40206f[_0x2abb('0x19')](0x194);}return _0x527aed;};}function handleError(_0x4e62b5,_0x3a4129){_0x3a4129=_0x3a4129||0x1f4;return function(_0x388a2c){logger[_0x2abb('0x25')](_0x388a2c[_0x2abb('0x26')]);if(_0x388a2c[_0x2abb('0x27')]){delete _0x388a2c['name'];}_0x4e62b5[_0x2abb('0x1b')](_0x3a4129)[_0x2abb('0x28')](_0x388a2c);};}exports['index']=function(_0x1c481b,_0x2751c8){var _0x3c01ab={},_0x3b32e1={},_0x143acc={'count':0x0,'rows':[]};var _0x177e1b=_[_0x2abb('0x29')](db[_0x2abb('0x2a')][_0x2abb('0x2b')],function(_0x4273b0){return{'name':_0x4273b0[_0x2abb('0x2c')],'type':_0x4273b0[_0x2abb('0x2d')][_0x2abb('0x2e')]};});_0x3b32e1[_0x2abb('0x2f')]=_['map'](_0x177e1b,_0x2abb('0x27'));_0x3b32e1[_0x2abb('0x30')]=_[_0x2abb('0x31')](_0x1c481b[_0x2abb('0x30')]);_0x3b32e1[_0x2abb('0x32')]=_[_0x2abb('0x33')](_0x3b32e1[_0x2abb('0x2f')],_0x3b32e1['query']);_0x3c01ab[_0x2abb('0x34')]=_['intersection'](_0x3b32e1[_0x2abb('0x2f')],qs[_0x2abb('0x35')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x35')]));_0x3c01ab[_0x2abb('0x34')]=_0x3c01ab[_0x2abb('0x34')]['length']?_0x3c01ab[_0x2abb('0x34')]:_0x3b32e1[_0x2abb('0x2f')];if(!_0x1c481b[_0x2abb('0x30')][_0x2abb('0x36')](_0x2abb('0x37'))){_0x3c01ab[_0x2abb('0x1f')]=qs[_0x2abb('0x1f')](_0x1c481b[_0x2abb('0x30')]['limit']);_0x3c01ab[_0x2abb('0x1d')]=qs[_0x2abb('0x1d')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x1d')]);}_0x3c01ab['order']=qs[_0x2abb('0x38')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x38')]);_0x3c01ab['where']=qs['filters'](_[_0x2abb('0x39')](_0x1c481b[_0x2abb('0x30')],_0x3b32e1[_0x2abb('0x32')]),_0x177e1b);if(_0x1c481b[_0x2abb('0x30')][_0x2abb('0x3a')]){_0x3c01ab[_0x2abb('0x3b')]=_[_0x2abb('0x3c')](_0x3c01ab[_0x2abb('0x3b')],{'$or':_[_0x2abb('0x29')](_0x177e1b,function(_0x3063ae){if(_0x3063ae['type']!==_0x2abb('0x3d')){var _0x2d6e9e={};_0x2d6e9e[_0x3063ae[_0x2abb('0x27')]]={'$like':'%'+_0x1c481b[_0x2abb('0x30')]['filter']+'%'};return _0x2d6e9e;}})});}_0x3c01ab=_[_0x2abb('0x3c')]({},_0x3c01ab,_0x1c481b[_0x2abb('0x3e')]);var _0x534b31={'where':_0x3c01ab[_0x2abb('0x3b')]};return db['ZohoAccount'][_0x2abb('0x20')](_0x534b31)[_0x2abb('0x3f')](function(_0x11f65a){_0x143acc[_0x2abb('0x20')]=_0x11f65a;if(_0x1c481b[_0x2abb('0x30')][_0x2abb('0x40')]){_0x3c01ab[_0x2abb('0x41')]=[{'all':!![]}];}return db[_0x2abb('0x2a')][_0x2abb('0x42')](_0x3c01ab);})[_0x2abb('0x3f')](function(_0x463f78){_0x143acc[_0x2abb('0x43')]=_0x463f78;return _0x143acc;})[_0x2abb('0x3f')](respondWithFilteredResult(_0x2751c8,_0x3c01ab))['catch'](handleError(_0x2751c8,null));};exports['show']=function(_0x3c40c5,_0x23ad1a){var _0x11c3e3={'raw':![],'where':{'id':_0x3c40c5['params']['id']}},_0x36a695={};_0x36a695[_0x2abb('0x2f')]=_['keys'](db[_0x2abb('0x2a')][_0x2abb('0x2b')]);_0x36a695[_0x2abb('0x30')]=_['keys'](_0x3c40c5[_0x2abb('0x30')]);_0x36a695[_0x2abb('0x32')]=_[_0x2abb('0x33')](_0x36a695['model'],_0x36a695[_0x2abb('0x30')]);_0x11c3e3[_0x2abb('0x34')]=_[_0x2abb('0x33')](_0x36a695[_0x2abb('0x2f')],qs['fields'](_0x3c40c5[_0x2abb('0x30')][_0x2abb('0x35')]));_0x11c3e3['attributes']=_0x11c3e3[_0x2abb('0x34')][_0x2abb('0x44')]?_0x11c3e3[_0x2abb('0x34')]:_0x36a695['model'];if(_0x3c40c5[_0x2abb('0x30')][_0x2abb('0x40')]){_0x11c3e3[_0x2abb('0x41')]=[{'all':!![]}];}_0x11c3e3=_[_0x2abb('0x3c')]({},_0x11c3e3,_0x3c40c5[_0x2abb('0x3e')]);return db['ZohoAccount']['find'](_0x11c3e3)['then'](handleEntityNotFound(_0x23ad1a,null))['then'](respondWithResult(_0x23ad1a,null))[_0x2abb('0x45')](handleError(_0x23ad1a,null));};exports[_0x2abb('0x46')]=function(_0x505fad,_0x5386da){return db[_0x2abb('0x2a')][_0x2abb('0x46')](_0x505fad[_0x2abb('0x47')],{})['then'](respondWithResult(_0x5386da,0xc9))['catch'](handleError(_0x5386da,null));};exports[_0x2abb('0x24')]=function(_0x1bceaf,_0x50a6d0){if(_0x1bceaf[_0x2abb('0x47')]['id']){delete _0x1bceaf[_0x2abb('0x47')]['id'];}return db['ZohoAccount'][_0x2abb('0x48')]({'where':{'id':_0x1bceaf[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0x50a6d0,null))['then'](saveUpdates(_0x1bceaf[_0x2abb('0x47')],null))[_0x2abb('0x3f')](respondWithResult(_0x50a6d0,null))[_0x2abb('0x45')](handleError(_0x50a6d0,null));};exports['destroy']=function(_0xf5cb21,_0x32b416){return db[_0x2abb('0x2a')][_0x2abb('0x48')]({'where':{'id':_0xf5cb21[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0x32b416,null))[_0x2abb('0x3f')](removeEntity(_0x32b416,null))[_0x2abb('0x45')](handleError(_0x32b416,null));};exports[_0x2abb('0x4a')]=function(_0x1213cb,_0xa64e9a,_0x12470a){var _0x93b118={};var _0x2ca629={};var _0xb0ba6b;var _0x1957b8;return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x1213cb[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0xa64e9a,null))['then'](function(_0x5604e4){if(_0x5604e4){_0xb0ba6b=_0x5604e4;_0x2ca629[_0x2abb('0x2f')]=_['keys'](db[_0x2abb('0x4c')]['rawAttributes']);_0x2ca629[_0x2abb('0x30')]=_[_0x2abb('0x31')](_0x1213cb[_0x2abb('0x30')]);_0x2ca629['filters']=_[_0x2abb('0x33')](_0x2ca629[_0x2abb('0x2f')],_0x2ca629[_0x2abb('0x30')]);_0x93b118[_0x2abb('0x34')]=_[_0x2abb('0x33')](_0x2ca629['model'],qs[_0x2abb('0x35')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x35')]));_0x93b118[_0x2abb('0x34')]=_0x93b118[_0x2abb('0x34')][_0x2abb('0x44')]?_0x93b118['attributes']:_0x2ca629[_0x2abb('0x2f')];_0x93b118[_0x2abb('0x4d')]=qs[_0x2abb('0x38')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x38')]);_0x93b118[_0x2abb('0x3b')]=qs[_0x2abb('0x32')](_[_0x2abb('0x39')](_0x1213cb['query'],_0x2ca629[_0x2abb('0x32')]));if(_0x1213cb[_0x2abb('0x30')]['filter']){_0x93b118[_0x2abb('0x3b')]=_['merge'](_0x93b118[_0x2abb('0x3b')],{'$or':_[_0x2abb('0x29')](_0x93b118[_0x2abb('0x34')],function(_0x382dcd){var _0x18bda0={};_0x18bda0[_0x382dcd]={'$like':'%'+_0x1213cb[_0x2abb('0x30')]['filter']+'%'};return _0x18bda0;})});}_0x93b118=_['merge']({},_0x93b118,_0x1213cb[_0x2abb('0x3e')]);return _0xb0ba6b[_0x2abb('0x4a')](_0x93b118);}})['then'](function(_0x781b88){if(_0x781b88){_0x1957b8=_0x781b88[_0x2abb('0x44')];if(!_0x1213cb[_0x2abb('0x30')]['hasOwnProperty'](_0x2abb('0x37'))){_0x93b118[_0x2abb('0x1f')]=qs['limit'](_0x1213cb['query'][_0x2abb('0x1f')]);_0x93b118[_0x2abb('0x1d')]=qs[_0x2abb('0x1d')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x1d')]);}return _0xb0ba6b[_0x2abb('0x4a')](_0x93b118);}})['then'](function(_0x47c23f){if(_0x47c23f){return _0x47c23f?{'count':_0x1957b8,'rows':_0x47c23f}:null;}})[_0x2abb('0x3f')](respondWithResult(_0xa64e9a,null))[_0x2abb('0x45')](handleError(_0xa64e9a,null));};exports['addConfiguration']=function(_0x2285b3,_0x3c5382,_0x5f383f){if(_0x2285b3[_0x2abb('0x47')]['id']){delete _0x2285b3[_0x2abb('0x47')]['id'];}return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x2285b3[_0x2abb('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c5382,null))[_0x2abb('0x3f')](function(_0x4c4de5){if(_0x4c4de5){_0x2285b3[_0x2abb('0x47')][_0x2abb('0x4e')]=_0x4c4de5['id'];_0x2285b3['body'][_0x2abb('0x4f')]=integrations[_0x2abb('0x50')](_0x2285b3[_0x2abb('0x47')][_0x2abb('0x51')],_0x2285b3['body'][_0x2abb('0x2d')]);_0x2285b3[_0x2abb('0x47')][_0x2abb('0x52')]=integrations[_0x2abb('0x53')](_0x2285b3[_0x2abb('0x47')][_0x2abb('0x51')],_0x2285b3[_0x2abb('0x47')]['type']);return db[_0x2abb('0x4c')][_0x2abb('0x46')](_0x2285b3[_0x2abb('0x47')],{'include':[{'model':db['ZohoField'],'as':_0x2abb('0x4f')},{'model':db[_0x2abb('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3c5382,null))[_0x2abb('0x45')](handleError(_0x3c5382,null));};function getAccessToken(_0x3d1502){return new Promise(function(_0x321b80,_0x1c9166){var _0x34887b;switch(_0x3d1502[_0x2abb('0x55')]){case'US':_0x34887b=_0x2abb('0x56');break;case'AU':_0x34887b='https://accounts.zoho.com.au';break;case'EU':_0x34887b=_0x2abb('0x57');break;case'IN':_0x34887b=_0x2abb('0x58');break;case'CN':_0x34887b=_0x2abb('0x59');break;default:_0x34887b=_0x2abb('0x57');break;}var _0x760374={'method':_0x2abb('0x5a'),'uri':_0x34887b+_0x2abb('0x5b'),'qs':{'refresh_token':_0x3d1502[_0x2abb('0x5c')],'client_id':_0x3d1502['clientId'],'client_secret':_0x3d1502[_0x2abb('0x5d')],'grant_type':_0x2abb('0x5e')},'json':!![]};return rp(_0x760374)[_0x2abb('0x3f')](function(_0x389a54){if(_0x389a54[_0x2abb('0x5f')]){_0x321b80(_0x389a54[_0x2abb('0x5f')]);}else{_0x1c9166(_0x2abb('0x60'));}})['catch'](function(_0x60fbb5){_0x1c9166(_0x60fbb5);});});}exports[_0x2abb('0x61')]=function(_0x44bda7,_0x50e6bb,_0x2a3ae9){var _0x505daa,_0x1d38ad,_0x55cad4,_0x2c8f9c,_0x8bd99d;return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x44bda7[_0x2abb('0x49')]['id']},'attributes':['id',_0x2abb('0x62'),'zone',_0x2abb('0x63'),_0x2abb('0x5d'),_0x2abb('0x64'),_0x2abb('0x65'),_0x2abb('0x5c')]})['then'](handleEntityNotFound(_0x50e6bb,null))[_0x2abb('0x3f')](function(_0x502a06){_0x8bd99d=_0x502a06;_0x505daa=_0x8bd99d[_0x2abb('0x62')];_0x1d38ad=_0x505daa===_0x2abb('0x66')?'eu':_0x2abb('0x67');_0x55cad4=_0x8bd99d[_0x2abb('0x64')];var _0x49db1e=_0x55cad4['slice'](-0x1);if(_0x49db1e==='/'||_0x49db1e==='\x5c'||_0x49db1e===':'){_0x55cad4=_0x55cad4['substring'](0x0,_0x55cad4['lastIndexOf'](_0x49db1e));}if(!_0x8bd99d[_0x2abb('0x5c')]){throw new Error(_0x2abb('0x68'));}return getAccessToken(_0x8bd99d);})[_0x2abb('0x3f')](function(_0x28d017){if(_0x28d017){return rp({'method':_0x2abb('0x69'),'uri':util[_0x2abb('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1d38ad),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2abb('0x6b')+_0x28d017},'json':!![]});}})[_0x2abb('0x3f')](function(_0x4ec3ff){if(_0x4ec3ff){if(_0x4ec3ff[_0x2abb('0x6c')]&&_0x4ec3ff[_0x2abb('0x6c')][_0x2abb('0x25')]){throw new Error(_0x4ec3ff['response'][_0x2abb('0x25')][_0x2abb('0x6d')]);}var _0x5b80f4=[];var _0x4850fc=[];var _0x2eae8d=[_0x2abb('0x6e'),_0x2abb('0x6f'),_0x2abb('0x70'),'WhoId',_0x2abb('0x71'),_0x2abb('0x72'),_0x2abb('0x73'),_0x2abb('0x74')];_0x4850fc=_[_0x2abb('0x75')](_0x4ec3ff[_0x2abb('0x35')],function(_0x180997){return _0x2eae8d[_0x2abb('0x76')](_0x180997[_0x2abb('0x77')]);});for(var _0x3cc742=0x0;_0x3cc742<_0x4850fc['length'];_0x3cc742++){if(_0x4850fc[_0x3cc742]['system_mandatory']===![]){_0x5b80f4[_0x2abb('0x78')]({'id':_0x4850fc[_0x3cc742]['id'],'name':_0x4850fc[_0x3cc742]['display_label'],'custom':_0x4850fc[_0x3cc742][_0x2abb('0x79')],'options':_0x4850fc[_0x3cc742]['data_type']===_0x2abb('0x7a')&&_0x4850fc[_0x3cc742][_0x2abb('0x7b')][_0x2abb('0x44')]>-0x1?_[_0x2abb('0x29')](_0x4850fc[_0x3cc742][_0x2abb('0x7b')],function(_0x550032){return{'name':_0x550032,'value':_0x550032};}):[]});}}return{'count':_0x5b80f4[_0x2abb('0x44')],'rows':_0x5b80f4};}else{return{'count':0x0,'rows':[]};}})[_0x2abb('0x3f')](respondWithResult(_0x50e6bb,null))[_0x2abb('0x45')](function(_0x1e1119){var _0x366f04=_0x44bda7['query']['test']?0x1f4:_0x1e1119[_0x2abb('0x7c')]||0x1f4;logger['error'](_0x2abb('0x7d'),'getFields',_0x366f04,JSON[_0x2abb('0x7e')](_0x1e1119));delete _0x1e1119[_0x2abb('0x27')];if(_0x366f04===0x191){_0x366f04=0x190;}_0x50e6bb[_0x2abb('0x1b')](_0x366f04)[_0x2abb('0x28')](_0x44bda7[_0x2abb('0x30')][_0x2abb('0x7f')]?{'message':_0x2abb('0x80'),'statusCode':_0x1e1119[_0x2abb('0x7c')]}:_0x1e1119);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 35b0ebd..f76ff6e 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 _0x17fb=['slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientSecret','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.com','https://accounts.zoho.com.cn','/oauth/v2/token','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId'];(function(_0x16f55d,_0x43c7fe){var _0x3f3706=function(_0x908684){while(--_0x908684){_0x16f55d['push'](_0x16f55d['shift']());}};_0x3f3706(++_0x43c7fe);}(_0x17fb,0xc1));var _0xb17f=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x17fb[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xb17f('0x0'));var util=require(_0xb17f('0x1'));var logger=require('../../config/logger')(_0xb17f('0x2'));var moment=require(_0xb17f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb17f('0x4'));var fs=require('fs');var path=require(_0xb17f('0x5'));var rimraf=require(_0xb17f('0x6'));var config=require(_0xb17f('0x7'));var attributes=require(_0xb17f('0x8'));var integrations=require(_0xb17f('0x9'));module[_0xb17f('0xa')]=function(_0x5519f0,_0x1cd614){return _0x5519f0[_0xb17f('0xb')]('ZohoAccount',attributes,{'tableName':_0xb17f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3fabd0,_0x236020,_0x153dac){if(_0x3fabd0[_0xb17f('0xd')](_0xb17f('0xe'))||_0x3fabd0[_0xb17f('0xd')](_0xb17f('0xf'))||_0x3fabd0[_0xb17f('0xd')](_0xb17f('0x10'))||_0x3fabd0[_0xb17f('0xd')]('clientSecret')||_0x3fabd0[_0xb17f('0xd')]('code')||_0x3fabd0['changed']('host')){var _0x5ae3eb,_0x494789;_0x5ae3eb=_0x3fabd0['serverUrl'];var _0x185b52=_0x5ae3eb[_0xb17f('0x11')](-0x1);if(_0x185b52==='/'||_0x185b52==='\x5c'||_0x185b52===':'){_0x5ae3eb=_0x5ae3eb['substring'](0x0,_0x5ae3eb[_0xb17f('0x12')](_0x185b52));}switch(_0x3fabd0[_0xb17f('0xe')]){case'US':_0x494789='https://accounts.zoho.com';break;case'AU':_0x494789='https://accounts.zoho.com.au';break;case'IN':_0x494789=_0xb17f('0x13');break;case'CN':_0x494789='https://accounts.zoho.com.cn';break;default:_0x494789=_0xb17f('0x14');break;}var _0x258b7a={'method':_0xb17f('0x15'),'uri':_0x494789+'/oauth/v2/token','form':{'grant_type':_0xb17f('0x16'),'client_id':_0x3fabd0[_0xb17f('0x10')],'client_secret':_0x3fabd0[_0xb17f('0x17')],'redirect_uri':_0x3fabd0[_0xb17f('0xf')],'code':_0x3fabd0[_0xb17f('0x18')]},'headers':{'Content-Type':_0xb17f('0x19')}};return rp(_0x258b7a)[_0xb17f('0x1a')](function(_0x43d16d){var _0x341369=JSON[_0xb17f('0x1b')](_0x43d16d);if(_0x341369[_0xb17f('0x1c')]){_0x3fabd0[_0xb17f('0x1d')]=_0x341369['refresh_token'];logger[_0xb17f('0x1e')](util[_0xb17f('0x1f')](_0xb17f('0x20'),_0x3fabd0[_0xb17f('0x21')],_0x3fabd0['id']));}else{logger[_0xb17f('0x22')](util[_0xb17f('0x1f')](_0xb17f('0x23'),_0x3fabd0[_0xb17f('0x21')],_0x3fabd0['id']),util[_0xb17f('0x24')](_0x341369,{'showHidden':![],'depth':null}));}return _0x153dac(null,_0x236020);})[_0xb17f('0x25')](function(_0x4c3bd1){logger['error'](util[_0xb17f('0x1f')](_0xb17f('0x23'),_0x3fabd0['name'],_0x3fabd0['id']),util[_0xb17f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x153dac(_0x4c3bd1);});}else{return _0x153dac(null,_0x236020);}},'beforeUpdate':function(_0x3f7ca0,_0x4025ff,_0x9aba46){if(_0x3f7ca0[_0xb17f('0xd')](_0xb17f('0xe'))||_0x3f7ca0[_0xb17f('0xd')](_0xb17f('0xf'))||_0x3f7ca0['changed'](_0xb17f('0x10'))||_0x3f7ca0[_0xb17f('0xd')](_0xb17f('0x17'))||_0x3f7ca0[_0xb17f('0xd')](_0xb17f('0x18'))||_0x3f7ca0[_0xb17f('0xd')]('host')){var _0x1f9b00,_0xa35d97;_0x1f9b00=_0x3f7ca0[_0xb17f('0xf')];var _0x439145=_0x1f9b00['slice'](-0x1);if(_0x439145==='/'||_0x439145==='\x5c'||_0x439145===':'){_0x1f9b00=_0x1f9b00[_0xb17f('0x26')](0x0,_0x1f9b00[_0xb17f('0x12')](_0x439145));}switch(_0x3f7ca0['zone']){case'US':_0xa35d97=_0xb17f('0x27');break;case'AU':_0xa35d97='https://accounts.zoho.com.au';break;case'IN':_0xa35d97=_0xb17f('0x13');break;case'CN':_0xa35d97=_0xb17f('0x28');break;default:_0xa35d97=_0xb17f('0x14');break;}var _0x5e48c1={'method':_0xb17f('0x15'),'uri':_0xa35d97+_0xb17f('0x29'),'form':{'grant_type':_0xb17f('0x16'),'client_id':_0x3f7ca0[_0xb17f('0x10')],'client_secret':_0x3f7ca0[_0xb17f('0x17')],'redirect_uri':_0x3f7ca0['serverUrl'],'code':_0x3f7ca0['code']},'headers':{'Content-Type':_0xb17f('0x19')}};return rp(_0x5e48c1)[_0xb17f('0x1a')](function(_0x4c9b8a){var _0x33eb23=JSON[_0xb17f('0x1b')](_0x4c9b8a);if(_0x33eb23[_0xb17f('0x1c')]){_0x3f7ca0[_0xb17f('0x1d')]=_0x33eb23[_0xb17f('0x1c')];logger[_0xb17f('0x1e')](util['format'](_0xb17f('0x20'),_0x3f7ca0[_0xb17f('0x21')],_0x3f7ca0['id']));}else{logger[_0xb17f('0x22')](util[_0xb17f('0x1f')](_0xb17f('0x23'),_0x3f7ca0[_0xb17f('0x21')],_0x3f7ca0['id']),util['inspect'](_0x33eb23,{'showHidden':![],'depth':null}));}return _0x9aba46(null,_0x4025ff);})[_0xb17f('0x25')](function(_0x4fda15){logger['error'](util[_0xb17f('0x1f')](_0xb17f('0x23'),_0x3f7ca0[_0xb17f('0x21')],_0x3f7ca0['id']),util[_0xb17f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x9aba46(_0x4fda15);});}else{return _0x9aba46(null,_0x4025ff);}}}});}; \ No newline at end of file +var _0xf5e8=['changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','POST','authorization_code','then','info','catch','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0xf5e8[_0x2b55b5];return _0x103d28;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f5e('0x5'));var fs=require('fs');var path=require(_0x8f5e('0x6'));var rimraf=require('rimraf');var config=require(_0x8f5e('0x7'));var attributes=require(_0x8f5e('0x8'));var integrations=require(_0x8f5e('0x9'));module[_0x8f5e('0xa')]=function(_0x48ed61,_0x49a02f){return _0x48ed61[_0x8f5e('0xb')](_0x8f5e('0xc'),attributes,{'tableName':_0x8f5e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e9aaa,_0x131cfe,_0x444281){if(_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0xf'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x10'))||_0x5e9aaa['changed'](_0x8f5e('0x11'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x12'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x13'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x14'))){var _0x44b8fe,_0x516c04;_0x44b8fe=_0x5e9aaa[_0x8f5e('0x10')];var _0x3d0c37=_0x44b8fe[_0x8f5e('0x15')](-0x1);if(_0x3d0c37==='/'||_0x3d0c37==='\x5c'||_0x3d0c37===':'){_0x44b8fe=_0x44b8fe[_0x8f5e('0x16')](0x0,_0x44b8fe[_0x8f5e('0x17')](_0x3d0c37));}switch(_0x5e9aaa['zone']){case'US':_0x516c04=_0x8f5e('0x18');break;case'AU':_0x516c04=_0x8f5e('0x19');break;case'IN':_0x516c04=_0x8f5e('0x1a');break;case'CN':_0x516c04=_0x8f5e('0x1b');break;default:_0x516c04=_0x8f5e('0x1c');break;}var _0x40dae1={'method':'POST','uri':_0x516c04+_0x8f5e('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0x5e9aaa[_0x8f5e('0x11')],'client_secret':_0x5e9aaa[_0x8f5e('0x12')],'redirect_uri':_0x5e9aaa[_0x8f5e('0x10')],'code':_0x5e9aaa[_0x8f5e('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x40dae1)['then'](function(_0x1c117c){var _0x2625b4=JSON[_0x8f5e('0x1e')](_0x1c117c);if(_0x2625b4[_0x8f5e('0x1f')]){_0x5e9aaa[_0x8f5e('0x20')]=_0x2625b4[_0x8f5e('0x1f')];logger['info'](util[_0x8f5e('0x21')](_0x8f5e('0x22'),_0x5e9aaa[_0x8f5e('0x23')],_0x5e9aaa['id']));}else{logger['error'](util['format'](_0x8f5e('0x24'),_0x5e9aaa['name'],_0x5e9aaa['id']),util[_0x8f5e('0x25')](_0x2625b4,{'showHidden':![],'depth':null}));}return _0x444281(null,_0x131cfe);})['catch'](function(_0x1488f0){logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x5e9aaa[_0x8f5e('0x23')],_0x5e9aaa['id']),util[_0x8f5e('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x444281(_0x1488f0);});}else{return _0x444281(null,_0x131cfe);}},'beforeUpdate':function(_0x3e5347,_0x1a7649,_0x1ee875){if(_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0xf'))||_0x3e5347[_0x8f5e('0xe')]('serverUrl')||_0x3e5347['changed']('clientId')||_0x3e5347['changed']('clientSecret')||_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0x13'))||_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0x14'))){var _0x3f7a06,_0x183360;_0x3f7a06=_0x3e5347[_0x8f5e('0x10')];var _0x326feb=_0x3f7a06['slice'](-0x1);if(_0x326feb==='/'||_0x326feb==='\x5c'||_0x326feb===':'){_0x3f7a06=_0x3f7a06[_0x8f5e('0x16')](0x0,_0x3f7a06['lastIndexOf'](_0x326feb));}switch(_0x3e5347[_0x8f5e('0xf')]){case'US':_0x183360=_0x8f5e('0x18');break;case'AU':_0x183360=_0x8f5e('0x19');break;case'IN':_0x183360=_0x8f5e('0x1a');break;case'CN':_0x183360=_0x8f5e('0x1b');break;default:_0x183360=_0x8f5e('0x1c');break;}var _0x48a8e5={'method':_0x8f5e('0x27'),'uri':_0x183360+_0x8f5e('0x1d'),'form':{'grant_type':_0x8f5e('0x28'),'client_id':_0x3e5347[_0x8f5e('0x11')],'client_secret':_0x3e5347[_0x8f5e('0x12')],'redirect_uri':_0x3e5347['serverUrl'],'code':_0x3e5347['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x48a8e5)[_0x8f5e('0x29')](function(_0x4b1148){var _0x18df49=JSON[_0x8f5e('0x1e')](_0x4b1148);if(_0x18df49[_0x8f5e('0x1f')]){_0x3e5347[_0x8f5e('0x20')]=_0x18df49[_0x8f5e('0x1f')];logger[_0x8f5e('0x2a')](util['format'](_0x8f5e('0x22'),_0x3e5347[_0x8f5e('0x23')],_0x3e5347['id']));}else{logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x3e5347[_0x8f5e('0x23')],_0x3e5347['id']),util[_0x8f5e('0x25')](_0x18df49,{'showHidden':![],'depth':null}));}return _0x1ee875(null,_0x1a7649);})[_0x8f5e('0x2b')](function(_0x4e1984){logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x3e5347['name'],_0x3e5347['id']),util[_0x8f5e('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1ee875(_0x4e1984);});}else{return _0x1ee875(null,_0x1a7649);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b55f601..f95ed9d 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 _0x7da6=['options','attributes','include','map','model','then','GetZohoAccount','stringify','ShowZohoAccount','find','raw','where','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ZohoAccount','findAll'];(function(_0x7a3e1b,_0x206afb){var _0x258916=function(_0x28a323){while(--_0x28a323){_0x7a3e1b['push'](_0x7a3e1b['shift']());}};_0x258916(++_0x206afb);}(_0x7da6,0x124));var _0x67da=function(_0x325bc4,_0x4df462){_0x325bc4=_0x325bc4-0x0;var _0x330091=_0x7da6[_0x325bc4];return _0x330091;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67da('0x0'));var BPromise=require(_0x67da('0x1'));var rs=require(_0x67da('0x2'));var fs=require('fs');var Redis=require(_0x67da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67da('0x4'));var logger=require(_0x67da('0x5'))(_0x67da('0x6'));var config=require(_0x67da('0x7'));var jayson=require(_0x67da('0x8'));var client=jayson[_0x67da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb7f52,_0x49025f,_0x4cfe49){return new BPromise(function(_0x3d971d,_0x5ac004){return client[_0x67da('0xa')](_0xb7f52,_0x4cfe49)['then'](function(_0x1e8a4c){logger[_0x67da('0xb')](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));logger[_0x67da('0xe')](_0x67da('0xf'),_0x49025f,_0x67da('0xd'),JSON['stringify'](_0x1e8a4c));if(_0x1e8a4c[_0x67da('0x10')]){if(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x11')]===0x1f4){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x5ac004(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x3d971d(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}else{logger['info'](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));_0x3d971d(_0x1e8a4c[_0x67da('0x13')][_0x67da('0x12')]);}})[_0x67da('0x14')](function(_0xb3a67){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0xb3a67);_0x5ac004(_0xb3a67);});});}exports['GetZohoAccount']=function(_0xaefe69){var _0x524819=this;return new Promise(function(_0x31454f,_0x5765d5){return db[_0x67da('0x15')][_0x67da('0x16')]({'raw':_0xaefe69[_0x67da('0x17')]?_0xaefe69[_0x67da('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xaefe69[_0x67da('0x17')]?_0xaefe69['options']['where']||null:null,'attributes':_0xaefe69[_0x67da('0x17')]?_0xaefe69[_0x67da('0x17')][_0x67da('0x18')]||null:null,'limit':_0xaefe69[_0x67da('0x17')]?_0xaefe69['options']['limit']||null:null,'include':_0xaefe69['options']?_0xaefe69[_0x67da('0x17')][_0x67da('0x19')]?_[_0x67da('0x1a')](_0xaefe69[_0x67da('0x17')][_0x67da('0x19')],function(_0x4e6cb1){return{'model':db[_0x4e6cb1['model']],'as':_0x4e6cb1['as'],'attributes':_0x4e6cb1[_0x67da('0x18')],'include':_0x4e6cb1[_0x67da('0x19')]?_['map'](_0x4e6cb1[_0x67da('0x19')],function(_0x599a9d){return{'model':db[_0x599a9d[_0x67da('0x1b')]],'as':_0x599a9d['as'],'attributes':_0x599a9d[_0x67da('0x18')],'include':_0x599a9d[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x599a9d[_0x67da('0x19')],function(_0x35b1bc){return{'model':db[_0x35b1bc['model']],'as':_0x35b1bc['as'],'attributes':_0x35b1bc[_0x67da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x67da('0x1c')](function(_0x5875d9){logger['info'](_0x67da('0x1d'),_0xaefe69);logger[_0x67da('0xe')](_0x67da('0x1d'),_0xaefe69,JSON[_0x67da('0x1e')](_0x5875d9));_0x31454f(_0x5875d9);})['catch'](function(_0x1cba18){logger[_0x67da('0x10')](_0x67da('0x1d'),_0x1cba18[_0x67da('0x12')],_0xaefe69);_0x5765d5(_0x524819[_0x67da('0x10')](0x1f4,_0x1cba18[_0x67da('0x12')]));});});};exports[_0x67da('0x1f')]=function(_0x1e2bd0){var _0x36d143=this;return new Promise(function(_0x91fc5c,_0x18dd99){return db[_0x67da('0x15')][_0x67da('0x20')]({'raw':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0['options'][_0x67da('0x21')]===undefined?!![]:![]:!![],'where':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')][_0x67da('0x22')]||null:null,'attributes':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')]['attributes']||null:null,'include':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')][_0x67da('0x19')]?_['map'](_0x1e2bd0['options']['include'],function(_0x4cfcab){return{'model':db[_0x4cfcab[_0x67da('0x1b')]],'as':_0x4cfcab['as'],'attributes':_0x4cfcab['attributes'],'include':_0x4cfcab[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x4cfcab[_0x67da('0x19')],function(_0x21c253){return{'model':db[_0x21c253[_0x67da('0x1b')]],'as':_0x21c253['as'],'attributes':_0x21c253[_0x67da('0x18')],'include':_0x21c253[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x21c253[_0x67da('0x19')],function(_0x11ec02){return{'model':db[_0x11ec02[_0x67da('0x1b')]],'as':_0x11ec02['as'],'attributes':_0x11ec02[_0x67da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x67da('0x1c')](function(_0x1348bb){logger[_0x67da('0xb')](_0x67da('0x1f'),_0x1e2bd0);logger[_0x67da('0xe')](_0x67da('0x1f'),_0x1e2bd0,JSON[_0x67da('0x1e')](_0x1348bb));_0x91fc5c(_0x1348bb);})[_0x67da('0x14')](function(_0xa96a4e){logger[_0x67da('0x10')](_0x67da('0x1f'),_0xa96a4e[_0x67da('0x12')],_0x1e2bd0);_0x18dd99(_0x36d143[_0x67da('0x10')](0x1f4,_0xa96a4e[_0x67da('0x12')]));});});}; \ No newline at end of file +var _0x5713=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','ZohoAccount','findAll','options','where','limit','include','model','attributes','map','find','raw','ShowZohoAccount','stringify','catch'];(function(_0x403db1,_0x59018e){var _0x47c48f=function(_0x1b663c){while(--_0x1b663c){_0x403db1['push'](_0x403db1['shift']());}};_0x47c48f(++_0x59018e);}(_0x5713,0x1c7));var _0x3571=function(_0x54493b,_0x5da0bb){_0x54493b=_0x54493b-0x0;var _0x20b87b=_0x5713[_0x54493b];return _0x20b87b;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});}exports[_0x3571('0x14')]=function(_0x37881f){var _0x4b745a=this;return new Promise(function(_0x22a418,_0xab19b1){return db[_0x3571('0x15')][_0x3571('0x16')]({'raw':_0x37881f[_0x3571('0x17')]?_0x37881f[_0x3571('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37881f[_0x3571('0x17')]?_0x37881f['options'][_0x3571('0x18')]||null:null,'attributes':_0x37881f[_0x3571('0x17')]?_0x37881f['options']['attributes']||null:null,'limit':_0x37881f['options']?_0x37881f[_0x3571('0x17')][_0x3571('0x19')]||null:null,'include':_0x37881f[_0x3571('0x17')]?_0x37881f[_0x3571('0x17')][_0x3571('0x1a')]?_['map'](_0x37881f[_0x3571('0x17')][_0x3571('0x1a')],function(_0x17492d){return{'model':db[_0x17492d[_0x3571('0x1b')]],'as':_0x17492d['as'],'attributes':_0x17492d[_0x3571('0x1c')],'include':_0x17492d['include']?_[_0x3571('0x1d')](_0x17492d[_0x3571('0x1a')],function(_0x5c830b){return{'model':db[_0x5c830b[_0x3571('0x1b')]],'as':_0x5c830b['as'],'attributes':_0x5c830b['attributes'],'include':_0x5c830b[_0x3571('0x1a')]?_[_0x3571('0x1d')](_0x5c830b[_0x3571('0x1a')],function(_0x2a06e4){return{'model':db[_0x2a06e4[_0x3571('0x1b')]],'as':_0x2a06e4['as'],'attributes':_0x2a06e4[_0x3571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3571('0xb')](function(_0x4cbaae){logger[_0x3571('0xc')](_0x3571('0x14'),_0x37881f);logger[_0x3571('0xd')]('GetZohoAccount',_0x37881f,JSON['stringify'](_0x4cbaae));_0x22a418(_0x4cbaae);})['catch'](function(_0xa6d91f){logger['error'](_0x3571('0x14'),_0xa6d91f[_0x3571('0x12')],_0x37881f);_0xab19b1(_0x4b745a[_0x3571('0x10')](0x1f4,_0xa6d91f['message']));});});};exports['ShowZohoAccount']=function(_0x7c1c2a){var _0x40eea0=this;return new Promise(function(_0x4cc26c,_0x37de61){return db['ZohoAccount'][_0x3571('0x1e')]({'raw':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x1f')]===undefined?!![]:![]:!![],'where':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x18')]||null:null,'attributes':_0x7c1c2a['options']?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x1c')]||null:null,'include':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')]['include']?_[_0x3571('0x1d')](_0x7c1c2a['options'][_0x3571('0x1a')],function(_0x16c5a0){return{'model':db[_0x16c5a0[_0x3571('0x1b')]],'as':_0x16c5a0['as'],'attributes':_0x16c5a0[_0x3571('0x1c')],'include':_0x16c5a0[_0x3571('0x1a')]?_['map'](_0x16c5a0['include'],function(_0x525842){return{'model':db[_0x525842['model']],'as':_0x525842['as'],'attributes':_0x525842[_0x3571('0x1c')],'include':_0x525842['include']?_[_0x3571('0x1d')](_0x525842[_0x3571('0x1a')],function(_0xa0d2d3){return{'model':db[_0xa0d2d3[_0x3571('0x1b')]],'as':_0xa0d2d3['as'],'attributes':_0xa0d2d3[_0x3571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3571('0xb')](function(_0x356eb1){logger['info'](_0x3571('0x20'),_0x7c1c2a);logger[_0x3571('0xd')](_0x3571('0x20'),_0x7c1c2a,JSON[_0x3571('0x21')](_0x356eb1));_0x4cc26c(_0x356eb1);})[_0x3571('0x22')](function(_0x59ecb4){logger[_0x3571('0x10')](_0x3571('0x20'),_0x59ecb4[_0x3571('0x12')],_0x7c1c2a);_0x37de61(_0x40eea0[_0x3571('0x10')](0x1f4,_0x59ecb4[_0x3571('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 025ebc9..94ac9ff 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 _0x8a87=['./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','create','put','update','delete','exports','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x8a87,0x176));var _0x78a8=function(_0x3f7855,_0x535342){_0x3f7855=_0x3f7855-0x0;var _0x301fb7=_0x8a87[_0x3f7855];return _0x301fb7;};'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[_0x78a8('0x0')]();var fs_extra=require(_0x78a8('0x1'));var auth=require(_0x78a8('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x78a8('0x3'));var controller=require(_0x78a8('0x4'));router[_0x78a8('0x5')]('/',auth[_0x78a8('0x6')](),controller[_0x78a8('0x7')]);router[_0x78a8('0x5')](_0x78a8('0x8'),auth[_0x78a8('0x6')](),controller[_0x78a8('0x9')]);router[_0x78a8('0x5')](_0x78a8('0xa'),auth[_0x78a8('0x6')](),controller[_0x78a8('0xb')]);router[_0x78a8('0x5')]('/:id/subjects',auth[_0x78a8('0x6')](),controller['getSubjects']);router[_0x78a8('0x5')](_0x78a8('0xc'),auth[_0x78a8('0x6')](),controller['getDescriptions']);router['post']('/',auth[_0x78a8('0x6')](),controller[_0x78a8('0xd')]);router[_0x78a8('0xe')](_0x78a8('0x8'),auth[_0x78a8('0x6')](),controller[_0x78a8('0xf')]);router[_0x78a8('0x10')](_0x78a8('0x8'),auth[_0x78a8('0x6')](),controller['destroy']);module[_0x78a8('0x11')]=router; \ No newline at end of file +var _0x9775=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x4075fb,_0x3f59e0){var _0x26ffed=function(_0x81ec8){while(--_0x81ec8){_0x4075fb['push'](_0x4075fb['shift']());}};_0x26ffed(++_0x3f59e0);}(_0x9775,0x17e));var _0x5977=function(_0x17d39e,_0x1e8c54){_0x17d39e=_0x17d39e-0x0;var _0x4592fa=_0x9775[_0x17d39e];return _0x4592fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5977('0x0'));var timeout=require(_0x5977('0x1'));var express=require(_0x5977('0x2'));var router=express[_0x5977('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5977('0x4'));var interaction=require(_0x5977('0x5'));var config=require(_0x5977('0x6'));var controller=require(_0x5977('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5977('0x8')]);router[_0x5977('0x9')](_0x5977('0xa'),auth[_0x5977('0xb')](),controller['show']);router[_0x5977('0x9')](_0x5977('0xc'),auth[_0x5977('0xb')](),controller[_0x5977('0xd')]);router[_0x5977('0x9')](_0x5977('0xe'),auth[_0x5977('0xb')](),controller['getSubjects']);router[_0x5977('0x9')](_0x5977('0xf'),auth[_0x5977('0xb')](),controller['getDescriptions']);router[_0x5977('0x10')]('/',auth[_0x5977('0xb')](),controller['create']);router['put'](_0x5977('0xa'),auth[_0x5977('0xb')](),controller[_0x5977('0x11')]);router[_0x5977('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5977('0x13')]);module[_0x5977('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1816793..98147cd 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 _0x65d3=['lead','contact_lead','exports','STRING','ENUM','contact'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x65d3,0x134));var _0x365d=function(_0x4b25f6,_0x22d2ac){_0x4b25f6=_0x4b25f6-0x0;var _0x4cb200=_0x65d3[_0x4b25f6];return _0x4cb200;};'use strict';var Sequelize=require('sequelize');module[_0x365d('0x0')]={'name':{'type':Sequelize[_0x365d('0x1')]},'moduleCreate':{'type':Sequelize[_0x365d('0x2')]('lead',_0x365d('0x3'),'nothing'),'defaultValue':_0x365d('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x365d('0x5'),_0x365d('0x3'),_0x365d('0x4')),'defaultValue':_0x365d('0x5')},'description':{'type':Sequelize[_0x365d('0x1')]}}; \ No newline at end of file +var _0x446e=['sequelize','exports','ENUM','lead','contact','nothing','contact_lead','STRING'];(function(_0x3d67eb,_0x2f578b){var _0x4354f9=function(_0xb5bc1d){while(--_0xb5bc1d){_0x3d67eb['push'](_0x3d67eb['shift']());}};_0x4354f9(++_0x2f578b);}(_0x446e,0x1f0));var _0xe446=function(_0x65ca3d,_0x500095){_0x65ca3d=_0x65ca3d-0x0;var _0x431b89=_0x446e[_0x65ca3d];return _0x431b89;};'use strict';var Sequelize=require(_0xe446('0x0'));module[_0xe446('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xe446('0x2')](_0xe446('0x3'),_0xe446('0x4'),_0xe446('0x5')),'defaultValue':_0xe446('0x3')},'moduleSearch':{'type':Sequelize[_0xe446('0x2')](_0xe446('0x6'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xe446('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 7cd37db..e88b9c0 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 _0xa8b9=['destroy','findOne','ZohoField','order','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','length','options','find','create','body'];(function(_0x3b8ed7,_0x47543e){var _0x3a3534=function(_0x4c2b39){while(--_0x4c2b39){_0x3b8ed7['push'](_0x3b8ed7['shift']());}};_0x3a3534(++_0x47543e);}(_0xa8b9,0xa9));var _0x9a8b=function(_0x41c624,_0x21e8be){_0x41c624=_0x41c624-0x0;var _0x586ec5=_0xa8b9[_0x41c624];return _0x586ec5;};'use strict';var emlformat=require(_0x9a8b('0x0'));var rimraf=require(_0x9a8b('0x1'));var zipdir=require(_0x9a8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a8b('0x3'));var moment=require(_0x9a8b('0x4'));var BPromise=require(_0x9a8b('0x5'));var Mustache=require(_0x9a8b('0x6'));var util=require(_0x9a8b('0x7'));var path=require(_0x9a8b('0x8'));var sox=require(_0x9a8b('0x9'));var csv=require(_0x9a8b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a8b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9a8b('0xc'));var deskjs=require(_0x9a8b('0xd'));var toCsv=require(_0x9a8b('0xa'));var querystring=require(_0x9a8b('0xe'));var Papa=require(_0x9a8b('0xf'));var Redis=require(_0x9a8b('0x10'));var authService=require(_0x9a8b('0x11'));var qs=require(_0x9a8b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a8b('0x13'));var logger=require(_0x9a8b('0x14'))(_0x9a8b('0x15'));var utils=require('../../config/utils');var config=require(_0x9a8b('0x16'));var licenseUtil=require(_0x9a8b('0x17'));var db=require(_0x9a8b('0x18'))['db'];function respondWithStatusCode(_0x47ec98,_0xe15d88){_0xe15d88=_0xe15d88||0xcc;return function(_0x4c56ef){if(_0x4c56ef){return _0x47ec98[_0x9a8b('0x19')](_0xe15d88);}return _0x47ec98[_0x9a8b('0x1a')](_0xe15d88)['end']();};}function respondWithResult(_0x4ca253,_0x5a047a){_0x5a047a=_0x5a047a||0xc8;return function(_0x8d1238){if(_0x8d1238){return _0x4ca253[_0x9a8b('0x1a')](_0x5a047a)['json'](_0x8d1238);}};}function respondWithFilteredResult(_0x4add87,_0x7d8b01){return function(_0x5c1b82){if(_0x5c1b82){var _0x4cfc9b=typeof _0x7d8b01[_0x9a8b('0x1b')]===_0x9a8b('0x1c')&&typeof _0x7d8b01[_0x9a8b('0x1d')]==='undefined';var _0x4560d7=_0x5c1b82[_0x9a8b('0x1e')];var _0x1b3823=_0x4cfc9b?0x0:_0x7d8b01[_0x9a8b('0x1b')];var _0x3a5046=_0x4cfc9b?_0x5c1b82[_0x9a8b('0x1e')]:_0x7d8b01[_0x9a8b('0x1b')]+_0x7d8b01['limit'];var _0x497ac2;if(_0x3a5046>=_0x4560d7){_0x3a5046=_0x4560d7;_0x497ac2=0xc8;}else{_0x497ac2=0xce;}_0x4add87[_0x9a8b('0x1a')](_0x497ac2);return _0x4add87[_0x9a8b('0x1f')](_0x9a8b('0x20'),_0x1b3823+'-'+_0x3a5046+'/'+_0x4560d7)[_0x9a8b('0x21')](_0x5c1b82);}return null;};}function patchUpdates(_0x2c3253){return function(_0x190142){try{jsonpatch[_0x9a8b('0x22')](_0x190142,_0x2c3253,!![]);}catch(_0x5a1b55){return BPromise[_0x9a8b('0x23')](_0x5a1b55);}return _0x190142[_0x9a8b('0x24')]();};}function saveUpdates(_0x82b93e,_0x98317d){return function(_0x820302){if(_0x820302){return _0x820302[_0x9a8b('0x25')](_0x82b93e)[_0x9a8b('0x26')](function(_0x2d5f28){return _0x2d5f28;});}return null;};}function removeEntity(_0x59db55,_0x5f57c5){return function(_0x22649a){if(_0x22649a){return _0x22649a['destroy']()[_0x9a8b('0x26')](function(){_0x59db55[_0x9a8b('0x1a')](0xcc)[_0x9a8b('0x27')]();});}};}function handleEntityNotFound(_0x26503e,_0x11cb46){return function(_0x47dd45){if(!_0x47dd45){_0x26503e[_0x9a8b('0x19')](0x194);}return _0x47dd45;};}function handleError(_0x1e6538,_0x5763c5){_0x5763c5=_0x5763c5||0x1f4;return function(_0x2e1798){logger['error'](_0x2e1798[_0x9a8b('0x28')]);if(_0x2e1798['name']){delete _0x2e1798[_0x9a8b('0x29')];}_0x1e6538[_0x9a8b('0x1a')](_0x5763c5)[_0x9a8b('0x2a')](_0x2e1798);};}exports[_0x9a8b('0x2b')]=function(_0x508cb3,_0x452b18){var _0x415f99={},_0x5cae88={},_0x363bf0={'count':0x0,'rows':[]};var _0x1b7645=_[_0x9a8b('0x2c')](db[_0x9a8b('0x2d')][_0x9a8b('0x2e')],function(_0x265253){return{'name':_0x265253[_0x9a8b('0x2f')],'type':_0x265253[_0x9a8b('0x30')][_0x9a8b('0x31')]};});_0x5cae88[_0x9a8b('0x32')]=_[_0x9a8b('0x2c')](_0x1b7645,_0x9a8b('0x29'));_0x5cae88[_0x9a8b('0x33')]=_[_0x9a8b('0x34')](_0x508cb3['query']);_0x5cae88[_0x9a8b('0x35')]=_[_0x9a8b('0x36')](_0x5cae88[_0x9a8b('0x32')],_0x5cae88[_0x9a8b('0x33')]);_0x415f99['attributes']=_[_0x9a8b('0x36')](_0x5cae88[_0x9a8b('0x32')],qs[_0x9a8b('0x37')](_0x508cb3[_0x9a8b('0x33')]['fields']));_0x415f99[_0x9a8b('0x38')]=_0x415f99[_0x9a8b('0x38')]['length']?_0x415f99[_0x9a8b('0x38')]:_0x5cae88[_0x9a8b('0x32')];if(!_0x508cb3[_0x9a8b('0x33')][_0x9a8b('0x39')]('nolimit')){_0x415f99['limit']=qs[_0x9a8b('0x1d')](_0x508cb3[_0x9a8b('0x33')][_0x9a8b('0x1d')]);_0x415f99[_0x9a8b('0x1b')]=qs[_0x9a8b('0x1b')](_0x508cb3['query'][_0x9a8b('0x1b')]);}_0x415f99['order']=qs[_0x9a8b('0x3a')](_0x508cb3[_0x9a8b('0x33')]['sort']);_0x415f99[_0x9a8b('0x3b')]=qs['filters'](_[_0x9a8b('0x3c')](_0x508cb3[_0x9a8b('0x33')],_0x5cae88[_0x9a8b('0x35')]),_0x1b7645);if(_0x508cb3[_0x9a8b('0x33')][_0x9a8b('0x3d')]){_0x415f99[_0x9a8b('0x3b')]=_[_0x9a8b('0x3e')](_0x415f99[_0x9a8b('0x3b')],{'$or':_[_0x9a8b('0x2c')](_0x1b7645,function(_0x59959b){if(_0x59959b[_0x9a8b('0x30')]!=='VIRTUAL'){var _0xefb813={};_0xefb813[_0x59959b[_0x9a8b('0x29')]]={'$like':'%'+_0x508cb3[_0x9a8b('0x33')][_0x9a8b('0x3d')]+'%'};return _0xefb813;}})});}_0x415f99=_[_0x9a8b('0x3e')]({},_0x415f99,_0x508cb3['options']);var _0x2d3158={'where':_0x415f99[_0x9a8b('0x3b')]};return db[_0x9a8b('0x2d')]['count'](_0x2d3158)['then'](function(_0x555d67){_0x363bf0[_0x9a8b('0x1e')]=_0x555d67;if(_0x508cb3[_0x9a8b('0x33')][_0x9a8b('0x3f')]){_0x415f99[_0x9a8b('0x40')]=[{'all':!![]}];}return db[_0x9a8b('0x2d')]['findAll'](_0x415f99);})['then'](function(_0x53e318){_0x363bf0[_0x9a8b('0x41')]=_0x53e318;return _0x363bf0;})[_0x9a8b('0x26')](respondWithFilteredResult(_0x452b18,_0x415f99))[_0x9a8b('0x42')](handleError(_0x452b18,null));};exports[_0x9a8b('0x43')]=function(_0x173d55,_0x239498){var _0x4d1e1a={'raw':![],'where':{'id':_0x173d55[_0x9a8b('0x44')]['id']}},_0x11f008={};_0x11f008[_0x9a8b('0x32')]=_[_0x9a8b('0x34')](db[_0x9a8b('0x2d')][_0x9a8b('0x2e')]);_0x11f008[_0x9a8b('0x33')]=_[_0x9a8b('0x34')](_0x173d55[_0x9a8b('0x33')]);_0x11f008[_0x9a8b('0x35')]=_[_0x9a8b('0x36')](_0x11f008['model'],_0x11f008[_0x9a8b('0x33')]);_0x4d1e1a[_0x9a8b('0x38')]=_[_0x9a8b('0x36')](_0x11f008[_0x9a8b('0x32')],qs['fields'](_0x173d55[_0x9a8b('0x33')]['fields']));_0x4d1e1a['attributes']=_0x4d1e1a[_0x9a8b('0x38')][_0x9a8b('0x45')]?_0x4d1e1a['attributes']:_0x11f008[_0x9a8b('0x32')];if(_0x173d55[_0x9a8b('0x33')][_0x9a8b('0x3f')]){_0x4d1e1a['include']=[{'all':!![]}];}_0x4d1e1a=_[_0x9a8b('0x3e')]({},_0x4d1e1a,_0x173d55[_0x9a8b('0x46')]);return db['ZohoConfiguration'][_0x9a8b('0x47')](_0x4d1e1a)['then'](handleEntityNotFound(_0x239498,null))[_0x9a8b('0x26')](respondWithResult(_0x239498,null))[_0x9a8b('0x42')](handleError(_0x239498,null));};exports[_0x9a8b('0x48')]=function(_0x598226,_0x21710c){return db['ZohoConfiguration'][_0x9a8b('0x48')](_0x598226[_0x9a8b('0x49')],{})[_0x9a8b('0x26')](respondWithResult(_0x21710c,0xc9))[_0x9a8b('0x42')](handleError(_0x21710c,null));};exports[_0x9a8b('0x25')]=function(_0x4a035c,_0x2813a9){if(_0x4a035c[_0x9a8b('0x49')]['id']){delete _0x4a035c[_0x9a8b('0x49')]['id'];}return db[_0x9a8b('0x2d')]['find']({'where':{'id':_0x4a035c[_0x9a8b('0x44')]['id']}})[_0x9a8b('0x26')](handleEntityNotFound(_0x2813a9,null))['then'](saveUpdates(_0x4a035c[_0x9a8b('0x49')],null))[_0x9a8b('0x26')](respondWithResult(_0x2813a9,null))[_0x9a8b('0x42')](handleError(_0x2813a9,null));};exports[_0x9a8b('0x4a')]=function(_0x388f8c,_0x390491){return db['ZohoConfiguration'][_0x9a8b('0x47')]({'where':{'id':_0x388f8c[_0x9a8b('0x44')]['id']}})[_0x9a8b('0x26')](handleEntityNotFound(_0x390491,null))[_0x9a8b('0x26')](removeEntity(_0x390491,null))[_0x9a8b('0x42')](handleError(_0x390491,null));};exports['getFields']=function(_0x31f404,_0x57bd3f,_0x5e5b84){var _0x5308e1={};var _0x293827={};var _0x51bbf8;var _0x52ddcf;return db[_0x9a8b('0x2d')][_0x9a8b('0x4b')]({'where':{'id':_0x31f404[_0x9a8b('0x44')]['id']}})[_0x9a8b('0x26')](handleEntityNotFound(_0x57bd3f,null))['then'](function(_0x119cb7){if(_0x119cb7){_0x51bbf8=_0x119cb7;_0x293827[_0x9a8b('0x32')]=_[_0x9a8b('0x34')](db[_0x9a8b('0x4c')][_0x9a8b('0x2e')]);_0x293827[_0x9a8b('0x33')]=_[_0x9a8b('0x34')](_0x31f404[_0x9a8b('0x33')]);_0x293827[_0x9a8b('0x35')]=_[_0x9a8b('0x36')](_0x293827[_0x9a8b('0x32')],_0x293827[_0x9a8b('0x33')]);_0x5308e1[_0x9a8b('0x38')]=_['intersection'](_0x293827['model'],qs[_0x9a8b('0x37')](_0x31f404['query'][_0x9a8b('0x37')]));_0x5308e1[_0x9a8b('0x38')]=_0x5308e1['attributes'][_0x9a8b('0x45')]?_0x5308e1[_0x9a8b('0x38')]:_0x293827[_0x9a8b('0x32')];_0x5308e1[_0x9a8b('0x4d')]=qs[_0x9a8b('0x3a')](_0x31f404[_0x9a8b('0x33')][_0x9a8b('0x3a')]);_0x5308e1[_0x9a8b('0x3b')]=qs[_0x9a8b('0x35')](_[_0x9a8b('0x3c')](_0x31f404[_0x9a8b('0x33')],_0x293827[_0x9a8b('0x35')]));if(_0x31f404[_0x9a8b('0x33')][_0x9a8b('0x3d')]){_0x5308e1[_0x9a8b('0x3b')]=_[_0x9a8b('0x3e')](_0x5308e1[_0x9a8b('0x3b')],{'$or':_[_0x9a8b('0x2c')](_0x5308e1[_0x9a8b('0x38')],function(_0x202536){var _0x4cb906={};_0x4cb906[_0x202536]={'$like':'%'+_0x31f404['query'][_0x9a8b('0x3d')]+'%'};return _0x4cb906;})});}_0x5308e1=_[_0x9a8b('0x3e')]({},_0x5308e1,_0x31f404['options']);return _0x51bbf8['getFields'](_0x5308e1);}})[_0x9a8b('0x26')](function(_0x346ae8){if(_0x346ae8){_0x52ddcf=_0x346ae8[_0x9a8b('0x45')];if(!_0x31f404[_0x9a8b('0x33')][_0x9a8b('0x39')](_0x9a8b('0x4e'))){_0x5308e1[_0x9a8b('0x1d')]=qs[_0x9a8b('0x1d')](_0x31f404[_0x9a8b('0x33')][_0x9a8b('0x1d')]);_0x5308e1['offset']=qs[_0x9a8b('0x1b')](_0x31f404['query'][_0x9a8b('0x1b')]);}return _0x51bbf8['getFields'](_0x5308e1);}})['then'](function(_0x54f48c){if(_0x54f48c){return _0x54f48c?{'count':_0x52ddcf,'rows':_0x54f48c}:null;}})[_0x9a8b('0x26')](respondWithResult(_0x57bd3f,null))[_0x9a8b('0x42')](handleError(_0x57bd3f,null));};exports[_0x9a8b('0x4f')]=function(_0x190d2e,_0x57676a,_0x1777c7){var _0x2b4bad={};var _0x2a5588={};var _0x322caa;var _0x20c53e;return db[_0x9a8b('0x2d')][_0x9a8b('0x4b')]({'where':{'id':_0x190d2e[_0x9a8b('0x44')]['id']}})['then'](handleEntityNotFound(_0x57676a,null))[_0x9a8b('0x26')](function(_0x2fc173){if(_0x2fc173){_0x322caa=_0x2fc173;_0x2a5588[_0x9a8b('0x32')]=_[_0x9a8b('0x34')](db[_0x9a8b('0x4c')][_0x9a8b('0x2e')]);_0x2a5588['query']=_[_0x9a8b('0x34')](_0x190d2e[_0x9a8b('0x33')]);_0x2a5588['filters']=_[_0x9a8b('0x36')](_0x2a5588[_0x9a8b('0x32')],_0x2a5588[_0x9a8b('0x33')]);_0x2b4bad['attributes']=_[_0x9a8b('0x36')](_0x2a5588[_0x9a8b('0x32')],qs[_0x9a8b('0x37')](_0x190d2e['query'][_0x9a8b('0x37')]));_0x2b4bad['attributes']=_0x2b4bad[_0x9a8b('0x38')][_0x9a8b('0x45')]?_0x2b4bad['attributes']:_0x2a5588[_0x9a8b('0x32')];_0x2b4bad[_0x9a8b('0x4d')]=qs[_0x9a8b('0x3a')](_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x3a')]);_0x2b4bad[_0x9a8b('0x3b')]=qs['filters'](_[_0x9a8b('0x3c')](_0x190d2e['query'],_0x2a5588['filters']));if(_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x3d')]){_0x2b4bad[_0x9a8b('0x3b')]=_[_0x9a8b('0x3e')](_0x2b4bad[_0x9a8b('0x3b')],{'$or':_[_0x9a8b('0x2c')](_0x2b4bad[_0x9a8b('0x38')],function(_0x5d324b){var _0x4ae66a={};_0x4ae66a[_0x5d324b]={'$like':'%'+_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x3d')]+'%'};return _0x4ae66a;})});}_0x2b4bad=_[_0x9a8b('0x3e')]({},_0x2b4bad,_0x190d2e[_0x9a8b('0x46')]);return _0x322caa[_0x9a8b('0x4f')](_0x2b4bad);}})[_0x9a8b('0x26')](function(_0x2cd7ef){if(_0x2cd7ef){_0x20c53e=_0x2cd7ef[_0x9a8b('0x45')];if(!_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x39')](_0x9a8b('0x4e'))){_0x2b4bad['limit']=qs[_0x9a8b('0x1d')](_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x1d')]);_0x2b4bad['offset']=qs[_0x9a8b('0x1b')](_0x190d2e[_0x9a8b('0x33')][_0x9a8b('0x1b')]);}return _0x322caa[_0x9a8b('0x4f')](_0x2b4bad);}})[_0x9a8b('0x26')](function(_0x18a98c){if(_0x18a98c){return _0x18a98c?{'count':_0x20c53e,'rows':_0x18a98c}:null;}})['then'](respondWithResult(_0x57676a,null))[_0x9a8b('0x42')](handleError(_0x57676a,null));};exports[_0x9a8b('0x50')]=function(_0x4403f4,_0x2ad97d,_0x1a8920){var _0x20360f={};var _0x20aa7e={};var _0x4c81b8;var _0x2d88fb;return db[_0x9a8b('0x2d')][_0x9a8b('0x4b')]({'where':{'id':_0x4403f4[_0x9a8b('0x44')]['id']}})[_0x9a8b('0x26')](handleEntityNotFound(_0x2ad97d,null))[_0x9a8b('0x26')](function(_0x32f5c8){if(_0x32f5c8){_0x4c81b8=_0x32f5c8;_0x20aa7e['model']=_[_0x9a8b('0x34')](db[_0x9a8b('0x4c')]['rawAttributes']);_0x20aa7e['query']=_[_0x9a8b('0x34')](_0x4403f4[_0x9a8b('0x33')]);_0x20aa7e[_0x9a8b('0x35')]=_[_0x9a8b('0x36')](_0x20aa7e[_0x9a8b('0x32')],_0x20aa7e[_0x9a8b('0x33')]);_0x20360f[_0x9a8b('0x38')]=_[_0x9a8b('0x36')](_0x20aa7e[_0x9a8b('0x32')],qs['fields'](_0x4403f4[_0x9a8b('0x33')][_0x9a8b('0x37')]));_0x20360f[_0x9a8b('0x38')]=_0x20360f['attributes']['length']?_0x20360f[_0x9a8b('0x38')]:_0x20aa7e[_0x9a8b('0x32')];_0x20360f[_0x9a8b('0x4d')]=qs[_0x9a8b('0x3a')](_0x4403f4[_0x9a8b('0x33')][_0x9a8b('0x3a')]);_0x20360f[_0x9a8b('0x3b')]=qs[_0x9a8b('0x35')](_[_0x9a8b('0x3c')](_0x4403f4[_0x9a8b('0x33')],_0x20aa7e[_0x9a8b('0x35')]));if(_0x4403f4[_0x9a8b('0x33')]['filter']){_0x20360f['where']=_[_0x9a8b('0x3e')](_0x20360f[_0x9a8b('0x3b')],{'$or':_[_0x9a8b('0x2c')](_0x20360f[_0x9a8b('0x38')],function(_0x16e61a){var _0x4ef5ff={};_0x4ef5ff[_0x16e61a]={'$like':'%'+_0x4403f4[_0x9a8b('0x33')][_0x9a8b('0x3d')]+'%'};return _0x4ef5ff;})});}_0x20360f=_[_0x9a8b('0x3e')]({},_0x20360f,_0x4403f4[_0x9a8b('0x46')]);return _0x4c81b8[_0x9a8b('0x50')](_0x20360f);}})[_0x9a8b('0x26')](function(_0x295865){if(_0x295865){_0x2d88fb=_0x295865[_0x9a8b('0x45')];if(!_0x4403f4['query']['hasOwnProperty'](_0x9a8b('0x4e'))){_0x20360f[_0x9a8b('0x1d')]=qs['limit'](_0x4403f4['query'][_0x9a8b('0x1d')]);_0x20360f[_0x9a8b('0x1b')]=qs[_0x9a8b('0x1b')](_0x4403f4[_0x9a8b('0x33')][_0x9a8b('0x1b')]);}return _0x4c81b8[_0x9a8b('0x50')](_0x20360f);}})[_0x9a8b('0x26')](function(_0x181cc4){if(_0x181cc4){return _0x181cc4?{'count':_0x2d88fb,'rows':_0x181cc4}:null;}})['then'](respondWithResult(_0x2ad97d,null))[_0x9a8b('0x42')](handleError(_0x2ad97d,null));}; \ No newline at end of file +var _0x9737=['sendStatus','status','offset','undefined','limit','count','set','json','apply','update','destroy','then','end','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getFields','findOne','ZohoField','getSubjects','options','getDescriptions','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xf65a8e,_0x228b00){var _0x37eb5=function(_0x90b233){while(--_0x90b233){_0xf65a8e['push'](_0xf65a8e['shift']());}};_0x37eb5(++_0x228b00);}(_0x9737,0x123));var _0x7973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9737[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7973('0x0'));var zipdir=require(_0x7973('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7973('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7973('0x3'));var util=require(_0x7973('0x4'));var path=require(_0x7973('0x5'));var sox=require(_0x7973('0x6'));var csv=require(_0x7973('0x7'));var ejs=require(_0x7973('0x8'));var fs=require('fs');var fs_extra=require(_0x7973('0x9'));var _=require(_0x7973('0xa'));var squel=require(_0x7973('0xb'));var crypto=require('crypto');var jsforce=require(_0x7973('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7973('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7973('0xd'));var qs=require(_0x7973('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7973('0xf'))(_0x7973('0x10'));var utils=require(_0x7973('0x11'));var config=require(_0x7973('0x12'));var licenseUtil=require(_0x7973('0x13'));var db=require(_0x7973('0x14'))['db'];function respondWithStatusCode(_0xee212b,_0x5493ee){_0x5493ee=_0x5493ee||0xcc;return function(_0x2c8b9f){if(_0x2c8b9f){return _0xee212b[_0x7973('0x15')](_0x5493ee);}return _0xee212b['status'](_0x5493ee)['end']();};}function respondWithResult(_0x500cc9,_0x2ab2a1){_0x2ab2a1=_0x2ab2a1||0xc8;return function(_0xcef0fa){if(_0xcef0fa){return _0x500cc9[_0x7973('0x16')](_0x2ab2a1)['json'](_0xcef0fa);}};}function respondWithFilteredResult(_0x584fa2,_0x24fe65){return function(_0x4286cf){if(_0x4286cf){var _0x2b1ea=typeof _0x24fe65[_0x7973('0x17')]===_0x7973('0x18')&&typeof _0x24fe65[_0x7973('0x19')]===_0x7973('0x18');var _0x2133f7=_0x4286cf[_0x7973('0x1a')];var _0x16ff92=_0x2b1ea?0x0:_0x24fe65[_0x7973('0x17')];var _0x234067=_0x2b1ea?_0x4286cf[_0x7973('0x1a')]:_0x24fe65['offset']+_0x24fe65['limit'];var _0x13ddf9;if(_0x234067>=_0x2133f7){_0x234067=_0x2133f7;_0x13ddf9=0xc8;}else{_0x13ddf9=0xce;}_0x584fa2[_0x7973('0x16')](_0x13ddf9);return _0x584fa2[_0x7973('0x1b')]('Content-Range',_0x16ff92+'-'+_0x234067+'/'+_0x2133f7)[_0x7973('0x1c')](_0x4286cf);}return null;};}function patchUpdates(_0x1b5be9){return function(_0x1d7cc2){try{jsonpatch[_0x7973('0x1d')](_0x1d7cc2,_0x1b5be9,!![]);}catch(_0x2af6ae){return BPromise['reject'](_0x2af6ae);}return _0x1d7cc2['save']();};}function saveUpdates(_0x4d80cb,_0xd79dfa){return function(_0xa2b51b){if(_0xa2b51b){return _0xa2b51b[_0x7973('0x1e')](_0x4d80cb)['then'](function(_0x17ec4c){return _0x17ec4c;});}return null;};}function removeEntity(_0x1e0148,_0x194124){return function(_0x3226f4){if(_0x3226f4){return _0x3226f4[_0x7973('0x1f')]()[_0x7973('0x20')](function(){_0x1e0148['status'](0xcc)[_0x7973('0x21')]();});}};}function handleEntityNotFound(_0x2c644a,_0xf85799){return function(_0x548091){if(!_0x548091){_0x2c644a['sendStatus'](0x194);}return _0x548091;};}function handleError(_0xeebcc4,_0x294880){_0x294880=_0x294880||0x1f4;return function(_0x5dadd1){logger[_0x7973('0x22')](_0x5dadd1[_0x7973('0x23')]);if(_0x5dadd1['name']){delete _0x5dadd1[_0x7973('0x24')];}_0xeebcc4[_0x7973('0x16')](_0x294880)[_0x7973('0x25')](_0x5dadd1);};}exports[_0x7973('0x26')]=function(_0x1f7635,_0x399c3e){var _0x2f1011={},_0x1026d6={},_0x5a22e6={'count':0x0,'rows':[]};var _0x5872c7=_['map'](db[_0x7973('0x27')][_0x7973('0x28')],function(_0x57b310){return{'name':_0x57b310[_0x7973('0x29')],'type':_0x57b310[_0x7973('0x2a')][_0x7973('0x2b')]};});_0x1026d6[_0x7973('0x2c')]=_[_0x7973('0x2d')](_0x5872c7,'name');_0x1026d6[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x1f7635['query']);_0x1026d6[_0x7973('0x30')]=_[_0x7973('0x31')](_0x1026d6[_0x7973('0x2c')],_0x1026d6[_0x7973('0x2e')]);_0x2f1011['attributes']=_['intersection'](_0x1026d6[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x1f7635[_0x7973('0x2e')][_0x7973('0x32')]));_0x2f1011[_0x7973('0x33')]=_0x2f1011['attributes'][_0x7973('0x34')]?_0x2f1011[_0x7973('0x33')]:_0x1026d6[_0x7973('0x2c')];if(!_0x1f7635['query'][_0x7973('0x35')](_0x7973('0x36'))){_0x2f1011[_0x7973('0x19')]=qs[_0x7973('0x19')](_0x1f7635[_0x7973('0x2e')][_0x7973('0x19')]);_0x2f1011['offset']=qs[_0x7973('0x17')](_0x1f7635['query']['offset']);}_0x2f1011[_0x7973('0x37')]=qs['sort'](_0x1f7635[_0x7973('0x2e')][_0x7973('0x38')]);_0x2f1011[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x1f7635[_0x7973('0x2e')],_0x1026d6[_0x7973('0x30')]),_0x5872c7);if(_0x1f7635['query'][_0x7973('0x3b')]){_0x2f1011[_0x7973('0x39')]=_['merge'](_0x2f1011['where'],{'$or':_[_0x7973('0x2d')](_0x5872c7,function(_0x687625){if(_0x687625['type']!==_0x7973('0x3c')){var _0xcd00e6={};_0xcd00e6[_0x687625[_0x7973('0x24')]]={'$like':'%'+_0x1f7635[_0x7973('0x2e')][_0x7973('0x3b')]+'%'};return _0xcd00e6;}})});}_0x2f1011=_['merge']({},_0x2f1011,_0x1f7635['options']);var _0x28fcf4={'where':_0x2f1011[_0x7973('0x39')]};return db[_0x7973('0x27')]['count'](_0x28fcf4)['then'](function(_0x28a014){_0x5a22e6[_0x7973('0x1a')]=_0x28a014;if(_0x1f7635['query'][_0x7973('0x3d')]){_0x2f1011[_0x7973('0x3e')]=[{'all':!![]}];}return db[_0x7973('0x27')][_0x7973('0x3f')](_0x2f1011);})[_0x7973('0x20')](function(_0x55ac69){_0x5a22e6[_0x7973('0x40')]=_0x55ac69;return _0x5a22e6;})[_0x7973('0x20')](respondWithFilteredResult(_0x399c3e,_0x2f1011))[_0x7973('0x41')](handleError(_0x399c3e,null));};exports[_0x7973('0x42')]=function(_0x2898f3,_0x4935b0){var _0x176bdf={'raw':![],'where':{'id':_0x2898f3[_0x7973('0x43')]['id']}},_0x3ad3b9={};_0x3ad3b9['model']=_[_0x7973('0x2f')](db[_0x7973('0x27')][_0x7973('0x28')]);_0x3ad3b9[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x2898f3[_0x7973('0x2e')]);_0x3ad3b9[_0x7973('0x30')]=_[_0x7973('0x31')](_0x3ad3b9[_0x7973('0x2c')],_0x3ad3b9[_0x7973('0x2e')]);_0x176bdf['attributes']=_[_0x7973('0x31')](_0x3ad3b9['model'],qs[_0x7973('0x32')](_0x2898f3[_0x7973('0x2e')][_0x7973('0x32')]));_0x176bdf['attributes']=_0x176bdf[_0x7973('0x33')][_0x7973('0x34')]?_0x176bdf[_0x7973('0x33')]:_0x3ad3b9['model'];if(_0x2898f3[_0x7973('0x2e')][_0x7973('0x3d')]){_0x176bdf[_0x7973('0x3e')]=[{'all':!![]}];}_0x176bdf=_[_0x7973('0x44')]({},_0x176bdf,_0x2898f3['options']);return db[_0x7973('0x27')][_0x7973('0x45')](_0x176bdf)[_0x7973('0x20')](handleEntityNotFound(_0x4935b0,null))[_0x7973('0x20')](respondWithResult(_0x4935b0,null))[_0x7973('0x41')](handleError(_0x4935b0,null));};exports[_0x7973('0x46')]=function(_0x4af8db,_0x2655b2){return db[_0x7973('0x27')][_0x7973('0x46')](_0x4af8db[_0x7973('0x47')],{})[_0x7973('0x20')](respondWithResult(_0x2655b2,0xc9))['catch'](handleError(_0x2655b2,null));};exports['update']=function(_0x35d310,_0x5bfd44){if(_0x35d310[_0x7973('0x47')]['id']){delete _0x35d310['body']['id'];}return db[_0x7973('0x27')][_0x7973('0x45')]({'where':{'id':_0x35d310['params']['id']}})['then'](handleEntityNotFound(_0x5bfd44,null))[_0x7973('0x20')](saveUpdates(_0x35d310[_0x7973('0x47')],null))[_0x7973('0x20')](respondWithResult(_0x5bfd44,null))[_0x7973('0x41')](handleError(_0x5bfd44,null));};exports[_0x7973('0x1f')]=function(_0x19648b,_0x157180){return db[_0x7973('0x27')]['find']({'where':{'id':_0x19648b[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x157180,null))[_0x7973('0x20')](removeEntity(_0x157180,null))[_0x7973('0x41')](handleError(_0x157180,null));};exports[_0x7973('0x48')]=function(_0x573d96,_0x268f12,_0x26c37c){var _0x1ac495={};var _0x320be2={};var _0x35610e;var _0x42226e;return db[_0x7973('0x27')][_0x7973('0x49')]({'where':{'id':_0x573d96[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x268f12,null))['then'](function(_0x1fc193){if(_0x1fc193){_0x35610e=_0x1fc193;_0x320be2[_0x7973('0x2c')]=_[_0x7973('0x2f')](db[_0x7973('0x4a')][_0x7973('0x28')]);_0x320be2[_0x7973('0x2e')]=_['keys'](_0x573d96[_0x7973('0x2e')]);_0x320be2[_0x7973('0x30')]=_[_0x7973('0x31')](_0x320be2[_0x7973('0x2c')],_0x320be2[_0x7973('0x2e')]);_0x1ac495['attributes']=_[_0x7973('0x31')](_0x320be2[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x573d96['query'][_0x7973('0x32')]));_0x1ac495[_0x7973('0x33')]=_0x1ac495[_0x7973('0x33')][_0x7973('0x34')]?_0x1ac495['attributes']:_0x320be2[_0x7973('0x2c')];_0x1ac495[_0x7973('0x37')]=qs['sort'](_0x573d96[_0x7973('0x2e')]['sort']);_0x1ac495[_0x7973('0x39')]=qs[_0x7973('0x30')](_['pick'](_0x573d96['query'],_0x320be2[_0x7973('0x30')]));if(_0x573d96[_0x7973('0x2e')]['filter']){_0x1ac495[_0x7973('0x39')]=_['merge'](_0x1ac495[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x1ac495['attributes'],function(_0x2d516d){var _0x4cea8c={};_0x4cea8c[_0x2d516d]={'$like':'%'+_0x573d96['query'][_0x7973('0x3b')]+'%'};return _0x4cea8c;})});}_0x1ac495=_[_0x7973('0x44')]({},_0x1ac495,_0x573d96['options']);return _0x35610e['getFields'](_0x1ac495);}})[_0x7973('0x20')](function(_0x289759){if(_0x289759){_0x42226e=_0x289759[_0x7973('0x34')];if(!_0x573d96[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x1ac495['limit']=qs[_0x7973('0x19')](_0x573d96[_0x7973('0x2e')][_0x7973('0x19')]);_0x1ac495[_0x7973('0x17')]=qs[_0x7973('0x17')](_0x573d96[_0x7973('0x2e')][_0x7973('0x17')]);}return _0x35610e[_0x7973('0x48')](_0x1ac495);}})[_0x7973('0x20')](function(_0x4585dd){if(_0x4585dd){return _0x4585dd?{'count':_0x42226e,'rows':_0x4585dd}:null;}})[_0x7973('0x20')](respondWithResult(_0x268f12,null))['catch'](handleError(_0x268f12,null));};exports[_0x7973('0x4b')]=function(_0x449f41,_0xb3581b,_0x58e8a6){var _0x32d1b3={};var _0x3d6dfd={};var _0x2b3f36;var _0x5e8f3b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x449f41[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0xb3581b,null))['then'](function(_0x2220a5){if(_0x2220a5){_0x2b3f36=_0x2220a5;_0x3d6dfd['model']=_[_0x7973('0x2f')](db['ZohoField']['rawAttributes']);_0x3d6dfd[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x449f41[_0x7973('0x2e')]);_0x3d6dfd[_0x7973('0x30')]=_['intersection'](_0x3d6dfd[_0x7973('0x2c')],_0x3d6dfd['query']);_0x32d1b3[_0x7973('0x33')]=_[_0x7973('0x31')](_0x3d6dfd[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x449f41[_0x7973('0x2e')]['fields']));_0x32d1b3[_0x7973('0x33')]=_0x32d1b3['attributes']['length']?_0x32d1b3[_0x7973('0x33')]:_0x3d6dfd[_0x7973('0x2c')];_0x32d1b3[_0x7973('0x37')]=qs[_0x7973('0x38')](_0x449f41[_0x7973('0x2e')][_0x7973('0x38')]);_0x32d1b3[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x449f41['query'],_0x3d6dfd['filters']));if(_0x449f41[_0x7973('0x2e')][_0x7973('0x3b')]){_0x32d1b3[_0x7973('0x39')]=_[_0x7973('0x44')](_0x32d1b3[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x32d1b3['attributes'],function(_0x393de8){var _0x4481fb={};_0x4481fb[_0x393de8]={'$like':'%'+_0x449f41['query'][_0x7973('0x3b')]+'%'};return _0x4481fb;})});}_0x32d1b3=_['merge']({},_0x32d1b3,_0x449f41[_0x7973('0x4c')]);return _0x2b3f36[_0x7973('0x4b')](_0x32d1b3);}})[_0x7973('0x20')](function(_0x10b3c0){if(_0x10b3c0){_0x5e8f3b=_0x10b3c0[_0x7973('0x34')];if(!_0x449f41[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x32d1b3[_0x7973('0x19')]=qs[_0x7973('0x19')](_0x449f41[_0x7973('0x2e')][_0x7973('0x19')]);_0x32d1b3[_0x7973('0x17')]=qs[_0x7973('0x17')](_0x449f41[_0x7973('0x2e')]['offset']);}return _0x2b3f36['getSubjects'](_0x32d1b3);}})[_0x7973('0x20')](function(_0x262956){if(_0x262956){return _0x262956?{'count':_0x5e8f3b,'rows':_0x262956}:null;}})[_0x7973('0x20')](respondWithResult(_0xb3581b,null))[_0x7973('0x41')](handleError(_0xb3581b,null));};exports['getDescriptions']=function(_0x4760f6,_0x5c2da8,_0x587180){var _0x29a92f={};var _0x5eff3f={};var _0x142179;var _0x5df11e;return db[_0x7973('0x27')][_0x7973('0x49')]({'where':{'id':_0x4760f6[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x5c2da8,null))[_0x7973('0x20')](function(_0x8a7c13){if(_0x8a7c13){_0x142179=_0x8a7c13;_0x5eff3f[_0x7973('0x2c')]=_[_0x7973('0x2f')](db[_0x7973('0x4a')]['rawAttributes']);_0x5eff3f[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x4760f6[_0x7973('0x2e')]);_0x5eff3f['filters']=_[_0x7973('0x31')](_0x5eff3f[_0x7973('0x2c')],_0x5eff3f[_0x7973('0x2e')]);_0x29a92f['attributes']=_['intersection'](_0x5eff3f[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x4760f6[_0x7973('0x2e')][_0x7973('0x32')]));_0x29a92f['attributes']=_0x29a92f[_0x7973('0x33')][_0x7973('0x34')]?_0x29a92f['attributes']:_0x5eff3f[_0x7973('0x2c')];_0x29a92f['order']=qs['sort'](_0x4760f6[_0x7973('0x2e')][_0x7973('0x38')]);_0x29a92f[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x4760f6[_0x7973('0x2e')],_0x5eff3f['filters']));if(_0x4760f6[_0x7973('0x2e')][_0x7973('0x3b')]){_0x29a92f[_0x7973('0x39')]=_['merge'](_0x29a92f[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x29a92f[_0x7973('0x33')],function(_0x12f9cc){var _0x37504c={};_0x37504c[_0x12f9cc]={'$like':'%'+_0x4760f6[_0x7973('0x2e')]['filter']+'%'};return _0x37504c;})});}_0x29a92f=_['merge']({},_0x29a92f,_0x4760f6['options']);return _0x142179['getDescriptions'](_0x29a92f);}})[_0x7973('0x20')](function(_0x542f48){if(_0x542f48){_0x5df11e=_0x542f48[_0x7973('0x34')];if(!_0x4760f6[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x29a92f[_0x7973('0x19')]=qs['limit'](_0x4760f6[_0x7973('0x2e')][_0x7973('0x19')]);_0x29a92f['offset']=qs['offset'](_0x4760f6['query']['offset']);}return _0x142179[_0x7973('0x4d')](_0x29a92f);}})['then'](function(_0x1b9b88){if(_0x1b9b88){return _0x1b9b88?{'count':_0x5df11e,'rows':_0x1b9b88}:null;}})[_0x7973('0x20')](respondWithResult(_0x5c2da8,null))[_0x7973('0x41')](handleError(_0x5c2da8,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b66ea07..d17b666 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 _0x14e1=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14e1,0xdd));var _0x114e=function(_0x44b98c,_0x2959eb){_0x44b98c=_0x44b98c-0x0;var _0x234181=_0x14e1[_0x44b98c];return _0x234181;};'use strict';var _=require(_0x114e('0x0'));var util=require(_0x114e('0x1'));var logger=require(_0x114e('0x2'))(_0x114e('0x3'));var moment=require(_0x114e('0x4'));var BPromise=require('bluebird');var rp=require(_0x114e('0x5'));var fs=require('fs');var path=require(_0x114e('0x6'));var rimraf=require(_0x114e('0x7'));var config=require(_0x114e('0x8'));var attributes=require(_0x114e('0x9'));module[_0x114e('0xa')]=function(_0x1e31da,_0x57899f){return _0x1e31da[_0x114e('0xb')](_0x114e('0xc'),attributes,{'tableName':_0x114e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe20=['define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x3e0e6c,_0x4757cd){var _0xad2be9=function(_0x366658){while(--_0x366658){_0x3e0e6c['push'](_0x3e0e6c['shift']());}};_0xad2be9(++_0x4757cd);}(_0xfe20,0xdf));var _0x0fe2=function(_0x486524,_0x3c066b){_0x486524=_0x486524-0x0;var _0x3ed508=_0xfe20[_0x486524];return _0x3ed508;};'use strict';var _=require('lodash');var util=require(_0x0fe2('0x0'));var logger=require(_0x0fe2('0x1'))(_0x0fe2('0x2'));var moment=require(_0x0fe2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fe2('0x4'));var config=require(_0x0fe2('0x5'));var attributes=require(_0x0fe2('0x6'));module[_0x0fe2('0x7')]=function(_0x1b58c,_0x2e24cf){return _0x1b58c[_0x0fe2('0x8')](_0x0fe2('0x9'),attributes,{'tableName':_0x0fe2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 03c2006..f610abd 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 _0x1c9a=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x517be0,_0x254861){var _0x4e427a=function(_0x4f91d6){while(--_0x4f91d6){_0x517be0['push'](_0x517be0['shift']());}};_0x4e427a(++_0x254861);}(_0x1c9a,0x19e));var _0xa1c9=function(_0x5a47f7,_0x11bb9f){_0x5a47f7=_0x5a47f7-0x0;var _0x3d8585=_0x1c9a[_0x5a47f7];return _0x3d8585;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa1c9('0x1'));var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require(_0xa1c9('0x5'));var logger=require(_0xa1c9('0x6'))(_0xa1c9('0x7'));var config=require(_0xa1c9('0x8'));var jayson=require(_0xa1c9('0x9'));var client=jayson[_0xa1c9('0xa')][_0xa1c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x558d2a,_0x590825,_0x45de20){return new BPromise(function(_0x5740bd,_0x35aacc){return client[_0xa1c9('0xc')](_0x558d2a,_0x45de20)[_0xa1c9('0xd')](function(_0x3c945d){logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x590825,_0xa1c9('0x10'));logger[_0xa1c9('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x590825,_0xa1c9('0x10'),JSON[_0xa1c9('0x12')](_0x3c945d));if(_0x3c945d['error']){if(_0x3c945d[_0xa1c9('0x13')][_0xa1c9('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x590825,_0x3c945d['error']['message']);return _0x35aacc(_0x3c945d[_0xa1c9('0x13')][_0xa1c9('0x15')]);}logger[_0xa1c9('0x13')](_0xa1c9('0xf'),_0x590825,_0x3c945d[_0xa1c9('0x13')][_0xa1c9('0x15')]);return _0x5740bd(_0x3c945d[_0xa1c9('0x13')][_0xa1c9('0x15')]);}else{logger[_0xa1c9('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x590825,_0xa1c9('0x10'));_0x5740bd(_0x3c945d['result'][_0xa1c9('0x15')]);}})[_0xa1c9('0x16')](function(_0x5b6fd3){logger['error'](_0xa1c9('0xf'),_0x590825,_0x5b6fd3);_0x35aacc(_0x5b6fd3);});});} \ No newline at end of file +var _0xe949=['../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe949,0x117));var _0x9e94=function(_0x867a3e,_0x496e41){_0x867a3e=_0x867a3e-0x0;var _0x56c5ae=_0xe949[_0x867a3e];return _0x56c5ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e94('0x0'));var BPromise=require(_0x9e94('0x1'));var rs=require(_0x9e94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e94('0x3'))['db'];var utils=require(_0x9e94('0x4'));var logger=require(_0x9e94('0x5'))(_0x9e94('0x6'));var config=require(_0x9e94('0x7'));var jayson=require(_0x9e94('0x8'));var client=jayson[_0x9e94('0x9')][_0x9e94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42277a,_0xaffc5c,_0x57729d){return new BPromise(function(_0x48b362,_0x37d8c1){return client[_0x9e94('0xb')](_0x42277a,_0x57729d)['then'](function(_0x4ee9af){logger['info'](_0x9e94('0xc'),_0xaffc5c,_0x9e94('0xd'));logger[_0x9e94('0xe')](_0x9e94('0xf'),_0xaffc5c,_0x9e94('0xd'),JSON[_0x9e94('0x10')](_0x4ee9af));if(_0x4ee9af[_0x9e94('0x11')]){if(_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x12')]===0x1f4){logger['error'](_0x9e94('0xc'),_0xaffc5c,_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);return _0x37d8c1(_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);}logger[_0x9e94('0x11')](_0x9e94('0xc'),_0xaffc5c,_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);return _0x48b362(_0x4ee9af[_0x9e94('0x11')]['message']);}else{logger['info'](_0x9e94('0xc'),_0xaffc5c,_0x9e94('0xd'));_0x48b362(_0x4ee9af[_0x9e94('0x14')][_0x9e94('0x13')]);}})[_0x9e94('0x15')](function(_0x12ddf9){logger[_0x9e94('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0xaffc5c,_0x12ddf9);_0x37d8c1(_0x12ddf9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1c56fc0..addf36c 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 _0xa9b0=['show','post','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','/:id'];(function(_0x30a115,_0x444a45){var _0x1ce9a0=function(_0x25e670){while(--_0x25e670){_0x30a115['push'](_0x30a115['shift']());}};_0x1ce9a0(++_0x444a45);}(_0xa9b0,0x1f3));var _0x0a9b=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xa9b0[_0x38c632];return _0x12737e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a9b('0x0'));var timeout=require(_0x0a9b('0x1'));var express=require('express');var router=express[_0x0a9b('0x2')]();var fs_extra=require(_0x0a9b('0x3'));var auth=require(_0x0a9b('0x4'));var interaction=require(_0x0a9b('0x5'));var config=require(_0x0a9b('0x6'));var controller=require(_0x0a9b('0x7'));router['get']('/',auth[_0x0a9b('0x8')](),controller[_0x0a9b('0x9')]);router['get'](_0x0a9b('0xa'),auth[_0x0a9b('0x8')](),controller[_0x0a9b('0xb')]);router[_0x0a9b('0xc')]('/',auth[_0x0a9b('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9b('0xd')]);router[_0x0a9b('0xe')](_0x0a9b('0xa'),auth[_0x0a9b('0x8')](),controller[_0x0a9b('0xf')]);module[_0x0a9b('0x10')]=router; \ No newline at end of file +var _0x5e4e=['Router','../../components/auth/service','../../config/environment','./intZohoField.controller','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38046c,_0x5afd67){var _0x4c77b2=function(_0x17d1a3){while(--_0x17d1a3){_0x38046c['push'](_0x38046c['shift']());}};_0x4c77b2(++_0x5afd67);}(_0x5e4e,0x17c));var _0xe5e4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e4e[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xe5e4('0x0'));var util=require(_0xe5e4('0x1'));var path=require(_0xe5e4('0x2'));var timeout=require(_0xe5e4('0x3'));var express=require('express');var router=express[_0xe5e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe5e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e4('0x6'));var controller=require(_0xe5e4('0x7'));router['get']('/',auth[_0xe5e4('0x8')](),controller['index']);router['get'](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xa')]);router['post']('/',auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xb')]);router[_0xe5e4('0xc')](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller['update']);router[_0xe5e4('0xd')](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xe')]);module[_0xe5e4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2b02b8f..66a610d 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 _0x32a9=['sequelize','exports','ENUM','variable','customVariable','string','STRING'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x32a9,0x1b9));var _0x932a=function(_0xab0a8d,_0x5d9eb6){_0xab0a8d=_0xab0a8d-0x0;var _0x1a14d1=_0x32a9[_0xab0a8d];return _0x1a14d1;};'use strict';var Sequelize=require(_0x932a('0x0'));module[_0x932a('0x1')]={'type':{'type':Sequelize[_0x932a('0x2')]('string',_0x932a('0x3'),_0x932a('0x4'),'keyValue','picklist'),'defaultValue':_0x932a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x932a('0x2')](_0x932a('0x5'),_0x932a('0x3'),_0x932a('0x4'))},'keyContent':{'type':Sequelize[_0x932a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x932a('0x6')]}}; \ No newline at end of file +var _0x4de9=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x26dd29,_0xc2b1ac){var _0x4431c5=function(_0x360a77){while(--_0x360a77){_0x26dd29['push'](_0x26dd29['shift']());}};_0x4431c5(++_0xc2b1ac);}(_0x4de9,0x79));var _0x94de=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x4de9[_0xd8aad0];return _0x570860;};'use strict';var Sequelize=require(_0x94de('0x0'));module[_0x94de('0x1')]={'type':{'type':Sequelize['ENUM'](_0x94de('0x2'),_0x94de('0x3'),'customVariable',_0x94de('0x4'),_0x94de('0x5')),'defaultValue':_0x94de('0x2')},'content':{'type':Sequelize[_0x94de('0x6')]},'key':{'type':Sequelize[_0x94de('0x6')]},'keyType':{'type':Sequelize[_0x94de('0x7')]('string','variable',_0x94de('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x94de('0x6')]},'nameField':{'type':Sequelize[_0x94de('0x6')]},'customField':{'type':Sequelize[_0x94de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94de('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index d8110b6..0a8864e 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 _0xb688=['attributes','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ZohoField','fieldName','type','query','keys','filters','intersection','model','fields'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb688,0x64));var _0x8b68=function(_0x3e9995,_0x2414f0){_0x3e9995=_0x3e9995-0x0;var _0x5ea169=_0xb688[_0x3e9995];return _0x5ea169;};'use strict';var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b68('0xa'));var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require('papaparse');var Redis=require(_0x8b68('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b68('0x11'));var as=require(_0x8b68('0x12'));var hardwareService=require(_0x8b68('0x13'));var logger=require(_0x8b68('0x14'))(_0x8b68('0x15'));var utils=require(_0x8b68('0x16'));var config=require(_0x8b68('0x17'));var licenseUtil=require(_0x8b68('0x18'));var db=require(_0x8b68('0x19'))['db'];function respondWithStatusCode(_0x7e3005,_0x37aa8e){_0x37aa8e=_0x37aa8e||0xcc;return function(_0x2723c4){if(_0x2723c4){return _0x7e3005[_0x8b68('0x1a')](_0x37aa8e);}return _0x7e3005['status'](_0x37aa8e)[_0x8b68('0x1b')]();};}function respondWithResult(_0x3235c6,_0x327789){_0x327789=_0x327789||0xc8;return function(_0x1cc135){if(_0x1cc135){return _0x3235c6[_0x8b68('0x1c')](_0x327789)[_0x8b68('0x1d')](_0x1cc135);}};}function respondWithFilteredResult(_0x546b10,_0x3b4f10){return function(_0x46d4c3){if(_0x46d4c3){var _0x2b0931=typeof _0x3b4f10[_0x8b68('0x1e')]===_0x8b68('0x1f')&&typeof _0x3b4f10[_0x8b68('0x20')]===_0x8b68('0x1f');var _0x794c0e=_0x46d4c3['count'];var _0x5abd35=_0x2b0931?0x0:_0x3b4f10['offset'];var _0x499d15=_0x2b0931?_0x46d4c3['count']:_0x3b4f10[_0x8b68('0x1e')]+_0x3b4f10[_0x8b68('0x20')];var _0x5f5aba;if(_0x499d15>=_0x794c0e){_0x499d15=_0x794c0e;_0x5f5aba=0xc8;}else{_0x5f5aba=0xce;}_0x546b10['status'](_0x5f5aba);return _0x546b10[_0x8b68('0x21')](_0x8b68('0x22'),_0x5abd35+'-'+_0x499d15+'/'+_0x794c0e)[_0x8b68('0x1d')](_0x46d4c3);}return null;};}function patchUpdates(_0x2d0c80){return function(_0x4a26db){try{jsonpatch[_0x8b68('0x23')](_0x4a26db,_0x2d0c80,!![]);}catch(_0x300d79){return BPromise[_0x8b68('0x24')](_0x300d79);}return _0x4a26db['save']();};}function saveUpdates(_0x40dba5,_0x1e57e2){return function(_0x28b233){if(_0x28b233){return _0x28b233[_0x8b68('0x25')](_0x40dba5)[_0x8b68('0x26')](function(_0x1191ab){return _0x1191ab;});}return null;};}function removeEntity(_0x189221,_0x4317cd){return function(_0x570aab){if(_0x570aab){return _0x570aab['destroy']()['then'](function(){_0x189221[_0x8b68('0x1c')](0xcc)[_0x8b68('0x1b')]();});}};}function handleEntityNotFound(_0x561a60,_0x48949a){return function(_0x3f9b6e){if(!_0x3f9b6e){_0x561a60[_0x8b68('0x1a')](0x194);}return _0x3f9b6e;};}function handleError(_0x3c330c,_0x44fb72){_0x44fb72=_0x44fb72||0x1f4;return function(_0x4c39ca){logger[_0x8b68('0x27')](_0x4c39ca[_0x8b68('0x28')]);if(_0x4c39ca[_0x8b68('0x29')]){delete _0x4c39ca[_0x8b68('0x29')];}_0x3c330c['status'](_0x44fb72)[_0x8b68('0x2a')](_0x4c39ca);};}exports[_0x8b68('0x2b')]=function(_0x2bf077,_0x57e214){var _0x3b7ce0={},_0x56ab4a={},_0x49c796={'count':0x0,'rows':[]};var _0x3e26a0=_[_0x8b68('0x2c')](db[_0x8b68('0x2d')]['rawAttributes'],function(_0x3f1850){return{'name':_0x3f1850[_0x8b68('0x2e')],'type':_0x3f1850[_0x8b68('0x2f')]['key']};});_0x56ab4a['model']=_[_0x8b68('0x2c')](_0x3e26a0,_0x8b68('0x29'));_0x56ab4a[_0x8b68('0x30')]=_[_0x8b68('0x31')](_0x2bf077[_0x8b68('0x30')]);_0x56ab4a[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x56ab4a[_0x8b68('0x34')],_0x56ab4a['query']);_0x3b7ce0['attributes']=_[_0x8b68('0x33')](_0x56ab4a['model'],qs[_0x8b68('0x35')](_0x2bf077[_0x8b68('0x30')]['fields']));_0x3b7ce0[_0x8b68('0x36')]=_0x3b7ce0['attributes']['length']?_0x3b7ce0['attributes']:_0x56ab4a[_0x8b68('0x34')];if(!_0x2bf077[_0x8b68('0x30')]['hasOwnProperty']('nolimit')){_0x3b7ce0['limit']=qs[_0x8b68('0x20')](_0x2bf077[_0x8b68('0x30')][_0x8b68('0x20')]);_0x3b7ce0['offset']=qs[_0x8b68('0x1e')](_0x2bf077['query'][_0x8b68('0x1e')]);}_0x3b7ce0[_0x8b68('0x37')]=qs[_0x8b68('0x38')](_0x2bf077[_0x8b68('0x30')]['sort']);_0x3b7ce0[_0x8b68('0x39')]=qs[_0x8b68('0x32')](_[_0x8b68('0x3a')](_0x2bf077[_0x8b68('0x30')],_0x56ab4a[_0x8b68('0x32')]),_0x3e26a0);if(_0x2bf077['query']['filter']){_0x3b7ce0[_0x8b68('0x39')]=_['merge'](_0x3b7ce0[_0x8b68('0x39')],{'$or':_[_0x8b68('0x2c')](_0x3e26a0,function(_0x5aa84a){if(_0x5aa84a[_0x8b68('0x2f')]!==_0x8b68('0x3b')){var _0x29f615={};_0x29f615[_0x5aa84a[_0x8b68('0x29')]]={'$like':'%'+_0x2bf077[_0x8b68('0x30')][_0x8b68('0x3c')]+'%'};return _0x29f615;}})});}_0x3b7ce0=_[_0x8b68('0x3d')]({},_0x3b7ce0,_0x2bf077[_0x8b68('0x3e')]);var _0x1cd6fb={'where':_0x3b7ce0[_0x8b68('0x39')]};return db[_0x8b68('0x2d')][_0x8b68('0x3f')](_0x1cd6fb)[_0x8b68('0x26')](function(_0x274324){_0x49c796[_0x8b68('0x3f')]=_0x274324;if(_0x2bf077[_0x8b68('0x30')]['includeAll']){_0x3b7ce0[_0x8b68('0x40')]=[{'all':!![]}];}return db[_0x8b68('0x2d')][_0x8b68('0x41')](_0x3b7ce0);})['then'](function(_0x42ff5d){_0x49c796[_0x8b68('0x42')]=_0x42ff5d;return _0x49c796;})[_0x8b68('0x26')](respondWithFilteredResult(_0x57e214,_0x3b7ce0))[_0x8b68('0x43')](handleError(_0x57e214,null));};exports[_0x8b68('0x44')]=function(_0x162924,_0x306827){var _0x5a1db8={'raw':!![],'where':{'id':_0x162924[_0x8b68('0x45')]['id']}},_0x1b9e13={};_0x1b9e13[_0x8b68('0x34')]=_[_0x8b68('0x31')](db['ZohoField'][_0x8b68('0x46')]);_0x1b9e13[_0x8b68('0x30')]=_[_0x8b68('0x31')](_0x162924[_0x8b68('0x30')]);_0x1b9e13[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x1b9e13[_0x8b68('0x34')],_0x1b9e13[_0x8b68('0x30')]);_0x5a1db8[_0x8b68('0x36')]=_['intersection'](_0x1b9e13[_0x8b68('0x34')],qs[_0x8b68('0x35')](_0x162924[_0x8b68('0x30')][_0x8b68('0x35')]));_0x5a1db8[_0x8b68('0x36')]=_0x5a1db8[_0x8b68('0x36')][_0x8b68('0x47')]?_0x5a1db8['attributes']:_0x1b9e13[_0x8b68('0x34')];if(_0x162924[_0x8b68('0x30')][_0x8b68('0x48')]){_0x5a1db8['include']=[{'all':!![]}];}_0x5a1db8=_[_0x8b68('0x3d')]({},_0x5a1db8,_0x162924[_0x8b68('0x3e')]);return db[_0x8b68('0x2d')][_0x8b68('0x49')](_0x5a1db8)['then'](handleEntityNotFound(_0x306827,null))['then'](respondWithResult(_0x306827,null))['catch'](handleError(_0x306827,null));};exports[_0x8b68('0x4a')]=function(_0x2fc4de,_0x451cb7){return db[_0x8b68('0x2d')][_0x8b68('0x4a')](_0x2fc4de[_0x8b68('0x4b')],{})['then'](respondWithResult(_0x451cb7,0xc9))[_0x8b68('0x43')](handleError(_0x451cb7,null));};exports[_0x8b68('0x25')]=function(_0x37b8fd,_0x1dc784){if(_0x37b8fd['body']['id']){delete _0x37b8fd[_0x8b68('0x4b')]['id'];}return db[_0x8b68('0x2d')][_0x8b68('0x49')]({'where':{'id':_0x37b8fd[_0x8b68('0x45')]['id']}})[_0x8b68('0x26')](handleEntityNotFound(_0x1dc784,null))[_0x8b68('0x26')](saveUpdates(_0x37b8fd['body'],null))[_0x8b68('0x26')](respondWithResult(_0x1dc784,null))['catch'](handleError(_0x1dc784,null));};exports[_0x8b68('0x4c')]=function(_0x4002f8,_0x4d4ea2){return db[_0x8b68('0x2d')][_0x8b68('0x49')]({'where':{'id':_0x4002f8['params']['id']}})[_0x8b68('0x26')](handleEntityNotFound(_0x4d4ea2,null))[_0x8b68('0x26')](removeEntity(_0x4d4ea2,null))[_0x8b68('0x43')](handleError(_0x4d4ea2,null));}; \ No newline at end of file +var _0x58d2=['json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','ZohoField','includeAll','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status'];(function(_0xd0de50,_0x2cd601){var _0x4d0c8a=function(_0x45847c){while(--_0x45847c){_0xd0de50['push'](_0xd0de50['shift']());}};_0x4d0c8a(++_0x2cd601);}(_0x58d2,0xcb));var _0x258d=function(_0x40eb1c,_0x5bbf43){_0x40eb1c=_0x40eb1c-0x0;var _0x15ec71=_0x58d2[_0x40eb1c];return _0x15ec71;};'use strict';var emlformat=require(_0x258d('0x0'));var rimraf=require(_0x258d('0x1'));var zipdir=require(_0x258d('0x2'));var jsonpatch=require(_0x258d('0x3'));var rp=require(_0x258d('0x4'));var moment=require(_0x258d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x258d('0x6'));var util=require(_0x258d('0x7'));var path=require('path');var sox=require(_0x258d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x258d('0x9'));var _=require(_0x258d('0xa'));var squel=require(_0x258d('0xb'));var crypto=require(_0x258d('0xc'));var jsforce=require(_0x258d('0xd'));var deskjs=require(_0x258d('0xe'));var toCsv=require(_0x258d('0xf'));var querystring=require(_0x258d('0x10'));var Papa=require(_0x258d('0x11'));var Redis=require('ioredis');var authService=require(_0x258d('0x12'));var qs=require(_0x258d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258d('0x14'));var logger=require(_0x258d('0x15'))(_0x258d('0x16'));var utils=require('../../config/utils');var config=require(_0x258d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x60869c,_0x48966e){_0x48966e=_0x48966e||0xcc;return function(_0x3225e8){if(_0x3225e8){return _0x60869c['sendStatus'](_0x48966e);}return _0x60869c[_0x258d('0x18')](_0x48966e)['end']();};}function respondWithResult(_0x7759f0,_0x2f8e69){_0x2f8e69=_0x2f8e69||0xc8;return function(_0x58dd76){if(_0x58dd76){return _0x7759f0[_0x258d('0x18')](_0x2f8e69)[_0x258d('0x19')](_0x58dd76);}};}function respondWithFilteredResult(_0x2ef99f,_0x184b83){return function(_0x1c6f31){if(_0x1c6f31){var _0x19d952=typeof _0x184b83[_0x258d('0x1a')]==='undefined'&&typeof _0x184b83[_0x258d('0x1b')]===_0x258d('0x1c');var _0x5183af=_0x1c6f31[_0x258d('0x1d')];var _0x8a3ad6=_0x19d952?0x0:_0x184b83[_0x258d('0x1a')];var _0x21f1b6=_0x19d952?_0x1c6f31[_0x258d('0x1d')]:_0x184b83['offset']+_0x184b83['limit'];var _0x543d02;if(_0x21f1b6>=_0x5183af){_0x21f1b6=_0x5183af;_0x543d02=0xc8;}else{_0x543d02=0xce;}_0x2ef99f['status'](_0x543d02);return _0x2ef99f[_0x258d('0x1e')]('Content-Range',_0x8a3ad6+'-'+_0x21f1b6+'/'+_0x5183af)[_0x258d('0x19')](_0x1c6f31);}return null;};}function patchUpdates(_0x318af0){return function(_0x4cb148){try{jsonpatch[_0x258d('0x1f')](_0x4cb148,_0x318af0,!![]);}catch(_0x46266a){return BPromise[_0x258d('0x20')](_0x46266a);}return _0x4cb148[_0x258d('0x21')]();};}function saveUpdates(_0x2dadb9,_0x1fd7aa){return function(_0x1d3945){if(_0x1d3945){return _0x1d3945[_0x258d('0x22')](_0x2dadb9)[_0x258d('0x23')](function(_0x448955){return _0x448955;});}return null;};}function removeEntity(_0x39a242,_0x5929e0){return function(_0x19ded2){if(_0x19ded2){return _0x19ded2[_0x258d('0x24')]()[_0x258d('0x23')](function(){_0x39a242[_0x258d('0x18')](0xcc)[_0x258d('0x25')]();});}};}function handleEntityNotFound(_0x29bbc9,_0x4d0a68){return function(_0x13be62){if(!_0x13be62){_0x29bbc9[_0x258d('0x26')](0x194);}return _0x13be62;};}function handleError(_0x23ba4d,_0x5701b8){_0x5701b8=_0x5701b8||0x1f4;return function(_0x15341d){logger[_0x258d('0x27')](_0x15341d[_0x258d('0x28')]);if(_0x15341d[_0x258d('0x29')]){delete _0x15341d[_0x258d('0x29')];}_0x23ba4d[_0x258d('0x18')](_0x5701b8)[_0x258d('0x2a')](_0x15341d);};}exports[_0x258d('0x2b')]=function(_0x81a125,_0x149c5c){var _0x5cb70c={},_0x3c172b={},_0x4862cb={'count':0x0,'rows':[]};var _0x32d08d=_[_0x258d('0x2c')](db['ZohoField'][_0x258d('0x2d')],function(_0x5e86fd){return{'name':_0x5e86fd[_0x258d('0x2e')],'type':_0x5e86fd[_0x258d('0x2f')][_0x258d('0x30')]};});_0x3c172b['model']=_[_0x258d('0x2c')](_0x32d08d,'name');_0x3c172b[_0x258d('0x31')]=_[_0x258d('0x32')](_0x81a125['query']);_0x3c172b[_0x258d('0x33')]=_[_0x258d('0x34')](_0x3c172b[_0x258d('0x35')],_0x3c172b['query']);_0x5cb70c[_0x258d('0x36')]=_[_0x258d('0x34')](_0x3c172b[_0x258d('0x35')],qs[_0x258d('0x37')](_0x81a125[_0x258d('0x31')][_0x258d('0x37')]));_0x5cb70c[_0x258d('0x36')]=_0x5cb70c[_0x258d('0x36')][_0x258d('0x38')]?_0x5cb70c[_0x258d('0x36')]:_0x3c172b[_0x258d('0x35')];if(!_0x81a125[_0x258d('0x31')][_0x258d('0x39')](_0x258d('0x3a'))){_0x5cb70c['limit']=qs[_0x258d('0x1b')](_0x81a125[_0x258d('0x31')][_0x258d('0x1b')]);_0x5cb70c['offset']=qs['offset'](_0x81a125[_0x258d('0x31')][_0x258d('0x1a')]);}_0x5cb70c[_0x258d('0x3b')]=qs[_0x258d('0x3c')](_0x81a125[_0x258d('0x31')][_0x258d('0x3c')]);_0x5cb70c[_0x258d('0x3d')]=qs[_0x258d('0x33')](_['pick'](_0x81a125[_0x258d('0x31')],_0x3c172b['filters']),_0x32d08d);if(_0x81a125[_0x258d('0x31')]['filter']){_0x5cb70c[_0x258d('0x3d')]=_[_0x258d('0x3e')](_0x5cb70c[_0x258d('0x3d')],{'$or':_[_0x258d('0x2c')](_0x32d08d,function(_0x114c5c){if(_0x114c5c[_0x258d('0x2f')]!==_0x258d('0x3f')){var _0x32bf4b={};_0x32bf4b[_0x114c5c['name']]={'$like':'%'+_0x81a125[_0x258d('0x31')][_0x258d('0x40')]+'%'};return _0x32bf4b;}})});}_0x5cb70c=_['merge']({},_0x5cb70c,_0x81a125[_0x258d('0x41')]);var _0x217b57={'where':_0x5cb70c[_0x258d('0x3d')]};return db[_0x258d('0x42')]['count'](_0x217b57)[_0x258d('0x23')](function(_0x5611fc){_0x4862cb[_0x258d('0x1d')]=_0x5611fc;if(_0x81a125[_0x258d('0x31')][_0x258d('0x43')]){_0x5cb70c['include']=[{'all':!![]}];}return db['ZohoField'][_0x258d('0x44')](_0x5cb70c);})[_0x258d('0x23')](function(_0x37df23){_0x4862cb[_0x258d('0x45')]=_0x37df23;return _0x4862cb;})['then'](respondWithFilteredResult(_0x149c5c,_0x5cb70c))[_0x258d('0x46')](handleError(_0x149c5c,null));};exports[_0x258d('0x47')]=function(_0x57e468,_0x226592){var _0x2b13e2={'raw':!![],'where':{'id':_0x57e468['params']['id']}},_0x49904f={};_0x49904f[_0x258d('0x35')]=_['keys'](db[_0x258d('0x42')][_0x258d('0x2d')]);_0x49904f[_0x258d('0x31')]=_[_0x258d('0x32')](_0x57e468['query']);_0x49904f[_0x258d('0x33')]=_['intersection'](_0x49904f[_0x258d('0x35')],_0x49904f[_0x258d('0x31')]);_0x2b13e2['attributes']=_['intersection'](_0x49904f['model'],qs[_0x258d('0x37')](_0x57e468[_0x258d('0x31')][_0x258d('0x37')]));_0x2b13e2[_0x258d('0x36')]=_0x2b13e2[_0x258d('0x36')][_0x258d('0x38')]?_0x2b13e2[_0x258d('0x36')]:_0x49904f[_0x258d('0x35')];if(_0x57e468[_0x258d('0x31')][_0x258d('0x43')]){_0x2b13e2['include']=[{'all':!![]}];}_0x2b13e2=_[_0x258d('0x3e')]({},_0x2b13e2,_0x57e468['options']);return db[_0x258d('0x42')][_0x258d('0x48')](_0x2b13e2)[_0x258d('0x23')](handleEntityNotFound(_0x226592,null))[_0x258d('0x23')](respondWithResult(_0x226592,null))['catch'](handleError(_0x226592,null));};exports[_0x258d('0x49')]=function(_0x5b6178,_0x51a245){return db[_0x258d('0x42')][_0x258d('0x49')](_0x5b6178['body'],{})['then'](respondWithResult(_0x51a245,0xc9))[_0x258d('0x46')](handleError(_0x51a245,null));};exports[_0x258d('0x22')]=function(_0x4e3f42,_0x43ad5f){if(_0x4e3f42[_0x258d('0x4a')]['id']){delete _0x4e3f42[_0x258d('0x4a')]['id'];}return db[_0x258d('0x42')][_0x258d('0x48')]({'where':{'id':_0x4e3f42[_0x258d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43ad5f,null))['then'](saveUpdates(_0x4e3f42[_0x258d('0x4a')],null))[_0x258d('0x23')](respondWithResult(_0x43ad5f,null))[_0x258d('0x46')](handleError(_0x43ad5f,null));};exports['destroy']=function(_0x4fa40f,_0x2177df){return db[_0x258d('0x42')]['find']({'where':{'id':_0x4fa40f[_0x258d('0x4b')]['id']}})[_0x258d('0x23')](handleEntityNotFound(_0x2177df,null))[_0x258d('0x23')](removeEntity(_0x2177df,null))['catch'](handleError(_0x2177df,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 4afcf9a..dcfb822 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 _0x9536=['zoho_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x9536,0x179));var _0x6953=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x9536[_0x3b711c];return _0x2685f0;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['idField',_0x6953('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','bluebird','request-promise','path'];(function(_0x5af0bd,_0x5d6806){var _0x2ebe5b=function(_0x442064){while(--_0x442064){_0x5af0bd['push'](_0x5af0bd['shift']());}};_0x2ebe5b(++_0x5d6806);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xd'),_0xb71a('0xe')],'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 7bb4588..0f9c014 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 _0x182c=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x182c,0x164));var _0xc182=function(_0x5d829d,_0x14680a){_0x5d829d=_0x5d829d-0x0;var _0x25a70f=_0x182c[_0x5d829d];return _0x25a70f;};'use strict';var _=require(_0xc182('0x0'));var util=require(_0xc182('0x1'));var moment=require(_0xc182('0x2'));var BPromise=require(_0xc182('0x3'));var rs=require(_0xc182('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc182('0x5'))['db'];var utils=require(_0xc182('0x6'));var logger=require(_0xc182('0x7'))(_0xc182('0x8'));var config=require(_0xc182('0x9'));var jayson=require(_0xc182('0xa'));var client=jayson[_0xc182('0xb')][_0xc182('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ea230,_0x389949,_0x123975){return new BPromise(function(_0x4cc16e,_0x5d4d68){return client[_0xc182('0xd')](_0x3ea230,_0x123975)[_0xc182('0xe')](function(_0xe6b6ef){logger[_0xc182('0xf')](_0xc182('0x10'),_0x389949,_0xc182('0x11'));logger[_0xc182('0x12')](_0xc182('0x13'),_0x389949,_0xc182('0x11'),JSON[_0xc182('0x14')](_0xe6b6ef));if(_0xe6b6ef['error']){if(_0xe6b6ef['error'][_0xc182('0x15')]===0x1f4){logger[_0xc182('0x16')](_0xc182('0x10'),_0x389949,_0xe6b6ef[_0xc182('0x16')]['message']);return _0x5d4d68(_0xe6b6ef['error']['message']);}logger['error'](_0xc182('0x10'),_0x389949,_0xe6b6ef[_0xc182('0x16')][_0xc182('0x17')]);return _0x4cc16e(_0xe6b6ef['error'][_0xc182('0x17')]);}else{logger[_0xc182('0xf')]('ZohoField,\x20%s,\x20%s',_0x389949,'request\x20sent');_0x4cc16e(_0xe6b6ef['result'][_0xc182('0x17')]);}})[_0xc182('0x18')](function(_0x3799a1){logger[_0xc182('0x16')](_0xc182('0x10'),_0x389949,_0x3799a1);_0x5d4d68(_0x3799a1);});});} \ No newline at end of file +var _0xe72c=['../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe72c,0x14b));var _0xce72=function(_0x205b2d,_0x5c4047){_0x205b2d=_0x205b2d-0x0;var _0x8bccfa=_0xe72c[_0x205b2d];return _0x8bccfa;};'use strict';var _=require(_0xce72('0x0'));var util=require(_0xce72('0x1'));var moment=require(_0xce72('0x2'));var BPromise=require('bluebird');var rs=require(_0xce72('0x3'));var fs=require('fs');var Redis=require(_0xce72('0x4'));var db=require(_0xce72('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xce72('0x6'));var jayson=require(_0xce72('0x7'));var client=jayson['client'][_0xce72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18b468,_0x37dcac,_0x1a9cfe){return new BPromise(function(_0x28d627,_0x144017){return client[_0xce72('0x9')](_0x18b468,_0x1a9cfe)[_0xce72('0xa')](function(_0x9c3a35){logger[_0xce72('0xb')](_0xce72('0xc'),_0x37dcac,'request\x20sent');logger['debug'](_0xce72('0xd'),_0x37dcac,_0xce72('0xe'),JSON[_0xce72('0xf')](_0x9c3a35));if(_0x9c3a35['error']){if(_0x9c3a35[_0xce72('0x10')][_0xce72('0x11')]===0x1f4){logger[_0xce72('0x10')](_0xce72('0xc'),_0x37dcac,_0x9c3a35['error'][_0xce72('0x12')]);return _0x144017(_0x9c3a35['error'][_0xce72('0x12')]);}logger[_0xce72('0x10')](_0xce72('0xc'),_0x37dcac,_0x9c3a35['error'][_0xce72('0x12')]);return _0x28d627(_0x9c3a35[_0xce72('0x10')][_0xce72('0x12')]);}else{logger[_0xce72('0xb')](_0xce72('0xc'),_0x37dcac,'request\x20sent');_0x28d627(_0x9c3a35[_0xce72('0x13')][_0xce72('0x12')]);}})[_0xce72('0x14')](function(_0x1861e3){logger['error'](_0xce72('0xc'),_0x37dcac,_0x1861e3);_0x144017(_0x1861e3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 148b795..0bdce92 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x533af8,_0x1f2b7c){var _0x331f44=function(_0xa2fdf0){while(--_0xa2fdf0){_0x533af8['push'](_0x533af8['shift']());}};_0x331f44(++_0x1f2b7c);}(_0x70e0,0x17b));var _0x070e=function(_0x255d81,_0x4614e1){_0x255d81=_0x255d81-0x0;var _0x4f0831=_0x70e0[_0x255d81];return _0x4f0831;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2cbb42,_0x5862e8){var _0x1d4266=function(_0x16d166){while(--_0x16d166){_0x2cbb42['push'](_0x2cbb42['shift']());}};_0x1d4266(++_0x5862e8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5e67b14..a8be31f 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 _0x1c2a=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c2a,0xbf));var _0xa1c2=function(_0x565d37,_0x4bf65f){_0x565d37=_0x565d37-0x0;var _0x43fbb9=_0x1c2a[_0x565d37];return _0x43fbb9;};'use strict';var Sequelize=require(_0xa1c2('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c2('0x1')],'allowNull':![],'unique':_0xa1c2('0x2')},'version':{'type':Sequelize[_0xa1c2('0x1')],'allowNull':![],'unique':_0xa1c2('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xa1c2('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa1c2('0x1')]},'type':{'type':Sequelize[_0xa1c2('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xa1c2('0x1')]},'logo':{'type':Sequelize[_0xa1c2('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xa1c2('0x5')},'description':{'type':Sequelize[_0xa1c2('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1c2('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x0da2=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x289388,_0x4f66f2){var _0x27ac65=function(_0x1d78a1){while(--_0x1d78a1){_0x289388['push'](_0x289388['shift']());}};_0x27ac65(++_0x4f66f2);}(_0x0da2,0x85));var _0x20da=function(_0x257bb3,_0x3f2c30){_0x257bb3=_0x257bb3-0x0;var _0x288002=_0x0da2[_0x257bb3];return _0x288002;};'use strict';var Sequelize=require(_0x20da('0x0'));module[_0x20da('0x1')]={'name':{'type':Sequelize[_0x20da('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x20da('0x2')],'allowNull':![],'unique':_0x20da('0x3')},'main':{'type':Sequelize[_0x20da('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x20da('0x2')]},'path':{'type':Sequelize[_0x20da('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x20da('0x4')]},'active':{'type':Sequelize[_0x20da('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x20da('0x2')]},'logo':{'type':Sequelize[_0x20da('0x2')]},'state':{'type':Sequelize[_0x20da('0x2')],'unique':_0x20da('0x6')},'description':{'type':Sequelize[_0x20da('0x2')]},'title':{'type':Sequelize[_0x20da('0x2')]},'remoteUri':{'type':Sequelize[_0x20da('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 26644ee..11d4ba4 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 _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x524e,0x15e));var _0xe524=function(_0x49f1db,_0x4f2705){_0x49f1db=_0x49f1db-0x0;var _0x1dc34c=_0x524e[_0x49f1db];return _0x1dc34c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file +var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','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','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0xf61e,0x191));var _0xef61=function(_0x190f06,_0x13f5fd){_0x190f06=_0x190f06-0x0;var _0x3353e8=_0xf61e[_0x190f06];return _0x3353e8;};'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['Integration']['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['Integration'][_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));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 05635aa..fbf3e1d 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 _0x4825=['util','api','moment','request-promise','rimraf','./integration.attributes','define','Integration','integrations','lodash'];(function(_0x1ad76c,_0x30fe9f){var _0x3810ac=function(_0x1796d8){while(--_0x1796d8){_0x1ad76c['push'](_0x1ad76c['shift']());}};_0x3810ac(++_0x30fe9f);}(_0x4825,0x117));var _0x5482=function(_0x1b7f8d,_0x47a3d0){_0x1b7f8d=_0x1b7f8d-0x0;var _0x28e65a=_0x4825[_0x1b7f8d];return _0x28e65a;};'use strict';var _=require(_0x5482('0x0'));var util=require(_0x5482('0x1'));var logger=require('../../config/logger')(_0x5482('0x2'));var moment=require(_0x5482('0x3'));var BPromise=require('bluebird');var rp=require(_0x5482('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5482('0x5'));var config=require('../../config/environment');var attributes=require(_0x5482('0x6'));module['exports']=function(_0x2ece33,_0x491d3a){return _0x2ece33[_0x5482('0x7')](_0x5482('0x8'),attributes,{'tableName':_0x5482('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd418=['bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','api','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd418,0xe1));var _0x8d41=function(_0x5f226c,_0x26501a){_0x5f226c=_0x5f226c-0x0;var _0x122026=_0xd418[_0x5f226c];return _0x122026;};'use strict';var _=require('lodash');var util=require(_0x8d41('0x0'));var logger=require('../../config/logger')(_0x8d41('0x1'));var moment=require(_0x8d41('0x2'));var BPromise=require(_0x8d41('0x3'));var rp=require(_0x8d41('0x4'));var fs=require('fs');var path=require(_0x8d41('0x5'));var rimraf=require('rimraf');var config=require(_0x8d41('0x6'));var attributes=require(_0x8d41('0x7'));module[_0x8d41('0x8')]=function(_0xce6bb9,_0x17173c){return _0xce6bb9[_0x8d41('0x9')](_0x8d41('0xa'),attributes,{'tableName':_0x8d41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index e8a0b1f..9d7883f 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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\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','request','then'];(function(_0x501c00,_0x1dc98b){var _0x5ad836=function(_0x21299f){while(--_0x21299f){_0x501c00['push'](_0x501c00['shift']());}};_0x5ad836(++_0x1dc98b);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x3fe794,_0x406f0b){_0x3fe794=_0x3fe794-0x0;var _0x153dd1=_0xd7d1[_0x3fe794];return _0x153dd1;};'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']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\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);});});} \ No newline at end of file +var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3fd108,_0x5d911f){var _0x4f943f=function(_0x12abdf){while(--_0x12abdf){_0x3fd108['push'](_0x3fd108['shift']());}};_0x4f943f(++_0x5d911f);}(_0x896e,0x1e9));var _0xe896=function(_0x3ca5d2,_0x22e645){_0x3ca5d2=_0x3ca5d2-0x0;var _0x1c65b7=_0x896e[_0x3ca5d2];return _0x1c65b7;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9c53da0..8bfff17 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x56b7cf,_0x5e3446){var _0x2d75a0=function(_0x3dec12){while(--_0x3dec12){_0x56b7cf['push'](_0x56b7cf['shift']());}};_0x2d75a0(++_0x5e3446);}(_0x7880,0x1f4));var _0x0788=function(_0x18c4bf,_0x56dfe5){_0x18c4bf=_0x18c4bf-0x0;var _0x5c9674=_0x7880[_0x18c4bf];return _0x5c9674;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x39dc02,_0x57da9d){var _0x537af2=function(_0x12b96f){while(--_0x12b96f){_0x39dc02['push'](_0x39dc02['shift']());}};_0x537af2(++_0x57da9d);}(_0x1261,0x144));var _0x1126=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x1261[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9bd82e3..c78f243 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 _0x3007=['BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x567e3f,_0x3df761){var _0x3fc825=function(_0x37006e){while(--_0x37006e){_0x567e3f['push'](_0x567e3f['shift']());}};_0x3fc825(++_0x3df761);}(_0x3007,0x19d));var _0x7300=function(_0x5edf01,_0x35aee0){_0x5edf01=_0x5edf01-0x0;var _0x1e9631=_0x3007[_0x5edf01];return _0x1e9631;};'use strict';var Sequelize=require(_0x7300('0x0'));module[_0x7300('0x1')]={'integration':{'type':Sequelize[_0x7300('0x2')]},'eventChannel':{'type':Sequelize[_0x7300('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x7300('0x3')]},'contacts':{'type':Sequelize[_0x7300('0x2')]},'uniqueid':{'type':Sequelize[_0x7300('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7300('0x2')]},'queue':{'type':Sequelize[_0x7300('0x2')]},'interface':{'type':Sequelize[_0x7300('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7300('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x7300('0x3')]},'agentcomplete':{'type':Sequelize[_0x7300('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7300('0x4')]},'talktime':{'type':Sequelize[_0x7300('0x3')]},'agentacw':{'type':Sequelize[_0x7300('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7300('0x3')]},'reason':{'type':Sequelize[_0x7300('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7300('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7300('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7300('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x7300('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7300('0x2')]},'language':{'type':Sequelize[_0x7300('0x2')]},'accountcode':{'type':Sequelize[_0x7300('0x2')]},'context':{'type':Sequelize[_0x7300('0x2')]},'exten':{'type':Sequelize[_0x7300('0x2')]},'priority':{'type':Sequelize[_0x7300('0x2')]},'destchannel':{'type':Sequelize[_0x7300('0x2')]},'destchannelstate':{'type':Sequelize[_0x7300('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7300('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7300('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7300('0x2')]},'destlanguage':{'type':Sequelize[_0x7300('0x2')]},'destaccountcode':{'type':Sequelize[_0x7300('0x2')]},'destcontext':{'type':Sequelize[_0x7300('0x2')]},'destexten':{'type':Sequelize[_0x7300('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7300('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7300('0x2')]},'subject':{'type':Sequelize[_0x7300('0x2')]},'from':{'type':Sequelize[_0x7300('0x2')]},'to':{'type':Sequelize[_0x7300('0x2')]},'cc':{'type':Sequelize[_0x7300('0x2')]},'attachment':{'type':Sequelize[_0x7300('0x6')]},'html':{'type':Sequelize[_0x7300('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7300('0x7')]('SENT',_0x7300('0x8'),_0x7300('0x9'),_0x7300('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7300('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x7300('0x3')]}}; \ No newline at end of file +var _0xacd6=['INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE'];(function(_0x381bd2,_0x3b338b){var _0x24570e=function(_0x3881c7){while(--_0x3881c7){_0x381bd2['push'](_0x381bd2['shift']());}};_0x24570e(++_0x3b338b);}(_0xacd6,0x104));var _0x6acd=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xacd6[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0x6acd('0x0'));module[_0x6acd('0x1')]={'integration':{'type':Sequelize[_0x6acd('0x2')]},'eventChannel':{'type':Sequelize[_0x6acd('0x2')]},'exitStatus':{'type':Sequelize[_0x6acd('0x2')]},'ticketId':{'type':Sequelize[_0x6acd('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x6acd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6acd('0x2')]},'calleridname':{'type':Sequelize[_0x6acd('0x2')]},'queue':{'type':Sequelize[_0x6acd('0x2')]},'interface':{'type':Sequelize[_0x6acd('0x2')]},'membername':{'type':Sequelize[_0x6acd('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6acd('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6acd('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6acd('0x3')]},'talktime':{'type':Sequelize[_0x6acd('0x4')]},'agentacw':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6acd('0x4')]},'reason':{'type':Sequelize[_0x6acd('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6acd('0x3')]},'lastevent':{'type':Sequelize[_0x6acd('0x2')]},'channel':{'type':Sequelize[_0x6acd('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6acd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6acd('0x2')]},'connectedlinename':{'type':Sequelize[_0x6acd('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6acd('0x2')]},'context':{'type':Sequelize[_0x6acd('0x2')]},'exten':{'type':Sequelize[_0x6acd('0x2')]},'priority':{'type':Sequelize[_0x6acd('0x2')]},'destchannel':{'type':Sequelize[_0x6acd('0x2')]},'destchannelstate':{'type':Sequelize[_0x6acd('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x6acd('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6acd('0x2')]},'destcalleridname':{'type':Sequelize[_0x6acd('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6acd('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6acd('0x2')]},'destcontext':{'type':Sequelize[_0x6acd('0x2')]},'destexten':{'type':Sequelize[_0x6acd('0x2')]},'destpriority':{'type':Sequelize[_0x6acd('0x2')]},'destuniqueid':{'type':Sequelize[_0x6acd('0x2')]},'messageId':{'type':Sequelize[_0x6acd('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6acd('0x2')]},'from':{'type':Sequelize[_0x6acd('0x2')]},'to':{'type':Sequelize[_0x6acd('0x2')]},'cc':{'type':Sequelize[_0x6acd('0x2')]},'attachment':{'type':Sequelize[_0x6acd('0x6')]},'html':{'type':Sequelize[_0x6acd('0x6')]},'text':{'type':Sequelize[_0x6acd('0x6')]},'status':{'type':Sequelize[_0x6acd('0x7')](_0x6acd('0x8'),_0x6acd('0x9'),_0x6acd('0xa'),'FAILED')},'url':{'type':Sequelize[_0x6acd('0x2')]},'app':{'type':Sequelize[_0x6acd('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x6acd('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c55d1f6..b1af182 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 _0x4800=['end','json','offset','count','limit','status','set','save','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x45bffc,_0x8db6e4){var _0x3c3a9b=function(_0x3ed933){while(--_0x3ed933){_0x45bffc['push'](_0x45bffc['shift']());}};_0x3c3a9b(++_0x8db6e4);}(_0x4800,0x115));var _0x0480=function(_0x271dc9,_0x5c1711){_0x271dc9=_0x271dc9-0x0;var _0x4019de=_0x4800[_0x271dc9];return _0x4019de;};'use strict';var emlformat=require(_0x0480('0x0'));var rimraf=require(_0x0480('0x1'));var zipdir=require(_0x0480('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0480('0x3'));var moment=require(_0x0480('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0480('0x5'));var util=require(_0x0480('0x6'));var path=require(_0x0480('0x7'));var sox=require(_0x0480('0x8'));var csv=require(_0x0480('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0480('0xa'));var _=require(_0x0480('0xb'));var squel=require(_0x0480('0xc'));var crypto=require(_0x0480('0xd'));var jsforce=require(_0x0480('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0480('0x9'));var querystring=require('querystring');var Papa=require(_0x0480('0xf'));var Redis=require(_0x0480('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0480('0x11'));var as=require(_0x0480('0x12'));var hardwareService=require(_0x0480('0x13'));var logger=require(_0x0480('0x14'))(_0x0480('0x15'));var utils=require(_0x0480('0x16'));var config=require(_0x0480('0x17'));var licenseUtil=require(_0x0480('0x18'));var db=require(_0x0480('0x19'))['db'];function respondWithStatusCode(_0x1dfbc1,_0x1f3f17){_0x1f3f17=_0x1f3f17||0xcc;return function(_0x170877){if(_0x170877){return _0x1dfbc1[_0x0480('0x1a')](_0x1f3f17);}return _0x1dfbc1['status'](_0x1f3f17)[_0x0480('0x1b')]();};}function respondWithResult(_0x51148b,_0x2f39bc){_0x2f39bc=_0x2f39bc||0xc8;return function(_0x318a0d){if(_0x318a0d){return _0x51148b['status'](_0x2f39bc)[_0x0480('0x1c')](_0x318a0d);}};}function respondWithFilteredResult(_0x567532,_0x3c3ef9){return function(_0x13588c){if(_0x13588c){var _0x31b48a=typeof _0x3c3ef9[_0x0480('0x1d')]==='undefined'&&typeof _0x3c3ef9['limit']==='undefined';var _0x285483=_0x13588c['count'];var _0x227347=_0x31b48a?0x0:_0x3c3ef9[_0x0480('0x1d')];var _0x4f9d0d=_0x31b48a?_0x13588c[_0x0480('0x1e')]:_0x3c3ef9[_0x0480('0x1d')]+_0x3c3ef9[_0x0480('0x1f')];var _0x7032de;if(_0x4f9d0d>=_0x285483){_0x4f9d0d=_0x285483;_0x7032de=0xc8;}else{_0x7032de=0xce;}_0x567532[_0x0480('0x20')](_0x7032de);return _0x567532[_0x0480('0x21')]('Content-Range',_0x227347+'-'+_0x4f9d0d+'/'+_0x285483)[_0x0480('0x1c')](_0x13588c);}return null;};}function patchUpdates(_0x4db73b){return function(_0x446224){try{jsonpatch['apply'](_0x446224,_0x4db73b,!![]);}catch(_0x8f01ef){return BPromise['reject'](_0x8f01ef);}return _0x446224[_0x0480('0x22')]();};}function saveUpdates(_0x114652,_0x1269fd){return function(_0x1340d8){if(_0x1340d8){return _0x1340d8['update'](_0x114652)[_0x0480('0x23')](function(_0x3317ef){return _0x3317ef;});}return null;};}function removeEntity(_0x4dd386,_0x11545){return function(_0x546c05){if(_0x546c05){return _0x546c05[_0x0480('0x24')]()[_0x0480('0x23')](function(){_0x4dd386['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da943,_0x55017a){return function(_0x3ec80a){if(!_0x3ec80a){_0x4da943[_0x0480('0x1a')](0x194);}return _0x3ec80a;};}function handleError(_0x1a9e38,_0x4cb38f){_0x4cb38f=_0x4cb38f||0x1f4;return function(_0x944ad5){logger[_0x0480('0x25')](_0x944ad5[_0x0480('0x26')]);if(_0x944ad5[_0x0480('0x27')]){delete _0x944ad5[_0x0480('0x27')];}_0x1a9e38[_0x0480('0x20')](_0x4cb38f)[_0x0480('0x28')](_0x944ad5);};}exports[_0x0480('0x29')]=function(_0x196f66,_0x25bc43){var _0x1d19f3={},_0x2984a1={},_0x4cbb09={'count':0x0,'rows':[]};var _0x220f4b=_[_0x0480('0x2a')](db[_0x0480('0x2b')][_0x0480('0x2c')],function(_0x25ded7){return{'name':_0x25ded7[_0x0480('0x2d')],'type':_0x25ded7[_0x0480('0x2e')][_0x0480('0x2f')]};});_0x2984a1['model']=_[_0x0480('0x2a')](_0x220f4b,_0x0480('0x27'));_0x2984a1[_0x0480('0x30')]=_[_0x0480('0x31')](_0x196f66[_0x0480('0x30')]);_0x2984a1[_0x0480('0x32')]=_['intersection'](_0x2984a1[_0x0480('0x33')],_0x2984a1[_0x0480('0x30')]);_0x1d19f3[_0x0480('0x34')]=_[_0x0480('0x35')](_0x2984a1[_0x0480('0x33')],qs[_0x0480('0x36')](_0x196f66[_0x0480('0x30')]['fields']));_0x1d19f3['attributes']=_0x1d19f3[_0x0480('0x34')][_0x0480('0x37')]?_0x1d19f3[_0x0480('0x34')]:_0x2984a1[_0x0480('0x33')];if(!_0x196f66[_0x0480('0x30')][_0x0480('0x38')](_0x0480('0x39'))){_0x1d19f3[_0x0480('0x1f')]=qs['limit'](_0x196f66[_0x0480('0x30')][_0x0480('0x1f')]);_0x1d19f3[_0x0480('0x1d')]=qs[_0x0480('0x1d')](_0x196f66[_0x0480('0x30')][_0x0480('0x1d')]);}_0x1d19f3['order']=qs[_0x0480('0x3a')](_0x196f66[_0x0480('0x30')][_0x0480('0x3a')]);_0x1d19f3[_0x0480('0x3b')]=qs[_0x0480('0x32')](_[_0x0480('0x3c')](_0x196f66[_0x0480('0x30')],_0x2984a1['filters']),_0x220f4b);if(_0x196f66[_0x0480('0x30')][_0x0480('0x3d')]){_0x1d19f3[_0x0480('0x3b')]=_[_0x0480('0x3e')](_0x1d19f3['where'],{'$or':_[_0x0480('0x2a')](_0x220f4b,function(_0xe22b47){if(_0xe22b47['type']!=='VIRTUAL'){var _0x1b84ce={};_0x1b84ce[_0xe22b47['name']]={'$like':'%'+_0x196f66[_0x0480('0x30')]['filter']+'%'};return _0x1b84ce;}})});}_0x1d19f3=_[_0x0480('0x3e')]({},_0x1d19f3,_0x196f66[_0x0480('0x3f')]);var _0x364058={'where':_0x1d19f3[_0x0480('0x3b')]};return db[_0x0480('0x2b')][_0x0480('0x1e')](_0x364058)['then'](function(_0x2c611e){_0x4cbb09['count']=_0x2c611e;if(_0x196f66[_0x0480('0x30')][_0x0480('0x40')]){_0x1d19f3[_0x0480('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0480('0x42')](_0x1d19f3);})[_0x0480('0x23')](function(_0x3a6b2d){_0x4cbb09[_0x0480('0x43')]=_0x3a6b2d;return _0x4cbb09;})[_0x0480('0x23')](respondWithFilteredResult(_0x25bc43,_0x1d19f3))['catch'](handleError(_0x25bc43,null));};exports[_0x0480('0x44')]=function(_0x2011f4,_0x508981){var _0x451df0={'raw':![],'where':{'id':_0x2011f4[_0x0480('0x45')]['id']}},_0x4e9f3d={};_0x4e9f3d['model']=_['keys'](db['IntegrationReport'][_0x0480('0x2c')]);_0x4e9f3d[_0x0480('0x30')]=_['keys'](_0x2011f4[_0x0480('0x30')]);_0x4e9f3d[_0x0480('0x32')]=_['intersection'](_0x4e9f3d[_0x0480('0x33')],_0x4e9f3d[_0x0480('0x30')]);_0x451df0[_0x0480('0x34')]=_[_0x0480('0x35')](_0x4e9f3d['model'],qs[_0x0480('0x36')](_0x2011f4[_0x0480('0x30')]['fields']));_0x451df0[_0x0480('0x34')]=_0x451df0['attributes'][_0x0480('0x37')]?_0x451df0[_0x0480('0x34')]:_0x4e9f3d[_0x0480('0x33')];if(_0x2011f4[_0x0480('0x30')][_0x0480('0x40')]){_0x451df0[_0x0480('0x41')]=[{'all':!![]}];}_0x451df0=_[_0x0480('0x3e')]({},_0x451df0,_0x2011f4['options']);return db['IntegrationReport'][_0x0480('0x46')](_0x451df0)[_0x0480('0x23')](handleEntityNotFound(_0x508981,null))['then'](respondWithResult(_0x508981,null))[_0x0480('0x47')](handleError(_0x508981,null));};exports[_0x0480('0x48')]=function(_0x8317bd,_0x5eadd3){return db['IntegrationReport'][_0x0480('0x48')](_0x8317bd[_0x0480('0x49')],{})['then'](respondWithResult(_0x5eadd3,0xc9))[_0x0480('0x47')](handleError(_0x5eadd3,null));};exports[_0x0480('0x4a')]=function(_0x6e304c,_0x142d5a){if(_0x6e304c[_0x0480('0x49')]['id']){delete _0x6e304c[_0x0480('0x49')]['id'];}return db['IntegrationReport'][_0x0480('0x46')]({'where':{'id':_0x6e304c[_0x0480('0x45')]['id']}})[_0x0480('0x23')](handleEntityNotFound(_0x142d5a,null))[_0x0480('0x23')](saveUpdates(_0x6e304c['body'],null))[_0x0480('0x23')](respondWithResult(_0x142d5a,null))[_0x0480('0x47')](handleError(_0x142d5a,null));};exports[_0x0480('0x24')]=function(_0x58e785,_0xce052a){return db[_0x0480('0x2b')]['find']({'where':{'id':_0x58e785['params']['id']}})[_0x0480('0x23')](handleEntityNotFound(_0xce052a,null))[_0x0480('0x23')](removeEntity(_0xce052a,null))[_0x0480('0x47')](handleError(_0xce052a,null));};exports[_0x0480('0x4b')]=function(_0x1c2b4d,_0x25d1f1){return db[_0x0480('0x2b')][_0x0480('0x4b')]()['then'](respondWithResult(_0x25d1f1,null))[_0x0480('0x47')](handleError(_0x25d1f1,null));}; \ No newline at end of file +var _0x8734=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x40d320,_0x44d480){var _0x31f85b=function(_0x45ae06){while(--_0x45ae06){_0x40d320['push'](_0x40d320['shift']());}};_0x31f85b(++_0x44d480);}(_0x8734,0x192));var _0x4873=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x8734[_0x1678c8];return _0x387aa9;};'use strict';var emlformat=require(_0x4873('0x0'));var rimraf=require(_0x4873('0x1'));var zipdir=require(_0x4873('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4873('0x3'));var BPromise=require(_0x4873('0x4'));var Mustache=require('mustache');var util=require(_0x4873('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4873('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4873('0x7'));var squel=require('squel');var crypto=require(_0x4873('0x8'));var jsforce=require(_0x4873('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4873('0xa'));var Papa=require(_0x4873('0xb'));var Redis=require(_0x4873('0xc'));var authService=require(_0x4873('0xd'));var qs=require(_0x4873('0xe'));var as=require(_0x4873('0xf'));var hardwareService=require(_0x4873('0x10'));var logger=require('../../config/logger')(_0x4873('0x11'));var utils=require(_0x4873('0x12'));var config=require(_0x4873('0x13'));var licenseUtil=require(_0x4873('0x14'));var db=require(_0x4873('0x15'))['db'];function respondWithStatusCode(_0x237270,_0x5cca51){_0x5cca51=_0x5cca51||0xcc;return function(_0x1d9ff1){if(_0x1d9ff1){return _0x237270[_0x4873('0x16')](_0x5cca51);}return _0x237270[_0x4873('0x17')](_0x5cca51)[_0x4873('0x18')]();};}function respondWithResult(_0x539d2b,_0xe949a5){_0xe949a5=_0xe949a5||0xc8;return function(_0x365c7d){if(_0x365c7d){return _0x539d2b[_0x4873('0x17')](_0xe949a5)[_0x4873('0x19')](_0x365c7d);}};}function respondWithFilteredResult(_0x19622c,_0x583a3f){return function(_0x2b2f75){if(_0x2b2f75){var _0x15a93e=typeof _0x583a3f[_0x4873('0x1a')]===_0x4873('0x1b')&&typeof _0x583a3f[_0x4873('0x1c')]===_0x4873('0x1b');var _0x4ad9a2=_0x2b2f75[_0x4873('0x1d')];var _0x31e14b=_0x15a93e?0x0:_0x583a3f[_0x4873('0x1a')];var _0x5d722e=_0x15a93e?_0x2b2f75[_0x4873('0x1d')]:_0x583a3f[_0x4873('0x1a')]+_0x583a3f[_0x4873('0x1c')];var _0xd46348;if(_0x5d722e>=_0x4ad9a2){_0x5d722e=_0x4ad9a2;_0xd46348=0xc8;}else{_0xd46348=0xce;}_0x19622c[_0x4873('0x17')](_0xd46348);return _0x19622c[_0x4873('0x1e')]('Content-Range',_0x31e14b+'-'+_0x5d722e+'/'+_0x4ad9a2)[_0x4873('0x19')](_0x2b2f75);}return null;};}function patchUpdates(_0x76852f){return function(_0x1c86ee){try{jsonpatch[_0x4873('0x1f')](_0x1c86ee,_0x76852f,!![]);}catch(_0x121aa5){return BPromise[_0x4873('0x20')](_0x121aa5);}return _0x1c86ee[_0x4873('0x21')]();};}function saveUpdates(_0x438996,_0x41f780){return function(_0x1458c1){if(_0x1458c1){return _0x1458c1[_0x4873('0x22')](_0x438996)[_0x4873('0x23')](function(_0x308b65){return _0x308b65;});}return null;};}function removeEntity(_0x1a6cbe,_0x58dd2e){return function(_0xfb5f56){if(_0xfb5f56){return _0xfb5f56[_0x4873('0x24')]()['then'](function(){_0x1a6cbe[_0x4873('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e6552,_0x377e1d){return function(_0x2dfe6d){if(!_0x2dfe6d){_0x2e6552[_0x4873('0x16')](0x194);}return _0x2dfe6d;};}function handleError(_0xe175f7,_0x4dfcc1){_0x4dfcc1=_0x4dfcc1||0x1f4;return function(_0x2dd8f6){logger[_0x4873('0x25')](_0x2dd8f6[_0x4873('0x26')]);if(_0x2dd8f6[_0x4873('0x27')]){delete _0x2dd8f6['name'];}_0xe175f7[_0x4873('0x17')](_0x4dfcc1)[_0x4873('0x28')](_0x2dd8f6);};}exports[_0x4873('0x29')]=function(_0x273d96,_0x2a0bde){var _0xa51b32={},_0x4eed3a={},_0x48cc41={'count':0x0,'rows':[]};var _0x503932=_['map'](db[_0x4873('0x2a')]['rawAttributes'],function(_0x580113){return{'name':_0x580113[_0x4873('0x2b')],'type':_0x580113[_0x4873('0x2c')][_0x4873('0x2d')]};});_0x4eed3a[_0x4873('0x2e')]=_[_0x4873('0x2f')](_0x503932,_0x4873('0x27'));_0x4eed3a[_0x4873('0x30')]=_[_0x4873('0x31')](_0x273d96[_0x4873('0x30')]);_0x4eed3a['filters']=_[_0x4873('0x32')](_0x4eed3a[_0x4873('0x2e')],_0x4eed3a['query']);_0xa51b32['attributes']=_[_0x4873('0x32')](_0x4eed3a[_0x4873('0x2e')],qs[_0x4873('0x33')](_0x273d96[_0x4873('0x30')][_0x4873('0x33')]));_0xa51b32[_0x4873('0x34')]=_0xa51b32['attributes'][_0x4873('0x35')]?_0xa51b32['attributes']:_0x4eed3a[_0x4873('0x2e')];if(!_0x273d96[_0x4873('0x30')][_0x4873('0x36')](_0x4873('0x37'))){_0xa51b32[_0x4873('0x1c')]=qs[_0x4873('0x1c')](_0x273d96[_0x4873('0x30')][_0x4873('0x1c')]);_0xa51b32['offset']=qs[_0x4873('0x1a')](_0x273d96[_0x4873('0x30')][_0x4873('0x1a')]);}_0xa51b32[_0x4873('0x38')]=qs[_0x4873('0x39')](_0x273d96['query'][_0x4873('0x39')]);_0xa51b32[_0x4873('0x3a')]=qs[_0x4873('0x3b')](_[_0x4873('0x3c')](_0x273d96[_0x4873('0x30')],_0x4eed3a[_0x4873('0x3b')]),_0x503932);if(_0x273d96['query']['filter']){_0xa51b32[_0x4873('0x3a')]=_[_0x4873('0x3d')](_0xa51b32[_0x4873('0x3a')],{'$or':_['map'](_0x503932,function(_0x297663){if(_0x297663[_0x4873('0x2c')]!==_0x4873('0x3e')){var _0x449c05={};_0x449c05[_0x297663[_0x4873('0x27')]]={'$like':'%'+_0x273d96[_0x4873('0x30')][_0x4873('0x3f')]+'%'};return _0x449c05;}})});}_0xa51b32=_[_0x4873('0x3d')]({},_0xa51b32,_0x273d96[_0x4873('0x40')]);var _0x6f51cc={'where':_0xa51b32[_0x4873('0x3a')]};return db[_0x4873('0x2a')][_0x4873('0x1d')](_0x6f51cc)[_0x4873('0x23')](function(_0x10ea10){_0x48cc41[_0x4873('0x1d')]=_0x10ea10;if(_0x273d96[_0x4873('0x30')][_0x4873('0x41')]){_0xa51b32[_0x4873('0x42')]=[{'all':!![]}];}return db[_0x4873('0x2a')][_0x4873('0x43')](_0xa51b32);})[_0x4873('0x23')](function(_0x39009e){_0x48cc41[_0x4873('0x44')]=_0x39009e;return _0x48cc41;})[_0x4873('0x23')](respondWithFilteredResult(_0x2a0bde,_0xa51b32))[_0x4873('0x45')](handleError(_0x2a0bde,null));};exports[_0x4873('0x46')]=function(_0x1ac337,_0x4d0d38){var _0x405706={'raw':![],'where':{'id':_0x1ac337['params']['id']}},_0x482835={};_0x482835['model']=_['keys'](db['IntegrationReport'][_0x4873('0x47')]);_0x482835[_0x4873('0x30')]=_[_0x4873('0x31')](_0x1ac337['query']);_0x482835[_0x4873('0x3b')]=_[_0x4873('0x32')](_0x482835['model'],_0x482835[_0x4873('0x30')]);_0x405706[_0x4873('0x34')]=_[_0x4873('0x32')](_0x482835[_0x4873('0x2e')],qs['fields'](_0x1ac337[_0x4873('0x30')][_0x4873('0x33')]));_0x405706['attributes']=_0x405706[_0x4873('0x34')][_0x4873('0x35')]?_0x405706[_0x4873('0x34')]:_0x482835[_0x4873('0x2e')];if(_0x1ac337[_0x4873('0x30')][_0x4873('0x41')]){_0x405706[_0x4873('0x42')]=[{'all':!![]}];}_0x405706=_[_0x4873('0x3d')]({},_0x405706,_0x1ac337[_0x4873('0x40')]);return db['IntegrationReport'][_0x4873('0x48')](_0x405706)[_0x4873('0x23')](handleEntityNotFound(_0x4d0d38,null))[_0x4873('0x23')](respondWithResult(_0x4d0d38,null))[_0x4873('0x45')](handleError(_0x4d0d38,null));};exports[_0x4873('0x49')]=function(_0x1ee17b,_0x271456){return db[_0x4873('0x2a')][_0x4873('0x49')](_0x1ee17b['body'],{})[_0x4873('0x23')](respondWithResult(_0x271456,0xc9))['catch'](handleError(_0x271456,null));};exports[_0x4873('0x22')]=function(_0x3d2f55,_0x215031){if(_0x3d2f55[_0x4873('0x4a')]['id']){delete _0x3d2f55[_0x4873('0x4a')]['id'];}return db[_0x4873('0x2a')][_0x4873('0x48')]({'where':{'id':_0x3d2f55[_0x4873('0x4b')]['id']}})[_0x4873('0x23')](handleEntityNotFound(_0x215031,null))[_0x4873('0x23')](saveUpdates(_0x3d2f55[_0x4873('0x4a')],null))[_0x4873('0x23')](respondWithResult(_0x215031,null))['catch'](handleError(_0x215031,null));};exports[_0x4873('0x24')]=function(_0x4de141,_0x30e528){return db['IntegrationReport'][_0x4873('0x48')]({'where':{'id':_0x4de141[_0x4873('0x4b')]['id']}})[_0x4873('0x23')](handleEntityNotFound(_0x30e528,null))[_0x4873('0x23')](removeEntity(_0x30e528,null))[_0x4873('0x45')](handleError(_0x30e528,null));};exports[_0x4873('0x4c')]=function(_0x3bfc97,_0x249ab8){return db[_0x4873('0x2a')][_0x4873('0x4c')]()['then'](respondWithResult(_0x249ab8,null))[_0x4873('0x45')](handleError(_0x249ab8,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 84645af..22591be 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 _0xaa8b=['../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xfe0e7,_0x30ee3c){var _0x48ba4c=function(_0x384ad4){while(--_0x384ad4){_0xfe0e7['push'](_0xfe0e7['shift']());}};_0x48ba4c(++_0x30ee3c);}(_0xaa8b,0x19b));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbaa8('0x0'));var util=require(_0xbaa8('0x1'));var logger=require(_0xbaa8('0x2'))(_0xbaa8('0x3'));var moment=require(_0xbaa8('0x4'));var BPromise=require(_0xbaa8('0x5'));var rp=require(_0xbaa8('0x6'));var fs=require('fs');var path=require(_0xbaa8('0x7'));var rimraf=require(_0xbaa8('0x8'));var config=require(_0xbaa8('0x9'));var attributes=require(_0xbaa8('0xa'));module['exports']=function(_0x59b9df,_0x509656){return _0x59b9df[_0xbaa8('0xb')](_0xbaa8('0xc'),attributes,{'tableName':_0xbaa8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4687=['exports','define','IntegrationReport','report_integration','util','../../config/logger','moment','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x554ced,_0x45ff90){var _0x2c90c2=function(_0x58334b){while(--_0x58334b){_0x554ced['push'](_0x554ced['shift']());}};_0x2c90c2(++_0x45ff90);}(_0x4687,0x14e));var _0x7468=function(_0x25bc01,_0x160704){_0x25bc01=_0x25bc01-0x0;var _0x33bcb4=_0x4687[_0x25bc01];return _0x33bcb4;};'use strict';var _=require('lodash');var util=require(_0x7468('0x0'));var logger=require(_0x7468('0x1'))('api');var moment=require(_0x7468('0x2'));var BPromise=require('bluebird');var rp=require(_0x7468('0x3'));var fs=require('fs');var path=require(_0x7468('0x4'));var rimraf=require('rimraf');var config=require(_0x7468('0x5'));var attributes=require(_0x7468('0x6'));module[_0x7468('0x7')]=function(_0x229b2b,_0x21beca){return _0x229b2b[_0x7468('0x8')](_0x7468('0x9'),attributes,{'tableName':_0x7468('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 705bcd3..082c6aa 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 _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0xbe8efe,_0x196a0f){var _0x1a2d7e=function(_0x65f9c1){while(--_0x65f9c1){_0xbe8efe['push'](_0xbe8efe['shift']());}};_0x1a2d7e(++_0x196a0f);}(_0x1261,0x144));var _0x1126=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x1261[_0x4e93a9];return _0x43013c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x550bb1,_0x1fda56){var _0x455f8e=function(_0x47f082){while(--_0x47f082){_0x550bb1['push'](_0x550bb1['shift']());}};_0x455f8e(++_0x1fda56);}(_0x2542,0x169));var _0x2254=function(_0x3c5f1a,_0x558e94){_0x3c5f1a=_0x3c5f1a-0x0;var _0x178d7b=_0x2542[_0x3c5f1a];return _0x178d7b;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index edd944c..93fdf81 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 _0xfa12=['addInterval','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','post','create'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x2b0aef,_0x1fe494){_0x2b0aef=_0x2b0aef-0x0;var _0x3d01fd=_0xfa12[_0x2b0aef];return _0x3d01fd;};'use strict';var multer=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var path=require(_0x2fa1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa1('0x3')]();var fs_extra=require(_0x2fa1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa1('0x5'));var controller=require(_0x2fa1('0x6'));router[_0x2fa1('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fa1('0x8')]);router['get'](_0x2fa1('0x9'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xb')]);router[_0x2fa1('0x7')](_0x2fa1('0xc'),auth[_0x2fa1('0xa')](),controller['getIntervals']);router[_0x2fa1('0xd')]('/',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xe')]);router[_0x2fa1('0xd')](_0x2fa1('0xc'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xf')]);router[_0x2fa1('0xd')]('/:id/sub_intervals/create_many',auth[_0x2fa1('0xa')](),controller['addIntervals']);router[_0x2fa1('0x10')]('/:id',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x11')]);router[_0x2fa1('0x12')](_0x2fa1('0x9'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3809=['update','delete','util','path','connect-timeout','Router','fs-extra','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addIntervals','put'];(function(_0x100a3e,_0xe7e174){var _0x5ca2d0=function(_0x14cbc8){while(--_0x14cbc8){_0x100a3e['push'](_0x100a3e['shift']());}};_0x5ca2d0(++_0xe7e174);}(_0x3809,0xca));var _0x9380=function(_0x3296c2,_0x252bab){_0x3296c2=_0x3296c2-0x0;var _0x189101=_0x3809[_0x3296c2];return _0x189101;};'use strict';var multer=require('multer');var util=require(_0x9380('0x0'));var path=require(_0x9380('0x1'));var timeout=require(_0x9380('0x2'));var express=require('express');var router=express[_0x9380('0x3')]();var fs_extra=require(_0x9380('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9380('0x5'));var controller=require(_0x9380('0x6'));router[_0x9380('0x7')]('/',auth[_0x9380('0x8')](),controller[_0x9380('0x9')]);router[_0x9380('0x7')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller[_0x9380('0xb')]);router[_0x9380('0x7')](_0x9380('0xc'),auth['isAuthenticated'](),controller[_0x9380('0xd')]);router[_0x9380('0xe')]('/',auth['isAuthenticated'](),controller[_0x9380('0xf')]);router[_0x9380('0xe')]('/:id/sub_intervals',auth[_0x9380('0x8')](),controller['addInterval']);router[_0x9380('0xe')]('/:id/sub_intervals/create_many',auth[_0x9380('0x8')](),controller[_0x9380('0x10')]);router[_0x9380('0x11')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller[_0x9380('0x12')]);router[_0x9380('0x13')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 25b8819..ff9adcc 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 _0xf3cc=['STRING','sequelize','exports'];(function(_0x44ae2b,_0x6e30bb){var _0x512b65=function(_0x59c37c){while(--_0x59c37c){_0x44ae2b['push'](_0x44ae2b['shift']());}};_0x512b65(++_0x6e30bb);}(_0xf3cc,0x70));var _0xcf3c=function(_0x13ebfc,_0x4313a6){_0x13ebfc=_0x13ebfc-0x0;var _0x3f069e=_0xf3cc[_0x13ebfc];return _0x3f069e;};'use strict';var Sequelize=require(_0xcf3c('0x0'));module[_0xcf3c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcf3c('0x2')]},'interval':{'type':Sequelize[_0xcf3c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf7f4=['STRING'];(function(_0x340910,_0x281f94){var _0x26c9da=function(_0x1a8717){while(--_0x1a8717){_0x340910['push'](_0x340910['shift']());}};_0x26c9da(++_0x281f94);}(_0xf7f4,0x1d7));var _0x4f7f=function(_0x5b79c6,_0x4f5871){_0x5b79c6=_0x5b79c6-0x0;var _0x2b9850=_0xf7f4[_0x5b79c6];return _0x2b9850;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4f7f('0x0')]},'description':{'type':Sequelize[_0x4f7f('0x0')]},'interval':{'type':Sequelize[_0x4f7f('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 76dba86..8879011 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 _0xa529=['bulkCreate','findAll','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','limit','offset','count','set','json','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','IntervalId','getIntervals','findOne','addIntervals','sequelize'];(function(_0x56762b,_0x5e2ddd){var _0x179344=function(_0x171dff){while(--_0x171dff){_0x56762b['push'](_0x56762b['shift']());}};_0x179344(++_0x5e2ddd);}(_0xa529,0x16e));var _0x9a52=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa529[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a52('0x0'));var zipdir=require(_0x9a52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a52('0x2'));var moment=require('moment');var BPromise=require(_0x9a52('0x3'));var Mustache=require(_0x9a52('0x4'));var util=require(_0x9a52('0x5'));var path=require(_0x9a52('0x6'));var sox=require('sox');var csv=require(_0x9a52('0x7'));var ejs=require(_0x9a52('0x8'));var fs=require('fs');var fs_extra=require(_0x9a52('0x9'));var _=require(_0x9a52('0xa'));var squel=require(_0x9a52('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a52('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a52('0xd'));var Redis=require(_0x9a52('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9a52('0xf'));var as=require(_0x9a52('0x10'));var hardwareService=require(_0x9a52('0x11'));var logger=require(_0x9a52('0x12'))(_0x9a52('0x13'));var utils=require(_0x9a52('0x14'));var config=require(_0x9a52('0x15'));var licenseUtil=require(_0x9a52('0x16'));var db=require(_0x9a52('0x17'))['db'];var extensions=require(_0x9a52('0x18'));function respondWithStatusCode(_0x44f59d,_0x3859b2){_0x3859b2=_0x3859b2||0xcc;return function(_0x5a0b83){if(_0x5a0b83){return _0x44f59d['sendStatus'](_0x3859b2);}return _0x44f59d[_0x9a52('0x19')](_0x3859b2)[_0x9a52('0x1a')]();};}function respondWithResult(_0x532dcf,_0x6f47a0){_0x6f47a0=_0x6f47a0||0xc8;return function(_0x4b48b1){if(_0x4b48b1){return _0x532dcf[_0x9a52('0x19')](_0x6f47a0)['json'](_0x4b48b1);}};}function respondWithFilteredResult(_0x54cd28,_0x498fd9){return function(_0x2adb6a){if(_0x2adb6a){var _0x4b9557=typeof _0x498fd9['offset']==='undefined'&&typeof _0x498fd9[_0x9a52('0x1b')]==='undefined';var _0x3a16c8=_0x2adb6a['count'];var _0x10a5c2=_0x4b9557?0x0:_0x498fd9[_0x9a52('0x1c')];var _0xf210b3=_0x4b9557?_0x2adb6a[_0x9a52('0x1d')]:_0x498fd9[_0x9a52('0x1c')]+_0x498fd9[_0x9a52('0x1b')];var _0x280f59;if(_0xf210b3>=_0x3a16c8){_0xf210b3=_0x3a16c8;_0x280f59=0xc8;}else{_0x280f59=0xce;}_0x54cd28[_0x9a52('0x19')](_0x280f59);return _0x54cd28[_0x9a52('0x1e')]('Content-Range',_0x10a5c2+'-'+_0xf210b3+'/'+_0x3a16c8)[_0x9a52('0x1f')](_0x2adb6a);}return null;};}function patchUpdates(_0x4b0307){return function(_0x2d78c4){try{jsonpatch[_0x9a52('0x20')](_0x2d78c4,_0x4b0307,!![]);}catch(_0x21209f){return BPromise[_0x9a52('0x21')](_0x21209f);}return _0x2d78c4[_0x9a52('0x22')]();};}function saveUpdates(_0xd18a1a,_0x12790f){return function(_0x45a8ba){if(_0x45a8ba){return _0x45a8ba['update'](_0xd18a1a)[_0x9a52('0x23')](function(_0x20262f){return _0x20262f;});}return null;};}function removeEntity(_0x45d27f,_0x40a51b){return function(_0x5a98fd){if(_0x5a98fd){return _0x5a98fd[_0x9a52('0x24')]()[_0x9a52('0x23')](function(){var _0x3d7e48=_0x5a98fd[_0x9a52('0x25')]({'plain':!![]});var _0x14a737='Intervals';return db[_0x9a52('0x26')]['destroy']({'where':{'type':_0x14a737,'resourceId':_0x3d7e48['id']}})[_0x9a52('0x23')](function(){return _0x5a98fd;});})[_0x9a52('0x23')](function(){_0x45d27f[_0x9a52('0x19')](0xcc)[_0x9a52('0x1a')]();});}};}function handleEntityNotFound(_0x2c9a0a,_0x1e3a37){return function(_0x1c6d43){if(!_0x1c6d43){_0x2c9a0a[_0x9a52('0x27')](0x194);}return _0x1c6d43;};}function handleError(_0x3f3abc,_0x11bbcb){_0x11bbcb=_0x11bbcb||0x1f4;return function(_0x1115e5){logger['error'](_0x1115e5[_0x9a52('0x28')]);if(_0x1115e5[_0x9a52('0x29')]){delete _0x1115e5[_0x9a52('0x29')];}_0x3f3abc[_0x9a52('0x19')](_0x11bbcb)[_0x9a52('0x2a')](_0x1115e5);};}exports[_0x9a52('0x2b')]=function(_0x24564f,_0x5bf319){var _0x186057={},_0x370a3b={},_0x41ff24={'count':0x0,'rows':[]};var _0x1d4607=_[_0x9a52('0x2c')](db[_0x9a52('0x2d')][_0x9a52('0x2e')],function(_0x476cc7){return{'name':_0x476cc7[_0x9a52('0x2f')],'type':_0x476cc7[_0x9a52('0x30')][_0x9a52('0x31')]};});_0x370a3b['model']=_[_0x9a52('0x2c')](_0x1d4607,_0x9a52('0x29'));_0x370a3b[_0x9a52('0x32')]=_[_0x9a52('0x33')](_0x24564f[_0x9a52('0x32')]);_0x370a3b[_0x9a52('0x34')]=_[_0x9a52('0x35')](_0x370a3b['model'],_0x370a3b[_0x9a52('0x32')]);_0x186057['attributes']=_['intersection'](_0x370a3b['model'],qs[_0x9a52('0x36')](_0x24564f[_0x9a52('0x32')][_0x9a52('0x36')]));_0x186057[_0x9a52('0x37')]=_0x186057[_0x9a52('0x37')]['length']?_0x186057[_0x9a52('0x37')]:_0x370a3b[_0x9a52('0x38')];if(!_0x24564f[_0x9a52('0x32')][_0x9a52('0x39')](_0x9a52('0x3a'))){_0x186057[_0x9a52('0x1b')]=qs[_0x9a52('0x1b')](_0x24564f[_0x9a52('0x32')]['limit']);_0x186057[_0x9a52('0x1c')]=qs[_0x9a52('0x1c')](_0x24564f[_0x9a52('0x32')]['offset']);}_0x186057[_0x9a52('0x3b')]=qs[_0x9a52('0x3c')](_0x24564f[_0x9a52('0x32')]['sort']);_0x186057[_0x9a52('0x3d')]=qs[_0x9a52('0x34')](_[_0x9a52('0x3e')](_0x24564f[_0x9a52('0x32')],_0x370a3b[_0x9a52('0x34')]),_0x1d4607);if(_0x24564f['query'][_0x9a52('0x3f')]){_0x186057[_0x9a52('0x3d')]=_[_0x9a52('0x40')](_0x186057['where'],{'$or':_[_0x9a52('0x2c')](_0x1d4607,function(_0xd8ec){if(_0xd8ec[_0x9a52('0x30')]!==_0x9a52('0x41')){var _0x384b47={};_0x384b47[_0xd8ec[_0x9a52('0x29')]]={'$like':'%'+_0x24564f[_0x9a52('0x32')][_0x9a52('0x3f')]+'%'};return _0x384b47;}})});}_0x186057=_['merge']({},_0x186057,_0x24564f[_0x9a52('0x42')]);var _0x5b8e14={'where':_0x186057[_0x9a52('0x3d')]};return db[_0x9a52('0x2d')][_0x9a52('0x1d')](_0x5b8e14)['then'](function(_0x419a3a){_0x41ff24['count']=_0x419a3a;if(_0x24564f['query']['includeAll']){_0x186057[_0x9a52('0x43')]=[{'all':!![]}];}return db[_0x9a52('0x2d')]['findAll'](_0x186057);})['then'](function(_0x1a93b5){_0x41ff24[_0x9a52('0x44')]=_0x1a93b5;return _0x41ff24;})['then'](respondWithFilteredResult(_0x5bf319,_0x186057))['catch'](handleError(_0x5bf319,null));};exports['show']=function(_0x131d08,_0x4b7bb8){var _0x5e8416={'raw':!![],'where':{'id':_0x131d08[_0x9a52('0x45')]['id']}},_0x22cbc7={};_0x22cbc7[_0x9a52('0x38')]=_[_0x9a52('0x33')](db[_0x9a52('0x2d')][_0x9a52('0x2e')]);_0x22cbc7[_0x9a52('0x32')]=_[_0x9a52('0x33')](_0x131d08['query']);_0x22cbc7[_0x9a52('0x34')]=_[_0x9a52('0x35')](_0x22cbc7['model'],_0x22cbc7[_0x9a52('0x32')]);_0x5e8416['attributes']=_['intersection'](_0x22cbc7[_0x9a52('0x38')],qs[_0x9a52('0x36')](_0x131d08[_0x9a52('0x32')][_0x9a52('0x36')]));_0x5e8416[_0x9a52('0x37')]=_0x5e8416[_0x9a52('0x37')][_0x9a52('0x46')]?_0x5e8416['attributes']:_0x22cbc7['model'];if(_0x131d08['query'][_0x9a52('0x47')]){_0x5e8416[_0x9a52('0x43')]=[{'all':!![]}];}_0x5e8416=_[_0x9a52('0x40')]({},_0x5e8416,_0x131d08[_0x9a52('0x42')]);return db['Interval'][_0x9a52('0x48')](_0x5e8416)['then'](handleEntityNotFound(_0x4b7bb8,null))[_0x9a52('0x23')](respondWithResult(_0x4b7bb8,null))['catch'](handleError(_0x4b7bb8,null));};exports[_0x9a52('0x49')]=function(_0x4189e8,_0xfc7052){return db['Interval'][_0x9a52('0x49')](_0x4189e8[_0x9a52('0x4a')],{})[_0x9a52('0x23')](function(_0xc3160e){var _0x39329e=_0x4189e8[_0x9a52('0x4b')][_0x9a52('0x25')]({'plain':!![]});if(!_0x39329e)throw new Error(_0x9a52('0x4c'));if(_0x39329e['role']===_0x9a52('0x4b')){var _0x5ca0a9=_0xc3160e[_0x9a52('0x25')]({'plain':!![]});var _0x46a45c='Intervals';return db[_0x9a52('0x4d')][_0x9a52('0x48')]({'where':{'name':_0x46a45c,'userProfileId':_0x39329e[_0x9a52('0x4e')]},'raw':!![]})[_0x9a52('0x23')](function(_0x5b01f8){if(_0x5b01f8&&_0x5b01f8[_0x9a52('0x4f')]===0x0){return db[_0x9a52('0x26')]['create']({'name':_0x5ca0a9['name'],'resourceId':_0x5ca0a9['id'],'type':_0x5b01f8[_0x9a52('0x29')],'sectionId':_0x5b01f8['id']},{})['then'](function(){return _0xc3160e;});}else{return _0xc3160e;}})['catch'](function(_0x30c0ce){logger[_0x9a52('0x50')](_0x9a52('0x51'),_0x30c0ce);throw _0x30c0ce;});}return _0xc3160e;})[_0x9a52('0x23')](respondWithResult(_0xfc7052,0xc9))[_0x9a52('0x52')](handleError(_0xfc7052,null));};exports[_0x9a52('0x53')]=function(_0x2733ed,_0x40ea8c){if(_0x2733ed[_0x9a52('0x4a')]['id']){delete _0x2733ed[_0x9a52('0x4a')]['id'];}return db['Interval'][_0x9a52('0x48')]({'where':{'id':_0x2733ed[_0x9a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x40ea8c,null))['then'](saveUpdates(_0x2733ed[_0x9a52('0x4a')],null))['then'](respondWithResult(_0x40ea8c,null))['catch'](handleError(_0x40ea8c,null));};exports[_0x9a52('0x24')]=function(_0x4661b2,_0x341672){return db[_0x9a52('0x2d')][_0x9a52('0x48')]({'where':{'id':_0x4661b2['params']['id']}})[_0x9a52('0x23')](handleEntityNotFound(_0x341672,null))['then'](removeEntity(_0x341672,null))[_0x9a52('0x52')](handleError(_0x341672,null));};exports['addInterval']=function(_0x2b65e5,_0x1b06ae,_0xc0c3d9){if(_0x2b65e5[_0x9a52('0x4a')]['id']){delete _0x2b65e5[_0x9a52('0x4a')]['id'];}return db[_0x9a52('0x2d')][_0x9a52('0x48')]({'where':{'id':_0x2b65e5['params']['id']}})['then'](handleEntityNotFound(_0x1b06ae,null))[_0x9a52('0x23')](function(_0x266816){if(_0x266816){_0x2b65e5[_0x9a52('0x4a')][_0x9a52('0x54')]=_0x266816['id'];return db[_0x9a52('0x2d')]['create'](_0x2b65e5['body']);}})['then'](respondWithResult(_0x1b06ae,null))[_0x9a52('0x52')](handleError(_0x1b06ae,null));};exports[_0x9a52('0x55')]=function(_0x231502,_0x47c25e,_0x245cbb){var _0x2cf7e4={};var _0x34f788={};var _0x59d621;var _0x27327e;return db[_0x9a52('0x2d')][_0x9a52('0x56')]({'where':{'id':_0x231502[_0x9a52('0x45')]['id']}})[_0x9a52('0x23')](handleEntityNotFound(_0x47c25e,null))[_0x9a52('0x23')](function(_0x242956){if(_0x242956){_0x59d621=_0x242956;_0x34f788[_0x9a52('0x38')]=_['keys'](db[_0x9a52('0x2d')][_0x9a52('0x2e')]);_0x34f788[_0x9a52('0x32')]=_[_0x9a52('0x33')](_0x231502[_0x9a52('0x32')]);_0x34f788[_0x9a52('0x34')]=_[_0x9a52('0x35')](_0x34f788['model'],_0x34f788[_0x9a52('0x32')]);_0x2cf7e4[_0x9a52('0x37')]=_[_0x9a52('0x35')](_0x34f788[_0x9a52('0x38')],qs['fields'](_0x231502[_0x9a52('0x32')]['fields']));_0x2cf7e4[_0x9a52('0x37')]=_0x2cf7e4[_0x9a52('0x37')][_0x9a52('0x46')]?_0x2cf7e4[_0x9a52('0x37')]:_0x34f788[_0x9a52('0x38')];_0x2cf7e4[_0x9a52('0x3b')]=qs[_0x9a52('0x3c')](_0x231502[_0x9a52('0x32')]['sort']);_0x2cf7e4[_0x9a52('0x3d')]=qs[_0x9a52('0x34')](_[_0x9a52('0x3e')](_0x231502[_0x9a52('0x32')],_0x34f788[_0x9a52('0x34')]));if(_0x231502[_0x9a52('0x32')][_0x9a52('0x3f')]){_0x2cf7e4['where']=_[_0x9a52('0x40')](_0x2cf7e4[_0x9a52('0x3d')],{'$or':_['map'](_0x2cf7e4[_0x9a52('0x37')],function(_0x3029dc){var _0x28ac45={};_0x28ac45[_0x3029dc]={'$like':'%'+_0x231502['query'][_0x9a52('0x3f')]+'%'};return _0x28ac45;})});}_0x2cf7e4=_[_0x9a52('0x40')]({},_0x2cf7e4,_0x231502['options']);return _0x59d621[_0x9a52('0x55')](_0x2cf7e4);}})[_0x9a52('0x23')](function(_0x561969){if(_0x561969){_0x27327e=_0x561969[_0x9a52('0x46')];if(!_0x231502['query'][_0x9a52('0x39')](_0x9a52('0x3a'))){_0x2cf7e4[_0x9a52('0x1b')]=qs[_0x9a52('0x1b')](_0x231502[_0x9a52('0x32')][_0x9a52('0x1b')]);_0x2cf7e4['offset']=qs[_0x9a52('0x1c')](_0x231502['query'][_0x9a52('0x1c')]);}return _0x59d621[_0x9a52('0x55')](_0x2cf7e4);}})[_0x9a52('0x23')](function(_0x39eebb){if(_0x39eebb){return _0x39eebb?{'count':_0x27327e,'rows':_0x39eebb}:null;}})[_0x9a52('0x23')](respondWithResult(_0x47c25e,null))[_0x9a52('0x52')](handleError(_0x47c25e,null));};exports[_0x9a52('0x57')]=function(_0x56a520,_0xa70674,_0x235f59){return db[_0x9a52('0x2d')][_0x9a52('0x56')]({'where':{'id':_0x56a520[_0x9a52('0x45')]['id']}})[_0x9a52('0x23')](handleEntityNotFound(_0xa70674,null))[_0x9a52('0x23')](function(_0x535a90){if(_0x535a90){return db[_0x9a52('0x58')]['transaction'](function(_0x22d954){return db['Interval']['destroy']({'where':{'IntervalId':_0x56a520[_0x9a52('0x45')]['id']},'transaction':_0x22d954})['then'](function(_0x126676){var _0x3b6cc4=_[_0x9a52('0x2c')](_0x56a520['body'],function(_0x44a5f6){delete _0x44a5f6['id'];_0x44a5f6[_0x9a52('0x54')]=_0x56a520[_0x9a52('0x45')]['id'];return _0x44a5f6;});return db[_0x9a52('0x2d')][_0x9a52('0x59')](_0x3b6cc4,{'transaction':_0x22d954});});})[_0x9a52('0x23')](function(){return db[_0x9a52('0x2d')][_0x9a52('0x5a')]({'where':{'IntervalId':_0x56a520['params']['id']}});});}})[_0x9a52('0x23')](respondWithResult(_0xa70674,null))[_0x9a52('0x52')](handleError(_0xa70674,null));}; \ No newline at end of file +var _0x7871=['ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','Interval','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','order','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','papaparse'];(function(_0x3e575b,_0x1e3273){var _0x2eb74e=function(_0x53535c){while(--_0x53535c){_0x3e575b['push'](_0x3e575b['shift']());}};_0x2eb74e(++_0x1e3273);}(_0x7871,0xa1));var _0x1787=function(_0x5ad92b,_0x431e6d){_0x5ad92b=_0x5ad92b-0x0;var _0x3ea5c5=_0x7871[_0x5ad92b];return _0x3ea5c5;};'use strict';var emlformat=require(_0x1787('0x0'));var rimraf=require(_0x1787('0x1'));var zipdir=require(_0x1787('0x2'));var jsonpatch=require(_0x1787('0x3'));var rp=require('request-promise');var moment=require(_0x1787('0x4'));var BPromise=require(_0x1787('0x5'));var Mustache=require('mustache');var util=require(_0x1787('0x6'));var path=require(_0x1787('0x7'));var sox=require(_0x1787('0x8'));var csv=require(_0x1787('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1787('0xa'));var Redis=require(_0x1787('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1787('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1787('0xd'))(_0x1787('0xe'));var utils=require(_0x1787('0xf'));var config=require(_0x1787('0x10'));var licenseUtil=require(_0x1787('0x11'));var db=require(_0x1787('0x12'))['db'];var extensions=require(_0x1787('0x13'));function respondWithStatusCode(_0x4546ed,_0x3a32f1){_0x3a32f1=_0x3a32f1||0xcc;return function(_0x1688b8){if(_0x1688b8){return _0x4546ed[_0x1787('0x14')](_0x3a32f1);}return _0x4546ed[_0x1787('0x15')](_0x3a32f1)[_0x1787('0x16')]();};}function respondWithResult(_0x31ab73,_0x4d41ca){_0x4d41ca=_0x4d41ca||0xc8;return function(_0x38282d){if(_0x38282d){return _0x31ab73[_0x1787('0x15')](_0x4d41ca)[_0x1787('0x17')](_0x38282d);}};}function respondWithFilteredResult(_0x1b0343,_0x2432a4){return function(_0x35684e){if(_0x35684e){var _0x51dca4=typeof _0x2432a4[_0x1787('0x18')]===_0x1787('0x19')&&typeof _0x2432a4['limit']===_0x1787('0x19');var _0x4fa5d9=_0x35684e[_0x1787('0x1a')];var _0x3066aa=_0x51dca4?0x0:_0x2432a4[_0x1787('0x18')];var _0x5253f4=_0x51dca4?_0x35684e['count']:_0x2432a4['offset']+_0x2432a4['limit'];var _0x2eb3b3;if(_0x5253f4>=_0x4fa5d9){_0x5253f4=_0x4fa5d9;_0x2eb3b3=0xc8;}else{_0x2eb3b3=0xce;}_0x1b0343[_0x1787('0x15')](_0x2eb3b3);return _0x1b0343[_0x1787('0x1b')](_0x1787('0x1c'),_0x3066aa+'-'+_0x5253f4+'/'+_0x4fa5d9)[_0x1787('0x17')](_0x35684e);}return null;};}function patchUpdates(_0x324dd1){return function(_0x157e2a){try{jsonpatch[_0x1787('0x1d')](_0x157e2a,_0x324dd1,!![]);}catch(_0x12ee92){return BPromise['reject'](_0x12ee92);}return _0x157e2a['save']();};}function saveUpdates(_0x4c03ca,_0x3782e6){return function(_0x49146a){if(_0x49146a){return _0x49146a[_0x1787('0x1e')](_0x4c03ca)[_0x1787('0x1f')](function(_0x492e44){return _0x492e44;});}return null;};}function removeEntity(_0x13c917,_0x5cbcfa){return function(_0x3df794){if(_0x3df794){return _0x3df794[_0x1787('0x20')]()[_0x1787('0x1f')](function(){var _0x1c1903=_0x3df794[_0x1787('0x21')]({'plain':!![]});var _0xf8e78f=_0x1787('0x22');return db[_0x1787('0x23')][_0x1787('0x20')]({'where':{'type':_0xf8e78f,'resourceId':_0x1c1903['id']}})[_0x1787('0x1f')](function(){return _0x3df794;});})[_0x1787('0x1f')](function(){_0x13c917[_0x1787('0x15')](0xcc)[_0x1787('0x16')]();});}};}function handleEntityNotFound(_0x26be28,_0xcb1178){return function(_0xa2a59e){if(!_0xa2a59e){_0x26be28['sendStatus'](0x194);}return _0xa2a59e;};}function handleError(_0x12b4d3,_0x3bdb73){_0x3bdb73=_0x3bdb73||0x1f4;return function(_0x50e8ea){logger[_0x1787('0x24')](_0x50e8ea['stack']);if(_0x50e8ea['name']){delete _0x50e8ea[_0x1787('0x25')];}_0x12b4d3['status'](_0x3bdb73)[_0x1787('0x26')](_0x50e8ea);};}exports[_0x1787('0x27')]=function(_0x8a3d71,_0x23995a){var _0x2a5493={},_0x4bef13={},_0x124735={'count':0x0,'rows':[]};var _0x173819=_['map'](db['Interval'][_0x1787('0x28')],function(_0x527262){return{'name':_0x527262[_0x1787('0x29')],'type':_0x527262[_0x1787('0x2a')][_0x1787('0x2b')]};});_0x4bef13['model']=_[_0x1787('0x2c')](_0x173819,_0x1787('0x25'));_0x4bef13[_0x1787('0x2d')]=_[_0x1787('0x2e')](_0x8a3d71[_0x1787('0x2d')]);_0x4bef13['filters']=_[_0x1787('0x2f')](_0x4bef13['model'],_0x4bef13['query']);_0x2a5493[_0x1787('0x30')]=_[_0x1787('0x2f')](_0x4bef13['model'],qs[_0x1787('0x31')](_0x8a3d71[_0x1787('0x2d')]['fields']));_0x2a5493[_0x1787('0x30')]=_0x2a5493[_0x1787('0x30')][_0x1787('0x32')]?_0x2a5493[_0x1787('0x30')]:_0x4bef13[_0x1787('0x33')];if(!_0x8a3d71[_0x1787('0x2d')][_0x1787('0x34')](_0x1787('0x35'))){_0x2a5493[_0x1787('0x36')]=qs[_0x1787('0x36')](_0x8a3d71['query'][_0x1787('0x36')]);_0x2a5493['offset']=qs[_0x1787('0x18')](_0x8a3d71[_0x1787('0x2d')][_0x1787('0x18')]);}_0x2a5493['order']=qs['sort'](_0x8a3d71[_0x1787('0x2d')][_0x1787('0x37')]);_0x2a5493['where']=qs[_0x1787('0x38')](_[_0x1787('0x39')](_0x8a3d71[_0x1787('0x2d')],_0x4bef13['filters']),_0x173819);if(_0x8a3d71[_0x1787('0x2d')][_0x1787('0x3a')]){_0x2a5493[_0x1787('0x3b')]=_[_0x1787('0x3c')](_0x2a5493['where'],{'$or':_['map'](_0x173819,function(_0xe8d0fa){if(_0xe8d0fa[_0x1787('0x2a')]!==_0x1787('0x3d')){var _0x488768={};_0x488768[_0xe8d0fa[_0x1787('0x25')]]={'$like':'%'+_0x8a3d71[_0x1787('0x2d')]['filter']+'%'};return _0x488768;}})});}_0x2a5493=_[_0x1787('0x3c')]({},_0x2a5493,_0x8a3d71[_0x1787('0x3e')]);var _0x714ea1={'where':_0x2a5493[_0x1787('0x3b')]};return db[_0x1787('0x3f')][_0x1787('0x1a')](_0x714ea1)[_0x1787('0x1f')](function(_0x83758b){_0x124735[_0x1787('0x1a')]=_0x83758b;if(_0x8a3d71[_0x1787('0x2d')]['includeAll']){_0x2a5493[_0x1787('0x40')]=[{'all':!![]}];}return db[_0x1787('0x3f')][_0x1787('0x41')](_0x2a5493);})[_0x1787('0x1f')](function(_0x365006){_0x124735[_0x1787('0x42')]=_0x365006;return _0x124735;})['then'](respondWithFilteredResult(_0x23995a,_0x2a5493))[_0x1787('0x43')](handleError(_0x23995a,null));};exports['show']=function(_0x24c6d4,_0x1ddf73){var _0x545c9a={'raw':!![],'where':{'id':_0x24c6d4['params']['id']}},_0x49cf44={};_0x49cf44[_0x1787('0x33')]=_[_0x1787('0x2e')](db[_0x1787('0x3f')][_0x1787('0x28')]);_0x49cf44['query']=_['keys'](_0x24c6d4[_0x1787('0x2d')]);_0x49cf44['filters']=_['intersection'](_0x49cf44[_0x1787('0x33')],_0x49cf44[_0x1787('0x2d')]);_0x545c9a['attributes']=_[_0x1787('0x2f')](_0x49cf44[_0x1787('0x33')],qs[_0x1787('0x31')](_0x24c6d4[_0x1787('0x2d')][_0x1787('0x31')]));_0x545c9a[_0x1787('0x30')]=_0x545c9a[_0x1787('0x30')]['length']?_0x545c9a[_0x1787('0x30')]:_0x49cf44[_0x1787('0x33')];if(_0x24c6d4['query'][_0x1787('0x44')]){_0x545c9a[_0x1787('0x40')]=[{'all':!![]}];}_0x545c9a=_[_0x1787('0x3c')]({},_0x545c9a,_0x24c6d4['options']);return db[_0x1787('0x3f')][_0x1787('0x45')](_0x545c9a)['then'](handleEntityNotFound(_0x1ddf73,null))[_0x1787('0x1f')](respondWithResult(_0x1ddf73,null))['catch'](handleError(_0x1ddf73,null));};exports[_0x1787('0x46')]=function(_0x484e01,_0x426664){return db[_0x1787('0x3f')][_0x1787('0x46')](_0x484e01[_0x1787('0x47')],{})[_0x1787('0x1f')](function(_0x35ca57){var _0x20bdac=_0x484e01[_0x1787('0x48')][_0x1787('0x21')]({'plain':!![]});if(!_0x20bdac)throw new Error(_0x1787('0x49'));if(_0x20bdac['role']===_0x1787('0x48')){var _0x5ef7b9=_0x35ca57[_0x1787('0x21')]({'plain':!![]});var _0x156405=_0x1787('0x22');return db[_0x1787('0x4a')]['find']({'where':{'name':_0x156405,'userProfileId':_0x20bdac[_0x1787('0x4b')]},'raw':!![]})['then'](function(_0x3bdbf2){if(_0x3bdbf2&&_0x3bdbf2[_0x1787('0x4c')]===0x0){return db[_0x1787('0x23')][_0x1787('0x46')]({'name':_0x5ef7b9[_0x1787('0x25')],'resourceId':_0x5ef7b9['id'],'type':_0x3bdbf2['name'],'sectionId':_0x3bdbf2['id']},{})['then'](function(){return _0x35ca57;});}else{return _0x35ca57;}})['catch'](function(_0x3f6a50){logger['error'](_0x1787('0x4d'),_0x3f6a50);throw _0x3f6a50;});}return _0x35ca57;})[_0x1787('0x1f')](respondWithResult(_0x426664,0xc9))['catch'](handleError(_0x426664,null));};exports[_0x1787('0x1e')]=function(_0x294c22,_0x2aff5c){if(_0x294c22[_0x1787('0x47')]['id']){delete _0x294c22[_0x1787('0x47')]['id'];}return db[_0x1787('0x3f')][_0x1787('0x45')]({'where':{'id':_0x294c22['params']['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x2aff5c,null))[_0x1787('0x1f')](saveUpdates(_0x294c22['body'],null))[_0x1787('0x1f')](respondWithResult(_0x2aff5c,null))[_0x1787('0x43')](handleError(_0x2aff5c,null));};exports[_0x1787('0x20')]=function(_0x3ded06,_0x5cc6c6){return db[_0x1787('0x3f')]['find']({'where':{'id':_0x3ded06[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x5cc6c6,null))[_0x1787('0x1f')](removeEntity(_0x5cc6c6,null))['catch'](handleError(_0x5cc6c6,null));};exports['addInterval']=function(_0x4ea1a2,_0x268d10,_0x2c13c2){if(_0x4ea1a2[_0x1787('0x47')]['id']){delete _0x4ea1a2[_0x1787('0x47')]['id'];}return db[_0x1787('0x3f')][_0x1787('0x45')]({'where':{'id':_0x4ea1a2[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x268d10,null))[_0x1787('0x1f')](function(_0x321b00){if(_0x321b00){_0x4ea1a2[_0x1787('0x47')][_0x1787('0x4f')]=_0x321b00['id'];return db[_0x1787('0x3f')][_0x1787('0x46')](_0x4ea1a2[_0x1787('0x47')]);}})['then'](respondWithResult(_0x268d10,null))['catch'](handleError(_0x268d10,null));};exports[_0x1787('0x50')]=function(_0x2a6c6b,_0x2d5603,_0x2c1447){var _0x354ba6={};var _0x18a8da={};var _0x4f5fbb;var _0x3e2e1a;return db[_0x1787('0x3f')]['findOne']({'where':{'id':_0x2a6c6b[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x2d5603,null))[_0x1787('0x1f')](function(_0x3aedb7){if(_0x3aedb7){_0x4f5fbb=_0x3aedb7;_0x18a8da[_0x1787('0x33')]=_[_0x1787('0x2e')](db[_0x1787('0x3f')]['rawAttributes']);_0x18a8da[_0x1787('0x2d')]=_[_0x1787('0x2e')](_0x2a6c6b[_0x1787('0x2d')]);_0x18a8da[_0x1787('0x38')]=_['intersection'](_0x18a8da[_0x1787('0x33')],_0x18a8da['query']);_0x354ba6[_0x1787('0x30')]=_[_0x1787('0x2f')](_0x18a8da[_0x1787('0x33')],qs['fields'](_0x2a6c6b[_0x1787('0x2d')]['fields']));_0x354ba6[_0x1787('0x30')]=_0x354ba6['attributes'][_0x1787('0x32')]?_0x354ba6[_0x1787('0x30')]:_0x18a8da['model'];_0x354ba6[_0x1787('0x51')]=qs[_0x1787('0x37')](_0x2a6c6b[_0x1787('0x2d')]['sort']);_0x354ba6[_0x1787('0x3b')]=qs['filters'](_[_0x1787('0x39')](_0x2a6c6b[_0x1787('0x2d')],_0x18a8da[_0x1787('0x38')]));if(_0x2a6c6b[_0x1787('0x2d')][_0x1787('0x3a')]){_0x354ba6[_0x1787('0x3b')]=_['merge'](_0x354ba6[_0x1787('0x3b')],{'$or':_['map'](_0x354ba6[_0x1787('0x30')],function(_0x541a53){var _0x266627={};_0x266627[_0x541a53]={'$like':'%'+_0x2a6c6b[_0x1787('0x2d')][_0x1787('0x3a')]+'%'};return _0x266627;})});}_0x354ba6=_[_0x1787('0x3c')]({},_0x354ba6,_0x2a6c6b[_0x1787('0x3e')]);return _0x4f5fbb[_0x1787('0x50')](_0x354ba6);}})[_0x1787('0x1f')](function(_0x172533){if(_0x172533){_0x3e2e1a=_0x172533[_0x1787('0x32')];if(!_0x2a6c6b['query'][_0x1787('0x34')](_0x1787('0x35'))){_0x354ba6[_0x1787('0x36')]=qs[_0x1787('0x36')](_0x2a6c6b['query'][_0x1787('0x36')]);_0x354ba6[_0x1787('0x18')]=qs['offset'](_0x2a6c6b[_0x1787('0x2d')]['offset']);}return _0x4f5fbb[_0x1787('0x50')](_0x354ba6);}})[_0x1787('0x1f')](function(_0x4e910c){if(_0x4e910c){return _0x4e910c?{'count':_0x3e2e1a,'rows':_0x4e910c}:null;}})[_0x1787('0x1f')](respondWithResult(_0x2d5603,null))[_0x1787('0x43')](handleError(_0x2d5603,null));};exports['addIntervals']=function(_0xd5d9d4,_0x24ef1f,_0x3454d3){return db[_0x1787('0x3f')][_0x1787('0x52')]({'where':{'id':_0xd5d9d4[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x24ef1f,null))[_0x1787('0x1f')](function(_0x38d583){if(_0x38d583){return db[_0x1787('0x53')][_0x1787('0x54')](function(_0x35c47d){return db[_0x1787('0x3f')][_0x1787('0x20')]({'where':{'IntervalId':_0xd5d9d4[_0x1787('0x4e')]['id']},'transaction':_0x35c47d})[_0x1787('0x1f')](function(_0x23e90d){var _0x59e6c5=_[_0x1787('0x2c')](_0xd5d9d4[_0x1787('0x47')],function(_0x2c8a37){delete _0x2c8a37['id'];_0x2c8a37[_0x1787('0x4f')]=_0xd5d9d4[_0x1787('0x4e')]['id'];return _0x2c8a37;});return db[_0x1787('0x3f')][_0x1787('0x55')](_0x59e6c5,{'transaction':_0x35c47d});});})[_0x1787('0x1f')](function(){return db[_0x1787('0x3f')][_0x1787('0x41')]({'where':{'IntervalId':_0xd5d9d4[_0x1787('0x4e')]['id']}});});}})[_0x1787('0x1f')](respondWithResult(_0x24ef1f,null))[_0x1787('0x43')](handleError(_0x24ef1f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e2f82b9..fdd40c4 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 _0x94ed=['path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x34a459,_0x136cd9){var _0x500f8b=function(_0xdcad7f){while(--_0xdcad7f){_0x34a459['push'](_0x34a459['shift']());}};_0x500f8b(++_0x136cd9);}(_0x94ed,0xbd));var _0xd94e=function(_0x47f8d2,_0x259040){_0x47f8d2=_0x47f8d2-0x0;var _0x5b31bb=_0x94ed[_0x47f8d2];return _0x5b31bb;};'use strict';var _=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var logger=require(_0xd94e('0x2'))(_0xd94e('0x3'));var moment=require(_0xd94e('0x4'));var BPromise=require(_0xd94e('0x5'));var rp=require(_0xd94e('0x6'));var fs=require('fs');var path=require(_0xd94e('0x7'));var rimraf=require('rimraf');var config=require(_0xd94e('0x8'));var attributes=require(_0xd94e('0x9'));var extensions=require(_0xd94e('0xa'));module[_0xd94e('0xb')]=function(_0x115922,_0x5dd48a){return _0x115922[_0xd94e('0xc')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2165c4,_0x299671){extensions[_0xd94e('0xd')](_0x115922,_0x2165c4);},'afterBulkCreate':function(_0x284739,_0x4242ff,_0x32ab23){_0x32ab23();extensions['rewrite'](_0x115922,_0x284739[0x0]);},'afterUpdate':function(_0x4e168b,_0x290db9){extensions[_0xd94e('0xd')](_0x115922,_0x4e168b);},'afterDestroy':function(_0x4b6935,_0x19c27a){extensions['rewrite'](_0x115922,_0x4b6935);}}});}; \ No newline at end of file +var _0x5232=['path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x21860b,_0x41febf){var _0x4ff351=function(_0xf8c13f){while(--_0xf8c13f){_0x21860b['push'](_0x21860b['shift']());}};_0x4ff351(++_0x41febf);}(_0x5232,0x1c9));var _0x2523=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x5232[_0x29d6e6];return _0xc75ff0;};'use strict';var _=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var logger=require(_0x2523('0x2'))(_0x2523('0x3'));var moment=require(_0x2523('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2523('0x5'));var rimraf=require(_0x2523('0x6'));var config=require('../../config/environment');var attributes=require(_0x2523('0x7'));var extensions=require(_0x2523('0x8'));module[_0x2523('0x9')]=function(_0x45ae69,_0x3ab139){return _0x45ae69[_0x2523('0xa')](_0x2523('0xb'),attributes,{'tableName':_0x2523('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x251973,_0x39dca8){extensions[_0x2523('0xd')](_0x45ae69,_0x251973);},'afterBulkCreate':function(_0x30f2cd,_0x55e5bb,_0x1e6087){_0x1e6087();extensions[_0x2523('0xd')](_0x45ae69,_0x30f2cd[0x0]);},'afterUpdate':function(_0xb076a8,_0x2f6bf5){extensions[_0x2523('0xd')](_0x45ae69,_0xb076a8);},'afterDestroy':function(_0x3ea8fa,_0x5856d2){extensions[_0x2523('0xd')](_0x45ae69,_0x3ea8fa);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f357f16..de56df4 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(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_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 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 ab99106..dcc504f 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x26296d,_0x8ee019){var _0xf36c03=function(_0x276ed3){while(--_0x276ed3){_0x26296d['push'](_0x26296d['shift']());}};_0xf36c03(++_0x8ee019);}(_0xdb28,0x106));var _0x8db2=function(_0x3a7706,_0x1e7c46){_0x3a7706=_0x3a7706-0x0;var _0xac0807=_0xdb28[_0x3a7706];return _0xac0807;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 4e471b1..eb6ed07 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 _0x5353=['https','support','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket'];(function(_0x1cd633,_0x21c3db){var _0x5bf6d8=function(_0x19de57){while(--_0x19de57){_0x1cd633['push'](_0x1cd633['shift']());}};_0x5bf6d8(++_0x21c3db);}(_0x5353,0x195));var _0x3535=function(_0x43d098,_0x553346){_0x43d098=_0x43d098-0x0;var _0x2461c3=_0x5353[_0x43d098];return _0x2461c3;};'use strict';var BPromise=require('bluebird');var https=require(_0x3535('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0x3535('0x1');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2018dc,_0x36a975){var _0x5f310f={'fields':{'project':{'key':_0x2018dc[_0x3535('0x2')]||_0x3535('0x3')},'summary':(_0x2018dc[_0x3535('0x4')]||'Report')+_0x3535('0x5')+_0x2018dc['ip'],'description':_0x2018dc[_0x3535('0x6')]||JSON[_0x3535('0x7')](_0x2018dc),'issuetype':{'name':_0x2018dc[_0x3535('0x8')]||_0x3535('0x9')}}};_0x5f310f[_0x3535('0xa')][_0x3535('0xb')]=_0x2018dc[_0x3535('0xc')];_0x5f310f[_0x3535('0xa')][_0x3535('0xd')]=_0x2018dc[_0x3535('0xe')];_0x5f310f['fields'][_0x3535('0xf')]=_0x2018dc[_0x3535('0x10')];_0x5f310f[_0x3535('0xa')][_0x3535('0x11')]=_0x2018dc[_0x3535('0x12')];_0x5f310f['fields']['customfield_11504']=_0x2018dc[_0x3535('0x13')];_0x5f310f[_0x3535('0xa')]['customfield_10102']=_0x2018dc['ip'];var _0x1db09c={'host':_0x3535('0x14'),'port':0x1bb,'path':_0x3535('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3535('0x16'),'Authorization':_0x3535('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3535('0x18'))}};var _0x435471=JSON[_0x3535('0x7')](_0x5f310f);var _0x5bc689=https[_0x3535('0x19')](_0x1db09c,function(_0x5a0aba){_0x5a0aba[_0x3535('0x1a')](_0x3535('0x1b'));var _0x341cb3='';_0x5a0aba['on'](_0x3535('0x1c'),function(_0x2fc35e){_0x341cb3+=_0x2fc35e;});_0x5a0aba['on'](_0x3535('0x1d'),function(){if(_0x36a975){return _0x36a975[_0x3535('0x1e')](_0x5a0aba[_0x3535('0x1f')])['json'](JSON[_0x3535('0x20')](_0x341cb3));}});});_0x5bc689['on']('error',function(_0x1ca1eb){if(_0x36a975){return _0x36a975[_0x3535('0x1e')](0x1f4)[_0x3535('0x21')]({'errors':[{'message':_0x3535('0x22'),'type':_0x3535('0x23')}]});}});_0x5bc689[_0x3535('0x24')](_0x435471);_0x5bc689[_0x3535('0x1d')]();}exports[_0x3535('0x25')]=openIssue;exports[_0x3535('0x26')]=function(_0x363557,_0xcf9d19){_0x363557[_0x3535('0x27')]['ip']=_0x363557[_0x3535('0x28')][_0x3535('0x29')]||_0x363557[_0x3535('0x2a')][_0x3535('0x2b')]||_0x363557[_0x3535('0x2c')][_0x3535('0x2b')]||_0x363557[_0x3535('0x2a')]['socket'][_0x3535('0x2b')];return openIssue(_0x363557['body'],_0xcf9d19);}; \ No newline at end of file +var _0x02ac=['application/json','request','setEncoding','data','end','json','parse','status','api.jira','openIssue','body','headers','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue'];(function(_0xeedbcc,_0x42f007){var _0x4a9b38=function(_0x3ad27b){while(--_0x3ad27b){_0xeedbcc['push'](_0xeedbcc['shift']());}};_0x4a9b38(++_0x42f007);}(_0x02ac,0xff));var _0xc02a=function(_0x1f5e05,_0x522d89){_0x1f5e05=_0x1f5e05-0x0;var _0x5d42c8=_0x02ac[_0x1f5e05];return _0x5d42c8;};'use strict';var BPromise=require(_0xc02a('0x0'));var https=require(_0xc02a('0x1'));var logger=require(_0xc02a('0x2'))(_0xc02a('0x3'));var USERNAME=_0xc02a('0x4');var PASSWORD=_0xc02a('0x5');function openIssue(_0x3311f3,_0x2570d6){var _0x33aa74={'fields':{'project':{'key':_0x3311f3[_0xc02a('0x6')]||_0xc02a('0x7')},'summary':(_0x3311f3[_0xc02a('0x8')]||_0xc02a('0x9'))+_0xc02a('0xa')+_0x3311f3['ip'],'description':_0x3311f3[_0xc02a('0xb')]||JSON[_0xc02a('0xc')](_0x3311f3),'issuetype':{'name':_0x3311f3[_0xc02a('0xd')]||_0xc02a('0xe')}}};_0x33aa74[_0xc02a('0xf')]['customfield_11500']=_0x3311f3[_0xc02a('0x10')];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x11')]=_0x3311f3[_0xc02a('0x12')];_0x33aa74[_0xc02a('0xf')]['customfield_11502']=_0x3311f3[_0xc02a('0x13')];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x14')]=_0x3311f3[_0xc02a('0x15')];_0x33aa74['fields'][_0xc02a('0x16')]=_0x3311f3['reason'];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x17')]=_0x3311f3['ip'];var _0x27b5d8={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc02a('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xc02a('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x3cd259=JSON['stringify'](_0x33aa74);var _0x2d04b6=https[_0xc02a('0x1a')](_0x27b5d8,function(_0x2ddf04){_0x2ddf04[_0xc02a('0x1b')]('utf8');var _0x5c07f0='';_0x2ddf04['on'](_0xc02a('0x1c'),function(_0x7c49d){_0x5c07f0+=_0x7c49d;});_0x2ddf04['on'](_0xc02a('0x1d'),function(){if(_0x2570d6){return _0x2570d6['status'](_0x2ddf04['statusCode'])[_0xc02a('0x1e')](JSON[_0xc02a('0x1f')](_0x5c07f0));}});});_0x2d04b6['on']('error',function(_0x588c4d){if(_0x2570d6){return _0x2570d6[_0xc02a('0x20')](0x1f4)[_0xc02a('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xc02a('0x21')}]});}});_0x2d04b6['write'](_0x3cd259);_0x2d04b6[_0xc02a('0x1d')]();}exports[_0xc02a('0x22')]=openIssue;exports['send']=function(_0x394161,_0x29e021){_0x394161[_0xc02a('0x23')]['ip']=_0x394161[_0xc02a('0x24')]['x-forwarded-for']||_0x394161['connection'][_0xc02a('0x25')]||_0x394161[_0xc02a('0x26')]['remoteAddress']||_0x394161[_0xc02a('0x27')][_0xc02a('0x26')][_0xc02a('0x25')];return openIssue(_0x394161['body'],_0x29e021);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5f7b83b..3209821 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 _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x4c13f0,_0x5e4b35){var _0x27ec90=function(_0x10e4e6){while(--_0x10e4e6){_0x4c13f0['push'](_0x4c13f0['shift']());}};_0x27ec90(++_0x5e4b35);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1b3776,_0x37e1a1){_0x1b3776=_0x1b3776-0x0;var _0x31798e=_0xf4eb[_0x1b3776];return _0x31798e;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file +var _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xf109,0xce));var _0x9f10=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf109[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index e3a4995..50ba5a7 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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a54,0x106));var _0x47a5=function(_0x2be91a,_0x50429d){_0x2be91a=_0x2be91a-0x0;var _0xbd1525=_0x7a54[_0x2be91a];return _0xbd1525;};'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(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x161f9f,_0x311f5d){_0x161f9f=_0x161f9f-0x0;var _0x5d9d6c=_0x7a54[_0x161f9f];return _0x5d9d6c;};'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 971215f..450bb7e 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 _0x6011=['ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0xab0d5c,_0x1981b2){var _0x1edcd1=function(_0x573a95){while(--_0x573a95){_0xab0d5c['push'](_0xab0d5c['shift']());}};_0x1edcd1(++_0x1981b2);}(_0x6011,0x196));var _0x1601=function(_0x38c82a,_0x22a176){_0x38c82a=_0x38c82a-0x0;var _0xfd0528=_0x6011[_0x38c82a];return _0xfd0528;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1601('0x0'));var BPromise=require(_0x1601('0x1'));var Mustache=require('mustache');var util=require(_0x1601('0x2'));var path=require(_0x1601('0x3'));var sox=require(_0x1601('0x4'));var csv=require(_0x1601('0x5'));var ejs=require(_0x1601('0x6'));var fs=require('fs');var fs_extra=require(_0x1601('0x7'));var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x5'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1601('0x10'))('api');var utils=require(_0x1601('0x11'));var config=require(_0x1601('0x12'));var licenseUtil=require(_0x1601('0x13'));var db=require(_0x1601('0x14'))['db'];function respondWithStatusCode(_0x263bef,_0x322025){_0x322025=_0x322025||0xcc;return function(_0x3ac50b){if(_0x3ac50b){return _0x263bef[_0x1601('0x15')](_0x322025);}return _0x263bef['status'](_0x322025)[_0x1601('0x16')]();};}function respondWithResult(_0x555d4f,_0x4705f0){_0x4705f0=_0x4705f0||0xc8;return function(_0x5d642d){if(_0x5d642d){return _0x555d4f[_0x1601('0x17')](_0x4705f0)[_0x1601('0x18')](_0x5d642d);}};}function respondWithFilteredResult(_0x4bb5c1,_0x1b40be){return function(_0x39873a){if(_0x39873a){var _0x12ddb0=typeof _0x1b40be['offset']==='undefined'&&typeof _0x1b40be[_0x1601('0x19')]===_0x1601('0x1a');var _0x3621e2=_0x39873a[_0x1601('0x1b')];var _0x1d8563=_0x12ddb0?0x0:_0x1b40be[_0x1601('0x1c')];var _0x23b992=_0x12ddb0?_0x39873a[_0x1601('0x1b')]:_0x1b40be[_0x1601('0x1c')]+_0x1b40be['limit'];var _0x4d077e;if(_0x23b992>=_0x3621e2){_0x23b992=_0x3621e2;_0x4d077e=0xc8;}else{_0x4d077e=0xce;}_0x4bb5c1[_0x1601('0x17')](_0x4d077e);return _0x4bb5c1[_0x1601('0x1d')](_0x1601('0x1e'),_0x1d8563+'-'+_0x23b992+'/'+_0x3621e2)['json'](_0x39873a);}return null;};}function patchUpdates(_0x2c3b5d){return function(_0x380157){try{jsonpatch[_0x1601('0x1f')](_0x380157,_0x2c3b5d,!![]);}catch(_0x2e2e0d){return BPromise[_0x1601('0x20')](_0x2e2e0d);}return _0x380157['save']();};}function saveUpdates(_0x1b8314,_0x296023){return function(_0x220313){if(_0x220313){return _0x220313['update'](_0x1b8314)[_0x1601('0x21')](function(_0x330033){return _0x330033;});}return null;};}function removeEntity(_0x4f918b,_0x2b01da){return function(_0xa8e856){if(_0xa8e856){return _0xa8e856['destroy']()['then'](function(){_0x4f918b[_0x1601('0x17')](0xcc)[_0x1601('0x16')]();});}};}function handleEntityNotFound(_0x34d021,_0x4919f2){return function(_0x362f51){if(!_0x362f51){_0x34d021[_0x1601('0x15')](0x194);}return _0x362f51;};}function handleError(_0x23a6a9,_0x250fcc){_0x250fcc=_0x250fcc||0x1f4;return function(_0x296c34){logger['error'](_0x296c34['stack']);if(_0x296c34[_0x1601('0x22')]){delete _0x296c34[_0x1601('0x22')];}_0x23a6a9[_0x1601('0x17')](_0x250fcc)['send'](_0x296c34);};}exports[_0x1601('0x23')]=function(_0x57eb42,_0x2dcbc9){var _0x3c6bc1={},_0x389f0f={},_0x4d4d0b={'count':0x0,'rows':[]};var _0x388530=_[_0x1601('0x24')](db[_0x1601('0x25')][_0x1601('0x26')],function(_0x5cdcfb){return{'name':_0x5cdcfb[_0x1601('0x27')],'type':_0x5cdcfb[_0x1601('0x28')][_0x1601('0x29')]};});_0x389f0f[_0x1601('0x2a')]=_[_0x1601('0x24')](_0x388530,_0x1601('0x22'));_0x389f0f[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x57eb42[_0x1601('0x2b')]);_0x389f0f[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],_0x389f0f[_0x1601('0x2b')]);_0x3c6bc1['attributes']=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x2f')]));_0x3c6bc1['attributes']=_0x3c6bc1[_0x1601('0x30')][_0x1601('0x31')]?_0x3c6bc1['attributes']:_0x389f0f[_0x1601('0x2a')];if(!_0x57eb42['query'][_0x1601('0x32')](_0x1601('0x33'))){_0x3c6bc1['limit']=qs[_0x1601('0x19')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x19')]);_0x3c6bc1[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x1c')]);}_0x3c6bc1['order']=qs[_0x1601('0x34')](_0x57eb42[_0x1601('0x2b')]['sort']);_0x3c6bc1['where']=qs[_0x1601('0x2d')](_[_0x1601('0x35')](_0x57eb42[_0x1601('0x2b')],_0x389f0f[_0x1601('0x2d')]),_0x388530);if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x36')]){_0x3c6bc1[_0x1601('0x37')]=_['merge'](_0x3c6bc1[_0x1601('0x37')],{'$or':_[_0x1601('0x24')](_0x388530,function(_0x482379){if(_0x482379['type']!==_0x1601('0x38')){var _0x52034d={};_0x52034d[_0x482379['name']]={'$like':'%'+_0x57eb42['query'][_0x1601('0x36')]+'%'};return _0x52034d;}})});}_0x3c6bc1=_[_0x1601('0x39')]({},_0x3c6bc1,_0x57eb42[_0x1601('0x3a')]);var _0xb8146e={'where':_0x3c6bc1[_0x1601('0x37')]};return db[_0x1601('0x25')][_0x1601('0x1b')](_0xb8146e)[_0x1601('0x21')](function(_0x388f3b){_0x4d4d0b[_0x1601('0x1b')]=_0x388f3b;if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3c6bc1[_0x1601('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x1601('0x3d')](_0x3c6bc1);})['then'](function(_0x5acf66){_0x4d4d0b['rows']=_0x5acf66;return _0x4d4d0b;})[_0x1601('0x21')](respondWithFilteredResult(_0x2dcbc9,_0x3c6bc1))[_0x1601('0x3e')](handleError(_0x2dcbc9,null));};exports[_0x1601('0x3f')]=function(_0x5a06dc,_0x581941){var _0x3aef1a={'raw':!![],'where':{'id':_0x5a06dc[_0x1601('0x40')]['id']}},_0x3ce65d={};_0x3ce65d['model']=_[_0x1601('0x2c')](db['JscriptyAnswerReport'][_0x1601('0x26')]);_0x3ce65d[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x5a06dc[_0x1601('0x2b')]);_0x3ce65d['filters']=_[_0x1601('0x2e')](_0x3ce65d['model'],_0x3ce65d[_0x1601('0x2b')]);_0x3aef1a[_0x1601('0x30')]=_['intersection'](_0x3ce65d[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x5a06dc[_0x1601('0x2b')]['fields']));_0x3aef1a[_0x1601('0x30')]=_0x3aef1a['attributes'][_0x1601('0x31')]?_0x3aef1a[_0x1601('0x30')]:_0x3ce65d[_0x1601('0x2a')];if(_0x5a06dc[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3aef1a[_0x1601('0x3c')]=[{'all':!![]}];}_0x3aef1a=_[_0x1601('0x39')]({},_0x3aef1a,_0x5a06dc[_0x1601('0x3a')]);return db[_0x1601('0x25')]['find'](_0x3aef1a)[_0x1601('0x21')](handleEntityNotFound(_0x581941,null))['then'](respondWithResult(_0x581941,null))[_0x1601('0x3e')](handleError(_0x581941,null));};exports[_0x1601('0x41')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x25')]['create'](_0x4a8039[_0x1601('0x42')],{})[_0x1601('0x21')](respondWithResult(_0xbaeefc,0xc9))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x43')]=function(_0x30f2bf,_0xf14c98){if(_0x30f2bf[_0x1601('0x42')]['id']){delete _0x30f2bf[_0x1601('0x42')]['id'];}return db[_0x1601('0x25')][_0x1601('0x44')]({'where':{'id':_0x30f2bf['params']['id']}})[_0x1601('0x21')](handleEntityNotFound(_0xf14c98,null))['then'](saveUpdates(_0x30f2bf[_0x1601('0x42')],null))[_0x1601('0x21')](respondWithResult(_0xf14c98,null))[_0x1601('0x3e')](handleError(_0xf14c98,null));};exports['destroy']=function(_0x56b904,_0x26ba09){return db[_0x1601('0x25')]['find']({'where':{'id':_0x56b904['params']['id']}})['then'](handleEntityNotFound(_0x26ba09,null))[_0x1601('0x21')](removeEntity(_0x26ba09,null))['catch'](handleError(_0x26ba09,null));};exports[_0x1601('0x45')]=function(_0x174eee,_0x50edf3){return db[_0x1601('0x25')]['describe']()['then'](respondWithResult(_0x50edf3,null))[_0x1601('0x3e')](handleError(_0x50edf3,null));}; \ No newline at end of file +var _0xc474=['fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','JscriptyAnswerReport','rawAttributes'];(function(_0x49e7ca,_0xa937c7){var _0x50c225=function(_0x2cbde2){while(--_0x2cbde2){_0x49e7ca['push'](_0x49e7ca['shift']());}};_0x50c225(++_0xa937c7);}(_0xc474,0xfc));var _0x4c47=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xc474[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0x4c47('0x0'));var rimraf=require(_0x4c47('0x1'));var zipdir=require(_0x4c47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c47('0x3'));var moment=require(_0x4c47('0x4'));var BPromise=require(_0x4c47('0x5'));var Mustache=require(_0x4c47('0x6'));var util=require(_0x4c47('0x7'));var path=require(_0x4c47('0x8'));var sox=require(_0x4c47('0x9'));var csv=require(_0x4c47('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c47('0xb'));var squel=require(_0x4c47('0xc'));var crypto=require(_0x4c47('0xd'));var jsforce=require(_0x4c47('0xe'));var deskjs=require(_0x4c47('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4c47('0x10'));var Papa=require(_0x4c47('0x11'));var Redis=require('ioredis');var authService=require(_0x4c47('0x12'));var qs=require(_0x4c47('0x13'));var as=require(_0x4c47('0x14'));var hardwareService=require(_0x4c47('0x15'));var logger=require('../../config/logger')(_0x4c47('0x16'));var utils=require('../../config/utils');var config=require(_0x4c47('0x17'));var licenseUtil=require(_0x4c47('0x18'));var db=require(_0x4c47('0x19'))['db'];function respondWithStatusCode(_0x496e7b,_0x429553){_0x429553=_0x429553||0xcc;return function(_0x16a4fd){if(_0x16a4fd){return _0x496e7b['sendStatus'](_0x429553);}return _0x496e7b[_0x4c47('0x1a')](_0x429553)['end']();};}function respondWithResult(_0x3d1b6a,_0x121f9e){_0x121f9e=_0x121f9e||0xc8;return function(_0x25d4dc){if(_0x25d4dc){return _0x3d1b6a[_0x4c47('0x1a')](_0x121f9e)['json'](_0x25d4dc);}};}function respondWithFilteredResult(_0xb53c24,_0x78f26b){return function(_0x16c7a9){if(_0x16c7a9){var _0xd162cc=typeof _0x78f26b['offset']==='undefined'&&typeof _0x78f26b['limit']===_0x4c47('0x1b');var _0x92a444=_0x16c7a9[_0x4c47('0x1c')];var _0x5727cf=_0xd162cc?0x0:_0x78f26b[_0x4c47('0x1d')];var _0x254dfc=_0xd162cc?_0x16c7a9[_0x4c47('0x1c')]:_0x78f26b[_0x4c47('0x1d')]+_0x78f26b['limit'];var _0x4cc984;if(_0x254dfc>=_0x92a444){_0x254dfc=_0x92a444;_0x4cc984=0xc8;}else{_0x4cc984=0xce;}_0xb53c24['status'](_0x4cc984);return _0xb53c24[_0x4c47('0x1e')](_0x4c47('0x1f'),_0x5727cf+'-'+_0x254dfc+'/'+_0x92a444)[_0x4c47('0x20')](_0x16c7a9);}return null;};}function patchUpdates(_0x3b156f){return function(_0x52de60){try{jsonpatch[_0x4c47('0x21')](_0x52de60,_0x3b156f,!![]);}catch(_0x27b61a){return BPromise[_0x4c47('0x22')](_0x27b61a);}return _0x52de60[_0x4c47('0x23')]();};}function saveUpdates(_0x20950c,_0x40a984){return function(_0x4d56eb){if(_0x4d56eb){return _0x4d56eb['update'](_0x20950c)['then'](function(_0x1a575a){return _0x1a575a;});}return null;};}function removeEntity(_0x275a10,_0x4d110d){return function(_0x3037a2){if(_0x3037a2){return _0x3037a2['destroy']()[_0x4c47('0x24')](function(){_0x275a10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592469,_0x3bacc9){return function(_0x3bd199){if(!_0x3bd199){_0x592469[_0x4c47('0x25')](0x194);}return _0x3bd199;};}function handleError(_0x4eff26,_0x33f440){_0x33f440=_0x33f440||0x1f4;return function(_0x2c0367){logger[_0x4c47('0x26')](_0x2c0367[_0x4c47('0x27')]);if(_0x2c0367[_0x4c47('0x28')]){delete _0x2c0367[_0x4c47('0x28')];}_0x4eff26[_0x4c47('0x1a')](_0x33f440)[_0x4c47('0x29')](_0x2c0367);};}exports['index']=function(_0x36e82b,_0x344a7d){var _0x590b56={},_0x491638={},_0x3b977d={'count':0x0,'rows':[]};var _0x56c130=_['map'](db[_0x4c47('0x2a')][_0x4c47('0x2b')],function(_0x12462a){return{'name':_0x12462a[_0x4c47('0x2c')],'type':_0x12462a[_0x4c47('0x2d')]['key']};});_0x491638[_0x4c47('0x2e')]=_['map'](_0x56c130,_0x4c47('0x28'));_0x491638[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x36e82b['query']);_0x491638['filters']=_['intersection'](_0x491638['model'],_0x491638[_0x4c47('0x2f')]);_0x590b56[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x491638['model'],qs[_0x4c47('0x33')](_0x36e82b['query'][_0x4c47('0x33')]));_0x590b56[_0x4c47('0x31')]=_0x590b56[_0x4c47('0x31')][_0x4c47('0x34')]?_0x590b56[_0x4c47('0x31')]:_0x491638[_0x4c47('0x2e')];if(!_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x35')]('nolimit')){_0x590b56[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x36')]);_0x590b56['offset']=qs['offset'](_0x36e82b['query'][_0x4c47('0x1d')]);}_0x590b56[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x36e82b['query']['sort']);_0x590b56['where']=qs['filters'](_[_0x4c47('0x39')](_0x36e82b[_0x4c47('0x2f')],_0x491638[_0x4c47('0x3a')]),_0x56c130);if(_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x3b')]){_0x590b56['where']=_[_0x4c47('0x3c')](_0x590b56[_0x4c47('0x3d')],{'$or':_['map'](_0x56c130,function(_0x1c309b){if(_0x1c309b[_0x4c47('0x2d')]!==_0x4c47('0x3e')){var _0x418098={};_0x418098[_0x1c309b[_0x4c47('0x28')]]={'$like':'%'+_0x36e82b['query'][_0x4c47('0x3b')]+'%'};return _0x418098;}})});}_0x590b56=_[_0x4c47('0x3c')]({},_0x590b56,_0x36e82b[_0x4c47('0x3f')]);var _0x291666={'where':_0x590b56[_0x4c47('0x3d')]};return db['JscriptyAnswerReport'][_0x4c47('0x1c')](_0x291666)[_0x4c47('0x24')](function(_0x5a7135){_0x3b977d[_0x4c47('0x1c')]=_0x5a7135;if(_0x36e82b['query'][_0x4c47('0x40')]){_0x590b56[_0x4c47('0x41')]=[{'all':!![]}];}return db[_0x4c47('0x2a')]['findAll'](_0x590b56);})['then'](function(_0x164105){_0x3b977d[_0x4c47('0x42')]=_0x164105;return _0x3b977d;})[_0x4c47('0x24')](respondWithFilteredResult(_0x344a7d,_0x590b56))['catch'](handleError(_0x344a7d,null));};exports[_0x4c47('0x43')]=function(_0x10669d,_0x40057e){var _0x5a0b1f={'raw':!![],'where':{'id':_0x10669d[_0x4c47('0x44')]['id']}},_0x274596={};_0x274596[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db[_0x4c47('0x2a')][_0x4c47('0x2b')]);_0x274596[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x10669d[_0x4c47('0x2f')]);_0x274596[_0x4c47('0x3a')]=_['intersection'](_0x274596[_0x4c47('0x2e')],_0x274596[_0x4c47('0x2f')]);_0x5a0b1f['attributes']=_['intersection'](_0x274596[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x10669d['query'][_0x4c47('0x33')]));_0x5a0b1f[_0x4c47('0x31')]=_0x5a0b1f[_0x4c47('0x31')][_0x4c47('0x34')]?_0x5a0b1f[_0x4c47('0x31')]:_0x274596['model'];if(_0x10669d['query'][_0x4c47('0x40')]){_0x5a0b1f[_0x4c47('0x41')]=[{'all':!![]}];}_0x5a0b1f=_[_0x4c47('0x3c')]({},_0x5a0b1f,_0x10669d[_0x4c47('0x3f')]);return db[_0x4c47('0x2a')][_0x4c47('0x45')](_0x5a0b1f)[_0x4c47('0x24')](handleEntityNotFound(_0x40057e,null))['then'](respondWithResult(_0x40057e,null))[_0x4c47('0x46')](handleError(_0x40057e,null));};exports['create']=function(_0x40bbec,_0x460fef){return db[_0x4c47('0x2a')]['create'](_0x40bbec[_0x4c47('0x47')],{})[_0x4c47('0x24')](respondWithResult(_0x460fef,0xc9))[_0x4c47('0x46')](handleError(_0x460fef,null));};exports['update']=function(_0x125b18,_0x4ccb67){if(_0x125b18[_0x4c47('0x47')]['id']){delete _0x125b18['body']['id'];}return db[_0x4c47('0x2a')]['find']({'where':{'id':_0x125b18[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x4ccb67,null))[_0x4c47('0x24')](saveUpdates(_0x125b18[_0x4c47('0x47')],null))['then'](respondWithResult(_0x4ccb67,null))['catch'](handleError(_0x4ccb67,null));};exports[_0x4c47('0x48')]=function(_0x48ba62,_0x419ee3){return db[_0x4c47('0x2a')][_0x4c47('0x45')]({'where':{'id':_0x48ba62['params']['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x419ee3,null))[_0x4c47('0x24')](removeEntity(_0x419ee3,null))['catch'](handleError(_0x419ee3,null));};exports['describe']=function(_0x59d746,_0x479332){return db[_0x4c47('0x2a')][_0x4c47('0x49')]()[_0x4c47('0x24')](respondWithResult(_0x479332,null))[_0x4c47('0x46')](handleError(_0x479332,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e659d48..40ce6dc 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 _0xd4b9=['JscriptyAnswerReport','lodash','util','api','moment','bluebird','request-promise','exports','define'];(function(_0x388096,_0x50b7c8){var _0x38c620=function(_0x58a1a6){while(--_0x58a1a6){_0x388096['push'](_0x388096['shift']());}};_0x38c620(++_0x50b7c8);}(_0xd4b9,0x1c3));var _0x9d4b=function(_0x39977a,_0x339526){_0x39977a=_0x39977a-0x0;var _0x5622f1=_0xd4b9[_0x39977a];return _0x5622f1;};'use strict';var _=require(_0x9d4b('0x0'));var util=require(_0x9d4b('0x1'));var logger=require('../../config/logger')(_0x9d4b('0x2'));var moment=require(_0x9d4b('0x3'));var BPromise=require(_0x9d4b('0x4'));var rp=require(_0x9d4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x9d4b('0x6')]=function(_0x19d0c1,_0x26a369){return _0x19d0c1[_0x9d4b('0x7')](_0x9d4b('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d1=['bluebird','request-promise','path','rimraf','exports','define','report_jscripty_answers','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa2d1,0x19f));var _0x1a2d=function(_0x3f48e0,_0x453a44){_0x3f48e0=_0x3f48e0-0x0;var _0x2333e1=_0xa2d1[_0x3f48e0];return _0x2333e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1a2d('0x0'));var BPromise=require(_0x1a2d('0x1'));var rp=require(_0x1a2d('0x2'));var fs=require('fs');var path=require(_0x1a2d('0x3'));var rimraf=require(_0x1a2d('0x4'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x1a2d('0x5')]=function(_0x47a2fe,_0x39e59d){return _0x47a2fe[_0x1a2d('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0x1a2d('0x7'),'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 0492e55..b2342d7 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 _0x9d5a=['rpc','jayson/promise','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0x9d5a,0x1a3));var _0xa9d5=function(_0xfaf455,_0x13c0a9){_0xfaf455=_0xfaf455-0x0;var _0x5aaa60=_0x9d5a[_0xfaf455];return _0x5aaa60;};'use strict';var _=require(_0xa9d5('0x0'));var util=require(_0xa9d5('0x1'));var moment=require(_0xa9d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9d5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9d5('0x4'));var logger=require(_0xa9d5('0x5'))(_0xa9d5('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9d5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48f59c,_0x475909,_0x504a40){return new BPromise(function(_0x1693bb,_0x155cf7){return client['request'](_0x48f59c,_0x504a40)['then'](function(_0x572869){logger[_0xa9d5('0x8')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x475909,_0xa9d5('0x9'));logger[_0xa9d5('0xa')](_0xa9d5('0xb'),_0x475909,_0xa9d5('0x9'),JSON['stringify'](_0x572869));if(_0x572869[_0xa9d5('0xc')]){if(_0x572869[_0xa9d5('0xc')][_0xa9d5('0xd')]===0x1f4){logger[_0xa9d5('0xc')](_0xa9d5('0xe'),_0x475909,_0x572869[_0xa9d5('0xc')]['message']);return _0x155cf7(_0x572869[_0xa9d5('0xc')][_0xa9d5('0xf')]);}logger[_0xa9d5('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x475909,_0x572869[_0xa9d5('0xc')][_0xa9d5('0xf')]);return _0x1693bb(_0x572869[_0xa9d5('0xc')][_0xa9d5('0xf')]);}else{logger[_0xa9d5('0x8')](_0xa9d5('0xe'),_0x475909,_0xa9d5('0x9'));_0x1693bb(_0x572869[_0xa9d5('0x10')][_0xa9d5('0xf')]);}})['catch'](function(_0x59bd3d){logger[_0xa9d5('0xc')](_0xa9d5('0xe'),_0x475909,_0x59bd3d);_0x155cf7(_0x59bd3d);});});} \ No newline at end of file +var _0x121d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x121d,0x121));var _0xd121=function(_0x584e75,_0xa30874){_0x584e75=_0x584e75-0x0;var _0x4cfb39=_0x121d[_0x584e75];return _0x4cfb39;};'use strict';var _=require('lodash');var util=require(_0xd121('0x0'));var moment=require(_0xd121('0x1'));var BPromise=require(_0xd121('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd121('0x3'));var db=require(_0xd121('0x4'))['db'];var utils=require(_0xd121('0x5'));var logger=require(_0xd121('0x6'))('rpc');var config=require(_0xd121('0x7'));var jayson=require(_0xd121('0x8'));var client=jayson[_0xd121('0x9')][_0xd121('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c828,_0x431cd0,_0x1ceeb4){return new BPromise(function(_0x29bd3a,_0xafb0e2){return client['request'](_0x24c828,_0x1ceeb4)[_0xd121('0xb')](function(_0x4236b9){logger['info'](_0xd121('0xc'),_0x431cd0,_0xd121('0xd'));logger[_0xd121('0xe')](_0xd121('0xf'),_0x431cd0,'request\x20sent',JSON[_0xd121('0x10')](_0x4236b9));if(_0x4236b9['error']){if(_0x4236b9[_0xd121('0x11')]['code']===0x1f4){logger[_0xd121('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x431cd0,_0x4236b9['error'][_0xd121('0x12')]);return _0xafb0e2(_0x4236b9['error'][_0xd121('0x12')]);}logger[_0xd121('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x431cd0,_0x4236b9[_0xd121('0x11')]['message']);return _0x29bd3a(_0x4236b9[_0xd121('0x11')][_0xd121('0x12')]);}else{logger['info'](_0xd121('0xc'),_0x431cd0,_0xd121('0xd'));_0x29bd3a(_0x4236b9[_0xd121('0x13')][_0xd121('0x12')]);}})[_0xd121('0x14')](function(_0x58fc3e){logger['error'](_0xd121('0xc'),_0x431cd0,_0x58fc3e);_0xafb0e2(_0x58fc3e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6582510..88ea2f7 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 _0xb149=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','util'];(function(_0x1cb94b,_0x576fe5){var _0x39d18e=function(_0x579ffa){while(--_0x579ffa){_0x1cb94b['push'](_0x1cb94b['shift']());}};_0x39d18e(++_0x576fe5);}(_0xb149,0x150));var _0x9b14=function(_0x4bc56e,_0x4f2fc0){_0x4bc56e=_0x4bc56e-0x0;var _0x29c230=_0xb149[_0x4bc56e];return _0x29c230;};'use strict';var multer=require(_0x9b14('0x0'));var util=require(_0x9b14('0x1'));var path=require('path');var timeout=require(_0x9b14('0x2'));var express=require(_0x9b14('0x3'));var router=express[_0x9b14('0x4')]();var fs_extra=require(_0x9b14('0x5'));var auth=require(_0x9b14('0x6'));var interaction=require(_0x9b14('0x7'));var config=require('../../config/environment');var controller=require(_0x9b14('0x8'));router[_0x9b14('0x9')]('/',auth[_0x9b14('0xa')](),controller[_0x9b14('0xb')]);router['get'](_0x9b14('0xc'),auth[_0x9b14('0xa')](),controller[_0x9b14('0xd')]);router[_0x9b14('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x9b14('0xe')]);router['get'](_0x9b14('0xf'),auth[_0x9b14('0xa')](),controller[_0x9b14('0x10')]);router[_0x9b14('0x9')]('/:id/summary',auth[_0x9b14('0xa')](),timeout('30s'),controller[_0x9b14('0x11')]);router[_0x9b14('0x12')]('/',auth['isAuthenticated'](),controller[_0x9b14('0x13')]);router[_0x9b14('0x12')](_0x9b14('0x14'),auth[_0x9b14('0xa')](),controller[_0x9b14('0x15')]);router[_0x9b14('0x16')](_0x9b14('0xc'),auth[_0x9b14('0xa')](),controller['update']);router[_0x9b14('0x17')](_0x9b14('0xc'),auth[_0x9b14('0xa')](),controller[_0x9b14('0x18')]);module[_0x9b14('0x19')]=router; \ No newline at end of file +var _0xf3ba=['isAuthenticated','/:id/answers','/:id/summary','getSummary','post','create','/:id/clone','clone','/:id','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id/sessions'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xf3ba,0x74));var _0xaf3b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf3ba[_0x40bffc];return _0x3007e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf3b('0x0'));var timeout=require('connect-timeout');var express=require(_0xaf3b('0x1'));var router=express[_0xaf3b('0x2')]();var fs_extra=require(_0xaf3b('0x3'));var auth=require(_0xaf3b('0x4'));var interaction=require(_0xaf3b('0x5'));var config=require(_0xaf3b('0x6'));var controller=require('./jscriptyProject.controller');router[_0xaf3b('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf3b('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xaf3b('0x7')](_0xaf3b('0x9'),auth[_0xaf3b('0xa')](),controller['getSessions']);router[_0xaf3b('0x7')](_0xaf3b('0xb'),auth[_0xaf3b('0xa')](),controller['getAnswers']);router[_0xaf3b('0x7')](_0xaf3b('0xc'),auth[_0xaf3b('0xa')](),timeout('30s'),controller[_0xaf3b('0xd')]);router[_0xaf3b('0xe')]('/',auth[_0xaf3b('0xa')](),controller[_0xaf3b('0xf')]);router['post'](_0xaf3b('0x10'),auth[_0xaf3b('0xa')](),controller[_0xaf3b('0x11')]);router['put'](_0xaf3b('0x12'),auth['isAuthenticated'](),controller[_0xaf3b('0x13')]);router['delete'](_0xaf3b('0x12'),auth['isAuthenticated'](),controller[_0xaf3b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 0ae6da2..c5db7fe 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 _0x8e98=['isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','TEXT','long'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8e98,0xbd));var _0x88e9=function(_0x19ce7a,_0x35ccb2){_0x19ce7a=_0x19ce7a-0x0;var _0xae087d=_0x8e98[_0x19ce7a];return _0xae087d;};'use strict';var Sequelize=require(_0x88e9('0x0'));var _=require('lodash');var util=require(_0x88e9('0x1'));module[_0x88e9('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x88e9('0x3')]},'formData':{'type':Sequelize[_0x88e9('0x4')](_0x88e9('0x5')),'set':function(_0x502d4b){if(_[_0x88e9('0x6')](_0x502d4b)){this[_0x88e9('0x7')](_0x88e9('0x8'),JSON[_0x88e9('0x9')](_0x502d4b));}else if(_['isString'](_0x502d4b)){this[_0x88e9('0x7')](_0x88e9('0x8'),_0x502d4b);}else{this[_0x88e9('0x7')](_0x88e9('0x8'),util[_0x88e9('0xa')](_0x88e9('0xb'),this['getDataValue']('name')||'',this[_0x88e9('0xc')](_0x88e9('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x88e9('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x88e9('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x29fd=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x542e58,_0x35f835){var _0x3c8779=function(_0x582976){while(--_0x582976){_0x542e58['push'](_0x542e58['shift']());}};_0x3c8779(++_0x35f835);}(_0x29fd,0xfb));var _0xd29f=function(_0x430929,_0x7d809e){_0x430929=_0x430929-0x0;var _0x512eb4=_0x29fd[_0x430929];return _0x512eb4;};'use strict';var Sequelize=require(_0xd29f('0x0'));var _=require(_0xd29f('0x1'));var util=require(_0xd29f('0x2'));module[_0xd29f('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xd29f('0x4')]},'formData':{'type':Sequelize[_0xd29f('0x5')](_0xd29f('0x6')),'set':function(_0x2f36af){if(_[_0xd29f('0x7')](_0x2f36af)){this[_0xd29f('0x8')](_0xd29f('0x9'),JSON[_0xd29f('0xa')](_0x2f36af));}else if(_[_0xd29f('0xb')](_0x2f36af)){this[_0xd29f('0x8')]('formData',_0x2f36af);}else{this['setDataValue']('formData',util['format'](_0xd29f('0xc'),this[_0xd29f('0xd')]('name')||'',this[_0xd29f('0xd')](_0xd29f('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd29f('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd29f('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 dc397a0..4d7324f 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 _0x8efc=['pick','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','clone','length','include','omit','createdAt','updatedAt','role','user','find','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','filter','getAnswers','JscriptyAnswerReport','nolimit','number','fromCharCode','toString','indexOf','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','stack','name','send','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','order','sort','filters'];(function(_0x441263,_0x7aa064){var _0x5353a5=function(_0x5a2538){while(--_0x5a2538){_0x441263['push'](_0x441263['shift']());}};_0x5353a5(++_0x7aa064);}(_0x8efc,0xb3));var _0xc8ef=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x8efc[_0x30cc1a];return _0xb3f18f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8ef('0x0'));var zipdir=require(_0xc8ef('0x1'));var jsonpatch=require(_0xc8ef('0x2'));var rp=require(_0xc8ef('0x3'));var moment=require('moment');var BPromise=require(_0xc8ef('0x4'));var Mustache=require(_0xc8ef('0x5'));var util=require(_0xc8ef('0x6'));var path=require('path');var sox=require(_0xc8ef('0x7'));var csv=require(_0xc8ef('0x8'));var ejs=require(_0xc8ef('0x9'));var fs=require('fs');var fs_extra=require(_0xc8ef('0xa'));var _=require('lodash');var squel=require(_0xc8ef('0xb'));var crypto=require(_0xc8ef('0xc'));var jsforce=require(_0xc8ef('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc8ef('0x8'));var querystring=require(_0xc8ef('0xe'));var Papa=require(_0xc8ef('0xf'));var Redis=require(_0xc8ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc8ef('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8ef('0x12'));var logger=require(_0xc8ef('0x13'))(_0xc8ef('0x14'));var utils=require(_0xc8ef('0x15'));var config=require(_0xc8ef('0x16'));var licenseUtil=require(_0xc8ef('0x17'));var db=require(_0xc8ef('0x18'))['db'];function respondWithStatusCode(_0x1c6744,_0xb90ed0){_0xb90ed0=_0xb90ed0||0xcc;return function(_0x15669b){if(_0x15669b){return _0x1c6744[_0xc8ef('0x19')](_0xb90ed0);}return _0x1c6744[_0xc8ef('0x1a')](_0xb90ed0)[_0xc8ef('0x1b')]();};}function respondWithResult(_0x2337a0,_0x8ba6d2){_0x8ba6d2=_0x8ba6d2||0xc8;return function(_0x1799ae){if(_0x1799ae){return _0x2337a0[_0xc8ef('0x1a')](_0x8ba6d2)[_0xc8ef('0x1c')](_0x1799ae);}};}function respondWithFilteredResult(_0x2c3bbf,_0x3f5636){return function(_0x175003){if(_0x175003){var _0x45eb4b=typeof _0x3f5636['offset']===_0xc8ef('0x1d')&&typeof _0x3f5636[_0xc8ef('0x1e')]===_0xc8ef('0x1d');var _0x374982=_0x175003[_0xc8ef('0x1f')];var _0x28eed6=_0x45eb4b?0x0:_0x3f5636[_0xc8ef('0x20')];var _0x262768=_0x45eb4b?_0x175003[_0xc8ef('0x1f')]:_0x3f5636[_0xc8ef('0x20')]+_0x3f5636['limit'];var _0x8edf4;if(_0x262768>=_0x374982){_0x262768=_0x374982;_0x8edf4=0xc8;}else{_0x8edf4=0xce;}_0x2c3bbf['status'](_0x8edf4);return _0x2c3bbf[_0xc8ef('0x21')]('Content-Range',_0x28eed6+'-'+_0x262768+'/'+_0x374982)[_0xc8ef('0x1c')](_0x175003);}return null;};}function patchUpdates(_0x4ff970){return function(_0x32f5f3){try{jsonpatch[_0xc8ef('0x22')](_0x32f5f3,_0x4ff970,!![]);}catch(_0x45635b){return BPromise[_0xc8ef('0x23')](_0x45635b);}return _0x32f5f3[_0xc8ef('0x24')]();};}function saveUpdates(_0x4c57e3,_0x3cf7b2){return function(_0x3ee862){if(_0x3ee862){return _0x3ee862[_0xc8ef('0x25')](_0x4c57e3)['then'](function(_0x23dd8d){return _0x23dd8d;});}return null;};}function removeEntity(_0x57555c,_0x5678b3){return function(_0x5f2456){if(_0x5f2456){return _0x5f2456['destroy']()[_0xc8ef('0x26')](function(){var _0x128556=_0x5f2456[_0xc8ef('0x27')]({'plain':!![]});var _0xeb24e4=_0xc8ef('0x28');return db[_0xc8ef('0x29')][_0xc8ef('0x2a')]({'where':{'type':_0xeb24e4,'resourceId':_0x128556['id']}})[_0xc8ef('0x26')](function(){return _0x5f2456;});})[_0xc8ef('0x26')](function(){_0x57555c[_0xc8ef('0x1a')](0xcc)[_0xc8ef('0x1b')]();});}};}function handleEntityNotFound(_0x328a91,_0x248c3d){return function(_0x1b921a){if(!_0x1b921a){_0x328a91['sendStatus'](0x194);}return _0x1b921a;};}function handleError(_0x173e6f,_0x270c79){_0x270c79=_0x270c79||0x1f4;return function(_0x522500){logger['error'](_0x522500[_0xc8ef('0x2b')]);if(_0x522500['name']){delete _0x522500[_0xc8ef('0x2c')];}_0x173e6f['status'](_0x270c79)[_0xc8ef('0x2d')](_0x522500);};}exports['index']=function(_0x33a80e,_0x405be9){var _0x5e50fd={},_0x5f40c9={},_0x289dbb={'count':0x0,'rows':[]};var _0x2c4e46=_['map'](db[_0xc8ef('0x2e')][_0xc8ef('0x2f')],function(_0x28be7f){return{'name':_0x28be7f[_0xc8ef('0x30')],'type':_0x28be7f[_0xc8ef('0x31')][_0xc8ef('0x32')]};});_0x5f40c9[_0xc8ef('0x33')]=_[_0xc8ef('0x34')](_0x2c4e46,_0xc8ef('0x2c'));_0x5f40c9[_0xc8ef('0x35')]=_[_0xc8ef('0x36')](_0x33a80e[_0xc8ef('0x35')]);_0x5f40c9['filters']=_[_0xc8ef('0x37')](_0x5f40c9[_0xc8ef('0x33')],_0x5f40c9[_0xc8ef('0x35')]);_0x5e50fd[_0xc8ef('0x38')]=_['intersection'](_0x5f40c9[_0xc8ef('0x33')],qs[_0xc8ef('0x39')](_0x33a80e['query'][_0xc8ef('0x39')]));_0x5e50fd[_0xc8ef('0x38')]=_0x5e50fd['attributes']['length']?_0x5e50fd[_0xc8ef('0x38')]:_0x5f40c9[_0xc8ef('0x33')];if(!_0x33a80e[_0xc8ef('0x35')]['hasOwnProperty']('nolimit')){_0x5e50fd[_0xc8ef('0x1e')]=qs[_0xc8ef('0x1e')](_0x33a80e[_0xc8ef('0x35')][_0xc8ef('0x1e')]);_0x5e50fd[_0xc8ef('0x20')]=qs['offset'](_0x33a80e[_0xc8ef('0x35')][_0xc8ef('0x20')]);}_0x5e50fd[_0xc8ef('0x3a')]=qs[_0xc8ef('0x3b')](_0x33a80e[_0xc8ef('0x35')][_0xc8ef('0x3b')]);_0x5e50fd['where']=qs[_0xc8ef('0x3c')](_[_0xc8ef('0x3d')](_0x33a80e['query'],_0x5f40c9['filters']),_0x2c4e46);if(_0x33a80e['query']['filter']){_0x5e50fd[_0xc8ef('0x3e')]=_['merge'](_0x5e50fd[_0xc8ef('0x3e')],{'$or':_[_0xc8ef('0x34')](_0x2c4e46,function(_0x368513){if(_0x368513['type']!==_0xc8ef('0x3f')){var _0x38fe94={};_0x38fe94[_0x368513[_0xc8ef('0x2c')]]={'$like':'%'+_0x33a80e[_0xc8ef('0x35')]['filter']+'%'};return _0x38fe94;}})});}_0x5e50fd=_[_0xc8ef('0x40')]({},_0x5e50fd,_0x33a80e[_0xc8ef('0x41')]);var _0x44a740={'where':_0x5e50fd[_0xc8ef('0x3e')]};return db['JscriptyProject']['count'](_0x44a740)[_0xc8ef('0x26')](function(_0x20647f){_0x289dbb[_0xc8ef('0x1f')]=_0x20647f;if(_0x33a80e[_0xc8ef('0x35')][_0xc8ef('0x42')]){_0x5e50fd['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xc8ef('0x43')](_0x5e50fd);})['then'](function(_0xa6ce01){_0x289dbb[_0xc8ef('0x44')]=_0xa6ce01;return _0x289dbb;})[_0xc8ef('0x26')](respondWithFilteredResult(_0x405be9,_0x5e50fd))['catch'](handleError(_0x405be9,null));};exports[_0xc8ef('0x45')]=function(_0xa8dcd4,_0x562df9){var _0x3cd290={'raw':![],'where':{'id':_0xa8dcd4[_0xc8ef('0x46')]['id']}},_0x4ebbe7={};_0x4ebbe7[_0xc8ef('0x33')]=_[_0xc8ef('0x36')](db['JscriptyProject'][_0xc8ef('0x2f')]);_0x4ebbe7['query']=_[_0xc8ef('0x36')](_0xa8dcd4[_0xc8ef('0x35')]);_0x4ebbe7[_0xc8ef('0x3c')]=_[_0xc8ef('0x37')](_0x4ebbe7[_0xc8ef('0x33')],_0x4ebbe7[_0xc8ef('0x35')]);_0x3cd290[_0xc8ef('0x38')]=_['intersection'](_0x4ebbe7['model'],qs[_0xc8ef('0x39')](_0xa8dcd4[_0xc8ef('0x35')][_0xc8ef('0x39')]));_0x3cd290[_0xc8ef('0x38')]=_0x3cd290[_0xc8ef('0x38')]['length']?_0x3cd290[_0xc8ef('0x38')]:_0x4ebbe7[_0xc8ef('0x33')];if(_0xa8dcd4[_0xc8ef('0x35')][_0xc8ef('0x42')]){_0x3cd290['include']=[{'all':!![]}];}_0x3cd290=_[_0xc8ef('0x40')]({},_0x3cd290,_0xa8dcd4[_0xc8ef('0x41')]);return db[_0xc8ef('0x2e')]['find'](_0x3cd290)[_0xc8ef('0x26')](handleEntityNotFound(_0x562df9,null))['then'](respondWithResult(_0x562df9,null))[_0xc8ef('0x47')](handleError(_0x562df9,null));};exports['create']=function(_0x3dbb7a,_0x331faa){return db[_0xc8ef('0x2e')][_0xc8ef('0x48')](_0x3dbb7a[_0xc8ef('0x49')],{})[_0xc8ef('0x26')](function(_0x2eb81b){var _0x76785=_0x3dbb7a['user'][_0xc8ef('0x27')]({'plain':!![]});if(!_0x76785)throw new Error(_0xc8ef('0x4a'));if(_0x76785['role']==='user'){var _0xe997a=_0x2eb81b['get']({'plain':!![]});var _0x12d88a='Projects';return db[_0xc8ef('0x4b')]['find']({'where':{'name':_0x12d88a,'userProfileId':_0x76785[_0xc8ef('0x4c')]},'raw':!![]})[_0xc8ef('0x26')](function(_0xb7816e){if(_0xb7816e&&_0xb7816e[_0xc8ef('0x4d')]===0x0){return db[_0xc8ef('0x29')]['create']({'name':_0xe997a[_0xc8ef('0x2c')],'resourceId':_0xe997a['id'],'type':_0xb7816e[_0xc8ef('0x2c')],'sectionId':_0xb7816e['id']},{})[_0xc8ef('0x26')](function(){return _0x2eb81b;});}else{return _0x2eb81b;}})[_0xc8ef('0x47')](function(_0x1b460a){logger[_0xc8ef('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b460a);throw _0x1b460a;});}return _0x2eb81b;})['then'](respondWithResult(_0x331faa,0xc9))[_0xc8ef('0x47')](handleError(_0x331faa,null));};exports[_0xc8ef('0x4f')]=function(_0x5e88eb,_0x5b41e5){var _0x1cc6e4={'where':{'id':_0x5e88eb['params']['id']}},_0x1cfab1={};_0x1cfab1['model']=_[_0xc8ef('0x36')](db[_0xc8ef('0x2e')][_0xc8ef('0x2f')]);_0x1cc6e4[_0xc8ef('0x38')]=_[_0xc8ef('0x37')](_0x1cfab1['model'],qs[_0xc8ef('0x39')](_0x5e88eb[_0xc8ef('0x35')][_0xc8ef('0x39')]));_0x1cc6e4['attributes']=_0x1cc6e4['attributes'][_0xc8ef('0x50')]?_0x1cc6e4[_0xc8ef('0x38')]:_0x1cfab1[_0xc8ef('0x33')];if(_0x5e88eb[_0xc8ef('0x35')][_0xc8ef('0x42')]){_0x1cc6e4[_0xc8ef('0x51')]=[{'all':!![]}];}_0x1cc6e4=_[_0xc8ef('0x40')]({},_0x1cc6e4,_0x5e88eb[_0xc8ef('0x41')]);return db[_0xc8ef('0x2e')]['find'](_0x1cc6e4)[_0xc8ef('0x26')](handleEntityNotFound(_0x5b41e5,null))['then'](function(_0x1d394a){if(_0x1d394a){var _0x40607a=_0x1d394a[_0xc8ef('0x27')]({'plain':!![]});_0x40607a=qs[_0xc8ef('0x52')](_0x40607a,['id',_0xc8ef('0x53'),_0xc8ef('0x54')]);_0x5e88eb['body']=_[_0xc8ef('0x52')](_0x5e88eb[_0xc8ef('0x49')],['id',_0xc8ef('0x53'),_0xc8ef('0x54')]);return db[_0xc8ef('0x2e')][_0xc8ef('0x48')](_[_0xc8ef('0x40')](_0x40607a,_0x5e88eb[_0xc8ef('0x49')]),{'include':_0x5e88eb[_0xc8ef('0x35')][_0xc8ef('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x2b6543){var _0x365745=_0x5e88eb['user'][_0xc8ef('0x27')]({'plain':!![]});if(!_0x365745)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x365745[_0xc8ef('0x55')]===_0xc8ef('0x56')){var _0x498900=_0x2b6543[_0xc8ef('0x27')]({'plain':!![]});var _0x1de73d=_0xc8ef('0x28');return db['UserProfileSection'][_0xc8ef('0x57')]({'where':{'name':_0x1de73d,'userProfileId':_0x365745[_0xc8ef('0x4c')]},'raw':!![]})[_0xc8ef('0x26')](function(_0x157bb8){if(_0x157bb8&&_0x157bb8[_0xc8ef('0x4d')]===0x0){return db['UserProfileResource'][_0xc8ef('0x48')]({'name':_0x498900[_0xc8ef('0x2c')],'resourceId':_0x498900['id'],'type':_0x157bb8[_0xc8ef('0x2c')],'sectionId':_0x157bb8['id']},{})[_0xc8ef('0x26')](function(){return _0x2b6543;});}else{return _0x2b6543;}})[_0xc8ef('0x47')](function(_0xdade06){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdade06);throw _0xdade06;});}return _0x2b6543;});}})[_0xc8ef('0x26')](respondWithResult(_0x5b41e5,0xc9))[_0xc8ef('0x47')](handleError(_0x5b41e5,null));};exports[_0xc8ef('0x25')]=function(_0x5928d9,_0x154f30){if(_0x5928d9[_0xc8ef('0x49')]['id']){delete _0x5928d9['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x5928d9[_0xc8ef('0x46')]['id']}})[_0xc8ef('0x26')](handleEntityNotFound(_0x154f30,null))[_0xc8ef('0x26')](saveUpdates(_0x5928d9[_0xc8ef('0x49')],null))[_0xc8ef('0x26')](respondWithResult(_0x154f30,null))[_0xc8ef('0x47')](handleError(_0x154f30,null));};exports[_0xc8ef('0x2a')]=function(_0x32c5a6,_0x2c1f05){return db[_0xc8ef('0x2e')]['find']({'where':{'id':_0x32c5a6[_0xc8ef('0x46')]['id']}})[_0xc8ef('0x26')](handleEntityNotFound(_0x2c1f05,null))[_0xc8ef('0x26')](removeEntity(_0x2c1f05,null))[_0xc8ef('0x47')](handleError(_0x2c1f05,null));};exports[_0xc8ef('0x58')]=function(_0x405672,_0x59a5a6,_0x38e239){var _0x4a7e49={'raw':!![],'where':{}};var _0x5616ae={};var _0x4a4cef={'count':0x0,'rows':[]};return db[_0xc8ef('0x2e')][_0xc8ef('0x59')]({'where':{'id':_0x405672[_0xc8ef('0x46')]['id']}})[_0xc8ef('0x26')](handleEntityNotFound(_0x59a5a6,null))[_0xc8ef('0x26')](function(_0x3b2301){if(_0x3b2301){_0x5616ae['model']=_[_0xc8ef('0x36')](db[_0xc8ef('0x5a')][_0xc8ef('0x2f')]);_0x5616ae[_0xc8ef('0x35')]=_['keys'](_0x405672[_0xc8ef('0x35')]);_0x5616ae[_0xc8ef('0x3c')]=_[_0xc8ef('0x37')](_0x5616ae['model'],_0x5616ae[_0xc8ef('0x35')]);_0x4a7e49[_0xc8ef('0x38')]=_[_0xc8ef('0x37')](_0x5616ae[_0xc8ef('0x33')],qs['fields'](_0x405672['query']['fields']));_0x4a7e49[_0xc8ef('0x38')]=_0x4a7e49[_0xc8ef('0x38')][_0xc8ef('0x50')]?_0x4a7e49[_0xc8ef('0x38')]:_0x5616ae[_0xc8ef('0x33')];if(!_0x405672[_0xc8ef('0x35')][_0xc8ef('0x5b')]('nolimit')){_0x4a7e49[_0xc8ef('0x1e')]=qs[_0xc8ef('0x1e')](_0x405672['query'][_0xc8ef('0x1e')]);_0x4a7e49[_0xc8ef('0x20')]=qs[_0xc8ef('0x20')](_0x405672[_0xc8ef('0x35')]['offset']);}_0x4a7e49[_0xc8ef('0x3a')]=qs['sort'](_0x405672['query'][_0xc8ef('0x3b')]);_0x4a7e49['where']=qs[_0xc8ef('0x3c')](_[_0xc8ef('0x3d')](_0x405672['query'],_0x5616ae[_0xc8ef('0x3c')]));_0x4a7e49[_0xc8ef('0x3e')][_0xc8ef('0x5c')]=_0x3b2301['id'];if(_0x405672['query'][_0xc8ef('0x5d')]){_0x4a7e49[_0xc8ef('0x3e')]=_['merge'](_0x4a7e49[_0xc8ef('0x3e')],{'$or':_[_0xc8ef('0x34')](_0x4a7e49[_0xc8ef('0x38')],function(_0x5d2332){var _0x31fb0c={};_0x31fb0c[_0x5d2332]={'$like':'%'+_0x405672['query'][_0xc8ef('0x5d')]+'%'};return _0x31fb0c;})});}_0x4a7e49=_[_0xc8ef('0x40')]({},_0x4a7e49,_0x405672[_0xc8ef('0x41')]);return db['JscriptySessionReport'][_0xc8ef('0x1f')]({'where':_0x4a7e49[_0xc8ef('0x3e')]})[_0xc8ef('0x26')](function(_0x4f67f4){_0x4a4cef[_0xc8ef('0x1f')]=_0x4f67f4;if(_0x405672[_0xc8ef('0x35')]['includeAll']){_0x4a7e49['include']=[{'all':!![]}];}return db[_0xc8ef('0x5a')][_0xc8ef('0x43')](_0x4a7e49);})[_0xc8ef('0x26')](function(_0x19d9db){_0x4a4cef['rows']=_0x19d9db;return _0x4a4cef;});}})['then'](respondWithFilteredResult(_0x59a5a6,_0x4a7e49))[_0xc8ef('0x47')](handleError(_0x59a5a6,null));};exports[_0xc8ef('0x5e')]=function(_0x38e931,_0x734d4e,_0x147b7a){var _0x121b98={'raw':!![],'where':{}};var _0x176bda={};var _0xfb7c28={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x38e931[_0xc8ef('0x46')]['id']}})[_0xc8ef('0x26')](handleEntityNotFound(_0x734d4e,null))[_0xc8ef('0x26')](function(_0x54a9e9){if(_0x54a9e9){_0x176bda[_0xc8ef('0x33')]=_[_0xc8ef('0x36')](db[_0xc8ef('0x5f')]['rawAttributes']);_0x176bda['query']=_['keys'](_0x38e931[_0xc8ef('0x35')]);_0x176bda[_0xc8ef('0x3c')]=_[_0xc8ef('0x37')](_0x176bda[_0xc8ef('0x33')],_0x176bda[_0xc8ef('0x35')]);_0x121b98[_0xc8ef('0x38')]=_['intersection'](_0x176bda[_0xc8ef('0x33')],qs[_0xc8ef('0x39')](_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x39')]));_0x121b98[_0xc8ef('0x38')]=_0x121b98['attributes']['length']?_0x121b98[_0xc8ef('0x38')]:_0x176bda[_0xc8ef('0x33')];if(!_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x5b')](_0xc8ef('0x60'))){_0x121b98[_0xc8ef('0x1e')]=qs[_0xc8ef('0x1e')](_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x1e')]);_0x121b98[_0xc8ef('0x20')]=qs['offset'](_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x20')]);}_0x121b98[_0xc8ef('0x3a')]=qs[_0xc8ef('0x3b')](_0x38e931['query'][_0xc8ef('0x3b')]);_0x121b98[_0xc8ef('0x3e')]=qs[_0xc8ef('0x3c')](_[_0xc8ef('0x3d')](_0x38e931[_0xc8ef('0x35')],_0x176bda['filters']));_0x121b98[_0xc8ef('0x3e')][_0xc8ef('0x5c')]=_0x54a9e9['id'];if(_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x5d')]){_0x121b98[_0xc8ef('0x3e')]=_[_0xc8ef('0x40')](_0x121b98[_0xc8ef('0x3e')],{'$or':_['map'](_0x121b98[_0xc8ef('0x38')],function(_0x4b6d7e){var _0x1c3131={};_0x1c3131[_0x4b6d7e]={'$like':'%'+_0x38e931[_0xc8ef('0x35')]['filter']+'%'};return _0x1c3131;})});}_0x121b98=_[_0xc8ef('0x40')]({},_0x121b98,_0x38e931['options']);return db[_0xc8ef('0x5f')][_0xc8ef('0x1f')]({'where':_0x121b98[_0xc8ef('0x3e')]})[_0xc8ef('0x26')](function(_0x5376b0){_0xfb7c28['count']=_0x5376b0;if(_0x38e931[_0xc8ef('0x35')][_0xc8ef('0x42')]){_0x121b98[_0xc8ef('0x51')]=[{'all':!![]}];}return db[_0xc8ef('0x5f')]['findAll'](_0x121b98);})[_0xc8ef('0x26')](function(_0x33acd8){_0xfb7c28[_0xc8ef('0x44')]=_0x33acd8;return _0xfb7c28;});}})[_0xc8ef('0x26')](respondWithFilteredResult(_0x734d4e,_0x121b98))[_0xc8ef('0x47')](handleError(_0x734d4e,null));};function char(_0x3884dd){return _0xc8ef('0x61')===typeof _0x3884dd?String[_0xc8ef('0x62')][_0xc8ef('0x22')](null,arguments):_0x3884dd;}function needsEncapsulation(_0x1697ce){return!!_0x1697ce&&(_0x1697ce[_0xc8ef('0x63')]()[_0xc8ef('0x64')](char(0xd))>=0x0||_0x1697ce[_0xc8ef('0x63')]()['indexOf'](char(0xa))>=0x0||_0x1697ce[_0xc8ef('0x63')]()[_0xc8ef('0x64')](char(0x2c))>=0x0||_0x1697ce[_0xc8ef('0x63')]()[_0xc8ef('0x64')](char(0x22))>=0x0);}function encapsulate(_0x3e7351){var _0x53885e=char(0x22),_0x2a98dd='\x5c'+char(0x22),_0x4c369a=_0x3e7351[_0xc8ef('0x63')]()['replace'](new RegExp(_0x53885e,'g'),_0x2a98dd);return _0x53885e+_0x4c369a+_0x53885e;}exports[_0xc8ef('0x65')]=function(_0x15e577,_0x56b2be,_0x2a9ef6){var _0x34a886,_0x317e87;var _0x44a4d5={'where':{'ProjectId':_0x15e577[_0xc8ef('0x46')]['id']}};if(_0x15e577['query']['startTime']){_0x44a4d5[_0xc8ef('0x3e')][_0xc8ef('0x66')]=JSON['parse'](_0x15e577['query'][_0xc8ef('0x67')]);}return db['JscriptySessionReport'][_0xc8ef('0x43')](_0x44a4d5)[_0xc8ef('0x26')](handleEntityNotFound(_0x56b2be,null))['then'](function(_0x41ab61){if(_0x41ab61){_0x34a886=_0x41ab61;return db[_0xc8ef('0x68')][_0xc8ef('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x34a886,'id')},'ProjectId':_0x15e577['params']['id']},'order':_0xc8ef('0x69')});}})[_0xc8ef('0x26')](handleEntityNotFound(_0x56b2be,null))['then'](function(_0x2bb7c7){if(_0x2bb7c7){_0x317e87=_0x2bb7c7;var _0x319ca9={};for(var _0x482197=0x0,_0x43cd35=_0x317e87['length'];_0x482197<_0x43cd35;_0x482197++){if(!_0x319ca9['hasOwnProperty'](_0x317e87[_0x482197][_0xc8ef('0x6a')])){_0x319ca9[_0x317e87[_0x482197][_0xc8ef('0x6a')]]=needsEncapsulation(_0x317e87[_0x482197][_0xc8ef('0x6b')])?encapsulate(_0x317e87[_0x482197]['question']):_0x317e87[_0x482197][_0xc8ef('0x6b')];}}var _0x151e34=[],_0x13d9b4={};for(var _0x150f18=0x0,_0x25ca0f=_0x34a886[_0xc8ef('0x50')];_0x150f18<_0x25ca0f;_0x150f18++){_0x13d9b4={'ProjectId':_0x15e577[_0xc8ef('0x46')]['id'],'SessionId':_0x34a886[_0x150f18]['id'],'StartTime':moment(_0x34a886[_0x150f18][_0xc8ef('0x66')])[_0xc8ef('0x6c')](_0xc8ef('0x6d'))};for(var _0x10b5c1=0x0,_0x49198d=_0x317e87[_0xc8ef('0x50')];_0x10b5c1<_0x49198d;_0x10b5c1++){if(_0x317e87[_0x10b5c1][_0xc8ef('0x6e')]==_0x34a886[_0x150f18]['id']&&_0x319ca9['hasOwnProperty'](_0x317e87[_0x10b5c1][_0xc8ef('0x6a')])){_0x13d9b4[_0x319ca9[_0x317e87[_0x10b5c1]['questionId']]]=_0x317e87[_0x10b5c1][_0xc8ef('0x6f')];}}for(var _0xa10318 in _0x319ca9){if(!_0x13d9b4[_0xc8ef('0x5b')](_0x319ca9[_0xa10318])){_0x13d9b4[_0x319ca9[_0xa10318]]=null;}}_0x151e34['push'](_0x13d9b4);}return _0x151e34;}})[_0xc8ef('0x26')](function(_0x596902){if(!_['isEmpty'](_0x596902)){var _0x34dbd9=toCsv(_0x596902);var _0x5e6fa2=Date['now']();fs[_0xc8ef('0x70')](util[_0xc8ef('0x6c')](_0xc8ef('0x71'),_0x15e577[_0xc8ef('0x46')]['id'],_0x5e6fa2),_0x34dbd9);_0x56b2be['setHeader'](_0xc8ef('0x72'),'attachment;\x20filename='+util[_0xc8ef('0x6c')](_0xc8ef('0x73'),_0x15e577['params']['id'],_0x5e6fa2));_0x56b2be[_0xc8ef('0x74')](_0xc8ef('0x75'),_0xc8ef('0x76'));return _0x56b2be[_0xc8ef('0x77')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x15e577[_0xc8ef('0x46')]['id'],_0x5e6fa2));}else{return _0x56b2be[_0xc8ef('0x19')](0xcc);}})[_0xc8ef('0x47')](handleError(_0x56b2be,null));}; \ No newline at end of file +var _0x13b6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','userProfileId','findOne','JscriptySessionReport','ProjectId','rows','hasOwnProperty','fromCharCode','apply','indexOf','toString','replace','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyProject','includeAll','include','findAll','catch','params','find','create','body','user'];(function(_0x44ceee,_0x2a5e28){var _0x1a065c=function(_0x24ec16){while(--_0x24ec16){_0x44ceee['push'](_0x44ceee['shift']());}};_0x1a065c(++_0x2a5e28);}(_0x13b6,0x97));var _0x613b=function(_0x2e5c51,_0x2d646b){_0x2e5c51=_0x2e5c51-0x0;var _0xa23db3=_0x13b6[_0x2e5c51];return _0xa23db3;};'use strict';var emlformat=require(_0x613b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x613b('0x1'));var jsonpatch=require(_0x613b('0x2'));var rp=require(_0x613b('0x3'));var moment=require(_0x613b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x613b('0x5'));var util=require(_0x613b('0x6'));var path=require(_0x613b('0x7'));var sox=require('sox');var csv=require(_0x613b('0x8'));var ejs=require(_0x613b('0x9'));var fs=require('fs');var fs_extra=require(_0x613b('0xa'));var _=require('lodash');var squel=require(_0x613b('0xb'));var crypto=require('crypto');var jsforce=require(_0x613b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x613b('0xd'));var Papa=require(_0x613b('0xe'));var Redis=require(_0x613b('0xf'));var authService=require(_0x613b('0x10'));var qs=require(_0x613b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x613b('0x12'))('api');var utils=require(_0x613b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x613b('0x14'))['db'];function respondWithStatusCode(_0x408b5f,_0x1567cd){_0x1567cd=_0x1567cd||0xcc;return function(_0x4afa45){if(_0x4afa45){return _0x408b5f[_0x613b('0x15')](_0x1567cd);}return _0x408b5f[_0x613b('0x16')](_0x1567cd)[_0x613b('0x17')]();};}function respondWithResult(_0x1b9d4b,_0x297031){_0x297031=_0x297031||0xc8;return function(_0x3516ed){if(_0x3516ed){return _0x1b9d4b[_0x613b('0x16')](_0x297031)[_0x613b('0x18')](_0x3516ed);}};}function respondWithFilteredResult(_0x37df51,_0xde7e24){return function(_0x52c088){if(_0x52c088){var _0xa74b30=typeof _0xde7e24[_0x613b('0x19')]===_0x613b('0x1a')&&typeof _0xde7e24['limit']==='undefined';var _0x41a912=_0x52c088['count'];var _0x27949c=_0xa74b30?0x0:_0xde7e24['offset'];var _0x46c9c4=_0xa74b30?_0x52c088[_0x613b('0x1b')]:_0xde7e24[_0x613b('0x19')]+_0xde7e24[_0x613b('0x1c')];var _0x22fee9;if(_0x46c9c4>=_0x41a912){_0x46c9c4=_0x41a912;_0x22fee9=0xc8;}else{_0x22fee9=0xce;}_0x37df51[_0x613b('0x16')](_0x22fee9);return _0x37df51[_0x613b('0x1d')]('Content-Range',_0x27949c+'-'+_0x46c9c4+'/'+_0x41a912)[_0x613b('0x18')](_0x52c088);}return null;};}function patchUpdates(_0x2628e8){return function(_0x4877d6){try{jsonpatch['apply'](_0x4877d6,_0x2628e8,!![]);}catch(_0x22b5ec){return BPromise[_0x613b('0x1e')](_0x22b5ec);}return _0x4877d6[_0x613b('0x1f')]();};}function saveUpdates(_0x425ebb,_0x1df68a){return function(_0x4d9728){if(_0x4d9728){return _0x4d9728[_0x613b('0x20')](_0x425ebb)['then'](function(_0x295420){return _0x295420;});}return null;};}function removeEntity(_0x3f8dc0,_0x3a17a1){return function(_0x101ec7){if(_0x101ec7){return _0x101ec7['destroy']()[_0x613b('0x21')](function(){var _0x4eb354=_0x101ec7[_0x613b('0x22')]({'plain':!![]});var _0x4ad958=_0x613b('0x23');return db[_0x613b('0x24')][_0x613b('0x25')]({'where':{'type':_0x4ad958,'resourceId':_0x4eb354['id']}})[_0x613b('0x21')](function(){return _0x101ec7;});})[_0x613b('0x21')](function(){_0x3f8dc0[_0x613b('0x16')](0xcc)[_0x613b('0x17')]();});}};}function handleEntityNotFound(_0x374547,_0x2d7191){return function(_0x63f8c3){if(!_0x63f8c3){_0x374547[_0x613b('0x15')](0x194);}return _0x63f8c3;};}function handleError(_0x367c1a,_0x4f6bdf){_0x4f6bdf=_0x4f6bdf||0x1f4;return function(_0x46529a){logger[_0x613b('0x26')](_0x46529a[_0x613b('0x27')]);if(_0x46529a[_0x613b('0x28')]){delete _0x46529a[_0x613b('0x28')];}_0x367c1a[_0x613b('0x16')](_0x4f6bdf)[_0x613b('0x29')](_0x46529a);};}exports['index']=function(_0x228f39,_0x169baf){var _0x56561f={},_0x3af1ff={},_0x4f2df9={'count':0x0,'rows':[]};var _0x3ed316=_[_0x613b('0x2a')](db['JscriptyProject'][_0x613b('0x2b')],function(_0x37294f){return{'name':_0x37294f[_0x613b('0x2c')],'type':_0x37294f[_0x613b('0x2d')][_0x613b('0x2e')]};});_0x3af1ff[_0x613b('0x2f')]=_[_0x613b('0x2a')](_0x3ed316,_0x613b('0x28'));_0x3af1ff[_0x613b('0x30')]=_[_0x613b('0x31')](_0x228f39[_0x613b('0x30')]);_0x3af1ff[_0x613b('0x32')]=_[_0x613b('0x33')](_0x3af1ff['model'],_0x3af1ff[_0x613b('0x30')]);_0x56561f[_0x613b('0x34')]=_[_0x613b('0x33')](_0x3af1ff[_0x613b('0x2f')],qs['fields'](_0x228f39['query'][_0x613b('0x35')]));_0x56561f[_0x613b('0x34')]=_0x56561f[_0x613b('0x34')][_0x613b('0x36')]?_0x56561f[_0x613b('0x34')]:_0x3af1ff[_0x613b('0x2f')];if(!_0x228f39[_0x613b('0x30')]['hasOwnProperty'](_0x613b('0x37'))){_0x56561f[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x228f39[_0x613b('0x30')][_0x613b('0x1c')]);_0x56561f[_0x613b('0x19')]=qs[_0x613b('0x19')](_0x228f39[_0x613b('0x30')][_0x613b('0x19')]);}_0x56561f[_0x613b('0x38')]=qs[_0x613b('0x39')](_0x228f39[_0x613b('0x30')][_0x613b('0x39')]);_0x56561f[_0x613b('0x3a')]=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x228f39[_0x613b('0x30')],_0x3af1ff[_0x613b('0x32')]),_0x3ed316);if(_0x228f39['query'][_0x613b('0x3c')]){_0x56561f[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0x56561f[_0x613b('0x3a')],{'$or':_[_0x613b('0x2a')](_0x3ed316,function(_0x127500){if(_0x127500[_0x613b('0x2d')]!==_0x613b('0x3e')){var _0x18d31e={};_0x18d31e[_0x127500[_0x613b('0x28')]]={'$like':'%'+_0x228f39[_0x613b('0x30')]['filter']+'%'};return _0x18d31e;}})});}_0x56561f=_[_0x613b('0x3d')]({},_0x56561f,_0x228f39['options']);var _0x5ea015={'where':_0x56561f[_0x613b('0x3a')]};return db[_0x613b('0x3f')][_0x613b('0x1b')](_0x5ea015)[_0x613b('0x21')](function(_0x48bca8){_0x4f2df9[_0x613b('0x1b')]=_0x48bca8;if(_0x228f39['query'][_0x613b('0x40')]){_0x56561f[_0x613b('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0x613b('0x42')](_0x56561f);})['then'](function(_0x48a4fb){_0x4f2df9['rows']=_0x48a4fb;return _0x4f2df9;})['then'](respondWithFilteredResult(_0x169baf,_0x56561f))[_0x613b('0x43')](handleError(_0x169baf,null));};exports['show']=function(_0x385c1c,_0x389868){var _0x57d5fa={'raw':![],'where':{'id':_0x385c1c[_0x613b('0x44')]['id']}},_0x392a2d={};_0x392a2d[_0x613b('0x2f')]=_[_0x613b('0x31')](db['JscriptyProject']['rawAttributes']);_0x392a2d[_0x613b('0x30')]=_[_0x613b('0x31')](_0x385c1c[_0x613b('0x30')]);_0x392a2d['filters']=_['intersection'](_0x392a2d[_0x613b('0x2f')],_0x392a2d[_0x613b('0x30')]);_0x57d5fa[_0x613b('0x34')]=_['intersection'](_0x392a2d['model'],qs[_0x613b('0x35')](_0x385c1c[_0x613b('0x30')][_0x613b('0x35')]));_0x57d5fa[_0x613b('0x34')]=_0x57d5fa[_0x613b('0x34')][_0x613b('0x36')]?_0x57d5fa[_0x613b('0x34')]:_0x392a2d[_0x613b('0x2f')];if(_0x385c1c[_0x613b('0x30')][_0x613b('0x40')]){_0x57d5fa[_0x613b('0x41')]=[{'all':!![]}];}_0x57d5fa=_[_0x613b('0x3d')]({},_0x57d5fa,_0x385c1c['options']);return db[_0x613b('0x3f')][_0x613b('0x45')](_0x57d5fa)[_0x613b('0x21')](handleEntityNotFound(_0x389868,null))[_0x613b('0x21')](respondWithResult(_0x389868,null))[_0x613b('0x43')](handleError(_0x389868,null));};exports['create']=function(_0x1e6226,_0x2d3995){return db[_0x613b('0x3f')][_0x613b('0x46')](_0x1e6226[_0x613b('0x47')],{})[_0x613b('0x21')](function(_0x5f6d6){var _0xd7c1d3=_0x1e6226[_0x613b('0x48')][_0x613b('0x22')]({'plain':!![]});if(!_0xd7c1d3)throw new Error(_0x613b('0x49'));if(_0xd7c1d3[_0x613b('0x4a')]===_0x613b('0x48')){var _0x77daf3=_0x5f6d6[_0x613b('0x22')]({'plain':!![]});var _0x1a08ba=_0x613b('0x23');return db[_0x613b('0x4b')][_0x613b('0x45')]({'where':{'name':_0x1a08ba,'userProfileId':_0xd7c1d3['userProfileId']},'raw':!![]})[_0x613b('0x21')](function(_0x24c4af){if(_0x24c4af&&_0x24c4af[_0x613b('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x77daf3[_0x613b('0x28')],'resourceId':_0x77daf3['id'],'type':_0x24c4af[_0x613b('0x28')],'sectionId':_0x24c4af['id']},{})[_0x613b('0x21')](function(){return _0x5f6d6;});}else{return _0x5f6d6;}})['catch'](function(_0x23116e){logger[_0x613b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23116e);throw _0x23116e;});}return _0x5f6d6;})[_0x613b('0x21')](respondWithResult(_0x2d3995,0xc9))[_0x613b('0x43')](handleError(_0x2d3995,null));};exports[_0x613b('0x4d')]=function(_0x337ed8,_0x3cf476){var _0x1eb1de={'where':{'id':_0x337ed8[_0x613b('0x44')]['id']}},_0x5ef07a={};_0x5ef07a[_0x613b('0x2f')]=_['keys'](db['JscriptyProject'][_0x613b('0x2b')]);_0x1eb1de['attributes']=_['intersection'](_0x5ef07a[_0x613b('0x2f')],qs[_0x613b('0x35')](_0x337ed8[_0x613b('0x30')][_0x613b('0x35')]));_0x1eb1de['attributes']=_0x1eb1de[_0x613b('0x34')][_0x613b('0x36')]?_0x1eb1de[_0x613b('0x34')]:_0x5ef07a['model'];if(_0x337ed8['query'][_0x613b('0x40')]){_0x1eb1de['include']=[{'all':!![]}];}_0x1eb1de=_['merge']({},_0x1eb1de,_0x337ed8[_0x613b('0x4e')]);return db['JscriptyProject'][_0x613b('0x45')](_0x1eb1de)[_0x613b('0x21')](handleEntityNotFound(_0x3cf476,null))[_0x613b('0x21')](function(_0x6a2d01){if(_0x6a2d01){var _0x522bd3=_0x6a2d01['get']({'plain':!![]});_0x522bd3=qs[_0x613b('0x4f')](_0x522bd3,['id',_0x613b('0x50'),_0x613b('0x51')]);_0x337ed8[_0x613b('0x47')]=_[_0x613b('0x4f')](_0x337ed8[_0x613b('0x47')],['id',_0x613b('0x50'),_0x613b('0x51')]);return db[_0x613b('0x3f')][_0x613b('0x46')](_[_0x613b('0x3d')](_0x522bd3,_0x337ed8[_0x613b('0x47')]),{'include':_0x337ed8[_0x613b('0x30')][_0x613b('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x135c48){var _0x340804=_0x337ed8[_0x613b('0x48')]['get']({'plain':!![]});if(!_0x340804)throw new Error(_0x613b('0x49'));if(_0x340804[_0x613b('0x4a')]===_0x613b('0x48')){var _0x9dfe7d=_0x135c48[_0x613b('0x22')]({'plain':!![]});var _0x35f06c=_0x613b('0x23');return db[_0x613b('0x4b')]['find']({'where':{'name':_0x35f06c,'userProfileId':_0x340804[_0x613b('0x52')]},'raw':!![]})[_0x613b('0x21')](function(_0x5c04cd){if(_0x5c04cd&&_0x5c04cd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x9dfe7d['name'],'resourceId':_0x9dfe7d['id'],'type':_0x5c04cd[_0x613b('0x28')],'sectionId':_0x5c04cd['id']},{})[_0x613b('0x21')](function(){return _0x135c48;});}else{return _0x135c48;}})[_0x613b('0x43')](function(_0x108318){logger[_0x613b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x108318);throw _0x108318;});}return _0x135c48;});}})['then'](respondWithResult(_0x3cf476,0xc9))['catch'](handleError(_0x3cf476,null));};exports[_0x613b('0x20')]=function(_0x16f1e2,_0x172e88){if(_0x16f1e2[_0x613b('0x47')]['id']){delete _0x16f1e2['body']['id'];}return db[_0x613b('0x3f')][_0x613b('0x45')]({'where':{'id':_0x16f1e2[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x172e88,null))[_0x613b('0x21')](saveUpdates(_0x16f1e2['body'],null))[_0x613b('0x21')](respondWithResult(_0x172e88,null))[_0x613b('0x43')](handleError(_0x172e88,null));};exports[_0x613b('0x25')]=function(_0x191d72,_0x477e24){return db[_0x613b('0x3f')][_0x613b('0x45')]({'where':{'id':_0x191d72[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x477e24,null))[_0x613b('0x21')](removeEntity(_0x477e24,null))[_0x613b('0x43')](handleError(_0x477e24,null));};exports['getSessions']=function(_0x279e27,_0x3ee588,_0x3d58d3){var _0x5e8c5f={'raw':!![],'where':{}};var _0x52159f={};var _0x12f606={'count':0x0,'rows':[]};return db[_0x613b('0x3f')][_0x613b('0x53')]({'where':{'id':_0x279e27[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x3ee588,null))[_0x613b('0x21')](function(_0x350fd2){if(_0x350fd2){_0x52159f[_0x613b('0x2f')]=_['keys'](db[_0x613b('0x54')][_0x613b('0x2b')]);_0x52159f[_0x613b('0x30')]=_[_0x613b('0x31')](_0x279e27[_0x613b('0x30')]);_0x52159f[_0x613b('0x32')]=_['intersection'](_0x52159f[_0x613b('0x2f')],_0x52159f['query']);_0x5e8c5f[_0x613b('0x34')]=_['intersection'](_0x52159f[_0x613b('0x2f')],qs['fields'](_0x279e27[_0x613b('0x30')][_0x613b('0x35')]));_0x5e8c5f['attributes']=_0x5e8c5f[_0x613b('0x34')]['length']?_0x5e8c5f[_0x613b('0x34')]:_0x52159f[_0x613b('0x2f')];if(!_0x279e27[_0x613b('0x30')]['hasOwnProperty']('nolimit')){_0x5e8c5f[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x279e27['query'][_0x613b('0x1c')]);_0x5e8c5f['offset']=qs[_0x613b('0x19')](_0x279e27[_0x613b('0x30')][_0x613b('0x19')]);}_0x5e8c5f[_0x613b('0x38')]=qs['sort'](_0x279e27[_0x613b('0x30')]['sort']);_0x5e8c5f['where']=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x279e27[_0x613b('0x30')],_0x52159f[_0x613b('0x32')]));_0x5e8c5f[_0x613b('0x3a')][_0x613b('0x55')]=_0x350fd2['id'];if(_0x279e27['query'][_0x613b('0x3c')]){_0x5e8c5f[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0x5e8c5f['where'],{'$or':_['map'](_0x5e8c5f[_0x613b('0x34')],function(_0x331851){var _0x4e4ae2={};_0x4e4ae2[_0x331851]={'$like':'%'+_0x279e27[_0x613b('0x30')][_0x613b('0x3c')]+'%'};return _0x4e4ae2;})});}_0x5e8c5f=_['merge']({},_0x5e8c5f,_0x279e27[_0x613b('0x4e')]);return db[_0x613b('0x54')][_0x613b('0x1b')]({'where':_0x5e8c5f[_0x613b('0x3a')]})['then'](function(_0x2a111a){_0x12f606[_0x613b('0x1b')]=_0x2a111a;if(_0x279e27[_0x613b('0x30')][_0x613b('0x40')]){_0x5e8c5f[_0x613b('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x613b('0x42')](_0x5e8c5f);})[_0x613b('0x21')](function(_0x3c332c){_0x12f606[_0x613b('0x56')]=_0x3c332c;return _0x12f606;});}})[_0x613b('0x21')](respondWithFilteredResult(_0x3ee588,_0x5e8c5f))[_0x613b('0x43')](handleError(_0x3ee588,null));};exports['getAnswers']=function(_0x1f4c2d,_0x54874f,_0x5b9b4e){var _0xedd980={'raw':!![],'where':{}};var _0x471a07={};var _0x325492={'count':0x0,'rows':[]};return db[_0x613b('0x3f')][_0x613b('0x53')]({'where':{'id':_0x1f4c2d[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x54874f,null))[_0x613b('0x21')](function(_0xe68aa0){if(_0xe68aa0){_0x471a07[_0x613b('0x2f')]=_['keys'](db['JscriptyAnswerReport'][_0x613b('0x2b')]);_0x471a07[_0x613b('0x30')]=_['keys'](_0x1f4c2d['query']);_0x471a07[_0x613b('0x32')]=_[_0x613b('0x33')](_0x471a07[_0x613b('0x2f')],_0x471a07[_0x613b('0x30')]);_0xedd980['attributes']=_[_0x613b('0x33')](_0x471a07[_0x613b('0x2f')],qs['fields'](_0x1f4c2d['query'][_0x613b('0x35')]));_0xedd980[_0x613b('0x34')]=_0xedd980[_0x613b('0x34')]['length']?_0xedd980[_0x613b('0x34')]:_0x471a07['model'];if(!_0x1f4c2d[_0x613b('0x30')][_0x613b('0x57')](_0x613b('0x37'))){_0xedd980[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x1c')]);_0xedd980['offset']=qs[_0x613b('0x19')](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x19')]);}_0xedd980[_0x613b('0x38')]=qs['sort'](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x39')]);_0xedd980['where']=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x1f4c2d[_0x613b('0x30')],_0x471a07[_0x613b('0x32')]));_0xedd980['where'][_0x613b('0x55')]=_0xe68aa0['id'];if(_0x1f4c2d[_0x613b('0x30')]['filter']){_0xedd980[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0xedd980[_0x613b('0x3a')],{'$or':_[_0x613b('0x2a')](_0xedd980[_0x613b('0x34')],function(_0x33df3f){var _0x27095d={};_0x27095d[_0x33df3f]={'$like':'%'+_0x1f4c2d[_0x613b('0x30')][_0x613b('0x3c')]+'%'};return _0x27095d;})});}_0xedd980=_[_0x613b('0x3d')]({},_0xedd980,_0x1f4c2d[_0x613b('0x4e')]);return db['JscriptyAnswerReport'][_0x613b('0x1b')]({'where':_0xedd980[_0x613b('0x3a')]})['then'](function(_0x304f92){_0x325492[_0x613b('0x1b')]=_0x304f92;if(_0x1f4c2d[_0x613b('0x30')][_0x613b('0x40')]){_0xedd980['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x613b('0x42')](_0xedd980);})[_0x613b('0x21')](function(_0x4a5881){_0x325492[_0x613b('0x56')]=_0x4a5881;return _0x325492;});}})[_0x613b('0x21')](respondWithFilteredResult(_0x54874f,_0xedd980))['catch'](handleError(_0x54874f,null));};function char(_0x40e2b6){return'number'===typeof _0x40e2b6?String[_0x613b('0x58')][_0x613b('0x59')](null,arguments):_0x40e2b6;}function needsEncapsulation(_0x6b80c4){return!!_0x6b80c4&&(_0x6b80c4['toString']()[_0x613b('0x5a')](char(0xd))>=0x0||_0x6b80c4[_0x613b('0x5b')]()[_0x613b('0x5a')](char(0xa))>=0x0||_0x6b80c4['toString']()[_0x613b('0x5a')](char(0x2c))>=0x0||_0x6b80c4[_0x613b('0x5b')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x531dcb){var _0x504a3b=char(0x22),_0x110d2b='\x5c'+char(0x22),_0x2ab1dc=_0x531dcb[_0x613b('0x5b')]()[_0x613b('0x5c')](new RegExp(_0x504a3b,'g'),_0x110d2b);return _0x504a3b+_0x2ab1dc+_0x504a3b;}exports['getSummary']=function(_0x3e6ce2,_0xdee76c,_0x57215f){var _0x4f1eaf,_0x47342e;var _0x2496c1={'where':{'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id']}};if(_0x3e6ce2[_0x613b('0x30')]['startTime']){_0x2496c1[_0x613b('0x3a')][_0x613b('0x5d')]=JSON[_0x613b('0x5e')](_0x3e6ce2['query'][_0x613b('0x5f')]);}return db[_0x613b('0x54')][_0x613b('0x42')](_0x2496c1)[_0x613b('0x21')](handleEntityNotFound(_0xdee76c,null))['then'](function(_0x1e7bcf){if(_0x1e7bcf){_0x4f1eaf=_0x1e7bcf;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x613b('0x2a')](_0x4f1eaf,'id')},'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id']},'order':_0x613b('0x60')});}})['then'](handleEntityNotFound(_0xdee76c,null))['then'](function(_0x32b661){if(_0x32b661){_0x47342e=_0x32b661;var _0x41f51f={};for(var _0x3520c0=0x0,_0xa548ef=_0x47342e[_0x613b('0x36')];_0x3520c0<_0xa548ef;_0x3520c0++){if(!_0x41f51f[_0x613b('0x57')](_0x47342e[_0x3520c0][_0x613b('0x61')])){_0x41f51f[_0x47342e[_0x3520c0]['questionId']]=needsEncapsulation(_0x47342e[_0x3520c0]['question'])?encapsulate(_0x47342e[_0x3520c0][_0x613b('0x62')]):_0x47342e[_0x3520c0][_0x613b('0x62')];}}var _0x2cc9e8=[],_0x4c6aa8={};for(var _0x35ab20=0x0,_0x4db62d=_0x4f1eaf['length'];_0x35ab20<_0x4db62d;_0x35ab20++){_0x4c6aa8={'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id'],'SessionId':_0x4f1eaf[_0x35ab20]['id'],'StartTime':moment(_0x4f1eaf[_0x35ab20][_0x613b('0x5d')])[_0x613b('0x63')](_0x613b('0x64'))};for(var _0x273781=0x0,_0xb40bf=_0x47342e[_0x613b('0x36')];_0x273781<_0xb40bf;_0x273781++){if(_0x47342e[_0x273781][_0x613b('0x65')]==_0x4f1eaf[_0x35ab20]['id']&&_0x41f51f['hasOwnProperty'](_0x47342e[_0x273781][_0x613b('0x61')])){_0x4c6aa8[_0x41f51f[_0x47342e[_0x273781][_0x613b('0x61')]]]=_0x47342e[_0x273781][_0x613b('0x66')];}}for(var _0x19f46b in _0x41f51f){if(!_0x4c6aa8[_0x613b('0x57')](_0x41f51f[_0x19f46b])){_0x4c6aa8[_0x41f51f[_0x19f46b]]=null;}}_0x2cc9e8[_0x613b('0x67')](_0x4c6aa8);}return _0x2cc9e8;}})[_0x613b('0x21')](function(_0x57f907){if(!_['isEmpty'](_0x57f907)){var _0x15d682=toCsv(_0x57f907);var _0x3f0280=Date[_0x613b('0x68')]();fs[_0x613b('0x69')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280),_0x15d682);_0xdee76c[_0x613b('0x6a')]('Content-disposition',_0x613b('0x6b')+util[_0x613b('0x63')](_0x613b('0x6c'),_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280));_0xdee76c[_0x613b('0x6a')](_0x613b('0x6d'),'text/csv');return _0xdee76c[_0x613b('0x6e')](util[_0x613b('0x63')](_0x613b('0x6f'),_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280));}else{return _0xdee76c[_0x613b('0x15')](0xcc);}})[_0x613b('0x43')](handleError(_0xdee76c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 93370f4..7bce1e1 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 _0xbc8d=['moment','bluebird','path','rimraf','../../config/environment','exports','JscriptyProject','lodash','../../config/logger','api'];(function(_0x15c5b8,_0x3b670f){var _0xd45fe6=function(_0x15a775){while(--_0x15a775){_0x15c5b8['push'](_0x15c5b8['shift']());}};_0xd45fe6(++_0x3b670f);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbc8('0x0'));var util=require('util');var logger=require(_0xdbc8('0x1'))(_0xdbc8('0x2'));var moment=require(_0xdbc8('0x3'));var BPromise=require(_0xdbc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbc8('0x5'));var rimraf=require(_0xdbc8('0x6'));var config=require(_0xdbc8('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xdbc8('0x8')]=function(_0x10ede0,_0x3ee39d){return _0x10ede0['define'](_0xdbc8('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd493=['bluebird','rimraf','../../config/environment','define','JscriptyProject','lodash','../../config/logger','api'];(function(_0x271731,_0x416f84){var _0x26fe9f=function(_0x56f95a){while(--_0x56f95a){_0x271731['push'](_0x271731['shift']());}};_0x26fe9f(++_0x416f84);}(_0xd493,0x1bd));var _0x3d49=function(_0x58d26b,_0xf54d6e){_0x58d26b=_0x58d26b-0x0;var _0x3fbbe1=_0xd493[_0x58d26b];return _0x3fbbe1;};'use strict';var _=require(_0x3d49('0x0'));var util=require('util');var logger=require(_0x3d49('0x1'))(_0x3d49('0x2'));var moment=require('moment');var BPromise=require(_0x3d49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d49('0x4'));var config=require(_0x3d49('0x5'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1550e0,_0x1316f4){return _0x1550e0[_0x3d49('0x6')](_0x3d49('0x7'),attributes,{'tableName':'jscripty_projects','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 c8f44c8..97b57a0 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x47e313,_0x178999){var _0x551c92=function(_0x45a39c){while(--_0x45a39c){_0x47e313['push'](_0x47e313['shift']());}};_0x551c92(++_0x178999);}(_0xe706,0xa3));var _0x6e70=function(_0x4f2039,_0x528e8e){_0x4f2039=_0x4f2039-0x0;var _0x9643db=_0xe706[_0x4f2039];return _0x9643db;};'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']('JscriptyProject,\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']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\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(_0x5558fb,_0xe6bb5e){var _0x11368d=function(_0x4f0cd6){while(--_0x4f0cd6){_0x5558fb['push'](_0x5558fb['shift']());}};_0x11368d(++_0xe6bb5e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1d6879,_0x23c6a4){_0x1d6879=_0x1d6879-0x0;var _0x4a3a0d=_0xf4eb[_0x1d6879];return _0x4a3a0d;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9eab0ce..fb97652 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 _0x17f1=['./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x17f1,0x174));var _0x117f=function(_0x5596a2,_0x46816d){_0x5596a2=_0x5596a2-0x0;var _0x12dbe1=_0x17f1[_0x5596a2];return _0x12dbe1;};'use strict';var multer=require(_0x117f('0x0'));var util=require(_0x117f('0x1'));var path=require(_0x117f('0x2'));var timeout=require(_0x117f('0x3'));var express=require(_0x117f('0x4'));var router=express[_0x117f('0x5')]();var fs_extra=require(_0x117f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x117f('0x7'));var controller=require(_0x117f('0x8'));router[_0x117f('0x9')]('/',auth[_0x117f('0xa')](),controller['index']);router['get'](_0x117f('0xb'),auth[_0x117f('0xa')](),controller['describe']);router['get'](_0x117f('0xc'),auth[_0x117f('0xa')](),controller[_0x117f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x117f('0xe')]);router[_0x117f('0xf')](_0x117f('0xc'),auth[_0x117f('0xa')](),controller[_0x117f('0x10')]);router[_0x117f('0x11')](_0x117f('0xc'),auth[_0x117f('0xa')](),controller[_0x117f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf104=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','show','create','put'];(function(_0x215de2,_0x4b0c1f){var _0x14a8d1=function(_0x39adf0){while(--_0x39adf0){_0x215de2['push'](_0x215de2['shift']());}};_0x14a8d1(++_0x4b0c1f);}(_0xf104,0x19d));var _0x4f10=function(_0x50913c,_0x1476fb){_0x50913c=_0x50913c-0x0;var _0x26cab=_0xf104[_0x50913c];return _0x26cab;};'use strict';var multer=require(_0x4f10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f10('0x1'));var express=require(_0x4f10('0x2'));var router=express['Router']();var fs_extra=require(_0x4f10('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f10('0x4'));router[_0x4f10('0x5')]('/',auth['isAuthenticated'](),controller[_0x4f10('0x6')]);router[_0x4f10('0x5')](_0x4f10('0x7'),auth[_0x4f10('0x8')](),controller['describe']);router['get']('/:id',auth[_0x4f10('0x8')](),controller[_0x4f10('0x9')]);router['post']('/',auth[_0x4f10('0x8')](),controller[_0x4f10('0xa')]);router[_0x4f10('0xb')](_0x4f10('0xc'),auth[_0x4f10('0x8')](),controller[_0x4f10('0xd')]);router[_0x4f10('0xe')](_0x4f10('0xc'),auth[_0x4f10('0x8')](),controller[_0x4f10('0xf')]);module[_0x4f10('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 90c5094..b069859 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x3fb0c5,_0xaeee5b){_0x3fb0c5=_0x3fb0c5-0x0;var _0xb71dd5=_0x7a54[_0x3fb0c5];return _0xb71dd5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0x18ae2c,_0x3a0477){_0x18ae2c=_0x18ae2c-0x0;var _0x121fe3=_0x7a54[_0x18ae2c];return _0x121fe3;};'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 c82428b..d1b92b1 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 _0xab93=['JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','update','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','name','send','index'];(function(_0x250809,_0x4483c5){var _0x5b6108=function(_0x1a13cb){while(--_0x1a13cb){_0x250809['push'](_0x250809['shift']());}};_0x5b6108(++_0x4483c5);}(_0xab93,0x68));var _0x3ab9=function(_0xa89325,_0x53d83a){_0xa89325=_0xa89325-0x0;var _0x1afc96=_0xab93[_0xa89325];return _0x1afc96;};'use strict';var emlformat=require(_0x3ab9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ab9('0x1'));var rp=require(_0x3ab9('0x2'));var moment=require(_0x3ab9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3ab9('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3ab9('0x5'));var csv=require(_0x3ab9('0x6'));var ejs=require(_0x3ab9('0x7'));var fs=require('fs');var fs_extra=require(_0x3ab9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3ab9('0x9'));var jsforce=require(_0x3ab9('0xa'));var deskjs=require(_0x3ab9('0xb'));var toCsv=require(_0x3ab9('0x6'));var querystring=require('querystring');var Papa=require(_0x3ab9('0xc'));var Redis=require('ioredis');var authService=require(_0x3ab9('0xd'));var qs=require(_0x3ab9('0xe'));var as=require(_0x3ab9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ab9('0x10'))(_0x3ab9('0x11'));var utils=require('../../config/utils');var config=require(_0x3ab9('0x12'));var licenseUtil=require(_0x3ab9('0x13'));var db=require(_0x3ab9('0x14'))['db'];function respondWithStatusCode(_0x412acd,_0x1f493d){_0x1f493d=_0x1f493d||0xcc;return function(_0x336760){if(_0x336760){return _0x412acd[_0x3ab9('0x15')](_0x1f493d);}return _0x412acd[_0x3ab9('0x16')](_0x1f493d)['end']();};}function respondWithResult(_0x515517,_0x3f67d8){_0x3f67d8=_0x3f67d8||0xc8;return function(_0x2adacd){if(_0x2adacd){return _0x515517[_0x3ab9('0x16')](_0x3f67d8)[_0x3ab9('0x17')](_0x2adacd);}};}function respondWithFilteredResult(_0x45a0b2,_0x13519b){return function(_0xb55173){if(_0xb55173){var _0x1254cb=typeof _0x13519b[_0x3ab9('0x18')]===_0x3ab9('0x19')&&typeof _0x13519b[_0x3ab9('0x1a')]===_0x3ab9('0x19');var _0x736476=_0xb55173['count'];var _0x8bd150=_0x1254cb?0x0:_0x13519b[_0x3ab9('0x18')];var _0x16f1e2=_0x1254cb?_0xb55173[_0x3ab9('0x1b')]:_0x13519b[_0x3ab9('0x18')]+_0x13519b['limit'];var _0x223f84;if(_0x16f1e2>=_0x736476){_0x16f1e2=_0x736476;_0x223f84=0xc8;}else{_0x223f84=0xce;}_0x45a0b2[_0x3ab9('0x16')](_0x223f84);return _0x45a0b2[_0x3ab9('0x1c')](_0x3ab9('0x1d'),_0x8bd150+'-'+_0x16f1e2+'/'+_0x736476)[_0x3ab9('0x17')](_0xb55173);}return null;};}function patchUpdates(_0x2cc2cf){return function(_0x4f3a45){try{jsonpatch[_0x3ab9('0x1e')](_0x4f3a45,_0x2cc2cf,!![]);}catch(_0x1e81fc){return BPromise['reject'](_0x1e81fc);}return _0x4f3a45[_0x3ab9('0x1f')]();};}function saveUpdates(_0x54118f,_0x2edf5e){return function(_0x43ffd1){if(_0x43ffd1){return _0x43ffd1['update'](_0x54118f)[_0x3ab9('0x20')](function(_0x1aeb62){return _0x1aeb62;});}return null;};}function removeEntity(_0x17a3b3,_0x49c3e0){return function(_0x22e28c){if(_0x22e28c){return _0x22e28c[_0x3ab9('0x21')]()[_0x3ab9('0x20')](function(){_0x17a3b3[_0x3ab9('0x16')](0xcc)[_0x3ab9('0x22')]();});}};}function handleEntityNotFound(_0x457a86,_0x5db054){return function(_0x5dde08){if(!_0x5dde08){_0x457a86[_0x3ab9('0x15')](0x194);}return _0x5dde08;};}function handleError(_0x24d06f,_0x3cbdec){_0x3cbdec=_0x3cbdec||0x1f4;return function(_0x173b0b){logger['error'](_0x173b0b['stack']);if(_0x173b0b[_0x3ab9('0x23')]){delete _0x173b0b[_0x3ab9('0x23')];}_0x24d06f[_0x3ab9('0x16')](_0x3cbdec)[_0x3ab9('0x24')](_0x173b0b);};}exports[_0x3ab9('0x25')]=function(_0x235ecc,_0x40dcf7){var _0x232523={},_0x41e047={},_0x233158={'count':0x0,'rows':[]};var _0x452fc0=_['map'](db[_0x3ab9('0x26')]['rawAttributes'],function(_0xeecf83){return{'name':_0xeecf83[_0x3ab9('0x27')],'type':_0xeecf83[_0x3ab9('0x28')][_0x3ab9('0x29')]};});_0x41e047[_0x3ab9('0x2a')]=_[_0x3ab9('0x2b')](_0x452fc0,'name');_0x41e047['query']=_['keys'](_0x235ecc[_0x3ab9('0x2c')]);_0x41e047['filters']=_[_0x3ab9('0x2d')](_0x41e047[_0x3ab9('0x2a')],_0x41e047[_0x3ab9('0x2c')]);_0x232523[_0x3ab9('0x2e')]=_[_0x3ab9('0x2d')](_0x41e047['model'],qs[_0x3ab9('0x2f')](_0x235ecc['query'][_0x3ab9('0x2f')]));_0x232523[_0x3ab9('0x2e')]=_0x232523[_0x3ab9('0x2e')][_0x3ab9('0x30')]?_0x232523[_0x3ab9('0x2e')]:_0x41e047[_0x3ab9('0x2a')];if(!_0x235ecc['query'][_0x3ab9('0x31')]('nolimit')){_0x232523['limit']=qs['limit'](_0x235ecc[_0x3ab9('0x2c')][_0x3ab9('0x1a')]);_0x232523[_0x3ab9('0x18')]=qs['offset'](_0x235ecc[_0x3ab9('0x2c')][_0x3ab9('0x18')]);}_0x232523[_0x3ab9('0x32')]=qs[_0x3ab9('0x33')](_0x235ecc['query'][_0x3ab9('0x33')]);_0x232523[_0x3ab9('0x34')]=qs[_0x3ab9('0x35')](_[_0x3ab9('0x36')](_0x235ecc[_0x3ab9('0x2c')],_0x41e047[_0x3ab9('0x35')]),_0x452fc0);if(_0x235ecc[_0x3ab9('0x2c')][_0x3ab9('0x37')]){_0x232523[_0x3ab9('0x34')]=_['merge'](_0x232523['where'],{'$or':_[_0x3ab9('0x2b')](_0x452fc0,function(_0x2937cd){if(_0x2937cd[_0x3ab9('0x28')]!=='VIRTUAL'){var _0x1e2607={};_0x1e2607[_0x2937cd[_0x3ab9('0x23')]]={'$like':'%'+_0x235ecc['query'][_0x3ab9('0x37')]+'%'};return _0x1e2607;}})});}_0x232523=_[_0x3ab9('0x38')]({},_0x232523,_0x235ecc['options']);var _0x2dd8ee={'where':_0x232523[_0x3ab9('0x34')]};return db[_0x3ab9('0x26')][_0x3ab9('0x1b')](_0x2dd8ee)[_0x3ab9('0x20')](function(_0x3676ac){_0x233158[_0x3ab9('0x1b')]=_0x3676ac;if(_0x235ecc[_0x3ab9('0x2c')][_0x3ab9('0x39')]){_0x232523[_0x3ab9('0x3a')]=[{'all':!![]}];}return db[_0x3ab9('0x26')][_0x3ab9('0x3b')](_0x232523);})['then'](function(_0x4a2b03){_0x233158[_0x3ab9('0x3c')]=_0x4a2b03;return _0x233158;})[_0x3ab9('0x20')](respondWithFilteredResult(_0x40dcf7,_0x232523))['catch'](handleError(_0x40dcf7,null));};exports[_0x3ab9('0x3d')]=function(_0xb20cb1,_0x13f0ea){var _0x49d3c8={'raw':!![],'where':{'id':_0xb20cb1[_0x3ab9('0x3e')]['id']}},_0x15cba9={};_0x15cba9[_0x3ab9('0x2a')]=_[_0x3ab9('0x3f')](db['JscriptyQuestionReport'][_0x3ab9('0x40')]);_0x15cba9[_0x3ab9('0x2c')]=_[_0x3ab9('0x3f')](_0xb20cb1[_0x3ab9('0x2c')]);_0x15cba9['filters']=_['intersection'](_0x15cba9['model'],_0x15cba9['query']);_0x49d3c8[_0x3ab9('0x2e')]=_[_0x3ab9('0x2d')](_0x15cba9[_0x3ab9('0x2a')],qs[_0x3ab9('0x2f')](_0xb20cb1[_0x3ab9('0x2c')][_0x3ab9('0x2f')]));_0x49d3c8['attributes']=_0x49d3c8['attributes'][_0x3ab9('0x30')]?_0x49d3c8['attributes']:_0x15cba9[_0x3ab9('0x2a')];if(_0xb20cb1[_0x3ab9('0x2c')][_0x3ab9('0x39')]){_0x49d3c8['include']=[{'all':!![]}];}_0x49d3c8=_[_0x3ab9('0x38')]({},_0x49d3c8,_0xb20cb1['options']);return db['JscriptyQuestionReport'][_0x3ab9('0x41')](_0x49d3c8)[_0x3ab9('0x20')](handleEntityNotFound(_0x13f0ea,null))[_0x3ab9('0x20')](respondWithResult(_0x13f0ea,null))[_0x3ab9('0x42')](handleError(_0x13f0ea,null));};exports[_0x3ab9('0x43')]=function(_0x45ae5b,_0x405570){return db[_0x3ab9('0x26')]['create'](_0x45ae5b['body'],{})[_0x3ab9('0x20')](respondWithResult(_0x405570,0xc9))[_0x3ab9('0x42')](handleError(_0x405570,null));};exports[_0x3ab9('0x44')]=function(_0x4e8677,_0x4689ce){if(_0x4e8677[_0x3ab9('0x45')]['id']){delete _0x4e8677[_0x3ab9('0x45')]['id'];}return db[_0x3ab9('0x26')][_0x3ab9('0x41')]({'where':{'id':_0x4e8677[_0x3ab9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4689ce,null))['then'](saveUpdates(_0x4e8677[_0x3ab9('0x45')],null))['then'](respondWithResult(_0x4689ce,null))[_0x3ab9('0x42')](handleError(_0x4689ce,null));};exports[_0x3ab9('0x21')]=function(_0x2741dc,_0x29fdc4){return db[_0x3ab9('0x26')][_0x3ab9('0x41')]({'where':{'id':_0x2741dc[_0x3ab9('0x3e')]['id']}})[_0x3ab9('0x20')](handleEntityNotFound(_0x29fdc4,null))[_0x3ab9('0x20')](removeEntity(_0x29fdc4,null))[_0x3ab9('0x42')](handleError(_0x29fdc4,null));};exports[_0x3ab9('0x46')]=function(_0x3cd1ba,_0x384254){return db[_0x3ab9('0x26')][_0x3ab9('0x46')]()[_0x3ab9('0x20')](respondWithResult(_0x384254,null))[_0x3ab9('0x42')](handleError(_0x384254,null));}; \ No newline at end of file +var _0x42a4=['type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport'];(function(_0x1ad4d7,_0x2a0e06){var _0x8d319f=function(_0x44af61){while(--_0x44af61){_0x1ad4d7['push'](_0x1ad4d7['shift']());}};_0x8d319f(++_0x2a0e06);}(_0x42a4,0xb3));var _0x442a=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x42a4[_0x5c846d];return _0xd064e4;};'use strict';var emlformat=require(_0x442a('0x0'));var rimraf=require(_0x442a('0x1'));var zipdir=require(_0x442a('0x2'));var jsonpatch=require(_0x442a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x442a('0x4'));var Mustache=require(_0x442a('0x5'));var util=require(_0x442a('0x6'));var path=require(_0x442a('0x7'));var sox=require(_0x442a('0x8'));var csv=require(_0x442a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x442a('0xa'));var _=require(_0x442a('0xb'));var squel=require(_0x442a('0xc'));var crypto=require(_0x442a('0xd'));var jsforce=require(_0x442a('0xe'));var deskjs=require(_0x442a('0xf'));var toCsv=require(_0x442a('0x9'));var querystring=require('querystring');var Papa=require(_0x442a('0x10'));var Redis=require(_0x442a('0x11'));var authService=require(_0x442a('0x12'));var qs=require(_0x442a('0x13'));var as=require(_0x442a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x442a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x442a('0x16'));var licenseUtil=require(_0x442a('0x17'));var db=require(_0x442a('0x18'))['db'];function respondWithStatusCode(_0x250108,_0x3a0812){_0x3a0812=_0x3a0812||0xcc;return function(_0x17b031){if(_0x17b031){return _0x250108[_0x442a('0x19')](_0x3a0812);}return _0x250108[_0x442a('0x1a')](_0x3a0812)[_0x442a('0x1b')]();};}function respondWithResult(_0x53dbed,_0x5ee57c){_0x5ee57c=_0x5ee57c||0xc8;return function(_0x20a73b){if(_0x20a73b){return _0x53dbed['status'](_0x5ee57c)[_0x442a('0x1c')](_0x20a73b);}};}function respondWithFilteredResult(_0x1159b3,_0x4bd9f8){return function(_0x2b3065){if(_0x2b3065){var _0x16cdd4=typeof _0x4bd9f8[_0x442a('0x1d')]===_0x442a('0x1e')&&typeof _0x4bd9f8[_0x442a('0x1f')]===_0x442a('0x1e');var _0x58c2bd=_0x2b3065[_0x442a('0x20')];var _0x598249=_0x16cdd4?0x0:_0x4bd9f8['offset'];var _0xdc763e=_0x16cdd4?_0x2b3065[_0x442a('0x20')]:_0x4bd9f8[_0x442a('0x1d')]+_0x4bd9f8[_0x442a('0x1f')];var _0xee7d16;if(_0xdc763e>=_0x58c2bd){_0xdc763e=_0x58c2bd;_0xee7d16=0xc8;}else{_0xee7d16=0xce;}_0x1159b3[_0x442a('0x1a')](_0xee7d16);return _0x1159b3[_0x442a('0x21')](_0x442a('0x22'),_0x598249+'-'+_0xdc763e+'/'+_0x58c2bd)['json'](_0x2b3065);}return null;};}function patchUpdates(_0x183862){return function(_0x5ca2ad){try{jsonpatch[_0x442a('0x23')](_0x5ca2ad,_0x183862,!![]);}catch(_0x4c36f7){return BPromise['reject'](_0x4c36f7);}return _0x5ca2ad[_0x442a('0x24')]();};}function saveUpdates(_0x3a87a3,_0x1f2cf2){return function(_0x443324){if(_0x443324){return _0x443324[_0x442a('0x25')](_0x3a87a3)[_0x442a('0x26')](function(_0x1a12c7){return _0x1a12c7;});}return null;};}function removeEntity(_0x6347f2,_0x1b6459){return function(_0x853897){if(_0x853897){return _0x853897[_0x442a('0x27')]()[_0x442a('0x26')](function(){_0x6347f2[_0x442a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c123a,_0x2ea035){return function(_0x31ac6a){if(!_0x31ac6a){_0x2c123a[_0x442a('0x19')](0x194);}return _0x31ac6a;};}function handleError(_0x2b7eea,_0x26f9b9){_0x26f9b9=_0x26f9b9||0x1f4;return function(_0x3cc8c6){logger[_0x442a('0x28')](_0x3cc8c6['stack']);if(_0x3cc8c6[_0x442a('0x29')]){delete _0x3cc8c6['name'];}_0x2b7eea['status'](_0x26f9b9)[_0x442a('0x2a')](_0x3cc8c6);};}exports[_0x442a('0x2b')]=function(_0x2890b5,_0x481077){var _0x455687={},_0x1fcd79={},_0x463051={'count':0x0,'rows':[]};var _0x5dd647=_[_0x442a('0x2c')](db[_0x442a('0x2d')]['rawAttributes'],function(_0x138897){return{'name':_0x138897['fieldName'],'type':_0x138897[_0x442a('0x2e')]['key']};});_0x1fcd79[_0x442a('0x2f')]=_[_0x442a('0x2c')](_0x5dd647,_0x442a('0x29'));_0x1fcd79[_0x442a('0x30')]=_[_0x442a('0x31')](_0x2890b5['query']);_0x1fcd79[_0x442a('0x32')]=_['intersection'](_0x1fcd79[_0x442a('0x2f')],_0x1fcd79[_0x442a('0x30')]);_0x455687[_0x442a('0x33')]=_[_0x442a('0x34')](_0x1fcd79[_0x442a('0x2f')],qs[_0x442a('0x35')](_0x2890b5['query']['fields']));_0x455687[_0x442a('0x33')]=_0x455687[_0x442a('0x33')]['length']?_0x455687[_0x442a('0x33')]:_0x1fcd79[_0x442a('0x2f')];if(!_0x2890b5[_0x442a('0x30')][_0x442a('0x36')](_0x442a('0x37'))){_0x455687[_0x442a('0x1f')]=qs[_0x442a('0x1f')](_0x2890b5[_0x442a('0x30')][_0x442a('0x1f')]);_0x455687[_0x442a('0x1d')]=qs[_0x442a('0x1d')](_0x2890b5[_0x442a('0x30')]['offset']);}_0x455687[_0x442a('0x38')]=qs['sort'](_0x2890b5[_0x442a('0x30')][_0x442a('0x39')]);_0x455687[_0x442a('0x3a')]=qs[_0x442a('0x32')](_[_0x442a('0x3b')](_0x2890b5[_0x442a('0x30')],_0x1fcd79[_0x442a('0x32')]),_0x5dd647);if(_0x2890b5[_0x442a('0x30')][_0x442a('0x3c')]){_0x455687[_0x442a('0x3a')]=_[_0x442a('0x3d')](_0x455687[_0x442a('0x3a')],{'$or':_[_0x442a('0x2c')](_0x5dd647,function(_0x458a67){if(_0x458a67[_0x442a('0x2e')]!==_0x442a('0x3e')){var _0xf11904={};_0xf11904[_0x458a67[_0x442a('0x29')]]={'$like':'%'+_0x2890b5['query'][_0x442a('0x3c')]+'%'};return _0xf11904;}})});}_0x455687=_[_0x442a('0x3d')]({},_0x455687,_0x2890b5[_0x442a('0x3f')]);var _0x54e154={'where':_0x455687[_0x442a('0x3a')]};return db[_0x442a('0x2d')][_0x442a('0x20')](_0x54e154)[_0x442a('0x26')](function(_0x2ef5c6){_0x463051['count']=_0x2ef5c6;if(_0x2890b5[_0x442a('0x30')]['includeAll']){_0x455687[_0x442a('0x40')]=[{'all':!![]}];}return db[_0x442a('0x2d')][_0x442a('0x41')](_0x455687);})[_0x442a('0x26')](function(_0x258218){_0x463051['rows']=_0x258218;return _0x463051;})['then'](respondWithFilteredResult(_0x481077,_0x455687))[_0x442a('0x42')](handleError(_0x481077,null));};exports[_0x442a('0x43')]=function(_0x46c250,_0x4254ee){var _0x279c4e={'raw':!![],'where':{'id':_0x46c250[_0x442a('0x44')]['id']}},_0x51b03f={};_0x51b03f['model']=_[_0x442a('0x31')](db['JscriptyQuestionReport']['rawAttributes']);_0x51b03f['query']=_['keys'](_0x46c250[_0x442a('0x30')]);_0x51b03f['filters']=_[_0x442a('0x34')](_0x51b03f['model'],_0x51b03f[_0x442a('0x30')]);_0x279c4e[_0x442a('0x33')]=_[_0x442a('0x34')](_0x51b03f['model'],qs[_0x442a('0x35')](_0x46c250[_0x442a('0x30')][_0x442a('0x35')]));_0x279c4e[_0x442a('0x33')]=_0x279c4e['attributes'][_0x442a('0x45')]?_0x279c4e[_0x442a('0x33')]:_0x51b03f[_0x442a('0x2f')];if(_0x46c250[_0x442a('0x30')][_0x442a('0x46')]){_0x279c4e['include']=[{'all':!![]}];}_0x279c4e=_['merge']({},_0x279c4e,_0x46c250[_0x442a('0x3f')]);return db['JscriptyQuestionReport']['find'](_0x279c4e)[_0x442a('0x26')](handleEntityNotFound(_0x4254ee,null))[_0x442a('0x26')](respondWithResult(_0x4254ee,null))['catch'](handleError(_0x4254ee,null));};exports[_0x442a('0x47')]=function(_0x32c3a2,_0x554a37){return db['JscriptyQuestionReport']['create'](_0x32c3a2[_0x442a('0x48')],{})['then'](respondWithResult(_0x554a37,0xc9))[_0x442a('0x42')](handleError(_0x554a37,null));};exports[_0x442a('0x25')]=function(_0x3fe2ec,_0x26274a){if(_0x3fe2ec['body']['id']){delete _0x3fe2ec[_0x442a('0x48')]['id'];}return db[_0x442a('0x2d')][_0x442a('0x49')]({'where':{'id':_0x3fe2ec[_0x442a('0x44')]['id']}})[_0x442a('0x26')](handleEntityNotFound(_0x26274a,null))[_0x442a('0x26')](saveUpdates(_0x3fe2ec['body'],null))[_0x442a('0x26')](respondWithResult(_0x26274a,null))[_0x442a('0x42')](handleError(_0x26274a,null));};exports[_0x442a('0x27')]=function(_0x1b9629,_0x3d205e){return db['JscriptyQuestionReport'][_0x442a('0x49')]({'where':{'id':_0x1b9629[_0x442a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d205e,null))[_0x442a('0x26')](removeEntity(_0x3d205e,null))['catch'](handleError(_0x3d205e,null));};exports['describe']=function(_0x1f5fb4,_0x56a459){return db[_0x442a('0x2d')][_0x442a('0x4a')]()[_0x442a('0x26')](respondWithResult(_0x56a459,null))[_0x442a('0x42')](handleError(_0x56a459,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 82beb72..537094c 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 _0xb75e=['JscriptyQuestionReport','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports'];(function(_0x215dd4,_0x5af42a){var _0x44d47c=function(_0x73af27){while(--_0x73af27){_0x215dd4['push'](_0x215dd4['shift']());}};_0x44d47c(++_0x5af42a);}(_0xb75e,0xd9));var _0xeb75=function(_0x1a9eee,_0x37968f){_0x1a9eee=_0x1a9eee-0x0;var _0x16af98=_0xb75e[_0x1a9eee];return _0x16af98;};'use strict';var _=require(_0xeb75('0x0'));var util=require('util');var logger=require(_0xeb75('0x1'))('api');var moment=require(_0xeb75('0x2'));var BPromise=require(_0xeb75('0x3'));var rp=require(_0xeb75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb75('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xeb75('0x6')]=function(_0x1fa84f,_0x467bd1){return _0x1fa84f['define'](_0xeb75('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eea=['exports','define','JscriptyQuestionReport','../../config/logger','api','moment','bluebird','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0xebe7f3,_0x1ee7e6){var _0x592902=function(_0x9570bb){while(--_0x9570bb){_0xebe7f3['push'](_0xebe7f3['shift']());}};_0x592902(++_0x1ee7e6);}(_0x2eea,0xb7));var _0xa2ee=function(_0xc9bd00,_0x28d3dc){_0xc9bd00=_0xc9bd00-0x0;var _0x374392=_0x2eea[_0xc9bd00];return _0x374392;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2ee('0x0'))(_0xa2ee('0x1'));var moment=require(_0xa2ee('0x2'));var BPromise=require(_0xa2ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa2ee('0x4'));var attributes=require(_0xa2ee('0x5'));module[_0xa2ee('0x6')]=function(_0x31ae69,_0x56e5a2){return _0x31ae69[_0xa2ee('0x7')](_0xa2ee('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 82fb720..bc10eee 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 _0xdb3f=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x44ad93,_0x3993c1){var _0x305cf7=function(_0x2bf20c){while(--_0x2bf20c){_0x44ad93['push'](_0x44ad93['shift']());}};_0x305cf7(++_0x3993c1);}(_0xdb3f,0x1f3));var _0xfdb3=function(_0x2a4c0d,_0x326aaa){_0x2a4c0d=_0x2a4c0d-0x0;var _0x232a8b=_0xdb3f[_0x2a4c0d];return _0x232a8b;};'use strict';var _=require(_0xfdb3('0x0'));var util=require(_0xfdb3('0x1'));var moment=require(_0xfdb3('0x2'));var BPromise=require(_0xfdb3('0x3'));var rs=require(_0xfdb3('0x4'));var fs=require('fs');var Redis=require(_0xfdb3('0x5'));var db=require(_0xfdb3('0x6'))['db'];var utils=require(_0xfdb3('0x7'));var logger=require(_0xfdb3('0x8'))(_0xfdb3('0x9'));var config=require('../../config/environment');var jayson=require(_0xfdb3('0xa'));var client=jayson['client'][_0xfdb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1521e7,_0x1f2526,_0xec1e72){return new BPromise(function(_0x3c811e,_0x1cf1d1){return client[_0xfdb3('0xc')](_0x1521e7,_0xec1e72)['then'](function(_0xd9f234){logger['info'](_0xfdb3('0xd'),_0x1f2526,_0xfdb3('0xe'));logger[_0xfdb3('0xf')](_0xfdb3('0x10'),_0x1f2526,_0xfdb3('0xe'),JSON['stringify'](_0xd9f234));if(_0xd9f234['error']){if(_0xd9f234[_0xfdb3('0x11')][_0xfdb3('0x12')]===0x1f4){logger[_0xfdb3('0x11')](_0xfdb3('0xd'),_0x1f2526,_0xd9f234[_0xfdb3('0x11')][_0xfdb3('0x13')]);return _0x1cf1d1(_0xd9f234['error'][_0xfdb3('0x13')]);}logger[_0xfdb3('0x11')](_0xfdb3('0xd'),_0x1f2526,_0xd9f234[_0xfdb3('0x11')][_0xfdb3('0x13')]);return _0x3c811e(_0xd9f234[_0xfdb3('0x11')][_0xfdb3('0x13')]);}else{logger[_0xfdb3('0x14')](_0xfdb3('0xd'),_0x1f2526,_0xfdb3('0xe'));_0x3c811e(_0xd9f234[_0xfdb3('0x15')][_0xfdb3('0x13')]);}})[_0xfdb3('0x16')](function(_0x5961a8){logger['error'](_0xfdb3('0xd'),_0x1f2526,_0x5961a8);_0x1cf1d1(_0x5961a8);});});} \ No newline at end of file +var _0x585e=['info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/environment','client','http','request','then'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x585e,0x186));var _0xe585=function(_0x5bcafe,_0x5709ce){_0x5bcafe=_0x5bcafe-0x0;var _0x2a3d1e=_0x585e[_0x5bcafe];return _0x2a3d1e;};'use strict';var _=require(_0xe585('0x0'));var util=require('util');var moment=require(_0xe585('0x1'));var BPromise=require('bluebird');var rs=require(_0xe585('0x2'));var fs=require('fs');var Redis=require(_0xe585('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe585('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe585('0x5')][_0xe585('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2437ba,_0x2bbe97,_0x1c084d){return new BPromise(function(_0x10a345,_0x3e8b5d){return client[_0xe585('0x7')](_0x2437ba,_0x1c084d)[_0xe585('0x8')](function(_0x35e790){logger[_0xe585('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2bbe97,'request\x20sent');logger[_0xe585('0xa')](_0xe585('0xb'),_0x2bbe97,'request\x20sent',JSON[_0xe585('0xc')](_0x35e790));if(_0x35e790['error']){if(_0x35e790[_0xe585('0xd')][_0xe585('0xe')]===0x1f4){logger[_0xe585('0xd')](_0xe585('0xf'),_0x2bbe97,_0x35e790[_0xe585('0xd')][_0xe585('0x10')]);return _0x3e8b5d(_0x35e790[_0xe585('0xd')]['message']);}logger['error'](_0xe585('0xf'),_0x2bbe97,_0x35e790[_0xe585('0xd')][_0xe585('0x10')]);return _0x10a345(_0x35e790['error'][_0xe585('0x10')]);}else{logger[_0xe585('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2bbe97,'request\x20sent');_0x10a345(_0x35e790[_0xe585('0x11')]['message']);}})[_0xe585('0x12')](function(_0x4b0fa5){logger[_0xe585('0xd')](_0xe585('0xf'),_0x2bbe97,_0x4b0fa5);_0x3e8b5d(_0x4b0fa5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 17adbe2..81cbb22 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 _0x5aa4=['describe','/:id','show','/:id/questions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe'];(function(_0x2cc659,_0x3981c0){var _0x37c538=function(_0x29778b){while(--_0x29778b){_0x2cc659['push'](_0x2cc659['shift']());}};_0x37c538(++_0x3981c0);}(_0x5aa4,0xa4));var _0x45aa=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x5aa4[_0x51d129];return _0x44c377;};'use strict';var multer=require(_0x45aa('0x0'));var util=require(_0x45aa('0x1'));var path=require(_0x45aa('0x2'));var timeout=require(_0x45aa('0x3'));var express=require('express');var router=express[_0x45aa('0x4')]();var fs_extra=require(_0x45aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x45aa('0x6'));var config=require(_0x45aa('0x7'));var controller=require(_0x45aa('0x8'));router[_0x45aa('0x9')]('/',auth[_0x45aa('0xa')](),controller['index']);router[_0x45aa('0x9')](_0x45aa('0xb'),auth['isAuthenticated'](),controller[_0x45aa('0xc')]);router[_0x45aa('0x9')](_0x45aa('0xd'),auth['isAuthenticated'](),controller[_0x45aa('0xe')]);router[_0x45aa('0x9')](_0x45aa('0xf'),auth[_0x45aa('0xa')](),controller['getQuestions']);router[_0x45aa('0x10')]('/',auth[_0x45aa('0xa')](),controller[_0x45aa('0x11')]);router[_0x45aa('0x12')](_0x45aa('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x45aa('0x13')](_0x45aa('0xd'),auth[_0x45aa('0xa')](),controller[_0x45aa('0x14')]);module[_0x45aa('0x15')]=router; \ No newline at end of file +var _0xb16a=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','/:id','update'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xb16a,0x1a6));var _0xab16=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb16a[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xab16('0x0'));var util=require(_0xab16('0x1'));var path=require(_0xab16('0x2'));var timeout=require(_0xab16('0x3'));var express=require('express');var router=express[_0xab16('0x4')]();var fs_extra=require(_0xab16('0x5'));var auth=require(_0xab16('0x6'));var interaction=require(_0xab16('0x7'));var config=require(_0xab16('0x8'));var controller=require(_0xab16('0x9'));router[_0xab16('0xa')]('/',auth[_0xab16('0xb')](),controller[_0xab16('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xab16('0xd')]);router[_0xab16('0xa')]('/:id',auth[_0xab16('0xb')](),controller[_0xab16('0xe')]);router[_0xab16('0xa')](_0xab16('0xf'),auth['isAuthenticated'](),controller[_0xab16('0x10')]);router['post']('/',auth[_0xab16('0xb')](),controller['create']);router['put'](_0xab16('0x11'),auth[_0xab16('0xb')](),controller[_0xab16('0x12')]);router[_0xab16('0x13')](_0xab16('0x11'),auth[_0xab16('0xb')](),controller['destroy']);module[_0xab16('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 89d8413..bb9e56d 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 _0x5120=['DATE','setDataValue','starttime','STRING','BOOLEAN','sequelize'];(function(_0x17b46b,_0x5a388e){var _0x4c0667=function(_0x333e70){while(--_0x333e70){_0x17b46b['push'](_0x17b46b['shift']());}};_0x4c0667(++_0x5a388e);}(_0x5120,0x179));var _0x0512=function(_0x1915e5,_0xe53420){_0x1915e5=_0x1915e5-0x0;var _0x148dd0=_0x5120[_0x1915e5];return _0x148dd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x0512('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x0512('0x1')],'set':function(_0x2b090f){this[_0x0512('0x2')](_0x0512('0x3'),_0x2b090f);this[_0x0512('0x2')]('endtime',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x0512('0x1')]},'membername':{'type':Sequelize[_0x0512('0x4')]},'projectname':{'type':Sequelize[_0x0512('0x4')]},'queue':{'type':Sequelize[_0x0512('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0512('0x4')]},'completed':{'type':Sequelize[_0x0512('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x2cfd=['exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize'];(function(_0x1e267a,_0x3ab894){var _0x4f8c89=function(_0x2a1124){while(--_0x2a1124){_0x1e267a['push'](_0x1e267a['shift']());}};_0x4f8c89(++_0x3ab894);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0xd2cf('0x0'));module[_0xd2cf('0x1')]={'starttime':{'type':Sequelize[_0xd2cf('0x2')],'set':function(_0x5f1272){this[_0xd2cf('0x3')](_0xd2cf('0x4'),_0x5f1272);this['setDataValue']('endtime',moment()['format'](_0xd2cf('0x5')));}},'endtime':{'type':Sequelize[_0xd2cf('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xd2cf('0x6')]},'queue':{'type':Sequelize[_0xd2cf('0x6')]},'uniqueid':{'type':Sequelize[_0xd2cf('0x6')]},'calleridname':{'type':Sequelize[_0xd2cf('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 03edb38..2f4118e 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 _0xb2e6=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','JscriptySessionReport','findAll','rows','catch','show','params','keys','create','body','find','describe','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir'];(function(_0x4fb0e7,_0x80e2e0){var _0x12649d=function(_0x36237e){while(--_0x36237e){_0x4fb0e7['push'](_0x4fb0e7['shift']());}};_0x12649d(++_0x80e2e0);}(_0xb2e6,0x1e9));var _0x6b2e=function(_0x1c4b3e,_0x4956bf){_0x1c4b3e=_0x1c4b3e-0x0;var _0x47392b=_0xb2e6[_0x1c4b3e];return _0x47392b;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require(_0x6b2e('0x4'));var moment=require(_0x6b2e('0x5'));var BPromise=require(_0x6b2e('0x6'));var Mustache=require('mustache');var util=require(_0x6b2e('0x7'));var path=require('path');var sox=require(_0x6b2e('0x8'));var csv=require(_0x6b2e('0x9'));var ejs=require(_0x6b2e('0xa'));var fs=require('fs');var fs_extra=require(_0x6b2e('0xb'));var _=require('lodash');var squel=require(_0x6b2e('0xc'));var crypto=require(_0x6b2e('0xd'));var jsforce=require(_0x6b2e('0xe'));var deskjs=require(_0x6b2e('0xf'));var toCsv=require(_0x6b2e('0x9'));var querystring=require(_0x6b2e('0x10'));var Papa=require('papaparse');var Redis=require(_0x6b2e('0x11'));var authService=require(_0x6b2e('0x12'));var qs=require(_0x6b2e('0x13'));var as=require(_0x6b2e('0x14'));var hardwareService=require(_0x6b2e('0x15'));var logger=require(_0x6b2e('0x16'))('api');var utils=require(_0x6b2e('0x17'));var config=require(_0x6b2e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b2e('0x19'))['db'];function respondWithStatusCode(_0xe77c93,_0x2d83d8){_0x2d83d8=_0x2d83d8||0xcc;return function(_0x3486ea){if(_0x3486ea){return _0xe77c93[_0x6b2e('0x1a')](_0x2d83d8);}return _0xe77c93['status'](_0x2d83d8)['end']();};}function respondWithResult(_0x2f6d13,_0x180784){_0x180784=_0x180784||0xc8;return function(_0x8b2e72){if(_0x8b2e72){return _0x2f6d13[_0x6b2e('0x1b')](_0x180784)[_0x6b2e('0x1c')](_0x8b2e72);}};}function respondWithFilteredResult(_0x482822,_0x4ef12e){return function(_0x306561){if(_0x306561){var _0x564c=typeof _0x4ef12e[_0x6b2e('0x1d')]==='undefined'&&typeof _0x4ef12e[_0x6b2e('0x1e')]===_0x6b2e('0x1f');var _0x3ce9cc=_0x306561[_0x6b2e('0x20')];var _0x59cade=_0x564c?0x0:_0x4ef12e['offset'];var _0x590d14=_0x564c?_0x306561[_0x6b2e('0x20')]:_0x4ef12e[_0x6b2e('0x1d')]+_0x4ef12e[_0x6b2e('0x1e')];var _0x129a34;if(_0x590d14>=_0x3ce9cc){_0x590d14=_0x3ce9cc;_0x129a34=0xc8;}else{_0x129a34=0xce;}_0x482822[_0x6b2e('0x1b')](_0x129a34);return _0x482822['set'](_0x6b2e('0x21'),_0x59cade+'-'+_0x590d14+'/'+_0x3ce9cc)['json'](_0x306561);}return null;};}function patchUpdates(_0x1e9517){return function(_0x5ca96b){try{jsonpatch[_0x6b2e('0x22')](_0x5ca96b,_0x1e9517,!![]);}catch(_0x21199e){return BPromise[_0x6b2e('0x23')](_0x21199e);}return _0x5ca96b[_0x6b2e('0x24')]();};}function saveUpdates(_0x29516d,_0x22831f){return function(_0x32aa8e){if(_0x32aa8e){return _0x32aa8e[_0x6b2e('0x25')](_0x29516d)[_0x6b2e('0x26')](function(_0x48a426){return _0x48a426;});}return null;};}function removeEntity(_0xcf5ce4,_0x1e7e22){return function(_0x61d982){if(_0x61d982){return _0x61d982[_0x6b2e('0x27')]()[_0x6b2e('0x26')](function(){_0xcf5ce4['status'](0xcc)[_0x6b2e('0x28')]();});}};}function handleEntityNotFound(_0x245184,_0x179ee3){return function(_0x174310){if(!_0x174310){_0x245184[_0x6b2e('0x1a')](0x194);}return _0x174310;};}function handleError(_0x389e6e,_0x4a6317){_0x4a6317=_0x4a6317||0x1f4;return function(_0x2aee54){logger[_0x6b2e('0x29')](_0x2aee54[_0x6b2e('0x2a')]);if(_0x2aee54['name']){delete _0x2aee54['name'];}_0x389e6e[_0x6b2e('0x1b')](_0x4a6317)[_0x6b2e('0x2b')](_0x2aee54);};}exports[_0x6b2e('0x2c')]=function(_0x47a9f7,_0x2fe474){var _0x241560={},_0x1b6f4f={},_0x4687f1={'count':0x0,'rows':[]};var _0x504adf=_['map'](db['JscriptySessionReport'][_0x6b2e('0x2d')],function(_0x22bae6){return{'name':_0x22bae6[_0x6b2e('0x2e')],'type':_0x22bae6[_0x6b2e('0x2f')][_0x6b2e('0x30')]};});_0x1b6f4f[_0x6b2e('0x31')]=_['map'](_0x504adf,_0x6b2e('0x32'));_0x1b6f4f[_0x6b2e('0x33')]=_['keys'](_0x47a9f7['query']);_0x1b6f4f['filters']=_[_0x6b2e('0x34')](_0x1b6f4f[_0x6b2e('0x31')],_0x1b6f4f[_0x6b2e('0x33')]);_0x241560[_0x6b2e('0x35')]=_['intersection'](_0x1b6f4f[_0x6b2e('0x31')],qs['fields'](_0x47a9f7['query'][_0x6b2e('0x36')]));_0x241560[_0x6b2e('0x35')]=_0x241560[_0x6b2e('0x35')][_0x6b2e('0x37')]?_0x241560[_0x6b2e('0x35')]:_0x1b6f4f[_0x6b2e('0x31')];if(!_0x47a9f7[_0x6b2e('0x33')][_0x6b2e('0x38')](_0x6b2e('0x39'))){_0x241560[_0x6b2e('0x1e')]=qs[_0x6b2e('0x1e')](_0x47a9f7['query'][_0x6b2e('0x1e')]);_0x241560['offset']=qs[_0x6b2e('0x1d')](_0x47a9f7['query'][_0x6b2e('0x1d')]);}_0x241560[_0x6b2e('0x3a')]=qs[_0x6b2e('0x3b')](_0x47a9f7['query'][_0x6b2e('0x3b')]);_0x241560[_0x6b2e('0x3c')]=qs[_0x6b2e('0x3d')](_[_0x6b2e('0x3e')](_0x47a9f7['query'],_0x1b6f4f[_0x6b2e('0x3d')]),_0x504adf);if(_0x47a9f7[_0x6b2e('0x33')][_0x6b2e('0x3f')]){_0x241560[_0x6b2e('0x3c')]=_[_0x6b2e('0x40')](_0x241560['where'],{'$or':_[_0x6b2e('0x41')](_0x504adf,function(_0x4861f1){if(_0x4861f1['type']!=='VIRTUAL'){var _0x26f358={};_0x26f358[_0x4861f1[_0x6b2e('0x32')]]={'$like':'%'+_0x47a9f7['query'][_0x6b2e('0x3f')]+'%'};return _0x26f358;}})});}_0x241560=_[_0x6b2e('0x40')]({},_0x241560,_0x47a9f7[_0x6b2e('0x42')]);var _0x4d2500={'where':_0x241560[_0x6b2e('0x3c')]};return db['JscriptySessionReport'][_0x6b2e('0x20')](_0x4d2500)[_0x6b2e('0x26')](function(_0x5d1f9a){_0x4687f1[_0x6b2e('0x20')]=_0x5d1f9a;if(_0x47a9f7[_0x6b2e('0x33')][_0x6b2e('0x43')]){_0x241560[_0x6b2e('0x44')]=[{'all':!![]}];}return db[_0x6b2e('0x45')][_0x6b2e('0x46')](_0x241560);})[_0x6b2e('0x26')](function(_0x1770a8){_0x4687f1[_0x6b2e('0x47')]=_0x1770a8;return _0x4687f1;})[_0x6b2e('0x26')](respondWithFilteredResult(_0x2fe474,_0x241560))[_0x6b2e('0x48')](handleError(_0x2fe474,null));};exports[_0x6b2e('0x49')]=function(_0x14e494,_0x5f4b41){var _0x3ba0ff={'raw':!![],'where':{'id':_0x14e494[_0x6b2e('0x4a')]['id']}},_0x481b95={};_0x481b95['model']=_[_0x6b2e('0x4b')](db[_0x6b2e('0x45')][_0x6b2e('0x2d')]);_0x481b95[_0x6b2e('0x33')]=_[_0x6b2e('0x4b')](_0x14e494[_0x6b2e('0x33')]);_0x481b95['filters']=_[_0x6b2e('0x34')](_0x481b95[_0x6b2e('0x31')],_0x481b95[_0x6b2e('0x33')]);_0x3ba0ff[_0x6b2e('0x35')]=_['intersection'](_0x481b95['model'],qs[_0x6b2e('0x36')](_0x14e494['query'][_0x6b2e('0x36')]));_0x3ba0ff['attributes']=_0x3ba0ff[_0x6b2e('0x35')][_0x6b2e('0x37')]?_0x3ba0ff[_0x6b2e('0x35')]:_0x481b95['model'];if(_0x14e494[_0x6b2e('0x33')][_0x6b2e('0x43')]){_0x3ba0ff[_0x6b2e('0x44')]=[{'all':!![]}];}_0x3ba0ff=_[_0x6b2e('0x40')]({},_0x3ba0ff,_0x14e494[_0x6b2e('0x42')]);return db[_0x6b2e('0x45')]['find'](_0x3ba0ff)['then'](handleEntityNotFound(_0x5f4b41,null))[_0x6b2e('0x26')](respondWithResult(_0x5f4b41,null))[_0x6b2e('0x48')](handleError(_0x5f4b41,null));};exports[_0x6b2e('0x4c')]=function(_0x4768c4,_0x15be5b){return db[_0x6b2e('0x45')]['create'](_0x4768c4[_0x6b2e('0x4d')],{})[_0x6b2e('0x26')](respondWithResult(_0x15be5b,0xc9))[_0x6b2e('0x48')](handleError(_0x15be5b,null));};exports[_0x6b2e('0x25')]=function(_0x26952b,_0x2c7e80){if(_0x26952b[_0x6b2e('0x4d')]['id']){delete _0x26952b[_0x6b2e('0x4d')]['id'];}return db[_0x6b2e('0x45')][_0x6b2e('0x4e')]({'where':{'id':_0x26952b['params']['id']}})[_0x6b2e('0x26')](handleEntityNotFound(_0x2c7e80,null))[_0x6b2e('0x26')](saveUpdates(_0x26952b[_0x6b2e('0x4d')],null))[_0x6b2e('0x26')](respondWithResult(_0x2c7e80,null))[_0x6b2e('0x48')](handleError(_0x2c7e80,null));};exports[_0x6b2e('0x27')]=function(_0x456adf,_0x167c51){return db[_0x6b2e('0x45')][_0x6b2e('0x4e')]({'where':{'id':_0x456adf['params']['id']}})[_0x6b2e('0x26')](handleEntityNotFound(_0x167c51,null))[_0x6b2e('0x26')](removeEntity(_0x167c51,null))[_0x6b2e('0x48')](handleError(_0x167c51,null));};exports[_0x6b2e('0x4f')]=function(_0xb1d8d9,_0x14a4cd){return db[_0x6b2e('0x45')][_0x6b2e('0x4f')]()[_0x6b2e('0x26')](respondWithResult(_0x14a4cd,null))[_0x6b2e('0x48')](handleError(_0x14a4cd,null));};exports['getQuestions']=function(_0x356fa7,_0x314491,_0x5e705d){var _0x19cc96={'raw':!![],'where':{}};var _0x46f810={};var _0x3e254e={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x6b2e('0x50')]({'where':{'id':_0x356fa7['params']['id']}})['then'](handleEntityNotFound(_0x314491,null))['then'](function(_0x3e2476){if(_0x3e2476){_0x46f810[_0x6b2e('0x31')]=_[_0x6b2e('0x4b')](db['JscriptyQuestionReport']['rawAttributes']);_0x46f810[_0x6b2e('0x33')]=_[_0x6b2e('0x4b')](_0x356fa7[_0x6b2e('0x33')]);_0x46f810[_0x6b2e('0x3d')]=_['intersection'](_0x46f810[_0x6b2e('0x31')],_0x46f810[_0x6b2e('0x33')]);_0x19cc96[_0x6b2e('0x35')]=_[_0x6b2e('0x34')](_0x46f810[_0x6b2e('0x31')],qs[_0x6b2e('0x36')](_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x36')]));_0x19cc96[_0x6b2e('0x35')]=_0x19cc96[_0x6b2e('0x35')][_0x6b2e('0x37')]?_0x19cc96[_0x6b2e('0x35')]:_0x46f810[_0x6b2e('0x31')];if(!_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x38')](_0x6b2e('0x39'))){_0x19cc96[_0x6b2e('0x1e')]=qs[_0x6b2e('0x1e')](_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x1e')]);_0x19cc96[_0x6b2e('0x1d')]=qs['offset'](_0x356fa7['query'][_0x6b2e('0x1d')]);}_0x19cc96['order']=qs[_0x6b2e('0x3b')](_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x3b')]);_0x19cc96[_0x6b2e('0x3c')]=qs[_0x6b2e('0x3d')](_[_0x6b2e('0x3e')](_0x356fa7[_0x6b2e('0x33')],_0x46f810[_0x6b2e('0x3d')]));_0x19cc96['where']['SessionId']=_0x3e2476['id'];if(_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x3f')]){_0x19cc96[_0x6b2e('0x3c')]=_['merge'](_0x19cc96[_0x6b2e('0x3c')],{'$or':_['map'](_0x19cc96[_0x6b2e('0x35')],function(_0x624e57){var _0x39f1fc={};_0x39f1fc[_0x624e57]={'$like':'%'+_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x3f')]+'%'};return _0x39f1fc;})});}_0x19cc96=_[_0x6b2e('0x40')]({},_0x19cc96,_0x356fa7[_0x6b2e('0x42')]);return db['JscriptyQuestionReport']['count']({'where':_0x19cc96[_0x6b2e('0x3c')]})[_0x6b2e('0x26')](function(_0x2c738a){_0x3e254e[_0x6b2e('0x20')]=_0x2c738a;if(_0x356fa7[_0x6b2e('0x33')][_0x6b2e('0x43')]){_0x19cc96[_0x6b2e('0x44')]=[{'all':!![]}];}return db[_0x6b2e('0x51')]['findAll'](_0x19cc96);})['then'](function(_0x860fa4){_0x3e254e[_0x6b2e('0x47')]=_0x860fa4;return _0x3e254e;});}})[_0x6b2e('0x26')](respondWithFilteredResult(_0x314491,_0x19cc96))[_0x6b2e('0x48')](handleError(_0x314491,null));}; \ No newline at end of file +var _0x3bc4=['merge','JscriptySessionReport','includeAll','include','catch','show','params','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','order','SessionId','findAll','rows','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bc4,0x14d));var _0x43bc=function(_0x3fb5a8,_0x57d3f6){_0x3fb5a8=_0x3fb5a8-0x0;var _0x519841=_0x3bc4[_0x3fb5a8];return _0x519841;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43bc('0x0'));var zipdir=require(_0x43bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43bc('0x2'));var moment=require(_0x43bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x43bc('0x4'));var util=require(_0x43bc('0x5'));var path=require(_0x43bc('0x6'));var sox=require(_0x43bc('0x7'));var csv=require(_0x43bc('0x8'));var ejs=require(_0x43bc('0x9'));var fs=require('fs');var fs_extra=require(_0x43bc('0xa'));var _=require(_0x43bc('0xb'));var squel=require(_0x43bc('0xc'));var crypto=require(_0x43bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x43bc('0xe'));var toCsv=require(_0x43bc('0x8'));var querystring=require(_0x43bc('0xf'));var Papa=require(_0x43bc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43bc('0x11'));var as=require(_0x43bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43bc('0x13'))(_0x43bc('0x14'));var utils=require(_0x43bc('0x15'));var config=require(_0x43bc('0x16'));var licenseUtil=require(_0x43bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f54ec,_0x56b236){_0x56b236=_0x56b236||0xcc;return function(_0x47a2c3){if(_0x47a2c3){return _0x4f54ec['sendStatus'](_0x56b236);}return _0x4f54ec[_0x43bc('0x18')](_0x56b236)[_0x43bc('0x19')]();};}function respondWithResult(_0x4899d3,_0xf87a65){_0xf87a65=_0xf87a65||0xc8;return function(_0x2dc91c){if(_0x2dc91c){return _0x4899d3[_0x43bc('0x18')](_0xf87a65)[_0x43bc('0x1a')](_0x2dc91c);}};}function respondWithFilteredResult(_0x20f4c5,_0x410060){return function(_0x45e590){if(_0x45e590){var _0x16047c=typeof _0x410060[_0x43bc('0x1b')]===_0x43bc('0x1c')&&typeof _0x410060[_0x43bc('0x1d')]===_0x43bc('0x1c');var _0x403187=_0x45e590[_0x43bc('0x1e')];var _0x5b03df=_0x16047c?0x0:_0x410060[_0x43bc('0x1b')];var _0x3043bf=_0x16047c?_0x45e590[_0x43bc('0x1e')]:_0x410060[_0x43bc('0x1b')]+_0x410060[_0x43bc('0x1d')];var _0xf753bb;if(_0x3043bf>=_0x403187){_0x3043bf=_0x403187;_0xf753bb=0xc8;}else{_0xf753bb=0xce;}_0x20f4c5[_0x43bc('0x18')](_0xf753bb);return _0x20f4c5['set']('Content-Range',_0x5b03df+'-'+_0x3043bf+'/'+_0x403187)['json'](_0x45e590);}return null;};}function patchUpdates(_0xbe011e){return function(_0x356d3a){try{jsonpatch[_0x43bc('0x1f')](_0x356d3a,_0xbe011e,!![]);}catch(_0xe8e491){return BPromise[_0x43bc('0x20')](_0xe8e491);}return _0x356d3a[_0x43bc('0x21')]();};}function saveUpdates(_0x3f52d2,_0x2d734e){return function(_0x4b5678){if(_0x4b5678){return _0x4b5678[_0x43bc('0x22')](_0x3f52d2)[_0x43bc('0x23')](function(_0x5ad479){return _0x5ad479;});}return null;};}function removeEntity(_0x41e019,_0x55c9c0){return function(_0x15e264){if(_0x15e264){return _0x15e264[_0x43bc('0x24')]()['then'](function(){_0x41e019[_0x43bc('0x18')](0xcc)[_0x43bc('0x19')]();});}};}function handleEntityNotFound(_0x4c907a,_0x4cfb16){return function(_0x575168){if(!_0x575168){_0x4c907a[_0x43bc('0x25')](0x194);}return _0x575168;};}function handleError(_0x50eb1f,_0x938966){_0x938966=_0x938966||0x1f4;return function(_0x34679a){logger['error'](_0x34679a[_0x43bc('0x26')]);if(_0x34679a[_0x43bc('0x27')]){delete _0x34679a[_0x43bc('0x27')];}_0x50eb1f['status'](_0x938966)[_0x43bc('0x28')](_0x34679a);};}exports[_0x43bc('0x29')]=function(_0x30b97b,_0x228004){var _0x11aacd={},_0x36c808={},_0x50a21e={'count':0x0,'rows':[]};var _0x19e9ae=_['map'](db['JscriptySessionReport'][_0x43bc('0x2a')],function(_0xc7eeb7){return{'name':_0xc7eeb7['fieldName'],'type':_0xc7eeb7[_0x43bc('0x2b')][_0x43bc('0x2c')]};});_0x36c808[_0x43bc('0x2d')]=_['map'](_0x19e9ae,'name');_0x36c808[_0x43bc('0x2e')]=_[_0x43bc('0x2f')](_0x30b97b[_0x43bc('0x2e')]);_0x36c808['filters']=_[_0x43bc('0x30')](_0x36c808[_0x43bc('0x2d')],_0x36c808[_0x43bc('0x2e')]);_0x11aacd[_0x43bc('0x31')]=_['intersection'](_0x36c808['model'],qs[_0x43bc('0x32')](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x11aacd['attributes']=_0x11aacd[_0x43bc('0x31')][_0x43bc('0x33')]?_0x11aacd[_0x43bc('0x31')]:_0x36c808[_0x43bc('0x2d')];if(!_0x30b97b[_0x43bc('0x2e')]['hasOwnProperty']('nolimit')){_0x11aacd[_0x43bc('0x1d')]=qs[_0x43bc('0x1d')](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x1d')]);_0x11aacd[_0x43bc('0x1b')]=qs['offset'](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x1b')]);}_0x11aacd['order']=qs['sort'](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x34')]);_0x11aacd[_0x43bc('0x35')]=qs[_0x43bc('0x36')](_[_0x43bc('0x37')](_0x30b97b[_0x43bc('0x2e')],_0x36c808[_0x43bc('0x36')]),_0x19e9ae);if(_0x30b97b['query'][_0x43bc('0x38')]){_0x11aacd[_0x43bc('0x35')]=_[_0x43bc('0x39')](_0x11aacd[_0x43bc('0x35')],{'$or':_['map'](_0x19e9ae,function(_0x51a3b1){if(_0x51a3b1[_0x43bc('0x2b')]!=='VIRTUAL'){var _0x259304={};_0x259304[_0x51a3b1[_0x43bc('0x27')]]={'$like':'%'+_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x38')]+'%'};return _0x259304;}})});}_0x11aacd=_[_0x43bc('0x39')]({},_0x11aacd,_0x30b97b['options']);var _0x22b7c7={'where':_0x11aacd[_0x43bc('0x35')]};return db[_0x43bc('0x3a')][_0x43bc('0x1e')](_0x22b7c7)['then'](function(_0x5466e4){_0x50a21e[_0x43bc('0x1e')]=_0x5466e4;if(_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x3b')]){_0x11aacd[_0x43bc('0x3c')]=[{'all':!![]}];}return db[_0x43bc('0x3a')]['findAll'](_0x11aacd);})[_0x43bc('0x23')](function(_0x216a05){_0x50a21e['rows']=_0x216a05;return _0x50a21e;})[_0x43bc('0x23')](respondWithFilteredResult(_0x228004,_0x11aacd))[_0x43bc('0x3d')](handleError(_0x228004,null));};exports[_0x43bc('0x3e')]=function(_0x28b6ec,_0x426784){var _0x51131e={'raw':!![],'where':{'id':_0x28b6ec[_0x43bc('0x3f')]['id']}},_0x409073={};_0x409073[_0x43bc('0x2d')]=_[_0x43bc('0x2f')](db[_0x43bc('0x3a')][_0x43bc('0x2a')]);_0x409073[_0x43bc('0x2e')]=_['keys'](_0x28b6ec[_0x43bc('0x2e')]);_0x409073[_0x43bc('0x36')]=_['intersection'](_0x409073[_0x43bc('0x2d')],_0x409073[_0x43bc('0x2e')]);_0x51131e[_0x43bc('0x31')]=_[_0x43bc('0x30')](_0x409073[_0x43bc('0x2d')],qs[_0x43bc('0x32')](_0x28b6ec[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x51131e['attributes']=_0x51131e[_0x43bc('0x31')]['length']?_0x51131e[_0x43bc('0x31')]:_0x409073[_0x43bc('0x2d')];if(_0x28b6ec[_0x43bc('0x2e')][_0x43bc('0x3b')]){_0x51131e[_0x43bc('0x3c')]=[{'all':!![]}];}_0x51131e=_['merge']({},_0x51131e,_0x28b6ec[_0x43bc('0x40')]);return db[_0x43bc('0x3a')][_0x43bc('0x41')](_0x51131e)['then'](handleEntityNotFound(_0x426784,null))[_0x43bc('0x23')](respondWithResult(_0x426784,null))['catch'](handleError(_0x426784,null));};exports[_0x43bc('0x42')]=function(_0x2b6d49,_0x246838){return db[_0x43bc('0x3a')]['create'](_0x2b6d49[_0x43bc('0x43')],{})[_0x43bc('0x23')](respondWithResult(_0x246838,0xc9))[_0x43bc('0x3d')](handleError(_0x246838,null));};exports[_0x43bc('0x22')]=function(_0x54c154,_0x27edc2){if(_0x54c154['body']['id']){delete _0x54c154[_0x43bc('0x43')]['id'];}return db[_0x43bc('0x3a')]['find']({'where':{'id':_0x54c154['params']['id']}})['then'](handleEntityNotFound(_0x27edc2,null))[_0x43bc('0x23')](saveUpdates(_0x54c154[_0x43bc('0x43')],null))[_0x43bc('0x23')](respondWithResult(_0x27edc2,null))[_0x43bc('0x3d')](handleError(_0x27edc2,null));};exports[_0x43bc('0x24')]=function(_0x379fc3,_0x3e47cc){return db[_0x43bc('0x3a')][_0x43bc('0x41')]({'where':{'id':_0x379fc3['params']['id']}})[_0x43bc('0x23')](handleEntityNotFound(_0x3e47cc,null))[_0x43bc('0x23')](removeEntity(_0x3e47cc,null))[_0x43bc('0x3d')](handleError(_0x3e47cc,null));};exports[_0x43bc('0x44')]=function(_0x548c97,_0x330ac1){return db[_0x43bc('0x3a')][_0x43bc('0x44')]()[_0x43bc('0x23')](respondWithResult(_0x330ac1,null))[_0x43bc('0x3d')](handleError(_0x330ac1,null));};exports[_0x43bc('0x45')]=function(_0x5a9bff,_0x5b4bbd,_0x5d1db3){var _0x5adc3b={'raw':!![],'where':{}};var _0x3e3720={};var _0x4b82ff={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x43bc('0x46')]({'where':{'id':_0x5a9bff[_0x43bc('0x3f')]['id']}})[_0x43bc('0x23')](handleEntityNotFound(_0x5b4bbd,null))[_0x43bc('0x23')](function(_0xc246cc){if(_0xc246cc){_0x3e3720['model']=_[_0x43bc('0x2f')](db[_0x43bc('0x47')][_0x43bc('0x2a')]);_0x3e3720['query']=_[_0x43bc('0x2f')](_0x5a9bff['query']);_0x3e3720[_0x43bc('0x36')]=_[_0x43bc('0x30')](_0x3e3720['model'],_0x3e3720[_0x43bc('0x2e')]);_0x5adc3b[_0x43bc('0x31')]=_['intersection'](_0x3e3720[_0x43bc('0x2d')],qs['fields'](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x5adc3b['attributes']=_0x5adc3b['attributes'][_0x43bc('0x33')]?_0x5adc3b[_0x43bc('0x31')]:_0x3e3720[_0x43bc('0x2d')];if(!_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x48')](_0x43bc('0x49'))){_0x5adc3b['limit']=qs[_0x43bc('0x1d')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x1d')]);_0x5adc3b[_0x43bc('0x1b')]=qs[_0x43bc('0x1b')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x1b')]);}_0x5adc3b[_0x43bc('0x4a')]=qs[_0x43bc('0x34')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x34')]);_0x5adc3b['where']=qs['filters'](_[_0x43bc('0x37')](_0x5a9bff['query'],_0x3e3720[_0x43bc('0x36')]));_0x5adc3b[_0x43bc('0x35')][_0x43bc('0x4b')]=_0xc246cc['id'];if(_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x38')]){_0x5adc3b[_0x43bc('0x35')]=_[_0x43bc('0x39')](_0x5adc3b[_0x43bc('0x35')],{'$or':_['map'](_0x5adc3b[_0x43bc('0x31')],function(_0x5b4b70){var _0x1b04e8={};_0x1b04e8[_0x5b4b70]={'$like':'%'+_0x5a9bff['query'][_0x43bc('0x38')]+'%'};return _0x1b04e8;})});}_0x5adc3b=_['merge']({},_0x5adc3b,_0x5a9bff[_0x43bc('0x40')]);return db[_0x43bc('0x47')]['count']({'where':_0x5adc3b[_0x43bc('0x35')]})[_0x43bc('0x23')](function(_0x45bc71){_0x4b82ff[_0x43bc('0x1e')]=_0x45bc71;if(_0x5a9bff['query'][_0x43bc('0x3b')]){_0x5adc3b[_0x43bc('0x3c')]=[{'all':!![]}];}return db[_0x43bc('0x47')][_0x43bc('0x4c')](_0x5adc3b);})[_0x43bc('0x23')](function(_0x113698){_0x4b82ff[_0x43bc('0x4d')]=_0x113698;return _0x4b82ff;});}})[_0x43bc('0x23')](respondWithFilteredResult(_0x5b4bbd,_0x5adc3b))['catch'](handleError(_0x5b4bbd,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d5538b3..b60fe58 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 _0x187d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x40edb7,_0x166c16){var _0x2c38c4=function(_0x35effc){while(--_0x35effc){_0x40edb7['push'](_0x40edb7['shift']());}};_0x2c38c4(++_0x166c16);}(_0x187d,0x93));var _0xd187=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x187d[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x307aa4,_0x16ae7e){var _0x32f0ea=function(_0x97a029){while(--_0x97a029){_0x307aa4['push'](_0x307aa4['shift']());}};_0x32f0ea(++_0x16ae7e);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x180967,_0x1a467d){_0x180967=_0x180967-0x0;var _0x2e9b69=_0xaa3f[_0x180967];return _0x2e9b69;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 4ecf70c..2ca0731 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 _0x3e24=['info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x3e24,0x167));var _0x43e2=function(_0x5a7282,_0xa6e195){_0x5a7282=_0x5a7282-0x0;var _0x4928ec=_0x3e24[_0x5a7282];return _0x4928ec;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});} \ No newline at end of file +var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x49cd59,_0x431e4f){var _0x478595=function(_0x2af4e1){while(--_0x2af4e1){_0x49cd59['push'](_0x49cd59['shift']());}};_0x478595(++_0x431e4f);}(_0xafc4,0x69));var _0x4afc=function(_0xbc086a,_0x556c9a){_0xbc086a=_0xbc086a-0x0;var _0x577e6c=_0xafc4[_0xbc086a];return _0x577e6c;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9c1b14b..5ecd121 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 _0x556b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express'];(function(_0x51144c,_0x137f69){var _0x22b259=function(_0x346686){while(--_0x346686){_0x51144c['push'](_0x51144c['shift']());}};_0x22b259(++_0x137f69);}(_0x556b,0x1d7));var _0xb556=function(_0x3aac5c,_0x5f4b66){_0x3aac5c=_0x3aac5c-0x0;var _0x37f4ad=_0x556b[_0x3aac5c];return _0x37f4ad;};'use strict';var multer=require(_0xb556('0x0'));var util=require(_0xb556('0x1'));var path=require(_0xb556('0x2'));var timeout=require(_0xb556('0x3'));var express=require(_0xb556('0x4'));var router=express['Router']();var fs_extra=require(_0xb556('0x5'));var auth=require(_0xb556('0x6'));var interaction=require(_0xb556('0x7'));var config=require(_0xb556('0x8'));var controller=require(_0xb556('0x9'));router['get']('/',controller['index']);router['put'](_0xb556('0xa'),auth[_0xb556('0xb')](),controller[_0xb556('0xc')]);module[_0xb556('0xd')]=router; \ No newline at end of file +var _0xf3d0=['../../components/interaction/service','get','index','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c372f,_0x31d36a){var _0x2fc84e=function(_0x32612d){while(--_0x32612d){_0x3c372f['push'](_0x3c372f['shift']());}};_0x2fc84e(++_0x31d36a);}(_0xf3d0,0x18e));var _0x0f3d=function(_0x248cb2,_0x52fdbb){_0x248cb2=_0x248cb2-0x0;var _0x5c7dcb=_0xf3d0[_0x248cb2];return _0x5c7dcb;};'use strict';var multer=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var path=require('path');var timeout=require(_0x0f3d('0x2'));var express=require(_0x0f3d('0x3'));var router=express[_0x0f3d('0x4')]();var fs_extra=require(_0x0f3d('0x5'));var auth=require(_0x0f3d('0x6'));var interaction=require(_0x0f3d('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x0f3d('0x8')]('/',controller[_0x0f3d('0x9')]);router[_0x0f3d('0xa')](_0x0f3d('0xb'),auth[_0x0f3d('0xc')](),controller[_0x0f3d('0xd')]);module[_0x0f3d('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 5581cac..9e5fd34 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 _0x050c=['STRING','sequelize','exports','TEXT'];(function(_0x5351ff,_0x382ef7){var _0x255428=function(_0x403692){while(--_0x403692){_0x5351ff['push'](_0x5351ff['shift']());}};_0x255428(++_0x382ef7);}(_0x050c,0x15d));var _0xc050=function(_0x19ce50,_0x532835){_0x19ce50=_0x19ce50-0x0;var _0x3b4327=_0x050c[_0x19ce50];return _0x3b4327;};'use strict';var Sequelize=require(_0xc050('0x0'));module[_0xc050('0x1')]={'license':{'type':Sequelize[_0xc050('0x2')]},'data1':{'type':Sequelize[_0xc050('0x3')]},'data2':{'type':Sequelize[_0xc050('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa0b0=['sequelize','TEXT','STRING','INTEGER'];(function(_0xdea60c,_0x36a0a2){var _0x2643a4=function(_0x437ae9){while(--_0x437ae9){_0xdea60c['push'](_0xdea60c['shift']());}};_0x2643a4(++_0x36a0a2);}(_0xa0b0,0x174));var _0x0a0b=function(_0xe7b05e,_0x582b5d){_0xe7b05e=_0xe7b05e-0x0;var _0x2846ca=_0xa0b0[_0xe7b05e];return _0x2846ca;};'use strict';var Sequelize=require(_0x0a0b('0x0'));module['exports']={'license':{'type':Sequelize[_0x0a0b('0x1')]},'data1':{'type':Sequelize[_0x0a0b('0x2')]},'data2':{'type':Sequelize[_0x0a0b('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x0a0b('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 c348fac..8299f50 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x29c7a5,_0x5e29f8){var _0x2b231c=function(_0x422925){while(--_0x422925){_0x29c7a5['push'](_0x29c7a5['shift']());}};_0x2b231c(++_0x5e29f8);}(_0x1261,0x144));var _0x1126=function(_0x432af8,_0x477b3d){_0x432af8=_0x432af8-0x0;var _0x228f4f=_0x1261[_0x432af8];return _0x228f4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','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'];(function(_0x304a70,_0x31fbed){var _0x2c8044=function(_0x1e6486){while(--_0x1e6486){_0x304a70['push'](_0x304a70['shift']());}};_0x2c8044(++_0x31fbed);}(_0x4975,0x86));var _0x5497=function(_0x15ff6b,_0x1bab56){_0x15ff6b=_0x15ff6b-0x0;var _0x1852c8=_0x4975[_0x15ff6b];return _0x1852c8;};'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);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 24ec15e..757a8ca 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 _0x0fc2=['License','license','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x328cdc,_0xe9775){var _0x17eea7=function(_0x7a872f){while(--_0x7a872f){_0x328cdc['push'](_0x328cdc['shift']());}};_0x17eea7(++_0xe9775);}(_0x0fc2,0x14c));var _0x20fc=function(_0x3c1b82,_0x19d766){_0x3c1b82=_0x3c1b82-0x0;var _0xdf858a=_0x0fc2[_0x3c1b82];return _0xdf858a;};'use strict';var _=require(_0x20fc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x20fc('0x1'));var BPromise=require(_0x20fc('0x2'));var rp=require(_0x20fc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20fc('0x4'));var config=require(_0x20fc('0x5'));var attributes=require(_0x20fc('0x6'));module[_0x20fc('0x7')]=function(_0x59a51d,_0x15f9cd){return _0x59a51d['define'](_0x20fc('0x8'),attributes,{'tableName':_0x20fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85c7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','License','lodash','util'];(function(_0x6f813e,_0x573957){var _0x24df11=function(_0x28c86f){while(--_0x28c86f){_0x6f813e['push'](_0x6f813e['shift']());}};_0x24df11(++_0x573957);}(_0x85c7,0x172));var _0x785c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x85c7[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x785c('0x0'));var util=require(_0x785c('0x1'));var logger=require(_0x785c('0x2'))(_0x785c('0x3'));var moment=require(_0x785c('0x4'));var BPromise=require(_0x785c('0x5'));var rp=require(_0x785c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x785c('0x7'));var config=require(_0x785c('0x8'));var attributes=require('./license.attributes');module[_0x785c('0x9')]=function(_0x3962d5,_0x5f27dd){return _0x3962d5[_0x785c('0xa')](_0x785c('0xb'),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 d23c79d..8ca2464 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 _0x5f67=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x5f67,0x163));var _0x75f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f67[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75f6('0x0'));var util=require(_0x75f6('0x1'));var moment=require(_0x75f6('0x2'));var BPromise=require(_0x75f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75f6('0x4'));var db=require(_0x75f6('0x5'))['db'];var utils=require(_0x75f6('0x6'));var logger=require('../../config/logger')(_0x75f6('0x7'));var config=require(_0x75f6('0x8'));var jayson=require(_0x75f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x307c2e,_0x3d8bb1,_0x56c411){return new BPromise(function(_0x3a3c8c,_0x229e1b){return client[_0x75f6('0xa')](_0x307c2e,_0x56c411)[_0x75f6('0xb')](function(_0x3465fc){logger[_0x75f6('0xc')](_0x75f6('0xd'),_0x3d8bb1,_0x75f6('0xe'));logger[_0x75f6('0xf')](_0x75f6('0x10'),_0x3d8bb1,'request\x20sent',JSON['stringify'](_0x3465fc));if(_0x3465fc[_0x75f6('0x11')]){if(_0x3465fc[_0x75f6('0x11')][_0x75f6('0x12')]===0x1f4){logger[_0x75f6('0x11')](_0x75f6('0xd'),_0x3d8bb1,_0x3465fc[_0x75f6('0x11')][_0x75f6('0x13')]);return _0x229e1b(_0x3465fc[_0x75f6('0x11')]['message']);}logger[_0x75f6('0x11')](_0x75f6('0xd'),_0x3d8bb1,_0x3465fc[_0x75f6('0x11')][_0x75f6('0x13')]);return _0x3a3c8c(_0x3465fc[_0x75f6('0x11')][_0x75f6('0x13')]);}else{logger['info'](_0x75f6('0xd'),_0x3d8bb1,_0x75f6('0xe'));_0x3a3c8c(_0x3465fc[_0x75f6('0x14')][_0x75f6('0x13')]);}})[_0x75f6('0x15')](function(_0x2fd29f){logger[_0x75f6('0x11')](_0x75f6('0xd'),_0x3d8bb1,_0x2fd29f);_0x229e1b(_0x2fd29f);});});} \ No newline at end of file +var _0xcd2e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','randomstring'];(function(_0x3c2753,_0x1455c7){var _0x30e10a=function(_0x28d1d2){while(--_0x28d1d2){_0x3c2753['push'](_0x3c2753['shift']());}};_0x30e10a(++_0x1455c7);}(_0xcd2e,0x8a));var _0xecd2=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xcd2e[_0x4defd6];return _0x4c9276;};'use strict';var _=require('lodash');var util=require(_0xecd2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xecd2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecd2('0x2'))['db'];var utils=require(_0xecd2('0x3'));var logger=require(_0xecd2('0x4'))(_0xecd2('0x5'));var config=require(_0xecd2('0x6'));var jayson=require(_0xecd2('0x7'));var client=jayson[_0xecd2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e57af,_0x30d655,_0x1d3f98){return new BPromise(function(_0x5af2d5,_0x4712c5){return client[_0xecd2('0x9')](_0x1e57af,_0x1d3f98)[_0xecd2('0xa')](function(_0x185308){logger[_0xecd2('0xb')](_0xecd2('0xc'),_0x30d655,_0xecd2('0xd'));logger[_0xecd2('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x30d655,_0xecd2('0xd'),JSON['stringify'](_0x185308));if(_0x185308[_0xecd2('0xf')]){if(_0x185308[_0xecd2('0xf')][_0xecd2('0x10')]===0x1f4){logger[_0xecd2('0xf')](_0xecd2('0xc'),_0x30d655,_0x185308[_0xecd2('0xf')][_0xecd2('0x11')]);return _0x4712c5(_0x185308['error'][_0xecd2('0x11')]);}logger['error'](_0xecd2('0xc'),_0x30d655,_0x185308[_0xecd2('0xf')]['message']);return _0x5af2d5(_0x185308['error'][_0xecd2('0x11')]);}else{logger[_0xecd2('0xb')]('License,\x20%s,\x20%s',_0x30d655,_0xecd2('0xd'));_0x5af2d5(_0x185308[_0xecd2('0x12')][_0xecd2('0x11')]);}})[_0xecd2('0x13')](function(_0x3fa295){logger[_0xecd2('0xf')](_0xecd2('0xc'),_0x30d655,_0x3fa295);_0x4712c5(_0x3fa295);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0f53f56..fa10e76 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 _0xc070=['express','Router','fs-extra','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','addInteraction','addApplications','send','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout'];(function(_0x3b56ff,_0x14cf4e){var _0x4d80be=function(_0x4ba99b){while(--_0x4ba99b){_0x3b56ff['push'](_0x3b56ff['shift']());}};_0x4d80be(++_0x14cf4e);}(_0xc070,0xd9));var _0x0c07=function(_0x16f81d,_0x173756){_0x16f81d=_0x16f81d-0x0;var _0x3697eb=_0xc070[_0x16f81d];return _0x3697eb;};'use strict';var multer=require(_0x0c07('0x0'));var util=require(_0x0c07('0x1'));var path=require('path');var timeout=require(_0x0c07('0x2'));var express=require(_0x0c07('0x3'));var router=express[_0x0c07('0x4')]();var fs_extra=require(_0x0c07('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c07('0x6'));router[_0x0c07('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c07('0x8')]);router['get'](_0x0c07('0x9'),auth[_0x0c07('0xa')](),controller[_0x0c07('0xb')]);router['get'](_0x0c07('0xc'),auth[_0x0c07('0xa')](),controller[_0x0c07('0xd')]);router['get'](_0x0c07('0xe'),auth[_0x0c07('0xa')](),controller[_0x0c07('0xf')]);router[_0x0c07('0x7')](_0x0c07('0x10'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x11')]);router[_0x0c07('0x7')](_0x0c07('0x12'),auth['isAuthenticated'](),controller[_0x0c07('0x13')]);router[_0x0c07('0x7')](_0x0c07('0x14'),auth[_0x0c07('0xa')](),controller['getSmtp']);router[_0x0c07('0x7')](_0x0c07('0x15'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x16')]);router[_0x0c07('0x7')](_0x0c07('0x17'),auth[_0x0c07('0xa')](),controller['getApplications']);router[_0x0c07('0x7')](_0x0c07('0x18'),auth[_0x0c07('0xa')](),controller['getMessages']);router[_0x0c07('0x7')](_0x0c07('0x19'),auth[_0x0c07('0xa')](),controller['verifySmtp']);router[_0x0c07('0x7')](_0x0c07('0x1a'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x1b')]);router[_0x0c07('0x1c')](_0x0c07('0xe'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x1d')]);router[_0x0c07('0x1c')]('/:id/canned_answers',auth[_0x0c07('0xa')](),controller[_0x0c07('0x1e')]);router[_0x0c07('0x1c')]('/',auth['isAuthenticated'](),controller[_0x0c07('0x1f')]);router['post'](_0x0c07('0x12'),auth['isAuthenticated'](),controller['addImap']);router[_0x0c07('0x1c')]('/:id/out_servers',auth[_0x0c07('0xa')](),controller[_0x0c07('0x20')]);router[_0x0c07('0x1c')](_0x0c07('0x15'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x21')]);router[_0x0c07('0x1c')](_0x0c07('0x17'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x22')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x0c07('0x23')]);router[_0x0c07('0x1c')](_0x0c07('0x1a'),auth[_0x0c07('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0x0c07('0xa')](),controller['update']);router[_0x0c07('0x24')](_0x0c07('0xe'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x25')]);router['delete'](_0x0c07('0x10'),auth['isAuthenticated'](),controller[_0x0c07('0x26')]);router[_0x0c07('0x24')](_0x0c07('0x12'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x27')]);router['delete'](_0x0c07('0x14'),auth[_0x0c07('0xa')](),controller[_0x0c07('0x28')]);router[_0x0c07('0x24')](_0x0c07('0xc'),auth['isAuthenticated'](),controller[_0x0c07('0x29')]);router[_0x0c07('0x24')]('/:id/users',auth[_0x0c07('0xa')](),controller[_0x0c07('0x2a')]);module[_0x0c07('0x2b')]=router; \ No newline at end of file +var _0x59cf=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','put','update','delete','removeDispositions','removeImap','removeSmtp','/:id/users','removeAgents','exports'];(function(_0x389b92,_0x5badc1){var _0x2e355c=function(_0x51bbbf){while(--_0x51bbbf){_0x389b92['push'](_0x389b92['shift']());}};_0x2e355c(++_0x5badc1);}(_0x59cf,0x157));var _0xf59c=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x59cf[_0x2ac4af];return _0x3a36df;};'use strict';var multer=require(_0xf59c('0x0'));var util=require(_0xf59c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf59c('0x2'));var router=express[_0xf59c('0x3')]();var fs_extra=require(_0xf59c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf59c('0x5'));var config=require(_0xf59c('0x6'));var controller=require(_0xf59c('0x7'));router[_0xf59c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf59c('0x9')]);router[_0xf59c('0x8')](_0xf59c('0xa'),auth[_0xf59c('0xb')](),controller[_0xf59c('0xc')]);router[_0xf59c('0x8')](_0xf59c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf59c('0x8')]('/:id/dispositions',auth[_0xf59c('0xb')](),controller[_0xf59c('0xe')]);router['get'](_0xf59c('0xf'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x10')]);router[_0xf59c('0x8')](_0xf59c('0x11'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x12')]);router[_0xf59c('0x8')](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x14')]);router['get'](_0xf59c('0x15'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x16')]);router[_0xf59c('0x8')]('/:id/applications',auth[_0xf59c('0xb')](),controller[_0xf59c('0x17')]);router[_0xf59c('0x8')](_0xf59c('0x18'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x19')]);router['get'](_0xf59c('0x1a'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x1b')]);router[_0xf59c('0x8')]('/:id/users',auth[_0xf59c('0xb')](),controller[_0xf59c('0x1c')]);router[_0xf59c('0x1d')](_0xf59c('0x1e'),auth['isAuthenticated'](),controller[_0xf59c('0x1f')]);router[_0xf59c('0x1d')](_0xf59c('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0xf59c('0xb')](),controller[_0xf59c('0x20')]);router['post'](_0xf59c('0x11'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x21')]);router['post'](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x22')]);router['post'](_0xf59c('0x15'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x23')]);router[_0xf59c('0x1d')](_0xf59c('0x24'),auth['isAuthenticated'](),controller[_0xf59c('0x25')]);router['post'](_0xf59c('0x26'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x27')]);router[_0xf59c('0x1d')]('/:id/users',auth[_0xf59c('0xb')](),controller['addAgents']);router[_0xf59c('0x28')](_0xf59c('0xd'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x29')]);router[_0xf59c('0x2a')](_0xf59c('0x1e'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2b')]);router[_0xf59c('0x2a')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf59c('0x2a')](_0xf59c('0x11'),auth['isAuthenticated'](),controller[_0xf59c('0x2c')]);router[_0xf59c('0x2a')](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2d')]);router['delete'](_0xf59c('0xd'),auth[_0xf59c('0xb')](),controller['destroy']);router['delete'](_0xf59c('0x2e'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2f')]);module[_0xf59c('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f3fc328..75f2240 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 _0x423b=['setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x593a33,_0x584f81){var _0x4fbd72=function(_0x1bcb43){while(--_0x1bcb43){_0x593a33['push'](_0x593a33['shift']());}};_0x4fbd72(++_0x584f81);}(_0x423b,0x12b));var _0xb423=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x423b[_0x4ae829];return _0x256b31;};'use strict';var Sequelize=require('sequelize');module[_0xb423('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb423('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb423('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb423('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb423('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xb423('0x3')](0x2)[_0xb423('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb423('0x5')],'defaultValue':function(){return _0xb423('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb423('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb423('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb423('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb423('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb423('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb423('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xb423('0x2')],'defaultValue':![],'comment':_0xb423('0x8'),'set':function(_0x37f802){if(!_0x37f802)this[_0xb423('0x9')]('mandatoryDispositionPauseId',null);this[_0xb423('0x9')](_0xb423('0xa'),_0x37f802);}}}; \ No newline at end of file +var _0x4b1f=['BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x5e6515,_0x2954b1){var _0xd33ce2=function(_0x5ce7ea){while(--_0x5ce7ea){_0x5e6515['push'](_0x5e6515['shift']());}};_0xd33ce2(++_0x2954b1);}(_0x4b1f,0x195));var _0xf4b1=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x4b1f[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0xf4b1('0x0'));module[_0xf4b1('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf4b1('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf4b1('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf4b1('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf4b1('0x4')]},'markAsUnread':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xf4b1('0x5')](0x2)[_0xf4b1('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf4b1('0x4')],'defaultValue':function(){return _0xf4b1('0x7');}},'notificationSound':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf4b1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf4b1('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[_0xf4b1('0x3')],'defaultValue':![],'comment':_0xf4b1('0x8'),'set':function(_0x10a08c){if(!_0x10a08c)this[_0xf4b1('0x9')](_0xf4b1('0xa'),null);this[_0xf4b1('0x9')](_0xf4b1('0xb'),_0x10a08c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b66f0dc..8b2a5c6 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 _0xd030=['redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','MailAccounts','UserProfileResource','end','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','Smtp','keys','include','find','MailServerIn','body','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','stack','send','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','from','attachments','join','server/files/attachments','auth','port','secure','SendMail','List\x20not\x20found','List','subject','attach','format','messageId','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xb72117,_0x349096){var _0xeb1f7e=function(_0x4df89f){while(--_0x4df89f){_0xb72117['push'](_0xb72117['shift']());}};_0xeb1f7e(++_0x349096);}(_0xd030,0x16c));var _0x0d03=function(_0x3ee38d,_0x1b6fa8){_0x3ee38d=_0x3ee38d-0x0;var _0x2123e7=_0xd030[_0x3ee38d];return _0x2123e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d03('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d03('0x1'));var rp=require(_0x0d03('0x2'));var moment=require(_0x0d03('0x3'));var BPromise=require(_0x0d03('0x4'));var Mustache=require(_0x0d03('0x5'));var util=require(_0x0d03('0x6'));var path=require(_0x0d03('0x7'));var sox=require(_0x0d03('0x8'));var csv=require('to-csv');var ejs=require(_0x0d03('0x9'));var fs=require('fs');var fs_extra=require(_0x0d03('0xa'));var _=require('lodash');var squel=require(_0x0d03('0xb'));var crypto=require('crypto');var jsforce=require(_0x0d03('0xc'));var deskjs=require(_0x0d03('0xd'));var toCsv=require(_0x0d03('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0x0d03('0xf'));var Redis=require(_0x0d03('0x10'));var authService=require(_0x0d03('0x11'));var qs=require(_0x0d03('0x12'));var as=require(_0x0d03('0x13'));var hardwareService=require(_0x0d03('0x14'));var logger=require(_0x0d03('0x15'))(_0x0d03('0x16'));var utils=require(_0x0d03('0x17'));var config=require(_0x0d03('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d03('0x19'))['db'];config[_0x0d03('0x1a')]=_[_0x0d03('0x1b')](config['redis'],{'host':_0x0d03('0x1c'),'port':0x18eb});var socket=require(_0x0d03('0x1d'))(new Redis(config[_0x0d03('0x1a')]));require('./mailAccount.socket')[_0x0d03('0x1e')](socket);var jayson=require(_0x0d03('0x1f'));var client=jayson[_0x0d03('0x20')][_0x0d03('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x57dc67,_0x40ec9b,_0x196e09,_0x1e4a8b){return new BPromise(function(_0x56b891,_0xbff535){var _0x120fe8=_0x1e4a8b||client;return _0x120fe8[_0x0d03('0x22')](_0x57dc67,_0x196e09)[_0x0d03('0x23')](function(_0x310dd6){logger[_0x0d03('0x24')](_0x0d03('0x25'),_0x40ec9b,_0x0d03('0x26'));logger[_0x0d03('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x40ec9b,_0x0d03('0x26'),JSON[_0x0d03('0x28')](_0x310dd6));if(_0x310dd6[_0x0d03('0x29')]){if(_0x310dd6['error'][_0x0d03('0x2a')]===0x1f4){logger['error'](_0x0d03('0x25'),_0x40ec9b,_0x310dd6[_0x0d03('0x29')][_0x0d03('0x2b')]);return _0xbff535(_0x310dd6[_0x0d03('0x29')][_0x0d03('0x2b')]);}logger[_0x0d03('0x29')](_0x0d03('0x25'),_0x40ec9b,_0x310dd6[_0x0d03('0x29')][_0x0d03('0x2b')]);return _0x56b891(_0x310dd6[_0x0d03('0x29')]['message']);}else{logger[_0x0d03('0x24')]('MailAccount,\x20%s,\x20%s',_0x40ec9b,_0x0d03('0x26'));_0x56b891(_0x310dd6['result'][_0x0d03('0x2b')]);}})['catch'](function(_0x507ef7){logger[_0x0d03('0x29')]('MailAccount,\x20%s,\x20%s',_0x40ec9b,_0x507ef7);_0xbff535(_0x507ef7);});});}function respondWithStatusCode(_0xe67bb2,_0x275554){_0x275554=_0x275554||0xcc;return function(_0x51fe7e){if(_0x51fe7e){return _0xe67bb2[_0x0d03('0x2c')](_0x275554);}return _0xe67bb2[_0x0d03('0x2d')](_0x275554)['end']();};}function respondWithResult(_0x38c62b,_0x34dcd6){_0x34dcd6=_0x34dcd6||0xc8;return function(_0x104b4e){if(_0x104b4e){return _0x38c62b[_0x0d03('0x2d')](_0x34dcd6)[_0x0d03('0x2e')](_0x104b4e);}};}function respondWithFilteredResult(_0x198318,_0x4ebc9c){return function(_0x467fd3){if(_0x467fd3){var _0x2b8827=typeof _0x4ebc9c[_0x0d03('0x2f')]===_0x0d03('0x30')&&typeof _0x4ebc9c[_0x0d03('0x31')]==='undefined';var _0x4d41fa=_0x467fd3['count'];var _0x8ce938=_0x2b8827?0x0:_0x4ebc9c[_0x0d03('0x2f')];var _0x348cc5=_0x2b8827?_0x467fd3[_0x0d03('0x32')]:_0x4ebc9c['offset']+_0x4ebc9c[_0x0d03('0x31')];var _0x4b7fbe;if(_0x348cc5>=_0x4d41fa){_0x348cc5=_0x4d41fa;_0x4b7fbe=0xc8;}else{_0x4b7fbe=0xce;}_0x198318[_0x0d03('0x2d')](_0x4b7fbe);return _0x198318[_0x0d03('0x33')]('Content-Range',_0x8ce938+'-'+_0x348cc5+'/'+_0x4d41fa)[_0x0d03('0x2e')](_0x467fd3);}return null;};}function patchUpdates(_0x255b83){return function(_0x58b545){try{jsonpatch['apply'](_0x58b545,_0x255b83,!![]);}catch(_0x261e67){return BPromise[_0x0d03('0x34')](_0x261e67);}return _0x58b545[_0x0d03('0x35')]();};}function saveUpdates(_0x4b35e5,_0x52d31c){return function(_0x1b5284){if(_0x1b5284){return _0x1b5284[_0x0d03('0x36')](_0x4b35e5)['then'](function(_0x50d1bd){return _0x50d1bd;});}return null;};}function removeEntity(_0x268555,_0xe02224){return function(_0x1dbeeb){if(_0x1dbeeb){return _0x1dbeeb[_0x0d03('0x37')]()['then'](function(){var _0x3097c2=_0x1dbeeb[_0x0d03('0x38')]({'plain':!![]});var _0x5bcab1=_0x0d03('0x39');return db[_0x0d03('0x3a')][_0x0d03('0x37')]({'where':{'type':_0x5bcab1,'resourceId':_0x3097c2['id']}})[_0x0d03('0x23')](function(){return _0x1dbeeb;});})[_0x0d03('0x23')](function(){_0x268555[_0x0d03('0x2d')](0xcc)[_0x0d03('0x3b')]();});}};}function handleEntityNotFound(_0x4a9cf1,_0x1d2e62){return function(_0x41b4a5){if(!_0x41b4a5){_0x4a9cf1[_0x0d03('0x2c')](0x194);}return _0x41b4a5;};}function handleError(_0x33ec64,_0xcde3fe){_0xcde3fe=_0xcde3fe||0x1f4;return function(_0x48066c){logger[_0x0d03('0x29')](_0x48066c['stack']);if(_0x48066c['name']){delete _0x48066c['name'];}_0x33ec64[_0x0d03('0x2d')](_0xcde3fe)['send'](_0x48066c);};}exports[_0x0d03('0x3c')]=function(_0x4e410f,_0x3f590e){var _0x223e69={'include':[{'model':db['MailServerIn'],'as':_0x0d03('0x3d')},{'model':db[_0x0d03('0x3e')],'as':'Smtp'},{'model':db[_0x0d03('0x3f')],'as':_0x0d03('0x40')}]},_0x5ed22a={},_0x3bfdc3={'count':0x0,'rows':[]};var _0x2564e6=_[_0x0d03('0x41')](db[_0x0d03('0x42')][_0x0d03('0x43')],function(_0x5eae8e){return{'name':_0x5eae8e[_0x0d03('0x44')],'type':_0x5eae8e[_0x0d03('0x45')][_0x0d03('0x46')]};});_0x5ed22a[_0x0d03('0x47')]=_[_0x0d03('0x41')](_0x2564e6,_0x0d03('0x48'));_0x5ed22a[_0x0d03('0x49')]=_['keys'](_0x4e410f[_0x0d03('0x49')]);_0x5ed22a[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0x5ed22a[_0x0d03('0x47')],_0x5ed22a['query']);_0x223e69['attributes']=_[_0x0d03('0x4b')](_0x5ed22a[_0x0d03('0x47')],qs['fields'](_0x4e410f[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x223e69[_0x0d03('0x4d')]=_0x223e69[_0x0d03('0x4d')][_0x0d03('0x4e')]?_0x223e69[_0x0d03('0x4d')]:_0x5ed22a[_0x0d03('0x47')];if(!_0x4e410f[_0x0d03('0x49')][_0x0d03('0x4f')](_0x0d03('0x50'))){_0x223e69[_0x0d03('0x31')]=qs[_0x0d03('0x31')](_0x4e410f[_0x0d03('0x49')][_0x0d03('0x31')]);_0x223e69[_0x0d03('0x2f')]=qs[_0x0d03('0x2f')](_0x4e410f['query'][_0x0d03('0x2f')]);}_0x223e69[_0x0d03('0x51')]=qs[_0x0d03('0x52')](_0x4e410f['query']['sort']);_0x223e69[_0x0d03('0x53')]=qs[_0x0d03('0x4a')](_[_0x0d03('0x54')](_0x4e410f['query'],_0x5ed22a[_0x0d03('0x4a')]),_0x2564e6);if(_0x4e410f[_0x0d03('0x49')][_0x0d03('0x55')]){_0x223e69[_0x0d03('0x53')]=_[_0x0d03('0x56')](_0x223e69[_0x0d03('0x53')],{'$or':_[_0x0d03('0x41')](_0x2564e6,function(_0x38df6e){if(_0x38df6e[_0x0d03('0x45')]!==_0x0d03('0x57')){var _0x7c25a6={};_0x7c25a6[_0x38df6e[_0x0d03('0x48')]]={'$like':'%'+_0x4e410f['query'][_0x0d03('0x55')]+'%'};return _0x7c25a6;}})});}_0x223e69=_[_0x0d03('0x56')]({},_0x223e69,_0x4e410f[_0x0d03('0x58')]);var _0x2cd7e1={'where':_0x223e69['where']};return db[_0x0d03('0x42')]['count'](_0x2cd7e1)[_0x0d03('0x23')](function(_0x4041de){_0x3bfdc3[_0x0d03('0x32')]=_0x4041de;if(_0x4e410f['query'][_0x0d03('0x59')]){_0x223e69['include']=[{'all':!![]}];}return db[_0x0d03('0x42')][_0x0d03('0x5a')](_0x223e69);})['then'](function(_0x472644){_0x3bfdc3[_0x0d03('0x5b')]=_0x472644;return _0x3bfdc3;})[_0x0d03('0x23')](respondWithFilteredResult(_0x3f590e,_0x223e69))[_0x0d03('0x5c')](handleError(_0x3f590e,null));};exports['show']=function(_0x9b127e,_0x314a31){var _0x2ea269={'raw':![],'where':{'id':_0x9b127e[_0x0d03('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0d03('0x3d')},{'model':db[_0x0d03('0x3e')],'as':_0x0d03('0x5e')},{'model':db['Pause'],'as':_0x0d03('0x40')}]},_0x2b0715={};_0x2b0715[_0x0d03('0x47')]=_[_0x0d03('0x5f')](db['MailAccount'][_0x0d03('0x43')]);_0x2b0715[_0x0d03('0x49')]=_[_0x0d03('0x5f')](_0x9b127e[_0x0d03('0x49')]);_0x2b0715[_0x0d03('0x4a')]=_['intersection'](_0x2b0715['model'],_0x2b0715[_0x0d03('0x49')]);_0x2ea269[_0x0d03('0x4d')]=_['intersection'](_0x2b0715['model'],qs[_0x0d03('0x4c')](_0x9b127e[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x2ea269[_0x0d03('0x4d')]=_0x2ea269[_0x0d03('0x4d')][_0x0d03('0x4e')]?_0x2ea269[_0x0d03('0x4d')]:_0x2b0715[_0x0d03('0x47')];if(_0x9b127e[_0x0d03('0x49')][_0x0d03('0x59')]){_0x2ea269[_0x0d03('0x60')]=[{'all':!![]}];}_0x2ea269=_[_0x0d03('0x56')]({},_0x2ea269,_0x9b127e[_0x0d03('0x58')]);return db[_0x0d03('0x42')][_0x0d03('0x61')](_0x2ea269)['then'](handleEntityNotFound(_0x314a31,null))[_0x0d03('0x23')](respondWithResult(_0x314a31,null))[_0x0d03('0x5c')](handleError(_0x314a31,null));};exports[_0x0d03('0x36')]=function(_0x41d4be,_0xdd576b){if(_0x41d4be['body']['id']){delete _0x41d4be['body']['id'];}return db['MailAccount'][_0x0d03('0x61')]({'where':{'id':_0x41d4be[_0x0d03('0x5d')]['id']},'include':[{'model':db[_0x0d03('0x62')],'as':_0x0d03('0x3d')},{'model':db[_0x0d03('0x3e')],'as':_0x0d03('0x5e')},{'model':db['Pause'],'as':_0x0d03('0x40')}]})[_0x0d03('0x23')](handleEntityNotFound(_0xdd576b,null))[_0x0d03('0x23')](saveUpdates(_0x41d4be['body'],null))['then'](function(_0x11db4e){if(_0x11db4e&&_0x41d4be['body'][_0x0d03('0x3d')]){return db[_0x0d03('0x62')][_0x0d03('0x36')](_0x41d4be[_0x0d03('0x63')]['Imap'],{'where':{'MailAccountId':_0x11db4e['id']}})[_0x0d03('0x23')](function(){return _0x11db4e;});}return _0x11db4e;})[_0x0d03('0x23')](function(_0x4d8bcd){if(_0x4d8bcd&&_0x41d4be['body'][_0x0d03('0x5e')]){return db[_0x0d03('0x3e')][_0x0d03('0x36')](_0x41d4be[_0x0d03('0x63')][_0x0d03('0x5e')],{'where':{'MailAccountId':_0x4d8bcd['id']}})[_0x0d03('0x23')](function(){return _0x4d8bcd;});}return _0x4d8bcd;})[_0x0d03('0x23')](respondWithResult(_0xdd576b,null))['catch'](handleError(_0xdd576b,null));};exports['describe']=function(_0x1615a9,_0x80cda4){return db['MailAccount'][_0x0d03('0x64')]()[_0x0d03('0x23')](respondWithResult(_0x80cda4,null))['catch'](handleError(_0x80cda4,null));};exports[_0x0d03('0x65')]=function(_0x481a7b,_0x254439,_0x19cb0f){if(_0x481a7b[_0x0d03('0x63')]['id']){delete _0x481a7b['body']['id'];}return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x481a7b[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x254439,null))[_0x0d03('0x23')](function(_0x2f5479){if(_0x2f5479){_0x481a7b[_0x0d03('0x63')][_0x0d03('0x66')]=_0x2f5479['id'];return db['Disposition'][_0x0d03('0x67')](_0x481a7b[_0x0d03('0x63')]);}})['then'](respondWithResult(_0x254439,null))['catch'](handleError(_0x254439,null));};exports[_0x0d03('0x68')]=function(_0x50e4fc,_0x329c7d,_0x4e6be0){var _0x25e0a4={'raw':![],'where':{}};var _0x2428e3={};var _0x449341={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x50e4fc[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x329c7d,null))['then'](function(_0x509c0f){if(_0x509c0f){_0x2428e3[_0x0d03('0x47')]=_[_0x0d03('0x5f')](db['Disposition'][_0x0d03('0x43')]);_0x2428e3[_0x0d03('0x49')]=_['keys'](_0x50e4fc['query']);_0x2428e3[_0x0d03('0x4a')]=_['intersection'](_0x2428e3[_0x0d03('0x47')],_0x2428e3[_0x0d03('0x49')]);_0x25e0a4['attributes']=_[_0x0d03('0x4b')](_0x2428e3['model'],qs['fields'](_0x50e4fc[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x25e0a4['attributes']=_0x25e0a4['attributes'][_0x0d03('0x4e')]?_0x25e0a4[_0x0d03('0x4d')]:_0x2428e3['model'];if(!_0x50e4fc['query'][_0x0d03('0x4f')](_0x0d03('0x50'))){_0x25e0a4[_0x0d03('0x31')]=qs[_0x0d03('0x31')](_0x50e4fc[_0x0d03('0x49')]['limit']);_0x25e0a4[_0x0d03('0x2f')]=qs[_0x0d03('0x2f')](_0x50e4fc['query'][_0x0d03('0x2f')]);}_0x25e0a4['order']=qs['sort'](_0x50e4fc[_0x0d03('0x49')][_0x0d03('0x52')]);_0x25e0a4[_0x0d03('0x53')]=qs['filters'](_[_0x0d03('0x54')](_0x50e4fc[_0x0d03('0x49')],_0x2428e3[_0x0d03('0x4a')]));_0x25e0a4[_0x0d03('0x53')]['MailAccountId']=_0x509c0f['id'];if(_0x50e4fc['query'][_0x0d03('0x55')]){_0x25e0a4[_0x0d03('0x53')]=_['merge'](_0x25e0a4['where'],{'$or':_[_0x0d03('0x41')](_0x25e0a4[_0x0d03('0x4d')],function(_0x16c226){var _0x5ba021={};_0x5ba021[_0x16c226]={'$like':'%'+_0x50e4fc[_0x0d03('0x49')][_0x0d03('0x55')]+'%'};return _0x5ba021;})});}_0x25e0a4=_['merge']({},_0x25e0a4,_0x50e4fc[_0x0d03('0x58')]);return db[_0x0d03('0x69')][_0x0d03('0x32')]({'where':_0x25e0a4['where']})[_0x0d03('0x23')](function(_0x2171a2){_0x449341[_0x0d03('0x32')]=_0x2171a2;if(_0x50e4fc[_0x0d03('0x49')][_0x0d03('0x59')]){_0x25e0a4['include']=[{'all':!![]}];}return db[_0x0d03('0x69')]['findAll'](_0x25e0a4);})[_0x0d03('0x23')](function(_0x52f214){_0x449341[_0x0d03('0x5b')]=_0x52f214;return _0x449341;});}})[_0x0d03('0x23')](respondWithFilteredResult(_0x329c7d,_0x25e0a4))[_0x0d03('0x5c')](handleError(_0x329c7d,null));};exports[_0x0d03('0x6a')]=function(_0x104acb,_0x414ca1,_0x36c678){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x104acb[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x414ca1,null))[_0x0d03('0x23')](function(_0x3d6c7a){if(_0x3d6c7a){return _0x3d6c7a[_0x0d03('0x6a')](_0x104acb['query'][_0x0d03('0x6b')]);}})['then'](respondWithStatusCode(_0x414ca1,null))[_0x0d03('0x5c')](handleError(_0x414ca1,null));};exports[_0x0d03('0x6c')]=function(_0x261559,_0x4ccd61,_0xd5aa61){if(_0x261559[_0x0d03('0x63')]['id']){delete _0x261559[_0x0d03('0x63')]['id'];}return db[_0x0d03('0x42')]['find']({'where':{'id':_0x261559[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x4ccd61,null))[_0x0d03('0x23')](function(_0x5ef757){if(_0x5ef757){_0x261559['body'][_0x0d03('0x66')]=_0x5ef757['id'];return db[_0x0d03('0x6d')][_0x0d03('0x67')](_0x261559[_0x0d03('0x63')]);}})[_0x0d03('0x23')](respondWithResult(_0x4ccd61,null))['catch'](handleError(_0x4ccd61,null));};exports[_0x0d03('0x6e')]=function(_0x1aa41c,_0x179bc7,_0x16b6bc){var _0xcce016={'raw':![],'where':{}};var _0x38ee3f={};var _0x4dcd60={'count':0x0,'rows':[]};return db[_0x0d03('0x42')][_0x0d03('0x6f')]({'where':{'id':_0x1aa41c['params']['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x179bc7,null))[_0x0d03('0x23')](function(_0x2b3661){if(_0x2b3661){_0x38ee3f[_0x0d03('0x47')]=_[_0x0d03('0x5f')](db[_0x0d03('0x6d')][_0x0d03('0x43')]);_0x38ee3f[_0x0d03('0x49')]=_['keys'](_0x1aa41c['query']);_0x38ee3f[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0x38ee3f[_0x0d03('0x47')],_0x38ee3f[_0x0d03('0x49')]);_0xcce016['attributes']=_[_0x0d03('0x4b')](_0x38ee3f['model'],qs[_0x0d03('0x4c')](_0x1aa41c[_0x0d03('0x49')][_0x0d03('0x4c')]));_0xcce016[_0x0d03('0x4d')]=_0xcce016[_0x0d03('0x4d')][_0x0d03('0x4e')]?_0xcce016[_0x0d03('0x4d')]:_0x38ee3f['model'];if(!_0x1aa41c['query'][_0x0d03('0x4f')](_0x0d03('0x50'))){_0xcce016[_0x0d03('0x31')]=qs[_0x0d03('0x31')](_0x1aa41c[_0x0d03('0x49')][_0x0d03('0x31')]);_0xcce016[_0x0d03('0x2f')]=qs[_0x0d03('0x2f')](_0x1aa41c[_0x0d03('0x49')][_0x0d03('0x2f')]);}_0xcce016[_0x0d03('0x51')]=qs[_0x0d03('0x52')](_0x1aa41c[_0x0d03('0x49')][_0x0d03('0x52')]);_0xcce016[_0x0d03('0x53')]=qs['filters'](_[_0x0d03('0x54')](_0x1aa41c[_0x0d03('0x49')],_0x38ee3f[_0x0d03('0x4a')]));_0xcce016[_0x0d03('0x53')][_0x0d03('0x66')]=_0x2b3661['id'];if(_0x1aa41c[_0x0d03('0x49')][_0x0d03('0x55')]){_0xcce016[_0x0d03('0x53')]=_['merge'](_0xcce016[_0x0d03('0x53')],{'$or':_[_0x0d03('0x41')](_0xcce016[_0x0d03('0x4d')],function(_0x298175){var _0xaa193e={};_0xaa193e[_0x298175]={'$like':'%'+_0x1aa41c['query'][_0x0d03('0x55')]+'%'};return _0xaa193e;})});}_0xcce016=_[_0x0d03('0x56')]({},_0xcce016,_0x1aa41c['options']);return db[_0x0d03('0x6d')][_0x0d03('0x32')]({'where':_0xcce016[_0x0d03('0x53')]})[_0x0d03('0x23')](function(_0x9c0d19){_0x4dcd60[_0x0d03('0x32')]=_0x9c0d19;if(_0x1aa41c[_0x0d03('0x49')]['includeAll']){_0xcce016[_0x0d03('0x60')]=[{'all':!![]}];}return db[_0x0d03('0x6d')][_0x0d03('0x5a')](_0xcce016);})[_0x0d03('0x23')](function(_0x4db0c8){_0x4dcd60['rows']=_0x4db0c8;return _0x4dcd60;});}})[_0x0d03('0x23')](respondWithFilteredResult(_0x179bc7,_0xcce016))[_0x0d03('0x5c')](handleError(_0x179bc7,null));};exports[_0x0d03('0x70')]=function(_0x2887c4,_0x395949,_0x1a6481){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x2887c4[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x395949,null))[_0x0d03('0x23')](function(_0x395ea5){if(_0x395ea5){return _0x395ea5[_0x0d03('0x70')](_0x2887c4[_0x0d03('0x49')][_0x0d03('0x6b')]);}})[_0x0d03('0x23')](respondWithStatusCode(_0x395949,null))[_0x0d03('0x5c')](handleError(_0x395949,null));};exports[_0x0d03('0x67')]=function(_0x4f7ddc,_0xfe180f){var _0x564075={'name':_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x48')],'key':_0x4f7ddc[_0x0d03('0x63')]['key'],'email':_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x71')],'ListId':_0x4f7ddc[_0x0d03('0x63')]['ListId'],'active':!_[_0x0d03('0x72')](_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x73')])?_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x73')]:!![],'description':_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x0d03('0x72')](_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x75')])){if(_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x76')]){_0x564075[_0x0d03('0x3d')]['user']=_0x564075[_0x0d03('0x5e')][_0x0d03('0x77')]=_0x4f7ddc['body'][_0x0d03('0x78')];_0x564075[_0x0d03('0x3d')][_0x0d03('0x79')]=_0x564075[_0x0d03('0x5e')][_0x0d03('0x7a')]=_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x7b')];}else{_0x564075[_0x0d03('0x3d')][_0x0d03('0x7c')]=_0x564075['Smtp'][_0x0d03('0x7c')]=![];}_0x564075[_0x0d03('0x3d')]['host']=_0x4f7ddc['body'][_0x0d03('0x3d')][_0x0d03('0x7d')];_0x564075[_0x0d03('0x3d')]['port']=_0x4f7ddc[_0x0d03('0x63')]['Imap']['port'];_0x564075['Smtp']['host']=_0x4f7ddc['body'][_0x0d03('0x5e')][_0x0d03('0x7d')];_0x564075[_0x0d03('0x5e')]['port']=_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x5e')]['port'];}else{_0x564075[_0x0d03('0x3d')][_0x0d03('0x7e')]=_0x564075['Smtp']['service']=_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x75')];_0x564075[_0x0d03('0x3d')][_0x0d03('0x77')]=_0x564075['Smtp'][_0x0d03('0x77')]=_0x4f7ddc[_0x0d03('0x63')][_0x0d03('0x78')];_0x564075['Imap'][_0x0d03('0x79')]=_0x564075[_0x0d03('0x5e')]['pass']=_0x4f7ddc['body'][_0x0d03('0x7b')];}return db[_0x0d03('0x42')][_0x0d03('0x67')](_0x564075,{'include':[{'model':db[_0x0d03('0x3e')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x0d03('0x3d')}]})[_0x0d03('0x23')](function(_0x276875){var _0x1809ef=_0x4f7ddc['user'][_0x0d03('0x38')]({'plain':!![]});if(!_0x1809ef)throw new Error(_0x0d03('0x7f'));if(_0x1809ef['role']===_0x0d03('0x77')){var _0x11e79e=_0x276875['get']({'plain':!![]});return db[_0x0d03('0x80')]['find']({'where':{'name':_0x0d03('0x39'),'userProfileId':_0x1809ef['userProfileId']},'raw':!![]})['then'](function(_0x508fd2){if(_0x508fd2&&_0x508fd2[_0x0d03('0x81')]===0x0){return db[_0x0d03('0x3a')][_0x0d03('0x67')]({'name':_0x11e79e[_0x0d03('0x48')],'resourceId':_0x11e79e['id'],'type':_0x508fd2[_0x0d03('0x48')],'sectionId':_0x508fd2['id']},{})['then'](function(){return _0x276875;});}else{return _0x276875;}})['catch'](function(_0x56fb36){logger['error'](_0x0d03('0x82'),_0x56fb36);throw _0x56fb36;});}return _0x276875;})[_0x0d03('0x23')](respondWithResult(_0xfe180f,0xc9))[_0x0d03('0x5c')](handleError(_0xfe180f,null));};exports['getImap']=function(_0x274fd9,_0x106020,_0x164b29){return db[_0x0d03('0x42')][_0x0d03('0x6f')]({'where':{'id':_0x274fd9[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x106020,null))[_0x0d03('0x23')](function(_0xd0beea){if(_0xd0beea){return _0xd0beea[_0x0d03('0x83')]();}return null;})[_0x0d03('0x23')](respondWithResult(_0x106020,null))['catch'](handleError(_0x106020,null));};exports['addImap']=function(_0x51a728,_0x12e3af,_0x5bd4be){if(_0x51a728[_0x0d03('0x63')]['id']){delete _0x51a728[_0x0d03('0x63')]['id'];}return db[_0x0d03('0x42')]['find']({'where':{'id':_0x51a728[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x12e3af,null))[_0x0d03('0x23')](function(_0x32f776){if(_0x32f776){_0x51a728[_0x0d03('0x63')][_0x0d03('0x66')]=_0x32f776['id'];return db[_0x0d03('0x62')][_0x0d03('0x67')](_0x51a728['body']);}})[_0x0d03('0x23')](respondWithResult(_0x12e3af,null))['catch'](handleError(_0x12e3af,null));};exports[_0x0d03('0x84')]=function(_0x56e0e0,_0x334905,_0x286b10){return db[_0x0d03('0x42')][_0x0d03('0x6f')]({'where':{'id':_0x56e0e0[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x334905,null))[_0x0d03('0x23')](function(_0x25e5ed){if(_0x25e5ed){return _0x25e5ed[_0x0d03('0x85')](null);}return null;})[_0x0d03('0x23')](respondWithStatusCode(_0x334905,null))['catch'](handleError(_0x334905,null));};exports[_0x0d03('0x86')]=function(_0x158430,_0x25d835,_0x46f854){return db[_0x0d03('0x42')][_0x0d03('0x6f')]({'where':{'id':_0x158430[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x25d835,null))[_0x0d03('0x23')](function(_0x2ebf53){if(_0x2ebf53){return _0x2ebf53['getSmtp']();}return null;})[_0x0d03('0x23')](respondWithResult(_0x25d835,null))[_0x0d03('0x5c')](handleError(_0x25d835,null));};exports[_0x0d03('0x87')]=function(_0x361f42,_0x125cd6,_0x27dd2b){if(_0x361f42[_0x0d03('0x63')]['id']){delete _0x361f42[_0x0d03('0x63')]['id'];}return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x361f42[_0x0d03('0x5d')]['id']}})['then'](handleEntityNotFound(_0x125cd6,null))[_0x0d03('0x23')](function(_0xaf2d0e){if(_0xaf2d0e){_0x361f42['body'][_0x0d03('0x66')]=_0xaf2d0e['id'];return db['MailServerOut'][_0x0d03('0x67')](_0x361f42['body']);}})[_0x0d03('0x23')](respondWithResult(_0x125cd6,null))[_0x0d03('0x5c')](handleError(_0x125cd6,null));};exports[_0x0d03('0x88')]=function(_0x3b3eac,_0x4c37c6,_0x5939c9){return db[_0x0d03('0x42')][_0x0d03('0x6f')]({'where':{'id':_0x3b3eac[_0x0d03('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4c37c6,null))[_0x0d03('0x23')](function(_0x369a59){if(_0x369a59){return _0x369a59[_0x0d03('0x89')](null);}return null;})[_0x0d03('0x23')](respondWithStatusCode(_0x4c37c6,null))[_0x0d03('0x5c')](handleError(_0x4c37c6,null));};exports[_0x0d03('0x8a')]=function(_0x51c574,_0x595ff0,_0x4f9b6a){return db[_0x0d03('0x8b')]['find']({'where':{'id':_0x51c574[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x595ff0,null))['then'](function(_0x1a1645){if(_0x1a1645){return _0x1a1645['addInteraction'](_0x51c574[_0x0d03('0x63')][_0x0d03('0x6b')],_[_0x0d03('0x8c')](_0x51c574['body'],[_0x0d03('0x6b'),'id'])||{});}})[_0x0d03('0x23')](respondWithResult(_0x595ff0,null))[_0x0d03('0x5c')](handleError(_0x595ff0,null));};exports[_0x0d03('0x8d')]=function(_0x3b302f,_0x13270b,_0x1e6cdc){var _0x215241={'raw':![],'where':{}};var _0xa4560d={};var _0x51fc66={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3b302f[_0x0d03('0x5d')]['id']}})['then'](handleEntityNotFound(_0x13270b,null))['then'](function(_0x4cef56){if(_0x4cef56){_0xa4560d[_0x0d03('0x47')]=_[_0x0d03('0x5f')](db[_0x0d03('0x8b')][_0x0d03('0x43')]);_0xa4560d[_0x0d03('0x49')]=_[_0x0d03('0x5f')](_0x3b302f[_0x0d03('0x49')]);_0xa4560d[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0xa4560d[_0x0d03('0x47')],_0xa4560d['query']);_0x215241['attributes']=_[_0x0d03('0x4b')](_0xa4560d['model'],qs['fields'](_0x3b302f[_0x0d03('0x49')]['fields']));_0x215241[_0x0d03('0x4d')]=_0x215241[_0x0d03('0x4d')][_0x0d03('0x4e')]?_0x215241[_0x0d03('0x4d')]:_0xa4560d[_0x0d03('0x47')];if(!_0x3b302f['query'][_0x0d03('0x4f')](_0x0d03('0x50'))){_0x215241[_0x0d03('0x31')]=qs['limit'](_0x3b302f['query'][_0x0d03('0x31')]);_0x215241[_0x0d03('0x2f')]=qs['offset'](_0x3b302f[_0x0d03('0x49')]['offset']);}_0x215241['order']=qs[_0x0d03('0x52')](_0x3b302f[_0x0d03('0x49')]['sort']);_0x215241[_0x0d03('0x53')]=qs[_0x0d03('0x4a')](_[_0x0d03('0x54')](_0x3b302f['query'],_0xa4560d[_0x0d03('0x4a')]));_0x215241[_0x0d03('0x53')]['MailAccountId']=_0x4cef56['id'];if(_0x3b302f['query'][_0x0d03('0x55')]){_0x215241[_0x0d03('0x53')]=_[_0x0d03('0x56')](_0x215241['where'],{'$or':_[_0x0d03('0x41')](_0x215241['attributes'],function(_0x4383b5){var _0x2dd79a={};_0x2dd79a[_0x4383b5]={'$like':'%'+_0x3b302f[_0x0d03('0x49')][_0x0d03('0x55')]+'%'};return _0x2dd79a;})});}_0x215241=_[_0x0d03('0x56')]({},_0x215241,_0x3b302f[_0x0d03('0x58')]);return db['MailInteraction']['count']({'where':_0x215241[_0x0d03('0x53')]})[_0x0d03('0x23')](function(_0xe5a74d){_0x51fc66[_0x0d03('0x32')]=_0xe5a74d;if(_0x3b302f[_0x0d03('0x49')]['includeAll']){_0x215241[_0x0d03('0x60')]=[{'model':db[_0x0d03('0x8e')],'as':_0x0d03('0x8f'),'required':![]},{'model':db[_0x0d03('0x90')],'as':'Owner','attributes':[_0x0d03('0x48'),_0x0d03('0x91'),_0x0d03('0x92')],'required':![]},{'model':db[_0x0d03('0x93')],'as':'Tags','attributes':['id','name',_0x0d03('0x94')],'where':_0x3b302f[_0x0d03('0x49')]['tag']?{'id':_0x3b302f[_0x0d03('0x49')][_0x0d03('0x95')]}:undefined,'required':_0x3b302f[_0x0d03('0x49')]['tag']?!![]:![]}];}return db[_0x0d03('0x8b')][_0x0d03('0x5a')](_0x215241);})['then'](function(_0x1a2259){_0x51fc66['rows']=_0x1a2259;return _0x51fc66;});}})[_0x0d03('0x23')](respondWithFilteredResult(_0x13270b,_0x215241))[_0x0d03('0x5c')](handleError(_0x13270b,null));};exports[_0x0d03('0x96')]=function addApplications(_0x55abab,_0x4baca3){var _0x5d1510=_0x55abab[_0x0d03('0x5d')]['id'];var _0x54517e=_0x55abab['body'];var _0xb75452=0xc8;var _0xe3cae8=null;return db['sequelize'][_0x0d03('0x97')]({'isolationLevel':db[_0x0d03('0x98')][_0x0d03('0x99')][_0x0d03('0x9a')][_0x0d03('0x9b')]},function(_0x2f5c09){return db['MailAccount']['findOne']({'where':{'id':_0x5d1510},'transaction':_0x2f5c09})[_0x0d03('0x23')](function(_0x562bfa){if(_0x562bfa){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x5d1510},'transaction':_0x2f5c09})[_0x0d03('0x23')](function(){var _0x161090=_[_0x0d03('0x41')](_0x54517e,function(_0x4e303d){_0x4e303d[_0x0d03('0x66')]=_0x5d1510;return _0x4e303d;});return db[_0x0d03('0x9c')]['bulkCreate'](_0x161090,{'transaction':_0x2f5c09});});}else{_0xb75452=0x194;_0xe3cae8=[];}});})['then'](function(){if(_0xb75452!==0x194){return db[_0x0d03('0x9c')]['findAndCountAll']({'where':{'MailAccountId':_0x5d1510},'order':'priority'})[_0x0d03('0x23')](function(_0x45e6f9){_0xe3cae8=_0x45e6f9;});}})[_0x0d03('0x5c')](function(_0x196044){_0xb75452=0x1f4;logger['error'](_0x196044[_0x0d03('0x9d')]);if(_0x196044['name']){delete _0x196044[_0x0d03('0x48')];}_0xe3cae8=_0x196044;})['finally'](function(){if(_0xe3cae8===null){_0x4baca3[_0x0d03('0x2c')](_0xb75452);}else{if(_0xb75452===0x1f4){_0x4baca3[_0x0d03('0x2d')](_0xb75452)[_0x0d03('0x9e')](_0xe3cae8);}else{_0x4baca3[_0x0d03('0x2d')](_0xb75452)['json'](_0xe3cae8);}}});};exports[_0x0d03('0x9f')]=function(_0x34c0fb,_0x1dc344,_0x10e3ea){var _0x1644fa={};var _0x772d1a={};var _0x2412db;var _0x54d396;return db[_0x0d03('0x42')]['findOne']({'where':{'id':_0x34c0fb[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x1dc344,null))[_0x0d03('0x23')](function(_0x2d18f0){if(_0x2d18f0){_0x2412db=_0x2d18f0;_0x772d1a['model']=_[_0x0d03('0x5f')](db['MailApplication'][_0x0d03('0x43')]);_0x772d1a[_0x0d03('0x49')]=_['keys'](_0x34c0fb['query']);_0x772d1a[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0x772d1a[_0x0d03('0x47')],_0x772d1a['query']);_0x1644fa[_0x0d03('0x4d')]=_[_0x0d03('0x4b')](_0x772d1a[_0x0d03('0x47')],qs[_0x0d03('0x4c')](_0x34c0fb[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x1644fa[_0x0d03('0x4d')]=_0x1644fa[_0x0d03('0x4d')][_0x0d03('0x4e')]?_0x1644fa[_0x0d03('0x4d')]:_0x772d1a[_0x0d03('0x47')];_0x1644fa[_0x0d03('0x51')]=qs[_0x0d03('0x52')](_0x34c0fb['query']['sort']);_0x1644fa[_0x0d03('0x53')]=qs[_0x0d03('0x4a')](_[_0x0d03('0x54')](_0x34c0fb[_0x0d03('0x49')],_0x772d1a[_0x0d03('0x4a')]));if(_0x34c0fb[_0x0d03('0x49')][_0x0d03('0x55')]){_0x1644fa['where']=_[_0x0d03('0x56')](_0x1644fa[_0x0d03('0x53')],{'$or':_[_0x0d03('0x41')](_0x1644fa[_0x0d03('0x4d')],function(_0x39542e){var _0x4ac85e={};_0x4ac85e[_0x39542e]={'$like':'%'+_0x34c0fb[_0x0d03('0x49')][_0x0d03('0x55')]+'%'};return _0x4ac85e;})});}_0x1644fa=_[_0x0d03('0x56')]({},_0x1644fa,_0x34c0fb[_0x0d03('0x58')]);return _0x2412db[_0x0d03('0x9f')](_0x1644fa);}})['then'](function(_0x4bb6c1){if(_0x4bb6c1){_0x54d396=_0x4bb6c1['length'];if(!_0x34c0fb[_0x0d03('0x49')]['hasOwnProperty'](_0x0d03('0x50'))){_0x1644fa['limit']=qs[_0x0d03('0x31')](_0x34c0fb['query'][_0x0d03('0x31')]);_0x1644fa[_0x0d03('0x2f')]=qs['offset'](_0x34c0fb[_0x0d03('0x49')][_0x0d03('0x2f')]);}return _0x2412db[_0x0d03('0x9f')](_0x1644fa);}})[_0x0d03('0x23')](function(_0x369430){if(_0x369430){return _0x369430?{'count':_0x54d396,'rows':_0x369430}:null;}})[_0x0d03('0x23')](respondWithResult(_0x1dc344,null))[_0x0d03('0x5c')](handleError(_0x1dc344,null));};exports[_0x0d03('0xa0')]=function(_0x564008,_0x5695f9,_0x4aa88b){var _0x187346={'raw':!![],'where':{}};var _0x3530a7={};var _0x521225={'count':0x0,'rows':[]};return db[_0x0d03('0x42')]['findOne']({'where':{'id':_0x564008['params']['id']}})['then'](handleEntityNotFound(_0x5695f9,null))['then'](function(_0x169e50){if(_0x169e50){_0x3530a7[_0x0d03('0x47')]=_['keys'](db[_0x0d03('0xa1')][_0x0d03('0x43')]);_0x3530a7['query']=_['keys'](_0x564008[_0x0d03('0x49')]);_0x3530a7[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0x3530a7[_0x0d03('0x47')],_0x3530a7['query']);_0x187346[_0x0d03('0x4d')]=_[_0x0d03('0x4b')](_0x3530a7['model'],qs[_0x0d03('0x4c')](_0x564008[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x187346[_0x0d03('0x4d')]=_0x187346[_0x0d03('0x4d')]['length']?_0x187346[_0x0d03('0x4d')]:_0x3530a7['model'];if(!_0x564008[_0x0d03('0x49')]['hasOwnProperty'](_0x0d03('0x50'))){_0x187346[_0x0d03('0x31')]=qs[_0x0d03('0x31')](_0x564008['query']['limit']);_0x187346[_0x0d03('0x2f')]=qs[_0x0d03('0x2f')](_0x564008['query'][_0x0d03('0x2f')]);}_0x187346['order']=qs[_0x0d03('0x52')](_0x564008['query'][_0x0d03('0x52')]);_0x187346['where']=qs[_0x0d03('0x4a')](_[_0x0d03('0x54')](_0x564008[_0x0d03('0x49')],_0x3530a7[_0x0d03('0x4a')]));_0x187346[_0x0d03('0x53')]['MailAccountId']=_0x169e50['id'];if(_0x564008[_0x0d03('0x49')][_0x0d03('0x55')]){_0x187346['where']=_['merge'](_0x187346['where'],{'$or':_[_0x0d03('0x41')](_0x187346['attributes'],function(_0x3da836){var _0x4a0da6={};_0x4a0da6[_0x3da836]={'$like':'%'+_0x564008[_0x0d03('0x49')][_0x0d03('0x55')]+'%'};return _0x4a0da6;})});}if(_0x564008[_0x0d03('0x49')][_0x0d03('0xa2')]){var _0x230836=_0x564008[_0x0d03('0x49')][_0x0d03('0xa2')][_0x0d03('0xa3')](',');var _0x5c89bb={};_0x5c89bb[_0x230836[0x0]]={'$gte':moment(_0x230836[0x1])['format'](_0x0d03('0xa4'))};_0x187346['where']=_[_0x0d03('0x56')](_0x187346[_0x0d03('0x53')],_0x5c89bb);}_0x187346=_[_0x0d03('0x56')]({},_0x187346,_0x564008[_0x0d03('0x58')]);return db[_0x0d03('0xa1')][_0x0d03('0x32')]({'where':_0x187346[_0x0d03('0x53')]})[_0x0d03('0x23')](function(_0x1fcb85){_0x521225[_0x0d03('0x32')]=_0x1fcb85;if(_0x564008[_0x0d03('0x49')][_0x0d03('0x59')]){_0x187346[_0x0d03('0x60')]=[{'all':!![]}];}return db[_0x0d03('0xa1')][_0x0d03('0x5a')](_0x187346);})[_0x0d03('0x23')](function(_0x22c679){if(_0x564008[_0x0d03('0x49')]['inlineCss']==='true'){for(var _0x2c4f02=0x0;_0x2c4f02<_0x22c679[_0x0d03('0x4e')];_0x2c4f02++){_0x22c679[_0x2c4f02]['body']=juice(_0x22c679[_0x2c4f02]['body']);}}_0x521225['rows']=_0x22c679;return _0x521225;});}})[_0x0d03('0x23')](respondWithFilteredResult(_0x5695f9,_0x187346))[_0x0d03('0x5c')](handleError(_0x5695f9,null));};exports[_0x0d03('0x9e')]=function(_0x2185cd,_0x3254ca,_0x2fdd8d){var _0x493594,_0x1029cb={},_0x4e1970;if(_0x2185cd[_0x0d03('0x63')]['to']){_0x4e1970=_0x2185cd['body']['to'][_0x0d03('0xa3')](',')[0x0];}return db['MailAccount'][_0x0d03('0x61')]({'where':{'id':_0x2185cd[_0x0d03('0x5d')]['id']},'include':[{'model':db[_0x0d03('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0d03('0xa6'),'where':{'email':_0x4e1970},'limit':0x1,'order':[[_0x0d03('0xa7'),_0x0d03('0xa8')]]}]},{'model':db[_0x0d03('0x3e')],'as':_0x0d03('0x5e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x3254ca,null))[_0x0d03('0x23')](function(_0x2073fd){if(_0x2073fd){_0x493594=_0x2073fd;if(_0x2073fd[_0x0d03('0x5e')]){if(_['isNil'](_0x2185cd['body'][_0x0d03('0xa9')])){_0x2185cd['body'][_0x0d03('0xa9')]=util['format']('%s\x20<%s>',_0x2073fd[_0x0d03('0x48')],_0x2073fd[_0x0d03('0x71')]||_0x2073fd[_0x0d03('0x5e')]['user']);}if(_0x2185cd[_0x0d03('0x63')][_0x0d03('0xaa')]&&_0x2185cd[_0x0d03('0x63')][_0x0d03('0xaa')][_0x0d03('0x4e')]){for(var _0x208046=0x0;_0x208046<_0x2185cd[_0x0d03('0x63')]['attachments'][_0x0d03('0x4e')];_0x208046+=0x1){_0x2185cd[_0x0d03('0x63')][_0x0d03('0xaa')][_0x208046]={'filename':_0x2185cd[_0x0d03('0x63')][_0x0d03('0xaa')][_0x208046][_0x0d03('0x48')],'path':path[_0x0d03('0xab')](config['root'],_0x0d03('0xac'),_0x2185cd[_0x0d03('0x63')][_0x0d03('0xaa')][_0x208046]['basename'])};}}var _0x14a5a2={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7e')])){if(_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7c')]){_0x14a5a2[_0x0d03('0xad')]={'user':_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x77')],'pass':_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7a')]};}_0x14a5a2['host']=_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7d')];_0x14a5a2['port']=_0x2073fd[_0x0d03('0x5e')][_0x0d03('0xae')];_0x14a5a2[_0x0d03('0xaf')]=_0x2073fd[_0x0d03('0x5e')][_0x0d03('0xaf')];}else{_0x14a5a2['service']=_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7e')];_0x14a5a2[_0x0d03('0xad')]={'user':_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x77')],'pass':_0x2073fd[_0x0d03('0x5e')][_0x0d03('0x7a')]};}return respondWithRpcPromise(_0x0d03('0xb0'),'sendMail',{'account':_0x14a5a2,'message':_0x2185cd[_0x0d03('0x63')]});}else{throw new Error(_0x0d03('0xb1'));}}})[_0x0d03('0x23')](function(_0x595b5e){if(_0x595b5e){_0x1029cb=_0x595b5e;if(_0x493594[_0x0d03('0xb2')]){if(_0x493594['List'][_0x0d03('0xa6')]['length']){return _0x493594['List'][_0x0d03('0xa6')][0x0];}else{return db[_0x0d03('0x8e')][_0x0d03('0x67')](_[_0x0d03('0x1b')](_0x2185cd['body'],{'firstName':_0x2185cd[_0x0d03('0x63')]['to'],'email':_0x2185cd[_0x0d03('0x63')]['to'],'phone':_0x2185cd[_0x0d03('0x63')]['to'],'ListId':_0x493594['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x0d03('0x23')](function(_0x43a13c){if(_0x43a13c){var _0x191712={'UserId':_0x2185cd[_0x0d03('0x77')]['id'],'ContactId':_0x43a13c['id'],'MailAccountId':_0x493594['id'],'inReplyTo':_0x1029cb['messageId'],'to':_0x2185cd[_0x0d03('0x63')]['from'],'cc':_0x2185cd[_0x0d03('0x63')]['cc'],'subject':_0x2185cd[_0x0d03('0x63')][_0x0d03('0xb3')],'attach':_0x2185cd[_0x0d03('0x63')][_0x0d03('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x0d03('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x0d03('0x56')](_0x2185cd[_0x0d03('0x63')],{'messageId':_0x1029cb[_0x0d03('0xb6')],'sentAt':moment()[_0x0d03('0xb5')](_0x0d03('0xa4')),'read':!![],'MailAccountId':_0x493594['id'],'UserId':_0x2185cd[_0x0d03('0x77')]['id'],'ContactId':_0x43a13c['id']})]};if(_0x2185cd['body'][_0x0d03('0xb7')]){_0x191712=_[_0x0d03('0x56')](_0x191712,_0x2185cd['body'][_0x0d03('0xb7')]);}return db['MailInteraction'][_0x0d03('0x67')](_0x191712,{'include':[{'model':db[_0x0d03('0xa1')],'as':_0x0d03('0xb8')}]});}})[_0x0d03('0x23')](respondWithResult(_0x3254ca,null))[_0x0d03('0x5c')](handleError(_0x3254ca,null));};exports[_0x0d03('0xb9')]=function(_0x5e5057,_0x4c3de0,_0x2c8436){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x5e5057[_0x0d03('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x4c3de0,null))['then'](function(_0x2eb5fc){if(_0x2eb5fc&&_0x2eb5fc['Smtp']){var _0x5c0c71={'id':_0x2eb5fc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2eb5fc[_0x0d03('0x5e')][_0x0d03('0x7e')]){_0x5c0c71[_0x0d03('0x7e')]=_0x2eb5fc[_0x0d03('0x5e')]['service'];}else{_0x5c0c71['host']=_0x2eb5fc['Smtp'][_0x0d03('0x7d')];_0x5c0c71[_0x0d03('0xae')]=_0x2eb5fc[_0x0d03('0x5e')][_0x0d03('0xae')];_0x5c0c71['secure']=_0x2eb5fc[_0x0d03('0x5e')][_0x0d03('0xaf')];}if(_0x2eb5fc[_0x0d03('0x5e')][_0x0d03('0x7c')]){_0x5c0c71[_0x0d03('0xad')]={'user':_0x2eb5fc['Smtp']['user'],'pass':_0x2eb5fc['Smtp'][_0x0d03('0x7a')]};}return respondWithRpcPromise('VerifySmtp',_0x0d03('0xb9'),{'account':_0x5c0c71});}})[_0x0d03('0x23')](respondWithResult(_0x4c3de0,null))['catch'](handleError(_0x4c3de0,null));};exports[_0x0d03('0x37')]=function(_0x1ab4e2,_0x28bc1f){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x1ab4e2[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x28bc1f,null))[_0x0d03('0x23')](function(_0x2dfa0c){if(_0x2dfa0c&&_0x2dfa0c[_0x0d03('0x7e')]){throw new db[(_0x0d03('0xba'))][(_0x0d03('0xbb'))](_0x0d03('0xbc'));}return _0x2dfa0c;})[_0x0d03('0x23')](removeEntity(_0x28bc1f,null))[_0x0d03('0x5c')](handleError(_0x28bc1f,null));};exports[_0x0d03('0xbd')]=function(_0x486125,_0x104826,_0x402b56){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x486125[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x104826,null))[_0x0d03('0x23')](function(_0x1bf191){if(_0x1bf191){return _0x1bf191[_0x0d03('0xbd')](_0x486125['body']['ids'],_['omit'](_0x486125['body'],[_0x0d03('0x6b'),'id'])||{})['spread'](function(_0x33dae0){for(var _0x25f7d6=0x0;_0x25f7d6<_0x486125[_0x0d03('0x63')][_0x0d03('0x6b')][_0x0d03('0x4e')];_0x25f7d6+=0x1){socket[_0x0d03('0xbe')](_0x0d03('0xbf'),{'UserId':Number(_0x486125[_0x0d03('0x63')]['ids'][_0x25f7d6]),'MailAccountId':Number(_0x486125[_0x0d03('0x5d')]['id'])});}return _0x33dae0;});}})['then'](respondWithResult(_0x104826,null))[_0x0d03('0x5c')](handleError(_0x104826,null));};exports[_0x0d03('0xc0')]=function(_0x1265f6,_0x2f4d7a,_0x3c48d0){return db[_0x0d03('0x42')][_0x0d03('0x61')]({'where':{'id':_0x1265f6['params']['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x2f4d7a,null))[_0x0d03('0x23')](function(_0x4ceca3){if(_0x4ceca3){return _0x4ceca3[_0x0d03('0xc0')](_0x1265f6['query'][_0x0d03('0x6b')])[_0x0d03('0x23')](function(){if(_['isArray'](_0x1265f6[_0x0d03('0x49')][_0x0d03('0x6b')])){for(var _0x1c77a6=0x0;_0x1c77a6<_0x1265f6['query'][_0x0d03('0x6b')]['length'];_0x1c77a6+=0x1){socket[_0x0d03('0xbe')](_0x0d03('0xc1'),{'UserId':Number(_0x1265f6[_0x0d03('0x49')][_0x0d03('0x6b')][_0x1c77a6]),'MailAccountId':Number(_0x1265f6[_0x0d03('0x5d')]['id'])});}}else{socket['emit'](_0x0d03('0xc1'),{'UserId':Number(_0x1265f6['query'][_0x0d03('0x6b')]),'MailAccountId':Number(_0x1265f6[_0x0d03('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f4d7a,null))[_0x0d03('0x5c')](handleError(_0x2f4d7a,null));};exports[_0x0d03('0xc2')]=function(_0x3138e7,_0x4ae3ca,_0x1c30de){var _0x49b159={};var _0x5558da={};var _0x26390c;var _0x4db802;return db[_0x0d03('0x42')]['findOne']({'where':{'id':_0x3138e7[_0x0d03('0x5d')]['id']}})[_0x0d03('0x23')](handleEntityNotFound(_0x4ae3ca,null))[_0x0d03('0x23')](function(_0x5b800b){if(_0x5b800b){_0x26390c=_0x5b800b;_0x5558da[_0x0d03('0x47')]=_[_0x0d03('0x5f')](db[_0x0d03('0x90')]['rawAttributes']);_0x5558da[_0x0d03('0x49')]=_[_0x0d03('0x5f')](_0x3138e7[_0x0d03('0x49')]);_0x5558da[_0x0d03('0x4a')]=_[_0x0d03('0x4b')](_0x5558da['model'],_0x5558da['query']);_0x49b159[_0x0d03('0x4d')]=_[_0x0d03('0x4b')](_0x5558da[_0x0d03('0x47')],qs[_0x0d03('0x4c')](_0x3138e7[_0x0d03('0x49')][_0x0d03('0x4c')]));_0x49b159[_0x0d03('0x4d')]=_0x49b159['attributes'][_0x0d03('0x4e')]?_0x49b159[_0x0d03('0x4d')]:_0x5558da[_0x0d03('0x47')];_0x49b159[_0x0d03('0x51')]=qs[_0x0d03('0x52')](_0x3138e7['query'][_0x0d03('0x52')]);_0x49b159['where']=qs[_0x0d03('0x4a')](_[_0x0d03('0x54')](_0x3138e7[_0x0d03('0x49')],_0x5558da[_0x0d03('0x4a')]));if(_0x3138e7[_0x0d03('0x49')][_0x0d03('0x55')]){_0x49b159['where']=_[_0x0d03('0x56')](_0x49b159[_0x0d03('0x53')],{'$or':_[_0x0d03('0x41')](_0x49b159['attributes'],function(_0x2283d6){var _0x1fb23b={};_0x1fb23b[_0x2283d6]={'$like':'%'+_0x3138e7['query'][_0x0d03('0x55')]+'%'};return _0x1fb23b;})});}_0x49b159=_['merge']({},_0x49b159,_0x3138e7[_0x0d03('0x58')]);return _0x26390c[_0x0d03('0xc2')](_0x49b159);}})[_0x0d03('0x23')](function(_0x35cb4d){if(_0x35cb4d){_0x4db802=_0x35cb4d[_0x0d03('0x4e')];if(!_0x3138e7['query'][_0x0d03('0x4f')](_0x0d03('0x50'))){_0x49b159['limit']=qs[_0x0d03('0x31')](_0x3138e7[_0x0d03('0x49')]['limit']);_0x49b159[_0x0d03('0x2f')]=qs['offset'](_0x3138e7[_0x0d03('0x49')][_0x0d03('0x2f')]);}return _0x26390c['getAgents'](_0x49b159);}})[_0x0d03('0x23')](function(_0xec6ccf){if(_0xec6ccf){return _0xec6ccf?{'count':_0x4db802,'rows':_0xec6ccf}:null;}})['then'](respondWithResult(_0x4ae3ca,null))['catch'](handleError(_0x4ae3ca,null));}; \ No newline at end of file +var _0x00da=['removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','List','updatedAt','DESC','from','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','CmContact','defaults','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','emit','userMailAccount:remove','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','fs-extra','squel','jsforce','to-csv','papaparse','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','MailAccount','findAll','rows','catch','show','params','MailServerOut','Smtp','length','merge','find','body','Imap','describe','addDisposition','MailAccountId','Disposition','create','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x00da,0x1cf));var _0xa00d=function(_0x48a3c2,_0x208531){_0x48a3c2=_0x48a3c2-0x0;var _0x28e359=_0x00da[_0x48a3c2];return _0x28e359;};'use strict';var emlformat=require(_0xa00d('0x0'));var rimraf=require(_0xa00d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa00d('0x2'));var rp=require(_0xa00d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa00d('0x4'));var util=require('util');var path=require(_0xa00d('0x5'));var sox=require(_0xa00d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa00d('0x7'));var _=require('lodash');var squel=require(_0xa00d('0x8'));var crypto=require('crypto');var jsforce=require(_0xa00d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa00d('0xa'));var querystring=require('querystring');var Papa=require(_0xa00d('0xb'));var htmlToText=require('html-to-text');var juice=require(_0xa00d('0xc'));var Redis=require(_0xa00d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa00d('0xe'));var as=require(_0xa00d('0xf'));var hardwareService=require(_0xa00d('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xa00d('0x11'));var config=require(_0xa00d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa00d('0x13'))['db'];config[_0xa00d('0x14')]=_['defaults'](config[_0xa00d('0x14')],{'host':_0xa00d('0x15'),'port':0x18eb});var socket=require(_0xa00d('0x16'))(new Redis(config['redis']));require(_0xa00d('0x17'))[_0xa00d('0x18')](socket);var jayson=require(_0xa00d('0x19'));var client=jayson[_0xa00d('0x1a')][_0xa00d('0x1b')]({'port':0x232b});function respondWithRpcPromise(_0x5c083a,_0xd9a8a9,_0x2fa44d,_0x3b14e7){return new BPromise(function(_0x1c24d7,_0x5ec176){var _0x543198=_0x3b14e7||client;return _0x543198[_0xa00d('0x1c')](_0x5c083a,_0x2fa44d)['then'](function(_0x157588){logger[_0xa00d('0x1d')](_0xa00d('0x1e'),_0xd9a8a9,_0xa00d('0x1f'));logger['debug'](_0xa00d('0x20'),_0xd9a8a9,'request\x20sent',JSON['stringify'](_0x157588));if(_0x157588[_0xa00d('0x21')]){if(_0x157588[_0xa00d('0x21')][_0xa00d('0x22')]===0x1f4){logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x157588[_0xa00d('0x21')]['message']);return _0x5ec176(_0x157588[_0xa00d('0x21')][_0xa00d('0x23')]);}logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x157588[_0xa00d('0x21')][_0xa00d('0x23')]);return _0x1c24d7(_0x157588['error'][_0xa00d('0x23')]);}else{logger[_0xa00d('0x1d')](_0xa00d('0x1e'),_0xd9a8a9,'request\x20sent');_0x1c24d7(_0x157588[_0xa00d('0x24')][_0xa00d('0x23')]);}})['catch'](function(_0x4c6147){logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x4c6147);_0x5ec176(_0x4c6147);});});}function respondWithStatusCode(_0x53db02,_0xc4857d){_0xc4857d=_0xc4857d||0xcc;return function(_0x38206a){if(_0x38206a){return _0x53db02[_0xa00d('0x25')](_0xc4857d);}return _0x53db02['status'](_0xc4857d)[_0xa00d('0x26')]();};}function respondWithResult(_0x392631,_0x435597){_0x435597=_0x435597||0xc8;return function(_0x42b24b){if(_0x42b24b){return _0x392631[_0xa00d('0x27')](_0x435597)['json'](_0x42b24b);}};}function respondWithFilteredResult(_0x21ca1f,_0x309686){return function(_0x2a2138){if(_0x2a2138){var _0x1e93d2=typeof _0x309686[_0xa00d('0x28')]===_0xa00d('0x29')&&typeof _0x309686[_0xa00d('0x2a')]==='undefined';var _0x324426=_0x2a2138[_0xa00d('0x2b')];var _0x8bda2b=_0x1e93d2?0x0:_0x309686[_0xa00d('0x28')];var _0x5e09dc=_0x1e93d2?_0x2a2138['count']:_0x309686[_0xa00d('0x28')]+_0x309686[_0xa00d('0x2a')];var _0x53cc26;if(_0x5e09dc>=_0x324426){_0x5e09dc=_0x324426;_0x53cc26=0xc8;}else{_0x53cc26=0xce;}_0x21ca1f[_0xa00d('0x27')](_0x53cc26);return _0x21ca1f['set'](_0xa00d('0x2c'),_0x8bda2b+'-'+_0x5e09dc+'/'+_0x324426)[_0xa00d('0x2d')](_0x2a2138);}return null;};}function patchUpdates(_0x4a66b0){return function(_0x1e0a64){try{jsonpatch[_0xa00d('0x2e')](_0x1e0a64,_0x4a66b0,!![]);}catch(_0x237282){return BPromise['reject'](_0x237282);}return _0x1e0a64[_0xa00d('0x2f')]();};}function saveUpdates(_0x412747,_0x2a6a4b){return function(_0x390659){if(_0x390659){return _0x390659[_0xa00d('0x30')](_0x412747)[_0xa00d('0x31')](function(_0x5fbd4e){return _0x5fbd4e;});}return null;};}function removeEntity(_0x2d3948,_0x4ce8bb){return function(_0x4901f3){if(_0x4901f3){return _0x4901f3[_0xa00d('0x32')]()[_0xa00d('0x31')](function(){var _0x64557d=_0x4901f3[_0xa00d('0x33')]({'plain':!![]});var _0x1bfa29=_0xa00d('0x34');return db[_0xa00d('0x35')][_0xa00d('0x32')]({'where':{'type':_0x1bfa29,'resourceId':_0x64557d['id']}})[_0xa00d('0x31')](function(){return _0x4901f3;});})[_0xa00d('0x31')](function(){_0x2d3948[_0xa00d('0x27')](0xcc)[_0xa00d('0x26')]();});}};}function handleEntityNotFound(_0x327743,_0x474e74){return function(_0x13ad82){if(!_0x13ad82){_0x327743[_0xa00d('0x25')](0x194);}return _0x13ad82;};}function handleError(_0xe5725e,_0x154311){_0x154311=_0x154311||0x1f4;return function(_0x5425f7){logger['error'](_0x5425f7[_0xa00d('0x36')]);if(_0x5425f7[_0xa00d('0x37')]){delete _0x5425f7[_0xa00d('0x37')];}_0xe5725e[_0xa00d('0x27')](_0x154311)[_0xa00d('0x38')](_0x5425f7);};}exports[_0xa00d('0x39')]=function(_0x536877,_0x24929f){var _0x359fe2={'include':[{'model':db[_0xa00d('0x3a')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xa00d('0x3b')],'as':_0xa00d('0x3c')}]},_0x36e7dc={},_0x336ea3={'count':0x0,'rows':[]};var _0x1ca056=_[_0xa00d('0x3d')](db['MailAccount'][_0xa00d('0x3e')],function(_0x29ba4a){return{'name':_0x29ba4a[_0xa00d('0x3f')],'type':_0x29ba4a[_0xa00d('0x40')][_0xa00d('0x41')]};});_0x36e7dc[_0xa00d('0x42')]=_[_0xa00d('0x3d')](_0x1ca056,_0xa00d('0x37'));_0x36e7dc[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x536877[_0xa00d('0x43')]);_0x36e7dc[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x36e7dc[_0xa00d('0x42')],_0x36e7dc['query']);_0x359fe2[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x36e7dc['model'],qs[_0xa00d('0x48')](_0x536877[_0xa00d('0x43')][_0xa00d('0x48')]));_0x359fe2[_0xa00d('0x47')]=_0x359fe2['attributes']['length']?_0x359fe2[_0xa00d('0x47')]:_0x36e7dc[_0xa00d('0x42')];if(!_0x536877[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x359fe2[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x536877['query']['limit']);_0x359fe2[_0xa00d('0x28')]=qs['offset'](_0x536877['query'][_0xa00d('0x28')]);}_0x359fe2['order']=qs[_0xa00d('0x4b')](_0x536877[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x359fe2[_0xa00d('0x4c')]=qs['filters'](_['pick'](_0x536877[_0xa00d('0x43')],_0x36e7dc[_0xa00d('0x45')]),_0x1ca056);if(_0x536877['query'][_0xa00d('0x4d')]){_0x359fe2[_0xa00d('0x4c')]=_['merge'](_0x359fe2['where'],{'$or':_[_0xa00d('0x3d')](_0x1ca056,function(_0x1c7013){if(_0x1c7013['type']!=='VIRTUAL'){var _0x1ab56e={};_0x1ab56e[_0x1c7013['name']]={'$like':'%'+_0x536877[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x1ab56e;}})});}_0x359fe2=_['merge']({},_0x359fe2,_0x536877[_0xa00d('0x4e')]);var _0x390caf={'where':_0x359fe2['where']};return db['MailAccount']['count'](_0x390caf)[_0xa00d('0x31')](function(_0x33a9fa){_0x336ea3[_0xa00d('0x2b')]=_0x33a9fa;if(_0x536877[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x359fe2[_0xa00d('0x50')]=[{'all':!![]}];}return db[_0xa00d('0x51')][_0xa00d('0x52')](_0x359fe2);})[_0xa00d('0x31')](function(_0x2fe804){_0x336ea3[_0xa00d('0x53')]=_0x2fe804;return _0x336ea3;})['then'](respondWithFilteredResult(_0x24929f,_0x359fe2))[_0xa00d('0x54')](handleError(_0x24929f,null));};exports[_0xa00d('0x55')]=function(_0x2ebc9f,_0x2bc0a5){var _0x3a08d8={'raw':![],'where':{'id':_0x2ebc9f[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x3a')],'as':'Imap'},{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58')},{'model':db[_0xa00d('0x3b')],'as':_0xa00d('0x3c')}]},_0x4b1b62={};_0x4b1b62[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x51')][_0xa00d('0x3e')]);_0x4b1b62[_0xa00d('0x43')]=_['keys'](_0x2ebc9f[_0xa00d('0x43')]);_0x4b1b62[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x4b1b62['model'],_0x4b1b62[_0xa00d('0x43')]);_0x3a08d8[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x4b1b62[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x2ebc9f[_0xa00d('0x43')][_0xa00d('0x48')]));_0x3a08d8['attributes']=_0x3a08d8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x3a08d8[_0xa00d('0x47')]:_0x4b1b62[_0xa00d('0x42')];if(_0x2ebc9f[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x3a08d8[_0xa00d('0x50')]=[{'all':!![]}];}_0x3a08d8=_[_0xa00d('0x5a')]({},_0x3a08d8,_0x2ebc9f[_0xa00d('0x4e')]);return db[_0xa00d('0x51')][_0xa00d('0x5b')](_0x3a08d8)[_0xa00d('0x31')](handleEntityNotFound(_0x2bc0a5,null))[_0xa00d('0x31')](respondWithResult(_0x2bc0a5,null))[_0xa00d('0x54')](handleError(_0x2bc0a5,null));};exports[_0xa00d('0x30')]=function(_0x5991cf,_0xb9fce0){if(_0x5991cf[_0xa00d('0x5c')]['id']){delete _0x5991cf[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')]['find']({'where':{'id':_0x5991cf[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x3a')],'as':_0xa00d('0x5d')},{'model':db[_0xa00d('0x57')],'as':'Smtp'},{'model':db['Pause'],'as':_0xa00d('0x3c')}]})[_0xa00d('0x31')](handleEntityNotFound(_0xb9fce0,null))[_0xa00d('0x31')](saveUpdates(_0x5991cf[_0xa00d('0x5c')],null))['then'](function(_0x5e596e){if(_0x5e596e&&_0x5991cf['body'][_0xa00d('0x5d')]){return db['MailServerIn'][_0xa00d('0x30')](_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x5d')],{'where':{'MailAccountId':_0x5e596e['id']}})[_0xa00d('0x31')](function(){return _0x5e596e;});}return _0x5e596e;})['then'](function(_0x2b90c7){if(_0x2b90c7&&_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x58')]){return db[_0xa00d('0x57')][_0xa00d('0x30')](_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x58')],{'where':{'MailAccountId':_0x2b90c7['id']}})[_0xa00d('0x31')](function(){return _0x2b90c7;});}return _0x2b90c7;})[_0xa00d('0x31')](respondWithResult(_0xb9fce0,null))[_0xa00d('0x54')](handleError(_0xb9fce0,null));};exports[_0xa00d('0x5e')]=function(_0x4a3fd2,_0x3de5c5){return db[_0xa00d('0x51')][_0xa00d('0x5e')]()[_0xa00d('0x31')](respondWithResult(_0x3de5c5,null))[_0xa00d('0x54')](handleError(_0x3de5c5,null));};exports[_0xa00d('0x5f')]=function(_0x2cf218,_0x2b868e,_0x9a61a7){if(_0x2cf218[_0xa00d('0x5c')]['id']){delete _0x2cf218[_0xa00d('0x5c')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2cf218[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x2b868e,null))['then'](function(_0x2e35f3){if(_0x2e35f3){_0x2cf218[_0xa00d('0x5c')][_0xa00d('0x60')]=_0x2e35f3['id'];return db[_0xa00d('0x61')][_0xa00d('0x62')](_0x2cf218[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x2b868e,null))[_0xa00d('0x54')](handleError(_0x2b868e,null));};exports['getDispositions']=function(_0x108941,_0x2c3d1a,_0x524fd3){var _0x134fc8={'raw':![],'where':{}};var _0xf281e3={};var _0x31ad83={'count':0x0,'rows':[]};return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x108941[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x2c3d1a,null))[_0xa00d('0x31')](function(_0x38e122){if(_0x38e122){_0xf281e3[_0xa00d('0x42')]=_[_0xa00d('0x44')](db['Disposition'][_0xa00d('0x3e')]);_0xf281e3[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x108941[_0xa00d('0x43')]);_0xf281e3['filters']=_['intersection'](_0xf281e3[_0xa00d('0x42')],_0xf281e3[_0xa00d('0x43')]);_0x134fc8[_0xa00d('0x47')]=_['intersection'](_0xf281e3[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x108941[_0xa00d('0x43')][_0xa00d('0x48')]));_0x134fc8[_0xa00d('0x47')]=_0x134fc8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x134fc8[_0xa00d('0x47')]:_0xf281e3[_0xa00d('0x42')];if(!_0x108941[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x134fc8[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x108941[_0xa00d('0x43')][_0xa00d('0x2a')]);_0x134fc8['offset']=qs[_0xa00d('0x28')](_0x108941['query'][_0xa00d('0x28')]);}_0x134fc8[_0xa00d('0x64')]=qs['sort'](_0x108941['query']['sort']);_0x134fc8[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x108941['query'],_0xf281e3[_0xa00d('0x45')]));_0x134fc8[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x38e122['id'];if(_0x108941[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x134fc8['where']=_['merge'](_0x134fc8[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x134fc8['attributes'],function(_0x2066ca){var _0x17f1aa={};_0x17f1aa[_0x2066ca]={'$like':'%'+_0x108941[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x17f1aa;})});}_0x134fc8=_[_0xa00d('0x5a')]({},_0x134fc8,_0x108941[_0xa00d('0x4e')]);return db['Disposition'][_0xa00d('0x2b')]({'where':_0x134fc8[_0xa00d('0x4c')]})[_0xa00d('0x31')](function(_0xcffcea){_0x31ad83['count']=_0xcffcea;if(_0x108941[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x134fc8['include']=[{'all':!![]}];}return db[_0xa00d('0x61')][_0xa00d('0x52')](_0x134fc8);})[_0xa00d('0x31')](function(_0x5ab7da){_0x31ad83[_0xa00d('0x53')]=_0x5ab7da;return _0x31ad83;});}})[_0xa00d('0x31')](respondWithFilteredResult(_0x2c3d1a,_0x134fc8))['catch'](handleError(_0x2c3d1a,null));};exports[_0xa00d('0x66')]=function(_0x547481,_0x1e737a,_0x234517){return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x547481[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x1e737a,null))[_0xa00d('0x31')](function(_0x56d4a8){if(_0x56d4a8){return _0x56d4a8[_0xa00d('0x66')](_0x547481[_0xa00d('0x43')][_0xa00d('0x67')]);}})[_0xa00d('0x31')](respondWithStatusCode(_0x1e737a,null))[_0xa00d('0x54')](handleError(_0x1e737a,null));};exports[_0xa00d('0x68')]=function(_0x3e6e68,_0x279bf7,_0x344c81){if(_0x3e6e68['body']['id']){delete _0x3e6e68['body']['id'];}return db['MailAccount'][_0xa00d('0x5b')]({'where':{'id':_0x3e6e68['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x279bf7,null))[_0xa00d('0x31')](function(_0xc8415){if(_0xc8415){_0x3e6e68['body'][_0xa00d('0x60')]=_0xc8415['id'];return db[_0xa00d('0x69')]['create'](_0x3e6e68[_0xa00d('0x5c')]);}})['then'](respondWithResult(_0x279bf7,null))[_0xa00d('0x54')](handleError(_0x279bf7,null));};exports[_0xa00d('0x6a')]=function(_0x532203,_0x1cb1c1,_0xbf7447){var _0x1b0ee0={'raw':![],'where':{}};var _0x28c2ef={};var _0xafd4e4={'count':0x0,'rows':[]};return db['MailAccount'][_0xa00d('0x63')]({'where':{'id':_0x532203[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x1cb1c1,null))[_0xa00d('0x31')](function(_0x2bb10e){if(_0x2bb10e){_0x28c2ef[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x69')][_0xa00d('0x3e')]);_0x28c2ef[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x532203[_0xa00d('0x43')]);_0x28c2ef['filters']=_[_0xa00d('0x46')](_0x28c2ef['model'],_0x28c2ef[_0xa00d('0x43')]);_0x1b0ee0['attributes']=_[_0xa00d('0x46')](_0x28c2ef['model'],qs[_0xa00d('0x48')](_0x532203[_0xa00d('0x43')][_0xa00d('0x48')]));_0x1b0ee0[_0xa00d('0x47')]=_0x1b0ee0['attributes'][_0xa00d('0x59')]?_0x1b0ee0[_0xa00d('0x47')]:_0x28c2ef[_0xa00d('0x42')];if(!_0x532203['query'][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x1b0ee0[_0xa00d('0x2a')]=qs['limit'](_0x532203[_0xa00d('0x43')][_0xa00d('0x2a')]);_0x1b0ee0[_0xa00d('0x28')]=qs[_0xa00d('0x28')](_0x532203[_0xa00d('0x43')][_0xa00d('0x28')]);}_0x1b0ee0['order']=qs[_0xa00d('0x4b')](_0x532203[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x1b0ee0[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x532203[_0xa00d('0x43')],_0x28c2ef[_0xa00d('0x45')]));_0x1b0ee0[_0xa00d('0x4c')]['MailAccountId']=_0x2bb10e['id'];if(_0x532203['query'][_0xa00d('0x4d')]){_0x1b0ee0[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x1b0ee0['where'],{'$or':_['map'](_0x1b0ee0[_0xa00d('0x47')],function(_0x157c0e){var _0x2bc35c={};_0x2bc35c[_0x157c0e]={'$like':'%'+_0x532203['query'][_0xa00d('0x4d')]+'%'};return _0x2bc35c;})});}_0x1b0ee0=_['merge']({},_0x1b0ee0,_0x532203['options']);return db[_0xa00d('0x69')][_0xa00d('0x2b')]({'where':_0x1b0ee0['where']})[_0xa00d('0x31')](function(_0x10548d){_0xafd4e4[_0xa00d('0x2b')]=_0x10548d;if(_0x532203[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x1b0ee0[_0xa00d('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1b0ee0);})[_0xa00d('0x31')](function(_0x3232dc){_0xafd4e4[_0xa00d('0x53')]=_0x3232dc;return _0xafd4e4;});}})['then'](respondWithFilteredResult(_0x1cb1c1,_0x1b0ee0))[_0xa00d('0x54')](handleError(_0x1cb1c1,null));};exports[_0xa00d('0x6b')]=function(_0x308ed7,_0x3d619e,_0x41ecfc){return db['MailAccount']['find']({'where':{'id':_0x308ed7[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d619e,null))[_0xa00d('0x31')](function(_0x3028bd){if(_0x3028bd){return _0x3028bd[_0xa00d('0x6b')](_0x308ed7[_0xa00d('0x43')][_0xa00d('0x67')]);}})[_0xa00d('0x31')](respondWithStatusCode(_0x3d619e,null))['catch'](handleError(_0x3d619e,null));};exports[_0xa00d('0x62')]=function(_0x23b255,_0x4fe6d8){var _0x2d1a7b={'name':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x37')],'key':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x41')],'email':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6c')],'ListId':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6d')],'active':!_[_0xa00d('0x6e')](_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6f')])?_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6f')]:!![],'description':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xa00d('0x6e')](_0x23b255[_0xa00d('0x5c')][_0xa00d('0x71')])){if(_0x23b255['body'][_0xa00d('0x72')]){_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x73')]=_0x2d1a7b[_0xa00d('0x58')]['user']=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x74')];_0x2d1a7b['Imap'][_0xa00d('0x75')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x76')]=_0x23b255[_0xa00d('0x5c')]['cpassword'];}else{_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x77')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x77')]=![];}_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x78')]=_0x23b255[_0xa00d('0x5c')]['Imap'][_0xa00d('0x78')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x79')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x5d')][_0xa00d('0x79')];_0x2d1a7b['Smtp']['host']=_0x23b255['body'][_0xa00d('0x58')][_0xa00d('0x78')];_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x79')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x58')][_0xa00d('0x79')];}else{_0x2d1a7b[_0xa00d('0x5d')]['service']=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x7a')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x71')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x73')]=_0x2d1a7b['Smtp'][_0xa00d('0x73')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x74')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x75')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x76')]=_0x23b255[_0xa00d('0x5c')]['cpassword'];}return db[_0xa00d('0x51')]['create'](_0x2d1a7b,{'include':[{'model':db['MailServerOut'],'as':_0xa00d('0x58')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xa00d('0x31')](function(_0x2f6cd4){var _0x4dd7f3=_0x23b255[_0xa00d('0x73')]['get']({'plain':!![]});if(!_0x4dd7f3)throw new Error(_0xa00d('0x7b'));if(_0x4dd7f3[_0xa00d('0x7c')]==='user'){var _0x3e1d94=_0x2f6cd4[_0xa00d('0x33')]({'plain':!![]});return db[_0xa00d('0x7d')][_0xa00d('0x5b')]({'where':{'name':_0xa00d('0x34'),'userProfileId':_0x4dd7f3[_0xa00d('0x7e')]},'raw':!![]})[_0xa00d('0x31')](function(_0x465d80){if(_0x465d80&&_0x465d80[_0xa00d('0x7f')]===0x0){return db[_0xa00d('0x35')][_0xa00d('0x62')]({'name':_0x3e1d94[_0xa00d('0x37')],'resourceId':_0x3e1d94['id'],'type':_0x465d80['name'],'sectionId':_0x465d80['id']},{})[_0xa00d('0x31')](function(){return _0x2f6cd4;});}else{return _0x2f6cd4;}})[_0xa00d('0x54')](function(_0x23acfa){logger['error'](_0xa00d('0x80'),_0x23acfa);throw _0x23acfa;});}return _0x2f6cd4;})['then'](respondWithResult(_0x4fe6d8,0xc9))[_0xa00d('0x54')](handleError(_0x4fe6d8,null));};exports[_0xa00d('0x81')]=function(_0x2d5bd0,_0x467024,_0x485460){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x2d5bd0['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x467024,null))[_0xa00d('0x31')](function(_0x488648){if(_0x488648){return _0x488648[_0xa00d('0x81')]();}return null;})[_0xa00d('0x31')](respondWithResult(_0x467024,null))[_0xa00d('0x54')](handleError(_0x467024,null));};exports[_0xa00d('0x82')]=function(_0x297b15,_0x311899,_0x1f083b){if(_0x297b15[_0xa00d('0x5c')]['id']){delete _0x297b15[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x297b15['params']['id']}})['then'](handleEntityNotFound(_0x311899,null))[_0xa00d('0x31')](function(_0x28c527){if(_0x28c527){_0x297b15[_0xa00d('0x5c')][_0xa00d('0x60')]=_0x28c527['id'];return db[_0xa00d('0x3a')]['create'](_0x297b15[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x311899,null))['catch'](handleError(_0x311899,null));};exports[_0xa00d('0x83')]=function(_0x26f8e8,_0x18f103,_0x28cd57){return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x26f8e8[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x18f103,null))[_0xa00d('0x31')](function(_0x3ca973){if(_0x3ca973){return _0x3ca973['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x18f103,null))[_0xa00d('0x54')](handleError(_0x18f103,null));};exports[_0xa00d('0x84')]=function(_0x4a0abc,_0x42d98d,_0x24518d){return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x4a0abc[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x42d98d,null))[_0xa00d('0x31')](function(_0x3bec72){if(_0x3bec72){return _0x3bec72['getSmtp']();}return null;})[_0xa00d('0x31')](respondWithResult(_0x42d98d,null))[_0xa00d('0x54')](handleError(_0x42d98d,null));};exports['addSmtp']=function(_0x2a3261,_0x5cd575,_0x4e074e){if(_0x2a3261[_0xa00d('0x5c')]['id']){delete _0x2a3261[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x2a3261[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cd575,null))[_0xa00d('0x31')](function(_0x584d53){if(_0x584d53){_0x2a3261[_0xa00d('0x5c')]['MailAccountId']=_0x584d53['id'];return db['MailServerOut'][_0xa00d('0x62')](_0x2a3261[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x5cd575,null))[_0xa00d('0x54')](handleError(_0x5cd575,null));};exports[_0xa00d('0x85')]=function(_0x32ec85,_0x10bd0c,_0x581817){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x32ec85[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x10bd0c,null))[_0xa00d('0x31')](function(_0x477037){if(_0x477037){return _0x477037[_0xa00d('0x86')](null);}return null;})[_0xa00d('0x31')](respondWithStatusCode(_0x10bd0c,null))[_0xa00d('0x54')](handleError(_0x10bd0c,null));};exports[_0xa00d('0x87')]=function(_0x562fc9,_0x4dee55,_0x107f49){return db[_0xa00d('0x88')][_0xa00d('0x5b')]({'where':{'id':_0x562fc9['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x4dee55,null))[_0xa00d('0x31')](function(_0x26f385){if(_0x26f385){return _0x26f385[_0xa00d('0x87')](_0x562fc9[_0xa00d('0x5c')][_0xa00d('0x67')],_[_0xa00d('0x89')](_0x562fc9['body'],[_0xa00d('0x67'),'id'])||{});}})[_0xa00d('0x31')](respondWithResult(_0x4dee55,null))[_0xa00d('0x54')](handleError(_0x4dee55,null));};exports['getInteractions']=function(_0x1c99f8,_0x594a1c,_0xe61f5b){var _0x21bae8={'raw':![],'where':{}};var _0x44434f={};var _0x296e04={'count':0x0,'rows':[]};return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x1c99f8[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x594a1c,null))[_0xa00d('0x31')](function(_0x21f2df){if(_0x21f2df){_0x44434f['model']=_[_0xa00d('0x44')](db[_0xa00d('0x88')]['rawAttributes']);_0x44434f[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x1c99f8[_0xa00d('0x43')]);_0x44434f[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x44434f[_0xa00d('0x42')],_0x44434f[_0xa00d('0x43')]);_0x21bae8['attributes']=_[_0xa00d('0x46')](_0x44434f[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x1c99f8[_0xa00d('0x43')]['fields']));_0x21bae8['attributes']=_0x21bae8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x21bae8[_0xa00d('0x47')]:_0x44434f[_0xa00d('0x42')];if(!_0x1c99f8[_0xa00d('0x43')]['hasOwnProperty'](_0xa00d('0x4a'))){_0x21bae8['limit']=qs[_0xa00d('0x2a')](_0x1c99f8['query'][_0xa00d('0x2a')]);_0x21bae8[_0xa00d('0x28')]=qs[_0xa00d('0x28')](_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x28')]);}_0x21bae8[_0xa00d('0x64')]=qs[_0xa00d('0x4b')](_0x1c99f8['query'][_0xa00d('0x4b')]);_0x21bae8[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x1c99f8[_0xa00d('0x43')],_0x44434f[_0xa00d('0x45')]));_0x21bae8[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x21f2df['id'];if(_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x21bae8[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x21bae8[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x21bae8['attributes'],function(_0x396ba7){var _0x414c29={};_0x414c29[_0x396ba7]={'$like':'%'+_0x1c99f8['query'][_0xa00d('0x4d')]+'%'};return _0x414c29;})});}_0x21bae8=_['merge']({},_0x21bae8,_0x1c99f8[_0xa00d('0x4e')]);return db['MailInteraction'][_0xa00d('0x2b')]({'where':_0x21bae8[_0xa00d('0x4c')]})['then'](function(_0x55aa4a){_0x296e04[_0xa00d('0x2b')]=_0x55aa4a;if(_0x1c99f8[_0xa00d('0x43')]['includeAll']){_0x21bae8[_0xa00d('0x50')]=[{'model':db['CmContact'],'as':_0xa00d('0x8a'),'required':![]},{'model':db[_0xa00d('0x8b')],'as':_0xa00d('0x8c'),'attributes':[_0xa00d('0x37'),_0xa00d('0x8d'),_0xa00d('0x8e')],'required':![]},{'model':db['Tag'],'as':_0xa00d('0x8f'),'attributes':['id',_0xa00d('0x37'),_0xa00d('0x90')],'where':_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x91')]?{'id':_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x91')]}:undefined,'required':_0x1c99f8['query'][_0xa00d('0x91')]?!![]:![]}];}return db[_0xa00d('0x88')]['findAll'](_0x21bae8);})[_0xa00d('0x31')](function(_0x5e4ba6){_0x296e04['rows']=_0x5e4ba6;return _0x296e04;});}})['then'](respondWithFilteredResult(_0x594a1c,_0x21bae8))[_0xa00d('0x54')](handleError(_0x594a1c,null));};exports[_0xa00d('0x92')]=function addApplications(_0x17d35e,_0x6a00c1){var _0x1a002e=_0x17d35e[_0xa00d('0x56')]['id'];var _0x1e8a11=_0x17d35e[_0xa00d('0x5c')];var _0x291227=0xc8;var _0x229eff=null;return db['sequelize'][_0xa00d('0x93')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x21e983){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x1a002e},'transaction':_0x21e983})['then'](function(_0x8ddb44){if(_0x8ddb44){return db[_0xa00d('0x94')]['destroy']({'where':{'MailAccountId':_0x1a002e},'transaction':_0x21e983})[_0xa00d('0x31')](function(){var _0x443277=_[_0xa00d('0x3d')](_0x1e8a11,function(_0x55348c){_0x55348c[_0xa00d('0x60')]=_0x1a002e;return _0x55348c;});return db[_0xa00d('0x94')][_0xa00d('0x95')](_0x443277,{'transaction':_0x21e983});});}else{_0x291227=0x194;_0x229eff=[];}});})['then'](function(){if(_0x291227!==0x194){return db[_0xa00d('0x94')][_0xa00d('0x96')]({'where':{'MailAccountId':_0x1a002e},'order':_0xa00d('0x97')})['then'](function(_0x3d45b7){_0x229eff=_0x3d45b7;});}})['catch'](function(_0x4afa3a){_0x291227=0x1f4;logger[_0xa00d('0x21')](_0x4afa3a['stack']);if(_0x4afa3a['name']){delete _0x4afa3a[_0xa00d('0x37')];}_0x229eff=_0x4afa3a;})[_0xa00d('0x98')](function(){if(_0x229eff===null){_0x6a00c1['sendStatus'](_0x291227);}else{if(_0x291227===0x1f4){_0x6a00c1[_0xa00d('0x27')](_0x291227)[_0xa00d('0x38')](_0x229eff);}else{_0x6a00c1[_0xa00d('0x27')](_0x291227)[_0xa00d('0x2d')](_0x229eff);}}});};exports[_0xa00d('0x99')]=function(_0x37e544,_0x3bce3f,_0x2302e8){var _0x5c8de3={};var _0x56da2e={};var _0x170645;var _0x1ba9d5;return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x37e544[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x3bce3f,null))[_0xa00d('0x31')](function(_0x3c701b){if(_0x3c701b){_0x170645=_0x3c701b;_0x56da2e[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x94')]['rawAttributes']);_0x56da2e[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x37e544[_0xa00d('0x43')]);_0x56da2e[_0xa00d('0x45')]=_['intersection'](_0x56da2e[_0xa00d('0x42')],_0x56da2e[_0xa00d('0x43')]);_0x5c8de3[_0xa00d('0x47')]=_['intersection'](_0x56da2e[_0xa00d('0x42')],qs['fields'](_0x37e544['query'][_0xa00d('0x48')]));_0x5c8de3['attributes']=_0x5c8de3['attributes'][_0xa00d('0x59')]?_0x5c8de3[_0xa00d('0x47')]:_0x56da2e[_0xa00d('0x42')];_0x5c8de3['order']=qs['sort'](_0x37e544[_0xa00d('0x43')]['sort']);_0x5c8de3[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x37e544['query'],_0x56da2e[_0xa00d('0x45')]));if(_0x37e544[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x5c8de3[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x5c8de3['where'],{'$or':_['map'](_0x5c8de3[_0xa00d('0x47')],function(_0x10eeff){var _0x25fb73={};_0x25fb73[_0x10eeff]={'$like':'%'+_0x37e544[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x25fb73;})});}_0x5c8de3=_['merge']({},_0x5c8de3,_0x37e544[_0xa00d('0x4e')]);return _0x170645[_0xa00d('0x99')](_0x5c8de3);}})[_0xa00d('0x31')](function(_0x468c8c){if(_0x468c8c){_0x1ba9d5=_0x468c8c[_0xa00d('0x59')];if(!_0x37e544[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x5c8de3[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x37e544['query'][_0xa00d('0x2a')]);_0x5c8de3[_0xa00d('0x28')]=qs['offset'](_0x37e544['query'][_0xa00d('0x28')]);}return _0x170645[_0xa00d('0x99')](_0x5c8de3);}})['then'](function(_0xd1f415){if(_0xd1f415){return _0xd1f415?{'count':_0x1ba9d5,'rows':_0xd1f415}:null;}})[_0xa00d('0x31')](respondWithResult(_0x3bce3f,null))[_0xa00d('0x54')](handleError(_0x3bce3f,null));};exports['getMessages']=function(_0x122bbf,_0xacf4f0,_0x297264){var _0x123609={'raw':!![],'where':{}};var _0x4751df={};var _0x2c1050={'count':0x0,'rows':[]};return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x122bbf[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0xacf4f0,null))['then'](function(_0x2fcff5){if(_0x2fcff5){_0x4751df[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x9a')][_0xa00d('0x3e')]);_0x4751df['query']=_['keys'](_0x122bbf['query']);_0x4751df[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x4751df['model'],_0x4751df[_0xa00d('0x43')]);_0x123609['attributes']=_[_0xa00d('0x46')](_0x4751df[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x122bbf[_0xa00d('0x43')][_0xa00d('0x48')]));_0x123609[_0xa00d('0x47')]=_0x123609[_0xa00d('0x47')][_0xa00d('0x59')]?_0x123609['attributes']:_0x4751df[_0xa00d('0x42')];if(!_0x122bbf[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x123609[_0xa00d('0x2a')]=qs['limit'](_0x122bbf['query'][_0xa00d('0x2a')]);_0x123609[_0xa00d('0x28')]=qs['offset'](_0x122bbf['query']['offset']);}_0x123609[_0xa00d('0x64')]=qs[_0xa00d('0x4b')](_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x123609['where']=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x122bbf[_0xa00d('0x43')],_0x4751df[_0xa00d('0x45')]));_0x123609[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x2fcff5['id'];if(_0x122bbf[_0xa00d('0x43')]['filter']){_0x123609[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x123609[_0xa00d('0x4c')],{'$or':_['map'](_0x123609[_0xa00d('0x47')],function(_0x366056){var _0x3dee3c={};_0x3dee3c[_0x366056]={'$like':'%'+_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x3dee3c;})});}if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x9b')]){var _0x4dd608=_0x122bbf[_0xa00d('0x43')]['$gte'][_0xa00d('0x9c')](',');var _0x316c23={};_0x316c23[_0x4dd608[0x0]]={'$gte':moment(_0x4dd608[0x1])[_0xa00d('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x123609[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x123609['where'],_0x316c23);}_0x123609=_['merge']({},_0x123609,_0x122bbf[_0xa00d('0x4e')]);return db['MailMessage'][_0xa00d('0x2b')]({'where':_0x123609['where']})[_0xa00d('0x31')](function(_0x3494ce){_0x2c1050['count']=_0x3494ce;if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x123609[_0xa00d('0x50')]=[{'all':!![]}];}return db[_0xa00d('0x9a')][_0xa00d('0x52')](_0x123609);})[_0xa00d('0x31')](function(_0x998e98){if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x9e')]==='true'){for(var _0x4cebd1=0x0;_0x4cebd1<_0x998e98[_0xa00d('0x59')];_0x4cebd1++){_0x998e98[_0x4cebd1]['body']=juice(_0x998e98[_0x4cebd1][_0xa00d('0x5c')]);}}_0x2c1050[_0xa00d('0x53')]=_0x998e98;return _0x2c1050;});}})[_0xa00d('0x31')](respondWithFilteredResult(_0xacf4f0,_0x123609))['catch'](handleError(_0xacf4f0,null));};exports[_0xa00d('0x38')]=function(_0xcf188,_0x3585d5,_0x4f205d){var _0x5a96d3,_0x3775de={},_0x25a4a5;if(_0xcf188['body']['to']){_0x25a4a5=_0xcf188['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0xa00d('0x5b')]({'where':{'id':_0xcf188[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x9f')],'as':_0xa00d('0xa0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x25a4a5},'limit':0x1,'order':[[_0xa00d('0xa1'),_0xa00d('0xa2')]]}]},{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58'),'raw':!![]}]})[_0xa00d('0x31')](handleEntityNotFound(_0x3585d5,null))['then'](function(_0x5a61a6){if(_0x5a61a6){_0x5a96d3=_0x5a61a6;if(_0x5a61a6[_0xa00d('0x58')]){if(_['isNil'](_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')])){_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')]=util['format']('%s\x20<%s>',_0x5a61a6['name'],_0x5a61a6[_0xa00d('0x6c')]||_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x73')]);}if(_0xcf188['body']['attachments']&&_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0xa00d('0x59')]){for(var _0x37dc3b=0x0;_0x37dc3b<_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0xa00d('0x59')];_0x37dc3b+=0x1){_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0x37dc3b]={'filename':_0xcf188['body'][_0xa00d('0xa4')][_0x37dc3b]['name'],'path':path['join'](config[_0xa00d('0xa5')],_0xa00d('0xa6'),_0xcf188['body']['attachments'][_0x37dc3b][_0xa00d('0xa7')])};}}var _0x330326={'tls':{'rejectUnauthorized':![]}};if(_[_0xa00d('0x6e')](_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x7a')])){if(_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x77')]){_0x330326[_0xa00d('0xa8')]={'user':_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x73')],'pass':_0x5a61a6[_0xa00d('0x58')]['pass']};}_0x330326[_0xa00d('0x78')]=_0x5a61a6['Smtp'][_0xa00d('0x78')];_0x330326['port']=_0x5a61a6[_0xa00d('0x58')]['port'];_0x330326[_0xa00d('0xa9')]=_0x5a61a6[_0xa00d('0x58')][_0xa00d('0xa9')];}else{_0x330326[_0xa00d('0x7a')]=_0x5a61a6['Smtp'][_0xa00d('0x7a')];_0x330326['auth']={'user':_0x5a61a6[_0xa00d('0x58')]['user'],'pass':_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x76')]};}return respondWithRpcPromise(_0xa00d('0xaa'),_0xa00d('0xab'),{'account':_0x330326,'message':_0xcf188[_0xa00d('0x5c')]});}else{throw new Error(_0xa00d('0xac'));}}})[_0xa00d('0x31')](function(_0x50d117){if(_0x50d117){_0x3775de=_0x50d117;if(_0x5a96d3[_0xa00d('0xa0')]){if(_0x5a96d3['List'][_0xa00d('0xad')][_0xa00d('0x59')]){return _0x5a96d3['List'][_0xa00d('0xad')][0x0];}else{return db[_0xa00d('0xae')][_0xa00d('0x62')](_[_0xa00d('0xaf')](_0xcf188[_0xa00d('0x5c')],{'firstName':_0xcf188['body']['to'],'email':_0xcf188['body']['to'],'phone':_0xcf188[_0xa00d('0x5c')]['to'],'ListId':_0x5a96d3[_0xa00d('0x6d')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xa00d('0x31')](function(_0xd0ddff){if(_0xd0ddff){var _0x352b82={'UserId':_0xcf188[_0xa00d('0x73')]['id'],'ContactId':_0xd0ddff['id'],'MailAccountId':_0x5a96d3['id'],'inReplyTo':_0x3775de[_0xa00d('0xb0')],'to':_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')],'cc':_0xcf188['body']['cc'],'subject':_0xcf188['body'][_0xa00d('0xb1')],'attach':_0xcf188[_0xa00d('0x5c')][_0xa00d('0xb2')],'firstMsgDirection':_0xa00d('0xb3'),'lastMsgAt':moment()['format'](_0xa00d('0xb4')),'lastMsgDirection':'out','Messages':[_['merge'](_0xcf188[_0xa00d('0x5c')],{'messageId':_0x3775de[_0xa00d('0xb0')],'sentAt':moment()[_0xa00d('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5a96d3['id'],'UserId':_0xcf188['user']['id'],'ContactId':_0xd0ddff['id']})]};if(_0xcf188['body'][_0xa00d('0xb5')]){_0x352b82=_['merge'](_0x352b82,_0xcf188['body'][_0xa00d('0xb5')]);}return db['MailInteraction'][_0xa00d('0x62')](_0x352b82,{'include':[{'model':db[_0xa00d('0x9a')],'as':_0xa00d('0xb6')}]});}})[_0xa00d('0x31')](respondWithResult(_0x3585d5,null))[_0xa00d('0x54')](handleError(_0x3585d5,null));};exports['verifySmtp']=function(_0x54fd47,_0x4e9438,_0x12f996){return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x54fd47[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58'),'raw':!![]}]})[_0xa00d('0x31')](handleEntityNotFound(_0x4e9438,null))[_0xa00d('0x31')](function(_0x5d96c9){if(_0x5d96c9&&_0x5d96c9[_0xa00d('0x58')]){var _0x27f5cc={'id':_0x5d96c9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d96c9['Smtp']['service']){_0x27f5cc[_0xa00d('0x7a')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x7a')];}else{_0x27f5cc['host']=_0x5d96c9['Smtp'][_0xa00d('0x78')];_0x27f5cc[_0xa00d('0x79')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x79')];_0x27f5cc[_0xa00d('0xa9')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0xa9')];}if(_0x5d96c9[_0xa00d('0x58')]['authentication']){_0x27f5cc['auth']={'user':_0x5d96c9['Smtp'][_0xa00d('0x73')],'pass':_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x76')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x27f5cc});}})[_0xa00d('0x31')](respondWithResult(_0x4e9438,null))['catch'](handleError(_0x4e9438,null));};exports[_0xa00d('0x32')]=function(_0x4e8c47,_0x45c489){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x4e8c47[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x45c489,null))[_0xa00d('0x31')](function(_0x3c5b27){if(_0x3c5b27&&_0x3c5b27['service']){throw new db[(_0xa00d('0xb7'))]['ValidationError'](_0xa00d('0xb8'));}return _0x3c5b27;})['then'](removeEntity(_0x45c489,null))['catch'](handleError(_0x45c489,null));};exports['addAgents']=function(_0x47ebb8,_0xcfe1d8,_0x2a39e5){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x47ebb8['params']['id']}})['then'](handleEntityNotFound(_0xcfe1d8,null))[_0xa00d('0x31')](function(_0x398b3d){if(_0x398b3d){return _0x398b3d[_0xa00d('0xb9')](_0x47ebb8[_0xa00d('0x5c')]['ids'],_['omit'](_0x47ebb8[_0xa00d('0x5c')],['ids','id'])||{})[_0xa00d('0xba')](function(_0x4308cc){for(var _0x1dfa67=0x0;_0x1dfa67<_0x47ebb8[_0xa00d('0x5c')][_0xa00d('0x67')][_0xa00d('0x59')];_0x1dfa67+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x47ebb8[_0xa00d('0x5c')][_0xa00d('0x67')][_0x1dfa67]),'MailAccountId':Number(_0x47ebb8[_0xa00d('0x56')]['id'])});}return _0x4308cc;});}})[_0xa00d('0x31')](respondWithResult(_0xcfe1d8,null))[_0xa00d('0x54')](handleError(_0xcfe1d8,null));};exports[_0xa00d('0xbb')]=function(_0x3e25de,_0x4e4c5e,_0xa94e07){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x3e25de[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e4c5e,null))['then'](function(_0x496bc6){if(_0x496bc6){return _0x496bc6[_0xa00d('0xbb')](_0x3e25de['query'][_0xa00d('0x67')])[_0xa00d('0x31')](function(){if(_['isArray'](_0x3e25de['query'][_0xa00d('0x67')])){for(var _0x76afa7=0x0;_0x76afa7<_0x3e25de[_0xa00d('0x43')]['ids'][_0xa00d('0x59')];_0x76afa7+=0x1){socket[_0xa00d('0xbc')](_0xa00d('0xbd'),{'UserId':Number(_0x3e25de[_0xa00d('0x43')][_0xa00d('0x67')][_0x76afa7]),'MailAccountId':Number(_0x3e25de[_0xa00d('0x56')]['id'])});}}else{socket[_0xa00d('0xbc')](_0xa00d('0xbd'),{'UserId':Number(_0x3e25de['query'][_0xa00d('0x67')]),'MailAccountId':Number(_0x3e25de['params']['id'])});}});}})[_0xa00d('0x31')](respondWithStatusCode(_0x4e4c5e,null))['catch'](handleError(_0x4e4c5e,null));};exports['getAgents']=function(_0x264260,_0x46d732,_0x5201e0){var _0x406237={};var _0x500002={};var _0x115ace;var _0x3810d8;return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x264260['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x46d732,null))['then'](function(_0x33b6e4){if(_0x33b6e4){_0x115ace=_0x33b6e4;_0x500002['model']=_[_0xa00d('0x44')](db[_0xa00d('0x8b')][_0xa00d('0x3e')]);_0x500002[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x264260[_0xa00d('0x43')]);_0x500002['filters']=_[_0xa00d('0x46')](_0x500002[_0xa00d('0x42')],_0x500002[_0xa00d('0x43')]);_0x406237[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x500002[_0xa00d('0x42')],qs['fields'](_0x264260[_0xa00d('0x43')]['fields']));_0x406237[_0xa00d('0x47')]=_0x406237[_0xa00d('0x47')]['length']?_0x406237[_0xa00d('0x47')]:_0x500002[_0xa00d('0x42')];_0x406237['order']=qs[_0xa00d('0x4b')](_0x264260[_0xa00d('0x43')]['sort']);_0x406237[_0xa00d('0x4c')]=qs['filters'](_[_0xa00d('0x65')](_0x264260[_0xa00d('0x43')],_0x500002[_0xa00d('0x45')]));if(_0x264260[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x406237[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x406237[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x406237[_0xa00d('0x47')],function(_0x49df84){var _0x3b43ef={};_0x3b43ef[_0x49df84]={'$like':'%'+_0x264260['query'][_0xa00d('0x4d')]+'%'};return _0x3b43ef;})});}_0x406237=_[_0xa00d('0x5a')]({},_0x406237,_0x264260['options']);return _0x115ace['getAgents'](_0x406237);}})['then'](function(_0x1c091b){if(_0x1c091b){_0x3810d8=_0x1c091b[_0xa00d('0x59')];if(!_0x264260[_0xa00d('0x43')][_0xa00d('0x49')]('nolimit')){_0x406237['limit']=qs[_0xa00d('0x2a')](_0x264260['query'][_0xa00d('0x2a')]);_0x406237[_0xa00d('0x28')]=qs['offset'](_0x264260[_0xa00d('0x43')]['offset']);}return _0x115ace['getAgents'](_0x406237);}})['then'](function(_0x169ee8){if(_0x169ee8){return _0x169ee8?{'count':_0x3810d8,'rows':_0x169ee8}:null;}})[_0xa00d('0x31')](respondWithResult(_0x46d732,null))[_0xa00d('0x54')](handleError(_0x46d732,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 225ab12..a63644f 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 _0x341c=['update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount','save'];(function(_0x5708ad,_0xdfe547){var _0x5ec1f1=function(_0x563ade){while(--_0x563ade){_0x5708ad['push'](_0x5708ad['shift']());}};_0x5ec1f1(++_0xdfe547);}(_0x341c,0xcc));var _0xc341=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x341c[_0x33ebf5];return _0x66957b;};'use strict';var EventEmitter=require(_0xc341('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xc341('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc341('0x2'),'afterUpdate':_0xc341('0x3'),'afterDestroy':_0xc341('0x4')};function emitEvent(_0x40d92f){return function(_0x4c74c5,_0x3e07f8,_0x3ab689){MailAccountEvents[_0xc341('0x5')](_0x40d92f+':'+_0x4c74c5['id'],_0x4c74c5);MailAccountEvents['emit'](_0x40d92f,_0x4c74c5);_0x3ab689(null);};}for(var e in events){if(events[_0xc341('0x6')](e)){var event=events[e];MailAccount[_0xc341('0x7')](e,emitEvent(event));}}module[_0xc341('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xe3b3=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x10caa5,_0x5ade72){var _0x1d939c=function(_0x460f90){while(--_0x460f90){_0x10caa5['push'](_0x10caa5['shift']());}};_0x1d939c(++_0x5ade72);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x19ac10,_0x54ee13){_0x19ac10=_0x19ac10-0x0;var _0xdf3f6d=_0xe3b3[_0x19ac10];return _0xdf3f6d;};'use strict';var EventEmitter=require(_0x3e3b('0x0'));var MailAccount=require(_0x3e3b('0x1'))['db'][_0x3e3b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3e3b('0x3')](0x0);var events={'afterCreate':_0x3e3b('0x4'),'afterUpdate':_0x3e3b('0x5'),'afterDestroy':_0x3e3b('0x6')};function emitEvent(_0x4d1684){return function(_0xcfab31,_0x2011b1,_0x5e3212){MailAccountEvents[_0x3e3b('0x7')](_0x4d1684+':'+_0xcfab31['id'],_0xcfab31);MailAccountEvents[_0x3e3b('0x7')](_0x4d1684,_0xcfab31);_0x5e3212(null);};}for(var e in events){if(events[_0x3e3b('0x8')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3e3b('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 3e29064..4b94c29 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 _0x8d3b=['api','moment','bluebird','path','../../config/environment','exports','MailAccount','mail_accounts','lodash','util'];(function(_0x223106,_0x499e32){var _0x18378c=function(_0x5110c1){while(--_0x5110c1){_0x223106['push'](_0x223106['shift']());}};_0x18378c(++_0x499e32);}(_0x8d3b,0x166));var _0xb8d3=function(_0x37acc7,_0x169745){_0x37acc7=_0x37acc7-0x0;var _0x2b861c=_0x8d3b[_0x37acc7];return _0x2b861c;};'use strict';var _=require(_0xb8d3('0x0'));var util=require(_0xb8d3('0x1'));var logger=require('../../config/logger')(_0xb8d3('0x2'));var moment=require(_0xb8d3('0x3'));var BPromise=require(_0xb8d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d3('0x5'));var rimraf=require('rimraf');var config=require(_0xb8d3('0x6'));var attributes=require('./mailAccount.attributes');module[_0xb8d3('0x7')]=function(_0x6de2de,_0x460924){return _0x6de2de['define'](_0xb8d3('0x8'),attributes,{'tableName':_0xb8d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ddb=['define','MailAccount','lodash','util','api','bluebird','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0x29fc2c,_0x4ff86a){var _0x1adbc8=function(_0x596f87){while(--_0x596f87){_0x29fc2c['push'](_0x29fc2c['shift']());}};_0x1adbc8(++_0x4ff86a);}(_0x1ddb,0xe8));var _0xb1dd=function(_0x31adf9,_0x511868){_0x31adf9=_0x31adf9-0x0;var _0x4412b5=_0x1ddb[_0x31adf9];return _0x4412b5;};'use strict';var _=require(_0xb1dd('0x0'));var util=require(_0xb1dd('0x1'));var logger=require('../../config/logger')(_0xb1dd('0x2'));var moment=require('moment');var BPromise=require(_0xb1dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb1dd('0x4'));var config=require(_0xb1dd('0x5'));var attributes=require(_0xb1dd('0x6'));module[_0xb1dd('0x7')]=function(_0x33d166,_0x2bec7e){return _0x33d166[_0xb1dd('0x8')](_0xb1dd('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 2af1936..4b15cc9 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 _0x618b=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','where','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','CmContact','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','List','applications','orderBy','asc','account','push','length','close','autoclose','*,*,*,*','defaults','create','contact','messageId','generate','subject','attach','format','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','get','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x618b,0x141));var _0xb618=function(_0x1b9fc2,_0x493ba3){_0x1b9fc2=_0x1b9fc2-0x0;var _0x211936=_0x618b[_0x1b9fc2];return _0x211936;};'use strict';var _=require(_0xb618('0x0'));var util=require(_0xb618('0x1'));var moment=require(_0xb618('0x2'));var BPromise=require(_0xb618('0x3'));var rs=require(_0xb618('0x4'));var fs=require('fs');var Redis=require(_0xb618('0x5'));var db=require(_0xb618('0x6'))['db'];var utils=require(_0xb618('0x7'));var logger=require('../../config/logger')(_0xb618('0x8'));var config=require(_0xb618('0x9'));var jayson=require(_0xb618('0xa'));var client=jayson[_0xb618('0xb')][_0xb618('0xc')]({'port':0x232c});config[_0xb618('0xd')]=_['defaults'](config[_0xb618('0xd')],{'host':_0xb618('0xe'),'port':0x18eb});var socket=require(_0xb618('0xf'))(new Redis(config[_0xb618('0xd')]));require(_0xb618('0x10'))[_0xb618('0x11')](socket);function respondWithRpcPromise(_0x20507e,_0x32c0ce,_0x39d378){return new BPromise(function(_0x4d5c3a,_0x2548e3){return client[_0xb618('0x12')](_0x20507e,_0x39d378)[_0xb618('0x13')](function(_0x1eaf7d){logger[_0xb618('0x14')](_0xb618('0x15'),_0x32c0ce,_0xb618('0x16'));logger[_0xb618('0x17')](_0xb618('0x18'),_0x32c0ce,'request\x20sent',JSON['stringify'](_0x1eaf7d));if(_0x1eaf7d[_0xb618('0x19')]){if(_0x1eaf7d['error'][_0xb618('0x1a')]===0x1f4){logger[_0xb618('0x19')](_0xb618('0x15'),_0x32c0ce,_0x1eaf7d[_0xb618('0x19')][_0xb618('0x1b')]);return _0x2548e3(_0x1eaf7d[_0xb618('0x19')][_0xb618('0x1b')]);}logger[_0xb618('0x19')](_0xb618('0x15'),_0x32c0ce,_0x1eaf7d['error'][_0xb618('0x1b')]);return _0x4d5c3a(_0x1eaf7d[_0xb618('0x19')][_0xb618('0x1b')]);}else{logger['info'](_0xb618('0x15'),_0x32c0ce,_0xb618('0x16'));_0x4d5c3a(_0x1eaf7d[_0xb618('0x1c')]['message']);}})[_0xb618('0x1d')](function(_0x1f4556){logger['error'](_0xb618('0x15'),_0x32c0ce,_0x1f4556);_0x2548e3(_0x1f4556);});});}exports[_0xb618('0x1e')]=function(_0x9f7721){var _0x4e7bf7=this;return new Promise(function(_0x34e399,_0x362b3f){return db['MailAccount'][_0xb618('0x1f')]({'raw':_0x9f7721[_0xb618('0x20')]?_0x9f7721['options'][_0xb618('0x21')]===undefined?!![]:![]:!![],'where':_0x9f7721[_0xb618('0x20')]?_0x9f7721[_0xb618('0x20')]['where']||null:null,'attributes':_0x9f7721[_0xb618('0x20')]?_0x9f7721[_0xb618('0x20')][_0xb618('0x22')]||null:null,'limit':_0x9f7721[_0xb618('0x20')]?_0x9f7721[_0xb618('0x20')][_0xb618('0x23')]||null:null,'include':_0x9f7721[_0xb618('0x20')]?_0x9f7721['options'][_0xb618('0x24')]?_[_0xb618('0x25')](_0x9f7721['options'][_0xb618('0x24')],function(_0x14fae4){return{'model':db[_0x14fae4[_0xb618('0x26')]],'as':_0x14fae4['as'],'attributes':_0x14fae4['attributes'],'include':_0x14fae4['include']?_['map'](_0x14fae4[_0xb618('0x24')],function(_0x530d10){return{'model':db[_0x530d10[_0xb618('0x26')]],'as':_0x530d10['as'],'attributes':_0x530d10[_0xb618('0x22')],'include':_0x530d10[_0xb618('0x24')]?_[_0xb618('0x25')](_0x530d10[_0xb618('0x24')],function(_0x1ae343){return{'model':db[_0x1ae343[_0xb618('0x26')]],'as':_0x1ae343['as'],'attributes':_0x1ae343['attributes']};}):[]};}):[]};}):[]:[]})[_0xb618('0x13')](function(_0x3cbb19){logger[_0xb618('0x14')]('GetMailAccount',_0x9f7721);logger['debug'](_0xb618('0x1e'),_0x9f7721,JSON[_0xb618('0x27')](_0x3cbb19));_0x34e399(_0x3cbb19);})['catch'](function(_0x2806a0){logger[_0xb618('0x19')](_0xb618('0x1e'),_0x2806a0[_0xb618('0x1b')],_0x9f7721);_0x362b3f(_0x4e7bf7['error'](0x1f4,_0x2806a0['message']));});});};exports[_0xb618('0x28')]=function(_0x4a50a3){var _0x2838b1=this;return new Promise(function(_0x41e4bd,_0x309cf2){return db[_0xb618('0x29')][_0xb618('0x2a')]({'raw':_0x4a50a3[_0xb618('0x20')]?_0x4a50a3[_0xb618('0x20')][_0xb618('0x21')]===undefined?!![]:![]:!![],'where':_0x4a50a3[_0xb618('0x20')]?_0x4a50a3['options'][_0xb618('0x2b')]||null:null,'attributes':_0x4a50a3[_0xb618('0x20')]?_0x4a50a3[_0xb618('0x20')][_0xb618('0x22')]||null:null,'include':_0x4a50a3[_0xb618('0x20')]?_0x4a50a3[_0xb618('0x20')][_0xb618('0x24')]?_[_0xb618('0x25')](_0x4a50a3[_0xb618('0x20')][_0xb618('0x24')],function(_0x9c3c81){return{'model':db[_0x9c3c81[_0xb618('0x26')]],'as':_0x9c3c81['as'],'attributes':_0x9c3c81['attributes'],'include':_0x9c3c81['include']?_[_0xb618('0x25')](_0x9c3c81['include'],function(_0x2ee17a){return{'model':db[_0x2ee17a[_0xb618('0x26')]],'as':_0x2ee17a['as'],'attributes':_0x2ee17a[_0xb618('0x22')],'include':_0x2ee17a[_0xb618('0x24')]?_[_0xb618('0x25')](_0x2ee17a[_0xb618('0x24')],function(_0x1d2617){return{'model':db[_0x1d2617['model']],'as':_0x1d2617['as'],'attributes':_0x1d2617[_0xb618('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb618('0x13')](function(_0x3a693e){logger['info']('ShowMailAccount',_0x4a50a3);logger[_0xb618('0x17')](_0xb618('0x28'),_0x4a50a3,JSON[_0xb618('0x27')](_0x3a693e));_0x41e4bd(_0x3a693e);})['catch'](function(_0xc8231f){logger['error']('ShowMailAccount',_0xc8231f[_0xb618('0x1b')],_0x4a50a3);_0x309cf2(_0x2838b1['error'](0x1f4,_0xc8231f[_0xb618('0x1b')]));});});};exports[_0xb618('0x2c')]=function(_0x151bef){var _0x3ebe96=this;return new Promise(function(_0x153d7a,_0x4580cc){var _0x3c43c4={'body':_0x151bef[_0xb618('0x2d')],'channel':_0xb618('0x2e')};var _0x33ec4d=_[_0xb618('0x2f')](_[_0xb618('0x30')](db['CmContact'][_0xb618('0x31')]),[_0xb618('0x32'),'updatedAt',_0xb618('0x33'),_0xb618('0x34')]);var _0x4f95a5=![];if(_0x151bef[_0xb618('0x2d')]['id']){delete _0x151bef[_0xb618('0x2d')]['id'];}if(_['isNil'](_0x151bef['body'][_0xb618('0x35')])){return _0x4580cc(_0x3ebe96[_0xb618('0x19')](0x1f4,_0xb618('0x36')));}if(_[_0xb618('0x37')](_0x151bef[_0xb618('0x2d')][_0xb618('0x2d')])||_0x151bef[_0xb618('0x2d')][_0xb618('0x2d')]===''){return _0x4580cc(_0x3ebe96[_0xb618('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xb618('0x37')](_0x151bef['body']['mapKey'])){return _0x4580cc(_0x3ebe96[_0xb618('0x19')](0x1f4,_0xb618('0x38')+_0x33ec4d));}if(!_[_0xb618('0x39')](_0x33ec4d,_0x151bef[_0xb618('0x2d')][_0xb618('0x3a')])){return _0x4580cc(_0x3ebe96[_0xb618('0x19')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x33ec4d));}var _0x5f30e5={};_0x5f30e5[_0x151bef['body'][_0xb618('0x3a')]]=_0x151bef['body']['from'];return db[_0xb618('0x29')][_0xb618('0x2a')]({'where':{'id':_0x151bef['account']['id']},'include':[{'model':db[_0xb618('0x3b')],'as':'List','include':[{'model':db[_0xb618('0x3c')],'as':_0xb618('0x3d'),'where':_0x5f30e5,'limit':0x1,'order':[[_0xb618('0x3e'),_0xb618('0x3f')]]}]},{'model':db['MailApplication'],'as':_0xb618('0x40')},{'model':db[_0xb618('0x41')],'as':_0xb618('0x42')}]})[_0xb618('0x13')](function(_0x33b864){if(_0x33b864&&_0x33b864['List']){var _0x279cd9=_0x33b864['get']({'plain':!![]});_0x3c43c4['account']=_['omit'](_0x279cd9,['Applications',_0xb618('0x43')]);_0x3c43c4[_0xb618('0x44')]=_0x279cd9[_0xb618('0x40')];_0x3c43c4['list']=_0x279cd9['List'];_0x3c43c4[_0xb618('0x44')]=_[_0xb618('0x45')](_0x3c43c4[_0xb618('0x44')],['priority'],[_0xb618('0x46')]);if(_0x3c43c4[_0xb618('0x47')]&&_0x3c43c4['account']['autoclose']){_0x3c43c4[_0xb618('0x44')][_0xb618('0x48')]({'id':0x0,'priority':_0x3c43c4['applications'][_0xb618('0x49')]+0x1,'app':_0xb618('0x4a'),'appdata':_0xb618('0x4b'),'interval':_0xb618('0x4c')});}if(_0x3c43c4['account'][_0xb618('0x40')]){delete _0x3c43c4[_0xb618('0x47')][_0xb618('0x40')];}if(_0x3c43c4[_0xb618('0x47')][_0xb618('0x43')]){delete _0x3c43c4['account'][_0xb618('0x43')];}if(_0x279cd9['List'][_0xb618('0x3d')]['length']){return _0x279cd9[_0xb618('0x43')]['Contacts'][0x0];}var _0x42b8b7=_[_0xb618('0x4d')](_0x151bef['body'],{'firstName':_0x151bef['body'][_0xb618('0x35')],'ListId':_0x279cd9[_0xb618('0x34')]});_0x42b8b7[_0x151bef['body'][_0xb618('0x3a')]]=_0x151bef[_0xb618('0x2d')][_0xb618('0x35')];return db['CmContact'][_0xb618('0x4e')](_0x42b8b7);}else{throw new Error('List\x20not\x20found');}})[_0xb618('0x13')](function(_0x1a1e4c){_0x3c43c4[_0xb618('0x4f')]=_0x1a1e4c;if(_0x1a1e4c){if(!_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x50')]){_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x50')]=rs[_0xb618('0x51')]()+'\x20'+_0x151bef['body']['message']['from'];}var _0x5e10a2={'ContactId':_0x1a1e4c['id'],'MailAccountId':_0x151bef['account']['id'],'inReplyTo':_0x151bef['body'][_0xb618('0x1b')][_0xb618('0x50')],'to':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x35')],'cc':_0x151bef['body'][_0xb618('0x1b')]['cc'],'subject':_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x52')],'attach':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x53')],'lastMsgAt':moment()[_0xb618('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xb618('0x2a')]({'where':{'closed':![],'MailAccountId':_0x151bef['account']['id']},'include':[{'model':db[_0xb618('0x55')],'as':_0xb618('0x56'),'attributes':[_0xb618('0x50')],'where':{'messageId':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x57')]}}]})[_0xb618('0x13')](function(_0x562eee){if(_0x562eee){return[_0x562eee,![]];}return db[_0xb618('0x58')]['create'](_0x5e10a2)['then'](function(_0x199426){return[_0x199426,!![]];});});}else{throw new Error(_0xb618('0x59'));}})[_0xb618('0x5a')](function(_0x519799,_0x2e0253){if(_0x519799){_0x4f95a5=_0x2e0253;if(!_0x2e0253){return _0x519799['update']({'inReplyTo':_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x50')],'to':_0x151bef['body'][_0xb618('0x1b')][_0xb618('0x35')],'cc':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')]['cc'],'subject':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')]['subject'],'attach':_0x519799[_0xb618('0x53')]?_0x519799['attach']:_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x53')],'substatus':null,'substatusAt':moment()[_0xb618('0x54')](_0xb618('0x5b')),'lastMsgAt':moment()[_0xb618('0x54')](_0xb618('0x5b')),'lastMsgDirection':'in'});}else{return _0x519799;}}})[_0xb618('0x13')](function(_0x17f39e){_0x3c43c4[_0xb618('0x5c')]=_0x17f39e[_0xb618('0x5d')]({'plain':!![]});_0x3c43c4['interaction']['created']=_0x4f95a5;return db[_0xb618('0x55')][_0xb618('0x4e')]({'body':_0x151bef['body']['body'],'MailAccountId':_0x151bef[_0xb618('0x47')]['id'],'MailInteractionId':_0x17f39e['id'],'direction':'in','ContactId':_0x3c43c4[_0xb618('0x4f')]['id'],'messageId':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')]['messageId'],'from':_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x35')],'to':_0x151bef['body'][_0xb618('0x1b')]['to'],'cc':_0x151bef[_0xb618('0x2d')]['message']['cc'],'subject':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x52')],'attach':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x53')],'Attachments':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')]['attachments'],'originTo':_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x5e')],'originCc':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x5f')],'bcc':_0x151bef[_0xb618('0x2d')]['message'][_0xb618('0x60')],'ChatWebsiteId':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x61')]||null,'originChannel':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x62')]||_0xb618('0x63'),'ChatOfflineMessageId':_0x151bef[_0xb618('0x2d')][_0xb618('0x1b')][_0xb618('0x64')]||null},{'include':[{'model':db[_0xb618('0x65')],'as':_0xb618('0x66')}]});})[_0xb618('0x13')](function(_0x2b4518){_0x3c43c4['message']=_0x2b4518;if(_0x3c43c4[_0xb618('0x5c')][_0xb618('0x67')]){return db[_0xb618('0x68')][_0xb618('0x2a')]({'attributes':['id',_0xb618('0x69')],'where':{'id':_0x3c43c4[_0xb618('0x5c')][_0xb618('0x67')]}})[_0xb618('0x13')](function(_0x464eee){if(_0x464eee){_0x3c43c4[_0xb618('0x44')][_0xb618('0x6a')]({'id':0x0,'priority':0x0,'app':_0xb618('0x6b'),'appdata':_0x464eee[_0xb618('0x69')]+','+(_0x3c43c4[_0xb618('0x47')][_0xb618('0x6c')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb618('0x6d'),'startRouting',_0x3c43c4);});}return respondWithRpcPromise('Start','startRouting',_0x3c43c4);})[_0xb618('0x13')](function(_0x35560b){_0x153d7a(_0x35560b);})['catch'](function(_0x3f5a18){_0x4580cc(_0x3ebe96[_0xb618('0x19')](0x1f4,_0x3f5a18[_0xb618('0x1b')]));});});}; \ No newline at end of file +var _0xd833=['originChannel','ChatOfflineMessageId','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','include','map','model','ShowMailAccount','MailAccount','find','debug','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','bcc','ChatWebsiteId'];(function(_0x217ea1,_0x18b281){var _0x1c9ea6=function(_0x451b84){while(--_0x451b84){_0x217ea1['push'](_0x217ea1['shift']());}};_0x1c9ea6(++_0x18b281);}(_0xd833,0x138));var _0x3d83=function(_0x1234cd,_0x3a11e3){_0x1234cd=_0x1234cd-0x0;var _0x5e83b2=_0xd833[_0x1234cd];return _0x5e83b2;};'use strict';var _=require('lodash');var util=require(_0x3d83('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3d83('0x1'));var fs=require('fs');var Redis=require(_0x3d83('0x2'));var db=require(_0x3d83('0x3'))['db'];var utils=require(_0x3d83('0x4'));var logger=require(_0x3d83('0x5'))('rpc');var config=require(_0x3d83('0x6'));var jayson=require(_0x3d83('0x7'));var client=jayson[_0x3d83('0x8')][_0x3d83('0x9')]({'port':0x232c});config[_0x3d83('0xa')]=_[_0x3d83('0xb')](config[_0x3d83('0xa')],{'host':_0x3d83('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d83('0xa')]));require(_0x3d83('0xd'))[_0x3d83('0xe')](socket);function respondWithRpcPromise(_0x2dfb9,_0x3da717,_0x24f454){return new BPromise(function(_0x101f3a,_0x406359){return client['request'](_0x2dfb9,_0x24f454)[_0x3d83('0xf')](function(_0x5989f1){logger[_0x3d83('0x10')](_0x3d83('0x11'),_0x3da717,_0x3d83('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x3da717,_0x3d83('0x12'),JSON[_0x3d83('0x13')](_0x5989f1));if(_0x5989f1[_0x3d83('0x14')]){if(_0x5989f1['error'][_0x3d83('0x15')]===0x1f4){logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x5989f1[_0x3d83('0x14')][_0x3d83('0x16')]);return _0x406359(_0x5989f1[_0x3d83('0x14')][_0x3d83('0x16')]);}logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x5989f1[_0x3d83('0x14')]['message']);return _0x101f3a(_0x5989f1['error'][_0x3d83('0x16')]);}else{logger[_0x3d83('0x10')](_0x3d83('0x11'),_0x3da717,_0x3d83('0x12'));_0x101f3a(_0x5989f1['result'][_0x3d83('0x16')]);}})[_0x3d83('0x17')](function(_0x3190b2){logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x3190b2);_0x406359(_0x3190b2);});});}exports[_0x3d83('0x18')]=function(_0x2060d1){var _0x1e1337=this;return new Promise(function(_0x2b2a34,_0x154001){return db['MailAccount'][_0x3d83('0x19')]({'raw':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1['options'][_0x3d83('0x1b')]===undefined?!![]:![]:!![],'where':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')]['where']||null:null,'attributes':_0x2060d1['options']?_0x2060d1['options'][_0x3d83('0x1c')]||null:null,'limit':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')]['limit']||null:null,'include':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')][_0x3d83('0x1d')]?_[_0x3d83('0x1e')](_0x2060d1[_0x3d83('0x1a')][_0x3d83('0x1d')],function(_0x22476d){return{'model':db[_0x22476d['model']],'as':_0x22476d['as'],'attributes':_0x22476d['attributes'],'include':_0x22476d[_0x3d83('0x1d')]?_['map'](_0x22476d['include'],function(_0x584d60){return{'model':db[_0x584d60['model']],'as':_0x584d60['as'],'attributes':_0x584d60[_0x3d83('0x1c')],'include':_0x584d60['include']?_[_0x3d83('0x1e')](_0x584d60[_0x3d83('0x1d')],function(_0x4d0dc1){return{'model':db[_0x4d0dc1[_0x3d83('0x1f')]],'as':_0x4d0dc1['as'],'attributes':_0x4d0dc1[_0x3d83('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28ae14){logger[_0x3d83('0x10')](_0x3d83('0x18'),_0x2060d1);logger['debug'](_0x3d83('0x18'),_0x2060d1,JSON[_0x3d83('0x13')](_0x28ae14));_0x2b2a34(_0x28ae14);})[_0x3d83('0x17')](function(_0x3e623c){logger['error'](_0x3d83('0x18'),_0x3e623c[_0x3d83('0x16')],_0x2060d1);_0x154001(_0x1e1337[_0x3d83('0x14')](0x1f4,_0x3e623c[_0x3d83('0x16')]));});});};exports[_0x3d83('0x20')]=function(_0x5f485f){var _0x37cd94=this;return new Promise(function(_0x1e6e4b,_0x9f5b93){return db[_0x3d83('0x21')][_0x3d83('0x22')]({'raw':_0x5f485f['options']?_0x5f485f[_0x3d83('0x1a')][_0x3d83('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f485f['options']?_0x5f485f['options']['where']||null:null,'attributes':_0x5f485f['options']?_0x5f485f[_0x3d83('0x1a')][_0x3d83('0x1c')]||null:null,'include':_0x5f485f['options']?_0x5f485f['options'][_0x3d83('0x1d')]?_['map'](_0x5f485f[_0x3d83('0x1a')]['include'],function(_0x4f357c){return{'model':db[_0x4f357c['model']],'as':_0x4f357c['as'],'attributes':_0x4f357c[_0x3d83('0x1c')],'include':_0x4f357c[_0x3d83('0x1d')]?_['map'](_0x4f357c[_0x3d83('0x1d')],function(_0x1f3c36){return{'model':db[_0x1f3c36[_0x3d83('0x1f')]],'as':_0x1f3c36['as'],'attributes':_0x1f3c36['attributes'],'include':_0x1f3c36[_0x3d83('0x1d')]?_['map'](_0x1f3c36['include'],function(_0x469d6c){return{'model':db[_0x469d6c[_0x3d83('0x1f')]],'as':_0x469d6c['as'],'attributes':_0x469d6c[_0x3d83('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3d83('0xf')](function(_0x2bf54f){logger[_0x3d83('0x10')]('ShowMailAccount',_0x5f485f);logger[_0x3d83('0x23')](_0x3d83('0x20'),_0x5f485f,JSON[_0x3d83('0x13')](_0x2bf54f));_0x1e6e4b(_0x2bf54f);})[_0x3d83('0x17')](function(_0x3876de){logger['error'](_0x3d83('0x20'),_0x3876de[_0x3d83('0x16')],_0x5f485f);_0x9f5b93(_0x37cd94[_0x3d83('0x14')](0x1f4,_0x3876de[_0x3d83('0x16')]));});});};exports[_0x3d83('0x24')]=function(_0x273deb){var _0x3af764=this;return new Promise(function(_0x23be39,_0x2172a3){var _0xc253ab={'body':_0x273deb[_0x3d83('0x25')],'channel':_0x3d83('0x26')};var _0x5c7522=_[_0x3d83('0x27')](_[_0x3d83('0x28')](db[_0x3d83('0x29')]['rawAttributes']),[_0x3d83('0x2a'),_0x3d83('0x2b'),_0x3d83('0x2c'),'ListId']);var _0x533566=![];if(_0x273deb['body']['id']){delete _0x273deb[_0x3d83('0x25')]['id'];}if(_[_0x3d83('0x2d')](_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')])){return _0x2172a3(_0x3af764['error'](0x1f4,_0x3d83('0x2f')));}if(_[_0x3d83('0x2d')](_0x273deb[_0x3d83('0x25')][_0x3d83('0x25')])||_0x273deb[_0x3d83('0x25')]['body']===''){return _0x2172a3(_0x3af764['error'](0x1f4,_0x3d83('0x30')));}if(_['isNil'](_0x273deb[_0x3d83('0x25')][_0x3d83('0x31')])){return _0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,_0x3d83('0x32')+_0x5c7522));}if(!_[_0x3d83('0x33')](_0x5c7522,_0x273deb[_0x3d83('0x25')]['mapKey'])){return _0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c7522));}var _0x2e8d3d={};_0x2e8d3d[_0x273deb[_0x3d83('0x25')][_0x3d83('0x31')]]=_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')];return db[_0x3d83('0x21')][_0x3d83('0x22')]({'where':{'id':_0x273deb[_0x3d83('0x34')]['id']},'include':[{'model':db[_0x3d83('0x35')],'as':_0x3d83('0x36'),'include':[{'model':db[_0x3d83('0x29')],'as':_0x3d83('0x37'),'where':_0x2e8d3d,'limit':0x1,'order':[[_0x3d83('0x2b'),'DESC']]}]},{'model':db[_0x3d83('0x38')],'as':_0x3d83('0x39')},{'model':db[_0x3d83('0x3a')],'as':_0x3d83('0x3b')}]})[_0x3d83('0xf')](function(_0x1ba538){if(_0x1ba538&&_0x1ba538[_0x3d83('0x36')]){var _0x175c08=_0x1ba538[_0x3d83('0x3c')]({'plain':!![]});_0xc253ab['account']=_['omit'](_0x175c08,[_0x3d83('0x39'),_0x3d83('0x36')]);_0xc253ab[_0x3d83('0x3d')]=_0x175c08[_0x3d83('0x39')];_0xc253ab[_0x3d83('0x3e')]=_0x175c08[_0x3d83('0x36')];_0xc253ab[_0x3d83('0x3d')]=_[_0x3d83('0x3f')](_0xc253ab[_0x3d83('0x3d')],[_0x3d83('0x40')],[_0x3d83('0x41')]);if(_0xc253ab[_0x3d83('0x34')]&&_0xc253ab[_0x3d83('0x34')][_0x3d83('0x42')]){_0xc253ab[_0x3d83('0x3d')][_0x3d83('0x43')]({'id':0x0,'priority':_0xc253ab[_0x3d83('0x3d')][_0x3d83('0x44')]+0x1,'app':_0x3d83('0x45'),'appdata':'autoclose','interval':_0x3d83('0x46')});}if(_0xc253ab['account'][_0x3d83('0x39')]){delete _0xc253ab[_0x3d83('0x34')][_0x3d83('0x39')];}if(_0xc253ab[_0x3d83('0x34')][_0x3d83('0x36')]){delete _0xc253ab['account'][_0x3d83('0x36')];}if(_0x175c08[_0x3d83('0x36')][_0x3d83('0x37')][_0x3d83('0x44')]){return _0x175c08[_0x3d83('0x36')][_0x3d83('0x37')][0x0];}var _0x5828c5=_[_0x3d83('0xb')](_0x273deb[_0x3d83('0x25')],{'firstName':_0x273deb[_0x3d83('0x25')]['from'],'ListId':_0x175c08['ListId']});_0x5828c5[_0x273deb[_0x3d83('0x25')]['mapKey']]=_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')];return db[_0x3d83('0x29')][_0x3d83('0x47')](_0x5828c5);}else{throw new Error(_0x3d83('0x48'));}})[_0x3d83('0xf')](function(_0x1a4fb8){_0xc253ab[_0x3d83('0x49')]=_0x1a4fb8;if(_0x1a4fb8){if(!_0x273deb['body']['message'][_0x3d83('0x4a')]){_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['messageId']=rs[_0x3d83('0x4b')]()+'\x20'+_0x273deb['body'][_0x3d83('0x16')]['from'];}var _0x216f61={'ContactId':_0x1a4fb8['id'],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id'],'inReplyTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'to':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x2e')],'cc':_0x273deb[_0x3d83('0x25')]['message']['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x4d')],'lastMsgAt':moment()[_0x3d83('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x3d83('0x4f')][_0x3d83('0x22')]({'where':{'closed':![],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x3d83('0x50'),'attributes':[_0x3d83('0x4a')],'where':{'messageId':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x51')]}}]})[_0x3d83('0xf')](function(_0x4b238e){if(_0x4b238e){return[_0x4b238e,![]];}return db[_0x3d83('0x4f')][_0x3d83('0x47')](_0x216f61)['then'](function(_0x19e018){return[_0x19e018,!![]];});});}else{throw new Error(_0x3d83('0x52'));}})[_0x3d83('0x53')](function(_0x3c120a,_0x5e36b6){if(_0x3c120a){_0x533566=_0x5e36b6;if(!_0x5e36b6){return _0x3c120a[_0x3d83('0x54')]({'inReplyTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'to':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x2e')],'cc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x3c120a[_0x3d83('0x4d')]?_0x3c120a[_0x3d83('0x4d')]:_0x273deb[_0x3d83('0x25')]['message']['attach'],'substatus':null,'substatusAt':moment()['format'](_0x3d83('0x55')),'lastMsgAt':moment()[_0x3d83('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c120a;}}})[_0x3d83('0xf')](function(_0x1e580f){_0xc253ab['interaction']=_0x1e580f[_0x3d83('0x3c')]({'plain':!![]});_0xc253ab[_0x3d83('0x56')][_0x3d83('0x57')]=_0x533566;return db['MailMessage'][_0x3d83('0x47')]({'body':_0x273deb[_0x3d83('0x25')]['body'],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id'],'MailInteractionId':_0x1e580f['id'],'direction':'in','ContactId':_0xc253ab[_0x3d83('0x49')]['id'],'messageId':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'from':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['from'],'to':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['to'],'cc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x273deb[_0x3d83('0x25')]['message'][_0x3d83('0x4d')],'Attachments':_0x273deb['body'][_0x3d83('0x16')]['attachments'],'originTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x58')],'originCc':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x59')],'bcc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x5a')],'ChatWebsiteId':_0x273deb['body']['message'][_0x3d83('0x5b')]||null,'originChannel':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x5c')]||'Email','ChatOfflineMessageId':_0x273deb[_0x3d83('0x25')]['message'][_0x3d83('0x5d')]||null},{'include':[{'model':db['Attachment'],'as':_0x3d83('0x5e')}]});})[_0x3d83('0xf')](function(_0x2f0290){_0xc253ab['message']=_0x2f0290;if(_0xc253ab[_0x3d83('0x56')][_0x3d83('0x5f')]){return db['User'][_0x3d83('0x22')]({'attributes':['id',_0x3d83('0x60')],'where':{'id':_0xc253ab[_0x3d83('0x56')][_0x3d83('0x5f')]}})[_0x3d83('0xf')](function(_0x33e84f){if(_0x33e84f){_0xc253ab[_0x3d83('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d83('0x61'),'appdata':_0x33e84f[_0x3d83('0x60')]+','+(_0xc253ab['account'][_0x3d83('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d83('0x63'),_0x3d83('0x64'),_0xc253ab);});}return respondWithRpcPromise(_0x3d83('0x63'),_0x3d83('0x64'),_0xc253ab);})[_0x3d83('0xf')](function(_0x3476d5){_0x23be39(_0x3476d5);})[_0x3d83('0x17')](function(_0x5d7e63){_0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,_0x5d7e63[_0x3d83('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f208a43..54c5261 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 _0x3f73=['save','removeListener','mailAccount:','./mailAccount.events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3f73,0xc3));var _0x33f7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3f73[_0x122ef9];return _0x42fba0;};'use strict';var MailAccountEvents=require(_0x33f7('0x0'));var events=[_0x33f7('0x1'),'remove','update'];function createListener(_0x918518,_0x50f2fd){return function(_0x407d71){_0x50f2fd['emit'](_0x918518,_0x407d71);};}function removeListener(_0x182643,_0x257947){return function(){MailAccountEvents[_0x33f7('0x2')](_0x182643,_0x257947);};}exports['register']=function(_0x2c8ea9){for(var _0x227540=0x0,_0x172f3e=events['length'];_0x227540<_0x172f3e;_0x227540++){var _0x9ce9ce=events[_0x227540];var _0x52855b=createListener(_0x33f7('0x3')+_0x9ce9ce,_0x2c8ea9);MailAccountEvents['on'](_0x9ce9ce,_0x52855b);}}; \ No newline at end of file +var _0x95ef=['register','length','mailAccount:','./mailAccount.events','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95ef,0x12a));var _0xf95e=function(_0x49a694,_0x4772be){_0x49a694=_0x49a694-0x0;var _0x528a6f=_0x95ef[_0x49a694];return _0x528a6f;};'use strict';var MailAccountEvents=require(_0xf95e('0x0'));var events=['save','remove','update'];function createListener(_0x56dd04,_0x596a11){return function(_0x239cac){_0x596a11[_0xf95e('0x1')](_0x56dd04,_0x239cac);};}function removeListener(_0x679e2a,_0x57ca06){return function(){MailAccountEvents['removeListener'](_0x679e2a,_0x57ca06);};}exports[_0xf95e('0x2')]=function(_0x3e77b4){for(var _0x39457d=0x0,_0x1e492a=events[_0xf95e('0x3')];_0x39457d<_0x1e492a;_0x39457d++){var _0x5dff1f=events[_0x39457d];var _0x538cd1=createListener(_0xf95e('0x4')+_0x5dff1f,_0x3e77b4);MailAccountEvents['on'](_0x5dff1f,_0x538cd1);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index adb7693..b9d9c93 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 _0x769e=['get','isAuthenticated','put','/:id','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x5f3f14,_0x1d09c6){var _0x3468c6=function(_0x1e6077){while(--_0x1e6077){_0x5f3f14['push'](_0x5f3f14['shift']());}};_0x3468c6(++_0x1d09c6);}(_0x769e,0xc7));var _0xe769=function(_0x38fa4a,_0x28c71d){_0x38fa4a=_0x38fa4a-0x0;var _0x3f2b56=_0x769e[_0x38fa4a];return _0x3f2b56;};'use strict';var multer=require(_0xe769('0x0'));var util=require('util');var path=require(_0xe769('0x1'));var timeout=require('connect-timeout');var express=require(_0xe769('0x2'));var router=express[_0xe769('0x3')]();var fs_extra=require(_0xe769('0x4'));var auth=require(_0xe769('0x5'));var interaction=require(_0xe769('0x6'));var config=require(_0xe769('0x7'));var controller=require(_0xe769('0x8'));router[_0xe769('0x9')]('/:id',auth[_0xe769('0xa')](),controller['show']);router[_0xe769('0xb')](_0xe769('0xc'),auth[_0xe769('0xa')](),controller[_0xe769('0xd')]);router[_0xe769('0xe')](_0xe769('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe769('0xf')]=router; \ No newline at end of file +var _0x4cea=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4cea,0xed));var _0xa4ce=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4cea[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xa4ce('0x0'));var util=require(_0xa4ce('0x1'));var path=require('path');var timeout=require(_0xa4ce('0x2'));var express=require(_0xa4ce('0x3'));var router=express[_0xa4ce('0x4')]();var fs_extra=require(_0xa4ce('0x5'));var auth=require(_0xa4ce('0x6'));var interaction=require(_0xa4ce('0x7'));var config=require('../../config/environment');var controller=require(_0xa4ce('0x8'));router[_0xa4ce('0x9')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0xc')]);router[_0xa4ce('0xd')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0xe')]);router[_0xa4ce('0xf')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0x10')]);module[_0xa4ce('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index b13fae3..01ff01e 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 _0xc30b=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x44e384,_0x3cec7d){var _0x3f26d2=function(_0x4428cf){while(--_0x4428cf){_0x44e384['push'](_0x44e384['shift']());}};_0x3f26d2(++_0x3cec7d);}(_0xc30b,0x138));var _0xbc30=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xc30b[_0x17928f];return _0x500b63;};'use strict';var Sequelize=require(_0xbc30('0x0'));module[_0xbc30('0x1')]={'priority':{'type':Sequelize[_0xbc30('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc30('0x3')},'appdata':{'type':Sequelize[_0xbc30('0x4')]()},'description':{'type':Sequelize[_0xbc30('0x5')]},'interval':{'type':Sequelize[_0xbc30('0x5')],'defaultValue':_0xbc30('0x6')}}; \ No newline at end of file +var _0x9695=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0x9695,0x1b5));var _0x5969=function(_0x2a8b5a,_0x1988d0){_0x2a8b5a=_0x2a8b5a-0x0;var _0x21fa39=_0x9695[_0x2a8b5a];return _0x21fa39;};'use strict';var Sequelize=require(_0x5969('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5969('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5969('0x2')},'appdata':{'type':Sequelize[_0x5969('0x3')]()},'description':{'type':Sequelize[_0x5969('0x4')]},'interval':{'type':Sequelize[_0x5969('0x4')],'defaultValue':_0x5969('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 27fb04c..bca2bff 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0xaa88[_0x4a5f6c];return _0x281ffd;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x58c554,_0x53d40d){var _0x56489f=function(_0x1e5840){while(--_0x1e5840){_0x58c554['push'](_0x58c554['shift']());}};_0x56489f(++_0x53d40d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4496dd1..4b237b4 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 _0x1913=['./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x4c61b7,_0xbb0ff6){var _0x11f934=function(_0x31e59b){while(--_0x31e59b){_0x4c61b7['push'](_0x4c61b7['shift']());}};_0x11f934(++_0xbb0ff6);}(_0x1913,0x1c3));var _0x3191=function(_0x51ecfc,_0x66e31){_0x51ecfc=_0x51ecfc-0x0;var _0x26cd27=_0x1913[_0x51ecfc];return _0x26cd27;};'use strict';var _=require(_0x3191('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3191('0x1'));var BPromise=require(_0x3191('0x2'));var rp=require(_0x3191('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3191('0x4'));var config=require('../../config/environment');var attributes=require(_0x3191('0x5'));module[_0x3191('0x6')]=function(_0xbc662d,_0x3dafbf){return _0xbc662d[_0x3191('0x7')](_0x3191('0x8'),attributes,{'tableName':_0x3191('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3191('0xa'),'collate':_0x3191('0xb')});}; \ No newline at end of file +var _0x539b=['request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x50a634,_0x16fc3b){var _0x30b238=function(_0x2d19c2){while(--_0x2d19c2){_0x50a634['push'](_0x50a634['shift']());}};_0x30b238(++_0x16fc3b);}(_0x539b,0x99));var _0xb539=function(_0x36c189,_0x3822be){_0x36c189=_0x36c189-0x0;var _0x21f4b4=_0x539b[_0x36c189];return _0x21f4b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb539('0x0'));var moment=require(_0xb539('0x1'));var BPromise=require(_0xb539('0x2'));var rp=require(_0xb539('0x3'));var fs=require('fs');var path=require(_0xb539('0x4'));var rimraf=require('rimraf');var config=require(_0xb539('0x5'));var attributes=require(_0xb539('0x6'));module[_0xb539('0x7')]=function(_0x42ca29,_0x6603e3){return _0x42ca29[_0xb539('0x8')](_0xb539('0x9'),attributes,{'tableName':_0xb539('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb539('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1bb87e8..4e3cc61 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 _0x4a93=['where','attributes','limit','then','debug','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','http','request','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailApplication','update','body','raw','options'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0x4a93,0x165));var _0x34a9=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x4a93[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x34a9('0x0'));var util=require(_0x34a9('0x1'));var moment=require(_0x34a9('0x2'));var BPromise=require(_0x34a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x34a9('0x5'))('rpc');var config=require(_0x34a9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x34a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x371d3d,_0x35a887,_0x4c1959){return new BPromise(function(_0x368d22,_0x52c2a3){return client[_0x34a9('0x8')](_0x371d3d,_0x4c1959)['then'](function(_0x56b550){logger[_0x34a9('0x9')](_0x34a9('0xa'),_0x35a887,'request\x20sent');logger['debug'](_0x34a9('0xb'),_0x35a887,'request\x20sent',JSON['stringify'](_0x56b550));if(_0x56b550[_0x34a9('0xc')]){if(_0x56b550[_0x34a9('0xc')][_0x34a9('0xd')]===0x1f4){logger[_0x34a9('0xc')](_0x34a9('0xa'),_0x35a887,_0x56b550['error']['message']);return _0x52c2a3(_0x56b550[_0x34a9('0xc')][_0x34a9('0xe')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x35a887,_0x56b550['error'][_0x34a9('0xe')]);return _0x368d22(_0x56b550['error']['message']);}else{logger[_0x34a9('0x9')](_0x34a9('0xa'),_0x35a887,'request\x20sent');_0x368d22(_0x56b550['result'][_0x34a9('0xe')]);}})[_0x34a9('0xf')](function(_0x34413e){logger[_0x34a9('0xc')]('MailApplication,\x20%s,\x20%s',_0x35a887,_0x34413e);_0x52c2a3(_0x34413e);});});}exports[_0x34a9('0x10')]=function(_0x4452ec){var _0x830f22=this;return new Promise(function(_0x1bd8ed,_0x192153){return db['MailApplication'][_0x34a9('0x11')](_0x4452ec[_0x34a9('0x12')],{'raw':_0x4452ec['options']?_0x4452ec['options'][_0x34a9('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4452ec[_0x34a9('0x14')]?_0x4452ec[_0x34a9('0x14')][_0x34a9('0x15')]||null:null,'attributes':_0x4452ec[_0x34a9('0x14')]?_0x4452ec['options'][_0x34a9('0x16')]||null:null,'limit':_0x4452ec[_0x34a9('0x14')]?_0x4452ec['options'][_0x34a9('0x17')]||null:null})[_0x34a9('0x18')](function(_0x2ab60c){logger['info'](_0x34a9('0x10'),_0x4452ec);logger[_0x34a9('0x19')](_0x34a9('0x10'),_0x4452ec,JSON[_0x34a9('0x1a')](_0x2ab60c));_0x1bd8ed(_0x2ab60c);})[_0x34a9('0xf')](function(_0x154164){logger[_0x34a9('0xc')]('UpdateMailApplication',_0x154164[_0x34a9('0xe')],_0x4452ec);_0x192153(_0x830f22[_0x34a9('0xc')](0x1f4,_0x154164[_0x34a9('0xe')]));});});}; \ No newline at end of file +var _0xe240=['result','catch','UpdateMailApplication','update','options','raw','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x10aa96,_0x45815b){var _0x529cfc=function(_0x657e04){while(--_0x657e04){_0x10aa96['push'](_0x10aa96['shift']());}};_0x529cfc(++_0x45815b);}(_0xe240,0xa3));var _0x0e24=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe240[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0e24('0x0'));var util=require('util');var moment=require(_0x0e24('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e24('0x3'))['db'];var utils=require(_0x0e24('0x4'));var logger=require(_0x0e24('0x5'))(_0x0e24('0x6'));var config=require(_0x0e24('0x7'));var jayson=require(_0x0e24('0x8'));var client=jayson['client'][_0x0e24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbc0df,_0x12eadc,_0x5005b9){return new BPromise(function(_0x11cebb,_0x440fdd){return client['request'](_0xfbc0df,_0x5005b9)[_0x0e24('0xa')](function(_0x1d824f){logger[_0x0e24('0xb')](_0x0e24('0xc'),_0x12eadc,_0x0e24('0xd'));logger[_0x0e24('0xe')](_0x0e24('0xf'),_0x12eadc,_0x0e24('0xd'),JSON[_0x0e24('0x10')](_0x1d824f));if(_0x1d824f['error']){if(_0x1d824f[_0x0e24('0x11')]['code']===0x1f4){logger[_0x0e24('0x11')]('MailApplication,\x20%s,\x20%s',_0x12eadc,_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);return _0x440fdd(_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);}logger[_0x0e24('0x11')](_0x0e24('0xc'),_0x12eadc,_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);return _0x11cebb(_0x1d824f[_0x0e24('0x11')]['message']);}else{logger[_0x0e24('0xb')](_0x0e24('0xc'),_0x12eadc,_0x0e24('0xd'));_0x11cebb(_0x1d824f[_0x0e24('0x13')]['message']);}})[_0x0e24('0x14')](function(_0x3196df){logger['error'](_0x0e24('0xc'),_0x12eadc,_0x3196df);_0x440fdd(_0x3196df);});});}exports[_0x0e24('0x15')]=function(_0x4222fe){var _0x2adb79=this;return new Promise(function(_0x1d99f1,_0x27ed3b){return db['MailApplication'][_0x0e24('0x16')](_0x4222fe['body'],{'raw':_0x4222fe[_0x0e24('0x17')]?_0x4222fe[_0x0e24('0x17')][_0x0e24('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4222fe[_0x0e24('0x17')]?_0x4222fe['options']['where']||null:null,'attributes':_0x4222fe[_0x0e24('0x17')]?_0x4222fe['options'][_0x0e24('0x19')]||null:null,'limit':_0x4222fe['options']?_0x4222fe[_0x0e24('0x17')]['limit']||null:null})[_0x0e24('0xa')](function(_0x36f007){logger['info'](_0x0e24('0x15'),_0x4222fe);logger['debug'](_0x0e24('0x15'),_0x4222fe,JSON[_0x0e24('0x10')](_0x36f007));_0x1d99f1(_0x36f007);})[_0x0e24('0x14')](function(_0x25f9a6){logger[_0x0e24('0x11')](_0x0e24('0x15'),_0x25f9a6[_0x0e24('0x12')],_0x4222fe);_0x27ed3b(_0x2adb79[_0x0e24('0x11')](0x1f4,_0x25f9a6[_0x0e24('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6140378..2dc3dbb 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 _0x42ba=['post','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','/describe','/:id/download','download','create'];(function(_0x543971,_0x221213){var _0x5c4626=function(_0x11ca1b){while(--_0x11ca1b){_0x543971['push'](_0x543971['shift']());}};_0x5c4626(++_0x221213);}(_0x42ba,0x1b8));var _0xa42b=function(_0x178361,_0xb85ae0){_0x178361=_0x178361-0x0;var _0x59b3e1=_0x42ba[_0x178361];return _0x59b3e1;};'use strict';var express=require(_0xa42b('0x0'));var router=express[_0xa42b('0x1')]();var auth=require(_0xa42b('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xa42b('0x3'));router[_0xa42b('0x4')]('/',auth[_0xa42b('0x5')](),controller['index']);router[_0xa42b('0x4')](_0xa42b('0x6'),auth[_0xa42b('0x5')](),controller['describe']);router[_0xa42b('0x4')]('/:id',auth[_0xa42b('0x5')](),controller['show']);router[_0xa42b('0x4')]('/:id/messages',auth[_0xa42b('0x5')](),controller['getMessages']);router[_0xa42b('0x4')](_0xa42b('0x7'),auth['isAuthenticated'](),controller[_0xa42b('0x8')]);router['post']('/',auth[_0xa42b('0x5')](),controller[_0xa42b('0x9')]);router[_0xa42b('0xa')](_0xa42b('0xb'),auth[_0xa42b('0x5')](),controller[_0xa42b('0xc')]);router[_0xa42b('0xa')](_0xa42b('0xd'),auth['isAuthenticated'](),interaction[_0xa42b('0xe')](_0xa42b('0xf'),_0xa42b('0x10')),controller[_0xa42b('0x11')]);router['put'](_0xa42b('0x12'),auth[_0xa42b('0x5')](),interaction[_0xa42b('0xe')](_0xa42b('0xf'),_0xa42b('0x13')),controller[_0xa42b('0x14')]);router[_0xa42b('0x15')]('/:id',auth[_0xa42b('0x5')](),interaction['tracked']('mail','mailinteraction:destroy'),controller[_0xa42b('0x16')]);router[_0xa42b('0x15')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa42b('0x17')]);module[_0xa42b('0x18')]=router; \ No newline at end of file +var _0x6042=['mailinteraction:addtags','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','mail'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6042,0x7d));var _0x2604=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6042[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x2604('0x0'));var router=express[_0x2604('0x1')]();var auth=require(_0x2604('0x2'));var interaction=require(_0x2604('0x3'));var controller=require(_0x2604('0x4'));router['get']('/',auth[_0x2604('0x5')](),controller[_0x2604('0x6')]);router['get'](_0x2604('0x7'),auth[_0x2604('0x5')](),controller[_0x2604('0x8')]);router[_0x2604('0x9')](_0x2604('0xa'),auth[_0x2604('0x5')](),controller[_0x2604('0xb')]);router[_0x2604('0x9')](_0x2604('0xc'),auth[_0x2604('0x5')](),controller[_0x2604('0xd')]);router[_0x2604('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x2604('0xe')]);router[_0x2604('0xf')]('/',auth[_0x2604('0x5')](),controller['create']);router[_0x2604('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2604('0x10')]);router[_0x2604('0xf')](_0x2604('0x11'),auth[_0x2604('0x5')](),interaction[_0x2604('0x12')](_0x2604('0x13'),_0x2604('0x14')),controller[_0x2604('0x15')]);router[_0x2604('0x16')](_0x2604('0xa'),auth[_0x2604('0x5')](),interaction[_0x2604('0x12')](_0x2604('0x13'),_0x2604('0x17')),controller['update']);router[_0x2604('0x18')](_0x2604('0xa'),auth[_0x2604('0x5')](),interaction['tracked'](_0x2604('0x13'),_0x2604('0x19')),controller[_0x2604('0x1a')]);router['delete'](_0x2604('0x11'),auth[_0x2604('0x5')](),controller[_0x2604('0x1b')]);module[_0x2604('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f97bebf..7ab6ef9 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 _0xb3eb=['DATE','out','sequelize','iconv','exports','STRING','TEXT','long','BOOLEAN'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0xb3eb,0x80));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbb3e('0x0'));var iconv=require(_0xbb3e('0x1'));module[_0xbb3e('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbb3e('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbb3e('0x3')]},'note':{'type':Sequelize[_0xbb3e('0x3')]},'inReplyTo':{'type':Sequelize[_0xbb3e('0x3')](0x1fe)},'to':{'type':Sequelize[_0xbb3e('0x3')]},'cc':{'type':Sequelize[_0xbb3e('0x4')](_0xbb3e('0x5'))},'subject':{'type':Sequelize[_0xbb3e('0x4')]()},'attach':{'type':Sequelize[_0xbb3e('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbb3e('0x7')]},'substatus':{'type':Sequelize[_0xbb3e('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xbb3e('0x7')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb3e('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb3e('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbb3e('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xff39=['ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x11b1b3,_0x467ad5){var _0x521a55=function(_0x56d106){while(--_0x56d106){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x521a55(++_0x467ad5);}(_0xff39,0xba));var _0x9ff3=function(_0xe86041,_0x2fbd7b){_0xe86041=_0xe86041-0x0;var _0x1230a9=_0xff39[_0xe86041];return _0x1230a9;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x9ff3('0x0'));module[_0x9ff3('0x1')]={'closed':{'type':Sequelize[_0x9ff3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ff3('0x3')]},'disposition':{'type':Sequelize[_0x9ff3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9ff3('0x4')]},'note':{'type':Sequelize[_0x9ff3('0x4')]},'inReplyTo':{'type':Sequelize[_0x9ff3('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9ff3('0x4')]},'cc':{'type':Sequelize[_0x9ff3('0x5')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x9ff3('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9ff3('0x3')]},'substatus':{'type':Sequelize[_0x9ff3('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ff3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9ff3('0x6')]('in',_0x9ff3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index d0745ec..6d09450 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 _0x8840=['mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','length','conditions','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','rawAttributes','includeAll','options','create','body','find','addMessage','ids','omit','merge','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','spread','removeTags','download','root','server','files','tmp','join','attachments','push','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','decode','headers','basename','existsSync','readFileSync','build','eml-format','rimraf','zip-dir','moment','bluebird','util','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','destroy','name','send','map','Tags','split','forEach','TagIds','MailMessage','findOne','out','-id','then','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','field','color','from','tools_tags','select','u.id','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId'];(function(_0x145e61,_0x2d39ad){var _0x3a10f6=function(_0x3ae3b8){while(--_0x3ae3b8){_0x145e61['push'](_0x145e61['shift']());}};_0x3a10f6(++_0x2d39ad);}(_0x8840,0x16b));var _0x0884=function(_0x4e0560,_0x2841c4){_0x4e0560=_0x4e0560-0x0;var _0x1b34df=_0x8840[_0x4e0560];return _0x1b34df;};'use strict';var emlformat=require(_0x0884('0x0'));var rimraf=require(_0x0884('0x1'));var zipdir=require(_0x0884('0x2'));var moment=require(_0x0884('0x3'));var BPromise=require(_0x0884('0x4'));var util=require(_0x0884('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0884('0x6'));var juice=require('juice');var Redis=require(_0x0884('0x7'));var qs=require(_0x0884('0x8'));var as=require(_0x0884('0x9'));var logger=require('../../config/logger')(_0x0884('0xa'));var config=require('../../config/environment');var db=require(_0x0884('0xb'))['db'];var htmlEntities=require(_0x0884('0xc'));config[_0x0884('0xd')]=_[_0x0884('0xe')](config[_0x0884('0xd')],{'host':_0x0884('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0884('0xd')]));require(_0x0884('0x10'))[_0x0884('0x11')](socket);function respondWithStatusCode(_0x255c57,_0x508c66){_0x508c66=_0x508c66||0xcc;return function(_0x232c48){if(_0x232c48){return _0x255c57[_0x0884('0x12')](_0x508c66);}return _0x255c57['status'](_0x508c66)[_0x0884('0x13')]();};}function respondWithResult(_0x421eb7,_0x293e68){_0x293e68=_0x293e68||0xc8;return function(_0x5ad12b){if(_0x5ad12b){return _0x421eb7[_0x0884('0x14')](_0x293e68)[_0x0884('0x15')](_0x5ad12b);}};}function respondWithFilteredResult(_0x343527,_0x2308db){return function(_0x248ba6){if(_0x248ba6){var _0x502772=typeof _0x2308db['offset']===_0x0884('0x16')&&typeof _0x2308db[_0x0884('0x17')]==='undefined';var _0x1e4556=_0x248ba6[_0x0884('0x18')];var _0x5e7dcb=_0x502772?0x0:_0x2308db['offset'];var _0x36333c=_0x502772?_0x248ba6[_0x0884('0x18')]:_0x2308db[_0x0884('0x19')]+_0x2308db[_0x0884('0x17')];var _0x1a1726;if(_0x36333c>=_0x1e4556){_0x36333c=_0x1e4556;_0x1a1726=0xc8;}else{_0x1a1726=0xce;}_0x343527[_0x0884('0x14')](_0x1a1726);return _0x343527[_0x0884('0x1a')](_0x0884('0x1b'),_0x5e7dcb+'-'+_0x36333c+'/'+_0x1e4556)['json'](_0x248ba6);}return null;};}function saveUpdates(_0x63b790){return function(_0x178678){if(_0x178678){return _0x178678['update'](_0x63b790)['then'](function(_0x223ea6){return _0x223ea6;});}return null;};}function removeEntity(_0x59528f){return function(_0x406f51){if(_0x406f51){return _0x406f51[_0x0884('0x1c')]()['then'](function(){_0x59528f['status'](0xcc)[_0x0884('0x13')]();});}};}function handleEntityNotFound(_0x1a50b4){return function(_0x5bfe10){if(!_0x5bfe10){_0x1a50b4['sendStatus'](0x194);}return _0x5bfe10;};}function handleError(_0x425c02,_0x2984c5){_0x2984c5=_0x2984c5||0x1f4;return function(_0x56cf3b){logger['error'](_0x56cf3b['stack']);if(_0x56cf3b[_0x0884('0x1d')]){delete _0x56cf3b[_0x0884('0x1d')];}_0x425c02[_0x0884('0x14')](_0x2984c5)[_0x0884('0x1e')](_0x56cf3b);};}function getInteractionUsers(_0x50a991,_0x24bdd9){return new BPromise(function(_0x7989fa,_0x4b7975){try{if(_0x24bdd9[_0x50a991['id']]){_0x50a991['Users']=_[_0x0884('0x1f')](_0x24bdd9[_0x50a991['id']],function(_0x465ecb){return{'id':_0x465ecb['id'],'fullname':_0x465ecb['fullname']};});}}catch(_0x3fe688){_0x4b7975(_0x3fe688);}_0x7989fa(_0x50a991);});}function getInteractionTags(_0x319257,_0x13afd5){return new BPromise(function(_0xf9dfe9,_0x4e7535){try{if(_0x319257['TagIds']){_0x319257[_0x0884('0x20')]=[];_0x319257['TagIds'][_0x0884('0x21')](',')[_0x0884('0x22')](function(_0x4abfb8){_0x319257[_0x0884('0x20')]['push'](_0x13afd5[_0x4abfb8]);});}delete _0x319257[_0x0884('0x23')];}catch(_0x20ef61){_0x4e7535(_0x20ef61);}_0xf9dfe9(_0x319257);});}function getLastMessageText(_0x2b9ce1){return new BPromise(function(_0x24e447,_0x3349c5){return db[_0x0884('0x24')][_0x0884('0x25')]({'where':{'$and':[{'MailInteractionId':_0x2b9ce1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0884('0x26')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0884('0x27'),'raw':!![]})[_0x0884('0x28')](function(_0x47bcf1){if(_0x47bcf1&&_0x47bcf1[_0x0884('0x29')]){_0x2b9ce1[_0x0884('0x2a')]=_[_0x0884('0x2b')](_0x47bcf1[_0x0884('0x29')]);}_0x24e447(_0x2b9ce1);})['catch'](function(_0x507259){_0x3349c5(_0x507259);});});}function updateMailInteraction(_0x453774,_0x2f5ad4,_0x34e75f,_0x193b1f){return new BPromise(function(_0x3b977c,_0x362156){return getInteractionUsers(_0x453774,_0x34e75f)[_0x0884('0x28')](function(_0x4566b4){return getInteractionTags(_0x4566b4,_0x2f5ad4);})[_0x0884('0x28')](function(_0x181100){if(_0x193b1f){_0x3b977c(getLastMessageText(_0x181100));}else{_0x3b977c(_0x181100);}})[_0x0884('0x2c')](function(_0x3a5ff9){_0x362156(_0x3a5ff9);});});}exports[_0x0884('0x2d')]=function(_0x4a36d5,_0xd0788){var _0x6d79d7={},_0x491c16={},_0x56afad={'count':0x0,'rows':[]};var _0x3938a4=_[_0x0884('0x1f')](db[_0x0884('0x2e')]['rawAttributes'],function(_0x3c5c62){return{'name':_0x3c5c62['fieldName'],'type':_0x3c5c62[_0x0884('0x2f')][_0x0884('0x30')]};});_0x491c16[_0x0884('0x31')]=_[_0x0884('0x1f')](_0x3938a4,_0x0884('0x1d'));_0x491c16[_0x0884('0x32')]=_[_0x0884('0x33')](_0x4a36d5['query']);_0x491c16[_0x0884('0x34')]=_[_0x0884('0x35')](_0x491c16[_0x0884('0x31')],_0x491c16[_0x0884('0x32')]);_0x6d79d7['attributes']=_[_0x0884('0x35')](_0x491c16[_0x0884('0x31')],qs['fields'](_0x4a36d5[_0x0884('0x32')][_0x0884('0x36')]));_0x6d79d7[_0x0884('0x37')]=_0x6d79d7[_0x0884('0x37')]['length']?_0x6d79d7[_0x0884('0x37')]:_0x491c16[_0x0884('0x31')];if(!_0x4a36d5[_0x0884('0x32')][_0x0884('0x38')]('nolimit')){_0x6d79d7['limit']=qs['limit'](_0x4a36d5[_0x0884('0x32')]['limit']);_0x6d79d7[_0x0884('0x19')]=qs[_0x0884('0x19')](_0x4a36d5[_0x0884('0x32')][_0x0884('0x19')]);}_0x6d79d7['order']=qs[_0x0884('0x39')](_0x4a36d5[_0x0884('0x32')]['sort']);_0x6d79d7[_0x0884('0x3a')]=qs[_0x0884('0x34')](_[_0x0884('0x3b')](_0x4a36d5[_0x0884('0x32')],_0x491c16[_0x0884('0x34')]),_0x3938a4);var _0xa136fb=[];var _0x3815ac=squel['select']()['field']('id')[_0x0884('0x3c')](_0x0884('0x1d'))[_0x0884('0x3c')](_0x0884('0x3d'))[_0x0884('0x3e')](_0x0884('0x3f'));var _0x411a96=squel[_0x0884('0x40')]()[_0x0884('0x3c')](_0x0884('0x41'))[_0x0884('0x3c')]('u.fullname')[_0x0884('0x3c')]('ui.MailInteractionId')[_0x0884('0x3e')](_0x0884('0x42'),'ui')[_0x0884('0x43')](_0x0884('0x44'),'u','u.id\x20=\x20ui.UserId');var _0x40bee4=squel[_0x0884('0x40')]()[_0x0884('0x3e')](_0x0884('0x45'),'i')[_0x0884('0x43')](_0x0884('0x46'),'c',_0x0884('0x47'))[_0x0884('0x43')](_0x0884('0x44'),'o',_0x0884('0x48'))[_0x0884('0x43')](_0x0884('0x49'),'a',_0x0884('0x4a'))[_0x0884('0x43')](_0x0884('0x4b'),'me',_0x0884('0x4c'))[_0x0884('0x43')](_0x0884('0x4d'),'it',_0x0884('0x4e'))[_0x0884('0x43')](_0x0884('0x3f'),'t',_0x0884('0x4f'));var _0x8631a2=squel[_0x0884('0x50')]();var _0x154d0d=[];var _0x27183b=squel[_0x0884('0x50')]();var _0x2b7b98;if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x51')]){_0x2b7b98=as['parseSearch'](_0x4a36d5[_0x0884('0x32')][_0x0884('0x51')]);var _0x5524d6=_0x2b7b98['sqlOperator'];for(var _0x34ba7a=0x0;_0x34ba7a<_0x2b7b98['conditions'][_0x0884('0x52')];_0x34ba7a++){var _0x51e24a=_0x2b7b98[_0x0884('0x53')][_0x34ba7a];var _0x3daf26='i';var _0x44e084=_['find'](_0x3938a4,[_0x0884('0x1d'),_0x51e24a['field']]);if(!_0x44e084){switch(_0x51e24a[_0x0884('0x3c')]){case _0x0884('0x54'):if(_0x51e24a['value']==0x1){_0x40bee4['having']('`'+_0x51e24a[_0x0884('0x3c')]+_0x0884('0x55'));}else{_0x40bee4[_0x0884('0x56')]('`'+_0x51e24a['field']+_0x0884('0x57'));}break;case _0x0884('0x58'):if(_0x51e24a['operator']==='$substring'){if(_0x51e24a[_0x0884('0x59')][_0x0884('0x21')]('\x20')['length']>0x1){_0x8631a2[_0x5524d6](_0x0884('0x5a'),qs['getFullTextValue'](_0x51e24a[_0x0884('0x59')]),null);}else{var _0x2a1396='%'+_0x51e24a[_0x0884('0x59')]+'%';_0x8631a2[_0x5524d6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2a1396,_0x2a1396,_0x2a1396);}}else{_0x44e084=_['find'](_0x3938a4,['name',_0x0884('0x5b')]);_0x51e24a['field']=_0x0884('0x5b');_0xb03043=as[_0x0884('0x5c')](_0x3daf26,_0x44e084[_0x0884('0x2f')],_0x51e24a);_0x8631a2[_0x5524d6](_0xb03043[_0x0884('0x5d')],_0xb03043[_0x0884('0x59')][_0x0884('0x5e')],_0xb03043['value'][_0x0884('0x13')]);}break;case _0x0884('0x5f'):var _0x1b22c0=_0x51e24a[_0x0884('0x59')][_0x0884('0x21')](',')[_0x0884('0x1f')](function(_0x197bcc){return Number(_0x197bcc);});_0x1b22c0[_0x0884('0x22')](function(_0x1d2c65){_0x27183b['or'](_0x0884('0x60'),'%,'+_0x1d2c65+',%');});_0x154d0d=_[_0x0884('0x61')](_0x154d0d,_0x1b22c0);break;case _0x0884('0x62'):if(_0x51e24a[_0x0884('0x63')]===_0x0884('0x64')){_0x8631a2[_0x5524d6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x51e24a[_0x0884('0x59')]+'%',null);}else{_0x44e084=_['find'](_0x3938a4,[_0x0884('0x1d'),_0x0884('0x65')]);_0x51e24a[_0x0884('0x3c')]=_0x0884('0x65');_0xb03043=as[_0x0884('0x5c')](_0x3daf26,_0x44e084[_0x0884('0x2f')],_0x51e24a);_0x8631a2[_0x5524d6](_0xb03043[_0x0884('0x5d')],_0xb03043['value']['start'],_0xb03043[_0x0884('0x59')][_0x0884('0x13')]);}break;case _0x0884('0x29'):_0xb03043=as[_0x0884('0x5c')]('me',null,_0x51e24a);_0x8631a2[_0x5524d6](_0xb03043[_0x0884('0x5d')],_0xb03043['value'][_0x0884('0x5e')],_0xb03043[_0x0884('0x59')]['end']);break;}}else{var _0xb03043=as[_0x0884('0x5c')](_0x3daf26,_0x44e084[_0x0884('0x2f')],_0x51e24a);_0x8631a2[_0x5524d6](_0xb03043[_0x0884('0x5d')],_0xb03043[_0x0884('0x59')][_0x0884('0x5e')],_0xb03043['value'][_0x0884('0x13')]);}}}else{var _0x549582=_(_0x4a36d5['query'])[_0x0884('0x33')]()[_0x0884('0x1f')](function(_0x381629){return _[_0x0884('0x66')](_0x3938a4,[_0x0884('0x1d'),_0x381629])?_0x381629:undefined;})[_0x0884('0x67')]()['value']();if(!_[_0x0884('0x68')](_0x549582)){_0x549582['forEach'](function(_0x355e47){if(_0x355e47===_0x0884('0x69')){_0x40bee4[_0x0884('0x3a')](_0x0884('0x6a'),[][_0x0884('0x6b')](_0x4a36d5[_0x0884('0x32')][_0x355e47]));}else if(_0x355e47===_0x0884('0x6c')){var _0x4356b2=JSON[_0x0884('0x6d')](_0x4a36d5['query'][_0x355e47])['$gte'];var _0x423460=JSON[_0x0884('0x6d')](_0x4a36d5['query'][_0x355e47])[_0x0884('0x6e')];_0x40bee4[_0x0884('0x3a')](_0x0884('0x6f'),_0x4356b2,_0x423460);}else{if(_0x4a36d5[_0x0884('0x32')][_0x355e47]===_0x0884('0x70')){_0x40bee4[_0x0884('0x3a')]('i.'+_0x355e47+_0x0884('0x71'));}else{_0x40bee4[_0x0884('0x3a')]('i.'+_0x355e47+_0x0884('0x72'),_0x4a36d5[_0x0884('0x32')][_0x355e47]);}}});}if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x73')]){if(_0x4a36d5['query']['read']==0x1){_0x40bee4[_0x0884('0x56')](_0x0884('0x74'));}else{_0x40bee4['having']('`unreadMessages`\x20>\x200');}}if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x75')]){_0x154d0d=_['isArray'](_0x4a36d5[_0x0884('0x32')][_0x0884('0x75')])?_0x4a36d5[_0x0884('0x32')]['tag']:new Array(_0x4a36d5[_0x0884('0x32')][_0x0884('0x75')]);_0x154d0d[_0x0884('0x22')](function(_0x3e8b1c){_0x27183b['or'](_0x0884('0x60'),'%,'+_0x3e8b1c+',%');});}if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x76')]){var _0x23744f=_0x4a36d5[_0x0884('0x32')][_0x0884('0x76')][_0x0884('0x77')]('\x5c','\x5c\x5c')[_0x0884('0x77')](/'/g,'\x27\x27');if(qs[_0x0884('0x78')](_0x23744f)){_0x8631a2['or'](_0x0884('0x79'),_0x23744f+'%');}else if(qs[_0x0884('0x7a')](_0x23744f)){_0x8631a2['or'](_0x0884('0x7b'),_0x23744f+'%');}else{_0x8631a2['or'](_0x0884('0x7c'),qs[_0x0884('0x7d')](_0x23744f))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0884('0x7d')](_0x23744f));}}}_0x40bee4['where'](_0x8631a2);_0x40bee4['group']('i.id');var _0x1d8395={'type':db[_0x0884('0x7e')]['QueryTypes'][_0x0884('0x7f')],'raw':!![]};var _0xb01930=_0x40bee4[_0x0884('0x80')]();_0xb01930['field'](_0x0884('0x81'));_0xb01930[_0x0884('0x3c')](_0x0884('0x82'),'unreadMessages');if(_0x6d79d7[_0x0884('0x83')]){_0x6d79d7[_0x0884('0x83')][_0x0884('0x22')](function(_0x18a3b8){var _0x9ea087=_0x18a3b8[0x0]==='contactName'?_0x18a3b8[0x0]:'i.'+_0x18a3b8[0x0];_0x40bee4[_0x0884('0x83')](_0x9ea087,_0x18a3b8[0x1]===_0x0884('0x84')?![]:!![]);});}if(!_['isEmpty'](_0x154d0d)){_0x40bee4[_0x0884('0x56')](_0x27183b);_0xb01930[_0x0884('0x3a')](_0x0884('0x85'),_0x154d0d);}BPromise[_0x0884('0x86')]()['then'](function(){if(!_0x2b7b98){if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x69')])return;_0xb01930[_0x0884('0x3a')](_0x0884('0x87'));_0x40bee4[_0x0884('0x3a')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4a36d5['user']['role']!==_0x0884('0x88'))return;return _0x4a36d5[_0x0884('0x89')][_0x0884('0x8a')]({'attributes':['id'],'raw':!![]})[_0x0884('0x28')](function(_0x5f58b3){if(_[_0x0884('0x68')](_0x5f58b3)){_0xb01930[_0x0884('0x3a')](_0x0884('0x8b'));_0x40bee4[_0x0884('0x3a')](_0x0884('0x8b'));}else{_0xb01930['where'](_0x0884('0x6a'),_[_0x0884('0x1f')](_0x5f58b3,'id'));_0x40bee4[_0x0884('0x3a')](_0x0884('0x6a'),_[_0x0884('0x1f')](_0x5f58b3,'id'));}});})['then'](function(){if(_0x4a36d5[_0x0884('0x89')]['role']===_0x0884('0x88')&&!_0x2b7b98&&!_0x4a36d5[_0x0884('0x32')][_0x0884('0x69')])return[];return db['sequelize'][_0x0884('0x32')](_0xb01930[_0x0884('0x8c')](),_0x1d8395);})[_0x0884('0x28')](function(_0x196e74){_0x56afad[_0x0884('0x18')]=_0x196e74[_0x0884('0x52')];if(_0x56afad[_0x0884('0x18')]===0x0)return[];return db[_0x0884('0x8d')]['query'](_0x3815ac['toString'](),_0x1d8395)[_0x0884('0x28')](function(_0x27c4ef){_0xa136fb=_['keyBy'](_0x27c4ef,'id');_0x1d8395=_['merge'](_0x1d8395,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a36d5[_0x0884('0x32')][_0x0884('0x36')]){_0x6d79d7[_0x0884('0x37')][_0x0884('0x22')](function(_0x58d543){_0x40bee4[_0x0884('0x3c')]('i.'+_0x58d543);});}else{_0x40bee4['field'](_0x0884('0x82'),_0x0884('0x54'));_0x40bee4['field'](_0x0884('0x8e'),_0x0884('0x8f'));_0x40bee4[_0x0884('0x3c')]('a.mandatoryDisposition',_0x0884('0x90'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x91'),_0x0884('0x92'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x81'));_0x40bee4[_0x0884('0x3c')]('i.createdAt');_0x40bee4[_0x0884('0x3c')](_0x0884('0x93'));_0x40bee4['field']('i.closed');_0x40bee4[_0x0884('0x3c')](_0x0884('0x94'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x95'));_0x40bee4[_0x0884('0x3c')]('i.lastMsgAt');_0x40bee4['field'](_0x0884('0x96'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x97'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x98'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x99'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x9a'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x9b'));_0x40bee4[_0x0884('0x3c')]('i.to');_0x40bee4[_0x0884('0x3c')](_0x0884('0x9c'));_0x40bee4[_0x0884('0x3c')](_0x0884('0x9d'));_0x40bee4[_0x0884('0x3c')]('i.UserId');_0x40bee4[_0x0884('0x3c')](_0x0884('0x9e'),_0x0884('0x9f'));_0x40bee4[_0x0884('0x3c')](_0x0884('0xa0'),_0x0884('0xa1'));_0x40bee4[_0x0884('0x3c')](_0x0884('0xa2'),_0x0884('0xa3'));_0x40bee4[_0x0884('0x3c')](_0x0884('0xa4'),_0x0884('0xa5'));_0x40bee4[_0x0884('0x3c')](_0x0884('0xa6'),_0x0884('0xa7'));_0x40bee4['field'](_0x0884('0xa8'),_0x0884('0xa9'));_0x40bee4['field'](_0x0884('0xaa'),'Owner.fullname');_0x40bee4['field']('o.internal',_0x0884('0xab'));_0x40bee4[_0x0884('0x3c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0884('0x23'));}if(_0x6d79d7['limit'])_0x40bee4[_0x0884('0x17')](_0x6d79d7[_0x0884('0x17')]);if(_0x6d79d7['offset'])_0x40bee4[_0x0884('0x19')](_0x6d79d7[_0x0884('0x19')]);return db[_0x0884('0x8d')]['query'](_0x40bee4[_0x0884('0x8c')](),_0x1d8395);})[_0x0884('0x28')](function(_0x4dd433){if(_0x4dd433[_0x0884('0x52')]>0x0)_0x411a96[_0x0884('0x3a')](_0x0884('0xac'),_['map'](_0x4dd433,'id'));return db['sequelize'][_0x0884('0x32')](_0x411a96[_0x0884('0x8c')](),_0x1d8395)[_0x0884('0x28')](function(_0x297ef5){var _0x513db9=_[_0x0884('0xad')](_0x297ef5,_0x0884('0xae'));var _0x504e24=[];return db[_0x0884('0xaf')][_0x0884('0x25')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x0884('0x28')](function(_0xa28d4){var _0x544582=_0xa28d4[_0x0884('0xb0')];_0x4dd433[_0x0884('0x22')](function(_0x335190){_0x504e24['push'](updateMailInteraction(_0x335190,_0xa136fb,_0x513db9,_0x544582));});return BPromise[_0x0884('0xb1')](_0x504e24);});});});})['then'](function(_0xdcf33f){_0x56afad[_0x0884('0xb2')]=_0xdcf33f;return _0x56afad;})['then'](respondWithFilteredResult(_0xd0788,_0x6d79d7))['catch'](handleError(_0xd0788,null));};exports[_0x0884('0xb3')]=function(_0x5d4cb0,_0x35043b){var _0x4959d0={'raw':![],'where':{'id':_0x5d4cb0[_0x0884('0xb4')]['id']}},_0x2ad697={};_0x2ad697[_0x0884('0x31')]=_[_0x0884('0x33')](db[_0x0884('0x2e')][_0x0884('0xb5')]);_0x2ad697[_0x0884('0x32')]=_[_0x0884('0x33')](_0x5d4cb0[_0x0884('0x32')]);_0x2ad697[_0x0884('0x34')]=_[_0x0884('0x35')](_0x2ad697[_0x0884('0x31')],_0x2ad697[_0x0884('0x32')]);_0x4959d0['attributes']=_['intersection'](_0x2ad697[_0x0884('0x31')],qs[_0x0884('0x36')](_0x5d4cb0[_0x0884('0x32')][_0x0884('0x36')]));_0x4959d0[_0x0884('0x37')]=_0x4959d0[_0x0884('0x37')][_0x0884('0x52')]?_0x4959d0[_0x0884('0x37')]:_0x2ad697[_0x0884('0x31')];if(_0x5d4cb0['query'][_0x0884('0xb6')]){_0x4959d0['include']=[{'all':!![]}];}_0x4959d0=_['merge']({},_0x4959d0,_0x5d4cb0[_0x0884('0xb7')]);return db[_0x0884('0x2e')]['find'](_0x4959d0)['then'](handleEntityNotFound(_0x35043b,null))[_0x0884('0x28')](respondWithResult(_0x35043b,null))[_0x0884('0x2c')](handleError(_0x35043b,null));};exports[_0x0884('0xb8')]=function(_0x2fd5cb,_0xe9f22f){return db[_0x0884('0x2e')][_0x0884('0xb8')](_0x2fd5cb[_0x0884('0xb9')],{})[_0x0884('0x28')](respondWithResult(_0xe9f22f,0xc9))[_0x0884('0x2c')](handleError(_0xe9f22f,null));};exports['update']=function(_0x4cd057,_0x2ee32d){if(_0x4cd057['body']['id']){delete _0x4cd057[_0x0884('0xb9')]['id'];}return db[_0x0884('0x2e')][_0x0884('0xba')]({'where':{'id':_0x4cd057[_0x0884('0xb4')]['id']}})[_0x0884('0x28')](handleEntityNotFound(_0x2ee32d,null))[_0x0884('0x28')](saveUpdates(_0x4cd057[_0x0884('0xb9')],null))[_0x0884('0x28')](respondWithResult(_0x2ee32d,null))[_0x0884('0x2c')](handleError(_0x2ee32d,null));};exports[_0x0884('0x1c')]=function(_0xef8233,_0x5ae50a){return db['MailInteraction']['find']({'where':{'id':_0xef8233[_0x0884('0xb4')]['id']}})[_0x0884('0x28')](handleEntityNotFound(_0x5ae50a,null))['then'](removeEntity(_0x5ae50a,null))[_0x0884('0x2c')](handleError(_0x5ae50a,null));};exports['describe']=function(_0xa4379a,_0x1a47ce){return db[_0x0884('0x2e')]['describe']()[_0x0884('0x28')](respondWithResult(_0x1a47ce,null))[_0x0884('0x2c')](handleError(_0x1a47ce,null));};exports[_0x0884('0xbb')]=function(_0x44ce53,_0x117838){return db[_0x0884('0x24')]['find']({'where':{'id':_0x44ce53[_0x0884('0xb4')]['id']}})[_0x0884('0x28')](handleEntityNotFound(_0x117838,null))['then'](function(_0x3d7a63){if(_0x3d7a63){return _0x3d7a63[_0x0884('0xbb')](_0x44ce53[_0x0884('0xb9')][_0x0884('0xbc')],_[_0x0884('0xbd')](_0x44ce53['body'],[_0x0884('0xbc'),'id'])||{});}})[_0x0884('0x28')](respondWithResult(_0x117838,null))[_0x0884('0x2c')](handleError(_0x117838,null));};exports['getMessages']=function(_0x3b6ea7,_0x4b31f6){var _0x23729c={'raw':![],'where':{}};var _0x105d9a={};var _0x40f968={'count':0x0,'rows':[]};return db[_0x0884('0x2e')]['findOne']({'where':{'id':_0x3b6ea7[_0x0884('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4b31f6,null))['then'](function(_0x61f324){if(_0x61f324){_0x105d9a['model']=_[_0x0884('0x33')](db[_0x0884('0x24')]['rawAttributes']);_0x105d9a['query']=_[_0x0884('0x33')](_0x3b6ea7[_0x0884('0x32')]);_0x105d9a[_0x0884('0x34')]=_['intersection'](_0x105d9a[_0x0884('0x31')],_0x105d9a[_0x0884('0x32')]);_0x23729c[_0x0884('0x37')]=_['intersection'](_0x105d9a[_0x0884('0x31')],qs['fields'](_0x3b6ea7[_0x0884('0x32')][_0x0884('0x36')]));_0x23729c[_0x0884('0x37')]=_0x23729c[_0x0884('0x37')][_0x0884('0x52')]?_0x23729c[_0x0884('0x37')]:_0x105d9a[_0x0884('0x31')];if(!_0x3b6ea7[_0x0884('0x32')][_0x0884('0x38')]('nolimit')){_0x23729c[_0x0884('0x17')]=qs[_0x0884('0x17')](_0x3b6ea7[_0x0884('0x32')][_0x0884('0x17')]);_0x23729c[_0x0884('0x19')]=qs['offset'](_0x3b6ea7['query'][_0x0884('0x19')]);}_0x23729c['order']=qs[_0x0884('0x39')](_0x3b6ea7[_0x0884('0x32')][_0x0884('0x39')]);_0x23729c[_0x0884('0x3a')]=qs['filters'](_[_0x0884('0x3b')](_0x3b6ea7[_0x0884('0x32')],_0x105d9a[_0x0884('0x34')]));_0x23729c['where'][_0x0884('0xae')]=_0x61f324['id'];if(_0x3b6ea7[_0x0884('0x32')]['filter']){_0x23729c['where']=_[_0x0884('0xbe')](_0x23729c['where'],{'$or':_[_0x0884('0x1f')](_0x23729c[_0x0884('0x37')],function(_0x51e819){var _0x16d457={};_0x16d457[_0x51e819]={'$like':'%'+_0x3b6ea7[_0x0884('0x32')][_0x0884('0x76')]+'%'};return _0x16d457;})});}if(_0x3b6ea7['query']['$gte']){var _0xd76d96=_0x3b6ea7['query']['$gte'][_0x0884('0x21')](',');var _0x62724={};_0x62724[_0xd76d96[0x0]]={'$gte':moment(_0xd76d96[0x1])[_0x0884('0xbf')](_0x0884('0xc0'))};_0x23729c['where']=_[_0x0884('0xbe')](_0x23729c['where'],_0x62724);}_0x23729c=_[_0x0884('0xbe')]({},_0x23729c,_0x3b6ea7['options']);return db[_0x0884('0x24')][_0x0884('0x18')]({'where':_0x23729c['where']})[_0x0884('0x28')](function(_0x692390){_0x40f968[_0x0884('0x18')]=_0x692390;if(_0x3b6ea7[_0x0884('0x32')]['includeAll']){_0x23729c[_0x0884('0xc1')]=[{'all':!![]}];}return db['MailMessage'][_0x0884('0xc2')](_0x23729c);})[_0x0884('0x28')](function(_0x231826){if(_0x3b6ea7[_0x0884('0x32')]['inlineCss']==='true'){for(var _0x1fda78=0x0;_0x1fda78<_0x231826[_0x0884('0x52')];_0x1fda78++){_0x231826[_0x1fda78][_0x0884('0xb9')]=juice(_0x231826[_0x1fda78][_0x0884('0xb9')]);}}_0x40f968[_0x0884('0xb2')]=_0x231826;return _0x40f968;});}})[_0x0884('0x28')](respondWithFilteredResult(_0x4b31f6,_0x23729c))[_0x0884('0x2c')](handleError(_0x4b31f6,null));};exports['addTags']=function(_0x19cd81,_0x53149f){return db[_0x0884('0x2e')][_0x0884('0xba')]({'where':{'id':_0x19cd81[_0x0884('0xb4')]['id']}})[_0x0884('0x28')](handleEntityNotFound(_0x53149f,null))['then'](function(_0x570be1){if(_0x570be1){return _0x570be1['setTags'](_0x19cd81[_0x0884('0xb9')]['ids'],_[_0x0884('0xbd')](_0x19cd81[_0x0884('0xb9')],[_0x0884('0xbc'),'id'])||{})[_0x0884('0xc3')](function(){return db['Tag'][_0x0884('0xc2')]({'attributes':['id',_0x0884('0x1d'),_0x0884('0x3d')],'where':{'id':_0x19cd81[_0x0884('0xb9')][_0x0884('0xbc')]}});})[_0x0884('0x28')](function(_0x5924c3){socket['emit']('mailInteractionTags:save',{'id':Number(_0x19cd81[_0x0884('0xb4')]['id']),'tags':_0x5924c3||[]});return{'id':Number(_0x19cd81[_0x0884('0xb4')]['id']),'tags':_0x5924c3||[]};});}})[_0x0884('0x28')](respondWithResult(_0x53149f,null))[_0x0884('0x2c')](handleError(_0x53149f,null));};exports[_0x0884('0xc4')]=function(_0x48d22e,_0x5351ce){return db[_0x0884('0x2e')][_0x0884('0xba')]({'where':{'id':_0x48d22e['params']['id']}})['then'](handleEntityNotFound(_0x5351ce,null))[_0x0884('0x28')](function(_0x74ee55){if(_0x74ee55){return _0x74ee55['removeTags'](_0x48d22e['query'][_0x0884('0xbc')]);}})[_0x0884('0x28')](respondWithStatusCode(_0x5351ce,null))[_0x0884('0x2c')](handleError(_0x5351ce,null));};exports[_0x0884('0xc5')]=function(_0x310281,_0x206197){var _0x11a95b=moment()['unix']()[_0x0884('0x8c')]();var _0x5264eb=path['join'](config[_0x0884('0xc6')],_0x0884('0xc7'),_0x0884('0xc8'),_0x0884('0xc9'));var _0x52843b=path[_0x0884('0xca')](config[_0x0884('0xc6')],_0x0884('0xc7'),_0x0884('0xc8'),'attachments');var _0x59c1e6=path['join'](_0x5264eb,_0x11a95b);var _0x663ee8=util[_0x0884('0xbf')]('transcript-%d-%s.zip',_0x310281[_0x0884('0xb4')]['id'],_0x11a95b);var _0x38d116=path['join'](_0x5264eb,_0x663ee8);var _0x2da300=[];if(_0x310281[_0x0884('0x32')][_0x0884('0xcb')]){_0x2da300[_0x0884('0xcc')]({'model':db[_0x0884('0xcd')],'as':_0x0884('0xce'),'raw':!![]});}var _0x127b87=[{'model':db['MailMessage'],'as':_0x0884('0xcf'),'attributes':['id',_0x0884('0xb9'),'from','to','cc',_0x0884('0xd0'),_0x0884('0xd1'),_0x0884('0x6c')],'where':{'secret':![]},'order':qs[_0x0884('0x39')]('id'),'include':_0x2da300}];return db[_0x0884('0x2e')][_0x0884('0xba')]({'where':{'id':_0x310281[_0x0884('0xb4')]['id']},'include':_0x127b87})[_0x0884('0x28')](handleEntityNotFound(_0x206197,null))[_0x0884('0x28')](function(_0x5d75d8){if(_0x5d75d8&&_0x5d75d8[_0x0884('0xcf')]){var _0x442b59=_0x5d75d8[_0x0884('0xd2')]({'plain':!![]});fs[_0x0884('0xd3')](_0x59c1e6);return BPromise['each'](_0x442b59[_0x0884('0xcf')],function(_0x4a9572,_0x3f46fd){var _0x341113={'from':_0x4a9572[_0x0884('0x3e')],'to':_0x4a9572['to'],'subject':_0x4a9572[_0x0884('0xd1')],'html':htmlEntities[_0x0884('0xd4')](_0x4a9572[_0x0884('0xb9')]),'headers':{'Date':moment(_0x4a9572[_0x0884('0x6c')])[_0x0884('0xbf')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4a9572['cc']){_0x341113[_0x0884('0xd5')]['Cc']=_0x4a9572['cc'];}if(_0x4a9572[_0x0884('0xd0')]){_0x341113[_0x0884('0xd5')]['Bcc']=_0x4a9572[_0x0884('0xd0')];}return new BPromise(function(_0x3482a5,_0x20decc){if(_0x4a9572[_0x0884('0xce')]){for(var _0xd21904=0x0;_0xd21904<_0x4a9572[_0x0884('0xce')][_0x0884('0x52')];_0xd21904++){var _0x13ca0f=_0x4a9572[_0x0884('0xce')][_0xd21904];var _0x4f6697=path[_0x0884('0xca')](_0x52843b,_0x13ca0f[_0x0884('0xd6')]);if(fs[_0x0884('0xd7')](_0x4f6697)){_0x341113[_0x0884('0xcb')][_0x0884('0xcc')]({'name':_0x13ca0f[_0x0884('0x1d')],'contentType':_0x13ca0f['type'],'data':fs[_0x0884('0xd8')](_0x4f6697)});}}}emlformat[_0x0884('0xd9')](_0x341113,function(_0x30e289,_0x58de20){if(_0x30e289)return _0x20decc(_0x30e289);fs['writeFileSync'](path[_0x0884('0xca')](_0x59c1e6,util[_0x0884('0xbf')]('message%d.eml',_0x3f46fd)),_0x58de20);return _0x3482a5(_0x58de20);});});})[_0x0884('0x28')](function(){return new BPromise(function(_0x3996c6,_0x11553f){zipdir(_0x59c1e6,{'saveTo':_0x38d116},function(_0x574e51,_0x212beb){if(_0x574e51)return _0x11553f(_0x574e51);return _0x3996c6(_0x212beb);});})['then'](function(){return new BPromise(function(_0x5dd08e,_0x36b1a6){rimraf(_0x59c1e6,function(_0x40534e){if(_0x40534e)_0x36b1a6(_0x40534e);return _0x5dd08e();});});})['then'](function(){return _0x206197[_0x0884('0xc5')](_0x38d116,_0x663ee8,function(_0x29b696){if(!_0x29b696)fs['unlinkSync'](_0x38d116);});});});}else{return _0x206197[_0x0884('0x12')](0xc8);}})['catch'](handleError(_0x206197,null));}; \ No newline at end of file +var _0x13c3=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','end','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.MailAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','create','body','describe','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','setTags','spread','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','get','mkdirSync','headers','Bcc','basename','build','message%d.eml','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','limit','Content-Range','json','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','select','field','color','from','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x13c3,0x164));var _0x313c=function(_0x1986fd,_0x50ecff){_0x1986fd=_0x1986fd-0x0;var _0x2dd9a4=_0x13c3[_0x1986fd];return _0x2dd9a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x313c('0x0'));var moment=require(_0x313c('0x1'));var BPromise=require(_0x313c('0x2'));var util=require(_0x313c('0x3'));var path=require(_0x313c('0x4'));var fs=require('fs');var _=require(_0x313c('0x5'));var squel=require(_0x313c('0x6'));var juice=require(_0x313c('0x7'));var Redis=require('ioredis');var qs=require(_0x313c('0x8'));var as=require(_0x313c('0x9'));var logger=require(_0x313c('0xa'))(_0x313c('0xb'));var config=require('../../config/environment');var db=require(_0x313c('0xc'))['db'];var htmlEntities=require(_0x313c('0xd'));config[_0x313c('0xe')]=_[_0x313c('0xf')](config[_0x313c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x313c('0x10'))(new Redis(config[_0x313c('0xe')]));require(_0x313c('0x11'))[_0x313c('0x12')](socket);function respondWithStatusCode(_0x19b63f,_0x280667){_0x280667=_0x280667||0xcc;return function(_0x547ce4){if(_0x547ce4){return _0x19b63f[_0x313c('0x13')](_0x280667);}return _0x19b63f[_0x313c('0x14')](_0x280667)['end']();};}function respondWithResult(_0x5da43e,_0x6778c1){_0x6778c1=_0x6778c1||0xc8;return function(_0x44c7e8){if(_0x44c7e8){return _0x5da43e[_0x313c('0x14')](_0x6778c1)['json'](_0x44c7e8);}};}function respondWithFilteredResult(_0x313330,_0x3675af){return function(_0x2ce04f){if(_0x2ce04f){var _0x145de1=typeof _0x3675af[_0x313c('0x15')]==='undefined'&&typeof _0x3675af[_0x313c('0x16')]==='undefined';var _0x5e34d9=_0x2ce04f['count'];var _0x55aeb1=_0x145de1?0x0:_0x3675af['offset'];var _0x39ceef=_0x145de1?_0x2ce04f['count']:_0x3675af[_0x313c('0x15')]+_0x3675af[_0x313c('0x16')];var _0x2dc539;if(_0x39ceef>=_0x5e34d9){_0x39ceef=_0x5e34d9;_0x2dc539=0xc8;}else{_0x2dc539=0xce;}_0x313330[_0x313c('0x14')](_0x2dc539);return _0x313330['set'](_0x313c('0x17'),_0x55aeb1+'-'+_0x39ceef+'/'+_0x5e34d9)[_0x313c('0x18')](_0x2ce04f);}return null;};}function saveUpdates(_0x4c7d04){return function(_0x2b171b){if(_0x2b171b){return _0x2b171b[_0x313c('0x19')](_0x4c7d04)[_0x313c('0x1a')](function(_0x8ffc6a){return _0x8ffc6a;});}return null;};}function removeEntity(_0x1c9238){return function(_0x114f6a){if(_0x114f6a){return _0x114f6a[_0x313c('0x1b')]()['then'](function(){_0x1c9238[_0x313c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x758699){return function(_0x500845){if(!_0x500845){_0x758699['sendStatus'](0x194);}return _0x500845;};}function handleError(_0x553f7f,_0x128572){_0x128572=_0x128572||0x1f4;return function(_0x18a6cb){logger[_0x313c('0x1c')](_0x18a6cb[_0x313c('0x1d')]);if(_0x18a6cb[_0x313c('0x1e')]){delete _0x18a6cb[_0x313c('0x1e')];}_0x553f7f[_0x313c('0x14')](_0x128572)[_0x313c('0x1f')](_0x18a6cb);};}function getInteractionUsers(_0x2db025,_0x45f162){return new BPromise(function(_0x327a2f,_0x1fd8c5){try{if(_0x45f162[_0x2db025['id']]){_0x2db025[_0x313c('0x20')]=_[_0x313c('0x21')](_0x45f162[_0x2db025['id']],function(_0x3d84b6){return{'id':_0x3d84b6['id'],'fullname':_0x3d84b6[_0x313c('0x22')]};});}}catch(_0x30a33c){_0x1fd8c5(_0x30a33c);}_0x327a2f(_0x2db025);});}function getInteractionTags(_0x32243f,_0x536c06){return new BPromise(function(_0x533087,_0x272880){try{if(_0x32243f[_0x313c('0x23')]){_0x32243f[_0x313c('0x24')]=[];_0x32243f[_0x313c('0x23')][_0x313c('0x25')](',')[_0x313c('0x26')](function(_0x1e9fc7){_0x32243f[_0x313c('0x24')][_0x313c('0x27')](_0x536c06[_0x1e9fc7]);});}delete _0x32243f[_0x313c('0x23')];}catch(_0x2c6372){_0x272880(_0x2c6372);}_0x533087(_0x32243f);});}function getLastMessageText(_0x313441){return new BPromise(function(_0x298500,_0x12b425){return db[_0x313c('0x28')][_0x313c('0x29')]({'where':{'$and':[{'MailInteractionId':_0x313441['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x313c('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x313c('0x2b')],'order':_0x313c('0x2c'),'raw':!![]})[_0x313c('0x1a')](function(_0x4e8c2f){if(_0x4e8c2f&&_0x4e8c2f[_0x313c('0x2b')]){_0x313441[_0x313c('0x2d')]=_[_0x313c('0x2e')](_0x4e8c2f['plainBody']);}_0x298500(_0x313441);})['catch'](function(_0x59ede7){_0x12b425(_0x59ede7);});});}function updateMailInteraction(_0x299448,_0x408693,_0x3c68fc,_0x529662){return new BPromise(function(_0x513cd7,_0x1c5862){return getInteractionUsers(_0x299448,_0x3c68fc)[_0x313c('0x1a')](function(_0x24270b){return getInteractionTags(_0x24270b,_0x408693);})[_0x313c('0x1a')](function(_0x3d41ed){if(_0x529662){_0x513cd7(getLastMessageText(_0x3d41ed));}else{_0x513cd7(_0x3d41ed);}})[_0x313c('0x2f')](function(_0x585683){_0x1c5862(_0x585683);});});}exports[_0x313c('0x30')]=function(_0xfa6c22,_0x4553ec){var _0xea8c02={},_0x5beb34={},_0x500aef={'count':0x0,'rows':[]};var _0x9f7e4=_[_0x313c('0x21')](db[_0x313c('0x31')][_0x313c('0x32')],function(_0x1fad27){return{'name':_0x1fad27[_0x313c('0x33')],'type':_0x1fad27[_0x313c('0x34')]['key']};});_0x5beb34[_0x313c('0x35')]=_[_0x313c('0x21')](_0x9f7e4,_0x313c('0x1e'));_0x5beb34[_0x313c('0x36')]=_[_0x313c('0x37')](_0xfa6c22[_0x313c('0x36')]);_0x5beb34[_0x313c('0x38')]=_[_0x313c('0x39')](_0x5beb34[_0x313c('0x35')],_0x5beb34[_0x313c('0x36')]);_0xea8c02['attributes']=_[_0x313c('0x39')](_0x5beb34['model'],qs[_0x313c('0x3a')](_0xfa6c22['query'][_0x313c('0x3a')]));_0xea8c02[_0x313c('0x3b')]=_0xea8c02[_0x313c('0x3b')][_0x313c('0x3c')]?_0xea8c02[_0x313c('0x3b')]:_0x5beb34[_0x313c('0x35')];if(!_0xfa6c22[_0x313c('0x36')][_0x313c('0x3d')]('nolimit')){_0xea8c02[_0x313c('0x16')]=qs[_0x313c('0x16')](_0xfa6c22[_0x313c('0x36')][_0x313c('0x16')]);_0xea8c02[_0x313c('0x15')]=qs['offset'](_0xfa6c22['query'][_0x313c('0x15')]);}_0xea8c02['order']=qs[_0x313c('0x3e')](_0xfa6c22[_0x313c('0x36')][_0x313c('0x3e')]);_0xea8c02['where']=qs[_0x313c('0x38')](_[_0x313c('0x3f')](_0xfa6c22[_0x313c('0x36')],_0x5beb34['filters']),_0x9f7e4);var _0x8082dd=[];var _0x3832d9=squel[_0x313c('0x40')]()[_0x313c('0x41')]('id')[_0x313c('0x41')](_0x313c('0x1e'))[_0x313c('0x41')](_0x313c('0x42'))[_0x313c('0x43')]('tools_tags');var _0x15a83c=squel['select']()[_0x313c('0x41')](_0x313c('0x44'))[_0x313c('0x41')]('u.fullname')[_0x313c('0x41')](_0x313c('0x45'))['from'](_0x313c('0x46'),'ui')[_0x313c('0x47')](_0x313c('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x54f289=squel[_0x313c('0x40')]()[_0x313c('0x43')](_0x313c('0x49'),'i')[_0x313c('0x47')](_0x313c('0x4a'),'c',_0x313c('0x4b'))['left_join'](_0x313c('0x48'),'o',_0x313c('0x4c'))['left_join'](_0x313c('0x4d'),'a',_0x313c('0x4e'))['left_join'](_0x313c('0x4f'),'me','me.MailInteractionId\x20=\x20i.id')[_0x313c('0x47')](_0x313c('0x50'),'it',_0x313c('0x51'))[_0x313c('0x47')]('tools_tags','t',_0x313c('0x52'));var _0x104160=squel['expr']();var _0x330962=[];var _0x48079c=squel[_0x313c('0x53')]();var _0x3646ac;if(_0xfa6c22['query'][_0x313c('0x54')]){_0x3646ac=as['parseSearch'](_0xfa6c22[_0x313c('0x36')][_0x313c('0x54')]);var _0xa9621c=_0x3646ac[_0x313c('0x55')];for(var _0x32e265=0x0;_0x32e265<_0x3646ac[_0x313c('0x56')][_0x313c('0x3c')];_0x32e265++){var _0x230a35=_0x3646ac[_0x313c('0x56')][_0x32e265];var _0x792460='i';var _0xd0d23e=_['find'](_0x9f7e4,['name',_0x230a35['field']]);if(!_0xd0d23e){switch(_0x230a35[_0x313c('0x41')]){case _0x313c('0x57'):if(_0x230a35[_0x313c('0x58')]==0x1){_0x54f289['having']('`'+_0x230a35[_0x313c('0x41')]+_0x313c('0x59'));}else{_0x54f289['having']('`'+_0x230a35[_0x313c('0x41')]+_0x313c('0x5a'));}break;case _0x313c('0x5b'):if(_0x230a35[_0x313c('0x5c')]===_0x313c('0x5d')){if(_0x230a35[_0x313c('0x58')][_0x313c('0x25')]('\x20')[_0x313c('0x3c')]>0x1){_0x104160[_0xa9621c](_0x313c('0x5e'),qs['getFullTextValue'](_0x230a35['value']),null);}else{var _0x1514cf='%'+_0x230a35[_0x313c('0x58')]+'%';_0x104160[_0xa9621c](_0x313c('0x5f'),_0x1514cf,_0x1514cf,_0x1514cf);}}else{_0xd0d23e=_[_0x313c('0x60')](_0x9f7e4,[_0x313c('0x1e'),_0x313c('0x61')]);_0x230a35[_0x313c('0x41')]=_0x313c('0x61');_0x1294cf=as['buildExpression'](_0x792460,_0xd0d23e['type'],_0x230a35);_0x104160[_0xa9621c](_0x1294cf[_0x313c('0x62')],_0x1294cf['value']['start'],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);}break;case _0x313c('0x64'):var _0x3cba31=_0x230a35[_0x313c('0x58')][_0x313c('0x25')](',')[_0x313c('0x21')](function(_0x25572d){return Number(_0x25572d);});_0x3cba31['forEach'](function(_0xbdc215){_0x48079c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbdc215+',%');});_0x330962=_[_0x313c('0x65')](_0x330962,_0x3cba31);break;case'User':if(_0x230a35[_0x313c('0x5c')]==='$substring'){_0x104160[_0xa9621c](_0x313c('0x66'),'%'+_0x230a35[_0x313c('0x58')]+'%',null);}else{_0xd0d23e=_[_0x313c('0x60')](_0x9f7e4,[_0x313c('0x1e'),_0x313c('0x67')]);_0x230a35[_0x313c('0x41')]=_0x313c('0x67');_0x1294cf=as[_0x313c('0x68')](_0x792460,_0xd0d23e[_0x313c('0x34')],_0x230a35);_0x104160[_0xa9621c](_0x1294cf['text'],_0x1294cf['value'][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')]['end']);}break;case _0x313c('0x2b'):_0x1294cf=as[_0x313c('0x68')]('me',null,_0x230a35);_0x104160[_0xa9621c](_0x1294cf['text'],_0x1294cf[_0x313c('0x58')][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);break;}}else{var _0x1294cf=as[_0x313c('0x68')](_0x792460,_0xd0d23e['type'],_0x230a35);_0x104160[_0xa9621c](_0x1294cf[_0x313c('0x62')],_0x1294cf['value'][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);}}}else{var _0x2c47d2=_(_0xfa6c22['query'])['keys']()[_0x313c('0x21')](function(_0xe02a7){return _[_0x313c('0x6a')](_0x9f7e4,[_0x313c('0x1e'),_0xe02a7])?_0xe02a7:undefined;})[_0x313c('0x6b')]()[_0x313c('0x58')]();if(!_[_0x313c('0x6c')](_0x2c47d2)){_0x2c47d2[_0x313c('0x26')](function(_0x88afcb){if(_0x88afcb===_0x313c('0x6d')){_0x54f289[_0x313c('0x6e')](_0x313c('0x6f'),[][_0x313c('0x70')](_0xfa6c22[_0x313c('0x36')][_0x88afcb]));}else if(_0x88afcb===_0x313c('0x71')){var _0x4e82eb=JSON[_0x313c('0x72')](_0xfa6c22['query'][_0x88afcb])[_0x313c('0x73')];var _0x2989a3=JSON[_0x313c('0x72')](_0xfa6c22[_0x313c('0x36')][_0x88afcb])['$lte'];_0x54f289[_0x313c('0x6e')](_0x313c('0x74'),_0x4e82eb,_0x2989a3);}else{if(_0xfa6c22[_0x313c('0x36')][_0x88afcb]===_0x313c('0x75')){_0x54f289[_0x313c('0x6e')]('i.'+_0x88afcb+_0x313c('0x76'));}else{_0x54f289[_0x313c('0x6e')]('i.'+_0x88afcb+_0x313c('0x77'),_0xfa6c22['query'][_0x88afcb]);}}});}if(_0xfa6c22[_0x313c('0x36')][_0x313c('0x78')]){if(_0xfa6c22['query'][_0x313c('0x78')]==0x1){_0x54f289[_0x313c('0x79')](_0x313c('0x7a'));}else{_0x54f289[_0x313c('0x79')](_0x313c('0x7b'));}}if(_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]){_0x330962=_[_0x313c('0x7d')](_0xfa6c22['query'][_0x313c('0x7c')])?_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]:new Array(_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]);_0x330962[_0x313c('0x26')](function(_0x1540c3){_0x48079c['or'](_0x313c('0x7e'),'%,'+_0x1540c3+',%');});}if(_0xfa6c22['query'][_0x313c('0x7f')]){var _0x9e9289=_0xfa6c22[_0x313c('0x36')][_0x313c('0x7f')][_0x313c('0x80')]('\x5c','\x5c\x5c')[_0x313c('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x9e9289)){_0x104160['or'](_0x313c('0x81'),_0x9e9289+'%');}else if(qs[_0x313c('0x82')](_0x9e9289)){_0x104160['or'](_0x313c('0x83'),_0x9e9289+'%');}else{_0x104160['or'](_0x313c('0x84'),qs[_0x313c('0x85')](_0x9e9289))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x313c('0x85')](_0x9e9289));}}}_0x54f289[_0x313c('0x6e')](_0x104160);_0x54f289['group'](_0x313c('0x86'));var _0x47c071={'type':db[_0x313c('0x87')]['QueryTypes'][_0x313c('0x88')],'raw':!![]};var _0x210334=_0x54f289[_0x313c('0x89')]();_0x210334[_0x313c('0x41')](_0x313c('0x86'));_0x210334[_0x313c('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x313c('0x57'));if(_0xea8c02[_0x313c('0x8a')]){_0xea8c02['order'][_0x313c('0x26')](function(_0x1a0f6d){var _0x2b363a=_0x1a0f6d[0x0]===_0x313c('0x8b')?_0x1a0f6d[0x0]:'i.'+_0x1a0f6d[0x0];_0x54f289[_0x313c('0x8a')](_0x2b363a,_0x1a0f6d[0x1]===_0x313c('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x330962)){_0x54f289['having'](_0x48079c);_0x210334['where'](_0x313c('0x8d'),_0x330962);}BPromise['resolve']()['then'](function(){if(!_0x3646ac){if(_0xfa6c22['query']['MailAccountId'])return;_0x210334['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x54f289['where'](_0x313c('0x8e'));return;}if(_0xfa6c22['user'][_0x313c('0x8f')]!==_0x313c('0x90'))return;return _0xfa6c22[_0x313c('0x91')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x313c('0x1a')](function(_0x3d17c6){if(_[_0x313c('0x6c')](_0x3d17c6)){_0x210334[_0x313c('0x6e')]('i.MailAccountId\x20IS\x20NULL');_0x54f289[_0x313c('0x6e')](_0x313c('0x92'));}else{_0x210334[_0x313c('0x6e')](_0x313c('0x6f'),_[_0x313c('0x21')](_0x3d17c6,'id'));_0x54f289[_0x313c('0x6e')](_0x313c('0x6f'),_[_0x313c('0x21')](_0x3d17c6,'id'));}});})[_0x313c('0x1a')](function(){if(_0xfa6c22['user'][_0x313c('0x8f')]==='agent'&&!_0x3646ac&&!_0xfa6c22['query']['MailAccountId'])return[];return db[_0x313c('0x93')][_0x313c('0x36')](_0x210334[_0x313c('0x94')](),_0x47c071);})[_0x313c('0x1a')](function(_0x1d906d){_0x500aef[_0x313c('0x95')]=_0x1d906d[_0x313c('0x3c')];if(_0x500aef[_0x313c('0x95')]===0x0)return[];return db[_0x313c('0x93')]['query'](_0x3832d9[_0x313c('0x94')](),_0x47c071)[_0x313c('0x1a')](function(_0x25cc06){_0x8082dd=_[_0x313c('0x96')](_0x25cc06,'id');_0x47c071=_[_0x313c('0x97')](_0x47c071,{'model':db[_0x313c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfa6c22['query'][_0x313c('0x3a')]){_0xea8c02['attributes'][_0x313c('0x26')](function(_0x1b5b65){_0x54f289['field']('i.'+_0x1b5b65);});}else{_0x54f289[_0x313c('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x313c('0x57'));_0x54f289[_0x313c('0x41')](_0x313c('0x98'),_0x313c('0x99'));_0x54f289['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x54f289[_0x313c('0x41')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x313c('0x8b'));_0x54f289[_0x313c('0x41')](_0x313c('0x86'));_0x54f289[_0x313c('0x41')](_0x313c('0x9a'));_0x54f289[_0x313c('0x41')](_0x313c('0x9b'));_0x54f289['field'](_0x313c('0x9c'));_0x54f289[_0x313c('0x41')](_0x313c('0x9d'));_0x54f289[_0x313c('0x41')](_0x313c('0x9e'));_0x54f289[_0x313c('0x41')](_0x313c('0x9f'));_0x54f289['field'](_0x313c('0xa0'));_0x54f289[_0x313c('0x41')](_0x313c('0xa1'));_0x54f289[_0x313c('0x41')](_0x313c('0xa2'));_0x54f289[_0x313c('0x41')](_0x313c('0xa3'));_0x54f289['field']('i.thirdDisposition');_0x54f289[_0x313c('0x41')]('i.substatus');_0x54f289['field'](_0x313c('0xa4'));_0x54f289[_0x313c('0x41')](_0x313c('0xa5'));_0x54f289[_0x313c('0x41')](_0x313c('0xa6'));_0x54f289[_0x313c('0x41')](_0x313c('0xa7'));_0x54f289[_0x313c('0x41')]('c.firstName',_0x313c('0xa8'));_0x54f289[_0x313c('0x41')](_0x313c('0xa9'),_0x313c('0xaa'));_0x54f289[_0x313c('0x41')](_0x313c('0xab'),'Contact.email');_0x54f289[_0x313c('0x41')]('c.phone','Contact.phone');_0x54f289[_0x313c('0x41')](_0x313c('0xac'),_0x313c('0xad'));_0x54f289[_0x313c('0x41')](_0x313c('0xae'),_0x313c('0xaf'));_0x54f289[_0x313c('0x41')](_0x313c('0xb0'),_0x313c('0xb1'));_0x54f289[_0x313c('0x41')]('o.internal',_0x313c('0xb2'));_0x54f289[_0x313c('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x313c('0x23'));}if(_0xea8c02[_0x313c('0x16')])_0x54f289['limit'](_0xea8c02[_0x313c('0x16')]);if(_0xea8c02['offset'])_0x54f289[_0x313c('0x15')](_0xea8c02[_0x313c('0x15')]);return db[_0x313c('0x93')]['query'](_0x54f289['toString'](),_0x47c071);})[_0x313c('0x1a')](function(_0x3a0aa6){if(_0x3a0aa6[_0x313c('0x3c')]>0x0)_0x15a83c[_0x313c('0x6e')](_0x313c('0xb3'),_['map'](_0x3a0aa6,'id'));return db[_0x313c('0x93')][_0x313c('0x36')](_0x15a83c['toString'](),_0x47c071)['then'](function(_0xe94981){var _0x1fe429=_[_0x313c('0xb4')](_0xe94981,_0x313c('0xb5'));var _0x123d97=[];return db[_0x313c('0xb6')][_0x313c('0x29')]({'attributes':[_0x313c('0xb7')],'raw':!![]})[_0x313c('0x1a')](function(_0x7692c7){var _0x353762=_0x7692c7[_0x313c('0xb7')];_0x3a0aa6[_0x313c('0x26')](function(_0x4545a3){_0x123d97[_0x313c('0x27')](updateMailInteraction(_0x4545a3,_0x8082dd,_0x1fe429,_0x353762));});return BPromise[_0x313c('0xb8')](_0x123d97);});});});})['then'](function(_0x3e4bcf){_0x500aef[_0x313c('0xb9')]=_0x3e4bcf;return _0x500aef;})[_0x313c('0x1a')](respondWithFilteredResult(_0x4553ec,_0xea8c02))[_0x313c('0x2f')](handleError(_0x4553ec,null));};exports[_0x313c('0xba')]=function(_0x256685,_0xb9961){var _0x172f18={'raw':![],'where':{'id':_0x256685[_0x313c('0xbb')]['id']}},_0x5872f7={};_0x5872f7['model']=_['keys'](db[_0x313c('0x31')][_0x313c('0x32')]);_0x5872f7[_0x313c('0x36')]=_[_0x313c('0x37')](_0x256685[_0x313c('0x36')]);_0x5872f7[_0x313c('0x38')]=_['intersection'](_0x5872f7[_0x313c('0x35')],_0x5872f7[_0x313c('0x36')]);_0x172f18[_0x313c('0x3b')]=_[_0x313c('0x39')](_0x5872f7[_0x313c('0x35')],qs[_0x313c('0x3a')](_0x256685[_0x313c('0x36')][_0x313c('0x3a')]));_0x172f18[_0x313c('0x3b')]=_0x172f18[_0x313c('0x3b')][_0x313c('0x3c')]?_0x172f18[_0x313c('0x3b')]:_0x5872f7['model'];if(_0x256685[_0x313c('0x36')][_0x313c('0xbc')]){_0x172f18[_0x313c('0xbd')]=[{'all':!![]}];}_0x172f18=_[_0x313c('0x97')]({},_0x172f18,_0x256685['options']);return db['MailInteraction']['find'](_0x172f18)[_0x313c('0x1a')](handleEntityNotFound(_0xb9961,null))[_0x313c('0x1a')](respondWithResult(_0xb9961,null))[_0x313c('0x2f')](handleError(_0xb9961,null));};exports[_0x313c('0xbe')]=function(_0x2115a5,_0x541436){return db[_0x313c('0x31')][_0x313c('0xbe')](_0x2115a5[_0x313c('0xbf')],{})[_0x313c('0x1a')](respondWithResult(_0x541436,0xc9))[_0x313c('0x2f')](handleError(_0x541436,null));};exports[_0x313c('0x19')]=function(_0x404ae1,_0x2655a9){if(_0x404ae1[_0x313c('0xbf')]['id']){delete _0x404ae1['body']['id'];}return db['MailInteraction']['find']({'where':{'id':_0x404ae1['params']['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0x2655a9,null))[_0x313c('0x1a')](saveUpdates(_0x404ae1[_0x313c('0xbf')],null))['then'](respondWithResult(_0x2655a9,null))[_0x313c('0x2f')](handleError(_0x2655a9,null));};exports['destroy']=function(_0x34c8f9,_0xfdc034){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x34c8f9[_0x313c('0xbb')]['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0xfdc034,null))[_0x313c('0x1a')](removeEntity(_0xfdc034,null))['catch'](handleError(_0xfdc034,null));};exports[_0x313c('0xc0')]=function(_0x113ba9,_0xf6e037){return db[_0x313c('0x31')][_0x313c('0xc0')]()['then'](respondWithResult(_0xf6e037,null))['catch'](handleError(_0xf6e037,null));};exports['addMessage']=function(_0x11ce0d,_0x42fd6a){return db[_0x313c('0x28')][_0x313c('0x60')]({'where':{'id':_0x11ce0d[_0x313c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x42fd6a,null))[_0x313c('0x1a')](function(_0x1df743){if(_0x1df743){return _0x1df743['addMessage'](_0x11ce0d[_0x313c('0xbf')][_0x313c('0xc1')],_[_0x313c('0xc2')](_0x11ce0d[_0x313c('0xbf')],[_0x313c('0xc1'),'id'])||{});}})[_0x313c('0x1a')](respondWithResult(_0x42fd6a,null))[_0x313c('0x2f')](handleError(_0x42fd6a,null));};exports[_0x313c('0xc3')]=function(_0x2ef0a5,_0x2e4985){var _0xa82270={'raw':![],'where':{}};var _0x4a009a={};var _0x1f1c76={'count':0x0,'rows':[]};return db[_0x313c('0x31')]['findOne']({'where':{'id':_0x2ef0a5['params']['id']}})['then'](handleEntityNotFound(_0x2e4985,null))['then'](function(_0x321386){if(_0x321386){_0x4a009a[_0x313c('0x35')]=_[_0x313c('0x37')](db[_0x313c('0x28')][_0x313c('0x32')]);_0x4a009a[_0x313c('0x36')]=_['keys'](_0x2ef0a5[_0x313c('0x36')]);_0x4a009a['filters']=_['intersection'](_0x4a009a[_0x313c('0x35')],_0x4a009a['query']);_0xa82270[_0x313c('0x3b')]=_[_0x313c('0x39')](_0x4a009a[_0x313c('0x35')],qs['fields'](_0x2ef0a5[_0x313c('0x36')][_0x313c('0x3a')]));_0xa82270[_0x313c('0x3b')]=_0xa82270['attributes'][_0x313c('0x3c')]?_0xa82270[_0x313c('0x3b')]:_0x4a009a[_0x313c('0x35')];if(!_0x2ef0a5[_0x313c('0x36')][_0x313c('0x3d')](_0x313c('0xc4'))){_0xa82270[_0x313c('0x16')]=qs[_0x313c('0x16')](_0x2ef0a5[_0x313c('0x36')]['limit']);_0xa82270['offset']=qs[_0x313c('0x15')](_0x2ef0a5['query'][_0x313c('0x15')]);}_0xa82270[_0x313c('0x8a')]=qs[_0x313c('0x3e')](_0x2ef0a5['query'][_0x313c('0x3e')]);_0xa82270[_0x313c('0x6e')]=qs[_0x313c('0x38')](_[_0x313c('0x3f')](_0x2ef0a5[_0x313c('0x36')],_0x4a009a[_0x313c('0x38')]));_0xa82270[_0x313c('0x6e')][_0x313c('0xb5')]=_0x321386['id'];if(_0x2ef0a5['query']['filter']){_0xa82270[_0x313c('0x6e')]=_['merge'](_0xa82270['where'],{'$or':_[_0x313c('0x21')](_0xa82270['attributes'],function(_0xbeab8d){var _0x5ccf0f={};_0x5ccf0f[_0xbeab8d]={'$like':'%'+_0x2ef0a5[_0x313c('0x36')][_0x313c('0x7f')]+'%'};return _0x5ccf0f;})});}if(_0x2ef0a5['query'][_0x313c('0x73')]){var _0x22027f=_0x2ef0a5['query']['$gte']['split'](',');var _0x3eb176={};_0x3eb176[_0x22027f[0x0]]={'$gte':moment(_0x22027f[0x1])['format'](_0x313c('0xc5'))};_0xa82270[_0x313c('0x6e')]=_[_0x313c('0x97')](_0xa82270[_0x313c('0x6e')],_0x3eb176);}_0xa82270=_['merge']({},_0xa82270,_0x2ef0a5[_0x313c('0xc6')]);return db[_0x313c('0x28')][_0x313c('0x95')]({'where':_0xa82270[_0x313c('0x6e')]})[_0x313c('0x1a')](function(_0x668211){_0x1f1c76['count']=_0x668211;if(_0x2ef0a5['query']['includeAll']){_0xa82270[_0x313c('0xbd')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xa82270);})[_0x313c('0x1a')](function(_0x12dd35){if(_0x2ef0a5['query'][_0x313c('0xc7')]==='true'){for(var _0x5a06b2=0x0;_0x5a06b2<_0x12dd35['length'];_0x5a06b2++){_0x12dd35[_0x5a06b2][_0x313c('0xbf')]=juice(_0x12dd35[_0x5a06b2][_0x313c('0xbf')]);}}_0x1f1c76['rows']=_0x12dd35;return _0x1f1c76;});}})[_0x313c('0x1a')](respondWithFilteredResult(_0x2e4985,_0xa82270))['catch'](handleError(_0x2e4985,null));};exports['addTags']=function(_0x4a046d,_0x527b13){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x4a046d[_0x313c('0xbb')]['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0x527b13,null))['then'](function(_0xa23f22){if(_0xa23f22){return _0xa23f22[_0x313c('0xc8')](_0x4a046d['body'][_0x313c('0xc1')],_['omit'](_0x4a046d[_0x313c('0xbf')],['ids','id'])||{})[_0x313c('0xc9')](function(){return db[_0x313c('0x64')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x4a046d['body'][_0x313c('0xc1')]}});})['then'](function(_0x195c44){socket[_0x313c('0xca')]('mailInteractionTags:save',{'id':Number(_0x4a046d[_0x313c('0xbb')]['id']),'tags':_0x195c44||[]});return{'id':Number(_0x4a046d[_0x313c('0xbb')]['id']),'tags':_0x195c44||[]};});}})[_0x313c('0x1a')](respondWithResult(_0x527b13,null))[_0x313c('0x2f')](handleError(_0x527b13,null));};exports[_0x313c('0xcb')]=function(_0x332bb1,_0x1a163d){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x332bb1[_0x313c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x1a163d,null))[_0x313c('0x1a')](function(_0x5183c0){if(_0x5183c0){return _0x5183c0[_0x313c('0xcb')](_0x332bb1[_0x313c('0x36')][_0x313c('0xc1')]);}})[_0x313c('0x1a')](respondWithStatusCode(_0x1a163d,null))[_0x313c('0x2f')](handleError(_0x1a163d,null));};exports[_0x313c('0xcc')]=function(_0x38f76f,_0x466188){var _0x57f5f9=moment()[_0x313c('0xcd')]()['toString']();var _0x5a9e46=path['join'](config[_0x313c('0xce')],_0x313c('0xcf'),_0x313c('0xd0'),_0x313c('0xd1'));var _0x3a79ec=path[_0x313c('0xd2')](config[_0x313c('0xce')],'server',_0x313c('0xd0'),_0x313c('0xd3'));var _0x493f40=path[_0x313c('0xd2')](_0x5a9e46,_0x57f5f9);var _0x2b76b=util[_0x313c('0xd4')](_0x313c('0xd5'),_0x38f76f['params']['id'],_0x57f5f9);var _0x52440d=path[_0x313c('0xd2')](_0x5a9e46,_0x2b76b);var _0x42996d=[];if(_0x38f76f[_0x313c('0x36')][_0x313c('0xd3')]){_0x42996d['push']({'model':db['Attachment'],'as':_0x313c('0xd6'),'raw':!![]});}var _0x492eec=[{'model':db[_0x313c('0x28')],'as':_0x313c('0xd7'),'attributes':['id',_0x313c('0xbf'),_0x313c('0x43'),'to','cc',_0x313c('0xd8'),_0x313c('0xd9'),_0x313c('0x71')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x42996d}];return db[_0x313c('0x31')]['find']({'where':{'id':_0x38f76f[_0x313c('0xbb')]['id']},'include':_0x492eec})['then'](handleEntityNotFound(_0x466188,null))['then'](function(_0x261d51){if(_0x261d51&&_0x261d51[_0x313c('0xd7')]){var _0x10658f=_0x261d51[_0x313c('0xda')]({'plain':!![]});fs[_0x313c('0xdb')](_0x493f40);return BPromise['each'](_0x10658f[_0x313c('0xd7')],function(_0x1948af,_0x126642){var _0x2665cc={'from':_0x1948af[_0x313c('0x43')],'to':_0x1948af['to'],'subject':_0x1948af[_0x313c('0xd9')],'html':htmlEntities['decode'](_0x1948af['body']),'headers':{'Date':moment(_0x1948af[_0x313c('0x71')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1948af['cc']){_0x2665cc[_0x313c('0xdc')]['Cc']=_0x1948af['cc'];}if(_0x1948af['bcc']){_0x2665cc['headers'][_0x313c('0xdd')]=_0x1948af[_0x313c('0xd8')];}return new BPromise(function(_0x47ff99,_0x3ee22e){if(_0x1948af[_0x313c('0xd6')]){for(var _0x1a6361=0x0;_0x1a6361<_0x1948af['Attachments'][_0x313c('0x3c')];_0x1a6361++){var _0x27daf3=_0x1948af[_0x313c('0xd6')][_0x1a6361];var _0x33b05e=path['join'](_0x3a79ec,_0x27daf3[_0x313c('0xde')]);if(fs['existsSync'](_0x33b05e)){_0x2665cc[_0x313c('0xd3')][_0x313c('0x27')]({'name':_0x27daf3[_0x313c('0x1e')],'contentType':_0x27daf3[_0x313c('0x34')],'data':fs['readFileSync'](_0x33b05e)});}}}emlformat[_0x313c('0xdf')](_0x2665cc,function(_0x1105cc,_0x3824c9){if(_0x1105cc)return _0x3ee22e(_0x1105cc);fs['writeFileSync'](path[_0x313c('0xd2')](_0x493f40,util['format'](_0x313c('0xe0'),_0x126642)),_0x3824c9);return _0x47ff99(_0x3824c9);});});})['then'](function(){return new BPromise(function(_0x1ac681,_0x22a271){zipdir(_0x493f40,{'saveTo':_0x52440d},function(_0x457aef,_0x4e8236){if(_0x457aef)return _0x22a271(_0x457aef);return _0x1ac681(_0x4e8236);});})['then'](function(){return new BPromise(function(_0x3fe9ff,_0x3b29d0){rimraf(_0x493f40,function(_0x537c1c){if(_0x537c1c)_0x3b29d0(_0x537c1c);return _0x3fe9ff();});});})[_0x313c('0x1a')](function(){return _0x466188['download'](_0x52440d,_0x2b76b,function(_0x35a1c6){if(!_0x35a1c6)fs['unlinkSync'](_0x52440d);});});});}else{return _0x466188['sendStatus'](0xc8);}})[_0x313c('0x2f')](handleError(_0x466188,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 661797b..3cc53e9 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 _0x58d3=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','findAll'];(function(_0xaaefcc,_0x232326){var _0x514607=function(_0x4795cd){while(--_0x4795cd){_0xaaefcc['push'](_0xaaefcc['shift']());}};_0x514607(++_0x232326);}(_0x58d3,0x1e3));var _0x358d=function(_0x21ad08,_0x382ffd){_0x21ad08=_0x21ad08-0x0;var _0xa1e557=_0x58d3[_0x21ad08];return _0xa1e557;};'use strict';var EventEmitter=require(_0x358d('0x0'));var MailInteraction=require(_0x358d('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x358d('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x358d('0x3')](0x0);var events={'afterCreate':_0x358d('0x4'),'afterUpdate':_0x358d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3b6a53){return function(_0x4093df,_0x20d70d,_0x272d43){_0x4093df[_0x358d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28067d){_0x4093df[_0x358d('0x7')](_0x358d('0x8'),_0x28067d['map'](function(_0x16817c){return{'id':_0x16817c['id']};}));return MailMessage[_0x358d('0x9')]({'where':{'MailInteractionId':_0x4093df['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43764b){_0x4093df[_0x358d('0x7')](_0x358d('0xa'),_0x43764b[_0x358d('0xb')]);MailInteractionEvents[_0x358d('0xc')](_0x3b6a53+':'+_0x4093df['id'],_0x4093df);MailInteractionEvents[_0x358d('0xc')](_0x3b6a53,_0x4093df);_0x272d43(null);})[_0x358d('0xd')](_0x272d43(null));};}for(var e in events){if(events[_0x358d('0xe')](e)){var event=events[e];MailInteraction[_0x358d('0xf')](e,emitEvent(event));}}module[_0x358d('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x28db=['length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','setDataValue','unreadMessages'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x28db,0xd7));var _0xb28d=function(_0x4ae745,_0x5a2e11){_0x4ae745=_0x4ae745-0x0;var _0x15a0bb=_0x28db[_0x4ae745];return _0x15a0bb;};'use strict';var EventEmitter=require(_0xb28d('0x0'));var MailInteraction=require(_0xb28d('0x1'))['db'][_0xb28d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xb28d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb28d('0x4')](0x0);var events={'afterCreate':_0xb28d('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5225dd){return function(_0x30a6a9,_0x44f222,_0x500282){_0x30a6a9[_0xb28d('0x6')]({'attributes':['id'],'raw':!![]})[_0xb28d('0x7')](function(_0x71bb13){_0x30a6a9[_0xb28d('0x8')]('Users',_0x71bb13['map'](function(_0x3a7d85){return{'id':_0x3a7d85['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x30a6a9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb28d('0x7')](function(_0x1cafad){_0x30a6a9[_0xb28d('0x8')](_0xb28d('0x9'),_0x1cafad[_0xb28d('0xa')]);MailInteractionEvents[_0xb28d('0xb')](_0x5225dd+':'+_0x30a6a9['id'],_0x30a6a9);MailInteractionEvents[_0xb28d('0xb')](_0x5225dd,_0x30a6a9);_0x500282(null);})[_0xb28d('0xc')](_0x500282(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb28d('0xd')](e,emitEvent(event));}}module[_0xb28d('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e72cf5c..6ba227a 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 _0xc1ed=['substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','MailMessage','then','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','subject','FULLTEXT','substatus'];(function(_0x398087,_0x5174ec){var _0x2eef9e=function(_0x33cc5c){while(--_0x33cc5c){_0x398087['push'](_0x398087['shift']());}};_0x2eef9e(++_0x5174ec);}(_0xc1ed,0x12a));var _0xdc1e=function(_0x17e1f7,_0x2894ad){_0x17e1f7=_0x17e1f7-0x0;var _0x1ac7ea=_0xc1ed[_0x17e1f7];return _0x1ac7ea;};'use strict';var _=require(_0xdc1e('0x0'));var util=require(_0xdc1e('0x1'));var logger=require(_0xdc1e('0x2'))(_0xdc1e('0x3'));var moment=require(_0xdc1e('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc1e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1e('0x6'));var config=require(_0xdc1e('0x7'));var attributes=require(_0xdc1e('0x8'));module[_0xdc1e('0x9')]=function(_0x101e07,_0x2ff1bb){return _0x101e07[_0xdc1e('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xdc1e('0xb'),'to'],'type':_0xdc1e('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5015ef,_0x26f883,_0x3f3f0a){if(_0x5015ef[_0xdc1e('0xd')]){_0x5015ef[_0xdc1e('0xe')]=moment()['format'](_0xdc1e('0xf'));}if(_0x5015ef[_0xdc1e('0x10')]){_0x5015ef[_0xdc1e('0x11')]=moment()[_0xdc1e('0x12')](_0xdc1e('0xf'));}_0x3f3f0a(null,_0x26f883);},'beforeUpdate':function(_0x5b5a2d,_0x224d04,_0x9b5651){if(_0x5b5a2d[_0xdc1e('0x13')](_0xdc1e('0xd'))){_0x5b5a2d['substatusAt']=_0x5b5a2d[_0xdc1e('0xd')]?moment()['format'](_0xdc1e('0xf')):null;}if(_0x5b5a2d['changed']('closed')){_0x5b5a2d[_0xdc1e('0x11')]=moment()['format'](_0xdc1e('0xf'));_0x5b5a2d['substatus']=null;_0x5b5a2d[_0xdc1e('0xe')]=null;}_0x9b5651(null,_0x5b5a2d);},'afterUpdate':function(_0x5b698b,_0x55c142,_0x3f026a){var _0x2862cd=_0x101e07[_0xdc1e('0x14')];var _0xd8f826=_0x5b698b[_0xdc1e('0x15')]({'plain':!![]});if(_0xd8f826['closed']){return _0x2862cd[_0xdc1e('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0xd8f826['id']}})[_0xdc1e('0x17')](function(){_0x3f026a();})['catch'](function(_0x11eec3){_0x3f026a(_0x11eec3);});}else{_0x3f026a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4c43=['get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','util','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4c43,0xd6));var _0x34c4=function(_0x9d3ac3,_0x23f2e0){_0x9d3ac3=_0x9d3ac3-0x0;var _0x30e910=_0x4c43[_0x9d3ac3];return _0x30e910;};'use strict';var _=require('lodash');var util=require(_0x34c4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x34c4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34c4('0x2'));var rimraf=require(_0x34c4('0x3'));var config=require(_0x34c4('0x4'));var attributes=require(_0x34c4('0x5'));module[_0x34c4('0x6')]=function(_0x1e98c2,_0x554fed){return _0x1e98c2[_0x34c4('0x7')](_0x34c4('0x8'),attributes,{'tableName':_0x34c4('0x9'),'paranoid':![],'indexes':[{'name':_0x34c4('0xa'),'fields':['subject','to'],'type':_0x34c4('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51c7fc,_0xc9297e,_0x3f84e2){if(_0x51c7fc[_0x34c4('0xc')]){_0x51c7fc[_0x34c4('0xd')]=moment()[_0x34c4('0xe')](_0x34c4('0xf'));}if(_0x51c7fc['closed']){_0x51c7fc['closedAt']=moment()['format'](_0x34c4('0xf'));}_0x3f84e2(null,_0xc9297e);},'beforeUpdate':function(_0x38f36a,_0x4fb46c,_0x35035b){if(_0x38f36a[_0x34c4('0x10')](_0x34c4('0xc'))){_0x38f36a['substatusAt']=_0x38f36a[_0x34c4('0xc')]?moment()['format'](_0x34c4('0xf')):null;}if(_0x38f36a[_0x34c4('0x10')](_0x34c4('0x11'))){_0x38f36a[_0x34c4('0x12')]=moment()[_0x34c4('0xe')](_0x34c4('0xf'));_0x38f36a[_0x34c4('0xc')]=null;_0x38f36a[_0x34c4('0xd')]=null;}_0x35035b(null,_0x38f36a);},'afterUpdate':function(_0x4e1130,_0x2dfd6b,_0x7cb25){var _0x5aca49=_0x1e98c2[_0x34c4('0x13')];var _0x56bffc=_0x4e1130[_0x34c4('0x14')]({'plain':!![]});if(_0x56bffc[_0x34c4('0x11')]){return _0x5aca49[_0x34c4('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x56bffc['id']}})[_0x34c4('0x16')](function(){_0x7cb25();})[_0x34c4('0x17')](function(_0x2daf2f){_0x7cb25(_0x2daf2f);});}else{_0x7cb25();}}},'charset':_0x34c4('0x18'),'collate':_0x34c4('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 6bf5ab4..6aea37e 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 _0x2af8=['stringify','error','message','result','catch','UpdateMailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5e891f,_0x454184){var _0x48dd81=function(_0x1d478d){while(--_0x1d478d){_0x5e891f['push'](_0x5e891f['shift']());}};_0x48dd81(++_0x454184);}(_0x2af8,0xf6));var _0x82af=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0x2af8[_0x586642];return _0xef997a;};'use strict';var _=require(_0x82af('0x0'));var util=require('util');var moment=require(_0x82af('0x1'));var BPromise=require(_0x82af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82af('0x3'));var db=require(_0x82af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82af('0x5'))('rpc');var config=require(_0x82af('0x6'));var jayson=require(_0x82af('0x7'));var client=jayson['client'][_0x82af('0x8')]({'port':0x232a});config[_0x82af('0x9')]=_['defaults'](config[_0x82af('0x9')],{'host':_0x82af('0xa'),'port':0x18eb});var socket=require(_0x82af('0xb'))(new Redis(config[_0x82af('0x9')]));require(_0x82af('0xc'))[_0x82af('0xd')](socket);function respondWithRpcPromise(_0x1dbaff,_0x46fe4b,_0x41451a){return new BPromise(function(_0xd5ecc8,_0x459bf0){return client[_0x82af('0xe')](_0x1dbaff,_0x41451a)[_0x82af('0xf')](function(_0x1dedf2){logger[_0x82af('0x10')](_0x82af('0x11'),_0x46fe4b,_0x82af('0x12'));logger[_0x82af('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x46fe4b,'request\x20sent',JSON[_0x82af('0x14')](_0x1dedf2));if(_0x1dedf2[_0x82af('0x15')]){if(_0x1dedf2[_0x82af('0x15')]['code']===0x1f4){logger[_0x82af('0x15')](_0x82af('0x11'),_0x46fe4b,_0x1dedf2[_0x82af('0x15')][_0x82af('0x16')]);return _0x459bf0(_0x1dedf2['error'][_0x82af('0x16')]);}logger[_0x82af('0x15')](_0x82af('0x11'),_0x46fe4b,_0x1dedf2[_0x82af('0x15')][_0x82af('0x16')]);return _0xd5ecc8(_0x1dedf2[_0x82af('0x15')][_0x82af('0x16')]);}else{logger[_0x82af('0x10')](_0x82af('0x11'),_0x46fe4b,_0x82af('0x12'));_0xd5ecc8(_0x1dedf2[_0x82af('0x17')][_0x82af('0x16')]);}})[_0x82af('0x18')](function(_0x5be05a){logger[_0x82af('0x15')](_0x82af('0x11'),_0x46fe4b,_0x5be05a);_0x459bf0(_0x5be05a);});});}exports[_0x82af('0x19')]=function(_0x20cc9e){var _0x59a6fc=this;return new Promise(function(_0x5be0d8,_0x31ffbe){return db['MailInteraction'][_0x82af('0x1a')](_0x20cc9e[_0x82af('0x1b')],{'raw':_0x20cc9e[_0x82af('0x1c')]?_0x20cc9e[_0x82af('0x1c')][_0x82af('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20cc9e[_0x82af('0x1c')]?_0x20cc9e[_0x82af('0x1c')]['where']||null:null,'attributes':_0x20cc9e[_0x82af('0x1c')]?_0x20cc9e['options'][_0x82af('0x1e')]||null:null,'limit':_0x20cc9e['options']?_0x20cc9e['options'][_0x82af('0x1f')]||null:null})['then'](function(_0x7d204e){logger[_0x82af('0x10')](_0x82af('0x19'),_0x20cc9e);logger[_0x82af('0x13')](_0x82af('0x19'),_0x20cc9e,JSON[_0x82af('0x14')](_0x7d204e));_0x5be0d8(_0x7d204e);})[_0x82af('0x18')](function(_0x1adceb){logger['error']('UpdateMailInteraction',_0x1adceb[_0x82af('0x16')],_0x20cc9e);_0x31ffbe(_0x59a6fc[_0x82af('0x15')](0x1f4,_0x1adceb['message']));});});};exports[_0x82af('0x20')]=function(_0x2e6753){return new Promise(function(_0x428c5e,_0x1561f7){return db['MailInteraction']['find']({'where':_0x2e6753[_0x82af('0x1c')]?_0x2e6753[_0x82af('0x1c')][_0x82af('0x21')]||null:null})[_0x82af('0xf')](function(_0x253b01){if(_0x253b01){return _0x253b01[_0x82af('0x22')](_0x2e6753[_0x82af('0x1b')][_0x82af('0x23')],_[_0x82af('0x24')](_0x2e6753[_0x82af('0x1b')],['ids','id'])||{});}})['spread'](function(_0x2412f2){logger['info']('AddTags',_0x2e6753);logger[_0x82af('0x13')](_0x82af('0x25'),_0x2e6753,JSON['stringify'](_0x2412f2));_0x428c5e(_0x2412f2);})['catch'](function(_0x2e6542){logger[_0x82af('0x15')](_0x82af('0x25'),_0x2e6542[_0x82af('0x16')],_0x2e6753);_0x1561f7(_this['error'](0x1f4,_0x2e6542[_0x82af('0x16')]));});});}; \ No newline at end of file +var _0xd2d0=['message','info','MailInteraction','update','body','options','raw','where','limit','then','UpdateMailInteraction','catch','AddTagsToMailInteraction','find','ids','omit','AddTags','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x190bdd,_0x1f9a69){var _0x4b08ff=function(_0x58e1d0){while(--_0x58e1d0){_0x190bdd['push'](_0x190bdd['shift']());}};_0x4b08ff(++_0x1f9a69);}(_0xd2d0,0x80));var _0x0d2d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd2d0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0d2d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d2d('0x1'));var db=require(_0x0d2d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d2d('0x3'))(_0x0d2d('0x4'));var config=require(_0x0d2d('0x5'));var jayson=require(_0x0d2d('0x6'));var client=jayson[_0x0d2d('0x7')]['http']({'port':0x232a});config[_0x0d2d('0x8')]=_[_0x0d2d('0x9')](config['redis'],{'host':_0x0d2d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d2d('0x8')]));require(_0x0d2d('0xb'))[_0x0d2d('0xc')](socket);function respondWithRpcPromise(_0x459390,_0x41c4cf,_0x343c14){return new BPromise(function(_0x336dd4,_0x7dcc5e){return client[_0x0d2d('0xd')](_0x459390,_0x343c14)['then'](function(_0x54d451){logger['info'](_0x0d2d('0xe'),_0x41c4cf,_0x0d2d('0xf'));logger[_0x0d2d('0x10')](_0x0d2d('0x11'),_0x41c4cf,_0x0d2d('0xf'),JSON[_0x0d2d('0x12')](_0x54d451));if(_0x54d451[_0x0d2d('0x13')]){if(_0x54d451['error']['code']===0x1f4){logger[_0x0d2d('0x13')](_0x0d2d('0xe'),_0x41c4cf,_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);return _0x7dcc5e(_0x54d451['error'][_0x0d2d('0x14')]);}logger['error'](_0x0d2d('0xe'),_0x41c4cf,_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);return _0x336dd4(_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);}else{logger[_0x0d2d('0x15')](_0x0d2d('0xe'),_0x41c4cf,_0x0d2d('0xf'));_0x336dd4(_0x54d451['result']['message']);}})['catch'](function(_0x2ab016){logger[_0x0d2d('0x13')]('MailInteraction,\x20%s,\x20%s',_0x41c4cf,_0x2ab016);_0x7dcc5e(_0x2ab016);});});}exports['UpdateMailInteraction']=function(_0x1bc278){var _0x3ad219=this;return new Promise(function(_0x516978,_0x320cc8){return db[_0x0d2d('0x16')][_0x0d2d('0x17')](_0x1bc278[_0x0d2d('0x18')],{'raw':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1b')]||null:null,'attributes':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')]['attributes']||null:null,'limit':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1c')]||null:null})[_0x0d2d('0x1d')](function(_0x335caf){logger['info'](_0x0d2d('0x1e'),_0x1bc278);logger[_0x0d2d('0x10')](_0x0d2d('0x1e'),_0x1bc278,JSON[_0x0d2d('0x12')](_0x335caf));_0x516978(_0x335caf);})[_0x0d2d('0x1f')](function(_0xf09fd4){logger[_0x0d2d('0x13')](_0x0d2d('0x1e'),_0xf09fd4[_0x0d2d('0x14')],_0x1bc278);_0x320cc8(_0x3ad219['error'](0x1f4,_0xf09fd4[_0x0d2d('0x14')]));});});};exports[_0x0d2d('0x20')]=function(_0x40e574){return new Promise(function(_0x28185c,_0x8788e0){return db[_0x0d2d('0x16')][_0x0d2d('0x21')]({'where':_0x40e574[_0x0d2d('0x19')]?_0x40e574[_0x0d2d('0x19')]['where']||null:null})['then'](function(_0xd3e526){if(_0xd3e526){return _0xd3e526['addTags'](_0x40e574[_0x0d2d('0x18')][_0x0d2d('0x22')],_[_0x0d2d('0x23')](_0x40e574[_0x0d2d('0x18')],[_0x0d2d('0x22'),'id'])||{});}})['spread'](function(_0x22acc7){logger[_0x0d2d('0x15')](_0x0d2d('0x24'),_0x40e574);logger[_0x0d2d('0x10')](_0x0d2d('0x24'),_0x40e574,JSON[_0x0d2d('0x12')](_0x22acc7));_0x28185c(_0x22acc7);})['catch'](function(_0x1a5105){logger[_0x0d2d('0x13')](_0x0d2d('0x24'),_0x1a5105[_0x0d2d('0x14')],_0x40e574);_0x8788e0(_this[_0x0d2d('0x13')](0x1f4,_0x1a5105[_0x0d2d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index cd96689..094a968 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 _0xa9ec=['update','removeListener','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x475a12,_0x3a1aa6){var _0x1dfd30=function(_0x4173b8){while(--_0x4173b8){_0x475a12['push'](_0x475a12['shift']());}};_0x1dfd30(++_0x3a1aa6);}(_0xa9ec,0x146));var _0xca9e=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0xa9ec[_0x389c94];return _0x1455cb;};'use strict';var MailInteractionEvents=require(_0xca9e('0x0'));var events=[_0xca9e('0x1'),_0xca9e('0x2'),_0xca9e('0x3')];function createListener(_0x12b747,_0x46cff0){return function(_0x5db90c){_0x46cff0['emit'](_0x12b747,_0x5db90c);};}function removeListener(_0x100762,_0x38f8e2){return function(){MailInteractionEvents[_0xca9e('0x4')](_0x100762,_0x38f8e2);};}exports['register']=function(_0x4a32d0){for(var _0x5782a8=0x0,_0x7d17b=events[_0xca9e('0x5')];_0x5782a8<_0x7d17b;_0x5782a8++){var _0x5a4726=events[_0x5782a8];var _0x9610fa=createListener(_0xca9e('0x6')+_0x5a4726,_0x4a32d0);MailInteractionEvents['on'](_0x5a4726,_0x9610fa);}}; \ No newline at end of file +var _0x14d4=['mailInteraction:','./mailInteraction.events','save','remove','update','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14d4,0xfd));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x414d('0x0'));var events=[_0x414d('0x1'),_0x414d('0x2'),_0x414d('0x3')];function createListener(_0x24194d,_0x1c6818){return function(_0x478069){_0x1c6818['emit'](_0x24194d,_0x478069);};}function removeListener(_0x536ff2,_0x36335c){return function(){MailInteractionEvents[_0x414d('0x4')](_0x536ff2,_0x36335c);};}exports['register']=function(_0x2aa1fd){for(var _0x4e93c7=0x0,_0x2622ee=events[_0x414d('0x5')];_0x4e93c7<_0x2622ee;_0x4e93c7++){var _0xd481ab=events[_0x4e93c7];var _0x5b262b=createListener(_0x414d('0x6')+_0xd481ab,_0x2aa1fd);MailInteractionEvents['on'](_0xd481ab,_0x5b262b);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f58a31e..b0353a2 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 _0xca7b=['accept','/:id/reject','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','tracked','mailmessage:create','create','put','update'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0xca7b,0x14e));var _0xbca7=function(_0xd0b8f2,_0x5aa8de){_0xd0b8f2=_0xd0b8f2-0x0;var _0x323f76=_0xca7b[_0xd0b8f2];return _0x323f76;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbca7('0x0'));var timeout=require(_0xbca7('0x1'));var express=require('express');var router=express[_0xbca7('0x2')]();var fs_extra=require(_0xbca7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbca7('0x4'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbca7('0x5')]('/',auth['isAuthenticated'](),controller[_0xbca7('0x6')]);router['get'](_0xbca7('0x7'),auth[_0xbca7('0x8')](),controller[_0xbca7('0x9')]);router[_0xbca7('0x5')](_0xbca7('0xa'),auth[_0xbca7('0x8')](),controller['show']);router[_0xbca7('0x5')](_0xbca7('0xb'),auth[_0xbca7('0x8')](),controller[_0xbca7('0xc')]);router['post']('/',auth[_0xbca7('0x8')](),interaction[_0xbca7('0xd')]('mail',_0xbca7('0xe')),controller[_0xbca7('0xf')]);router[_0xbca7('0x10')](_0xbca7('0xa'),auth[_0xbca7('0x8')](),controller[_0xbca7('0x11')]);router[_0xbca7('0x10')]('/:id/accept',auth[_0xbca7('0x8')](),controller[_0xbca7('0x12')]);router['put'](_0xbca7('0x13'),auth[_0xbca7('0x8')](),controller['reject']);router[_0xbca7('0x14')]('/:id',auth[_0xbca7('0x8')](),controller[_0xbca7('0x15')]);module['exports']=router; \ No newline at end of file +var _0x515d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x515d,0x104));var _0xd515=function(_0x490605,_0xccbe84){_0x490605=_0x490605-0x0;var _0x56a9b7=_0x515d[_0x490605];return _0x56a9b7;};'use strict';var multer=require('multer');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var timeout=require(_0xd515('0x2'));var express=require(_0xd515('0x3'));var router=express[_0xd515('0x4')]();var fs_extra=require(_0xd515('0x5'));var auth=require(_0xd515('0x6'));var interaction=require(_0xd515('0x7'));var config=require('../../config/environment');var controller=require(_0xd515('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd515('0x9')]);router[_0xd515('0xa')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0xd')]);router['get'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0xf')]);router[_0xd515('0xa')](_0xd515('0x10'),auth[_0xd515('0xc')](),controller['download']);router[_0xd515('0x11')]('/',auth[_0xd515('0xc')](),interaction[_0xd515('0x12')](_0xd515('0x13'),'mailmessage:create'),controller[_0xd515('0x14')]);router[_0xd515('0x15')](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x16')]);router[_0xd515('0x15')](_0xd515('0x17'),auth[_0xd515('0xc')](),controller[_0xd515('0x18')]);router[_0xd515('0x15')](_0xd515('0x19'),auth[_0xd515('0xc')](),controller[_0xd515('0x1a')]);router['delete'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x1b')]);module[_0xd515('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index d14b4d7..a23c29c 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 _0xf8cf=['DATE','Email','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2dcf6e,_0x1e971f){var _0x5c9d78=function(_0x57c1d7){while(--_0x57c1d7){_0x2dcf6e['push'](_0x2dcf6e['shift']());}};_0x5c9d78(++_0x1e971f);}(_0xf8cf,0x153));var _0xff8c=function(_0x9f18b0,_0x4fdb49){_0x9f18b0=_0x9f18b0-0x0;var _0x2b08fe=_0xf8cf[_0x9f18b0];return _0x2b08fe;};'use strict';var Sequelize=require('sequelize');var _=require(_0xff8c('0x0'));module[_0xff8c('0x1')]={'body':{'type':Sequelize[_0xff8c('0x2')](_0xff8c('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xff8c('0x2')](_0xff8c('0x4'))},'read':{'type':Sequelize[_0xff8c('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xff8c('0x6')]('in',_0xff8c('0x7')),'defaultValue':_0xff8c('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xff8c('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xff8c('0x2')]('long')},'cc':{'type':Sequelize[_0xff8c('0x2')](_0xff8c('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0xff8c('0x3'))},'subject':{'type':Sequelize[_0xff8c('0x2')]},'sentAt':{'type':Sequelize[_0xff8c('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xff8c('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xff8c('0x3'))},'originCc':{'type':Sequelize[_0xff8c('0x2')](_0xff8c('0x3'))},'originChannel':{'type':Sequelize[_0xff8c('0x6')](_0xff8c('0xa'),_0xff8c('0xb')),'defaultValue':_0xff8c('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x5f8a=['DATE','Chat','lodash','exports','long','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x23a766,_0x2eab2c){var _0x439cd4=function(_0x4b2913){while(--_0x4b2913){_0x23a766['push'](_0x23a766['shift']());}};_0x439cd4(++_0x2eab2c);}(_0x5f8a,0x156));var _0xa5f8=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x5f8a[_0xb875ee];return _0x4c7f3a;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa5f8('0x0'));module[_0xa5f8('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa5f8('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xa5f8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa5f8('0x4')]('in',_0xa5f8('0x5')),'defaultValue':_0xa5f8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa5f8('0x6')](0x1fe)},'from':{'type':Sequelize[_0xa5f8('0x6')]},'to':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'cc':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xa5f8('0x7')]},'sentAt':{'type':Sequelize[_0xa5f8('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa5f8('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'originCc':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'originChannel':{'type':Sequelize[_0xa5f8('0x4')]('Email',_0xa5f8('0x9')),'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 d6260dc..757458b 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 _0x0eb0=['readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','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','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','event','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','update','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','findAll','show','includeAll','include','options','find','body','params','destroy','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','host','port','secure','authentication','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read'];(function(_0x6202a4,_0x9faa90){var _0x568768=function(_0x2d6b1f){while(--_0x2d6b1f){_0x6202a4['push'](_0x6202a4['shift']());}};_0x568768(++_0x9faa90);}(_0x0eb0,0xea));var _0x00eb=function(_0x49bfd2,_0xcff9a9){_0x49bfd2=_0x49bfd2-0x0;var _0x5a2cc2=_0x0eb0[_0x49bfd2];return _0x5a2cc2;};'use strict';var emlformat=require(_0x00eb('0x0'));var moment=require(_0x00eb('0x1'));var BPromise=require(_0x00eb('0x2'));var util=require(_0x00eb('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x00eb('0x4'));var Redis=require(_0x00eb('0x5'));var htmlToText=require(_0x00eb('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x00eb('0x7'))(_0x00eb('0x8'));var interaction_log=require(_0x00eb('0x7'))(_0x00eb('0x9'));var config=require(_0x00eb('0xa'));var db=require(_0x00eb('0xb'))['db'];config[_0x00eb('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x00eb('0xd'))(new Redis(config[_0x00eb('0xc')]));var htmlEntities=require(_0x00eb('0xe'));require('./mailMessage.socket')[_0x00eb('0xf')](socket);var jayson=require(_0x00eb('0x10'));var client=jayson[_0x00eb('0x11')][_0x00eb('0x12')]({'port':0x232c});var client9003=jayson[_0x00eb('0x11')][_0x00eb('0x12')]({'port':0x232b});var client9002=jayson[_0x00eb('0x11')][_0x00eb('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x48e7fc,_0x2728ce,_0x536610,_0x551c29){return new BPromise(function(_0x4d49ca,_0x35bee7){var _0xe59b0d=_0x551c29||client;return _0xe59b0d['request'](_0x48e7fc,_0x536610)[_0x00eb('0x13')](function(_0x3c35ce){logger[_0x00eb('0x14')](_0x00eb('0x15'),_0x2728ce,_0x00eb('0x16'));logger[_0x00eb('0x17')](_0x00eb('0x18'),_0x2728ce,'request\x20sent',JSON['stringify'](_0x3c35ce));if(_0x3c35ce[_0x00eb('0x19')]){if(_0x3c35ce[_0x00eb('0x19')]['code']===0x1f4){logger[_0x00eb('0x19')](_0x00eb('0x15'),_0x2728ce,_0x3c35ce[_0x00eb('0x19')][_0x00eb('0x1a')]);return _0x35bee7(_0x3c35ce[_0x00eb('0x19')][_0x00eb('0x1a')]);}logger[_0x00eb('0x19')]('MailMessage,\x20%s,\x20%s',_0x2728ce,_0x3c35ce[_0x00eb('0x19')][_0x00eb('0x1a')]);return _0x4d49ca(_0x3c35ce[_0x00eb('0x19')]['message']);}else{logger[_0x00eb('0x14')](_0x00eb('0x15'),_0x2728ce,_0x00eb('0x16'));_0x4d49ca(_0x3c35ce[_0x00eb('0x1b')][_0x00eb('0x1a')]);}})[_0x00eb('0x1c')](function(_0xf4eee3){logger['error'](_0x00eb('0x15'),_0x2728ce,_0xf4eee3);_0x35bee7(_0xf4eee3);});});}function respondWithResult(_0x4c607b,_0x3d03c6){_0x3d03c6=_0x3d03c6||0xc8;return function(_0x13a72d){if(_0x13a72d){return _0x4c607b[_0x00eb('0x1d')](_0x3d03c6)[_0x00eb('0x1e')](_0x13a72d);}};}function respondWithFilteredResult(_0x18ee13,_0x12d5a3){return function(_0x5bdcc4){if(_0x5bdcc4){var _0x1e7e96=typeof _0x12d5a3['offset']===_0x00eb('0x1f')&&typeof _0x12d5a3[_0x00eb('0x20')]===_0x00eb('0x1f');var _0x30d951=_0x5bdcc4[_0x00eb('0x21')];var _0x568e94=_0x1e7e96?0x0:_0x12d5a3[_0x00eb('0x22')];var _0x18ffb4=_0x1e7e96?_0x5bdcc4[_0x00eb('0x21')]:_0x12d5a3['offset']+_0x12d5a3[_0x00eb('0x20')];var _0x290f15;if(_0x18ffb4>=_0x30d951){_0x18ffb4=_0x30d951;_0x290f15=0xc8;}else{_0x290f15=0xce;}_0x18ee13[_0x00eb('0x1d')](_0x290f15);return _0x18ee13[_0x00eb('0x23')](_0x00eb('0x24'),_0x568e94+'-'+_0x18ffb4+'/'+_0x30d951)['json'](_0x5bdcc4);}return null;};}function saveUpdates(_0x40d135){return function(_0x6cd473){if(_0x6cd473){return _0x6cd473[_0x00eb('0x25')](_0x40d135)[_0x00eb('0x13')](function(_0x287363){return _0x287363;});}return null;};}function removeEntity(_0x5ba1f6){return function(_0x40e983){if(_0x40e983){return _0x40e983['destroy']()[_0x00eb('0x13')](function(){_0x5ba1f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28b7b0){return function(_0x33425d){if(!_0x33425d){_0x28b7b0[_0x00eb('0x26')](0x194);}return _0x33425d;};}function handleError(_0x183dee,_0x15b806){_0x15b806=_0x15b806||0x1f4;return function(_0x53a8f6){logger['error'](_0x53a8f6[_0x00eb('0x27')]);if(_0x53a8f6[_0x00eb('0x28')]){delete _0x53a8f6['name'];}_0x183dee[_0x00eb('0x1d')](_0x15b806)[_0x00eb('0x29')](_0x53a8f6);};}exports[_0x00eb('0x2a')]=function(_0x4be610,_0x45507c){var _0x30fdf3={},_0x17f6b3={},_0x351c74={'count':0x0,'rows':[]};var _0x424d33=_[_0x00eb('0x2b')](db[_0x00eb('0x2c')][_0x00eb('0x2d')],function(_0x15c9cd){return{'name':_0x15c9cd['fieldName'],'type':_0x15c9cd[_0x00eb('0x2e')][_0x00eb('0x2f')]};});_0x17f6b3[_0x00eb('0x30')]=_[_0x00eb('0x2b')](_0x424d33,_0x00eb('0x28'));_0x17f6b3[_0x00eb('0x31')]=_[_0x00eb('0x32')](_0x4be610[_0x00eb('0x31')]);_0x17f6b3[_0x00eb('0x33')]=_[_0x00eb('0x34')](_0x17f6b3['model'],_0x17f6b3[_0x00eb('0x31')]);_0x30fdf3[_0x00eb('0x35')]=_[_0x00eb('0x34')](_0x17f6b3['model'],qs[_0x00eb('0x36')](_0x4be610[_0x00eb('0x31')][_0x00eb('0x36')]));_0x30fdf3[_0x00eb('0x35')]=_0x30fdf3[_0x00eb('0x35')][_0x00eb('0x37')]?_0x30fdf3[_0x00eb('0x35')]:_0x17f6b3[_0x00eb('0x30')];if(!_0x4be610[_0x00eb('0x31')][_0x00eb('0x38')](_0x00eb('0x39'))){_0x30fdf3[_0x00eb('0x20')]=qs[_0x00eb('0x20')](_0x4be610[_0x00eb('0x31')][_0x00eb('0x20')]);_0x30fdf3[_0x00eb('0x22')]=qs['offset'](_0x4be610[_0x00eb('0x31')]['offset']);}_0x30fdf3['order']=qs['sort'](_0x4be610[_0x00eb('0x31')][_0x00eb('0x3a')]);_0x30fdf3['where']=qs[_0x00eb('0x33')](_['pick'](_0x4be610[_0x00eb('0x31')],_0x17f6b3[_0x00eb('0x33')]),_0x424d33);if(_0x4be610[_0x00eb('0x31')][_0x00eb('0x3b')]){_0x30fdf3['where']=_[_0x00eb('0x3c')](_0x30fdf3[_0x00eb('0x3d')],{'$or':_[_0x00eb('0x2b')](_0x424d33,function(_0x21732f){if(_0x21732f[_0x00eb('0x2e')]!==_0x00eb('0x3e')){var _0x36ec66={};_0x36ec66[_0x21732f['name']]={'$like':'%'+_0x4be610[_0x00eb('0x31')][_0x00eb('0x3b')]+'%'};return _0x36ec66;}})});}_0x30fdf3=_[_0x00eb('0x3c')]({},_0x30fdf3,_0x4be610['options']);var _0x3a360e={'where':_0x30fdf3[_0x00eb('0x3d')]};return db[_0x00eb('0x2c')][_0x00eb('0x21')](_0x3a360e)['then'](function(_0x3680b0){_0x351c74[_0x00eb('0x21')]=_0x3680b0;if(_0x4be610[_0x00eb('0x31')]['includeAll']){_0x30fdf3['include']=[{'all':!![]}];}return db[_0x00eb('0x2c')][_0x00eb('0x3f')](_0x30fdf3);})[_0x00eb('0x13')](function(_0xf9dd77){_0x351c74['rows']=_0xf9dd77;return _0x351c74;})[_0x00eb('0x13')](respondWithFilteredResult(_0x45507c,_0x30fdf3))[_0x00eb('0x1c')](handleError(_0x45507c,null));};exports[_0x00eb('0x40')]=function(_0xca688f,_0x1e66aa){var _0x27c710={'raw':!![],'where':{'id':_0xca688f['params']['id']}},_0x5978e5={};_0x5978e5[_0x00eb('0x30')]=_[_0x00eb('0x32')](db[_0x00eb('0x2c')][_0x00eb('0x2d')]);_0x5978e5[_0x00eb('0x31')]=_[_0x00eb('0x32')](_0xca688f[_0x00eb('0x31')]);_0x5978e5['filters']=_[_0x00eb('0x34')](_0x5978e5[_0x00eb('0x30')],_0x5978e5[_0x00eb('0x31')]);_0x27c710[_0x00eb('0x35')]=_[_0x00eb('0x34')](_0x5978e5[_0x00eb('0x30')],qs[_0x00eb('0x36')](_0xca688f['query'][_0x00eb('0x36')]));_0x27c710[_0x00eb('0x35')]=_0x27c710[_0x00eb('0x35')][_0x00eb('0x37')]?_0x27c710[_0x00eb('0x35')]:_0x5978e5[_0x00eb('0x30')];if(_0xca688f[_0x00eb('0x31')][_0x00eb('0x41')]){_0x27c710[_0x00eb('0x42')]=[{'all':!![]}];}_0x27c710=_['merge']({},_0x27c710,_0xca688f[_0x00eb('0x43')]);return db['MailMessage'][_0x00eb('0x44')](_0x27c710)[_0x00eb('0x13')](handleEntityNotFound(_0x1e66aa,null))[_0x00eb('0x13')](respondWithResult(_0x1e66aa,null))[_0x00eb('0x1c')](handleError(_0x1e66aa,null));};exports['update']=function(_0x4da3fe,_0x3b7f25){if(_0x4da3fe['body']['id']){delete _0x4da3fe[_0x00eb('0x45')]['id'];}return db[_0x00eb('0x2c')][_0x00eb('0x44')]({'where':{'id':_0x4da3fe[_0x00eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b7f25,null))[_0x00eb('0x13')](saveUpdates(_0x4da3fe[_0x00eb('0x45')],null))['then'](respondWithResult(_0x3b7f25,null))[_0x00eb('0x1c')](handleError(_0x3b7f25,null));};exports[_0x00eb('0x47')]=function(_0x2729ef,_0x27ef55){return db[_0x00eb('0x2c')][_0x00eb('0x44')]({'where':{'id':_0x2729ef['params']['id']}})[_0x00eb('0x13')](handleEntityNotFound(_0x27ef55,null))['then'](removeEntity(_0x27ef55,null))[_0x00eb('0x1c')](handleError(_0x27ef55,null));};exports['describe']=function(_0x271307,_0x26ebb5){return db['MailMessage'][_0x00eb('0x48')]()[_0x00eb('0x13')](respondWithResult(_0x26ebb5,null))[_0x00eb('0x1c')](handleError(_0x26ebb5,null));};exports[_0x00eb('0x49')]=function(_0x420da4,_0x129148){return db[_0x00eb('0x2c')][_0x00eb('0x49')](_0x420da4[_0x00eb('0x45')])[_0x00eb('0x13')](function(_0x6ae92d){if(_0x6ae92d){if(_0x6ae92d[_0x00eb('0x4a')]===_0x00eb('0x4b')&&!_0x6ae92d[_0x00eb('0x4c')]){var _0x2afa56,_0x2ef8ad,_0x250e78;if(_0x420da4[_0x00eb('0x45')]['to']){_0x2ef8ad=_0x420da4[_0x00eb('0x45')]['to'][_0x00eb('0x4d')](',')[0x0];}return db[_0x00eb('0x4e')]['findOne']({'where':{'id':_0x6ae92d[_0x00eb('0x4f')]},'include':[{'model':db[_0x00eb('0x50')],'as':_0x00eb('0x51'),'include':[{'model':db['CmContact'],'as':_0x00eb('0x52'),'where':{'email':_0x2ef8ad},'limit':0x1,'order':[[_0x00eb('0x53'),_0x00eb('0x54')]]}]},{'model':db[_0x00eb('0x55')],'as':_0x00eb('0x56'),'raw':!![]}]})['then'](function(_0x189b2e){_0x2afa56=_0x189b2e;if(_0x2afa56&&_0x2afa56['Smtp']){var _0x106d75={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x2afa56[_0x00eb('0x56')]['service'])){_0x106d75[_0x00eb('0x57')]=_0x2afa56[_0x00eb('0x56')][_0x00eb('0x57')];_0x106d75[_0x00eb('0x58')]=_0x2afa56[_0x00eb('0x56')]['port'];_0x106d75[_0x00eb('0x59')]=_0x2afa56['Smtp'][_0x00eb('0x59')];if(_0x2afa56['Smtp'][_0x00eb('0x5a')]){_0x106d75[_0x00eb('0x5b')]={'user':_0x2afa56[_0x00eb('0x56')][_0x00eb('0x5c')],'pass':_0x2afa56[_0x00eb('0x56')][_0x00eb('0x5d')]};}}else{_0x106d75[_0x00eb('0x5e')]=_0x2afa56[_0x00eb('0x56')][_0x00eb('0x5e')];_0x106d75[_0x00eb('0x5b')]={'user':_0x2afa56['Smtp'][_0x00eb('0x5c')],'pass':_0x2afa56[_0x00eb('0x56')]['pass']};_0x106d75['secure']=_0x2afa56[_0x00eb('0x56')][_0x00eb('0x59')];}if(_0x420da4[_0x00eb('0x45')]['attachments']&&_0x420da4[_0x00eb('0x45')][_0x00eb('0x5f')]['length']){for(var _0x9a771b=0x0;_0x9a771b<_0x420da4['body'][_0x00eb('0x5f')][_0x00eb('0x37')];_0x9a771b+=0x1){_0x420da4[_0x00eb('0x45')][_0x00eb('0x5f')][_0x9a771b]={'filename':_0x420da4['body']['attachments'][_0x9a771b][_0x00eb('0x28')],'path':path[_0x00eb('0x60')](config[_0x00eb('0x61')],_0x00eb('0x62'),_0x420da4['body']['attachments'][_0x9a771b][_0x00eb('0x63')])};}}_0x250e78={'account':_0x106d75,'message':_0x420da4['body']};return;}})['then'](function(){if(_0x2afa56[_0x00eb('0x51')]){if(_0x2afa56[_0x00eb('0x51')][_0x00eb('0x52')][_0x00eb('0x37')]){return _0x2afa56[_0x00eb('0x51')][_0x00eb('0x52')][0x0];}else{return db[_0x00eb('0x64')][_0x00eb('0x49')](_['defaults'](_0x420da4[_0x00eb('0x45')],{'firstName':_0x420da4['body']['to'],'email':_0x420da4[_0x00eb('0x45')]['to'],'phone':_0x420da4['body']['to'],'ListId':_0x2afa56[_0x00eb('0x65')]}));}}else{throw new Error(_0x00eb('0x66'));}})[_0x00eb('0x13')](function(){if(_0x250e78){return respondWithRpcPromise(_0x00eb('0x67'),_0x00eb('0x68'),_0x250e78,client9003)[_0x00eb('0x13')](function(_0x268174){return _0x6ae92d['update']({'read':!![],'messageId':_0x268174[_0x00eb('0x69')],'sentAt':moment()['format'](_0x00eb('0x6a'))});})[_0x00eb('0x1c')](function(_0x489e68){logger[_0x00eb('0x19')]('%s',JSON['stringify'](_0x489e68));return _0x6ae92d;});}return _0x6ae92d;});}return _0x6ae92d;}})[_0x00eb('0x13')](respondWithResult(_0x129148,0xc9))['catch'](handleError(_0x129148,null));};exports[_0x00eb('0x6b')]=function(_0x147d31,_0x3d4f0f){var _0x1cf4f5={'agent':{},'channel':_0x00eb('0x6c')};if(_0x147d31[_0x00eb('0x45')]['id']){delete _0x147d31['body']['id'];}_0x147d31[_0x00eb('0x45')][_0x00eb('0x6d')]=!![];_0x147d31['body'][_0x00eb('0x6e')]=moment()['format'](_0x00eb('0x6a'));_0x147d31['body'][_0x00eb('0x6f')]=_0x147d31['body'][_0x00eb('0x6f')]||_0x147d31[_0x00eb('0x5c')]['id'];_0x1cf4f5[_0x00eb('0x70')]['id']=_0x147d31[_0x00eb('0x45')][_0x00eb('0x6f')];return db[_0x00eb('0x2c')][_0x00eb('0x44')]({'where':{'id':_0x147d31[_0x00eb('0x46')]['id'],'UserId':null}})[_0x00eb('0x13')](handleEntityNotFound(_0x3d4f0f,null))[_0x00eb('0x13')](saveUpdates(_0x147d31[_0x00eb('0x45')],null))[_0x00eb('0x13')](function(_0x29d1a9){if(_0x29d1a9){_0x1cf4f5[_0x00eb('0x1a')]=_0x29d1a9[_0x00eb('0x71')]({'plain':!![]});return db[_0x00eb('0x72')]['find']({'where':{'id':_0x29d1a9[_0x00eb('0x73')]}});}return null;})[_0x00eb('0x13')](handleEntityNotFound(_0x3d4f0f,null))[_0x00eb('0x13')](function(_0x14c361){if(_0x14c361){return _0x14c361[_0x00eb('0x25')]({'UserId':_0x147d31['body']['UserId'],'read1stAt':_[_0x00eb('0x74')](_0x14c361[_0x00eb('0x75')])?moment()['format'](_0x00eb('0x6a')):undefined});}return null;})[_0x00eb('0x13')](function(_0x23163f){if(_0x23163f){_0x1cf4f5[_0x00eb('0x76')]=_0x23163f[_0x00eb('0x71')]({'plain':!![]});interaction_log['info'](_0x00eb('0x77'),_0x147d31[_0x00eb('0x5c')]['id'],_0x147d31['user'][_0x00eb('0x28')],_0x147d31[_0x00eb('0x5c')][_0x00eb('0x78')],_0x1cf4f5[_0x00eb('0x76')]['id'],_0x147d31[_0x00eb('0x45')]?JSON[_0x00eb('0x79')](_0x147d31[_0x00eb('0x45')]):_0x00eb('0x7a'));return respondWithRpcPromise(_0x00eb('0x7b'),_0x00eb('0x7c'),_0x1cf4f5);}return null;})[_0x00eb('0x13')](function(_0x358b18){var _0x38f67a=_0x00eb('0x7d')+_0x358b18[_0x00eb('0x1a')][_0x00eb('0x7e')];return db[_0x00eb('0x7f')][_0x00eb('0x31')](_0x38f67a,{'type':db[_0x00eb('0x80')][_0x00eb('0x81')][_0x00eb('0x82')],'raw':!![]})[_0x00eb('0x13')](function(_0x21dd8a){return _0x21dd8a;});})[_0x00eb('0x13')](function(_0x40d17e){if(_0x40d17e){_0x1cf4f5[_0x00eb('0x1a')]['contact']=_0x40d17e[0x0];if(!_0x147d31[_0x00eb('0x45')]['UserId'])return;return db[_0x00eb('0x83')][_0x00eb('0x44')]({'where':{'id':_0x147d31[_0x00eb('0x45')]['UserId'],'role':_0x00eb('0x70')},'attributes':['id',_0x00eb('0x28'),_0x00eb('0x84'),_0x00eb('0x85'),_0x00eb('0x86')],'raw':!![]});}return null;})[_0x00eb('0x13')](function(_0x1c1489){if(!_0x1c1489)return null;_0x1cf4f5[_0x00eb('0x1a')]['agent']=_0x1c1489;return _0x1cf4f5;})[_0x00eb('0x13')](function(_0x4fef27){if(_0x4fef27){if(_0x147d31[_0x00eb('0x45')][_0x00eb('0x87')]){_0x1cf4f5[_0x00eb('0x1a')][_0x00eb('0x88')]=util[_0x00eb('0x89')](_0x00eb('0x8a'),_0x147d31[_0x00eb('0x5c')]['name']);_0x1cf4f5[_0x00eb('0x1a')][_0x00eb('0x8b')]=_0x1cf4f5[_0x00eb('0x8b')];_0x1cf4f5[_0x00eb('0x1a')][_0x00eb('0x8c')]=_0x1cf4f5[_0x00eb('0x8b')];_0x1cf4f5[_0x00eb('0x1a')]['event']=_0x00eb('0x6b');_0x1cf4f5[_0x00eb('0x1a')]['body']=htmlToText[_0x00eb('0x8d')](_0x1cf4f5['message']['body']);return respondWithRpcPromise(_0x00eb('0x8e'),'EventManager',{'event':'acceptmessage','message':_0x1cf4f5[_0x00eb('0x1a')]},client9002)['then'](function(){return _0x1cf4f5;});}return _0x1cf4f5;}return null;})['then'](respondWithResult(_0x3d4f0f,null))[_0x00eb('0x1c')](handleError(_0x3d4f0f,null));};exports[_0x00eb('0x8f')]=function(_0x1b8e1f,_0x929c14){var _0x3c89ef={'agent':{},'channel':'mail'};if(_0x1b8e1f[_0x00eb('0x45')]['id']){delete _0x1b8e1f['body']['id'];}_0x1b8e1f['body'][_0x00eb('0x6f')]=_0x1b8e1f[_0x00eb('0x45')][_0x00eb('0x6f')]||_0x1b8e1f[_0x00eb('0x5c')]['id'];_0x3c89ef[_0x00eb('0x70')]['id']=_0x1b8e1f[_0x00eb('0x45')][_0x00eb('0x6f')];return db[_0x00eb('0x2c')][_0x00eb('0x44')]({'where':{'id':_0x1b8e1f[_0x00eb('0x46')]['id'],'UserId':null}})[_0x00eb('0x13')](handleEntityNotFound(_0x929c14,null))[_0x00eb('0x13')](function(_0x5bbb8c){if(_0x5bbb8c){_0x3c89ef['message']=_0x5bbb8c[_0x00eb('0x71')]({'plain':!![]});return db[_0x00eb('0x72')][_0x00eb('0x44')]({'where':{'id':_0x5bbb8c['MailInteractionId']}});}return null;})[_0x00eb('0x13')](handleEntityNotFound(_0x929c14,null))[_0x00eb('0x13')](function(_0x3c35bc){if(_0x3c35bc){_0x3c89ef['interaction']=_0x3c35bc['get']({'plain':!![]});interaction_log[_0x00eb('0x14')](_0x00eb('0x90'),_0x1b8e1f[_0x00eb('0x5c')]['id'],_0x1b8e1f['user'][_0x00eb('0x28')],_0x1b8e1f[_0x00eb('0x5c')][_0x00eb('0x78')],_0x3c89ef[_0x00eb('0x76')]['id'],_0x1b8e1f[_0x00eb('0x45')]?JSON[_0x00eb('0x79')](_0x1b8e1f[_0x00eb('0x45')]):_0x00eb('0x7a'));return respondWithRpcPromise(_0x00eb('0x91'),_0x00eb('0x92'),_0x3c89ef);}return null;})[_0x00eb('0x13')](function(_0x546208){var _0x5be720=_0x00eb('0x7d')+_0x546208[_0x00eb('0x1a')][_0x00eb('0x7e')];return db[_0x00eb('0x7f')][_0x00eb('0x31')](_0x5be720,{'type':db['Sequelize'][_0x00eb('0x81')][_0x00eb('0x82')],'raw':!![]})[_0x00eb('0x13')](function(_0x5132c0){return _0x5132c0;});})['then'](function(_0xa4188c){if(_0xa4188c){_0x3c89ef[_0x00eb('0x1a')][_0x00eb('0x93')]=_0xa4188c[0x0];if(!_0x1b8e1f['body'][_0x00eb('0x6f')])return;return db[_0x00eb('0x83')]['find']({'where':{'id':_0x1b8e1f[_0x00eb('0x45')][_0x00eb('0x6f')],'role':_0x00eb('0x70')},'attributes':['id',_0x00eb('0x28'),_0x00eb('0x84'),'email',_0x00eb('0x86')],'raw':!![]});}return null;})[_0x00eb('0x13')](function(_0xbd4d2){if(!_0xbd4d2)return null;_0x3c89ef[_0x00eb('0x1a')]['agent']=_0xbd4d2;return _0x3c89ef;})[_0x00eb('0x13')](function(_0x11a106){if(_0x11a106){_0x11a106[_0x00eb('0x1a')][_0x00eb('0x88')]=util[_0x00eb('0x89')]('SIP/%s',_0x1b8e1f[_0x00eb('0x5c')][_0x00eb('0x28')]);_0x11a106[_0x00eb('0x1a')][_0x00eb('0x8b')]=_0x3c89ef[_0x00eb('0x8b')];_0x11a106[_0x00eb('0x1a')]['motionChannel']=_0x3c89ef[_0x00eb('0x8b')];_0x11a106['message'][_0x00eb('0x94')]='reject';_0x11a106[_0x00eb('0x1a')]['body']=htmlToText[_0x00eb('0x8d')](_0x3c89ef[_0x00eb('0x1a')]['body']);respondWithRpcPromise(_0x00eb('0x8e'),_0x00eb('0x8e'),{'event':'rejectmessage','message':_0x11a106[_0x00eb('0x1a')]},client9002);return _0x3c89ef;}return null;})[_0x00eb('0x13')](respondWithResult(_0x929c14,null))['catch'](handleError(_0x929c14,null));};exports[_0x00eb('0x95')]=function(_0x25dcf9,_0x2e00cd){var _0xd3ccda=moment()[_0x00eb('0x96')]()[_0x00eb('0x97')]();var _0x11a8ae=path[_0x00eb('0x60')](config[_0x00eb('0x61')],_0x00eb('0x98'),_0x00eb('0x99'),_0x00eb('0x9a'));var _0x4298f6=path[_0x00eb('0x60')](config[_0x00eb('0x61')],_0x00eb('0x98'),_0x00eb('0x99'),_0x00eb('0x5f'));var _0x4b5d71=util[_0x00eb('0x89')](_0x00eb('0x9b'),_0xd3ccda);return db['MailMessage'][_0x00eb('0x44')]({'where':{'id':_0x25dcf9['params']['id']},'attributes':['id',_0x00eb('0x45'),_0x00eb('0x9c'),'to','cc',_0x00eb('0x9d'),_0x00eb('0x9e'),_0x00eb('0x9f')],'include':_0x25dcf9['query'][_0x00eb('0x5f')]?[{'model':db[_0x00eb('0xa0')],'as':_0x00eb('0xa1')}]:undefined})[_0x00eb('0x13')](handleEntityNotFound(_0x2e00cd,null))[_0x00eb('0x13')](function(_0x6d067){if(_0x6d067){var _0x51d917=_0x6d067;var _0x4dd2d8={'from':_0x51d917[_0x00eb('0x9c')],'to':_0x51d917['to'],'subject':_0x51d917[_0x00eb('0x9e')],'html':htmlEntities[_0x00eb('0xa2')](_0x51d917['body']),'headers':{'Date':moment(_0x51d917[_0x00eb('0x9f')])['format'](_0x00eb('0xa3'))},'attachments':[]};if(_0x6d067['cc']){_0x4dd2d8[_0x00eb('0xa4')]['Cc']=_0x6d067['cc'];}if(_0x6d067[_0x00eb('0x9d')]){_0x4dd2d8[_0x00eb('0xa4')][_0x00eb('0xa5')]=_0x6d067[_0x00eb('0x9d')];}return new BPromise(function(_0x5b43f5,_0x3fc886){if(_0x6d067[_0x00eb('0xa1')]){for(var _0x28f1a6=0x0;_0x28f1a6<_0x6d067[_0x00eb('0xa1')][_0x00eb('0x37')];_0x28f1a6++){var _0x5dfb3f=_0x6d067[_0x00eb('0xa1')][_0x28f1a6];var _0x48c4ac=path[_0x00eb('0x60')](_0x4298f6,_0x5dfb3f[_0x00eb('0x63')]);if(fs[_0x00eb('0xa6')](_0x48c4ac)){_0x4dd2d8['attachments'][_0x00eb('0xa7')]({'name':_0x5dfb3f[_0x00eb('0x28')],'contentType':_0x5dfb3f[_0x00eb('0x2e')],'data':fs[_0x00eb('0xa8')](_0x48c4ac)});}}}emlformat[_0x00eb('0xa9')](_0x4dd2d8,function(_0x1ce9e1,_0x13374c){if(_0x1ce9e1)return _0x3fc886(_0x1ce9e1);fs[_0x00eb('0xaa')](path['join'](_0x11a8ae,_0x4b5d71),_0x13374c);return _0x5b43f5(_0x13374c);});});}})['then'](function(_0x3d719d){if(_0x3d719d){return _0x2e00cd[_0x00eb('0x95')](path[_0x00eb('0x60')](_0x11a8ae,_0x4b5d71),_0x4b5d71,function(_0x5636ee){if(!_0x5636ee)fs[_0x00eb('0xab')](path[_0x00eb('0x60')](_0x11a8ae,_0x4b5d71));});}})[_0x00eb('0x1c')](handleError(_0x2e00cd,null));}; \ No newline at end of file +var _0x3072=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','body','describe','create','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','User','reject','fromString','download','files','server','message-%s.eml','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','writeFileSync','eml-format','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','json','offset','limit','undefined','count','set','Content-Range','update','destroy','status','stack','name','send','index','map','MailMessage','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4bc16c,_0xdb80f0){var _0x1707ea=function(_0x3a5235){while(--_0x3a5235){_0x4bc16c['push'](_0x4bc16c['shift']());}};_0x1707ea(++_0xdb80f0);}(_0x3072,0x64));var _0x2307=function(_0x4b6aba,_0x10ade8){_0x4b6aba=_0x4b6aba-0x0;var _0x428c1d=_0x3072[_0x4b6aba];return _0x428c1d;};'use strict';var emlformat=require(_0x2307('0x0'));var moment=require('moment');var BPromise=require(_0x2307('0x1'));var util=require(_0x2307('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x2307('0x3'));var Redis=require(_0x2307('0x4'));var htmlToText=require('html-to-text');var qs=require(_0x2307('0x5'));var logger=require('../../config/logger')('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x2307('0x6'));var db=require(_0x2307('0x7'))['db'];config[_0x2307('0x8')]=_['defaults'](config[_0x2307('0x8')],{'host':_0x2307('0x9'),'port':0x18eb});var socket=require(_0x2307('0xa'))(new Redis(config[_0x2307('0x8')]));var htmlEntities=require(_0x2307('0xb'));require(_0x2307('0xc'))[_0x2307('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2307('0xe')][_0x2307('0xf')]({'port':0x232c});var client9003=jayson[_0x2307('0xe')]['http']({'port':0x232b});var client9002=jayson['client'][_0x2307('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x214dae,_0x483297,_0x12a9c1,_0x5241d7){return new BPromise(function(_0x3dd7bc,_0x42acf5){var _0x22d23e=_0x5241d7||client;return _0x22d23e['request'](_0x214dae,_0x12a9c1)[_0x2307('0x10')](function(_0x181c17){logger['info']('MailMessage,\x20%s,\x20%s',_0x483297,_0x2307('0x11'));logger['debug'](_0x2307('0x12'),_0x483297,_0x2307('0x11'),JSON[_0x2307('0x13')](_0x181c17));if(_0x181c17[_0x2307('0x14')]){if(_0x181c17[_0x2307('0x14')]['code']===0x1f4){logger[_0x2307('0x14')](_0x2307('0x15'),_0x483297,_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);return _0x42acf5(_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);}logger[_0x2307('0x14')]('MailMessage,\x20%s,\x20%s',_0x483297,_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);return _0x3dd7bc(_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);}else{logger['info'](_0x2307('0x15'),_0x483297,_0x2307('0x11'));_0x3dd7bc(_0x181c17[_0x2307('0x17')][_0x2307('0x16')]);}})['catch'](function(_0x2ed821){logger[_0x2307('0x14')]('MailMessage,\x20%s,\x20%s',_0x483297,_0x2ed821);_0x42acf5(_0x2ed821);});});}function respondWithResult(_0x241f4a,_0x3d8451){_0x3d8451=_0x3d8451||0xc8;return function(_0x429f63){if(_0x429f63){return _0x241f4a['status'](_0x3d8451)[_0x2307('0x18')](_0x429f63);}};}function respondWithFilteredResult(_0x3deddd,_0x2151f0){return function(_0x351aec){if(_0x351aec){var _0x57e126=typeof _0x2151f0[_0x2307('0x19')]==='undefined'&&typeof _0x2151f0[_0x2307('0x1a')]===_0x2307('0x1b');var _0x5c5279=_0x351aec['count'];var _0x16a552=_0x57e126?0x0:_0x2151f0[_0x2307('0x19')];var _0x53e62e=_0x57e126?_0x351aec[_0x2307('0x1c')]:_0x2151f0[_0x2307('0x19')]+_0x2151f0[_0x2307('0x1a')];var _0x4c0724;if(_0x53e62e>=_0x5c5279){_0x53e62e=_0x5c5279;_0x4c0724=0xc8;}else{_0x4c0724=0xce;}_0x3deddd['status'](_0x4c0724);return _0x3deddd[_0x2307('0x1d')](_0x2307('0x1e'),_0x16a552+'-'+_0x53e62e+'/'+_0x5c5279)[_0x2307('0x18')](_0x351aec);}return null;};}function saveUpdates(_0x2488f8){return function(_0x3e5c71){if(_0x3e5c71){return _0x3e5c71[_0x2307('0x1f')](_0x2488f8)[_0x2307('0x10')](function(_0x43a18c){return _0x43a18c;});}return null;};}function removeEntity(_0x11213e){return function(_0x2a16d4){if(_0x2a16d4){return _0x2a16d4[_0x2307('0x20')]()[_0x2307('0x10')](function(){_0x11213e[_0x2307('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502e54){return function(_0x5a3588){if(!_0x5a3588){_0x502e54['sendStatus'](0x194);}return _0x5a3588;};}function handleError(_0xce1360,_0x292bd3){_0x292bd3=_0x292bd3||0x1f4;return function(_0x389122){logger[_0x2307('0x14')](_0x389122[_0x2307('0x22')]);if(_0x389122[_0x2307('0x23')]){delete _0x389122['name'];}_0xce1360['status'](_0x292bd3)[_0x2307('0x24')](_0x389122);};}exports[_0x2307('0x25')]=function(_0x3aba27,_0x272494){var _0x3f8476={},_0x24f1e1={},_0xc5e810={'count':0x0,'rows':[]};var _0x119a05=_[_0x2307('0x26')](db[_0x2307('0x27')]['rawAttributes'],function(_0x6c1f8c){return{'name':_0x6c1f8c['fieldName'],'type':_0x6c1f8c['type']['key']};});_0x24f1e1[_0x2307('0x28')]=_[_0x2307('0x26')](_0x119a05,_0x2307('0x23'));_0x24f1e1[_0x2307('0x29')]=_[_0x2307('0x2a')](_0x3aba27[_0x2307('0x29')]);_0x24f1e1[_0x2307('0x2b')]=_['intersection'](_0x24f1e1['model'],_0x24f1e1[_0x2307('0x29')]);_0x3f8476[_0x2307('0x2c')]=_[_0x2307('0x2d')](_0x24f1e1['model'],qs[_0x2307('0x2e')](_0x3aba27['query'][_0x2307('0x2e')]));_0x3f8476[_0x2307('0x2c')]=_0x3f8476[_0x2307('0x2c')][_0x2307('0x2f')]?_0x3f8476[_0x2307('0x2c')]:_0x24f1e1['model'];if(!_0x3aba27['query'][_0x2307('0x30')](_0x2307('0x31'))){_0x3f8476[_0x2307('0x1a')]=qs['limit'](_0x3aba27[_0x2307('0x29')]['limit']);_0x3f8476[_0x2307('0x19')]=qs[_0x2307('0x19')](_0x3aba27['query'][_0x2307('0x19')]);}_0x3f8476[_0x2307('0x32')]=qs[_0x2307('0x33')](_0x3aba27[_0x2307('0x29')][_0x2307('0x33')]);_0x3f8476[_0x2307('0x34')]=qs[_0x2307('0x2b')](_['pick'](_0x3aba27[_0x2307('0x29')],_0x24f1e1[_0x2307('0x2b')]),_0x119a05);if(_0x3aba27[_0x2307('0x29')][_0x2307('0x35')]){_0x3f8476[_0x2307('0x34')]=_[_0x2307('0x36')](_0x3f8476[_0x2307('0x34')],{'$or':_['map'](_0x119a05,function(_0x426ca9){if(_0x426ca9[_0x2307('0x37')]!==_0x2307('0x38')){var _0x5d6b46={};_0x5d6b46[_0x426ca9[_0x2307('0x23')]]={'$like':'%'+_0x3aba27['query'][_0x2307('0x35')]+'%'};return _0x5d6b46;}})});}_0x3f8476=_[_0x2307('0x36')]({},_0x3f8476,_0x3aba27[_0x2307('0x39')]);var _0x1d612d={'where':_0x3f8476[_0x2307('0x34')]};return db['MailMessage']['count'](_0x1d612d)['then'](function(_0x816828){_0xc5e810[_0x2307('0x1c')]=_0x816828;if(_0x3aba27[_0x2307('0x29')][_0x2307('0x3a')]){_0x3f8476[_0x2307('0x3b')]=[{'all':!![]}];}return db[_0x2307('0x27')][_0x2307('0x3c')](_0x3f8476);})['then'](function(_0x7cd1dd){_0xc5e810['rows']=_0x7cd1dd;return _0xc5e810;})[_0x2307('0x10')](respondWithFilteredResult(_0x272494,_0x3f8476))['catch'](handleError(_0x272494,null));};exports[_0x2307('0x3d')]=function(_0x2be19a,_0xfe5284){var _0xa8ce0e={'raw':!![],'where':{'id':_0x2be19a[_0x2307('0x3e')]['id']}},_0x3607c1={};_0x3607c1[_0x2307('0x28')]=_['keys'](db['MailMessage'][_0x2307('0x3f')]);_0x3607c1[_0x2307('0x29')]=_['keys'](_0x2be19a[_0x2307('0x29')]);_0x3607c1[_0x2307('0x2b')]=_[_0x2307('0x2d')](_0x3607c1[_0x2307('0x28')],_0x3607c1[_0x2307('0x29')]);_0xa8ce0e[_0x2307('0x2c')]=_[_0x2307('0x2d')](_0x3607c1['model'],qs[_0x2307('0x2e')](_0x2be19a['query'][_0x2307('0x2e')]));_0xa8ce0e[_0x2307('0x2c')]=_0xa8ce0e[_0x2307('0x2c')][_0x2307('0x2f')]?_0xa8ce0e['attributes']:_0x3607c1['model'];if(_0x2be19a[_0x2307('0x29')]['includeAll']){_0xa8ce0e[_0x2307('0x3b')]=[{'all':!![]}];}_0xa8ce0e=_[_0x2307('0x36')]({},_0xa8ce0e,_0x2be19a['options']);return db[_0x2307('0x27')][_0x2307('0x40')](_0xa8ce0e)['then'](handleEntityNotFound(_0xfe5284,null))[_0x2307('0x10')](respondWithResult(_0xfe5284,null))[_0x2307('0x41')](handleError(_0xfe5284,null));};exports[_0x2307('0x1f')]=function(_0x5ebdab,_0x2e5483){if(_0x5ebdab[_0x2307('0x42')]['id']){delete _0x5ebdab['body']['id'];}return db[_0x2307('0x27')]['find']({'where':{'id':_0x5ebdab[_0x2307('0x3e')]['id']}})[_0x2307('0x10')](handleEntityNotFound(_0x2e5483,null))[_0x2307('0x10')](saveUpdates(_0x5ebdab['body'],null))[_0x2307('0x10')](respondWithResult(_0x2e5483,null))[_0x2307('0x41')](handleError(_0x2e5483,null));};exports[_0x2307('0x20')]=function(_0x121436,_0x192715){return db['MailMessage'][_0x2307('0x40')]({'where':{'id':_0x121436[_0x2307('0x3e')]['id']}})[_0x2307('0x10')](handleEntityNotFound(_0x192715,null))[_0x2307('0x10')](removeEntity(_0x192715,null))[_0x2307('0x41')](handleError(_0x192715,null));};exports[_0x2307('0x43')]=function(_0x3061e0,_0x33df8f){return db[_0x2307('0x27')][_0x2307('0x43')]()['then'](respondWithResult(_0x33df8f,null))['catch'](handleError(_0x33df8f,null));};exports[_0x2307('0x44')]=function(_0x2f5067,_0x2f6cde){return db[_0x2307('0x27')][_0x2307('0x44')](_0x2f5067['body'])[_0x2307('0x10')](function(_0x428f10){if(_0x428f10){if(_0x428f10['direction']==='out'&&!_0x428f10[_0x2307('0x45')]){var _0x39db30,_0x57fb33,_0x497ae0;if(_0x2f5067['body']['to']){_0x57fb33=_0x2f5067[_0x2307('0x42')]['to'][_0x2307('0x46')](',')[0x0];}return db[_0x2307('0x47')][_0x2307('0x48')]({'where':{'id':_0x428f10['MailAccountId']},'include':[{'model':db[_0x2307('0x49')],'as':_0x2307('0x4a'),'include':[{'model':db[_0x2307('0x4b')],'as':_0x2307('0x4c'),'where':{'email':_0x57fb33},'limit':0x1,'order':[[_0x2307('0x4d'),_0x2307('0x4e')]]}]},{'model':db[_0x2307('0x4f')],'as':_0x2307('0x50'),'raw':!![]}]})['then'](function(_0x5b7e13){_0x39db30=_0x5b7e13;if(_0x39db30&&_0x39db30[_0x2307('0x50')]){var _0x2b6c7e={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x39db30[_0x2307('0x50')][_0x2307('0x51')])){_0x2b6c7e[_0x2307('0x52')]=_0x39db30[_0x2307('0x50')]['host'];_0x2b6c7e[_0x2307('0x53')]=_0x39db30['Smtp'][_0x2307('0x53')];_0x2b6c7e[_0x2307('0x54')]=_0x39db30[_0x2307('0x50')][_0x2307('0x54')];if(_0x39db30[_0x2307('0x50')][_0x2307('0x55')]){_0x2b6c7e[_0x2307('0x56')]={'user':_0x39db30[_0x2307('0x50')]['user'],'pass':_0x39db30['Smtp']['pass']};}}else{_0x2b6c7e[_0x2307('0x51')]=_0x39db30[_0x2307('0x50')][_0x2307('0x51')];_0x2b6c7e[_0x2307('0x56')]={'user':_0x39db30[_0x2307('0x50')][_0x2307('0x57')],'pass':_0x39db30[_0x2307('0x50')][_0x2307('0x58')]};_0x2b6c7e['secure']=_0x39db30[_0x2307('0x50')][_0x2307('0x54')];}if(_0x2f5067['body'][_0x2307('0x59')]&&_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x2307('0x2f')]){for(var _0x3c2d13=0x0;_0x3c2d13<_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x2307('0x2f')];_0x3c2d13+=0x1){_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13]={'filename':_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13][_0x2307('0x23')],'path':path[_0x2307('0x5a')](config[_0x2307('0x5b')],_0x2307('0x5c'),_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13][_0x2307('0x5d')])};}}_0x497ae0={'account':_0x2b6c7e,'message':_0x2f5067['body']};return;}})[_0x2307('0x10')](function(){if(_0x39db30[_0x2307('0x4a')]){if(_0x39db30[_0x2307('0x4a')][_0x2307('0x4c')]['length']){return _0x39db30[_0x2307('0x4a')]['Contacts'][0x0];}else{return db[_0x2307('0x4b')][_0x2307('0x44')](_[_0x2307('0x5e')](_0x2f5067['body'],{'firstName':_0x2f5067['body']['to'],'email':_0x2f5067[_0x2307('0x42')]['to'],'phone':_0x2f5067['body']['to'],'ListId':_0x39db30[_0x2307('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x497ae0){return respondWithRpcPromise(_0x2307('0x60'),_0x2307('0x61'),_0x497ae0,client9003)['then'](function(_0x42bf26){return _0x428f10['update']({'read':!![],'messageId':_0x42bf26[_0x2307('0x62')],'sentAt':moment()['format'](_0x2307('0x63'))});})[_0x2307('0x41')](function(_0x532eae){logger[_0x2307('0x14')]('%s',JSON[_0x2307('0x13')](_0x532eae));return _0x428f10;});}return _0x428f10;});}return _0x428f10;}})[_0x2307('0x10')](respondWithResult(_0x2f6cde,0xc9))[_0x2307('0x41')](handleError(_0x2f6cde,null));};exports[_0x2307('0x64')]=function(_0x2e4557,_0x2e4c61){var _0x284e0b={'agent':{},'channel':_0x2307('0x65')};if(_0x2e4557[_0x2307('0x42')]['id']){delete _0x2e4557[_0x2307('0x42')]['id'];}_0x2e4557[_0x2307('0x42')][_0x2307('0x66')]=!![];_0x2e4557[_0x2307('0x42')][_0x2307('0x67')]=moment()[_0x2307('0x68')](_0x2307('0x63'));_0x2e4557[_0x2307('0x42')][_0x2307('0x69')]=_0x2e4557[_0x2307('0x42')]['UserId']||_0x2e4557[_0x2307('0x57')]['id'];_0x284e0b[_0x2307('0x6a')]['id']=_0x2e4557[_0x2307('0x42')]['UserId'];return db[_0x2307('0x27')]['find']({'where':{'id':_0x2e4557[_0x2307('0x3e')]['id'],'UserId':null}})[_0x2307('0x10')](handleEntityNotFound(_0x2e4c61,null))[_0x2307('0x10')](saveUpdates(_0x2e4557[_0x2307('0x42')],null))[_0x2307('0x10')](function(_0x4d0166){if(_0x4d0166){_0x284e0b[_0x2307('0x16')]=_0x4d0166[_0x2307('0x6b')]({'plain':!![]});return db[_0x2307('0x6c')][_0x2307('0x40')]({'where':{'id':_0x4d0166[_0x2307('0x6d')]}});}return null;})[_0x2307('0x10')](handleEntityNotFound(_0x2e4c61,null))[_0x2307('0x10')](function(_0x5e1c58){if(_0x5e1c58){return _0x5e1c58[_0x2307('0x1f')]({'UserId':_0x2e4557[_0x2307('0x42')]['UserId'],'read1stAt':_['isNil'](_0x5e1c58[_0x2307('0x6e')])?moment()[_0x2307('0x68')](_0x2307('0x63')):undefined});}return null;})[_0x2307('0x10')](function(_0x51474c){if(_0x51474c){_0x284e0b[_0x2307('0x6f')]=_0x51474c[_0x2307('0x6b')]({'plain':!![]});interaction_log[_0x2307('0x70')](_0x2307('0x71'),_0x2e4557[_0x2307('0x57')]['id'],_0x2e4557[_0x2307('0x57')][_0x2307('0x23')],_0x2e4557[_0x2307('0x57')]['role'],_0x284e0b[_0x2307('0x6f')]['id'],_0x2e4557['body']?JSON[_0x2307('0x13')](_0x2e4557['body']):'null');return respondWithRpcPromise(_0x2307('0x72'),'acceptMessage',_0x284e0b);}return null;})[_0x2307('0x10')](function(_0x1c0a05){var _0x31cae5=_0x2307('0x73')+_0x1c0a05[_0x2307('0x16')]['ContactId'];return db['sequelize'][_0x2307('0x29')](_0x31cae5,{'type':db['Sequelize'][_0x2307('0x74')]['SELECT'],'raw':!![]})[_0x2307('0x10')](function(_0x4b5fb8){return _0x4b5fb8;});})[_0x2307('0x10')](function(_0x57818e){if(_0x57818e){_0x284e0b[_0x2307('0x16')][_0x2307('0x75')]=_0x57818e[0x0];if(!_0x2e4557['body'][_0x2307('0x69')])return;return db['User'][_0x2307('0x40')]({'where':{'id':_0x2e4557[_0x2307('0x42')][_0x2307('0x69')],'role':_0x2307('0x6a')},'attributes':['id',_0x2307('0x23'),_0x2307('0x76'),_0x2307('0x77'),_0x2307('0x78')],'raw':!![]});}return null;})[_0x2307('0x10')](function(_0x4f15d2){if(!_0x4f15d2)return null;_0x284e0b['message']['agent']=_0x4f15d2;return _0x284e0b;})[_0x2307('0x10')](function(_0xed1078){if(_0xed1078){if(_0x2e4557[_0x2307('0x42')]['manual']){_0x284e0b[_0x2307('0x16')][_0x2307('0x79')]=util[_0x2307('0x68')](_0x2307('0x7a'),_0x2e4557[_0x2307('0x57')]['name']);_0x284e0b['message'][_0x2307('0x7b')]=_0x284e0b[_0x2307('0x7b')];_0x284e0b[_0x2307('0x16')][_0x2307('0x7c')]=_0x284e0b[_0x2307('0x7b')];_0x284e0b[_0x2307('0x16')]['event']=_0x2307('0x64');_0x284e0b[_0x2307('0x16')][_0x2307('0x42')]=htmlToText['fromString'](_0x284e0b[_0x2307('0x16')][_0x2307('0x42')]);return respondWithRpcPromise(_0x2307('0x7d'),_0x2307('0x7d'),{'event':_0x2307('0x7e'),'message':_0x284e0b[_0x2307('0x16')]},client9002)[_0x2307('0x10')](function(){return _0x284e0b;});}return _0x284e0b;}return null;})[_0x2307('0x10')](respondWithResult(_0x2e4c61,null))[_0x2307('0x41')](handleError(_0x2e4c61,null));};exports['reject']=function(_0x55eba6,_0x1cffa2){var _0x472bad={'agent':{},'channel':_0x2307('0x65')};if(_0x55eba6[_0x2307('0x42')]['id']){delete _0x55eba6[_0x2307('0x42')]['id'];}_0x55eba6['body'][_0x2307('0x69')]=_0x55eba6[_0x2307('0x42')]['UserId']||_0x55eba6[_0x2307('0x57')]['id'];_0x472bad[_0x2307('0x6a')]['id']=_0x55eba6['body'][_0x2307('0x69')];return db['MailMessage'][_0x2307('0x40')]({'where':{'id':_0x55eba6[_0x2307('0x3e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1cffa2,null))[_0x2307('0x10')](function(_0x1a0e98){if(_0x1a0e98){_0x472bad[_0x2307('0x16')]=_0x1a0e98['get']({'plain':!![]});return db[_0x2307('0x6c')][_0x2307('0x40')]({'where':{'id':_0x1a0e98[_0x2307('0x6d')]}});}return null;})[_0x2307('0x10')](handleEntityNotFound(_0x1cffa2,null))['then'](function(_0x25e3db){if(_0x25e3db){_0x472bad['interaction']=_0x25e3db[_0x2307('0x6b')]({'plain':!![]});interaction_log[_0x2307('0x70')](_0x2307('0x7f'),_0x55eba6[_0x2307('0x57')]['id'],_0x55eba6[_0x2307('0x57')][_0x2307('0x23')],_0x55eba6['user'][_0x2307('0x80')],_0x472bad[_0x2307('0x6f')]['id'],_0x55eba6[_0x2307('0x42')]?JSON[_0x2307('0x13')](_0x55eba6['body']):_0x2307('0x81'));return respondWithRpcPromise(_0x2307('0x82'),_0x2307('0x83'),_0x472bad);}return null;})['then'](function(_0x3007ee){var _0x4d0b02=_0x2307('0x73')+_0x3007ee[_0x2307('0x16')][_0x2307('0x84')];return db[_0x2307('0x85')][_0x2307('0x29')](_0x4d0b02,{'type':db['Sequelize'][_0x2307('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x3aa93e){return _0x3aa93e;});})[_0x2307('0x10')](function(_0x21fdaa){if(_0x21fdaa){_0x472bad[_0x2307('0x16')][_0x2307('0x75')]=_0x21fdaa[0x0];if(!_0x55eba6[_0x2307('0x42')][_0x2307('0x69')])return;return db[_0x2307('0x86')][_0x2307('0x40')]({'where':{'id':_0x55eba6[_0x2307('0x42')][_0x2307('0x69')],'role':'agent'},'attributes':['id',_0x2307('0x23'),'fullname',_0x2307('0x77'),_0x2307('0x78')],'raw':!![]});}return null;})[_0x2307('0x10')](function(_0x19c0ee){if(!_0x19c0ee)return null;_0x472bad[_0x2307('0x16')]['agent']=_0x19c0ee;return _0x472bad;})[_0x2307('0x10')](function(_0x5840f4){if(_0x5840f4){_0x5840f4[_0x2307('0x16')][_0x2307('0x79')]=util['format'](_0x2307('0x7a'),_0x55eba6['user']['name']);_0x5840f4[_0x2307('0x16')][_0x2307('0x7b')]=_0x472bad['channel'];_0x5840f4[_0x2307('0x16')]['motionChannel']=_0x472bad[_0x2307('0x7b')];_0x5840f4[_0x2307('0x16')]['event']=_0x2307('0x87');_0x5840f4['message'][_0x2307('0x42')]=htmlToText[_0x2307('0x88')](_0x472bad[_0x2307('0x16')]['body']);respondWithRpcPromise(_0x2307('0x7d'),_0x2307('0x7d'),{'event':'rejectmessage','message':_0x5840f4[_0x2307('0x16')]},client9002);return _0x472bad;}return null;})[_0x2307('0x10')](respondWithResult(_0x1cffa2,null))[_0x2307('0x41')](handleError(_0x1cffa2,null));};exports[_0x2307('0x89')]=function(_0x189448,_0x3132ca){var _0x4d04e3=moment()['unix']()['toString']();var _0x201bb4=path['join'](config[_0x2307('0x5b')],'server',_0x2307('0x8a'),'tmp');var _0x2ba794=path[_0x2307('0x5a')](config[_0x2307('0x5b')],_0x2307('0x8b'),_0x2307('0x8a'),_0x2307('0x59'));var _0x514018=util['format'](_0x2307('0x8c'),_0x4d04e3);return db[_0x2307('0x27')]['find']({'where':{'id':_0x189448[_0x2307('0x3e')]['id']},'attributes':['id',_0x2307('0x42'),'from','to','cc','bcc','subject',_0x2307('0x8d')],'include':_0x189448['query'][_0x2307('0x59')]?[{'model':db[_0x2307('0x8e')],'as':'Attachments'}]:undefined})[_0x2307('0x10')](handleEntityNotFound(_0x3132ca,null))[_0x2307('0x10')](function(_0xd6f030){if(_0xd6f030){var _0x29f848=_0xd6f030;var _0x42d62e={'from':_0x29f848['from'],'to':_0x29f848['to'],'subject':_0x29f848[_0x2307('0x8f')],'html':htmlEntities['decode'](_0x29f848['body']),'headers':{'Date':moment(_0x29f848['createdAt'])[_0x2307('0x68')](_0x2307('0x90'))},'attachments':[]};if(_0xd6f030['cc']){_0x42d62e[_0x2307('0x91')]['Cc']=_0xd6f030['cc'];}if(_0xd6f030['bcc']){_0x42d62e[_0x2307('0x91')][_0x2307('0x92')]=_0xd6f030['bcc'];}return new BPromise(function(_0x221df3,_0x56238b){if(_0xd6f030[_0x2307('0x93')]){for(var _0x29a803=0x0;_0x29a803<_0xd6f030[_0x2307('0x93')][_0x2307('0x2f')];_0x29a803++){var _0xdf56b4=_0xd6f030[_0x2307('0x93')][_0x29a803];var _0x4440c2=path[_0x2307('0x5a')](_0x2ba794,_0xdf56b4[_0x2307('0x5d')]);if(fs[_0x2307('0x94')](_0x4440c2)){_0x42d62e[_0x2307('0x59')][_0x2307('0x95')]({'name':_0xdf56b4[_0x2307('0x23')],'contentType':_0xdf56b4[_0x2307('0x37')],'data':fs['readFileSync'](_0x4440c2)});}}}emlformat['build'](_0x42d62e,function(_0x5a2d80,_0x3351e6){if(_0x5a2d80)return _0x56238b(_0x5a2d80);fs[_0x2307('0x96')](path[_0x2307('0x5a')](_0x201bb4,_0x514018),_0x3351e6);return _0x221df3(_0x3351e6);});});}})[_0x2307('0x10')](function(_0x2bf94a){if(_0x2bf94a){return _0x3132ca[_0x2307('0x89')](path['join'](_0x201bb4,_0x514018),_0x514018,function(_0x570a77){if(!_0x570a77)fs['unlinkSync'](path[_0x2307('0x5a')](_0x201bb4,_0x514018));});}})[_0x2307('0x41')](handleError(_0x3132ca,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5c88d6b..550b8a1 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 _0x64f8=['emit','hasOwnProperty','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x86f969,_0x31562d){var _0x528de6=function(_0x39f024){while(--_0x39f024){_0x86f969['push'](_0x86f969['shift']());}};_0x528de6(++_0x31562d);}(_0x64f8,0xd2));var _0x864f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64f8[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x864f('0x0'));var MailMessage=require(_0x864f('0x1'))['db'][_0x864f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x864f('0x3')](0x0);var events={'afterCreate':_0x864f('0x4'),'afterUpdate':_0x864f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x245531){return function(_0x2ec13b,_0x2b6ebd,_0x23a793){MailMessageEvents[_0x864f('0x6')](_0x245531+':'+_0x2ec13b['id'],_0x2ec13b);MailMessageEvents[_0x864f('0x6')](_0x245531,_0x2ec13b);_0x23a793(null);};}for(var e in events){if(events[_0x864f('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x4345=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x3e2dce,_0x57430d){var _0x66a34a=function(_0x2010ac){while(--_0x2010ac){_0x3e2dce['push'](_0x3e2dce['shift']());}};_0x66a34a(++_0x57430d);}(_0x4345,0x1b5));var _0x5434=function(_0x3bc5c8,_0x16e06d){_0x3bc5c8=_0x3bc5c8-0x0;var _0x40819f=_0x4345[_0x3bc5c8];return _0x40819f;};'use strict';var EventEmitter=require(_0x5434('0x0'));var MailMessage=require(_0x5434('0x1'))['db'][_0x5434('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5434('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5434('0x4')};function emitEvent(_0x42e275){return function(_0x24ce10,_0x391049,_0x133911){MailMessageEvents[_0x5434('0x5')](_0x42e275+':'+_0x24ce10['id'],_0x24ce10);MailMessageEvents[_0x5434('0x5')](_0x42e275,_0x24ce10);_0x133911(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5434('0x6')](e,emitEvent(event));}}module[_0x5434('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 d24bd08..ea5a94d 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 _0x2d2c=['../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf'];(function(_0x236ebb,_0x21da6d){var _0x38a7fb=function(_0x669ef6){while(--_0x669ef6){_0x236ebb['push'](_0x236ebb['shift']());}};_0x38a7fb(++_0x21da6d);}(_0x2d2c,0xd5));var _0xc2d2=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0x2d2c[_0x3b0d98];return _0x296885;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var logger=require(_0xc2d2('0x2'))(_0xc2d2('0x3'));var moment=require(_0xc2d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xc2d2('0x5'));var htmlToText=require(_0xc2d2('0x6'));var fs=require('fs');var path=require(_0xc2d2('0x7'));var rimraf=require(_0xc2d2('0x8'));var config=require(_0xc2d2('0x9'));var attributes=require('./mailMessage.attributes');module[_0xc2d2('0xa')]=function(_0x5b43e7,_0x427e7c){return _0x5b43e7[_0xc2d2('0xb')](_0xc2d2('0xc'),attributes,{'tableName':_0xc2d2('0xd'),'paranoid':![],'indexes':[{'name':_0xc2d2('0xe'),'fields':['messageId']},{'name':_0xc2d2('0xf'),'fields':[_0xc2d2('0x10'),'subject'],'type':_0xc2d2('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3aff92,_0x4e6236,_0x11b21e){if(_0x3aff92[_0xc2d2('0x12')]){_0x3aff92[_0xc2d2('0x10')]=htmlToText['fromString'](_0x3aff92[_0xc2d2('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x11b21e(null,_0x4e6236);},'afterCreate':function(_0x1bafaf,_0x54f2d5,_0x5b3702){var _0xdc187f=_0x5b43e7[_0xc2d2('0x13')];var _0x3e4c62=_0x1bafaf[_0xc2d2('0x14')]({'plain':!![]});if(_0x3e4c62[_0xc2d2('0x15')][_0xc2d2('0x16')]()==='in'||_0x3e4c62[_0xc2d2('0x15')]['toLowerCase']()===_0xc2d2('0x17')&&!_0x3e4c62[_0xc2d2('0x18')]&&!_[_0xc2d2('0x19')](_0x3e4c62[_0xc2d2('0x1a')])){_0xdc187f[_0xc2d2('0x1b')][_0xc2d2('0x1c')]({'where':{'id':_0x3e4c62[_0xc2d2('0x1d')]}})[_0xc2d2('0x1e')](function(_0x619c83){if(_0x619c83){_0x619c83[_0xc2d2('0x1f')]({'lastMsgAt':_0x3e4c62[_0xc2d2('0x20')],'lastMsgDirection':_0x3e4c62[_0xc2d2('0x15')][_0xc2d2('0x16')]()});}})[_0xc2d2('0x21')](function(_0x18be8b){console[_0xc2d2('0x22')](_0x18be8b);});}_0x5b3702();}},'charset':_0xc2d2('0x23'),'collate':_0xc2d2('0x24')});}; \ No newline at end of file +var _0x5e39=['define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','html-to-text','./mailMessage.attributes'];(function(_0x2b7442,_0x561591){var _0x56e035=function(_0x42e09d){while(--_0x42e09d){_0x2b7442['push'](_0x2b7442['shift']());}};_0x56e035(++_0x561591);}(_0x5e39,0x1a7));var _0x95e3=function(_0x1315b9,_0x1131ca){_0x1315b9=_0x1315b9-0x0;var _0x4d81aa=_0x5e39[_0x1315b9];return _0x4d81aa;};'use strict';var _=require('lodash');var util=require(_0x95e3('0x0'));var logger=require(_0x95e3('0x1'))('api');var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var rp=require('request-promise');var htmlToText=require(_0x95e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95e3('0x5'));module['exports']=function(_0x10df07,_0x3c4b96){return _0x10df07[_0x95e3('0x6')](_0x95e3('0x7'),attributes,{'tableName':_0x95e3('0x8'),'paranoid':![],'indexes':[{'name':_0x95e3('0x9'),'fields':[_0x95e3('0x9')]},{'name':_0x95e3('0xa'),'fields':['plainBody',_0x95e3('0xb')],'type':_0x95e3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4f5e93,_0x1d959d,_0x405ef1){if(_0x4f5e93[_0x95e3('0xd')]){_0x4f5e93[_0x95e3('0xe')]=htmlToText[_0x95e3('0xf')](_0x4f5e93[_0x95e3('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x405ef1(null,_0x1d959d);},'afterCreate':function(_0x4ed943,_0xab6b5,_0x1127a2){var _0x4be03e=_0x10df07[_0x95e3('0x10')];var _0x38477b=_0x4ed943[_0x95e3('0x11')]({'plain':!![]});if(_0x38477b[_0x95e3('0x12')][_0x95e3('0x13')]()==='in'||_0x38477b[_0x95e3('0x12')]['toLowerCase']()===_0x95e3('0x14')&&!_0x38477b[_0x95e3('0x15')]&&!_[_0x95e3('0x16')](_0x38477b[_0x95e3('0x17')])){_0x4be03e[_0x95e3('0x18')][_0x95e3('0x19')]({'where':{'id':_0x38477b[_0x95e3('0x1a')]}})[_0x95e3('0x1b')](function(_0x5b9d3e){if(_0x5b9d3e){_0x5b9d3e[_0x95e3('0x1c')]({'lastMsgAt':_0x38477b[_0x95e3('0x1d')],'lastMsgDirection':_0x38477b[_0x95e3('0x12')][_0x95e3('0x13')]()});}})[_0x95e3('0x1e')](function(_0x2b26d4){console[_0x95e3('0x1f')](_0x2b26d4);});}_0x1127a2();}},'charset':'utf8mb4','collate':_0x95e3('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 57746f7..d546148 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 _0x6d11=['options','raw','CreateMailMessage','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage','create','body'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x6d11,0xbf));var _0x16d1=function(_0x45aa47,_0x52b536){_0x45aa47=_0x45aa47-0x0;var _0x4ec96a=_0x6d11[_0x45aa47];return _0x4ec96a;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});}exports['CreateMailMessage']=function(_0x52a0f2){var _0x5b9599=this;return new Promise(function(_0x348425,_0x55a0e0){return db[_0x16d1('0x17')][_0x16d1('0x18')](_0x52a0f2[_0x16d1('0x19')],{'raw':_0x52a0f2[_0x16d1('0x1a')]?_0x52a0f2['options'][_0x16d1('0x1b')]===undefined?!![]:![]:!![]})[_0x16d1('0xf')](function(_0x2a897d){logger['info'](_0x16d1('0x1c'),_0x52a0f2);logger[_0x16d1('0x1d')](_0x16d1('0x1c'),_0x52a0f2,JSON[_0x16d1('0x14')](_0x2a897d));_0x348425(_0x2a897d);})[_0x16d1('0x1e')](function(_0x1448b7){logger[_0x16d1('0x15')](_0x16d1('0x1c'),_0x1448b7[_0x16d1('0x16')],_0x52a0f2);_0x55a0e0(_0x5b9599[_0x16d1('0x15')](0x1f4,_0x1448b7[_0x16d1('0x16')]));});});}; \ No newline at end of file +var _0x5fdc=['catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x455afa,_0x235bfc){var _0x46ee43=function(_0x26de4a){while(--_0x26de4a){_0x455afa['push'](_0x455afa['shift']());}};_0x46ee43(++_0x235bfc);}(_0x5fdc,0x127));var _0xc5fd=function(_0x4f6402,_0xad4423){_0x4f6402=_0x4f6402-0x0;var _0x302983=_0x5fdc[_0x4f6402];return _0x302983;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});config[_0xc5fd('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc5fd('0xf'))(new Redis(config[_0xc5fd('0xe')]));require(_0xc5fd('0x10'))[_0xc5fd('0x11')](socket);function respondWithRpcPromise(_0x4e6d35,_0x4e1e94,_0x3442dd){return new BPromise(function(_0x1edeec,_0x39a95a){return client[_0xc5fd('0x12')](_0x4e6d35,_0x3442dd)[_0xc5fd('0x13')](function(_0x368c80){logger['info'](_0xc5fd('0x14'),_0x4e1e94,'request\x20sent');logger['debug'](_0xc5fd('0x15'),_0x4e1e94,_0xc5fd('0x16'),JSON[_0xc5fd('0x17')](_0x368c80));if(_0x368c80[_0xc5fd('0x18')]){if(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x19')]===0x1f4){logger[_0xc5fd('0x18')](_0xc5fd('0x14'),_0x4e1e94,_0x368c80['error'][_0xc5fd('0x1a')]);return _0x39a95a(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x1a')]);}logger[_0xc5fd('0x18')]('MailMessage,\x20%s,\x20%s',_0x4e1e94,_0x368c80['error']['message']);return _0x1edeec(_0x368c80['error']['message']);}else{logger[_0xc5fd('0x1b')](_0xc5fd('0x14'),_0x4e1e94,_0xc5fd('0x16'));_0x1edeec(_0x368c80[_0xc5fd('0x1c')][_0xc5fd('0x1a')]);}})[_0xc5fd('0x1d')](function(_0xfd14c7){logger['error'](_0xc5fd('0x14'),_0x4e1e94,_0xfd14c7);_0x39a95a(_0xfd14c7);});});}exports[_0xc5fd('0x1e')]=function(_0x32eac2){var _0x9c12e4=this;return new Promise(function(_0x3b3093,_0x48024e){return db[_0xc5fd('0x1f')][_0xc5fd('0x20')](_0x32eac2[_0xc5fd('0x21')],{'raw':_0x32eac2[_0xc5fd('0x22')]?_0x32eac2['options']['raw']===undefined?!![]:![]:!![]})[_0xc5fd('0x13')](function(_0x2ab935){logger[_0xc5fd('0x1b')](_0xc5fd('0x1e'),_0x32eac2);logger[_0xc5fd('0x23')](_0xc5fd('0x1e'),_0x32eac2,JSON['stringify'](_0x2ab935));_0x3b3093(_0x2ab935);})[_0xc5fd('0x1d')](function(_0x2701f7){logger[_0xc5fd('0x18')](_0xc5fd('0x1e'),_0x2701f7[_0xc5fd('0x1a')],_0x32eac2);_0x48024e(_0x9c12e4[_0xc5fd('0x18')](0x1f4,_0x2701f7[_0xc5fd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index fd96c0d..8939384 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 _0x4731=['removeListener','register','length','./mailMessage.events','save','remove','update'];(function(_0x3e3f27,_0x2c2ecf){var _0x15c868=function(_0x4b348d){while(--_0x4b348d){_0x3e3f27['push'](_0x3e3f27['shift']());}};_0x15c868(++_0x2c2ecf);}(_0x4731,0xce));var _0x1473=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4731[_0x1477ef];return _0x164acd;};'use strict';var MailMessageEvents=require(_0x1473('0x0'));var events=[_0x1473('0x1'),_0x1473('0x2'),_0x1473('0x3')];function createListener(_0x300551,_0x4d6703){return function(_0x1b0c96){_0x4d6703['emit'](_0x300551,_0x1b0c96);};}function removeListener(_0x4f1546,_0x1397d7){return function(){MailMessageEvents[_0x1473('0x4')](_0x4f1546,_0x1397d7);};}exports[_0x1473('0x5')]=function(_0x5e609a){for(var _0x169ee1=0x0,_0x2c210a=events[_0x1473('0x6')];_0x169ee1<_0x2c210a;_0x169ee1++){var _0x6f4474=events[_0x169ee1];var _0x332abb=createListener('mailMessage:'+_0x6f4474,_0x5e609a);MailMessageEvents['on'](_0x6f4474,_0x332abb);}}; \ No newline at end of file +var _0x3f0a=['length','mailMessage:','remove','register'];(function(_0xc0eeb2,_0x350fd5){var _0x3ce561=function(_0x18f5cd){while(--_0x18f5cd){_0xc0eeb2['push'](_0xc0eeb2['shift']());}};_0x3ce561(++_0x350fd5);}(_0x3f0a,0x19a));var _0xa3f0=function(_0x5dcf1f,_0x2b1a7d){_0x5dcf1f=_0x5dcf1f-0x0;var _0x1878c8=_0x3f0a[_0x5dcf1f];return _0x1878c8;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xa3f0('0x0'),'update'];function createListener(_0x51454d,_0x5a7ca7){return function(_0x51a26a){_0x5a7ca7['emit'](_0x51454d,_0x51a26a);};}function removeListener(_0x4073d7,_0x22bd74){return function(){MailMessageEvents['removeListener'](_0x4073d7,_0x22bd74);};}exports[_0xa3f0('0x1')]=function(_0x517775){for(var _0x417bda=0x0,_0x3632ba=events[_0xa3f0('0x2')];_0x417bda<_0x3632ba;_0x417bda++){var _0x1b3b55=events[_0x417bda];var _0x2b1d06=createListener(_0xa3f0('0x3')+_0x1b3b55,_0x517775);MailMessageEvents['on'](_0x1b3b55,_0x2b1d06);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 46fecc2..1061c09 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 _0xc143=['/:id/users','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','index','/describe','describe','isAuthenticated','show','/:id/members','getMembers','get','getTeams','getAgents','post','addTeams'];(function(_0xe574c7,_0x2e5a2d){var _0x59d1db=function(_0x710b09){while(--_0x710b09){_0xe574c7['push'](_0xe574c7['shift']());}};_0x59d1db(++_0x2e5a2d);}(_0xc143,0x1ea));var _0x3c14=function(_0x3d722d,_0x157e44){_0x3d722d=_0x3d722d-0x0;var _0x4b3365=_0xc143[_0x3d722d];return _0x4b3365;};'use strict';var multer=require(_0x3c14('0x0'));var util=require('util');var path=require(_0x3c14('0x1'));var timeout=require(_0x3c14('0x2'));var express=require('express');var router=express[_0x3c14('0x3')]();var fs_extra=require(_0x3c14('0x4'));var auth=require(_0x3c14('0x5'));var interaction=require(_0x3c14('0x6'));var config=require('../../config/environment');var controller=require(_0x3c14('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3c14('0x8')]);router['get'](_0x3c14('0x9'),auth['isAuthenticated'](),controller[_0x3c14('0xa')]);router['get']('/:id',auth[_0x3c14('0xb')](),controller[_0x3c14('0xc')]);router['get'](_0x3c14('0xd'),auth[_0x3c14('0xb')](),controller[_0x3c14('0xe')]);router[_0x3c14('0xf')]('/:id/teams',auth[_0x3c14('0xb')](),controller[_0x3c14('0x10')]);router[_0x3c14('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0x3c14('0x11')]);router[_0x3c14('0x12')]('/',auth[_0x3c14('0xb')](),controller['create']);router[_0x3c14('0x12')]('/:id/teams',auth[_0x3c14('0xb')](),controller[_0x3c14('0x13')]);router['post'](_0x3c14('0x14'),auth[_0x3c14('0xb')](),controller[_0x3c14('0x15')]);router[_0x3c14('0x16')](_0x3c14('0x17'),auth[_0x3c14('0xb')](),controller['update']);router[_0x3c14('0x18')](_0x3c14('0x17'),auth['isAuthenticated'](),controller[_0x3c14('0x19')]);router[_0x3c14('0x18')](_0x3c14('0x1a'),auth[_0x3c14('0xb')](),controller[_0x3c14('0x1b')]);router['delete'](_0x3c14('0x14'),auth[_0x3c14('0xb')](),controller[_0x3c14('0x1c')]);module[_0x3c14('0x1d')]=router; \ No newline at end of file +var _0x9e82=['getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members'];(function(_0x3207ae,_0x31234d){var _0xbd7e59=function(_0x31573a){while(--_0x31573a){_0x3207ae['push'](_0x3207ae['shift']());}};_0xbd7e59(++_0x31234d);}(_0x9e82,0xae));var _0x29e8=function(_0x306cb2,_0x4b15e9){_0x306cb2=_0x306cb2-0x0;var _0x5e3086=_0x9e82[_0x306cb2];return _0x5e3086;};'use strict';var multer=require(_0x29e8('0x0'));var util=require(_0x29e8('0x1'));var path=require(_0x29e8('0x2'));var timeout=require(_0x29e8('0x3'));var express=require(_0x29e8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x29e8('0x5'));var interaction=require(_0x29e8('0x6'));var config=require(_0x29e8('0x7'));var controller=require(_0x29e8('0x8'));router[_0x29e8('0x9')]('/',auth[_0x29e8('0xa')](),controller['index']);router[_0x29e8('0x9')](_0x29e8('0xb'),auth[_0x29e8('0xa')](),controller[_0x29e8('0xc')]);router['get'](_0x29e8('0xd'),auth[_0x29e8('0xa')](),controller['show']);router[_0x29e8('0x9')](_0x29e8('0xe'),auth[_0x29e8('0xa')](),controller[_0x29e8('0xf')]);router[_0x29e8('0x9')](_0x29e8('0x10'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x11')]);router[_0x29e8('0x9')]('/:id/users',auth[_0x29e8('0xa')](),controller[_0x29e8('0x12')]);router['post']('/',auth[_0x29e8('0xa')](),controller[_0x29e8('0x13')]);router[_0x29e8('0x14')](_0x29e8('0x10'),auth['isAuthenticated'](),controller[_0x29e8('0x15')]);router['post'](_0x29e8('0x16'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x17')]);router['put'](_0x29e8('0xd'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x18')]);router[_0x29e8('0x19')](_0x29e8('0xd'),auth['isAuthenticated'](),controller[_0x29e8('0x1a')]);router[_0x29e8('0x19')]('/:id/teams',auth[_0x29e8('0xa')](),controller['removeTeams']);router['delete'](_0x29e8('0x16'),auth[_0x29e8('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 99c7018..3840369 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 _0x8abb=['ENUM','rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0x1461ec,_0x68a535){var _0x1c822d=function(_0x34fdc0){while(--_0x34fdc0){_0x1461ec['push'](_0x1461ec['shift']());}};_0x1c822d(++_0x68a535);}(_0x8abb,0x1ca));var _0xb8ab=function(_0x5bcbc7,_0x22253e){_0x5bcbc7=_0x5bcbc7-0x0;var _0x18c65b=_0x8abb[_0x5bcbc7];return _0x18c65b;};'use strict';var Sequelize=require('sequelize');module[_0xb8ab('0x0')]={'name':{'type':Sequelize[_0xb8ab('0x1')],'unique':_0xb8ab('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb8ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb8ab('0x4')](_0xb8ab('0x5'),_0xb8ab('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xae6f=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xae6f,0x15f));var _0xfae6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xae6f[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require(_0xfae6('0x0'));module[_0xfae6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfae6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfae6('0x3')]},'timeout':{'type':Sequelize[_0xfae6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfae6('0x5')](_0xfae6('0x6'),_0xfae6('0x7'),_0xfae6('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c37d0cd..f499f1d 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 _0x024a=['set','reject','update','then','get','MailQueues','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','MailQueue','findAll','rows','catch','params','fields','length','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','destroy','getMembers','UserMailQueue','order','MailQueueId','findAndCountAll','UserId','agent','mailPause','updatedAt','format','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','value','removeTeams','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x024a,0x17f));var _0xa024=function(_0x4f6ea2,_0xb5a2d){_0x4f6ea2=_0x4f6ea2-0x0;var _0x58c868=_0x024a[_0x4f6ea2];return _0x58c868;};'use strict';var emlformat=require(_0xa024('0x0'));var rimraf=require(_0xa024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa024('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa024('0x3'));var util=require(_0xa024('0x4'));var path=require(_0xa024('0x5'));var sox=require('sox');var csv=require(_0xa024('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa024('0x7'));var _=require(_0xa024('0x8'));var squel=require('squel');var crypto=require(_0xa024('0x9'));var jsforce=require(_0xa024('0xa'));var deskjs=require(_0xa024('0xb'));var toCsv=require(_0xa024('0x6'));var querystring=require(_0xa024('0xc'));var Papa=require(_0xa024('0xd'));var Redis=require(_0xa024('0xe'));var authService=require(_0xa024('0xf'));var qs=require(_0xa024('0x10'));var as=require(_0xa024('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa024('0x12'))('api');var utils=require(_0xa024('0x13'));var config=require(_0xa024('0x14'));var licenseUtil=require(_0xa024('0x15'));var db=require(_0xa024('0x16'))['db'];config[_0xa024('0x17')]=_[_0xa024('0x18')](config[_0xa024('0x17')],{'host':_0xa024('0x19'),'port':0x18eb});var socket=require(_0xa024('0x1a'))(new Redis(config[_0xa024('0x17')]));require(_0xa024('0x1b'))[_0xa024('0x1c')](socket);function respondWithStatusCode(_0x26fb15,_0x4e109d){_0x4e109d=_0x4e109d||0xcc;return function(_0x1336e8){if(_0x1336e8){return _0x26fb15[_0xa024('0x1d')](_0x4e109d);}return _0x26fb15[_0xa024('0x1e')](_0x4e109d)[_0xa024('0x1f')]();};}function respondWithResult(_0xae6ca6,_0x356936){_0x356936=_0x356936||0xc8;return function(_0x7446bf){if(_0x7446bf){return _0xae6ca6[_0xa024('0x1e')](_0x356936)[_0xa024('0x20')](_0x7446bf);}};}function respondWithFilteredResult(_0x36f791,_0x1584c6){return function(_0x88b88a){if(_0x88b88a){var _0x2c8b4=typeof _0x1584c6[_0xa024('0x21')]===_0xa024('0x22')&&typeof _0x1584c6[_0xa024('0x23')]===_0xa024('0x22');var _0x13e7ba=_0x88b88a[_0xa024('0x24')];var _0x162e72=_0x2c8b4?0x0:_0x1584c6['offset'];var _0x325b4f=_0x2c8b4?_0x88b88a[_0xa024('0x24')]:_0x1584c6[_0xa024('0x21')]+_0x1584c6[_0xa024('0x23')];var _0x2acf6a;if(_0x325b4f>=_0x13e7ba){_0x325b4f=_0x13e7ba;_0x2acf6a=0xc8;}else{_0x2acf6a=0xce;}_0x36f791[_0xa024('0x1e')](_0x2acf6a);return _0x36f791[_0xa024('0x25')]('Content-Range',_0x162e72+'-'+_0x325b4f+'/'+_0x13e7ba)[_0xa024('0x20')](_0x88b88a);}return null;};}function patchUpdates(_0x83213c){return function(_0x2ccd60){try{jsonpatch['apply'](_0x2ccd60,_0x83213c,!![]);}catch(_0x5d28b9){return BPromise[_0xa024('0x26')](_0x5d28b9);}return _0x2ccd60['save']();};}function saveUpdates(_0x3f098e,_0x2ee7e5){return function(_0x363659){if(_0x363659){return _0x363659[_0xa024('0x27')](_0x3f098e)[_0xa024('0x28')](function(_0x496eb8){return _0x496eb8;});}return null;};}function removeEntity(_0x357abb,_0x80c6ea){return function(_0x4262a3){if(_0x4262a3){return _0x4262a3['destroy']()['then'](function(){var _0x4302dc=_0x4262a3[_0xa024('0x29')]({'plain':!![]});var _0xb7955f=_0xa024('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0xb7955f,'resourceId':_0x4302dc['id']}})[_0xa024('0x28')](function(){return _0x4262a3;});})['then'](function(){_0x357abb[_0xa024('0x1e')](0xcc)[_0xa024('0x1f')]();});}};}function handleEntityNotFound(_0x27f0ff,_0x214a2d){return function(_0x36e61f){if(!_0x36e61f){_0x27f0ff[_0xa024('0x1d')](0x194);}return _0x36e61f;};}function handleError(_0x54b55b,_0x513600){_0x513600=_0x513600||0x1f4;return function(_0x569d20){logger[_0xa024('0x2b')](_0x569d20[_0xa024('0x2c')]);if(_0x569d20[_0xa024('0x2d')]){delete _0x569d20[_0xa024('0x2d')];}_0x54b55b['status'](_0x513600)[_0xa024('0x2e')](_0x569d20);};}exports['index']=function(_0x3cd206,_0x43583d){var _0x34dfe7={},_0x18066a={},_0x184cb6={'count':0x0,'rows':[]};var _0x41b62c=_[_0xa024('0x2f')](db['MailQueue'][_0xa024('0x30')],function(_0xe2e512){return{'name':_0xe2e512[_0xa024('0x31')],'type':_0xe2e512[_0xa024('0x32')][_0xa024('0x33')]};});_0x18066a['model']=_[_0xa024('0x2f')](_0x41b62c,_0xa024('0x2d'));_0x18066a['query']=_[_0xa024('0x34')](_0x3cd206[_0xa024('0x35')]);_0x18066a[_0xa024('0x36')]=_[_0xa024('0x37')](_0x18066a[_0xa024('0x38')],_0x18066a['query']);_0x34dfe7['attributes']=_[_0xa024('0x37')](_0x18066a[_0xa024('0x38')],qs['fields'](_0x3cd206[_0xa024('0x35')]['fields']));_0x34dfe7[_0xa024('0x39')]=_0x34dfe7[_0xa024('0x39')]['length']?_0x34dfe7[_0xa024('0x39')]:_0x18066a[_0xa024('0x38')];if(!_0x3cd206[_0xa024('0x35')][_0xa024('0x3a')](_0xa024('0x3b'))){_0x34dfe7[_0xa024('0x23')]=qs[_0xa024('0x23')](_0x3cd206['query']['limit']);_0x34dfe7['offset']=qs['offset'](_0x3cd206['query'][_0xa024('0x21')]);}_0x34dfe7['order']=qs[_0xa024('0x3c')](_0x3cd206[_0xa024('0x35')][_0xa024('0x3c')]);_0x34dfe7['where']=qs['filters'](_[_0xa024('0x3d')](_0x3cd206[_0xa024('0x35')],_0x18066a[_0xa024('0x36')]),_0x41b62c);if(_0x3cd206[_0xa024('0x35')][_0xa024('0x3e')]){_0x34dfe7[_0xa024('0x3f')]=_[_0xa024('0x40')](_0x34dfe7['where'],{'$or':_[_0xa024('0x2f')](_0x41b62c,function(_0x38f6b9){if(_0x38f6b9[_0xa024('0x32')]!==_0xa024('0x41')){var _0x3b17fa={};_0x3b17fa[_0x38f6b9[_0xa024('0x2d')]]={'$like':'%'+_0x3cd206[_0xa024('0x35')][_0xa024('0x3e')]+'%'};return _0x3b17fa;}})});}_0x34dfe7=_[_0xa024('0x40')]({},_0x34dfe7,_0x3cd206[_0xa024('0x42')]);var _0x6cb096={'where':_0x34dfe7[_0xa024('0x3f')]};return db['MailQueue'][_0xa024('0x24')](_0x6cb096)[_0xa024('0x28')](function(_0x26fa6e){_0x184cb6['count']=_0x26fa6e;if(_0x3cd206['query'][_0xa024('0x43')]){_0x34dfe7['include']=[{'all':!![]}];}return db[_0xa024('0x44')][_0xa024('0x45')](_0x34dfe7);})[_0xa024('0x28')](function(_0x249192){_0x184cb6[_0xa024('0x46')]=_0x249192;return _0x184cb6;})[_0xa024('0x28')](respondWithFilteredResult(_0x43583d,_0x34dfe7))[_0xa024('0x47')](handleError(_0x43583d,null));};exports['show']=function(_0xc99e45,_0x337638){var _0x269f18={'raw':!![],'where':{'id':_0xc99e45[_0xa024('0x48')]['id']}},_0x4e5ee1={};_0x4e5ee1[_0xa024('0x38')]=_[_0xa024('0x34')](db[_0xa024('0x44')][_0xa024('0x30')]);_0x4e5ee1[_0xa024('0x35')]=_['keys'](_0xc99e45[_0xa024('0x35')]);_0x4e5ee1[_0xa024('0x36')]=_[_0xa024('0x37')](_0x4e5ee1[_0xa024('0x38')],_0x4e5ee1[_0xa024('0x35')]);_0x269f18[_0xa024('0x39')]=_[_0xa024('0x37')](_0x4e5ee1[_0xa024('0x38')],qs[_0xa024('0x49')](_0xc99e45['query']['fields']));_0x269f18[_0xa024('0x39')]=_0x269f18[_0xa024('0x39')][_0xa024('0x4a')]?_0x269f18['attributes']:_0x4e5ee1['model'];if(_0xc99e45[_0xa024('0x35')]['includeAll']){_0x269f18['include']=[{'all':!![]}];}_0x269f18=_[_0xa024('0x40')]({},_0x269f18,_0xc99e45[_0xa024('0x42')]);return db['MailQueue'][_0xa024('0x4b')](_0x269f18)[_0xa024('0x28')](handleEntityNotFound(_0x337638,null))[_0xa024('0x28')](respondWithResult(_0x337638,null))[_0xa024('0x47')](handleError(_0x337638,null));};exports[_0xa024('0x4c')]=function(_0x35cd4a,_0x19d8f9){return db['MailQueue']['create'](_0x35cd4a[_0xa024('0x4d')],{})['then'](function(_0x3cb132){var _0x38e6b6=_0x35cd4a[_0xa024('0x4e')]['get']({'plain':!![]});if(!_0x38e6b6)throw new Error(_0xa024('0x4f'));if(_0x38e6b6[_0xa024('0x50')]===_0xa024('0x4e')){var _0x5eff09=_0x3cb132[_0xa024('0x29')]({'plain':!![]});var _0x262486='MailQueues';return db[_0xa024('0x51')]['find']({'where':{'name':_0x262486,'userProfileId':_0x38e6b6[_0xa024('0x52')]},'raw':!![]})[_0xa024('0x28')](function(_0x285419){if(_0x285419&&_0x285419[_0xa024('0x53')]===0x0){return db['UserProfileResource'][_0xa024('0x4c')]({'name':_0x5eff09[_0xa024('0x2d')],'resourceId':_0x5eff09['id'],'type':_0x285419[_0xa024('0x2d')],'sectionId':_0x285419['id']},{})[_0xa024('0x28')](function(){return _0x3cb132;});}else{return _0x3cb132;}})[_0xa024('0x47')](function(_0xa2ecee){logger[_0xa024('0x2b')](_0xa024('0x54'),_0xa2ecee);throw _0xa2ecee;});}return _0x3cb132;})[_0xa024('0x28')](respondWithResult(_0x19d8f9,0xc9))['catch'](handleError(_0x19d8f9,null));};exports['update']=function(_0x19170c,_0x4de68d){if(_0x19170c[_0xa024('0x4d')]['id']){delete _0x19170c[_0xa024('0x4d')]['id'];}return db['MailQueue'][_0xa024('0x4b')]({'where':{'id':_0x19170c[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x4de68d,null))[_0xa024('0x28')](saveUpdates(_0x19170c[_0xa024('0x4d')],null))[_0xa024('0x28')](respondWithResult(_0x4de68d,null))[_0xa024('0x47')](handleError(_0x4de68d,null));};exports[_0xa024('0x55')]=function(_0x20d9bd,_0x2149b3){return db[_0xa024('0x44')][_0xa024('0x4b')]({'where':{'id':_0x20d9bd[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x2149b3,null))[_0xa024('0x28')](removeEntity(_0x2149b3,null))[_0xa024('0x47')](handleError(_0x2149b3,null));};exports['describe']=function(_0x4a5265,_0x337b41){return db[_0xa024('0x44')]['describe']()['then'](respondWithResult(_0x337b41,null))[_0xa024('0x47')](handleError(_0x337b41,null));};exports[_0xa024('0x56')]=function(_0x18d408,_0x32498d,_0x1214d0){var _0xfdadfd={'raw':!![],'where':{}},_0x1bf985={},_0x362e5f;return db[_0xa024('0x44')]['findOne']({'where':{'id':_0x18d408[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x32498d,null))[_0xa024('0x28')](function(_0x7cfb44){if(_0x7cfb44){_0x362e5f=_0x7cfb44['get']({'plain':!![]});_0x1bf985[_0xa024('0x38')]=_[_0xa024('0x34')](db[_0xa024('0x57')]['rawAttributes']);_0x1bf985[_0xa024('0x35')]=_[_0xa024('0x34')](_0x18d408[_0xa024('0x35')]);_0x1bf985['filters']=_['intersection'](_0x1bf985['model'],_0x1bf985[_0xa024('0x35')]);_0xfdadfd[_0xa024('0x39')]=_['intersection'](_0x1bf985[_0xa024('0x38')],qs['fields'](_0x18d408[_0xa024('0x35')][_0xa024('0x49')]));_0xfdadfd[_0xa024('0x39')]=_0xfdadfd['attributes'][_0xa024('0x4a')]?_0xfdadfd['attributes']:_0x1bf985[_0xa024('0x38')];if(!_0x18d408[_0xa024('0x35')][_0xa024('0x3a')](_0xa024('0x3b'))){_0xfdadfd['limit']=qs[_0xa024('0x23')](_0x18d408[_0xa024('0x35')][_0xa024('0x23')]);_0xfdadfd[_0xa024('0x21')]=qs[_0xa024('0x21')](_0x18d408[_0xa024('0x35')]['offset']);}_0xfdadfd[_0xa024('0x58')]=qs[_0xa024('0x3c')](_0x18d408[_0xa024('0x35')][_0xa024('0x3c')]);_0xfdadfd[_0xa024('0x3f')]=qs['filters'](_[_0xa024('0x3d')](_0x18d408[_0xa024('0x35')],_0x1bf985['filters']));_0xfdadfd[_0xa024('0x3f')][_0xa024('0x59')]=_0x7cfb44['id'];if(_0x18d408[_0xa024('0x35')][_0xa024('0x3e')]){_0xfdadfd['where']=_[_0xa024('0x40')](_0xfdadfd['where'],{'$or':_['map'](_0xfdadfd[_0xa024('0x39')],function(_0x331fa3){var _0x2a1016={};_0x2a1016[_0x331fa3]={'$like':'%'+_0x18d408[_0xa024('0x35')][_0xa024('0x3e')]+'%'};return _0x2a1016;})});}_0xfdadfd=_[_0xa024('0x40')]({},_0xfdadfd,_0x18d408[_0xa024('0x42')]);return db['UserMailQueue'][_0xa024('0x45')](_0xfdadfd);}})[_0xa024('0x28')](function(_0x26331d){if(_0x26331d){return db['User'][_0xa024('0x5a')]({'where':{'id':_[_0xa024('0x2f')](_0x26331d,_0xa024('0x5b')),'role':_0xa024('0x5c')},'attributes':['id','name',_0xa024('0x5d'),_0xa024('0x5e'),'createdAt']});}})[_0xa024('0x28')](function(_0x4b9e62){if(_0x4b9e62){return{'count':_0x4b9e62[_0xa024('0x24')],'rows':_['map'](_0x4b9e62[_0xa024('0x46')],function(_0x1c4a0){return{'membername':_0x1c4a0['name'],'UserId':_0x1c4a0['id'],'queue_name':_0x362e5f[_0xa024('0x2d')],'MailQueueId':_0x362e5f['id'],'interface':util[_0xa024('0x5f')]('%s/%s',_0xa024('0x60'),_0x1c4a0[_0xa024('0x2d')]),'penalty':0x0,'paused':_0x1c4a0['mailPause'],'createdAt':_0x1c4a0[_0xa024('0x61')],'updatedAt':_0x1c4a0[_0xa024('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa024('0x28')](respondWithFilteredResult(_0x32498d,_0xfdadfd))[_0xa024('0x47')](handleError(_0x32498d,null));};exports[_0xa024('0x62')]=function(_0x5412e8,_0x454b4e,_0x4647fd){var _0x24562c={};var _0x4622f4={};var _0xfd214d;var _0x5c4cde;return db[_0xa024('0x44')][_0xa024('0x63')]({'where':{'id':_0x5412e8[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x454b4e,null))[_0xa024('0x28')](function(_0x8168f5){if(_0x8168f5){_0xfd214d=_0x8168f5;_0x4622f4['model']=_[_0xa024('0x34')](db[_0xa024('0x64')][_0xa024('0x30')]);_0x4622f4['query']=_[_0xa024('0x34')](_0x5412e8['query']);_0x4622f4[_0xa024('0x36')]=_[_0xa024('0x37')](_0x4622f4[_0xa024('0x38')],_0x4622f4[_0xa024('0x35')]);_0x24562c['attributes']=_[_0xa024('0x37')](_0x4622f4[_0xa024('0x38')],qs['fields'](_0x5412e8[_0xa024('0x35')][_0xa024('0x49')]));_0x24562c[_0xa024('0x39')]=_0x24562c[_0xa024('0x39')][_0xa024('0x4a')]?_0x24562c['attributes']:_0x4622f4[_0xa024('0x38')];_0x24562c[_0xa024('0x58')]=qs[_0xa024('0x3c')](_0x5412e8[_0xa024('0x35')]['sort']);_0x24562c[_0xa024('0x3f')]=qs['filters'](_['pick'](_0x5412e8['query'],_0x4622f4[_0xa024('0x36')]));if(_0x5412e8[_0xa024('0x35')]['filter']){_0x24562c[_0xa024('0x3f')]=_[_0xa024('0x40')](_0x24562c[_0xa024('0x3f')],{'$or':_[_0xa024('0x2f')](_0x24562c[_0xa024('0x39')],function(_0x3d5cfc){var _0x1f9e2a={};_0x1f9e2a[_0x3d5cfc]={'$like':'%'+_0x5412e8[_0xa024('0x35')][_0xa024('0x3e')]+'%'};return _0x1f9e2a;})});}_0x24562c=_[_0xa024('0x40')]({},_0x24562c,_0x5412e8[_0xa024('0x42')]);return _0xfd214d[_0xa024('0x62')](_0x24562c);}})['then'](function(_0x3748b5){if(_0x3748b5){_0x5c4cde=_0x3748b5[_0xa024('0x4a')];if(!_0x5412e8[_0xa024('0x35')]['hasOwnProperty'](_0xa024('0x3b'))){_0x24562c[_0xa024('0x23')]=qs[_0xa024('0x23')](_0x5412e8[_0xa024('0x35')][_0xa024('0x23')]);_0x24562c[_0xa024('0x21')]=qs[_0xa024('0x21')](_0x5412e8[_0xa024('0x35')]['offset']);}return _0xfd214d['getTeams'](_0x24562c);}})[_0xa024('0x28')](function(_0x249e4c){if(_0x249e4c){return _0x249e4c?{'count':_0x5c4cde,'rows':_0x249e4c}:null;}})[_0xa024('0x28')](respondWithResult(_0x454b4e,null))[_0xa024('0x47')](handleError(_0x454b4e,null));};exports[_0xa024('0x65')]=function(_0xd3a303,_0x455e37,_0x123431){var _0x18b53b=_0xd3a303[_0xa024('0x4d')][_0xa024('0x66')];return db[_0xa024('0x64')]['findAll']({'where':{'id':_0x18b53b},'attributes':['id'],'include':[{'model':db[_0xa024('0x67')],'as':_0xa024('0x68'),'attributes':['id',_0xa024('0x2d'),_0xa024('0x69'),'voicePause',_0xa024('0x6a')],'raw':!![]}]})[_0xa024('0x28')](function(_0x46c240){if(_0x46c240){var _0x3d020b=_[_0xa024('0x6b')](_0x46c240,function(_0x10d4d6){var _0x4db5a5=_0x10d4d6['get']({'plain':!![]});return _0x4db5a5[_0xa024('0x68')];});return db['MailQueue'][_0xa024('0x4b')]({'where':{'id':_0xd3a303['params']['id']}})[_0xa024('0x28')](function(_0x19e024){return db[_0xa024('0x6c')][_0xa024('0x6d')](function(_0x4a3554){return _0x19e024['addTeams'](_0x18b53b,{'transaction':_0x4a3554})[_0xa024('0x28')](function(){return BPromise[_0xa024('0x6e')](_0x3d020b,function(_0x307893){return db[_0xa024('0x57')][_0xa024('0x6f')]({'where':{'UserId':_0x307893['id'],'MailQueueId':_0xd3a303[_0xa024('0x48')]['id']},'transaction':_0x4a3554});});})['then'](function(){_0x3d020b[_0xa024('0x70')](function(_0x43ed92){socket['emit'](_0xa024('0x71'),{'UserId':_0x43ed92['id'],'MailQueueId':_0x19e024['id']});});});});});}})[_0xa024('0x28')](respondWithStatusCode(_0x455e37,null))[_0xa024('0x47')](handleError(_0x455e37,null));};exports['removeTeams']=function(_0x87e4ef,_0x2596f2,_0x1a9529){return db[_0xa024('0x64')][_0xa024('0x45')]({'where':{'id':_0x87e4ef[_0xa024('0x35')][_0xa024('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa024('0x67')],'as':_0xa024('0x68'),'attributes':['id'],'raw':!![]}]})[_0xa024('0x28')](handleEntityNotFound(_0x2596f2,null))[_0xa024('0x28')](function(_0xd8ae32){var _0x53a6b9=_[_0xa024('0x2f')](_0xd8ae32,'id');var _0x4f9840=[];var _0x1a41e3=[];var _0x26c875=squel['select']();_0x26c875['field'](_0xa024('0x72'))[_0xa024('0x73')](_0xa024('0x74'),'tq')[_0xa024('0x75')](_0xa024('0x76'),'ut',_0xa024('0x77'))[_0xa024('0x3f')](_0xa024('0x78'),_0x87e4ef[_0xa024('0x48')]['id']);for(var _0x127ead=0x0;_0x127ead<_0xd8ae32['length'];_0x127ead+=0x1){let _0x449a3a=_0xd8ae32[_0x127ead];for(var _0x338ecd=0x0;_0x338ecd<_0x449a3a[_0xa024('0x68')][_0xa024('0x4a')];_0x338ecd+=0x1){let _0x4898c4=_0x449a3a[_0xa024('0x68')][_0x338ecd];var _0x197957=_0x26c875[_0xa024('0x79')]();_0x197957['where'](_0xa024('0x7a'),_0x4898c4['id']);_0x1a41e3['push'](db['sequelize'][_0xa024('0x35')](_0x197957[_0xa024('0x7b')](),{'type':db[_0xa024('0x6c')]['QueryTypes'][_0xa024('0x7c')]})[_0xa024('0x28')](function(_0x5c31af){if(_0x5c31af[_0xa024('0x4a')]===0x1){return _0x4898c4['id'];}else{var _0x4a4bea=_[_0xa024('0x7d')](_[_0xa024('0x2f')](_0x5c31af,_0xa024('0x7e')),function(_0x43dac4){return _[_0xa024('0x7f')](_0x53a6b9,_0x43dac4);});if(_0x4a4bea){return _0x4898c4['id'];}}}));}}return BPromise[_0xa024('0x80')](_0x1a41e3)['then'](function(_0xb3b1b6){_0x4f9840=_(_0x4f9840)[_0xa024('0x81')](_0xb3b1b6)['compact']()[_0xa024('0x82')]();return db[_0xa024('0x44')][_0xa024('0x4b')]({'where':{'id':_0x87e4ef[_0xa024('0x48')]['id']}})[_0xa024('0x28')](function(_0x4fcf3e){return db['sequelize']['transaction'](function(_0x349a5d){return _0x4fcf3e[_0xa024('0x83')](_0x87e4ef[_0xa024('0x35')][_0xa024('0x66')],{'transaction':_0x349a5d})['then'](function(){if(!_['isEmpty'](_0x4f9840)){return _0x4fcf3e[_0xa024('0x84')](_0x4f9840,{'transaction':_0x349a5d});}})[_0xa024('0x28')](function(){_0x4f9840['forEach'](function(_0x174308){socket[_0xa024('0x85')](_0xa024('0x86'),{'UserId':_0x174308,'MailQueueId':_0x4fcf3e['id']});});});});});});})[_0xa024('0x28')](respondWithStatusCode(_0x2596f2,null))[_0xa024('0x47')](handleError(_0x2596f2,null));};exports[_0xa024('0x87')]=function(_0x5bf509,_0xe84a52,_0x4068cb){return db['MailQueue'][_0xa024('0x4b')]({'where':{'id':_0x5bf509[_0xa024('0x48')]['id']}})['then'](handleEntityNotFound(_0xe84a52,null))[_0xa024('0x28')](function(_0x12c619){if(_0x12c619){return _0x12c619[_0xa024('0x87')](_0x5bf509[_0xa024('0x4d')][_0xa024('0x66')],_[_0xa024('0x88')](_0x5bf509[_0xa024('0x4d')],['ids','id'])||{})[_0xa024('0x89')](function(_0x1f211f){for(var _0x2f5b51=0x0;_0x2f5b51<_0x5bf509[_0xa024('0x4d')]['ids']['length'];_0x2f5b51+=0x1){socket[_0xa024('0x85')](_0xa024('0x71'),{'UserId':Number(_0x5bf509[_0xa024('0x4d')][_0xa024('0x66')][_0x2f5b51]),'MailQueueId':Number(_0x5bf509[_0xa024('0x48')]['id'])});}return _0x1f211f;});}})[_0xa024('0x28')](respondWithResult(_0xe84a52,null))[_0xa024('0x47')](handleError(_0xe84a52,null));};exports[_0xa024('0x84')]=function(_0x4295a9,_0x13c290,_0x144c4c){return db[_0xa024('0x44')][_0xa024('0x4b')]({'where':{'id':_0x4295a9[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x13c290,null))[_0xa024('0x28')](function(_0x3af6e6){if(_0x3af6e6){return _0x3af6e6[_0xa024('0x84')](_0x4295a9[_0xa024('0x35')]['ids'])[_0xa024('0x28')](function(){if(_[_0xa024('0x8a')](_0x4295a9[_0xa024('0x35')][_0xa024('0x66')])){for(var _0x4b249c=0x0;_0x4b249c<_0x4295a9['query'][_0xa024('0x66')]['length'];_0x4b249c+=0x1){socket['emit'](_0xa024('0x86'),{'UserId':Number(_0x4295a9[_0xa024('0x35')][_0xa024('0x66')][_0x4b249c]),'MailQueueId':Number(_0x4295a9['params']['id'])});}}else{socket[_0xa024('0x85')](_0xa024('0x86'),{'UserId':Number(_0x4295a9['query'][_0xa024('0x66')]),'MailQueueId':Number(_0x4295a9[_0xa024('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x13c290,null))['catch'](handleError(_0x13c290,null));};exports[_0xa024('0x8b')]=function(_0x5431d4,_0x105231,_0x280c69){var _0x310b28={};var _0x1ce47b={};var _0x28d2ae;var _0x630458;return db[_0xa024('0x44')][_0xa024('0x63')]({'where':{'id':_0x5431d4[_0xa024('0x48')]['id']}})[_0xa024('0x28')](handleEntityNotFound(_0x105231,null))[_0xa024('0x28')](function(_0x16ac83){if(_0x16ac83){_0x28d2ae=_0x16ac83;_0x1ce47b['model']=_[_0xa024('0x34')](db[_0xa024('0x67')][_0xa024('0x30')]);_0x1ce47b['query']=_[_0xa024('0x34')](_0x5431d4[_0xa024('0x35')]);_0x1ce47b[_0xa024('0x36')]=_[_0xa024('0x37')](_0x1ce47b['model'],_0x1ce47b[_0xa024('0x35')]);_0x310b28['attributes']=_['intersection'](_0x1ce47b['model'],qs[_0xa024('0x49')](_0x5431d4['query']['fields']));_0x310b28['attributes']=_0x310b28[_0xa024('0x39')][_0xa024('0x4a')]?_0x310b28[_0xa024('0x39')]:_0x1ce47b[_0xa024('0x38')];_0x310b28['order']=qs[_0xa024('0x3c')](_0x5431d4[_0xa024('0x35')][_0xa024('0x3c')]);_0x310b28[_0xa024('0x3f')]=qs['filters'](_[_0xa024('0x3d')](_0x5431d4[_0xa024('0x35')],_0x1ce47b[_0xa024('0x36')]));if(_0x5431d4[_0xa024('0x35')][_0xa024('0x3e')]){_0x310b28[_0xa024('0x3f')]=_['merge'](_0x310b28[_0xa024('0x3f')],{'$or':_[_0xa024('0x2f')](_0x310b28[_0xa024('0x39')],function(_0x32c199){var _0x16a9f9={};_0x16a9f9[_0x32c199]={'$like':'%'+_0x5431d4[_0xa024('0x35')]['filter']+'%'};return _0x16a9f9;})});}_0x310b28=_[_0xa024('0x40')]({},_0x310b28,_0x5431d4['options']);return _0x28d2ae[_0xa024('0x8b')](_0x310b28);}})[_0xa024('0x28')](function(_0x1bc7f0){if(_0x1bc7f0){_0x630458=_0x1bc7f0[_0xa024('0x4a')];if(!_0x5431d4['query'][_0xa024('0x3a')](_0xa024('0x3b'))){_0x310b28[_0xa024('0x23')]=qs['limit'](_0x5431d4['query'][_0xa024('0x23')]);_0x310b28[_0xa024('0x21')]=qs[_0xa024('0x21')](_0x5431d4['query']['offset']);}return _0x28d2ae[_0xa024('0x8b')](_0x310b28);}})[_0xa024('0x28')](function(_0x495a02){if(_0x495a02){return _0x495a02?{'count':_0x630458,'rows':_0x495a02}:null;}})[_0xa024('0x28')](respondWithResult(_0x105231,null))[_0xa024('0x47')](handleError(_0x105231,null));}; \ No newline at end of file +var _0x6027=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','rawAttributes','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','all','compact','value','removeAgents','forEach','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','create','body','user','get','role','UserProfileSection','find'];(function(_0x45ec55,_0x430053){var _0x47691d=function(_0x44d640){while(--_0x44d640){_0x45ec55['push'](_0x45ec55['shift']());}};_0x47691d(++_0x430053);}(_0x6027,0xc5));var _0x7602=function(_0x336df4,_0x52c1dc){_0x336df4=_0x336df4-0x0;var _0x580d8c=_0x6027[_0x336df4];return _0x580d8c;};'use strict';var emlformat=require(_0x7602('0x0'));var rimraf=require(_0x7602('0x1'));var zipdir=require(_0x7602('0x2'));var jsonpatch=require(_0x7602('0x3'));var rp=require(_0x7602('0x4'));var moment=require(_0x7602('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7602('0x6'));var path=require('path');var sox=require(_0x7602('0x7'));var csv=require('to-csv');var ejs=require(_0x7602('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7602('0x9'));var squel=require(_0x7602('0xa'));var crypto=require('crypto');var jsforce=require(_0x7602('0xb'));var deskjs=require(_0x7602('0xc'));var toCsv=require(_0x7602('0xd'));var querystring=require(_0x7602('0xe'));var Papa=require(_0x7602('0xf'));var Redis=require(_0x7602('0x10'));var authService=require(_0x7602('0x11'));var qs=require(_0x7602('0x12'));var as=require(_0x7602('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7602('0x14'))(_0x7602('0x15'));var utils=require(_0x7602('0x16'));var config=require(_0x7602('0x17'));var licenseUtil=require(_0x7602('0x18'));var db=require(_0x7602('0x19'))['db'];config[_0x7602('0x1a')]=_[_0x7602('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7602('0x1c'))(new Redis(config['redis']));require(_0x7602('0x1d'))['register'](socket);function respondWithStatusCode(_0x77c4c4,_0x1cbbb9){_0x1cbbb9=_0x1cbbb9||0xcc;return function(_0x648cf9){if(_0x648cf9){return _0x77c4c4[_0x7602('0x1e')](_0x1cbbb9);}return _0x77c4c4[_0x7602('0x1f')](_0x1cbbb9)[_0x7602('0x20')]();};}function respondWithResult(_0x120274,_0x15a23a){_0x15a23a=_0x15a23a||0xc8;return function(_0x2c2367){if(_0x2c2367){return _0x120274[_0x7602('0x1f')](_0x15a23a)[_0x7602('0x21')](_0x2c2367);}};}function respondWithFilteredResult(_0xd810cd,_0x5506a6){return function(_0x591506){if(_0x591506){var _0xc7db17=typeof _0x5506a6['offset']===_0x7602('0x22')&&typeof _0x5506a6[_0x7602('0x23')]===_0x7602('0x22');var _0x168dab=_0x591506[_0x7602('0x24')];var _0x5739c9=_0xc7db17?0x0:_0x5506a6[_0x7602('0x25')];var _0xdc4e64=_0xc7db17?_0x591506['count']:_0x5506a6['offset']+_0x5506a6[_0x7602('0x23')];var _0x12f59d;if(_0xdc4e64>=_0x168dab){_0xdc4e64=_0x168dab;_0x12f59d=0xc8;}else{_0x12f59d=0xce;}_0xd810cd[_0x7602('0x1f')](_0x12f59d);return _0xd810cd[_0x7602('0x26')](_0x7602('0x27'),_0x5739c9+'-'+_0xdc4e64+'/'+_0x168dab)[_0x7602('0x21')](_0x591506);}return null;};}function patchUpdates(_0x3b5067){return function(_0x49eb46){try{jsonpatch[_0x7602('0x28')](_0x49eb46,_0x3b5067,!![]);}catch(_0x2ce8eb){return BPromise[_0x7602('0x29')](_0x2ce8eb);}return _0x49eb46['save']();};}function saveUpdates(_0x3d7d62,_0x164b2b){return function(_0x42fb91){if(_0x42fb91){return _0x42fb91['update'](_0x3d7d62)[_0x7602('0x2a')](function(_0x36bbe9){return _0x36bbe9;});}return null;};}function removeEntity(_0x520965,_0x47feb3){return function(_0x187983){if(_0x187983){return _0x187983[_0x7602('0x2b')]()[_0x7602('0x2a')](function(){var _0x186615=_0x187983['get']({'plain':!![]});var _0x546a78=_0x7602('0x2c');return db[_0x7602('0x2d')]['destroy']({'where':{'type':_0x546a78,'resourceId':_0x186615['id']}})[_0x7602('0x2a')](function(){return _0x187983;});})[_0x7602('0x2a')](function(){_0x520965[_0x7602('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b06c4,_0x2efde5){return function(_0xd5d7c8){if(!_0xd5d7c8){_0x5b06c4[_0x7602('0x1e')](0x194);}return _0xd5d7c8;};}function handleError(_0x3f16e5,_0x41e1fd){_0x41e1fd=_0x41e1fd||0x1f4;return function(_0x4baf22){logger[_0x7602('0x2e')](_0x4baf22[_0x7602('0x2f')]);if(_0x4baf22[_0x7602('0x30')]){delete _0x4baf22[_0x7602('0x30')];}_0x3f16e5[_0x7602('0x1f')](_0x41e1fd)[_0x7602('0x31')](_0x4baf22);};}exports[_0x7602('0x32')]=function(_0x35e554,_0x20c68f){var _0x45d892={},_0x39ac36={},_0x3dcf70={'count':0x0,'rows':[]};var _0x57c81d=_[_0x7602('0x33')](db[_0x7602('0x34')]['rawAttributes'],function(_0x21d205){return{'name':_0x21d205['fieldName'],'type':_0x21d205['type'][_0x7602('0x35')]};});_0x39ac36[_0x7602('0x36')]=_['map'](_0x57c81d,_0x7602('0x30'));_0x39ac36[_0x7602('0x37')]=_[_0x7602('0x38')](_0x35e554[_0x7602('0x37')]);_0x39ac36[_0x7602('0x39')]=_[_0x7602('0x3a')](_0x39ac36['model'],_0x39ac36[_0x7602('0x37')]);_0x45d892[_0x7602('0x3b')]=_['intersection'](_0x39ac36[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x35e554['query'][_0x7602('0x3c')]));_0x45d892[_0x7602('0x3b')]=_0x45d892[_0x7602('0x3b')][_0x7602('0x3d')]?_0x45d892[_0x7602('0x3b')]:_0x39ac36[_0x7602('0x36')];if(!_0x35e554['query'][_0x7602('0x3e')](_0x7602('0x3f'))){_0x45d892['limit']=qs[_0x7602('0x23')](_0x35e554[_0x7602('0x37')]['limit']);_0x45d892['offset']=qs[_0x7602('0x25')](_0x35e554[_0x7602('0x37')][_0x7602('0x25')]);}_0x45d892[_0x7602('0x40')]=qs[_0x7602('0x41')](_0x35e554[_0x7602('0x37')][_0x7602('0x41')]);_0x45d892['where']=qs[_0x7602('0x39')](_[_0x7602('0x42')](_0x35e554[_0x7602('0x37')],_0x39ac36[_0x7602('0x39')]),_0x57c81d);if(_0x35e554[_0x7602('0x37')][_0x7602('0x43')]){_0x45d892['where']=_['merge'](_0x45d892[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x57c81d,function(_0x306d77){if(_0x306d77[_0x7602('0x45')]!==_0x7602('0x46')){var _0x4d378e={};_0x4d378e[_0x306d77[_0x7602('0x30')]]={'$like':'%'+_0x35e554[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x4d378e;}})});}_0x45d892=_['merge']({},_0x45d892,_0x35e554[_0x7602('0x47')]);var _0x27b19f={'where':_0x45d892[_0x7602('0x44')]};return db[_0x7602('0x34')]['count'](_0x27b19f)[_0x7602('0x2a')](function(_0x178626){_0x3dcf70['count']=_0x178626;if(_0x35e554[_0x7602('0x37')][_0x7602('0x48')]){_0x45d892['include']=[{'all':!![]}];}return db[_0x7602('0x34')][_0x7602('0x49')](_0x45d892);})[_0x7602('0x2a')](function(_0x53462a){_0x3dcf70[_0x7602('0x4a')]=_0x53462a;return _0x3dcf70;})['then'](respondWithFilteredResult(_0x20c68f,_0x45d892))[_0x7602('0x4b')](handleError(_0x20c68f,null));};exports[_0x7602('0x4c')]=function(_0x4651ad,_0x510dc4){var _0xd96acc={'raw':!![],'where':{'id':_0x4651ad[_0x7602('0x4d')]['id']}},_0x1344db={};_0x1344db[_0x7602('0x36')]=_[_0x7602('0x38')](db[_0x7602('0x34')]['rawAttributes']);_0x1344db['query']=_[_0x7602('0x38')](_0x4651ad[_0x7602('0x37')]);_0x1344db[_0x7602('0x39')]=_[_0x7602('0x3a')](_0x1344db[_0x7602('0x36')],_0x1344db[_0x7602('0x37')]);_0xd96acc[_0x7602('0x3b')]=_[_0x7602('0x3a')](_0x1344db[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x4651ad[_0x7602('0x37')][_0x7602('0x3c')]));_0xd96acc[_0x7602('0x3b')]=_0xd96acc[_0x7602('0x3b')][_0x7602('0x3d')]?_0xd96acc[_0x7602('0x3b')]:_0x1344db[_0x7602('0x36')];if(_0x4651ad[_0x7602('0x37')][_0x7602('0x48')]){_0xd96acc[_0x7602('0x4e')]=[{'all':!![]}];}_0xd96acc=_[_0x7602('0x4f')]({},_0xd96acc,_0x4651ad[_0x7602('0x47')]);return db[_0x7602('0x34')]['find'](_0xd96acc)[_0x7602('0x2a')](handleEntityNotFound(_0x510dc4,null))[_0x7602('0x2a')](respondWithResult(_0x510dc4,null))[_0x7602('0x4b')](handleError(_0x510dc4,null));};exports[_0x7602('0x50')]=function(_0x28b59f,_0x30c96a){return db['MailQueue'][_0x7602('0x50')](_0x28b59f[_0x7602('0x51')],{})[_0x7602('0x2a')](function(_0x1f7928){var _0x4824bb=_0x28b59f[_0x7602('0x52')][_0x7602('0x53')]({'plain':!![]});if(!_0x4824bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4824bb[_0x7602('0x54')]===_0x7602('0x52')){var _0x59028d=_0x1f7928[_0x7602('0x53')]({'plain':!![]});var _0x4ea15a=_0x7602('0x2c');return db[_0x7602('0x55')][_0x7602('0x56')]({'where':{'name':_0x4ea15a,'userProfileId':_0x4824bb[_0x7602('0x57')]},'raw':!![]})[_0x7602('0x2a')](function(_0x50abaf){if(_0x50abaf&&_0x50abaf['autoAssociation']===0x0){return db[_0x7602('0x2d')][_0x7602('0x50')]({'name':_0x59028d[_0x7602('0x30')],'resourceId':_0x59028d['id'],'type':_0x50abaf['name'],'sectionId':_0x50abaf['id']},{})[_0x7602('0x2a')](function(){return _0x1f7928;});}else{return _0x1f7928;}})[_0x7602('0x4b')](function(_0x24a44c){logger['error'](_0x7602('0x58'),_0x24a44c);throw _0x24a44c;});}return _0x1f7928;})[_0x7602('0x2a')](respondWithResult(_0x30c96a,0xc9))[_0x7602('0x4b')](handleError(_0x30c96a,null));};exports[_0x7602('0x59')]=function(_0x355c70,_0x16be38){if(_0x355c70[_0x7602('0x51')]['id']){delete _0x355c70[_0x7602('0x51')]['id'];}return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x355c70[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x16be38,null))['then'](saveUpdates(_0x355c70[_0x7602('0x51')],null))[_0x7602('0x2a')](respondWithResult(_0x16be38,null))[_0x7602('0x4b')](handleError(_0x16be38,null));};exports['destroy']=function(_0x47dd3e,_0x325202){return db[_0x7602('0x34')]['find']({'where':{'id':_0x47dd3e[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x325202,null))[_0x7602('0x2a')](removeEntity(_0x325202,null))[_0x7602('0x4b')](handleError(_0x325202,null));};exports[_0x7602('0x5a')]=function(_0x1ee9ee,_0x7cce2d){return db[_0x7602('0x34')][_0x7602('0x5a')]()['then'](respondWithResult(_0x7cce2d,null))[_0x7602('0x4b')](handleError(_0x7cce2d,null));};exports[_0x7602('0x5b')]=function(_0x45c04e,_0x2b9ebd,_0xcf8106){var _0x476cf2={'raw':!![],'where':{}},_0xab255d={},_0x57ab91;return db[_0x7602('0x34')][_0x7602('0x5c')]({'where':{'id':_0x45c04e[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x2b9ebd,null))[_0x7602('0x2a')](function(_0x2b3318){if(_0x2b3318){_0x57ab91=_0x2b3318[_0x7602('0x53')]({'plain':!![]});_0xab255d['model']=_[_0x7602('0x38')](db[_0x7602('0x5d')][_0x7602('0x5e')]);_0xab255d[_0x7602('0x37')]=_[_0x7602('0x38')](_0x45c04e[_0x7602('0x37')]);_0xab255d[_0x7602('0x39')]=_[_0x7602('0x3a')](_0xab255d[_0x7602('0x36')],_0xab255d[_0x7602('0x37')]);_0x476cf2[_0x7602('0x3b')]=_[_0x7602('0x3a')](_0xab255d[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x45c04e[_0x7602('0x37')][_0x7602('0x3c')]));_0x476cf2[_0x7602('0x3b')]=_0x476cf2[_0x7602('0x3b')][_0x7602('0x3d')]?_0x476cf2['attributes']:_0xab255d[_0x7602('0x36')];if(!_0x45c04e[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x476cf2[_0x7602('0x23')]=qs[_0x7602('0x23')](_0x45c04e['query'][_0x7602('0x23')]);_0x476cf2[_0x7602('0x25')]=qs[_0x7602('0x25')](_0x45c04e[_0x7602('0x37')][_0x7602('0x25')]);}_0x476cf2[_0x7602('0x40')]=qs[_0x7602('0x41')](_0x45c04e[_0x7602('0x37')][_0x7602('0x41')]);_0x476cf2[_0x7602('0x44')]=qs[_0x7602('0x39')](_[_0x7602('0x42')](_0x45c04e['query'],_0xab255d['filters']));_0x476cf2[_0x7602('0x44')][_0x7602('0x5f')]=_0x2b3318['id'];if(_0x45c04e[_0x7602('0x37')]['filter']){_0x476cf2[_0x7602('0x44')]=_[_0x7602('0x4f')](_0x476cf2[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x476cf2[_0x7602('0x3b')],function(_0x230261){var _0x303397={};_0x303397[_0x230261]={'$like':'%'+_0x45c04e['query'][_0x7602('0x43')]+'%'};return _0x303397;})});}_0x476cf2=_[_0x7602('0x4f')]({},_0x476cf2,_0x45c04e[_0x7602('0x47')]);return db[_0x7602('0x5d')][_0x7602('0x49')](_0x476cf2);}})[_0x7602('0x2a')](function(_0x1ee0fb){if(_0x1ee0fb){return db[_0x7602('0x60')]['findAndCountAll']({'where':{'id':_[_0x7602('0x33')](_0x1ee0fb,_0x7602('0x61')),'role':_0x7602('0x62')},'attributes':['id',_0x7602('0x30'),_0x7602('0x63'),_0x7602('0x64'),_0x7602('0x65')]});}})['then'](function(_0x130c64){if(_0x130c64){return{'count':_0x130c64[_0x7602('0x24')],'rows':_[_0x7602('0x33')](_0x130c64[_0x7602('0x4a')],function(_0x4ffaec){return{'membername':_0x4ffaec['name'],'UserId':_0x4ffaec['id'],'queue_name':_0x57ab91[_0x7602('0x30')],'MailQueueId':_0x57ab91['id'],'interface':util['format'](_0x7602('0x66'),_0x7602('0x67'),_0x4ffaec[_0x7602('0x30')]),'penalty':0x0,'paused':_0x4ffaec['mailPause'],'createdAt':_0x4ffaec['createdAt'],'updatedAt':_0x4ffaec['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7602('0x2a')](respondWithFilteredResult(_0x2b9ebd,_0x476cf2))[_0x7602('0x4b')](handleError(_0x2b9ebd,null));};exports[_0x7602('0x68')]=function(_0x16eccc,_0x121706,_0x2836fd){var _0x441ea7={};var _0x5c6680={};var _0x48374d;var _0x3d8e0f;return db[_0x7602('0x34')][_0x7602('0x5c')]({'where':{'id':_0x16eccc[_0x7602('0x4d')]['id']}})['then'](handleEntityNotFound(_0x121706,null))[_0x7602('0x2a')](function(_0x5be405){if(_0x5be405){_0x48374d=_0x5be405;_0x5c6680[_0x7602('0x36')]=_['keys'](db[_0x7602('0x69')][_0x7602('0x5e')]);_0x5c6680[_0x7602('0x37')]=_['keys'](_0x16eccc[_0x7602('0x37')]);_0x5c6680[_0x7602('0x39')]=_['intersection'](_0x5c6680[_0x7602('0x36')],_0x5c6680[_0x7602('0x37')]);_0x441ea7[_0x7602('0x3b')]=_['intersection'](_0x5c6680['model'],qs[_0x7602('0x3c')](_0x16eccc[_0x7602('0x37')][_0x7602('0x3c')]));_0x441ea7[_0x7602('0x3b')]=_0x441ea7['attributes'][_0x7602('0x3d')]?_0x441ea7[_0x7602('0x3b')]:_0x5c6680[_0x7602('0x36')];_0x441ea7['order']=qs[_0x7602('0x41')](_0x16eccc[_0x7602('0x37')][_0x7602('0x41')]);_0x441ea7[_0x7602('0x44')]=qs['filters'](_[_0x7602('0x42')](_0x16eccc['query'],_0x5c6680[_0x7602('0x39')]));if(_0x16eccc[_0x7602('0x37')][_0x7602('0x43')]){_0x441ea7[_0x7602('0x44')]=_[_0x7602('0x4f')](_0x441ea7[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x441ea7['attributes'],function(_0xf55e78){var _0x521e47={};_0x521e47[_0xf55e78]={'$like':'%'+_0x16eccc[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x521e47;})});}_0x441ea7=_['merge']({},_0x441ea7,_0x16eccc[_0x7602('0x47')]);return _0x48374d[_0x7602('0x68')](_0x441ea7);}})[_0x7602('0x2a')](function(_0x2cf2eb){if(_0x2cf2eb){_0x3d8e0f=_0x2cf2eb['length'];if(!_0x16eccc[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x441ea7['limit']=qs[_0x7602('0x23')](_0x16eccc['query'][_0x7602('0x23')]);_0x441ea7['offset']=qs[_0x7602('0x25')](_0x16eccc[_0x7602('0x37')][_0x7602('0x25')]);}return _0x48374d['getTeams'](_0x441ea7);}})['then'](function(_0x4d08e4){if(_0x4d08e4){return _0x4d08e4?{'count':_0x3d8e0f,'rows':_0x4d08e4}:null;}})[_0x7602('0x2a')](respondWithResult(_0x121706,null))[_0x7602('0x4b')](handleError(_0x121706,null));};exports[_0x7602('0x6a')]=function(_0x323620,_0x331ab0,_0x62c4c5){var _0x45220f=_0x323620[_0x7602('0x51')][_0x7602('0x6b')];return db['Team'][_0x7602('0x49')]({'where':{'id':_0x45220f},'attributes':['id'],'include':[{'model':db[_0x7602('0x60')],'as':_0x7602('0x6c'),'attributes':['id',_0x7602('0x30'),_0x7602('0x6d'),_0x7602('0x6e'),_0x7602('0x6f')],'raw':!![]}]})[_0x7602('0x2a')](function(_0x55982d){if(_0x55982d){var _0x204065=_['flatMap'](_0x55982d,function(_0x10b98c){var _0x389b6d=_0x10b98c[_0x7602('0x53')]({'plain':!![]});return _0x389b6d[_0x7602('0x6c')];});return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x323620[_0x7602('0x4d')]['id']}})['then'](function(_0x5e503c){return db['sequelize'][_0x7602('0x70')](function(_0x29c102){return _0x5e503c[_0x7602('0x6a')](_0x45220f,{'transaction':_0x29c102})[_0x7602('0x2a')](function(){return BPromise[_0x7602('0x71')](_0x204065,function(_0x368f0f){return db[_0x7602('0x5d')][_0x7602('0x72')]({'where':{'UserId':_0x368f0f['id'],'MailQueueId':_0x323620[_0x7602('0x4d')]['id']},'transaction':_0x29c102});});})['then'](function(){_0x204065['forEach'](function(_0x27afdd){socket[_0x7602('0x73')](_0x7602('0x74'),{'UserId':_0x27afdd['id'],'MailQueueId':_0x5e503c['id']});});});});});}})[_0x7602('0x2a')](respondWithStatusCode(_0x331ab0,null))[_0x7602('0x4b')](handleError(_0x331ab0,null));};exports[_0x7602('0x75')]=function(_0x5b7e6f,_0x42d9e3,_0x2eb440){return db[_0x7602('0x69')]['findAll']({'where':{'id':_0x5b7e6f[_0x7602('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7602('0x60')],'as':_0x7602('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x7602('0x2a')](handleEntityNotFound(_0x42d9e3,null))[_0x7602('0x2a')](function(_0x298c4b){var _0x2a9fed=_[_0x7602('0x33')](_0x298c4b,'id');var _0x4f6d51=[];var _0x5608f9=[];var _0x1ffe20=squel[_0x7602('0x76')]();_0x1ffe20[_0x7602('0x77')](_0x7602('0x78'))[_0x7602('0x79')]('team_has_mail_queues','tq')[_0x7602('0x7a')]('user_has_teams','ut',_0x7602('0x7b'))['where'](_0x7602('0x7c'),_0x5b7e6f[_0x7602('0x4d')]['id']);for(var _0x1aa7e3=0x0;_0x1aa7e3<_0x298c4b[_0x7602('0x3d')];_0x1aa7e3+=0x1){let _0x2cefcb=_0x298c4b[_0x1aa7e3];for(var _0xb257df=0x0;_0xb257df<_0x2cefcb['Agents']['length'];_0xb257df+=0x1){let _0x469912=_0x2cefcb[_0x7602('0x6c')][_0xb257df];var _0x867bb1=_0x1ffe20[_0x7602('0x7d')]();_0x867bb1[_0x7602('0x44')]('ut.UserId\x20=\x20?',_0x469912['id']);_0x5608f9[_0x7602('0x7e')](db[_0x7602('0x7f')][_0x7602('0x37')](_0x867bb1[_0x7602('0x80')](),{'type':db['sequelize'][_0x7602('0x81')][_0x7602('0x82')]})[_0x7602('0x2a')](function(_0x457293){if(_0x457293[_0x7602('0x3d')]===0x1){return _0x469912['id'];}else{var _0x54d5e1=_[_0x7602('0x83')](_[_0x7602('0x33')](_0x457293,'TeamId'),function(_0x4dc265){return _['includes'](_0x2a9fed,_0x4dc265);});if(_0x54d5e1){return _0x469912['id'];}}}));}}return BPromise[_0x7602('0x84')](_0x5608f9)[_0x7602('0x2a')](function(_0x48eb99){_0x4f6d51=_(_0x4f6d51)['union'](_0x48eb99)[_0x7602('0x85')]()[_0x7602('0x86')]();return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x5b7e6f['params']['id']}})[_0x7602('0x2a')](function(_0x26215){return db[_0x7602('0x7f')]['transaction'](function(_0x443e92){return _0x26215[_0x7602('0x75')](_0x5b7e6f[_0x7602('0x37')][_0x7602('0x6b')],{'transaction':_0x443e92})[_0x7602('0x2a')](function(){if(!_['isEmpty'](_0x4f6d51)){return _0x26215[_0x7602('0x87')](_0x4f6d51,{'transaction':_0x443e92});}})['then'](function(){_0x4f6d51[_0x7602('0x88')](function(_0x553cc0){socket['emit'](_0x7602('0x89'),{'UserId':_0x553cc0,'MailQueueId':_0x26215['id']});});});});});});})[_0x7602('0x2a')](respondWithStatusCode(_0x42d9e3,null))[_0x7602('0x4b')](handleError(_0x42d9e3,null));};exports['addAgents']=function(_0x1fe6df,_0x12af6,_0x109fc8){return db['MailQueue']['find']({'where':{'id':_0x1fe6df[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x12af6,null))['then'](function(_0x212c48){if(_0x212c48){return _0x212c48[_0x7602('0x8a')](_0x1fe6df[_0x7602('0x51')][_0x7602('0x6b')],_[_0x7602('0x8b')](_0x1fe6df[_0x7602('0x51')],['ids','id'])||{})['spread'](function(_0x43004c){for(var _0x70ae38=0x0;_0x70ae38<_0x1fe6df[_0x7602('0x51')]['ids'][_0x7602('0x3d')];_0x70ae38+=0x1){socket[_0x7602('0x73')](_0x7602('0x74'),{'UserId':Number(_0x1fe6df[_0x7602('0x51')]['ids'][_0x70ae38]),'MailQueueId':Number(_0x1fe6df[_0x7602('0x4d')]['id'])});}return _0x43004c;});}})[_0x7602('0x2a')](respondWithResult(_0x12af6,null))[_0x7602('0x4b')](handleError(_0x12af6,null));};exports[_0x7602('0x87')]=function(_0xb9a276,_0x426c0d,_0x478a2e){return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0xb9a276[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x426c0d,null))[_0x7602('0x2a')](function(_0x47803b){if(_0x47803b){return _0x47803b['removeAgents'](_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')])['then'](function(){if(_[_0x7602('0x8c')](_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')])){for(var _0x268df3=0x0;_0x268df3<_0xb9a276['query']['ids']['length'];_0x268df3+=0x1){socket[_0x7602('0x73')](_0x7602('0x89'),{'UserId':Number(_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')][_0x268df3]),'MailQueueId':Number(_0xb9a276['params']['id'])});}}else{socket[_0x7602('0x73')]('userMailQueue:remove',{'UserId':Number(_0xb9a276[_0x7602('0x37')]['ids']),'MailQueueId':Number(_0xb9a276[_0x7602('0x4d')]['id'])});}});}})[_0x7602('0x2a')](respondWithStatusCode(_0x426c0d,null))[_0x7602('0x4b')](handleError(_0x426c0d,null));};exports[_0x7602('0x8d')]=function(_0x3f1e76,_0x12048e,_0x32e144){var _0x45baa1={};var _0x302317={};var _0x3deb8c;var _0x31842d;return db[_0x7602('0x34')]['findOne']({'where':{'id':_0x3f1e76[_0x7602('0x4d')]['id']}})['then'](handleEntityNotFound(_0x12048e,null))[_0x7602('0x2a')](function(_0x322703){if(_0x322703){_0x3deb8c=_0x322703;_0x302317['model']=_['keys'](db[_0x7602('0x60')][_0x7602('0x5e')]);_0x302317['query']=_[_0x7602('0x38')](_0x3f1e76['query']);_0x302317[_0x7602('0x39')]=_['intersection'](_0x302317[_0x7602('0x36')],_0x302317[_0x7602('0x37')]);_0x45baa1[_0x7602('0x3b')]=_['intersection'](_0x302317['model'],qs['fields'](_0x3f1e76[_0x7602('0x37')][_0x7602('0x3c')]));_0x45baa1[_0x7602('0x3b')]=_0x45baa1['attributes']['length']?_0x45baa1[_0x7602('0x3b')]:_0x302317[_0x7602('0x36')];_0x45baa1[_0x7602('0x40')]=qs['sort'](_0x3f1e76[_0x7602('0x37')][_0x7602('0x41')]);_0x45baa1[_0x7602('0x44')]=qs['filters'](_[_0x7602('0x42')](_0x3f1e76[_0x7602('0x37')],_0x302317[_0x7602('0x39')]));if(_0x3f1e76[_0x7602('0x37')][_0x7602('0x43')]){_0x45baa1[_0x7602('0x44')]=_['merge'](_0x45baa1[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x45baa1['attributes'],function(_0x3a597d){var _0x198943={};_0x198943[_0x3a597d]={'$like':'%'+_0x3f1e76[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x198943;})});}_0x45baa1=_[_0x7602('0x4f')]({},_0x45baa1,_0x3f1e76[_0x7602('0x47')]);return _0x3deb8c[_0x7602('0x8d')](_0x45baa1);}})[_0x7602('0x2a')](function(_0x99bb33){if(_0x99bb33){_0x31842d=_0x99bb33[_0x7602('0x3d')];if(!_0x3f1e76[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x45baa1['limit']=qs['limit'](_0x3f1e76['query']['limit']);_0x45baa1[_0x7602('0x25')]=qs[_0x7602('0x25')](_0x3f1e76[_0x7602('0x37')][_0x7602('0x25')]);}return _0x3deb8c['getAgents'](_0x45baa1);}})['then'](function(_0x5d1daa){if(_0x5d1daa){return _0x5d1daa?{'count':_0x31842d,'rows':_0x5d1daa}:null;}})[_0x7602('0x2a')](respondWithResult(_0x12048e,null))['catch'](handleError(_0x12048e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 06cc808..642dd4e 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 _0xcd84=['emit','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xcd84,0x1cf));var _0x4cd8=function(_0x1d3ca8,_0x31cde1){_0x1d3ca8=_0x1d3ca8-0x0;var _0x78b332=_0xcd84[_0x1d3ca8];return _0x78b332;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x4cd8('0x0'))['db'][_0x4cd8('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4cd8('0x2')](0x0);var events={'afterCreate':_0x4cd8('0x3'),'afterUpdate':_0x4cd8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5cfeba){return function(_0x413bf3,_0x5ab61a,_0x4b1c9b){MailQueueEvents['emit'](_0x5cfeba+':'+_0x413bf3['id'],_0x413bf3);MailQueueEvents[_0x4cd8('0x5')](_0x5cfeba,_0x413bf3);_0x4b1c9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x2c06=['emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x54d4c9,_0x359152){var _0x383b16=function(_0x2bcc7d){while(--_0x2bcc7d){_0x54d4c9['push'](_0x54d4c9['shift']());}};_0x383b16(++_0x359152);}(_0x2c06,0x111));var _0x62c0=function(_0x350a25,_0x4d36e0){_0x350a25=_0x350a25-0x0;var _0xdae393=_0x2c06[_0x350a25];return _0xdae393;};'use strict';var EventEmitter=require(_0x62c0('0x0'));var MailQueue=require(_0x62c0('0x1'))['db'][_0x62c0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x62c0('0x3')](0x0);var events={'afterCreate':_0x62c0('0x4'),'afterUpdate':_0x62c0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b1c76){return function(_0x8a1608,_0x16ea82,_0x331d9d){MailQueueEvents[_0x62c0('0x6')](_0x4b1c76+':'+_0x8a1608['id'],_0x8a1608);MailQueueEvents[_0x62c0('0x6')](_0x4b1c76,_0x8a1608);_0x331d9d(null);};}for(var e in events){if(events[_0x62c0('0x7')](e)){var event=events[e];MailQueue[_0x62c0('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b671bd2..639c5d9 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 _0x4a66=['mail_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0xd8efb3,_0x504bc9){var _0x1b64e4=function(_0x490083){while(--_0x490083){_0xd8efb3['push'](_0xd8efb3['shift']());}};_0x1b64e4(++_0x504bc9);}(_0x4a66,0x85));var _0x64a6=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x4a66[_0x2d61ac];return _0x3f7d3c;};'use strict';var _=require(_0x64a6('0x0'));var util=require(_0x64a6('0x1'));var logger=require(_0x64a6('0x2'))(_0x64a6('0x3'));var moment=require('moment');var BPromise=require(_0x64a6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a6('0x5'));var rimraf=require(_0x64a6('0x6'));var config=require(_0x64a6('0x7'));var attributes=require(_0x64a6('0x8'));module[_0x64a6('0x9')]=function(_0x265a45,_0x416626){return _0x265a45['define']('MailQueue',attributes,{'tableName':_0x64a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcef=['lodash','util','../../config/logger','bluebird','request-promise','exports','define','MailQueue','mail_queues'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0xfcef,0xf3));var _0xffce=function(_0x4a507c,_0x243283){_0x4a507c=_0x4a507c-0x0;var _0xd678ce=_0xfcef[_0x4a507c];return _0xd678ce;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var logger=require(_0xffce('0x2'))('api');var moment=require('moment');var BPromise=require(_0xffce('0x3'));var rp=require(_0xffce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xffce('0x5')]=function(_0x42f7e9,_0x3f9a82){return _0x42f7e9[_0xffce('0x6')](_0xffce('0x7'),attributes,{'tableName':_0xffce('0x8'),'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 be38de0..c6b674f 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 _0x6c63=['jayson/promise','http','redis','defaults','localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','raw','options','attributes','limit','map','include','model','ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c63,0x1ee));var _0x36c6=function(_0x3b7303,_0x28a6cd){_0x3b7303=_0x3b7303-0x0;var _0x413bf2=_0x6c63[_0x3b7303];return _0x413bf2;};'use strict';var _=require(_0x36c6('0x0'));var util=require(_0x36c6('0x1'));var moment=require(_0x36c6('0x2'));var BPromise=require(_0x36c6('0x3'));var rs=require(_0x36c6('0x4'));var fs=require('fs');var Redis=require(_0x36c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36c6('0x6'));var logger=require(_0x36c6('0x7'))(_0x36c6('0x8'));var config=require(_0x36c6('0x9'));var jayson=require(_0x36c6('0xa'));var client=jayson['client'][_0x36c6('0xb')]({'port':0x232a});config[_0x36c6('0xc')]=_[_0x36c6('0xd')](config[_0x36c6('0xc')],{'host':_0x36c6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36c6('0xc')]));require('./mailQueue.socket')[_0x36c6('0xf')](socket);function respondWithRpcPromise(_0x4b7ec0,_0x25fcbd,_0xbe21dc){return new BPromise(function(_0x2323b4,_0x17f5c3){return client[_0x36c6('0x10')](_0x4b7ec0,_0xbe21dc)[_0x36c6('0x11')](function(_0x3fe114){logger[_0x36c6('0x12')](_0x36c6('0x13'),_0x25fcbd,_0x36c6('0x14'));logger[_0x36c6('0x15')](_0x36c6('0x16'),_0x25fcbd,_0x36c6('0x14'),JSON[_0x36c6('0x17')](_0x3fe114));if(_0x3fe114['error']){if(_0x3fe114[_0x36c6('0x18')][_0x36c6('0x19')]===0x1f4){logger[_0x36c6('0x18')]('MailQueue,\x20%s,\x20%s',_0x25fcbd,_0x3fe114[_0x36c6('0x18')][_0x36c6('0x1a')]);return _0x17f5c3(_0x3fe114[_0x36c6('0x18')][_0x36c6('0x1a')]);}logger[_0x36c6('0x18')](_0x36c6('0x13'),_0x25fcbd,_0x3fe114[_0x36c6('0x18')][_0x36c6('0x1a')]);return _0x2323b4(_0x3fe114[_0x36c6('0x18')][_0x36c6('0x1a')]);}else{logger['info'](_0x36c6('0x13'),_0x25fcbd,'request\x20sent');_0x2323b4(_0x3fe114[_0x36c6('0x1b')]['message']);}})[_0x36c6('0x1c')](function(_0x396de2){logger[_0x36c6('0x18')]('MailQueue,\x20%s,\x20%s',_0x25fcbd,_0x396de2);_0x17f5c3(_0x396de2);});});}exports[_0x36c6('0x1d')]=function(_0xdee3a5){var _0x981109=this;return new Promise(function(_0x4376c3,_0x4097b1){return db[_0x36c6('0x1e')][_0x36c6('0x1f')]({'raw':_0xdee3a5['options']?_0xdee3a5['options'][_0x36c6('0x20')]===undefined?!![]:![]:!![],'where':_0xdee3a5[_0x36c6('0x21')]?_0xdee3a5['options']['where']||null:null,'attributes':_0xdee3a5[_0x36c6('0x21')]?_0xdee3a5[_0x36c6('0x21')][_0x36c6('0x22')]||null:null,'limit':_0xdee3a5[_0x36c6('0x21')]?_0xdee3a5[_0x36c6('0x21')][_0x36c6('0x23')]||null:null,'include':_0xdee3a5[_0x36c6('0x21')]?_0xdee3a5[_0x36c6('0x21')]['include']?_[_0x36c6('0x24')](_0xdee3a5[_0x36c6('0x21')][_0x36c6('0x25')],function(_0x599db1){return{'model':db[_0x599db1[_0x36c6('0x26')]],'as':_0x599db1['as'],'attributes':_0x599db1[_0x36c6('0x22')],'include':_0x599db1[_0x36c6('0x25')]?_[_0x36c6('0x24')](_0x599db1['include'],function(_0x34b08c){return{'model':db[_0x34b08c['model']],'as':_0x34b08c['as'],'attributes':_0x34b08c[_0x36c6('0x22')],'include':_0x34b08c[_0x36c6('0x25')]?_['map'](_0x34b08c['include'],function(_0x539d99){return{'model':db[_0x539d99[_0x36c6('0x26')]],'as':_0x539d99['as'],'attributes':_0x539d99[_0x36c6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x36c6('0x11')](function(_0x50b21b){logger[_0x36c6('0x12')](_0x36c6('0x1d'),_0xdee3a5);logger[_0x36c6('0x15')](_0x36c6('0x1d'),_0xdee3a5,JSON[_0x36c6('0x17')](_0x50b21b));_0x4376c3(_0x50b21b);})[_0x36c6('0x1c')](function(_0x3c1973){logger[_0x36c6('0x18')](_0x36c6('0x1d'),_0x3c1973[_0x36c6('0x1a')],_0xdee3a5);_0x4097b1(_0x981109[_0x36c6('0x18')](0x1f4,_0x3c1973[_0x36c6('0x1a')]));});});};exports[_0x36c6('0x27')]=function(_0x492ba1){var _0x7f8038=this;return new Promise(function(_0xfffe53,_0x502e84){return db[_0x36c6('0x1e')][_0x36c6('0x28')]({'raw':_0x492ba1[_0x36c6('0x21')]?_0x492ba1['options']['raw']===undefined?!![]:![]:!![],'where':_0x492ba1['options']?_0x492ba1[_0x36c6('0x21')][_0x36c6('0x29')]||null:null,'attributes':_0x492ba1[_0x36c6('0x21')]?_0x492ba1[_0x36c6('0x21')][_0x36c6('0x22')]||null:null,'include':_0x492ba1[_0x36c6('0x21')]?_0x492ba1[_0x36c6('0x21')][_0x36c6('0x25')]?_['map'](_0x492ba1['options'][_0x36c6('0x25')],function(_0x2b9786){return{'model':db[_0x2b9786[_0x36c6('0x26')]],'as':_0x2b9786['as'],'attributes':_0x2b9786[_0x36c6('0x22')],'include':_0x2b9786['include']?_[_0x36c6('0x24')](_0x2b9786['include'],function(_0x1e9ba4){return{'model':db[_0x1e9ba4['model']],'as':_0x1e9ba4['as'],'attributes':_0x1e9ba4[_0x36c6('0x22')],'include':_0x1e9ba4[_0x36c6('0x25')]?_['map'](_0x1e9ba4[_0x36c6('0x25')],function(_0x59c43d){return{'model':db[_0x59c43d[_0x36c6('0x26')]],'as':_0x59c43d['as'],'attributes':_0x59c43d[_0x36c6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x36c6('0x11')](function(_0xcc5b5){logger[_0x36c6('0x12')]('ShowMailQueue',_0x492ba1);logger[_0x36c6('0x15')]('ShowMailQueue',_0x492ba1,JSON[_0x36c6('0x17')](_0xcc5b5));_0xfffe53(_0xcc5b5);})[_0x36c6('0x1c')](function(_0x54475b){logger[_0x36c6('0x18')](_0x36c6('0x27'),_0x54475b[_0x36c6('0x1a')],_0x492ba1);_0x502e84(_0x7f8038['error'](0x1f4,_0x54475b['message']));});});}; \ No newline at end of file +var _0x9e0d=['client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9e0d,0x9b));var _0xd9e0=function(_0x2b5479,_0x314d74){_0x2b5479=_0x2b5479-0x0;var _0x5382a9=_0x9e0d[_0x2b5479];return _0x5382a9;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require(_0xd9e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9e0('0x5'));var logger=require(_0xd9e0('0x6'))(_0xd9e0('0x7'));var config=require(_0xd9e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9e0('0x9')][_0xd9e0('0xa')]({'port':0x232a});config[_0xd9e0('0xb')]=_[_0xd9e0('0xc')](config[_0xd9e0('0xb')],{'host':_0xd9e0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd9e0('0xb')]));require(_0xd9e0('0xe'))[_0xd9e0('0xf')](socket);function respondWithRpcPromise(_0x52e142,_0x59fc82,_0x2dd5f7){return new BPromise(function(_0x5341fc,_0x3c2dff){return client[_0xd9e0('0x10')](_0x52e142,_0x2dd5f7)[_0xd9e0('0x11')](function(_0x1a1f68){logger[_0xd9e0('0x12')](_0xd9e0('0x13'),_0x59fc82,_0xd9e0('0x14'));logger['debug'](_0xd9e0('0x15'),_0x59fc82,_0xd9e0('0x14'),JSON[_0xd9e0('0x16')](_0x1a1f68));if(_0x1a1f68[_0xd9e0('0x17')]){if(_0x1a1f68['error'][_0xd9e0('0x18')]===0x1f4){logger[_0xd9e0('0x17')](_0xd9e0('0x13'),_0x59fc82,_0x1a1f68['error'][_0xd9e0('0x19')]);return _0x3c2dff(_0x1a1f68[_0xd9e0('0x17')][_0xd9e0('0x19')]);}logger[_0xd9e0('0x17')](_0xd9e0('0x13'),_0x59fc82,_0x1a1f68['error'][_0xd9e0('0x19')]);return _0x5341fc(_0x1a1f68[_0xd9e0('0x17')][_0xd9e0('0x19')]);}else{logger['info'](_0xd9e0('0x13'),_0x59fc82,_0xd9e0('0x14'));_0x5341fc(_0x1a1f68[_0xd9e0('0x1a')]['message']);}})[_0xd9e0('0x1b')](function(_0x1cff33){logger[_0xd9e0('0x17')]('MailQueue,\x20%s,\x20%s',_0x59fc82,_0x1cff33);_0x3c2dff(_0x1cff33);});});}exports[_0xd9e0('0x1c')]=function(_0x25bd77){var _0x1a66e0=this;return new Promise(function(_0x53ff39,_0x3748f8){return db['MailQueue'][_0xd9e0('0x1d')]({'raw':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77['options'][_0xd9e0('0x20')]||null:null,'attributes':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x21')]||null:null,'limit':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x22')]||null:null,'include':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x23')],function(_0x142f2b){return{'model':db[_0x142f2b[_0xd9e0('0x25')]],'as':_0x142f2b['as'],'attributes':_0x142f2b[_0xd9e0('0x21')],'include':_0x142f2b[_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x142f2b['include'],function(_0x2930e9){return{'model':db[_0x2930e9['model']],'as':_0x2930e9['as'],'attributes':_0x2930e9[_0xd9e0('0x21')],'include':_0x2930e9[_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x2930e9[_0xd9e0('0x23')],function(_0x5ec31d){return{'model':db[_0x5ec31d[_0xd9e0('0x25')]],'as':_0x5ec31d['as'],'attributes':_0x5ec31d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9e0('0x11')](function(_0x2152de){logger[_0xd9e0('0x12')](_0xd9e0('0x1c'),_0x25bd77);logger[_0xd9e0('0x26')](_0xd9e0('0x1c'),_0x25bd77,JSON[_0xd9e0('0x16')](_0x2152de));_0x53ff39(_0x2152de);})[_0xd9e0('0x1b')](function(_0x3481df){logger[_0xd9e0('0x17')]('GetMailQueue',_0x3481df[_0xd9e0('0x19')],_0x25bd77);_0x3748f8(_0x1a66e0['error'](0x1f4,_0x3481df[_0xd9e0('0x19')]));});});};exports[_0xd9e0('0x27')]=function(_0x302ea2){var _0x2dd01e=this;return new Promise(function(_0x532ee5,_0x5291af){return db['MailQueue'][_0xd9e0('0x28')]({'raw':_0x302ea2['options']?_0x302ea2['options'][_0xd9e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')]['where']||null:null,'attributes':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x21')]||null:null,'include':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x23')],function(_0x1f631f){return{'model':db[_0x1f631f[_0xd9e0('0x25')]],'as':_0x1f631f['as'],'attributes':_0x1f631f[_0xd9e0('0x21')],'include':_0x1f631f['include']?_[_0xd9e0('0x24')](_0x1f631f[_0xd9e0('0x23')],function(_0x530695){return{'model':db[_0x530695['model']],'as':_0x530695['as'],'attributes':_0x530695[_0xd9e0('0x21')],'include':_0x530695['include']?_[_0xd9e0('0x24')](_0x530695[_0xd9e0('0x23')],function(_0x425d15){return{'model':db[_0x425d15['model']],'as':_0x425d15['as'],'attributes':_0x425d15[_0xd9e0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a9721){logger['info'](_0xd9e0('0x27'),_0x302ea2);logger[_0xd9e0('0x26')](_0xd9e0('0x27'),_0x302ea2,JSON[_0xd9e0('0x16')](_0x1a9721));_0x532ee5(_0x1a9721);})[_0xd9e0('0x1b')](function(_0x3ffbf6){logger[_0xd9e0('0x17')](_0xd9e0('0x27'),_0x3ffbf6['message'],_0x302ea2);_0x5291af(_0x2dd01e[_0xd9e0('0x17')](0x1f4,_0x3ffbf6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index a91cb5f..004dfbd 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 _0xddb5=['update','removeListener','register','save','remove'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xddb5,0x120));var _0x5ddb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddb5[_0x3947c9];return _0x2e7871;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x5ddb('0x0'),_0x5ddb('0x1'),_0x5ddb('0x2')];function createListener(_0x57036e,_0x380956){return function(_0x23aeab){_0x380956['emit'](_0x57036e,_0x23aeab);};}function removeListener(_0x3ac537,_0x30af28){return function(){MailQueueEvents[_0x5ddb('0x3')](_0x3ac537,_0x30af28);};}exports[_0x5ddb('0x4')]=function(_0x492b1a){for(var _0x13c63d=0x0,_0x5b745d=events['length'];_0x13c63d<_0x5b745d;_0x13c63d++){var _0x56d13b=events[_0x13c63d];var _0x371c83=createListener('mailQueue:'+_0x56d13b,_0x492b1a);MailQueueEvents['on'](_0x56d13b,_0x371c83);}}; \ No newline at end of file +var _0x0f58=['emit','removeListener','register','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x571fff,_0x335410){var _0x399acb=function(_0x324737){while(--_0x324737){_0x571fff['push'](_0x571fff['shift']());}};_0x399acb(++_0x335410);}(_0x0f58,0x164));var _0x80f5=function(_0x5a07a2,_0x32f99c){_0x5a07a2=_0x5a07a2-0x0;var _0x2238fe=_0x0f58[_0x5a07a2];return _0x2238fe;};'use strict';var MailQueueEvents=require(_0x80f5('0x0'));var events=[_0x80f5('0x1'),_0x80f5('0x2'),_0x80f5('0x3')];function createListener(_0xfce845,_0x5b64d7){return function(_0xabad8b){_0x5b64d7[_0x80f5('0x4')](_0xfce845,_0xabad8b);};}function removeListener(_0x14bc8c,_0x54a59c){return function(){MailQueueEvents[_0x80f5('0x5')](_0x14bc8c,_0x54a59c);};}exports[_0x80f5('0x6')]=function(_0x105437){for(var _0x418af5=0x0,_0x2bec6d=events['length'];_0x418af5<_0x2bec6d;_0x418af5++){var _0x1e981f=events[_0x418af5];var _0x5b232a=createListener(_0x80f5('0x7')+_0x1e981f,_0x105437);MailQueueEvents['on'](_0x1e981f,_0x5b232a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 2aacebd..2658496 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 _0x86d5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','exports','connect-timeout','express'];(function(_0x35cc97,_0x22035f){var _0x35a18a=function(_0x27417f){while(--_0x27417f){_0x35cc97['push'](_0x35cc97['shift']());}};_0x35a18a(++_0x22035f);}(_0x86d5,0xb2));var _0x586d=function(_0xa1a0b1,_0x10d6f6){_0xa1a0b1=_0xa1a0b1-0x0;var _0x22dea3=_0x86d5[_0xa1a0b1];return _0x22dea3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x586d('0x0'));var express=require(_0x586d('0x1'));var router=express[_0x586d('0x2')]();var fs_extra=require(_0x586d('0x3'));var auth=require(_0x586d('0x4'));var interaction=require(_0x586d('0x5'));var config=require(_0x586d('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x586d('0x7')](),controller[_0x586d('0x8')]);router[_0x586d('0x9')]('/describe',auth[_0x586d('0x7')](),controller[_0x586d('0xa')]);router[_0x586d('0x9')](_0x586d('0xb'),auth[_0x586d('0x7')](),controller['show']);router[_0x586d('0xc')]('/',auth[_0x586d('0x7')](),controller[_0x586d('0xd')]);router[_0x586d('0xe')](_0x586d('0xb'),auth[_0x586d('0x7')](),controller[_0x586d('0xf')]);router[_0x586d('0x10')](_0x586d('0xb'),auth[_0x586d('0x7')](),controller['destroy']);module[_0x586d('0x11')]=router; \ No newline at end of file +var _0xa8fc=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0xa8fc,0x1b6));var _0xca8f=function(_0x53a325,_0x53bb14){_0x53a325=_0x53a325-0x0;var _0x4b5fdc=_0xa8fc[_0x53a325];return _0x4b5fdc;};'use strict';var multer=require(_0xca8f('0x0'));var util=require(_0xca8f('0x1'));var path=require('path');var timeout=require(_0xca8f('0x2'));var express=require(_0xca8f('0x3'));var router=express['Router']();var fs_extra=require(_0xca8f('0x4'));var auth=require(_0xca8f('0x5'));var interaction=require(_0xca8f('0x6'));var config=require('../../config/environment');var controller=require(_0xca8f('0x7'));router['get']('/',auth[_0xca8f('0x8')](),controller[_0xca8f('0x9')]);router[_0xca8f('0xa')](_0xca8f('0xb'),auth[_0xca8f('0x8')](),controller[_0xca8f('0xc')]);router[_0xca8f('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xca8f('0xd')]('/',auth[_0xca8f('0x8')](),controller[_0xca8f('0xe')]);router['put'](_0xca8f('0xf'),auth['isAuthenticated'](),controller[_0xca8f('0x10')]);router[_0xca8f('0x11')]('/:id',auth[_0xca8f('0x8')](),controller[_0xca8f('0x12')]);module[_0xca8f('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index e9bf893..4231996 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 _0x064a=['moment','sequelize','exports','STRING','DATE'];(function(_0x4e0b87,_0x1de9ab){var _0x54d25b=function(_0x2f05da){while(--_0x2f05da){_0x4e0b87['push'](_0x4e0b87['shift']());}};_0x54d25b(++_0x1de9ab);}(_0x064a,0x17c));var _0xa064=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x064a[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xa064('0x0'));var Sequelize=require(_0xa064('0x1'));module[_0xa064('0x2')]={'uniqueid':{'type':Sequelize[_0xa064('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa064('0x3')]},'joinAt':{'type':Sequelize[_0xa064('0x4')]},'leaveAt':{'type':Sequelize[_0xa064('0x4')]},'acceptAt':{'type':Sequelize[_0xa064('0x4')]},'exitAt':{'type':Sequelize[_0xa064('0x4')]},'reason':{'type':Sequelize[_0xa064('0x3')]}}; \ No newline at end of file +var _0x444a=['DATE','STRING','moment','exports'];(function(_0x18fe9a,_0x18b3a6){var _0x4b5bfc=function(_0xb22428){while(--_0xb22428){_0x18fe9a['push'](_0x18fe9a['shift']());}};_0x4b5bfc(++_0x18b3a6);}(_0x444a,0xa2));var _0xa444=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0x444a[_0x529296];return _0x1796bf;};'use strict';var moment=require(_0xa444('0x0'));var Sequelize=require('sequelize');module[_0xa444('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa444('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa444('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index deecdaa..42ac292 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 _0x6343=['VIRTUAL','options','MailQueueReport','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x6343,0x168));var _0x3634=function(_0xcf6294,_0x5f2d25){_0xcf6294=_0xcf6294-0x0;var _0x15a655=_0x6343[_0xcf6294];return _0x15a655;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['MailQueueReport'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':!![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['MailQueueReport'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x5e87a3,_0x58c1d1){var _0x69c6ab=function(_0x287844){while(--_0x287844){_0x5e87a3['push'](_0x5e87a3['shift']());}};_0x69c6ab(++_0x58c1d1);}(_0xadb5,0xad));var _0x5adb=function(_0x4f9217,_0x1523d6){_0x4f9217=_0x4f9217-0x0;var _0x46f014=_0xadb5[_0x4f9217];return _0x46f014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['MailQueueReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index e84d439..d18bb72 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 _0x48bd=['define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','bluebird','rimraf','exports'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x48bd,0x1bb));var _0xd48b=function(_0x4c5de5,_0x511138){_0x4c5de5=_0x4c5de5-0x0;var _0x51cb06=_0x48bd[_0x4c5de5];return _0x51cb06;};'use strict';var _=require(_0xd48b('0x0'));var util=require(_0xd48b('0x1'));var logger=require(_0xd48b('0x2'))(_0xd48b('0x3'));var moment=require('moment');var BPromise=require(_0xd48b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd48b('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xd48b('0x6')]=function(_0x2083aa,_0x132b6f){return _0x2083aa[_0xd48b('0x7')](_0xd48b('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xd48b('0x9'),'fields':[_0xd48b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90ec=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','api','moment'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0x90ec,0x159));var _0xc90e=function(_0x2438be,_0x111462){_0x2438be=_0x2438be-0x0;var _0x3f22ba=_0x90ec[_0x2438be];return _0x3f22ba;};'use strict';var _=require(_0xc90e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc90e('0x1'));var moment=require(_0xc90e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc90e('0x3'));var rimraf=require(_0xc90e('0x4'));var config=require(_0xc90e('0x5'));var attributes=require(_0xc90e('0x6'));module[_0xc90e('0x7')]=function(_0x17a201,_0x35301a){return _0x17a201[_0xc90e('0x8')](_0xc90e('0x9'),attributes,{'tableName':_0xc90e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc90e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0696dcd..52b1c34 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x29e124,_0xd208cd){var _0x1371b3=function(_0x1db050){while(--_0x1db050){_0x29e124['push'](_0x29e124['shift']());}};_0x1371b3(++_0xd208cd);}(_0x1261,0x144));var _0x1126=function(_0x4e6eac,_0x3f4365){_0x4e6eac=_0x4e6eac-0x0;var _0x79f963=_0x1261[_0x4e6eac];return _0x79f963;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('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(_0x424f06,_0x38261c){var _0x59412f=function(_0x269ca0){while(--_0x269ca0){_0x424f06['push'](_0x424f06['shift']());}};_0x59412f(++_0x38261c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'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 a21304f..1653197 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x20845d,_0x3a062d){var _0x191f03=function(_0x58a941){while(--_0x58a941){_0x20845d['push'](_0x20845d['shift']());}};_0x191f03(++_0x3a062d);}(_0xe706,0xa3));var _0x6e70=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe706[_0x581249];return _0x284bae;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 36bb8ec..46445ef 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 _0xd64b=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x809fe5,_0x476534){var _0x3c8d4d=function(_0xdd2d9c){while(--_0xdd2d9c){_0x809fe5['push'](_0x809fe5['shift']());}};_0x3c8d4d(++_0x476534);}(_0xd64b,0xc1));var _0xbd64=function(_0x2d0d68,_0x11e7ab){_0x2d0d68=_0x2d0d68-0x0;var _0xb8b405=_0xd64b[_0x2d0d68];return _0xb8b405;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'description':{'type':Sequelize[_0xbd64('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xbd64('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xbd64('0x1')]},'password':{'type':Sequelize[_0xbd64('0x1')]},'port':{'type':Sequelize[_0xbd64('0x3')]},'tls':{'type':Sequelize[_0xbd64('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xbd64('0x1')]}}; \ No newline at end of file +var _0x4fc2=['STRING','INTEGER','INBOX','sequelize','exports'];(function(_0x29ee6b,_0x3e6bc9){var _0x301a35=function(_0x2ccc54){while(--_0x2ccc54){_0x29ee6b['push'](_0x29ee6b['shift']());}};_0x301a35(++_0x3e6bc9);}(_0x4fc2,0x111));var _0x24fc=function(_0x5ae5f7,_0x57076b){_0x5ae5f7=_0x5ae5f7-0x0;var _0x190b76=_0x4fc2[_0x5ae5f7];return _0x190b76;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'description':{'type':Sequelize[_0x24fc('0x2')]},'host':{'type':Sequelize[_0x24fc('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x24fc('0x2')]},'password':{'type':Sequelize[_0x24fc('0x2')]},'port':{'type':Sequelize[_0x24fc('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':_0x24fc('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x24fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 0ed7f2e..4d6c6ba 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 _0x547f=['./mailServerIn.attributes','exports','define','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x547f,0x193));var _0xf547=function(_0x22b86c,_0x16ff4c){_0x22b86c=_0x22b86c-0x0;var _0x24143a=_0x547f[_0x22b86c];return _0x24143a;};'use strict';var _=require(_0xf547('0x0'));var util=require(_0xf547('0x1'));var logger=require('../../config/logger')(_0xf547('0x2'));var moment=require('moment');var BPromise=require(_0xf547('0x3'));var rp=require(_0xf547('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf547('0x5'));var config=require(_0xf547('0x6'));var attributes=require(_0xf547('0x7'));module[_0xf547('0x8')]=function(_0x50c365,_0x906fd9){return _0x50c365[_0xf547('0x9')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3b6=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb3b6,0xa3));var _0x6b3b=function(_0x4c4225,_0x6d3cd0){_0x4c4225=_0x4c4225-0x0;var _0x305576=_0xb3b6[_0x4c4225];return _0x305576;};'use strict';var _=require(_0x6b3b('0x0'));var util=require('util');var logger=require(_0x6b3b('0x1'))(_0x6b3b('0x2'));var moment=require('moment');var BPromise=require(_0x6b3b('0x3'));var rp=require(_0x6b3b('0x4'));var fs=require('fs');var path=require(_0x6b3b('0x5'));var rimraf=require(_0x6b3b('0x6'));var config=require(_0x6b3b('0x7'));var attributes=require(_0x6b3b('0x8'));module[_0x6b3b('0x9')]=function(_0x26e1be,_0x53208b){return _0x26e1be[_0x6b3b('0xa')](_0x6b3b('0xb'),attributes,{'tableName':_0x6b3b('0xc'),'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 07ab237..07fe5e4 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 _0x552a=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','info','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x552a,0xaf));var _0xa552=function(_0x500140,_0x3c574e){_0x500140=_0x500140-0x0;var _0x174ec7=_0x552a[_0x500140];return _0x174ec7;};'use strict';var _=require('lodash');var util=require(_0xa552('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa552('0x1'));var fs=require('fs');var Redis=require(_0xa552('0x2'));var db=require(_0xa552('0x3'))['db'];var utils=require(_0xa552('0x4'));var logger=require('../../config/logger')(_0xa552('0x5'));var config=require('../../config/environment');var jayson=require(_0xa552('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a55bb,_0x341054,_0x42ae3e){return new BPromise(function(_0x26cacf,_0x400561){return client[_0xa552('0x7')](_0x5a55bb,_0x42ae3e)[_0xa552('0x8')](function(_0x47546d){logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));logger[_0xa552('0xb')](_0xa552('0xc'),_0x341054,_0xa552('0xa'),JSON[_0xa552('0xd')](_0x47546d));if(_0x47546d[_0xa552('0xe')]){if(_0x47546d[_0xa552('0xe')][_0xa552('0xf')]===0x1f4){logger[_0xa552('0xe')]('MailServerIn,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x400561(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}logger[_0xa552('0xe')]('MailServerIn,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x26cacf(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}else{logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));_0x26cacf(_0x47546d[_0xa552('0x11')][_0xa552('0x10')]);}})['catch'](function(_0x169be4){logger[_0xa552('0xe')](_0xa552('0x9'),_0x341054,_0x169be4);_0x400561(_0x169be4);});});}exports[_0xa552('0x12')]=function(_0x5780ad){var _0x2db3df=this;return new Promise(function(_0x1cdb04,_0x3616f9){return db[_0xa552('0x13')][_0xa552('0x14')]({'raw':_0x5780ad[_0xa552('0x15')]?_0x5780ad['options'][_0xa552('0x16')]===undefined?!![]:![]:!![],'where':_0x5780ad['options']?_0x5780ad[_0xa552('0x15')][_0xa552('0x17')]||null:null,'attributes':_0x5780ad[_0xa552('0x15')]?_0x5780ad['options'][_0xa552('0x18')]||null:null,'limit':_0x5780ad[_0xa552('0x15')]?_0x5780ad[_0xa552('0x15')][_0xa552('0x19')]||null:null,'include':_0x5780ad[_0xa552('0x15')]?_0x5780ad[_0xa552('0x15')][_0xa552('0x1a')]?_['map'](_0x5780ad[_0xa552('0x15')][_0xa552('0x1a')],function(_0x575a62){return{'model':db[_0x575a62[_0xa552('0x1b')]],'as':_0x575a62['as'],'attributes':_0x575a62['attributes'],'include':_0x575a62[_0xa552('0x1a')]?_[_0xa552('0x1c')](_0x575a62[_0xa552('0x1a')],function(_0xf4d071){return{'model':db[_0xf4d071[_0xa552('0x1b')]],'as':_0xf4d071['as'],'attributes':_0xf4d071['attributes'],'include':_0xf4d071[_0xa552('0x1a')]?_['map'](_0xf4d071['include'],function(_0x36a048){return{'model':db[_0x36a048['model']],'as':_0x36a048['as'],'attributes':_0x36a048[_0xa552('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa552('0x8')](function(_0x5e20e2){logger[_0xa552('0x1d')](_0xa552('0x12'),_0x5780ad);logger[_0xa552('0xb')](_0xa552('0x12'),_0x5780ad,JSON[_0xa552('0xd')](_0x5e20e2));_0x1cdb04(_0x5e20e2);})[_0xa552('0x1e')](function(_0xd1afcf){logger[_0xa552('0xe')]('GetMailServerIn',_0xd1afcf[_0xa552('0x10')],_0x5780ad);_0x3616f9(_0x2db3df[_0xa552('0xe')](0x1f4,_0xd1afcf[_0xa552('0x10')]));});});}; \ No newline at end of file +var _0x20fa=['MailServerIn','options','attributes','limit','include','map','then','debug','lodash','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x20fa,0x166));var _0xa20f=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x20fa[_0x1283d4];return _0x433643;};'use strict';var _=require(_0xa20f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa20f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa20f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa20f('0x3'));var logger=require('../../config/logger')(_0xa20f('0x4'));var config=require('../../config/environment');var jayson=require(_0xa20f('0x5'));var client=jayson['client'][_0xa20f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3363ac,_0x1eb7b5,_0x43f923){return new BPromise(function(_0x4f0a09,_0x50c320){return client[_0xa20f('0x7')](_0x3363ac,_0x43f923)['then'](function(_0x2fd0f6){logger[_0xa20f('0x8')](_0xa20f('0x9'),_0x1eb7b5,_0xa20f('0xa'));logger['debug'](_0xa20f('0xb'),_0x1eb7b5,'request\x20sent',JSON[_0xa20f('0xc')](_0x2fd0f6));if(_0x2fd0f6['error']){if(_0x2fd0f6['error']['code']===0x1f4){logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);return _0x50c320(_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);}logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);return _0x4f0a09(_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);}else{logger[_0xa20f('0x8')](_0xa20f('0x9'),_0x1eb7b5,'request\x20sent');_0x4f0a09(_0x2fd0f6['result']['message']);}})[_0xa20f('0xf')](function(_0x500ee1){logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x500ee1);_0x50c320(_0x500ee1);});});}exports[_0xa20f('0x10')]=function(_0x267d47){var _0x121011=this;return new Promise(function(_0x3e4e33,_0x1753a2){return db[_0xa20f('0x11')]['findAll']({'raw':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x267d47['options']?_0x267d47[_0xa20f('0x12')]['where']||null:null,'attributes':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')][_0xa20f('0x13')]||null:null,'limit':_0x267d47['options']?_0x267d47[_0xa20f('0x12')][_0xa20f('0x14')]||null:null,'include':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')]['include']?_['map'](_0x267d47[_0xa20f('0x12')]['include'],function(_0x428c2f){return{'model':db[_0x428c2f['model']],'as':_0x428c2f['as'],'attributes':_0x428c2f['attributes'],'include':_0x428c2f[_0xa20f('0x15')]?_[_0xa20f('0x16')](_0x428c2f[_0xa20f('0x15')],function(_0x254668){return{'model':db[_0x254668['model']],'as':_0x254668['as'],'attributes':_0x254668[_0xa20f('0x13')],'include':_0x254668[_0xa20f('0x15')]?_[_0xa20f('0x16')](_0x254668[_0xa20f('0x15')],function(_0x4ee42c){return{'model':db[_0x4ee42c['model']],'as':_0x4ee42c['as'],'attributes':_0x4ee42c[_0xa20f('0x13')]};}):[]};}):[]};}):[]:[]})[_0xa20f('0x17')](function(_0x41d90d){logger[_0xa20f('0x8')](_0xa20f('0x10'),_0x267d47);logger[_0xa20f('0x18')](_0xa20f('0x10'),_0x267d47,JSON[_0xa20f('0xc')](_0x41d90d));_0x3e4e33(_0x41d90d);})['catch'](function(_0x3d3b55){logger['error'](_0xa20f('0x10'),_0x3d3b55[_0xa20f('0xe')],_0x267d47);_0x1753a2(_0x121011['error'](0x1f4,_0x3d3b55[_0xa20f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e1f45c4..cd169a4 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 7f91978..18596fd 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 _0xc577=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0xdcd260,_0x6199a3){var _0x410169=function(_0x73ceee){while(--_0x73ceee){_0xdcd260['push'](_0xdcd260['shift']());}};_0x410169(++_0x6199a3);}(_0xc577,0x128));var _0x7c57=function(_0x33ca22,_0xbcc94){_0x33ca22=_0x33ca22-0x0;var _0x1790c3=_0xc577[_0x33ca22];return _0x1790c3;};'use strict';var Sequelize=require(_0x7c57('0x0'));module[_0x7c57('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7c57('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7c57('0x3')]},'secure':{'type':Sequelize[_0x7c57('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3fb4=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1037b2,_0x2dc6cf){var _0x1d3c61=function(_0x303918){while(--_0x303918){_0x1037b2['push'](_0x1037b2['shift']());}};_0x1d3c61(++_0x2dc6cf);}(_0x3fb4,0x97));var _0x43fb=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x3fb4[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0x43fb('0x0'));module[_0x43fb('0x1')]={'description':{'type':Sequelize[_0x43fb('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x43fb('0x2')]},'pass':{'type':Sequelize[_0x43fb('0x2')]},'port':{'type':Sequelize[_0x43fb('0x3')]},'secure':{'type':Sequelize[_0x43fb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x43fb('0x2')]},'authentication':{'type':Sequelize[_0x43fb('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d9c02d0..a0a3291 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 _0xb7c1=['fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','rawAttributes','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x4a6975,_0x4b06ce){var _0x1b38a8=function(_0x3a196d){while(--_0x3a196d){_0x4a6975['push'](_0x4a6975['shift']());}};_0x1b38a8(++_0x4b06ce);}(_0xb7c1,0x1b7));var _0x1b7c=function(_0x5a2e73,_0x43714e){_0x5a2e73=_0x5a2e73-0x0;var _0x2a7a47=_0xb7c1[_0x5a2e73];return _0x2a7a47;};'use strict';var emlformat=require(_0x1b7c('0x0'));var rimraf=require(_0x1b7c('0x1'));var zipdir=require(_0x1b7c('0x2'));var jsonpatch=require(_0x1b7c('0x3'));var rp=require('request-promise');var moment=require(_0x1b7c('0x4'));var BPromise=require(_0x1b7c('0x5'));var Mustache=require(_0x1b7c('0x6'));var util=require(_0x1b7c('0x7'));var path=require(_0x1b7c('0x8'));var sox=require('sox');var csv=require(_0x1b7c('0x9'));var ejs=require(_0x1b7c('0xa'));var fs=require('fs');var fs_extra=require(_0x1b7c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b7c('0xc'));var deskjs=require(_0x1b7c('0xd'));var toCsv=require(_0x1b7c('0x9'));var querystring=require(_0x1b7c('0xe'));var Papa=require(_0x1b7c('0xf'));var Redis=require(_0x1b7c('0x10'));var authService=require(_0x1b7c('0x11'));var qs=require(_0x1b7c('0x12'));var as=require(_0x1b7c('0x13'));var hardwareService=require(_0x1b7c('0x14'));var logger=require(_0x1b7c('0x15'))(_0x1b7c('0x16'));var utils=require(_0x1b7c('0x17'));var config=require(_0x1b7c('0x18'));var licenseUtil=require(_0x1b7c('0x19'));var db=require(_0x1b7c('0x1a'))['db'];function respondWithStatusCode(_0x46ae5f,_0x1e003c){_0x1e003c=_0x1e003c||0xcc;return function(_0x222846){if(_0x222846){return _0x46ae5f[_0x1b7c('0x1b')](_0x1e003c);}return _0x46ae5f[_0x1b7c('0x1c')](_0x1e003c)[_0x1b7c('0x1d')]();};}function respondWithResult(_0x55ebb0,_0x323898){_0x323898=_0x323898||0xc8;return function(_0x3ac70a){if(_0x3ac70a){return _0x55ebb0[_0x1b7c('0x1c')](_0x323898)[_0x1b7c('0x1e')](_0x3ac70a);}};}function respondWithFilteredResult(_0x4a0084,_0x57aa62){return function(_0x584595){if(_0x584595){var _0xe9ad42=typeof _0x57aa62[_0x1b7c('0x1f')]==='undefined'&&typeof _0x57aa62[_0x1b7c('0x20')]==='undefined';var _0x5c1b68=_0x584595[_0x1b7c('0x21')];var _0x10d6f3=_0xe9ad42?0x0:_0x57aa62[_0x1b7c('0x1f')];var _0x56fd92=_0xe9ad42?_0x584595['count']:_0x57aa62[_0x1b7c('0x1f')]+_0x57aa62[_0x1b7c('0x20')];var _0x1dc05d;if(_0x56fd92>=_0x5c1b68){_0x56fd92=_0x5c1b68;_0x1dc05d=0xc8;}else{_0x1dc05d=0xce;}_0x4a0084[_0x1b7c('0x1c')](_0x1dc05d);return _0x4a0084[_0x1b7c('0x22')](_0x1b7c('0x23'),_0x10d6f3+'-'+_0x56fd92+'/'+_0x5c1b68)['json'](_0x584595);}return null;};}function patchUpdates(_0x3e6eee){return function(_0x310685){try{jsonpatch['apply'](_0x310685,_0x3e6eee,!![]);}catch(_0x387efd){return BPromise[_0x1b7c('0x24')](_0x387efd);}return _0x310685['save']();};}function saveUpdates(_0x57c408,_0x1340c2){return function(_0x5b9eab){if(_0x5b9eab){return _0x5b9eab[_0x1b7c('0x25')](_0x57c408)[_0x1b7c('0x26')](function(_0x254875){return _0x254875;});}return null;};}function removeEntity(_0xb833e8,_0x381dc4){return function(_0x515e71){if(_0x515e71){return _0x515e71[_0x1b7c('0x27')]()[_0x1b7c('0x26')](function(){_0xb833e8[_0x1b7c('0x1c')](0xcc)[_0x1b7c('0x1d')]();});}};}function handleEntityNotFound(_0x5be8af,_0x58b2c5){return function(_0x72c3fa){if(!_0x72c3fa){_0x5be8af[_0x1b7c('0x1b')](0x194);}return _0x72c3fa;};}function handleError(_0xa26521,_0x4ddeef){_0x4ddeef=_0x4ddeef||0x1f4;return function(_0x43e70c){logger[_0x1b7c('0x28')](_0x43e70c[_0x1b7c('0x29')]);if(_0x43e70c[_0x1b7c('0x2a')]){delete _0x43e70c[_0x1b7c('0x2a')];}_0xa26521[_0x1b7c('0x1c')](_0x4ddeef)['send'](_0x43e70c);};}exports['index']=function(_0x4a11d6,_0x4b2752){var _0x5cd5d8={},_0x478d44={},_0x5d5ed1={'count':0x0,'rows':[]};var _0x572559=_[_0x1b7c('0x2b')](db[_0x1b7c('0x2c')]['rawAttributes'],function(_0x18559b){return{'name':_0x18559b[_0x1b7c('0x2d')],'type':_0x18559b[_0x1b7c('0x2e')][_0x1b7c('0x2f')]};});_0x478d44[_0x1b7c('0x30')]=_[_0x1b7c('0x2b')](_0x572559,_0x1b7c('0x2a'));_0x478d44[_0x1b7c('0x31')]=_[_0x1b7c('0x32')](_0x4a11d6[_0x1b7c('0x31')]);_0x478d44[_0x1b7c('0x33')]=_[_0x1b7c('0x34')](_0x478d44[_0x1b7c('0x30')],_0x478d44['query']);_0x5cd5d8[_0x1b7c('0x35')]=_[_0x1b7c('0x34')](_0x478d44[_0x1b7c('0x30')],qs[_0x1b7c('0x36')](_0x4a11d6[_0x1b7c('0x31')][_0x1b7c('0x36')]));_0x5cd5d8[_0x1b7c('0x35')]=_0x5cd5d8[_0x1b7c('0x35')][_0x1b7c('0x37')]?_0x5cd5d8[_0x1b7c('0x35')]:_0x478d44['model'];if(!_0x4a11d6[_0x1b7c('0x31')][_0x1b7c('0x38')]('nolimit')){_0x5cd5d8[_0x1b7c('0x20')]=qs[_0x1b7c('0x20')](_0x4a11d6['query'][_0x1b7c('0x20')]);_0x5cd5d8[_0x1b7c('0x1f')]=qs['offset'](_0x4a11d6['query']['offset']);}_0x5cd5d8[_0x1b7c('0x39')]=qs['sort'](_0x4a11d6[_0x1b7c('0x31')][_0x1b7c('0x3a')]);_0x5cd5d8[_0x1b7c('0x3b')]=qs[_0x1b7c('0x33')](_[_0x1b7c('0x3c')](_0x4a11d6[_0x1b7c('0x31')],_0x478d44['filters']),_0x572559);if(_0x4a11d6['query']['filter']){_0x5cd5d8[_0x1b7c('0x3b')]=_[_0x1b7c('0x3d')](_0x5cd5d8[_0x1b7c('0x3b')],{'$or':_[_0x1b7c('0x2b')](_0x572559,function(_0x5d6ef8){if(_0x5d6ef8['type']!==_0x1b7c('0x3e')){var _0x32c6a2={};_0x32c6a2[_0x5d6ef8['name']]={'$like':'%'+_0x4a11d6['query'][_0x1b7c('0x3f')]+'%'};return _0x32c6a2;}})});}_0x5cd5d8=_[_0x1b7c('0x3d')]({},_0x5cd5d8,_0x4a11d6[_0x1b7c('0x40')]);var _0xebde6e={'where':_0x5cd5d8['where']};return db[_0x1b7c('0x2c')][_0x1b7c('0x21')](_0xebde6e)[_0x1b7c('0x26')](function(_0x6a855d){_0x5d5ed1[_0x1b7c('0x21')]=_0x6a855d;if(_0x4a11d6['query'][_0x1b7c('0x41')]){_0x5cd5d8[_0x1b7c('0x42')]=[{'all':!![]}];}return db[_0x1b7c('0x2c')][_0x1b7c('0x43')](_0x5cd5d8);})[_0x1b7c('0x26')](function(_0x45f97f){_0x5d5ed1['rows']=_0x45f97f;return _0x5d5ed1;})[_0x1b7c('0x26')](respondWithFilteredResult(_0x4b2752,_0x5cd5d8))['catch'](handleError(_0x4b2752,null));};exports[_0x1b7c('0x44')]=function(_0xcae120,_0x48be30){var _0x1bee64={'raw':!![],'where':{'id':_0xcae120['params']['id']}},_0x15ff08={};_0x15ff08['model']=_['keys'](db[_0x1b7c('0x2c')][_0x1b7c('0x45')]);_0x15ff08['query']=_['keys'](_0xcae120['query']);_0x15ff08[_0x1b7c('0x33')]=_[_0x1b7c('0x34')](_0x15ff08[_0x1b7c('0x30')],_0x15ff08['query']);_0x1bee64[_0x1b7c('0x35')]=_['intersection'](_0x15ff08[_0x1b7c('0x30')],qs[_0x1b7c('0x36')](_0xcae120[_0x1b7c('0x31')][_0x1b7c('0x36')]));_0x1bee64['attributes']=_0x1bee64[_0x1b7c('0x35')][_0x1b7c('0x37')]?_0x1bee64[_0x1b7c('0x35')]:_0x15ff08[_0x1b7c('0x30')];if(_0xcae120[_0x1b7c('0x31')][_0x1b7c('0x41')]){_0x1bee64['include']=[{'all':!![]}];}_0x1bee64=_[_0x1b7c('0x3d')]({},_0x1bee64,_0xcae120['options']);return db[_0x1b7c('0x2c')]['find'](_0x1bee64)['then'](handleEntityNotFound(_0x48be30,null))[_0x1b7c('0x26')](respondWithResult(_0x48be30,null))[_0x1b7c('0x46')](handleError(_0x48be30,null));};exports[_0x1b7c('0x47')]=function(_0x1aa449,_0x4c3f43){return db[_0x1b7c('0x2c')][_0x1b7c('0x47')](_0x1aa449[_0x1b7c('0x48')],{})['then'](respondWithResult(_0x4c3f43,0xc9))[_0x1b7c('0x46')](handleError(_0x4c3f43,null));};exports[_0x1b7c('0x25')]=function(_0x1a246a,_0x5c5150){if(_0x1a246a[_0x1b7c('0x48')]['id']){delete _0x1a246a[_0x1b7c('0x48')]['id'];}return db[_0x1b7c('0x2c')][_0x1b7c('0x49')]({'where':{'id':_0x1a246a['params']['id']}})[_0x1b7c('0x26')](handleEntityNotFound(_0x5c5150,null))[_0x1b7c('0x26')](saveUpdates(_0x1a246a['body'],null))[_0x1b7c('0x26')](respondWithResult(_0x5c5150,null))[_0x1b7c('0x46')](handleError(_0x5c5150,null));};exports[_0x1b7c('0x27')]=function(_0x3d8b79,_0x4aa35f){return db[_0x1b7c('0x2c')][_0x1b7c('0x49')]({'where':{'id':_0x3d8b79[_0x1b7c('0x4a')]['id']}})[_0x1b7c('0x26')](handleEntityNotFound(_0x4aa35f,null))['then'](removeEntity(_0x4aa35f,null))['catch'](handleError(_0x4aa35f,null));}; \ No newline at end of file +var _0x47c5=['MailServerOut','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x5f14e5,_0x3e2192){var _0x253474=function(_0x311d78){while(--_0x311d78){_0x5f14e5['push'](_0x5f14e5['shift']());}};_0x253474(++_0x3e2192);}(_0x47c5,0xb0));var _0x547c=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x47c5[_0x589248];return _0x486750;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x547c('0x5'));var util=require('util');var path=require(_0x547c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0x7'));var _=require(_0x547c('0x8'));var squel=require(_0x547c('0x9'));var crypto=require(_0x547c('0xa'));var jsforce=require(_0x547c('0xb'));var deskjs=require(_0x547c('0xc'));var toCsv=require(_0x547c('0xd'));var querystring=require(_0x547c('0xe'));var Papa=require(_0x547c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x547c('0x10'));var as=require(_0x547c('0x11'));var hardwareService=require(_0x547c('0x12'));var logger=require(_0x547c('0x13'))(_0x547c('0x14'));var utils=require('../../config/utils');var config=require(_0x547c('0x15'));var licenseUtil=require(_0x547c('0x16'));var db=require(_0x547c('0x17'))['db'];function respondWithStatusCode(_0x182de8,_0x1c50ff){_0x1c50ff=_0x1c50ff||0xcc;return function(_0x574d1f){if(_0x574d1f){return _0x182de8['sendStatus'](_0x1c50ff);}return _0x182de8[_0x547c('0x18')](_0x1c50ff)[_0x547c('0x19')]();};}function respondWithResult(_0x37f24a,_0x31aede){_0x31aede=_0x31aede||0xc8;return function(_0x50d340){if(_0x50d340){return _0x37f24a['status'](_0x31aede)[_0x547c('0x1a')](_0x50d340);}};}function respondWithFilteredResult(_0x4c41f2,_0x28f6fc){return function(_0x2eab37){if(_0x2eab37){var _0x3e6cb0=typeof _0x28f6fc[_0x547c('0x1b')]===_0x547c('0x1c')&&typeof _0x28f6fc[_0x547c('0x1d')]===_0x547c('0x1c');var _0x3278a3=_0x2eab37[_0x547c('0x1e')];var _0x2a5242=_0x3e6cb0?0x0:_0x28f6fc['offset'];var _0x390353=_0x3e6cb0?_0x2eab37['count']:_0x28f6fc[_0x547c('0x1b')]+_0x28f6fc[_0x547c('0x1d')];var _0x3fd845;if(_0x390353>=_0x3278a3){_0x390353=_0x3278a3;_0x3fd845=0xc8;}else{_0x3fd845=0xce;}_0x4c41f2[_0x547c('0x18')](_0x3fd845);return _0x4c41f2[_0x547c('0x1f')]('Content-Range',_0x2a5242+'-'+_0x390353+'/'+_0x3278a3)[_0x547c('0x1a')](_0x2eab37);}return null;};}function patchUpdates(_0xa54fa4){return function(_0x1e4bcd){try{jsonpatch['apply'](_0x1e4bcd,_0xa54fa4,!![]);}catch(_0x5ecaa1){return BPromise[_0x547c('0x20')](_0x5ecaa1);}return _0x1e4bcd[_0x547c('0x21')]();};}function saveUpdates(_0x335342,_0x1d1633){return function(_0x24c407){if(_0x24c407){return _0x24c407[_0x547c('0x22')](_0x335342)[_0x547c('0x23')](function(_0x1afa71){return _0x1afa71;});}return null;};}function removeEntity(_0x467c10,_0x67c0e7){return function(_0x524939){if(_0x524939){return _0x524939[_0x547c('0x24')]()[_0x547c('0x23')](function(){_0x467c10[_0x547c('0x18')](0xcc)[_0x547c('0x19')]();});}};}function handleEntityNotFound(_0x5d0fc1,_0x2fd39b){return function(_0x5bc390){if(!_0x5bc390){_0x5d0fc1[_0x547c('0x25')](0x194);}return _0x5bc390;};}function handleError(_0x3ad52c,_0x5cfa0e){_0x5cfa0e=_0x5cfa0e||0x1f4;return function(_0x14a9f3){logger[_0x547c('0x26')](_0x14a9f3[_0x547c('0x27')]);if(_0x14a9f3['name']){delete _0x14a9f3[_0x547c('0x28')];}_0x3ad52c[_0x547c('0x18')](_0x5cfa0e)[_0x547c('0x29')](_0x14a9f3);};}exports[_0x547c('0x2a')]=function(_0x4af085,_0x54bd5f){var _0x425481={},_0x404067={},_0x37adf8={'count':0x0,'rows':[]};var _0x29d51e=_['map'](db[_0x547c('0x2b')]['rawAttributes'],function(_0x2eafec){return{'name':_0x2eafec['fieldName'],'type':_0x2eafec[_0x547c('0x2c')][_0x547c('0x2d')]};});_0x404067['model']=_[_0x547c('0x2e')](_0x29d51e,_0x547c('0x28'));_0x404067[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x4af085[_0x547c('0x2f')]);_0x404067[_0x547c('0x31')]=_['intersection'](_0x404067[_0x547c('0x32')],_0x404067[_0x547c('0x2f')]);_0x425481[_0x547c('0x33')]=_[_0x547c('0x34')](_0x404067[_0x547c('0x32')],qs[_0x547c('0x35')](_0x4af085[_0x547c('0x2f')][_0x547c('0x35')]));_0x425481[_0x547c('0x33')]=_0x425481[_0x547c('0x33')][_0x547c('0x36')]?_0x425481[_0x547c('0x33')]:_0x404067[_0x547c('0x32')];if(!_0x4af085[_0x547c('0x2f')][_0x547c('0x37')](_0x547c('0x38'))){_0x425481[_0x547c('0x1d')]=qs[_0x547c('0x1d')](_0x4af085[_0x547c('0x2f')][_0x547c('0x1d')]);_0x425481['offset']=qs[_0x547c('0x1b')](_0x4af085[_0x547c('0x2f')][_0x547c('0x1b')]);}_0x425481[_0x547c('0x39')]=qs[_0x547c('0x3a')](_0x4af085[_0x547c('0x2f')][_0x547c('0x3a')]);_0x425481[_0x547c('0x3b')]=qs[_0x547c('0x31')](_[_0x547c('0x3c')](_0x4af085[_0x547c('0x2f')],_0x404067[_0x547c('0x31')]),_0x29d51e);if(_0x4af085['query']['filter']){_0x425481['where']=_[_0x547c('0x3d')](_0x425481[_0x547c('0x3b')],{'$or':_[_0x547c('0x2e')](_0x29d51e,function(_0x389b2c){if(_0x389b2c[_0x547c('0x2c')]!==_0x547c('0x3e')){var _0x44f7c5={};_0x44f7c5[_0x389b2c[_0x547c('0x28')]]={'$like':'%'+_0x4af085[_0x547c('0x2f')]['filter']+'%'};return _0x44f7c5;}})});}_0x425481=_[_0x547c('0x3d')]({},_0x425481,_0x4af085[_0x547c('0x3f')]);var _0x50b41b={'where':_0x425481[_0x547c('0x3b')]};return db[_0x547c('0x2b')][_0x547c('0x1e')](_0x50b41b)[_0x547c('0x23')](function(_0x28b3e2){_0x37adf8['count']=_0x28b3e2;if(_0x4af085[_0x547c('0x2f')][_0x547c('0x40')]){_0x425481[_0x547c('0x41')]=[{'all':!![]}];}return db[_0x547c('0x2b')][_0x547c('0x42')](_0x425481);})[_0x547c('0x23')](function(_0x5b643c){_0x37adf8[_0x547c('0x43')]=_0x5b643c;return _0x37adf8;})[_0x547c('0x23')](respondWithFilteredResult(_0x54bd5f,_0x425481))[_0x547c('0x44')](handleError(_0x54bd5f,null));};exports['show']=function(_0x1dec49,_0x1c8cbd){var _0x38db01={'raw':!![],'where':{'id':_0x1dec49[_0x547c('0x45')]['id']}},_0x5730b4={};_0x5730b4[_0x547c('0x32')]=_[_0x547c('0x30')](db[_0x547c('0x2b')]['rawAttributes']);_0x5730b4[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x1dec49[_0x547c('0x2f')]);_0x5730b4[_0x547c('0x31')]=_[_0x547c('0x34')](_0x5730b4[_0x547c('0x32')],_0x5730b4[_0x547c('0x2f')]);_0x38db01[_0x547c('0x33')]=_[_0x547c('0x34')](_0x5730b4[_0x547c('0x32')],qs[_0x547c('0x35')](_0x1dec49[_0x547c('0x2f')][_0x547c('0x35')]));_0x38db01[_0x547c('0x33')]=_0x38db01[_0x547c('0x33')]['length']?_0x38db01[_0x547c('0x33')]:_0x5730b4[_0x547c('0x32')];if(_0x1dec49['query']['includeAll']){_0x38db01[_0x547c('0x41')]=[{'all':!![]}];}_0x38db01=_['merge']({},_0x38db01,_0x1dec49[_0x547c('0x3f')]);return db[_0x547c('0x2b')][_0x547c('0x46')](_0x38db01)['then'](handleEntityNotFound(_0x1c8cbd,null))[_0x547c('0x23')](respondWithResult(_0x1c8cbd,null))[_0x547c('0x44')](handleError(_0x1c8cbd,null));};exports['create']=function(_0x27bc09,_0xfe0a25){return db[_0x547c('0x2b')][_0x547c('0x47')](_0x27bc09[_0x547c('0x48')],{})[_0x547c('0x23')](respondWithResult(_0xfe0a25,0xc9))['catch'](handleError(_0xfe0a25,null));};exports[_0x547c('0x22')]=function(_0x1f5435,_0x23dbd7){if(_0x1f5435[_0x547c('0x48')]['id']){delete _0x1f5435[_0x547c('0x48')]['id'];}return db[_0x547c('0x2b')][_0x547c('0x46')]({'where':{'id':_0x1f5435[_0x547c('0x45')]['id']}})[_0x547c('0x23')](handleEntityNotFound(_0x23dbd7,null))['then'](saveUpdates(_0x1f5435[_0x547c('0x48')],null))[_0x547c('0x23')](respondWithResult(_0x23dbd7,null))[_0x547c('0x44')](handleError(_0x23dbd7,null));};exports['destroy']=function(_0x52aa71,_0x1cc9da){return db['MailServerOut'][_0x547c('0x46')]({'where':{'id':_0x52aa71[_0x547c('0x45')]['id']}})[_0x547c('0x23')](handleEntityNotFound(_0x1cc9da,null))['then'](removeEntity(_0x1cc9da,null))[_0x547c('0x44')](handleError(_0x1cc9da,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d47a295..072e2ba 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 _0xb3aa=['mail_servers_out','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x5fa8f5,_0x45b975){var _0x362151=function(_0x367640){while(--_0x367640){_0x5fa8f5['push'](_0x5fa8f5['shift']());}};_0x362151(++_0x45b975);}(_0xb3aa,0x1b1));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xab3a('0x0'));var logger=require(_0xab3a('0x1'))('api');var moment=require(_0xab3a('0x2'));var BPromise=require(_0xab3a('0x3'));var rp=require(_0xab3a('0x4'));var fs=require('fs');var path=require(_0xab3a('0x5'));var rimraf=require('rimraf');var config=require(_0xab3a('0x6'));var attributes=require(_0xab3a('0x7'));module[_0xab3a('0x8')]=function(_0x56e957,_0x11e618){return _0x56e957[_0xab3a('0x9')](_0xab3a('0xa'),attributes,{'tableName':_0xab3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaed=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xaaed,0x189));var _0xdaae=function(_0x19a928,_0x3d0493){_0x19a928=_0x19a928-0x0;var _0x282442=_0xaaed[_0x19a928];return _0x282442;};'use strict';var _=require(_0xdaae('0x0'));var util=require(_0xdaae('0x1'));var logger=require(_0xdaae('0x2'))(_0xdaae('0x3'));var moment=require(_0xdaae('0x4'));var BPromise=require(_0xdaae('0x5'));var rp=require(_0xdaae('0x6'));var fs=require('fs');var path=require(_0xdaae('0x7'));var rimraf=require(_0xdaae('0x8'));var config=require(_0xdaae('0x9'));var attributes=require(_0xdaae('0xa'));module[_0xdaae('0xb')]=function(_0x14dac4,_0x339828){return _0x14dac4[_0xdaae('0xc')](_0xdaae('0xd'),attributes,{'tableName':_0xdaae('0xe'),'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 8cc22e1..5c4e0b8 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x512eb9,_0x3bd44e){var _0x26a1d1=function(_0x5c6570){while(--_0x5c6570){_0x512eb9['push'](_0x512eb9['shift']());}};_0x26a1d1(++_0x3bd44e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x59db37,_0x14464c){var _0x3a4d97=function(_0x3e1094){while(--_0x3e1094){_0x59db37['push'](_0x59db37['shift']());}};_0x3a4d97(++_0x14464c);}(_0x2ef3,0xba));var _0x32ef=function(_0x48f6ef,_0x39d187){_0x48f6ef=_0x48f6ef-0x0;var _0x3d8db4=_0x2ef3[_0x48f6ef];return _0x3d8db4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 66a3e0c..9e2f6e5 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 _0x4944=['index','/describe','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x343b0a,_0x586263){var _0x3d8ff8=function(_0x53c629){while(--_0x53c629){_0x343b0a['push'](_0x343b0a['shift']());}};_0x3d8ff8(++_0x586263);}(_0x4944,0x6d));var _0x4494=function(_0x5b5b1b,_0x2b678c){_0x5b5b1b=_0x5b5b1b-0x0;var _0x50bf87=_0x4944[_0x5b5b1b];return _0x50bf87;};'use strict';var multer=require(_0x4494('0x0'));var util=require(_0x4494('0x1'));var path=require(_0x4494('0x2'));var timeout=require('connect-timeout');var express=require(_0x4494('0x3'));var router=express[_0x4494('0x4')]();var fs_extra=require(_0x4494('0x5'));var auth=require(_0x4494('0x6'));var interaction=require(_0x4494('0x7'));var config=require('../../config/environment');var controller=require(_0x4494('0x8'));router[_0x4494('0x9')]('/',auth[_0x4494('0xa')](),controller[_0x4494('0xb')]);router[_0x4494('0x9')](_0x4494('0xc'),auth[_0x4494('0xa')](),controller['describe']);router[_0x4494('0x9')](_0x4494('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4494('0xe')]('/',auth['isAuthenticated'](),controller[_0x4494('0xf')]);router[_0x4494('0x10')]('/:id',auth[_0x4494('0xa')](),controller[_0x4494('0x11')]);router[_0x4494('0x12')](_0x4494('0xd'),auth[_0x4494('0xa')](),controller[_0x4494('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5248=['../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','destroy','exports','multer','connect-timeout','Router','fs-extra'];(function(_0x5f76e3,_0x977880){var _0x4a5558=function(_0x1340d4){while(--_0x1340d4){_0x5f76e3['push'](_0x5f76e3['shift']());}};_0x4a5558(++_0x977880);}(_0x5248,0x84));var _0x8524=function(_0x22c0d4,_0x416c7d){_0x22c0d4=_0x22c0d4-0x0;var _0xacede6=_0x5248[_0x22c0d4];return _0xacede6;};'use strict';var multer=require(_0x8524('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8524('0x1'));var express=require('express');var router=express[_0x8524('0x2')]();var fs_extra=require(_0x8524('0x3'));var auth=require(_0x8524('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8524('0x5'));var controller=require(_0x8524('0x6'));router['get']('/',auth[_0x8524('0x7')](),controller[_0x8524('0x8')]);router[_0x8524('0x9')](_0x8524('0xa'),auth['isAuthenticated'](),controller[_0x8524('0xb')]);router[_0x8524('0x9')](_0x8524('0xc'),auth[_0x8524('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8524('0xd')]);router[_0x8524('0xe')](_0x8524('0xc'),auth[_0x8524('0x7')](),controller['update']);router['delete'](_0x8524('0xc'),auth[_0x8524('0x7')](),controller[_0x8524('0xf')]);module[_0x8524('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 8f34d10..90d9221 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 _0xcde7=['name','STRING'];(function(_0x49ebb3,_0x56e2e7){var _0x4e8cd1=function(_0x1a8a45){while(--_0x1a8a45){_0x49ebb3['push'](_0x49ebb3['shift']());}};_0x4e8cd1(++_0x56e2e7);}(_0xcde7,0x65));var _0x7cde=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcde7[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7cde('0x0')],'unique':_0x7cde('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7cde('0x0')]}}; \ No newline at end of file +var _0x7a54=['STRING','sequelize','exports'];(function(_0x5ddf23,_0x319603){var _0x24b5f5=function(_0x59efb2){while(--_0x59efb2){_0x5ddf23['push'](_0x5ddf23['shift']());}};_0x24b5f5(++_0x319603);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1396,_0xaaebad){_0x1c1396=_0x1c1396-0x0;var _0x5f0b85=_0x7a54[_0x1c1396];return _0x5f0b85;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2967524..4f3b110 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 _0xa1a1=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','MailSubstatus','includeAll','include','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x423736,_0x1417b9){var _0x184f2d=function(_0x43c721){while(--_0x43c721){_0x423736['push'](_0x423736['shift']());}};_0x184f2d(++_0x1417b9);}(_0xa1a1,0x91));var _0x1a1a=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xa1a1[_0x292f93];return _0x5a94b1;};'use strict';var emlformat=require(_0x1a1a('0x0'));var rimraf=require(_0x1a1a('0x1'));var zipdir=require(_0x1a1a('0x2'));var jsonpatch=require(_0x1a1a('0x3'));var rp=require(_0x1a1a('0x4'));var moment=require(_0x1a1a('0x5'));var BPromise=require(_0x1a1a('0x6'));var Mustache=require(_0x1a1a('0x7'));var util=require(_0x1a1a('0x8'));var path=require(_0x1a1a('0x9'));var sox=require(_0x1a1a('0xa'));var csv=require(_0x1a1a('0xb'));var ejs=require(_0x1a1a('0xc'));var fs=require('fs');var fs_extra=require(_0x1a1a('0xd'));var _=require(_0x1a1a('0xe'));var squel=require(_0x1a1a('0xf'));var crypto=require(_0x1a1a('0x10'));var jsforce=require(_0x1a1a('0x11'));var deskjs=require(_0x1a1a('0x12'));var toCsv=require('to-csv');var querystring=require(_0x1a1a('0x13'));var Papa=require(_0x1a1a('0x14'));var Redis=require('ioredis');var authService=require(_0x1a1a('0x15'));var qs=require(_0x1a1a('0x16'));var as=require(_0x1a1a('0x17'));var hardwareService=require(_0x1a1a('0x18'));var logger=require(_0x1a1a('0x19'))(_0x1a1a('0x1a'));var utils=require(_0x1a1a('0x1b'));var config=require(_0x1a1a('0x1c'));var licenseUtil=require(_0x1a1a('0x1d'));var db=require(_0x1a1a('0x1e'))['db'];function respondWithStatusCode(_0x2c82dd,_0x402fd2){_0x402fd2=_0x402fd2||0xcc;return function(_0x2924a6){if(_0x2924a6){return _0x2c82dd['sendStatus'](_0x402fd2);}return _0x2c82dd[_0x1a1a('0x1f')](_0x402fd2)[_0x1a1a('0x20')]();};}function respondWithResult(_0x4abc21,_0x451851){_0x451851=_0x451851||0xc8;return function(_0xd2e9d){if(_0xd2e9d){return _0x4abc21[_0x1a1a('0x1f')](_0x451851)[_0x1a1a('0x21')](_0xd2e9d);}};}function respondWithFilteredResult(_0xdc83be,_0x3d56ac){return function(_0x1f7fa1){if(_0x1f7fa1){var _0x320794=typeof _0x3d56ac[_0x1a1a('0x22')]===_0x1a1a('0x23')&&typeof _0x3d56ac[_0x1a1a('0x24')]===_0x1a1a('0x23');var _0x16f9ba=_0x1f7fa1['count'];var _0x25a2ae=_0x320794?0x0:_0x3d56ac['offset'];var _0x1e704c=_0x320794?_0x1f7fa1[_0x1a1a('0x25')]:_0x3d56ac[_0x1a1a('0x22')]+_0x3d56ac[_0x1a1a('0x24')];var _0x149f2c;if(_0x1e704c>=_0x16f9ba){_0x1e704c=_0x16f9ba;_0x149f2c=0xc8;}else{_0x149f2c=0xce;}_0xdc83be[_0x1a1a('0x1f')](_0x149f2c);return _0xdc83be[_0x1a1a('0x26')](_0x1a1a('0x27'),_0x25a2ae+'-'+_0x1e704c+'/'+_0x16f9ba)['json'](_0x1f7fa1);}return null;};}function patchUpdates(_0x411081){return function(_0xdadff){try{jsonpatch['apply'](_0xdadff,_0x411081,!![]);}catch(_0x3b601f){return BPromise['reject'](_0x3b601f);}return _0xdadff[_0x1a1a('0x28')]();};}function saveUpdates(_0x60905d,_0x53d27a){return function(_0x104fdb){if(_0x104fdb){return _0x104fdb['update'](_0x60905d)[_0x1a1a('0x29')](function(_0xa7a305){return _0xa7a305;});}return null;};}function removeEntity(_0x397ea8,_0x53cd98){return function(_0x3ec3ec){if(_0x3ec3ec){return _0x3ec3ec[_0x1a1a('0x2a')]()[_0x1a1a('0x29')](function(){_0x397ea8[_0x1a1a('0x1f')](0xcc)[_0x1a1a('0x20')]();});}};}function handleEntityNotFound(_0x1e3bc2,_0x5035e7){return function(_0x57750d){if(!_0x57750d){_0x1e3bc2[_0x1a1a('0x2b')](0x194);}return _0x57750d;};}function handleError(_0x40df2e,_0x5b8bc5){_0x5b8bc5=_0x5b8bc5||0x1f4;return function(_0x32fca4){logger[_0x1a1a('0x2c')](_0x32fca4[_0x1a1a('0x2d')]);if(_0x32fca4[_0x1a1a('0x2e')]){delete _0x32fca4[_0x1a1a('0x2e')];}_0x40df2e[_0x1a1a('0x1f')](_0x5b8bc5)[_0x1a1a('0x2f')](_0x32fca4);};}exports[_0x1a1a('0x30')]=function(_0x44fb40,_0x3cac88){var _0x50e7b4={},_0x46041c={},_0x3e3e52={'count':0x0,'rows':[]};var _0x6fe2e4=_[_0x1a1a('0x31')](db['MailSubstatus'][_0x1a1a('0x32')],function(_0x186558){return{'name':_0x186558['fieldName'],'type':_0x186558[_0x1a1a('0x33')][_0x1a1a('0x34')]};});_0x46041c['model']=_['map'](_0x6fe2e4,_0x1a1a('0x2e'));_0x46041c[_0x1a1a('0x35')]=_['keys'](_0x44fb40[_0x1a1a('0x35')]);_0x46041c[_0x1a1a('0x36')]=_[_0x1a1a('0x37')](_0x46041c[_0x1a1a('0x38')],_0x46041c[_0x1a1a('0x35')]);_0x50e7b4[_0x1a1a('0x39')]=_[_0x1a1a('0x37')](_0x46041c['model'],qs['fields'](_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x3a')]));_0x50e7b4[_0x1a1a('0x39')]=_0x50e7b4[_0x1a1a('0x39')][_0x1a1a('0x3b')]?_0x50e7b4[_0x1a1a('0x39')]:_0x46041c[_0x1a1a('0x38')];if(!_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x3c')](_0x1a1a('0x3d'))){_0x50e7b4[_0x1a1a('0x24')]=qs['limit'](_0x44fb40['query'][_0x1a1a('0x24')]);_0x50e7b4[_0x1a1a('0x22')]=qs[_0x1a1a('0x22')](_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x22')]);}_0x50e7b4[_0x1a1a('0x3e')]=qs[_0x1a1a('0x3f')](_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x3f')]);_0x50e7b4[_0x1a1a('0x40')]=qs['filters'](_['pick'](_0x44fb40[_0x1a1a('0x35')],_0x46041c['filters']),_0x6fe2e4);if(_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x41')]){_0x50e7b4[_0x1a1a('0x40')]=_['merge'](_0x50e7b4[_0x1a1a('0x40')],{'$or':_['map'](_0x6fe2e4,function(_0x54b985){if(_0x54b985[_0x1a1a('0x33')]!==_0x1a1a('0x42')){var _0x29fdd5={};_0x29fdd5[_0x54b985['name']]={'$like':'%'+_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x41')]+'%'};return _0x29fdd5;}})});}_0x50e7b4=_[_0x1a1a('0x43')]({},_0x50e7b4,_0x44fb40[_0x1a1a('0x44')]);var _0x2e8ba0={'where':_0x50e7b4[_0x1a1a('0x40')]};return db[_0x1a1a('0x45')][_0x1a1a('0x25')](_0x2e8ba0)['then'](function(_0x1161cb){_0x3e3e52[_0x1a1a('0x25')]=_0x1161cb;if(_0x44fb40[_0x1a1a('0x35')][_0x1a1a('0x46')]){_0x50e7b4[_0x1a1a('0x47')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x50e7b4);})[_0x1a1a('0x29')](function(_0x1f5c1d){_0x3e3e52[_0x1a1a('0x48')]=_0x1f5c1d;return _0x3e3e52;})[_0x1a1a('0x29')](respondWithFilteredResult(_0x3cac88,_0x50e7b4))['catch'](handleError(_0x3cac88,null));};exports[_0x1a1a('0x49')]=function(_0xf4d64f,_0xe64d72){var _0x1af269={'raw':!![],'where':{'id':_0xf4d64f[_0x1a1a('0x4a')]['id']}},_0x2d72dd={};_0x2d72dd['model']=_[_0x1a1a('0x4b')](db[_0x1a1a('0x45')]['rawAttributes']);_0x2d72dd['query']=_[_0x1a1a('0x4b')](_0xf4d64f[_0x1a1a('0x35')]);_0x2d72dd[_0x1a1a('0x36')]=_[_0x1a1a('0x37')](_0x2d72dd[_0x1a1a('0x38')],_0x2d72dd[_0x1a1a('0x35')]);_0x1af269['attributes']=_[_0x1a1a('0x37')](_0x2d72dd[_0x1a1a('0x38')],qs[_0x1a1a('0x3a')](_0xf4d64f[_0x1a1a('0x35')]['fields']));_0x1af269[_0x1a1a('0x39')]=_0x1af269['attributes'][_0x1a1a('0x3b')]?_0x1af269[_0x1a1a('0x39')]:_0x2d72dd['model'];if(_0xf4d64f[_0x1a1a('0x35')][_0x1a1a('0x46')]){_0x1af269[_0x1a1a('0x47')]=[{'all':!![]}];}_0x1af269=_[_0x1a1a('0x43')]({},_0x1af269,_0xf4d64f[_0x1a1a('0x44')]);return db[_0x1a1a('0x45')][_0x1a1a('0x4c')](_0x1af269)[_0x1a1a('0x29')](handleEntityNotFound(_0xe64d72,null))[_0x1a1a('0x29')](respondWithResult(_0xe64d72,null))[_0x1a1a('0x4d')](handleError(_0xe64d72,null));};exports[_0x1a1a('0x4e')]=function(_0x5a51c2,_0x589b54){return db[_0x1a1a('0x45')][_0x1a1a('0x4e')](_0x5a51c2[_0x1a1a('0x4f')],{})['then'](respondWithResult(_0x589b54,0xc9))[_0x1a1a('0x4d')](handleError(_0x589b54,null));};exports['update']=function(_0x5345fe,_0x1bf9eb){if(_0x5345fe['body']['id']){delete _0x5345fe[_0x1a1a('0x4f')]['id'];}return db[_0x1a1a('0x45')][_0x1a1a('0x4c')]({'where':{'id':_0x5345fe['params']['id']}})[_0x1a1a('0x29')](handleEntityNotFound(_0x1bf9eb,null))[_0x1a1a('0x29')](saveUpdates(_0x5345fe[_0x1a1a('0x4f')],null))[_0x1a1a('0x29')](respondWithResult(_0x1bf9eb,null))[_0x1a1a('0x4d')](handleError(_0x1bf9eb,null));};exports[_0x1a1a('0x2a')]=function(_0x77edf4,_0x5b84fd){return db[_0x1a1a('0x45')][_0x1a1a('0x4c')]({'where':{'id':_0x77edf4[_0x1a1a('0x4a')]['id']}})[_0x1a1a('0x29')](handleEntityNotFound(_0x5b84fd,null))['then'](removeEntity(_0x5b84fd,null))['catch'](handleError(_0x5b84fd,null));};exports[_0x1a1a('0x50')]=function(_0x1af99e,_0x950ff2){return db[_0x1a1a('0x45')]['describe']()[_0x1a1a('0x29')](respondWithResult(_0x950ff2,null))[_0x1a1a('0x4d')](handleError(_0x950ff2,null));}; \ No newline at end of file +var _0xd5c4=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','MailSubstatus','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x58a48a,_0x925cbb){var _0x2c98df=function(_0x596248){while(--_0x596248){_0x58a48a['push'](_0x58a48a['shift']());}};_0x2c98df(++_0x925cbb);}(_0xd5c4,0x10a));var _0x4d5c=function(_0x48280d,_0x2cf7d1){_0x48280d=_0x48280d-0x0;var _0x45d0ed=_0xd5c4[_0x48280d];return _0x45d0ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d5c('0x0'));var jsonpatch=require(_0x4d5c('0x1'));var rp=require(_0x4d5c('0x2'));var moment=require(_0x4d5c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d5c('0x4'));var path=require(_0x4d5c('0x5'));var sox=require('sox');var csv=require(_0x4d5c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d5c('0x7'));var squel=require('squel');var crypto=require(_0x4d5c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x4d5c('0x9'));var toCsv=require(_0x4d5c('0x6'));var querystring=require('querystring');var Papa=require(_0x4d5c('0xa'));var Redis=require(_0x4d5c('0xb'));var authService=require(_0x4d5c('0xc'));var qs=require(_0x4d5c('0xd'));var as=require(_0x4d5c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5c('0xf'))(_0x4d5c('0x10'));var utils=require(_0x4d5c('0x11'));var config=require(_0x4d5c('0x12'));var licenseUtil=require(_0x4d5c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4068e7,_0x484ed4){_0x484ed4=_0x484ed4||0xcc;return function(_0x251347){if(_0x251347){return _0x4068e7[_0x4d5c('0x14')](_0x484ed4);}return _0x4068e7[_0x4d5c('0x15')](_0x484ed4)[_0x4d5c('0x16')]();};}function respondWithResult(_0x1befdf,_0x3ae226){_0x3ae226=_0x3ae226||0xc8;return function(_0x30fc0f){if(_0x30fc0f){return _0x1befdf['status'](_0x3ae226)['json'](_0x30fc0f);}};}function respondWithFilteredResult(_0x4f07bb,_0x58fff2){return function(_0xba830f){if(_0xba830f){var _0x33fa4d=typeof _0x58fff2[_0x4d5c('0x17')]===_0x4d5c('0x18')&&typeof _0x58fff2[_0x4d5c('0x19')]===_0x4d5c('0x18');var _0xaad82e=_0xba830f[_0x4d5c('0x1a')];var _0x27c0f0=_0x33fa4d?0x0:_0x58fff2[_0x4d5c('0x17')];var _0x2bb886=_0x33fa4d?_0xba830f['count']:_0x58fff2['offset']+_0x58fff2[_0x4d5c('0x19')];var _0x377e9e;if(_0x2bb886>=_0xaad82e){_0x2bb886=_0xaad82e;_0x377e9e=0xc8;}else{_0x377e9e=0xce;}_0x4f07bb[_0x4d5c('0x15')](_0x377e9e);return _0x4f07bb[_0x4d5c('0x1b')]('Content-Range',_0x27c0f0+'-'+_0x2bb886+'/'+_0xaad82e)[_0x4d5c('0x1c')](_0xba830f);}return null;};}function patchUpdates(_0x17ef6b){return function(_0x2fca7e){try{jsonpatch['apply'](_0x2fca7e,_0x17ef6b,!![]);}catch(_0x171c2a){return BPromise[_0x4d5c('0x1d')](_0x171c2a);}return _0x2fca7e['save']();};}function saveUpdates(_0x139241,_0x987754){return function(_0x59fd7a){if(_0x59fd7a){return _0x59fd7a[_0x4d5c('0x1e')](_0x139241)[_0x4d5c('0x1f')](function(_0x5dff7e){return _0x5dff7e;});}return null;};}function removeEntity(_0x39d5e1,_0x5be400){return function(_0x51b934){if(_0x51b934){return _0x51b934['destroy']()[_0x4d5c('0x1f')](function(){_0x39d5e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x446549,_0x22202e){return function(_0x27e914){if(!_0x27e914){_0x446549[_0x4d5c('0x14')](0x194);}return _0x27e914;};}function handleError(_0x360fb3,_0x21f46e){_0x21f46e=_0x21f46e||0x1f4;return function(_0x5013d0){logger[_0x4d5c('0x20')](_0x5013d0[_0x4d5c('0x21')]);if(_0x5013d0[_0x4d5c('0x22')]){delete _0x5013d0[_0x4d5c('0x22')];}_0x360fb3['status'](_0x21f46e)[_0x4d5c('0x23')](_0x5013d0);};}exports[_0x4d5c('0x24')]=function(_0xb383f4,_0x1ddc01){var _0x3e7262={},_0x11ee59={},_0x521dd8={'count':0x0,'rows':[]};var _0x572b14=_[_0x4d5c('0x25')](db['MailSubstatus'][_0x4d5c('0x26')],function(_0x4d9583){return{'name':_0x4d9583['fieldName'],'type':_0x4d9583[_0x4d5c('0x27')][_0x4d5c('0x28')]};});_0x11ee59[_0x4d5c('0x29')]=_[_0x4d5c('0x25')](_0x572b14,'name');_0x11ee59[_0x4d5c('0x2a')]=_[_0x4d5c('0x2b')](_0xb383f4['query']);_0x11ee59['filters']=_[_0x4d5c('0x2c')](_0x11ee59[_0x4d5c('0x29')],_0x11ee59[_0x4d5c('0x2a')]);_0x3e7262['attributes']=_['intersection'](_0x11ee59[_0x4d5c('0x29')],qs[_0x4d5c('0x2d')](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x2d')]));_0x3e7262[_0x4d5c('0x2e')]=_0x3e7262[_0x4d5c('0x2e')][_0x4d5c('0x2f')]?_0x3e7262['attributes']:_0x11ee59[_0x4d5c('0x29')];if(!_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x30')](_0x4d5c('0x31'))){_0x3e7262['limit']=qs['limit'](_0xb383f4['query'][_0x4d5c('0x19')]);_0x3e7262['offset']=qs[_0x4d5c('0x17')](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x17')]);}_0x3e7262['order']=qs['sort'](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x32')]);_0x3e7262['where']=qs[_0x4d5c('0x33')](_[_0x4d5c('0x34')](_0xb383f4['query'],_0x11ee59[_0x4d5c('0x33')]),_0x572b14);if(_0xb383f4['query'][_0x4d5c('0x35')]){_0x3e7262[_0x4d5c('0x36')]=_[_0x4d5c('0x37')](_0x3e7262[_0x4d5c('0x36')],{'$or':_[_0x4d5c('0x25')](_0x572b14,function(_0x4facc6){if(_0x4facc6[_0x4d5c('0x27')]!=='VIRTUAL'){var _0x188767={};_0x188767[_0x4facc6['name']]={'$like':'%'+_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x35')]+'%'};return _0x188767;}})});}_0x3e7262=_[_0x4d5c('0x37')]({},_0x3e7262,_0xb383f4[_0x4d5c('0x38')]);var _0x235355={'where':_0x3e7262[_0x4d5c('0x36')]};return db[_0x4d5c('0x39')][_0x4d5c('0x1a')](_0x235355)[_0x4d5c('0x1f')](function(_0xe413fb){_0x521dd8['count']=_0xe413fb;if(_0xb383f4['query'][_0x4d5c('0x3a')]){_0x3e7262[_0x4d5c('0x3b')]=[{'all':!![]}];}return db[_0x4d5c('0x39')][_0x4d5c('0x3c')](_0x3e7262);})[_0x4d5c('0x1f')](function(_0x8f6919){_0x521dd8[_0x4d5c('0x3d')]=_0x8f6919;return _0x521dd8;})[_0x4d5c('0x1f')](respondWithFilteredResult(_0x1ddc01,_0x3e7262))['catch'](handleError(_0x1ddc01,null));};exports[_0x4d5c('0x3e')]=function(_0x59874a,_0x21cdc5){var _0x586154={'raw':!![],'where':{'id':_0x59874a[_0x4d5c('0x3f')]['id']}},_0x2220c1={};_0x2220c1[_0x4d5c('0x29')]=_[_0x4d5c('0x2b')](db['MailSubstatus']['rawAttributes']);_0x2220c1[_0x4d5c('0x2a')]=_['keys'](_0x59874a[_0x4d5c('0x2a')]);_0x2220c1[_0x4d5c('0x33')]=_[_0x4d5c('0x2c')](_0x2220c1[_0x4d5c('0x29')],_0x2220c1['query']);_0x586154[_0x4d5c('0x2e')]=_[_0x4d5c('0x2c')](_0x2220c1[_0x4d5c('0x29')],qs[_0x4d5c('0x2d')](_0x59874a[_0x4d5c('0x2a')][_0x4d5c('0x2d')]));_0x586154['attributes']=_0x586154[_0x4d5c('0x2e')][_0x4d5c('0x2f')]?_0x586154[_0x4d5c('0x2e')]:_0x2220c1[_0x4d5c('0x29')];if(_0x59874a[_0x4d5c('0x2a')]['includeAll']){_0x586154[_0x4d5c('0x3b')]=[{'all':!![]}];}_0x586154=_[_0x4d5c('0x37')]({},_0x586154,_0x59874a[_0x4d5c('0x38')]);return db[_0x4d5c('0x39')][_0x4d5c('0x40')](_0x586154)[_0x4d5c('0x1f')](handleEntityNotFound(_0x21cdc5,null))[_0x4d5c('0x1f')](respondWithResult(_0x21cdc5,null))[_0x4d5c('0x41')](handleError(_0x21cdc5,null));};exports[_0x4d5c('0x42')]=function(_0x172e71,_0x2781e3){return db[_0x4d5c('0x39')][_0x4d5c('0x42')](_0x172e71['body'],{})[_0x4d5c('0x1f')](respondWithResult(_0x2781e3,0xc9))['catch'](handleError(_0x2781e3,null));};exports[_0x4d5c('0x1e')]=function(_0x2908c0,_0x3ff168){if(_0x2908c0[_0x4d5c('0x43')]['id']){delete _0x2908c0[_0x4d5c('0x43')]['id'];}return db[_0x4d5c('0x39')][_0x4d5c('0x40')]({'where':{'id':_0x2908c0['params']['id']}})[_0x4d5c('0x1f')](handleEntityNotFound(_0x3ff168,null))[_0x4d5c('0x1f')](saveUpdates(_0x2908c0[_0x4d5c('0x43')],null))[_0x4d5c('0x1f')](respondWithResult(_0x3ff168,null))['catch'](handleError(_0x3ff168,null));};exports[_0x4d5c('0x44')]=function(_0x139e0c,_0x1781d7){return db[_0x4d5c('0x39')][_0x4d5c('0x40')]({'where':{'id':_0x139e0c[_0x4d5c('0x3f')]['id']}})[_0x4d5c('0x1f')](handleEntityNotFound(_0x1781d7,null))[_0x4d5c('0x1f')](removeEntity(_0x1781d7,null))['catch'](handleError(_0x1781d7,null));};exports[_0x4d5c('0x45')]=function(_0x5af21c,_0x199fcb){return db['MailSubstatus']['describe']()[_0x4d5c('0x1f')](respondWithResult(_0x199fcb,null))[_0x4d5c('0x41')](handleError(_0x199fcb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 17fddf8..bdacd70 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 _0x54aa=['rimraf','../../config/environment','exports','define','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x469d6c,_0x144b53){var _0xb1c543=function(_0x4ee34d){while(--_0x4ee34d){_0x469d6c['push'](_0x469d6c['shift']());}};_0xb1c543(++_0x144b53);}(_0x54aa,0x123));var _0xa54a=function(_0x301bbf,_0xfb706f){_0x301bbf=_0x301bbf-0x0;var _0x572615=_0x54aa[_0x301bbf];return _0x572615;};'use strict';var _=require(_0xa54a('0x0'));var util=require(_0xa54a('0x1'));var logger=require(_0xa54a('0x2'))(_0xa54a('0x3'));var moment=require(_0xa54a('0x4'));var BPromise=require(_0xa54a('0x5'));var rp=require(_0xa54a('0x6'));var fs=require('fs');var path=require(_0xa54a('0x7'));var rimraf=require(_0xa54a('0x8'));var config=require(_0xa54a('0x9'));var attributes=require('./mailSubstatus.attributes');module[_0xa54a('0xa')]=function(_0x363b28,_0x23012d){return _0x363b28[_0xa54a('0xb')]('MailSubstatus',attributes,{'tableName':_0xa54a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36d0=['bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','../../config/logger','api','moment'];(function(_0x47b50b,_0x3210df){var _0x408532=function(_0x25c0c1){while(--_0x25c0c1){_0x47b50b['push'](_0x47b50b['shift']());}};_0x408532(++_0x3210df);}(_0x36d0,0x171));var _0x036d=function(_0x4fc40f,_0x1a66b8){_0x4fc40f=_0x4fc40f-0x0;var _0x1ec033=_0x36d0[_0x4fc40f];return _0x1ec033;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x036d('0x0'))(_0x036d('0x1'));var moment=require(_0x036d('0x2'));var BPromise=require(_0x036d('0x3'));var rp=require(_0x036d('0x4'));var fs=require('fs');var path=require(_0x036d('0x5'));var rimraf=require(_0x036d('0x6'));var config=require(_0x036d('0x7'));var attributes=require(_0x036d('0x8'));module[_0x036d('0x9')]=function(_0x7e08b4,_0x49b74e){return _0x7e08b4[_0x036d('0xa')]('MailSubstatus',attributes,{'tableName':_0x036d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index efc44c0..f5a91f3 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 _0xed31=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent'];(function(_0xca517f,_0x3c6a5e){var _0x213c45=function(_0x28ea51){while(--_0x28ea51){_0xca517f['push'](_0xca517f['shift']());}};_0x213c45(++_0x3c6a5e);}(_0xed31,0x117));var _0x1ed3=function(_0x181322,_0x21ebc8){_0x181322=_0x181322-0x0;var _0x7e377c=_0xed31[_0x181322];return _0x7e377c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ed3('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ed3('0x1'))['db'];var utils=require(_0x1ed3('0x2'));var logger=require('../../config/logger')(_0x1ed3('0x3'));var config=require('../../config/environment');var jayson=require(_0x1ed3('0x4'));var client=jayson[_0x1ed3('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36332e,_0x1db249,_0x4f9aa6){return new BPromise(function(_0x211446,_0x5ef3e4){return client[_0x1ed3('0x6')](_0x36332e,_0x4f9aa6)[_0x1ed3('0x7')](function(_0x57c93d){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x1db249,_0x1ed3('0x8'));logger[_0x1ed3('0x9')](_0x1ed3('0xa'),_0x1db249,_0x1ed3('0x8'),JSON[_0x1ed3('0xb')](_0x57c93d));if(_0x57c93d[_0x1ed3('0xc')]){if(_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xd')]===0x1f4){logger[_0x1ed3('0xc')](_0x1ed3('0xe'),_0x1db249,_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);return _0x5ef3e4(_0x57c93d['error']['message']);}logger['error'](_0x1ed3('0xe'),_0x1db249,_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);return _0x211446(_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);}else{logger[_0x1ed3('0x10')](_0x1ed3('0xe'),_0x1db249,'request\x20sent');_0x211446(_0x57c93d[_0x1ed3('0x11')][_0x1ed3('0xf')]);}})['catch'](function(_0xa8ec06){logger[_0x1ed3('0xc')](_0x1ed3('0xe'),_0x1db249,_0xa8ec06);_0x5ef3e4(_0xa8ec06);});});} \ No newline at end of file +var _0xab5d=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','MailSubstatus,\x20%s,\x20%s','result','util'];(function(_0x32f87c,_0x319327){var _0x1518e4=function(_0x37a649){while(--_0x37a649){_0x32f87c['push'](_0x32f87c['shift']());}};_0x1518e4(++_0x319327);}(_0xab5d,0x71));var _0xdab5=function(_0x12b181,_0x52dff9){_0x12b181=_0x12b181-0x0;var _0x3cb8cd=_0xab5d[_0x12b181];return _0x3cb8cd;};'use strict';var _=require('lodash');var util=require(_0xdab5('0x0'));var moment=require(_0xdab5('0x1'));var BPromise=require('bluebird');var rs=require(_0xdab5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdab5('0x3'))['db'];var utils=require(_0xdab5('0x4'));var logger=require(_0xdab5('0x5'))(_0xdab5('0x6'));var config=require(_0xdab5('0x7'));var jayson=require(_0xdab5('0x8'));var client=jayson[_0xdab5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476b1f,_0x4e7256,_0x46f331){return new BPromise(function(_0x169def,_0x8cca32){return client['request'](_0x476b1f,_0x46f331)['then'](function(_0x3ed97f){logger[_0xdab5('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0xdab5('0xb'));logger[_0xdab5('0xc')](_0xdab5('0xd'),_0x4e7256,_0xdab5('0xb'),JSON[_0xdab5('0xe')](_0x3ed97f));if(_0x3ed97f[_0xdab5('0xf')]){if(_0x3ed97f[_0xdab5('0xf')]['code']===0x1f4){logger[_0xdab5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);return _0x8cca32(_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);}logger[_0xdab5('0xf')](_0xdab5('0x11'),_0x4e7256,_0x3ed97f[_0xdab5('0xf')]['message']);return _0x169def(_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);}else{logger[_0xdab5('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0xdab5('0xb'));_0x169def(_0x3ed97f[_0xdab5('0x12')]['message']);}})['catch'](function(_0x7ae1c8){logger[_0xdab5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0x7ae1c8);_0x8cca32(_0x7ae1c8);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9d38b0d..3bc04ac 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 _0xf4ad=['index','describe','post','create','put','update','delete','/:id','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x31e1bc,_0x3b8aca){var _0x1e6a48=function(_0x395226){while(--_0x395226){_0x31e1bc['push'](_0x31e1bc['shift']());}};_0x1e6a48(++_0x3b8aca);}(_0xf4ad,0x15f));var _0xdf4a=function(_0x5ace25,_0x536239){_0x5ace25=_0x5ace25-0x0;var _0x4ba17a=_0xf4ad[_0x5ace25];return _0x4ba17a;};'use strict';var multer=require(_0xdf4a('0x0'));var util=require('util');var path=require(_0xdf4a('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf4a('0x2'));var router=express[_0xdf4a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf4a('0x4'));var interaction=require(_0xdf4a('0x5'));var config=require(_0xdf4a('0x6'));var controller=require('./mailTransferReport.controller');router[_0xdf4a('0x7')]('/',auth[_0xdf4a('0x8')](),controller[_0xdf4a('0x9')]);router['get']('/describe',auth[_0xdf4a('0x8')](),controller[_0xdf4a('0xa')]);router[_0xdf4a('0x7')]('/:id',auth[_0xdf4a('0x8')](),controller['show']);router[_0xdf4a('0xb')]('/',auth[_0xdf4a('0x8')](),controller[_0xdf4a('0xc')]);router[_0xdf4a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xdf4a('0xe')]);router[_0xdf4a('0xf')](_0xdf4a('0x10'),auth[_0xdf4a('0x8')](),controller['destroy']);module[_0xdf4a('0x11')]=router; \ No newline at end of file +var _0x10ac=['destroy','exports','util','path','connect-timeout','Router','fs-extra','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id'];(function(_0x41deb2,_0x365783){var _0x572115=function(_0x380fca){while(--_0x380fca){_0x41deb2['push'](_0x41deb2['shift']());}};_0x572115(++_0x365783);}(_0x10ac,0x9a));var _0xc10a=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0x10ac[_0x146dd7];return _0x2af0bb;};'use strict';var multer=require('multer');var util=require(_0xc10a('0x0'));var path=require(_0xc10a('0x1'));var timeout=require(_0xc10a('0x2'));var express=require('express');var router=express[_0xc10a('0x3')]();var fs_extra=require(_0xc10a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc10a('0x5'));router[_0xc10a('0x6')]('/',auth[_0xc10a('0x7')](),controller[_0xc10a('0x8')]);router[_0xc10a('0x6')](_0xc10a('0x9'),auth[_0xc10a('0x7')](),controller[_0xc10a('0xa')]);router[_0xc10a('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc10a('0xb')]);router[_0xc10a('0xc')]('/',auth[_0xc10a('0x7')](),controller[_0xc10a('0xd')]);router[_0xc10a('0xe')]('/:id',auth[_0xc10a('0x7')](),controller[_0xc10a('0xf')]);router['delete'](_0xc10a('0x10'),auth['isAuthenticated'](),controller[_0xc10a('0x11')]);module[_0xc10a('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7fc677c..3c12f6c 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x47a838,_0x1c7e1e){var _0x560260=function(_0x1efd32){while(--_0x1efd32){_0x47a838['push'](_0x47a838['shift']());}};_0x560260(++_0x1c7e1e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0xf3cd[_0x2e7a43];return _0x52e9e1;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1369a2,_0x55cbed){var _0x4d1891=function(_0x5c26e6){while(--_0x5c26e6){_0x1369a2['push'](_0x1369a2['shift']());}};_0x4d1891(++_0x55cbed);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 110448c..b6f9b56 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 _0x387f=['end','json','count','offset','limit','status','Content-Range','apply','reject','save','destroy','then','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x4adb19,_0x3d3761){var _0x10274b=function(_0x73ca64){while(--_0x73ca64){_0x4adb19['push'](_0x4adb19['shift']());}};_0x10274b(++_0x3d3761);}(_0x387f,0x19c));var _0xf387=function(_0xa06b3f,_0x2cee0b){_0xa06b3f=_0xa06b3f-0x0;var _0x1c007e=_0x387f[_0xa06b3f];return _0x1c007e;};'use strict';var emlformat=require(_0xf387('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf387('0x1'));var jsonpatch=require(_0xf387('0x2'));var rp=require('request-promise');var moment=require(_0xf387('0x3'));var BPromise=require(_0xf387('0x4'));var Mustache=require(_0xf387('0x5'));var util=require(_0xf387('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf387('0x7'));var ejs=require(_0xf387('0x8'));var fs=require('fs');var fs_extra=require(_0xf387('0x9'));var _=require('lodash');var squel=require(_0xf387('0xa'));var crypto=require(_0xf387('0xb'));var jsforce=require(_0xf387('0xc'));var deskjs=require(_0xf387('0xd'));var toCsv=require(_0xf387('0x7'));var querystring=require(_0xf387('0xe'));var Papa=require(_0xf387('0xf'));var Redis=require(_0xf387('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf387('0x11'));var as=require(_0xf387('0x12'));var hardwareService=require(_0xf387('0x13'));var logger=require(_0xf387('0x14'))(_0xf387('0x15'));var utils=require(_0xf387('0x16'));var config=require(_0xf387('0x17'));var licenseUtil=require(_0xf387('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120598,_0x4be1a6){_0x4be1a6=_0x4be1a6||0xcc;return function(_0x2a1364){if(_0x2a1364){return _0x120598[_0xf387('0x19')](_0x4be1a6);}return _0x120598['status'](_0x4be1a6)[_0xf387('0x1a')]();};}function respondWithResult(_0x4a2144,_0xa3b5a9){_0xa3b5a9=_0xa3b5a9||0xc8;return function(_0x2a93f0){if(_0x2a93f0){return _0x4a2144['status'](_0xa3b5a9)[_0xf387('0x1b')](_0x2a93f0);}};}function respondWithFilteredResult(_0x50b3c3,_0x227c25){return function(_0x47c1c3){if(_0x47c1c3){var _0x3da3ba=typeof _0x227c25['offset']==='undefined'&&typeof _0x227c25['limit']==='undefined';var _0xdf80f2=_0x47c1c3[_0xf387('0x1c')];var _0x5573e6=_0x3da3ba?0x0:_0x227c25[_0xf387('0x1d')];var _0x5cfc11=_0x3da3ba?_0x47c1c3['count']:_0x227c25['offset']+_0x227c25[_0xf387('0x1e')];var _0x2344b7;if(_0x5cfc11>=_0xdf80f2){_0x5cfc11=_0xdf80f2;_0x2344b7=0xc8;}else{_0x2344b7=0xce;}_0x50b3c3[_0xf387('0x1f')](_0x2344b7);return _0x50b3c3['set'](_0xf387('0x20'),_0x5573e6+'-'+_0x5cfc11+'/'+_0xdf80f2)['json'](_0x47c1c3);}return null;};}function patchUpdates(_0x27227c){return function(_0x1d9783){try{jsonpatch[_0xf387('0x21')](_0x1d9783,_0x27227c,!![]);}catch(_0x2e6fe1){return BPromise[_0xf387('0x22')](_0x2e6fe1);}return _0x1d9783[_0xf387('0x23')]();};}function saveUpdates(_0x3be7d5,_0x364247){return function(_0x5d00cb){if(_0x5d00cb){return _0x5d00cb['update'](_0x3be7d5)['then'](function(_0x39d87e){return _0x39d87e;});}return null;};}function removeEntity(_0x401799,_0x5003d9){return function(_0x2ad27e){if(_0x2ad27e){return _0x2ad27e[_0xf387('0x24')]()[_0xf387('0x25')](function(){_0x401799['status'](0xcc)[_0xf387('0x1a')]();});}};}function handleEntityNotFound(_0x2be85b,_0x2c856e){return function(_0x3d677d){if(!_0x3d677d){_0x2be85b[_0xf387('0x19')](0x194);}return _0x3d677d;};}function handleError(_0x332edc,_0x4fb2ac){_0x4fb2ac=_0x4fb2ac||0x1f4;return function(_0x229dac){logger[_0xf387('0x26')](_0x229dac['stack']);if(_0x229dac[_0xf387('0x27')]){delete _0x229dac[_0xf387('0x27')];}_0x332edc['status'](_0x4fb2ac)['send'](_0x229dac);};}exports[_0xf387('0x28')]=function(_0x34ecfc,_0x472a1e){var _0x16d4de={},_0x2410a1={},_0x4d3bd7={'count':0x0,'rows':[]};var _0x490e7e=_[_0xf387('0x29')](db[_0xf387('0x2a')][_0xf387('0x2b')],function(_0x2fcfae){return{'name':_0x2fcfae[_0xf387('0x2c')],'type':_0x2fcfae[_0xf387('0x2d')]['key']};});_0x2410a1['model']=_[_0xf387('0x29')](_0x490e7e,_0xf387('0x27'));_0x2410a1[_0xf387('0x2e')]=_['keys'](_0x34ecfc[_0xf387('0x2e')]);_0x2410a1['filters']=_[_0xf387('0x2f')](_0x2410a1[_0xf387('0x30')],_0x2410a1[_0xf387('0x2e')]);_0x16d4de[_0xf387('0x31')]=_[_0xf387('0x2f')](_0x2410a1['model'],qs[_0xf387('0x32')](_0x34ecfc['query'][_0xf387('0x32')]));_0x16d4de[_0xf387('0x31')]=_0x16d4de['attributes']['length']?_0x16d4de['attributes']:_0x2410a1[_0xf387('0x30')];if(!_0x34ecfc[_0xf387('0x2e')]['hasOwnProperty'](_0xf387('0x33'))){_0x16d4de[_0xf387('0x1e')]=qs[_0xf387('0x1e')](_0x34ecfc[_0xf387('0x2e')][_0xf387('0x1e')]);_0x16d4de[_0xf387('0x1d')]=qs[_0xf387('0x1d')](_0x34ecfc['query'][_0xf387('0x1d')]);}_0x16d4de[_0xf387('0x34')]=qs[_0xf387('0x35')](_0x34ecfc[_0xf387('0x2e')][_0xf387('0x35')]);_0x16d4de[_0xf387('0x36')]=qs[_0xf387('0x37')](_[_0xf387('0x38')](_0x34ecfc[_0xf387('0x2e')],_0x2410a1[_0xf387('0x37')]),_0x490e7e);if(_0x34ecfc[_0xf387('0x2e')][_0xf387('0x39')]){_0x16d4de[_0xf387('0x36')]=_['merge'](_0x16d4de[_0xf387('0x36')],{'$or':_[_0xf387('0x29')](_0x490e7e,function(_0x498e1a){if(_0x498e1a[_0xf387('0x2d')]!==_0xf387('0x3a')){var _0x59ef32={};_0x59ef32[_0x498e1a[_0xf387('0x27')]]={'$like':'%'+_0x34ecfc[_0xf387('0x2e')][_0xf387('0x39')]+'%'};return _0x59ef32;}})});}_0x16d4de=_[_0xf387('0x3b')]({},_0x16d4de,_0x34ecfc['options']);var _0x360422={'where':_0x16d4de[_0xf387('0x36')]};return db['MailTransferReport']['count'](_0x360422)[_0xf387('0x25')](function(_0x1fec0d){_0x4d3bd7[_0xf387('0x1c')]=_0x1fec0d;if(_0x34ecfc['query']['includeAll']){_0x16d4de[_0xf387('0x3c')]=[{'all':!![]}];}return db[_0xf387('0x2a')][_0xf387('0x3d')](_0x16d4de);})[_0xf387('0x25')](function(_0x48f14f){_0x4d3bd7[_0xf387('0x3e')]=_0x48f14f;return _0x4d3bd7;})[_0xf387('0x25')](respondWithFilteredResult(_0x472a1e,_0x16d4de))[_0xf387('0x3f')](handleError(_0x472a1e,null));};exports[_0xf387('0x40')]=function(_0x112512,_0x5293b4){var _0x15c81d={'raw':!![],'where':{'id':_0x112512[_0xf387('0x41')]['id']}},_0x26ae1a={};_0x26ae1a['model']=_[_0xf387('0x42')](db[_0xf387('0x2a')][_0xf387('0x2b')]);_0x26ae1a[_0xf387('0x2e')]=_[_0xf387('0x42')](_0x112512[_0xf387('0x2e')]);_0x26ae1a[_0xf387('0x37')]=_[_0xf387('0x2f')](_0x26ae1a[_0xf387('0x30')],_0x26ae1a[_0xf387('0x2e')]);_0x15c81d[_0xf387('0x31')]=_[_0xf387('0x2f')](_0x26ae1a[_0xf387('0x30')],qs[_0xf387('0x32')](_0x112512[_0xf387('0x2e')][_0xf387('0x32')]));_0x15c81d['attributes']=_0x15c81d[_0xf387('0x31')][_0xf387('0x43')]?_0x15c81d[_0xf387('0x31')]:_0x26ae1a[_0xf387('0x30')];if(_0x112512['query']['includeAll']){_0x15c81d[_0xf387('0x3c')]=[{'all':!![]}];}_0x15c81d=_['merge']({},_0x15c81d,_0x112512[_0xf387('0x44')]);return db[_0xf387('0x2a')][_0xf387('0x45')](_0x15c81d)['then'](handleEntityNotFound(_0x5293b4,null))[_0xf387('0x25')](respondWithResult(_0x5293b4,null))[_0xf387('0x3f')](handleError(_0x5293b4,null));};exports['create']=function(_0x58895e,_0x442cfe){return db[_0xf387('0x2a')][_0xf387('0x46')](_0x58895e[_0xf387('0x47')],{})['then'](respondWithResult(_0x442cfe,0xc9))[_0xf387('0x3f')](handleError(_0x442cfe,null));};exports[_0xf387('0x48')]=function(_0x18e7fc,_0x2ef96d){if(_0x18e7fc[_0xf387('0x47')]['id']){delete _0x18e7fc[_0xf387('0x47')]['id'];}return db[_0xf387('0x2a')][_0xf387('0x45')]({'where':{'id':_0x18e7fc[_0xf387('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ef96d,null))[_0xf387('0x25')](saveUpdates(_0x18e7fc[_0xf387('0x47')],null))[_0xf387('0x25')](respondWithResult(_0x2ef96d,null))[_0xf387('0x3f')](handleError(_0x2ef96d,null));};exports[_0xf387('0x24')]=function(_0x1485e4,_0x3cd454){return db['MailTransferReport'][_0xf387('0x45')]({'where':{'id':_0x1485e4[_0xf387('0x41')]['id']}})['then'](handleEntityNotFound(_0x3cd454,null))['then'](removeEntity(_0x3cd454,null))['catch'](handleError(_0x3cd454,null));};exports['describe']=function(_0x18fc11,_0x2f1f78){return db[_0xf387('0x2a')]['describe']()[_0xf387('0x25')](respondWithResult(_0x2f1f78,null))[_0xf387('0x3f')](handleError(_0x2f1f78,null));}; \ No newline at end of file +var _0xd122=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','attributes','length','find','catch','create','body','rimraf','zip-dir','util','sox'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xd122,0x120));var _0x2d12=function(_0x2d4f2f,_0x250960){_0x2d4f2f=_0x2d4f2f-0x0;var _0xa6ee1a=_0xd122[_0x2d4f2f];return _0xa6ee1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d12('0x0'));var zipdir=require(_0x2d12('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d12('0x2'));var path=require('path');var sox=require(_0x2d12('0x3'));var csv=require('to-csv');var ejs=require(_0x2d12('0x4'));var fs=require('fs');var fs_extra=require(_0x2d12('0x5'));var _=require(_0x2d12('0x6'));var squel=require(_0x2d12('0x7'));var crypto=require(_0x2d12('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2d12('0x9'));var toCsv=require(_0x2d12('0xa'));var querystring=require(_0x2d12('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d12('0xc'));var qs=require(_0x2d12('0xd'));var as=require(_0x2d12('0xe'));var hardwareService=require(_0x2d12('0xf'));var logger=require(_0x2d12('0x10'))(_0x2d12('0x11'));var utils=require(_0x2d12('0x12'));var config=require(_0x2d12('0x13'));var licenseUtil=require(_0x2d12('0x14'));var db=require(_0x2d12('0x15'))['db'];function respondWithStatusCode(_0x548758,_0x4b728a){_0x4b728a=_0x4b728a||0xcc;return function(_0x1c28e3){if(_0x1c28e3){return _0x548758[_0x2d12('0x16')](_0x4b728a);}return _0x548758[_0x2d12('0x17')](_0x4b728a)[_0x2d12('0x18')]();};}function respondWithResult(_0x5900aa,_0x290b65){_0x290b65=_0x290b65||0xc8;return function(_0x48c45d){if(_0x48c45d){return _0x5900aa[_0x2d12('0x17')](_0x290b65)['json'](_0x48c45d);}};}function respondWithFilteredResult(_0x54b160,_0x13eef9){return function(_0x11de53){if(_0x11de53){var _0xbfbd7c=typeof _0x13eef9['offset']===_0x2d12('0x19')&&typeof _0x13eef9['limit']===_0x2d12('0x19');var _0x5053f9=_0x11de53[_0x2d12('0x1a')];var _0x106bc5=_0xbfbd7c?0x0:_0x13eef9[_0x2d12('0x1b')];var _0x57577e=_0xbfbd7c?_0x11de53['count']:_0x13eef9['offset']+_0x13eef9[_0x2d12('0x1c')];var _0x20361b;if(_0x57577e>=_0x5053f9){_0x57577e=_0x5053f9;_0x20361b=0xc8;}else{_0x20361b=0xce;}_0x54b160[_0x2d12('0x17')](_0x20361b);return _0x54b160[_0x2d12('0x1d')]('Content-Range',_0x106bc5+'-'+_0x57577e+'/'+_0x5053f9)[_0x2d12('0x1e')](_0x11de53);}return null;};}function patchUpdates(_0x234175){return function(_0x14f885){try{jsonpatch[_0x2d12('0x1f')](_0x14f885,_0x234175,!![]);}catch(_0x4ed6c2){return BPromise['reject'](_0x4ed6c2);}return _0x14f885[_0x2d12('0x20')]();};}function saveUpdates(_0xdf02a0,_0x47db66){return function(_0x2f852c){if(_0x2f852c){return _0x2f852c[_0x2d12('0x21')](_0xdf02a0)[_0x2d12('0x22')](function(_0x1df0e6){return _0x1df0e6;});}return null;};}function removeEntity(_0x1e3db9,_0x33dc41){return function(_0x2b1b82){if(_0x2b1b82){return _0x2b1b82[_0x2d12('0x23')]()[_0x2d12('0x22')](function(){_0x1e3db9[_0x2d12('0x17')](0xcc)[_0x2d12('0x18')]();});}};}function handleEntityNotFound(_0x118f97,_0x4516be){return function(_0x21af9b){if(!_0x21af9b){_0x118f97[_0x2d12('0x16')](0x194);}return _0x21af9b;};}function handleError(_0x22f4a1,_0x29bca7){_0x29bca7=_0x29bca7||0x1f4;return function(_0x50c0c3){logger[_0x2d12('0x24')](_0x50c0c3[_0x2d12('0x25')]);if(_0x50c0c3[_0x2d12('0x26')]){delete _0x50c0c3[_0x2d12('0x26')];}_0x22f4a1[_0x2d12('0x17')](_0x29bca7)[_0x2d12('0x27')](_0x50c0c3);};}exports[_0x2d12('0x28')]=function(_0x83009f,_0x2aa262){var _0x5db9f4={},_0x2f8b29={},_0x5bda79={'count':0x0,'rows':[]};var _0xbb1c05=_[_0x2d12('0x29')](db[_0x2d12('0x2a')][_0x2d12('0x2b')],function(_0x1a12dd){return{'name':_0x1a12dd[_0x2d12('0x2c')],'type':_0x1a12dd[_0x2d12('0x2d')][_0x2d12('0x2e')]};});_0x2f8b29[_0x2d12('0x2f')]=_[_0x2d12('0x29')](_0xbb1c05,'name');_0x2f8b29[_0x2d12('0x30')]=_[_0x2d12('0x31')](_0x83009f[_0x2d12('0x30')]);_0x2f8b29[_0x2d12('0x32')]=_[_0x2d12('0x33')](_0x2f8b29[_0x2d12('0x2f')],_0x2f8b29[_0x2d12('0x30')]);_0x5db9f4['attributes']=_[_0x2d12('0x33')](_0x2f8b29['model'],qs[_0x2d12('0x34')](_0x83009f[_0x2d12('0x30')][_0x2d12('0x34')]));_0x5db9f4['attributes']=_0x5db9f4['attributes']['length']?_0x5db9f4['attributes']:_0x2f8b29['model'];if(!_0x83009f['query'][_0x2d12('0x35')](_0x2d12('0x36'))){_0x5db9f4[_0x2d12('0x1c')]=qs['limit'](_0x83009f['query'][_0x2d12('0x1c')]);_0x5db9f4[_0x2d12('0x1b')]=qs[_0x2d12('0x1b')](_0x83009f[_0x2d12('0x30')][_0x2d12('0x1b')]);}_0x5db9f4[_0x2d12('0x37')]=qs[_0x2d12('0x38')](_0x83009f[_0x2d12('0x30')]['sort']);_0x5db9f4[_0x2d12('0x39')]=qs[_0x2d12('0x32')](_['pick'](_0x83009f[_0x2d12('0x30')],_0x2f8b29[_0x2d12('0x32')]),_0xbb1c05);if(_0x83009f[_0x2d12('0x30')][_0x2d12('0x3a')]){_0x5db9f4[_0x2d12('0x39')]=_[_0x2d12('0x3b')](_0x5db9f4[_0x2d12('0x39')],{'$or':_[_0x2d12('0x29')](_0xbb1c05,function(_0x567e73){if(_0x567e73[_0x2d12('0x2d')]!=='VIRTUAL'){var _0x4a82b7={};_0x4a82b7[_0x567e73[_0x2d12('0x26')]]={'$like':'%'+_0x83009f['query']['filter']+'%'};return _0x4a82b7;}})});}_0x5db9f4=_[_0x2d12('0x3b')]({},_0x5db9f4,_0x83009f[_0x2d12('0x3c')]);var _0x493915={'where':_0x5db9f4[_0x2d12('0x39')]};return db[_0x2d12('0x2a')][_0x2d12('0x1a')](_0x493915)[_0x2d12('0x22')](function(_0x153521){_0x5bda79[_0x2d12('0x1a')]=_0x153521;if(_0x83009f[_0x2d12('0x30')][_0x2d12('0x3d')]){_0x5db9f4[_0x2d12('0x3e')]=[{'all':!![]}];}return db[_0x2d12('0x2a')][_0x2d12('0x3f')](_0x5db9f4);})[_0x2d12('0x22')](function(_0x183fce){_0x5bda79[_0x2d12('0x40')]=_0x183fce;return _0x5bda79;})['then'](respondWithFilteredResult(_0x2aa262,_0x5db9f4))['catch'](handleError(_0x2aa262,null));};exports[_0x2d12('0x41')]=function(_0xba53c7,_0x2d85e7){var _0x2774e6={'raw':!![],'where':{'id':_0xba53c7[_0x2d12('0x42')]['id']}},_0x3b1c06={};_0x3b1c06[_0x2d12('0x2f')]=_[_0x2d12('0x31')](db[_0x2d12('0x2a')]['rawAttributes']);_0x3b1c06[_0x2d12('0x30')]=_['keys'](_0xba53c7[_0x2d12('0x30')]);_0x3b1c06[_0x2d12('0x32')]=_[_0x2d12('0x33')](_0x3b1c06['model'],_0x3b1c06[_0x2d12('0x30')]);_0x2774e6[_0x2d12('0x43')]=_[_0x2d12('0x33')](_0x3b1c06[_0x2d12('0x2f')],qs[_0x2d12('0x34')](_0xba53c7['query'][_0x2d12('0x34')]));_0x2774e6[_0x2d12('0x43')]=_0x2774e6[_0x2d12('0x43')][_0x2d12('0x44')]?_0x2774e6[_0x2d12('0x43')]:_0x3b1c06[_0x2d12('0x2f')];if(_0xba53c7[_0x2d12('0x30')][_0x2d12('0x3d')]){_0x2774e6[_0x2d12('0x3e')]=[{'all':!![]}];}_0x2774e6=_[_0x2d12('0x3b')]({},_0x2774e6,_0xba53c7[_0x2d12('0x3c')]);return db['MailTransferReport'][_0x2d12('0x45')](_0x2774e6)[_0x2d12('0x22')](handleEntityNotFound(_0x2d85e7,null))['then'](respondWithResult(_0x2d85e7,null))[_0x2d12('0x46')](handleError(_0x2d85e7,null));};exports[_0x2d12('0x47')]=function(_0x359db8,_0x1ef762){return db[_0x2d12('0x2a')]['create'](_0x359db8[_0x2d12('0x48')],{})[_0x2d12('0x22')](respondWithResult(_0x1ef762,0xc9))[_0x2d12('0x46')](handleError(_0x1ef762,null));};exports[_0x2d12('0x21')]=function(_0x2d749a,_0x163f3a){if(_0x2d749a[_0x2d12('0x48')]['id']){delete _0x2d749a[_0x2d12('0x48')]['id'];}return db[_0x2d12('0x2a')][_0x2d12('0x45')]({'where':{'id':_0x2d749a['params']['id']}})[_0x2d12('0x22')](handleEntityNotFound(_0x163f3a,null))[_0x2d12('0x22')](saveUpdates(_0x2d749a[_0x2d12('0x48')],null))[_0x2d12('0x22')](respondWithResult(_0x163f3a,null))[_0x2d12('0x46')](handleError(_0x163f3a,null));};exports[_0x2d12('0x23')]=function(_0x3e3cf3,_0x379388){return db[_0x2d12('0x2a')][_0x2d12('0x45')]({'where':{'id':_0x3e3cf3['params']['id']}})[_0x2d12('0x22')](handleEntityNotFound(_0x379388,null))['then'](removeEntity(_0x379388,null))['catch'](handleError(_0x379388,null));};exports['describe']=function(_0x1d88b8,_0x5842c9){return db[_0x2d12('0x2a')]['describe']()[_0x2d12('0x22')](respondWithResult(_0x5842c9,null))[_0x2d12('0x46')](handleError(_0x5842c9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index bbd2b9e..a85d2c9 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 _0xb957=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','../../config/logger'];(function(_0x1dc8dc,_0x384acb){var _0x9b6337=function(_0x77f445){while(--_0x77f445){_0x1dc8dc['push'](_0x1dc8dc['shift']());}};_0x9b6337(++_0x384acb);}(_0xb957,0x6d));var _0x7b95=function(_0x538384,_0xafbcef){_0x538384=_0x538384-0x0;var _0x36a5b7=_0xb957[_0x538384];return _0x36a5b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b95('0x0'))('api');var moment=require(_0x7b95('0x1'));var BPromise=require(_0x7b95('0x2'));var rp=require(_0x7b95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var attributes=require(_0x7b95('0x6'));module[_0x7b95('0x7')]=function(_0x19ff14,_0x518099){return _0x19ff14[_0x7b95('0x8')](_0x7b95('0x9'),attributes,{'tableName':_0x7b95('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x59cf=['exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','path','rimraf','../../config/environment'];(function(_0xcb1100,_0x2354a7){var _0xb144de=function(_0x3bc9ee){while(--_0x3bc9ee){_0xcb1100['push'](_0xcb1100['shift']());}};_0xb144de(++_0x2354a7);}(_0x59cf,0x158));var _0xf59c=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x59cf[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0xf59c('0x0'));var util=require(_0xf59c('0x1'));var logger=require(_0xf59c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf59c('0x3'));var rimraf=require(_0xf59c('0x4'));var config=require(_0xf59c('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0xf59c('0x6')]=function(_0x584078,_0x13e2de){return _0x584078[_0xf59c('0x7')]('MailTransferReport',attributes,{'tableName':_0xf59c('0x8'),'paranoid':![],'indexes':[{'name':_0xf59c('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 2b9e174..0550f83 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 _0xed87=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x29f2c0,_0x1522c6){var _0x46a946=function(_0x447b61){while(--_0x447b61){_0x29f2c0['push'](_0x29f2c0['shift']());}};_0x46a946(++_0x1522c6);}(_0xed87,0x110));var _0x7ed8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xed87[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x7ed8('0x0'));var moment=require(_0x7ed8('0x1'));var BPromise=require(_0x7ed8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ed8('0x3'));var db=require(_0x7ed8('0x4'))['db'];var utils=require(_0x7ed8('0x5'));var logger=require(_0x7ed8('0x6'))('rpc');var config=require(_0x7ed8('0x7'));var jayson=require(_0x7ed8('0x8'));var client=jayson[_0x7ed8('0x9')][_0x7ed8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39b8b8,_0xbd4890,_0x3e7ad3){return new BPromise(function(_0x407180,_0x4b7c41){return client['request'](_0x39b8b8,_0x3e7ad3)[_0x7ed8('0xb')](function(_0x73a76f){logger[_0x7ed8('0xc')](_0x7ed8('0xd'),_0xbd4890,_0x7ed8('0xe'));logger[_0x7ed8('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xbd4890,_0x7ed8('0xe'),JSON['stringify'](_0x73a76f));if(_0x73a76f[_0x7ed8('0x10')]){if(_0x73a76f['error']['code']===0x1f4){logger[_0x7ed8('0x10')](_0x7ed8('0xd'),_0xbd4890,_0x73a76f['error'][_0x7ed8('0x11')]);return _0x4b7c41(_0x73a76f[_0x7ed8('0x10')][_0x7ed8('0x11')]);}logger[_0x7ed8('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xbd4890,_0x73a76f[_0x7ed8('0x10')][_0x7ed8('0x11')]);return _0x407180(_0x73a76f['error']['message']);}else{logger['info'](_0x7ed8('0xd'),_0xbd4890,_0x7ed8('0xe'));_0x407180(_0x73a76f['result'][_0x7ed8('0x11')]);}})[_0x7ed8('0x12')](function(_0x55ff86){logger[_0x7ed8('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xbd4890,_0x55ff86);_0x4b7c41(_0x55ff86);});});} \ No newline at end of file +var _0x5a1e=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5797f0,_0x3955c0){var _0x506bce=function(_0x108eff){while(--_0x108eff){_0x5797f0['push'](_0x5797f0['shift']());}};_0x506bce(++_0x3955c0);}(_0x5a1e,0x69));var _0xe5a1=function(_0xbabce1,_0x36f0ca){_0xbabce1=_0xbabce1-0x0;var _0x438df0=_0x5a1e[_0xbabce1];return _0x438df0;};'use strict';var _=require(_0xe5a1('0x0'));var util=require('util');var moment=require(_0xe5a1('0x1'));var BPromise=require('bluebird');var rs=require(_0xe5a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5a1('0x3'))['db'];var utils=require(_0xe5a1('0x4'));var logger=require(_0xe5a1('0x5'))('rpc');var config=require(_0xe5a1('0x6'));var jayson=require(_0xe5a1('0x7'));var client=jayson[_0xe5a1('0x8')][_0xe5a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x331841,_0x1ab35e,_0x21a9e3){return new BPromise(function(_0x3bb0d,_0x8e39f){return client[_0xe5a1('0xa')](_0x331841,_0x21a9e3)[_0xe5a1('0xb')](function(_0x140c87){logger[_0xe5a1('0xc')](_0xe5a1('0xd'),_0x1ab35e,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1ab35e,_0xe5a1('0xe'),JSON['stringify'](_0x140c87));if(_0x140c87[_0xe5a1('0xf')]){if(_0x140c87['error'][_0xe5a1('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1ab35e,_0x140c87[_0xe5a1('0xf')][_0xe5a1('0x11')]);return _0x8e39f(_0x140c87[_0xe5a1('0xf')][_0xe5a1('0x11')]);}logger['error'](_0xe5a1('0xd'),_0x1ab35e,_0x140c87['error'][_0xe5a1('0x11')]);return _0x3bb0d(_0x140c87['error'][_0xe5a1('0x11')]);}else{logger['info'](_0xe5a1('0xd'),_0x1ab35e,_0xe5a1('0xe'));_0x3bb0d(_0x140c87[_0xe5a1('0x12')][_0xe5a1('0x11')]);}})['catch'](function(_0x3c66ea){logger[_0xe5a1('0xf')](_0xe5a1('0xd'),_0x1ab35e,_0x3c66ea);_0x8e39f(_0x3c66ea);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 78990a5..fd01dca 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 _0x204b=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x521b9a,_0x217b1c){var _0x5786aa=function(_0x1af041){while(--_0x1af041){_0x521b9a['push'](_0x521b9a['shift']());}};_0x5786aa(++_0x217b1c);}(_0x204b,0x189));var _0xb204=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x204b[_0x2261ce];return _0x524640;};'use strict';var multer=require(_0xb204('0x0'));var util=require(_0xb204('0x1'));var path=require('path');var timeout=require(_0xb204('0x2'));var express=require(_0xb204('0x3'));var router=express[_0xb204('0x4')]();var fs_extra=require(_0xb204('0x5'));var auth=require(_0xb204('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb204('0x7'));var controller=require(_0xb204('0x8'));router[_0xb204('0x9')]('/',auth[_0xb204('0xa')](),controller[_0xb204('0xb')]);router[_0xb204('0x9')]('/describe',auth[_0xb204('0xa')](),controller[_0xb204('0xc')]);router[_0xb204('0x9')](_0xb204('0xd'),auth[_0xb204('0xa')](),controller['show']);router[_0xb204('0xe')]('/',auth[_0xb204('0xa')](),controller[_0xb204('0xf')]);router[_0xb204('0x10')](_0xb204('0xd'),auth[_0xb204('0xa')](),controller[_0xb204('0x11')]);router[_0xb204('0x12')]('/:id',auth[_0xb204('0xa')](),controller[_0xb204('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb85b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','destroy','exports'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0xb85b,0x88));var _0xbb85=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb85b[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbb85('0x0'));var timeout=require(_0xbb85('0x1'));var express=require(_0xbb85('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb85('0x3'));var interaction=require(_0xbb85('0x4'));var config=require(_0xbb85('0x5'));var controller=require(_0xbb85('0x6'));router[_0xbb85('0x7')]('/',auth[_0xbb85('0x8')](),controller[_0xbb85('0x9')]);router[_0xbb85('0x7')](_0xbb85('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller['show']);router[_0xbb85('0xc')]('/',auth[_0xbb85('0x8')](),controller[_0xbb85('0xd')]);router['put'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller[_0xbb85('0xe')]);router['delete'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller[_0xbb85('0xf')]);module[_0xbb85('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e57442c..90abdea 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 _0x8c38=['moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','sequelize'];(function(_0x1287a6,_0x38b142){var _0x3b6196=function(_0x216e82){while(--_0x216e82){_0x1287a6['push'](_0x1287a6['shift']());}};_0x3b6196(++_0x38b142);}(_0x8c38,0x83));var _0x88c3=function(_0x2f190a,_0x2a2a88){_0x2f190a=_0x2f190a-0x0;var _0x26864a=_0x8c38[_0x2f190a];return _0x26864a;};'use strict';var Sequelize=require(_0x88c3('0x0'));var moment=require(_0x88c3('0x1'));module['exports']={'channel':{'type':Sequelize[_0x88c3('0x2')]},'membername':{'type':Sequelize[_0x88c3('0x2')]},'interface':{'type':Sequelize[_0x88c3('0x2')]},'type':{'type':Sequelize[_0x88c3('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x88c3('0x3')},'duration':{'type':Sequelize[_0x88c3('0x4')]},'enterAt':{'type':Sequelize[_0x88c3('0x5')]},'exitAt':{'type':Sequelize[_0x88c3('0x5')],'set':function(_0x2c413c){var _0x6b76d7=moment(_0x2c413c);var _0xcdbc28=moment(this[_0x88c3('0x6')]('enterAt'));var _0x350a11=_0x6b76d7['diff'](_0xcdbc28,_0x88c3('0x7'));this['setDataValue'](_0x88c3('0x8'),_0x2c413c);this['setDataValue'](_0x88c3('0x9'),_0x350a11||null);}},'data1':{'type':Sequelize[_0x88c3('0x2')],'comment':_0x88c3('0xa')},'data2':{'type':Sequelize[_0x88c3('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x88c3('0x2')],'comment':_0x88c3('0xb')},'data4':{'type':Sequelize[_0x88c3('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x88c3('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x88c3('0x4')]},'uniqueid':{'type':Sequelize[_0x88c3('0x2')]}}; \ No newline at end of file +var _0x94dc=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING'];(function(_0xc81e7a,_0x32893f){var _0x505c78=function(_0x44781f){while(--_0x44781f){_0xc81e7a['push'](_0xc81e7a['shift']());}};_0x505c78(++_0x32893f);}(_0x94dc,0xb1));var _0xc94d=function(_0x21141e,_0x1fab14){_0x21141e=_0x21141e-0x0;var _0x277ce5=_0x94dc[_0x21141e];return _0x277ce5;};'use strict';var Sequelize=require(_0xc94d('0x0'));var moment=require('moment');module[_0xc94d('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc94d('0x2')]},'interface':{'type':Sequelize[_0xc94d('0x2')]},'type':{'type':Sequelize[_0xc94d('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xc94d('0x3')},'duration':{'type':Sequelize[_0xc94d('0x4')]},'enterAt':{'type':Sequelize[_0xc94d('0x5')]},'exitAt':{'type':Sequelize[_0xc94d('0x5')],'set':function(_0x3c0601){var _0x344188=moment(_0x3c0601);var _0xb7275c=moment(this['getDataValue'](_0xc94d('0x6')));var _0xbe5904=_0x344188[_0xc94d('0x7')](_0xb7275c,_0xc94d('0x8'));this[_0xc94d('0x9')]('exitAt',_0x3c0601);this[_0xc94d('0x9')](_0xc94d('0xa'),_0xbe5904||null);}},'data1':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xb')},'data2':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0xc94d('0xd')},'data4':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xe')},'data5':{'type':Sequelize[_0xc94d('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xc94d('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index aa41194..2287506 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55ca,0x126));var _0xa55c=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x55ca[_0x3bcf9e];return _0x1bb37c;};'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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x34e8,0x12c));var _0x834e=function(_0x141054,_0x2fcf1e){_0x141054=_0x141054-0x0;var _0x46f273=_0x34e8[_0x141054];return _0x46f273;};'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 5681772..355a726 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 _0x798e=['interface','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x798e,0x187));var _0xe798=function(_0x550e68,_0x368a74){_0x550e68=_0x550e68-0x0;var _0x5865bf=_0x798e[_0x550e68];return _0x5865bf;};'use strict';var _=require(_0xe798('0x0'));var util=require('util');var logger=require(_0xe798('0x1'))(_0xe798('0x2'));var moment=require(_0xe798('0x3'));var BPromise=require('bluebird');var rp=require(_0xe798('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe798('0x5'));var config=require(_0xe798('0x6'));var attributes=require(_0xe798('0x7'));module[_0xe798('0x8')]=function(_0x450efb,_0x4a4716){return _0x450efb[_0xe798('0x9')](_0xe798('0xa'),attributes,{'tableName':_0xe798('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xe798('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd663=['membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','membername_interface'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd663,0xf0));var _0x3d66=function(_0x467dd0,_0x45fc18){_0x467dd0=_0x467dd0-0x0;var _0x5d6e36=_0xd663[_0x467dd0];return _0x5d6e36;};'use strict';var _=require(_0x3d66('0x0'));var util=require(_0x3d66('0x1'));var logger=require(_0x3d66('0x2'))('api');var moment=require(_0x3d66('0x3'));var BPromise=require(_0x3d66('0x4'));var rp=require(_0x3d66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d66('0x6'));var config=require(_0x3d66('0x7'));var attributes=require(_0x3d66('0x8'));module['exports']=function(_0x3e0562,_0x1b8315){return _0x3e0562[_0x3d66('0x9')](_0x3d66('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x3d66('0xb'),'fields':[_0x3d66('0xc'),_0x3d66('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ef0578d..45f963f 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 _0xcb41=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','MemberReport','findAll','options','raw','where','attributes','map','include','model','GetMemberReport','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash'];(function(_0x1d23d6,_0x30b4a6){var _0x4240ad=function(_0x1f0df9){while(--_0x1f0df9){_0x1d23d6['push'](_0x1d23d6['shift']());}};_0x4240ad(++_0x30b4a6);}(_0xcb41,0x1df));var _0x1cb4=function(_0x520934,_0x46f4bb){_0x520934=_0x520934-0x0;var _0x4497f5=_0xcb41[_0x520934];return _0x4497f5;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var moment=require(_0x1cb4('0x2'));var BPromise=require(_0x1cb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb4('0x5'));var logger=require(_0x1cb4('0x6'))(_0x1cb4('0x7'));var config=require(_0x1cb4('0x8'));var jayson=require(_0x1cb4('0x9'));var client=jayson[_0x1cb4('0xa')][_0x1cb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42e7fe,_0x4fd3b6,_0x2b51e3){return new BPromise(function(_0x2a5095,_0x50b603){return client[_0x1cb4('0xc')](_0x42e7fe,_0x2b51e3)[_0x1cb4('0xd')](function(_0x26f5ba){logger['info'](_0x1cb4('0xe'),_0x4fd3b6,_0x1cb4('0xf'));logger[_0x1cb4('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4fd3b6,'request\x20sent',JSON[_0x1cb4('0x11')](_0x26f5ba));if(_0x26f5ba['error']){if(_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x13')]===0x1f4){logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x26f5ba[_0x1cb4('0x12')]['message']);return _0x50b603(_0x26f5ba[_0x1cb4('0x12')]['message']);}logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x14')]);return _0x2a5095(_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x14')]);}else{logger[_0x1cb4('0x15')](_0x1cb4('0xe'),_0x4fd3b6,_0x1cb4('0xf'));_0x2a5095(_0x26f5ba[_0x1cb4('0x16')]['message']);}})[_0x1cb4('0x17')](function(_0x514285){logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x514285);_0x50b603(_0x514285);});});}exports['GetMemberReport']=function(_0x56d926){var _0x25b120=this;return new Promise(function(_0x281d36,_0xfc93ad){return db[_0x1cb4('0x18')][_0x1cb4('0x19')]({'raw':_0x56d926[_0x1cb4('0x1a')]?_0x56d926[_0x1cb4('0x1a')][_0x1cb4('0x1b')]===undefined?!![]:![]:!![],'where':_0x56d926['options']?_0x56d926[_0x1cb4('0x1a')][_0x1cb4('0x1c')]||null:null,'attributes':_0x56d926['options']?_0x56d926[_0x1cb4('0x1a')][_0x1cb4('0x1d')]||null:null,'limit':_0x56d926[_0x1cb4('0x1a')]?_0x56d926[_0x1cb4('0x1a')]['limit']||null:null,'include':_0x56d926[_0x1cb4('0x1a')]?_0x56d926['options']['include']?_[_0x1cb4('0x1e')](_0x56d926[_0x1cb4('0x1a')][_0x1cb4('0x1f')],function(_0x4d93b9){return{'model':db[_0x4d93b9[_0x1cb4('0x20')]],'as':_0x4d93b9['as'],'attributes':_0x4d93b9[_0x1cb4('0x1d')],'include':_0x4d93b9[_0x1cb4('0x1f')]?_['map'](_0x4d93b9[_0x1cb4('0x1f')],function(_0x1e8d9c){return{'model':db[_0x1e8d9c[_0x1cb4('0x20')]],'as':_0x1e8d9c['as'],'attributes':_0x1e8d9c[_0x1cb4('0x1d')],'include':_0x1e8d9c['include']?_[_0x1cb4('0x1e')](_0x1e8d9c['include'],function(_0x5ef0fe){return{'model':db[_0x5ef0fe['model']],'as':_0x5ef0fe['as'],'attributes':_0x5ef0fe[_0x1cb4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28ac89){logger[_0x1cb4('0x15')]('GetMemberReport',_0x56d926);logger['debug'](_0x1cb4('0x21'),_0x56d926,JSON[_0x1cb4('0x11')](_0x28ac89));_0x281d36(_0x28ac89);})[_0x1cb4('0x17')](function(_0x253864){logger[_0x1cb4('0x12')](_0x1cb4('0x21'),_0x253864['message'],_0x56d926);_0xfc93ad(_0x25b120['error'](0x1f4,_0x253864['message']));});});};exports[_0x1cb4('0x22')]=function(_0x24b709){var _0x22d82a=this;return new Promise(function(_0xd97190,_0x454546){return db[_0x1cb4('0x18')][_0x1cb4('0x23')](_0x24b709[_0x1cb4('0x24')],{'raw':_0x24b709[_0x1cb4('0x1a')]?_0x24b709[_0x1cb4('0x1a')][_0x1cb4('0x1b')]===undefined?!![]:![]:!![]})[_0x1cb4('0xd')](function(_0x26d959){logger[_0x1cb4('0x15')](_0x1cb4('0x22'),_0x24b709);logger[_0x1cb4('0x10')](_0x1cb4('0x22'),_0x24b709,JSON[_0x1cb4('0x11')](_0x26d959));_0xd97190(_0x26d959);})['catch'](function(_0x2722a2){logger[_0x1cb4('0x12')](_0x1cb4('0x22'),_0x2722a2[_0x1cb4('0x14')],_0x24b709);_0x454546(_0x22d82a[_0x1cb4('0x12')](0x1f4,_0x2722a2['message']));});});};exports[_0x1cb4('0x25')]=function(_0xeb037a){var _0x5aa5e4=this;return new Promise(function(_0x375a26,_0x15e139){return db[_0x1cb4('0x18')][_0x1cb4('0x26')](_0xeb037a[_0x1cb4('0x24')],{'raw':_0xeb037a[_0x1cb4('0x1a')]?_0xeb037a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb037a[_0x1cb4('0x1a')]?_0xeb037a['options']['where']||null:null,'attributes':_0xeb037a[_0x1cb4('0x1a')]?_0xeb037a[_0x1cb4('0x1a')][_0x1cb4('0x1d')]||null:null,'limit':_0xeb037a[_0x1cb4('0x1a')]?_0xeb037a[_0x1cb4('0x1a')][_0x1cb4('0x27')]||null:null})['then'](function(_0x109667){logger[_0x1cb4('0x15')](_0x1cb4('0x25'),_0xeb037a);logger[_0x1cb4('0x10')](_0x1cb4('0x25'),_0xeb037a,JSON[_0x1cb4('0x11')](_0x109667));_0x375a26(_0x109667);})['catch'](function(_0x81955b){logger[_0x1cb4('0x12')](_0x1cb4('0x25'),_0x81955b[_0x1cb4('0x14')],_0xeb037a);_0x15e139(_0x5aa5e4[_0x1cb4('0x12')](0x1f4,_0x81955b[_0x1cb4('0x14')]));});});}; \ No newline at end of file +var _0x6011=['code','message','result','GetMemberReport','MemberReport','options','raw','where','attributes','limit','map','model','include','debug','stringify','catch','create','body','CreateMemberReport','update','UpdateMemberReport','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x29beb4,_0x3e9f4c){var _0x1770e0=function(_0x2d2a30){while(--_0x2d2a30){_0x29beb4['push'](_0x29beb4['shift']());}};_0x1770e0(++_0x3e9f4c);}(_0x6011,0x196));var _0x1601=function(_0xf02bd6,_0x247382){_0xf02bd6=_0xf02bd6-0x0;var _0x224799=_0x6011[_0xf02bd6];return _0x224799;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1601('0x0'));var db=require(_0x1601('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x1601('0x2'))(_0x1601('0x3'));var config=require(_0x1601('0x4'));var jayson=require(_0x1601('0x5'));var client=jayson[_0x1601('0x6')][_0x1601('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x277bfc,_0x1e7cf6,_0x18e06c){return new BPromise(function(_0x99dee1,_0x55b751){return client[_0x1601('0x8')](_0x277bfc,_0x18e06c)[_0x1601('0x9')](function(_0x1e3488){logger[_0x1601('0xa')](_0x1601('0xb'),_0x1e7cf6,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1e7cf6,_0x1601('0xc'),JSON['stringify'](_0x1e3488));if(_0x1e3488[_0x1601('0xd')]){if(_0x1e3488[_0x1601('0xd')][_0x1601('0xe')]===0x1f4){logger[_0x1601('0xd')](_0x1601('0xb'),_0x1e7cf6,_0x1e3488[_0x1601('0xd')][_0x1601('0xf')]);return _0x55b751(_0x1e3488[_0x1601('0xd')]['message']);}logger[_0x1601('0xd')]('MemberReport,\x20%s,\x20%s',_0x1e7cf6,_0x1e3488[_0x1601('0xd')]['message']);return _0x99dee1(_0x1e3488[_0x1601('0xd')][_0x1601('0xf')]);}else{logger['info'](_0x1601('0xb'),_0x1e7cf6,_0x1601('0xc'));_0x99dee1(_0x1e3488[_0x1601('0x10')]['message']);}})['catch'](function(_0x24c0ab){logger[_0x1601('0xd')](_0x1601('0xb'),_0x1e7cf6,_0x24c0ab);_0x55b751(_0x24c0ab);});});}exports[_0x1601('0x11')]=function(_0x1d8563){var _0x302350=this;return new Promise(function(_0x23b992,_0x3ae0c6){return db[_0x1601('0x12')]['findAll']({'raw':_0x1d8563['options']?_0x1d8563[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![],'where':_0x1d8563[_0x1601('0x13')]?_0x1d8563['options'][_0x1601('0x15')]||null:null,'attributes':_0x1d8563[_0x1601('0x13')]?_0x1d8563[_0x1601('0x13')][_0x1601('0x16')]||null:null,'limit':_0x1d8563[_0x1601('0x13')]?_0x1d8563['options'][_0x1601('0x17')]||null:null,'include':_0x1d8563[_0x1601('0x13')]?_0x1d8563[_0x1601('0x13')]['include']?_[_0x1601('0x18')](_0x1d8563[_0x1601('0x13')]['include'],function(_0x2b01da){return{'model':db[_0x2b01da[_0x1601('0x19')]],'as':_0x2b01da['as'],'attributes':_0x2b01da['attributes'],'include':_0x2b01da['include']?_[_0x1601('0x18')](_0x2b01da[_0x1601('0x1a')],function(_0x34d021){return{'model':db[_0x34d021['model']],'as':_0x34d021['as'],'attributes':_0x34d021[_0x1601('0x16')],'include':_0x34d021[_0x1601('0x1a')]?_[_0x1601('0x18')](_0x34d021[_0x1601('0x1a')],function(_0x296c34){return{'model':db[_0x296c34['model']],'as':_0x296c34['as'],'attributes':_0x296c34['attributes']};}):[]};}):[]};}):[]:[]})[_0x1601('0x9')](function(_0x1aef35){logger[_0x1601('0xa')]('GetMemberReport',_0x1d8563);logger[_0x1601('0x1b')]('GetMemberReport',_0x1d8563,JSON[_0x1601('0x1c')](_0x1aef35));_0x23b992(_0x1aef35);})[_0x1601('0x1d')](function(_0x389f0f){logger['error'](_0x1601('0x11'),_0x389f0f[_0x1601('0xf')],_0x1d8563);_0x3ae0c6(_0x302350[_0x1601('0xd')](0x1f4,_0x389f0f[_0x1601('0xf')]));});});};exports['CreateMemberReport']=function(_0x32740e){var _0x3ef6a7=this;return new Promise(function(_0x2a4ef9,_0x224a1c){return db[_0x1601('0x12')][_0x1601('0x1e')](_0x32740e[_0x1601('0x1f')],{'raw':_0x32740e[_0x1601('0x13')]?_0x32740e[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![]})[_0x1601('0x9')](function(_0x46050f){logger[_0x1601('0xa')]('CreateMemberReport',_0x32740e);logger[_0x1601('0x1b')](_0x1601('0x20'),_0x32740e,JSON[_0x1601('0x1c')](_0x46050f));_0x2a4ef9(_0x46050f);})[_0x1601('0x1d')](function(_0x3a350d){logger['error'](_0x1601('0x20'),_0x3a350d[_0x1601('0xf')],_0x32740e);_0x224a1c(_0x3ef6a7['error'](0x1f4,_0x3a350d[_0x1601('0xf')]));});});};exports['UpdateMemberReport']=function(_0x3a92d9){var _0x39e89f=this;return new Promise(function(_0x4b2f6c,_0x7a11dd){return db[_0x1601('0x12')][_0x1601('0x21')](_0x3a92d9[_0x1601('0x1f')],{'raw':_0x3a92d9[_0x1601('0x13')]?_0x3a92d9[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a92d9['options']?_0x3a92d9[_0x1601('0x13')][_0x1601('0x15')]||null:null,'attributes':_0x3a92d9['options']?_0x3a92d9['options'][_0x1601('0x16')]||null:null,'limit':_0x3a92d9[_0x1601('0x13')]?_0x3a92d9[_0x1601('0x13')][_0x1601('0x17')]||null:null})[_0x1601('0x9')](function(_0x2a585b){logger[_0x1601('0xa')]('UpdateMemberReport',_0x3a92d9);logger[_0x1601('0x1b')](_0x1601('0x22'),_0x3a92d9,JSON['stringify'](_0x2a585b));_0x4b2f6c(_0x2a585b);})['catch'](function(_0x3f0522){logger['error']('UpdateMemberReport',_0x3f0522['message'],_0x3a92d9);_0x7a11dd(_0x39e89f[_0x1601('0xd')](0x1f4,_0x3f0522[_0x1601('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 0fa9749..4b9ba35 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 _0x10da=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','multer','util','connect-timeout','Router','fs-extra'];(function(_0x5dc2fa,_0x56279d){var _0x16eaf9=function(_0x83322){while(--_0x83322){_0x5dc2fa['push'](_0x5dc2fa['shift']());}};_0x16eaf9(++_0x56279d);}(_0x10da,0x145));var _0xa10d=function(_0xf101a6,_0x54156c){_0xf101a6=_0xf101a6-0x0;var _0x3c3ad5=_0x10da[_0xf101a6];return _0x3c3ad5;};'use strict';var multer=require(_0xa10d('0x0'));var util=require(_0xa10d('0x1'));var path=require('path');var timeout=require(_0xa10d('0x2'));var express=require('express');var router=express[_0xa10d('0x3')]();var fs_extra=require(_0xa10d('0x4'));var auth=require(_0xa10d('0x5'));var interaction=require(_0xa10d('0x6'));var config=require(_0xa10d('0x7'));var controller=require(_0xa10d('0x8'));router['get']('/',controller[_0xa10d('0x9')]);module['exports']=router; \ No newline at end of file +var _0x164f=['../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x484225,_0x10e811){var _0x17dbf9=function(_0x5e6950){while(--_0x5e6950){_0x484225['push'](_0x484225['shift']());}};_0x17dbf9(++_0x10e811);}(_0x164f,0x186));var _0xf164=function(_0x515108,_0x303eb8){_0x515108=_0x515108-0x0;var _0x3d5145=_0x164f[_0x515108];return _0x3d5145;};'use strict';var multer=require('multer');var util=require(_0xf164('0x0'));var path=require(_0xf164('0x1'));var timeout=require(_0xf164('0x2'));var express=require(_0xf164('0x3'));var router=express[_0xf164('0x4')]();var fs_extra=require(_0xf164('0x5'));var auth=require(_0xf164('0x6'));var interaction=require(_0xf164('0x7'));var config=require('../../config/environment');var controller=require(_0xf164('0x8'));router[_0xf164('0x9')]('/',controller[_0xf164('0xa')]);module[_0xf164('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 0514ec9..93afb94 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 _0xc442=['exports','STRING','version','sequelize'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc442,0x14f));var _0x2c44=function(_0x73a24,_0x28694a){_0x73a24=_0x73a24-0x0;var _0x51fc53=_0xc442[_0x73a24];return _0x51fc53;};'use strict';var Sequelize=require(_0x2c44('0x0'));module[_0x2c44('0x1')]={'version':{'type':Sequelize[_0x2c44('0x2')],'unique':_0x2c44('0x3')}}; \ No newline at end of file +var _0x8810=['exports','version','sequelize'];(function(_0x1327f7,_0x15950c){var _0x328b8f=function(_0x47bfbc){while(--_0x47bfbc){_0x1327f7['push'](_0x1327f7['shift']());}};_0x328b8f(++_0x15950c);}(_0x8810,0x19a));var _0x0881=function(_0x254f7c,_0x3e7aae){_0x254f7c=_0x254f7c-0x0;var _0x418615=_0x8810[_0x254f7c];return _0x418615;};'use strict';var Sequelize=require(_0x0881('0x0'));module[_0x0881('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x0881('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index db304ea..8e836d9 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 _0x40ce=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','include','rows','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x40ce,0x72));var _0xe40c=function(_0x5aa3cb,_0x2030bf){_0x5aa3cb=_0x5aa3cb-0x0;var _0x5c660a=_0x40ce[_0x5aa3cb];return _0x5c660a;};'use strict';var emlformat=require(_0xe40c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe40c('0x1'));var jsonpatch=require(_0xe40c('0x2'));var rp=require(_0xe40c('0x3'));var moment=require('moment');var BPromise=require(_0xe40c('0x4'));var Mustache=require('mustache');var util=require(_0xe40c('0x5'));var path=require(_0xe40c('0x6'));var sox=require(_0xe40c('0x7'));var csv=require(_0xe40c('0x8'));var ejs=require(_0xe40c('0x9'));var fs=require('fs');var fs_extra=require(_0xe40c('0xa'));var _=require(_0xe40c('0xb'));var squel=require(_0xe40c('0xc'));var crypto=require('crypto');var jsforce=require(_0xe40c('0xd'));var deskjs=require(_0xe40c('0xe'));var toCsv=require(_0xe40c('0x8'));var querystring=require('querystring');var Papa=require(_0xe40c('0xf'));var Redis=require(_0xe40c('0x10'));var authService=require(_0xe40c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe40c('0x12'));var hardwareService=require(_0xe40c('0x13'));var logger=require(_0xe40c('0x14'))('api');var utils=require(_0xe40c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe40c('0x16'));var db=require(_0xe40c('0x17'))['db'];function respondWithStatusCode(_0x45c1a6,_0x277b5f){_0x277b5f=_0x277b5f||0xcc;return function(_0x571f14){if(_0x571f14){return _0x45c1a6[_0xe40c('0x18')](_0x277b5f);}return _0x45c1a6[_0xe40c('0x19')](_0x277b5f)[_0xe40c('0x1a')]();};}function respondWithResult(_0x60c5b9,_0x3ad7a8){_0x3ad7a8=_0x3ad7a8||0xc8;return function(_0x2c58ac){if(_0x2c58ac){return _0x60c5b9[_0xe40c('0x19')](_0x3ad7a8)[_0xe40c('0x1b')](_0x2c58ac);}};}function respondWithFilteredResult(_0x5005a4,_0x37ffb1){return function(_0x29b644){if(_0x29b644){var _0x5de8ac=typeof _0x37ffb1[_0xe40c('0x1c')]===_0xe40c('0x1d')&&typeof _0x37ffb1['limit']==='undefined';var _0x2a4a0b=_0x29b644['count'];var _0x5e757d=_0x5de8ac?0x0:_0x37ffb1[_0xe40c('0x1c')];var _0x476ef6=_0x5de8ac?_0x29b644['count']:_0x37ffb1[_0xe40c('0x1c')]+_0x37ffb1[_0xe40c('0x1e')];var _0x2e3c48;if(_0x476ef6>=_0x2a4a0b){_0x476ef6=_0x2a4a0b;_0x2e3c48=0xc8;}else{_0x2e3c48=0xce;}_0x5005a4[_0xe40c('0x19')](_0x2e3c48);return _0x5005a4[_0xe40c('0x1f')](_0xe40c('0x20'),_0x5e757d+'-'+_0x476ef6+'/'+_0x2a4a0b)['json'](_0x29b644);}return null;};}function patchUpdates(_0xcf6e42){return function(_0x50ac84){try{jsonpatch[_0xe40c('0x21')](_0x50ac84,_0xcf6e42,!![]);}catch(_0x47a04e){return BPromise[_0xe40c('0x22')](_0x47a04e);}return _0x50ac84[_0xe40c('0x23')]();};}function saveUpdates(_0xafd0e2,_0x227d7f){return function(_0x45e5ca){if(_0x45e5ca){return _0x45e5ca['update'](_0xafd0e2)[_0xe40c('0x24')](function(_0x3fddd3){return _0x3fddd3;});}return null;};}function removeEntity(_0x20e170,_0x598c0d){return function(_0x58c8c5){if(_0x58c8c5){return _0x58c8c5['destroy']()[_0xe40c('0x24')](function(){_0x20e170[_0xe40c('0x19')](0xcc)[_0xe40c('0x1a')]();});}};}function handleEntityNotFound(_0x11450d,_0x247787){return function(_0x1c6b00){if(!_0x1c6b00){_0x11450d[_0xe40c('0x18')](0x194);}return _0x1c6b00;};}function handleError(_0x341100,_0x18a5bf){_0x18a5bf=_0x18a5bf||0x1f4;return function(_0x7eac4){logger['error'](_0x7eac4['stack']);if(_0x7eac4[_0xe40c('0x25')]){delete _0x7eac4[_0xe40c('0x25')];}_0x341100[_0xe40c('0x19')](_0x18a5bf)[_0xe40c('0x26')](_0x7eac4);};}exports['index']=function(_0x533070,_0x5ea0e2){var _0x4d9777={},_0x4cba2c={},_0x5a30ba={'count':0x0,'rows':[]};var _0x34c560=_[_0xe40c('0x27')](db[_0xe40c('0x28')][_0xe40c('0x29')],function(_0x348da3){return{'name':_0x348da3[_0xe40c('0x2a')],'type':_0x348da3[_0xe40c('0x2b')][_0xe40c('0x2c')]};});_0x4cba2c['model']=_[_0xe40c('0x27')](_0x34c560,_0xe40c('0x25'));_0x4cba2c[_0xe40c('0x2d')]=_[_0xe40c('0x2e')](_0x533070[_0xe40c('0x2d')]);_0x4cba2c['filters']=_[_0xe40c('0x2f')](_0x4cba2c[_0xe40c('0x30')],_0x4cba2c[_0xe40c('0x2d')]);_0x4d9777[_0xe40c('0x31')]=_[_0xe40c('0x2f')](_0x4cba2c['model'],qs[_0xe40c('0x32')](_0x533070[_0xe40c('0x2d')][_0xe40c('0x32')]));_0x4d9777[_0xe40c('0x31')]=_0x4d9777[_0xe40c('0x31')][_0xe40c('0x33')]?_0x4d9777['attributes']:_0x4cba2c[_0xe40c('0x30')];if(!_0x533070[_0xe40c('0x2d')][_0xe40c('0x34')](_0xe40c('0x35'))){_0x4d9777[_0xe40c('0x1e')]=qs[_0xe40c('0x1e')](_0x533070[_0xe40c('0x2d')][_0xe40c('0x1e')]);_0x4d9777[_0xe40c('0x1c')]=qs['offset'](_0x533070[_0xe40c('0x2d')][_0xe40c('0x1c')]);}_0x4d9777[_0xe40c('0x36')]=qs[_0xe40c('0x37')](_0x533070['query'][_0xe40c('0x37')]);_0x4d9777['where']=qs[_0xe40c('0x38')](_[_0xe40c('0x39')](_0x533070[_0xe40c('0x2d')],_0x4cba2c['filters']),_0x34c560);if(_0x533070[_0xe40c('0x2d')][_0xe40c('0x3a')]){_0x4d9777[_0xe40c('0x3b')]=_['merge'](_0x4d9777[_0xe40c('0x3b')],{'$or':_[_0xe40c('0x27')](_0x34c560,function(_0x565213){if(_0x565213[_0xe40c('0x2b')]!=='VIRTUAL'){var _0xdb6f81={};_0xdb6f81[_0x565213['name']]={'$like':'%'+_0x533070['query'][_0xe40c('0x3a')]+'%'};return _0xdb6f81;}})});}_0x4d9777=_[_0xe40c('0x3c')]({},_0x4d9777,_0x533070[_0xe40c('0x3d')]);var _0x425d50={'where':_0x4d9777[_0xe40c('0x3b')]};return db['Migration'][_0xe40c('0x3e')](_0x425d50)[_0xe40c('0x24')](function(_0x43dace){_0x5a30ba['count']=_0x43dace;if(_0x533070[_0xe40c('0x2d')][_0xe40c('0x3f')]){_0x4d9777[_0xe40c('0x40')]=[{'all':!![]}];}return db[_0xe40c('0x28')]['findAll'](_0x4d9777);})[_0xe40c('0x24')](function(_0x4aa6e9){_0x5a30ba[_0xe40c('0x41')]=_0x4aa6e9;return _0x5a30ba;})[_0xe40c('0x24')](respondWithFilteredResult(_0x5ea0e2,_0x4d9777))['catch'](handleError(_0x5ea0e2,null));}; \ No newline at end of file +var _0x32a5=['index','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','name'];(function(_0x577beb,_0x196407){var _0x3cac54=function(_0x2fcdaf){while(--_0x2fcdaf){_0x577beb['push'](_0x577beb['shift']());}};_0x3cac54(++_0x196407);}(_0x32a5,0xe8));var _0x532a=function(_0x13d7ff,_0x598d69){_0x13d7ff=_0x13d7ff-0x0;var _0x567dc3=_0x32a5[_0x13d7ff];return _0x567dc3;};'use strict';var emlformat=require(_0x532a('0x0'));var rimraf=require(_0x532a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x532a('0x2'));var rp=require(_0x532a('0x3'));var moment=require('moment');var BPromise=require(_0x532a('0x4'));var Mustache=require(_0x532a('0x5'));var util=require(_0x532a('0x6'));var path=require(_0x532a('0x7'));var sox=require('sox');var csv=require(_0x532a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x532a('0x9'));var _=require(_0x532a('0xa'));var squel=require(_0x532a('0xb'));var crypto=require(_0x532a('0xc'));var jsforce=require(_0x532a('0xd'));var deskjs=require(_0x532a('0xe'));var toCsv=require(_0x532a('0x8'));var querystring=require(_0x532a('0xf'));var Papa=require(_0x532a('0x10'));var Redis=require(_0x532a('0x11'));var authService=require(_0x532a('0x12'));var qs=require(_0x532a('0x13'));var as=require(_0x532a('0x14'));var hardwareService=require(_0x532a('0x15'));var logger=require(_0x532a('0x16'))('api');var utils=require(_0x532a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x532a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45e52a,_0x336590){_0x336590=_0x336590||0xcc;return function(_0x19d2ed){if(_0x19d2ed){return _0x45e52a[_0x532a('0x19')](_0x336590);}return _0x45e52a[_0x532a('0x1a')](_0x336590)[_0x532a('0x1b')]();};}function respondWithResult(_0x20714e,_0x4e0db0){_0x4e0db0=_0x4e0db0||0xc8;return function(_0x434336){if(_0x434336){return _0x20714e[_0x532a('0x1a')](_0x4e0db0)[_0x532a('0x1c')](_0x434336);}};}function respondWithFilteredResult(_0x2bf449,_0x41da44){return function(_0x2ea76b){if(_0x2ea76b){var _0x3db89c=typeof _0x41da44[_0x532a('0x1d')]==='undefined'&&typeof _0x41da44[_0x532a('0x1e')]===_0x532a('0x1f');var _0x345ae9=_0x2ea76b[_0x532a('0x20')];var _0x2b4dd6=_0x3db89c?0x0:_0x41da44['offset'];var _0x292ff0=_0x3db89c?_0x2ea76b['count']:_0x41da44[_0x532a('0x1d')]+_0x41da44[_0x532a('0x1e')];var _0x148e70;if(_0x292ff0>=_0x345ae9){_0x292ff0=_0x345ae9;_0x148e70=0xc8;}else{_0x148e70=0xce;}_0x2bf449[_0x532a('0x1a')](_0x148e70);return _0x2bf449[_0x532a('0x21')](_0x532a('0x22'),_0x2b4dd6+'-'+_0x292ff0+'/'+_0x345ae9)[_0x532a('0x1c')](_0x2ea76b);}return null;};}function patchUpdates(_0x5b927c){return function(_0x4c7084){try{jsonpatch[_0x532a('0x23')](_0x4c7084,_0x5b927c,!![]);}catch(_0x532b9e){return BPromise['reject'](_0x532b9e);}return _0x4c7084[_0x532a('0x24')]();};}function saveUpdates(_0x509de1,_0x2093c8){return function(_0x5a27e6){if(_0x5a27e6){return _0x5a27e6['update'](_0x509de1)[_0x532a('0x25')](function(_0x225c00){return _0x225c00;});}return null;};}function removeEntity(_0x3a7794,_0x54cd04){return function(_0x3355b3){if(_0x3355b3){return _0x3355b3['destroy']()[_0x532a('0x25')](function(){_0x3a7794[_0x532a('0x1a')](0xcc)[_0x532a('0x1b')]();});}};}function handleEntityNotFound(_0x8f0634,_0x2d12e6){return function(_0x3d67be){if(!_0x3d67be){_0x8f0634[_0x532a('0x19')](0x194);}return _0x3d67be;};}function handleError(_0x4975cf,_0x4258e3){_0x4258e3=_0x4258e3||0x1f4;return function(_0x2a73a9){logger[_0x532a('0x26')](_0x2a73a9['stack']);if(_0x2a73a9[_0x532a('0x27')]){delete _0x2a73a9[_0x532a('0x27')];}_0x4975cf[_0x532a('0x1a')](_0x4258e3)['send'](_0x2a73a9);};}exports[_0x532a('0x28')]=function(_0x426ba1,_0x233048){var _0xe9c0b9={},_0x47e133={},_0x598b46={'count':0x0,'rows':[]};var _0x252ce0=_['map'](db['Migration']['rawAttributes'],function(_0x1ab660){return{'name':_0x1ab660['fieldName'],'type':_0x1ab660[_0x532a('0x29')][_0x532a('0x2a')]};});_0x47e133[_0x532a('0x2b')]=_[_0x532a('0x2c')](_0x252ce0,_0x532a('0x27'));_0x47e133[_0x532a('0x2d')]=_[_0x532a('0x2e')](_0x426ba1[_0x532a('0x2d')]);_0x47e133['filters']=_[_0x532a('0x2f')](_0x47e133['model'],_0x47e133[_0x532a('0x2d')]);_0xe9c0b9[_0x532a('0x30')]=_[_0x532a('0x2f')](_0x47e133[_0x532a('0x2b')],qs[_0x532a('0x31')](_0x426ba1[_0x532a('0x2d')][_0x532a('0x31')]));_0xe9c0b9[_0x532a('0x30')]=_0xe9c0b9['attributes'][_0x532a('0x32')]?_0xe9c0b9[_0x532a('0x30')]:_0x47e133['model'];if(!_0x426ba1[_0x532a('0x2d')][_0x532a('0x33')](_0x532a('0x34'))){_0xe9c0b9[_0x532a('0x1e')]=qs[_0x532a('0x1e')](_0x426ba1[_0x532a('0x2d')][_0x532a('0x1e')]);_0xe9c0b9[_0x532a('0x1d')]=qs['offset'](_0x426ba1[_0x532a('0x2d')][_0x532a('0x1d')]);}_0xe9c0b9[_0x532a('0x35')]=qs[_0x532a('0x36')](_0x426ba1['query']['sort']);_0xe9c0b9[_0x532a('0x37')]=qs[_0x532a('0x38')](_[_0x532a('0x39')](_0x426ba1[_0x532a('0x2d')],_0x47e133['filters']),_0x252ce0);if(_0x426ba1[_0x532a('0x2d')][_0x532a('0x3a')]){_0xe9c0b9[_0x532a('0x37')]=_[_0x532a('0x3b')](_0xe9c0b9[_0x532a('0x37')],{'$or':_[_0x532a('0x2c')](_0x252ce0,function(_0x314c52){if(_0x314c52[_0x532a('0x29')]!==_0x532a('0x3c')){var _0x3baa6c={};_0x3baa6c[_0x314c52[_0x532a('0x27')]]={'$like':'%'+_0x426ba1[_0x532a('0x2d')][_0x532a('0x3a')]+'%'};return _0x3baa6c;}})});}_0xe9c0b9=_[_0x532a('0x3b')]({},_0xe9c0b9,_0x426ba1[_0x532a('0x3d')]);var _0x126d2e={'where':_0xe9c0b9['where']};return db[_0x532a('0x3e')][_0x532a('0x20')](_0x126d2e)[_0x532a('0x25')](function(_0x5d503e){_0x598b46[_0x532a('0x20')]=_0x5d503e;if(_0x426ba1[_0x532a('0x2d')][_0x532a('0x3f')]){_0xe9c0b9[_0x532a('0x40')]=[{'all':!![]}];}return db[_0x532a('0x3e')][_0x532a('0x41')](_0xe9c0b9);})['then'](function(_0xc42f20){_0x598b46[_0x532a('0x42')]=_0xc42f20;return _0x598b46;})[_0x532a('0x25')](respondWithFilteredResult(_0x233048,_0xe9c0b9))[_0x532a('0x43')](handleError(_0x233048,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 87232e2..8a8b26c 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 _0xfab3=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','migrations','util'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0xfab3,0x1f3));var _0x3fab=function(_0x82b66e,_0xc7a91d){_0x82b66e=_0x82b66e-0x0;var _0x1b9888=_0xfab3[_0x82b66e];return _0x1b9888;};'use strict';var _=require('lodash');var util=require(_0x3fab('0x0'));var logger=require(_0x3fab('0x1'))(_0x3fab('0x2'));var moment=require(_0x3fab('0x3'));var BPromise=require(_0x3fab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3fab('0x5'));var config=require(_0x3fab('0x6'));var attributes=require('./migration.attributes');module[_0x3fab('0x7')]=function(_0xed2e5,_0x259bc6){return _0xed2e5[_0x3fab('0x8')]('Migration',attributes,{'tableName':_0x3fab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207d=['../../config/environment','exports','define','Migration','migrations','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x207d,0x65));var _0xd207=function(_0x3f14d2,_0x21e949){_0x3f14d2=_0x3f14d2-0x0;var _0x1b88f5=_0x207d[_0x3f14d2];return _0x1b88f5;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require(_0xd207('0x1'))(_0xd207('0x2'));var moment=require(_0xd207('0x3'));var BPromise=require(_0xd207('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd207('0x5'));var rimraf=require(_0xd207('0x6'));var config=require(_0xd207('0x7'));var attributes=require('./migration.attributes');module[_0xd207('0x8')]=function(_0x29a525,_0x3efc36){return _0x29a525[_0xd207('0x9')](_0xd207('0xa'),attributes,{'tableName':_0xd207('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 594e2a8..eaed663 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 _0xb9a7=['request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Migration,\x20%s,\x20%s'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xb9a7,0x112));var _0x7b9a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb9a7[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('Migration,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('Migration,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});} \ No newline at end of file +var _0xb74d=['request\x20sent','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb74d,0x16e));var _0xdb74=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xb74d[_0x46a671];return _0x526d75;};'use strict';var _=require(_0xdb74('0x0'));var util=require('util');var moment=require(_0xdb74('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb74('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb74('0x3'))['db'];var utils=require(_0xdb74('0x4'));var logger=require(_0xdb74('0x5'))('rpc');var config=require(_0xdb74('0x6'));var jayson=require(_0xdb74('0x7'));var client=jayson[_0xdb74('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5183ae,_0xfc6f47,_0x4bf15e){return new BPromise(function(_0x3e44b7,_0x2655f3){return client['request'](_0x5183ae,_0x4bf15e)[_0xdb74('0x9')](function(_0x5370df){logger[_0xdb74('0xa')](_0xdb74('0xb'),_0xfc6f47,'request\x20sent');logger[_0xdb74('0xc')](_0xdb74('0xd'),_0xfc6f47,_0xdb74('0xe'),JSON['stringify'](_0x5370df));if(_0x5370df['error']){if(_0x5370df[_0xdb74('0xf')][_0xdb74('0x10')]===0x1f4){logger[_0xdb74('0xf')](_0xdb74('0xb'),_0xfc6f47,_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);return _0x2655f3(_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);}logger[_0xdb74('0xf')](_0xdb74('0xb'),_0xfc6f47,_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);return _0x3e44b7(_0x5370df[_0xdb74('0xf')]['message']);}else{logger[_0xdb74('0xa')](_0xdb74('0xb'),_0xfc6f47,_0xdb74('0xe'));_0x3e44b7(_0x5370df[_0xdb74('0x12')]['message']);}})['catch'](function(_0xc9548c){logger[_0xdb74('0xf')]('Migration,\x20%s,\x20%s',_0xfc6f47,_0xc9548c);_0x2655f3(_0xc9548c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index beb2c30..b0c2f9b 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 _0x4f81=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','show','post','create','update','delete','destroy','exports','path','express','Router'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x4f81,0x1e3));var _0x14f8=function(_0x3ef98c,_0x6477b0){_0x3ef98c=_0x3ef98c-0x0;var _0x768195=_0x4f81[_0x3ef98c];return _0x768195;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14f8('0x0'));var timeout=require('connect-timeout');var express=require(_0x14f8('0x1'));var router=express[_0x14f8('0x2')]();var fs_extra=require(_0x14f8('0x3'));var auth=require(_0x14f8('0x4'));var interaction=require(_0x14f8('0x5'));var config=require(_0x14f8('0x6'));var controller=require(_0x14f8('0x7'));router['get']('/',auth[_0x14f8('0x8')](),controller['index']);router[_0x14f8('0x9')](_0x14f8('0xa'),auth['isAuthenticated'](),controller[_0x14f8('0xb')]);router[_0x14f8('0xc')]('/',auth['isAuthenticated'](),controller[_0x14f8('0xd')]);router['put']('/:id',auth[_0x14f8('0x8')](),controller[_0x14f8('0xe')]);router[_0x14f8('0xf')](_0x14f8('0xa'),auth[_0x14f8('0x8')](),controller[_0x14f8('0x10')]);module[_0x14f8('0x11')]=router; \ No newline at end of file +var _0x8be3=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','create','put','update'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x8be3,0xd1));var _0x38be=function(_0xfb790d,_0x1793fe){_0xfb790d=_0xfb790d-0x0;var _0x23a1b9=_0x8be3[_0xfb790d];return _0x23a1b9;};'use strict';var multer=require('multer');var util=require(_0x38be('0x0'));var path=require(_0x38be('0x1'));var timeout=require(_0x38be('0x2'));var express=require('express');var router=express[_0x38be('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38be('0x4'));var interaction=require(_0x38be('0x5'));var config=require(_0x38be('0x6'));var controller=require(_0x38be('0x7'));router[_0x38be('0x8')]('/',auth['isAuthenticated'](),controller[_0x38be('0x9')]);router[_0x38be('0x8')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['show']);router['post']('/',auth[_0x38be('0xb')](),controller[_0x38be('0xc')]);router[_0x38be('0xd')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller[_0x38be('0xe')]);router['delete'](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['destroy']);module[_0x38be('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 63bee71..1be9870 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 _0x697a=['stun','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x697a,0x18a));var _0xa697=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x697a[_0x903228];return _0xcec81d;};'use strict';var Sequelize=require(_0xa697('0x0'));module[_0xa697('0x1')]={'type':{'type':Sequelize[_0xa697('0x2')](_0xa697('0x3'),_0xa697('0x4'),_0xa697('0x5'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa697('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd4ff=['exports','ENUM','externip','turn','STRING','sequelize'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0xd4ff,0x149));var _0xfd4f=function(_0x162224,_0x138f58){_0x162224=_0x162224-0x0;var _0x4e449d=_0xd4ff[_0x162224];return _0x4e449d;};'use strict';var Sequelize=require(_0xfd4f('0x0'));module[_0xfd4f('0x1')]={'type':{'type':Sequelize[_0xfd4f('0x2')]('localnet',_0xfd4f('0x3'),'stun',_0xfd4f('0x4'))},'value':{'type':Sequelize[_0xfd4f('0x5')]},'username':{'type':Sequelize[_0xfd4f('0x5')]},'password':{'type':Sequelize[_0xfd4f('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8f4bbb7..ecbe8cc 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 _0x9306=['query','filters','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','create','sequelize','transaction','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','find','params','server/files/templates/network.ejs','chan_sip.so','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Network,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','name','index','map','Network','rawAttributes','fieldName','key','keys'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9306,0x176));var _0x6930=function(_0x2094cd,_0x316988){_0x2094cd=_0x2094cd-0x0;var _0xffc545=_0x9306[_0x2094cd];return _0xffc545;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6930('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6930('0x1'));var rp=require(_0x6930('0x2'));var moment=require(_0x6930('0x3'));var BPromise=require(_0x6930('0x4'));var Mustache=require(_0x6930('0x5'));var util=require(_0x6930('0x6'));var path=require(_0x6930('0x7'));var sox=require(_0x6930('0x8'));var csv=require(_0x6930('0x9'));var ejs=require(_0x6930('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6930('0xb'));var crypto=require('crypto');var jsforce=require(_0x6930('0xc'));var deskjs=require(_0x6930('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6930('0xe'));var Papa=require(_0x6930('0xf'));var Redis=require(_0x6930('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6930('0x11'));var as=require(_0x6930('0x12'));var hardwareService=require(_0x6930('0x13'));var logger=require(_0x6930('0x14'))(_0x6930('0x15'));var utils=require(_0x6930('0x16'));var config=require(_0x6930('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6930('0x18'))['db'];var jayson=require(_0x6930('0x19'));var client=jayson['client'][_0x6930('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4e420d,_0x276311,_0x571f07,_0x259fca){return new BPromise(function(_0xc85aca,_0x3b6a95){var _0x371c6a=_0x259fca||client;return _0x371c6a[_0x6930('0x1b')](_0x4e420d,_0x571f07)['then'](function(_0x4e3576){logger[_0x6930('0x1c')]('Network,\x20%s,\x20%s',_0x276311,_0x6930('0x1d'));logger[_0x6930('0x1e')](_0x6930('0x1f'),_0x276311,'request\x20sent',JSON[_0x6930('0x20')](_0x4e3576));if(_0x4e3576[_0x6930('0x21')]){if(_0x4e3576[_0x6930('0x21')][_0x6930('0x22')]===0x1f4){logger[_0x6930('0x21')]('Network,\x20%s,\x20%s',_0x276311,_0x4e3576[_0x6930('0x21')][_0x6930('0x23')]);return _0x3b6a95(_0x4e3576[_0x6930('0x21')][_0x6930('0x23')]);}logger[_0x6930('0x21')](_0x6930('0x24'),_0x276311,_0x4e3576[_0x6930('0x21')][_0x6930('0x23')]);return _0xc85aca(_0x4e3576[_0x6930('0x21')]['message']);}else{logger[_0x6930('0x1c')](_0x6930('0x24'),_0x276311,_0x6930('0x1d'));_0xc85aca(_0x4e3576[_0x6930('0x25')][_0x6930('0x23')]);}})[_0x6930('0x26')](function(_0x3272e4){logger[_0x6930('0x21')](_0x6930('0x24'),_0x276311,_0x3272e4);_0x3b6a95(_0x3272e4);});});}function respondWithStatusCode(_0x48d56f,_0x5b2f5c){_0x5b2f5c=_0x5b2f5c||0xcc;return function(_0x4001bb){if(_0x4001bb){return _0x48d56f[_0x6930('0x27')](_0x5b2f5c);}return _0x48d56f[_0x6930('0x28')](_0x5b2f5c)['end']();};}function respondWithResult(_0x50dbd5,_0x24f955){_0x24f955=_0x24f955||0xc8;return function(_0x34ba0c){if(_0x34ba0c){return _0x50dbd5[_0x6930('0x28')](_0x24f955)[_0x6930('0x29')](_0x34ba0c);}};}function respondWithFilteredResult(_0x2ac21c,_0x409bc7){return function(_0x2a53df){if(_0x2a53df){var _0x288870=typeof _0x409bc7[_0x6930('0x2a')]===_0x6930('0x2b')&&typeof _0x409bc7[_0x6930('0x2c')]==='undefined';var _0x429ed4=_0x2a53df[_0x6930('0x2d')];var _0x2a0b9f=_0x288870?0x0:_0x409bc7['offset'];var _0x58d5e7=_0x288870?_0x2a53df[_0x6930('0x2d')]:_0x409bc7[_0x6930('0x2a')]+_0x409bc7['limit'];var _0x2b0f03;if(_0x58d5e7>=_0x429ed4){_0x58d5e7=_0x429ed4;_0x2b0f03=0xc8;}else{_0x2b0f03=0xce;}_0x2ac21c[_0x6930('0x28')](_0x2b0f03);return _0x2ac21c[_0x6930('0x2e')]('Content-Range',_0x2a0b9f+'-'+_0x58d5e7+'/'+_0x429ed4)['json'](_0x2a53df);}return null;};}function patchUpdates(_0xc3b733){return function(_0x108864){try{jsonpatch[_0x6930('0x2f')](_0x108864,_0xc3b733,!![]);}catch(_0xf94f8d){return BPromise[_0x6930('0x30')](_0xf94f8d);}return _0x108864[_0x6930('0x31')]();};}function saveUpdates(_0x284640,_0x356084){return function(_0x242096){if(_0x242096){return _0x242096[_0x6930('0x32')](_0x284640)[_0x6930('0x33')](function(_0x5493a2){return _0x5493a2;});}return null;};}function removeEntity(_0xda293c,_0x104b37){return function(_0x4ea7de){if(_0x4ea7de){return _0x4ea7de[_0x6930('0x34')]()['then'](function(){_0xda293c[_0x6930('0x28')](0xcc)[_0x6930('0x35')]();});}};}function handleEntityNotFound(_0x2b7514,_0x4ffa06){return function(_0x20ace1){if(!_0x20ace1){_0x2b7514[_0x6930('0x27')](0x194);}return _0x20ace1;};}function handleError(_0x4f8c86,_0x536ac2){_0x536ac2=_0x536ac2||0x1f4;return function(_0x9303f9){logger[_0x6930('0x21')](_0x9303f9['stack']);if(_0x9303f9[_0x6930('0x36')]){delete _0x9303f9[_0x6930('0x36')];}_0x4f8c86[_0x6930('0x28')](_0x536ac2)['send'](_0x9303f9);};}exports[_0x6930('0x37')]=function(_0x3452c5,_0xda0c2c){var _0x418fd8={},_0x51b453={},_0x52807c={'count':0x0,'rows':[]};var _0x19f9f1=_[_0x6930('0x38')](db[_0x6930('0x39')][_0x6930('0x3a')],function(_0x56c99b){return{'name':_0x56c99b[_0x6930('0x3b')],'type':_0x56c99b['type'][_0x6930('0x3c')]};});_0x51b453['model']=_[_0x6930('0x38')](_0x19f9f1,_0x6930('0x36'));_0x51b453['query']=_[_0x6930('0x3d')](_0x3452c5[_0x6930('0x3e')]);_0x51b453[_0x6930('0x3f')]=_['intersection'](_0x51b453[_0x6930('0x40')],_0x51b453[_0x6930('0x3e')]);_0x418fd8[_0x6930('0x41')]=_['intersection'](_0x51b453['model'],qs[_0x6930('0x42')](_0x3452c5[_0x6930('0x3e')][_0x6930('0x42')]));_0x418fd8[_0x6930('0x41')]=_0x418fd8[_0x6930('0x41')][_0x6930('0x43')]?_0x418fd8[_0x6930('0x41')]:_0x51b453[_0x6930('0x40')];if(!_0x3452c5[_0x6930('0x3e')]['hasOwnProperty'](_0x6930('0x44'))){_0x418fd8[_0x6930('0x2c')]=qs[_0x6930('0x2c')](_0x3452c5[_0x6930('0x3e')][_0x6930('0x2c')]);_0x418fd8[_0x6930('0x2a')]=qs['offset'](_0x3452c5['query']['offset']);}_0x418fd8['order']=qs[_0x6930('0x45')](_0x3452c5[_0x6930('0x3e')]['sort']);_0x418fd8[_0x6930('0x46')]=qs[_0x6930('0x3f')](_[_0x6930('0x47')](_0x3452c5[_0x6930('0x3e')],_0x51b453[_0x6930('0x3f')]),_0x19f9f1);if(_0x3452c5['query'][_0x6930('0x48')]){_0x418fd8[_0x6930('0x46')]=_[_0x6930('0x49')](_0x418fd8[_0x6930('0x46')],{'$or':_[_0x6930('0x38')](_0x19f9f1,function(_0x2809f5){if(_0x2809f5[_0x6930('0x4a')]!==_0x6930('0x4b')){var _0x2f0255={};_0x2f0255[_0x2809f5[_0x6930('0x36')]]={'$like':'%'+_0x3452c5[_0x6930('0x3e')][_0x6930('0x48')]+'%'};return _0x2f0255;}})});}_0x418fd8=_['merge']({},_0x418fd8,_0x3452c5[_0x6930('0x4c')]);var _0x1b71d8={'where':_0x418fd8['where']};return db[_0x6930('0x39')][_0x6930('0x2d')](_0x1b71d8)[_0x6930('0x33')](function(_0x113a3d){_0x52807c['count']=_0x113a3d;if(_0x3452c5[_0x6930('0x3e')][_0x6930('0x4d')]){_0x418fd8[_0x6930('0x4e')]=[{'all':!![]}];}return db['Network'][_0x6930('0x4f')](_0x418fd8);})[_0x6930('0x33')](function(_0x5bab3c){_0x52807c[_0x6930('0x50')]=_0x5bab3c;return _0x52807c;})[_0x6930('0x33')](respondWithFilteredResult(_0xda0c2c,_0x418fd8))[_0x6930('0x26')](handleError(_0xda0c2c,null));};exports[_0x6930('0x51')]=function(_0x5dbec0,_0x1cbd04){var _0x4b0d95={'raw':!![],'where':{'id':_0x5dbec0['params']['id']}},_0x174d7a={};_0x174d7a[_0x6930('0x40')]=_[_0x6930('0x3d')](db[_0x6930('0x39')][_0x6930('0x3a')]);_0x174d7a[_0x6930('0x3e')]=_['keys'](_0x5dbec0['query']);_0x174d7a['filters']=_[_0x6930('0x52')](_0x174d7a[_0x6930('0x40')],_0x174d7a['query']);_0x4b0d95[_0x6930('0x41')]=_[_0x6930('0x52')](_0x174d7a[_0x6930('0x40')],qs['fields'](_0x5dbec0[_0x6930('0x3e')][_0x6930('0x42')]));_0x4b0d95[_0x6930('0x41')]=_0x4b0d95['attributes'][_0x6930('0x43')]?_0x4b0d95[_0x6930('0x41')]:_0x174d7a['model'];if(_0x5dbec0[_0x6930('0x3e')][_0x6930('0x4d')]){_0x4b0d95[_0x6930('0x4e')]=[{'all':!![]}];}_0x4b0d95=_['merge']({},_0x4b0d95,_0x5dbec0['options']);return db[_0x6930('0x39')]['find'](_0x4b0d95)[_0x6930('0x33')](handleEntityNotFound(_0x1cbd04,null))['then'](respondWithResult(_0x1cbd04,null))[_0x6930('0x26')](handleError(_0x1cbd04,null));};exports[_0x6930('0x53')]=function(_0x458cfb,_0x264966,_0x2986e4){var _0x562b0b;return db[_0x6930('0x54')][_0x6930('0x55')](function(_0x102888){return db[_0x6930('0x39')][_0x6930('0x53')](_0x458cfb[_0x6930('0x56')],{'raw':!![]})[_0x6930('0x33')](function(_0x13b43a){_0x562b0b=_0x13b43a;return db[_0x6930('0x39')][_0x6930('0x4f')]({'where':{'type':_0x458cfb[_0x6930('0x56')][_0x6930('0x4a')]},'raw':!![]});})[_0x6930('0x33')](function(_0x4821b9){if(_0x562b0b[_0x6930('0x4a')][_0x6930('0x57')]()==_0x6930('0x58')){var _0x3f818a=fs['readFileSync'](path[_0x6930('0x59')](config[_0x6930('0x5a')],_0x6930('0x5b')),_0x6930('0x5c'));var _0x39affd=ejs[_0x6930('0x5d')](_0x3f818a,{'networks':_0x4821b9||[]});fs[_0x6930('0x5e')](_0x6930('0x5f'),_0x39affd);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x53'),{'module':_0x6930('0x61')});}else if(_0x562b0b[_0x6930('0x4a')][_0x6930('0x57')]()==_0x6930('0x62')){var _0x46b8e3=fs[_0x6930('0x63')](path[_0x6930('0x59')](config[_0x6930('0x5a')],_0x6930('0x64')),_0x6930('0x5c'));var _0x469828=ejs['render'](_0x46b8e3,{'networks':_0x4821b9||[]});fs[_0x6930('0x5e')](_0x6930('0x65'),_0x469828);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x53'),{'module':_0x6930('0x61')});}else{var _0x415dda=fs['readFileSync'](path[_0x6930('0x59')](config[_0x6930('0x5a')],'server/files/templates/network.ejs'),_0x6930('0x5c'));var _0x4c5fc2=ejs['render'](_0x415dda,{'networks':_0x4821b9||[]});fs[_0x6930('0x5e')](util[_0x6930('0x66')](_0x6930('0x67'),_0x458cfb['body'][_0x6930('0x4a')][_0x6930('0x68')]()),_0x4c5fc2);return respondWithRpcPromise('Reload',_0x6930('0x53'),{'module':'chan_sip.so'});}return null;})[_0x6930('0x33')](function(){return _0x562b0b;});})[_0x6930('0x33')](respondWithResult(_0x264966,0xc9))['catch'](handleError(_0x264966,null));};exports[_0x6930('0x32')]=function(_0x2225d6,_0x3b3d0e,_0x3cd104){var _0x9e554a;return db[_0x6930('0x54')]['transaction'](function(_0x16ddc1){return db['Network'][_0x6930('0x69')]({'where':{'id':_0x2225d6[_0x6930('0x6a')]['id']}})['then'](handleEntityNotFound(_0x3b3d0e,null))[_0x6930('0x33')](saveUpdates(_0x2225d6[_0x6930('0x56')],null))[_0x6930('0x33')](function(_0x47614f){if(_0x47614f){_0x9e554a=_0x47614f;return db[_0x6930('0x39')][_0x6930('0x4f')]({'where':{'type':_0x9e554a[_0x6930('0x4a')]},'raw':!![]});}return null;})[_0x6930('0x33')](function(_0x5c580a){if(_0x9e554a['type'][_0x6930('0x57')]()=='STUN'){var _0x2222a4=fs[_0x6930('0x63')](path[_0x6930('0x59')](config[_0x6930('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x6930('0x5c'));var _0x15e4c1=ejs[_0x6930('0x5d')](_0x2222a4,{'networks':_0x5c580a||[]});fs[_0x6930('0x5e')](_0x6930('0x5f'),_0x15e4c1);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x32'),{'module':_0x6930('0x61')});}else if(_0x9e554a[_0x6930('0x4a')][_0x6930('0x57')]()==_0x6930('0x62')){var _0x358f70=fs[_0x6930('0x63')](path[_0x6930('0x59')](config[_0x6930('0x5a')],_0x6930('0x64')),_0x6930('0x5c'));var _0x49749=ejs['render'](_0x358f70,{'networks':_0x5c580a||[]});fs[_0x6930('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x49749);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x32'),{'module':_0x6930('0x61')});}else{var _0x19aea3=fs[_0x6930('0x63')](path[_0x6930('0x59')](config[_0x6930('0x5a')],_0x6930('0x6b')),_0x6930('0x5c'));var _0x408a71=ejs[_0x6930('0x5d')](_0x19aea3,{'networks':_0x5c580a||[]});fs[_0x6930('0x5e')](util[_0x6930('0x66')](_0x6930('0x67'),_0x2225d6[_0x6930('0x56')]['type'][_0x6930('0x68')]()),_0x408a71);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x32'),{'module':_0x6930('0x6c')});}return null;})[_0x6930('0x33')](function(_0x5d1879){if(_0x5d1879){return _0x9e554a;}return null;});})[_0x6930('0x33')](respondWithResult(_0x3b3d0e,null))[_0x6930('0x26')](handleError(_0x3b3d0e,null));};exports[_0x6930('0x34')]=function(_0x2af33c,_0x2eec00,_0x4ce394){var _0x2d72fa;return db['Network'][_0x6930('0x69')]({'where':{'id':_0x2af33c[_0x6930('0x6a')]['id']}})[_0x6930('0x33')](function(_0x33fda3){_0x2d72fa=_0x33fda3;return _0x33fda3;})[_0x6930('0x33')](handleEntityNotFound(_0x2eec00,null))[_0x6930('0x33')](removeEntity(_0x2eec00,null))[_0x6930('0x33')](function(){if(_0x2d72fa){return db[_0x6930('0x39')][_0x6930('0x4f')]({'where':{'type':_0x2d72fa[_0x6930('0x4a')]},'raw':!![]});}})['then'](function(_0x434353){if(_0x2d72fa[_0x6930('0x4a')][_0x6930('0x57')]()==_0x6930('0x58')){var _0xba60e0=fs['readFileSync'](path[_0x6930('0x59')](config['root'],_0x6930('0x5b')),'utf8');var _0x24eecf=ejs['render'](_0xba60e0,{'networks':_0x434353||[]});fs['writeFileSync'](_0x6930('0x5f'),_0x24eecf);return respondWithRpcPromise('Reload',_0x6930('0x34'),{'module':'res_stun_monitor.so'});}else if(_0x2d72fa[_0x6930('0x4a')][_0x6930('0x57')]()==_0x6930('0x62')){var _0x301669=fs[_0x6930('0x63')](path[_0x6930('0x59')](config['root'],_0x6930('0x64')),'utf8');var _0x124952=ejs[_0x6930('0x5d')](_0x301669,{'networks':_0x434353||[]});fs[_0x6930('0x5e')](_0x6930('0x65'),_0x124952);return respondWithRpcPromise('Reload',_0x6930('0x34'),{'module':'res_stun_monitor.so'});}else{var _0x1357f8=fs[_0x6930('0x63')](path[_0x6930('0x59')](config[_0x6930('0x5a')],_0x6930('0x6b')),_0x6930('0x5c'));var _0x5eeaa4=ejs[_0x6930('0x5d')](_0x1357f8,{'networks':_0x434353||[]});fs['writeFileSync'](util[_0x6930('0x66')](_0x6930('0x67'),_0x2af33c[_0x6930('0x56')][_0x6930('0x4a')][_0x6930('0x68')]()),_0x5eeaa4);return respondWithRpcPromise(_0x6930('0x60'),_0x6930('0x34'),{'module':_0x6930('0x6c')});}return null;})[_0x6930('0x26')](handleError(_0x2eec00,null));}; \ No newline at end of file +var _0xb67d=['send','index','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','params','length','include','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','Reload','server/files/templates/network.ejs','format','update','sequelize','find','TURN','/etc/asterisk/turn_xcally.conf','toLowerCase','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','offset','count','limit','apply','reject','destroy','name'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0xb67d,0x1ef));var _0xdb67=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb67d[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xdb67('0x0'));var rimraf=require(_0xdb67('0x1'));var zipdir=require(_0xdb67('0x2'));var jsonpatch=require(_0xdb67('0x3'));var rp=require(_0xdb67('0x4'));var moment=require(_0xdb67('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb67('0x6'));var util=require(_0xdb67('0x7'));var path=require(_0xdb67('0x8'));var sox=require(_0xdb67('0x9'));var csv=require(_0xdb67('0xa'));var ejs=require(_0xdb67('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb67('0xc'));var squel=require(_0xdb67('0xd'));var crypto=require(_0xdb67('0xe'));var jsforce=require(_0xdb67('0xf'));var deskjs=require(_0xdb67('0x10'));var toCsv=require(_0xdb67('0xa'));var querystring=require(_0xdb67('0x11'));var Papa=require(_0xdb67('0x12'));var Redis=require(_0xdb67('0x13'));var authService=require(_0xdb67('0x14'));var qs=require(_0xdb67('0x15'));var as=require(_0xdb67('0x16'));var hardwareService=require(_0xdb67('0x17'));var logger=require(_0xdb67('0x18'))(_0xdb67('0x19'));var utils=require(_0xdb67('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xdb67('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdb67('0x1c'));var client=jayson[_0xdb67('0x1d')][_0xdb67('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x537e98,_0x559db3,_0x307455,_0x25db9b){return new BPromise(function(_0x50146b,_0x5c6ec5){var _0xf8b702=_0x25db9b||client;return _0xf8b702[_0xdb67('0x1f')](_0x537e98,_0x307455)[_0xdb67('0x20')](function(_0x5246b4){logger[_0xdb67('0x21')]('Network,\x20%s,\x20%s',_0x559db3,_0xdb67('0x22'));logger[_0xdb67('0x23')](_0xdb67('0x24'),_0x559db3,_0xdb67('0x22'),JSON[_0xdb67('0x25')](_0x5246b4));if(_0x5246b4[_0xdb67('0x26')]){if(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x27')]===0x1f4){logger[_0xdb67('0x26')](_0xdb67('0x28'),_0x559db3,_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);return _0x5c6ec5(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);}logger['error'](_0xdb67('0x28'),_0x559db3,_0x5246b4['error'][_0xdb67('0x29')]);return _0x50146b(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);}else{logger[_0xdb67('0x21')](_0xdb67('0x28'),_0x559db3,_0xdb67('0x22'));_0x50146b(_0x5246b4['result']['message']);}})[_0xdb67('0x2a')](function(_0x5579a3){logger[_0xdb67('0x26')](_0xdb67('0x28'),_0x559db3,_0x5579a3);_0x5c6ec5(_0x5579a3);});});}function respondWithStatusCode(_0x574841,_0x4cc1f8){_0x4cc1f8=_0x4cc1f8||0xcc;return function(_0x12a621){if(_0x12a621){return _0x574841[_0xdb67('0x2b')](_0x4cc1f8);}return _0x574841[_0xdb67('0x2c')](_0x4cc1f8)[_0xdb67('0x2d')]();};}function respondWithResult(_0x4423a5,_0x543cde){_0x543cde=_0x543cde||0xc8;return function(_0xea509f){if(_0xea509f){return _0x4423a5['status'](_0x543cde)[_0xdb67('0x2e')](_0xea509f);}};}function respondWithFilteredResult(_0x1c79b8,_0x31f4c7){return function(_0x4e258e){if(_0x4e258e){var _0x46e287=typeof _0x31f4c7['offset']===_0xdb67('0x2f')&&typeof _0x31f4c7['limit']===_0xdb67('0x2f');var _0x2005c8=_0x4e258e['count'];var _0x46e82d=_0x46e287?0x0:_0x31f4c7[_0xdb67('0x30')];var _0x4382b3=_0x46e287?_0x4e258e[_0xdb67('0x31')]:_0x31f4c7['offset']+_0x31f4c7[_0xdb67('0x32')];var _0x96870f;if(_0x4382b3>=_0x2005c8){_0x4382b3=_0x2005c8;_0x96870f=0xc8;}else{_0x96870f=0xce;}_0x1c79b8[_0xdb67('0x2c')](_0x96870f);return _0x1c79b8['set']('Content-Range',_0x46e82d+'-'+_0x4382b3+'/'+_0x2005c8)['json'](_0x4e258e);}return null;};}function patchUpdates(_0x110c76){return function(_0x2d9533){try{jsonpatch[_0xdb67('0x33')](_0x2d9533,_0x110c76,!![]);}catch(_0xee3e2e){return BPromise[_0xdb67('0x34')](_0xee3e2e);}return _0x2d9533['save']();};}function saveUpdates(_0x42b83b,_0x53900d){return function(_0x16e60b){if(_0x16e60b){return _0x16e60b['update'](_0x42b83b)[_0xdb67('0x20')](function(_0x1fe95d){return _0x1fe95d;});}return null;};}function removeEntity(_0x1fbb99,_0x4042b9){return function(_0x2b4fae){if(_0x2b4fae){return _0x2b4fae[_0xdb67('0x35')]()[_0xdb67('0x20')](function(){_0x1fbb99['status'](0xcc)[_0xdb67('0x2d')]();});}};}function handleEntityNotFound(_0x40cf5e,_0x4cac8d){return function(_0xef72c1){if(!_0xef72c1){_0x40cf5e[_0xdb67('0x2b')](0x194);}return _0xef72c1;};}function handleError(_0x28b15d,_0x443dcf){_0x443dcf=_0x443dcf||0x1f4;return function(_0x2bf3be){logger[_0xdb67('0x26')](_0x2bf3be['stack']);if(_0x2bf3be['name']){delete _0x2bf3be[_0xdb67('0x36')];}_0x28b15d['status'](_0x443dcf)[_0xdb67('0x37')](_0x2bf3be);};}exports[_0xdb67('0x38')]=function(_0x23b6c6,_0x8f4073){var _0x4ab325={},_0xa49ae1={},_0x3429fa={'count':0x0,'rows':[]};var _0x4e4f73=_['map'](db[_0xdb67('0x39')][_0xdb67('0x3a')],function(_0x12a3e5){return{'name':_0x12a3e5[_0xdb67('0x3b')],'type':_0x12a3e5[_0xdb67('0x3c')][_0xdb67('0x3d')]};});_0xa49ae1[_0xdb67('0x3e')]=_['map'](_0x4e4f73,_0xdb67('0x36'));_0xa49ae1[_0xdb67('0x3f')]=_[_0xdb67('0x40')](_0x23b6c6[_0xdb67('0x3f')]);_0xa49ae1[_0xdb67('0x41')]=_[_0xdb67('0x42')](_0xa49ae1['model'],_0xa49ae1[_0xdb67('0x3f')]);_0x4ab325[_0xdb67('0x43')]=_[_0xdb67('0x42')](_0xa49ae1['model'],qs[_0xdb67('0x44')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x44')]));_0x4ab325[_0xdb67('0x43')]=_0x4ab325['attributes']['length']?_0x4ab325[_0xdb67('0x43')]:_0xa49ae1[_0xdb67('0x3e')];if(!_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x45')](_0xdb67('0x46'))){_0x4ab325[_0xdb67('0x32')]=qs[_0xdb67('0x32')](_0x23b6c6['query']['limit']);_0x4ab325['offset']=qs[_0xdb67('0x30')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x30')]);}_0x4ab325[_0xdb67('0x47')]=qs[_0xdb67('0x48')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x48')]);_0x4ab325[_0xdb67('0x49')]=qs[_0xdb67('0x41')](_[_0xdb67('0x4a')](_0x23b6c6[_0xdb67('0x3f')],_0xa49ae1[_0xdb67('0x41')]),_0x4e4f73);if(_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x4b')]){_0x4ab325[_0xdb67('0x49')]=_[_0xdb67('0x4c')](_0x4ab325[_0xdb67('0x49')],{'$or':_[_0xdb67('0x4d')](_0x4e4f73,function(_0x248911){if(_0x248911[_0xdb67('0x3c')]!==_0xdb67('0x4e')){var _0x14d3d8={};_0x14d3d8[_0x248911['name']]={'$like':'%'+_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x4b')]+'%'};return _0x14d3d8;}})});}_0x4ab325=_[_0xdb67('0x4c')]({},_0x4ab325,_0x23b6c6[_0xdb67('0x4f')]);var _0x2cc722={'where':_0x4ab325[_0xdb67('0x49')]};return db[_0xdb67('0x39')][_0xdb67('0x31')](_0x2cc722)[_0xdb67('0x20')](function(_0x5536a8){_0x3429fa[_0xdb67('0x31')]=_0x5536a8;if(_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x50')]){_0x4ab325['include']=[{'all':!![]}];}return db['Network'][_0xdb67('0x51')](_0x4ab325);})[_0xdb67('0x20')](function(_0x303f7a){_0x3429fa['rows']=_0x303f7a;return _0x3429fa;})[_0xdb67('0x20')](respondWithFilteredResult(_0x8f4073,_0x4ab325))['catch'](handleError(_0x8f4073,null));};exports['show']=function(_0x15c8d9,_0x1961f5){var _0x387fd5={'raw':!![],'where':{'id':_0x15c8d9[_0xdb67('0x52')]['id']}},_0x51f1ce={};_0x51f1ce[_0xdb67('0x3e')]=_['keys'](db['Network'][_0xdb67('0x3a')]);_0x51f1ce[_0xdb67('0x3f')]=_[_0xdb67('0x40')](_0x15c8d9[_0xdb67('0x3f')]);_0x51f1ce[_0xdb67('0x41')]=_[_0xdb67('0x42')](_0x51f1ce[_0xdb67('0x3e')],_0x51f1ce[_0xdb67('0x3f')]);_0x387fd5['attributes']=_[_0xdb67('0x42')](_0x51f1ce['model'],qs[_0xdb67('0x44')](_0x15c8d9[_0xdb67('0x3f')][_0xdb67('0x44')]));_0x387fd5['attributes']=_0x387fd5['attributes'][_0xdb67('0x53')]?_0x387fd5[_0xdb67('0x43')]:_0x51f1ce[_0xdb67('0x3e')];if(_0x15c8d9[_0xdb67('0x3f')][_0xdb67('0x50')]){_0x387fd5[_0xdb67('0x54')]=[{'all':!![]}];}_0x387fd5=_[_0xdb67('0x4c')]({},_0x387fd5,_0x15c8d9[_0xdb67('0x4f')]);return db['Network']['find'](_0x387fd5)[_0xdb67('0x20')](handleEntityNotFound(_0x1961f5,null))[_0xdb67('0x20')](respondWithResult(_0x1961f5,null))['catch'](handleError(_0x1961f5,null));};exports[_0xdb67('0x55')]=function(_0x32b168,_0x5ecc33,_0x51389b){var _0x1b39ab;return db['sequelize'][_0xdb67('0x56')](function(_0x7b08a){return db['Network'][_0xdb67('0x55')](_0x32b168[_0xdb67('0x57')],{'raw':!![]})[_0xdb67('0x20')](function(_0x3e9cda){_0x1b39ab=_0x3e9cda;return db['Network']['findAll']({'where':{'type':_0x32b168['body'][_0xdb67('0x3c')]},'raw':!![]});})[_0xdb67('0x20')](function(_0x5419bb){if(_0x1b39ab['type'][_0xdb67('0x58')]()==_0xdb67('0x59')){var _0x354b2d=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),_0xdb67('0x5e'));var _0x1c4ec5=ejs[_0xdb67('0x5f')](_0x354b2d,{'networks':_0x5419bb||[]});fs[_0xdb67('0x60')](_0xdb67('0x61'),_0x1c4ec5);return respondWithRpcPromise('Reload',_0xdb67('0x55'),{'module':_0xdb67('0x62')});}else if(_0x1b39ab['type'][_0xdb67('0x58')]()=='TURN'){var _0x359483=fs[_0xdb67('0x5a')](path['join'](config[_0xdb67('0x5c')],_0xdb67('0x63')),_0xdb67('0x5e'));var _0x3bf91e=ejs[_0xdb67('0x5f')](_0x359483,{'networks':_0x5419bb||[]});fs[_0xdb67('0x60')]('/etc/asterisk/turn_xcally.conf',_0x3bf91e);return respondWithRpcPromise(_0xdb67('0x64'),'create',{'module':'res_stun_monitor.so'});}else{var _0x3d5355=fs['readFileSync'](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x29dae0=ejs['render'](_0x3d5355,{'networks':_0x5419bb||[]});fs['writeFileSync'](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x32b168[_0xdb67('0x57')]['type']['toLowerCase']()),_0x29dae0);return respondWithRpcPromise(_0xdb67('0x64'),_0xdb67('0x55'),{'module':'chan_sip.so'});}return null;})[_0xdb67('0x20')](function(){return _0x1b39ab;});})[_0xdb67('0x20')](respondWithResult(_0x5ecc33,0xc9))[_0xdb67('0x2a')](handleError(_0x5ecc33,null));};exports[_0xdb67('0x67')]=function(_0x2ec787,_0x365408,_0x62eb5d){var _0x29219;return db[_0xdb67('0x68')][_0xdb67('0x56')](function(_0x475757){return db[_0xdb67('0x39')][_0xdb67('0x69')]({'where':{'id':_0x2ec787[_0xdb67('0x52')]['id']}})[_0xdb67('0x20')](handleEntityNotFound(_0x365408,null))[_0xdb67('0x20')](saveUpdates(_0x2ec787[_0xdb67('0x57')],null))[_0xdb67('0x20')](function(_0x50403c){if(_0x50403c){_0x29219=_0x50403c;return db['Network'][_0xdb67('0x51')]({'where':{'type':_0x29219[_0xdb67('0x3c')]},'raw':!![]});}return null;})[_0xdb67('0x20')](function(_0x43f1ba){if(_0x29219[_0xdb67('0x3c')][_0xdb67('0x58')]()==_0xdb67('0x59')){var _0x1d798f=fs['readFileSync'](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),'utf8');var _0x220e17=ejs[_0xdb67('0x5f')](_0x1d798f,{'networks':_0x43f1ba||[]});fs[_0xdb67('0x60')]('/etc/asterisk/stun_xcally.conf',_0x220e17);return respondWithRpcPromise(_0xdb67('0x64'),'update',{'module':'res_stun_monitor.so'});}else if(_0x29219['type'][_0xdb67('0x58')]()==_0xdb67('0x6a')){var _0x189df2=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xdb67('0x5e'));var _0x5a9687=ejs[_0xdb67('0x5f')](_0x189df2,{'networks':_0x43f1ba||[]});fs['writeFileSync'](_0xdb67('0x6b'),_0x5a9687);return respondWithRpcPromise(_0xdb67('0x64'),_0xdb67('0x67'),{'module':_0xdb67('0x62')});}else{var _0x1f8d6c=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x4bc538=ejs[_0xdb67('0x5f')](_0x1f8d6c,{'networks':_0x43f1ba||[]});fs['writeFileSync'](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ec787[_0xdb67('0x57')][_0xdb67('0x3c')][_0xdb67('0x6c')]()),_0x4bc538);return respondWithRpcPromise(_0xdb67('0x64'),'update',{'module':_0xdb67('0x6d')});}return null;})[_0xdb67('0x20')](function(_0x369612){if(_0x369612){return _0x29219;}return null;});})['then'](respondWithResult(_0x365408,null))['catch'](handleError(_0x365408,null));};exports[_0xdb67('0x35')]=function(_0x593f00,_0x316bc3,_0x452cf5){var _0xc2d876;return db['Network'][_0xdb67('0x69')]({'where':{'id':_0x593f00['params']['id']}})['then'](function(_0x19b092){_0xc2d876=_0x19b092;return _0x19b092;})[_0xdb67('0x20')](handleEntityNotFound(_0x316bc3,null))['then'](removeEntity(_0x316bc3,null))[_0xdb67('0x20')](function(){if(_0xc2d876){return db[_0xdb67('0x39')][_0xdb67('0x51')]({'where':{'type':_0xc2d876[_0xdb67('0x3c')]},'raw':!![]});}})[_0xdb67('0x20')](function(_0x432f40){if(_0xc2d876[_0xdb67('0x3c')]['toUpperCase']()==_0xdb67('0x59')){var _0x215e57=fs['readFileSync'](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),_0xdb67('0x5e'));var _0x226c60=ejs[_0xdb67('0x5f')](_0x215e57,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')]('/etc/asterisk/stun_xcally.conf',_0x226c60);return respondWithRpcPromise('Reload',_0xdb67('0x35'),{'module':_0xdb67('0x62')});}else if(_0xc2d876[_0xdb67('0x3c')][_0xdb67('0x58')]()==_0xdb67('0x6a')){var _0xba30ba=fs['readFileSync'](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x63')),_0xdb67('0x5e'));var _0x38f525=ejs['render'](_0xba30ba,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')](_0xdb67('0x6b'),_0x38f525);return respondWithRpcPromise(_0xdb67('0x64'),'destroy',{'module':_0xdb67('0x62')});}else{var _0x1f82fd=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x2afac0=ejs[_0xdb67('0x5f')](_0x1f82fd,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x593f00['body'][_0xdb67('0x3c')]['toLowerCase']()),_0x2afac0);return respondWithRpcPromise('Reload',_0xdb67('0x35'),{'module':_0xdb67('0x6d')});}return null;})[_0xdb67('0x2a')](handleError(_0x316bc3,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 0963638..ed00f2b 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 _0xcffe=['network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Network'];(function(_0xf05c4d,_0x140378){var _0x14030b=function(_0x4e0fe9){while(--_0x4e0fe9){_0xf05c4d['push'](_0xf05c4d['shift']());}};_0x14030b(++_0x140378);}(_0xcffe,0x1a1));var _0xecff=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xcffe[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var logger=require(_0xecff('0x2'))(_0xecff('0x3'));var moment=require(_0xecff('0x4'));var BPromise=require(_0xecff('0x5'));var rp=require(_0xecff('0x6'));var fs=require('fs');var path=require(_0xecff('0x7'));var rimraf=require(_0xecff('0x8'));var config=require(_0xecff('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x3020d9,_0x25572c){return _0x3020d9[_0xecff('0xa')](_0xecff('0xb'),attributes,{'tableName':_0xecff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24cf=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','Network','../../config/logger'];(function(_0x4a08f5,_0x29f8b0){var _0x4f2cd6=function(_0x2716f8){while(--_0x2716f8){_0x4a08f5['push'](_0x4a08f5['shift']());}};_0x4f2cd6(++_0x29f8b0);}(_0x24cf,0x1d5));var _0xf24c=function(_0x4d9d1e,_0x1a7f59){_0x4d9d1e=_0x4d9d1e-0x0;var _0x535684=_0x24cf[_0x4d9d1e];return _0x535684;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf24c('0x0'))(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rp=require(_0xf24c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var attributes=require(_0xf24c('0x7'));module[_0xf24c('0x8')]=function(_0x5c4ebc,_0x4983e2){return _0x5c4ebc['define'](_0xf24c('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 9e54478..5310dff 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1c3717,_0x4acc59){_0x1c3717=_0x1c3717-0x0;var _0x4b113c=_0x7a54[_0x1c3717];return _0x4b113c;};'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(_0xc8f868,_0x56aec0){var _0x14f5cf=function(_0x5a0d5d){while(--_0x5a0d5d){_0xc8f868['push'](_0xc8f868['shift']());}};_0x14f5cf(++_0x56aec0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 b5f9165..648ad76 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 _0xce51=['getApplications','/:id/interactions','getInteractions','getAgents','create','post','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeAgents','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications'];(function(_0x19df8e,_0xc8482){var _0x378598=function(_0x24f1d0){while(--_0x24f1d0){_0x19df8e['push'](_0x19df8e['shift']());}};_0x378598(++_0xc8482);}(_0xce51,0x85));var _0x1ce5=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0xce51[_0x1ab0e6];return _0x248815;};'use strict';var multer=require(_0x1ce5('0x0'));var util=require(_0x1ce5('0x1'));var path=require(_0x1ce5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ce5('0x3')]();var fs_extra=require(_0x1ce5('0x4'));var auth=require(_0x1ce5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1ce5('0x6'));var controller=require(_0x1ce5('0x7'));router[_0x1ce5('0x8')]('/',auth['isAuthenticated'](),controller[_0x1ce5('0x9')]);router[_0x1ce5('0x8')](_0x1ce5('0xa'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0xc')]);router[_0x1ce5('0x8')]('/:id',auth[_0x1ce5('0xb')](),controller[_0x1ce5('0xd')]);router['get'](_0x1ce5('0xe'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0xf')]);router[_0x1ce5('0x8')](_0x1ce5('0x10'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x11')]);router[_0x1ce5('0x8')](_0x1ce5('0x12'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x13')]);router[_0x1ce5('0x8')](_0x1ce5('0x14'),auth['isAuthenticated'](),controller[_0x1ce5('0x15')]);router['get']('/:id/users',auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x16')]);router['post']('/',auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x17')]);router[_0x1ce5('0x18')](_0x1ce5('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x1ce5('0x10'),auth[_0x1ce5('0xb')](),controller['addAnswer']);router[_0x1ce5('0x18')](_0x1ce5('0x19'),controller[_0x1ce5('0x1a')]);router['post'](_0x1ce5('0x12'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x1b')]);router[_0x1ce5('0x18')](_0x1ce5('0x1c'),auth['isAuthenticated'](),controller[_0x1ce5('0x1d')]);router['post'](_0x1ce5('0x1e'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x1f')]);router[_0x1ce5('0x20')](_0x1ce5('0x21'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x22')]);router[_0x1ce5('0x23')](_0x1ce5('0x21'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x24')]);router[_0x1ce5('0x23')](_0x1ce5('0xe'),auth[_0x1ce5('0xb')](),controller['removeDispositions']);router[_0x1ce5('0x23')]('/:id/canned_answers',auth[_0x1ce5('0xb')](),controller['removeAnswers']);router[_0x1ce5('0x23')](_0x1ce5('0x1c'),auth[_0x1ce5('0xb')](),controller[_0x1ce5('0x25')]);module['exports']=router; \ No newline at end of file +var _0x3508=['/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3508,0xe5));var _0x8350=function(_0x569ea3,_0x114b8e){_0x569ea3=_0x569ea3-0x0;var _0x10ef56=_0x3508[_0x569ea3];return _0x10ef56;};'use strict';var multer=require('multer');var util=require(_0x8350('0x0'));var path=require(_0x8350('0x1'));var timeout=require(_0x8350('0x2'));var express=require(_0x8350('0x3'));var router=express[_0x8350('0x4')]();var fs_extra=require(_0x8350('0x5'));var auth=require(_0x8350('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x8350('0x7')]('/',auth[_0x8350('0x8')](),controller[_0x8350('0x9')]);router[_0x8350('0x7')](_0x8350('0xa'),auth['isAuthenticated'](),controller[_0x8350('0xb')]);router[_0x8350('0x7')](_0x8350('0xc'),auth[_0x8350('0x8')](),controller[_0x8350('0xd')]);router['get'](_0x8350('0xe'),auth[_0x8350('0x8')](),controller[_0x8350('0xf')]);router['get'](_0x8350('0x10'),auth[_0x8350('0x8')](),controller['getAnswers']);router[_0x8350('0x7')](_0x8350('0x11'),auth[_0x8350('0x8')](),controller[_0x8350('0x12')]);router[_0x8350('0x7')]('/:id/interactions',auth[_0x8350('0x8')](),controller[_0x8350('0x13')]);router['get'](_0x8350('0x14'),auth[_0x8350('0x8')](),controller['getAgents']);router[_0x8350('0x15')]('/',auth['isAuthenticated'](),controller[_0x8350('0x16')]);router[_0x8350('0x15')](_0x8350('0xe'),auth['isAuthenticated'](),controller[_0x8350('0x17')]);router[_0x8350('0x15')](_0x8350('0x10'),auth[_0x8350('0x8')](),controller[_0x8350('0x18')]);router[_0x8350('0x15')](_0x8350('0x19'),controller[_0x8350('0x1a')]);router['post'](_0x8350('0x11'),auth['isAuthenticated'](),controller[_0x8350('0x1b')]);router[_0x8350('0x15')](_0x8350('0x14'),auth[_0x8350('0x8')](),controller['addAgents']);router['post'](_0x8350('0x1c'),auth['isAuthenticated'](),controller[_0x8350('0x1d')]);router['put'](_0x8350('0xc'),auth[_0x8350('0x8')](),controller['update']);router[_0x8350('0x1e')](_0x8350('0xc'),auth[_0x8350('0x8')](),controller['destroy']);router[_0x8350('0x1e')](_0x8350('0xe'),auth['isAuthenticated'](),controller[_0x8350('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x8350('0x8')](),controller[_0x8350('0x20')]);router[_0x8350('0x1e')](_0x8350('0x14'),auth[_0x8350('0x8')](),controller[_0x8350('0x21')]);module[_0x8350('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 1466917..82d4b56 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 _0x7799=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x39c543,_0x1e8f37){var _0x1bf3c8=function(_0x3a068e){while(--_0x3a068e){_0x39c543['push'](_0x39c543['shift']());}};_0x1bf3c8(++_0x1e8f37);}(_0x7799,0x1c4));var _0x9779=function(_0x1b9edd,_0x66b166){_0x1b9edd=_0x1b9edd-0x0;var _0x4907c4=_0x7799[_0x1b9edd];return _0x4907c4;};'use strict';var Sequelize=require(_0x9779('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x9779('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9779('0x1')]},'token':{'type':Sequelize[_0x9779('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x9779('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9779('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9779('0x2')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9779('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9779('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9779('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9779('0x1')]},'queueTransfer':{'type':Sequelize[_0x9779('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9779('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9779('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9779('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x9779('0x5')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9779('0x6'),'set':function(_0x4ce062){if(!_0x4ce062)this['setDataValue'](_0x9779('0x7'),null);this['setDataValue'](_0x9779('0x8'),_0x4ce062);}}}; \ No newline at end of file +var _0x997a=['generate','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x51e22f,_0x335f66){var _0x3cdbb1=function(_0x1e3da9){while(--_0x1e3da9){_0x51e22f['push'](_0x51e22f['shift']());}};_0x3cdbb1(++_0x335f66);}(_0x997a,0x1b5));var _0xa997=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x997a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xa997('0x0'));var rs=require(_0xa997('0x1'));module[_0xa997('0x2')]={'name':{'type':Sequelize[_0xa997('0x3')],'unique':_0xa997('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa997('0x3')]},'token':{'type':Sequelize[_0xa997('0x3')],'defaultValue':function(){return rs[_0xa997('0x5')]();}},'replyUri':{'type':Sequelize[_0xa997('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa997('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa997('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa997('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa997('0x8')],'defaultValue':![],'comment':_0xa997('0x9'),'set':function(_0x335951){if(!_0x335951)this[_0xa997('0xa')](_0xa997('0xb'),null);this[_0xa997('0xa')](_0xa997('0xc'),_0x335951);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 9fac673..9a4094a 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 _0x8c9e=['where','pick','VIRTUAL','merge','includeAll','include','rows','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filter','findAll','removeDispositions','addAnswer','CannedAnswer','nolimit','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','updatedAt','Applications','account','applications','list','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c9e,0x6f));var _0xe8c9=function(_0x3d3817,_0x5d0b91){_0x3d3817=_0x3d3817-0x0;var _0x4f23ce=_0x8c9e[_0x3d3817];return _0x4f23ce;};'use strict';var emlformat=require(_0xe8c9('0x0'));var rimraf=require(_0xe8c9('0x1'));var zipdir=require(_0xe8c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8c9('0x3'));var moment=require('moment');var BPromise=require(_0xe8c9('0x4'));var Mustache=require(_0xe8c9('0x5'));var util=require(_0xe8c9('0x6'));var path=require(_0xe8c9('0x7'));var sox=require(_0xe8c9('0x8'));var csv=require(_0xe8c9('0x9'));var ejs=require(_0xe8c9('0xa'));var fs=require('fs');var fs_extra=require(_0xe8c9('0xb'));var _=require(_0xe8c9('0xc'));var squel=require(_0xe8c9('0xd'));var crypto=require(_0xe8c9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe8c9('0xf'));var toCsv=require(_0xe8c9('0x9'));var querystring=require(_0xe8c9('0x10'));var Papa=require(_0xe8c9('0x11'));var Redis=require(_0xe8c9('0x12'));var authService=require(_0xe8c9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe8c9('0x14'));var hardwareService=require(_0xe8c9('0x15'));var logger=require(_0xe8c9('0x16'))(_0xe8c9('0x17'));var utils=require(_0xe8c9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe8c9('0x19'));var db=require(_0xe8c9('0x1a'))['db'];config[_0xe8c9('0x1b')]=_[_0xe8c9('0x1c')](config[_0xe8c9('0x1b')],{'host':_0xe8c9('0x1d'),'port':0x18eb});var socket=require(_0xe8c9('0x1e'))(new Redis(config[_0xe8c9('0x1b')]));require(_0xe8c9('0x1f'))[_0xe8c9('0x20')](socket);var jayson=require(_0xe8c9('0x21'));var client=jayson['client'][_0xe8c9('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ad214,_0x4f2df6,_0x12caf8,_0x3d2a12){return new BPromise(function(_0x704eef,_0x26a36c){var _0x4e15fd=_0x3d2a12||client;return _0x4e15fd[_0xe8c9('0x23')](_0x5ad214,_0x12caf8)[_0xe8c9('0x24')](function(_0x8fadf9){logger[_0xe8c9('0x25')](_0xe8c9('0x26'),_0x4f2df6,_0xe8c9('0x27'));logger[_0xe8c9('0x28')](_0xe8c9('0x29'),_0x4f2df6,_0xe8c9('0x27'),JSON[_0xe8c9('0x2a')](_0x8fadf9));if(_0x8fadf9[_0xe8c9('0x2b')]){if(_0x8fadf9[_0xe8c9('0x2b')][_0xe8c9('0x2c')]===0x1f4){logger[_0xe8c9('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f2df6,_0x8fadf9['error']['message']);return _0x26a36c(_0x8fadf9[_0xe8c9('0x2b')][_0xe8c9('0x2d')]);}logger[_0xe8c9('0x2b')](_0xe8c9('0x26'),_0x4f2df6,_0x8fadf9['error'][_0xe8c9('0x2d')]);return _0x704eef(_0x8fadf9[_0xe8c9('0x2b')]['message']);}else{logger[_0xe8c9('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f2df6,_0xe8c9('0x27'));_0x704eef(_0x8fadf9[_0xe8c9('0x2e')][_0xe8c9('0x2d')]);}})[_0xe8c9('0x2f')](function(_0xa81b63){logger['error'](_0xe8c9('0x26'),_0x4f2df6,_0xa81b63);_0x26a36c(_0xa81b63);});});}function respondWithStatusCode(_0x505697,_0x4e0d1f){_0x4e0d1f=_0x4e0d1f||0xcc;return function(_0x3fa3ae){if(_0x3fa3ae){return _0x505697[_0xe8c9('0x30')](_0x4e0d1f);}return _0x505697[_0xe8c9('0x31')](_0x4e0d1f)[_0xe8c9('0x32')]();};}function respondWithResult(_0x3276c2,_0x237631){_0x237631=_0x237631||0xc8;return function(_0x3353ca){if(_0x3353ca){return _0x3276c2[_0xe8c9('0x31')](_0x237631)['json'](_0x3353ca);}};}function respondWithFilteredResult(_0x3d4744,_0x25414a){return function(_0x26d81a){if(_0x26d81a){var _0xd87b73=typeof _0x25414a[_0xe8c9('0x33')]===_0xe8c9('0x34')&&typeof _0x25414a[_0xe8c9('0x35')]==='undefined';var _0x16fe6d=_0x26d81a['count'];var _0x39fd80=_0xd87b73?0x0:_0x25414a[_0xe8c9('0x33')];var _0x539b1a=_0xd87b73?_0x26d81a[_0xe8c9('0x36')]:_0x25414a['offset']+_0x25414a[_0xe8c9('0x35')];var _0x45b18f;if(_0x539b1a>=_0x16fe6d){_0x539b1a=_0x16fe6d;_0x45b18f=0xc8;}else{_0x45b18f=0xce;}_0x3d4744['status'](_0x45b18f);return _0x3d4744[_0xe8c9('0x37')]('Content-Range',_0x39fd80+'-'+_0x539b1a+'/'+_0x16fe6d)[_0xe8c9('0x38')](_0x26d81a);}return null;};}function patchUpdates(_0x459923){return function(_0x1ed246){try{jsonpatch['apply'](_0x1ed246,_0x459923,!![]);}catch(_0x458aca){return BPromise[_0xe8c9('0x39')](_0x458aca);}return _0x1ed246['save']();};}function saveUpdates(_0x2366b5,_0x5a8056){return function(_0x173950){if(_0x173950){return _0x173950[_0xe8c9('0x3a')](_0x2366b5)[_0xe8c9('0x24')](function(_0x3c2f4d){return _0x3c2f4d;});}return null;};}function removeEntity(_0x414e13,_0x52596d){return function(_0x5814df){if(_0x5814df){return _0x5814df[_0xe8c9('0x3b')]()[_0xe8c9('0x24')](function(){var _0x2cc95e=_0x5814df[_0xe8c9('0x3c')]({'plain':!![]});var _0x401503='OpenchannelAccounts';return db['UserProfileResource'][_0xe8c9('0x3b')]({'where':{'type':_0x401503,'resourceId':_0x2cc95e['id']}})[_0xe8c9('0x24')](function(){return _0x5814df;});})['then'](function(){_0x414e13[_0xe8c9('0x31')](0xcc)[_0xe8c9('0x32')]();});}};}function handleEntityNotFound(_0x37a61b,_0x2d05ab){return function(_0x500b19){if(!_0x500b19){_0x37a61b[_0xe8c9('0x30')](0x194);}return _0x500b19;};}function handleError(_0x1cabec,_0x1e7420){_0x1e7420=_0x1e7420||0x1f4;return function(_0xd1fda4){logger[_0xe8c9('0x2b')](_0xd1fda4[_0xe8c9('0x3d')]);if(_0xd1fda4['name']){delete _0xd1fda4[_0xe8c9('0x3e')];}_0x1cabec[_0xe8c9('0x31')](_0x1e7420)[_0xe8c9('0x3f')](_0xd1fda4);};}exports[_0xe8c9('0x40')]=function(_0x3c7037,_0x281fba){var _0x52cd99={'include':[{'model':db[_0xe8c9('0x41')],'as':_0xe8c9('0x42')}]},_0x48a2bc={},_0x54e4d5={'count':0x0,'rows':[]};var _0x3a688b=_[_0xe8c9('0x43')](db[_0xe8c9('0x44')][_0xe8c9('0x45')],function(_0x2d007a){return{'name':_0x2d007a['fieldName'],'type':_0x2d007a[_0xe8c9('0x46')][_0xe8c9('0x47')]};});_0x48a2bc[_0xe8c9('0x48')]=_[_0xe8c9('0x43')](_0x3a688b,_0xe8c9('0x3e'));_0x48a2bc[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x3c7037[_0xe8c9('0x49')]);_0x48a2bc[_0xe8c9('0x4b')]=_[_0xe8c9('0x4c')](_0x48a2bc[_0xe8c9('0x48')],_0x48a2bc['query']);_0x52cd99['attributes']=_[_0xe8c9('0x4c')](_0x48a2bc[_0xe8c9('0x48')],qs['fields'](_0x3c7037[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x52cd99['attributes']=_0x52cd99[_0xe8c9('0x4e')][_0xe8c9('0x4f')]?_0x52cd99['attributes']:_0x48a2bc[_0xe8c9('0x48')];if(!_0x3c7037[_0xe8c9('0x49')][_0xe8c9('0x50')]('nolimit')){_0x52cd99[_0xe8c9('0x35')]=qs[_0xe8c9('0x35')](_0x3c7037['query'][_0xe8c9('0x35')]);_0x52cd99[_0xe8c9('0x33')]=qs[_0xe8c9('0x33')](_0x3c7037['query']['offset']);}_0x52cd99[_0xe8c9('0x51')]=qs[_0xe8c9('0x52')](_0x3c7037[_0xe8c9('0x49')]['sort']);_0x52cd99[_0xe8c9('0x53')]=qs['filters'](_[_0xe8c9('0x54')](_0x3c7037[_0xe8c9('0x49')],_0x48a2bc[_0xe8c9('0x4b')]),_0x3a688b);if(_0x3c7037[_0xe8c9('0x49')]['filter']){_0x52cd99[_0xe8c9('0x53')]=_['merge'](_0x52cd99[_0xe8c9('0x53')],{'$or':_[_0xe8c9('0x43')](_0x3a688b,function(_0x21fe86){if(_0x21fe86[_0xe8c9('0x46')]!==_0xe8c9('0x55')){var _0x26d19d={};_0x26d19d[_0x21fe86['name']]={'$like':'%'+_0x3c7037[_0xe8c9('0x49')]['filter']+'%'};return _0x26d19d;}})});}_0x52cd99=_[_0xe8c9('0x56')]({},_0x52cd99,_0x3c7037['options']);var _0x212516={'where':_0x52cd99['where']};return db[_0xe8c9('0x44')][_0xe8c9('0x36')](_0x212516)[_0xe8c9('0x24')](function(_0x27406c){_0x54e4d5[_0xe8c9('0x36')]=_0x27406c;if(_0x3c7037[_0xe8c9('0x49')][_0xe8c9('0x57')]){_0x52cd99[_0xe8c9('0x58')]=[{'all':!![]}];}return db[_0xe8c9('0x44')]['findAll'](_0x52cd99);})[_0xe8c9('0x24')](function(_0x532b10){_0x54e4d5[_0xe8c9('0x59')]=_0x532b10;return _0x54e4d5;})[_0xe8c9('0x24')](respondWithFilteredResult(_0x281fba,_0x52cd99))[_0xe8c9('0x2f')](handleError(_0x281fba,null));};exports[_0xe8c9('0x5a')]=function(_0x27bb59,_0x2dbf21){var _0x25b0e6={'raw':![],'where':{'id':_0x27bb59['params']['id']},'include':[{'model':db[_0xe8c9('0x41')],'as':_0xe8c9('0x42')}]},_0x210bb9={};_0x210bb9[_0xe8c9('0x48')]=_[_0xe8c9('0x4a')](db[_0xe8c9('0x44')][_0xe8c9('0x45')]);_0x210bb9[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x27bb59[_0xe8c9('0x49')]);_0x210bb9['filters']=_[_0xe8c9('0x4c')](_0x210bb9[_0xe8c9('0x48')],_0x210bb9[_0xe8c9('0x49')]);_0x25b0e6[_0xe8c9('0x4e')]=_[_0xe8c9('0x4c')](_0x210bb9[_0xe8c9('0x48')],qs[_0xe8c9('0x4d')](_0x27bb59['query'][_0xe8c9('0x4d')]));_0x25b0e6[_0xe8c9('0x4e')]=_0x25b0e6[_0xe8c9('0x4e')][_0xe8c9('0x4f')]?_0x25b0e6['attributes']:_0x210bb9[_0xe8c9('0x48')];if(_0x27bb59[_0xe8c9('0x49')]['includeAll']){_0x25b0e6[_0xe8c9('0x58')]=[{'all':!![]}];}_0x25b0e6=_['merge']({},_0x25b0e6,_0x27bb59[_0xe8c9('0x5b')]);return db[_0xe8c9('0x44')]['find'](_0x25b0e6)[_0xe8c9('0x24')](handleEntityNotFound(_0x2dbf21,null))[_0xe8c9('0x24')](respondWithResult(_0x2dbf21,null))[_0xe8c9('0x2f')](handleError(_0x2dbf21,null));};exports[_0xe8c9('0x5c')]=function(_0x2088e2,_0x1c9aae){return db[_0xe8c9('0x44')]['create'](_0x2088e2[_0xe8c9('0x5d')],{})[_0xe8c9('0x24')](function(_0x2d0129){var _0x4a3a3c=_0x2088e2[_0xe8c9('0x5e')]['get']({'plain':!![]});if(!_0x4a3a3c)throw new Error(_0xe8c9('0x5f'));if(_0x4a3a3c['role']==='user'){var _0x6d6962=_0x2d0129[_0xe8c9('0x3c')]({'plain':!![]});var _0x40b1d9=_0xe8c9('0x60');return db[_0xe8c9('0x61')][_0xe8c9('0x62')]({'where':{'name':_0x40b1d9,'userProfileId':_0x4a3a3c['userProfileId']},'raw':!![]})['then'](function(_0x7f5651){if(_0x7f5651&&_0x7f5651[_0xe8c9('0x63')]===0x0){return db[_0xe8c9('0x64')][_0xe8c9('0x5c')]({'name':_0x6d6962['name'],'resourceId':_0x6d6962['id'],'type':_0x7f5651['name'],'sectionId':_0x7f5651['id']},{})['then'](function(){return _0x2d0129;});}else{return _0x2d0129;}})['catch'](function(_0x4a561c){logger[_0xe8c9('0x2b')](_0xe8c9('0x65'),_0x4a561c);throw _0x4a561c;});}return _0x2d0129;})['then'](respondWithResult(_0x1c9aae,0xc9))[_0xe8c9('0x2f')](handleError(_0x1c9aae,null));};exports[_0xe8c9('0x3a')]=function(_0x1b51f5,_0x516582){if(_0x1b51f5[_0xe8c9('0x5d')]['id']){delete _0x1b51f5[_0xe8c9('0x5d')]['id'];}return db[_0xe8c9('0x44')][_0xe8c9('0x62')]({'where':{'id':_0x1b51f5[_0xe8c9('0x66')]['id']},'include':[{'model':db['Pause'],'as':_0xe8c9('0x42')}]})['then'](handleEntityNotFound(_0x516582,null))[_0xe8c9('0x24')](saveUpdates(_0x1b51f5[_0xe8c9('0x5d')],null))[_0xe8c9('0x24')](respondWithResult(_0x516582,null))[_0xe8c9('0x2f')](handleError(_0x516582,null));};exports['destroy']=function(_0x2d2402,_0x542e6d){return db[_0xe8c9('0x44')][_0xe8c9('0x62')]({'where':{'id':_0x2d2402[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x542e6d,null))[_0xe8c9('0x24')](removeEntity(_0x542e6d,null))[_0xe8c9('0x2f')](handleError(_0x542e6d,null));};exports[_0xe8c9('0x67')]=function(_0x3ca745,_0x11a366){return db[_0xe8c9('0x44')][_0xe8c9('0x67')]()[_0xe8c9('0x24')](respondWithResult(_0x11a366,null))[_0xe8c9('0x2f')](handleError(_0x11a366,null));};exports[_0xe8c9('0x68')]=function(_0x30e62e,_0x4008f5,_0x22975b){if(_0x30e62e[_0xe8c9('0x5d')]['id']){delete _0x30e62e[_0xe8c9('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x30e62e[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x4008f5,null))[_0xe8c9('0x24')](function(_0x14f2f3){if(_0x14f2f3){_0x30e62e['body'][_0xe8c9('0x69')]=_0x14f2f3['id'];return db[_0xe8c9('0x6a')][_0xe8c9('0x5c')](_0x30e62e[_0xe8c9('0x5d')]);}})[_0xe8c9('0x24')](respondWithResult(_0x4008f5,null))[_0xe8c9('0x2f')](handleError(_0x4008f5,null));};exports[_0xe8c9('0x6b')]=function(_0x262461,_0x1fd5b3,_0x3163f8){var _0x2e90b6={'raw':![],'where':{}};var _0x50f8b0={};var _0x3b6a7e={'count':0x0,'rows':[]};return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x262461['params']['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x1fd5b3,null))[_0xe8c9('0x24')](function(_0x4b6b9c){if(_0x4b6b9c){_0x50f8b0['model']=_[_0xe8c9('0x4a')](db[_0xe8c9('0x6a')]['rawAttributes']);_0x50f8b0[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x262461[_0xe8c9('0x49')]);_0x50f8b0[_0xe8c9('0x4b')]=_[_0xe8c9('0x4c')](_0x50f8b0[_0xe8c9('0x48')],_0x50f8b0[_0xe8c9('0x49')]);_0x2e90b6[_0xe8c9('0x4e')]=_[_0xe8c9('0x4c')](_0x50f8b0[_0xe8c9('0x48')],qs[_0xe8c9('0x4d')](_0x262461[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x2e90b6[_0xe8c9('0x4e')]=_0x2e90b6['attributes'][_0xe8c9('0x4f')]?_0x2e90b6[_0xe8c9('0x4e')]:_0x50f8b0[_0xe8c9('0x48')];if(!_0x262461[_0xe8c9('0x49')][_0xe8c9('0x50')]('nolimit')){_0x2e90b6[_0xe8c9('0x35')]=qs['limit'](_0x262461[_0xe8c9('0x49')][_0xe8c9('0x35')]);_0x2e90b6[_0xe8c9('0x33')]=qs['offset'](_0x262461[_0xe8c9('0x49')][_0xe8c9('0x33')]);}_0x2e90b6['order']=qs[_0xe8c9('0x52')](_0x262461[_0xe8c9('0x49')][_0xe8c9('0x52')]);_0x2e90b6[_0xe8c9('0x53')]=qs[_0xe8c9('0x4b')](_[_0xe8c9('0x54')](_0x262461[_0xe8c9('0x49')],_0x50f8b0[_0xe8c9('0x4b')]));_0x2e90b6[_0xe8c9('0x53')][_0xe8c9('0x69')]=_0x4b6b9c['id'];if(_0x262461[_0xe8c9('0x49')][_0xe8c9('0x6d')]){_0x2e90b6[_0xe8c9('0x53')]=_[_0xe8c9('0x56')](_0x2e90b6[_0xe8c9('0x53')],{'$or':_['map'](_0x2e90b6[_0xe8c9('0x4e')],function(_0x5e0734){var _0x56312c={};_0x56312c[_0x5e0734]={'$like':'%'+_0x262461[_0xe8c9('0x49')][_0xe8c9('0x6d')]+'%'};return _0x56312c;})});}_0x2e90b6=_[_0xe8c9('0x56')]({},_0x2e90b6,_0x262461['options']);return db[_0xe8c9('0x6a')][_0xe8c9('0x36')]({'where':_0x2e90b6[_0xe8c9('0x53')]})[_0xe8c9('0x24')](function(_0x1ef156){_0x3b6a7e[_0xe8c9('0x36')]=_0x1ef156;if(_0x262461[_0xe8c9('0x49')][_0xe8c9('0x57')]){_0x2e90b6[_0xe8c9('0x58')]=[{'all':!![]}];}return db[_0xe8c9('0x6a')][_0xe8c9('0x6e')](_0x2e90b6);})[_0xe8c9('0x24')](function(_0x1cbe38){_0x3b6a7e[_0xe8c9('0x59')]=_0x1cbe38;return _0x3b6a7e;});}})[_0xe8c9('0x24')](respondWithFilteredResult(_0x1fd5b3,_0x2e90b6))[_0xe8c9('0x2f')](handleError(_0x1fd5b3,null));};exports[_0xe8c9('0x6f')]=function(_0x1bd771,_0x37d03e,_0x370a46){return db[_0xe8c9('0x44')]['find']({'where':{'id':_0x1bd771[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x37d03e,null))[_0xe8c9('0x24')](function(_0x45b874){if(_0x45b874){return _0x45b874[_0xe8c9('0x6f')](_0x1bd771['query']['ids']);}})[_0xe8c9('0x24')](respondWithStatusCode(_0x37d03e,null))[_0xe8c9('0x2f')](handleError(_0x37d03e,null));};exports[_0xe8c9('0x70')]=function(_0x327830,_0x2540c6,_0x3fd3b6){if(_0x327830[_0xe8c9('0x5d')]['id']){delete _0x327830['body']['id'];}return db[_0xe8c9('0x44')][_0xe8c9('0x62')]({'where':{'id':_0x327830[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x2540c6,null))[_0xe8c9('0x24')](function(_0x12e635){if(_0x12e635){_0x327830[_0xe8c9('0x5d')][_0xe8c9('0x69')]=_0x12e635['id'];return db[_0xe8c9('0x71')][_0xe8c9('0x5c')](_0x327830[_0xe8c9('0x5d')]);}})[_0xe8c9('0x24')](respondWithResult(_0x2540c6,null))[_0xe8c9('0x2f')](handleError(_0x2540c6,null));};exports['getAnswers']=function(_0x4cb01b,_0x40712b,_0x2a65e0){var _0x4471a3={'raw':![],'where':{}};var _0x58e604={};var _0x19df63={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe8c9('0x6c')]({'where':{'id':_0x4cb01b[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x40712b,null))[_0xe8c9('0x24')](function(_0x15af8f){if(_0x15af8f){_0x58e604[_0xe8c9('0x48')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x58e604[_0xe8c9('0x49')]=_['keys'](_0x4cb01b[_0xe8c9('0x49')]);_0x58e604[_0xe8c9('0x4b')]=_[_0xe8c9('0x4c')](_0x58e604[_0xe8c9('0x48')],_0x58e604[_0xe8c9('0x49')]);_0x4471a3[_0xe8c9('0x4e')]=_[_0xe8c9('0x4c')](_0x58e604[_0xe8c9('0x48')],qs[_0xe8c9('0x4d')](_0x4cb01b[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x4471a3[_0xe8c9('0x4e')]=_0x4471a3[_0xe8c9('0x4e')][_0xe8c9('0x4f')]?_0x4471a3[_0xe8c9('0x4e')]:_0x58e604[_0xe8c9('0x48')];if(!_0x4cb01b[_0xe8c9('0x49')][_0xe8c9('0x50')](_0xe8c9('0x72'))){_0x4471a3['limit']=qs[_0xe8c9('0x35')](_0x4cb01b['query'][_0xe8c9('0x35')]);_0x4471a3[_0xe8c9('0x33')]=qs[_0xe8c9('0x33')](_0x4cb01b['query']['offset']);}_0x4471a3[_0xe8c9('0x51')]=qs[_0xe8c9('0x52')](_0x4cb01b[_0xe8c9('0x49')][_0xe8c9('0x52')]);_0x4471a3[_0xe8c9('0x53')]=qs[_0xe8c9('0x4b')](_[_0xe8c9('0x54')](_0x4cb01b[_0xe8c9('0x49')],_0x58e604[_0xe8c9('0x4b')]));_0x4471a3['where'][_0xe8c9('0x69')]=_0x15af8f['id'];if(_0x4cb01b['query']['filter']){_0x4471a3[_0xe8c9('0x53')]=_[_0xe8c9('0x56')](_0x4471a3[_0xe8c9('0x53')],{'$or':_['map'](_0x4471a3[_0xe8c9('0x4e')],function(_0x5b8445){var _0x415055={};_0x415055[_0x5b8445]={'$like':'%'+_0x4cb01b['query']['filter']+'%'};return _0x415055;})});}_0x4471a3=_[_0xe8c9('0x56')]({},_0x4471a3,_0x4cb01b['options']);return db[_0xe8c9('0x71')]['count']({'where':_0x4471a3[_0xe8c9('0x53')]})[_0xe8c9('0x24')](function(_0x5b02ea){_0x19df63['count']=_0x5b02ea;if(_0x4cb01b[_0xe8c9('0x49')][_0xe8c9('0x57')]){_0x4471a3[_0xe8c9('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe8c9('0x6e')](_0x4471a3);})['then'](function(_0x3499d7){_0x19df63[_0xe8c9('0x59')]=_0x3499d7;return _0x19df63;});}})[_0xe8c9('0x24')](respondWithFilteredResult(_0x40712b,_0x4471a3))['catch'](handleError(_0x40712b,null));};exports['removeAnswers']=function(_0x455f9d,_0x478f09,_0x26f3a4){return db[_0xe8c9('0x44')]['find']({'where':{'id':_0x455f9d[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x478f09,null))[_0xe8c9('0x24')](function(_0x2725a9){if(_0x2725a9){return _0x2725a9[_0xe8c9('0x73')](_0x455f9d[_0xe8c9('0x49')][_0xe8c9('0x74')]);}})[_0xe8c9('0x24')](respondWithStatusCode(_0x478f09,null))['catch'](handleError(_0x478f09,null));};exports[_0xe8c9('0x75')]=function(_0x588896,_0x687a6f,_0x594f81){var _0x2c9ac3={'body':_0x588896[_0xe8c9('0x5d')],'channel':_0xe8c9('0x76')};var _0x39118a=[];var _0x4adf30=[];var _0x10ae55={};var _0x25c1e2=![];return db[_0xe8c9('0x77')][_0xe8c9('0x67')]()[_0xe8c9('0x24')](function(_0x4e6452){if(!_0x4e6452){throw new db['Sequelize'][(_0xe8c9('0x78'))](_0xe8c9('0x79'));}_0x39118a=_[_0xe8c9('0x7a')](_[_0xe8c9('0x4a')](_0x4e6452),[_0xe8c9('0x7b'),'updatedAt']);_0x4adf30=_['difference'](_[_0xe8c9('0x4a')](_0x4e6452),[_0xe8c9('0x7b'),'updatedAt',_0xe8c9('0x7c'),_0xe8c9('0x7d')]);if(_0x588896[_0xe8c9('0x5d')]['id']){delete _0x588896[_0xe8c9('0x5d')]['id'];}if(_[_0xe8c9('0x7e')](_0x588896['body']['from'])){throw new db[(_0xe8c9('0x7f'))][(_0xe8c9('0x78'))](_0xe8c9('0x80'));}if(_[_0xe8c9('0x7e')](_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x5d')])||_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x5d')]===''){throw new db['Sequelize'][(_0xe8c9('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe8c9('0x7e')](_0x588896['body'][_0xe8c9('0x81')])){throw new db['Sequelize'][(_0xe8c9('0x78'))](_0xe8c9('0x82')+_0x4adf30);}if(!_['includes'](_0x4adf30,_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x81')])){throw new db[(_0xe8c9('0x7f'))]['ValidationError'](_0xe8c9('0x83')+_0x4adf30);}_0x10ae55[_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x81')]]=_0x588896['body'][_0xe8c9('0x84')];})[_0xe8c9('0x24')](function(){return db[_0xe8c9('0x44')]['find']({'where':{'id':_0x588896[_0xe8c9('0x66')]['id']},'include':[{'model':db[_0xe8c9('0x85')],'as':_0xe8c9('0x86'),'include':[{'model':db['CmContact'],'as':_0xe8c9('0x87'),'where':_0x10ae55,'limit':0x1,'order':[[_0xe8c9('0x88'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xe8c9('0x89')}]});})[_0xe8c9('0x24')](handleEntityNotFound(_0x687a6f,null))[_0xe8c9('0x24')](function(_0x46b467){if(_0x46b467&&_0x46b467[_0xe8c9('0x86')]){_0x2c9ac3[_0xe8c9('0x8a')]=_0x46b467;_0x2c9ac3[_0xe8c9('0x8b')]=_0x46b467[_0xe8c9('0x89')];_0x2c9ac3[_0xe8c9('0x8c')]=_0x46b467[_0xe8c9('0x86')];_0x2c9ac3['applications']=_[_0xe8c9('0x8d')](_0x2c9ac3[_0xe8c9('0x8b')],[_0xe8c9('0x8e')],[_0xe8c9('0x8f')]);if(_0x2c9ac3[_0xe8c9('0x8a')][_0xe8c9('0x89')]){delete _0x2c9ac3[_0xe8c9('0x8a')][_0xe8c9('0x89')];}if(_0x2c9ac3[_0xe8c9('0x8a')][_0xe8c9('0x86')]&&_0x2c9ac3[_0xe8c9('0x8a')][_0xe8c9('0x86')][_0xe8c9('0x87')][_0xe8c9('0x4f')]){return _0x2c9ac3[_0xe8c9('0x8a')]['List'][_0xe8c9('0x87')][0x0];}var _0x75638c=_['defaults'](_0x588896[_0xe8c9('0x5d')],{'firstName':_0x588896[_0xe8c9('0x5d')]['from'],'ListId':_0x46b467[_0xe8c9('0x7d')]});_0x75638c[_0x588896['body'][_0xe8c9('0x81')]]=_0x588896[_0xe8c9('0x5d')]['from'];return db[_0xe8c9('0x77')][_0xe8c9('0x5c')](_0x75638c,{'fields':_0x39118a,'raw':!![]});}})['then'](handleEntityNotFound(_0x687a6f,null))[_0xe8c9('0x24')](function(_0x5b83f2){_0x2c9ac3[_0xe8c9('0x90')]=_0x5b83f2;if(_0x5b83f2){var _0x52851f={'ContactId':_0x5b83f2['id'],'OpenchannelAccountId':_0x588896[_0xe8c9('0x66')]['id'],'from':(_0x5b83f2['firstName']||'')+'\x20'+(_0x5b83f2[_0xe8c9('0x91')]||'')};var _0x11bcf7={'OpenchannelAccountId':_0x588896[_0xe8c9('0x66')]['id'],'closed':![]};if(_0x588896[_0xe8c9('0x5d')]['threadId']){_0x11bcf7[_0xe8c9('0x92')]=_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x92')];return db[_0xe8c9('0x93')][_0xe8c9('0x62')]({'where':_0x11bcf7})[_0xe8c9('0x24')](function(_0x4a88e4){if(_0x4a88e4){return[_0x4a88e4,![]];}_0x52851f[_0xe8c9('0x92')]=_0x588896['body']['threadId'];_0x52851f['externalUrl']=_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x94')];return db[_0xe8c9('0x93')][_0xe8c9('0x5c')](_0x52851f)[_0xe8c9('0x24')](function(_0x12c319){return[_0x12c319,!![]];});});}else{_0x11bcf7[_0xe8c9('0x92')]=null;}_0x11bcf7[_0xe8c9('0x95')]=_0x5b83f2['id'];return db['OpenchannelInteraction'][_0xe8c9('0x62')]({'where':_0x11bcf7})['then'](function(_0x55f575){if(_0x55f575){return[_0x55f575,![]];}return db[_0xe8c9('0x93')][_0xe8c9('0x5c')](_0x52851f)['then'](function(_0x53e885){return[_0x53e885,!![]];});});}})['spread'](function(_0x459ba4,_0x2da09d){if(_0x459ba4){_0x25c1e2=_0x2da09d;if(!_0x2da09d){var _0x500e16={'from':(_0x2c9ac3['contact'][_0xe8c9('0x96')]||'')+'\x20'+(_0x2c9ac3[_0xe8c9('0x90')][_0xe8c9('0x91')]||'')};if(_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x92')]&&_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x97')]&&_0x588896[_0xe8c9('0x5d')]['threadId']!=_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x97')]){_0x500e16['threadId']=_0x588896['body'][_0xe8c9('0x97')];}return _0x459ba4[_0xe8c9('0x3a')](_0x500e16);}else{return _0x459ba4;}}})['then'](function(_0x217270){_0x2c9ac3[_0xe8c9('0x98')]=_0x217270['get']({'plain':!![]});_0x2c9ac3[_0xe8c9('0x98')][_0xe8c9('0x99')]=_0x25c1e2;if(_0x2c9ac3['interaction'][_0xe8c9('0x99')]){if(_0x2c9ac3['account'][_0xe8c9('0x9a')]){_0x2c9ac3[_0xe8c9('0x8b')][_0xe8c9('0x9b')]({'id':0x0,'priority':_0x2c9ac3[_0xe8c9('0x8b')][_0xe8c9('0x4f')]+0x1,'app':_0xe8c9('0x9c'),'appdata':_0xe8c9('0x9d'),'interval':'*,*,*,*'});}}return db[_0xe8c9('0x9e')]['create']({'body':_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x5d')],'OpenchannelAccountId':_0x588896[_0xe8c9('0x66')]['id'],'OpenchannelInteractionId':_0x217270['id'],'direction':'in','ContactId':_0x2c9ac3[_0xe8c9('0x90')]['id'],'AttachmentId':_0x588896[_0xe8c9('0x5d')][_0xe8c9('0x9f')]});})[_0xe8c9('0x24')](function(_0x2fd98a){_0x2c9ac3['message']=_0x2fd98a;if(_0x2c9ac3[_0xe8c9('0x98')][_0xe8c9('0xa0')]){return db[_0xe8c9('0xa1')][_0xe8c9('0x62')]({'attributes':['id',_0xe8c9('0x3e')],'where':{'id':_0x2c9ac3[_0xe8c9('0x98')][_0xe8c9('0xa0')]}})[_0xe8c9('0x24')](function(_0x551e8b){if(_0x551e8b){_0x2c9ac3[_0xe8c9('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe8c9('0xa2'),'appdata':_0x551e8b['name']+','+(_0x2c9ac3[_0xe8c9('0x8a')][_0xe8c9('0xa3')]||0xa),'interval':_0xe8c9('0xa4')});_0x2c9ac3[_0xe8c9('0xa5')]=![];}return respondWithRpcPromise(_0xe8c9('0xa6'),_0xe8c9('0xa7'),_0x2c9ac3);});}return respondWithRpcPromise(_0xe8c9('0xa6'),'startRouting',_0x2c9ac3);})['then'](function(_0x328ccf){respondWithRpcPromise(_0xe8c9('0xa8'),_0xe8c9('0xa8'),{'event':'notify','message':_0x328ccf},client9002);return _0x328ccf;})['then'](respondWithResult(_0x687a6f,null))[_0xe8c9('0x2f')](handleError(_0x687a6f,null));};exports['addApplications']=function(_0x2c4027,_0x364876,_0x2c8c9c){return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x2c4027[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x364876,null))[_0xe8c9('0x24')](function(_0x4e9ad6){if(_0x4e9ad6){return db[_0xe8c9('0xa9')][_0xe8c9('0xaa')](function(_0x5be16a){return db[_0xe8c9('0xab')][_0xe8c9('0x3b')]({'where':{'OpenchannelAccountId':_0x2c4027[_0xe8c9('0x66')]['id']},'transaction':_0x5be16a})[_0xe8c9('0x24')](function(_0x2e0ae5){var _0x5ca387=_['map'](_0x2c4027['body'],function(_0x52e3ce){_0x52e3ce[_0xe8c9('0x69')]=_0x2c4027[_0xe8c9('0x66')]['id'];return _0x52e3ce;});return db[_0xe8c9('0xab')][_0xe8c9('0xac')](_0x5ca387,{'transaction':_0x5be16a});});})[_0xe8c9('0x24')](function(){return db[_0xe8c9('0xab')][_0xe8c9('0xad')]({'where':{'OpenchannelAccountId':_0x2c4027['params']['id']},'order':_0xe8c9('0x8e')});});}})[_0xe8c9('0x24')](respondWithResult(_0x364876,null))[_0xe8c9('0x2f')](handleError(_0x364876,null));};exports['getApplications']=function(_0x3f6d0b,_0x3bf39f,_0x309cc2){var _0x573e1b={};var _0x327b5c={};var _0x2cac55;var _0xf51ee7;return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x3f6d0b[_0xe8c9('0x66')]['id']}})['then'](handleEntityNotFound(_0x3bf39f,null))['then'](function(_0x23f854){if(_0x23f854){_0x2cac55=_0x23f854;_0x327b5c[_0xe8c9('0x48')]=_[_0xe8c9('0x4a')](db[_0xe8c9('0xab')][_0xe8c9('0x45')]);_0x327b5c[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x3f6d0b['query']);_0x327b5c[_0xe8c9('0x4b')]=_[_0xe8c9('0x4c')](_0x327b5c[_0xe8c9('0x48')],_0x327b5c[_0xe8c9('0x49')]);_0x573e1b['attributes']=_[_0xe8c9('0x4c')](_0x327b5c[_0xe8c9('0x48')],qs['fields'](_0x3f6d0b[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x573e1b[_0xe8c9('0x4e')]=_0x573e1b[_0xe8c9('0x4e')][_0xe8c9('0x4f')]?_0x573e1b[_0xe8c9('0x4e')]:_0x327b5c[_0xe8c9('0x48')];_0x573e1b[_0xe8c9('0x51')]=qs[_0xe8c9('0x52')](_0x3f6d0b[_0xe8c9('0x49')]['sort']);_0x573e1b[_0xe8c9('0x53')]=qs[_0xe8c9('0x4b')](_[_0xe8c9('0x54')](_0x3f6d0b[_0xe8c9('0x49')],_0x327b5c[_0xe8c9('0x4b')]));if(_0x3f6d0b['query']['filter']){_0x573e1b[_0xe8c9('0x53')]=_[_0xe8c9('0x56')](_0x573e1b[_0xe8c9('0x53')],{'$or':_['map'](_0x573e1b[_0xe8c9('0x4e')],function(_0x22d7b9){var _0x10aae7={};_0x10aae7[_0x22d7b9]={'$like':'%'+_0x3f6d0b[_0xe8c9('0x49')]['filter']+'%'};return _0x10aae7;})});}_0x573e1b=_[_0xe8c9('0x56')]({},_0x573e1b,_0x3f6d0b[_0xe8c9('0x5b')]);return _0x2cac55[_0xe8c9('0xae')](_0x573e1b);}})[_0xe8c9('0x24')](function(_0x34a91e){if(_0x34a91e){_0xf51ee7=_0x34a91e['length'];if(!_0x3f6d0b[_0xe8c9('0x49')][_0xe8c9('0x50')](_0xe8c9('0x72'))){_0x573e1b[_0xe8c9('0x35')]=qs[_0xe8c9('0x35')](_0x3f6d0b['query']['limit']);_0x573e1b[_0xe8c9('0x33')]=qs['offset'](_0x3f6d0b['query']['offset']);}return _0x2cac55[_0xe8c9('0xae')](_0x573e1b);}})[_0xe8c9('0x24')](function(_0x46a262){if(_0x46a262){return _0x46a262?{'count':_0xf51ee7,'rows':_0x46a262}:null;}})[_0xe8c9('0x24')](respondWithResult(_0x3bf39f,null))[_0xe8c9('0x2f')](handleError(_0x3bf39f,null));};exports[_0xe8c9('0xaf')]=function(_0x420202,_0x12bc67,_0x15e3c2){var _0x2c7e0d={'raw':![],'where':{}};var _0x443980={};var _0x5552c1={'count':0x0,'rows':[]};return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x420202[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x12bc67,null))[_0xe8c9('0x24')](function(_0x66658c){if(_0x66658c){_0x443980['model']=_[_0xe8c9('0x4a')](db[_0xe8c9('0x93')][_0xe8c9('0x45')]);_0x443980[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x420202[_0xe8c9('0x49')]);_0x443980[_0xe8c9('0x4b')]=_[_0xe8c9('0x4c')](_0x443980['model'],_0x443980[_0xe8c9('0x49')]);_0x2c7e0d[_0xe8c9('0x4e')]=_[_0xe8c9('0x4c')](_0x443980[_0xe8c9('0x48')],qs[_0xe8c9('0x4d')](_0x420202[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x2c7e0d['attributes']=_0x2c7e0d[_0xe8c9('0x4e')][_0xe8c9('0x4f')]?_0x2c7e0d[_0xe8c9('0x4e')]:_0x443980['model'];if(!_0x420202[_0xe8c9('0x49')][_0xe8c9('0x50')](_0xe8c9('0x72'))){_0x2c7e0d[_0xe8c9('0x35')]=qs[_0xe8c9('0x35')](_0x420202['query'][_0xe8c9('0x35')]);_0x2c7e0d[_0xe8c9('0x33')]=qs[_0xe8c9('0x33')](_0x420202[_0xe8c9('0x49')][_0xe8c9('0x33')]);}_0x2c7e0d[_0xe8c9('0x51')]=qs[_0xe8c9('0x52')](_0x420202['query'][_0xe8c9('0x52')]);_0x2c7e0d[_0xe8c9('0x53')]=qs[_0xe8c9('0x4b')](_[_0xe8c9('0x54')](_0x420202['query'],_0x443980[_0xe8c9('0x4b')]));_0x2c7e0d[_0xe8c9('0x53')][_0xe8c9('0x69')]=_0x66658c['id'];if(_0x420202[_0xe8c9('0x49')][_0xe8c9('0x6d')]){_0x2c7e0d[_0xe8c9('0x53')]=_['merge'](_0x2c7e0d[_0xe8c9('0x53')],{'$or':_['map'](_0x2c7e0d[_0xe8c9('0x4e')],function(_0x252b3a){var _0x47fbb8={};_0x47fbb8[_0x252b3a]={'$like':'%'+_0x420202['query']['filter']+'%'};return _0x47fbb8;})});}_0x2c7e0d=_[_0xe8c9('0x56')]({},_0x2c7e0d,_0x420202['options']);return db[_0xe8c9('0x93')][_0xe8c9('0x36')]({'where':_0x2c7e0d[_0xe8c9('0x53')]})[_0xe8c9('0x24')](function(_0x59c2a5){_0x5552c1[_0xe8c9('0x36')]=_0x59c2a5;if(_0x420202[_0xe8c9('0x49')]['includeAll']){_0x2c7e0d['include']=[{'model':db[_0xe8c9('0x77')],'as':_0xe8c9('0xb0'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0xe8c9('0xb1'),_0xe8c9('0xb2')],'required':![]},{'model':db[_0xe8c9('0xb3')],'as':_0xe8c9('0xb4'),'attributes':['id',_0xe8c9('0x3e'),_0xe8c9('0xb5')],'where':_0x420202['query'][_0xe8c9('0xb6')]?{'id':_0x420202[_0xe8c9('0x49')][_0xe8c9('0xb6')]}:undefined,'required':_0x420202[_0xe8c9('0x49')]['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x2c7e0d);})[_0xe8c9('0x24')](function(_0xfaccb7){_0x5552c1['rows']=_0xfaccb7;return _0x5552c1;});}})[_0xe8c9('0x24')](respondWithFilteredResult(_0x12bc67,_0x2c7e0d))[_0xe8c9('0x2f')](handleError(_0x12bc67,null));};exports[_0xe8c9('0xb7')]=function(_0x38a810,_0x47c452,_0x205eff){return db['OpenchannelAccount'][_0xe8c9('0x62')]({'where':{'id':_0x38a810[_0xe8c9('0x66')]['id']}})['then'](handleEntityNotFound(_0x47c452,null))[_0xe8c9('0x24')](function(_0x404cb0){if(_0x404cb0){return _0x404cb0[_0xe8c9('0xb7')](_0x38a810[_0xe8c9('0x5d')][_0xe8c9('0x74')],_['omit'](_0x38a810[_0xe8c9('0x5d')],[_0xe8c9('0x74'),'id'])||{})[_0xe8c9('0xb8')](function(_0xc74946){for(var _0x5a998f=0x0;_0x5a998f<_0x38a810[_0xe8c9('0x5d')][_0xe8c9('0x74')][_0xe8c9('0x4f')];_0x5a998f+=0x1){socket[_0xe8c9('0xb9')](_0xe8c9('0xba'),{'UserId':Number(_0x38a810[_0xe8c9('0x5d')][_0xe8c9('0x74')][_0x5a998f]),'OpenchannelAccountId':Number(_0x38a810[_0xe8c9('0x66')]['id'])});}return _0xc74946;});}})['then'](respondWithResult(_0x47c452,null))[_0xe8c9('0x2f')](handleError(_0x47c452,null));};exports[_0xe8c9('0xbb')]=function(_0x471fdf,_0x2f2212,_0x44316a){return db['OpenchannelAccount'][_0xe8c9('0x62')]({'where':{'id':_0x471fdf[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x2f2212,null))[_0xe8c9('0x24')](function(_0x515820){if(_0x515820){return _0x515820[_0xe8c9('0xbb')](_0x471fdf[_0xe8c9('0x49')]['ids'])[_0xe8c9('0x24')](function(){if(_['isArray'](_0x471fdf[_0xe8c9('0x49')][_0xe8c9('0x74')])){for(var _0x3d8060=0x0;_0x3d8060<_0x471fdf['query']['ids'][_0xe8c9('0x4f')];_0x3d8060+=0x1){socket[_0xe8c9('0xb9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x471fdf[_0xe8c9('0x49')]['ids'][_0x3d8060]),'OpenchannelAccountId':Number(_0x471fdf[_0xe8c9('0x66')]['id'])});}}else{socket[_0xe8c9('0xb9')](_0xe8c9('0xbc'),{'UserId':Number(_0x471fdf[_0xe8c9('0x49')][_0xe8c9('0x74')]),'OpenchannelAccountId':Number(_0x471fdf[_0xe8c9('0x66')]['id'])});}});}})[_0xe8c9('0x24')](respondWithStatusCode(_0x2f2212,null))[_0xe8c9('0x2f')](handleError(_0x2f2212,null));};exports['getAgents']=function(_0x34c003,_0x3e6ec6,_0x444789){var _0x24f748={};var _0x5b4755={};var _0x35669a;var _0x62f6f1;return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x34c003[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x3e6ec6,null))['then'](function(_0x5dbfb7){if(_0x5dbfb7){_0x35669a=_0x5dbfb7;_0x5b4755[_0xe8c9('0x48')]=_[_0xe8c9('0x4a')](db[_0xe8c9('0xa1')][_0xe8c9('0x45')]);_0x5b4755[_0xe8c9('0x49')]=_[_0xe8c9('0x4a')](_0x34c003[_0xe8c9('0x49')]);_0x5b4755['filters']=_['intersection'](_0x5b4755[_0xe8c9('0x48')],_0x5b4755[_0xe8c9('0x49')]);_0x24f748[_0xe8c9('0x4e')]=_[_0xe8c9('0x4c')](_0x5b4755['model'],qs[_0xe8c9('0x4d')](_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x4d')]));_0x24f748[_0xe8c9('0x4e')]=_0x24f748[_0xe8c9('0x4e')]['length']?_0x24f748[_0xe8c9('0x4e')]:_0x5b4755[_0xe8c9('0x48')];_0x24f748[_0xe8c9('0x51')]=qs[_0xe8c9('0x52')](_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x52')]);_0x24f748[_0xe8c9('0x53')]=qs[_0xe8c9('0x4b')](_[_0xe8c9('0x54')](_0x34c003[_0xe8c9('0x49')],_0x5b4755[_0xe8c9('0x4b')]));if(_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x6d')]){_0x24f748[_0xe8c9('0x53')]=_[_0xe8c9('0x56')](_0x24f748[_0xe8c9('0x53')],{'$or':_[_0xe8c9('0x43')](_0x24f748[_0xe8c9('0x4e')],function(_0x2f1edf){var _0x3173b9={};_0x3173b9[_0x2f1edf]={'$like':'%'+_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x6d')]+'%'};return _0x3173b9;})});}_0x24f748=_[_0xe8c9('0x56')]({},_0x24f748,_0x34c003[_0xe8c9('0x5b')]);return _0x35669a[_0xe8c9('0xbd')](_0x24f748);}})[_0xe8c9('0x24')](function(_0x301640){if(_0x301640){_0x62f6f1=_0x301640[_0xe8c9('0x4f')];if(!_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x50')](_0xe8c9('0x72'))){_0x24f748[_0xe8c9('0x35')]=qs[_0xe8c9('0x35')](_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x35')]);_0x24f748[_0xe8c9('0x33')]=qs['offset'](_0x34c003[_0xe8c9('0x49')][_0xe8c9('0x33')]);}return _0x35669a[_0xe8c9('0xbd')](_0x24f748);}})['then'](function(_0x9cc89f){if(_0x9cc89f){return _0x9cc89f?{'count':_0x62f6f1,'rows':_0x9cc89f}:null;}})[_0xe8c9('0x24')](respondWithResult(_0x3e6ec6,null))[_0xe8c9('0x2f')](handleError(_0x3e6ec6,null));};exports[_0xe8c9('0x3f')]=function(_0x1131ed,_0x11f846,_0x583342){var _0x6a5ae8,_0x1177c2,_0x31c4d4;if(_[_0xe8c9('0x7e')](_0x1131ed[_0xe8c9('0x5d')][_0xe8c9('0x5d')])||_0x1131ed[_0xe8c9('0x5d')][_0xe8c9('0x5d')]===''){throw new db[(_0xe8c9('0x7f'))]['ValidationError'](_0xe8c9('0xbe'));}if(_[_0xe8c9('0x7e')](_0x1131ed[_0xe8c9('0x5d')]['to'])){}_0x6a5ae8=_0x1131ed[_0xe8c9('0x5d')]['to'];return db[_0xe8c9('0x44')][_0xe8c9('0x6c')]({'where':{'id':_0x1131ed[_0xe8c9('0x66')]['id']}})[_0xe8c9('0x24')](handleEntityNotFound(_0x11f846,null))[_0xe8c9('0x24')](function(_0x4f4f61){if(_0x4f4f61){return db[_0xe8c9('0x44')][_0xe8c9('0x62')]({'where':{'id':_0x4f4f61['id']},'include':[{'model':db[_0xe8c9('0x85')],'as':_0xe8c9('0x86'),'include':[{'model':db[_0xe8c9('0x77')],'as':_0xe8c9('0x87'),'where':{[_0x4f4f61['mapKey']]:_0x6a5ae8},'limit':0x1,'order':[[_0xe8c9('0x88'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x11f846,null))['then'](function(_0x3d8b6f){if(_0x3d8b6f&&_0x3d8b6f['List']){_0x1177c2=_0x3d8b6f[_0xe8c9('0x3c')]({'plain':!![]});if(_0x1177c2['List']&&_0x1177c2['List']['Contacts'][_0xe8c9('0x4f')]){return _0x1177c2[_0xe8c9('0x86')]['Contacts'][0x0];}return db[_0xe8c9('0x77')][_0xe8c9('0x5c')](_['defaults'](_0x1131ed[_0xe8c9('0x5d')],{'firstName':_0x6a5ae8,[_0x3d8b6f[_0xe8c9('0x81')]]:_0x6a5ae8,'phone':_0x6a5ae8,'ListId':_0x1177c2[_0xe8c9('0x7d')]}));}})[_0xe8c9('0x24')](handleEntityNotFound(_0x11f846,null))[_0xe8c9('0x24')](function(_0x4c9ad){if(_0x4c9ad){_0x31c4d4=_0x4c9ad;return db[_0xe8c9('0x93')][_0xe8c9('0x62')]({'where':{'ContactId':_0x31c4d4['id'],'closed':![],'OpenchannelAccountId':_0x1177c2['id']}})[_0xe8c9('0x24')](function(_0xeb0420){if(_0xeb0420){return[_0xeb0420,![]];}return db[_0xe8c9('0x93')][_0xe8c9('0x5c')]({'UserId':_0x1131ed[_0xe8c9('0x5e')]['id'],'ContactId':_0x31c4d4['id'],'OpenchannelAccountId':_0x1177c2['id'],'lastMsgDirection':_0xe8c9('0xbf'),'Messages':[_[_0xe8c9('0x56')](_0x1131ed['body'],{'read':![],'body':_0x1131ed['body'][_0xe8c9('0x5d')],'OpenchannelAccountId':_0x1177c2['id'],'UserId':_0x1131ed[_0xe8c9('0x5e')]['id'],'ContactId':_0x31c4d4['id']})]},{'include':[{'model':db[_0xe8c9('0x9e')],'as':_0xe8c9('0xc0')}]})['then'](function(_0x3775f2){return[_0x3775f2,!![]];});});}})['spread'](function(_0x57d78,_0x1b4dbb){if(_0x1b4dbb){return _0x57d78;}return db['OpenchannelMessage'][_0xe8c9('0x5c')](_[_0xe8c9('0x56')](_0x1131ed[_0xe8c9('0x5d')],{'read':![],'body':_0x1131ed[_0xe8c9('0x5d')][_0xe8c9('0x5d')],'OpenchannelAccountId':_0x1177c2['id'],'OpenchannelInteractionId':_0x57d78['id'],'UserId':_0x1131ed[_0xe8c9('0x5e')]['id'],'ContactId':_0x31c4d4['id']}))[_0xe8c9('0x24')](function(_0x43656a){_0x57d78[_0xe8c9('0xc1')]['Messages']=[];_0x57d78[_0xe8c9('0xc1')]['Messages'][_0xe8c9('0x9b')](_0x43656a['dataValues']);return _0x57d78;});});}})[_0xe8c9('0x24')](respondWithResult(_0x11f846,null))[_0xe8c9('0x2f')](handleError(_0x11f846,null));}; \ No newline at end of file +var _0xea47=['Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','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','List','Contacts','DESC','OpenchannelApplication','applications','list','orderBy','priority','account','Applications','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','hasOwnProperty','Contact','Owner','fullname','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','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','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','count','findAll','params','Pause','rawAttributes','includeAll','include','find','create','user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','findOne','order','OpenchannelAccountId','rows','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','CmContact'];(function(_0x1ac621,_0x862fe4){var _0xe9ea98=function(_0x2ffcda){while(--_0x2ffcda){_0x1ac621['push'](_0x1ac621['shift']());}};_0xe9ea98(++_0x862fe4);}(_0xea47,0x10b));var _0x7ea4=function(_0x4a26bc,_0x304433){_0x4a26bc=_0x4a26bc-0x0;var _0x26004b=_0xea47[_0x4a26bc];return _0x26004b;};'use strict';var emlformat=require(_0x7ea4('0x0'));var rimraf=require(_0x7ea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ea4('0x2'));var rp=require(_0x7ea4('0x3'));var moment=require('moment');var BPromise=require(_0x7ea4('0x4'));var Mustache=require(_0x7ea4('0x5'));var util=require('util');var path=require(_0x7ea4('0x6'));var sox=require(_0x7ea4('0x7'));var csv=require('to-csv');var ejs=require(_0x7ea4('0x8'));var fs=require('fs');var fs_extra=require(_0x7ea4('0x9'));var _=require(_0x7ea4('0xa'));var squel=require(_0x7ea4('0xb'));var crypto=require('crypto');var jsforce=require(_0x7ea4('0xc'));var deskjs=require(_0x7ea4('0xd'));var toCsv=require(_0x7ea4('0xe'));var querystring=require(_0x7ea4('0xf'));var Papa=require(_0x7ea4('0x10'));var Redis=require(_0x7ea4('0x11'));var authService=require(_0x7ea4('0x12'));var qs=require(_0x7ea4('0x13'));var as=require(_0x7ea4('0x14'));var hardwareService=require(_0x7ea4('0x15'));var logger=require(_0x7ea4('0x16'))(_0x7ea4('0x17'));var utils=require(_0x7ea4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7ea4('0x19'));var db=require(_0x7ea4('0x1a'))['db'];config['redis']=_[_0x7ea4('0x1b')](config[_0x7ea4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ea4('0x1d'))(new Redis(config['redis']));require(_0x7ea4('0x1e'))[_0x7ea4('0x1f')](socket);var jayson=require(_0x7ea4('0x20'));var client=jayson[_0x7ea4('0x21')][_0x7ea4('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x7ea4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x8d9e76,_0x1e1e64,_0x57ecb9,_0x40f458){return new BPromise(function(_0x60d643,_0x4d19e7){var _0x25e7ba=_0x40f458||client;return _0x25e7ba[_0x7ea4('0x23')](_0x8d9e76,_0x57ecb9)[_0x7ea4('0x24')](function(_0x46c14e){logger[_0x7ea4('0x25')](_0x7ea4('0x26'),_0x1e1e64,'request\x20sent');logger[_0x7ea4('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1e1e64,_0x7ea4('0x28'),JSON[_0x7ea4('0x29')](_0x46c14e));if(_0x46c14e[_0x7ea4('0x2a')]){if(_0x46c14e['error'][_0x7ea4('0x2b')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1e1e64,_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);return _0x4d19e7(_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);}logger[_0x7ea4('0x2a')](_0x7ea4('0x26'),_0x1e1e64,_0x46c14e['error'][_0x7ea4('0x2c')]);return _0x60d643(_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);}else{logger[_0x7ea4('0x25')](_0x7ea4('0x26'),_0x1e1e64,_0x7ea4('0x28'));_0x60d643(_0x46c14e['result'][_0x7ea4('0x2c')]);}})[_0x7ea4('0x2d')](function(_0x1685d6){logger[_0x7ea4('0x2a')](_0x7ea4('0x26'),_0x1e1e64,_0x1685d6);_0x4d19e7(_0x1685d6);});});}function respondWithStatusCode(_0xa3b97,_0x30208a){_0x30208a=_0x30208a||0xcc;return function(_0x172cf6){if(_0x172cf6){return _0xa3b97[_0x7ea4('0x2e')](_0x30208a);}return _0xa3b97[_0x7ea4('0x2f')](_0x30208a)[_0x7ea4('0x30')]();};}function respondWithResult(_0x2d576e,_0x2cdeb7){_0x2cdeb7=_0x2cdeb7||0xc8;return function(_0x253d1a){if(_0x253d1a){return _0x2d576e[_0x7ea4('0x2f')](_0x2cdeb7)[_0x7ea4('0x31')](_0x253d1a);}};}function respondWithFilteredResult(_0x1fe932,_0x4a06f2){return function(_0x284587){if(_0x284587){var _0x5357b8=typeof _0x4a06f2[_0x7ea4('0x32')]===_0x7ea4('0x33')&&typeof _0x4a06f2[_0x7ea4('0x34')]==='undefined';var _0x1f1f98=_0x284587['count'];var _0x2edc54=_0x5357b8?0x0:_0x4a06f2[_0x7ea4('0x32')];var _0x332a29=_0x5357b8?_0x284587['count']:_0x4a06f2[_0x7ea4('0x32')]+_0x4a06f2[_0x7ea4('0x34')];var _0x49230e;if(_0x332a29>=_0x1f1f98){_0x332a29=_0x1f1f98;_0x49230e=0xc8;}else{_0x49230e=0xce;}_0x1fe932[_0x7ea4('0x2f')](_0x49230e);return _0x1fe932[_0x7ea4('0x35')](_0x7ea4('0x36'),_0x2edc54+'-'+_0x332a29+'/'+_0x1f1f98)[_0x7ea4('0x31')](_0x284587);}return null;};}function patchUpdates(_0x3cbea1){return function(_0x5c0dd0){try{jsonpatch[_0x7ea4('0x37')](_0x5c0dd0,_0x3cbea1,!![]);}catch(_0x435836){return BPromise[_0x7ea4('0x38')](_0x435836);}return _0x5c0dd0[_0x7ea4('0x39')]();};}function saveUpdates(_0x29a223,_0x4a4778){return function(_0x4f7300){if(_0x4f7300){return _0x4f7300['update'](_0x29a223)[_0x7ea4('0x24')](function(_0x5c98b3){return _0x5c98b3;});}return null;};}function removeEntity(_0x8c3001,_0x3c9411){return function(_0x9c5d7d){if(_0x9c5d7d){return _0x9c5d7d['destroy']()[_0x7ea4('0x24')](function(){var _0x5d51ec=_0x9c5d7d[_0x7ea4('0x3a')]({'plain':!![]});var _0x27b3e1='OpenchannelAccounts';return db[_0x7ea4('0x3b')][_0x7ea4('0x3c')]({'where':{'type':_0x27b3e1,'resourceId':_0x5d51ec['id']}})[_0x7ea4('0x24')](function(){return _0x9c5d7d;});})[_0x7ea4('0x24')](function(){_0x8c3001[_0x7ea4('0x2f')](0xcc)[_0x7ea4('0x30')]();});}};}function handleEntityNotFound(_0x4d0092,_0x3d7a3f){return function(_0x44fca6){if(!_0x44fca6){_0x4d0092[_0x7ea4('0x2e')](0x194);}return _0x44fca6;};}function handleError(_0x4aafe8,_0x3790e1){_0x3790e1=_0x3790e1||0x1f4;return function(_0x4ed37d){logger[_0x7ea4('0x2a')](_0x4ed37d[_0x7ea4('0x3d')]);if(_0x4ed37d[_0x7ea4('0x3e')]){delete _0x4ed37d[_0x7ea4('0x3e')];}_0x4aafe8['status'](_0x3790e1)[_0x7ea4('0x3f')](_0x4ed37d);};}exports['index']=function(_0x4544ca,_0x4f1dc7){var _0x572eb1={'include':[{'model':db['Pause'],'as':_0x7ea4('0x40')}]},_0x5925e6={},_0x5760aa={'count':0x0,'rows':[]};var _0x217057=_[_0x7ea4('0x41')](db[_0x7ea4('0x42')]['rawAttributes'],function(_0x4f540e){return{'name':_0x4f540e['fieldName'],'type':_0x4f540e[_0x7ea4('0x43')][_0x7ea4('0x44')]};});_0x5925e6[_0x7ea4('0x45')]=_['map'](_0x217057,_0x7ea4('0x3e'));_0x5925e6['query']=_[_0x7ea4('0x46')](_0x4544ca[_0x7ea4('0x47')]);_0x5925e6['filters']=_[_0x7ea4('0x48')](_0x5925e6[_0x7ea4('0x45')],_0x5925e6[_0x7ea4('0x47')]);_0x572eb1[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x5925e6['model'],qs[_0x7ea4('0x4a')](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x572eb1[_0x7ea4('0x49')]=_0x572eb1[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x572eb1[_0x7ea4('0x49')]:_0x5925e6[_0x7ea4('0x45')];if(!_0x4544ca['query']['hasOwnProperty'](_0x7ea4('0x4c'))){_0x572eb1[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x572eb1['offset']=qs['offset'](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x32')]);}_0x572eb1['order']=qs[_0x7ea4('0x4d')](_0x4544ca['query'][_0x7ea4('0x4d')]);_0x572eb1[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_['pick'](_0x4544ca['query'],_0x5925e6[_0x7ea4('0x4f')]),_0x217057);if(_0x4544ca[_0x7ea4('0x47')]['filter']){_0x572eb1[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x572eb1[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x217057,function(_0x404938){if(_0x404938[_0x7ea4('0x43')]!==_0x7ea4('0x51')){var _0x3d28cb={};_0x3d28cb[_0x404938[_0x7ea4('0x3e')]]={'$like':'%'+_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x3d28cb;}})});}_0x572eb1=_[_0x7ea4('0x50')]({},_0x572eb1,_0x4544ca[_0x7ea4('0x53')]);var _0x3f0875={'where':_0x572eb1[_0x7ea4('0x4e')]};return db['OpenchannelAccount']['count'](_0x3f0875)[_0x7ea4('0x24')](function(_0x3953ad){_0x5760aa[_0x7ea4('0x54')]=_0x3953ad;if(_0x4544ca[_0x7ea4('0x47')]['includeAll']){_0x572eb1['include']=[{'all':!![]}];}return db[_0x7ea4('0x42')][_0x7ea4('0x55')](_0x572eb1);})[_0x7ea4('0x24')](function(_0x4a7125){_0x5760aa['rows']=_0x4a7125;return _0x5760aa;})[_0x7ea4('0x24')](respondWithFilteredResult(_0x4f1dc7,_0x572eb1))['catch'](handleError(_0x4f1dc7,null));};exports['show']=function(_0x3b0b65,_0x5332e1){var _0x76bfff={'raw':![],'where':{'id':_0x3b0b65[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x57')],'as':'mandatoryDispositionPause'}]},_0x1cc1c8={};_0x1cc1c8[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x42')][_0x7ea4('0x58')]);_0x1cc1c8['query']=_[_0x7ea4('0x46')](_0x3b0b65[_0x7ea4('0x47')]);_0x1cc1c8[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x1cc1c8['model'],_0x1cc1c8[_0x7ea4('0x47')]);_0x76bfff[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x1cc1c8['model'],qs[_0x7ea4('0x4a')](_0x3b0b65[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x76bfff['attributes']=_0x76bfff[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x76bfff[_0x7ea4('0x49')]:_0x1cc1c8[_0x7ea4('0x45')];if(_0x3b0b65[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x76bfff[_0x7ea4('0x5a')]=[{'all':!![]}];}_0x76bfff=_[_0x7ea4('0x50')]({},_0x76bfff,_0x3b0b65[_0x7ea4('0x53')]);return db['OpenchannelAccount'][_0x7ea4('0x5b')](_0x76bfff)[_0x7ea4('0x24')](handleEntityNotFound(_0x5332e1,null))[_0x7ea4('0x24')](respondWithResult(_0x5332e1,null))[_0x7ea4('0x2d')](handleError(_0x5332e1,null));};exports[_0x7ea4('0x5c')]=function(_0x592fc6,_0x4b3582){return db['OpenchannelAccount']['create'](_0x592fc6['body'],{})['then'](function(_0x37b67d){var _0x1fa351=_0x592fc6[_0x7ea4('0x5d')][_0x7ea4('0x3a')]({'plain':!![]});if(!_0x1fa351)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fa351[_0x7ea4('0x5e')]===_0x7ea4('0x5d')){var _0x4a9fd3=_0x37b67d[_0x7ea4('0x3a')]({'plain':!![]});var _0x3fe908=_0x7ea4('0x5f');return db['UserProfileSection'][_0x7ea4('0x5b')]({'where':{'name':_0x3fe908,'userProfileId':_0x1fa351[_0x7ea4('0x60')]},'raw':!![]})[_0x7ea4('0x24')](function(_0xf8b556){if(_0xf8b556&&_0xf8b556[_0x7ea4('0x61')]===0x0){return db[_0x7ea4('0x3b')][_0x7ea4('0x5c')]({'name':_0x4a9fd3['name'],'resourceId':_0x4a9fd3['id'],'type':_0xf8b556['name'],'sectionId':_0xf8b556['id']},{})[_0x7ea4('0x24')](function(){return _0x37b67d;});}else{return _0x37b67d;}})[_0x7ea4('0x2d')](function(_0x1ad08e){logger[_0x7ea4('0x2a')](_0x7ea4('0x62'),_0x1ad08e);throw _0x1ad08e;});}return _0x37b67d;})[_0x7ea4('0x24')](respondWithResult(_0x4b3582,0xc9))[_0x7ea4('0x2d')](handleError(_0x4b3582,null));};exports[_0x7ea4('0x63')]=function(_0x2241c7,_0x280c8e){if(_0x2241c7[_0x7ea4('0x64')]['id']){delete _0x2241c7[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x2241c7[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x57')],'as':_0x7ea4('0x40')}]})[_0x7ea4('0x24')](handleEntityNotFound(_0x280c8e,null))['then'](saveUpdates(_0x2241c7[_0x7ea4('0x64')],null))['then'](respondWithResult(_0x280c8e,null))[_0x7ea4('0x2d')](handleError(_0x280c8e,null));};exports[_0x7ea4('0x3c')]=function(_0x4f1317,_0x23c9a4){return db['OpenchannelAccount']['find']({'where':{'id':_0x4f1317[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x23c9a4,null))[_0x7ea4('0x24')](removeEntity(_0x23c9a4,null))[_0x7ea4('0x2d')](handleError(_0x23c9a4,null));};exports[_0x7ea4('0x65')]=function(_0x19bf84,_0x5dc1ee){return db[_0x7ea4('0x42')][_0x7ea4('0x65')]()[_0x7ea4('0x24')](respondWithResult(_0x5dc1ee,null))[_0x7ea4('0x2d')](handleError(_0x5dc1ee,null));};exports[_0x7ea4('0x66')]=function(_0x410d90,_0x5f4311,_0x2c7af8){if(_0x410d90[_0x7ea4('0x64')]['id']){delete _0x410d90[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x410d90[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x5f4311,null))[_0x7ea4('0x24')](function(_0x3c412a){if(_0x3c412a){_0x410d90[_0x7ea4('0x64')]['OpenchannelAccountId']=_0x3c412a['id'];return db[_0x7ea4('0x67')][_0x7ea4('0x5c')](_0x410d90['body']);}})[_0x7ea4('0x24')](respondWithResult(_0x5f4311,null))['catch'](handleError(_0x5f4311,null));};exports[_0x7ea4('0x68')]=function(_0x37e407,_0x329ebb,_0x9980da){var _0x16e276={'raw':![],'where':{}};var _0x10ce8a={};var _0x206fd4={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x37e407[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x329ebb,null))['then'](function(_0x4a06da){if(_0x4a06da){_0x10ce8a[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db['Disposition'][_0x7ea4('0x58')]);_0x10ce8a[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x37e407[_0x7ea4('0x47')]);_0x10ce8a['filters']=_['intersection'](_0x10ce8a[_0x7ea4('0x45')],_0x10ce8a[_0x7ea4('0x47')]);_0x16e276[_0x7ea4('0x49')]=_['intersection'](_0x10ce8a[_0x7ea4('0x45')],qs[_0x7ea4('0x4a')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x16e276[_0x7ea4('0x49')]=_0x16e276[_0x7ea4('0x49')]['length']?_0x16e276[_0x7ea4('0x49')]:_0x10ce8a[_0x7ea4('0x45')];if(!_0x37e407[_0x7ea4('0x47')]['hasOwnProperty'](_0x7ea4('0x4c'))){_0x16e276[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x16e276[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x32')]);}_0x16e276[_0x7ea4('0x6a')]=qs['sort'](_0x37e407[_0x7ea4('0x47')]['sort']);_0x16e276[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_['pick'](_0x37e407[_0x7ea4('0x47')],_0x10ce8a[_0x7ea4('0x4f')]));_0x16e276[_0x7ea4('0x4e')][_0x7ea4('0x6b')]=_0x4a06da['id'];if(_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x16e276[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x16e276[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x16e276[_0x7ea4('0x49')],function(_0x53e82e){var _0x2894d9={};_0x2894d9[_0x53e82e]={'$like':'%'+_0x37e407[_0x7ea4('0x47')]['filter']+'%'};return _0x2894d9;})});}_0x16e276=_['merge']({},_0x16e276,_0x37e407[_0x7ea4('0x53')]);return db[_0x7ea4('0x67')][_0x7ea4('0x54')]({'where':_0x16e276[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0x183f06){_0x206fd4[_0x7ea4('0x54')]=_0x183f06;if(_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x16e276[_0x7ea4('0x5a')]=[{'all':!![]}];}return db[_0x7ea4('0x67')][_0x7ea4('0x55')](_0x16e276);})[_0x7ea4('0x24')](function(_0x2b8960){_0x206fd4[_0x7ea4('0x6c')]=_0x2b8960;return _0x206fd4;});}})[_0x7ea4('0x24')](respondWithFilteredResult(_0x329ebb,_0x16e276))[_0x7ea4('0x2d')](handleError(_0x329ebb,null));};exports[_0x7ea4('0x6d')]=function(_0x1ff06c,_0x3f8e48,_0x544b14){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x1ff06c['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x3f8e48,null))['then'](function(_0x9706ea){if(_0x9706ea){return _0x9706ea['removeDispositions'](_0x1ff06c[_0x7ea4('0x47')][_0x7ea4('0x6e')]);}})[_0x7ea4('0x24')](respondWithStatusCode(_0x3f8e48,null))[_0x7ea4('0x2d')](handleError(_0x3f8e48,null));};exports['addAnswer']=function(_0x563d3c,_0x2cef3a,_0x5b17a2){if(_0x563d3c[_0x7ea4('0x64')]['id']){delete _0x563d3c[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x563d3c[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x2cef3a,null))[_0x7ea4('0x24')](function(_0x278b5b){if(_0x278b5b){_0x563d3c['body']['OpenchannelAccountId']=_0x278b5b['id'];return db[_0x7ea4('0x6f')][_0x7ea4('0x5c')](_0x563d3c[_0x7ea4('0x64')]);}})[_0x7ea4('0x24')](respondWithResult(_0x2cef3a,null))[_0x7ea4('0x2d')](handleError(_0x2cef3a,null));};exports[_0x7ea4('0x70')]=function(_0x5b2294,_0x3d9f97,_0x5939fc){var _0x11ecaa={'raw':![],'where':{}};var _0x2fe56={};var _0x2bad23={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x5b2294[_0x7ea4('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d9f97,null))[_0x7ea4('0x24')](function(_0x4fb370){if(_0x4fb370){_0x2fe56['model']=_[_0x7ea4('0x46')](db[_0x7ea4('0x6f')][_0x7ea4('0x58')]);_0x2fe56[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x5b2294[_0x7ea4('0x47')]);_0x2fe56[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x2fe56[_0x7ea4('0x45')],_0x2fe56[_0x7ea4('0x47')]);_0x11ecaa[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x2fe56[_0x7ea4('0x45')],qs['fields'](_0x5b2294['query']['fields']));_0x11ecaa[_0x7ea4('0x49')]=_0x11ecaa[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x11ecaa['attributes']:_0x2fe56[_0x7ea4('0x45')];if(!_0x5b2294[_0x7ea4('0x47')]['hasOwnProperty'](_0x7ea4('0x4c'))){_0x11ecaa[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x5b2294[_0x7ea4('0x47')]['limit']);_0x11ecaa[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x5b2294[_0x7ea4('0x47')]['offset']);}_0x11ecaa[_0x7ea4('0x6a')]=qs[_0x7ea4('0x4d')](_0x5b2294[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x11ecaa[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_[_0x7ea4('0x71')](_0x5b2294['query'],_0x2fe56[_0x7ea4('0x4f')]));_0x11ecaa['where'][_0x7ea4('0x6b')]=_0x4fb370['id'];if(_0x5b2294[_0x7ea4('0x47')]['filter']){_0x11ecaa[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x11ecaa[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x11ecaa[_0x7ea4('0x49')],function(_0x3207a1){var _0x8f4b5c={};_0x8f4b5c[_0x3207a1]={'$like':'%'+_0x5b2294[_0x7ea4('0x47')]['filter']+'%'};return _0x8f4b5c;})});}_0x11ecaa=_[_0x7ea4('0x50')]({},_0x11ecaa,_0x5b2294[_0x7ea4('0x53')]);return db[_0x7ea4('0x6f')][_0x7ea4('0x54')]({'where':_0x11ecaa[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0xb5f448){_0x2bad23[_0x7ea4('0x54')]=_0xb5f448;if(_0x5b2294[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x11ecaa[_0x7ea4('0x5a')]=[{'all':!![]}];}return db[_0x7ea4('0x6f')]['findAll'](_0x11ecaa);})['then'](function(_0x167c3b){_0x2bad23[_0x7ea4('0x6c')]=_0x167c3b;return _0x2bad23;});}})['then'](respondWithFilteredResult(_0x3d9f97,_0x11ecaa))['catch'](handleError(_0x3d9f97,null));};exports['removeAnswers']=function(_0x4fa2ac,_0x4fe7fc,_0x27278d){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x4fa2ac['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x4fe7fc,null))[_0x7ea4('0x24')](function(_0x5895cf){if(_0x5895cf){return _0x5895cf[_0x7ea4('0x72')](_0x4fa2ac[_0x7ea4('0x47')]['ids']);}})[_0x7ea4('0x24')](respondWithStatusCode(_0x4fe7fc,null))[_0x7ea4('0x2d')](handleError(_0x4fe7fc,null));};exports[_0x7ea4('0x73')]=function(_0x5527da,_0x3cc481,_0x1c993b){var _0x28b7cf={'body':_0x5527da[_0x7ea4('0x64')],'channel':'openchannel'};var _0x3cae68=[];var _0x206fa3=[];var _0x29b279={};var _0x1fa7cc=![];return db[_0x7ea4('0x74')]['describe']()[_0x7ea4('0x24')](function(_0x157b04){if(!_0x157b04){throw new db[(_0x7ea4('0x75'))]['ValidationError'](_0x7ea4('0x76'));}_0x3cae68=_[_0x7ea4('0x77')](_[_0x7ea4('0x46')](_0x157b04),[_0x7ea4('0x78'),_0x7ea4('0x79')]);_0x206fa3=_[_0x7ea4('0x77')](_[_0x7ea4('0x46')](_0x157b04),[_0x7ea4('0x78'),_0x7ea4('0x79'),_0x7ea4('0x7a'),'ListId']);if(_0x5527da[_0x7ea4('0x64')]['id']){delete _0x5527da[_0x7ea4('0x64')]['id'];}if(_[_0x7ea4('0x7b')](_0x5527da['body'][_0x7ea4('0x7c')])){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x7e'));}if(_['isNil'](_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x64')])||_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x64')]===''){throw new db['Sequelize']['ValidationError'](_0x7ea4('0x7f'));}if(_[_0x7ea4('0x7b')](_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')])){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x81')+_0x206fa3);}if(!_[_0x7ea4('0x82')](_0x206fa3,_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')])){throw new db['Sequelize'][(_0x7ea4('0x7d'))](_0x7ea4('0x83')+_0x206fa3);}_0x29b279[_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')]]=_0x5527da['body'][_0x7ea4('0x7c')];})['then'](function(){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x5527da[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x84')],'as':_0x7ea4('0x85'),'include':[{'model':db['CmContact'],'as':_0x7ea4('0x86'),'where':_0x29b279,'limit':0x1,'order':[['updatedAt',_0x7ea4('0x87')]]}]},{'model':db[_0x7ea4('0x88')],'as':'Applications'}]});})[_0x7ea4('0x24')](handleEntityNotFound(_0x3cc481,null))[_0x7ea4('0x24')](function(_0xaa3b3d){if(_0xaa3b3d&&_0xaa3b3d[_0x7ea4('0x85')]){_0x28b7cf['account']=_0xaa3b3d;_0x28b7cf[_0x7ea4('0x89')]=_0xaa3b3d['Applications'];_0x28b7cf[_0x7ea4('0x8a')]=_0xaa3b3d[_0x7ea4('0x85')];_0x28b7cf['applications']=_[_0x7ea4('0x8b')](_0x28b7cf[_0x7ea4('0x89')],[_0x7ea4('0x8c')],['asc']);if(_0x28b7cf[_0x7ea4('0x8d')]['Applications']){delete _0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x8e')];}if(_0x28b7cf['account'][_0x7ea4('0x85')]&&_0x28b7cf[_0x7ea4('0x8d')]['List'][_0x7ea4('0x86')][_0x7ea4('0x4b')]){return _0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x85')][_0x7ea4('0x86')][0x0];}var _0x47ef0b=_[_0x7ea4('0x1b')](_0x5527da['body'],{'firstName':_0x5527da[_0x7ea4('0x64')]['from'],'ListId':_0xaa3b3d[_0x7ea4('0x8f')]});_0x47ef0b[_0x5527da['body'][_0x7ea4('0x80')]]=_0x5527da['body'][_0x7ea4('0x7c')];return db[_0x7ea4('0x74')][_0x7ea4('0x5c')](_0x47ef0b,{'fields':_0x3cae68,'raw':!![]});}})[_0x7ea4('0x24')](handleEntityNotFound(_0x3cc481,null))['then'](function(_0x39b2d7){_0x28b7cf['contact']=_0x39b2d7;if(_0x39b2d7){var _0x148698={'ContactId':_0x39b2d7['id'],'OpenchannelAccountId':_0x5527da['params']['id'],'from':(_0x39b2d7[_0x7ea4('0x90')]||'')+'\x20'+(_0x39b2d7[_0x7ea4('0x91')]||'')};var _0x185535={'OpenchannelAccountId':_0x5527da['params']['id'],'closed':![]};if(_0x5527da[_0x7ea4('0x64')]['threadId']){_0x185535[_0x7ea4('0x92')]=_0x5527da['body']['threadId'];return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':_0x185535})[_0x7ea4('0x24')](function(_0x10854c){if(_0x10854c){return[_0x10854c,![]];}_0x148698[_0x7ea4('0x92')]=_0x5527da[_0x7ea4('0x64')]['threadId'];_0x148698['externalUrl']=_0x5527da['body'][_0x7ea4('0x94')];return db[_0x7ea4('0x93')][_0x7ea4('0x5c')](_0x148698)[_0x7ea4('0x24')](function(_0x4ef6d5){return[_0x4ef6d5,!![]];});});}else{_0x185535['threadId']=null;}_0x185535[_0x7ea4('0x95')]=_0x39b2d7['id'];return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':_0x185535})[_0x7ea4('0x24')](function(_0x9b5019){if(_0x9b5019){return[_0x9b5019,![]];}return db[_0x7ea4('0x93')][_0x7ea4('0x5c')](_0x148698)[_0x7ea4('0x24')](function(_0x4c5826){return[_0x4c5826,!![]];});});}})['spread'](function(_0x32312a,_0x23516b){if(_0x32312a){_0x1fa7cc=_0x23516b;if(!_0x23516b){var _0x2e476a={'from':(_0x28b7cf[_0x7ea4('0x96')][_0x7ea4('0x90')]||'')+'\x20'+(_0x28b7cf[_0x7ea4('0x96')]['lastName']||'')};if(_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x92')]&&_0x5527da['body'][_0x7ea4('0x97')]&&_0x5527da['body'][_0x7ea4('0x92')]!=_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x97')]){_0x2e476a[_0x7ea4('0x92')]=_0x5527da[_0x7ea4('0x64')]['messageId'];}return _0x32312a[_0x7ea4('0x63')](_0x2e476a);}else{return _0x32312a;}}})[_0x7ea4('0x24')](function(_0x10eee8){_0x28b7cf[_0x7ea4('0x98')]=_0x10eee8[_0x7ea4('0x3a')]({'plain':!![]});_0x28b7cf[_0x7ea4('0x98')]['created']=_0x1fa7cc;if(_0x28b7cf['interaction'][_0x7ea4('0x99')]){if(_0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x9a')]){_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0x9b')]({'id':0x0,'priority':_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0x4b')]+0x1,'app':_0x7ea4('0x9c'),'appdata':_0x7ea4('0x9d'),'interval':_0x7ea4('0x9e')});}}return db[_0x7ea4('0x9f')][_0x7ea4('0x5c')]({'body':_0x5527da['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x5527da[_0x7ea4('0x56')]['id'],'OpenchannelInteractionId':_0x10eee8['id'],'direction':'in','ContactId':_0x28b7cf[_0x7ea4('0x96')]['id'],'AttachmentId':_0x5527da[_0x7ea4('0x64')][_0x7ea4('0xa0')]});})[_0x7ea4('0x24')](function(_0x4faccf){_0x28b7cf[_0x7ea4('0x2c')]=_0x4faccf;if(_0x28b7cf['interaction'][_0x7ea4('0xa1')]){return db[_0x7ea4('0xa2')][_0x7ea4('0x5b')]({'attributes':['id',_0x7ea4('0x3e')],'where':{'id':_0x28b7cf[_0x7ea4('0x98')][_0x7ea4('0xa1')]}})[_0x7ea4('0x24')](function(_0x2900c7){if(_0x2900c7){_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0xa3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2900c7[_0x7ea4('0x3e')]+','+(_0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0xa4')]||0xa),'interval':_0x7ea4('0x9e')});_0x28b7cf[_0x7ea4('0xa5')]=![];}return respondWithRpcPromise(_0x7ea4('0xa6'),'startRouting',_0x28b7cf);});}return respondWithRpcPromise(_0x7ea4('0xa6'),_0x7ea4('0xa7'),_0x28b7cf);})[_0x7ea4('0x24')](function(_0x3aa3a2){respondWithRpcPromise(_0x7ea4('0xa8'),_0x7ea4('0xa8'),{'event':_0x7ea4('0x73'),'message':_0x3aa3a2},client9002);return _0x3aa3a2;})[_0x7ea4('0x24')](respondWithResult(_0x3cc481,null))[_0x7ea4('0x2d')](handleError(_0x3cc481,null));};exports[_0x7ea4('0xa9')]=function(_0x1693d9,_0x2dd452,_0x24d3af){return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x1693d9['params']['id']}})['then'](handleEntityNotFound(_0x2dd452,null))[_0x7ea4('0x24')](function(_0x21092c){if(_0x21092c){return db[_0x7ea4('0xaa')][_0x7ea4('0xab')](function(_0x530ba6){return db[_0x7ea4('0x88')]['destroy']({'where':{'OpenchannelAccountId':_0x1693d9[_0x7ea4('0x56')]['id']},'transaction':_0x530ba6})[_0x7ea4('0x24')](function(_0x5e8987){var _0x3b65c2=_[_0x7ea4('0x41')](_0x1693d9[_0x7ea4('0x64')],function(_0x390dd1){_0x390dd1[_0x7ea4('0x6b')]=_0x1693d9[_0x7ea4('0x56')]['id'];return _0x390dd1;});return db[_0x7ea4('0x88')]['bulkCreate'](_0x3b65c2,{'transaction':_0x530ba6});});})[_0x7ea4('0x24')](function(){return db[_0x7ea4('0x88')][_0x7ea4('0xac')]({'where':{'OpenchannelAccountId':_0x1693d9[_0x7ea4('0x56')]['id']},'order':'priority'});});}})[_0x7ea4('0x24')](respondWithResult(_0x2dd452,null))[_0x7ea4('0x2d')](handleError(_0x2dd452,null));};exports[_0x7ea4('0xad')]=function(_0x351c42,_0x3a8c80,_0x2e812b){var _0x4598a9={};var _0x54d70c={};var _0x36426f;var _0x3f84e1;return db[_0x7ea4('0x42')]['findOne']({'where':{'id':_0x351c42[_0x7ea4('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a8c80,null))['then'](function(_0xd26d09){if(_0xd26d09){_0x36426f=_0xd26d09;_0x54d70c[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x88')][_0x7ea4('0x58')]);_0x54d70c[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x351c42[_0x7ea4('0x47')]);_0x54d70c[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x54d70c[_0x7ea4('0x45')],_0x54d70c['query']);_0x4598a9[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x54d70c['model'],qs[_0x7ea4('0x4a')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x4598a9[_0x7ea4('0x49')]=_0x4598a9[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x4598a9[_0x7ea4('0x49')]:_0x54d70c[_0x7ea4('0x45')];_0x4598a9[_0x7ea4('0x6a')]=qs[_0x7ea4('0x4d')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x4598a9[_0x7ea4('0x4e')]=qs['filters'](_['pick'](_0x351c42[_0x7ea4('0x47')],_0x54d70c[_0x7ea4('0x4f')]));if(_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x4598a9[_0x7ea4('0x4e')]=_['merge'](_0x4598a9['where'],{'$or':_[_0x7ea4('0x41')](_0x4598a9[_0x7ea4('0x49')],function(_0x4b4157){var _0x24cc68={};_0x24cc68[_0x4b4157]={'$like':'%'+_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x24cc68;})});}_0x4598a9=_[_0x7ea4('0x50')]({},_0x4598a9,_0x351c42[_0x7ea4('0x53')]);return _0x36426f[_0x7ea4('0xad')](_0x4598a9);}})[_0x7ea4('0x24')](function(_0x56e7d2){if(_0x56e7d2){_0x3f84e1=_0x56e7d2['length'];if(!_0x351c42[_0x7ea4('0x47')][_0x7ea4('0xae')]('nolimit')){_0x4598a9[_0x7ea4('0x34')]=qs['limit'](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x4598a9['offset']=qs[_0x7ea4('0x32')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x32')]);}return _0x36426f[_0x7ea4('0xad')](_0x4598a9);}})['then'](function(_0x3bf1dc){if(_0x3bf1dc){return _0x3bf1dc?{'count':_0x3f84e1,'rows':_0x3bf1dc}:null;}})[_0x7ea4('0x24')](respondWithResult(_0x3a8c80,null))[_0x7ea4('0x2d')](handleError(_0x3a8c80,null));};exports['getInteractions']=function(_0x12872c,_0x5a2c85,_0x4c4d00){var _0x4856c3={'raw':![],'where':{}};var _0x20824f={};var _0x29a51b={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x12872c['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x5a2c85,null))[_0x7ea4('0x24')](function(_0x1c6daa){if(_0x1c6daa){_0x20824f[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x93')][_0x7ea4('0x58')]);_0x20824f[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x12872c['query']);_0x20824f['filters']=_['intersection'](_0x20824f[_0x7ea4('0x45')],_0x20824f['query']);_0x4856c3[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x20824f['model'],qs[_0x7ea4('0x4a')](_0x12872c['query']['fields']));_0x4856c3[_0x7ea4('0x49')]=_0x4856c3['attributes'][_0x7ea4('0x4b')]?_0x4856c3[_0x7ea4('0x49')]:_0x20824f[_0x7ea4('0x45')];if(!_0x12872c['query']['hasOwnProperty'](_0x7ea4('0x4c'))){_0x4856c3['limit']=qs[_0x7ea4('0x34')](_0x12872c[_0x7ea4('0x47')]['limit']);_0x4856c3['offset']=qs[_0x7ea4('0x32')](_0x12872c[_0x7ea4('0x47')]['offset']);}_0x4856c3['order']=qs[_0x7ea4('0x4d')](_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x4856c3[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_[_0x7ea4('0x71')](_0x12872c[_0x7ea4('0x47')],_0x20824f[_0x7ea4('0x4f')]));_0x4856c3[_0x7ea4('0x4e')][_0x7ea4('0x6b')]=_0x1c6daa['id'];if(_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x4856c3[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x4856c3['where'],{'$or':_['map'](_0x4856c3[_0x7ea4('0x49')],function(_0x4d6be5){var _0x5e8756={};_0x5e8756[_0x4d6be5]={'$like':'%'+_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x5e8756;})});}_0x4856c3=_[_0x7ea4('0x50')]({},_0x4856c3,_0x12872c[_0x7ea4('0x53')]);return db[_0x7ea4('0x93')][_0x7ea4('0x54')]({'where':_0x4856c3[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0x157c08){_0x29a51b[_0x7ea4('0x54')]=_0x157c08;if(_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x4856c3[_0x7ea4('0x5a')]=[{'model':db[_0x7ea4('0x74')],'as':_0x7ea4('0xaf'),'required':![]},{'model':db[_0x7ea4('0xa2')],'as':_0x7ea4('0xb0'),'attributes':[_0x7ea4('0x3e'),_0x7ea4('0xb1'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x7ea4('0xb2'),'attributes':['id',_0x7ea4('0x3e'),_0x7ea4('0xb3')],'where':_0x12872c[_0x7ea4('0x47')]['tag']?{'id':_0x12872c[_0x7ea4('0x47')][_0x7ea4('0xb4')]}:undefined,'required':_0x12872c['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x4856c3);})[_0x7ea4('0x24')](function(_0x557a7d){_0x29a51b['rows']=_0x557a7d;return _0x29a51b;});}})[_0x7ea4('0x24')](respondWithFilteredResult(_0x5a2c85,_0x4856c3))[_0x7ea4('0x2d')](handleError(_0x5a2c85,null));};exports[_0x7ea4('0xb5')]=function(_0x2ede83,_0x491cf1,_0x4a6551){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x2ede83['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x491cf1,null))[_0x7ea4('0x24')](function(_0x153206){if(_0x153206){return _0x153206[_0x7ea4('0xb5')](_0x2ede83['body'][_0x7ea4('0x6e')],_['omit'](_0x2ede83['body'],[_0x7ea4('0x6e'),'id'])||{})[_0x7ea4('0xb6')](function(_0x1d9be4){for(var _0x89c3f4=0x0;_0x89c3f4<_0x2ede83['body'][_0x7ea4('0x6e')]['length'];_0x89c3f4+=0x1){socket[_0x7ea4('0xb7')](_0x7ea4('0xb8'),{'UserId':Number(_0x2ede83[_0x7ea4('0x64')][_0x7ea4('0x6e')][_0x89c3f4]),'OpenchannelAccountId':Number(_0x2ede83[_0x7ea4('0x56')]['id'])});}return _0x1d9be4;});}})[_0x7ea4('0x24')](respondWithResult(_0x491cf1,null))['catch'](handleError(_0x491cf1,null));};exports[_0x7ea4('0xb9')]=function(_0x412876,_0xe77e86,_0x371624){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x412876[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0xe77e86,null))[_0x7ea4('0x24')](function(_0x2b674d){if(_0x2b674d){return _0x2b674d[_0x7ea4('0xb9')](_0x412876[_0x7ea4('0x47')]['ids'])[_0x7ea4('0x24')](function(){if(_[_0x7ea4('0xba')](_0x412876['query'][_0x7ea4('0x6e')])){for(var _0x1e1cb5=0x0;_0x1e1cb5<_0x412876['query'][_0x7ea4('0x6e')][_0x7ea4('0x4b')];_0x1e1cb5+=0x1){socket[_0x7ea4('0xb7')](_0x7ea4('0xbb'),{'UserId':Number(_0x412876[_0x7ea4('0x47')][_0x7ea4('0x6e')][_0x1e1cb5]),'OpenchannelAccountId':Number(_0x412876['params']['id'])});}}else{socket[_0x7ea4('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x412876[_0x7ea4('0x47')][_0x7ea4('0x6e')]),'OpenchannelAccountId':Number(_0x412876[_0x7ea4('0x56')]['id'])});}});}})[_0x7ea4('0x24')](respondWithStatusCode(_0xe77e86,null))[_0x7ea4('0x2d')](handleError(_0xe77e86,null));};exports[_0x7ea4('0xbc')]=function(_0x52e197,_0x4e7a76,_0x2f0830){var _0x5ef2bc={};var _0x27d164={};var _0x3b0412;var _0x1c4a40;return db['OpenchannelAccount'][_0x7ea4('0x69')]({'where':{'id':_0x52e197[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x4e7a76,null))['then'](function(_0x1d4287){if(_0x1d4287){_0x3b0412=_0x1d4287;_0x27d164[_0x7ea4('0x45')]=_['keys'](db['User']['rawAttributes']);_0x27d164[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x52e197[_0x7ea4('0x47')]);_0x27d164[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x27d164['model'],_0x27d164[_0x7ea4('0x47')]);_0x5ef2bc[_0x7ea4('0x49')]=_['intersection'](_0x27d164[_0x7ea4('0x45')],qs['fields'](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x5ef2bc[_0x7ea4('0x49')]=_0x5ef2bc[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x5ef2bc['attributes']:_0x27d164[_0x7ea4('0x45')];_0x5ef2bc['order']=qs[_0x7ea4('0x4d')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x5ef2bc[_0x7ea4('0x4e')]=qs['filters'](_[_0x7ea4('0x71')](_0x52e197[_0x7ea4('0x47')],_0x27d164['filters']));if(_0x52e197[_0x7ea4('0x47')]['filter']){_0x5ef2bc[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x5ef2bc['where'],{'$or':_[_0x7ea4('0x41')](_0x5ef2bc[_0x7ea4('0x49')],function(_0x426ea8){var _0x3e2df4={};_0x3e2df4[_0x426ea8]={'$like':'%'+_0x52e197[_0x7ea4('0x47')]['filter']+'%'};return _0x3e2df4;})});}_0x5ef2bc=_[_0x7ea4('0x50')]({},_0x5ef2bc,_0x52e197['options']);return _0x3b0412[_0x7ea4('0xbc')](_0x5ef2bc);}})['then'](function(_0x3d8c73){if(_0x3d8c73){_0x1c4a40=_0x3d8c73['length'];if(!_0x52e197['query'][_0x7ea4('0xae')]('nolimit')){_0x5ef2bc[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x5ef2bc[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x32')]);}return _0x3b0412['getAgents'](_0x5ef2bc);}})[_0x7ea4('0x24')](function(_0x3f1542){if(_0x3f1542){return _0x3f1542?{'count':_0x1c4a40,'rows':_0x3f1542}:null;}})[_0x7ea4('0x24')](respondWithResult(_0x4e7a76,null))['catch'](handleError(_0x4e7a76,null));};exports['send']=function(_0x76bf0,_0x31a769,_0x528d11){var _0x31070b,_0x1327fa,_0xb7c013;if(_['isNil'](_0x76bf0[_0x7ea4('0x64')][_0x7ea4('0x64')])||_0x76bf0[_0x7ea4('0x64')][_0x7ea4('0x64')]===''){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x7f'));}if(_[_0x7ea4('0x7b')](_0x76bf0['body']['to'])){}_0x31070b=_0x76bf0[_0x7ea4('0x64')]['to'];return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x76bf0['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x31a769,null))['then'](function(_0x44dc94){if(_0x44dc94){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x44dc94['id']},'include':[{'model':db[_0x7ea4('0x84')],'as':_0x7ea4('0x85'),'include':[{'model':db[_0x7ea4('0x74')],'as':_0x7ea4('0x86'),'where':{[_0x44dc94[_0x7ea4('0x80')]]:_0x31070b},'limit':0x1,'order':[[_0x7ea4('0x79'),_0x7ea4('0x87')]]}]}]})['then'](handleEntityNotFound(_0x31a769,null))['then'](function(_0x2af801){if(_0x2af801&&_0x2af801[_0x7ea4('0x85')]){_0x1327fa=_0x2af801[_0x7ea4('0x3a')]({'plain':!![]});if(_0x1327fa[_0x7ea4('0x85')]&&_0x1327fa[_0x7ea4('0x85')][_0x7ea4('0x86')][_0x7ea4('0x4b')]){return _0x1327fa[_0x7ea4('0x85')][_0x7ea4('0x86')][0x0];}return db['CmContact'][_0x7ea4('0x5c')](_[_0x7ea4('0x1b')](_0x76bf0[_0x7ea4('0x64')],{'firstName':_0x31070b,[_0x2af801['mapKey']]:_0x31070b,'phone':_0x31070b,'ListId':_0x1327fa[_0x7ea4('0x8f')]}));}})['then'](handleEntityNotFound(_0x31a769,null))['then'](function(_0x37d769){if(_0x37d769){_0xb7c013=_0x37d769;return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':{'ContactId':_0xb7c013['id'],'closed':![],'OpenchannelAccountId':_0x1327fa['id']}})[_0x7ea4('0x24')](function(_0x4b6fc7){if(_0x4b6fc7){return[_0x4b6fc7,![]];}return db[_0x7ea4('0x93')][_0x7ea4('0x5c')]({'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id'],'OpenchannelAccountId':_0x1327fa['id'],'lastMsgDirection':_0x7ea4('0xbd'),'Messages':[_['merge'](_0x76bf0[_0x7ea4('0x64')],{'read':![],'body':_0x76bf0['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x1327fa['id'],'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x7ea4('0xbe')}]})['then'](function(_0x5377d7){return[_0x5377d7,!![]];});});}})['spread'](function(_0x5bdda9,_0x29507a){if(_0x29507a){return _0x5bdda9;}return db['OpenchannelMessage'][_0x7ea4('0x5c')](_[_0x7ea4('0x50')](_0x76bf0[_0x7ea4('0x64')],{'read':![],'body':_0x76bf0['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x1327fa['id'],'OpenchannelInteractionId':_0x5bdda9['id'],'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id']}))['then'](function(_0x116835){_0x5bdda9[_0x7ea4('0xbf')]['Messages']=[];_0x5bdda9[_0x7ea4('0xbf')][_0x7ea4('0xbe')]['push'](_0x116835[_0x7ea4('0xbf')]);return _0x5bdda9;});});}})[_0x7ea4('0x24')](respondWithResult(_0x31a769,null))[_0x7ea4('0x2d')](handleError(_0x31a769,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ec41bfe..cc753ff 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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x300e96,_0x329b01){var _0x3a4fe6=function(_0x558e83){while(--_0x558e83){_0x300e96['push'](_0x300e96['shift']());}};_0x3a4fe6(++_0x329b01);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5acc61,_0x3ea41c){_0x5acc61=_0x5acc61-0x0;var _0xa56c6d=_0xee5b[_0x5acc61];return _0xa56c6d;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4483,0x1a3));var _0x3448=function(_0x13495e,_0x3f5193){_0x13495e=_0x13495e-0x0;var _0x429cfe=_0x4483[_0x13495e];return _0x429cfe;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('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 134b87d..3de5fe7 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(_0x88b95c,_0x4ed0df){var _0x10b2c0=function(_0x58bbf9){while(--_0x58bbf9){_0x88b95c['push'](_0x88b95c['shift']());}};_0x10b2c0(++_0x4ed0df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x3c6ed7,_0x18fa72){var _0x355be8=function(_0xb1aa0f){while(--_0xb1aa0f){_0x3c6ed7['push'](_0x3c6ed7['shift']());}};_0x355be8(++_0x18fa72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index d3095f4..d13aa91 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 _0xaa5e=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x3824d5,_0x246a00){_0x3824d5=_0x3824d5-0x0;var _0x5f3d11=_0xaa5e[_0x3824d5];return _0x5f3d11;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});config['redis']=_[_0xeaa5('0xb')](config[_0xeaa5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xeaa5('0xd'))(new Redis(config[_0xeaa5('0xc')]));require('./openchannelAccount.socket')[_0xeaa5('0xe')](socket);function respondWithRpcPromise(_0x49682b,_0x2f5750,_0x3552ac){return new BPromise(function(_0x503237,_0x3e1c2e){return client[_0xeaa5('0xf')](_0x49682b,_0x3552ac)[_0xeaa5('0x10')](function(_0x46806d){logger[_0xeaa5('0x11')](_0xeaa5('0x12'),_0x2f5750,_0xeaa5('0x13'));logger[_0xeaa5('0x14')](_0xeaa5('0x15'),_0x2f5750,'request\x20sent',JSON[_0xeaa5('0x16')](_0x46806d));if(_0x46806d[_0xeaa5('0x17')]){if(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x18')]===0x1f4){logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x46806d[_0xeaa5('0x17')]['message']);return _0x3e1c2e(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x19')]);}logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x46806d[_0xeaa5('0x17')]['message']);return _0x503237(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x19')]);}else{logger[_0xeaa5('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0xeaa5('0x13'));_0x503237(_0x46806d['result'][_0xeaa5('0x19')]);}})[_0xeaa5('0x1a')](function(_0x22f4d3){logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x22f4d3);_0x3e1c2e(_0x22f4d3);});});} \ No newline at end of file +var _0x6215=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info'];(function(_0x2dd4ac,_0x5b170d){var _0x4d3ece=function(_0x433033){while(--_0x433033){_0x2dd4ac['push'](_0x2dd4ac['shift']());}};_0x4d3ece(++_0x5b170d);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var moment=require(_0x5621('0x2'));var BPromise=require('bluebird');var rs=require(_0x5621('0x3'));var fs=require('fs');var Redis=require(_0x5621('0x4'));var db=require(_0x5621('0x5'))['db'];var utils=require(_0x5621('0x6'));var logger=require(_0x5621('0x7'))(_0x5621('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5621('0x9')]=_[_0x5621('0xa')](config[_0x5621('0x9')],{'host':_0x5621('0xb'),'port':0x18eb});var socket=require(_0x5621('0xc'))(new Redis(config['redis']));require(_0x5621('0xd'))[_0x5621('0xe')](socket);function respondWithRpcPromise(_0x3aa022,_0x418114,_0x53625c){return new BPromise(function(_0x1f4148,_0x10bb32){return client[_0x5621('0xf')](_0x3aa022,_0x53625c)['then'](function(_0x2b0f51){logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));logger[_0x5621('0x13')](_0x5621('0x14'),_0x418114,_0x5621('0x12'),JSON[_0x5621('0x15')](_0x2b0f51));if(_0x2b0f51[_0x5621('0x16')]){if(_0x2b0f51[_0x5621('0x16')]['code']===0x1f4){logger[_0x5621('0x16')](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')]['message']);return _0x10bb32(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}logger['error'](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);return _0x1f4148(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}else{logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));_0x1f4148(_0x2b0f51[_0x5621('0x18')][_0x5621('0x17')]);}})['catch'](function(_0x1111b2){logger[_0x5621('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x418114,_0x1111b2);_0x10bb32(_0x1111b2);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6d7d696..49c8341 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 _0x5bbd=['remove','update','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x39dfac,_0x23f528){var _0x385392=function(_0x471620){while(--_0x471620){_0x39dfac['push'](_0x39dfac['shift']());}};_0x385392(++_0x23f528);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xd5bb('0x0'));var events=[_0xd5bb('0x1'),_0xd5bb('0x2'),_0xd5bb('0x3')];function createListener(_0x31b4a1,_0x44487d){return function(_0x179bab){_0x44487d['emit'](_0x31b4a1,_0x179bab);};}function removeListener(_0x5db64a,_0x4a4799){return function(){OpenchannelAccountEvents[_0xd5bb('0x4')](_0x5db64a,_0x4a4799);};}exports[_0xd5bb('0x5')]=function(_0x489e3d){for(var _0x520c77=0x0,_0x292873=events['length'];_0x520c77<_0x292873;_0x520c77++){var _0x3878ba=events[_0x520c77];var _0x17c08f=createListener(_0xd5bb('0x6')+_0x3878ba,_0x489e3d);OpenchannelAccountEvents['on'](_0x3878ba,_0x17c08f);}}; \ No newline at end of file +var _0x3360=['register','length','openchannelAccount:','./openchannelAccount.events','save','removeListener'];(function(_0x272437,_0x1a4588){var _0x32cf67=function(_0x386550){while(--_0x386550){_0x272437['push'](_0x272437['shift']());}};_0x32cf67(++_0x1a4588);}(_0x3360,0x1d7));var _0x0336=function(_0x272cd2,_0x3a8322){_0x272cd2=_0x272cd2-0x0;var _0x13bd2c=_0x3360[_0x272cd2];return _0x13bd2c;};'use strict';var OpenchannelAccountEvents=require(_0x0336('0x0'));var events=[_0x0336('0x1'),'remove','update'];function createListener(_0x5882e7,_0x12fd21){return function(_0x56bf8b){_0x12fd21['emit'](_0x5882e7,_0x56bf8b);};}function removeListener(_0x472555,_0xeb42d1){return function(){OpenchannelAccountEvents[_0x0336('0x2')](_0x472555,_0xeb42d1);};}exports[_0x0336('0x3')]=function(_0x340a8a){for(var _0x4aed6a=0x0,_0x4890e5=events[_0x0336('0x4')];_0x4aed6a<_0x4890e5;_0x4aed6a++){var _0x36a973=events[_0x4aed6a];var _0x310327=createListener(_0x0336('0x5')+_0x36a973,_0x340a8a);OpenchannelAccountEvents['on'](_0x36a973,_0x310327);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 183c120..dbfd66b 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 _0x4bf0=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','create','put','update','delete'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x4bf0,0x91));var _0x04bf=function(_0x488b60,_0x43ff12){_0x488b60=_0x488b60-0x0;var _0x4cdd6b=_0x4bf0[_0x488b60];return _0x4cdd6b;};'use strict';var multer=require('multer');var util=require(_0x04bf('0x0'));var path=require(_0x04bf('0x1'));var timeout=require(_0x04bf('0x2'));var express=require(_0x04bf('0x3'));var router=express['Router']();var fs_extra=require(_0x04bf('0x4'));var auth=require(_0x04bf('0x5'));var interaction=require(_0x04bf('0x6'));var config=require(_0x04bf('0x7'));var controller=require(_0x04bf('0x8'));router[_0x04bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x04bf('0xa')]);router[_0x04bf('0x9')](_0x04bf('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x04bf('0xc')](),controller[_0x04bf('0xd')]);router[_0x04bf('0xe')](_0x04bf('0xb'),auth['isAuthenticated'](),controller[_0x04bf('0xf')]);router[_0x04bf('0x10')](_0x04bf('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x04bf('0x11')]=router; \ No newline at end of file +var _0x47ab=['./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x839b28,_0x3e887f){var _0x11e2e5=function(_0xdb42a0){while(--_0xdb42a0){_0x839b28['push'](_0x839b28['shift']());}};_0x11e2e5(++_0x3e887f);}(_0x47ab,0x19b));var _0xb47a=function(_0x5598f1,_0x44aaf2){_0x5598f1=_0x5598f1-0x0;var _0x137d9a=_0x47ab[_0x5598f1];return _0x137d9a;};'use strict';var multer=require(_0xb47a('0x0'));var util=require(_0xb47a('0x1'));var path=require('path');var timeout=require(_0xb47a('0x2'));var express=require('express');var router=express[_0xb47a('0x3')]();var fs_extra=require(_0xb47a('0x4'));var auth=require(_0xb47a('0x5'));var interaction=require(_0xb47a('0x6'));var config=require('../../config/environment');var controller=require(_0xb47a('0x7'));router[_0xb47a('0x8')]('/',auth[_0xb47a('0x9')](),controller['index']);router[_0xb47a('0x8')](_0xb47a('0xa'),auth[_0xb47a('0x9')](),controller[_0xb47a('0xb')]);router[_0xb47a('0xc')]('/',auth[_0xb47a('0x9')](),controller[_0xb47a('0xd')]);router[_0xb47a('0xe')]('/:id',auth[_0xb47a('0x9')](),controller[_0xb47a('0xf')]);router[_0xb47a('0x10')](_0xb47a('0xa'),auth[_0xb47a('0x9')](),controller[_0xb47a('0x11')]);module[_0xb47a('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 8502da9..cb46ab8 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 _0xb365=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xb365,0x93));var _0x5b36=function(_0x27cd5a,_0x354773){_0x27cd5a=_0x27cd5a-0x0;var _0x31c24e=_0xb365[_0x27cd5a];return _0x31c24e;};'use strict';var Sequelize=require(_0x5b36('0x0'));module[_0x5b36('0x1')]={'priority':{'type':Sequelize[_0x5b36('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5b36('0x3')],'allowNull':![],'defaultValue':_0x5b36('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5b36('0x3')]},'interval':{'type':Sequelize[_0x5b36('0x3')],'defaultValue':_0x5b36('0x5')}}; \ No newline at end of file +var _0xbb7b=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x13f035,_0x121a24){var _0x5e5717=function(_0x1df90e){while(--_0x1df90e){_0x13f035['push'](_0x13f035['shift']());}};_0x5e5717(++_0x121a24);}(_0xbb7b,0xc0));var _0xbbb7=function(_0x4fba1b,_0x28eb4c){_0x4fba1b=_0x4fba1b-0x0;var _0x3ea35a=_0xbb7b[_0x4fba1b];return _0x3ea35a;};'use strict';var Sequelize=require('sequelize');module[_0xbbb7('0x0')]={'priority':{'type':Sequelize[_0xbbb7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':![],'defaultValue':_0xbbb7('0x3')},'appdata':{'type':Sequelize[_0xbbb7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':_0xbbb7('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e55182d..ed21bc7 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 _0x9663=['sort','pick','filter','where','VIRTUAL','merge','OpenchannelApplication','includeAll','include','findAll','rows','params','rawAttributes','intersection','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x9663,0x137));var _0x3966=function(_0x18b42c,_0x2c1140){_0x18b42c=_0x18b42c-0x0;var _0x178ac0=_0x9663[_0x18b42c];return _0x178ac0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3966('0x0'));var zipdir=require(_0x3966('0x1'));var jsonpatch=require(_0x3966('0x2'));var rp=require(_0x3966('0x3'));var moment=require(_0x3966('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3966('0x5'));var path=require(_0x3966('0x6'));var sox=require(_0x3966('0x7'));var csv=require('to-csv');var ejs=require(_0x3966('0x8'));var fs=require('fs');var fs_extra=require(_0x3966('0x9'));var _=require(_0x3966('0xa'));var squel=require(_0x3966('0xb'));var crypto=require(_0x3966('0xc'));var jsforce=require(_0x3966('0xd'));var deskjs=require(_0x3966('0xe'));var toCsv=require(_0x3966('0xf'));var querystring=require(_0x3966('0x10'));var Papa=require(_0x3966('0x11'));var Redis=require('ioredis');var authService=require(_0x3966('0x12'));var qs=require(_0x3966('0x13'));var as=require(_0x3966('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3966('0x15'))('api');var utils=require(_0x3966('0x16'));var config=require(_0x3966('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3229,_0x64eb78){_0x64eb78=_0x64eb78||0xcc;return function(_0x2bb9fb){if(_0x2bb9fb){return _0x4f3229[_0x3966('0x18')](_0x64eb78);}return _0x4f3229[_0x3966('0x19')](_0x64eb78)[_0x3966('0x1a')]();};}function respondWithResult(_0x56ee0b,_0x493d1f){_0x493d1f=_0x493d1f||0xc8;return function(_0x138ad6){if(_0x138ad6){return _0x56ee0b[_0x3966('0x19')](_0x493d1f)[_0x3966('0x1b')](_0x138ad6);}};}function respondWithFilteredResult(_0x33f48e,_0x78f727){return function(_0x23fb95){if(_0x23fb95){var _0x9d8021=typeof _0x78f727[_0x3966('0x1c')]===_0x3966('0x1d')&&typeof _0x78f727[_0x3966('0x1e')]===_0x3966('0x1d');var _0x198636=_0x23fb95['count'];var _0x21aed2=_0x9d8021?0x0:_0x78f727['offset'];var _0x3ab622=_0x9d8021?_0x23fb95[_0x3966('0x1f')]:_0x78f727['offset']+_0x78f727[_0x3966('0x1e')];var _0x15b8d9;if(_0x3ab622>=_0x198636){_0x3ab622=_0x198636;_0x15b8d9=0xc8;}else{_0x15b8d9=0xce;}_0x33f48e[_0x3966('0x19')](_0x15b8d9);return _0x33f48e[_0x3966('0x20')](_0x3966('0x21'),_0x21aed2+'-'+_0x3ab622+'/'+_0x198636)[_0x3966('0x1b')](_0x23fb95);}return null;};}function patchUpdates(_0x1d800c){return function(_0x3a2f1c){try{jsonpatch[_0x3966('0x22')](_0x3a2f1c,_0x1d800c,!![]);}catch(_0x538d7e){return BPromise[_0x3966('0x23')](_0x538d7e);}return _0x3a2f1c['save']();};}function saveUpdates(_0x50978d,_0x9b8737){return function(_0x409ff2){if(_0x409ff2){return _0x409ff2[_0x3966('0x24')](_0x50978d)['then'](function(_0x50e596){return _0x50e596;});}return null;};}function removeEntity(_0x5d2e1c,_0x5e5b23){return function(_0x3a7524){if(_0x3a7524){return _0x3a7524[_0x3966('0x25')]()[_0x3966('0x26')](function(){_0x5d2e1c[_0x3966('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fdad9,_0x383f8c){return function(_0x3bcf38){if(!_0x3bcf38){_0x3fdad9[_0x3966('0x18')](0x194);}return _0x3bcf38;};}function handleError(_0x103bd9,_0xb41b01){_0xb41b01=_0xb41b01||0x1f4;return function(_0x12ec5e){logger[_0x3966('0x27')](_0x12ec5e[_0x3966('0x28')]);if(_0x12ec5e[_0x3966('0x29')]){delete _0x12ec5e['name'];}_0x103bd9[_0x3966('0x19')](_0xb41b01)[_0x3966('0x2a')](_0x12ec5e);};}exports['index']=function(_0x30da9b,_0x15e3b3){var _0x51e41f={},_0xa7e61c={},_0x4c3b50={'count':0x0,'rows':[]};var _0xc1756c=_[_0x3966('0x2b')](db['OpenchannelApplication']['rawAttributes'],function(_0x2db0fa){return{'name':_0x2db0fa[_0x3966('0x2c')],'type':_0x2db0fa[_0x3966('0x2d')]['key']};});_0xa7e61c[_0x3966('0x2e')]=_[_0x3966('0x2b')](_0xc1756c,_0x3966('0x29'));_0xa7e61c['query']=_[_0x3966('0x2f')](_0x30da9b[_0x3966('0x30')]);_0xa7e61c[_0x3966('0x31')]=_['intersection'](_0xa7e61c[_0x3966('0x2e')],_0xa7e61c[_0x3966('0x30')]);_0x51e41f[_0x3966('0x32')]=_['intersection'](_0xa7e61c[_0x3966('0x2e')],qs[_0x3966('0x33')](_0x30da9b[_0x3966('0x30')][_0x3966('0x33')]));_0x51e41f[_0x3966('0x32')]=_0x51e41f[_0x3966('0x32')][_0x3966('0x34')]?_0x51e41f[_0x3966('0x32')]:_0xa7e61c[_0x3966('0x2e')];if(!_0x30da9b[_0x3966('0x30')][_0x3966('0x35')]('nolimit')){_0x51e41f[_0x3966('0x1e')]=qs[_0x3966('0x1e')](_0x30da9b['query'][_0x3966('0x1e')]);_0x51e41f[_0x3966('0x1c')]=qs[_0x3966('0x1c')](_0x30da9b['query'][_0x3966('0x1c')]);}_0x51e41f['order']=qs[_0x3966('0x36')](_0x30da9b[_0x3966('0x30')][_0x3966('0x36')]);_0x51e41f['where']=qs['filters'](_[_0x3966('0x37')](_0x30da9b[_0x3966('0x30')],_0xa7e61c[_0x3966('0x31')]),_0xc1756c);if(_0x30da9b[_0x3966('0x30')][_0x3966('0x38')]){_0x51e41f[_0x3966('0x39')]=_['merge'](_0x51e41f['where'],{'$or':_[_0x3966('0x2b')](_0xc1756c,function(_0x35be05){if(_0x35be05[_0x3966('0x2d')]!==_0x3966('0x3a')){var _0x5b5ee8={};_0x5b5ee8[_0x35be05[_0x3966('0x29')]]={'$like':'%'+_0x30da9b['query'][_0x3966('0x38')]+'%'};return _0x5b5ee8;}})});}_0x51e41f=_[_0x3966('0x3b')]({},_0x51e41f,_0x30da9b['options']);var _0x2a1f6c={'where':_0x51e41f[_0x3966('0x39')]};return db[_0x3966('0x3c')][_0x3966('0x1f')](_0x2a1f6c)['then'](function(_0x51e468){_0x4c3b50[_0x3966('0x1f')]=_0x51e468;if(_0x30da9b[_0x3966('0x30')][_0x3966('0x3d')]){_0x51e41f[_0x3966('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3966('0x3f')](_0x51e41f);})[_0x3966('0x26')](function(_0x25edd6){_0x4c3b50[_0x3966('0x40')]=_0x25edd6;return _0x4c3b50;})[_0x3966('0x26')](respondWithFilteredResult(_0x15e3b3,_0x51e41f))['catch'](handleError(_0x15e3b3,null));};exports['show']=function(_0x45e25f,_0x198070){var _0x53e773={'raw':!![],'where':{'id':_0x45e25f[_0x3966('0x41')]['id']}},_0x20c6d7={};_0x20c6d7[_0x3966('0x2e')]=_[_0x3966('0x2f')](db[_0x3966('0x3c')][_0x3966('0x42')]);_0x20c6d7[_0x3966('0x30')]=_['keys'](_0x45e25f['query']);_0x20c6d7[_0x3966('0x31')]=_[_0x3966('0x43')](_0x20c6d7[_0x3966('0x2e')],_0x20c6d7['query']);_0x53e773[_0x3966('0x32')]=_[_0x3966('0x43')](_0x20c6d7[_0x3966('0x2e')],qs[_0x3966('0x33')](_0x45e25f[_0x3966('0x30')][_0x3966('0x33')]));_0x53e773[_0x3966('0x32')]=_0x53e773[_0x3966('0x32')]['length']?_0x53e773[_0x3966('0x32')]:_0x20c6d7[_0x3966('0x2e')];if(_0x45e25f['query']['includeAll']){_0x53e773['include']=[{'all':!![]}];}_0x53e773=_[_0x3966('0x3b')]({},_0x53e773,_0x45e25f[_0x3966('0x44')]);return db[_0x3966('0x3c')][_0x3966('0x45')](_0x53e773)[_0x3966('0x26')](handleEntityNotFound(_0x198070,null))[_0x3966('0x26')](respondWithResult(_0x198070,null))[_0x3966('0x46')](handleError(_0x198070,null));};exports[_0x3966('0x47')]=function(_0x2122d4,_0x1105b9){return db['OpenchannelApplication']['create'](_0x2122d4[_0x3966('0x48')],{})[_0x3966('0x26')](respondWithResult(_0x1105b9,0xc9))['catch'](handleError(_0x1105b9,null));};exports[_0x3966('0x24')]=function(_0x2d04d2,_0x5ee2df){if(_0x2d04d2[_0x3966('0x48')]['id']){delete _0x2d04d2[_0x3966('0x48')]['id'];}return db[_0x3966('0x3c')][_0x3966('0x45')]({'where':{'id':_0x2d04d2[_0x3966('0x41')]['id']}})[_0x3966('0x26')](handleEntityNotFound(_0x5ee2df,null))[_0x3966('0x26')](saveUpdates(_0x2d04d2[_0x3966('0x48')],null))[_0x3966('0x26')](respondWithResult(_0x5ee2df,null))[_0x3966('0x46')](handleError(_0x5ee2df,null));};exports[_0x3966('0x25')]=function(_0x549977,_0x45db78){return db[_0x3966('0x3c')]['find']({'where':{'id':_0x549977[_0x3966('0x41')]['id']}})[_0x3966('0x26')](handleEntityNotFound(_0x45db78,null))['then'](removeEntity(_0x45db78,null))[_0x3966('0x46')](handleError(_0x45db78,null));}; \ No newline at end of file +var _0x04ff=['send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name'];(function(_0x382189,_0x4c38a9){var _0x36f350=function(_0x13e6a9){while(--_0x13e6a9){_0x382189['push'](_0x382189['shift']());}};_0x36f350(++_0x4c38a9);}(_0x04ff,0x115));var _0xf04f=function(_0x455556,_0x2e71de){_0x455556=_0x455556-0x0;var _0x52c6b8=_0x04ff[_0x455556];return _0x52c6b8;};'use strict';var emlformat=require(_0xf04f('0x0'));var rimraf=require(_0xf04f('0x1'));var zipdir=require(_0xf04f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf04f('0x3'));var moment=require(_0xf04f('0x4'));var BPromise=require(_0xf04f('0x5'));var Mustache=require(_0xf04f('0x6'));var util=require(_0xf04f('0x7'));var path=require(_0xf04f('0x8'));var sox=require('sox');var csv=require(_0xf04f('0x9'));var ejs=require(_0xf04f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf04f('0xb'));var squel=require(_0xf04f('0xc'));var crypto=require(_0xf04f('0xd'));var jsforce=require(_0xf04f('0xe'));var deskjs=require(_0xf04f('0xf'));var toCsv=require(_0xf04f('0x9'));var querystring=require(_0xf04f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf04f('0x11'));var qs=require(_0xf04f('0x12'));var as=require(_0xf04f('0x13'));var hardwareService=require(_0xf04f('0x14'));var logger=require(_0xf04f('0x15'))(_0xf04f('0x16'));var utils=require('../../config/utils');var config=require(_0xf04f('0x17'));var licenseUtil=require(_0xf04f('0x18'));var db=require(_0xf04f('0x19'))['db'];function respondWithStatusCode(_0x43e3c2,_0x25f3a9){_0x25f3a9=_0x25f3a9||0xcc;return function(_0x1d0067){if(_0x1d0067){return _0x43e3c2[_0xf04f('0x1a')](_0x25f3a9);}return _0x43e3c2[_0xf04f('0x1b')](_0x25f3a9)[_0xf04f('0x1c')]();};}function respondWithResult(_0x58638c,_0x441f0c){_0x441f0c=_0x441f0c||0xc8;return function(_0x22dfc5){if(_0x22dfc5){return _0x58638c[_0xf04f('0x1b')](_0x441f0c)[_0xf04f('0x1d')](_0x22dfc5);}};}function respondWithFilteredResult(_0x1d9d89,_0x1bc9bf){return function(_0x18834f){if(_0x18834f){var _0x4aa96e=typeof _0x1bc9bf[_0xf04f('0x1e')]===_0xf04f('0x1f')&&typeof _0x1bc9bf[_0xf04f('0x20')]===_0xf04f('0x1f');var _0x2afebf=_0x18834f[_0xf04f('0x21')];var _0xc3e206=_0x4aa96e?0x0:_0x1bc9bf[_0xf04f('0x1e')];var _0x4d5234=_0x4aa96e?_0x18834f[_0xf04f('0x21')]:_0x1bc9bf['offset']+_0x1bc9bf[_0xf04f('0x20')];var _0x2efd48;if(_0x4d5234>=_0x2afebf){_0x4d5234=_0x2afebf;_0x2efd48=0xc8;}else{_0x2efd48=0xce;}_0x1d9d89[_0xf04f('0x1b')](_0x2efd48);return _0x1d9d89[_0xf04f('0x22')](_0xf04f('0x23'),_0xc3e206+'-'+_0x4d5234+'/'+_0x2afebf)[_0xf04f('0x1d')](_0x18834f);}return null;};}function patchUpdates(_0x4f6f19){return function(_0x151a0f){try{jsonpatch[_0xf04f('0x24')](_0x151a0f,_0x4f6f19,!![]);}catch(_0x22d2a8){return BPromise['reject'](_0x22d2a8);}return _0x151a0f[_0xf04f('0x25')]();};}function saveUpdates(_0x12ca05,_0x46d9d2){return function(_0x174ba4){if(_0x174ba4){return _0x174ba4[_0xf04f('0x26')](_0x12ca05)[_0xf04f('0x27')](function(_0xdbc164){return _0xdbc164;});}return null;};}function removeEntity(_0x59c8c3,_0x12721f){return function(_0x3d505b){if(_0x3d505b){return _0x3d505b['destroy']()[_0xf04f('0x27')](function(){_0x59c8c3[_0xf04f('0x1b')](0xcc)[_0xf04f('0x1c')]();});}};}function handleEntityNotFound(_0x3bee6f,_0x3a1ed3){return function(_0x36bdf7){if(!_0x36bdf7){_0x3bee6f[_0xf04f('0x1a')](0x194);}return _0x36bdf7;};}function handleError(_0x50c457,_0x3c879f){_0x3c879f=_0x3c879f||0x1f4;return function(_0x49f577){logger[_0xf04f('0x28')](_0x49f577[_0xf04f('0x29')]);if(_0x49f577[_0xf04f('0x2a')]){delete _0x49f577[_0xf04f('0x2a')];}_0x50c457[_0xf04f('0x1b')](_0x3c879f)[_0xf04f('0x2b')](_0x49f577);};}exports[_0xf04f('0x2c')]=function(_0x44d697,_0x213e63){var _0x243cd5={},_0xad5e2b={},_0x4f4479={'count':0x0,'rows':[]};var _0x56f77b=_[_0xf04f('0x2d')](db[_0xf04f('0x2e')][_0xf04f('0x2f')],function(_0x192d28){return{'name':_0x192d28[_0xf04f('0x30')],'type':_0x192d28[_0xf04f('0x31')][_0xf04f('0x32')]};});_0xad5e2b[_0xf04f('0x33')]=_['map'](_0x56f77b,_0xf04f('0x2a'));_0xad5e2b[_0xf04f('0x34')]=_[_0xf04f('0x35')](_0x44d697[_0xf04f('0x34')]);_0xad5e2b[_0xf04f('0x36')]=_[_0xf04f('0x37')](_0xad5e2b[_0xf04f('0x33')],_0xad5e2b[_0xf04f('0x34')]);_0x243cd5[_0xf04f('0x38')]=_['intersection'](_0xad5e2b[_0xf04f('0x33')],qs[_0xf04f('0x39')](_0x44d697[_0xf04f('0x34')]['fields']));_0x243cd5[_0xf04f('0x38')]=_0x243cd5['attributes'][_0xf04f('0x3a')]?_0x243cd5[_0xf04f('0x38')]:_0xad5e2b[_0xf04f('0x33')];if(!_0x44d697[_0xf04f('0x34')][_0xf04f('0x3b')](_0xf04f('0x3c'))){_0x243cd5[_0xf04f('0x20')]=qs[_0xf04f('0x20')](_0x44d697[_0xf04f('0x34')][_0xf04f('0x20')]);_0x243cd5[_0xf04f('0x1e')]=qs[_0xf04f('0x1e')](_0x44d697['query']['offset']);}_0x243cd5[_0xf04f('0x3d')]=qs['sort'](_0x44d697[_0xf04f('0x34')][_0xf04f('0x3e')]);_0x243cd5[_0xf04f('0x3f')]=qs[_0xf04f('0x36')](_[_0xf04f('0x40')](_0x44d697[_0xf04f('0x34')],_0xad5e2b[_0xf04f('0x36')]),_0x56f77b);if(_0x44d697[_0xf04f('0x34')]['filter']){_0x243cd5['where']=_[_0xf04f('0x41')](_0x243cd5[_0xf04f('0x3f')],{'$or':_[_0xf04f('0x2d')](_0x56f77b,function(_0x5814d3){if(_0x5814d3[_0xf04f('0x31')]!==_0xf04f('0x42')){var _0x3e2c5a={};_0x3e2c5a[_0x5814d3['name']]={'$like':'%'+_0x44d697[_0xf04f('0x34')][_0xf04f('0x43')]+'%'};return _0x3e2c5a;}})});}_0x243cd5=_[_0xf04f('0x41')]({},_0x243cd5,_0x44d697[_0xf04f('0x44')]);var _0x57ec00={'where':_0x243cd5[_0xf04f('0x3f')]};return db[_0xf04f('0x2e')][_0xf04f('0x21')](_0x57ec00)['then'](function(_0x5137f9){_0x4f4479[_0xf04f('0x21')]=_0x5137f9;if(_0x44d697[_0xf04f('0x34')][_0xf04f('0x45')]){_0x243cd5['include']=[{'all':!![]}];}return db[_0xf04f('0x2e')][_0xf04f('0x46')](_0x243cd5);})[_0xf04f('0x27')](function(_0x1fb05d){_0x4f4479[_0xf04f('0x47')]=_0x1fb05d;return _0x4f4479;})['then'](respondWithFilteredResult(_0x213e63,_0x243cd5))[_0xf04f('0x48')](handleError(_0x213e63,null));};exports[_0xf04f('0x49')]=function(_0x307ab5,_0x3119bd){var _0x3c2750={'raw':!![],'where':{'id':_0x307ab5[_0xf04f('0x4a')]['id']}},_0x5f13d6={};_0x5f13d6[_0xf04f('0x33')]=_[_0xf04f('0x35')](db['OpenchannelApplication'][_0xf04f('0x2f')]);_0x5f13d6[_0xf04f('0x34')]=_['keys'](_0x307ab5[_0xf04f('0x34')]);_0x5f13d6[_0xf04f('0x36')]=_[_0xf04f('0x37')](_0x5f13d6['model'],_0x5f13d6[_0xf04f('0x34')]);_0x3c2750['attributes']=_[_0xf04f('0x37')](_0x5f13d6[_0xf04f('0x33')],qs[_0xf04f('0x39')](_0x307ab5[_0xf04f('0x34')][_0xf04f('0x39')]));_0x3c2750['attributes']=_0x3c2750['attributes'][_0xf04f('0x3a')]?_0x3c2750[_0xf04f('0x38')]:_0x5f13d6[_0xf04f('0x33')];if(_0x307ab5[_0xf04f('0x34')][_0xf04f('0x45')]){_0x3c2750[_0xf04f('0x4b')]=[{'all':!![]}];}_0x3c2750=_[_0xf04f('0x41')]({},_0x3c2750,_0x307ab5[_0xf04f('0x44')]);return db['OpenchannelApplication'][_0xf04f('0x4c')](_0x3c2750)[_0xf04f('0x27')](handleEntityNotFound(_0x3119bd,null))[_0xf04f('0x27')](respondWithResult(_0x3119bd,null))[_0xf04f('0x48')](handleError(_0x3119bd,null));};exports[_0xf04f('0x4d')]=function(_0x2a3960,_0x458ac4){return db['OpenchannelApplication'][_0xf04f('0x4d')](_0x2a3960[_0xf04f('0x4e')],{})['then'](respondWithResult(_0x458ac4,0xc9))[_0xf04f('0x48')](handleError(_0x458ac4,null));};exports[_0xf04f('0x26')]=function(_0x2208c1,_0x42b4b0){if(_0x2208c1[_0xf04f('0x4e')]['id']){delete _0x2208c1[_0xf04f('0x4e')]['id'];}return db[_0xf04f('0x2e')][_0xf04f('0x4c')]({'where':{'id':_0x2208c1[_0xf04f('0x4a')]['id']}})[_0xf04f('0x27')](handleEntityNotFound(_0x42b4b0,null))[_0xf04f('0x27')](saveUpdates(_0x2208c1['body'],null))[_0xf04f('0x27')](respondWithResult(_0x42b4b0,null))[_0xf04f('0x48')](handleError(_0x42b4b0,null));};exports[_0xf04f('0x4f')]=function(_0x25d417,_0xfb01c1){return db[_0xf04f('0x2e')][_0xf04f('0x4c')]({'where':{'id':_0x25d417[_0xf04f('0x4a')]['id']}})[_0xf04f('0x27')](handleEntityNotFound(_0xfb01c1,null))['then'](removeEntity(_0xfb01c1,null))[_0xf04f('0x48')](handleError(_0xfb01c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 295d8b0..64c75bb 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 _0xfde3=['path','rimraf','../../config/environment','./openchannelApplication.attributes','define','openchannel_applications','../../config/logger','moment','bluebird','request-promise'];(function(_0x1c429b,_0xc14315){var _0x136d79=function(_0x4a1b42){while(--_0x4a1b42){_0x1c429b['push'](_0x1c429b['shift']());}};_0x136d79(++_0xc14315);}(_0xfde3,0xba));var _0x3fde=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xfde3[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fde('0x0'))('api');var moment=require(_0x3fde('0x1'));var BPromise=require(_0x3fde('0x2'));var rp=require(_0x3fde('0x3'));var fs=require('fs');var path=require(_0x3fde('0x4'));var rimraf=require(_0x3fde('0x5'));var config=require(_0x3fde('0x6'));var attributes=require(_0x3fde('0x7'));module['exports']=function(_0x4c6459,_0x10f6e4){return _0x4c6459[_0x3fde('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x3fde('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4ebb=['./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x1fa722,_0x6d53ef){var _0x57eab2=function(_0x1b1b24){while(--_0x1b1b24){_0x1fa722['push'](_0x1fa722['shift']());}};_0x57eab2(++_0x6d53ef);}(_0x4ebb,0x9a));var _0xb4eb=function(_0x272cfd,_0x589216){_0x272cfd=_0x272cfd-0x0;var _0x2c283d=_0x4ebb[_0x272cfd];return _0x2c283d;};'use strict';var _=require(_0xb4eb('0x0'));var util=require(_0xb4eb('0x1'));var logger=require(_0xb4eb('0x2'))('api');var moment=require(_0xb4eb('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4eb('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4eb('0x6'));module['exports']=function(_0x59da56,_0x2e4e78){return _0x59da56[_0xb4eb('0x7')]('OpenchannelApplication',attributes,{'tableName':_0xb4eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4eb('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index eafbe83..2f94dcb 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 _0xc187=['../../config/utils','rpc','jayson/promise','http','then','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x452d2a,_0x9c7acc){var _0x3686ca=function(_0x254d6d){while(--_0x254d6d){_0x452d2a['push'](_0x452d2a['shift']());}};_0x3686ca(++_0x9c7acc);}(_0xc187,0x11c));var _0x7c18=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xc187[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x7c18('0x0'));var util=require(_0x7c18('0x1'));var moment=require(_0x7c18('0x2'));var BPromise=require(_0x7c18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c18('0x4'));var db=require(_0x7c18('0x5'))['db'];var utils=require(_0x7c18('0x6'));var logger=require('../../config/logger')(_0x7c18('0x7'));var config=require('../../config/environment');var jayson=require(_0x7c18('0x8'));var client=jayson['client'][_0x7c18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x534457,_0x3fbe41,_0x351a09){return new BPromise(function(_0x405a23,_0x374a9d){return client['request'](_0x534457,_0x351a09)[_0x7c18('0xa')](function(_0x238e18){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x3fbe41,'request\x20sent');logger[_0x7c18('0xb')](_0x7c18('0xc'),_0x3fbe41,_0x7c18('0xd'),JSON[_0x7c18('0xe')](_0x238e18));if(_0x238e18['error']){if(_0x238e18[_0x7c18('0xf')][_0x7c18('0x10')]===0x1f4){logger[_0x7c18('0xf')](_0x7c18('0x11'),_0x3fbe41,_0x238e18[_0x7c18('0xf')][_0x7c18('0x12')]);return _0x374a9d(_0x238e18[_0x7c18('0xf')]['message']);}logger['error'](_0x7c18('0x11'),_0x3fbe41,_0x238e18[_0x7c18('0xf')]['message']);return _0x405a23(_0x238e18[_0x7c18('0xf')][_0x7c18('0x12')]);}else{logger[_0x7c18('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x3fbe41,'request\x20sent');_0x405a23(_0x238e18[_0x7c18('0x14')][_0x7c18('0x12')]);}})[_0x7c18('0x15')](function(_0x2380c4){logger[_0x7c18('0xf')](_0x7c18('0x11'),_0x3fbe41,_0x2380c4);_0x374a9d(_0x2380c4);});});}exports[_0x7c18('0x16')]=function(_0x2da6cf){var _0x1c7fc3=this;return new Promise(function(_0x44fc4b,_0x36006b){return db[_0x7c18('0x17')][_0x7c18('0x18')](_0x2da6cf[_0x7c18('0x19')],{'raw':_0x2da6cf[_0x7c18('0x1a')]?_0x2da6cf[_0x7c18('0x1a')][_0x7c18('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da6cf[_0x7c18('0x1a')]?_0x2da6cf[_0x7c18('0x1a')][_0x7c18('0x1c')]||null:null,'attributes':_0x2da6cf['options']?_0x2da6cf[_0x7c18('0x1a')]['attributes']||null:null,'limit':_0x2da6cf[_0x7c18('0x1a')]?_0x2da6cf[_0x7c18('0x1a')]['limit']||null:null})[_0x7c18('0xa')](function(_0x573654){logger[_0x7c18('0x13')](_0x7c18('0x16'),_0x2da6cf);logger[_0x7c18('0xb')](_0x7c18('0x16'),_0x2da6cf,JSON[_0x7c18('0xe')](_0x573654));_0x44fc4b(_0x573654);})['catch'](function(_0x54f4cf){logger[_0x7c18('0xf')](_0x7c18('0x16'),_0x54f4cf[_0x7c18('0x12')],_0x2da6cf);_0x36006b(_0x1c7fc3[_0x7c18('0xf')](0x1f4,_0x54f4cf['message']));});});}; \ No newline at end of file +var _0x8ed5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x292037,_0x442f7c){var _0x4bd506=function(_0x2c73ce){while(--_0x2c73ce){_0x292037['push'](_0x292037['shift']());}};_0x4bd506(++_0x442f7c);}(_0x8ed5,0xa1));var _0x58ed=function(_0x570d76,_0x2c471c){_0x570d76=_0x570d76-0x0;var _0x11b012=_0x8ed5[_0x570d76];return _0x11b012;};'use strict';var _=require(_0x58ed('0x0'));var util=require(_0x58ed('0x1'));var moment=require(_0x58ed('0x2'));var BPromise=require(_0x58ed('0x3'));var rs=require(_0x58ed('0x4'));var fs=require('fs');var Redis=require(_0x58ed('0x5'));var db=require(_0x58ed('0x6'))['db'];var utils=require(_0x58ed('0x7'));var logger=require(_0x58ed('0x8'))(_0x58ed('0x9'));var config=require(_0x58ed('0xa'));var jayson=require(_0x58ed('0xb'));var client=jayson[_0x58ed('0xc')][_0x58ed('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d856c,_0x455226,_0x263253){return new BPromise(function(_0x4a5497,_0x1ebe34){return client[_0x58ed('0xe')](_0x4d856c,_0x263253)['then'](function(_0x5ab89e){logger['info'](_0x58ed('0xf'),_0x455226,'request\x20sent');logger[_0x58ed('0x10')](_0x58ed('0x11'),_0x455226,_0x58ed('0x12'),JSON[_0x58ed('0x13')](_0x5ab89e));if(_0x5ab89e['error']){if(_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x15')]===0x1f4){logger['error'](_0x58ed('0xf'),_0x455226,_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x16')]);return _0x1ebe34(_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x16')]);}logger[_0x58ed('0x14')](_0x58ed('0xf'),_0x455226,_0x5ab89e['error'][_0x58ed('0x16')]);return _0x4a5497(_0x5ab89e[_0x58ed('0x14')]['message']);}else{logger[_0x58ed('0x17')]('OpenchannelApplication,\x20%s,\x20%s',_0x455226,_0x58ed('0x12'));_0x4a5497(_0x5ab89e[_0x58ed('0x18')][_0x58ed('0x16')]);}})[_0x58ed('0x19')](function(_0x5742b8){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x455226,_0x5742b8);_0x1ebe34(_0x5742b8);});});}exports[_0x58ed('0x1a')]=function(_0xbd0a19){var _0x14a85e=this;return new Promise(function(_0x484b09,_0x386ba6){return db['OpenchannelApplication']['update'](_0xbd0a19[_0x58ed('0x1b')],{'raw':_0xbd0a19[_0x58ed('0x1c')]?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd0a19['options']?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1e')]||null:null,'attributes':_0xbd0a19['options']?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1f')]||null:null,'limit':_0xbd0a19[_0x58ed('0x1c')]?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x20')]||null:null})['then'](function(_0x3f69e4){logger[_0x58ed('0x17')](_0x58ed('0x1a'),_0xbd0a19);logger[_0x58ed('0x10')](_0x58ed('0x1a'),_0xbd0a19,JSON[_0x58ed('0x13')](_0x3f69e4));_0x484b09(_0x3f69e4);})[_0x58ed('0x19')](function(_0x7f723a){logger[_0x58ed('0x14')](_0x58ed('0x1a'),_0x7f723a['message'],_0xbd0a19);_0x386ba6(_0x14a85e['error'](0x1f4,_0x7f723a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f356d1c..a801a51 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 _0xa34b=['fs-extra','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','get','describe','/:id','show','/:id/messages','download','post','/:id/tags','tracked','addTags','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa34b,0xdb));var _0xba34=function(_0x1e0f26,_0x5c07eb){_0x1e0f26=_0x1e0f26-0x0;var _0x457cc5=_0xa34b[_0x1e0f26];return _0x457cc5;};'use strict';var multer=require(_0xba34('0x0'));var util=require(_0xba34('0x1'));var path=require('path');var timeout=require(_0xba34('0x2'));var express=require(_0xba34('0x3'));var router=express[_0xba34('0x4')]();var fs_extra=require(_0xba34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba34('0x6'));var config=require('../../config/environment');var controller=require(_0xba34('0x7'));router['get']('/',auth[_0xba34('0x8')](),controller['index']);router[_0xba34('0x9')]('/describe',auth[_0xba34('0x8')](),controller[_0xba34('0xa')]);router['get'](_0xba34('0xb'),auth[_0xba34('0x8')](),controller[_0xba34('0xc')]);router['get'](_0xba34('0xd'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xba34('0xe')]);router[_0xba34('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xba34('0xf')](_0xba34('0xd'),auth[_0xba34('0x8')](),controller['addMessage']);router['post'](_0xba34('0x10'),auth[_0xba34('0x8')](),interaction[_0xba34('0x11')]('openchannel','openchannelinteraction:addtags'),controller[_0xba34('0x12')]);router[_0xba34('0x13')]('/:id',auth[_0xba34('0x8')](),interaction[_0xba34('0x11')](_0xba34('0x14'),_0xba34('0x15')),controller[_0xba34('0x16')]);router[_0xba34('0x17')](_0xba34('0xb'),auth[_0xba34('0x8')](),interaction[_0xba34('0x11')](_0xba34('0x14'),_0xba34('0x18')),controller[_0xba34('0x19')]);router[_0xba34('0x17')](_0xba34('0x10'),auth['isAuthenticated'](),controller[_0xba34('0x1a')]);module[_0xba34('0x1b')]=router; \ No newline at end of file +var _0xe50b=['addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','openchannelinteraction:destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe50b,0x103));var _0xbe50=function(_0x173003,_0x51bfb4){_0x173003=_0x173003-0x0;var _0x593b55=_0xe50b[_0x173003];return _0x593b55;};'use strict';var multer=require(_0xbe50('0x0'));var util=require(_0xbe50('0x1'));var path=require('path');var timeout=require(_0xbe50('0x2'));var express=require(_0xbe50('0x3'));var router=express[_0xbe50('0x4')]();var fs_extra=require(_0xbe50('0x5'));var auth=require(_0xbe50('0x6'));var interaction=require(_0xbe50('0x7'));var config=require(_0xbe50('0x8'));var controller=require(_0xbe50('0x9'));router[_0xbe50('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbe50('0xa')]('/describe',auth[_0xbe50('0xb')](),controller[_0xbe50('0xc')]);router[_0xbe50('0xa')](_0xbe50('0xd'),auth['isAuthenticated'](),controller[_0xbe50('0xe')]);router[_0xbe50('0xa')](_0xbe50('0xf'),auth[_0xbe50('0xb')](),controller[_0xbe50('0x10')]);router['get'](_0xbe50('0x11'),auth['isAuthenticated'](),controller['download']);router[_0xbe50('0x12')]('/',auth[_0xbe50('0xb')](),controller[_0xbe50('0x13')]);router[_0xbe50('0x12')](_0xbe50('0xf'),auth[_0xbe50('0xb')](),controller[_0xbe50('0x14')]);router[_0xbe50('0x12')](_0xbe50('0x15'),auth[_0xbe50('0xb')](),interaction[_0xbe50('0x16')](_0xbe50('0x17'),_0xbe50('0x18')),controller[_0xbe50('0x19')]);router[_0xbe50('0x1a')](_0xbe50('0xd'),auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:update'),controller[_0xbe50('0x1b')]);router['delete'](_0xbe50('0xd'),auth['isAuthenticated'](),interaction[_0xbe50('0x16')](_0xbe50('0x17'),_0xbe50('0x1c')),controller['destroy']);router[_0xbe50('0x1d')]('/:id/tags',auth[_0xbe50('0xb')](),controller[_0xbe50('0x1e')]);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 d2fd182..1de4e60 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 _0x4b68=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x4b68,0x129));var _0x84b6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4b68[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x84b6('0x0'));module[_0x84b6('0x1')]={'closed':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x84b6('0x3')]},'disposition':{'type':Sequelize[_0x84b6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x84b6('0x4')]},'note':{'type':Sequelize[_0x84b6('0x4')]},'read1stAt':{'type':Sequelize[_0x84b6('0x3')]},'threadId':{'type':Sequelize[_0x84b6('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x84b6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x84b6('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x84b6('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9ff7=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x21d383,_0x71056d){var _0x3ea4a5=function(_0x233120){while(--_0x233120){_0x21d383['push'](_0x21d383['shift']());}};_0x3ea4a5(++_0x71056d);}(_0x9ff7,0x8c));var _0x79ff=function(_0x1306dd,_0x51547f){_0x1306dd=_0x1306dd-0x0;var _0x550bd9=_0x9ff7[_0x1306dd];return _0x550bd9;};'use strict';var Sequelize=require(_0x79ff('0x0'));module[_0x79ff('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x79ff('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x79ff('0x3')]},'thirdDisposition':{'type':Sequelize[_0x79ff('0x3')]},'note':{'type':Sequelize[_0x79ff('0x3')]},'read1stAt':{'type':Sequelize[_0x79ff('0x2')]},'threadId':{'type':Sequelize[_0x79ff('0x3')]},'externalUrl':{'type':Sequelize[_0x79ff('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x79ff('0x4')]('in',_0x79ff('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index d2cd46f..2622556 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 _0x4141=['getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','push','all','rows','params','includeAll','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','rawAttributes','merge','include','findAll','addTags','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','Attachment','direction','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','basename','createReadStream','pipe','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','catch','index','OpenchannelInteraction','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','UserId','text','body','keys','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role'];(function(_0x2eb790,_0x13fbe9){var _0x310fc7=function(_0x5eb3d6){while(--_0x5eb3d6){_0x2eb790['push'](_0x2eb790['shift']());}};_0x310fc7(++_0x13fbe9);}(_0x4141,0x147));var _0x1414=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4141[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x1414('0x0'));var rimraf=require(_0x1414('0x1'));var zipdir=require(_0x1414('0x2'));var jsonpatch=require(_0x1414('0x3'));var rp=require(_0x1414('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1414('0x5'));var path=require(_0x1414('0x6'));var sox=require(_0x1414('0x7'));var csv=require(_0x1414('0x8'));var ejs=require(_0x1414('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1414('0xa'));var squel=require(_0x1414('0xb'));var crypto=require(_0x1414('0xc'));var jsforce=require(_0x1414('0xd'));var deskjs=require(_0x1414('0xe'));var toCsv=require(_0x1414('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1414('0xf'));var authService=require(_0x1414('0x10'));var qs=require(_0x1414('0x11'));var as=require(_0x1414('0x12'));var pdf=require(_0x1414('0x13'));var hardwareService=require(_0x1414('0x14'));var logger=require(_0x1414('0x15'))(_0x1414('0x16'));var utils=require('../../config/utils');var config=require(_0x1414('0x17'));var licenseUtil=require(_0x1414('0x18'));var db=require(_0x1414('0x19'))['db'];config[_0x1414('0x1a')]=_[_0x1414('0x1b')](config[_0x1414('0x1a')],{'host':_0x1414('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1414('0x1a')]));require(_0x1414('0x1d'))['register'](socket);function respondWithStatusCode(_0x1ceb82,_0x5c41b7){_0x5c41b7=_0x5c41b7||0xcc;return function(_0x5ddd9b){if(_0x5ddd9b){return _0x1ceb82[_0x1414('0x1e')](_0x5c41b7);}return _0x1ceb82[_0x1414('0x1f')](_0x5c41b7)[_0x1414('0x20')]();};}function respondWithResult(_0x5f24b0,_0x21a10d){_0x21a10d=_0x21a10d||0xc8;return function(_0x279879){if(_0x279879){return _0x5f24b0[_0x1414('0x1f')](_0x21a10d)[_0x1414('0x21')](_0x279879);}};}function respondWithFilteredResult(_0x26b666,_0x21527b){return function(_0x26c0bd){if(_0x26c0bd){var _0x4b15c7=typeof _0x21527b[_0x1414('0x22')]===_0x1414('0x23')&&typeof _0x21527b[_0x1414('0x24')]==='undefined';var _0x358a84=_0x26c0bd[_0x1414('0x25')];var _0x3f957d=_0x4b15c7?0x0:_0x21527b[_0x1414('0x22')];var _0x1528ab=_0x4b15c7?_0x26c0bd[_0x1414('0x25')]:_0x21527b['offset']+_0x21527b['limit'];var _0x384235;if(_0x1528ab>=_0x358a84){_0x1528ab=_0x358a84;_0x384235=0xc8;}else{_0x384235=0xce;}_0x26b666[_0x1414('0x1f')](_0x384235);return _0x26b666['set'](_0x1414('0x26'),_0x3f957d+'-'+_0x1528ab+'/'+_0x358a84)[_0x1414('0x21')](_0x26c0bd);}return null;};}function patchUpdates(_0x406adc){return function(_0x148c47){try{jsonpatch[_0x1414('0x27')](_0x148c47,_0x406adc,!![]);}catch(_0x157111){return BPromise[_0x1414('0x28')](_0x157111);}return _0x148c47[_0x1414('0x29')]();};}function saveUpdates(_0x387352,_0xa41340){return function(_0x57c7a1){if(_0x57c7a1){return _0x57c7a1[_0x1414('0x2a')](_0x387352)[_0x1414('0x2b')](function(_0xdde3a7){return _0xdde3a7;});}return null;};}function removeEntity(_0x1071ec,_0x21e833){return function(_0x321bd4){if(_0x321bd4){return _0x321bd4[_0x1414('0x2c')]()[_0x1414('0x2b')](function(){_0x1071ec[_0x1414('0x1f')](0xcc)[_0x1414('0x20')]();});}};}function handleEntityNotFound(_0x4ac1ba,_0xfed8cd){return function(_0x2e28f4){if(!_0x2e28f4){_0x4ac1ba[_0x1414('0x1e')](0x194);}return _0x2e28f4;};}function handleError(_0x41b2e3,_0x580ab9){_0x580ab9=_0x580ab9||0x1f4;return function(_0x56b467){logger[_0x1414('0x2d')](_0x56b467[_0x1414('0x2e')]);if(_0x56b467[_0x1414('0x2f')]){delete _0x56b467[_0x1414('0x2f')];}_0x41b2e3[_0x1414('0x1f')](_0x580ab9)[_0x1414('0x30')](_0x56b467);};}function getInteractionUsers(_0x131d53,_0x3bd3e8){return new BPromise(function(_0x6a1b63,_0x1b8d62){try{if(_0x3bd3e8[_0x131d53['id']]){_0x131d53[_0x1414('0x31')]=_[_0x1414('0x32')](_0x3bd3e8[_0x131d53['id']],function(_0x29a911){return{'id':_0x29a911['id'],'fullname':_0x29a911[_0x1414('0x33')]};});}}catch(_0x198477){_0x1b8d62(_0x198477);}_0x6a1b63(_0x131d53);});}function getInteractionTags(_0x333d82,_0x477048){return new BPromise(function(_0xcf4de3,_0x3187a4){try{if(_0x333d82[_0x1414('0x34')]){_0x333d82['Tags']=[];_0x333d82[_0x1414('0x34')]['split'](',')['forEach'](function(_0x53c35a){_0x333d82[_0x1414('0x35')]['push'](_0x477048[_0x53c35a]);});}delete _0x333d82[_0x1414('0x34')];}catch(_0x5e49ac){_0x3187a4(_0x5e49ac);}_0xcf4de3(_0x333d82);});}function updateOpenchannelInteraction(_0x247979,_0xcbd6a4,_0x19dc13){return new BPromise(function(_0x19181c,_0x5b2159){return getInteractionUsers(_0x247979,_0x19dc13)[_0x1414('0x2b')](function(_0x500ae6){return getInteractionTags(_0x500ae6,_0xcbd6a4);})[_0x1414('0x2b')](function(_0x506eff){_0x19181c(_0x506eff);})[_0x1414('0x36')](function(_0x214710){_0x5b2159(_0x214710);});});}exports[_0x1414('0x37')]=function(_0x1d70c5,_0x332dfc){var _0x180ed9={},_0x1833c7={},_0x24114d={'count':0x0,'rows':[]};var _0x5770ea=_['map'](db[_0x1414('0x38')]['rawAttributes'],function(_0x411ca3){return{'name':_0x411ca3[_0x1414('0x39')],'type':_0x411ca3[_0x1414('0x3a')][_0x1414('0x3b')]};});_0x1833c7['model']=_[_0x1414('0x32')](_0x5770ea,_0x1414('0x2f'));_0x1833c7[_0x1414('0x3c')]=_['keys'](_0x1d70c5['query']);_0x1833c7[_0x1414('0x3d')]=_[_0x1414('0x3e')](_0x1833c7['model'],_0x1833c7[_0x1414('0x3c')]);_0x180ed9['attributes']=_['intersection'](_0x1833c7['model'],qs[_0x1414('0x3f')](_0x1d70c5[_0x1414('0x3c')]['fields']));_0x180ed9[_0x1414('0x40')]=_0x180ed9[_0x1414('0x40')][_0x1414('0x41')]?_0x180ed9[_0x1414('0x40')]:_0x1833c7[_0x1414('0x42')];if(!_0x1d70c5[_0x1414('0x3c')][_0x1414('0x43')](_0x1414('0x44'))){_0x180ed9[_0x1414('0x24')]=qs[_0x1414('0x24')](_0x1d70c5['query'][_0x1414('0x24')]);_0x180ed9[_0x1414('0x22')]=qs[_0x1414('0x22')](_0x1d70c5[_0x1414('0x3c')][_0x1414('0x22')]);}_0x180ed9[_0x1414('0x45')]=qs[_0x1414('0x46')](_0x1d70c5[_0x1414('0x3c')][_0x1414('0x46')]);_0x180ed9['where']=qs[_0x1414('0x3d')](_[_0x1414('0x47')](_0x1d70c5['query'],_0x1833c7[_0x1414('0x3d')]),_0x5770ea);var _0x49f4da=[];var _0x2bb177=squel[_0x1414('0x48')]()[_0x1414('0x49')]('id')[_0x1414('0x49')]('name')[_0x1414('0x49')](_0x1414('0x4a'))[_0x1414('0x4b')](_0x1414('0x4c'));var _0x210a20=squel[_0x1414('0x48')]()[_0x1414('0x49')](_0x1414('0x4d'))['field']('u.fullname')[_0x1414('0x49')](_0x1414('0x4e'))[_0x1414('0x4b')]('user_has_openchannel_interactions','ui')[_0x1414('0x4f')](_0x1414('0x50'),'u',_0x1414('0x51'));var _0xaab2a7=squel[_0x1414('0x48')]()[_0x1414('0x4b')](_0x1414('0x52'),'i')[_0x1414('0x4f')](_0x1414('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1414('0x4f')]('users','o',_0x1414('0x54'))[_0x1414('0x4f')](_0x1414('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x1414('0x4f')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x1414('0x4f')](_0x1414('0x56'),'it',_0x1414('0x57'))['left_join'](_0x1414('0x4c'),'t',_0x1414('0x58'));var _0xcfc651=squel[_0x1414('0x59')]();var _0x16eb9a=[];var _0x384370=squel[_0x1414('0x59')]();var _0x430a88;if(_0x1d70c5['query'][_0x1414('0x5a')]){_0x430a88=as[_0x1414('0x5b')](_0x1d70c5[_0x1414('0x3c')]['search']);var _0x26578a=_0x430a88[_0x1414('0x5c')];for(var _0x110973=0x0;_0x110973<_0x430a88['conditions']['length'];_0x110973++){var _0x1dc84f=_0x430a88['conditions'][_0x110973];var _0x54fc7='i';var _0x251bb3=_[_0x1414('0x5d')](_0x5770ea,[_0x1414('0x2f'),_0x1dc84f[_0x1414('0x49')]]);if(!_0x251bb3){switch(_0x1dc84f[_0x1414('0x49')]){case _0x1414('0x5e'):if(_0x1dc84f[_0x1414('0x5f')]==0x1){_0xaab2a7[_0x1414('0x60')]('`'+_0x1dc84f[_0x1414('0x49')]+_0x1414('0x61'));}else{_0xaab2a7['having']('`'+_0x1dc84f[_0x1414('0x49')]+'`\x20>\x200');}break;case'Contact':if(_0x1dc84f['operator']===_0x1414('0x62')){if(_0x1dc84f['value'][_0x1414('0x63')]('\x20')[_0x1414('0x41')]>0x1){_0xcfc651[_0x26578a](_0x1414('0x64'),qs['getFullTextValue'](_0x1dc84f[_0x1414('0x5f')]),null);}else{var _0x599ea4='%'+_0x1dc84f[_0x1414('0x5f')]+'%';_0xcfc651[_0x26578a](_0x1414('0x65'),_0x599ea4,_0x599ea4,_0x599ea4);}}else{_0x251bb3=_[_0x1414('0x5d')](_0x5770ea,[_0x1414('0x2f'),_0x1414('0x66')]);_0x1dc84f[_0x1414('0x49')]=_0x1414('0x66');_0x30dc96=as[_0x1414('0x67')](_0x54fc7,_0x251bb3[_0x1414('0x3a')],_0x1dc84f);_0xcfc651[_0x26578a](_0x30dc96['text'],_0x30dc96[_0x1414('0x5f')][_0x1414('0x68')],_0x30dc96[_0x1414('0x5f')][_0x1414('0x20')]);}break;case _0x1414('0x69'):var _0x2d1a6c=_0x1dc84f[_0x1414('0x5f')][_0x1414('0x63')](',')[_0x1414('0x32')](function(_0x3ce2ea){return Number(_0x3ce2ea);});_0x2d1a6c['forEach'](function(_0x356ca1){_0x384370['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x356ca1+',%');});_0x16eb9a=_[_0x1414('0x6a')](_0x16eb9a,_0x2d1a6c);break;case _0x1414('0x6b'):if(_0x1dc84f[_0x1414('0x6c')]===_0x1414('0x62')){_0xcfc651[_0x26578a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1dc84f[_0x1414('0x5f')]+'%',null);}else{_0x251bb3=_[_0x1414('0x5d')](_0x5770ea,[_0x1414('0x2f'),_0x1414('0x6d')]);_0x1dc84f['field']=_0x1414('0x6d');_0x30dc96=as[_0x1414('0x67')](_0x54fc7,_0x251bb3[_0x1414('0x3a')],_0x1dc84f);_0xcfc651[_0x26578a](_0x30dc96[_0x1414('0x6e')],_0x30dc96[_0x1414('0x5f')]['start'],_0x30dc96[_0x1414('0x5f')]['end']);}break;case _0x1414('0x6f'):_0x30dc96=as[_0x1414('0x67')]('me',null,_0x1dc84f);_0xcfc651[_0x26578a](_0x30dc96[_0x1414('0x6e')],_0x30dc96[_0x1414('0x5f')][_0x1414('0x68')],_0x30dc96[_0x1414('0x5f')]['end']);break;}}else{var _0x30dc96=as[_0x1414('0x67')](_0x54fc7,_0x251bb3[_0x1414('0x3a')],_0x1dc84f);_0xcfc651[_0x26578a](_0x30dc96[_0x1414('0x6e')],_0x30dc96[_0x1414('0x5f')][_0x1414('0x68')],_0x30dc96[_0x1414('0x5f')][_0x1414('0x20')]);}}}else{var _0x1be553=_(_0x1d70c5[_0x1414('0x3c')])[_0x1414('0x70')]()[_0x1414('0x32')](function(_0x472748){return _[_0x1414('0x71')](_0x5770ea,[_0x1414('0x2f'),_0x472748])?_0x472748:undefined;})[_0x1414('0x72')]()[_0x1414('0x5f')]();if(!_[_0x1414('0x73')](_0x1be553)){_0x1be553['forEach'](function(_0x1bdaad){if(_0x1bdaad===_0x1414('0x74')){_0xaab2a7[_0x1414('0x75')](_0x1414('0x76'),[]['concat'](_0x1d70c5[_0x1414('0x3c')][_0x1bdaad]));}else if(_0x1bdaad===_0x1414('0x77')){var _0x4907e8=JSON['parse'](_0x1d70c5['query'][_0x1bdaad])[_0x1414('0x78')];var _0x9a95d=JSON[_0x1414('0x79')](_0x1d70c5[_0x1414('0x3c')][_0x1bdaad])[_0x1414('0x7a')];_0xaab2a7['where'](_0x1414('0x7b'),_0x4907e8,_0x9a95d);}else{if(_0x1d70c5['query'][_0x1bdaad]==='null'){_0xaab2a7[_0x1414('0x75')]('i.'+_0x1bdaad+'\x20IS\x20NULL');}else{_0xaab2a7['where']('i.'+_0x1bdaad+_0x1414('0x7c'),_0x1d70c5['query'][_0x1bdaad]);}}});}if(_0x1d70c5['query'][_0x1414('0x7d')]){if(_0x1d70c5[_0x1414('0x3c')][_0x1414('0x7d')]==0x1){_0xaab2a7[_0x1414('0x60')](_0x1414('0x7e'));}else{_0xaab2a7[_0x1414('0x60')](_0x1414('0x7f'));}}if(_0x1d70c5[_0x1414('0x3c')][_0x1414('0x80')]){_0x16eb9a=_['isArray'](_0x1d70c5[_0x1414('0x3c')][_0x1414('0x80')])?_0x1d70c5[_0x1414('0x3c')][_0x1414('0x80')]:new Array(_0x1d70c5[_0x1414('0x3c')][_0x1414('0x80')]);_0x16eb9a[_0x1414('0x81')](function(_0x54836b){_0x384370['or'](_0x1414('0x82'),'%,'+_0x54836b+',%');});}if(_0x1d70c5[_0x1414('0x3c')][_0x1414('0x83')]){var _0x5cb9bf=_0x1d70c5[_0x1414('0x3c')][_0x1414('0x83')][_0x1414('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1414('0x85')](_0x5cb9bf)){_0xcfc651['or'](_0x1414('0x86'),_0x5cb9bf+'%');}else{_0xcfc651['or'](_0x1414('0x87'),qs[_0x1414('0x88')](_0x5cb9bf))['or']('i.from\x20LIKE\x20?',_0x5cb9bf+'%')['or'](_0x1414('0x89'),_0x5cb9bf+'%');}}}_0xaab2a7[_0x1414('0x75')](_0xcfc651);_0xaab2a7[_0x1414('0x8a')](_0x1414('0x8b'));var _0x1b3f48={'type':db[_0x1414('0x8c')][_0x1414('0x8d')][_0x1414('0x8e')],'raw':!![]};var _0x1b3648=_0xaab2a7[_0x1414('0x8f')]();_0x1b3648[_0x1414('0x49')](_0x1414('0x8b'));_0x1b3648[_0x1414('0x49')](_0x1414('0x90'),'unreadMessages');if(_0x180ed9['order']){_0x180ed9[_0x1414('0x45')][_0x1414('0x81')](function(_0x4cbdf6){var _0x3551c6=_0x4cbdf6[0x0]===_0x1414('0x91')?_0x4cbdf6[0x0]:'i.'+_0x4cbdf6[0x0];_0xaab2a7['order'](_0x3551c6,_0x4cbdf6[0x1]===_0x1414('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x16eb9a)){_0xaab2a7['having'](_0x384370);_0x1b3648[_0x1414('0x75')]('t.id\x20IN\x20?',_0x16eb9a);}BPromise[_0x1414('0x93')]()['then'](function(){if(!_0x430a88){if(_0x1d70c5[_0x1414('0x3c')][_0x1414('0x74')])return;_0x1b3648[_0x1414('0x75')](_0x1414('0x94'));_0xaab2a7['where'](_0x1414('0x94'));return;}if(_0x1d70c5[_0x1414('0x95')][_0x1414('0x96')]!=='agent')return;return _0x1d70c5[_0x1414('0x95')][_0x1414('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x412009){if(_[_0x1414('0x73')](_0x412009)){_0x1b3648[_0x1414('0x75')](_0x1414('0x98'));_0xaab2a7[_0x1414('0x75')](_0x1414('0x98'));}else{_0x1b3648[_0x1414('0x75')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x412009,'id'));_0xaab2a7['where'](_0x1414('0x76'),_[_0x1414('0x32')](_0x412009,'id'));}});})[_0x1414('0x2b')](function(){if(_0x1d70c5[_0x1414('0x95')][_0x1414('0x96')]===_0x1414('0x99')&&!_0x430a88&&!_0x1d70c5[_0x1414('0x3c')][_0x1414('0x74')])return[];return db[_0x1414('0x9a')]['query'](_0x1b3648[_0x1414('0x9b')](),_0x1b3f48);})[_0x1414('0x2b')](function(_0x46d070){_0x24114d[_0x1414('0x25')]=_0x46d070[_0x1414('0x41')];if(_0x24114d['count']===0x0)return[];return db[_0x1414('0x9a')][_0x1414('0x3c')](_0x2bb177[_0x1414('0x9b')](),_0x1b3f48)[_0x1414('0x2b')](function(_0x30b046){_0x49f4da=_[_0x1414('0x9c')](_0x30b046,'id');_0x1b3f48=_['merge'](_0x1b3f48,{'model':db[_0x1414('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d70c5[_0x1414('0x3c')]['fields']){_0x180ed9[_0x1414('0x40')][_0x1414('0x81')](function(_0x1cf091){_0xaab2a7[_0x1414('0x49')]('i.'+_0x1cf091);});}else{_0xaab2a7[_0x1414('0x49')](_0x1414('0x90'),_0x1414('0x5e'));_0xaab2a7[_0x1414('0x49')]('a.key',_0x1414('0x9d'));_0xaab2a7[_0x1414('0x49')]('a.mandatoryDisposition',_0x1414('0x9e'));_0xaab2a7[_0x1414('0x49')](_0x1414('0x9f'),_0x1414('0x91'));_0xaab2a7[_0x1414('0x49')](_0x1414('0xa0'));_0xaab2a7[_0x1414('0x49')](_0x1414('0xa1'),'Contact.firstName');_0xaab2a7[_0x1414('0x49')](_0x1414('0xa2'),'Contact.lastName');_0xaab2a7[_0x1414('0x49')](_0x1414('0xa3'),_0x1414('0xa4'));_0xaab2a7[_0x1414('0x49')]('c.phone',_0x1414('0xa5'));_0xaab2a7['field']('c.mobile',_0x1414('0xa6'));_0xaab2a7[_0x1414('0x49')]('c.fax',_0x1414('0xa7'));_0xaab2a7[_0x1414('0x49')](_0x1414('0xa8'),_0x1414('0xa9'));_0xaab2a7['field'](_0x1414('0xaa'),_0x1414('0xab'));_0xaab2a7['field'](_0x1414('0xac'),_0x1414('0x34'));}if(_0x180ed9[_0x1414('0x24')])_0xaab2a7['limit'](_0x180ed9[_0x1414('0x24')]);if(_0x180ed9[_0x1414('0x22')])_0xaab2a7[_0x1414('0x22')](_0x180ed9[_0x1414('0x22')]);return db[_0x1414('0x9a')]['query'](_0xaab2a7[_0x1414('0x9b')](),_0x1b3f48);})[_0x1414('0x2b')](function(_0x31b5e9){if(_0x31b5e9['length']>0x0)_0x210a20[_0x1414('0x75')](_0x1414('0xad'),_[_0x1414('0x32')](_0x31b5e9,'id'));return db['sequelize'][_0x1414('0x3c')](_0x210a20[_0x1414('0x9b')](),_0x1b3f48)['then'](function(_0xe172ca){var _0x613c12=_['groupBy'](_0xe172ca,_0x1414('0xae'));var _0x3a8f5b=[];_0x31b5e9['forEach'](function(_0x3a40d7){_0x3a8f5b[_0x1414('0xaf')](updateOpenchannelInteraction(_0x3a40d7,_0x49f4da,_0x613c12));});return BPromise[_0x1414('0xb0')](_0x3a8f5b);});});})[_0x1414('0x2b')](function(_0x16bbd0){_0x24114d[_0x1414('0xb1')]=_0x16bbd0;return _0x24114d;})[_0x1414('0x2b')](respondWithFilteredResult(_0x332dfc,_0x180ed9))['catch'](handleError(_0x332dfc,null));};exports['show']=function(_0x484284,_0x3d6078){var _0x5a2204={};if(_0x484284['query'][_0x1414('0x3a')]&&_0x484284['query'][_0x1414('0x3a')]===_0x1414('0x4b')){_0x5a2204[_0x1414('0x4b')]=_0x484284['params']['id'];}else{_0x5a2204['id']=_0x484284[_0x1414('0xb2')]['id'];}var _0x27198b={'raw':![],'where':_0x5a2204},_0x108def={};_0x108def[_0x1414('0x42')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x108def[_0x1414('0x3c')]=_['keys'](_0x484284[_0x1414('0x3c')]);_0x108def[_0x1414('0x3d')]=_[_0x1414('0x3e')](_0x108def[_0x1414('0x42')],_0x108def[_0x1414('0x3c')]);_0x27198b[_0x1414('0x40')]=_[_0x1414('0x3e')](_0x108def[_0x1414('0x42')],qs[_0x1414('0x3f')](_0x484284[_0x1414('0x3c')][_0x1414('0x3f')]));_0x27198b[_0x1414('0x40')]=_0x27198b['attributes']['length']?_0x27198b[_0x1414('0x40')]:_0x108def['model'];if(_0x484284['query'][_0x1414('0xb3')]){_0x27198b['include']=[{'all':!![]}];}_0x27198b=_['merge']({},_0x27198b,_0x484284[_0x1414('0xb4')]);return db[_0x1414('0x38')][_0x1414('0x5d')](_0x27198b)[_0x1414('0x2b')](handleEntityNotFound(_0x3d6078,null))[_0x1414('0x2b')](respondWithResult(_0x3d6078,null))[_0x1414('0x36')](handleError(_0x3d6078,null));};exports['create']=function(_0x2e5453,_0x271793){return db['OpenchannelInteraction'][_0x1414('0xb5')](_0x2e5453[_0x1414('0x6f')],{})[_0x1414('0x2b')](respondWithResult(_0x271793,0xc9))['catch'](handleError(_0x271793,null));};exports[_0x1414('0x2a')]=function(_0x4c12bd,_0x19e166){if(_0x4c12bd['body']['id']){delete _0x4c12bd[_0x1414('0x6f')]['id'];}return db[_0x1414('0x38')][_0x1414('0x5d')]({'where':{'id':_0x4c12bd[_0x1414('0xb2')]['id']}})[_0x1414('0x2b')](handleEntityNotFound(_0x19e166,null))[_0x1414('0x2b')](saveUpdates(_0x4c12bd[_0x1414('0x6f')],null))['then'](respondWithResult(_0x19e166,null))[_0x1414('0x36')](handleError(_0x19e166,null));};exports[_0x1414('0x2c')]=function(_0x4559db,_0x187b77){return db[_0x1414('0x38')][_0x1414('0x5d')]({'where':{'id':_0x4559db[_0x1414('0xb2')]['id']}})[_0x1414('0x2b')](handleEntityNotFound(_0x187b77,null))[_0x1414('0x2b')](removeEntity(_0x187b77,null))[_0x1414('0x36')](handleError(_0x187b77,null));};exports[_0x1414('0xb6')]=function(_0x547bb8,_0x4bf4ee){return db['OpenchannelInteraction'][_0x1414('0xb6')]()[_0x1414('0x2b')](respondWithResult(_0x4bf4ee,null))[_0x1414('0x36')](handleError(_0x4bf4ee,null));};exports[_0x1414('0xb7')]=function(_0xa3973c,_0x88100e,_0x49e70d){return db[_0x1414('0xb8')]['find']({'where':{'id':_0xa3973c[_0x1414('0xb2')]['id']}})[_0x1414('0x2b')](handleEntityNotFound(_0x88100e,null))[_0x1414('0x2b')](function(_0x533719){if(_0x533719){return _0x533719[_0x1414('0xb7')](_0xa3973c[_0x1414('0x6f')][_0x1414('0xb9')],_[_0x1414('0xba')](_0xa3973c['body'],[_0x1414('0xb9'),'id'])||{});}})[_0x1414('0x2b')](respondWithResult(_0x88100e,null))[_0x1414('0x36')](handleError(_0x88100e,null));};exports[_0x1414('0xbb')]=function(_0x10fa51,_0x2d2b4c,_0x4b4010){var _0x440c89={'raw':![],'where':{}};var _0x2691fc={};var _0x147721={'count':0x0,'rows':[]};return db[_0x1414('0x38')][_0x1414('0xbc')]({'where':{'id':_0x10fa51[_0x1414('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2d2b4c,null))[_0x1414('0x2b')](function(_0x5a8e94){if(_0x5a8e94){_0x2691fc['model']=_[_0x1414('0x70')](db['OpenchannelMessage'][_0x1414('0xbd')]);_0x2691fc[_0x1414('0x3c')]=_[_0x1414('0x70')](_0x10fa51[_0x1414('0x3c')]);_0x2691fc[_0x1414('0x3d')]=_[_0x1414('0x3e')](_0x2691fc[_0x1414('0x42')],_0x2691fc[_0x1414('0x3c')]);_0x440c89['attributes']=_[_0x1414('0x3e')](_0x2691fc[_0x1414('0x42')],qs['fields'](_0x10fa51[_0x1414('0x3c')][_0x1414('0x3f')]));_0x440c89[_0x1414('0x40')]=_0x440c89[_0x1414('0x40')]['length']?_0x440c89[_0x1414('0x40')]:_0x2691fc[_0x1414('0x42')];if(!_0x10fa51['query'][_0x1414('0x43')]('nolimit')){_0x440c89['limit']=qs[_0x1414('0x24')](_0x10fa51[_0x1414('0x3c')][_0x1414('0x24')]);_0x440c89[_0x1414('0x22')]=qs[_0x1414('0x22')](_0x10fa51[_0x1414('0x3c')]['offset']);}_0x440c89['order']=qs['sort'](_0x10fa51[_0x1414('0x3c')][_0x1414('0x46')]);_0x440c89['where']=qs[_0x1414('0x3d')](_[_0x1414('0x47')](_0x10fa51['query'],_0x2691fc[_0x1414('0x3d')]));_0x440c89[_0x1414('0x75')][_0x1414('0xae')]=_0x5a8e94['id'];if(_0x10fa51['query']['filter']){_0x440c89['where']=_['merge'](_0x440c89[_0x1414('0x75')],{'$or':_[_0x1414('0x32')](_0x440c89[_0x1414('0x40')],function(_0x150319){var _0x5a61e0={};_0x5a61e0[_0x150319]={'$like':'%'+_0x10fa51[_0x1414('0x3c')][_0x1414('0x83')]+'%'};return _0x5a61e0;})});}if(_0x10fa51[_0x1414('0x3c')][_0x1414('0x78')]){var _0x18a9c4=_0x10fa51[_0x1414('0x3c')][_0x1414('0x78')][_0x1414('0x63')](',');var _0x40325a={};_0x40325a[_0x18a9c4[0x0]]={'$gte':moment(_0x18a9c4[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x440c89['where']=_[_0x1414('0xbe')](_0x440c89['where'],_0x40325a);}_0x440c89=_[_0x1414('0xbe')]({},_0x440c89,_0x10fa51[_0x1414('0xb4')]);return db[_0x1414('0xb8')][_0x1414('0x25')]({'where':_0x440c89[_0x1414('0x75')]})[_0x1414('0x2b')](function(_0x4d9652){_0x147721['count']=_0x4d9652;if(_0x10fa51[_0x1414('0x3c')][_0x1414('0xb3')]){_0x440c89[_0x1414('0xbf')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1414('0xc0')](_0x440c89);})[_0x1414('0x2b')](function(_0xd7c228){_0x147721['rows']=_0xd7c228;return _0x147721;});}})[_0x1414('0x2b')](respondWithFilteredResult(_0x2d2b4c,_0x440c89))[_0x1414('0x36')](handleError(_0x2d2b4c,null));};exports[_0x1414('0xc1')]=function(_0xbf57d7,_0x302f87,_0xcb3838){return db[_0x1414('0x38')][_0x1414('0x5d')]({'where':{'id':_0xbf57d7[_0x1414('0xb2')]['id']}})['then'](handleEntityNotFound(_0x302f87,null))[_0x1414('0x2b')](function(_0x570bae){if(_0x570bae){return _0x570bae['setTags'](_0xbf57d7[_0x1414('0x6f')]['ids'],_[_0x1414('0xba')](_0xbf57d7[_0x1414('0x6f')],[_0x1414('0xb9'),'id'])||{})['spread'](function(){return db['Tag'][_0x1414('0xc0')]({'attributes':['id','name',_0x1414('0x4a')],'where':{'id':_0xbf57d7[_0x1414('0x6f')]['ids']}});})['then'](function(_0x1873ce){socket['emit'](_0x1414('0xc2'),{'id':Number(_0xbf57d7['params']['id']),'tags':_0x1873ce||[]});return{'id':Number(_0xbf57d7[_0x1414('0xb2')]['id']),'tags':_0x1873ce||[]};});}})[_0x1414('0x2b')](respondWithResult(_0x302f87,null))[_0x1414('0x36')](handleError(_0x302f87,null));};exports[_0x1414('0xc3')]=function(_0x33a294,_0x3ea6c,_0x48c5ab){return db[_0x1414('0x38')][_0x1414('0x5d')]({'where':{'id':_0x33a294['params']['id']}})[_0x1414('0x2b')](handleEntityNotFound(_0x3ea6c,null))['then'](function(_0x5ba080){if(_0x5ba080){return _0x5ba080[_0x1414('0xc3')](_0x33a294['query'][_0x1414('0xb9')]);}})[_0x1414('0x2b')](respondWithStatusCode(_0x3ea6c,null))[_0x1414('0x36')](handleError(_0x3ea6c,null));};exports[_0x1414('0xc4')]=function(_0x4bd721,_0x43b6f3){var _0x5ef67f=moment()[_0x1414('0xc5')]()[_0x1414('0x9b')]();var _0x160df5=path[_0x1414('0xc6')](config[_0x1414('0xc7')],_0x1414('0xc8'),_0x1414('0xc9'),_0x1414('0xca'));var _0x51b527=path[_0x1414('0xc6')](config[_0x1414('0xc7')],'server',_0x1414('0xc9'),_0x1414('0xcb'));var _0x42531a=path['join'](_0x160df5,_0x5ef67f);var _0x5844ed=util[_0x1414('0xcc')](_0x1414('0xcd'),_0x4bd721[_0x1414('0xb2')]['id'],_0x5ef67f);var _0x86676c=path[_0x1414('0xc6')](_0x160df5,_0x5844ed);var _0x72d1dc=[];_0x72d1dc[_0x1414('0xaf')]({'model':db[_0x1414('0x6b')],'as':_0x1414('0x6b'),'attributes':['id',_0x1414('0x33')],'raw':!![]});_0x72d1dc[_0x1414('0xaf')]({'model':db[_0x1414('0xce')],'as':_0x1414('0xcf'),'attributes':['id',_0x1414('0xd0'),'lastName'],'raw':!![]});if(_0x4bd721['query'][_0x1414('0xcb')]){_0x72d1dc[_0x1414('0xaf')]({'model':db[_0x1414('0xd1')],'as':_0x1414('0xd1'),'raw':!![]});}var _0x3682d1=[{'model':db[_0x1414('0xb8')],'as':'Messages','attributes':['id',_0x1414('0x6f'),'createdAt',_0x1414('0xd2'),_0x1414('0xd3'),_0x1414('0x7d')],'include':_0x72d1dc}];_0x3682d1[_0x1414('0xaf')]({'model':db[_0x1414('0xd4')],'as':_0x1414('0xd5'),'attributes':['id',_0x1414('0x2f')]});_0x3682d1[_0x1414('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id',_0x1414('0x33')]});return db['OpenchannelInteraction'][_0x1414('0x5d')]({'where':{'id':_0x4bd721[_0x1414('0xb2')]['id']},'include':_0x3682d1})[_0x1414('0x2b')](handleEntityNotFound(_0x43b6f3,null))['then'](function(_0x37b8f5){if(_0x37b8f5){var _0x425d20=_0x37b8f5[_0x1414('0xd6')]({'plain':!![]});fs[_0x1414('0xd7')](_0x42531a);var _0xb7403e={'channel':_0x1414('0xd8'),'account':_0x425d20[_0x1414('0xd5')][_0x1414('0x2f')],'agent':_0x425d20[_0x1414('0xd9')]?_0x425d20[_0x1414('0xd9')][_0x1414('0x33')]:_0x1414('0xda'),'createdAt':moment(_0x425d20[_0x1414('0x77')])[_0x1414('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1414('0x9b')](),'closedAt':_0x425d20[_0x1414('0xdb')]?moment(_0x425d20['closedAt'])['format'](_0x1414('0xdc'))['toString']():'','disposition':_0x425d20[_0x1414('0xdd')],'visibility':_0x425d20[_0x1414('0xde')]?_0x1414('0xdf'):'Private','messages':_(_0x425d20['Messages'])[_0x1414('0x83')]({'secret':![]})['map'](function(_0x287629){if(_0x287629[_0x1414('0xd1')]){var _0x26bec3=path[_0x1414('0xc6')](_0x51b527,_0x287629[_0x1414('0xd1')][_0x1414('0xe0')]);if(fs['existsSync'](_0x26bec3)){fs[_0x1414('0xe1')](_0x26bec3)[_0x1414('0xe2')](fs[_0x1414('0xe3')](path[_0x1414('0xc6')](_0x42531a,_0x287629[_0x1414('0xd1')][_0x1414('0xe0')])));}}return{'date':moment(_0x287629[_0x1414('0x77')])[_0x1414('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1414('0x9b')](),'sender':_0x287629[_0x1414('0xd2')]===_0x1414('0xe4')?_0x287629['User']?_0x287629[_0x1414('0x6b')][_0x1414('0x33')]:_0x1414('0xe5'):_0x287629['Contact'][_0x1414('0xd0')]+(_0x287629[_0x1414('0xcf')][_0x1414('0xe6')]?'\x20'+_0x287629['Contact']['lastName']:''),'body':_0x287629[_0x1414('0xd1')]?_0x287629[_0x1414('0xd1')][_0x1414('0xe0')]:_0x287629[_0x1414('0x6f')],'direction':_0x287629[_0x1414('0xd2')]===_0x1414('0xe4')?'A':'C','secret':_0x287629[_0x1414('0xd3')],'read':_0x287629['read'],'attachment':_0x287629[_0x1414('0xd1')]};})[_0x1414('0x5f')]()};return ejs[_0x1414('0xe7')](path[_0x1414('0xc6')](config['root'],_0x1414('0xc8'),_0x1414('0xe8'),_0x1414('0xe9')),{'interaction':_0xb7403e})[_0x1414('0x2b')](function(_0x370310){var _0x56504e=path[_0x1414('0xc6')](_0x42531a,_0x1414('0xea')+_0x425d20['id']+'-'+_0x5ef67f+_0x1414('0xeb'));var _0x14b59a={'path':_0x56504e,'channel':_0x1414('0xd8'),'interactionId':_0x425d20['id']};return pdf['createPdfFromHTML'](_0x370310,_0x14b59a);})[_0x1414('0x2b')](function(){return new BPromise(function(_0x474411,_0x5db225){zipdir(_0x42531a,{'saveTo':_0x86676c},function(_0x327d14,_0x4b6547){if(_0x327d14)return _0x5db225(_0x327d14);return _0x474411(_0x4b6547);});})[_0x1414('0x2b')](function(){return new BPromise(function(_0x26c341,_0x380334){rimraf(_0x42531a,function(_0x93233e){if(_0x93233e)_0x380334(_0x93233e);return _0x26c341();});});})[_0x1414('0x2b')](function(){return _0x43b6f3[_0x1414('0xc4')](_0x86676c,_0x5844ed,function(_0x13e498){if(_0x13e498){console[_0x1414('0xec')](_0x1414('0xed'),_0x13e498);}else{fs[_0x1414('0xee')](_0x86676c);}});});});}else{return _0x43b6f3[_0x1414('0x1e')](0xc8);}})[_0x1414('0x36')](handleError(_0x43b6f3,null));}; \ No newline at end of file +var _0x37f5=['get','mkdirSync','Openchannel','Account','Owner','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','select','field','color','u.id','ui.OpenchannelInteractionId','left_join','users','from','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','OpenchannelAccountId','createdAt','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','order','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','findOne','nolimit','pick','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','omit','spread','openchannelInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount'];(function(_0x296609,_0x5a31c5){var _0x1f565d=function(_0x57b321){while(--_0x57b321){_0x296609['push'](_0x296609['shift']());}};_0x1f565d(++_0x5a31c5);}(_0x37f5,0x1ec));var _0x537f=function(_0x1fba88,_0x377f23){_0x1fba88=_0x1fba88-0x0;var _0x3f0fee=_0x37f5[_0x1fba88];return _0x3f0fee;};'use strict';var emlformat=require(_0x537f('0x0'));var rimraf=require(_0x537f('0x1'));var zipdir=require(_0x537f('0x2'));var jsonpatch=require(_0x537f('0x3'));var rp=require('request-promise');var moment=require(_0x537f('0x4'));var BPromise=require(_0x537f('0x5'));var Mustache=require('mustache');var util=require(_0x537f('0x6'));var path=require(_0x537f('0x7'));var sox=require(_0x537f('0x8'));var csv=require(_0x537f('0x9'));var ejs=require(_0x537f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x537f('0xb'));var squel=require(_0x537f('0xc'));var crypto=require(_0x537f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x537f('0xe'));var toCsv=require(_0x537f('0x9'));var querystring=require('querystring');var Papa=require(_0x537f('0xf'));var Redis=require(_0x537f('0x10'));var authService=require(_0x537f('0x11'));var qs=require(_0x537f('0x12'));var as=require(_0x537f('0x13'));var pdf=require(_0x537f('0x14'));var hardwareService=require(_0x537f('0x15'));var logger=require(_0x537f('0x16'))(_0x537f('0x17'));var utils=require(_0x537f('0x18'));var config=require(_0x537f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x537f('0x1a'))['db'];config[_0x537f('0x1b')]=_[_0x537f('0x1c')](config[_0x537f('0x1b')],{'host':_0x537f('0x1d'),'port':0x18eb});var socket=require(_0x537f('0x1e'))(new Redis(config[_0x537f('0x1b')]));require(_0x537f('0x1f'))[_0x537f('0x20')](socket);function respondWithStatusCode(_0x473d03,_0x39c4a2){_0x39c4a2=_0x39c4a2||0xcc;return function(_0x3b97aa){if(_0x3b97aa){return _0x473d03[_0x537f('0x21')](_0x39c4a2);}return _0x473d03['status'](_0x39c4a2)[_0x537f('0x22')]();};}function respondWithResult(_0x3aec3a,_0x495d10){_0x495d10=_0x495d10||0xc8;return function(_0x17ef4a){if(_0x17ef4a){return _0x3aec3a['status'](_0x495d10)['json'](_0x17ef4a);}};}function respondWithFilteredResult(_0x8fc040,_0xbc36bc){return function(_0x3dc4e3){if(_0x3dc4e3){var _0x23f042=typeof _0xbc36bc[_0x537f('0x23')]===_0x537f('0x24')&&typeof _0xbc36bc[_0x537f('0x25')]===_0x537f('0x24');var _0x5cceda=_0x3dc4e3['count'];var _0x896aad=_0x23f042?0x0:_0xbc36bc['offset'];var _0x5731c4=_0x23f042?_0x3dc4e3[_0x537f('0x26')]:_0xbc36bc[_0x537f('0x23')]+_0xbc36bc[_0x537f('0x25')];var _0x3d1ea6;if(_0x5731c4>=_0x5cceda){_0x5731c4=_0x5cceda;_0x3d1ea6=0xc8;}else{_0x3d1ea6=0xce;}_0x8fc040[_0x537f('0x27')](_0x3d1ea6);return _0x8fc040[_0x537f('0x28')](_0x537f('0x29'),_0x896aad+'-'+_0x5731c4+'/'+_0x5cceda)['json'](_0x3dc4e3);}return null;};}function patchUpdates(_0x29f0bd){return function(_0x5171a5){try{jsonpatch['apply'](_0x5171a5,_0x29f0bd,!![]);}catch(_0x596675){return BPromise[_0x537f('0x2a')](_0x596675);}return _0x5171a5[_0x537f('0x2b')]();};}function saveUpdates(_0x20c5f6,_0x3e5dc6){return function(_0x59da85){if(_0x59da85){return _0x59da85[_0x537f('0x2c')](_0x20c5f6)['then'](function(_0x455f92){return _0x455f92;});}return null;};}function removeEntity(_0x378af0,_0xce7743){return function(_0xc4ab2d){if(_0xc4ab2d){return _0xc4ab2d[_0x537f('0x2d')]()[_0x537f('0x2e')](function(){_0x378af0[_0x537f('0x27')](0xcc)[_0x537f('0x22')]();});}};}function handleEntityNotFound(_0xda995d,_0x38af47){return function(_0x5e5b8f){if(!_0x5e5b8f){_0xda995d[_0x537f('0x21')](0x194);}return _0x5e5b8f;};}function handleError(_0x4ed111,_0x456e2f){_0x456e2f=_0x456e2f||0x1f4;return function(_0x5c9136){logger[_0x537f('0x2f')](_0x5c9136[_0x537f('0x30')]);if(_0x5c9136['name']){delete _0x5c9136[_0x537f('0x31')];}_0x4ed111['status'](_0x456e2f)['send'](_0x5c9136);};}function getInteractionUsers(_0x3909b4,_0x47d196){return new BPromise(function(_0x3aa159,_0x5e6c24){try{if(_0x47d196[_0x3909b4['id']]){_0x3909b4[_0x537f('0x32')]=_[_0x537f('0x33')](_0x47d196[_0x3909b4['id']],function(_0x2fe504){return{'id':_0x2fe504['id'],'fullname':_0x2fe504[_0x537f('0x34')]};});}}catch(_0x4a65c8){_0x5e6c24(_0x4a65c8);}_0x3aa159(_0x3909b4);});}function getInteractionTags(_0x2e15bc,_0x5aa721){return new BPromise(function(_0x1a5d50,_0x4bae2a){try{if(_0x2e15bc[_0x537f('0x35')]){_0x2e15bc[_0x537f('0x36')]=[];_0x2e15bc[_0x537f('0x35')][_0x537f('0x37')](',')[_0x537f('0x38')](function(_0x5c4899){_0x2e15bc[_0x537f('0x36')][_0x537f('0x39')](_0x5aa721[_0x5c4899]);});}delete _0x2e15bc[_0x537f('0x35')];}catch(_0x4ecf7a){_0x4bae2a(_0x4ecf7a);}_0x1a5d50(_0x2e15bc);});}function updateOpenchannelInteraction(_0x4b5f25,_0x47ee8c,_0xe5b1f9){return new BPromise(function(_0x2b4063,_0x244767){return getInteractionUsers(_0x4b5f25,_0xe5b1f9)[_0x537f('0x2e')](function(_0x4ebbbb){return getInteractionTags(_0x4ebbbb,_0x47ee8c);})[_0x537f('0x2e')](function(_0x3d9b24){_0x2b4063(_0x3d9b24);})[_0x537f('0x3a')](function(_0x16cb41){_0x244767(_0x16cb41);});});}exports[_0x537f('0x3b')]=function(_0x1c399d,_0x45fae8){var _0x1c4e0e={},_0x557e48={},_0x31f35b={'count':0x0,'rows':[]};var _0x21b5b1=_[_0x537f('0x33')](db[_0x537f('0x3c')]['rawAttributes'],function(_0x15e08b){return{'name':_0x15e08b['fieldName'],'type':_0x15e08b[_0x537f('0x3d')]['key']};});_0x557e48[_0x537f('0x3e')]=_[_0x537f('0x33')](_0x21b5b1,_0x537f('0x31'));_0x557e48[_0x537f('0x3f')]=_[_0x537f('0x40')](_0x1c399d['query']);_0x557e48[_0x537f('0x41')]=_[_0x537f('0x42')](_0x557e48[_0x537f('0x3e')],_0x557e48[_0x537f('0x3f')]);_0x1c4e0e[_0x537f('0x43')]=_['intersection'](_0x557e48['model'],qs['fields'](_0x1c399d[_0x537f('0x3f')][_0x537f('0x44')]));_0x1c4e0e['attributes']=_0x1c4e0e[_0x537f('0x43')][_0x537f('0x45')]?_0x1c4e0e[_0x537f('0x43')]:_0x557e48['model'];if(!_0x1c399d[_0x537f('0x3f')][_0x537f('0x46')]('nolimit')){_0x1c4e0e[_0x537f('0x25')]=qs[_0x537f('0x25')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x25')]);_0x1c4e0e[_0x537f('0x23')]=qs[_0x537f('0x23')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x23')]);}_0x1c4e0e['order']=qs[_0x537f('0x47')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x47')]);_0x1c4e0e[_0x537f('0x48')]=qs['filters'](_['pick'](_0x1c399d[_0x537f('0x3f')],_0x557e48[_0x537f('0x41')]),_0x21b5b1);var _0x68d9d8=[];var _0x16e102=squel[_0x537f('0x49')]()['field']('id')[_0x537f('0x4a')](_0x537f('0x31'))[_0x537f('0x4a')](_0x537f('0x4b'))['from']('tools_tags');var _0x1a5020=squel['select']()[_0x537f('0x4a')](_0x537f('0x4c'))[_0x537f('0x4a')]('u.fullname')[_0x537f('0x4a')](_0x537f('0x4d'))['from']('user_has_openchannel_interactions','ui')[_0x537f('0x4e')](_0x537f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x152f4f=squel['select']()[_0x537f('0x50')](_0x537f('0x51'),'i')['left_join'](_0x537f('0x52'),'c',_0x537f('0x53'))[_0x537f('0x4e')](_0x537f('0x4f'),'o',_0x537f('0x54'))[_0x537f('0x4e')](_0x537f('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x537f('0x4e')](_0x537f('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x537f('0x4e')](_0x537f('0x57'),'it',_0x537f('0x58'))[_0x537f('0x4e')](_0x537f('0x59'),'t',_0x537f('0x5a'));var _0x91746=squel[_0x537f('0x5b')]();var _0x439bc7=[];var _0x44c58a=squel[_0x537f('0x5b')]();var _0x8b75e4;if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x5c')]){_0x8b75e4=as[_0x537f('0x5d')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x5c')]);var _0x5db526=_0x8b75e4['sqlOperator'];for(var _0x17f331=0x0;_0x17f331<_0x8b75e4[_0x537f('0x5e')][_0x537f('0x45')];_0x17f331++){var _0x1c0671=_0x8b75e4[_0x537f('0x5e')][_0x17f331];var _0x5166cd='i';var _0x36c611=_[_0x537f('0x5f')](_0x21b5b1,[_0x537f('0x31'),_0x1c0671['field']]);if(!_0x36c611){switch(_0x1c0671[_0x537f('0x4a')]){case'unreadMessages':if(_0x1c0671[_0x537f('0x60')]==0x1){_0x152f4f[_0x537f('0x61')]('`'+_0x1c0671[_0x537f('0x4a')]+'`\x20=\x200');}else{_0x152f4f['having']('`'+_0x1c0671[_0x537f('0x4a')]+_0x537f('0x62'));}break;case _0x537f('0x63'):if(_0x1c0671[_0x537f('0x64')]===_0x537f('0x65')){if(_0x1c0671[_0x537f('0x60')]['split']('\x20')['length']>0x1){_0x91746[_0x5db526](_0x537f('0x66'),qs[_0x537f('0x67')](_0x1c0671[_0x537f('0x60')]),null);}else{var _0x5d95c5='%'+_0x1c0671['value']+'%';_0x91746[_0x5db526](_0x537f('0x68'),_0x5d95c5,_0x5d95c5,_0x5d95c5);}}else{_0x36c611=_['find'](_0x21b5b1,[_0x537f('0x31'),_0x537f('0x69')]);_0x1c0671[_0x537f('0x4a')]=_0x537f('0x69');_0x52ba6b=as[_0x537f('0x6a')](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b[_0x537f('0x60')]['start'],_0x52ba6b['value']['end']);}break;case _0x537f('0x6c'):var _0x2e4890=_0x1c0671[_0x537f('0x60')]['split'](',')[_0x537f('0x33')](function(_0xbdb82e){return Number(_0xbdb82e);});_0x2e4890[_0x537f('0x38')](function(_0x457b69){_0x44c58a['or'](_0x537f('0x6d'),'%,'+_0x457b69+',%');});_0x439bc7=_[_0x537f('0x6e')](_0x439bc7,_0x2e4890);break;case _0x537f('0x6f'):if(_0x1c0671[_0x537f('0x64')]==='$substring'){_0x91746[_0x5db526](_0x537f('0x70'),'%'+_0x1c0671[_0x537f('0x60')]+'%',null);}else{_0x36c611=_[_0x537f('0x5f')](_0x21b5b1,[_0x537f('0x31'),'UserId']);_0x1c0671[_0x537f('0x4a')]=_0x537f('0x71');_0x52ba6b=as['buildExpression'](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b['value']['start'],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);}break;case'body':_0x52ba6b=as[_0x537f('0x6a')]('me',null,_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b[_0x537f('0x60')][_0x537f('0x72')],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);break;}}else{var _0x52ba6b=as[_0x537f('0x6a')](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b['text'],_0x52ba6b[_0x537f('0x60')]['start'],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);}}}else{var _0x2ac30b=_(_0x1c399d[_0x537f('0x3f')])['keys']()[_0x537f('0x33')](function(_0x321e92){return _['some'](_0x21b5b1,[_0x537f('0x31'),_0x321e92])?_0x321e92:undefined;})[_0x537f('0x73')]()[_0x537f('0x60')]();if(!_['isEmpty'](_0x2ac30b)){_0x2ac30b[_0x537f('0x38')](function(_0x4a19e1){if(_0x4a19e1===_0x537f('0x74')){_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x1c399d[_0x537f('0x3f')][_0x4a19e1]));}else if(_0x4a19e1===_0x537f('0x75')){var _0x143566=JSON['parse'](_0x1c399d[_0x537f('0x3f')][_0x4a19e1])['$gte'];var _0x32e599=JSON['parse'](_0x1c399d['query'][_0x4a19e1])['$lte'];_0x152f4f[_0x537f('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x143566,_0x32e599);}else{if(_0x1c399d[_0x537f('0x3f')][_0x4a19e1]===_0x537f('0x76')){_0x152f4f[_0x537f('0x48')]('i.'+_0x4a19e1+_0x537f('0x77'));}else{_0x152f4f['where']('i.'+_0x4a19e1+_0x537f('0x78'),_0x1c399d['query'][_0x4a19e1]);}}});}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x79')]){if(_0x1c399d[_0x537f('0x3f')]['read']==0x1){_0x152f4f['having'](_0x537f('0x7a'));}else{_0x152f4f['having'](_0x537f('0x7b'));}}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')]){_0x439bc7=_[_0x537f('0x7d')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')])?_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')]:new Array(_0x1c399d[_0x537f('0x3f')]['tag']);_0x439bc7[_0x537f('0x38')](function(_0x3ca4de){_0x44c58a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3ca4de+',%');});}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x7e')]){var _0xca8990=_0x1c399d['query'][_0x537f('0x7e')][_0x537f('0x7f')]('\x5c','\x5c\x5c')[_0x537f('0x7f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xca8990)){_0x91746['or'](_0x537f('0x80'),_0xca8990+'%');}else{_0x91746['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x537f('0x67')](_0xca8990))['or']('i.from\x20LIKE\x20?',_0xca8990+'%')['or'](_0x537f('0x81'),_0xca8990+'%');}}}_0x152f4f[_0x537f('0x48')](_0x91746);_0x152f4f[_0x537f('0x82')](_0x537f('0x83'));var _0x22db33={'type':db[_0x537f('0x84')]['QueryTypes'][_0x537f('0x85')],'raw':!![]};var _0x546892=_0x152f4f['clone']();_0x546892[_0x537f('0x4a')](_0x537f('0x83'));_0x546892['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1c4e0e[_0x537f('0x86')]){_0x1c4e0e[_0x537f('0x86')][_0x537f('0x38')](function(_0x30f8ec){var _0x3cd24a=_0x30f8ec[0x0]==='contactName'?_0x30f8ec[0x0]:'i.'+_0x30f8ec[0x0];_0x152f4f['order'](_0x3cd24a,_0x30f8ec[0x1]==='DESC'?![]:!![]);});}if(!_[_0x537f('0x87')](_0x439bc7)){_0x152f4f['having'](_0x44c58a);_0x546892[_0x537f('0x48')](_0x537f('0x88'),_0x439bc7);}BPromise[_0x537f('0x89')]()[_0x537f('0x2e')](function(){if(!_0x8b75e4){if(_0x1c399d[_0x537f('0x3f')]['OpenchannelAccountId'])return;_0x546892['where'](_0x537f('0x8a'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1c399d[_0x537f('0x8b')]['role']!==_0x537f('0x8c'))return;return _0x1c399d[_0x537f('0x8b')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x540e71){if(_[_0x537f('0x87')](_0x540e71)){_0x546892['where'](_0x537f('0x8d'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x546892[_0x537f('0x48')](_0x537f('0x8e'),_[_0x537f('0x33')](_0x540e71,'id'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x537f('0x33')](_0x540e71,'id'));}});})[_0x537f('0x2e')](function(){if(_0x1c399d[_0x537f('0x8b')]['role']===_0x537f('0x8c')&&!_0x8b75e4&&!_0x1c399d[_0x537f('0x3f')][_0x537f('0x74')])return[];return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x546892[_0x537f('0x90')](),_0x22db33);})[_0x537f('0x2e')](function(_0x58286b){_0x31f35b[_0x537f('0x26')]=_0x58286b[_0x537f('0x45')];if(_0x31f35b[_0x537f('0x26')]===0x0)return[];return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x16e102[_0x537f('0x90')](),_0x22db33)[_0x537f('0x2e')](function(_0x2f54ec){_0x68d9d8=_[_0x537f('0x91')](_0x2f54ec,'id');_0x22db33=_['merge'](_0x22db33,{'model':db[_0x537f('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x44')]){_0x1c4e0e['attributes'][_0x537f('0x38')](function(_0x113a0e){_0x152f4f['field']('i.'+_0x113a0e);});}else{_0x152f4f['field'](_0x537f('0x92'),_0x537f('0x93'));_0x152f4f['field'](_0x537f('0x94'),_0x537f('0x95'));_0x152f4f[_0x537f('0x4a')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x152f4f['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x152f4f['field'](_0x537f('0x96'));_0x152f4f[_0x537f('0x4a')](_0x537f('0x97'),_0x537f('0x98'));_0x152f4f[_0x537f('0x4a')](_0x537f('0x99'),_0x537f('0x9a'));_0x152f4f['field'](_0x537f('0x9b'),'Contact.email');_0x152f4f['field'](_0x537f('0x9c'),'Contact.phone');_0x152f4f[_0x537f('0x4a')](_0x537f('0x9d'),_0x537f('0x9e'));_0x152f4f[_0x537f('0x4a')]('c.fax',_0x537f('0x9f'));_0x152f4f['field'](_0x537f('0xa0'),_0x537f('0xa1'));_0x152f4f[_0x537f('0x4a')](_0x537f('0xa2'),_0x537f('0xa3'));_0x152f4f[_0x537f('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x537f('0x35'));}if(_0x1c4e0e['limit'])_0x152f4f[_0x537f('0x25')](_0x1c4e0e[_0x537f('0x25')]);if(_0x1c4e0e[_0x537f('0x23')])_0x152f4f['offset'](_0x1c4e0e[_0x537f('0x23')]);return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x152f4f[_0x537f('0x90')](),_0x22db33);})[_0x537f('0x2e')](function(_0x253400){if(_0x253400[_0x537f('0x45')]>0x0)_0x1a5020['where'](_0x537f('0xa4'),_[_0x537f('0x33')](_0x253400,'id'));return db['sequelize'][_0x537f('0x3f')](_0x1a5020[_0x537f('0x90')](),_0x22db33)['then'](function(_0x1c4ad9){var _0x3668dc=_[_0x537f('0xa5')](_0x1c4ad9,_0x537f('0xa6'));var _0x414563=[];_0x253400['forEach'](function(_0x2bd662){_0x414563[_0x537f('0x39')](updateOpenchannelInteraction(_0x2bd662,_0x68d9d8,_0x3668dc));});return BPromise[_0x537f('0xa7')](_0x414563);});});})[_0x537f('0x2e')](function(_0x579cc0){_0x31f35b[_0x537f('0xa8')]=_0x579cc0;return _0x31f35b;})[_0x537f('0x2e')](respondWithFilteredResult(_0x45fae8,_0x1c4e0e))[_0x537f('0x3a')](handleError(_0x45fae8,null));};exports[_0x537f('0xa9')]=function(_0x53a34a,_0x108afc){var _0x4e17c6={};if(_0x53a34a[_0x537f('0x3f')]['type']&&_0x53a34a[_0x537f('0x3f')]['type']===_0x537f('0x50')){_0x4e17c6[_0x537f('0x50')]=_0x53a34a[_0x537f('0xaa')]['id'];}else{_0x4e17c6['id']=_0x53a34a[_0x537f('0xaa')]['id'];}var _0x10013b={'raw':![],'where':_0x4e17c6},_0xf398bb={};_0xf398bb[_0x537f('0x3e')]=_[_0x537f('0x40')](db[_0x537f('0x3c')]['rawAttributes']);_0xf398bb[_0x537f('0x3f')]=_['keys'](_0x53a34a[_0x537f('0x3f')]);_0xf398bb[_0x537f('0x41')]=_[_0x537f('0x42')](_0xf398bb[_0x537f('0x3e')],_0xf398bb[_0x537f('0x3f')]);_0x10013b[_0x537f('0x43')]=_[_0x537f('0x42')](_0xf398bb['model'],qs['fields'](_0x53a34a[_0x537f('0x3f')][_0x537f('0x44')]));_0x10013b['attributes']=_0x10013b[_0x537f('0x43')][_0x537f('0x45')]?_0x10013b[_0x537f('0x43')]:_0xf398bb[_0x537f('0x3e')];if(_0x53a34a[_0x537f('0x3f')][_0x537f('0xab')]){_0x10013b[_0x537f('0xac')]=[{'all':!![]}];}_0x10013b=_['merge']({},_0x10013b,_0x53a34a[_0x537f('0xad')]);return db[_0x537f('0x3c')][_0x537f('0x5f')](_0x10013b)[_0x537f('0x2e')](handleEntityNotFound(_0x108afc,null))[_0x537f('0x2e')](respondWithResult(_0x108afc,null))[_0x537f('0x3a')](handleError(_0x108afc,null));};exports[_0x537f('0xae')]=function(_0x48c2ac,_0xc30485){return db[_0x537f('0x3c')][_0x537f('0xae')](_0x48c2ac[_0x537f('0xaf')],{})['then'](respondWithResult(_0xc30485,0xc9))[_0x537f('0x3a')](handleError(_0xc30485,null));};exports[_0x537f('0x2c')]=function(_0x4ff04c,_0x39e4a0){if(_0x4ff04c[_0x537f('0xaf')]['id']){delete _0x4ff04c[_0x537f('0xaf')]['id'];}return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x4ff04c[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x39e4a0,null))[_0x537f('0x2e')](saveUpdates(_0x4ff04c['body'],null))['then'](respondWithResult(_0x39e4a0,null))['catch'](handleError(_0x39e4a0,null));};exports['destroy']=function(_0x236590,_0x35e59b){return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x236590[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x35e59b,null))[_0x537f('0x2e')](removeEntity(_0x35e59b,null))[_0x537f('0x3a')](handleError(_0x35e59b,null));};exports[_0x537f('0xb0')]=function(_0x44419f,_0x5a3e07){return db[_0x537f('0x3c')]['describe']()[_0x537f('0x2e')](respondWithResult(_0x5a3e07,null))[_0x537f('0x3a')](handleError(_0x5a3e07,null));};exports[_0x537f('0xb1')]=function(_0x52ebfa,_0x7fecb6,_0x191432){return db[_0x537f('0xb2')][_0x537f('0x5f')]({'where':{'id':_0x52ebfa[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x7fecb6,null))[_0x537f('0x2e')](function(_0x44a679){if(_0x44a679){return _0x44a679['addMessage'](_0x52ebfa[_0x537f('0xaf')]['ids'],_['omit'](_0x52ebfa[_0x537f('0xaf')],['ids','id'])||{});}})[_0x537f('0x2e')](respondWithResult(_0x7fecb6,null))[_0x537f('0x3a')](handleError(_0x7fecb6,null));};exports['getMessages']=function(_0x21d2fc,_0xeb349b,_0x202f01){var _0x22bc0d={'raw':![],'where':{}};var _0x409496={};var _0x5189e1={'count':0x0,'rows':[]};return db[_0x537f('0x3c')][_0x537f('0xb3')]({'where':{'id':_0x21d2fc['params']['id']}})['then'](handleEntityNotFound(_0xeb349b,null))['then'](function(_0x585c3f){if(_0x585c3f){_0x409496[_0x537f('0x3e')]=_[_0x537f('0x40')](db['OpenchannelMessage']['rawAttributes']);_0x409496['query']=_[_0x537f('0x40')](_0x21d2fc[_0x537f('0x3f')]);_0x409496['filters']=_['intersection'](_0x409496[_0x537f('0x3e')],_0x409496['query']);_0x22bc0d['attributes']=_[_0x537f('0x42')](_0x409496['model'],qs[_0x537f('0x44')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x44')]));_0x22bc0d['attributes']=_0x22bc0d[_0x537f('0x43')]['length']?_0x22bc0d[_0x537f('0x43')]:_0x409496['model'];if(!_0x21d2fc[_0x537f('0x3f')][_0x537f('0x46')](_0x537f('0xb4'))){_0x22bc0d[_0x537f('0x25')]=qs[_0x537f('0x25')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x25')]);_0x22bc0d[_0x537f('0x23')]=qs[_0x537f('0x23')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x23')]);}_0x22bc0d[_0x537f('0x86')]=qs[_0x537f('0x47')](_0x21d2fc[_0x537f('0x3f')]['sort']);_0x22bc0d['where']=qs[_0x537f('0x41')](_[_0x537f('0xb5')](_0x21d2fc[_0x537f('0x3f')],_0x409496[_0x537f('0x41')]));_0x22bc0d['where'][_0x537f('0xa6')]=_0x585c3f['id'];if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0x7e')]){_0x22bc0d['where']=_[_0x537f('0xb6')](_0x22bc0d[_0x537f('0x48')],{'$or':_[_0x537f('0x33')](_0x22bc0d[_0x537f('0x43')],function(_0x559209){var _0xd484e9={};_0xd484e9[_0x559209]={'$like':'%'+_0x21d2fc[_0x537f('0x3f')][_0x537f('0x7e')]+'%'};return _0xd484e9;})});}if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0xb7')]){var _0x56ca3c=_0x21d2fc[_0x537f('0x3f')][_0x537f('0xb7')][_0x537f('0x37')](',');var _0x3aa6bc={};_0x3aa6bc[_0x56ca3c[0x0]]={'$gte':moment(_0x56ca3c[0x1])[_0x537f('0xb8')](_0x537f('0xb9'))};_0x22bc0d['where']=_[_0x537f('0xb6')](_0x22bc0d[_0x537f('0x48')],_0x3aa6bc);}_0x22bc0d=_['merge']({},_0x22bc0d,_0x21d2fc[_0x537f('0xad')]);return db['OpenchannelMessage'][_0x537f('0x26')]({'where':_0x22bc0d[_0x537f('0x48')]})[_0x537f('0x2e')](function(_0x10c39e){_0x5189e1[_0x537f('0x26')]=_0x10c39e;if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0xab')]){_0x22bc0d[_0x537f('0xac')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x537f('0xba')](_0x22bc0d);})[_0x537f('0x2e')](function(_0x2710f2){_0x5189e1[_0x537f('0xa8')]=_0x2710f2;return _0x5189e1;});}})[_0x537f('0x2e')](respondWithFilteredResult(_0xeb349b,_0x22bc0d))[_0x537f('0x3a')](handleError(_0xeb349b,null));};exports[_0x537f('0xbb')]=function(_0x2c2966,_0x1a2369,_0x25e99c){return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x2c2966[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x1a2369,null))['then'](function(_0x33692a){if(_0x33692a){return _0x33692a[_0x537f('0xbc')](_0x2c2966[_0x537f('0xaf')][_0x537f('0xbd')],_[_0x537f('0xbe')](_0x2c2966[_0x537f('0xaf')],[_0x537f('0xbd'),'id'])||{})[_0x537f('0xbf')](function(){return db[_0x537f('0x6c')][_0x537f('0xba')]({'attributes':['id',_0x537f('0x31'),'color'],'where':{'id':_0x2c2966[_0x537f('0xaf')][_0x537f('0xbd')]}});})[_0x537f('0x2e')](function(_0x333258){socket['emit'](_0x537f('0xc0'),{'id':Number(_0x2c2966[_0x537f('0xaa')]['id']),'tags':_0x333258||[]});return{'id':Number(_0x2c2966[_0x537f('0xaa')]['id']),'tags':_0x333258||[]};});}})[_0x537f('0x2e')](respondWithResult(_0x1a2369,null))[_0x537f('0x3a')](handleError(_0x1a2369,null));};exports[_0x537f('0xc1')]=function(_0x573bd7,_0x512bbf,_0x3681d2){return db[_0x537f('0x3c')]['find']({'where':{'id':_0x573bd7[_0x537f('0xaa')]['id']}})['then'](handleEntityNotFound(_0x512bbf,null))[_0x537f('0x2e')](function(_0x40d087){if(_0x40d087){return _0x40d087['removeTags'](_0x573bd7[_0x537f('0x3f')][_0x537f('0xbd')]);}})[_0x537f('0x2e')](respondWithStatusCode(_0x512bbf,null))[_0x537f('0x3a')](handleError(_0x512bbf,null));};exports[_0x537f('0xc2')]=function(_0xcec428,_0xd952d0){var _0x57b329=moment()['unix']()[_0x537f('0x90')]();var _0x7f843a=path[_0x537f('0xc3')](config[_0x537f('0xc4')],'server',_0x537f('0xc5'),_0x537f('0xc6'));var _0x767b60=path[_0x537f('0xc3')](config[_0x537f('0xc4')],_0x537f('0xc7'),'files',_0x537f('0xc8'));var _0x3842cf=path[_0x537f('0xc3')](_0x7f843a,_0x57b329);var _0x4dc2b8=util[_0x537f('0xb8')](_0x537f('0xc9'),_0xcec428['params']['id'],_0x57b329);var _0x2643eb=path[_0x537f('0xc3')](_0x7f843a,_0x4dc2b8);var _0x5d17e0=[];_0x5d17e0['push']({'model':db[_0x537f('0x6f')],'as':_0x537f('0x6f'),'attributes':['id',_0x537f('0x34')],'raw':!![]});_0x5d17e0[_0x537f('0x39')]({'model':db[_0x537f('0xca')],'as':_0x537f('0x63'),'attributes':['id',_0x537f('0xcb'),_0x537f('0xcc')],'raw':!![]});if(_0xcec428[_0x537f('0x3f')]['attachments']){_0x5d17e0[_0x537f('0x39')]({'model':db['Attachment'],'as':_0x537f('0xcd'),'raw':!![]});}var _0x1a4e93=[{'model':db[_0x537f('0xb2')],'as':_0x537f('0xce'),'attributes':['id',_0x537f('0xaf'),_0x537f('0x75'),_0x537f('0xcf'),_0x537f('0xd0'),'read'],'include':_0x5d17e0}];_0x1a4e93['push']({'model':db[_0x537f('0xd1')],'as':'Account','attributes':['id',_0x537f('0x31')]});_0x1a4e93[_0x537f('0x39')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0xcec428[_0x537f('0xaa')]['id']},'include':_0x1a4e93})[_0x537f('0x2e')](handleEntityNotFound(_0xd952d0,null))[_0x537f('0x2e')](function(_0x9afe9e){if(_0x9afe9e){var _0x41d732=_0x9afe9e[_0x537f('0xd2')]({'plain':!![]});fs[_0x537f('0xd3')](_0x3842cf);var _0x52a2d4={'channel':_0x537f('0xd4'),'account':_0x41d732[_0x537f('0xd5')]['name'],'agent':_0x41d732[_0x537f('0xd6')]?_0x41d732[_0x537f('0xd6')][_0x537f('0x34')]:_0x537f('0xd7'),'createdAt':moment(_0x41d732['createdAt'])[_0x537f('0xb8')](_0x537f('0xb9'))[_0x537f('0x90')](),'closedAt':_0x41d732['closed']?moment(_0x41d732[_0x537f('0xd8')])[_0x537f('0xb8')](_0x537f('0xb9'))[_0x537f('0x90')]():'','disposition':_0x41d732[_0x537f('0xd9')],'visibility':_0x41d732[_0x537f('0xda')]?_0x537f('0xdb'):_0x537f('0xdc'),'messages':_(_0x41d732[_0x537f('0xce')])[_0x537f('0x7e')]({'secret':![]})[_0x537f('0x33')](function(_0x13b42d){if(_0x13b42d[_0x537f('0xcd')]){var _0x3bd7fa=path[_0x537f('0xc3')](_0x767b60,_0x13b42d[_0x537f('0xcd')][_0x537f('0xdd')]);if(fs[_0x537f('0xde')](_0x3bd7fa)){fs['createReadStream'](_0x3bd7fa)[_0x537f('0xdf')](fs[_0x537f('0xe0')](path[_0x537f('0xc3')](_0x3842cf,_0x13b42d[_0x537f('0xcd')]['basename'])));}}return{'date':moment(_0x13b42d[_0x537f('0x75')])[_0x537f('0xb8')](_0x537f('0xb9'))['toString'](),'sender':_0x13b42d[_0x537f('0xcf')]===_0x537f('0xe1')?_0x13b42d['User']?_0x13b42d[_0x537f('0x6f')][_0x537f('0x34')]:_0x537f('0xe2'):_0x13b42d[_0x537f('0x63')][_0x537f('0xcb')]+(_0x13b42d[_0x537f('0x63')]['lastName']?'\x20'+_0x13b42d['Contact'][_0x537f('0xcc')]:''),'body':_0x13b42d[_0x537f('0xcd')]?_0x13b42d[_0x537f('0xcd')][_0x537f('0xdd')]:_0x13b42d[_0x537f('0xaf')],'direction':_0x13b42d[_0x537f('0xcf')]===_0x537f('0xe1')?'A':'C','secret':_0x13b42d[_0x537f('0xd0')],'read':_0x13b42d[_0x537f('0x79')],'attachment':_0x13b42d[_0x537f('0xcd')]};})[_0x537f('0x60')]()};return ejs[_0x537f('0xe3')](path[_0x537f('0xc3')](config['root'],_0x537f('0xc7'),_0x537f('0xe4'),_0x537f('0xe5')),{'interaction':_0x52a2d4})[_0x537f('0x2e')](function(_0x51b806){var _0x422e4a=path[_0x537f('0xc3')](_0x3842cf,_0x537f('0xe6')+_0x41d732['id']+'-'+_0x57b329+_0x537f('0xe7'));var _0x3d9339={'path':_0x422e4a,'channel':_0x537f('0xd4'),'interactionId':_0x41d732['id']};return pdf['createPdfFromHTML'](_0x51b806,_0x3d9339);})['then'](function(){return new BPromise(function(_0x2d9202,_0x5b6dd2){zipdir(_0x3842cf,{'saveTo':_0x2643eb},function(_0x47ecb5,_0x58f616){if(_0x47ecb5)return _0x5b6dd2(_0x47ecb5);return _0x2d9202(_0x58f616);});})['then'](function(){return new BPromise(function(_0x2b12bc,_0x44c7e6){rimraf(_0x3842cf,function(_0x2e19a6){if(_0x2e19a6)_0x44c7e6(_0x2e19a6);return _0x2b12bc();});});})[_0x537f('0x2e')](function(){return _0xd952d0[_0x537f('0xc2')](_0x2643eb,_0x4dc2b8,function(_0x46a037){if(_0x46a037){console[_0x537f('0xe8')](_0x537f('0xe9'),_0x46a037);}else{fs['unlinkSync'](_0x2643eb);}});});});}else{return _0xd952d0['sendStatus'](0xc8);}})[_0x537f('0x3a')](handleError(_0xd952d0,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 24fc28f..e3948dc 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 _0xb789=['exports','events','../../mysqldb','OpenchannelInteraction','save','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xb789,0x188));var _0x9b78=function(_0x4c3c97,_0x5ec114){_0x4c3c97=_0x4c3c97-0x0;var _0x112244=_0xb789[_0x4c3c97];return _0x112244;};'use strict';var EventEmitter=require(_0x9b78('0x0'));var OpenchannelInteraction=require(_0x9b78('0x1'))['db'][_0x9b78('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b78('0x3'),'afterUpdate':_0x9b78('0x4'),'afterDestroy':_0x9b78('0x5')};function emitEvent(_0x3b15f2){return function(_0x5beecf,_0x3d8c7f,_0x696c5e){_0x5beecf['getUsers']({'attributes':['id'],'raw':!![]})[_0x9b78('0x6')](function(_0x1506a5){_0x5beecf['setDataValue'](_0x9b78('0x7'),_0x1506a5[_0x9b78('0x8')](function(_0x59e61e){return{'id':_0x59e61e['id']};}));return OpenchannelMessage[_0x9b78('0x9')]({'where':{'OpenchannelInteractionId':_0x5beecf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3e214f){_0x5beecf[_0x9b78('0xa')](_0x9b78('0xb'),_0x3e214f[_0x9b78('0xc')]);OpenchannelInteractionEvents['emit'](_0x3b15f2+':'+_0x5beecf['id'],_0x5beecf);OpenchannelInteractionEvents[_0x9b78('0xd')](_0x3b15f2,_0x5beecf);_0x696c5e(null);})['catch'](_0x696c5e(null));};}for(var e in events){if(events[_0x9b78('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x9b78('0xf')](e,emitEvent(event));}}module[_0x9b78('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6a39=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6a39,0xbb));var _0x96a3=function(_0x105b20,_0x388d13){_0x105b20=_0x105b20-0x0;var _0x357455=_0x6a39[_0x105b20];return _0x357455;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x96a3('0x0'))['db'][_0x96a3('0x1')];var OpenchannelMessage=require(_0x96a3('0x0'))['db'][_0x96a3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x96a3('0x3')](0x0);var events={'afterCreate':_0x96a3('0x4'),'afterUpdate':_0x96a3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4384f9){return function(_0x439692,_0x3b97aa,_0x2e25d1){_0x439692['getUsers']({'attributes':['id'],'raw':!![]})[_0x96a3('0x6')](function(_0x2a6f7a){_0x439692[_0x96a3('0x7')]('Users',_0x2a6f7a[_0x96a3('0x8')](function(_0x2f92ef){return{'id':_0x2f92ef['id']};}));return OpenchannelMessage[_0x96a3('0x9')]({'where':{'OpenchannelInteractionId':_0x439692['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96a3('0x6')](function(_0x3dc7a2){_0x439692[_0x96a3('0x7')](_0x96a3('0xa'),_0x3dc7a2[_0x96a3('0xb')]);OpenchannelInteractionEvents['emit'](_0x4384f9+':'+_0x439692['id'],_0x439692);OpenchannelInteractionEvents[_0x96a3('0xc')](_0x4384f9,_0x439692);_0x2e25d1(null);})[_0x96a3('0xd')](_0x2e25d1(null));};}for(var e in events){if(events[_0x96a3('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x96a3('0xf')](e,emitEvent(event));}}module[_0x96a3('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b8e0139..14919ae 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 _0x00fc=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x416205,_0x38b0e4){var _0x59fe6c=function(_0x13fa52){while(--_0x13fa52){_0x416205['push'](_0x416205['shift']());}};_0x59fe6c(++_0x38b0e4);}(_0x00fc,0x143));var _0xc00f=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x00fc[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0xc00f('0x0'));var util=require('util');var logger=require(_0xc00f('0x1'))(_0xc00f('0x2'));var moment=require(_0xc00f('0x3'));var BPromise=require(_0xc00f('0x4'));var rp=require(_0xc00f('0x5'));var fs=require('fs');var path=require(_0xc00f('0x6'));var rimraf=require(_0xc00f('0x7'));var config=require(_0xc00f('0x8'));var attributes=require(_0xc00f('0x9'));module[_0xc00f('0xa')]=function(_0x3662bf,_0x4813f8){return _0x3662bf[_0xc00f('0xb')](_0xc00f('0xc'),attributes,{'tableName':_0xc00f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc00f('0xe'),'collate':_0xc00f('0xf'),'hooks':{'beforeUpdate':function(_0x9620f2,_0x13180e,_0xc62134){if(_0x9620f2[_0xc00f('0x10')](_0xc00f('0x11'))){_0x9620f2[_0xc00f('0x12')]=moment()[_0xc00f('0x13')](_0xc00f('0x14'));}_0xc62134(null,_0x9620f2);}}});}; \ No newline at end of file +var _0x5fb2=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x53f132,_0x441cf9){var _0x18925d=function(_0x1ba5d8){while(--_0x1ba5d8){_0x53f132['push'](_0x53f132['shift']());}};_0x18925d(++_0x441cf9);}(_0x5fb2,0xad));var _0x25fb=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0x5fb2[_0x5b734b];return _0x2a15a3;};'use strict';var _=require(_0x25fb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25fb('0x1'));var BPromise=require(_0x25fb('0x2'));var rp=require(_0x25fb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25fb('0x4'));var config=require(_0x25fb('0x5'));var attributes=require(_0x25fb('0x6'));module['exports']=function(_0x7e549f,_0x135a73){return _0x7e549f[_0x25fb('0x7')](_0x25fb('0x8'),attributes,{'tableName':_0x25fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x25fb('0xa'),'hooks':{'beforeUpdate':function(_0x2fd92a,_0xadcb49,_0x18c790){if(_0x2fd92a[_0x25fb('0xb')](_0x25fb('0xc'))){_0x2fd92a[_0x25fb('0xd')]=moment()['format'](_0x25fb('0xe'));}_0x18c790(null,_0x2fd92a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d4ca4e7..c0fddb6 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 _0xe192=['../../config/utils','../../config/logger','client','http','redis','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','bluebird','ioredis'];(function(_0x159395,_0x2457c8){var _0x44e2af=function(_0x30e137){while(--_0x30e137){_0x159395['push'](_0x159395['shift']());}};_0x44e2af(++_0x2457c8);}(_0xe192,0x1b8));var _0x2e19=function(_0x502b80,_0x4b7c9a){_0x502b80=_0x502b80-0x0;var _0x2e6df8=_0xe192[_0x502b80];return _0x2e6df8;};'use strict';var _=require(_0x2e19('0x0'));var util=require(_0x2e19('0x1'));var moment=require('moment');var BPromise=require(_0x2e19('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e19('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e19('0x4'));var logger=require(_0x2e19('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e19('0x6')][_0x2e19('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2e19('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e19('0x8')]));require('./openchannelInteraction.socket')[_0x2e19('0x9')](socket);function respondWithRpcPromise(_0x18931a,_0x54bd9f,_0x3fa7fe){return new BPromise(function(_0x55dff5,_0x411aee){return client[_0x2e19('0xa')](_0x18931a,_0x3fa7fe)[_0x2e19('0xb')](function(_0x2920b7){logger[_0x2e19('0xc')](_0x2e19('0xd'),_0x54bd9f,_0x2e19('0xe'));logger[_0x2e19('0xf')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x54bd9f,_0x2e19('0xe'),JSON[_0x2e19('0x10')](_0x2920b7));if(_0x2920b7[_0x2e19('0x11')]){if(_0x2920b7[_0x2e19('0x11')][_0x2e19('0x12')]===0x1f4){logger[_0x2e19('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x54bd9f,_0x2920b7[_0x2e19('0x11')][_0x2e19('0x13')]);return _0x411aee(_0x2920b7[_0x2e19('0x11')][_0x2e19('0x13')]);}logger[_0x2e19('0x11')](_0x2e19('0xd'),_0x54bd9f,_0x2920b7['error']['message']);return _0x55dff5(_0x2920b7[_0x2e19('0x11')]['message']);}else{logger[_0x2e19('0xc')]('OpenchannelInteraction,\x20%s,\x20%s',_0x54bd9f,_0x2e19('0xe'));_0x55dff5(_0x2920b7[_0x2e19('0x14')][_0x2e19('0x13')]);}})['catch'](function(_0x387a03){logger[_0x2e19('0x11')](_0x2e19('0xd'),_0x54bd9f,_0x387a03);_0x411aee(_0x387a03);});});}exports[_0x2e19('0x15')]=function(_0x54929e){var _0x214785=this;return new Promise(function(_0x33b438,_0x34165b){return db['OpenchannelInteraction'][_0x2e19('0x16')](_0x54929e[_0x2e19('0x17')],{'raw':_0x54929e[_0x2e19('0x18')]?_0x54929e[_0x2e19('0x18')][_0x2e19('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54929e[_0x2e19('0x18')]?_0x54929e[_0x2e19('0x18')][_0x2e19('0x1a')]||null:null,'attributes':_0x54929e['options']?_0x54929e[_0x2e19('0x18')]['attributes']||null:null,'limit':_0x54929e[_0x2e19('0x18')]?_0x54929e[_0x2e19('0x18')][_0x2e19('0x1b')]||null:null})[_0x2e19('0xb')](function(_0x4ae574){logger[_0x2e19('0xc')](_0x2e19('0x15'),_0x54929e);logger['debug']('UpdateOpenchannelInteraction',_0x54929e,JSON[_0x2e19('0x10')](_0x4ae574));_0x33b438(_0x4ae574);})['catch'](function(_0x531684){logger[_0x2e19('0x11')](_0x2e19('0x15'),_0x531684[_0x2e19('0x13')],_0x54929e);_0x34165b(_0x214785['error'](0x1f4,_0x531684[_0x2e19('0x13')]));});});};exports[_0x2e19('0x1c')]=function(_0x3c4490){return new Promise(function(_0x12a47d,_0x309c7a){return db[_0x2e19('0x1d')][_0x2e19('0x1e')]({'where':_0x3c4490[_0x2e19('0x18')]?_0x3c4490[_0x2e19('0x18')][_0x2e19('0x1a')]||null:null})[_0x2e19('0xb')](function(_0x2d5d20){if(_0x2d5d20){return _0x2d5d20[_0x2e19('0x1f')](_0x3c4490['body'][_0x2e19('0x20')],_[_0x2e19('0x21')](_0x3c4490[_0x2e19('0x17')],[_0x2e19('0x20'),'id'])||{});}})[_0x2e19('0x22')](function(_0xb60fed){logger[_0x2e19('0xc')]('AddTags',_0x3c4490);logger[_0x2e19('0xf')](_0x2e19('0x23'),_0x3c4490,JSON[_0x2e19('0x10')](_0xb60fed));_0x12a47d(_0xb60fed);})[_0x2e19('0x24')](function(_0x29a28e){logger['error'](_0x2e19('0x23'),_0x29a28e[_0x2e19('0x13')],_0x3c4490);_0x309c7a(_this['error'](0x1f4,_0x29a28e[_0x2e19('0x13')]));});});}; \ No newline at end of file +var _0xc5e5=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','request\x20sent','debug','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','limit','then','addTags','ids','omit','spread','AddTags'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xc5e5,0x19a));var _0x5c5e=function(_0x48ab1b,_0x4ddf0f){_0x48ab1b=_0x48ab1b-0x0;var _0x580213=_0xc5e5[_0x48ab1b];return _0x580213;};'use strict';var _=require(_0x5c5e('0x0'));var util=require(_0x5c5e('0x1'));var moment=require('moment');var BPromise=require(_0x5c5e('0x2'));var rs=require(_0x5c5e('0x3'));var fs=require('fs');var Redis=require(_0x5c5e('0x4'));var db=require(_0x5c5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c5e('0x6'))(_0x5c5e('0x7'));var config=require(_0x5c5e('0x8'));var jayson=require(_0x5c5e('0x9'));var client=jayson[_0x5c5e('0xa')][_0x5c5e('0xb')]({'port':0x232a});config[_0x5c5e('0xc')]=_[_0x5c5e('0xd')](config[_0x5c5e('0xc')],{'host':_0x5c5e('0xe'),'port':0x18eb});var socket=require(_0x5c5e('0xf'))(new Redis(config[_0x5c5e('0xc')]));require(_0x5c5e('0x10'))['register'](socket);function respondWithRpcPromise(_0x18f2ea,_0x1988ca,_0x1466ce){return new BPromise(function(_0x3d1798,_0x338fe2){return client[_0x5c5e('0x11')](_0x18f2ea,_0x1466ce)['then'](function(_0x2d0907){logger[_0x5c5e('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1988ca,_0x5c5e('0x13'));logger[_0x5c5e('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1988ca,_0x5c5e('0x13'),JSON[_0x5c5e('0x15')](_0x2d0907));if(_0x2d0907[_0x5c5e('0x16')]){if(_0x2d0907[_0x5c5e('0x16')][_0x5c5e('0x17')]===0x1f4){logger[_0x5c5e('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1988ca,_0x2d0907[_0x5c5e('0x16')]['message']);return _0x338fe2(_0x2d0907['error'][_0x5c5e('0x18')]);}logger[_0x5c5e('0x16')](_0x5c5e('0x19'),_0x1988ca,_0x2d0907[_0x5c5e('0x16')]['message']);return _0x3d1798(_0x2d0907['error'][_0x5c5e('0x18')]);}else{logger[_0x5c5e('0x12')](_0x5c5e('0x19'),_0x1988ca,_0x5c5e('0x13'));_0x3d1798(_0x2d0907[_0x5c5e('0x1a')][_0x5c5e('0x18')]);}})[_0x5c5e('0x1b')](function(_0x1808c3){logger[_0x5c5e('0x16')](_0x5c5e('0x19'),_0x1988ca,_0x1808c3);_0x338fe2(_0x1808c3);});});}exports[_0x5c5e('0x1c')]=function(_0x33eb80){var _0x16be2f=this;return new Promise(function(_0x1bbf5c,_0x4cbc13){return db[_0x5c5e('0x1d')]['update'](_0x33eb80[_0x5c5e('0x1e')],{'raw':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80[_0x5c5e('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80[_0x5c5e('0x1f')][_0x5c5e('0x20')]||null:null,'attributes':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80['options'][_0x5c5e('0x21')]||null:null,'limit':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80['options'][_0x5c5e('0x22')]||null:null})[_0x5c5e('0x23')](function(_0x3b99d9){logger[_0x5c5e('0x12')](_0x5c5e('0x1c'),_0x33eb80);logger['debug'](_0x5c5e('0x1c'),_0x33eb80,JSON[_0x5c5e('0x15')](_0x3b99d9));_0x1bbf5c(_0x3b99d9);})[_0x5c5e('0x1b')](function(_0x1834b4){logger[_0x5c5e('0x16')](_0x5c5e('0x1c'),_0x1834b4[_0x5c5e('0x18')],_0x33eb80);_0x4cbc13(_0x16be2f[_0x5c5e('0x16')](0x1f4,_0x1834b4[_0x5c5e('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5c0120){return new Promise(function(_0xd77c9b,_0x581b0b){return db[_0x5c5e('0x1d')]['find']({'where':_0x5c0120[_0x5c5e('0x1f')]?_0x5c0120[_0x5c5e('0x1f')][_0x5c5e('0x20')]||null:null})[_0x5c5e('0x23')](function(_0xba4dc3){if(_0xba4dc3){return _0xba4dc3[_0x5c5e('0x24')](_0x5c0120[_0x5c5e('0x1e')][_0x5c5e('0x25')],_[_0x5c5e('0x26')](_0x5c0120[_0x5c5e('0x1e')],[_0x5c5e('0x25'),'id'])||{});}})[_0x5c5e('0x27')](function(_0x1b6142){logger['info']('AddTags',_0x5c0120);logger['debug'](_0x5c5e('0x28'),_0x5c0120,JSON['stringify'](_0x1b6142));_0xd77c9b(_0x1b6142);})[_0x5c5e('0x1b')](function(_0x34c3f3){logger[_0x5c5e('0x16')](_0x5c5e('0x28'),_0x34c3f3['message'],_0x5c0120);_0x581b0b(_this[_0x5c5e('0x16')](0x1f4,_0x34c3f3[_0x5c5e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index aaf7c91..22cf231 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 _0x678b=['./openchannelInteraction.events','save','emit','length','openchannelInteraction:'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x678b,0x64));var _0xb678=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x678b[_0x576170];return _0x397c70;};'use strict';var OpenchannelInteractionEvents=require(_0xb678('0x0'));var events=[_0xb678('0x1'),'remove','update'];function createListener(_0x15fe62,_0x477887){return function(_0x587860){_0x477887[_0xb678('0x2')](_0x15fe62,_0x587860);};}function removeListener(_0x56bd52,_0x3fc573){return function(){OpenchannelInteractionEvents['removeListener'](_0x56bd52,_0x3fc573);};}exports['register']=function(_0xd1446b){for(var _0x598c75=0x0,_0x407add=events[_0xb678('0x3')];_0x598c75<_0x407add;_0x598c75++){var _0x9f76ea=events[_0x598c75];var _0x2719d2=createListener(_0xb678('0x4')+_0x9f76ea,_0xd1446b);OpenchannelInteractionEvents['on'](_0x9f76ea,_0x2719d2);}}; \ No newline at end of file +var _0xc665=['save','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x5ded3e,_0x18011d){var _0x505b3e=function(_0x31c8c5){while(--_0x31c8c5){_0x5ded3e['push'](_0x5ded3e['shift']());}};_0x505b3e(++_0x18011d);}(_0xc665,0x1df));var _0x5c66=function(_0x48084f,_0x2d1e50){_0x48084f=_0x48084f-0x0;var _0x215480=_0xc665[_0x48084f];return _0x215480;};'use strict';var OpenchannelInteractionEvents=require(_0x5c66('0x0'));var events=[_0x5c66('0x1'),'remove','update'];function createListener(_0x34c05f,_0x19a1cd){return function(_0x3f5820){_0x19a1cd[_0x5c66('0x2')](_0x34c05f,_0x3f5820);};}function removeListener(_0x4865b9,_0x27a024){return function(){OpenchannelInteractionEvents[_0x5c66('0x3')](_0x4865b9,_0x27a024);};}exports[_0x5c66('0x4')]=function(_0x3933e5){for(var _0x5ba9e7=0x0,_0x4b1ac4=events[_0x5c66('0x5')];_0x5ba9e7<_0x4b1ac4;_0x5ba9e7++){var _0x355019=events[_0x5ba9e7];var _0x2048ed=createListener('openchannelInteraction:'+_0x355019,_0x3933e5);OpenchannelInteractionEvents['on'](_0x355019,_0x2048ed);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index d365e5c..7b0c7dd 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x439501,_0x3047a2){var _0x850956=function(_0x1b11ca){while(--_0x1b11ca){_0x439501['push'](_0x439501['shift']());}};_0x850956(++_0x3047a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index af1d728..4d0ff3a 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 _0xd3f5=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd3f5,0x147));var _0x5d3f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd3f5[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x5d3f('0x0'));module[_0x5d3f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5d3f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5d3f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5d3f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5d3f('0x4')]('in',_0x5d3f('0x5')),'defaultValue':_0x5d3f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5d3f('0x6')]},'providerName':{'type':Sequelize[_0x5d3f('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3495=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x3e2b4e,_0x5cba62){var _0xa545e9=function(_0x4c3c1a){while(--_0x4c3c1a){_0x3e2b4e['push'](_0x3e2b4e['shift']());}};_0xa545e9(++_0x5cba62);}(_0x3495,0x1de));var _0x5349=function(_0x17c0cc,_0x5eba4e){_0x17c0cc=_0x17c0cc-0x0;var _0xbd3d8a=_0x3495[_0x17c0cc];return _0xbd3d8a;};'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 96f48ef..3bbddcd 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 _0x7212=['rejectMessage','ContactId','contact','eml-format','request-promise','util','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','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','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','limit','undefined','count','set','apply','reject','update','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','keys','query','filters','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','length','find','create','body','destroy','openchannel-interactions','openchannel','readAt','format','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x1032bf,_0x44910a){var _0x2aa822=function(_0x40104b){while(--_0x40104b){_0x1032bf['push'](_0x1032bf['shift']());}};_0x2aa822(++_0x44910a);}(_0x7212,0x1e3));var _0x2721=function(_0x2b4ac6,_0x4baabb){_0x2b4ac6=_0x2b4ac6-0x0;var _0x4ef86b=_0x7212[_0x2b4ac6];return _0x4ef86b;};'use strict';var emlformat=require(_0x2721('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2721('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2721('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0x2721('0x3'));var ejs=require(_0x2721('0x4'));var fs=require('fs');var fs_extra=require(_0x2721('0x5'));var _=require('lodash');var squel=require(_0x2721('0x6'));var crypto=require(_0x2721('0x7'));var jsforce=require(_0x2721('0x8'));var deskjs=require(_0x2721('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2721('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2721('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2721('0xc'))(_0x2721('0xd'));var utils=require(_0x2721('0xe'));var config=require(_0x2721('0xf'));var licenseUtil=require(_0x2721('0x10'));var db=require(_0x2721('0x11'))['db'];config['redis']=_['defaults'](config[_0x2721('0x12')],{'host':_0x2721('0x13'),'port':0x18eb});var socket=require(_0x2721('0x14'))(new Redis(config[_0x2721('0x12')]));require(_0x2721('0x15'))[_0x2721('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2721('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x2721('0x17')][_0x2721('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xae4f44,_0x1a0dbb,_0x79c2e,_0xd860ff){return new BPromise(function(_0x1b9fe1,_0x172d26){var _0x2ff05c=_0xd860ff||client;return _0x2ff05c[_0x2721('0x19')](_0xae4f44,_0x79c2e)[_0x2721('0x1a')](function(_0x186285){logger['info'](_0x2721('0x1b'),_0x1a0dbb,_0x2721('0x1c'));logger[_0x2721('0x1d')](_0x2721('0x1e'),_0x1a0dbb,'request\x20sent',JSON[_0x2721('0x1f')](_0x186285));if(_0x186285[_0x2721('0x20')]){if(_0x186285[_0x2721('0x20')][_0x2721('0x21')]===0x1f4){logger['error'](_0x2721('0x1b'),_0x1a0dbb,_0x186285['error'][_0x2721('0x22')]);return _0x172d26(_0x186285[_0x2721('0x20')][_0x2721('0x22')]);}logger[_0x2721('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1a0dbb,_0x186285['error'][_0x2721('0x22')]);return _0x1b9fe1(_0x186285[_0x2721('0x20')][_0x2721('0x22')]);}else{logger['info'](_0x2721('0x1b'),_0x1a0dbb,_0x2721('0x1c'));_0x1b9fe1(_0x186285[_0x2721('0x23')]['message']);}})['catch'](function(_0x28c968){logger[_0x2721('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1a0dbb,_0x28c968);_0x172d26(_0x28c968);});});}function respondWithStatusCode(_0xef2b48,_0x3e7028){_0x3e7028=_0x3e7028||0xcc;return function(_0x500f83){if(_0x500f83){return _0xef2b48[_0x2721('0x24')](_0x3e7028);}return _0xef2b48[_0x2721('0x25')](_0x3e7028)[_0x2721('0x26')]();};}function respondWithResult(_0x36f2c9,_0x27c083){_0x27c083=_0x27c083||0xc8;return function(_0x3a556a){if(_0x3a556a){return _0x36f2c9[_0x2721('0x25')](_0x27c083)[_0x2721('0x27')](_0x3a556a);}};}function respondWithFilteredResult(_0x396b9c,_0x2ae791){return function(_0x3f56a9){if(_0x3f56a9){var _0x49437c=typeof _0x2ae791[_0x2721('0x28')]==='undefined'&&typeof _0x2ae791[_0x2721('0x29')]===_0x2721('0x2a');var _0x1c5e49=_0x3f56a9[_0x2721('0x2b')];var _0xec099b=_0x49437c?0x0:_0x2ae791['offset'];var _0x2871ec=_0x49437c?_0x3f56a9[_0x2721('0x2b')]:_0x2ae791[_0x2721('0x28')]+_0x2ae791[_0x2721('0x29')];var _0xbbf12f;if(_0x2871ec>=_0x1c5e49){_0x2871ec=_0x1c5e49;_0xbbf12f=0xc8;}else{_0xbbf12f=0xce;}_0x396b9c[_0x2721('0x25')](_0xbbf12f);return _0x396b9c[_0x2721('0x2c')]('Content-Range',_0xec099b+'-'+_0x2871ec+'/'+_0x1c5e49)[_0x2721('0x27')](_0x3f56a9);}return null;};}function patchUpdates(_0x5ad530){return function(_0x27cb59){try{jsonpatch[_0x2721('0x2d')](_0x27cb59,_0x5ad530,!![]);}catch(_0x42dda5){return BPromise[_0x2721('0x2e')](_0x42dda5);}return _0x27cb59['save']();};}function saveUpdates(_0x442b93,_0xeae5d4){return function(_0x48ca46){if(_0x48ca46){return _0x48ca46[_0x2721('0x2f')](_0x442b93)[_0x2721('0x1a')](function(_0x3df767){return _0x3df767;});}return null;};}function removeEntity(_0xee379c,_0x327c8c){return function(_0x4a10e1){if(_0x4a10e1){return _0x4a10e1['destroy']()['then'](function(){_0xee379c[_0x2721('0x25')](0xcc)[_0x2721('0x26')]();});}};}function handleEntityNotFound(_0x9204a7,_0x17214b){return function(_0x3680d3){if(!_0x3680d3){_0x9204a7['sendStatus'](0x194);}return _0x3680d3;};}function handleError(_0x143098,_0x1826ad){_0x1826ad=_0x1826ad||0x1f4;return function(_0x25aee9){logger[_0x2721('0x20')](_0x25aee9[_0x2721('0x30')]);if(_0x25aee9['name']){delete _0x25aee9[_0x2721('0x31')];}_0x143098[_0x2721('0x25')](_0x1826ad)['send'](_0x25aee9);};}exports[_0x2721('0x32')]=function(_0xb9e986,_0x575a17){var _0x5c4562={},_0x519a15={},_0x1050a4={'count':0x0,'rows':[]};var _0x483a17=_[_0x2721('0x33')](db[_0x2721('0x34')][_0x2721('0x35')],function(_0x46786b){return{'name':_0x46786b[_0x2721('0x36')],'type':_0x46786b[_0x2721('0x37')][_0x2721('0x38')]};});_0x519a15['model']=_[_0x2721('0x33')](_0x483a17,_0x2721('0x31'));_0x519a15['query']=_[_0x2721('0x39')](_0xb9e986[_0x2721('0x3a')]);_0x519a15[_0x2721('0x3b')]=_['intersection'](_0x519a15['model'],_0x519a15['query']);_0x5c4562[_0x2721('0x3c')]=_['intersection'](_0x519a15[_0x2721('0x3d')],qs[_0x2721('0x3e')](_0xb9e986[_0x2721('0x3a')][_0x2721('0x3e')]));_0x5c4562['attributes']=_0x5c4562[_0x2721('0x3c')]['length']?_0x5c4562[_0x2721('0x3c')]:_0x519a15[_0x2721('0x3d')];if(!_0xb9e986['query'][_0x2721('0x3f')](_0x2721('0x40'))){_0x5c4562[_0x2721('0x29')]=qs[_0x2721('0x29')](_0xb9e986[_0x2721('0x3a')][_0x2721('0x29')]);_0x5c4562[_0x2721('0x28')]=qs[_0x2721('0x28')](_0xb9e986[_0x2721('0x3a')][_0x2721('0x28')]);}_0x5c4562['order']=qs[_0x2721('0x41')](_0xb9e986[_0x2721('0x3a')][_0x2721('0x41')]);_0x5c4562[_0x2721('0x42')]=qs[_0x2721('0x3b')](_[_0x2721('0x43')](_0xb9e986[_0x2721('0x3a')],_0x519a15['filters']),_0x483a17);if(_0xb9e986[_0x2721('0x3a')]['filter']){_0x5c4562[_0x2721('0x42')]=_['merge'](_0x5c4562[_0x2721('0x42')],{'$or':_[_0x2721('0x33')](_0x483a17,function(_0xd22b6a){if(_0xd22b6a[_0x2721('0x37')]!=='VIRTUAL'){var _0x4c22f4={};_0x4c22f4[_0xd22b6a[_0x2721('0x31')]]={'$like':'%'+_0xb9e986['query'][_0x2721('0x44')]+'%'};return _0x4c22f4;}})});}_0x5c4562=_[_0x2721('0x45')]({},_0x5c4562,_0xb9e986[_0x2721('0x46')]);var _0x3096ce={'where':_0x5c4562['where']};return db[_0x2721('0x34')]['count'](_0x3096ce)[_0x2721('0x1a')](function(_0x52ddfb){_0x1050a4[_0x2721('0x2b')]=_0x52ddfb;if(_0xb9e986[_0x2721('0x3a')][_0x2721('0x47')]){_0x5c4562[_0x2721('0x48')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2721('0x49')](_0x5c4562);})['then'](function(_0x1d848d){_0x1050a4[_0x2721('0x4a')]=_0x1d848d;return _0x1050a4;})[_0x2721('0x1a')](respondWithFilteredResult(_0x575a17,_0x5c4562))[_0x2721('0x4b')](handleError(_0x575a17,null));};exports['show']=function(_0x466ea7,_0x3bf7c1){var _0x28bc7f={'raw':!![],'where':{'id':_0x466ea7[_0x2721('0x4c')]['id']}},_0x593b33={};_0x593b33[_0x2721('0x3d')]=_[_0x2721('0x39')](db['OpenchannelMessage'][_0x2721('0x35')]);_0x593b33[_0x2721('0x3a')]=_[_0x2721('0x39')](_0x466ea7['query']);_0x593b33[_0x2721('0x3b')]=_[_0x2721('0x4d')](_0x593b33[_0x2721('0x3d')],_0x593b33[_0x2721('0x3a')]);_0x28bc7f[_0x2721('0x3c')]=_[_0x2721('0x4d')](_0x593b33[_0x2721('0x3d')],qs[_0x2721('0x3e')](_0x466ea7[_0x2721('0x3a')][_0x2721('0x3e')]));_0x28bc7f[_0x2721('0x3c')]=_0x28bc7f['attributes'][_0x2721('0x4e')]?_0x28bc7f[_0x2721('0x3c')]:_0x593b33['model'];if(_0x466ea7[_0x2721('0x3a')]['includeAll']){_0x28bc7f[_0x2721('0x48')]=[{'all':!![]}];}_0x28bc7f=_[_0x2721('0x45')]({},_0x28bc7f,_0x466ea7['options']);return db[_0x2721('0x34')][_0x2721('0x4f')](_0x28bc7f)[_0x2721('0x1a')](handleEntityNotFound(_0x3bf7c1,null))[_0x2721('0x1a')](respondWithResult(_0x3bf7c1,null))['catch'](handleError(_0x3bf7c1,null));};exports[_0x2721('0x50')]=function(_0x2ecd12,_0x474ddd){return db['OpenchannelMessage'][_0x2721('0x50')](_0x2ecd12[_0x2721('0x51')],{})[_0x2721('0x1a')](respondWithResult(_0x474ddd,0xc9))[_0x2721('0x4b')](handleError(_0x474ddd,null));};exports[_0x2721('0x2f')]=function(_0x314632,_0x21628c){if(_0x314632[_0x2721('0x51')]['id']){delete _0x314632[_0x2721('0x51')]['id'];}return db[_0x2721('0x34')][_0x2721('0x4f')]({'where':{'id':_0x314632['params']['id']}})[_0x2721('0x1a')](handleEntityNotFound(_0x21628c,null))['then'](saveUpdates(_0x314632['body'],null))[_0x2721('0x1a')](respondWithResult(_0x21628c,null))['catch'](handleError(_0x21628c,null));};exports[_0x2721('0x52')]=function(_0x2fbabb,_0x163587){return db[_0x2721('0x34')][_0x2721('0x4f')]({'where':{'id':_0x2fbabb['params']['id']}})['then'](handleEntityNotFound(_0x163587,null))['then'](removeEntity(_0x163587,null))[_0x2721('0x4b')](handleError(_0x163587,null));};exports['describe']=function(_0x571fa2,_0x1eb020){return db[_0x2721('0x34')]['describe']()[_0x2721('0x1a')](respondWithResult(_0x1eb020,null))[_0x2721('0x4b')](handleError(_0x1eb020,null));};var interaction_log=require(_0x2721('0xc'))(_0x2721('0x53'));exports['accept']=function(_0x1b2607,_0x26e596,_0x39a37b){var _0x72359d={'agent':{},'channel':_0x2721('0x54')};if(_0x1b2607[_0x2721('0x51')]['id']){delete _0x1b2607['body']['id'];}_0x1b2607[_0x2721('0x51')]['read']=!![];_0x1b2607['body'][_0x2721('0x55')]=moment()[_0x2721('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b2607['body']['UserId']=_0x1b2607[_0x2721('0x51')][_0x2721('0x57')]||_0x1b2607[_0x2721('0x58')]['id'];_0x72359d['agent']['id']=_0x1b2607['body']['UserId'];return db[_0x2721('0x34')][_0x2721('0x4f')]({'where':{'id':_0x1b2607['params']['id'],'UserId':null}})[_0x2721('0x1a')](handleEntityNotFound(_0x26e596,null))[_0x2721('0x1a')](saveUpdates(_0x1b2607[_0x2721('0x51')],null))[_0x2721('0x1a')](function(_0xbdd7ee){if(_0xbdd7ee){_0x72359d[_0x2721('0x22')]=_0xbdd7ee[_0x2721('0x59')]({'plain':!![]});return db[_0x2721('0x5a')][_0x2721('0x4f')]({'where':{'id':_0xbdd7ee[_0x2721('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x26e596,null))[_0x2721('0x1a')](function(_0x1caecd){if(_0x1caecd){return _0x1caecd[_0x2721('0x2f')]({'UserId':_0x1b2607[_0x2721('0x51')][_0x2721('0x57')],'read1stAt':_[_0x2721('0x5c')](_0x1caecd[_0x2721('0x5d')])?moment()[_0x2721('0x56')](_0x2721('0x5e')):undefined});}return null;})['then'](function(_0x24116b){if(_0x24116b){_0x72359d[_0x2721('0x5f')]=_0x24116b[_0x2721('0x59')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b2607['user']['id'],_0x1b2607[_0x2721('0x58')]['name'],_0x1b2607[_0x2721('0x58')][_0x2721('0x60')],_0x72359d[_0x2721('0x5f')]['id'],_0x1b2607[_0x2721('0x51')]?JSON[_0x2721('0x1f')](_0x1b2607[_0x2721('0x51')]):_0x2721('0x61'));return respondWithRpcPromise('AcceptMessage',_0x2721('0x62'),_0x72359d);}return null;})[_0x2721('0x1a')](function(_0x5aa697){var _0x5efee0=_0x2721('0x63')+_0x5aa697[_0x2721('0x22')]['ContactId'];return db[_0x2721('0x64')][_0x2721('0x3a')](_0x5efee0,{'type':db[_0x2721('0x65')][_0x2721('0x66')][_0x2721('0x67')],'raw':!![]})[_0x2721('0x1a')](function(_0x17c07c){return _0x17c07c;});})[_0x2721('0x1a')](function(_0x5f4415){if(_0x5f4415){_0x72359d['message']['contact']=_0x5f4415[0x0];if(!_0x1b2607['body']['UserId'])return;return db[_0x2721('0x68')][_0x2721('0x4f')]({'where':{'id':_0x1b2607['body'][_0x2721('0x57')],'role':_0x2721('0x69')},'attributes':['id',_0x2721('0x31'),_0x2721('0x6a'),_0x2721('0x6b'),_0x2721('0x6c')],'raw':!![]});}return null;})[_0x2721('0x1a')](function(_0x5a97e5){if(!_0x5a97e5)return null;_0x72359d['message'][_0x2721('0x69')]=_0x5a97e5;return _0x72359d;})[_0x2721('0x1a')](function(_0x2c0e57){if(_0x2c0e57){if(_0x1b2607['body'][_0x2721('0x6d')]){_0x72359d[_0x2721('0x22')][_0x2721('0x6e')]=util[_0x2721('0x56')](_0x2721('0x6f'),_0x1b2607[_0x2721('0x58')][_0x2721('0x31')]);_0x72359d['message']['channel']=_0x72359d[_0x2721('0x70')];_0x72359d['message'][_0x2721('0x71')]=_0x72359d[_0x2721('0x70')];_0x72359d['message'][_0x2721('0x72')]='accept';return respondWithRpcPromise(_0x2721('0x73'),_0x2721('0x73'),{'event':'acceptmessage','message':_0x72359d[_0x2721('0x22')]},client9002)['then'](function(){return _0x72359d;});}return _0x72359d;}return null;})['then'](respondWithResult(_0x26e596,null))[_0x2721('0x4b')](handleError(_0x26e596,null));};var interaction_log=require(_0x2721('0xc'))(_0x2721('0x53'));exports[_0x2721('0x2e')]=function(_0x1d83be,_0xf478e9,_0x1db2ee){var _0x317cce={'agent':{},'channel':_0x2721('0x54')};if(_0x1d83be[_0x2721('0x51')]['id']){delete _0x1d83be[_0x2721('0x51')]['id'];}_0x1d83be['body'][_0x2721('0x57')]=_0x1d83be['body']['UserId']||_0x1d83be[_0x2721('0x58')]['id'];_0x317cce[_0x2721('0x69')]['id']=_0x1d83be[_0x2721('0x51')][_0x2721('0x57')];return db[_0x2721('0x34')]['find']({'where':{'id':_0x1d83be[_0x2721('0x4c')]['id'],'UserId':null}})[_0x2721('0x1a')](handleEntityNotFound(_0xf478e9,null))[_0x2721('0x1a')](function(_0x35b068){if(_0x35b068){_0x317cce[_0x2721('0x22')]=_0x35b068['get']({'plain':!![]});return db[_0x2721('0x5a')]['find']({'where':{'id':_0x35b068[_0x2721('0x5b')]}});}return null;})[_0x2721('0x1a')](handleEntityNotFound(_0xf478e9,null))[_0x2721('0x1a')](function(_0x1b0bd7){if(_0x1b0bd7){_0x317cce[_0x2721('0x5f')]=_0x1b0bd7['get']({'plain':!![]});interaction_log['info'](_0x2721('0x74'),_0x1d83be[_0x2721('0x58')]['id'],_0x1d83be[_0x2721('0x58')][_0x2721('0x31')],_0x1d83be[_0x2721('0x58')][_0x2721('0x60')],_0x317cce[_0x2721('0x5f')]['id'],_0x1d83be[_0x2721('0x51')]?JSON['stringify'](_0x1d83be[_0x2721('0x51')]):'null');return respondWithRpcPromise('RejectMessage',_0x2721('0x75'),_0x317cce);}return null;})['then'](function(_0x55c76f){var _0x295468=_0x2721('0x63')+_0x55c76f[_0x2721('0x22')][_0x2721('0x76')];return db[_0x2721('0x64')][_0x2721('0x3a')](_0x295468,{'type':db[_0x2721('0x65')][_0x2721('0x66')]['SELECT'],'raw':!![]})['then'](function(_0xf39e0a){return _0xf39e0a;});})[_0x2721('0x1a')](function(_0x235509){if(_0x235509){_0x317cce[_0x2721('0x22')][_0x2721('0x77')]=_0x235509[0x0];if(!_0x1d83be['body'][_0x2721('0x57')])return;return db[_0x2721('0x68')]['find']({'where':{'id':_0x1d83be[_0x2721('0x51')]['UserId'],'role':_0x2721('0x69')},'attributes':['id',_0x2721('0x31'),'fullname',_0x2721('0x6b'),'internal'],'raw':!![]});}return null;})[_0x2721('0x1a')](function(_0x5674a1){if(!_0x5674a1)return null;_0x317cce[_0x2721('0x22')]['agent']=_0x5674a1;return _0x317cce;})[_0x2721('0x1a')](function(_0x34dd9d){if(_0x34dd9d){_0x34dd9d[_0x2721('0x22')][_0x2721('0x6e')]=util[_0x2721('0x56')](_0x2721('0x6f'),_0x1d83be[_0x2721('0x58')][_0x2721('0x31')]);_0x34dd9d[_0x2721('0x22')][_0x2721('0x70')]=_0x317cce[_0x2721('0x70')];_0x34dd9d['message'][_0x2721('0x71')]=_0x317cce[_0x2721('0x70')];_0x34dd9d['message'][_0x2721('0x72')]=_0x2721('0x2e');respondWithRpcPromise(_0x2721('0x73'),_0x2721('0x73'),{'event':'rejectmessage','message':_0x34dd9d[_0x2721('0x22')]},client9002);return _0x317cce;}return null;})[_0x2721('0x1a')](respondWithResult(_0xf478e9,null))[_0x2721('0x4b')](handleError(_0xf478e9,null));}; \ No newline at end of file +var _0x9d0c=['count','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','fullname','internal','manual','channel','motionChannel','accept','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','email','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','keys','query','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','options'];(function(_0x1639be,_0x4ac980){var _0x4af3e1=function(_0x1a24cb){while(--_0x1a24cb){_0x1639be['push'](_0x1639be['shift']());}};_0x4af3e1(++_0x4ac980);}(_0x9d0c,0xb9));var _0xc9d0=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x9d0c[_0x1bc762];return _0x40f70c;};'use strict';var emlformat=require(_0xc9d0('0x0'));var rimraf=require(_0xc9d0('0x1'));var zipdir=require(_0xc9d0('0x2'));var jsonpatch=require(_0xc9d0('0x3'));var rp=require('request-promise');var moment=require(_0xc9d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9d0('0x5'));var util=require(_0xc9d0('0x6'));var path=require(_0xc9d0('0x7'));var sox=require(_0xc9d0('0x8'));var csv=require(_0xc9d0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d0('0xa'));var _=require(_0xc9d0('0xb'));var squel=require(_0xc9d0('0xc'));var crypto=require(_0xc9d0('0xd'));var jsforce=require(_0xc9d0('0xe'));var deskjs=require(_0xc9d0('0xf'));var toCsv=require(_0xc9d0('0x9'));var querystring=require(_0xc9d0('0x10'));var Papa=require(_0xc9d0('0x11'));var Redis=require(_0xc9d0('0x12'));var authService=require(_0xc9d0('0x13'));var qs=require(_0xc9d0('0x14'));var as=require(_0xc9d0('0x15'));var hardwareService=require(_0xc9d0('0x16'));var logger=require(_0xc9d0('0x17'))(_0xc9d0('0x18'));var utils=require(_0xc9d0('0x19'));var config=require(_0xc9d0('0x1a'));var licenseUtil=require(_0xc9d0('0x1b'));var db=require(_0xc9d0('0x1c'))['db'];config[_0xc9d0('0x1d')]=_[_0xc9d0('0x1e')](config[_0xc9d0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9d0('0x1d')]));require(_0xc9d0('0x1f'))[_0xc9d0('0x20')](socket);var jayson=require(_0xc9d0('0x21'));var client=jayson[_0xc9d0('0x22')][_0xc9d0('0x23')]({'port':0x232c});var client9002=jayson[_0xc9d0('0x22')][_0xc9d0('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x18eb1e,_0x31f48f,_0x1a29f6,_0x34c2c0){return new BPromise(function(_0x2e4b16,_0x214d63){var _0x539744=_0x34c2c0||client;return _0x539744[_0xc9d0('0x24')](_0x18eb1e,_0x1a29f6)['then'](function(_0x582e18){logger[_0xc9d0('0x25')](_0xc9d0('0x26'),_0x31f48f,'request\x20sent');logger[_0xc9d0('0x27')](_0xc9d0('0x28'),_0x31f48f,_0xc9d0('0x29'),JSON[_0xc9d0('0x2a')](_0x582e18));if(_0x582e18[_0xc9d0('0x2b')]){if(_0x582e18[_0xc9d0('0x2b')]['code']===0x1f4){logger[_0xc9d0('0x2b')](_0xc9d0('0x26'),_0x31f48f,_0x582e18['error']['message']);return _0x214d63(_0x582e18['error']['message']);}logger['error'](_0xc9d0('0x26'),_0x31f48f,_0x582e18[_0xc9d0('0x2b')][_0xc9d0('0x2c')]);return _0x2e4b16(_0x582e18[_0xc9d0('0x2b')]['message']);}else{logger[_0xc9d0('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x31f48f,_0xc9d0('0x29'));_0x2e4b16(_0x582e18[_0xc9d0('0x2d')]['message']);}})[_0xc9d0('0x2e')](function(_0xda2fd5){logger['error'](_0xc9d0('0x26'),_0x31f48f,_0xda2fd5);_0x214d63(_0xda2fd5);});});}function respondWithStatusCode(_0x3436db,_0x11d833){_0x11d833=_0x11d833||0xcc;return function(_0x1321a7){if(_0x1321a7){return _0x3436db[_0xc9d0('0x2f')](_0x11d833);}return _0x3436db[_0xc9d0('0x30')](_0x11d833)[_0xc9d0('0x31')]();};}function respondWithResult(_0x4987c1,_0x2c5fe8){_0x2c5fe8=_0x2c5fe8||0xc8;return function(_0x1ff8ef){if(_0x1ff8ef){return _0x4987c1[_0xc9d0('0x30')](_0x2c5fe8)[_0xc9d0('0x32')](_0x1ff8ef);}};}function respondWithFilteredResult(_0x3fe4ad,_0x132d66){return function(_0x3d4b80){if(_0x3d4b80){var _0x11f3ea=typeof _0x132d66[_0xc9d0('0x33')]===_0xc9d0('0x34')&&typeof _0x132d66[_0xc9d0('0x35')]===_0xc9d0('0x34');var _0x399adf=_0x3d4b80['count'];var _0xcdac5d=_0x11f3ea?0x0:_0x132d66[_0xc9d0('0x33')];var _0x7859bc=_0x11f3ea?_0x3d4b80['count']:_0x132d66[_0xc9d0('0x33')]+_0x132d66['limit'];var _0x53e60a;if(_0x7859bc>=_0x399adf){_0x7859bc=_0x399adf;_0x53e60a=0xc8;}else{_0x53e60a=0xce;}_0x3fe4ad['status'](_0x53e60a);return _0x3fe4ad[_0xc9d0('0x36')](_0xc9d0('0x37'),_0xcdac5d+'-'+_0x7859bc+'/'+_0x399adf)[_0xc9d0('0x32')](_0x3d4b80);}return null;};}function patchUpdates(_0x4baae8){return function(_0x3398f4){try{jsonpatch[_0xc9d0('0x38')](_0x3398f4,_0x4baae8,!![]);}catch(_0x1a07bf){return BPromise[_0xc9d0('0x39')](_0x1a07bf);}return _0x3398f4[_0xc9d0('0x3a')]();};}function saveUpdates(_0x2c5e29,_0xf22308){return function(_0x22a73c){if(_0x22a73c){return _0x22a73c[_0xc9d0('0x3b')](_0x2c5e29)['then'](function(_0x5638cf){return _0x5638cf;});}return null;};}function removeEntity(_0x509391,_0x59d515){return function(_0x18ac04){if(_0x18ac04){return _0x18ac04[_0xc9d0('0x3c')]()[_0xc9d0('0x3d')](function(){_0x509391['status'](0xcc)[_0xc9d0('0x31')]();});}};}function handleEntityNotFound(_0x50642c,_0x3a18d2){return function(_0x552297){if(!_0x552297){_0x50642c['sendStatus'](0x194);}return _0x552297;};}function handleError(_0x9fb9d7,_0x87e30b){_0x87e30b=_0x87e30b||0x1f4;return function(_0x527da2){logger['error'](_0x527da2[_0xc9d0('0x3e')]);if(_0x527da2[_0xc9d0('0x3f')]){delete _0x527da2['name'];}_0x9fb9d7[_0xc9d0('0x30')](_0x87e30b)['send'](_0x527da2);};}exports[_0xc9d0('0x40')]=function(_0x1bacf6,_0x492257){var _0x5e60dd={},_0x1b53ae={},_0x3e8651={'count':0x0,'rows':[]};var _0x4100ea=_[_0xc9d0('0x41')](db[_0xc9d0('0x42')][_0xc9d0('0x43')],function(_0x344782){return{'name':_0x344782[_0xc9d0('0x44')],'type':_0x344782['type']['key']};});_0x1b53ae['model']=_[_0xc9d0('0x41')](_0x4100ea,'name');_0x1b53ae['query']=_[_0xc9d0('0x45')](_0x1bacf6[_0xc9d0('0x46')]);_0x1b53ae['filters']=_[_0xc9d0('0x47')](_0x1b53ae[_0xc9d0('0x48')],_0x1b53ae[_0xc9d0('0x46')]);_0x5e60dd[_0xc9d0('0x49')]=_[_0xc9d0('0x47')](_0x1b53ae[_0xc9d0('0x48')],qs[_0xc9d0('0x4a')](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x4a')]));_0x5e60dd[_0xc9d0('0x49')]=_0x5e60dd[_0xc9d0('0x49')]['length']?_0x5e60dd['attributes']:_0x1b53ae[_0xc9d0('0x48')];if(!_0x1bacf6['query']['hasOwnProperty'](_0xc9d0('0x4b'))){_0x5e60dd[_0xc9d0('0x35')]=qs['limit'](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x35')]);_0x5e60dd[_0xc9d0('0x33')]=qs[_0xc9d0('0x33')](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x33')]);}_0x5e60dd[_0xc9d0('0x4c')]=qs['sort'](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x4d')]);_0x5e60dd[_0xc9d0('0x4e')]=qs[_0xc9d0('0x4f')](_[_0xc9d0('0x50')](_0x1bacf6[_0xc9d0('0x46')],_0x1b53ae[_0xc9d0('0x4f')]),_0x4100ea);if(_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x51')]){_0x5e60dd[_0xc9d0('0x4e')]=_[_0xc9d0('0x52')](_0x5e60dd[_0xc9d0('0x4e')],{'$or':_[_0xc9d0('0x41')](_0x4100ea,function(_0x5ea6f3){if(_0x5ea6f3[_0xc9d0('0x53')]!=='VIRTUAL'){var _0x52fd1f={};_0x52fd1f[_0x5ea6f3[_0xc9d0('0x3f')]]={'$like':'%'+_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x51')]+'%'};return _0x52fd1f;}})});}_0x5e60dd=_[_0xc9d0('0x52')]({},_0x5e60dd,_0x1bacf6[_0xc9d0('0x54')]);var _0x2053ef={'where':_0x5e60dd[_0xc9d0('0x4e')]};return db['OpenchannelMessage'][_0xc9d0('0x55')](_0x2053ef)[_0xc9d0('0x3d')](function(_0x2c60dc){_0x3e8651[_0xc9d0('0x55')]=_0x2c60dc;if(_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x56')]){_0x5e60dd[_0xc9d0('0x57')]=[{'all':!![]}];}return db[_0xc9d0('0x42')][_0xc9d0('0x58')](_0x5e60dd);})['then'](function(_0xcc7231){_0x3e8651[_0xc9d0('0x59')]=_0xcc7231;return _0x3e8651;})[_0xc9d0('0x3d')](respondWithFilteredResult(_0x492257,_0x5e60dd))['catch'](handleError(_0x492257,null));};exports[_0xc9d0('0x5a')]=function(_0xdc1fd5,_0x5749cf){var _0x326b63={'raw':!![],'where':{'id':_0xdc1fd5[_0xc9d0('0x5b')]['id']}},_0x1c4a52={};_0x1c4a52[_0xc9d0('0x48')]=_[_0xc9d0('0x45')](db[_0xc9d0('0x42')][_0xc9d0('0x43')]);_0x1c4a52[_0xc9d0('0x46')]=_['keys'](_0xdc1fd5[_0xc9d0('0x46')]);_0x1c4a52[_0xc9d0('0x4f')]=_[_0xc9d0('0x47')](_0x1c4a52[_0xc9d0('0x48')],_0x1c4a52[_0xc9d0('0x46')]);_0x326b63[_0xc9d0('0x49')]=_[_0xc9d0('0x47')](_0x1c4a52[_0xc9d0('0x48')],qs[_0xc9d0('0x4a')](_0xdc1fd5['query'][_0xc9d0('0x4a')]));_0x326b63[_0xc9d0('0x49')]=_0x326b63[_0xc9d0('0x49')][_0xc9d0('0x5c')]?_0x326b63[_0xc9d0('0x49')]:_0x1c4a52[_0xc9d0('0x48')];if(_0xdc1fd5['query']['includeAll']){_0x326b63[_0xc9d0('0x57')]=[{'all':!![]}];}_0x326b63=_['merge']({},_0x326b63,_0xdc1fd5[_0xc9d0('0x54')]);return db[_0xc9d0('0x42')][_0xc9d0('0x5d')](_0x326b63)[_0xc9d0('0x3d')](handleEntityNotFound(_0x5749cf,null))[_0xc9d0('0x3d')](respondWithResult(_0x5749cf,null))[_0xc9d0('0x2e')](handleError(_0x5749cf,null));};exports[_0xc9d0('0x5e')]=function(_0x4b18c2,_0x444134){return db['OpenchannelMessage']['create'](_0x4b18c2[_0xc9d0('0x5f')],{})[_0xc9d0('0x3d')](respondWithResult(_0x444134,0xc9))['catch'](handleError(_0x444134,null));};exports[_0xc9d0('0x3b')]=function(_0x5bf894,_0x5fa7c9){if(_0x5bf894[_0xc9d0('0x5f')]['id']){delete _0x5bf894['body']['id'];}return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0x5bf894[_0xc9d0('0x5b')]['id']}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x5fa7c9,null))[_0xc9d0('0x3d')](saveUpdates(_0x5bf894[_0xc9d0('0x5f')],null))[_0xc9d0('0x3d')](respondWithResult(_0x5fa7c9,null))[_0xc9d0('0x2e')](handleError(_0x5fa7c9,null));};exports[_0xc9d0('0x3c')]=function(_0xf71798,_0x1cb4aa){return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0xf71798[_0xc9d0('0x5b')]['id']}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x1cb4aa,null))[_0xc9d0('0x3d')](removeEntity(_0x1cb4aa,null))['catch'](handleError(_0x1cb4aa,null));};exports[_0xc9d0('0x60')]=function(_0x166ec7,_0x481c5a){return db[_0xc9d0('0x42')]['describe']()['then'](respondWithResult(_0x481c5a,null))['catch'](handleError(_0x481c5a,null));};var interaction_log=require(_0xc9d0('0x17'))(_0xc9d0('0x61'));exports['accept']=function(_0x4aedda,_0x47f568,_0x47cbad){var _0x15b4f1={'agent':{},'channel':_0xc9d0('0x62')};if(_0x4aedda[_0xc9d0('0x5f')]['id']){delete _0x4aedda[_0xc9d0('0x5f')]['id'];}_0x4aedda['body']['read']=!![];_0x4aedda['body'][_0xc9d0('0x63')]=moment()[_0xc9d0('0x64')](_0xc9d0('0x65'));_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')]=_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')]||_0x4aedda[_0xc9d0('0x67')]['id'];_0x15b4f1[_0xc9d0('0x68')]['id']=_0x4aedda['body'][_0xc9d0('0x66')];return db[_0xc9d0('0x42')]['find']({'where':{'id':_0x4aedda[_0xc9d0('0x5b')]['id'],'UserId':null}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x47f568,null))[_0xc9d0('0x3d')](saveUpdates(_0x4aedda[_0xc9d0('0x5f')],null))[_0xc9d0('0x3d')](function(_0x504e76){if(_0x504e76){_0x15b4f1[_0xc9d0('0x2c')]=_0x504e76['get']({'plain':!![]});return db[_0xc9d0('0x69')][_0xc9d0('0x5d')]({'where':{'id':_0x504e76['OpenchannelInteractionId']}});}return null;})[_0xc9d0('0x3d')](handleEntityNotFound(_0x47f568,null))[_0xc9d0('0x3d')](function(_0x472470){if(_0x472470){return _0x472470['update']({'UserId':_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')],'read1stAt':_[_0xc9d0('0x6a')](_0x472470[_0xc9d0('0x6b')])?moment()[_0xc9d0('0x64')](_0xc9d0('0x65')):undefined});}return null;})[_0xc9d0('0x3d')](function(_0x5de3f2){if(_0x5de3f2){_0x15b4f1[_0xc9d0('0x6c')]=_0x5de3f2[_0xc9d0('0x6d')]({'plain':!![]});interaction_log[_0xc9d0('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4aedda[_0xc9d0('0x67')]['id'],_0x4aedda[_0xc9d0('0x67')][_0xc9d0('0x3f')],_0x4aedda['user'][_0xc9d0('0x6e')],_0x15b4f1[_0xc9d0('0x6c')]['id'],_0x4aedda[_0xc9d0('0x5f')]?JSON[_0xc9d0('0x2a')](_0x4aedda[_0xc9d0('0x5f')]):_0xc9d0('0x6f'));return respondWithRpcPromise(_0xc9d0('0x70'),_0xc9d0('0x71'),_0x15b4f1);}return null;})[_0xc9d0('0x3d')](function(_0x196c1c){var _0x4725db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x196c1c[_0xc9d0('0x2c')][_0xc9d0('0x72')];return db[_0xc9d0('0x73')][_0xc9d0('0x46')](_0x4725db,{'type':db['Sequelize']['QueryTypes'][_0xc9d0('0x74')],'raw':!![]})['then'](function(_0x2c1d29){return _0x2c1d29;});})[_0xc9d0('0x3d')](function(_0x5db40e){if(_0x5db40e){_0x15b4f1[_0xc9d0('0x2c')]['contact']=_0x5db40e[0x0];if(!_0x4aedda['body'][_0xc9d0('0x66')])return;return db['User']['find']({'where':{'id':_0x4aedda['body'][_0xc9d0('0x66')],'role':_0xc9d0('0x68')},'attributes':['id',_0xc9d0('0x3f'),_0xc9d0('0x75'),'email',_0xc9d0('0x76')],'raw':!![]});}return null;})[_0xc9d0('0x3d')](function(_0xb6e446){if(!_0xb6e446)return null;_0x15b4f1[_0xc9d0('0x2c')]['agent']=_0xb6e446;return _0x15b4f1;})[_0xc9d0('0x3d')](function(_0x152e9e){if(_0x152e9e){if(_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x77')]){_0x15b4f1[_0xc9d0('0x2c')]['interface']=util[_0xc9d0('0x64')]('SIP/%s',_0x4aedda[_0xc9d0('0x67')]['name']);_0x15b4f1[_0xc9d0('0x2c')][_0xc9d0('0x78')]=_0x15b4f1['channel'];_0x15b4f1[_0xc9d0('0x2c')][_0xc9d0('0x79')]=_0x15b4f1[_0xc9d0('0x78')];_0x15b4f1[_0xc9d0('0x2c')]['event']=_0xc9d0('0x7a');return respondWithRpcPromise(_0xc9d0('0x7b'),_0xc9d0('0x7b'),{'event':_0xc9d0('0x7c'),'message':_0x15b4f1[_0xc9d0('0x2c')]},client9002)[_0xc9d0('0x3d')](function(){return _0x15b4f1;});}return _0x15b4f1;}return null;})['then'](respondWithResult(_0x47f568,null))[_0xc9d0('0x2e')](handleError(_0x47f568,null));};var interaction_log=require('../../config/logger')(_0xc9d0('0x61'));exports[_0xc9d0('0x39')]=function(_0x312c99,_0x41e551,_0x1806a2){var _0x3037eb={'agent':{},'channel':_0xc9d0('0x62')};if(_0x312c99[_0xc9d0('0x5f')]['id']){delete _0x312c99[_0xc9d0('0x5f')]['id'];}_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')]=_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')]||_0x312c99[_0xc9d0('0x67')]['id'];_0x3037eb['agent']['id']=_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')];return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0x312c99[_0xc9d0('0x5b')]['id'],'UserId':null}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x41e551,null))[_0xc9d0('0x3d')](function(_0x149791){if(_0x149791){_0x3037eb[_0xc9d0('0x2c')]=_0x149791[_0xc9d0('0x6d')]({'plain':!![]});return db[_0xc9d0('0x69')]['find']({'where':{'id':_0x149791[_0xc9d0('0x7d')]}});}return null;})[_0xc9d0('0x3d')](handleEntityNotFound(_0x41e551,null))['then'](function(_0x1749c4){if(_0x1749c4){_0x3037eb['interaction']=_0x1749c4[_0xc9d0('0x6d')]({'plain':!![]});interaction_log[_0xc9d0('0x25')](_0xc9d0('0x7e'),_0x312c99[_0xc9d0('0x67')]['id'],_0x312c99[_0xc9d0('0x67')]['name'],_0x312c99['user'][_0xc9d0('0x6e')],_0x3037eb[_0xc9d0('0x6c')]['id'],_0x312c99['body']?JSON[_0xc9d0('0x2a')](_0x312c99[_0xc9d0('0x5f')]):_0xc9d0('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3037eb);}return null;})[_0xc9d0('0x3d')](function(_0x383083){var _0x5a658b=_0xc9d0('0x7f')+_0x383083[_0xc9d0('0x2c')][_0xc9d0('0x72')];return db[_0xc9d0('0x73')][_0xc9d0('0x46')](_0x5a658b,{'type':db[_0xc9d0('0x80')][_0xc9d0('0x81')][_0xc9d0('0x74')],'raw':!![]})[_0xc9d0('0x3d')](function(_0x5d4a32){return _0x5d4a32;});})[_0xc9d0('0x3d')](function(_0xa14d9a){if(_0xa14d9a){_0x3037eb[_0xc9d0('0x2c')][_0xc9d0('0x82')]=_0xa14d9a[0x0];if(!_0x312c99[_0xc9d0('0x5f')]['UserId'])return;return db[_0xc9d0('0x83')][_0xc9d0('0x5d')]({'where':{'id':_0x312c99['body'][_0xc9d0('0x66')],'role':_0xc9d0('0x68')},'attributes':['id',_0xc9d0('0x3f'),_0xc9d0('0x75'),_0xc9d0('0x84'),_0xc9d0('0x76')],'raw':!![]});}return null;})[_0xc9d0('0x3d')](function(_0x11993d){if(!_0x11993d)return null;_0x3037eb['message'][_0xc9d0('0x68')]=_0x11993d;return _0x3037eb;})['then'](function(_0x333de9){if(_0x333de9){_0x333de9[_0xc9d0('0x2c')]['interface']=util[_0xc9d0('0x64')](_0xc9d0('0x85'),_0x312c99[_0xc9d0('0x67')][_0xc9d0('0x3f')]);_0x333de9['message']['channel']=_0x3037eb[_0xc9d0('0x78')];_0x333de9['message'][_0xc9d0('0x79')]=_0x3037eb[_0xc9d0('0x78')];_0x333de9[_0xc9d0('0x2c')]['event']=_0xc9d0('0x39');respondWithRpcPromise(_0xc9d0('0x7b'),'EventManager',{'event':_0xc9d0('0x86'),'message':_0x333de9['message']},client9002);return _0x3037eb;}return null;})[_0xc9d0('0x3d')](respondWithResult(_0x41e551,null))['catch'](handleError(_0x41e551,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 215b3e6..16976b0 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 _0xc029=['remove','emit','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x372fc6,_0x4de4d9){var _0x52382c=function(_0x549d6a){while(--_0x549d6a){_0x372fc6['push'](_0x372fc6['shift']());}};_0x52382c(++_0x4de4d9);}(_0xc029,0x7a));var _0x9c02=function(_0x1b0a89,_0x5f4f8f){_0x1b0a89=_0x1b0a89-0x0;var _0x3800f0=_0xc029[_0x1b0a89];return _0x3800f0;};'use strict';var EventEmitter=require(_0x9c02('0x0'));var OpenchannelMessage=require(_0x9c02('0x1'))['db'][_0x9c02('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9c02('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c02('0x4')};function emitEvent(_0x3e0cdf){return function(_0x32ac6c,_0x51c908,_0x2d78f1){OpenchannelMessageEvents[_0x9c02('0x5')](_0x3e0cdf+':'+_0x32ac6c['id'],_0x32ac6c);OpenchannelMessageEvents[_0x9c02('0x5')](_0x3e0cdf,_0x32ac6c);_0x2d78f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x9c02('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x9d11=['emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x1846ef,_0xee69c9){var _0x21cfcc=function(_0xfd80f2){while(--_0xfd80f2){_0x1846ef['push'](_0x1846ef['shift']());}};_0x21cfcc(++_0xee69c9);}(_0x9d11,0x13b));var _0x19d1=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x9d11[_0x37ae26];return _0x1b1902;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x19d1('0x0'))['db'][_0x19d1('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x19d1('0x2')](0x0);var events={'afterCreate':_0x19d1('0x3'),'afterUpdate':'update','afterDestroy':_0x19d1('0x4')};function emitEvent(_0x2e7abd){return function(_0x3fc25f,_0x18a2ff,_0x1bb239){OpenchannelMessageEvents[_0x19d1('0x5')](_0x2e7abd+':'+_0x3fc25f['id'],_0x3fc25f);OpenchannelMessageEvents['emit'](_0x2e7abd,_0x3fc25f);_0x1bb239(null);};}for(var e in events){if(events[_0x19d1('0x6')](e)){var event=events[e];OpenchannelMessage[_0x19d1('0x7')](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 54a5dbf..26fe41c 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 _0x9354=['threadId','inspect','finally','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','Contact','POST','method','GET','body'];(function(_0x27a894,_0x3fcf4c){var _0x45a756=function(_0x158418){while(--_0x158418){_0x27a894['push'](_0x27a894['shift']());}};_0x45a756(++_0x3fcf4c);}(_0x9354,0x96));var _0x4935=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x9354[_0x1857c6];return _0x51011c;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[{'name':_0x4935('0xc'),'fields':['body'],'type':_0x4935('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a44f,_0x2aac9a,_0x38de96){var _0xd5b117=_0x2d518a[_0x4935('0xe')];var _0x261462=_0x47a44f[_0x4935('0xf')]({'plain':!![]});if(_0x261462['direction']['toLowerCase']()==='in'||_0x261462[_0x4935('0x10')]['toLowerCase']()==='out'&&!_0x261462[_0x4935('0x11')]&&!_[_0x4935('0x12')](_0x261462[_0x4935('0x13')])){_0xd5b117[_0x4935('0x14')][_0x4935('0x15')]({'where':{'id':_0x261462[_0x4935('0x16')]}})[_0x4935('0x17')](function(_0x3a7c30){if(_0x3a7c30){_0x3a7c30[_0x4935('0x18')]({'lastMsgAt':_0x261462[_0x4935('0x19')],'lastMsgDirection':_0x261462[_0x4935('0x10')][_0x4935('0x1a')]()});}})[_0x4935('0x1b')](function(_0x3652c4){console[_0x4935('0x1c')](_0x3652c4);});}if(_0x261462[_0x4935('0x10')]==='out'&&!_0x261462[_0x4935('0x11')]){var _0x46526a;_0xd5b117[_0x4935('0x1d')][_0x4935('0x1e')]()[_0x4935('0x17')](function(_0x429ef3){return _0xd5b117['OpenchannelAccount'][_0x4935('0x1f')]({'where':{'id':_0x261462[_0x4935('0x20')]},'include':[{'model':_0xd5b117['OpenchannelInteraction'],'as':_0x4935('0x21'),'where':{'id':_0x261462[_0x4935('0x16')]},'limit':0x1,'include':[{'model':_0xd5b117[_0x4935('0x1d')],'as':'Contact','attributes':_['keys'](_0x429ef3)}]}]});})[_0x4935('0x17')](function(_0x6b849f){_0x46526a=_0x6b849f[_0x4935('0xf')]({'plain':!![]});if(_0x46526a&&_0x46526a[_0x4935('0x22')]){logger[_0x4935('0x23')](_0x4935('0x24'),_0x4935('0x25'),util[_0x4935('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x46526a[_0x4935('0x21')]&&_0x46526a[_0x4935('0x21')][_0x4935('0x27')]){_0x261462[_0x4935('0x28')]=_['omit'](_0x46526a['Interactions'][0x0],_0x4935('0x29'));_0x261462[_0x4935('0x29')]=_0x46526a[_0x4935('0x21')][0x0][_0x4935('0x29')];}var _0x2aac9a={'method':_0x4935('0x2a'),'uri':encodeURI(_0x46526a[_0x4935('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aac9a[_0x4935('0x2b')]){case _0x4935('0x2c'):_0x2aac9a['qs']=_0x261462;break;case _0x4935('0x2a'):_0x2aac9a[_0x4935('0x2d')]=_0x261462;break;}return rp(_0x2aac9a)[_0x4935('0x17')](function(_0x2c47ab){logger[_0x4935('0x23')](_0x4935('0x24'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x2c47ab[_0x4935('0x2d')]['threadId']&&_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]!=_0x261462[_0x4935('0x28')][_0x4935('0x2e')]){return _0xd5b117[_0x4935('0x14')][_0x4935('0x18')]({'threadId':_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]},{'logging':!![],'where':{'id':_0x261462['Interaction']['id']}});}else{return;}})[_0x4935('0x17')](function(){return _0x47a44f[_0x4935('0x18')]({'read':!![]});})['catch'](function(_0x48a289){logger[_0x4935('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x4935('0x25'),util[_0x4935('0x2f')](_0x48a289,{'showHidden':![],'depth':null}));_0x38de96();});}else{_0x38de96();}})[_0x4935('0x30')](function(){_0x38de96();});}else{_0x38de96();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x14a0=['fti_openchannel_messages','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages'];(function(_0x300473,_0x1c0f1a){var _0x4ee785=function(_0xd66e75){while(--_0xd66e75){_0x300473['push'](_0x300473['shift']());}};_0x4ee785(++_0x1c0f1a);}(_0x14a0,0x8e));var _0x014a=function(_0x24e7c0,_0x2bbaf9){_0x24e7c0=_0x24e7c0-0x0;var _0x1f20c9=_0x14a0[_0x24e7c0];return _0x1f20c9;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[{'name':_0x014a('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2519e3,_0x4f5506,_0x490ea2){var _0x5aa52f=_0x38a22c['models'];var _0x330469=_0x2519e3['get']({'plain':!![]});if(_0x330469[_0x014a('0xc')][_0x014a('0xd')]()==='in'||_0x330469['direction'][_0x014a('0xd')]()===_0x014a('0xe')&&!_0x330469[_0x014a('0xf')]&&!_[_0x014a('0x10')](_0x330469[_0x014a('0x11')])){_0x5aa52f[_0x014a('0x12')][_0x014a('0x13')]({'where':{'id':_0x330469[_0x014a('0x14')]}})[_0x014a('0x15')](function(_0x71535d){if(_0x71535d){_0x71535d[_0x014a('0x16')]({'lastMsgAt':_0x330469[_0x014a('0x17')],'lastMsgDirection':_0x330469['direction'][_0x014a('0xd')]()});}})[_0x014a('0x18')](function(_0x59f207){console[_0x014a('0x19')](_0x59f207);});}if(_0x330469[_0x014a('0xc')]==='out'&&!_0x330469[_0x014a('0xf')]){var _0x17e4be;_0x5aa52f[_0x014a('0x1a')][_0x014a('0x1b')]()[_0x014a('0x15')](function(_0x12d339){return _0x5aa52f[_0x014a('0x1c')][_0x014a('0x1d')]({'where':{'id':_0x330469[_0x014a('0x1e')]},'include':[{'model':_0x5aa52f[_0x014a('0x12')],'as':_0x014a('0x1f'),'where':{'id':_0x330469[_0x014a('0x14')]},'limit':0x1,'include':[{'model':_0x5aa52f[_0x014a('0x1a')],'as':_0x014a('0x20'),'attributes':_['keys'](_0x12d339)}]}]});})[_0x014a('0x15')](function(_0x109a9c){_0x17e4be=_0x109a9c[_0x014a('0x21')]({'plain':!![]});if(_0x17e4be&&_0x17e4be[_0x014a('0x22')]){logger[_0x014a('0x23')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x26')](_0x014a('0x27'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x17e4be[_0x014a('0x1f')]&&_0x17e4be['Interactions'][_0x014a('0x28')]){_0x330469[_0x014a('0x29')]=_[_0x014a('0x2a')](_0x17e4be[_0x014a('0x1f')][0x0],_0x014a('0x20'));_0x330469[_0x014a('0x20')]=_0x17e4be[_0x014a('0x1f')][0x0][_0x014a('0x20')];}var _0x4f5506={'method':'POST','uri':encodeURI(_0x17e4be[_0x014a('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4f5506['method']){case _0x014a('0x2b'):_0x4f5506['qs']=_0x330469;break;case _0x014a('0x2c'):_0x4f5506['body']=_0x330469;break;}return rp(_0x4f5506)['then'](function(_0x9a901f){logger[_0x014a('0x23')](_0x014a('0x24'),'afterCreate',util[_0x014a('0x26')](_0x014a('0x2d'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x9a901f[_0x014a('0x2e')][_0x014a('0x2f')]&&_0x9a901f['body']['threadId']!=_0x330469[_0x014a('0x29')][_0x014a('0x2f')]){return _0x5aa52f[_0x014a('0x12')][_0x014a('0x16')]({'threadId':_0x9a901f['body'][_0x014a('0x2f')]},{'logging':!![],'where':{'id':_0x330469[_0x014a('0x29')]['id']}});}else{return;}})[_0x014a('0x15')](function(){return _0x2519e3[_0x014a('0x16')]({'read':!![]});})[_0x014a('0x18')](function(_0x1eb007){logger[_0x014a('0x19')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x30')](_0x1eb007,{'showHidden':![],'depth':null}));_0x490ea2();});}else{_0x490ea2();}})[_0x014a('0x31')](function(){_0x490ea2();});}else{_0x490ea2();}}},'charset':'utf8mb4','collate':_0x014a('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index cac798e..e66a1fc 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x348754,_0x5ab02d){var _0x290b19=function(_0x5833b9){while(--_0x5833b9){_0x348754['push'](_0x348754['shift']());}};_0x290b19(++_0x5ab02d);}(_0x0b0e,0x187));var _0xe0b0=function(_0xb4e2df,_0x1cbb7c){_0xb4e2df=_0xb4e2df-0x0;var _0x5e95ba=_0x0b0e[_0xb4e2df];return _0x5e95ba;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ 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(_0x419a55,_0x46d4a4){var _0xad4cc3=function(_0x50dee4){while(--_0x50dee4){_0x419a55['push'](_0x419a55['shift']());}};_0xad4cc3(++_0x46d4a4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d85c6,_0x5beaf2){_0x5d85c6=_0x5d85c6-0x0;var _0x5f253d=_0x7a54[_0x5d85c6];return _0x5f253d;};'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 534aa42..b1757e6 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 _0x6b3e=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x2adc28,_0x38e880){var _0x450f5a=function(_0x3c89f6){while(--_0x3c89f6){_0x2adc28['push'](_0x2adc28['shift']());}};_0x450f5a(++_0x38e880);}(_0x6b3e,0x122));var _0xe6b3=function(_0x38ea9d,_0x25b874){_0x38ea9d=_0x38ea9d-0x0;var _0x224ef5=_0x6b3e[_0x38ea9d];return _0x224ef5;};'use strict';var OpenchannelMessageEvents=require(_0xe6b3('0x0'));var events=[_0xe6b3('0x1'),_0xe6b3('0x2'),_0xe6b3('0x3')];function createListener(_0x448fca,_0x48be86){return function(_0x28ee36){_0x48be86[_0xe6b3('0x4')](_0x448fca,_0x28ee36);};}function removeListener(_0xbbf7d5,_0x2f7034){return function(){OpenchannelMessageEvents[_0xe6b3('0x5')](_0xbbf7d5,_0x2f7034);};}exports['register']=function(_0x3d33c4){for(var _0x2893f7=0x0,_0x50a59d=events[_0xe6b3('0x6')];_0x2893f7<_0x50a59d;_0x2893f7++){var _0x3e8afc=events[_0x2893f7];var _0x2a6e1c=createListener(_0xe6b3('0x7')+_0x3e8afc,_0x3d33c4);OpenchannelMessageEvents['on'](_0x3e8afc,_0x2a6e1c);}}; \ No newline at end of file +var _0x1b8a=['./openchannelMessage.events','save','remove','update'];(function(_0x397d50,_0x57fe53){var _0x4051dc=function(_0x456d40){while(--_0x456d40){_0x397d50['push'](_0x397d50['shift']());}};_0x4051dc(++_0x57fe53);}(_0x1b8a,0xc8));var _0xa1b8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1b8a[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelMessageEvents=require(_0xa1b8('0x0'));var events=[_0xa1b8('0x1'),_0xa1b8('0x2'),_0xa1b8('0x3')];function createListener(_0x328dbb,_0x50f4e3){return function(_0x290396){_0x50f4e3['emit'](_0x328dbb,_0x290396);};}function removeListener(_0x572a88,_0x3c1d36){return function(){OpenchannelMessageEvents['removeListener'](_0x572a88,_0x3c1d36);};}exports['register']=function(_0x1e9ba4){for(var _0xde0955=0x0,_0x6de2b5=events['length'];_0xde0955<_0x6de2b5;_0xde0955++){var _0x23ce85=events[_0xde0955];var _0x5aad6c=createListener('openchannelMessage:'+_0x23ce85,_0x1e9ba4);OpenchannelMessageEvents['on'](_0x23ce85,_0x5aad6c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fecff95..3c5e9ed 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 _0x0425=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xb6212f,_0x1d05b2){var _0x33bce7=function(_0xe010e8){while(--_0xe010e8){_0xb6212f['push'](_0xb6212f['shift']());}};_0x33bce7(++_0x1d05b2);}(_0x0425,0x156));var _0x5042=function(_0x2af5da,_0x21eed1){_0x2af5da=_0x2af5da-0x0;var _0x359ca5=_0x0425[_0x2af5da];return _0x359ca5;};'use strict';var multer=require(_0x5042('0x0'));var util=require(_0x5042('0x1'));var path=require(_0x5042('0x2'));var timeout=require(_0x5042('0x3'));var express=require(_0x5042('0x4'));var router=express[_0x5042('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5042('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5042('0x7'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x5042('0x8')](),controller[_0x5042('0x9')]);router[_0x5042('0xa')](_0x5042('0xb'),auth['isAuthenticated'](),controller[_0x5042('0xc')]);router[_0x5042('0xa')]('/:id',auth[_0x5042('0x8')](),controller[_0x5042('0xd')]);router[_0x5042('0xa')](_0x5042('0xe'),auth[_0x5042('0x8')](),controller[_0x5042('0xf')]);router[_0x5042('0xa')]('/:id/teams',auth[_0x5042('0x8')](),controller[_0x5042('0x10')]);router[_0x5042('0xa')]('/:id/users',auth[_0x5042('0x8')](),controller[_0x5042('0x11')]);router[_0x5042('0x12')]('/',auth[_0x5042('0x8')](),controller['create']);router[_0x5042('0x12')](_0x5042('0x13'),auth[_0x5042('0x8')](),controller[_0x5042('0x14')]);router[_0x5042('0x12')](_0x5042('0x15'),auth[_0x5042('0x8')](),controller[_0x5042('0x16')]);router['put'](_0x5042('0x17'),auth[_0x5042('0x8')](),controller[_0x5042('0x18')]);router[_0x5042('0x19')](_0x5042('0x17'),auth[_0x5042('0x8')](),controller[_0x5042('0x1a')]);router[_0x5042('0x19')](_0x5042('0x13'),auth[_0x5042('0x8')](),controller[_0x5042('0x1b')]);router[_0x5042('0x19')](_0x5042('0x15'),auth[_0x5042('0x8')](),controller['removeAgents']);module[_0x5042('0x1c')]=router; \ No newline at end of file +var _0xe20d=['removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','addAgents','put','delete','/:id','removeTeams'];(function(_0x5af0ec,_0x134201){var _0x3f8da9=function(_0x5aaf40){while(--_0x5aaf40){_0x5af0ec['push'](_0x5af0ec['shift']());}};_0x3f8da9(++_0x134201);}(_0xe20d,0x17a));var _0xde20=function(_0xca6715,_0x1948d8){_0xca6715=_0xca6715-0x0;var _0x391cfc=_0xe20d[_0xca6715];return _0x391cfc;};'use strict';var multer=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var path=require(_0xde20('0x2'));var timeout=require(_0xde20('0x3'));var express=require(_0xde20('0x4'));var router=express[_0xde20('0x5')]();var fs_extra=require(_0xde20('0x6'));var auth=require(_0xde20('0x7'));var interaction=require(_0xde20('0x8'));var config=require('../../config/environment');var controller=require(_0xde20('0x9'));router[_0xde20('0xa')]('/',auth['isAuthenticated'](),controller[_0xde20('0xb')]);router[_0xde20('0xa')](_0xde20('0xc'),auth[_0xde20('0xd')](),controller[_0xde20('0xe')]);router[_0xde20('0xa')]('/:id',auth[_0xde20('0xd')](),controller[_0xde20('0xf')]);router[_0xde20('0xa')](_0xde20('0x10'),auth[_0xde20('0xd')](),controller[_0xde20('0x11')]);router[_0xde20('0xa')](_0xde20('0x12'),auth[_0xde20('0xd')](),controller[_0xde20('0x13')]);router[_0xde20('0xa')](_0xde20('0x14'),auth['isAuthenticated'](),controller[_0xde20('0x15')]);router['post']('/',auth[_0xde20('0xd')](),controller['create']);router['post'](_0xde20('0x12'),auth[_0xde20('0xd')](),controller[_0xde20('0x16')]);router['post'](_0xde20('0x14'),auth['isAuthenticated'](),controller[_0xde20('0x17')]);router[_0xde20('0x18')]('/:id',auth[_0xde20('0xd')](),controller['update']);router[_0xde20('0x19')](_0xde20('0x1a'),auth[_0xde20('0xd')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xde20('0xd')](),controller[_0xde20('0x1b')]);router['delete'](_0xde20('0x14'),auth[_0xde20('0xd')](),controller[_0xde20('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 7259354..94eda9a 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 _0xb461=['name','beepall','sequelize','exports','STRING'];(function(_0x57e750,_0x35fbf3){var _0x7e5115=function(_0x51683f){while(--_0x51683f){_0x57e750['push'](_0x57e750['shift']());}};_0x7e5115(++_0x35fbf3);}(_0xb461,0x179));var _0x1b46=function(_0x5ef23c,_0x189b9b){_0x5ef23c=_0x5ef23c-0x0;var _0x8ab4eb=_0xb461[_0x5ef23c];return _0x8ab4eb;};'use strict';var Sequelize=require(_0x1b46('0x0'));module[_0x1b46('0x1')]={'name':{'type':Sequelize[_0x1b46('0x2')],'unique':_0x1b46('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1b46('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x13ef=['INTEGER','ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x13ef,0x168));var _0xf13e=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x13ef[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0xf13e('0x0'));module[_0xf13e('0x1')]={'name':{'type':Sequelize[_0xf13e('0x2')],'unique':_0xf13e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf13e('0x2')]},'timeout':{'type':Sequelize[_0xf13e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf13e('0x5')]('rrmemory',_0xf13e('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f76ef63..a1087f1 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 _0x23cb=['mustache','sox','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/utils','../../config/license/util','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','end','error','stack','name','index','OpenchannelQueue','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','nolimit','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','value','ids','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23cb,0x115));var _0xb23c=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0x23cb[_0x20714a];return _0x15e877;};'use strict';var emlformat=require(_0xb23c('0x0'));var rimraf=require(_0xb23c('0x1'));var zipdir=require(_0xb23c('0x2'));var jsonpatch=require(_0xb23c('0x3'));var rp=require(_0xb23c('0x4'));var moment=require(_0xb23c('0x5'));var BPromise=require(_0xb23c('0x6'));var Mustache=require(_0xb23c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb23c('0x8'));var csv=require('to-csv');var ejs=require(_0xb23c('0x9'));var fs=require('fs');var fs_extra=require(_0xb23c('0xa'));var _=require(_0xb23c('0xb'));var squel=require(_0xb23c('0xc'));var crypto=require(_0xb23c('0xd'));var jsforce=require(_0xb23c('0xe'));var deskjs=require(_0xb23c('0xf'));var toCsv=require(_0xb23c('0x10'));var querystring=require(_0xb23c('0x11'));var Papa=require(_0xb23c('0x12'));var Redis=require('ioredis');var authService=require(_0xb23c('0x13'));var qs=require(_0xb23c('0x14'));var as=require(_0xb23c('0x15'));var hardwareService=require(_0xb23c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb23c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb23c('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb23c('0x19')](config[_0xb23c('0x1a')],{'host':_0xb23c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb23c('0x1c'))[_0xb23c('0x1d')](socket);function respondWithStatusCode(_0x509d2a,_0x28b3ff){_0x28b3ff=_0x28b3ff||0xcc;return function(_0x2d7147){if(_0x2d7147){return _0x509d2a[_0xb23c('0x1e')](_0x28b3ff);}return _0x509d2a[_0xb23c('0x1f')](_0x28b3ff)['end']();};}function respondWithResult(_0x3d73d0,_0x2b7d71){_0x2b7d71=_0x2b7d71||0xc8;return function(_0x407266){if(_0x407266){return _0x3d73d0['status'](_0x2b7d71)['json'](_0x407266);}};}function respondWithFilteredResult(_0x528c9d,_0x24333b){return function(_0xb52382){if(_0xb52382){var _0x294b1f=typeof _0x24333b[_0xb23c('0x20')]===_0xb23c('0x21')&&typeof _0x24333b[_0xb23c('0x22')]==='undefined';var _0x5e2bd7=_0xb52382['count'];var _0x438ae6=_0x294b1f?0x0:_0x24333b[_0xb23c('0x20')];var _0x56adb1=_0x294b1f?_0xb52382[_0xb23c('0x23')]:_0x24333b[_0xb23c('0x20')]+_0x24333b[_0xb23c('0x22')];var _0xa40f76;if(_0x56adb1>=_0x5e2bd7){_0x56adb1=_0x5e2bd7;_0xa40f76=0xc8;}else{_0xa40f76=0xce;}_0x528c9d[_0xb23c('0x1f')](_0xa40f76);return _0x528c9d[_0xb23c('0x24')](_0xb23c('0x25'),_0x438ae6+'-'+_0x56adb1+'/'+_0x5e2bd7)['json'](_0xb52382);}return null;};}function patchUpdates(_0x4f7a74){return function(_0x33557b){try{jsonpatch[_0xb23c('0x26')](_0x33557b,_0x4f7a74,!![]);}catch(_0x19fa46){return BPromise['reject'](_0x19fa46);}return _0x33557b[_0xb23c('0x27')]();};}function saveUpdates(_0x27b83b,_0x2fd857){return function(_0x3134fd){if(_0x3134fd){return _0x3134fd[_0xb23c('0x28')](_0x27b83b)[_0xb23c('0x29')](function(_0x293ca4){return _0x293ca4;});}return null;};}function removeEntity(_0x8fd82b,_0x3c6b17){return function(_0x228563){if(_0x228563){return _0x228563['destroy']()[_0xb23c('0x29')](function(){var _0x5334bb=_0x228563[_0xb23c('0x2a')]({'plain':!![]});var _0x288f48=_0xb23c('0x2b');return db[_0xb23c('0x2c')][_0xb23c('0x2d')]({'where':{'type':_0x288f48,'resourceId':_0x5334bb['id']}})[_0xb23c('0x29')](function(){return _0x228563;});})['then'](function(){_0x8fd82b[_0xb23c('0x1f')](0xcc)[_0xb23c('0x2e')]();});}};}function handleEntityNotFound(_0x3fa8b9,_0x1d925c){return function(_0x23e0fa){if(!_0x23e0fa){_0x3fa8b9[_0xb23c('0x1e')](0x194);}return _0x23e0fa;};}function handleError(_0x225a7f,_0x347a93){_0x347a93=_0x347a93||0x1f4;return function(_0x567afc){logger[_0xb23c('0x2f')](_0x567afc[_0xb23c('0x30')]);if(_0x567afc[_0xb23c('0x31')]){delete _0x567afc[_0xb23c('0x31')];}_0x225a7f['status'](_0x347a93)['send'](_0x567afc);};}exports[_0xb23c('0x32')]=function(_0x81d6ed,_0x3b4767){var _0x83357a={},_0x2f6b6e={},_0x3e7391={'count':0x0,'rows':[]};var _0x119ce1=_['map'](db[_0xb23c('0x33')][_0xb23c('0x34')],function(_0x4661d1){return{'name':_0x4661d1['fieldName'],'type':_0x4661d1[_0xb23c('0x35')][_0xb23c('0x36')]};});_0x2f6b6e[_0xb23c('0x37')]=_[_0xb23c('0x38')](_0x119ce1,_0xb23c('0x31'));_0x2f6b6e['query']=_[_0xb23c('0x39')](_0x81d6ed[_0xb23c('0x3a')]);_0x2f6b6e['filters']=_[_0xb23c('0x3b')](_0x2f6b6e['model'],_0x2f6b6e[_0xb23c('0x3a')]);_0x83357a['attributes']=_[_0xb23c('0x3b')](_0x2f6b6e[_0xb23c('0x37')],qs['fields'](_0x81d6ed[_0xb23c('0x3a')][_0xb23c('0x3c')]));_0x83357a[_0xb23c('0x3d')]=_0x83357a['attributes'][_0xb23c('0x3e')]?_0x83357a[_0xb23c('0x3d')]:_0x2f6b6e[_0xb23c('0x37')];if(!_0x81d6ed[_0xb23c('0x3a')][_0xb23c('0x3f')]('nolimit')){_0x83357a[_0xb23c('0x22')]=qs['limit'](_0x81d6ed['query'][_0xb23c('0x22')]);_0x83357a['offset']=qs[_0xb23c('0x20')](_0x81d6ed[_0xb23c('0x3a')]['offset']);}_0x83357a[_0xb23c('0x40')]=qs[_0xb23c('0x41')](_0x81d6ed[_0xb23c('0x3a')][_0xb23c('0x41')]);_0x83357a[_0xb23c('0x42')]=qs[_0xb23c('0x43')](_[_0xb23c('0x44')](_0x81d6ed['query'],_0x2f6b6e['filters']),_0x119ce1);if(_0x81d6ed[_0xb23c('0x3a')]['filter']){_0x83357a['where']=_['merge'](_0x83357a[_0xb23c('0x42')],{'$or':_['map'](_0x119ce1,function(_0x56b362){if(_0x56b362[_0xb23c('0x35')]!==_0xb23c('0x45')){var _0x2dbe90={};_0x2dbe90[_0x56b362[_0xb23c('0x31')]]={'$like':'%'+_0x81d6ed[_0xb23c('0x3a')]['filter']+'%'};return _0x2dbe90;}})});}_0x83357a=_[_0xb23c('0x46')]({},_0x83357a,_0x81d6ed[_0xb23c('0x47')]);var _0x2bc918={'where':_0x83357a[_0xb23c('0x42')]};return db[_0xb23c('0x33')][_0xb23c('0x23')](_0x2bc918)['then'](function(_0x1290b4){_0x3e7391['count']=_0x1290b4;if(_0x81d6ed[_0xb23c('0x3a')][_0xb23c('0x48')]){_0x83357a[_0xb23c('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xb23c('0x4a')](_0x83357a);})[_0xb23c('0x29')](function(_0x49b0bb){_0x3e7391[_0xb23c('0x4b')]=_0x49b0bb;return _0x3e7391;})[_0xb23c('0x29')](respondWithFilteredResult(_0x3b4767,_0x83357a))[_0xb23c('0x4c')](handleError(_0x3b4767,null));};exports['show']=function(_0x3b4a51,_0x3665a0){var _0x14ff02={'raw':!![],'where':{'id':_0x3b4a51[_0xb23c('0x4d')]['id']}},_0x2315db={};_0x2315db['model']=_[_0xb23c('0x39')](db[_0xb23c('0x33')][_0xb23c('0x34')]);_0x2315db['query']=_[_0xb23c('0x39')](_0x3b4a51[_0xb23c('0x3a')]);_0x2315db[_0xb23c('0x43')]=_[_0xb23c('0x3b')](_0x2315db[_0xb23c('0x37')],_0x2315db[_0xb23c('0x3a')]);_0x14ff02[_0xb23c('0x3d')]=_[_0xb23c('0x3b')](_0x2315db[_0xb23c('0x37')],qs[_0xb23c('0x3c')](_0x3b4a51[_0xb23c('0x3a')][_0xb23c('0x3c')]));_0x14ff02[_0xb23c('0x3d')]=_0x14ff02['attributes'][_0xb23c('0x3e')]?_0x14ff02[_0xb23c('0x3d')]:_0x2315db[_0xb23c('0x37')];if(_0x3b4a51['query'][_0xb23c('0x48')]){_0x14ff02[_0xb23c('0x49')]=[{'all':!![]}];}_0x14ff02=_[_0xb23c('0x46')]({},_0x14ff02,_0x3b4a51[_0xb23c('0x47')]);return db[_0xb23c('0x33')][_0xb23c('0x4e')](_0x14ff02)[_0xb23c('0x29')](handleEntityNotFound(_0x3665a0,null))[_0xb23c('0x29')](respondWithResult(_0x3665a0,null))[_0xb23c('0x4c')](handleError(_0x3665a0,null));};exports[_0xb23c('0x4f')]=function(_0x5e902f,_0x1aadb5){return db['OpenchannelQueue'][_0xb23c('0x4f')](_0x5e902f[_0xb23c('0x50')],{})[_0xb23c('0x29')](function(_0x409ffe){var _0x4b5552=_0x5e902f[_0xb23c('0x51')][_0xb23c('0x2a')]({'plain':!![]});if(!_0x4b5552)throw new Error(_0xb23c('0x52'));if(_0x4b5552['role']==='user'){var _0x2d8cd1=_0x409ffe[_0xb23c('0x2a')]({'plain':!![]});var _0x52de4b=_0xb23c('0x2b');return db[_0xb23c('0x53')][_0xb23c('0x4e')]({'where':{'name':_0x52de4b,'userProfileId':_0x4b5552[_0xb23c('0x54')]},'raw':!![]})[_0xb23c('0x29')](function(_0x227acd){if(_0x227acd&&_0x227acd[_0xb23c('0x55')]===0x0){return db[_0xb23c('0x2c')][_0xb23c('0x4f')]({'name':_0x2d8cd1[_0xb23c('0x31')],'resourceId':_0x2d8cd1['id'],'type':_0x227acd[_0xb23c('0x31')],'sectionId':_0x227acd['id']},{})[_0xb23c('0x29')](function(){return _0x409ffe;});}else{return _0x409ffe;}})[_0xb23c('0x4c')](function(_0x9895f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9895f3);throw _0x9895f3;});}return _0x409ffe;})[_0xb23c('0x29')](respondWithResult(_0x1aadb5,0xc9))[_0xb23c('0x4c')](handleError(_0x1aadb5,null));};exports[_0xb23c('0x28')]=function(_0x5e66bb,_0x2b17e0){if(_0x5e66bb[_0xb23c('0x50')]['id']){delete _0x5e66bb[_0xb23c('0x50')]['id'];}return db[_0xb23c('0x33')][_0xb23c('0x4e')]({'where':{'id':_0x5e66bb[_0xb23c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b17e0,null))['then'](saveUpdates(_0x5e66bb[_0xb23c('0x50')],null))['then'](respondWithResult(_0x2b17e0,null))[_0xb23c('0x4c')](handleError(_0x2b17e0,null));};exports[_0xb23c('0x2d')]=function(_0x522134,_0x5b8a4d){return db[_0xb23c('0x33')][_0xb23c('0x4e')]({'where':{'id':_0x522134[_0xb23c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5b8a4d,null))[_0xb23c('0x29')](removeEntity(_0x5b8a4d,null))[_0xb23c('0x4c')](handleError(_0x5b8a4d,null));};exports[_0xb23c('0x56')]=function(_0x16771a,_0x4e580a){return db['OpenchannelQueue'][_0xb23c('0x56')]()[_0xb23c('0x29')](respondWithResult(_0x4e580a,null))[_0xb23c('0x4c')](handleError(_0x4e580a,null));};exports['getMembers']=function(_0x1a0fa8,_0x405dd6,_0x40d774){var _0x1c2ca2={'raw':!![],'where':{}},_0xd5bb3={},_0x2405aa;return db[_0xb23c('0x33')][_0xb23c('0x57')]({'where':{'id':_0x1a0fa8[_0xb23c('0x4d')]['id']}})[_0xb23c('0x29')](handleEntityNotFound(_0x405dd6,null))[_0xb23c('0x29')](function(_0x135958){if(_0x135958){_0x2405aa=_0x135958[_0xb23c('0x2a')]({'plain':!![]});_0xd5bb3[_0xb23c('0x37')]=_[_0xb23c('0x39')](db[_0xb23c('0x58')][_0xb23c('0x34')]);_0xd5bb3[_0xb23c('0x3a')]=_[_0xb23c('0x39')](_0x1a0fa8[_0xb23c('0x3a')]);_0xd5bb3[_0xb23c('0x43')]=_[_0xb23c('0x3b')](_0xd5bb3[_0xb23c('0x37')],_0xd5bb3[_0xb23c('0x3a')]);_0x1c2ca2[_0xb23c('0x3d')]=_[_0xb23c('0x3b')](_0xd5bb3[_0xb23c('0x37')],qs[_0xb23c('0x3c')](_0x1a0fa8[_0xb23c('0x3a')][_0xb23c('0x3c')]));_0x1c2ca2[_0xb23c('0x3d')]=_0x1c2ca2[_0xb23c('0x3d')][_0xb23c('0x3e')]?_0x1c2ca2[_0xb23c('0x3d')]:_0xd5bb3['model'];if(!_0x1a0fa8[_0xb23c('0x3a')][_0xb23c('0x3f')]('nolimit')){_0x1c2ca2['limit']=qs[_0xb23c('0x22')](_0x1a0fa8[_0xb23c('0x3a')][_0xb23c('0x22')]);_0x1c2ca2[_0xb23c('0x20')]=qs[_0xb23c('0x20')](_0x1a0fa8['query'][_0xb23c('0x20')]);}_0x1c2ca2[_0xb23c('0x40')]=qs[_0xb23c('0x41')](_0x1a0fa8[_0xb23c('0x3a')][_0xb23c('0x41')]);_0x1c2ca2[_0xb23c('0x42')]=qs['filters'](_[_0xb23c('0x44')](_0x1a0fa8['query'],_0xd5bb3[_0xb23c('0x43')]));_0x1c2ca2[_0xb23c('0x42')][_0xb23c('0x59')]=_0x135958['id'];if(_0x1a0fa8[_0xb23c('0x3a')][_0xb23c('0x5a')]){_0x1c2ca2[_0xb23c('0x42')]=_[_0xb23c('0x46')](_0x1c2ca2[_0xb23c('0x42')],{'$or':_[_0xb23c('0x38')](_0x1c2ca2['attributes'],function(_0x2a00ae){var _0x166200={};_0x166200[_0x2a00ae]={'$like':'%'+_0x1a0fa8[_0xb23c('0x3a')]['filter']+'%'};return _0x166200;})});}_0x1c2ca2=_[_0xb23c('0x46')]({},_0x1c2ca2,_0x1a0fa8[_0xb23c('0x47')]);return db[_0xb23c('0x58')][_0xb23c('0x4a')](_0x1c2ca2);}})[_0xb23c('0x29')](function(_0x2aab89){if(_0x2aab89){return db[_0xb23c('0x5b')][_0xb23c('0x5c')]({'where':{'id':_[_0xb23c('0x38')](_0x2aab89,_0xb23c('0x5d')),'role':'agent'},'attributes':['id',_0xb23c('0x31'),_0xb23c('0x5e'),_0xb23c('0x5f'),_0xb23c('0x60')]});}})[_0xb23c('0x29')](function(_0x549bf4){if(_0x549bf4){return{'count':_0x549bf4[_0xb23c('0x23')],'rows':_[_0xb23c('0x38')](_0x549bf4[_0xb23c('0x4b')],function(_0x2e6242){return{'membername':_0x2e6242['name'],'UserId':_0x2e6242['id'],'queue_name':_0x2405aa['name'],'OpenchannelQueueId':_0x2405aa['id'],'interface':util[_0xb23c('0x61')]('%s/%s',_0xb23c('0x62'),_0x2e6242[_0xb23c('0x31')]),'penalty':0x0,'paused':_0x2e6242[_0xb23c('0x5e')],'createdAt':_0x2e6242[_0xb23c('0x60')],'updatedAt':_0x2e6242[_0xb23c('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x405dd6,_0x1c2ca2))[_0xb23c('0x4c')](handleError(_0x405dd6,null));};exports[_0xb23c('0x63')]=function(_0x109a9e,_0x4bfb4c,_0xbf3aea){var _0x4d3809={};var _0x4918c6={};var _0xd5db0a;var _0x35f284;return db[_0xb23c('0x33')][_0xb23c('0x57')]({'where':{'id':_0x109a9e[_0xb23c('0x4d')]['id']}})[_0xb23c('0x29')](handleEntityNotFound(_0x4bfb4c,null))[_0xb23c('0x29')](function(_0x4cee97){if(_0x4cee97){_0xd5db0a=_0x4cee97;_0x4918c6[_0xb23c('0x37')]=_[_0xb23c('0x39')](db[_0xb23c('0x64')][_0xb23c('0x34')]);_0x4918c6['query']=_['keys'](_0x109a9e[_0xb23c('0x3a')]);_0x4918c6[_0xb23c('0x43')]=_[_0xb23c('0x3b')](_0x4918c6[_0xb23c('0x37')],_0x4918c6[_0xb23c('0x3a')]);_0x4d3809[_0xb23c('0x3d')]=_[_0xb23c('0x3b')](_0x4918c6[_0xb23c('0x37')],qs['fields'](_0x109a9e[_0xb23c('0x3a')][_0xb23c('0x3c')]));_0x4d3809['attributes']=_0x4d3809[_0xb23c('0x3d')][_0xb23c('0x3e')]?_0x4d3809[_0xb23c('0x3d')]:_0x4918c6[_0xb23c('0x37')];_0x4d3809[_0xb23c('0x40')]=qs[_0xb23c('0x41')](_0x109a9e[_0xb23c('0x3a')][_0xb23c('0x41')]);_0x4d3809[_0xb23c('0x42')]=qs['filters'](_[_0xb23c('0x44')](_0x109a9e['query'],_0x4918c6[_0xb23c('0x43')]));if(_0x109a9e['query'][_0xb23c('0x5a')]){_0x4d3809[_0xb23c('0x42')]=_['merge'](_0x4d3809[_0xb23c('0x42')],{'$or':_['map'](_0x4d3809['attributes'],function(_0x18a009){var _0x5cc004={};_0x5cc004[_0x18a009]={'$like':'%'+_0x109a9e['query'][_0xb23c('0x5a')]+'%'};return _0x5cc004;})});}_0x4d3809=_['merge']({},_0x4d3809,_0x109a9e[_0xb23c('0x47')]);return _0xd5db0a[_0xb23c('0x63')](_0x4d3809);}})[_0xb23c('0x29')](function(_0x509588){if(_0x509588){_0x35f284=_0x509588['length'];if(!_0x109a9e[_0xb23c('0x3a')][_0xb23c('0x3f')](_0xb23c('0x65'))){_0x4d3809[_0xb23c('0x22')]=qs['limit'](_0x109a9e['query'][_0xb23c('0x22')]);_0x4d3809[_0xb23c('0x20')]=qs[_0xb23c('0x20')](_0x109a9e[_0xb23c('0x3a')][_0xb23c('0x20')]);}return _0xd5db0a[_0xb23c('0x63')](_0x4d3809);}})[_0xb23c('0x29')](function(_0x1d33f3){if(_0x1d33f3){return _0x1d33f3?{'count':_0x35f284,'rows':_0x1d33f3}:null;}})[_0xb23c('0x29')](respondWithResult(_0x4bfb4c,null))[_0xb23c('0x4c')](handleError(_0x4bfb4c,null));};exports['addTeams']=function(_0x1ec4a1,_0x423075,_0x54fe23){var _0x8915b8=_0x1ec4a1[_0xb23c('0x50')]['ids'];return db[_0xb23c('0x64')]['findAll']({'where':{'id':_0x8915b8},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb23c('0x66'),'attributes':['id','name',_0xb23c('0x67'),_0xb23c('0x68'),_0xb23c('0x69')],'raw':!![]}]})[_0xb23c('0x29')](function(_0x4144c9){if(_0x4144c9){var _0x40492f=_[_0xb23c('0x6a')](_0x4144c9,function(_0x3b2a83){var _0x5d07d9=_0x3b2a83[_0xb23c('0x2a')]({'plain':!![]});return _0x5d07d9[_0xb23c('0x66')];});return db[_0xb23c('0x33')][_0xb23c('0x4e')]({'where':{'id':_0x1ec4a1[_0xb23c('0x4d')]['id']}})[_0xb23c('0x29')](function(_0x3ce806){return db[_0xb23c('0x6b')][_0xb23c('0x6c')](function(_0x1befc3){return _0x3ce806[_0xb23c('0x6d')](_0x8915b8,{'transaction':_0x1befc3})[_0xb23c('0x29')](function(){return BPromise[_0xb23c('0x6e')](_0x40492f,function(_0x18e505){return db[_0xb23c('0x58')][_0xb23c('0x6f')]({'where':{'UserId':_0x18e505['id'],'OpenchannelQueueId':_0x1ec4a1[_0xb23c('0x4d')]['id']},'transaction':_0x1befc3});});})['then'](function(){_0x40492f['forEach'](function(_0x2690fc){socket[_0xb23c('0x70')](_0xb23c('0x71'),{'UserId':_0x2690fc['id'],'OpenchannelQueueId':_0x3ce806['id']});});});});});}})[_0xb23c('0x29')](respondWithStatusCode(_0x423075,null))[_0xb23c('0x4c')](handleError(_0x423075,null));};exports[_0xb23c('0x72')]=function(_0x589575,_0x44bad7,_0x588711){return db[_0xb23c('0x64')][_0xb23c('0x4a')]({'where':{'id':_0x589575[_0xb23c('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb23c('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb23c('0x29')](handleEntityNotFound(_0x44bad7,null))['then'](function(_0x4c322b){var _0x546fab=_[_0xb23c('0x38')](_0x4c322b,'id');var _0x5d394b=[];var _0x53b8c2=[];var _0x533694=squel[_0xb23c('0x73')]();_0x533694['field'](_0xb23c('0x74'))[_0xb23c('0x75')](_0xb23c('0x76'),'tq')[_0xb23c('0x77')](_0xb23c('0x78'),'ut',_0xb23c('0x79'))[_0xb23c('0x42')](_0xb23c('0x7a'),_0x589575['params']['id']);for(var _0xc4c4e2=0x0;_0xc4c4e2<_0x4c322b[_0xb23c('0x3e')];_0xc4c4e2+=0x1){let _0x2c10ae=_0x4c322b[_0xc4c4e2];for(var _0x4d862a=0x0;_0x4d862a<_0x2c10ae['Agents'][_0xb23c('0x3e')];_0x4d862a+=0x1){let _0xfce327=_0x2c10ae['Agents'][_0x4d862a];var _0x58ddbf=_0x533694[_0xb23c('0x7b')]();_0x58ddbf['where'](_0xb23c('0x7c'),_0xfce327['id']);_0x53b8c2[_0xb23c('0x7d')](db['sequelize'][_0xb23c('0x3a')](_0x58ddbf[_0xb23c('0x7e')](),{'type':db['sequelize'][_0xb23c('0x7f')][_0xb23c('0x80')]})['then'](function(_0x130d14){if(_0x130d14[_0xb23c('0x3e')]===0x1){return _0xfce327['id'];}else{var _0x432363=_['every'](_[_0xb23c('0x38')](_0x130d14,'TeamId'),function(_0x38bb2f){return _[_0xb23c('0x81')](_0x546fab,_0x38bb2f);});if(_0x432363){return _0xfce327['id'];}}}));}}return BPromise[_0xb23c('0x82')](_0x53b8c2)[_0xb23c('0x29')](function(_0x331452){_0x5d394b=_(_0x5d394b)[_0xb23c('0x83')](_0x331452)['compact']()[_0xb23c('0x84')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x589575[_0xb23c('0x4d')]['id']}})[_0xb23c('0x29')](function(_0x9b35d0){return db[_0xb23c('0x6b')][_0xb23c('0x6c')](function(_0x36a575){return _0x9b35d0[_0xb23c('0x72')](_0x589575[_0xb23c('0x3a')][_0xb23c('0x85')],{'transaction':_0x36a575})[_0xb23c('0x29')](function(){if(!_[_0xb23c('0x86')](_0x5d394b)){return _0x9b35d0['removeAgents'](_0x5d394b,{'transaction':_0x36a575});}})[_0xb23c('0x29')](function(){_0x5d394b[_0xb23c('0x87')](function(_0x5370a3){socket[_0xb23c('0x70')](_0xb23c('0x88'),{'UserId':_0x5370a3,'OpenchannelQueueId':_0x9b35d0['id']});});});});});});})['then'](respondWithStatusCode(_0x44bad7,null))[_0xb23c('0x4c')](handleError(_0x44bad7,null));};exports[_0xb23c('0x89')]=function(_0x56922f,_0x447f83,_0x42e853){return db['OpenchannelQueue'][_0xb23c('0x4e')]({'where':{'id':_0x56922f['params']['id']}})[_0xb23c('0x29')](handleEntityNotFound(_0x447f83,null))['then'](function(_0xd5175){if(_0xd5175){return _0xd5175['addAgents'](_0x56922f['body'][_0xb23c('0x85')],_[_0xb23c('0x8a')](_0x56922f[_0xb23c('0x50')],['ids','id'])||{})[_0xb23c('0x8b')](function(_0xe77d58){for(var _0x53b4ab=0x0;_0x53b4ab<_0x56922f[_0xb23c('0x50')]['ids'][_0xb23c('0x3e')];_0x53b4ab+=0x1){socket[_0xb23c('0x70')](_0xb23c('0x71'),{'UserId':Number(_0x56922f[_0xb23c('0x50')][_0xb23c('0x85')][_0x53b4ab]),'OpenchannelQueueId':Number(_0x56922f['params']['id'])});}return _0xe77d58;});}})[_0xb23c('0x29')](respondWithResult(_0x447f83,null))[_0xb23c('0x4c')](handleError(_0x447f83,null));};exports['removeAgents']=function(_0x34e164,_0x3b9ecd,_0x597758){return db['OpenchannelQueue']['find']({'where':{'id':_0x34e164[_0xb23c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3b9ecd,null))[_0xb23c('0x29')](function(_0x49be1b){if(_0x49be1b){return _0x49be1b[_0xb23c('0x8c')](_0x34e164['query']['ids'])[_0xb23c('0x29')](function(){if(_['isArray'](_0x34e164['query'][_0xb23c('0x85')])){for(var _0xc96d5a=0x0;_0xc96d5a<_0x34e164[_0xb23c('0x3a')][_0xb23c('0x85')][_0xb23c('0x3e')];_0xc96d5a+=0x1){socket[_0xb23c('0x70')](_0xb23c('0x88'),{'UserId':Number(_0x34e164[_0xb23c('0x3a')][_0xb23c('0x85')][_0xc96d5a]),'OpenchannelQueueId':Number(_0x34e164[_0xb23c('0x4d')]['id'])});}}else{socket[_0xb23c('0x70')](_0xb23c('0x88'),{'UserId':Number(_0x34e164[_0xb23c('0x3a')]['ids']),'OpenchannelQueueId':Number(_0x34e164[_0xb23c('0x4d')]['id'])});}});}})[_0xb23c('0x29')](respondWithStatusCode(_0x3b9ecd,null))[_0xb23c('0x4c')](handleError(_0x3b9ecd,null));};exports[_0xb23c('0x8d')]=function(_0x3a7267,_0x4dda90,_0x4b0d08){var _0x552c17={};var _0x5cf8b2={};var _0x41756f;var _0x928b15;return db[_0xb23c('0x33')]['findOne']({'where':{'id':_0x3a7267[_0xb23c('0x4d')]['id']}})[_0xb23c('0x29')](handleEntityNotFound(_0x4dda90,null))[_0xb23c('0x29')](function(_0x685074){if(_0x685074){_0x41756f=_0x685074;_0x5cf8b2['model']=_[_0xb23c('0x39')](db[_0xb23c('0x5b')][_0xb23c('0x34')]);_0x5cf8b2[_0xb23c('0x3a')]=_[_0xb23c('0x39')](_0x3a7267[_0xb23c('0x3a')]);_0x5cf8b2[_0xb23c('0x43')]=_['intersection'](_0x5cf8b2[_0xb23c('0x37')],_0x5cf8b2[_0xb23c('0x3a')]);_0x552c17[_0xb23c('0x3d')]=_['intersection'](_0x5cf8b2[_0xb23c('0x37')],qs[_0xb23c('0x3c')](_0x3a7267[_0xb23c('0x3a')][_0xb23c('0x3c')]));_0x552c17[_0xb23c('0x3d')]=_0x552c17[_0xb23c('0x3d')][_0xb23c('0x3e')]?_0x552c17[_0xb23c('0x3d')]:_0x5cf8b2[_0xb23c('0x37')];_0x552c17[_0xb23c('0x40')]=qs[_0xb23c('0x41')](_0x3a7267[_0xb23c('0x3a')][_0xb23c('0x41')]);_0x552c17[_0xb23c('0x42')]=qs[_0xb23c('0x43')](_['pick'](_0x3a7267['query'],_0x5cf8b2[_0xb23c('0x43')]));if(_0x3a7267[_0xb23c('0x3a')]['filter']){_0x552c17[_0xb23c('0x42')]=_[_0xb23c('0x46')](_0x552c17[_0xb23c('0x42')],{'$or':_['map'](_0x552c17[_0xb23c('0x3d')],function(_0x10670f){var _0x5e13f0={};_0x5e13f0[_0x10670f]={'$like':'%'+_0x3a7267['query']['filter']+'%'};return _0x5e13f0;})});}_0x552c17=_['merge']({},_0x552c17,_0x3a7267[_0xb23c('0x47')]);return _0x41756f[_0xb23c('0x8d')](_0x552c17);}})[_0xb23c('0x29')](function(_0x69bf38){if(_0x69bf38){_0x928b15=_0x69bf38['length'];if(!_0x3a7267[_0xb23c('0x3a')][_0xb23c('0x3f')](_0xb23c('0x65'))){_0x552c17['limit']=qs[_0xb23c('0x22')](_0x3a7267[_0xb23c('0x3a')][_0xb23c('0x22')]);_0x552c17[_0xb23c('0x20')]=qs[_0xb23c('0x20')](_0x3a7267[_0xb23c('0x3a')]['offset']);}return _0x41756f[_0xb23c('0x8d')](_0x552c17);}})[_0xb23c('0x29')](function(_0x430684){if(_0x430684){return _0x430684?{'count':_0x928b15,'rows':_0x430684}:null;}})[_0xb23c('0x29')](respondWithResult(_0x4dda90,null))[_0xb23c('0x4c')](handleError(_0x4dda90,null));}; \ No newline at end of file +var _0x8f03=['userOpenchannelQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','OpenchannelQueues','stack','name','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','include','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','findAll','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x5b734b,_0x486a7f){var _0x2a15a3=function(_0x187239){while(--_0x187239){_0x5b734b['push'](_0x5b734b['shift']());}};_0x2a15a3(++_0x486a7f);}(_0x8f03,0x124));var _0x38f0=function(_0x2fba2b,_0x4977bf){_0x2fba2b=_0x2fba2b-0x0;var _0x438896=_0x8f03[_0x2fba2b];return _0x438896;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38f0('0x0'));var zipdir=require(_0x38f0('0x1'));var jsonpatch=require(_0x38f0('0x2'));var rp=require(_0x38f0('0x3'));var moment=require(_0x38f0('0x4'));var BPromise=require(_0x38f0('0x5'));var Mustache=require(_0x38f0('0x6'));var util=require(_0x38f0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x38f0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38f0('0x9'));var _=require(_0x38f0('0xa'));var squel=require(_0x38f0('0xb'));var crypto=require('crypto');var jsforce=require(_0x38f0('0xc'));var deskjs=require(_0x38f0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x38f0('0xe'));var Papa=require(_0x38f0('0xf'));var Redis=require(_0x38f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38f0('0x11'));var as=require(_0x38f0('0x12'));var hardwareService=require(_0x38f0('0x13'));var logger=require(_0x38f0('0x14'))(_0x38f0('0x15'));var utils=require(_0x38f0('0x16'));var config=require(_0x38f0('0x17'));var licenseUtil=require(_0x38f0('0x18'));var db=require(_0x38f0('0x19'))['db'];config[_0x38f0('0x1a')]=_[_0x38f0('0x1b')](config['redis'],{'host':_0x38f0('0x1c'),'port':0x18eb});var socket=require(_0x38f0('0x1d'))(new Redis(config[_0x38f0('0x1a')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0xdea5e5,_0x15b715){_0x15b715=_0x15b715||0xcc;return function(_0x13fde8){if(_0x13fde8){return _0xdea5e5[_0x38f0('0x1e')](_0x15b715);}return _0xdea5e5[_0x38f0('0x1f')](_0x15b715)[_0x38f0('0x20')]();};}function respondWithResult(_0x4ce43a,_0x5e0d50){_0x5e0d50=_0x5e0d50||0xc8;return function(_0x2ccd26){if(_0x2ccd26){return _0x4ce43a[_0x38f0('0x1f')](_0x5e0d50)['json'](_0x2ccd26);}};}function respondWithFilteredResult(_0x5d3daf,_0x4aed1e){return function(_0x2055cf){if(_0x2055cf){var _0x2b91e8=typeof _0x4aed1e['offset']===_0x38f0('0x21')&&typeof _0x4aed1e[_0x38f0('0x22')]===_0x38f0('0x21');var _0x6ff536=_0x2055cf[_0x38f0('0x23')];var _0x33106a=_0x2b91e8?0x0:_0x4aed1e[_0x38f0('0x24')];var _0x1c59fd=_0x2b91e8?_0x2055cf[_0x38f0('0x23')]:_0x4aed1e[_0x38f0('0x24')]+_0x4aed1e[_0x38f0('0x22')];var _0x55c10c;if(_0x1c59fd>=_0x6ff536){_0x1c59fd=_0x6ff536;_0x55c10c=0xc8;}else{_0x55c10c=0xce;}_0x5d3daf[_0x38f0('0x1f')](_0x55c10c);return _0x5d3daf[_0x38f0('0x25')](_0x38f0('0x26'),_0x33106a+'-'+_0x1c59fd+'/'+_0x6ff536)[_0x38f0('0x27')](_0x2055cf);}return null;};}function patchUpdates(_0x55b8af){return function(_0x57b26e){try{jsonpatch[_0x38f0('0x28')](_0x57b26e,_0x55b8af,!![]);}catch(_0x1a17f8){return BPromise[_0x38f0('0x29')](_0x1a17f8);}return _0x57b26e[_0x38f0('0x2a')]();};}function saveUpdates(_0x400e42,_0x16bd37){return function(_0x5f07c5){if(_0x5f07c5){return _0x5f07c5[_0x38f0('0x2b')](_0x400e42)[_0x38f0('0x2c')](function(_0x1e96b5){return _0x1e96b5;});}return null;};}function removeEntity(_0x116e96,_0x264234){return function(_0x4290c6){if(_0x4290c6){return _0x4290c6[_0x38f0('0x2d')]()['then'](function(){var _0x4de5b4=_0x4290c6[_0x38f0('0x2e')]({'plain':!![]});var _0x16de72=_0x38f0('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x16de72,'resourceId':_0x4de5b4['id']}})[_0x38f0('0x2c')](function(){return _0x4290c6;});})[_0x38f0('0x2c')](function(){_0x116e96[_0x38f0('0x1f')](0xcc)[_0x38f0('0x20')]();});}};}function handleEntityNotFound(_0x399899,_0x25a1c5){return function(_0x16797b){if(!_0x16797b){_0x399899[_0x38f0('0x1e')](0x194);}return _0x16797b;};}function handleError(_0x680731,_0x4dadca){_0x4dadca=_0x4dadca||0x1f4;return function(_0x32917d){logger['error'](_0x32917d[_0x38f0('0x30')]);if(_0x32917d[_0x38f0('0x31')]){delete _0x32917d[_0x38f0('0x31')];}_0x680731[_0x38f0('0x1f')](_0x4dadca)['send'](_0x32917d);};}exports[_0x38f0('0x32')]=function(_0x44ce49,_0x3f1d91){var _0x5a005e={},_0x32abea={},_0x508817={'count':0x0,'rows':[]};var _0x26292d=_['map'](db[_0x38f0('0x33')][_0x38f0('0x34')],function(_0x56e451){return{'name':_0x56e451[_0x38f0('0x35')],'type':_0x56e451[_0x38f0('0x36')][_0x38f0('0x37')]};});_0x32abea[_0x38f0('0x38')]=_['map'](_0x26292d,'name');_0x32abea[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x44ce49['query']);_0x32abea[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x32abea[_0x38f0('0x38')],_0x32abea[_0x38f0('0x39')]);_0x5a005e[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x32abea[_0x38f0('0x38')],qs[_0x38f0('0x3e')](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x3e')]));_0x5a005e[_0x38f0('0x3d')]=_0x5a005e[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x5a005e[_0x38f0('0x3d')]:_0x32abea[_0x38f0('0x38')];if(!_0x44ce49['query'][_0x38f0('0x40')](_0x38f0('0x41'))){_0x5a005e['limit']=qs[_0x38f0('0x22')](_0x44ce49[_0x38f0('0x39')]['limit']);_0x5a005e[_0x38f0('0x24')]=qs['offset'](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x24')]);}_0x5a005e[_0x38f0('0x42')]=qs['sort'](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x43')]);_0x5a005e[_0x38f0('0x44')]=qs[_0x38f0('0x3b')](_[_0x38f0('0x45')](_0x44ce49[_0x38f0('0x39')],_0x32abea[_0x38f0('0x3b')]),_0x26292d);if(_0x44ce49[_0x38f0('0x39')]['filter']){_0x5a005e[_0x38f0('0x44')]=_[_0x38f0('0x46')](_0x5a005e[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x26292d,function(_0x33fe94){if(_0x33fe94[_0x38f0('0x36')]!=='VIRTUAL'){var _0x4f3982={};_0x4f3982[_0x33fe94[_0x38f0('0x31')]]={'$like':'%'+_0x44ce49[_0x38f0('0x39')][_0x38f0('0x48')]+'%'};return _0x4f3982;}})});}_0x5a005e=_[_0x38f0('0x46')]({},_0x5a005e,_0x44ce49[_0x38f0('0x49')]);var _0xab25dd={'where':_0x5a005e['where']};return db[_0x38f0('0x33')][_0x38f0('0x23')](_0xab25dd)[_0x38f0('0x2c')](function(_0x20058a){_0x508817[_0x38f0('0x23')]=_0x20058a;if(_0x44ce49[_0x38f0('0x39')]['includeAll']){_0x5a005e[_0x38f0('0x4a')]=[{'all':!![]}];}return db[_0x38f0('0x33')]['findAll'](_0x5a005e);})[_0x38f0('0x2c')](function(_0x2d578c){_0x508817[_0x38f0('0x4b')]=_0x2d578c;return _0x508817;})[_0x38f0('0x2c')](respondWithFilteredResult(_0x3f1d91,_0x5a005e))[_0x38f0('0x4c')](handleError(_0x3f1d91,null));};exports[_0x38f0('0x4d')]=function(_0x48f768,_0xb715a9){var _0x14fdd1={'raw':!![],'where':{'id':_0x48f768[_0x38f0('0x4e')]['id']}},_0x29f6a8={};_0x29f6a8[_0x38f0('0x38')]=_['keys'](db['OpenchannelQueue'][_0x38f0('0x34')]);_0x29f6a8[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x48f768['query']);_0x29f6a8[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x29f6a8['model'],_0x29f6a8[_0x38f0('0x39')]);_0x14fdd1[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x29f6a8['model'],qs[_0x38f0('0x3e')](_0x48f768[_0x38f0('0x39')]['fields']));_0x14fdd1['attributes']=_0x14fdd1[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x14fdd1[_0x38f0('0x3d')]:_0x29f6a8[_0x38f0('0x38')];if(_0x48f768['query'][_0x38f0('0x4f')]){_0x14fdd1[_0x38f0('0x4a')]=[{'all':!![]}];}_0x14fdd1=_[_0x38f0('0x46')]({},_0x14fdd1,_0x48f768[_0x38f0('0x49')]);return db[_0x38f0('0x33')]['find'](_0x14fdd1)[_0x38f0('0x2c')](handleEntityNotFound(_0xb715a9,null))[_0x38f0('0x2c')](respondWithResult(_0xb715a9,null))[_0x38f0('0x4c')](handleError(_0xb715a9,null));};exports[_0x38f0('0x50')]=function(_0x58986b,_0x72916e){return db[_0x38f0('0x33')][_0x38f0('0x50')](_0x58986b[_0x38f0('0x51')],{})[_0x38f0('0x2c')](function(_0x5990f9){var _0x1555a1=_0x58986b['user'][_0x38f0('0x2e')]({'plain':!![]});if(!_0x1555a1)throw new Error(_0x38f0('0x52'));if(_0x1555a1['role']===_0x38f0('0x53')){var _0x450203=_0x5990f9[_0x38f0('0x2e')]({'plain':!![]});var _0x3fa35e=_0x38f0('0x2f');return db[_0x38f0('0x54')][_0x38f0('0x55')]({'where':{'name':_0x3fa35e,'userProfileId':_0x1555a1[_0x38f0('0x56')]},'raw':!![]})[_0x38f0('0x2c')](function(_0xf4d171){if(_0xf4d171&&_0xf4d171[_0x38f0('0x57')]===0x0){return db['UserProfileResource'][_0x38f0('0x50')]({'name':_0x450203['name'],'resourceId':_0x450203['id'],'type':_0xf4d171[_0x38f0('0x31')],'sectionId':_0xf4d171['id']},{})['then'](function(){return _0x5990f9;});}else{return _0x5990f9;}})[_0x38f0('0x4c')](function(_0x52a384){logger[_0x38f0('0x58')](_0x38f0('0x59'),_0x52a384);throw _0x52a384;});}return _0x5990f9;})[_0x38f0('0x2c')](respondWithResult(_0x72916e,0xc9))['catch'](handleError(_0x72916e,null));};exports[_0x38f0('0x2b')]=function(_0x47ed19,_0x3dd883){if(_0x47ed19[_0x38f0('0x51')]['id']){delete _0x47ed19[_0x38f0('0x51')]['id'];}return db[_0x38f0('0x33')]['find']({'where':{'id':_0x47ed19[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x3dd883,null))[_0x38f0('0x2c')](saveUpdates(_0x47ed19['body'],null))[_0x38f0('0x2c')](respondWithResult(_0x3dd883,null))[_0x38f0('0x4c')](handleError(_0x3dd883,null));};exports[_0x38f0('0x2d')]=function(_0x3619ba,_0x4a5b65){return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x3619ba[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x4a5b65,null))[_0x38f0('0x2c')](removeEntity(_0x4a5b65,null))['catch'](handleError(_0x4a5b65,null));};exports[_0x38f0('0x5a')]=function(_0x358cf1,_0x32106f){return db[_0x38f0('0x33')]['describe']()['then'](respondWithResult(_0x32106f,null))[_0x38f0('0x4c')](handleError(_0x32106f,null));};exports[_0x38f0('0x5b')]=function(_0x19aa9c,_0x105b49,_0x513770){var _0x3dcb9d={'raw':!![],'where':{}},_0x4d8c87={},_0x53eb0b;return db[_0x38f0('0x33')][_0x38f0('0x5c')]({'where':{'id':_0x19aa9c[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x105b49,null))['then'](function(_0x4a00e6){if(_0x4a00e6){_0x53eb0b=_0x4a00e6[_0x38f0('0x2e')]({'plain':!![]});_0x4d8c87['model']=_[_0x38f0('0x3a')](db[_0x38f0('0x5d')][_0x38f0('0x34')]);_0x4d8c87['query']=_[_0x38f0('0x3a')](_0x19aa9c[_0x38f0('0x39')]);_0x4d8c87['filters']=_[_0x38f0('0x3c')](_0x4d8c87[_0x38f0('0x38')],_0x4d8c87[_0x38f0('0x39')]);_0x3dcb9d[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x4d8c87[_0x38f0('0x38')],qs['fields'](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x3e')]));_0x3dcb9d[_0x38f0('0x3d')]=_0x3dcb9d[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x3dcb9d[_0x38f0('0x3d')]:_0x4d8c87[_0x38f0('0x38')];if(!_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x40')]('nolimit')){_0x3dcb9d[_0x38f0('0x22')]=qs[_0x38f0('0x22')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x22')]);_0x3dcb9d[_0x38f0('0x24')]=qs[_0x38f0('0x24')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x24')]);}_0x3dcb9d['order']=qs[_0x38f0('0x43')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x43')]);_0x3dcb9d[_0x38f0('0x44')]=qs['filters'](_[_0x38f0('0x45')](_0x19aa9c[_0x38f0('0x39')],_0x4d8c87[_0x38f0('0x3b')]));_0x3dcb9d['where']['OpenchannelQueueId']=_0x4a00e6['id'];if(_0x19aa9c[_0x38f0('0x39')]['filter']){_0x3dcb9d['where']=_[_0x38f0('0x46')](_0x3dcb9d[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x3dcb9d['attributes'],function(_0x5f3c49){var _0xfdfb1a={};_0xfdfb1a[_0x5f3c49]={'$like':'%'+_0x19aa9c[_0x38f0('0x39')]['filter']+'%'};return _0xfdfb1a;})});}_0x3dcb9d=_[_0x38f0('0x46')]({},_0x3dcb9d,_0x19aa9c['options']);return db[_0x38f0('0x5d')][_0x38f0('0x5e')](_0x3dcb9d);}})['then'](function(_0x5368c1){if(_0x5368c1){return db[_0x38f0('0x5f')][_0x38f0('0x60')]({'where':{'id':_[_0x38f0('0x47')](_0x5368c1,_0x38f0('0x61')),'role':'agent'},'attributes':['id',_0x38f0('0x31'),_0x38f0('0x62'),_0x38f0('0x63'),_0x38f0('0x64')]});}})[_0x38f0('0x2c')](function(_0x4c6f90){if(_0x4c6f90){return{'count':_0x4c6f90[_0x38f0('0x23')],'rows':_[_0x38f0('0x47')](_0x4c6f90['rows'],function(_0x372ec2){return{'membername':_0x372ec2[_0x38f0('0x31')],'UserId':_0x372ec2['id'],'queue_name':_0x53eb0b['name'],'OpenchannelQueueId':_0x53eb0b['id'],'interface':util['format']('%s/%s',_0x38f0('0x65'),_0x372ec2[_0x38f0('0x31')]),'penalty':0x0,'paused':_0x372ec2[_0x38f0('0x62')],'createdAt':_0x372ec2[_0x38f0('0x64')],'updatedAt':_0x372ec2[_0x38f0('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x105b49,_0x3dcb9d))['catch'](handleError(_0x105b49,null));};exports['getTeams']=function(_0x58b076,_0x4c3a26,_0x3bddb5){var _0x12cd48={};var _0x1d5754={};var _0x27b230;var _0xce901c;return db['OpenchannelQueue'][_0x38f0('0x5c')]({'where':{'id':_0x58b076[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x4c3a26,null))[_0x38f0('0x2c')](function(_0x39f249){if(_0x39f249){_0x27b230=_0x39f249;_0x1d5754[_0x38f0('0x38')]=_['keys'](db[_0x38f0('0x66')][_0x38f0('0x34')]);_0x1d5754[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x58b076['query']);_0x1d5754[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x1d5754['model'],_0x1d5754[_0x38f0('0x39')]);_0x12cd48[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x1d5754['model'],qs[_0x38f0('0x3e')](_0x58b076[_0x38f0('0x39')]['fields']));_0x12cd48['attributes']=_0x12cd48['attributes'][_0x38f0('0x3f')]?_0x12cd48[_0x38f0('0x3d')]:_0x1d5754[_0x38f0('0x38')];_0x12cd48[_0x38f0('0x42')]=qs[_0x38f0('0x43')](_0x58b076[_0x38f0('0x39')][_0x38f0('0x43')]);_0x12cd48['where']=qs[_0x38f0('0x3b')](_[_0x38f0('0x45')](_0x58b076[_0x38f0('0x39')],_0x1d5754[_0x38f0('0x3b')]));if(_0x58b076[_0x38f0('0x39')][_0x38f0('0x48')]){_0x12cd48['where']=_[_0x38f0('0x46')](_0x12cd48[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x12cd48[_0x38f0('0x3d')],function(_0x516ea4){var _0x1ff0ac={};_0x1ff0ac[_0x516ea4]={'$like':'%'+_0x58b076[_0x38f0('0x39')]['filter']+'%'};return _0x1ff0ac;})});}_0x12cd48=_[_0x38f0('0x46')]({},_0x12cd48,_0x58b076[_0x38f0('0x49')]);return _0x27b230['getTeams'](_0x12cd48);}})[_0x38f0('0x2c')](function(_0xe274f8){if(_0xe274f8){_0xce901c=_0xe274f8[_0x38f0('0x3f')];if(!_0x58b076[_0x38f0('0x39')][_0x38f0('0x40')](_0x38f0('0x41'))){_0x12cd48['limit']=qs[_0x38f0('0x22')](_0x58b076[_0x38f0('0x39')][_0x38f0('0x22')]);_0x12cd48[_0x38f0('0x24')]=qs['offset'](_0x58b076['query'][_0x38f0('0x24')]);}return _0x27b230[_0x38f0('0x67')](_0x12cd48);}})[_0x38f0('0x2c')](function(_0x316a68){if(_0x316a68){return _0x316a68?{'count':_0xce901c,'rows':_0x316a68}:null;}})['then'](respondWithResult(_0x4c3a26,null))['catch'](handleError(_0x4c3a26,null));};exports[_0x38f0('0x68')]=function(_0x85d8ba,_0x2b52e5,_0x19c905){var _0x36c9be=_0x85d8ba['body'][_0x38f0('0x69')];return db['Team']['findAll']({'where':{'id':_0x36c9be},'attributes':['id'],'include':[{'model':db[_0x38f0('0x5f')],'as':_0x38f0('0x6a'),'attributes':['id','name',_0x38f0('0x6b'),_0x38f0('0x6c'),_0x38f0('0x6d')],'raw':!![]}]})[_0x38f0('0x2c')](function(_0x48cfbf){if(_0x48cfbf){var _0x58c8bd=_['flatMap'](_0x48cfbf,function(_0x5de2b5){var _0xb3bbbe=_0x5de2b5['get']({'plain':!![]});return _0xb3bbbe[_0x38f0('0x6a')];});return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x85d8ba[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](function(_0x2027d7){return db[_0x38f0('0x6e')]['transaction'](function(_0x4efa7d){return _0x2027d7[_0x38f0('0x68')](_0x36c9be,{'transaction':_0x4efa7d})[_0x38f0('0x2c')](function(){return BPromise[_0x38f0('0x6f')](_0x58c8bd,function(_0x2af217){return db['UserOpenchannelQueue'][_0x38f0('0x70')]({'where':{'UserId':_0x2af217['id'],'OpenchannelQueueId':_0x85d8ba['params']['id']},'transaction':_0x4efa7d});});})[_0x38f0('0x2c')](function(){_0x58c8bd[_0x38f0('0x71')](function(_0x20de89){socket[_0x38f0('0x72')]('userOpenchannelQueue:save',{'UserId':_0x20de89['id'],'OpenchannelQueueId':_0x2027d7['id']});});});});});}})[_0x38f0('0x2c')](respondWithStatusCode(_0x2b52e5,null))[_0x38f0('0x4c')](handleError(_0x2b52e5,null));};exports[_0x38f0('0x73')]=function(_0x8e9a39,_0x286d6e,_0x48b5a5){return db['Team']['findAll']({'where':{'id':_0x8e9a39[_0x38f0('0x39')][_0x38f0('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x38f0('0x2c')](handleEntityNotFound(_0x286d6e,null))[_0x38f0('0x2c')](function(_0x515a27){var _0x1dd519=_[_0x38f0('0x47')](_0x515a27,'id');var _0x478a41=[];var _0x18cf64=[];var _0x445517=squel[_0x38f0('0x74')]();_0x445517[_0x38f0('0x75')](_0x38f0('0x76'))[_0x38f0('0x77')](_0x38f0('0x78'),'tq')[_0x38f0('0x79')](_0x38f0('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x38f0('0x44')](_0x38f0('0x7b'),_0x8e9a39[_0x38f0('0x4e')]['id']);for(var _0xcd7f5a=0x0;_0xcd7f5a<_0x515a27[_0x38f0('0x3f')];_0xcd7f5a+=0x1){let _0x2b36fa=_0x515a27[_0xcd7f5a];for(var _0x351a4d=0x0;_0x351a4d<_0x2b36fa['Agents'][_0x38f0('0x3f')];_0x351a4d+=0x1){let _0x24be82=_0x2b36fa['Agents'][_0x351a4d];var _0x3f4b43=_0x445517[_0x38f0('0x7c')]();_0x3f4b43[_0x38f0('0x44')](_0x38f0('0x7d'),_0x24be82['id']);_0x18cf64[_0x38f0('0x7e')](db['sequelize'][_0x38f0('0x39')](_0x3f4b43[_0x38f0('0x7f')](),{'type':db[_0x38f0('0x6e')][_0x38f0('0x80')][_0x38f0('0x81')]})[_0x38f0('0x2c')](function(_0x33347f){if(_0x33347f[_0x38f0('0x3f')]===0x1){return _0x24be82['id'];}else{var _0x3cb1ab=_[_0x38f0('0x82')](_['map'](_0x33347f,_0x38f0('0x83')),function(_0x6dbab5){return _['includes'](_0x1dd519,_0x6dbab5);});if(_0x3cb1ab){return _0x24be82['id'];}}}));}}return BPromise[_0x38f0('0x84')](_0x18cf64)[_0x38f0('0x2c')](function(_0x48050b){_0x478a41=_(_0x478a41)[_0x38f0('0x85')](_0x48050b)['compact']()['value']();return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x8e9a39[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](function(_0x55ed92){return db[_0x38f0('0x6e')][_0x38f0('0x86')](function(_0x316f08){return _0x55ed92[_0x38f0('0x73')](_0x8e9a39[_0x38f0('0x39')]['ids'],{'transaction':_0x316f08})[_0x38f0('0x2c')](function(){if(!_[_0x38f0('0x87')](_0x478a41)){return _0x55ed92['removeAgents'](_0x478a41,{'transaction':_0x316f08});}})[_0x38f0('0x2c')](function(){_0x478a41[_0x38f0('0x71')](function(_0x2920d6){socket['emit'](_0x38f0('0x88'),{'UserId':_0x2920d6,'OpenchannelQueueId':_0x55ed92['id']});});});});});});})['then'](respondWithStatusCode(_0x286d6e,null))[_0x38f0('0x4c')](handleError(_0x286d6e,null));};exports[_0x38f0('0x89')]=function(_0x30d318,_0x432d8d,_0x39d1be){return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x30d318[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x432d8d,null))[_0x38f0('0x2c')](function(_0x5cf3f1){if(_0x5cf3f1){return _0x5cf3f1[_0x38f0('0x89')](_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')],_[_0x38f0('0x8a')](_0x30d318[_0x38f0('0x51')],[_0x38f0('0x69'),'id'])||{})[_0x38f0('0x8b')](function(_0x4a6723){for(var _0x584866=0x0;_0x584866<_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')][_0x38f0('0x3f')];_0x584866+=0x1){socket['emit'](_0x38f0('0x8c'),{'UserId':Number(_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')][_0x584866]),'OpenchannelQueueId':Number(_0x30d318[_0x38f0('0x4e')]['id'])});}return _0x4a6723;});}})[_0x38f0('0x2c')](respondWithResult(_0x432d8d,null))[_0x38f0('0x4c')](handleError(_0x432d8d,null));};exports['removeAgents']=function(_0x32657a,_0x74d07f,_0xa34c0b){return db['OpenchannelQueue'][_0x38f0('0x55')]({'where':{'id':_0x32657a[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x74d07f,null))[_0x38f0('0x2c')](function(_0x1adc93){if(_0x1adc93){return _0x1adc93[_0x38f0('0x8d')](_0x32657a[_0x38f0('0x39')]['ids'])[_0x38f0('0x2c')](function(){if(_[_0x38f0('0x8e')](_0x32657a['query'][_0x38f0('0x69')])){for(var _0x2e7236=0x0;_0x2e7236<_0x32657a[_0x38f0('0x39')][_0x38f0('0x69')][_0x38f0('0x3f')];_0x2e7236+=0x1){socket[_0x38f0('0x72')](_0x38f0('0x88'),{'UserId':Number(_0x32657a[_0x38f0('0x39')]['ids'][_0x2e7236]),'OpenchannelQueueId':Number(_0x32657a['params']['id'])});}}else{socket[_0x38f0('0x72')](_0x38f0('0x88'),{'UserId':Number(_0x32657a[_0x38f0('0x39')][_0x38f0('0x69')]),'OpenchannelQueueId':Number(_0x32657a[_0x38f0('0x4e')]['id'])});}});}})[_0x38f0('0x2c')](respondWithStatusCode(_0x74d07f,null))['catch'](handleError(_0x74d07f,null));};exports[_0x38f0('0x8f')]=function(_0x2f6cca,_0x2f1915,_0x4daa9a){var _0x2a0769={};var _0x5b08be={};var _0x59e04f;var _0x58f4da;return db[_0x38f0('0x33')][_0x38f0('0x5c')]({'where':{'id':_0x2f6cca[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x2f1915,null))['then'](function(_0x1f6f84){if(_0x1f6f84){_0x59e04f=_0x1f6f84;_0x5b08be[_0x38f0('0x38')]=_[_0x38f0('0x3a')](db[_0x38f0('0x5f')][_0x38f0('0x34')]);_0x5b08be[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x2f6cca[_0x38f0('0x39')]);_0x5b08be['filters']=_['intersection'](_0x5b08be[_0x38f0('0x38')],_0x5b08be[_0x38f0('0x39')]);_0x2a0769[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x5b08be['model'],qs[_0x38f0('0x3e')](_0x2f6cca[_0x38f0('0x39')]['fields']));_0x2a0769[_0x38f0('0x3d')]=_0x2a0769['attributes']['length']?_0x2a0769[_0x38f0('0x3d')]:_0x5b08be[_0x38f0('0x38')];_0x2a0769[_0x38f0('0x42')]=qs[_0x38f0('0x43')](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x43')]);_0x2a0769[_0x38f0('0x44')]=qs['filters'](_[_0x38f0('0x45')](_0x2f6cca[_0x38f0('0x39')],_0x5b08be[_0x38f0('0x3b')]));if(_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x48')]){_0x2a0769[_0x38f0('0x44')]=_[_0x38f0('0x46')](_0x2a0769[_0x38f0('0x44')],{'$or':_['map'](_0x2a0769[_0x38f0('0x3d')],function(_0x4fa6e2){var _0x147756={};_0x147756[_0x4fa6e2]={'$like':'%'+_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x48')]+'%'};return _0x147756;})});}_0x2a0769=_[_0x38f0('0x46')]({},_0x2a0769,_0x2f6cca[_0x38f0('0x49')]);return _0x59e04f[_0x38f0('0x8f')](_0x2a0769);}})[_0x38f0('0x2c')](function(_0x598f10){if(_0x598f10){_0x58f4da=_0x598f10[_0x38f0('0x3f')];if(!_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x40')](_0x38f0('0x41'))){_0x2a0769['limit']=qs['limit'](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x22')]);_0x2a0769[_0x38f0('0x24')]=qs[_0x38f0('0x24')](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x24')]);}return _0x59e04f['getAgents'](_0x2a0769);}})[_0x38f0('0x2c')](function(_0x38575f){if(_0x38575f){return _0x38575f?{'count':_0x58f4da,'rows':_0x38575f}:null;}})[_0x38f0('0x2c')](respondWithResult(_0x2f1915,null))[_0x38f0('0x4c')](handleError(_0x2f1915,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5af98d2..800c9d5 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 _0xbbcd=['hook','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3887b3,_0x38d669){var _0x2541a9=function(_0x2195ba){while(--_0x2195ba){_0x3887b3['push'](_0x3887b3['shift']());}};_0x2541a9(++_0x38d669);}(_0xbbcd,0xe9));var _0xdbbc=function(_0x5eaf89,_0x2204d6){_0x5eaf89=_0x5eaf89-0x0;var _0x2d878f=_0xbbcd[_0x5eaf89];return _0x2d878f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xdbbc('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdbbc('0x1')](0x0);var events={'afterCreate':_0xdbbc('0x2'),'afterUpdate':_0xdbbc('0x3'),'afterDestroy':_0xdbbc('0x4')};function emitEvent(_0x3e3b4b){return function(_0x3b51ca,_0x29d5f5,_0x54bcc0){OpenchannelQueueEvents[_0xdbbc('0x5')](_0x3e3b4b+':'+_0x3b51ca['id'],_0x3b51ca);OpenchannelQueueEvents[_0xdbbc('0x5')](_0x3e3b4b,_0x3b51ca);_0x54bcc0(null);};}for(var e in events){if(events[_0xdbbc('0x6')](e)){var event=events[e];OpenchannelQueue[_0xdbbc('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x5176=['emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','remove'];(function(_0x56cc19,_0x2fd3a3){var _0x19cf03=function(_0x2e70ed){while(--_0x2e70ed){_0x56cc19['push'](_0x56cc19['shift']());}};_0x19cf03(++_0x2fd3a3);}(_0x5176,0x1ae));var _0x6517=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5176[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x6517('0x0'))['db'][_0x6517('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6517('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6517('0x3')};function emitEvent(_0x4aef45){return function(_0x321772,_0x26cb2a,_0x28ccba){OpenchannelQueueEvents[_0x6517('0x4')](_0x4aef45+':'+_0x321772['id'],_0x321772);OpenchannelQueueEvents[_0x6517('0x4')](_0x4aef45,_0x321772);_0x28ccba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x6517('0x5')](e,emitEvent(event));}}module[_0x6517('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 3e92e50..a7635ec 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 _0x0a1d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x24deb9,_0x206ea7){var _0xa375ba=function(_0x19078f){while(--_0x19078f){_0x24deb9['push'](_0x24deb9['shift']());}};_0xa375ba(++_0x206ea7);}(_0x0a1d,0x152));var _0xd0a1=function(_0x2d5219,_0x5adf57){_0x2d5219=_0x2d5219-0x0;var _0xf67855=_0x0a1d[_0x2d5219];return _0xf67855;};'use strict';var _=require(_0xd0a1('0x0'));var util=require('util');var logger=require(_0xd0a1('0x1'))(_0xd0a1('0x2'));var moment=require(_0xd0a1('0x3'));var BPromise=require(_0xd0a1('0x4'));var rp=require(_0xd0a1('0x5'));var fs=require('fs');var path=require(_0xd0a1('0x6'));var rimraf=require(_0xd0a1('0x7'));var config=require(_0xd0a1('0x8'));var attributes=require(_0xd0a1('0x9'));module[_0xd0a1('0xa')]=function(_0x36b91a,_0x5cee28){return _0x36b91a[_0xd0a1('0xb')](_0xd0a1('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17aa=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x17aa,0x120));var _0xa17a=function(_0x94eb91,_0x58aa9e){_0x94eb91=_0x94eb91-0x0;var _0x20eaa0=_0x17aa[_0x94eb91];return _0x20eaa0;};'use strict';var _=require(_0xa17a('0x0'));var util=require(_0xa17a('0x1'));var logger=require(_0xa17a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa17a('0x3'));var rp=require(_0xa17a('0x4'));var fs=require('fs');var path=require(_0xa17a('0x5'));var rimraf=require(_0xa17a('0x6'));var config=require(_0xa17a('0x7'));var attributes=require(_0xa17a('0x8'));module['exports']=function(_0x3a2e07,_0x205a7a){return _0x3a2e07[_0xa17a('0x9')](_0xa17a('0xa'),attributes,{'tableName':_0xa17a('0xb'),'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 0962278..b4ecf8a 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 _0x0fb8=['request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','ShowOpenchannelQueue','where','debug','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x1ac4be,_0x254fbb){var _0x4417ba=function(_0x291f87){while(--_0x291f87){_0x1ac4be['push'](_0x1ac4be['shift']());}};_0x4417ba(++_0x254fbb);}(_0x0fb8,0x190));var _0x80fb=function(_0x57426f,_0x52f0d3){_0x57426f=_0x57426f-0x0;var _0xe15733=_0x0fb8[_0x57426f];return _0xe15733;};'use strict';var _=require(_0x80fb('0x0'));var util=require(_0x80fb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x80fb('0x2'));var fs=require('fs');var Redis=require(_0x80fb('0x3'));var db=require(_0x80fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x80fb('0x5'));var config=require('../../config/environment');var jayson=require(_0x80fb('0x6'));var client=jayson[_0x80fb('0x7')][_0x80fb('0x8')]({'port':0x232a});config[_0x80fb('0x9')]=_[_0x80fb('0xa')](config[_0x80fb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x80fb('0xb'))(new Redis(config[_0x80fb('0x9')]));require(_0x80fb('0xc'))[_0x80fb('0xd')](socket);function respondWithRpcPromise(_0x3b7b83,_0x1b6d1b,_0x2b7457){return new BPromise(function(_0x22abd2,_0x57f0a6){return client[_0x80fb('0xe')](_0x3b7b83,_0x2b7457)[_0x80fb('0xf')](function(_0x110c97){logger[_0x80fb('0x10')](_0x80fb('0x11'),_0x1b6d1b,_0x80fb('0x12'));logger['debug'](_0x80fb('0x13'),_0x1b6d1b,_0x80fb('0x12'),JSON[_0x80fb('0x14')](_0x110c97));if(_0x110c97[_0x80fb('0x15')]){if(_0x110c97['error']['code']===0x1f4){logger[_0x80fb('0x15')](_0x80fb('0x11'),_0x1b6d1b,_0x110c97[_0x80fb('0x15')][_0x80fb('0x16')]);return _0x57f0a6(_0x110c97['error'][_0x80fb('0x16')]);}logger['error'](_0x80fb('0x11'),_0x1b6d1b,_0x110c97[_0x80fb('0x15')]['message']);return _0x22abd2(_0x110c97[_0x80fb('0x15')][_0x80fb('0x16')]);}else{logger['info'](_0x80fb('0x11'),_0x1b6d1b,_0x80fb('0x12'));_0x22abd2(_0x110c97[_0x80fb('0x17')][_0x80fb('0x16')]);}})[_0x80fb('0x18')](function(_0x2e6c9e){logger[_0x80fb('0x15')](_0x80fb('0x11'),_0x1b6d1b,_0x2e6c9e);_0x57f0a6(_0x2e6c9e);});});}exports[_0x80fb('0x19')]=function(_0x42fab9){var _0x35a1bf=this;return new Promise(function(_0x48cdb9,_0x2df9bc){return db[_0x80fb('0x1a')][_0x80fb('0x1b')]({'raw':_0x42fab9['options']?_0x42fab9[_0x80fb('0x1c')][_0x80fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x42fab9[_0x80fb('0x1c')]?_0x42fab9[_0x80fb('0x1c')]['where']||null:null,'attributes':_0x42fab9[_0x80fb('0x1c')]?_0x42fab9[_0x80fb('0x1c')][_0x80fb('0x1e')]||null:null,'limit':_0x42fab9[_0x80fb('0x1c')]?_0x42fab9[_0x80fb('0x1c')][_0x80fb('0x1f')]||null:null,'include':_0x42fab9[_0x80fb('0x1c')]?_0x42fab9[_0x80fb('0x1c')][_0x80fb('0x20')]?_[_0x80fb('0x21')](_0x42fab9[_0x80fb('0x1c')][_0x80fb('0x20')],function(_0x1697e6){return{'model':db[_0x1697e6[_0x80fb('0x22')]],'as':_0x1697e6['as'],'attributes':_0x1697e6[_0x80fb('0x1e')],'include':_0x1697e6[_0x80fb('0x20')]?_['map'](_0x1697e6['include'],function(_0x34dfe6){return{'model':db[_0x34dfe6[_0x80fb('0x22')]],'as':_0x34dfe6['as'],'attributes':_0x34dfe6[_0x80fb('0x1e')],'include':_0x34dfe6[_0x80fb('0x20')]?_['map'](_0x34dfe6[_0x80fb('0x20')],function(_0x3ec5a0){return{'model':db[_0x3ec5a0[_0x80fb('0x22')]],'as':_0x3ec5a0['as'],'attributes':_0x3ec5a0[_0x80fb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x80fb('0xf')](function(_0x33ad84){logger[_0x80fb('0x10')](_0x80fb('0x19'),_0x42fab9);logger['debug']('GetOpenchannelQueue',_0x42fab9,JSON[_0x80fb('0x14')](_0x33ad84));_0x48cdb9(_0x33ad84);})[_0x80fb('0x18')](function(_0x21463e){logger[_0x80fb('0x15')]('GetOpenchannelQueue',_0x21463e[_0x80fb('0x16')],_0x42fab9);_0x2df9bc(_0x35a1bf[_0x80fb('0x15')](0x1f4,_0x21463e[_0x80fb('0x16')]));});});};exports[_0x80fb('0x23')]=function(_0x5cd4fe){var _0xb9d866=this;return new Promise(function(_0x492772,_0x249261){return db[_0x80fb('0x1a')]['find']({'raw':_0x5cd4fe['options']?_0x5cd4fe[_0x80fb('0x1c')][_0x80fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cd4fe[_0x80fb('0x1c')]?_0x5cd4fe[_0x80fb('0x1c')][_0x80fb('0x24')]||null:null,'attributes':_0x5cd4fe[_0x80fb('0x1c')]?_0x5cd4fe[_0x80fb('0x1c')]['attributes']||null:null,'include':_0x5cd4fe[_0x80fb('0x1c')]?_0x5cd4fe[_0x80fb('0x1c')][_0x80fb('0x20')]?_[_0x80fb('0x21')](_0x5cd4fe['options'][_0x80fb('0x20')],function(_0x57ea7a){return{'model':db[_0x57ea7a[_0x80fb('0x22')]],'as':_0x57ea7a['as'],'attributes':_0x57ea7a[_0x80fb('0x1e')],'include':_0x57ea7a[_0x80fb('0x20')]?_['map'](_0x57ea7a[_0x80fb('0x20')],function(_0x299106){return{'model':db[_0x299106['model']],'as':_0x299106['as'],'attributes':_0x299106[_0x80fb('0x1e')],'include':_0x299106['include']?_[_0x80fb('0x21')](_0x299106[_0x80fb('0x20')],function(_0x4c44da){return{'model':db[_0x4c44da[_0x80fb('0x22')]],'as':_0x4c44da['as'],'attributes':_0x4c44da[_0x80fb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x80fb('0xf')](function(_0x3fec08){logger[_0x80fb('0x10')]('ShowOpenchannelQueue',_0x5cd4fe);logger[_0x80fb('0x25')](_0x80fb('0x23'),_0x5cd4fe,JSON['stringify'](_0x3fec08));_0x492772(_0x3fec08);})[_0x80fb('0x18')](function(_0x5c4269){logger['error']('ShowOpenchannelQueue',_0x5c4269[_0x80fb('0x16')],_0x5cd4fe);_0x249261(_0xb9d866[_0x80fb('0x15')](0x1f4,_0x5c4269[_0x80fb('0x16')]));});});}; \ No newline at end of file +var _0xf78a=['defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf78a,0xe0));var _0xaf78=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0xf78a[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0xaf78('0x0'));var util=require(_0xaf78('0x1'));var moment=require(_0xaf78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf78('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf78('0x4'));var logger=require(_0xaf78('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaf78('0x6'));var client=jayson[_0xaf78('0x7')][_0xaf78('0x8')]({'port':0x232a});config[_0xaf78('0x9')]=_[_0xaf78('0xa')](config['redis'],{'host':_0xaf78('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf78('0x9')]));require(_0xaf78('0xc'))[_0xaf78('0xd')](socket);function respondWithRpcPromise(_0x524706,_0x33f2ea,_0x55d0ca){return new BPromise(function(_0x22b14e,_0x48faf8){return client[_0xaf78('0xe')](_0x524706,_0x55d0ca)[_0xaf78('0xf')](function(_0x27ea23){logger[_0xaf78('0x10')](_0xaf78('0x11'),_0x33f2ea,'request\x20sent');logger[_0xaf78('0x12')](_0xaf78('0x13'),_0x33f2ea,_0xaf78('0x14'),JSON[_0xaf78('0x15')](_0x27ea23));if(_0x27ea23[_0xaf78('0x16')]){if(_0x27ea23[_0xaf78('0x16')][_0xaf78('0x17')]===0x1f4){logger['error'](_0xaf78('0x11'),_0x33f2ea,_0x27ea23['error'][_0xaf78('0x18')]);return _0x48faf8(_0x27ea23[_0xaf78('0x16')][_0xaf78('0x18')]);}logger[_0xaf78('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x33f2ea,_0x27ea23['error'][_0xaf78('0x18')]);return _0x22b14e(_0x27ea23['error']['message']);}else{logger[_0xaf78('0x10')](_0xaf78('0x11'),_0x33f2ea,_0xaf78('0x14'));_0x22b14e(_0x27ea23[_0xaf78('0x19')][_0xaf78('0x18')]);}})[_0xaf78('0x1a')](function(_0x2fb155){logger[_0xaf78('0x16')](_0xaf78('0x11'),_0x33f2ea,_0x2fb155);_0x48faf8(_0x2fb155);});});}exports[_0xaf78('0x1b')]=function(_0x2eae57){var _0x69c728=this;return new Promise(function(_0x1b2516,_0x5e5ce9){return db[_0xaf78('0x1c')]['findAll']({'raw':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x1e')]===undefined?!![]:![]:!![],'where':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x1f')]||null:null,'attributes':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x20')]||null:null,'limit':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57['options'][_0xaf78('0x21')]||null:null,'include':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x22')]?_[_0xaf78('0x23')](_0x2eae57['options'][_0xaf78('0x22')],function(_0x497bc7){return{'model':db[_0x497bc7[_0xaf78('0x24')]],'as':_0x497bc7['as'],'attributes':_0x497bc7[_0xaf78('0x20')],'include':_0x497bc7['include']?_[_0xaf78('0x23')](_0x497bc7[_0xaf78('0x22')],function(_0xfbff2c){return{'model':db[_0xfbff2c[_0xaf78('0x24')]],'as':_0xfbff2c['as'],'attributes':_0xfbff2c[_0xaf78('0x20')],'include':_0xfbff2c['include']?_[_0xaf78('0x23')](_0xfbff2c[_0xaf78('0x22')],function(_0x30dc7f){return{'model':db[_0x30dc7f[_0xaf78('0x24')]],'as':_0x30dc7f['as'],'attributes':_0x30dc7f[_0xaf78('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1affe1){logger[_0xaf78('0x10')](_0xaf78('0x1b'),_0x2eae57);logger[_0xaf78('0x12')](_0xaf78('0x1b'),_0x2eae57,JSON['stringify'](_0x1affe1));_0x1b2516(_0x1affe1);})[_0xaf78('0x1a')](function(_0x32e70c){logger['error'](_0xaf78('0x1b'),_0x32e70c['message'],_0x2eae57);_0x5e5ce9(_0x69c728['error'](0x1f4,_0x32e70c[_0xaf78('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x401bdc){var _0x4c9fcc=this;return new Promise(function(_0x401ab7,_0x4deb78){return db[_0xaf78('0x1c')][_0xaf78('0x25')]({'raw':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc['options'][_0xaf78('0x1e')]===undefined?!![]:![]:!![],'where':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc[_0xaf78('0x1d')]['where']||null:null,'attributes':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x20')]||null:null,'include':_0x401bdc['options']?_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x22')]?_[_0xaf78('0x23')](_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x22')],function(_0x12aca2){return{'model':db[_0x12aca2[_0xaf78('0x24')]],'as':_0x12aca2['as'],'attributes':_0x12aca2['attributes'],'include':_0x12aca2['include']?_['map'](_0x12aca2[_0xaf78('0x22')],function(_0xd13743){return{'model':db[_0xd13743['model']],'as':_0xd13743['as'],'attributes':_0xd13743['attributes'],'include':_0xd13743[_0xaf78('0x22')]?_[_0xaf78('0x23')](_0xd13743[_0xaf78('0x22')],function(_0x2a13be){return{'model':db[_0x2a13be[_0xaf78('0x24')]],'as':_0x2a13be['as'],'attributes':_0x2a13be[_0xaf78('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaf78('0xf')](function(_0x17fa31){logger[_0xaf78('0x10')](_0xaf78('0x26'),_0x401bdc);logger[_0xaf78('0x12')]('ShowOpenchannelQueue',_0x401bdc,JSON[_0xaf78('0x15')](_0x17fa31));_0x401ab7(_0x17fa31);})[_0xaf78('0x1a')](function(_0x3c0463){logger[_0xaf78('0x16')]('ShowOpenchannelQueue',_0x3c0463['message'],_0x401bdc);_0x4deb78(_0x4c9fcc[_0xaf78('0x16')](0x1f4,_0x3c0463[_0xaf78('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4020335..0e4865c 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 _0x205d=['openchannelQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x1a2006,_0x28593c){var _0x83d34f=function(_0x1eadf8){while(--_0x1eadf8){_0x1a2006['push'](_0x1a2006['shift']());}};_0x83d34f(++_0x28593c);}(_0x205d,0x1f1));var _0xd205=function(_0x1fbde3,_0x59da39){_0x1fbde3=_0x1fbde3-0x0;var _0x2b092f=_0x205d[_0x1fbde3];return _0x2b092f;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xd205('0x0'),_0xd205('0x1'),_0xd205('0x2')];function createListener(_0x5bfe5b,_0x39b080){return function(_0x38b674){_0x39b080[_0xd205('0x3')](_0x5bfe5b,_0x38b674);};}function removeListener(_0x305da1,_0x25e4dd){return function(){OpenchannelQueueEvents[_0xd205('0x4')](_0x305da1,_0x25e4dd);};}exports[_0xd205('0x5')]=function(_0x3c5535){for(var _0x1387d1=0x0,_0x37dd0e=events[_0xd205('0x6')];_0x1387d1<_0x37dd0e;_0x1387d1++){var _0x2e84ff=events[_0x1387d1];var _0x31f437=createListener(_0xd205('0x7')+_0x2e84ff,_0x3c5535);OpenchannelQueueEvents['on'](_0x2e84ff,_0x31f437);}}; \ No newline at end of file +var _0x7f83=['length','./openchannelQueue.events','update','removeListener','register'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x7f83,0xd3));var _0x37f8=function(_0x46692f,_0x5c9d8a){_0x46692f=_0x46692f-0x0;var _0x4abf0a=_0x7f83[_0x46692f];return _0x4abf0a;};'use strict';var OpenchannelQueueEvents=require(_0x37f8('0x0'));var events=['save','remove',_0x37f8('0x1')];function createListener(_0x2e0112,_0x3ff66c){return function(_0x415e6e){_0x3ff66c['emit'](_0x2e0112,_0x415e6e);};}function removeListener(_0x37f4d5,_0x5dabdf){return function(){OpenchannelQueueEvents[_0x37f8('0x2')](_0x37f4d5,_0x5dabdf);};}exports[_0x37f8('0x3')]=function(_0x105ac4){for(var _0x264242=0x0,_0x5133b1=events[_0x37f8('0x4')];_0x264242<_0x5133b1;_0x264242++){var _0x2dcb13=events[_0x264242];var _0x169122=createListener('openchannelQueue:'+_0x2dcb13,_0x105ac4);OpenchannelQueueEvents['on'](_0x2dcb13,_0x169122);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 098bea8..13dfa01 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 _0x7be9=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','put','update','delete'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x7be9,0x86));var _0x97be=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7be9[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x97be('0x0'));var util=require(_0x97be('0x1'));var path=require('path');var timeout=require(_0x97be('0x2'));var express=require(_0x97be('0x3'));var router=express[_0x97be('0x4')]();var fs_extra=require(_0x97be('0x5'));var auth=require(_0x97be('0x6'));var interaction=require(_0x97be('0x7'));var config=require(_0x97be('0x8'));var controller=require(_0x97be('0x9'));router[_0x97be('0xa')]('/',auth[_0x97be('0xb')](),controller['index']);router[_0x97be('0xa')](_0x97be('0xc'),auth[_0x97be('0xb')](),controller[_0x97be('0xd')]);router[_0x97be('0xa')](_0x97be('0xe'),auth[_0x97be('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x97be('0xf')](_0x97be('0xe'),auth['isAuthenticated'](),controller[_0x97be('0x10')]);router[_0x97be('0x11')](_0x97be('0xe'),auth[_0x97be('0xb')](),controller[_0x97be('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0f40=['update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','put','/:id'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x0f40,0x6f));var _0x00f4=function(_0x2c32fb,_0x45b9a8){_0x2c32fb=_0x2c32fb-0x0;var _0x1f2836=_0x0f40[_0x2c32fb];return _0x1f2836;};'use strict';var multer=require(_0x00f4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x00f4('0x1'));var router=express[_0x00f4('0x2')]();var fs_extra=require(_0x00f4('0x3'));var auth=require(_0x00f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x00f4('0x5'));var controller=require(_0x00f4('0x6'));router['get']('/',auth[_0x00f4('0x7')](),controller['index']);router[_0x00f4('0x8')](_0x00f4('0x9'),auth[_0x00f4('0x7')](),controller[_0x00f4('0xa')]);router['get']('/:id',auth[_0x00f4('0x7')](),controller[_0x00f4('0xb')]);router[_0x00f4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x00f4('0xd')](_0x00f4('0xe'),auth[_0x00f4('0x7')](),controller[_0x00f4('0xf')]);router['delete'](_0x00f4('0xe'),auth[_0x00f4('0x7')](),controller[_0x00f4('0x10')]);module[_0x00f4('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e36840f..e76e1e5 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 _0x7989=['sequelize','exports','STRING','DATE','moment'];(function(_0x249963,_0xe59db5){var _0x5c169c=function(_0x18cc5c){while(--_0x18cc5c){_0x249963['push'](_0x249963['shift']());}};_0x5c169c(++_0xe59db5);}(_0x7989,0x135));var _0x9798=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x7989[_0x7c0074];return _0x13e95b;};'use strict';var moment=require(_0x9798('0x0'));var Sequelize=require(_0x9798('0x1'));module[_0x9798('0x2')]={'uniqueid':{'type':Sequelize[_0x9798('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9798('0x3')]},'joinAt':{'type':Sequelize[_0x9798('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9798('0x4')]},'exitAt':{'type':Sequelize[_0x9798('0x4')]},'reason':{'type':Sequelize[_0x9798('0x3')]}}; \ No newline at end of file +var _0x2c40=['DATE','sequelize','exports','STRING'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x2c40,0xfd));var _0x02c4=function(_0x41c394,_0x32e672){_0x41c394=_0x41c394-0x0;var _0x521e71=_0x2c40[_0x41c394];return _0x521e71;};'use strict';var moment=require('moment');var Sequelize=require(_0x02c4('0x0'));module[_0x02c4('0x1')]={'uniqueid':{'type':Sequelize[_0x02c4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x02c4('0x2')]},'joinAt':{'type':Sequelize[_0x02c4('0x3')]},'leaveAt':{'type':Sequelize[_0x02c4('0x3')]},'acceptAt':{'type':Sequelize[_0x02c4('0x3')]},'exitAt':{'type':Sequelize[_0x02c4('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 67a1d79..612607f 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 _0xb6a5=['merge','options','then','count','includeAll','include','rows','catch','show','params','model','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','set','json','apply','save','update','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','type','key','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','VIRTUAL','filter'];(function(_0x4513fb,_0x400f2b){var _0x18a8c9=function(_0xce95ac){while(--_0xce95ac){_0x4513fb['push'](_0x4513fb['shift']());}};_0x18a8c9(++_0x400f2b);}(_0xb6a5,0xab));var _0x5b6a=function(_0x3ce1fd,_0x5add51){_0x3ce1fd=_0x3ce1fd-0x0;var _0x35c34b=_0xb6a5[_0x3ce1fd];return _0x35c34b;};'use strict';var emlformat=require(_0x5b6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b6a('0x1'));var jsonpatch=require(_0x5b6a('0x2'));var rp=require(_0x5b6a('0x3'));var moment=require(_0x5b6a('0x4'));var BPromise=require(_0x5b6a('0x5'));var Mustache=require(_0x5b6a('0x6'));var util=require(_0x5b6a('0x7'));var path=require(_0x5b6a('0x8'));var sox=require(_0x5b6a('0x9'));var csv=require(_0x5b6a('0xa'));var ejs=require(_0x5b6a('0xb'));var fs=require('fs');var fs_extra=require(_0x5b6a('0xc'));var _=require(_0x5b6a('0xd'));var squel=require(_0x5b6a('0xe'));var crypto=require(_0x5b6a('0xf'));var jsforce=require(_0x5b6a('0x10'));var deskjs=require(_0x5b6a('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b6a('0x12'));var Redis=require(_0x5b6a('0x13'));var authService=require(_0x5b6a('0x14'));var qs=require(_0x5b6a('0x15'));var as=require(_0x5b6a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b6a('0x17'))(_0x5b6a('0x18'));var utils=require(_0x5b6a('0x19'));var config=require(_0x5b6a('0x1a'));var licenseUtil=require(_0x5b6a('0x1b'));var db=require(_0x5b6a('0x1c'))['db'];function respondWithStatusCode(_0x1a943a,_0x5cf32f){_0x5cf32f=_0x5cf32f||0xcc;return function(_0x874a8b){if(_0x874a8b){return _0x1a943a['sendStatus'](_0x5cf32f);}return _0x1a943a[_0x5b6a('0x1d')](_0x5cf32f)[_0x5b6a('0x1e')]();};}function respondWithResult(_0x2089a6,_0x392448){_0x392448=_0x392448||0xc8;return function(_0x1de151){if(_0x1de151){return _0x2089a6[_0x5b6a('0x1d')](_0x392448)['json'](_0x1de151);}};}function respondWithFilteredResult(_0xf0aaa7,_0x1d5a59){return function(_0x1d21f0){if(_0x1d21f0){var _0x202d00=typeof _0x1d5a59[_0x5b6a('0x1f')]==='undefined'&&typeof _0x1d5a59[_0x5b6a('0x20')]===_0x5b6a('0x21');var _0x3fefa8=_0x1d21f0['count'];var _0x4aec60=_0x202d00?0x0:_0x1d5a59[_0x5b6a('0x1f')];var _0x2fbdc7=_0x202d00?_0x1d21f0['count']:_0x1d5a59['offset']+_0x1d5a59[_0x5b6a('0x20')];var _0x303e45;if(_0x2fbdc7>=_0x3fefa8){_0x2fbdc7=_0x3fefa8;_0x303e45=0xc8;}else{_0x303e45=0xce;}_0xf0aaa7[_0x5b6a('0x1d')](_0x303e45);return _0xf0aaa7[_0x5b6a('0x22')]('Content-Range',_0x4aec60+'-'+_0x2fbdc7+'/'+_0x3fefa8)[_0x5b6a('0x23')](_0x1d21f0);}return null;};}function patchUpdates(_0x4b41e2){return function(_0x5ead49){try{jsonpatch[_0x5b6a('0x24')](_0x5ead49,_0x4b41e2,!![]);}catch(_0xd70ecd){return BPromise['reject'](_0xd70ecd);}return _0x5ead49[_0x5b6a('0x25')]();};}function saveUpdates(_0x1a34ec,_0x3e3577){return function(_0x3fa524){if(_0x3fa524){return _0x3fa524[_0x5b6a('0x26')](_0x1a34ec)['then'](function(_0x5a5d19){return _0x5a5d19;});}return null;};}function removeEntity(_0x244913,_0x4c15c4){return function(_0x2e0942){if(_0x2e0942){return _0x2e0942[_0x5b6a('0x27')]()['then'](function(){_0x244913['status'](0xcc)[_0x5b6a('0x1e')]();});}};}function handleEntityNotFound(_0x10b728,_0x20094d){return function(_0x57b475){if(!_0x57b475){_0x10b728[_0x5b6a('0x28')](0x194);}return _0x57b475;};}function handleError(_0x315b87,_0x11de0b){_0x11de0b=_0x11de0b||0x1f4;return function(_0x3079a2){logger[_0x5b6a('0x29')](_0x3079a2[_0x5b6a('0x2a')]);if(_0x3079a2[_0x5b6a('0x2b')]){delete _0x3079a2['name'];}_0x315b87[_0x5b6a('0x1d')](_0x11de0b)[_0x5b6a('0x2c')](_0x3079a2);};}exports[_0x5b6a('0x2d')]=function(_0xae1a1,_0x4ade94){var _0x546f3a={},_0x47f5c7={},_0x3537f5={'count':0x0,'rows':[]};var _0x541496=_[_0x5b6a('0x2e')](db[_0x5b6a('0x2f')]['rawAttributes'],function(_0x459027){return{'name':_0x459027['fieldName'],'type':_0x459027[_0x5b6a('0x30')][_0x5b6a('0x31')]};});_0x47f5c7['model']=_[_0x5b6a('0x2e')](_0x541496,'name');_0x47f5c7[_0x5b6a('0x32')]=_[_0x5b6a('0x33')](_0xae1a1['query']);_0x47f5c7[_0x5b6a('0x34')]=_['intersection'](_0x47f5c7['model'],_0x47f5c7[_0x5b6a('0x32')]);_0x546f3a['attributes']=_[_0x5b6a('0x35')](_0x47f5c7['model'],qs[_0x5b6a('0x36')](_0xae1a1[_0x5b6a('0x32')][_0x5b6a('0x36')]));_0x546f3a[_0x5b6a('0x37')]=_0x546f3a[_0x5b6a('0x37')][_0x5b6a('0x38')]?_0x546f3a[_0x5b6a('0x37')]:_0x47f5c7['model'];if(!_0xae1a1[_0x5b6a('0x32')]['hasOwnProperty']('nolimit')){_0x546f3a[_0x5b6a('0x20')]=qs[_0x5b6a('0x20')](_0xae1a1[_0x5b6a('0x32')][_0x5b6a('0x20')]);_0x546f3a[_0x5b6a('0x1f')]=qs['offset'](_0xae1a1[_0x5b6a('0x32')][_0x5b6a('0x1f')]);}_0x546f3a[_0x5b6a('0x39')]=qs['sort'](_0xae1a1[_0x5b6a('0x32')][_0x5b6a('0x3a')]);_0x546f3a[_0x5b6a('0x3b')]=qs[_0x5b6a('0x34')](_[_0x5b6a('0x3c')](_0xae1a1['query'],_0x47f5c7[_0x5b6a('0x34')]),_0x541496);if(_0xae1a1['query']['filter']){_0x546f3a[_0x5b6a('0x3b')]=_['merge'](_0x546f3a[_0x5b6a('0x3b')],{'$or':_['map'](_0x541496,function(_0x2102a){if(_0x2102a[_0x5b6a('0x30')]!==_0x5b6a('0x3d')){var _0x3a4940={};_0x3a4940[_0x2102a[_0x5b6a('0x2b')]]={'$like':'%'+_0xae1a1[_0x5b6a('0x32')][_0x5b6a('0x3e')]+'%'};return _0x3a4940;}})});}_0x546f3a=_[_0x5b6a('0x3f')]({},_0x546f3a,_0xae1a1[_0x5b6a('0x40')]);var _0x253f3a={'where':_0x546f3a['where']};return db[_0x5b6a('0x2f')]['count'](_0x253f3a)[_0x5b6a('0x41')](function(_0xa503ec){_0x3537f5[_0x5b6a('0x42')]=_0xa503ec;if(_0xae1a1['query'][_0x5b6a('0x43')]){_0x546f3a[_0x5b6a('0x44')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x546f3a);})[_0x5b6a('0x41')](function(_0x1a4b55){_0x3537f5[_0x5b6a('0x45')]=_0x1a4b55;return _0x3537f5;})[_0x5b6a('0x41')](respondWithFilteredResult(_0x4ade94,_0x546f3a))[_0x5b6a('0x46')](handleError(_0x4ade94,null));};exports[_0x5b6a('0x47')]=function(_0x508cc6,_0x22d2e0){var _0x5ec2e5={'raw':!![],'where':{'id':_0x508cc6[_0x5b6a('0x48')]['id']}},_0x317153={};_0x317153[_0x5b6a('0x49')]=_[_0x5b6a('0x33')](db['OpenchannelQueueReport']['rawAttributes']);_0x317153[_0x5b6a('0x32')]=_[_0x5b6a('0x33')](_0x508cc6[_0x5b6a('0x32')]);_0x317153['filters']=_[_0x5b6a('0x35')](_0x317153[_0x5b6a('0x49')],_0x317153['query']);_0x5ec2e5['attributes']=_[_0x5b6a('0x35')](_0x317153[_0x5b6a('0x49')],qs['fields'](_0x508cc6[_0x5b6a('0x32')][_0x5b6a('0x36')]));_0x5ec2e5['attributes']=_0x5ec2e5['attributes'][_0x5b6a('0x38')]?_0x5ec2e5[_0x5b6a('0x37')]:_0x317153[_0x5b6a('0x49')];if(_0x508cc6['query'][_0x5b6a('0x43')]){_0x5ec2e5[_0x5b6a('0x44')]=[{'all':!![]}];}_0x5ec2e5=_[_0x5b6a('0x3f')]({},_0x5ec2e5,_0x508cc6['options']);return db[_0x5b6a('0x2f')][_0x5b6a('0x4a')](_0x5ec2e5)['then'](handleEntityNotFound(_0x22d2e0,null))[_0x5b6a('0x41')](respondWithResult(_0x22d2e0,null))[_0x5b6a('0x46')](handleError(_0x22d2e0,null));};exports[_0x5b6a('0x4b')]=function(_0x4cd391,_0x2fa781){return db[_0x5b6a('0x2f')][_0x5b6a('0x4b')](_0x4cd391[_0x5b6a('0x4c')],{})[_0x5b6a('0x41')](respondWithResult(_0x2fa781,0xc9))[_0x5b6a('0x46')](handleError(_0x2fa781,null));};exports[_0x5b6a('0x26')]=function(_0xe59402,_0x59fc3f){if(_0xe59402[_0x5b6a('0x4c')]['id']){delete _0xe59402[_0x5b6a('0x4c')]['id'];}return db[_0x5b6a('0x2f')][_0x5b6a('0x4a')]({'where':{'id':_0xe59402['params']['id']}})[_0x5b6a('0x41')](handleEntityNotFound(_0x59fc3f,null))[_0x5b6a('0x41')](saveUpdates(_0xe59402[_0x5b6a('0x4c')],null))[_0x5b6a('0x41')](respondWithResult(_0x59fc3f,null))[_0x5b6a('0x46')](handleError(_0x59fc3f,null));};exports[_0x5b6a('0x27')]=function(_0x27ebe1,_0x49566e){return db[_0x5b6a('0x2f')][_0x5b6a('0x4a')]({'where':{'id':_0x27ebe1[_0x5b6a('0x48')]['id']}})[_0x5b6a('0x41')](handleEntityNotFound(_0x49566e,null))['then'](removeEntity(_0x49566e,null))['catch'](handleError(_0x49566e,null));};exports[_0x5b6a('0x4d')]=function(_0x258274,_0x34f3de){return db[_0x5b6a('0x2f')][_0x5b6a('0x4d')]()[_0x5b6a('0x41')](respondWithResult(_0x34f3de,null))[_0x5b6a('0x46')](handleError(_0x34f3de,null));}; \ No newline at end of file +var _0x646c=['count','Content-Range','json','reject','update','then','destroy','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','params','describe','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x646c,0x16d));var _0xc646=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x646c[_0x223461];return _0x4dbe0a;};'use strict';var emlformat=require(_0xc646('0x0'));var rimraf=require(_0xc646('0x1'));var zipdir=require(_0xc646('0x2'));var jsonpatch=require(_0xc646('0x3'));var rp=require(_0xc646('0x4'));var moment=require(_0xc646('0x5'));var BPromise=require(_0xc646('0x6'));var Mustache=require(_0xc646('0x7'));var util=require(_0xc646('0x8'));var path=require(_0xc646('0x9'));var sox=require(_0xc646('0xa'));var csv=require(_0xc646('0xb'));var ejs=require(_0xc646('0xc'));var fs=require('fs');var fs_extra=require(_0xc646('0xd'));var _=require(_0xc646('0xe'));var squel=require(_0xc646('0xf'));var crypto=require(_0xc646('0x10'));var jsforce=require(_0xc646('0x11'));var deskjs=require(_0xc646('0x12'));var toCsv=require(_0xc646('0xb'));var querystring=require(_0xc646('0x13'));var Papa=require(_0xc646('0x14'));var Redis=require('ioredis');var authService=require(_0xc646('0x15'));var qs=require(_0xc646('0x16'));var as=require(_0xc646('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc646('0x18'))(_0xc646('0x19'));var utils=require(_0xc646('0x1a'));var config=require(_0xc646('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc646('0x1c'))['db'];function respondWithStatusCode(_0x4d30de,_0x13a9fd){_0x13a9fd=_0x13a9fd||0xcc;return function(_0x4b8416){if(_0x4b8416){return _0x4d30de[_0xc646('0x1d')](_0x13a9fd);}return _0x4d30de[_0xc646('0x1e')](_0x13a9fd)[_0xc646('0x1f')]();};}function respondWithResult(_0x3d69bd,_0x20bec1){_0x20bec1=_0x20bec1||0xc8;return function(_0x5d8f0d){if(_0x5d8f0d){return _0x3d69bd[_0xc646('0x1e')](_0x20bec1)['json'](_0x5d8f0d);}};}function respondWithFilteredResult(_0x1c2db5,_0x359791){return function(_0x34247e){if(_0x34247e){var _0x28a762=typeof _0x359791[_0xc646('0x20')]===_0xc646('0x21')&&typeof _0x359791[_0xc646('0x22')]===_0xc646('0x21');var _0x2cc4d9=_0x34247e['count'];var _0x455fe3=_0x28a762?0x0:_0x359791[_0xc646('0x20')];var _0x5296b5=_0x28a762?_0x34247e[_0xc646('0x23')]:_0x359791['offset']+_0x359791[_0xc646('0x22')];var _0x5bc5f4;if(_0x5296b5>=_0x2cc4d9){_0x5296b5=_0x2cc4d9;_0x5bc5f4=0xc8;}else{_0x5bc5f4=0xce;}_0x1c2db5['status'](_0x5bc5f4);return _0x1c2db5['set'](_0xc646('0x24'),_0x455fe3+'-'+_0x5296b5+'/'+_0x2cc4d9)[_0xc646('0x25')](_0x34247e);}return null;};}function patchUpdates(_0x1dd4bb){return function(_0x957eca){try{jsonpatch['apply'](_0x957eca,_0x1dd4bb,!![]);}catch(_0x3b9393){return BPromise[_0xc646('0x26')](_0x3b9393);}return _0x957eca['save']();};}function saveUpdates(_0x259444,_0x4602d1){return function(_0x5ba3f3){if(_0x5ba3f3){return _0x5ba3f3[_0xc646('0x27')](_0x259444)[_0xc646('0x28')](function(_0x5c1ebb){return _0x5c1ebb;});}return null;};}function removeEntity(_0x45f708,_0x489432){return function(_0x18ea75){if(_0x18ea75){return _0x18ea75[_0xc646('0x29')]()['then'](function(){_0x45f708['status'](0xcc)[_0xc646('0x1f')]();});}};}function handleEntityNotFound(_0x5b9f7f,_0x394e13){return function(_0x4f5a75){if(!_0x4f5a75){_0x5b9f7f[_0xc646('0x1d')](0x194);}return _0x4f5a75;};}function handleError(_0x368f6e,_0xe55016){_0xe55016=_0xe55016||0x1f4;return function(_0xe2be32){logger[_0xc646('0x2a')](_0xe2be32[_0xc646('0x2b')]);if(_0xe2be32[_0xc646('0x2c')]){delete _0xe2be32[_0xc646('0x2c')];}_0x368f6e[_0xc646('0x1e')](_0xe55016)['send'](_0xe2be32);};}exports['index']=function(_0x17c300,_0x3edd6f){var _0x42c95e={},_0xe93d3={},_0x45edf7={'count':0x0,'rows':[]};var _0x420a36=_[_0xc646('0x2d')](db[_0xc646('0x2e')][_0xc646('0x2f')],function(_0x4bf298){return{'name':_0x4bf298[_0xc646('0x30')],'type':_0x4bf298[_0xc646('0x31')][_0xc646('0x32')]};});_0xe93d3[_0xc646('0x33')]=_[_0xc646('0x2d')](_0x420a36,_0xc646('0x2c'));_0xe93d3[_0xc646('0x34')]=_[_0xc646('0x35')](_0x17c300[_0xc646('0x34')]);_0xe93d3[_0xc646('0x36')]=_['intersection'](_0xe93d3['model'],_0xe93d3['query']);_0x42c95e[_0xc646('0x37')]=_[_0xc646('0x38')](_0xe93d3[_0xc646('0x33')],qs['fields'](_0x17c300[_0xc646('0x34')]['fields']));_0x42c95e['attributes']=_0x42c95e[_0xc646('0x37')][_0xc646('0x39')]?_0x42c95e[_0xc646('0x37')]:_0xe93d3['model'];if(!_0x17c300[_0xc646('0x34')][_0xc646('0x3a')](_0xc646('0x3b'))){_0x42c95e[_0xc646('0x22')]=qs[_0xc646('0x22')](_0x17c300[_0xc646('0x34')]['limit']);_0x42c95e[_0xc646('0x20')]=qs[_0xc646('0x20')](_0x17c300[_0xc646('0x34')]['offset']);}_0x42c95e[_0xc646('0x3c')]=qs['sort'](_0x17c300[_0xc646('0x34')][_0xc646('0x3d')]);_0x42c95e[_0xc646('0x3e')]=qs['filters'](_[_0xc646('0x3f')](_0x17c300['query'],_0xe93d3[_0xc646('0x36')]),_0x420a36);if(_0x17c300[_0xc646('0x34')][_0xc646('0x40')]){_0x42c95e[_0xc646('0x3e')]=_[_0xc646('0x41')](_0x42c95e['where'],{'$or':_['map'](_0x420a36,function(_0x1f75aa){if(_0x1f75aa[_0xc646('0x31')]!==_0xc646('0x42')){var _0x527bbc={};_0x527bbc[_0x1f75aa[_0xc646('0x2c')]]={'$like':'%'+_0x17c300[_0xc646('0x34')][_0xc646('0x40')]+'%'};return _0x527bbc;}})});}_0x42c95e=_[_0xc646('0x41')]({},_0x42c95e,_0x17c300['options']);var _0x2fe433={'where':_0x42c95e[_0xc646('0x3e')]};return db['OpenchannelQueueReport'][_0xc646('0x23')](_0x2fe433)[_0xc646('0x28')](function(_0x157bec){_0x45edf7[_0xc646('0x23')]=_0x157bec;if(_0x17c300[_0xc646('0x34')][_0xc646('0x43')]){_0x42c95e[_0xc646('0x44')]=[{'all':!![]}];}return db[_0xc646('0x2e')][_0xc646('0x45')](_0x42c95e);})[_0xc646('0x28')](function(_0x34de38){_0x45edf7[_0xc646('0x46')]=_0x34de38;return _0x45edf7;})[_0xc646('0x28')](respondWithFilteredResult(_0x3edd6f,_0x42c95e))[_0xc646('0x47')](handleError(_0x3edd6f,null));};exports[_0xc646('0x48')]=function(_0x78db09,_0x3544f1){var _0xc1d1e1={'raw':!![],'where':{'id':_0x78db09['params']['id']}},_0x1f03ea={};_0x1f03ea[_0xc646('0x33')]=_[_0xc646('0x35')](db[_0xc646('0x2e')]['rawAttributes']);_0x1f03ea[_0xc646('0x34')]=_[_0xc646('0x35')](_0x78db09[_0xc646('0x34')]);_0x1f03ea['filters']=_[_0xc646('0x38')](_0x1f03ea['model'],_0x1f03ea[_0xc646('0x34')]);_0xc1d1e1[_0xc646('0x37')]=_[_0xc646('0x38')](_0x1f03ea['model'],qs[_0xc646('0x49')](_0x78db09[_0xc646('0x34')][_0xc646('0x49')]));_0xc1d1e1['attributes']=_0xc1d1e1[_0xc646('0x37')][_0xc646('0x39')]?_0xc1d1e1[_0xc646('0x37')]:_0x1f03ea[_0xc646('0x33')];if(_0x78db09['query'][_0xc646('0x43')]){_0xc1d1e1[_0xc646('0x44')]=[{'all':!![]}];}_0xc1d1e1=_[_0xc646('0x41')]({},_0xc1d1e1,_0x78db09[_0xc646('0x4a')]);return db[_0xc646('0x2e')][_0xc646('0x4b')](_0xc1d1e1)['then'](handleEntityNotFound(_0x3544f1,null))[_0xc646('0x28')](respondWithResult(_0x3544f1,null))[_0xc646('0x47')](handleError(_0x3544f1,null));};exports[_0xc646('0x4c')]=function(_0x4507f9,_0x485641){return db[_0xc646('0x2e')][_0xc646('0x4c')](_0x4507f9['body'],{})[_0xc646('0x28')](respondWithResult(_0x485641,0xc9))[_0xc646('0x47')](handleError(_0x485641,null));};exports['update']=function(_0x3fe20f,_0x4adb57){if(_0x3fe20f[_0xc646('0x4d')]['id']){delete _0x3fe20f[_0xc646('0x4d')]['id'];}return db['OpenchannelQueueReport'][_0xc646('0x4b')]({'where':{'id':_0x3fe20f[_0xc646('0x4e')]['id']}})[_0xc646('0x28')](handleEntityNotFound(_0x4adb57,null))['then'](saveUpdates(_0x3fe20f['body'],null))[_0xc646('0x28')](respondWithResult(_0x4adb57,null))[_0xc646('0x47')](handleError(_0x4adb57,null));};exports[_0xc646('0x29')]=function(_0x31ad32,_0x59eaa0){return db['OpenchannelQueueReport'][_0xc646('0x4b')]({'where':{'id':_0x31ad32['params']['id']}})[_0xc646('0x28')](handleEntityNotFound(_0x59eaa0,null))['then'](removeEntity(_0x59eaa0,null))['catch'](handleError(_0x59eaa0,null));};exports[_0xc646('0x4f')]=function(_0x4ff523,_0x492770){return db[_0xc646('0x2e')][_0xc646('0x4f')]()['then'](respondWithResult(_0x492770,null))[_0xc646('0x47')](handleError(_0x492770,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f5ee047..40fd78d 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x31672c,_0x3b2b79){var _0x459dc4=function(_0x1c44e0){while(--_0x1c44e0){_0x31672c['push'](_0x31672c['shift']());}};_0x459dc4(++_0x3b2b79);}(_0x1261,0x144));var _0x1126=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x1261[_0x46428c];return _0x16a677;};'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')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x34503b,_0x54b357){var _0x54ab9a=function(_0x27f1ed){while(--_0x27f1ed){_0x34503b['push'](_0x34503b['shift']());}};_0x54ab9a(++_0x54b357);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x5fc3[_0x43f881];return _0x365c14;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index fefa2c5..439a9a2 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 _0x7d25=['create','body','options','raw','then','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x3aac8d,_0x34d74c){var _0x1add83=function(_0xb9bfb3){while(--_0xb9bfb3){_0x3aac8d['push'](_0x3aac8d['shift']());}};_0x1add83(++_0x34d74c);}(_0x7d25,0x8a));var _0x57d2=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x7d25[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')](_0x7d4cf1[_0x57d2('0x17')],{'raw':_0x7d4cf1[_0x57d2('0x18')]?_0x7d4cf1['options'][_0x57d2('0x19')]===undefined?!![]:![]:!![]})[_0x57d2('0x1a')](function(_0x55191e){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x55191e));_0x4a94e3(_0x55191e);})[_0x57d2('0x13')](function(_0x803c25){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x803c25[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x803c25[_0x57d2('0x11')]));});});};exports[_0x57d2('0x1b')]=function(_0x12ff19){var _0x473df2=this;return new Promise(function(_0x5327ea,_0x424ddc){return db[_0x57d2('0x15')][_0x57d2('0x1c')](_0x12ff19[_0x57d2('0x17')],{'raw':_0x12ff19[_0x57d2('0x18')]?_0x12ff19['options'][_0x57d2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ff19[_0x57d2('0x18')]?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1d')]||null:null,'attributes':_0x12ff19[_0x57d2('0x18')]?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1e')]||null:null,'limit':_0x12ff19['options']?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1f')]||null:null})[_0x57d2('0x1a')](function(_0x1fe383){logger[_0x57d2('0x9')](_0x57d2('0x1b'),_0x12ff19);logger[_0x57d2('0xb')](_0x57d2('0x1b'),_0x12ff19,JSON[_0x57d2('0xe')](_0x1fe383));_0x5327ea(_0x1fe383);})[_0x57d2('0x13')](function(_0x574589){logger[_0x57d2('0xf')](_0x57d2('0x1b'),_0x574589[_0x57d2('0x11')],_0x12ff19);_0x424ddc(_0x473df2[_0x57d2('0xf')](0x1f4,_0x574589['message']));});});}; \ No newline at end of file +var _0x3423=['http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','catch','UpdateOpenchannelQueueReport','body','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateOpenchannelQueueReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});};exports[_0x3342('0x1c')]=function(_0x26eb87){var _0x2d8622=this;return new Promise(function(_0x5d4f14,_0x30ffc9){return db['OpenchannelQueueReport']['update'](_0x26eb87[_0x3342('0x1d')],{'raw':_0x26eb87['options']?_0x26eb87['options'][_0x3342('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26eb87['options']?_0x26eb87[_0x3342('0x18')]['where']||null:null,'attributes':_0x26eb87['options']?_0x26eb87['options'][_0x3342('0x1e')]||null:null,'limit':_0x26eb87[_0x3342('0x18')]?_0x26eb87[_0x3342('0x18')]['limit']||null:null})[_0x3342('0xd')](function(_0x1275e2){logger[_0x3342('0x13')](_0x3342('0x1c'),_0x26eb87);logger['debug'](_0x3342('0x1c'),_0x26eb87,JSON[_0x3342('0xf')](_0x1275e2));_0x5d4f14(_0x1275e2);})[_0x3342('0x1b')](function(_0x301114){logger[_0x3342('0x10')](_0x3342('0x1c'),_0x301114[_0x3342('0x12')],_0x26eb87);_0x30ffc9(_0x2d8622['error'](0x1f4,_0x301114[_0x3342('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index c8c1154..e76efbd 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 _0x832a=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x832a,0x1a4));var _0xa832=function(_0x4252bf,_0xc977d7){_0x4252bf=_0x4252bf-0x0;var _0x32a218=_0x832a[_0x4252bf];return _0x32a218;};'use strict';var multer=require(_0xa832('0x0'));var util=require(_0xa832('0x1'));var path=require('path');var timeout=require(_0xa832('0x2'));var express=require(_0xa832('0x3'));var router=express['Router']();var fs_extra=require(_0xa832('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa832('0x5'));var config=require(_0xa832('0x6'));var controller=require(_0xa832('0x7'));router[_0xa832('0x8')]('/',auth[_0xa832('0x9')](),controller[_0xa832('0xa')]);router[_0xa832('0x8')](_0xa832('0xb'),auth[_0xa832('0x9')](),controller[_0xa832('0xc')]);router[_0xa832('0x8')]('/:id',auth[_0xa832('0x9')](),controller[_0xa832('0xd')]);router[_0xa832('0xe')]('/',auth[_0xa832('0x9')](),controller[_0xa832('0xf')]);router[_0xa832('0x10')](_0xa832('0x11'),auth[_0xa832('0x9')](),controller[_0xa832('0x12')]);router[_0xa832('0x13')](_0xa832('0x11'),auth[_0xa832('0x9')](),controller['destroy']);module[_0xa832('0x14')]=router; \ No newline at end of file +var _0x44b2=['delete','/:id','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x44b2,0x121));var _0x244b=function(_0xcf2b8e,_0xcb1818){_0xcf2b8e=_0xcf2b8e-0x0;var _0x1e6133=_0x44b2[_0xcf2b8e];return _0x1e6133;};'use strict';var multer=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var path=require(_0x244b('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(_0x244b('0x3'));var config=require(_0x244b('0x4'));var controller=require(_0x244b('0x5'));router[_0x244b('0x6')]('/',auth[_0x244b('0x7')](),controller[_0x244b('0x8')]);router[_0x244b('0x6')](_0x244b('0x9'),auth[_0x244b('0x7')](),controller[_0x244b('0xa')]);router[_0x244b('0x6')]('/:id',auth[_0x244b('0x7')](),controller[_0x244b('0xb')]);router[_0x244b('0xc')]('/',auth[_0x244b('0x7')](),controller[_0x244b('0xd')]);router[_0x244b('0xe')]('/:id',auth[_0x244b('0x7')](),controller['update']);router[_0x244b('0xf')](_0x244b('0x10'),auth['isAuthenticated'](),controller[_0x244b('0x11')]);module[_0x244b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6930192..fe8e1e7 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1e8db4,_0x12b067){var _0x3e1495=function(_0x3b9e39){while(--_0x3b9e39){_0x1e8db4['push'](_0x1e8db4['shift']());}};_0x3e1495(++_0x12b067);}(_0x008c,0x188));var _0xc008=function(_0x1fc85c,_0x4b72b8){_0x1fc85c=_0x1fc85c-0x0;var _0x952c1e=_0x008c[_0x1fc85c];return _0x952c1e;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 20f1bab..6e2fde4 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 _0x0b36=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xe01639,_0x2eea58){var _0x5f8321=function(_0x48a30d){while(--_0x48a30d){_0xe01639['push'](_0xe01639['shift']());}};_0x5f8321(++_0x2eea58);}(_0x0b36,0x80));var _0x60b3=function(_0x2ef7b0,_0x3c1a32){_0x2ef7b0=_0x2ef7b0-0x0;var _0x41739b=_0x0b36[_0x2ef7b0];return _0x41739b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60b3('0x0'));var zipdir=require(_0x60b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60b3('0x2'));var moment=require(_0x60b3('0x3'));var BPromise=require(_0x60b3('0x4'));var Mustache=require(_0x60b3('0x5'));var util=require(_0x60b3('0x6'));var path=require(_0x60b3('0x7'));var sox=require(_0x60b3('0x8'));var csv=require(_0x60b3('0x9'));var ejs=require(_0x60b3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60b3('0xb'));var squel=require(_0x60b3('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60b3('0xd'));var toCsv=require(_0x60b3('0x9'));var querystring=require(_0x60b3('0xe'));var Papa=require(_0x60b3('0xf'));var Redis=require(_0x60b3('0x10'));var authService=require(_0x60b3('0x11'));var qs=require(_0x60b3('0x12'));var as=require(_0x60b3('0x13'));var hardwareService=require(_0x60b3('0x14'));var logger=require(_0x60b3('0x15'))(_0x60b3('0x16'));var utils=require(_0x60b3('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9ffd,_0x212ed1){_0x212ed1=_0x212ed1||0xcc;return function(_0x89ebe4){if(_0x89ebe4){return _0x5e9ffd[_0x60b3('0x18')](_0x212ed1);}return _0x5e9ffd[_0x60b3('0x19')](_0x212ed1)['end']();};}function respondWithResult(_0x2a1e37,_0xcbd7ed){_0xcbd7ed=_0xcbd7ed||0xc8;return function(_0x5b40b5){if(_0x5b40b5){return _0x2a1e37[_0x60b3('0x19')](_0xcbd7ed)[_0x60b3('0x1a')](_0x5b40b5);}};}function respondWithFilteredResult(_0x757170,_0x511e5d){return function(_0x5661e5){if(_0x5661e5){var _0x5eb339=typeof _0x511e5d[_0x60b3('0x1b')]==='undefined'&&typeof _0x511e5d['limit']===_0x60b3('0x1c');var _0x5ac95c=_0x5661e5['count'];var _0x248840=_0x5eb339?0x0:_0x511e5d[_0x60b3('0x1b')];var _0x746b04=_0x5eb339?_0x5661e5[_0x60b3('0x1d')]:_0x511e5d['offset']+_0x511e5d['limit'];var _0x7433a0;if(_0x746b04>=_0x5ac95c){_0x746b04=_0x5ac95c;_0x7433a0=0xc8;}else{_0x7433a0=0xce;}_0x757170[_0x60b3('0x19')](_0x7433a0);return _0x757170[_0x60b3('0x1e')](_0x60b3('0x1f'),_0x248840+'-'+_0x746b04+'/'+_0x5ac95c)[_0x60b3('0x1a')](_0x5661e5);}return null;};}function patchUpdates(_0x10a05c){return function(_0x4afcaf){try{jsonpatch['apply'](_0x4afcaf,_0x10a05c,!![]);}catch(_0x4647b2){return BPromise[_0x60b3('0x20')](_0x4647b2);}return _0x4afcaf['save']();};}function saveUpdates(_0x50b698,_0x4a0e45){return function(_0x144598){if(_0x144598){return _0x144598[_0x60b3('0x21')](_0x50b698)[_0x60b3('0x22')](function(_0x58d0c6){return _0x58d0c6;});}return null;};}function removeEntity(_0x17a77c,_0x161f21){return function(_0x16bb21){if(_0x16bb21){return _0x16bb21[_0x60b3('0x23')]()[_0x60b3('0x22')](function(){_0x17a77c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe6bcfe,_0x11231f){return function(_0x1ea062){if(!_0x1ea062){_0xe6bcfe[_0x60b3('0x18')](0x194);}return _0x1ea062;};}function handleError(_0x57b186,_0x279d44){_0x279d44=_0x279d44||0x1f4;return function(_0x130367){logger[_0x60b3('0x24')](_0x130367[_0x60b3('0x25')]);if(_0x130367['name']){delete _0x130367['name'];}_0x57b186['status'](_0x279d44)['send'](_0x130367);};}exports[_0x60b3('0x26')]=function(_0x586830,_0x2ac9b5){var _0x3d6428={},_0x1ca519={},_0x3ab862={'count':0x0,'rows':[]};var _0x3f25e7=_[_0x60b3('0x27')](db[_0x60b3('0x28')][_0x60b3('0x29')],function(_0x199e81){return{'name':_0x199e81[_0x60b3('0x2a')],'type':_0x199e81['type'][_0x60b3('0x2b')]};});_0x1ca519['model']=_[_0x60b3('0x27')](_0x3f25e7,'name');_0x1ca519[_0x60b3('0x2c')]=_[_0x60b3('0x2d')](_0x586830[_0x60b3('0x2c')]);_0x1ca519[_0x60b3('0x2e')]=_[_0x60b3('0x2f')](_0x1ca519[_0x60b3('0x30')],_0x1ca519['query']);_0x3d6428[_0x60b3('0x31')]=_['intersection'](_0x1ca519[_0x60b3('0x30')],qs[_0x60b3('0x32')](_0x586830[_0x60b3('0x2c')][_0x60b3('0x32')]));_0x3d6428[_0x60b3('0x31')]=_0x3d6428[_0x60b3('0x31')][_0x60b3('0x33')]?_0x3d6428[_0x60b3('0x31')]:_0x1ca519[_0x60b3('0x30')];if(!_0x586830[_0x60b3('0x2c')][_0x60b3('0x34')](_0x60b3('0x35'))){_0x3d6428[_0x60b3('0x36')]=qs[_0x60b3('0x36')](_0x586830[_0x60b3('0x2c')][_0x60b3('0x36')]);_0x3d6428[_0x60b3('0x1b')]=qs[_0x60b3('0x1b')](_0x586830[_0x60b3('0x2c')][_0x60b3('0x1b')]);}_0x3d6428[_0x60b3('0x37')]=qs[_0x60b3('0x38')](_0x586830[_0x60b3('0x2c')]['sort']);_0x3d6428['where']=qs[_0x60b3('0x2e')](_[_0x60b3('0x39')](_0x586830['query'],_0x1ca519[_0x60b3('0x2e')]),_0x3f25e7);if(_0x586830[_0x60b3('0x2c')][_0x60b3('0x3a')]){_0x3d6428[_0x60b3('0x3b')]=_[_0x60b3('0x3c')](_0x3d6428[_0x60b3('0x3b')],{'$or':_[_0x60b3('0x27')](_0x3f25e7,function(_0x1505ff){if(_0x1505ff['type']!=='VIRTUAL'){var _0x479f1c={};_0x479f1c[_0x1505ff['name']]={'$like':'%'+_0x586830[_0x60b3('0x2c')]['filter']+'%'};return _0x479f1c;}})});}_0x3d6428=_[_0x60b3('0x3c')]({},_0x3d6428,_0x586830[_0x60b3('0x3d')]);var _0x5a7749={'where':_0x3d6428[_0x60b3('0x3b')]};return db[_0x60b3('0x28')][_0x60b3('0x1d')](_0x5a7749)[_0x60b3('0x22')](function(_0x5012f6){_0x3ab862[_0x60b3('0x1d')]=_0x5012f6;if(_0x586830[_0x60b3('0x2c')][_0x60b3('0x3e')]){_0x3d6428[_0x60b3('0x3f')]=[{'all':!![]}];}return db[_0x60b3('0x28')][_0x60b3('0x40')](_0x3d6428);})['then'](function(_0x18c206){_0x3ab862[_0x60b3('0x41')]=_0x18c206;return _0x3ab862;})[_0x60b3('0x22')](respondWithFilteredResult(_0x2ac9b5,_0x3d6428))[_0x60b3('0x42')](handleError(_0x2ac9b5,null));};exports[_0x60b3('0x43')]=function(_0x191da2,_0x3b80ad){var _0x5a65da={'raw':!![],'where':{'id':_0x191da2[_0x60b3('0x44')]['id']}},_0x51954c={};_0x51954c['model']=_[_0x60b3('0x2d')](db[_0x60b3('0x28')][_0x60b3('0x29')]);_0x51954c[_0x60b3('0x2c')]=_[_0x60b3('0x2d')](_0x191da2[_0x60b3('0x2c')]);_0x51954c[_0x60b3('0x2e')]=_[_0x60b3('0x2f')](_0x51954c[_0x60b3('0x30')],_0x51954c[_0x60b3('0x2c')]);_0x5a65da[_0x60b3('0x31')]=_[_0x60b3('0x2f')](_0x51954c['model'],qs[_0x60b3('0x32')](_0x191da2['query'][_0x60b3('0x32')]));_0x5a65da[_0x60b3('0x31')]=_0x5a65da[_0x60b3('0x31')][_0x60b3('0x33')]?_0x5a65da[_0x60b3('0x31')]:_0x51954c['model'];if(_0x191da2[_0x60b3('0x2c')][_0x60b3('0x3e')]){_0x5a65da[_0x60b3('0x3f')]=[{'all':!![]}];}_0x5a65da=_[_0x60b3('0x3c')]({},_0x5a65da,_0x191da2[_0x60b3('0x3d')]);return db[_0x60b3('0x28')][_0x60b3('0x45')](_0x5a65da)['then'](handleEntityNotFound(_0x3b80ad,null))[_0x60b3('0x22')](respondWithResult(_0x3b80ad,null))[_0x60b3('0x42')](handleError(_0x3b80ad,null));};exports[_0x60b3('0x46')]=function(_0x4c0a51,_0x2b3854){return db[_0x60b3('0x28')][_0x60b3('0x46')](_0x4c0a51[_0x60b3('0x47')],{})[_0x60b3('0x22')](respondWithResult(_0x2b3854,0xc9))[_0x60b3('0x42')](handleError(_0x2b3854,null));};exports[_0x60b3('0x21')]=function(_0x34b155,_0x410b4f){if(_0x34b155[_0x60b3('0x47')]['id']){delete _0x34b155['body']['id'];}return db[_0x60b3('0x28')]['find']({'where':{'id':_0x34b155['params']['id']}})[_0x60b3('0x22')](handleEntityNotFound(_0x410b4f,null))[_0x60b3('0x22')](saveUpdates(_0x34b155[_0x60b3('0x47')],null))[_0x60b3('0x22')](respondWithResult(_0x410b4f,null))[_0x60b3('0x42')](handleError(_0x410b4f,null));};exports[_0x60b3('0x23')]=function(_0x3724aa,_0xb4fb46){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3724aa[_0x60b3('0x44')]['id']}})[_0x60b3('0x22')](handleEntityNotFound(_0xb4fb46,null))[_0x60b3('0x22')](removeEntity(_0xb4fb46,null))['catch'](handleError(_0xb4fb46,null));};exports['describe']=function(_0x2319c9,_0x2c81d3){return db[_0x60b3('0x28')][_0x60b3('0x48')]()[_0x60b3('0x22')](respondWithResult(_0x2c81d3,null))[_0x60b3('0x42')](handleError(_0x2c81d3,null));}; \ No newline at end of file +var _0x6f27=['undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end'];(function(_0x526211,_0x49b917){var _0x20dbf6=function(_0x1f8ee0){while(--_0x1f8ee0){_0x526211['push'](_0x526211['shift']());}};_0x20dbf6(++_0x49b917);}(_0x6f27,0x76));var _0x76f2=function(_0x2573f7,_0x1200bc){_0x2573f7=_0x2573f7-0x0;var _0x57740d=_0x6f27[_0x2573f7];return _0x57740d;};'use strict';var emlformat=require(_0x76f2('0x0'));var rimraf=require(_0x76f2('0x1'));var zipdir=require(_0x76f2('0x2'));var jsonpatch=require(_0x76f2('0x3'));var rp=require(_0x76f2('0x4'));var moment=require(_0x76f2('0x5'));var BPromise=require(_0x76f2('0x6'));var Mustache=require(_0x76f2('0x7'));var util=require('util');var path=require(_0x76f2('0x8'));var sox=require('sox');var csv=require(_0x76f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76f2('0xa'));var squel=require(_0x76f2('0xb'));var crypto=require('crypto');var jsforce=require(_0x76f2('0xc'));var deskjs=require(_0x76f2('0xd'));var toCsv=require(_0x76f2('0x9'));var querystring=require('querystring');var Papa=require(_0x76f2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f2('0xf'));var as=require(_0x76f2('0x10'));var hardwareService=require(_0x76f2('0x11'));var logger=require(_0x76f2('0x12'))(_0x76f2('0x13'));var utils=require(_0x76f2('0x14'));var config=require(_0x76f2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24d53c,_0x37c518){_0x37c518=_0x37c518||0xcc;return function(_0x38b4ee){if(_0x38b4ee){return _0x24d53c['sendStatus'](_0x37c518);}return _0x24d53c[_0x76f2('0x16')](_0x37c518)[_0x76f2('0x17')]();};}function respondWithResult(_0x4686ce,_0x3fb65e){_0x3fb65e=_0x3fb65e||0xc8;return function(_0x1e80e9){if(_0x1e80e9){return _0x4686ce[_0x76f2('0x16')](_0x3fb65e)['json'](_0x1e80e9);}};}function respondWithFilteredResult(_0x380eda,_0x5947e1){return function(_0x39ae18){if(_0x39ae18){var _0x5ed5c9=typeof _0x5947e1['offset']===_0x76f2('0x18')&&typeof _0x5947e1[_0x76f2('0x19')]===_0x76f2('0x18');var _0x37e7ce=_0x39ae18[_0x76f2('0x1a')];var _0x32bcb5=_0x5ed5c9?0x0:_0x5947e1[_0x76f2('0x1b')];var _0xce32fd=_0x5ed5c9?_0x39ae18[_0x76f2('0x1a')]:_0x5947e1[_0x76f2('0x1b')]+_0x5947e1[_0x76f2('0x19')];var _0xbf0f95;if(_0xce32fd>=_0x37e7ce){_0xce32fd=_0x37e7ce;_0xbf0f95=0xc8;}else{_0xbf0f95=0xce;}_0x380eda[_0x76f2('0x16')](_0xbf0f95);return _0x380eda[_0x76f2('0x1c')](_0x76f2('0x1d'),_0x32bcb5+'-'+_0xce32fd+'/'+_0x37e7ce)[_0x76f2('0x1e')](_0x39ae18);}return null;};}function patchUpdates(_0x4e7853){return function(_0x166fe6){try{jsonpatch[_0x76f2('0x1f')](_0x166fe6,_0x4e7853,!![]);}catch(_0x4ef114){return BPromise[_0x76f2('0x20')](_0x4ef114);}return _0x166fe6[_0x76f2('0x21')]();};}function saveUpdates(_0x358d62,_0x3b2f8c){return function(_0x3b8281){if(_0x3b8281){return _0x3b8281['update'](_0x358d62)[_0x76f2('0x22')](function(_0x2bfb04){return _0x2bfb04;});}return null;};}function removeEntity(_0x1e7d82,_0x30d690){return function(_0xda0e7b){if(_0xda0e7b){return _0xda0e7b['destroy']()['then'](function(){_0x1e7d82[_0x76f2('0x16')](0xcc)[_0x76f2('0x17')]();});}};}function handleEntityNotFound(_0x5ba02d,_0x9ca391){return function(_0x314254){if(!_0x314254){_0x5ba02d[_0x76f2('0x23')](0x194);}return _0x314254;};}function handleError(_0x547cc3,_0x1103d5){_0x1103d5=_0x1103d5||0x1f4;return function(_0x253a72){logger['error'](_0x253a72[_0x76f2('0x24')]);if(_0x253a72[_0x76f2('0x25')]){delete _0x253a72[_0x76f2('0x25')];}_0x547cc3['status'](_0x1103d5)[_0x76f2('0x26')](_0x253a72);};}exports['index']=function(_0x34c68b,_0x42c190){var _0x3a374f={},_0x4ae67b={},_0x3bb773={'count':0x0,'rows':[]};var _0x45e149=_[_0x76f2('0x27')](db[_0x76f2('0x28')][_0x76f2('0x29')],function(_0x28e329){return{'name':_0x28e329[_0x76f2('0x2a')],'type':_0x28e329['type'][_0x76f2('0x2b')]};});_0x4ae67b[_0x76f2('0x2c')]=_[_0x76f2('0x27')](_0x45e149,'name');_0x4ae67b[_0x76f2('0x2d')]=_[_0x76f2('0x2e')](_0x34c68b[_0x76f2('0x2d')]);_0x4ae67b[_0x76f2('0x2f')]=_['intersection'](_0x4ae67b[_0x76f2('0x2c')],_0x4ae67b[_0x76f2('0x2d')]);_0x3a374f[_0x76f2('0x30')]=_['intersection'](_0x4ae67b[_0x76f2('0x2c')],qs['fields'](_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x31')]));_0x3a374f[_0x76f2('0x30')]=_0x3a374f[_0x76f2('0x30')][_0x76f2('0x32')]?_0x3a374f[_0x76f2('0x30')]:_0x4ae67b[_0x76f2('0x2c')];if(!_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x33')]('nolimit')){_0x3a374f[_0x76f2('0x19')]=qs[_0x76f2('0x19')](_0x34c68b[_0x76f2('0x2d')]['limit']);_0x3a374f['offset']=qs[_0x76f2('0x1b')](_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x1b')]);}_0x3a374f[_0x76f2('0x34')]=qs[_0x76f2('0x35')](_0x34c68b['query'][_0x76f2('0x35')]);_0x3a374f[_0x76f2('0x36')]=qs[_0x76f2('0x2f')](_['pick'](_0x34c68b[_0x76f2('0x2d')],_0x4ae67b[_0x76f2('0x2f')]),_0x45e149);if(_0x34c68b['query'][_0x76f2('0x37')]){_0x3a374f['where']=_[_0x76f2('0x38')](_0x3a374f['where'],{'$or':_[_0x76f2('0x27')](_0x45e149,function(_0x32d759){if(_0x32d759[_0x76f2('0x39')]!==_0x76f2('0x3a')){var _0x3f698b={};_0x3f698b[_0x32d759['name']]={'$like':'%'+_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x37')]+'%'};return _0x3f698b;}})});}_0x3a374f=_[_0x76f2('0x38')]({},_0x3a374f,_0x34c68b[_0x76f2('0x3b')]);var _0x2f851d={'where':_0x3a374f[_0x76f2('0x36')]};return db[_0x76f2('0x28')]['count'](_0x2f851d)[_0x76f2('0x22')](function(_0x4b6fb2){_0x3bb773[_0x76f2('0x1a')]=_0x4b6fb2;if(_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x3c')]){_0x3a374f[_0x76f2('0x3d')]=[{'all':!![]}];}return db[_0x76f2('0x28')][_0x76f2('0x3e')](_0x3a374f);})['then'](function(_0x218c8b){_0x3bb773['rows']=_0x218c8b;return _0x3bb773;})[_0x76f2('0x22')](respondWithFilteredResult(_0x42c190,_0x3a374f))[_0x76f2('0x3f')](handleError(_0x42c190,null));};exports[_0x76f2('0x40')]=function(_0x17b425,_0x18a005){var _0x59506a={'raw':!![],'where':{'id':_0x17b425[_0x76f2('0x41')]['id']}},_0x1c3c4a={};_0x1c3c4a[_0x76f2('0x2c')]=_[_0x76f2('0x2e')](db[_0x76f2('0x28')][_0x76f2('0x29')]);_0x1c3c4a['query']=_[_0x76f2('0x2e')](_0x17b425[_0x76f2('0x2d')]);_0x1c3c4a[_0x76f2('0x2f')]=_[_0x76f2('0x42')](_0x1c3c4a[_0x76f2('0x2c')],_0x1c3c4a['query']);_0x59506a[_0x76f2('0x30')]=_[_0x76f2('0x42')](_0x1c3c4a['model'],qs[_0x76f2('0x31')](_0x17b425['query'][_0x76f2('0x31')]));_0x59506a[_0x76f2('0x30')]=_0x59506a['attributes'][_0x76f2('0x32')]?_0x59506a['attributes']:_0x1c3c4a[_0x76f2('0x2c')];if(_0x17b425[_0x76f2('0x2d')]['includeAll']){_0x59506a[_0x76f2('0x3d')]=[{'all':!![]}];}_0x59506a=_[_0x76f2('0x38')]({},_0x59506a,_0x17b425[_0x76f2('0x3b')]);return db[_0x76f2('0x28')][_0x76f2('0x43')](_0x59506a)[_0x76f2('0x22')](handleEntityNotFound(_0x18a005,null))[_0x76f2('0x22')](respondWithResult(_0x18a005,null))[_0x76f2('0x3f')](handleError(_0x18a005,null));};exports[_0x76f2('0x44')]=function(_0x1e179d,_0x2ef10b){return db[_0x76f2('0x28')][_0x76f2('0x44')](_0x1e179d['body'],{})['then'](respondWithResult(_0x2ef10b,0xc9))[_0x76f2('0x3f')](handleError(_0x2ef10b,null));};exports['update']=function(_0x49799f,_0x4ae8ce){if(_0x49799f[_0x76f2('0x45')]['id']){delete _0x49799f['body']['id'];}return db[_0x76f2('0x28')][_0x76f2('0x43')]({'where':{'id':_0x49799f[_0x76f2('0x41')]['id']}})[_0x76f2('0x22')](handleEntityNotFound(_0x4ae8ce,null))['then'](saveUpdates(_0x49799f[_0x76f2('0x45')],null))['then'](respondWithResult(_0x4ae8ce,null))['catch'](handleError(_0x4ae8ce,null));};exports['destroy']=function(_0x45a8e0,_0x4f273b){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x45a8e0[_0x76f2('0x41')]['id']}})[_0x76f2('0x22')](handleEntityNotFound(_0x4f273b,null))[_0x76f2('0x22')](removeEntity(_0x4f273b,null))['catch'](handleError(_0x4f273b,null));};exports['describe']=function(_0x58b5bf,_0x4d0be6){return db[_0x76f2('0x28')][_0x76f2('0x46')]()['then'](respondWithResult(_0x4d0be6,null))[_0x76f2('0x3f')](handleError(_0x4d0be6,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 43486a6..c82ffa9 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 _0x2dce=['../../config/logger','api','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid','util'];(function(_0x4ae8f8,_0x40a58e){var _0x24c8c6=function(_0x2457da){while(--_0x2457da){_0x4ae8f8['push'](_0x4ae8f8['shift']());}};_0x24c8c6(++_0x40a58e);}(_0x2dce,0xdb));var _0xe2dc=function(_0x5a7b96,_0x896caa){_0x5a7b96=_0x5a7b96-0x0;var _0x309775=_0x2dce[_0x5a7b96];return _0x309775;};'use strict';var _=require('lodash');var util=require(_0xe2dc('0x0'));var logger=require(_0xe2dc('0x1'))(_0xe2dc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe2dc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2dc('0x4'));var config=require(_0xe2dc('0x5'));var attributes=require(_0xe2dc('0x6'));module[_0xe2dc('0x7')]=function(_0x646602,_0x433b70){return _0x646602['define'](_0xe2dc('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe2dc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6030=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6030,0x175));var _0x0603=function(_0x1a6c31,_0x14a78e){_0x1a6c31=_0x1a6c31-0x0;var _0x15315f=_0x6030[_0x1a6c31];return _0x15315f;};'use strict';var _=require(_0x0603('0x0'));var util=require(_0x0603('0x1'));var logger=require(_0x0603('0x2'))(_0x0603('0x3'));var moment=require(_0x0603('0x4'));var BPromise=require(_0x0603('0x5'));var rp=require(_0x0603('0x6'));var fs=require('fs');var path=require(_0x0603('0x7'));var rimraf=require(_0x0603('0x8'));var config=require(_0x0603('0x9'));var attributes=require(_0x0603('0xa'));module[_0x0603('0xb')]=function(_0x5af364,_0x3b5705){return _0x5af364[_0x0603('0xc')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fa251fb..e854c38 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 _0xb647=['request','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x2ea857,_0x692ec1){var _0x13b408=function(_0x5f43ba){while(--_0x5f43ba){_0x2ea857['push'](_0x2ea857['shift']());}};_0x13b408(++_0x692ec1);}(_0xb647,0xdb));var _0x7b64=function(_0x44a699,_0x489eca){_0x44a699=_0x44a699-0x0;var _0x15ceb0=_0xb647[_0x44a699];return _0x15ceb0;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));var BPromise=require(_0x7b64('0x3'));var rs=require(_0x7b64('0x4'));var fs=require('fs');var Redis=require(_0x7b64('0x5'));var db=require(_0x7b64('0x6'))['db'];var utils=require(_0x7b64('0x7'));var logger=require('../../config/logger')(_0x7b64('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b64('0x9'));var client=jayson[_0x7b64('0xa')][_0x7b64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80721a,_0xcdec41,_0x22eca3){return new BPromise(function(_0x727684,_0x2ff650){return client[_0x7b64('0xc')](_0x80721a,_0x22eca3)['then'](function(_0x1b8b2a){logger['info'](_0x7b64('0xd'),_0xcdec41,'request\x20sent');logger['debug'](_0x7b64('0xe'),_0xcdec41,_0x7b64('0xf'),JSON['stringify'](_0x1b8b2a));if(_0x1b8b2a[_0x7b64('0x10')]){if(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x11')]===0x1f4){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x2ff650(_0x1b8b2a['error'][_0x7b64('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x727684(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);}else{logger[_0x7b64('0x13')](_0x7b64('0xd'),_0xcdec41,_0x7b64('0xf'));_0x727684(_0x1b8b2a['result'][_0x7b64('0x12')]);}})[_0x7b64('0x14')](function(_0x16ff72){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x16ff72);_0x2ff650(_0x16ff72);});});} \ No newline at end of file +var _0xa751=['rpc','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x45bcd1,_0x2754d0){var _0x48708c=function(_0x36351f){while(--_0x36351f){_0x45bcd1['push'](_0x45bcd1['shift']());}};_0x48708c(++_0x2754d0);}(_0xa751,0x175));var _0x1a75=function(_0x447f53,_0x12cb4f){_0x447f53=_0x447f53-0x0;var _0x1c8c28=_0xa751[_0x447f53];return _0x1c8c28;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2af95b,_0x1ec106,_0x692ac0){return new BPromise(function(_0x4537f6,_0x5d6faa){return client['request'](_0x2af95b,_0x692ac0)['then'](function(_0x41aa8f){logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));logger[_0x1a75('0xe')](_0x1a75('0xf'),_0x1ec106,_0x1a75('0xd'),JSON[_0x1a75('0x10')](_0x41aa8f));if(_0x41aa8f['error']){if(_0x41aa8f['error']['code']===0x1f4){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f[_0x1a75('0x11')][_0x1a75('0x12')]);return _0x5d6faa(_0x41aa8f['error']['message']);}logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f['error'][_0x1a75('0x12')]);return _0x4537f6(_0x41aa8f[_0x1a75('0x11')]['message']);}else{logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));_0x4537f6(_0x41aa8f['result']['message']);}})['catch'](function(_0x471b90){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x471b90);_0x5d6faa(_0x471b90);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3163c31..d1192d1 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 _0x23f2=['get','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated'];(function(_0x78a2d8,_0x1c2137){var _0x34cb72=function(_0x2713a1){while(--_0x2713a1){_0x78a2d8['push'](_0x78a2d8['shift']());}};_0x34cb72(++_0x1c2137);}(_0x23f2,0x171));var _0x223f=function(_0x1b9e62,_0x34523c){_0x1b9e62=_0x1b9e62-0x0;var _0x1e3eef=_0x23f2[_0x1b9e62];return _0x1e3eef;};'use strict';var multer=require(_0x223f('0x0'));var util=require(_0x223f('0x1'));var path=require(_0x223f('0x2'));var timeout=require(_0x223f('0x3'));var express=require(_0x223f('0x4'));var router=express['Router']();var fs_extra=require(_0x223f('0x5'));var auth=require(_0x223f('0x6'));var interaction=require(_0x223f('0x7'));var config=require(_0x223f('0x8'));var controller=require(_0x223f('0x9'));router['get']('/',auth[_0x223f('0xa')](),controller['index']);router[_0x223f('0xb')](_0x223f('0xc'),auth[_0x223f('0xa')](),controller['show']);router['post']('/',auth[_0x223f('0xa')](),controller[_0x223f('0xd')]);router[_0x223f('0xe')](_0x223f('0xc'),auth[_0x223f('0xa')](),controller[_0x223f('0xf')]);router[_0x223f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x223f('0x11')]);module[_0x223f('0x12')]=router; \ No newline at end of file +var _0xa062=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x1589ed,_0x4d6c42){var _0x39b189=function(_0x207363){while(--_0x207363){_0x1589ed['push'](_0x1589ed['shift']());}};_0x39b189(++_0x4d6c42);}(_0xa062,0x101));var _0x2a06=function(_0x35a4aa,_0x49f770){_0x35a4aa=_0x35a4aa-0x0;var _0x4ec141=_0xa062[_0x35a4aa];return _0x4ec141;};'use strict';var multer=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var path=require(_0x2a06('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a06('0x3'));var router=express[_0x2a06('0x4')]();var fs_extra=require(_0x2a06('0x5'));var auth=require(_0x2a06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a06('0x7'));var controller=require('./pause.controller');router['get']('/',auth[_0x2a06('0x8')](),controller[_0x2a06('0x9')]);router[_0x2a06('0xa')](_0x2a06('0xb'),auth[_0x2a06('0x8')](),controller[_0x2a06('0xc')]);router['post']('/',auth[_0x2a06('0x8')](),controller[_0x2a06('0xd')]);router['put'](_0x2a06('0xb'),auth[_0x2a06('0x8')](),controller[_0x2a06('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2a06('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f28346c..f2c6e30 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 _0x2b29=['name','STRING','sequelize','exports'];(function(_0x1c80e4,_0x54093e){var _0x52cf4f=function(_0x58e283){while(--_0x58e283){_0x1c80e4['push'](_0x1c80e4['shift']());}};_0x52cf4f(++_0x54093e);}(_0x2b29,0x14e));var _0x92b2=function(_0x12926d,_0x35ac15){_0x12926d=_0x12926d-0x0;var _0x2d5f0f=_0x2b29[_0x12926d];return _0x2d5f0f;};'use strict';var Sequelize=require(_0x92b2('0x0'));module[_0x92b2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x92b2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x92b2('0x3')]}}; \ No newline at end of file +var _0xb58c=['exports','STRING','name','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb58c,0x127));var _0xcb58=function(_0x5401e2,_0xb8e801){_0x5401e2=_0x5401e2-0x0;var _0x557f0f=_0xb58c[_0x5401e2];return _0x557f0f;};'use strict';var Sequelize=require(_0xcb58('0x0'));module[_0xcb58('0x1')]={'name':{'type':Sequelize[_0xcb58('0x2')],'unique':_0xcb58('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcb58('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index dd1800b..6093340 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 _0xaf84=['include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','get','end','stack','name','send','map','Pause','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys'];(function(_0x2ff55d,_0x404f4b){var _0x1af942=function(_0x39ad08){while(--_0x39ad08){_0x2ff55d['push'](_0x2ff55d['shift']());}};_0x1af942(++_0x404f4b);}(_0xaf84,0x1e7));var _0x4af8=function(_0x5c4d30,_0x2bc47a){_0x5c4d30=_0x5c4d30-0x0;var _0x120851=_0xaf84[_0x5c4d30];return _0x120851;};'use strict';var emlformat=require(_0x4af8('0x0'));var rimraf=require(_0x4af8('0x1'));var zipdir=require(_0x4af8('0x2'));var jsonpatch=require(_0x4af8('0x3'));var rp=require(_0x4af8('0x4'));var moment=require(_0x4af8('0x5'));var BPromise=require(_0x4af8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4af8('0x7'));var csv=require(_0x4af8('0x8'));var ejs=require(_0x4af8('0x9'));var fs=require('fs');var fs_extra=require(_0x4af8('0xa'));var _=require(_0x4af8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4af8('0xc'));var toCsv=require(_0x4af8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4af8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4af8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4af8('0xf'))('api');var utils=require(_0x4af8('0x10'));var config=require(_0x4af8('0x11'));var licenseUtil=require(_0x4af8('0x12'));var db=require(_0x4af8('0x13'))['db'];function respondWithStatusCode(_0x56b198,_0x40cdb5){_0x40cdb5=_0x40cdb5||0xcc;return function(_0x46a5c8){if(_0x46a5c8){return _0x56b198[_0x4af8('0x14')](_0x40cdb5);}return _0x56b198[_0x4af8('0x15')](_0x40cdb5)['end']();};}function respondWithResult(_0x53fc95,_0x2fb984){_0x2fb984=_0x2fb984||0xc8;return function(_0x52e7a3){if(_0x52e7a3){return _0x53fc95['status'](_0x2fb984)[_0x4af8('0x16')](_0x52e7a3);}};}function respondWithFilteredResult(_0x3a1c4b,_0x5dfbf9){return function(_0x3eb858){if(_0x3eb858){var _0x216057=typeof _0x5dfbf9[_0x4af8('0x17')]===_0x4af8('0x18')&&typeof _0x5dfbf9[_0x4af8('0x19')]===_0x4af8('0x18');var _0xa1021a=_0x3eb858['count'];var _0x18b270=_0x216057?0x0:_0x5dfbf9[_0x4af8('0x17')];var _0x409600=_0x216057?_0x3eb858[_0x4af8('0x1a')]:_0x5dfbf9[_0x4af8('0x17')]+_0x5dfbf9['limit'];var _0x171503;if(_0x409600>=_0xa1021a){_0x409600=_0xa1021a;_0x171503=0xc8;}else{_0x171503=0xce;}_0x3a1c4b[_0x4af8('0x15')](_0x171503);return _0x3a1c4b[_0x4af8('0x1b')](_0x4af8('0x1c'),_0x18b270+'-'+_0x409600+'/'+_0xa1021a)[_0x4af8('0x16')](_0x3eb858);}return null;};}function patchUpdates(_0x33e057){return function(_0x24dccf){try{jsonpatch[_0x4af8('0x1d')](_0x24dccf,_0x33e057,!![]);}catch(_0x3f4362){return BPromise['reject'](_0x3f4362);}return _0x24dccf['save']();};}function saveUpdates(_0x5a52b9,_0x24470e){return function(_0xdc4165){if(_0xdc4165){return _0xdc4165[_0x4af8('0x1e')](_0x5a52b9)['then'](function(_0x3f6671){return _0x3f6671;});}return null;};}function removeEntity(_0x3ca952,_0x415518){return function(_0x1b4991){if(_0x1b4991){return _0x1b4991[_0x4af8('0x1f')]()[_0x4af8('0x20')](function(){var _0x4a290a=_0x1b4991[_0x4af8('0x21')]({'plain':!![]});var _0x28deee='Pauses';return db['UserProfileResource'][_0x4af8('0x1f')]({'where':{'type':_0x28deee,'resourceId':_0x4a290a['id']}})[_0x4af8('0x20')](function(){return _0x1b4991;});})[_0x4af8('0x20')](function(){_0x3ca952[_0x4af8('0x15')](0xcc)[_0x4af8('0x22')]();});}};}function handleEntityNotFound(_0x2dead3,_0x34a400){return function(_0x46a73a){if(!_0x46a73a){_0x2dead3[_0x4af8('0x14')](0x194);}return _0x46a73a;};}function handleError(_0x436645,_0xf34d8a){_0xf34d8a=_0xf34d8a||0x1f4;return function(_0x2625c7){logger['error'](_0x2625c7[_0x4af8('0x23')]);if(_0x2625c7[_0x4af8('0x24')]){delete _0x2625c7[_0x4af8('0x24')];}_0x436645['status'](_0xf34d8a)[_0x4af8('0x25')](_0x2625c7);};}exports['index']=function(_0x179bd7,_0x2193ed){var _0x1a5b65={},_0x3a84c7={},_0x310692={'count':0x0,'rows':[]};var _0x1981e6=_[_0x4af8('0x26')](db[_0x4af8('0x27')][_0x4af8('0x28')],function(_0x176b9c){return{'name':_0x176b9c[_0x4af8('0x29')],'type':_0x176b9c[_0x4af8('0x2a')]['key']};});_0x3a84c7[_0x4af8('0x2b')]=_[_0x4af8('0x26')](_0x1981e6,_0x4af8('0x24'));_0x3a84c7[_0x4af8('0x2c')]=_['keys'](_0x179bd7[_0x4af8('0x2c')]);_0x3a84c7['filters']=_[_0x4af8('0x2d')](_0x3a84c7[_0x4af8('0x2b')],_0x3a84c7['query']);_0x1a5b65['attributes']=_[_0x4af8('0x2d')](_0x3a84c7['model'],qs[_0x4af8('0x2e')](_0x179bd7[_0x4af8('0x2c')]['fields']));_0x1a5b65[_0x4af8('0x2f')]=_0x1a5b65[_0x4af8('0x2f')][_0x4af8('0x30')]?_0x1a5b65[_0x4af8('0x2f')]:_0x3a84c7[_0x4af8('0x2b')];if(!_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x31')](_0x4af8('0x32'))){_0x1a5b65['limit']=qs['limit'](_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x19')]);_0x1a5b65[_0x4af8('0x17')]=qs[_0x4af8('0x17')](_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x17')]);}_0x1a5b65[_0x4af8('0x33')]=qs['sort'](_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x34')]);_0x1a5b65[_0x4af8('0x35')]=qs[_0x4af8('0x36')](_[_0x4af8('0x37')](_0x179bd7[_0x4af8('0x2c')],_0x3a84c7[_0x4af8('0x36')]),_0x1981e6);if(_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x38')]){_0x1a5b65['where']=_[_0x4af8('0x39')](_0x1a5b65[_0x4af8('0x35')],{'$or':_['map'](_0x1981e6,function(_0x8effe8){if(_0x8effe8[_0x4af8('0x2a')]!==_0x4af8('0x3a')){var _0x3c52d8={};_0x3c52d8[_0x8effe8[_0x4af8('0x24')]]={'$like':'%'+_0x179bd7['query'][_0x4af8('0x38')]+'%'};return _0x3c52d8;}})});}_0x1a5b65=_['merge']({},_0x1a5b65,_0x179bd7[_0x4af8('0x3b')]);var _0x402951={'where':_0x1a5b65[_0x4af8('0x35')]};return db[_0x4af8('0x27')][_0x4af8('0x1a')](_0x402951)['then'](function(_0x55768e){_0x310692['count']=_0x55768e;if(_0x179bd7[_0x4af8('0x2c')][_0x4af8('0x3c')]){_0x1a5b65['include']=[{'all':!![]}];}return db[_0x4af8('0x27')]['findAll'](_0x1a5b65);})[_0x4af8('0x20')](function(_0x10d4e9){_0x310692[_0x4af8('0x3d')]=_0x10d4e9;return _0x310692;})[_0x4af8('0x20')](respondWithFilteredResult(_0x2193ed,_0x1a5b65))[_0x4af8('0x3e')](handleError(_0x2193ed,null));};exports[_0x4af8('0x3f')]=function(_0x3d2f28,_0x461532){var _0x482987={'raw':!![],'where':{'id':_0x3d2f28[_0x4af8('0x40')]['id']}},_0x2a9ca4={};_0x2a9ca4[_0x4af8('0x2b')]=_['keys'](db['Pause'][_0x4af8('0x28')]);_0x2a9ca4[_0x4af8('0x2c')]=_[_0x4af8('0x41')](_0x3d2f28[_0x4af8('0x2c')]);_0x2a9ca4['filters']=_[_0x4af8('0x2d')](_0x2a9ca4['model'],_0x2a9ca4[_0x4af8('0x2c')]);_0x482987[_0x4af8('0x2f')]=_[_0x4af8('0x2d')](_0x2a9ca4[_0x4af8('0x2b')],qs['fields'](_0x3d2f28['query'][_0x4af8('0x2e')]));_0x482987[_0x4af8('0x2f')]=_0x482987[_0x4af8('0x2f')][_0x4af8('0x30')]?_0x482987[_0x4af8('0x2f')]:_0x2a9ca4['model'];if(_0x3d2f28[_0x4af8('0x2c')][_0x4af8('0x3c')]){_0x482987[_0x4af8('0x42')]=[{'all':!![]}];}_0x482987=_['merge']({},_0x482987,_0x3d2f28[_0x4af8('0x3b')]);return db[_0x4af8('0x27')][_0x4af8('0x43')](_0x482987)[_0x4af8('0x20')](handleEntityNotFound(_0x461532,null))[_0x4af8('0x20')](respondWithResult(_0x461532,null))[_0x4af8('0x3e')](handleError(_0x461532,null));};exports[_0x4af8('0x44')]=function(_0x28fcd1,_0x1193b1){return db[_0x4af8('0x27')][_0x4af8('0x44')](_0x28fcd1['body'],{})[_0x4af8('0x20')](function(_0x51a482){var _0x65e69c=_0x28fcd1[_0x4af8('0x45')][_0x4af8('0x21')]({'plain':!![]});if(!_0x65e69c)throw new Error(_0x4af8('0x46'));if(_0x65e69c[_0x4af8('0x47')]===_0x4af8('0x45')){var _0x3fd4b9=_0x51a482[_0x4af8('0x21')]({'plain':!![]});var _0x307cf6=_0x4af8('0x48');return db[_0x4af8('0x49')][_0x4af8('0x43')]({'where':{'name':_0x307cf6,'userProfileId':_0x65e69c['userProfileId']},'raw':!![]})['then'](function(_0x4e2f4c){if(_0x4e2f4c&&_0x4e2f4c[_0x4af8('0x4a')]===0x0){return db[_0x4af8('0x4b')][_0x4af8('0x44')]({'name':_0x3fd4b9[_0x4af8('0x24')],'resourceId':_0x3fd4b9['id'],'type':_0x4e2f4c[_0x4af8('0x24')],'sectionId':_0x4e2f4c['id']},{})['then'](function(){return _0x51a482;});}else{return _0x51a482;}})[_0x4af8('0x3e')](function(_0x467407){logger[_0x4af8('0x4c')](_0x4af8('0x4d'),_0x467407);throw _0x467407;});}return _0x51a482;})['then'](respondWithResult(_0x1193b1,0xc9))['catch'](handleError(_0x1193b1,null));};exports[_0x4af8('0x1e')]=function(_0x35574b,_0x564244){if(_0x35574b[_0x4af8('0x4e')]['id']){delete _0x35574b['body']['id'];}return db[_0x4af8('0x27')]['find']({'where':{'id':_0x35574b[_0x4af8('0x40')]['id']}})[_0x4af8('0x20')](handleEntityNotFound(_0x564244,null))[_0x4af8('0x20')](saveUpdates(_0x35574b[_0x4af8('0x4e')],null))['then'](respondWithResult(_0x564244,null))['catch'](handleError(_0x564244,null));};exports[_0x4af8('0x1f')]=function(_0x2f5f7f,_0x19c2cc){return db[_0x4af8('0x27')][_0x4af8('0x43')]({'where':{'id':_0x2f5f7f[_0x4af8('0x40')]['id']}})[_0x4af8('0x20')](handleEntityNotFound(_0x19c2cc,null))[_0x4af8('0x20')](removeEntity(_0x19c2cc,null))[_0x4af8('0x3e')](handleError(_0x19c2cc,null));}; \ No newline at end of file +var _0x9290=['fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','send','map','Pause','rawAttributes','type','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','query','sort','where','pick','merge','options','includeAll','include','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x9290,0x1c1));var _0x0929=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x9290[_0x29d623];return _0x242e59;};'use strict';var emlformat=require(_0x0929('0x0'));var rimraf=require(_0x0929('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0929('0x2'));var rp=require(_0x0929('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0929('0x4'));var util=require('util');var path=require(_0x0929('0x5'));var sox=require('sox');var csv=require(_0x0929('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0929('0x7'));var _=require(_0x0929('0x8'));var squel=require('squel');var crypto=require(_0x0929('0x9'));var jsforce=require(_0x0929('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0929('0x6'));var querystring=require(_0x0929('0xb'));var Papa=require(_0x0929('0xc'));var Redis=require(_0x0929('0xd'));var authService=require(_0x0929('0xe'));var qs=require(_0x0929('0xf'));var as=require(_0x0929('0x10'));var hardwareService=require(_0x0929('0x11'));var logger=require(_0x0929('0x12'))(_0x0929('0x13'));var utils=require(_0x0929('0x14'));var config=require(_0x0929('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0929('0x16'))['db'];function respondWithStatusCode(_0x582ce4,_0xffe2cb){_0xffe2cb=_0xffe2cb||0xcc;return function(_0x537d21){if(_0x537d21){return _0x582ce4[_0x0929('0x17')](_0xffe2cb);}return _0x582ce4[_0x0929('0x18')](_0xffe2cb)[_0x0929('0x19')]();};}function respondWithResult(_0x359caf,_0x464fff){_0x464fff=_0x464fff||0xc8;return function(_0x27bf73){if(_0x27bf73){return _0x359caf['status'](_0x464fff)[_0x0929('0x1a')](_0x27bf73);}};}function respondWithFilteredResult(_0x3332e9,_0x39921b){return function(_0x514aef){if(_0x514aef){var _0x28233f=typeof _0x39921b[_0x0929('0x1b')]===_0x0929('0x1c')&&typeof _0x39921b[_0x0929('0x1d')]===_0x0929('0x1c');var _0x141164=_0x514aef[_0x0929('0x1e')];var _0x5a50b9=_0x28233f?0x0:_0x39921b[_0x0929('0x1b')];var _0x4f9ae9=_0x28233f?_0x514aef[_0x0929('0x1e')]:_0x39921b[_0x0929('0x1b')]+_0x39921b[_0x0929('0x1d')];var _0x525869;if(_0x4f9ae9>=_0x141164){_0x4f9ae9=_0x141164;_0x525869=0xc8;}else{_0x525869=0xce;}_0x3332e9['status'](_0x525869);return _0x3332e9[_0x0929('0x1f')](_0x0929('0x20'),_0x5a50b9+'-'+_0x4f9ae9+'/'+_0x141164)[_0x0929('0x1a')](_0x514aef);}return null;};}function patchUpdates(_0x37f9ef){return function(_0x40ff2a){try{jsonpatch['apply'](_0x40ff2a,_0x37f9ef,!![]);}catch(_0x3c5ec3){return BPromise['reject'](_0x3c5ec3);}return _0x40ff2a[_0x0929('0x21')]();};}function saveUpdates(_0x4cdf38,_0x4ccadc){return function(_0xfe65df){if(_0xfe65df){return _0xfe65df[_0x0929('0x22')](_0x4cdf38)[_0x0929('0x23')](function(_0x55fb52){return _0x55fb52;});}return null;};}function removeEntity(_0x563c02,_0x47f185){return function(_0x1acdd0){if(_0x1acdd0){return _0x1acdd0[_0x0929('0x24')]()[_0x0929('0x23')](function(){var _0x2e368c=_0x1acdd0[_0x0929('0x25')]({'plain':!![]});var _0x4f9049=_0x0929('0x26');return db[_0x0929('0x27')]['destroy']({'where':{'type':_0x4f9049,'resourceId':_0x2e368c['id']}})['then'](function(){return _0x1acdd0;});})[_0x0929('0x23')](function(){_0x563c02[_0x0929('0x18')](0xcc)[_0x0929('0x19')]();});}};}function handleEntityNotFound(_0x130ed2,_0x3c5203){return function(_0x33993f){if(!_0x33993f){_0x130ed2[_0x0929('0x17')](0x194);}return _0x33993f;};}function handleError(_0x5c6cff,_0x32f33d){_0x32f33d=_0x32f33d||0x1f4;return function(_0x24a97c){logger['error'](_0x24a97c[_0x0929('0x28')]);if(_0x24a97c[_0x0929('0x29')]){delete _0x24a97c[_0x0929('0x29')];}_0x5c6cff[_0x0929('0x18')](_0x32f33d)[_0x0929('0x2a')](_0x24a97c);};}exports['index']=function(_0x2ba363,_0x52464e){var _0xbf0e1e={},_0x2dbea0={},_0x457497={'count':0x0,'rows':[]};var _0x3d7d6a=_[_0x0929('0x2b')](db[_0x0929('0x2c')][_0x0929('0x2d')],function(_0xf460dc){return{'name':_0xf460dc['fieldName'],'type':_0xf460dc[_0x0929('0x2e')]['key']};});_0x2dbea0['model']=_[_0x0929('0x2b')](_0x3d7d6a,_0x0929('0x29'));_0x2dbea0['query']=_['keys'](_0x2ba363['query']);_0x2dbea0[_0x0929('0x2f')]=_[_0x0929('0x30')](_0x2dbea0[_0x0929('0x31')],_0x2dbea0['query']);_0xbf0e1e[_0x0929('0x32')]=_['intersection'](_0x2dbea0[_0x0929('0x31')],qs['fields'](_0x2ba363['query'][_0x0929('0x33')]));_0xbf0e1e[_0x0929('0x32')]=_0xbf0e1e['attributes'][_0x0929('0x34')]?_0xbf0e1e['attributes']:_0x2dbea0['model'];if(!_0x2ba363['query'][_0x0929('0x35')](_0x0929('0x36'))){_0xbf0e1e[_0x0929('0x1d')]=qs[_0x0929('0x1d')](_0x2ba363['query']['limit']);_0xbf0e1e['offset']=qs[_0x0929('0x1b')](_0x2ba363[_0x0929('0x37')][_0x0929('0x1b')]);}_0xbf0e1e['order']=qs[_0x0929('0x38')](_0x2ba363[_0x0929('0x37')][_0x0929('0x38')]);_0xbf0e1e[_0x0929('0x39')]=qs['filters'](_[_0x0929('0x3a')](_0x2ba363['query'],_0x2dbea0[_0x0929('0x2f')]),_0x3d7d6a);if(_0x2ba363[_0x0929('0x37')]['filter']){_0xbf0e1e[_0x0929('0x39')]=_[_0x0929('0x3b')](_0xbf0e1e[_0x0929('0x39')],{'$or':_[_0x0929('0x2b')](_0x3d7d6a,function(_0x2453dc){if(_0x2453dc[_0x0929('0x2e')]!=='VIRTUAL'){var _0x472f94={};_0x472f94[_0x2453dc[_0x0929('0x29')]]={'$like':'%'+_0x2ba363[_0x0929('0x37')]['filter']+'%'};return _0x472f94;}})});}_0xbf0e1e=_['merge']({},_0xbf0e1e,_0x2ba363[_0x0929('0x3c')]);var _0x55db0a={'where':_0xbf0e1e[_0x0929('0x39')]};return db[_0x0929('0x2c')][_0x0929('0x1e')](_0x55db0a)[_0x0929('0x23')](function(_0xfb47d3){_0x457497[_0x0929('0x1e')]=_0xfb47d3;if(_0x2ba363[_0x0929('0x37')][_0x0929('0x3d')]){_0xbf0e1e[_0x0929('0x3e')]=[{'all':!![]}];}return db['Pause']['findAll'](_0xbf0e1e);})[_0x0929('0x23')](function(_0x2ad196){_0x457497[_0x0929('0x3f')]=_0x2ad196;return _0x457497;})[_0x0929('0x23')](respondWithFilteredResult(_0x52464e,_0xbf0e1e))[_0x0929('0x40')](handleError(_0x52464e,null));};exports[_0x0929('0x41')]=function(_0x44e079,_0x4d12f9){var _0x43c71b={'raw':!![],'where':{'id':_0x44e079['params']['id']}},_0x20da88={};_0x20da88['model']=_[_0x0929('0x42')](db[_0x0929('0x2c')]['rawAttributes']);_0x20da88['query']=_[_0x0929('0x42')](_0x44e079['query']);_0x20da88[_0x0929('0x2f')]=_[_0x0929('0x30')](_0x20da88[_0x0929('0x31')],_0x20da88[_0x0929('0x37')]);_0x43c71b[_0x0929('0x32')]=_[_0x0929('0x30')](_0x20da88['model'],qs[_0x0929('0x33')](_0x44e079['query']['fields']));_0x43c71b[_0x0929('0x32')]=_0x43c71b[_0x0929('0x32')]['length']?_0x43c71b[_0x0929('0x32')]:_0x20da88[_0x0929('0x31')];if(_0x44e079['query'][_0x0929('0x3d')]){_0x43c71b[_0x0929('0x3e')]=[{'all':!![]}];}_0x43c71b=_[_0x0929('0x3b')]({},_0x43c71b,_0x44e079[_0x0929('0x3c')]);return db[_0x0929('0x2c')]['find'](_0x43c71b)['then'](handleEntityNotFound(_0x4d12f9,null))[_0x0929('0x23')](respondWithResult(_0x4d12f9,null))['catch'](handleError(_0x4d12f9,null));};exports['create']=function(_0x224cb1,_0x58abd3){return db[_0x0929('0x2c')][_0x0929('0x43')](_0x224cb1[_0x0929('0x44')],{})['then'](function(_0x5cabe4){var _0x559a72=_0x224cb1[_0x0929('0x45')][_0x0929('0x25')]({'plain':!![]});if(!_0x559a72)throw new Error(_0x0929('0x46'));if(_0x559a72[_0x0929('0x47')]==='user'){var _0x4787e3=_0x5cabe4['get']({'plain':!![]});var _0x55703f=_0x0929('0x26');return db[_0x0929('0x48')][_0x0929('0x49')]({'where':{'name':_0x55703f,'userProfileId':_0x559a72['userProfileId']},'raw':!![]})['then'](function(_0x19034c){if(_0x19034c&&_0x19034c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4787e3[_0x0929('0x29')],'resourceId':_0x4787e3['id'],'type':_0x19034c[_0x0929('0x29')],'sectionId':_0x19034c['id']},{})[_0x0929('0x23')](function(){return _0x5cabe4;});}else{return _0x5cabe4;}})[_0x0929('0x40')](function(_0x476bd1){logger['error'](_0x0929('0x4a'),_0x476bd1);throw _0x476bd1;});}return _0x5cabe4;})[_0x0929('0x23')](respondWithResult(_0x58abd3,0xc9))[_0x0929('0x40')](handleError(_0x58abd3,null));};exports[_0x0929('0x22')]=function(_0x523c00,_0x47c9e7){if(_0x523c00[_0x0929('0x44')]['id']){delete _0x523c00[_0x0929('0x44')]['id'];}return db[_0x0929('0x2c')][_0x0929('0x49')]({'where':{'id':_0x523c00['params']['id']}})[_0x0929('0x23')](handleEntityNotFound(_0x47c9e7,null))[_0x0929('0x23')](saveUpdates(_0x523c00[_0x0929('0x44')],null))['then'](respondWithResult(_0x47c9e7,null))[_0x0929('0x40')](handleError(_0x47c9e7,null));};exports[_0x0929('0x24')]=function(_0x201ce2,_0x40c6fd){return db[_0x0929('0x2c')][_0x0929('0x49')]({'where':{'id':_0x201ce2[_0x0929('0x4b')]['id']}})[_0x0929('0x23')](handleEntityNotFound(_0x40c6fd,null))[_0x0929('0x23')](removeEntity(_0x40c6fd,null))[_0x0929('0x40')](handleError(_0x40c6fd,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 510ff17..ec43a03 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 2651846..91d65e0 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(_0x15f628,_0x4e2a1){var _0x519601=function(_0x5acf7e){while(--_0x5acf7e){_0x15f628['push'](_0x15f628['shift']());}};_0x519601(++_0x4e2a1);}(_0x7a54,0x106));var _0x47a5=function(_0x3740fb,_0x5f24a4){_0x3740fb=_0x3740fb-0x0;var _0x4f0d1a=_0x7a54[_0x3740fb];return _0x4f0d1a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x52a28a,_0x48704d){var _0x294c4c=function(_0x5e19b3){while(--_0x5e19b3){_0x52a28a['push'](_0x52a28a['shift']());}};_0x294c4c(++_0x48704d);}(_0x7a54,0x106));var _0x47a5=function(_0x3fae86,_0x37f59a){_0x3fae86=_0x3fae86-0x0;var _0x179075=_0x7a54[_0x3fae86];return _0x179075;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 627016f..a81d415 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 _0x5db8=['basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s'];(function(_0x52304d,_0x2e0d13){var _0x27220a=function(_0x16433a){while(--_0x16433a){_0x52304d['push'](_0x52304d['shift']());}};_0x27220a(++_0x2e0d13);}(_0x5db8,0xbb));var _0x85db=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x5db8[_0x3a6922];return _0x9c1b44;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),controller[_0x85db('0xb')]);router[_0x85db('0x8')](_0x85db('0xc'),auth['isAuthenticated'](),controller[_0x85db('0xd')]);router['get'](_0x85db('0xe'),auth[_0x85db('0x9')](),controller[_0x85db('0xf')]);var upload=multer({'storage':multer[_0x85db('0x10')]({'destination':function(_0x5491fa,_0x54feb2,_0x51fd42){_0x51fd42(null,path[_0x85db('0x11')](config[_0x85db('0x12')],'server/files/plugins'));},'filename':function(_0x11ac68,_0x541f2f,_0x437f7a){_0x541f2f[_0x85db('0x13')]=_0x541f2f[_0x85db('0x13')][_0x85db('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x437f7a(null,util[_0x85db('0x15')](_0x85db('0x16'),path[_0x85db('0x17')](_0x541f2f[_0x85db('0x13')],path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])),Date[_0x85db('0x19')](),path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])));}})});router['post']('/',upload[_0x85db('0x1a')](_0x85db('0x1b')),controller[_0x85db('0x1c')]);router[_0x85db('0x1d')](_0x85db('0xa'),controller[_0x85db('0x1e')]);router[_0x85db('0x1f')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x20')]);router[_0x85db('0x21')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0x21')]);module[_0x85db('0x22')]=router; \ No newline at end of file +var _0x207c=['file','upload','post','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/webhook','/:id','isAuthenticated','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','extname','now','single'];(function(_0x776428,_0x9695e7){var _0x36fef9=function(_0x16148f){while(--_0x16148f){_0x776428['push'](_0x776428['shift']());}};_0x36fef9(++_0x9695e7);}(_0x207c,0x1e8));var _0xc207=function(_0x48eecb,_0x4cc6cd){_0x48eecb=_0x48eecb-0x0;var _0x21caa9=_0x207c[_0x48eecb];return _0x21caa9;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),controller['webhookGet']);router[_0xc207('0x9')](_0xc207('0xb'),auth[_0xc207('0xc')](),controller['show']);router[_0xc207('0x9')](_0xc207('0xd'),auth[_0xc207('0xc')](),controller[_0xc207('0xe')]);var upload=multer({'storage':multer[_0xc207('0xf')]({'destination':function(_0x347549,_0x487d95,_0x574425){_0x574425(null,path['join'](config[_0xc207('0x10')],'server/files/plugins'));},'filename':function(_0x2741f3,_0x2782ce,_0x59d401){_0x2782ce[_0xc207('0x11')]=_0x2782ce[_0xc207('0x11')][_0xc207('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59d401(null,util[_0xc207('0x13')](_0xc207('0x14'),path['basename'](_0x2782ce[_0xc207('0x11')],path[_0xc207('0x15')](_0x2782ce[_0xc207('0x11')])),Date[_0xc207('0x16')](),path['extname'](_0x2782ce['originalname'])));}})});router['post']('/',upload[_0xc207('0x17')](_0xc207('0x18')),controller[_0xc207('0x19')]);router[_0xc207('0x1a')]('/webhook',controller[_0xc207('0x1b')]);router[_0xc207('0x1c')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x1d')]);router['delete'](_0xc207('0xb'),auth[_0xc207('0xc')](),controller[_0xc207('0x1e')]);module[_0xc207('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4343a68..7e55bcb 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 _0x4983=['adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x448336,_0x20ac96){var _0x4628b2=function(_0x2c2767){while(--_0x2c2767){_0x448336['push'](_0x448336['shift']());}};_0x4628b2(++_0x20ac96);}(_0x4983,0xb8));var _0x3498=function(_0x522162,_0x301a55){_0x522162=_0x522162-0x0;var _0x363516=_0x4983[_0x522162];return _0x363516;};'use strict';var Sequelize=require(_0x3498('0x0'));module[_0x3498('0x1')]={'name':{'type':Sequelize[_0x3498('0x2')]},'type':{'type':Sequelize[_0x3498('0x3')](_0x3498('0x4'),'script')},'description':{'type':Sequelize[_0x3498('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x3498('0x2')],'comment':_0x3498('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3498('0x7')},'sidebar':{'type':Sequelize[_0x3498('0x3')](_0x3498('0x8'),'agentOnly',_0x3498('0x9'),_0x3498('0xa')),'defaultValue':'always','comment':_0x3498('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x3498('0x2')]},'scriptPath':{'type':Sequelize[_0x3498('0x2')]}}; \ No newline at end of file +var _0x260d=['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','always','sequelize','exports','STRING'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x260d,0x169));var _0xd260=function(_0x18ea41,_0x3985a8){_0x18ea41=_0x18ea41-0x0;var _0x5f2f90=_0x260d[_0x18ea41];return _0x5f2f90;};'use strict';var Sequelize=require(_0xd260('0x0'));module[_0xd260('0x1')]={'name':{'type':Sequelize[_0xd260('0x2')]},'type':{'type':Sequelize[_0xd260('0x3')](_0xd260('0x4'),_0xd260('0x5'))},'description':{'type':Sequelize[_0xd260('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xd260('0x2')],'comment':_0xd260('0x7')},'active':{'type':Sequelize[_0xd260('0x8')],'defaultValue':0x0,'comment':_0xd260('0x9')},'sidebar':{'type':Sequelize[_0xd260('0x3')](_0xd260('0xa'),_0xd260('0xb'),_0xd260('0xc'),'never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xd260('0x2')]},'adminUrl':{'type':Sequelize[_0xd260('0x2')]},'agentUrl':{'type':Sequelize[_0xd260('0x2')]},'scriptName':{'type':Sequelize[_0xd260('0x2')]},'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 61c6d5e..29a1840 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 _0x23cb=['localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Plugins','UserProfileResource','error','name','Plugin','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','filename','file','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','description','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','eml-format','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','extract-zip','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0xf529ba,_0x47f543){var _0xe7e86e=function(_0x14c828){while(--_0x14c828){_0xf529ba['push'](_0xf529ba['shift']());}};_0xe7e86e(++_0x47f543);}(_0x23cb,0x12e));var _0xb23c=function(_0x10d79b,_0x40e651){_0x10d79b=_0x10d79b-0x0;var _0x348f39=_0x23cb[_0x10d79b];return _0x348f39;};'use strict';var emlformat=require(_0xb23c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb23c('0x1'));var moment=require(_0xb23c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb23c('0x3'));var path=require('path');var sox=require(_0xb23c('0x4'));var csv=require(_0xb23c('0x5'));var ejs=require(_0xb23c('0x6'));var fs=require('fs');var fs_extra=require(_0xb23c('0x7'));var _=require(_0xb23c('0x8'));var squel=require(_0xb23c('0x9'));var crypto=require(_0xb23c('0xa'));var jsforce=require(_0xb23c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb23c('0x5'));var querystring=require(_0xb23c('0xc'));var Papa=require('papaparse');var extract=require(_0xb23c('0xd'));var rimraf=require('rimraf');var archiver=require(_0xb23c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb23c('0xf'));var as=require(_0xb23c('0x10'));var hardwareService=require(_0xb23c('0x11'));var logger=require(_0xb23c('0x12'))(_0xb23c('0x13'));var utils=require(_0xb23c('0x14'));var config=require(_0xb23c('0x15'));var licenseUtil=require(_0xb23c('0x16'));var db=require(_0xb23c('0x17'))['db'];config['redis']=_[_0xb23c('0x18')](config[_0xb23c('0x19')],{'host':_0xb23c('0x1a'),'port':0x18eb});var socket=require(_0xb23c('0x1b'))(new Redis(config[_0xb23c('0x19')]));require(_0xb23c('0x1c'))[_0xb23c('0x1d')](socket);function respondWithStatusCode(_0x3826be,_0x4661ba){_0x4661ba=_0x4661ba||0xcc;return function(_0x2a0981){if(_0x2a0981){return _0x3826be[_0xb23c('0x1e')](_0x4661ba);}return _0x3826be[_0xb23c('0x1f')](_0x4661ba)[_0xb23c('0x20')]();};}function respondWithResult(_0x1c3e49,_0x59a15f){_0x59a15f=_0x59a15f||0xc8;return function(_0x5a79f1){if(_0x5a79f1){return _0x1c3e49['status'](_0x59a15f)[_0xb23c('0x21')](_0x5a79f1);}};}function respondWithFilteredResult(_0x5486f8,_0x544f05){return function(_0x20dfc0){if(_0x20dfc0){var _0x2d63d0=typeof _0x544f05[_0xb23c('0x22')]===_0xb23c('0x23')&&typeof _0x544f05[_0xb23c('0x24')]===_0xb23c('0x23');var _0x19d16e=_0x20dfc0[_0xb23c('0x25')];var _0x327c7a=_0x2d63d0?0x0:_0x544f05[_0xb23c('0x22')];var _0x1ee486=_0x2d63d0?_0x20dfc0[_0xb23c('0x25')]:_0x544f05[_0xb23c('0x22')]+_0x544f05['limit'];var _0x1f8cc3;if(_0x1ee486>=_0x19d16e){_0x1ee486=_0x19d16e;_0x1f8cc3=0xc8;}else{_0x1f8cc3=0xce;}_0x5486f8[_0xb23c('0x1f')](_0x1f8cc3);return _0x5486f8[_0xb23c('0x26')](_0xb23c('0x27'),_0x327c7a+'-'+_0x1ee486+'/'+_0x19d16e)[_0xb23c('0x21')](_0x20dfc0);}return null;};}function patchUpdates(_0x3e49cc){return function(_0x3fe9c2){try{jsonpatch[_0xb23c('0x28')](_0x3fe9c2,_0x3e49cc,!![]);}catch(_0x2c1167){return BPromise['reject'](_0x2c1167);}return _0x3fe9c2[_0xb23c('0x29')]();};}function saveUpdates(_0x2e3440,_0x2f68ee){return function(_0x466ef6){if(_0x466ef6){return _0x466ef6[_0xb23c('0x2a')](_0x2e3440)['then'](function(_0x2b71c2){return _0x2b71c2;});}return null;};}function removeEntity(_0x46a9f6,_0x4dbd6e){return function(_0x10e364){if(_0x10e364){return _0x10e364[_0xb23c('0x2b')]()[_0xb23c('0x2c')](function(){var _0x1fdaca=_0x10e364[_0xb23c('0x2d')]({'plain':!![]});var _0x4c0c04=_0xb23c('0x2e');return db[_0xb23c('0x2f')][_0xb23c('0x2b')]({'where':{'type':_0x4c0c04,'resourceId':_0x1fdaca['id']}})[_0xb23c('0x2c')](function(){return _0x10e364;});})['then'](function(){_0x46a9f6['status'](0xcc)[_0xb23c('0x20')]();});}};}function handleEntityNotFound(_0x14123f,_0xe8aea){return function(_0xba6dc0){if(!_0xba6dc0){_0x14123f['sendStatus'](0x194);}return _0xba6dc0;};}function handleError(_0x488348,_0x84beba){_0x84beba=_0x84beba||0x1f4;return function(_0x5f4c71){logger[_0xb23c('0x30')](_0x5f4c71['stack']);if(_0x5f4c71[_0xb23c('0x31')]){delete _0x5f4c71['name'];}_0x488348[_0xb23c('0x1f')](_0x84beba)['send'](_0x5f4c71);};}exports['index']=function(_0x244cc6,_0x302c57){var _0x523153={},_0x1599d6={},_0x1cb65a={'count':0x0,'rows':[]};var _0x4e296c=_['map'](db[_0xb23c('0x32')][_0xb23c('0x33')],function(_0x2e1a05){return{'name':_0x2e1a05['fieldName'],'type':_0x2e1a05[_0xb23c('0x34')][_0xb23c('0x35')]};});_0x1599d6[_0xb23c('0x36')]=_[_0xb23c('0x37')](_0x4e296c,_0xb23c('0x31'));_0x1599d6['query']=_[_0xb23c('0x38')](_0x244cc6['query']);_0x1599d6[_0xb23c('0x39')]=_[_0xb23c('0x3a')](_0x1599d6[_0xb23c('0x36')],_0x1599d6[_0xb23c('0x3b')]);_0x523153[_0xb23c('0x3c')]=_['intersection'](_0x1599d6[_0xb23c('0x36')],qs[_0xb23c('0x3d')](_0x244cc6['query'][_0xb23c('0x3d')]));_0x523153[_0xb23c('0x3c')]=_0x523153[_0xb23c('0x3c')][_0xb23c('0x3e')]?_0x523153['attributes']:_0x1599d6[_0xb23c('0x36')];if(!_0x244cc6['query'][_0xb23c('0x3f')](_0xb23c('0x40'))){_0x523153[_0xb23c('0x24')]=qs[_0xb23c('0x24')](_0x244cc6[_0xb23c('0x3b')][_0xb23c('0x24')]);_0x523153[_0xb23c('0x22')]=qs[_0xb23c('0x22')](_0x244cc6[_0xb23c('0x3b')][_0xb23c('0x22')]);}_0x523153['order']=qs[_0xb23c('0x41')](_0x244cc6[_0xb23c('0x3b')]['sort']);_0x523153[_0xb23c('0x42')]=qs[_0xb23c('0x39')](_[_0xb23c('0x43')](_0x244cc6[_0xb23c('0x3b')],_0x1599d6[_0xb23c('0x39')]),_0x4e296c);if(_0x244cc6[_0xb23c('0x3b')][_0xb23c('0x44')]){_0x523153[_0xb23c('0x42')]=_[_0xb23c('0x45')](_0x523153[_0xb23c('0x42')],{'$or':_[_0xb23c('0x37')](_0x4e296c,function(_0x53c075){if(_0x53c075['type']!==_0xb23c('0x46')){var _0x3181ee={};_0x3181ee[_0x53c075[_0xb23c('0x31')]]={'$like':'%'+_0x244cc6[_0xb23c('0x3b')][_0xb23c('0x44')]+'%'};return _0x3181ee;}})});}_0x523153=_[_0xb23c('0x45')]({},_0x523153,_0x244cc6['options']);var _0x3add73={'where':_0x523153['where']};return db[_0xb23c('0x32')][_0xb23c('0x25')](_0x3add73)['then'](function(_0x45273a){_0x1cb65a[_0xb23c('0x25')]=_0x45273a;if(_0x244cc6[_0xb23c('0x3b')]['includeAll']){_0x523153[_0xb23c('0x47')]=[{'all':!![]}];}return db[_0xb23c('0x32')][_0xb23c('0x48')](_0x523153);})[_0xb23c('0x2c')](function(_0x5c135d){_0x1cb65a[_0xb23c('0x49')]=_0x5c135d;return _0x1cb65a;})['then'](respondWithFilteredResult(_0x302c57,_0x523153))[_0xb23c('0x4a')](handleError(_0x302c57,null));};exports[_0xb23c('0x4b')]=function(_0x3064ae,_0x2eb678){var _0x4dffa9={'raw':!![],'where':{'id':_0x3064ae[_0xb23c('0x4c')]['id']}},_0x24ba1b={};_0x24ba1b[_0xb23c('0x36')]=_[_0xb23c('0x38')](db['Plugin'][_0xb23c('0x33')]);_0x24ba1b[_0xb23c('0x3b')]=_[_0xb23c('0x38')](_0x3064ae[_0xb23c('0x3b')]);_0x24ba1b[_0xb23c('0x39')]=_['intersection'](_0x24ba1b[_0xb23c('0x36')],_0x24ba1b['query']);_0x4dffa9[_0xb23c('0x3c')]=_[_0xb23c('0x3a')](_0x24ba1b[_0xb23c('0x36')],qs[_0xb23c('0x3d')](_0x3064ae[_0xb23c('0x3b')][_0xb23c('0x3d')]));_0x4dffa9[_0xb23c('0x3c')]=_0x4dffa9[_0xb23c('0x3c')][_0xb23c('0x3e')]?_0x4dffa9[_0xb23c('0x3c')]:_0x24ba1b[_0xb23c('0x36')];if(_0x3064ae[_0xb23c('0x3b')]['includeAll']){_0x4dffa9[_0xb23c('0x47')]=[{'all':!![]}];}_0x4dffa9=_[_0xb23c('0x45')]({},_0x4dffa9,_0x3064ae['options']);return db[_0xb23c('0x32')][_0xb23c('0x4d')](_0x4dffa9)['then'](handleEntityNotFound(_0x2eb678,null))[_0xb23c('0x2c')](respondWithResult(_0x2eb678,null))['catch'](handleError(_0x2eb678,null));};exports[_0xb23c('0x4e')]=function(_0x65da22,_0x26444f,_0x419d62){return db[_0xb23c('0x32')][_0xb23c('0x4d')]({'where':{'id':_0x65da22[_0xb23c('0x4c')]['id']},'attributes':['name',_0xb23c('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x26444f,null))[_0xb23c('0x2c')](function(_0x1636f2){if(_0x1636f2){var _0x4ee7bc=path[_0xb23c('0x50')](config[_0xb23c('0x51')],_0xb23c('0x52'),util[_0xb23c('0x53')](_0xb23c('0x54'),path[_0xb23c('0x55')](_0x1636f2[_0xb23c('0x4f')])));var _0x549761=fs['createWriteStream'](_0x4ee7bc);var _0x706583=archiver('zip',{'zlib':{'level':0x9}});_0x706583['on'](_0xb23c('0x56'),function(_0x2f2bb1){if(_0x2f2bb1[_0xb23c('0x57')]===_0xb23c('0x58')){logger[_0xb23c('0x30')](_0x2f2bb1);}else{throw new db[(_0xb23c('0x59'))][(_0xb23c('0x5a'))](_0xb23c('0x5b'));}});_0x706583['on'](_0xb23c('0x30'),function(_0x580778){throw new db['Sequelize'][(_0xb23c('0x5a'))](_0xb23c('0x5b'));});_0x706583[_0xb23c('0x5c')](_0x549761);_0x706583[_0xb23c('0x5d')](_0xb23c('0x5e'),{'cwd':path['join'](config[_0xb23c('0x51')],_0xb23c('0x52'),path[_0xb23c('0x5f')](_0x1636f2[_0xb23c('0x4f')])),'ignore':[path['join'](path[_0xb23c('0x55')](_0x1636f2[_0xb23c('0x4f')]),_0xb23c('0x60')),path[_0xb23c('0x50')](path[_0xb23c('0x55')](_0x1636f2['path']),_0xb23c('0x61'))],'nodir':!![]})['finalize']();_0x549761['on'](_0xb23c('0x62'),function(){if(!fs['existsSync'](_0x4ee7bc)){throw new db[(_0xb23c('0x59'))][(_0xb23c('0x5a'))](_0xb23c('0x63'));}return _0x26444f[_0xb23c('0x4e')](_0x4ee7bc,util['format']('%s.zip',path[_0xb23c('0x55')](_0x1636f2[_0xb23c('0x4f')])),function(_0xeda1ce){if(_0xeda1ce){throw new db[(_0xb23c('0x59'))][(_0xb23c('0x5a'))](_0xb23c('0x64'));}fs['unlinkSync'](_0x4ee7bc);logger[_0xb23c('0x65')](_0xb23c('0x66'));logger['info'](_0xb23c('0x67'));});});}return null;})['catch'](handleError(_0x26444f,null));};exports['upload']=function(_0x44620d,_0x2e9a39,_0x2abb1e){var _0x243f32=path['basename'](_0x44620d['file'][_0xb23c('0x68')],path['extname'](_0x44620d[_0xb23c('0x69')][_0xb23c('0x68')]));var _0x7b82ca=path[_0xb23c('0x50')](config[_0xb23c('0x51')],_0xb23c('0x52'),_0x44620d[_0xb23c('0x69')][_0xb23c('0x68')]);var _0x49fc9e=path[_0xb23c('0x50')](config['root'],_0xb23c('0x52'),_0x243f32);logger[_0xb23c('0x65')](_0xb23c('0x6a'),_0x7b82ca);logger[_0xb23c('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x49fc9e);try{fs[_0xb23c('0x6b')](_0x7b82ca,parseInt(_0xb23c('0x6c'),0x8));extract(_0x7b82ca,{'dir':_0x49fc9e},function(_0x3d7b89){if(_0x3d7b89){logger[_0xb23c('0x30')](_0x3d7b89);handleError(_0x3d7b89,!![]);};var _0x285818=fs['readdirSync'](_0x49fc9e);if(_0x285818[_0xb23c('0x3e')]>0x1){removeReferences(_0x7b82ca,_0x49fc9e);logger[_0xb23c('0x30')](_0xb23c('0x6d'));return _0x2abb1e(new Error(_0xb23c('0x6d')));}var _0x3b5f3b=fs[_0xb23c('0x6e')](path[_0xb23c('0x50')](_0x49fc9e,_0x285818[0x0]));if(_0x3b5f3b['isFile']()){removeReferences(_0x7b82ca,_0x49fc9e);logger[_0xb23c('0x30')](_0xb23c('0x6d'));return _0x2abb1e(new Error(_0xb23c('0x6d')));}if(_0x3b5f3b[_0xb23c('0x6f')]()){var _0x1c4ac1=fs[_0xb23c('0x70')](path[_0xb23c('0x50')](_0x49fc9e,_0x285818[0x0]));if(_0x1c4ac1['length']===0x0){removeReferences(_0x7b82ca,_0x49fc9e);logger[_0xb23c('0x30')](_0xb23c('0x6d'));return _0x2abb1e(new Error('Invalid\x20plugin\x20structure'));}var _0x3b6ecb=_0x1c4ac1[_0xb23c('0x71')](function(_0x5ac7ba){return _0x5ac7ba==='manifest.json';});if(!_0x3b6ecb){return _0x2abb1e(new Error(_0xb23c('0x72')));}var _0x25b546=fs[_0xb23c('0x73')](path[_0xb23c('0x50')](_0x49fc9e,_0x285818[0x0],'manifest.json'));var _0x46e223=JSON['parse'](_0x25b546);if('undefined'==typeof _0x46e223[_0xb23c('0x31')]){return _0x2abb1e(new Error(_0xb23c('0x74')));}if(_0xb23c('0x23')==typeof _0x46e223[_0xb23c('0x34')]){return _0x2abb1e(new Error(_0xb23c('0x75')));}if(_0xb23c('0x23')==typeof _0x46e223['version']){return _0x2abb1e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xb23c('0x23')==typeof _0x46e223[_0xb23c('0x76')]){return _0x2abb1e(new Error(_0xb23c('0x77')));}if(_0x46e223[_0xb23c('0x34')]===_0xb23c('0x78')){if(_0xb23c('0x23')==typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]){return _0x2abb1e(new Error(_0xb23c('0x7a')));}if(_0xb23c('0x23')==typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')][_0xb23c('0x7b')]&&_0xb23c('0x23')==typeof _0x46e223['parameters'][_0xb23c('0x79')][_0xb23c('0x7c')]){return _0x2abb1e(new Error(_0xb23c('0x7d')));}}else if(_0x46e223[_0xb23c('0x34')]===_0xb23c('0x7e')){if(_0xb23c('0x23')==typeof _0x46e223[_0xb23c('0x76')]['scriptName']){return _0x2abb1e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xb23c('0x23')==typeof _0x46e223['parameters'][_0xb23c('0x7f')]){return _0x2abb1e(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2abb1e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4760c6=_0x46e223['name'];var _0x1e1abc=_0x46e223[_0xb23c('0x80')];var _0xcd4339=_0x46e223['type'];var _0x41408b=_0x46e223['sidebar']?_0x46e223['sidebar']:_0xb23c('0x81');var _0x209a4b=_0x46e223[_0xb23c('0x82')]?_0x46e223[_0xb23c('0x82')]:_0xb23c('0x83');var _0x482492='';var _0x41e744='';var _0x1eb2d9='';var _0x156a99='';var _0x2fbfa2=_0x46e223[_0xb23c('0x84')];if(_0xcd4339===_0xb23c('0x78')){if('undefined'!=typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]['admin']){var _0x638d3=_0x46e223['parameters'][_0xb23c('0x79')][_0xb23c('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb23c('0x85')](_0x638d3)){_0x482492=path[_0xb23c('0x50')](_0xb23c('0x86'),_0x243f32,_0x285818[0x0],_0x638d3);}else{_0x482492=_0x638d3;}}else{logger[_0xb23c('0x65')](_0xb23c('0x87'));}if('undefined'!=typeof _0x46e223[_0xb23c('0x76')]['views']['agent']){var _0x3a72b3=_0x46e223[_0xb23c('0x76')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb23c('0x85')](_0x3a72b3)){_0x41e744=path['join']('plugins',_0x243f32,_0x285818[0x0],_0x3a72b3);}else{_0x41e744=_0x3a72b3;}}else{logger[_0xb23c('0x65')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xcd4339===_0xb23c('0x7e')){_0x1eb2d9=_0x46e223[_0xb23c('0x76')][_0xb23c('0x88')];_0x156a99=_0x46e223[_0xb23c('0x76')][_0xb23c('0x7f')];if(_0xb23c('0x23')!=typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]){if(_0xb23c('0x23')!=typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')][_0xb23c('0x7b')]){var _0x638d3=_0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb23c('0x85')](_0x638d3)){_0x482492=path['join']('plugins',_0x243f32,_0x285818[0x0],_0x638d3);}else{_0x482492=_0x638d3;}}if('undefined'!=typeof _0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]['agent']){var _0x3a72b3=_0x46e223[_0xb23c('0x76')][_0xb23c('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb23c('0x85')](_0x3a72b3)){_0x41e744=path[_0xb23c('0x50')](_0xb23c('0x86'),_0x243f32,_0x285818[0x0],_0x3a72b3);}else{_0x41e744=_0x3a72b3;}}}}var _0x533253={'name':_0x4760c6,'description':_0x1e1abc,'path':path['join'](_0x243f32,_0x285818[0x0]),'type':_0xcd4339,'sidebar':_0x41408b,'icon':_0x209a4b,'adminUrl':_0x482492,'agentUrl':_0x41e744,'scriptName':_0x1eb2d9,'scriptPath':_0x156a99,'version':_0x2fbfa2};removeReferences(_0x7b82ca,null);return db[_0xb23c('0x32')][_0xb23c('0x89')](_0x533253)['then'](function(_0x418f68){var _0x4c4fc8={'role':_0x44620d[_0xb23c('0x8a')][_0xb23c('0x8b')],'userProfileId':_0x44620d[_0xb23c('0x8a')]['userProfileId']};if(!_0x4c4fc8)throw new Error(_0xb23c('0x8c'));if(_0x4c4fc8[_0xb23c('0x8b')]===_0xb23c('0x8d')){var _0x5888a6=_0x418f68['get']({'plain':!![]});return db[_0xb23c('0x8e')]['find']({'where':{'name':_0xb23c('0x2e'),'userProfileId':_0x4c4fc8[_0xb23c('0x8f')]},'raw':!![]})[_0xb23c('0x2c')](function(_0x367298){if(_0x367298&&_0x367298['autoAssociation']===0x0){return db[_0xb23c('0x2f')][_0xb23c('0x89')]({'name':_0x5888a6['name'],'resourceId':_0x5888a6['id'],'type':_0x367298['name'],'sectionId':_0x367298['id']},{})[_0xb23c('0x2c')](function(){return _0x418f68;});}else{return _0x418f68;}})[_0xb23c('0x4a')](function(_0x17aa7c){logger['error'](_0xb23c('0x90'),_0x17aa7c);throw _0x17aa7c;});}return _0x418f68;})[_0xb23c('0x2c')](respondWithResult(_0x2e9a39,null))[_0xb23c('0x4a')](handleError(_0x2e9a39,null));}});}catch(_0x1be0ab){_0x2e9a39['status'](0x1f4)[_0xb23c('0x91')](_0x1be0ab);}};function removeReferences(_0x34ded4,_0x3f8b6c){try{if(_0x34ded4){fs[_0xb23c('0x92')](_0x34ded4);logger[_0xb23c('0x65')](_0xb23c('0x93'));}if(_0x3f8b6c){rimraf(_0x3f8b6c,function(){});logger[_0xb23c('0x65')](_0xb23c('0x94'));}}catch(_0x2ffe76){logger[_0xb23c('0x30')](_0x2ffe76);}}exports['update']=function(_0xdbbb,_0x5aeade,_0x41daad){return db[_0xb23c('0x32')][_0xb23c('0x4d')]({'where':{'id':_0xdbbb[_0xb23c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5aeade,null))[_0xb23c('0x2c')](saveUpdates(_0xdbbb['body'],null))[_0xb23c('0x2c')](respondWithResult(_0x5aeade,null))[_0xb23c('0x4a')](handleError(_0x5aeade,null));};exports['delete']=function(_0x5d89f4,_0x57be13,_0x545ab){return db['Plugin'][_0xb23c('0x4d')]({'where':{'id':_0x5d89f4[_0xb23c('0x4c')]['id']}})[_0xb23c('0x2c')](function(_0x590043){if(_0x590043){return _0x590043['destroy']();}})[_0xb23c('0x2c')](function(_0x54a08c){rimraf(path[_0xb23c('0x50')](config[_0xb23c('0x51')],_0xb23c('0x52'),path[_0xb23c('0x5f')](_0x54a08c[_0xb23c('0x4f')])),function(){});return _0x54a08c;})[_0xb23c('0x2c')](handleEntityNotFound(_0x57be13,null))[_0xb23c('0x2c')](respondWithStatusCode(_0x57be13,null))[_0xb23c('0x4a')](handleError(_0x57be13,null));};exports[_0xb23c('0x95')]=function(_0x29b59f,_0x1a9153,_0x5964fa){return BPromise[_0xb23c('0x96')]()[_0xb23c('0x2c')](function(){if(!_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x97')]){throw new Error(_0xb23c('0x98'));}var _0x3469b7=_0x29b59f[_0xb23c('0x3b')]['hostname']?_0x29b59f[_0xb23c('0x3b')]['hostname']+':'+_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x97')]:_0xb23c('0x99')+_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x97')];var _0x4b1019=_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x21')]?_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x21')]:!![];var _0x40c369=_0x29b59f['query'][_0xb23c('0x9a')]?_0x29b59f[_0xb23c('0x3b')]['encoding']:null;var _0x48d6fb={'method':_0x29b59f['method'],'uri':util[_0xb23c('0x53')](_0xb23c('0x9b'),_0x3469b7,_0x29b59f[_0xb23c('0x3b')][_0xb23c('0x4f')]),'json':_0x4b1019,'resolveWithFullResponse':!![],'encoding':_0x40c369,'qs':_0x29b59f[_0xb23c('0x3b')]};if(_0x29b59f[_0xb23c('0x9c')]){_0x48d6fb[_0xb23c('0x9c')]=_0x29b59f[_0xb23c('0x9c')];if(_0x48d6fb[_0xb23c('0x9c')][_0xb23c('0x9d')]){delete _0x48d6fb[_0xb23c('0x9c')][_0xb23c('0x9d')];}}if(_0x48d6fb[_0xb23c('0x9c')][_0xb23c('0x9e')]){delete _0x48d6fb[_0xb23c('0x9c')][_0xb23c('0x9e')];}return rp(_0x48d6fb);})[_0xb23c('0x2c')](function(_0x4cdc56){if(_0x4cdc56){_0x1a9153[_0xb23c('0x26')](_0x4cdc56[_0xb23c('0x9c')]);logger[_0xb23c('0x65')](_0x4cdc56[_0xb23c('0x8a')]);if(_[_0xb23c('0x9f')](_0x29b59f['query'][_0xb23c('0x4f')],'download')&&_0x4cdc56['statusCode']==0x1f4){return _0x1a9153[_0xb23c('0x1e')](_0x4cdc56[_0xb23c('0xa0')]);}else{return _0x1a9153['status'](_0x4cdc56['statusCode'])[_0xb23c('0x91')](_0x4cdc56[_0xb23c('0x8a')]);}}else{return _0x1a9153['sendStatus'](0xc8);}})['catch'](handleError(_0x1a9153,null));};exports[_0xb23c('0xa1')]=function(_0x5eb539,_0x21ab84,_0x13afd4){return BPromise[_0xb23c('0x96')]()[_0xb23c('0x2c')](function(){if(!_0x5eb539['query']['path']){throw new Error(_0xb23c('0xa2'));}if(!_0x5eb539[_0xb23c('0x3b')]['port']){throw new Error(_0xb23c('0x98'));}var _0x47f9e3=_0x5eb539[_0xb23c('0x3b')][_0xb23c('0xa3')]?_0x5eb539[_0xb23c('0x3b')]['hostname']+':'+_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x97')]:_0xb23c('0x99')+_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x97')];var _0x51367b=_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x21')]?_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x21')]:!![];var _0xae06e1=_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x9a')]?_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x9a')]:null;var _0x44f5f3={'method':_0x5eb539['method'],'uri':util[_0xb23c('0x53')](_0xb23c('0x9b'),_0x47f9e3,_0x5eb539[_0xb23c('0x3b')][_0xb23c('0x4f')]),'json':_0x51367b,'resolveWithFullResponse':!![],'encoding':_0xae06e1,'body':_0x5eb539[_0xb23c('0x8a')]};if(_0x5eb539[_0xb23c('0x9c')]){_0x44f5f3['headers']=_0x5eb539[_0xb23c('0x9c')];if(_0x44f5f3[_0xb23c('0x9c')]['content-length']){delete _0x44f5f3[_0xb23c('0x9c')][_0xb23c('0x9d')];}}if(_0x44f5f3['headers'][_0xb23c('0x9e')]){delete _0x44f5f3[_0xb23c('0x9c')]['content-type'];}return rp(_0x44f5f3);})[_0xb23c('0x2c')](function(_0x5d84b1){if(_0x5d84b1){_0x21ab84[_0xb23c('0x26')](_0x5d84b1[_0xb23c('0x9c')]);logger[_0xb23c('0x65')](_0x5d84b1[_0xb23c('0x8a')]);return _0x21ab84[_0xb23c('0x1f')](_0x5d84b1[_0xb23c('0xa0')])[_0xb23c('0x91')](_0x5d84b1['body']);}else{return _0x21ab84[_0xb23c('0x1e')](0xc8);}})[_0xb23c('0x4a')](handleError(_0x21ab84,null));}; \ No newline at end of file +var _0x3c36=['then','destroy','get','Plugins','UserProfileResource','stack','name','index','map','Plugin','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','params','rawAttributes','includeAll','find','download','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','send','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','reject','save','update'];(function(_0x5c4632,_0x3db302){var _0x3347ac=function(_0x392128){while(--_0x392128){_0x5c4632['push'](_0x5c4632['shift']());}};_0x3347ac(++_0x3db302);}(_0x3c36,0x7f));var _0x63c3=function(_0x36626d,_0x33482d){_0x36626d=_0x36626d-0x0;var _0x4346a5=_0x3c36[_0x36626d];return _0x4346a5;};'use strict';var emlformat=require(_0x63c3('0x0'));var rimraf=require(_0x63c3('0x1'));var zipdir=require(_0x63c3('0x2'));var jsonpatch=require(_0x63c3('0x3'));var rp=require(_0x63c3('0x4'));var moment=require(_0x63c3('0x5'));var BPromise=require(_0x63c3('0x6'));var Mustache=require(_0x63c3('0x7'));var util=require(_0x63c3('0x8'));var path=require(_0x63c3('0x9'));var sox=require('sox');var csv=require(_0x63c3('0xa'));var ejs=require(_0x63c3('0xb'));var fs=require('fs');var fs_extra=require(_0x63c3('0xc'));var _=require(_0x63c3('0xd'));var squel=require(_0x63c3('0xe'));var crypto=require(_0x63c3('0xf'));var jsforce=require(_0x63c3('0x10'));var deskjs=require(_0x63c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x63c3('0x12'));var Papa=require(_0x63c3('0x13'));var extract=require(_0x63c3('0x14'));var rimraf=require(_0x63c3('0x1'));var archiver=require(_0x63c3('0x15'));var Redis=require(_0x63c3('0x16'));var authService=require(_0x63c3('0x17'));var qs=require(_0x63c3('0x18'));var as=require(_0x63c3('0x19'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63c3('0x1a'))(_0x63c3('0x1b'));var utils=require(_0x63c3('0x1c'));var config=require(_0x63c3('0x1d'));var licenseUtil=require(_0x63c3('0x1e'));var db=require('../../mysqldb')['db'];config[_0x63c3('0x1f')]=_[_0x63c3('0x20')](config['redis'],{'host':_0x63c3('0x21'),'port':0x18eb});var socket=require(_0x63c3('0x22'))(new Redis(config['redis']));require('./plugin.socket')[_0x63c3('0x23')](socket);function respondWithStatusCode(_0x5a2583,_0x387403){_0x387403=_0x387403||0xcc;return function(_0x2369a8){if(_0x2369a8){return _0x5a2583[_0x63c3('0x24')](_0x387403);}return _0x5a2583[_0x63c3('0x25')](_0x387403)[_0x63c3('0x26')]();};}function respondWithResult(_0x2b2b06,_0x361a43){_0x361a43=_0x361a43||0xc8;return function(_0x7a19de){if(_0x7a19de){return _0x2b2b06['status'](_0x361a43)[_0x63c3('0x27')](_0x7a19de);}};}function respondWithFilteredResult(_0x38d987,_0x2ba6a2){return function(_0x1af8a9){if(_0x1af8a9){var _0x26cec9=typeof _0x2ba6a2[_0x63c3('0x28')]==='undefined'&&typeof _0x2ba6a2[_0x63c3('0x29')]==='undefined';var _0x1491b3=_0x1af8a9[_0x63c3('0x2a')];var _0x57da77=_0x26cec9?0x0:_0x2ba6a2[_0x63c3('0x28')];var _0x8fb0cc=_0x26cec9?_0x1af8a9[_0x63c3('0x2a')]:_0x2ba6a2[_0x63c3('0x28')]+_0x2ba6a2['limit'];var _0x7e48ac;if(_0x8fb0cc>=_0x1491b3){_0x8fb0cc=_0x1491b3;_0x7e48ac=0xc8;}else{_0x7e48ac=0xce;}_0x38d987['status'](_0x7e48ac);return _0x38d987[_0x63c3('0x2b')]('Content-Range',_0x57da77+'-'+_0x8fb0cc+'/'+_0x1491b3)[_0x63c3('0x27')](_0x1af8a9);}return null;};}function patchUpdates(_0x2facc6){return function(_0x4834ea){try{jsonpatch['apply'](_0x4834ea,_0x2facc6,!![]);}catch(_0x4666c6){return BPromise[_0x63c3('0x2c')](_0x4666c6);}return _0x4834ea[_0x63c3('0x2d')]();};}function saveUpdates(_0x31195b,_0x41f2a4){return function(_0x11a563){if(_0x11a563){return _0x11a563[_0x63c3('0x2e')](_0x31195b)[_0x63c3('0x2f')](function(_0x334daf){return _0x334daf;});}return null;};}function removeEntity(_0x2f69e8,_0x434842){return function(_0x3f4885){if(_0x3f4885){return _0x3f4885[_0x63c3('0x30')]()[_0x63c3('0x2f')](function(){var _0x16cdb7=_0x3f4885[_0x63c3('0x31')]({'plain':!![]});var _0x442405=_0x63c3('0x32');return db[_0x63c3('0x33')][_0x63c3('0x30')]({'where':{'type':_0x442405,'resourceId':_0x16cdb7['id']}})[_0x63c3('0x2f')](function(){return _0x3f4885;});})[_0x63c3('0x2f')](function(){_0x2f69e8[_0x63c3('0x25')](0xcc)[_0x63c3('0x26')]();});}};}function handleEntityNotFound(_0x533a4a,_0x5ef55b){return function(_0x5944cf){if(!_0x5944cf){_0x533a4a[_0x63c3('0x24')](0x194);}return _0x5944cf;};}function handleError(_0x3ebf10,_0x508cf4){_0x508cf4=_0x508cf4||0x1f4;return function(_0x40b262){logger['error'](_0x40b262[_0x63c3('0x34')]);if(_0x40b262[_0x63c3('0x35')]){delete _0x40b262[_0x63c3('0x35')];}_0x3ebf10[_0x63c3('0x25')](_0x508cf4)['send'](_0x40b262);};}exports[_0x63c3('0x36')]=function(_0x537024,_0x259493){var _0x10751a={},_0x509c3b={},_0x3e89cf={'count':0x0,'rows':[]};var _0xa4d33f=_[_0x63c3('0x37')](db[_0x63c3('0x38')]['rawAttributes'],function(_0x55353e){return{'name':_0x55353e['fieldName'],'type':_0x55353e[_0x63c3('0x39')][_0x63c3('0x3a')]};});_0x509c3b[_0x63c3('0x3b')]=_[_0x63c3('0x37')](_0xa4d33f,'name');_0x509c3b['query']=_[_0x63c3('0x3c')](_0x537024[_0x63c3('0x3d')]);_0x509c3b['filters']=_[_0x63c3('0x3e')](_0x509c3b['model'],_0x509c3b['query']);_0x10751a[_0x63c3('0x3f')]=_[_0x63c3('0x3e')](_0x509c3b['model'],qs['fields'](_0x537024[_0x63c3('0x3d')][_0x63c3('0x40')]));_0x10751a['attributes']=_0x10751a[_0x63c3('0x3f')][_0x63c3('0x41')]?_0x10751a['attributes']:_0x509c3b[_0x63c3('0x3b')];if(!_0x537024[_0x63c3('0x3d')]['hasOwnProperty'](_0x63c3('0x42'))){_0x10751a[_0x63c3('0x29')]=qs[_0x63c3('0x29')](_0x537024[_0x63c3('0x3d')][_0x63c3('0x29')]);_0x10751a[_0x63c3('0x28')]=qs[_0x63c3('0x28')](_0x537024[_0x63c3('0x3d')][_0x63c3('0x28')]);}_0x10751a['order']=qs[_0x63c3('0x43')](_0x537024[_0x63c3('0x3d')]['sort']);_0x10751a[_0x63c3('0x44')]=qs[_0x63c3('0x45')](_[_0x63c3('0x46')](_0x537024['query'],_0x509c3b['filters']),_0xa4d33f);if(_0x537024[_0x63c3('0x3d')][_0x63c3('0x47')]){_0x10751a[_0x63c3('0x44')]=_[_0x63c3('0x48')](_0x10751a[_0x63c3('0x44')],{'$or':_[_0x63c3('0x37')](_0xa4d33f,function(_0x5bb8cd){if(_0x5bb8cd[_0x63c3('0x39')]!==_0x63c3('0x49')){var _0x1f3338={};_0x1f3338[_0x5bb8cd[_0x63c3('0x35')]]={'$like':'%'+_0x537024[_0x63c3('0x3d')][_0x63c3('0x47')]+'%'};return _0x1f3338;}})});}_0x10751a=_['merge']({},_0x10751a,_0x537024[_0x63c3('0x4a')]);var _0x5b0c07={'where':_0x10751a[_0x63c3('0x44')]};return db[_0x63c3('0x38')][_0x63c3('0x2a')](_0x5b0c07)['then'](function(_0x129686){_0x3e89cf[_0x63c3('0x2a')]=_0x129686;if(_0x537024[_0x63c3('0x3d')]['includeAll']){_0x10751a['include']=[{'all':!![]}];}return db[_0x63c3('0x38')][_0x63c3('0x4b')](_0x10751a);})['then'](function(_0x260ab7){_0x3e89cf['rows']=_0x260ab7;return _0x3e89cf;})[_0x63c3('0x2f')](respondWithFilteredResult(_0x259493,_0x10751a))[_0x63c3('0x4c')](handleError(_0x259493,null));};exports['show']=function(_0xfc14eb,_0x3da667){var _0x1c7b93={'raw':!![],'where':{'id':_0xfc14eb[_0x63c3('0x4d')]['id']}},_0x533a0a={};_0x533a0a[_0x63c3('0x3b')]=_[_0x63c3('0x3c')](db[_0x63c3('0x38')][_0x63c3('0x4e')]);_0x533a0a['query']=_[_0x63c3('0x3c')](_0xfc14eb[_0x63c3('0x3d')]);_0x533a0a[_0x63c3('0x45')]=_['intersection'](_0x533a0a['model'],_0x533a0a[_0x63c3('0x3d')]);_0x1c7b93[_0x63c3('0x3f')]=_[_0x63c3('0x3e')](_0x533a0a[_0x63c3('0x3b')],qs[_0x63c3('0x40')](_0xfc14eb['query'][_0x63c3('0x40')]));_0x1c7b93['attributes']=_0x1c7b93[_0x63c3('0x3f')][_0x63c3('0x41')]?_0x1c7b93[_0x63c3('0x3f')]:_0x533a0a[_0x63c3('0x3b')];if(_0xfc14eb[_0x63c3('0x3d')][_0x63c3('0x4f')]){_0x1c7b93['include']=[{'all':!![]}];}_0x1c7b93=_['merge']({},_0x1c7b93,_0xfc14eb[_0x63c3('0x4a')]);return db['Plugin'][_0x63c3('0x50')](_0x1c7b93)[_0x63c3('0x2f')](handleEntityNotFound(_0x3da667,null))[_0x63c3('0x2f')](respondWithResult(_0x3da667,null))[_0x63c3('0x4c')](handleError(_0x3da667,null));};exports[_0x63c3('0x51')]=function(_0x42dc5a,_0x2d3b9a,_0xaed956){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x42dc5a[_0x63c3('0x4d')]['id']},'attributes':[_0x63c3('0x35'),_0x63c3('0x9')],'raw':!![]})[_0x63c3('0x2f')](handleEntityNotFound(_0x2d3b9a,null))[_0x63c3('0x2f')](function(_0x2bdb0a){if(_0x2bdb0a){var _0x553cf9=path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),util[_0x63c3('0x55')](_0x63c3('0x56'),path[_0x63c3('0x57')](_0x2bdb0a['path'])));var _0x58c56d=fs['createWriteStream'](_0x553cf9);var _0x18ccc6=archiver(_0x63c3('0x58'),{'zlib':{'level':0x9}});_0x18ccc6['on'](_0x63c3('0x59'),function(_0x2bd26d){if(_0x2bd26d[_0x63c3('0x5a')]===_0x63c3('0x5b')){logger[_0x63c3('0x5c')](_0x2bd26d);}else{throw new db['Sequelize'][(_0x63c3('0x5d'))](_0x63c3('0x5e'));}});_0x18ccc6['on']('error',function(_0x37b83d){throw new db[(_0x63c3('0x5f'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x18ccc6[_0x63c3('0x60')](_0x58c56d);_0x18ccc6[_0x63c3('0x61')](_0x63c3('0x62'),{'cwd':path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),path[_0x63c3('0x63')](_0x2bdb0a[_0x63c3('0x9')])),'ignore':[path[_0x63c3('0x52')](path[_0x63c3('0x57')](_0x2bdb0a[_0x63c3('0x9')]),'node_modules/**/*'),path['join'](path['basename'](_0x2bdb0a[_0x63c3('0x9')]),'attachments/**/*')],'nodir':!![]})[_0x63c3('0x64')]();_0x58c56d['on'](_0x63c3('0x65'),function(){if(!fs[_0x63c3('0x66')](_0x553cf9)){throw new db[(_0x63c3('0x5f'))]['Error'](_0x63c3('0x67'));}return _0x2d3b9a[_0x63c3('0x51')](_0x553cf9,util[_0x63c3('0x55')](_0x63c3('0x56'),path[_0x63c3('0x57')](_0x2bdb0a[_0x63c3('0x9')])),function(_0xa5c0ef){if(_0xa5c0ef){throw new db['Sequelize'][(_0x63c3('0x5d'))](_0x63c3('0x68'));}fs[_0x63c3('0x69')](_0x553cf9);logger[_0x63c3('0x6a')](_0x63c3('0x6b'));logger[_0x63c3('0x6a')](_0x63c3('0x6c'));});});}return null;})['catch'](handleError(_0x2d3b9a,null));};exports[_0x63c3('0x6d')]=function(_0x5579a5,_0x59f648,_0x1eb85f){var _0x2412b3=path[_0x63c3('0x57')](_0x5579a5[_0x63c3('0x6e')][_0x63c3('0x6f')],path[_0x63c3('0x70')](_0x5579a5['file'][_0x63c3('0x6f')]));var _0x2e3a76=path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),_0x5579a5[_0x63c3('0x6e')]['filename']);var _0x4f4964=path['join'](config['root'],_0x63c3('0x54'),_0x2412b3);logger[_0x63c3('0x6a')]('Plugin\x20upload\x20filepath:\x20%s',_0x2e3a76);logger[_0x63c3('0x6a')](_0x63c3('0x71'),_0x4f4964);try{fs[_0x63c3('0x72')](_0x2e3a76,parseInt(_0x63c3('0x73'),0x8));extract(_0x2e3a76,{'dir':_0x4f4964},function(_0x46f5b9){if(_0x46f5b9){logger[_0x63c3('0x5c')](_0x46f5b9);handleError(_0x46f5b9,!![]);};var _0x506bc9=fs[_0x63c3('0x74')](_0x4f4964);if(_0x506bc9[_0x63c3('0x41')]>0x1){removeReferences(_0x2e3a76,_0x4f4964);logger['error'](_0x63c3('0x75'));return _0x1eb85f(new Error(_0x63c3('0x75')));}var _0x2ceab6=fs[_0x63c3('0x76')](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0]));if(_0x2ceab6[_0x63c3('0x77')]()){removeReferences(_0x2e3a76,_0x4f4964);logger[_0x63c3('0x5c')](_0x63c3('0x75'));return _0x1eb85f(new Error('Invalid\x20plugin\x20structure'));}if(_0x2ceab6[_0x63c3('0x78')]()){var _0xd554f8=fs['readdirSync'](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0]));if(_0xd554f8['length']===0x0){removeReferences(_0x2e3a76,_0x4f4964);logger[_0x63c3('0x5c')](_0x63c3('0x75'));return _0x1eb85f(new Error(_0x63c3('0x75')));}var _0x4c3543=_0xd554f8[_0x63c3('0x79')](function(_0x15e88a){return _0x15e88a===_0x63c3('0x7a');});if(!_0x4c3543){return _0x1eb85f(new Error('Plugin\x20manifest\x20missing'));}var _0x22c92c=fs['readFileSync'](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0],'manifest.json'));var _0x389414=JSON[_0x63c3('0x7b')](_0x22c92c);if('undefined'==typeof _0x389414[_0x63c3('0x35')]){return _0x1eb85f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x39')]){return _0x1eb85f(new Error(_0x63c3('0x7d')));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x7e')]){return _0x1eb85f(new Error(_0x63c3('0x7f')));}if('undefined'==typeof _0x389414['parameters']){return _0x1eb85f(new Error(_0x63c3('0x80')));}if(_0x389414[_0x63c3('0x39')]===_0x63c3('0x81')){if('undefined'==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]){return _0x1eb85f(new Error(_0x63c3('0x84')));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]['admin']&&'undefined'==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]['agent']){return _0x1eb85f(new Error(_0x63c3('0x85')));}}else if(_0x389414[_0x63c3('0x39')]===_0x63c3('0x86')){if(_0x63c3('0x7c')==typeof _0x389414['parameters'][_0x63c3('0x87')]){return _0x1eb85f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x88')]){return _0x1eb85f(new Error(_0x63c3('0x89')));}}else{return _0x1eb85f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3b3dbd=_0x389414[_0x63c3('0x35')];var _0x17e191=_0x389414[_0x63c3('0x8a')];var _0x4b9f04=_0x389414[_0x63c3('0x39')];var _0x5e0784=_0x389414[_0x63c3('0x8b')]?_0x389414[_0x63c3('0x8b')]:_0x63c3('0x8c');var _0x18a443=_0x389414['icon']?_0x389414[_0x63c3('0x8d')]:_0x63c3('0x8e');var _0x2fbc4b='';var _0x52e66f='';var _0x143fd1='';var _0x306750='';var _0x83ed62=_0x389414[_0x63c3('0x7e')];if(_0x4b9f04===_0x63c3('0x81')){if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')]){var _0x2126aa=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x2126aa)){_0x2fbc4b=path[_0x63c3('0x52')](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x2126aa);}else{_0x2fbc4b=_0x2126aa;}}else{logger[_0x63c3('0x6a')](_0x63c3('0x92'));}if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')]){var _0x341c81=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x341c81)){_0x52e66f=path['join'](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x341c81);}else{_0x52e66f=_0x341c81;}}else{logger[_0x63c3('0x6a')](_0x63c3('0x94'));}}else if(_0x4b9f04===_0x63c3('0x86')){_0x143fd1=_0x389414['parameters'][_0x63c3('0x87')];_0x306750=_0x389414[_0x63c3('0x82')][_0x63c3('0x88')];if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]){if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')]){var _0x2126aa=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2126aa)){_0x2fbc4b=path[_0x63c3('0x52')](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x2126aa);}else{_0x2fbc4b=_0x2126aa;}}if('undefined'!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')]){var _0x341c81=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x341c81)){_0x52e66f=path['join'](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x341c81);}else{_0x52e66f=_0x341c81;}}}}var _0x3e4d9b={'name':_0x3b3dbd,'description':_0x17e191,'path':path[_0x63c3('0x52')](_0x2412b3,_0x506bc9[0x0]),'type':_0x4b9f04,'sidebar':_0x5e0784,'icon':_0x18a443,'adminUrl':_0x2fbc4b,'agentUrl':_0x52e66f,'scriptName':_0x143fd1,'scriptPath':_0x306750,'version':_0x83ed62};removeReferences(_0x2e3a76,null);return db[_0x63c3('0x38')][_0x63c3('0x95')](_0x3e4d9b)[_0x63c3('0x2f')](function(_0x2dfb6a){var _0x331669={'role':_0x5579a5['body']['role'],'userProfileId':_0x5579a5[_0x63c3('0x96')][_0x63c3('0x97')]};if(!_0x331669)throw new Error(_0x63c3('0x98'));if(_0x331669[_0x63c3('0x99')]===_0x63c3('0x9a')){var _0x2e0900=_0x2dfb6a[_0x63c3('0x31')]({'plain':!![]});return db[_0x63c3('0x9b')][_0x63c3('0x50')]({'where':{'name':_0x63c3('0x32'),'userProfileId':_0x331669[_0x63c3('0x97')]},'raw':!![]})[_0x63c3('0x2f')](function(_0x461a51){if(_0x461a51&&_0x461a51[_0x63c3('0x9c')]===0x0){return db[_0x63c3('0x33')][_0x63c3('0x95')]({'name':_0x2e0900[_0x63c3('0x35')],'resourceId':_0x2e0900['id'],'type':_0x461a51[_0x63c3('0x35')],'sectionId':_0x461a51['id']},{})[_0x63c3('0x2f')](function(){return _0x2dfb6a;});}else{return _0x2dfb6a;}})[_0x63c3('0x4c')](function(_0x142e44){logger[_0x63c3('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x142e44);throw _0x142e44;});}return _0x2dfb6a;})[_0x63c3('0x2f')](respondWithResult(_0x59f648,null))['catch'](handleError(_0x59f648,null));}});}catch(_0xf7c7d8){_0x59f648['status'](0x1f4)[_0x63c3('0x9d')](_0xf7c7d8);}};function removeReferences(_0x47346a,_0xb769b){try{if(_0x47346a){fs[_0x63c3('0x69')](_0x47346a);logger[_0x63c3('0x6a')]('Zip\x20archive\x20removed');}if(_0xb769b){rimraf(_0xb769b,function(){});logger['info'](_0x63c3('0x9e'));}}catch(_0x41eb35){logger[_0x63c3('0x5c')](_0x41eb35);}}exports[_0x63c3('0x2e')]=function(_0x22d76f,_0x3d96e7,_0x45fde6){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x22d76f[_0x63c3('0x4d')]['id']}})[_0x63c3('0x2f')](handleEntityNotFound(_0x3d96e7,null))['then'](saveUpdates(_0x22d76f['body'],null))[_0x63c3('0x2f')](respondWithResult(_0x3d96e7,null))[_0x63c3('0x4c')](handleError(_0x3d96e7,null));};exports['delete']=function(_0x251c3e,_0x5a0a8e,_0x3c7423){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x251c3e['params']['id']}})[_0x63c3('0x2f')](function(_0xfe4763){if(_0xfe4763){return _0xfe4763[_0x63c3('0x30')]();}})[_0x63c3('0x2f')](function(_0x55f8fb){rimraf(path[_0x63c3('0x52')](config[_0x63c3('0x53')],'server/files/plugins',path[_0x63c3('0x63')](_0x55f8fb['path'])),function(){});return _0x55f8fb;})['then'](handleEntityNotFound(_0x5a0a8e,null))[_0x63c3('0x2f')](respondWithStatusCode(_0x5a0a8e,null))[_0x63c3('0x4c')](handleError(_0x5a0a8e,null));};exports[_0x63c3('0x9f')]=function(_0xfeb4c7,_0x3dcd11,_0x4bd685){return BPromise[_0x63c3('0xa0')]()[_0x63c3('0x2f')](function(){if(!_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')]){throw new Error(_0x63c3('0xa2'));}var _0x94ec9f=_0xfeb4c7['query'][_0x63c3('0xa3')]?_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa3')]+':'+_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')]:_0x63c3('0xa4')+_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')];var _0x27a49a=_0xfeb4c7['query'][_0x63c3('0x27')]?_0xfeb4c7[_0x63c3('0x3d')]['json']:!![];var _0x2c0b3f=_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa5')]?_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa5')]:null;var _0x15dbed={'method':_0xfeb4c7[_0x63c3('0xa6')],'uri':util[_0x63c3('0x55')](_0x63c3('0xa7'),_0x94ec9f,_0xfeb4c7['query'][_0x63c3('0x9')]),'json':_0x27a49a,'resolveWithFullResponse':!![],'encoding':_0x2c0b3f,'qs':_0xfeb4c7['query']};if(_0xfeb4c7[_0x63c3('0xa8')]){_0x15dbed[_0x63c3('0xa8')]=_0xfeb4c7['headers'];if(_0x15dbed[_0x63c3('0xa8')][_0x63c3('0xa9')]){delete _0x15dbed[_0x63c3('0xa8')][_0x63c3('0xa9')];}}if(_0x15dbed['headers'][_0x63c3('0xaa')]){delete _0x15dbed['headers'][_0x63c3('0xaa')];}return rp(_0x15dbed);})[_0x63c3('0x2f')](function(_0x5bc972){if(_0x5bc972){_0x3dcd11[_0x63c3('0x2b')](_0x5bc972[_0x63c3('0xa8')]);logger[_0x63c3('0x6a')](_0x5bc972[_0x63c3('0x96')]);if(_['endsWith'](_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0x9')],'download')&&_0x5bc972['statusCode']==0x1f4){return _0x3dcd11[_0x63c3('0x24')](_0x5bc972[_0x63c3('0xab')]);}else{return _0x3dcd11['status'](_0x5bc972[_0x63c3('0xab')])[_0x63c3('0x9d')](_0x5bc972[_0x63c3('0x96')]);}}else{return _0x3dcd11[_0x63c3('0x24')](0xc8);}})[_0x63c3('0x4c')](handleError(_0x3dcd11,null));};exports[_0x63c3('0xac')]=function(_0x27602c,_0x3b724f,_0xee3145){return BPromise[_0x63c3('0xa0')]()['then'](function(){if(!_0x27602c[_0x63c3('0x3d')][_0x63c3('0x9')]){throw new Error(_0x63c3('0xad'));}if(!_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')]){throw new Error(_0x63c3('0xa2'));}var _0x491c38=_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa3')]?_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa3')]+':'+_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')]:'http://localhost:'+_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')];var _0x343a87=_0x27602c[_0x63c3('0x3d')][_0x63c3('0x27')]?_0x27602c[_0x63c3('0x3d')]['json']:!![];var _0x2b24f7=_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa5')]?_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa5')]:null;var _0x56d238={'method':_0x27602c['method'],'uri':util[_0x63c3('0x55')](_0x63c3('0xa7'),_0x491c38,_0x27602c['query']['path']),'json':_0x343a87,'resolveWithFullResponse':!![],'encoding':_0x2b24f7,'body':_0x27602c[_0x63c3('0x96')]};if(_0x27602c['headers']){_0x56d238[_0x63c3('0xa8')]=_0x27602c[_0x63c3('0xa8')];if(_0x56d238[_0x63c3('0xa8')][_0x63c3('0xa9')]){delete _0x56d238[_0x63c3('0xa8')]['content-length'];}}if(_0x56d238[_0x63c3('0xa8')][_0x63c3('0xaa')]){delete _0x56d238[_0x63c3('0xa8')][_0x63c3('0xaa')];}return rp(_0x56d238);})[_0x63c3('0x2f')](function(_0x1dfc0c){if(_0x1dfc0c){_0x3b724f['set'](_0x1dfc0c[_0x63c3('0xa8')]);logger[_0x63c3('0x6a')](_0x1dfc0c[_0x63c3('0x96')]);return _0x3b724f[_0x63c3('0x25')](_0x1dfc0c[_0x63c3('0xab')])[_0x63c3('0x9d')](_0x1dfc0c[_0x63c3('0x96')]);}else{return _0x3b724f[_0x63c3('0x24')](0xc8);}})[_0x63c3('0x4c')](handleError(_0x3b724f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 4883248..a2fcb68 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 _0x6bb4=['update','emit','exports','events','../../mysqldb','Plugin','save'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x4852f9,_0x3b7fbd){_0x4852f9=_0x4852f9-0x0;var _0x4be4db=_0x6bb4[_0x4852f9];return _0x4be4db;};'use strict';var EventEmitter=require(_0x46bb('0x0'));var Plugin=require(_0x46bb('0x1'))['db'][_0x46bb('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46bb('0x3'),'afterUpdate':_0x46bb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x74054){return function(_0x100be2,_0x2eefcc,_0x3c8bef){PluginEvents[_0x46bb('0x5')](_0x74054+':'+_0x100be2['id'],_0x100be2);PluginEvents[_0x46bb('0x5')](_0x74054,_0x100be2);_0x3c8bef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x46bb('0x6')]=PluginEvents; \ No newline at end of file +var _0xe1d3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x3c2675,_0x22b065){var _0x37abd5=function(_0x50f0c3){while(--_0x50f0c3){_0x3c2675['push'](_0x3c2675['shift']());}};_0x37abd5(++_0x22b065);}(_0xe1d3,0x159));var _0x3e1d=function(_0x18114f,_0xb27b19){_0x18114f=_0x18114f-0x0;var _0x2dd623=_0xe1d3[_0x18114f];return _0x2dd623;};'use strict';var EventEmitter=require(_0x3e1d('0x0'));var Plugin=require(_0x3e1d('0x1'))['db'][_0x3e1d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3e1d('0x3')](0x0);var events={'afterCreate':_0x3e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x3e1d('0x5')};function emitEvent(_0x4a0768){return function(_0x23f59b,_0x38df15,_0x4f6337){PluginEvents['emit'](_0x4a0768+':'+_0x23f59b['id'],_0x23f59b);PluginEvents[_0x3e1d('0x6')](_0x4a0768,_0x23f59b);_0x4f6337(null);};}for(var e in events){if(events[_0x3e1d('0x7')](e)){var event=events[e];Plugin[_0x3e1d('0x8')](e,emitEvent(event));}}module[_0x3e1d('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4059bf6..9f0e2f3 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 _0x3f50=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f50,0x7e));var _0x03f5=function(_0x208f6a,_0x3e2afb){_0x208f6a=_0x208f6a-0x0;var _0x107bd7=_0x3f50[_0x208f6a];return _0x107bd7;};'use strict';var _=require(_0x03f5('0x0'));var util=require(_0x03f5('0x1'));var logger=require(_0x03f5('0x2'))(_0x03f5('0x3'));var moment=require(_0x03f5('0x4'));var BPromise=require(_0x03f5('0x5'));var rp=require(_0x03f5('0x6'));var fs=require('fs');var path=require(_0x03f5('0x7'));var rimraf=require(_0x03f5('0x8'));var config=require(_0x03f5('0x9'));var attributes=require(_0x03f5('0xa'));module[_0x03f5('0xb')]=function(_0x497d53,_0x3366e2){return _0x497d53[_0x03f5('0xc')](_0x03f5('0xd'),attributes,{'tableName':_0x03f5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885f=['path','rimraf','../../config/environment','exports','define','Plugin','plugins','../../config/logger','api','bluebird','request-promise'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x885f,0x8b));var _0xf885=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x885f[_0x1ebd10];return _0x1004d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf885('0x0'))(_0xf885('0x1'));var moment=require('moment');var BPromise=require(_0xf885('0x2'));var rp=require(_0xf885('0x3'));var fs=require('fs');var path=require(_0xf885('0x4'));var rimraf=require(_0xf885('0x5'));var config=require(_0xf885('0x6'));var attributes=require('./plugin.attributes');module[_0xf885('0x7')]=function(_0x42bfad,_0x2fd5e1){return _0x42bfad[_0xf885('0x8')](_0xf885('0x9'),attributes,{'tableName':_0xf885('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 869029e..e17eb3d 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 _0x2227=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','info','debug','request\x20sent','error','message','Plugin,\x20%s,\x20%s','CreatePlugin','Plugin','body','options','raw','then','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cd359,_0x558786){var _0x117e49=function(_0x4d578d){while(--_0x4d578d){_0x3cd359['push'](_0x3cd359['shift']());}};_0x117e49(++_0x558786);}(_0x2227,0x143));var _0x7222=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2227[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7222('0x0'));var util=require('util');var moment=require(_0x7222('0x1'));var BPromise=require(_0x7222('0x2'));var rs=require(_0x7222('0x3'));var fs=require('fs');var Redis=require(_0x7222('0x4'));var db=require(_0x7222('0x5'))['db'];var utils=require(_0x7222('0x6'));var logger=require(_0x7222('0x7'))(_0x7222('0x8'));var config=require(_0x7222('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7222('0xa')][_0x7222('0xb')]({'port':0x232a});config[_0x7222('0xc')]=_[_0x7222('0xd')](config['redis'],{'host':_0x7222('0xe'),'port':0x18eb});var socket=require(_0x7222('0xf'))(new Redis(config[_0x7222('0xc')]));require(_0x7222('0x10'))[_0x7222('0x11')](socket);function respondWithRpcPromise(_0x549edc,_0xd0ee27,_0x186650){return new BPromise(function(_0x314a21,_0x477388){return client[_0x7222('0x12')](_0x549edc,_0x186650)['then'](function(_0xa44f3f){logger[_0x7222('0x13')]('Plugin,\x20%s,\x20%s',_0xd0ee27,'request\x20sent');logger[_0x7222('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0xd0ee27,_0x7222('0x15'),JSON['stringify'](_0xa44f3f));if(_0xa44f3f[_0x7222('0x16')]){if(_0xa44f3f[_0x7222('0x16')]['code']===0x1f4){logger[_0x7222('0x16')]('Plugin,\x20%s,\x20%s',_0xd0ee27,_0xa44f3f[_0x7222('0x16')][_0x7222('0x17')]);return _0x477388(_0xa44f3f[_0x7222('0x16')][_0x7222('0x17')]);}logger[_0x7222('0x16')]('Plugin,\x20%s,\x20%s',_0xd0ee27,_0xa44f3f[_0x7222('0x16')]['message']);return _0x314a21(_0xa44f3f['error'][_0x7222('0x17')]);}else{logger[_0x7222('0x13')]('Plugin,\x20%s,\x20%s',_0xd0ee27,_0x7222('0x15'));_0x314a21(_0xa44f3f['result'][_0x7222('0x17')]);}})['catch'](function(_0x405308){logger[_0x7222('0x16')](_0x7222('0x18'),_0xd0ee27,_0x405308);_0x477388(_0x405308);});});}exports[_0x7222('0x19')]=function(_0x7a9a01){var _0x3be837=this;return new Promise(function(_0x28a579,_0x438e02){return db[_0x7222('0x1a')]['create'](_0x7a9a01[_0x7222('0x1b')],{'raw':_0x7a9a01[_0x7222('0x1c')]?_0x7a9a01[_0x7222('0x1c')][_0x7222('0x1d')]===undefined?!![]:![]:!![]})[_0x7222('0x1e')](function(_0x2fa982){logger['info']('CreatePlugin',_0x7a9a01);logger[_0x7222('0x14')](_0x7222('0x19'),_0x7a9a01,JSON[_0x7222('0x1f')](_0x2fa982));_0x28a579(_0x2fa982);})[_0x7222('0x20')](function(_0x3d41db){logger[_0x7222('0x16')](_0x7222('0x19'),_0x3d41db[_0x7222('0x17')],_0x7a9a01);_0x438e02(_0x3be837['error'](0x1f4,_0x3d41db[_0x7222('0x17')]));});});}; \ No newline at end of file +var _0x2ad3=['options','raw','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Plugin,\x20%s,\x20%s','result','CreatePlugin','create','body'];(function(_0x1c31f9,_0xa3879f){var _0x47ef68=function(_0x4d1e16){while(--_0x4d1e16){_0x1c31f9['push'](_0x1c31f9['shift']());}};_0x47ef68(++_0xa3879f);}(_0x2ad3,0x94));var _0x32ad=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2ad3[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x32ad('0x0'));var util=require(_0x32ad('0x1'));var moment=require(_0x32ad('0x2'));var BPromise=require(_0x32ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32ad('0x4'));var db=require(_0x32ad('0x5'))['db'];var utils=require(_0x32ad('0x6'));var logger=require(_0x32ad('0x7'))(_0x32ad('0x8'));var config=require(_0x32ad('0x9'));var jayson=require(_0x32ad('0xa'));var client=jayson[_0x32ad('0xb')][_0x32ad('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x32ad('0xd')],{'host':_0x32ad('0xe'),'port':0x18eb});var socket=require(_0x32ad('0xf'))(new Redis(config['redis']));require(_0x32ad('0x10'))[_0x32ad('0x11')](socket);function respondWithRpcPromise(_0x10f81f,_0x9e7396,_0xde3a8b){return new BPromise(function(_0x462a25,_0x4bb077){return client[_0x32ad('0x12')](_0x10f81f,_0xde3a8b)[_0x32ad('0x13')](function(_0x1dcc5a){logger[_0x32ad('0x14')]('Plugin,\x20%s,\x20%s',_0x9e7396,_0x32ad('0x15'));logger['debug'](_0x32ad('0x16'),_0x9e7396,_0x32ad('0x15'),JSON[_0x32ad('0x17')](_0x1dcc5a));if(_0x1dcc5a[_0x32ad('0x18')]){if(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x19')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x9e7396,_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);return _0x4bb077(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);}logger[_0x32ad('0x18')](_0x32ad('0x1b'),_0x9e7396,_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);return _0x462a25(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);}else{logger[_0x32ad('0x14')](_0x32ad('0x1b'),_0x9e7396,_0x32ad('0x15'));_0x462a25(_0x1dcc5a[_0x32ad('0x1c')][_0x32ad('0x1a')]);}})['catch'](function(_0x29bb){logger[_0x32ad('0x18')](_0x32ad('0x1b'),_0x9e7396,_0x29bb);_0x4bb077(_0x29bb);});});}exports[_0x32ad('0x1d')]=function(_0x5606bf){var _0x27a67d=this;return new Promise(function(_0x194e77,_0x5f1529){return db['Plugin'][_0x32ad('0x1e')](_0x5606bf[_0x32ad('0x1f')],{'raw':_0x5606bf[_0x32ad('0x20')]?_0x5606bf[_0x32ad('0x20')][_0x32ad('0x21')]===undefined?!![]:![]:!![]})[_0x32ad('0x13')](function(_0x4eef08){logger['info'](_0x32ad('0x1d'),_0x5606bf);logger[_0x32ad('0x22')](_0x32ad('0x1d'),_0x5606bf,JSON[_0x32ad('0x17')](_0x4eef08));_0x194e77(_0x4eef08);})[_0x32ad('0x23')](function(_0x23f2e9){logger['error'](_0x32ad('0x1d'),_0x23f2e9[_0x32ad('0x1a')],_0x5606bf);_0x5f1529(_0x27a67d['error'](0x1f4,_0x23f2e9[_0x32ad('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index def30ce..00542a7 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 _0xa5dd=['save','remove','update','removeListener','register'];(function(_0x377f50,_0x5589ba){var _0x14a9d2=function(_0x4ab38b){while(--_0x4ab38b){_0x377f50['push'](_0x377f50['shift']());}};_0x14a9d2(++_0x5589ba);}(_0xa5dd,0x1c7));var _0xda5d=function(_0x13f05f,_0x1c4b2f){_0x13f05f=_0x13f05f-0x0;var _0x585afd=_0xa5dd[_0x13f05f];return _0x585afd;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xda5d('0x0'),_0xda5d('0x1'),_0xda5d('0x2')];function createListener(_0x38eaae,_0x286da0){return function(_0x2d3962){_0x286da0['emit'](_0x38eaae,_0x2d3962);};}function removeListener(_0x47504d,_0x2e7940){return function(){PluginEvents[_0xda5d('0x3')](_0x47504d,_0x2e7940);};}exports[_0xda5d('0x4')]=function(_0xcbe13e){for(var _0x35c3dc=0x0,_0x235536=events['length'];_0x35c3dc<_0x235536;_0x35c3dc++){var _0x41e0c2=events[_0x35c3dc];var _0xf52094=createListener('plugin:'+_0x41e0c2,_0xcbe13e);PluginEvents['on'](_0x41e0c2,_0xf52094);}}; \ No newline at end of file +var _0x6569=['remove','update','emit','removeListener','register','length','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6569,0x1d6));var _0x9656=function(_0x20b7f4,_0x294e69){_0x20b7f4=_0x20b7f4-0x0;var _0x1f204e=_0x6569[_0x20b7f4];return _0x1f204e;};'use strict';var PluginEvents=require(_0x9656('0x0'));var events=[_0x9656('0x1'),_0x9656('0x2'),_0x9656('0x3')];function createListener(_0x5b1c99,_0x23d8f7){return function(_0x3cddee){_0x23d8f7[_0x9656('0x4')](_0x5b1c99,_0x3cddee);};}function removeListener(_0xccfe03,_0x4aa40f){return function(){PluginEvents[_0x9656('0x5')](_0xccfe03,_0x4aa40f);};}exports[_0x9656('0x6')]=function(_0xb2c897){for(var _0x49cdec=0x0,_0xb15712=events[_0x9656('0x7')];_0x49cdec<_0xb15712;_0x49cdec++){var _0x18a6e9=events[_0x49cdec];var _0x5cc38f=createListener('plugin:'+_0x18a6e9,_0xb2c897);PluginEvents['on'](_0x18a6e9,_0x5cc38f);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ae5bdfe..d438a11 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(_0x125af9,_0x41ed83){var _0x1a8dd2=function(_0x4028c7){while(--_0x4028c7){_0x125af9['push'](_0x125af9['shift']());}};_0x1a8dd2(++_0x41ed83);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x16b1ef,_0x4239b8){var _0x43fc47=function(_0x5907b7){while(--_0x5907b7){_0x16b1ef['push'](_0x16b1ef['shift']());}};_0x43fc47(++_0x4239b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 3fae67c..8cd3b41 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 _0x4ded=['name','express','motion2','catch','show','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','info','index','list','then','reject'];(function(_0x35b788,_0x41a9f8){var _0x2788cd=function(_0x50a0d5){while(--_0x50a0d5){_0x35b788['push'](_0x35b788['shift']());}};_0x2788cd(++_0x41a9f8);}(_0x4ded,0x116));var _0xd4de=function(_0x53bbf6,_0x3a9649){_0x53bbf6=_0x53bbf6-0x0;var _0xa4d3ff=_0x4ded[_0x53bbf6];return _0xa4d3ff;};'use strict';var _=require(_0xd4de('0x0'));var pm2=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var path=require(_0xd4de('0x4'));var exec=require(_0xd4de('0x5'))[_0xd4de('0x6')];var BPromise=require(_0xd4de('0x7'));function handleEntityNotFound(_0x20930f,_0x36d4dd){return function(_0x2e8d86){if(!_0x2e8d86){_0x20930f[_0xd4de('0x8')](0x194);;}return _0x2e8d86;};}function respondWithResult(_0x554a51,_0x23e5b9){_0x23e5b9=_0x23e5b9||0xc8;return function(_0x2433b8){if(_0x2433b8){return _0x554a51[_0xd4de('0x9')](_0x23e5b9)[_0xd4de('0xa')](_0x2433b8);}return null;};}function handleError(_0x4453c2,_0x1e8c35){_0x1e8c35=_0x1e8c35||0x1f4;return function(_0x5c612f){logger[_0xd4de('0xb')](_0x5c612f['stack']);if(_0x5c612f['name']){delete _0x5c612f['name'];}_0x4453c2[_0xd4de('0x9')](_0x1e8c35)[_0xd4de('0xc')](_0x5c612f);};}function execChildProcess(){return new BPromise(function(_0x4e5b10,_0x5b6dc4){exec('npm\x20install',function(_0x29e265,_0x49d931,_0x38ac13){logger[_0xd4de('0xd')](_0x49d931);logger[_0xd4de('0xd')](_0x38ac13);if(_0x29e265){logger[_0xd4de('0xb')](_0x29e265);return _0x5b6dc4(_0x29e265);}return _0x4e5b10(_0x49d931);});});}exports[_0xd4de('0xe')]=function(_0x3af6e0,_0x1dc9d5){return pm2[_0xd4de('0xf')]()[_0xd4de('0x10')](function(_0x37cb9f){if(_0x37cb9f){var _0x691ba9=_[_0xd4de('0x11')](_0x37cb9f,function(_0x164ca0){return _0x164ca0[_0xd4de('0x12')]===_0xd4de('0x13')||_0x164ca0[_0xd4de('0x12')]===_0xd4de('0x14');});return{'rows':_0x691ba9,'count':_0x691ba9['length']};}return null;})['then'](respondWithResult(_0x1dc9d5,null))[_0xd4de('0x15')](handleError(_0x1dc9d5,null));};exports[_0xd4de('0x16')]=function(_0x17b377,_0x428aa2){return pm2['describe'](_0x17b377['params']['id'])[_0xd4de('0x10')](respondWithResult(_0x428aa2,null))['then'](handleEntityNotFound(_0x428aa2,null))[_0xd4de('0x15')](handleError(_0x428aa2,null));};exports[_0xd4de('0x17')]=function(_0x50b9e3,_0xc15081){if(_0x50b9e3['body'][_0xd4de('0x12')]&&_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]){var _0x8e8712=path['join'](__dirname,_0xd4de('0x1a'),_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]);var _0xdb3fc=process[_0xd4de('0x1b')]();process[_0xd4de('0x1c')](path[_0xd4de('0x1d')](_0x8e8712));return execChildProcess()[_0xd4de('0x10')](function(_0x2f9de6){process[_0xd4de('0x1c')](_0xdb3fc);return pm2['start']({'name':_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x12')],'script':_0x8e8712});})[_0xd4de('0x10')](function(_0x22970c){pm2[_0xd4de('0x1e')]();return _0x22970c[0x0];})[_0xd4de('0x10')](respondWithResult(_0xc15081,0xc9))[_0xd4de('0x15')](handleError(_0xc15081,null));}else{return _0xc15081[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':_0xd4de('0x1f')});}};exports[_0xd4de('0x20')]=function(_0xb2d8a1,_0x586126){if(_0xb2d8a1[_0xd4de('0x18')]['id']){delete _0xb2d8a1[_0xd4de('0x18')]['id'];}var _0x5005b0={'online':_0xd4de('0x21'),'stopped':'stop'};if(_0x5005b0[_0xd4de('0x22')](_0xb2d8a1[_0xd4de('0x18')][_0xd4de('0x9')])){return pm2[_0x5005b0[_0xb2d8a1['body'][_0xd4de('0x9')]]](_0xb2d8a1[_0xd4de('0x23')]['id'])[_0xd4de('0x10')](respondWithResult(_0x586126,0xc8))['catch'](handleError(_0x586126,null));}else{return _0x586126[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x5706fe,_0x3f6491){if(_0x5706fe['body']['id']){delete _0x5706fe[_0xd4de('0x18')]['id'];}if(_0x5706fe[_0xd4de('0x23')]['id']){return pm2[_0xd4de('0x24')](_0x5706fe[_0xd4de('0x23')]['id'])['then'](function(_0x3fe6c8){pm2[_0xd4de('0x1e')]();return _0x3fe6c8[0x0];})['then'](respondWithResult(_0x3f6491,null))[_0xd4de('0x15')](handleError(_0x3f6491,null));}else{return _0x3f6491[_0xd4de('0x9')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x222f=['dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','stack','name','status','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','body','join','../../files/plugins','script','chdir','dirname','start'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x222f,0x1a4));var _0xf222=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x222f[_0x5de390];return _0x12bf75;};'use strict';var _=require(_0xf222('0x0'));var pm2=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var path=require('path');var exec=require('child_process')[_0xf222('0x4')];var BPromise=require(_0xf222('0x5'));function handleEntityNotFound(_0x307791,_0x7b187d){return function(_0x59a619){if(!_0x59a619){_0x307791[_0xf222('0x6')](0x194);;}return _0x59a619;};}function respondWithResult(_0x54a758,_0x112e6d){_0x112e6d=_0x112e6d||0xc8;return function(_0x26f129){if(_0x26f129){return _0x54a758['status'](_0x112e6d)[_0xf222('0x7')](_0x26f129);}return null;};}function handleError(_0x302d7a,_0x4aceb4){_0x4aceb4=_0x4aceb4||0x1f4;return function(_0x31c027){logger[_0xf222('0x8')](_0x31c027[_0xf222('0x9')]);if(_0x31c027[_0xf222('0xa')]){delete _0x31c027[_0xf222('0xa')];}_0x302d7a[_0xf222('0xb')](_0x4aceb4)['send'](_0x31c027);};}function execChildProcess(){return new BPromise(function(_0x2e29ad,_0x405080){exec(_0xf222('0xc'),function(_0x182bc3,_0x48f740,_0x3c9b96){logger[_0xf222('0xd')](_0x48f740);logger[_0xf222('0xd')](_0x3c9b96);if(_0x182bc3){logger[_0xf222('0x8')](_0x182bc3);return _0x405080(_0x182bc3);}return _0x2e29ad(_0x48f740);});});}exports[_0xf222('0xe')]=function(_0x334017,_0x11fca0){return pm2[_0xf222('0xf')]()['then'](function(_0x5b8f97){if(_0x5b8f97){var _0x1feb86=_[_0xf222('0x10')](_0x5b8f97,function(_0x4c2314){return _0x4c2314[_0xf222('0xa')]===_0xf222('0x11')||_0x4c2314[_0xf222('0xa')]===_0xf222('0x12');});return{'rows':_0x1feb86,'count':_0x1feb86[_0xf222('0x13')]};}return null;})[_0xf222('0x14')](respondWithResult(_0x11fca0,null))[_0xf222('0x15')](handleError(_0x11fca0,null));};exports['show']=function(_0x1efa9f,_0x823314){return pm2[_0xf222('0x16')](_0x1efa9f[_0xf222('0x17')]['id'])[_0xf222('0x14')](respondWithResult(_0x823314,null))[_0xf222('0x14')](handleEntityNotFound(_0x823314,null))[_0xf222('0x15')](handleError(_0x823314,null));};exports['create']=function(_0xf26a16,_0x1bdd0a){if(_0xf26a16[_0xf222('0x18')][_0xf222('0xa')]&&_0xf26a16['body']['script']){var _0x398ff4=path[_0xf222('0x19')](__dirname,_0xf222('0x1a'),_0xf26a16[_0xf222('0x18')][_0xf222('0x1b')]);var _0x151a89=process['cwd']();process[_0xf222('0x1c')](path[_0xf222('0x1d')](_0x398ff4));return execChildProcess()[_0xf222('0x14')](function(_0x12d443){process[_0xf222('0x1c')](_0x151a89);return pm2[_0xf222('0x1e')]({'name':_0xf26a16[_0xf222('0x18')][_0xf222('0xa')],'script':_0x398ff4});})['then'](function(_0x145e2e){pm2[_0xf222('0x1f')]();return _0x145e2e[0x0];})[_0xf222('0x14')](respondWithResult(_0x1bdd0a,0xc9))[_0xf222('0x15')](handleError(_0x1bdd0a,null));}else{return _0x1bdd0a[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x21')});}};exports[_0xf222('0x22')]=function(_0x15bf4e,_0x2ec2e9){if(_0x15bf4e[_0xf222('0x18')]['id']){delete _0x15bf4e['body']['id'];}var _0x14b2b1={'online':_0xf222('0x23'),'stopped':_0xf222('0x24')};if(_0x14b2b1[_0xf222('0x25')](_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')])){return pm2[_0x14b2b1[_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')]]](_0x15bf4e[_0xf222('0x17')]['id'])['then'](respondWithResult(_0x2ec2e9,0xc8))[_0xf222('0x15')](handleError(_0x2ec2e9,null));}else{return _0x2ec2e9[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf222('0x26')]=function(_0x5d5963,_0x40c7e7){if(_0x5d5963[_0xf222('0x18')]['id']){delete _0x5d5963[_0xf222('0x18')]['id'];}if(_0x5d5963[_0xf222('0x17')]['id']){return pm2[_0xf222('0x27')](_0x5d5963[_0xf222('0x17')]['id'])[_0xf222('0x14')](function(_0x5075ad){pm2['dump']();return _0x5075ad[0x0];})[_0xf222('0x14')](respondWithResult(_0x40c7e7,null))[_0xf222('0x15')](handleError(_0x40c7e7,null));}else{return _0x40c7e7[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 1b003ea..9128d24 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 _0xaafc=['isAuthenticated','getQueues','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x1f5303,_0x354414){var _0x84ef1a=function(_0x27e275){while(--_0x27e275){_0x1f5303['push'](_0x1f5303['shift']());}};_0x84ef1a(++_0x354414);}(_0xaafc,0x176));var _0xcaaf=function(_0x4c2182,_0xce2299){_0x4c2182=_0x4c2182-0x0;var _0x2f684d=_0xaafc[_0x4c2182];return _0x2f684d;};'use strict';var express=require('express');var router=express[_0xcaaf('0x0')]();var auth=require(_0xcaaf('0x1'));var controller=require(_0xcaaf('0x2'));router[_0xcaaf('0x3')]('/queues',auth[_0xcaaf('0x4')](),controller[_0xcaaf('0x5')]);module['exports']=router; \ No newline at end of file +var _0x090a=['get','getQueues','express','Router','./realtime.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x090a,0x133));var _0xa090=function(_0x34ce72,_0x19ce31){_0x34ce72=_0x34ce72-0x0;var _0x4a3fe8=_0x090a[_0x34ce72];return _0x4a3fe8;};'use strict';var express=require(_0xa090('0x0'));var router=express[_0xa090('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa090('0x2'));router[_0xa090('0x3')]('/queues',auth['isAuthenticated'](),controller[_0xa090('0x4')]);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 acf4ac5..3f4702c 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 _0x0e2f=['UserId','accountcode','online','voiceStatus','User','Pause','startCase','mail','chat','sms','openchannel','fax','whatsapp','resolve','channel','includes','toLowerCase','Invalid\x20channel','Queue','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','query','QueueCampaigns','getResources','rows','all','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','set','stack','name','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch','voice','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','originated','merge','pick','filter','find','getMembers','length'];(function(_0x36c777,_0x2616f2){var _0x8c2dc5=function(_0x1539a0){while(--_0x1539a0){_0x36c777['push'](_0x36c777['shift']());}};_0x8c2dc5(++_0x2616f2);}(_0x0e2f,0xe2));var _0xf0e2=function(_0x162f79,_0xc4ad7d){_0x162f79=_0x162f79-0x0;var _0x380302=_0x0e2f[_0x162f79];return _0x380302;};'use strict';var util=require(_0xf0e2('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require(_0xf0e2('0x1'));var logger=require(_0xf0e2('0x2'))(_0xf0e2('0x3'));var db=require(_0xf0e2('0x4'))['db'];var amiClient=jayson[_0xf0e2('0x5')][_0xf0e2('0x6')]({'port':0x232a});var routingClient=jayson[_0xf0e2('0x5')][_0xf0e2('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x144b27,_0x4c58f2){return function(_0x5045ba){if(_0x5045ba){var _0xd59b43=typeof _0x4c58f2['offset']==='undefined'&&typeof _0x4c58f2[_0xf0e2('0x7')]===_0xf0e2('0x8');var _0x1e2715=_0x5045ba[_0xf0e2('0x9')];var _0x37a0c3=_0xd59b43?0x0:_0x4c58f2['offset'];var _0x4a9037=_0xd59b43?_0x5045ba[_0xf0e2('0x9')]:_0x4c58f2[_0xf0e2('0xa')]+_0x4c58f2[_0xf0e2('0x7')];var _0x1e0a3f;if(_0x4a9037>=_0x1e2715){_0x4a9037=_0x1e2715;_0x1e0a3f=0xc8;}else{_0x1e0a3f=0xce;}_0x144b27[_0xf0e2('0xb')](_0x1e0a3f);return _0x144b27[_0xf0e2('0xc')]('Content-Range',_0x37a0c3+'-'+_0x4a9037+'/'+_0x1e2715)['json'](_0x5045ba);}return null;};}function handleError(_0x448305,_0x5a4f6d){_0x5a4f6d=_0x5a4f6d||0x1f4;return function(_0x5acbcf){logger['error'](_0x5acbcf[_0xf0e2('0xd')]);if(_0x5acbcf['name']){delete _0x5acbcf[_0xf0e2('0xe')];}_0x448305[_0xf0e2('0xb')](_0x5a4f6d)[_0xf0e2('0xf')](_0x5acbcf);};}function getRealtimeAgents(){return new Promise(function(_0x50adfa,_0x34bd29){return amiClient[_0xf0e2('0x10')](_0xf0e2('0x11'),{})[_0xf0e2('0x12')](function(_0x14b0bb){if(_0x14b0bb[_0xf0e2('0x13')])throw new Error(_0xf0e2('0x14'));var _0x589175=_0x14b0bb[_0xf0e2('0x15')];return routingClient[_0xf0e2('0x10')](_0xf0e2('0x11'),{})[_0xf0e2('0x12')](function(_0x3dc17a){if(_0x3dc17a[_0xf0e2('0x13')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x4dd722=_0x3dc17a[_0xf0e2('0x15')];return _0x50adfa(_['merge']({},_0x589175,_0x4dd722));});})[_0xf0e2('0x16')](function(_0x42bdab){_0x34bd29(_0x42bdab);});});}function getRealtimeQueues(_0x3b3f67,_0x1c58d9){return new Promise(function(_0x1623b1,_0x50efc9){var _0x2cd0b6=_0x1c58d9===_0xf0e2('0x17')?amiClient:routingClient;return _0x2cd0b6[_0xf0e2('0x10')](_['startCase'](_0x1c58d9)+_0xf0e2('0x18'),_0x3b3f67)[_0xf0e2('0x12')](function(_0x573067){if(_0x573067[_0xf0e2('0x13')])throw new Error(util['format'](_0xf0e2('0x19'),_0x1c58d9));return _0x1623b1(_0x573067[_0xf0e2('0x15')]);})[_0xf0e2('0x16')](function(_0x3d55a4){_0x50efc9(_0x3d55a4);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3205b0,_0xbf5d94){return amiClient[_0xf0e2('0x10')](_0xf0e2('0x1a'),{})[_0xf0e2('0x12')](function(_0x12c552){if(_0x12c552[_0xf0e2('0x13')])throw new Error(_0xf0e2('0x1b'));return _0x3205b0(_0x12c552['result']);})[_0xf0e2('0x16')](function(_0x29a8a6){_0xbf5d94(_0x29a8a6);});});}function initializeQueues(_0x1dbe45,_0xfd4e0a,_0xed358c,_0x14417b){var _0x5e2bf8=[_0xf0e2('0x1c'),_0xf0e2('0x1d'),_0xf0e2('0x1e'),_0xf0e2('0x1f'),_0xf0e2('0x20')];if(_0xed358c===_0xf0e2('0x17')&&_0x14417b===_0xf0e2('0x21')){_0x5e2bf8[_0xf0e2('0x22')](_0xf0e2('0x23'),'originated',_0xf0e2('0x24'),_0xf0e2('0x25'),_0xf0e2('0x26'),_0xf0e2('0x27'),_0xf0e2('0x28'),_0xf0e2('0x29'),_0xf0e2('0x2a'),_0xf0e2('0x2b'),_0xf0e2('0x2c'),'erlangBusyFactor',_0xf0e2('0x2d'),_0xf0e2('0x2e'),_0xf0e2('0x2f'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0xf0e2('0x30'),_0xf0e2('0x31'),_0xf0e2('0x32'),_0xf0e2('0x33'),_0xf0e2('0x34'));}return _0x1dbe45[_0xf0e2('0x35')](function(_0x5472c8){var _0x25eabb=_0x5472c8[_0xf0e2('0x36')]({'plain':!![]});_0x25eabb[_0xf0e2('0x37')]=[];_0x25eabb['paused']=0x0;_0x25eabb[_0xf0e2('0x38')]=0x0;_0x25eabb[_0xf0e2('0x1c')]=0x0;_0x25eabb[_0xf0e2('0x1d')]=0x0;_0x25eabb[_0xf0e2('0x1e')]=0x0;if(_0xed358c===_0xf0e2('0x17')){_0x25eabb[_0xf0e2('0x1f')]=0x0;_0x25eabb[_0xf0e2('0x39')]=0x0;if(_0x14417b===_0xf0e2('0x21')){_0x25eabb[_0xf0e2('0x23')]=0x0;_0x25eabb[_0xf0e2('0x3a')]=0x0;}}var _0x148436=_['find'](_0xfd4e0a,['id',_0x25eabb['id']]);if(_0x148436)_[_0xf0e2('0x3b')](_0x25eabb,_[_0xf0e2('0x3c')](_0x148436,_0x5e2bf8));return _0x25eabb;});}function updateAgentVoiceStatus(_0x5bfb28,_0x17f2ff,_0xa4b509){var _0x2190ea=_[_0xf0e2('0x3d')](_0xa4b509,['queue',_0x17f2ff['name']]);if(_0x2190ea['length']===0x0)return _0x5bfb28[_0xf0e2('0x39')]=!![];if(_['some'](_0x2190ea,['connectedlinenum',_0x5bfb28['internal']['toString']()]))return _0x5bfb28[_0xf0e2('0x1f')]=!![];if(!_0x5bfb28[_0xf0e2('0x1f')])return _0x5bfb28[_0xf0e2('0x39')]=!![];}function getVoiceQueueAgents(_0x56f10c,_0x4c95d4,_0x470c6d,_0x205cc4){var _0x202511=_[_0xf0e2('0x3e')](_0x4c95d4,['id',_0x56f10c['id']]);if(!_0x202511)return _0x56f10c;return _0x202511[_0xf0e2('0x3f')]({'raw':!![]})[_0xf0e2('0x12')](function(_0x4e2f39){for(var _0x14bd6c=0x0;_0x14bd6c<_0x4e2f39[_0xf0e2('0x40')];_0x14bd6c++){var _0x59ed4f=_[_0xf0e2('0x3e')](_0x470c6d,['id',_0x4e2f39[_0x14bd6c][_0xf0e2('0x41')]]);if(!_0x59ed4f){_0x59ed4f={'id':_0x4e2f39[_0x14bd6c][_0xf0e2('0x41')],'name':_0x4e2f39[_0x14bd6c]['UserId'],'accountcode':'','online':![]};}var _0x2c40f5={'id':_0x59ed4f['id'],'name':_0x59ed4f['name'],'internal':_0x59ed4f[_0xf0e2('0x42')],'online':Boolean(_0x59ed4f[_0xf0e2('0x43')]),'paused':Boolean(_0x4e2f39[_0x14bd6c][_0xf0e2('0x20')])};if(_0x59ed4f[_0xf0e2('0x44')]===_0xf0e2('0x1f'))updateAgentVoiceStatus(_0x2c40f5,_0x56f10c,_0x205cc4);if(_0x2c40f5[_0xf0e2('0x43')])_0x56f10c[_0xf0e2('0x38')]++;if(_0x2c40f5[_0xf0e2('0x39')])_0x56f10c['busy']++;if(_0x2c40f5[_0xf0e2('0x20')]&&!_0x2c40f5['busy']&&!_0x2c40f5[_0xf0e2('0x1f')])_0x56f10c[_0xf0e2('0x20')]++;_0x56f10c[_0xf0e2('0x37')]['push'](_0x2c40f5);}return _0x56f10c;});}function getQueueAgents(_0x4c4bea,_0x598193,_0x1dce60){var _0x1bc026=_0xf0e2('0x45')+_['startCase'](_0x1dce60)+'Queue';var _0x186716=_0x1dce60+_0xf0e2('0x46');return db[_0x1bc026]['findAll']({'where':{[_[_0xf0e2('0x47')](_0x1dce60)+'QueueId']:_0x4c4bea['id']},'raw':!![]})[_0xf0e2('0x12')](function(_0x37e762){for(var _0x4d6996=0x0;_0x4d6996<_0x37e762['length'];_0x4d6996++){var _0x12027a=_[_0xf0e2('0x3e')](_0x598193,['id',_0x37e762[_0x4d6996]['UserId']]);if(!_0x12027a){_0x12027a={'id':_0x37e762[_0x4d6996][_0xf0e2('0x41')],'name':_0x37e762[_0x4d6996]['UserId'],'online':![],['pauseField']:![]};}var _0x18e3e1={'id':_0x12027a['id'],'name':_0x12027a[_0xf0e2('0xe')],'online':Boolean(_0x12027a[_0xf0e2('0x43')]),'paused':Boolean(_0x12027a[_0x186716])};if(_0x18e3e1[_0xf0e2('0x43')])_0x4c4bea[_0xf0e2('0x38')]++;_0x4c4bea[_0xf0e2('0x37')]['push'](_0x18e3e1);}return _0x4c4bea;});}exports['getQueues']=function(_0x2cd2a5,_0x367672){var _0x25c312=[_0xf0e2('0x48'),_0xf0e2('0x49'),_0xf0e2('0x4a'),_0xf0e2('0x4b'),_0xf0e2('0x4c'),_0xf0e2('0x4d'),_0xf0e2('0x17')];var _0x63567e={'count':0x0,'rows':[]},_0x3194d3={},_0x49c423,_0x59689d,_0x74b9b7,_0x374692,_0x490b21;Promise[_0xf0e2('0x4e')]()[_0xf0e2('0x12')](function(){if(_0x2cd2a5['query'][_0xf0e2('0x4f')]){if(!_[_0xf0e2('0x50')](_0x25c312,_0x2cd2a5['query'][_0xf0e2('0x4f')][_0xf0e2('0x51')]()))throw new Error(_0xf0e2('0x52'));_0x49c423=_0x2cd2a5['query']['channel']['toLowerCase']();}var _0x3f388f=_[_0xf0e2('0x47')](_0x49c423)+_0xf0e2('0x53');var _0x11366d=_[_0xf0e2('0x35')](db[_0x3f388f][_0xf0e2('0x54')],function(_0x33db20){return{'name':_0x33db20[_0xf0e2('0x55')],'type':_0x33db20[_0xf0e2('0x56')][_0xf0e2('0x57')]};});_0x3194d3=qs[_0xf0e2('0x58')](_0x11366d,_0x2cd2a5);if(_0x2cd2a5[_0xf0e2('0x59')][_0xf0e2('0x5a')]===_0xf0e2('0x59')){var _0xe12b1e={'params':{'id':_0x2cd2a5[_0xf0e2('0x59')][_0xf0e2('0x5b')]},'query':{'section':_0x49c423===_0xf0e2('0x17')&&_0x2cd2a5[_0xf0e2('0x5c')][_0xf0e2('0x56')]==='outbound'?_0xf0e2('0x5d'):_[_0xf0e2('0x47')](_0x49c423)+_0xf0e2('0x18'),'type':_0x2cd2a5[_0xf0e2('0x5c')][_0xf0e2('0x56')],'nolimit':!![],'sort':_0xf0e2('0xe'),'filter':_0x2cd2a5[_0xf0e2('0x5c')][_0xf0e2('0x3d')]}};return db['UserProfile'][_0xf0e2('0x5e')](_0xe12b1e);}return db[_0x3f388f]['findAndCountAll'](_0x3194d3);})['then'](function(_0x3d55bd){_0x63567e['count']=_0x3d55bd['count'];_0x59689d=_0x3d55bd[_0xf0e2('0x5f')];return getRealtimeQueues(_0x2cd2a5,_0x49c423);})[_0xf0e2('0x12')](function(_0x466beb){_0x374692=_0x466beb['rows'];return getRealtimeAgents();})['then'](function(_0x2074d7){_0x74b9b7=_0x2074d7[_0xf0e2('0x5f')];if(_0x49c423!=_0xf0e2('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x6e2f4e){_0x490b21=_0x6e2f4e?_0x6e2f4e['rows']:[];return initializeQueues(_0x59689d,_0x374692,_0x49c423,_0x2cd2a5['query']['type']);})[_0xf0e2('0x12')](function(_0x27c2f7){var _0x1fefe0=_0x27c2f7[_0xf0e2('0x35')](function(_0x3ffc71){if(_0x49c423===_0xf0e2('0x17'))return getVoiceQueueAgents(_0x3ffc71,_0x59689d,_0x74b9b7,_0x490b21);else return getQueueAgents(_0x3ffc71,_0x74b9b7,_0x49c423);});return Promise[_0xf0e2('0x60')](_0x1fefe0);})[_0xf0e2('0x12')](function(_0x493034){_0x63567e[_0xf0e2('0x5f')]=_0x493034;return _0x63567e;})[_0xf0e2('0x12')](respondWithFilteredResult(_0x367672,_0x3194d3))['catch'](handleError(_0x367672,null));}; \ No newline at end of file +var _0xe79f=['loggedInDb','talking','busy','outbound','merge','pick','filter','queue','length','some','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','QueueId','chat','sms','openchannel','fax','whatsapp','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','fieldName','key','getOptions','user','role','userProfileId','QueueCampaigns','type','UserProfile','findAndCountAll','count','rows','catch','util','jayson/promise','../../components/parsers/qs','api','../../mysqldb','http','client','undefined','limit','offset','set','Content-Range','json','error','stack','name','send','request','then','result','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','paused','voice','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents'];(function(_0x46050b,_0x4fb433){var _0x51e7d4=function(_0x7db0da){while(--_0x7db0da){_0x46050b['push'](_0x46050b['shift']());}};_0x51e7d4(++_0x4fb433);}(_0xe79f,0xf0));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xfe79('0x0'));var _=require('lodash');var jayson=require(_0xfe79('0x1'));var qs=require(_0xfe79('0x2'));var logger=require('../../config/logger')(_0xfe79('0x3'));var db=require(_0xfe79('0x4'))['db'];var amiClient=jayson['client'][_0xfe79('0x5')]({'port':0x232a});var routingClient=jayson[_0xfe79('0x6')][_0xfe79('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x788b61,_0x591fa0){return function(_0x1f3553){if(_0x1f3553){var _0x38e009=typeof _0x591fa0['offset']===_0xfe79('0x7')&&typeof _0x591fa0[_0xfe79('0x8')]===_0xfe79('0x7');var _0x5e70bf=_0x1f3553['count'];var _0x49ad37=_0x38e009?0x0:_0x591fa0[_0xfe79('0x9')];var _0x55179d=_0x38e009?_0x1f3553['count']:_0x591fa0[_0xfe79('0x9')]+_0x591fa0[_0xfe79('0x8')];var _0x561c0e;if(_0x55179d>=_0x5e70bf){_0x55179d=_0x5e70bf;_0x561c0e=0xc8;}else{_0x561c0e=0xce;}_0x788b61['status'](_0x561c0e);return _0x788b61[_0xfe79('0xa')](_0xfe79('0xb'),_0x49ad37+'-'+_0x55179d+'/'+_0x5e70bf)[_0xfe79('0xc')](_0x1f3553);}return null;};}function handleError(_0x217bcc,_0x40b872){_0x40b872=_0x40b872||0x1f4;return function(_0x2f39d8){logger[_0xfe79('0xd')](_0x2f39d8[_0xfe79('0xe')]);if(_0x2f39d8[_0xfe79('0xf')]){delete _0x2f39d8[_0xfe79('0xf')];}_0x217bcc['status'](_0x40b872)[_0xfe79('0x10')](_0x2f39d8);};}function getRealtimeAgents(){return new Promise(function(_0x5e84ab,_0x82850b){return amiClient[_0xfe79('0x11')]('Agents',{})[_0xfe79('0x12')](function(_0x44f816){if(_0x44f816[_0xfe79('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3dc4b1=_0x44f816[_0xfe79('0x13')];return routingClient['request']('Agents',{})[_0xfe79('0x12')](function(_0x4efe69){if(_0x4efe69[_0xfe79('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x1524fe=_0x4efe69[_0xfe79('0x13')];return _0x5e84ab(_['merge']({},_0x3dc4b1,_0x1524fe));});})['catch'](function(_0x291ab2){_0x82850b(_0x291ab2);});});}function getRealtimeQueues(_0x4da236,_0x2b9201){return new Promise(function(_0xa09cdb,_0x41b243){var _0x5d26c9=_0x2b9201==='voice'?amiClient:routingClient;return _0x5d26c9[_0xfe79('0x11')](_[_0xfe79('0x14')](_0x2b9201)+_0xfe79('0x15'),_0x4da236)['then'](function(_0xbe3a6e){if(_0xbe3a6e[_0xfe79('0xd')])throw new Error(util['format'](_0xfe79('0x16'),_0x2b9201));return _0xa09cdb(_0xbe3a6e[_0xfe79('0x13')]);})['catch'](function(_0x49e2b2){_0x41b243(_0x49e2b2);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3969af,_0x27b22b){return amiClient[_0xfe79('0x11')](_0xfe79('0x17'),{})[_0xfe79('0x12')](function(_0x18d2fe){if(_0x18d2fe[_0xfe79('0xd')])throw new Error(_0xfe79('0x18'));return _0x3969af(_0x18d2fe[_0xfe79('0x13')]);})['catch'](function(_0x4e87a9){_0x27b22b(_0x4e87a9);});});}function initializeQueues(_0x5e5180,_0x124b63,_0x5183c5,_0x32e319){var _0x5b0e0a=[_0xfe79('0x19'),_0xfe79('0x1a'),'waiting','talking',_0xfe79('0x1b')];if(_0x5183c5===_0xfe79('0x1c')&&_0x32e319==='outbound'){_0x5b0e0a[_0xfe79('0x1d')](_0xfe79('0x1e'),_0xfe79('0x1f'),_0xfe79('0x20'),_0xfe79('0x21'),_0xfe79('0x22'),_0xfe79('0x23'),'startPredictive',_0xfe79('0x24'),_0xfe79('0x25'),_0xfe79('0x26'),'erlangAbandonmentRate',_0xfe79('0x27'),'dialPredictiveInterval',_0xfe79('0x28'),_0xfe79('0x29'),_0xfe79('0x2a'),'predictiveIntervalTotalCalls',_0xfe79('0x2b'),_0xfe79('0x2c'),_0xfe79('0x2d'),_0xfe79('0x2e'),_0xfe79('0x2f'));}return _0x5e5180[_0xfe79('0x30')](function(_0x53f217){var _0x35fc78=_0x53f217[_0xfe79('0x31')]({'plain':!![]});_0x35fc78[_0xfe79('0x32')]=[];_0x35fc78[_0xfe79('0x1b')]=0x0;_0x35fc78[_0xfe79('0x33')]=0x0;_0x35fc78[_0xfe79('0x19')]=0x0;_0x35fc78[_0xfe79('0x1a')]=0x0;_0x35fc78['waiting']=0x0;if(_0x5183c5===_0xfe79('0x1c')){_0x35fc78[_0xfe79('0x34')]=0x0;_0x35fc78[_0xfe79('0x35')]=0x0;if(_0x32e319===_0xfe79('0x36')){_0x35fc78[_0xfe79('0x1e')]=0x0;_0x35fc78[_0xfe79('0x1f')]=0x0;}}var _0x2e793e=_['find'](_0x124b63,['id',_0x35fc78['id']]);if(_0x2e793e)_[_0xfe79('0x37')](_0x35fc78,_[_0xfe79('0x38')](_0x2e793e,_0x5b0e0a));return _0x35fc78;});}function updateAgentVoiceStatus(_0x293184,_0xd98b6c,_0x51dc0e){var _0x43cdc2=_[_0xfe79('0x39')](_0x51dc0e,[_0xfe79('0x3a'),_0xd98b6c['name']]);if(_0x43cdc2[_0xfe79('0x3b')]===0x0)return _0x293184[_0xfe79('0x35')]=!![];if(_[_0xfe79('0x3c')](_0x43cdc2,['connectedlinenum',_0x293184['internal'][_0xfe79('0x3d')]()]))return _0x293184[_0xfe79('0x34')]=!![];if(!_0x293184[_0xfe79('0x34')])return _0x293184[_0xfe79('0x35')]=!![];}function getVoiceQueueAgents(_0x16f9c1,_0x435868,_0xc8d591,_0x36301f){var _0xb4daad=_[_0xfe79('0x3e')](_0x435868,['id',_0x16f9c1['id']]);if(!_0xb4daad)return _0x16f9c1;return _0xb4daad[_0xfe79('0x3f')]({'raw':!![]})[_0xfe79('0x12')](function(_0x139f77){for(var _0x32e98c=0x0;_0x32e98c<_0x139f77[_0xfe79('0x3b')];_0x32e98c++){var _0x5ccd77=_[_0xfe79('0x3e')](_0xc8d591,['id',_0x139f77[_0x32e98c][_0xfe79('0x40')]]);if(!_0x5ccd77){_0x5ccd77={'id':_0x139f77[_0x32e98c][_0xfe79('0x40')],'name':_0x139f77[_0x32e98c][_0xfe79('0x40')],'accountcode':'','online':![]};}var _0x509658={'id':_0x5ccd77['id'],'name':_0x5ccd77[_0xfe79('0xf')],'internal':_0x5ccd77[_0xfe79('0x41')],'online':Boolean(_0x5ccd77[_0xfe79('0x42')]),'paused':Boolean(_0x139f77[_0x32e98c][_0xfe79('0x1b')])};if(_0x5ccd77[_0xfe79('0x43')]===_0xfe79('0x34'))updateAgentVoiceStatus(_0x509658,_0x16f9c1,_0x36301f);if(_0x509658['online'])_0x16f9c1[_0xfe79('0x33')]++;if(_0x509658[_0xfe79('0x35')])_0x16f9c1[_0xfe79('0x35')]++;if(_0x509658['paused']&&!_0x509658['busy']&&!_0x509658['talking'])_0x16f9c1['paused']++;_0x16f9c1[_0xfe79('0x32')][_0xfe79('0x1d')](_0x509658);}return _0x16f9c1;});}function getQueueAgents(_0x5458b1,_0x269d5f,_0x1b36ad){var _0x5a80cc=_0xfe79('0x44')+_[_0xfe79('0x14')](_0x1b36ad)+_0xfe79('0x45');var _0x2a8d7f=_0x1b36ad+_0xfe79('0x46');return db[_0x5a80cc][_0xfe79('0x47')]({'where':{[_[_0xfe79('0x14')](_0x1b36ad)+_0xfe79('0x48')]:_0x5458b1['id']},'raw':!![]})[_0xfe79('0x12')](function(_0x17d0bb){for(var _0x28e388=0x0;_0x28e388<_0x17d0bb[_0xfe79('0x3b')];_0x28e388++){var _0x583ac1=_[_0xfe79('0x3e')](_0x269d5f,['id',_0x17d0bb[_0x28e388][_0xfe79('0x40')]]);if(!_0x583ac1){_0x583ac1={'id':_0x17d0bb[_0x28e388][_0xfe79('0x40')],'name':_0x17d0bb[_0x28e388][_0xfe79('0x40')],'online':![],['pauseField']:![]};}var _0x4d5232={'id':_0x583ac1['id'],'name':_0x583ac1['name'],'online':Boolean(_0x583ac1['online']),'paused':Boolean(_0x583ac1[_0x2a8d7f])};if(_0x4d5232[_0xfe79('0x42')])_0x5458b1['loggedInDb']++;_0x5458b1[_0xfe79('0x32')][_0xfe79('0x1d')](_0x4d5232);}return _0x5458b1;});}exports['getQueues']=function(_0x1ba220,_0x1dbebb){var _0xad71be=['mail',_0xfe79('0x49'),_0xfe79('0x4a'),_0xfe79('0x4b'),_0xfe79('0x4c'),_0xfe79('0x4d'),'voice'];var _0x5e645b={'count':0x0,'rows':[]},_0x300765={},_0x16e86a,_0x38482a,_0xba8aa3,_0xe81a38,_0x57a57f;Promise[_0xfe79('0x4e')]()[_0xfe79('0x12')](function(){if(_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')]){if(!_[_0xfe79('0x51')](_0xad71be,_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')][_0xfe79('0x52')]()))throw new Error(_0xfe79('0x53'));_0x16e86a=_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')]['toLowerCase']();}var _0x6d6e93=_[_0xfe79('0x14')](_0x16e86a)+_0xfe79('0x45');var _0x373663=_[_0xfe79('0x30')](db[_0x6d6e93]['rawAttributes'],function(_0x5cf9b9){return{'name':_0x5cf9b9[_0xfe79('0x54')],'type':_0x5cf9b9['type'][_0xfe79('0x55')]};});_0x300765=qs[_0xfe79('0x56')](_0x373663,_0x1ba220);if(_0x1ba220[_0xfe79('0x57')][_0xfe79('0x58')]===_0xfe79('0x57')){var _0x7155f7={'params':{'id':_0x1ba220[_0xfe79('0x57')][_0xfe79('0x59')]},'query':{'section':_0x16e86a===_0xfe79('0x1c')&&_0x1ba220['query']['type']===_0xfe79('0x36')?_0xfe79('0x5a'):_[_0xfe79('0x14')](_0x16e86a)+_0xfe79('0x15'),'type':_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x5b')],'nolimit':!![],'sort':_0xfe79('0xf'),'filter':_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x39')]}};return db[_0xfe79('0x5c')]['getResources'](_0x7155f7);}return db[_0x6d6e93][_0xfe79('0x5d')](_0x300765);})[_0xfe79('0x12')](function(_0x257c41){_0x5e645b[_0xfe79('0x5e')]=_0x257c41[_0xfe79('0x5e')];_0x38482a=_0x257c41[_0xfe79('0x5f')];return getRealtimeQueues(_0x1ba220,_0x16e86a);})['then'](function(_0x5768d4){_0xe81a38=_0x5768d4[_0xfe79('0x5f')];return getRealtimeAgents();})[_0xfe79('0x12')](function(_0x24e5e9){_0xba8aa3=_0x24e5e9['rows'];if(_0x16e86a!=_0xfe79('0x1c'))return;return getRealtimeVoiceQueueChannels();})[_0xfe79('0x12')](function(_0x51ad83){_0x57a57f=_0x51ad83?_0x51ad83['rows']:[];return initializeQueues(_0x38482a,_0xe81a38,_0x16e86a,_0x1ba220[_0xfe79('0x4f')]['type']);})[_0xfe79('0x12')](function(_0x836ef2){var _0x5edfd7=_0x836ef2[_0xfe79('0x30')](function(_0xcaff58){if(_0x16e86a===_0xfe79('0x1c'))return getVoiceQueueAgents(_0xcaff58,_0x38482a,_0xba8aa3,_0x57a57f);else return getQueueAgents(_0xcaff58,_0xba8aa3,_0x16e86a);});return Promise['all'](_0x5edfd7);})[_0xfe79('0x12')](function(_0x17e526){_0x5e645b['rows']=_0x17e526;return _0x5e645b;})['then'](respondWithFilteredResult(_0x1dbebb,_0x300765))[_0xfe79('0x60')](handleError(_0x1dbebb,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 32924a1..71747c5 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x278474,_0x4bb2ee){var _0x2e207f=function(_0x2780d9){while(--_0x2780d9){_0x278474['push'](_0x278474['shift']());}};_0x2e207f(++_0x4bb2ee);}(_0xedd9,0xfc));var _0x9edd=function(_0xad885c,_0x3fd8bb){_0xad885c=_0xad885c-0x0;var _0x3d3d45=_0xedd9[_0xad885c];return _0x3d3d45;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 5d34f0e..527976f 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 _0x7919=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5528fa,_0x4f0b2e){var _0x489299=function(_0x5db840){while(--_0x5db840){_0x5528fa['push'](_0x5528fa['shift']());}};_0x489299(++_0x4f0b2e);}(_0x7919,0xeb));var _0x9791=function(_0x543d2d,_0x4436e2){_0x543d2d=_0x543d2d-0x0;var _0x3d5343=_0x7919[_0x543d2d];return _0x3d5343;};'use strict';var Sequelize=require(_0x9791('0x0'));module[_0x9791('0x1')]={'state':{'type':Sequelize[_0x9791('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9791('0x3')]},'scheduledat':{'type':Sequelize[_0x9791('0x4')]},'uniqueid':{'type':Sequelize[_0x9791('0x3')]},'starttime':{'type':Sequelize[_0x9791('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9791('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9791('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9791('0x3')]}}; \ No newline at end of file +var _0xf072=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x274341,_0x5b2806){var _0x3c599b=function(_0x2a6434){while(--_0x2a6434){_0x274341['push'](_0x274341['shift']());}};_0x3c599b(++_0x5b2806);}(_0xf072,0x1cf));var _0x2f07=function(_0x4a7a9,_0x3d85d8){_0x4a7a9=_0x4a7a9-0x0;var _0x1f4e07=_0xf072[_0x4a7a9];return _0x1f4e07;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'state':{'type':Sequelize[_0x2f07('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2f07('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2f07('0x3')]},'responsetime':{'type':Sequelize[_0x2f07('0x3')]},'ringtime':{'type':Sequelize[_0x2f07('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2f07('0x4')]},'membername':{'type':Sequelize[_0x2f07('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e356f42..bbc14c1 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 _0x1323=['path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','../../config/logger','api','moment','request-promise'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0x1323,0xd8));var _0x3132=function(_0x1c0982,_0x1247ce){_0x1c0982=_0x1c0982-0x0;var _0x2106a4=_0x1323[_0x1c0982];return _0x2106a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3132('0x0'))(_0x3132('0x1'));var moment=require(_0x3132('0x2'));var BPromise=require('bluebird');var rp=require(_0x3132('0x3'));var fs=require('fs');var path=require(_0x3132('0x4'));var rimraf=require('rimraf');var config=require(_0x3132('0x5'));var attributes=require(_0x3132('0x6'));module[_0x3132('0x7')]=function(_0x2ce1d1,_0x12a011){return _0x2ce1d1[_0x3132('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x3132('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68aa=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0xb79d48,_0x21c0fb){var _0x543ac3=function(_0xeb08e3){while(--_0xeb08e3){_0xb79d48['push'](_0xb79d48['shift']());}};_0x543ac3(++_0x21c0fb);}(_0x68aa,0x8d));var _0xa68a=function(_0x187aa1,_0x1f5358){_0x187aa1=_0x187aa1-0x0;var _0x309658=_0x68aa[_0x187aa1];return _0x309658;};'use strict';var _=require(_0xa68a('0x0'));var util=require(_0xa68a('0x1'));var logger=require(_0xa68a('0x2'))(_0xa68a('0x3'));var moment=require(_0xa68a('0x4'));var BPromise=require(_0xa68a('0x5'));var rp=require(_0xa68a('0x6'));var fs=require('fs');var path=require(_0xa68a('0x7'));var rimraf=require('rimraf');var config=require(_0xa68a('0x8'));var attributes=require(_0xa68a('0x9'));module[_0xa68a('0xa')]=function(_0x1a4f05,_0x307388){return _0x1a4f05[_0xa68a('0xb')](_0xa68a('0xc'),attributes,{'tableName':_0xa68a('0xd'),'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 6f38b4c..a026e3a 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 _0x1438=['ReportAgentPreview','create','body','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateReportAgentPreview'];(function(_0x54e53e,_0x3eb4fe){var _0x98e574=function(_0x1e0b30){while(--_0x1e0b30){_0x54e53e['push'](_0x54e53e['shift']());}};_0x98e574(++_0x3eb4fe);}(_0x1438,0xad));var _0x8143=function(_0xf219b,_0x1ad38e){_0xf219b=_0xf219b-0x0;var _0x4db27e=_0x1438[_0xf219b];return _0x4db27e;};'use strict';var _=require(_0x8143('0x0'));var util=require('util');var moment=require(_0x8143('0x1'));var BPromise=require('bluebird');var rs=require(_0x8143('0x2'));var fs=require('fs');var Redis=require(_0x8143('0x3'));var db=require(_0x8143('0x4'))['db'];var utils=require(_0x8143('0x5'));var logger=require(_0x8143('0x6'))(_0x8143('0x7'));var config=require(_0x8143('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8143('0x9')][_0x8143('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x87422e,_0x362939,_0x34e96b){return new BPromise(function(_0x140cac,_0xae9415){return client[_0x8143('0xb')](_0x87422e,_0x34e96b)[_0x8143('0xc')](function(_0x361869){logger[_0x8143('0xd')](_0x8143('0xe'),_0x362939,_0x8143('0xf'));logger[_0x8143('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x362939,_0x8143('0xf'),JSON[_0x8143('0x11')](_0x361869));if(_0x361869[_0x8143('0x12')]){if(_0x361869[_0x8143('0x12')][_0x8143('0x13')]===0x1f4){logger[_0x8143('0x12')](_0x8143('0xe'),_0x362939,_0x361869[_0x8143('0x12')][_0x8143('0x14')]);return _0xae9415(_0x361869[_0x8143('0x12')][_0x8143('0x14')]);}logger[_0x8143('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x362939,_0x361869[_0x8143('0x12')][_0x8143('0x14')]);return _0x140cac(_0x361869[_0x8143('0x12')][_0x8143('0x14')]);}else{logger[_0x8143('0xd')](_0x8143('0xe'),_0x362939,_0x8143('0xf'));_0x140cac(_0x361869[_0x8143('0x15')][_0x8143('0x14')]);}})['catch'](function(_0x2999e2){logger[_0x8143('0x12')](_0x8143('0xe'),_0x362939,_0x2999e2);_0xae9415(_0x2999e2);});});}exports[_0x8143('0x16')]=function(_0x48a87f){var _0x17fb57=this;return new Promise(function(_0x39274d,_0x1d05cc){return db[_0x8143('0x17')][_0x8143('0x18')](_0x48a87f[_0x8143('0x19')],{'raw':_0x48a87f['options']?_0x48a87f[_0x8143('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5a49ee){logger[_0x8143('0xd')](_0x8143('0x16'),_0x48a87f);logger['debug'](_0x8143('0x16'),_0x48a87f,JSON[_0x8143('0x11')](_0x5a49ee));_0x39274d(_0x5a49ee);})[_0x8143('0x1b')](function(_0x4ce134){logger[_0x8143('0x12')](_0x8143('0x16'),_0x4ce134[_0x8143('0x14')],_0x48a87f);_0x1d05cc(_0x17fb57[_0x8143('0x12')](0x1f4,_0x4ce134[_0x8143('0x14')]));});});}; \ No newline at end of file +var _0xc0c5=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','util','moment','bluebird'];(function(_0x11ef01,_0x31a929){var _0xa6b94c=function(_0x885c9e){while(--_0x885c9e){_0x11ef01['push'](_0x11ef01['shift']());}};_0xa6b94c(++_0x31a929);}(_0xc0c5,0x1d9));var _0x5c0c=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0xc0c5[_0x7a112];return _0x136dc5;};'use strict';var _=require('lodash');var util=require(_0x5c0c('0x0'));var moment=require(_0x5c0c('0x1'));var BPromise=require(_0x5c0c('0x2'));var rs=require(_0x5c0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c0c('0x4'));var logger=require(_0x5c0c('0x5'))(_0x5c0c('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c0c('0x7'));var client=jayson[_0x5c0c('0x8')][_0x5c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116c9a,_0x5204fb,_0x3b4051){return new BPromise(function(_0x560196,_0x14dda0){return client[_0x5c0c('0xa')](_0x116c9a,_0x3b4051)[_0x5c0c('0xb')](function(_0x3d4fdb){logger[_0x5c0c('0xc')](_0x5c0c('0xd'),_0x5204fb,_0x5c0c('0xe'));logger[_0x5c0c('0xf')](_0x5c0c('0x10'),_0x5204fb,'request\x20sent',JSON[_0x5c0c('0x11')](_0x3d4fdb));if(_0x3d4fdb[_0x5c0c('0x12')]){if(_0x3d4fdb[_0x5c0c('0x12')][_0x5c0c('0x13')]===0x1f4){logger[_0x5c0c('0x12')](_0x5c0c('0xd'),_0x5204fb,_0x3d4fdb['error'][_0x5c0c('0x14')]);return _0x14dda0(_0x3d4fdb[_0x5c0c('0x12')]['message']);}logger[_0x5c0c('0x12')](_0x5c0c('0xd'),_0x5204fb,_0x3d4fdb['error']['message']);return _0x560196(_0x3d4fdb['error'][_0x5c0c('0x14')]);}else{logger[_0x5c0c('0xc')](_0x5c0c('0xd'),_0x5204fb,_0x5c0c('0xe'));_0x560196(_0x3d4fdb[_0x5c0c('0x15')][_0x5c0c('0x14')]);}})[_0x5c0c('0x16')](function(_0x4ba6aa){logger['error'](_0x5c0c('0xd'),_0x5204fb,_0x4ba6aa);_0x14dda0(_0x4ba6aa);});});}exports[_0x5c0c('0x17')]=function(_0x145e06){var _0x5a8df1=this;return new Promise(function(_0x536aaf,_0x5b81ea){return db[_0x5c0c('0x18')][_0x5c0c('0x19')](_0x145e06[_0x5c0c('0x1a')],{'raw':_0x145e06[_0x5c0c('0x1b')]?_0x145e06[_0x5c0c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x5c0c('0xb')](function(_0x11ec5a){logger[_0x5c0c('0xc')](_0x5c0c('0x17'),_0x145e06);logger[_0x5c0c('0xf')](_0x5c0c('0x17'),_0x145e06,JSON[_0x5c0c('0x11')](_0x11ec5a));_0x536aaf(_0x11ec5a);})[_0x5c0c('0x16')](function(_0x5726dd){logger[_0x5c0c('0x12')](_0x5c0c('0x17'),_0x5726dd[_0x5c0c('0x14')],_0x145e06);_0x5b81ea(_0x5a8df1[_0x5c0c('0x12')](0x1f4,_0x5726dd[_0x5c0c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c868c63..1d8e6ab 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 _0x0be7=['whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','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/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','get','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannel','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0x8338b1,_0x1eb097){var _0x4f4e95=function(_0x19fe46){while(--_0x19fe46){_0x8338b1['push'](_0x8338b1['shift']());}};_0x4f4e95(++_0x1eb097);}(_0x0be7,0x158));var _0x70be=function(_0x3a6a05,_0x2f515e){_0x3a6a05=_0x3a6a05-0x0;var _0x4e0452=_0x0be7[_0x3a6a05];return _0x4e0452;};'use strict';var multer=require(_0x70be('0x0'));var util=require(_0x70be('0x1'));var path=require(_0x70be('0x2'));var express=require(_0x70be('0x3'));var router=express['Router']();var auth=require(_0x70be('0x4'));var controller=require('./rpc.controller');router['get'](_0x70be('0x5'),auth[_0x70be('0x6')](),controller['voiceChannels']);router['get'](_0x70be('0x7'),auth[_0x70be('0x6')](),controller['voiceChannelMixMonitor']);router['get'](_0x70be('0x8'),auth[_0x70be('0x6')](),controller[_0x70be('0x9')]);router[_0x70be('0xa')](_0x70be('0xb'),auth[_0x70be('0x6')](),controller['voiceQueues']);router[_0x70be('0xa')](_0x70be('0xc'),auth['isAuthenticated'](),controller[_0x70be('0xd')]);router['get'](_0x70be('0xe'),auth[_0x70be('0x6')](),controller['mailQueues']);router['get'](_0x70be('0xf'),auth[_0x70be('0x6')](),controller[_0x70be('0x10')]);router[_0x70be('0xa')](_0x70be('0x11'),auth[_0x70be('0x6')](),controller[_0x70be('0x12')]);router[_0x70be('0xa')](_0x70be('0x13'),auth[_0x70be('0x6')](),controller[_0x70be('0x14')]);router[_0x70be('0xa')](_0x70be('0x15'),auth[_0x70be('0x6')](),controller['whatsappQueues']);router[_0x70be('0xa')](_0x70be('0x16'),auth[_0x70be('0x6')](),controller[_0x70be('0x17')]);router[_0x70be('0xa')](_0x70be('0x18'),auth[_0x70be('0x6')](),controller['voiceQueuesPreview']);router['get'](_0x70be('0x19'),auth[_0x70be('0x6')](),controller['voiceQueuesChannels']);router[_0x70be('0xa')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x70be('0x1a')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x70be('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x70be('0xa')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x70be('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0x70be('0xa')](_0x70be('0x1b'),auth[_0x70be('0x6')](),controller[_0x70be('0x1c')]);router['put'](_0x70be('0x1b'),auth[_0x70be('0x6')](),controller[_0x70be('0x1d')]);router['get'](_0x70be('0x1e'),auth[_0x70be('0x6')](),controller[_0x70be('0x1f')]);router['get'](_0x70be('0x20'),auth['isAuthenticated'](),controller[_0x70be('0x21')]);router[_0x70be('0xa')](_0x70be('0x22'),auth[_0x70be('0x6')](),controller[_0x70be('0x23')]);router['put'](_0x70be('0x24'),auth[_0x70be('0x6')](),controller[_0x70be('0x25')]);router['get']('/telephones',auth[_0x70be('0x6')](),controller[_0x70be('0x26')]);router[_0x70be('0xa')]('/trunks',auth[_0x70be('0x6')](),controller[_0x70be('0x27')]);router[_0x70be('0xa')](_0x70be('0x28'),auth[_0x70be('0x6')](),controller[_0x70be('0x29')]);router[_0x70be('0xa')](_0x70be('0x2a'),auth[_0x70be('0x6')](),controller[_0x70be('0x2b')]);router[_0x70be('0xa')]('/chat/queues/waitinginteractions',auth[_0x70be('0x6')](),controller[_0x70be('0x2c')]);router[_0x70be('0xa')](_0x70be('0x2d'),auth['isAuthenticated'](),controller[_0x70be('0x2e')]);router[_0x70be('0xa')](_0x70be('0x2f'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x70be('0xa')](_0x70be('0x30'),auth['isAuthenticated'](),controller[_0x70be('0x31')]);router[_0x70be('0xa')]('/sms/queues/waitinginteractions',auth[_0x70be('0x6')](),controller[_0x70be('0x32')]);router[_0x70be('0xa')]('/whatsapp/queues/waitinginteractions',auth[_0x70be('0x6')](),controller[_0x70be('0x33')]);router[_0x70be('0xa')](_0x70be('0x34'),auth['isAuthenticated'](),controller[_0x70be('0x35')]);router[_0x70be('0x36')](_0x70be('0x37'),auth[_0x70be('0x6')](),controller[_0x70be('0x38')](_0x70be('0x39')));router[_0x70be('0xa')](_0x70be('0x3a'),auth['isAuthenticated'](),controller[_0x70be('0x3b')]);router['post'](_0x70be('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x70be('0x3d')));router['get'](_0x70be('0x3e'),auth[_0x70be('0x6')](),controller[_0x70be('0x3f')]);router['post'](_0x70be('0x40'),auth['isAuthenticated'](),controller['queueNotify']('fax'));router['get'](_0x70be('0x41'),auth[_0x70be('0x6')](),controller[_0x70be('0x42')]);router[_0x70be('0x36')](_0x70be('0x43'),auth[_0x70be('0x6')](),controller[_0x70be('0x38')](_0x70be('0x44')));router['get'](_0x70be('0x45'),auth[_0x70be('0x6')](),controller[_0x70be('0x46')]);router[_0x70be('0x36')](_0x70be('0x47'),auth['isAuthenticated'](),controller[_0x70be('0x38')](_0x70be('0x48')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x70be('0x49')));router[_0x70be('0xa')](_0x70be('0x4a'),auth[_0x70be('0x6')](),controller['showSmsQueues']);router[_0x70be('0xa')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x70be('0x4b')]);router['post'](_0x70be('0x4c'),auth[_0x70be('0x6')](),controller[_0x70be('0x4d')]);module[_0x70be('0x4e')]=router; \ No newline at end of file +var _0x29a2=['showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id'];(function(_0x4cf7b1,_0x5386b8){var _0xe7c159=function(_0x13bd87){while(--_0x13bd87){_0x4cf7b1['push'](_0x4cf7b1['shift']());}};_0xe7c159(++_0x5386b8);}(_0x29a2,0x18d));var _0x229a=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x29a2[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0x229a('0x0'));var path=require('path');var express=require(_0x229a('0x1'));var router=express[_0x229a('0x2')]();var auth=require(_0x229a('0x3'));var controller=require(_0x229a('0x4'));router[_0x229a('0x5')](_0x229a('0x6'),auth['isAuthenticated'](),controller[_0x229a('0x7')]);router[_0x229a('0x5')](_0x229a('0x8'),auth[_0x229a('0x9')](),controller[_0x229a('0xa')]);router[_0x229a('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x229a('0x9')](),controller[_0x229a('0xb')]);router['get'](_0x229a('0xc'),auth[_0x229a('0x9')](),controller[_0x229a('0xd')]);router[_0x229a('0x5')]('/chat/queues',auth[_0x229a('0x9')](),controller[_0x229a('0xe')]);router[_0x229a('0x5')]('/mail/queues',auth[_0x229a('0x9')](),controller[_0x229a('0xf')]);router[_0x229a('0x5')](_0x229a('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x229a('0x5')](_0x229a('0x11'),auth[_0x229a('0x9')](),controller['openchannelQueues']);router[_0x229a('0x5')](_0x229a('0x12'),auth['isAuthenticated'](),controller[_0x229a('0x13')]);router['get']('/whatsapp/queues',auth[_0x229a('0x9')](),controller[_0x229a('0x14')]);router['get'](_0x229a('0x15'),auth[_0x229a('0x9')](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x16')]);router[_0x229a('0x5')](_0x229a('0x17'),auth['isAuthenticated'](),controller[_0x229a('0x18')]);router[_0x229a('0x5')](_0x229a('0x19'),auth[_0x229a('0x9')](),controller[_0x229a('0x1a')]);router[_0x229a('0x5')](_0x229a('0x1b'),auth[_0x229a('0x9')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x229a('0x9')](),controller[_0x229a('0x1c')]);router[_0x229a('0x5')]('/voice/queues/:id',auth[_0x229a('0x9')](),controller['showVoiceQueues']);router[_0x229a('0x1d')](_0x229a('0x1e'),auth[_0x229a('0x9')](),controller['updateVoiceQueue']);router[_0x229a('0x5')](_0x229a('0x1f'),auth['isAuthenticated'](),controller[_0x229a('0x20')]);router[_0x229a('0x5')](_0x229a('0x21'),auth[_0x229a('0x9')](),controller[_0x229a('0x22')]);router[_0x229a('0x5')](_0x229a('0x23'),auth[_0x229a('0x9')](),controller[_0x229a('0x24')]);router[_0x229a('0x1d')]('/agents/:id/capacity',auth[_0x229a('0x9')](),controller[_0x229a('0x25')]);router[_0x229a('0x5')](_0x229a('0x26'),auth[_0x229a('0x9')](),controller[_0x229a('0x27')]);router[_0x229a('0x5')](_0x229a('0x28'),auth[_0x229a('0x9')](),controller[_0x229a('0x29')]);router[_0x229a('0x5')]('/campaigns',auth[_0x229a('0x9')](),controller[_0x229a('0x2a')]);router['get'](_0x229a('0x2b'),auth['isAuthenticated'](),controller[_0x229a('0x2c')]);router[_0x229a('0x5')]('/chat/queues/waitinginteractions',auth[_0x229a('0x9')](),controller[_0x229a('0x2d')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x229a('0x5')](_0x229a('0x2e'),auth[_0x229a('0x9')](),controller[_0x229a('0x2f')]);router['get'](_0x229a('0x30'),auth[_0x229a('0x9')](),controller[_0x229a('0x31')]);router[_0x229a('0x5')](_0x229a('0x32'),auth[_0x229a('0x9')](),controller[_0x229a('0x33')]);router[_0x229a('0x5')](_0x229a('0x34'),auth[_0x229a('0x9')](),controller[_0x229a('0x35')]);router[_0x229a('0x5')]('/fax/queues/waitinginteractions',auth[_0x229a('0x9')](),controller[_0x229a('0x36')]);router['post'](_0x229a('0x37'),auth[_0x229a('0x9')](),controller[_0x229a('0x38')](_0x229a('0x39')));router['get'](_0x229a('0x3a'),auth[_0x229a('0x9')](),controller[_0x229a('0x3b')]);router[_0x229a('0x3c')](_0x229a('0x3d'),auth[_0x229a('0x9')](),controller['queueNotify'](_0x229a('0x3e')));router[_0x229a('0x5')](_0x229a('0x3f'),auth[_0x229a('0x9')](),controller['showChatQueues']);router[_0x229a('0x3c')](_0x229a('0x40'),auth['isAuthenticated'](),controller[_0x229a('0x38')](_0x229a('0x41')));router[_0x229a('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x229a('0x42')]);router[_0x229a('0x3c')](_0x229a('0x43'),auth[_0x229a('0x9')](),controller['queueNotify']('openchannel'));router[_0x229a('0x5')](_0x229a('0x44'),auth[_0x229a('0x9')](),controller['showOpenchannelQueues']);router[_0x229a('0x3c')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x229a('0x38')]('sms'));router[_0x229a('0x3c')](_0x229a('0x45'),auth[_0x229a('0x9')](),controller[_0x229a('0x38')](_0x229a('0x46')));router['get'](_0x229a('0x47'),auth[_0x229a('0x9')](),controller[_0x229a('0x48')]);router[_0x229a('0x5')]('/whatsapp/queues/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x49')]);router[_0x229a('0x3c')](_0x229a('0x4a'),auth[_0x229a('0x9')](),controller[_0x229a('0x4b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5df899b..d71e3dc 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 _0xda19=['rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','TransferReport','moment','lodash','../../mysqldb','api','client','http','then','error','code','message','status','json','name','send','isNil'];(function(_0x551906,_0x569941){var _0x58bfb6=function(_0x1eb6de){while(--_0x1eb6de){_0x551906['push'](_0x551906['shift']());}};_0x58bfb6(++_0x569941);}(_0xda19,0xd5));var _0x9da1=function(_0x3c7f88,_0x15ee86){_0x3c7f88=_0x3c7f88-0x0;var _0x31cefe=_0xda19[_0x3c7f88];return _0x31cefe;};'use strict';var BPromise=require('bluebird');var moment=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));var util=require('util');var db=require(_0x9da1('0x2'))['db'];var logger=require('../../config/logger')(_0x9da1('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232a});var mailClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232b});var routingClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){var _0x55f66b=_0x1c24e6?_0x1c24e6:amiClient;return _0x55f66b['request'](_0x23e4f7,_0x2c3cdd)[_0x9da1('0x6')](function(_0x493d0b){if(_0x493d0b[_0x9da1('0x7')]){if(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x8')]===0x1f4){return _0x47df89(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}return _0x5e2d18(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}else{_0x5e2d18(_0x493d0b['result']);}})['catch'](function(_0x3114f7){_0x47df89(_0x3114f7);});});}function respondWithResult(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xc8;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0xa')](_0x4735c7)[_0x9da1('0xb')](_0x1d93f8);}return _0x596b6b['sendStatus'](0x194);};}function handleError(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0x1f4;return function(_0x4d17e1){logger[_0x9da1('0x7')](_0x4d17e1['stack']);if(_0x4d17e1[_0x9da1('0xc')]){delete _0x4d17e1[_0x9da1('0xc')];}_0x2837e3[_0x9da1('0xa')](_0x535a13)[_0x9da1('0xd')](_0x4d17e1);};}function findById(_0x7f1a64){return function(_0x514d8e){if(!_[_0x9da1('0xe')](_0x7f1a64)&&!_[_0x9da1('0xe')](_0x514d8e)&&!_[_0x9da1('0xe')](_0x514d8e[_0x9da1('0xf')])){return _[_0x9da1('0x10')](_0x514d8e[_0x9da1('0xf')],function(_0x497676){return _0x497676['id']==_0x7f1a64;});}return null;};}exports['voiceChannels']=function(_0x17205d,_0x8da712){return respondWithRpcPromise(_0x9da1('0x11'),_0x17205d[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x8da712,null))[_0x9da1('0x13')](handleError(_0x8da712,null));};exports[_0x9da1('0x14')]=function(_0x47e5cf,_0x1a459c){return respondWithRpcPromise(_0x9da1('0x15'),_[_0x9da1('0x16')](_0x47e5cf[_0x9da1('0x12')],_0x47e5cf[_0x9da1('0x17')]))['then'](respondWithResult(_0x1a459c,null))['catch'](handleError(_0x1a459c,null));};exports[_0x9da1('0x18')]=function(_0x3e6f85,_0x16ee0c){return respondWithRpcPromise(_0x9da1('0x19'),_[_0x9da1('0x16')](_0x3e6f85[_0x9da1('0x12')],_0x3e6f85['params']))[_0x9da1('0x6')](respondWithResult(_0x16ee0c,null))[_0x9da1('0x13')](handleError(_0x16ee0c,null));};exports['voiceQueues']=function(_0x45fcce,_0x3f5680){return respondWithRpcPromise('VoiceQueues',_0x45fcce[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x3f5680,null))['catch'](handleError(_0x3f5680,null));};exports[_0x9da1('0x1a')]=function(_0x1d6af5,_0x55cd3d){return respondWithRpcPromise('VoiceQueues',_0x1d6af5[_0x9da1('0x12')])[_0x9da1('0x6')](findById(_0x1d6af5['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x55cd3d,null))['catch'](handleError(_0x55cd3d,null));};exports['updateVoiceQueue']=function(_0x5a59c2,_0x31b826){return respondWithRpcPromise(_0x9da1('0x1b'),_[_0x9da1('0x16')](_0x5a59c2[_0x9da1('0x1c')],_0x5a59c2[_0x9da1('0x17')]))['then'](respondWithResult(_0x31b826,null))[_0x9da1('0x13')](handleError(_0x31b826,null));};exports['voiceQueuesPreview']=function(_0x1feae0,_0x235ced){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x9da1('0x16')](_0x1feae0[_0x9da1('0x12')],_0x1feae0['params']))[_0x9da1('0x6')](respondWithResult(_0x235ced,null))[_0x9da1('0x13')](handleError(_0x235ced,null));};exports[_0x9da1('0x1d')]=function(_0x2b2b48,_0x581e9f){return respondWithRpcPromise('VoiceQueuesChannels',_0x2b2b48[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x581e9f,null))[_0x9da1('0x13')](handleError(_0x581e9f,null));};exports[_0x9da1('0x1e')]=function(_0x193273,_0x559645){return respondWithRpcPromise(_0x9da1('0x1f'),_[_0x9da1('0x16')](_0x193273[_0x9da1('0x12')],_0x193273[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x559645,null))[_0x9da1('0x13')](handleError(_0x559645,null));};exports['voiceQueuesChannelHangup']=function(_0xa43301,_0x5af570){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9da1('0x16')](_0xa43301['query'],_0xa43301[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x5af570,null))[_0x9da1('0x13')](handleError(_0x5af570,null));};exports[_0x9da1('0x20')]=function(_0x98b294,_0x5efa40){return respondWithRpcPromise(_0x9da1('0x21'),_[_0x9da1('0x16')](_0x98b294['query'],_0x98b294[_0x9da1('0x17')]))['then'](respondWithResult(_0x5efa40,null))[_0x9da1('0x13')](handleError(_0x5efa40,null));};exports['outbound']=function(_0x5eaa7e,_0x1ce0f8){return respondWithRpcPromise('Outbound',_0x5eaa7e[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x1ce0f8,null))['catch'](handleError(_0x1ce0f8,null));};exports[_0x9da1('0x22')]=function(_0x1b750f,_0x390457){return respondWithRpcPromise(_0x9da1('0x23'),_0x1b750f['query'])[_0x9da1('0x6')](respondWithResult(_0x390457,null))['catch'](handleError(_0x390457,null));};exports[_0x9da1('0x24')]=function(_0x4bdaf1,_0x26e8d3){var _0x46c176;return respondWithRpcPromise('Agents',_0x4bdaf1[_0x9da1('0x12')])[_0x9da1('0x6')](function(_0x394acf){_0x46c176=_0x394acf;return respondWithRpcPromise('Agents',_0x4bdaf1['query'],routingClient);})['then'](function(_0x27e78c){return _['merge']({},_0x27e78c,_0x46c176);})[_0x9da1('0x6')](respondWithResult(_0x26e8d3,null))[_0x9da1('0x13')](handleError(_0x26e8d3,null));};exports[_0x9da1('0x25')]=function(_0x43c064,_0x54f188){if(_0x43c064[_0x9da1('0x1c')]&&_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')]&&_0x43c064[_0x9da1('0x27')]&&_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]){for(var _0x28e0b2 in _0x43c064['body'][_0x9da1('0x26')]){if(_0x43c064['body'][_0x9da1('0x26')]['hasOwnProperty'](_0x28e0b2)){db[_0x9da1('0x28')][_0x9da1('0x29')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'type':_0x9da1('0x2a'),'exitAt':null,'uniqueid':_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2]&&_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2][_0x9da1('0x2b')]?{'$notIn':_0x43c064['body']['interaction'][_0x28e0b2]}:{'$ne':null}}})[_0x9da1('0x6')](function(_0x3f3688){var _0x15bb24=moment()[_0x9da1('0x2c')](_0x9da1('0x2d'));for(var _0x15578d=0x0,_0x2d7003=_0x3f3688[_0x9da1('0x2b')];_0x15578d<_0x2d7003;_0x15578d+=0x1){_0x3f3688[_0x15578d]['updateAttributes']({'exitAt':_0x15bb24});}});for(var _0xd7fb0a=0x0;_0xd7fb0a<_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2]['length'];_0xd7fb0a+=0x1){db[_0x9da1('0x28')][_0x9da1('0x2e')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064[_0x9da1('0x27')]['name'],'type':_0x9da1('0x2a'),'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a],'exitAt':null},'defaults':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'interface':_['isNil'](_0x43c064['user'][_0x9da1('0x2f')])?util[_0x9da1('0x2c')]('SIP/%s',_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]):_0x43c064['user'][_0x9da1('0x2f')],'type':_0x9da1('0x2a'),'enterAt':moment()[_0x9da1('0x2c')](_0x9da1('0x2d')),'role':_0x9da1('0x30'),'internal':_0x43c064[_0x9da1('0x27')][_0x9da1('0x31')],'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x43c064[_0x9da1('0x17')]['id'],'capacity':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x32')]},routingClient)[_0x9da1('0x6')](respondWithResult(_0x54f188,null))['catch'](handleError(_0x54f188,null));};exports['telephones']=function(_0xf36078,_0x6ca1ac){return respondWithRpcPromise(_0x9da1('0x33'),_0xf36078[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x6ca1ac,null))[_0x9da1('0x13')](handleError(_0x6ca1ac,null));};exports[_0x9da1('0x34')]=function(_0x1b1148,_0x34327e){return respondWithRpcPromise(_0x9da1('0x35'),_0x1b1148[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x34327e,null))[_0x9da1('0x13')](handleError(_0x34327e,null));};exports[_0x9da1('0x36')]=function(_0x4c99e8,_0x26ecdb){return respondWithRpcPromise(_0x9da1('0x37'),_0x4c99e8['query'])[_0x9da1('0x6')](respondWithResult(_0x26ecdb,null))['catch'](handleError(_0x26ecdb,null));};exports[_0x9da1('0x38')]=function(_0x4f4980,_0x5df0d8){return respondWithRpcPromise(_0x9da1('0x39'),_0x4f4980[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5df0d8,null))[_0x9da1('0x13')](handleError(_0x5df0d8,null));};exports[_0x9da1('0x3a')]=function(_0x2787e1,_0x343b05){return respondWithRpcPromise(_0x9da1('0x39'),_0x2787e1[_0x9da1('0x12')],routingClient)['then'](findById(_0x2787e1[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x343b05,null))[_0x9da1('0x13')](handleError(_0x343b05,null));};exports[_0x9da1('0x3b')]=function(_0x2aae1b,_0x4607a9){return respondWithRpcPromise(_0x9da1('0x3c'),_0x2aae1b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x4607a9,null))[_0x9da1('0x13')](handleError(_0x4607a9,null));};exports['showMailQueues']=function(_0xdaa51b,_0x374a1a){return respondWithRpcPromise('MailQueues',_0xdaa51b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0xdaa51b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x374a1a,null))[_0x9da1('0x13')](handleError(_0x374a1a,null));};exports[_0x9da1('0x3d')]=function(_0x3081d7,_0x5d9ac7){return respondWithRpcPromise(_0x9da1('0x3e'),_0x3081d7[_0x9da1('0x12')],mailClient)[_0x9da1('0x6')](respondWithResult(_0x5d9ac7,null))[_0x9da1('0x13')](handleError(_0x5d9ac7,null));};exports['openchannelQueues']=function(_0x1a9df0,_0x5c236e){return respondWithRpcPromise(_0x9da1('0x3f'),_0x1a9df0[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5c236e,null))[_0x9da1('0x13')](handleError(_0x5c236e,null));};exports[_0x9da1('0x40')]=function(_0x4445e2,_0x5e262c){return respondWithRpcPromise('OpenchannelQueues',_0x4445e2[_0x9da1('0x12')],routingClient)['then'](findById(_0x4445e2['params']['id']))['then'](respondWithResult(_0x5e262c,null))[_0x9da1('0x13')](handleError(_0x5e262c,null));};exports['smsQueues']=function(_0x1ee86e,_0x558602){return respondWithRpcPromise(_0x9da1('0x41'),_0x1ee86e[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x558602,null))[_0x9da1('0x13')](handleError(_0x558602,null));};exports[_0x9da1('0x42')]=function(_0x575a9b,_0x1a91c8){return respondWithRpcPromise(_0x9da1('0x41'),_0x575a9b['query'],routingClient)['then'](findById(_0x575a9b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x1a91c8,null))[_0x9da1('0x13')](handleError(_0x1a91c8,null));};exports[_0x9da1('0x43')]=function(_0x236b01,_0x44d7fe){return respondWithRpcPromise('WhatsappQueues',_0x236b01[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x44d7fe,null))['catch'](handleError(_0x44d7fe,null));};exports[_0x9da1('0x44')]=function(_0x41717a,_0x2e4ea4){return respondWithRpcPromise(_0x9da1('0x45'),_0x41717a[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x41717a[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x2e4ea4,null))[_0x9da1('0x13')](handleError(_0x2e4ea4,null));};exports['faxQueues']=function(_0x41283e,_0xbd54e){return respondWithRpcPromise(_0x9da1('0x46'),_0x41283e[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0xbd54e,null))['catch'](handleError(_0xbd54e,null));};exports[_0x9da1('0x47')]=function(_0x13fadd,_0x419f78){return respondWithRpcPromise(_0x9da1('0x46'),_0x13fadd[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x13fadd['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x419f78,null))['catch'](handleError(_0x419f78,null));};exports[_0x9da1('0x48')]=function(_0x5b6d9f,_0x7cfa7e){return respondWithRpcPromise(_0x9da1('0x49'),_0x5b6d9f[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x7cfa7e,null))['catch'](handleError(_0x7cfa7e,null));};exports['chatQueuesWaitingInteractions']=function(_0x4c832f,_0x73a2fc){return respondWithRpcPromise(_0x9da1('0x4a'),_0x4c832f[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x73a2fc,null))['catch'](handleError(_0x73a2fc,null));};exports['mailQueuesWaitingInteractions']=function(_0x35b782,_0x327bb4){return respondWithRpcPromise(_0x9da1('0x4b'),_0x35b782['query'],routingClient)['then'](respondWithResult(_0x327bb4,null))[_0x9da1('0x13')](handleError(_0x327bb4,null));};exports[_0x9da1('0x4c')]=function(_0x114093,_0x57f20c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x114093[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x57f20c,null))[_0x9da1('0x13')](handleError(_0x57f20c,null));};exports[_0x9da1('0x4d')]=function(_0x3cfe64,_0x5daa11){return respondWithRpcPromise(_0x9da1('0x4e'),_0x3cfe64[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](function(_0x1f0369){if(_0x3cfe64['query'][_0x9da1('0x4f')]!==undefined){var _0x244987=_(_0x1f0369[_0x9da1('0xf')])['filter']([_0x3cfe64[_0x9da1('0x12')][_0x9da1('0x4f')],_0x3cfe64[_0x9da1('0x17')]['id']])['map'](_0x9da1('0x50'))[_0x9da1('0x51')]()['value']();return _0x1f0369[_0x9da1('0xf')]['filter'](function(_0x247710){return _0x244987['indexOf'](_0x247710[_0x9da1('0x50')])>-0x1;});}else{return _0x1f0369[_0x9da1('0xf')][_0x9da1('0x52')](function(_0x2d3541){return _0x2d3541[_0x9da1('0x50')]===parseInt(_0x3cfe64[_0x9da1('0x17')]['id']);});}})[_0x9da1('0x6')](respondWithResult(_0x5daa11,null))[_0x9da1('0x13')](handleError(_0x5daa11,null));};exports[_0x9da1('0x53')]=function(_0x457b45,_0x323cae){return respondWithRpcPromise(_0x9da1('0x54'),_0x457b45[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x323cae,null))[_0x9da1('0x13')](handleError(_0x323cae,null));};exports[_0x9da1('0x55')]=function(_0x27cec6,_0x890b14){return respondWithRpcPromise(_0x9da1('0x56'),_0x27cec6['query'],routingClient)[_0x9da1('0x6')](respondWithResult(_0x890b14,null))[_0x9da1('0x13')](handleError(_0x890b14,null));};exports['faxQueuesWaitingInteractions']=function(_0x4a4cda,_0x84f8d8){return respondWithRpcPromise(_0x9da1('0x57'),_0x4a4cda[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x84f8d8,null))[_0x9da1('0x13')](handleError(_0x84f8d8,null));};exports[_0x9da1('0x58')]=function(_0x1e5b52){return function(_0x1eaaeb,_0x29c4e8){var _0x1d02ff,_0x21748e;var _0x48341a=_[_0x9da1('0x59')](_0x1e5b52);var _0x49a95c=_0x1e5b52===_0x9da1('0x5a')?_0x9da1('0x5b'):_0x9da1('0x5c');return db[_0x48341a+_0x9da1('0x5d')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x1eaaeb['params']['id']}})[_0x9da1('0x6')](function(_0x354c5a){if(_['isNil'](_0x354c5a)){throw new Error(_0x48341a+_0x9da1('0x5f'));}_0x1d02ff=_0x354c5a;return db[_0x48341a+'Message'][_0x9da1('0x5e')]({'where':{'id':_0x1eaaeb['body'][_0x9da1('0x60')]},'include':[{'model':db[_0x48341a+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x48341a+_0x49a95c],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0x3e331a){if(_[_0x9da1('0xe')](_0x3e331a)){throw new Error(_0x48341a+_0x9da1('0x62'));}_0x21748e=_0x3e331a;return _0x3e331a[_0x9da1('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0xbd3a16={'uniqueid':_0x1e5b52+'.'+_0x21748e['id']+'.'+_0x21748e[_0x9da1('0x61')]['id'],'FromUserId':_0x1eaaeb['user']['id'],'type':_0x9da1('0x64')};_0xbd3a16[_0x48341a+_0x9da1('0x65')]=_0x21748e['id'];_0xbd3a16[_0x48341a+_0x9da1('0x66')]=_0x21748e[_0x9da1('0x61')]['id'];_0xbd3a16[_0x9da1('0x67')+_0x48341a+_0x49a95c+'Id']=_0x21748e[_0x9da1('0x5c')]['id'];_0xbd3a16['To'+_0x48341a+'QueueId']=_0x1d02ff['id'];return db[_0x48341a+'TransferReport'][_0x9da1('0x68')](_0xbd3a16);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x1e5b52,'interaction':_0x21748e['Interaction'],'message':_0x21748e,'account':_0x21748e[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x64'),'appdata':_0x1d02ff[_0x9da1('0xc')]+','+(_0x21748e[_0x9da1('0x5c')][_0x9da1('0x6a')]||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})[_0x9da1('0x6')](respondWithResult(_0x29c4e8,null))['catch'](handleError(_0x29c4e8,null));};};exports[_0x9da1('0x6c')]=function(_0x18fbc9,_0x5a64fd){var _0x56af13,_0x392d19;if(_['isNil'](_0x18fbc9['body'][_0x9da1('0x6d')])){throw new Error(_0x9da1('0x6e'));}var _0x3f9010=_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x6d')];var _0x30065d=_[_0x9da1('0x59')](_0x3f9010);var _0x39afa7=_0x3f9010==='chat'?'Website':_0x9da1('0x5c');return db[_0x9da1('0x6f')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x18fbc9[_0x9da1('0x17')]['id'],'role':_0x9da1('0x30')}})[_0x9da1('0x6')](function(_0x20a71f){if(_[_0x9da1('0xe')](_0x20a71f)){throw new Error('Agent\x20not\x20found');}_0x56af13=_0x20a71f;return db[_0x30065d+_0x9da1('0x70')]['findOne']({'where':{'id':_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x60')]},'include':[{'model':db[_0x30065d+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x30065d+_0x39afa7],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0xe59156){if(_['isNil'](_0xe59156)){throw new Error(_0x30065d+_0x9da1('0x62'));}_0x392d19=_0xe59156;return _0xe59156['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0x35322c={'uniqueid':_0x3f9010+'.'+_0x392d19['id']+'.'+_0x392d19[_0x9da1('0x61')]['id'],'FromUserId':_0x18fbc9[_0x9da1('0x27')]['id'],'type':'queue','ToUserId':_0x56af13['id']};_0x35322c[_0x30065d+_0x9da1('0x65')]=_0x392d19['id'];_0x35322c[_0x30065d+_0x9da1('0x66')]=_0x392d19[_0x9da1('0x61')]['id'];_0x35322c[_0x9da1('0x67')+_0x30065d+_0x39afa7+'Id']=_0x392d19[_0x9da1('0x5c')]['id'];return db[_0x30065d+_0x9da1('0x71')][_0x9da1('0x68')](_0x35322c);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x3f9010,'interaction':_0x392d19[_0x9da1('0x61')],'message':_0x392d19,'account':_0x392d19[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x30'),'appdata':_0x56af13[_0x9da1('0xc')]+','+(_0x392d19[_0x9da1('0x5c')]['agentTransferTimeout']||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})['then'](respondWithResult(_0x5a64fd,null))[_0x9da1('0x13')](handleError(_0x5a64fd,null));}; \ No newline at end of file +var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0xa630,0xbe));var _0x0a63=function(_0x109409,_0x531e67){_0x109409=_0x109409-0x0;var _0x841581=_0xa630[_0x109409];return _0x841581;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7020f0c..4208915 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 _0xa51f=['../../components/auth/service','../../config/environment','./schedule.controller','index','isAuthenticated','get','create','put','update','delete','/:id','destroy','multer','path','express','Router','fs-extra'];(function(_0x3e55b8,_0x56eb70){var _0x378a60=function(_0x18582d){while(--_0x18582d){_0x3e55b8['push'](_0x3e55b8['shift']());}};_0x378a60(++_0x56eb70);}(_0xa51f,0x72));var _0xfa51=function(_0x2a05b0,_0x45eed9){_0x2a05b0=_0x2a05b0-0x0;var _0x36eb0a=_0xa51f[_0x2a05b0];return _0x36eb0a;};'use strict';var multer=require(_0xfa51('0x0'));var util=require('util');var path=require(_0xfa51('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa51('0x2'));var router=express[_0xfa51('0x3')]();var fs_extra=require(_0xfa51('0x4'));var auth=require(_0xfa51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa51('0x6'));var controller=require(_0xfa51('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa51('0x8')]);router['get']('/:id',auth[_0xfa51('0x9')](),controller['show']);router[_0xfa51('0xa')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xfa51('0xb')]);router[_0xfa51('0xc')]('/:id',auth[_0xfa51('0x9')](),controller[_0xfa51('0xd')]);router[_0xfa51('0xe')](_0xfa51('0xf'),auth['isAuthenticated'](),controller[_0xfa51('0x10')]);module['exports']=router; \ No newline at end of file +var _0x57ba=['get','/:id','isAuthenticated','show','run','post','create','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','index'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x57ba,0x1df));var _0xa57b=function(_0x112654,_0x60b3ce){_0x112654=_0x112654-0x0;var _0x515e85=_0x57ba[_0x112654];return _0x515e85;};'use strict';var multer=require('multer');var util=require(_0xa57b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa57b('0x1'));var router=express['Router']();var fs_extra=require(_0xa57b('0x2'));var auth=require(_0xa57b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa57b('0x4'));var controller=require(_0xa57b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa57b('0x6')]);router[_0xa57b('0x7')](_0xa57b('0x8'),auth[_0xa57b('0x9')](),controller[_0xa57b('0xa')]);router[_0xa57b('0x7')]('/:id/run',auth[_0xa57b('0x9')](),controller[_0xa57b('0xb')]);router[_0xa57b('0xc')]('/',auth['isAuthenticated'](),controller[_0xa57b('0xd')]);router['put'](_0xa57b('0x8'),auth[_0xa57b('0x9')](),controller[_0xa57b('0xe')]);router[_0xa57b('0xf')](_0xa57b('0x8'),auth['isAuthenticated'](),controller[_0xa57b('0x10')]);module[_0xa57b('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c7d0c99..f7059ca 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 _0x05e6=['years','quarters','months','weeks','days','hours','minutes','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM'];(function(_0x2b9618,_0x4b37b1){var _0x1e7ab4=function(_0x24d6c8){while(--_0x24d6c8){_0x2b9618['push'](_0x2b9618['shift']());}};_0x1e7ab4(++_0x4b37b1);}(_0x05e6,0x7a));var _0x605e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x05e6[_0x411add];return _0x238242;};'use strict';var Sequelize=require('sequelize');module[_0x605e('0x0')]={'name':{'type':Sequelize[_0x605e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x605e('0x1')]},'active':{'type':Sequelize[_0x605e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x605e('0x1')],'allowNull':![],'defaultValue':_0x605e('0x3')},'startAt':{'type':Sequelize[_0x605e('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x605e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x605e('0x5')](_0x605e('0x6'),_0x605e('0x7'),_0x605e('0x8'),_0x605e('0x9'),_0x605e('0xa'),_0x605e('0xb'),_0x605e('0xc')),'allowNull':![],'defaultValue':_0x605e('0xa')},'output':{'type':Sequelize[_0x605e('0x5')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x605e('0x5')](_0x605e('0xd'),_0x605e('0xe')),'allowNull':![],'defaultValue':_0x605e('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x605e('0x1')]},'cc':{'type':Sequelize[_0x605e('0xf')]},'bcc':{'type':Sequelize[_0x605e('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x605e('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xaeee=['ENUM','quarters','months','weeks','days','minutes','csv','xlsx','custom','default','TEXT','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','INTEGER'];(function(_0x532b00,_0x4a0f5){var _0x19fef5=function(_0x165b5){while(--_0x165b5){_0x532b00['push'](_0x532b00['shift']());}};_0x19fef5(++_0x4a0f5);}(_0xaeee,0x1ec));var _0xeaee=function(_0x2e7764,_0x2b5511){_0x2e7764=_0x2e7764-0x0;var _0x16fd09=_0xaeee[_0x2e7764];return _0x16fd09;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeaee('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xeaee('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeaee('0x1')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xeaee('0x2')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xeaee('0x3')]('years',_0xeaee('0x4'),_0xeaee('0x5'),_0xeaee('0x6'),_0xeaee('0x7'),'hours',_0xeaee('0x8')),'allowNull':![],'defaultValue':_0xeaee('0x7')},'output':{'type':Sequelize[_0xeaee('0x3')](_0xeaee('0x9'),'pdf',_0xeaee('0xa')),'allowNull':![],'defaultValue':_0xeaee('0x9')},'type':{'type':Sequelize[_0xeaee('0x3')](_0xeaee('0xb'),_0xeaee('0xc')),'allowNull':![],'defaultValue':_0xeaee('0xb')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xeaee('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xeaee('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xeaee('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6b2ff18..120e735 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 _0x9eb7=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','update','then','destroy','Scheduler','UserProfileResource','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','Schedule','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x4688e3,_0x1f5d34){var _0x348354=function(_0x417a92){while(--_0x417a92){_0x4688e3['push'](_0x4688e3['shift']());}};_0x348354(++_0x1f5d34);}(_0x9eb7,0x13a));var _0x79eb=function(_0x48f085,_0x47bb7d){_0x48f085=_0x48f085-0x0;var _0x2dec00=_0x9eb7[_0x48f085];return _0x2dec00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79eb('0x0'));var zipdir=require(_0x79eb('0x1'));var jsonpatch=require(_0x79eb('0x2'));var rp=require(_0x79eb('0x3'));var moment=require(_0x79eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x79eb('0x5'));var path=require('path');var sox=require(_0x79eb('0x6'));var csv=require(_0x79eb('0x7'));var ejs=require(_0x79eb('0x8'));var fs=require('fs');var fs_extra=require(_0x79eb('0x9'));var _=require(_0x79eb('0xa'));var squel=require(_0x79eb('0xb'));var crypto=require(_0x79eb('0xc'));var jsforce=require(_0x79eb('0xd'));var deskjs=require(_0x79eb('0xe'));var toCsv=require(_0x79eb('0x7'));var querystring=require(_0x79eb('0xf'));var Papa=require('papaparse');var Redis=require(_0x79eb('0x10'));var authService=require(_0x79eb('0x11'));var qs=require(_0x79eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79eb('0x13'));var logger=require(_0x79eb('0x14'))(_0x79eb('0x15'));var utils=require(_0x79eb('0x16'));var config=require(_0x79eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x79eb('0x18'))['db'];function respondWithStatusCode(_0x4af6c6,_0x13ad7a){_0x13ad7a=_0x13ad7a||0xcc;return function(_0x2f5abb){if(_0x2f5abb){return _0x4af6c6[_0x79eb('0x19')](_0x13ad7a);}return _0x4af6c6['status'](_0x13ad7a)[_0x79eb('0x1a')]();};}function respondWithResult(_0x3f1ffd,_0x57eb11){_0x57eb11=_0x57eb11||0xc8;return function(_0xbfafba){if(_0xbfafba){return _0x3f1ffd['status'](_0x57eb11)[_0x79eb('0x1b')](_0xbfafba);}};}function respondWithFilteredResult(_0x15df2e,_0x3f3941){return function(_0x5c0a0e){if(_0x5c0a0e){var _0x38ebec=typeof _0x3f3941[_0x79eb('0x1c')]===_0x79eb('0x1d')&&typeof _0x3f3941[_0x79eb('0x1e')]===_0x79eb('0x1d');var _0x5ee224=_0x5c0a0e[_0x79eb('0x1f')];var _0x4d951b=_0x38ebec?0x0:_0x3f3941[_0x79eb('0x1c')];var _0x4484f2=_0x38ebec?_0x5c0a0e['count']:_0x3f3941[_0x79eb('0x1c')]+_0x3f3941[_0x79eb('0x1e')];var _0x2cadaf;if(_0x4484f2>=_0x5ee224){_0x4484f2=_0x5ee224;_0x2cadaf=0xc8;}else{_0x2cadaf=0xce;}_0x15df2e[_0x79eb('0x20')](_0x2cadaf);return _0x15df2e['set'](_0x79eb('0x21'),_0x4d951b+'-'+_0x4484f2+'/'+_0x5ee224)[_0x79eb('0x1b')](_0x5c0a0e);}return null;};}function patchUpdates(_0x2a4241){return function(_0xad539a){try{jsonpatch['apply'](_0xad539a,_0x2a4241,!![]);}catch(_0x17c8eb){return BPromise[_0x79eb('0x22')](_0x17c8eb);}return _0xad539a['save']();};}function saveUpdates(_0x249145,_0x25073e){return function(_0xa85f5f){if(_0xa85f5f){return _0xa85f5f[_0x79eb('0x23')](_0x249145)[_0x79eb('0x24')](function(_0xf2f8fb){return _0xf2f8fb;});}return null;};}function removeEntity(_0x106ff1,_0x5c4da2){return function(_0x28243a){if(_0x28243a){return _0x28243a[_0x79eb('0x25')]()['then'](function(){var _0xaa2508=_0x28243a['get']({'plain':!![]});var _0x52dc7e=_0x79eb('0x26');return db[_0x79eb('0x27')]['destroy']({'where':{'type':_0x52dc7e,'resourceId':_0xaa2508['id']}})['then'](function(){return _0x28243a;});})[_0x79eb('0x24')](function(){_0x106ff1[_0x79eb('0x20')](0xcc)[_0x79eb('0x1a')]();});}};}function handleEntityNotFound(_0x6e4af3,_0x390cb6){return function(_0x1fded3){if(!_0x1fded3){_0x6e4af3[_0x79eb('0x19')](0x194);}return _0x1fded3;};}function handleError(_0x385ed8,_0x4262bf){_0x4262bf=_0x4262bf||0x1f4;return function(_0xb99148){logger[_0x79eb('0x28')](_0xb99148['stack']);if(_0xb99148[_0x79eb('0x29')]){delete _0xb99148[_0x79eb('0x29')];}_0x385ed8[_0x79eb('0x20')](_0x4262bf)[_0x79eb('0x2a')](_0xb99148);};}exports['index']=function(_0x57b929,_0x29471d){var _0x279031={},_0x1af7b1={},_0x3bdcb2={'count':0x0,'rows':[]};var _0x579359=_[_0x79eb('0x2b')](db['Schedule'][_0x79eb('0x2c')],function(_0x13b5b2){return{'name':_0x13b5b2['fieldName'],'type':_0x13b5b2[_0x79eb('0x2d')][_0x79eb('0x2e')]};});_0x1af7b1[_0x79eb('0x2f')]=_[_0x79eb('0x2b')](_0x579359,_0x79eb('0x29'));_0x1af7b1[_0x79eb('0x30')]=_[_0x79eb('0x31')](_0x57b929[_0x79eb('0x30')]);_0x1af7b1[_0x79eb('0x32')]=_[_0x79eb('0x33')](_0x1af7b1[_0x79eb('0x2f')],_0x1af7b1[_0x79eb('0x30')]);_0x279031[_0x79eb('0x34')]=_[_0x79eb('0x33')](_0x1af7b1[_0x79eb('0x2f')],qs[_0x79eb('0x35')](_0x57b929['query']['fields']));_0x279031[_0x79eb('0x34')]=_0x279031[_0x79eb('0x34')]['length']?_0x279031[_0x79eb('0x34')]:_0x1af7b1['model'];if(!_0x57b929[_0x79eb('0x30')][_0x79eb('0x36')](_0x79eb('0x37'))){_0x279031['limit']=qs['limit'](_0x57b929['query'][_0x79eb('0x1e')]);_0x279031[_0x79eb('0x1c')]=qs[_0x79eb('0x1c')](_0x57b929[_0x79eb('0x30')][_0x79eb('0x1c')]);}_0x279031[_0x79eb('0x38')]=qs[_0x79eb('0x39')](_0x57b929[_0x79eb('0x30')][_0x79eb('0x39')]);_0x279031[_0x79eb('0x3a')]=qs[_0x79eb('0x32')](_[_0x79eb('0x3b')](_0x57b929['query'],_0x1af7b1[_0x79eb('0x32')]),_0x579359);if(_0x57b929[_0x79eb('0x30')][_0x79eb('0x3c')]){_0x279031[_0x79eb('0x3a')]=_[_0x79eb('0x3d')](_0x279031[_0x79eb('0x3a')],{'$or':_[_0x79eb('0x2b')](_0x579359,function(_0x1fe9c1){if(_0x1fe9c1[_0x79eb('0x2d')]!==_0x79eb('0x3e')){var _0x265e04={};_0x265e04[_0x1fe9c1['name']]={'$like':'%'+_0x57b929[_0x79eb('0x30')]['filter']+'%'};return _0x265e04;}})});}_0x279031=_[_0x79eb('0x3d')]({},_0x279031,_0x57b929[_0x79eb('0x3f')]);var _0x1c77ea={'where':_0x279031[_0x79eb('0x3a')]};return db['Schedule'][_0x79eb('0x1f')](_0x1c77ea)[_0x79eb('0x24')](function(_0xea1150){_0x3bdcb2[_0x79eb('0x1f')]=_0xea1150;if(_0x57b929['query'][_0x79eb('0x40')]){_0x279031[_0x79eb('0x41')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x279031);})[_0x79eb('0x24')](function(_0x36ee86){_0x3bdcb2[_0x79eb('0x42')]=_0x36ee86;return _0x3bdcb2;})['then'](respondWithFilteredResult(_0x29471d,_0x279031))[_0x79eb('0x43')](handleError(_0x29471d,null));};exports['show']=function(_0x384f70,_0x2aabd1){var _0x44ba3b={'raw':![],'where':{'id':_0x384f70['params']['id']}},_0x5d5a5a={};_0x5d5a5a['model']=_[_0x79eb('0x31')](db[_0x79eb('0x44')][_0x79eb('0x2c')]);_0x5d5a5a[_0x79eb('0x30')]=_[_0x79eb('0x31')](_0x384f70[_0x79eb('0x30')]);_0x5d5a5a['filters']=_['intersection'](_0x5d5a5a[_0x79eb('0x2f')],_0x5d5a5a[_0x79eb('0x30')]);_0x44ba3b[_0x79eb('0x34')]=_[_0x79eb('0x33')](_0x5d5a5a[_0x79eb('0x2f')],qs[_0x79eb('0x35')](_0x384f70[_0x79eb('0x30')]['fields']));_0x44ba3b[_0x79eb('0x34')]=_0x44ba3b[_0x79eb('0x34')][_0x79eb('0x45')]?_0x44ba3b['attributes']:_0x5d5a5a[_0x79eb('0x2f')];if(_0x384f70[_0x79eb('0x30')][_0x79eb('0x40')]){_0x44ba3b[_0x79eb('0x41')]=[{'all':!![]}];}_0x44ba3b=_['merge']({},_0x44ba3b,_0x384f70[_0x79eb('0x3f')]);return db[_0x79eb('0x44')][_0x79eb('0x46')](_0x44ba3b)['then'](handleEntityNotFound(_0x2aabd1,null))[_0x79eb('0x24')](respondWithResult(_0x2aabd1,null))[_0x79eb('0x43')](handleError(_0x2aabd1,null));};exports[_0x79eb('0x47')]=function(_0x4a5afc,_0x4860eb){return db[_0x79eb('0x44')][_0x79eb('0x47')](_0x4a5afc['body'],{})[_0x79eb('0x24')](function(_0x215233){var _0x2f4649=_0x4a5afc[_0x79eb('0x48')]['get']({'plain':!![]});if(!_0x2f4649)throw new Error(_0x79eb('0x49'));if(_0x2f4649[_0x79eb('0x4a')]===_0x79eb('0x48')){var _0x3ba23f=_0x215233['get']({'plain':!![]});var _0x4bdb9a=_0x79eb('0x26');return db[_0x79eb('0x4b')][_0x79eb('0x46')]({'where':{'name':_0x4bdb9a,'userProfileId':_0x2f4649[_0x79eb('0x4c')]},'raw':!![]})[_0x79eb('0x24')](function(_0x379f23){if(_0x379f23&&_0x379f23[_0x79eb('0x4d')]===0x0){return db[_0x79eb('0x27')][_0x79eb('0x47')]({'name':_0x3ba23f[_0x79eb('0x29')],'resourceId':_0x3ba23f['id'],'type':_0x379f23[_0x79eb('0x29')],'sectionId':_0x379f23['id']},{})[_0x79eb('0x24')](function(){return _0x215233;});}else{return _0x215233;}})[_0x79eb('0x43')](function(_0x100f56){logger['error'](_0x79eb('0x4e'),_0x100f56);throw _0x100f56;});}return _0x215233;})[_0x79eb('0x24')](respondWithResult(_0x4860eb,0xc9))[_0x79eb('0x43')](handleError(_0x4860eb,null));};exports[_0x79eb('0x23')]=function(_0x52ef95,_0x44fa5a){if(_0x52ef95['body']['id']){delete _0x52ef95['body']['id'];}return db[_0x79eb('0x44')]['find']({'where':{'id':_0x52ef95[_0x79eb('0x4f')]['id']}})[_0x79eb('0x24')](handleEntityNotFound(_0x44fa5a,null))[_0x79eb('0x24')](saveUpdates(_0x52ef95[_0x79eb('0x50')],null))['then'](respondWithResult(_0x44fa5a,null))[_0x79eb('0x43')](handleError(_0x44fa5a,null));};exports[_0x79eb('0x25')]=function(_0x89d8a,_0x48695f){return db[_0x79eb('0x44')]['find']({'where':{'id':_0x89d8a[_0x79eb('0x4f')]['id']}})[_0x79eb('0x24')](handleEntityNotFound(_0x48695f,null))[_0x79eb('0x24')](removeEntity(_0x48695f,null))[_0x79eb('0x43')](handleError(_0x48695f,null));};exports[_0x79eb('0x51')]=function(_0x142a68,_0x55b373,_0x37a347){var _0x506551=require(_0x79eb('0x52'));return db[_0x79eb('0x44')][_0x79eb('0x46')]({'where':{'id':_0x142a68['params']['id']},'raw':!![]})[_0x79eb('0x24')](handleEntityNotFound(_0x55b373,null))[_0x79eb('0x24')](function(){_0x506551[_0x79eb('0x51')](_0x142a68[_0x79eb('0x4f')]['id']);})[_0x79eb('0x24')](respondWithStatusCode(_0x55b373,null))[_0x79eb('0x43')](handleError(_0x55b373,null));}; \ No newline at end of file +var _0x0d9e=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','map','Schedule','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','../../config/schedule','run','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x37f32d,_0x4b8438){var _0x41ca9f=function(_0xda289a){while(--_0xda289a){_0x37f32d['push'](_0x37f32d['shift']());}};_0x41ca9f(++_0x4b8438);}(_0x0d9e,0x193));var _0xe0d9=function(_0x392b33,_0x24abc7){_0x392b33=_0x392b33-0x0;var _0x1c6771=_0x0d9e[_0x392b33];return _0x1c6771;};'use strict';var emlformat=require(_0xe0d9('0x0'));var rimraf=require(_0xe0d9('0x1'));var zipdir=require(_0xe0d9('0x2'));var jsonpatch=require(_0xe0d9('0x3'));var rp=require('request-promise');var moment=require(_0xe0d9('0x4'));var BPromise=require(_0xe0d9('0x5'));var Mustache=require(_0xe0d9('0x6'));var util=require(_0xe0d9('0x7'));var path=require('path');var sox=require(_0xe0d9('0x8'));var csv=require(_0xe0d9('0x9'));var ejs=require(_0xe0d9('0xa'));var fs=require('fs');var fs_extra=require(_0xe0d9('0xb'));var _=require(_0xe0d9('0xc'));var squel=require(_0xe0d9('0xd'));var crypto=require(_0xe0d9('0xe'));var jsforce=require(_0xe0d9('0xf'));var deskjs=require(_0xe0d9('0x10'));var toCsv=require(_0xe0d9('0x9'));var querystring=require(_0xe0d9('0x11'));var Papa=require('papaparse');var Redis=require(_0xe0d9('0x12'));var authService=require(_0xe0d9('0x13'));var qs=require(_0xe0d9('0x14'));var as=require(_0xe0d9('0x15'));var hardwareService=require(_0xe0d9('0x16'));var logger=require(_0xe0d9('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0d9('0x18'));var db=require(_0xe0d9('0x19'))['db'];function respondWithStatusCode(_0x77ea96,_0x6ce65f){_0x6ce65f=_0x6ce65f||0xcc;return function(_0x30dcd1){if(_0x30dcd1){return _0x77ea96[_0xe0d9('0x1a')](_0x6ce65f);}return _0x77ea96[_0xe0d9('0x1b')](_0x6ce65f)[_0xe0d9('0x1c')]();};}function respondWithResult(_0x38cf48,_0xb80b95){_0xb80b95=_0xb80b95||0xc8;return function(_0x3f94bf){if(_0x3f94bf){return _0x38cf48['status'](_0xb80b95)[_0xe0d9('0x1d')](_0x3f94bf);}};}function respondWithFilteredResult(_0x3a74d9,_0x4d57e6){return function(_0x2063e0){if(_0x2063e0){var _0x18f19c=typeof _0x4d57e6[_0xe0d9('0x1e')]===_0xe0d9('0x1f')&&typeof _0x4d57e6[_0xe0d9('0x20')]===_0xe0d9('0x1f');var _0x1969e8=_0x2063e0['count'];var _0x5aa3b8=_0x18f19c?0x0:_0x4d57e6['offset'];var _0x525835=_0x18f19c?_0x2063e0[_0xe0d9('0x21')]:_0x4d57e6['offset']+_0x4d57e6[_0xe0d9('0x20')];var _0xf8ee04;if(_0x525835>=_0x1969e8){_0x525835=_0x1969e8;_0xf8ee04=0xc8;}else{_0xf8ee04=0xce;}_0x3a74d9[_0xe0d9('0x1b')](_0xf8ee04);return _0x3a74d9['set'](_0xe0d9('0x22'),_0x5aa3b8+'-'+_0x525835+'/'+_0x1969e8)['json'](_0x2063e0);}return null;};}function patchUpdates(_0x264627){return function(_0x36e435){try{jsonpatch[_0xe0d9('0x23')](_0x36e435,_0x264627,!![]);}catch(_0x337597){return BPromise[_0xe0d9('0x24')](_0x337597);}return _0x36e435[_0xe0d9('0x25')]();};}function saveUpdates(_0x215263,_0x485dbf){return function(_0x18f936){if(_0x18f936){return _0x18f936['update'](_0x215263)['then'](function(_0x3d0a31){return _0x3d0a31;});}return null;};}function removeEntity(_0x2d656c,_0x169755){return function(_0x15e7d0){if(_0x15e7d0){return _0x15e7d0[_0xe0d9('0x26')]()[_0xe0d9('0x27')](function(){var _0x78bf19=_0x15e7d0[_0xe0d9('0x28')]({'plain':!![]});var _0x3d258a=_0xe0d9('0x29');return db[_0xe0d9('0x2a')][_0xe0d9('0x26')]({'where':{'type':_0x3d258a,'resourceId':_0x78bf19['id']}})[_0xe0d9('0x27')](function(){return _0x15e7d0;});})['then'](function(){_0x2d656c[_0xe0d9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8d63,_0xcfe04a){return function(_0x25b2ce){if(!_0x25b2ce){_0x5d8d63[_0xe0d9('0x1a')](0x194);}return _0x25b2ce;};}function handleError(_0x4b86e8,_0x1d86a0){_0x1d86a0=_0x1d86a0||0x1f4;return function(_0x5d99fd){logger[_0xe0d9('0x2b')](_0x5d99fd[_0xe0d9('0x2c')]);if(_0x5d99fd[_0xe0d9('0x2d')]){delete _0x5d99fd['name'];}_0x4b86e8[_0xe0d9('0x1b')](_0x1d86a0)['send'](_0x5d99fd);};}exports['index']=function(_0x30945c,_0x3a731d){var _0x381e49={},_0x56fe97={},_0x42d2b7={'count':0x0,'rows':[]};var _0x447e11=_[_0xe0d9('0x2e')](db[_0xe0d9('0x2f')][_0xe0d9('0x30')],function(_0x19cff8){return{'name':_0x19cff8['fieldName'],'type':_0x19cff8['type'][_0xe0d9('0x31')]};});_0x56fe97['model']=_['map'](_0x447e11,'name');_0x56fe97[_0xe0d9('0x32')]=_[_0xe0d9('0x33')](_0x30945c['query']);_0x56fe97[_0xe0d9('0x34')]=_[_0xe0d9('0x35')](_0x56fe97[_0xe0d9('0x36')],_0x56fe97['query']);_0x381e49[_0xe0d9('0x37')]=_[_0xe0d9('0x35')](_0x56fe97['model'],qs[_0xe0d9('0x38')](_0x30945c[_0xe0d9('0x32')]['fields']));_0x381e49['attributes']=_0x381e49[_0xe0d9('0x37')][_0xe0d9('0x39')]?_0x381e49[_0xe0d9('0x37')]:_0x56fe97['model'];if(!_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x3a')]('nolimit')){_0x381e49['limit']=qs[_0xe0d9('0x20')](_0x30945c['query'][_0xe0d9('0x20')]);_0x381e49[_0xe0d9('0x1e')]=qs[_0xe0d9('0x1e')](_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x1e')]);}_0x381e49[_0xe0d9('0x3b')]=qs[_0xe0d9('0x3c')](_0x30945c[_0xe0d9('0x32')]['sort']);_0x381e49[_0xe0d9('0x3d')]=qs[_0xe0d9('0x34')](_[_0xe0d9('0x3e')](_0x30945c[_0xe0d9('0x32')],_0x56fe97[_0xe0d9('0x34')]),_0x447e11);if(_0x30945c['query']['filter']){_0x381e49[_0xe0d9('0x3d')]=_[_0xe0d9('0x3f')](_0x381e49[_0xe0d9('0x3d')],{'$or':_[_0xe0d9('0x2e')](_0x447e11,function(_0xb7eec2){if(_0xb7eec2[_0xe0d9('0x40')]!==_0xe0d9('0x41')){var _0x5571b0={};_0x5571b0[_0xb7eec2[_0xe0d9('0x2d')]]={'$like':'%'+_0x30945c[_0xe0d9('0x32')]['filter']+'%'};return _0x5571b0;}})});}_0x381e49=_[_0xe0d9('0x3f')]({},_0x381e49,_0x30945c['options']);var _0x1cab24={'where':_0x381e49[_0xe0d9('0x3d')]};return db['Schedule']['count'](_0x1cab24)[_0xe0d9('0x27')](function(_0xb8387d){_0x42d2b7[_0xe0d9('0x21')]=_0xb8387d;if(_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x42')]){_0x381e49[_0xe0d9('0x43')]=[{'all':!![]}];}return db[_0xe0d9('0x2f')]['findAll'](_0x381e49);})['then'](function(_0x163440){_0x42d2b7[_0xe0d9('0x44')]=_0x163440;return _0x42d2b7;})['then'](respondWithFilteredResult(_0x3a731d,_0x381e49))[_0xe0d9('0x45')](handleError(_0x3a731d,null));};exports[_0xe0d9('0x46')]=function(_0x242736,_0x384584){var _0x4d1040={'raw':![],'where':{'id':_0x242736[_0xe0d9('0x47')]['id']}},_0x4964d9={};_0x4964d9[_0xe0d9('0x36')]=_[_0xe0d9('0x33')](db['Schedule'][_0xe0d9('0x30')]);_0x4964d9[_0xe0d9('0x32')]=_[_0xe0d9('0x33')](_0x242736[_0xe0d9('0x32')]);_0x4964d9[_0xe0d9('0x34')]=_['intersection'](_0x4964d9[_0xe0d9('0x36')],_0x4964d9[_0xe0d9('0x32')]);_0x4d1040['attributes']=_[_0xe0d9('0x35')](_0x4964d9[_0xe0d9('0x36')],qs[_0xe0d9('0x38')](_0x242736[_0xe0d9('0x32')][_0xe0d9('0x38')]));_0x4d1040[_0xe0d9('0x37')]=_0x4d1040[_0xe0d9('0x37')][_0xe0d9('0x39')]?_0x4d1040['attributes']:_0x4964d9[_0xe0d9('0x36')];if(_0x242736[_0xe0d9('0x32')][_0xe0d9('0x42')]){_0x4d1040[_0xe0d9('0x43')]=[{'all':!![]}];}_0x4d1040=_[_0xe0d9('0x3f')]({},_0x4d1040,_0x242736[_0xe0d9('0x48')]);return db['Schedule']['find'](_0x4d1040)[_0xe0d9('0x27')](handleEntityNotFound(_0x384584,null))[_0xe0d9('0x27')](respondWithResult(_0x384584,null))[_0xe0d9('0x45')](handleError(_0x384584,null));};exports['create']=function(_0x15f88d,_0x513e4d){return db[_0xe0d9('0x2f')][_0xe0d9('0x49')](_0x15f88d[_0xe0d9('0x4a')],{})[_0xe0d9('0x27')](function(_0x1076b8){var _0x550f8a=_0x15f88d[_0xe0d9('0x4b')]['get']({'plain':!![]});if(!_0x550f8a)throw new Error(_0xe0d9('0x4c'));if(_0x550f8a['role']===_0xe0d9('0x4b')){var _0xf332d0=_0x1076b8[_0xe0d9('0x28')]({'plain':!![]});var _0x38e292=_0xe0d9('0x29');return db[_0xe0d9('0x4d')][_0xe0d9('0x4e')]({'where':{'name':_0x38e292,'userProfileId':_0x550f8a[_0xe0d9('0x4f')]},'raw':!![]})[_0xe0d9('0x27')](function(_0x2bc8b3){if(_0x2bc8b3&&_0x2bc8b3[_0xe0d9('0x50')]===0x0){return db['UserProfileResource'][_0xe0d9('0x49')]({'name':_0xf332d0[_0xe0d9('0x2d')],'resourceId':_0xf332d0['id'],'type':_0x2bc8b3[_0xe0d9('0x2d')],'sectionId':_0x2bc8b3['id']},{})[_0xe0d9('0x27')](function(){return _0x1076b8;});}else{return _0x1076b8;}})[_0xe0d9('0x45')](function(_0x3f8286){logger[_0xe0d9('0x2b')](_0xe0d9('0x51'),_0x3f8286);throw _0x3f8286;});}return _0x1076b8;})[_0xe0d9('0x27')](respondWithResult(_0x513e4d,0xc9))['catch'](handleError(_0x513e4d,null));};exports[_0xe0d9('0x52')]=function(_0xb6de01,_0x10c87b){if(_0xb6de01[_0xe0d9('0x4a')]['id']){delete _0xb6de01[_0xe0d9('0x4a')]['id'];}return db[_0xe0d9('0x2f')][_0xe0d9('0x4e')]({'where':{'id':_0xb6de01[_0xe0d9('0x47')]['id']}})[_0xe0d9('0x27')](handleEntityNotFound(_0x10c87b,null))[_0xe0d9('0x27')](saveUpdates(_0xb6de01[_0xe0d9('0x4a')],null))[_0xe0d9('0x27')](respondWithResult(_0x10c87b,null))[_0xe0d9('0x45')](handleError(_0x10c87b,null));};exports['destroy']=function(_0x2d08e,_0x4635fc){return db['Schedule'][_0xe0d9('0x4e')]({'where':{'id':_0x2d08e['params']['id']}})['then'](handleEntityNotFound(_0x4635fc,null))[_0xe0d9('0x27')](removeEntity(_0x4635fc,null))['catch'](handleError(_0x4635fc,null));};exports['run']=function(_0x25fe49,_0x206740,_0x1f564d){var _0x116f2c=require(_0xe0d9('0x53'));return db[_0xe0d9('0x2f')]['find']({'where':{'id':_0x25fe49['params']['id']},'raw':!![]})[_0xe0d9('0x27')](handleEntityNotFound(_0x206740,null))[_0xe0d9('0x27')](function(){_0x116f2c[_0xe0d9('0x54')](_0x25fe49[_0xe0d9('0x47')]['id']);})['then'](respondWithStatusCode(_0x206740,null))[_0xe0d9('0x45')](handleError(_0x206740,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index ca5bcb1..eafab14 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 _0x168e=['./schedule.attributes','exports','define','util','api','request-promise','rimraf'];(function(_0x2fab69,_0x2c6f0d){var _0x5dcffa=function(_0x1be8d2){while(--_0x1be8d2){_0x2fab69['push'](_0x2fab69['shift']());}};_0x5dcffa(++_0x2c6f0d);}(_0x168e,0x11b));var _0xe168=function(_0x248ca8,_0x207fe6){_0x248ca8=_0x248ca8-0x0;var _0x1ada4f=_0x168e[_0x248ca8];return _0x1ada4f;};'use strict';var _=require('lodash');var util=require(_0xe168('0x0'));var logger=require('../../config/logger')(_0xe168('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe168('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe168('0x3'));var config=require('../../config/environment');var attributes=require(_0xe168('0x4'));module[_0xe168('0x5')]=function(_0x124dfe,_0x2892e3){return _0x124dfe[_0xe168('0x6')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfab=['exports','define','Schedule','tools_schedules','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0x285af7,_0x1d36d0){var _0x1b4be2=function(_0x388654){while(--_0x388654){_0x285af7['push'](_0x285af7['shift']());}};_0x1b4be2(++_0x1d36d0);}(_0xbfab,0x12d));var _0xbbfa=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0xbfab[_0x3ab353];return _0x1e2285;};'use strict';var _=require(_0xbbfa('0x0'));var util=require(_0xbbfa('0x1'));var logger=require('../../config/logger')(_0xbbfa('0x2'));var moment=require(_0xbbfa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbfa('0x4'));var rimraf=require(_0xbbfa('0x5'));var config=require(_0xbbfa('0x6'));var attributes=require('./schedule.attributes');module[_0xbbfa('0x7')]=function(_0x3d7224,_0x591c16){return _0x3d7224[_0xbbfa('0x8')](_0xbbfa('0x9'),attributes,{'tableName':_0xbbfa('0xa'),'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 0a6c493..5c58dd3 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 _0x54c0=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x21c152,_0x449b00){var _0x54501a=function(_0x5f5be7){while(--_0x5f5be7){_0x21c152['push'](_0x21c152['shift']());}};_0x54501a(++_0x449b00);}(_0x54c0,0x1cd));var _0x054c=function(_0x306248,_0x496141){_0x306248=_0x306248-0x0;var _0x1def01=_0x54c0[_0x306248];return _0x1def01;};'use strict';var _=require(_0x054c('0x0'));var util=require(_0x054c('0x1'));var moment=require(_0x054c('0x2'));var BPromise=require(_0x054c('0x3'));var rs=require(_0x054c('0x4'));var fs=require('fs');var Redis=require(_0x054c('0x5'));var db=require(_0x054c('0x6'))['db'];var utils=require(_0x054c('0x7'));var logger=require(_0x054c('0x8'))(_0x054c('0x9'));var config=require('../../config/environment');var jayson=require(_0x054c('0xa'));var client=jayson[_0x054c('0xb')][_0x054c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46285f,_0x344c9c,_0x559cba){return new BPromise(function(_0x531747,_0xe5dceb){return client[_0x054c('0xd')](_0x46285f,_0x559cba)[_0x054c('0xe')](function(_0xd115ce){logger[_0x054c('0xf')](_0x054c('0x10'),_0x344c9c,_0x054c('0x11'));logger[_0x054c('0x12')](_0x054c('0x13'),_0x344c9c,_0x054c('0x11'),JSON['stringify'](_0xd115ce));if(_0xd115ce[_0x054c('0x14')]){if(_0xd115ce[_0x054c('0x14')]['code']===0x1f4){logger[_0x054c('0x14')](_0x054c('0x10'),_0x344c9c,_0xd115ce[_0x054c('0x14')][_0x054c('0x15')]);return _0xe5dceb(_0xd115ce[_0x054c('0x14')]['message']);}logger['error'](_0x054c('0x10'),_0x344c9c,_0xd115ce['error']['message']);return _0x531747(_0xd115ce[_0x054c('0x14')][_0x054c('0x15')]);}else{logger[_0x054c('0xf')](_0x054c('0x10'),_0x344c9c,_0x054c('0x11'));_0x531747(_0xd115ce[_0x054c('0x16')][_0x054c('0x15')]);}})['catch'](function(_0x4bc13f){logger[_0x054c('0x14')](_0x054c('0x10'),_0x344c9c,_0x4bc13f);_0xe5dceb(_0x4bc13f);});});} \ No newline at end of file +var _0x6035=['Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x6035,0x14b));var _0x5603=function(_0x515e2b,_0xb4a2b5){_0x515e2b=_0x515e2b-0x0;var _0xc74bef=_0x6035[_0x515e2b];return _0xc74bef;};'use strict';var _=require(_0x5603('0x0'));var util=require('util');var moment=require(_0x5603('0x1'));var BPromise=require('bluebird');var rs=require(_0x5603('0x2'));var fs=require('fs');var Redis=require(_0x5603('0x3'));var db=require(_0x5603('0x4'))['db'];var utils=require(_0x5603('0x5'));var logger=require(_0x5603('0x6'))(_0x5603('0x7'));var config=require('../../config/environment');var jayson=require(_0x5603('0x8'));var client=jayson[_0x5603('0x9')][_0x5603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b2bd,_0x4debcb,_0x4af19f){return new BPromise(function(_0x55cd38,_0x251dde){return client[_0x5603('0xb')](_0x36b2bd,_0x4af19f)[_0x5603('0xc')](function(_0x4d372e){logger[_0x5603('0xd')](_0x5603('0xe'),_0x4debcb,_0x5603('0xf'));logger[_0x5603('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4debcb,_0x5603('0xf'),JSON[_0x5603('0x11')](_0x4d372e));if(_0x4d372e['error']){if(_0x4d372e[_0x5603('0x12')][_0x5603('0x13')]===0x1f4){logger[_0x5603('0x12')]('Schedule,\x20%s,\x20%s',_0x4debcb,_0x4d372e[_0x5603('0x12')]['message']);return _0x251dde(_0x4d372e['error'][_0x5603('0x14')]);}logger[_0x5603('0x12')](_0x5603('0xe'),_0x4debcb,_0x4d372e[_0x5603('0x12')][_0x5603('0x14')]);return _0x55cd38(_0x4d372e['error'][_0x5603('0x14')]);}else{logger['info'](_0x5603('0xe'),_0x4debcb,_0x5603('0xf'));_0x55cd38(_0x4d372e[_0x5603('0x15')][_0x5603('0x14')]);}})[_0x5603('0x16')](function(_0x1192a2){logger[_0x5603('0x12')](_0x5603('0xe'),_0x4debcb,_0x1192a2);_0x251dde(_0x1192a2);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a42b23f..231dbd9 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 _0x6223=['post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','show','/:id/download'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0x6223,0xc5));var _0x3622=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x6223[_0x2850c0];return _0x21e830;};'use strict';var multer=require(_0x3622('0x0'));var util=require(_0x3622('0x1'));var path=require('path');var timeout=require(_0x3622('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3622('0x3'));var auth=require(_0x3622('0x4'));var interaction=require(_0x3622('0x5'));var config=require('../../config/environment');var controller=require(_0x3622('0x6'));router['get']('/',auth[_0x3622('0x7')](),controller[_0x3622('0x8')]);router[_0x3622('0x9')]('/describe',auth[_0x3622('0x7')](),controller['describe']);router[_0x3622('0x9')]('/:id',auth[_0x3622('0x7')](),controller[_0x3622('0xa')]);router[_0x3622('0x9')](_0x3622('0xb'),auth[_0x3622('0x7')](),controller['download']);router[_0x3622('0xc')]('/',auth['isAuthenticated'](),controller[_0x3622('0xd')]);router[_0x3622('0xe')](_0x3622('0xf'),auth[_0x3622('0x7')](),controller[_0x3622('0x10')]);router[_0x3622('0x11')](_0x3622('0xf'),auth[_0x3622('0x7')](),controller['destroy']);module[_0x3622('0x12')]=router; \ No newline at end of file +var _0xfd0a=['show','/:id/download','download','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index'];(function(_0xdd8c4,_0x5aa244){var _0x353e7e=function(_0x2039b7){while(--_0x2039b7){_0xdd8c4['push'](_0xdd8c4['shift']());}};_0x353e7e(++_0x5aa244);}(_0xfd0a,0xe6));var _0xafd0=function(_0x1c4782,_0x1e01ba){_0x1c4782=_0x1c4782-0x0;var _0x254980=_0xfd0a[_0x1c4782];return _0x254980;};'use strict';var multer=require('multer');var util=require(_0xafd0('0x0'));var path=require(_0xafd0('0x1'));var timeout=require(_0xafd0('0x2'));var express=require(_0xafd0('0x3'));var router=express[_0xafd0('0x4')]();var fs_extra=require(_0xafd0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xafd0('0x6'));var config=require(_0xafd0('0x7'));var controller=require(_0xafd0('0x8'));router[_0xafd0('0x9')]('/',auth[_0xafd0('0xa')](),controller[_0xafd0('0xb')]);router[_0xafd0('0x9')]('/describe',auth[_0xafd0('0xa')](),controller['describe']);router['get']('/:id',auth[_0xafd0('0xa')](),controller[_0xafd0('0xc')]);router[_0xafd0('0x9')](_0xafd0('0xd'),auth[_0xafd0('0xa')](),controller[_0xafd0('0xe')]);router['post']('/',auth[_0xafd0('0xa')](),controller[_0xafd0('0xf')]);router[_0xafd0('0x10')]('/:id',auth[_0xafd0('0xa')](),controller[_0xafd0('0x11')]);router[_0xafd0('0x12')](_0xafd0('0x13'),auth['isAuthenticated'](),controller[_0xafd0('0x14')]);module[_0xafd0('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1949864..2cd9d9b 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 _0x42c3=['toString','DATE','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','format','MM-DD-YYYY\x20HH:mm'];(function(_0xeb17cc,_0x40c096){var _0x3b9ae3=function(_0xb0abe7){while(--_0xb0abe7){_0xeb17cc['push'](_0xeb17cc['shift']());}};_0x3b9ae3(++_0x40c096);}(_0x42c3,0x1bc));var _0x342c=function(_0x360195,_0x51f689){_0x360195=_0x360195-0x0;var _0x51a470=_0x42c3[_0x360195];return _0x51a470;};'use strict';var Sequelize=require(_0x342c('0x0'));var moment=require(_0x342c('0x1'));var path=require(_0x342c('0x2'));var config=require('../../config/environment');module[_0x342c('0x3')]={'format':{'type':Sequelize[_0x342c('0x4')],'get':function(){return this[_0x342c('0x5')]('value')?path[_0x342c('0x6')](this['getDataValue'](_0x342c('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x342c('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x3f6d68){var _0x364f48=_0x3f6d68[_0x342c('0x9')](/\\/g,'/');this[_0x342c('0xa')]('value',_0x364f48);}},'rating':{'type':Sequelize[_0x342c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x342c('0xb')],'set':function(_0x3bc287){this[_0x342c('0xa')](_0x342c('0xc'),moment()['subtract'](_0x3bc287,'ms'));this[_0x342c('0xa')](_0x342c('0xd'),moment());this[_0x342c('0xa')]('duration',_0x3bc287);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x342c('0xc')))[_0x342c('0xe')](_0x342c('0xf'))[_0x342c('0x10')]();}},'closedAt':{'type':Sequelize[_0x342c('0x11')],'get':function(){return moment(this[_0x342c('0x5')](_0x342c('0xd')))[_0x342c('0xe')](_0x342c('0xf'))[_0x342c('0x10')]();}},'createdAt':{'type':Sequelize[_0x342c('0x11')],'get':function(){return moment(this[_0x342c('0x5')](_0x342c('0x12')))[_0x342c('0xe')](_0x342c('0xf'))[_0x342c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x342c('0x11')],'get':function(){return moment(this['getDataValue'](_0x342c('0x13')))['format'](_0x342c('0xf'))[_0x342c('0x10')]();}}}; \ No newline at end of file +var _0x36ee=['VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','path','exports'];(function(_0x2ea73f,_0x3e4181){var _0x5ded6a=function(_0x559637){while(--_0x559637){_0x2ea73f['push'](_0x2ea73f['shift']());}};_0x5ded6a(++_0x3e4181);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xe36e('0x0'));var config=require('../../config/environment');module[_0xe36e('0x1')]={'format':{'type':Sequelize[_0xe36e('0x2')],'get':function(){return this[_0xe36e('0x3')](_0xe36e('0x4'))?path[_0xe36e('0x5')](this[_0xe36e('0x3')](_0xe36e('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xe36e('0x6')]},'channel':{'type':Sequelize[_0xe36e('0x6')]},'value':{'type':Sequelize[_0xe36e('0x6')],'set':function(_0x21be0b){var _0x1aa596=_0x21be0b['replace'](/\\/g,'/');this[_0xe36e('0x7')]('value',_0x1aa596);}},'rating':{'type':Sequelize[_0xe36e('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe36e('0x8')],'set':function(_0x46f239){this['setDataValue'](_0xe36e('0x9'),moment()['subtract'](_0x46f239,'ms'));this[_0xe36e('0x7')](_0xe36e('0xa'),moment());this[_0xe36e('0x7')](_0xe36e('0xb'),_0x46f239);}},'startedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x9')))[_0xe36e('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xe36e('0xe')]();}},'closedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0xa')))['format'](_0xe36e('0xf'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x10')))[_0xe36e('0xd')](_0xe36e('0xf'))[_0xe36e('0xe')]();}},'updatedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x11')))[_0xe36e('0xd')](_0xe36e('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 17c53d8..96cf444 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 _0x55ca=['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','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x5e3cd8,_0x406428){var _0x20126b=function(_0x49da29){while(--_0x49da29){_0x5e3cd8['push'](_0x5e3cd8['shift']());}};_0x20126b(++_0x406428);}(_0x55ca,0x126));var _0xa55c=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x55ca[_0x1c3b41];return _0x41e3fe;};'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('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));}; \ No newline at end of file +var _0xe14b=['include','findAll','catch','show','fields','length','includeAll','find','create','body','duration','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xc2c1b0,_0x29309e){var _0x1d9013=function(_0x2e9946){while(--_0x2e9946){_0xc2c1b0['push'](_0xc2c1b0['shift']());}};_0x1d9013(++_0x29309e);}(_0xe14b,0x93));var _0xbe14=function(_0x517ae1,_0x176156){_0x517ae1=_0x517ae1-0x0;var _0x35d589=_0xe14b[_0x517ae1];return _0x35d589;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x2e')](_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25')),[_0xbe14('0x2f')]);_0x19252f[_0xbe14('0x30')]=_[_0xbe14('0x31')](_0x3c3613['query']);_0x19252f[_0xbe14('0x32')]=_['intersection'](_0x19252f['model'],_0x19252f[_0xbe14('0x30')]);_0x1c7cc7['attributes']=_[_0xbe14('0x33')](_0x19252f[_0xbe14('0x2d')],qs['fields'](_0x3c3613['query']['fields']));_0x1c7cc7[_0xbe14('0x34')]=_0x1c7cc7[_0xbe14('0x34')]['length']?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f[_0xbe14('0x2d')];if(!_0x3c3613[_0xbe14('0x30')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7['limit']=qs['limit'](_0x3c3613[_0xbe14('0x30')]['limit']);_0x1c7cc7['offset']=qs['offset'](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x1c')]);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x32')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x30')],_0x19252f[_0xbe14('0x32')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x30')]['filter']){_0x1c7cc7['where']=_[_0xbe14('0x3b')](_0x1c7cc7[_0xbe14('0x39')],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x520e09){if(_0x520e09[_0xbe14('0x2b')]!==_0xbe14('0x3c')){var _0xeda70e={};_0xeda70e[_0x520e09[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x30')][_0xbe14('0x3d')]+'%'};return _0xeda70e;}})});}_0x1c7cc7=_[_0xbe14('0x3b')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3e')]);var _0x1b2608={'where':_0x1c7cc7['where']};return db[_0xbe14('0x28')][_0xbe14('0x1b')](_0x1b2608)[_0xbe14('0x22')](function(_0x1b3118){_0x34d648[_0xbe14('0x1b')]=_0x1b3118;if(_0x3c3613[_0xbe14('0x30')]['includeAll']){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x28')][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x5cf713){_0x34d648['rows']=_0x5cf713;return _0x34d648;})[_0xbe14('0x22')](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))[_0xbe14('0x41')](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0x51c859,_0x5d5318){var _0x6b6aa8={'raw':![],'where':{'id':_0x51c859['params']['id']}},_0x59ae4d={};_0x59ae4d[_0xbe14('0x2d')]=_[_0xbe14('0x31')](db[_0xbe14('0x28')]['rawAttributes']);_0x59ae4d['query']=_['keys'](_0x51c859[_0xbe14('0x30')]);_0x59ae4d[_0xbe14('0x32')]=_[_0xbe14('0x33')](_0x59ae4d['model'],_0x59ae4d[_0xbe14('0x30')]);_0x6b6aa8[_0xbe14('0x34')]=_[_0xbe14('0x33')](_0x59ae4d[_0xbe14('0x2d')],qs['fields'](_0x51c859['query'][_0xbe14('0x43')]));_0x6b6aa8[_0xbe14('0x34')]=_0x6b6aa8[_0xbe14('0x34')][_0xbe14('0x44')]?_0x6b6aa8[_0xbe14('0x34')]:_0x59ae4d['model'];if(_0x51c859['query'][_0xbe14('0x45')]){_0x6b6aa8[_0xbe14('0x3f')]=[{'all':!![]}];}_0x6b6aa8=_[_0xbe14('0x3b')]({},_0x6b6aa8,_0x51c859[_0xbe14('0x3e')]);return db['ScreenRecording'][_0xbe14('0x46')](_0x6b6aa8)[_0xbe14('0x22')](handleEntityNotFound(_0x5d5318,null))['then'](respondWithResult(_0x5d5318,null))[_0xbe14('0x41')](handleError(_0x5d5318,null));};exports[_0xbe14('0x47')]=function(_0x2d6ee8,_0x36c20c){return db['ScreenRecording']['create'](_0x2d6ee8[_0xbe14('0x48')],{})[_0xbe14('0x22')](respondWithResult(_0x36c20c,0xc9))['catch'](handleError(_0x36c20c,null));};exports['update']=function(_0xca8cdb,_0x5d3726){if(_0xca8cdb[_0xbe14('0x48')]['id']){delete _0xca8cdb[_0xbe14('0x48')]['id'];}delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x49')];delete _0xca8cdb[_0xbe14('0x48')]['createdAt'];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4a')];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4b')];return db[_0xbe14('0x28')]['find']({'where':{'id':_0xca8cdb[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5d3726,null))[_0xbe14('0x22')](saveUpdates(_0xca8cdb[_0xbe14('0x48')],null))[_0xbe14('0x22')](respondWithResult(_0x5d3726,null))[_0xbe14('0x41')](handleError(_0x5d3726,null));};exports['describe']=function(_0x5aeea9,_0x3a49f7){return db[_0xbe14('0x28')][_0xbe14('0x4d')]()['then'](respondWithResult(_0x3a49f7,null))['catch'](handleError(_0x3a49f7,null));};exports[_0xbe14('0x4e')]=function(_0x134878,_0x50d78f,_0x339a86){var _0x32496a=require('../../components/encryptor');var _0x28f995=![];var _0x4a40d2={};if(_0x134878[_0xbe14('0x30')][_0xbe14('0x2b')]&&_0x134878[_0xbe14('0x30')]['type']===_0xbe14('0x4f')){_0x4a40d2[_0xbe14('0x4f')]=_0x134878['params']['id'];}else{_0x4a40d2['id']=_0x134878[_0xbe14('0x4c')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':_0x4a40d2,'attributes':['id',_0xbe14('0x4b')],'raw':!![]})[_0xbe14('0x22')](handleEntityNotFound(_0x50d78f,null))['then'](function(_0x42a346){if(_0x42a346){var _0x34cd66=path[_0xbe14('0x50')](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x42a346[_0xbe14('0x4b')]);var _0x1dd6c7=util['format'](_0xbe14('0x53'),_0x34cd66);if(fs[_0xbe14('0x54')](_0x1dd6c7)){_0x28f995=!![];return _0x32496a[_0xbe14('0x55')](_0x1dd6c7,_0x34cd66,config[_0xbe14('0x56')][_0xbe14('0x57')])[_0xbe14('0x22')](function(){return _0x42a346;});}return _0x42a346;}})[_0xbe14('0x22')](function(_0x32df3c){if(_0x32df3c){var _0x285b6e=path[_0xbe14('0x50')](config[_0xbe14('0x51')],'server/files/screen_recordings',_0x32df3c['value']);if(!fs['existsSync'](_0x285b6e)){throw new db[(_0xbe14('0x58'))][(_0xbe14('0x59'))](_0xbe14('0x5a'));}if(_0x32df3c[_0xbe14('0x5b')]){return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,_0x32df3c[_0xbe14('0x5b')]+path[_0xbe14('0x5c')](_0x285b6e),function(){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}else{return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,function(_0x451b0b){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}}})[_0xbe14('0x41')](function(_0x2088e4){if(_0x2088e4[_0xbe14('0x5e')]===_0xbe14('0x5a')){_0x50d78f[_0xbe14('0x17')](0x194)[_0xbe14('0x26')](_0xbe14('0x5f'));}else{return handleError(_0x50d78f,null);}});};exports[_0xbe14('0x60')]=function(_0x1a945b,_0x5f394c){return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':{'id':_0x1a945b[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](function(_0x3ee6b7){if(_[_0xbe14('0x61')](_0x3ee6b7)){throw new ReferenceError(_0xbe14('0x62'));}return _0x3ee6b7;})[_0xbe14('0x22')](function(_0x23cb36){var _0x100d43=path['join'](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x23cb36[_0xbe14('0x4b')]);logger[_0xbe14('0x63')](_0xbe14('0x64'),_0x100d43);if(!_['isNil'](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs['unlinkSync'](_0x100d43);}_0x100d43=_0x100d43+_0xbe14('0x67');if(!_[_0xbe14('0x61')](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs[_0xbe14('0x68')](_0x100d43);}return _0x23cb36;})['then'](function(_0x1bb588){if(!_0x1bb588)throw new InternalError();return _0x1bb588[_0xbe14('0x60')]();})[_0xbe14('0x22')](function(){_0x5f394c[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();})[_0xbe14('0x41')](handleError(_0x5f394c,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3195c93..0c2cc8b 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 _0x8e1d=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x5bedd7,_0x48e6a6){var _0x1cdcfd=function(_0x50d6ea){while(--_0x50d6ea){_0x5bedd7['push'](_0x5bedd7['shift']());}};_0x1cdcfd(++_0x48e6a6);}(_0x8e1d,0x110));var _0xd8e1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8e1d[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xd8e1('0x0'));var util=require(_0xd8e1('0x1'));var logger=require(_0xd8e1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd8e1('0x3'));var rp=require(_0xd8e1('0x4'));var fs=require('fs');var path=require(_0xd8e1('0x5'));var rimraf=require('rimraf');var config=require(_0xd8e1('0x6'));var attributes=require(_0xd8e1('0x7'));module[_0xd8e1('0x8')]=function(_0xdb3009,_0x164d54){return _0xdb3009[_0xd8e1('0x9')](_0xd8e1('0xa'),attributes,{'tableName':_0xd8e1('0xb'),'paranoid':![],'indexes':[{'name':_0xd8e1('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a8a=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','ScreenRecording','lodash'];(function(_0x35cde7,_0x6b3daa){var _0x3bd434=function(_0x5b0c22){while(--_0x5b0c22){_0x35cde7['push'](_0x35cde7['shift']());}};_0x3bd434(++_0x6b3daa);}(_0x6a8a,0x13a));var _0xa6a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a8a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6a8('0x0'));var util=require(_0xa6a8('0x1'));var logger=require(_0xa6a8('0x2'))('api');var moment=require(_0xa6a8('0x3'));var BPromise=require(_0xa6a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6a8('0x5'));var rimraf=require(_0xa6a8('0x6'));var config=require(_0xa6a8('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2c0805,_0x1af277){return _0x2c0805['define'](_0xa6a8('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 471584e..adc2233 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 _0x08ae=['message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3e4e85,_0x45dffc){var _0x575f18=function(_0x12d456){while(--_0x12d456){_0x3e4e85['push'](_0x3e4e85['shift']());}};_0x575f18(++_0x45dffc);}(_0x08ae,0x1ba));var _0xe08a=function(_0x18ed25,_0x3f4fbb){_0x18ed25=_0x18ed25-0x0;var _0x1bc566=_0x08ae[_0x18ed25];return _0x1bc566;};'use strict';var _=require(_0xe08a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe08a('0x1'));var fs=require('fs');var Redis=require(_0xe08a('0x2'));var db=require(_0xe08a('0x3'))['db'];var utils=require(_0xe08a('0x4'));var logger=require(_0xe08a('0x5'))(_0xe08a('0x6'));var config=require(_0xe08a('0x7'));var jayson=require(_0xe08a('0x8'));var client=jayson[_0xe08a('0x9')][_0xe08a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x391a08,_0x331973,_0xe4d053){return new BPromise(function(_0x2fbb73,_0x2e4d3c){return client[_0xe08a('0xb')](_0x391a08,_0xe4d053)['then'](function(_0x5680e1){logger[_0xe08a('0xc')](_0xe08a('0xd'),_0x331973,'request\x20sent');logger[_0xe08a('0xe')](_0xe08a('0xf'),_0x331973,_0xe08a('0x10'),JSON[_0xe08a('0x11')](_0x5680e1));if(_0x5680e1['error']){if(_0x5680e1[_0xe08a('0x12')][_0xe08a('0x13')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x331973,_0x5680e1[_0xe08a('0x12')][_0xe08a('0x14')]);return _0x2e4d3c(_0x5680e1[_0xe08a('0x12')][_0xe08a('0x14')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x331973,_0x5680e1[_0xe08a('0x12')]['message']);return _0x2fbb73(_0x5680e1[_0xe08a('0x12')][_0xe08a('0x14')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x331973,_0xe08a('0x10'));_0x2fbb73(_0x5680e1[_0xe08a('0x15')][_0xe08a('0x14')]);}})['catch'](function(_0x1d5b18){logger[_0xe08a('0x12')](_0xe08a('0xd'),_0x331973,_0x1d5b18);_0x2e4d3c(_0x1d5b18);});});} \ No newline at end of file +var _0xc4c9=['info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2566ee,_0x201011){var _0x2b7260=function(_0x3096ab){while(--_0x3096ab){_0x2566ee['push'](_0x2566ee['shift']());}};_0x2b7260(++_0x201011);}(_0xc4c9,0x11f));var _0x9c4c=function(_0x1b49de,_0x1bfacc){_0x1b49de=_0x1b49de-0x0;var _0x2763ae=_0xc4c9[_0x1b49de];return _0x2763ae;};'use strict';var _=require(_0x9c4c('0x0'));var util=require(_0x9c4c('0x1'));var moment=require('moment');var BPromise=require(_0x9c4c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c4c('0x3'))['db'];var utils=require(_0x9c4c('0x4'));var logger=require(_0x9c4c('0x5'))(_0x9c4c('0x6'));var config=require(_0x9c4c('0x7'));var jayson=require(_0x9c4c('0x8'));var client=jayson[_0x9c4c('0x9')][_0x9c4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21a0f1,_0x2ff1b7,_0x3a8c41){return new BPromise(function(_0x22c891,_0x2eab2b){return client[_0x9c4c('0xb')](_0x21a0f1,_0x3a8c41)[_0x9c4c('0xc')](function(_0x1071ce){logger[_0x9c4c('0xd')](_0x9c4c('0xe'),_0x2ff1b7,'request\x20sent');logger['debug'](_0x9c4c('0xf'),_0x2ff1b7,_0x9c4c('0x10'),JSON['stringify'](_0x1071ce));if(_0x1071ce['error']){if(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x12')]===0x1f4){logger['error'](_0x9c4c('0xe'),_0x2ff1b7,_0x1071ce['error'][_0x9c4c('0x13')]);return _0x2eab2b(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x13')]);}logger[_0x9c4c('0x11')](_0x9c4c('0xe'),_0x2ff1b7,_0x1071ce['error']['message']);return _0x22c891(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x13')]);}else{logger[_0x9c4c('0xd')](_0x9c4c('0xe'),_0x2ff1b7,'request\x20sent');_0x22c891(_0x1071ce['result'][_0x9c4c('0x13')]);}})['catch'](function(_0x4cadd1){logger[_0x9c4c('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x2ff1b7,_0x4cadd1);_0x2eab2b(_0x4cadd1);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9034521..86da598 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 _0x4855=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/now','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo','addLogoLogin','addPreferred','originalname','/:id','isAuthenticated','update','multer','path'];(function(_0x400019,_0xb47109){var _0x16a47a=function(_0x1fbc0e){while(--_0x1fbc0e){_0x400019['push'](_0x400019['shift']());}};_0x16a47a(++_0xb47109);}(_0x4855,0x1c6));var _0x5485=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0x4855[_0x2aa83a];return _0x36a653;};'use strict';var multer=require(_0x5485('0x0'));var util=require('util');var path=require(_0x5485('0x1'));var timeout=require(_0x5485('0x2'));var express=require('express');var router=express[_0x5485('0x3')]();var fs_extra=require(_0x5485('0x4'));var auth=require(_0x5485('0x5'));var interaction=require(_0x5485('0x6'));var config=require(_0x5485('0x7'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5485('0x8')]);router[_0x5485('0x9')](_0x5485('0xa'),controller['getDate']);router[_0x5485('0x9')]('/:id',controller[_0x5485('0xb')]);router['get'](_0x5485('0xc'),controller[_0x5485('0xd')]);router['get'](_0x5485('0xe'),controller[_0x5485('0xf')]);router['get'](_0x5485('0x10'),controller['gdpr']);router['get'](_0x5485('0x11'),controller['getPreferred']);router['get'](_0x5485('0x12'),controller[_0x5485('0x13')]);var upload=multer({'storage':multer[_0x5485('0x14')]({'destination':function(_0x564ef6,_0x498f82,_0x2f885b){_0x2f885b(null,path[_0x5485('0x15')](config[_0x5485('0x16')],_0x5485('0x17')));},'filename':function(_0x5026c7,_0x5c6131,_0x411011){_0x411011(null,util[_0x5485('0x18')](_0x5485('0x19'),_0x5485('0x1a'),path[_0x5485('0x1b')](_0x5c6131['originalname'])));}})});router[_0x5485('0x1c')](_0x5485('0xc'),upload[_0x5485('0x1d')](_0x5485('0x1e')),controller[_0x5485('0x1f')]);var upload=multer({'storage':multer[_0x5485('0x14')]({'destination':function(_0x17c514,_0x1003e6,_0xeae318){_0xeae318(null,path[_0x5485('0x15')](config[_0x5485('0x16')],_0x5485('0x17')));},'filename':function(_0x371815,_0x4f6ba2,_0x31290e){_0x31290e(null,util[_0x5485('0x18')]('%s%s','logologin',path[_0x5485('0x1b')](_0x4f6ba2['originalname'])));}})});router[_0x5485('0x1c')]('/:id/logo_login',upload[_0x5485('0x1d')](_0x5485('0x1e')),controller[_0x5485('0x20')]);var upload=multer({'storage':multer[_0x5485('0x14')]({'destination':function(_0x5324cc,_0x5e3e1d,_0x509e63){_0x509e63(null,path['join'](config[_0x5485('0x16')],'server/files/images/logos/'));},'filename':function(_0xf3aba7,_0xfe2d4b,_0x2b81e1){_0x2b81e1(null,util[_0x5485('0x18')](_0x5485('0x19'),'preferred',path[_0x5485('0x1b')](_0xfe2d4b['originalname'])));}})});router[_0x5485('0x1c')](_0x5485('0x11'),upload[_0x5485('0x1d')](_0x5485('0x1e')),controller[_0x5485('0x21')]);var upload=multer({'storage':multer[_0x5485('0x14')]({'destination':function(_0x35f235,_0x4fef6e,_0x1010a9){_0x1010a9(null,path[_0x5485('0x15')](config[_0x5485('0x16')],'server/files/images/logos/'));},'filename':function(_0x204aca,_0x1b887c,_0x55ab9f){_0x55ab9f(null,util[_0x5485('0x18')](_0x5485('0x19'),'favicon',path[_0x5485('0x1b')](_0x1b887c[_0x5485('0x22')])));}})});router[_0x5485('0x1c')](_0x5485('0x12'),upload[_0x5485('0x1d')]('file'),controller['addFavicon']);router['put'](_0x5485('0x23'),auth[_0x5485('0x24')](),controller[_0x5485('0x25')]);module['exports']=router; \ No newline at end of file +var _0xee80=['extname','single','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','logo','originalname','post','diskStorage','join','root','server/files/images/logos/','format','%s%s','logologin'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xee80,0x10b));var _0x0ee8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xee80[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require('multer');var util=require(_0x0ee8('0x0'));var path=require('path');var timeout=require(_0x0ee8('0x1'));var express=require(_0x0ee8('0x2'));var router=express[_0x0ee8('0x3')]();var fs_extra=require(_0x0ee8('0x4'));var auth=require(_0x0ee8('0x5'));var interaction=require(_0x0ee8('0x6'));var config=require(_0x0ee8('0x7'));var controller=require(_0x0ee8('0x8'));router[_0x0ee8('0x9')]('/',auth[_0x0ee8('0xa')](),controller[_0x0ee8('0xb')]);router[_0x0ee8('0x9')](_0x0ee8('0xc'),controller[_0x0ee8('0xd')]);router[_0x0ee8('0x9')](_0x0ee8('0xe'),controller['show']);router[_0x0ee8('0x9')](_0x0ee8('0xf'),controller[_0x0ee8('0x10')]);router[_0x0ee8('0x9')](_0x0ee8('0x11'),controller[_0x0ee8('0x12')]);router[_0x0ee8('0x9')](_0x0ee8('0x13'),controller[_0x0ee8('0x14')]);router[_0x0ee8('0x9')](_0x0ee8('0x15'),controller['getPreferred']);router[_0x0ee8('0x9')](_0x0ee8('0x16'),controller[_0x0ee8('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29c754,_0x4fdd12,_0x8c75e3){_0x8c75e3(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x49630b,_0x24508e,_0x431874){_0x431874(null,util['format']('%s%s',_0x0ee8('0x18'),path['extname'](_0x24508e[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x0ee8('0x1b')]({'destination':function(_0x26ad28,_0x3dfe39,_0x273d00){_0x273d00(null,path[_0x0ee8('0x1c')](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x5218b0,_0x3dfb85,_0x4787cc){_0x4787cc(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x21'),path[_0x0ee8('0x22')](_0x3dfb85[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x11'),upload[_0x0ee8('0x23')](_0x0ee8('0x24')),controller[_0x0ee8('0x25')]);var upload=multer({'storage':multer[_0x0ee8('0x1b')]({'destination':function(_0xe2cb30,_0x5effdb,_0x5617e9){_0x5617e9(null,path['join'](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x495518,_0xb515f9,_0x14eada){_0x14eada(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x26'),path['extname'](_0xb515f9['originalname'])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x15'),upload[_0x0ee8('0x23')]('file'),controller[_0x0ee8('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x472105,_0x382cd9,_0x24165b){_0x24165b(null,path[_0x0ee8('0x1c')](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x3b3fdd,_0x1aa119,_0x50b5e6){_0x50b5e6(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x28'),path[_0x0ee8('0x22')](_0x1aa119[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x16'),upload['single'](_0x0ee8('0x24')),controller[_0x0ee8('0x29')]);router[_0x0ee8('0x2a')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index e151492..e7088e5 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 _0xdc1d=['BOOLEAN','alternate','UNSIGNED','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x370736,_0x965e53){var _0x531a67=function(_0x5f1430){while(--_0x5f1430){_0x370736['push'](_0x370736['shift']());}};_0x531a67(++_0x965e53);}(_0xdc1d,0x88));var _0xddc1=function(_0x127904,_0x4fc951){_0x127904=_0x127904-0x0;var _0x3e7177=_0xdc1d[_0x127904];return _0x3e7177;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0xddc1('0x0')](0xb),'unique':_0xddc1('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xddc1('0x0')](0xb),'unique':_0xddc1('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xddc1('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xddc1('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xddc1('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xddc1('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xddc1('0x3')]},'turnaddr':{'type':Sequelize[_0xddc1('0x3')]},'turnusername':{'type':Sequelize[_0xddc1('0x3')]},'turnpassword':{'type':Sequelize[_0xddc1('0x3')]},'pageTitle':{'type':Sequelize[_0xddc1('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xddc1('0x0')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xddc1('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xddc1('0x3')],'defaultValue':_0xddc1('0x5')},'chatTimeout':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xddc1('0x3')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xddc1('0x0')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xddc1('0x0')]},'sentimentRegion':{'type':Sequelize[_0xddc1('0x3')]},'language':{'type':Sequelize[_0xddc1('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xddc1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xddc1('0x0')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xddc1('0x0')](0x2)[_0xddc1('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xddc1('0x0')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xddc1('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xddc1('0x0')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3bed=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x1257e6,_0x40323a){var _0x5ec19f=function(_0x411d4b){while(--_0x411d4b){_0x1257e6['push'](_0x1257e6['shift']());}};_0x5ec19f(++_0x40323a);}(_0x3bed,0x11e));var _0xd3be=function(_0x39bdb2,_0x3344fd){_0x39bdb2=_0x39bdb2-0x0;var _0xf47719=_0x3bed[_0x39bdb2];return _0xf47719;};'use strict';var Sequelize=require(_0xd3be('0x0'));module[_0xd3be('0x1')]={'min_internal':{'type':Sequelize[_0xd3be('0x2')](0xb),'unique':_0xd3be('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xd3be('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd3be('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd3be('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd3be('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xd3be('0x5')]},'turnaddr':{'type':Sequelize[_0xd3be('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xd3be('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd3be('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x8')},'enableEmailPreview':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x9')},'chatTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd3be('0x5')]},'defaultPreferred':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd3be('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xd3be('0x5')]},'defaultFavicon':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xd3be('0x2')]},'transcribeRegion':{'type':Sequelize[_0xd3be('0x5')]},'sentiment':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xd3be('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd3be('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c1f0516..2e6d2f5 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 _0x5cd7=['existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','getLogoLogin','default_loginLogo.svg','\x20not\x20found','download','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','send','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','http','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','end','sendStatus','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','rows','params','keys','includeAll','find','body','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'];(function(_0x19adb0,_0x436f03){var _0x18a4b9=function(_0x2f5ab1){while(--_0x2f5ab1){_0x19adb0['push'](_0x19adb0['shift']());}};_0x18a4b9(++_0x436f03);}(_0x5cd7,0x102));var _0x75cd=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x5cd7[_0x27bd2c];return _0x3784ea;};'use strict';var emlformat=require(_0x75cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75cd('0x1'));var jsonpatch=require(_0x75cd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75cd('0x3'));var Mustache=require(_0x75cd('0x4'));var util=require(_0x75cd('0x5'));var path=require(_0x75cd('0x6'));var sox=require(_0x75cd('0x7'));var csv=require(_0x75cd('0x8'));var ejs=require(_0x75cd('0x9'));var fs=require('fs');var fs_extra=require(_0x75cd('0xa'));var _=require(_0x75cd('0xb'));var squel=require('squel');var crypto=require(_0x75cd('0xc'));var jsforce=require(_0x75cd('0xd'));var deskjs=require(_0x75cd('0xe'));var toCsv=require(_0x75cd('0x8'));var querystring=require(_0x75cd('0xf'));var Papa=require(_0x75cd('0x10'));var Redis=require(_0x75cd('0x11'));var authService=require(_0x75cd('0x12'));var qs=require(_0x75cd('0x13'));var as=require(_0x75cd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75cd('0x15'))('api');var utils=require(_0x75cd('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x75cd('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x75cd('0x18')][_0x75cd('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x12701f,_0x5f0712,_0x4b7ee0,_0x265daa){return new BPromise(function(_0x474abe,_0x3a3e79){var _0x3c40ab=_0x265daa||client;return _0x3c40ab['request'](_0x12701f,_0x4b7ee0)[_0x75cd('0x1a')](function(_0x1159b2){logger[_0x75cd('0x1b')]('Setting,\x20%s,\x20%s',_0x5f0712,_0x75cd('0x1c'));logger['debug'](_0x75cd('0x1d'),_0x5f0712,_0x75cd('0x1c'),JSON[_0x75cd('0x1e')](_0x1159b2));if(_0x1159b2[_0x75cd('0x1f')]){if(_0x1159b2[_0x75cd('0x1f')]['code']===0x1f4){logger[_0x75cd('0x1f')](_0x75cd('0x20'),_0x5f0712,_0x1159b2['error'][_0x75cd('0x21')]);return _0x3a3e79(_0x1159b2[_0x75cd('0x1f')][_0x75cd('0x21')]);}logger[_0x75cd('0x1f')](_0x75cd('0x20'),_0x5f0712,_0x1159b2[_0x75cd('0x1f')][_0x75cd('0x21')]);return _0x474abe(_0x1159b2[_0x75cd('0x1f')][_0x75cd('0x21')]);}else{logger[_0x75cd('0x1b')](_0x75cd('0x20'),_0x5f0712,_0x75cd('0x1c'));_0x474abe(_0x1159b2[_0x75cd('0x22')][_0x75cd('0x21')]);}})[_0x75cd('0x23')](function(_0x19c7cc){logger[_0x75cd('0x1f')]('Setting,\x20%s,\x20%s',_0x5f0712,_0x19c7cc);_0x3a3e79(_0x19c7cc);});});}function respondWithStatusCode(_0xd37b7b,_0x496842){_0x496842=_0x496842||0xcc;return function(_0x31f298){if(_0x31f298){return _0xd37b7b['sendStatus'](_0x496842);}return _0xd37b7b[_0x75cd('0x24')](_0x496842)['end']();};}function respondWithResult(_0x14b398,_0x12c2a1){_0x12c2a1=_0x12c2a1||0xc8;return function(_0x22935a){if(_0x22935a){return _0x14b398[_0x75cd('0x24')](_0x12c2a1)[_0x75cd('0x25')](_0x22935a);}};}function respondWithFilteredResult(_0x51a084,_0x2343aa){return function(_0x2c85df){if(_0x2c85df){var _0x37dbe7=typeof _0x2343aa[_0x75cd('0x26')]===_0x75cd('0x27')&&typeof _0x2343aa[_0x75cd('0x28')]===_0x75cd('0x27');var _0x5ab986=_0x2c85df[_0x75cd('0x29')];var _0x421b35=_0x37dbe7?0x0:_0x2343aa[_0x75cd('0x26')];var _0x5f504c=_0x37dbe7?_0x2c85df['count']:_0x2343aa[_0x75cd('0x26')]+_0x2343aa['limit'];var _0x23bc4d;if(_0x5f504c>=_0x5ab986){_0x5f504c=_0x5ab986;_0x23bc4d=0xc8;}else{_0x23bc4d=0xce;}_0x51a084[_0x75cd('0x24')](_0x23bc4d);return _0x51a084[_0x75cd('0x2a')](_0x75cd('0x2b'),_0x421b35+'-'+_0x5f504c+'/'+_0x5ab986)[_0x75cd('0x25')](_0x2c85df);}return null;};}function patchUpdates(_0x3994a0){return function(_0x5b77f5){try{jsonpatch[_0x75cd('0x2c')](_0x5b77f5,_0x3994a0,!![]);}catch(_0xd1a878){return BPromise['reject'](_0xd1a878);}return _0x5b77f5['save']();};}function saveUpdates(_0x4f64f0,_0x26d904){return function(_0x3adf7b){if(_0x3adf7b){return _0x3adf7b[_0x75cd('0x2d')](_0x4f64f0)['then'](function(_0x2d79e6){return _0x2d79e6;});}return null;};}function removeEntity(_0x12e7cb,_0x386c93){return function(_0x4666ad){if(_0x4666ad){return _0x4666ad[_0x75cd('0x2e')]()[_0x75cd('0x1a')](function(){_0x12e7cb[_0x75cd('0x24')](0xcc)[_0x75cd('0x2f')]();});}};}function handleEntityNotFound(_0x46512d,_0x1c577d){return function(_0x3d2cd5){if(!_0x3d2cd5){_0x46512d[_0x75cd('0x30')](0x194);}return _0x3d2cd5;};}function handleError(_0x306ccd,_0x5e50f8){_0x5e50f8=_0x5e50f8||0x1f4;return function(_0x47431a){logger[_0x75cd('0x1f')](_0x47431a[_0x75cd('0x31')]);if(_0x47431a['name']){delete _0x47431a[_0x75cd('0x32')];}_0x306ccd[_0x75cd('0x24')](_0x5e50f8)['send'](_0x47431a);};}exports['index']=function(_0x13a800,_0x3b1516){var _0x54ae51={},_0x460506={},_0x3f6489={'count':0x0,'rows':[]};var _0x5cecb9=_[_0x75cd('0x33')](db[_0x75cd('0x34')][_0x75cd('0x35')],function(_0x2da639){return{'name':_0x2da639[_0x75cd('0x36')],'type':_0x2da639[_0x75cd('0x37')][_0x75cd('0x38')]};});_0x460506[_0x75cd('0x39')]=_[_0x75cd('0x33')](_0x5cecb9,'name');_0x460506['query']=_['keys'](_0x13a800[_0x75cd('0x3a')]);_0x460506[_0x75cd('0x3b')]=_[_0x75cd('0x3c')](_0x460506[_0x75cd('0x39')],_0x460506[_0x75cd('0x3a')]);_0x54ae51[_0x75cd('0x3d')]=_[_0x75cd('0x3c')](_0x460506[_0x75cd('0x39')],qs['fields'](_0x13a800[_0x75cd('0x3a')][_0x75cd('0x3e')]));_0x54ae51[_0x75cd('0x3d')]=_0x54ae51[_0x75cd('0x3d')][_0x75cd('0x3f')]?_0x54ae51[_0x75cd('0x3d')]:_0x460506[_0x75cd('0x39')];if(!_0x13a800[_0x75cd('0x3a')]['hasOwnProperty'](_0x75cd('0x40'))){_0x54ae51[_0x75cd('0x28')]=qs[_0x75cd('0x28')](_0x13a800['query'][_0x75cd('0x28')]);_0x54ae51[_0x75cd('0x26')]=qs[_0x75cd('0x26')](_0x13a800[_0x75cd('0x3a')]['offset']);}_0x54ae51['order']=qs[_0x75cd('0x41')](_0x13a800[_0x75cd('0x3a')][_0x75cd('0x41')]);_0x54ae51['where']=qs[_0x75cd('0x3b')](_[_0x75cd('0x42')](_0x13a800['query'],_0x460506[_0x75cd('0x3b')]),_0x5cecb9);if(_0x13a800[_0x75cd('0x3a')][_0x75cd('0x43')]){_0x54ae51[_0x75cd('0x44')]=_[_0x75cd('0x45')](_0x54ae51[_0x75cd('0x44')],{'$or':_[_0x75cd('0x33')](_0x5cecb9,function(_0x21e144){if(_0x21e144[_0x75cd('0x37')]!==_0x75cd('0x46')){var _0x443c92={};_0x443c92[_0x21e144[_0x75cd('0x32')]]={'$like':'%'+_0x13a800[_0x75cd('0x3a')]['filter']+'%'};return _0x443c92;}})});}_0x54ae51=_[_0x75cd('0x45')]({},_0x54ae51,_0x13a800[_0x75cd('0x47')]);var _0x4ee504={'where':_0x54ae51['where']};return db[_0x75cd('0x34')][_0x75cd('0x29')](_0x4ee504)['then'](function(_0x39364d){_0x3f6489['count']=_0x39364d;if(_0x13a800[_0x75cd('0x3a')]['includeAll']){_0x54ae51['include']=[{'all':!![]}];}return db['Setting']['findAll'](_0x54ae51);})[_0x75cd('0x1a')](function(_0x3996e4){_0x3f6489[_0x75cd('0x48')]=_0x3996e4;return _0x3f6489;})[_0x75cd('0x1a')](respondWithFilteredResult(_0x3b1516,_0x54ae51))[_0x75cd('0x23')](handleError(_0x3b1516,null));};exports['show']=function(_0x1e96c5,_0x48e2e6){var _0x2dc65f={'raw':![],'where':{'id':_0x1e96c5[_0x75cd('0x49')]['id']}},_0x415769={};_0x415769[_0x75cd('0x39')]=_[_0x75cd('0x4a')](db[_0x75cd('0x34')][_0x75cd('0x35')]);_0x415769['query']=_[_0x75cd('0x4a')](_0x1e96c5[_0x75cd('0x3a')]);_0x415769[_0x75cd('0x3b')]=_['intersection'](_0x415769[_0x75cd('0x39')],_0x415769[_0x75cd('0x3a')]);_0x2dc65f[_0x75cd('0x3d')]=_[_0x75cd('0x3c')](_0x415769[_0x75cd('0x39')],qs[_0x75cd('0x3e')](_0x1e96c5[_0x75cd('0x3a')][_0x75cd('0x3e')]));_0x2dc65f[_0x75cd('0x3d')]=_0x2dc65f[_0x75cd('0x3d')][_0x75cd('0x3f')]?_0x2dc65f[_0x75cd('0x3d')]:_0x415769[_0x75cd('0x39')];if(_0x1e96c5[_0x75cd('0x3a')][_0x75cd('0x4b')]){_0x2dc65f['include']=[{'all':!![]}];}_0x2dc65f=_[_0x75cd('0x45')]({},_0x2dc65f,_0x1e96c5[_0x75cd('0x47')]);return db[_0x75cd('0x34')][_0x75cd('0x4c')](_0x2dc65f)['then'](handleEntityNotFound(_0x48e2e6,null))['then'](respondWithResult(_0x48e2e6,null))[_0x75cd('0x23')](handleError(_0x48e2e6,null));};exports['update']=function(_0x251dbc,_0x27af77){if(_0x251dbc[_0x75cd('0x4d')]['id']){delete _0x251dbc['body']['id'];}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x251dbc[_0x75cd('0x49')]['id']}})[_0x75cd('0x1a')](handleEntityNotFound(_0x27af77,null))[_0x75cd('0x1a')](saveUpdates(_0x251dbc[_0x75cd('0x4d')],null))['then'](respondWithResult(_0x27af77,null))[_0x75cd('0x23')](handleError(_0x27af77,null));};exports['addLogo']=function(_0x41c56f,_0x58634f,_0x5ec770){if(_0x41c56f[_0x75cd('0x4e')]&&_0x41c56f[_0x75cd('0x4e')][_0x75cd('0x4f')]){_0x41c56f[_0x75cd('0x4d')][_0x75cd('0x50')]=_0x41c56f['file'][_0x75cd('0x4f')];}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x41c56f[_0x75cd('0x49')]['id']}})[_0x75cd('0x1a')](handleEntityNotFound(_0x58634f,null))['then'](saveUpdates(_0x41c56f[_0x75cd('0x4d')],null))[_0x75cd('0x1a')](respondWithResult(_0x58634f,null))['catch'](handleError(_0x58634f,null));};exports[_0x75cd('0x51')]=function(_0x1a5225,_0x564745,_0x31488f){if(_0x1a5225['file']&&_0x1a5225['file']['filename']){_0x1a5225[_0x75cd('0x4d')][_0x75cd('0x52')]=_0x1a5225[_0x75cd('0x4e')][_0x75cd('0x4f')];}return db['Setting'][_0x75cd('0x4c')]({'where':{'id':_0x1a5225[_0x75cd('0x49')]['id']}})[_0x75cd('0x1a')](handleEntityNotFound(_0x564745,null))[_0x75cd('0x1a')](saveUpdates(_0x1a5225[_0x75cd('0x4d')],null))[_0x75cd('0x1a')](respondWithResult(_0x564745,null))['catch'](handleError(_0x564745,null));};var utilLicense=require(_0x75cd('0x53'));exports[_0x75cd('0x54')]=function(_0x41cbd5,_0x2a86fc,_0x498471){var _0x3a45cb=_0x75cd('0x55');var _0x5b1ec9={'custom':![]};return utilLicense[_0x75cd('0x56')]()['then'](function(_0x4146d9){if(_0x4146d9){_0x5b1ec9=_0x4146d9;}return db['Setting'][_0x75cd('0x4c')]({'where':{'id':_0x41cbd5['params']['id']},'attributes':['logo',_0x75cd('0x52'),_0x75cd('0x57'),_0x75cd('0x58'),_0x75cd('0x59'),_0x75cd('0x5a'),_0x75cd('0x5b'),_0x75cd('0x5c')],'raw':!![]});})[_0x75cd('0x1a')](handleEntityNotFound(_0x2a86fc,null))[_0x75cd('0x1a')](function(_0x4770d4){if(_0x4770d4){var _0x554c17=_0x4770d4['logo']&&fs[_0x75cd('0x5d')](path[_0x75cd('0x5e')](config[_0x75cd('0x5f')],_0x3a45cb,_[_0x75cd('0x60')](_0x4770d4[_0x75cd('0x50')])))?path[_0x75cd('0x5e')](config['root'],_0x3a45cb,_['toLower'](_0x4770d4[_0x75cd('0x50')])):path[_0x75cd('0x5e')](config['root'],_0x3a45cb,_[_0x75cd('0x60')](_0x75cd('0x61')));var _0x549324=_0x75cd('0x62')+_[_0x75cd('0x63')](_0x75cd('0x50'));if(_0x4770d4[_0x549324]||!_0x5b1ec9[_0x75cd('0x64')]){_0x554c17=path[_0x75cd('0x5e')](config[_0x75cd('0x5f')],_0x3a45cb,_[_0x75cd('0x60')](_0x75cd('0x61')));}if(!fs[_0x75cd('0x5d')](_0x554c17)){throw new db[(_0x75cd('0x65'))][(_0x75cd('0x66'))](_[_0x75cd('0x63')]('logo')+'\x20not\x20found');}return _0x2a86fc['download'](_0x554c17);}})[_0x75cd('0x23')](handleError(_0x2a86fc,null));};var utilLicense=require(_0x75cd('0x53'));exports[_0x75cd('0x67')]=function(_0x3f04ba,_0x2b4652,_0x728853){var _0x474981=_0x75cd('0x55');var _0x1340b5={'custom':![]};return utilLicense[_0x75cd('0x56')]()[_0x75cd('0x1a')](function(_0x514a34){if(_0x514a34){_0x1340b5=_0x514a34;}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x3f04ba[_0x75cd('0x49')]['id']},'attributes':['logo',_0x75cd('0x52'),_0x75cd('0x57'),'favicon',_0x75cd('0x59'),'defaultLoginLogo','defaultPreferred',_0x75cd('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x2b4652,null))['then'](function(_0x1223bf){if(_0x1223bf){var _0x2c2d53=_0x1223bf[_0x75cd('0x52')]&&fs[_0x75cd('0x5d')](path['join'](config[_0x75cd('0x5f')],_0x474981,_[_0x75cd('0x60')](_0x1223bf[_0x75cd('0x52')])))?path['join'](config[_0x75cd('0x5f')],_0x474981,_[_0x75cd('0x60')](_0x1223bf[_0x75cd('0x52')])):path[_0x75cd('0x5e')](config['root'],_0x474981,_['toLower'](_0x75cd('0x68')));var _0xd8971c=_0x75cd('0x62')+_[_0x75cd('0x63')](_0x75cd('0x52'));if(_0x1223bf[_0xd8971c]||!_0x1340b5[_0x75cd('0x64')]){_0x2c2d53=path[_0x75cd('0x5e')](config[_0x75cd('0x5f')],_0x474981,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x75cd('0x5d')](_0x2c2d53)){throw new db[(_0x75cd('0x65'))][(_0x75cd('0x66'))](_['upperFirst']('loginLogo')+_0x75cd('0x69'));}return _0x2b4652[_0x75cd('0x6a')](_0x2c2d53);}})['catch'](handleError(_0x2b4652,null));};exports['gdpr']=function(_0x43382c,_0x176dbe){return db[_0x75cd('0x34')]['find']({'where':{'id':_0x43382c[_0x75cd('0x49')]['id']},'attributes':[_0x75cd('0x6b')]})[_0x75cd('0x1a')](respondWithResult(_0x176dbe,null))[_0x75cd('0x23')](handleError(_0x176dbe,null));};exports[_0x75cd('0x6c')]=function(_0x45be06,_0x31137f,_0x210e65){if(_0x45be06['file']&&_0x45be06[_0x75cd('0x4e')][_0x75cd('0x4f')]){_0x45be06[_0x75cd('0x4d')][_0x75cd('0x57')]=_0x45be06[_0x75cd('0x4e')][_0x75cd('0x4f')];}return db['Setting'][_0x75cd('0x4c')]({'where':{'id':_0x45be06[_0x75cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x31137f,null))['then'](saveUpdates(_0x45be06[_0x75cd('0x4d')],null))[_0x75cd('0x1a')](respondWithResult(_0x31137f,null))['catch'](handleError(_0x31137f,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x34b8a0,_0x5631bd,_0x34a1e6){var _0x4e2af1='server/files/images/logos';var _0xd1280e={'custom':![]};return utilLicense[_0x75cd('0x56')]()[_0x75cd('0x1a')](function(_0xf18bf8){if(_0xf18bf8){_0xd1280e=_0xf18bf8;}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x34b8a0['params']['id']},'attributes':['logo',_0x75cd('0x52'),_0x75cd('0x57'),_0x75cd('0x58'),_0x75cd('0x59'),_0x75cd('0x5a'),_0x75cd('0x5b'),_0x75cd('0x5c')],'raw':!![]});})[_0x75cd('0x1a')](handleEntityNotFound(_0x5631bd,null))[_0x75cd('0x1a')](function(_0x2b0e91){if(_0x2b0e91){var _0x249b60=_0x2b0e91[_0x75cd('0x57')]&&fs['existsSync'](path[_0x75cd('0x5e')](config['root'],_0x4e2af1,_['toLower'](_0x2b0e91[_0x75cd('0x57')])))?path['join'](config[_0x75cd('0x5f')],_0x4e2af1,_[_0x75cd('0x60')](_0x2b0e91['preferred'])):path[_0x75cd('0x5e')](config[_0x75cd('0x5f')],_0x4e2af1,_[_0x75cd('0x60')]('default_preferred.png'));var _0x3bce2e=_0x75cd('0x62')+_[_0x75cd('0x63')](_0x75cd('0x57'));if(_0x2b0e91[_0x3bce2e]||!_0xd1280e[_0x75cd('0x64')]||!_0xd1280e[_0x75cd('0x57')]){_0x249b60=path['join'](config[_0x75cd('0x5f')],_0x4e2af1,_[_0x75cd('0x60')](_0x75cd('0x6d')));}if(!fs[_0x75cd('0x5d')](_0x249b60)){throw new db[(_0x75cd('0x65'))][(_0x75cd('0x66'))](_['upperFirst'](_0x75cd('0x57'))+_0x75cd('0x69'));}return _0x5631bd[_0x75cd('0x6a')](_0x249b60);}})[_0x75cd('0x23')](handleError(_0x5631bd,null));};exports[_0x75cd('0x6e')]=function(_0x27fde4,_0x287108,_0x29366d){if(_0x27fde4[_0x75cd('0x4e')]&&_0x27fde4[_0x75cd('0x4e')][_0x75cd('0x4f')]){_0x27fde4[_0x75cd('0x4d')][_0x75cd('0x58')]=_0x27fde4[_0x75cd('0x4e')][_0x75cd('0x4f')];}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x27fde4[_0x75cd('0x49')]['id']}})[_0x75cd('0x1a')](handleEntityNotFound(_0x287108,null))[_0x75cd('0x1a')](saveUpdates(_0x27fde4['body'],null))[_0x75cd('0x1a')](respondWithResult(_0x287108,null))['catch'](handleError(_0x287108,null));};var utilLicense=require(_0x75cd('0x53'));exports[_0x75cd('0x6f')]=function(_0x30eb41,_0x641d2,_0x11961e){var _0x156729=_0x75cd('0x55');var _0x4c9044={'custom':![]};return utilLicense['getLicense']()[_0x75cd('0x1a')](function(_0x121bf9){if(_0x121bf9){_0x4c9044=_0x121bf9;}return db[_0x75cd('0x34')][_0x75cd('0x4c')]({'where':{'id':_0x30eb41[_0x75cd('0x49')]['id']},'attributes':['logo',_0x75cd('0x52'),'preferred',_0x75cd('0x58'),_0x75cd('0x59'),_0x75cd('0x5a'),_0x75cd('0x5b'),_0x75cd('0x5c')],'raw':!![]});})[_0x75cd('0x1a')](handleEntityNotFound(_0x641d2,null))[_0x75cd('0x1a')](function(_0x4ecf4b){if(_0x4ecf4b){var _0x2e3869=_0x4ecf4b[_0x75cd('0x58')]&&fs[_0x75cd('0x5d')](path[_0x75cd('0x5e')](config['root'],_0x156729,_['toLower'](_0x4ecf4b[_0x75cd('0x58')])))?path[_0x75cd('0x5e')](config[_0x75cd('0x5f')],_0x156729,_[_0x75cd('0x60')](_0x4ecf4b[_0x75cd('0x58')])):path['join'](config[_0x75cd('0x5f')],_0x156729,_['toLower'](_0x75cd('0x70')));var _0x3e5446=_0x75cd('0x62')+_['upperFirst'](_0x75cd('0x58'));if(_0x4ecf4b[_0x3e5446]||!_0x4c9044[_0x75cd('0x64')]){_0x2e3869=path['join'](config['root'],_0x156729,_['toLower']('default_favicon.ico'));}if(!fs[_0x75cd('0x5d')](_0x2e3869)){throw new db['Sequelize'][(_0x75cd('0x66'))](_[_0x75cd('0x63')](_0x75cd('0x58'))+_0x75cd('0x69'));}return _0x641d2['download'](_0x2e3869);}})[_0x75cd('0x23')](handleError(_0x641d2,null));};exports[_0x75cd('0x71')]=function(_0x513340,_0x142465){var _0x25077d={'offset':moment()[_0x75cd('0x72')]()};_0x25077d[_0x75cd('0x73')]=moment()[_0x75cd('0x72')](_0x25077d[_0x75cd('0x26')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x142465[_0x75cd('0x24')](0xc8)[_0x75cd('0x74')](_0x25077d);}; \ No newline at end of file +var _0x1603=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','update','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','default','upperFirst','custom','join','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','gdpr','addPreferred','server/files/images/logos','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','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/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','limit','count','set','apply','reject','save','destroy','sendStatus','stack','name','send','map','Setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1603,0x1b4));var _0x3160=function(_0x35dfae,_0xeb8092){_0x35dfae=_0x35dfae-0x0;var _0x28de7a=_0x1603[_0x35dfae];return _0x28de7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3160('0x0'));var zipdir=require(_0x3160('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3160('0x2'));var moment=require(_0x3160('0x3'));var BPromise=require(_0x3160('0x4'));var Mustache=require('mustache');var util=require(_0x3160('0x5'));var path=require('path');var sox=require(_0x3160('0x6'));var csv=require(_0x3160('0x7'));var ejs=require(_0x3160('0x8'));var fs=require('fs');var fs_extra=require(_0x3160('0x9'));var _=require(_0x3160('0xa'));var squel=require(_0x3160('0xb'));var crypto=require(_0x3160('0xc'));var jsforce=require(_0x3160('0xd'));var deskjs=require(_0x3160('0xe'));var toCsv=require(_0x3160('0x7'));var querystring=require(_0x3160('0xf'));var Papa=require(_0x3160('0x10'));var Redis=require(_0x3160('0x11'));var authService=require(_0x3160('0x12'));var qs=require(_0x3160('0x13'));var as=require(_0x3160('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3160('0x15'))(_0x3160('0x16'));var utils=require(_0x3160('0x17'));var config=require(_0x3160('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x3160('0x19'));var client=jayson[_0x3160('0x1a')][_0x3160('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ca22f,_0x3cd44a,_0x528e0e,_0x20b3b0){return new BPromise(function(_0x269325,_0x41ef02){var _0x31ab91=_0x20b3b0||client;return _0x31ab91['request'](_0x5ca22f,_0x528e0e)[_0x3160('0x1c')](function(_0x5eb8b1){logger[_0x3160('0x1d')](_0x3160('0x1e'),_0x3cd44a,_0x3160('0x1f'));logger[_0x3160('0x20')](_0x3160('0x21'),_0x3cd44a,_0x3160('0x1f'),JSON[_0x3160('0x22')](_0x5eb8b1));if(_0x5eb8b1['error']){if(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x24')]===0x1f4){logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);return _0x41ef02(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);}logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);return _0x269325(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);}else{logger[_0x3160('0x1d')](_0x3160('0x1e'),_0x3cd44a,_0x3160('0x1f'));_0x269325(_0x5eb8b1['result'][_0x3160('0x25')]);}})[_0x3160('0x26')](function(_0x3a08ab){logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x3a08ab);_0x41ef02(_0x3a08ab);});});}function respondWithStatusCode(_0x2821a0,_0xcb69bb){_0xcb69bb=_0xcb69bb||0xcc;return function(_0x227a38){if(_0x227a38){return _0x2821a0['sendStatus'](_0xcb69bb);}return _0x2821a0[_0x3160('0x27')](_0xcb69bb)[_0x3160('0x28')]();};}function respondWithResult(_0xe6dd7c,_0x6c4eeb){_0x6c4eeb=_0x6c4eeb||0xc8;return function(_0x36d175){if(_0x36d175){return _0xe6dd7c[_0x3160('0x27')](_0x6c4eeb)[_0x3160('0x29')](_0x36d175);}};}function respondWithFilteredResult(_0x28a69d,_0x570be0){return function(_0x1cf464){if(_0x1cf464){var _0x34343c=typeof _0x570be0[_0x3160('0x2a')]==='undefined'&&typeof _0x570be0[_0x3160('0x2b')]==='undefined';var _0xd20ef2=_0x1cf464[_0x3160('0x2c')];var _0x16eaee=_0x34343c?0x0:_0x570be0[_0x3160('0x2a')];var _0x521390=_0x34343c?_0x1cf464[_0x3160('0x2c')]:_0x570be0[_0x3160('0x2a')]+_0x570be0[_0x3160('0x2b')];var _0x27cd30;if(_0x521390>=_0xd20ef2){_0x521390=_0xd20ef2;_0x27cd30=0xc8;}else{_0x27cd30=0xce;}_0x28a69d[_0x3160('0x27')](_0x27cd30);return _0x28a69d[_0x3160('0x2d')]('Content-Range',_0x16eaee+'-'+_0x521390+'/'+_0xd20ef2)['json'](_0x1cf464);}return null;};}function patchUpdates(_0x2cc935){return function(_0x284838){try{jsonpatch[_0x3160('0x2e')](_0x284838,_0x2cc935,!![]);}catch(_0x3d8e2d){return BPromise[_0x3160('0x2f')](_0x3d8e2d);}return _0x284838[_0x3160('0x30')]();};}function saveUpdates(_0x73ba78,_0x42e04b){return function(_0x1b288e){if(_0x1b288e){return _0x1b288e['update'](_0x73ba78)['then'](function(_0x32a70c){return _0x32a70c;});}return null;};}function removeEntity(_0x45058e,_0x31bc8f){return function(_0x152721){if(_0x152721){return _0x152721[_0x3160('0x31')]()[_0x3160('0x1c')](function(){_0x45058e[_0x3160('0x27')](0xcc)[_0x3160('0x28')]();});}};}function handleEntityNotFound(_0x6c6eb5,_0x197d15){return function(_0x35f594){if(!_0x35f594){_0x6c6eb5[_0x3160('0x32')](0x194);}return _0x35f594;};}function handleError(_0x52fda8,_0x42f72d){_0x42f72d=_0x42f72d||0x1f4;return function(_0x255c29){logger[_0x3160('0x23')](_0x255c29[_0x3160('0x33')]);if(_0x255c29[_0x3160('0x34')]){delete _0x255c29[_0x3160('0x34')];}_0x52fda8['status'](_0x42f72d)[_0x3160('0x35')](_0x255c29);};}exports['index']=function(_0xd9b80a,_0x1b086a){var _0x10ee5f={},_0x563d44={},_0x27be57={'count':0x0,'rows':[]};var _0x11154b=_[_0x3160('0x36')](db[_0x3160('0x37')][_0x3160('0x38')],function(_0x29efdd){return{'name':_0x29efdd[_0x3160('0x39')],'type':_0x29efdd[_0x3160('0x3a')][_0x3160('0x3b')]};});_0x563d44[_0x3160('0x3c')]=_['map'](_0x11154b,_0x3160('0x34'));_0x563d44[_0x3160('0x3d')]=_[_0x3160('0x3e')](_0xd9b80a[_0x3160('0x3d')]);_0x563d44[_0x3160('0x3f')]=_[_0x3160('0x40')](_0x563d44[_0x3160('0x3c')],_0x563d44['query']);_0x10ee5f[_0x3160('0x41')]=_[_0x3160('0x40')](_0x563d44[_0x3160('0x3c')],qs[_0x3160('0x42')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x42')]));_0x10ee5f['attributes']=_0x10ee5f[_0x3160('0x41')]['length']?_0x10ee5f['attributes']:_0x563d44[_0x3160('0x3c')];if(!_0xd9b80a[_0x3160('0x3d')][_0x3160('0x43')]('nolimit')){_0x10ee5f[_0x3160('0x2b')]=qs[_0x3160('0x2b')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x2b')]);_0x10ee5f['offset']=qs[_0x3160('0x2a')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x2a')]);}_0x10ee5f[_0x3160('0x44')]=qs[_0x3160('0x45')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x45')]);_0x10ee5f[_0x3160('0x46')]=qs[_0x3160('0x3f')](_['pick'](_0xd9b80a[_0x3160('0x3d')],_0x563d44[_0x3160('0x3f')]),_0x11154b);if(_0xd9b80a['query'][_0x3160('0x47')]){_0x10ee5f[_0x3160('0x46')]=_['merge'](_0x10ee5f[_0x3160('0x46')],{'$or':_[_0x3160('0x36')](_0x11154b,function(_0x49aa50){if(_0x49aa50['type']!==_0x3160('0x48')){var _0x51e2e6={};_0x51e2e6[_0x49aa50[_0x3160('0x34')]]={'$like':'%'+_0xd9b80a[_0x3160('0x3d')][_0x3160('0x47')]+'%'};return _0x51e2e6;}})});}_0x10ee5f=_[_0x3160('0x49')]({},_0x10ee5f,_0xd9b80a[_0x3160('0x4a')]);var _0xd060de={'where':_0x10ee5f[_0x3160('0x46')]};return db[_0x3160('0x37')][_0x3160('0x2c')](_0xd060de)[_0x3160('0x1c')](function(_0x2f6e1f){_0x27be57[_0x3160('0x2c')]=_0x2f6e1f;if(_0xd9b80a[_0x3160('0x3d')][_0x3160('0x4b')]){_0x10ee5f[_0x3160('0x4c')]=[{'all':!![]}];}return db[_0x3160('0x37')][_0x3160('0x4d')](_0x10ee5f);})[_0x3160('0x1c')](function(_0x4a8cec){_0x27be57[_0x3160('0x4e')]=_0x4a8cec;return _0x27be57;})[_0x3160('0x1c')](respondWithFilteredResult(_0x1b086a,_0x10ee5f))[_0x3160('0x26')](handleError(_0x1b086a,null));};exports[_0x3160('0x4f')]=function(_0x457dcf,_0x16d172){var _0x599c33={'raw':![],'where':{'id':_0x457dcf[_0x3160('0x50')]['id']}},_0x329e0a={};_0x329e0a['model']=_[_0x3160('0x3e')](db[_0x3160('0x37')]['rawAttributes']);_0x329e0a[_0x3160('0x3d')]=_[_0x3160('0x3e')](_0x457dcf['query']);_0x329e0a[_0x3160('0x3f')]=_[_0x3160('0x40')](_0x329e0a[_0x3160('0x3c')],_0x329e0a['query']);_0x599c33[_0x3160('0x41')]=_[_0x3160('0x40')](_0x329e0a[_0x3160('0x3c')],qs['fields'](_0x457dcf[_0x3160('0x3d')][_0x3160('0x42')]));_0x599c33[_0x3160('0x41')]=_0x599c33[_0x3160('0x41')]['length']?_0x599c33['attributes']:_0x329e0a['model'];if(_0x457dcf[_0x3160('0x3d')][_0x3160('0x4b')]){_0x599c33[_0x3160('0x4c')]=[{'all':!![]}];}_0x599c33=_[_0x3160('0x49')]({},_0x599c33,_0x457dcf['options']);return db['Setting'][_0x3160('0x51')](_0x599c33)['then'](handleEntityNotFound(_0x16d172,null))[_0x3160('0x1c')](respondWithResult(_0x16d172,null))[_0x3160('0x26')](handleError(_0x16d172,null));};exports[_0x3160('0x52')]=function(_0x925e3c,_0x54e4fa){if(_0x925e3c[_0x3160('0x53')]['id']){delete _0x925e3c[_0x3160('0x53')]['id'];}return db[_0x3160('0x37')]['find']({'where':{'id':_0x925e3c[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x54e4fa,null))[_0x3160('0x1c')](saveUpdates(_0x925e3c[_0x3160('0x53')],null))[_0x3160('0x1c')](respondWithResult(_0x54e4fa,null))[_0x3160('0x26')](handleError(_0x54e4fa,null));};exports[_0x3160('0x54')]=function(_0x5c55c5,_0x6fe46a,_0x42e6b3){if(_0x5c55c5[_0x3160('0x55')]&&_0x5c55c5[_0x3160('0x55')]['filename']){_0x5c55c5[_0x3160('0x53')][_0x3160('0x56')]=_0x5c55c5[_0x3160('0x55')][_0x3160('0x57')];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x5c55c5[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x6fe46a,null))['then'](saveUpdates(_0x5c55c5[_0x3160('0x53')],null))[_0x3160('0x1c')](respondWithResult(_0x6fe46a,null))['catch'](handleError(_0x6fe46a,null));};exports[_0x3160('0x58')]=function(_0x31e03c,_0x236b34,_0x536a6c){if(_0x31e03c[_0x3160('0x55')]&&_0x31e03c[_0x3160('0x55')][_0x3160('0x57')]){_0x31e03c[_0x3160('0x53')][_0x3160('0x59')]=_0x31e03c['file'][_0x3160('0x57')];}return db[_0x3160('0x37')]['find']({'where':{'id':_0x31e03c[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x236b34,null))[_0x3160('0x1c')](saveUpdates(_0x31e03c[_0x3160('0x53')],null))['then'](respondWithResult(_0x236b34,null))['catch'](handleError(_0x236b34,null));};var utilLicense=require(_0x3160('0x5a'));exports['getLogo']=function(_0x3fda2b,_0x40eefe,_0x17d809){var _0x4a2771='server/files/images/logos';var _0x50bca9={'custom':![]};return utilLicense[_0x3160('0x5b')]()['then'](function(_0x26dda5){if(_0x26dda5){_0x50bca9=_0x26dda5;}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x3fda2b['params']['id']},'attributes':[_0x3160('0x56'),_0x3160('0x59'),'preferred',_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x40eefe,null))[_0x3160('0x1c')](function(_0x13fda5){if(_0x13fda5){var _0x31e448=_0x13fda5[_0x3160('0x56')]&&fs[_0x3160('0x61')](path['join'](config[_0x3160('0x62')],_0x4a2771,_[_0x3160('0x63')](_0x13fda5[_0x3160('0x56')])))?path['join'](config['root'],_0x4a2771,_['toLower'](_0x13fda5[_0x3160('0x56')])):path['join'](config[_0x3160('0x62')],_0x4a2771,_[_0x3160('0x63')]('default_logo.svg'));var _0x44a112=_0x3160('0x64')+_[_0x3160('0x65')]('logo');if(_0x13fda5[_0x44a112]||!_0x50bca9[_0x3160('0x66')]){_0x31e448=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x4a2771,_['toLower'](_0x3160('0x68')));}if(!fs['existsSync'](_0x31e448)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x56'))+_0x3160('0x6b'));}return _0x40eefe[_0x3160('0x6c')](_0x31e448);}})[_0x3160('0x26')](handleError(_0x40eefe,null));};var utilLicense=require(_0x3160('0x5a'));exports[_0x3160('0x6d')]=function(_0x345a10,_0x5c4414,_0x539834){var _0x30e8fc='server/files/images/logos';var _0x70bd50={'custom':![]};return utilLicense[_0x3160('0x5b')]()[_0x3160('0x1c')](function(_0x56ed26){if(_0x56ed26){_0x70bd50=_0x56ed26;}return db[_0x3160('0x37')]['find']({'where':{'id':_0x345a10[_0x3160('0x50')]['id']},'attributes':[_0x3160('0x56'),'loginLogo',_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x5c4414,null))[_0x3160('0x1c')](function(_0x32b0b7){if(_0x32b0b7){var _0x4bf92d=_0x32b0b7[_0x3160('0x59')]&&fs[_0x3160('0x61')](path['join'](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')](_0x32b0b7['loginLogo'])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_['toLower'](_0x32b0b7[_0x3160('0x59')])):path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')]('default_loginLogo.svg'));var _0x1fa2d5=_0x3160('0x64')+_[_0x3160('0x65')](_0x3160('0x59'));if(_0x32b0b7[_0x1fa2d5]||!_0x70bd50[_0x3160('0x66')]){_0x4bf92d=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')](_0x3160('0x6f')));}if(!fs[_0x3160('0x61')](_0x4bf92d)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x59'))+_0x3160('0x6b'));}return _0x5c4414['download'](_0x4bf92d);}})['catch'](handleError(_0x5c4414,null));};exports[_0x3160('0x70')]=function(_0x5e2d04,_0x88b83e){return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x5e2d04['params']['id']},'attributes':['securePassword']})[_0x3160('0x1c')](respondWithResult(_0x88b83e,null))[_0x3160('0x26')](handleError(_0x88b83e,null));};exports[_0x3160('0x71')]=function(_0x496e9b,_0x44b9b5,_0x3d436e){if(_0x496e9b[_0x3160('0x55')]&&_0x496e9b[_0x3160('0x55')][_0x3160('0x57')]){_0x496e9b[_0x3160('0x53')][_0x3160('0x6e')]=_0x496e9b[_0x3160('0x55')]['filename'];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x496e9b[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x44b9b5,null))['then'](saveUpdates(_0x496e9b['body'],null))[_0x3160('0x1c')](respondWithResult(_0x44b9b5,null))[_0x3160('0x26')](handleError(_0x44b9b5,null));};var utilLicense=require(_0x3160('0x5a'));exports['getPreferred']=function(_0x2e181a,_0xa50990,_0x2b54e4){var _0x2231c6=_0x3160('0x72');var _0xf8540a={'custom':![]};return utilLicense[_0x3160('0x5b')]()['then'](function(_0x1f6ea8){if(_0x1f6ea8){_0xf8540a=_0x1f6ea8;}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x2e181a['params']['id']},'attributes':[_0x3160('0x56'),_0x3160('0x59'),_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0xa50990,null))[_0x3160('0x1c')](function(_0x54b130){if(_0x54b130){var _0x37137a=_0x54b130['preferred']&&fs[_0x3160('0x61')](path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x54b130[_0x3160('0x6e')])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x54b130[_0x3160('0x6e')])):path['join'](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x3160('0x73')));var _0x3c6ef9='default'+_[_0x3160('0x65')](_0x3160('0x6e'));if(_0x54b130[_0x3c6ef9]||!_0xf8540a[_0x3160('0x66')]||!_0xf8540a[_0x3160('0x6e')]){_0x37137a=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x3160('0x73')));}if(!fs[_0x3160('0x61')](_0x37137a)){throw new db['Sequelize'][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x6e'))+_0x3160('0x6b'));}return _0xa50990[_0x3160('0x6c')](_0x37137a);}})[_0x3160('0x26')](handleError(_0xa50990,null));};exports[_0x3160('0x74')]=function(_0x1c85f9,_0x98607c,_0x54d74a){if(_0x1c85f9[_0x3160('0x55')]&&_0x1c85f9[_0x3160('0x55')][_0x3160('0x57')]){_0x1c85f9['body']['favicon']=_0x1c85f9[_0x3160('0x55')]['filename'];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x1c85f9[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x98607c,null))['then'](saveUpdates(_0x1c85f9[_0x3160('0x53')],null))['then'](respondWithResult(_0x98607c,null))['catch'](handleError(_0x98607c,null));};var utilLicense=require(_0x3160('0x5a'));exports['getFavicon']=function(_0x285c91,_0x579a12,_0x1fc1de){var _0x839fae=_0x3160('0x72');var _0x352312={'custom':![]};return utilLicense[_0x3160('0x5b')]()[_0x3160('0x1c')](function(_0x3c87e7){if(_0x3c87e7){_0x352312=_0x3c87e7;}return db['Setting']['find']({'where':{'id':_0x285c91['params']['id']},'attributes':[_0x3160('0x56'),'loginLogo',_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x579a12,null))[_0x3160('0x1c')](function(_0x4e187d){if(_0x4e187d){var _0x38b164=_0x4e187d['favicon']&&fs[_0x3160('0x61')](path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x4e187d[_0x3160('0x5c')])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x4e187d[_0x3160('0x5c')])):path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x3160('0x75')));var _0x68588b=_0x3160('0x64')+_['upperFirst'](_0x3160('0x5c'));if(_0x4e187d[_0x68588b]||!_0x352312[_0x3160('0x66')]){_0x38b164=path['join'](config['root'],_0x839fae,_[_0x3160('0x63')](_0x3160('0x75')));}if(!fs[_0x3160('0x61')](_0x38b164)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')]('favicon')+_0x3160('0x6b'));}return _0x579a12[_0x3160('0x6c')](_0x38b164);}})[_0x3160('0x26')](handleError(_0x579a12,null));};exports[_0x3160('0x76')]=function(_0x50961c,_0x1d6cb2){var _0x3c32ef={'offset':moment()[_0x3160('0x77')]()};_0x3c32ef[_0x3160('0x78')]=moment()[_0x3160('0x77')](_0x3c32ef[_0x3160('0x2a')])[_0x3160('0x79')](_0x3160('0x7a'));return _0x1d6cb2[_0x3160('0x27')](0xc8)[_0x3160('0x35')](_0x3c32ef);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 97bc037..36d3184 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4575e5,_0x95f8a4){var _0x55d543=function(_0x314196){while(--_0x314196){_0x4575e5['push'](_0x4575e5['shift']());}};_0x55d543(++_0x95f8a4);}(_0xedd9,0xfc));var _0x9edd=function(_0x4bd11d,_0xee69b8){_0x4bd11d=_0x4bd11d-0x0;var _0x328238=_0xedd9[_0x4bd11d];return _0x328238;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x55ca,0x126));var _0xa55c=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0x55ca[_0xec74fe];return _0x50bda2;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c33b702..e540112 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 _0xbb11=['ShowSetting','find','options','raw','where','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch'];(function(_0x989e19,_0x41f0dc){var _0x14e47b=function(_0x20f7ad){while(--_0x20f7ad){_0x989e19['push'](_0x989e19['shift']());}};_0x14e47b(++_0x41f0dc);}(_0xbb11,0xa9));var _0x1bb1=function(_0x3d7d2e,_0x39ce8c){_0x3d7d2e=_0x3d7d2e-0x0;var _0x384d4c=_0xbb11[_0x3d7d2e];return _0x384d4c;};'use strict';var _=require(_0x1bb1('0x0'));var util=require('util');var moment=require(_0x1bb1('0x1'));var BPromise=require(_0x1bb1('0x2'));var rs=require(_0x1bb1('0x3'));var fs=require('fs');var Redis=require(_0x1bb1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bb1('0x5'));var logger=require(_0x1bb1('0x6'))(_0x1bb1('0x7'));var config=require(_0x1bb1('0x8'));var jayson=require(_0x1bb1('0x9'));var client=jayson['client'][_0x1bb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3be152,_0x49ca71,_0x2bebaf){return new BPromise(function(_0x3c6f70,_0x49038c){return client[_0x1bb1('0xb')](_0x3be152,_0x2bebaf)[_0x1bb1('0xc')](function(_0x38802e){logger[_0x1bb1('0xd')]('Setting,\x20%s,\x20%s',_0x49ca71,_0x1bb1('0xe'));logger[_0x1bb1('0xf')](_0x1bb1('0x10'),_0x49ca71,_0x1bb1('0xe'),JSON[_0x1bb1('0x11')](_0x38802e));if(_0x38802e['error']){if(_0x38802e[_0x1bb1('0x12')][_0x1bb1('0x13')]===0x1f4){logger[_0x1bb1('0x12')](_0x1bb1('0x14'),_0x49ca71,_0x38802e[_0x1bb1('0x12')][_0x1bb1('0x15')]);return _0x49038c(_0x38802e[_0x1bb1('0x12')]['message']);}logger['error'](_0x1bb1('0x14'),_0x49ca71,_0x38802e['error'][_0x1bb1('0x15')]);return _0x3c6f70(_0x38802e['error'][_0x1bb1('0x15')]);}else{logger[_0x1bb1('0xd')](_0x1bb1('0x14'),_0x49ca71,_0x1bb1('0xe'));_0x3c6f70(_0x38802e['result'][_0x1bb1('0x15')]);}})[_0x1bb1('0x16')](function(_0x2f1bc7){logger[_0x1bb1('0x12')](_0x1bb1('0x14'),_0x49ca71,_0x2f1bc7);_0x49038c(_0x2f1bc7);});});}exports[_0x1bb1('0x17')]=function(_0x5296d8){var _0x28e85c=this;return new Promise(function(_0x41751e,_0x28d9c8){return db['Setting'][_0x1bb1('0x18')]({'raw':_0x5296d8[_0x1bb1('0x19')]?_0x5296d8['options'][_0x1bb1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5296d8[_0x1bb1('0x19')]?_0x5296d8['options'][_0x1bb1('0x1b')]||null:null,'attributes':_0x5296d8['options']?_0x5296d8['options']['attributes']||null:null,'include':_0x5296d8[_0x1bb1('0x19')]?_0x5296d8[_0x1bb1('0x19')][_0x1bb1('0x1c')]?_[_0x1bb1('0x1d')](_0x5296d8[_0x1bb1('0x19')][_0x1bb1('0x1c')],function(_0x1c43f5){return{'model':db[_0x1c43f5[_0x1bb1('0x1e')]],'as':_0x1c43f5['as'],'attributes':_0x1c43f5['attributes'],'include':_0x1c43f5[_0x1bb1('0x1c')]?_[_0x1bb1('0x1d')](_0x1c43f5[_0x1bb1('0x1c')],function(_0x1c6bb1){return{'model':db[_0x1c6bb1[_0x1bb1('0x1e')]],'as':_0x1c6bb1['as'],'attributes':_0x1c6bb1['attributes'],'include':_0x1c6bb1['include']?_[_0x1bb1('0x1d')](_0x1c6bb1['include'],function(_0x4769e3){return{'model':db[_0x4769e3[_0x1bb1('0x1e')]],'as':_0x4769e3['as'],'attributes':_0x4769e3[_0x1bb1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1bb1('0xc')](function(_0x5328c1){logger[_0x1bb1('0xd')]('ShowSetting',_0x5296d8);logger['debug'](_0x1bb1('0x17'),_0x5296d8,JSON[_0x1bb1('0x11')](_0x5328c1));_0x41751e(_0x5328c1);})['catch'](function(_0x4755a7){logger[_0x1bb1('0x12')]('ShowSetting',_0x4755a7['message'],_0x5296d8);_0x28d9c8(_0x28e85c[_0x1bb1('0x12')](0x1f4,_0x4755a7['message']));});});}; \ No newline at end of file +var _0x4063=['stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x313a00,_0x107929){var _0x46d07b=function(_0x452b30){while(--_0x452b30){_0x313a00['push'](_0x313a00['shift']());}};_0x46d07b(++_0x107929);}(_0x4063,0x1be));var _0x3406=function(_0x14405c,_0x12b9b9){_0x14405c=_0x14405c-0x0;var _0x5d54ba=_0x4063[_0x14405c];return _0x5d54ba;};'use strict';var _=require(_0x3406('0x0'));var util=require(_0x3406('0x1'));var moment=require(_0x3406('0x2'));var BPromise=require(_0x3406('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3406('0x4'));var db=require(_0x3406('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3406('0x6'));var config=require(_0x3406('0x7'));var jayson=require(_0x3406('0x8'));var client=jayson[_0x3406('0x9')][_0x3406('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13bc06,_0x39b0b4,_0x14717a){return new BPromise(function(_0x449acb,_0x231f19){return client[_0x3406('0xb')](_0x13bc06,_0x14717a)[_0x3406('0xc')](function(_0x4cdbeb){logger[_0x3406('0xd')]('Setting,\x20%s,\x20%s',_0x39b0b4,_0x3406('0xe'));logger['debug'](_0x3406('0xf'),_0x39b0b4,_0x3406('0xe'),JSON[_0x3406('0x10')](_0x4cdbeb));if(_0x4cdbeb[_0x3406('0x11')]){if(_0x4cdbeb[_0x3406('0x11')][_0x3406('0x12')]===0x1f4){logger[_0x3406('0x11')](_0x3406('0x13'),_0x39b0b4,_0x4cdbeb['error'][_0x3406('0x14')]);return _0x231f19(_0x4cdbeb[_0x3406('0x11')][_0x3406('0x14')]);}logger[_0x3406('0x11')](_0x3406('0x13'),_0x39b0b4,_0x4cdbeb[_0x3406('0x11')][_0x3406('0x14')]);return _0x449acb(_0x4cdbeb['error'][_0x3406('0x14')]);}else{logger[_0x3406('0xd')](_0x3406('0x13'),_0x39b0b4,'request\x20sent');_0x449acb(_0x4cdbeb[_0x3406('0x15')][_0x3406('0x14')]);}})[_0x3406('0x16')](function(_0x4b65be){logger['error'](_0x3406('0x13'),_0x39b0b4,_0x4b65be);_0x231f19(_0x4b65be);});});}exports[_0x3406('0x17')]=function(_0x309c16){var _0x296096=this;return new Promise(function(_0x4badf2,_0x5cec1d){return db[_0x3406('0x18')]['find']({'raw':_0x309c16[_0x3406('0x19')]?_0x309c16[_0x3406('0x19')][_0x3406('0x1a')]===undefined?!![]:![]:!![],'where':_0x309c16['options']?_0x309c16[_0x3406('0x19')][_0x3406('0x1b')]||null:null,'attributes':_0x309c16[_0x3406('0x19')]?_0x309c16[_0x3406('0x19')][_0x3406('0x1c')]||null:null,'include':_0x309c16['options']?_0x309c16[_0x3406('0x19')]['include']?_[_0x3406('0x1d')](_0x309c16['options'][_0x3406('0x1e')],function(_0x2ee8ac){return{'model':db[_0x2ee8ac['model']],'as':_0x2ee8ac['as'],'attributes':_0x2ee8ac['attributes'],'include':_0x2ee8ac['include']?_[_0x3406('0x1d')](_0x2ee8ac['include'],function(_0x5da6f4){return{'model':db[_0x5da6f4[_0x3406('0x1f')]],'as':_0x5da6f4['as'],'attributes':_0x5da6f4[_0x3406('0x1c')],'include':_0x5da6f4[_0x3406('0x1e')]?_[_0x3406('0x1d')](_0x5da6f4[_0x3406('0x1e')],function(_0x24aced){return{'model':db[_0x24aced[_0x3406('0x1f')]],'as':_0x24aced['as'],'attributes':_0x24aced[_0x3406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3406('0xc')](function(_0x48067c){logger[_0x3406('0xd')](_0x3406('0x17'),_0x309c16);logger[_0x3406('0x20')](_0x3406('0x17'),_0x309c16,JSON[_0x3406('0x10')](_0x48067c));_0x4badf2(_0x48067c);})[_0x3406('0x16')](function(_0x5c109d){logger[_0x3406('0x11')](_0x3406('0x17'),_0x5c109d[_0x3406('0x14')],_0x309c16);_0x5cec1d(_0x296096[_0x3406('0x11')](0x1f4,_0x5c109d[_0x3406('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 44a9c88..59fcd85 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 _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x3208d3,_0x3b31bb){var _0x5adbd3=function(_0xf4f7da){while(--_0xf4f7da){_0x3208d3['push'](_0x3208d3['shift']());}};_0x5adbd3(++_0x3b31bb);}(_0x53ec,0x192));var _0xc53e=function(_0x25acfe,_0x3797bc){_0x25acfe=_0x25acfe-0x0;var _0x547928=_0x53ec[_0x25acfe];return _0x547928;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file +var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x2b84d5,_0x428914){var _0x51452a=function(_0x3ddc9c){while(--_0x3ddc9c){_0x2b84d5['push'](_0x2b84d5['shift']());}};_0x51452a(++_0x428914);}(_0x5fab,0x177));var _0xb5fa=function(_0x3a196b,_0x1a03c4){_0x3a196b=_0x3a196b-0x0;var _0x192dd8=_0x5fab[_0x3a196b];return _0x192dd8;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 68e25e4..bd6becf 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 _0x45ce=['generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x45ce,0x133));var _0xe45c=function(_0x47f3f9,_0x1c347a){_0x47f3f9=_0x47f3f9-0x0;var _0x2f9922=_0x45ce[_0x47f3f9];return _0x2f9922;};'use strict';var Sequelize=require(_0xe45c('0x0'));var rs=require(_0xe45c('0x1'));module[_0xe45c('0x2')]={'name':{'type':Sequelize[_0xe45c('0x3')],'unique':_0xe45c('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe45c('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe45c('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe45c('0x3')],'defaultValue':function(){return rs[_0xe45c('0x5')]();}},'phone':{'type':Sequelize[_0xe45c('0x3')]},'type':{'type':Sequelize[_0xe45c('0x6')](_0xe45c('0x7'),_0xe45c('0x8'),'connectel',_0xe45c('0x9'),_0xe45c('0xa'),_0xe45c('0xb'),_0xe45c('0xc'),_0xe45c('0xd'),_0xe45c('0xe'),_0xe45c('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xe45c('0x3')]},'authToken':{'type':Sequelize[_0xe45c('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xe45c('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe45c('0x3')]},'applicationId':{'type':Sequelize[_0xe45c('0x3')]},'accountId':{'type':Sequelize[_0xe45c('0x3')]},'senderString':{'type':Sequelize[_0xe45c('0x3')]},'deliveryReport':{'type':Sequelize[_0xe45c('0x10')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xe45c('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe45c('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe45c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe45c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe45c('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe45c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe45c('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe45c('0x12')],'comment':_0xe45c('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xe45c('0x10')],'defaultValue':![],'comment':_0xe45c('0x14'),'set':function(_0x522887){if(!_0x522887)this[_0xe45c('0x15')](_0xe45c('0x16'),null);this['setDataValue'](_0xe45c('0x17'),_0x522887);}}}; \ No newline at end of file +var _0x67b5=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','csc','intelepeer','BOOLEAN'];(function(_0x58fff4,_0xfc3641){var _0x4949b2=function(_0x1462c1){while(--_0x1462c1){_0x58fff4['push'](_0x58fff4['shift']());}};_0x4949b2(++_0xfc3641);}(_0x67b5,0x11f));var _0x567b=function(_0x2633d7,_0x3ddb04){_0x2633d7=_0x2633d7-0x0;var _0x559b29=_0x67b5[_0x2633d7];return _0x559b29;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x567b('0x0'));module[_0x567b('0x1')]={'name':{'type':Sequelize[_0x567b('0x2')],'unique':_0x567b('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x567b('0x2')],'defaultValue':function(){return rs[_0x567b('0x4')]();}},'phone':{'type':Sequelize[_0x567b('0x2')]},'type':{'type':Sequelize[_0x567b('0x5')](_0x567b('0x6'),_0x567b('0x7'),'connectel',_0x567b('0x8'),_0x567b('0x9'),'clickatell','bandwidth',_0x567b('0xa'),'infobip',_0x567b('0xb'))},'accountSid':{'type':Sequelize[_0x567b('0x2')]},'authId':{'type':Sequelize[_0x567b('0x2')]},'authToken':{'type':Sequelize[_0x567b('0x2')]},'smsMethod':{'type':Sequelize[_0x567b('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x567b('0x2')]},'password':{'type':Sequelize[_0x567b('0x2')]},'apiKey':{'type':Sequelize[_0x567b('0x2')]},'applicationId':{'type':Sequelize[_0x567b('0x2')]},'accountId':{'type':Sequelize[_0x567b('0x2')]},'senderString':{'type':Sequelize[_0x567b('0x2')]},'deliveryReport':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x567b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x567b('0xd')],'defaultValue':function(){return _0x567b('0xe');}},'notificationSound':{'type':Sequelize[_0x567b('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x567b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x567b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x567b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x567b('0xf')],'comment':_0x567b('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b3e3c){if(!_0x4b3e3c)this[_0x567b('0x11')](_0x567b('0x12'),null);this[_0x567b('0x11')](_0x567b('0x13'),_0x4b3e3c);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cbc4e50..2e9c8e4 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 _0xa8d8=['Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','messageId','skebby','sender','connectel','message_id','Text','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','Contacts','list','omit','defaults','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','SmsMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','entity\x20found','text/xml','send','\x0a','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','User','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','clicksend','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsAccount.socket','register','jayson/promise','client','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SmsAccount','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','role','get','UserProfileSection','userProfileId','describe','addDisposition','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','SmsAccountId','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication'];(function(_0x4454e7,_0x2e916a){var _0x4c2a56=function(_0x103efc){while(--_0x103efc){_0x4454e7['push'](_0x4454e7['shift']());}};_0x4c2a56(++_0x2e916a);}(_0xa8d8,0x6a));var _0x8a8d=function(_0x59c135,_0x2324ac){_0x59c135=_0x59c135-0x0;var _0x1603eb=_0xa8d8[_0x59c135];return _0x1603eb;};'use strict';var emlformat=require(_0x8a8d('0x0'));var rimraf=require(_0x8a8d('0x1'));var zipdir=require(_0x8a8d('0x2'));var jsonpatch=require(_0x8a8d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a8d('0x4'));var Mustache=require(_0x8a8d('0x5'));var util=require(_0x8a8d('0x6'));var path=require(_0x8a8d('0x7'));var sox=require(_0x8a8d('0x8'));var csv=require(_0x8a8d('0x9'));var ejs=require(_0x8a8d('0xa'));var fs=require('fs');var fs_extra=require(_0x8a8d('0xb'));var _=require(_0x8a8d('0xc'));var squel=require(_0x8a8d('0xd'));var crypto=require(_0x8a8d('0xe'));var jsforce=require(_0x8a8d('0xf'));var deskjs=require(_0x8a8d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a8d('0x11'));var Redis=require(_0x8a8d('0x12'));var authService=require(_0x8a8d('0x13'));var qs=require(_0x8a8d('0x14'));var as=require(_0x8a8d('0x15'));var hardwareService=require(_0x8a8d('0x16'));var logger=require('../../config/logger')(_0x8a8d('0x17'));var utils=require(_0x8a8d('0x18'));var config=require(_0x8a8d('0x19'));var licenseUtil=require(_0x8a8d('0x1a'));var db=require(_0x8a8d('0x1b'))['db'];config[_0x8a8d('0x1c')]=_['defaults'](config['redis'],{'host':_0x8a8d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8a8d('0x1e'))[_0x8a8d('0x1f')](socket);var jayson=require(_0x8a8d('0x20'));var client=jayson[_0x8a8d('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2daf74,_0x5b2439,_0x45fd56,_0x2c13e9){return new BPromise(function(_0x55bf6b,_0x332084){var _0x1ab404=_0x2c13e9||client;return _0x1ab404[_0x8a8d('0x22')](_0x2daf74,_0x45fd56)[_0x8a8d('0x23')](function(_0x4ad5c3){logger['info'](_0x8a8d('0x24'),_0x5b2439,_0x8a8d('0x25'));logger[_0x8a8d('0x26')](_0x8a8d('0x27'),_0x5b2439,_0x8a8d('0x25'),JSON[_0x8a8d('0x28')](_0x4ad5c3));if(_0x4ad5c3[_0x8a8d('0x29')]){if(_0x4ad5c3[_0x8a8d('0x29')][_0x8a8d('0x2a')]===0x1f4){logger[_0x8a8d('0x29')](_0x8a8d('0x24'),_0x5b2439,_0x4ad5c3[_0x8a8d('0x29')][_0x8a8d('0x2b')]);return _0x332084(_0x4ad5c3[_0x8a8d('0x29')][_0x8a8d('0x2b')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x5b2439,_0x4ad5c3[_0x8a8d('0x29')][_0x8a8d('0x2b')]);return _0x55bf6b(_0x4ad5c3[_0x8a8d('0x29')][_0x8a8d('0x2b')]);}else{logger[_0x8a8d('0x2c')](_0x8a8d('0x24'),_0x5b2439,_0x8a8d('0x25'));_0x55bf6b(_0x4ad5c3['result'][_0x8a8d('0x2b')]);}})['catch'](function(_0x54fe09){logger[_0x8a8d('0x29')]('SmsAccount,\x20%s,\x20%s',_0x5b2439,_0x54fe09);_0x332084(_0x54fe09);});});}function respondWithStatusCode(_0x4cd96e,_0x1671cd){_0x1671cd=_0x1671cd||0xcc;return function(_0x5afb0c){if(_0x5afb0c){return _0x4cd96e['sendStatus'](_0x1671cd);}return _0x4cd96e['status'](_0x1671cd)[_0x8a8d('0x2d')]();};}function respondWithResult(_0x1eeea1,_0x98f720){_0x98f720=_0x98f720||0xc8;return function(_0x1486d2){if(_0x1486d2){return _0x1eeea1[_0x8a8d('0x2e')](_0x98f720)[_0x8a8d('0x2f')](_0x1486d2);}};}function respondWithFilteredResult(_0x3f8acd,_0x2e1b00){return function(_0x439f7d){if(_0x439f7d){var _0xb3af95=typeof _0x2e1b00[_0x8a8d('0x30')]===_0x8a8d('0x31')&&typeof _0x2e1b00[_0x8a8d('0x32')]===_0x8a8d('0x31');var _0x1895fb=_0x439f7d[_0x8a8d('0x33')];var _0x50ae0e=_0xb3af95?0x0:_0x2e1b00[_0x8a8d('0x30')];var _0x1d03d0=_0xb3af95?_0x439f7d[_0x8a8d('0x33')]:_0x2e1b00[_0x8a8d('0x30')]+_0x2e1b00[_0x8a8d('0x32')];var _0x50641f;if(_0x1d03d0>=_0x1895fb){_0x1d03d0=_0x1895fb;_0x50641f=0xc8;}else{_0x50641f=0xce;}_0x3f8acd[_0x8a8d('0x2e')](_0x50641f);return _0x3f8acd[_0x8a8d('0x34')]('Content-Range',_0x50ae0e+'-'+_0x1d03d0+'/'+_0x1895fb)['json'](_0x439f7d);}return null;};}function patchUpdates(_0x259cee){return function(_0x4c961f){try{jsonpatch[_0x8a8d('0x35')](_0x4c961f,_0x259cee,!![]);}catch(_0x4c79ba){return BPromise[_0x8a8d('0x36')](_0x4c79ba);}return _0x4c961f[_0x8a8d('0x37')]();};}function saveUpdates(_0x592df9,_0x2df66c){return function(_0x4ac227){if(_0x4ac227){return _0x4ac227[_0x8a8d('0x38')](_0x592df9)[_0x8a8d('0x23')](function(_0x1f7813){return _0x1f7813;});}return null;};}function removeEntity(_0x172375,_0x11c3b6){return function(_0x37285e){if(_0x37285e){return _0x37285e[_0x8a8d('0x39')]()['then'](function(){var _0x32ecdc=_0x37285e['get']({'plain':!![]});var _0x5d88d8=_0x8a8d('0x3a');return db[_0x8a8d('0x3b')][_0x8a8d('0x39')]({'where':{'type':_0x5d88d8,'resourceId':_0x32ecdc['id']}})[_0x8a8d('0x23')](function(){return _0x37285e;});})['then'](function(){_0x172375[_0x8a8d('0x2e')](0xcc)[_0x8a8d('0x2d')]();});}};}function handleEntityNotFound(_0x22e60d,_0x4226ce){return function(_0x35514d){if(!_0x35514d){_0x22e60d['sendStatus'](0x194);}return _0x35514d;};}function handleError(_0x548c77,_0x2bb11d){_0x2bb11d=_0x2bb11d||0x1f4;return function(_0xe43f25){logger[_0x8a8d('0x29')](_0xe43f25[_0x8a8d('0x3c')]);if(_0xe43f25[_0x8a8d('0x3d')]){delete _0xe43f25[_0x8a8d('0x3d')];}_0x548c77['status'](_0x2bb11d)['send'](_0xe43f25);};}exports[_0x8a8d('0x3e')]=function(_0x4e0769,_0x1385e9){var _0x320c9b={'include':[{'model':db[_0x8a8d('0x3f')],'as':_0x8a8d('0x40')}]},_0x3627f1={},_0x2e8976={'count':0x0,'rows':[]};var _0x37f7fd=_[_0x8a8d('0x41')](db['SmsAccount']['rawAttributes'],function(_0x28e274){return{'name':_0x28e274[_0x8a8d('0x42')],'type':_0x28e274[_0x8a8d('0x43')][_0x8a8d('0x44')]};});_0x3627f1['model']=_[_0x8a8d('0x41')](_0x37f7fd,_0x8a8d('0x3d'));_0x3627f1[_0x8a8d('0x45')]=_[_0x8a8d('0x46')](_0x4e0769[_0x8a8d('0x45')]);_0x3627f1[_0x8a8d('0x47')]=_[_0x8a8d('0x48')](_0x3627f1[_0x8a8d('0x49')],_0x3627f1[_0x8a8d('0x45')]);_0x320c9b[_0x8a8d('0x4a')]=_[_0x8a8d('0x48')](_0x3627f1[_0x8a8d('0x49')],qs[_0x8a8d('0x4b')](_0x4e0769[_0x8a8d('0x45')][_0x8a8d('0x4b')]));_0x320c9b[_0x8a8d('0x4a')]=_0x320c9b['attributes'][_0x8a8d('0x4c')]?_0x320c9b[_0x8a8d('0x4a')]:_0x3627f1[_0x8a8d('0x49')];if(!_0x4e0769[_0x8a8d('0x45')][_0x8a8d('0x4d')](_0x8a8d('0x4e'))){_0x320c9b['limit']=qs['limit'](_0x4e0769[_0x8a8d('0x45')][_0x8a8d('0x32')]);_0x320c9b['offset']=qs['offset'](_0x4e0769[_0x8a8d('0x45')][_0x8a8d('0x30')]);}_0x320c9b[_0x8a8d('0x4f')]=qs[_0x8a8d('0x50')](_0x4e0769['query'][_0x8a8d('0x50')]);_0x320c9b[_0x8a8d('0x51')]=qs[_0x8a8d('0x47')](_[_0x8a8d('0x52')](_0x4e0769[_0x8a8d('0x45')],_0x3627f1[_0x8a8d('0x47')]),_0x37f7fd);if(_0x4e0769[_0x8a8d('0x45')][_0x8a8d('0x53')]){_0x320c9b[_0x8a8d('0x51')]=_[_0x8a8d('0x54')](_0x320c9b['where'],{'$or':_[_0x8a8d('0x41')](_0x37f7fd,function(_0xbea6a){if(_0xbea6a[_0x8a8d('0x43')]!=='VIRTUAL'){var _0x2f6d0f={};_0x2f6d0f[_0xbea6a[_0x8a8d('0x3d')]]={'$like':'%'+_0x4e0769[_0x8a8d('0x45')]['filter']+'%'};return _0x2f6d0f;}})});}_0x320c9b=_[_0x8a8d('0x54')]({},_0x320c9b,_0x4e0769[_0x8a8d('0x55')]);var _0x5c2393={'where':_0x320c9b[_0x8a8d('0x51')]};return db[_0x8a8d('0x56')][_0x8a8d('0x33')](_0x5c2393)[_0x8a8d('0x23')](function(_0x3a8017){_0x2e8976[_0x8a8d('0x33')]=_0x3a8017;if(_0x4e0769[_0x8a8d('0x45')]['includeAll']){_0x320c9b[_0x8a8d('0x57')]=[{'all':!![]}];}return db[_0x8a8d('0x56')]['findAll'](_0x320c9b);})[_0x8a8d('0x23')](function(_0x7bcff6){_0x2e8976[_0x8a8d('0x58')]=_0x7bcff6;return _0x2e8976;})[_0x8a8d('0x23')](respondWithFilteredResult(_0x1385e9,_0x320c9b))['catch'](handleError(_0x1385e9,null));};exports[_0x8a8d('0x59')]=function(_0x10cb28,_0xf38189){var _0x454207={'raw':![],'where':{'id':_0x10cb28[_0x8a8d('0x5a')]['id']},'include':[{'model':db[_0x8a8d('0x3f')],'as':_0x8a8d('0x40')}]},_0xe26fb8={};_0xe26fb8[_0x8a8d('0x49')]=_[_0x8a8d('0x46')](db['SmsAccount'][_0x8a8d('0x5b')]);_0xe26fb8[_0x8a8d('0x45')]=_[_0x8a8d('0x46')](_0x10cb28['query']);_0xe26fb8['filters']=_['intersection'](_0xe26fb8[_0x8a8d('0x49')],_0xe26fb8[_0x8a8d('0x45')]);_0x454207[_0x8a8d('0x4a')]=_[_0x8a8d('0x48')](_0xe26fb8[_0x8a8d('0x49')],qs[_0x8a8d('0x4b')](_0x10cb28[_0x8a8d('0x45')][_0x8a8d('0x4b')]));_0x454207[_0x8a8d('0x4a')]=_0x454207['attributes'][_0x8a8d('0x4c')]?_0x454207[_0x8a8d('0x4a')]:_0xe26fb8[_0x8a8d('0x49')];if(_0x10cb28[_0x8a8d('0x45')][_0x8a8d('0x5c')]){_0x454207['include']=[{'all':!![]}];}_0x454207=_['merge']({},_0x454207,_0x10cb28['options']);return db[_0x8a8d('0x56')][_0x8a8d('0x5d')](_0x454207)[_0x8a8d('0x23')](handleEntityNotFound(_0xf38189,null))[_0x8a8d('0x23')](respondWithResult(_0xf38189,null))[_0x8a8d('0x5e')](handleError(_0xf38189,null));};exports[_0x8a8d('0x5f')]=function(_0x129328,_0x149d74){return db['SmsAccount'][_0x8a8d('0x5f')](_0x129328[_0x8a8d('0x60')],{})[_0x8a8d('0x23')](function(_0x34a887){var _0x43398a=_0x129328[_0x8a8d('0x61')]['get']({'plain':!![]});if(!_0x43398a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43398a[_0x8a8d('0x62')]===_0x8a8d('0x61')){var _0x31aeb6=_0x34a887[_0x8a8d('0x63')]({'plain':!![]});var _0x39f5dc=_0x8a8d('0x3a');return db[_0x8a8d('0x64')][_0x8a8d('0x5d')]({'where':{'name':_0x39f5dc,'userProfileId':_0x43398a[_0x8a8d('0x65')]},'raw':!![]})[_0x8a8d('0x23')](function(_0x5318b7){if(_0x5318b7&&_0x5318b7['autoAssociation']===0x0){return db[_0x8a8d('0x3b')][_0x8a8d('0x5f')]({'name':_0x31aeb6[_0x8a8d('0x3d')],'resourceId':_0x31aeb6['id'],'type':_0x5318b7[_0x8a8d('0x3d')],'sectionId':_0x5318b7['id']},{})[_0x8a8d('0x23')](function(){return _0x34a887;});}else{return _0x34a887;}})['catch'](function(_0x1a00ab){logger[_0x8a8d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a00ab);throw _0x1a00ab;});}return _0x34a887;})[_0x8a8d('0x23')](respondWithResult(_0x149d74,0xc9))[_0x8a8d('0x5e')](handleError(_0x149d74,null));};exports[_0x8a8d('0x38')]=function(_0x2b6ee5,_0x30811){if(_0x2b6ee5[_0x8a8d('0x60')]['id']){delete _0x2b6ee5[_0x8a8d('0x60')]['id'];}return db['SmsAccount'][_0x8a8d('0x5d')]({'where':{'id':_0x2b6ee5['params']['id']},'include':[{'model':db[_0x8a8d('0x3f')],'as':_0x8a8d('0x40')}]})['then'](handleEntityNotFound(_0x30811,null))[_0x8a8d('0x23')](saveUpdates(_0x2b6ee5[_0x8a8d('0x60')],null))[_0x8a8d('0x23')](respondWithResult(_0x30811,null))[_0x8a8d('0x5e')](handleError(_0x30811,null));};exports[_0x8a8d('0x39')]=function(_0x378125,_0x4aee3c){return db[_0x8a8d('0x56')]['find']({'where':{'id':_0x378125[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x4aee3c,null))[_0x8a8d('0x23')](removeEntity(_0x4aee3c,null))['catch'](handleError(_0x4aee3c,null));};exports[_0x8a8d('0x66')]=function(_0x3f045d,_0x46995f){return db[_0x8a8d('0x56')][_0x8a8d('0x66')]()[_0x8a8d('0x23')](respondWithResult(_0x46995f,null))[_0x8a8d('0x5e')](handleError(_0x46995f,null));};exports[_0x8a8d('0x67')]=function(_0x30662e,_0x2aeeea,_0x563787){if(_0x30662e['body']['id']){delete _0x30662e[_0x8a8d('0x60')]['id'];}return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x30662e[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x2aeeea,null))[_0x8a8d('0x23')](function(_0x3366d6){if(_0x3366d6){_0x30662e[_0x8a8d('0x60')]['SmsAccountId']=_0x3366d6['id'];return db[_0x8a8d('0x68')]['create'](_0x30662e[_0x8a8d('0x60')]);}})[_0x8a8d('0x23')](respondWithResult(_0x2aeeea,null))[_0x8a8d('0x5e')](handleError(_0x2aeeea,null));};exports[_0x8a8d('0x69')]=function(_0x146e03,_0x2d85bd,_0x570f22){var _0x234d14={'raw':![],'where':{}};var _0x561e5a={};var _0x45ee4f={'count':0x0,'rows':[]};return db[_0x8a8d('0x56')][_0x8a8d('0x6a')]({'where':{'id':_0x146e03['params']['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x2d85bd,null))['then'](function(_0x214a40){if(_0x214a40){_0x561e5a[_0x8a8d('0x49')]=_[_0x8a8d('0x46')](db[_0x8a8d('0x68')][_0x8a8d('0x5b')]);_0x561e5a['query']=_[_0x8a8d('0x46')](_0x146e03['query']);_0x561e5a['filters']=_['intersection'](_0x561e5a[_0x8a8d('0x49')],_0x561e5a[_0x8a8d('0x45')]);_0x234d14['attributes']=_[_0x8a8d('0x48')](_0x561e5a[_0x8a8d('0x49')],qs['fields'](_0x146e03[_0x8a8d('0x45')][_0x8a8d('0x4b')]));_0x234d14[_0x8a8d('0x4a')]=_0x234d14[_0x8a8d('0x4a')][_0x8a8d('0x4c')]?_0x234d14[_0x8a8d('0x4a')]:_0x561e5a[_0x8a8d('0x49')];if(!_0x146e03[_0x8a8d('0x45')][_0x8a8d('0x4d')]('nolimit')){_0x234d14[_0x8a8d('0x32')]=qs[_0x8a8d('0x32')](_0x146e03[_0x8a8d('0x45')][_0x8a8d('0x32')]);_0x234d14['offset']=qs[_0x8a8d('0x30')](_0x146e03[_0x8a8d('0x45')]['offset']);}_0x234d14[_0x8a8d('0x4f')]=qs[_0x8a8d('0x50')](_0x146e03['query'][_0x8a8d('0x50')]);_0x234d14['where']=qs[_0x8a8d('0x47')](_['pick'](_0x146e03[_0x8a8d('0x45')],_0x561e5a[_0x8a8d('0x47')]));_0x234d14[_0x8a8d('0x51')]['SmsAccountId']=_0x214a40['id'];if(_0x146e03['query'][_0x8a8d('0x53')]){_0x234d14[_0x8a8d('0x51')]=_[_0x8a8d('0x54')](_0x234d14[_0x8a8d('0x51')],{'$or':_[_0x8a8d('0x41')](_0x234d14[_0x8a8d('0x4a')],function(_0x30315c){var _0x390dfd={};_0x390dfd[_0x30315c]={'$like':'%'+_0x146e03[_0x8a8d('0x45')][_0x8a8d('0x53')]+'%'};return _0x390dfd;})});}_0x234d14=_['merge']({},_0x234d14,_0x146e03['options']);return db[_0x8a8d('0x68')]['count']({'where':_0x234d14['where']})[_0x8a8d('0x23')](function(_0x5c2f67){_0x45ee4f[_0x8a8d('0x33')]=_0x5c2f67;if(_0x146e03[_0x8a8d('0x45')][_0x8a8d('0x5c')]){_0x234d14[_0x8a8d('0x57')]=[{'all':!![]}];}return db[_0x8a8d('0x68')][_0x8a8d('0x6b')](_0x234d14);})[_0x8a8d('0x23')](function(_0x275b66){_0x45ee4f[_0x8a8d('0x58')]=_0x275b66;return _0x45ee4f;});}})[_0x8a8d('0x23')](respondWithFilteredResult(_0x2d85bd,_0x234d14))[_0x8a8d('0x5e')](handleError(_0x2d85bd,null));};exports[_0x8a8d('0x6c')]=function(_0x17a69c,_0x14eed4,_0x242bc8){return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x17a69c[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x14eed4,null))[_0x8a8d('0x23')](function(_0x11eac4){if(_0x11eac4){return _0x11eac4[_0x8a8d('0x6c')](_0x17a69c[_0x8a8d('0x45')][_0x8a8d('0x6d')]);}})[_0x8a8d('0x23')](respondWithStatusCode(_0x14eed4,null))['catch'](handleError(_0x14eed4,null));};exports[_0x8a8d('0x6e')]=function(_0x2f0246,_0x5eaf9b,_0x40c251){if(_0x2f0246[_0x8a8d('0x60')]['id']){delete _0x2f0246[_0x8a8d('0x60')]['id'];}return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x2f0246[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x5eaf9b,null))[_0x8a8d('0x23')](function(_0x447fc8){if(_0x447fc8){_0x2f0246[_0x8a8d('0x60')][_0x8a8d('0x6f')]=_0x447fc8['id'];return db['CannedAnswer']['create'](_0x2f0246[_0x8a8d('0x60')]);}})['then'](respondWithResult(_0x5eaf9b,null))[_0x8a8d('0x5e')](handleError(_0x5eaf9b,null));};exports[_0x8a8d('0x70')]=function(_0x277cec,_0x3705c1,_0x15b4d9){var _0x1b663c={'raw':![],'where':{}};var _0x4938fc={};var _0x53bc21={'count':0x0,'rows':[]};return db[_0x8a8d('0x56')][_0x8a8d('0x6a')]({'where':{'id':_0x277cec['params']['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x3705c1,null))['then'](function(_0x26aaf3){if(_0x26aaf3){_0x4938fc[_0x8a8d('0x49')]=_[_0x8a8d('0x46')](db[_0x8a8d('0x71')][_0x8a8d('0x5b')]);_0x4938fc[_0x8a8d('0x45')]=_[_0x8a8d('0x46')](_0x277cec[_0x8a8d('0x45')]);_0x4938fc[_0x8a8d('0x47')]=_[_0x8a8d('0x48')](_0x4938fc[_0x8a8d('0x49')],_0x4938fc[_0x8a8d('0x45')]);_0x1b663c['attributes']=_[_0x8a8d('0x48')](_0x4938fc[_0x8a8d('0x49')],qs[_0x8a8d('0x4b')](_0x277cec['query'][_0x8a8d('0x4b')]));_0x1b663c['attributes']=_0x1b663c[_0x8a8d('0x4a')][_0x8a8d('0x4c')]?_0x1b663c[_0x8a8d('0x4a')]:_0x4938fc['model'];if(!_0x277cec[_0x8a8d('0x45')]['hasOwnProperty'](_0x8a8d('0x4e'))){_0x1b663c[_0x8a8d('0x32')]=qs[_0x8a8d('0x32')](_0x277cec[_0x8a8d('0x45')]['limit']);_0x1b663c[_0x8a8d('0x30')]=qs[_0x8a8d('0x30')](_0x277cec['query']['offset']);}_0x1b663c['order']=qs[_0x8a8d('0x50')](_0x277cec[_0x8a8d('0x45')][_0x8a8d('0x50')]);_0x1b663c[_0x8a8d('0x51')]=qs[_0x8a8d('0x47')](_[_0x8a8d('0x52')](_0x277cec[_0x8a8d('0x45')],_0x4938fc[_0x8a8d('0x47')]));_0x1b663c[_0x8a8d('0x51')]['SmsAccountId']=_0x26aaf3['id'];if(_0x277cec[_0x8a8d('0x45')][_0x8a8d('0x53')]){_0x1b663c['where']=_[_0x8a8d('0x54')](_0x1b663c['where'],{'$or':_[_0x8a8d('0x41')](_0x1b663c[_0x8a8d('0x4a')],function(_0x3fe276){var _0x4fb454={};_0x4fb454[_0x3fe276]={'$like':'%'+_0x277cec[_0x8a8d('0x45')][_0x8a8d('0x53')]+'%'};return _0x4fb454;})});}_0x1b663c=_[_0x8a8d('0x54')]({},_0x1b663c,_0x277cec[_0x8a8d('0x55')]);return db['CannedAnswer'][_0x8a8d('0x33')]({'where':_0x1b663c['where']})[_0x8a8d('0x23')](function(_0x4f11dd){_0x53bc21[_0x8a8d('0x33')]=_0x4f11dd;if(_0x277cec['query'][_0x8a8d('0x5c')]){_0x1b663c[_0x8a8d('0x57')]=[{'all':!![]}];}return db[_0x8a8d('0x71')][_0x8a8d('0x6b')](_0x1b663c);})[_0x8a8d('0x23')](function(_0x388930){_0x53bc21[_0x8a8d('0x58')]=_0x388930;return _0x53bc21;});}})[_0x8a8d('0x23')](respondWithFilteredResult(_0x3705c1,_0x1b663c))[_0x8a8d('0x5e')](handleError(_0x3705c1,null));};exports[_0x8a8d('0x72')]=function(_0x311b2d,_0x2950c9,_0x170320){return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x311b2d[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x2950c9,null))['then'](function(_0x4d01ef){if(_0x4d01ef){return _0x4d01ef[_0x8a8d('0x72')](_0x311b2d[_0x8a8d('0x45')][_0x8a8d('0x6d')]);}})[_0x8a8d('0x23')](respondWithStatusCode(_0x2950c9,null))[_0x8a8d('0x5e')](handleError(_0x2950c9,null));};exports[_0x8a8d('0x73')]=function(_0x3b1202,_0x3b2a02,_0x56c448){var _0xf9e39c={'channel':_0x8a8d('0x74')};var _0x52c0a7=[];var _0x13997e=[];var _0x3817d5={};return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x3b1202[_0x8a8d('0x5a')]['id']},'include':[{'model':db[_0x8a8d('0x75')],'as':_0x8a8d('0x76')}]})[_0x8a8d('0x23')](handleEntityNotFound(_0x3b2a02,null))['then'](function(_0x396e81){_0xf9e39c[_0x8a8d('0x77')]=_0x396e81;_0xf9e39c[_0x8a8d('0x78')]=_[_0x8a8d('0x79')](_0x396e81[_0x8a8d('0x76')],[_0x8a8d('0x7a')],[_0x8a8d('0x7b')]);if(_0xf9e39c[_0x8a8d('0x77')]['Applications']){delete _0xf9e39c[_0x8a8d('0x77')]['Applications'];}return db[_0x8a8d('0x7c')][_0x8a8d('0x66')]();})[_0x8a8d('0x23')](function(_0x45d2a0){if(!_0x45d2a0){throw new db[(_0x8a8d('0x7d'))][(_0x8a8d('0x7e'))](_0x8a8d('0x7f'));}_0x52c0a7=_[_0x8a8d('0x80')](_[_0x8a8d('0x46')](_0x45d2a0),[_0x8a8d('0x81'),_0x8a8d('0x82')]);_0x13997e=_[_0x8a8d('0x80')](_[_0x8a8d('0x46')](_0x45d2a0),[_0x8a8d('0x81'),'updatedAt',_0x8a8d('0x83'),'ListId']);_0xf9e39c[_0x8a8d('0x60')]={'mapKey':_0x8a8d('0x84')};if(_0xf9e39c[_0x8a8d('0x77')]['type']){switch(_0xf9e39c[_0x8a8d('0x77')][_0x8a8d('0x43')]){case _0x8a8d('0x85'):_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x87')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202['body']['Body'];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')]['MessageSid'];break;case _0x8a8d('0x89'):_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')]='+'+_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x8a')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202['body']['text'];break;case _0x8a8d('0x8b'):_0xf9e39c[_0x8a8d('0x60')]['from']=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x86')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x2b')];break;case'clicksend':_0xf9e39c['body'][_0x8a8d('0x86')]=_0x3b1202['body'][_0x8a8d('0x86')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202['body'][_0x8a8d('0x60')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x8c')];break;case'plivo':_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x87')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202['body'][_0x8a8d('0x8d')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x8e')];break;case'infobip':_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')]='+'+_0x3b1202[_0x8a8d('0x60')]['results'][0x0][_0x8a8d('0x86')];_0xf9e39c[_0x8a8d('0x60')]['body']=_0x3b1202['body'][_0x8a8d('0x8f')][0x0][_0x8a8d('0x90')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')]['results'][0x0][_0x8a8d('0x88')];break;case _0x8a8d('0x91'):_0xf9e39c['body'][_0x8a8d('0x86')]=_0x3b1202['body'][_0x8a8d('0x92')];_0xf9e39c['body'][_0x8a8d('0x60')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x93')][_0x8a8d('0x2b')];break;case _0x8a8d('0x94'):_0xf9e39c['body'][_0x8a8d('0x86')]=_0x3b1202[_0x8a8d('0x60')]['fromNumber'];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202[_0x8a8d('0x60')]['text'];_0xf9e39c['body']['messageId']=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x95')];break;case _0x8a8d('0x96'):_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')][0x0]['message']['id'];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')]=_0x3b1202[_0x8a8d('0x60')][0x0][_0x8a8d('0x2b')][_0x8a8d('0x86')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]=_0x3b1202[_0x8a8d('0x60')][0x0]['message'][_0x8a8d('0x90')];break;case _0x8a8d('0x97'):_0xf9e39c['body'][_0x8a8d('0x86')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x86')];_0xf9e39c['body'][_0x8a8d('0x60')]=_0x3b1202['body'][_0x8a8d('0x2b')];_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x88')]=_0x3b1202[_0x8a8d('0x60')][_0x8a8d('0x98')];break;}}if(_0xf9e39c[_0x8a8d('0x60')]['id']){delete _0xf9e39c[_0x8a8d('0x60')]['id'];}if(_[_0x8a8d('0x99')](_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')])){throw new db[(_0x8a8d('0x7d'))][(_0x8a8d('0x7e'))](_0x8a8d('0x9a'));}if(_['isNil'](_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')])||_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xf9e39c['body']['mapKey'])){throw new db['Sequelize'][(_0x8a8d('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13997e);}if(!_['includes'](_0x13997e,_0xf9e39c[_0x8a8d('0x60')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x8a8d('0x9b')+_0x13997e);}_0x3817d5[_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x9c')]]=_0xf9e39c[_0x8a8d('0x60')]['from'];return db[_0x8a8d('0x9d')][_0x8a8d('0x5d')]({'where':{'id':_0xf9e39c[_0x8a8d('0x77')][_0x8a8d('0x9e')]},'include':[{'model':db[_0x8a8d('0x7c')],'as':_0x8a8d('0x9f'),'where':_0x3817d5,'limit':0x1,'order':[[_0x8a8d('0x82'),'DESC']]}]});})['then'](handleEntityNotFound(_0x3b2a02,null))['then'](function(_0x3d3542){if(_0x3d3542){_0xf9e39c[_0x8a8d('0xa0')]=_[_0x8a8d('0xa1')](_0x3d3542,[_0x8a8d('0x9f')]);if(_0x3d3542[_0x8a8d('0x9f')]['length']){return _0x3d3542[_0x8a8d('0x9f')][0x0];}var _0x2d0809=_[_0x8a8d('0xa2')](_0xf9e39c[_0x8a8d('0x60')],{'firstName':_0xf9e39c[_0x8a8d('0x60')]['from'],'ListId':_0x3d3542['id']});_0x2d0809[_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x9c')]]=_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')];return db[_0x8a8d('0x7c')]['create'](_0x2d0809,{'fields':_0x52c0a7,'raw':!![]});}})[_0x8a8d('0x23')](handleEntityNotFound(_0x3b2a02,null))[_0x8a8d('0x23')](function(_0x46d975){if(_0x46d975){_0xf9e39c[_0x8a8d('0xa3')]=_0x46d975;var _0x2b0c83={'ContactId':_0x46d975['id'],'phone':_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')],'SmsAccountId':_0x3b1202[_0x8a8d('0x5a')]['id']};var _0x12275e={'ContactId':_0x46d975['id'],'SmsAccountId':_0x3b1202[_0x8a8d('0x5a')]['id'],'closed':![]};return db[_0x8a8d('0xa4')]['find']({'where':_0x12275e})['then'](function(_0xac84ba){if(_0xac84ba){return[_0xac84ba,![]];}return db[_0x8a8d('0xa4')][_0x8a8d('0x5f')](_0x2b0c83)[_0x8a8d('0x23')](function(_0x1af805){return[_0x1af805,!![]];});});}})['spread'](function(_0x31b510,_0x5f4bed){_0xf9e39c[_0x8a8d('0xa5')]=_0x31b510['get']({'plain':!![]});_0xf9e39c[_0x8a8d('0xa5')][_0x8a8d('0xa6')]=![];if(_0x5f4bed){if(_0xf9e39c['account'][_0x8a8d('0xa7')]){_0xf9e39c['applications']['push']({'id':0x0,'priority':_0xf9e39c['applications'][_0x8a8d('0x4c')]+0x1,'app':_0x8a8d('0xa8'),'appdata':_0x8a8d('0xa9'),'interval':'*,*,*,*'});}_0xf9e39c[_0x8a8d('0xa5')][_0x8a8d('0xa6')]=!![];}return db[_0x8a8d('0xaa')][_0x8a8d('0x5f')]({'phone':_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x86')],'messageId':_0xf9e39c[_0x8a8d('0x60')]['messageId'],'body':_0xf9e39c[_0x8a8d('0x60')][_0x8a8d('0x60')],'SmsAccountId':_0x3b1202[_0x8a8d('0x5a')]['id'],'SmsInteractionId':_0x31b510['id'],'direction':'in','ContactId':_0x31b510[_0x8a8d('0xab')],'AttachmentId':_0xf9e39c[_0x8a8d('0x60')]['AttachmentId']});})[_0x8a8d('0x23')](function(_0x421004){_0xf9e39c[_0x8a8d('0x2b')]=_0x421004;if(_0xf9e39c['interaction'][_0x8a8d('0xac')]){return db['User']['find']({'attributes':['id',_0x8a8d('0x3d')],'where':{'id':_0xf9e39c[_0x8a8d('0xa5')][_0x8a8d('0xac')]}})[_0x8a8d('0x23')](function(_0x211c9b){if(_0x211c9b){_0xf9e39c[_0x8a8d('0x78')][_0x8a8d('0xad')]({'id':0x0,'priority':0x0,'app':_0x8a8d('0xae'),'appdata':_0x211c9b[_0x8a8d('0x3d')]+','+(_0xf9e39c['account'][_0x8a8d('0xaf')]||0xa),'interval':_0x8a8d('0xb0')});}return respondWithRpcPromise(_0x8a8d('0xb1'),'startRouting',_0xf9e39c);});}return respondWithRpcPromise(_0x8a8d('0xb1'),'startRouting',_0xf9e39c);})['then'](function(_0x637905){if(_0x637905){var _0x1f1da3=0xc8;var _0x2d70bd='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d70bd,_0x1f1da3,_0x8a8d('0xb2'));logger[_0x8a8d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2d70bd,_0x1f1da3,_0x8a8d('0xb2'),JSON[_0x8a8d('0x28')](_0x637905));if(_0xf9e39c[_0x8a8d('0x77')][_0x8a8d('0x43')]===_0x8a8d('0x85')){return _0x3b2a02['status'](_0x1f1da3)[_0x8a8d('0x34')]('Content-Type',_0x8a8d('0xb3'))[_0x8a8d('0xb4')](_0x8a8d('0xb5'));}else{return _0x3b2a02[_0x8a8d('0x2e')](_0x1f1da3)[_0x8a8d('0x2f')](_0x637905);}}})[_0x8a8d('0x5e')](handleError(_0x3b2a02,null));};exports[_0x8a8d('0xb6')]=function(_0x5a7e75,_0xe9a8cc,_0x5af7ab){return db['SmsAccount'][_0x8a8d('0x6a')]({'where':{'id':_0x5a7e75[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0xe9a8cc,null))[_0x8a8d('0x23')](function(_0x4cdb37){if(_0x4cdb37){return db[_0x8a8d('0xb7')][_0x8a8d('0xb8')](function(_0xe677db){return db[_0x8a8d('0x75')][_0x8a8d('0x39')]({'where':{'SmsAccountId':_0x5a7e75[_0x8a8d('0x5a')]['id']},'transaction':_0xe677db})[_0x8a8d('0x23')](function(_0x38ca8b){var _0x194bd6=_[_0x8a8d('0x41')](_0x5a7e75[_0x8a8d('0x60')],function(_0x419057){_0x419057[_0x8a8d('0x6f')]=_0x5a7e75[_0x8a8d('0x5a')]['id'];return _0x419057;});return db[_0x8a8d('0x75')]['bulkCreate'](_0x194bd6,{'transaction':_0xe677db});});})[_0x8a8d('0x23')](function(){return db[_0x8a8d('0x75')][_0x8a8d('0xb9')]({'where':{'SmsAccountId':_0x5a7e75[_0x8a8d('0x5a')]['id']},'order':_0x8a8d('0x7a')});});}})[_0x8a8d('0x23')](respondWithResult(_0xe9a8cc,null))[_0x8a8d('0x5e')](handleError(_0xe9a8cc,null));};exports[_0x8a8d('0xba')]=function(_0x48d3b6,_0xa3cf3a,_0x1c6dc3){var _0x36108d={};var _0x15acff={};var _0x5371a2;var _0x4bc66a;return db[_0x8a8d('0x56')][_0x8a8d('0x6a')]({'where':{'id':_0x48d3b6[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0xa3cf3a,null))[_0x8a8d('0x23')](function(_0x7c1c1b){if(_0x7c1c1b){_0x5371a2=_0x7c1c1b;_0x15acff['model']=_['keys'](db[_0x8a8d('0x75')][_0x8a8d('0x5b')]);_0x15acff[_0x8a8d('0x45')]=_['keys'](_0x48d3b6[_0x8a8d('0x45')]);_0x15acff[_0x8a8d('0x47')]=_[_0x8a8d('0x48')](_0x15acff['model'],_0x15acff[_0x8a8d('0x45')]);_0x36108d[_0x8a8d('0x4a')]=_['intersection'](_0x15acff[_0x8a8d('0x49')],qs[_0x8a8d('0x4b')](_0x48d3b6[_0x8a8d('0x45')][_0x8a8d('0x4b')]));_0x36108d[_0x8a8d('0x4a')]=_0x36108d[_0x8a8d('0x4a')][_0x8a8d('0x4c')]?_0x36108d[_0x8a8d('0x4a')]:_0x15acff[_0x8a8d('0x49')];_0x36108d[_0x8a8d('0x4f')]=qs[_0x8a8d('0x50')](_0x48d3b6[_0x8a8d('0x45')][_0x8a8d('0x50')]);_0x36108d[_0x8a8d('0x51')]=qs[_0x8a8d('0x47')](_['pick'](_0x48d3b6[_0x8a8d('0x45')],_0x15acff[_0x8a8d('0x47')]));if(_0x48d3b6['query'][_0x8a8d('0x53')]){_0x36108d[_0x8a8d('0x51')]=_[_0x8a8d('0x54')](_0x36108d[_0x8a8d('0x51')],{'$or':_['map'](_0x36108d[_0x8a8d('0x4a')],function(_0x3b9e2a){var _0x5e1047={};_0x5e1047[_0x3b9e2a]={'$like':'%'+_0x48d3b6[_0x8a8d('0x45')][_0x8a8d('0x53')]+'%'};return _0x5e1047;})});}_0x36108d=_[_0x8a8d('0x54')]({},_0x36108d,_0x48d3b6[_0x8a8d('0x55')]);return _0x5371a2[_0x8a8d('0xba')](_0x36108d);}})[_0x8a8d('0x23')](function(_0x2b11ee){if(_0x2b11ee){_0x4bc66a=_0x2b11ee[_0x8a8d('0x4c')];if(!_0x48d3b6['query'][_0x8a8d('0x4d')](_0x8a8d('0x4e'))){_0x36108d[_0x8a8d('0x32')]=qs[_0x8a8d('0x32')](_0x48d3b6['query'][_0x8a8d('0x32')]);_0x36108d[_0x8a8d('0x30')]=qs[_0x8a8d('0x30')](_0x48d3b6[_0x8a8d('0x45')][_0x8a8d('0x30')]);}return _0x5371a2[_0x8a8d('0xba')](_0x36108d);}})[_0x8a8d('0x23')](function(_0x36a68b){if(_0x36a68b){return _0x36a68b?{'count':_0x4bc66a,'rows':_0x36a68b}:null;}})[_0x8a8d('0x23')](respondWithResult(_0xa3cf3a,null))[_0x8a8d('0x5e')](handleError(_0xa3cf3a,null));};exports[_0x8a8d('0xbb')]=function(_0x26b257,_0x42ad7d,_0x21c28a){var _0x366a18={'raw':![],'where':{}};var _0x16445d={};var _0xbc59a4={'count':0x0,'rows':[]};return db[_0x8a8d('0x56')][_0x8a8d('0x6a')]({'where':{'id':_0x26b257[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x42ad7d,null))[_0x8a8d('0x23')](function(_0x228083){if(_0x228083){_0x16445d['model']=_[_0x8a8d('0x46')](db[_0x8a8d('0xa4')]['rawAttributes']);_0x16445d[_0x8a8d('0x45')]=_[_0x8a8d('0x46')](_0x26b257[_0x8a8d('0x45')]);_0x16445d[_0x8a8d('0x47')]=_['intersection'](_0x16445d['model'],_0x16445d[_0x8a8d('0x45')]);_0x366a18['attributes']=_[_0x8a8d('0x48')](_0x16445d[_0x8a8d('0x49')],qs[_0x8a8d('0x4b')](_0x26b257['query'][_0x8a8d('0x4b')]));_0x366a18[_0x8a8d('0x4a')]=_0x366a18[_0x8a8d('0x4a')][_0x8a8d('0x4c')]?_0x366a18[_0x8a8d('0x4a')]:_0x16445d[_0x8a8d('0x49')];if(!_0x26b257[_0x8a8d('0x45')][_0x8a8d('0x4d')]('nolimit')){_0x366a18[_0x8a8d('0x32')]=qs[_0x8a8d('0x32')](_0x26b257[_0x8a8d('0x45')][_0x8a8d('0x32')]);_0x366a18[_0x8a8d('0x30')]=qs[_0x8a8d('0x30')](_0x26b257[_0x8a8d('0x45')][_0x8a8d('0x30')]);}_0x366a18[_0x8a8d('0x4f')]=qs[_0x8a8d('0x50')](_0x26b257[_0x8a8d('0x45')][_0x8a8d('0x50')]);_0x366a18['where']=qs[_0x8a8d('0x47')](_[_0x8a8d('0x52')](_0x26b257[_0x8a8d('0x45')],_0x16445d['filters']));_0x366a18['where'][_0x8a8d('0x6f')]=_0x228083['id'];if(_0x26b257['query'][_0x8a8d('0x53')]){_0x366a18[_0x8a8d('0x51')]=_[_0x8a8d('0x54')](_0x366a18[_0x8a8d('0x51')],{'$or':_['map'](_0x366a18[_0x8a8d('0x4a')],function(_0x3742d9){var _0x1e1950={};_0x1e1950[_0x3742d9]={'$like':'%'+_0x26b257[_0x8a8d('0x45')][_0x8a8d('0x53')]+'%'};return _0x1e1950;})});}_0x366a18=_[_0x8a8d('0x54')]({},_0x366a18,_0x26b257[_0x8a8d('0x55')]);return db[_0x8a8d('0xa4')][_0x8a8d('0x33')]({'where':_0x366a18[_0x8a8d('0x51')]})['then'](function(_0x5aa625){_0xbc59a4[_0x8a8d('0x33')]=_0x5aa625;if(_0x26b257['query']['includeAll']){_0x366a18[_0x8a8d('0x57')]=[{'model':db[_0x8a8d('0x7c')],'as':'Contact','required':![]},{'model':db[_0x8a8d('0xbc')],'as':'Owner','attributes':[_0x8a8d('0x3d'),_0x8a8d('0xbd'),'internal'],'required':![]},{'model':db[_0x8a8d('0xbe')],'as':_0x8a8d('0xbf'),'attributes':['id',_0x8a8d('0x3d'),_0x8a8d('0xc0')],'where':_0x26b257[_0x8a8d('0x45')][_0x8a8d('0xc1')]?{'id':_0x26b257[_0x8a8d('0x45')][_0x8a8d('0xc1')]}:undefined,'required':_0x26b257[_0x8a8d('0x45')][_0x8a8d('0xc1')]?!![]:![]}];}return db[_0x8a8d('0xa4')][_0x8a8d('0x6b')](_0x366a18);})[_0x8a8d('0x23')](function(_0x9d46a9){_0xbc59a4[_0x8a8d('0x58')]=_0x9d46a9;return _0xbc59a4;});}})[_0x8a8d('0x23')](respondWithFilteredResult(_0x42ad7d,_0x366a18))['catch'](handleError(_0x42ad7d,null));};exports[_0x8a8d('0xb4')]=function(_0xdee389,_0xb5dd67,_0x57a3f7){var _0x43e6d8,_0x1fbc58,_0x23cef0;if(_['isNil'](_0xdee389['body'][_0x8a8d('0x60')])||_0xdee389[_0x8a8d('0x60')][_0x8a8d('0x60')]===''){throw new db['Sequelize'][(_0x8a8d('0x7e'))](_0x8a8d('0xc2'));}if(_[_0x8a8d('0x99')](_0xdee389[_0x8a8d('0x60')]['to'])){throw new db[(_0x8a8d('0x7d'))][(_0x8a8d('0x7e'))](_0x8a8d('0xc3'));}_0x43e6d8=_0xdee389['body']['to'];return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0xdee389[_0x8a8d('0x5a')]['id']},'include':[{'model':db[_0x8a8d('0x9d')],'as':_0x8a8d('0xc4'),'include':[{'model':db[_0x8a8d('0x7c')],'as':_0x8a8d('0x9f'),'where':{'mobile':_0x43e6d8},'limit':0x1,'order':[[_0x8a8d('0x82'),_0x8a8d('0xc5')]]}]}]})['then'](handleEntityNotFound(_0xb5dd67,null))['then'](function(_0xdbdc59){if(_0xdbdc59&&_0xdbdc59[_0x8a8d('0xc4')]){_0x1fbc58=_0xdbdc59[_0x8a8d('0x63')]({'plain':!![]});if(_0x1fbc58[_0x8a8d('0xc4')]&&_0x1fbc58[_0x8a8d('0xc4')][_0x8a8d('0x9f')][_0x8a8d('0x4c')]){return _0x1fbc58[_0x8a8d('0xc4')][_0x8a8d('0x9f')][0x0];}return db[_0x8a8d('0x7c')][_0x8a8d('0x5f')](_[_0x8a8d('0xa2')](_0xdee389[_0x8a8d('0x60')],{'firstName':_0x43e6d8,'mobile':_0x43e6d8,'phone':_0x43e6d8,'ListId':_0x1fbc58[_0x8a8d('0x9e')]}));}})['then'](handleEntityNotFound(_0xb5dd67,null))[_0x8a8d('0x23')](function(_0x5f1ed1){if(_0x5f1ed1){_0x23cef0=_0x5f1ed1;return db[_0x8a8d('0xa4')]['find']({'where':{'ContactId':_0x23cef0['id'],'closed':![],'SmsAccountId':_0x1fbc58['id']}})['then'](function(_0x1ba2f9){if(_0x1ba2f9){return[_0x1ba2f9,![]];}return db[_0x8a8d('0xa4')][_0x8a8d('0x5f')]({'UserId':_0xdee389[_0x8a8d('0x61')]['id'],'ContactId':_0x23cef0['id'],'SmsAccountId':_0x1fbc58['id'],'phone':_0x43e6d8,'firstMsgDirection':'out','Messages':[_[_0x8a8d('0x54')](_0xdee389[_0x8a8d('0x60')],{'read':![],'body':_0xdee389[_0x8a8d('0x60')][_0x8a8d('0x60')],'phone':_0x43e6d8,'SmsAccountId':_0x1fbc58['id'],'UserId':_0xdee389[_0x8a8d('0x61')]['id'],'ContactId':_0x23cef0['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x8a8d('0xc6')}]})[_0x8a8d('0x23')](function(_0x51f19c){return[_0x51f19c,!![]];});});}})[_0x8a8d('0xc7')](function(_0x239ef1,_0x1a1726){if(_0x1a1726){return _0x239ef1;}return db['SmsMessage']['create'](_['merge'](_0xdee389[_0x8a8d('0x60')],{'read':![],'body':_0xdee389[_0x8a8d('0x60')]['body'],'phone':_0x43e6d8,'SmsAccountId':_0x1fbc58['id'],'SmsInteractionId':_0x239ef1['id'],'UserId':_0xdee389['user']['id'],'ContactId':_0x23cef0['id']}))['then'](function(_0x1940a7){_0x239ef1[_0x8a8d('0xc8')]['Messages']=[];_0x239ef1[_0x8a8d('0xc8')][_0x8a8d('0xc6')]['push'](_0x1940a7[_0x8a8d('0xc8')]);return _0x239ef1;});})['then'](respondWithResult(_0xb5dd67,null))[_0x8a8d('0x5e')](handleError(_0xb5dd67,null));};exports[_0x8a8d('0x2e')]=function(_0x5a0830,_0x220092,_0x131999){if(_0x5a0830[_0x8a8d('0x60')]['id']){delete _0x5a0830[_0x8a8d('0x60')]['id'];}var _0x556bf1,_0x360bae,_0x379b61;return db[_0x8a8d('0x56')][_0x8a8d('0x5d')]({'where':{'id':_0x5a0830[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x220092,null))[_0x8a8d('0x23')](function(_0x1dbab8){if(_0x1dbab8){_0x379b61=_0x1dbab8;logger['debug'](_0x8a8d('0x27'),'status',_0x8a8d('0xc9'),_0x1dbab8['type'],util[_0x8a8d('0xca')](_0x5a0830[_0x8a8d('0x60')],{'showHidden':![],'depth':null}));switch(_0x1dbab8[_0x8a8d('0x43')]){case _0x8a8d('0x89'):if(_0x5a0830[_0x8a8d('0x60')]['skebby_dispatch_id']&&_0x5a0830[_0x8a8d('0x60')]['status']){_0x360bae=_0x5a0830[_0x8a8d('0x60')]['status'];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x5a0830[_0x8a8d('0x60')]['skebby_dispatch_id']}});}break;case _0x8a8d('0x8b'):if(_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0xcb')]&&_0x5a0830['body'][_0x8a8d('0xcc')]){_0x360bae=_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0xcc')];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x5a0830['body'][_0x8a8d('0xcb')]}});}break;case'clicksend':if(_0x5a0830['body'][_0x8a8d('0x8c')]&&_0x5a0830['body']['status_code']){_0x360bae=_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0xcd')];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0x8c')]}});}break;case _0x8a8d('0xce'):var _0x233f14=_0x5a0830[_0x8a8d('0x60')]['results'][0x0];if(_0x233f14[_0x8a8d('0x88')]&&_0x233f14[_0x8a8d('0x2e')][_0x8a8d('0xcf')]===_0x8a8d('0xd0')){_0x360bae=_0x233f14[_0x8a8d('0x2e')]['groupName'];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x233f14['messageId']}});}break;case _0x8a8d('0x94'):if(_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0x88')]&&_0x5a0830[_0x8a8d('0x60')]['status']){_0x360bae=_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0x2e')];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x5a0830[_0x8a8d('0x60')]['messageId']}});}break;case _0x8a8d('0x96'):if(_0x5a0830[_0x8a8d('0x60')][0x0][_0x8a8d('0x2b')]['id']){_0x360bae=_0x5a0830['body'][0x0][_0x8a8d('0x43')];return db[_0x8a8d('0xaa')]['find']({'where':{'messageId':_0x5a0830[_0x8a8d('0x60')][0x0][_0x8a8d('0x2b')]['id']}});}break;case _0x8a8d('0x97'):if(_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0xd1')]&&_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0x2e')]){_0x360bae=_0x5a0830['body'][_0x8a8d('0x2e')];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0xd1')]}});}break;}}})[_0x8a8d('0x23')](handleEntityNotFound(_0x220092,null))['then'](function(_0x40f16a){if(_0x40f16a){_0x556bf1=_0x40f16a;switch(_0x379b61[_0x8a8d('0x43')]){case _0x8a8d('0x89'):if(_0x360bae===_0x8a8d('0xd0')){return _0x556bf1['update']({'read':!![]});}else{logger[_0x8a8d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a8d('0x2e'),'skebby',util[_0x8a8d('0xca')](_0x5a0830['body'],{'showHidden':![],'depth':null}));}break;case _0x8a8d('0x8b'):if(_0x360bae==='1'){return _0x556bf1[_0x8a8d('0x38')]({'read':!![]});}else{logger[_0x8a8d('0x29')](_0x8a8d('0x27'),_0x8a8d('0x2e'),_0x8a8d('0x89'),util[_0x8a8d('0xca')](_0x5a0830[_0x8a8d('0x60')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5a0830[_0x8a8d('0x60')]['error_code']&&_0x360bae>=0xc8&&_0x360bae<=0xce){return _0x556bf1['update']({'read':!![]});}else{logger[_0x8a8d('0x29')](_0x8a8d('0x27'),_0x8a8d('0x2e'),_0x8a8d('0xd2'),util[_0x8a8d('0xca')](_0x5a0830['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2085a1=_0x5a0830[_0x8a8d('0x60')][_0x8a8d('0x8f')][0x0];if(_0x2085a1['status']['groupName']===_0x8a8d('0xd0')){return _0x556bf1['update']({'read':!![]});}else{logger['error'](_0x8a8d('0x27'),_0x8a8d('0x2e'),'infobip',util['inspect'](_0x5a0830[_0x8a8d('0x60')],{'showHidden':![],'depth':null}));}break;case _0x8a8d('0x94'):if(_0x360bae==_0x8a8d('0xd3')||_0x360bae=='RECEIVED_BY_RECIPIENT'){return _0x556bf1[_0x8a8d('0x38')]({'read':!![]});}else{logger[_0x8a8d('0x29')](_0x8a8d('0x27'),_0x8a8d('0x2e'),_0x8a8d('0x94'),util[_0x8a8d('0xca')](_0x5a0830[_0x8a8d('0x60')],{'showHidden':![],'depth':null}));}break;case _0x8a8d('0x96'):if(_0x360bae==_0x8a8d('0xd4')){return _0x556bf1[_0x8a8d('0x38')]({'read':!![]});}else{logger[_0x8a8d('0x29')](_0x8a8d('0x27'),_0x8a8d('0x2e'),_0x8a8d('0x96'),util['inspect'](_0x5a0830[_0x8a8d('0x60')],{'showHidden':![],'depth':null}));}break;case _0x8a8d('0x97'):if(_0x360bae===_0x8a8d('0xd5')||_0x360bae===_0x8a8d('0xd6')){return _0x556bf1['update']({'read':!![]});}else{logger[_0x8a8d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a8d('0x2e'),_0x8a8d('0x97'),util[_0x8a8d('0xca')](_0x5a0830['body'],{'showHidden':![],'depth':null}));}break;}return _0x556bf1;}})[_0x8a8d('0x23')](respondWithResult(_0x220092,null))[_0x8a8d('0x5e')](handleError(_0x220092,null));};exports[_0x8a8d('0xd7')]=function(_0x28512f,_0x443d8d,_0xbcd9e2){var _0x253ca2,_0x226f36,_0x55f49b;return db['SmsAccount']['find']({'where':{'id':_0x28512f['params']['id']}})['then'](handleEntityNotFound(_0x443d8d,null))[_0x8a8d('0x23')](function(_0x1a7253){if(_0x1a7253){_0x55f49b=_0x1a7253;logger['debug'](_0x8a8d('0x27'),'status',_0x8a8d('0xc9'),_0x1a7253['type'],util[_0x8a8d('0xca')](_0x28512f['query'],{'showHidden':![],'depth':null}));switch(_0x1a7253[_0x8a8d('0x43')]){case _0x8a8d('0x91'):if(_0x28512f['query'][_0x8a8d('0xd8')]&&_0x28512f[_0x8a8d('0x45')]['state']){_0x226f36=_0x28512f[_0x8a8d('0x45')][_0x8a8d('0xd9')];return db[_0x8a8d('0xaa')][_0x8a8d('0x5d')]({'where':{'messageId':_0x28512f[_0x8a8d('0x45')][_0x8a8d('0xd8')]}});}break;}}})[_0x8a8d('0x23')](handleEntityNotFound(_0x443d8d,null))[_0x8a8d('0x23')](function(_0xf4e2a2){if(_0xf4e2a2){_0x253ca2=_0xf4e2a2;switch(_0x55f49b[_0x8a8d('0x43')]){case _0x8a8d('0x91'):if(_0x226f36==='2'||_0x226f36==='6'){return _0x253ca2[_0x8a8d('0x38')]({'read':!![]});}else{logger[_0x8a8d('0x29')](_0x8a8d('0x27'),_0x8a8d('0x2e'),_0x8a8d('0x91'),util[_0x8a8d('0xca')](_0x28512f[_0x8a8d('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x253ca2;}})['then'](respondWithResult(_0x443d8d,null))[_0x8a8d('0x5e')](handleError(_0x443d8d,null));};exports['addAgents']=function(_0x3e6c1a,_0x4ac397,_0x1e86ef){return db[_0x8a8d('0x56')]['find']({'where':{'id':_0x3e6c1a[_0x8a8d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ac397,null))['then'](function(_0x1adcf1){if(_0x1adcf1){return _0x1adcf1[_0x8a8d('0xda')](_0x3e6c1a['body'][_0x8a8d('0x6d')],_[_0x8a8d('0xa1')](_0x3e6c1a['body'],[_0x8a8d('0x6d'),'id'])||{})[_0x8a8d('0xc7')](function(_0x1e5e12){for(var _0x340172=0x0;_0x340172<_0x3e6c1a[_0x8a8d('0x60')]['ids'][_0x8a8d('0x4c')];_0x340172+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x3e6c1a[_0x8a8d('0x60')][_0x8a8d('0x6d')][_0x340172]),'SmsAccountId':Number(_0x3e6c1a['params']['id'])});}return _0x1e5e12;});}})[_0x8a8d('0x23')](respondWithResult(_0x4ac397,null))['catch'](handleError(_0x4ac397,null));};exports[_0x8a8d('0xdb')]=function(_0xd4dc84,_0x46d87f,_0x25b99c){return db[_0x8a8d('0x56')]['find']({'where':{'id':_0xd4dc84[_0x8a8d('0x5a')]['id']}})[_0x8a8d('0x23')](handleEntityNotFound(_0x46d87f,null))[_0x8a8d('0x23')](function(_0x152ab9){if(_0x152ab9){return _0x152ab9[_0x8a8d('0xdb')](_0xd4dc84[_0x8a8d('0x45')]['ids'])[_0x8a8d('0x23')](function(){if(_[_0x8a8d('0xdc')](_0xd4dc84[_0x8a8d('0x45')][_0x8a8d('0x6d')])){for(var _0x46d02e=0x0;_0x46d02e<_0xd4dc84['query'][_0x8a8d('0x6d')][_0x8a8d('0x4c')];_0x46d02e+=0x1){socket[_0x8a8d('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0xd4dc84[_0x8a8d('0x45')][_0x8a8d('0x6d')][_0x46d02e]),'SmsAccountId':Number(_0xd4dc84[_0x8a8d('0x5a')]['id'])});}}else{socket[_0x8a8d('0xdd')](_0x8a8d('0xde'),{'UserId':Number(_0xd4dc84[_0x8a8d('0x45')]['ids']),'SmsAccountId':Number(_0xd4dc84[_0x8a8d('0x5a')]['id'])});}});}})[_0x8a8d('0x23')](respondWithStatusCode(_0x46d87f,null))['catch'](handleError(_0x46d87f,null));};exports[_0x8a8d('0xdf')]=function(_0x5c717b,_0x338f21,_0x37ae01){var _0x526777={};var _0x2a3f4e={};var _0x223de7;var _0xdd9609;return db[_0x8a8d('0x56')][_0x8a8d('0x6a')]({'where':{'id':_0x5c717b[_0x8a8d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x338f21,null))['then'](function(_0x539f82){if(_0x539f82){_0x223de7=_0x539f82;_0x2a3f4e['model']=_[_0x8a8d('0x46')](db['User']['rawAttributes']);_0x2a3f4e[_0x8a8d('0x45')]=_[_0x8a8d('0x46')](_0x5c717b[_0x8a8d('0x45')]);_0x2a3f4e[_0x8a8d('0x47')]=_[_0x8a8d('0x48')](_0x2a3f4e[_0x8a8d('0x49')],_0x2a3f4e['query']);_0x526777[_0x8a8d('0x4a')]=_[_0x8a8d('0x48')](_0x2a3f4e[_0x8a8d('0x49')],qs['fields'](_0x5c717b[_0x8a8d('0x45')]['fields']));_0x526777[_0x8a8d('0x4a')]=_0x526777['attributes'][_0x8a8d('0x4c')]?_0x526777[_0x8a8d('0x4a')]:_0x2a3f4e[_0x8a8d('0x49')];_0x526777[_0x8a8d('0x4f')]=qs['sort'](_0x5c717b[_0x8a8d('0x45')][_0x8a8d('0x50')]);_0x526777[_0x8a8d('0x51')]=qs['filters'](_[_0x8a8d('0x52')](_0x5c717b['query'],_0x2a3f4e['filters']));if(_0x5c717b[_0x8a8d('0x45')][_0x8a8d('0x53')]){_0x526777['where']=_['merge'](_0x526777['where'],{'$or':_['map'](_0x526777[_0x8a8d('0x4a')],function(_0x38bbe6){var _0x487f85={};_0x487f85[_0x38bbe6]={'$like':'%'+_0x5c717b['query'][_0x8a8d('0x53')]+'%'};return _0x487f85;})});}_0x526777=_[_0x8a8d('0x54')]({},_0x526777,_0x5c717b[_0x8a8d('0x55')]);return _0x223de7[_0x8a8d('0xdf')](_0x526777);}})['then'](function(_0x2b8b04){if(_0x2b8b04){_0xdd9609=_0x2b8b04[_0x8a8d('0x4c')];if(!_0x5c717b[_0x8a8d('0x45')][_0x8a8d('0x4d')]('nolimit')){_0x526777[_0x8a8d('0x32')]=qs[_0x8a8d('0x32')](_0x5c717b['query'][_0x8a8d('0x32')]);_0x526777['offset']=qs['offset'](_0x5c717b[_0x8a8d('0x45')][_0x8a8d('0x30')]);}return _0x223de7[_0x8a8d('0xdf')](_0x526777);}})[_0x8a8d('0x23')](function(_0x1b6eec){if(_0x1b6eec){return _0x1b6eec?{'count':_0xdd9609,'rows':_0x1b6eec}:null;}})['then'](respondWithResult(_0x338f21,null))['catch'](handleError(_0x338f21,null));}; \ No newline at end of file +var _0x2bfc=['userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','stack','name','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsAccount','includeAll','show','params','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','include','findAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','applications','Applications','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','close','*,*,*,*','SmsMessage','ContactId','User','UserId','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','priority','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','results','DELIVERED','redif','groupName','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','emit'];(function(_0x3b3a20,_0x23aefc){var _0x4daacf=function(_0x319afa){while(--_0x319afa){_0x3b3a20['push'](_0x3b3a20['shift']());}};_0x4daacf(++_0x23aefc);}(_0x2bfc,0x1be));var _0xc2bf=function(_0x274d4b,_0x128681){_0x274d4b=_0x274d4b-0x0;var _0x1a1f03=_0x2bfc[_0x274d4b];return _0x1a1f03;};'use strict';var emlformat=require(_0xc2bf('0x0'));var rimraf=require(_0xc2bf('0x1'));var zipdir=require(_0xc2bf('0x2'));var jsonpatch=require(_0xc2bf('0x3'));var rp=require('request-promise');var moment=require(_0xc2bf('0x4'));var BPromise=require(_0xc2bf('0x5'));var Mustache=require(_0xc2bf('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc2bf('0x7'));var csv=require(_0xc2bf('0x8'));var ejs=require(_0xc2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xc2bf('0xa'));var _=require(_0xc2bf('0xb'));var squel=require(_0xc2bf('0xc'));var crypto=require('crypto');var jsforce=require(_0xc2bf('0xd'));var deskjs=require(_0xc2bf('0xe'));var toCsv=require(_0xc2bf('0x8'));var querystring=require(_0xc2bf('0xf'));var Papa=require(_0xc2bf('0x10'));var Redis=require(_0xc2bf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc2bf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2bf('0x13'))(_0xc2bf('0x14'));var utils=require(_0xc2bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc2bf('0x16'));var db=require('../../mysqldb')['db'];config[_0xc2bf('0x17')]=_[_0xc2bf('0x18')](config[_0xc2bf('0x17')],{'host':_0xc2bf('0x19'),'port':0x18eb});var socket=require(_0xc2bf('0x1a'))(new Redis(config[_0xc2bf('0x17')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xc2bf('0x1b'));var client=jayson[_0xc2bf('0x1c')][_0xc2bf('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x27c9e6,_0x55e3c1,_0x5069d2,_0x4b8a65){return new BPromise(function(_0x1277b6,_0x3e99c6){var _0x2dba6e=_0x4b8a65||client;return _0x2dba6e[_0xc2bf('0x1e')](_0x27c9e6,_0x5069d2)[_0xc2bf('0x1f')](function(_0xf1a550){logger[_0xc2bf('0x20')](_0xc2bf('0x21'),_0x55e3c1,_0xc2bf('0x22'));logger[_0xc2bf('0x23')](_0xc2bf('0x24'),_0x55e3c1,_0xc2bf('0x22'),JSON['stringify'](_0xf1a550));if(_0xf1a550[_0xc2bf('0x25')]){if(_0xf1a550[_0xc2bf('0x25')][_0xc2bf('0x26')]===0x1f4){logger[_0xc2bf('0x25')](_0xc2bf('0x21'),_0x55e3c1,_0xf1a550[_0xc2bf('0x25')]['message']);return _0x3e99c6(_0xf1a550['error'][_0xc2bf('0x27')]);}logger[_0xc2bf('0x25')]('SmsAccount,\x20%s,\x20%s',_0x55e3c1,_0xf1a550['error'][_0xc2bf('0x27')]);return _0x1277b6(_0xf1a550[_0xc2bf('0x25')][_0xc2bf('0x27')]);}else{logger[_0xc2bf('0x20')](_0xc2bf('0x21'),_0x55e3c1,_0xc2bf('0x22'));_0x1277b6(_0xf1a550['result'][_0xc2bf('0x27')]);}})[_0xc2bf('0x28')](function(_0x49e68c){logger[_0xc2bf('0x25')](_0xc2bf('0x21'),_0x55e3c1,_0x49e68c);_0x3e99c6(_0x49e68c);});});}function respondWithStatusCode(_0x57f523,_0xb9ebcd){_0xb9ebcd=_0xb9ebcd||0xcc;return function(_0x53b564){if(_0x53b564){return _0x57f523[_0xc2bf('0x29')](_0xb9ebcd);}return _0x57f523[_0xc2bf('0x2a')](_0xb9ebcd)[_0xc2bf('0x2b')]();};}function respondWithResult(_0x461d7c,_0x4aa892){_0x4aa892=_0x4aa892||0xc8;return function(_0x1b7012){if(_0x1b7012){return _0x461d7c[_0xc2bf('0x2a')](_0x4aa892)[_0xc2bf('0x2c')](_0x1b7012);}};}function respondWithFilteredResult(_0x55de9e,_0x82280a){return function(_0x4a4a00){if(_0x4a4a00){var _0x15315a=typeof _0x82280a[_0xc2bf('0x2d')]===_0xc2bf('0x2e')&&typeof _0x82280a[_0xc2bf('0x2f')]===_0xc2bf('0x2e');var _0x506ee4=_0x4a4a00['count'];var _0x51feb6=_0x15315a?0x0:_0x82280a[_0xc2bf('0x2d')];var _0x348991=_0x15315a?_0x4a4a00[_0xc2bf('0x30')]:_0x82280a[_0xc2bf('0x2d')]+_0x82280a[_0xc2bf('0x2f')];var _0x658b9a;if(_0x348991>=_0x506ee4){_0x348991=_0x506ee4;_0x658b9a=0xc8;}else{_0x658b9a=0xce;}_0x55de9e['status'](_0x658b9a);return _0x55de9e[_0xc2bf('0x31')](_0xc2bf('0x32'),_0x51feb6+'-'+_0x348991+'/'+_0x506ee4)['json'](_0x4a4a00);}return null;};}function patchUpdates(_0x4e6378){return function(_0x2626dc){try{jsonpatch['apply'](_0x2626dc,_0x4e6378,!![]);}catch(_0x2b12d3){return BPromise[_0xc2bf('0x33')](_0x2b12d3);}return _0x2626dc[_0xc2bf('0x34')]();};}function saveUpdates(_0x352148,_0x4c63c3){return function(_0x8855a2){if(_0x8855a2){return _0x8855a2[_0xc2bf('0x35')](_0x352148)[_0xc2bf('0x1f')](function(_0x23a84e){return _0x23a84e;});}return null;};}function removeEntity(_0x105d8f,_0x5c8996){return function(_0x2f63c1){if(_0x2f63c1){return _0x2f63c1[_0xc2bf('0x36')]()[_0xc2bf('0x1f')](function(){var _0x2555c1=_0x2f63c1[_0xc2bf('0x37')]({'plain':!![]});var _0x128aad=_0xc2bf('0x38');return db['UserProfileResource'][_0xc2bf('0x36')]({'where':{'type':_0x128aad,'resourceId':_0x2555c1['id']}})[_0xc2bf('0x1f')](function(){return _0x2f63c1;});})[_0xc2bf('0x1f')](function(){_0x105d8f['status'](0xcc)[_0xc2bf('0x2b')]();});}};}function handleEntityNotFound(_0xc9c86,_0xc72c86){return function(_0x30775e){if(!_0x30775e){_0xc9c86[_0xc2bf('0x29')](0x194);}return _0x30775e;};}function handleError(_0x1128ec,_0x31eff8){_0x31eff8=_0x31eff8||0x1f4;return function(_0x51ad9c){logger[_0xc2bf('0x25')](_0x51ad9c[_0xc2bf('0x39')]);if(_0x51ad9c[_0xc2bf('0x3a')]){delete _0x51ad9c[_0xc2bf('0x3a')];}_0x1128ec[_0xc2bf('0x2a')](_0x31eff8)['send'](_0x51ad9c);};}exports['index']=function(_0x4adafa,_0x298791){var _0x34d86a={'include':[{'model':db['Pause'],'as':_0xc2bf('0x3b')}]},_0x3a7320={},_0x1f8d5b={'count':0x0,'rows':[]};var _0x46acee=_[_0xc2bf('0x3c')](db['SmsAccount']['rawAttributes'],function(_0x1c257c){return{'name':_0x1c257c[_0xc2bf('0x3d')],'type':_0x1c257c[_0xc2bf('0x3e')]['key']};});_0x3a7320[_0xc2bf('0x3f')]=_['map'](_0x46acee,_0xc2bf('0x3a'));_0x3a7320[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x4adafa[_0xc2bf('0x40')]);_0x3a7320[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x3a7320['model'],_0x3a7320[_0xc2bf('0x40')]);_0x34d86a[_0xc2bf('0x44')]=_['intersection'](_0x3a7320[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x34d86a[_0xc2bf('0x44')]=_0x34d86a[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x34d86a[_0xc2bf('0x44')]:_0x3a7320['model'];if(!_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x34d86a[_0xc2bf('0x2f')]=qs[_0xc2bf('0x2f')](_0x4adafa['query'][_0xc2bf('0x2f')]);_0x34d86a[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x4adafa[_0xc2bf('0x40')]['offset']);}_0x34d86a[_0xc2bf('0x49')]=qs['sort'](_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x34d86a[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x4adafa[_0xc2bf('0x40')],_0x3a7320['filters']),_0x46acee);if(_0x4adafa['query']['filter']){_0x34d86a['where']=_[_0xc2bf('0x4d')](_0x34d86a['where'],{'$or':_[_0xc2bf('0x3c')](_0x46acee,function(_0x4ff986){if(_0x4ff986['type']!==_0xc2bf('0x4e')){var _0x437655={};_0x437655[_0x4ff986[_0xc2bf('0x3a')]]={'$like':'%'+_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x437655;}})});}_0x34d86a=_['merge']({},_0x34d86a,_0x4adafa[_0xc2bf('0x50')]);var _0x524714={'where':_0x34d86a[_0xc2bf('0x4b')]};return db[_0xc2bf('0x51')]['count'](_0x524714)[_0xc2bf('0x1f')](function(_0x2e5dc0){_0x1f8d5b[_0xc2bf('0x30')]=_0x2e5dc0;if(_0x4adafa['query'][_0xc2bf('0x52')]){_0x34d86a['include']=[{'all':!![]}];}return db[_0xc2bf('0x51')]['findAll'](_0x34d86a);})[_0xc2bf('0x1f')](function(_0x17e64d){_0x1f8d5b['rows']=_0x17e64d;return _0x1f8d5b;})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x298791,_0x34d86a))[_0xc2bf('0x28')](handleError(_0x298791,null));};exports[_0xc2bf('0x53')]=function(_0x4fa5b8,_0x230393){var _0x39727b={'raw':![],'where':{'id':_0x4fa5b8[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0x55')],'as':_0xc2bf('0x3b')}]},_0x345b82={};_0x345b82[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x51')]['rawAttributes']);_0x345b82[_0xc2bf('0x40')]=_['keys'](_0x4fa5b8[_0xc2bf('0x40')]);_0x345b82[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x345b82[_0xc2bf('0x3f')],_0x345b82[_0xc2bf('0x40')]);_0x39727b[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x345b82[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4fa5b8[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x39727b[_0xc2bf('0x44')]=_0x39727b[_0xc2bf('0x44')]['length']?_0x39727b[_0xc2bf('0x44')]:_0x345b82[_0xc2bf('0x3f')];if(_0x4fa5b8['query'][_0xc2bf('0x52')]){_0x39727b['include']=[{'all':!![]}];}_0x39727b=_['merge']({},_0x39727b,_0x4fa5b8['options']);return db[_0xc2bf('0x51')]['find'](_0x39727b)[_0xc2bf('0x1f')](handleEntityNotFound(_0x230393,null))['then'](respondWithResult(_0x230393,null))[_0xc2bf('0x28')](handleError(_0x230393,null));};exports[_0xc2bf('0x56')]=function(_0x86c536,_0xdb5e79){return db[_0xc2bf('0x51')][_0xc2bf('0x56')](_0x86c536[_0xc2bf('0x57')],{})[_0xc2bf('0x1f')](function(_0x2b67f9){var _0x556d8a=_0x86c536[_0xc2bf('0x58')]['get']({'plain':!![]});if(!_0x556d8a)throw new Error(_0xc2bf('0x59'));if(_0x556d8a['role']===_0xc2bf('0x58')){var _0x5d37e2=_0x2b67f9[_0xc2bf('0x37')]({'plain':!![]});var _0x228bc8=_0xc2bf('0x38');return db[_0xc2bf('0x5a')][_0xc2bf('0x5b')]({'where':{'name':_0x228bc8,'userProfileId':_0x556d8a[_0xc2bf('0x5c')]},'raw':!![]})[_0xc2bf('0x1f')](function(_0x543e0d){if(_0x543e0d&&_0x543e0d[_0xc2bf('0x5d')]===0x0){return db[_0xc2bf('0x5e')]['create']({'name':_0x5d37e2[_0xc2bf('0x3a')],'resourceId':_0x5d37e2['id'],'type':_0x543e0d[_0xc2bf('0x3a')],'sectionId':_0x543e0d['id']},{})[_0xc2bf('0x1f')](function(){return _0x2b67f9;});}else{return _0x2b67f9;}})[_0xc2bf('0x28')](function(_0x443c46){logger[_0xc2bf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x443c46);throw _0x443c46;});}return _0x2b67f9;})[_0xc2bf('0x1f')](respondWithResult(_0xdb5e79,0xc9))[_0xc2bf('0x28')](handleError(_0xdb5e79,null));};exports['update']=function(_0x37e699,_0x40f69b){if(_0x37e699[_0xc2bf('0x57')]['id']){delete _0x37e699[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x37e699[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0x55')],'as':_0xc2bf('0x3b')}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x40f69b,null))[_0xc2bf('0x1f')](saveUpdates(_0x37e699[_0xc2bf('0x57')],null))[_0xc2bf('0x1f')](respondWithResult(_0x40f69b,null))[_0xc2bf('0x28')](handleError(_0x40f69b,null));};exports['destroy']=function(_0x663e54,_0x32c497){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x663e54['params']['id']}})['then'](handleEntityNotFound(_0x32c497,null))[_0xc2bf('0x1f')](removeEntity(_0x32c497,null))[_0xc2bf('0x28')](handleError(_0x32c497,null));};exports[_0xc2bf('0x5f')]=function(_0x1d185e,_0xcff3){return db[_0xc2bf('0x51')][_0xc2bf('0x5f')]()[_0xc2bf('0x1f')](respondWithResult(_0xcff3,null))['catch'](handleError(_0xcff3,null));};exports[_0xc2bf('0x60')]=function(_0x19797f,_0x4debf6,_0x161021){if(_0x19797f[_0xc2bf('0x57')]['id']){delete _0x19797f[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x19797f[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x4debf6,null))[_0xc2bf('0x1f')](function(_0x45b399){if(_0x45b399){_0x19797f[_0xc2bf('0x57')][_0xc2bf('0x61')]=_0x45b399['id'];return db[_0xc2bf('0x62')]['create'](_0x19797f[_0xc2bf('0x57')]);}})[_0xc2bf('0x1f')](respondWithResult(_0x4debf6,null))[_0xc2bf('0x28')](handleError(_0x4debf6,null));};exports[_0xc2bf('0x63')]=function(_0x2914a0,_0x42d9b1,_0x10681b){var _0x10c468={'raw':![],'where':{}};var _0x28603b={};var _0x2faea6={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x2914a0[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x42d9b1,null))[_0xc2bf('0x1f')](function(_0x170b33){if(_0x170b33){_0x28603b[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x62')][_0xc2bf('0x65')]);_0x28603b['query']=_[_0xc2bf('0x41')](_0x2914a0[_0xc2bf('0x40')]);_0x28603b['filters']=_['intersection'](_0x28603b['model'],_0x28603b[_0xc2bf('0x40')]);_0x10c468[_0xc2bf('0x44')]=_['intersection'](_0x28603b[_0xc2bf('0x3f')],qs['fields'](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x10c468[_0xc2bf('0x44')]=_0x10c468['attributes']['length']?_0x10c468['attributes']:_0x28603b[_0xc2bf('0x3f')];if(!_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x10c468[_0xc2bf('0x2f')]=qs['limit'](_0x2914a0[_0xc2bf('0x40')]['limit']);_0x10c468[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}_0x10c468[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x10c468[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x2914a0[_0xc2bf('0x40')],_0x28603b[_0xc2bf('0x42')]));_0x10c468[_0xc2bf('0x4b')]['SmsAccountId']=_0x170b33['id'];if(_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4f')]){_0x10c468['where']=_[_0xc2bf('0x4d')](_0x10c468[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x10c468[_0xc2bf('0x44')],function(_0x4c15ed){var _0x169aef={};_0x169aef[_0x4c15ed]={'$like':'%'+_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x169aef;})});}_0x10c468=_[_0xc2bf('0x4d')]({},_0x10c468,_0x2914a0['options']);return db[_0xc2bf('0x62')][_0xc2bf('0x30')]({'where':_0x10c468['where']})['then'](function(_0x2c4bae){_0x2faea6[_0xc2bf('0x30')]=_0x2c4bae;if(_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x10c468[_0xc2bf('0x66')]=[{'all':!![]}];}return db[_0xc2bf('0x62')][_0xc2bf('0x67')](_0x10c468);})['then'](function(_0x164933){_0x2faea6[_0xc2bf('0x68')]=_0x164933;return _0x2faea6;});}})['then'](respondWithFilteredResult(_0x42d9b1,_0x10c468))[_0xc2bf('0x28')](handleError(_0x42d9b1,null));};exports['removeDispositions']=function(_0x5a4233,_0x328cdd,_0x4795e2){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x5a4233[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x328cdd,null))[_0xc2bf('0x1f')](function(_0x28d7ca){if(_0x28d7ca){return _0x28d7ca[_0xc2bf('0x69')](_0x5a4233[_0xc2bf('0x40')][_0xc2bf('0x6a')]);}})[_0xc2bf('0x1f')](respondWithStatusCode(_0x328cdd,null))[_0xc2bf('0x28')](handleError(_0x328cdd,null));};exports[_0xc2bf('0x6b')]=function(_0x3a6bb6,_0xebeba2,_0x8bc73d){if(_0x3a6bb6[_0xc2bf('0x57')]['id']){delete _0x3a6bb6[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x3a6bb6['params']['id']}})['then'](handleEntityNotFound(_0xebeba2,null))[_0xc2bf('0x1f')](function(_0x5ada47){if(_0x5ada47){_0x3a6bb6[_0xc2bf('0x57')]['SmsAccountId']=_0x5ada47['id'];return db['CannedAnswer'][_0xc2bf('0x56')](_0x3a6bb6[_0xc2bf('0x57')]);}})[_0xc2bf('0x1f')](respondWithResult(_0xebeba2,null))[_0xc2bf('0x28')](handleError(_0xebeba2,null));};exports[_0xc2bf('0x6c')]=function(_0x4c73a8,_0x2cd19c,_0x446020){var _0x41c7f3={'raw':![],'where':{}};var _0x4cf173={};var _0x3975bd={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x4c73a8[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x2cd19c,null))['then'](function(_0x4e385a){if(_0x4e385a){_0x4cf173[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x6d')][_0xc2bf('0x65')]);_0x4cf173['query']=_[_0xc2bf('0x41')](_0x4c73a8[_0xc2bf('0x40')]);_0x4cf173[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x4cf173[_0xc2bf('0x3f')],_0x4cf173[_0xc2bf('0x40')]);_0x41c7f3[_0xc2bf('0x44')]=_['intersection'](_0x4cf173[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x41c7f3[_0xc2bf('0x44')]=_0x41c7f3[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x41c7f3[_0xc2bf('0x44')]:_0x4cf173[_0xc2bf('0x3f')];if(!_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x41c7f3['limit']=qs[_0xc2bf('0x2f')](_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x41c7f3[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x4c73a8[_0xc2bf('0x40')]['offset']);}_0x41c7f3[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x4c73a8['query'][_0xc2bf('0x4a')]);_0x41c7f3['where']=qs['filters'](_['pick'](_0x4c73a8[_0xc2bf('0x40')],_0x4cf173[_0xc2bf('0x42')]));_0x41c7f3[_0xc2bf('0x4b')][_0xc2bf('0x61')]=_0x4e385a['id'];if(_0x4c73a8[_0xc2bf('0x40')]['filter']){_0x41c7f3[_0xc2bf('0x4b')]=_[_0xc2bf('0x4d')](_0x41c7f3[_0xc2bf('0x4b')],{'$or':_['map'](_0x41c7f3[_0xc2bf('0x44')],function(_0xe1f55c){var _0x99cb04={};_0x99cb04[_0xe1f55c]={'$like':'%'+_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x99cb04;})});}_0x41c7f3=_[_0xc2bf('0x4d')]({},_0x41c7f3,_0x4c73a8['options']);return db[_0xc2bf('0x6d')][_0xc2bf('0x30')]({'where':_0x41c7f3[_0xc2bf('0x4b')]})[_0xc2bf('0x1f')](function(_0x3d0734){_0x3975bd[_0xc2bf('0x30')]=_0x3d0734;if(_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x41c7f3['include']=[{'all':!![]}];}return db[_0xc2bf('0x6d')]['findAll'](_0x41c7f3);})[_0xc2bf('0x1f')](function(_0x233110){_0x3975bd[_0xc2bf('0x68')]=_0x233110;return _0x3975bd;});}})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x2cd19c,_0x41c7f3))[_0xc2bf('0x28')](handleError(_0x2cd19c,null));};exports[_0xc2bf('0x6e')]=function(_0x418f5f,_0xf1fd80,_0x32bc7f){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x418f5f['params']['id']}})['then'](handleEntityNotFound(_0xf1fd80,null))[_0xc2bf('0x1f')](function(_0x4620e7){if(_0x4620e7){return _0x4620e7[_0xc2bf('0x6e')](_0x418f5f[_0xc2bf('0x40')]['ids']);}})[_0xc2bf('0x1f')](respondWithStatusCode(_0xf1fd80,null))[_0xc2bf('0x28')](handleError(_0xf1fd80,null));};exports[_0xc2bf('0x6f')]=function(_0x458e59,_0x24fcf0,_0x2e1aeb){var _0x174499={'channel':_0xc2bf('0x70')};var _0x4321ad=[];var _0x1b79bb=[];var _0x2d3dee={};return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x458e59['params']['id']},'include':[{'model':db[_0xc2bf('0x71')],'as':'Applications'}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x24fcf0,null))[_0xc2bf('0x1f')](function(_0x37fbd9){_0x174499['account']=_0x37fbd9;_0x174499[_0xc2bf('0x72')]=_['orderBy'](_0x37fbd9[_0xc2bf('0x73')],['priority'],[_0xc2bf('0x74')]);if(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x73')]){delete _0x174499[_0xc2bf('0x75')][_0xc2bf('0x73')];}return db[_0xc2bf('0x76')][_0xc2bf('0x5f')]();})[_0xc2bf('0x1f')](function(_0x54c87c){if(!_0x54c87c){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x79'));}_0x4321ad=_[_0xc2bf('0x7a')](_[_0xc2bf('0x41')](_0x54c87c),['createdAt',_0xc2bf('0x7b')]);_0x1b79bb=_['difference'](_[_0xc2bf('0x41')](_0x54c87c),[_0xc2bf('0x7c'),'updatedAt',_0xc2bf('0x7d'),_0xc2bf('0x7e')]);_0x174499[_0xc2bf('0x57')]={'mapKey':_0xc2bf('0x7f')};if(_0x174499[_0xc2bf('0x75')]['type']){switch(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x3e')]){case _0xc2bf('0x80'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59['body'][_0xc2bf('0x81')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59['body'][_0xc2bf('0x82')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x84')];break;case _0xc2bf('0x85'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]='+'+_0x458e59['body'][_0xc2bf('0x87')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x88')];break;case _0xc2bf('0x89'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59['body'][_0xc2bf('0x86')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x27')];break;case _0xc2bf('0x8a'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x86')];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59['body'][_0xc2bf('0x57')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8b')];break;case _0xc2bf('0x8c'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x81')];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8d')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8e')];break;case _0xc2bf('0x8f'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]='+'+_0x458e59[_0xc2bf('0x57')]['results'][0x0]['from'];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59['body']['results'][0x0][_0xc2bf('0x88')];_0x174499['body']['messageId']=_0x458e59['body']['results'][0x0]['messageId'];break;case _0xc2bf('0x90'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x91')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')]['segmentedMessage'][_0xc2bf('0x27')];break;case _0xc2bf('0x92'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x93')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x88')];_0x174499[_0xc2bf('0x57')]['messageId']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x94')];break;case _0xc2bf('0x95'):_0x174499['body'][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id'];_0x174499['body'][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')][_0xc2bf('0x86')];_0x174499['body']['body']=_0x458e59['body'][0x0][_0xc2bf('0x27')]['text'];break;case _0xc2bf('0x96'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59[_0xc2bf('0x57')]['from'];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x27')];_0x174499['body'][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x97')];break;}}if(_0x174499[_0xc2bf('0x57')]['id']){delete _0x174499[_0xc2bf('0x57')]['id'];}if(_['isNil'](_0x174499[_0xc2bf('0x57')]['from'])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x98'));}if(_[_0xc2bf('0x99')](_0x174499['body']['body'])||_0x174499[_0xc2bf('0x57')]['body']===''){throw new db['Sequelize'][(_0xc2bf('0x78'))](_0xc2bf('0x9a'));}if(_[_0xc2bf('0x99')](_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')])){throw new db['Sequelize'][(_0xc2bf('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b79bb);}if(!_[_0xc2bf('0x9c')](_0x1b79bb,_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x9d')+_0x1b79bb);}_0x2d3dee[_0x174499['body'][_0xc2bf('0x9b')]]=_0x174499[_0xc2bf('0x57')]['from'];return db['CmList']['find']({'where':{'id':_0x174499[_0xc2bf('0x75')]['ListId']},'include':[{'model':db[_0xc2bf('0x76')],'as':_0xc2bf('0x9e'),'where':_0x2d3dee,'limit':0x1,'order':[['updatedAt',_0xc2bf('0x9f')]]}]});})[_0xc2bf('0x1f')](handleEntityNotFound(_0x24fcf0,null))['then'](function(_0x447b08){if(_0x447b08){_0x174499[_0xc2bf('0xa0')]=_[_0xc2bf('0xa1')](_0x447b08,[_0xc2bf('0x9e')]);if(_0x447b08[_0xc2bf('0x9e')][_0xc2bf('0x46')]){return _0x447b08[_0xc2bf('0x9e')][0x0];}var _0x4351ba=_['defaults'](_0x174499[_0xc2bf('0x57')],{'firstName':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'ListId':_0x447b08['id']});_0x4351ba[_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')]]=_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')];return db[_0xc2bf('0x76')][_0xc2bf('0x56')](_0x4351ba,{'fields':_0x4321ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x24fcf0,null))[_0xc2bf('0x1f')](function(_0x5eff3c){if(_0x5eff3c){_0x174499[_0xc2bf('0xa2')]=_0x5eff3c;var _0x55c256={'ContactId':_0x5eff3c['id'],'phone':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id']};var _0x146905={'ContactId':_0x5eff3c['id'],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id'],'closed':![]};return db[_0xc2bf('0xa3')][_0xc2bf('0x5b')]({'where':_0x146905})[_0xc2bf('0x1f')](function(_0xfd4bc4){if(_0xfd4bc4){return[_0xfd4bc4,![]];}return db[_0xc2bf('0xa3')][_0xc2bf('0x56')](_0x55c256)['then'](function(_0x38b612){return[_0x38b612,!![]];});});}})[_0xc2bf('0xa4')](function(_0x3a39aa,_0x127423){_0x174499[_0xc2bf('0xa5')]=_0x3a39aa[_0xc2bf('0x37')]({'plain':!![]});_0x174499[_0xc2bf('0xa5')][_0xc2bf('0xa6')]=![];if(_0x127423){if(_0x174499[_0xc2bf('0x75')]['autoclose']){_0x174499[_0xc2bf('0x72')][_0xc2bf('0xa7')]({'id':0x0,'priority':_0x174499['applications']['length']+0x1,'app':_0xc2bf('0xa8'),'appdata':'unmanaged','interval':_0xc2bf('0xa9')});}_0x174499[_0xc2bf('0xa5')]['created']=!![];}return db[_0xc2bf('0xaa')][_0xc2bf('0x56')]({'phone':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'messageId':_0x174499[_0xc2bf('0x57')]['messageId'],'body':_0x174499[_0xc2bf('0x57')]['body'],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id'],'SmsInteractionId':_0x3a39aa['id'],'direction':'in','ContactId':_0x3a39aa[_0xc2bf('0xab')],'AttachmentId':_0x174499['body']['AttachmentId']});})[_0xc2bf('0x1f')](function(_0x93baca){_0x174499['message']=_0x93baca;if(_0x174499[_0xc2bf('0xa5')]['UserId']){return db[_0xc2bf('0xac')]['find']({'attributes':['id',_0xc2bf('0x3a')],'where':{'id':_0x174499[_0xc2bf('0xa5')][_0xc2bf('0xad')]}})['then'](function(_0x217fd9){if(_0x217fd9){_0x174499['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x217fd9[_0xc2bf('0x3a')]+','+(_0x174499[_0xc2bf('0x75')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc2bf('0xae'),_0xc2bf('0xaf'),_0x174499);});}return respondWithRpcPromise(_0xc2bf('0xae'),_0xc2bf('0xaf'),_0x174499);})[_0xc2bf('0x1f')](function(_0x29c12d){if(_0x29c12d){var _0x77b662=0xc8;var _0x24725c=_0xc2bf('0xb0');logger[_0xc2bf('0x20')](_0xc2bf('0x24'),_0x24725c,_0x77b662,'entity\x20found');logger['debug'](_0xc2bf('0xb1'),_0x24725c,_0x77b662,'entity\x20found',JSON['stringify'](_0x29c12d));if(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x3e')]===_0xc2bf('0x80')){return _0x24fcf0[_0xc2bf('0x2a')](_0x77b662)[_0xc2bf('0x31')](_0xc2bf('0xb2'),'text/xml')['send'](_0xc2bf('0xb3'));}else{return _0x24fcf0[_0xc2bf('0x2a')](_0x77b662)[_0xc2bf('0x2c')](_0x29c12d);}}})[_0xc2bf('0x28')](handleError(_0x24fcf0,null));};exports[_0xc2bf('0xb4')]=function(_0x41219f,_0x139ac8,_0x57d6fa){return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x41219f['params']['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x139ac8,null))[_0xc2bf('0x1f')](function(_0x5e74be){if(_0x5e74be){return db['sequelize'][_0xc2bf('0xb5')](function(_0x59cf26){return db[_0xc2bf('0x71')][_0xc2bf('0x36')]({'where':{'SmsAccountId':_0x41219f[_0xc2bf('0x54')]['id']},'transaction':_0x59cf26})['then'](function(_0x384b8a){var _0x4af615=_[_0xc2bf('0x3c')](_0x41219f[_0xc2bf('0x57')],function(_0x44a903){_0x44a903[_0xc2bf('0x61')]=_0x41219f[_0xc2bf('0x54')]['id'];return _0x44a903;});return db[_0xc2bf('0x71')][_0xc2bf('0xb6')](_0x4af615,{'transaction':_0x59cf26});});})[_0xc2bf('0x1f')](function(){return db['SmsApplication'][_0xc2bf('0xb7')]({'where':{'SmsAccountId':_0x41219f[_0xc2bf('0x54')]['id']},'order':_0xc2bf('0xb8')});});}})[_0xc2bf('0x1f')](respondWithResult(_0x139ac8,null))['catch'](handleError(_0x139ac8,null));};exports[_0xc2bf('0xb9')]=function(_0x42b2d4,_0x545d61,_0x3029c7){var _0x5ac8cf={};var _0x2bf18f={};var _0x3fbfe3;var _0x5c7f03;return db[_0xc2bf('0x51')]['findOne']({'where':{'id':_0x42b2d4[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x545d61,null))['then'](function(_0x212e4d){if(_0x212e4d){_0x3fbfe3=_0x212e4d;_0x2bf18f[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x71')][_0xc2bf('0x65')]);_0x2bf18f[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x42b2d4[_0xc2bf('0x40')]);_0x2bf18f[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x2bf18f[_0xc2bf('0x3f')],_0x2bf18f[_0xc2bf('0x40')]);_0x5ac8cf[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x2bf18f['model'],qs['fields'](_0x42b2d4[_0xc2bf('0x40')]['fields']));_0x5ac8cf[_0xc2bf('0x44')]=_0x5ac8cf[_0xc2bf('0x44')]['length']?_0x5ac8cf[_0xc2bf('0x44')]:_0x2bf18f[_0xc2bf('0x3f')];_0x5ac8cf[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x42b2d4['query'][_0xc2bf('0x4a')]);_0x5ac8cf[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x42b2d4[_0xc2bf('0x40')],_0x2bf18f[_0xc2bf('0x42')]));if(_0x42b2d4['query'][_0xc2bf('0x4f')]){_0x5ac8cf['where']=_['merge'](_0x5ac8cf['where'],{'$or':_[_0xc2bf('0x3c')](_0x5ac8cf['attributes'],function(_0x14a696){var _0x567a93={};_0x567a93[_0x14a696]={'$like':'%'+_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x567a93;})});}_0x5ac8cf=_[_0xc2bf('0x4d')]({},_0x5ac8cf,_0x42b2d4['options']);return _0x3fbfe3[_0xc2bf('0xb9')](_0x5ac8cf);}})[_0xc2bf('0x1f')](function(_0x56d0ab){if(_0x56d0ab){_0x5c7f03=_0x56d0ab[_0xc2bf('0x46')];if(!_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x5ac8cf['limit']=qs['limit'](_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x5ac8cf['offset']=qs[_0xc2bf('0x2d')](_0x42b2d4[_0xc2bf('0x40')]['offset']);}return _0x3fbfe3[_0xc2bf('0xb9')](_0x5ac8cf);}})[_0xc2bf('0x1f')](function(_0x2b2725){if(_0x2b2725){return _0x2b2725?{'count':_0x5c7f03,'rows':_0x2b2725}:null;}})[_0xc2bf('0x1f')](respondWithResult(_0x545d61,null))[_0xc2bf('0x28')](handleError(_0x545d61,null));};exports['getInteractions']=function(_0x202e36,_0x5a9828,_0x51a0f9){var _0x436e4c={'raw':![],'where':{}};var _0x1cb91e={};var _0x55b76a={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x202e36[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x5a9828,null))[_0xc2bf('0x1f')](function(_0x58d7d7){if(_0x58d7d7){_0x1cb91e[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0xa3')][_0xc2bf('0x65')]);_0x1cb91e['query']=_[_0xc2bf('0x41')](_0x202e36[_0xc2bf('0x40')]);_0x1cb91e[_0xc2bf('0x42')]=_['intersection'](_0x1cb91e[_0xc2bf('0x3f')],_0x1cb91e[_0xc2bf('0x40')]);_0x436e4c['attributes']=_['intersection'](_0x1cb91e[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x202e36['query'][_0xc2bf('0x45')]));_0x436e4c['attributes']=_0x436e4c[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x436e4c['attributes']:_0x1cb91e[_0xc2bf('0x3f')];if(!_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x436e4c[_0xc2bf('0x2f')]=qs[_0xc2bf('0x2f')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x436e4c[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}_0x436e4c[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x436e4c[_0xc2bf('0x4b')]=qs['filters'](_['pick'](_0x202e36[_0xc2bf('0x40')],_0x1cb91e['filters']));_0x436e4c[_0xc2bf('0x4b')][_0xc2bf('0x61')]=_0x58d7d7['id'];if(_0x202e36[_0xc2bf('0x40')]['filter']){_0x436e4c[_0xc2bf('0x4b')]=_[_0xc2bf('0x4d')](_0x436e4c[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x436e4c[_0xc2bf('0x44')],function(_0x169fd3){var _0x4ba362={};_0x4ba362[_0x169fd3]={'$like':'%'+_0x202e36['query'][_0xc2bf('0x4f')]+'%'};return _0x4ba362;})});}_0x436e4c=_[_0xc2bf('0x4d')]({},_0x436e4c,_0x202e36[_0xc2bf('0x50')]);return db[_0xc2bf('0xa3')][_0xc2bf('0x30')]({'where':_0x436e4c[_0xc2bf('0x4b')]})[_0xc2bf('0x1f')](function(_0x54e01f){_0x55b76a[_0xc2bf('0x30')]=_0x54e01f;if(_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x436e4c[_0xc2bf('0x66')]=[{'model':db['CmContact'],'as':_0xc2bf('0xba'),'required':![]},{'model':db[_0xc2bf('0xac')],'as':_0xc2bf('0xbb'),'attributes':[_0xc2bf('0x3a'),_0xc2bf('0xbc'),_0xc2bf('0xbd')],'required':![]},{'model':db[_0xc2bf('0xbe')],'as':_0xc2bf('0xbf'),'attributes':['id',_0xc2bf('0x3a'),_0xc2bf('0xc0')],'where':_0x202e36['query'][_0xc2bf('0xc1')]?{'id':_0x202e36[_0xc2bf('0x40')]['tag']}:undefined,'required':_0x202e36['query'][_0xc2bf('0xc1')]?!![]:![]}];}return db[_0xc2bf('0xa3')][_0xc2bf('0x67')](_0x436e4c);})['then'](function(_0x5a4762){_0x55b76a[_0xc2bf('0x68')]=_0x5a4762;return _0x55b76a;});}})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x5a9828,_0x436e4c))[_0xc2bf('0x28')](handleError(_0x5a9828,null));};exports['send']=function(_0x5f1471,_0x347126,_0xadb7e9){var _0x3ec6f5,_0x313b4e,_0x36baba;if(_[_0xc2bf('0x99')](_0x5f1471[_0xc2bf('0x57')][_0xc2bf('0x57')])||_0x5f1471[_0xc2bf('0x57')]['body']===''){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x9a'));}if(_[_0xc2bf('0x99')](_0x5f1471[_0xc2bf('0x57')]['to'])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0xc2'));}_0x3ec6f5=_0x5f1471[_0xc2bf('0x57')]['to'];return db['SmsAccount'][_0xc2bf('0x5b')]({'where':{'id':_0x5f1471[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0xc3')],'as':_0xc2bf('0xc4'),'include':[{'model':db[_0xc2bf('0x76')],'as':'Contacts','where':{'mobile':_0x3ec6f5},'limit':0x1,'order':[['updatedAt',_0xc2bf('0x9f')]]}]}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x347126,null))[_0xc2bf('0x1f')](function(_0x5ac61a){if(_0x5ac61a&&_0x5ac61a[_0xc2bf('0xc4')]){_0x313b4e=_0x5ac61a[_0xc2bf('0x37')]({'plain':!![]});if(_0x313b4e['List']&&_0x313b4e[_0xc2bf('0xc4')][_0xc2bf('0x9e')][_0xc2bf('0x46')]){return _0x313b4e[_0xc2bf('0xc4')][_0xc2bf('0x9e')][0x0];}return db[_0xc2bf('0x76')]['create'](_[_0xc2bf('0x18')](_0x5f1471['body'],{'firstName':_0x3ec6f5,'mobile':_0x3ec6f5,'phone':_0x3ec6f5,'ListId':_0x313b4e[_0xc2bf('0x7e')]}));}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x347126,null))[_0xc2bf('0x1f')](function(_0x328237){if(_0x328237){_0x36baba=_0x328237;return db['SmsInteraction'][_0xc2bf('0x5b')]({'where':{'ContactId':_0x36baba['id'],'closed':![],'SmsAccountId':_0x313b4e['id']}})[_0xc2bf('0x1f')](function(_0x2c48f4){if(_0x2c48f4){return[_0x2c48f4,![]];}return db['SmsInteraction'][_0xc2bf('0x56')]({'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id'],'SmsAccountId':_0x313b4e['id'],'phone':_0x3ec6f5,'firstMsgDirection':_0xc2bf('0xc5'),'Messages':[_['merge'](_0x5f1471[_0xc2bf('0x57')],{'read':![],'body':_0x5f1471[_0xc2bf('0x57')][_0xc2bf('0x57')],'phone':_0x3ec6f5,'SmsAccountId':_0x313b4e['id'],'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc2bf('0xc6')}]})['then'](function(_0x5ebf7b){return[_0x5ebf7b,!![]];});});}})[_0xc2bf('0xa4')](function(_0x23f91,_0x73acce){if(_0x73acce){return _0x23f91;}return db[_0xc2bf('0xaa')][_0xc2bf('0x56')](_[_0xc2bf('0x4d')](_0x5f1471[_0xc2bf('0x57')],{'read':![],'body':_0x5f1471['body'][_0xc2bf('0x57')],'phone':_0x3ec6f5,'SmsAccountId':_0x313b4e['id'],'SmsInteractionId':_0x23f91['id'],'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id']}))['then'](function(_0xbbfb9d){_0x23f91['dataValues'][_0xc2bf('0xc6')]=[];_0x23f91[_0xc2bf('0xc7')][_0xc2bf('0xc6')][_0xc2bf('0xa7')](_0xbbfb9d[_0xc2bf('0xc7')]);return _0x23f91;});})[_0xc2bf('0x1f')](respondWithResult(_0x347126,null))[_0xc2bf('0x28')](handleError(_0x347126,null));};exports[_0xc2bf('0x2a')]=function(_0x580986,_0xb84e5e,_0x5a144b){if(_0x580986[_0xc2bf('0x57')]['id']){delete _0x580986[_0xc2bf('0x57')]['id'];}var _0x653708,_0x421346,_0x26f84c;return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x580986[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0xb84e5e,null))[_0xc2bf('0x1f')](function(_0x179df6){if(_0x179df6){_0x26f84c=_0x179df6;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc2bf('0x2a'),_0xc2bf('0xc8'),_0x179df6[_0xc2bf('0x3e')],util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));switch(_0x179df6['type']){case _0xc2bf('0x85'):if(_0x580986[_0xc2bf('0x57')][_0xc2bf('0xca')]&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')]){_0x421346=_0x580986['body'][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0xca')]}});}break;case'connectel':if(_0x580986['body'][_0xc2bf('0xcb')]&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcc')]){_0x421346=_0x580986[_0xc2bf('0x57')]['statusInt'];return db[_0xc2bf('0xaa')]['find']({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcb')]}});}break;case _0xc2bf('0x8a'):if(_0x580986['body'][_0xc2bf('0x8b')]&&_0x580986['body'][_0xc2bf('0xcd')]){_0x421346=_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcd')];return db['SmsMessage'][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0x8b')]}});}break;case'infobip':var _0x1eff80=_0x580986['body'][_0xc2bf('0xce')][0x0];if(_0x1eff80[_0xc2bf('0x83')]&&_0x1eff80['status']['groupName']===_0xc2bf('0xcf')){_0x421346=_0x1eff80[_0xc2bf('0x2a')]['groupName'];return db['SmsMessage']['find']({'where':{'messageId':_0x1eff80[_0xc2bf('0x83')]}});}break;case _0xc2bf('0x92'):if(_0x580986[_0xc2bf('0x57')]['messageId']&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')]){_0x421346=_0x580986['body'][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0x83')]}});}break;case _0xc2bf('0x95'):if(_0x580986[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id']){_0x421346=_0x580986['body'][0x0][_0xc2bf('0x3e')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id']}});}break;case _0xc2bf('0x96'):if(_0x580986[_0xc2bf('0x57')][_0xc2bf('0xd0')]&&_0x580986[_0xc2bf('0x57')]['status']){_0x421346=_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986['body'][_0xc2bf('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0xb84e5e,null))[_0xc2bf('0x1f')](function(_0x2aabfd){if(_0x2aabfd){_0x653708=_0x2aabfd;switch(_0x26f84c[_0xc2bf('0x3e')]){case _0xc2bf('0x85'):if(_0x421346==='DELIVERED'){return _0x653708['update']({'read':!![]});}else{logger['error'](_0xc2bf('0x24'),_0xc2bf('0x2a'),'skebby',util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x89'):if(_0x421346==='1'){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x85'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x8a'):if(!_0x580986[_0xc2bf('0x57')]['error_code']&&_0x421346>=0xc8&&_0x421346<=0xce){return _0x653708['update']({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x8a'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x8f'):var _0x429175=_0x580986[_0xc2bf('0x57')]['results'][0x0];if(_0x429175[_0xc2bf('0x2a')][_0xc2bf('0xd1')]===_0xc2bf('0xcf')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger['error'](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x8f'),util[_0xc2bf('0xc9')](_0x580986['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x421346==_0xc2bf('0xd2')||_0x421346=='RECEIVED_BY_RECIPIENT'){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x92'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x95'):if(_0x421346==_0xc2bf('0xd3')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),'status',_0xc2bf('0x95'),util['inspect'](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x421346===_0xc2bf('0xd4')||_0x421346===_0xc2bf('0xd5')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),'status',_0xc2bf('0x96'),util['inspect'](_0x580986['body'],{'showHidden':![],'depth':null}));}break;}return _0x653708;}})[_0xc2bf('0x1f')](respondWithResult(_0xb84e5e,null))[_0xc2bf('0x28')](handleError(_0xb84e5e,null));};exports[_0xc2bf('0xd6')]=function(_0x7ecf7,_0x163885,_0x2767be){var _0x5b44a6,_0x28f2bd,_0x58752d;return db['SmsAccount'][_0xc2bf('0x5b')]({'where':{'id':_0x7ecf7[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x163885,null))['then'](function(_0x39dbfe){if(_0x39dbfe){_0x58752d=_0x39dbfe;logger['debug'](_0xc2bf('0x24'),'status',_0xc2bf('0xc8'),_0x39dbfe[_0xc2bf('0x3e')],util[_0xc2bf('0xc9')](_0x7ecf7[_0xc2bf('0x40')],{'showHidden':![],'depth':null}));switch(_0x39dbfe[_0xc2bf('0x3e')]){case _0xc2bf('0x90'):if(_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd7')]&&_0x7ecf7[_0xc2bf('0x40')]['state']){_0x28f2bd=_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd8')];return db[_0xc2bf('0xaa')]['find']({'where':{'messageId':_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x163885,null))['then'](function(_0x35a0d0){if(_0x35a0d0){_0x5b44a6=_0x35a0d0;switch(_0x58752d['type']){case _0xc2bf('0x90'):if(_0x28f2bd==='2'||_0x28f2bd==='6'){return _0x5b44a6[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x90'),util[_0xc2bf('0xc9')](_0x7ecf7[_0xc2bf('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x5b44a6;}})['then'](respondWithResult(_0x163885,null))[_0xc2bf('0x28')](handleError(_0x163885,null));};exports['addAgents']=function(_0x199f05,_0x17be6d,_0x150966){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x199f05[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x17be6d,null))['then'](function(_0x281c04){if(_0x281c04){return _0x281c04[_0xc2bf('0xd9')](_0x199f05['body'][_0xc2bf('0x6a')],_[_0xc2bf('0xa1')](_0x199f05['body'],[_0xc2bf('0x6a'),'id'])||{})[_0xc2bf('0xa4')](function(_0x22230c){for(var _0x1c643c=0x0;_0x1c643c<_0x199f05[_0xc2bf('0x57')]['ids'][_0xc2bf('0x46')];_0x1c643c+=0x1){socket['emit'](_0xc2bf('0xda'),{'UserId':Number(_0x199f05[_0xc2bf('0x57')][_0xc2bf('0x6a')][_0x1c643c]),'SmsAccountId':Number(_0x199f05['params']['id'])});}return _0x22230c;});}})[_0xc2bf('0x1f')](respondWithResult(_0x17be6d,null))[_0xc2bf('0x28')](handleError(_0x17be6d,null));};exports['removeAgents']=function(_0x28d74b,_0x5dd92b,_0x3dcab5){return db[_0xc2bf('0x51')]['find']({'where':{'id':_0x28d74b[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x5dd92b,null))[_0xc2bf('0x1f')](function(_0x5823b9){if(_0x5823b9){return _0x5823b9['removeAgents'](_0x28d74b[_0xc2bf('0x40')]['ids'])['then'](function(){if(_['isArray'](_0x28d74b[_0xc2bf('0x40')]['ids'])){for(var _0x4232d9=0x0;_0x4232d9<_0x28d74b['query'][_0xc2bf('0x6a')][_0xc2bf('0x46')];_0x4232d9+=0x1){socket[_0xc2bf('0xdb')](_0xc2bf('0xdc'),{'UserId':Number(_0x28d74b[_0xc2bf('0x40')][_0xc2bf('0x6a')][_0x4232d9]),'SmsAccountId':Number(_0x28d74b['params']['id'])});}}else{socket[_0xc2bf('0xdb')](_0xc2bf('0xdc'),{'UserId':Number(_0x28d74b[_0xc2bf('0x40')][_0xc2bf('0x6a')]),'SmsAccountId':Number(_0x28d74b[_0xc2bf('0x54')]['id'])});}});}})[_0xc2bf('0x1f')](respondWithStatusCode(_0x5dd92b,null))['catch'](handleError(_0x5dd92b,null));};exports['getAgents']=function(_0x567010,_0x3b33fa,_0x2bf176){var _0x2a9f75={};var _0x1d4b03={};var _0x1e85cf;var _0x1430fe;return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x567010[_0xc2bf('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b33fa,null))['then'](function(_0x14b99a){if(_0x14b99a){_0x1e85cf=_0x14b99a;_0x1d4b03[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0xac')]['rawAttributes']);_0x1d4b03[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x567010[_0xc2bf('0x40')]);_0x1d4b03['filters']=_[_0xc2bf('0x43')](_0x1d4b03[_0xc2bf('0x3f')],_0x1d4b03[_0xc2bf('0x40')]);_0x2a9f75[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x1d4b03[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x2a9f75[_0xc2bf('0x44')]=_0x2a9f75[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x2a9f75[_0xc2bf('0x44')]:_0x1d4b03[_0xc2bf('0x3f')];_0x2a9f75[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x2a9f75[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x567010['query'],_0x1d4b03[_0xc2bf('0x42')]));if(_0x567010['query'][_0xc2bf('0x4f')]){_0x2a9f75[_0xc2bf('0x4b')]=_['merge'](_0x2a9f75[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x2a9f75[_0xc2bf('0x44')],function(_0x59971d){var _0x1dc0ad={};_0x1dc0ad[_0x59971d]={'$like':'%'+_0x567010['query']['filter']+'%'};return _0x1dc0ad;})});}_0x2a9f75=_[_0xc2bf('0x4d')]({},_0x2a9f75,_0x567010[_0xc2bf('0x50')]);return _0x1e85cf[_0xc2bf('0xdd')](_0x2a9f75);}})[_0xc2bf('0x1f')](function(_0x3cbec1){if(_0x3cbec1){_0x1430fe=_0x3cbec1[_0xc2bf('0x46')];if(!_0x567010[_0xc2bf('0x40')]['hasOwnProperty']('nolimit')){_0x2a9f75['limit']=qs['limit'](_0x567010['query'][_0xc2bf('0x2f')]);_0x2a9f75[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}return _0x1e85cf[_0xc2bf('0xdd')](_0x2a9f75);}})[_0xc2bf('0x1f')](function(_0x3ef8df){if(_0x3ef8df){return _0x3ef8df?{'count':_0x1430fe,'rows':_0x3ef8df}:null;}})[_0xc2bf('0x1f')](respondWithResult(_0x3b33fa,null))[_0xc2bf('0x28')](handleError(_0x3b33fa,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2012cda..7019028 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 _0x8f39=['SmsAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x524cc3,_0x411124){var _0x47d234=function(_0x37aa09){while(--_0x37aa09){_0x524cc3['push'](_0x524cc3['shift']());}};_0x47d234(++_0x411124);}(_0x8f39,0xda));var _0x98f3=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x8f39[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0x98f3('0x0'));var SmsAccount=require(_0x98f3('0x1'))['db'][_0x98f3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98f3('0x3'),'afterUpdate':_0x98f3('0x4'),'afterDestroy':_0x98f3('0x5')};function emitEvent(_0x30ed78){return function(_0x15a948,_0x535732,_0x251e93){SmsAccountEvents[_0x98f3('0x6')](_0x30ed78+':'+_0x15a948['id'],_0x15a948);SmsAccountEvents[_0x98f3('0x6')](_0x30ed78,_0x15a948);_0x251e93(null);};}for(var e in events){if(events[_0x98f3('0x7')](e)){var event=events[e];SmsAccount[_0x98f3('0x8')](e,emitEvent(event));}}module[_0x98f3('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xcdfe=['hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xc1a10f,_0x4b706a){var _0x2ff748=function(_0x3bb82d){while(--_0x3bb82d){_0xc1a10f['push'](_0xc1a10f['shift']());}};_0x2ff748(++_0x4b706a);}(_0xcdfe,0x14a));var _0xecdf=function(_0x3f80e2,_0x2afef){_0x3f80e2=_0x3f80e2-0x0;var _0x10b68b=_0xcdfe[_0x3f80e2];return _0x10b68b;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xecdf('0x0'))['db'][_0xecdf('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xecdf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xecdf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40bed5){return function(_0xd24d6,_0x422bc7,_0xef8192){SmsAccountEvents[_0xecdf('0x4')](_0x40bed5+':'+_0xd24d6['id'],_0xd24d6);SmsAccountEvents[_0xecdf('0x4')](_0x40bed5,_0xd24d6);_0xef8192(null);};}for(var e in events){if(events[_0xecdf('0x5')](e)){var event=events[e];SmsAccount[_0xecdf('0x6')](e,emitEvent(event));}}module[_0xecdf('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 ee2eb8f..f312b67 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 _0x0b2d=['moment','bluebird','request-promise','path','rimraf','exports','define','../../config/logger','api'];(function(_0x5eed74,_0x445143){var _0x5cf861=function(_0x3e8eae){while(--_0x3e8eae){_0x5eed74['push'](_0x5eed74['shift']());}};_0x5cf861(++_0x445143);}(_0x0b2d,0x130));var _0xd0b2=function(_0x29b6c9,_0xbfcae3){_0x29b6c9=_0x29b6c9-0x0;var _0x10f339=_0x0b2d[_0x29b6c9];return _0x10f339;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd0b2('0x0'))(_0xd0b2('0x1'));var moment=require(_0xd0b2('0x2'));var BPromise=require(_0xd0b2('0x3'));var rp=require(_0xd0b2('0x4'));var fs=require('fs');var path=require(_0xd0b2('0x5'));var rimraf=require(_0xd0b2('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xd0b2('0x7')]=function(_0x4c68ea,_0x127547){return _0x4c68ea[_0xd0b2('0x8')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9eb=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1ff089,_0x686322){var _0x278a2a=function(_0x33a830){while(--_0x33a830){_0x1ff089['push'](_0x1ff089['shift']());}};_0x278a2a(++_0x686322);}(_0xf9eb,0x149));var _0xbf9e=function(_0x5e0ee9,_0xe94ee1){_0x5e0ee9=_0x5e0ee9-0x0;var _0x1bab98=_0xf9eb[_0x5e0ee9];return _0x1bab98;};'use strict';var _=require(_0xbf9e('0x0'));var util=require(_0xbf9e('0x1'));var logger=require(_0xbf9e('0x2'))(_0xbf9e('0x3'));var moment=require('moment');var BPromise=require(_0xbf9e('0x4'));var rp=require(_0xbf9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9e('0x6'));var config=require(_0xbf9e('0x7'));var attributes=require(_0xbf9e('0x8'));module['exports']=function(_0xb51fb6,_0x58f762){return _0xb51fb6[_0xbf9e('0x9')](_0xbf9e('0xa'),attributes,{'tableName':_0xbf9e('0xb'),'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 b27e4b5..95b8d90 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 _0x5406=['map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','attributes','include'];(function(_0x174eab,_0x46b1f8){var _0x97f256=function(_0x6393a9){while(--_0x6393a9){_0x174eab['push'](_0x174eab['shift']());}};_0x97f256(++_0x46b1f8);}(_0x5406,0x183));var _0x6540=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x5406[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x6540('0x0'));var util=require(_0x6540('0x1'));var moment=require(_0x6540('0x2'));var BPromise=require(_0x6540('0x3'));var rs=require(_0x6540('0x4'));var fs=require('fs');var Redis=require(_0x6540('0x5'));var db=require(_0x6540('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6540('0x7'))(_0x6540('0x8'));var config=require(_0x6540('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6540('0xa')]=_[_0x6540('0xb')](config[_0x6540('0xa')],{'host':_0x6540('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6540('0xa')]));require(_0x6540('0xd'))[_0x6540('0xe')](socket);function respondWithRpcPromise(_0x25a2c9,_0x5dbf31,_0x160db9){return new BPromise(function(_0x62d232,_0x3e90b0){return client[_0x6540('0xf')](_0x25a2c9,_0x160db9)[_0x6540('0x10')](function(_0x2c7f4c){logger[_0x6540('0x11')](_0x6540('0x12'),_0x5dbf31,_0x6540('0x13'));logger['debug'](_0x6540('0x14'),_0x5dbf31,_0x6540('0x13'),JSON[_0x6540('0x15')](_0x2c7f4c));if(_0x2c7f4c['error']){if(_0x2c7f4c[_0x6540('0x16')][_0x6540('0x17')]===0x1f4){logger['error'](_0x6540('0x12'),_0x5dbf31,_0x2c7f4c[_0x6540('0x16')][_0x6540('0x18')]);return _0x3e90b0(_0x2c7f4c[_0x6540('0x16')][_0x6540('0x18')]);}logger['error'](_0x6540('0x12'),_0x5dbf31,_0x2c7f4c[_0x6540('0x16')][_0x6540('0x18')]);return _0x62d232(_0x2c7f4c[_0x6540('0x16')][_0x6540('0x18')]);}else{logger[_0x6540('0x11')](_0x6540('0x12'),_0x5dbf31,_0x6540('0x13'));_0x62d232(_0x2c7f4c[_0x6540('0x19')][_0x6540('0x18')]);}})[_0x6540('0x1a')](function(_0x51722c){logger[_0x6540('0x16')]('SmsAccount,\x20%s,\x20%s',_0x5dbf31,_0x51722c);_0x3e90b0(_0x51722c);});});}exports[_0x6540('0x1b')]=function(_0x49429d){var _0x2a4508=this;return new Promise(function(_0x72113a,_0xe11bc0){return db[_0x6540('0x1c')]['find']({'raw':_0x49429d[_0x6540('0x1d')]?_0x49429d[_0x6540('0x1d')][_0x6540('0x1e')]===undefined?!![]:![]:!![],'where':_0x49429d['options']?_0x49429d[_0x6540('0x1d')]['where']||null:null,'attributes':_0x49429d[_0x6540('0x1d')]?_0x49429d[_0x6540('0x1d')][_0x6540('0x1f')]||null:null,'include':_0x49429d['options']?_0x49429d['options'][_0x6540('0x20')]?_[_0x6540('0x21')](_0x49429d['options']['include'],function(_0x590dbb){return{'model':db[_0x590dbb[_0x6540('0x22')]],'as':_0x590dbb['as'],'attributes':_0x590dbb['attributes'],'include':_0x590dbb[_0x6540('0x20')]?_[_0x6540('0x21')](_0x590dbb[_0x6540('0x20')],function(_0x2019d3){return{'model':db[_0x2019d3[_0x6540('0x22')]],'as':_0x2019d3['as'],'attributes':_0x2019d3[_0x6540('0x1f')],'include':_0x2019d3[_0x6540('0x20')]?_['map'](_0x2019d3[_0x6540('0x20')],function(_0x5da4c1){return{'model':db[_0x5da4c1[_0x6540('0x22')]],'as':_0x5da4c1['as'],'attributes':_0x5da4c1[_0x6540('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6540('0x10')](function(_0x29bc27){logger[_0x6540('0x11')]('ShowSmsAccount',_0x49429d);logger['debug'](_0x6540('0x1b'),_0x49429d,JSON[_0x6540('0x15')](_0x29bc27));_0x72113a(_0x29bc27);})[_0x6540('0x1a')](function(_0x41b141){logger['error']('ShowSmsAccount',_0x41b141['message'],_0x49429d);_0xe11bc0(_0x2a4508['error'](0x1f4,_0x41b141['message']));});});}; \ No newline at end of file +var _0x9158=['http','redis','defaults','socket.io-emitter','register','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xd8c72f,_0x29b075){var _0x23fd0e=function(_0x11a655){while(--_0x11a655){_0xd8c72f['push'](_0xd8c72f['shift']());}};_0x23fd0e(++_0x29b075);}(_0x9158,0xf3));var _0x8915=function(_0x4cb280,_0x2accb5){_0x4cb280=_0x4cb280-0x0;var _0x3f10df=_0x9158[_0x4cb280];return _0x3f10df;};'use strict';var _=require(_0x8915('0x0'));var util=require('util');var moment=require(_0x8915('0x1'));var BPromise=require(_0x8915('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8915('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8915('0x4'));var logger=require(_0x8915('0x5'))(_0x8915('0x6'));var config=require(_0x8915('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8915('0x8')][_0x8915('0x9')]({'port':0x232a});config[_0x8915('0xa')]=_[_0x8915('0xb')](config[_0x8915('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8915('0xc'))(new Redis(config[_0x8915('0xa')]));require('./smsAccount.socket')[_0x8915('0xd')](socket);function respondWithRpcPromise(_0x278393,_0x3c9ac8,_0x4eee54){return new BPromise(function(_0x49d452,_0x3ccf08){return client[_0x8915('0xe')](_0x278393,_0x4eee54)[_0x8915('0xf')](function(_0x7d9a55){logger[_0x8915('0x10')]('SmsAccount,\x20%s,\x20%s',_0x3c9ac8,'request\x20sent');logger[_0x8915('0x11')](_0x8915('0x12'),_0x3c9ac8,'request\x20sent',JSON[_0x8915('0x13')](_0x7d9a55));if(_0x7d9a55[_0x8915('0x14')]){if(_0x7d9a55[_0x8915('0x14')]['code']===0x1f4){logger[_0x8915('0x14')](_0x8915('0x15'),_0x3c9ac8,_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);return _0x3ccf08(_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);}logger[_0x8915('0x14')]('SmsAccount,\x20%s,\x20%s',_0x3c9ac8,_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);return _0x49d452(_0x7d9a55['error'][_0x8915('0x16')]);}else{logger[_0x8915('0x10')](_0x8915('0x15'),_0x3c9ac8,_0x8915('0x17'));_0x49d452(_0x7d9a55[_0x8915('0x18')]['message']);}})[_0x8915('0x19')](function(_0x578714){logger[_0x8915('0x14')](_0x8915('0x15'),_0x3c9ac8,_0x578714);_0x3ccf08(_0x578714);});});}exports['ShowSmsAccount']=function(_0x45d6cc){var _0x42c0f8=this;return new Promise(function(_0x1f4892,_0x3a86fc){return db[_0x8915('0x1a')][_0x8915('0x1b')]({'raw':_0x45d6cc['options']?_0x45d6cc[_0x8915('0x1c')][_0x8915('0x1d')]===undefined?!![]:![]:!![],'where':_0x45d6cc['options']?_0x45d6cc[_0x8915('0x1c')][_0x8915('0x1e')]||null:null,'attributes':_0x45d6cc[_0x8915('0x1c')]?_0x45d6cc['options'][_0x8915('0x1f')]||null:null,'include':_0x45d6cc[_0x8915('0x1c')]?_0x45d6cc[_0x8915('0x1c')]['include']?_['map'](_0x45d6cc[_0x8915('0x1c')][_0x8915('0x20')],function(_0x1bb76f){return{'model':db[_0x1bb76f['model']],'as':_0x1bb76f['as'],'attributes':_0x1bb76f[_0x8915('0x1f')],'include':_0x1bb76f['include']?_['map'](_0x1bb76f['include'],function(_0x1ae57e){return{'model':db[_0x1ae57e[_0x8915('0x21')]],'as':_0x1ae57e['as'],'attributes':_0x1ae57e[_0x8915('0x1f')],'include':_0x1ae57e[_0x8915('0x20')]?_[_0x8915('0x22')](_0x1ae57e['include'],function(_0x5277ef){return{'model':db[_0x5277ef['model']],'as':_0x5277ef['as'],'attributes':_0x5277ef[_0x8915('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8915('0xf')](function(_0x307ede){logger[_0x8915('0x10')]('ShowSmsAccount',_0x45d6cc);logger[_0x8915('0x11')](_0x8915('0x23'),_0x45d6cc,JSON[_0x8915('0x13')](_0x307ede));_0x1f4892(_0x307ede);})[_0x8915('0x19')](function(_0x23a2e1){logger[_0x8915('0x14')](_0x8915('0x23'),_0x23a2e1[_0x8915('0x16')],_0x45d6cc);_0x3a86fc(_0x42c0f8[_0x8915('0x14')](0x1f4,_0x23a2e1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 0a3bdbd..1db1435 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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 diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index e269f06..5794b46 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5eb009,_0x56d2f4){var _0x38b580=function(_0xca3fe6){while(--_0xca3fe6){_0x5eb009['push'](_0x5eb009['shift']());}};_0x38b580(++_0x56d2f4);}(_0x34e8,0x12c));var _0x834e=function(_0x156e81,_0x137628){_0x156e81=_0x156e81-0x0;var _0x1191ba=_0x34e8[_0x156e81];return _0x1191ba;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x5da61f,_0x20d5e8){var _0x516b83=function(_0x129111){while(--_0x129111){_0x5da61f['push'](_0x5da61f['shift']());}};_0x516b83(++_0x20d5e8);}(_0x008c,0x188));var _0xc008=function(_0x1e1ecf,_0x175529){_0x1e1ecf=_0x1e1ecf-0x0;var _0x52be90=_0x008c[_0x1e1ecf];return _0x52be90;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b55a373..a1433d6 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 _0x3b52=['exports','STRING','noop','TEXT','sequelize'];(function(_0x395739,_0x39a094){var _0x3c244e=function(_0x139b82){while(--_0x139b82){_0x395739['push'](_0x395739['shift']());}};_0x3c244e(++_0x39a094);}(_0x3b52,0x135));var _0x23b5=function(_0x3c9eaa,_0x496585){_0x3c9eaa=_0x3c9eaa-0x0;var _0x91d9c6=_0x3b52[_0x3c9eaa];return _0x91d9c6;};'use strict';var Sequelize=require(_0x23b5('0x0'));module[_0x23b5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x23b5('0x2')],'allowNull':![],'defaultValue':_0x23b5('0x3')},'appdata':{'type':Sequelize[_0x23b5('0x4')]()},'description':{'type':Sequelize[_0x23b5('0x2')]},'interval':{'type':Sequelize[_0x23b5('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5a13=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x192cbe,_0x3b4b43){var _0x4ce395=function(_0x5388ae){while(--_0x5388ae){_0x192cbe['push'](_0x192cbe['shift']());}};_0x4ce395(++_0x3b4b43);}(_0x5a13,0x105));var _0x35a1=function(_0x1a9a83,_0x2b0735){_0x1a9a83=_0x1a9a83-0x0;var _0x280732=_0x5a13[_0x1a9a83];return _0x280732;};'use strict';var Sequelize=require(_0x35a1('0x0'));module[_0x35a1('0x1')]={'priority':{'type':Sequelize[_0x35a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x35a1('0x3')],'allowNull':![],'defaultValue':_0x35a1('0x4')},'appdata':{'type':Sequelize[_0x35a1('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':_0x35a1('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4f13a0f..964682c 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 _0x0660=['send','index','map','SmsApplication','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','length','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack'];(function(_0x6a4fe7,_0x40a337){var _0x5e467d=function(_0x24eb0b){while(--_0x24eb0b){_0x6a4fe7['push'](_0x6a4fe7['shift']());}};_0x5e467d(++_0x40a337);}(_0x0660,0xb1));var _0x0066=function(_0x580ce7,_0x57fa40){_0x580ce7=_0x580ce7-0x0;var _0x2164e2=_0x0660[_0x580ce7];return _0x2164e2;};'use strict';var emlformat=require(_0x0066('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0066('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0066('0x2'));var moment=require(_0x0066('0x3'));var BPromise=require(_0x0066('0x4'));var Mustache=require(_0x0066('0x5'));var util=require(_0x0066('0x6'));var path=require(_0x0066('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0066('0x8'));var fs=require('fs');var fs_extra=require(_0x0066('0x9'));var _=require('lodash');var squel=require(_0x0066('0xa'));var crypto=require(_0x0066('0xb'));var jsforce=require(_0x0066('0xc'));var deskjs=require(_0x0066('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0066('0xe'));var Papa=require(_0x0066('0xf'));var Redis=require('ioredis');var authService=require(_0x0066('0x10'));var qs=require(_0x0066('0x11'));var as=require(_0x0066('0x12'));var hardwareService=require(_0x0066('0x13'));var logger=require(_0x0066('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0066('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0066('0x16'))['db'];function respondWithStatusCode(_0x2df48b,_0x18e57b){_0x18e57b=_0x18e57b||0xcc;return function(_0x5685cd){if(_0x5685cd){return _0x2df48b[_0x0066('0x17')](_0x18e57b);}return _0x2df48b['status'](_0x18e57b)[_0x0066('0x18')]();};}function respondWithResult(_0x32a91f,_0x2a9b73){_0x2a9b73=_0x2a9b73||0xc8;return function(_0x5617ed){if(_0x5617ed){return _0x32a91f[_0x0066('0x19')](_0x2a9b73)[_0x0066('0x1a')](_0x5617ed);}};}function respondWithFilteredResult(_0x5d270a,_0x2257bc){return function(_0x46b358){if(_0x46b358){var _0x375d43=typeof _0x2257bc[_0x0066('0x1b')]==='undefined'&&typeof _0x2257bc[_0x0066('0x1c')]===_0x0066('0x1d');var _0x4fb480=_0x46b358['count'];var _0x3f1d56=_0x375d43?0x0:_0x2257bc['offset'];var _0x393b28=_0x375d43?_0x46b358[_0x0066('0x1e')]:_0x2257bc[_0x0066('0x1b')]+_0x2257bc[_0x0066('0x1c')];var _0x3125cb;if(_0x393b28>=_0x4fb480){_0x393b28=_0x4fb480;_0x3125cb=0xc8;}else{_0x3125cb=0xce;}_0x5d270a[_0x0066('0x19')](_0x3125cb);return _0x5d270a[_0x0066('0x1f')](_0x0066('0x20'),_0x3f1d56+'-'+_0x393b28+'/'+_0x4fb480)[_0x0066('0x1a')](_0x46b358);}return null;};}function patchUpdates(_0x5d2249){return function(_0x4dcd4a){try{jsonpatch[_0x0066('0x21')](_0x4dcd4a,_0x5d2249,!![]);}catch(_0x22a88a){return BPromise['reject'](_0x22a88a);}return _0x4dcd4a[_0x0066('0x22')]();};}function saveUpdates(_0x2c7d73,_0xae5d1e){return function(_0x3f7a59){if(_0x3f7a59){return _0x3f7a59['update'](_0x2c7d73)[_0x0066('0x23')](function(_0x2c4b8b){return _0x2c4b8b;});}return null;};}function removeEntity(_0x55f0a1,_0x546e17){return function(_0x154bed){if(_0x154bed){return _0x154bed[_0x0066('0x24')]()[_0x0066('0x23')](function(){_0x55f0a1[_0x0066('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1414b0,_0xf05596){return function(_0x203b1a){if(!_0x203b1a){_0x1414b0[_0x0066('0x17')](0x194);}return _0x203b1a;};}function handleError(_0x22ab9d,_0x43b08e){_0x43b08e=_0x43b08e||0x1f4;return function(_0x565714){logger[_0x0066('0x25')](_0x565714[_0x0066('0x26')]);if(_0x565714['name']){delete _0x565714['name'];}_0x22ab9d[_0x0066('0x19')](_0x43b08e)[_0x0066('0x27')](_0x565714);};}exports[_0x0066('0x28')]=function(_0x1de8ca,_0x23af1e){var _0x3ca121={},_0x35f9b2={},_0x1e9b29={'count':0x0,'rows':[]};var _0x3a0316=_[_0x0066('0x29')](db[_0x0066('0x2a')][_0x0066('0x2b')],function(_0x31cf12){return{'name':_0x31cf12[_0x0066('0x2c')],'type':_0x31cf12[_0x0066('0x2d')][_0x0066('0x2e')]};});_0x35f9b2['model']=_[_0x0066('0x29')](_0x3a0316,_0x0066('0x2f'));_0x35f9b2[_0x0066('0x30')]=_[_0x0066('0x31')](_0x1de8ca[_0x0066('0x30')]);_0x35f9b2['filters']=_[_0x0066('0x32')](_0x35f9b2['model'],_0x35f9b2[_0x0066('0x30')]);_0x3ca121['attributes']=_[_0x0066('0x32')](_0x35f9b2[_0x0066('0x33')],qs[_0x0066('0x34')](_0x1de8ca['query'][_0x0066('0x34')]));_0x3ca121['attributes']=_0x3ca121['attributes']['length']?_0x3ca121[_0x0066('0x35')]:_0x35f9b2[_0x0066('0x33')];if(!_0x1de8ca[_0x0066('0x30')][_0x0066('0x36')]('nolimit')){_0x3ca121['limit']=qs[_0x0066('0x1c')](_0x1de8ca[_0x0066('0x30')][_0x0066('0x1c')]);_0x3ca121[_0x0066('0x1b')]=qs[_0x0066('0x1b')](_0x1de8ca[_0x0066('0x30')][_0x0066('0x1b')]);}_0x3ca121['order']=qs[_0x0066('0x37')](_0x1de8ca['query'][_0x0066('0x37')]);_0x3ca121[_0x0066('0x38')]=qs[_0x0066('0x39')](_[_0x0066('0x3a')](_0x1de8ca[_0x0066('0x30')],_0x35f9b2[_0x0066('0x39')]),_0x3a0316);if(_0x1de8ca[_0x0066('0x30')][_0x0066('0x3b')]){_0x3ca121['where']=_[_0x0066('0x3c')](_0x3ca121[_0x0066('0x38')],{'$or':_['map'](_0x3a0316,function(_0x5f590c){if(_0x5f590c['type']!==_0x0066('0x3d')){var _0x2951c6={};_0x2951c6[_0x5f590c[_0x0066('0x2f')]]={'$like':'%'+_0x1de8ca[_0x0066('0x30')][_0x0066('0x3b')]+'%'};return _0x2951c6;}})});}_0x3ca121=_['merge']({},_0x3ca121,_0x1de8ca[_0x0066('0x3e')]);var _0x371fcf={'where':_0x3ca121[_0x0066('0x38')]};return db[_0x0066('0x2a')]['count'](_0x371fcf)['then'](function(_0x3c58f0){_0x1e9b29['count']=_0x3c58f0;if(_0x1de8ca[_0x0066('0x30')][_0x0066('0x3f')]){_0x3ca121[_0x0066('0x40')]=[{'all':!![]}];}return db[_0x0066('0x2a')][_0x0066('0x41')](_0x3ca121);})[_0x0066('0x23')](function(_0x286786){_0x1e9b29['rows']=_0x286786;return _0x1e9b29;})[_0x0066('0x23')](respondWithFilteredResult(_0x23af1e,_0x3ca121))['catch'](handleError(_0x23af1e,null));};exports['show']=function(_0x32b895,_0x31b0d3){var _0x2ca28d={'raw':!![],'where':{'id':_0x32b895[_0x0066('0x42')]['id']}},_0x4032c7={};_0x4032c7['model']=_[_0x0066('0x31')](db[_0x0066('0x2a')][_0x0066('0x2b')]);_0x4032c7[_0x0066('0x30')]=_[_0x0066('0x31')](_0x32b895[_0x0066('0x30')]);_0x4032c7[_0x0066('0x39')]=_[_0x0066('0x32')](_0x4032c7[_0x0066('0x33')],_0x4032c7[_0x0066('0x30')]);_0x2ca28d['attributes']=_['intersection'](_0x4032c7[_0x0066('0x33')],qs['fields'](_0x32b895['query']['fields']));_0x2ca28d[_0x0066('0x35')]=_0x2ca28d[_0x0066('0x35')][_0x0066('0x43')]?_0x2ca28d[_0x0066('0x35')]:_0x4032c7[_0x0066('0x33')];if(_0x32b895[_0x0066('0x30')]['includeAll']){_0x2ca28d[_0x0066('0x40')]=[{'all':!![]}];}_0x2ca28d=_[_0x0066('0x3c')]({},_0x2ca28d,_0x32b895[_0x0066('0x3e')]);return db[_0x0066('0x2a')][_0x0066('0x44')](_0x2ca28d)[_0x0066('0x23')](handleEntityNotFound(_0x31b0d3,null))[_0x0066('0x23')](respondWithResult(_0x31b0d3,null))[_0x0066('0x45')](handleError(_0x31b0d3,null));};exports[_0x0066('0x46')]=function(_0x2634c8,_0x29d7b7){return db[_0x0066('0x2a')]['create'](_0x2634c8[_0x0066('0x47')],{})[_0x0066('0x23')](respondWithResult(_0x29d7b7,0xc9))[_0x0066('0x45')](handleError(_0x29d7b7,null));};exports['update']=function(_0x2d3c5f,_0x1bcf08){if(_0x2d3c5f[_0x0066('0x47')]['id']){delete _0x2d3c5f[_0x0066('0x47')]['id'];}return db[_0x0066('0x2a')]['find']({'where':{'id':_0x2d3c5f[_0x0066('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bcf08,null))[_0x0066('0x23')](saveUpdates(_0x2d3c5f['body'],null))['then'](respondWithResult(_0x1bcf08,null))[_0x0066('0x45')](handleError(_0x1bcf08,null));};exports[_0x0066('0x24')]=function(_0x460e55,_0x1d5eb2){return db[_0x0066('0x2a')][_0x0066('0x44')]({'where':{'id':_0x460e55['params']['id']}})[_0x0066('0x23')](handleEntityNotFound(_0x1d5eb2,null))[_0x0066('0x23')](removeEntity(_0x1d5eb2,null))[_0x0066('0x45')](handleError(_0x1d5eb2,null));}; \ No newline at end of file +var _0x5ae8=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x5ae8,0xc7));var _0x85ae=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0x5ae8[_0x49ab20];return _0x3c10b4;};'use strict';var emlformat=require(_0x85ae('0x0'));var rimraf=require(_0x85ae('0x1'));var zipdir=require(_0x85ae('0x2'));var jsonpatch=require(_0x85ae('0x3'));var rp=require(_0x85ae('0x4'));var moment=require(_0x85ae('0x5'));var BPromise=require(_0x85ae('0x6'));var Mustache=require('mustache');var util=require(_0x85ae('0x7'));var path=require(_0x85ae('0x8'));var sox=require('sox');var csv=require(_0x85ae('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85ae('0xa'));var _=require(_0x85ae('0xb'));var squel=require(_0x85ae('0xc'));var crypto=require(_0x85ae('0xd'));var jsforce=require(_0x85ae('0xe'));var deskjs=require(_0x85ae('0xf'));var toCsv=require(_0x85ae('0x9'));var querystring=require(_0x85ae('0x10'));var Papa=require(_0x85ae('0x11'));var Redis=require(_0x85ae('0x12'));var authService=require(_0x85ae('0x13'));var qs=require(_0x85ae('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85ae('0x15'));var logger=require(_0x85ae('0x16'))(_0x85ae('0x17'));var utils=require(_0x85ae('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x85ae('0x19'));var db=require(_0x85ae('0x1a'))['db'];function respondWithStatusCode(_0x10d156,_0x460673){_0x460673=_0x460673||0xcc;return function(_0x326a90){if(_0x326a90){return _0x10d156[_0x85ae('0x1b')](_0x460673);}return _0x10d156[_0x85ae('0x1c')](_0x460673)[_0x85ae('0x1d')]();};}function respondWithResult(_0x255ad7,_0x58ad88){_0x58ad88=_0x58ad88||0xc8;return function(_0x5aab31){if(_0x5aab31){return _0x255ad7['status'](_0x58ad88)[_0x85ae('0x1e')](_0x5aab31);}};}function respondWithFilteredResult(_0x15e15d,_0x397fd1){return function(_0x27167f){if(_0x27167f){var _0x497ba3=typeof _0x397fd1[_0x85ae('0x1f')]===_0x85ae('0x20')&&typeof _0x397fd1[_0x85ae('0x21')]==='undefined';var _0x40dd34=_0x27167f[_0x85ae('0x22')];var _0xaba82d=_0x497ba3?0x0:_0x397fd1[_0x85ae('0x1f')];var _0x3a19d0=_0x497ba3?_0x27167f[_0x85ae('0x22')]:_0x397fd1[_0x85ae('0x1f')]+_0x397fd1[_0x85ae('0x21')];var _0x514cbb;if(_0x3a19d0>=_0x40dd34){_0x3a19d0=_0x40dd34;_0x514cbb=0xc8;}else{_0x514cbb=0xce;}_0x15e15d['status'](_0x514cbb);return _0x15e15d[_0x85ae('0x23')](_0x85ae('0x24'),_0xaba82d+'-'+_0x3a19d0+'/'+_0x40dd34)['json'](_0x27167f);}return null;};}function patchUpdates(_0x10cb9a){return function(_0x519d83){try{jsonpatch[_0x85ae('0x25')](_0x519d83,_0x10cb9a,!![]);}catch(_0x451490){return BPromise[_0x85ae('0x26')](_0x451490);}return _0x519d83['save']();};}function saveUpdates(_0x45798b,_0xd130fb){return function(_0x47de3f){if(_0x47de3f){return _0x47de3f[_0x85ae('0x27')](_0x45798b)[_0x85ae('0x28')](function(_0x190e59){return _0x190e59;});}return null;};}function removeEntity(_0x5aec36,_0x32d2f2){return function(_0x540a91){if(_0x540a91){return _0x540a91[_0x85ae('0x29')]()['then'](function(){_0x5aec36[_0x85ae('0x1c')](0xcc)[_0x85ae('0x1d')]();});}};}function handleEntityNotFound(_0x902179,_0xdeacaf){return function(_0x49eb3d){if(!_0x49eb3d){_0x902179[_0x85ae('0x1b')](0x194);}return _0x49eb3d;};}function handleError(_0x4e2e26,_0x19097d){_0x19097d=_0x19097d||0x1f4;return function(_0x20fa3a){logger[_0x85ae('0x2a')](_0x20fa3a[_0x85ae('0x2b')]);if(_0x20fa3a[_0x85ae('0x2c')]){delete _0x20fa3a[_0x85ae('0x2c')];}_0x4e2e26[_0x85ae('0x1c')](_0x19097d)[_0x85ae('0x2d')](_0x20fa3a);};}exports[_0x85ae('0x2e')]=function(_0x537b81,_0x21535c){var _0xe0c528={},_0xcc87fe={},_0x203230={'count':0x0,'rows':[]};var _0x5d1e8a=_[_0x85ae('0x2f')](db[_0x85ae('0x30')]['rawAttributes'],function(_0xf8fb18){return{'name':_0xf8fb18['fieldName'],'type':_0xf8fb18['type'][_0x85ae('0x31')]};});_0xcc87fe[_0x85ae('0x32')]=_['map'](_0x5d1e8a,_0x85ae('0x2c'));_0xcc87fe[_0x85ae('0x33')]=_['keys'](_0x537b81[_0x85ae('0x33')]);_0xcc87fe['filters']=_[_0x85ae('0x34')](_0xcc87fe[_0x85ae('0x32')],_0xcc87fe['query']);_0xe0c528[_0x85ae('0x35')]=_[_0x85ae('0x34')](_0xcc87fe[_0x85ae('0x32')],qs[_0x85ae('0x36')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x36')]));_0xe0c528[_0x85ae('0x35')]=_0xe0c528['attributes'][_0x85ae('0x37')]?_0xe0c528[_0x85ae('0x35')]:_0xcc87fe['model'];if(!_0x537b81[_0x85ae('0x33')]['hasOwnProperty']('nolimit')){_0xe0c528[_0x85ae('0x21')]=qs[_0x85ae('0x21')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x21')]);_0xe0c528[_0x85ae('0x1f')]=qs[_0x85ae('0x1f')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x1f')]);}_0xe0c528[_0x85ae('0x38')]=qs[_0x85ae('0x39')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x39')]);_0xe0c528[_0x85ae('0x3a')]=qs[_0x85ae('0x3b')](_[_0x85ae('0x3c')](_0x537b81[_0x85ae('0x33')],_0xcc87fe[_0x85ae('0x3b')]),_0x5d1e8a);if(_0x537b81[_0x85ae('0x33')][_0x85ae('0x3d')]){_0xe0c528['where']=_['merge'](_0xe0c528[_0x85ae('0x3a')],{'$or':_[_0x85ae('0x2f')](_0x5d1e8a,function(_0x3e06d4){if(_0x3e06d4[_0x85ae('0x3e')]!==_0x85ae('0x3f')){var _0x4e1144={};_0x4e1144[_0x3e06d4['name']]={'$like':'%'+_0x537b81[_0x85ae('0x33')][_0x85ae('0x3d')]+'%'};return _0x4e1144;}})});}_0xe0c528=_[_0x85ae('0x40')]({},_0xe0c528,_0x537b81[_0x85ae('0x41')]);var _0x3a0e64={'where':_0xe0c528['where']};return db['SmsApplication'][_0x85ae('0x22')](_0x3a0e64)[_0x85ae('0x28')](function(_0x4e4fc0){_0x203230['count']=_0x4e4fc0;if(_0x537b81[_0x85ae('0x33')]['includeAll']){_0xe0c528[_0x85ae('0x42')]=[{'all':!![]}];}return db[_0x85ae('0x30')][_0x85ae('0x43')](_0xe0c528);})[_0x85ae('0x28')](function(_0x356ddc){_0x203230[_0x85ae('0x44')]=_0x356ddc;return _0x203230;})[_0x85ae('0x28')](respondWithFilteredResult(_0x21535c,_0xe0c528))[_0x85ae('0x45')](handleError(_0x21535c,null));};exports['show']=function(_0x9fe81a,_0x216efd){var _0x12ce0c={'raw':!![],'where':{'id':_0x9fe81a[_0x85ae('0x46')]['id']}},_0x2c4202={};_0x2c4202['model']=_[_0x85ae('0x47')](db[_0x85ae('0x30')][_0x85ae('0x48')]);_0x2c4202['query']=_[_0x85ae('0x47')](_0x9fe81a[_0x85ae('0x33')]);_0x2c4202[_0x85ae('0x3b')]=_[_0x85ae('0x34')](_0x2c4202['model'],_0x2c4202[_0x85ae('0x33')]);_0x12ce0c[_0x85ae('0x35')]=_[_0x85ae('0x34')](_0x2c4202['model'],qs[_0x85ae('0x36')](_0x9fe81a[_0x85ae('0x33')][_0x85ae('0x36')]));_0x12ce0c[_0x85ae('0x35')]=_0x12ce0c[_0x85ae('0x35')]['length']?_0x12ce0c[_0x85ae('0x35')]:_0x2c4202[_0x85ae('0x32')];if(_0x9fe81a[_0x85ae('0x33')][_0x85ae('0x49')]){_0x12ce0c[_0x85ae('0x42')]=[{'all':!![]}];}_0x12ce0c=_[_0x85ae('0x40')]({},_0x12ce0c,_0x9fe81a['options']);return db['SmsApplication'][_0x85ae('0x4a')](_0x12ce0c)[_0x85ae('0x28')](handleEntityNotFound(_0x216efd,null))[_0x85ae('0x28')](respondWithResult(_0x216efd,null))[_0x85ae('0x45')](handleError(_0x216efd,null));};exports[_0x85ae('0x4b')]=function(_0x1c1b09,_0x47be6e){return db[_0x85ae('0x30')][_0x85ae('0x4b')](_0x1c1b09['body'],{})['then'](respondWithResult(_0x47be6e,0xc9))[_0x85ae('0x45')](handleError(_0x47be6e,null));};exports[_0x85ae('0x27')]=function(_0x3a919d,_0x3b1bff){if(_0x3a919d[_0x85ae('0x4c')]['id']){delete _0x3a919d['body']['id'];}return db[_0x85ae('0x30')][_0x85ae('0x4a')]({'where':{'id':_0x3a919d[_0x85ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b1bff,null))[_0x85ae('0x28')](saveUpdates(_0x3a919d['body'],null))[_0x85ae('0x28')](respondWithResult(_0x3b1bff,null))[_0x85ae('0x45')](handleError(_0x3b1bff,null));};exports[_0x85ae('0x29')]=function(_0x47be9f,_0xb37d8f){return db[_0x85ae('0x30')][_0x85ae('0x4a')]({'where':{'id':_0x47be9f['params']['id']}})[_0x85ae('0x28')](handleEntityNotFound(_0xb37d8f,null))[_0x85ae('0x28')](removeEntity(_0xb37d8f,null))[_0x85ae('0x45')](handleError(_0xb37d8f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index f856fce..294725e 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 _0x7d9f=['define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x1614c2,_0x1fccfc){var _0x182c4c=function(_0x19c361){while(--_0x19c361){_0x1614c2['push'](_0x1614c2['shift']());}};_0x182c4c(++_0x1fccfc);}(_0x7d9f,0x135));var _0xf7d9=function(_0x1598fb,_0x29645f){_0x1598fb=_0x1598fb-0x0;var _0x4fae38=_0x7d9f[_0x1598fb];return _0x4fae38;};'use strict';var _=require('lodash');var util=require(_0xf7d9('0x0'));var logger=require(_0xf7d9('0x1'))(_0xf7d9('0x2'));var moment=require(_0xf7d9('0x3'));var BPromise=require(_0xf7d9('0x4'));var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module[_0xf7d9('0xa')]=function(_0x273379,_0x43889c){return _0x273379[_0xf7d9('0xb')](_0xf7d9('0xc'),attributes,{'tableName':_0xf7d9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7d9('0xe'),'collate':_0xf7d9('0xf')});}; \ No newline at end of file +var _0x853c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1022ac,_0x55ad8b){var _0x451d24=function(_0x142604){while(--_0x142604){_0x1022ac['push'](_0x1022ac['shift']());}};_0x451d24(++_0x55ad8b);}(_0x853c,0x1a1));var _0xc853=function(_0x9836bf,_0x8bfc0f){_0x9836bf=_0x9836bf-0x0;var _0x284080=_0x853c[_0x9836bf];return _0x284080;};'use strict';var _=require(_0xc853('0x0'));var util=require('util');var logger=require(_0xc853('0x1'))(_0xc853('0x2'));var moment=require(_0xc853('0x3'));var BPromise=require(_0xc853('0x4'));var rp=require(_0xc853('0x5'));var fs=require('fs');var path=require(_0xc853('0x6'));var rimraf=require(_0xc853('0x7'));var config=require(_0xc853('0x8'));var attributes=require(_0xc853('0x9'));module[_0xc853('0xa')]=function(_0x257e3a,_0x4f1dd0){return _0x257e3a[_0xc853('0xb')]('SmsApplication',attributes,{'tableName':_0xc853('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc853('0xd'),'collate':_0xc853('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index b60db3c..533b797 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 _0xc74c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xc74c,0x163));var _0xcc74=function(_0x5c7a6f,_0x2e0f25){_0x5c7a6f=_0x5c7a6f-0x0;var _0x51b56a=_0xc74c[_0x5c7a6f];return _0x51b56a;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('SmsApplication,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});} \ No newline at end of file +var _0x0c8d=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0x58879c,_0x5a05a4){var _0x1d51e7=function(_0x2c473b){while(--_0x2c473b){_0x58879c['push'](_0x58879c['shift']());}};_0x1d51e7(++_0x5a05a4);}(_0x0c8d,0x79));var _0xd0c8=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0c8d[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d1c1,_0x5f0027,_0x415439){return new BPromise(function(_0x34e3d5,_0x2f6200){return client[_0xd0c8('0x8')](_0x16d1c1,_0x415439)[_0xd0c8('0x9')](function(_0x5678f9){logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));logger[_0xd0c8('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5f0027,'request\x20sent',JSON[_0xd0c8('0xe')](_0x5678f9));if(_0x5678f9[_0xd0c8('0xf')]){if(_0x5678f9['error']['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5f0027,_0x5678f9['error'][_0xd0c8('0x10')]);return _0x2f6200(_0x5678f9[_0xd0c8('0xf')]['message']);}logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);return _0x34e3d5(_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);}else{logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));_0x34e3d5(_0x5678f9[_0xd0c8('0x11')][_0xd0c8('0x10')]);}})[_0xd0c8('0x12')](function(_0x58c3e0){logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x58c3e0);_0x2f6200(_0x58c3e0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 306bd1e..0f20f51 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 _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20a4c5,_0x43f6f1){var _0x1cac1a=function(_0x2c6f08){while(--_0x2c6f08){_0x20a4c5['push'](_0x20a4c5['shift']());}};_0x1cac1a(++_0x43f6f1);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x18a298,_0x5c8ea0){var _0x2ba08c=function(_0x4bd3c2){while(--_0x4bd3c2){_0x18a298['push'](_0x18a298['shift']());}};_0x2ba08c(++_0x5c8ea0);}(_0x955f,0x1eb));var _0xf955=function(_0x3b15d2,_0x5cd824){_0x3b15d2=_0x3b15d2-0x0;var _0x2fd235=_0x955f[_0x3b15d2];return _0x2fd235;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 99f7908..806dbd4 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 _0x2caf=['out','BOOLEAN','STRING','DATE','ENUM'];(function(_0x347de1,_0x2feeaa){var _0x18ad77=function(_0x2a335e){while(--_0x2a335e){_0x347de1['push'](_0x347de1['shift']());}};_0x18ad77(++_0x2feeaa);}(_0x2caf,0x6a));var _0xf2ca=function(_0x359365,_0x4119c4){_0x359365=_0x359365-0x0;var _0x5dea1=_0x2caf[_0x359365];return _0x5dea1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xf2ca('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf2ca('0x1')]},'secondDisposition':{'type':Sequelize[_0xf2ca('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf2ca('0x1')]},'note':{'type':Sequelize[_0xf2ca('0x1')]},'phone':{'type':Sequelize[_0xf2ca('0x1')]},'read1stAt':{'type':Sequelize[_0xf2ca('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf2ca('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf2ca('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf2ca('0x3')]('in',_0xf2ca('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7e02=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3987cf,_0x3ebe4d){var _0x1202e8=function(_0x108ebc){while(--_0x108ebc){_0x3987cf['push'](_0x3987cf['shift']());}};_0x1202e8(++_0x3ebe4d);}(_0x7e02,0x71));var _0x27e0=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0x7e02[_0x19921b];return _0x273545;};'use strict';var Sequelize=require(_0x27e0('0x0'));var moment=require(_0x27e0('0x1'));module[_0x27e0('0x2')]={'closed':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x27e0('0x4')]},'disposition':{'type':Sequelize[_0x27e0('0x5')]},'secondDisposition':{'type':Sequelize[_0x27e0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x27e0('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x27e0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x27e0('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 461789a..e5de74e 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 _0x0ea2=['user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','o.internal','groupBy','all','rows','catch','show','params','includeAll','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','smsInteractionTags:save','removeTags','download','unix','tmp','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','direction','secret','Account','fullname','mkdirSync','Sms','Owner','N.A.','createdAt','closed','System','firstName','out','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','TagIds','split','Tags','push','then','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId'];(function(_0x83736e,_0x50ab9a){var _0x2db4f6=function(_0x2c7617){while(--_0x2c7617){_0x83736e['push'](_0x83736e['shift']());}};_0x2db4f6(++_0x50ab9a);}(_0x0ea2,0x189));var _0x20ea=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x0ea2[_0x3b1b23];return _0x1efc85;};'use strict';var emlformat=require(_0x20ea('0x0'));var rimraf=require(_0x20ea('0x1'));var zipdir=require(_0x20ea('0x2'));var jsonpatch=require(_0x20ea('0x3'));var rp=require('request-promise');var moment=require(_0x20ea('0x4'));var BPromise=require(_0x20ea('0x5'));var Mustache=require(_0x20ea('0x6'));var util=require(_0x20ea('0x7'));var path=require(_0x20ea('0x8'));var sox=require(_0x20ea('0x9'));var csv=require(_0x20ea('0xa'));var ejs=require(_0x20ea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20ea('0xc'));var squel=require(_0x20ea('0xd'));var crypto=require('crypto');var jsforce=require(_0x20ea('0xe'));var deskjs=require(_0x20ea('0xf'));var toCsv=require('to-csv');var querystring=require(_0x20ea('0x10'));var Papa=require(_0x20ea('0x11'));var Redis=require(_0x20ea('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x20ea('0x13'));var pdf=require(_0x20ea('0x14'));var hardwareService=require(_0x20ea('0x15'));var logger=require('../../config/logger')(_0x20ea('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x20ea('0x17'));var db=require(_0x20ea('0x18'))['db'];config[_0x20ea('0x19')]=_[_0x20ea('0x1a')](config[_0x20ea('0x19')],{'host':_0x20ea('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20ea('0x1c'))[_0x20ea('0x1d')](socket);function respondWithStatusCode(_0x3bc1aa,_0x831704){_0x831704=_0x831704||0xcc;return function(_0x5c127a){if(_0x5c127a){return _0x3bc1aa[_0x20ea('0x1e')](_0x831704);}return _0x3bc1aa[_0x20ea('0x1f')](_0x831704)[_0x20ea('0x20')]();};}function respondWithResult(_0x29a79f,_0x456266){_0x456266=_0x456266||0xc8;return function(_0x2a6a66){if(_0x2a6a66){return _0x29a79f[_0x20ea('0x1f')](_0x456266)[_0x20ea('0x21')](_0x2a6a66);}};}function respondWithFilteredResult(_0x4ee9bd,_0x2a87a0){return function(_0x4fb5e4){if(_0x4fb5e4){var _0xeb0888=typeof _0x2a87a0['offset']===_0x20ea('0x22')&&typeof _0x2a87a0[_0x20ea('0x23')]===_0x20ea('0x22');var _0x24ba01=_0x4fb5e4[_0x20ea('0x24')];var _0x3688cf=_0xeb0888?0x0:_0x2a87a0[_0x20ea('0x25')];var _0x37f802=_0xeb0888?_0x4fb5e4[_0x20ea('0x24')]:_0x2a87a0[_0x20ea('0x25')]+_0x2a87a0['limit'];var _0xecc372;if(_0x37f802>=_0x24ba01){_0x37f802=_0x24ba01;_0xecc372=0xc8;}else{_0xecc372=0xce;}_0x4ee9bd['status'](_0xecc372);return _0x4ee9bd[_0x20ea('0x26')](_0x20ea('0x27'),_0x3688cf+'-'+_0x37f802+'/'+_0x24ba01)[_0x20ea('0x21')](_0x4fb5e4);}return null;};}function patchUpdates(_0x46a533){return function(_0x1593d2){try{jsonpatch[_0x20ea('0x28')](_0x1593d2,_0x46a533,!![]);}catch(_0x1a8ff6){return BPromise[_0x20ea('0x29')](_0x1a8ff6);}return _0x1593d2[_0x20ea('0x2a')]();};}function saveUpdates(_0x1601e8,_0x14e6ca){return function(_0x51a855){if(_0x51a855){return _0x51a855[_0x20ea('0x2b')](_0x1601e8)['then'](function(_0x40db28){return _0x40db28;});}return null;};}function removeEntity(_0x3ee9cb,_0x39fdfe){return function(_0x1dbf1a){if(_0x1dbf1a){return _0x1dbf1a[_0x20ea('0x2c')]()['then'](function(){_0x3ee9cb[_0x20ea('0x1f')](0xcc)[_0x20ea('0x20')]();});}};}function handleEntityNotFound(_0x1e1a80,_0xe81aa0){return function(_0x5e9a64){if(!_0x5e9a64){_0x1e1a80[_0x20ea('0x1e')](0x194);}return _0x5e9a64;};}function handleError(_0x4f4810,_0x1550d1){_0x1550d1=_0x1550d1||0x1f4;return function(_0x1a0e0b){logger['error'](_0x1a0e0b[_0x20ea('0x2d')]);if(_0x1a0e0b['name']){delete _0x1a0e0b[_0x20ea('0x2e')];}_0x4f4810[_0x20ea('0x1f')](_0x1550d1)[_0x20ea('0x2f')](_0x1a0e0b);};}function getInteractionUsers(_0x1a2957,_0x170797){return new BPromise(function(_0x1a6d93,_0x5498a6){try{if(_0x170797[_0x1a2957['id']]){_0x1a2957['Users']=_[_0x20ea('0x30')](_0x170797[_0x1a2957['id']],function(_0x5c669d){return{'id':_0x5c669d['id'],'fullname':_0x5c669d['fullname']};});}}catch(_0x4b112f){_0x5498a6(_0x4b112f);}_0x1a6d93(_0x1a2957);});}function getInteractionTags(_0x217cf7,_0x29204a){return new BPromise(function(_0x1ef8ba,_0x7bc0f1){try{if(_0x217cf7[_0x20ea('0x31')]){_0x217cf7['Tags']=[];_0x217cf7[_0x20ea('0x31')][_0x20ea('0x32')](',')['forEach'](function(_0x229031){_0x217cf7[_0x20ea('0x33')][_0x20ea('0x34')](_0x29204a[_0x229031]);});}delete _0x217cf7[_0x20ea('0x31')];}catch(_0x216fe5){_0x7bc0f1(_0x216fe5);}_0x1ef8ba(_0x217cf7);});}function updateSmsInteraction(_0x47a140,_0x13511f,_0x3c9f46){return new BPromise(function(_0x537682,_0x4fabe8){return getInteractionUsers(_0x47a140,_0x3c9f46)['then'](function(_0x412d04){return getInteractionTags(_0x412d04,_0x13511f);})[_0x20ea('0x35')](function(_0x498ae6){_0x537682(_0x498ae6);})['catch'](function(_0x1a7e85){_0x4fabe8(_0x1a7e85);});});}exports[_0x20ea('0x36')]=function(_0x3de48a,_0x433cbc){var _0x3688e6={},_0x4dc400={},_0x143ba1={'count':0x0,'rows':[]};var _0x3ff73f=_[_0x20ea('0x30')](db[_0x20ea('0x37')][_0x20ea('0x38')],function(_0xe6c059){return{'name':_0xe6c059[_0x20ea('0x39')],'type':_0xe6c059[_0x20ea('0x3a')][_0x20ea('0x3b')]};});_0x4dc400[_0x20ea('0x3c')]=_['map'](_0x3ff73f,_0x20ea('0x2e'));_0x4dc400['query']=_[_0x20ea('0x3d')](_0x3de48a[_0x20ea('0x3e')]);_0x4dc400['filters']=_[_0x20ea('0x3f')](_0x4dc400[_0x20ea('0x3c')],_0x4dc400[_0x20ea('0x3e')]);_0x3688e6[_0x20ea('0x40')]=_[_0x20ea('0x3f')](_0x4dc400[_0x20ea('0x3c')],qs[_0x20ea('0x41')](_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x41')]));_0x3688e6[_0x20ea('0x40')]=_0x3688e6[_0x20ea('0x40')][_0x20ea('0x42')]?_0x3688e6[_0x20ea('0x40')]:_0x4dc400[_0x20ea('0x3c')];if(!_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x43')](_0x20ea('0x44'))){_0x3688e6[_0x20ea('0x23')]=qs[_0x20ea('0x23')](_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x23')]);_0x3688e6[_0x20ea('0x25')]=qs[_0x20ea('0x25')](_0x3de48a['query'][_0x20ea('0x25')]);}_0x3688e6[_0x20ea('0x45')]=qs[_0x20ea('0x46')](_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x46')]);_0x3688e6[_0x20ea('0x47')]=qs[_0x20ea('0x48')](_[_0x20ea('0x49')](_0x3de48a[_0x20ea('0x3e')],_0x4dc400[_0x20ea('0x48')]),_0x3ff73f);var _0x1fc9e1=[];var _0x354ce2=squel[_0x20ea('0x4a')]()[_0x20ea('0x4b')]('id')[_0x20ea('0x4b')](_0x20ea('0x2e'))[_0x20ea('0x4b')](_0x20ea('0x4c'))[_0x20ea('0x4d')](_0x20ea('0x4e'));var _0x448f58=squel[_0x20ea('0x4a')]()[_0x20ea('0x4b')]('u.id')['field'](_0x20ea('0x4f'))[_0x20ea('0x4b')](_0x20ea('0x50'))[_0x20ea('0x4d')](_0x20ea('0x51'),'ui')[_0x20ea('0x52')](_0x20ea('0x53'),'u',_0x20ea('0x54'));var _0x39789f=squel['select']()[_0x20ea('0x4d')](_0x20ea('0x55'),'i')[_0x20ea('0x52')](_0x20ea('0x56'),'c',_0x20ea('0x57'))[_0x20ea('0x52')](_0x20ea('0x53'),'o',_0x20ea('0x58'))[_0x20ea('0x52')]('sms_accounts','a',_0x20ea('0x59'))['left_join']('sms_messages','me',_0x20ea('0x5a'))[_0x20ea('0x52')](_0x20ea('0x5b'),'it',_0x20ea('0x5c'))[_0x20ea('0x52')](_0x20ea('0x4e'),'t',_0x20ea('0x5d'));var _0x4f6453=squel[_0x20ea('0x5e')]();var _0x2f67d3=[];var _0x1d6bc5=squel[_0x20ea('0x5e')]();var _0x1fc7f0;if(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x5f')]){_0x1fc7f0=as[_0x20ea('0x60')](_0x3de48a[_0x20ea('0x3e')]['search']);var _0x378bc0=_0x1fc7f0['sqlOperator'];for(var _0x448344=0x0;_0x448344<_0x1fc7f0[_0x20ea('0x61')][_0x20ea('0x42')];_0x448344++){var _0x34c7d6=_0x1fc7f0[_0x20ea('0x61')][_0x448344];var _0x4faeea='i';var _0x342fc9=_[_0x20ea('0x62')](_0x3ff73f,['name',_0x34c7d6[_0x20ea('0x4b')]]);if(!_0x342fc9){switch(_0x34c7d6[_0x20ea('0x4b')]){case _0x20ea('0x63'):if(_0x34c7d6['value']==0x1){_0x39789f[_0x20ea('0x64')]('`'+_0x34c7d6[_0x20ea('0x4b')]+_0x20ea('0x65'));}else{_0x39789f[_0x20ea('0x64')]('`'+_0x34c7d6['field']+_0x20ea('0x66'));}break;case _0x20ea('0x67'):if(_0x34c7d6[_0x20ea('0x68')]===_0x20ea('0x69')){if(_0x34c7d6[_0x20ea('0x6a')]['split']('\x20')[_0x20ea('0x42')]>0x1){_0x4f6453[_0x378bc0](_0x20ea('0x6b'),qs[_0x20ea('0x6c')](_0x34c7d6[_0x20ea('0x6a')]),null);}else{var _0x3c9f5f='%'+_0x34c7d6[_0x20ea('0x6a')]+'%';_0x4f6453[_0x378bc0](_0x20ea('0x6d'),_0x3c9f5f,_0x3c9f5f,_0x3c9f5f);}}else{_0x342fc9=_[_0x20ea('0x62')](_0x3ff73f,[_0x20ea('0x2e'),'ContactId']);_0x34c7d6[_0x20ea('0x4b')]=_0x20ea('0x6e');_0x116eb3=as[_0x20ea('0x6f')](_0x4faeea,_0x342fc9[_0x20ea('0x3a')],_0x34c7d6);_0x4f6453[_0x378bc0](_0x116eb3[_0x20ea('0x70')],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x71')],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x20')]);}break;case _0x20ea('0x72'):var _0x36f1a1=_0x34c7d6['value']['split'](',')[_0x20ea('0x30')](function(_0x4e84f5){return Number(_0x4e84f5);});_0x36f1a1[_0x20ea('0x73')](function(_0x1d397d){_0x1d6bc5['or'](_0x20ea('0x74'),'%,'+_0x1d397d+',%');});_0x2f67d3=_['union'](_0x2f67d3,_0x36f1a1);break;case _0x20ea('0x75'):if(_0x34c7d6[_0x20ea('0x68')]===_0x20ea('0x69')){_0x4f6453[_0x378bc0](_0x20ea('0x76'),'%'+_0x34c7d6[_0x20ea('0x6a')]+'%',null);}else{_0x342fc9=_[_0x20ea('0x62')](_0x3ff73f,[_0x20ea('0x2e'),_0x20ea('0x77')]);_0x34c7d6[_0x20ea('0x4b')]='UserId';_0x116eb3=as[_0x20ea('0x6f')](_0x4faeea,_0x342fc9[_0x20ea('0x3a')],_0x34c7d6);_0x4f6453[_0x378bc0](_0x116eb3[_0x20ea('0x70')],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x71')],_0x116eb3['value'][_0x20ea('0x20')]);}break;case _0x20ea('0x78'):_0x116eb3=as[_0x20ea('0x6f')]('me',null,_0x34c7d6);_0x4f6453[_0x378bc0](_0x116eb3['text'],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x71')],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x20')]);break;}}else{var _0x116eb3=as[_0x20ea('0x6f')](_0x4faeea,_0x342fc9[_0x20ea('0x3a')],_0x34c7d6);_0x4f6453[_0x378bc0](_0x116eb3[_0x20ea('0x70')],_0x116eb3[_0x20ea('0x6a')][_0x20ea('0x71')],_0x116eb3[_0x20ea('0x6a')]['end']);}}}else{var _0x2cafbe=_(_0x3de48a[_0x20ea('0x3e')])['keys']()[_0x20ea('0x30')](function(_0x4d4776){return _[_0x20ea('0x79')](_0x3ff73f,['name',_0x4d4776])?_0x4d4776:undefined;})[_0x20ea('0x7a')]()[_0x20ea('0x6a')]();if(!_[_0x20ea('0x7b')](_0x2cafbe)){_0x2cafbe[_0x20ea('0x73')](function(_0x3e41a1){if(_0x3e41a1===_0x20ea('0x7c')){_0x39789f[_0x20ea('0x47')](_0x20ea('0x7d'),[][_0x20ea('0x7e')](_0x3de48a['query'][_0x3e41a1]));}else if(_0x3e41a1==='createdAt'){var _0x16176f=JSON['parse'](_0x3de48a[_0x20ea('0x3e')][_0x3e41a1])[_0x20ea('0x7f')];var _0x4758f7=JSON['parse'](_0x3de48a['query'][_0x3e41a1])[_0x20ea('0x80')];_0x39789f['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16176f,_0x4758f7);}else{if(_0x3de48a[_0x20ea('0x3e')][_0x3e41a1]===_0x20ea('0x81')){_0x39789f[_0x20ea('0x47')]('i.'+_0x3e41a1+'\x20IS\x20NULL');}else{_0x39789f[_0x20ea('0x47')]('i.'+_0x3e41a1+_0x20ea('0x82'),_0x3de48a['query'][_0x3e41a1]);}}});}if(_0x3de48a['query'][_0x20ea('0x83')]){if(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x83')]==0x1){_0x39789f['having'](_0x20ea('0x84'));}else{_0x39789f[_0x20ea('0x64')](_0x20ea('0x85'));}}if(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x86')]){_0x2f67d3=_[_0x20ea('0x87')](_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x86')])?_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x86')]:new Array(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x86')]);_0x2f67d3[_0x20ea('0x73')](function(_0xf6cf44){_0x1d6bc5['or'](_0x20ea('0x74'),'%,'+_0xf6cf44+',%');});}if(_0x3de48a['query']['filter']){var _0x583a92=_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x88')]['replace']('\x5c','\x5c\x5c')[_0x20ea('0x89')](/'/g,'\x27\x27');if(qs[_0x20ea('0x8a')](_0x583a92)){_0x4f6453['or'](_0x20ea('0x8b'),_0x583a92+'%')['or'](_0x20ea('0x8c'),_0x583a92+'%');}else{_0x4f6453['or'](_0x20ea('0x8d'),qs['getFullTextValue'](_0x583a92))['or'](_0x20ea('0x8e'),_0x583a92+'%');}}}_0x39789f[_0x20ea('0x47')](_0x4f6453);_0x39789f[_0x20ea('0x8f')]('i.id');var _0x30ba34={'type':db['Sequelize'][_0x20ea('0x90')][_0x20ea('0x91')],'raw':!![]};var _0x20ee4c=_0x39789f[_0x20ea('0x92')]();_0x20ee4c[_0x20ea('0x4b')](_0x20ea('0x93'));_0x20ee4c[_0x20ea('0x4b')](_0x20ea('0x94'),_0x20ea('0x63'));if(_0x3688e6[_0x20ea('0x45')]){_0x3688e6[_0x20ea('0x45')][_0x20ea('0x73')](function(_0x17e307){var _0x222e94=_0x17e307[0x0]===_0x20ea('0x95')?_0x17e307[0x0]:'i.'+_0x17e307[0x0];_0x39789f['order'](_0x222e94,_0x17e307[0x1]===_0x20ea('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x2f67d3)){_0x39789f[_0x20ea('0x64')](_0x1d6bc5);_0x20ee4c[_0x20ea('0x47')](_0x20ea('0x97'),_0x2f67d3);}BPromise[_0x20ea('0x98')]()['then'](function(){if(!_0x1fc7f0){if(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x7c')])return;_0x20ee4c[_0x20ea('0x47')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x39789f[_0x20ea('0x47')](_0x20ea('0x99'));return;}if(_0x3de48a[_0x20ea('0x9a')]['role']!==_0x20ea('0x9b'))return;return _0x3de48a[_0x20ea('0x9a')][_0x20ea('0x9c')]({'attributes':['id'],'raw':!![]})[_0x20ea('0x35')](function(_0x1d034c){if(_[_0x20ea('0x7b')](_0x1d034c)){_0x20ee4c[_0x20ea('0x47')](_0x20ea('0x9d'));_0x39789f['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x20ee4c[_0x20ea('0x47')]('i.SmsAccountId\x20IN\x20?',_[_0x20ea('0x30')](_0x1d034c,'id'));_0x39789f[_0x20ea('0x47')](_0x20ea('0x7d'),_['map'](_0x1d034c,'id'));}});})['then'](function(){if(_0x3de48a[_0x20ea('0x9a')][_0x20ea('0x9e')]===_0x20ea('0x9b')&&!_0x1fc7f0&&!_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x7c')])return[];return db[_0x20ea('0x9f')][_0x20ea('0x3e')](_0x20ee4c[_0x20ea('0xa0')](),_0x30ba34);})[_0x20ea('0x35')](function(_0x37bc3b){_0x143ba1[_0x20ea('0x24')]=_0x37bc3b[_0x20ea('0x42')];if(_0x143ba1[_0x20ea('0x24')]===0x0)return[];return db['sequelize']['query'](_0x354ce2[_0x20ea('0xa0')](),_0x30ba34)['then'](function(_0x89f529){_0x1fc9e1=_[_0x20ea('0xa1')](_0x89f529,'id');_0x30ba34=_['merge'](_0x30ba34,{'model':db[_0x20ea('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3de48a[_0x20ea('0x3e')][_0x20ea('0x41')]){_0x3688e6[_0x20ea('0x40')]['forEach'](function(_0x54ca92){_0x39789f['field']('i.'+_0x54ca92);});}else{_0x39789f[_0x20ea('0x4b')](_0x20ea('0x94'),_0x20ea('0x63'));_0x39789f['field'](_0x20ea('0xa2'),'Account.key');_0x39789f[_0x20ea('0x4b')](_0x20ea('0xa3'),_0x20ea('0xa4'));_0x39789f[_0x20ea('0x4b')]('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',_0x20ea('0x95'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xa5'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xa6'),_0x20ea('0xa7'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xa8'),'Contact.lastName');_0x39789f[_0x20ea('0x4b')](_0x20ea('0xa9'),_0x20ea('0xaa'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xab'),_0x20ea('0xac'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xad'),_0x20ea('0xae'));_0x39789f['field'](_0x20ea('0xaf'),_0x20ea('0xb0'));_0x39789f[_0x20ea('0x4b')](_0x20ea('0xb1'),'Owner.fullname');_0x39789f['field'](_0x20ea('0xb2'),'Owner.internal');_0x39789f[_0x20ea('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x20ea('0x31'));}if(_0x3688e6[_0x20ea('0x23')])_0x39789f[_0x20ea('0x23')](_0x3688e6[_0x20ea('0x23')]);if(_0x3688e6[_0x20ea('0x25')])_0x39789f[_0x20ea('0x25')](_0x3688e6[_0x20ea('0x25')]);return db[_0x20ea('0x9f')][_0x20ea('0x3e')](_0x39789f[_0x20ea('0xa0')](),_0x30ba34);})['then'](function(_0x5c4d17){if(_0x5c4d17['length']>0x0)_0x448f58[_0x20ea('0x47')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x5c4d17,'id'));return db[_0x20ea('0x9f')][_0x20ea('0x3e')](_0x448f58[_0x20ea('0xa0')](),_0x30ba34)[_0x20ea('0x35')](function(_0x4df517){var _0x147c6c=_[_0x20ea('0xb3')](_0x4df517,'SmsInteractionId');var _0x54c83b=[];_0x5c4d17['forEach'](function(_0x50b46c){_0x54c83b[_0x20ea('0x34')](updateSmsInteraction(_0x50b46c,_0x1fc9e1,_0x147c6c));});return BPromise[_0x20ea('0xb4')](_0x54c83b);});});})[_0x20ea('0x35')](function(_0x4c2018){_0x143ba1[_0x20ea('0xb5')]=_0x4c2018;return _0x143ba1;})[_0x20ea('0x35')](respondWithFilteredResult(_0x433cbc,_0x3688e6))[_0x20ea('0xb6')](handleError(_0x433cbc,null));};exports[_0x20ea('0xb7')]=function(_0x7a7a67,_0x4f052c){var _0x30c89a={'raw':![],'where':{'id':_0x7a7a67[_0x20ea('0xb8')]['id']}},_0x576895={};_0x576895['model']=_['keys'](db['SmsInteraction'][_0x20ea('0x38')]);_0x576895[_0x20ea('0x3e')]=_['keys'](_0x7a7a67[_0x20ea('0x3e')]);_0x576895[_0x20ea('0x48')]=_[_0x20ea('0x3f')](_0x576895[_0x20ea('0x3c')],_0x576895['query']);_0x30c89a[_0x20ea('0x40')]=_[_0x20ea('0x3f')](_0x576895[_0x20ea('0x3c')],qs[_0x20ea('0x41')](_0x7a7a67['query'][_0x20ea('0x41')]));_0x30c89a[_0x20ea('0x40')]=_0x30c89a[_0x20ea('0x40')][_0x20ea('0x42')]?_0x30c89a[_0x20ea('0x40')]:_0x576895[_0x20ea('0x3c')];if(_0x7a7a67[_0x20ea('0x3e')][_0x20ea('0xb9')]){_0x30c89a['include']=[{'all':!![]}];}_0x30c89a=_['merge']({},_0x30c89a,_0x7a7a67[_0x20ea('0xba')]);return db[_0x20ea('0x37')][_0x20ea('0x62')](_0x30c89a)[_0x20ea('0x35')](handleEntityNotFound(_0x4f052c,null))[_0x20ea('0x35')](respondWithResult(_0x4f052c,null))[_0x20ea('0xb6')](handleError(_0x4f052c,null));};exports[_0x20ea('0xbb')]=function(_0x352966,_0x588d07){return db['SmsInteraction'][_0x20ea('0xbb')](_0x352966[_0x20ea('0x78')],{})['then'](respondWithResult(_0x588d07,0xc9))[_0x20ea('0xb6')](handleError(_0x588d07,null));};exports[_0x20ea('0x2b')]=function(_0xe9915,_0x7f93a7){if(_0xe9915[_0x20ea('0x78')]['id']){delete _0xe9915['body']['id'];}return db[_0x20ea('0x37')][_0x20ea('0x62')]({'where':{'id':_0xe9915[_0x20ea('0xb8')]['id']}})[_0x20ea('0x35')](handleEntityNotFound(_0x7f93a7,null))[_0x20ea('0x35')](saveUpdates(_0xe9915['body'],null))['then'](respondWithResult(_0x7f93a7,null))[_0x20ea('0xb6')](handleError(_0x7f93a7,null));};exports[_0x20ea('0x2c')]=function(_0x1b6b94,_0x281b45){return db[_0x20ea('0x37')][_0x20ea('0x62')]({'where':{'id':_0x1b6b94['params']['id']}})['then'](handleEntityNotFound(_0x281b45,null))[_0x20ea('0x35')](removeEntity(_0x281b45,null))[_0x20ea('0xb6')](handleError(_0x281b45,null));};exports[_0x20ea('0xbc')]=function(_0x48c389,_0x3cda4e){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x3cda4e,null))[_0x20ea('0xb6')](handleError(_0x3cda4e,null));};exports[_0x20ea('0xbd')]=function(_0x43065b,_0x6de3b7,_0x2e0ead){return db[_0x20ea('0xbe')][_0x20ea('0x62')]({'where':{'id':_0x43065b['params']['id']}})[_0x20ea('0x35')](handleEntityNotFound(_0x6de3b7,null))[_0x20ea('0x35')](function(_0x264f35){if(_0x264f35){return _0x264f35[_0x20ea('0xbd')](_0x43065b[_0x20ea('0x78')][_0x20ea('0xbf')],_[_0x20ea('0xc0')](_0x43065b['body'],[_0x20ea('0xbf'),'id'])||{});}})[_0x20ea('0x35')](respondWithResult(_0x6de3b7,null))[_0x20ea('0xb6')](handleError(_0x6de3b7,null));};exports[_0x20ea('0xc1')]=function(_0x474b5d,_0x4a15a0,_0x57db4a){var _0xdb9130={'raw':![],'where':{}};var _0x22dac0={};var _0x301ac4={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x20ea('0xc2')]({'where':{'id':_0x474b5d['params']['id']}})[_0x20ea('0x35')](handleEntityNotFound(_0x4a15a0,null))[_0x20ea('0x35')](function(_0x192695){if(_0x192695){_0x22dac0[_0x20ea('0x3c')]=_[_0x20ea('0x3d')](db[_0x20ea('0xbe')][_0x20ea('0x38')]);_0x22dac0['query']=_['keys'](_0x474b5d[_0x20ea('0x3e')]);_0x22dac0[_0x20ea('0x48')]=_[_0x20ea('0x3f')](_0x22dac0[_0x20ea('0x3c')],_0x22dac0[_0x20ea('0x3e')]);_0xdb9130[_0x20ea('0x40')]=_['intersection'](_0x22dac0[_0x20ea('0x3c')],qs[_0x20ea('0x41')](_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x41')]));_0xdb9130[_0x20ea('0x40')]=_0xdb9130['attributes'][_0x20ea('0x42')]?_0xdb9130['attributes']:_0x22dac0[_0x20ea('0x3c')];if(!_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x43')](_0x20ea('0x44'))){_0xdb9130['limit']=qs[_0x20ea('0x23')](_0x474b5d['query'][_0x20ea('0x23')]);_0xdb9130[_0x20ea('0x25')]=qs[_0x20ea('0x25')](_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x25')]);}_0xdb9130[_0x20ea('0x45')]=qs[_0x20ea('0x46')](_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x46')]);_0xdb9130[_0x20ea('0x47')]=qs[_0x20ea('0x48')](_['pick'](_0x474b5d[_0x20ea('0x3e')],_0x22dac0[_0x20ea('0x48')]));_0xdb9130[_0x20ea('0x47')]['SmsInteractionId']=_0x192695['id'];if(_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x88')]){_0xdb9130[_0x20ea('0x47')]=_[_0x20ea('0xc3')](_0xdb9130[_0x20ea('0x47')],{'$or':_[_0x20ea('0x30')](_0xdb9130[_0x20ea('0x40')],function(_0x57a393){var _0x80bd7c={};_0x80bd7c[_0x57a393]={'$like':'%'+_0x474b5d[_0x20ea('0x3e')]['filter']+'%'};return _0x80bd7c;})});}if(_0x474b5d[_0x20ea('0x3e')][_0x20ea('0x7f')]){var _0x5d8f66=_0x474b5d['query'][_0x20ea('0x7f')]['split'](',');var _0x5ac2a6={};_0x5ac2a6[_0x5d8f66[0x0]]={'$gte':moment(_0x5d8f66[0x1])[_0x20ea('0xc4')](_0x20ea('0xc5'))};_0xdb9130[_0x20ea('0x47')]=_[_0x20ea('0xc3')](_0xdb9130[_0x20ea('0x47')],_0x5ac2a6);}_0xdb9130=_[_0x20ea('0xc3')]({},_0xdb9130,_0x474b5d[_0x20ea('0xba')]);return db[_0x20ea('0xbe')]['count']({'where':_0xdb9130[_0x20ea('0x47')]})[_0x20ea('0x35')](function(_0x43b7b2){_0x301ac4[_0x20ea('0x24')]=_0x43b7b2;if(_0x474b5d[_0x20ea('0x3e')][_0x20ea('0xb9')]){_0xdb9130['include']=[{'all':!![]}];}return db[_0x20ea('0xbe')]['findAll'](_0xdb9130);})[_0x20ea('0x35')](function(_0x2a56cc){_0x301ac4[_0x20ea('0xb5')]=_0x2a56cc;return _0x301ac4;});}})['then'](respondWithFilteredResult(_0x4a15a0,_0xdb9130))[_0x20ea('0xb6')](handleError(_0x4a15a0,null));};exports[_0x20ea('0xc6')]=function(_0x4f2772,_0xa8509e,_0x296c47){return db[_0x20ea('0x37')][_0x20ea('0x62')]({'where':{'id':_0x4f2772[_0x20ea('0xb8')]['id']}})[_0x20ea('0x35')](handleEntityNotFound(_0xa8509e,null))['then'](function(_0x30f43d){if(_0x30f43d){return _0x30f43d[_0x20ea('0xc7')](_0x4f2772['body'][_0x20ea('0xbf')],_['omit'](_0x4f2772[_0x20ea('0x78')],[_0x20ea('0xbf'),'id'])||{})[_0x20ea('0xc8')](function(){return db[_0x20ea('0x72')][_0x20ea('0xc9')]({'attributes':['id',_0x20ea('0x2e'),_0x20ea('0x4c')],'where':{'id':_0x4f2772[_0x20ea('0x78')][_0x20ea('0xbf')]}});})[_0x20ea('0x35')](function(_0x1b7843){socket[_0x20ea('0xca')](_0x20ea('0xcb'),{'id':Number(_0x4f2772[_0x20ea('0xb8')]['id']),'tags':_0x1b7843||[]});return{'id':Number(_0x4f2772[_0x20ea('0xb8')]['id']),'tags':_0x1b7843||[]};});}})[_0x20ea('0x35')](respondWithResult(_0xa8509e,null))[_0x20ea('0xb6')](handleError(_0xa8509e,null));};exports[_0x20ea('0xcc')]=function(_0x4e59fa,_0x36f2ad,_0x45bb5a){return db[_0x20ea('0x37')][_0x20ea('0x62')]({'where':{'id':_0x4e59fa[_0x20ea('0xb8')]['id']}})[_0x20ea('0x35')](handleEntityNotFound(_0x36f2ad,null))[_0x20ea('0x35')](function(_0x396b0d){if(_0x396b0d){return _0x396b0d['removeTags'](_0x4e59fa['query'][_0x20ea('0xbf')]);}})[_0x20ea('0x35')](respondWithStatusCode(_0x36f2ad,null))[_0x20ea('0xb6')](handleError(_0x36f2ad,null));};exports[_0x20ea('0xcd')]=function(_0x2f41d0,_0x1fc8ee){var _0x24a5a8=moment()[_0x20ea('0xce')]()['toString']();var _0x8c2ba1=path['join'](config['root'],'server','files',_0x20ea('0xcf'));var _0x14bd52=path[_0x20ea('0xd0')](config[_0x20ea('0xd1')],_0x20ea('0xd2'),_0x20ea('0xd3'),_0x20ea('0xd4'));var _0xaf3079=path[_0x20ea('0xd0')](_0x8c2ba1,_0x24a5a8);var _0xac2f11=util[_0x20ea('0xc4')](_0x20ea('0xd5'),_0x2f41d0[_0x20ea('0xb8')]['id'],_0x24a5a8);var _0x4411f6=path[_0x20ea('0xd0')](_0x8c2ba1,_0xac2f11);var _0x4dc7b4=[];_0x4dc7b4[_0x20ea('0x34')]({'model':db[_0x20ea('0x75')],'as':_0x20ea('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x4dc7b4[_0x20ea('0x34')]({'model':db[_0x20ea('0xd6')],'as':'Contact','attributes':['id','firstName',_0x20ea('0xd7')],'raw':!![]});var _0x3512e1=[{'model':db[_0x20ea('0xbe')],'as':_0x20ea('0xd8'),'attributes':['id',_0x20ea('0x78'),'createdAt',_0x20ea('0xd9'),_0x20ea('0xda'),_0x20ea('0x83')],'include':_0x4dc7b4}];_0x3512e1[_0x20ea('0x34')]({'model':db['SmsAccount'],'as':_0x20ea('0xdb'),'attributes':['id',_0x20ea('0x2e')]});_0x3512e1[_0x20ea('0x34')]({'model':db[_0x20ea('0x75')],'as':'Owner','attributes':['id',_0x20ea('0xdc')]});return db['SmsInteraction'][_0x20ea('0x62')]({'where':{'id':_0x2f41d0[_0x20ea('0xb8')]['id']},'include':_0x3512e1})['then'](handleEntityNotFound(_0x1fc8ee,null))['then'](function(_0x3e685c){if(_0x3e685c){var _0x4bacf6=_0x3e685c['get']({'plain':!![]});fs[_0x20ea('0xdd')](_0xaf3079);var _0x5d8c8a={'channel':_0x20ea('0xde'),'account':_0x4bacf6[_0x20ea('0xdb')][_0x20ea('0x2e')],'agent':_0x4bacf6['Owner']?_0x4bacf6[_0x20ea('0xdf')][_0x20ea('0xdc')]:_0x20ea('0xe0'),'createdAt':moment(_0x4bacf6[_0x20ea('0xe1')])[_0x20ea('0xc4')](_0x20ea('0xc5'))['toString'](),'closedAt':_0x4bacf6[_0x20ea('0xe2')]?moment(_0x4bacf6['closedAt'])[_0x20ea('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x20ea('0xa0')]():'','disposition':_0x4bacf6['disposition'],'messages':_(_0x4bacf6['Messages'])[_0x20ea('0x88')]({'secret':![]})[_0x20ea('0x30')](function(_0x4d68e6){return{'date':moment(_0x4d68e6[_0x20ea('0xe1')])[_0x20ea('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4d68e6[_0x20ea('0xd9')]==='out'?_0x4d68e6[_0x20ea('0x75')]?_0x4d68e6[_0x20ea('0x75')][_0x20ea('0xdc')]:_0x20ea('0xe3'):_0x4d68e6[_0x20ea('0x67')][_0x20ea('0xe4')]+(_0x4d68e6[_0x20ea('0x67')]['lastName']?'\x20'+_0x4d68e6['Contact'][_0x20ea('0xd7')]:''),'body':_0x4d68e6[_0x20ea('0x78')],'direction':_0x4d68e6['direction']===_0x20ea('0xe5')?'A':'C','secret':_0x4d68e6['secret'],'read':_0x4d68e6[_0x20ea('0x83')]};})[_0x20ea('0x6a')]()};return ejs[_0x20ea('0xe6')](path[_0x20ea('0xd0')](config[_0x20ea('0xd1')],_0x20ea('0xd2'),'views','downloadInteraction.ejs'),{'interaction':_0x5d8c8a})['then'](function(_0x5bd175){var _0x4cdeb1=path[_0x20ea('0xd0')](_0xaf3079,_0x20ea('0xe7')+_0x4bacf6['id']+'-'+_0x24a5a8+_0x20ea('0xe8'));var _0x5e8669={'path':_0x4cdeb1,'channel':_0x20ea('0xde'),'interactionId':_0x4bacf6['id']};return pdf[_0x20ea('0xe9')](_0x5bd175,_0x5e8669);})[_0x20ea('0x35')](function(){return new BPromise(function(_0x4065b8,_0x277e81){zipdir(_0xaf3079,{'saveTo':_0x4411f6},function(_0x1f4161,_0x418b99){if(_0x1f4161)return _0x277e81(_0x1f4161);return _0x4065b8(_0x418b99);});})[_0x20ea('0x35')](function(){return new BPromise(function(_0x53a3e8,_0x3053ab){rimraf(_0xaf3079,function(_0x319fb8){if(_0x319fb8)_0x3053ab(_0x319fb8);return _0x53a3e8();});});})[_0x20ea('0x35')](function(){return _0x1fc8ee[_0x20ea('0xcd')](_0x4411f6,_0xac2f11,function(_0x3dca68){if(_0x3dca68){console[_0x20ea('0xea')](_0x20ea('0xeb'),_0x3dca68);}else{fs[_0x20ea('0xec')](_0x4411f6);}});});});}else{return _0x1fc8ee[_0x20ea('0x1e')](0xc8);}})[_0x20ea('0xb6')](handleError(_0x1fc8ee,null));}; \ No newline at end of file +var _0xe39c=['i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','include','create','destroy','describe','addMessage','ids','omit','SmsMessage','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','emit','removeTags','unix','root','server','files','transcript-%d-%s.zip','fullname','direction','secret','SmsAccount','mkdirSync','Sms','Account','Owner','N.A.','closed','disposition','Messages','System','lastName','out','renderFile','join','views','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','error','stack','name','send','Users','map','TagIds','Tags','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','pick','field','color','tools_tags','u.id','u.fullname','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','some','compact','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x596de1,_0x41fa07){var _0x3b3ce9=function(_0x46978c){while(--_0x46978c){_0x596de1['push'](_0x596de1['shift']());}};_0x3b3ce9(++_0x41fa07);}(_0xe39c,0x135));var _0xce39=function(_0x248e36,_0x5e293d){_0x248e36=_0x248e36-0x0;var _0x5616dd=_0xe39c[_0x248e36];return _0x5616dd;};'use strict';var emlformat=require(_0xce39('0x0'));var rimraf=require(_0xce39('0x1'));var zipdir=require(_0xce39('0x2'));var jsonpatch=require(_0xce39('0x3'));var rp=require(_0xce39('0x4'));var moment=require(_0xce39('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xce39('0x6'));var util=require(_0xce39('0x7'));var path=require(_0xce39('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce39('0x9'));var fs=require('fs');var fs_extra=require(_0xce39('0xa'));var _=require(_0xce39('0xb'));var squel=require(_0xce39('0xc'));var crypto=require(_0xce39('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xce39('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce39('0xf'));var Papa=require(_0xce39('0x10'));var Redis=require(_0xce39('0x11'));var authService=require(_0xce39('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xce39('0x13'));var pdf=require(_0xce39('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce39('0x15'));var utils=require('../../config/utils');var config=require(_0xce39('0x16'));var licenseUtil=require(_0xce39('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xce39('0x18')](config[_0xce39('0x19')],{'host':_0xce39('0x1a'),'port':0x18eb});var socket=require(_0xce39('0x1b'))(new Redis(config['redis']));require(_0xce39('0x1c'))[_0xce39('0x1d')](socket);function respondWithStatusCode(_0x21cf3b,_0x26b3bb){_0x26b3bb=_0x26b3bb||0xcc;return function(_0x4edf59){if(_0x4edf59){return _0x21cf3b[_0xce39('0x1e')](_0x26b3bb);}return _0x21cf3b[_0xce39('0x1f')](_0x26b3bb)['end']();};}function respondWithResult(_0x2e47c0,_0x275d3b){_0x275d3b=_0x275d3b||0xc8;return function(_0x603eb9){if(_0x603eb9){return _0x2e47c0[_0xce39('0x1f')](_0x275d3b)[_0xce39('0x20')](_0x603eb9);}};}function respondWithFilteredResult(_0x27a111,_0xb55615){return function(_0x2dd216){if(_0x2dd216){var _0x4eac1d=typeof _0xb55615[_0xce39('0x21')]===_0xce39('0x22')&&typeof _0xb55615[_0xce39('0x23')]===_0xce39('0x22');var _0x92a9e5=_0x2dd216[_0xce39('0x24')];var _0x13d41b=_0x4eac1d?0x0:_0xb55615['offset'];var _0x5ec5bb=_0x4eac1d?_0x2dd216['count']:_0xb55615[_0xce39('0x21')]+_0xb55615[_0xce39('0x23')];var _0x384972;if(_0x5ec5bb>=_0x92a9e5){_0x5ec5bb=_0x92a9e5;_0x384972=0xc8;}else{_0x384972=0xce;}_0x27a111[_0xce39('0x1f')](_0x384972);return _0x27a111['set'](_0xce39('0x25'),_0x13d41b+'-'+_0x5ec5bb+'/'+_0x92a9e5)['json'](_0x2dd216);}return null;};}function patchUpdates(_0x4fb69a){return function(_0x38539b){try{jsonpatch['apply'](_0x38539b,_0x4fb69a,!![]);}catch(_0xaf0b00){return BPromise['reject'](_0xaf0b00);}return _0x38539b[_0xce39('0x26')]();};}function saveUpdates(_0x1ef0b1,_0x410f85){return function(_0x2d55d6){if(_0x2d55d6){return _0x2d55d6[_0xce39('0x27')](_0x1ef0b1)[_0xce39('0x28')](function(_0x7ad2d9){return _0x7ad2d9;});}return null;};}function removeEntity(_0x238746,_0x844f49){return function(_0x47353c){if(_0x47353c){return _0x47353c['destroy']()[_0xce39('0x28')](function(){_0x238746[_0xce39('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a8328,_0x51aeb2){return function(_0x10d04c){if(!_0x10d04c){_0x1a8328[_0xce39('0x1e')](0x194);}return _0x10d04c;};}function handleError(_0x5902c3,_0x581bd7){_0x581bd7=_0x581bd7||0x1f4;return function(_0x297111){logger[_0xce39('0x29')](_0x297111[_0xce39('0x2a')]);if(_0x297111[_0xce39('0x2b')]){delete _0x297111['name'];}_0x5902c3[_0xce39('0x1f')](_0x581bd7)[_0xce39('0x2c')](_0x297111);};}function getInteractionUsers(_0x5eb3fa,_0x4f1688){return new BPromise(function(_0x202ee7,_0x3fa9f3){try{if(_0x4f1688[_0x5eb3fa['id']]){_0x5eb3fa[_0xce39('0x2d')]=_[_0xce39('0x2e')](_0x4f1688[_0x5eb3fa['id']],function(_0x4fadd1){return{'id':_0x4fadd1['id'],'fullname':_0x4fadd1['fullname']};});}}catch(_0x21b0a7){_0x3fa9f3(_0x21b0a7);}_0x202ee7(_0x5eb3fa);});}function getInteractionTags(_0x5ce9d6,_0x181f4b){return new BPromise(function(_0xa5b119,_0x4bb63e){try{if(_0x5ce9d6[_0xce39('0x2f')]){_0x5ce9d6[_0xce39('0x30')]=[];_0x5ce9d6['TagIds']['split'](',')[_0xce39('0x31')](function(_0x1eaec4){_0x5ce9d6['Tags']['push'](_0x181f4b[_0x1eaec4]);});}delete _0x5ce9d6[_0xce39('0x2f')];}catch(_0x39bb3d){_0x4bb63e(_0x39bb3d);}_0xa5b119(_0x5ce9d6);});}function updateSmsInteraction(_0x30e000,_0x3cb8de,_0x14d6a5){return new BPromise(function(_0x2220b4,_0x6bfb6b){return getInteractionUsers(_0x30e000,_0x14d6a5)[_0xce39('0x28')](function(_0xafbdae){return getInteractionTags(_0xafbdae,_0x3cb8de);})[_0xce39('0x28')](function(_0x4264bf){_0x2220b4(_0x4264bf);})[_0xce39('0x32')](function(_0x397d0f){_0x6bfb6b(_0x397d0f);});});}exports[_0xce39('0x33')]=function(_0x4dd19e,_0x397a3b){var _0x8b2c59={},_0x3de43d={},_0x40f956={'count':0x0,'rows':[]};var _0x297517=_[_0xce39('0x2e')](db[_0xce39('0x34')][_0xce39('0x35')],function(_0x1f6cf9){return{'name':_0x1f6cf9[_0xce39('0x36')],'type':_0x1f6cf9[_0xce39('0x37')][_0xce39('0x38')]};});_0x3de43d[_0xce39('0x39')]=_[_0xce39('0x2e')](_0x297517,'name');_0x3de43d['query']=_[_0xce39('0x3a')](_0x4dd19e['query']);_0x3de43d[_0xce39('0x3b')]=_[_0xce39('0x3c')](_0x3de43d[_0xce39('0x39')],_0x3de43d['query']);_0x8b2c59[_0xce39('0x3d')]=_[_0xce39('0x3c')](_0x3de43d['model'],qs[_0xce39('0x3e')](_0x4dd19e[_0xce39('0x3f')]['fields']));_0x8b2c59[_0xce39('0x3d')]=_0x8b2c59[_0xce39('0x3d')][_0xce39('0x40')]?_0x8b2c59[_0xce39('0x3d')]:_0x3de43d[_0xce39('0x39')];if(!_0x4dd19e[_0xce39('0x3f')]['hasOwnProperty'](_0xce39('0x41'))){_0x8b2c59[_0xce39('0x23')]=qs['limit'](_0x4dd19e['query'][_0xce39('0x23')]);_0x8b2c59[_0xce39('0x21')]=qs['offset'](_0x4dd19e[_0xce39('0x3f')][_0xce39('0x21')]);}_0x8b2c59[_0xce39('0x42')]=qs['sort'](_0x4dd19e['query'][_0xce39('0x43')]);_0x8b2c59['where']=qs[_0xce39('0x3b')](_[_0xce39('0x44')](_0x4dd19e[_0xce39('0x3f')],_0x3de43d[_0xce39('0x3b')]),_0x297517);var _0x325e25=[];var _0x4b6252=squel['select']()[_0xce39('0x45')]('id')[_0xce39('0x45')](_0xce39('0x2b'))[_0xce39('0x45')](_0xce39('0x46'))['from'](_0xce39('0x47'));var _0x39c1e5=squel['select']()[_0xce39('0x45')](_0xce39('0x48'))[_0xce39('0x45')](_0xce39('0x49'))[_0xce39('0x45')]('ui.SmsInteractionId')[_0xce39('0x4a')](_0xce39('0x4b'),'ui')[_0xce39('0x4c')](_0xce39('0x4d'),'u',_0xce39('0x4e'));var _0x15d9a7=squel[_0xce39('0x4f')]()[_0xce39('0x4a')](_0xce39('0x50'),'i')['left_join'](_0xce39('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xce39('0x4c')](_0xce39('0x4d'),'o',_0xce39('0x52'))[_0xce39('0x4c')]('sms_accounts','a',_0xce39('0x53'))['left_join'](_0xce39('0x54'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xce39('0x4c')](_0xce39('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xce39('0x4c')](_0xce39('0x47'),'t',_0xce39('0x56'));var _0x4e9b73=squel[_0xce39('0x57')]();var _0x419cb1=[];var _0xb757f=squel[_0xce39('0x57')]();var _0x55c05c;if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x58')]){_0x55c05c=as[_0xce39('0x59')](_0x4dd19e['query'][_0xce39('0x58')]);var _0x1a53b7=_0x55c05c[_0xce39('0x5a')];for(var _0x453145=0x0;_0x453145<_0x55c05c['conditions'][_0xce39('0x40')];_0x453145++){var _0x3467de=_0x55c05c['conditions'][_0x453145];var _0x222309='i';var _0x413221=_[_0xce39('0x5b')](_0x297517,['name',_0x3467de[_0xce39('0x45')]]);if(!_0x413221){switch(_0x3467de['field']){case'unreadMessages':if(_0x3467de['value']==0x1){_0x15d9a7['having']('`'+_0x3467de[_0xce39('0x45')]+_0xce39('0x5c'));}else{_0x15d9a7['having']('`'+_0x3467de['field']+_0xce39('0x5d'));}break;case _0xce39('0x5e'):if(_0x3467de[_0xce39('0x5f')]===_0xce39('0x60')){if(_0x3467de['value'][_0xce39('0x61')]('\x20')['length']>0x1){_0x4e9b73[_0x1a53b7](_0xce39('0x62'),qs[_0xce39('0x63')](_0x3467de[_0xce39('0x64')]),null);}else{var _0x1e1957='%'+_0x3467de[_0xce39('0x64')]+'%';_0x4e9b73[_0x1a53b7](_0xce39('0x65'),_0x1e1957,_0x1e1957,_0x1e1957);}}else{_0x413221=_[_0xce39('0x5b')](_0x297517,['name',_0xce39('0x66')]);_0x3467de[_0xce39('0x45')]=_0xce39('0x66');_0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff[_0xce39('0x64')]['start'],_0x5714ff['value'][_0xce39('0x69')]);}break;case _0xce39('0x6a'):var _0x5ad082=_0x3467de[_0xce39('0x64')][_0xce39('0x61')](',')[_0xce39('0x2e')](function(_0x12e62e){return Number(_0x12e62e);});_0x5ad082[_0xce39('0x31')](function(_0x65c06e){_0xb757f['or'](_0xce39('0x6b'),'%,'+_0x65c06e+',%');});_0x419cb1=_[_0xce39('0x6c')](_0x419cb1,_0x5ad082);break;case _0xce39('0x6d'):if(_0x3467de[_0xce39('0x5f')]===_0xce39('0x60')){_0x4e9b73[_0x1a53b7](_0xce39('0x6e'),'%'+_0x3467de['value']+'%',null);}else{_0x413221=_[_0xce39('0x5b')](_0x297517,[_0xce39('0x2b'),'UserId']);_0x3467de['field']='UserId';_0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff['value']['start'],_0x5714ff['value'][_0xce39('0x69')]);}break;case _0xce39('0x6f'):_0x5714ff=as[_0xce39('0x67')]('me',null,_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff[_0xce39('0x64')][_0xce39('0x70')],_0x5714ff[_0xce39('0x64')][_0xce39('0x69')]);break;}}else{var _0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff['text'],_0x5714ff['value']['start'],_0x5714ff['value'][_0xce39('0x69')]);}}}else{var _0x45cdd0=_(_0x4dd19e[_0xce39('0x3f')])[_0xce39('0x3a')]()[_0xce39('0x2e')](function(_0x1580e3){return _[_0xce39('0x71')](_0x297517,['name',_0x1580e3])?_0x1580e3:undefined;})[_0xce39('0x72')]()[_0xce39('0x64')]();if(!_['isEmpty'](_0x45cdd0)){_0x45cdd0[_0xce39('0x31')](function(_0x333e81){if(_0x333e81===_0xce39('0x73')){_0x15d9a7[_0xce39('0x74')](_0xce39('0x75'),[][_0xce39('0x76')](_0x4dd19e['query'][_0x333e81]));}else if(_0x333e81===_0xce39('0x77')){var _0x29aad4=JSON[_0xce39('0x78')](_0x4dd19e['query'][_0x333e81])[_0xce39('0x79')];var _0x59733f=JSON[_0xce39('0x78')](_0x4dd19e[_0xce39('0x3f')][_0x333e81])[_0xce39('0x7a')];_0x15d9a7[_0xce39('0x74')](_0xce39('0x7b'),_0x29aad4,_0x59733f);}else{if(_0x4dd19e[_0xce39('0x3f')][_0x333e81]==='null'){_0x15d9a7[_0xce39('0x74')]('i.'+_0x333e81+_0xce39('0x7c'));}else{_0x15d9a7[_0xce39('0x74')]('i.'+_0x333e81+_0xce39('0x7d'),_0x4dd19e[_0xce39('0x3f')][_0x333e81]);}}});}if(_0x4dd19e['query'][_0xce39('0x7e')]){if(_0x4dd19e['query']['read']==0x1){_0x15d9a7[_0xce39('0x7f')](_0xce39('0x80'));}else{_0x15d9a7[_0xce39('0x7f')]('`unreadMessages`\x20>\x200');}}if(_0x4dd19e[_0xce39('0x3f')]['tag']){_0x419cb1=_[_0xce39('0x81')](_0x4dd19e[_0xce39('0x3f')]['tag'])?_0x4dd19e[_0xce39('0x3f')][_0xce39('0x82')]:new Array(_0x4dd19e['query'][_0xce39('0x82')]);_0x419cb1[_0xce39('0x31')](function(_0x438831){_0xb757f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x438831+',%');});}if(_0x4dd19e['query'][_0xce39('0x83')]){var _0x345f10=_0x4dd19e[_0xce39('0x3f')][_0xce39('0x83')][_0xce39('0x84')]('\x5c','\x5c\x5c')[_0xce39('0x84')](/'/g,'\x27\x27');if(qs[_0xce39('0x85')](_0x345f10)){_0x4e9b73['or'](_0xce39('0x86'),_0x345f10+'%')['or'](_0xce39('0x87'),_0x345f10+'%');}else{_0x4e9b73['or'](_0xce39('0x88'),qs[_0xce39('0x63')](_0x345f10))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x345f10+'%');}}}_0x15d9a7['where'](_0x4e9b73);_0x15d9a7[_0xce39('0x89')](_0xce39('0x8a'));var _0x453a3b={'type':db[_0xce39('0x8b')]['QueryTypes'][_0xce39('0x8c')],'raw':!![]};var _0x34ae66=_0x15d9a7['clone']();_0x34ae66[_0xce39('0x45')]('i.id');_0x34ae66[_0xce39('0x45')](_0xce39('0x8d'),'unreadMessages');if(_0x8b2c59['order']){_0x8b2c59[_0xce39('0x42')][_0xce39('0x31')](function(_0x36034a){var _0x26392f=_0x36034a[0x0]===_0xce39('0x8e')?_0x36034a[0x0]:'i.'+_0x36034a[0x0];_0x15d9a7['order'](_0x26392f,_0x36034a[0x1]===_0xce39('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x419cb1)){_0x15d9a7[_0xce39('0x7f')](_0xb757f);_0x34ae66['where'](_0xce39('0x90'),_0x419cb1);}BPromise['resolve']()[_0xce39('0x28')](function(){if(!_0x55c05c){if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x73')])return;_0x34ae66[_0xce39('0x74')](_0xce39('0x91'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x91'));return;}if(_0x4dd19e[_0xce39('0x92')][_0xce39('0x93')]!==_0xce39('0x94'))return;return _0x4dd19e['user'][_0xce39('0x95')]({'attributes':['id'],'raw':!![]})[_0xce39('0x28')](function(_0x2aa87c){if(_[_0xce39('0x96')](_0x2aa87c)){_0x34ae66[_0xce39('0x74')](_0xce39('0x97'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x97'));}else{_0x34ae66['where'](_0xce39('0x75'),_['map'](_0x2aa87c,'id'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x75'),_[_0xce39('0x2e')](_0x2aa87c,'id'));}});})[_0xce39('0x28')](function(){if(_0x4dd19e[_0xce39('0x92')]['role']===_0xce39('0x94')&&!_0x55c05c&&!_0x4dd19e[_0xce39('0x3f')][_0xce39('0x73')])return[];return db[_0xce39('0x98')][_0xce39('0x3f')](_0x34ae66[_0xce39('0x99')](),_0x453a3b);})[_0xce39('0x28')](function(_0x56867b){_0x40f956[_0xce39('0x24')]=_0x56867b[_0xce39('0x40')];if(_0x40f956[_0xce39('0x24')]===0x0)return[];return db[_0xce39('0x98')][_0xce39('0x3f')](_0x4b6252['toString'](),_0x453a3b)['then'](function(_0x12fb86){_0x325e25=_['keyBy'](_0x12fb86,'id');_0x453a3b=_[_0xce39('0x9a')](_0x453a3b,{'model':db[_0xce39('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x3e')]){_0x8b2c59[_0xce39('0x3d')]['forEach'](function(_0x3dfd87){_0x15d9a7[_0xce39('0x45')]('i.'+_0x3dfd87);});}else{_0x15d9a7[_0xce39('0x45')](_0xce39('0x8d'),_0xce39('0x9b'));_0x15d9a7['field'](_0xce39('0x9c'),_0xce39('0x9d'));_0x15d9a7[_0xce39('0x45')](_0xce39('0x9e'),_0xce39('0x9f'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa0'),_0xce39('0x8e'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa1'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa2'),_0xce39('0xa3'));_0x15d9a7['field']('c.lastName',_0xce39('0xa4'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa5'),_0xce39('0xa6'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa7'),'Contact.phone');_0x15d9a7[_0xce39('0x45')](_0xce39('0xa8'),'Contact.mobile');_0x15d9a7[_0xce39('0x45')](_0xce39('0xa9'),_0xce39('0xaa'));_0x15d9a7[_0xce39('0x45')]('o.fullname',_0xce39('0xab'));_0x15d9a7[_0xce39('0x45')]('o.internal','Owner.internal');_0x15d9a7[_0xce39('0x45')](_0xce39('0xac'),_0xce39('0x2f'));}if(_0x8b2c59[_0xce39('0x23')])_0x15d9a7[_0xce39('0x23')](_0x8b2c59['limit']);if(_0x8b2c59[_0xce39('0x21')])_0x15d9a7['offset'](_0x8b2c59['offset']);return db[_0xce39('0x98')]['query'](_0x15d9a7[_0xce39('0x99')](),_0x453a3b);})[_0xce39('0x28')](function(_0x1bec9d){if(_0x1bec9d['length']>0x0)_0x39c1e5[_0xce39('0x74')]('ui.SmsInteractionId\x20IN\x20?',_[_0xce39('0x2e')](_0x1bec9d,'id'));return db['sequelize'][_0xce39('0x3f')](_0x39c1e5[_0xce39('0x99')](),_0x453a3b)[_0xce39('0x28')](function(_0x5240cf){var _0x20bdaf=_[_0xce39('0xad')](_0x5240cf,'SmsInteractionId');var _0xe68e56=[];_0x1bec9d[_0xce39('0x31')](function(_0x445612){_0xe68e56[_0xce39('0xae')](updateSmsInteraction(_0x445612,_0x325e25,_0x20bdaf));});return BPromise[_0xce39('0xaf')](_0xe68e56);});});})[_0xce39('0x28')](function(_0x563ea4){_0x40f956[_0xce39('0xb0')]=_0x563ea4;return _0x40f956;})[_0xce39('0x28')](respondWithFilteredResult(_0x397a3b,_0x8b2c59))[_0xce39('0x32')](handleError(_0x397a3b,null));};exports[_0xce39('0xb1')]=function(_0x3d7448,_0x47eae4){var _0x43adf9={'raw':![],'where':{'id':_0x3d7448[_0xce39('0xb2')]['id']}},_0x475a5d={};_0x475a5d[_0xce39('0x39')]=_[_0xce39('0x3a')](db[_0xce39('0x34')][_0xce39('0x35')]);_0x475a5d[_0xce39('0x3f')]=_[_0xce39('0x3a')](_0x3d7448[_0xce39('0x3f')]);_0x475a5d[_0xce39('0x3b')]=_[_0xce39('0x3c')](_0x475a5d['model'],_0x475a5d[_0xce39('0x3f')]);_0x43adf9[_0xce39('0x3d')]=_['intersection'](_0x475a5d['model'],qs['fields'](_0x3d7448[_0xce39('0x3f')][_0xce39('0x3e')]));_0x43adf9[_0xce39('0x3d')]=_0x43adf9[_0xce39('0x3d')]['length']?_0x43adf9['attributes']:_0x475a5d[_0xce39('0x39')];if(_0x3d7448['query']['includeAll']){_0x43adf9[_0xce39('0xb3')]=[{'all':!![]}];}_0x43adf9=_[_0xce39('0x9a')]({},_0x43adf9,_0x3d7448['options']);return db[_0xce39('0x34')][_0xce39('0x5b')](_0x43adf9)['then'](handleEntityNotFound(_0x47eae4,null))[_0xce39('0x28')](respondWithResult(_0x47eae4,null))['catch'](handleError(_0x47eae4,null));};exports[_0xce39('0xb4')]=function(_0x180738,_0x477f19){return db[_0xce39('0x34')]['create'](_0x180738[_0xce39('0x6f')],{})[_0xce39('0x28')](respondWithResult(_0x477f19,0xc9))[_0xce39('0x32')](handleError(_0x477f19,null));};exports[_0xce39('0x27')]=function(_0x28d97e,_0x45cd87){if(_0x28d97e[_0xce39('0x6f')]['id']){delete _0x28d97e[_0xce39('0x6f')]['id'];}return db['SmsInteraction'][_0xce39('0x5b')]({'where':{'id':_0x28d97e[_0xce39('0xb2')]['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x45cd87,null))['then'](saveUpdates(_0x28d97e[_0xce39('0x6f')],null))['then'](respondWithResult(_0x45cd87,null))['catch'](handleError(_0x45cd87,null));};exports[_0xce39('0xb5')]=function(_0x2ae1b1,_0x2bc930){return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0x2ae1b1['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x2bc930,null))[_0xce39('0x28')](removeEntity(_0x2bc930,null))[_0xce39('0x32')](handleError(_0x2bc930,null));};exports[_0xce39('0xb6')]=function(_0x3813a4,_0x29c0c6){return db[_0xce39('0x34')]['describe']()['then'](respondWithResult(_0x29c0c6,null))['catch'](handleError(_0x29c0c6,null));};exports[_0xce39('0xb7')]=function(_0x5e3fbf,_0x377e4e,_0x5b41d9){return db['SmsMessage'][_0xce39('0x5b')]({'where':{'id':_0x5e3fbf['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x377e4e,null))['then'](function(_0x64c9cc){if(_0x64c9cc){return _0x64c9cc[_0xce39('0xb7')](_0x5e3fbf['body'][_0xce39('0xb8')],_[_0xce39('0xb9')](_0x5e3fbf[_0xce39('0x6f')],[_0xce39('0xb8'),'id'])||{});}})[_0xce39('0x28')](respondWithResult(_0x377e4e,null))['catch'](handleError(_0x377e4e,null));};exports['getMessages']=function(_0x535b6f,_0x49fa7d,_0x2e41de){var _0x42317b={'raw':![],'where':{}};var _0x460b37={};var _0x1aabec={'count':0x0,'rows':[]};return db[_0xce39('0x34')]['findOne']({'where':{'id':_0x535b6f[_0xce39('0xb2')]['id']}})['then'](handleEntityNotFound(_0x49fa7d,null))[_0xce39('0x28')](function(_0x1fd2ba){if(_0x1fd2ba){_0x460b37[_0xce39('0x39')]=_[_0xce39('0x3a')](db[_0xce39('0xba')]['rawAttributes']);_0x460b37['query']=_[_0xce39('0x3a')](_0x535b6f[_0xce39('0x3f')]);_0x460b37['filters']=_[_0xce39('0x3c')](_0x460b37[_0xce39('0x39')],_0x460b37['query']);_0x42317b['attributes']=_[_0xce39('0x3c')](_0x460b37[_0xce39('0x39')],qs[_0xce39('0x3e')](_0x535b6f[_0xce39('0x3f')]['fields']));_0x42317b['attributes']=_0x42317b['attributes'][_0xce39('0x40')]?_0x42317b[_0xce39('0x3d')]:_0x460b37[_0xce39('0x39')];if(!_0x535b6f['query']['hasOwnProperty'](_0xce39('0x41'))){_0x42317b[_0xce39('0x23')]=qs[_0xce39('0x23')](_0x535b6f[_0xce39('0x3f')]['limit']);_0x42317b[_0xce39('0x21')]=qs['offset'](_0x535b6f[_0xce39('0x3f')]['offset']);}_0x42317b[_0xce39('0x42')]=qs[_0xce39('0x43')](_0x535b6f[_0xce39('0x3f')][_0xce39('0x43')]);_0x42317b[_0xce39('0x74')]=qs['filters'](_[_0xce39('0x44')](_0x535b6f['query'],_0x460b37[_0xce39('0x3b')]));_0x42317b[_0xce39('0x74')][_0xce39('0xbb')]=_0x1fd2ba['id'];if(_0x535b6f[_0xce39('0x3f')]['filter']){_0x42317b[_0xce39('0x74')]=_[_0xce39('0x9a')](_0x42317b[_0xce39('0x74')],{'$or':_[_0xce39('0x2e')](_0x42317b['attributes'],function(_0x241c2e){var _0x37aeb9={};_0x37aeb9[_0x241c2e]={'$like':'%'+_0x535b6f['query'][_0xce39('0x83')]+'%'};return _0x37aeb9;})});}if(_0x535b6f[_0xce39('0x3f')][_0xce39('0x79')]){var _0x5a4508=_0x535b6f[_0xce39('0x3f')][_0xce39('0x79')][_0xce39('0x61')](',');var _0x1565c0={};_0x1565c0[_0x5a4508[0x0]]={'$gte':moment(_0x5a4508[0x1])[_0xce39('0xbc')](_0xce39('0xbd'))};_0x42317b[_0xce39('0x74')]=_[_0xce39('0x9a')](_0x42317b[_0xce39('0x74')],_0x1565c0);}_0x42317b=_['merge']({},_0x42317b,_0x535b6f['options']);return db[_0xce39('0xba')][_0xce39('0x24')]({'where':_0x42317b[_0xce39('0x74')]})['then'](function(_0x181923){_0x1aabec[_0xce39('0x24')]=_0x181923;if(_0x535b6f[_0xce39('0x3f')][_0xce39('0xbe')]){_0x42317b[_0xce39('0xb3')]=[{'all':!![]}];}return db[_0xce39('0xba')]['findAll'](_0x42317b);})[_0xce39('0x28')](function(_0x492a09){_0x1aabec[_0xce39('0xb0')]=_0x492a09;return _0x1aabec;});}})[_0xce39('0x28')](respondWithFilteredResult(_0x49fa7d,_0x42317b))[_0xce39('0x32')](handleError(_0x49fa7d,null));};exports[_0xce39('0xbf')]=function(_0x3e6b3e,_0x3d5d34,_0x1d4ed2){return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0x3e6b3e['params']['id']}})['then'](handleEntityNotFound(_0x3d5d34,null))[_0xce39('0x28')](function(_0x1b9fc4){if(_0x1b9fc4){return _0x1b9fc4[_0xce39('0xc0')](_0x3e6b3e[_0xce39('0x6f')]['ids'],_[_0xce39('0xb9')](_0x3e6b3e[_0xce39('0x6f')],[_0xce39('0xb8'),'id'])||{})['spread'](function(){return db[_0xce39('0x6a')]['findAll']({'attributes':['id','name',_0xce39('0x46')],'where':{'id':_0x3e6b3e['body']['ids']}});})['then'](function(_0x4016c6){socket[_0xce39('0xc1')]('smsInteractionTags:save',{'id':Number(_0x3e6b3e[_0xce39('0xb2')]['id']),'tags':_0x4016c6||[]});return{'id':Number(_0x3e6b3e[_0xce39('0xb2')]['id']),'tags':_0x4016c6||[]};});}})[_0xce39('0x28')](respondWithResult(_0x3d5d34,null))['catch'](handleError(_0x3d5d34,null));};exports[_0xce39('0xc2')]=function(_0x5315c9,_0x3edc38,_0x2f6cd9){return db['SmsInteraction'][_0xce39('0x5b')]({'where':{'id':_0x5315c9['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x3edc38,null))[_0xce39('0x28')](function(_0x3210a7){if(_0x3210a7){return _0x3210a7[_0xce39('0xc2')](_0x5315c9[_0xce39('0x3f')][_0xce39('0xb8')]);}})[_0xce39('0x28')](respondWithStatusCode(_0x3edc38,null))[_0xce39('0x32')](handleError(_0x3edc38,null));};exports['download']=function(_0xf4ad2,_0x302f7e){var _0x462688=moment()[_0xce39('0xc3')]()[_0xce39('0x99')]();var _0x2e9637=path['join'](config[_0xce39('0xc4')],_0xce39('0xc5'),_0xce39('0xc6'),'tmp');var _0x182ae5=path['join'](config[_0xce39('0xc4')],'server',_0xce39('0xc6'),'attachments');var _0x5c35b5=path['join'](_0x2e9637,_0x462688);var _0x16dea8=util[_0xce39('0xbc')](_0xce39('0xc7'),_0xf4ad2[_0xce39('0xb2')]['id'],_0x462688);var _0x250c67=path['join'](_0x2e9637,_0x16dea8);var _0x2c6170=[];_0x2c6170['push']({'model':db['User'],'as':_0xce39('0x6d'),'attributes':['id',_0xce39('0xc8')],'raw':!![]});_0x2c6170[_0xce39('0xae')]({'model':db['CmContact'],'as':_0xce39('0x5e'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x169491=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body',_0xce39('0x77'),_0xce39('0xc9'),_0xce39('0xca'),_0xce39('0x7e')],'include':_0x2c6170}];_0x169491['push']({'model':db[_0xce39('0xcb')],'as':'Account','attributes':['id','name']});_0x169491[_0xce39('0xae')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0xf4ad2[_0xce39('0xb2')]['id']},'include':_0x169491})[_0xce39('0x28')](handleEntityNotFound(_0x302f7e,null))[_0xce39('0x28')](function(_0xf743a3){if(_0xf743a3){var _0x372ac9=_0xf743a3['get']({'plain':!![]});fs[_0xce39('0xcc')](_0x5c35b5);var _0x4362a5={'channel':_0xce39('0xcd'),'account':_0x372ac9[_0xce39('0xce')]['name'],'agent':_0x372ac9[_0xce39('0xcf')]?_0x372ac9[_0xce39('0xcf')][_0xce39('0xc8')]:_0xce39('0xd0'),'createdAt':moment(_0x372ac9[_0xce39('0x77')])[_0xce39('0xbc')](_0xce39('0xbd'))[_0xce39('0x99')](),'closedAt':_0x372ac9[_0xce39('0xd1')]?moment(_0x372ac9['closedAt'])[_0xce39('0xbc')](_0xce39('0xbd'))['toString']():'','disposition':_0x372ac9[_0xce39('0xd2')],'messages':_(_0x372ac9[_0xce39('0xd3')])['filter']({'secret':![]})[_0xce39('0x2e')](function(_0x468b5a){return{'date':moment(_0x468b5a['createdAt'])[_0xce39('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x468b5a[_0xce39('0xc9')]==='out'?_0x468b5a['User']?_0x468b5a[_0xce39('0x6d')][_0xce39('0xc8')]:_0xce39('0xd4'):_0x468b5a[_0xce39('0x5e')]['firstName']+(_0x468b5a['Contact'][_0xce39('0xd5')]?'\x20'+_0x468b5a[_0xce39('0x5e')][_0xce39('0xd5')]:''),'body':_0x468b5a[_0xce39('0x6f')],'direction':_0x468b5a[_0xce39('0xc9')]===_0xce39('0xd6')?'A':'C','secret':_0x468b5a[_0xce39('0xca')],'read':_0x468b5a[_0xce39('0x7e')]};})[_0xce39('0x64')]()};return ejs[_0xce39('0xd7')](path[_0xce39('0xd8')](config[_0xce39('0xc4')],_0xce39('0xc5'),_0xce39('0xd9'),'downloadInteraction.ejs'),{'interaction':_0x4362a5})[_0xce39('0x28')](function(_0x22683e){var _0x442a8c=path[_0xce39('0xd8')](_0x5c35b5,'transcript-'+_0x372ac9['id']+'-'+_0x462688+'.pdf');var _0x2b0279={'path':_0x442a8c,'channel':_0xce39('0xcd'),'interactionId':_0x372ac9['id']};return pdf[_0xce39('0xda')](_0x22683e,_0x2b0279);})[_0xce39('0x28')](function(){return new BPromise(function(_0x3e73f5,_0x50b185){zipdir(_0x5c35b5,{'saveTo':_0x250c67},function(_0x2b382b,_0x5f2bc7){if(_0x2b382b)return _0x50b185(_0x2b382b);return _0x3e73f5(_0x5f2bc7);});})[_0xce39('0x28')](function(){return new BPromise(function(_0x56c273,_0x255a4e){rimraf(_0x5c35b5,function(_0x5d8270){if(_0x5d8270)_0x255a4e(_0x5d8270);return _0x56c273();});});})[_0xce39('0x28')](function(){return _0x302f7e[_0xce39('0xdb')](_0x250c67,_0x16dea8,function(_0x3a0d28){if(_0x3a0d28){console['log'](_0xce39('0xdc'),_0x3a0d28);}else{fs[_0xce39('0xdd')](_0x250c67);}});});});}else{return _0x302f7e[_0xce39('0x1e')](0xc8);}})['catch'](handleError(_0x302f7e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5c27678..08c5279 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 _0xaebd=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','then','map','findAll','unreadMessages','emit','catch','hasOwnProperty','events'];(function(_0xa0e629,_0x36300f){var _0x29659c=function(_0x5df6a3){while(--_0x5df6a3){_0xa0e629['push'](_0xa0e629['shift']());}};_0x29659c(++_0x36300f);}(_0xaebd,0x1e9));var _0xdaeb=function(_0xac675f,_0x5e100e){_0xac675f=_0xac675f-0x0;var _0x4362b9=_0xaebd[_0xac675f];return _0x4362b9;};'use strict';var EventEmitter=require(_0xdaeb('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xdaeb('0x1')];var SmsMessage=require(_0xdaeb('0x2'))['db'][_0xdaeb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xdaeb('0x4')](0x0);var events={'afterCreate':_0xdaeb('0x5'),'afterUpdate':'update','afterDestroy':_0xdaeb('0x6')};function emitEvent(_0x1c617a){return function(_0x1a99be,_0x1141fe,_0xee94f9){_0x1a99be['getUsers']({'attributes':['id'],'raw':!![]})[_0xdaeb('0x7')](function(_0x3f7ba1){_0x1a99be['setDataValue']('Users',_0x3f7ba1[_0xdaeb('0x8')](function(_0x11b164){return{'id':_0x11b164['id']};}));return SmsMessage[_0xdaeb('0x9')]({'where':{'SmsInteractionId':_0x1a99be['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xbb4b72){_0x1a99be['setDataValue'](_0xdaeb('0xa'),_0xbb4b72['length']);SmsInteractionEvents[_0xdaeb('0xb')](_0x1c617a+':'+_0x1a99be['id'],_0x1a99be);SmsInteractionEvents['emit'](_0x1c617a,_0x1a99be);_0xee94f9(null);})[_0xdaeb('0xc')](_0xee94f9(null));};}for(var e in events){if(events[_0xdaeb('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x8c318b,_0x309481){var _0x3c000a=function(_0x33db55){while(--_0x33db55){_0x8c318b['push'](_0x8c318b['shift']());}};_0x3c000a(++_0x309481);}(_0xdb28,0x106));var _0x8db2=function(_0x4001fe,_0x3c3cfe){_0x4001fe=_0x4001fe-0x0;var _0x1381e6=_0xdb28[_0x4001fe];return _0x1381e6;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('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 41a47e7..4f86561 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 _0xbbce=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x2dfba7,_0x116f68){var _0xdf34b6=function(_0x11269e){while(--_0x11269e){_0x2dfba7['push'](_0x2dfba7['shift']());}};_0xdf34b6(++_0x116f68);}(_0xbbce,0xbd));var _0xebbc=function(_0x4a94fb,_0x4a9122){_0x4a94fb=_0x4a94fb-0x0;var _0x360176=_0xbbce[_0x4a94fb];return _0x360176;};'use strict';var _=require(_0xebbc('0x0'));var util=require(_0xebbc('0x1'));var logger=require(_0xebbc('0x2'))(_0xebbc('0x3'));var moment=require(_0xebbc('0x4'));var BPromise=require(_0xebbc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xebbc('0x6'));var config=require(_0xebbc('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xebbc('0x8')]=function(_0x339333,_0x58cc35){return _0x339333[_0xebbc('0x9')](_0xebbc('0xa'),attributes,{'tableName':_0xebbc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50cf25,_0xbd8a11,_0x295f68){if(_0x50cf25[_0xebbc('0xc')](_0xebbc('0xd'))){_0x50cf25[_0xebbc('0xe')]=moment()[_0xebbc('0xf')](_0xebbc('0x10'));}_0x295f68(null,_0x50cf25);}}});}; \ No newline at end of file +var _0x1fbf=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1fbf,0x175));var _0xf1fb=function(_0x145fe6,_0xdc1e17){_0x145fe6=_0x145fe6-0x0;var _0x2b113a=_0x1fbf[_0x145fe6];return _0x2b113a;};'use strict';var _=require(_0xf1fb('0x0'));var util=require(_0xf1fb('0x1'));var logger=require(_0xf1fb('0x2'))(_0xf1fb('0x3'));var moment=require('moment');var BPromise=require(_0xf1fb('0x4'));var rp=require(_0xf1fb('0x5'));var fs=require('fs');var path=require(_0xf1fb('0x6'));var rimraf=require(_0xf1fb('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1fb('0x8'));module[_0xf1fb('0x9')]=function(_0x365c91,_0x1aa3ee){return _0x365c91[_0xf1fb('0xa')](_0xf1fb('0xb'),attributes,{'tableName':_0xf1fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11e303,_0x11ae97,_0x1964e3){if(_0x11e303[_0xf1fb('0xd')](_0xf1fb('0xe'))){_0x11e303[_0xf1fb('0xf')]=moment()['format'](_0xf1fb('0x10'));}_0x1964e3(null,_0x11e303);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 4a47157..ae7f558 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 _0x8f33=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f33,0x12b));var _0x38f3=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x8f33[_0x589248];return _0x486750;};'use strict';var _=require(_0x38f3('0x0'));var util=require('util');var moment=require(_0x38f3('0x1'));var BPromise=require(_0x38f3('0x2'));var rs=require(_0x38f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38f3('0x4'))['db'];var utils=require(_0x38f3('0x5'));var logger=require(_0x38f3('0x6'))(_0x38f3('0x7'));var config=require(_0x38f3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x38f3('0x9')]['http']({'port':0x232a});config['redis']=_[_0x38f3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x38f3('0xb'))(new Redis(config[_0x38f3('0xc')]));require(_0x38f3('0xd'))[_0x38f3('0xe')](socket);function respondWithRpcPromise(_0x408df6,_0x559f67,_0x4b7356){return new BPromise(function(_0x4d9923,_0x34a58d){return client[_0x38f3('0xf')](_0x408df6,_0x4b7356)[_0x38f3('0x10')](function(_0x2e9103){logger[_0x38f3('0x11')](_0x38f3('0x12'),_0x559f67,_0x38f3('0x13'));logger[_0x38f3('0x14')](_0x38f3('0x15'),_0x559f67,_0x38f3('0x13'),JSON[_0x38f3('0x16')](_0x2e9103));if(_0x2e9103[_0x38f3('0x17')]){if(_0x2e9103[_0x38f3('0x17')][_0x38f3('0x18')]===0x1f4){logger[_0x38f3('0x17')](_0x38f3('0x12'),_0x559f67,_0x2e9103['error']['message']);return _0x34a58d(_0x2e9103[_0x38f3('0x17')][_0x38f3('0x19')]);}logger[_0x38f3('0x17')](_0x38f3('0x12'),_0x559f67,_0x2e9103[_0x38f3('0x17')][_0x38f3('0x19')]);return _0x4d9923(_0x2e9103[_0x38f3('0x17')]['message']);}else{logger['info'](_0x38f3('0x12'),_0x559f67,_0x38f3('0x13'));_0x4d9923(_0x2e9103[_0x38f3('0x1a')]['message']);}})[_0x38f3('0x1b')](function(_0x4f48cb){logger[_0x38f3('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x559f67,_0x4f48cb);_0x34a58d(_0x4f48cb);});});}exports['UpdateSmsInteraction']=function(_0x1a8e8b){var _0x16b947=this;return new Promise(function(_0x2fbcac,_0x2c9fc1){return db[_0x38f3('0x1c')]['update'](_0x1a8e8b['body'],{'raw':_0x1a8e8b[_0x38f3('0x1d')]?_0x1a8e8b[_0x38f3('0x1d')][_0x38f3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a8e8b[_0x38f3('0x1d')]?_0x1a8e8b['options'][_0x38f3('0x1f')]||null:null,'attributes':_0x1a8e8b[_0x38f3('0x1d')]?_0x1a8e8b[_0x38f3('0x1d')][_0x38f3('0x20')]||null:null,'limit':_0x1a8e8b[_0x38f3('0x1d')]?_0x1a8e8b[_0x38f3('0x1d')][_0x38f3('0x21')]||null:null})[_0x38f3('0x10')](function(_0x1e80d3){logger[_0x38f3('0x11')](_0x38f3('0x22'),_0x1a8e8b);logger['debug'](_0x38f3('0x22'),_0x1a8e8b,JSON[_0x38f3('0x16')](_0x1e80d3));_0x2fbcac(_0x1e80d3);})[_0x38f3('0x1b')](function(_0x33b87c){logger['error'](_0x38f3('0x22'),_0x33b87c['message'],_0x1a8e8b);_0x2c9fc1(_0x16b947[_0x38f3('0x17')](0x1f4,_0x33b87c['message']));});});};exports[_0x38f3('0x23')]=function(_0xcae435){return new Promise(function(_0x1c9075,_0x37979b){return db[_0x38f3('0x1c')][_0x38f3('0x24')]({'where':_0xcae435[_0x38f3('0x1d')]?_0xcae435[_0x38f3('0x1d')][_0x38f3('0x1f')]||null:null})[_0x38f3('0x10')](function(_0x153f54){if(_0x153f54){return _0x153f54[_0x38f3('0x25')](_0xcae435[_0x38f3('0x26')][_0x38f3('0x27')],_[_0x38f3('0x28')](_0xcae435[_0x38f3('0x26')],[_0x38f3('0x27'),'id'])||{});}})[_0x38f3('0x29')](function(_0xd3bf79){logger['info'](_0x38f3('0x2a'),_0xcae435);logger[_0x38f3('0x14')]('AddTags',_0xcae435,JSON[_0x38f3('0x16')](_0xd3bf79));_0x1c9075(_0xd3bf79);})[_0x38f3('0x1b')](function(_0x47c82e){logger[_0x38f3('0x17')](_0x38f3('0x2a'),_0x47c82e[_0x38f3('0x19')],_0xcae435);_0x37979b(_this[_0x38f3('0x17')](0x1f4,_0x47c82e[_0x38f3('0x19')]));});});}; \ No newline at end of file +var _0x03c6=['find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToSmsInteraction'];(function(_0x26cbc7,_0x280e84){var _0x53c271=function(_0x3270b5){while(--_0x3270b5){_0x26cbc7['push'](_0x26cbc7['shift']());}};_0x53c271(++_0x280e84);}(_0x03c6,0x7e));var _0x603c=function(_0x3d68ab,_0x263121){_0x3d68ab=_0x3d68ab-0x0;var _0x5c6fae=_0x03c6[_0x3d68ab];return _0x5c6fae;};'use strict';var _=require(_0x603c('0x0'));var util=require('util');var moment=require(_0x603c('0x1'));var BPromise=require(_0x603c('0x2'));var rs=require(_0x603c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x603c('0x4'))['db'];var utils=require(_0x603c('0x5'));var logger=require(_0x603c('0x6'))(_0x603c('0x7'));var config=require('../../config/environment');var jayson=require(_0x603c('0x8'));var client=jayson['client'][_0x603c('0x9')]({'port':0x232a});config['redis']=_[_0x603c('0xa')](config[_0x603c('0xb')],{'host':_0x603c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3f8422,_0x58d7e8,_0x500619){return new BPromise(function(_0x1ba619,_0x439c5e){return client['request'](_0x3f8422,_0x500619)[_0x603c('0xd')](function(_0x274242){logger['info'](_0x603c('0xe'),_0x58d7e8,_0x603c('0xf'));logger[_0x603c('0x10')](_0x603c('0x11'),_0x58d7e8,_0x603c('0xf'),JSON['stringify'](_0x274242));if(_0x274242[_0x603c('0x12')]){if(_0x274242[_0x603c('0x12')][_0x603c('0x13')]===0x1f4){logger['error'](_0x603c('0xe'),_0x58d7e8,_0x274242['error'][_0x603c('0x14')]);return _0x439c5e(_0x274242[_0x603c('0x12')][_0x603c('0x14')]);}logger[_0x603c('0x12')](_0x603c('0xe'),_0x58d7e8,_0x274242[_0x603c('0x12')][_0x603c('0x14')]);return _0x1ba619(_0x274242[_0x603c('0x12')][_0x603c('0x14')]);}else{logger[_0x603c('0x15')](_0x603c('0xe'),_0x58d7e8,_0x603c('0xf'));_0x1ba619(_0x274242[_0x603c('0x16')][_0x603c('0x14')]);}})[_0x603c('0x17')](function(_0x14b102){logger[_0x603c('0x12')](_0x603c('0xe'),_0x58d7e8,_0x14b102);_0x439c5e(_0x14b102);});});}exports[_0x603c('0x18')]=function(_0x592408){var _0x56a2b2=this;return new Promise(function(_0x3d9ec8,_0x1b5d43){return db[_0x603c('0x19')][_0x603c('0x1a')](_0x592408[_0x603c('0x1b')],{'raw':_0x592408[_0x603c('0x1c')]?_0x592408['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592408[_0x603c('0x1c')]?_0x592408[_0x603c('0x1c')][_0x603c('0x1d')]||null:null,'attributes':_0x592408['options']?_0x592408[_0x603c('0x1c')][_0x603c('0x1e')]||null:null,'limit':_0x592408[_0x603c('0x1c')]?_0x592408['options'][_0x603c('0x1f')]||null:null})['then'](function(_0x256fd9){logger[_0x603c('0x15')](_0x603c('0x18'),_0x592408);logger[_0x603c('0x10')](_0x603c('0x18'),_0x592408,JSON[_0x603c('0x20')](_0x256fd9));_0x3d9ec8(_0x256fd9);})[_0x603c('0x17')](function(_0x43efc3){logger[_0x603c('0x12')]('UpdateSmsInteraction',_0x43efc3[_0x603c('0x14')],_0x592408);_0x1b5d43(_0x56a2b2[_0x603c('0x12')](0x1f4,_0x43efc3[_0x603c('0x14')]));});});};exports[_0x603c('0x21')]=function(_0x4b8de7){return new Promise(function(_0x4edc0b,_0x3c4a3c){return db[_0x603c('0x19')][_0x603c('0x22')]({'where':_0x4b8de7['options']?_0x4b8de7['options'][_0x603c('0x1d')]||null:null})[_0x603c('0xd')](function(_0x3801d4){if(_0x3801d4){return _0x3801d4[_0x603c('0x23')](_0x4b8de7['body'][_0x603c('0x24')],_[_0x603c('0x25')](_0x4b8de7[_0x603c('0x1b')],[_0x603c('0x24'),'id'])||{});}})[_0x603c('0x26')](function(_0x1063ef){logger[_0x603c('0x15')](_0x603c('0x27'),_0x4b8de7);logger['debug'](_0x603c('0x27'),_0x4b8de7,JSON[_0x603c('0x20')](_0x1063ef));_0x4edc0b(_0x1063ef);})['catch'](function(_0x56f35d){logger['error'](_0x603c('0x27'),_0x56f35d[_0x603c('0x14')],_0x4b8de7);_0x3c4a3c(_this[_0x603c('0x12')](0x1f4,_0x56f35d[_0x603c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b8856e3..7de7ed4 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 _0xc396=['remove','removeListener','register','length','./smsInteraction.events','save'];(function(_0x444168,_0x271bd9){var _0xec12ff=function(_0x1e68cb){while(--_0x1e68cb){_0x444168['push'](_0x444168['shift']());}};_0xec12ff(++_0x271bd9);}(_0xc396,0x1c6));var _0x6c39=function(_0xe1b0b8,_0x42b1af){_0xe1b0b8=_0xe1b0b8-0x0;var _0x27772c=_0xc396[_0xe1b0b8];return _0x27772c;};'use strict';var SmsInteractionEvents=require(_0x6c39('0x0'));var events=[_0x6c39('0x1'),_0x6c39('0x2'),'update'];function createListener(_0x334f63,_0xa61125){return function(_0x147e42){_0xa61125['emit'](_0x334f63,_0x147e42);};}function removeListener(_0x593cf4,_0x8d716d){return function(){SmsInteractionEvents[_0x6c39('0x3')](_0x593cf4,_0x8d716d);};}exports[_0x6c39('0x4')]=function(_0x5249d1){for(var _0x2e397a=0x0,_0x6fa9bc=events[_0x6c39('0x5')];_0x2e397a<_0x6fa9bc;_0x2e397a++){var _0x1f5513=events[_0x2e397a];var _0x215f81=createListener('smsInteraction:'+_0x1f5513,_0x5249d1);SmsInteractionEvents['on'](_0x1f5513,_0x215f81);}}; \ No newline at end of file +var _0xe4de=['update','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe4de,0x195));var _0xee4d=function(_0x312b38,_0x1cfe9f){_0x312b38=_0x312b38-0x0;var _0x8d8abb=_0xe4de[_0x312b38];return _0x8d8abb;};'use strict';var SmsInteractionEvents=require(_0xee4d('0x0'));var events=[_0xee4d('0x1'),_0xee4d('0x2'),_0xee4d('0x3')];function createListener(_0x56f131,_0x2c5d89){return function(_0x5012ae){_0x2c5d89['emit'](_0x56f131,_0x5012ae);};}function removeListener(_0x47dc50,_0x20235b){return function(){SmsInteractionEvents[_0xee4d('0x4')](_0x47dc50,_0x20235b);};}exports[_0xee4d('0x5')]=function(_0x3131b1){for(var _0x15dfab=0x0,_0x253632=events[_0xee4d('0x6')];_0x15dfab<_0x253632;_0x15dfab++){var _0x1b8605=events[_0x15dfab];var _0x384d20=createListener(_0xee4d('0x7')+_0x1b8605,_0x3131b1);SmsInteractionEvents['on'](_0x1b8605,_0x384d20);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 795649e..8e70d1a 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 _0x2357=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index','get','describe','/:id','isAuthenticated','show','post','tracked','sms','put','update','/:id/accept','accept','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x351953,_0x1c24bc){var _0x5ca379=function(_0x2a9d3d){while(--_0x2a9d3d){_0x351953['push'](_0x351953['shift']());}};_0x5ca379(++_0x1c24bc);}(_0x2357,0xa9));var _0x7235=function(_0x1c1f40,_0x21a793){_0x1c1f40=_0x1c1f40-0x0;var _0x5f3de5=_0x2357[_0x1c1f40];return _0x5f3de5;};'use strict';var multer=require('multer');var util=require(_0x7235('0x0'));var path=require(_0x7235('0x1'));var timeout=require(_0x7235('0x2'));var express=require(_0x7235('0x3'));var router=express[_0x7235('0x4')]();var fs_extra=require(_0x7235('0x5'));var auth=require(_0x7235('0x6'));var interaction=require(_0x7235('0x7'));var config=require('../../config/environment');var controller=require(_0x7235('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7235('0x9')]);router[_0x7235('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x7235('0xb')]);router[_0x7235('0xa')](_0x7235('0xc'),auth[_0x7235('0xd')](),controller[_0x7235('0xe')]);router[_0x7235('0xf')]('/',auth[_0x7235('0xd')](),interaction[_0x7235('0x10')](_0x7235('0x11'),'smsmessage:create'),controller['create']);router[_0x7235('0xf')]('/:id/status',controller['status']);router[_0x7235('0x12')](_0x7235('0xc'),auth['isAuthenticated'](),controller[_0x7235('0x13')]);router[_0x7235('0x12')](_0x7235('0x14'),auth[_0x7235('0xd')](),controller[_0x7235('0x15')]);router[_0x7235('0x12')]('/:id/reject',auth[_0x7235('0xd')](),controller['reject']);router[_0x7235('0x16')](_0x7235('0xc'),auth['isAuthenticated'](),controller[_0x7235('0x17')]);module[_0x7235('0x18')]=router; \ No newline at end of file +var _0xae9e=['/:id','show','post','tracked','smsmessage:create','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xae9e,0xbd));var _0xeae9=function(_0x391ca6,_0x4dd56a){_0x391ca6=_0x391ca6-0x0;var _0x4630ec=_0xae9e[_0x391ca6];return _0x4630ec;};'use strict';var multer=require('multer');var util=require(_0xeae9('0x0'));var path=require(_0xeae9('0x1'));var timeout=require(_0xeae9('0x2'));var express=require('express');var router=express[_0xeae9('0x3')]();var fs_extra=require(_0xeae9('0x4'));var auth=require(_0xeae9('0x5'));var interaction=require(_0xeae9('0x6'));var config=require(_0xeae9('0x7'));var controller=require(_0xeae9('0x8'));router[_0xeae9('0x9')]('/',auth[_0xeae9('0xa')](),controller[_0xeae9('0xb')]);router['get'](_0xeae9('0xc'),auth['isAuthenticated'](),controller[_0xeae9('0xd')]);router['get'](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller[_0xeae9('0xf')]);router[_0xeae9('0x10')]('/',auth['isAuthenticated'](),interaction[_0xeae9('0x11')]('sms',_0xeae9('0x12')),controller[_0xeae9('0x13')]);router[_0xeae9('0x10')](_0xeae9('0x14'),controller['status']);router[_0xeae9('0x15')](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller['update']);router[_0xeae9('0x15')](_0xeae9('0x16'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x17')]);router[_0xeae9('0x15')](_0xeae9('0x18'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x19')]);router[_0xeae9('0x1a')](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x1b')]);module[_0xeae9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 04da812..1a47a94 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 _0x6cae=['sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x4fff8c,_0x140337){var _0x48634=function(_0x30d0b2){while(--_0x30d0b2){_0x4fff8c['push'](_0x4fff8c['shift']());}};_0x48634(++_0x140337);}(_0x6cae,0xf0));var _0xe6ca=function(_0x39e6cd,_0x1336d3){_0x39e6cd=_0x39e6cd-0x0;var _0x95a708=_0x6cae[_0x39e6cd];return _0x95a708;};'use strict';var Sequelize=require(_0xe6ca('0x0'));module[_0xe6ca('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe6ca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe6ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe6ca('0x4')]('in',_0xe6ca('0x5')),'defaultValue':_0xe6ca('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe6ca('0x6')](0xbe)},'phone':{'type':Sequelize[_0xe6ca('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xe6ca('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe6ca('0x6')]},'providerResponse':{'type':Sequelize[_0xe6ca('0x7')]}}; \ No newline at end of file +var _0xe4cd=['sequelize','TEXT','medium','out','STRING','BOOLEAN'];(function(_0x2f8177,_0x5c54a5){var _0x4a8623=function(_0x47bcd1){while(--_0x47bcd1){_0x2f8177['push'](_0x2f8177['shift']());}};_0x4a8623(++_0x5c54a5);}(_0xe4cd,0x84));var _0xde4c=function(_0x403eda,_0x23d26b){_0x403eda=_0x403eda-0x0;var _0x7bdd17=_0xe4cd[_0x403eda];return _0x7bdd17;};'use strict';var Sequelize=require(_0xde4c('0x0'));module['exports']={'body':{'type':Sequelize[_0xde4c('0x1')](_0xde4c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xde4c('0x3')),'defaultValue':_0xde4c('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xde4c('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xde4c('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xde4c('0x4')]},'providerResponse':{'type':Sequelize[_0xde4c('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b18fb2b..690dc5e 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 _0xaafc=['destroy','name','index','map','SmsMessage','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','interface','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','delivered','Status','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','limit','offset','count','apply','reject','save','update'];(function(_0x36feba,_0x541932){var _0x358e41=function(_0x3dc247){while(--_0x3dc247){_0x36feba['push'](_0x36feba['shift']());}};_0x358e41(++_0x541932);}(_0xaafc,0x176));var _0xcaaf=function(_0x15dd77,_0x1fdec5){_0x15dd77=_0x15dd77-0x0;var _0x159400=_0xaafc[_0x15dd77];return _0x159400;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaaf('0x0'));var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require(_0xcaaf('0x2'));var rp=require(_0xcaaf('0x3'));var moment=require('moment');var BPromise=require(_0xcaaf('0x4'));var Mustache=require(_0xcaaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcaaf('0x6'));var csv=require('to-csv');var ejs=require(_0xcaaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaaf('0x8'));var squel=require(_0xcaaf('0x9'));var crypto=require(_0xcaaf('0xa'));var jsforce=require(_0xcaaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcaaf('0xc'));var querystring=require('querystring');var Papa=require(_0xcaaf('0xd'));var Redis=require('ioredis');var authService=require(_0xcaaf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaaf('0xf'));var hardwareService=require(_0xcaaf('0x10'));var logger=require(_0xcaaf('0x11'))(_0xcaaf('0x12'));var utils=require(_0xcaaf('0x13'));var config=require(_0xcaaf('0x14'));var licenseUtil=require(_0xcaaf('0x15'));var db=require(_0xcaaf('0x16'))['db'];config[_0xcaaf('0x17')]=_['defaults'](config[_0xcaaf('0x17')],{'host':_0xcaaf('0x18'),'port':0x18eb});var socket=require(_0xcaaf('0x19'))(new Redis(config[_0xcaaf('0x17')]));require(_0xcaaf('0x1a'))[_0xcaaf('0x1b')](socket);var jayson=require(_0xcaaf('0x1c'));var client=jayson[_0xcaaf('0x1d')][_0xcaaf('0x1e')]({'port':0x232c});var client9002=jayson[_0xcaaf('0x1d')][_0xcaaf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x552cf1,_0x301344,_0xb8532b,_0x7f23fb){return new BPromise(function(_0x3bb678,_0x3580ac){var _0x360078=_0x7f23fb||client;return _0x360078['request'](_0x552cf1,_0xb8532b)[_0xcaaf('0x1f')](function(_0x10ad54){logger['info'](_0xcaaf('0x20'),_0x301344,_0xcaaf('0x21'));logger[_0xcaaf('0x22')](_0xcaaf('0x23'),_0x301344,_0xcaaf('0x21'),JSON[_0xcaaf('0x24')](_0x10ad54));if(_0x10ad54[_0xcaaf('0x25')]){if(_0x10ad54[_0xcaaf('0x25')][_0xcaaf('0x26')]===0x1f4){logger[_0xcaaf('0x25')](_0xcaaf('0x20'),_0x301344,_0x10ad54['error'][_0xcaaf('0x27')]);return _0x3580ac(_0x10ad54[_0xcaaf('0x25')][_0xcaaf('0x27')]);}logger[_0xcaaf('0x25')](_0xcaaf('0x20'),_0x301344,_0x10ad54[_0xcaaf('0x25')][_0xcaaf('0x27')]);return _0x3bb678(_0x10ad54['error'][_0xcaaf('0x27')]);}else{logger[_0xcaaf('0x28')](_0xcaaf('0x20'),_0x301344,'request\x20sent');_0x3bb678(_0x10ad54[_0xcaaf('0x29')][_0xcaaf('0x27')]);}})[_0xcaaf('0x2a')](function(_0x3dac7d){logger[_0xcaaf('0x25')](_0xcaaf('0x20'),_0x301344,_0x3dac7d);_0x3580ac(_0x3dac7d);});});}function respondWithStatusCode(_0x1cc1fb,_0x4ffbab){_0x4ffbab=_0x4ffbab||0xcc;return function(_0x387319){if(_0x387319){return _0x1cc1fb['sendStatus'](_0x4ffbab);}return _0x1cc1fb['status'](_0x4ffbab)['end']();};}function respondWithResult(_0x30d68a,_0x85b4a){_0x85b4a=_0x85b4a||0xc8;return function(_0x149dbb){if(_0x149dbb){return _0x30d68a[_0xcaaf('0x2b')](_0x85b4a)[_0xcaaf('0x2c')](_0x149dbb);}};}function respondWithFilteredResult(_0x35e500,_0x20be72){return function(_0x34019c){if(_0x34019c){var _0x1523bc=typeof _0x20be72['offset']==='undefined'&&typeof _0x20be72[_0xcaaf('0x2d')]==='undefined';var _0x4429e3=_0x34019c['count'];var _0x343cd5=_0x1523bc?0x0:_0x20be72[_0xcaaf('0x2e')];var _0x2e8530=_0x1523bc?_0x34019c[_0xcaaf('0x2f')]:_0x20be72['offset']+_0x20be72[_0xcaaf('0x2d')];var _0x2d0881;if(_0x2e8530>=_0x4429e3){_0x2e8530=_0x4429e3;_0x2d0881=0xc8;}else{_0x2d0881=0xce;}_0x35e500[_0xcaaf('0x2b')](_0x2d0881);return _0x35e500['set']('Content-Range',_0x343cd5+'-'+_0x2e8530+'/'+_0x4429e3)[_0xcaaf('0x2c')](_0x34019c);}return null;};}function patchUpdates(_0xe1207f){return function(_0x5696e4){try{jsonpatch[_0xcaaf('0x30')](_0x5696e4,_0xe1207f,!![]);}catch(_0x315565){return BPromise[_0xcaaf('0x31')](_0x315565);}return _0x5696e4[_0xcaaf('0x32')]();};}function saveUpdates(_0x427510,_0x3cdf87){return function(_0x19135d){if(_0x19135d){return _0x19135d[_0xcaaf('0x33')](_0x427510)[_0xcaaf('0x1f')](function(_0x4f1eb1){return _0x4f1eb1;});}return null;};}function removeEntity(_0x48b018,_0x318e42){return function(_0x581c02){if(_0x581c02){return _0x581c02[_0xcaaf('0x34')]()[_0xcaaf('0x1f')](function(){_0x48b018[_0xcaaf('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aae88,_0x41b0f0){return function(_0x37fb0a){if(!_0x37fb0a){_0x5aae88['sendStatus'](0x194);}return _0x37fb0a;};}function handleError(_0x553ae9,_0x168082){_0x168082=_0x168082||0x1f4;return function(_0x12a4fc){logger[_0xcaaf('0x25')](_0x12a4fc['stack']);if(_0x12a4fc[_0xcaaf('0x35')]){delete _0x12a4fc['name'];}_0x553ae9[_0xcaaf('0x2b')](_0x168082)['send'](_0x12a4fc);};}exports[_0xcaaf('0x36')]=function(_0x44abfd,_0x51d6a1){var _0x5318f2={},_0x27d7d4={},_0x41bd8f={'count':0x0,'rows':[]};var _0x4a6936=_[_0xcaaf('0x37')](db[_0xcaaf('0x38')]['rawAttributes'],function(_0x210268){return{'name':_0x210268['fieldName'],'type':_0x210268[_0xcaaf('0x39')][_0xcaaf('0x3a')]};});_0x27d7d4[_0xcaaf('0x3b')]=_[_0xcaaf('0x37')](_0x4a6936,_0xcaaf('0x35'));_0x27d7d4[_0xcaaf('0x3c')]=_[_0xcaaf('0x3d')](_0x44abfd[_0xcaaf('0x3c')]);_0x27d7d4[_0xcaaf('0x3e')]=_['intersection'](_0x27d7d4['model'],_0x27d7d4[_0xcaaf('0x3c')]);_0x5318f2['attributes']=_[_0xcaaf('0x3f')](_0x27d7d4['model'],qs[_0xcaaf('0x40')](_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x40')]));_0x5318f2[_0xcaaf('0x41')]=_0x5318f2['attributes'][_0xcaaf('0x42')]?_0x5318f2[_0xcaaf('0x41')]:_0x27d7d4['model'];if(!_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x43')](_0xcaaf('0x44'))){_0x5318f2[_0xcaaf('0x2d')]=qs[_0xcaaf('0x2d')](_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x2d')]);_0x5318f2[_0xcaaf('0x2e')]=qs[_0xcaaf('0x2e')](_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x2e')]);}_0x5318f2[_0xcaaf('0x45')]=qs[_0xcaaf('0x46')](_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x46')]);_0x5318f2[_0xcaaf('0x47')]=qs['filters'](_['pick'](_0x44abfd['query'],_0x27d7d4['filters']),_0x4a6936);if(_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x48')]){_0x5318f2[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x5318f2['where'],{'$or':_['map'](_0x4a6936,function(_0x50eeb1){if(_0x50eeb1[_0xcaaf('0x39')]!==_0xcaaf('0x4a')){var _0x4aa9f3={};_0x4aa9f3[_0x50eeb1[_0xcaaf('0x35')]]={'$like':'%'+_0x44abfd[_0xcaaf('0x3c')][_0xcaaf('0x48')]+'%'};return _0x4aa9f3;}})});}_0x5318f2=_[_0xcaaf('0x49')]({},_0x5318f2,_0x44abfd['options']);var _0x1d90f3={'where':_0x5318f2[_0xcaaf('0x47')]};return db['SmsMessage']['count'](_0x1d90f3)['then'](function(_0x417f4e){_0x41bd8f[_0xcaaf('0x2f')]=_0x417f4e;if(_0x44abfd['query'][_0xcaaf('0x4b')]){_0x5318f2['include']=[{'all':!![]}];}return db['SmsMessage'][_0xcaaf('0x4c')](_0x5318f2);})[_0xcaaf('0x1f')](function(_0x1176a7){_0x41bd8f[_0xcaaf('0x4d')]=_0x1176a7;return _0x41bd8f;})[_0xcaaf('0x1f')](respondWithFilteredResult(_0x51d6a1,_0x5318f2))[_0xcaaf('0x2a')](handleError(_0x51d6a1,null));};exports[_0xcaaf('0x4e')]=function(_0x4eb630,_0x19a7ae){var _0x4a19ed={'raw':!![],'where':{'id':_0x4eb630[_0xcaaf('0x4f')]['id']}},_0x27ba34={};_0x27ba34[_0xcaaf('0x3b')]=_[_0xcaaf('0x3d')](db['SmsMessage'][_0xcaaf('0x50')]);_0x27ba34['query']=_[_0xcaaf('0x3d')](_0x4eb630[_0xcaaf('0x3c')]);_0x27ba34[_0xcaaf('0x3e')]=_[_0xcaaf('0x3f')](_0x27ba34[_0xcaaf('0x3b')],_0x27ba34[_0xcaaf('0x3c')]);_0x4a19ed[_0xcaaf('0x41')]=_[_0xcaaf('0x3f')](_0x27ba34['model'],qs[_0xcaaf('0x40')](_0x4eb630[_0xcaaf('0x3c')]['fields']));_0x4a19ed[_0xcaaf('0x41')]=_0x4a19ed['attributes'][_0xcaaf('0x42')]?_0x4a19ed[_0xcaaf('0x41')]:_0x27ba34['model'];if(_0x4eb630[_0xcaaf('0x3c')][_0xcaaf('0x4b')]){_0x4a19ed['include']=[{'all':!![]}];}_0x4a19ed=_[_0xcaaf('0x49')]({},_0x4a19ed,_0x4eb630['options']);return db[_0xcaaf('0x38')]['find'](_0x4a19ed)[_0xcaaf('0x1f')](handleEntityNotFound(_0x19a7ae,null))[_0xcaaf('0x1f')](respondWithResult(_0x19a7ae,null))[_0xcaaf('0x2a')](handleError(_0x19a7ae,null));};exports[_0xcaaf('0x51')]=function(_0x8519e9,_0x27a4cc){return db[_0xcaaf('0x38')][_0xcaaf('0x51')](_0x8519e9[_0xcaaf('0x52')],{})[_0xcaaf('0x1f')](respondWithResult(_0x27a4cc,0xc9))[_0xcaaf('0x2a')](handleError(_0x27a4cc,null));};exports['update']=function(_0x466ad8,_0xf26672){if(_0x466ad8[_0xcaaf('0x52')]['id']){delete _0x466ad8[_0xcaaf('0x52')]['id'];}return db[_0xcaaf('0x38')][_0xcaaf('0x53')]({'where':{'id':_0x466ad8[_0xcaaf('0x4f')]['id']}})[_0xcaaf('0x1f')](handleEntityNotFound(_0xf26672,null))[_0xcaaf('0x1f')](saveUpdates(_0x466ad8[_0xcaaf('0x52')],null))['then'](respondWithResult(_0xf26672,null))['catch'](handleError(_0xf26672,null));};exports[_0xcaaf('0x34')]=function(_0x6807c6,_0x5c9b2b){return db[_0xcaaf('0x38')][_0xcaaf('0x53')]({'where':{'id':_0x6807c6['params']['id']}})[_0xcaaf('0x1f')](handleEntityNotFound(_0x5c9b2b,null))[_0xcaaf('0x1f')](removeEntity(_0x5c9b2b,null))['catch'](handleError(_0x5c9b2b,null));};exports[_0xcaaf('0x54')]=function(_0x284ae3,_0x3ea4da){return db['SmsMessage'][_0xcaaf('0x54')]()[_0xcaaf('0x1f')](respondWithResult(_0x3ea4da,null))[_0xcaaf('0x2a')](handleError(_0x3ea4da,null));};var interaction_log=require(_0xcaaf('0x11'))(_0xcaaf('0x55'));exports[_0xcaaf('0x56')]=function(_0xf84a37,_0x5793c5,_0x4f5505){var _0x31cfc8={'agent':{},'channel':_0xcaaf('0x57')};if(_0xf84a37[_0xcaaf('0x52')]['id']){delete _0xf84a37['body']['id'];}_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x58')]=!![];_0xf84a37['body'][_0xcaaf('0x59')]=moment()[_0xcaaf('0x5a')](_0xcaaf('0x5b'));_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x5c')]=_0xf84a37['body'][_0xcaaf('0x5c')]||_0xf84a37[_0xcaaf('0x5d')]['id'];_0x31cfc8[_0xcaaf('0x5e')]['id']=_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x5c')];return db[_0xcaaf('0x38')][_0xcaaf('0x53')]({'where':{'id':_0xf84a37['params']['id'],'UserId':null}})[_0xcaaf('0x1f')](handleEntityNotFound(_0x5793c5,null))['then'](saveUpdates(_0xf84a37[_0xcaaf('0x52')],null))['then'](function(_0x42e400){if(_0x42e400){_0x31cfc8[_0xcaaf('0x27')]=_0x42e400[_0xcaaf('0x5f')]({'plain':!![]});return db[_0xcaaf('0x60')][_0xcaaf('0x53')]({'where':{'id':_0x42e400[_0xcaaf('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x5793c5,null))[_0xcaaf('0x1f')](function(_0x324d87){if(_0x324d87){return _0x324d87[_0xcaaf('0x33')]({'UserId':_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x5c')],'read1stAt':_[_0xcaaf('0x62')](_0x324d87[_0xcaaf('0x63')])?moment()[_0xcaaf('0x5a')](_0xcaaf('0x5b')):undefined});}return null;})[_0xcaaf('0x1f')](function(_0x588478){if(_0x588478){_0x31cfc8[_0xcaaf('0x64')]=_0x588478['get']({'plain':!![]});interaction_log[_0xcaaf('0x28')](_0xcaaf('0x65'),_0xf84a37[_0xcaaf('0x5d')]['id'],_0xf84a37[_0xcaaf('0x5d')]['name'],_0xf84a37[_0xcaaf('0x5d')][_0xcaaf('0x66')],_0x31cfc8[_0xcaaf('0x64')]['id'],_0xf84a37[_0xcaaf('0x52')]?JSON[_0xcaaf('0x24')](_0xf84a37['body']):_0xcaaf('0x67'));return respondWithRpcPromise(_0xcaaf('0x68'),_0xcaaf('0x69'),_0x31cfc8);}return null;})[_0xcaaf('0x1f')](function(_0x11424a){var _0x328971=_0xcaaf('0x6a')+_0x11424a[_0xcaaf('0x27')]['ContactId'];return db[_0xcaaf('0x6b')]['query'](_0x328971,{'type':db[_0xcaaf('0x6c')][_0xcaaf('0x6d')][_0xcaaf('0x6e')],'raw':!![]})[_0xcaaf('0x1f')](function(_0x49e9ae){return _0x49e9ae;});})[_0xcaaf('0x1f')](function(_0x50b6be){if(_0x50b6be){_0x31cfc8[_0xcaaf('0x27')][_0xcaaf('0x6f')]=_0x50b6be[0x0];if(!_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x5c')])return;return db[_0xcaaf('0x70')]['find']({'where':{'id':_0xf84a37['body'][_0xcaaf('0x5c')],'role':_0xcaaf('0x5e')},'attributes':['id',_0xcaaf('0x35'),_0xcaaf('0x71'),_0xcaaf('0x72'),_0xcaaf('0x73')],'raw':!![]});}return null;})['then'](function(_0x11e4a3){if(!_0x11e4a3)return null;_0x31cfc8[_0xcaaf('0x27')]['agent']=_0x11e4a3;return _0x31cfc8;})[_0xcaaf('0x1f')](function(_0x4cbdff){if(_0x4cbdff){if(_0xf84a37[_0xcaaf('0x52')][_0xcaaf('0x74')]){_0x31cfc8['message']['interface']=util[_0xcaaf('0x5a')](_0xcaaf('0x75'),_0xf84a37[_0xcaaf('0x5d')][_0xcaaf('0x35')]);_0x31cfc8[_0xcaaf('0x27')][_0xcaaf('0x76')]=_0x31cfc8[_0xcaaf('0x76')];_0x31cfc8[_0xcaaf('0x27')][_0xcaaf('0x77')]=_0x31cfc8[_0xcaaf('0x76')];_0x31cfc8[_0xcaaf('0x27')][_0xcaaf('0x78')]=_0xcaaf('0x56');return respondWithRpcPromise('EventManager',_0xcaaf('0x79'),{'event':_0xcaaf('0x7a'),'message':_0x31cfc8[_0xcaaf('0x27')]},client9002)[_0xcaaf('0x1f')](function(){return _0x31cfc8;});}return _0x31cfc8;}return null;})[_0xcaaf('0x1f')](respondWithResult(_0x5793c5,null))[_0xcaaf('0x2a')](handleError(_0x5793c5,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xcaaf('0x31')]=function(_0x5d981a,_0x1c307c,_0x230b48){var _0x5919db={'agent':{},'channel':_0xcaaf('0x57')};if(_0x5d981a[_0xcaaf('0x52')]['id']){delete _0x5d981a['body']['id'];}_0x5d981a[_0xcaaf('0x52')][_0xcaaf('0x5c')]=_0x5d981a[_0xcaaf('0x52')][_0xcaaf('0x5c')]||_0x5d981a[_0xcaaf('0x5d')]['id'];_0x5919db[_0xcaaf('0x5e')]['id']=_0x5d981a[_0xcaaf('0x52')]['UserId'];return db[_0xcaaf('0x38')][_0xcaaf('0x53')]({'where':{'id':_0x5d981a[_0xcaaf('0x4f')]['id'],'UserId':null}})[_0xcaaf('0x1f')](handleEntityNotFound(_0x1c307c,null))[_0xcaaf('0x1f')](function(_0x5db5da){if(_0x5db5da){_0x5919db[_0xcaaf('0x27')]=_0x5db5da['get']({'plain':!![]});return db[_0xcaaf('0x60')]['find']({'where':{'id':_0x5db5da[_0xcaaf('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x1c307c,null))['then'](function(_0x3d45df){if(_0x3d45df){_0x5919db[_0xcaaf('0x64')]=_0x3d45df[_0xcaaf('0x5f')]({'plain':!![]});interaction_log[_0xcaaf('0x28')](_0xcaaf('0x7b'),_0x5d981a['user']['id'],_0x5d981a[_0xcaaf('0x5d')][_0xcaaf('0x35')],_0x5d981a[_0xcaaf('0x5d')][_0xcaaf('0x66')],_0x5919db['interaction']['id'],_0x5d981a['body']?JSON['stringify'](_0x5d981a[_0xcaaf('0x52')]):_0xcaaf('0x67'));return respondWithRpcPromise(_0xcaaf('0x7c'),'rejectMessage',_0x5919db);}return null;})[_0xcaaf('0x1f')](function(_0x216853){var _0x5ae4fd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x216853[_0xcaaf('0x27')][_0xcaaf('0x7d')];return db['sequelize']['query'](_0x5ae4fd,{'type':db['Sequelize'][_0xcaaf('0x6d')][_0xcaaf('0x6e')],'raw':!![]})[_0xcaaf('0x1f')](function(_0x25c427){return _0x25c427;});})[_0xcaaf('0x1f')](function(_0x4b6eba){if(_0x4b6eba){_0x5919db['message'][_0xcaaf('0x6f')]=_0x4b6eba[0x0];if(!_0x5d981a[_0xcaaf('0x52')]['UserId'])return;return db[_0xcaaf('0x70')][_0xcaaf('0x53')]({'where':{'id':_0x5d981a['body'][_0xcaaf('0x5c')],'role':_0xcaaf('0x5e')},'attributes':['id',_0xcaaf('0x35'),_0xcaaf('0x71'),_0xcaaf('0x72'),_0xcaaf('0x73')],'raw':!![]});}return null;})[_0xcaaf('0x1f')](function(_0xf47d74){if(!_0xf47d74)return null;_0x5919db[_0xcaaf('0x27')][_0xcaaf('0x5e')]=_0xf47d74;return _0x5919db;})['then'](function(_0x43fd5a){if(_0x43fd5a){_0x43fd5a[_0xcaaf('0x27')][_0xcaaf('0x7e')]=util['format'](_0xcaaf('0x75'),_0x5d981a[_0xcaaf('0x5d')][_0xcaaf('0x35')]);_0x43fd5a[_0xcaaf('0x27')]['channel']=_0x5919db[_0xcaaf('0x76')];_0x43fd5a['message']['motionChannel']=_0x5919db[_0xcaaf('0x76')];_0x43fd5a[_0xcaaf('0x27')]['event']=_0xcaaf('0x31');respondWithRpcPromise(_0xcaaf('0x79'),'EventManager',{'event':_0xcaaf('0x7f'),'message':_0x43fd5a[_0xcaaf('0x27')]},client9002);return _0x5919db;}return null;})[_0xcaaf('0x1f')](respondWithResult(_0x1c307c,null))['catch'](handleError(_0x1c307c,null));};exports[_0xcaaf('0x2b')]=function(_0x84e3c7,_0x16cf92,_0x21b516){if(_0x84e3c7[_0xcaaf('0x52')]['id']){delete _0x84e3c7[_0xcaaf('0x52')]['id'];}var _0x13511a;return db[_0xcaaf('0x38')][_0xcaaf('0x53')]({'where':{'id':_0x84e3c7['params']['id']}})[_0xcaaf('0x1f')](handleEntityNotFound(_0x16cf92,null))[_0xcaaf('0x1f')](function(_0x5aa209){if(_0x5aa209){_0x13511a=_0x5aa209;return db['SmsAccount'][_0xcaaf('0x53')]({'where':{'id':_0x5aa209[_0xcaaf('0x80')]}});}})['then'](handleEntityNotFound(_0x16cf92,null))['then'](function(_0x812d19){if(_0x812d19){logger[_0xcaaf('0x22')](_0xcaaf('0x23'),_0xcaaf('0x2b'),_0xcaaf('0x81'),_0x812d19[_0xcaaf('0x39')],util[_0xcaaf('0x82')](_0x84e3c7[_0xcaaf('0x52')],{'showHidden':![],'depth':null}));switch(_0x812d19[_0xcaaf('0x39')]){case _0xcaaf('0x83'):if(_0x84e3c7['body'][_0xcaaf('0x84')]&&_0x84e3c7[_0xcaaf('0x52')][_0xcaaf('0x84')]===_0x13511a[_0xcaaf('0x85')]){return _0x13511a['update']({'read':!![]});}else{logger[_0xcaaf('0x25')](_0xcaaf('0x86'),_0xcaaf('0x2b'),_0xcaaf('0x83'),util[_0xcaaf('0x82')](_0x84e3c7[_0xcaaf('0x52')],{'showHidden':![],'depth':null}));}break;case _0xcaaf('0x87'):if(_0x84e3c7[_0xcaaf('0x52')]['MessageUUID']&&_0x84e3c7['body']['MessageUUID']===_0x13511a[_0xcaaf('0x85')]&&_['indexOf'](['sent',_0xcaaf('0x88')],_0x84e3c7[_0xcaaf('0x52')][_0xcaaf('0x89')])>=0x0){return _0x13511a[_0xcaaf('0x33')]({'read':!![]});}else{logger[_0xcaaf('0x25')](_0xcaaf('0x86'),_0xcaaf('0x2b'),_0xcaaf('0x8a'),util[_0xcaaf('0x82')](_0x84e3c7[_0xcaaf('0x52')],{'showHidden':![],'depth':null}));}break;case _0xcaaf('0x8b'):var _0x43b83f=_0x84e3c7['body'][_0xcaaf('0x8c')][0x0];if(_0x43b83f[_0xcaaf('0x2b')][_0xcaaf('0x8d')]==='DELIVERED'){return _0x13511a[_0xcaaf('0x33')]({'read':!![]});}else{logger[_0xcaaf('0x25')](_0xcaaf('0x86'),_0xcaaf('0x2b'),_0xcaaf('0x8b'),util['inspect'](_0x84e3c7[_0xcaaf('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x13511a;}})[_0xcaaf('0x1f')](respondWithResult(_0x16cf92,null))[_0xcaaf('0x2a')](handleError(_0x16cf92,null));}; \ No newline at end of file +var _0x29b1=['fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','internal','manual','interface','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','fullname','SIP/%s','motionChannel','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','name','send','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0x29b1,0x16d));var _0x129b=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x29b1[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require(_0x129b('0x2'));var jsonpatch=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var moment=require('moment');var BPromise=require(_0x129b('0x5'));var Mustache=require(_0x129b('0x6'));var util=require(_0x129b('0x7'));var path=require(_0x129b('0x8'));var sox=require(_0x129b('0x9'));var csv=require(_0x129b('0xa'));var ejs=require(_0x129b('0xb'));var fs=require('fs');var fs_extra=require(_0x129b('0xc'));var _=require('lodash');var squel=require(_0x129b('0xd'));var crypto=require('crypto');var jsforce=require(_0x129b('0xe'));var deskjs=require(_0x129b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x129b('0x10'));var Papa=require(_0x129b('0x11'));var Redis=require('ioredis');var authService=require(_0x129b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x129b('0x13'));var hardwareService=require(_0x129b('0x14'));var logger=require(_0x129b('0x15'))('api');var utils=require(_0x129b('0x16'));var config=require(_0x129b('0x17'));var licenseUtil=require(_0x129b('0x18'));var db=require(_0x129b('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x129b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x129b('0x1b')]));require(_0x129b('0x1c'))[_0x129b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x129b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x129b('0x1e')][_0x129b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x17fff2,_0x50d62b,_0x46a6a4,_0x453ba2){return new BPromise(function(_0x1364f8,_0x2ba58c){var _0x30785a=_0x453ba2||client;return _0x30785a[_0x129b('0x20')](_0x17fff2,_0x46a6a4)[_0x129b('0x21')](function(_0x169d4c){logger[_0x129b('0x22')](_0x129b('0x23'),_0x50d62b,_0x129b('0x24'));logger[_0x129b('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x50d62b,_0x129b('0x24'),JSON[_0x129b('0x26')](_0x169d4c));if(_0x169d4c[_0x129b('0x27')]){if(_0x169d4c[_0x129b('0x27')][_0x129b('0x28')]===0x1f4){logger[_0x129b('0x27')](_0x129b('0x23'),_0x50d62b,_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);return _0x2ba58c(_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);}logger[_0x129b('0x27')]('SmsMessage,\x20%s,\x20%s',_0x50d62b,_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);return _0x1364f8(_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x50d62b,_0x129b('0x24'));_0x1364f8(_0x169d4c['result'][_0x129b('0x29')]);}})[_0x129b('0x2a')](function(_0x4c733d){logger['error'](_0x129b('0x23'),_0x50d62b,_0x4c733d);_0x2ba58c(_0x4c733d);});});}function respondWithStatusCode(_0x1c6d9f,_0x2c7243){_0x2c7243=_0x2c7243||0xcc;return function(_0x10288e){if(_0x10288e){return _0x1c6d9f[_0x129b('0x2b')](_0x2c7243);}return _0x1c6d9f[_0x129b('0x2c')](_0x2c7243)[_0x129b('0x2d')]();};}function respondWithResult(_0x3fec4b,_0x4aaa74){_0x4aaa74=_0x4aaa74||0xc8;return function(_0x275ff0){if(_0x275ff0){return _0x3fec4b[_0x129b('0x2c')](_0x4aaa74)['json'](_0x275ff0);}};}function respondWithFilteredResult(_0x3a852a,_0x519053){return function(_0x4179e1){if(_0x4179e1){var _0x4d1017=typeof _0x519053[_0x129b('0x2e')]===_0x129b('0x2f')&&typeof _0x519053[_0x129b('0x30')]===_0x129b('0x2f');var _0x917382=_0x4179e1[_0x129b('0x31')];var _0x296461=_0x4d1017?0x0:_0x519053[_0x129b('0x2e')];var _0x371e89=_0x4d1017?_0x4179e1['count']:_0x519053[_0x129b('0x2e')]+_0x519053[_0x129b('0x30')];var _0x480338;if(_0x371e89>=_0x917382){_0x371e89=_0x917382;_0x480338=0xc8;}else{_0x480338=0xce;}_0x3a852a[_0x129b('0x2c')](_0x480338);return _0x3a852a[_0x129b('0x32')](_0x129b('0x33'),_0x296461+'-'+_0x371e89+'/'+_0x917382)['json'](_0x4179e1);}return null;};}function patchUpdates(_0x17e5ed){return function(_0xf2d43){try{jsonpatch['apply'](_0xf2d43,_0x17e5ed,!![]);}catch(_0x5a1229){return BPromise[_0x129b('0x34')](_0x5a1229);}return _0xf2d43['save']();};}function saveUpdates(_0x333b32,_0x4eb857){return function(_0x15b01c){if(_0x15b01c){return _0x15b01c[_0x129b('0x35')](_0x333b32)['then'](function(_0x4249a8){return _0x4249a8;});}return null;};}function removeEntity(_0x141d8f,_0x3e80a9){return function(_0x5bd0f6){if(_0x5bd0f6){return _0x5bd0f6[_0x129b('0x36')]()[_0x129b('0x21')](function(){_0x141d8f[_0x129b('0x2c')](0xcc)[_0x129b('0x2d')]();});}};}function handleEntityNotFound(_0x5a6c3e,_0x55937f){return function(_0x49189e){if(!_0x49189e){_0x5a6c3e[_0x129b('0x2b')](0x194);}return _0x49189e;};}function handleError(_0x52e037,_0x39e68d){_0x39e68d=_0x39e68d||0x1f4;return function(_0x1bc5ea){logger[_0x129b('0x27')](_0x1bc5ea['stack']);if(_0x1bc5ea['name']){delete _0x1bc5ea[_0x129b('0x37')];}_0x52e037[_0x129b('0x2c')](_0x39e68d)[_0x129b('0x38')](_0x1bc5ea);};}exports['index']=function(_0x25569f,_0x2588e3){var _0x536aa3={},_0xf2da76={},_0x158cfb={'count':0x0,'rows':[]};var _0x4e5410=_['map'](db[_0x129b('0x39')][_0x129b('0x3a')],function(_0x2a81e8){return{'name':_0x2a81e8[_0x129b('0x3b')],'type':_0x2a81e8[_0x129b('0x3c')][_0x129b('0x3d')]};});_0xf2da76[_0x129b('0x3e')]=_['map'](_0x4e5410,'name');_0xf2da76[_0x129b('0x3f')]=_['keys'](_0x25569f[_0x129b('0x3f')]);_0xf2da76[_0x129b('0x40')]=_[_0x129b('0x41')](_0xf2da76[_0x129b('0x3e')],_0xf2da76[_0x129b('0x3f')]);_0x536aa3[_0x129b('0x42')]=_['intersection'](_0xf2da76['model'],qs[_0x129b('0x43')](_0x25569f['query'][_0x129b('0x43')]));_0x536aa3[_0x129b('0x42')]=_0x536aa3[_0x129b('0x42')][_0x129b('0x44')]?_0x536aa3['attributes']:_0xf2da76['model'];if(!_0x25569f['query'][_0x129b('0x45')]('nolimit')){_0x536aa3[_0x129b('0x30')]=qs['limit'](_0x25569f[_0x129b('0x3f')]['limit']);_0x536aa3[_0x129b('0x2e')]=qs[_0x129b('0x2e')](_0x25569f[_0x129b('0x3f')][_0x129b('0x2e')]);}_0x536aa3[_0x129b('0x46')]=qs[_0x129b('0x47')](_0x25569f['query']['sort']);_0x536aa3['where']=qs[_0x129b('0x40')](_[_0x129b('0x48')](_0x25569f[_0x129b('0x3f')],_0xf2da76['filters']),_0x4e5410);if(_0x25569f['query'][_0x129b('0x49')]){_0x536aa3[_0x129b('0x4a')]=_[_0x129b('0x4b')](_0x536aa3[_0x129b('0x4a')],{'$or':_[_0x129b('0x4c')](_0x4e5410,function(_0x123562){if(_0x123562['type']!==_0x129b('0x4d')){var _0x6cc4cb={};_0x6cc4cb[_0x123562['name']]={'$like':'%'+_0x25569f[_0x129b('0x3f')][_0x129b('0x49')]+'%'};return _0x6cc4cb;}})});}_0x536aa3=_[_0x129b('0x4b')]({},_0x536aa3,_0x25569f[_0x129b('0x4e')]);var _0xa70a30={'where':_0x536aa3[_0x129b('0x4a')]};return db[_0x129b('0x39')][_0x129b('0x31')](_0xa70a30)[_0x129b('0x21')](function(_0x336f72){_0x158cfb[_0x129b('0x31')]=_0x336f72;if(_0x25569f[_0x129b('0x3f')][_0x129b('0x4f')]){_0x536aa3[_0x129b('0x50')]=[{'all':!![]}];}return db[_0x129b('0x39')][_0x129b('0x51')](_0x536aa3);})[_0x129b('0x21')](function(_0x38bd1a){_0x158cfb[_0x129b('0x52')]=_0x38bd1a;return _0x158cfb;})[_0x129b('0x21')](respondWithFilteredResult(_0x2588e3,_0x536aa3))['catch'](handleError(_0x2588e3,null));};exports[_0x129b('0x53')]=function(_0x128d59,_0x37dcfd){var _0x27a469={'raw':!![],'where':{'id':_0x128d59['params']['id']}},_0x56a8ff={};_0x56a8ff[_0x129b('0x3e')]=_[_0x129b('0x54')](db[_0x129b('0x39')]['rawAttributes']);_0x56a8ff['query']=_[_0x129b('0x54')](_0x128d59[_0x129b('0x3f')]);_0x56a8ff['filters']=_[_0x129b('0x41')](_0x56a8ff[_0x129b('0x3e')],_0x56a8ff[_0x129b('0x3f')]);_0x27a469['attributes']=_[_0x129b('0x41')](_0x56a8ff[_0x129b('0x3e')],qs[_0x129b('0x43')](_0x128d59[_0x129b('0x3f')]['fields']));_0x27a469['attributes']=_0x27a469[_0x129b('0x42')][_0x129b('0x44')]?_0x27a469[_0x129b('0x42')]:_0x56a8ff[_0x129b('0x3e')];if(_0x128d59[_0x129b('0x3f')]['includeAll']){_0x27a469[_0x129b('0x50')]=[{'all':!![]}];}_0x27a469=_[_0x129b('0x4b')]({},_0x27a469,_0x128d59[_0x129b('0x4e')]);return db[_0x129b('0x39')][_0x129b('0x55')](_0x27a469)[_0x129b('0x21')](handleEntityNotFound(_0x37dcfd,null))[_0x129b('0x21')](respondWithResult(_0x37dcfd,null))[_0x129b('0x2a')](handleError(_0x37dcfd,null));};exports[_0x129b('0x56')]=function(_0x11fae9,_0x131cd4){return db[_0x129b('0x39')][_0x129b('0x56')](_0x11fae9[_0x129b('0x57')],{})[_0x129b('0x21')](respondWithResult(_0x131cd4,0xc9))[_0x129b('0x2a')](handleError(_0x131cd4,null));};exports[_0x129b('0x35')]=function(_0x59f400,_0x2cd9fd){if(_0x59f400[_0x129b('0x57')]['id']){delete _0x59f400[_0x129b('0x57')]['id'];}return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x59f400[_0x129b('0x58')]['id']}})[_0x129b('0x21')](handleEntityNotFound(_0x2cd9fd,null))[_0x129b('0x21')](saveUpdates(_0x59f400['body'],null))[_0x129b('0x21')](respondWithResult(_0x2cd9fd,null))['catch'](handleError(_0x2cd9fd,null));};exports[_0x129b('0x36')]=function(_0x56fa31,_0x484442){return db['SmsMessage'][_0x129b('0x55')]({'where':{'id':_0x56fa31['params']['id']}})[_0x129b('0x21')](handleEntityNotFound(_0x484442,null))[_0x129b('0x21')](removeEntity(_0x484442,null))[_0x129b('0x2a')](handleError(_0x484442,null));};exports[_0x129b('0x59')]=function(_0x255571,_0x502086){return db[_0x129b('0x39')][_0x129b('0x59')]()[_0x129b('0x21')](respondWithResult(_0x502086,null))[_0x129b('0x2a')](handleError(_0x502086,null));};var interaction_log=require('../../config/logger')(_0x129b('0x5a'));exports[_0x129b('0x5b')]=function(_0x4638be,_0x508745,_0x52ece3){var _0x3fe7ac={'agent':{},'channel':_0x129b('0x5c')};if(_0x4638be[_0x129b('0x57')]['id']){delete _0x4638be[_0x129b('0x57')]['id'];}_0x4638be[_0x129b('0x57')][_0x129b('0x5d')]=!![];_0x4638be['body'][_0x129b('0x5e')]=moment()[_0x129b('0x5f')](_0x129b('0x60'));_0x4638be[_0x129b('0x57')]['UserId']=_0x4638be[_0x129b('0x57')][_0x129b('0x61')]||_0x4638be[_0x129b('0x62')]['id'];_0x3fe7ac[_0x129b('0x63')]['id']=_0x4638be[_0x129b('0x57')][_0x129b('0x61')];return db['SmsMessage'][_0x129b('0x55')]({'where':{'id':_0x4638be['params']['id'],'UserId':null}})[_0x129b('0x21')](handleEntityNotFound(_0x508745,null))['then'](saveUpdates(_0x4638be[_0x129b('0x57')],null))[_0x129b('0x21')](function(_0x3ee493){if(_0x3ee493){_0x3fe7ac['message']=_0x3ee493[_0x129b('0x64')]({'plain':!![]});return db[_0x129b('0x65')][_0x129b('0x55')]({'where':{'id':_0x3ee493['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x508745,null))[_0x129b('0x21')](function(_0x2a263f){if(_0x2a263f){return _0x2a263f['update']({'UserId':_0x4638be[_0x129b('0x57')][_0x129b('0x61')],'read1stAt':_[_0x129b('0x66')](_0x2a263f['read1stAt'])?moment()[_0x129b('0x5f')](_0x129b('0x60')):undefined});}return null;})[_0x129b('0x21')](function(_0x593579){if(_0x593579){_0x3fe7ac[_0x129b('0x67')]=_0x593579[_0x129b('0x64')]({'plain':!![]});interaction_log[_0x129b('0x22')](_0x129b('0x68'),_0x4638be[_0x129b('0x62')]['id'],_0x4638be['user'][_0x129b('0x37')],_0x4638be['user'][_0x129b('0x69')],_0x3fe7ac['interaction']['id'],_0x4638be[_0x129b('0x57')]?JSON[_0x129b('0x26')](_0x4638be[_0x129b('0x57')]):_0x129b('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3fe7ac);}return null;})['then'](function(_0x24fc30){var _0xb8601f=_0x129b('0x6b')+_0x24fc30['message'][_0x129b('0x6c')];return db[_0x129b('0x6d')][_0x129b('0x3f')](_0xb8601f,{'type':db[_0x129b('0x6e')][_0x129b('0x6f')][_0x129b('0x70')],'raw':!![]})[_0x129b('0x21')](function(_0x51f823){return _0x51f823;});})['then'](function(_0x7d58f3){if(_0x7d58f3){_0x3fe7ac[_0x129b('0x29')]['contact']=_0x7d58f3[0x0];if(!_0x4638be[_0x129b('0x57')][_0x129b('0x61')])return;return db[_0x129b('0x71')][_0x129b('0x55')]({'where':{'id':_0x4638be[_0x129b('0x57')][_0x129b('0x61')],'role':_0x129b('0x63')},'attributes':['id',_0x129b('0x37'),'fullname','email',_0x129b('0x72')],'raw':!![]});}return null;})['then'](function(_0x36379c){if(!_0x36379c)return null;_0x3fe7ac['message'][_0x129b('0x63')]=_0x36379c;return _0x3fe7ac;})[_0x129b('0x21')](function(_0x29aa1c){if(_0x29aa1c){if(_0x4638be[_0x129b('0x57')][_0x129b('0x73')]){_0x3fe7ac[_0x129b('0x29')][_0x129b('0x74')]=util[_0x129b('0x5f')]('SIP/%s',_0x4638be[_0x129b('0x62')][_0x129b('0x37')]);_0x3fe7ac[_0x129b('0x29')][_0x129b('0x75')]=_0x3fe7ac[_0x129b('0x75')];_0x3fe7ac['message']['motionChannel']=_0x3fe7ac['channel'];_0x3fe7ac[_0x129b('0x29')][_0x129b('0x76')]=_0x129b('0x5b');return respondWithRpcPromise(_0x129b('0x77'),_0x129b('0x77'),{'event':_0x129b('0x78'),'message':_0x3fe7ac[_0x129b('0x29')]},client9002)[_0x129b('0x21')](function(){return _0x3fe7ac;});}return _0x3fe7ac;}return null;})[_0x129b('0x21')](respondWithResult(_0x508745,null))[_0x129b('0x2a')](handleError(_0x508745,null));};var interaction_log=require(_0x129b('0x15'))(_0x129b('0x5a'));exports['reject']=function(_0x51778b,_0x1c4169,_0x5465e5){var _0x5ea7d3={'agent':{},'channel':'sms'};if(_0x51778b[_0x129b('0x57')]['id']){delete _0x51778b[_0x129b('0x57')]['id'];}_0x51778b['body'][_0x129b('0x61')]=_0x51778b[_0x129b('0x57')][_0x129b('0x61')]||_0x51778b[_0x129b('0x62')]['id'];_0x5ea7d3[_0x129b('0x63')]['id']=_0x51778b[_0x129b('0x57')][_0x129b('0x61')];return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x51778b['params']['id'],'UserId':null}})[_0x129b('0x21')](handleEntityNotFound(_0x1c4169,null))[_0x129b('0x21')](function(_0x549cbe){if(_0x549cbe){_0x5ea7d3[_0x129b('0x29')]=_0x549cbe[_0x129b('0x64')]({'plain':!![]});return db[_0x129b('0x65')][_0x129b('0x55')]({'where':{'id':_0x549cbe[_0x129b('0x79')]}});}return null;})[_0x129b('0x21')](handleEntityNotFound(_0x1c4169,null))['then'](function(_0x2c2908){if(_0x2c2908){_0x5ea7d3[_0x129b('0x67')]=_0x2c2908[_0x129b('0x64')]({'plain':!![]});interaction_log['info'](_0x129b('0x7a'),_0x51778b['user']['id'],_0x51778b[_0x129b('0x62')][_0x129b('0x37')],_0x51778b[_0x129b('0x62')][_0x129b('0x69')],_0x5ea7d3['interaction']['id'],_0x51778b[_0x129b('0x57')]?JSON[_0x129b('0x26')](_0x51778b[_0x129b('0x57')]):_0x129b('0x6a'));return respondWithRpcPromise(_0x129b('0x7b'),_0x129b('0x7c'),_0x5ea7d3);}return null;})[_0x129b('0x21')](function(_0x143c29){var _0x4b6219=_0x129b('0x6b')+_0x143c29['message'][_0x129b('0x6c')];return db[_0x129b('0x6d')]['query'](_0x4b6219,{'type':db[_0x129b('0x6e')][_0x129b('0x6f')][_0x129b('0x70')],'raw':!![]})[_0x129b('0x21')](function(_0x8a417e){return _0x8a417e;});})[_0x129b('0x21')](function(_0x2af88a){if(_0x2af88a){_0x5ea7d3[_0x129b('0x29')][_0x129b('0x7d')]=_0x2af88a[0x0];if(!_0x51778b[_0x129b('0x57')][_0x129b('0x61')])return;return db[_0x129b('0x71')][_0x129b('0x55')]({'where':{'id':_0x51778b[_0x129b('0x57')][_0x129b('0x61')],'role':_0x129b('0x63')},'attributes':['id',_0x129b('0x37'),_0x129b('0x7e'),'email',_0x129b('0x72')],'raw':!![]});}return null;})['then'](function(_0x49c53c){if(!_0x49c53c)return null;_0x5ea7d3[_0x129b('0x29')][_0x129b('0x63')]=_0x49c53c;return _0x5ea7d3;})[_0x129b('0x21')](function(_0xecf1dd){if(_0xecf1dd){_0xecf1dd[_0x129b('0x29')][_0x129b('0x74')]=util[_0x129b('0x5f')](_0x129b('0x7f'),_0x51778b[_0x129b('0x62')]['name']);_0xecf1dd[_0x129b('0x29')][_0x129b('0x75')]=_0x5ea7d3['channel'];_0xecf1dd[_0x129b('0x29')][_0x129b('0x80')]=_0x5ea7d3[_0x129b('0x75')];_0xecf1dd[_0x129b('0x29')][_0x129b('0x76')]=_0x129b('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x129b('0x81'),'message':_0xecf1dd[_0x129b('0x29')]},client9002);return _0x5ea7d3;}return null;})[_0x129b('0x21')](respondWithResult(_0x1c4169,null))['catch'](handleError(_0x1c4169,null));};exports['status']=function(_0x539104,_0x37e6a6,_0x5ef869){if(_0x539104[_0x129b('0x57')]['id']){delete _0x539104[_0x129b('0x57')]['id'];}var _0x361e00;return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x539104[_0x129b('0x58')]['id']}})['then'](handleEntityNotFound(_0x37e6a6,null))[_0x129b('0x21')](function(_0x114160){if(_0x114160){_0x361e00=_0x114160;return db[_0x129b('0x82')][_0x129b('0x55')]({'where':{'id':_0x114160[_0x129b('0x83')]}});}})[_0x129b('0x21')](handleEntityNotFound(_0x37e6a6,null))['then'](function(_0x5a90d1){if(_0x5a90d1){logger[_0x129b('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x129b('0x2c'),'received\x20delivery\x20report\x20from',_0x5a90d1[_0x129b('0x3c')],util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));switch(_0x5a90d1[_0x129b('0x3c')]){case _0x129b('0x85'):if(_0x539104[_0x129b('0x57')]['MessageSid']&&_0x539104['body'][_0x129b('0x86')]===_0x361e00[_0x129b('0x87')]){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger[_0x129b('0x27')](_0x129b('0x88'),_0x129b('0x2c'),_0x129b('0x85'),util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x129b('0x89'):if(_0x539104['body'][_0x129b('0x8a')]&&_0x539104[_0x129b('0x57')][_0x129b('0x8a')]===_0x361e00[_0x129b('0x87')]&&_['indexOf'](['sent',_0x129b('0x8b')],_0x539104['body'][_0x129b('0x8c')])>=0x0){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger[_0x129b('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x129b('0x2c'),'plivio',util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x129b('0x8d'):var _0x2a77f6=_0x539104[_0x129b('0x57')]['results'][0x0];if(_0x2a77f6[_0x129b('0x2c')][_0x129b('0x8e')]===_0x129b('0x8f')){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger['error'](_0x129b('0x88'),'status',_0x129b('0x8d'),util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x361e00;}})[_0x129b('0x21')](respondWithResult(_0x37e6a6,null))[_0x129b('0x2a')](handleError(_0x37e6a6,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 9c26719..415a63c 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 _0x762b=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x762b,0x172));var _0xb762=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x762b[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xb762('0x0'));var SmsMessage=require(_0xb762('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb762('0x2')](0x0);var events={'afterCreate':_0xb762('0x3'),'afterUpdate':_0xb762('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c4325){return function(_0x2179d0,_0x41b243,_0x116384){SmsMessageEvents[_0xb762('0x5')](_0x1c4325+':'+_0x2179d0['id'],_0x2179d0);SmsMessageEvents['emit'](_0x1c4325,_0x2179d0);_0x116384(null);};}for(var e in events){if(events[_0xb762('0x6')](e)){var event=events[e];SmsMessage[_0xb762('0x7')](e,emitEvent(event));}}module[_0xb762('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xf7da=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3cfe5b,_0x2e919c){var _0x3bdb2a=function(_0x296e62){while(--_0x296e62){_0x3cfe5b['push'](_0x3cfe5b['shift']());}};_0x3bdb2a(++_0x2e919c);}(_0xf7da,0x155));var _0xaf7d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf7da[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0xaf7d('0x0'));var SmsMessage=require(_0xaf7d('0x1'))['db'][_0xaf7d('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xaf7d('0x3')](0x0);var events={'afterCreate':_0xaf7d('0x4'),'afterUpdate':_0xaf7d('0x5'),'afterDestroy':_0xaf7d('0x6')};function emitEvent(_0xcf83d2){return function(_0x1e4f06,_0x587387,_0x136b89){SmsMessageEvents[_0xaf7d('0x7')](_0xcf83d2+':'+_0x1e4f06['id'],_0x1e4f06);SmsMessageEvents[_0xaf7d('0x7')](_0xcf83d2,_0x1e4f06);_0x136b89(null);};}for(var e in events){if(events[_0xaf7d('0x8')](e)){var event=events[e];SmsMessage[_0xaf7d('0x9')](e,emitEvent(event));}}module[_0xaf7d('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index bcbbfb3..ad7ca53 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 _0xd957=['phone','create','/api/sms/messages/','/status?token=','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/','password','smsMethod','sender','username','GET','split','sms','POST','user_key','session_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','head','message_id','clickSend','authId','senderString','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','infobip','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','base64','bandwidth','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','SmsInteraction','findOne','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var logger=require('../../config/logger')(_0x7d95('0x2'));var moment=require(_0x7d95('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d95('0x4'));var fs=require('fs');var path=require(_0x7d95('0x5'));var rimraf=require(_0x7d95('0x6'));var config=require(_0x7d95('0x7'));var attributes=require(_0x7d95('0x8'));module[_0x7d95('0x9')]=function(_0x2de581,_0x514355){return _0x2de581[_0x7d95('0xa')](_0x7d95('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x7d95('0xc'),'fields':[_0x7d95('0xc')]},{'name':_0x7d95('0xd'),'fields':[_0x7d95('0xe')],'type':_0x7d95('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x572e5f,_0x2e0589,_0x109cec){var _0x33f544=_0x2de581[_0x7d95('0x10')];var _0x2af3bd=_0x572e5f['get']({'plain':!![]});if(_0x2af3bd['direction'][_0x7d95('0x11')]()==='in'||_0x2af3bd[_0x7d95('0x12')]['toLowerCase']()===_0x7d95('0x13')&&!_0x2af3bd[_0x7d95('0x14')]&&!_[_0x7d95('0x15')](_0x2af3bd[_0x7d95('0x16')])){_0x33f544[_0x7d95('0x17')][_0x7d95('0x18')]({'where':{'id':_0x2af3bd['SmsInteractionId']}})[_0x7d95('0x19')](function(_0x56e18f){if(_0x56e18f){_0x56e18f[_0x7d95('0x1a')]({'lastMsgAt':_0x2af3bd['createdAt'],'lastMsgDirection':_0x2af3bd[_0x7d95('0x12')]['toLowerCase']()});}})[_0x7d95('0x1b')](function(_0x30c2f8){console[_0x7d95('0x1c')](_0x30c2f8);});}if(_0x2af3bd[_0x7d95('0x12')]==='out'&&!_0x2af3bd['secret']){var _0x186198;_0x33f544[_0x7d95('0x1d')][_0x7d95('0x1e')]({'where':{'id':_0x2af3bd[_0x7d95('0x1f')]},'raw':!![]})['then'](function(_0x1c656c){_0x186198=_0x1c656c;if(_0x186198&&_0x186198[_0x7d95('0x20')]){switch(_0x186198['type']){case _0x7d95('0x21'):var _0x1b5629=require(_0x7d95('0x21'));if(_0x186198[_0x7d95('0x22')]&&_0x186198[_0x7d95('0x23')]&&_0x186198[_0x7d95('0x24')]){var _0x3ae23a=new _0x1b5629(_0x186198[_0x7d95('0x22')],_0x186198[_0x7d95('0x23')]);_0x3ae23a['messages'][_0x7d95('0x25')]({'body':_0x2af3bd['body'],'to':_0x2af3bd[_0x7d95('0x24')],'from':_0x186198['phone'],'statusCallback':_0x186198['remote']+_0x7d95('0x26')+_0x2af3bd['id']+_0x7d95('0x27')+_0x186198[_0x7d95('0x28')]})['then'](function(_0x2f54c4){if(_0x2f54c4[_0x7d95('0x29')]){return _0x572e5f['update']({'messageId':_0x2f54c4[_0x7d95('0x29')]});}})['catch'](function(_0x4ec676){logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),'twilio',util[_0x7d95('0x2c')](_0x4ec676,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')](_0x7d95('0x2a'),'afterCreate',_0x7d95('0x21'),_0x7d95('0x2d'));}break;case _0x7d95('0x2e'):var _0x5c0664=_0x7d95('0x2f');if(_0x186198['username']&&_0x186198[_0x7d95('0x30')]){var _0x3be6fa={'recipient':[_0x2af3bd[_0x7d95('0x24')]],'message':_0x2af3bd[_0x7d95('0xe')],'message_type':_0x186198[_0x7d95('0x31')]};if(_0x186198[_0x7d95('0x31')]&&_0x186198[_0x7d95('0x31')]!=='SI'){_0x3be6fa[_0x7d95('0x32')]=_0x186198['phone'];}var _0x2a98aa={'url':_0x5c0664+'login?username='+_0x186198[_0x7d95('0x33')]+'&password='+_0x186198[_0x7d95('0x30')],'method':_0x7d95('0x34')};rp(_0x2a98aa)[_0x7d95('0x19')](function(_0xfae5b2){var _0x2556ef=_0xfae5b2[_0x7d95('0x35')](';');var _0x563fcd={'user_key':_0x2556ef[0x0],'session_key':_0x2556ef[0x1]};_0x2a98aa={'url':_0x5c0664+_0x7d95('0x36'),'method':_0x7d95('0x37'),'headers':{'user_key':_0x563fcd[_0x7d95('0x38')],'Session_key':_0x563fcd[_0x7d95('0x39')]},'json':!![],'body':_0x3be6fa};return rp(_0x2a98aa);})[_0x7d95('0x19')](function(_0x3ddd23){if(_0x3ddd23['total_sent']>=0x1){var _0xc59bc8={'messageId':_0x3ddd23[_0x7d95('0x3a')]};if(_0x186198['smsMethod']!=='GP'||!_0x186198['deliveryReport']){_0xc59bc8[_0x7d95('0x3b')]=!![];}return _0x572e5f[_0x7d95('0x1a')](_0xc59bc8);}else{return logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x2e'),util[_0x7d95('0x2c')](_0x3ddd23,{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x1b5648){return logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d95('0x2b'),_0x7d95('0x2e'),util[_0x7d95('0x2c')](_0x1b5648,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),'skebby',_0x7d95('0x3c'));}break;case _0x7d95('0x3d'):if(_0x186198[_0x7d95('0x23')]){var _0x632cc4={'recipient':_0x2af3bd['phone'],'message':_0x2af3bd['body'],'sender':_0x186198['senderString']||_0x186198['phone'],'authorization':_0x186198['authToken']};var _0x2e0589={'method':'POST','uri':_0x7d95('0x3e'),'body':_0x632cc4,'json':!![]};rp(_0x2e0589)[_0x7d95('0x19')](function(_0x40f2ae){var _0x28d7eb={'messageId':_0x40f2ae[_0x7d95('0x3f')]};if(!_0x186198[_0x7d95('0x40')]){_0x28d7eb[_0x7d95('0x3b')]=!![];}return _0x572e5f[_0x7d95('0x1a')](_0x28d7eb);})[_0x7d95('0x1b')](function(_0x6901c5){logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x3d'),util[_0x7d95('0x2c')](_0x6901c5,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x3d'),'Missing\x20parameters:\x20authToken');}break;case _0x7d95('0x41'):if(_0x186198[_0x7d95('0x33')]&&_0x186198['password']){var _0x632cc4={'messages':[{'source':_0x7d95('0x42'),'to':_0x2af3bd['phone'],'body':_0x2af3bd[_0x7d95('0xe')],'from':_0x186198['senderString']||_0x186198['phone']}]};var _0x2671e6=util[_0x7d95('0x43')](_0x7d95('0x44'),_0x186198[_0x7d95('0x33')],_0x186198[_0x7d95('0x30')]);var _0x2e0589={'method':_0x7d95('0x37'),'uri':_0x7d95('0x45'),'body':_0x632cc4,'headers':{'Authorization':util[_0x7d95('0x43')]('Basic\x20%s',new Buffer(_0x2671e6)[_0x7d95('0x46')]('base64'))},'json':!![]};rp(_0x2e0589)[_0x7d95('0x19')](function(_0x2d4a5b){if(_0x2d4a5b[_0x7d95('0x47')]>=0xc8&&_0x2d4a5b[_0x7d95('0x47')]<=0xce){if(_0x2d4a5b[_0x7d95('0x48')]&&_0x2d4a5b[_0x7d95('0x48')][_0x7d95('0x49')]>0x0){var _0x14ae42=_[_0x7d95('0x4a')](_0x2d4a5b[_0x7d95('0x48')]['messages']);var _0x226daa={'messageId':_0x14ae42[_0x7d95('0x4b')]};if(!_0x186198[_0x7d95('0x40')]){_0x226daa[_0x7d95('0x3b')]=!![];}return _0x572e5f[_0x7d95('0x1a')](_0x226daa);}else{logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7d95('0x4c'),util[_0x7d95('0x2c')](_0x2d4a5b,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),'clickSend',util[_0x7d95('0x2c')](_0x2d4a5b,{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x306ae9){logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x4c'),util[_0x7d95('0x2c')](_0x306ae9,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d95('0x2b'),'clickSend',_0x7d95('0x3c'));}break;case'plivo':if(_0x186198[_0x7d95('0x4d')]&&_0x186198[_0x7d95('0x23')]){var _0x632cc4={'dst':_0x2af3bd[_0x7d95('0x24')],'text':_0x2af3bd[_0x7d95('0xe')],'src':_0x186198[_0x7d95('0x4e')]||_0x186198[_0x7d95('0x24')],'url':_0x186198[_0x7d95('0x4f')]+_0x7d95('0x26')+_0x2af3bd['id']+'/status?token='+_0x186198[_0x7d95('0x28')]};var _0x2671e6=util[_0x7d95('0x43')](_0x7d95('0x44'),_0x186198[_0x7d95('0x4d')],_0x186198[_0x7d95('0x23')]);var _0x2e0589={'method':_0x7d95('0x37'),'uri':util[_0x7d95('0x43')](_0x7d95('0x50'),_0x186198[_0x7d95('0x4d')]),'body':_0x632cc4,'headers':{'Authorization':util[_0x7d95('0x43')](_0x7d95('0x51'),new Buffer(_0x2671e6)[_0x7d95('0x46')]('base64'))},'json':!![]};rp(_0x2e0589)[_0x7d95('0x19')](function(_0x1d6b9b){var _0x26edb3={'messageId':_0x1d6b9b[_0x7d95('0x52')][0x0]};return _0x572e5f[_0x7d95('0x1a')](_0x26edb3);})[_0x7d95('0x1b')](function(_0x426a3e){logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x53'),util[_0x7d95('0x2c')](_0x426a3e,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x53'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x186198[_0x7d95('0x33')]&&_0x186198[_0x7d95('0x30')]){if(_0x186198[_0x7d95('0x54')]){var _0x5771c7={'method':_0x7d95('0x37'),'uri':_0x186198[_0x7d95('0x54')]+_0x7d95('0x55'),'body':{'username':_0x186198[_0x7d95('0x33')],'password':_0x186198[_0x7d95('0x30')]},'json':!![]};return rp(_0x5771c7)[_0x7d95('0x19')](function(_0x47a6a6){var _0x5267d0={'method':_0x7d95('0x37'),'uri':_0x186198[_0x7d95('0x54')]+_0x7d95('0x56'),'body':{'messages':[{'from':_0x186198[_0x7d95('0x24')],'destinations':[{'to':_0x2af3bd[_0x7d95('0x24')]}],'text':_0x2af3bd[_0x7d95('0xe')],'notifyUrl':_0x186198['remote']+_0x7d95('0x26')+_0x2af3bd['id']+_0x7d95('0x27')+_0x186198[_0x7d95('0x28')],'notifyContentType':_0x7d95('0x57'),'callbackData':_0x186198[_0x7d95('0x24')]+';'+_0x2af3bd['body']}]},'headers':{'Authorization':_0x7d95('0x58')+_0x47a6a6[_0x7d95('0x28')]},'json':!![]};return rp(_0x5267d0)[_0x7d95('0x19')](function(_0x32194e){if(_0x32194e[_0x7d95('0x59')]){var _0x22439f={'messageId':_0x32194e[_0x7d95('0x59')][0x0][_0x7d95('0xc')]};if(!_0x186198[_0x7d95('0x40')]){_0x22439f['read']=!![];}return _0x572e5f['update'](_0x22439f);}else{return logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x5a'),util[_0x7d95('0x2c')](_0x32194e,{'showHidden':![],'depth':null}));}});})[_0x7d95('0x1b')](function(_0x2f691a){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d95('0x2b'),_0x7d95('0x5a'),util[_0x7d95('0x2c')](_0x2f691a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7d95('0x5a'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x5a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7d95('0x5b'):var _0x29de59=require(_0x7d95('0x5c'));if(_0x186198[_0x7d95('0x5d')]){var _0x2504d3={};_0x2504d3[_0x7d95('0x5e')]=_0x186198[_0x7d95('0x33')];_0x2504d3[_0x7d95('0x24')]=_0x2af3bd[_0x7d95('0x24')];_0x2504d3['sender']=_0x186198['phone'];_0x2504d3[_0x7d95('0x5f')]=_0x2af3bd[_0x7d95('0xe')];_0x2504d3['timestamp']=+new Date();var _0x49bcc9='';var _0x60825c='';var _0x15dddd=Object[_0x7d95('0x60')](_0x2504d3);_0x15dddd[_0x7d95('0x61')]();for(var _0x493f64=0x0;_0x493f64<_0x15dddd[_0x7d95('0x62')];_0x493f64++){if(_0x49bcc9!=''){_0x49bcc9+='&';}_0x49bcc9+=_0x15dddd[_0x493f64]+'='+encodeURIComponent(_0x2504d3[_0x15dddd[_0x493f64]]);_0x60825c+=_0x2504d3[_0x15dddd[_0x493f64]];}_0x60825c+=_0x186198[_0x7d95('0x5d')];_0x60825c=_0x29de59[_0x7d95('0x63')](_0x7d95('0x64'))[_0x7d95('0x1a')](_0x60825c)[_0x7d95('0x65')](_0x7d95('0x66'));if(_0x49bcc9!==''){_0x49bcc9+='&';}_0x49bcc9+='signature='+_0x60825c;var _0x2a98aa={'method':_0x7d95('0x34'),'uri':_0x186198[_0x7d95('0x54')]+_0x7d95('0x67')+_0x49bcc9,'json':!![]};return rp(_0x2a98aa)[_0x7d95('0x19')](function(_0x17f428){var _0x258a28=Object[_0x7d95('0x60')](_0x17f428);if(_0x17f428[_0x258a28[0x0]]['error']&&parseInt(_0x17f428[_0x258a28[0x0]][_0x7d95('0x1c')])===0x0){var _0x52a99c={'messageId':_0x17f428[_0x258a28[0x0]]['id_sms']};if(!_0x186198[_0x7d95('0x40')]){_0x52a99c[_0x7d95('0x3b')]=!![];}return _0x572e5f[_0x7d95('0x1a')](_0x52a99c);}else{return logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7d95('0x5b'),util[_0x7d95('0x2c')](_0x17f428['error'],{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x47e5b0){return logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),'csc',util['inspect'](_0x47e5b0,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x5b'),_0x7d95('0x68'));}break;case _0x7d95('0x69'):if(_0x186198['apiKey']){var _0x298da8={'method':_0x7d95('0x37'),'uri':_0x7d95('0x6a'),'headers':{'Authorization':_0x186198[_0x7d95('0x5d')]},'body':{'content':_0x2af3bd[_0x7d95('0xe')],'to':[_0x2af3bd[_0x7d95('0x24')]],'from':_0x186198[_0x7d95('0x24')],'binary':![],'clientMessageId':_0x7d95('0x6b'),'charset':_0x7d95('0x6c')},'json':!![]};rp(_0x298da8)[_0x7d95('0x19')](function(_0x50fb3d){if(!_0x50fb3d['error']){var _0x54ee95={'messageId':_0x50fb3d[_0x7d95('0x59')][0x0][_0x7d95('0x6d')]};if(!_0x186198[_0x7d95('0x40')]){_0x54ee95[_0x7d95('0x3b')]=!![];}return _0x572e5f['update'](_0x54ee95);}else{return logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x69'),util['inspect'](_0x50fb3d[_0x7d95('0x1c')],{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x32e05d){return logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d95('0x2b'),_0x7d95('0x69'),util[_0x7d95('0x2c')](_0x32e05d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x69'),_0x7d95('0x68'));}break;case'bandwidth':if(_0x186198[_0x7d95('0x33')]&&_0x186198[_0x7d95('0x30')]){var _0x2671e6=util[_0x7d95('0x43')](_0x7d95('0x44'),_0x186198[_0x7d95('0x33')],_0x186198[_0x7d95('0x30')]);var _0x2e0589={'method':_0x7d95('0x37'),'uri':_0x7d95('0x6e')+_0x186198[_0x7d95('0x6f')]+_0x7d95('0x70'),'body':{'to':[_0x2af3bd[_0x7d95('0x24')]],'text':_0x2af3bd[_0x7d95('0xe')],'from':_0x186198[_0x7d95('0x24')],'applicationId':_0x186198['applicationId']},'headers':{'Authorization':util[_0x7d95('0x43')](_0x7d95('0x51'),new Buffer(_0x2671e6)[_0x7d95('0x46')](_0x7d95('0x71')))},'json':!![]};rp(_0x2e0589)[_0x7d95('0x19')](function(_0x42488e){if(_0x42488e['id']){var _0x3f1359={'messageId':_0x42488e['id']};return _0x572e5f[_0x7d95('0x1a')](_0x3f1359);}else{logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x72'),util['inspect'](_0x42488e,{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x287576){logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x72'),util[_0x7d95('0x2c')](_0x287576,{'showHidden':![],'depth':null}));});}else{logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d95('0x2b'),_0x7d95('0x72'),_0x7d95('0x3c'));}break;case'intelepeer':if(_0x186198[_0x7d95('0x5d')]){var _0x366051={};var _0x2a98aa={'method':_0x7d95('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x7d95('0x73')+_0x186198[_0x7d95('0x5d')],'Content-Type':_0x7d95('0x57')},'body':{'from':_0x186198['phone'],'to':_0x2af3bd['phone'],'text':_0x2af3bd['body']},'json':!![]};return rp(_0x2a98aa)[_0x7d95('0x19')](function(_0x5db6de){if(_0x5db6de[_0x7d95('0x74')]==0xca){_0x366051[_0x7d95('0x75')]=_0x5db6de;var _0x4b562a={'method':'POST','uri':_0x7d95('0x76'),'headers':{'Authorization':_0x7d95('0x73')+_0x186198[_0x7d95('0x5d')],'Content-Type':_0x7d95('0x57')},'body':{'refid':_0x366051['message'][_0x7d95('0x77')]},'json':!![]};return rp(_0x4b562a)[_0x7d95('0x19')](function(_0x4d6378){_0x366051['status']=_0x4d6378;var _0x22b918={'messageId':_0x366051[_0x7d95('0x75')]['refid'],'read':!![]};return _0x572e5f[_0x7d95('0x1a')](_0x22b918);});}else{return logger[_0x7d95('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7d95('0x78'),util[_0x7d95('0x2c')](_0x5db6de,{'showHidden':![],'depth':null}));}})[_0x7d95('0x1b')](function(_0x5b4497){return logger['error'](_0x7d95('0x2a'),'afterCreate','intelepeer',util[_0x7d95('0x2c')](_0x5b4497,{'showHidden':![],'depth':null}));});}else{return logger[_0x7d95('0x1c')](_0x7d95('0x2a'),_0x7d95('0x2b'),_0x7d95('0x78'),_0x7d95('0x79'));}break;}}})[_0x7d95('0x7a')](function(){_0x109cec();});}else{_0x109cec();}}},'charset':_0x7d95('0x7b'),'collate':_0x7d95('0x7c')});}; \ No newline at end of file +var _0x79d8=['secret','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','sender','text','keys','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','base64','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out'];(function(_0x5d7990,_0x17786f){var _0xbd01f0=function(_0x1ba6c9){while(--_0x1ba6c9){_0x5d7990['push'](_0x5d7990['shift']());}};_0xbd01f0(++_0x17786f);}(_0x79d8,0x67));var _0x879d=function(_0x5c2be2,_0x50f808){_0x5c2be2=_0x5c2be2-0x0;var _0x1394a3=_0x79d8[_0x5c2be2];return _0x1394a3;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var logger=require(_0x879d('0x2'))(_0x879d('0x3'));var moment=require('moment');var BPromise=require(_0x879d('0x4'));var rp=require(_0x879d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879d('0x6'));var config=require(_0x879d('0x7'));var attributes=require(_0x879d('0x8'));module['exports']=function(_0x2d578e,_0x46ed21){return _0x2d578e[_0x879d('0x9')](_0x879d('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x879d('0xb'),'fields':[_0x879d('0xb')]},{'name':_0x879d('0xc'),'fields':[_0x879d('0xd')],'type':_0x879d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d0900,_0x1cc5bf,_0x4920b5){var _0x5d93f2=_0x2d578e[_0x879d('0xf')];var _0x35bbff=_0x5d0900[_0x879d('0x10')]({'plain':!![]});if(_0x35bbff['direction'][_0x879d('0x11')]()==='in'||_0x35bbff[_0x879d('0x12')]['toLowerCase']()===_0x879d('0x13')&&!_0x35bbff[_0x879d('0x14')]&&!_['isNil'](_0x35bbff[_0x879d('0x15')])){_0x5d93f2['SmsInteraction'][_0x879d('0x16')]({'where':{'id':_0x35bbff[_0x879d('0x17')]}})[_0x879d('0x18')](function(_0x24e775){if(_0x24e775){_0x24e775[_0x879d('0x19')]({'lastMsgAt':_0x35bbff[_0x879d('0x1a')],'lastMsgDirection':_0x35bbff['direction']['toLowerCase']()});}})[_0x879d('0x1b')](function(_0x175dfe){console['error'](_0x175dfe);});}if(_0x35bbff['direction']===_0x879d('0x13')&&!_0x35bbff[_0x879d('0x14')]){var _0x3a7259;_0x5d93f2[_0x879d('0x1c')][_0x879d('0x1d')]({'where':{'id':_0x35bbff[_0x879d('0x1e')]},'raw':!![]})[_0x879d('0x18')](function(_0x50539d){_0x3a7259=_0x50539d;if(_0x3a7259&&_0x3a7259['type']){switch(_0x3a7259[_0x879d('0x1f')]){case'twilio':var _0x16e170=require('twilio');if(_0x3a7259[_0x879d('0x20')]&&_0x3a7259[_0x879d('0x21')]&&_0x3a7259[_0x879d('0x22')]){var _0x2dba72=new _0x16e170(_0x3a7259[_0x879d('0x20')],_0x3a7259[_0x879d('0x21')]);_0x2dba72[_0x879d('0x23')]['create']({'body':_0x35bbff[_0x879d('0xd')],'to':_0x35bbff[_0x879d('0x22')],'from':_0x3a7259[_0x879d('0x22')],'statusCallback':_0x3a7259[_0x879d('0x24')]+_0x879d('0x25')+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259['token']})[_0x879d('0x18')](function(_0x4a0559){if(_0x4a0559[_0x879d('0x27')]){return _0x5d0900[_0x879d('0x19')]({'messageId':_0x4a0559[_0x879d('0x27')]});}})['catch'](function(_0x39d838){logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x2b'),util['inspect'](_0x39d838,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),_0x879d('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x879d('0x2c'):var _0x1b3b96=_0x879d('0x2d');if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x481e90={'recipient':[_0x35bbff['phone']],'message':_0x35bbff[_0x879d('0xd')],'message_type':_0x3a7259[_0x879d('0x30')]};if(_0x3a7259[_0x879d('0x30')]&&_0x3a7259[_0x879d('0x30')]!=='SI'){_0x481e90['sender']=_0x3a7259[_0x879d('0x22')];}var _0xe8c394={'url':_0x1b3b96+_0x879d('0x31')+_0x3a7259['username']+_0x879d('0x32')+_0x3a7259[_0x879d('0x2f')],'method':_0x879d('0x33')};rp(_0xe8c394)['then'](function(_0x1a1230){var _0x215f2a=_0x1a1230[_0x879d('0x34')](';');var _0x8430c1={'user_key':_0x215f2a[0x0],'session_key':_0x215f2a[0x1]};_0xe8c394={'url':_0x1b3b96+_0x879d('0x35'),'method':_0x879d('0x36'),'headers':{'user_key':_0x8430c1[_0x879d('0x37')],'Session_key':_0x8430c1[_0x879d('0x38')]},'json':!![],'body':_0x481e90};return rp(_0xe8c394);})[_0x879d('0x18')](function(_0x284881){if(_0x284881[_0x879d('0x39')]>=0x1){var _0x3eee95={'messageId':_0x284881[_0x879d('0x3a')]};if(_0x3a7259[_0x879d('0x30')]!=='GP'||!_0x3a7259['deliveryReport']){_0x3eee95[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x3eee95);}else{return logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x2c'),util['inspect'](_0x284881,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x1f867d){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x2c'),util[_0x879d('0x3c')](_0x1f867d,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x2c'),_0x879d('0x3d'));}break;case _0x879d('0x3e'):if(_0x3a7259[_0x879d('0x21')]){var _0x4a006e={'recipient':_0x35bbff[_0x879d('0x22')],'message':_0x35bbff[_0x879d('0xd')],'sender':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')],'authorization':_0x3a7259['authToken']};var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x40'),'body':_0x4a006e,'json':!![]};rp(_0x1cc5bf)['then'](function(_0x422d98){var _0x50f255={'messageId':_0x422d98['requestid']};if(!_0x3a7259[_0x879d('0x41')]){_0x50f255['read']=!![];}return _0x5d0900[_0x879d('0x19')](_0x50f255);})[_0x879d('0x1b')](function(_0x29b88a){logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x3e'),util[_0x879d('0x3c')](_0x29b88a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),'afterCreate',_0x879d('0x3e'),_0x879d('0x42'));}break;case _0x879d('0x43'):if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x4a006e={'messages':[{'source':_0x879d('0x44'),'to':_0x35bbff['phone'],'body':_0x35bbff[_0x879d('0xd')],'from':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')]}]};var _0x227377=util[_0x879d('0x45')](_0x879d('0x46'),_0x3a7259[_0x879d('0x2e')],_0x3a7259['password']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x47'),'body':_0x4a006e,'headers':{'Authorization':util[_0x879d('0x45')](_0x879d('0x48'),new Buffer(_0x227377)[_0x879d('0x49')]('base64'))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x2fccc5){if(_0x2fccc5[_0x879d('0x4a')]>=0xc8&&_0x2fccc5[_0x879d('0x4a')]<=0xce){if(_0x2fccc5[_0x879d('0x4b')]&&_0x2fccc5[_0x879d('0x4b')]['queued_count']>0x0){var _0x2d6480=_[_0x879d('0x4c')](_0x2fccc5['data'][_0x879d('0x23')]);var _0x5563e9={'messageId':_0x2d6480['message_id']};if(!_0x3a7259[_0x879d('0x41')]){_0x5563e9[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x5563e9);}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x4d'),util['inspect'](_0x2fccc5,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x4d'),util[_0x879d('0x3c')](_0x2fccc5,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x75ce30){logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'clickSend',util[_0x879d('0x3c')](_0x75ce30,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x4d'),_0x879d('0x3d'));}break;case _0x879d('0x4e'):if(_0x3a7259[_0x879d('0x4f')]&&_0x3a7259[_0x879d('0x21')]){var _0x4a006e={'dst':_0x35bbff['phone'],'text':_0x35bbff[_0x879d('0xd')],'src':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')],'url':_0x3a7259[_0x879d('0x24')]+_0x879d('0x25')+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259[_0x879d('0x50')]};var _0x227377=util['format'](_0x879d('0x46'),_0x3a7259[_0x879d('0x4f')],_0x3a7259['authToken']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':util[_0x879d('0x45')](_0x879d('0x51'),_0x3a7259['authId']),'body':_0x4a006e,'headers':{'Authorization':util['format'](_0x879d('0x48'),new Buffer(_0x227377)['toString']('base64'))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x2acc3c){var _0x1743a5={'messageId':_0x2acc3c['message_uuid'][0x0]};return _0x5d0900[_0x879d('0x19')](_0x1743a5);})[_0x879d('0x1b')](function(_0x484116){logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x4e'),util['inspect'](_0x484116,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'plivo',_0x879d('0x52'));}break;case _0x879d('0x53'):if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){if(_0x3a7259[_0x879d('0x54')]){var _0x3d28f2={'method':'POST','uri':_0x3a7259[_0x879d('0x54')]+_0x879d('0x55'),'body':{'username':_0x3a7259[_0x879d('0x2e')],'password':_0x3a7259[_0x879d('0x2f')]},'json':!![]};return rp(_0x3d28f2)['then'](function(_0x24d834){var _0x161c62={'method':'POST','uri':_0x3a7259[_0x879d('0x54')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3a7259[_0x879d('0x22')],'destinations':[{'to':_0x35bbff[_0x879d('0x22')]}],'text':_0x35bbff[_0x879d('0xd')],'notifyUrl':_0x3a7259[_0x879d('0x24')]+'/api/sms/messages/'+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259['token'],'notifyContentType':_0x879d('0x56'),'callbackData':_0x3a7259[_0x879d('0x22')]+';'+_0x35bbff['body']}]},'headers':{'Authorization':_0x879d('0x57')+_0x24d834['token']},'json':!![]};return rp(_0x161c62)[_0x879d('0x18')](function(_0xa97563){if(_0xa97563['messages']){var _0x57f5f5={'messageId':_0xa97563[_0x879d('0x23')][0x0][_0x879d('0xb')]};if(!_0x3a7259[_0x879d('0x41')]){_0x57f5f5[_0x879d('0x3b')]=!![];}return _0x5d0900['update'](_0x57f5f5);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x53'),util[_0x879d('0x3c')](_0xa97563,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x225239){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x53'),util[_0x879d('0x3c')](_0x225239,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'infobip',_0x879d('0x58'));}}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x53'),_0x879d('0x3d'));}break;case'csc':var _0x4c2d9a=require(_0x879d('0x59'));if(_0x3a7259['apiKey']){var _0x5cc25a={};_0x5cc25a[_0x879d('0x5a')]=_0x3a7259[_0x879d('0x2e')];_0x5cc25a[_0x879d('0x22')]=_0x35bbff[_0x879d('0x22')];_0x5cc25a[_0x879d('0x5b')]=_0x3a7259['phone'];_0x5cc25a[_0x879d('0x5c')]=_0x35bbff[_0x879d('0xd')];_0x5cc25a['timestamp']=+new Date();var _0x519b73='';var _0x43483f='';var _0x5296ea=Object[_0x879d('0x5d')](_0x5cc25a);_0x5296ea['sort']();for(var _0x1678f2=0x0;_0x1678f2<_0x5296ea[_0x879d('0x5e')];_0x1678f2++){if(_0x519b73!=''){_0x519b73+='&';}_0x519b73+=_0x5296ea[_0x1678f2]+'='+encodeURIComponent(_0x5cc25a[_0x5296ea[_0x1678f2]]);_0x43483f+=_0x5cc25a[_0x5296ea[_0x1678f2]];}_0x43483f+=_0x3a7259[_0x879d('0x5f')];_0x43483f=_0x4c2d9a[_0x879d('0x60')](_0x879d('0x61'))[_0x879d('0x19')](_0x43483f)[_0x879d('0x62')](_0x879d('0x63'));if(_0x519b73!==''){_0x519b73+='&';}_0x519b73+=_0x879d('0x64')+_0x43483f;var _0xe8c394={'method':_0x879d('0x33'),'uri':_0x3a7259['baseUrl']+_0x879d('0x65')+_0x519b73,'json':!![]};return rp(_0xe8c394)[_0x879d('0x18')](function(_0x40d1e7){var _0x1dc3a9=Object[_0x879d('0x5d')](_0x40d1e7);if(_0x40d1e7[_0x1dc3a9[0x0]]['error']&&parseInt(_0x40d1e7[_0x1dc3a9[0x0]]['error'])===0x0){var _0x11f9da={'messageId':_0x40d1e7[_0x1dc3a9[0x0]]['id_sms']};if(!_0x3a7259[_0x879d('0x41')]){_0x11f9da['read']=!![];}return _0x5d0900[_0x879d('0x19')](_0x11f9da);}else{return logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'csc',util[_0x879d('0x3c')](_0x40d1e7['error'],{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x2f5d22){return logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),'csc',util['inspect'](_0x2f5d22,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x66'),_0x879d('0x67'));}break;case _0x879d('0x68'):if(_0x3a7259[_0x879d('0x5f')]){var _0x3a711a={'method':_0x879d('0x36'),'uri':_0x879d('0x69'),'headers':{'Authorization':_0x3a7259[_0x879d('0x5f')]},'body':{'content':_0x35bbff[_0x879d('0xd')],'to':[_0x35bbff[_0x879d('0x22')]],'from':_0x3a7259[_0x879d('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x3a711a)[_0x879d('0x18')](function(_0x2f74d7){if(!_0x2f74d7[_0x879d('0x28')]){var _0x26b8d9={'messageId':_0x2f74d7['messages'][0x0][_0x879d('0x6a')]};if(!_0x3a7259[_0x879d('0x41')]){_0x26b8d9[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x26b8d9);}else{return logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x68'),util[_0x879d('0x3c')](_0x2f74d7['error'],{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x1844d3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'clickatell',util[_0x879d('0x3c')](_0x1844d3,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x68'),_0x879d('0x67'));}break;case'bandwidth':if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x227377=util[_0x879d('0x45')]('%s:%s',_0x3a7259['username'],_0x3a7259['password']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x6b')+_0x3a7259[_0x879d('0x6c')]+'/messages','body':{'to':[_0x35bbff['phone']],'text':_0x35bbff[_0x879d('0xd')],'from':_0x3a7259[_0x879d('0x22')],'applicationId':_0x3a7259[_0x879d('0x6d')]},'headers':{'Authorization':util[_0x879d('0x45')](_0x879d('0x48'),new Buffer(_0x227377)[_0x879d('0x49')](_0x879d('0x6e')))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x81642e){if(_0x81642e['id']){var _0x3f3277={'messageId':_0x81642e['id']};return _0x5d0900[_0x879d('0x19')](_0x3f3277);}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x6f'),util[_0x879d('0x3c')](_0x81642e,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x4f0bcf){logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate','bandwidth',util[_0x879d('0x3c')](_0x4f0bcf,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x6f'),_0x879d('0x3d'));}break;case _0x879d('0x70'):if(_0x3a7259[_0x879d('0x5f')]){var _0x156b59={};var _0xe8c394={'method':'POST','uri':_0x879d('0x71'),'headers':{'Authorization':_0x879d('0x72')+_0x3a7259[_0x879d('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x3a7259[_0x879d('0x22')],'to':_0x35bbff[_0x879d('0x22')],'text':_0x35bbff[_0x879d('0xd')]},'json':!![]};return rp(_0xe8c394)[_0x879d('0x18')](function(_0x61471){if(_0x61471[_0x879d('0x73')]==0xca){_0x156b59['message']=_0x61471;var _0x38b13a={'method':_0x879d('0x36'),'uri':_0x879d('0x74'),'headers':{'Authorization':_0x879d('0x72')+_0x3a7259[_0x879d('0x5f')],'Content-Type':_0x879d('0x56')},'body':{'refid':_0x156b59[_0x879d('0x75')][_0x879d('0x76')]},'json':!![]};return rp(_0x38b13a)[_0x879d('0x18')](function(_0xa548ac){_0x156b59['status']=_0xa548ac;var _0x266859={'messageId':_0x156b59[_0x879d('0x75')][_0x879d('0x76')],'read':!![]};return _0x5d0900[_0x879d('0x19')](_0x266859);});}else{return logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x70'),util[_0x879d('0x3c')](_0x61471,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x111c78){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate','intelepeer',util[_0x879d('0x3c')](_0x111c78,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x879d('0x70'),_0x879d('0x77'));}break;}}})[_0x879d('0x78')](function(){_0x4920b5();});}else{_0x4920b5();}}},'charset':_0x879d('0x79'),'collate':_0x879d('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8642230..e98c2bf 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 _0x4375=['code','message','result','CreateSmsMessage','SmsMessage','body','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4375,0x6a));var _0x5437=function(_0x4483a6,_0x3b9882){_0x4483a6=_0x4483a6-0x0;var _0x2edaed=_0x4375[_0x4483a6];return _0x2edaed;};'use strict';var _=require(_0x5437('0x0'));var util=require(_0x5437('0x1'));var moment=require(_0x5437('0x2'));var BPromise=require('bluebird');var rs=require(_0x5437('0x3'));var fs=require('fs');var Redis=require(_0x5437('0x4'));var db=require(_0x5437('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5437('0x6'))(_0x5437('0x7'));var config=require(_0x5437('0x8'));var jayson=require(_0x5437('0x9'));var client=jayson['client'][_0x5437('0xa')]({'port':0x232a});config[_0x5437('0xb')]=_[_0x5437('0xc')](config[_0x5437('0xb')],{'host':_0x5437('0xd'),'port':0x18eb});var socket=require(_0x5437('0xe'))(new Redis(config[_0x5437('0xb')]));require(_0x5437('0xf'))[_0x5437('0x10')](socket);function respondWithRpcPromise(_0xda1c3d,_0x355aa2,_0x3c1f3f){return new BPromise(function(_0x1f98e8,_0x18b634){return client[_0x5437('0x11')](_0xda1c3d,_0x3c1f3f)[_0x5437('0x12')](function(_0x3d2ad3){logger[_0x5437('0x13')](_0x5437('0x14'),_0x355aa2,_0x5437('0x15'));logger[_0x5437('0x16')](_0x5437('0x17'),_0x355aa2,_0x5437('0x15'),JSON[_0x5437('0x18')](_0x3d2ad3));if(_0x3d2ad3[_0x5437('0x19')]){if(_0x3d2ad3[_0x5437('0x19')][_0x5437('0x1a')]===0x1f4){logger[_0x5437('0x19')](_0x5437('0x14'),_0x355aa2,_0x3d2ad3[_0x5437('0x19')][_0x5437('0x1b')]);return _0x18b634(_0x3d2ad3[_0x5437('0x19')][_0x5437('0x1b')]);}logger['error'](_0x5437('0x14'),_0x355aa2,_0x3d2ad3[_0x5437('0x19')][_0x5437('0x1b')]);return _0x1f98e8(_0x3d2ad3[_0x5437('0x19')][_0x5437('0x1b')]);}else{logger[_0x5437('0x13')](_0x5437('0x14'),_0x355aa2,'request\x20sent');_0x1f98e8(_0x3d2ad3[_0x5437('0x1c')][_0x5437('0x1b')]);}})['catch'](function(_0x27ed8c){logger['error'](_0x5437('0x14'),_0x355aa2,_0x27ed8c);_0x18b634(_0x27ed8c);});});}exports[_0x5437('0x1d')]=function(_0x2b3797){var _0x124b7f=this;return new Promise(function(_0x19af03,_0xa7b685){return db[_0x5437('0x1e')]['create'](_0x2b3797[_0x5437('0x1f')],{'raw':_0x2b3797['options']?_0x2b3797['options']['raw']===undefined?!![]:![]:!![]})[_0x5437('0x12')](function(_0x411eb8){logger[_0x5437('0x13')](_0x5437('0x1d'),_0x2b3797);logger[_0x5437('0x16')](_0x5437('0x1d'),_0x2b3797,JSON['stringify'](_0x411eb8));_0x19af03(_0x411eb8);})[_0x5437('0x20')](function(_0x5280c2){logger[_0x5437('0x19')](_0x5437('0x1d'),_0x5280c2[_0x5437('0x1b')],_0x2b3797);_0xa7b685(_0x124b7f[_0x5437('0x19')](0x1f4,_0x5280c2[_0x5437('0x1b')]));});});}; \ No newline at end of file +var _0x4497=['register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x4bc45c,_0x24e56b){var _0x2a69b3=function(_0x4b2673){while(--_0x4b2673){_0x4bc45c['push'](_0x4bc45c['shift']());}};_0x2a69b3(++_0x24e56b);}(_0x4497,0x9f));var _0x7449=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x4497[_0x595013];return _0x2a29e3;};'use strict';var _=require(_0x7449('0x0'));var util=require(_0x7449('0x1'));var moment=require(_0x7449('0x2'));var BPromise=require(_0x7449('0x3'));var rs=require(_0x7449('0x4'));var fs=require('fs');var Redis=require(_0x7449('0x5'));var db=require(_0x7449('0x6'))['db'];var utils=require(_0x7449('0x7'));var logger=require(_0x7449('0x8'))(_0x7449('0x9'));var config=require(_0x7449('0xa'));var jayson=require(_0x7449('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7449('0xc')],{'host':_0x7449('0xd'),'port':0x18eb});var socket=require(_0x7449('0xe'))(new Redis(config[_0x7449('0xc')]));require(_0x7449('0xf'))[_0x7449('0x10')](socket);function respondWithRpcPromise(_0x57a152,_0x26aa38,_0x9b7d1e){return new BPromise(function(_0x227522,_0x22d184){return client[_0x7449('0x11')](_0x57a152,_0x9b7d1e)['then'](function(_0x5c0bb0){logger[_0x7449('0x12')](_0x7449('0x13'),_0x26aa38,_0x7449('0x14'));logger[_0x7449('0x15')](_0x7449('0x16'),_0x26aa38,_0x7449('0x14'),JSON['stringify'](_0x5c0bb0));if(_0x5c0bb0[_0x7449('0x17')]){if(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x18')]===0x1f4){logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);return _0x22d184(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);}logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x5c0bb0['error'][_0x7449('0x19')]);return _0x227522(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);}else{logger[_0x7449('0x12')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,'request\x20sent');_0x227522(_0x5c0bb0[_0x7449('0x1a')]['message']);}})[_0x7449('0x1b')](function(_0x25ef17){logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x25ef17);_0x22d184(_0x25ef17);});});}exports[_0x7449('0x1c')]=function(_0x316f52){var _0xf782b=this;return new Promise(function(_0x221455,_0x350207){return db['SmsMessage'][_0x7449('0x1d')](_0x316f52[_0x7449('0x1e')],{'raw':_0x316f52[_0x7449('0x1f')]?_0x316f52[_0x7449('0x1f')][_0x7449('0x20')]===undefined?!![]:![]:!![]})[_0x7449('0x21')](function(_0x28483a){logger[_0x7449('0x12')](_0x7449('0x1c'),_0x316f52);logger['debug']('CreateSmsMessage',_0x316f52,JSON[_0x7449('0x22')](_0x28483a));_0x221455(_0x28483a);})[_0x7449('0x1b')](function(_0x1e02fa){logger[_0x7449('0x17')](_0x7449('0x1c'),_0x1e02fa[_0x7449('0x19')],_0x316f52);_0x350207(_0xf782b[_0x7449('0x17')](0x1f4,_0x1e02fa['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 54ce4ee..07b2949 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 _0x77a2=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77a2,0x1ae));var _0x277a=function(_0x55fb99,_0x1af191){_0x55fb99=_0x55fb99-0x0;var _0x2ce6eb=_0x77a2[_0x55fb99];return _0x2ce6eb;};'use strict';var SmsMessageEvents=require(_0x277a('0x0'));var events=[_0x277a('0x1'),'remove',_0x277a('0x2')];function createListener(_0x5f5397,_0x3dd794){return function(_0x2fa993){_0x3dd794[_0x277a('0x3')](_0x5f5397,_0x2fa993);};}function removeListener(_0x330eb4,_0x2704d0){return function(){SmsMessageEvents[_0x277a('0x4')](_0x330eb4,_0x2704d0);};}exports[_0x277a('0x5')]=function(_0xa02c0c){for(var _0x554f35=0x0,_0x362595=events[_0x277a('0x6')];_0x554f35<_0x362595;_0x554f35++){var _0xc91997=events[_0x554f35];var _0x4d8154=createListener(_0x277a('0x7')+_0xc91997,_0xa02c0c);SmsMessageEvents['on'](_0xc91997,_0x4d8154);}}; \ No newline at end of file +var _0x38ae=['remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x3253a7,_0x35b175){var _0x5cfd78=function(_0x168cab){while(--_0x168cab){_0x3253a7['push'](_0x3253a7['shift']());}};_0x5cfd78(++_0x35b175);}(_0x38ae,0x1c6));var _0xe38a=function(_0x49155d,_0x2bb881){_0x49155d=_0x49155d-0x0;var _0x4c5f0f=_0x38ae[_0x49155d];return _0x4c5f0f;};'use strict';var SmsMessageEvents=require(_0xe38a('0x0'));var events=['save',_0xe38a('0x1'),'update'];function createListener(_0x2b708a,_0x70dc53){return function(_0x3a5118){_0x70dc53[_0xe38a('0x2')](_0x2b708a,_0x3a5118);};}function removeListener(_0x3defed,_0x57fba8){return function(){SmsMessageEvents[_0xe38a('0x3')](_0x3defed,_0x57fba8);};}exports[_0xe38a('0x4')]=function(_0x427c2c){for(var _0x498a80=0x0,_0x47bde9=events[_0xe38a('0x5')];_0x498a80<_0x47bde9;_0x498a80++){var _0x5c3351=events[_0x498a80];var _0x4c0959=createListener(_0xe38a('0x6')+_0x5c3351,_0x427c2c);SmsMessageEvents['on'](_0x5c3351,_0x4c0959);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1060680..fe3b8c8 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 _0x1da1=['../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','Router','fs-extra'];(function(_0x38e685,_0x446b34){var _0x5439a9=function(_0x36af33){while(--_0x36af33){_0x38e685['push'](_0x38e685['shift']());}};_0x5439a9(++_0x446b34);}(_0x1da1,0x6c));var _0x11da=function(_0x10aefe,_0x5adb5e){_0x10aefe=_0x10aefe-0x0;var _0x1a4cca=_0x1da1[_0x10aefe];return _0x1a4cca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11da('0x0'));var timeout=require(_0x11da('0x1'));var express=require('express');var router=express[_0x11da('0x2')]();var fs_extra=require(_0x11da('0x3'));var auth=require(_0x11da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x11da('0x5'));var controller=require(_0x11da('0x6'));router[_0x11da('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x11da('0x7')](_0x11da('0x8'),auth[_0x11da('0x9')](),controller[_0x11da('0xa')]);router[_0x11da('0x7')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller[_0x11da('0xc')]);router[_0x11da('0x7')](_0x11da('0xd'),auth[_0x11da('0x9')](),controller[_0x11da('0xe')]);router['get'](_0x11da('0xf'),auth[_0x11da('0x9')](),controller[_0x11da('0x10')]);router[_0x11da('0x7')](_0x11da('0x11'),auth[_0x11da('0x9')](),controller[_0x11da('0x12')]);router[_0x11da('0x13')]('/',auth[_0x11da('0x9')](),controller[_0x11da('0x14')]);router[_0x11da('0x13')](_0x11da('0xf'),auth[_0x11da('0x9')](),controller[_0x11da('0x15')]);router['post']('/:id/users',auth[_0x11da('0x9')](),controller['addAgents']);router['put'](_0x11da('0xb'),auth['isAuthenticated'](),controller[_0x11da('0x16')]);router[_0x11da('0x17')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller[_0x11da('0x18')]);router[_0x11da('0x17')](_0x11da('0xf'),auth[_0x11da('0x9')](),controller[_0x11da('0x19')]);router[_0x11da('0x17')](_0x11da('0x11'),auth[_0x11da('0x9')](),controller[_0x11da('0x1a')]);module[_0x11da('0x1b')]=router; \ No newline at end of file +var _0x3aa8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aa8,0x102));var _0x83aa=function(_0x8906d5,_0x17f950){_0x8906d5=_0x8906d5-0x0;var _0x40d085=_0x3aa8[_0x8906d5];return _0x40d085;};'use strict';var multer=require('multer');var util=require(_0x83aa('0x0'));var path=require(_0x83aa('0x1'));var timeout=require(_0x83aa('0x2'));var express=require('express');var router=express[_0x83aa('0x3')]();var fs_extra=require(_0x83aa('0x4'));var auth=require(_0x83aa('0x5'));var interaction=require(_0x83aa('0x6'));var config=require(_0x83aa('0x7'));var controller=require(_0x83aa('0x8'));router[_0x83aa('0x9')]('/',auth[_0x83aa('0xa')](),controller['index']);router[_0x83aa('0x9')](_0x83aa('0xb'),auth[_0x83aa('0xa')](),controller[_0x83aa('0xc')]);router['get'](_0x83aa('0xd'),auth['isAuthenticated'](),controller[_0x83aa('0xe')]);router['get'](_0x83aa('0xf'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x10')]);router[_0x83aa('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x83aa('0x11')]);router[_0x83aa('0x9')](_0x83aa('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x83aa('0xa')](),controller[_0x83aa('0x13')]);router[_0x83aa('0x14')]('/:id/teams',auth[_0x83aa('0xa')](),controller[_0x83aa('0x15')]);router[_0x83aa('0x14')](_0x83aa('0x12'),auth['isAuthenticated'](),controller[_0x83aa('0x16')]);router[_0x83aa('0x17')](_0x83aa('0xd'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x18')]);router[_0x83aa('0x19')]('/:id',auth[_0x83aa('0xa')](),controller[_0x83aa('0x1a')]);router[_0x83aa('0x19')](_0x83aa('0x1b'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x1c')]);router[_0x83aa('0x19')](_0x83aa('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6801121..1b21edc 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 _0x49d2=['beepall','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x5b9666,_0x50b1ac){var _0x2499a5=function(_0x453c5c){while(--_0x453c5c){_0x5b9666['push'](_0x5b9666['shift']());}};_0x2499a5(++_0x50b1ac);}(_0x49d2,0x9d));var _0x249d=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x49d2[_0x347471];return _0x422b6a;};'use strict';var Sequelize=require(_0x249d('0x0'));module[_0x249d('0x1')]={'name':{'type':Sequelize[_0x249d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x249d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x249d('0x3')](_0x249d('0x4'),_0x249d('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x1e1e=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x71d604,_0x3edc06){var _0x1ae5a5=function(_0x1eb704){while(--_0x1eb704){_0x71d604['push'](_0x71d604['shift']());}};_0x1ae5a5(++_0x3edc06);}(_0x1e1e,0xb8));var _0xe1e1=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0x1e1e[_0x4664db];return _0x5615b4;};'use strict';var Sequelize=require(_0xe1e1('0x0'));module[_0xe1e1('0x1')]={'name':{'type':Sequelize[_0xe1e1('0x2')],'unique':_0xe1e1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe1e1('0x2')]},'timeout':{'type':Sequelize[_0xe1e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe1e1('0x5'),'beepall',_0xe1e1('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 37a92a3..22c5a5d 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 _0x6972=['send','index','SmsQueue','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','body','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','agent','format','SIP','smsPause','createdAt','updatedAt','Team','rawAttributes','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','push','toString','every','TeamId','all','union','value','isEmpty','removeAgents','userSmsQueue:remove','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','count','limit','set','Content-Range','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name'];(function(_0x4812bd,_0x476c0e){var _0x36581c=function(_0x4330e9){while(--_0x4330e9){_0x4812bd['push'](_0x4812bd['shift']());}};_0x36581c(++_0x476c0e);}(_0x6972,0x173));var _0x2697=function(_0x5d8d87,_0x12bf56){_0x5d8d87=_0x5d8d87-0x0;var _0x2cbd53=_0x6972[_0x5d8d87];return _0x2cbd53;};'use strict';var emlformat=require(_0x2697('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2697('0x1'));var jsonpatch=require(_0x2697('0x2'));var rp=require(_0x2697('0x3'));var moment=require('moment');var BPromise=require(_0x2697('0x4'));var Mustache=require(_0x2697('0x5'));var util=require('util');var path=require(_0x2697('0x6'));var sox=require(_0x2697('0x7'));var csv=require(_0x2697('0x8'));var ejs=require(_0x2697('0x9'));var fs=require('fs');var fs_extra=require(_0x2697('0xa'));var _=require(_0x2697('0xb'));var squel=require(_0x2697('0xc'));var crypto=require(_0x2697('0xd'));var jsforce=require(_0x2697('0xe'));var deskjs=require(_0x2697('0xf'));var toCsv=require(_0x2697('0x8'));var querystring=require(_0x2697('0x10'));var Papa=require(_0x2697('0x11'));var Redis=require('ioredis');var authService=require(_0x2697('0x12'));var qs=require(_0x2697('0x13'));var as=require(_0x2697('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2697('0x15'))(_0x2697('0x16'));var utils=require(_0x2697('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2697('0x18'));var db=require(_0x2697('0x19'))['db'];config[_0x2697('0x1a')]=_[_0x2697('0x1b')](config[_0x2697('0x1a')],{'host':_0x2697('0x1c'),'port':0x18eb});var socket=require(_0x2697('0x1d'))(new Redis(config[_0x2697('0x1a')]));require(_0x2697('0x1e'))['register'](socket);function respondWithStatusCode(_0x476f2d,_0x230658){_0x230658=_0x230658||0xcc;return function(_0x90dead){if(_0x90dead){return _0x476f2d[_0x2697('0x1f')](_0x230658);}return _0x476f2d[_0x2697('0x20')](_0x230658)[_0x2697('0x21')]();};}function respondWithResult(_0x14f6ef,_0x5817a7){_0x5817a7=_0x5817a7||0xc8;return function(_0x140512){if(_0x140512){return _0x14f6ef['status'](_0x5817a7)[_0x2697('0x22')](_0x140512);}};}function respondWithFilteredResult(_0x2150b4,_0x4aa435){return function(_0x277e69){if(_0x277e69){var _0x8b11f5=typeof _0x4aa435[_0x2697('0x23')]==='undefined'&&typeof _0x4aa435['limit']==='undefined';var _0x3da5db=_0x277e69[_0x2697('0x24')];var _0x3a1277=_0x8b11f5?0x0:_0x4aa435[_0x2697('0x23')];var _0x4b49f7=_0x8b11f5?_0x277e69[_0x2697('0x24')]:_0x4aa435[_0x2697('0x23')]+_0x4aa435[_0x2697('0x25')];var _0xe4e697;if(_0x4b49f7>=_0x3da5db){_0x4b49f7=_0x3da5db;_0xe4e697=0xc8;}else{_0xe4e697=0xce;}_0x2150b4['status'](_0xe4e697);return _0x2150b4[_0x2697('0x26')](_0x2697('0x27'),_0x3a1277+'-'+_0x4b49f7+'/'+_0x3da5db)[_0x2697('0x22')](_0x277e69);}return null;};}function patchUpdates(_0x2c9efd){return function(_0x445509){try{jsonpatch['apply'](_0x445509,_0x2c9efd,!![]);}catch(_0x55bf3e){return BPromise['reject'](_0x55bf3e);}return _0x445509[_0x2697('0x28')]();};}function saveUpdates(_0xaa83bf,_0x1cc909){return function(_0x1b99ad){if(_0x1b99ad){return _0x1b99ad[_0x2697('0x29')](_0xaa83bf)[_0x2697('0x2a')](function(_0x5a888c){return _0x5a888c;});}return null;};}function removeEntity(_0xdd6a6d,_0x34683b){return function(_0x1a2917){if(_0x1a2917){return _0x1a2917[_0x2697('0x2b')]()[_0x2697('0x2a')](function(){var _0x5854ae=_0x1a2917['get']({'plain':!![]});var _0x1a34fb=_0x2697('0x2c');return db[_0x2697('0x2d')][_0x2697('0x2b')]({'where':{'type':_0x1a34fb,'resourceId':_0x5854ae['id']}})[_0x2697('0x2a')](function(){return _0x1a2917;});})[_0x2697('0x2a')](function(){_0xdd6a6d['status'](0xcc)[_0x2697('0x21')]();});}};}function handleEntityNotFound(_0xe08ebb,_0x2c12aa){return function(_0x1a4dee){if(!_0x1a4dee){_0xe08ebb[_0x2697('0x1f')](0x194);}return _0x1a4dee;};}function handleError(_0x3a1a1f,_0x46e4c5){_0x46e4c5=_0x46e4c5||0x1f4;return function(_0x5df4bd){logger[_0x2697('0x2e')](_0x5df4bd[_0x2697('0x2f')]);if(_0x5df4bd[_0x2697('0x30')]){delete _0x5df4bd[_0x2697('0x30')];}_0x3a1a1f[_0x2697('0x20')](_0x46e4c5)[_0x2697('0x31')](_0x5df4bd);};}exports[_0x2697('0x32')]=function(_0x18d3a7,_0x287a29){var _0x107dd3={},_0xa04c45={},_0x2d0235={'count':0x0,'rows':[]};var _0xf656ae=_['map'](db[_0x2697('0x33')]['rawAttributes'],function(_0x13d267){return{'name':_0x13d267[_0x2697('0x34')],'type':_0x13d267[_0x2697('0x35')][_0x2697('0x36')]};});_0xa04c45[_0x2697('0x37')]=_['map'](_0xf656ae,'name');_0xa04c45['query']=_[_0x2697('0x38')](_0x18d3a7[_0x2697('0x39')]);_0xa04c45[_0x2697('0x3a')]=_[_0x2697('0x3b')](_0xa04c45[_0x2697('0x37')],_0xa04c45[_0x2697('0x39')]);_0x107dd3[_0x2697('0x3c')]=_[_0x2697('0x3b')](_0xa04c45[_0x2697('0x37')],qs['fields'](_0x18d3a7[_0x2697('0x39')][_0x2697('0x3d')]));_0x107dd3[_0x2697('0x3c')]=_0x107dd3['attributes'][_0x2697('0x3e')]?_0x107dd3['attributes']:_0xa04c45[_0x2697('0x37')];if(!_0x18d3a7['query'][_0x2697('0x3f')]('nolimit')){_0x107dd3[_0x2697('0x25')]=qs[_0x2697('0x25')](_0x18d3a7[_0x2697('0x39')][_0x2697('0x25')]);_0x107dd3[_0x2697('0x23')]=qs[_0x2697('0x23')](_0x18d3a7['query'][_0x2697('0x23')]);}_0x107dd3[_0x2697('0x40')]=qs[_0x2697('0x41')](_0x18d3a7[_0x2697('0x39')][_0x2697('0x41')]);_0x107dd3[_0x2697('0x42')]=qs[_0x2697('0x3a')](_[_0x2697('0x43')](_0x18d3a7[_0x2697('0x39')],_0xa04c45['filters']),_0xf656ae);if(_0x18d3a7[_0x2697('0x39')][_0x2697('0x44')]){_0x107dd3[_0x2697('0x42')]=_['merge'](_0x107dd3['where'],{'$or':_[_0x2697('0x45')](_0xf656ae,function(_0x475007){if(_0x475007[_0x2697('0x35')]!==_0x2697('0x46')){var _0x715912={};_0x715912[_0x475007[_0x2697('0x30')]]={'$like':'%'+_0x18d3a7[_0x2697('0x39')][_0x2697('0x44')]+'%'};return _0x715912;}})});}_0x107dd3=_[_0x2697('0x47')]({},_0x107dd3,_0x18d3a7[_0x2697('0x48')]);var _0x4d5a98={'where':_0x107dd3[_0x2697('0x42')]};return db['SmsQueue'][_0x2697('0x24')](_0x4d5a98)[_0x2697('0x2a')](function(_0x463296){_0x2d0235[_0x2697('0x24')]=_0x463296;if(_0x18d3a7[_0x2697('0x39')]['includeAll']){_0x107dd3['include']=[{'all':!![]}];}return db[_0x2697('0x33')][_0x2697('0x49')](_0x107dd3);})[_0x2697('0x2a')](function(_0x1ae880){_0x2d0235[_0x2697('0x4a')]=_0x1ae880;return _0x2d0235;})[_0x2697('0x2a')](respondWithFilteredResult(_0x287a29,_0x107dd3))[_0x2697('0x4b')](handleError(_0x287a29,null));};exports[_0x2697('0x4c')]=function(_0x47d384,_0x1810d1){var _0x39dd9b={'raw':!![],'where':{'id':_0x47d384[_0x2697('0x4d')]['id']}},_0x53f7b1={};_0x53f7b1['model']=_[_0x2697('0x38')](db[_0x2697('0x33')]['rawAttributes']);_0x53f7b1[_0x2697('0x39')]=_[_0x2697('0x38')](_0x47d384[_0x2697('0x39')]);_0x53f7b1[_0x2697('0x3a')]=_['intersection'](_0x53f7b1['model'],_0x53f7b1[_0x2697('0x39')]);_0x39dd9b[_0x2697('0x3c')]=_['intersection'](_0x53f7b1[_0x2697('0x37')],qs[_0x2697('0x3d')](_0x47d384[_0x2697('0x39')]['fields']));_0x39dd9b[_0x2697('0x3c')]=_0x39dd9b[_0x2697('0x3c')][_0x2697('0x3e')]?_0x39dd9b[_0x2697('0x3c')]:_0x53f7b1['model'];if(_0x47d384[_0x2697('0x39')][_0x2697('0x4e')]){_0x39dd9b[_0x2697('0x4f')]=[{'all':!![]}];}_0x39dd9b=_[_0x2697('0x47')]({},_0x39dd9b,_0x47d384[_0x2697('0x48')]);return db[_0x2697('0x33')]['find'](_0x39dd9b)[_0x2697('0x2a')](handleEntityNotFound(_0x1810d1,null))[_0x2697('0x2a')](respondWithResult(_0x1810d1,null))['catch'](handleError(_0x1810d1,null));};exports[_0x2697('0x50')]=function(_0x4bd343,_0x5c64ef){return db[_0x2697('0x33')][_0x2697('0x50')](_0x4bd343['body'],{})[_0x2697('0x2a')](function(_0x47adae){var _0x3d434f=_0x4bd343['user'][_0x2697('0x51')]({'plain':!![]});if(!_0x3d434f)throw new Error(_0x2697('0x52'));if(_0x3d434f['role']===_0x2697('0x53')){var _0x8014f6=_0x47adae[_0x2697('0x51')]({'plain':!![]});var _0x53ee98=_0x2697('0x2c');return db[_0x2697('0x54')][_0x2697('0x55')]({'where':{'name':_0x53ee98,'userProfileId':_0x3d434f[_0x2697('0x56')]},'raw':!![]})['then'](function(_0x172a55){if(_0x172a55&&_0x172a55['autoAssociation']===0x0){return db[_0x2697('0x2d')][_0x2697('0x50')]({'name':_0x8014f6['name'],'resourceId':_0x8014f6['id'],'type':_0x172a55[_0x2697('0x30')],'sectionId':_0x172a55['id']},{})[_0x2697('0x2a')](function(){return _0x47adae;});}else{return _0x47adae;}})[_0x2697('0x4b')](function(_0x45a0e1){logger[_0x2697('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45a0e1);throw _0x45a0e1;});}return _0x47adae;})[_0x2697('0x2a')](respondWithResult(_0x5c64ef,0xc9))[_0x2697('0x4b')](handleError(_0x5c64ef,null));};exports[_0x2697('0x29')]=function(_0x4b801f,_0x5ecda9){if(_0x4b801f['body']['id']){delete _0x4b801f[_0x2697('0x57')]['id'];}return db[_0x2697('0x33')][_0x2697('0x55')]({'where':{'id':_0x4b801f['params']['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0x5ecda9,null))[_0x2697('0x2a')](saveUpdates(_0x4b801f[_0x2697('0x57')],null))['then'](respondWithResult(_0x5ecda9,null))[_0x2697('0x4b')](handleError(_0x5ecda9,null));};exports['destroy']=function(_0x276dac,_0x231895){return db[_0x2697('0x33')]['find']({'where':{'id':_0x276dac['params']['id']}})['then'](handleEntityNotFound(_0x231895,null))[_0x2697('0x2a')](removeEntity(_0x231895,null))[_0x2697('0x4b')](handleError(_0x231895,null));};exports[_0x2697('0x58')]=function(_0x511492,_0x3374fe){return db['SmsQueue']['describe']()[_0x2697('0x2a')](respondWithResult(_0x3374fe,null))['catch'](handleError(_0x3374fe,null));};exports[_0x2697('0x59')]=function(_0x3eb885,_0xdd091d,_0xe63e92){var _0x474157={'raw':!![],'where':{}},_0x47f84a={},_0xf7ae78;return db[_0x2697('0x33')][_0x2697('0x5a')]({'where':{'id':_0x3eb885[_0x2697('0x4d')]['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0xdd091d,null))['then'](function(_0x83921f){if(_0x83921f){_0xf7ae78=_0x83921f[_0x2697('0x51')]({'plain':!![]});_0x47f84a[_0x2697('0x37')]=_[_0x2697('0x38')](db[_0x2697('0x5b')]['rawAttributes']);_0x47f84a[_0x2697('0x39')]=_[_0x2697('0x38')](_0x3eb885[_0x2697('0x39')]);_0x47f84a[_0x2697('0x3a')]=_[_0x2697('0x3b')](_0x47f84a[_0x2697('0x37')],_0x47f84a[_0x2697('0x39')]);_0x474157[_0x2697('0x3c')]=_[_0x2697('0x3b')](_0x47f84a['model'],qs[_0x2697('0x3d')](_0x3eb885[_0x2697('0x39')][_0x2697('0x3d')]));_0x474157[_0x2697('0x3c')]=_0x474157[_0x2697('0x3c')][_0x2697('0x3e')]?_0x474157[_0x2697('0x3c')]:_0x47f84a[_0x2697('0x37')];if(!_0x3eb885[_0x2697('0x39')][_0x2697('0x3f')](_0x2697('0x5c'))){_0x474157['limit']=qs[_0x2697('0x25')](_0x3eb885[_0x2697('0x39')]['limit']);_0x474157[_0x2697('0x23')]=qs[_0x2697('0x23')](_0x3eb885[_0x2697('0x39')][_0x2697('0x23')]);}_0x474157['order']=qs['sort'](_0x3eb885[_0x2697('0x39')][_0x2697('0x41')]);_0x474157[_0x2697('0x42')]=qs['filters'](_[_0x2697('0x43')](_0x3eb885[_0x2697('0x39')],_0x47f84a[_0x2697('0x3a')]));_0x474157[_0x2697('0x42')][_0x2697('0x5d')]=_0x83921f['id'];if(_0x3eb885[_0x2697('0x39')][_0x2697('0x44')]){_0x474157[_0x2697('0x42')]=_[_0x2697('0x47')](_0x474157['where'],{'$or':_[_0x2697('0x45')](_0x474157[_0x2697('0x3c')],function(_0x3028c1){var _0x3372ff={};_0x3372ff[_0x3028c1]={'$like':'%'+_0x3eb885['query'][_0x2697('0x44')]+'%'};return _0x3372ff;})});}_0x474157=_[_0x2697('0x47')]({},_0x474157,_0x3eb885['options']);return db[_0x2697('0x5b')][_0x2697('0x49')](_0x474157);}})['then'](function(_0x1a5667){if(_0x1a5667){return db[_0x2697('0x5e')][_0x2697('0x5f')]({'where':{'id':_['map'](_0x1a5667,'UserId'),'role':_0x2697('0x60')},'attributes':['id',_0x2697('0x30'),'smsPause','updatedAt','createdAt']});}})[_0x2697('0x2a')](function(_0x364337){if(_0x364337){return{'count':_0x364337[_0x2697('0x24')],'rows':_[_0x2697('0x45')](_0x364337['rows'],function(_0x3bfbc4){return{'membername':_0x3bfbc4[_0x2697('0x30')],'UserId':_0x3bfbc4['id'],'queue_name':_0xf7ae78[_0x2697('0x30')],'SmsQueueId':_0xf7ae78['id'],'interface':util[_0x2697('0x61')]('%s/%s',_0x2697('0x62'),_0x3bfbc4[_0x2697('0x30')]),'penalty':0x0,'paused':_0x3bfbc4[_0x2697('0x63')],'createdAt':_0x3bfbc4[_0x2697('0x64')],'updatedAt':_0x3bfbc4[_0x2697('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xdd091d,_0x474157))['catch'](handleError(_0xdd091d,null));};exports['getTeams']=function(_0x5b9270,_0x3c7838,_0x255558){var _0x39cbc6={};var _0x1951da={};var _0x58ccf3;var _0x1c899b;return db[_0x2697('0x33')][_0x2697('0x5a')]({'where':{'id':_0x5b9270[_0x2697('0x4d')]['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0x3c7838,null))[_0x2697('0x2a')](function(_0x31624f){if(_0x31624f){_0x58ccf3=_0x31624f;_0x1951da[_0x2697('0x37')]=_['keys'](db[_0x2697('0x66')][_0x2697('0x67')]);_0x1951da['query']=_[_0x2697('0x38')](_0x5b9270[_0x2697('0x39')]);_0x1951da[_0x2697('0x3a')]=_['intersection'](_0x1951da[_0x2697('0x37')],_0x1951da[_0x2697('0x39')]);_0x39cbc6[_0x2697('0x3c')]=_[_0x2697('0x3b')](_0x1951da[_0x2697('0x37')],qs[_0x2697('0x3d')](_0x5b9270[_0x2697('0x39')][_0x2697('0x3d')]));_0x39cbc6[_0x2697('0x3c')]=_0x39cbc6[_0x2697('0x3c')][_0x2697('0x3e')]?_0x39cbc6[_0x2697('0x3c')]:_0x1951da[_0x2697('0x37')];_0x39cbc6[_0x2697('0x40')]=qs[_0x2697('0x41')](_0x5b9270[_0x2697('0x39')][_0x2697('0x41')]);_0x39cbc6[_0x2697('0x42')]=qs[_0x2697('0x3a')](_[_0x2697('0x43')](_0x5b9270['query'],_0x1951da['filters']));if(_0x5b9270[_0x2697('0x39')][_0x2697('0x44')]){_0x39cbc6[_0x2697('0x42')]=_[_0x2697('0x47')](_0x39cbc6[_0x2697('0x42')],{'$or':_[_0x2697('0x45')](_0x39cbc6['attributes'],function(_0x119b7d){var _0x49a658={};_0x49a658[_0x119b7d]={'$like':'%'+_0x5b9270['query']['filter']+'%'};return _0x49a658;})});}_0x39cbc6=_[_0x2697('0x47')]({},_0x39cbc6,_0x5b9270['options']);return _0x58ccf3['getTeams'](_0x39cbc6);}})[_0x2697('0x2a')](function(_0x584182){if(_0x584182){_0x1c899b=_0x584182[_0x2697('0x3e')];if(!_0x5b9270[_0x2697('0x39')][_0x2697('0x3f')](_0x2697('0x5c'))){_0x39cbc6[_0x2697('0x25')]=qs['limit'](_0x5b9270[_0x2697('0x39')][_0x2697('0x25')]);_0x39cbc6[_0x2697('0x23')]=qs[_0x2697('0x23')](_0x5b9270['query'][_0x2697('0x23')]);}return _0x58ccf3['getTeams'](_0x39cbc6);}})[_0x2697('0x2a')](function(_0x30935e){if(_0x30935e){return _0x30935e?{'count':_0x1c899b,'rows':_0x30935e}:null;}})[_0x2697('0x2a')](respondWithResult(_0x3c7838,null))[_0x2697('0x4b')](handleError(_0x3c7838,null));};exports[_0x2697('0x68')]=function(_0x553768,_0x5c94ea,_0x2e7080){var _0x24730e=_0x553768[_0x2697('0x57')]['ids'];return db[_0x2697('0x66')][_0x2697('0x49')]({'where':{'id':_0x24730e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2697('0x69'),'attributes':['id',_0x2697('0x30'),'online',_0x2697('0x6a'),_0x2697('0x6b')],'raw':!![]}]})['then'](function(_0x482dd2){if(_0x482dd2){var _0x31a5f3=_[_0x2697('0x6c')](_0x482dd2,function(_0x5071cd){var _0x5703c5=_0x5071cd['get']({'plain':!![]});return _0x5703c5[_0x2697('0x69')];});return db[_0x2697('0x33')][_0x2697('0x55')]({'where':{'id':_0x553768['params']['id']}})['then'](function(_0x2c238f){return db[_0x2697('0x6d')][_0x2697('0x6e')](function(_0x2d1512){return _0x2c238f['addTeams'](_0x24730e,{'transaction':_0x2d1512})[_0x2697('0x2a')](function(){return BPromise[_0x2697('0x6f')](_0x31a5f3,function(_0x13d71c){return db[_0x2697('0x5b')]['findOrCreate']({'where':{'UserId':_0x13d71c['id'],'SmsQueueId':_0x553768['params']['id']},'transaction':_0x2d1512});});})['then'](function(){_0x31a5f3[_0x2697('0x70')](function(_0x9b0bef){socket[_0x2697('0x71')](_0x2697('0x72'),{'UserId':_0x9b0bef['id'],'SmsQueueId':_0x2c238f['id']});});});});});}})[_0x2697('0x2a')](respondWithStatusCode(_0x5c94ea,null))['catch'](handleError(_0x5c94ea,null));};exports[_0x2697('0x73')]=function(_0x4b6b8d,_0xd62a6b,_0x3d3388){return db['Team'][_0x2697('0x49')]({'where':{'id':_0x4b6b8d[_0x2697('0x39')][_0x2697('0x74')]},'attributes':['id'],'include':[{'model':db[_0x2697('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2697('0x2a')](handleEntityNotFound(_0xd62a6b,null))[_0x2697('0x2a')](function(_0x1bd914){var _0x44be25=_[_0x2697('0x45')](_0x1bd914,'id');var _0x1adddc=[];var _0x2fbf2d=[];var _0x5aa207=squel[_0x2697('0x75')]();_0x5aa207[_0x2697('0x76')](_0x2697('0x77'))[_0x2697('0x78')](_0x2697('0x79'),'tq')[_0x2697('0x7a')](_0x2697('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2697('0x7c'),_0x4b6b8d[_0x2697('0x4d')]['id']);for(var _0x59241e=0x0;_0x59241e<_0x1bd914[_0x2697('0x3e')];_0x59241e+=0x1){let _0xeb5845=_0x1bd914[_0x59241e];for(var _0xc8b8d8=0x0;_0xc8b8d8<_0xeb5845[_0x2697('0x69')][_0x2697('0x3e')];_0xc8b8d8+=0x1){let _0x4e81d6=_0xeb5845[_0x2697('0x69')][_0xc8b8d8];var _0x3595a2=_0x5aa207[_0x2697('0x7d')]();_0x3595a2[_0x2697('0x42')]('ut.UserId\x20=\x20?',_0x4e81d6['id']);_0x2fbf2d[_0x2697('0x7e')](db[_0x2697('0x6d')][_0x2697('0x39')](_0x3595a2[_0x2697('0x7f')](),{'type':db[_0x2697('0x6d')]['QueryTypes']['SELECT']})[_0x2697('0x2a')](function(_0xcfdc51){if(_0xcfdc51[_0x2697('0x3e')]===0x1){return _0x4e81d6['id'];}else{var _0x190ee0=_[_0x2697('0x80')](_[_0x2697('0x45')](_0xcfdc51,_0x2697('0x81')),function(_0x3ded33){return _['includes'](_0x44be25,_0x3ded33);});if(_0x190ee0){return _0x4e81d6['id'];}}}));}}return BPromise[_0x2697('0x82')](_0x2fbf2d)[_0x2697('0x2a')](function(_0x2ae839){_0x1adddc=_(_0x1adddc)[_0x2697('0x83')](_0x2ae839)['compact']()[_0x2697('0x84')]();return db[_0x2697('0x33')][_0x2697('0x55')]({'where':{'id':_0x4b6b8d['params']['id']}})[_0x2697('0x2a')](function(_0x2da404){return db[_0x2697('0x6d')][_0x2697('0x6e')](function(_0x510278){return _0x2da404[_0x2697('0x73')](_0x4b6b8d['query'][_0x2697('0x74')],{'transaction':_0x510278})[_0x2697('0x2a')](function(){if(!_[_0x2697('0x85')](_0x1adddc)){return _0x2da404[_0x2697('0x86')](_0x1adddc,{'transaction':_0x510278});}})['then'](function(){_0x1adddc[_0x2697('0x70')](function(_0x35fd81){socket['emit'](_0x2697('0x87'),{'UserId':_0x35fd81,'SmsQueueId':_0x2da404['id']});});});});});});})[_0x2697('0x2a')](respondWithStatusCode(_0xd62a6b,null))['catch'](handleError(_0xd62a6b,null));};exports['addAgents']=function(_0x4853ba,_0x42958c,_0x5de0a7){return db['SmsQueue'][_0x2697('0x55')]({'where':{'id':_0x4853ba[_0x2697('0x4d')]['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0x42958c,null))[_0x2697('0x2a')](function(_0x3d0a51){if(_0x3d0a51){return _0x3d0a51['addAgents'](_0x4853ba['body'][_0x2697('0x74')],_[_0x2697('0x88')](_0x4853ba[_0x2697('0x57')],[_0x2697('0x74'),'id'])||{})[_0x2697('0x89')](function(_0x41c0ca){for(var _0x5de9a4=0x0;_0x5de9a4<_0x4853ba[_0x2697('0x57')]['ids']['length'];_0x5de9a4+=0x1){socket[_0x2697('0x71')](_0x2697('0x72'),{'UserId':Number(_0x4853ba[_0x2697('0x57')]['ids'][_0x5de9a4]),'SmsQueueId':Number(_0x4853ba[_0x2697('0x4d')]['id'])});}return _0x41c0ca;});}})[_0x2697('0x2a')](respondWithResult(_0x42958c,null))['catch'](handleError(_0x42958c,null));};exports[_0x2697('0x86')]=function(_0x37af1b,_0x508fa0,_0x259d04){return db[_0x2697('0x33')][_0x2697('0x55')]({'where':{'id':_0x37af1b['params']['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0x508fa0,null))[_0x2697('0x2a')](function(_0x4e945f){if(_0x4e945f){return _0x4e945f[_0x2697('0x86')](_0x37af1b[_0x2697('0x39')][_0x2697('0x74')])[_0x2697('0x2a')](function(){if(_[_0x2697('0x8a')](_0x37af1b[_0x2697('0x39')]['ids'])){for(var _0x5a72a8=0x0;_0x5a72a8<_0x37af1b[_0x2697('0x39')][_0x2697('0x74')]['length'];_0x5a72a8+=0x1){socket['emit'](_0x2697('0x87'),{'UserId':Number(_0x37af1b[_0x2697('0x39')][_0x2697('0x74')][_0x5a72a8]),'SmsQueueId':Number(_0x37af1b['params']['id'])});}}else{socket[_0x2697('0x71')](_0x2697('0x87'),{'UserId':Number(_0x37af1b[_0x2697('0x39')][_0x2697('0x74')]),'SmsQueueId':Number(_0x37af1b[_0x2697('0x4d')]['id'])});}});}})[_0x2697('0x2a')](respondWithStatusCode(_0x508fa0,null))['catch'](handleError(_0x508fa0,null));};exports[_0x2697('0x8b')]=function(_0xf7b2a9,_0x5b284f,_0x2d33ed){var _0x194745={};var _0x1de58b={};var _0x18fa6c;var _0x319cf0;return db['SmsQueue'][_0x2697('0x5a')]({'where':{'id':_0xf7b2a9[_0x2697('0x4d')]['id']}})[_0x2697('0x2a')](handleEntityNotFound(_0x5b284f,null))['then'](function(_0x53998f){if(_0x53998f){_0x18fa6c=_0x53998f;_0x1de58b[_0x2697('0x37')]=_['keys'](db[_0x2697('0x5e')][_0x2697('0x67')]);_0x1de58b[_0x2697('0x39')]=_[_0x2697('0x38')](_0xf7b2a9['query']);_0x1de58b[_0x2697('0x3a')]=_[_0x2697('0x3b')](_0x1de58b[_0x2697('0x37')],_0x1de58b[_0x2697('0x39')]);_0x194745[_0x2697('0x3c')]=_[_0x2697('0x3b')](_0x1de58b[_0x2697('0x37')],qs[_0x2697('0x3d')](_0xf7b2a9['query']['fields']));_0x194745['attributes']=_0x194745[_0x2697('0x3c')][_0x2697('0x3e')]?_0x194745['attributes']:_0x1de58b['model'];_0x194745[_0x2697('0x40')]=qs[_0x2697('0x41')](_0xf7b2a9[_0x2697('0x39')][_0x2697('0x41')]);_0x194745[_0x2697('0x42')]=qs[_0x2697('0x3a')](_[_0x2697('0x43')](_0xf7b2a9[_0x2697('0x39')],_0x1de58b[_0x2697('0x3a')]));if(_0xf7b2a9[_0x2697('0x39')][_0x2697('0x44')]){_0x194745[_0x2697('0x42')]=_['merge'](_0x194745['where'],{'$or':_[_0x2697('0x45')](_0x194745[_0x2697('0x3c')],function(_0x3617cd){var _0x2ebbc5={};_0x2ebbc5[_0x3617cd]={'$like':'%'+_0xf7b2a9[_0x2697('0x39')]['filter']+'%'};return _0x2ebbc5;})});}_0x194745=_[_0x2697('0x47')]({},_0x194745,_0xf7b2a9['options']);return _0x18fa6c[_0x2697('0x8b')](_0x194745);}})[_0x2697('0x2a')](function(_0x86b7f8){if(_0x86b7f8){_0x319cf0=_0x86b7f8['length'];if(!_0xf7b2a9[_0x2697('0x39')][_0x2697('0x3f')](_0x2697('0x5c'))){_0x194745[_0x2697('0x25')]=qs[_0x2697('0x25')](_0xf7b2a9[_0x2697('0x39')]['limit']);_0x194745[_0x2697('0x23')]=qs[_0x2697('0x23')](_0xf7b2a9[_0x2697('0x39')]['offset']);}return _0x18fa6c[_0x2697('0x8b')](_0x194745);}})[_0x2697('0x2a')](function(_0x5db4fa){if(_0x5db4fa){return _0x5db4fa?{'count':_0x319cf0,'rows':_0x5db4fa}:null;}})[_0x2697('0x2a')](respondWithResult(_0x5b284f,null))[_0x2697('0x4b')](handleError(_0x5b284f,null));}; \ No newline at end of file +var _0xe596=['getTeams','Team','addTeams','online','voicePause','interface','Agents','sequelize','transaction','findOrCreate','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','ids','removeAgents','forEach','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','fieldName','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','SmsQueueId','filter','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP'];(function(_0x4fb7ea,_0x54c72d){var _0x263966=function(_0x470510){while(--_0x470510){_0x4fb7ea['push'](_0x4fb7ea['shift']());}};_0x263966(++_0x54c72d);}(_0xe596,0xb1));var _0x6e59=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xe596[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e59('0x0'));var zipdir=require(_0x6e59('0x1'));var jsonpatch=require(_0x6e59('0x2'));var rp=require('request-promise');var moment=require(_0x6e59('0x3'));var BPromise=require(_0x6e59('0x4'));var Mustache=require(_0x6e59('0x5'));var util=require(_0x6e59('0x6'));var path=require(_0x6e59('0x7'));var sox=require(_0x6e59('0x8'));var csv=require(_0x6e59('0x9'));var ejs=require(_0x6e59('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e59('0xb'));var squel=require(_0x6e59('0xc'));var crypto=require('crypto');var jsforce=require(_0x6e59('0xd'));var deskjs=require(_0x6e59('0xe'));var toCsv=require(_0x6e59('0x9'));var querystring=require(_0x6e59('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e59('0x10'));var authService=require(_0x6e59('0x11'));var qs=require(_0x6e59('0x12'));var as=require(_0x6e59('0x13'));var hardwareService=require(_0x6e59('0x14'));var logger=require(_0x6e59('0x15'))(_0x6e59('0x16'));var utils=require('../../config/utils');var config=require(_0x6e59('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e59('0x18'))['db'];config['redis']=_[_0x6e59('0x19')](config[_0x6e59('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e59('0x1b'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0xadb8a3,_0x2fc274){_0x2fc274=_0x2fc274||0xcc;return function(_0x2d642d){if(_0x2d642d){return _0xadb8a3['sendStatus'](_0x2fc274);}return _0xadb8a3[_0x6e59('0x1c')](_0x2fc274)[_0x6e59('0x1d')]();};}function respondWithResult(_0x2bd39d,_0x410dbc){_0x410dbc=_0x410dbc||0xc8;return function(_0x46e3c2){if(_0x46e3c2){return _0x2bd39d[_0x6e59('0x1c')](_0x410dbc)['json'](_0x46e3c2);}};}function respondWithFilteredResult(_0x50f1d7,_0x5f0357){return function(_0x41859e){if(_0x41859e){var _0x56e011=typeof _0x5f0357[_0x6e59('0x1e')]==='undefined'&&typeof _0x5f0357[_0x6e59('0x1f')]===_0x6e59('0x20');var _0x132ece=_0x41859e[_0x6e59('0x21')];var _0x3083c6=_0x56e011?0x0:_0x5f0357['offset'];var _0x1fc6ed=_0x56e011?_0x41859e[_0x6e59('0x21')]:_0x5f0357['offset']+_0x5f0357['limit'];var _0x36ff11;if(_0x1fc6ed>=_0x132ece){_0x1fc6ed=_0x132ece;_0x36ff11=0xc8;}else{_0x36ff11=0xce;}_0x50f1d7[_0x6e59('0x1c')](_0x36ff11);return _0x50f1d7[_0x6e59('0x22')]('Content-Range',_0x3083c6+'-'+_0x1fc6ed+'/'+_0x132ece)[_0x6e59('0x23')](_0x41859e);}return null;};}function patchUpdates(_0x1405c0){return function(_0xb7edd2){try{jsonpatch[_0x6e59('0x24')](_0xb7edd2,_0x1405c0,!![]);}catch(_0x40c67c){return BPromise[_0x6e59('0x25')](_0x40c67c);}return _0xb7edd2[_0x6e59('0x26')]();};}function saveUpdates(_0x3ae530,_0x4c470d){return function(_0x5d6696){if(_0x5d6696){return _0x5d6696[_0x6e59('0x27')](_0x3ae530)[_0x6e59('0x28')](function(_0x29f934){return _0x29f934;});}return null;};}function removeEntity(_0x1e2df0,_0x2347ae){return function(_0x291913){if(_0x291913){return _0x291913[_0x6e59('0x29')]()[_0x6e59('0x28')](function(){var _0x5c70c9=_0x291913[_0x6e59('0x2a')]({'plain':!![]});var _0x599bfb=_0x6e59('0x2b');return db[_0x6e59('0x2c')][_0x6e59('0x29')]({'where':{'type':_0x599bfb,'resourceId':_0x5c70c9['id']}})[_0x6e59('0x28')](function(){return _0x291913;});})[_0x6e59('0x28')](function(){_0x1e2df0[_0x6e59('0x1c')](0xcc)[_0x6e59('0x1d')]();});}};}function handleEntityNotFound(_0x33277b,_0x44f5bc){return function(_0x3aef74){if(!_0x3aef74){_0x33277b['sendStatus'](0x194);}return _0x3aef74;};}function handleError(_0x4e8fa8,_0x34ca23){_0x34ca23=_0x34ca23||0x1f4;return function(_0xab6637){logger['error'](_0xab6637[_0x6e59('0x2d')]);if(_0xab6637[_0x6e59('0x2e')]){delete _0xab6637[_0x6e59('0x2e')];}_0x4e8fa8[_0x6e59('0x1c')](_0x34ca23)[_0x6e59('0x2f')](_0xab6637);};}exports[_0x6e59('0x30')]=function(_0x5edf39,_0x5f33e2){var _0x404650={},_0x1a0e16={},_0x54f235={'count':0x0,'rows':[]};var _0x379f56=_['map'](db[_0x6e59('0x31')][_0x6e59('0x32')],function(_0x39172b){return{'name':_0x39172b[_0x6e59('0x33')],'type':_0x39172b['type']['key']};});_0x1a0e16[_0x6e59('0x34')]=_[_0x6e59('0x35')](_0x379f56,_0x6e59('0x2e'));_0x1a0e16['query']=_[_0x6e59('0x36')](_0x5edf39[_0x6e59('0x37')]);_0x1a0e16['filters']=_[_0x6e59('0x38')](_0x1a0e16[_0x6e59('0x34')],_0x1a0e16[_0x6e59('0x37')]);_0x404650['attributes']=_['intersection'](_0x1a0e16[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x39')]));_0x404650['attributes']=_0x404650[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x404650[_0x6e59('0x3a')]:_0x1a0e16[_0x6e59('0x34')];if(!_0x5edf39[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x404650[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x1f')]);_0x404650['offset']=qs[_0x6e59('0x1e')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x1e')]);}_0x404650[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x3f')]);_0x404650[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x5edf39['query'],_0x1a0e16[_0x6e59('0x41')]),_0x379f56);if(_0x5edf39[_0x6e59('0x37')]['filter']){_0x404650[_0x6e59('0x40')]=_[_0x6e59('0x43')](_0x404650['where'],{'$or':_['map'](_0x379f56,function(_0x4a6eb5){if(_0x4a6eb5[_0x6e59('0x44')]!==_0x6e59('0x45')){var _0x53388e={};_0x53388e[_0x4a6eb5['name']]={'$like':'%'+_0x5edf39['query']['filter']+'%'};return _0x53388e;}})});}_0x404650=_['merge']({},_0x404650,_0x5edf39['options']);var _0x2e9f39={'where':_0x404650[_0x6e59('0x40')]};return db[_0x6e59('0x31')][_0x6e59('0x21')](_0x2e9f39)[_0x6e59('0x28')](function(_0x418a0f){_0x54f235[_0x6e59('0x21')]=_0x418a0f;if(_0x5edf39[_0x6e59('0x37')]['includeAll']){_0x404650[_0x6e59('0x46')]=[{'all':!![]}];}return db[_0x6e59('0x31')][_0x6e59('0x47')](_0x404650);})[_0x6e59('0x28')](function(_0x6e862a){_0x54f235['rows']=_0x6e862a;return _0x54f235;})['then'](respondWithFilteredResult(_0x5f33e2,_0x404650))[_0x6e59('0x48')](handleError(_0x5f33e2,null));};exports[_0x6e59('0x49')]=function(_0x41a378,_0x569aed){var _0x32dd1e={'raw':!![],'where':{'id':_0x41a378[_0x6e59('0x4a')]['id']}},_0x1a123b={};_0x1a123b[_0x6e59('0x34')]=_[_0x6e59('0x36')](db[_0x6e59('0x31')][_0x6e59('0x32')]);_0x1a123b[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x41a378[_0x6e59('0x37')]);_0x1a123b[_0x6e59('0x41')]=_[_0x6e59('0x38')](_0x1a123b[_0x6e59('0x34')],_0x1a123b[_0x6e59('0x37')]);_0x32dd1e[_0x6e59('0x3a')]=_['intersection'](_0x1a123b[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x41a378[_0x6e59('0x37')][_0x6e59('0x39')]));_0x32dd1e[_0x6e59('0x3a')]=_0x32dd1e[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x32dd1e[_0x6e59('0x3a')]:_0x1a123b['model'];if(_0x41a378[_0x6e59('0x37')][_0x6e59('0x4b')]){_0x32dd1e['include']=[{'all':!![]}];}_0x32dd1e=_['merge']({},_0x32dd1e,_0x41a378[_0x6e59('0x4c')]);return db[_0x6e59('0x31')][_0x6e59('0x4d')](_0x32dd1e)[_0x6e59('0x28')](handleEntityNotFound(_0x569aed,null))[_0x6e59('0x28')](respondWithResult(_0x569aed,null))[_0x6e59('0x48')](handleError(_0x569aed,null));};exports['create']=function(_0x54faab,_0x243ef9){return db[_0x6e59('0x31')]['create'](_0x54faab['body'],{})[_0x6e59('0x28')](function(_0x507bc3){var _0x3e7e25=_0x54faab[_0x6e59('0x4e')][_0x6e59('0x2a')]({'plain':!![]});if(!_0x3e7e25)throw new Error(_0x6e59('0x4f'));if(_0x3e7e25['role']==='user'){var _0x503030=_0x507bc3[_0x6e59('0x2a')]({'plain':!![]});var _0x4d2fba='SmsQueues';return db[_0x6e59('0x50')][_0x6e59('0x4d')]({'where':{'name':_0x4d2fba,'userProfileId':_0x3e7e25[_0x6e59('0x51')]},'raw':!![]})[_0x6e59('0x28')](function(_0xf0cbc2){if(_0xf0cbc2&&_0xf0cbc2[_0x6e59('0x52')]===0x0){return db[_0x6e59('0x2c')][_0x6e59('0x53')]({'name':_0x503030[_0x6e59('0x2e')],'resourceId':_0x503030['id'],'type':_0xf0cbc2[_0x6e59('0x2e')],'sectionId':_0xf0cbc2['id']},{})[_0x6e59('0x28')](function(){return _0x507bc3;});}else{return _0x507bc3;}})[_0x6e59('0x48')](function(_0x18c60a){logger[_0x6e59('0x54')](_0x6e59('0x55'),_0x18c60a);throw _0x18c60a;});}return _0x507bc3;})['then'](respondWithResult(_0x243ef9,0xc9))[_0x6e59('0x48')](handleError(_0x243ef9,null));};exports[_0x6e59('0x27')]=function(_0x3f55d4,_0x41031f){if(_0x3f55d4[_0x6e59('0x56')]['id']){delete _0x3f55d4[_0x6e59('0x56')]['id'];}return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x3f55d4['params']['id']}})['then'](handleEntityNotFound(_0x41031f,null))['then'](saveUpdates(_0x3f55d4['body'],null))[_0x6e59('0x28')](respondWithResult(_0x41031f,null))['catch'](handleError(_0x41031f,null));};exports[_0x6e59('0x29')]=function(_0x546ae9,_0x30f7dc){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x546ae9[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x30f7dc,null))[_0x6e59('0x28')](removeEntity(_0x30f7dc,null))[_0x6e59('0x48')](handleError(_0x30f7dc,null));};exports['describe']=function(_0x4cdd8b,_0x169b9b){return db['SmsQueue'][_0x6e59('0x57')]()[_0x6e59('0x28')](respondWithResult(_0x169b9b,null))['catch'](handleError(_0x169b9b,null));};exports['getMembers']=function(_0x446ff2,_0x55ac54,_0x9d2b6d){var _0x226537={'raw':!![],'where':{}},_0x183e21={},_0x55471d;return db['SmsQueue'][_0x6e59('0x58')]({'where':{'id':_0x446ff2[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x55ac54,null))['then'](function(_0x4a6cf3){if(_0x4a6cf3){_0x55471d=_0x4a6cf3[_0x6e59('0x2a')]({'plain':!![]});_0x183e21[_0x6e59('0x34')]=_['keys'](db['UserSmsQueue'][_0x6e59('0x32')]);_0x183e21[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x446ff2[_0x6e59('0x37')]);_0x183e21['filters']=_[_0x6e59('0x38')](_0x183e21['model'],_0x183e21['query']);_0x226537[_0x6e59('0x3a')]=_['intersection'](_0x183e21[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x446ff2[_0x6e59('0x37')][_0x6e59('0x39')]));_0x226537[_0x6e59('0x3a')]=_0x226537['attributes'][_0x6e59('0x3b')]?_0x226537[_0x6e59('0x3a')]:_0x183e21['model'];if(!_0x446ff2[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x226537[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x446ff2[_0x6e59('0x37')][_0x6e59('0x1f')]);_0x226537[_0x6e59('0x1e')]=qs['offset'](_0x446ff2[_0x6e59('0x37')]['offset']);}_0x226537[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x446ff2[_0x6e59('0x37')]['sort']);_0x226537['where']=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x446ff2[_0x6e59('0x37')],_0x183e21[_0x6e59('0x41')]));_0x226537[_0x6e59('0x40')][_0x6e59('0x59')]=_0x4a6cf3['id'];if(_0x446ff2[_0x6e59('0x37')]['filter']){_0x226537[_0x6e59('0x40')]=_['merge'](_0x226537[_0x6e59('0x40')],{'$or':_[_0x6e59('0x35')](_0x226537[_0x6e59('0x3a')],function(_0x11e411){var _0x3718fd={};_0x3718fd[_0x11e411]={'$like':'%'+_0x446ff2[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x3718fd;})});}_0x226537=_[_0x6e59('0x43')]({},_0x226537,_0x446ff2[_0x6e59('0x4c')]);return db[_0x6e59('0x5b')][_0x6e59('0x47')](_0x226537);}})[_0x6e59('0x28')](function(_0x3ccf57){if(_0x3ccf57){return db[_0x6e59('0x5c')][_0x6e59('0x5d')]({'where':{'id':_[_0x6e59('0x35')](_0x3ccf57,_0x6e59('0x5e')),'role':_0x6e59('0x5f')},'attributes':['id',_0x6e59('0x2e'),_0x6e59('0x60'),_0x6e59('0x61'),_0x6e59('0x62')]});}})[_0x6e59('0x28')](function(_0x3f2d39){if(_0x3f2d39){return{'count':_0x3f2d39[_0x6e59('0x21')],'rows':_['map'](_0x3f2d39[_0x6e59('0x63')],function(_0x4806c4){return{'membername':_0x4806c4[_0x6e59('0x2e')],'UserId':_0x4806c4['id'],'queue_name':_0x55471d[_0x6e59('0x2e')],'SmsQueueId':_0x55471d['id'],'interface':util[_0x6e59('0x64')](_0x6e59('0x65'),_0x6e59('0x66'),_0x4806c4[_0x6e59('0x2e')]),'penalty':0x0,'paused':_0x4806c4[_0x6e59('0x60')],'createdAt':_0x4806c4['createdAt'],'updatedAt':_0x4806c4[_0x6e59('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6e59('0x28')](respondWithFilteredResult(_0x55ac54,_0x226537))[_0x6e59('0x48')](handleError(_0x55ac54,null));};exports[_0x6e59('0x67')]=function(_0x16feb4,_0x1ac7e6,_0x26f515){var _0x476d59={};var _0xc39855={};var _0x2125ec;var _0x35c43d;return db[_0x6e59('0x31')][_0x6e59('0x58')]({'where':{'id':_0x16feb4[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x1ac7e6,null))[_0x6e59('0x28')](function(_0x3c5b89){if(_0x3c5b89){_0x2125ec=_0x3c5b89;_0xc39855[_0x6e59('0x34')]=_[_0x6e59('0x36')](db[_0x6e59('0x68')][_0x6e59('0x32')]);_0xc39855[_0x6e59('0x37')]=_['keys'](_0x16feb4['query']);_0xc39855['filters']=_['intersection'](_0xc39855[_0x6e59('0x34')],_0xc39855['query']);_0x476d59[_0x6e59('0x3a')]=_[_0x6e59('0x38')](_0xc39855[_0x6e59('0x34')],qs['fields'](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x39')]));_0x476d59[_0x6e59('0x3a')]=_0x476d59[_0x6e59('0x3a')]['length']?_0x476d59[_0x6e59('0x3a')]:_0xc39855[_0x6e59('0x34')];_0x476d59[_0x6e59('0x3e')]=qs['sort'](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x3f')]);_0x476d59[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x16feb4[_0x6e59('0x37')],_0xc39855[_0x6e59('0x41')]));if(_0x16feb4[_0x6e59('0x37')][_0x6e59('0x5a')]){_0x476d59['where']=_[_0x6e59('0x43')](_0x476d59['where'],{'$or':_[_0x6e59('0x35')](_0x476d59[_0x6e59('0x3a')],function(_0x3e1244){var _0x2f1df9={};_0x2f1df9[_0x3e1244]={'$like':'%'+_0x16feb4[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x2f1df9;})});}_0x476d59=_[_0x6e59('0x43')]({},_0x476d59,_0x16feb4[_0x6e59('0x4c')]);return _0x2125ec[_0x6e59('0x67')](_0x476d59);}})['then'](function(_0x488826){if(_0x488826){_0x35c43d=_0x488826[_0x6e59('0x3b')];if(!_0x16feb4[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x476d59[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x16feb4['query'][_0x6e59('0x1f')]);_0x476d59['offset']=qs[_0x6e59('0x1e')](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x1e')]);}return _0x2125ec[_0x6e59('0x67')](_0x476d59);}})['then'](function(_0x52bc91){if(_0x52bc91){return _0x52bc91?{'count':_0x35c43d,'rows':_0x52bc91}:null;}})['then'](respondWithResult(_0x1ac7e6,null))['catch'](handleError(_0x1ac7e6,null));};exports[_0x6e59('0x69')]=function(_0x521a7a,_0x50055d,_0x3dc39a){var _0x38483e=_0x521a7a[_0x6e59('0x56')]['ids'];return db[_0x6e59('0x68')][_0x6e59('0x47')]({'where':{'id':_0x38483e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x6e59('0x6a'),_0x6e59('0x6b'),_0x6e59('0x6c')],'raw':!![]}]})[_0x6e59('0x28')](function(_0x3a5506){if(_0x3a5506){var _0x43cd0c=_['flatMap'](_0x3a5506,function(_0x5795f1){var _0x4c11d1=_0x5795f1['get']({'plain':!![]});return _0x4c11d1[_0x6e59('0x6d')];});return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x521a7a[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](function(_0x5deb3f){return db[_0x6e59('0x6e')][_0x6e59('0x6f')](function(_0x51f255){return _0x5deb3f[_0x6e59('0x69')](_0x38483e,{'transaction':_0x51f255})[_0x6e59('0x28')](function(){return BPromise['each'](_0x43cd0c,function(_0x259ca6){return db[_0x6e59('0x5b')][_0x6e59('0x70')]({'where':{'UserId':_0x259ca6['id'],'SmsQueueId':_0x521a7a[_0x6e59('0x4a')]['id']},'transaction':_0x51f255});});})[_0x6e59('0x28')](function(){_0x43cd0c['forEach'](function(_0x26878b){socket['emit'](_0x6e59('0x71'),{'UserId':_0x26878b['id'],'SmsQueueId':_0x5deb3f['id']});});});});});}})['then'](respondWithStatusCode(_0x50055d,null))['catch'](handleError(_0x50055d,null));};exports[_0x6e59('0x72')]=function(_0x43610d,_0x51d5af,_0x50e46a){return db[_0x6e59('0x68')][_0x6e59('0x47')]({'where':{'id':_0x43610d[_0x6e59('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6e59('0x5c')],'as':_0x6e59('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x6e59('0x28')](handleEntityNotFound(_0x51d5af,null))[_0x6e59('0x28')](function(_0x20a0b2){var _0x4bd953=_[_0x6e59('0x35')](_0x20a0b2,'id');var _0x1d7b5b=[];var _0x301112=[];var _0x16f95c=squel[_0x6e59('0x73')]();_0x16f95c['field'](_0x6e59('0x74'))['from'](_0x6e59('0x75'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6e59('0x40')](_0x6e59('0x76'),_0x43610d[_0x6e59('0x4a')]['id']);for(var _0x2d4ca3=0x0;_0x2d4ca3<_0x20a0b2['length'];_0x2d4ca3+=0x1){let _0x532fa8=_0x20a0b2[_0x2d4ca3];for(var _0x2d44e1=0x0;_0x2d44e1<_0x532fa8['Agents'][_0x6e59('0x3b')];_0x2d44e1+=0x1){let _0x47ea7f=_0x532fa8[_0x6e59('0x6d')][_0x2d44e1];var _0x2e33be=_0x16f95c[_0x6e59('0x77')]();_0x2e33be[_0x6e59('0x40')](_0x6e59('0x78'),_0x47ea7f['id']);_0x301112['push'](db[_0x6e59('0x6e')][_0x6e59('0x37')](_0x2e33be[_0x6e59('0x79')](),{'type':db[_0x6e59('0x6e')]['QueryTypes'][_0x6e59('0x7a')]})['then'](function(_0x32878c){if(_0x32878c[_0x6e59('0x3b')]===0x1){return _0x47ea7f['id'];}else{var _0x16b645=_[_0x6e59('0x7b')](_[_0x6e59('0x35')](_0x32878c,_0x6e59('0x7c')),function(_0x4ce5b5){return _[_0x6e59('0x7d')](_0x4bd953,_0x4ce5b5);});if(_0x16b645){return _0x47ea7f['id'];}}}));}}return BPromise[_0x6e59('0x7e')](_0x301112)['then'](function(_0x2e2efe){_0x1d7b5b=_(_0x1d7b5b)[_0x6e59('0x7f')](_0x2e2efe)[_0x6e59('0x80')]()[_0x6e59('0x81')]();return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x43610d['params']['id']}})[_0x6e59('0x28')](function(_0x25e2ed){return db[_0x6e59('0x6e')]['transaction'](function(_0x4fd32e){return _0x25e2ed[_0x6e59('0x72')](_0x43610d[_0x6e59('0x37')][_0x6e59('0x82')],{'transaction':_0x4fd32e})[_0x6e59('0x28')](function(){if(!_['isEmpty'](_0x1d7b5b)){return _0x25e2ed[_0x6e59('0x83')](_0x1d7b5b,{'transaction':_0x4fd32e});}})[_0x6e59('0x28')](function(){_0x1d7b5b[_0x6e59('0x84')](function(_0x148b91){socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':_0x148b91,'SmsQueueId':_0x25e2ed['id']});});});});});});})['then'](respondWithStatusCode(_0x51d5af,null))[_0x6e59('0x48')](handleError(_0x51d5af,null));};exports[_0x6e59('0x87')]=function(_0x207b11,_0x31e59d,_0x5c4f68){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x207b11[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x31e59d,null))['then'](function(_0x4e95cd){if(_0x4e95cd){return _0x4e95cd[_0x6e59('0x87')](_0x207b11[_0x6e59('0x56')][_0x6e59('0x82')],_[_0x6e59('0x88')](_0x207b11['body'],['ids','id'])||{})[_0x6e59('0x89')](function(_0x5b1539){for(var _0x4a2484=0x0;_0x4a2484<_0x207b11[_0x6e59('0x56')]['ids'][_0x6e59('0x3b')];_0x4a2484+=0x1){socket[_0x6e59('0x85')](_0x6e59('0x71'),{'UserId':Number(_0x207b11[_0x6e59('0x56')][_0x6e59('0x82')][_0x4a2484]),'SmsQueueId':Number(_0x207b11[_0x6e59('0x4a')]['id'])});}return _0x5b1539;});}})[_0x6e59('0x28')](respondWithResult(_0x31e59d,null))[_0x6e59('0x48')](handleError(_0x31e59d,null));};exports[_0x6e59('0x83')]=function(_0x56da71,_0x4be0fa,_0x482f64){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x56da71[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x4be0fa,null))['then'](function(_0x38ba59){if(_0x38ba59){return _0x38ba59[_0x6e59('0x83')](_0x56da71[_0x6e59('0x37')]['ids'])[_0x6e59('0x28')](function(){if(_[_0x6e59('0x8a')](_0x56da71['query']['ids'])){for(var _0xd50fbd=0x0;_0xd50fbd<_0x56da71[_0x6e59('0x37')]['ids'][_0x6e59('0x3b')];_0xd50fbd+=0x1){socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':Number(_0x56da71['query'][_0x6e59('0x82')][_0xd50fbd]),'SmsQueueId':Number(_0x56da71[_0x6e59('0x4a')]['id'])});}}else{socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':Number(_0x56da71[_0x6e59('0x37')][_0x6e59('0x82')]),'SmsQueueId':Number(_0x56da71[_0x6e59('0x4a')]['id'])});}});}})[_0x6e59('0x28')](respondWithStatusCode(_0x4be0fa,null))[_0x6e59('0x48')](handleError(_0x4be0fa,null));};exports[_0x6e59('0x8b')]=function(_0x350440,_0x433f54,_0x27cd29){var _0x4116a3={};var _0x440934={};var _0x3787db;var _0x1860c6;return db[_0x6e59('0x31')][_0x6e59('0x58')]({'where':{'id':_0x350440[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x433f54,null))[_0x6e59('0x28')](function(_0x50ff14){if(_0x50ff14){_0x3787db=_0x50ff14;_0x440934[_0x6e59('0x34')]=_[_0x6e59('0x36')](db['User'][_0x6e59('0x32')]);_0x440934[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x350440[_0x6e59('0x37')]);_0x440934['filters']=_['intersection'](_0x440934[_0x6e59('0x34')],_0x440934[_0x6e59('0x37')]);_0x4116a3['attributes']=_[_0x6e59('0x38')](_0x440934[_0x6e59('0x34')],qs['fields'](_0x350440['query'][_0x6e59('0x39')]));_0x4116a3[_0x6e59('0x3a')]=_0x4116a3[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x4116a3[_0x6e59('0x3a')]:_0x440934[_0x6e59('0x34')];_0x4116a3[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x350440['query']['sort']);_0x4116a3[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x350440[_0x6e59('0x37')],_0x440934['filters']));if(_0x350440['query']['filter']){_0x4116a3[_0x6e59('0x40')]=_[_0x6e59('0x43')](_0x4116a3[_0x6e59('0x40')],{'$or':_['map'](_0x4116a3[_0x6e59('0x3a')],function(_0x47f3e4){var _0x4a246d={};_0x4a246d[_0x47f3e4]={'$like':'%'+_0x350440[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x4a246d;})});}_0x4116a3=_[_0x6e59('0x43')]({},_0x4116a3,_0x350440['options']);return _0x3787db[_0x6e59('0x8b')](_0x4116a3);}})[_0x6e59('0x28')](function(_0x1c4392){if(_0x1c4392){_0x1860c6=_0x1c4392[_0x6e59('0x3b')];if(!_0x350440[_0x6e59('0x37')]['hasOwnProperty'](_0x6e59('0x3d'))){_0x4116a3[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x350440['query'][_0x6e59('0x1f')]);_0x4116a3[_0x6e59('0x1e')]=qs['offset'](_0x350440['query']['offset']);}return _0x3787db[_0x6e59('0x8b')](_0x4116a3);}})['then'](function(_0x320de7){if(_0x320de7){return _0x320de7?{'count':_0x1860c6,'rows':_0x320de7}:null;}})['then'](respondWithResult(_0x433f54,null))['catch'](handleError(_0x433f54,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f33400f..0dd7e26 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 _0x1433=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1433,0xaf));var _0x3143=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1433[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x3143('0x0'));var SmsQueue=require(_0x3143('0x1'))['db'][_0x3143('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3143('0x3')](0x0);var events={'afterCreate':_0x3143('0x4'),'afterUpdate':'update','afterDestroy':_0x3143('0x5')};function emitEvent(_0x527fc8){return function(_0xa417a1,_0x3b6c75,_0x170870){SmsQueueEvents[_0x3143('0x6')](_0x527fc8+':'+_0xa417a1['id'],_0xa417a1);SmsQueueEvents['emit'](_0x527fc8,_0xa417a1);_0x170870(null);};}for(var e in events){if(events[_0x3143('0x7')](e)){var event=events[e];SmsQueue[_0x3143('0x8')](e,emitEvent(event));}}module[_0x3143('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xafd3=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3f99e1,_0x43cbc3){var _0x5d299f=function(_0x14f910){while(--_0x14f910){_0x3f99e1['push'](_0x3f99e1['shift']());}};_0x5d299f(++_0x43cbc3);}(_0xafd3,0x95));var _0x3afd=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xafd3[_0x5beda8];return _0x2aa042;};'use strict';var EventEmitter=require(_0x3afd('0x0'));var SmsQueue=require(_0x3afd('0x1'))['db'][_0x3afd('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3afd('0x3')](0x0);var events={'afterCreate':_0x3afd('0x4'),'afterUpdate':_0x3afd('0x5'),'afterDestroy':_0x3afd('0x6')};function emitEvent(_0x4c2b83){return function(_0x3e72ba,_0x2cf230,_0x477408){SmsQueueEvents[_0x3afd('0x7')](_0x4c2b83+':'+_0x3e72ba['id'],_0x3e72ba);SmsQueueEvents[_0x3afd('0x7')](_0x4c2b83,_0x3e72ba);_0x477408(null);};}for(var e in events){if(events[_0x3afd('0x8')](e)){var event=events[e];SmsQueue[_0x3afd('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 20b66e3..07f1a58 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 _0xfee9=['sms_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xfee9,0x90));var _0x9fee=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfee9[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x9fee('0x0'));var util=require(_0x9fee('0x1'));var logger=require('../../config/logger')(_0x9fee('0x2'));var moment=require('moment');var BPromise=require(_0x9fee('0x3'));var rp=require(_0x9fee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fee('0x5'));var config=require(_0x9fee('0x6'));var attributes=require(_0x9fee('0x7'));module[_0x9fee('0x8')]=function(_0x5c66ad,_0x3d6590){return _0x5c66ad[_0x9fee('0x9')]('SmsQueue',attributes,{'tableName':_0x9fee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcbc=['util','bluebird','rimraf','./smsQueue.attributes','define','SmsQueue','sms_queues'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbcbc,0xa1));var _0xcbcb=function(_0x2340e4,_0x36c3aa){_0x2340e4=_0x2340e4-0x0;var _0x4070b5=_0xbcbc[_0x2340e4];return _0x4070b5;};'use strict';var _=require('lodash');var util=require(_0xcbcb('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcbcb('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcbcb('0x2'));var config=require('../../config/environment');var attributes=require(_0xcbcb('0x3'));module['exports']=function(_0x453a57,_0x4ddc0d){return _0x453a57[_0xcbcb('0x4')](_0xcbcb('0x5'),attributes,{'tableName':_0xcbcb('0x6'),'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 910ed08..18ab854 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 _0x227a=['./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter'];(function(_0x412274,_0x4f9a69){var _0x55353e=function(_0x3fc8b2){while(--_0x3fc8b2){_0x412274['push'](_0x412274['shift']());}};_0x55353e(++_0x4f9a69);}(_0x227a,0x96));var _0xa227=function(_0x2a5fdc,_0x1119cf){_0x2a5fdc=_0x2a5fdc-0x0;var _0x83d8de=_0x227a[_0x2a5fdc];return _0x83d8de;};'use strict';var _=require(_0xa227('0x0'));var util=require(_0xa227('0x1'));var moment=require(_0xa227('0x2'));var BPromise=require(_0xa227('0x3'));var rs=require(_0xa227('0x4'));var fs=require('fs');var Redis=require(_0xa227('0x5'));var db=require(_0xa227('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa227('0x7'))(_0xa227('0x8'));var config=require('../../config/environment');var jayson=require(_0xa227('0x9'));var client=jayson['client'][_0xa227('0xa')]({'port':0x232a});config['redis']=_[_0xa227('0xb')](config[_0xa227('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa227('0xd'))(new Redis(config['redis']));require(_0xa227('0xe'))[_0xa227('0xf')](socket);function respondWithRpcPromise(_0x5d853d,_0x5bb469,_0x30f403){return new BPromise(function(_0x37559f,_0xbcf4f2){return client[_0xa227('0x10')](_0x5d853d,_0x30f403)[_0xa227('0x11')](function(_0x929f20){logger[_0xa227('0x12')](_0xa227('0x13'),_0x5bb469,_0xa227('0x14'));logger[_0xa227('0x15')](_0xa227('0x16'),_0x5bb469,_0xa227('0x14'),JSON[_0xa227('0x17')](_0x929f20));if(_0x929f20['error']){if(_0x929f20[_0xa227('0x18')][_0xa227('0x19')]===0x1f4){logger[_0xa227('0x18')]('SmsQueue,\x20%s,\x20%s',_0x5bb469,_0x929f20[_0xa227('0x18')][_0xa227('0x1a')]);return _0xbcf4f2(_0x929f20[_0xa227('0x18')][_0xa227('0x1a')]);}logger[_0xa227('0x18')](_0xa227('0x13'),_0x5bb469,_0x929f20[_0xa227('0x18')][_0xa227('0x1a')]);return _0x37559f(_0x929f20['error'][_0xa227('0x1a')]);}else{logger[_0xa227('0x12')](_0xa227('0x13'),_0x5bb469,_0xa227('0x14'));_0x37559f(_0x929f20['result'][_0xa227('0x1a')]);}})[_0xa227('0x1b')](function(_0x40773b){logger[_0xa227('0x18')](_0xa227('0x13'),_0x5bb469,_0x40773b);_0xbcf4f2(_0x40773b);});});}exports[_0xa227('0x1c')]=function(_0x2a2258){var _0x31dbd3=this;return new Promise(function(_0x4561f7,_0x2350db){return db[_0xa227('0x1d')][_0xa227('0x1e')]({'raw':_0x2a2258['options']?_0x2a2258[_0xa227('0x1f')][_0xa227('0x20')]===undefined?!![]:![]:!![],'where':_0x2a2258[_0xa227('0x1f')]?_0x2a2258['options'][_0xa227('0x21')]||null:null,'attributes':_0x2a2258[_0xa227('0x1f')]?_0x2a2258[_0xa227('0x1f')][_0xa227('0x22')]||null:null,'limit':_0x2a2258[_0xa227('0x1f')]?_0x2a2258[_0xa227('0x1f')][_0xa227('0x23')]||null:null,'include':_0x2a2258[_0xa227('0x1f')]?_0x2a2258[_0xa227('0x1f')][_0xa227('0x24')]?_['map'](_0x2a2258[_0xa227('0x1f')][_0xa227('0x24')],function(_0x10f7c5){return{'model':db[_0x10f7c5[_0xa227('0x25')]],'as':_0x10f7c5['as'],'attributes':_0x10f7c5[_0xa227('0x22')],'include':_0x10f7c5[_0xa227('0x24')]?_[_0xa227('0x26')](_0x10f7c5[_0xa227('0x24')],function(_0xff96ef){return{'model':db[_0xff96ef[_0xa227('0x25')]],'as':_0xff96ef['as'],'attributes':_0xff96ef['attributes'],'include':_0xff96ef[_0xa227('0x24')]?_[_0xa227('0x26')](_0xff96ef[_0xa227('0x24')],function(_0x387e0e){return{'model':db[_0x387e0e[_0xa227('0x25')]],'as':_0x387e0e['as'],'attributes':_0x387e0e[_0xa227('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa227('0x11')](function(_0x34f22e){logger[_0xa227('0x12')](_0xa227('0x1c'),_0x2a2258);logger[_0xa227('0x15')](_0xa227('0x1c'),_0x2a2258,JSON[_0xa227('0x17')](_0x34f22e));_0x4561f7(_0x34f22e);})[_0xa227('0x1b')](function(_0x3b4f4f){logger[_0xa227('0x18')](_0xa227('0x1c'),_0x3b4f4f[_0xa227('0x1a')],_0x2a2258);_0x2350db(_0x31dbd3[_0xa227('0x18')](0x1f4,_0x3b4f4f[_0xa227('0x1a')]));});});};exports[_0xa227('0x27')]=function(_0x80ad82){var _0x2ba0ca=this;return new Promise(function(_0x5771b8,_0x3f692a){return db[_0xa227('0x1d')][_0xa227('0x28')]({'raw':_0x80ad82[_0xa227('0x1f')]?_0x80ad82['options'][_0xa227('0x20')]===undefined?!![]:![]:!![],'where':_0x80ad82[_0xa227('0x1f')]?_0x80ad82[_0xa227('0x1f')]['where']||null:null,'attributes':_0x80ad82[_0xa227('0x1f')]?_0x80ad82[_0xa227('0x1f')][_0xa227('0x22')]||null:null,'include':_0x80ad82['options']?_0x80ad82[_0xa227('0x1f')][_0xa227('0x24')]?_[_0xa227('0x26')](_0x80ad82[_0xa227('0x1f')][_0xa227('0x24')],function(_0x23f774){return{'model':db[_0x23f774[_0xa227('0x25')]],'as':_0x23f774['as'],'attributes':_0x23f774[_0xa227('0x22')],'include':_0x23f774[_0xa227('0x24')]?_['map'](_0x23f774[_0xa227('0x24')],function(_0x1957d9){return{'model':db[_0x1957d9[_0xa227('0x25')]],'as':_0x1957d9['as'],'attributes':_0x1957d9[_0xa227('0x22')],'include':_0x1957d9[_0xa227('0x24')]?_[_0xa227('0x26')](_0x1957d9[_0xa227('0x24')],function(_0x4dc125){return{'model':db[_0x4dc125[_0xa227('0x25')]],'as':_0x4dc125['as'],'attributes':_0x4dc125[_0xa227('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x114af4){logger['info']('ShowSmsQueue',_0x80ad82);logger['debug']('ShowSmsQueue',_0x80ad82,JSON[_0xa227('0x17')](_0x114af4));_0x5771b8(_0x114af4);})[_0xa227('0x1b')](function(_0xf43322){logger[_0xa227('0x18')](_0xa227('0x27'),_0xf43322[_0xa227('0x1a')],_0x80ad82);_0x3f692a(_0x2ba0ca['error'](0x1f4,_0xf43322[_0xa227('0x1a')]));});});}; \ No newline at end of file +var _0xe53f=['message','info','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x390b5f,_0x4b8174){var _0x1c0901=function(_0x3d6e9f){while(--_0x3d6e9f){_0x390b5f['push'](_0x390b5f['shift']());}};_0x1c0901(++_0x4b8174);}(_0xe53f,0x1cd));var _0xfe53=function(_0x3e5e70,_0x14eb27){_0x3e5e70=_0x3e5e70-0x0;var _0x2e61b3=_0xe53f[_0x3e5e70];return _0x2e61b3;};'use strict';var _=require(_0xfe53('0x0'));var util=require(_0xfe53('0x1'));var moment=require('moment');var BPromise=require(_0xfe53('0x2'));var rs=require(_0xfe53('0x3'));var fs=require('fs');var Redis=require(_0xfe53('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe53('0x5'));var config=require('../../config/environment');var jayson=require(_0xfe53('0x6'));var client=jayson[_0xfe53('0x7')]['http']({'port':0x232a});config[_0xfe53('0x8')]=_[_0xfe53('0x9')](config[_0xfe53('0x8')],{'host':_0xfe53('0xa'),'port':0x18eb});var socket=require(_0xfe53('0xb'))(new Redis(config[_0xfe53('0x8')]));require('./smsQueue.socket')[_0xfe53('0xc')](socket);function respondWithRpcPromise(_0xcb6040,_0x1f7b25,_0x168d53){return new BPromise(function(_0x37cc7c,_0xd29716){return client['request'](_0xcb6040,_0x168d53)[_0xfe53('0xd')](function(_0x3c065d){logger['info'](_0xfe53('0xe'),_0x1f7b25,_0xfe53('0xf'));logger[_0xfe53('0x10')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1f7b25,_0xfe53('0xf'),JSON[_0xfe53('0x11')](_0x3c065d));if(_0x3c065d[_0xfe53('0x12')]){if(_0x3c065d['error'][_0xfe53('0x13')]===0x1f4){logger['error'](_0xfe53('0xe'),_0x1f7b25,_0x3c065d[_0xfe53('0x12')]['message']);return _0xd29716(_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);}logger[_0xfe53('0x12')](_0xfe53('0xe'),_0x1f7b25,_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);return _0x37cc7c(_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);}else{logger[_0xfe53('0x15')](_0xfe53('0xe'),_0x1f7b25,'request\x20sent');_0x37cc7c(_0x3c065d[_0xfe53('0x16')][_0xfe53('0x14')]);}})[_0xfe53('0x17')](function(_0x53c149){logger[_0xfe53('0x12')](_0xfe53('0xe'),_0x1f7b25,_0x53c149);_0xd29716(_0x53c149);});});}exports['GetSmsQueue']=function(_0x13573d){var _0x2d478e=this;return new Promise(function(_0x53af0d,_0x3723e7){return db['SmsQueue'][_0xfe53('0x18')]({'raw':_0x13573d['options']?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1a')]===undefined?!![]:![]:!![],'where':_0x13573d[_0xfe53('0x19')]?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1b')]||null:null,'attributes':_0x13573d['options']?_0x13573d['options'][_0xfe53('0x1c')]||null:null,'limit':_0x13573d['options']?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1d')]||null:null,'include':_0x13573d[_0xfe53('0x19')]?_0x13573d[_0xfe53('0x19')]['include']?_[_0xfe53('0x1e')](_0x13573d[_0xfe53('0x19')][_0xfe53('0x1f')],function(_0x3ef24c){return{'model':db[_0x3ef24c[_0xfe53('0x20')]],'as':_0x3ef24c['as'],'attributes':_0x3ef24c[_0xfe53('0x1c')],'include':_0x3ef24c[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x3ef24c['include'],function(_0x148530){return{'model':db[_0x148530['model']],'as':_0x148530['as'],'attributes':_0x148530['attributes'],'include':_0x148530[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x148530['include'],function(_0xc9457a){return{'model':db[_0xc9457a[_0xfe53('0x20')]],'as':_0xc9457a['as'],'attributes':_0xc9457a[_0xfe53('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe53('0xd')](function(_0x1b5045){logger[_0xfe53('0x15')](_0xfe53('0x21'),_0x13573d);logger[_0xfe53('0x10')](_0xfe53('0x21'),_0x13573d,JSON['stringify'](_0x1b5045));_0x53af0d(_0x1b5045);})[_0xfe53('0x17')](function(_0x52d4c2){logger['error'](_0xfe53('0x21'),_0x52d4c2[_0xfe53('0x14')],_0x13573d);_0x3723e7(_0x2d478e[_0xfe53('0x12')](0x1f4,_0x52d4c2[_0xfe53('0x14')]));});});};exports[_0xfe53('0x22')]=function(_0x5c72e3){var _0x5c607e=this;return new Promise(function(_0x53d973,_0x3fad55){return db[_0xfe53('0x23')][_0xfe53('0x24')]({'raw':_0x5c72e3[_0xfe53('0x19')]?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c72e3['options']?_0x5c72e3['options'][_0xfe53('0x1b')]||null:null,'attributes':_0x5c72e3[_0xfe53('0x19')]?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1c')]||null:null,'include':_0x5c72e3['options']?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x5c72e3[_0xfe53('0x19')]['include'],function(_0x4c935a){return{'model':db[_0x4c935a[_0xfe53('0x20')]],'as':_0x4c935a['as'],'attributes':_0x4c935a['attributes'],'include':_0x4c935a[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x4c935a['include'],function(_0x5cab78){return{'model':db[_0x5cab78['model']],'as':_0x5cab78['as'],'attributes':_0x5cab78[_0xfe53('0x1c')],'include':_0x5cab78['include']?_[_0xfe53('0x1e')](_0x5cab78[_0xfe53('0x1f')],function(_0x27492a){return{'model':db[_0x27492a[_0xfe53('0x20')]],'as':_0x27492a['as'],'attributes':_0x27492a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe53('0xd')](function(_0x137e8c){logger['info'](_0xfe53('0x22'),_0x5c72e3);logger['debug']('ShowSmsQueue',_0x5c72e3,JSON[_0xfe53('0x11')](_0x137e8c));_0x53d973(_0x137e8c);})['catch'](function(_0x225b46){logger[_0xfe53('0x12')](_0xfe53('0x22'),_0x225b46[_0xfe53('0x14')],_0x5c72e3);_0x3fad55(_0x5c607e[_0xfe53('0x12')](0x1f4,_0x225b46[_0xfe53('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5a4e686..bf48566 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 _0x9d96=['remove','update','emit','removeListener','register','smsQueue:','./smsQueue.events','save'];(function(_0x2e6c01,_0x2072a8){var _0x5e7a75=function(_0x28a48e){while(--_0x28a48e){_0x2e6c01['push'](_0x2e6c01['shift']());}};_0x5e7a75(++_0x2072a8);}(_0x9d96,0x17e));var _0x69d9=function(_0x140187,_0x4c735e){_0x140187=_0x140187-0x0;var _0x2b395c=_0x9d96[_0x140187];return _0x2b395c;};'use strict';var SmsQueueEvents=require(_0x69d9('0x0'));var events=[_0x69d9('0x1'),_0x69d9('0x2'),_0x69d9('0x3')];function createListener(_0x1172e2,_0x2c878b){return function(_0x5f0040){_0x2c878b[_0x69d9('0x4')](_0x1172e2,_0x5f0040);};}function removeListener(_0x123e2c,_0x45d9d8){return function(){SmsQueueEvents[_0x69d9('0x5')](_0x123e2c,_0x45d9d8);};}exports[_0x69d9('0x6')]=function(_0x2ce06d){for(var _0x316cc9=0x0,_0x527610=events['length'];_0x316cc9<_0x527610;_0x316cc9++){var _0x4af6b4=events[_0x316cc9];var _0x20fa4c=createListener(_0x69d9('0x7')+_0x4af6b4,_0x2ce06d);SmsQueueEvents['on'](_0x4af6b4,_0x20fa4c);}}; \ No newline at end of file +var _0x4b16=['emit','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x253b0a,_0x1990ca){var _0x3948f7=function(_0x2292af){while(--_0x2292af){_0x253b0a['push'](_0x253b0a['shift']());}};_0x3948f7(++_0x1990ca);}(_0x4b16,0x1f4));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require(_0x64b1('0x0'));var events=[_0x64b1('0x1'),_0x64b1('0x2'),_0x64b1('0x3')];function createListener(_0x436fe2,_0xa494ab){return function(_0x4b27c6){_0xa494ab[_0x64b1('0x4')](_0x436fe2,_0x4b27c6);};}function removeListener(_0x969def,_0xddc6b5){return function(){SmsQueueEvents['removeListener'](_0x969def,_0xddc6b5);};}exports[_0x64b1('0x5')]=function(_0x56c138){for(var _0x5c5704=0x0,_0x130341=events[_0x64b1('0x6')];_0x5c5704<_0x130341;_0x5c5704++){var _0x349691=events[_0x5c5704];var _0x471e07=createListener(_0x64b1('0x7')+_0x349691,_0x56c138);SmsQueueEvents['on'](_0x349691,_0x471e07);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 629602b..1605a90 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 _0x91f6=['post','create','put','/:id','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x12fb36,_0x2285e9){var _0x37952d=function(_0xb5fe2d){while(--_0xb5fe2d){_0x12fb36['push'](_0x12fb36['shift']());}};_0x37952d(++_0x2285e9);}(_0x91f6,0x7c));var _0x691f=function(_0x1b4b0a,_0x1083d5){_0x1b4b0a=_0x1b4b0a-0x0;var _0x2e6f15=_0x91f6[_0x1b4b0a];return _0x2e6f15;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x691f('0x0'));var timeout=require('connect-timeout');var express=require(_0x691f('0x1'));var router=express['Router']();var fs_extra=require(_0x691f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x691f('0x3'));var config=require(_0x691f('0x4'));var controller=require(_0x691f('0x5'));router[_0x691f('0x6')]('/',auth['isAuthenticated'](),controller[_0x691f('0x7')]);router['get'](_0x691f('0x8'),auth[_0x691f('0x9')](),controller[_0x691f('0xa')]);router[_0x691f('0x6')]('/:id',auth[_0x691f('0x9')](),controller[_0x691f('0xb')]);router[_0x691f('0xc')]('/',auth[_0x691f('0x9')](),controller[_0x691f('0xd')]);router[_0x691f('0xe')](_0x691f('0xf'),auth[_0x691f('0x9')](),controller['update']);router['delete']('/:id',auth[_0x691f('0x9')](),controller['destroy']);module[_0x691f('0x10')]=router; \ No newline at end of file +var _0xa267=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','describe','/:id','post','isAuthenticated'];(function(_0x5b118a,_0x43938b){var _0x535740=function(_0x229b8c){while(--_0x229b8c){_0x5b118a['push'](_0x5b118a['shift']());}};_0x535740(++_0x43938b);}(_0xa267,0xcb));var _0x7a26=function(_0x5544f6,_0x33a3e8){_0x5544f6=_0x5544f6-0x0;var _0x526f8c=_0xa267[_0x5544f6];return _0x526f8c;};'use strict';var multer=require(_0x7a26('0x0'));var util=require(_0x7a26('0x1'));var path=require(_0x7a26('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a26('0x3'));var router=express[_0x7a26('0x4')]();var fs_extra=require(_0x7a26('0x5'));var auth=require(_0x7a26('0x6'));var interaction=require(_0x7a26('0x7'));var config=require(_0x7a26('0x8'));var controller=require(_0x7a26('0x9'));router[_0x7a26('0xa')]('/',auth['isAuthenticated'](),controller[_0x7a26('0xb')]);router[_0x7a26('0xa')](_0x7a26('0xc'),auth['isAuthenticated'](),controller[_0x7a26('0xd')]);router[_0x7a26('0xa')](_0x7a26('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x7a26('0xf')]('/',auth[_0x7a26('0x10')](),controller[_0x7a26('0x11')]);router[_0x7a26('0x12')](_0x7a26('0xe'),auth[_0x7a26('0x10')](),controller[_0x7a26('0x13')]);router[_0x7a26('0x14')]('/:id',auth[_0x7a26('0x10')](),controller['destroy']);module[_0x7a26('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0667270..93eb28c 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 _0xdc00=['moment','sequelize','STRING','DATE'];(function(_0x312fb6,_0x49b5aa){var _0x5536f1=function(_0x3e2848){while(--_0x3e2848){_0x312fb6['push'](_0x312fb6['shift']());}};_0x5536f1(++_0x49b5aa);}(_0xdc00,0x120));var _0x0dc0=function(_0x19694a,_0x20374e){_0x19694a=_0x19694a-0x0;var _0x120927=_0xdc00[_0x19694a];return _0x120927;};'use strict';var moment=require(_0x0dc0('0x0'));var Sequelize=require(_0x0dc0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0dc0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0dc0('0x3')]},'leaveAt':{'type':Sequelize[_0x0dc0('0x3')]},'acceptAt':{'type':Sequelize[_0x0dc0('0x3')]},'exitAt':{'type':Sequelize[_0x0dc0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c42=['exports','STRING','DATE','moment','sequelize'];(function(_0x31236c,_0x34f702){var _0x12eb2f=function(_0x6bb9a){while(--_0x6bb9a){_0x31236c['push'](_0x31236c['shift']());}};_0x12eb2f(++_0x34f702);}(_0x6c42,0x189));var _0x26c4=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6c42[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0x26c4('0x0'));var Sequelize=require(_0x26c4('0x1'));module[_0x26c4('0x2')]={'uniqueid':{'type':Sequelize[_0x26c4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x26c4('0x3')]},'joinAt':{'type':Sequelize[_0x26c4('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x26c4('0x4')]},'exitAt':{'type':Sequelize[_0x26c4('0x4')]},'reason':{'type':Sequelize[_0x26c4('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 8b72ace..1e5f87f 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 _0xc248=['ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','reject','save','update','then','end','error','stack','name','send','index','map','SmsQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x183906,_0x223210){var _0x106f18=function(_0x5630a5){while(--_0x5630a5){_0x183906['push'](_0x183906['shift']());}};_0x106f18(++_0x223210);}(_0xc248,0x1a6));var _0x8c24=function(_0x517cfd,_0xbf678e){_0x517cfd=_0x517cfd-0x0;var _0x5e2beb=_0xc248[_0x517cfd];return _0x5e2beb;};'use strict';var emlformat=require(_0x8c24('0x0'));var rimraf=require(_0x8c24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c24('0x2'));var rp=require(_0x8c24('0x3'));var moment=require(_0x8c24('0x4'));var BPromise=require(_0x8c24('0x5'));var Mustache=require(_0x8c24('0x6'));var util=require('util');var path=require(_0x8c24('0x7'));var sox=require(_0x8c24('0x8'));var csv=require(_0x8c24('0x9'));var ejs=require(_0x8c24('0xa'));var fs=require('fs');var fs_extra=require(_0x8c24('0xb'));var _=require('lodash');var squel=require(_0x8c24('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c24('0xd'));var deskjs=require(_0x8c24('0xe'));var toCsv=require(_0x8c24('0x9'));var querystring=require('querystring');var Papa=require(_0x8c24('0xf'));var Redis=require(_0x8c24('0x10'));var authService=require(_0x8c24('0x11'));var qs=require(_0x8c24('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c24('0x13'))('api');var utils=require(_0x8c24('0x14'));var config=require(_0x8c24('0x15'));var licenseUtil=require(_0x8c24('0x16'));var db=require(_0x8c24('0x17'))['db'];function respondWithStatusCode(_0x369ee3,_0x447e15){_0x447e15=_0x447e15||0xcc;return function(_0xf69e0d){if(_0xf69e0d){return _0x369ee3[_0x8c24('0x18')](_0x447e15);}return _0x369ee3[_0x8c24('0x19')](_0x447e15)['end']();};}function respondWithResult(_0x5d296c,_0x36da30){_0x36da30=_0x36da30||0xc8;return function(_0x14cc4f){if(_0x14cc4f){return _0x5d296c[_0x8c24('0x19')](_0x36da30)['json'](_0x14cc4f);}};}function respondWithFilteredResult(_0x3e8a6b,_0x5b9c86){return function(_0x5c3620){if(_0x5c3620){var _0x41ed5e=typeof _0x5b9c86[_0x8c24('0x1a')]===_0x8c24('0x1b')&&typeof _0x5b9c86[_0x8c24('0x1c')]===_0x8c24('0x1b');var _0x3d20e6=_0x5c3620[_0x8c24('0x1d')];var _0x374ba7=_0x41ed5e?0x0:_0x5b9c86[_0x8c24('0x1a')];var _0x1921ec=_0x41ed5e?_0x5c3620[_0x8c24('0x1d')]:_0x5b9c86['offset']+_0x5b9c86['limit'];var _0x1b8e19;if(_0x1921ec>=_0x3d20e6){_0x1921ec=_0x3d20e6;_0x1b8e19=0xc8;}else{_0x1b8e19=0xce;}_0x3e8a6b[_0x8c24('0x19')](_0x1b8e19);return _0x3e8a6b[_0x8c24('0x1e')]('Content-Range',_0x374ba7+'-'+_0x1921ec+'/'+_0x3d20e6)['json'](_0x5c3620);}return null;};}function patchUpdates(_0x42225c){return function(_0xbc652){try{jsonpatch['apply'](_0xbc652,_0x42225c,!![]);}catch(_0x124e98){return BPromise[_0x8c24('0x1f')](_0x124e98);}return _0xbc652[_0x8c24('0x20')]();};}function saveUpdates(_0x487599,_0x83ba16){return function(_0xd672b){if(_0xd672b){return _0xd672b[_0x8c24('0x21')](_0x487599)['then'](function(_0x568e87){return _0x568e87;});}return null;};}function removeEntity(_0x36a117,_0x181dd7){return function(_0x5d9fa9){if(_0x5d9fa9){return _0x5d9fa9['destroy']()[_0x8c24('0x22')](function(){_0x36a117[_0x8c24('0x19')](0xcc)[_0x8c24('0x23')]();});}};}function handleEntityNotFound(_0x381d50,_0xfc08d7){return function(_0x2c6847){if(!_0x2c6847){_0x381d50[_0x8c24('0x18')](0x194);}return _0x2c6847;};}function handleError(_0x513a1b,_0x193b93){_0x193b93=_0x193b93||0x1f4;return function(_0x4e8d7f){logger[_0x8c24('0x24')](_0x4e8d7f[_0x8c24('0x25')]);if(_0x4e8d7f[_0x8c24('0x26')]){delete _0x4e8d7f[_0x8c24('0x26')];}_0x513a1b[_0x8c24('0x19')](_0x193b93)[_0x8c24('0x27')](_0x4e8d7f);};}exports[_0x8c24('0x28')]=function(_0x31b802,_0x46fe54){var _0x5a329e={},_0x37c85a={},_0x2838ae={'count':0x0,'rows':[]};var _0x5004dd=_[_0x8c24('0x29')](db[_0x8c24('0x2a')]['rawAttributes'],function(_0x4fc80a){return{'name':_0x4fc80a['fieldName'],'type':_0x4fc80a[_0x8c24('0x2b')][_0x8c24('0x2c')]};});_0x37c85a[_0x8c24('0x2d')]=_['map'](_0x5004dd,_0x8c24('0x26'));_0x37c85a[_0x8c24('0x2e')]=_[_0x8c24('0x2f')](_0x31b802[_0x8c24('0x2e')]);_0x37c85a[_0x8c24('0x30')]=_[_0x8c24('0x31')](_0x37c85a[_0x8c24('0x2d')],_0x37c85a[_0x8c24('0x2e')]);_0x5a329e[_0x8c24('0x32')]=_[_0x8c24('0x31')](_0x37c85a[_0x8c24('0x2d')],qs[_0x8c24('0x33')](_0x31b802[_0x8c24('0x2e')]['fields']));_0x5a329e[_0x8c24('0x32')]=_0x5a329e[_0x8c24('0x32')]['length']?_0x5a329e['attributes']:_0x37c85a[_0x8c24('0x2d')];if(!_0x31b802[_0x8c24('0x2e')]['hasOwnProperty']('nolimit')){_0x5a329e[_0x8c24('0x1c')]=qs[_0x8c24('0x1c')](_0x31b802[_0x8c24('0x2e')][_0x8c24('0x1c')]);_0x5a329e['offset']=qs[_0x8c24('0x1a')](_0x31b802[_0x8c24('0x2e')][_0x8c24('0x1a')]);}_0x5a329e[_0x8c24('0x34')]=qs['sort'](_0x31b802['query'][_0x8c24('0x35')]);_0x5a329e['where']=qs['filters'](_[_0x8c24('0x36')](_0x31b802['query'],_0x37c85a[_0x8c24('0x30')]),_0x5004dd);if(_0x31b802['query'][_0x8c24('0x37')]){_0x5a329e[_0x8c24('0x38')]=_[_0x8c24('0x39')](_0x5a329e[_0x8c24('0x38')],{'$or':_[_0x8c24('0x29')](_0x5004dd,function(_0x32ec5c){if(_0x32ec5c[_0x8c24('0x2b')]!==_0x8c24('0x3a')){var _0x3f556d={};_0x3f556d[_0x32ec5c['name']]={'$like':'%'+_0x31b802[_0x8c24('0x2e')][_0x8c24('0x37')]+'%'};return _0x3f556d;}})});}_0x5a329e=_[_0x8c24('0x39')]({},_0x5a329e,_0x31b802[_0x8c24('0x3b')]);var _0x55820d={'where':_0x5a329e[_0x8c24('0x38')]};return db[_0x8c24('0x2a')][_0x8c24('0x1d')](_0x55820d)[_0x8c24('0x22')](function(_0x58eca4){_0x2838ae[_0x8c24('0x1d')]=_0x58eca4;if(_0x31b802[_0x8c24('0x2e')][_0x8c24('0x3c')]){_0x5a329e['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x5a329e);})[_0x8c24('0x22')](function(_0xf74514){_0x2838ae[_0x8c24('0x3d')]=_0xf74514;return _0x2838ae;})[_0x8c24('0x22')](respondWithFilteredResult(_0x46fe54,_0x5a329e))[_0x8c24('0x3e')](handleError(_0x46fe54,null));};exports[_0x8c24('0x3f')]=function(_0x595f9a,_0x103ff2){var _0xc4540f={'raw':!![],'where':{'id':_0x595f9a['params']['id']}},_0x2e9f9c={};_0x2e9f9c[_0x8c24('0x2d')]=_[_0x8c24('0x2f')](db[_0x8c24('0x2a')][_0x8c24('0x40')]);_0x2e9f9c[_0x8c24('0x2e')]=_[_0x8c24('0x2f')](_0x595f9a[_0x8c24('0x2e')]);_0x2e9f9c['filters']=_[_0x8c24('0x31')](_0x2e9f9c[_0x8c24('0x2d')],_0x2e9f9c['query']);_0xc4540f['attributes']=_[_0x8c24('0x31')](_0x2e9f9c[_0x8c24('0x2d')],qs[_0x8c24('0x33')](_0x595f9a[_0x8c24('0x2e')][_0x8c24('0x33')]));_0xc4540f[_0x8c24('0x32')]=_0xc4540f[_0x8c24('0x32')]['length']?_0xc4540f[_0x8c24('0x32')]:_0x2e9f9c[_0x8c24('0x2d')];if(_0x595f9a[_0x8c24('0x2e')][_0x8c24('0x3c')]){_0xc4540f[_0x8c24('0x41')]=[{'all':!![]}];}_0xc4540f=_[_0x8c24('0x39')]({},_0xc4540f,_0x595f9a['options']);return db[_0x8c24('0x2a')][_0x8c24('0x42')](_0xc4540f)[_0x8c24('0x22')](handleEntityNotFound(_0x103ff2,null))['then'](respondWithResult(_0x103ff2,null))[_0x8c24('0x3e')](handleError(_0x103ff2,null));};exports[_0x8c24('0x43')]=function(_0x3b447d,_0x2d772f){return db['SmsQueueReport'][_0x8c24('0x43')](_0x3b447d[_0x8c24('0x44')],{})[_0x8c24('0x22')](respondWithResult(_0x2d772f,0xc9))[_0x8c24('0x3e')](handleError(_0x2d772f,null));};exports[_0x8c24('0x21')]=function(_0x4cae88,_0x4e61ea){if(_0x4cae88[_0x8c24('0x44')]['id']){delete _0x4cae88[_0x8c24('0x44')]['id'];}return db[_0x8c24('0x2a')][_0x8c24('0x42')]({'where':{'id':_0x4cae88[_0x8c24('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e61ea,null))['then'](saveUpdates(_0x4cae88[_0x8c24('0x44')],null))[_0x8c24('0x22')](respondWithResult(_0x4e61ea,null))['catch'](handleError(_0x4e61ea,null));};exports[_0x8c24('0x46')]=function(_0x18a6b3,_0x166d3c){return db[_0x8c24('0x2a')]['find']({'where':{'id':_0x18a6b3['params']['id']}})[_0x8c24('0x22')](handleEntityNotFound(_0x166d3c,null))[_0x8c24('0x22')](removeEntity(_0x166d3c,null))[_0x8c24('0x3e')](handleError(_0x166d3c,null));};exports[_0x8c24('0x47')]=function(_0x18fa3d,_0x4ab4ab){return db[_0x8c24('0x2a')][_0x8c24('0x47')]()[_0x8c24('0x22')](respondWithResult(_0x4ab4ab,null))[_0x8c24('0x3e')](handleError(_0x4ab4ab,null));}; \ No newline at end of file +var _0x9b53=['ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b53,0x8e));var _0x39b5=function(_0x117a14,_0x1a1724){_0x117a14=_0x117a14-0x0;var _0x2c3f5e=_0x9b53[_0x117a14];return _0x2c3f5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39b5('0x0'));var zipdir=require(_0x39b5('0x1'));var jsonpatch=require(_0x39b5('0x2'));var rp=require(_0x39b5('0x3'));var moment=require('moment');var BPromise=require(_0x39b5('0x4'));var Mustache=require(_0x39b5('0x5'));var util=require('util');var path=require(_0x39b5('0x6'));var sox=require(_0x39b5('0x7'));var csv=require('to-csv');var ejs=require(_0x39b5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39b5('0x9'));var squel=require('squel');var crypto=require(_0x39b5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x39b5('0xb'));var toCsv=require(_0x39b5('0xc'));var querystring=require(_0x39b5('0xd'));var Papa=require(_0x39b5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39b5('0xf'));var hardwareService=require(_0x39b5('0x10'));var logger=require(_0x39b5('0x11'))(_0x39b5('0x12'));var utils=require(_0x39b5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x39b5('0x14'));var db=require(_0x39b5('0x15'))['db'];function respondWithStatusCode(_0x27be3d,_0x26ce7f){_0x26ce7f=_0x26ce7f||0xcc;return function(_0xe34abd){if(_0xe34abd){return _0x27be3d[_0x39b5('0x16')](_0x26ce7f);}return _0x27be3d[_0x39b5('0x17')](_0x26ce7f)['end']();};}function respondWithResult(_0x2ab9c6,_0x205fdd){_0x205fdd=_0x205fdd||0xc8;return function(_0x4c8d65){if(_0x4c8d65){return _0x2ab9c6[_0x39b5('0x17')](_0x205fdd)[_0x39b5('0x18')](_0x4c8d65);}};}function respondWithFilteredResult(_0x197abf,_0x3d8991){return function(_0x3f426f){if(_0x3f426f){var _0x21129e=typeof _0x3d8991[_0x39b5('0x19')]===_0x39b5('0x1a')&&typeof _0x3d8991[_0x39b5('0x1b')]===_0x39b5('0x1a');var _0x3cb1c6=_0x3f426f[_0x39b5('0x1c')];var _0x5e09db=_0x21129e?0x0:_0x3d8991[_0x39b5('0x19')];var _0x4822ef=_0x21129e?_0x3f426f[_0x39b5('0x1c')]:_0x3d8991[_0x39b5('0x19')]+_0x3d8991[_0x39b5('0x1b')];var _0x4ac5e1;if(_0x4822ef>=_0x3cb1c6){_0x4822ef=_0x3cb1c6;_0x4ac5e1=0xc8;}else{_0x4ac5e1=0xce;}_0x197abf[_0x39b5('0x17')](_0x4ac5e1);return _0x197abf['set'](_0x39b5('0x1d'),_0x5e09db+'-'+_0x4822ef+'/'+_0x3cb1c6)[_0x39b5('0x18')](_0x3f426f);}return null;};}function patchUpdates(_0x23c23c){return function(_0x3d5430){try{jsonpatch[_0x39b5('0x1e')](_0x3d5430,_0x23c23c,!![]);}catch(_0x25622d){return BPromise[_0x39b5('0x1f')](_0x25622d);}return _0x3d5430[_0x39b5('0x20')]();};}function saveUpdates(_0x54ea42,_0x105091){return function(_0x56bc56){if(_0x56bc56){return _0x56bc56[_0x39b5('0x21')](_0x54ea42)[_0x39b5('0x22')](function(_0x7493f1){return _0x7493f1;});}return null;};}function removeEntity(_0x173b15,_0x2d9dc5){return function(_0x3753d7){if(_0x3753d7){return _0x3753d7['destroy']()[_0x39b5('0x22')](function(){_0x173b15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fa52,_0x2d45a6){return function(_0x2fbbb3){if(!_0x2fbbb3){_0x56fa52['sendStatus'](0x194);}return _0x2fbbb3;};}function handleError(_0x1d3bf2,_0xab2a08){_0xab2a08=_0xab2a08||0x1f4;return function(_0x521e7c){logger[_0x39b5('0x23')](_0x521e7c[_0x39b5('0x24')]);if(_0x521e7c['name']){delete _0x521e7c[_0x39b5('0x25')];}_0x1d3bf2[_0x39b5('0x17')](_0xab2a08)[_0x39b5('0x26')](_0x521e7c);};}exports[_0x39b5('0x27')]=function(_0x31b64e,_0x1b97c1){var _0x9de0c4={},_0x34a9f8={},_0x3d05c1={'count':0x0,'rows':[]};var _0x2c924f=_[_0x39b5('0x28')](db[_0x39b5('0x29')][_0x39b5('0x2a')],function(_0xfbba76){return{'name':_0xfbba76[_0x39b5('0x2b')],'type':_0xfbba76['type'][_0x39b5('0x2c')]};});_0x34a9f8[_0x39b5('0x2d')]=_['map'](_0x2c924f,_0x39b5('0x25'));_0x34a9f8[_0x39b5('0x2e')]=_['keys'](_0x31b64e[_0x39b5('0x2e')]);_0x34a9f8[_0x39b5('0x2f')]=_[_0x39b5('0x30')](_0x34a9f8['model'],_0x34a9f8[_0x39b5('0x2e')]);_0x9de0c4[_0x39b5('0x31')]=_[_0x39b5('0x30')](_0x34a9f8[_0x39b5('0x2d')],qs[_0x39b5('0x32')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x32')]));_0x9de0c4[_0x39b5('0x31')]=_0x9de0c4[_0x39b5('0x31')][_0x39b5('0x33')]?_0x9de0c4['attributes']:_0x34a9f8[_0x39b5('0x2d')];if(!_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x34')](_0x39b5('0x35'))){_0x9de0c4[_0x39b5('0x1b')]=qs[_0x39b5('0x1b')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x1b')]);_0x9de0c4[_0x39b5('0x19')]=qs[_0x39b5('0x19')](_0x31b64e['query'][_0x39b5('0x19')]);}_0x9de0c4[_0x39b5('0x36')]=qs[_0x39b5('0x37')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x37')]);_0x9de0c4[_0x39b5('0x38')]=qs[_0x39b5('0x2f')](_[_0x39b5('0x39')](_0x31b64e[_0x39b5('0x2e')],_0x34a9f8[_0x39b5('0x2f')]),_0x2c924f);if(_0x31b64e['query'][_0x39b5('0x3a')]){_0x9de0c4[_0x39b5('0x38')]=_[_0x39b5('0x3b')](_0x9de0c4[_0x39b5('0x38')],{'$or':_[_0x39b5('0x28')](_0x2c924f,function(_0x4657d7){if(_0x4657d7[_0x39b5('0x3c')]!==_0x39b5('0x3d')){var _0x13b6b7={};_0x13b6b7[_0x4657d7['name']]={'$like':'%'+_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x3a')]+'%'};return _0x13b6b7;}})});}_0x9de0c4=_[_0x39b5('0x3b')]({},_0x9de0c4,_0x31b64e[_0x39b5('0x3e')]);var _0x54261b={'where':_0x9de0c4[_0x39b5('0x38')]};return db[_0x39b5('0x29')][_0x39b5('0x1c')](_0x54261b)[_0x39b5('0x22')](function(_0xd7240){_0x3d05c1[_0x39b5('0x1c')]=_0xd7240;if(_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x3f')]){_0x9de0c4[_0x39b5('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x39b5('0x41')](_0x9de0c4);})[_0x39b5('0x22')](function(_0x8095db){_0x3d05c1['rows']=_0x8095db;return _0x3d05c1;})[_0x39b5('0x22')](respondWithFilteredResult(_0x1b97c1,_0x9de0c4))[_0x39b5('0x42')](handleError(_0x1b97c1,null));};exports[_0x39b5('0x43')]=function(_0x7aadad,_0x1150d1){var _0x156336={'raw':!![],'where':{'id':_0x7aadad['params']['id']}},_0x2d8fa9={};_0x2d8fa9[_0x39b5('0x2d')]=_[_0x39b5('0x44')](db['SmsQueueReport'][_0x39b5('0x2a')]);_0x2d8fa9[_0x39b5('0x2e')]=_[_0x39b5('0x44')](_0x7aadad[_0x39b5('0x2e')]);_0x2d8fa9['filters']=_['intersection'](_0x2d8fa9[_0x39b5('0x2d')],_0x2d8fa9[_0x39b5('0x2e')]);_0x156336[_0x39b5('0x31')]=_[_0x39b5('0x30')](_0x2d8fa9[_0x39b5('0x2d')],qs['fields'](_0x7aadad['query']['fields']));_0x156336['attributes']=_0x156336[_0x39b5('0x31')]['length']?_0x156336['attributes']:_0x2d8fa9[_0x39b5('0x2d')];if(_0x7aadad[_0x39b5('0x2e')][_0x39b5('0x3f')]){_0x156336[_0x39b5('0x40')]=[{'all':!![]}];}_0x156336=_[_0x39b5('0x3b')]({},_0x156336,_0x7aadad[_0x39b5('0x3e')]);return db['SmsQueueReport'][_0x39b5('0x45')](_0x156336)[_0x39b5('0x22')](handleEntityNotFound(_0x1150d1,null))[_0x39b5('0x22')](respondWithResult(_0x1150d1,null))[_0x39b5('0x42')](handleError(_0x1150d1,null));};exports['create']=function(_0x537206,_0x1ead23){return db[_0x39b5('0x29')][_0x39b5('0x46')](_0x537206[_0x39b5('0x47')],{})[_0x39b5('0x22')](respondWithResult(_0x1ead23,0xc9))['catch'](handleError(_0x1ead23,null));};exports['update']=function(_0x56080b,_0xaf931c){if(_0x56080b[_0x39b5('0x47')]['id']){delete _0x56080b[_0x39b5('0x47')]['id'];}return db[_0x39b5('0x29')][_0x39b5('0x45')]({'where':{'id':_0x56080b[_0x39b5('0x48')]['id']}})[_0x39b5('0x22')](handleEntityNotFound(_0xaf931c,null))[_0x39b5('0x22')](saveUpdates(_0x56080b['body'],null))[_0x39b5('0x22')](respondWithResult(_0xaf931c,null))[_0x39b5('0x42')](handleError(_0xaf931c,null));};exports[_0x39b5('0x49')]=function(_0x143511,_0x39a112){return db['SmsQueueReport']['find']({'where':{'id':_0x143511[_0x39b5('0x48')]['id']}})[_0x39b5('0x22')](handleEntityNotFound(_0x39a112,null))[_0x39b5('0x22')](removeEntity(_0x39a112,null))[_0x39b5('0x42')](handleError(_0x39a112,null));};exports[_0x39b5('0x4a')]=function(_0x531c1d,_0x53c124){return db[_0x39b5('0x29')]['describe']()[_0x39b5('0x22')](respondWithResult(_0x53c124,null))[_0x39b5('0x42')](handleError(_0x53c124,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b77c39c..c7972fe 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(_0x12b670,_0x26e8f9){var _0x5d4d7b=function(_0x573b5c){while(--_0x573b5c){_0x12b670['push'](_0x12b670['shift']());}};_0x5d4d7b(++_0x26e8f9);}(_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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x2b5773,_0x2d7385){var _0x2bb36d=function(_0x2aefcd){while(--_0x2aefcd){_0x2b5773['push'](_0x2b5773['shift']());}};_0x2bb36d(++_0x2d7385);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 2a541b5..8703bf1 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 _0x11cf=['then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','update','where','attributes','limit','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x331161,_0x309438){var _0x1cb001=function(_0x34abd5){while(--_0x34abd5){_0x331161['push'](_0x331161['shift']());}};_0x1cb001(++_0x309438);}(_0x11cf,0x106));var _0xf11c=function(_0x12cc4a,_0x48352f){_0x12cc4a=_0x12cc4a-0x0;var _0x25b563=_0x11cf[_0x12cc4a];return _0x25b563;};'use strict';var _=require(_0xf11c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf11c('0x1'));var db=require(_0xf11c('0x2'))['db'];var utils=require(_0xf11c('0x3'));var logger=require(_0xf11c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf11c('0x5'));var client=jayson[_0xf11c('0x6')][_0xf11c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xff7269,_0x496bad,_0x158d80){return new BPromise(function(_0x43b4f9,_0x43bc2f){return client['request'](_0xff7269,_0x158d80)[_0xf11c('0x8')](function(_0x2ab1fb){logger[_0xf11c('0x9')](_0xf11c('0xa'),_0x496bad,'request\x20sent');logger['debug'](_0xf11c('0xb'),_0x496bad,_0xf11c('0xc'),JSON[_0xf11c('0xd')](_0x2ab1fb));if(_0x2ab1fb[_0xf11c('0xe')]){if(_0x2ab1fb[_0xf11c('0xe')]['code']===0x1f4){logger['error'](_0xf11c('0xa'),_0x496bad,_0x2ab1fb['error'][_0xf11c('0xf')]);return _0x43bc2f(_0x2ab1fb[_0xf11c('0xe')][_0xf11c('0xf')]);}logger[_0xf11c('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x496bad,_0x2ab1fb['error'][_0xf11c('0xf')]);return _0x43b4f9(_0x2ab1fb[_0xf11c('0xe')]['message']);}else{logger[_0xf11c('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x496bad,'request\x20sent');_0x43b4f9(_0x2ab1fb[_0xf11c('0x10')]['message']);}})[_0xf11c('0x11')](function(_0x2126c1){logger[_0xf11c('0xe')](_0xf11c('0xa'),_0x496bad,_0x2126c1);_0x43bc2f(_0x2126c1);});});}exports[_0xf11c('0x12')]=function(_0x1ae705){var _0x4e4d0d=this;return new Promise(function(_0x2dc7f3,_0x448883){return db[_0xf11c('0x13')][_0xf11c('0x14')](_0x1ae705[_0xf11c('0x15')],{'raw':_0x1ae705[_0xf11c('0x16')]?_0x1ae705[_0xf11c('0x16')][_0xf11c('0x17')]===undefined?!![]:![]:!![]})[_0xf11c('0x8')](function(_0x17bf92){logger[_0xf11c('0x9')](_0xf11c('0x12'),_0x1ae705);logger[_0xf11c('0x18')](_0xf11c('0x12'),_0x1ae705,JSON['stringify'](_0x17bf92));_0x2dc7f3(_0x17bf92);})[_0xf11c('0x11')](function(_0x491e49){logger['error'](_0xf11c('0x12'),_0x491e49[_0xf11c('0xf')],_0x1ae705);_0x448883(_0x4e4d0d[_0xf11c('0xe')](0x1f4,_0x491e49[_0xf11c('0xf')]));});});};exports[_0xf11c('0x19')]=function(_0x228c8c){var _0x32295d=this;return new Promise(function(_0x1a0e44,_0x17d281){return db['SmsQueueReport'][_0xf11c('0x1a')](_0x228c8c[_0xf11c('0x15')],{'raw':_0x228c8c[_0xf11c('0x16')]?_0x228c8c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228c8c[_0xf11c('0x16')]?_0x228c8c[_0xf11c('0x16')][_0xf11c('0x1b')]||null:null,'attributes':_0x228c8c[_0xf11c('0x16')]?_0x228c8c['options'][_0xf11c('0x1c')]||null:null,'limit':_0x228c8c[_0xf11c('0x16')]?_0x228c8c[_0xf11c('0x16')][_0xf11c('0x1d')]||null:null})[_0xf11c('0x8')](function(_0x3c6d08){logger[_0xf11c('0x9')](_0xf11c('0x19'),_0x228c8c);logger[_0xf11c('0x18')]('UpdateSmsQueueReport',_0x228c8c,JSON[_0xf11c('0xd')](_0x3c6d08));_0x1a0e44(_0x3c6d08);})[_0xf11c('0x11')](function(_0x20e928){logger[_0xf11c('0xe')](_0xf11c('0x19'),_0x20e928[_0xf11c('0xf')],_0x228c8c);_0x17d281(_0x32295d[_0xf11c('0xe')](0x1f4,_0x20e928[_0xf11c('0xf')]));});});}; \ No newline at end of file +var _0xbbfd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbfd,0xa4));var _0xdbbf=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbbfd[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xdbbf('0x0'));var util=require('util');var moment=require(_0xdbbf('0x1'));var BPromise=require(_0xdbbf('0x2'));var rs=require(_0xdbbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbbf('0x4'))['db'];var utils=require(_0xdbbf('0x5'));var logger=require(_0xdbbf('0x6'))(_0xdbbf('0x7'));var config=require(_0xdbbf('0x8'));var jayson=require(_0xdbbf('0x9'));var client=jayson[_0xdbbf('0xa')][_0xdbbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4caee5,_0x4e37e0,_0x390b38){return new BPromise(function(_0x52c106,_0x296b3a){return client['request'](_0x4caee5,_0x390b38)[_0xdbbf('0xc')](function(_0x35994b){logger[_0xdbbf('0xd')](_0xdbbf('0xe'),_0x4e37e0,_0xdbbf('0xf'));logger[_0xdbbf('0x10')](_0xdbbf('0x11'),_0x4e37e0,_0xdbbf('0xf'),JSON[_0xdbbf('0x12')](_0x35994b));if(_0x35994b[_0xdbbf('0x13')]){if(_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x14')]===0x1f4){logger['error'](_0xdbbf('0xe'),_0x4e37e0,_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);return _0x296b3a(_0x35994b['error'][_0xdbbf('0x15')]);}logger['error'](_0xdbbf('0xe'),_0x4e37e0,_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);return _0x52c106(_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);}else{logger['info'](_0xdbbf('0xe'),_0x4e37e0,_0xdbbf('0xf'));_0x52c106(_0x35994b[_0xdbbf('0x16')]['message']);}})[_0xdbbf('0x17')](function(_0x25e832){logger[_0xdbbf('0x13')](_0xdbbf('0xe'),_0x4e37e0,_0x25e832);_0x296b3a(_0x25e832);});});}exports['CreateSmsQueueReport']=function(_0x301c37){var _0x4f5897=this;return new Promise(function(_0x31a464,_0x8c9762){return db[_0xdbbf('0x18')]['create'](_0x301c37['body'],{'raw':_0x301c37[_0xdbbf('0x19')]?_0x301c37[_0xdbbf('0x19')][_0xdbbf('0x1a')]===undefined?!![]:![]:!![]})[_0xdbbf('0xc')](function(_0x1512ca){logger[_0xdbbf('0xd')](_0xdbbf('0x1b'),_0x301c37);logger[_0xdbbf('0x10')]('CreateSmsQueueReport',_0x301c37,JSON[_0xdbbf('0x12')](_0x1512ca));_0x31a464(_0x1512ca);})[_0xdbbf('0x17')](function(_0x8cfee9){logger[_0xdbbf('0x13')](_0xdbbf('0x1b'),_0x8cfee9['message'],_0x301c37);_0x8c9762(_0x4f5897[_0xdbbf('0x13')](0x1f4,_0x8cfee9[_0xdbbf('0x15')]));});});};exports[_0xdbbf('0x1c')]=function(_0x27cb42){var _0x227df9=this;return new Promise(function(_0x5d35f0,_0x174a1d){return db[_0xdbbf('0x18')][_0xdbbf('0x1d')](_0x27cb42[_0xdbbf('0x1e')],{'raw':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27cb42['options']?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x1f')]||null:null,'attributes':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42['options'][_0xdbbf('0x20')]||null:null,'limit':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x21')]||null:null})[_0xdbbf('0xc')](function(_0x29ade0){logger[_0xdbbf('0xd')]('UpdateSmsQueueReport',_0x27cb42);logger[_0xdbbf('0x10')](_0xdbbf('0x1c'),_0x27cb42,JSON['stringify'](_0x29ade0));_0x5d35f0(_0x29ade0);})[_0xdbbf('0x17')](function(_0x2ca6df){logger[_0xdbbf('0x13')](_0xdbbf('0x1c'),_0x2ca6df[_0xdbbf('0x15')],_0x27cb42);_0x174a1d(_0x227df9[_0xdbbf('0x13')](0x1f4,_0x2ca6df[_0xdbbf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1605359..f5103d8 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 _0xd58c=['update','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x1956d1,_0x256b7d){var _0x5a0116=function(_0x3c3269){while(--_0x3c3269){_0x1956d1['push'](_0x1956d1['shift']());}};_0x5a0116(++_0x256b7d);}(_0xd58c,0xb6));var _0xcd58=function(_0x1aad50,_0x3fb27f){_0x1aad50=_0x1aad50-0x0;var _0x2db378=_0xd58c[_0x1aad50];return _0x2db378;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd58('0x3'));var router=express['Router']();var fs_extra=require(_0xcd58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var controller=require(_0xcd58('0x7'));router[_0xcd58('0x8')]('/',auth[_0xcd58('0x9')](),controller['index']);router['get'](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0xb')]);router[_0xcd58('0x8')](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0xd')]);router[_0xcd58('0xe')]('/',auth['isAuthenticated'](),controller[_0xcd58('0xf')]);router['put'](_0xcd58('0xc'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x10')]);router['delete'](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x1b30c4,_0x5cd2d9){var _0x1a180a=function(_0x4b2cf9){while(--_0x4b2cf9){_0x1b30c4['push'](_0x1b30c4['shift']());}};_0x1a180a(++_0x5cd2d9);}(_0xdc97,0x13b));var _0x7dc9=function(_0xb85339,_0x6ca1a4){_0xb85339=_0xb85339-0x0;var _0x2085d4=_0xdc97[_0xb85339];return _0x2085d4;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['post']('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 53c7f34..cb96c0b 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x41d5e,_0x4d8a7b){var _0x1894bb=function(_0x15b047){while(--_0x15b047){_0x41d5e['push'](_0x41d5e['shift']());}};_0x1894bb(++_0x4d8a7b);}(_0xaa88,0x137));var _0x8aa8=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0xaa88[_0x962fc5];return _0x43667c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x470168,_0x4af4bf){var _0x5c1ae9=function(_0x1e1204){while(--_0x1e1204){_0x470168['push'](_0x470168['shift']());}};_0x5c1ae9(++_0x4af4bf);}(_0x70e0,0x17b));var _0x070e=function(_0x4c8a89,_0x145406){_0x4c8a89=_0x4c8a89-0x0;var _0x354907=_0x70e0[_0x4c8a89];return _0x354907;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 61435c7..55f94be 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 _0xc22b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv'];(function(_0x5668da,_0x29a605){var _0x55e297=function(_0x292e90){while(--_0x292e90){_0x5668da['push'](_0x5668da['shift']());}};_0x55e297(++_0x29a605);}(_0xc22b,0x12d));var _0xbc22=function(_0x5d7f49,_0x5b4580){_0x5d7f49=_0x5d7f49-0x0;var _0x119a7b=_0xc22b[_0x5d7f49];return _0x119a7b;};'use strict';var emlformat=require(_0xbc22('0x0'));var rimraf=require(_0xbc22('0x1'));var zipdir=require(_0xbc22('0x2'));var jsonpatch=require(_0xbc22('0x3'));var rp=require(_0xbc22('0x4'));var moment=require(_0xbc22('0x5'));var BPromise=require(_0xbc22('0x6'));var Mustache=require(_0xbc22('0x7'));var util=require('util');var path=require(_0xbc22('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc22('0x9'));var _=require(_0xbc22('0xa'));var squel=require(_0xbc22('0xb'));var crypto=require(_0xbc22('0xc'));var jsforce=require(_0xbc22('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbc22('0xe'));var querystring=require(_0xbc22('0xf'));var Papa=require(_0xbc22('0x10'));var Redis=require(_0xbc22('0x11'));var authService=require(_0xbc22('0x12'));var qs=require(_0xbc22('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc22('0x14'));var logger=require(_0xbc22('0x15'))(_0xbc22('0x16'));var utils=require(_0xbc22('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbc22('0x18'));var db=require(_0xbc22('0x19'))['db'];function respondWithStatusCode(_0x39d381,_0x34651a){_0x34651a=_0x34651a||0xcc;return function(_0x45891c){if(_0x45891c){return _0x39d381[_0xbc22('0x1a')](_0x34651a);}return _0x39d381['status'](_0x34651a)[_0xbc22('0x1b')]();};}function respondWithResult(_0x2c624b,_0x3d982d){_0x3d982d=_0x3d982d||0xc8;return function(_0x440441){if(_0x440441){return _0x2c624b[_0xbc22('0x1c')](_0x3d982d)['json'](_0x440441);}};}function respondWithFilteredResult(_0xc3a86f,_0x502df0){return function(_0x112586){if(_0x112586){var _0x498e01=typeof _0x502df0[_0xbc22('0x1d')]===_0xbc22('0x1e')&&typeof _0x502df0[_0xbc22('0x1f')]===_0xbc22('0x1e');var _0x516025=_0x112586[_0xbc22('0x20')];var _0x27150a=_0x498e01?0x0:_0x502df0[_0xbc22('0x1d')];var _0x1f3014=_0x498e01?_0x112586['count']:_0x502df0[_0xbc22('0x1d')]+_0x502df0[_0xbc22('0x1f')];var _0x38b47d;if(_0x1f3014>=_0x516025){_0x1f3014=_0x516025;_0x38b47d=0xc8;}else{_0x38b47d=0xce;}_0xc3a86f[_0xbc22('0x1c')](_0x38b47d);return _0xc3a86f[_0xbc22('0x21')](_0xbc22('0x22'),_0x27150a+'-'+_0x1f3014+'/'+_0x516025)[_0xbc22('0x23')](_0x112586);}return null;};}function patchUpdates(_0x345af1){return function(_0x519200){try{jsonpatch[_0xbc22('0x24')](_0x519200,_0x345af1,!![]);}catch(_0x1703db){return BPromise[_0xbc22('0x25')](_0x1703db);}return _0x519200[_0xbc22('0x26')]();};}function saveUpdates(_0x207773,_0x5c0cc2){return function(_0xdcb18e){if(_0xdcb18e){return _0xdcb18e[_0xbc22('0x27')](_0x207773)[_0xbc22('0x28')](function(_0x3c7a43){return _0x3c7a43;});}return null;};}function removeEntity(_0x45280d,_0x42d185){return function(_0x297513){if(_0x297513){return _0x297513[_0xbc22('0x29')]()[_0xbc22('0x28')](function(){_0x45280d[_0xbc22('0x1c')](0xcc)[_0xbc22('0x1b')]();});}};}function handleEntityNotFound(_0x12ac9c,_0x219cd1){return function(_0x514483){if(!_0x514483){_0x12ac9c[_0xbc22('0x1a')](0x194);}return _0x514483;};}function handleError(_0x5ea2b0,_0x598a9a){_0x598a9a=_0x598a9a||0x1f4;return function(_0x389e99){logger[_0xbc22('0x2a')](_0x389e99[_0xbc22('0x2b')]);if(_0x389e99[_0xbc22('0x2c')]){delete _0x389e99['name'];}_0x5ea2b0[_0xbc22('0x1c')](_0x598a9a)[_0xbc22('0x2d')](_0x389e99);};}exports[_0xbc22('0x2e')]=function(_0x1cf627,_0x1ae32c){var _0x4dc11d={},_0x21cf99={},_0x54e742={'count':0x0,'rows':[]};var _0x1abda3=_[_0xbc22('0x2f')](db[_0xbc22('0x30')][_0xbc22('0x31')],function(_0x12a3d9){return{'name':_0x12a3d9[_0xbc22('0x32')],'type':_0x12a3d9[_0xbc22('0x33')]['key']};});_0x21cf99[_0xbc22('0x34')]=_['map'](_0x1abda3,_0xbc22('0x2c'));_0x21cf99[_0xbc22('0x35')]=_['keys'](_0x1cf627['query']);_0x21cf99[_0xbc22('0x36')]=_[_0xbc22('0x37')](_0x21cf99['model'],_0x21cf99[_0xbc22('0x35')]);_0x4dc11d[_0xbc22('0x38')]=_[_0xbc22('0x37')](_0x21cf99['model'],qs[_0xbc22('0x39')](_0x1cf627['query'][_0xbc22('0x39')]));_0x4dc11d[_0xbc22('0x38')]=_0x4dc11d[_0xbc22('0x38')][_0xbc22('0x3a')]?_0x4dc11d[_0xbc22('0x38')]:_0x21cf99['model'];if(!_0x1cf627[_0xbc22('0x35')][_0xbc22('0x3b')]('nolimit')){_0x4dc11d[_0xbc22('0x1f')]=qs[_0xbc22('0x1f')](_0x1cf627[_0xbc22('0x35')]['limit']);_0x4dc11d['offset']=qs[_0xbc22('0x1d')](_0x1cf627['query'][_0xbc22('0x1d')]);}_0x4dc11d[_0xbc22('0x3c')]=qs[_0xbc22('0x3d')](_0x1cf627[_0xbc22('0x35')][_0xbc22('0x3d')]);_0x4dc11d[_0xbc22('0x3e')]=qs[_0xbc22('0x36')](_[_0xbc22('0x3f')](_0x1cf627['query'],_0x21cf99[_0xbc22('0x36')]),_0x1abda3);if(_0x1cf627['query'][_0xbc22('0x40')]){_0x4dc11d[_0xbc22('0x3e')]=_[_0xbc22('0x41')](_0x4dc11d[_0xbc22('0x3e')],{'$or':_[_0xbc22('0x2f')](_0x1abda3,function(_0x3ea570){if(_0x3ea570[_0xbc22('0x33')]!=='VIRTUAL'){var _0x24d498={};_0x24d498[_0x3ea570[_0xbc22('0x2c')]]={'$like':'%'+_0x1cf627[_0xbc22('0x35')][_0xbc22('0x40')]+'%'};return _0x24d498;}})});}_0x4dc11d=_[_0xbc22('0x41')]({},_0x4dc11d,_0x1cf627[_0xbc22('0x42')]);var _0x5bb86a={'where':_0x4dc11d[_0xbc22('0x3e')]};return db['SmsTransferReport']['count'](_0x5bb86a)[_0xbc22('0x28')](function(_0x2104d5){_0x54e742[_0xbc22('0x20')]=_0x2104d5;if(_0x1cf627[_0xbc22('0x35')][_0xbc22('0x43')]){_0x4dc11d[_0xbc22('0x44')]=[{'all':!![]}];}return db[_0xbc22('0x30')][_0xbc22('0x45')](_0x4dc11d);})['then'](function(_0x517d19){_0x54e742[_0xbc22('0x46')]=_0x517d19;return _0x54e742;})['then'](respondWithFilteredResult(_0x1ae32c,_0x4dc11d))[_0xbc22('0x47')](handleError(_0x1ae32c,null));};exports[_0xbc22('0x48')]=function(_0x5e1c84,_0x3b0e80){var _0x1cfd8f={'raw':!![],'where':{'id':_0x5e1c84[_0xbc22('0x49')]['id']}},_0x410532={};_0x410532[_0xbc22('0x34')]=_[_0xbc22('0x4a')](db[_0xbc22('0x30')][_0xbc22('0x31')]);_0x410532['query']=_[_0xbc22('0x4a')](_0x5e1c84[_0xbc22('0x35')]);_0x410532['filters']=_[_0xbc22('0x37')](_0x410532[_0xbc22('0x34')],_0x410532[_0xbc22('0x35')]);_0x1cfd8f[_0xbc22('0x38')]=_[_0xbc22('0x37')](_0x410532[_0xbc22('0x34')],qs[_0xbc22('0x39')](_0x5e1c84[_0xbc22('0x35')][_0xbc22('0x39')]));_0x1cfd8f['attributes']=_0x1cfd8f[_0xbc22('0x38')][_0xbc22('0x3a')]?_0x1cfd8f[_0xbc22('0x38')]:_0x410532[_0xbc22('0x34')];if(_0x5e1c84[_0xbc22('0x35')][_0xbc22('0x43')]){_0x1cfd8f[_0xbc22('0x44')]=[{'all':!![]}];}_0x1cfd8f=_[_0xbc22('0x41')]({},_0x1cfd8f,_0x5e1c84[_0xbc22('0x42')]);return db['SmsTransferReport'][_0xbc22('0x4b')](_0x1cfd8f)[_0xbc22('0x28')](handleEntityNotFound(_0x3b0e80,null))['then'](respondWithResult(_0x3b0e80,null))['catch'](handleError(_0x3b0e80,null));};exports[_0xbc22('0x4c')]=function(_0x19a2a4,_0x1f751e){return db[_0xbc22('0x30')][_0xbc22('0x4c')](_0x19a2a4[_0xbc22('0x4d')],{})[_0xbc22('0x28')](respondWithResult(_0x1f751e,0xc9))[_0xbc22('0x47')](handleError(_0x1f751e,null));};exports['update']=function(_0xa119d5,_0x3599b1){if(_0xa119d5['body']['id']){delete _0xa119d5['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0xa119d5[_0xbc22('0x49')]['id']}})['then'](handleEntityNotFound(_0x3599b1,null))[_0xbc22('0x28')](saveUpdates(_0xa119d5[_0xbc22('0x4d')],null))[_0xbc22('0x28')](respondWithResult(_0x3599b1,null))[_0xbc22('0x47')](handleError(_0x3599b1,null));};exports[_0xbc22('0x29')]=function(_0x407a4b,_0x5e128e){return db[_0xbc22('0x30')][_0xbc22('0x4b')]({'where':{'id':_0x407a4b['params']['id']}})[_0xbc22('0x28')](handleEntityNotFound(_0x5e128e,null))[_0xbc22('0x28')](removeEntity(_0x5e128e,null))['catch'](handleError(_0x5e128e,null));};exports[_0xbc22('0x4e')]=function(_0x5e0476,_0x57a826){return db[_0xbc22('0x30')]['describe']()[_0xbc22('0x28')](respondWithResult(_0x57a826,null))[_0xbc22('0x47')](handleError(_0x57a826,null));}; \ No newline at end of file +var _0xf528=['sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','SmsTransferReport','includeAll','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x4bbda3,_0x6e262d){var _0x48eb61=function(_0x251680){while(--_0x251680){_0x4bbda3['push'](_0x4bbda3['shift']());}};_0x48eb61(++_0x6e262d);}(_0xf528,0x1ca));var _0x8f52=function(_0x26bf86,_0x3bea03){_0x26bf86=_0x26bf86-0x0;var _0xbdf743=_0xf528[_0x26bf86];return _0xbdf743;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f52('0x0'));var jsonpatch=require(_0x8f52('0x1'));var rp=require(_0x8f52('0x2'));var moment=require(_0x8f52('0x3'));var BPromise=require(_0x8f52('0x4'));var Mustache=require(_0x8f52('0x5'));var util=require(_0x8f52('0x6'));var path=require(_0x8f52('0x7'));var sox=require(_0x8f52('0x8'));var csv=require(_0x8f52('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f52('0xa'));var _=require('lodash');var squel=require(_0x8f52('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f52('0xc'));var deskjs=require(_0x8f52('0xd'));var toCsv=require(_0x8f52('0x9'));var querystring=require(_0x8f52('0xe'));var Papa=require(_0x8f52('0xf'));var Redis=require(_0x8f52('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8f52('0x11'));var as=require(_0x8f52('0x12'));var hardwareService=require(_0x8f52('0x13'));var logger=require(_0x8f52('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8f52('0x15'));var db=require(_0x8f52('0x16'))['db'];function respondWithStatusCode(_0x220fb9,_0x261363){_0x261363=_0x261363||0xcc;return function(_0x59c007){if(_0x59c007){return _0x220fb9[_0x8f52('0x17')](_0x261363);}return _0x220fb9['status'](_0x261363)[_0x8f52('0x18')]();};}function respondWithResult(_0x3dab8c,_0x5d2041){_0x5d2041=_0x5d2041||0xc8;return function(_0x369957){if(_0x369957){return _0x3dab8c[_0x8f52('0x19')](_0x5d2041)[_0x8f52('0x1a')](_0x369957);}};}function respondWithFilteredResult(_0x1b8fef,_0x2b381c){return function(_0x42cc8c){if(_0x42cc8c){var _0x274cbb=typeof _0x2b381c[_0x8f52('0x1b')]===_0x8f52('0x1c')&&typeof _0x2b381c[_0x8f52('0x1d')]===_0x8f52('0x1c');var _0xddc8a6=_0x42cc8c[_0x8f52('0x1e')];var _0x43d530=_0x274cbb?0x0:_0x2b381c[_0x8f52('0x1b')];var _0xf79f11=_0x274cbb?_0x42cc8c[_0x8f52('0x1e')]:_0x2b381c['offset']+_0x2b381c[_0x8f52('0x1d')];var _0x51fb8f;if(_0xf79f11>=_0xddc8a6){_0xf79f11=_0xddc8a6;_0x51fb8f=0xc8;}else{_0x51fb8f=0xce;}_0x1b8fef[_0x8f52('0x19')](_0x51fb8f);return _0x1b8fef[_0x8f52('0x1f')]('Content-Range',_0x43d530+'-'+_0xf79f11+'/'+_0xddc8a6)['json'](_0x42cc8c);}return null;};}function patchUpdates(_0x532f9d){return function(_0x4ce1ef){try{jsonpatch[_0x8f52('0x20')](_0x4ce1ef,_0x532f9d,!![]);}catch(_0x2dbdad){return BPromise[_0x8f52('0x21')](_0x2dbdad);}return _0x4ce1ef['save']();};}function saveUpdates(_0x189060,_0x4fa636){return function(_0x47b10c){if(_0x47b10c){return _0x47b10c['update'](_0x189060)[_0x8f52('0x22')](function(_0x187ed3){return _0x187ed3;});}return null;};}function removeEntity(_0x5aa0ee,_0x1e2e9b){return function(_0x496cdd){if(_0x496cdd){return _0x496cdd[_0x8f52('0x23')]()['then'](function(){_0x5aa0ee[_0x8f52('0x19')](0xcc)[_0x8f52('0x18')]();});}};}function handleEntityNotFound(_0x4f8bba,_0x119aa2){return function(_0x566d2f){if(!_0x566d2f){_0x4f8bba[_0x8f52('0x17')](0x194);}return _0x566d2f;};}function handleError(_0x13af16,_0x50bc6a){_0x50bc6a=_0x50bc6a||0x1f4;return function(_0x3e5b42){logger[_0x8f52('0x24')](_0x3e5b42['stack']);if(_0x3e5b42[_0x8f52('0x25')]){delete _0x3e5b42[_0x8f52('0x25')];}_0x13af16[_0x8f52('0x19')](_0x50bc6a)[_0x8f52('0x26')](_0x3e5b42);};}exports[_0x8f52('0x27')]=function(_0x95e04a,_0x130d46){var _0x1c1737={},_0x172d7e={},_0x411a6b={'count':0x0,'rows':[]};var _0x45210e=_[_0x8f52('0x28')](db['SmsTransferReport'][_0x8f52('0x29')],function(_0x54bef9){return{'name':_0x54bef9['fieldName'],'type':_0x54bef9[_0x8f52('0x2a')][_0x8f52('0x2b')]};});_0x172d7e[_0x8f52('0x2c')]=_[_0x8f52('0x28')](_0x45210e,_0x8f52('0x25'));_0x172d7e[_0x8f52('0x2d')]=_['keys'](_0x95e04a[_0x8f52('0x2d')]);_0x172d7e[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x172d7e['model'],_0x172d7e[_0x8f52('0x2d')]);_0x1c1737[_0x8f52('0x30')]=_[_0x8f52('0x2f')](_0x172d7e['model'],qs['fields'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x1c1737[_0x8f52('0x30')]=_0x1c1737[_0x8f52('0x30')][_0x8f52('0x32')]?_0x1c1737['attributes']:_0x172d7e[_0x8f52('0x2c')];if(!_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x33')]('nolimit')){_0x1c1737[_0x8f52('0x1d')]=qs['limit'](_0x95e04a[_0x8f52('0x2d')]['limit']);_0x1c1737[_0x8f52('0x1b')]=qs[_0x8f52('0x1b')](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x1b')]);}_0x1c1737[_0x8f52('0x34')]=qs['sort'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x35')]);_0x1c1737[_0x8f52('0x36')]=qs['filters'](_[_0x8f52('0x37')](_0x95e04a[_0x8f52('0x2d')],_0x172d7e['filters']),_0x45210e);if(_0x95e04a[_0x8f52('0x2d')]['filter']){_0x1c1737[_0x8f52('0x36')]=_['merge'](_0x1c1737[_0x8f52('0x36')],{'$or':_[_0x8f52('0x28')](_0x45210e,function(_0x4ca1fc){if(_0x4ca1fc[_0x8f52('0x2a')]!==_0x8f52('0x38')){var _0x1ed29f={};_0x1ed29f[_0x4ca1fc[_0x8f52('0x25')]]={'$like':'%'+_0x95e04a['query']['filter']+'%'};return _0x1ed29f;}})});}_0x1c1737=_[_0x8f52('0x39')]({},_0x1c1737,_0x95e04a[_0x8f52('0x3a')]);var _0x42dbba={'where':_0x1c1737[_0x8f52('0x36')]};return db['SmsTransferReport'][_0x8f52('0x1e')](_0x42dbba)[_0x8f52('0x22')](function(_0x5c725d){_0x411a6b['count']=_0x5c725d;if(_0x95e04a[_0x8f52('0x2d')]['includeAll']){_0x1c1737[_0x8f52('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8f52('0x3c')](_0x1c1737);})['then'](function(_0xc1a8ea){_0x411a6b[_0x8f52('0x3d')]=_0xc1a8ea;return _0x411a6b;})['then'](respondWithFilteredResult(_0x130d46,_0x1c1737))[_0x8f52('0x3e')](handleError(_0x130d46,null));};exports[_0x8f52('0x3f')]=function(_0x195672,_0x1dc439){var _0x4775cc={'raw':!![],'where':{'id':_0x195672[_0x8f52('0x40')]['id']}},_0x5a80da={};_0x5a80da['model']=_[_0x8f52('0x41')](db[_0x8f52('0x42')]['rawAttributes']);_0x5a80da[_0x8f52('0x2d')]=_[_0x8f52('0x41')](_0x195672[_0x8f52('0x2d')]);_0x5a80da[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],_0x5a80da[_0x8f52('0x2d')]);_0x4775cc['attributes']=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],qs[_0x8f52('0x31')](_0x195672[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x4775cc[_0x8f52('0x30')]=_0x4775cc[_0x8f52('0x30')]['length']?_0x4775cc[_0x8f52('0x30')]:_0x5a80da['model'];if(_0x195672[_0x8f52('0x2d')][_0x8f52('0x43')]){_0x4775cc[_0x8f52('0x3b')]=[{'all':!![]}];}_0x4775cc=_[_0x8f52('0x39')]({},_0x4775cc,_0x195672['options']);return db['SmsTransferReport'][_0x8f52('0x44')](_0x4775cc)[_0x8f52('0x22')](handleEntityNotFound(_0x1dc439,null))[_0x8f52('0x22')](respondWithResult(_0x1dc439,null))[_0x8f52('0x3e')](handleError(_0x1dc439,null));};exports['create']=function(_0xa17c25,_0x41eb7e){return db[_0x8f52('0x42')][_0x8f52('0x45')](_0xa17c25[_0x8f52('0x46')],{})['then'](respondWithResult(_0x41eb7e,0xc9))[_0x8f52('0x3e')](handleError(_0x41eb7e,null));};exports[_0x8f52('0x47')]=function(_0x18a521,_0x1a6d1d){if(_0x18a521['body']['id']){delete _0x18a521['body']['id'];}return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x18a521[_0x8f52('0x40')]['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x1a6d1d,null))[_0x8f52('0x22')](saveUpdates(_0x18a521[_0x8f52('0x46')],null))[_0x8f52('0x22')](respondWithResult(_0x1a6d1d,null))[_0x8f52('0x3e')](handleError(_0x1a6d1d,null));};exports[_0x8f52('0x23')]=function(_0x21e062,_0x19acf8){return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x21e062[_0x8f52('0x40')]['id']}})['then'](handleEntityNotFound(_0x19acf8,null))[_0x8f52('0x22')](removeEntity(_0x19acf8,null))[_0x8f52('0x3e')](handleError(_0x19acf8,null));};exports[_0x8f52('0x48')]=function(_0xe303e0,_0x360734){return db[_0x8f52('0x42')]['describe']()['then'](respondWithResult(_0x360734,null))['catch'](handleError(_0x360734,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 65daf17..fdf72b1 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 _0xc576=['path','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc576,0x1ea));var _0x6c57=function(_0x25f3e3,_0x207891){_0x25f3e3=_0x25f3e3-0x0;var _0xa89b6d=_0xc576[_0x25f3e3];return _0xa89b6d;};'use strict';var _=require(_0x6c57('0x0'));var util=require(_0x6c57('0x1'));var logger=require(_0x6c57('0x2'))(_0x6c57('0x3'));var moment=require(_0x6c57('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c57('0x5'));var rimraf=require('rimraf');var config=require(_0x6c57('0x6'));var attributes=require(_0x6c57('0x7'));module['exports']=function(_0xa6e0c4,_0x5e81a6){return _0xa6e0c4[_0x6c57('0x8')](_0x6c57('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x6c57('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xee81=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsTransferReport'];(function(_0x2ea680,_0x99a563){var _0x317396=function(_0x40c50d){while(--_0x40c50d){_0x2ea680['push'](_0x2ea680['shift']());}};_0x317396(++_0x99a563);}(_0xee81,0x15e));var _0x1ee8=function(_0x15f362,_0x120fe4){_0x15f362=_0x15f362-0x0;var _0x3d789a=_0xee81[_0x15f362];return _0x3d789a;};'use strict';var _=require(_0x1ee8('0x0'));var util=require(_0x1ee8('0x1'));var logger=require(_0x1ee8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1ee8('0x3'));var rp=require(_0x1ee8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ee8('0x5'));var config=require(_0x1ee8('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x1ee8('0x7')]=function(_0xd6987,_0x1f303b){return _0xd6987[_0x1ee8('0x8')](_0x1ee8('0x9'),attributes,{'tableName':_0x1ee8('0xa'),'paranoid':![],'indexes':[{'name':_0x1ee8('0xb'),'fields':[_0x1ee8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 732522a..acb3fdf 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 _0xef39=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x46627d,_0x5e8cae){var _0x126284=function(_0x54ec60){while(--_0x54ec60){_0x46627d['push'](_0x46627d['shift']());}};_0x126284(++_0x5e8cae);}(_0xef39,0x92));var _0x9ef3=function(_0x300f14,_0x150d61){_0x300f14=_0x300f14-0x0;var _0x3682a2=_0xef39[_0x300f14];return _0x3682a2;};'use strict';var _=require('lodash');var util=require(_0x9ef3('0x0'));var moment=require(_0x9ef3('0x1'));var BPromise=require(_0x9ef3('0x2'));var rs=require(_0x9ef3('0x3'));var fs=require('fs');var Redis=require(_0x9ef3('0x4'));var db=require(_0x9ef3('0x5'))['db'];var utils=require(_0x9ef3('0x6'));var logger=require(_0x9ef3('0x7'))(_0x9ef3('0x8'));var config=require(_0x9ef3('0x9'));var jayson=require(_0x9ef3('0xa'));var client=jayson[_0x9ef3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b8488,_0x1f7ab7,_0x290ffd){return new BPromise(function(_0x27cfaa,_0x370330){return client[_0x9ef3('0xc')](_0x1b8488,_0x290ffd)[_0x9ef3('0xd')](function(_0x15ae4c){logger[_0x9ef3('0xe')](_0x9ef3('0xf'),_0x1f7ab7,_0x9ef3('0x10'));logger[_0x9ef3('0x11')](_0x9ef3('0x12'),_0x1f7ab7,'request\x20sent',JSON[_0x9ef3('0x13')](_0x15ae4c));if(_0x15ae4c[_0x9ef3('0x14')]){if(_0x15ae4c[_0x9ef3('0x14')][_0x9ef3('0x15')]===0x1f4){logger[_0x9ef3('0x14')](_0x9ef3('0xf'),_0x1f7ab7,_0x15ae4c['error'][_0x9ef3('0x16')]);return _0x370330(_0x15ae4c[_0x9ef3('0x14')][_0x9ef3('0x16')]);}logger['error'](_0x9ef3('0xf'),_0x1f7ab7,_0x15ae4c[_0x9ef3('0x14')]['message']);return _0x27cfaa(_0x15ae4c[_0x9ef3('0x14')][_0x9ef3('0x16')]);}else{logger[_0x9ef3('0xe')](_0x9ef3('0xf'),_0x1f7ab7,_0x9ef3('0x10'));_0x27cfaa(_0x15ae4c[_0x9ef3('0x17')]['message']);}})[_0x9ef3('0x18')](function(_0x355dbb){logger[_0x9ef3('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x1f7ab7,_0x355dbb);_0x370330(_0x355dbb);});});} \ No newline at end of file +var _0xe009=['client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b747b,_0x3e3ad5){var _0x4361e0=function(_0x357074){while(--_0x357074){_0x1b747b['push'](_0x1b747b['shift']());}};_0x4361e0(++_0x3e3ad5);}(_0xe009,0x122));var _0x9e00=function(_0x43808a,_0x4b09f6){_0x43808a=_0x43808a-0x0;var _0x52fbc8=_0xe009[_0x43808a];return _0x52fbc8;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402bb0,_0x22417d,_0x1eb956){return new BPromise(function(_0x5da6a4,_0x292a51){return client['request'](_0x402bb0,_0x1eb956)['then'](function(_0x531c9b){logger[_0x9e00('0xc')](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));logger['debug'](_0x9e00('0xf'),_0x22417d,_0x9e00('0xe'),JSON[_0x9e00('0x10')](_0x531c9b));if(_0x531c9b['error']){if(_0x531c9b[_0x9e00('0x11')]['code']===0x1f4){logger['error'](_0x9e00('0xd'),_0x22417d,_0x531c9b['error'][_0x9e00('0x12')]);return _0x292a51(_0x531c9b[_0x9e00('0x11')][_0x9e00('0x12')]);}logger[_0x9e00('0x11')](_0x9e00('0xd'),_0x22417d,_0x531c9b[_0x9e00('0x11')]['message']);return _0x5da6a4(_0x531c9b['error'][_0x9e00('0x12')]);}else{logger['info'](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));_0x5da6a4(_0x531c9b[_0x9e00('0x13')][_0x9e00('0x12')]);}})['catch'](function(_0x4f9007){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x22417d,_0x4f9007);_0x292a51(_0x4f9007);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index e158889..6342adb 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 _0x318e=['../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','file','update','delete','multer','util','path','express','Router','../../components/auth/service'];(function(_0x565a92,_0x33b98a){var _0x4ec258=function(_0x4c2dd9){while(--_0x4c2dd9){_0x565a92['push'](_0x565a92['shift']());}};_0x4ec258(++_0x33b98a);}(_0x318e,0x108));var _0xe318=function(_0x319927,_0x481f64){_0x319927=_0x319927-0x0;var _0x58be17=_0x318e[_0x319927];return _0x58be17;};'use strict';var multer=require(_0xe318('0x0'));var util=require(_0xe318('0x1'));var path=require(_0xe318('0x2'));var timeout=require('connect-timeout');var express=require(_0xe318('0x3'));var router=express[_0xe318('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe318('0x5'));var interaction=require(_0xe318('0x6'));var config=require(_0xe318('0x7'));var controller=require(_0xe318('0x8'));router[_0xe318('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe318('0x9')](_0xe318('0xa'),auth[_0xe318('0xb')](),controller[_0xe318('0xc')]);router['get'](_0xe318('0xd'),auth[_0xe318('0xb')](),controller[_0xe318('0xe')]);var upload=multer({'storage':multer[_0xe318('0xf')]({'destination':function(_0x3dd119,_0x1727cc,_0xa21ec5){_0xa21ec5(null,path['join'](config['root'],_0xe318('0x10')));},'filename':function(_0x954d26,_0x2a69d2,_0x1d30c4){_0x2a69d2['originalname']=_0x2a69d2[_0xe318('0x11')][_0xe318('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d30c4(null,util[_0xe318('0x13')]('%s-%s%s',path[_0xe318('0x14')](_0x2a69d2['originalname'],path[_0xe318('0x15')](_0x2a69d2[_0xe318('0x11')])),Date[_0xe318('0x16')](),path['extname'](_0x2a69d2['originalname'])));}})});router[_0xe318('0x17')]('/',upload['single'](_0xe318('0x18')),controller['create']);router['put']('/:id',auth[_0xe318('0xb')](),controller[_0xe318('0x19')]);router[_0xe318('0x1a')](_0xe318('0xa'),auth[_0xe318('0xb')](),controller[_0xe318('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x4c7a=['../../config/environment','./sound.controller','isAuthenticated','index','get','show','download','root','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','post','file','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c86e8,_0x19ef82){var _0x1747b9=function(_0x14610){while(--_0x14610){_0x2c86e8['push'](_0x2c86e8['shift']());}};_0x1747b9(++_0x19ef82);}(_0x4c7a,0x1e5));var _0xa4c7=function(_0x5c6220,_0x5e94e6){_0x5c6220=_0x5c6220-0x0;var _0x16a51e=_0x4c7a[_0x5c6220];return _0x16a51e;};'use strict';var multer=require(_0xa4c7('0x0'));var util=require(_0xa4c7('0x1'));var path=require(_0xa4c7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4c7('0x3'));var router=express[_0xa4c7('0x4')]();var fs_extra=require(_0xa4c7('0x5'));var auth=require(_0xa4c7('0x6'));var interaction=require(_0xa4c7('0x7'));var config=require(_0xa4c7('0x8'));var controller=require(_0xa4c7('0x9'));router['get']('/',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xb')]);router[_0xa4c7('0xc')]('/:id',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xd')]);router[_0xa4c7('0xc')]('/:id/download',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56b214,_0x400d88,_0x45f452){_0x45f452(null,path['join'](config[_0xa4c7('0xf')],_0xa4c7('0x10')));},'filename':function(_0x20b23b,_0x485837,_0x4296f3){_0x485837['originalname']=_0x485837['originalname'][_0xa4c7('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4296f3(null,util[_0xa4c7('0x12')](_0xa4c7('0x13'),path[_0xa4c7('0x14')](_0x485837[_0xa4c7('0x15')],path['extname'](_0x485837[_0xa4c7('0x15')])),Date['now'](),path['extname'](_0x485837['originalname'])));}})});router[_0xa4c7('0x16')]('/',upload['single'](_0xa4c7('0x17')),controller['create']);router[_0xa4c7('0x18')](_0xa4c7('0x19'),auth[_0xa4c7('0xa')](),controller[_0xa4c7('0x1a')]);router[_0xa4c7('0x1b')](_0xa4c7('0x19'),auth[_0xa4c7('0xa')](),controller[_0xa4c7('0x1b')]);module[_0xa4c7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 93f301c..bfb1b55 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 _0x5b4f=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x4a66e2,_0x4c448d){var _0x5c8237=function(_0x5f5c65){while(--_0x5f5c65){_0x4a66e2['push'](_0x4a66e2['shift']());}};_0x5c8237(++_0x4c448d);}(_0x5b4f,0x145));var _0xf5b4=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5b4f[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xf5b4('0x0'));module[_0xf5b4('0x1')]={'name':{'type':Sequelize[_0xf5b4('0x2')],'unique':_0xf5b4('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf5b4('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xf5b4('0x2')]},'original_duration':{'type':Sequelize[_0xf5b4('0x4')]},'original_sampleCount':{'type':Sequelize[_0xf5b4('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xf5b4('0x5')]},'original_sampleRate':{'type':Sequelize[_0xf5b4('0x6')]},'converted_format':{'type':Sequelize[_0xf5b4('0x2')]},'converted_duration':{'type':Sequelize[_0xf5b4('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf5b4('0x5')]},'converted_channelCount':{'type':Sequelize[_0xf5b4('0x6')]},'converted_bitRate':{'type':Sequelize[_0xf5b4('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xf5b4('0x6')]}}; \ No newline at end of file +var _0x8037=['FLOAT','BIGINT','INTEGER','sequelize','name','STRING'];(function(_0xe9b9b5,_0x820cf2){var _0x581105=function(_0x1f4046){while(--_0x1f4046){_0xe9b9b5['push'](_0xe9b9b5['shift']());}};_0x581105(++_0x820cf2);}(_0x8037,0x195));var _0x7803=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8037[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7803('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7803('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x7803('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x7803('0x3')]},'original_sampleCount':{'type':Sequelize[_0x7803('0x4')]},'original_channelCount':{'type':Sequelize[_0x7803('0x5')]},'original_bitRate':{'type':Sequelize[_0x7803('0x4')]},'original_sampleRate':{'type':Sequelize[_0x7803('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x7803('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x7803('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x7803('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x7803('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 8de7bdd..7f1a26b 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 _0xe370=['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','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','get','destroy','error','stack','name','send','map','Sound','type','key','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','intersection','length','include','find','params','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','basename','file','originalname','extname','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','0777','body','userProfileId','role','UserProfileSection','Sounds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xe370,0x6e));var _0x0e37=function(_0x29d1ba,_0x7a5223){_0x29d1ba=_0x29d1ba-0x0;var _0x3de575=_0xe370[_0x29d1ba];return _0x3de575;};'use strict';var emlformat=require(_0x0e37('0x0'));var rimraf=require(_0x0e37('0x1'));var zipdir=require(_0x0e37('0x2'));var jsonpatch=require(_0x0e37('0x3'));var rp=require(_0x0e37('0x4'));var moment=require(_0x0e37('0x5'));var BPromise=require(_0x0e37('0x6'));var Mustache=require(_0x0e37('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0e37('0x8'));var csv=require(_0x0e37('0x9'));var ejs=require(_0x0e37('0xa'));var fs=require('fs');var fs_extra=require(_0x0e37('0xb'));var _=require(_0x0e37('0xc'));var squel=require(_0x0e37('0xd'));var crypto=require(_0x0e37('0xe'));var jsforce=require(_0x0e37('0xf'));var deskjs=require(_0x0e37('0x10'));var toCsv=require(_0x0e37('0x9'));var querystring=require(_0x0e37('0x11'));var Papa=require(_0x0e37('0x12'));var Redis=require('ioredis');var authService=require(_0x0e37('0x13'));var qs=require(_0x0e37('0x14'));var as=require(_0x0e37('0x15'));var hardwareService=require(_0x0e37('0x16'));var logger=require(_0x0e37('0x17'))(_0x0e37('0x18'));var utils=require(_0x0e37('0x19'));var config=require(_0x0e37('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x475270,_0x2bb6b8){_0x2bb6b8=_0x2bb6b8||0xcc;return function(_0x6bc7fe){if(_0x6bc7fe){return _0x475270[_0x0e37('0x1b')](_0x2bb6b8);}return _0x475270[_0x0e37('0x1c')](_0x2bb6b8)[_0x0e37('0x1d')]();};}function respondWithResult(_0x19619d,_0x45f825){_0x45f825=_0x45f825||0xc8;return function(_0x153985){if(_0x153985){return _0x19619d[_0x0e37('0x1c')](_0x45f825)['json'](_0x153985);}};}function respondWithFilteredResult(_0x37c462,_0x562184){return function(_0x14eb20){if(_0x14eb20){var _0x36b09d=typeof _0x562184[_0x0e37('0x1e')]===_0x0e37('0x1f')&&typeof _0x562184[_0x0e37('0x20')]==='undefined';var _0x1b3c03=_0x14eb20['count'];var _0x130c95=_0x36b09d?0x0:_0x562184[_0x0e37('0x1e')];var _0x2e282f=_0x36b09d?_0x14eb20[_0x0e37('0x21')]:_0x562184['offset']+_0x562184[_0x0e37('0x20')];var _0x341438;if(_0x2e282f>=_0x1b3c03){_0x2e282f=_0x1b3c03;_0x341438=0xc8;}else{_0x341438=0xce;}_0x37c462[_0x0e37('0x1c')](_0x341438);return _0x37c462[_0x0e37('0x22')]('Content-Range',_0x130c95+'-'+_0x2e282f+'/'+_0x1b3c03)['json'](_0x14eb20);}return null;};}function patchUpdates(_0x363a1e){return function(_0x587ecb){try{jsonpatch['apply'](_0x587ecb,_0x363a1e,!![]);}catch(_0xd149c2){return BPromise[_0x0e37('0x23')](_0xd149c2);}return _0x587ecb[_0x0e37('0x24')]();};}function saveUpdates(_0x1b8f0d,_0xe5c5a9){return function(_0x3c6958){if(_0x3c6958){return _0x3c6958[_0x0e37('0x25')](_0x1b8f0d)[_0x0e37('0x26')](function(_0x4f11d8){return _0x4f11d8;});}return null;};}function removeEntity(_0x4abe00,_0xd19282){return function(_0xfaeac9){if(_0xfaeac9){return _0xfaeac9['destroy']()['then'](function(){var _0x417c0d=_0xfaeac9[_0x0e37('0x27')]({'plain':!![]});var _0x40500a='Sounds';return db['UserProfileResource'][_0x0e37('0x28')]({'where':{'type':_0x40500a,'resourceId':_0x417c0d['id']}})[_0x0e37('0x26')](function(){return _0xfaeac9;});})[_0x0e37('0x26')](function(){_0x4abe00[_0x0e37('0x1c')](0xcc)[_0x0e37('0x1d')]();});}};}function handleEntityNotFound(_0x48af39,_0x40e45b){return function(_0x4a71e4){if(!_0x4a71e4){_0x48af39[_0x0e37('0x1b')](0x194);}return _0x4a71e4;};}function handleError(_0x2d7b7f,_0x8668c4){_0x8668c4=_0x8668c4||0x1f4;return function(_0x4b1e6c){logger[_0x0e37('0x29')](_0x4b1e6c[_0x0e37('0x2a')]);if(_0x4b1e6c['name']){delete _0x4b1e6c[_0x0e37('0x2b')];}_0x2d7b7f['status'](_0x8668c4)[_0x0e37('0x2c')](_0x4b1e6c);};}exports['index']=function(_0x50b9ec,_0x54b43c){var _0x3e182f={},_0x2d9225={},_0x1ce8dc={'count':0x0,'rows':[]};var _0xa860c2=_[_0x0e37('0x2d')](db[_0x0e37('0x2e')]['rawAttributes'],function(_0xe6ea00){return{'name':_0xe6ea00['fieldName'],'type':_0xe6ea00[_0x0e37('0x2f')][_0x0e37('0x30')]};});_0x2d9225[_0x0e37('0x31')]=_[_0x0e37('0x2d')](_0xa860c2,'name');_0x2d9225['query']=_[_0x0e37('0x32')](_0x50b9ec[_0x0e37('0x33')]);_0x2d9225[_0x0e37('0x34')]=_['intersection'](_0x2d9225['model'],_0x2d9225[_0x0e37('0x33')]);_0x3e182f['attributes']=_['intersection'](_0x2d9225['model'],qs['fields'](_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x35')]));_0x3e182f['attributes']=_0x3e182f['attributes']['length']?_0x3e182f[_0x0e37('0x36')]:_0x2d9225[_0x0e37('0x31')];if(!_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x37')](_0x0e37('0x38'))){_0x3e182f[_0x0e37('0x20')]=qs[_0x0e37('0x20')](_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x20')]);_0x3e182f[_0x0e37('0x1e')]=qs[_0x0e37('0x1e')](_0x50b9ec[_0x0e37('0x33')]['offset']);}_0x3e182f['order']=qs[_0x0e37('0x39')](_0x50b9ec['query'][_0x0e37('0x39')]);_0x3e182f['where']=qs[_0x0e37('0x34')](_[_0x0e37('0x3a')](_0x50b9ec[_0x0e37('0x33')],_0x2d9225['filters']),_0xa860c2);if(_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x3b')]){_0x3e182f[_0x0e37('0x3c')]=_[_0x0e37('0x3d')](_0x3e182f[_0x0e37('0x3c')],{'$or':_[_0x0e37('0x2d')](_0xa860c2,function(_0x2dbb94){if(_0x2dbb94[_0x0e37('0x2f')]!==_0x0e37('0x3e')){var _0x23b1ad={};_0x23b1ad[_0x2dbb94[_0x0e37('0x2b')]]={'$like':'%'+_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x3b')]+'%'};return _0x23b1ad;}})});}_0x3e182f=_[_0x0e37('0x3d')]({},_0x3e182f,_0x50b9ec[_0x0e37('0x3f')]);var _0x350c31={'where':_0x3e182f[_0x0e37('0x3c')]};return db[_0x0e37('0x2e')][_0x0e37('0x21')](_0x350c31)[_0x0e37('0x26')](function(_0x489075){_0x1ce8dc[_0x0e37('0x21')]=_0x489075;if(_0x50b9ec[_0x0e37('0x33')][_0x0e37('0x40')]){_0x3e182f['include']=[{'all':!![]}];}return db[_0x0e37('0x2e')][_0x0e37('0x41')](_0x3e182f);})['then'](function(_0x427b13){_0x1ce8dc['rows']=_0x427b13;return _0x1ce8dc;})[_0x0e37('0x26')](respondWithFilteredResult(_0x54b43c,_0x3e182f))[_0x0e37('0x42')](handleError(_0x54b43c,null));};exports[_0x0e37('0x43')]=function(_0x38f180,_0x2a06f9){var _0x24e4a7={'raw':!![],'where':{'id':_0x38f180['params']['id']}},_0x3660f4={};_0x3660f4[_0x0e37('0x31')]=_['keys'](db['Sound']['rawAttributes']);_0x3660f4[_0x0e37('0x33')]=_[_0x0e37('0x32')](_0x38f180[_0x0e37('0x33')]);_0x3660f4['filters']=_[_0x0e37('0x44')](_0x3660f4[_0x0e37('0x31')],_0x3660f4[_0x0e37('0x33')]);_0x24e4a7[_0x0e37('0x36')]=_[_0x0e37('0x44')](_0x3660f4[_0x0e37('0x31')],qs[_0x0e37('0x35')](_0x38f180[_0x0e37('0x33')][_0x0e37('0x35')]));_0x24e4a7[_0x0e37('0x36')]=_0x24e4a7[_0x0e37('0x36')][_0x0e37('0x45')]?_0x24e4a7[_0x0e37('0x36')]:_0x3660f4['model'];if(_0x38f180[_0x0e37('0x33')][_0x0e37('0x40')]){_0x24e4a7[_0x0e37('0x46')]=[{'all':!![]}];}_0x24e4a7=_[_0x0e37('0x3d')]({},_0x24e4a7,_0x38f180[_0x0e37('0x3f')]);return db[_0x0e37('0x2e')]['find'](_0x24e4a7)[_0x0e37('0x26')](handleEntityNotFound(_0x2a06f9,null))[_0x0e37('0x26')](respondWithResult(_0x2a06f9,null))[_0x0e37('0x42')](handleError(_0x2a06f9,null));};exports['download']=function(_0x44db26,_0xec8ed0,_0x535cee){return db[_0x0e37('0x2e')][_0x0e37('0x47')]({'where':{'id':_0x44db26[_0x0e37('0x48')]['id']},'attributes':[_0x0e37('0x2b'),'save_name',_0x0e37('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0xec8ed0,null))[_0x0e37('0x26')](function(_0x314db7){if(_0x314db7){if(!fs[_0x0e37('0x4a')](path[_0x0e37('0x4b')](config['root'],_0x0e37('0x4c'),_0x314db7[_0x0e37('0x4d')]+'.'+_0x314db7['converted_format']))){throw new db[(_0x0e37('0x4e'))][(_0x0e37('0x4f'))](_0x0e37('0x50'));}return _0xec8ed0[_0x0e37('0x51')](path[_0x0e37('0x4b')](config[_0x0e37('0x52')],_0x0e37('0x4c'),util[_0x0e37('0x53')](_0x0e37('0x54'),_0x314db7[_0x0e37('0x4d')],_0x314db7['converted_format'])),util[_0x0e37('0x53')]('%s.%s',_0x314db7[_0x0e37('0x2b')],_0x314db7[_0x0e37('0x49')]));}return null;})['catch'](handleError(_0xec8ed0,null));};exports[_0x0e37('0x55')]=function(_0xca6c77,_0x57d7f7,_0xd25e04){var _0x2e5877={'name':path[_0x0e37('0x56')](_0xca6c77[_0x0e37('0x57')][_0x0e37('0x58')],path['extname'](_0xca6c77[_0x0e37('0x57')][_0x0e37('0x58')])),'save_name':path[_0x0e37('0x56')](_0xca6c77[_0x0e37('0x57')]['filename'],path['extname'](_0xca6c77[_0x0e37('0x57')]['filename'])),'original_format':path[_0x0e37('0x59')](_0xca6c77[_0x0e37('0x57')][_0x0e37('0x58')])['substring'](0x1),'converted_format':_0x0e37('0x5a')};var _0x42c36a=path[_0x0e37('0x4b')](config[_0x0e37('0x52')],_0x0e37('0x5b'),_0xca6c77[_0x0e37('0x57')]['filename']);var _0x4833b9=path[_0x0e37('0x4b')](config[_0x0e37('0x52')],_0x0e37('0x4c'),util[_0x0e37('0x53')](_0x0e37('0x54'),path['basename'](_0xca6c77['file'][_0x0e37('0x5c')],path[_0x0e37('0x59')](_0xca6c77['file'][_0x0e37('0x5c')])),_0x2e5877[_0x0e37('0x49')]));logger[_0x0e37('0x5d')](_0x0e37('0x5e'),_0x42c36a);logger[_0x0e37('0x5d')](_0x0e37('0x5f'),_0x4833b9);try{fs[_0x0e37('0x60')](_0x42c36a,parseInt('0777',0x8));var _0x3cda14=sox[_0x0e37('0x61')](_0x42c36a,_0x4833b9,{'sampleRate':0x1f40,'format':_0x0e37('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3cda14['on']('error',function(_0x79fcd2){fs[_0x0e37('0x62')](_0x42c36a);_0x57d7f7[_0x0e37('0x1c')](0x1f4)['send'](_0x79fcd2);});_0x3cda14['on'](_0x0e37('0x63'),function(_0x46530c){_0x2e5877['original_duration']=isNaN(_0x46530c[_0x0e37('0x64')])?null:_0x46530c[_0x0e37('0x64')]*0x3e8;_0x2e5877[_0x0e37('0x65')]=isNaN(_0x46530c[_0x0e37('0x66')])?null:_0x46530c[_0x0e37('0x66')];_0x2e5877[_0x0e37('0x67')]=isNaN(_0x46530c[_0x0e37('0x68')])?null:_0x46530c[_0x0e37('0x68')];_0x2e5877[_0x0e37('0x69')]=isNaN(_0x46530c[_0x0e37('0x6a')])?null:_0x46530c[_0x0e37('0x6a')];_0x2e5877[_0x0e37('0x6b')]=isNaN(_0x46530c[_0x0e37('0x6c')])?null:_0x46530c[_0x0e37('0x6c')];});_0x3cda14['on']('dest',function(_0x132b21){_0x2e5877['converted_duration']=isNaN(_0x132b21[_0x0e37('0x64')])?null:_0x132b21['duration']*0x3e8;_0x2e5877[_0x0e37('0x6d')]=isNaN(_0x132b21[_0x0e37('0x66')])?null:_0x132b21[_0x0e37('0x66')];_0x2e5877['converted_channelCount']=isNaN(_0x132b21['channelCount'])?null:_0x132b21[_0x0e37('0x68')];_0x2e5877[_0x0e37('0x6e')]=isNaN(_0x132b21[_0x0e37('0x6a')])?null:_0x132b21[_0x0e37('0x6a')];_0x2e5877[_0x0e37('0x6f')]=isNaN(_0x132b21[_0x0e37('0x6c')])?null:_0x132b21[_0x0e37('0x6c')];});_0x3cda14['on']('end',function(){fs[_0x0e37('0x60')](_0x4833b9,parseInt(_0x0e37('0x70'),0x8));return db['Sound'][_0x0e37('0x55')](_0x2e5877)[_0x0e37('0x26')](function(_0x54508d){var _0x581a40={'role':_0xca6c77[_0x0e37('0x71')]['role'],'userProfileId':_0xca6c77['body'][_0x0e37('0x72')]};if(!_0x581a40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x581a40[_0x0e37('0x73')]==='user'){var _0x2b851e=_0x54508d[_0x0e37('0x27')]({'plain':!![]});return db[_0x0e37('0x74')]['find']({'where':{'name':_0x0e37('0x75'),'userProfileId':_0x581a40[_0x0e37('0x72')]},'raw':!![]})['then'](function(_0x30be5c){if(_0x30be5c&&_0x30be5c[_0x0e37('0x76')]===0x0){return db[_0x0e37('0x77')]['create']({'name':_0x2b851e['name'],'resourceId':_0x2b851e['id'],'type':_0x30be5c['name'],'sectionId':_0x30be5c['id']},{})[_0x0e37('0x26')](function(){return _0x54508d;});}else{return _0x54508d;}})['catch'](function(_0x4c85c9){logger[_0x0e37('0x29')](_0x0e37('0x78'),_0x4c85c9);throw _0x4c85c9;});}return _0x54508d;})[_0x0e37('0x26')](respondWithResult(_0x57d7f7,null))[_0x0e37('0x42')](handleError(_0x57d7f7,null));});_0x3cda14[_0x0e37('0x79')]();}catch(_0x458173){_0x57d7f7[_0x0e37('0x1c')](0x1f4)[_0x0e37('0x2c')](_0x458173);}};exports[_0x0e37('0x25')]=function(_0x42978,_0x5624d8,_0x3761fa){return db[_0x0e37('0x2e')][_0x0e37('0x47')]({'where':{'id':_0x42978['params']['id']}})['then'](handleEntityNotFound(_0x5624d8,null))['then'](saveUpdates(_[_0x0e37('0x3a')](_0x42978[_0x0e37('0x71')],[_0x0e37('0x2b'),'description']),null))[_0x0e37('0x26')](respondWithResult(_0x5624d8,null))[_0x0e37('0x42')](handleError(_0x5624d8,null));};exports[_0x0e37('0x7a')]=function(_0x51895b,_0x39a4f5,_0x2a2a7c){return db[_0x0e37('0x2e')][_0x0e37('0x47')]({'where':{'id':_0x51895b[_0x0e37('0x48')]['id']}})[_0x0e37('0x26')](function(_0x403e90){if(_0x403e90){return _0x403e90[_0x0e37('0x28')]();}})[_0x0e37('0x26')](function(_0x212c4d){var _0x16ab36=path[_0x0e37('0x4b')](config[_0x0e37('0x52')],_0x0e37('0x5b'),util['format']('%s.%s',_0x212c4d[_0x0e37('0x4d')],_0x212c4d[_0x0e37('0x7b')]));var _0x356e76=path[_0x0e37('0x4b')](config[_0x0e37('0x52')],_0x0e37('0x4c'),util[_0x0e37('0x53')]('%s.%s',_0x212c4d[_0x0e37('0x4d')],_0x212c4d['converted_format']));fs[_0x0e37('0x62')](_0x16ab36);fs['unlinkSync'](_0x356e76);return _0x212c4d;})[_0x0e37('0x26')](function(_0x4d042f){if(_0x4d042f){return _0x39a4f5[_0x0e37('0x1c')](0xcc)[_0x0e37('0x1d')]();}})[_0x0e37('0x26')](handleEntityNotFound(_0x39a4f5,null))['catch'](handleError(_0x39a4f5,null));}; \ No newline at end of file +var _0x733b=['description','delete','%s.%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','status','error','name','send','index','map','Sound','rawAttributes','fieldName','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','download','save_name','converted_format','existsSync','join','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','create','basename','file','extname','originalname','filename','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','bitRate','converted_sampleRate','role','body','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update'];(function(_0x48033c,_0x2aa81b){var _0x17d8d0=function(_0x2bb8b2){while(--_0x2bb8b2){_0x48033c['push'](_0x48033c['shift']());}};_0x17d8d0(++_0x2aa81b);}(_0x733b,0xfd));var _0xb733=function(_0x3a7852,_0x155437){_0x3a7852=_0x3a7852-0x0;var _0x44145a=_0x733b[_0x3a7852];return _0x44145a;};'use strict';var emlformat=require(_0xb733('0x0'));var rimraf=require(_0xb733('0x1'));var zipdir=require(_0xb733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb733('0x3'));var moment=require(_0xb733('0x4'));var BPromise=require(_0xb733('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb733('0x6'));var sox=require('sox');var csv=require(_0xb733('0x7'));var ejs=require(_0xb733('0x8'));var fs=require('fs');var fs_extra=require(_0xb733('0x9'));var _=require(_0xb733('0xa'));var squel=require(_0xb733('0xb'));var crypto=require('crypto');var jsforce=require(_0xb733('0xc'));var deskjs=require(_0xb733('0xd'));var toCsv=require(_0xb733('0x7'));var querystring=require(_0xb733('0xe'));var Papa=require('papaparse');var Redis=require(_0xb733('0xf'));var authService=require(_0xb733('0x10'));var qs=require(_0xb733('0x11'));var as=require(_0xb733('0x12'));var hardwareService=require(_0xb733('0x13'));var logger=require(_0xb733('0x14'))(_0xb733('0x15'));var utils=require(_0xb733('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb733('0x17'))['db'];function respondWithStatusCode(_0x3466a5,_0x217eb7){_0x217eb7=_0x217eb7||0xcc;return function(_0x5a188d){if(_0x5a188d){return _0x3466a5[_0xb733('0x18')](_0x217eb7);}return _0x3466a5['status'](_0x217eb7)[_0xb733('0x19')]();};}function respondWithResult(_0x24db35,_0x571bf0){_0x571bf0=_0x571bf0||0xc8;return function(_0x4d53d2){if(_0x4d53d2){return _0x24db35['status'](_0x571bf0)['json'](_0x4d53d2);}};}function respondWithFilteredResult(_0x5c5deb,_0x48d428){return function(_0x4ee6f3){if(_0x4ee6f3){var _0x2369dc=typeof _0x48d428[_0xb733('0x1a')]==='undefined'&&typeof _0x48d428['limit']===_0xb733('0x1b');var _0x844ac6=_0x4ee6f3[_0xb733('0x1c')];var _0x5a0e64=_0x2369dc?0x0:_0x48d428[_0xb733('0x1a')];var _0x5eb5c9=_0x2369dc?_0x4ee6f3['count']:_0x48d428[_0xb733('0x1a')]+_0x48d428[_0xb733('0x1d')];var _0x3d532d;if(_0x5eb5c9>=_0x844ac6){_0x5eb5c9=_0x844ac6;_0x3d532d=0xc8;}else{_0x3d532d=0xce;}_0x5c5deb['status'](_0x3d532d);return _0x5c5deb[_0xb733('0x1e')](_0xb733('0x1f'),_0x5a0e64+'-'+_0x5eb5c9+'/'+_0x844ac6)[_0xb733('0x20')](_0x4ee6f3);}return null;};}function patchUpdates(_0x180dd6){return function(_0x981f35){try{jsonpatch[_0xb733('0x21')](_0x981f35,_0x180dd6,!![]);}catch(_0x1b20ae){return BPromise[_0xb733('0x22')](_0x1b20ae);}return _0x981f35[_0xb733('0x23')]();};}function saveUpdates(_0x3ea659,_0x4c200b){return function(_0x428505){if(_0x428505){return _0x428505['update'](_0x3ea659)[_0xb733('0x24')](function(_0x6782b5){return _0x6782b5;});}return null;};}function removeEntity(_0x434a73,_0x183022){return function(_0x1338e7){if(_0x1338e7){return _0x1338e7[_0xb733('0x25')]()[_0xb733('0x24')](function(){var _0x4e7a5f=_0x1338e7[_0xb733('0x26')]({'plain':!![]});var _0x547815=_0xb733('0x27');return db[_0xb733('0x28')]['destroy']({'where':{'type':_0x547815,'resourceId':_0x4e7a5f['id']}})[_0xb733('0x24')](function(){return _0x1338e7;});})[_0xb733('0x24')](function(){_0x434a73[_0xb733('0x29')](0xcc)[_0xb733('0x19')]();});}};}function handleEntityNotFound(_0x4592ae,_0x37fb5c){return function(_0x146641){if(!_0x146641){_0x4592ae[_0xb733('0x18')](0x194);}return _0x146641;};}function handleError(_0x3b5f79,_0x13935c){_0x13935c=_0x13935c||0x1f4;return function(_0x3da316){logger[_0xb733('0x2a')](_0x3da316['stack']);if(_0x3da316[_0xb733('0x2b')]){delete _0x3da316['name'];}_0x3b5f79[_0xb733('0x29')](_0x13935c)[_0xb733('0x2c')](_0x3da316);};}exports[_0xb733('0x2d')]=function(_0x2bfb21,_0x908b78){var _0xbaf8c3={},_0x55b7c3={},_0x5ea3f6={'count':0x0,'rows':[]};var _0x370e49=_[_0xb733('0x2e')](db[_0xb733('0x2f')][_0xb733('0x30')],function(_0x18b7b5){return{'name':_0x18b7b5[_0xb733('0x31')],'type':_0x18b7b5['type']['key']};});_0x55b7c3['model']=_['map'](_0x370e49,_0xb733('0x2b'));_0x55b7c3['query']=_['keys'](_0x2bfb21['query']);_0x55b7c3['filters']=_['intersection'](_0x55b7c3[_0xb733('0x32')],_0x55b7c3[_0xb733('0x33')]);_0xbaf8c3[_0xb733('0x34')]=_[_0xb733('0x35')](_0x55b7c3[_0xb733('0x32')],qs[_0xb733('0x36')](_0x2bfb21['query'][_0xb733('0x36')]));_0xbaf8c3['attributes']=_0xbaf8c3[_0xb733('0x34')][_0xb733('0x37')]?_0xbaf8c3[_0xb733('0x34')]:_0x55b7c3[_0xb733('0x32')];if(!_0x2bfb21[_0xb733('0x33')][_0xb733('0x38')](_0xb733('0x39'))){_0xbaf8c3[_0xb733('0x1d')]=qs[_0xb733('0x1d')](_0x2bfb21[_0xb733('0x33')][_0xb733('0x1d')]);_0xbaf8c3[_0xb733('0x1a')]=qs[_0xb733('0x1a')](_0x2bfb21[_0xb733('0x33')][_0xb733('0x1a')]);}_0xbaf8c3[_0xb733('0x3a')]=qs['sort'](_0x2bfb21[_0xb733('0x33')]['sort']);_0xbaf8c3[_0xb733('0x3b')]=qs[_0xb733('0x3c')](_[_0xb733('0x3d')](_0x2bfb21[_0xb733('0x33')],_0x55b7c3['filters']),_0x370e49);if(_0x2bfb21['query'][_0xb733('0x3e')]){_0xbaf8c3[_0xb733('0x3b')]=_[_0xb733('0x3f')](_0xbaf8c3['where'],{'$or':_[_0xb733('0x2e')](_0x370e49,function(_0xde0bf2){if(_0xde0bf2['type']!==_0xb733('0x40')){var _0x83e71a={};_0x83e71a[_0xde0bf2[_0xb733('0x2b')]]={'$like':'%'+_0x2bfb21[_0xb733('0x33')][_0xb733('0x3e')]+'%'};return _0x83e71a;}})});}_0xbaf8c3=_[_0xb733('0x3f')]({},_0xbaf8c3,_0x2bfb21[_0xb733('0x41')]);var _0x8df7f8={'where':_0xbaf8c3[_0xb733('0x3b')]};return db[_0xb733('0x2f')][_0xb733('0x1c')](_0x8df7f8)['then'](function(_0xd87e1e){_0x5ea3f6[_0xb733('0x1c')]=_0xd87e1e;if(_0x2bfb21['query'][_0xb733('0x42')]){_0xbaf8c3[_0xb733('0x43')]=[{'all':!![]}];}return db[_0xb733('0x2f')][_0xb733('0x44')](_0xbaf8c3);})['then'](function(_0x87a151){_0x5ea3f6[_0xb733('0x45')]=_0x87a151;return _0x5ea3f6;})[_0xb733('0x24')](respondWithFilteredResult(_0x908b78,_0xbaf8c3))[_0xb733('0x46')](handleError(_0x908b78,null));};exports['show']=function(_0x209556,_0xc50bbe){var _0x2124a7={'raw':!![],'where':{'id':_0x209556[_0xb733('0x47')]['id']}},_0x1caa22={};_0x1caa22[_0xb733('0x32')]=_[_0xb733('0x48')](db[_0xb733('0x2f')]['rawAttributes']);_0x1caa22['query']=_[_0xb733('0x48')](_0x209556[_0xb733('0x33')]);_0x1caa22[_0xb733('0x3c')]=_[_0xb733('0x35')](_0x1caa22[_0xb733('0x32')],_0x1caa22['query']);_0x2124a7[_0xb733('0x34')]=_[_0xb733('0x35')](_0x1caa22[_0xb733('0x32')],qs[_0xb733('0x36')](_0x209556[_0xb733('0x33')][_0xb733('0x36')]));_0x2124a7[_0xb733('0x34')]=_0x2124a7[_0xb733('0x34')][_0xb733('0x37')]?_0x2124a7[_0xb733('0x34')]:_0x1caa22[_0xb733('0x32')];if(_0x209556[_0xb733('0x33')][_0xb733('0x42')]){_0x2124a7[_0xb733('0x43')]=[{'all':!![]}];}_0x2124a7=_['merge']({},_0x2124a7,_0x209556[_0xb733('0x41')]);return db[_0xb733('0x2f')][_0xb733('0x49')](_0x2124a7)[_0xb733('0x24')](handleEntityNotFound(_0xc50bbe,null))[_0xb733('0x24')](respondWithResult(_0xc50bbe,null))[_0xb733('0x46')](handleError(_0xc50bbe,null));};exports[_0xb733('0x4a')]=function(_0x5cb58c,_0x27e46a,_0x3132d3){return db[_0xb733('0x2f')][_0xb733('0x49')]({'where':{'id':_0x5cb58c[_0xb733('0x47')]['id']},'attributes':[_0xb733('0x2b'),_0xb733('0x4b'),_0xb733('0x4c')],'raw':!![]})[_0xb733('0x24')](handleEntityNotFound(_0x27e46a,null))[_0xb733('0x24')](function(_0x580843){if(_0x580843){if(!fs[_0xb733('0x4d')](path[_0xb733('0x4e')](config['root'],'server/files/sounds/converted',_0x580843[_0xb733('0x4b')]+'.'+_0x580843[_0xb733('0x4c')]))){throw new db[(_0xb733('0x4f'))][(_0xb733('0x50'))](_0xb733('0x51'));}return _0x27e46a['download'](path[_0xb733('0x4e')](config['root'],_0xb733('0x52'),util[_0xb733('0x53')]('%s.%s',_0x580843['save_name'],_0x580843[_0xb733('0x4c')])),util[_0xb733('0x53')]('%s.%s',_0x580843['name'],_0x580843[_0xb733('0x4c')]));}return null;})[_0xb733('0x46')](handleError(_0x27e46a,null));};exports[_0xb733('0x54')]=function(_0x3ff2ea,_0x292e90,_0x47713c){var _0x42f919={'name':path[_0xb733('0x55')](_0x3ff2ea[_0xb733('0x56')]['originalname'],path[_0xb733('0x57')](_0x3ff2ea['file'][_0xb733('0x58')])),'save_name':path[_0xb733('0x55')](_0x3ff2ea[_0xb733('0x56')][_0xb733('0x59')],path[_0xb733('0x57')](_0x3ff2ea['file'][_0xb733('0x59')])),'original_format':path[_0xb733('0x57')](_0x3ff2ea['file']['originalname'])[_0xb733('0x5a')](0x1),'converted_format':_0xb733('0x5b')};var _0xf2f2d7=path['join'](config[_0xb733('0x5c')],_0xb733('0x5d'),_0x3ff2ea['file'][_0xb733('0x59')]);var _0x1db30b=path[_0xb733('0x4e')](config[_0xb733('0x5c')],_0xb733('0x52'),util[_0xb733('0x53')]('%s.%s',path[_0xb733('0x55')](_0x3ff2ea['file'][_0xb733('0x59')],path[_0xb733('0x57')](_0x3ff2ea[_0xb733('0x56')][_0xb733('0x59')])),_0x42f919[_0xb733('0x4c')]));logger[_0xb733('0x5e')](_0xb733('0x5f'),_0xf2f2d7);logger[_0xb733('0x5e')](_0xb733('0x60'),_0x1db30b);try{fs[_0xb733('0x61')](_0xf2f2d7,parseInt(_0xb733('0x62'),0x8));var _0x3b0a9d=sox['transcode'](_0xf2f2d7,_0x1db30b,{'sampleRate':0x1f40,'format':_0xb733('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b0a9d['on']('error',function(_0x339285){fs[_0xb733('0x63')](_0xf2f2d7);_0x292e90[_0xb733('0x29')](0x1f4)['send'](_0x339285);});_0x3b0a9d['on'](_0xb733('0x64'),function(_0x3af95e){_0x42f919[_0xb733('0x65')]=isNaN(_0x3af95e[_0xb733('0x66')])?null:_0x3af95e['duration']*0x3e8;_0x42f919['original_sampleCount']=isNaN(_0x3af95e[_0xb733('0x67')])?null:_0x3af95e[_0xb733('0x67')];_0x42f919[_0xb733('0x68')]=isNaN(_0x3af95e['channelCount'])?null:_0x3af95e[_0xb733('0x69')];_0x42f919[_0xb733('0x6a')]=isNaN(_0x3af95e['bitRate'])?null:_0x3af95e['bitRate'];_0x42f919['original_sampleRate']=isNaN(_0x3af95e[_0xb733('0x6b')])?null:_0x3af95e[_0xb733('0x6b')];});_0x3b0a9d['on'](_0xb733('0x6c'),function(_0x22cb64){_0x42f919[_0xb733('0x6d')]=isNaN(_0x22cb64[_0xb733('0x66')])?null:_0x22cb64['duration']*0x3e8;_0x42f919[_0xb733('0x6e')]=isNaN(_0x22cb64[_0xb733('0x67')])?null:_0x22cb64[_0xb733('0x67')];_0x42f919['converted_channelCount']=isNaN(_0x22cb64[_0xb733('0x69')])?null:_0x22cb64['channelCount'];_0x42f919[_0xb733('0x6f')]=isNaN(_0x22cb64['bitRate'])?null:_0x22cb64[_0xb733('0x70')];_0x42f919[_0xb733('0x71')]=isNaN(_0x22cb64['sampleRate'])?null:_0x22cb64[_0xb733('0x6b')];});_0x3b0a9d['on']('end',function(){fs[_0xb733('0x61')](_0x1db30b,parseInt(_0xb733('0x62'),0x8));return db[_0xb733('0x2f')][_0xb733('0x54')](_0x42f919)[_0xb733('0x24')](function(_0x3d7a75){var _0xdfbbd4={'role':_0x3ff2ea['body'][_0xb733('0x72')],'userProfileId':_0x3ff2ea[_0xb733('0x73')][_0xb733('0x74')]};if(!_0xdfbbd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdfbbd4[_0xb733('0x72')]===_0xb733('0x75')){var _0x24ec0f=_0x3d7a75['get']({'plain':!![]});return db[_0xb733('0x76')][_0xb733('0x49')]({'where':{'name':'Sounds','userProfileId':_0xdfbbd4[_0xb733('0x74')]},'raw':!![]})[_0xb733('0x24')](function(_0x2e10c3){if(_0x2e10c3&&_0x2e10c3['autoAssociation']===0x0){return db[_0xb733('0x28')]['create']({'name':_0x24ec0f[_0xb733('0x2b')],'resourceId':_0x24ec0f['id'],'type':_0x2e10c3[_0xb733('0x2b')],'sectionId':_0x2e10c3['id']},{})[_0xb733('0x24')](function(){return _0x3d7a75;});}else{return _0x3d7a75;}})['catch'](function(_0x330d4e){logger[_0xb733('0x2a')](_0xb733('0x77'),_0x330d4e);throw _0x330d4e;});}return _0x3d7a75;})[_0xb733('0x24')](respondWithResult(_0x292e90,null))[_0xb733('0x46')](handleError(_0x292e90,null));});_0x3b0a9d[_0xb733('0x78')]();}catch(_0x16ecba){_0x292e90[_0xb733('0x29')](0x1f4)['send'](_0x16ecba);}};exports[_0xb733('0x79')]=function(_0x24600b,_0x2c438a,_0x1f6cbb){return db[_0xb733('0x2f')][_0xb733('0x49')]({'where':{'id':_0x24600b[_0xb733('0x47')]['id']}})[_0xb733('0x24')](handleEntityNotFound(_0x2c438a,null))[_0xb733('0x24')](saveUpdates(_[_0xb733('0x3d')](_0x24600b[_0xb733('0x73')],['name',_0xb733('0x7a')]),null))[_0xb733('0x24')](respondWithResult(_0x2c438a,null))[_0xb733('0x46')](handleError(_0x2c438a,null));};exports[_0xb733('0x7b')]=function(_0x2d97aa,_0x2fd84c,_0x32687c){return db['Sound'][_0xb733('0x49')]({'where':{'id':_0x2d97aa[_0xb733('0x47')]['id']}})['then'](function(_0x3b0063){if(_0x3b0063){return _0x3b0063[_0xb733('0x25')]();}})[_0xb733('0x24')](function(_0x1f774e){var _0x5c4d17=path[_0xb733('0x4e')](config['root'],'server/files/sounds/original',util['format']('%s.%s',_0x1f774e['save_name'],_0x1f774e['original_format']));var _0x5eabd7=path[_0xb733('0x4e')](config[_0xb733('0x5c')],'server/files/sounds/converted',util['format'](_0xb733('0x7c'),_0x1f774e[_0xb733('0x4b')],_0x1f774e[_0xb733('0x4c')]));fs[_0xb733('0x63')](_0x5c4d17);fs[_0xb733('0x63')](_0x5eabd7);return _0x1f774e;})[_0xb733('0x24')](function(_0x131545){if(_0x131545){return _0x2fd84c[_0xb733('0x29')](0xcc)[_0xb733('0x19')]();}})[_0xb733('0x24')](handleEntityNotFound(_0x2fd84c,null))['catch'](handleError(_0x2fd84c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6efc645..def18dc 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 _0xc298=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds'];(function(_0x38617,_0x363518){var _0x14f6cf=function(_0x46d695){while(--_0x46d695){_0x38617['push'](_0x38617['shift']());}};_0x14f6cf(++_0x363518);}(_0xc298,0x138));var _0x8c29=function(_0x546336,_0x1d4fd6){_0x546336=_0x546336-0x0;var _0x141043=_0xc298[_0x546336];return _0x141043;};'use strict';var _=require(_0x8c29('0x0'));var util=require('util');var logger=require(_0x8c29('0x1'))('api');var moment=require(_0x8c29('0x2'));var BPromise=require(_0x8c29('0x3'));var rp=require(_0x8c29('0x4'));var fs=require('fs');var path=require(_0x8c29('0x5'));var rimraf=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var attributes=require(_0x8c29('0x8'));module[_0x8c29('0x9')]=function(_0x5898e2,_0x1bca75){return _0x5898e2[_0x8c29('0xa')]('Sound',attributes,{'tableName':_0x8c29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2151=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2151,0xed));var _0x1215=function(_0x147430,_0x73ef01){_0x147430=_0x147430-0x0;var _0x39f81d=_0x2151[_0x147430];return _0x39f81d;};'use strict';var _=require(_0x1215('0x0'));var util=require(_0x1215('0x1'));var logger=require(_0x1215('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1215('0x3'));var rp=require(_0x1215('0x4'));var fs=require('fs');var path=require(_0x1215('0x5'));var rimraf=require(_0x1215('0x6'));var config=require(_0x1215('0x7'));var attributes=require('./sound.attributes');module[_0x1215('0x8')]=function(_0x18b7ce,_0x11b2b8){return _0x18b7ce[_0x1215('0x9')](_0x1215('0xa'),attributes,{'tableName':_0x1215('0xb'),'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 9216e7d..bc91274 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 _0xe525=['util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','Sound','find','options','where','attributes','include','map','model','debug','ShowSound'];(function(_0x573050,_0x50e171){var _0x2029c6=function(_0x11e888){while(--_0x11e888){_0x573050['push'](_0x573050['shift']());}};_0x2029c6(++_0x50e171);}(_0xe525,0xe8));var _0x5e52=function(_0x3abde4,_0x4076e2){_0x3abde4=_0x3abde4-0x0;var _0x96f3cc=_0xe525[_0x3abde4];return _0x96f3cc;};'use strict';var _=require('lodash');var util=require(_0x5e52('0x0'));var moment=require('moment');var BPromise=require(_0x5e52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e52('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e52('0x3'))(_0x5e52('0x4'));var config=require(_0x5e52('0x5'));var jayson=require(_0x5e52('0x6'));var client=jayson[_0x5e52('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59cdb8,_0x37cc02,_0x1cc6fe){return new BPromise(function(_0x271cfa,_0x1b597e){return client['request'](_0x59cdb8,_0x1cc6fe)[_0x5e52('0x8')](function(_0x1f2eaf){logger[_0x5e52('0x9')](_0x5e52('0xa'),_0x37cc02,'request\x20sent');logger['debug'](_0x5e52('0xb'),_0x37cc02,_0x5e52('0xc'),JSON[_0x5e52('0xd')](_0x1f2eaf));if(_0x1f2eaf['error']){if(_0x1f2eaf['error'][_0x5e52('0xe')]===0x1f4){logger['error'](_0x5e52('0xa'),_0x37cc02,_0x1f2eaf['error']['message']);return _0x1b597e(_0x1f2eaf['error']['message']);}logger['error'](_0x5e52('0xa'),_0x37cc02,_0x1f2eaf[_0x5e52('0xf')][_0x5e52('0x10')]);return _0x271cfa(_0x1f2eaf[_0x5e52('0xf')][_0x5e52('0x10')]);}else{logger[_0x5e52('0x9')](_0x5e52('0xa'),_0x37cc02,_0x5e52('0xc'));_0x271cfa(_0x1f2eaf[_0x5e52('0x11')][_0x5e52('0x10')]);}})[_0x5e52('0x12')](function(_0x505f1c){logger[_0x5e52('0xf')](_0x5e52('0xa'),_0x37cc02,_0x505f1c);_0x1b597e(_0x505f1c);});});}exports['ShowSound']=function(_0x4ed8ab){var _0xd1f45a=this;return new Promise(function(_0x3c84f9,_0x43533f){return db[_0x5e52('0x13')][_0x5e52('0x14')]({'raw':_0x4ed8ab[_0x5e52('0x15')]?_0x4ed8ab[_0x5e52('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4ed8ab[_0x5e52('0x15')]?_0x4ed8ab[_0x5e52('0x15')][_0x5e52('0x16')]||null:null,'attributes':_0x4ed8ab[_0x5e52('0x15')]?_0x4ed8ab['options'][_0x5e52('0x17')]||null:null,'include':_0x4ed8ab[_0x5e52('0x15')]?_0x4ed8ab[_0x5e52('0x15')][_0x5e52('0x18')]?_[_0x5e52('0x19')](_0x4ed8ab[_0x5e52('0x15')][_0x5e52('0x18')],function(_0x30806f){return{'model':db[_0x30806f[_0x5e52('0x1a')]],'as':_0x30806f['as'],'attributes':_0x30806f[_0x5e52('0x17')],'include':_0x30806f[_0x5e52('0x18')]?_['map'](_0x30806f[_0x5e52('0x18')],function(_0x49b8bb){return{'model':db[_0x49b8bb['model']],'as':_0x49b8bb['as'],'attributes':_0x49b8bb[_0x5e52('0x17')],'include':_0x49b8bb[_0x5e52('0x18')]?_[_0x5e52('0x19')](_0x49b8bb[_0x5e52('0x18')],function(_0x25060a){return{'model':db[_0x25060a[_0x5e52('0x1a')]],'as':_0x25060a['as'],'attributes':_0x25060a[_0x5e52('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5e52('0x8')](function(_0x4ac15e){logger[_0x5e52('0x9')]('ShowSound',_0x4ed8ab);logger[_0x5e52('0x1b')](_0x5e52('0x1c'),_0x4ed8ab,JSON[_0x5e52('0xd')](_0x4ac15e));_0x3c84f9(_0x4ac15e);})[_0x5e52('0x12')](function(_0x1e5478){logger[_0x5e52('0xf')](_0x5e52('0x1c'),_0x1e5478[_0x5e52('0x10')],_0x4ed8ab);_0x43533f(_0xd1f45a[_0x5e52('0xf')](0x1f4,_0x1e5478[_0x5e52('0x10')]));});});}; \ No newline at end of file +var _0x6e07=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','util','moment','ioredis'];(function(_0x562177,_0x140ad7){var _0x5805bd=function(_0x3c7a8){while(--_0x3c7a8){_0x562177['push'](_0x562177['shift']());}};_0x5805bd(++_0x140ad7);}(_0x6e07,0x15d));var _0x76e0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6e07[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x76e0('0x0'));var moment=require(_0x76e0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76e0('0x2'));var db=require(_0x76e0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76e0('0x4'))(_0x76e0('0x5'));var config=require(_0x76e0('0x6'));var jayson=require(_0x76e0('0x7'));var client=jayson[_0x76e0('0x8')][_0x76e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa06d,_0x549127,_0x48a9ed){return new BPromise(function(_0x20821f,_0x10ade8){return client[_0x76e0('0xa')](_0x2fa06d,_0x48a9ed)[_0x76e0('0xb')](function(_0x1bf3b9){logger[_0x76e0('0xc')](_0x76e0('0xd'),_0x549127,_0x76e0('0xe'));logger[_0x76e0('0xf')](_0x76e0('0x10'),_0x549127,_0x76e0('0xe'),JSON[_0x76e0('0x11')](_0x1bf3b9));if(_0x1bf3b9['error']){if(_0x1bf3b9['error'][_0x76e0('0x12')]===0x1f4){logger[_0x76e0('0x13')](_0x76e0('0xd'),_0x549127,_0x1bf3b9['error'][_0x76e0('0x14')]);return _0x10ade8(_0x1bf3b9[_0x76e0('0x13')]['message']);}logger[_0x76e0('0x13')](_0x76e0('0xd'),_0x549127,_0x1bf3b9[_0x76e0('0x13')]['message']);return _0x20821f(_0x1bf3b9[_0x76e0('0x13')][_0x76e0('0x14')]);}else{logger[_0x76e0('0xc')]('Sound,\x20%s,\x20%s',_0x549127,_0x76e0('0xe'));_0x20821f(_0x1bf3b9['result'][_0x76e0('0x14')]);}})[_0x76e0('0x15')](function(_0xdc7834){logger['error']('Sound,\x20%s,\x20%s',_0x549127,_0xdc7834);_0x10ade8(_0xdc7834);});});}exports[_0x76e0('0x16')]=function(_0x46c41a){var _0x12cc30=this;return new Promise(function(_0x19159f,_0x3bf761){return db[_0x76e0('0x17')][_0x76e0('0x18')]({'raw':_0x46c41a['options']?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1b')]||null:null,'attributes':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1c')]||null:null,'include':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1d')]?_[_0x76e0('0x1e')](_0x46c41a['options'][_0x76e0('0x1d')],function(_0x29b532){return{'model':db[_0x29b532[_0x76e0('0x1f')]],'as':_0x29b532['as'],'attributes':_0x29b532['attributes'],'include':_0x29b532[_0x76e0('0x1d')]?_['map'](_0x29b532['include'],function(_0x573293){return{'model':db[_0x573293[_0x76e0('0x1f')]],'as':_0x573293['as'],'attributes':_0x573293['attributes'],'include':_0x573293[_0x76e0('0x1d')]?_['map'](_0x573293[_0x76e0('0x1d')],function(_0x140b53){return{'model':db[_0x140b53[_0x76e0('0x1f')]],'as':_0x140b53['as'],'attributes':_0x140b53[_0x76e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x76e0('0xb')](function(_0x511e53){logger['info'](_0x76e0('0x16'),_0x46c41a);logger[_0x76e0('0xf')]('ShowSound',_0x46c41a,JSON['stringify'](_0x511e53));_0x19159f(_0x511e53);})[_0x76e0('0x15')](function(_0x284a10){logger['error'](_0x76e0('0x16'),_0x284a10[_0x76e0('0x14')],_0x46c41a);_0x3bf761(_0x12cc30[_0x76e0('0x13')](0x1f4,_0x284a10[_0x76e0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 441f542..f938257 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x3a16be,_0x15899a){var _0x2be480=function(_0x4f6b97){while(--_0x4f6b97){_0x3a16be['push'](_0x3a16be['shift']());}};_0x2be480(++_0x15899a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x99fb50,_0x5354ad){var _0x180a41=function(_0x2e4646){while(--_0x2e4646){_0x99fb50['push'](_0x99fb50['shift']());}};_0x180a41(++_0x5354ad);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e22fe8f..5589780 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 _0x39b5=['ENUM','out','sequelize','exports','STRING','medium'];(function(_0x4cfd78,_0x52355e){var _0xf4a95a=function(_0x5c2d5b){while(--_0x5c2d5b){_0x4cfd78['push'](_0x4cfd78['shift']());}};_0xf4a95a(++_0x52355e);}(_0x39b5,0xe6));var _0x539b=function(_0xc3a516,_0x32c235){_0xc3a516=_0xc3a516-0x0;var _0x1aec8a=_0x39b5[_0xc3a516];return _0x1aec8a;};'use strict';var Sequelize=require(_0x539b('0x0'));module[_0x539b('0x1')]={'uniqueid':{'type':Sequelize[_0x539b('0x2')]},'body':{'type':Sequelize['TEXT'](_0x539b('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x539b('0x4')]('in','out'),'defaultValue':_0x539b('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x539b('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6fd7=['STRING','medium','ENUM','out','TEXT','sequelize','exports'];(function(_0x336f98,_0x3aa428){var _0x97f6bf=function(_0x151702){while(--_0x151702){_0x336f98['push'](_0x336f98['shift']());}};_0x97f6bf(++_0x3aa428);}(_0x6fd7,0x14e));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x76fd('0x0'));module[_0x76fd('0x1')]={'uniqueid':{'type':Sequelize[_0x76fd('0x2')]},'body':{'type':Sequelize['TEXT'](_0x76fd('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x76fd('0x4')]('in',_0x76fd('0x5')),'defaultValue':_0x76fd('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x76fd('0x2')]},'providerResponse':{'type':Sequelize[_0x76fd('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index d4bc4d0..4529b6c 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 _0xa9e1=['ioredis','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa9e1,0x7a));var _0x1a9e=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xa9e1[_0xacb1e2];return _0x463815;};'use strict';var emlformat=require(_0x1a9e('0x0'));var rimraf=require(_0x1a9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a9e('0x2'));var rp=require(_0x1a9e('0x3'));var moment=require(_0x1a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a9e('0x5'));var util=require('util');var path=require(_0x1a9e('0x6'));var sox=require('sox');var csv=require(_0x1a9e('0x7'));var ejs=require(_0x1a9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1a9e('0x9'));var _=require(_0x1a9e('0xa'));var squel=require(_0x1a9e('0xb'));var crypto=require(_0x1a9e('0xc'));var jsforce=require(_0x1a9e('0xd'));var deskjs=require(_0x1a9e('0xe'));var toCsv=require(_0x1a9e('0x7'));var querystring=require(_0x1a9e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a9e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a9e('0x11'));var logger=require('../../config/logger')(_0x1a9e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ac0e,_0x4f6319){_0x4f6319=_0x4f6319||0xcc;return function(_0xe41277){if(_0xe41277){return _0x27ac0e[_0x1a9e('0x14')](_0x4f6319);}return _0x27ac0e[_0x1a9e('0x15')](_0x4f6319)[_0x1a9e('0x16')]();};}function respondWithResult(_0x6cf4d0,_0x1ac5aa){_0x1ac5aa=_0x1ac5aa||0xc8;return function(_0x39c1c0){if(_0x39c1c0){return _0x6cf4d0[_0x1a9e('0x15')](_0x1ac5aa)['json'](_0x39c1c0);}};}function respondWithFilteredResult(_0x2beade,_0x1a9aed){return function(_0x3d51bd){if(_0x3d51bd){var _0x3540d=typeof _0x1a9aed[_0x1a9e('0x17')]==='undefined'&&typeof _0x1a9aed[_0x1a9e('0x18')]===_0x1a9e('0x19');var _0xfe073f=_0x3d51bd['count'];var _0x44f39e=_0x3540d?0x0:_0x1a9aed[_0x1a9e('0x17')];var _0x3869cb=_0x3540d?_0x3d51bd[_0x1a9e('0x1a')]:_0x1a9aed[_0x1a9e('0x17')]+_0x1a9aed[_0x1a9e('0x18')];var _0x52df94;if(_0x3869cb>=_0xfe073f){_0x3869cb=_0xfe073f;_0x52df94=0xc8;}else{_0x52df94=0xce;}_0x2beade[_0x1a9e('0x15')](_0x52df94);return _0x2beade[_0x1a9e('0x1b')](_0x1a9e('0x1c'),_0x44f39e+'-'+_0x3869cb+'/'+_0xfe073f)[_0x1a9e('0x1d')](_0x3d51bd);}return null;};}function patchUpdates(_0x89a640){return function(_0x19d859){try{jsonpatch[_0x1a9e('0x1e')](_0x19d859,_0x89a640,!![]);}catch(_0x106385){return BPromise['reject'](_0x106385);}return _0x19d859[_0x1a9e('0x1f')]();};}function saveUpdates(_0x3e517e,_0x10ab8a){return function(_0x194778){if(_0x194778){return _0x194778[_0x1a9e('0x20')](_0x3e517e)[_0x1a9e('0x21')](function(_0x19b3d7){return _0x19b3d7;});}return null;};}function removeEntity(_0x2f8ed6,_0x21aa68){return function(_0x5cbf91){if(_0x5cbf91){return _0x5cbf91[_0x1a9e('0x22')]()['then'](function(){_0x2f8ed6[_0x1a9e('0x15')](0xcc)[_0x1a9e('0x16')]();});}};}function handleEntityNotFound(_0x2953ac,_0x279df5){return function(_0x33b453){if(!_0x33b453){_0x2953ac[_0x1a9e('0x14')](0x194);}return _0x33b453;};}function handleError(_0x464fba,_0x54ba8e){_0x54ba8e=_0x54ba8e||0x1f4;return function(_0x1f660f){logger[_0x1a9e('0x23')](_0x1f660f['stack']);if(_0x1f660f['name']){delete _0x1f660f[_0x1a9e('0x24')];}_0x464fba[_0x1a9e('0x15')](_0x54ba8e)[_0x1a9e('0x25')](_0x1f660f);};}exports[_0x1a9e('0x26')]=function(_0x44b3df,_0x3acd58){var _0x45474e={},_0x13aa7a={},_0x204f9c={'count':0x0,'rows':[]};var _0x275256=_[_0x1a9e('0x27')](db[_0x1a9e('0x28')][_0x1a9e('0x29')],function(_0x443707){return{'name':_0x443707['fieldName'],'type':_0x443707[_0x1a9e('0x2a')]['key']};});_0x13aa7a[_0x1a9e('0x2b')]=_[_0x1a9e('0x27')](_0x275256,_0x1a9e('0x24'));_0x13aa7a[_0x1a9e('0x2c')]=_[_0x1a9e('0x2d')](_0x44b3df[_0x1a9e('0x2c')]);_0x13aa7a['filters']=_[_0x1a9e('0x2e')](_0x13aa7a[_0x1a9e('0x2b')],_0x13aa7a[_0x1a9e('0x2c')]);_0x45474e[_0x1a9e('0x2f')]=_[_0x1a9e('0x2e')](_0x13aa7a['model'],qs[_0x1a9e('0x30')](_0x44b3df[_0x1a9e('0x2c')][_0x1a9e('0x30')]));_0x45474e[_0x1a9e('0x2f')]=_0x45474e[_0x1a9e('0x2f')]['length']?_0x45474e['attributes']:_0x13aa7a['model'];if(!_0x44b3df[_0x1a9e('0x2c')][_0x1a9e('0x31')](_0x1a9e('0x32'))){_0x45474e['limit']=qs[_0x1a9e('0x18')](_0x44b3df[_0x1a9e('0x2c')][_0x1a9e('0x18')]);_0x45474e[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0x44b3df['query']['offset']);}_0x45474e[_0x1a9e('0x33')]=qs[_0x1a9e('0x34')](_0x44b3df[_0x1a9e('0x2c')]['sort']);_0x45474e['where']=qs[_0x1a9e('0x35')](_[_0x1a9e('0x36')](_0x44b3df['query'],_0x13aa7a[_0x1a9e('0x35')]),_0x275256);if(_0x44b3df[_0x1a9e('0x2c')]['filter']){_0x45474e[_0x1a9e('0x37')]=_[_0x1a9e('0x38')](_0x45474e['where'],{'$or':_[_0x1a9e('0x27')](_0x275256,function(_0x18a726){if(_0x18a726[_0x1a9e('0x2a')]!=='VIRTUAL'){var _0x2531c1={};_0x2531c1[_0x18a726['name']]={'$like':'%'+_0x44b3df[_0x1a9e('0x2c')][_0x1a9e('0x39')]+'%'};return _0x2531c1;}})});}_0x45474e=_[_0x1a9e('0x38')]({},_0x45474e,_0x44b3df[_0x1a9e('0x3a')]);var _0x1c2770={'where':_0x45474e['where']};return db['SquareMessage'][_0x1a9e('0x1a')](_0x1c2770)[_0x1a9e('0x21')](function(_0x468f82){_0x204f9c[_0x1a9e('0x1a')]=_0x468f82;if(_0x44b3df['query'][_0x1a9e('0x3b')]){_0x45474e[_0x1a9e('0x3c')]=[{'all':!![]}];}return db[_0x1a9e('0x28')][_0x1a9e('0x3d')](_0x45474e);})[_0x1a9e('0x21')](function(_0xeb3e58){_0x204f9c[_0x1a9e('0x3e')]=_0xeb3e58;return _0x204f9c;})[_0x1a9e('0x21')](respondWithFilteredResult(_0x3acd58,_0x45474e))[_0x1a9e('0x3f')](handleError(_0x3acd58,null));};exports['show']=function(_0x2c83f1,_0x54c421){var _0x5d9372={'raw':!![],'where':{'id':_0x2c83f1[_0x1a9e('0x40')]['id']}},_0x124c86={};_0x124c86[_0x1a9e('0x2b')]=_[_0x1a9e('0x2d')](db['SquareMessage'][_0x1a9e('0x29')]);_0x124c86['query']=_[_0x1a9e('0x2d')](_0x2c83f1[_0x1a9e('0x2c')]);_0x124c86[_0x1a9e('0x35')]=_['intersection'](_0x124c86[_0x1a9e('0x2b')],_0x124c86[_0x1a9e('0x2c')]);_0x5d9372['attributes']=_[_0x1a9e('0x2e')](_0x124c86[_0x1a9e('0x2b')],qs[_0x1a9e('0x30')](_0x2c83f1[_0x1a9e('0x2c')]['fields']));_0x5d9372[_0x1a9e('0x2f')]=_0x5d9372[_0x1a9e('0x2f')][_0x1a9e('0x41')]?_0x5d9372['attributes']:_0x124c86[_0x1a9e('0x2b')];if(_0x2c83f1[_0x1a9e('0x2c')][_0x1a9e('0x3b')]){_0x5d9372[_0x1a9e('0x3c')]=[{'all':!![]}];}_0x5d9372=_[_0x1a9e('0x38')]({},_0x5d9372,_0x2c83f1[_0x1a9e('0x3a')]);return db[_0x1a9e('0x28')][_0x1a9e('0x42')](_0x5d9372)[_0x1a9e('0x21')](handleEntityNotFound(_0x54c421,null))[_0x1a9e('0x21')](respondWithResult(_0x54c421,null))['catch'](handleError(_0x54c421,null));};exports[_0x1a9e('0x43')]=function(_0x2c741d,_0x32908e){return db[_0x1a9e('0x28')]['create'](_0x2c741d[_0x1a9e('0x44')],{})[_0x1a9e('0x21')](respondWithResult(_0x32908e,0xc9))[_0x1a9e('0x3f')](handleError(_0x32908e,null));};exports[_0x1a9e('0x20')]=function(_0x29133e,_0x231526){if(_0x29133e[_0x1a9e('0x44')]['id']){delete _0x29133e[_0x1a9e('0x44')]['id'];}return db[_0x1a9e('0x28')]['find']({'where':{'id':_0x29133e[_0x1a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x231526,null))['then'](saveUpdates(_0x29133e[_0x1a9e('0x44')],null))[_0x1a9e('0x21')](respondWithResult(_0x231526,null))[_0x1a9e('0x3f')](handleError(_0x231526,null));};exports[_0x1a9e('0x22')]=function(_0xe6025e,_0x1e00aa){return db[_0x1a9e('0x28')]['find']({'where':{'id':_0xe6025e[_0x1a9e('0x40')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x1e00aa,null))[_0x1a9e('0x21')](removeEntity(_0x1e00aa,null))[_0x1a9e('0x3f')](handleError(_0x1e00aa,null));}; \ No newline at end of file +var _0x1921=['show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','reject','save','update','destroy','then','sendStatus','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','options','include','rows','catch'];(function(_0x2d4093,_0x32e7d2){var _0x336afe=function(_0x4297c7){while(--_0x4297c7){_0x2d4093['push'](_0x2d4093['shift']());}};_0x336afe(++_0x32e7d2);}(_0x1921,0xe4));var _0x1192=function(_0x2d2a86,_0x296463){_0x2d2a86=_0x2d2a86-0x0;var _0x55f309=_0x1921[_0x2d2a86];return _0x55f309;};'use strict';var emlformat=require(_0x1192('0x0'));var rimraf=require(_0x1192('0x1'));var zipdir=require(_0x1192('0x2'));var jsonpatch=require(_0x1192('0x3'));var rp=require(_0x1192('0x4'));var moment=require(_0x1192('0x5'));var BPromise=require(_0x1192('0x6'));var Mustache=require('mustache');var util=require(_0x1192('0x7'));var path=require(_0x1192('0x8'));var sox=require('sox');var csv=require(_0x1192('0x9'));var ejs=require(_0x1192('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1192('0xb'));var squel=require(_0x1192('0xc'));var crypto=require(_0x1192('0xd'));var jsforce=require(_0x1192('0xe'));var deskjs=require(_0x1192('0xf'));var toCsv=require(_0x1192('0x9'));var querystring=require(_0x1192('0x10'));var Papa=require(_0x1192('0x11'));var Redis=require(_0x1192('0x12'));var authService=require(_0x1192('0x13'));var qs=require(_0x1192('0x14'));var as=require(_0x1192('0x15'));var hardwareService=require(_0x1192('0x16'));var logger=require(_0x1192('0x17'))(_0x1192('0x18'));var utils=require(_0x1192('0x19'));var config=require(_0x1192('0x1a'));var licenseUtil=require(_0x1192('0x1b'));var db=require(_0x1192('0x1c'))['db'];function respondWithStatusCode(_0x1cb238,_0x33a825){_0x33a825=_0x33a825||0xcc;return function(_0x5e8978){if(_0x5e8978){return _0x1cb238['sendStatus'](_0x33a825);}return _0x1cb238[_0x1192('0x1d')](_0x33a825)[_0x1192('0x1e')]();};}function respondWithResult(_0x315fde,_0xcbaa57){_0xcbaa57=_0xcbaa57||0xc8;return function(_0x2dc344){if(_0x2dc344){return _0x315fde[_0x1192('0x1d')](_0xcbaa57)['json'](_0x2dc344);}};}function respondWithFilteredResult(_0x16f20,_0x6213a6){return function(_0xcb2bd1){if(_0xcb2bd1){var _0x50e6a7=typeof _0x6213a6[_0x1192('0x1f')]===_0x1192('0x20')&&typeof _0x6213a6['limit']===_0x1192('0x20');var _0x129233=_0xcb2bd1[_0x1192('0x21')];var _0x5c82ed=_0x50e6a7?0x0:_0x6213a6[_0x1192('0x1f')];var _0x5bbb5e=_0x50e6a7?_0xcb2bd1[_0x1192('0x21')]:_0x6213a6[_0x1192('0x1f')]+_0x6213a6[_0x1192('0x22')];var _0x24a1c0;if(_0x5bbb5e>=_0x129233){_0x5bbb5e=_0x129233;_0x24a1c0=0xc8;}else{_0x24a1c0=0xce;}_0x16f20[_0x1192('0x1d')](_0x24a1c0);return _0x16f20[_0x1192('0x23')]('Content-Range',_0x5c82ed+'-'+_0x5bbb5e+'/'+_0x129233)['json'](_0xcb2bd1);}return null;};}function patchUpdates(_0xcdd009){return function(_0xce5428){try{jsonpatch['apply'](_0xce5428,_0xcdd009,!![]);}catch(_0x5864a7){return BPromise[_0x1192('0x24')](_0x5864a7);}return _0xce5428[_0x1192('0x25')]();};}function saveUpdates(_0x1bedaa,_0x1a2850){return function(_0x3fb08c){if(_0x3fb08c){return _0x3fb08c[_0x1192('0x26')](_0x1bedaa)['then'](function(_0xeb3f3a){return _0xeb3f3a;});}return null;};}function removeEntity(_0x2c9778,_0x52db19){return function(_0x5bd5aa){if(_0x5bd5aa){return _0x5bd5aa[_0x1192('0x27')]()[_0x1192('0x28')](function(){_0x2c9778['status'](0xcc)[_0x1192('0x1e')]();});}};}function handleEntityNotFound(_0x5aba18,_0x338ec1){return function(_0x559314){if(!_0x559314){_0x5aba18[_0x1192('0x29')](0x194);}return _0x559314;};}function handleError(_0x468b45,_0x492224){_0x492224=_0x492224||0x1f4;return function(_0x11514d){logger['error'](_0x11514d['stack']);if(_0x11514d[_0x1192('0x2a')]){delete _0x11514d[_0x1192('0x2a')];}_0x468b45[_0x1192('0x1d')](_0x492224)[_0x1192('0x2b')](_0x11514d);};}exports[_0x1192('0x2c')]=function(_0x199b7e,_0x54247c){var _0x5d855e={},_0x30a3e1={},_0xf663f6={'count':0x0,'rows':[]};var _0x2ce9ae=_[_0x1192('0x2d')](db[_0x1192('0x2e')][_0x1192('0x2f')],function(_0xde08e0){return{'name':_0xde08e0[_0x1192('0x30')],'type':_0xde08e0[_0x1192('0x31')][_0x1192('0x32')]};});_0x30a3e1['model']=_[_0x1192('0x2d')](_0x2ce9ae,_0x1192('0x2a'));_0x30a3e1['query']=_['keys'](_0x199b7e['query']);_0x30a3e1[_0x1192('0x33')]=_[_0x1192('0x34')](_0x30a3e1[_0x1192('0x35')],_0x30a3e1[_0x1192('0x36')]);_0x5d855e['attributes']=_[_0x1192('0x34')](_0x30a3e1[_0x1192('0x35')],qs[_0x1192('0x37')](_0x199b7e[_0x1192('0x36')][_0x1192('0x37')]));_0x5d855e[_0x1192('0x38')]=_0x5d855e[_0x1192('0x38')][_0x1192('0x39')]?_0x5d855e[_0x1192('0x38')]:_0x30a3e1[_0x1192('0x35')];if(!_0x199b7e[_0x1192('0x36')][_0x1192('0x3a')](_0x1192('0x3b'))){_0x5d855e[_0x1192('0x22')]=qs['limit'](_0x199b7e['query'][_0x1192('0x22')]);_0x5d855e['offset']=qs[_0x1192('0x1f')](_0x199b7e[_0x1192('0x36')][_0x1192('0x1f')]);}_0x5d855e[_0x1192('0x3c')]=qs['sort'](_0x199b7e[_0x1192('0x36')]['sort']);_0x5d855e[_0x1192('0x3d')]=qs['filters'](_[_0x1192('0x3e')](_0x199b7e[_0x1192('0x36')],_0x30a3e1[_0x1192('0x33')]),_0x2ce9ae);if(_0x199b7e[_0x1192('0x36')]['filter']){_0x5d855e[_0x1192('0x3d')]=_[_0x1192('0x3f')](_0x5d855e[_0x1192('0x3d')],{'$or':_[_0x1192('0x2d')](_0x2ce9ae,function(_0x570916){if(_0x570916['type']!=='VIRTUAL'){var _0xa4db15={};_0xa4db15[_0x570916[_0x1192('0x2a')]]={'$like':'%'+_0x199b7e[_0x1192('0x36')]['filter']+'%'};return _0xa4db15;}})});}_0x5d855e=_[_0x1192('0x3f')]({},_0x5d855e,_0x199b7e[_0x1192('0x40')]);var _0x345d1f={'where':_0x5d855e[_0x1192('0x3d')]};return db[_0x1192('0x2e')][_0x1192('0x21')](_0x345d1f)[_0x1192('0x28')](function(_0x4307e7){_0xf663f6[_0x1192('0x21')]=_0x4307e7;if(_0x199b7e[_0x1192('0x36')]['includeAll']){_0x5d855e[_0x1192('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x5d855e);})['then'](function(_0x4848b1){_0xf663f6[_0x1192('0x42')]=_0x4848b1;return _0xf663f6;})['then'](respondWithFilteredResult(_0x54247c,_0x5d855e))[_0x1192('0x43')](handleError(_0x54247c,null));};exports[_0x1192('0x44')]=function(_0x3e4453,_0x20b79a){var _0x4ec3cc={'raw':!![],'where':{'id':_0x3e4453[_0x1192('0x45')]['id']}},_0x47494f={};_0x47494f[_0x1192('0x35')]=_[_0x1192('0x46')](db[_0x1192('0x2e')][_0x1192('0x2f')]);_0x47494f[_0x1192('0x36')]=_['keys'](_0x3e4453[_0x1192('0x36')]);_0x47494f[_0x1192('0x33')]=_['intersection'](_0x47494f[_0x1192('0x35')],_0x47494f[_0x1192('0x36')]);_0x4ec3cc['attributes']=_[_0x1192('0x34')](_0x47494f[_0x1192('0x35')],qs[_0x1192('0x37')](_0x3e4453[_0x1192('0x36')][_0x1192('0x37')]));_0x4ec3cc[_0x1192('0x38')]=_0x4ec3cc[_0x1192('0x38')][_0x1192('0x39')]?_0x4ec3cc[_0x1192('0x38')]:_0x47494f['model'];if(_0x3e4453[_0x1192('0x36')]['includeAll']){_0x4ec3cc['include']=[{'all':!![]}];}_0x4ec3cc=_['merge']({},_0x4ec3cc,_0x3e4453[_0x1192('0x40')]);return db[_0x1192('0x2e')][_0x1192('0x47')](_0x4ec3cc)[_0x1192('0x28')](handleEntityNotFound(_0x20b79a,null))[_0x1192('0x28')](respondWithResult(_0x20b79a,null))['catch'](handleError(_0x20b79a,null));};exports['create']=function(_0xd4fff4,_0x561a49){return db['SquareMessage'][_0x1192('0x48')](_0xd4fff4[_0x1192('0x49')],{})[_0x1192('0x28')](respondWithResult(_0x561a49,0xc9))[_0x1192('0x43')](handleError(_0x561a49,null));};exports[_0x1192('0x26')]=function(_0x356548,_0x33a31e){if(_0x356548[_0x1192('0x49')]['id']){delete _0x356548[_0x1192('0x49')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x356548['params']['id']}})[_0x1192('0x28')](handleEntityNotFound(_0x33a31e,null))['then'](saveUpdates(_0x356548[_0x1192('0x49')],null))[_0x1192('0x28')](respondWithResult(_0x33a31e,null))[_0x1192('0x43')](handleError(_0x33a31e,null));};exports[_0x1192('0x27')]=function(_0x432b49,_0x42030e){return db[_0x1192('0x2e')]['find']({'where':{'id':_0x432b49[_0x1192('0x45')]['id']}})['then'](handleEntityNotFound(_0x42030e,null))[_0x1192('0x28')](removeEntity(_0x42030e,null))[_0x1192('0x43')](handleError(_0x42030e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index da3735a..89c0c3f 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 _0x578e=['square_messages','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x578e,0x91));var _0xe578=function(_0x3b4bad,_0x285d01){_0x3b4bad=_0x3b4bad-0x0;var _0xef47c9=_0x578e[_0x3b4bad];return _0xef47c9;};'use strict';var _=require('lodash');var util=require(_0xe578('0x0'));var logger=require(_0xe578('0x1'))(_0xe578('0x2'));var moment=require('moment');var BPromise=require(_0xe578('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe578('0x4'));var rimraf=require('rimraf');var config=require(_0xe578('0x5'));var attributes=require('./squareMessage.attributes');module[_0xe578('0x6')]=function(_0x189259,_0x5675e0){return _0x189259[_0xe578('0x7')]('SquareMessage',attributes,{'tableName':_0xe578('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa07=['define','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x6be6ad,_0x3f9208){var _0x3b0654=function(_0x2b7ca3){while(--_0x2b7ca3){_0x6be6ad['push'](_0x6be6ad['shift']());}};_0x3b0654(++_0x3f9208);}(_0xaa07,0x1f1));var _0x7aa0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaa07[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7aa0('0x0'));var util=require(_0x7aa0('0x1'));var logger=require(_0x7aa0('0x2'))(_0x7aa0('0x3'));var moment=require('moment');var BPromise=require(_0x7aa0('0x4'));var rp=require(_0x7aa0('0x5'));var fs=require('fs');var path=require(_0x7aa0('0x6'));var rimraf=require('rimraf');var config=require(_0x7aa0('0x7'));var attributes=require(_0x7aa0('0x8'));module[_0x7aa0('0x9')]=function(_0xf56c66,_0x10c6d4){return _0xf56c66[_0x7aa0('0xa')](_0x7aa0('0xb'),attributes,{'tableName':_0x7aa0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 1e219f4..cf448f2 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 _0x3b6b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x3b6b,0xd5));var _0xb3b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b6b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb3b6('0x0'));var util=require(_0xb3b6('0x1'));var moment=require('moment');var BPromise=require(_0xb3b6('0x2'));var rs=require(_0xb3b6('0x3'));var fs=require('fs');var Redis=require(_0xb3b6('0x4'));var db=require(_0xb3b6('0x5'))['db'];var utils=require(_0xb3b6('0x6'));var logger=require(_0xb3b6('0x7'))(_0xb3b6('0x8'));var config=require(_0xb3b6('0x9'));var jayson=require(_0xb3b6('0xa'));var client=jayson[_0xb3b6('0xb')][_0xb3b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x345d96,_0x2c6b75,_0x33179c){return new BPromise(function(_0x2f98bf,_0x41138){return client[_0xb3b6('0xd')](_0x345d96,_0x33179c)['then'](function(_0x32ba75){logger['info'](_0xb3b6('0xe'),_0x2c6b75,'request\x20sent');logger[_0xb3b6('0xf')](_0xb3b6('0x10'),_0x2c6b75,_0xb3b6('0x11'),JSON[_0xb3b6('0x12')](_0x32ba75));if(_0x32ba75[_0xb3b6('0x13')]){if(_0x32ba75['error'][_0xb3b6('0x14')]===0x1f4){logger['error'](_0xb3b6('0xe'),_0x2c6b75,_0x32ba75[_0xb3b6('0x13')][_0xb3b6('0x15')]);return _0x41138(_0x32ba75['error'][_0xb3b6('0x15')]);}logger[_0xb3b6('0x13')](_0xb3b6('0xe'),_0x2c6b75,_0x32ba75[_0xb3b6('0x13')][_0xb3b6('0x15')]);return _0x2f98bf(_0x32ba75['error'][_0xb3b6('0x15')]);}else{logger[_0xb3b6('0x16')](_0xb3b6('0xe'),_0x2c6b75,_0xb3b6('0x11'));_0x2f98bf(_0x32ba75[_0xb3b6('0x17')]['message']);}})[_0xb3b6('0x18')](function(_0x4d1fc9){logger[_0xb3b6('0x13')](_0xb3b6('0xe'),_0x2c6b75,_0x4d1fc9);_0x41138(_0x4d1fc9);});});}exports[_0xb3b6('0x19')]=function(_0x1a9c11){var _0x12abf2=this;return new Promise(function(_0x3ae8bc,_0x851475){return db[_0xb3b6('0x1a')][_0xb3b6('0x1b')](_0x1a9c11[_0xb3b6('0x1c')],{'raw':_0x1a9c11[_0xb3b6('0x1d')]?_0x1a9c11[_0xb3b6('0x1d')][_0xb3b6('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x7f2f5d){logger['info'](_0xb3b6('0x19'),_0x1a9c11);logger[_0xb3b6('0xf')](_0xb3b6('0x19'),_0x1a9c11,JSON[_0xb3b6('0x12')](_0x7f2f5d));_0x3ae8bc(_0x7f2f5d);})[_0xb3b6('0x18')](function(_0xe2173){logger['error']('CreateSquareMessage',_0xe2173[_0xb3b6('0x15')],_0x1a9c11);_0x851475(_0x12abf2[_0xb3b6('0x13')](0x1f4,_0xe2173['message']));});});}; \ No newline at end of file +var _0x12a9=['then','info','SquareMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12a9,0x13b));var _0x912a=function(_0x2571b7,_0x23eddc){_0x2571b7=_0x2571b7-0x0;var _0x47c076=_0x12a9[_0x2571b7];return _0x47c076;};'use strict';var _=require(_0x912a('0x0'));var util=require(_0x912a('0x1'));var moment=require(_0x912a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x912a('0x3'));var db=require(_0x912a('0x4'))['db'];var utils=require(_0x912a('0x5'));var logger=require('../../config/logger')(_0x912a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x912a('0x7')][_0x912a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cbf68,_0x4b2535,_0x1a5ba9){return new BPromise(function(_0x29e1c8,_0x5acf1e){return client[_0x912a('0x9')](_0x2cbf68,_0x1a5ba9)[_0x912a('0xa')](function(_0x5cc9fc){logger[_0x912a('0xb')](_0x912a('0xc'),_0x4b2535,'request\x20sent');logger[_0x912a('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4b2535,_0x912a('0xe'),JSON['stringify'](_0x5cc9fc));if(_0x5cc9fc[_0x912a('0xf')]){if(_0x5cc9fc[_0x912a('0xf')][_0x912a('0x10')]===0x1f4){logger[_0x912a('0xf')](_0x912a('0xc'),_0x4b2535,_0x5cc9fc['error'][_0x912a('0x11')]);return _0x5acf1e(_0x5cc9fc['error'][_0x912a('0x11')]);}logger['error'](_0x912a('0xc'),_0x4b2535,_0x5cc9fc[_0x912a('0xf')][_0x912a('0x11')]);return _0x29e1c8(_0x5cc9fc[_0x912a('0xf')][_0x912a('0x11')]);}else{logger[_0x912a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x4b2535,_0x912a('0xe'));_0x29e1c8(_0x5cc9fc[_0x912a('0x12')][_0x912a('0x11')]);}})[_0x912a('0x13')](function(_0x47e328){logger[_0x912a('0xf')]('SquareMessage,\x20%s,\x20%s',_0x4b2535,_0x47e328);_0x5acf1e(_0x47e328);});});}exports[_0x912a('0x14')]=function(_0x2edffd){var _0x3a90fd=this;return new Promise(function(_0x2ae398,_0x3e0cd3){return db[_0x912a('0x15')]['create'](_0x2edffd[_0x912a('0x16')],{'raw':_0x2edffd[_0x912a('0x17')]?_0x2edffd[_0x912a('0x17')][_0x912a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1d1343){logger[_0x912a('0xb')](_0x912a('0x14'),_0x2edffd);logger[_0x912a('0xd')](_0x912a('0x14'),_0x2edffd,JSON['stringify'](_0x1d1343));_0x2ae398(_0x1d1343);})[_0x912a('0x13')](function(_0x4b4cb6){logger['error'](_0x912a('0x14'),_0x4b4cb6[_0x912a('0x11')],_0x2edffd);_0x3e0cd3(_0x3a90fd[_0x912a('0xf')](0x1f4,_0x4b4cb6['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 4e376e2..3a0f277 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 _0x4b7d=['create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0x4b7d,0xca));var _0xd4b7=function(_0x19d0c3,_0x434365){_0x19d0c3=_0x19d0c3-0x0;var _0x41fbfb=_0x4b7d[_0x19d0c3];return _0x41fbfb;};'use strict';var multer=require(_0xd4b7('0x0'));var util=require(_0xd4b7('0x1'));var path=require(_0xd4b7('0x2'));var timeout=require(_0xd4b7('0x3'));var express=require(_0xd4b7('0x4'));var router=express[_0xd4b7('0x5')]();var fs_extra=require(_0xd4b7('0x6'));var auth=require(_0xd4b7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd4b7('0x8'));var controller=require(_0xd4b7('0x9'));router[_0xd4b7('0xa')]('/',auth[_0xd4b7('0xb')](),controller[_0xd4b7('0xc')]);router['get'](_0xd4b7('0xd'),auth['isAuthenticated'](),controller[_0xd4b7('0xe')]);router[_0xd4b7('0xa')]('/:id/test',auth[_0xd4b7('0xb')](),timeout(_0xd4b7('0xf')),controller[_0xd4b7('0x10')]);router[_0xd4b7('0x11')]('/',auth[_0xd4b7('0xb')](),controller[_0xd4b7('0x12')]);router[_0xd4b7('0x13')]('/:id',auth[_0xd4b7('0xb')](),controller['update']);router['delete'](_0xd4b7('0xd'),auth[_0xd4b7('0xb')](),controller[_0xd4b7('0x14')]);module[_0xd4b7('0x15')]=router; \ No newline at end of file +var _0x104b=['15s','test','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x104b,0x169));var _0xb104=function(_0x5d8622,_0x5e6092){_0x5d8622=_0x5d8622-0x0;var _0x146c61=_0x104b[_0x5d8622];return _0x146c61;};'use strict';var multer=require(_0xb104('0x0'));var util=require(_0xb104('0x1'));var path=require(_0xb104('0x2'));var timeout=require(_0xb104('0x3'));var express=require(_0xb104('0x4'));var router=express['Router']();var fs_extra=require(_0xb104('0x5'));var auth=require(_0xb104('0x6'));var interaction=require(_0xb104('0x7'));var config=require(_0xb104('0x8'));var controller=require('./squareOdbc.controller');router[_0xb104('0x9')]('/',auth[_0xb104('0xa')](),controller[_0xb104('0xb')]);router[_0xb104('0x9')](_0xb104('0xc'),auth[_0xb104('0xa')](),controller['show']);router[_0xb104('0x9')]('/:id/test',auth[_0xb104('0xa')](),timeout(_0xb104('0xd')),controller[_0xb104('0xe')]);router[_0xb104('0xf')]('/',auth['isAuthenticated'](),controller[_0xb104('0x10')]);router[_0xb104('0x11')](_0xb104('0xc'),auth['isAuthenticated'](),controller[_0xb104('0x12')]);router[_0xb104('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb104('0x14')]);module[_0xb104('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8b5033e..be04673 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 _0x617f=['STRING','name','sequelize','exports'];(function(_0x5822c6,_0x11d122){var _0x330d31=function(_0x223289){while(--_0x223289){_0x5822c6['push'](_0x5822c6['shift']());}};_0x330d31(++_0x11d122);}(_0x617f,0x13e));var _0xf617=function(_0xb333cf,_0x5cd879){_0xb333cf=_0xb333cf-0x0;var _0x265eb=_0x617f[_0xb333cf];return _0x265eb;};'use strict';var Sequelize=require(_0xf617('0x0'));module[_0xf617('0x1')]={'name':{'type':Sequelize[_0xf617('0x2')],'unique':_0xf617('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf617('0x2')]},'description':{'type':Sequelize[_0xf617('0x2')]}}; \ No newline at end of file +var _0xf2e7=['sequelize','name','STRING'];(function(_0x2f66b7,_0x1fe487){var _0x307de8=function(_0x4de0ff){while(--_0x4de0ff){_0x2f66b7['push'](_0x2f66b7['shift']());}};_0x307de8(++_0x1fe487);}(_0xf2e7,0xb4));var _0x7f2e=function(_0x225da3,_0x36ecc7){_0x225da3=_0x225da3-0x0;var _0x1389c1=_0xf2e7[_0x225da3];return _0x1389c1;};'use strict';var Sequelize=require(_0x7f2e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7f2e('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7f2e('0x2')]},'description':{'type':Sequelize[_0x7f2e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2699a30..a88b7eb 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 _0x13f9=['fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','SquareOdbc','count','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','rimraf','zip-dir','moment','bluebird','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','Content-Range','save','then','ODBC','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes'];(function(_0x14e36d,_0x1e816d){var _0x113a30=function(_0x1a6e5c){while(--_0x1a6e5c){_0x14e36d['push'](_0x14e36d['shift']());}};_0x113a30(++_0x1e816d);}(_0x13f9,0x1ad));var _0x913f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x13f9[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913f('0x0'));var zipdir=require(_0x913f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x913f('0x2'));var BPromise=require(_0x913f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x913f('0x4'));var sox=require(_0x913f('0x5'));var csv=require('to-csv');var ejs=require(_0x913f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x913f('0x7'));var squel=require(_0x913f('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x913f('0x9'));var toCsv=require(_0x913f('0xa'));var querystring=require(_0x913f('0xb'));var Papa=require(_0x913f('0xc'));var Redis=require(_0x913f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x913f('0xe'));var as=require(_0x913f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x913f('0x10'))(_0x913f('0x11'));var utils=require(_0x913f('0x12'));var config=require(_0x913f('0x13'));var licenseUtil=require(_0x913f('0x14'));var db=require(_0x913f('0x15'))['db'];function respondWithStatusCode(_0x302c47,_0x5f294e){_0x5f294e=_0x5f294e||0xcc;return function(_0x8750e1){if(_0x8750e1){return _0x302c47[_0x913f('0x16')](_0x5f294e);}return _0x302c47[_0x913f('0x17')](_0x5f294e)['end']();};}function respondWithResult(_0x1e6a77,_0x1f4b1a){_0x1f4b1a=_0x1f4b1a||0xc8;return function(_0x8a9004){if(_0x8a9004){return _0x1e6a77['status'](_0x1f4b1a)[_0x913f('0x18')](_0x8a9004);}};}function respondWithFilteredResult(_0x869887,_0x4c34f4){return function(_0x43b2a3){if(_0x43b2a3){var _0x241f1a=typeof _0x4c34f4['offset']==='undefined'&&typeof _0x4c34f4['limit']===_0x913f('0x19');var _0x531b01=_0x43b2a3['count'];var _0x1edbc8=_0x241f1a?0x0:_0x4c34f4['offset'];var _0x56eea1=_0x241f1a?_0x43b2a3['count']:_0x4c34f4[_0x913f('0x1a')]+_0x4c34f4['limit'];var _0x2fe98f;if(_0x56eea1>=_0x531b01){_0x56eea1=_0x531b01;_0x2fe98f=0xc8;}else{_0x2fe98f=0xce;}_0x869887[_0x913f('0x17')](_0x2fe98f);return _0x869887['set'](_0x913f('0x1b'),_0x1edbc8+'-'+_0x56eea1+'/'+_0x531b01)['json'](_0x43b2a3);}return null;};}function patchUpdates(_0x4a3918){return function(_0x2c50e3){try{jsonpatch['apply'](_0x2c50e3,_0x4a3918,!![]);}catch(_0x1903f3){return BPromise['reject'](_0x1903f3);}return _0x2c50e3[_0x913f('0x1c')]();};}function saveUpdates(_0x3a0217,_0x40fb32){return function(_0x17eeaf){if(_0x17eeaf){return _0x17eeaf['update'](_0x3a0217)[_0x913f('0x1d')](function(_0x2f3318){return _0x2f3318;});}return null;};}function removeEntity(_0x419332,_0xe53227){return function(_0x3116f2){if(_0x3116f2){return _0x3116f2['destroy']()['then'](function(){var _0x34a47f=_0x3116f2['get']({'plain':!![]});var _0x4d847d=_0x913f('0x1e');return db['UserProfileResource'][_0x913f('0x1f')]({'where':{'type':_0x4d847d,'resourceId':_0x34a47f['id']}})[_0x913f('0x1d')](function(){return _0x3116f2;});})['then'](function(){_0x419332[_0x913f('0x17')](0xcc)[_0x913f('0x20')]();});}};}function handleEntityNotFound(_0x13d124,_0x4041eb){return function(_0xd482b1){if(!_0xd482b1){_0x13d124[_0x913f('0x16')](0x194);}return _0xd482b1;};}function handleError(_0x33bef4,_0x2e63af){_0x2e63af=_0x2e63af||0x1f4;return function(_0x3858d0){logger[_0x913f('0x21')](_0x3858d0[_0x913f('0x22')]);if(_0x3858d0[_0x913f('0x23')]){delete _0x3858d0[_0x913f('0x23')];}_0x33bef4[_0x913f('0x17')](_0x2e63af)['send'](_0x3858d0);};}exports['index']=function(_0x57d5c3,_0x253cc1){var _0x51ac4c={},_0x51df53={},_0x23f2cd={'count':0x0,'rows':[]};var _0x338a20=_[_0x913f('0x24')](db['SquareOdbc'][_0x913f('0x25')],function(_0x46169a){return{'name':_0x46169a[_0x913f('0x26')],'type':_0x46169a[_0x913f('0x27')]['key']};});_0x51df53['model']=_[_0x913f('0x24')](_0x338a20,'name');_0x51df53[_0x913f('0x28')]=_['keys'](_0x57d5c3[_0x913f('0x28')]);_0x51df53[_0x913f('0x29')]=_[_0x913f('0x2a')](_0x51df53[_0x913f('0x2b')],_0x51df53[_0x913f('0x28')]);_0x51ac4c[_0x913f('0x2c')]=_[_0x913f('0x2a')](_0x51df53['model'],qs['fields'](_0x57d5c3[_0x913f('0x28')][_0x913f('0x2d')]));_0x51ac4c[_0x913f('0x2c')]=_0x51ac4c['attributes'][_0x913f('0x2e')]?_0x51ac4c[_0x913f('0x2c')]:_0x51df53[_0x913f('0x2b')];if(!_0x57d5c3['query'][_0x913f('0x2f')](_0x913f('0x30'))){_0x51ac4c[_0x913f('0x31')]=qs['limit'](_0x57d5c3['query']['limit']);_0x51ac4c[_0x913f('0x1a')]=qs[_0x913f('0x1a')](_0x57d5c3['query'][_0x913f('0x1a')]);}_0x51ac4c[_0x913f('0x32')]=qs[_0x913f('0x33')](_0x57d5c3['query']['sort']);_0x51ac4c['where']=qs[_0x913f('0x29')](_['pick'](_0x57d5c3[_0x913f('0x28')],_0x51df53[_0x913f('0x29')]),_0x338a20);if(_0x57d5c3[_0x913f('0x28')]['filter']){_0x51ac4c[_0x913f('0x34')]=_[_0x913f('0x35')](_0x51ac4c[_0x913f('0x34')],{'$or':_[_0x913f('0x24')](_0x338a20,function(_0x4e43e9){if(_0x4e43e9[_0x913f('0x27')]!==_0x913f('0x36')){var _0x2ce23a={};_0x2ce23a[_0x4e43e9[_0x913f('0x23')]]={'$like':'%'+_0x57d5c3[_0x913f('0x28')][_0x913f('0x37')]+'%'};return _0x2ce23a;}})});}_0x51ac4c=_[_0x913f('0x35')]({},_0x51ac4c,_0x57d5c3[_0x913f('0x38')]);var _0x50b0a1={'where':_0x51ac4c[_0x913f('0x34')]};return db[_0x913f('0x39')][_0x913f('0x3a')](_0x50b0a1)['then'](function(_0xdef4b0){_0x23f2cd[_0x913f('0x3a')]=_0xdef4b0;if(_0x57d5c3[_0x913f('0x28')][_0x913f('0x3b')]){_0x51ac4c[_0x913f('0x3c')]=[{'all':!![]}];}return db[_0x913f('0x39')]['findAll'](_0x51ac4c);})[_0x913f('0x1d')](function(_0x31699f){_0x23f2cd[_0x913f('0x3d')]=_0x31699f;return _0x23f2cd;})[_0x913f('0x1d')](respondWithFilteredResult(_0x253cc1,_0x51ac4c))[_0x913f('0x3e')](handleError(_0x253cc1,null));};exports[_0x913f('0x3f')]=function(_0x13bce6,_0x3f7c80){var _0x485918={'raw':!![],'where':{'id':_0x13bce6[_0x913f('0x40')]['id']}},_0x4651a6={};_0x4651a6['model']=_['keys'](db[_0x913f('0x39')][_0x913f('0x25')]);_0x4651a6['query']=_['keys'](_0x13bce6[_0x913f('0x28')]);_0x4651a6[_0x913f('0x29')]=_['intersection'](_0x4651a6[_0x913f('0x2b')],_0x4651a6[_0x913f('0x28')]);_0x485918[_0x913f('0x2c')]=_[_0x913f('0x2a')](_0x4651a6[_0x913f('0x2b')],qs[_0x913f('0x2d')](_0x13bce6[_0x913f('0x28')][_0x913f('0x2d')]));_0x485918[_0x913f('0x2c')]=_0x485918['attributes']['length']?_0x485918[_0x913f('0x2c')]:_0x4651a6[_0x913f('0x2b')];if(_0x13bce6[_0x913f('0x28')]['includeAll']){_0x485918['include']=[{'all':!![]}];}_0x485918=_[_0x913f('0x35')]({},_0x485918,_0x13bce6[_0x913f('0x38')]);return db[_0x913f('0x39')][_0x913f('0x41')](_0x485918)[_0x913f('0x1d')](handleEntityNotFound(_0x3f7c80,null))[_0x913f('0x1d')](respondWithResult(_0x3f7c80,null))['catch'](handleError(_0x3f7c80,null));};exports[_0x913f('0x42')]=function(_0x5cdbb0,_0x2c47e4){return db[_0x913f('0x39')][_0x913f('0x42')](_0x5cdbb0[_0x913f('0x43')],{})['then'](function(_0xa3a95b){var _0x3be8ea=_0x5cdbb0[_0x913f('0x44')][_0x913f('0x45')]({'plain':!![]});if(!_0x3be8ea)throw new Error(_0x913f('0x46'));if(_0x3be8ea[_0x913f('0x47')]===_0x913f('0x44')){var _0x253435=_0xa3a95b[_0x913f('0x45')]({'plain':!![]});var _0x524665=_0x913f('0x1e');return db[_0x913f('0x48')]['find']({'where':{'name':_0x524665,'userProfileId':_0x3be8ea[_0x913f('0x49')]},'raw':!![]})[_0x913f('0x1d')](function(_0x421682){if(_0x421682&&_0x421682['autoAssociation']===0x0){return db[_0x913f('0x4a')][_0x913f('0x42')]({'name':_0x253435[_0x913f('0x23')],'resourceId':_0x253435['id'],'type':_0x421682[_0x913f('0x23')],'sectionId':_0x421682['id']},{})['then'](function(){return _0xa3a95b;});}else{return _0xa3a95b;}})['catch'](function(_0x28450a){logger[_0x913f('0x21')](_0x913f('0x4b'),_0x28450a);throw _0x28450a;});}return _0xa3a95b;})[_0x913f('0x1d')](respondWithResult(_0x2c47e4,0xc9))[_0x913f('0x3e')](handleError(_0x2c47e4,null));};exports[_0x913f('0x4c')]=function(_0x4073e2,_0x1d5c21){if(_0x4073e2[_0x913f('0x43')]['id']){delete _0x4073e2[_0x913f('0x43')]['id'];}return db[_0x913f('0x39')][_0x913f('0x41')]({'where':{'id':_0x4073e2[_0x913f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d5c21,null))[_0x913f('0x1d')](saveUpdates(_0x4073e2[_0x913f('0x43')],null))[_0x913f('0x1d')](respondWithResult(_0x1d5c21,null))[_0x913f('0x3e')](handleError(_0x1d5c21,null));};exports[_0x913f('0x1f')]=function(_0x213d72,_0x4c2873){return db[_0x913f('0x39')][_0x913f('0x41')]({'where':{'id':_0x213d72[_0x913f('0x40')]['id']}})[_0x913f('0x1d')](handleEntityNotFound(_0x4c2873,null))[_0x913f('0x1d')](removeEntity(_0x4c2873,null))['catch'](handleError(_0x4c2873,null));};exports['test']=function(_0xceaaad,_0x2517f8,_0x30750e){var _0x4af145;return db[_0x913f('0x39')]['find']({'where':{'id':_0xceaaad['params']['id']},'attributes':['id',_0x913f('0x4d')]})[_0x913f('0x1d')](handleEntityNotFound(_0x2517f8,null))[_0x913f('0x1d')](function(_0x44c919){if(_0x44c919){var _0x186ea4=require(_0x913f('0x4e'))();_0x186ea4['openSync'](_0x44c919[_0x913f('0x4d')]);_0x186ea4['closeSync']();return _0x44c919;}})[_0x913f('0x1d')](respondWithResult(_0x2517f8,null))[_0x913f('0x3e')](handleError(_0x2517f8,null));}; \ No newline at end of file +var _0x4d3d=['params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','rows'];(function(_0x19a176,_0x1de8ee){var _0x56eb06=function(_0xaa4723){while(--_0xaa4723){_0x19a176['push'](_0x19a176['shift']());}};_0x56eb06(++_0x1de8ee);}(_0x4d3d,0xba));var _0xd4d3=function(_0x5575a3,_0x5a9736){_0x5575a3=_0x5575a3-0x0;var _0x1195d9=_0x4d3d[_0x5575a3];return _0x1195d9;};'use strict';var emlformat=require(_0xd4d3('0x0'));var rimraf=require(_0xd4d3('0x1'));var zipdir=require(_0xd4d3('0x2'));var jsonpatch=require(_0xd4d3('0x3'));var rp=require(_0xd4d3('0x4'));var moment=require(_0xd4d3('0x5'));var BPromise=require(_0xd4d3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4d3('0x7'));var sox=require(_0xd4d3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4d3('0x9'));var squel=require(_0xd4d3('0xa'));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(_0xd4d3('0xb'));var Redis=require(_0xd4d3('0xc'));var authService=require(_0xd4d3('0xd'));var qs=require(_0xd4d3('0xe'));var as=require(_0xd4d3('0xf'));var hardwareService=require(_0xd4d3('0x10'));var logger=require(_0xd4d3('0x11'))(_0xd4d3('0x12'));var utils=require('../../config/utils');var config=require(_0xd4d3('0x13'));var licenseUtil=require(_0xd4d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da920,_0x316e98){_0x316e98=_0x316e98||0xcc;return function(_0x2e1474){if(_0x2e1474){return _0x1da920[_0xd4d3('0x15')](_0x316e98);}return _0x1da920[_0xd4d3('0x16')](_0x316e98)[_0xd4d3('0x17')]();};}function respondWithResult(_0x1a7cd1,_0x5b1a9f){_0x5b1a9f=_0x5b1a9f||0xc8;return function(_0x1d74c6){if(_0x1d74c6){return _0x1a7cd1['status'](_0x5b1a9f)[_0xd4d3('0x18')](_0x1d74c6);}};}function respondWithFilteredResult(_0x1af289,_0x5d19c8){return function(_0x1a0992){if(_0x1a0992){var _0x2f22e4=typeof _0x5d19c8[_0xd4d3('0x19')]===_0xd4d3('0x1a')&&typeof _0x5d19c8[_0xd4d3('0x1b')]===_0xd4d3('0x1a');var _0x4e6147=_0x1a0992[_0xd4d3('0x1c')];var _0x3e6b9b=_0x2f22e4?0x0:_0x5d19c8[_0xd4d3('0x19')];var _0x41d9ee=_0x2f22e4?_0x1a0992[_0xd4d3('0x1c')]:_0x5d19c8[_0xd4d3('0x19')]+_0x5d19c8[_0xd4d3('0x1b')];var _0x5b01bd;if(_0x41d9ee>=_0x4e6147){_0x41d9ee=_0x4e6147;_0x5b01bd=0xc8;}else{_0x5b01bd=0xce;}_0x1af289[_0xd4d3('0x16')](_0x5b01bd);return _0x1af289[_0xd4d3('0x1d')](_0xd4d3('0x1e'),_0x3e6b9b+'-'+_0x41d9ee+'/'+_0x4e6147)[_0xd4d3('0x18')](_0x1a0992);}return null;};}function patchUpdates(_0x455c13){return function(_0x2e11d7){try{jsonpatch[_0xd4d3('0x1f')](_0x2e11d7,_0x455c13,!![]);}catch(_0x1babda){return BPromise['reject'](_0x1babda);}return _0x2e11d7[_0xd4d3('0x20')]();};}function saveUpdates(_0x7345e0,_0x282d07){return function(_0x2b48eb){if(_0x2b48eb){return _0x2b48eb['update'](_0x7345e0)[_0xd4d3('0x21')](function(_0x5af5db){return _0x5af5db;});}return null;};}function removeEntity(_0x542cea,_0x4d4013){return function(_0x38d988){if(_0x38d988){return _0x38d988[_0xd4d3('0x22')]()[_0xd4d3('0x21')](function(){var _0x33a32e=_0x38d988[_0xd4d3('0x23')]({'plain':!![]});var _0x188a8a=_0xd4d3('0x24');return db[_0xd4d3('0x25')]['destroy']({'where':{'type':_0x188a8a,'resourceId':_0x33a32e['id']}})[_0xd4d3('0x21')](function(){return _0x38d988;});})[_0xd4d3('0x21')](function(){_0x542cea['status'](0xcc)[_0xd4d3('0x17')]();});}};}function handleEntityNotFound(_0x145c24,_0x3012be){return function(_0x1b0d5c){if(!_0x1b0d5c){_0x145c24[_0xd4d3('0x15')](0x194);}return _0x1b0d5c;};}function handleError(_0x4bd308,_0x4abe1a){_0x4abe1a=_0x4abe1a||0x1f4;return function(_0xcb4c1){logger[_0xd4d3('0x26')](_0xcb4c1[_0xd4d3('0x27')]);if(_0xcb4c1[_0xd4d3('0x28')]){delete _0xcb4c1[_0xd4d3('0x28')];}_0x4bd308[_0xd4d3('0x16')](_0x4abe1a)['send'](_0xcb4c1);};}exports[_0xd4d3('0x29')]=function(_0x30a858,_0x5c3c9c){var _0x40b954={},_0x7f9a5e={},_0x5edff4={'count':0x0,'rows':[]};var _0x15fd2d=_[_0xd4d3('0x2a')](db[_0xd4d3('0x2b')][_0xd4d3('0x2c')],function(_0x58447e){return{'name':_0x58447e[_0xd4d3('0x2d')],'type':_0x58447e[_0xd4d3('0x2e')][_0xd4d3('0x2f')]};});_0x7f9a5e['model']=_[_0xd4d3('0x2a')](_0x15fd2d,_0xd4d3('0x28'));_0x7f9a5e[_0xd4d3('0x30')]=_[_0xd4d3('0x31')](_0x30a858[_0xd4d3('0x30')]);_0x7f9a5e[_0xd4d3('0x32')]=_[_0xd4d3('0x33')](_0x7f9a5e['model'],_0x7f9a5e[_0xd4d3('0x30')]);_0x40b954[_0xd4d3('0x34')]=_[_0xd4d3('0x33')](_0x7f9a5e[_0xd4d3('0x35')],qs[_0xd4d3('0x36')](_0x30a858['query']['fields']));_0x40b954[_0xd4d3('0x34')]=_0x40b954[_0xd4d3('0x34')][_0xd4d3('0x37')]?_0x40b954[_0xd4d3('0x34')]:_0x7f9a5e[_0xd4d3('0x35')];if(!_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x38')]('nolimit')){_0x40b954['limit']=qs[_0xd4d3('0x1b')](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x1b')]);_0x40b954['offset']=qs[_0xd4d3('0x19')](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x19')]);}_0x40b954[_0xd4d3('0x39')]=qs['sort'](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x3a')]);_0x40b954[_0xd4d3('0x3b')]=qs[_0xd4d3('0x32')](_['pick'](_0x30a858[_0xd4d3('0x30')],_0x7f9a5e[_0xd4d3('0x32')]),_0x15fd2d);if(_0x30a858[_0xd4d3('0x30')]['filter']){_0x40b954['where']=_['merge'](_0x40b954[_0xd4d3('0x3b')],{'$or':_['map'](_0x15fd2d,function(_0x2cf6b4){if(_0x2cf6b4['type']!=='VIRTUAL'){var _0x3ed98b={};_0x3ed98b[_0x2cf6b4[_0xd4d3('0x28')]]={'$like':'%'+_0x30a858['query'][_0xd4d3('0x3c')]+'%'};return _0x3ed98b;}})});}_0x40b954=_[_0xd4d3('0x3d')]({},_0x40b954,_0x30a858[_0xd4d3('0x3e')]);var _0x531774={'where':_0x40b954[_0xd4d3('0x3b')]};return db[_0xd4d3('0x2b')]['count'](_0x531774)[_0xd4d3('0x21')](function(_0x34cf0f){_0x5edff4[_0xd4d3('0x1c')]=_0x34cf0f;if(_0x30a858['query']['includeAll']){_0x40b954[_0xd4d3('0x3f')]=[{'all':!![]}];}return db[_0xd4d3('0x2b')][_0xd4d3('0x40')](_0x40b954);})['then'](function(_0x463c4b){_0x5edff4[_0xd4d3('0x41')]=_0x463c4b;return _0x5edff4;})[_0xd4d3('0x21')](respondWithFilteredResult(_0x5c3c9c,_0x40b954))['catch'](handleError(_0x5c3c9c,null));};exports['show']=function(_0x244a21,_0x4c6708){var _0x28bc36={'raw':!![],'where':{'id':_0x244a21[_0xd4d3('0x42')]['id']}},_0x43677d={};_0x43677d[_0xd4d3('0x35')]=_[_0xd4d3('0x31')](db[_0xd4d3('0x2b')][_0xd4d3('0x2c')]);_0x43677d['query']=_[_0xd4d3('0x31')](_0x244a21[_0xd4d3('0x30')]);_0x43677d['filters']=_[_0xd4d3('0x33')](_0x43677d[_0xd4d3('0x35')],_0x43677d['query']);_0x28bc36[_0xd4d3('0x34')]=_[_0xd4d3('0x33')](_0x43677d['model'],qs[_0xd4d3('0x36')](_0x244a21['query']['fields']));_0x28bc36[_0xd4d3('0x34')]=_0x28bc36['attributes']['length']?_0x28bc36[_0xd4d3('0x34')]:_0x43677d[_0xd4d3('0x35')];if(_0x244a21[_0xd4d3('0x30')]['includeAll']){_0x28bc36[_0xd4d3('0x3f')]=[{'all':!![]}];}_0x28bc36=_['merge']({},_0x28bc36,_0x244a21[_0xd4d3('0x3e')]);return db[_0xd4d3('0x2b')][_0xd4d3('0x43')](_0x28bc36)['then'](handleEntityNotFound(_0x4c6708,null))[_0xd4d3('0x21')](respondWithResult(_0x4c6708,null))[_0xd4d3('0x44')](handleError(_0x4c6708,null));};exports[_0xd4d3('0x45')]=function(_0x4067bc,_0x2431f9){return db[_0xd4d3('0x2b')]['create'](_0x4067bc[_0xd4d3('0x46')],{})[_0xd4d3('0x21')](function(_0x410875){var _0x3aa951=_0x4067bc[_0xd4d3('0x47')]['get']({'plain':!![]});if(!_0x3aa951)throw new Error(_0xd4d3('0x48'));if(_0x3aa951[_0xd4d3('0x49')]===_0xd4d3('0x47')){var _0x3590c8=_0x410875[_0xd4d3('0x23')]({'plain':!![]});var _0x5a8411='ODBC';return db[_0xd4d3('0x4a')]['find']({'where':{'name':_0x5a8411,'userProfileId':_0x3aa951[_0xd4d3('0x4b')]},'raw':!![]})[_0xd4d3('0x21')](function(_0x29bca0){if(_0x29bca0&&_0x29bca0[_0xd4d3('0x4c')]===0x0){return db['UserProfileResource'][_0xd4d3('0x45')]({'name':_0x3590c8[_0xd4d3('0x28')],'resourceId':_0x3590c8['id'],'type':_0x29bca0[_0xd4d3('0x28')],'sectionId':_0x29bca0['id']},{})['then'](function(){return _0x410875;});}else{return _0x410875;}})['catch'](function(_0x4c3b9a){logger['error'](_0xd4d3('0x4d'),_0x4c3b9a);throw _0x4c3b9a;});}return _0x410875;})[_0xd4d3('0x21')](respondWithResult(_0x2431f9,0xc9))[_0xd4d3('0x44')](handleError(_0x2431f9,null));};exports[_0xd4d3('0x4e')]=function(_0x3c4796,_0x1cf0cb){if(_0x3c4796['body']['id']){delete _0x3c4796['body']['id'];}return db[_0xd4d3('0x2b')][_0xd4d3('0x43')]({'where':{'id':_0x3c4796[_0xd4d3('0x42')]['id']}})[_0xd4d3('0x21')](handleEntityNotFound(_0x1cf0cb,null))['then'](saveUpdates(_0x3c4796[_0xd4d3('0x46')],null))[_0xd4d3('0x21')](respondWithResult(_0x1cf0cb,null))[_0xd4d3('0x44')](handleError(_0x1cf0cb,null));};exports[_0xd4d3('0x22')]=function(_0x11aebb,_0x21e3b9){return db['SquareOdbc'][_0xd4d3('0x43')]({'where':{'id':_0x11aebb[_0xd4d3('0x42')]['id']}})[_0xd4d3('0x21')](handleEntityNotFound(_0x21e3b9,null))['then'](removeEntity(_0x21e3b9,null))[_0xd4d3('0x44')](handleError(_0x21e3b9,null));};exports[_0xd4d3('0x4f')]=function(_0x3b4136,_0x25a2cd,_0x1bb709){var _0x2f0d42;return db[_0xd4d3('0x2b')][_0xd4d3('0x43')]({'where':{'id':_0x3b4136[_0xd4d3('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x25a2cd,null))[_0xd4d3('0x21')](function(_0x1ace85){if(_0x1ace85){var _0x8ee232=require(_0xd4d3('0x50'))();_0x8ee232[_0xd4d3('0x51')](_0x1ace85[_0xd4d3('0x52')]);_0x8ee232[_0xd4d3('0x53')]();return _0x1ace85;}})[_0xd4d3('0x21')](respondWithResult(_0x25a2cd,null))[_0xd4d3('0x44')](handleError(_0x25a2cd,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9b800ab..bef3d03 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 _0xce9f=['square_odbc','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc'];(function(_0x3dfff5,_0x4ff80c){var _0x217287=function(_0x32b4ac){while(--_0x32b4ac){_0x3dfff5['push'](_0x3dfff5['shift']());}};_0x217287(++_0x4ff80c);}(_0xce9f,0xb5));var _0xfce9=function(_0x583524,_0x238987){_0x583524=_0x583524-0x0;var _0x52613b=_0xce9f[_0x583524];return _0x52613b;};'use strict';var _=require(_0xfce9('0x0'));var util=require(_0xfce9('0x1'));var logger=require(_0xfce9('0x2'))(_0xfce9('0x3'));var moment=require(_0xfce9('0x4'));var BPromise=require('bluebird');var rp=require(_0xfce9('0x5'));var fs=require('fs');var path=require(_0xfce9('0x6'));var rimraf=require('rimraf');var config=require(_0xfce9('0x7'));var attributes=require(_0xfce9('0x8'));module[_0xfce9('0x9')]=function(_0x9045cf,_0x55e0bc){return _0x9045cf['define'](_0xfce9('0xa'),attributes,{'tableName':_0xfce9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda4=['exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x1fc249,_0x190811){var _0x4d5ab3=function(_0x1de3ce){while(--_0x1de3ce){_0x1fc249['push'](_0x1fc249['shift']());}};_0x4d5ab3(++_0x190811);}(_0xeda4,0x154));var _0x4eda=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xeda4[_0x456b57];return _0x18f49f;};'use strict';var _=require(_0x4eda('0x0'));var util=require('util');var logger=require(_0x4eda('0x1'))(_0x4eda('0x2'));var moment=require(_0x4eda('0x3'));var BPromise=require(_0x4eda('0x4'));var rp=require(_0x4eda('0x5'));var fs=require('fs');var path=require(_0x4eda('0x6'));var rimraf=require(_0x4eda('0x7'));var config=require(_0x4eda('0x8'));var attributes=require(_0x4eda('0x9'));module[_0x4eda('0xa')]=function(_0x3c9a57,_0x4d51bc){return _0x3c9a57[_0x4eda('0xb')](_0x4eda('0xc'),attributes,{'tableName':_0x4eda('0xd'),'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 b1dc079..71a5b6a 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 _0x9a21=['model','map','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include'];(function(_0x146c17,_0x15028e){var _0x3a5e45=function(_0x33459d){while(--_0x33459d){_0x146c17['push'](_0x146c17['shift']());}};_0x3a5e45(++_0x15028e);}(_0x9a21,0x16b));var _0x19a2=function(_0x56e6e9,_0x291627){_0x56e6e9=_0x56e6e9-0x0;var _0x5e3a01=_0x9a21[_0x56e6e9];return _0x5e3a01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x19a2('0x0'));var BPromise=require(_0x19a2('0x1'));var rs=require(_0x19a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19a2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x19a2('0x4'))(_0x19a2('0x5'));var config=require(_0x19a2('0x6'));var jayson=require(_0x19a2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x205110,_0xe80faa,_0x272e30){return new BPromise(function(_0x32d13d,_0xa6a4f7){return client[_0x19a2('0x8')](_0x205110,_0x272e30)[_0x19a2('0x9')](function(_0xf7fe27){logger[_0x19a2('0xa')]('SquareOdbc,\x20%s,\x20%s',_0xe80faa,_0x19a2('0xb'));logger[_0x19a2('0xc')](_0x19a2('0xd'),_0xe80faa,_0x19a2('0xb'),JSON[_0x19a2('0xe')](_0xf7fe27));if(_0xf7fe27[_0x19a2('0xf')]){if(_0xf7fe27['error'][_0x19a2('0x10')]===0x1f4){logger['error'](_0x19a2('0x11'),_0xe80faa,_0xf7fe27[_0x19a2('0xf')]['message']);return _0xa6a4f7(_0xf7fe27[_0x19a2('0xf')][_0x19a2('0x12')]);}logger[_0x19a2('0xf')]('SquareOdbc,\x20%s,\x20%s',_0xe80faa,_0xf7fe27['error'][_0x19a2('0x12')]);return _0x32d13d(_0xf7fe27['error'][_0x19a2('0x12')]);}else{logger[_0x19a2('0xa')](_0x19a2('0x11'),_0xe80faa,_0x19a2('0xb'));_0x32d13d(_0xf7fe27[_0x19a2('0x13')][_0x19a2('0x12')]);}})['catch'](function(_0x2a1035){logger['error']('SquareOdbc,\x20%s,\x20%s',_0xe80faa,_0x2a1035);_0xa6a4f7(_0x2a1035);});});}exports[_0x19a2('0x14')]=function(_0x57c370){var _0x4fc5a6=this;return new Promise(function(_0x5b1e21,_0x45955b){return db[_0x19a2('0x15')]['find']({'raw':_0x57c370[_0x19a2('0x16')]?_0x57c370[_0x19a2('0x16')][_0x19a2('0x17')]===undefined?!![]:![]:!![],'where':_0x57c370['options']?_0x57c370['options'][_0x19a2('0x18')]||null:null,'attributes':_0x57c370[_0x19a2('0x16')]?_0x57c370[_0x19a2('0x16')][_0x19a2('0x19')]||null:null,'include':_0x57c370['options']?_0x57c370[_0x19a2('0x16')][_0x19a2('0x1a')]?_['map'](_0x57c370['options'][_0x19a2('0x1a')],function(_0x579187){return{'model':db[_0x579187[_0x19a2('0x1b')]],'as':_0x579187['as'],'attributes':_0x579187[_0x19a2('0x19')],'include':_0x579187[_0x19a2('0x1a')]?_['map'](_0x579187['include'],function(_0x5d6a27){return{'model':db[_0x5d6a27[_0x19a2('0x1b')]],'as':_0x5d6a27['as'],'attributes':_0x5d6a27[_0x19a2('0x19')],'include':_0x5d6a27[_0x19a2('0x1a')]?_[_0x19a2('0x1c')](_0x5d6a27[_0x19a2('0x1a')],function(_0x2e292e){return{'model':db[_0x2e292e[_0x19a2('0x1b')]],'as':_0x2e292e['as'],'attributes':_0x2e292e[_0x19a2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x19a2('0x9')](function(_0x3fbcb6){logger[_0x19a2('0xa')](_0x19a2('0x14'),_0x57c370);logger[_0x19a2('0xc')](_0x19a2('0x14'),_0x57c370,JSON[_0x19a2('0xe')](_0x3fbcb6));_0x5b1e21(_0x3fbcb6);})[_0x19a2('0x1d')](function(_0x2b8f50){logger[_0x19a2('0xf')](_0x19a2('0x14'),_0x2b8f50['message'],_0x57c370);_0x45955b(_0x4fc5a6[_0x19a2('0xf')](0x1f4,_0x2b8f50[_0x19a2('0x12')]));});});}; \ No newline at end of file +var _0x6e19=['stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','info','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6e19,0x16d));var _0x96e1=function(_0x1af3e4,_0x4bb7ef){_0x1af3e4=_0x1af3e4-0x0;var _0x5a7ba4=_0x6e19[_0x1af3e4];return _0x5a7ba4;};'use strict';var _=require('lodash');var util=require(_0x96e1('0x0'));var moment=require(_0x96e1('0x1'));var BPromise=require(_0x96e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96e1('0x3'));var db=require(_0x96e1('0x4'))['db'];var utils=require(_0x96e1('0x5'));var logger=require('../../config/logger')(_0x96e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x96e1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cafed,_0x1136c1,_0x32087f){return new BPromise(function(_0x8700a7,_0x27d3f1){return client[_0x96e1('0x8')](_0x1cafed,_0x32087f)[_0x96e1('0x9')](function(_0x261a24){logger['info'](_0x96e1('0xa'),_0x1136c1,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1136c1,_0x96e1('0xb'),JSON[_0x96e1('0xc')](_0x261a24));if(_0x261a24[_0x96e1('0xd')]){if(_0x261a24[_0x96e1('0xd')]['code']===0x1f4){logger[_0x96e1('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x1136c1,_0x261a24['error'][_0x96e1('0xe')]);return _0x27d3f1(_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);}logger['error'](_0x96e1('0xa'),_0x1136c1,_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);return _0x8700a7(_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x1136c1,_0x96e1('0xb'));_0x8700a7(_0x261a24[_0x96e1('0xf')]['message']);}})['catch'](function(_0x265592){logger[_0x96e1('0xd')](_0x96e1('0xa'),_0x1136c1,_0x265592);_0x27d3f1(_0x265592);});});}exports[_0x96e1('0x10')]=function(_0x2cee43){var _0x3bafe9=this;return new Promise(function(_0x268cfa,_0x3db100){return db[_0x96e1('0x11')][_0x96e1('0x12')]({'raw':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x14')]===undefined?!![]:![]:!![],'where':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x15')]||null:null,'attributes':_0x2cee43[_0x96e1('0x13')]?_0x2cee43['options']['attributes']||null:null,'include':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x2cee43['options'][_0x96e1('0x16')],function(_0x2c4d75){return{'model':db[_0x2c4d75[_0x96e1('0x18')]],'as':_0x2c4d75['as'],'attributes':_0x2c4d75[_0x96e1('0x19')],'include':_0x2c4d75[_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x2c4d75[_0x96e1('0x16')],function(_0x279b8e){return{'model':db[_0x279b8e[_0x96e1('0x18')]],'as':_0x279b8e['as'],'attributes':_0x279b8e['attributes'],'include':_0x279b8e[_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x279b8e[_0x96e1('0x16')],function(_0x328590){return{'model':db[_0x328590[_0x96e1('0x18')]],'as':_0x328590['as'],'attributes':_0x328590[_0x96e1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b0ea6){logger[_0x96e1('0x1a')]('ShowSquareOdbc',_0x2cee43);logger[_0x96e1('0x1b')](_0x96e1('0x10'),_0x2cee43,JSON[_0x96e1('0xc')](_0x3b0ea6));_0x268cfa(_0x3b0ea6);})[_0x96e1('0x1c')](function(_0x1ea688){logger[_0x96e1('0xd')](_0x96e1('0x10'),_0x1ea688['message'],_0x2cee43);_0x3db100(_0x3bafe9['error'](0x1f4,_0x1ea688[_0x96e1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index eecbf42..1ec50c6 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 _0xa509=['getUsers','post','create','addUsers','put','/:id','update','delete','removeUsers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id/users'];(function(_0x374b08,_0x26f0ef){var _0x3abec8=function(_0x5d6271){while(--_0x5d6271){_0x374b08['push'](_0x374b08['shift']());}};_0x3abec8(++_0x26f0ef);}(_0xa509,0x12f));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9a50('0x0'));var util=require(_0x9a50('0x1'));var path=require(_0x9a50('0x2'));var timeout=require(_0x9a50('0x3'));var express=require('express');var router=express[_0x9a50('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a50('0x5'));var interaction=require(_0x9a50('0x6'));var config=require(_0x9a50('0x7'));var controller=require(_0x9a50('0x8'));router['get']('/',auth[_0x9a50('0x9')](),controller['index']);router[_0x9a50('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x9a50('0xb'),auth[_0x9a50('0x9')](),controller[_0x9a50('0xc')]);router[_0x9a50('0xd')]('/',auth[_0x9a50('0x9')](),controller[_0x9a50('0xe')]);router[_0x9a50('0xd')](_0x9a50('0xb'),auth[_0x9a50('0x9')](),controller[_0x9a50('0xf')]);router[_0x9a50('0x10')](_0x9a50('0x11'),auth[_0x9a50('0x9')](),controller[_0x9a50('0x12')]);router[_0x9a50('0x13')](_0x9a50('0x11'),auth[_0x9a50('0x9')](),controller['destroy']);router['delete'](_0x9a50('0xb'),auth[_0x9a50('0x9')](),controller[_0x9a50('0x14')]);module['exports']=router; \ No newline at end of file +var _0x174b=['get','isAuthenticated','index','/:id','show','/:id/users','post','create','put','update','delete','removeUsers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x394cbe,_0xc005e){var _0x3de7ec=function(_0x4ed371){while(--_0x4ed371){_0x394cbe['push'](_0x394cbe['shift']());}};_0x3de7ec(++_0xc005e);}(_0x174b,0x19d));var _0xb174=function(_0x35b764,_0x11b9bb){_0x35b764=_0x35b764-0x0;var _0x4cded2=_0x174b[_0x35b764];return _0x4cded2;};'use strict';var multer=require(_0xb174('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb174('0x1'));var express=require(_0xb174('0x2'));var router=express[_0xb174('0x3')]();var fs_extra=require(_0xb174('0x4'));var auth=require(_0xb174('0x5'));var interaction=require(_0xb174('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xb174('0x7')]('/',auth[_0xb174('0x8')](),controller[_0xb174('0x9')]);router[_0xb174('0x7')](_0xb174('0xa'),auth[_0xb174('0x8')](),controller[_0xb174('0xb')]);router[_0xb174('0x7')](_0xb174('0xc'),auth[_0xb174('0x8')](),controller['getUsers']);router[_0xb174('0xd')]('/',auth['isAuthenticated'](),controller[_0xb174('0xe')]);router[_0xb174('0xd')]('/:id/users',auth[_0xb174('0x8')](),controller['addUsers']);router[_0xb174('0xf')](_0xb174('0xa'),auth['isAuthenticated'](),controller[_0xb174('0x10')]);router[_0xb174('0x11')](_0xb174('0xa'),auth[_0xb174('0x8')](),controller['destroy']);router[_0xb174('0x11')]('/:id/users',auth[_0xb174('0x8')](),controller[_0xb174('0x12')]);module[_0xb174('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index d29ef5c..c0d873c 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 _0x2c9b=['utf8','DATE','sequelize','exports','STRING','TEXT','BLOB','long','preproduction','getDataValue','toString'];(function(_0xd6e343,_0x41a619){var _0x5c0e4a=function(_0x2a8e6a){while(--_0x2a8e6a){_0xd6e343['push'](_0xd6e343['shift']());}};_0x5c0e4a(++_0x41a619);}(_0x2c9b,0x141));var _0xb2c9=function(_0x51b8a3,_0x4c49af){_0x51b8a3=_0x51b8a3-0x0;var _0x40ed9d=_0x2c9b[_0x51b8a3];return _0x40ed9d;};'use strict';var Sequelize=require(_0xb2c9('0x0'));module[_0xb2c9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb2c9('0x2')]},'notes':{'type':Sequelize[_0xb2c9('0x3')]},'preproduction':{'type':Sequelize[_0xb2c9('0x4')](_0xb2c9('0x5')),'get':function(){if(this['getDataValue'](_0xb2c9('0x6'))){return this[_0xb2c9('0x7')]('preproduction')[_0xb2c9('0x8')](_0xb2c9('0x9'));}}},'production':{'type':Sequelize[_0xb2c9('0x4')](_0xb2c9('0x5')),'get':function(){if(this[_0xb2c9('0x7')]('production')){return this['getDataValue']('production')['toString'](_0xb2c9('0x9'));}}},'savedAt':{'type':Sequelize[_0xb2c9('0xa')]},'publishedAt':{'type':Sequelize[_0xb2c9('0xa')]}}; \ No newline at end of file +var _0x0ce9=['STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0x13413f,_0x23ea3d){var _0x108bd9=function(_0x497358){while(--_0x497358){_0x13413f['push'](_0x13413f['shift']());}};_0x108bd9(++_0x23ea3d);}(_0x0ce9,0x9a));var _0x90ce=function(_0x13827c,_0x2c55e1){_0x13827c=_0x13827c-0x0;var _0x47f641=_0x0ce9[_0x13827c];return _0x47f641;};'use strict';var Sequelize=require(_0x90ce('0x0'));module[_0x90ce('0x1')]={'name':{'type':Sequelize[_0x90ce('0x2')],'unique':_0x90ce('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x90ce('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x90ce('0x4')](_0x90ce('0x5')),'get':function(){if(this[_0x90ce('0x6')]('preproduction')){return this[_0x90ce('0x6')](_0x90ce('0x7'))[_0x90ce('0x8')](_0x90ce('0x9'));}}},'production':{'type':Sequelize[_0x90ce('0x4')]('long'),'get':function(){if(this[_0x90ce('0x6')]('production')){return this['getDataValue'](_0x90ce('0xa'))[_0x90ce('0x8')](_0x90ce('0x9'));}}},'savedAt':{'type':Sequelize[_0x90ce('0xb')]},'publishedAt':{'type':Sequelize[_0x90ce('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index bd51a54..4ac4ecf 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 _0xdf46=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','update','body','addUsers','ids','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','SquareProjects','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xdf46,0x88));var _0x6df4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdf46[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x6df4('0x0'));var rimraf=require(_0x6df4('0x1'));var zipdir=require(_0x6df4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6df4('0x3'));var moment=require(_0x6df4('0x4'));var BPromise=require(_0x6df4('0x5'));var Mustache=require(_0x6df4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6df4('0x7'));var csv=require(_0x6df4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6df4('0x9'));var _=require('lodash');var squel=require(_0x6df4('0xa'));var crypto=require(_0x6df4('0xb'));var jsforce=require(_0x6df4('0xc'));var deskjs=require(_0x6df4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6df4('0xe'));var Papa=require('papaparse');var Redis=require(_0x6df4('0xf'));var authService=require(_0x6df4('0x10'));var qs=require(_0x6df4('0x11'));var as=require(_0x6df4('0x12'));var hardwareService=require(_0x6df4('0x13'));var logger=require('../../config/logger')(_0x6df4('0x14'));var utils=require('../../config/utils');var config=require(_0x6df4('0x15'));var licenseUtil=require(_0x6df4('0x16'));var db=require(_0x6df4('0x17'))['db'];config['redis']=_[_0x6df4('0x18')](config['redis'],{'host':_0x6df4('0x19'),'port':0x18eb});var socket=require(_0x6df4('0x1a'))(new Redis(config[_0x6df4('0x1b')]));require(_0x6df4('0x1c'))[_0x6df4('0x1d')](socket);function respondWithStatusCode(_0x2a5875,_0x2c6978){_0x2c6978=_0x2c6978||0xcc;return function(_0x2ff45a){if(_0x2ff45a){return _0x2a5875['sendStatus'](_0x2c6978);}return _0x2a5875['status'](_0x2c6978)[_0x6df4('0x1e')]();};}function respondWithResult(_0x1180b,_0xdcf290){_0xdcf290=_0xdcf290||0xc8;return function(_0x2a4eca){if(_0x2a4eca){return _0x1180b[_0x6df4('0x1f')](_0xdcf290)[_0x6df4('0x20')](_0x2a4eca);}};}function respondWithFilteredResult(_0x4d9620,_0x68d33f){return function(_0x95ba08){if(_0x95ba08){var _0x1fd841=typeof _0x68d33f['offset']===_0x6df4('0x21')&&typeof _0x68d33f[_0x6df4('0x22')]===_0x6df4('0x21');var _0x117ed4=_0x95ba08[_0x6df4('0x23')];var _0x4499bd=_0x1fd841?0x0:_0x68d33f[_0x6df4('0x24')];var _0x4a94c2=_0x1fd841?_0x95ba08[_0x6df4('0x23')]:_0x68d33f['offset']+_0x68d33f[_0x6df4('0x22')];var _0x38188c;if(_0x4a94c2>=_0x117ed4){_0x4a94c2=_0x117ed4;_0x38188c=0xc8;}else{_0x38188c=0xce;}_0x4d9620['status'](_0x38188c);return _0x4d9620[_0x6df4('0x25')](_0x6df4('0x26'),_0x4499bd+'-'+_0x4a94c2+'/'+_0x117ed4)[_0x6df4('0x20')](_0x95ba08);}return null;};}function patchUpdates(_0x41aa16){return function(_0x1fa5c8){try{jsonpatch[_0x6df4('0x27')](_0x1fa5c8,_0x41aa16,!![]);}catch(_0x4b4d7e){return BPromise[_0x6df4('0x28')](_0x4b4d7e);}return _0x1fa5c8[_0x6df4('0x29')]();};}function saveUpdates(_0x45fb36,_0x3c760c){return function(_0x20ea1c){if(_0x20ea1c){return _0x20ea1c['update'](_0x45fb36)[_0x6df4('0x2a')](function(_0x3bf4f6){return _0x3bf4f6;});}return null;};}function removeEntity(_0x4fd153,_0x440a5a){return function(_0x4c12d7){if(_0x4c12d7){return _0x4c12d7[_0x6df4('0x2b')]()[_0x6df4('0x2a')](function(){var _0x3d0fb0=_0x4c12d7['get']({'plain':!![]});var _0x3ba5c8=_0x6df4('0x2c');return db[_0x6df4('0x2d')]['destroy']({'where':{'type':_0x3ba5c8,'resourceId':_0x3d0fb0['id']}})[_0x6df4('0x2a')](function(){return _0x4c12d7;});})[_0x6df4('0x2a')](function(){_0x4fd153['status'](0xcc)[_0x6df4('0x1e')]();});}};}function handleEntityNotFound(_0x5281c8,_0x43b3d6){return function(_0x5678cd){if(!_0x5678cd){_0x5281c8[_0x6df4('0x2e')](0x194);}return _0x5678cd;};}function handleError(_0x37f4ad,_0x56ef88){_0x56ef88=_0x56ef88||0x1f4;return function(_0x1051f9){logger[_0x6df4('0x2f')](_0x1051f9[_0x6df4('0x30')]);if(_0x1051f9[_0x6df4('0x31')]){delete _0x1051f9[_0x6df4('0x31')];}_0x37f4ad['status'](_0x56ef88)[_0x6df4('0x32')](_0x1051f9);};}exports[_0x6df4('0x33')]=function(_0x1f2942,_0x5d93cc){var _0x404edf={},_0x2a2d7e={},_0x43ed79={'count':0x0,'rows':[]};var _0x577d55=_[_0x6df4('0x34')](db[_0x6df4('0x35')][_0x6df4('0x36')],function(_0x41bda2){return{'name':_0x41bda2[_0x6df4('0x37')],'type':_0x41bda2[_0x6df4('0x38')]['key']};});_0x2a2d7e['model']=_[_0x6df4('0x34')](_0x577d55,'name');_0x2a2d7e[_0x6df4('0x39')]=_[_0x6df4('0x3a')](_0x1f2942[_0x6df4('0x39')]);_0x2a2d7e[_0x6df4('0x3b')]=_[_0x6df4('0x3c')](_0x2a2d7e[_0x6df4('0x3d')],_0x2a2d7e[_0x6df4('0x39')]);_0x404edf[_0x6df4('0x3e')]=_['intersection'](_0x2a2d7e['model'],qs[_0x6df4('0x3f')](_0x1f2942[_0x6df4('0x39')][_0x6df4('0x3f')]));_0x404edf['attributes']=_0x404edf['attributes'][_0x6df4('0x40')]?_0x404edf[_0x6df4('0x3e')]:_0x2a2d7e[_0x6df4('0x3d')];if(!_0x1f2942[_0x6df4('0x39')][_0x6df4('0x41')](_0x6df4('0x42'))){_0x404edf[_0x6df4('0x22')]=qs[_0x6df4('0x22')](_0x1f2942['query'][_0x6df4('0x22')]);_0x404edf[_0x6df4('0x24')]=qs[_0x6df4('0x24')](_0x1f2942[_0x6df4('0x39')][_0x6df4('0x24')]);}_0x404edf[_0x6df4('0x43')]=qs[_0x6df4('0x44')](_0x1f2942[_0x6df4('0x39')]['sort']);_0x404edf[_0x6df4('0x45')]=qs['filters'](_[_0x6df4('0x46')](_0x1f2942['query'],_0x2a2d7e[_0x6df4('0x3b')]),_0x577d55);if(_0x1f2942[_0x6df4('0x39')][_0x6df4('0x47')]){_0x404edf[_0x6df4('0x45')]=_[_0x6df4('0x48')](_0x404edf[_0x6df4('0x45')],{'$or':_[_0x6df4('0x34')](_0x577d55,function(_0x43da05){if(_0x43da05[_0x6df4('0x38')]!==_0x6df4('0x49')){var _0x2f11a8={};_0x2f11a8[_0x43da05[_0x6df4('0x31')]]={'$like':'%'+_0x1f2942['query'][_0x6df4('0x47')]+'%'};return _0x2f11a8;}})});}_0x404edf=_[_0x6df4('0x48')]({},_0x404edf,_0x1f2942['options']);var _0x239b2a={'where':_0x404edf[_0x6df4('0x45')]};return db['SquareProject'][_0x6df4('0x23')](_0x239b2a)[_0x6df4('0x2a')](function(_0x1f2325){_0x43ed79[_0x6df4('0x23')]=_0x1f2325;if(_0x1f2942[_0x6df4('0x39')][_0x6df4('0x4a')]){_0x404edf['include']=[{'all':!![]}];}return db['SquareProject'][_0x6df4('0x4b')](_0x404edf);})['then'](function(_0x1d00e1){_0x43ed79[_0x6df4('0x4c')]=_0x1d00e1;return _0x43ed79;})['then'](respondWithFilteredResult(_0x5d93cc,_0x404edf))[_0x6df4('0x4d')](handleError(_0x5d93cc,null));};exports[_0x6df4('0x4e')]=function(_0x272fd0,_0x24d5e4){var _0x2f9903={'raw':![],'where':{'id':_0x272fd0[_0x6df4('0x4f')]['id']}},_0x355558={};_0x355558['model']=_['keys'](db[_0x6df4('0x35')][_0x6df4('0x36')]);_0x355558[_0x6df4('0x39')]=_[_0x6df4('0x3a')](_0x272fd0[_0x6df4('0x39')]);_0x355558[_0x6df4('0x3b')]=_[_0x6df4('0x3c')](_0x355558[_0x6df4('0x3d')],_0x355558[_0x6df4('0x39')]);_0x2f9903[_0x6df4('0x3e')]=_['intersection'](_0x355558[_0x6df4('0x3d')],qs[_0x6df4('0x3f')](_0x272fd0['query'][_0x6df4('0x3f')]));_0x2f9903[_0x6df4('0x3e')]=_0x2f9903['attributes'][_0x6df4('0x40')]?_0x2f9903[_0x6df4('0x3e')]:_0x355558[_0x6df4('0x3d')];if(_0x272fd0['query'][_0x6df4('0x4a')]){_0x2f9903['include']=[{'all':!![]}];}_0x2f9903=_['merge']({},_0x2f9903,_0x272fd0[_0x6df4('0x50')]);return db[_0x6df4('0x35')][_0x6df4('0x51')](_0x2f9903)[_0x6df4('0x2a')](handleEntityNotFound(_0x24d5e4,null))['then'](respondWithResult(_0x24d5e4,null))[_0x6df4('0x4d')](handleError(_0x24d5e4,null));};exports['create']=function(_0x214c9e,_0x20ca3e){return db['SquareProject']['create'](_0x214c9e['body'],{})[_0x6df4('0x2a')](function(_0x23f0c8){var _0x4cd809=_0x214c9e[_0x6df4('0x52')][_0x6df4('0x53')]({'plain':!![]});if(!_0x4cd809)throw new Error(_0x6df4('0x54'));if(_0x4cd809[_0x6df4('0x55')]===_0x6df4('0x52')){var _0x3c39be=_0x23f0c8[_0x6df4('0x53')]({'plain':!![]});var _0x3742cd=_0x6df4('0x2c');return db[_0x6df4('0x56')][_0x6df4('0x51')]({'where':{'name':_0x3742cd,'userProfileId':_0x4cd809[_0x6df4('0x57')]},'raw':!![]})[_0x6df4('0x2a')](function(_0x1da7e9){if(_0x1da7e9&&_0x1da7e9[_0x6df4('0x58')]===0x0){return db[_0x6df4('0x2d')][_0x6df4('0x59')]({'name':_0x3c39be[_0x6df4('0x31')],'resourceId':_0x3c39be['id'],'type':_0x1da7e9[_0x6df4('0x31')],'sectionId':_0x1da7e9['id']},{})[_0x6df4('0x2a')](function(){return _0x23f0c8;});}else{return _0x23f0c8;}})[_0x6df4('0x4d')](function(_0x1e8d9f){logger[_0x6df4('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e8d9f);throw _0x1e8d9f;});}return _0x23f0c8;})[_0x6df4('0x2a')](respondWithResult(_0x20ca3e,0xc9))[_0x6df4('0x4d')](handleError(_0x20ca3e,null));};exports[_0x6df4('0x5a')]=function(_0x56752a,_0x38ef30){if(_0x56752a[_0x6df4('0x5b')]['id']){delete _0x56752a['body']['id'];}return db[_0x6df4('0x35')]['find']({'where':{'id':_0x56752a[_0x6df4('0x4f')]['id']}})[_0x6df4('0x2a')](handleEntityNotFound(_0x38ef30,null))[_0x6df4('0x2a')](saveUpdates(_0x56752a[_0x6df4('0x5b')],null))['then'](respondWithResult(_0x38ef30,null))[_0x6df4('0x4d')](handleError(_0x38ef30,null));};exports['destroy']=function(_0x42cba3,_0x5e6160){return db[_0x6df4('0x35')][_0x6df4('0x51')]({'where':{'id':_0x42cba3[_0x6df4('0x4f')]['id']}})[_0x6df4('0x2a')](handleEntityNotFound(_0x5e6160,null))[_0x6df4('0x2a')](removeEntity(_0x5e6160,null))[_0x6df4('0x4d')](handleError(_0x5e6160,null));};exports['addUsers']=function(_0x5dad4f,_0x30cb86,_0x109045){return db['SquareProject'][_0x6df4('0x51')]({'where':{'id':_0x5dad4f[_0x6df4('0x4f')]['id']}})[_0x6df4('0x2a')](handleEntityNotFound(_0x30cb86,null))[_0x6df4('0x2a')](function(_0x45d0e7){if(_0x45d0e7){return _0x45d0e7[_0x6df4('0x5c')](_0x5dad4f['body'][_0x6df4('0x5d')],_['omit'](_0x5dad4f['body'],[_0x6df4('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x30cb86,null))[_0x6df4('0x4d')](handleError(_0x30cb86,null));};exports[_0x6df4('0x5e')]=function(_0x15cea3,_0x5616ab,_0x47269d){return db[_0x6df4('0x35')]['find']({'where':{'id':_0x15cea3[_0x6df4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5616ab,null))[_0x6df4('0x2a')](function(_0x212188){if(_0x212188){return _0x212188['removeUsers'](_0x15cea3[_0x6df4('0x39')][_0x6df4('0x5d')])[_0x6df4('0x2a')](function(){if(_[_0x6df4('0x5f')](_0x15cea3[_0x6df4('0x39')][_0x6df4('0x5d')])){for(var _0x35c158=0x0;_0x35c158<_0x15cea3[_0x6df4('0x39')][_0x6df4('0x5d')]['length'];_0x35c158+=0x1){socket['emit'](_0x6df4('0x60'),{'UserId':Number(_0x15cea3[_0x6df4('0x39')]['ids'][_0x35c158]),'SquareProjectId':Number(_0x15cea3[_0x6df4('0x4f')]['id'])});}}else{socket[_0x6df4('0x61')](_0x6df4('0x60'),{'UserId':Number(_0x15cea3[_0x6df4('0x39')]['ids']),'SquareProjectId':Number(_0x15cea3[_0x6df4('0x4f')]['id'])});}});}})[_0x6df4('0x2a')](respondWithStatusCode(_0x5616ab,null))[_0x6df4('0x4d')](handleError(_0x5616ab,null));};exports[_0x6df4('0x62')]=function(_0x36b7d7,_0x2604b0,_0xedbbd0){var _0x43784e={};var _0x400aec={};var _0x1aeab3;var _0x21b762;return db['SquareProject'][_0x6df4('0x63')]({'where':{'id':_0x36b7d7[_0x6df4('0x4f')]['id']}})[_0x6df4('0x2a')](handleEntityNotFound(_0x2604b0,null))[_0x6df4('0x2a')](function(_0x5b9754){if(_0x5b9754){_0x1aeab3=_0x5b9754;_0x400aec[_0x6df4('0x3d')]=_[_0x6df4('0x3a')](db[_0x6df4('0x64')][_0x6df4('0x36')]);_0x400aec[_0x6df4('0x39')]=_[_0x6df4('0x3a')](_0x36b7d7[_0x6df4('0x39')]);_0x400aec['filters']=_['intersection'](_0x400aec['model'],_0x400aec[_0x6df4('0x39')]);_0x43784e[_0x6df4('0x3e')]=_[_0x6df4('0x3c')](_0x400aec['model'],qs[_0x6df4('0x3f')](_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x3f')]));_0x43784e[_0x6df4('0x3e')]=_0x43784e['attributes'][_0x6df4('0x40')]?_0x43784e[_0x6df4('0x3e')]:_0x400aec['model'];_0x43784e['order']=qs[_0x6df4('0x44')](_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x44')]);_0x43784e[_0x6df4('0x45')]=qs[_0x6df4('0x3b')](_[_0x6df4('0x46')](_0x36b7d7[_0x6df4('0x39')],_0x400aec[_0x6df4('0x3b')]));if(_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x47')]){_0x43784e[_0x6df4('0x45')]=_[_0x6df4('0x48')](_0x43784e[_0x6df4('0x45')],{'$or':_[_0x6df4('0x34')](_0x43784e[_0x6df4('0x3e')],function(_0x211693){var _0x42aea9={};_0x42aea9[_0x211693]={'$like':'%'+_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x47')]+'%'};return _0x42aea9;})});}_0x43784e=_['merge']({},_0x43784e,_0x36b7d7[_0x6df4('0x50')]);return _0x1aeab3[_0x6df4('0x62')](_0x43784e);}})[_0x6df4('0x2a')](function(_0x13ce75){if(_0x13ce75){_0x21b762=_0x13ce75[_0x6df4('0x40')];if(!_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x41')](_0x6df4('0x42'))){_0x43784e[_0x6df4('0x22')]=qs[_0x6df4('0x22')](_0x36b7d7['query'][_0x6df4('0x22')]);_0x43784e[_0x6df4('0x24')]=qs['offset'](_0x36b7d7[_0x6df4('0x39')][_0x6df4('0x24')]);}return _0x1aeab3['getUsers'](_0x43784e);}})[_0x6df4('0x2a')](function(_0x6dce48){if(_0x6dce48){return _0x6dce48?{'count':_0x21b762,'rows':_0x6dce48}:null;}})[_0x6df4('0x2a')](respondWithResult(_0x2604b0,null))[_0x6df4('0x4d')](handleError(_0x2604b0,null));}; \ No newline at end of file +var _0x4bfc=['rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','SquareProjects','destroy','sendStatus','error','name','send','index','map','SquareProject','fieldName','type','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x4bfc,0x19e));var _0xc4bf=function(_0x5985fa,_0x49637d){_0x5985fa=_0x5985fa-0x0;var _0x3d65ca=_0x4bfc[_0x5985fa];return _0x3d65ca;};'use strict';var emlformat=require(_0xc4bf('0x0'));var rimraf=require(_0xc4bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4bf('0x2'));var rp=require('request-promise');var moment=require(_0xc4bf('0x3'));var BPromise=require(_0xc4bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc4bf('0x5'));var sox=require(_0xc4bf('0x6'));var csv=require(_0xc4bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4bf('0x8'));var jsforce=require(_0xc4bf('0x9'));var deskjs=require(_0xc4bf('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc4bf('0xb'));var Papa=require(_0xc4bf('0xc'));var Redis=require(_0xc4bf('0xd'));var authService=require(_0xc4bf('0xe'));var qs=require(_0xc4bf('0xf'));var as=require(_0xc4bf('0x10'));var hardwareService=require(_0xc4bf('0x11'));var logger=require(_0xc4bf('0x12'))(_0xc4bf('0x13'));var utils=require(_0xc4bf('0x14'));var config=require(_0xc4bf('0x15'));var licenseUtil=require(_0xc4bf('0x16'));var db=require(_0xc4bf('0x17'))['db'];config[_0xc4bf('0x18')]=_[_0xc4bf('0x19')](config[_0xc4bf('0x18')],{'host':_0xc4bf('0x1a'),'port':0x18eb});var socket=require(_0xc4bf('0x1b'))(new Redis(config[_0xc4bf('0x18')]));require(_0xc4bf('0x1c'))[_0xc4bf('0x1d')](socket);function respondWithStatusCode(_0x4a3258,_0x3c1dcb){_0x3c1dcb=_0x3c1dcb||0xcc;return function(_0x36dc76){if(_0x36dc76){return _0x4a3258['sendStatus'](_0x3c1dcb);}return _0x4a3258[_0xc4bf('0x1e')](_0x3c1dcb)[_0xc4bf('0x1f')]();};}function respondWithResult(_0x20584a,_0x1f9900){_0x1f9900=_0x1f9900||0xc8;return function(_0x4b252f){if(_0x4b252f){return _0x20584a[_0xc4bf('0x1e')](_0x1f9900)[_0xc4bf('0x20')](_0x4b252f);}};}function respondWithFilteredResult(_0x3cb54f,_0x4fa5a3){return function(_0x1fd9ae){if(_0x1fd9ae){var _0x4a58a2=typeof _0x4fa5a3[_0xc4bf('0x21')]===_0xc4bf('0x22')&&typeof _0x4fa5a3[_0xc4bf('0x23')]===_0xc4bf('0x22');var _0x2d761f=_0x1fd9ae[_0xc4bf('0x24')];var _0x1aae75=_0x4a58a2?0x0:_0x4fa5a3[_0xc4bf('0x21')];var _0x261780=_0x4a58a2?_0x1fd9ae[_0xc4bf('0x24')]:_0x4fa5a3[_0xc4bf('0x21')]+_0x4fa5a3[_0xc4bf('0x23')];var _0x46c1d7;if(_0x261780>=_0x2d761f){_0x261780=_0x2d761f;_0x46c1d7=0xc8;}else{_0x46c1d7=0xce;}_0x3cb54f[_0xc4bf('0x1e')](_0x46c1d7);return _0x3cb54f[_0xc4bf('0x25')]('Content-Range',_0x1aae75+'-'+_0x261780+'/'+_0x2d761f)[_0xc4bf('0x20')](_0x1fd9ae);}return null;};}function patchUpdates(_0x3e31a8){return function(_0x39b6f4){try{jsonpatch[_0xc4bf('0x26')](_0x39b6f4,_0x3e31a8,!![]);}catch(_0x522843){return BPromise[_0xc4bf('0x27')](_0x522843);}return _0x39b6f4[_0xc4bf('0x28')]();};}function saveUpdates(_0x3887ae,_0x52253d){return function(_0x43794f){if(_0x43794f){return _0x43794f[_0xc4bf('0x29')](_0x3887ae)[_0xc4bf('0x2a')](function(_0x41aac5){return _0x41aac5;});}return null;};}function removeEntity(_0x5739e4,_0x479944){return function(_0x27674e){if(_0x27674e){return _0x27674e['destroy']()[_0xc4bf('0x2a')](function(){var _0x577fcf=_0x27674e[_0xc4bf('0x2b')]({'plain':!![]});var _0x168e7a=_0xc4bf('0x2c');return db['UserProfileResource'][_0xc4bf('0x2d')]({'where':{'type':_0x168e7a,'resourceId':_0x577fcf['id']}})[_0xc4bf('0x2a')](function(){return _0x27674e;});})[_0xc4bf('0x2a')](function(){_0x5739e4['status'](0xcc)[_0xc4bf('0x1f')]();});}};}function handleEntityNotFound(_0x53018b,_0x47b084){return function(_0xf75ec){if(!_0xf75ec){_0x53018b[_0xc4bf('0x2e')](0x194);}return _0xf75ec;};}function handleError(_0x36845d,_0x64ca59){_0x64ca59=_0x64ca59||0x1f4;return function(_0x42c627){logger[_0xc4bf('0x2f')](_0x42c627['stack']);if(_0x42c627['name']){delete _0x42c627[_0xc4bf('0x30')];}_0x36845d[_0xc4bf('0x1e')](_0x64ca59)[_0xc4bf('0x31')](_0x42c627);};}exports[_0xc4bf('0x32')]=function(_0x1b6c46,_0x5c3d65){var _0x10e779={},_0x572d62={},_0x173859={'count':0x0,'rows':[]};var _0x39af56=_[_0xc4bf('0x33')](db[_0xc4bf('0x34')]['rawAttributes'],function(_0x4e0ce8){return{'name':_0x4e0ce8[_0xc4bf('0x35')],'type':_0x4e0ce8[_0xc4bf('0x36')]['key']};});_0x572d62['model']=_['map'](_0x39af56,_0xc4bf('0x30'));_0x572d62[_0xc4bf('0x37')]=_['keys'](_0x1b6c46['query']);_0x572d62[_0xc4bf('0x38')]=_['intersection'](_0x572d62[_0xc4bf('0x39')],_0x572d62[_0xc4bf('0x37')]);_0x10e779['attributes']=_[_0xc4bf('0x3a')](_0x572d62['model'],qs['fields'](_0x1b6c46['query'][_0xc4bf('0x3b')]));_0x10e779['attributes']=_0x10e779[_0xc4bf('0x3c')]['length']?_0x10e779[_0xc4bf('0x3c')]:_0x572d62[_0xc4bf('0x39')];if(!_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x3d')](_0xc4bf('0x3e'))){_0x10e779['limit']=qs[_0xc4bf('0x23')](_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x23')]);_0x10e779[_0xc4bf('0x21')]=qs['offset'](_0x1b6c46['query'][_0xc4bf('0x21')]);}_0x10e779[_0xc4bf('0x3f')]=qs['sort'](_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x40')]);_0x10e779[_0xc4bf('0x41')]=qs['filters'](_[_0xc4bf('0x42')](_0x1b6c46[_0xc4bf('0x37')],_0x572d62[_0xc4bf('0x38')]),_0x39af56);if(_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x43')]){_0x10e779[_0xc4bf('0x41')]=_[_0xc4bf('0x44')](_0x10e779['where'],{'$or':_[_0xc4bf('0x33')](_0x39af56,function(_0x2077dd){if(_0x2077dd['type']!==_0xc4bf('0x45')){var _0x23df2d={};_0x23df2d[_0x2077dd[_0xc4bf('0x30')]]={'$like':'%'+_0x1b6c46['query'][_0xc4bf('0x43')]+'%'};return _0x23df2d;}})});}_0x10e779=_[_0xc4bf('0x44')]({},_0x10e779,_0x1b6c46[_0xc4bf('0x46')]);var _0x31f026={'where':_0x10e779[_0xc4bf('0x41')]};return db[_0xc4bf('0x34')][_0xc4bf('0x24')](_0x31f026)['then'](function(_0x526a80){_0x173859[_0xc4bf('0x24')]=_0x526a80;if(_0x1b6c46['query']['includeAll']){_0x10e779[_0xc4bf('0x47')]=[{'all':!![]}];}return db[_0xc4bf('0x34')][_0xc4bf('0x48')](_0x10e779);})[_0xc4bf('0x2a')](function(_0x324805){_0x173859['rows']=_0x324805;return _0x173859;})[_0xc4bf('0x2a')](respondWithFilteredResult(_0x5c3d65,_0x10e779))[_0xc4bf('0x49')](handleError(_0x5c3d65,null));};exports['show']=function(_0x2eb881,_0x5c5b44){var _0x52d4b5={'raw':![],'where':{'id':_0x2eb881[_0xc4bf('0x4a')]['id']}},_0x257de9={};_0x257de9[_0xc4bf('0x39')]=_[_0xc4bf('0x4b')](db[_0xc4bf('0x34')][_0xc4bf('0x4c')]);_0x257de9[_0xc4bf('0x37')]=_[_0xc4bf('0x4b')](_0x2eb881[_0xc4bf('0x37')]);_0x257de9[_0xc4bf('0x38')]=_[_0xc4bf('0x3a')](_0x257de9['model'],_0x257de9[_0xc4bf('0x37')]);_0x52d4b5[_0xc4bf('0x3c')]=_['intersection'](_0x257de9['model'],qs[_0xc4bf('0x3b')](_0x2eb881[_0xc4bf('0x37')][_0xc4bf('0x3b')]));_0x52d4b5['attributes']=_0x52d4b5[_0xc4bf('0x3c')][_0xc4bf('0x4d')]?_0x52d4b5[_0xc4bf('0x3c')]:_0x257de9[_0xc4bf('0x39')];if(_0x2eb881['query'][_0xc4bf('0x4e')]){_0x52d4b5[_0xc4bf('0x47')]=[{'all':!![]}];}_0x52d4b5=_['merge']({},_0x52d4b5,_0x2eb881[_0xc4bf('0x46')]);return db[_0xc4bf('0x34')][_0xc4bf('0x4f')](_0x52d4b5)['then'](handleEntityNotFound(_0x5c5b44,null))['then'](respondWithResult(_0x5c5b44,null))[_0xc4bf('0x49')](handleError(_0x5c5b44,null));};exports[_0xc4bf('0x50')]=function(_0xc61a4d,_0x2e8d2f){return db[_0xc4bf('0x34')][_0xc4bf('0x50')](_0xc61a4d[_0xc4bf('0x51')],{})[_0xc4bf('0x2a')](function(_0x5dfac6){var _0x5a6b10=_0xc61a4d[_0xc4bf('0x52')][_0xc4bf('0x2b')]({'plain':!![]});if(!_0x5a6b10)throw new Error(_0xc4bf('0x53'));if(_0x5a6b10[_0xc4bf('0x54')]===_0xc4bf('0x52')){var _0x107ecb=_0x5dfac6['get']({'plain':!![]});var _0x801a52=_0xc4bf('0x2c');return db['UserProfileSection'][_0xc4bf('0x4f')]({'where':{'name':_0x801a52,'userProfileId':_0x5a6b10[_0xc4bf('0x55')]},'raw':!![]})[_0xc4bf('0x2a')](function(_0x431668){if(_0x431668&&_0x431668[_0xc4bf('0x56')]===0x0){return db[_0xc4bf('0x57')][_0xc4bf('0x50')]({'name':_0x107ecb[_0xc4bf('0x30')],'resourceId':_0x107ecb['id'],'type':_0x431668[_0xc4bf('0x30')],'sectionId':_0x431668['id']},{})[_0xc4bf('0x2a')](function(){return _0x5dfac6;});}else{return _0x5dfac6;}})[_0xc4bf('0x49')](function(_0xecd00d){logger[_0xc4bf('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xecd00d);throw _0xecd00d;});}return _0x5dfac6;})['then'](respondWithResult(_0x2e8d2f,0xc9))[_0xc4bf('0x49')](handleError(_0x2e8d2f,null));};exports[_0xc4bf('0x29')]=function(_0x5dec9a,_0xafe1ed){if(_0x5dec9a[_0xc4bf('0x51')]['id']){delete _0x5dec9a[_0xc4bf('0x51')]['id'];}return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x5dec9a['params']['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0xafe1ed,null))[_0xc4bf('0x2a')](saveUpdates(_0x5dec9a['body'],null))[_0xc4bf('0x2a')](respondWithResult(_0xafe1ed,null))[_0xc4bf('0x49')](handleError(_0xafe1ed,null));};exports['destroy']=function(_0x5a8314,_0xfc6dd){return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x5a8314[_0xc4bf('0x4a')]['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0xfc6dd,null))[_0xc4bf('0x2a')](removeEntity(_0xfc6dd,null))[_0xc4bf('0x49')](handleError(_0xfc6dd,null));};exports[_0xc4bf('0x58')]=function(_0x351902,_0x2d790f,_0x539f61){return db[_0xc4bf('0x34')]['find']({'where':{'id':_0x351902['params']['id']}})['then'](handleEntityNotFound(_0x2d790f,null))['then'](function(_0x16b91a){if(_0x16b91a){return _0x16b91a[_0xc4bf('0x58')](_0x351902[_0xc4bf('0x51')][_0xc4bf('0x59')],_[_0xc4bf('0x5a')](_0x351902[_0xc4bf('0x51')],['ids','id'])||{});}})[_0xc4bf('0x2a')](respondWithResult(_0x2d790f,null))[_0xc4bf('0x49')](handleError(_0x2d790f,null));};exports[_0xc4bf('0x5b')]=function(_0x3941e0,_0x29b5aa,_0x4f9f39){return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x3941e0[_0xc4bf('0x4a')]['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0x29b5aa,null))[_0xc4bf('0x2a')](function(_0x30bbfa){if(_0x30bbfa){return _0x30bbfa[_0xc4bf('0x5b')](_0x3941e0[_0xc4bf('0x37')]['ids'])['then'](function(){if(_[_0xc4bf('0x5c')](_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')])){for(var _0x3f763d=0x0;_0x3f763d<_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')][_0xc4bf('0x4d')];_0x3f763d+=0x1){socket[_0xc4bf('0x5d')](_0xc4bf('0x5e'),{'UserId':Number(_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')][_0x3f763d]),'SquareProjectId':Number(_0x3941e0[_0xc4bf('0x4a')]['id'])});}}else{socket['emit'](_0xc4bf('0x5e'),{'UserId':Number(_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')]),'SquareProjectId':Number(_0x3941e0['params']['id'])});}});}})[_0xc4bf('0x2a')](respondWithStatusCode(_0x29b5aa,null))[_0xc4bf('0x49')](handleError(_0x29b5aa,null));};exports[_0xc4bf('0x5f')]=function(_0x374494,_0x4ad7e9,_0xb7d3f2){var _0x220d3d={};var _0x5b8de9={};var _0x28c174;var _0x554b66;return db['SquareProject'][_0xc4bf('0x60')]({'where':{'id':_0x374494[_0xc4bf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ad7e9,null))['then'](function(_0x21a4e4){if(_0x21a4e4){_0x28c174=_0x21a4e4;_0x5b8de9[_0xc4bf('0x39')]=_[_0xc4bf('0x4b')](db[_0xc4bf('0x61')]['rawAttributes']);_0x5b8de9[_0xc4bf('0x37')]=_[_0xc4bf('0x4b')](_0x374494[_0xc4bf('0x37')]);_0x5b8de9[_0xc4bf('0x38')]=_[_0xc4bf('0x3a')](_0x5b8de9[_0xc4bf('0x39')],_0x5b8de9[_0xc4bf('0x37')]);_0x220d3d[_0xc4bf('0x3c')]=_[_0xc4bf('0x3a')](_0x5b8de9[_0xc4bf('0x39')],qs[_0xc4bf('0x3b')](_0x374494[_0xc4bf('0x37')]['fields']));_0x220d3d[_0xc4bf('0x3c')]=_0x220d3d[_0xc4bf('0x3c')]['length']?_0x220d3d[_0xc4bf('0x3c')]:_0x5b8de9[_0xc4bf('0x39')];_0x220d3d['order']=qs[_0xc4bf('0x40')](_0x374494[_0xc4bf('0x37')][_0xc4bf('0x40')]);_0x220d3d[_0xc4bf('0x41')]=qs[_0xc4bf('0x38')](_[_0xc4bf('0x42')](_0x374494['query'],_0x5b8de9['filters']));if(_0x374494[_0xc4bf('0x37')][_0xc4bf('0x43')]){_0x220d3d[_0xc4bf('0x41')]=_[_0xc4bf('0x44')](_0x220d3d[_0xc4bf('0x41')],{'$or':_[_0xc4bf('0x33')](_0x220d3d[_0xc4bf('0x3c')],function(_0x350cb2){var _0x4eacc3={};_0x4eacc3[_0x350cb2]={'$like':'%'+_0x374494[_0xc4bf('0x37')]['filter']+'%'};return _0x4eacc3;})});}_0x220d3d=_[_0xc4bf('0x44')]({},_0x220d3d,_0x374494[_0xc4bf('0x46')]);return _0x28c174['getUsers'](_0x220d3d);}})[_0xc4bf('0x2a')](function(_0x2a3dea){if(_0x2a3dea){_0x554b66=_0x2a3dea[_0xc4bf('0x4d')];if(!_0x374494['query']['hasOwnProperty']('nolimit')){_0x220d3d['limit']=qs[_0xc4bf('0x23')](_0x374494[_0xc4bf('0x37')]['limit']);_0x220d3d['offset']=qs[_0xc4bf('0x21')](_0x374494[_0xc4bf('0x37')][_0xc4bf('0x21')]);}return _0x28c174['getUsers'](_0x220d3d);}})[_0xc4bf('0x2a')](function(_0x19c8a5){if(_0x19c8a5){return _0x19c8a5?{'count':_0x554b66,'rows':_0x19c8a5}:null;}})[_0xc4bf('0x2a')](respondWithResult(_0x4ad7e9,null))[_0xc4bf('0x49')](handleError(_0x4ad7e9,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5f68b0a..e320831 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 _0x62b4=['save','remove','emit','exports','events','../../mysqldb','SquareProject'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0x62b4,0x10e));var _0x462b=function(_0x2e0854,_0x52544a){_0x2e0854=_0x2e0854-0x0;var _0x4d0ff9=_0x62b4[_0x2e0854];return _0x4d0ff9;};'use strict';var EventEmitter=require(_0x462b('0x0'));var SquareProject=require(_0x462b('0x1'))['db'][_0x462b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x462b('0x3'),'afterUpdate':'update','afterDestroy':_0x462b('0x4')};function emitEvent(_0x5c44a7){return function(_0x4dcc3d,_0x5d7887,_0x12b38c){SquareProjectEvents['emit'](_0x5c44a7+':'+_0x4dcc3d['id'],_0x4dcc3d);SquareProjectEvents[_0x462b('0x5')](_0x5c44a7,_0x4dcc3d);_0x12b38c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x462b('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x1cf0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1cf0,0x1e2));var _0x01cf=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x1cf0[_0x213518];return _0x1baf75;};'use strict';var EventEmitter=require(_0x01cf('0x0'));var SquareProject=require(_0x01cf('0x1'))['db'][_0x01cf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x01cf('0x3'),'afterDestroy':_0x01cf('0x4')};function emitEvent(_0x2c4b89){return function(_0x3c985c,_0x51b1aa,_0x8d8ec6){SquareProjectEvents[_0x01cf('0x5')](_0x2c4b89+':'+_0x3c985c['id'],_0x3c985c);SquareProjectEvents['emit'](_0x2c4b89,_0x3c985c);_0x8d8ec6(null);};}for(var e in events){if(events[_0x01cf('0x6')](e)){var event=events[e];SquareProject[_0x01cf('0x7')](e,emitEvent(event));}}module[_0x01cf('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 334546e..c45ba52 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 _0xec66=['changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','square_projects'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xec66,0x1f1));var _0x6ec6=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0xec66[_0x3388d8];return _0x2bbe73;};'use strict';var _=require('lodash');var util=require(_0x6ec6('0x0'));var logger=require(_0x6ec6('0x1'))(_0x6ec6('0x2'));var moment=require(_0x6ec6('0x3'));var BPromise=require(_0x6ec6('0x4'));var rp=require(_0x6ec6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ec6('0x6'));var attributes=require(_0x6ec6('0x7'));module[_0x6ec6('0x8')]=function(_0x56401a,_0x5e46d6){return _0x56401a['define']('SquareProject',attributes,{'tableName':_0x6ec6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cfced,_0x67d8de,_0x4bbae6){if(_0x3cfced[_0x6ec6('0xa')]('preproduction')){_0x3cfced['savedAt']=moment()[_0x6ec6('0xb')](_0x6ec6('0xc'));}if(_0x3cfced[_0x6ec6('0xa')]('production')){_0x3cfced['publishedAt']=moment()[_0x6ec6('0xb')](_0x6ec6('0xc'));}_0x4bbae6(null,_0x3cfced);}}});}; \ No newline at end of file +var _0xdb35=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4ccec6,_0x249927){var _0xb841b=function(_0x274519){while(--_0x274519){_0x4ccec6['push'](_0x4ccec6['shift']());}};_0xb841b(++_0x249927);}(_0xdb35,0x1ef));var _0x5db3=function(_0x8307e3,_0x48eb78){_0x8307e3=_0x8307e3-0x0;var _0x492db9=_0xdb35[_0x8307e3];return _0x492db9;};'use strict';var _=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var logger=require('../../config/logger')(_0x5db3('0x2'));var moment=require(_0x5db3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5db3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5db3('0x5'));var config=require(_0x5db3('0x6'));var attributes=require('./squareProject.attributes');module[_0x5db3('0x7')]=function(_0x450d4e,_0x561d99){return _0x450d4e['define'](_0x5db3('0x8'),attributes,{'tableName':_0x5db3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bd01d,_0x137f06,_0xb5a4c7){if(_0x3bd01d[_0x5db3('0xa')](_0x5db3('0xb'))){_0x3bd01d[_0x5db3('0xc')]=moment()[_0x5db3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3bd01d['changed']('production')){_0x3bd01d['publishedAt']=moment()[_0x5db3('0xd')](_0x5db3('0xe'));}_0xb5a4c7(null,_0x3bd01d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0af3431..74bc094 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 _0xd14a=['request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSquareProject','SquareProject','options','raw','attributes','include','map','model','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x5027dc,_0x567afa){var _0xc4bd14=function(_0x5b180d){while(--_0x5b180d){_0x5027dc['push'](_0x5027dc['shift']());}};_0xc4bd14(++_0x567afa);}(_0xd14a,0x83));var _0xad14=function(_0x547a79,_0x3de915){_0x547a79=_0x547a79-0x0;var _0x2b6eb8=_0xd14a[_0x547a79];return _0x2b6eb8;};'use strict';var _=require(_0xad14('0x0'));var util=require(_0xad14('0x1'));var moment=require(_0xad14('0x2'));var BPromise=require(_0xad14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad14('0x4'));var db=require(_0xad14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad14('0x6'))(_0xad14('0x7'));var config=require(_0xad14('0x8'));var jayson=require(_0xad14('0x9'));var client=jayson[_0xad14('0xa')][_0xad14('0xb')]({'port':0x232a});config[_0xad14('0xc')]=_[_0xad14('0xd')](config[_0xad14('0xc')],{'host':_0xad14('0xe'),'port':0x18eb});var socket=require(_0xad14('0xf'))(new Redis(config[_0xad14('0xc')]));require(_0xad14('0x10'))['register'](socket);function respondWithRpcPromise(_0x5dc9ae,_0x3aee6d,_0x441abb){return new BPromise(function(_0x280194,_0x2189f1){return client[_0xad14('0x11')](_0x5dc9ae,_0x441abb)[_0xad14('0x12')](function(_0x698d59){logger[_0xad14('0x13')](_0xad14('0x14'),_0x3aee6d,_0xad14('0x15'));logger[_0xad14('0x16')](_0xad14('0x17'),_0x3aee6d,_0xad14('0x15'),JSON[_0xad14('0x18')](_0x698d59));if(_0x698d59['error']){if(_0x698d59[_0xad14('0x19')][_0xad14('0x1a')]===0x1f4){logger[_0xad14('0x19')](_0xad14('0x14'),_0x3aee6d,_0x698d59['error'][_0xad14('0x1b')]);return _0x2189f1(_0x698d59['error'][_0xad14('0x1b')]);}logger[_0xad14('0x19')](_0xad14('0x14'),_0x3aee6d,_0x698d59[_0xad14('0x19')]['message']);return _0x280194(_0x698d59[_0xad14('0x19')][_0xad14('0x1b')]);}else{logger[_0xad14('0x13')](_0xad14('0x14'),_0x3aee6d,_0xad14('0x15'));_0x280194(_0x698d59['result'][_0xad14('0x1b')]);}})['catch'](function(_0x4526b2){logger['error'](_0xad14('0x14'),_0x3aee6d,_0x4526b2);_0x2189f1(_0x4526b2);});});}exports[_0xad14('0x1c')]=function(_0x136d8c){var _0x544688=this;return new Promise(function(_0x3700bc,_0x56865a){return db[_0xad14('0x1d')]['find']({'raw':_0x136d8c['options']?_0x136d8c[_0xad14('0x1e')][_0xad14('0x1f')]===undefined?!![]:![]:!![],'where':_0x136d8c[_0xad14('0x1e')]?_0x136d8c[_0xad14('0x1e')]['where']||null:null,'attributes':_0x136d8c[_0xad14('0x1e')]?_0x136d8c[_0xad14('0x1e')][_0xad14('0x20')]||null:null,'include':_0x136d8c[_0xad14('0x1e')]?_0x136d8c['options'][_0xad14('0x21')]?_['map'](_0x136d8c[_0xad14('0x1e')]['include'],function(_0x3af722){return{'model':db[_0x3af722['model']],'as':_0x3af722['as'],'attributes':_0x3af722[_0xad14('0x20')],'include':_0x3af722[_0xad14('0x21')]?_[_0xad14('0x22')](_0x3af722[_0xad14('0x21')],function(_0x45b947){return{'model':db[_0x45b947['model']],'as':_0x45b947['as'],'attributes':_0x45b947['attributes'],'include':_0x45b947[_0xad14('0x21')]?_['map'](_0x45b947['include'],function(_0x11899d){return{'model':db[_0x11899d[_0xad14('0x23')]],'as':_0x11899d['as'],'attributes':_0x11899d[_0xad14('0x20')]};}):[]};}):[]};}):[]:[]})[_0xad14('0x12')](function(_0x1950b1){logger['info']('ShowSquareProject',_0x136d8c);logger[_0xad14('0x16')](_0xad14('0x1c'),_0x136d8c,JSON[_0xad14('0x18')](_0x1950b1));_0x3700bc(_0x1950b1);})[_0xad14('0x24')](function(_0x2b2559){logger[_0xad14('0x19')](_0xad14('0x1c'),_0x2b2559[_0xad14('0x1b')],_0x136d8c);_0x56865a(_0x544688[_0xad14('0x19')](0x1f4,_0x2b2559[_0xad14('0x1b')]));});});}; \ No newline at end of file +var _0xb478=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareProject','SquareProject','options','raw','where','attributes','map','include','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xb478,0x67));var _0x8b47=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0xb478[_0x14cb58];return _0x5f097e;};'use strict';var _=require(_0x8b47('0x0'));var util=require(_0x8b47('0x1'));var moment=require(_0x8b47('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b47('0x3'));var fs=require('fs');var Redis=require(_0x8b47('0x4'));var db=require(_0x8b47('0x5'))['db'];var utils=require(_0x8b47('0x6'));var logger=require(_0x8b47('0x7'))(_0x8b47('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b47('0x9')][_0x8b47('0xa')]({'port':0x232a});config[_0x8b47('0xb')]=_[_0x8b47('0xc')](config['redis'],{'host':_0x8b47('0xd'),'port':0x18eb});var socket=require(_0x8b47('0xe'))(new Redis(config[_0x8b47('0xb')]));require(_0x8b47('0xf'))[_0x8b47('0x10')](socket);function respondWithRpcPromise(_0x590367,_0x57803e,_0x5c10bb){return new BPromise(function(_0x2fdd76,_0x385f27){return client[_0x8b47('0x11')](_0x590367,_0x5c10bb)['then'](function(_0x288902){logger[_0x8b47('0x12')](_0x8b47('0x13'),_0x57803e,_0x8b47('0x14'));logger[_0x8b47('0x15')](_0x8b47('0x16'),_0x57803e,_0x8b47('0x14'),JSON[_0x8b47('0x17')](_0x288902));if(_0x288902[_0x8b47('0x18')]){if(_0x288902['error'][_0x8b47('0x19')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x57803e,_0x288902[_0x8b47('0x18')][_0x8b47('0x1a')]);return _0x385f27(_0x288902[_0x8b47('0x18')]['message']);}logger['error'](_0x8b47('0x13'),_0x57803e,_0x288902['error'][_0x8b47('0x1a')]);return _0x2fdd76(_0x288902['error'][_0x8b47('0x1a')]);}else{logger[_0x8b47('0x12')](_0x8b47('0x13'),_0x57803e,'request\x20sent');_0x2fdd76(_0x288902[_0x8b47('0x1b')][_0x8b47('0x1a')]);}})['catch'](function(_0x542136){logger[_0x8b47('0x18')](_0x8b47('0x13'),_0x57803e,_0x542136);_0x385f27(_0x542136);});});}exports[_0x8b47('0x1c')]=function(_0x39a231){var _0xda679=this;return new Promise(function(_0x5ced30,_0x45f688){return db[_0x8b47('0x1d')]['find']({'raw':_0x39a231[_0x8b47('0x1e')]?_0x39a231['options'][_0x8b47('0x1f')]===undefined?!![]:![]:!![],'where':_0x39a231[_0x8b47('0x1e')]?_0x39a231['options'][_0x8b47('0x20')]||null:null,'attributes':_0x39a231[_0x8b47('0x1e')]?_0x39a231[_0x8b47('0x1e')][_0x8b47('0x21')]||null:null,'include':_0x39a231[_0x8b47('0x1e')]?_0x39a231[_0x8b47('0x1e')]['include']?_[_0x8b47('0x22')](_0x39a231[_0x8b47('0x1e')][_0x8b47('0x23')],function(_0x32738d){return{'model':db[_0x32738d[_0x8b47('0x24')]],'as':_0x32738d['as'],'attributes':_0x32738d['attributes'],'include':_0x32738d[_0x8b47('0x23')]?_[_0x8b47('0x22')](_0x32738d[_0x8b47('0x23')],function(_0xbf701c){return{'model':db[_0xbf701c[_0x8b47('0x24')]],'as':_0xbf701c['as'],'attributes':_0xbf701c['attributes'],'include':_0xbf701c[_0x8b47('0x23')]?_[_0x8b47('0x22')](_0xbf701c[_0x8b47('0x23')],function(_0xb8273f){return{'model':db[_0xb8273f[_0x8b47('0x24')]],'as':_0xb8273f['as'],'attributes':_0xb8273f[_0x8b47('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8b47('0x25')](function(_0x323e0d){logger['info'](_0x8b47('0x1c'),_0x39a231);logger[_0x8b47('0x15')](_0x8b47('0x1c'),_0x39a231,JSON[_0x8b47('0x17')](_0x323e0d));_0x5ced30(_0x323e0d);})['catch'](function(_0x2a4864){logger[_0x8b47('0x18')](_0x8b47('0x1c'),_0x2a4864['message'],_0x39a231);_0x45f688(_0xda679[_0x8b47('0x18')](0x1f4,_0x2a4864['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index af7fe1c..db2b217 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 _0x985b=['length','squareProject:','save','update','emit','removeListener','register'];(function(_0x3e18a8,_0x482cb4){var _0x20bd0d=function(_0xb63cf){while(--_0xb63cf){_0x3e18a8['push'](_0x3e18a8['shift']());}};_0x20bd0d(++_0x482cb4);}(_0x985b,0x191));var _0xb985=function(_0x6ee93b,_0x573ada){_0x6ee93b=_0x6ee93b-0x0;var _0x4804ca=_0x985b[_0x6ee93b];return _0x4804ca;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xb985('0x0'),'remove',_0xb985('0x1')];function createListener(_0x30daea,_0x64babb){return function(_0x53fc90){_0x64babb[_0xb985('0x2')](_0x30daea,_0x53fc90);};}function removeListener(_0x55c637,_0xe160c9){return function(){SquareProjectEvents[_0xb985('0x3')](_0x55c637,_0xe160c9);};}exports[_0xb985('0x4')]=function(_0x3312c2){for(var _0x3b2f30=0x0,_0xf4aee5=events[_0xb985('0x5')];_0x3b2f30<_0xf4aee5;_0x3b2f30++){var _0x2f5677=events[_0x3b2f30];var _0x4f07dd=createListener(_0xb985('0x6')+_0x2f5677,_0x3312c2);SquareProjectEvents['on'](_0x2f5677,_0x4f07dd);}}; \ No newline at end of file +var _0x2978=['update','emit','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x4ab78f,_0x1cbc7f){var _0x5f1de1=function(_0x379c7c){while(--_0x379c7c){_0x4ab78f['push'](_0x4ab78f['shift']());}};_0x5f1de1(++_0x1cbc7f);}(_0x2978,0x11d));var _0x8297=function(_0x37cf35,_0x1b444f){_0x37cf35=_0x37cf35-0x0;var _0x306dfd=_0x2978[_0x37cf35];return _0x306dfd;};'use strict';var SquareProjectEvents=require(_0x8297('0x0'));var events=[_0x8297('0x1'),_0x8297('0x2'),_0x8297('0x3')];function createListener(_0x1858a6,_0xccf1f2){return function(_0x38404d){_0xccf1f2[_0x8297('0x4')](_0x1858a6,_0x38404d);};}function removeListener(_0x3b7537,_0x1767b4){return function(){SquareProjectEvents['removeListener'](_0x3b7537,_0x1767b4);};}exports[_0x8297('0x5')]=function(_0x200d87){for(var _0x220f2c=0x0,_0x4190bc=events[_0x8297('0x6')];_0x220f2c<_0x4190bc;_0x220f2c++){var _0x1187e2=events[_0x220f2c];var _0x4f63b0=createListener(_0x8297('0x7')+_0x1187e2,_0x200d87);SquareProjectEvents['on'](_0x1187e2,_0x4f63b0);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 34a59bb..9097bda 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(_0x57ccc0,_0x194c3e){var _0x47b45a=function(_0x2efc76){while(--_0x2efc76){_0x57ccc0['push'](_0x57ccc0['shift']());}};_0x47b45a(++_0x194c3e);}(_0xf494,0x1c6));var _0x4f49=function(_0x1a7bc9,_0x1b001d){_0x1a7bc9=_0x1a7bc9-0x0;var _0x3b7c98=_0xf494[_0x1a7bc9];return _0x3b7c98;};'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(_0x2e20ac,_0x5b4359){var _0x584dbb=function(_0x54d851){while(--_0x54d851){_0x2e20ac['push'](_0x2e20ac['shift']());}};_0x584dbb(++_0x5b4359);}(_0x5fab,0x177));var _0xb5fa=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5fab[_0xc4001c];return _0x49f7bc;};'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 7b795d4..2bc9144 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d17=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0xb86b7a,_0x3fe5c8){var _0x2dead2=function(_0x180c4c){while(--_0x180c4c){_0xb86b7a['push'](_0xb86b7a['shift']());}};_0x2dead2(++_0x3fe5c8);}(_0x5d17,0x114));var _0x75d1=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x5d17[_0xe9e6cf];return _0x2b8851;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'extension':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'dnid':{'type':Sequelize[_0x75d1('0x2')]},'projectName':{'type':Sequelize[_0x75d1('0x2')]},'saveName':{'type':Sequelize[_0x75d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x75d1('0x2')]},'format':{'type':Sequelize[_0x75d1('0x3')],'get':function(){var _0x5c957a='';var _0x1ee61b=this[_0x75d1('0x4')](_0x75d1('0x5'));if(_0x1ee61b){_0x5c957a=_0x1ee61b[_0x75d1('0x6')](_0x1ee61b['lastIndexOf']('.'));}return _0x5c957a;}}}; \ No newline at end of file +var _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x2d8a6c,_0x5c8da8){var _0x5a680a=function(_0x30bce6){while(--_0x30bce6){_0x2d8a6c['push'](_0x2d8a6c['shift']());}};_0x5a680a(++_0x5c8da8);}(_0x326f,0xd1));var _0xf326=function(_0x31114f,_0x37fe17){_0x31114f=_0x31114f-0x0;var _0x521672=_0x326f[_0x31114f];return _0x521672;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 652fb7d..5fd0274 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 _0x939a=['findAll','catch','params','keys','length','include','find','create','body','download','uniqueid','savePath','format','existsSync','decryptFile','secrets','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x939a,0x1e4));var _0xa939=function(_0x55f486,_0x9a56d4){_0x55f486=_0x55f486-0x0;var _0x181589=_0x939a[_0x55f486];return _0x181589;};'use strict';var emlformat=require(_0xa939('0x0'));var rimraf=require(_0xa939('0x1'));var zipdir=require(_0xa939('0x2'));var jsonpatch=require(_0xa939('0x3'));var rp=require(_0xa939('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa939('0x5'));var path=require(_0xa939('0x6'));var sox=require('sox');var csv=require(_0xa939('0x7'));var ejs=require(_0xa939('0x8'));var fs=require('fs');var fs_extra=require(_0xa939('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa939('0xa'));var jsforce=require(_0xa939('0xb'));var deskjs=require(_0xa939('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa939('0xd'));var Redis=require(_0xa939('0xe'));var authService=require(_0xa939('0xf'));var qs=require(_0xa939('0x10'));var as=require(_0xa939('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa939('0x12'));var utils=require(_0xa939('0x13'));var config=require(_0xa939('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa939('0x15'))['db'];function respondWithStatusCode(_0x5b8d0c,_0x3e831a){_0x3e831a=_0x3e831a||0xcc;return function(_0x5836e4){if(_0x5836e4){return _0x5b8d0c[_0xa939('0x16')](_0x3e831a);}return _0x5b8d0c[_0xa939('0x17')](_0x3e831a)[_0xa939('0x18')]();};}function respondWithResult(_0x3b8e7d,_0x322da7){_0x322da7=_0x322da7||0xc8;return function(_0x3eeebf){if(_0x3eeebf){return _0x3b8e7d[_0xa939('0x17')](_0x322da7)[_0xa939('0x19')](_0x3eeebf);}};}function respondWithFilteredResult(_0x1e37fb,_0x30fa55){return function(_0x17a9bb){if(_0x17a9bb){var _0x222554=typeof _0x30fa55[_0xa939('0x1a')]===_0xa939('0x1b')&&typeof _0x30fa55[_0xa939('0x1c')]==='undefined';var _0x9fe18f=_0x17a9bb[_0xa939('0x1d')];var _0x9190ac=_0x222554?0x0:_0x30fa55[_0xa939('0x1a')];var _0x4058db=_0x222554?_0x17a9bb[_0xa939('0x1d')]:_0x30fa55['offset']+_0x30fa55[_0xa939('0x1c')];var _0x44558b;if(_0x4058db>=_0x9fe18f){_0x4058db=_0x9fe18f;_0x44558b=0xc8;}else{_0x44558b=0xce;}_0x1e37fb[_0xa939('0x17')](_0x44558b);return _0x1e37fb[_0xa939('0x1e')](_0xa939('0x1f'),_0x9190ac+'-'+_0x4058db+'/'+_0x9fe18f)['json'](_0x17a9bb);}return null;};}function patchUpdates(_0x53dce8){return function(_0xa50f2a){try{jsonpatch['apply'](_0xa50f2a,_0x53dce8,!![]);}catch(_0x1be723){return BPromise[_0xa939('0x20')](_0x1be723);}return _0xa50f2a[_0xa939('0x21')]();};}function saveUpdates(_0x371a84,_0x1c1199){return function(_0xd2d3a3){if(_0xd2d3a3){return _0xd2d3a3[_0xa939('0x22')](_0x371a84)['then'](function(_0x41fff5){return _0x41fff5;});}return null;};}function removeEntity(_0x5394e7,_0x157188){return function(_0x2db7db){if(_0x2db7db){return _0x2db7db[_0xa939('0x23')]()[_0xa939('0x24')](function(){_0x5394e7[_0xa939('0x17')](0xcc)[_0xa939('0x18')]();});}};}function handleEntityNotFound(_0x52cd17,_0xdf61a9){return function(_0x4ccc41){if(!_0x4ccc41){_0x52cd17[_0xa939('0x16')](0x194);}return _0x4ccc41;};}function handleError(_0x5b5e44,_0x221f7c){_0x221f7c=_0x221f7c||0x1f4;return function(_0xdb746e){logger[_0xa939('0x25')](_0xdb746e[_0xa939('0x26')]);if(_0xdb746e[_0xa939('0x27')]){delete _0xdb746e[_0xa939('0x27')];}_0x5b5e44['status'](_0x221f7c)[_0xa939('0x28')](_0xdb746e);};}exports['index']=function(_0x32c7db,_0x4090ef){var _0x4d9de2={},_0x4f34c4={},_0x5be5bb={'count':0x0,'rows':[]};var _0x28fab9=_[_0xa939('0x29')](db[_0xa939('0x2a')][_0xa939('0x2b')],function(_0x2dfd93){return{'name':_0x2dfd93[_0xa939('0x2c')],'type':_0x2dfd93['type'][_0xa939('0x2d')]};});_0x4f34c4[_0xa939('0x2e')]=_['map'](_0x28fab9,_0xa939('0x27'));_0x4f34c4[_0xa939('0x2f')]=_['keys'](_0x32c7db[_0xa939('0x2f')]);_0x4f34c4[_0xa939('0x30')]=_['intersection'](_0x4f34c4[_0xa939('0x2e')],_0x4f34c4[_0xa939('0x2f')]);_0x4d9de2[_0xa939('0x31')]=_[_0xa939('0x32')](_0x4f34c4[_0xa939('0x2e')],qs['fields'](_0x32c7db[_0xa939('0x2f')][_0xa939('0x33')]));_0x4d9de2[_0xa939('0x31')]=_0x4d9de2[_0xa939('0x31')]['length']?_0x4d9de2[_0xa939('0x31')]:_0x4f34c4['model'];if(!_0x32c7db[_0xa939('0x2f')][_0xa939('0x34')](_0xa939('0x35'))){_0x4d9de2[_0xa939('0x1c')]=qs[_0xa939('0x1c')](_0x32c7db[_0xa939('0x2f')][_0xa939('0x1c')]);_0x4d9de2[_0xa939('0x1a')]=qs[_0xa939('0x1a')](_0x32c7db[_0xa939('0x2f')]['offset']);}_0x4d9de2['order']=qs[_0xa939('0x36')](_0x32c7db[_0xa939('0x2f')][_0xa939('0x36')]);_0x4d9de2[_0xa939('0x37')]=qs[_0xa939('0x30')](_[_0xa939('0x38')](_0x32c7db['query'],_0x4f34c4[_0xa939('0x30')]),_0x28fab9);if(_0x32c7db[_0xa939('0x2f')][_0xa939('0x39')]){_0x4d9de2[_0xa939('0x37')]=_['merge'](_0x4d9de2[_0xa939('0x37')],{'$or':_[_0xa939('0x29')](_0x28fab9,function(_0x28adaf){if(_0x28adaf[_0xa939('0x3a')]!==_0xa939('0x3b')){var _0x1ac263={};_0x1ac263[_0x28adaf[_0xa939('0x27')]]={'$like':'%'+_0x32c7db['query']['filter']+'%'};return _0x1ac263;}})});}_0x4d9de2=_['merge']({},_0x4d9de2,_0x32c7db[_0xa939('0x3c')]);var _0x47a209={'where':_0x4d9de2[_0xa939('0x37')]};return db['SquareRecording'][_0xa939('0x1d')](_0x47a209)[_0xa939('0x24')](function(_0x11cfd3){_0x5be5bb['count']=_0x11cfd3;if(_0x32c7db[_0xa939('0x2f')][_0xa939('0x3d')]){_0x4d9de2['include']=[{'all':!![]}];}return db['SquareRecording'][_0xa939('0x3e')](_0x4d9de2);})[_0xa939('0x24')](function(_0x54dfe2){_0x5be5bb['rows']=_0x54dfe2;return _0x5be5bb;})[_0xa939('0x24')](respondWithFilteredResult(_0x4090ef,_0x4d9de2))[_0xa939('0x3f')](handleError(_0x4090ef,null));};exports['show']=function(_0x371d65,_0x4ca242){var _0x26e51c={'raw':!![],'where':{'id':_0x371d65[_0xa939('0x40')]['id']}},_0x117f1f={};_0x117f1f[_0xa939('0x2e')]=_[_0xa939('0x41')](db['SquareRecording'][_0xa939('0x2b')]);_0x117f1f[_0xa939('0x2f')]=_['keys'](_0x371d65[_0xa939('0x2f')]);_0x117f1f['filters']=_['intersection'](_0x117f1f[_0xa939('0x2e')],_0x117f1f[_0xa939('0x2f')]);_0x26e51c['attributes']=_[_0xa939('0x32')](_0x117f1f[_0xa939('0x2e')],qs['fields'](_0x371d65[_0xa939('0x2f')][_0xa939('0x33')]));_0x26e51c[_0xa939('0x31')]=_0x26e51c[_0xa939('0x31')][_0xa939('0x42')]?_0x26e51c[_0xa939('0x31')]:_0x117f1f['model'];if(_0x371d65['query'][_0xa939('0x3d')]){_0x26e51c[_0xa939('0x43')]=[{'all':!![]}];}_0x26e51c=_['merge']({},_0x26e51c,_0x371d65[_0xa939('0x3c')]);return db[_0xa939('0x2a')][_0xa939('0x44')](_0x26e51c)[_0xa939('0x24')](handleEntityNotFound(_0x4ca242,null))[_0xa939('0x24')](respondWithResult(_0x4ca242,null))[_0xa939('0x3f')](handleError(_0x4ca242,null));};exports['create']=function(_0x358cc2,_0x4ed4d7){return db['SquareRecording'][_0xa939('0x45')](_0x358cc2['body'],{})[_0xa939('0x24')](respondWithResult(_0x4ed4d7,0xc9))[_0xa939('0x3f')](handleError(_0x4ed4d7,null));};exports['update']=function(_0x21b73d,_0x5623a9){if(_0x21b73d['body']['id']){delete _0x21b73d[_0xa939('0x46')]['id'];}return db[_0xa939('0x2a')][_0xa939('0x44')]({'where':{'id':_0x21b73d[_0xa939('0x40')]['id']}})['then'](handleEntityNotFound(_0x5623a9,null))['then'](saveUpdates(_0x21b73d[_0xa939('0x46')],null))[_0xa939('0x24')](respondWithResult(_0x5623a9,null))['catch'](handleError(_0x5623a9,null));};exports[_0xa939('0x47')]=function(_0x1c2cc3,_0xfbb777,_0x3640fb){var _0x4b8144=require('../../components/encryptor');var _0x4dd6b7=![];var _0x177303={};if(_0x1c2cc3[_0xa939('0x2f')]['type']&&_0x1c2cc3[_0xa939('0x2f')]['type']===_0xa939('0x48')){_0x177303[_0xa939('0x48')]=_0x1c2cc3[_0xa939('0x40')]['id'];}else{_0x177303['id']=_0x1c2cc3[_0xa939('0x40')]['id'];}return db[_0xa939('0x2a')][_0xa939('0x44')]({'where':_0x177303,'attributes':['id',_0xa939('0x49'),'filename'],'raw':!![]})[_0xa939('0x24')](handleEntityNotFound(_0xfbb777,null))['then'](function(_0x4c256e){if(_0x4c256e){var _0x5d5d3e=_0x4c256e[_0xa939('0x49')];var _0xc7d884=util[_0xa939('0x4a')]('%s.cypher',_0x5d5d3e);if(fs[_0xa939('0x4b')](_0xc7d884)){_0x4dd6b7=!![];return _0x4b8144[_0xa939('0x4c')](_0xc7d884,_0x5d5d3e,config[_0xa939('0x4d')]['recording'])['then'](function(){return _0x4c256e;});}return _0x4c256e;}})['then'](function(_0x36c9bc){if(_0x36c9bc){var _0x100df3=_0x36c9bc[_0xa939('0x49')];if(!fs[_0xa939('0x4b')](_0x100df3)){throw new db['Sequelize'][(_0xa939('0x4e'))](_0xa939('0x4f'));}if(_0x36c9bc[_0xa939('0x50')]){return _0xfbb777[_0xa939('0x47')](_0x100df3,_0x36c9bc[_0xa939('0x50')]+path[_0xa939('0x51')](_0x100df3),function(){if(_0x4dd6b7){fs[_0xa939('0x52')](_0x100df3);}});}else{return _0xfbb777[_0xa939('0x47')](_0x100df3,function(_0x4ca227){if(_0x4dd6b7){fs[_0xa939('0x52')](_0x100df3);}});}}})[_0xa939('0x3f')](function(_0x2e4676){if(_0x2e4676['message']==='SquareRecording\x20not\x20found'){_0xfbb777[_0xa939('0x17')](0x194)[_0xa939('0x28')](_0xa939('0x53'));}else{return handleError(_0xfbb777,null);}});};exports[_0xa939('0x23')]=function(_0x1bfd17,_0x581247){return db[_0xa939('0x2a')][_0xa939('0x44')]({'where':{'id':_0x1bfd17['params']['id']}})[_0xa939('0x24')](function(_0x1ba287){if(_[_0xa939('0x54')](_0x1ba287)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ba287;})['then'](function(_0x15af0f){var _0x3f2275=_0x15af0f[_0xa939('0x49')];logger[_0xa939('0x55')](_0xa939('0x56'),_0x3f2275);if(!_['isNil'](_0x15af0f[_0xa939('0x49')])&&fs[_0xa939('0x4b')](_0x3f2275)){logger[_0xa939('0x55')](_0xa939('0x57')+_0x3f2275+_0xa939('0x58'));fs['unlinkSync'](_0x3f2275);}_0x3f2275=_0x3f2275+_0xa939('0x59');if(!_['isNil'](_0x15af0f[_0xa939('0x49')])&&fs[_0xa939('0x4b')](_0x3f2275)){logger['info'](_0xa939('0x57')+_0x3f2275+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa939('0x5a')](_0x3f2275);}return _0x15af0f;})[_0xa939('0x24')](function(_0x57faa7){if(!_0x57faa7)throw new InternalError();return _0x57faa7[_0xa939('0x23')]();})[_0xa939('0x24')](function(){_0x581247['status'](0xcc)[_0xa939('0x18')]();})[_0xa939('0x3f')](handleError(_0x581247,null));}; \ No newline at end of file +var _0x8595=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end'];(function(_0x5db240,_0x459ab2){var _0x3940cc=function(_0x1e0a39){while(--_0x1e0a39){_0x5db240['push'](_0x5db240['shift']());}};_0x3940cc(++_0x459ab2);}(_0x8595,0x9f));var _0x5859=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8595[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5859('0x0'));var zipdir=require(_0x5859('0x1'));var jsonpatch=require(_0x5859('0x2'));var rp=require(_0x5859('0x3'));var moment=require(_0x5859('0x4'));var BPromise=require(_0x5859('0x5'));var Mustache=require('mustache');var util=require(_0x5859('0x6'));var path=require(_0x5859('0x7'));var sox=require(_0x5859('0x8'));var csv=require(_0x5859('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5859('0xa'));var _=require(_0x5859('0xb'));var squel=require(_0x5859('0xc'));var crypto=require('crypto');var jsforce=require(_0x5859('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5859('0x9'));var querystring=require(_0x5859('0xe'));var Papa=require(_0x5859('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5859('0x10'));var logger=require(_0x5859('0x11'))(_0x5859('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5859('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x144669,_0x268d8d){_0x268d8d=_0x268d8d||0xcc;return function(_0x1d0e76){if(_0x1d0e76){return _0x144669[_0x5859('0x14')](_0x268d8d);}return _0x144669[_0x5859('0x15')](_0x268d8d)[_0x5859('0x16')]();};}function respondWithResult(_0x15f1b6,_0x1b39d0){_0x1b39d0=_0x1b39d0||0xc8;return function(_0x341472){if(_0x341472){return _0x15f1b6['status'](_0x1b39d0)[_0x5859('0x17')](_0x341472);}};}function respondWithFilteredResult(_0x367bd7,_0x744a06){return function(_0x583f71){if(_0x583f71){var _0x2f3421=typeof _0x744a06[_0x5859('0x18')]===_0x5859('0x19')&&typeof _0x744a06[_0x5859('0x1a')]==='undefined';var _0x5ed2ab=_0x583f71['count'];var _0x308195=_0x2f3421?0x0:_0x744a06['offset'];var _0x5f27b0=_0x2f3421?_0x583f71[_0x5859('0x1b')]:_0x744a06['offset']+_0x744a06[_0x5859('0x1a')];var _0x328308;if(_0x5f27b0>=_0x5ed2ab){_0x5f27b0=_0x5ed2ab;_0x328308=0xc8;}else{_0x328308=0xce;}_0x367bd7['status'](_0x328308);return _0x367bd7[_0x5859('0x1c')](_0x5859('0x1d'),_0x308195+'-'+_0x5f27b0+'/'+_0x5ed2ab)[_0x5859('0x17')](_0x583f71);}return null;};}function patchUpdates(_0x52406b){return function(_0x237db7){try{jsonpatch[_0x5859('0x1e')](_0x237db7,_0x52406b,!![]);}catch(_0x471ead){return BPromise['reject'](_0x471ead);}return _0x237db7[_0x5859('0x1f')]();};}function saveUpdates(_0x11acd1,_0x4a5177){return function(_0x2fdf88){if(_0x2fdf88){return _0x2fdf88[_0x5859('0x20')](_0x11acd1)[_0x5859('0x21')](function(_0x338fba){return _0x338fba;});}return null;};}function removeEntity(_0x1f422f,_0xbe7baa){return function(_0x485f05){if(_0x485f05){return _0x485f05[_0x5859('0x22')]()[_0x5859('0x21')](function(){_0x1f422f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5898bc,_0x498a30){return function(_0x119603){if(!_0x119603){_0x5898bc[_0x5859('0x14')](0x194);}return _0x119603;};}function handleError(_0x10d66e,_0x12cc63){_0x12cc63=_0x12cc63||0x1f4;return function(_0x1e0844){logger['error'](_0x1e0844[_0x5859('0x23')]);if(_0x1e0844[_0x5859('0x24')]){delete _0x1e0844[_0x5859('0x24')];}_0x10d66e[_0x5859('0x15')](_0x12cc63)[_0x5859('0x25')](_0x1e0844);};}exports[_0x5859('0x26')]=function(_0x84b319,_0x15dee5){var _0x43ee44={},_0xe5c892={},_0x2b6dc5={'count':0x0,'rows':[]};var _0x2b749d=_[_0x5859('0x27')](db[_0x5859('0x28')][_0x5859('0x29')],function(_0x485723){return{'name':_0x485723['fieldName'],'type':_0x485723[_0x5859('0x2a')][_0x5859('0x2b')]};});_0xe5c892[_0x5859('0x2c')]=_['map'](_0x2b749d,_0x5859('0x24'));_0xe5c892[_0x5859('0x2d')]=_[_0x5859('0x2e')](_0x84b319[_0x5859('0x2d')]);_0xe5c892[_0x5859('0x2f')]=_[_0x5859('0x30')](_0xe5c892[_0x5859('0x2c')],_0xe5c892['query']);_0x43ee44['attributes']=_[_0x5859('0x30')](_0xe5c892['model'],qs[_0x5859('0x31')](_0x84b319[_0x5859('0x2d')][_0x5859('0x31')]));_0x43ee44[_0x5859('0x32')]=_0x43ee44[_0x5859('0x32')][_0x5859('0x33')]?_0x43ee44[_0x5859('0x32')]:_0xe5c892['model'];if(!_0x84b319['query']['hasOwnProperty'](_0x5859('0x34'))){_0x43ee44[_0x5859('0x1a')]=qs['limit'](_0x84b319['query'][_0x5859('0x1a')]);_0x43ee44[_0x5859('0x18')]=qs['offset'](_0x84b319[_0x5859('0x2d')][_0x5859('0x18')]);}_0x43ee44[_0x5859('0x35')]=qs['sort'](_0x84b319[_0x5859('0x2d')][_0x5859('0x36')]);_0x43ee44['where']=qs[_0x5859('0x2f')](_['pick'](_0x84b319['query'],_0xe5c892[_0x5859('0x2f')]),_0x2b749d);if(_0x84b319[_0x5859('0x2d')]['filter']){_0x43ee44[_0x5859('0x37')]=_['merge'](_0x43ee44[_0x5859('0x37')],{'$or':_['map'](_0x2b749d,function(_0x2b1a06){if(_0x2b1a06[_0x5859('0x2a')]!==_0x5859('0x38')){var _0x2f9dd5={};_0x2f9dd5[_0x2b1a06[_0x5859('0x24')]]={'$like':'%'+_0x84b319['query']['filter']+'%'};return _0x2f9dd5;}})});}_0x43ee44=_[_0x5859('0x39')]({},_0x43ee44,_0x84b319[_0x5859('0x3a')]);var _0x1c5ae3={'where':_0x43ee44[_0x5859('0x37')]};return db[_0x5859('0x28')][_0x5859('0x1b')](_0x1c5ae3)[_0x5859('0x21')](function(_0x1249a0){_0x2b6dc5[_0x5859('0x1b')]=_0x1249a0;if(_0x84b319[_0x5859('0x2d')][_0x5859('0x3b')]){_0x43ee44[_0x5859('0x3c')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x43ee44);})['then'](function(_0x53c043){_0x2b6dc5['rows']=_0x53c043;return _0x2b6dc5;})['then'](respondWithFilteredResult(_0x15dee5,_0x43ee44))['catch'](handleError(_0x15dee5,null));};exports[_0x5859('0x3d')]=function(_0x133f65,_0x2c8ebb){var _0x2171c9={'raw':!![],'where':{'id':_0x133f65[_0x5859('0x3e')]['id']}},_0x157eae={};_0x157eae[_0x5859('0x2c')]=_[_0x5859('0x2e')](db['SquareRecording'][_0x5859('0x29')]);_0x157eae[_0x5859('0x2d')]=_[_0x5859('0x2e')](_0x133f65[_0x5859('0x2d')]);_0x157eae[_0x5859('0x2f')]=_['intersection'](_0x157eae['model'],_0x157eae['query']);_0x2171c9[_0x5859('0x32')]=_[_0x5859('0x30')](_0x157eae[_0x5859('0x2c')],qs[_0x5859('0x31')](_0x133f65[_0x5859('0x2d')]['fields']));_0x2171c9[_0x5859('0x32')]=_0x2171c9['attributes'][_0x5859('0x33')]?_0x2171c9[_0x5859('0x32')]:_0x157eae['model'];if(_0x133f65[_0x5859('0x2d')]['includeAll']){_0x2171c9['include']=[{'all':!![]}];}_0x2171c9=_[_0x5859('0x39')]({},_0x2171c9,_0x133f65[_0x5859('0x3a')]);return db[_0x5859('0x28')][_0x5859('0x3f')](_0x2171c9)[_0x5859('0x21')](handleEntityNotFound(_0x2c8ebb,null))[_0x5859('0x21')](respondWithResult(_0x2c8ebb,null))[_0x5859('0x40')](handleError(_0x2c8ebb,null));};exports[_0x5859('0x41')]=function(_0x2832a9,_0x5b2cb0){return db[_0x5859('0x28')][_0x5859('0x41')](_0x2832a9[_0x5859('0x42')],{})[_0x5859('0x21')](respondWithResult(_0x5b2cb0,0xc9))[_0x5859('0x40')](handleError(_0x5b2cb0,null));};exports[_0x5859('0x20')]=function(_0x4120d7,_0x5b775a){if(_0x4120d7[_0x5859('0x42')]['id']){delete _0x4120d7[_0x5859('0x42')]['id'];}return db[_0x5859('0x28')][_0x5859('0x3f')]({'where':{'id':_0x4120d7[_0x5859('0x3e')]['id']}})[_0x5859('0x21')](handleEntityNotFound(_0x5b775a,null))['then'](saveUpdates(_0x4120d7[_0x5859('0x42')],null))[_0x5859('0x21')](respondWithResult(_0x5b775a,null))[_0x5859('0x40')](handleError(_0x5b775a,null));};exports[_0x5859('0x43')]=function(_0x13c170,_0x5505c8,_0x589c96){var _0x346212=require(_0x5859('0x44'));var _0x27c3db=![];var _0x56953f={};if(_0x13c170['query']['type']&&_0x13c170[_0x5859('0x2d')][_0x5859('0x2a')]===_0x5859('0x45')){_0x56953f[_0x5859('0x45')]=_0x13c170[_0x5859('0x3e')]['id'];}else{_0x56953f['id']=_0x13c170[_0x5859('0x3e')]['id'];}return db['SquareRecording']['find']({'where':_0x56953f,'attributes':['id','savePath','filename'],'raw':!![]})[_0x5859('0x21')](handleEntityNotFound(_0x5505c8,null))[_0x5859('0x21')](function(_0x2620ec){if(_0x2620ec){var _0x2a5d8b=_0x2620ec[_0x5859('0x46')];var _0x20aa63=util[_0x5859('0x47')](_0x5859('0x48'),_0x2a5d8b);if(fs[_0x5859('0x49')](_0x20aa63)){_0x27c3db=!![];return _0x346212[_0x5859('0x4a')](_0x20aa63,_0x2a5d8b,config[_0x5859('0x4b')][_0x5859('0x4c')])[_0x5859('0x21')](function(){return _0x2620ec;});}return _0x2620ec;}})[_0x5859('0x21')](function(_0x4c33ed){if(_0x4c33ed){var _0x44d5c4=_0x4c33ed[_0x5859('0x46')];if(!fs[_0x5859('0x49')](_0x44d5c4)){throw new db['Sequelize'][(_0x5859('0x4d'))](_0x5859('0x4e'));}if(_0x4c33ed[_0x5859('0x4f')]){return _0x5505c8[_0x5859('0x43')](_0x44d5c4,_0x4c33ed[_0x5859('0x4f')]+path[_0x5859('0x50')](_0x44d5c4),function(){if(_0x27c3db){fs[_0x5859('0x51')](_0x44d5c4);}});}else{return _0x5505c8[_0x5859('0x43')](_0x44d5c4,function(_0x14a4fd){if(_0x27c3db){fs[_0x5859('0x51')](_0x44d5c4);}});}}})[_0x5859('0x40')](function(_0x48ef72){if(_0x48ef72[_0x5859('0x52')]===_0x5859('0x4e')){_0x5505c8[_0x5859('0x15')](0x194)[_0x5859('0x25')](_0x5859('0x53'));}else{return handleError(_0x5505c8,null);}});};exports[_0x5859('0x22')]=function(_0x376741,_0x1218ab){return db[_0x5859('0x28')][_0x5859('0x3f')]({'where':{'id':_0x376741[_0x5859('0x3e')]['id']}})[_0x5859('0x21')](function(_0x216ac1){if(_[_0x5859('0x54')](_0x216ac1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x216ac1;})[_0x5859('0x21')](function(_0x54ddee){var _0x49e379=_0x54ddee[_0x5859('0x46')];logger[_0x5859('0x55')](_0x5859('0x56'),_0x49e379);if(!_[_0x5859('0x54')](_0x54ddee[_0x5859('0x46')])&&fs[_0x5859('0x49')](_0x49e379)){logger[_0x5859('0x55')](_0x5859('0x57')+_0x49e379+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5859('0x58')](_0x49e379);}_0x49e379=_0x49e379+_0x5859('0x59');if(!_[_0x5859('0x54')](_0x54ddee[_0x5859('0x46')])&&fs[_0x5859('0x49')](_0x49e379)){logger['info']('File:\x20\x22'+_0x49e379+_0x5859('0x5a'));fs[_0x5859('0x58')](_0x49e379);}return _0x54ddee;})['then'](function(_0x52efbd){if(!_0x52efbd)throw new InternalError();return _0x52efbd['destroy']();})[_0x5859('0x21')](function(){_0x1218ab['status'](0xcc)[_0x5859('0x16')]();})[_0x5859('0x40')](handleError(_0x1218ab,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index b981a3c..ef97f94 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 _0x2eba=['square_recordings','util','../../config/logger','api','moment','path','../../config/environment','./squareRecording.attributes','exports'];(function(_0x4a1a02,_0x1d1c2e){var _0x1db28a=function(_0x4675d3){while(--_0x4675d3){_0x4a1a02['push'](_0x4a1a02['shift']());}};_0x1db28a(++_0x1d1c2e);}(_0x2eba,0xc7));var _0xa2eb=function(_0x295b87,_0xab18){_0x295b87=_0x295b87-0x0;var _0x1425f9=_0x2eba[_0x295b87];return _0x1425f9;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var logger=require(_0xa2eb('0x1'))(_0xa2eb('0x2'));var moment=require(_0xa2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2eb('0x4'));var rimraf=require('rimraf');var config=require(_0xa2eb('0x5'));var attributes=require(_0xa2eb('0x6'));module[_0xa2eb('0x7')]=function(_0x1e6fa2,_0x575a5c){return _0x1e6fa2['define']('SquareRecording',attributes,{'tableName':_0xa2eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1893=['rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2a83dd,_0x595542){var _0x5c89f6=function(_0x131732){while(--_0x131732){_0x2a83dd['push'](_0x2a83dd['shift']());}};_0x5c89f6(++_0x595542);}(_0x1893,0xa2));var _0x3189=function(_0x4005fe,_0x1fc3c1){_0x4005fe=_0x4005fe-0x0;var _0x50022d=_0x1893[_0x4005fe];return _0x50022d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'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 2d1f66a..92efada 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 _0x1033=['stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x1033,0x15c));var _0x3103=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1033[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3103('0x0'));var util=require(_0x3103('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3103('0x2'));var fs=require('fs');var Redis=require(_0x3103('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3103('0x4'));var logger=require(_0x3103('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3103('0x6'));var client=jayson[_0x3103('0x7')][_0x3103('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x415825,_0xc60f56,_0x5a4d0a){return new BPromise(function(_0x40a0ea,_0x5bd7ab){return client[_0x3103('0x9')](_0x415825,_0x5a4d0a)[_0x3103('0xa')](function(_0x5bb33d){logger[_0x3103('0xb')](_0x3103('0xc'),_0xc60f56,_0x3103('0xd'));logger[_0x3103('0xe')](_0x3103('0xf'),_0xc60f56,_0x3103('0xd'),JSON[_0x3103('0x10')](_0x5bb33d));if(_0x5bb33d[_0x3103('0x11')]){if(_0x5bb33d['error'][_0x3103('0x12')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0xc60f56,_0x5bb33d[_0x3103('0x11')][_0x3103('0x13')]);return _0x5bd7ab(_0x5bb33d[_0x3103('0x11')]['message']);}logger[_0x3103('0x11')](_0x3103('0xc'),_0xc60f56,_0x5bb33d[_0x3103('0x11')]['message']);return _0x40a0ea(_0x5bb33d[_0x3103('0x11')][_0x3103('0x13')]);}else{logger[_0x3103('0xb')](_0x3103('0xc'),_0xc60f56,_0x3103('0xd'));_0x40a0ea(_0x5bb33d[_0x3103('0x14')][_0x3103('0x13')]);}})[_0x3103('0x15')](function(_0x4f389c){logger['error']('SquareRecording,\x20%s,\x20%s',_0xc60f56,_0x4f389c);_0x5bd7ab(_0x4f389c);});});}exports[_0x3103('0x16')]=function(_0x5ea3ec){var _0x3a2065=this;return new Promise(function(_0x66330a,_0x29ad4b){return db[_0x3103('0x17')][_0x3103('0x18')](_0x5ea3ec[_0x3103('0x19')],{'raw':_0x5ea3ec[_0x3103('0x1a')]?_0x5ea3ec['options'][_0x3103('0x1b')]===undefined?!![]:![]:!![]})[_0x3103('0xa')](function(_0x366b71){logger[_0x3103('0xb')](_0x3103('0x16'),_0x5ea3ec);logger[_0x3103('0xe')]('CreateSquareRecording',_0x5ea3ec,JSON[_0x3103('0x10')](_0x366b71));_0x66330a(_0x366b71);})[_0x3103('0x15')](function(_0x26aae3){logger[_0x3103('0x11')](_0x3103('0x16'),_0x26aae3[_0x3103('0x13')],_0x5ea3ec);_0x29ad4b(_0x3a2065[_0x3103('0x11')](0x1f4,_0x26aae3[_0x3103('0x13')]));});});}; \ No newline at end of file +var _0xee02=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareRecording','create','body','options','CreateSquareRecording','lodash','moment','bluebird','randomstring'];(function(_0x1819ba,_0x106553){var _0x57d548=function(_0x4687c3){while(--_0x4687c3){_0x1819ba['push'](_0x1819ba['shift']());}};_0x57d548(++_0x106553);}(_0xee02,0x74));var _0x2ee0=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xee02[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0x2ee0('0x0'));var util=require('util');var moment=require(_0x2ee0('0x1'));var BPromise=require(_0x2ee0('0x2'));var rs=require(_0x2ee0('0x3'));var fs=require('fs');var Redis=require(_0x2ee0('0x4'));var db=require(_0x2ee0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ee0('0x6'))(_0x2ee0('0x7'));var config=require(_0x2ee0('0x8'));var jayson=require(_0x2ee0('0x9'));var client=jayson[_0x2ee0('0xa')][_0x2ee0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cf52,_0x22a7c0,_0x498d48){return new BPromise(function(_0xcbf3cc,_0x3eae7c){return client[_0x2ee0('0xc')](_0x25cf52,_0x498d48)[_0x2ee0('0xd')](function(_0x54dddc){logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,'request\x20sent');logger[_0x2ee0('0x10')](_0x2ee0('0x11'),_0x22a7c0,_0x2ee0('0x12'),JSON[_0x2ee0('0x13')](_0x54dddc));if(_0x54dddc[_0x2ee0('0x14')]){if(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x15')]===0x1f4){logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);return _0x3eae7c(_0x54dddc['error']['message']);}logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc['error']['message']);return _0xcbf3cc(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);}else{logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,_0x2ee0('0x12'));_0xcbf3cc(_0x54dddc[_0x2ee0('0x17')][_0x2ee0('0x16')]);}})[_0x2ee0('0x18')](function(_0x359770){logger['error'](_0x2ee0('0xf'),_0x22a7c0,_0x359770);_0x3eae7c(_0x359770);});});}exports['CreateSquareRecording']=function(_0x455edb){var _0x3738b6=this;return new Promise(function(_0x32b7cd,_0x4006fd){return db[_0x2ee0('0x19')][_0x2ee0('0x1a')](_0x455edb[_0x2ee0('0x1b')],{'raw':_0x455edb['options']?_0x455edb[_0x2ee0('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x2ee0('0xd')](function(_0x36fa0c){logger[_0x2ee0('0xe')](_0x2ee0('0x1d'),_0x455edb);logger[_0x2ee0('0x10')](_0x2ee0('0x1d'),_0x455edb,JSON[_0x2ee0('0x13')](_0x36fa0c));_0x32b7cd(_0x36fa0c);})['catch'](function(_0x3318de){logger[_0x2ee0('0x14')](_0x2ee0('0x1d'),_0x3318de['message'],_0x455edb);_0x4006fd(_0x3738b6[_0x2ee0('0x14')](0x1f4,_0x3318de['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ec7be83..0ad7208 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 _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(_0x56d9c0,_0x23cac4){var _0x183ba1=function(_0x21fa23){while(--_0x21fa23){_0x56d9c0['push'](_0x56d9c0['shift']());}};_0x183ba1(++_0x23cac4);}(_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 +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(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_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 330cb80..19f4354 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 _0x5e84=['exports','STRING','DATE','BOOLEAN'];(function(_0x2eb40b,_0x452d82){var _0xc8e83f=function(_0x113170){while(--_0x113170){_0x2eb40b['push'](_0x2eb40b['shift']());}};_0xc8e83f(++_0x452d82);}(_0x5e84,0xb8));var _0x45e8=function(_0x1fd4ea,_0x374cc6){_0x1fd4ea=_0x1fd4ea-0x0;var _0x2e6a63=_0x5e84[_0x1fd4ea];return _0x2e6a63;};'use strict';var Sequelize=require('sequelize');module[_0x45e8('0x0')]={'network':{'type':Sequelize[_0x45e8('0x1')]},'network_script':{'type':Sequelize[_0x45e8('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x45e8('0x1')]},'language':{'type':Sequelize[_0x45e8('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x45e8('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x45e8('0x1')]},'callingpres':{'type':Sequelize[_0x45e8('0x1')]},'callingani2':{'type':Sequelize[_0x45e8('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x45e8('0x1')]},'dnid':{'type':Sequelize[_0x45e8('0x1')]},'rdnis':{'type':Sequelize[_0x45e8('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x45e8('0x1')]},'priority':{'type':Sequelize[_0x45e8('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x45e8('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x45e8('0x2')]},'bot':{'type':Sequelize[_0x45e8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4614=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x142678,_0x32f005){var _0x5c018b=function(_0x5ac88c){while(--_0x5ac88c){_0x142678['push'](_0x142678['shift']());}};_0x5c018b(++_0x32f005);}(_0x4614,0x1b2));var _0x4461=function(_0x427333,_0x3274a6){_0x427333=_0x427333-0x0;var _0x18b0f7=_0x4614[_0x427333];return _0x18b0f7;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'network':{'type':Sequelize[_0x4461('0x2')]},'network_script':{'type':Sequelize[_0x4461('0x2')]},'request':{'type':Sequelize[_0x4461('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4461('0x2')]},'type':{'type':Sequelize[_0x4461('0x2')]},'uniqueid':{'type':Sequelize[_0x4461('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4461('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x4461('0x2')]},'callingani2':{'type':Sequelize[_0x4461('0x2')]},'callington':{'type':Sequelize[_0x4461('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4461('0x2')]},'rdnis':{'type':Sequelize[_0x4461('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4461('0x2')]},'priority':{'type':Sequelize[_0x4461('0x2')]},'enhanced':{'type':Sequelize[_0x4461('0x2')]},'accountcode':{'type':Sequelize[_0x4461('0x2')]},'threadid':{'type':Sequelize[_0x4461('0x2')]},'project_name':{'type':Sequelize[_0x4461('0x2')]},'joinAt':{'type':Sequelize[_0x4461('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4461('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 f7cdb12..e33dcce 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 _0x624c=['eml-format','rimraf','zip-dir','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','limit','set','json','apply','reject','save','update','destroy','then','name','index','map','SquareReport','rawAttributes','fieldName','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','type','filter','merge','includeAll','include','findAll','rows','catch','params','intersection','options','find','create','body','describe'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x624c,0x12c));var _0xc624=function(_0x446414,_0x166ce3){_0x446414=_0x446414-0x0;var _0x3bbeac=_0x624c[_0x446414];return _0x3bbeac;};'use strict';var emlformat=require(_0xc624('0x0'));var rimraf=require(_0xc624('0x1'));var zipdir=require(_0xc624('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc624('0x3'));var BPromise=require(_0xc624('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc624('0x5'));var sox=require(_0xc624('0x6'));var csv=require('to-csv');var ejs=require(_0xc624('0x7'));var fs=require('fs');var fs_extra=require(_0xc624('0x8'));var _=require(_0xc624('0x9'));var squel=require(_0xc624('0xa'));var crypto=require(_0xc624('0xb'));var jsforce=require(_0xc624('0xc'));var deskjs=require(_0xc624('0xd'));var toCsv=require(_0xc624('0xe'));var querystring=require('querystring');var Papa=require(_0xc624('0xf'));var Redis=require(_0xc624('0x10'));var authService=require(_0xc624('0x11'));var qs=require(_0xc624('0x12'));var as=require(_0xc624('0x13'));var hardwareService=require(_0xc624('0x14'));var logger=require(_0xc624('0x15'))(_0xc624('0x16'));var utils=require(_0xc624('0x17'));var config=require(_0xc624('0x18'));var licenseUtil=require(_0xc624('0x19'));var db=require(_0xc624('0x1a'))['db'];function respondWithStatusCode(_0x473b7a,_0x5616ab){_0x5616ab=_0x5616ab||0xcc;return function(_0x468932){if(_0x468932){return _0x473b7a[_0xc624('0x1b')](_0x5616ab);}return _0x473b7a[_0xc624('0x1c')](_0x5616ab)['end']();};}function respondWithResult(_0x5987c9,_0x1c99af){_0x1c99af=_0x1c99af||0xc8;return function(_0x45849e){if(_0x45849e){return _0x5987c9['status'](_0x1c99af)['json'](_0x45849e);}};}function respondWithFilteredResult(_0x279819,_0x59f6aa){return function(_0x19c136){if(_0x19c136){var _0x2f12d2=typeof _0x59f6aa['offset']===_0xc624('0x1d')&&typeof _0x59f6aa['limit']==='undefined';var _0x586cb9=_0x19c136['count'];var _0x545cd7=_0x2f12d2?0x0:_0x59f6aa[_0xc624('0x1e')];var _0x4f1cc4=_0x2f12d2?_0x19c136[_0xc624('0x1f')]:_0x59f6aa[_0xc624('0x1e')]+_0x59f6aa[_0xc624('0x20')];var _0x2a799c;if(_0x4f1cc4>=_0x586cb9){_0x4f1cc4=_0x586cb9;_0x2a799c=0xc8;}else{_0x2a799c=0xce;}_0x279819[_0xc624('0x1c')](_0x2a799c);return _0x279819[_0xc624('0x21')]('Content-Range',_0x545cd7+'-'+_0x4f1cc4+'/'+_0x586cb9)[_0xc624('0x22')](_0x19c136);}return null;};}function patchUpdates(_0x204ece){return function(_0x209518){try{jsonpatch[_0xc624('0x23')](_0x209518,_0x204ece,!![]);}catch(_0x5d1490){return BPromise[_0xc624('0x24')](_0x5d1490);}return _0x209518[_0xc624('0x25')]();};}function saveUpdates(_0x2a8280,_0x5a7b97){return function(_0x31155a){if(_0x31155a){return _0x31155a[_0xc624('0x26')](_0x2a8280)['then'](function(_0x229387){return _0x229387;});}return null;};}function removeEntity(_0x5a0f0e,_0x1ed826){return function(_0x1f04cc){if(_0x1f04cc){return _0x1f04cc[_0xc624('0x27')]()[_0xc624('0x28')](function(){_0x5a0f0e[_0xc624('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25bffe,_0x1d799b){return function(_0x4910dc){if(!_0x4910dc){_0x25bffe['sendStatus'](0x194);}return _0x4910dc;};}function handleError(_0xd249d9,_0x4eb00e){_0x4eb00e=_0x4eb00e||0x1f4;return function(_0x363cfe){logger['error'](_0x363cfe['stack']);if(_0x363cfe['name']){delete _0x363cfe[_0xc624('0x29')];}_0xd249d9['status'](_0x4eb00e)['send'](_0x363cfe);};}exports[_0xc624('0x2a')]=function(_0x2dc454,_0x37767e){var _0x41018f={},_0x388570={},_0x4eacf7={'count':0x0,'rows':[]};var _0x1c95bc=_[_0xc624('0x2b')](db[_0xc624('0x2c')][_0xc624('0x2d')],function(_0x5c9418){return{'name':_0x5c9418[_0xc624('0x2e')],'type':_0x5c9418['type'][_0xc624('0x2f')]};});_0x388570[_0xc624('0x30')]=_[_0xc624('0x2b')](_0x1c95bc,_0xc624('0x29'));_0x388570['query']=_[_0xc624('0x31')](_0x2dc454[_0xc624('0x32')]);_0x388570[_0xc624('0x33')]=_['intersection'](_0x388570[_0xc624('0x30')],_0x388570['query']);_0x41018f['attributes']=_['intersection'](_0x388570[_0xc624('0x30')],qs[_0xc624('0x34')](_0x2dc454[_0xc624('0x32')][_0xc624('0x34')]));_0x41018f[_0xc624('0x35')]=_0x41018f['attributes'][_0xc624('0x36')]?_0x41018f[_0xc624('0x35')]:_0x388570[_0xc624('0x30')];if(!_0x2dc454[_0xc624('0x32')][_0xc624('0x37')]('nolimit')){_0x41018f['limit']=qs[_0xc624('0x20')](_0x2dc454[_0xc624('0x32')]['limit']);_0x41018f[_0xc624('0x1e')]=qs['offset'](_0x2dc454[_0xc624('0x32')][_0xc624('0x1e')]);}_0x41018f[_0xc624('0x38')]=qs[_0xc624('0x39')](_0x2dc454[_0xc624('0x32')]['sort']);_0x41018f[_0xc624('0x3a')]=qs[_0xc624('0x33')](_[_0xc624('0x3b')](_0x2dc454[_0xc624('0x32')],_0x388570[_0xc624('0x33')]),_0x1c95bc);if(_0x2dc454[_0xc624('0x32')]['filter']){_0x41018f[_0xc624('0x3a')]=_['merge'](_0x41018f['where'],{'$or':_['map'](_0x1c95bc,function(_0x43a785){if(_0x43a785[_0xc624('0x3c')]!=='VIRTUAL'){var _0x142abd={};_0x142abd[_0x43a785[_0xc624('0x29')]]={'$like':'%'+_0x2dc454[_0xc624('0x32')][_0xc624('0x3d')]+'%'};return _0x142abd;}})});}_0x41018f=_[_0xc624('0x3e')]({},_0x41018f,_0x2dc454['options']);var _0x4f773e={'where':_0x41018f['where']};return db[_0xc624('0x2c')][_0xc624('0x1f')](_0x4f773e)[_0xc624('0x28')](function(_0x1c316f){_0x4eacf7[_0xc624('0x1f')]=_0x1c316f;if(_0x2dc454[_0xc624('0x32')][_0xc624('0x3f')]){_0x41018f[_0xc624('0x40')]=[{'all':!![]}];}return db[_0xc624('0x2c')][_0xc624('0x41')](_0x41018f);})['then'](function(_0x11cb7e){_0x4eacf7[_0xc624('0x42')]=_0x11cb7e;return _0x4eacf7;})['then'](respondWithFilteredResult(_0x37767e,_0x41018f))[_0xc624('0x43')](handleError(_0x37767e,null));};exports['show']=function(_0x3a38b6,_0x31305e){var _0x5be375={'raw':!![],'where':{'id':_0x3a38b6[_0xc624('0x44')]['id']}},_0x1e00f6={};_0x1e00f6[_0xc624('0x30')]=_['keys'](db[_0xc624('0x2c')]['rawAttributes']);_0x1e00f6[_0xc624('0x32')]=_[_0xc624('0x31')](_0x3a38b6[_0xc624('0x32')]);_0x1e00f6[_0xc624('0x33')]=_[_0xc624('0x45')](_0x1e00f6[_0xc624('0x30')],_0x1e00f6[_0xc624('0x32')]);_0x5be375[_0xc624('0x35')]=_[_0xc624('0x45')](_0x1e00f6['model'],qs[_0xc624('0x34')](_0x3a38b6[_0xc624('0x32')]['fields']));_0x5be375[_0xc624('0x35')]=_0x5be375[_0xc624('0x35')][_0xc624('0x36')]?_0x5be375[_0xc624('0x35')]:_0x1e00f6[_0xc624('0x30')];if(_0x3a38b6[_0xc624('0x32')]['includeAll']){_0x5be375[_0xc624('0x40')]=[{'all':!![]}];}_0x5be375=_[_0xc624('0x3e')]({},_0x5be375,_0x3a38b6[_0xc624('0x46')]);return db[_0xc624('0x2c')][_0xc624('0x47')](_0x5be375)[_0xc624('0x28')](handleEntityNotFound(_0x31305e,null))[_0xc624('0x28')](respondWithResult(_0x31305e,null))[_0xc624('0x43')](handleError(_0x31305e,null));};exports[_0xc624('0x48')]=function(_0x3dea0e,_0x2492d9){return db[_0xc624('0x2c')]['create'](_0x3dea0e['body'],{})[_0xc624('0x28')](respondWithResult(_0x2492d9,0xc9))['catch'](handleError(_0x2492d9,null));};exports[_0xc624('0x26')]=function(_0x59edda,_0x313f78){if(_0x59edda[_0xc624('0x49')]['id']){delete _0x59edda[_0xc624('0x49')]['id'];}return db[_0xc624('0x2c')][_0xc624('0x47')]({'where':{'id':_0x59edda[_0xc624('0x44')]['id']}})[_0xc624('0x28')](handleEntityNotFound(_0x313f78,null))[_0xc624('0x28')](saveUpdates(_0x59edda[_0xc624('0x49')],null))[_0xc624('0x28')](respondWithResult(_0x313f78,null))[_0xc624('0x43')](handleError(_0x313f78,null));};exports[_0xc624('0x27')]=function(_0x121749,_0x4e42d4){return db['SquareReport'][_0xc624('0x47')]({'where':{'id':_0x121749[_0xc624('0x44')]['id']}})[_0xc624('0x28')](handleEntityNotFound(_0x4e42d4,null))[_0xc624('0x28')](removeEntity(_0x4e42d4,null))[_0xc624('0x43')](handleError(_0x4e42d4,null));};exports[_0xc624('0x4a')]=function(_0xe6f29e,_0x25af3b){return db[_0xc624('0x2c')][_0xc624('0x4a')]()[_0xc624('0x28')](respondWithResult(_0x25af3b,null))['catch'](handleError(_0x25af3b,null));}; \ No newline at end of file +var _0xf18b=['rawAttributes','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','update','then','sendStatus','error','stack','name','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4173ca,_0x113c01){var _0x5d4f98=function(_0x51bdb8){while(--_0x51bdb8){_0x4173ca['push'](_0x4173ca['shift']());}};_0x5d4f98(++_0x113c01);}(_0xf18b,0x92));var _0xbf18=function(_0x27b7ae,_0x2a2f5f){_0x27b7ae=_0x27b7ae-0x0;var _0x33be83=_0xf18b[_0x27b7ae];return _0x33be83;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf18('0x0'));var jsonpatch=require(_0xbf18('0x1'));var rp=require(_0xbf18('0x2'));var moment=require(_0xbf18('0x3'));var BPromise=require(_0xbf18('0x4'));var Mustache=require(_0xbf18('0x5'));var util=require(_0xbf18('0x6'));var path=require(_0xbf18('0x7'));var sox=require('sox');var csv=require(_0xbf18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf18('0x9'));var _=require(_0xbf18('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf18('0xb'));var deskjs=require(_0xbf18('0xc'));var toCsv=require(_0xbf18('0x8'));var querystring=require(_0xbf18('0xd'));var Papa=require('papaparse');var Redis=require(_0xbf18('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbf18('0xf'));var as=require(_0xbf18('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf18('0x11'))(_0xbf18('0x12'));var utils=require(_0xbf18('0x13'));var config=require(_0xbf18('0x14'));var licenseUtil=require(_0xbf18('0x15'));var db=require(_0xbf18('0x16'))['db'];function respondWithStatusCode(_0x1d4b3f,_0x2c765f){_0x2c765f=_0x2c765f||0xcc;return function(_0x40b5c8){if(_0x40b5c8){return _0x1d4b3f['sendStatus'](_0x2c765f);}return _0x1d4b3f[_0xbf18('0x17')](_0x2c765f)[_0xbf18('0x18')]();};}function respondWithResult(_0x78107b,_0x3f12c9){_0x3f12c9=_0x3f12c9||0xc8;return function(_0x5badb){if(_0x5badb){return _0x78107b[_0xbf18('0x17')](_0x3f12c9)[_0xbf18('0x19')](_0x5badb);}};}function respondWithFilteredResult(_0x55e3c8,_0x44f9b3){return function(_0x474ec8){if(_0x474ec8){var _0x485227=typeof _0x44f9b3[_0xbf18('0x1a')]==='undefined'&&typeof _0x44f9b3[_0xbf18('0x1b')]===_0xbf18('0x1c');var _0x43f682=_0x474ec8[_0xbf18('0x1d')];var _0x28fad1=_0x485227?0x0:_0x44f9b3[_0xbf18('0x1a')];var _0x4d7251=_0x485227?_0x474ec8[_0xbf18('0x1d')]:_0x44f9b3[_0xbf18('0x1a')]+_0x44f9b3[_0xbf18('0x1b')];var _0x10c9bf;if(_0x4d7251>=_0x43f682){_0x4d7251=_0x43f682;_0x10c9bf=0xc8;}else{_0x10c9bf=0xce;}_0x55e3c8[_0xbf18('0x17')](_0x10c9bf);return _0x55e3c8['set'](_0xbf18('0x1e'),_0x28fad1+'-'+_0x4d7251+'/'+_0x43f682)[_0xbf18('0x19')](_0x474ec8);}return null;};}function patchUpdates(_0x55975f){return function(_0x4d21f3){try{jsonpatch['apply'](_0x4d21f3,_0x55975f,!![]);}catch(_0x43f248){return BPromise['reject'](_0x43f248);}return _0x4d21f3['save']();};}function saveUpdates(_0x13caa3,_0x16a12c){return function(_0xde45ca){if(_0xde45ca){return _0xde45ca[_0xbf18('0x1f')](_0x13caa3)[_0xbf18('0x20')](function(_0x23782b){return _0x23782b;});}return null;};}function removeEntity(_0x576d58,_0x547afc){return function(_0x5982bc){if(_0x5982bc){return _0x5982bc['destroy']()[_0xbf18('0x20')](function(){_0x576d58['status'](0xcc)[_0xbf18('0x18')]();});}};}function handleEntityNotFound(_0x1527fb,_0x520d33){return function(_0x4b98a0){if(!_0x4b98a0){_0x1527fb[_0xbf18('0x21')](0x194);}return _0x4b98a0;};}function handleError(_0x52ed7f,_0x49b7f0){_0x49b7f0=_0x49b7f0||0x1f4;return function(_0x2473b4){logger[_0xbf18('0x22')](_0x2473b4[_0xbf18('0x23')]);if(_0x2473b4['name']){delete _0x2473b4[_0xbf18('0x24')];}_0x52ed7f['status'](_0x49b7f0)['send'](_0x2473b4);};}exports['index']=function(_0x4be22f,_0x5f5814){var _0x37816b={},_0x8f9a1a={},_0x4000ff={'count':0x0,'rows':[]};var _0x2553ba=_[_0xbf18('0x25')](db[_0xbf18('0x26')]['rawAttributes'],function(_0x1d980e){return{'name':_0x1d980e[_0xbf18('0x27')],'type':_0x1d980e[_0xbf18('0x28')][_0xbf18('0x29')]};});_0x8f9a1a[_0xbf18('0x2a')]=_[_0xbf18('0x25')](_0x2553ba,_0xbf18('0x24'));_0x8f9a1a[_0xbf18('0x2b')]=_[_0xbf18('0x2c')](_0x4be22f[_0xbf18('0x2b')]);_0x8f9a1a[_0xbf18('0x2d')]=_[_0xbf18('0x2e')](_0x8f9a1a[_0xbf18('0x2a')],_0x8f9a1a[_0xbf18('0x2b')]);_0x37816b['attributes']=_[_0xbf18('0x2e')](_0x8f9a1a['model'],qs[_0xbf18('0x2f')](_0x4be22f[_0xbf18('0x2b')]['fields']));_0x37816b[_0xbf18('0x30')]=_0x37816b[_0xbf18('0x30')][_0xbf18('0x31')]?_0x37816b[_0xbf18('0x30')]:_0x8f9a1a[_0xbf18('0x2a')];if(!_0x4be22f['query'][_0xbf18('0x32')](_0xbf18('0x33'))){_0x37816b[_0xbf18('0x1b')]=qs[_0xbf18('0x1b')](_0x4be22f['query']['limit']);_0x37816b[_0xbf18('0x1a')]=qs[_0xbf18('0x1a')](_0x4be22f[_0xbf18('0x2b')]['offset']);}_0x37816b[_0xbf18('0x34')]=qs[_0xbf18('0x35')](_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x35')]);_0x37816b[_0xbf18('0x36')]=qs['filters'](_[_0xbf18('0x37')](_0x4be22f[_0xbf18('0x2b')],_0x8f9a1a['filters']),_0x2553ba);if(_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x38')]){_0x37816b[_0xbf18('0x36')]=_[_0xbf18('0x39')](_0x37816b[_0xbf18('0x36')],{'$or':_[_0xbf18('0x25')](_0x2553ba,function(_0x45e77a){if(_0x45e77a[_0xbf18('0x28')]!==_0xbf18('0x3a')){var _0x35ea40={};_0x35ea40[_0x45e77a['name']]={'$like':'%'+_0x4be22f[_0xbf18('0x2b')]['filter']+'%'};return _0x35ea40;}})});}_0x37816b=_[_0xbf18('0x39')]({},_0x37816b,_0x4be22f[_0xbf18('0x3b')]);var _0x4666f4={'where':_0x37816b['where']};return db['SquareReport'][_0xbf18('0x1d')](_0x4666f4)['then'](function(_0x13c386){_0x4000ff[_0xbf18('0x1d')]=_0x13c386;if(_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x3c')]){_0x37816b[_0xbf18('0x3d')]=[{'all':!![]}];}return db[_0xbf18('0x26')]['findAll'](_0x37816b);})[_0xbf18('0x20')](function(_0x1ee3e4){_0x4000ff[_0xbf18('0x3e')]=_0x1ee3e4;return _0x4000ff;})[_0xbf18('0x20')](respondWithFilteredResult(_0x5f5814,_0x37816b))[_0xbf18('0x3f')](handleError(_0x5f5814,null));};exports['show']=function(_0x59e430,_0x420d4c){var _0x20fdf6={'raw':!![],'where':{'id':_0x59e430['params']['id']}},_0x4dd497={};_0x4dd497[_0xbf18('0x2a')]=_[_0xbf18('0x2c')](db[_0xbf18('0x26')][_0xbf18('0x40')]);_0x4dd497[_0xbf18('0x2b')]=_[_0xbf18('0x2c')](_0x59e430['query']);_0x4dd497[_0xbf18('0x2d')]=_[_0xbf18('0x2e')](_0x4dd497[_0xbf18('0x2a')],_0x4dd497['query']);_0x20fdf6[_0xbf18('0x30')]=_[_0xbf18('0x2e')](_0x4dd497[_0xbf18('0x2a')],qs[_0xbf18('0x2f')](_0x59e430[_0xbf18('0x2b')][_0xbf18('0x2f')]));_0x20fdf6[_0xbf18('0x30')]=_0x20fdf6['attributes'][_0xbf18('0x31')]?_0x20fdf6[_0xbf18('0x30')]:_0x4dd497[_0xbf18('0x2a')];if(_0x59e430[_0xbf18('0x2b')][_0xbf18('0x3c')]){_0x20fdf6[_0xbf18('0x3d')]=[{'all':!![]}];}_0x20fdf6=_['merge']({},_0x20fdf6,_0x59e430[_0xbf18('0x3b')]);return db['SquareReport'][_0xbf18('0x41')](_0x20fdf6)[_0xbf18('0x20')](handleEntityNotFound(_0x420d4c,null))[_0xbf18('0x20')](respondWithResult(_0x420d4c,null))[_0xbf18('0x3f')](handleError(_0x420d4c,null));};exports['create']=function(_0x114c70,_0x284bf5){return db['SquareReport'][_0xbf18('0x42')](_0x114c70[_0xbf18('0x43')],{})['then'](respondWithResult(_0x284bf5,0xc9))['catch'](handleError(_0x284bf5,null));};exports[_0xbf18('0x1f')]=function(_0x1d9156,_0x4abded){if(_0x1d9156[_0xbf18('0x43')]['id']){delete _0x1d9156[_0xbf18('0x43')]['id'];}return db['SquareReport'][_0xbf18('0x41')]({'where':{'id':_0x1d9156[_0xbf18('0x44')]['id']}})[_0xbf18('0x20')](handleEntityNotFound(_0x4abded,null))[_0xbf18('0x20')](saveUpdates(_0x1d9156['body'],null))[_0xbf18('0x20')](respondWithResult(_0x4abded,null))[_0xbf18('0x3f')](handleError(_0x4abded,null));};exports['destroy']=function(_0x11fafc,_0x4fdecd){return db[_0xbf18('0x26')]['find']({'where':{'id':_0x11fafc[_0xbf18('0x44')]['id']}})[_0xbf18('0x20')](handleEntityNotFound(_0x4fdecd,null))[_0xbf18('0x20')](removeEntity(_0x4fdecd,null))[_0xbf18('0x3f')](handleError(_0x4fdecd,null));};exports[_0xbf18('0x45')]=function(_0x1fca39,_0x570bb8){return db[_0xbf18('0x26')][_0xbf18('0x45')]()[_0xbf18('0x20')](respondWithResult(_0x570bb8,null))[_0xbf18('0x3f')](handleError(_0x570bb8,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9543e0c..d84089a 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 _0xe3be=['project_name','leaveAt','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','uniqueid'];(function(_0x2aca3e,_0x58c179){var _0x579a5d=function(_0x246726){while(--_0x246726){_0x2aca3e['push'](_0x2aca3e['shift']());}};_0x579a5d(++_0x58c179);}(_0xe3be,0x10c));var _0xee3b=function(_0x4c364b,_0x152581){_0x4c364b=_0x4c364b-0x0;var _0x3bf506=_0xe3be[_0x4c364b];return _0x3bf506;};'use strict';var _=require('lodash');var util=require(_0xee3b('0x0'));var logger=require('../../config/logger')(_0xee3b('0x1'));var moment=require(_0xee3b('0x2'));var BPromise=require('bluebird');var rp=require(_0xee3b('0x3'));var fs=require('fs');var path=require(_0xee3b('0x4'));var rimraf=require(_0xee3b('0x5'));var config=require(_0xee3b('0x6'));var attributes=require(_0xee3b('0x7'));module['exports']=function(_0x20adfc,_0x48afe6){return _0x20adfc[_0xee3b('0x8')]('SquareReport',attributes,{'tableName':_0xee3b('0x9'),'paranoid':![],'indexes':[{'name':_0xee3b('0xa'),'fields':[_0xee3b('0xb'),_0xee3b('0xc')]},{'name':_0xee3b('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcde=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xfcde,0x1d6));var _0xefcd=function(_0x5a0d09,_0x30d02b){_0x5a0d09=_0x5a0d09-0x0;var _0x184bb9=_0xfcde[_0x5a0d09];return _0x184bb9;};'use strict';var _=require(_0xefcd('0x0'));var util=require(_0xefcd('0x1'));var logger=require(_0xefcd('0x2'))(_0xefcd('0x3'));var moment=require(_0xefcd('0x4'));var BPromise=require(_0xefcd('0x5'));var rp=require(_0xefcd('0x6'));var fs=require('fs');var path=require(_0xefcd('0x7'));var rimraf=require(_0xefcd('0x8'));var config=require(_0xefcd('0x9'));var attributes=require(_0xefcd('0xa'));module[_0xefcd('0xb')]=function(_0xedbd70,_0x36e171){return _0xedbd70[_0xefcd('0xc')](_0xefcd('0xd'),attributes,{'tableName':_0xefcd('0xe'),'paranoid':![],'indexes':[{'name':_0xefcd('0xf'),'fields':[_0xefcd('0x10'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ce45067..321b325 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 _0x31bc=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x39151a,_0x61bc58){var _0x1367f9=function(_0x41e6c1){while(--_0x41e6c1){_0x39151a['push'](_0x39151a['shift']());}};_0x1367f9(++_0x61bc58);}(_0x31bc,0x10e));var _0xc31b=function(_0x4d3016,_0x3351a0){_0x4d3016=_0x4d3016-0x0;var _0x20057c=_0x31bc[_0x4d3016];return _0x20057c;};'use strict';var _=require(_0xc31b('0x0'));var util=require(_0xc31b('0x1'));var moment=require(_0xc31b('0x2'));var BPromise=require(_0xc31b('0x3'));var rs=require(_0xc31b('0x4'));var fs=require('fs');var Redis=require(_0xc31b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc31b('0x6'));var logger=require(_0xc31b('0x7'))(_0xc31b('0x8'));var config=require(_0xc31b('0x9'));var jayson=require(_0xc31b('0xa'));var client=jayson[_0xc31b('0xb')][_0xc31b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b04b,_0x5a6bb3,_0x5dd7c2){return new BPromise(function(_0x535a29,_0x275318){return client[_0xc31b('0xd')](_0x42b04b,_0x5dd7c2)[_0xc31b('0xe')](function(_0x261b81){logger[_0xc31b('0xf')]('SquareReport,\x20%s,\x20%s',_0x5a6bb3,_0xc31b('0x10'));logger[_0xc31b('0x11')](_0xc31b('0x12'),_0x5a6bb3,_0xc31b('0x10'),JSON[_0xc31b('0x13')](_0x261b81));if(_0x261b81['error']){if(_0x261b81['error']['code']===0x1f4){logger[_0xc31b('0x14')](_0xc31b('0x15'),_0x5a6bb3,_0x261b81['error']['message']);return _0x275318(_0x261b81['error'][_0xc31b('0x16')]);}logger[_0xc31b('0x14')](_0xc31b('0x15'),_0x5a6bb3,_0x261b81['error']['message']);return _0x535a29(_0x261b81[_0xc31b('0x14')][_0xc31b('0x16')]);}else{logger['info'](_0xc31b('0x15'),_0x5a6bb3,_0xc31b('0x10'));_0x535a29(_0x261b81[_0xc31b('0x17')][_0xc31b('0x16')]);}})[_0xc31b('0x18')](function(_0x588898){logger[_0xc31b('0x14')]('SquareReport,\x20%s,\x20%s',_0x5a6bb3,_0x588898);_0x275318(_0x588898);});});}exports[_0xc31b('0x19')]=function(_0x5ed93f){var _0x207e28=this;return new Promise(function(_0x5c921a,_0x5e20e2){return db[_0xc31b('0x1a')][_0xc31b('0x1b')](_0x5ed93f[_0xc31b('0x1c')],{'raw':_0x5ed93f[_0xc31b('0x1d')]?_0x5ed93f[_0xc31b('0x1d')][_0xc31b('0x1e')]===undefined?!![]:![]:!![]})[_0xc31b('0xe')](function(_0xdc7b25){logger[_0xc31b('0xf')]('CreateSquareReport',_0x5ed93f);logger['debug'](_0xc31b('0x19'),_0x5ed93f,JSON[_0xc31b('0x13')](_0xdc7b25));_0x5c921a(_0xdc7b25);})[_0xc31b('0x18')](function(_0x14481c){logger[_0xc31b('0x14')](_0xc31b('0x19'),_0x14481c[_0xc31b('0x16')],_0x5ed93f);_0x5e20e2(_0x207e28[_0xc31b('0x14')](0x1f4,_0x14481c['message']));});});};exports[_0xc31b('0x1f')]=function(_0x4ca3d7){var _0x88c4c5=this;return new Promise(function(_0x237724,_0x4bcebe){return db['SquareReport'][_0xc31b('0x20')](_0x4ca3d7[_0xc31b('0x1c')],{'raw':_0x4ca3d7[_0xc31b('0x1d')]?_0x4ca3d7[_0xc31b('0x1d')][_0xc31b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca3d7['options']?_0x4ca3d7[_0xc31b('0x1d')][_0xc31b('0x21')]||null:null,'attributes':_0x4ca3d7['options']?_0x4ca3d7[_0xc31b('0x1d')][_0xc31b('0x22')]||null:null,'limit':_0x4ca3d7[_0xc31b('0x1d')]?_0x4ca3d7[_0xc31b('0x1d')][_0xc31b('0x23')]||null:null})['then'](function(_0x4814fe){logger[_0xc31b('0xf')](_0xc31b('0x1f'),_0x4ca3d7);logger[_0xc31b('0x11')](_0xc31b('0x1f'),_0x4ca3d7,JSON['stringify'](_0x4814fe));_0x237724(_0x4814fe);})[_0xc31b('0x18')](function(_0x5164c1){logger[_0xc31b('0x14')](_0xc31b('0x1f'),_0x5164c1[_0xc31b('0x16')],_0x4ca3d7);_0x4bcebe(_0x88c4c5[_0xc31b('0x14')](0x1f4,_0x5164c1[_0xc31b('0x16')]));});});}; \ No newline at end of file +var _0x1418=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','options','raw','UpdateSquareReport','SquareReport','body','attributes','lodash'];(function(_0x266df3,_0x310f44){var _0x36684b=function(_0x2db786){while(--_0x2db786){_0x266df3['push'](_0x266df3['shift']());}};_0x36684b(++_0x310f44);}(_0x1418,0x1df));var _0x8141=function(_0x2b626b,_0x598f60){_0x2b626b=_0x2b626b-0x0;var _0x3407c6=_0x1418[_0x2b626b];return _0x3407c6;};'use strict';var _=require(_0x8141('0x0'));var util=require(_0x8141('0x1'));var moment=require('moment');var BPromise=require(_0x8141('0x2'));var rs=require(_0x8141('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8141('0x4'))['db'];var utils=require(_0x8141('0x5'));var logger=require(_0x8141('0x6'))(_0x8141('0x7'));var config=require(_0x8141('0x8'));var jayson=require(_0x8141('0x9'));var client=jayson[_0x8141('0xa')][_0x8141('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cde2,_0x2cfe05,_0x53b5ca){return new BPromise(function(_0xc1b8ee,_0x3acf09){return client[_0x8141('0xc')](_0x25cde2,_0x53b5ca)[_0x8141('0xd')](function(_0x1fb024){logger[_0x8141('0xe')](_0x8141('0xf'),_0x2cfe05,_0x8141('0x10'));logger[_0x8141('0x11')](_0x8141('0x12'),_0x2cfe05,_0x8141('0x10'),JSON[_0x8141('0x13')](_0x1fb024));if(_0x1fb024[_0x8141('0x14')]){if(_0x1fb024[_0x8141('0x14')][_0x8141('0x15')]===0x1f4){logger['error'](_0x8141('0xf'),_0x2cfe05,_0x1fb024[_0x8141('0x14')]['message']);return _0x3acf09(_0x1fb024[_0x8141('0x14')]['message']);}logger[_0x8141('0x14')](_0x8141('0xf'),_0x2cfe05,_0x1fb024[_0x8141('0x14')]['message']);return _0xc1b8ee(_0x1fb024[_0x8141('0x14')][_0x8141('0x16')]);}else{logger[_0x8141('0xe')](_0x8141('0xf'),_0x2cfe05,_0x8141('0x10'));_0xc1b8ee(_0x1fb024[_0x8141('0x17')][_0x8141('0x16')]);}})[_0x8141('0x18')](function(_0x31a4a2){logger['error'](_0x8141('0xf'),_0x2cfe05,_0x31a4a2);_0x3acf09(_0x31a4a2);});});}exports[_0x8141('0x19')]=function(_0x55bce1){var _0x3da735=this;return new Promise(function(_0x34e697,_0x2063c4){return db['SquareReport']['create'](_0x55bce1['body'],{'raw':_0x55bce1[_0x8141('0x1a')]?_0x55bce1[_0x8141('0x1a')][_0x8141('0x1b')]===undefined?!![]:![]:!![]})[_0x8141('0xd')](function(_0x1b95e7){logger[_0x8141('0xe')](_0x8141('0x19'),_0x55bce1);logger['debug']('CreateSquareReport',_0x55bce1,JSON['stringify'](_0x1b95e7));_0x34e697(_0x1b95e7);})[_0x8141('0x18')](function(_0x1a8cfa){logger[_0x8141('0x14')]('CreateSquareReport',_0x1a8cfa['message'],_0x55bce1);_0x2063c4(_0x3da735[_0x8141('0x14')](0x1f4,_0x1a8cfa[_0x8141('0x16')]));});});};exports[_0x8141('0x1c')]=function(_0x173a8e){var _0x265ec0=this;return new Promise(function(_0x267c21,_0x51aba5){return db[_0x8141('0x1d')]['update'](_0x173a8e[_0x8141('0x1e')],{'raw':_0x173a8e[_0x8141('0x1a')]?_0x173a8e[_0x8141('0x1a')][_0x8141('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x173a8e[_0x8141('0x1a')]?_0x173a8e[_0x8141('0x1a')]['where']||null:null,'attributes':_0x173a8e['options']?_0x173a8e['options'][_0x8141('0x1f')]||null:null,'limit':_0x173a8e['options']?_0x173a8e[_0x8141('0x1a')]['limit']||null:null})[_0x8141('0xd')](function(_0x67f159){logger[_0x8141('0xe')](_0x8141('0x1c'),_0x173a8e);logger[_0x8141('0x11')](_0x8141('0x1c'),_0x173a8e,JSON['stringify'](_0x67f159));_0x267c21(_0x67f159);})[_0x8141('0x18')](function(_0x5be0e7){logger[_0x8141('0x14')](_0x8141('0x1c'),_0x5be0e7[_0x8141('0x16')],_0x173a8e);_0x51aba5(_0x265ec0[_0x8141('0x14')](0x1f4,_0x5be0e7[_0x8141('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 5855f44..8fc38b8 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 _0x4601=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','show','put','update','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4601,0xd1));var _0x1460=function(_0x32bc2c,_0x2f1456){_0x32bc2c=_0x32bc2c-0x0;var _0x1115f6=_0x4601[_0x32bc2c];return _0x1115f6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1460('0x0'));var express=require(_0x1460('0x1'));var router=express[_0x1460('0x2')]();var fs_extra=require(_0x1460('0x3'));var auth=require(_0x1460('0x4'));var interaction=require(_0x1460('0x5'));var config=require(_0x1460('0x6'));var controller=require(_0x1460('0x7'));router[_0x1460('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1460('0x8')]('/describe',auth[_0x1460('0x9')](),controller[_0x1460('0xa')]);router[_0x1460('0x8')](_0x1460('0xb'),auth[_0x1460('0x9')](),controller[_0x1460('0xc')]);router['post']('/',auth[_0x1460('0x9')](),controller['create']);router[_0x1460('0xd')]('/:id',auth[_0x1460('0x9')](),controller[_0x1460('0xe')]);router['delete'](_0x1460('0xb'),auth[_0x1460('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xedd9=['index','/describe','describe','post','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x43ff91,_0x234529){var _0x4ec65c=function(_0x2f0d6a){while(--_0x2f0d6a){_0x43ff91['push'](_0x43ff91['shift']());}};_0x4ec65c(++_0x234529);}(_0xedd9,0x121));var _0x9edd=function(_0xd9ce3,_0x45872f){_0xd9ce3=_0xd9ce3-0x0;var _0x1703c0=_0xedd9[_0xd9ce3];return _0x1703c0;};'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[_0x9edd('0x9')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')]('/:id',auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xe')]('/',auth['isAuthenticated'](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x12')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller['destroy']);module[_0x9edd('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 00bed72..85d79c7 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 _0xc9ca=['STRING','TEXT','sequelize','exports'];(function(_0x5f31f6,_0x83e4f3){var _0x5acc4b=function(_0x3c7a89){while(--_0x3c7a89){_0x5f31f6['push'](_0x5f31f6['shift']());}};_0x5acc4b(++_0x83e4f3);}(_0xc9ca,0x116));var _0xac9c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc9ca[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xac9c('0x0'));module[_0xac9c('0x1')]={'uniqueid':{'type':Sequelize[_0xac9c('0x2')]},'node':{'type':Sequelize[_0xac9c('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xac9c('0x3')]},'project_name':{'type':Sequelize[_0xac9c('0x2')]},'callerid':{'type':Sequelize[_0xac9c('0x2')]}}; \ No newline at end of file +var _0x5774=['TEXT','sequelize','exports','STRING'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x5774,0xd5));var _0x4577=function(_0x8fa71f,_0x211b50){_0x8fa71f=_0x8fa71f-0x0;var _0xd7515d=_0x5774[_0x8fa71f];return _0xd7515d;};'use strict';var Sequelize=require(_0x4577('0x0'));module[_0x4577('0x1')]={'uniqueid':{'type':Sequelize[_0x4577('0x2')]},'node':{'type':Sequelize[_0x4577('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x4577('0x3')]},'project_name':{'type':Sequelize[_0x4577('0x2')]},'callerid':{'type':Sequelize[_0x4577('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4006d08..e5e0cae 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 _0xf119=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','keys','includeAll','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis'];(function(_0x48d1ee,_0x4e27b2){var _0x1960aa=function(_0x564ec1){while(--_0x564ec1){_0x48d1ee['push'](_0x48d1ee['shift']());}};_0x1960aa(++_0x4e27b2);}(_0xf119,0x7f));var _0x9f11=function(_0x55a9d4,_0x203e63){_0x55a9d4=_0x55a9d4-0x0;var _0x43186c=_0xf119[_0x55a9d4];return _0x43186c;};'use strict';var emlformat=require(_0x9f11('0x0'));var rimraf=require(_0x9f11('0x1'));var zipdir=require(_0x9f11('0x2'));var jsonpatch=require(_0x9f11('0x3'));var rp=require(_0x9f11('0x4'));var moment=require(_0x9f11('0x5'));var BPromise=require(_0x9f11('0x6'));var Mustache=require('mustache');var util=require(_0x9f11('0x7'));var path=require('path');var sox=require(_0x9f11('0x8'));var csv=require(_0x9f11('0x9'));var ejs=require(_0x9f11('0xa'));var fs=require('fs');var fs_extra=require(_0x9f11('0xb'));var _=require('lodash');var squel=require(_0x9f11('0xc'));var crypto=require(_0x9f11('0xd'));var jsforce=require(_0x9f11('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9f11('0x9'));var querystring=require(_0x9f11('0xf'));var Papa=require('papaparse');var Redis=require(_0x9f11('0x10'));var authService=require(_0x9f11('0x11'));var qs=require(_0x9f11('0x12'));var as=require(_0x9f11('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f11('0x14'))(_0x9f11('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9f11('0x16'));var db=require(_0x9f11('0x17'))['db'];function respondWithStatusCode(_0x16570c,_0x11edee){_0x11edee=_0x11edee||0xcc;return function(_0x48087c){if(_0x48087c){return _0x16570c['sendStatus'](_0x11edee);}return _0x16570c[_0x9f11('0x18')](_0x11edee)[_0x9f11('0x19')]();};}function respondWithResult(_0xfe273f,_0xc3efb0){_0xc3efb0=_0xc3efb0||0xc8;return function(_0x3895fb){if(_0x3895fb){return _0xfe273f[_0x9f11('0x18')](_0xc3efb0)['json'](_0x3895fb);}};}function respondWithFilteredResult(_0x49f9e6,_0x4cf9b2){return function(_0x155b46){if(_0x155b46){var _0x569639=typeof _0x4cf9b2[_0x9f11('0x1a')]==='undefined'&&typeof _0x4cf9b2[_0x9f11('0x1b')]===_0x9f11('0x1c');var _0x5b39b2=_0x155b46['count'];var _0x6be188=_0x569639?0x0:_0x4cf9b2['offset'];var _0x4d41d5=_0x569639?_0x155b46[_0x9f11('0x1d')]:_0x4cf9b2[_0x9f11('0x1a')]+_0x4cf9b2['limit'];var _0x4b2bb0;if(_0x4d41d5>=_0x5b39b2){_0x4d41d5=_0x5b39b2;_0x4b2bb0=0xc8;}else{_0x4b2bb0=0xce;}_0x49f9e6[_0x9f11('0x18')](_0x4b2bb0);return _0x49f9e6['set'](_0x9f11('0x1e'),_0x6be188+'-'+_0x4d41d5+'/'+_0x5b39b2)['json'](_0x155b46);}return null;};}function patchUpdates(_0x34d396){return function(_0x283cb3){try{jsonpatch[_0x9f11('0x1f')](_0x283cb3,_0x34d396,!![]);}catch(_0x41a727){return BPromise[_0x9f11('0x20')](_0x41a727);}return _0x283cb3[_0x9f11('0x21')]();};}function saveUpdates(_0x2e2823,_0x50a511){return function(_0x112efe){if(_0x112efe){return _0x112efe[_0x9f11('0x22')](_0x2e2823)[_0x9f11('0x23')](function(_0x17009a){return _0x17009a;});}return null;};}function removeEntity(_0x20203d,_0x2e5b89){return function(_0x280a81){if(_0x280a81){return _0x280a81[_0x9f11('0x24')]()[_0x9f11('0x23')](function(){_0x20203d[_0x9f11('0x18')](0xcc)[_0x9f11('0x19')]();});}};}function handleEntityNotFound(_0x37c7cc,_0x553d4c){return function(_0x52efde){if(!_0x52efde){_0x37c7cc['sendStatus'](0x194);}return _0x52efde;};}function handleError(_0x5a3fb5,_0xdd2f89){_0xdd2f89=_0xdd2f89||0x1f4;return function(_0x46a180){logger[_0x9f11('0x25')](_0x46a180[_0x9f11('0x26')]);if(_0x46a180[_0x9f11('0x27')]){delete _0x46a180['name'];}_0x5a3fb5[_0x9f11('0x18')](_0xdd2f89)[_0x9f11('0x28')](_0x46a180);};}exports['index']=function(_0xafab56,_0x3550e4){var _0x54c319={},_0x66db59={},_0x436b08={'count':0x0,'rows':[]};var _0x284052=_[_0x9f11('0x29')](db[_0x9f11('0x2a')][_0x9f11('0x2b')],function(_0xcd45c1){return{'name':_0xcd45c1[_0x9f11('0x2c')],'type':_0xcd45c1[_0x9f11('0x2d')]['key']};});_0x66db59['model']=_['map'](_0x284052,_0x9f11('0x27'));_0x66db59[_0x9f11('0x2e')]=_['keys'](_0xafab56[_0x9f11('0x2e')]);_0x66db59[_0x9f11('0x2f')]=_['intersection'](_0x66db59['model'],_0x66db59['query']);_0x54c319[_0x9f11('0x30')]=_[_0x9f11('0x31')](_0x66db59[_0x9f11('0x32')],qs[_0x9f11('0x33')](_0xafab56['query']['fields']));_0x54c319[_0x9f11('0x30')]=_0x54c319[_0x9f11('0x30')]['length']?_0x54c319['attributes']:_0x66db59[_0x9f11('0x32')];if(!_0xafab56[_0x9f11('0x2e')][_0x9f11('0x34')](_0x9f11('0x35'))){_0x54c319[_0x9f11('0x1b')]=qs[_0x9f11('0x1b')](_0xafab56['query'][_0x9f11('0x1b')]);_0x54c319[_0x9f11('0x1a')]=qs[_0x9f11('0x1a')](_0xafab56[_0x9f11('0x2e')][_0x9f11('0x1a')]);}_0x54c319['order']=qs[_0x9f11('0x36')](_0xafab56[_0x9f11('0x2e')][_0x9f11('0x36')]);_0x54c319[_0x9f11('0x37')]=qs[_0x9f11('0x2f')](_[_0x9f11('0x38')](_0xafab56[_0x9f11('0x2e')],_0x66db59[_0x9f11('0x2f')]),_0x284052);if(_0xafab56['query'][_0x9f11('0x39')]){_0x54c319['where']=_[_0x9f11('0x3a')](_0x54c319['where'],{'$or':_[_0x9f11('0x29')](_0x284052,function(_0x32e98f){if(_0x32e98f[_0x9f11('0x2d')]!==_0x9f11('0x3b')){var _0x58d03f={};_0x58d03f[_0x32e98f[_0x9f11('0x27')]]={'$like':'%'+_0xafab56[_0x9f11('0x2e')]['filter']+'%'};return _0x58d03f;}})});}_0x54c319=_['merge']({},_0x54c319,_0xafab56['options']);var _0x2bb2cf={'where':_0x54c319['where']};return db[_0x9f11('0x2a')]['count'](_0x2bb2cf)[_0x9f11('0x23')](function(_0x545411){_0x436b08[_0x9f11('0x1d')]=_0x545411;if(_0xafab56[_0x9f11('0x2e')]['includeAll']){_0x54c319['include']=[{'all':!![]}];}return db[_0x9f11('0x2a')][_0x9f11('0x3c')](_0x54c319);})[_0x9f11('0x23')](function(_0x2eab59){_0x436b08[_0x9f11('0x3d')]=_0x2eab59;return _0x436b08;})[_0x9f11('0x23')](respondWithFilteredResult(_0x3550e4,_0x54c319))['catch'](handleError(_0x3550e4,null));};exports[_0x9f11('0x3e')]=function(_0x313ffa,_0x2134b6){var _0x11a7a3={'raw':!![],'where':{'id':_0x313ffa[_0x9f11('0x3f')]['id']}},_0x7d74f5={};_0x7d74f5[_0x9f11('0x32')]=_['keys'](db[_0x9f11('0x2a')][_0x9f11('0x2b')]);_0x7d74f5[_0x9f11('0x2e')]=_[_0x9f11('0x40')](_0x313ffa[_0x9f11('0x2e')]);_0x7d74f5[_0x9f11('0x2f')]=_[_0x9f11('0x31')](_0x7d74f5['model'],_0x7d74f5[_0x9f11('0x2e')]);_0x11a7a3[_0x9f11('0x30')]=_[_0x9f11('0x31')](_0x7d74f5[_0x9f11('0x32')],qs[_0x9f11('0x33')](_0x313ffa[_0x9f11('0x2e')][_0x9f11('0x33')]));_0x11a7a3[_0x9f11('0x30')]=_0x11a7a3['attributes']['length']?_0x11a7a3[_0x9f11('0x30')]:_0x7d74f5[_0x9f11('0x32')];if(_0x313ffa['query'][_0x9f11('0x41')]){_0x11a7a3['include']=[{'all':!![]}];}_0x11a7a3=_[_0x9f11('0x3a')]({},_0x11a7a3,_0x313ffa[_0x9f11('0x42')]);return db[_0x9f11('0x2a')][_0x9f11('0x43')](_0x11a7a3)['then'](handleEntityNotFound(_0x2134b6,null))[_0x9f11('0x23')](respondWithResult(_0x2134b6,null))['catch'](handleError(_0x2134b6,null));};exports[_0x9f11('0x44')]=function(_0x20172c,_0x1cecf4){return db['SquareDetailsReport'][_0x9f11('0x44')](_0x20172c[_0x9f11('0x45')],{})[_0x9f11('0x23')](respondWithResult(_0x1cecf4,0xc9))[_0x9f11('0x46')](handleError(_0x1cecf4,null));};exports[_0x9f11('0x22')]=function(_0x3ef6c6,_0xb2d6f4){if(_0x3ef6c6[_0x9f11('0x45')]['id']){delete _0x3ef6c6[_0x9f11('0x45')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3ef6c6[_0x9f11('0x3f')]['id']}})[_0x9f11('0x23')](handleEntityNotFound(_0xb2d6f4,null))[_0x9f11('0x23')](saveUpdates(_0x3ef6c6[_0x9f11('0x45')],null))[_0x9f11('0x23')](respondWithResult(_0xb2d6f4,null))[_0x9f11('0x46')](handleError(_0xb2d6f4,null));};exports[_0x9f11('0x24')]=function(_0x35c57b,_0x596d5d){return db[_0x9f11('0x2a')][_0x9f11('0x43')]({'where':{'id':_0x35c57b[_0x9f11('0x3f')]['id']}})['then'](handleEntityNotFound(_0x596d5d,null))['then'](removeEntity(_0x596d5d,null))[_0x9f11('0x46')](handleError(_0x596d5d,null));};exports[_0x9f11('0x47')]=function(_0x5cbfb3,_0x542d23){return db[_0x9f11('0x2a')][_0x9f11('0x47')]()[_0x9f11('0x23')](respondWithResult(_0x542d23,null))[_0x9f11('0x46')](handleError(_0x542d23,null));}; \ No newline at end of file +var _0x7306=['sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x7306,0x76));var _0x6730=function(_0x29100b,_0x222f53){_0x29100b=_0x29100b-0x0;var _0x21810c=_0x7306[_0x29100b];return _0x21810c;};'use strict';var emlformat=require(_0x6730('0x0'));var rimraf=require(_0x6730('0x1'));var zipdir=require(_0x6730('0x2'));var jsonpatch=require(_0x6730('0x3'));var rp=require(_0x6730('0x4'));var moment=require(_0x6730('0x5'));var BPromise=require(_0x6730('0x6'));var Mustache=require(_0x6730('0x7'));var util=require(_0x6730('0x8'));var path=require(_0x6730('0x9'));var sox=require(_0x6730('0xa'));var csv=require(_0x6730('0xb'));var ejs=require(_0x6730('0xc'));var fs=require('fs');var fs_extra=require(_0x6730('0xd'));var _=require('lodash');var squel=require(_0x6730('0xe'));var crypto=require(_0x6730('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6730('0xb'));var querystring=require(_0x6730('0x10'));var Papa=require(_0x6730('0x11'));var Redis=require(_0x6730('0x12'));var authService=require(_0x6730('0x13'));var qs=require(_0x6730('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6730('0x15'));var logger=require(_0x6730('0x16'))(_0x6730('0x17'));var utils=require(_0x6730('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6730('0x19'));var db=require(_0x6730('0x1a'))['db'];function respondWithStatusCode(_0x3fa09a,_0x14aac9){_0x14aac9=_0x14aac9||0xcc;return function(_0x4bff87){if(_0x4bff87){return _0x3fa09a['sendStatus'](_0x14aac9);}return _0x3fa09a['status'](_0x14aac9)[_0x6730('0x1b')]();};}function respondWithResult(_0x516b4a,_0x3bda44){_0x3bda44=_0x3bda44||0xc8;return function(_0x1ceb2e){if(_0x1ceb2e){return _0x516b4a[_0x6730('0x1c')](_0x3bda44)[_0x6730('0x1d')](_0x1ceb2e);}};}function respondWithFilteredResult(_0xa22ec5,_0x5ec5ec){return function(_0x4f6e17){if(_0x4f6e17){var _0x360f68=typeof _0x5ec5ec[_0x6730('0x1e')]===_0x6730('0x1f')&&typeof _0x5ec5ec['limit']===_0x6730('0x1f');var _0x10eb24=_0x4f6e17['count'];var _0x54f7ee=_0x360f68?0x0:_0x5ec5ec[_0x6730('0x1e')];var _0x6d5641=_0x360f68?_0x4f6e17[_0x6730('0x20')]:_0x5ec5ec[_0x6730('0x1e')]+_0x5ec5ec[_0x6730('0x21')];var _0x22cf37;if(_0x6d5641>=_0x10eb24){_0x6d5641=_0x10eb24;_0x22cf37=0xc8;}else{_0x22cf37=0xce;}_0xa22ec5[_0x6730('0x1c')](_0x22cf37);return _0xa22ec5[_0x6730('0x22')](_0x6730('0x23'),_0x54f7ee+'-'+_0x6d5641+'/'+_0x10eb24)['json'](_0x4f6e17);}return null;};}function patchUpdates(_0x5c83b4){return function(_0x2a4fca){try{jsonpatch[_0x6730('0x24')](_0x2a4fca,_0x5c83b4,!![]);}catch(_0x1a39a2){return BPromise[_0x6730('0x25')](_0x1a39a2);}return _0x2a4fca[_0x6730('0x26')]();};}function saveUpdates(_0x1926ef,_0x317067){return function(_0x2c9638){if(_0x2c9638){return _0x2c9638[_0x6730('0x27')](_0x1926ef)['then'](function(_0x4bdf2b){return _0x4bdf2b;});}return null;};}function removeEntity(_0x4bc515,_0x5b289b){return function(_0x479b3f){if(_0x479b3f){return _0x479b3f[_0x6730('0x28')]()[_0x6730('0x29')](function(){_0x4bc515['status'](0xcc)[_0x6730('0x1b')]();});}};}function handleEntityNotFound(_0x4193ca,_0x227cdf){return function(_0xdba0df){if(!_0xdba0df){_0x4193ca[_0x6730('0x2a')](0x194);}return _0xdba0df;};}function handleError(_0x48694d,_0x4502a4){_0x4502a4=_0x4502a4||0x1f4;return function(_0x22021d){logger[_0x6730('0x2b')](_0x22021d['stack']);if(_0x22021d[_0x6730('0x2c')]){delete _0x22021d[_0x6730('0x2c')];}_0x48694d[_0x6730('0x1c')](_0x4502a4)[_0x6730('0x2d')](_0x22021d);};}exports[_0x6730('0x2e')]=function(_0x19acd6,_0x5f5342){var _0x866c2e={},_0x20179d={},_0x25dfdd={'count':0x0,'rows':[]};var _0x4f4673=_[_0x6730('0x2f')](db[_0x6730('0x30')][_0x6730('0x31')],function(_0x569c09){return{'name':_0x569c09[_0x6730('0x32')],'type':_0x569c09['type']['key']};});_0x20179d[_0x6730('0x33')]=_[_0x6730('0x2f')](_0x4f4673,_0x6730('0x2c'));_0x20179d[_0x6730('0x34')]=_[_0x6730('0x35')](_0x19acd6[_0x6730('0x34')]);_0x20179d[_0x6730('0x36')]=_['intersection'](_0x20179d[_0x6730('0x33')],_0x20179d[_0x6730('0x34')]);_0x866c2e[_0x6730('0x37')]=_['intersection'](_0x20179d[_0x6730('0x33')],qs['fields'](_0x19acd6[_0x6730('0x34')][_0x6730('0x38')]));_0x866c2e[_0x6730('0x37')]=_0x866c2e['attributes'][_0x6730('0x39')]?_0x866c2e['attributes']:_0x20179d['model'];if(!_0x19acd6[_0x6730('0x34')][_0x6730('0x3a')](_0x6730('0x3b'))){_0x866c2e[_0x6730('0x21')]=qs['limit'](_0x19acd6[_0x6730('0x34')][_0x6730('0x21')]);_0x866c2e['offset']=qs[_0x6730('0x1e')](_0x19acd6['query'][_0x6730('0x1e')]);}_0x866c2e[_0x6730('0x3c')]=qs['sort'](_0x19acd6[_0x6730('0x34')][_0x6730('0x3d')]);_0x866c2e['where']=qs[_0x6730('0x36')](_[_0x6730('0x3e')](_0x19acd6[_0x6730('0x34')],_0x20179d[_0x6730('0x36')]),_0x4f4673);if(_0x19acd6[_0x6730('0x34')]['filter']){_0x866c2e[_0x6730('0x3f')]=_[_0x6730('0x40')](_0x866c2e[_0x6730('0x3f')],{'$or':_['map'](_0x4f4673,function(_0x5e2039){if(_0x5e2039[_0x6730('0x41')]!==_0x6730('0x42')){var _0x3e9620={};_0x3e9620[_0x5e2039[_0x6730('0x2c')]]={'$like':'%'+_0x19acd6['query']['filter']+'%'};return _0x3e9620;}})});}_0x866c2e=_[_0x6730('0x40')]({},_0x866c2e,_0x19acd6[_0x6730('0x43')]);var _0x4f3965={'where':_0x866c2e[_0x6730('0x3f')]};return db[_0x6730('0x30')][_0x6730('0x20')](_0x4f3965)[_0x6730('0x29')](function(_0x483548){_0x25dfdd[_0x6730('0x20')]=_0x483548;if(_0x19acd6[_0x6730('0x34')][_0x6730('0x44')]){_0x866c2e[_0x6730('0x45')]=[{'all':!![]}];}return db[_0x6730('0x30')][_0x6730('0x46')](_0x866c2e);})[_0x6730('0x29')](function(_0x5ade89){_0x25dfdd[_0x6730('0x47')]=_0x5ade89;return _0x25dfdd;})['then'](respondWithFilteredResult(_0x5f5342,_0x866c2e))[_0x6730('0x48')](handleError(_0x5f5342,null));};exports[_0x6730('0x49')]=function(_0x5235a2,_0x12d75){var _0x13c2c3={'raw':!![],'where':{'id':_0x5235a2[_0x6730('0x4a')]['id']}},_0xdd9f85={};_0xdd9f85[_0x6730('0x33')]=_['keys'](db['SquareDetailsReport'][_0x6730('0x31')]);_0xdd9f85['query']=_[_0x6730('0x35')](_0x5235a2[_0x6730('0x34')]);_0xdd9f85['filters']=_[_0x6730('0x4b')](_0xdd9f85[_0x6730('0x33')],_0xdd9f85['query']);_0x13c2c3[_0x6730('0x37')]=_[_0x6730('0x4b')](_0xdd9f85[_0x6730('0x33')],qs[_0x6730('0x38')](_0x5235a2[_0x6730('0x34')][_0x6730('0x38')]));_0x13c2c3[_0x6730('0x37')]=_0x13c2c3[_0x6730('0x37')][_0x6730('0x39')]?_0x13c2c3[_0x6730('0x37')]:_0xdd9f85['model'];if(_0x5235a2[_0x6730('0x34')][_0x6730('0x44')]){_0x13c2c3[_0x6730('0x45')]=[{'all':!![]}];}_0x13c2c3=_[_0x6730('0x40')]({},_0x13c2c3,_0x5235a2[_0x6730('0x43')]);return db[_0x6730('0x30')][_0x6730('0x4c')](_0x13c2c3)['then'](handleEntityNotFound(_0x12d75,null))[_0x6730('0x29')](respondWithResult(_0x12d75,null))[_0x6730('0x48')](handleError(_0x12d75,null));};exports[_0x6730('0x4d')]=function(_0x2e22db,_0x634fbf){return db[_0x6730('0x30')]['create'](_0x2e22db['body'],{})[_0x6730('0x29')](respondWithResult(_0x634fbf,0xc9))['catch'](handleError(_0x634fbf,null));};exports[_0x6730('0x27')]=function(_0x1b0c8d,_0x6cc3b8){if(_0x1b0c8d[_0x6730('0x4e')]['id']){delete _0x1b0c8d[_0x6730('0x4e')]['id'];}return db[_0x6730('0x30')][_0x6730('0x4c')]({'where':{'id':_0x1b0c8d['params']['id']}})['then'](handleEntityNotFound(_0x6cc3b8,null))[_0x6730('0x29')](saveUpdates(_0x1b0c8d['body'],null))[_0x6730('0x29')](respondWithResult(_0x6cc3b8,null))[_0x6730('0x48')](handleError(_0x6cc3b8,null));};exports[_0x6730('0x28')]=function(_0xee1e92,_0x47915a){return db[_0x6730('0x30')][_0x6730('0x4c')]({'where':{'id':_0xee1e92[_0x6730('0x4a')]['id']}})[_0x6730('0x29')](handleEntityNotFound(_0x47915a,null))[_0x6730('0x29')](removeEntity(_0x47915a,null))['catch'](handleError(_0x47915a,null));};exports[_0x6730('0x4f')]=function(_0x1337b7,_0x3b2c93){return db[_0x6730('0x30')][_0x6730('0x4f')]()['then'](respondWithResult(_0x3b2c93,null))['catch'](handleError(_0x3b2c93,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1cfd85c..5dd3a45 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 _0x9ce7=['SquareDetailsReport','report_square_details','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9ce7,0x12e));var _0x79ce=function(_0x1a8cbd,_0x11565b){_0x1a8cbd=_0x1a8cbd-0x0;var _0x53fcc3=_0x9ce7[_0x1a8cbd];return _0x53fcc3;};'use strict';var _=require('lodash');var util=require(_0x79ce('0x0'));var logger=require('../../config/logger')(_0x79ce('0x1'));var moment=require(_0x79ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x79ce('0x3'));var fs=require('fs');var path=require(_0x79ce('0x4'));var rimraf=require(_0x79ce('0x5'));var config=require(_0x79ce('0x6'));var attributes=require(_0x79ce('0x7'));module[_0x79ce('0x8')]=function(_0x2923ad,_0x352e20){return _0x2923ad[_0x79ce('0x9')](_0x79ce('0xa'),attributes,{'tableName':_0x79ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61c2=['exports','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x2b374c,_0x456710){var _0x5dd3ed=function(_0x41a249){while(--_0x41a249){_0x2b374c['push'](_0x2b374c['shift']());}};_0x5dd3ed(++_0x456710);}(_0x61c2,0x147));var _0x261c=function(_0x1115ab,_0x2c80e2){_0x1115ab=_0x1115ab-0x0;var _0x430e4d=_0x61c2[_0x1115ab];return _0x430e4d;};'use strict';var _=require(_0x261c('0x0'));var util=require(_0x261c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x261c('0x2'));var BPromise=require(_0x261c('0x3'));var rp=require(_0x261c('0x4'));var fs=require('fs');var path=require(_0x261c('0x5'));var rimraf=require(_0x261c('0x6'));var config=require(_0x261c('0x7'));var attributes=require(_0x261c('0x8'));module[_0x261c('0x9')]=function(_0x5b514c,_0x51bfb3){return _0x5b514c['define'](_0x261c('0xa'),attributes,{'tableName':_0x261c('0xb'),'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 379336c..ae6ce9b 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 _0x8f59=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x405022,_0x2377a8){var _0x3b29e7=function(_0xb927b5){while(--_0xb927b5){_0x405022['push'](_0x405022['shift']());}};_0x3b29e7(++_0x2377a8);}(_0x8f59,0x11d));var _0x98f5=function(_0x4641d5,_0x5bf8c9){_0x4641d5=_0x4641d5-0x0;var _0x253adb=_0x8f59[_0x4641d5];return _0x253adb;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')](_0x51a567[_0x98f5('0x17')],{'raw':_0x51a567['options']?_0x51a567[_0x98f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x98f5('0x19')](function(_0x191f23){logger['info'](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x1a')](_0x98f5('0x14'),_0x51a567,JSON[_0x98f5('0x1b')](_0x191f23));_0x9e42dd(_0x191f23);})[_0x98f5('0x1c')](function(_0x3dc7c2){logger[_0x98f5('0x11')]('CreateSquareDetailsReport',_0x3dc7c2[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c['error'](0x1f4,_0x3dc7c2[_0x98f5('0x12')]));});});}; \ No newline at end of file +var _0x68a5=['SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68a5,0xfc));var _0x568a=function(_0x30ce2b,_0x503d7a){_0x30ce2b=_0x30ce2b-0x0;var _0x16ea8e=_0x68a5[_0x30ce2b];return _0x16ea8e;};'use strict';var _=require(_0x568a('0x0'));var util=require('util');var moment=require(_0x568a('0x1'));var BPromise=require(_0x568a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x568a('0x3'));var db=require(_0x568a('0x4'))['db'];var utils=require(_0x568a('0x5'));var logger=require(_0x568a('0x6'))('rpc');var config=require(_0x568a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x568a('0x8')][_0x568a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d36ec,_0x3a7a9c,_0x4cda9a){return new BPromise(function(_0x172efd,_0x56deb6){return client[_0x568a('0xa')](_0x2d36ec,_0x4cda9a)[_0x568a('0xb')](function(_0x335ecd){logger[_0x568a('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a7a9c,'request\x20sent');logger[_0x568a('0xd')](_0x568a('0xe'),_0x3a7a9c,'request\x20sent',JSON[_0x568a('0xf')](_0x335ecd));if(_0x335ecd['error']){if(_0x335ecd[_0x568a('0x10')][_0x568a('0x11')]===0x1f4){logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x56deb6(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x172efd(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}else{logger[_0x568a('0xc')](_0x568a('0x12'),_0x3a7a9c,_0x568a('0x14'));_0x172efd(_0x335ecd['result'][_0x568a('0x13')]);}})['catch'](function(_0xa77de8){logger[_0x568a('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a7a9c,_0xa77de8);_0x56deb6(_0xa77de8);});});}exports[_0x568a('0x15')]=function(_0x561ae1){var _0x40d4a1=this;return new Promise(function(_0x1c8e3a,_0x9b4670){return db[_0x568a('0x16')]['create'](_0x561ae1[_0x568a('0x17')],{'raw':_0x561ae1['options']?_0x561ae1[_0x568a('0x18')][_0x568a('0x19')]===undefined?!![]:![]:!![]})[_0x568a('0xb')](function(_0x3b9968){logger[_0x568a('0xc')](_0x568a('0x15'),_0x561ae1);logger[_0x568a('0xd')](_0x568a('0x15'),_0x561ae1,JSON['stringify'](_0x3b9968));_0x1c8e3a(_0x3b9968);})[_0x568a('0x1a')](function(_0x1f12b5){logger['error'](_0x568a('0x15'),_0x1f12b5[_0x568a('0x13')],_0x561ae1);_0x9b4670(_0x40d4a1[_0x568a('0x10')](0x1f4,_0x1f12b5['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index f0d6713..c107960 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 _0x1690=['get','/process/:pid/kill','exports','express','Router','./system.controller','isAuthenticated','index'];(function(_0xdaff31,_0xaf350e){var _0x27f9fb=function(_0x5dedb0){while(--_0x5dedb0){_0xdaff31['push'](_0xdaff31['shift']());}};_0x27f9fb(++_0xaf350e);}(_0x1690,0x1b3));var _0x0169=function(_0x11bf6e,_0x5283f4){_0x11bf6e=_0x11bf6e-0x0;var _0xe68c9e=_0x1690[_0x11bf6e];return _0xe68c9e;};'use strict';var express=require(_0x0169('0x0'));var router=express[_0x0169('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0169('0x2'));router['get']('/',auth[_0x0169('0x3')](),controller[_0x0169('0x4')]);router[_0x0169('0x5')](_0x0169('0x6'),auth[_0x0169('0x3')](),controller['killProcess']);module[_0x0169('0x7')]=router; \ No newline at end of file +var _0x1e36=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x10e4be,_0xf5556d){var _0x1b4879=function(_0x4181a4){while(--_0x4181a4){_0x10e4be['push'](_0x10e4be['shift']());}};_0x1b4879(++_0xf5556d);}(_0x1e36,0x8b));var _0x61e3=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x1e36[_0x33fcbb];return _0x2efe40;};'use strict';var express=require(_0x61e3('0x0'));var router=express[_0x61e3('0x1')]();var auth=require(_0x61e3('0x2'));var controller=require('./system.controller');router[_0x61e3('0x3')]('/',auth[_0x61e3('0x4')](),controller['index']);router[_0x61e3('0x3')](_0x61e3('0x5'),auth[_0x61e3('0x4')](),controller[_0x61e3('0x6')]);module[_0x61e3('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 e4a6d79..29b3a5b 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 _0x4969=['pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','then','json','killProcess','components/import/cm'];(function(_0x5c4798,_0x4f29e8){var _0x6c0a96=function(_0x30de62){while(--_0x30de62){_0x5c4798['push'](_0x5c4798['shift']());}};_0x6c0a96(++_0x4f29e8);}(_0x4969,0x1ec));var _0x9496=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x4969[_0x2ddfd9];return _0x2668f0;};'use strict';var info=require('systeminformation');var exec=require(_0x9496('0x0'))[_0x9496('0x1')];var logger=require(_0x9496('0x2'))('api');var util=require(_0x9496('0x3'));var BPromise=require(_0x9496('0x4'));var _=require(_0x9496('0x5'));function handleError(_0x1893b5,_0x172e4d,_0x4af479){_0x172e4d=_0x172e4d||0x1f4;return function(_0x5be29e){logger['error'](_0x9496('0x6'),_0x4af479,_0x172e4d,util['inspect'](_0x5be29e,{'showHidden':![],'depth':null}));delete _0x5be29e['name'];_0x1893b5[_0x9496('0x7')](_0x172e4d)[_0x9496('0x8')](_0x5be29e);};}exports[_0x9496('0x9')]=function(_0xd87e14,_0x4ff0d8){return info['getAllData']()[_0x9496('0xa')](function(_0x42ad14){return _0x4ff0d8[_0x9496('0x7')](0xc8)[_0x9496('0xb')](_0x42ad14);})['catch'](function(_0x413f61){return _0x4ff0d8[_0x9496('0x7')](0x1f4)[_0x9496('0xb')](_0x413f61);});};exports[_0x9496('0xc')]=function(_0x317646,_0x4fe75d){var _0x509e66=[_0x9496('0xd')];return new BPromise(function(_0x4f2389,_0x3bea0f){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x317646['params'][_0x9496('0xe')]),function(_0x24ef96,_0x3cc651,_0x4a2122){if(_0x24ef96){return _0x3bea0f(_0x24ef96);}return _0x4f2389(_0x3cc651);});})['then'](function(_0x290f74){var _0x3d2371=![];var _0x50a0bc=_0x290f74[_0x9496('0xf')](/\n/);for(var _0x146703=0x0,_0x2d4452=_0x509e66[_0x9496('0x10')];_0x146703<_0x2d4452,_0x3d2371===![];_0x146703+=0x1){if(_0x290f74[_0x9496('0x11')](_0x509e66[_0x146703])>=0x0){_0x3d2371=!![];}}if(!_0x3d2371){throw new Error(util['format'](_0x9496('0x12'),_0x317646[_0x9496('0x13')][_0x9496('0xe')]));}process['kill'](_0x317646[_0x9496('0x13')][_0x9496('0xe')],_0x9496('0x14'));return _0x4fe75d['status'](0xc8)[_0x9496('0xb')]({'message':util[_0x9496('0x15')](_0x9496('0x16'),_0x317646[_0x9496('0x13')][_0x9496('0xe')])});})['catch'](handleError(_0x4fe75d,null,_0x9496('0xc')));}; \ No newline at end of file +var _0x0854=['params','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0854,0x168));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var info=require(_0x4085('0x0'));var exec=require(_0x4085('0x1'))['exec'];var logger=require(_0x4085('0x2'))('api');var util=require(_0x4085('0x3'));var BPromise=require('bluebird');var _=require(_0x4085('0x4'));function handleError(_0x4f05ab,_0x5d2d1a,_0x3924a1){_0x5d2d1a=_0x5d2d1a||0x1f4;return function(_0x5cfa1c){logger[_0x4085('0x5')](_0x4085('0x6'),_0x3924a1,_0x5d2d1a,util[_0x4085('0x7')](_0x5cfa1c,{'showHidden':![],'depth':null}));delete _0x5cfa1c[_0x4085('0x8')];_0x4f05ab[_0x4085('0x9')](_0x5d2d1a)['send'](_0x5cfa1c);};}exports[_0x4085('0xa')]=function(_0x4bc0b6,_0x240dd2){return info[_0x4085('0xb')]()['then'](function(_0x57c888){return _0x240dd2[_0x4085('0x9')](0xc8)[_0x4085('0xc')](_0x57c888);})[_0x4085('0xd')](function(_0x59c9f6){return _0x240dd2['status'](0x1f4)[_0x4085('0xc')](_0x59c9f6);});};exports[_0x4085('0xe')]=function(_0x48e523,_0x942147){var _0x2a388e=[_0x4085('0xf')];return new BPromise(function(_0x3d6f3c,_0x5bc6c0){return exec(util[_0x4085('0x10')](_0x4085('0x11'),_0x48e523[_0x4085('0x12')]['pid']),function(_0x2a8b53,_0x4a0b94,_0x3f87e2){if(_0x2a8b53){return _0x5bc6c0(_0x2a8b53);}return _0x3d6f3c(_0x4a0b94);});})[_0x4085('0x13')](function(_0x20231c){var _0x3baafc=![];var _0x117546=_0x20231c[_0x4085('0x14')](/\n/);for(var _0x3820ee=0x0,_0x34f98c=_0x2a388e['length'];_0x3820ee<_0x34f98c,_0x3baafc===![];_0x3820ee+=0x1){if(_0x20231c[_0x4085('0x15')](_0x2a388e[_0x3820ee])>=0x0){_0x3baafc=!![];}}if(!_0x3baafc){throw new Error(util[_0x4085('0x10')](_0x4085('0x16'),_0x48e523[_0x4085('0x12')]['pid']));}process[_0x4085('0x17')](_0x48e523[_0x4085('0x12')][_0x4085('0x18')],_0x4085('0x19'));return _0x942147[_0x4085('0x9')](0xc8)[_0x4085('0xc')]({'message':util[_0x4085('0x10')](_0x4085('0x1a'),_0x48e523[_0x4085('0x12')][_0x4085('0x18')])});})['catch'](handleError(_0x942147,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6d92112..5a9060f 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 _0x6b68=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','post','put','update','delete','/:id'];(function(_0x55ed81,_0x31b89b){var _0x4fbbc7=function(_0x4fb2a9){while(--_0x4fb2a9){_0x55ed81['push'](_0x55ed81['shift']());}};_0x4fbbc7(++_0x31b89b);}(_0x6b68,0x1ea));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x86b6('0x0'));var path=require(_0x86b6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x86b6('0x2')]();var fs_extra=require(_0x86b6('0x3'));var auth=require(_0x86b6('0x4'));var interaction=require(_0x86b6('0x5'));var config=require(_0x86b6('0x6'));var controller=require('./tag.controller');router['get']('/',auth[_0x86b6('0x7')](),controller['index']);router[_0x86b6('0x8')]('/:id',auth[_0x86b6('0x7')](),controller['show']);router[_0x86b6('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x86b6('0xa')]('/:id',auth[_0x86b6('0x7')](),controller[_0x86b6('0xb')]);router[_0x86b6('0xc')](_0x86b6('0xd'),auth[_0x86b6('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x71b0=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x53ec14,_0x1fd438){var _0x5b844c=function(_0x3036c2){while(--_0x3036c2){_0x53ec14['push'](_0x53ec14['shift']());}};_0x5b844c(++_0x1fd438);}(_0x71b0,0x1ba));var _0x071b=function(_0x29f1cc,_0x3fbd7b){_0x29f1cc=_0x29f1cc-0x0;var _0x5dc1d8=_0x71b0[_0x29f1cc];return _0x5dc1d8;};'use strict';var multer=require(_0x071b('0x0'));var util=require(_0x071b('0x1'));var path=require(_0x071b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x071b('0x3'));var auth=require(_0x071b('0x4'));var interaction=require(_0x071b('0x5'));var config=require(_0x071b('0x6'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x071b('0x7')]);router[_0x071b('0x8')]('/:id',auth[_0x071b('0x9')](),controller[_0x071b('0xa')]);router[_0x071b('0xb')]('/',auth[_0x071b('0x9')](),controller[_0x071b('0xc')]);router[_0x071b('0xd')](_0x071b('0xe'),auth[_0x071b('0x9')](),controller[_0x071b('0xf')]);router[_0x071b('0x10')]('/:id',auth[_0x071b('0x9')](),controller['destroy']);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 9ea9c28..17c62c3 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 _0x3266=['#0091EA','sequelize','exports','STRING','name'];(function(_0x73a2f6,_0x2f9681){var _0xf23f46=function(_0x3383de){while(--_0x3383de){_0x73a2f6['push'](_0x73a2f6['shift']());}};_0xf23f46(++_0x2f9681);}(_0x3266,0x6a));var _0x6326=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x3266[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6326('0x2')],'defaultValue':_0x6326('0x4')},'description':{'type':Sequelize[_0x6326('0x2')]}}; \ No newline at end of file +var _0xe9ad=['sequelize','exports','STRING','name','#0091EA'];(function(_0x35060d,_0x520ed8){var _0x522529=function(_0x351f97){while(--_0x351f97){_0x35060d['push'](_0x35060d['shift']());}};_0x522529(++_0x520ed8);}(_0xe9ad,0x82));var _0xde9a=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xe9ad[_0x269ee8];return _0x4d98bd;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'name':{'type':Sequelize[_0xde9a('0x2')],'unique':_0xde9a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':_0xde9a('0x4')},'description':{'type':Sequelize[_0xde9a('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f287273..fd73aae 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0x008c,0x188));var _0xc008=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x008c[_0x5d72da];return _0x43ebe7;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Tags';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['Tag'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['Tag'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['Tag'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Tags';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['Tag']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0xa75b=['rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','reject','then','destroy','get','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Tag'];(function(_0x288068,_0x4482a6){var _0x2d6918=function(_0x38da42){while(--_0x38da42){_0x288068['push'](_0x288068['shift']());}};_0x2d6918(++_0x4482a6);}(_0xa75b,0x170));var _0xba75=function(_0x33ebcf,_0x1ac085){_0x33ebcf=_0x33ebcf-0x0;var _0x36c222=_0xa75b[_0x33ebcf];return _0x36c222;};'use strict';var emlformat=require(_0xba75('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba75('0x1'));var rp=require(_0xba75('0x2'));var moment=require(_0xba75('0x3'));var BPromise=require(_0xba75('0x4'));var Mustache=require(_0xba75('0x5'));var util=require(_0xba75('0x6'));var path=require(_0xba75('0x7'));var sox=require(_0xba75('0x8'));var csv=require(_0xba75('0x9'));var ejs=require(_0xba75('0xa'));var fs=require('fs');var fs_extra=require(_0xba75('0xb'));var _=require(_0xba75('0xc'));var squel=require(_0xba75('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba75('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba75('0xf'));var Redis=require('ioredis');var authService=require(_0xba75('0x10'));var qs=require(_0xba75('0x11'));var as=require(_0xba75('0x12'));var hardwareService=require(_0xba75('0x13'));var logger=require(_0xba75('0x14'))(_0xba75('0x15'));var utils=require(_0xba75('0x16'));var config=require(_0xba75('0x17'));var licenseUtil=require(_0xba75('0x18'));var db=require(_0xba75('0x19'))['db'];function respondWithStatusCode(_0x8116d8,_0x1ed697){_0x1ed697=_0x1ed697||0xcc;return function(_0x50db90){if(_0x50db90){return _0x8116d8['sendStatus'](_0x1ed697);}return _0x8116d8[_0xba75('0x1a')](_0x1ed697)['end']();};}function respondWithResult(_0x2f141a,_0x2df615){_0x2df615=_0x2df615||0xc8;return function(_0xa27f76){if(_0xa27f76){return _0x2f141a[_0xba75('0x1a')](_0x2df615)['json'](_0xa27f76);}};}function respondWithFilteredResult(_0x31b3b3,_0x18bab2){return function(_0x256678){if(_0x256678){var _0x4028f9=typeof _0x18bab2[_0xba75('0x1b')]==='undefined'&&typeof _0x18bab2[_0xba75('0x1c')]===_0xba75('0x1d');var _0x14bd83=_0x256678['count'];var _0x2822af=_0x4028f9?0x0:_0x18bab2[_0xba75('0x1b')];var _0xc4bf17=_0x4028f9?_0x256678[_0xba75('0x1e')]:_0x18bab2[_0xba75('0x1b')]+_0x18bab2[_0xba75('0x1c')];var _0x5811cb;if(_0xc4bf17>=_0x14bd83){_0xc4bf17=_0x14bd83;_0x5811cb=0xc8;}else{_0x5811cb=0xce;}_0x31b3b3[_0xba75('0x1a')](_0x5811cb);return _0x31b3b3[_0xba75('0x1f')]('Content-Range',_0x2822af+'-'+_0xc4bf17+'/'+_0x14bd83)['json'](_0x256678);}return null;};}function patchUpdates(_0x35ffd2){return function(_0x31bc33){try{jsonpatch['apply'](_0x31bc33,_0x35ffd2,!![]);}catch(_0x48206c){return BPromise[_0xba75('0x20')](_0x48206c);}return _0x31bc33['save']();};}function saveUpdates(_0x1b8a36,_0x2ece41){return function(_0x19b2d7){if(_0x19b2d7){return _0x19b2d7['update'](_0x1b8a36)[_0xba75('0x21')](function(_0x221d5e){return _0x221d5e;});}return null;};}function removeEntity(_0x139fa4,_0x3e9bd9){return function(_0x14c54b){if(_0x14c54b){return _0x14c54b[_0xba75('0x22')]()['then'](function(){var _0x246c48=_0x14c54b[_0xba75('0x23')]({'plain':!![]});var _0xe579fb=_0xba75('0x24');return db[_0xba75('0x25')][_0xba75('0x22')]({'where':{'type':_0xe579fb,'resourceId':_0x246c48['id']}})[_0xba75('0x21')](function(){return _0x14c54b;});})[_0xba75('0x21')](function(){_0x139fa4[_0xba75('0x1a')](0xcc)[_0xba75('0x26')]();});}};}function handleEntityNotFound(_0x47ddff,_0x4c8d02){return function(_0x4e1987){if(!_0x4e1987){_0x47ddff[_0xba75('0x27')](0x194);}return _0x4e1987;};}function handleError(_0x4856be,_0x42cefb){_0x42cefb=_0x42cefb||0x1f4;return function(_0x58ea2d){logger[_0xba75('0x28')](_0x58ea2d[_0xba75('0x29')]);if(_0x58ea2d[_0xba75('0x2a')]){delete _0x58ea2d['name'];}_0x4856be[_0xba75('0x1a')](_0x42cefb)[_0xba75('0x2b')](_0x58ea2d);};}exports[_0xba75('0x2c')]=function(_0x2808f0,_0x5d9f78){var _0x4791a5={},_0x200715={},_0x481a04={'count':0x0,'rows':[]};var _0x5a85ee=_[_0xba75('0x2d')](db[_0xba75('0x2e')][_0xba75('0x2f')],function(_0x4b4d69){return{'name':_0x4b4d69[_0xba75('0x30')],'type':_0x4b4d69[_0xba75('0x31')]['key']};});_0x200715[_0xba75('0x32')]=_[_0xba75('0x2d')](_0x5a85ee,_0xba75('0x2a'));_0x200715[_0xba75('0x33')]=_['keys'](_0x2808f0[_0xba75('0x33')]);_0x200715[_0xba75('0x34')]=_['intersection'](_0x200715[_0xba75('0x32')],_0x200715[_0xba75('0x33')]);_0x4791a5[_0xba75('0x35')]=_['intersection'](_0x200715[_0xba75('0x32')],qs[_0xba75('0x36')](_0x2808f0[_0xba75('0x33')][_0xba75('0x36')]));_0x4791a5[_0xba75('0x35')]=_0x4791a5[_0xba75('0x35')][_0xba75('0x37')]?_0x4791a5['attributes']:_0x200715['model'];if(!_0x2808f0[_0xba75('0x33')][_0xba75('0x38')](_0xba75('0x39'))){_0x4791a5['limit']=qs[_0xba75('0x1c')](_0x2808f0[_0xba75('0x33')]['limit']);_0x4791a5['offset']=qs[_0xba75('0x1b')](_0x2808f0[_0xba75('0x33')][_0xba75('0x1b')]);}_0x4791a5[_0xba75('0x3a')]=qs[_0xba75('0x3b')](_0x2808f0['query']['sort']);_0x4791a5[_0xba75('0x3c')]=qs[_0xba75('0x34')](_[_0xba75('0x3d')](_0x2808f0[_0xba75('0x33')],_0x200715[_0xba75('0x34')]),_0x5a85ee);if(_0x2808f0[_0xba75('0x33')][_0xba75('0x3e')]){_0x4791a5['where']=_[_0xba75('0x3f')](_0x4791a5[_0xba75('0x3c')],{'$or':_['map'](_0x5a85ee,function(_0x1f28e8){if(_0x1f28e8[_0xba75('0x31')]!==_0xba75('0x40')){var _0x45d8cd={};_0x45d8cd[_0x1f28e8[_0xba75('0x2a')]]={'$like':'%'+_0x2808f0[_0xba75('0x33')][_0xba75('0x3e')]+'%'};return _0x45d8cd;}})});}_0x4791a5=_['merge']({},_0x4791a5,_0x2808f0[_0xba75('0x41')]);var _0x59d005={'where':_0x4791a5[_0xba75('0x3c')]};return db['Tag'][_0xba75('0x1e')](_0x59d005)[_0xba75('0x21')](function(_0x9c32ad){_0x481a04[_0xba75('0x1e')]=_0x9c32ad;if(_0x2808f0[_0xba75('0x33')][_0xba75('0x42')]){_0x4791a5[_0xba75('0x43')]=[{'all':!![]}];}return db[_0xba75('0x2e')][_0xba75('0x44')](_0x4791a5);})['then'](function(_0x30b5f0){_0x481a04[_0xba75('0x45')]=_0x30b5f0;return _0x481a04;})['then'](respondWithFilteredResult(_0x5d9f78,_0x4791a5))[_0xba75('0x46')](handleError(_0x5d9f78,null));};exports[_0xba75('0x47')]=function(_0x1130ac,_0x5bf935){var _0x5043a5={'raw':!![],'where':{'id':_0x1130ac['params']['id']}},_0x5c6491={};_0x5c6491[_0xba75('0x32')]=_['keys'](db[_0xba75('0x2e')][_0xba75('0x2f')]);_0x5c6491[_0xba75('0x33')]=_[_0xba75('0x48')](_0x1130ac[_0xba75('0x33')]);_0x5c6491['filters']=_['intersection'](_0x5c6491[_0xba75('0x32')],_0x5c6491['query']);_0x5043a5[_0xba75('0x35')]=_['intersection'](_0x5c6491[_0xba75('0x32')],qs[_0xba75('0x36')](_0x1130ac[_0xba75('0x33')][_0xba75('0x36')]));_0x5043a5['attributes']=_0x5043a5[_0xba75('0x35')][_0xba75('0x37')]?_0x5043a5[_0xba75('0x35')]:_0x5c6491[_0xba75('0x32')];if(_0x1130ac[_0xba75('0x33')][_0xba75('0x42')]){_0x5043a5[_0xba75('0x43')]=[{'all':!![]}];}_0x5043a5=_[_0xba75('0x3f')]({},_0x5043a5,_0x1130ac['options']);return db[_0xba75('0x2e')][_0xba75('0x49')](_0x5043a5)[_0xba75('0x21')](handleEntityNotFound(_0x5bf935,null))[_0xba75('0x21')](respondWithResult(_0x5bf935,null))[_0xba75('0x46')](handleError(_0x5bf935,null));};exports['create']=function(_0x2a1f84,_0x25ae33){return db[_0xba75('0x2e')][_0xba75('0x4a')](_0x2a1f84[_0xba75('0x4b')],{})[_0xba75('0x21')](function(_0x2c9085){var _0x5dc5f8=_0x2a1f84[_0xba75('0x4c')][_0xba75('0x23')]({'plain':!![]});if(!_0x5dc5f8)throw new Error(_0xba75('0x4d'));if(_0x5dc5f8['role']===_0xba75('0x4c')){var _0x29b4fc=_0x2c9085['get']({'plain':!![]});var _0x4d7e7e=_0xba75('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x4d7e7e,'userProfileId':_0x5dc5f8[_0xba75('0x4e')]},'raw':!![]})['then'](function(_0xbb87b9){if(_0xbb87b9&&_0xbb87b9[_0xba75('0x4f')]===0x0){return db[_0xba75('0x25')][_0xba75('0x4a')]({'name':_0x29b4fc[_0xba75('0x2a')],'resourceId':_0x29b4fc['id'],'type':_0xbb87b9['name'],'sectionId':_0xbb87b9['id']},{})[_0xba75('0x21')](function(){return _0x2c9085;});}else{return _0x2c9085;}})[_0xba75('0x46')](function(_0x57aaa6){logger[_0xba75('0x28')](_0xba75('0x50'),_0x57aaa6);throw _0x57aaa6;});}return _0x2c9085;})[_0xba75('0x21')](respondWithResult(_0x25ae33,0xc9))[_0xba75('0x46')](handleError(_0x25ae33,null));};exports[_0xba75('0x51')]=function(_0x52b2c9,_0x43f4b7){if(_0x52b2c9[_0xba75('0x4b')]['id']){delete _0x52b2c9['body']['id'];}return db[_0xba75('0x2e')][_0xba75('0x49')]({'where':{'id':_0x52b2c9[_0xba75('0x52')]['id']}})[_0xba75('0x21')](handleEntityNotFound(_0x43f4b7,null))[_0xba75('0x21')](saveUpdates(_0x52b2c9[_0xba75('0x4b')],null))['then'](respondWithResult(_0x43f4b7,null))[_0xba75('0x46')](handleError(_0x43f4b7,null));};exports[_0xba75('0x22')]=function(_0x361efb,_0x429e26){return db[_0xba75('0x2e')][_0xba75('0x49')]({'where':{'id':_0x361efb['params']['id']}})['then'](handleEntityNotFound(_0x429e26,null))['then'](removeEntity(_0x429e26,null))['catch'](handleError(_0x429e26,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 76aa2e9..b135d2a 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 _0x4ecf=['lodash','util','api','request-promise','path','../../config/environment','./tag.attributes','define','Tag','tools_tags'];(function(_0x4df04b,_0x52b8cb){var _0x5ce10e=function(_0x1dd148){while(--_0x1dd148){_0x4df04b['push'](_0x4df04b['shift']());}};_0x5ce10e(++_0x52b8cb);}(_0x4ecf,0x186));var _0xf4ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4ecf[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf4ec('0x0'));var util=require(_0xf4ec('0x1'));var logger=require('../../config/logger')(_0xf4ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf4ec('0x3'));var fs=require('fs');var path=require(_0xf4ec('0x4'));var rimraf=require('rimraf');var config=require(_0xf4ec('0x5'));var attributes=require(_0xf4ec('0x6'));module['exports']=function(_0x124633,_0x50aa86){return _0x124633[_0xf4ec('0x7')](_0xf4ec('0x8'),attributes,{'tableName':_0xf4ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebf0=['path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util','../../config/logger','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xebf0,0x11c));var _0x0ebf=function(_0x49950d,_0x20288c){_0x49950d=_0x49950d-0x0;var _0x5df41d=_0xebf0[_0x49950d];return _0x5df41d;};'use strict';var _=require('lodash');var util=require(_0x0ebf('0x0'));var logger=require(_0x0ebf('0x1'))('api');var moment=require(_0x0ebf('0x2'));var BPromise=require(_0x0ebf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ebf('0x4'));var rimraf=require(_0x0ebf('0x5'));var config=require(_0x0ebf('0x6'));var attributes=require(_0x0ebf('0x7'));module[_0x0ebf('0x8')]=function(_0x1d0104,_0x10e0c9){return _0x1d0104[_0x0ebf('0x9')](_0x0ebf('0xa'),attributes,{'tableName':_0x0ebf('0xb'),'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 0d9d3ab..8c96858 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 _0x0ba7=['client','http','request','then','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x0ba7,0x16d));var _0x70ba=function(_0x565580,_0x4f9375){_0x565580=_0x565580-0x0;var _0x4a166d=_0x0ba7[_0x565580];return _0x4a166d;};'use strict';var _=require(_0x70ba('0x0'));var util=require('util');var moment=require(_0x70ba('0x1'));var BPromise=require(_0x70ba('0x2'));var rs=require(_0x70ba('0x3'));var fs=require('fs');var Redis=require(_0x70ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ba('0x5'));var logger=require(_0x70ba('0x6'))(_0x70ba('0x7'));var config=require(_0x70ba('0x8'));var jayson=require(_0x70ba('0x9'));var client=jayson[_0x70ba('0xa')][_0x70ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d5a16,_0x240696,_0x1185cb){return new BPromise(function(_0x1a968b,_0x41cd10){return client[_0x70ba('0xc')](_0x2d5a16,_0x1185cb)[_0x70ba('0xd')](function(_0x465b7c){logger['info'](_0x70ba('0xe'),_0x240696,'request\x20sent');logger[_0x70ba('0xf')](_0x70ba('0x10'),_0x240696,_0x70ba('0x11'),JSON[_0x70ba('0x12')](_0x465b7c));if(_0x465b7c['error']){if(_0x465b7c['error'][_0x70ba('0x13')]===0x1f4){logger['error'](_0x70ba('0xe'),_0x240696,_0x465b7c['error'][_0x70ba('0x14')]);return _0x41cd10(_0x465b7c[_0x70ba('0x15')]['message']);}logger[_0x70ba('0x15')]('Tag,\x20%s,\x20%s',_0x240696,_0x465b7c[_0x70ba('0x15')][_0x70ba('0x14')]);return _0x1a968b(_0x465b7c[_0x70ba('0x15')][_0x70ba('0x14')]);}else{logger[_0x70ba('0x16')](_0x70ba('0xe'),_0x240696,_0x70ba('0x11'));_0x1a968b(_0x465b7c[_0x70ba('0x17')][_0x70ba('0x14')]);}})[_0x70ba('0x18')](function(_0x30ac22){logger[_0x70ba('0x15')](_0x70ba('0xe'),_0x240696,_0x30ac22);_0x41cd10(_0x30ac22);});});} \ No newline at end of file +var _0x7341=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x298e9,_0x436896){var _0x4cf7e=function(_0x4b749d){while(--_0x4b749d){_0x298e9['push'](_0x298e9['shift']());}};_0x4cf7e(++_0x436896);}(_0x7341,0xe4));var _0x1734=function(_0x42e261,_0x3c133a){_0x42e261=_0x42e261-0x0;var _0x2af091=_0x7341[_0x42e261];return _0x2af091;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('Tag,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 85b0d16..ce36eac 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 4a1060c..bf0bf87 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(_0x1499dc,_0x457597){var _0x116878=function(_0x33d535){while(--_0x33d535){_0x1499dc['push'](_0x1499dc['shift']());}};_0x116878(++_0x457597);}(_0xb10b,0x12a));var _0xbb10=function(_0x475191,_0x5bce86){_0x475191=_0x475191-0x0;var _0x189e96=_0xb10b[_0x475191];return _0x189e96;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 5bc09e1..c68c7ee 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 _0xe1c7=['SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','addQueues','Queues','removeQueues','remove','ids','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','interface','format','SIP/%s','all','addAgents','spread','removeAgents','isArray','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','error','name','send','index','Team','rawAttributes','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','then','includeAll','include','findAll','rows','catch','show','find','create','user','get','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','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','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue'];(function(_0x3223c5,_0xdc8557){var _0x4d062b=function(_0xcdda77){while(--_0xcdda77){_0x3223c5['push'](_0x3223c5['shift']());}};_0x4d062b(++_0xdc8557);}(_0xe1c7,0x16e));var _0x7e1c=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xe1c7[_0x1f6f84];return _0x177f40;};'use strict';var emlformat=require(_0x7e1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e1c('0x1'));var jsonpatch=require(_0x7e1c('0x2'));var rp=require(_0x7e1c('0x3'));var moment=require(_0x7e1c('0x4'));var BPromise=require(_0x7e1c('0x5'));var Mustache=require(_0x7e1c('0x6'));var util=require('util');var path=require(_0x7e1c('0x7'));var sox=require(_0x7e1c('0x8'));var csv=require(_0x7e1c('0x9'));var ejs=require(_0x7e1c('0xa'));var fs=require('fs');var fs_extra=require(_0x7e1c('0xb'));var _=require('lodash');var squel=require(_0x7e1c('0xc'));var crypto=require(_0x7e1c('0xd'));var jsforce=require(_0x7e1c('0xe'));var deskjs=require(_0x7e1c('0xf'));var toCsv=require(_0x7e1c('0x9'));var querystring=require(_0x7e1c('0x10'));var Papa=require(_0x7e1c('0x11'));var Redis=require('ioredis');var authService=require(_0x7e1c('0x12'));var qs=require(_0x7e1c('0x13'));var as=require(_0x7e1c('0x14'));var hardwareService=require(_0x7e1c('0x15'));var logger=require(_0x7e1c('0x16'))(_0x7e1c('0x17'));var utils=require(_0x7e1c('0x18'));var config=require(_0x7e1c('0x19'));var licenseUtil=require(_0x7e1c('0x1a'));var db=require(_0x7e1c('0x1b'))['db'];config[_0x7e1c('0x1c')]=_[_0x7e1c('0x1d')](config[_0x7e1c('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e1c('0x1e'))(new Redis(config[_0x7e1c('0x1c')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x4fd033,_0x1f3cd8){_0x1f3cd8=_0x1f3cd8||0xcc;return function(_0x4b4eae){if(_0x4b4eae){return _0x4fd033['sendStatus'](_0x1f3cd8);}return _0x4fd033[_0x7e1c('0x1f')](_0x1f3cd8)[_0x7e1c('0x20')]();};}function respondWithResult(_0x305c89,_0xee8a3d){_0xee8a3d=_0xee8a3d||0xc8;return function(_0x3fd022){if(_0x3fd022){return _0x305c89['status'](_0xee8a3d)[_0x7e1c('0x21')](_0x3fd022);}};}function respondWithFilteredResult(_0x46d241,_0x4ea4f2){return function(_0xaccbfa){if(_0xaccbfa){var _0x36b64d=typeof _0x4ea4f2['offset']==='undefined'&&typeof _0x4ea4f2[_0x7e1c('0x22')]===_0x7e1c('0x23');var _0x510054=_0xaccbfa[_0x7e1c('0x24')];var _0x3fe459=_0x36b64d?0x0:_0x4ea4f2[_0x7e1c('0x25')];var _0x5f1ab8=_0x36b64d?_0xaccbfa[_0x7e1c('0x24')]:_0x4ea4f2[_0x7e1c('0x25')]+_0x4ea4f2[_0x7e1c('0x22')];var _0x50b183;if(_0x5f1ab8>=_0x510054){_0x5f1ab8=_0x510054;_0x50b183=0xc8;}else{_0x50b183=0xce;}_0x46d241[_0x7e1c('0x1f')](_0x50b183);return _0x46d241[_0x7e1c('0x26')](_0x7e1c('0x27'),_0x3fe459+'-'+_0x5f1ab8+'/'+_0x510054)[_0x7e1c('0x21')](_0xaccbfa);}return null;};}function patchUpdates(_0x3f7ed1){return function(_0x18f545){try{jsonpatch['apply'](_0x18f545,_0x3f7ed1,!![]);}catch(_0x324576){return BPromise[_0x7e1c('0x28')](_0x324576);}return _0x18f545['save']();};}function saveUpdates(_0x235cdd,_0x498aa7){return function(_0x173280){if(_0x173280){return _0x173280[_0x7e1c('0x29')](_0x235cdd)['then'](function(_0x40351b){return _0x40351b;});}return null;};}function handleEntityNotFound(_0x22000f,_0x7882a5){return function(_0x8c8c56){if(!_0x8c8c56){_0x22000f['sendStatus'](0x194);}return _0x8c8c56;};}function handleError(_0x52444b,_0x375b5e){_0x375b5e=_0x375b5e||0x1f4;return function(_0x1457ef){logger[_0x7e1c('0x2a')](_0x1457ef['stack']);if(_0x1457ef[_0x7e1c('0x2b')]){delete _0x1457ef['name'];}_0x52444b[_0x7e1c('0x1f')](_0x375b5e)[_0x7e1c('0x2c')](_0x1457ef);};}exports[_0x7e1c('0x2d')]=function(_0x3a1ec6,_0x4bcc16){var _0x527413={},_0x1cc9ab={},_0xa6c5c2={'count':0x0,'rows':[]};var _0x780eeb=_['map'](db[_0x7e1c('0x2e')][_0x7e1c('0x2f')],function(_0x141f10){return{'name':_0x141f10['fieldName'],'type':_0x141f10[_0x7e1c('0x30')][_0x7e1c('0x31')]};});_0x1cc9ab['model']=_[_0x7e1c('0x32')](_0x780eeb,_0x7e1c('0x2b'));_0x1cc9ab['query']=_[_0x7e1c('0x33')](_0x3a1ec6[_0x7e1c('0x34')]);_0x1cc9ab[_0x7e1c('0x35')]=_[_0x7e1c('0x36')](_0x1cc9ab[_0x7e1c('0x37')],_0x1cc9ab[_0x7e1c('0x34')]);_0x527413[_0x7e1c('0x38')]=_['intersection'](_0x1cc9ab[_0x7e1c('0x37')],qs[_0x7e1c('0x39')](_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x39')]));_0x527413[_0x7e1c('0x38')]=_0x527413[_0x7e1c('0x38')][_0x7e1c('0x3a')]?_0x527413[_0x7e1c('0x38')]:_0x1cc9ab[_0x7e1c('0x37')];if(!_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x3b')]('nolimit')){_0x527413['limit']=qs[_0x7e1c('0x22')](_0x3a1ec6['query'][_0x7e1c('0x22')]);_0x527413[_0x7e1c('0x25')]=qs[_0x7e1c('0x25')](_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x25')]);}_0x527413[_0x7e1c('0x3c')]=qs['sort'](_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x3d')]);_0x527413['where']=qs[_0x7e1c('0x35')](_[_0x7e1c('0x3e')](_0x3a1ec6[_0x7e1c('0x34')],_0x1cc9ab['filters']),_0x780eeb);if(_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x3f')]){_0x527413[_0x7e1c('0x40')]=_['merge'](_0x527413[_0x7e1c('0x40')],{'$or':_[_0x7e1c('0x32')](_0x780eeb,function(_0x2d2c4d){if(_0x2d2c4d['type']!=='VIRTUAL'){var _0x4f80e7={};_0x4f80e7[_0x2d2c4d[_0x7e1c('0x2b')]]={'$like':'%'+_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x3f')]+'%'};return _0x4f80e7;}})});}_0x527413=_[_0x7e1c('0x41')]({},_0x527413,_0x3a1ec6[_0x7e1c('0x42')]);var _0x630d25={'where':_0x527413['where']};return db[_0x7e1c('0x2e')][_0x7e1c('0x24')](_0x630d25)[_0x7e1c('0x43')](function(_0x27237b){_0xa6c5c2[_0x7e1c('0x24')]=_0x27237b;if(_0x3a1ec6[_0x7e1c('0x34')][_0x7e1c('0x44')]){_0x527413[_0x7e1c('0x45')]=[{'all':!![]}];}return db[_0x7e1c('0x2e')][_0x7e1c('0x46')](_0x527413);})[_0x7e1c('0x43')](function(_0x3eb9e2){_0xa6c5c2[_0x7e1c('0x47')]=_0x3eb9e2;return _0xa6c5c2;})[_0x7e1c('0x43')](respondWithFilteredResult(_0x4bcc16,_0x527413))[_0x7e1c('0x48')](handleError(_0x4bcc16,null));};exports[_0x7e1c('0x49')]=function(_0x2f216e,_0x43ab59){var _0x3c7984={'raw':![],'where':{'id':_0x2f216e['params']['id']}},_0x1e4282={};_0x1e4282[_0x7e1c('0x37')]=_['keys'](db[_0x7e1c('0x2e')][_0x7e1c('0x2f')]);_0x1e4282[_0x7e1c('0x34')]=_['keys'](_0x2f216e[_0x7e1c('0x34')]);_0x1e4282['filters']=_[_0x7e1c('0x36')](_0x1e4282[_0x7e1c('0x37')],_0x1e4282[_0x7e1c('0x34')]);_0x3c7984[_0x7e1c('0x38')]=_[_0x7e1c('0x36')](_0x1e4282[_0x7e1c('0x37')],qs[_0x7e1c('0x39')](_0x2f216e[_0x7e1c('0x34')]['fields']));_0x3c7984[_0x7e1c('0x38')]=_0x3c7984['attributes']['length']?_0x3c7984[_0x7e1c('0x38')]:_0x1e4282['model'];if(_0x2f216e[_0x7e1c('0x34')][_0x7e1c('0x44')]){_0x3c7984[_0x7e1c('0x45')]=[{'all':!![]}];}_0x3c7984=_[_0x7e1c('0x41')]({},_0x3c7984,_0x2f216e[_0x7e1c('0x42')]);return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')](_0x3c7984)[_0x7e1c('0x43')](handleEntityNotFound(_0x43ab59,null))[_0x7e1c('0x43')](respondWithResult(_0x43ab59,null))[_0x7e1c('0x48')](handleError(_0x43ab59,null));};exports[_0x7e1c('0x4b')]=function(_0x5e4234,_0x137fee){return db['Team']['create'](_0x5e4234['body'],{})[_0x7e1c('0x43')](function(_0x51564a){var _0x1474d0=_0x5e4234[_0x7e1c('0x4c')][_0x7e1c('0x4d')]({'plain':!![]});if(!_0x1474d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1474d0[_0x7e1c('0x4e')]===_0x7e1c('0x4c')){var _0x56b9f0=_0x51564a[_0x7e1c('0x4d')]({'plain':!![]});var _0x2d8180=_0x7e1c('0x4f');return db[_0x7e1c('0x50')]['find']({'where':{'name':_0x2d8180,'userProfileId':_0x1474d0[_0x7e1c('0x51')]},'raw':!![]})[_0x7e1c('0x43')](function(_0x462bb8){if(_0x462bb8&&_0x462bb8[_0x7e1c('0x52')]===0x0){return db[_0x7e1c('0x53')][_0x7e1c('0x4b')]({'name':_0x56b9f0['name'],'resourceId':_0x56b9f0['id'],'type':_0x462bb8[_0x7e1c('0x2b')],'sectionId':_0x462bb8['id']},{})[_0x7e1c('0x43')](function(){return _0x51564a;});}else{return _0x51564a;}})[_0x7e1c('0x48')](function(_0x368dc9){logger[_0x7e1c('0x2a')](_0x7e1c('0x54'),_0x368dc9);throw _0x368dc9;});}return _0x51564a;})['then'](respondWithResult(_0x137fee,0xc9))[_0x7e1c('0x48')](handleError(_0x137fee,null));};exports[_0x7e1c('0x29')]=function(_0x9824d2,_0x562595){if(_0x9824d2[_0x7e1c('0x55')]['id']){delete _0x9824d2[_0x7e1c('0x55')]['id'];}return db['Team'][_0x7e1c('0x4a')]({'where':{'id':_0x9824d2['params']['id']}})[_0x7e1c('0x43')](handleEntityNotFound(_0x562595,null))[_0x7e1c('0x43')](saveUpdates(_0x9824d2['body'],null))['then'](respondWithResult(_0x562595,null))[_0x7e1c('0x48')](handleError(_0x562595,null));};exports[_0x7e1c('0x56')]=function(_0x28c442,_0x581a1a){var _0xa73d45=_0x28c442[_0x7e1c('0x57')]['id'];var _0x3f7cb5=[];return db[_0x7e1c('0x58')][_0x7e1c('0x59')](function(_0x432c7b){var _0x3e459e=_0x7e1c('0x5a')+_0xa73d45;return db[_0x7e1c('0x58')][_0x7e1c('0x34')](_0x3e459e,{'type':db['Sequelize'][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b})[_0x7e1c('0x43')](function(_0x55c262){_0x3f7cb5=_[_0x7e1c('0x32')](_0x55c262,function(_0x4c5bab){return Number(_0x4c5bab[_0x7e1c('0x5c')]);});})[_0x7e1c('0x43')](function(){var _0x397b29=_0x7e1c('0x5d')+_0xa73d45;return db[_0x7e1c('0x58')][_0x7e1c('0x34')](_0x397b29,{'type':db[_0x7e1c('0x5e')]['QueryTypes'][_0x7e1c('0x5f')],'raw':!![],'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(_0x488cc){var _0x55906e=_['map'](_0x488cc,function(_0x55a902){return Number(_0x55a902[_0x7e1c('0x60')]);});return db[_0x7e1c('0x61')]['destroy']({'where':{'UserId':{'$in':_0x3f7cb5},'VoiceQueueId':{'$in':_0x55906e}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){var _0x18559e=_0x7e1c('0x62')+_0xa73d45;return db['sequelize'][_0x7e1c('0x34')](_0x18559e,{'type':db['Sequelize'][_0x7e1c('0x5b')][_0x7e1c('0x5f')],'raw':!![],'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(_0x58e241){var _0x296825=_['map'](_0x58e241,function(_0x10d511){return Number(_0x10d511['MailQueueId']);});return db[_0x7e1c('0x63')][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'MailQueueId':{'$in':_0x296825}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){var _0x4ea10e=_0x7e1c('0x64')+_0xa73d45;return db[_0x7e1c('0x58')][_0x7e1c('0x34')](_0x4ea10e,{'type':db[_0x7e1c('0x5e')][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(_0x4cfde3){var _0x1fa4a8=_[_0x7e1c('0x32')](_0x4cfde3,function(_0xe6b6e){return Number(_0xe6b6e[_0x7e1c('0x65')]);});return db['UserSmsQueue'][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'SmsQueueId':{'$in':_0x1fa4a8}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){var _0x9776e7='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa73d45;return db[_0x7e1c('0x58')]['query'](_0x9776e7,{'type':db['Sequelize'][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b});})['then'](function(_0x3d23ab){var _0x1e3526=_[_0x7e1c('0x32')](_0x3d23ab,function(_0x10ef1c){return Number(_0x10ef1c['ChatQueueId']);});return db[_0x7e1c('0x66')][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'ChatQueueId':{'$in':_0x1e3526}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){var _0x4356e4=_0x7e1c('0x67')+_0xa73d45;return db[_0x7e1c('0x58')]['query'](_0x4356e4,{'type':db[_0x7e1c('0x5e')][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b});})['then'](function(_0xda63b3){var _0x5e7db4=_['map'](_0xda63b3,function(_0x5d4bc1){return Number(_0x5d4bc1[_0x7e1c('0x68')]);});return db['UserFaxQueue'][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'FaxQueueId':{'$in':_0x5e7db4}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){var _0x480399=_0x7e1c('0x69')+_0xa73d45;return db[_0x7e1c('0x58')][_0x7e1c('0x34')](_0x480399,{'type':db[_0x7e1c('0x5e')][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b});})['then'](function(_0x6067d8){var _0x302c67=_[_0x7e1c('0x32')](_0x6067d8,function(_0x22862a){return Number(_0x22862a[_0x7e1c('0x6a')]);});return db[_0x7e1c('0x6b')][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'OpenchannelQueueId':{'$in':_0x302c67}},'transaction':_0x432c7b});})['then'](function(){var _0x3f0335=_0x7e1c('0x6c')+_0xa73d45;return db[_0x7e1c('0x58')][_0x7e1c('0x34')](_0x3f0335,{'type':db[_0x7e1c('0x5e')][_0x7e1c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(_0x5a89b2){var _0x1cfb40=_[_0x7e1c('0x32')](_0x5a89b2,function(_0x3ddadd){return Number(_0x3ddadd[_0x7e1c('0x6d')]);});return db[_0x7e1c('0x6e')][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'WhatsappQueueId':{'$in':_0x1cfb40}},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){return db[_0x7e1c('0x6f')]['find']({'where':{'TeamId':_0xa73d45}});})[_0x7e1c('0x43')](function(_0x38a48e){if(_0x38a48e===null){return;}return db[_0x7e1c('0x70')][_0x7e1c('0x56')]({'where':{'UserId':{'$in':_0x3f7cb5},'VoicePrefixId':_0x38a48e[_0x7e1c('0x71')]},'transaction':_0x432c7b});})[_0x7e1c('0x43')](function(){return db[_0x7e1c('0x2e')][_0x7e1c('0x56')]({'where':{'id':_0xa73d45},'cascade':!![],'transaction':_0x432c7b});})['then'](function(_0x3031bd){if(_0x3031bd===0x0){_0x581a1a[_0x7e1c('0x72')](0x194);}else{return db[_0x7e1c('0x53')][_0x7e1c('0x56')]({'where':{'type':_0x7e1c('0x4f'),'resourceId':_0xa73d45},'cascade':!![],'transaction':_0x432c7b})[_0x7e1c('0x43')](function(){_0x581a1a[_0x7e1c('0x1f')](0xcc)[_0x7e1c('0x20')]();});}})['catch'](function(_0x57c36b){_0x581a1a[_0x7e1c('0x1f')](0x1f4)[_0x7e1c('0x2c')](_0x57c36b);});});};exports[_0x7e1c('0x73')]=function(_0xf1873,_0x3dd3f6,_0x3c6b72){return db['Team'][_0x7e1c('0x74')]({'where':{'id':_0xf1873[_0x7e1c('0x57')]['id']}})[_0x7e1c('0x43')](handleEntityNotFound(_0x3dd3f6,null))['then'](function(_0x53f53e){if(!_0xf1873[_0x7e1c('0x34')]['channel']||!utils[_0x7e1c('0x75')](_0xf1873[_0x7e1c('0x34')][_0x7e1c('0x76')])){throw new db[(_0x7e1c('0x5e'))][(_0x7e1c('0x77'))](_0x7e1c('0x78'));}var _0x3c3026={};var _0x2e2644={};_0x2e2644[_0x7e1c('0x37')]=_['keys'](db[_[_0x7e1c('0x79')](_0xf1873[_0x7e1c('0x34')][_0x7e1c('0x76')]['toLowerCase']())+'Queue'][_0x7e1c('0x2f')]);_0x2e2644[_0x7e1c('0x34')]=_[_0x7e1c('0x33')](_0xf1873[_0x7e1c('0x34')]);_0x2e2644[_0x7e1c('0x35')]=_['intersection'](_0x2e2644['model'],_0x2e2644[_0x7e1c('0x34')]);_0x3c3026[_0x7e1c('0x38')]=_[_0x7e1c('0x36')](_0x2e2644['model'],qs[_0x7e1c('0x39')](_0xf1873[_0x7e1c('0x34')][_0x7e1c('0x39')]));_0x3c3026[_0x7e1c('0x38')]=_0x3c3026[_0x7e1c('0x38')][_0x7e1c('0x3a')]?_0x3c3026[_0x7e1c('0x38')]:_0x2e2644['model'];_0x3c3026[_0x7e1c('0x22')]=qs[_0x7e1c('0x22')](_0xf1873['query']['limit']);_0x3c3026[_0x7e1c('0x25')]=qs[_0x7e1c('0x25')](_0xf1873[_0x7e1c('0x34')][_0x7e1c('0x25')]);_0x3c3026[_0x7e1c('0x3c')]=qs[_0x7e1c('0x3d')](_0xf1873[_0x7e1c('0x34')][_0x7e1c('0x3d')]);_0x3c3026[_0x7e1c('0x40')]=qs['filters'](_[_0x7e1c('0x3e')](_0xf1873[_0x7e1c('0x34')],_0x2e2644['filters']));_0x3c3026=_[_0x7e1c('0x41')]({},_0x3c3026,_0xf1873[_0x7e1c('0x42')]);return _0x53f53e['get'+_[_0x7e1c('0x79')](_0xf1873['query'][_0x7e1c('0x76')][_0x7e1c('0x7a')]())+'Queues'](_0x3c3026);})[_0x7e1c('0x43')](respondWithResult(_0x3dd3f6,null))['catch'](handleError(_0x3dd3f6,null));};exports[_0x7e1c('0x7b')]=function(_0x1e6307,_0x3df652,_0x262cf0){return db[_0x7e1c('0x2e')][_0x7e1c('0x74')]({'where':{'id':_0x1e6307[_0x7e1c('0x57')]['id']}})['then'](function(_0x4b4057){if(_0x4b4057){if(!_0x1e6307[_0x7e1c('0x55')]['channel']||!utils[_0x7e1c('0x75')](_0x1e6307[_0x7e1c('0x55')][_0x7e1c('0x76')])){throw new db[(_0x7e1c('0x5e'))][(_0x7e1c('0x77'))](_0x7e1c('0x78'));}return _0x4b4057['add'+_[_0x7e1c('0x79')](_0x1e6307['body'][_0x7e1c('0x76')][_0x7e1c('0x7a')]())+_0x7e1c('0x7c')](_0x1e6307[_0x7e1c('0x55')]['ids']);}return null;})[_0x7e1c('0x43')](handleEntityNotFound(_0x3df652,null))['then'](respondWithStatusCode(_0x3df652,null))[_0x7e1c('0x48')](handleError(_0x3df652,null));};exports[_0x7e1c('0x7d')]=function(_0x3c2040,_0x12f357,_0x1782fa){return db['Team'][_0x7e1c('0x74')]({'where':{'id':_0x3c2040[_0x7e1c('0x57')]['id']}})['then'](function(_0x17fbb1){if(_0x17fbb1){if(!_0x3c2040[_0x7e1c('0x34')]['channel']||!utils['isValidChannel'](_0x3c2040['query'][_0x7e1c('0x76')])){throw new db['Sequelize'][(_0x7e1c('0x77'))]('Unknown\x20channel');}return _0x17fbb1[_0x7e1c('0x7e')+_[_0x7e1c('0x79')](_0x3c2040[_0x7e1c('0x34')]['channel'][_0x7e1c('0x7a')]())+_0x7e1c('0x7c')](_0x3c2040[_0x7e1c('0x34')]['ids']);}return null;})[_0x7e1c('0x43')](handleEntityNotFound(_0x12f357,null))[_0x7e1c('0x43')](respondWithStatusCode(_0x12f357,null))[_0x7e1c('0x48')](handleError(_0x12f357,null));};exports['addAgents']=function(_0x195872,_0x28e150){var _0x38f97a=_['isArray'](_0x195872['body'][_0x7e1c('0x7f')])?_0x195872[_0x7e1c('0x55')][_0x7e1c('0x7f')]:[_0x195872[_0x7e1c('0x55')]['ids']];var _0x45cb31=_0x195872['params']['id'];return db[_0x7e1c('0x2e')]['find']({'where':{'id':_0x45cb31}})['then'](handleEntityNotFound(_0x28e150,null))[_0x7e1c('0x43')](function(_0x2a4e93){if(_0x2a4e93){var _0x55bbac=[_0x7e1c('0x80'),_0x7e1c('0x81'),_0x7e1c('0x82'),_0x7e1c('0x83'),_0x7e1c('0x84'),_0x7e1c('0x85'),_0x7e1c('0x86')];return db['sequelize'][_0x7e1c('0x59')](function(_0x30c1fd){var _0x2a3019=_[_0x7e1c('0x32')](_0x55bbac,function(_0x335769){var _0x4efcca={'attributes':['id',_0x7e1c('0x2b')]};if(_0x335769===_0x7e1c('0x80')){_0x4efcca[_0x7e1c('0x87')]={'attributes':[_0x7e1c('0x88')]};}return _0x2a4e93[_0x7e1c('0x4d')+_0x335769+_0x7e1c('0x7c')](_0x4efcca)[_0x7e1c('0x43')](function(_0x4ad917){var _0x2e78e0=_['map'](_0x4ad917,function(_0x1f0a99){var _0x35e95c=_[_0x7e1c('0x32')](_0x38f97a,function(_0x3eb1c3){var _0x6ee5c4={'where':{'UserId':_0x3eb1c3,[_0x335769+_0x7e1c('0x89')]:_0x1f0a99['id']},'transaction':_0x30c1fd};if(_0x335769===_0x7e1c('0x80')){_0x6ee5c4['defaults']={'penalty':_0x1f0a99[_0x7e1c('0x8a')][_0x7e1c('0x88')]};}return db[_0x7e1c('0x8b')+_0x335769+_0x7e1c('0x8c')][_0x7e1c('0x8d')](_0x6ee5c4)[_0x7e1c('0x43')](function(){socket[_0x7e1c('0x8e')](_0x7e1c('0x4c')+_0x335769+_0x7e1c('0x8f'),{'UserId':_0x3eb1c3,[_0x335769+_0x7e1c('0x89')]:_0x1f0a99['id']});if(_0x335769!==_0x7e1c('0x80')){return;}return db[_0x7e1c('0x8b')]['findAll']({'where':{'id':_0x38f97a,'online':0x1},'attributes':['id',_0x7e1c('0x2b'),_0x7e1c('0x90'),_0x7e1c('0x91'),'interface'],'raw':!![]})[_0x7e1c('0x43')](function(_0x2bfa6c){var _0x54024c=_[_0x7e1c('0x32')](_0x2bfa6c,function(_0x2f9737){return db[_0x7e1c('0x92')][_0x7e1c('0x93')]({'membername':_0x2f9737[_0x7e1c('0x2b')],'UserId':_0x2f9737['id'],'queue_name':_0x1f0a99[_0x7e1c('0x2b')],'VoiceQueueId':_0x1f0a99['id'],'interface':_['isNil'](_0x2f9737[_0x7e1c('0x94')])?util[_0x7e1c('0x95')](_0x7e1c('0x96'),_0x2f9737[_0x7e1c('0x2b')]):_0x2f9737[_0x7e1c('0x94')],'paused':_0x2f9737[_0x7e1c('0x91')]||![],'penalty':_0x1f0a99['TeamVoiceQueue'][_0x7e1c('0x88')]},{'transaction':_0x30c1fd});});return Promise[_0x7e1c('0x97')](_0x54024c);});});});return Promise[_0x7e1c('0x97')](_0x35e95c);});return Promise[_0x7e1c('0x97')](_0x2e78e0);})[_0x7e1c('0x43')](function(){return db[_0x7e1c('0x6f')][_0x7e1c('0x74')]({'where':{'teamId':_0x45cb31}})['then'](function(_0x431938){if(_0x431938){var _0x4596d9=_['map'](_0x38f97a,function(_0x45365c){db[_0x7e1c('0x70')][_0x7e1c('0x93')]({'UserId':_0x45365c,'VoicePrefixId':_0x431938['VoicePrefixId']});});return Promise[_0x7e1c('0x97')](_0x4596d9);}});});});return Promise[_0x7e1c('0x97')](_0x2a3019)[_0x7e1c('0x43')](function(){return _0x2a4e93[_0x7e1c('0x98')](_0x38f97a,{'transaction':_0x30c1fd})[_0x7e1c('0x99')](function(_0x975335){return _0x975335;});});});}})[_0x7e1c('0x43')](respondWithResult(_0x28e150,null))[_0x7e1c('0x48')](handleError(_0x28e150,null));};exports[_0x7e1c('0x9a')]=function(_0x11fa02,_0x17f5e4){var _0x2a87eb=_[_0x7e1c('0x9b')](_0x11fa02[_0x7e1c('0x34')][_0x7e1c('0x7f')])?_0x11fa02['query'][_0x7e1c('0x7f')]:[_0x11fa02[_0x7e1c('0x34')][_0x7e1c('0x7f')]];var _0x77d0c9=_0x11fa02[_0x7e1c('0x57')]['id'];return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')]({'where':{'id':_0x77d0c9}})[_0x7e1c('0x43')](handleEntityNotFound(_0x17f5e4,null))[_0x7e1c('0x43')](function(_0x5753f6){if(_0x5753f6){var _0x5339ff=[_0x7e1c('0x80'),_0x7e1c('0x81'),_0x7e1c('0x82'),_0x7e1c('0x83'),_0x7e1c('0x84'),_0x7e1c('0x85'),_0x7e1c('0x86')];return db[_0x7e1c('0x58')][_0x7e1c('0x59')](function(_0x3a4806){var _0x68eb22=_[_0x7e1c('0x32')](_0x5339ff,function(_0x5516b6){var _0x582b92={'attributes':['id',_0x7e1c('0x2b')]};return _0x5753f6['get'+_0x5516b6+_0x7e1c('0x7c')](_0x582b92)['then'](function(_0x1626c8){var _0x14e166=_[_0x7e1c('0x32')](_0x1626c8,function(_0x596f55){return _0x596f55[_0x7e1c('0x9a')](_0x2a87eb,{'transaction':_0x3a4806})['then'](function(){var _0x3fd95e=_['map'](_0x2a87eb,function(_0x22c8cb){socket[_0x7e1c('0x8e')](_0x7e1c('0x4c')+_0x5516b6+'Queue:remove',{'UserId':Number(_0x22c8cb),[_0x5516b6+'QueueId']:_0x596f55['id']});if(_0x5516b6!==_0x7e1c('0x80')){return;}return db[_0x7e1c('0x92')][_0x7e1c('0x56')]({'where':{'VoiceQueueId':_0x596f55['id'],'UserId':_0x22c8cb},'transaction':_0x3a4806});});return Promise[_0x7e1c('0x97')](_0x3fd95e);});});return Promise['all'](_0x14e166);});});return Promise[_0x7e1c('0x97')](_0x68eb22)['then'](function(){return _0x5753f6['removeAgents'](_0x2a87eb,{'transaction':_0x3a4806});})[_0x7e1c('0x43')](function(){return db[_0x7e1c('0x6f')]['findOne']({'where':{'teamId':_0x77d0c9}})[_0x7e1c('0x43')](function(_0x4efec5){if(_0x4efec5){var _0x681250=_[_0x7e1c('0x32')](_0x2a87eb,function(_0x3ad0c0){db['UserVoicePrefix'][_0x7e1c('0x56')]({'where':{'UserId':_0x3ad0c0,'VoicePrefixId':_0x4efec5[_0x7e1c('0x71')]}});});return Promise['all'](_0x681250);}});});});}})[_0x7e1c('0x43')](respondWithStatusCode(_0x17f5e4,null))['catch'](handleError(_0x17f5e4,null));};exports[_0x7e1c('0x9c')]=function(_0x3b72f7,_0x19aa1b,_0x8264dd){var _0x2ad3a8={};var _0x33cfd1={};var _0x1e321e;var _0x144917;return db['Team']['findOne']({'where':{'id':_0x3b72f7[_0x7e1c('0x57')]['id']}})[_0x7e1c('0x43')](handleEntityNotFound(_0x19aa1b,null))[_0x7e1c('0x43')](function(_0xfc38f){if(_0xfc38f){_0x1e321e=_0xfc38f;_0x33cfd1[_0x7e1c('0x37')]=_[_0x7e1c('0x33')](db[_0x7e1c('0x8b')][_0x7e1c('0x2f')]);_0x33cfd1[_0x7e1c('0x34')]=_['keys'](_0x3b72f7[_0x7e1c('0x34')]);_0x33cfd1[_0x7e1c('0x35')]=_[_0x7e1c('0x36')](_0x33cfd1[_0x7e1c('0x37')],_0x33cfd1['query']);_0x2ad3a8[_0x7e1c('0x38')]=_[_0x7e1c('0x36')](_0x33cfd1[_0x7e1c('0x37')],qs[_0x7e1c('0x39')](_0x3b72f7[_0x7e1c('0x34')][_0x7e1c('0x39')]));_0x2ad3a8[_0x7e1c('0x38')]=_0x2ad3a8['attributes'][_0x7e1c('0x3a')]?_0x2ad3a8['attributes']:_0x33cfd1[_0x7e1c('0x37')];_0x2ad3a8[_0x7e1c('0x3c')]=qs['sort'](_0x3b72f7['query'][_0x7e1c('0x3d')]);_0x2ad3a8[_0x7e1c('0x40')]=qs['filters'](_[_0x7e1c('0x3e')](_0x3b72f7[_0x7e1c('0x34')],_0x33cfd1['filters']));if(_0x3b72f7[_0x7e1c('0x34')]['filter']){_0x2ad3a8[_0x7e1c('0x40')]=_[_0x7e1c('0x41')](_0x2ad3a8[_0x7e1c('0x40')],{'$or':_[_0x7e1c('0x32')](_0x2ad3a8[_0x7e1c('0x38')],function(_0x1789fe){var _0x535c91={};_0x535c91[_0x1789fe]={'$like':'%'+_0x3b72f7[_0x7e1c('0x34')][_0x7e1c('0x3f')]+'%'};return _0x535c91;})});}_0x2ad3a8=_[_0x7e1c('0x41')]({},_0x2ad3a8,_0x3b72f7[_0x7e1c('0x42')]);return _0x1e321e[_0x7e1c('0x9c')](_0x2ad3a8);}})[_0x7e1c('0x43')](function(_0x13295d){if(_0x13295d){_0x144917=_0x13295d[_0x7e1c('0x3a')];if(!_0x3b72f7[_0x7e1c('0x34')][_0x7e1c('0x3b')](_0x7e1c('0x9d'))){_0x2ad3a8[_0x7e1c('0x22')]=qs['limit'](_0x3b72f7[_0x7e1c('0x34')][_0x7e1c('0x22')]);_0x2ad3a8['offset']=qs[_0x7e1c('0x25')](_0x3b72f7['query'][_0x7e1c('0x25')]);}return _0x1e321e[_0x7e1c('0x9c')](_0x2ad3a8);}})[_0x7e1c('0x43')](function(_0x19f68c){if(_0x19f68c){return _0x19f68c?{'count':_0x144917,'rows':_0x19f68c}:null;}})[_0x7e1c('0x43')](respondWithResult(_0x19aa1b,null))[_0x7e1c('0x48')](handleError(_0x19aa1b,null));}; \ No newline at end of file +var _0x535d=['transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','penalty','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','isNil','SIP/%s','TeamVoiceQueue','all','VoicePrefixId','spread','removeAgents','isArray','getAgents','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','Team','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize'];(function(_0x42b2b2,_0x2bbb05){var _0x4c2dd0=function(_0xbfed61){while(--_0xbfed61){_0x42b2b2['push'](_0x42b2b2['shift']());}};_0x4c2dd0(++_0x2bbb05);}(_0x535d,0xdd));var _0xd535=function(_0x299707,_0x5ec163){_0x299707=_0x299707-0x0;var _0x25e6bb=_0x535d[_0x299707];return _0x25e6bb;};'use strict';var emlformat=require(_0xd535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd535('0x1'));var jsonpatch=require(_0xd535('0x2'));var rp=require(_0xd535('0x3'));var moment=require('moment');var BPromise=require(_0xd535('0x4'));var Mustache=require(_0xd535('0x5'));var util=require(_0xd535('0x6'));var path=require(_0xd535('0x7'));var sox=require(_0xd535('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd535('0x9'));var _=require(_0xd535('0xa'));var squel=require(_0xd535('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd535('0xc'));var toCsv=require(_0xd535('0xd'));var querystring=require(_0xd535('0xe'));var Papa=require('papaparse');var Redis=require(_0xd535('0xf'));var authService=require(_0xd535('0x10'));var qs=require(_0xd535('0x11'));var as=require(_0xd535('0x12'));var hardwareService=require(_0xd535('0x13'));var logger=require('../../config/logger')(_0xd535('0x14'));var utils=require(_0xd535('0x15'));var config=require(_0xd535('0x16'));var licenseUtil=require(_0xd535('0x17'));var db=require(_0xd535('0x18'))['db'];config[_0xd535('0x19')]=_[_0xd535('0x1a')](config[_0xd535('0x19')],{'host':_0xd535('0x1b'),'port':0x18eb});var socket=require(_0xd535('0x1c'))(new Redis(config['redis']));require(_0xd535('0x1d'))[_0xd535('0x1e')](socket);function respondWithStatusCode(_0x222e7e,_0x21f591){_0x21f591=_0x21f591||0xcc;return function(_0x1a5ceb){if(_0x1a5ceb){return _0x222e7e[_0xd535('0x1f')](_0x21f591);}return _0x222e7e[_0xd535('0x20')](_0x21f591)[_0xd535('0x21')]();};}function respondWithResult(_0x4c4323,_0x49e8ef){_0x49e8ef=_0x49e8ef||0xc8;return function(_0x1e48f3){if(_0x1e48f3){return _0x4c4323[_0xd535('0x20')](_0x49e8ef)['json'](_0x1e48f3);}};}function respondWithFilteredResult(_0x6a8ce3,_0x2e21b0){return function(_0x380de3){if(_0x380de3){var _0x3de8a4=typeof _0x2e21b0[_0xd535('0x22')]==='undefined'&&typeof _0x2e21b0[_0xd535('0x23')]===_0xd535('0x24');var _0x4229dc=_0x380de3['count'];var _0x20037d=_0x3de8a4?0x0:_0x2e21b0['offset'];var _0x4c3ef7=_0x3de8a4?_0x380de3['count']:_0x2e21b0[_0xd535('0x22')]+_0x2e21b0[_0xd535('0x23')];var _0x539bde;if(_0x4c3ef7>=_0x4229dc){_0x4c3ef7=_0x4229dc;_0x539bde=0xc8;}else{_0x539bde=0xce;}_0x6a8ce3[_0xd535('0x20')](_0x539bde);return _0x6a8ce3[_0xd535('0x25')](_0xd535('0x26'),_0x20037d+'-'+_0x4c3ef7+'/'+_0x4229dc)[_0xd535('0x27')](_0x380de3);}return null;};}function patchUpdates(_0x276470){return function(_0x326d4c){try{jsonpatch['apply'](_0x326d4c,_0x276470,!![]);}catch(_0x2b3c56){return BPromise[_0xd535('0x28')](_0x2b3c56);}return _0x326d4c[_0xd535('0x29')]();};}function saveUpdates(_0x13871b,_0x2d3034){return function(_0x20b1ad){if(_0x20b1ad){return _0x20b1ad[_0xd535('0x2a')](_0x13871b)[_0xd535('0x2b')](function(_0x346367){return _0x346367;});}return null;};}function handleEntityNotFound(_0x1afa2e,_0x43901a){return function(_0x246d7d){if(!_0x246d7d){_0x1afa2e[_0xd535('0x1f')](0x194);}return _0x246d7d;};}function handleError(_0x3fa654,_0x3ce2f4){_0x3ce2f4=_0x3ce2f4||0x1f4;return function(_0x2f8621){logger[_0xd535('0x2c')](_0x2f8621['stack']);if(_0x2f8621[_0xd535('0x2d')]){delete _0x2f8621[_0xd535('0x2d')];}_0x3fa654['status'](_0x3ce2f4)[_0xd535('0x2e')](_0x2f8621);};}exports[_0xd535('0x2f')]=function(_0x2c76d5,_0x55871f){var _0x51baa8={},_0x201bcb={},_0x36cde9={'count':0x0,'rows':[]};var _0x3181c3=_[_0xd535('0x30')](db['Team'][_0xd535('0x31')],function(_0xb08164){return{'name':_0xb08164[_0xd535('0x32')],'type':_0xb08164[_0xd535('0x33')]['key']};});_0x201bcb[_0xd535('0x34')]=_[_0xd535('0x30')](_0x3181c3,_0xd535('0x2d'));_0x201bcb[_0xd535('0x35')]=_[_0xd535('0x36')](_0x2c76d5[_0xd535('0x35')]);_0x201bcb[_0xd535('0x37')]=_[_0xd535('0x38')](_0x201bcb[_0xd535('0x34')],_0x201bcb[_0xd535('0x35')]);_0x51baa8[_0xd535('0x39')]=_[_0xd535('0x38')](_0x201bcb[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x3a')]));_0x51baa8[_0xd535('0x39')]=_0x51baa8['attributes']['length']?_0x51baa8[_0xd535('0x39')]:_0x201bcb[_0xd535('0x34')];if(!_0x2c76d5[_0xd535('0x35')]['hasOwnProperty']('nolimit')){_0x51baa8[_0xd535('0x23')]=qs[_0xd535('0x23')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x23')]);_0x51baa8['offset']=qs[_0xd535('0x22')](_0x2c76d5['query'][_0xd535('0x22')]);}_0x51baa8[_0xd535('0x3b')]=qs[_0xd535('0x3c')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x3c')]);_0x51baa8[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x2c76d5[_0xd535('0x35')],_0x201bcb[_0xd535('0x37')]),_0x3181c3);if(_0x2c76d5[_0xd535('0x35')][_0xd535('0x3f')]){_0x51baa8['where']=_[_0xd535('0x40')](_0x51baa8[_0xd535('0x3d')],{'$or':_['map'](_0x3181c3,function(_0x336f61){if(_0x336f61[_0xd535('0x33')]!==_0xd535('0x41')){var _0x452643={};_0x452643[_0x336f61[_0xd535('0x2d')]]={'$like':'%'+_0x2c76d5[_0xd535('0x35')][_0xd535('0x3f')]+'%'};return _0x452643;}})});}_0x51baa8=_[_0xd535('0x40')]({},_0x51baa8,_0x2c76d5[_0xd535('0x42')]);var _0x12aff5={'where':_0x51baa8[_0xd535('0x3d')]};return db['Team']['count'](_0x12aff5)['then'](function(_0x2bbf2c){_0x36cde9[_0xd535('0x43')]=_0x2bbf2c;if(_0x2c76d5[_0xd535('0x35')][_0xd535('0x44')]){_0x51baa8[_0xd535('0x45')]=[{'all':!![]}];}return db['Team'][_0xd535('0x46')](_0x51baa8);})[_0xd535('0x2b')](function(_0x45b2fc){_0x36cde9['rows']=_0x45b2fc;return _0x36cde9;})['then'](respondWithFilteredResult(_0x55871f,_0x51baa8))[_0xd535('0x47')](handleError(_0x55871f,null));};exports['show']=function(_0x1795be,_0xf3604e){var _0x4ce31f={'raw':![],'where':{'id':_0x1795be[_0xd535('0x48')]['id']}},_0x484880={};_0x484880[_0xd535('0x34')]=_[_0xd535('0x36')](db[_0xd535('0x49')][_0xd535('0x31')]);_0x484880[_0xd535('0x35')]=_[_0xd535('0x36')](_0x1795be[_0xd535('0x35')]);_0x484880['filters']=_[_0xd535('0x38')](_0x484880[_0xd535('0x34')],_0x484880['query']);_0x4ce31f[_0xd535('0x39')]=_[_0xd535('0x38')](_0x484880[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x1795be[_0xd535('0x35')]['fields']));_0x4ce31f['attributes']=_0x4ce31f[_0xd535('0x39')][_0xd535('0x4a')]?_0x4ce31f[_0xd535('0x39')]:_0x484880[_0xd535('0x34')];if(_0x1795be[_0xd535('0x35')][_0xd535('0x44')]){_0x4ce31f['include']=[{'all':!![]}];}_0x4ce31f=_[_0xd535('0x40')]({},_0x4ce31f,_0x1795be[_0xd535('0x42')]);return db[_0xd535('0x49')][_0xd535('0x4b')](_0x4ce31f)['then'](handleEntityNotFound(_0xf3604e,null))[_0xd535('0x2b')](respondWithResult(_0xf3604e,null))['catch'](handleError(_0xf3604e,null));};exports[_0xd535('0x4c')]=function(_0x14b53e,_0x42984d){return db[_0xd535('0x49')][_0xd535('0x4c')](_0x14b53e[_0xd535('0x4d')],{})[_0xd535('0x2b')](function(_0x7332e1){var _0x26d690=_0x14b53e[_0xd535('0x4e')][_0xd535('0x4f')]({'plain':!![]});if(!_0x26d690)throw new Error(_0xd535('0x50'));if(_0x26d690['role']==='user'){var _0x526a21=_0x7332e1['get']({'plain':!![]});var _0x988deb=_0xd535('0x51');return db['UserProfileSection'][_0xd535('0x4b')]({'where':{'name':_0x988deb,'userProfileId':_0x26d690[_0xd535('0x52')]},'raw':!![]})[_0xd535('0x2b')](function(_0xc091be){if(_0xc091be&&_0xc091be['autoAssociation']===0x0){return db[_0xd535('0x53')][_0xd535('0x4c')]({'name':_0x526a21[_0xd535('0x2d')],'resourceId':_0x526a21['id'],'type':_0xc091be[_0xd535('0x2d')],'sectionId':_0xc091be['id']},{})['then'](function(){return _0x7332e1;});}else{return _0x7332e1;}})[_0xd535('0x47')](function(_0x2a4138){logger[_0xd535('0x2c')](_0xd535('0x54'),_0x2a4138);throw _0x2a4138;});}return _0x7332e1;})[_0xd535('0x2b')](respondWithResult(_0x42984d,0xc9))[_0xd535('0x47')](handleError(_0x42984d,null));};exports['update']=function(_0xd94630,_0x5d5cee){if(_0xd94630['body']['id']){delete _0xd94630['body']['id'];}return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0xd94630['params']['id']}})[_0xd535('0x2b')](handleEntityNotFound(_0x5d5cee,null))[_0xd535('0x2b')](saveUpdates(_0xd94630[_0xd535('0x4d')],null))['then'](respondWithResult(_0x5d5cee,null))[_0xd535('0x47')](handleError(_0x5d5cee,null));};exports[_0xd535('0x55')]=function(_0x4a8f4f,_0xc57dd6){var _0x75c9ef=_0x4a8f4f[_0xd535('0x48')]['id'];var _0x3d3249=[];return db[_0xd535('0x56')][_0xd535('0x57')](function(_0x31c77c){var _0x13aaf6=_0xd535('0x58')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x13aaf6,{'type':db[_0xd535('0x59')][_0xd535('0x5a')][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c})[_0xd535('0x2b')](function(_0x500df5){_0x3d3249=_['map'](_0x500df5,function(_0x384b1e){return Number(_0x384b1e['UserId']);});})['then'](function(){var _0x295774=_0xd535('0x5c')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x295774,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x4cc8d6){var _0x11171e=_['map'](_0x4cc8d6,function(_0x1e4be8){return Number(_0x1e4be8[_0xd535('0x5d')]);});return db[_0xd535('0x5e')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'VoiceQueueId':{'$in':_0x11171e}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x1b5b12=_0xd535('0x5f')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x1b5b12,{'type':db['Sequelize'][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x312a03){var _0x374ce6=_[_0xd535('0x30')](_0x312a03,function(_0xa90179){return Number(_0xa90179[_0xd535('0x60')]);});return db[_0xd535('0x61')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'MailQueueId':{'$in':_0x374ce6}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x5002a4='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x5002a4,{'type':db[_0xd535('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x5463dd){var _0x5d1e38=_[_0xd535('0x30')](_0x5463dd,function(_0x48729c){return Number(_0x48729c[_0xd535('0x62')]);});return db[_0xd535('0x63')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'SmsQueueId':{'$in':_0x5d1e38}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0xd5a621=_0xd535('0x64')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0xd5a621,{'type':db[_0xd535('0x59')]['QueryTypes'][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x1cc9e6){var _0x21b2c1=_[_0xd535('0x30')](_0x1cc9e6,function(_0x16b446){return Number(_0x16b446[_0xd535('0x65')]);});return db[_0xd535('0x66')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'ChatQueueId':{'$in':_0x21b2c1}},'transaction':_0x31c77c});})['then'](function(){var _0x3a71ca=_0xd535('0x67')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x3a71ca,{'type':db[_0xd535('0x59')]['QueryTypes'][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x54b4bc){var _0x202408=_[_0xd535('0x30')](_0x54b4bc,function(_0x38fea8){return Number(_0x38fea8[_0xd535('0x68')]);});return db[_0xd535('0x69')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'FaxQueueId':{'$in':_0x202408}},'transaction':_0x31c77c});})['then'](function(){var _0x22c19d=_0xd535('0x6a')+_0x75c9ef;return db[_0xd535('0x56')]['query'](_0x22c19d,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x46ce0d){var _0x3c9905=_[_0xd535('0x30')](_0x46ce0d,function(_0x21391d){return Number(_0x21391d[_0xd535('0x6b')]);});return db['UserOpenchannelQueue'][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'OpenchannelQueueId':{'$in':_0x3c9905}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x95d51='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x75c9ef;return db[_0xd535('0x56')]['query'](_0x95d51,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})['then'](function(_0x9dec6f){var _0x205e78=_[_0xd535('0x30')](_0x9dec6f,function(_0x253b9a){return Number(_0x253b9a[_0xd535('0x6c')]);});return db['UserWhatsappQueue'][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'WhatsappQueueId':{'$in':_0x205e78}},'transaction':_0x31c77c});})['then'](function(){return db[_0xd535('0x6d')][_0xd535('0x4b')]({'where':{'TeamId':_0x75c9ef}});})[_0xd535('0x2b')](function(_0x5a816c){if(_0x5a816c===null){return;}return db[_0xd535('0x6e')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'VoicePrefixId':_0x5a816c['VoicePrefixId']},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){return db['Team'][_0xd535('0x55')]({'where':{'id':_0x75c9ef},'cascade':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x5d1102){if(_0x5d1102===0x0){_0xc57dd6[_0xd535('0x1f')](0x194);}else{return db['UserProfileResource'][_0xd535('0x55')]({'where':{'type':_0xd535('0x51'),'resourceId':_0x75c9ef},'cascade':!![],'transaction':_0x31c77c})[_0xd535('0x2b')](function(){_0xc57dd6[_0xd535('0x20')](0xcc)['end']();});}})[_0xd535('0x47')](function(_0x340220){_0xc57dd6['status'](0x1f4)[_0xd535('0x2e')](_0x340220);});});};exports[_0xd535('0x6f')]=function(_0x7557,_0x4e5843,_0x54b316){return db['Team'][_0xd535('0x70')]({'where':{'id':_0x7557['params']['id']}})['then'](handleEntityNotFound(_0x4e5843,null))[_0xd535('0x2b')](function(_0x115844){if(!_0x7557['query'][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x7557['query'][_0xd535('0x71')])){throw new db[(_0xd535('0x59'))]['ValidationError'](_0xd535('0x73'));}var _0x2d5122={};var _0x4e4519={};_0x4e4519['model']=_[_0xd535('0x36')](db[_[_0xd535('0x74')](_0x7557['query'][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x76')][_0xd535('0x31')]);_0x4e4519[_0xd535('0x35')]=_[_0xd535('0x36')](_0x7557[_0xd535('0x35')]);_0x4e4519[_0xd535('0x37')]=_['intersection'](_0x4e4519[_0xd535('0x34')],_0x4e4519[_0xd535('0x35')]);_0x2d5122[_0xd535('0x39')]=_[_0xd535('0x38')](_0x4e4519[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x7557['query'][_0xd535('0x3a')]));_0x2d5122[_0xd535('0x39')]=_0x2d5122[_0xd535('0x39')][_0xd535('0x4a')]?_0x2d5122['attributes']:_0x4e4519[_0xd535('0x34')];_0x2d5122[_0xd535('0x23')]=qs[_0xd535('0x23')](_0x7557[_0xd535('0x35')][_0xd535('0x23')]);_0x2d5122[_0xd535('0x22')]=qs['offset'](_0x7557[_0xd535('0x35')][_0xd535('0x22')]);_0x2d5122['order']=qs[_0xd535('0x3c')](_0x7557[_0xd535('0x35')]['sort']);_0x2d5122[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x7557[_0xd535('0x35')],_0x4e4519[_0xd535('0x37')]));_0x2d5122=_[_0xd535('0x40')]({},_0x2d5122,_0x7557[_0xd535('0x42')]);return _0x115844['get'+_['capitalize'](_0x7557['query'][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x77')](_0x2d5122);})[_0xd535('0x2b')](respondWithResult(_0x4e5843,null))['catch'](handleError(_0x4e5843,null));};exports[_0xd535('0x78')]=function(_0x43cac6,_0x104b35,_0x36fcec){return db[_0xd535('0x49')][_0xd535('0x70')]({'where':{'id':_0x43cac6[_0xd535('0x48')]['id']}})[_0xd535('0x2b')](function(_0x5ce739){if(_0x5ce739){if(!_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')])){throw new db[(_0xd535('0x59'))][(_0xd535('0x79'))](_0xd535('0x73'));}return _0x5ce739[_0xd535('0x7a')+_[_0xd535('0x74')](_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')][_0xd535('0x75')]())+'Queues'](_0x43cac6[_0xd535('0x4d')][_0xd535('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x104b35,null))['then'](respondWithStatusCode(_0x104b35,null))[_0xd535('0x47')](handleError(_0x104b35,null));};exports[_0xd535('0x7c')]=function(_0x428543,_0x15f0bf,_0xaa6e33){return db['Team'][_0xd535('0x70')]({'where':{'id':_0x428543['params']['id']}})[_0xd535('0x2b')](function(_0x1b6632){if(_0x1b6632){if(!_0x428543[_0xd535('0x35')][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x428543[_0xd535('0x35')]['channel'])){throw new db['Sequelize'][(_0xd535('0x79'))](_0xd535('0x73'));}return _0x1b6632['remove'+_[_0xd535('0x74')](_0x428543[_0xd535('0x35')][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x77')](_0x428543[_0xd535('0x35')][_0xd535('0x7b')]);}return null;})[_0xd535('0x2b')](handleEntityNotFound(_0x15f0bf,null))[_0xd535('0x2b')](respondWithStatusCode(_0x15f0bf,null))[_0xd535('0x47')](handleError(_0x15f0bf,null));};exports[_0xd535('0x7d')]=function(_0x9cd78d,_0x30c06d){var _0x4c5c90=_['isArray'](_0x9cd78d['body'][_0xd535('0x7b')])?_0x9cd78d[_0xd535('0x4d')][_0xd535('0x7b')]:[_0x9cd78d[_0xd535('0x4d')][_0xd535('0x7b')]];var _0x59d020=_0x9cd78d['params']['id'];return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0x59d020}})[_0xd535('0x2b')](handleEntityNotFound(_0x30c06d,null))['then'](function(_0x3fa830){if(_0x3fa830){var _0x1b0bd2=[_0xd535('0x7e'),_0xd535('0x7f'),_0xd535('0x80'),_0xd535('0x81'),_0xd535('0x82'),_0xd535('0x83'),_0xd535('0x84')];return db[_0xd535('0x56')][_0xd535('0x57')](function(_0x40573b){var _0x1aedd6=_['map'](_0x1b0bd2,function(_0x209afa){var _0x309a03={'attributes':['id',_0xd535('0x2d')]};if(_0x209afa===_0xd535('0x7e')){_0x309a03[_0xd535('0x85')]={'attributes':['penalty']};}return _0x3fa830['get'+_0x209afa+_0xd535('0x77')](_0x309a03)[_0xd535('0x2b')](function(_0x45a302){var _0x403f15=_['map'](_0x45a302,function(_0x4567a8){var _0xc99647=_[_0xd535('0x30')](_0x4c5c90,function(_0x4a7c45){var _0x28a423={'where':{'UserId':_0x4a7c45,[_0x209afa+_0xd535('0x86')]:_0x4567a8['id']},'transaction':_0x40573b};if(_0x209afa===_0xd535('0x7e')){_0x28a423[_0xd535('0x1a')]={'penalty':_0x4567a8['TeamVoiceQueue'][_0xd535('0x87')]};}return db[_0xd535('0x88')+_0x209afa+_0xd535('0x76')][_0xd535('0x89')](_0x28a423)[_0xd535('0x2b')](function(){socket[_0xd535('0x8a')](_0xd535('0x4e')+_0x209afa+'Queue:save',{'UserId':_0x4a7c45,[_0x209afa+_0xd535('0x86')]:_0x4567a8['id']});if(_0x209afa!==_0xd535('0x7e')){return;}return db[_0xd535('0x88')]['findAll']({'where':{'id':_0x4c5c90,'online':0x1},'attributes':['id',_0xd535('0x2d'),_0xd535('0x8b'),_0xd535('0x8c'),_0xd535('0x8d')],'raw':!![]})[_0xd535('0x2b')](function(_0x9a0157){var _0x383373=_['map'](_0x9a0157,function(_0x64dd48){return db[_0xd535('0x8e')]['upsert']({'membername':_0x64dd48[_0xd535('0x2d')],'UserId':_0x64dd48['id'],'queue_name':_0x4567a8[_0xd535('0x2d')],'VoiceQueueId':_0x4567a8['id'],'interface':_[_0xd535('0x8f')](_0x64dd48['interface'])?util['format'](_0xd535('0x90'),_0x64dd48[_0xd535('0x2d')]):_0x64dd48['interface'],'paused':_0x64dd48[_0xd535('0x8c')]||![],'penalty':_0x4567a8[_0xd535('0x91')][_0xd535('0x87')]},{'transaction':_0x40573b});});return Promise[_0xd535('0x92')](_0x383373);});});});return Promise[_0xd535('0x92')](_0xc99647);});return Promise[_0xd535('0x92')](_0x403f15);})[_0xd535('0x2b')](function(){return db[_0xd535('0x6d')]['findOne']({'where':{'teamId':_0x59d020}})['then'](function(_0x15ea96){if(_0x15ea96){var _0x2d947b=_[_0xd535('0x30')](_0x4c5c90,function(_0x43e2f4){db[_0xd535('0x6e')]['upsert']({'UserId':_0x43e2f4,'VoicePrefixId':_0x15ea96[_0xd535('0x93')]});});return Promise[_0xd535('0x92')](_0x2d947b);}});});});return Promise[_0xd535('0x92')](_0x1aedd6)[_0xd535('0x2b')](function(){return _0x3fa830[_0xd535('0x7d')](_0x4c5c90,{'transaction':_0x40573b})[_0xd535('0x94')](function(_0x15b79c){return _0x15b79c;});});});}})[_0xd535('0x2b')](respondWithResult(_0x30c06d,null))['catch'](handleError(_0x30c06d,null));};exports[_0xd535('0x95')]=function(_0x4550eb,_0x228022){var _0x33f55b=_[_0xd535('0x96')](_0x4550eb[_0xd535('0x35')]['ids'])?_0x4550eb[_0xd535('0x35')][_0xd535('0x7b')]:[_0x4550eb[_0xd535('0x35')][_0xd535('0x7b')]];var _0x4b09a9=_0x4550eb[_0xd535('0x48')]['id'];return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0x4b09a9}})[_0xd535('0x2b')](handleEntityNotFound(_0x228022,null))['then'](function(_0xc51d97){if(_0xc51d97){var _0x1f10a0=[_0xd535('0x7e'),_0xd535('0x7f'),'Mail',_0xd535('0x81'),'Fax','Openchannel',_0xd535('0x84')];return db['sequelize'][_0xd535('0x57')](function(_0x5e6be6){var _0x49ae65=_[_0xd535('0x30')](_0x1f10a0,function(_0x2c6559){var _0x18cc5b={'attributes':['id',_0xd535('0x2d')]};return _0xc51d97[_0xd535('0x4f')+_0x2c6559+'Queues'](_0x18cc5b)['then'](function(_0x40db17){var _0x46903c=_[_0xd535('0x30')](_0x40db17,function(_0x3ba277){return _0x3ba277[_0xd535('0x95')](_0x33f55b,{'transaction':_0x5e6be6})['then'](function(){var _0x53d522=_[_0xd535('0x30')](_0x33f55b,function(_0x613bdf){socket[_0xd535('0x8a')]('user'+_0x2c6559+'Queue:remove',{'UserId':Number(_0x613bdf),[_0x2c6559+_0xd535('0x86')]:_0x3ba277['id']});if(_0x2c6559!==_0xd535('0x7e')){return;}return db[_0xd535('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x3ba277['id'],'UserId':_0x613bdf},'transaction':_0x5e6be6});});return Promise['all'](_0x53d522);});});return Promise['all'](_0x46903c);});});return Promise[_0xd535('0x92')](_0x49ae65)[_0xd535('0x2b')](function(){return _0xc51d97[_0xd535('0x95')](_0x33f55b,{'transaction':_0x5e6be6});})[_0xd535('0x2b')](function(){return db[_0xd535('0x6d')][_0xd535('0x70')]({'where':{'teamId':_0x4b09a9}})[_0xd535('0x2b')](function(_0x2d757b){if(_0x2d757b){var _0x5af25f=_['map'](_0x33f55b,function(_0x386b15){db[_0xd535('0x6e')][_0xd535('0x55')]({'where':{'UserId':_0x386b15,'VoicePrefixId':_0x2d757b[_0xd535('0x93')]}});});return Promise[_0xd535('0x92')](_0x5af25f);}});});});}})['then'](respondWithStatusCode(_0x228022,null))[_0xd535('0x47')](handleError(_0x228022,null));};exports[_0xd535('0x97')]=function(_0x54ba73,_0x95e2c9,_0xf1684b){var _0x5b7b24={};var _0x1f9bb6={};var _0x177112;var _0x425ad6;return db[_0xd535('0x49')][_0xd535('0x70')]({'where':{'id':_0x54ba73[_0xd535('0x48')]['id']}})[_0xd535('0x2b')](handleEntityNotFound(_0x95e2c9,null))['then'](function(_0x119422){if(_0x119422){_0x177112=_0x119422;_0x1f9bb6[_0xd535('0x34')]=_[_0xd535('0x36')](db[_0xd535('0x88')]['rawAttributes']);_0x1f9bb6[_0xd535('0x35')]=_[_0xd535('0x36')](_0x54ba73[_0xd535('0x35')]);_0x1f9bb6[_0xd535('0x37')]=_['intersection'](_0x1f9bb6[_0xd535('0x34')],_0x1f9bb6[_0xd535('0x35')]);_0x5b7b24['attributes']=_['intersection'](_0x1f9bb6[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x54ba73[_0xd535('0x35')][_0xd535('0x3a')]));_0x5b7b24['attributes']=_0x5b7b24['attributes']['length']?_0x5b7b24[_0xd535('0x39')]:_0x1f9bb6[_0xd535('0x34')];_0x5b7b24[_0xd535('0x3b')]=qs[_0xd535('0x3c')](_0x54ba73['query'][_0xd535('0x3c')]);_0x5b7b24[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x54ba73[_0xd535('0x35')],_0x1f9bb6['filters']));if(_0x54ba73[_0xd535('0x35')][_0xd535('0x3f')]){_0x5b7b24[_0xd535('0x3d')]=_[_0xd535('0x40')](_0x5b7b24[_0xd535('0x3d')],{'$or':_[_0xd535('0x30')](_0x5b7b24[_0xd535('0x39')],function(_0x16a9f6){var _0x189713={};_0x189713[_0x16a9f6]={'$like':'%'+_0x54ba73[_0xd535('0x35')]['filter']+'%'};return _0x189713;})});}_0x5b7b24=_[_0xd535('0x40')]({},_0x5b7b24,_0x54ba73[_0xd535('0x42')]);return _0x177112[_0xd535('0x97')](_0x5b7b24);}})[_0xd535('0x2b')](function(_0x4bd2a3){if(_0x4bd2a3){_0x425ad6=_0x4bd2a3['length'];if(!_0x54ba73[_0xd535('0x35')][_0xd535('0x98')](_0xd535('0x99'))){_0x5b7b24[_0xd535('0x23')]=qs['limit'](_0x54ba73['query'][_0xd535('0x23')]);_0x5b7b24['offset']=qs[_0xd535('0x22')](_0x54ba73[_0xd535('0x35')]['offset']);}return _0x177112['getAgents'](_0x5b7b24);}})[_0xd535('0x2b')](function(_0x2630eb){if(_0x2630eb){return _0x2630eb?{'count':_0x425ad6,'rows':_0x2630eb}:null;}})[_0xd535('0x2b')](respondWithResult(_0x95e2c9,null))[_0xd535('0x47')](handleError(_0x95e2c9,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a666a4a..fb47d4f 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 _0x51c7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','save','update','remove'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0x51c7,0x126));var _0x751c=function(_0x41eccd,_0x2052f4){_0x41eccd=_0x41eccd-0x0;var _0x4ebf84=_0x51c7[_0x41eccd];return _0x4ebf84;};'use strict';var EventEmitter=require(_0x751c('0x0'));var Team=require(_0x751c('0x1'))['db'][_0x751c('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x751c('0x3'),'afterUpdate':_0x751c('0x4'),'afterDestroy':_0x751c('0x5')};function emitEvent(_0x5cf273){return function(_0x253fe1,_0x3dfa35,_0x2f2f76){TeamEvents[_0x751c('0x6')](_0x5cf273+':'+_0x253fe1['id'],_0x253fe1);TeamEvents[_0x751c('0x6')](_0x5cf273,_0x253fe1);_0x2f2f76(null);};}for(var e in events){if(events[_0x751c('0x7')](e)){var event=events[e];Team[_0x751c('0x8')](e,emitEvent(event));}}module[_0x751c('0x9')]=TeamEvents; \ No newline at end of file +var _0xa862=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1af8cb,_0x48ba46){var _0x4544d6=function(_0xa2213b){while(--_0xa2213b){_0x1af8cb['push'](_0x1af8cb['shift']());}};_0x4544d6(++_0x48ba46);}(_0xa862,0xf0));var _0x2a86=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xa862[_0x3f2d02];return _0x54092b;};'use strict';var EventEmitter=require('events');var Team=require(_0x2a86('0x0'))['db'][_0x2a86('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2a86('0x2')](0x0);var events={'afterCreate':_0x2a86('0x3'),'afterUpdate':_0x2a86('0x4'),'afterDestroy':_0x2a86('0x5')};function emitEvent(_0x19fb73){return function(_0x65bfb6,_0x511aed,_0x2aabe0){TeamEvents[_0x2a86('0x6')](_0x19fb73+':'+_0x65bfb6['id'],_0x65bfb6);TeamEvents[_0x2a86('0x6')](_0x19fb73,_0x65bfb6);_0x2aabe0(null);};}for(var e in events){if(events[_0x2a86('0x7')](e)){var event=events[e];Team[_0x2a86('0x8')](e,emitEvent(event));}}module[_0x2a86('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index f7a0f97..8c21fac 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 _0xcc9f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Team','teams'];(function(_0xbf64af,_0x581dbf){var _0x3a41bd=function(_0x2a5351){while(--_0x2a5351){_0xbf64af['push'](_0xbf64af['shift']());}};_0x3a41bd(++_0x581dbf);}(_0xcc9f,0x186));var _0xfcc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfcc9('0x0'));var util=require(_0xfcc9('0x1'));var logger=require(_0xfcc9('0x2'))('api');var moment=require(_0xfcc9('0x3'));var BPromise=require(_0xfcc9('0x4'));var rp=require(_0xfcc9('0x5'));var fs=require('fs');var path=require(_0xfcc9('0x6'));var rimraf=require(_0xfcc9('0x7'));var config=require(_0xfcc9('0x8'));var attributes=require('./team.attributes');module[_0xfcc9('0x9')]=function(_0x35f298,_0x2a83e7){return _0x35f298[_0xfcc9('0xa')](_0xfcc9('0xb'),attributes,{'tableName':_0xfcc9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfebc=['moment','bluebird','rimraf','../../config/environment','./team.attributes','exports','teams','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfebc,0x1ed));var _0xcfeb=function(_0x20275f,_0x4528c5){_0x20275f=_0x20275f-0x0;var _0x5a5457=_0xfebc[_0x20275f];return _0x5a5457;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfeb('0x0'))(_0xcfeb('0x1'));var moment=require(_0xcfeb('0x2'));var BPromise=require(_0xcfeb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfeb('0x4'));var config=require(_0xcfeb('0x5'));var attributes=require(_0xcfeb('0x6'));module[_0xcfeb('0x7')]=function(_0x445a7e,_0x5e4df4){return _0x445a7e['define']('Team',attributes,{'tableName':_0xcfeb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index be79990..4b636a4 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 _0xdd41=['client','http','defaults','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x27c4da,_0x524970){var _0xdcb26f=function(_0x38699d){while(--_0x38699d){_0x27c4da['push'](_0x27c4da['shift']());}};_0xdcb26f(++_0x524970);}(_0xdd41,0x1f2));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dd4('0x0'));var util=require(_0x1dd4('0x1'));var moment=require(_0x1dd4('0x2'));var BPromise=require(_0x1dd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dd4('0x4'));var db=require(_0x1dd4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1dd4('0x6'));var config=require(_0x1dd4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1dd4('0x8')][_0x1dd4('0x9')]({'port':0x232a});config['redis']=_[_0x1dd4('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1dd4('0xb'))['register'](socket);function respondWithRpcPromise(_0x3ddfee,_0x1cc223,_0x2f8aa0){return new BPromise(function(_0xa64be4,_0x5c6b6d){return client[_0x1dd4('0xc')](_0x3ddfee,_0x2f8aa0)['then'](function(_0x47684f){logger[_0x1dd4('0xd')](_0x1dd4('0xe'),_0x1cc223,_0x1dd4('0xf'));logger[_0x1dd4('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x1cc223,_0x1dd4('0xf'),JSON[_0x1dd4('0x11')](_0x47684f));if(_0x47684f[_0x1dd4('0x12')]){if(_0x47684f[_0x1dd4('0x12')][_0x1dd4('0x13')]===0x1f4){logger[_0x1dd4('0x12')](_0x1dd4('0xe'),_0x1cc223,_0x47684f['error'][_0x1dd4('0x14')]);return _0x5c6b6d(_0x47684f[_0x1dd4('0x12')][_0x1dd4('0x14')]);}logger[_0x1dd4('0x12')](_0x1dd4('0xe'),_0x1cc223,_0x47684f[_0x1dd4('0x12')][_0x1dd4('0x14')]);return _0xa64be4(_0x47684f[_0x1dd4('0x12')][_0x1dd4('0x14')]);}else{logger[_0x1dd4('0xd')]('Team,\x20%s,\x20%s',_0x1cc223,'request\x20sent');_0xa64be4(_0x47684f[_0x1dd4('0x15')][_0x1dd4('0x14')]);}})[_0x1dd4('0x16')](function(_0x32e8c0){logger[_0x1dd4('0x12')]('Team,\x20%s,\x20%s',_0x1cc223,_0x32e8c0);_0x5c6b6d(_0x32e8c0);});});} \ No newline at end of file +var _0xf178=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32fbc0,_0x4c20e2){var _0x3c8fc0=function(_0x56cd0a){while(--_0x56cd0a){_0x32fbc0['push'](_0x32fbc0['shift']());}};_0x3c8fc0(++_0x4c20e2);}(_0xf178,0xb5));var _0x8f17=function(_0x47d193,_0x3d630b){_0x47d193=_0x47d193-0x0;var _0x442d26=_0xf178[_0x47d193];return _0x442d26;};'use strict';var _=require(_0x8f17('0x0'));var util=require('util');var moment=require(_0x8f17('0x1'));var BPromise=require(_0x8f17('0x2'));var rs=require(_0x8f17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f17('0x4'))['db'];var utils=require(_0x8f17('0x5'));var logger=require(_0x8f17('0x6'))(_0x8f17('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f17('0x8'));var client=jayson[_0x8f17('0x9')][_0x8f17('0xa')]({'port':0x232a});config[_0x8f17('0xb')]=_['defaults'](config[_0x8f17('0xb')],{'host':_0x8f17('0xc'),'port':0x18eb});var socket=require(_0x8f17('0xd'))(new Redis(config['redis']));require(_0x8f17('0xe'))[_0x8f17('0xf')](socket);function respondWithRpcPromise(_0x32b5f8,_0x1381da,_0x15be1c){return new BPromise(function(_0x226b61,_0x1191e5){return client[_0x8f17('0x10')](_0x32b5f8,_0x15be1c)[_0x8f17('0x11')](function(_0x263730){logger[_0x8f17('0x12')](_0x8f17('0x13'),_0x1381da,_0x8f17('0x14'));logger['debug'](_0x8f17('0x15'),_0x1381da,_0x8f17('0x14'),JSON['stringify'](_0x263730));if(_0x263730[_0x8f17('0x16')]){if(_0x263730[_0x8f17('0x16')][_0x8f17('0x17')]===0x1f4){logger[_0x8f17('0x16')](_0x8f17('0x13'),_0x1381da,_0x263730['error']['message']);return _0x1191e5(_0x263730[_0x8f17('0x16')][_0x8f17('0x18')]);}logger[_0x8f17('0x16')](_0x8f17('0x13'),_0x1381da,_0x263730['error'][_0x8f17('0x18')]);return _0x226b61(_0x263730[_0x8f17('0x16')][_0x8f17('0x18')]);}else{logger[_0x8f17('0x12')](_0x8f17('0x13'),_0x1381da,_0x8f17('0x14'));_0x226b61(_0x263730[_0x8f17('0x19')][_0x8f17('0x18')]);}})[_0x8f17('0x1a')](function(_0x2a7ca9){logger[_0x8f17('0x16')]('Team,\x20%s,\x20%s',_0x1381da,_0x2a7ca9);_0x1191e5(_0x2a7ca9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a7bc5ce..302b1a8 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 _0x4574=['update','register','length','./team.events','remove'];(function(_0x2d9e67,_0x3fc67b){var _0x465915=function(_0x5b0f38){while(--_0x5b0f38){_0x2d9e67['push'](_0x2d9e67['shift']());}};_0x465915(++_0x3fc67b);}(_0x4574,0xbc));var _0x4457=function(_0x3cd447,_0x1ddfda){_0x3cd447=_0x3cd447-0x0;var _0x3d0b31=_0x4574[_0x3cd447];return _0x3d0b31;};'use strict';var TeamEvents=require(_0x4457('0x0'));var events=['save',_0x4457('0x1'),_0x4457('0x2')];function createListener(_0x4d61c2,_0x277662){return function(_0x34ef2f){_0x277662['emit'](_0x4d61c2,_0x34ef2f);};}function removeListener(_0x104a6c,_0x35320c){return function(){TeamEvents['removeListener'](_0x104a6c,_0x35320c);};}exports[_0x4457('0x3')]=function(_0x25bd0b){for(var _0x110a03=0x0,_0x2b1246=events[_0x4457('0x4')];_0x110a03<_0x2b1246;_0x110a03++){var _0x52bcf7=events[_0x110a03];var _0x4f16b9=createListener('team:'+_0x52bcf7,_0x25bd0b);TeamEvents['on'](_0x52bcf7,_0x4f16b9);}}; \ No newline at end of file +var _0x27dd=['remove','update','emit','removeListener','register','length','team:','./team.events'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x27dd,0x177));var _0xd27d=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x27dd[_0xaa6a4];return _0xdc31a4;};'use strict';var TeamEvents=require(_0xd27d('0x0'));var events=['save',_0xd27d('0x1'),_0xd27d('0x2')];function createListener(_0x3c1ab5,_0x5626d6){return function(_0x5c09f3){_0x5626d6[_0xd27d('0x3')](_0x3c1ab5,_0x5c09f3);};}function removeListener(_0x47e0b0,_0x4f35fe){return function(){TeamEvents[_0xd27d('0x4')](_0x47e0b0,_0x4f35fe);};}exports[_0xd27d('0x5')]=function(_0x57f9df){for(var _0x1485e7=0x0,_0x2c917e=events[_0xd27d('0x6')];_0x1485e7<_0x2c917e;_0x1485e7++){var _0x1cc3f8=events[_0x1485e7];var _0x5154dd=createListener(_0xd27d('0x7')+_0x1cc3f8,_0x57f9df);TeamEvents['on'](_0x1cc3f8,_0x5154dd);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e11a104..6262dbd 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 _0x2141=['INTEGER','sequelize','exports'];(function(_0x514b14,_0x2b20ee){var _0x47aa2b=function(_0x1f3b43){while(--_0x1f3b43){_0x514b14['push'](_0x514b14['shift']());}};_0x47aa2b(++_0x2b20ee);}(_0x2141,0x1ba));var _0x1214=function(_0x9e7cd9,_0x1942a2){_0x9e7cd9=_0x9e7cd9-0x0;var _0xa3dc2b=_0x2141[_0x9e7cd9];return _0xa3dc2b;};'use strict';var Sequelize=require(_0x1214('0x0'));module[_0x1214('0x1')]={'TeamId':{'type':Sequelize[_0x1214('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1214('0x2')]}}; \ No newline at end of file +var _0x1752=['INTEGER','exports'];(function(_0x1704d5,_0x1f1740){var _0x58b71d=function(_0x252c42){while(--_0x252c42){_0x1704d5['push'](_0x1704d5['shift']());}};_0x58b71d(++_0x1f1740);}(_0x1752,0xa5));var _0x2175=function(_0x4fab47,_0x3c43b6){_0x4fab47=_0x4fab47-0x0;var _0x34a394=_0x1752[_0x4fab47];return _0x34a394;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'TeamId':{'type':Sequelize[_0x2175('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2175('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d7c9730..a3cef00 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 _0x2cae=['../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','lodash','util','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cae,0x16b));var _0xe2ca=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x2cae[_0x59e821];return _0x5333f6;};'use strict';var _=require(_0xe2ca('0x0'));var util=require(_0xe2ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe2ca('0x2'));var BPromise=require(_0xe2ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2ca('0x4'));var rimraf=require(_0xe2ca('0x5'));var config=require(_0xe2ca('0x6'));var attributes=require(_0xe2ca('0x7'));module['exports']=function(_0x2b4c70,_0x3cabde){return _0x2b4c70['define'](_0xe2ca('0x8'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x866a=['rimraf','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','path'];(function(_0x114356,_0x561b7a){var _0xd46fa7=function(_0x4b93ef){while(--_0x4b93ef){_0x114356['push'](_0x114356['shift']());}};_0xd46fa7(++_0x561b7a);}(_0x866a,0x156));var _0xa866=function(_0x2c32ad,_0x1a12d4){_0x2c32ad=_0x2c32ad-0x0;var _0x1d474f=_0x866a[_0x2c32ad];return _0x1d474f;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var logger=require(_0xa866('0x1'))(_0xa866('0x2'));var moment=require(_0xa866('0x3'));var BPromise=require(_0xa866('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa866('0x5'));var rimraf=require(_0xa866('0x6'));var config=require(_0xa866('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xa866('0x8')]=function(_0x31a017,_0x1ea4de){return _0x31a017[_0xa866('0x9')](_0xa866('0xa'),attributes,{'tableName':_0xa866('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 7faa824..c8be9ec 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x50b57f,_0x2f01e9){var _0x4386fd=function(_0x9aa517){while(--_0x9aa517){_0x50b57f['push'](_0x50b57f['shift']());}};_0x4386fd(++_0x2f01e9);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x35f5a5,_0x3f8a65){var _0x143dce=function(_0x5c3197){while(--_0x5c3197){_0x35f5a5['push'](_0x35f5a5['shift']());}};_0x143dce(++_0x3f8a65);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 790ded7..da4145c 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 _0xf368=['INTEGER','sequelize'];(function(_0x2d5887,_0xace828){var _0x257084=function(_0x457e3a){while(--_0x457e3a){_0x2d5887['push'](_0x2d5887['shift']());}};_0x257084(++_0xace828);}(_0xf368,0x175));var _0x8f36=function(_0x33645f,_0x1f72e0){_0x33645f=_0x33645f-0x0;var _0x360eea=_0xf368[_0x33645f];return _0x360eea;};'use strict';var Sequelize=require(_0x8f36('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8f36('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x78b2=['sequelize','exports','INTEGER'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x78b2,0x7e));var _0x278b=function(_0x440e4b,_0x498759){_0x440e4b=_0x440e4b-0x0;var _0x46a09f=_0x78b2[_0x440e4b];return _0x46a09f;};'use strict';var Sequelize=require(_0x278b('0x0'));module[_0x278b('0x1')]={'penalty':{'type':Sequelize[_0x278b('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 0d69570..0486918 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 _0x3c70=['../../config/environment','exports','define','TeamVoiceQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a077b,_0x5c893d){var _0xc9d88=function(_0x4e1175){while(--_0x4e1175){_0x4a077b['push'](_0x4a077b['shift']());}};_0xc9d88(++_0x5c893d);}(_0x3c70,0x10c));var _0x03c7=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x3c70[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ce=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','TeamVoiceQueue','util','api','moment'];(function(_0x23615e,_0x3d7c79){var _0x5a7e3b=function(_0x44de59){while(--_0x44de59){_0x23615e['push'](_0x23615e['shift']());}};_0x5a7e3b(++_0x3d7c79);}(_0xd2ce,0x13c));var _0xed2c=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xd2ce[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var logger=require('../../config/logger')(_0xed2c('0x1'));var moment=require(_0xed2c('0x2'));var BPromise=require(_0xed2c('0x3'));var rp=require(_0xed2c('0x4'));var fs=require('fs');var path=require(_0xed2c('0x5'));var rimraf=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var attributes=require('./teamVoiceQueue.attributes');module[_0xed2c('0x8')]=function(_0x5b6ccb,_0x38aa25){return _0x5b6ccb[_0xed2c('0x9')](_0xed2c('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index ba83a73..f971fce 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 _0x27e6=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x27e6,0x121));var _0x627e=function(_0x5144cd,_0x37ee07){_0x5144cd=_0x5144cd-0x0;var _0xe5bd11=_0x27e6[_0x5144cd];return _0xe5bd11;};'use strict';var _=require(_0x627e('0x0'));var util=require(_0x627e('0x1'));var moment=require(_0x627e('0x2'));var BPromise=require(_0x627e('0x3'));var rs=require(_0x627e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x627e('0x5'))['db'];var utils=require(_0x627e('0x6'));var logger=require(_0x627e('0x7'))(_0x627e('0x8'));var config=require('../../config/environment');var jayson=require(_0x627e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x169230,_0x33dc07,_0x20412c){return new BPromise(function(_0x1733e5,_0x34c2f4){return client['request'](_0x169230,_0x20412c)[_0x627e('0xa')](function(_0x4440a7){logger[_0x627e('0xb')](_0x627e('0xc'),_0x33dc07,'request\x20sent');logger[_0x627e('0xd')](_0x627e('0xe'),_0x33dc07,_0x627e('0xf'),JSON[_0x627e('0x10')](_0x4440a7));if(_0x4440a7[_0x627e('0x11')]){if(_0x4440a7[_0x627e('0x11')][_0x627e('0x12')]===0x1f4){logger[_0x627e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33dc07,_0x4440a7[_0x627e('0x11')][_0x627e('0x13')]);return _0x34c2f4(_0x4440a7[_0x627e('0x11')]['message']);}logger[_0x627e('0x11')](_0x627e('0xc'),_0x33dc07,_0x4440a7[_0x627e('0x11')]['message']);return _0x1733e5(_0x4440a7[_0x627e('0x11')]['message']);}else{logger[_0x627e('0xb')](_0x627e('0xc'),_0x33dc07,'request\x20sent');_0x1733e5(_0x4440a7[_0x627e('0x14')]['message']);}})[_0x627e('0x15')](function(_0x3f8715){logger['error'](_0x627e('0xc'),_0x33dc07,_0x3f8715);_0x34c2f4(_0x3f8715);});});} \ No newline at end of file +var _0xcb18=['code','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4bc532,_0x42f9c5){var _0x2b20f1=function(_0x4a9c95){while(--_0x4a9c95){_0x4bc532['push'](_0x4bc532['shift']());}};_0x2b20f1(++_0x42f9c5);}(_0xcb18,0x159));var _0x8cb1=function(_0x567569,_0x4e3b4f){_0x567569=_0x567569-0x0;var _0xcbe051=_0xcb18[_0x567569];return _0xcbe051;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cb1('0x0'));var BPromise=require('bluebird');var rs=require(_0x8cb1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb1('0x2'))['db'];var utils=require(_0x8cb1('0x3'));var logger=require(_0x8cb1('0x4'))(_0x8cb1('0x5'));var config=require(_0x8cb1('0x6'));var jayson=require(_0x8cb1('0x7'));var client=jayson['client'][_0x8cb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x335e41,_0x55ca24,_0x186f71){return new BPromise(function(_0x510e92,_0x34dbbb){return client[_0x8cb1('0x9')](_0x335e41,_0x186f71)['then'](function(_0xc6491b){logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,_0x8cb1('0xc'));logger[_0x8cb1('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x55ca24,_0x8cb1('0xc'),JSON[_0x8cb1('0xe')](_0xc6491b));if(_0xc6491b[_0x8cb1('0xf')]){if(_0xc6491b['error'][_0x8cb1('0x10')]===0x1f4){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x34dbbb(_0xc6491b[_0x8cb1('0xf')]['message']);}logger[_0x8cb1('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x510e92(_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);}else{logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,'request\x20sent');_0x510e92(_0xc6491b[_0x8cb1('0x12')]['message']);}})['catch'](function(_0x557fb5){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0x557fb5);_0x34dbbb(_0x557fb5);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index e36b2d2..f3cf809 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 _0xb5f3=['create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./template.controller','get','isAuthenticated','/:id','show'];(function(_0x103d2d,_0x1e8172){var _0x4f3fc0=function(_0x5563be){while(--_0x5563be){_0x103d2d['push'](_0x103d2d['shift']());}};_0x4f3fc0(++_0x1e8172);}(_0xb5f3,0x137));var _0x3b5f=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xb5f3[_0x4099ee];return _0x1b7bfc;};'use strict';var multer=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var path=require(_0x3b5f('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b5f('0x3'));var router=express[_0x3b5f('0x4')]();var fs_extra=require(_0x3b5f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b5f('0x6'));var controller=require(_0x3b5f('0x7'));router[_0x3b5f('0x8')]('/',auth[_0x3b5f('0x9')](),controller['index']);router[_0x3b5f('0x8')](_0x3b5f('0xa'),auth['isAuthenticated'](),controller[_0x3b5f('0xb')]);router['post']('/',auth[_0x3b5f('0x9')](),controller[_0x3b5f('0xc')]);router[_0x3b5f('0xd')](_0x3b5f('0xa'),auth['isAuthenticated'](),controller[_0x3b5f('0xe')]);router[_0x3b5f('0xf')](_0x3b5f('0xa'),auth[_0x3b5f('0x9')](),controller[_0x3b5f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x56b9=['isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./template.controller','get','index','/:id'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x56b9,0x196));var _0x956b=function(_0x596fca,_0x561214){_0x596fca=_0x596fca-0x0;var _0x1e64f1=_0x56b9[_0x596fca];return _0x1e64f1;};'use strict';var multer=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var path=require(_0x956b('0x2'));var timeout=require(_0x956b('0x3'));var express=require(_0x956b('0x4'));var router=express[_0x956b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x956b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x956b('0x7'));var controller=require(_0x956b('0x8'));router[_0x956b('0x9')]('/',auth['isAuthenticated'](),controller[_0x956b('0xa')]);router[_0x956b('0x9')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0xd')]);router[_0x956b('0xe')]('/',auth[_0x956b('0xc')](),controller[_0x956b('0xf')]);router['put'](_0x956b('0xb'),auth[_0x956b('0xc')](),controller['update']);router[_0x956b('0x10')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0x11')]);module[_0x956b('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 513a685..adaac07 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 _0x96bd=['exports','STRING'];(function(_0x35b2a5,_0x2a2ea1){var _0xdb3fb8=function(_0x3ca842){while(--_0x3ca842){_0x35b2a5['push'](_0x35b2a5['shift']());}};_0xdb3fb8(++_0x2a2ea1);}(_0x96bd,0x18a));var _0xd96b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x96bd[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xd96b('0x0')]={'name':{'type':Sequelize[_0xd96b('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x38a6=['sequelize','exports','STRING','TEXT'];(function(_0x2ac8aa,_0x9b30fb){var _0x2ed2d2=function(_0x45789a){while(--_0x45789a){_0x2ac8aa['push'](_0x2ac8aa['shift']());}};_0x2ed2d2(++_0x9b30fb);}(_0x38a6,0xb0));var _0x638a=function(_0x51e15a,_0x8d4d12){_0x51e15a=_0x51e15a-0x0;var _0x3c0868=_0x38a6[_0x51e15a];return _0x3c0868;};'use strict';var Sequelize=require(_0x638a('0x0'));module[_0x638a('0x1')]={'name':{'type':Sequelize[_0x638a('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x638a('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9ce426c..f3b445c 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 _0xcb88=['lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','Template','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','filter','includeAll','findAll','show','rawAttributes','include','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x5b5e9b,_0xe289fa){var _0x4ab979=function(_0x3ee1e6){while(--_0x3ee1e6){_0x5b5e9b['push'](_0x5b5e9b['shift']());}};_0x4ab979(++_0xe289fa);}(_0xcb88,0x1b7));var _0x8cb8=function(_0x1e4fae,_0x5893ce){_0x1e4fae=_0x1e4fae-0x0;var _0x5ccc9c=_0xcb88[_0x1e4fae];return _0x5ccc9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cb8('0x0'));var zipdir=require(_0x8cb8('0x1'));var jsonpatch=require(_0x8cb8('0x2'));var rp=require('request-promise');var moment=require(_0x8cb8('0x3'));var BPromise=require(_0x8cb8('0x4'));var Mustache=require(_0x8cb8('0x5'));var util=require(_0x8cb8('0x6'));var path=require(_0x8cb8('0x7'));var sox=require(_0x8cb8('0x8'));var csv=require(_0x8cb8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cb8('0xa'));var _=require(_0x8cb8('0xb'));var squel=require(_0x8cb8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8cb8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8cb8('0xe'));var Papa=require(_0x8cb8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cb8('0x10'));var hardwareService=require(_0x8cb8('0x11'));var logger=require(_0x8cb8('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8cb8('0x13'));var db=require(_0x8cb8('0x14'))['db'];function respondWithStatusCode(_0x4577fb,_0x1121a3){_0x1121a3=_0x1121a3||0xcc;return function(_0x203483){if(_0x203483){return _0x4577fb[_0x8cb8('0x15')](_0x1121a3);}return _0x4577fb[_0x8cb8('0x16')](_0x1121a3)[_0x8cb8('0x17')]();};}function respondWithResult(_0x3f546a,_0x4f82f6){_0x4f82f6=_0x4f82f6||0xc8;return function(_0x301b85){if(_0x301b85){return _0x3f546a[_0x8cb8('0x16')](_0x4f82f6)[_0x8cb8('0x18')](_0x301b85);}};}function respondWithFilteredResult(_0x39d7d2,_0x5e1a15){return function(_0x36b5bf){if(_0x36b5bf){var _0x10a920=typeof _0x5e1a15['offset']===_0x8cb8('0x19')&&typeof _0x5e1a15[_0x8cb8('0x1a')]===_0x8cb8('0x19');var _0x9f54f6=_0x36b5bf[_0x8cb8('0x1b')];var _0x4d6de3=_0x10a920?0x0:_0x5e1a15[_0x8cb8('0x1c')];var _0x2d0755=_0x10a920?_0x36b5bf[_0x8cb8('0x1b')]:_0x5e1a15['offset']+_0x5e1a15['limit'];var _0x577c3c;if(_0x2d0755>=_0x9f54f6){_0x2d0755=_0x9f54f6;_0x577c3c=0xc8;}else{_0x577c3c=0xce;}_0x39d7d2['status'](_0x577c3c);return _0x39d7d2[_0x8cb8('0x1d')](_0x8cb8('0x1e'),_0x4d6de3+'-'+_0x2d0755+'/'+_0x9f54f6)[_0x8cb8('0x18')](_0x36b5bf);}return null;};}function patchUpdates(_0x208784){return function(_0x56d7f3){try{jsonpatch['apply'](_0x56d7f3,_0x208784,!![]);}catch(_0x4665ff){return BPromise['reject'](_0x4665ff);}return _0x56d7f3['save']();};}function saveUpdates(_0xe1213c,_0x1ff54f){return function(_0x30e16f){if(_0x30e16f){return _0x30e16f[_0x8cb8('0x1f')](_0xe1213c)['then'](function(_0xcda30a){return _0xcda30a;});}return null;};}function removeEntity(_0x334ca9,_0x9c7917){return function(_0x3795c7){if(_0x3795c7){return _0x3795c7[_0x8cb8('0x20')]()['then'](function(){var _0x101821=_0x3795c7[_0x8cb8('0x21')]({'plain':!![]});var _0x8bfea7='Templates';return db[_0x8cb8('0x22')][_0x8cb8('0x20')]({'where':{'type':_0x8bfea7,'resourceId':_0x101821['id']}})[_0x8cb8('0x23')](function(){return _0x3795c7;});})[_0x8cb8('0x23')](function(){_0x334ca9[_0x8cb8('0x16')](0xcc)[_0x8cb8('0x17')]();});}};}function handleEntityNotFound(_0x2dc156,_0x7e33cb){return function(_0x387df0){if(!_0x387df0){_0x2dc156[_0x8cb8('0x15')](0x194);}return _0x387df0;};}function handleError(_0x419367,_0x5f0592){_0x5f0592=_0x5f0592||0x1f4;return function(_0xbb8411){logger[_0x8cb8('0x24')](_0xbb8411[_0x8cb8('0x25')]);if(_0xbb8411[_0x8cb8('0x26')]){delete _0xbb8411[_0x8cb8('0x26')];}_0x419367[_0x8cb8('0x16')](_0x5f0592)[_0x8cb8('0x27')](_0xbb8411);};}exports[_0x8cb8('0x28')]=function(_0x208976,_0x33feb2){var _0xd6b53f={},_0x1250af={},_0x41549f={'count':0x0,'rows':[]};var _0x372c92=_['map'](db[_0x8cb8('0x29')]['rawAttributes'],function(_0x233dad){return{'name':_0x233dad['fieldName'],'type':_0x233dad[_0x8cb8('0x2a')][_0x8cb8('0x2b')]};});_0x1250af[_0x8cb8('0x2c')]=_[_0x8cb8('0x2d')](_0x372c92,'name');_0x1250af[_0x8cb8('0x2e')]=_[_0x8cb8('0x2f')](_0x208976['query']);_0x1250af[_0x8cb8('0x30')]=_[_0x8cb8('0x31')](_0x1250af['model'],_0x1250af['query']);_0xd6b53f[_0x8cb8('0x32')]=_[_0x8cb8('0x31')](_0x1250af['model'],qs[_0x8cb8('0x33')](_0x208976[_0x8cb8('0x2e')][_0x8cb8('0x33')]));_0xd6b53f['attributes']=_0xd6b53f[_0x8cb8('0x32')][_0x8cb8('0x34')]?_0xd6b53f['attributes']:_0x1250af['model'];if(!_0x208976[_0x8cb8('0x2e')][_0x8cb8('0x35')]('nolimit')){_0xd6b53f[_0x8cb8('0x1a')]=qs[_0x8cb8('0x1a')](_0x208976['query'][_0x8cb8('0x1a')]);_0xd6b53f[_0x8cb8('0x1c')]=qs[_0x8cb8('0x1c')](_0x208976['query'][_0x8cb8('0x1c')]);}_0xd6b53f[_0x8cb8('0x36')]=qs['sort'](_0x208976['query'][_0x8cb8('0x37')]);_0xd6b53f['where']=qs[_0x8cb8('0x30')](_[_0x8cb8('0x38')](_0x208976[_0x8cb8('0x2e')],_0x1250af[_0x8cb8('0x30')]),_0x372c92);if(_0x208976[_0x8cb8('0x2e')]['filter']){_0xd6b53f[_0x8cb8('0x39')]=_['merge'](_0xd6b53f[_0x8cb8('0x39')],{'$or':_[_0x8cb8('0x2d')](_0x372c92,function(_0x51abbc){if(_0x51abbc[_0x8cb8('0x2a')]!=='VIRTUAL'){var _0x4ad11b={};_0x4ad11b[_0x51abbc[_0x8cb8('0x26')]]={'$like':'%'+_0x208976[_0x8cb8('0x2e')][_0x8cb8('0x3a')]+'%'};return _0x4ad11b;}})});}_0xd6b53f=_['merge']({},_0xd6b53f,_0x208976['options']);var _0x42abb7={'where':_0xd6b53f[_0x8cb8('0x39')]};return db[_0x8cb8('0x29')][_0x8cb8('0x1b')](_0x42abb7)[_0x8cb8('0x23')](function(_0x2a003e){_0x41549f['count']=_0x2a003e;if(_0x208976[_0x8cb8('0x2e')][_0x8cb8('0x3b')]){_0xd6b53f['include']=[{'all':!![]}];}return db[_0x8cb8('0x29')][_0x8cb8('0x3c')](_0xd6b53f);})['then'](function(_0x1de08b){_0x41549f['rows']=_0x1de08b;return _0x41549f;})[_0x8cb8('0x23')](respondWithFilteredResult(_0x33feb2,_0xd6b53f))['catch'](handleError(_0x33feb2,null));};exports[_0x8cb8('0x3d')]=function(_0x2ce3af,_0x4b36df){var _0x516445={'raw':!![],'where':{'id':_0x2ce3af['params']['id']}},_0x4ac5f9={};_0x4ac5f9[_0x8cb8('0x2c')]=_['keys'](db['Template'][_0x8cb8('0x3e')]);_0x4ac5f9[_0x8cb8('0x2e')]=_['keys'](_0x2ce3af[_0x8cb8('0x2e')]);_0x4ac5f9[_0x8cb8('0x30')]=_['intersection'](_0x4ac5f9['model'],_0x4ac5f9[_0x8cb8('0x2e')]);_0x516445[_0x8cb8('0x32')]=_[_0x8cb8('0x31')](_0x4ac5f9[_0x8cb8('0x2c')],qs[_0x8cb8('0x33')](_0x2ce3af[_0x8cb8('0x2e')][_0x8cb8('0x33')]));_0x516445[_0x8cb8('0x32')]=_0x516445[_0x8cb8('0x32')][_0x8cb8('0x34')]?_0x516445['attributes']:_0x4ac5f9['model'];if(_0x2ce3af[_0x8cb8('0x2e')][_0x8cb8('0x3b')]){_0x516445[_0x8cb8('0x3f')]=[{'all':!![]}];}_0x516445=_[_0x8cb8('0x40')]({},_0x516445,_0x2ce3af['options']);return db[_0x8cb8('0x29')][_0x8cb8('0x41')](_0x516445)['then'](handleEntityNotFound(_0x4b36df,null))[_0x8cb8('0x23')](respondWithResult(_0x4b36df,null))[_0x8cb8('0x42')](handleError(_0x4b36df,null));};exports['create']=function(_0x621a02,_0x5eb922){return db['Template'][_0x8cb8('0x43')](_0x621a02[_0x8cb8('0x44')],{})[_0x8cb8('0x23')](function(_0x4edf66){var _0x2e66e7=_0x621a02[_0x8cb8('0x45')]['get']({'plain':!![]});if(!_0x2e66e7)throw new Error(_0x8cb8('0x46'));if(_0x2e66e7['role']===_0x8cb8('0x45')){var _0x36a4fc=_0x4edf66[_0x8cb8('0x21')]({'plain':!![]});var _0x2c5178='Templates';return db[_0x8cb8('0x47')][_0x8cb8('0x41')]({'where':{'name':_0x2c5178,'userProfileId':_0x2e66e7['userProfileId']},'raw':!![]})['then'](function(_0x4f351b){if(_0x4f351b&&_0x4f351b[_0x8cb8('0x48')]===0x0){return db[_0x8cb8('0x22')][_0x8cb8('0x43')]({'name':_0x36a4fc[_0x8cb8('0x26')],'resourceId':_0x36a4fc['id'],'type':_0x4f351b['name'],'sectionId':_0x4f351b['id']},{})[_0x8cb8('0x23')](function(){return _0x4edf66;});}else{return _0x4edf66;}})[_0x8cb8('0x42')](function(_0x2baf03){logger[_0x8cb8('0x24')](_0x8cb8('0x49'),_0x2baf03);throw _0x2baf03;});}return _0x4edf66;})['then'](respondWithResult(_0x5eb922,0xc9))['catch'](handleError(_0x5eb922,null));};exports[_0x8cb8('0x1f')]=function(_0x462074,_0xa7f001){if(_0x462074[_0x8cb8('0x44')]['id']){delete _0x462074[_0x8cb8('0x44')]['id'];}return db['Template'][_0x8cb8('0x41')]({'where':{'id':_0x462074[_0x8cb8('0x4a')]['id']}})[_0x8cb8('0x23')](handleEntityNotFound(_0xa7f001,null))[_0x8cb8('0x23')](saveUpdates(_0x462074[_0x8cb8('0x44')],null))[_0x8cb8('0x23')](respondWithResult(_0xa7f001,null))[_0x8cb8('0x42')](handleError(_0xa7f001,null));};exports[_0x8cb8('0x20')]=function(_0x47ab95,_0x31e1e5){return db[_0x8cb8('0x29')]['find']({'where':{'id':_0x47ab95[_0x8cb8('0x4a')]['id']}})[_0x8cb8('0x23')](handleEntityNotFound(_0x31e1e5,null))[_0x8cb8('0x23')](removeEntity(_0x31e1e5,null))[_0x8cb8('0x42')](handleError(_0x31e1e5,null));}; \ No newline at end of file +var _0x6805=['user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6805,0x10d));var _0x5680=function(_0x16ad5a,_0x103565){_0x16ad5a=_0x16ad5a-0x0;var _0x108a4d=_0x6805[_0x16ad5a];return _0x108a4d;};'use strict';var emlformat=require(_0x5680('0x0'));var rimraf=require(_0x5680('0x1'));var zipdir=require(_0x5680('0x2'));var jsonpatch=require(_0x5680('0x3'));var rp=require(_0x5680('0x4'));var moment=require(_0x5680('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5680('0x6'));var util=require(_0x5680('0x7'));var path=require(_0x5680('0x8'));var sox=require(_0x5680('0x9'));var csv=require(_0x5680('0xa'));var ejs=require(_0x5680('0xb'));var fs=require('fs');var fs_extra=require(_0x5680('0xc'));var _=require(_0x5680('0xd'));var squel=require(_0x5680('0xe'));var crypto=require(_0x5680('0xf'));var jsforce=require(_0x5680('0x10'));var deskjs=require(_0x5680('0x11'));var toCsv=require(_0x5680('0xa'));var querystring=require(_0x5680('0x12'));var Papa=require(_0x5680('0x13'));var Redis=require(_0x5680('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5680('0x15'));var as=require(_0x5680('0x16'));var hardwareService=require(_0x5680('0x17'));var logger=require(_0x5680('0x18'))(_0x5680('0x19'));var utils=require(_0x5680('0x1a'));var config=require(_0x5680('0x1b'));var licenseUtil=require(_0x5680('0x1c'));var db=require(_0x5680('0x1d'))['db'];function respondWithStatusCode(_0x4d2de1,_0x24f6f6){_0x24f6f6=_0x24f6f6||0xcc;return function(_0x2b8d4c){if(_0x2b8d4c){return _0x4d2de1[_0x5680('0x1e')](_0x24f6f6);}return _0x4d2de1['status'](_0x24f6f6)[_0x5680('0x1f')]();};}function respondWithResult(_0x352136,_0x340983){_0x340983=_0x340983||0xc8;return function(_0x249eaa){if(_0x249eaa){return _0x352136[_0x5680('0x20')](_0x340983)[_0x5680('0x21')](_0x249eaa);}};}function respondWithFilteredResult(_0x21a2c4,_0x1f8995){return function(_0x318d29){if(_0x318d29){var _0x2147d5=typeof _0x1f8995[_0x5680('0x22')]===_0x5680('0x23')&&typeof _0x1f8995[_0x5680('0x24')]===_0x5680('0x23');var _0x18fd4e=_0x318d29['count'];var _0x23acba=_0x2147d5?0x0:_0x1f8995[_0x5680('0x22')];var _0x6248f3=_0x2147d5?_0x318d29['count']:_0x1f8995[_0x5680('0x22')]+_0x1f8995[_0x5680('0x24')];var _0x502554;if(_0x6248f3>=_0x18fd4e){_0x6248f3=_0x18fd4e;_0x502554=0xc8;}else{_0x502554=0xce;}_0x21a2c4[_0x5680('0x20')](_0x502554);return _0x21a2c4[_0x5680('0x25')]('Content-Range',_0x23acba+'-'+_0x6248f3+'/'+_0x18fd4e)['json'](_0x318d29);}return null;};}function patchUpdates(_0xed9703){return function(_0xc6d5ac){try{jsonpatch[_0x5680('0x26')](_0xc6d5ac,_0xed9703,!![]);}catch(_0x315e93){return BPromise[_0x5680('0x27')](_0x315e93);}return _0xc6d5ac[_0x5680('0x28')]();};}function saveUpdates(_0x185525,_0x49161f){return function(_0x1de434){if(_0x1de434){return _0x1de434[_0x5680('0x29')](_0x185525)[_0x5680('0x2a')](function(_0x38bf6c){return _0x38bf6c;});}return null;};}function removeEntity(_0x4f38b0,_0x3068ad){return function(_0x371701){if(_0x371701){return _0x371701[_0x5680('0x2b')]()[_0x5680('0x2a')](function(){var _0x4758ed=_0x371701[_0x5680('0x2c')]({'plain':!![]});var _0x414210=_0x5680('0x2d');return db[_0x5680('0x2e')][_0x5680('0x2b')]({'where':{'type':_0x414210,'resourceId':_0x4758ed['id']}})['then'](function(){return _0x371701;});})['then'](function(){_0x4f38b0['status'](0xcc)[_0x5680('0x1f')]();});}};}function handleEntityNotFound(_0x3025fb,_0x2d0325){return function(_0x1c8043){if(!_0x1c8043){_0x3025fb[_0x5680('0x1e')](0x194);}return _0x1c8043;};}function handleError(_0x575228,_0x4b3a52){_0x4b3a52=_0x4b3a52||0x1f4;return function(_0x5b74e4){logger[_0x5680('0x2f')](_0x5b74e4[_0x5680('0x30')]);if(_0x5b74e4[_0x5680('0x31')]){delete _0x5b74e4[_0x5680('0x31')];}_0x575228[_0x5680('0x20')](_0x4b3a52)[_0x5680('0x32')](_0x5b74e4);};}exports[_0x5680('0x33')]=function(_0x35729e,_0x48e2e1){var _0x203332={},_0x275fac={},_0xe7cbe9={'count':0x0,'rows':[]};var _0x8f22f2=_[_0x5680('0x34')](db[_0x5680('0x35')][_0x5680('0x36')],function(_0x38dd1f){return{'name':_0x38dd1f[_0x5680('0x37')],'type':_0x38dd1f[_0x5680('0x38')][_0x5680('0x39')]};});_0x275fac['model']=_[_0x5680('0x34')](_0x8f22f2,'name');_0x275fac['query']=_[_0x5680('0x3a')](_0x35729e[_0x5680('0x3b')]);_0x275fac[_0x5680('0x3c')]=_[_0x5680('0x3d')](_0x275fac[_0x5680('0x3e')],_0x275fac[_0x5680('0x3b')]);_0x203332[_0x5680('0x3f')]=_[_0x5680('0x3d')](_0x275fac[_0x5680('0x3e')],qs[_0x5680('0x40')](_0x35729e[_0x5680('0x3b')][_0x5680('0x40')]));_0x203332[_0x5680('0x3f')]=_0x203332[_0x5680('0x3f')][_0x5680('0x41')]?_0x203332[_0x5680('0x3f')]:_0x275fac['model'];if(!_0x35729e[_0x5680('0x3b')][_0x5680('0x42')](_0x5680('0x43'))){_0x203332[_0x5680('0x24')]=qs[_0x5680('0x24')](_0x35729e['query'][_0x5680('0x24')]);_0x203332['offset']=qs[_0x5680('0x22')](_0x35729e['query'][_0x5680('0x22')]);}_0x203332['order']=qs[_0x5680('0x44')](_0x35729e[_0x5680('0x3b')]['sort']);_0x203332[_0x5680('0x45')]=qs[_0x5680('0x3c')](_[_0x5680('0x46')](_0x35729e[_0x5680('0x3b')],_0x275fac[_0x5680('0x3c')]),_0x8f22f2);if(_0x35729e[_0x5680('0x3b')][_0x5680('0x47')]){_0x203332[_0x5680('0x45')]=_[_0x5680('0x48')](_0x203332['where'],{'$or':_[_0x5680('0x34')](_0x8f22f2,function(_0x40c348){if(_0x40c348[_0x5680('0x38')]!==_0x5680('0x49')){var _0x1fc4af={};_0x1fc4af[_0x40c348['name']]={'$like':'%'+_0x35729e[_0x5680('0x3b')][_0x5680('0x47')]+'%'};return _0x1fc4af;}})});}_0x203332=_[_0x5680('0x48')]({},_0x203332,_0x35729e[_0x5680('0x4a')]);var _0x70b3d6={'where':_0x203332['where']};return db[_0x5680('0x35')][_0x5680('0x4b')](_0x70b3d6)['then'](function(_0x751078){_0xe7cbe9[_0x5680('0x4b')]=_0x751078;if(_0x35729e['query']['includeAll']){_0x203332[_0x5680('0x4c')]=[{'all':!![]}];}return db[_0x5680('0x35')]['findAll'](_0x203332);})[_0x5680('0x2a')](function(_0x1698d6){_0xe7cbe9['rows']=_0x1698d6;return _0xe7cbe9;})[_0x5680('0x2a')](respondWithFilteredResult(_0x48e2e1,_0x203332))[_0x5680('0x4d')](handleError(_0x48e2e1,null));};exports['show']=function(_0x59a901,_0xeff476){var _0x526da5={'raw':!![],'where':{'id':_0x59a901[_0x5680('0x4e')]['id']}},_0x3dcc26={};_0x3dcc26[_0x5680('0x3e')]=_['keys'](db[_0x5680('0x35')][_0x5680('0x36')]);_0x3dcc26[_0x5680('0x3b')]=_[_0x5680('0x3a')](_0x59a901[_0x5680('0x3b')]);_0x3dcc26['filters']=_[_0x5680('0x3d')](_0x3dcc26[_0x5680('0x3e')],_0x3dcc26['query']);_0x526da5[_0x5680('0x3f')]=_['intersection'](_0x3dcc26[_0x5680('0x3e')],qs['fields'](_0x59a901[_0x5680('0x3b')][_0x5680('0x40')]));_0x526da5['attributes']=_0x526da5['attributes']['length']?_0x526da5['attributes']:_0x3dcc26[_0x5680('0x3e')];if(_0x59a901[_0x5680('0x3b')]['includeAll']){_0x526da5[_0x5680('0x4c')]=[{'all':!![]}];}_0x526da5=_[_0x5680('0x48')]({},_0x526da5,_0x59a901['options']);return db[_0x5680('0x35')]['find'](_0x526da5)[_0x5680('0x2a')](handleEntityNotFound(_0xeff476,null))[_0x5680('0x2a')](respondWithResult(_0xeff476,null))[_0x5680('0x4d')](handleError(_0xeff476,null));};exports['create']=function(_0xdf459b,_0x4e94e6){return db[_0x5680('0x35')][_0x5680('0x4f')](_0xdf459b[_0x5680('0x50')],{})[_0x5680('0x2a')](function(_0x2be905){var _0xe7e30=_0xdf459b['user'][_0x5680('0x2c')]({'plain':!![]});if(!_0xe7e30)throw new Error(_0x5680('0x51'));if(_0xe7e30[_0x5680('0x52')]===_0x5680('0x53')){var _0x20b46f=_0x2be905[_0x5680('0x2c')]({'plain':!![]});var _0x2b89d9=_0x5680('0x2d');return db[_0x5680('0x54')]['find']({'where':{'name':_0x2b89d9,'userProfileId':_0xe7e30[_0x5680('0x55')]},'raw':!![]})[_0x5680('0x2a')](function(_0x64efc4){if(_0x64efc4&&_0x64efc4[_0x5680('0x56')]===0x0){return db[_0x5680('0x2e')]['create']({'name':_0x20b46f[_0x5680('0x31')],'resourceId':_0x20b46f['id'],'type':_0x64efc4[_0x5680('0x31')],'sectionId':_0x64efc4['id']},{})[_0x5680('0x2a')](function(){return _0x2be905;});}else{return _0x2be905;}})[_0x5680('0x4d')](function(_0x2844ff){logger[_0x5680('0x2f')](_0x5680('0x57'),_0x2844ff);throw _0x2844ff;});}return _0x2be905;})[_0x5680('0x2a')](respondWithResult(_0x4e94e6,0xc9))['catch'](handleError(_0x4e94e6,null));};exports[_0x5680('0x29')]=function(_0x51a73d,_0x590a26){if(_0x51a73d[_0x5680('0x50')]['id']){delete _0x51a73d[_0x5680('0x50')]['id'];}return db['Template']['find']({'where':{'id':_0x51a73d[_0x5680('0x4e')]['id']}})[_0x5680('0x2a')](handleEntityNotFound(_0x590a26,null))[_0x5680('0x2a')](saveUpdates(_0x51a73d['body'],null))[_0x5680('0x2a')](respondWithResult(_0x590a26,null))[_0x5680('0x4d')](handleError(_0x590a26,null));};exports[_0x5680('0x2b')]=function(_0x352f05,_0x545d49){return db[_0x5680('0x35')]['find']({'where':{'id':_0x352f05[_0x5680('0x4e')]['id']}})['then'](handleEntityNotFound(_0x545d49,null))[_0x5680('0x2a')](removeEntity(_0x545d49,null))[_0x5680('0x4d')](handleError(_0x545d49,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 660fe22..911ea5f 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 _0x8684=['exports','define','Template','tools_templates','util','api','moment','rimraf','../../config/environment','./template.attributes'];(function(_0x51d27e,_0x2876d8){var _0x26d424=function(_0x42a5ba){while(--_0x42a5ba){_0x51d27e['push'](_0x51d27e['shift']());}};_0x26d424(++_0x2876d8);}(_0x8684,0xcc));var _0x4868=function(_0xe34c3f,_0x55b113){_0xe34c3f=_0xe34c3f-0x0;var _0xfa74be=_0x8684[_0xe34c3f];return _0xfa74be;};'use strict';var _=require('lodash');var util=require(_0x4868('0x0'));var logger=require('../../config/logger')(_0x4868('0x1'));var moment=require(_0x4868('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4868('0x3'));var config=require(_0x4868('0x4'));var attributes=require(_0x4868('0x5'));module[_0x4868('0x6')]=function(_0x47c5e1,_0x38f976){return _0x47c5e1[_0x4868('0x7')](_0x4868('0x8'),attributes,{'tableName':_0x4868('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa65=['Template','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes'];(function(_0x3d107e,_0x53fa04){var _0x443c0f=function(_0x4a3ecf){while(--_0x4a3ecf){_0x3d107e['push'](_0x3d107e['shift']());}};_0x443c0f(++_0x53fa04);}(_0xaa65,0x15f));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var logger=require('../../config/logger')(_0x5aa6('0x2'));var moment=require(_0x5aa6('0x3'));var BPromise=require(_0x5aa6('0x4'));var rp=require(_0x5aa6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aa6('0x6'));var config=require(_0x5aa6('0x7'));var attributes=require(_0x5aa6('0x8'));module['exports']=function(_0x942167,_0x5e74f8){return _0x942167['define'](_0x5aa6('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index d8c2887..c4ba502 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 _0x5f56=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','findAll','options','raw','where','limit','include','map','model','attributes','GetTemplate','catch','lodash','util'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5f56,0xc4));var _0x65f5=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x5f56[_0x2a390b];return _0x5df10a;};'use strict';var _=require(_0x65f5('0x0'));var util=require(_0x65f5('0x1'));var moment=require(_0x65f5('0x2'));var BPromise=require(_0x65f5('0x3'));var rs=require(_0x65f5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65f5('0x5'))['db'];var utils=require(_0x65f5('0x6'));var logger=require('../../config/logger')(_0x65f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x65f5('0x8'));var client=jayson[_0x65f5('0x9')][_0x65f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x72e2f2,_0xe5d50f,_0x456d12){return new BPromise(function(_0x140eee,_0x38c878){return client[_0x65f5('0xb')](_0x72e2f2,_0x456d12)[_0x65f5('0xc')](function(_0x23d2d8){logger[_0x65f5('0xd')](_0x65f5('0xe'),_0xe5d50f,'request\x20sent');logger[_0x65f5('0xf')](_0x65f5('0x10'),_0xe5d50f,_0x65f5('0x11'),JSON[_0x65f5('0x12')](_0x23d2d8));if(_0x23d2d8[_0x65f5('0x13')]){if(_0x23d2d8[_0x65f5('0x13')]['code']===0x1f4){logger[_0x65f5('0x13')]('Template,\x20%s,\x20%s',_0xe5d50f,_0x23d2d8[_0x65f5('0x13')][_0x65f5('0x14')]);return _0x38c878(_0x23d2d8['error'][_0x65f5('0x14')]);}logger[_0x65f5('0x13')](_0x65f5('0xe'),_0xe5d50f,_0x23d2d8[_0x65f5('0x13')][_0x65f5('0x14')]);return _0x140eee(_0x23d2d8[_0x65f5('0x13')][_0x65f5('0x14')]);}else{logger[_0x65f5('0xd')]('Template,\x20%s,\x20%s',_0xe5d50f,_0x65f5('0x11'));_0x140eee(_0x23d2d8[_0x65f5('0x15')][_0x65f5('0x14')]);}})['catch'](function(_0x1a8e33){logger[_0x65f5('0x13')]('Template,\x20%s,\x20%s',_0xe5d50f,_0x1a8e33);_0x38c878(_0x1a8e33);});});}exports['GetTemplate']=function(_0x43536a){var _0x2d612a=this;return new Promise(function(_0x2b0dc3,_0x5f4821){return db['Template'][_0x65f5('0x16')]({'raw':_0x43536a[_0x65f5('0x17')]?_0x43536a[_0x65f5('0x17')][_0x65f5('0x18')]===undefined?!![]:![]:!![],'where':_0x43536a['options']?_0x43536a[_0x65f5('0x17')][_0x65f5('0x19')]||null:null,'attributes':_0x43536a[_0x65f5('0x17')]?_0x43536a[_0x65f5('0x17')]['attributes']||null:null,'limit':_0x43536a[_0x65f5('0x17')]?_0x43536a[_0x65f5('0x17')][_0x65f5('0x1a')]||null:null,'include':_0x43536a[_0x65f5('0x17')]?_0x43536a[_0x65f5('0x17')][_0x65f5('0x1b')]?_[_0x65f5('0x1c')](_0x43536a['options'][_0x65f5('0x1b')],function(_0x6df1fd){return{'model':db[_0x6df1fd[_0x65f5('0x1d')]],'as':_0x6df1fd['as'],'attributes':_0x6df1fd[_0x65f5('0x1e')],'include':_0x6df1fd[_0x65f5('0x1b')]?_[_0x65f5('0x1c')](_0x6df1fd[_0x65f5('0x1b')],function(_0x2be49b){return{'model':db[_0x2be49b[_0x65f5('0x1d')]],'as':_0x2be49b['as'],'attributes':_0x2be49b[_0x65f5('0x1e')],'include':_0x2be49b[_0x65f5('0x1b')]?_[_0x65f5('0x1c')](_0x2be49b[_0x65f5('0x1b')],function(_0x80ad06){return{'model':db[_0x80ad06[_0x65f5('0x1d')]],'as':_0x80ad06['as'],'attributes':_0x80ad06[_0x65f5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x65f5('0xc')](function(_0x2ee4a1){logger['info']('GetTemplate',_0x43536a);logger['debug'](_0x65f5('0x1f'),_0x43536a,JSON[_0x65f5('0x12')](_0x2ee4a1));_0x2b0dc3(_0x2ee4a1);})[_0x65f5('0x20')](function(_0x59e524){logger['error'](_0x65f5('0x1f'),_0x59e524[_0x65f5('0x14')],_0x43536a);_0x5f4821(_0x2d612a[_0x65f5('0x13')](0x1f4,_0x59e524[_0x65f5('0x14')]));});});}; \ No newline at end of file +var _0xc1b4=['findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','message','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','result','catch','GetTemplate'];(function(_0x2e5849,_0x4e615a){var _0x17cd13=function(_0x5dffe0){while(--_0x5dffe0){_0x2e5849['push'](_0x2e5849['shift']());}};_0x17cd13(++_0x4e615a);}(_0xc1b4,0x1bf));var _0x4c1b=function(_0x3c0edf,_0x2403cc){_0x3c0edf=_0x3c0edf-0x0;var _0x38ab72=_0xc1b4[_0x3c0edf];return _0x38ab72;};'use strict';var _=require('lodash');var util=require(_0x4c1b('0x0'));var moment=require(_0x4c1b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c1b('0x2'))['db'];var utils=require(_0x4c1b('0x3'));var logger=require('../../config/logger')(_0x4c1b('0x4'));var config=require(_0x4c1b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4c1b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1219de,_0x34c61d,_0x46ac25){return new BPromise(function(_0x24b28a,_0x21a638){return client[_0x4c1b('0x7')](_0x1219de,_0x46ac25)['then'](function(_0x51ddec){logger[_0x4c1b('0x8')](_0x4c1b('0x9'),_0x34c61d,_0x4c1b('0xa'));logger[_0x4c1b('0xb')](_0x4c1b('0xc'),_0x34c61d,_0x4c1b('0xa'),JSON['stringify'](_0x51ddec));if(_0x51ddec['error']){if(_0x51ddec[_0x4c1b('0xd')]['code']===0x1f4){logger[_0x4c1b('0xd')]('Template,\x20%s,\x20%s',_0x34c61d,_0x51ddec[_0x4c1b('0xd')]['message']);return _0x21a638(_0x51ddec[_0x4c1b('0xd')]['message']);}logger[_0x4c1b('0xd')](_0x4c1b('0x9'),_0x34c61d,_0x51ddec['error']['message']);return _0x24b28a(_0x51ddec[_0x4c1b('0xd')]['message']);}else{logger[_0x4c1b('0x8')](_0x4c1b('0x9'),_0x34c61d,'request\x20sent');_0x24b28a(_0x51ddec[_0x4c1b('0xe')]['message']);}})[_0x4c1b('0xf')](function(_0x2b03b9){logger[_0x4c1b('0xd')](_0x4c1b('0x9'),_0x34c61d,_0x2b03b9);_0x21a638(_0x2b03b9);});});}exports[_0x4c1b('0x10')]=function(_0x499cff){var _0x4fd087=this;return new Promise(function(_0x2a2ee0,_0x2fc629){return db['Template'][_0x4c1b('0x11')]({'raw':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x13')]===undefined?!![]:![]:!![],'where':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x14')]||null:null,'attributes':_0x499cff[_0x4c1b('0x12')]?_0x499cff[_0x4c1b('0x12')][_0x4c1b('0x15')]||null:null,'limit':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x16')]||null:null,'include':_0x499cff[_0x4c1b('0x12')]?_0x499cff[_0x4c1b('0x12')][_0x4c1b('0x17')]?_[_0x4c1b('0x18')](_0x499cff[_0x4c1b('0x12')]['include'],function(_0x306827){return{'model':db[_0x306827[_0x4c1b('0x19')]],'as':_0x306827['as'],'attributes':_0x306827[_0x4c1b('0x15')],'include':_0x306827['include']?_[_0x4c1b('0x18')](_0x306827[_0x4c1b('0x17')],function(_0x4fd068){return{'model':db[_0x4fd068[_0x4c1b('0x19')]],'as':_0x4fd068['as'],'attributes':_0x4fd068['attributes'],'include':_0x4fd068[_0x4c1b('0x17')]?_[_0x4c1b('0x18')](_0x4fd068['include'],function(_0x4a62e2){return{'model':db[_0x4a62e2[_0x4c1b('0x19')]],'as':_0x4a62e2['as'],'attributes':_0x4a62e2[_0x4c1b('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4c1b('0x1a')](function(_0x2b76fd){logger[_0x4c1b('0x8')](_0x4c1b('0x10'),_0x499cff);logger[_0x4c1b('0xb')](_0x4c1b('0x10'),_0x499cff,JSON[_0x4c1b('0x1b')](_0x2b76fd));_0x2a2ee0(_0x2b76fd);})[_0x4c1b('0xf')](function(_0x1b98bf){logger[_0x4c1b('0xd')](_0x4c1b('0x10'),_0x1b98bf[_0x4c1b('0x1c')],_0x499cff);_0x2fc629(_0x4fd087[_0x4c1b('0xd')](0x1f4,_0x1b98bf[_0x4c1b('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 01b1f21..c44aac2 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 _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2d7fd5,_0x38785f){var _0xdd134f=function(_0x5cac2b){while(--_0x5cac2b){_0x2d7fd5['push'](_0x2d7fd5['shift']());}};_0xdd134f(++_0x38785f);}(_0xea28,0x13a));var _0x8ea2=function(_0x48e421,_0x5cbea5){_0x48e421=_0x48e421-0x0;var _0x5295a4=_0xea28[_0x48e421];return _0x5295a4;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getAnyConditions']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller['addAllCondition']);router[_0x8ea2('0x15')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x8ea2('0x16')]);router[_0x8ea2('0x15')](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file +var _0xc1ba=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./trigger.controller','index','/:id','/:id/all_conditions','getAllConditions','get','/:id/any_conditions','isAuthenticated','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','delete'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xc1ba,0x1bc));var _0xac1b=function(_0xc0aa62,_0x41d630){_0xc0aa62=_0xc0aa62-0x0;var _0x585510=_0xc1ba[_0xc0aa62];return _0x585510;};'use strict';var multer=require(_0xac1b('0x0'));var util=require(_0xac1b('0x1'));var path=require(_0xac1b('0x2'));var timeout=require(_0xac1b('0x3'));var express=require(_0xac1b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac1b('0x5'));var config=require(_0xac1b('0x6'));var controller=require(_0xac1b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xac1b('0x8')]);router['get'](_0xac1b('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xac1b('0xa'),auth['isAuthenticated'](),controller[_0xac1b('0xb')]);router[_0xac1b('0xc')](_0xac1b('0xd'),auth[_0xac1b('0xe')](),controller[_0xac1b('0xf')]);router[_0xac1b('0xc')](_0xac1b('0x10'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x11')]);router[_0xac1b('0x12')]('/',auth[_0xac1b('0xe')](),controller[_0xac1b('0x13')]);router[_0xac1b('0x12')](_0xac1b('0xa'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x14')]);router['post'](_0xac1b('0xd'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x15')]);router[_0xac1b('0x12')](_0xac1b('0x10'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x16')]);router['put'](_0xac1b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xac1b('0x17')]('/:id',auth[_0xac1b('0xe')](),controller[_0xac1b('0x18')]);module[_0xac1b('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 0c04ddc..c1b88ef 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 _0x9075=['STRING','BOOLEAN'];(function(_0x146f21,_0x24dc1f){var _0x59a416=function(_0x36ea07){while(--_0x36ea07){_0x146f21['push'](_0x146f21['shift']());}};_0x59a416(++_0x24dc1f);}(_0x9075,0x7a));var _0x5907=function(_0x2c84e5,_0x58a7c7){_0x2c84e5=_0x2c84e5-0x0;var _0x4990ec=_0x9075[_0x2c84e5];return _0x4990ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5907('0x0')]},'channel':{'type':Sequelize[_0x5907('0x0')]},'description':{'type':Sequelize[_0x5907('0x0')]},'status':{'type':Sequelize[_0x5907('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x902a=['BOOLEAN','sequelize','exports','STRING'];(function(_0x49813b,_0x4f170a){var _0x491ece=function(_0x45c465){while(--_0x45c465){_0x49813b['push'](_0x49813b['shift']());}};_0x491ece(++_0x4f170a);}(_0x902a,0x89));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa902('0x0'));module[_0xa902('0x1')]={'name':{'type':Sequelize[_0xa902('0x2')]},'channel':{'type':Sequelize[_0xa902('0x2')]},'description':{'type':Sequelize[_0xa902('0x2')]},'status':{'type':Sequelize[_0xa902('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 b7179b4..c3ac861 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 _0x4dd2=['util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','Trigger','includeAll','include','findAll','rows','catch','keys','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','findOne','nolimit','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','request-promise','moment'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0x4dd2,0x15c));var _0x24dd=function(_0x35f6b4,_0x505966){_0x35f6b4=_0x35f6b4-0x0;var _0x10f072=_0x4dd2[_0x35f6b4];return _0x10f072;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24dd('0x0'));var zipdir=require(_0x24dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24dd('0x2'));var moment=require(_0x24dd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x24dd('0x4'));var path=require(_0x24dd('0x5'));var sox=require(_0x24dd('0x6'));var csv=require(_0x24dd('0x7'));var ejs=require(_0x24dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24dd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x24dd('0xa'));var toCsv=require(_0x24dd('0x7'));var querystring=require('querystring');var Papa=require(_0x24dd('0xb'));var Redis=require('ioredis');var authService=require(_0x24dd('0xc'));var qs=require(_0x24dd('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24dd('0xe'));var logger=require('../../config/logger')(_0x24dd('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x24dd('0x10'))['db'];function respondWithStatusCode(_0x2cdfac,_0x3233eb){_0x3233eb=_0x3233eb||0xcc;return function(_0x9d71e8){if(_0x9d71e8){return _0x2cdfac['sendStatus'](_0x3233eb);}return _0x2cdfac[_0x24dd('0x11')](_0x3233eb)[_0x24dd('0x12')]();};}function respondWithResult(_0x2d3eee,_0x38285b){_0x38285b=_0x38285b||0xc8;return function(_0x22c1c7){if(_0x22c1c7){return _0x2d3eee[_0x24dd('0x11')](_0x38285b)[_0x24dd('0x13')](_0x22c1c7);}};}function respondWithFilteredResult(_0x8ee3cf,_0x3aa6eb){return function(_0x368c49){if(_0x368c49){var _0x250240=typeof _0x3aa6eb['offset']===_0x24dd('0x14')&&typeof _0x3aa6eb[_0x24dd('0x15')]===_0x24dd('0x14');var _0x4fd970=_0x368c49[_0x24dd('0x16')];var _0x3e9efa=_0x250240?0x0:_0x3aa6eb[_0x24dd('0x17')];var _0x58ce96=_0x250240?_0x368c49['count']:_0x3aa6eb[_0x24dd('0x17')]+_0x3aa6eb['limit'];var _0x34777c;if(_0x58ce96>=_0x4fd970){_0x58ce96=_0x4fd970;_0x34777c=0xc8;}else{_0x34777c=0xce;}_0x8ee3cf[_0x24dd('0x11')](_0x34777c);return _0x8ee3cf[_0x24dd('0x18')](_0x24dd('0x19'),_0x3e9efa+'-'+_0x58ce96+'/'+_0x4fd970)['json'](_0x368c49);}return null;};}function patchUpdates(_0x478a6d){return function(_0x1376d6){try{jsonpatch[_0x24dd('0x1a')](_0x1376d6,_0x478a6d,!![]);}catch(_0x370277){return BPromise[_0x24dd('0x1b')](_0x370277);}return _0x1376d6[_0x24dd('0x1c')]();};}function saveUpdates(_0x46dc58,_0x22661a){return function(_0xf53381){if(_0xf53381){return _0xf53381[_0x24dd('0x1d')](_0x46dc58)[_0x24dd('0x1e')](function(_0x17eacc){return _0x17eacc;});}return null;};}function removeEntity(_0x1c12c0,_0x18e122){return function(_0x5e189d){if(_0x5e189d){return _0x5e189d[_0x24dd('0x1f')]()[_0x24dd('0x1e')](function(){var _0x24a9da=_0x5e189d['get']({'plain':!![]});var _0x7435cf='Triggers';return db['UserProfileResource'][_0x24dd('0x1f')]({'where':{'type':_0x7435cf,'resourceId':_0x24a9da['id']}})[_0x24dd('0x1e')](function(){return _0x5e189d;});})[_0x24dd('0x1e')](function(){_0x1c12c0[_0x24dd('0x11')](0xcc)[_0x24dd('0x12')]();});}};}function handleEntityNotFound(_0x3fdc5e,_0x2412b){return function(_0x372683){if(!_0x372683){_0x3fdc5e['sendStatus'](0x194);}return _0x372683;};}function handleError(_0x1d93f2,_0x5728f6){_0x5728f6=_0x5728f6||0x1f4;return function(_0x2ac3ed){logger[_0x24dd('0x20')](_0x2ac3ed[_0x24dd('0x21')]);if(_0x2ac3ed[_0x24dd('0x22')]){delete _0x2ac3ed[_0x24dd('0x22')];}_0x1d93f2[_0x24dd('0x11')](_0x5728f6)[_0x24dd('0x23')](_0x2ac3ed);};}exports[_0x24dd('0x24')]=function(_0x354847,_0x246238){var _0x1684ec={},_0x531d0f={},_0x5ed90b={'count':0x0,'rows':[]};var _0x4efbc0=_[_0x24dd('0x25')](db['Trigger'][_0x24dd('0x26')],function(_0xc67601){return{'name':_0xc67601[_0x24dd('0x27')],'type':_0xc67601[_0x24dd('0x28')][_0x24dd('0x29')]};});_0x531d0f[_0x24dd('0x2a')]=_[_0x24dd('0x25')](_0x4efbc0,'name');_0x531d0f[_0x24dd('0x2b')]=_['keys'](_0x354847['query']);_0x531d0f['filters']=_[_0x24dd('0x2c')](_0x531d0f[_0x24dd('0x2a')],_0x531d0f['query']);_0x1684ec['attributes']=_['intersection'](_0x531d0f[_0x24dd('0x2a')],qs[_0x24dd('0x2d')](_0x354847[_0x24dd('0x2b')][_0x24dd('0x2d')]));_0x1684ec['attributes']=_0x1684ec[_0x24dd('0x2e')][_0x24dd('0x2f')]?_0x1684ec[_0x24dd('0x2e')]:_0x531d0f[_0x24dd('0x2a')];if(!_0x354847[_0x24dd('0x2b')][_0x24dd('0x30')]('nolimit')){_0x1684ec['limit']=qs[_0x24dd('0x15')](_0x354847[_0x24dd('0x2b')][_0x24dd('0x15')]);_0x1684ec[_0x24dd('0x17')]=qs['offset'](_0x354847[_0x24dd('0x2b')][_0x24dd('0x17')]);}_0x1684ec[_0x24dd('0x31')]=qs[_0x24dd('0x32')](_0x354847[_0x24dd('0x2b')][_0x24dd('0x32')]);_0x1684ec[_0x24dd('0x33')]=qs['filters'](_[_0x24dd('0x34')](_0x354847[_0x24dd('0x2b')],_0x531d0f[_0x24dd('0x35')]),_0x4efbc0);if(_0x354847[_0x24dd('0x2b')][_0x24dd('0x36')]){_0x1684ec[_0x24dd('0x33')]=_['merge'](_0x1684ec[_0x24dd('0x33')],{'$or':_[_0x24dd('0x25')](_0x4efbc0,function(_0x50451a){if(_0x50451a[_0x24dd('0x28')]!==_0x24dd('0x37')){var _0x5b9f62={};_0x5b9f62[_0x50451a[_0x24dd('0x22')]]={'$like':'%'+_0x354847[_0x24dd('0x2b')]['filter']+'%'};return _0x5b9f62;}})});}_0x1684ec=_['merge']({},_0x1684ec,_0x354847['options']);var _0x5e3112={'where':_0x1684ec[_0x24dd('0x33')]};return db[_0x24dd('0x38')]['count'](_0x5e3112)['then'](function(_0x5a8e4c){_0x5ed90b[_0x24dd('0x16')]=_0x5a8e4c;if(_0x354847[_0x24dd('0x2b')][_0x24dd('0x39')]){_0x1684ec[_0x24dd('0x3a')]=[{'all':!![]}];}return db[_0x24dd('0x38')][_0x24dd('0x3b')](_0x1684ec);})['then'](function(_0x9d021){_0x5ed90b[_0x24dd('0x3c')]=_0x9d021;return _0x5ed90b;})[_0x24dd('0x1e')](respondWithFilteredResult(_0x246238,_0x1684ec))[_0x24dd('0x3d')](handleError(_0x246238,null));};exports['show']=function(_0x281de0,_0x348f08){var _0x498fb0={'raw':![],'where':{'id':_0x281de0['params']['id']}},_0x55b325={};_0x55b325[_0x24dd('0x2a')]=_[_0x24dd('0x3e')](db[_0x24dd('0x38')][_0x24dd('0x26')]);_0x55b325['query']=_[_0x24dd('0x3e')](_0x281de0[_0x24dd('0x2b')]);_0x55b325[_0x24dd('0x35')]=_['intersection'](_0x55b325['model'],_0x55b325[_0x24dd('0x2b')]);_0x498fb0['attributes']=_['intersection'](_0x55b325[_0x24dd('0x2a')],qs['fields'](_0x281de0[_0x24dd('0x2b')]['fields']));_0x498fb0['attributes']=_0x498fb0[_0x24dd('0x2e')][_0x24dd('0x2f')]?_0x498fb0[_0x24dd('0x2e')]:_0x55b325['model'];if(_0x281de0[_0x24dd('0x2b')][_0x24dd('0x39')]){_0x498fb0[_0x24dd('0x3a')]=[{'all':!![]}];}_0x498fb0=_[_0x24dd('0x3f')]({},_0x498fb0,_0x281de0[_0x24dd('0x40')]);return db[_0x24dd('0x38')][_0x24dd('0x41')](_0x498fb0)[_0x24dd('0x1e')](handleEntityNotFound(_0x348f08,null))[_0x24dd('0x1e')](respondWithResult(_0x348f08,null))[_0x24dd('0x3d')](handleError(_0x348f08,null));};exports[_0x24dd('0x42')]=function(_0xdd4ffb,_0x1050c5){return db[_0x24dd('0x38')][_0x24dd('0x42')](_0xdd4ffb[_0x24dd('0x43')],{})['then'](function(_0x15b4f2){var _0x3a6a56=_0xdd4ffb[_0x24dd('0x44')][_0x24dd('0x45')]({'plain':!![]});if(!_0x3a6a56)throw new Error(_0x24dd('0x46'));if(_0x3a6a56[_0x24dd('0x47')]===_0x24dd('0x44')){var _0x3341cc=_0x15b4f2['get']({'plain':!![]});var _0x44d6a6=_0x24dd('0x48');return db[_0x24dd('0x49')]['find']({'where':{'name':_0x44d6a6,'userProfileId':_0x3a6a56['userProfileId']},'raw':!![]})[_0x24dd('0x1e')](function(_0x3678a9){if(_0x3678a9&&_0x3678a9['autoAssociation']===0x0){return db[_0x24dd('0x4a')]['create']({'name':_0x3341cc[_0x24dd('0x22')],'resourceId':_0x3341cc['id'],'type':_0x3678a9[_0x24dd('0x22')],'sectionId':_0x3678a9['id']},{})['then'](function(){return _0x15b4f2;});}else{return _0x15b4f2;}})[_0x24dd('0x3d')](function(_0x310a98){logger[_0x24dd('0x20')](_0x24dd('0x4b'),_0x310a98);throw _0x310a98;});}return _0x15b4f2;})[_0x24dd('0x1e')](respondWithResult(_0x1050c5,0xc9))[_0x24dd('0x3d')](handleError(_0x1050c5,null));};exports[_0x24dd('0x1d')]=function(_0x20de37,_0xa26485){if(_0x20de37[_0x24dd('0x43')]['id']){delete _0x20de37[_0x24dd('0x43')]['id'];}return db[_0x24dd('0x38')][_0x24dd('0x41')]({'where':{'id':_0x20de37[_0x24dd('0x4c')]['id']}})[_0x24dd('0x1e')](handleEntityNotFound(_0xa26485,null))[_0x24dd('0x1e')](saveUpdates(_0x20de37[_0x24dd('0x43')],null))[_0x24dd('0x1e')](respondWithResult(_0xa26485,null))[_0x24dd('0x3d')](handleError(_0xa26485,null));};exports[_0x24dd('0x1f')]=function(_0x3d6ff6,_0x55a1cd){return db[_0x24dd('0x38')][_0x24dd('0x41')]({'where':{'id':_0x3d6ff6[_0x24dd('0x4c')]['id']}})[_0x24dd('0x1e')](handleEntityNotFound(_0x55a1cd,null))[_0x24dd('0x1e')](removeEntity(_0x55a1cd,null))[_0x24dd('0x3d')](handleError(_0x55a1cd,null));};exports[_0x24dd('0x4d')]=function(_0x31ae23,_0x3cfd6a,_0x53d6b9){if(_0x31ae23[_0x24dd('0x43')]['id']){delete _0x31ae23[_0x24dd('0x43')]['id'];}return db[_0x24dd('0x38')]['find']({'where':{'id':_0x31ae23[_0x24dd('0x4c')]['id']}})[_0x24dd('0x1e')](handleEntityNotFound(_0x3cfd6a,null))[_0x24dd('0x1e')](function(_0x5b9356){if(_0x5b9356){_0x31ae23[_0x24dd('0x43')][_0x24dd('0x4e')]=_0x5b9356['id'];return db[_0x24dd('0x4f')][_0x24dd('0x42')](_0x31ae23['body']);}})[_0x24dd('0x1e')](respondWithResult(_0x3cfd6a,null))[_0x24dd('0x3d')](handleError(_0x3cfd6a,null));};exports['addAnyCondition']=function(_0x5bd74c,_0x14528c,_0x55f90b){if(_0x5bd74c[_0x24dd('0x43')]['id']){delete _0x5bd74c[_0x24dd('0x43')]['id'];}return db[_0x24dd('0x38')]['find']({'where':{'id':_0x5bd74c[_0x24dd('0x4c')]['id']}})[_0x24dd('0x1e')](handleEntityNotFound(_0x14528c,null))[_0x24dd('0x1e')](function(_0x2cd262){if(_0x2cd262){_0x5bd74c[_0x24dd('0x43')]['TriggerAnyId']=_0x2cd262['id'];return db[_0x24dd('0x4f')][_0x24dd('0x42')](_0x5bd74c[_0x24dd('0x43')]);}})[_0x24dd('0x1e')](respondWithResult(_0x14528c,null))[_0x24dd('0x3d')](handleError(_0x14528c,null));};exports['getAllConditions']=function(_0xd88922,_0x3ab247,_0x37a681){var _0x184950={};var _0x1e2bd6={};var _0x280c2d;var _0x471299;return db['Trigger'][_0x24dd('0x50')]({'where':{'id':_0xd88922[_0x24dd('0x4c')]['id']}})[_0x24dd('0x1e')](handleEntityNotFound(_0x3ab247,null))[_0x24dd('0x1e')](function(_0x389606){if(_0x389606){_0x280c2d=_0x389606;_0x1e2bd6[_0x24dd('0x2a')]=_[_0x24dd('0x3e')](db[_0x24dd('0x4f')][_0x24dd('0x26')]);_0x1e2bd6[_0x24dd('0x2b')]=_[_0x24dd('0x3e')](_0xd88922[_0x24dd('0x2b')]);_0x1e2bd6[_0x24dd('0x35')]=_[_0x24dd('0x2c')](_0x1e2bd6[_0x24dd('0x2a')],_0x1e2bd6[_0x24dd('0x2b')]);_0x184950['attributes']=_[_0x24dd('0x2c')](_0x1e2bd6[_0x24dd('0x2a')],qs['fields'](_0xd88922[_0x24dd('0x2b')][_0x24dd('0x2d')]));_0x184950[_0x24dd('0x2e')]=_0x184950[_0x24dd('0x2e')][_0x24dd('0x2f')]?_0x184950[_0x24dd('0x2e')]:_0x1e2bd6[_0x24dd('0x2a')];_0x184950[_0x24dd('0x31')]=qs[_0x24dd('0x32')](_0xd88922['query'][_0x24dd('0x32')]);_0x184950[_0x24dd('0x33')]=qs[_0x24dd('0x35')](_[_0x24dd('0x34')](_0xd88922[_0x24dd('0x2b')],_0x1e2bd6[_0x24dd('0x35')]));if(_0xd88922[_0x24dd('0x2b')][_0x24dd('0x36')]){_0x184950[_0x24dd('0x33')]=_[_0x24dd('0x3f')](_0x184950['where'],{'$or':_['map'](_0x184950[_0x24dd('0x2e')],function(_0x317d46){var _0x47d529={};_0x47d529[_0x317d46]={'$like':'%'+_0xd88922[_0x24dd('0x2b')][_0x24dd('0x36')]+'%'};return _0x47d529;})});}_0x184950=_[_0x24dd('0x3f')]({},_0x184950,_0xd88922[_0x24dd('0x40')]);return _0x280c2d['getAllConditions'](_0x184950);}})[_0x24dd('0x1e')](function(_0x2b1b60){if(_0x2b1b60){_0x471299=_0x2b1b60['length'];if(!_0xd88922[_0x24dd('0x2b')][_0x24dd('0x30')](_0x24dd('0x51'))){_0x184950[_0x24dd('0x15')]=qs[_0x24dd('0x15')](_0xd88922[_0x24dd('0x2b')][_0x24dd('0x15')]);_0x184950[_0x24dd('0x17')]=qs['offset'](_0xd88922[_0x24dd('0x2b')][_0x24dd('0x17')]);}return _0x280c2d[_0x24dd('0x52')](_0x184950);}})['then'](function(_0x338bbe){if(_0x338bbe){return _0x338bbe?{'count':_0x471299,'rows':_0x338bbe}:null;}})['then'](respondWithResult(_0x3ab247,null))[_0x24dd('0x3d')](handleError(_0x3ab247,null));};exports[_0x24dd('0x53')]=function(_0x130534,_0x1d5946,_0xbe8dd9){var _0x369f84={};var _0x146181={};var _0x5b370d;var _0x330453;return db[_0x24dd('0x38')][_0x24dd('0x50')]({'where':{'id':_0x130534[_0x24dd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d5946,null))[_0x24dd('0x1e')](function(_0x58c750){if(_0x58c750){_0x5b370d=_0x58c750;_0x146181[_0x24dd('0x2a')]=_[_0x24dd('0x3e')](db[_0x24dd('0x4f')]['rawAttributes']);_0x146181[_0x24dd('0x2b')]=_[_0x24dd('0x3e')](_0x130534[_0x24dd('0x2b')]);_0x146181[_0x24dd('0x35')]=_[_0x24dd('0x2c')](_0x146181[_0x24dd('0x2a')],_0x146181[_0x24dd('0x2b')]);_0x369f84[_0x24dd('0x2e')]=_[_0x24dd('0x2c')](_0x146181[_0x24dd('0x2a')],qs[_0x24dd('0x2d')](_0x130534['query'][_0x24dd('0x2d')]));_0x369f84[_0x24dd('0x2e')]=_0x369f84[_0x24dd('0x2e')][_0x24dd('0x2f')]?_0x369f84[_0x24dd('0x2e')]:_0x146181['model'];_0x369f84['order']=qs['sort'](_0x130534[_0x24dd('0x2b')][_0x24dd('0x32')]);_0x369f84[_0x24dd('0x33')]=qs[_0x24dd('0x35')](_['pick'](_0x130534[_0x24dd('0x2b')],_0x146181[_0x24dd('0x35')]));if(_0x130534[_0x24dd('0x2b')][_0x24dd('0x36')]){_0x369f84['where']=_[_0x24dd('0x3f')](_0x369f84[_0x24dd('0x33')],{'$or':_[_0x24dd('0x25')](_0x369f84[_0x24dd('0x2e')],function(_0x49a3a7){var _0x50798f={};_0x50798f[_0x49a3a7]={'$like':'%'+_0x130534[_0x24dd('0x2b')][_0x24dd('0x36')]+'%'};return _0x50798f;})});}_0x369f84=_[_0x24dd('0x3f')]({},_0x369f84,_0x130534[_0x24dd('0x40')]);return _0x5b370d[_0x24dd('0x53')](_0x369f84);}})[_0x24dd('0x1e')](function(_0x38a03f){if(_0x38a03f){_0x330453=_0x38a03f[_0x24dd('0x2f')];if(!_0x130534['query'][_0x24dd('0x30')](_0x24dd('0x51'))){_0x369f84[_0x24dd('0x15')]=qs[_0x24dd('0x15')](_0x130534[_0x24dd('0x2b')][_0x24dd('0x15')]);_0x369f84[_0x24dd('0x17')]=qs['offset'](_0x130534['query'][_0x24dd('0x17')]);}return _0x5b370d['getAnyConditions'](_0x369f84);}})[_0x24dd('0x1e')](function(_0x1b299b){if(_0x1b299b){return _0x1b299b?{'count':_0x330453,'rows':_0x1b299b}:null;}})['then'](respondWithResult(_0x1d5946,null))[_0x24dd('0x3d')](handleError(_0x1d5946,null));};exports[_0x24dd('0x54')]=function(_0x3da7d6,_0xeef383,_0x411d0a){if(_0x3da7d6[_0x24dd('0x43')]['id']){delete _0x3da7d6['body']['id'];}return db[_0x24dd('0x38')]['find']({'where':{'id':_0x3da7d6[_0x24dd('0x4c')]['id']}})['then'](handleEntityNotFound(_0xeef383,null))[_0x24dd('0x1e')](function(_0xfbc327){if(_0xfbc327){_0x3da7d6[_0x24dd('0x43')][_0x24dd('0x55')]=_0xfbc327['id'];return db[_0x24dd('0x56')][_0x24dd('0x42')](_0x3da7d6[_0x24dd('0x43')]);}})[_0x24dd('0x1e')](respondWithResult(_0xeef383,null))[_0x24dd('0x3d')](handleError(_0xeef383,null));};exports[_0x24dd('0x57')]=function(_0x19cb47,_0x20c6c7,_0x5a017f){var _0x3780fe={};var _0x2b9b71={};var _0x5d5dfc;var _0x34f151;return db[_0x24dd('0x38')][_0x24dd('0x50')]({'where':{'id':_0x19cb47[_0x24dd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20c6c7,null))[_0x24dd('0x1e')](function(_0x1c5228){if(_0x1c5228){_0x5d5dfc=_0x1c5228;_0x2b9b71[_0x24dd('0x2a')]=_[_0x24dd('0x3e')](db[_0x24dd('0x56')][_0x24dd('0x26')]);_0x2b9b71[_0x24dd('0x2b')]=_[_0x24dd('0x3e')](_0x19cb47['query']);_0x2b9b71[_0x24dd('0x35')]=_[_0x24dd('0x2c')](_0x2b9b71['model'],_0x2b9b71['query']);_0x3780fe[_0x24dd('0x2e')]=_[_0x24dd('0x2c')](_0x2b9b71[_0x24dd('0x2a')],qs[_0x24dd('0x2d')](_0x19cb47[_0x24dd('0x2b')]['fields']));_0x3780fe[_0x24dd('0x2e')]=_0x3780fe[_0x24dd('0x2e')][_0x24dd('0x2f')]?_0x3780fe[_0x24dd('0x2e')]:_0x2b9b71[_0x24dd('0x2a')];_0x3780fe[_0x24dd('0x31')]=qs[_0x24dd('0x32')](_0x19cb47[_0x24dd('0x2b')][_0x24dd('0x32')]);_0x3780fe[_0x24dd('0x33')]=qs[_0x24dd('0x35')](_[_0x24dd('0x34')](_0x19cb47[_0x24dd('0x2b')],_0x2b9b71[_0x24dd('0x35')]));if(_0x19cb47[_0x24dd('0x2b')][_0x24dd('0x36')]){_0x3780fe[_0x24dd('0x33')]=_['merge'](_0x3780fe[_0x24dd('0x33')],{'$or':_[_0x24dd('0x25')](_0x3780fe[_0x24dd('0x2e')],function(_0x3faca7){var _0x1fa54b={};_0x1fa54b[_0x3faca7]={'$like':'%'+_0x19cb47[_0x24dd('0x2b')][_0x24dd('0x36')]+'%'};return _0x1fa54b;})});}_0x3780fe=_[_0x24dd('0x3f')]({},_0x3780fe,_0x19cb47[_0x24dd('0x40')]);return _0x5d5dfc[_0x24dd('0x57')](_0x3780fe);}})[_0x24dd('0x1e')](function(_0x3bf39a){if(_0x3bf39a){_0x34f151=_0x3bf39a[_0x24dd('0x2f')];if(!_0x19cb47[_0x24dd('0x2b')][_0x24dd('0x30')](_0x24dd('0x51'))){_0x3780fe[_0x24dd('0x15')]=qs['limit'](_0x19cb47['query']['limit']);_0x3780fe[_0x24dd('0x17')]=qs[_0x24dd('0x17')](_0x19cb47[_0x24dd('0x2b')][_0x24dd('0x17')]);}return _0x5d5dfc[_0x24dd('0x57')](_0x3780fe);}})[_0x24dd('0x1e')](function(_0x13ee7f){if(_0x13ee7f){return _0x13ee7f?{'count':_0x34f151,'rows':_0x13ee7f}:null;}})[_0x24dd('0x1e')](respondWithResult(_0x20c6c7,null))[_0x24dd('0x3d')](handleError(_0x20c6c7,null));}; \ No newline at end of file +var _0xa4c2=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','getAllConditions','findOne','options','hasOwnProperty','getAnyConditions','rawAttributes','addAction','TriggerId','getActions','Action','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','Trigger','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','findAll','rows','show','keys','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId'];(function(_0x11adfe,_0x288b24){var _0x1218d0=function(_0x2ab768){while(--_0x2ab768){_0x11adfe['push'](_0x11adfe['shift']());}};_0x1218d0(++_0x288b24);}(_0xa4c2,0xc4));var _0x2a4c=function(_0x427627,_0x1d9f73){_0x427627=_0x427627-0x0;var _0xcaac7b=_0xa4c2[_0x427627];return _0xcaac7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a4c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a4c('0x1'));var rp=require('request-promise');var moment=require(_0x2a4c('0x2'));var BPromise=require(_0x2a4c('0x3'));var Mustache=require('mustache');var util=require(_0x2a4c('0x4'));var path=require('path');var sox=require(_0x2a4c('0x5'));var csv=require(_0x2a4c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a4c('0x7'));var _=require('lodash');var squel=require(_0x2a4c('0x8'));var crypto=require('crypto');var jsforce=require(_0x2a4c('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a4c('0xa'));var authService=require(_0x2a4c('0xb'));var qs=require(_0x2a4c('0xc'));var as=require(_0x2a4c('0xd'));var hardwareService=require(_0x2a4c('0xe'));var logger=require(_0x2a4c('0xf'))(_0x2a4c('0x10'));var utils=require(_0x2a4c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2a4c('0x12'))['db'];function respondWithStatusCode(_0x5cf8fc,_0x29433b){_0x29433b=_0x29433b||0xcc;return function(_0x5c3014){if(_0x5c3014){return _0x5cf8fc[_0x2a4c('0x13')](_0x29433b);}return _0x5cf8fc[_0x2a4c('0x14')](_0x29433b)[_0x2a4c('0x15')]();};}function respondWithResult(_0x2d4df5,_0x72d0ce){_0x72d0ce=_0x72d0ce||0xc8;return function(_0x3c2dff){if(_0x3c2dff){return _0x2d4df5[_0x2a4c('0x14')](_0x72d0ce)['json'](_0x3c2dff);}};}function respondWithFilteredResult(_0xbc70b7,_0xe9c4aa){return function(_0x3e21d7){if(_0x3e21d7){var _0x2de346=typeof _0xe9c4aa['offset']===_0x2a4c('0x16')&&typeof _0xe9c4aa[_0x2a4c('0x17')]===_0x2a4c('0x16');var _0x145daf=_0x3e21d7[_0x2a4c('0x18')];var _0x1ce6dc=_0x2de346?0x0:_0xe9c4aa[_0x2a4c('0x19')];var _0x53a1ea=_0x2de346?_0x3e21d7[_0x2a4c('0x18')]:_0xe9c4aa[_0x2a4c('0x19')]+_0xe9c4aa['limit'];var _0x254a57;if(_0x53a1ea>=_0x145daf){_0x53a1ea=_0x145daf;_0x254a57=0xc8;}else{_0x254a57=0xce;}_0xbc70b7[_0x2a4c('0x14')](_0x254a57);return _0xbc70b7[_0x2a4c('0x1a')](_0x2a4c('0x1b'),_0x1ce6dc+'-'+_0x53a1ea+'/'+_0x145daf)[_0x2a4c('0x1c')](_0x3e21d7);}return null;};}function patchUpdates(_0x186c1){return function(_0x2c9020){try{jsonpatch[_0x2a4c('0x1d')](_0x2c9020,_0x186c1,!![]);}catch(_0x3958d6){return BPromise[_0x2a4c('0x1e')](_0x3958d6);}return _0x2c9020[_0x2a4c('0x1f')]();};}function saveUpdates(_0x335d8b,_0x39df93){return function(_0x13c3eb){if(_0x13c3eb){return _0x13c3eb[_0x2a4c('0x20')](_0x335d8b)['then'](function(_0x247b76){return _0x247b76;});}return null;};}function removeEntity(_0x115865,_0x3a2862){return function(_0x4b1b90){if(_0x4b1b90){return _0x4b1b90[_0x2a4c('0x21')]()[_0x2a4c('0x22')](function(){var _0x55c34e=_0x4b1b90[_0x2a4c('0x23')]({'plain':!![]});var _0x10cd31='Triggers';return db[_0x2a4c('0x24')][_0x2a4c('0x21')]({'where':{'type':_0x10cd31,'resourceId':_0x55c34e['id']}})[_0x2a4c('0x22')](function(){return _0x4b1b90;});})['then'](function(){_0x115865['status'](0xcc)[_0x2a4c('0x15')]();});}};}function handleEntityNotFound(_0x4817d7,_0x443c45){return function(_0x5c4dc0){if(!_0x5c4dc0){_0x4817d7['sendStatus'](0x194);}return _0x5c4dc0;};}function handleError(_0x2acbda,_0x1e4ba5){_0x1e4ba5=_0x1e4ba5||0x1f4;return function(_0x29ff52){logger['error'](_0x29ff52[_0x2a4c('0x25')]);if(_0x29ff52[_0x2a4c('0x26')]){delete _0x29ff52[_0x2a4c('0x26')];}_0x2acbda[_0x2a4c('0x14')](_0x1e4ba5)[_0x2a4c('0x27')](_0x29ff52);};}exports[_0x2a4c('0x28')]=function(_0x3cca2a,_0x97ed5f){var _0x112cfd={},_0x2cbf6c={},_0xc018b4={'count':0x0,'rows':[]};var _0x1d08a0=_['map'](db[_0x2a4c('0x29')]['rawAttributes'],function(_0x287e25){return{'name':_0x287e25[_0x2a4c('0x2a')],'type':_0x287e25[_0x2a4c('0x2b')][_0x2a4c('0x2c')]};});_0x2cbf6c['model']=_[_0x2a4c('0x2d')](_0x1d08a0,_0x2a4c('0x26'));_0x2cbf6c[_0x2a4c('0x2e')]=_['keys'](_0x3cca2a['query']);_0x2cbf6c[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x2cbf6c[_0x2a4c('0x31')],_0x2cbf6c['query']);_0x112cfd['attributes']=_['intersection'](_0x2cbf6c[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x3cca2a[_0x2a4c('0x2e')]['fields']));_0x112cfd[_0x2a4c('0x33')]=_0x112cfd[_0x2a4c('0x33')]['length']?_0x112cfd['attributes']:_0x2cbf6c[_0x2a4c('0x31')];if(!_0x3cca2a[_0x2a4c('0x2e')]['hasOwnProperty'](_0x2a4c('0x34'))){_0x112cfd[_0x2a4c('0x17')]=qs['limit'](_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x17')]);_0x112cfd['offset']=qs[_0x2a4c('0x19')](_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x19')]);}_0x112cfd[_0x2a4c('0x35')]=qs['sort'](_0x3cca2a['query'][_0x2a4c('0x36')]);_0x112cfd['where']=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x3cca2a[_0x2a4c('0x2e')],_0x2cbf6c[_0x2a4c('0x2f')]),_0x1d08a0);if(_0x3cca2a['query'][_0x2a4c('0x38')]){_0x112cfd[_0x2a4c('0x39')]=_['merge'](_0x112cfd['where'],{'$or':_[_0x2a4c('0x2d')](_0x1d08a0,function(_0x2d8810){if(_0x2d8810[_0x2a4c('0x2b')]!==_0x2a4c('0x3a')){var _0x5aab10={};_0x5aab10[_0x2d8810[_0x2a4c('0x26')]]={'$like':'%'+_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x5aab10;}})});}_0x112cfd=_[_0x2a4c('0x3b')]({},_0x112cfd,_0x3cca2a['options']);var _0x40af9c={'where':_0x112cfd[_0x2a4c('0x39')]};return db[_0x2a4c('0x29')][_0x2a4c('0x18')](_0x40af9c)[_0x2a4c('0x22')](function(_0x53b324){_0xc018b4[_0x2a4c('0x18')]=_0x53b324;if(_0x3cca2a[_0x2a4c('0x2e')]['includeAll']){_0x112cfd['include']=[{'all':!![]}];}return db['Trigger'][_0x2a4c('0x3c')](_0x112cfd);})[_0x2a4c('0x22')](function(_0x520cd6){_0xc018b4[_0x2a4c('0x3d')]=_0x520cd6;return _0xc018b4;})[_0x2a4c('0x22')](respondWithFilteredResult(_0x97ed5f,_0x112cfd))['catch'](handleError(_0x97ed5f,null));};exports[_0x2a4c('0x3e')]=function(_0x224e56,_0x1750e3){var _0x5c7872={'raw':![],'where':{'id':_0x224e56['params']['id']}},_0x295133={};_0x295133[_0x2a4c('0x31')]=_[_0x2a4c('0x3f')](db[_0x2a4c('0x29')]['rawAttributes']);_0x295133[_0x2a4c('0x2e')]=_['keys'](_0x224e56['query']);_0x295133['filters']=_[_0x2a4c('0x30')](_0x295133[_0x2a4c('0x31')],_0x295133[_0x2a4c('0x2e')]);_0x5c7872['attributes']=_['intersection'](_0x295133['model'],qs[_0x2a4c('0x32')](_0x224e56[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0x5c7872[_0x2a4c('0x33')]=_0x5c7872[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x5c7872[_0x2a4c('0x33')]:_0x295133['model'];if(_0x224e56[_0x2a4c('0x2e')][_0x2a4c('0x41')]){_0x5c7872['include']=[{'all':!![]}];}_0x5c7872=_['merge']({},_0x5c7872,_0x224e56['options']);return db[_0x2a4c('0x29')][_0x2a4c('0x42')](_0x5c7872)[_0x2a4c('0x22')](handleEntityNotFound(_0x1750e3,null))[_0x2a4c('0x22')](respondWithResult(_0x1750e3,null))[_0x2a4c('0x43')](handleError(_0x1750e3,null));};exports[_0x2a4c('0x44')]=function(_0xf2427e,_0x46e2bf){return db[_0x2a4c('0x29')]['create'](_0xf2427e[_0x2a4c('0x45')],{})[_0x2a4c('0x22')](function(_0x487b1b){var _0x45b5bf=_0xf2427e['user'][_0x2a4c('0x23')]({'plain':!![]});if(!_0x45b5bf)throw new Error(_0x2a4c('0x46'));if(_0x45b5bf[_0x2a4c('0x47')]===_0x2a4c('0x48')){var _0x5b671d=_0x487b1b['get']({'plain':!![]});var _0x44e8c1='Triggers';return db['UserProfileSection'][_0x2a4c('0x42')]({'where':{'name':_0x44e8c1,'userProfileId':_0x45b5bf[_0x2a4c('0x49')]},'raw':!![]})['then'](function(_0x2c5684){if(_0x2c5684&&_0x2c5684[_0x2a4c('0x4a')]===0x0){return db[_0x2a4c('0x24')]['create']({'name':_0x5b671d['name'],'resourceId':_0x5b671d['id'],'type':_0x2c5684[_0x2a4c('0x26')],'sectionId':_0x2c5684['id']},{})[_0x2a4c('0x22')](function(){return _0x487b1b;});}else{return _0x487b1b;}})[_0x2a4c('0x43')](function(_0x210a76){logger[_0x2a4c('0x4b')](_0x2a4c('0x4c'),_0x210a76);throw _0x210a76;});}return _0x487b1b;})['then'](respondWithResult(_0x46e2bf,0xc9))[_0x2a4c('0x43')](handleError(_0x46e2bf,null));};exports[_0x2a4c('0x20')]=function(_0x5917d3,_0x405ab2){if(_0x5917d3[_0x2a4c('0x45')]['id']){delete _0x5917d3[_0x2a4c('0x45')]['id'];}return db[_0x2a4c('0x29')]['find']({'where':{'id':_0x5917d3['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x405ab2,null))[_0x2a4c('0x22')](saveUpdates(_0x5917d3[_0x2a4c('0x45')],null))[_0x2a4c('0x22')](respondWithResult(_0x405ab2,null))[_0x2a4c('0x43')](handleError(_0x405ab2,null));};exports[_0x2a4c('0x21')]=function(_0x435988,_0x45c80b){return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x435988[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x45c80b,null))[_0x2a4c('0x22')](removeEntity(_0x45c80b,null))[_0x2a4c('0x43')](handleError(_0x45c80b,null));};exports['addAllCondition']=function(_0x4936c5,_0x531fe9,_0x1d70bc){if(_0x4936c5['body']['id']){delete _0x4936c5['body']['id'];}return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x4936c5[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x531fe9,null))[_0x2a4c('0x22')](function(_0x442532){if(_0x442532){_0x4936c5[_0x2a4c('0x45')][_0x2a4c('0x4e')]=_0x442532['id'];return db[_0x2a4c('0x4f')]['create'](_0x4936c5[_0x2a4c('0x45')]);}})[_0x2a4c('0x22')](respondWithResult(_0x531fe9,null))[_0x2a4c('0x43')](handleError(_0x531fe9,null));};exports['addAnyCondition']=function(_0x3fb6b4,_0x382c67,_0x2824d0){if(_0x3fb6b4['body']['id']){delete _0x3fb6b4[_0x2a4c('0x45')]['id'];}return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x3fb6b4[_0x2a4c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x382c67,null))['then'](function(_0x1a2186){if(_0x1a2186){_0x3fb6b4[_0x2a4c('0x45')]['TriggerAnyId']=_0x1a2186['id'];return db[_0x2a4c('0x4f')][_0x2a4c('0x44')](_0x3fb6b4[_0x2a4c('0x45')]);}})[_0x2a4c('0x22')](respondWithResult(_0x382c67,null))[_0x2a4c('0x43')](handleError(_0x382c67,null));};exports[_0x2a4c('0x50')]=function(_0x2e2bf6,_0x27ff98,_0x5536f5){var _0x1243fc={};var _0x38b062={};var _0x15e366;var _0x5a0043;return db['Trigger'][_0x2a4c('0x51')]({'where':{'id':_0x2e2bf6['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x27ff98,null))[_0x2a4c('0x22')](function(_0x5aec26){if(_0x5aec26){_0x15e366=_0x5aec26;_0x38b062['model']=_[_0x2a4c('0x3f')](db['Condition']['rawAttributes']);_0x38b062[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x2e2bf6[_0x2a4c('0x2e')]);_0x38b062['filters']=_[_0x2a4c('0x30')](_0x38b062['model'],_0x38b062[_0x2a4c('0x2e')]);_0x1243fc[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x38b062[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x2e2bf6['query'][_0x2a4c('0x32')]));_0x1243fc['attributes']=_0x1243fc[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x1243fc['attributes']:_0x38b062['model'];_0x1243fc[_0x2a4c('0x35')]=qs[_0x2a4c('0x36')](_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x36')]);_0x1243fc[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_['pick'](_0x2e2bf6[_0x2a4c('0x2e')],_0x38b062[_0x2a4c('0x2f')]));if(_0x2e2bf6['query'][_0x2a4c('0x38')]){_0x1243fc[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0x1243fc[_0x2a4c('0x39')],{'$or':_[_0x2a4c('0x2d')](_0x1243fc['attributes'],function(_0x2eadd0){var _0x560669={};_0x560669[_0x2eadd0]={'$like':'%'+_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x560669;})});}_0x1243fc=_[_0x2a4c('0x3b')]({},_0x1243fc,_0x2e2bf6[_0x2a4c('0x52')]);return _0x15e366[_0x2a4c('0x50')](_0x1243fc);}})[_0x2a4c('0x22')](function(_0xa369b6){if(_0xa369b6){_0x5a0043=_0xa369b6[_0x2a4c('0x40')];if(!_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0x1243fc['limit']=qs[_0x2a4c('0x17')](_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x17')]);_0x1243fc[_0x2a4c('0x19')]=qs['offset'](_0x2e2bf6[_0x2a4c('0x2e')]['offset']);}return _0x15e366[_0x2a4c('0x50')](_0x1243fc);}})[_0x2a4c('0x22')](function(_0x4bfeda){if(_0x4bfeda){return _0x4bfeda?{'count':_0x5a0043,'rows':_0x4bfeda}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x27ff98,null))[_0x2a4c('0x43')](handleError(_0x27ff98,null));};exports[_0x2a4c('0x54')]=function(_0x21f8c3,_0x40321c,_0x127d5c){var _0xe0883f={};var _0x4a7ace={};var _0xf44176;var _0x217061;return db['Trigger'][_0x2a4c('0x51')]({'where':{'id':_0x21f8c3['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x40321c,null))[_0x2a4c('0x22')](function(_0x265d92){if(_0x265d92){_0xf44176=_0x265d92;_0x4a7ace[_0x2a4c('0x31')]=_['keys'](db['Condition'][_0x2a4c('0x55')]);_0x4a7ace[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x21f8c3[_0x2a4c('0x2e')]);_0x4a7ace[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x4a7ace[_0x2a4c('0x31')],_0x4a7ace[_0x2a4c('0x2e')]);_0xe0883f[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x4a7ace['model'],qs['fields'](_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0xe0883f['attributes']=_0xe0883f[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0xe0883f['attributes']:_0x4a7ace['model'];_0xe0883f[_0x2a4c('0x35')]=qs[_0x2a4c('0x36')](_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x36')]);_0xe0883f[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x21f8c3[_0x2a4c('0x2e')],_0x4a7ace[_0x2a4c('0x2f')]));if(_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x38')]){_0xe0883f[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0xe0883f[_0x2a4c('0x39')],{'$or':_['map'](_0xe0883f[_0x2a4c('0x33')],function(_0x5e3545){var _0x4a7865={};_0x4a7865[_0x5e3545]={'$like':'%'+_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x4a7865;})});}_0xe0883f=_[_0x2a4c('0x3b')]({},_0xe0883f,_0x21f8c3[_0x2a4c('0x52')]);return _0xf44176[_0x2a4c('0x54')](_0xe0883f);}})[_0x2a4c('0x22')](function(_0x4c6d5e){if(_0x4c6d5e){_0x217061=_0x4c6d5e['length'];if(!_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0xe0883f[_0x2a4c('0x17')]=qs[_0x2a4c('0x17')](_0x21f8c3[_0x2a4c('0x2e')]['limit']);_0xe0883f[_0x2a4c('0x19')]=qs[_0x2a4c('0x19')](_0x21f8c3['query'][_0x2a4c('0x19')]);}return _0xf44176[_0x2a4c('0x54')](_0xe0883f);}})[_0x2a4c('0x22')](function(_0x6beba9){if(_0x6beba9){return _0x6beba9?{'count':_0x217061,'rows':_0x6beba9}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x40321c,null))[_0x2a4c('0x43')](handleError(_0x40321c,null));};exports[_0x2a4c('0x56')]=function(_0x4d6b0f,_0x461740,_0x41b1a5){if(_0x4d6b0f[_0x2a4c('0x45')]['id']){delete _0x4d6b0f['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x4d6b0f['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x461740,null))[_0x2a4c('0x22')](function(_0x280ca3){if(_0x280ca3){_0x4d6b0f['body'][_0x2a4c('0x57')]=_0x280ca3['id'];return db['Action'][_0x2a4c('0x44')](_0x4d6b0f[_0x2a4c('0x45')]);}})['then'](respondWithResult(_0x461740,null))[_0x2a4c('0x43')](handleError(_0x461740,null));};exports[_0x2a4c('0x58')]=function(_0x53a4cf,_0x1b7028,_0x7c4c6c){var _0x15dd1e={};var _0x302259={};var _0x38c9e9;var _0x1cadbf;return db[_0x2a4c('0x29')]['findOne']({'where':{'id':_0x53a4cf[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x1b7028,null))[_0x2a4c('0x22')](function(_0x506376){if(_0x506376){_0x38c9e9=_0x506376;_0x302259[_0x2a4c('0x31')]=_['keys'](db[_0x2a4c('0x59')]['rawAttributes']);_0x302259[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x53a4cf['query']);_0x302259[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x302259[_0x2a4c('0x31')],_0x302259['query']);_0x15dd1e[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x302259[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0x15dd1e[_0x2a4c('0x33')]=_0x15dd1e[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x15dd1e[_0x2a4c('0x33')]:_0x302259[_0x2a4c('0x31')];_0x15dd1e['order']=qs[_0x2a4c('0x36')](_0x53a4cf['query'][_0x2a4c('0x36')]);_0x15dd1e[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x53a4cf['query'],_0x302259[_0x2a4c('0x2f')]));if(_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x38')]){_0x15dd1e[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0x15dd1e[_0x2a4c('0x39')],{'$or':_[_0x2a4c('0x2d')](_0x15dd1e[_0x2a4c('0x33')],function(_0x52ec28){var _0x4807fd={};_0x4807fd[_0x52ec28]={'$like':'%'+_0x53a4cf[_0x2a4c('0x2e')]['filter']+'%'};return _0x4807fd;})});}_0x15dd1e=_[_0x2a4c('0x3b')]({},_0x15dd1e,_0x53a4cf[_0x2a4c('0x52')]);return _0x38c9e9[_0x2a4c('0x58')](_0x15dd1e);}})['then'](function(_0x66c431){if(_0x66c431){_0x1cadbf=_0x66c431['length'];if(!_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0x15dd1e[_0x2a4c('0x17')]=qs[_0x2a4c('0x17')](_0x53a4cf[_0x2a4c('0x2e')]['limit']);_0x15dd1e[_0x2a4c('0x19')]=qs[_0x2a4c('0x19')](_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x19')]);}return _0x38c9e9[_0x2a4c('0x58')](_0x15dd1e);}})[_0x2a4c('0x22')](function(_0x50efd4){if(_0x50efd4){return _0x50efd4?{'count':_0x1cadbf,'rows':_0x50efd4}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x1b7028,null))[_0x2a4c('0x43')](handleError(_0x1b7028,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a1e64d9..ad6dc62 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 _0x9181=['Trigger','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x9181,0x182));var _0x1918=function(_0x39ff60,_0x501ae8){_0x39ff60=_0x39ff60-0x0;var _0xa3a946=_0x9181[_0x39ff60];return _0xa3a946;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var logger=require(_0x1918('0x2'))(_0x1918('0x3'));var moment=require(_0x1918('0x4'));var BPromise=require('bluebird');var rp=require(_0x1918('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var attributes=require(_0x1918('0x8'));module[_0x1918('0x9')]=function(_0x424951,_0x4106d7){return _0x424951['define'](_0x1918('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafe6=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','moment','bluebird'];(function(_0x189552,_0x39b6e3){var _0x12652a=function(_0x1f1e83){while(--_0x1f1e83){_0x189552['push'](_0x189552['shift']());}};_0x12652a(++_0x39b6e3);}(_0xafe6,0xac));var _0x6afe=function(_0x93fac6,_0x5a5058){_0x93fac6=_0x93fac6-0x0;var _0x1a206e=_0xafe6[_0x93fac6];return _0x1a206e;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6afe('0x2'));var BPromise=require(_0x6afe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6afe('0x4'));var config=require(_0x6afe('0x5'));var attributes=require(_0x6afe('0x6'));module[_0x6afe('0x7')]=function(_0x2ce302,_0x4898bb){return _0x2ce302[_0x6afe('0x8')](_0x6afe('0x9'),attributes,{'tableName':_0x6afe('0xa'),'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 61dbde7..aa84683 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 _0x4d08=['http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','result','catch','Trigger','findAll','options','raw','where','include','map','model','attributes','GetTrigger','stringify','ShowTrigger','find','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0xfdbd37,_0x5f17de){var _0x45a78c=function(_0x3ea4d6){while(--_0x3ea4d6){_0xfdbd37['push'](_0xfdbd37['shift']());}};_0x45a78c(++_0x5f17de);}(_0x4d08,0x119));var _0x84d0=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x4d08[_0x56e4e7];return _0x383618;};'use strict';var _=require(_0x84d0('0x0'));var util=require(_0x84d0('0x1'));var moment=require(_0x84d0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84d0('0x3'));var db=require(_0x84d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84d0('0x5'));var config=require(_0x84d0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x84d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea90a,_0x4f88db,_0x5e9004){return new BPromise(function(_0x3e61f,_0x4f62b4){return client[_0x84d0('0x8')](_0x1ea90a,_0x5e9004)[_0x84d0('0x9')](function(_0x31b1c9){logger[_0x84d0('0xa')](_0x84d0('0xb'),_0x4f88db,_0x84d0('0xc'));logger[_0x84d0('0xd')](_0x84d0('0xe'),_0x4f88db,_0x84d0('0xc'),JSON['stringify'](_0x31b1c9));if(_0x31b1c9[_0x84d0('0xf')]){if(_0x31b1c9['error']['code']===0x1f4){logger['error'](_0x84d0('0xb'),_0x4f88db,_0x31b1c9[_0x84d0('0xf')]['message']);return _0x4f62b4(_0x31b1c9[_0x84d0('0xf')][_0x84d0('0x10')]);}logger[_0x84d0('0xf')]('Trigger,\x20%s,\x20%s',_0x4f88db,_0x31b1c9['error'][_0x84d0('0x10')]);return _0x3e61f(_0x31b1c9[_0x84d0('0xf')]['message']);}else{logger['info'](_0x84d0('0xb'),_0x4f88db,_0x84d0('0xc'));_0x3e61f(_0x31b1c9[_0x84d0('0x11')][_0x84d0('0x10')]);}})[_0x84d0('0x12')](function(_0x2c2461){logger[_0x84d0('0xf')]('Trigger,\x20%s,\x20%s',_0x4f88db,_0x2c2461);_0x4f62b4(_0x2c2461);});});}exports['GetTrigger']=function(_0x33269a){var _0x3e4706=this;return new Promise(function(_0x45eed3,_0x51ef79){return db[_0x84d0('0x13')][_0x84d0('0x14')]({'raw':_0x33269a[_0x84d0('0x15')]?_0x33269a['options'][_0x84d0('0x16')]===undefined?!![]:![]:!![],'where':_0x33269a['options']?_0x33269a[_0x84d0('0x15')][_0x84d0('0x17')]||null:null,'attributes':_0x33269a[_0x84d0('0x15')]?_0x33269a['options']['attributes']||null:null,'limit':_0x33269a[_0x84d0('0x15')]?_0x33269a[_0x84d0('0x15')]['limit']||null:null,'include':_0x33269a[_0x84d0('0x15')]?_0x33269a[_0x84d0('0x15')][_0x84d0('0x18')]?_[_0x84d0('0x19')](_0x33269a[_0x84d0('0x15')]['include'],function(_0x5cf8b7){return{'model':db[_0x5cf8b7[_0x84d0('0x1a')]],'as':_0x5cf8b7['as'],'attributes':_0x5cf8b7['attributes'],'include':_0x5cf8b7[_0x84d0('0x18')]?_['map'](_0x5cf8b7['include'],function(_0x40fb27){return{'model':db[_0x40fb27[_0x84d0('0x1a')]],'as':_0x40fb27['as'],'attributes':_0x40fb27[_0x84d0('0x1b')],'include':_0x40fb27[_0x84d0('0x18')]?_[_0x84d0('0x19')](_0x40fb27[_0x84d0('0x18')],function(_0xf5122){return{'model':db[_0xf5122[_0x84d0('0x1a')]],'as':_0xf5122['as'],'attributes':_0xf5122[_0x84d0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84d0('0x9')](function(_0x24084d){logger['info']('GetTrigger',_0x33269a);logger[_0x84d0('0xd')](_0x84d0('0x1c'),_0x33269a,JSON[_0x84d0('0x1d')](_0x24084d));_0x45eed3(_0x24084d);})[_0x84d0('0x12')](function(_0x2133f4){logger[_0x84d0('0xf')]('GetTrigger',_0x2133f4[_0x84d0('0x10')],_0x33269a);_0x51ef79(_0x3e4706[_0x84d0('0xf')](0x1f4,_0x2133f4[_0x84d0('0x10')]));});});};exports[_0x84d0('0x1e')]=function(_0x2ac201){var _0xb8486c=this;return new Promise(function(_0x533658,_0x247592){return db[_0x84d0('0x13')][_0x84d0('0x1f')]({'raw':_0x2ac201[_0x84d0('0x15')]?_0x2ac201[_0x84d0('0x15')][_0x84d0('0x16')]===undefined?!![]:![]:!![],'where':_0x2ac201[_0x84d0('0x15')]?_0x2ac201[_0x84d0('0x15')][_0x84d0('0x17')]||null:null,'attributes':_0x2ac201['options']?_0x2ac201['options'][_0x84d0('0x1b')]||null:null,'include':_0x2ac201['options']?_0x2ac201[_0x84d0('0x15')][_0x84d0('0x18')]?_[_0x84d0('0x19')](_0x2ac201[_0x84d0('0x15')][_0x84d0('0x18')],function(_0x2ffb2f){return{'model':db[_0x2ffb2f[_0x84d0('0x1a')]],'as':_0x2ffb2f['as'],'attributes':_0x2ffb2f[_0x84d0('0x1b')],'include':_0x2ffb2f[_0x84d0('0x18')]?_[_0x84d0('0x19')](_0x2ffb2f[_0x84d0('0x18')],function(_0x41e8fa){return{'model':db[_0x41e8fa[_0x84d0('0x1a')]],'as':_0x41e8fa['as'],'attributes':_0x41e8fa[_0x84d0('0x1b')],'include':_0x41e8fa['include']?_[_0x84d0('0x19')](_0x41e8fa['include'],function(_0x87d45){return{'model':db[_0x87d45[_0x84d0('0x1a')]],'as':_0x87d45['as'],'attributes':_0x87d45[_0x84d0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84d0('0x9')](function(_0x3e2192){logger[_0x84d0('0xa')](_0x84d0('0x1e'),_0x2ac201);logger[_0x84d0('0xd')](_0x84d0('0x1e'),_0x2ac201,JSON[_0x84d0('0x1d')](_0x3e2192));_0x533658(_0x3e2192);})[_0x84d0('0x12')](function(_0x283720){logger['error']('ShowTrigger',_0x283720['message'],_0x2ac201);_0x247592(_0xb8486c[_0x84d0('0xf')](0x1f4,_0x283720[_0x84d0('0x10')]));});});}; \ No newline at end of file +var _0xf7b7=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trigger','options','raw','where','attributes','include','map','model','GetTrigger','ShowTrigger','lodash','bluebird','randomstring','ioredis'];(function(_0x268c23,_0x3f79c2){var _0x5d3ee2=function(_0x44affd){while(--_0x44affd){_0x268c23['push'](_0x268c23['shift']());}};_0x5d3ee2(++_0x3f79c2);}(_0xf7b7,0x1cd));var _0x7f7b=function(_0x1fae53,_0x28f2e0){_0x1fae53=_0x1fae53-0x0;var _0x39f959=_0xf7b7[_0x1fae53];return _0x39f959;};'use strict';var _=require(_0x7f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f7b('0x1'));var rs=require(_0x7f7b('0x2'));var fs=require('fs');var Redis=require(_0x7f7b('0x3'));var db=require(_0x7f7b('0x4'))['db'];var utils=require(_0x7f7b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f7b('0x6'));var jayson=require(_0x7f7b('0x7'));var client=jayson['client'][_0x7f7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc90,_0x34ab3e,_0x43a424){return new BPromise(function(_0x7722ed,_0x452292){return client[_0x7f7b('0x9')](_0x1ccc90,_0x43a424)[_0x7f7b('0xa')](function(_0x43e3bc){logger[_0x7f7b('0xb')](_0x7f7b('0xc'),_0x34ab3e,_0x7f7b('0xd'));logger[_0x7f7b('0xe')](_0x7f7b('0xf'),_0x34ab3e,_0x7f7b('0xd'),JSON[_0x7f7b('0x10')](_0x43e3bc));if(_0x43e3bc[_0x7f7b('0x11')]){if(_0x43e3bc[_0x7f7b('0x11')][_0x7f7b('0x12')]===0x1f4){logger[_0x7f7b('0x11')]('Trigger,\x20%s,\x20%s',_0x34ab3e,_0x43e3bc['error'][_0x7f7b('0x13')]);return _0x452292(_0x43e3bc[_0x7f7b('0x11')]['message']);}logger[_0x7f7b('0x11')](_0x7f7b('0xc'),_0x34ab3e,_0x43e3bc[_0x7f7b('0x11')][_0x7f7b('0x13')]);return _0x7722ed(_0x43e3bc['error'][_0x7f7b('0x13')]);}else{logger['info'](_0x7f7b('0xc'),_0x34ab3e,_0x7f7b('0xd'));_0x7722ed(_0x43e3bc['result'][_0x7f7b('0x13')]);}})[_0x7f7b('0x14')](function(_0x371ec8){logger[_0x7f7b('0x11')](_0x7f7b('0xc'),_0x34ab3e,_0x371ec8);_0x452292(_0x371ec8);});});}exports['GetTrigger']=function(_0x408bc9){var _0x23ec11=this;return new Promise(function(_0x354b2e,_0x5eb1f1){return db[_0x7f7b('0x15')]['findAll']({'raw':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x17')]===undefined?!![]:![]:!![],'where':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x18')]||null:null,'attributes':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x19')]||null:null,'limit':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')]['limit']||null:null,'include':_0x408bc9['options']?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x1a')],function(_0xf7c9cc){return{'model':db[_0xf7c9cc['model']],'as':_0xf7c9cc['as'],'attributes':_0xf7c9cc[_0x7f7b('0x19')],'include':_0xf7c9cc[_0x7f7b('0x1a')]?_['map'](_0xf7c9cc['include'],function(_0x33e7c9){return{'model':db[_0x33e7c9['model']],'as':_0x33e7c9['as'],'attributes':_0x33e7c9['attributes'],'include':_0x33e7c9[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x33e7c9[_0x7f7b('0x1a')],function(_0x4166d2){return{'model':db[_0x4166d2[_0x7f7b('0x1c')]],'as':_0x4166d2['as'],'attributes':_0x4166d2[_0x7f7b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7f7b('0xa')](function(_0x443674){logger['info'](_0x7f7b('0x1d'),_0x408bc9);logger[_0x7f7b('0xe')](_0x7f7b('0x1d'),_0x408bc9,JSON['stringify'](_0x443674));_0x354b2e(_0x443674);})[_0x7f7b('0x14')](function(_0xa66916){logger['error'](_0x7f7b('0x1d'),_0xa66916[_0x7f7b('0x13')],_0x408bc9);_0x5eb1f1(_0x23ec11[_0x7f7b('0x11')](0x1f4,_0xa66916[_0x7f7b('0x13')]));});});};exports[_0x7f7b('0x1e')]=function(_0x38f5fa){var _0x2fd8b3=this;return new Promise(function(_0x1ab118,_0x1ae2fa){return db[_0x7f7b('0x15')]['find']({'raw':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x17')]===undefined?!![]:![]:!![],'where':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa['options']['where']||null:null,'attributes':_0x38f5fa['options']?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x19')]||null:null,'include':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x1a')]?_['map'](_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x1a')],function(_0x576d81){return{'model':db[_0x576d81[_0x7f7b('0x1c')]],'as':_0x576d81['as'],'attributes':_0x576d81[_0x7f7b('0x19')],'include':_0x576d81[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x576d81[_0x7f7b('0x1a')],function(_0xd41893){return{'model':db[_0xd41893['model']],'as':_0xd41893['as'],'attributes':_0xd41893[_0x7f7b('0x19')],'include':_0xd41893[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0xd41893[_0x7f7b('0x1a')],function(_0x556e92){return{'model':db[_0x556e92[_0x7f7b('0x1c')]],'as':_0x556e92['as'],'attributes':_0x556e92[_0x7f7b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7f7b('0xa')](function(_0x336cd8){logger[_0x7f7b('0xb')](_0x7f7b('0x1e'),_0x38f5fa);logger[_0x7f7b('0xe')]('ShowTrigger',_0x38f5fa,JSON[_0x7f7b('0x10')](_0x336cd8));_0x1ab118(_0x336cd8);})[_0x7f7b('0x14')](function(_0x153382){logger[_0x7f7b('0x11')]('ShowTrigger',_0x153382['message'],_0x38f5fa);_0x1ae2fa(_0x2fd8b3['error'](0x1f4,_0x153382['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index cc12feb..7191e6b 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 _0x52f6=['put','update','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','get','/:id','show','post'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_0x52f6,0x83));var _0x652f=function(_0x4b6214,_0x59bb66){_0x4b6214=_0x4b6214-0x0;var _0x3cf589=_0x52f6[_0x4b6214];return _0x3cf589;};'use strict';var multer=require(_0x652f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x652f('0x1'));var express=require(_0x652f('0x2'));var router=express[_0x652f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x652f('0x4'));var interaction=require(_0x652f('0x5'));var config=require(_0x652f('0x6'));var controller=require(_0x652f('0x7'));router['get']('/',auth[_0x652f('0x8')](),controller['index']);router[_0x652f('0x9')](_0x652f('0xa'),auth[_0x652f('0x8')](),controller[_0x652f('0xb')]);router[_0x652f('0xc')]('/:id/clone',auth[_0x652f('0x8')](),controller['clone']);router[_0x652f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x652f('0xd')]('/:id',auth[_0x652f('0x8')](),controller[_0x652f('0xe')]);router['delete']('/:id',auth[_0x652f('0x8')](),controller['destroy']);module[_0x652f('0xf')]=router; \ No newline at end of file +var _0xc1af=['show','post','/:id/clone','clone','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x523bb2,_0x331d0d){var _0x2bca92=function(_0x3f5a6f){while(--_0x3f5a6f){_0x523bb2['push'](_0x523bb2['shift']());}};_0x2bca92(++_0x331d0d);}(_0xc1af,0x79));var _0xfc1a=function(_0x4d9b8b,_0x17724d){_0x4d9b8b=_0x4d9b8b-0x0;var _0x16bc6b=_0xc1af[_0x4d9b8b];return _0x16bc6b;};'use strict';var multer=require('multer');var util=require(_0xfc1a('0x0'));var path=require(_0xfc1a('0x1'));var timeout=require(_0xfc1a('0x2'));var express=require(_0xfc1a('0x3'));var router=express[_0xfc1a('0x4')]();var fs_extra=require(_0xfc1a('0x5'));var auth=require(_0xfc1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfc1a('0x7'));var controller=require('./trunk.controller');router[_0xfc1a('0x8')]('/',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xa')]);router['get'](_0xfc1a('0xb'),auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xc')]);router[_0xfc1a('0xd')](_0xfc1a('0xe'),auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfc1a('0x10')](_0xfc1a('0xb'),auth['isAuthenticated'](),controller[_0xfc1a('0x11')]);router['delete']('/:id',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 71bec7d..269b56e 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 _0x75b4=['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','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','split','rfc2833','shortinfo','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x75b4,0x1cf));var _0x475b=function(_0x185ae2,_0x44ee9d){_0x185ae2=_0x185ae2-0x0;var _0x4beb86=_0x75b4[_0x185ae2];return _0x4beb86;};'use strict';var Sequelize=require(_0x475b('0x0'));module[_0x475b('0x1')]={'name':{'type':Sequelize[_0x475b('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x475b('0x3')]('friend',_0x475b('0x4'),_0x475b('0x5')),'allowNull':![],'defaultValue':_0x475b('0x6')},'context':{'type':Sequelize[_0x475b('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x7'),_0x475b('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0x475b('0x9'),_0x475b('0xa'),_0x475b('0xb'))},'deny':{'type':Sequelize[_0x475b('0x2')]},'permit':{'type':Sequelize[_0x475b('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x475b('0x2')],'defaultValue':'udp','set':function(_0x58676e){this['setDataValue'](_0x475b('0xc'),_0x58676e?_0x58676e[_0x475b('0xd')](','):null);},'get':function(){return this[_0x475b('0xe')](_0x475b('0xc'))?this[_0x475b('0xe')](_0x475b('0xc'))[_0x475b('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x10'),'info',_0x475b('0x11'),'inband',_0x475b('0x12')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no',_0x475b('0x14'),_0x475b('0x15'),_0x475b('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x475b('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x475b('0x2')]},'directmediadeny':{'type':Sequelize[_0x475b('0x2')]},'nat':{'type':Sequelize[_0x475b('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x14ff50){this['setDataValue']('nat',_0x14ff50?_0x14ff50['join'](','):null);},'get':function(){return this[_0x475b('0xe')](_0x475b('0x17'))?this['getDataValue'](_0x475b('0x17'))['split'](','):null;},'comment':_0x475b('0x18')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x475b('0x2')]},'pickupgroup':{'type':Sequelize[_0x475b('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x475b('0x2')]},'language':{'type':Sequelize[_0x475b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x475b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x475b('0x2')],'defaultValue':_0x475b('0x19')},'allow':{'type':Sequelize[_0x475b('0x2')],'allowNull':![],'defaultValue':_0x475b('0x1a'),'set':function(_0x247306){this['setDataValue'](_0x475b('0x1b'),_0x247306?_0x247306['join'](';'):_0x475b('0x1a'));},'get':function(){return this['getDataValue'](_0x475b('0x1b'))?this['getDataValue'](_0x475b('0x1b'))['split'](';'):null;},'comment':_0x475b('0x1c')},'autoframing':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x475b('0x1d'),'set':function(_0xc82584){this['setDataValue'](_0x475b('0x1e'),_0xc82584?_0xc82584['join'](','):null);},'get':function(){return this[_0x475b('0xe')](_0x475b('0x1e'))?this[_0x475b('0xe')]('insecure')['split'](','):null;},'comment':_0x475b('0x1f')},'trustrpid':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no',_0x475b('0x20'))},'promiscredir':{'type':Sequelize[_0x475b('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'accountcode':{'type':Sequelize[_0x475b('0x21')](0xb)},'setvar':{'type':Sequelize[_0x475b('0x2')]},'callerid':{'type':Sequelize[_0x475b('0x2')],'defaultValue':_0x475b('0x22')},'amaflags':{'type':Sequelize[_0x475b('0x2')]},'callcounter':{'type':Sequelize[_0x475b('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x475b('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x475b('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x475b('0x2')]},'videosupport':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no',_0x475b('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x475b('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x475b('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x475b('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x475b('0x24'),_0x475b('0x25'),_0x475b('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x475b('0x21')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'defaultValue':_0x475b('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x475b('0x2')]},'regexten':{'type':Sequelize[_0x475b('0x2')]},'fromdomain':{'type':Sequelize[_0x475b('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x475b('0x21')](0x5)},'qualify':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no'),'defaultValue':_0x475b('0x13')},'keepalive':{'type':Sequelize[_0x475b('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x475b('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x475b('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x475b('0x3')]('yes','no',_0x475b('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x475b('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x475b('0x21')](0xb)},'timerb':{'type':Sequelize[_0x475b('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x475b('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x475b('0x2')]},'contactdeny':{'type':Sequelize[_0x475b('0x2')]},'contactacl':{'type':Sequelize[_0x475b('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x475b('0x2')]},'maxforwards':{'type':Sequelize[_0x475b('0x21')](0xb)},'encryption':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'force_avp':{'type':Sequelize[_0x475b('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no',_0x475b('0x29'),_0x475b('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x475b('0x21')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x475b('0x2')]},'dtlscipher':{'type':Sequelize[_0x475b('0x2')]},'dtlscafile':{'type':Sequelize[_0x475b('0x2')]},'dtlscapath':{'type':Sequelize[_0x475b('0x2')]},'dtlssetup':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x2b'),_0x475b('0x2c'),_0x475b('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x475b('0x2')]},'usereqphone':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x475b('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x475b('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x475b('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x475b('0x3')](_0x475b('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x475b('0x2')]},'mohsuggest':{'type':Sequelize[_0x475b('0x2')]},'parkinglot':{'type':Sequelize[_0x475b('0x2')]},'description':{'type':Sequelize[_0x475b('0x2')]},'host':{'type':Sequelize[_0x475b('0x2')],'defaultValue':_0x475b('0x2e')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x475b('0x14'),_0x475b('0x15'),_0x475b('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x475b('0x2')]},'otherFields':{'type':Sequelize[_0x475b('0x2')]},'active':{'type':Sequelize[_0x475b('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x475b('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0b52=['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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','refuse','originate','uac','uas','pai','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat'];(function(_0xb5ec2e,_0x539083){var _0x37de36=function(_0x4d8f53){while(--_0x4d8f53){_0xb5ec2e['push'](_0xb5ec2e['shift']());}};_0x37de36(++_0x539083);}(_0x0b52,0x1e4));var _0x20b5=function(_0x168457,_0x56d669){_0x168457=_0x168457-0x0;var _0x22d916=_0x0b52[_0x168457];return _0x22d916;};'use strict';var Sequelize=require(_0x20b5('0x0'));module['exports']={'name':{'type':Sequelize[_0x20b5('0x1')],'allowNull':![],'unique':_0x20b5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x20b5('0x3'),_0x20b5('0x4'),_0x20b5('0x5')),'allowNull':![],'defaultValue':_0x20b5('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x20b5('0x6')},'callingpres':{'type':Sequelize[_0x20b5('0x7')]('ALLOWED_NOT_SCREENED',_0x20b5('0x8'),_0x20b5('0x9'),'ALLOWED',_0x20b5('0xa'),_0x20b5('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x20b5('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x20b5('0x1')]},'remotesecret':{'type':Sequelize[_0x20b5('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x20b5('0xc'),'set':function(_0x1cbde1){this[_0x20b5('0xd')](_0x20b5('0xe'),_0x1cbde1?_0x1cbde1[_0x20b5('0xf')](','):null);},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0xe'))?this[_0x20b5('0x10')](_0x20b5('0xe'))[_0x20b5('0x11')](','):null;},'comment':_0x20b5('0x12')},'dtmfmode':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x13'),_0x20b5('0x14'),_0x20b5('0x15'),_0x20b5('0x16'),_0x20b5('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x19'),'update',_0x20b5('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x20b5('0x1')]},'directmediadeny':{'type':Sequelize[_0x20b5('0x1')]},'nat':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x1b'),'set':function(_0x1e0a2e){this['setDataValue'](_0x20b5('0x1c'),_0x1e0a2e?_0x1e0a2e[_0x20b5('0xf')](','):null);},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0x1c'))?this[_0x20b5('0x10')](_0x20b5('0x1c'))['split'](','):null;},'comment':_0x20b5('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x20b5('0x1')]},'pickupgroup':{'type':Sequelize[_0x20b5('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x20b5('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x1e')},'allow':{'type':Sequelize[_0x20b5('0x1')],'allowNull':![],'defaultValue':_0x20b5('0x1f'),'set':function(_0x44613b){this[_0x20b5('0xd')](_0x20b5('0x20'),_0x44613b?_0x44613b['join'](';'):_0x20b5('0x1f'));},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0x20'))?this[_0x20b5('0x10')](_0x20b5('0x20'))['split'](';'):null;},'comment':_0x20b5('0x21')},'autoframing':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x20b5('0x22'),'set':function(_0x1292e4){this[_0x20b5('0xd')]('insecure',_0x1292e4?_0x1292e4['join'](','):null);},'get':function(){return this['getDataValue'](_0x20b5('0x23'))?this[_0x20b5('0x10')](_0x20b5('0x23'))[_0x20b5('0x11')](','):null;},'comment':_0x20b5('0x24')},'trustrpid':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x25'))},'promiscredir':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'accountcode':{'type':Sequelize[_0x20b5('0x26')](0xb)},'setvar':{'type':Sequelize[_0x20b5('0x1')]},'callerid':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x20b5('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x20b5('0x1')]},'template':{'type':Sequelize[_0x20b5('0x1')]},'videosupport':{'type':Sequelize[_0x20b5('0x7')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x20b5('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'mailbox':{'type':Sequelize[_0x20b5('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x20b5('0x28'),_0x20b5('0x29'))},'session_expires':{'type':Sequelize[_0x20b5('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x20b5('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x2a'),_0x20b5('0x2b')),'defaultValue':_0x20b5('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x20b5('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x20b5('0x1')]},'fromuser':{'type':Sequelize[_0x20b5('0x1')]},'port':{'type':Sequelize[_0x20b5('0x26')](0x5)},'qualify':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':_0x20b5('0x18')},'keepalive':{'type':Sequelize[_0x20b5('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x20b5('0x1')]},'rtptimeout':{'type':Sequelize[_0x20b5('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x20b5('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x20b5('0x1')]},'callbackextension':{'type':Sequelize[_0x20b5('0x1')]},'timert1':{'type':Sequelize[_0x20b5('0x26')](0xb)},'timerb':{'type':Sequelize[_0x20b5('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x20b5('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x20b5('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x20b5('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x20b5('0x1')]},'maxforwards':{'type':Sequelize[_0x20b5('0x26')](0xb)},'encryption':{'type':Sequelize[_0x20b5('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x20b5('0x7')]('yes','no')},'force_avp':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'icesupport':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x20b5('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x20b5('0x1')]},'dtlscafile':{'type':Sequelize[_0x20b5('0x1')]},'dtlscapath':{'type':Sequelize[_0x20b5('0x1')]},'dtlssetup':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x2d'),_0x20b5('0x2e'),_0x20b5('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x20b5('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x20b5('0x1')]},'call_limit':{'type':Sequelize[_0x20b5('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'vmexten':{'type':Sequelize[_0x20b5('0x1')]},'mohinterpret':{'type':Sequelize[_0x20b5('0x1')]},'mohsuggest':{'type':Sequelize[_0x20b5('0x1')]},'parkinglot':{'type':Sequelize[_0x20b5('0x1')]},'description':{'type':Sequelize[_0x20b5('0x1')]},'host':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x30')},'canreinvite':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x19'),'update',_0x20b5('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x20b5('0x1')]},'otherFields':{'type':Sequelize[_0x20b5('0x1')]},'active':{'type':Sequelize[_0x20b5('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x20b5('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 d7fba7e..10dc108 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 _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3b2b55,_0x31c65d){_0x3b2b55=_0x3b2b55-0x0;var _0x172194=_0xe5b3[_0x3b2b55];return _0x172194;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +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(_0x283ff1,_0x5ecb57){var _0x480f7d=function(_0x131f70){while(--_0x131f70){_0x283ff1['push'](_0x283ff1['shift']());}};_0x480f7d(++_0x5ecb57);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2bd5ff,_0xfe80a5){_0x2bd5ff=_0x2bd5ff-0x0;var _0x5e1694=_0xd6d6[_0x2bd5ff];return _0x5e1694;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 572fe3b..78c135c 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 _0xea5c=['path','rimraf','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2a6def,_0x47772f){var _0x3bcc53=function(_0x108a8e){while(--_0x108a8e){_0x2a6def['push'](_0x2a6def['shift']());}};_0x3bcc53(++_0x47772f);}(_0xea5c,0x8a));var _0xcea5=function(_0x45497a,_0x513ab9){_0x45497a=_0x45497a-0x0;var _0x2637da=_0xea5c[_0x45497a];return _0x2637da;};'use strict';var _=require(_0xcea5('0x0'));var util=require('util');var logger=require(_0xcea5('0x1'))(_0xcea5('0x2'));var moment=require('moment');var BPromise=require(_0xcea5('0x3'));var rp=require(_0xcea5('0x4'));var fs=require('fs');var path=require(_0xcea5('0x5'));var rimraf=require(_0xcea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xcea5('0x7'));module[_0xcea5('0x8')]=function(_0x3a6466,_0x13d486){return _0x3a6466['define'](_0xcea5('0x9'),attributes,{'tableName':_0xcea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d0=['exports','define','Trunk','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x4a13db,_0x912364){var _0x3bdc9e=function(_0x2f3ed9){while(--_0x2f3ed9){_0x4a13db['push'](_0x4a13db['shift']());}};_0x3bdc9e(++_0x912364);}(_0xa3d0,0x1b3));var _0x0a3d=function(_0x4b6cbf,_0x3bb242){_0x4b6cbf=_0x4b6cbf-0x0;var _0x1d84bf=_0xa3d0[_0x4b6cbf];return _0x1d84bf;};'use strict';var _=require(_0x0a3d('0x0'));var util=require('util');var logger=require(_0x0a3d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a3d('0x2'));var fs=require('fs');var path=require(_0x0a3d('0x3'));var rimraf=require(_0x0a3d('0x4'));var config=require(_0x0a3d('0x5'));var attributes=require('./trunk.attributes');module[_0x0a3d('0x6')]=function(_0x196822,_0x15ac33){return _0x196822[_0x0a3d('0x7')](_0x0a3d('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 2d6c581..a5de1aa 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 _0x45ac=['result','catch','GetTrunk','Trunk','options','where','attributes','include','map','model','debug','ShowTrunk','find','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s'];(function(_0x250b5f,_0x45290b){var _0x5375ff=function(_0x296de4){while(--_0x296de4){_0x250b5f['push'](_0x250b5f['shift']());}};_0x5375ff(++_0x45290b);}(_0x45ac,0xf3));var _0xc45a=function(_0x585f40,_0x4a3091){_0x585f40=_0x585f40-0x0;var _0x44fc86=_0x45ac[_0x585f40];return _0x44fc86;};'use strict';var _=require(_0xc45a('0x0'));var util=require(_0xc45a('0x1'));var moment=require(_0xc45a('0x2'));var BPromise=require(_0xc45a('0x3'));var rs=require(_0xc45a('0x4'));var fs=require('fs');var Redis=require(_0xc45a('0x5'));var db=require(_0xc45a('0x6'))['db'];var utils=require(_0xc45a('0x7'));var logger=require(_0xc45a('0x8'))(_0xc45a('0x9'));var config=require(_0xc45a('0xa'));var jayson=require(_0xc45a('0xb'));var client=jayson[_0xc45a('0xc')][_0xc45a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x352d17,_0x58402d,_0x56fdf2){return new BPromise(function(_0x35c431,_0x43e510){return client[_0xc45a('0xe')](_0x352d17,_0x56fdf2)[_0xc45a('0xf')](function(_0x3d2e30){logger[_0xc45a('0x10')]('Trunk,\x20%s,\x20%s',_0x58402d,_0xc45a('0x11'));logger['debug'](_0xc45a('0x12'),_0x58402d,'request\x20sent',JSON['stringify'](_0x3d2e30));if(_0x3d2e30[_0xc45a('0x13')]){if(_0x3d2e30[_0xc45a('0x13')][_0xc45a('0x14')]===0x1f4){logger[_0xc45a('0x13')]('Trunk,\x20%s,\x20%s',_0x58402d,_0x3d2e30[_0xc45a('0x13')][_0xc45a('0x15')]);return _0x43e510(_0x3d2e30[_0xc45a('0x13')][_0xc45a('0x15')]);}logger[_0xc45a('0x13')]('Trunk,\x20%s,\x20%s',_0x58402d,_0x3d2e30[_0xc45a('0x13')][_0xc45a('0x15')]);return _0x35c431(_0x3d2e30['error'][_0xc45a('0x15')]);}else{logger[_0xc45a('0x10')](_0xc45a('0x16'),_0x58402d,_0xc45a('0x11'));_0x35c431(_0x3d2e30[_0xc45a('0x17')][_0xc45a('0x15')]);}})[_0xc45a('0x18')](function(_0x518ba7){logger[_0xc45a('0x13')](_0xc45a('0x16'),_0x58402d,_0x518ba7);_0x43e510(_0x518ba7);});});}exports[_0xc45a('0x19')]=function(_0x679ac3){var _0x2402ec=this;return new Promise(function(_0x7dbb57,_0x419b3c){return db[_0xc45a('0x1a')]['findAll']({'raw':_0x679ac3[_0xc45a('0x1b')]?_0x679ac3[_0xc45a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x679ac3[_0xc45a('0x1b')]?_0x679ac3[_0xc45a('0x1b')][_0xc45a('0x1c')]||null:null,'attributes':_0x679ac3['options']?_0x679ac3['options'][_0xc45a('0x1d')]||null:null,'limit':_0x679ac3['options']?_0x679ac3[_0xc45a('0x1b')]['limit']||null:null,'include':_0x679ac3['options']?_0x679ac3['options'][_0xc45a('0x1e')]?_[_0xc45a('0x1f')](_0x679ac3['options']['include'],function(_0x55956b){return{'model':db[_0x55956b[_0xc45a('0x20')]],'as':_0x55956b['as'],'attributes':_0x55956b['attributes'],'include':_0x55956b[_0xc45a('0x1e')]?_[_0xc45a('0x1f')](_0x55956b[_0xc45a('0x1e')],function(_0x3cbb0c){return{'model':db[_0x3cbb0c[_0xc45a('0x20')]],'as':_0x3cbb0c['as'],'attributes':_0x3cbb0c[_0xc45a('0x1d')],'include':_0x3cbb0c[_0xc45a('0x1e')]?_[_0xc45a('0x1f')](_0x3cbb0c['include'],function(_0x1195cd){return{'model':db[_0x1195cd[_0xc45a('0x20')]],'as':_0x1195cd['as'],'attributes':_0x1195cd[_0xc45a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x283d1b){logger['info']('GetTrunk',_0x679ac3);logger[_0xc45a('0x21')](_0xc45a('0x19'),_0x679ac3,JSON['stringify'](_0x283d1b));_0x7dbb57(_0x283d1b);})['catch'](function(_0xd3aa12){logger['error'](_0xc45a('0x19'),_0xd3aa12[_0xc45a('0x15')],_0x679ac3);_0x419b3c(_0x2402ec[_0xc45a('0x13')](0x1f4,_0xd3aa12[_0xc45a('0x15')]));});});};exports[_0xc45a('0x22')]=function(_0x592aa9){var _0x511f66=this;return new Promise(function(_0x53c86d,_0x3d0415){return db[_0xc45a('0x1a')][_0xc45a('0x23')]({'raw':_0x592aa9['options']?_0x592aa9['options'][_0xc45a('0x24')]===undefined?!![]:![]:!![],'where':_0x592aa9[_0xc45a('0x1b')]?_0x592aa9[_0xc45a('0x1b')][_0xc45a('0x1c')]||null:null,'attributes':_0x592aa9[_0xc45a('0x1b')]?_0x592aa9[_0xc45a('0x1b')][_0xc45a('0x1d')]||null:null,'include':_0x592aa9[_0xc45a('0x1b')]?_0x592aa9[_0xc45a('0x1b')]['include']?_[_0xc45a('0x1f')](_0x592aa9[_0xc45a('0x1b')][_0xc45a('0x1e')],function(_0x199a3c){return{'model':db[_0x199a3c[_0xc45a('0x20')]],'as':_0x199a3c['as'],'attributes':_0x199a3c[_0xc45a('0x1d')],'include':_0x199a3c[_0xc45a('0x1e')]?_['map'](_0x199a3c['include'],function(_0x5a85f2){return{'model':db[_0x5a85f2[_0xc45a('0x20')]],'as':_0x5a85f2['as'],'attributes':_0x5a85f2[_0xc45a('0x1d')],'include':_0x5a85f2[_0xc45a('0x1e')]?_[_0xc45a('0x1f')](_0x5a85f2[_0xc45a('0x1e')],function(_0x461765){return{'model':db[_0x461765['model']],'as':_0x461765['as'],'attributes':_0x461765[_0xc45a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f747a){logger['info'](_0xc45a('0x22'),_0x592aa9);logger[_0xc45a('0x21')](_0xc45a('0x22'),_0x592aa9,JSON[_0xc45a('0x25')](_0x4f747a));_0x53c86d(_0x4f747a);})[_0xc45a('0x18')](function(_0x5b4eb7){logger[_0xc45a('0x13')]('ShowTrunk',_0x5b4eb7['message'],_0x592aa9);_0x3d0415(_0x511f66['error'](0x1f4,_0x5b4eb7[_0xc45a('0x15')]));});});}; \ No newline at end of file +var _0xaaef=['rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','include','model','find','info','ShowTrunk','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaaef,0x1da));var _0xfaae=function(_0x489a1c,_0x166e23){_0x489a1c=_0x489a1c-0x0;var _0x207f0f=_0xaaef[_0x489a1c];return _0x207f0f;};'use strict';var _=require(_0xfaae('0x0'));var util=require(_0xfaae('0x1'));var moment=require(_0xfaae('0x2'));var BPromise=require(_0xfaae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaae('0x4'))['db'];var utils=require(_0xfaae('0x5'));var logger=require(_0xfaae('0x6'))(_0xfaae('0x7'));var config=require(_0xfaae('0x8'));var jayson=require(_0xfaae('0x9'));var client=jayson[_0xfaae('0xa')][_0xfaae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b2b0,_0x41eb3b,_0x4b9c46){return new BPromise(function(_0x2eb982,_0xbb4711){return client[_0xfaae('0xc')](_0x42b2b0,_0x4b9c46)[_0xfaae('0xd')](function(_0x153d5d){logger['info'](_0xfaae('0xe'),_0x41eb3b,_0xfaae('0xf'));logger[_0xfaae('0x10')](_0xfaae('0x11'),_0x41eb3b,_0xfaae('0xf'),JSON[_0xfaae('0x12')](_0x153d5d));if(_0x153d5d[_0xfaae('0x13')]){if(_0x153d5d[_0xfaae('0x13')]['code']===0x1f4){logger[_0xfaae('0x13')](_0xfaae('0xe'),_0x41eb3b,_0x153d5d[_0xfaae('0x13')]['message']);return _0xbb4711(_0x153d5d[_0xfaae('0x13')][_0xfaae('0x14')]);}logger['error'](_0xfaae('0xe'),_0x41eb3b,_0x153d5d[_0xfaae('0x13')]['message']);return _0x2eb982(_0x153d5d[_0xfaae('0x13')][_0xfaae('0x14')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x41eb3b,'request\x20sent');_0x2eb982(_0x153d5d[_0xfaae('0x15')]['message']);}})[_0xfaae('0x16')](function(_0xec2fd8){logger['error']('Trunk,\x20%s,\x20%s',_0x41eb3b,_0xec2fd8);_0xbb4711(_0xec2fd8);});});}exports[_0xfaae('0x17')]=function(_0x5b5e54){var _0x5cef1d=this;return new Promise(function(_0x5ee078,_0xb43dc0){return db[_0xfaae('0x18')][_0xfaae('0x19')]({'raw':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b5e54['options']?_0x5b5e54['options'][_0xfaae('0x1c')]||null:null,'attributes':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54['options'][_0xfaae('0x1d')]||null:null,'limit':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x1e')]||null:null,'include':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54['options']['include']?_[_0xfaae('0x1f')](_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x20')],function(_0x277c1c){return{'model':db[_0x277c1c[_0xfaae('0x21')]],'as':_0x277c1c['as'],'attributes':_0x277c1c[_0xfaae('0x1d')],'include':_0x277c1c[_0xfaae('0x20')]?_[_0xfaae('0x1f')](_0x277c1c[_0xfaae('0x20')],function(_0x31d8d4){return{'model':db[_0x31d8d4[_0xfaae('0x21')]],'as':_0x31d8d4['as'],'attributes':_0x31d8d4[_0xfaae('0x1d')],'include':_0x31d8d4['include']?_[_0xfaae('0x1f')](_0x31d8d4[_0xfaae('0x20')],function(_0x1c5f30){return{'model':db[_0x1c5f30[_0xfaae('0x21')]],'as':_0x1c5f30['as'],'attributes':_0x1c5f30['attributes']};}):[]};}):[]};}):[]:[]})[_0xfaae('0xd')](function(_0xc831f5){logger['info']('GetTrunk',_0x5b5e54);logger[_0xfaae('0x10')](_0xfaae('0x17'),_0x5b5e54,JSON['stringify'](_0xc831f5));_0x5ee078(_0xc831f5);})[_0xfaae('0x16')](function(_0x23186d){logger[_0xfaae('0x13')](_0xfaae('0x17'),_0x23186d[_0xfaae('0x14')],_0x5b5e54);_0xb43dc0(_0x5cef1d[_0xfaae('0x13')](0x1f4,_0x23186d[_0xfaae('0x14')]));});});};exports['ShowTrunk']=function(_0x5bd3a3){var _0x3bb3e8=this;return new Promise(function(_0x47e264,_0x1018a9){return db[_0xfaae('0x18')][_0xfaae('0x22')]({'raw':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3['options'][_0xfaae('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')][_0xfaae('0x1c')]||null:null,'attributes':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')]['attributes']||null:null,'include':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')]['include']?_['map'](_0x5bd3a3[_0xfaae('0x1a')]['include'],function(_0x5348cf){return{'model':db[_0x5348cf[_0xfaae('0x21')]],'as':_0x5348cf['as'],'attributes':_0x5348cf[_0xfaae('0x1d')],'include':_0x5348cf['include']?_[_0xfaae('0x1f')](_0x5348cf[_0xfaae('0x20')],function(_0x2cb2a9){return{'model':db[_0x2cb2a9['model']],'as':_0x2cb2a9['as'],'attributes':_0x2cb2a9[_0xfaae('0x1d')],'include':_0x2cb2a9['include']?_[_0xfaae('0x1f')](_0x2cb2a9[_0xfaae('0x20')],function(_0x5181ab){return{'model':db[_0x5181ab['model']],'as':_0x5181ab['as'],'attributes':_0x5181ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30d0ed){logger[_0xfaae('0x23')](_0xfaae('0x24'),_0x5bd3a3);logger[_0xfaae('0x10')](_0xfaae('0x24'),_0x5bd3a3,JSON[_0xfaae('0x12')](_0x30d0ed));_0x47e264(_0x30d0ed);})[_0xfaae('0x16')](function(_0x6ece25){logger['error'](_0xfaae('0x24'),_0x6ece25['message'],_0x5bd3a3);_0x1018a9(_0x3bb3e8[_0xfaae('0x13')](0x1f4,_0x6ece25[_0xfaae('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c00b50a..37b4c5c 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 _0xc423=['addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','join','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','/:id/teams','addTeams','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions'];(function(_0x32bd47,_0x574b54){var _0x16cef6=function(_0x24ca87){while(--_0x24ca87){_0x32bd47['push'](_0x32bd47['shift']());}};_0x16cef6(++_0x574b54);}(_0xc423,0x10c));var _0x3c42=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc423[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x3c42('0x0'));var util=require(_0x3c42('0x1'));var path=require('path');var timeout=require(_0x3c42('0x2'));var express=require('express');var router=express[_0x3c42('0x3')]();var fs_extra=require(_0x3c42('0x4'));var auth=require(_0x3c42('0x5'));var interaction=require(_0x3c42('0x6'));var config=require(_0x3c42('0x7'));var controller=require(_0x3c42('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3c42('0x9')](_0x3c42('0xa'),auth[_0x3c42('0xb')](),controller[_0x3c42('0xc')]);router[_0x3c42('0x9')](_0x3c42('0xd'),auth[_0x3c42('0xb')](),controller['whoami']);router[_0x3c42('0x9')](_0x3c42('0xe'),auth[_0x3c42('0xb')](),controller[_0x3c42('0xf')]);router[_0x3c42('0x9')](_0x3c42('0x10'),auth['isAuthenticated'](),controller[_0x3c42('0x11')]);router['get'](_0x3c42('0x12'),controller[_0x3c42('0x13')]);router[_0x3c42('0x9')](_0x3c42('0x14'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x15')]);router[_0x3c42('0x9')](_0x3c42('0x16'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x17')]);router[_0x3c42('0x9')](_0x3c42('0x18'),auth['isAuthenticated'](),controller['getQueues']);router[_0x3c42('0x9')](_0x3c42('0x19'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x1a')]);router[_0x3c42('0x9')](_0x3c42('0x1b'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x1c')]);router['get']('/:id/recordings',auth[_0x3c42('0xb')](),controller[_0x3c42('0x1d')]);router['get'](_0x3c42('0x1e'),auth['isAuthenticated'](),controller[_0x3c42('0x1f')]);router[_0x3c42('0x9')](_0x3c42('0x20'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x21')]);router[_0x3c42('0x9')](_0x3c42('0x22'),auth['isAuthenticated'](),controller[_0x3c42('0x23')]);router['get'](_0x3c42('0x24'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x25')]);router['get'](_0x3c42('0x26'),auth[_0x3c42('0xb')](),controller['getSmsInteractions']);router['get'](_0x3c42('0x27'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x28')]);router[_0x3c42('0x9')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x3c42('0x29')]);router['get']('/:id/teams',auth[_0x3c42('0xb')](),controller[_0x3c42('0x2a')]);router[_0x3c42('0x9')](_0x3c42('0x2b'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x2c')]);router[_0x3c42('0x9')](_0x3c42('0x2d'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x2e')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0x3c42('0x2f')]);router[_0x3c42('0x9')](_0x3c42('0x30'),auth['isAuthenticated'](),controller[_0x3c42('0x31')]);router[_0x3c42('0x9')](_0x3c42('0x32'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x33')]);router[_0x3c42('0x9')](_0x3c42('0x34'),auth['isAuthenticated'](),controller[_0x3c42('0x35')]);router[_0x3c42('0x9')](_0x3c42('0x36'),auth['isAuthenticated'](),controller[_0x3c42('0x37')]);router['get'](_0x3c42('0x38'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x39')]);router[_0x3c42('0x9')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x3c42('0x3a')]);router[_0x3c42('0x9')]('/:id/square_projects',auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x3c42('0x9')](_0x3c42('0x3b'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x3c42('0x9')]('/:id/api_key',auth[_0x3c42('0xb')](),controller[_0x3c42('0x3c')]);router[_0x3c42('0x3d')]('/:id/contacts',auth[_0x3c42('0xb')](),controller[_0x3c42('0x3e')]);router[_0x3c42('0x3d')]('/',auth[_0x3c42('0xb')](),controller[_0x3c42('0x3f')]);router['post'](_0x3c42('0x40'),auth[_0x3c42('0xb')](),controller['bulkCreate']);router[_0x3c42('0x3d')](_0x3c42('0x18'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x41')]);var upload=multer({'storage':multer[_0x3c42('0x42')]({'destination':function(_0x9869d6,_0x23c0e5,_0x12e78f){_0x12e78f(null,path[_0x3c42('0x43')](config['root'],_0x3c42('0x44')));},'filename':function(_0x150724,_0xb30ff5,_0x4a2990){_0x4a2990(null,util['format'](_0x3c42('0x45'),Date[_0x3c42('0x46')](),_0xb30ff5['originalname']));}})});router[_0x3c42('0x3d')](_0x3c42('0x12'),upload[_0x3c42('0x47')](_0x3c42('0x48')),controller[_0x3c42('0x49')]);router[_0x3c42('0x3d')](_0x3c42('0x4a'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x4b')]);router['post'](_0x3c42('0x4c'),auth['isAuthenticated'](),controller[_0x3c42('0x4d')]);router[_0x3c42('0x3d')](_0x3c42('0x4e'),auth[_0x3c42('0xb')](),controller['pause']);router['post'](_0x3c42('0x4f'),auth['isAuthenticated'](),controller['unpause']);router[_0x3c42('0x3d')](_0x3c42('0x50'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x51')]);router[_0x3c42('0x3d')]('/:id/chat_interactions',auth[_0x3c42('0xb')](),controller['addChatInteractions']);router[_0x3c42('0x3d')](_0x3c42('0x52'),auth[_0x3c42('0xb')](),controller['addMailInteractions']);router[_0x3c42('0x3d')](_0x3c42('0x53'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x54')]);router[_0x3c42('0x3d')](_0x3c42('0x55'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x56')]);router['post'](_0x3c42('0x57'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x58')]);router['post'](_0x3c42('0x59'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x5a')]);router[_0x3c42('0x3d')](_0x3c42('0x30'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x5b')]);router[_0x3c42('0x3d')](_0x3c42('0x32'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x5c')]);router[_0x3c42('0x3d')]('/:id/openchannel_accounts',auth[_0x3c42('0xb')](),controller[_0x3c42('0x5d')]);router[_0x3c42('0x3d')]('/:id/sms_accounts',auth[_0x3c42('0xb')](),controller[_0x3c42('0x5e')]);router[_0x3c42('0x3d')](_0x3c42('0x38'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x5f')]);router[_0x3c42('0x3d')](_0x3c42('0x60'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x61')]);router['post'](_0x3c42('0x62'),auth['isAuthenticated'](),controller[_0x3c42('0x63')]);router['post'](_0x3c42('0x64'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x65')]);router[_0x3c42('0x66')]('/:id',auth[_0x3c42('0xb')](),controller['update']);router[_0x3c42('0x66')]('/:id/password',auth[_0x3c42('0xb')](),controller['changePassword']);router['delete'](_0x3c42('0x18'),auth['isAuthenticated'](),controller[_0x3c42('0x67')]);router[_0x3c42('0x68')]('/:id/teams',auth[_0x3c42('0xb')](),controller[_0x3c42('0x69')]);router[_0x3c42('0x68')](_0x3c42('0x10'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x6a')]);router['delete']('/:id/chat_interactions',auth[_0x3c42('0xb')](),controller[_0x3c42('0x6b')]);router[_0x3c42('0x68')](_0x3c42('0x52'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x6c')]);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller['removeFaxInteractions']);router['delete'](_0x3c42('0x55'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x6d')]);router['delete'](_0x3c42('0x57'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x6e')]);router[_0x3c42('0x68')]('/:id/whatsapp_interactions',auth[_0x3c42('0xb')](),controller['removeWhatsappInteractions']);router[_0x3c42('0x68')](_0x3c42('0x30'),auth[_0x3c42('0xb')](),controller['removeFaxAccounts']);router[_0x3c42('0x68')](_0x3c42('0x32'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x6f')]);router[_0x3c42('0x68')]('/:id/openchannel_accounts',auth[_0x3c42('0xb')](),controller[_0x3c42('0x70')]);router[_0x3c42('0x68')](_0x3c42('0x36'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x71')]);router['delete'](_0x3c42('0x38'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x72')]);router[_0x3c42('0x68')](_0x3c42('0x60'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x73')]);router[_0x3c42('0x68')](_0x3c42('0x62'),auth[_0x3c42('0xb')](),controller[_0x3c42('0x74')]);router[_0x3c42('0x68')](_0x3c42('0x64'),auth[_0x3c42('0xb')](),controller['removeApiKey']);module[_0x3c42('0x75')]=router; \ No newline at end of file +var _0x31e0=['getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','removeQueues','destroy','removeChatInteractions','delete','removeMailInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','util','../../components/interaction/service','./user.controller','get','isAuthenticated','index','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x3a1a69,_0x469e8d){var _0x417be1=function(_0x4af948){while(--_0x4af948){_0x3a1a69['push'](_0x3a1a69['shift']());}};_0x417be1(++_0x469e8d);}(_0x31e0,0x1a2));var _0x031e=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x31e0[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require('multer');var util=require(_0x031e('0x0'));var path=require('path');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(_0x031e('0x1'));var config=require('../../config/environment');var controller=require(_0x031e('0x2'));router[_0x031e('0x3')]('/',auth[_0x031e('0x4')](),controller[_0x031e('0x5')]);router[_0x031e('0x3')]('/describe',auth[_0x031e('0x4')](),controller[_0x031e('0x6')]);router[_0x031e('0x3')]('/whoami',auth[_0x031e('0x4')](),controller[_0x031e('0x7')]);router[_0x031e('0x3')](_0x031e('0x8'),auth[_0x031e('0x4')](),controller[_0x031e('0x9')]);router[_0x031e('0x3')](_0x031e('0xa'),auth[_0x031e('0x4')](),controller[_0x031e('0xb')]);router[_0x031e('0x3')](_0x031e('0xc'),controller['getAvatar']);router[_0x031e('0x3')](_0x031e('0xd'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x031e('0x4')](),controller[_0x031e('0xe')]);router['get'](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x10')]);router[_0x031e('0x3')](_0x031e('0x11'),auth['isAuthenticated'](),controller[_0x031e('0x12')]);router['get']('/:id/groups',auth[_0x031e('0x4')](),controller[_0x031e('0x13')]);router[_0x031e('0x3')](_0x031e('0x14'),auth[_0x031e('0x4')](),controller[_0x031e('0x15')]);router['get'](_0x031e('0x16'),auth[_0x031e('0x4')](),controller[_0x031e('0x17')]);router['get'](_0x031e('0x18'),auth[_0x031e('0x4')](),controller[_0x031e('0x19')]);router[_0x031e('0x3')]('/:id/openchannel/interactions',auth[_0x031e('0x4')](),controller[_0x031e('0x1a')]);router[_0x031e('0x3')](_0x031e('0x1b'),auth[_0x031e('0x4')](),controller['getMailInteractions']);router[_0x031e('0x3')](_0x031e('0x1c'),auth[_0x031e('0x4')](),controller[_0x031e('0x1d')]);router[_0x031e('0x3')](_0x031e('0x1e'),auth['isAuthenticated'](),controller[_0x031e('0x1f')]);router[_0x031e('0x3')]('/:id/whatsapp/interactions',auth[_0x031e('0x4')](),controller['getWhatsappInteractions']);router[_0x031e('0x3')](_0x031e('0x20'),auth[_0x031e('0x4')](),controller[_0x031e('0x21')]);router[_0x031e('0x3')](_0x031e('0x22'),auth[_0x031e('0x4')](),controller[_0x031e('0x23')]);router['get']('/:id/agents',auth[_0x031e('0x4')](),controller[_0x031e('0x24')]);router[_0x031e('0x3')]('/:id/prefixes',auth[_0x031e('0x4')](),controller[_0x031e('0x25')]);router[_0x031e('0x3')](_0x031e('0x26'),auth[_0x031e('0x4')](),controller[_0x031e('0x27')]);router[_0x031e('0x3')](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x29')]);router[_0x031e('0x3')](_0x031e('0x2a'),auth[_0x031e('0x4')](),controller[_0x031e('0x2b')]);router[_0x031e('0x3')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x031e('0x2c')]);router[_0x031e('0x3')]('/:id/chat_websites',auth[_0x031e('0x4')](),controller[_0x031e('0x2d')]);router[_0x031e('0x3')](_0x031e('0x2e'),auth[_0x031e('0x4')](),controller[_0x031e('0x2f')]);router[_0x031e('0x3')](_0x031e('0x30'),auth[_0x031e('0x4')](),controller[_0x031e('0x31')]);router['get'](_0x031e('0x32'),auth[_0x031e('0x4')](),controller[_0x031e('0x33')]);router[_0x031e('0x3')]('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0x031e('0x34')](_0x031e('0x35'),auth[_0x031e('0x4')](),controller[_0x031e('0x36')]);router['post']('/',auth[_0x031e('0x4')](),controller[_0x031e('0x37')]);router[_0x031e('0x34')]('/create_many',auth['isAuthenticated'](),controller[_0x031e('0x38')]);router[_0x031e('0x34')](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x39')]);var upload=multer({'storage':multer[_0x031e('0x3a')]({'destination':function(_0x534839,_0x4a1b05,_0x16726b){_0x16726b(null,path[_0x031e('0x3b')](config[_0x031e('0x3c')],_0x031e('0x3d')));},'filename':function(_0x5877ed,_0x11a554,_0x4cb53c){_0x4cb53c(null,util[_0x031e('0x3e')]('%s-%s',Date['now'](),_0x11a554[_0x031e('0x3f')]));}})});router[_0x031e('0x34')]('/:id/avatar',upload['single'](_0x031e('0x40')),controller[_0x031e('0x41')]);router[_0x031e('0x34')](_0x031e('0x42'),auth['isAuthenticated'](),controller[_0x031e('0x43')]);router['post'](_0x031e('0x44'),auth[_0x031e('0x4')](),controller[_0x031e('0x45')]);router[_0x031e('0x34')](_0x031e('0x46'),auth[_0x031e('0x4')](),controller[_0x031e('0x47')]);router[_0x031e('0x34')](_0x031e('0x48'),auth[_0x031e('0x4')](),controller['unpause']);router[_0x031e('0x34')]('/:id/teams',auth[_0x031e('0x4')](),controller[_0x031e('0x49')]);router[_0x031e('0x34')](_0x031e('0x4a'),auth['isAuthenticated'](),controller[_0x031e('0x4b')]);router[_0x031e('0x34')](_0x031e('0x4c'),auth[_0x031e('0x4')](),controller[_0x031e('0x4d')]);router['post'](_0x031e('0x4e'),auth[_0x031e('0x4')](),controller[_0x031e('0x4f')]);router[_0x031e('0x34')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x031e('0x34')](_0x031e('0x50'),auth[_0x031e('0x4')](),controller['addOpenchannelInteractions']);router[_0x031e('0x34')](_0x031e('0x51'),auth[_0x031e('0x4')](),controller[_0x031e('0x52')]);router['post']('/:id/fax_accounts',auth[_0x031e('0x4')](),controller[_0x031e('0x53')]);router['post'](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x54')]);router[_0x031e('0x34')](_0x031e('0x2a'),auth[_0x031e('0x4')](),controller['addOpenchannelAccounts']);router[_0x031e('0x34')](_0x031e('0x55'),auth[_0x031e('0x4')](),controller[_0x031e('0x56')]);router[_0x031e('0x34')](_0x031e('0x57'),auth[_0x031e('0x4')](),controller[_0x031e('0x58')]);router['post'](_0x031e('0x2e'),auth['isAuthenticated'](),controller[_0x031e('0x59')]);router[_0x031e('0x34')]('/:id/square_projects',auth[_0x031e('0x4')](),controller['addSquareProjects']);router[_0x031e('0x34')](_0x031e('0x5a'),auth[_0x031e('0x4')](),controller[_0x031e('0x5b')]);router['put'](_0x031e('0xa'),auth[_0x031e('0x4')](),controller[_0x031e('0x5c')]);router[_0x031e('0x5d')](_0x031e('0x5e'),auth['isAuthenticated'](),controller[_0x031e('0x5f')]);router['delete'](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x60')]);router['delete'](_0x031e('0x20'),auth[_0x031e('0x4')](),controller['removeTeams']);router['delete']('/:id',auth[_0x031e('0x4')](),controller[_0x031e('0x61')]);router['delete'](_0x031e('0x4a'),auth['isAuthenticated'](),controller[_0x031e('0x62')]);router[_0x031e('0x63')](_0x031e('0x4c'),auth['isAuthenticated'](),controller[_0x031e('0x64')]);router['delete'](_0x031e('0x4e'),auth[_0x031e('0x4')](),controller['removeFaxInteractions']);router['delete'](_0x031e('0x65'),auth[_0x031e('0x4')](),controller['removeSmsInteractions']);router['delete'](_0x031e('0x50'),auth[_0x031e('0x4')](),controller[_0x031e('0x66')]);router[_0x031e('0x63')](_0x031e('0x51'),auth['isAuthenticated'](),controller[_0x031e('0x67')]);router[_0x031e('0x63')](_0x031e('0x26'),auth[_0x031e('0x4')](),controller[_0x031e('0x68')]);router[_0x031e('0x63')](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x69')]);router[_0x031e('0x63')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x031e('0x6a')]);router[_0x031e('0x63')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x031e('0x6b')]);router[_0x031e('0x63')](_0x031e('0x57'),auth[_0x031e('0x4')](),controller[_0x031e('0x6c')]);router[_0x031e('0x63')](_0x031e('0x2e'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x031e('0x63')](_0x031e('0x30'),auth[_0x031e('0x4')](),controller[_0x031e('0x6d')]);router[_0x031e('0x63')](_0x031e('0x5a'),auth[_0x031e('0x4')](),controller[_0x031e('0x6e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 18be2f1..aba4505 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 _0x29b1=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','nonat','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','user','agent','local','INTEGER','callerid','DATE','BOOLEAN','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','getDataValue'];(function(_0x4d9d1e,_0x3c2d20){var _0x1b9d54=function(_0x373c21){while(--_0x373c21){_0x4d9d1e['push'](_0x4d9d1e['shift']());}};_0x1b9d54(++_0x3c2d20);}(_0x29b1,0x13b));var _0x129b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x29b1[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x129b('0x0'));var _=require(_0x129b('0x1'));module[_0x129b('0x2')]={'name':{'type':Sequelize[_0x129b('0x3')],'allowNull':![],'unique':_0x129b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a052a){this[_0x129b('0x5')](_0x129b('0x4'),_0x2a052a);this[_0x129b('0x5')](_0x129b('0x6'),_0x2a052a);},'comment':_0x129b('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4b0923){this['setDataValue'](_0x129b('0x8'),_0x4b0923);this[_0x129b('0x5')]('callerid',util['format'](_0x129b('0x9'),_0x4b0923,this['getDataValue'](_0x129b('0xa'))));}},'alias':{'type':Sequelize[_0x129b('0x3')]},'email':{'type':Sequelize[_0x129b('0x3')],'allowNull':![],'unique':_0x129b('0xb'),'validate':{'isEmail':!![]},'set':function(_0x1cd1d){if(_0x1cd1d){this[_0x129b('0x5')]('email',_0x1cd1d[_0x129b('0xc')]());}}},'role':{'type':Sequelize[_0x129b('0xd')]('admin',_0x129b('0xe'),_0x129b('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x129b('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x129b('0x3')],'defaultValue':_0x129b('0x10')},'internal':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':![],'unique':_0x129b('0xa'),'set':function(_0x4f3ff3){this[_0x129b('0x5')](_0x129b('0xa'),_0x4f3ff3);this[_0x129b('0x5')]('accountcode',_0x4f3ff3);this[_0x129b('0x5')](_0x129b('0x12'),util['format'](_0x129b('0x9'),this['getDataValue'](_0x129b('0x8')),_0x4f3ff3));}},'salt':{'type':Sequelize[_0x129b('0x3')]},'phone':{'type':Sequelize[_0x129b('0x3')]},'mobile':{'type':Sequelize[_0x129b('0x3')]},'address':{'type':Sequelize[_0x129b('0x3')]},'zipcode':{'type':Sequelize[_0x129b('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x129b('0x3')]},'country':{'type':Sequelize[_0x129b('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x129b('0x13')]},'voicePause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x129b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x129b('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x129b('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x129b('0x15')},'ipaddr':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x129b('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x16'),_0x129b('0xe'),_0x129b('0x17')),'allowNull':!![],'defaultValue':_0x129b('0x16')},'context':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![],'defaultValue':_0x129b('0x18')},'callingpres':{'type':Sequelize[_0x129b('0xd')]('ALLOWED_NOT_SCREENED',_0x129b('0x19'),_0x129b('0x1a'),'ALLOWED',_0x129b('0x1b'),_0x129b('0x1c'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![],'defaultValue':_0x129b('0x1d'),'set':function(_0x162b8d){this[_0x129b('0x5')](_0x129b('0x1e'),_0x162b8d?_0x162b8d[_0x129b('0x1f')](','):null);},'get':function(){return this[_0x129b('0x20')](_0x129b('0x1e'))?this['getDataValue']('transport')[_0x129b('0x21')](','):null;},'comment':_0x129b('0x22')},'dtmfmode':{'type':Sequelize['ENUM'](_0x129b('0x23'),_0x129b('0x24'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':_0x129b('0x23')},'directmedia':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no','nonat','update',_0x129b('0x26')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![],'defaultValue':_0x129b('0x27'),'set':function(_0x5f36d2){this[_0x129b('0x5')](_0x129b('0x28'),_0x5f36d2?_0x5f36d2[_0x129b('0x1f')](','):null);},'get':function(){return this[_0x129b('0x20')](_0x129b('0x28'))?this[_0x129b('0x20')](_0x129b('0x28'))[_0x129b('0x21')](','):null;},'comment':_0x129b('0x29')},'callgroup':{'type':Sequelize[_0x129b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x129b('0x3')]},'pickupgroup':{'type':Sequelize[_0x129b('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x129b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x129b('0x3')]},'disallow':{'type':Sequelize[_0x129b('0x3')],'allowNull':![],'defaultValue':_0x129b('0x2a')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x129b('0x2b'),'set':function(_0x503b07){this[_0x129b('0x5')](_0x129b('0x2c'),_0x503b07?_0x503b07[_0x129b('0x1f')](';'):_0x129b('0x2b'));},'get':function(){return this[_0x129b('0x20')](_0x129b('0x2c'))?this[_0x129b('0x20')](_0x129b('0x2c'))['split'](';'):null;},'comment':_0x129b('0x2d')},'autoframing':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3dfe1d){this[_0x129b('0x5')](_0x129b('0x2e'),_0x3dfe1d?_0x3dfe1d[_0x129b('0x1f')](','):null);},'get':function(){return this[_0x129b('0x20')](_0x129b('0x2e'))?this['getDataValue']('insecure')[_0x129b('0x21')](','):null;},'comment':_0x129b('0x2f')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x129b('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x129b('0x31')},'amaflags':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':_0x129b('0x25')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no',_0x129b('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x129b('0x33'),_0x129b('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x35'),_0x129b('0x36')),'allowNull':!![],'defaultValue':_0x129b('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':_0x129b('0x25')},'keepalive':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x129b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x129b('0x25'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no',_0x129b('0x37'),_0x129b('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x129b('0xd')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x129b('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x129b('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no',_0x129b('0x39'),_0x129b('0x3a'),_0x129b('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x129b('0x13')]},'passwordResetAt':{'type':Sequelize[_0x129b('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x129b('0x3c')]},'showWebBar':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0,'set':function(_0x4931c8){this['setDataValue'](_0x129b('0x3d'),_0x4931c8);var _0x3d23c4=this[_0x129b('0x3e')]({'plain':!![]});switch(_0x4931c8){case 0x0:case 0x1:var _0x426473=_0x3d23c4[_0x129b('0x1e')]?_[_0x129b('0x3f')](_0x3d23c4[_0x129b('0x1e')])?_0x3d23c4[_0x129b('0x1e')]['join']():_0x3d23c4[_0x129b('0x1e')]:'udp';if(_0x426473===_0x129b('0x40')){_0x426473=_0x129b('0x1d');}this[_0x129b('0x5')]('transport',_0x426473);this[_0x129b('0x5')](_0x129b('0x41'),'no');this['setDataValue']('avpf',null);this[_0x129b('0x5')](_0x129b('0x42'),null);this['setDataValue'](_0x129b('0x43'),null);this[_0x129b('0x5')](_0x129b('0x44'),null);this[_0x129b('0x5')](_0x129b('0x45'),null);this[_0x129b('0x5')](_0x129b('0x46'),null);this[_0x129b('0x5')](_0x129b('0x47'),null);this['setDataValue'](_0x129b('0x48'),null);this['setDataValue'](_0x129b('0x49'),'no');break;case 0x2:this[_0x129b('0x5')]('transport','wss');this['setDataValue'](_0x129b('0x41'),_0x129b('0x25'));this[_0x129b('0x5')]('avpf',_0x129b('0x25'));this[_0x129b('0x5')](_0x129b('0x42'),_0x129b('0x25'));this[_0x129b('0x5')](_0x129b('0x43'),_0x129b('0x25'));this[_0x129b('0x5')](_0x129b('0x44'),'yes');this[_0x129b('0x5')]('dtlsverify','no');this[_0x129b('0x5')]('dtlssetup','actpass');this[_0x129b('0x5')](_0x129b('0x47'),_0x3d23c4[_0x129b('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0x129b('0x5')](_0x129b('0x48'),_0x3d23c4['dtlsprivatekey']||_0x129b('0x4a'));this[_0x129b('0x5')](_0x129b('0x49'),_0x129b('0x25'));break;default:}}},'permissions':{'type':Sequelize[_0x129b('0x3c')],'set':function(_0x151bce){this[_0x129b('0x5')](_0x129b('0x4b'),_0x151bce?_0x151bce['join'](','):[]);},'get':function(){return this[_0x129b('0x20')](_0x129b('0x4b'))?_[_0x129b('0x4c')](this[_0x129b('0x20')](_0x129b('0x4b'))[_0x129b('0x21')](','),function(_0x4a3a12){return parseInt(_0x4a3a12,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x129b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x129b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x129b('0xd')](_0x129b('0x25'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x129b('0x4d')],'get':function(){return this[_0x129b('0x20')](_0x129b('0x4e'))?this[_0x129b('0x20')](_0x129b('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x129b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x129b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![],'set':function(_0x60742d){if(typeof _0x60742d===_0x129b('0x4f')){var _0x515d42=_0x60742d==='1'?!![]:_0x60742d==='0'?![]:_0x60742d===_0x129b('0x50')?!![]:_0x60742d===_0x129b('0x51')?![]:![];this[_0x129b('0x5')](_0x129b('0x52'),_0x515d42);}else{this['setDataValue'](_0x129b('0x52'),_0x60742d);}}},'blocked':{'type':Sequelize[_0x129b('0x14')],'defaultValue':![],'set':function(_0x3129e5){this[_0x129b('0x5')](_0x129b('0x53'),_0x3129e5);if(_0x3129e5===!![]){this[_0x129b('0x5')](_0x129b('0x54'),moment());this[_0x129b('0x5')](_0x129b('0x55'),0x0);}else{this['setDataValue'](_0x129b('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x129b('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x129b('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x129b('0x11')](0x5)[_0x129b('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x129b('0x14')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd47f=['local','INTEGER','accountcode','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','split','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','admin'];(function(_0x4f0ac9,_0xf8844e){var _0x1d1f24=function(_0x4f1387){while(--_0x4f1387){_0x4f0ac9['push'](_0x4f0ac9['shift']());}};_0x1d1f24(++_0xf8844e);}(_0xd47f,0x1bd));var _0xfd47=function(_0x582514,_0x4667aa){_0x582514=_0x582514-0x0;var _0x369266=_0xd47f[_0x582514];return _0x369266;};'use strict';var Sequelize=require(_0xfd47('0x0'));var moment=require('moment');var util=require(_0xfd47('0x1'));var _=require(_0xfd47('0x2'));module[_0xfd47('0x3')]={'name':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x32a237){this[_0xfd47('0x6')](_0xfd47('0x5'),_0x32a237);this[_0xfd47('0x6')](_0xfd47('0x7'),_0x32a237);},'comment':_0xfd47('0x8')},'fullname':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'set':function(_0x55fd0b){this['setDataValue'](_0xfd47('0x9'),_0x55fd0b);this['setDataValue']('callerid',util['format'](_0xfd47('0xa'),_0x55fd0b,this[_0xfd47('0xb')](_0xfd47('0xc'))));}},'alias':{'type':Sequelize[_0xfd47('0x4')]},'email':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5a6644){if(_0x5a6644){this['setDataValue'](_0xfd47('0xd'),_0x5a6644['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xfd47('0xe'),'user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xfd47('0xf')},'internal':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':![],'unique':_0xfd47('0xc'),'set':function(_0x49c00a){this[_0xfd47('0x6')](_0xfd47('0xc'),_0x49c00a);this[_0xfd47('0x6')](_0xfd47('0x11'),_0x49c00a);this['setDataValue'](_0xfd47('0x12'),util[_0xfd47('0x13')](_0xfd47('0xa'),this['getDataValue']('fullname'),_0x49c00a));}},'salt':{'type':Sequelize[_0xfd47('0x4')]},'phone':{'type':Sequelize[_0xfd47('0x4')]},'mobile':{'type':Sequelize[_0xfd47('0x4')]},'address':{'type':Sequelize[_0xfd47('0x4')]},'zipcode':{'type':Sequelize[_0xfd47('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfd47('0x4')]},'country':{'type':Sequelize[_0xfd47('0x4')]},'online':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfd47('0x15')]},'voicePause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':_0xfd47('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x17')},'ipaddr':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfd47('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x19'),_0xfd47('0x1a'),_0xfd47('0x1b')),'allowNull':!![],'defaultValue':_0xfd47('0x19')},'context':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x1c')},'callingpres':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x1d'),'ALLOWED_PASSED_SCREEN',_0xfd47('0x1e'),_0xfd47('0x1f'),_0xfd47('0x20'),'PROHIB_PASSED_SCREEN',_0xfd47('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x22'),'set':function(_0x3d95bc){this[_0xfd47('0x6')](_0xfd47('0x23'),_0x3d95bc?_0x3d95bc[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')]('transport')?this[_0xfd47('0xb')](_0xfd47('0x23'))['split'](','):null;},'comment':_0xfd47('0x25')},'dtmfmode':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x26'),'info',_0xfd47('0x27'),'inband',_0xfd47('0x28')),'allowNull':!![],'defaultValue':_0xfd47('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x2c'),'set':function(_0x516a4c){this[_0xfd47('0x6')](_0xfd47('0x2d'),_0x516a4c?_0x516a4c['join'](','):null);},'get':function(){return this['getDataValue'](_0xfd47('0x2d'))?this['getDataValue'](_0xfd47('0x2d'))['split'](','):null;},'comment':_0xfd47('0x2e')},'callgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':_0xfd47('0x2f'),'set':function(_0x2c70a8){this['setDataValue']('allow',_0x2c70a8?_0x2c70a8['join'](';'):_0xfd47('0x2f'));},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x30'))?this[_0xfd47('0xb')](_0xfd47('0x30'))['split'](';'):null;},'comment':_0xfd47('0x31')},'autoframing':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'set':function(_0xf0727c){this[_0xfd47('0x6')](_0xfd47('0x32'),_0xf0727c?_0xf0727c[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x32'))?this[_0xfd47('0xb')](_0xfd47('0x32'))['split'](','):null;},'comment':_0xfd47('0x33')},'trustrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x35')},'amaflags':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'busylevel':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xfd47('0x37'),_0xfd47('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x39'),_0xfd47('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xfd47('0x3b'),_0xfd47('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x3d'),_0xfd47('0x3e'),_0xfd47('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),_0xfd47('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfd47('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfd47('0x15')]},'passwordResetAt':{'type':Sequelize[_0xfd47('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0,'set':function(_0x583e85){this[_0xfd47('0x6')](_0xfd47('0x41'),_0x583e85);var _0x2b2ae1=this['get']({'plain':!![]});switch(_0x583e85){case 0x0:case 0x1:var _0xb988b9=_0x2b2ae1[_0xfd47('0x23')]?_[_0xfd47('0x42')](_0x2b2ae1[_0xfd47('0x23')])?_0x2b2ae1['transport'][_0xfd47('0x24')]():_0x2b2ae1[_0xfd47('0x23')]:_0xfd47('0x22');if(_0xb988b9===_0xfd47('0x43')){_0xb988b9=_0xfd47('0x22');}this[_0xfd47('0x6')](_0xfd47('0x23'),_0xb988b9);this[_0xfd47('0x6')](_0xfd47('0x44'),'no');this['setDataValue'](_0xfd47('0x45'),null);this[_0xfd47('0x6')](_0xfd47('0x46'),null);this[_0xfd47('0x6')]('icesupport',null);this['setDataValue'](_0xfd47('0x47'),null);this['setDataValue'](_0xfd47('0x48'),null);this[_0xfd47('0x6')](_0xfd47('0x49'),null);this[_0xfd47('0x6')](_0xfd47('0x4a'),null);this[_0xfd47('0x6')](_0xfd47('0x4b'),null);this[_0xfd47('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xfd47('0x23'),_0xfd47('0x43'));this[_0xfd47('0x6')](_0xfd47('0x44'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x45'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x46'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x4c'),'yes');this['setDataValue'](_0xfd47('0x47'),'yes');this[_0xfd47('0x6')](_0xfd47('0x48'),'no');this['setDataValue']('dtlssetup',_0xfd47('0x3f'));this[_0xfd47('0x6')]('dtlscertfile',_0x2b2ae1[_0xfd47('0x4a')]||_0xfd47('0x4d'));this[_0xfd47('0x6')](_0xfd47('0x4b'),_0x2b2ae1[_0xfd47('0x4b')]||_0xfd47('0x4e'));this[_0xfd47('0x6')](_0xfd47('0x4f'),_0xfd47('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xfd47('0x50')],'set':function(_0x4e39d3){this[_0xfd47('0x6')](_0xfd47('0x51'),_0x4e39d3?_0x4e39d3[_0xfd47('0x24')](','):[]);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x51'))?_[_0xfd47('0x52')](this[_0xfd47('0xb')](_0xfd47('0x51'))[_0xfd47('0x53')](','),function(_0x1ef84e){return parseInt(_0x1ef84e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfd47('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xfd47('0xb')](_0xfd47('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![],'set':function(_0x4cea58){if(typeof _0x4cea58===_0xfd47('0x55')){var _0x2119c1=_0x4cea58==='1'?!![]:_0x4cea58==='0'?![]:_0x4cea58===_0xfd47('0x56')?!![]:_0x4cea58===_0xfd47('0x57')?![]:![];this[_0xfd47('0x6')](_0xfd47('0x58'),_0x2119c1);}else{this['setDataValue']('screenrecording',_0x4cea58);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x64f723){this['setDataValue'](_0xfd47('0x59'),_0x64f723);if(_0x64f723===!![]){this[_0xfd47('0x6')](_0xfd47('0x5a'),moment());this[_0xfd47('0x6')]('loginAttempts',0x0);}else{this[_0xfd47('0x6')](_0xfd47('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfd47('0x10')](0x5)[_0xfd47('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3b57400..9232bf4 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 _0x33af=['getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','sms','whatsapp','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','pick','where','options','CmList','List','Tags','color','tag','hasOwnProperty','nolimit','limit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','isMiddleware','resolve','forEach','pause','QueuePause','updateAttributes','getChannels','PAUSE','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','unpause','%s%s','Pause','manual','getTeams','Team','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','TeamVoicePrefix','UserVoicePrefix','removeTeams','getChatQueues','getWhatsappQueues','Whatsapp','getFaxQueues','removeAgent','getDataValue','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','lastName','VoiceQueue','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','lower','col','toString','asc','desc','substring','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','voiceStatus','toUpperCase','slice','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','bluebird','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','set','Content-Range','update','destroy','get','role','Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','name','sendStatus','stack','index','User','rawAttributes','fieldName','type','key','salt','getOptions','count','query','include','attributes','push','findAll','rows','true','length','chat','dataValues','fax','mail','openchannel','all','show','params','model','differenceBy','keys','password','filters','intersection','fields','includeAll','merge','openTabs','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','fullname','email','agent','permissions','101','102','103','110','104','105','106','108','109','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','isEmpty','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Wrong\x20credentials','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','emit','Queue:save','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','QueueId','Queue:remove','addAvatar','userpic','file','filename'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0x33af,0xec));var _0xf33a=function(_0x3755a2,_0x5be61e){_0x3755a2=_0x3755a2-0x0;var _0x2df8e4=_0x33af[_0x3755a2];return _0x2df8e4;};'use strict';var moment=require('moment');var BPromise=require(_0xf33a('0x0'));var util=require('util');var path=require(_0xf33a('0x1'));var fs=require('fs');var _=require(_0xf33a('0x2'));var squel=require(_0xf33a('0x3'));var jayson=require(_0xf33a('0x4'));var Redis=require(_0xf33a('0x5'));var authService=require(_0xf33a('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xf33a('0x7'))(_0xf33a('0x8'));var utils=require('../../config/utils');var config=require(_0xf33a('0x9'));var licenseUtil=require(_0xf33a('0xa'));var db=require(_0xf33a('0xb'))['db'];var socket=require(_0xf33a('0xc'))(new Redis(config[_0xf33a('0xd')]));require(_0xf33a('0xe'))['register'](socket);config[_0xf33a('0xd')]=_[_0xf33a('0xf')](config[_0xf33a('0xd')],{'host':_0xf33a('0x10'),'port':0x18eb});var client=jayson[_0xf33a('0x11')][_0xf33a('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5074a2,_0x4ea282,_0x31ccd8,_0xb47cde){return new BPromise(function(_0x170468,_0x22bd5c){var _0x338d1b=_0xb47cde||client;return _0x338d1b['request'](_0x5074a2,_0x31ccd8)[_0xf33a('0x13')](function(_0x21b80e){logger['info']('User,\x20%s,\x20%s',_0x4ea282,_0xf33a('0x14'));logger[_0xf33a('0x15')](_0xf33a('0x16'),_0x4ea282,_0xf33a('0x14'),JSON[_0xf33a('0x17')](_0x21b80e));if(_0x21b80e[_0xf33a('0x18')]){if(_0x21b80e[_0xf33a('0x18')][_0xf33a('0x19')]===0x1f4){logger['error'](_0xf33a('0x1a'),_0x4ea282,_0x21b80e['error'][_0xf33a('0x1b')]);return _0x22bd5c(_0x21b80e[_0xf33a('0x18')]['message']);}logger[_0xf33a('0x18')](_0xf33a('0x1a'),_0x4ea282,_0x21b80e['error'][_0xf33a('0x1b')]);return _0x170468(_0x21b80e[_0xf33a('0x18')][_0xf33a('0x1b')]);}else{logger[_0xf33a('0x1c')]('User,\x20%s,\x20%s',_0x4ea282,_0xf33a('0x14'));_0x170468(_0x21b80e[_0xf33a('0x1d')][_0xf33a('0x1b')]);}})[_0xf33a('0x1e')](function(_0x412727){logger[_0xf33a('0x18')](_0xf33a('0x1a'),_0x4ea282,_0x412727);_0x22bd5c(_0x412727);});});}function respondWithStatusCode(_0x288275,_0x19055e){_0x19055e=_0x19055e||0xcc;return function(_0x3cf525){if(_0x3cf525){return _0x288275['sendStatus'](_0x19055e);}return _0x288275[_0xf33a('0x1f')](_0x19055e)[_0xf33a('0x20')]();};}function respondWithResult(_0x1bf9bc,_0x27faa1){_0x27faa1=_0x27faa1||0xc8;return function(_0x2ab756){if(_0x2ab756){return _0x1bf9bc['status'](_0x27faa1)[_0xf33a('0x21')](_0x2ab756);}};}function respondWithFilteredResult(_0x5882ba,_0x492986){return function(_0x3f9ef7){if(_0x3f9ef7){var _0x394468=typeof _0x492986[_0xf33a('0x22')]===_0xf33a('0x23')&&typeof _0x492986['limit']===_0xf33a('0x23');var _0x393005=_0x3f9ef7['count'];var _0x4af24a=_0x394468?0x0:_0x492986[_0xf33a('0x22')];var _0x5f0a53=_0x394468?_0x3f9ef7['count']:_0x492986[_0xf33a('0x22')]+_0x492986['limit'];var _0x79d653;if(_0x5f0a53>=_0x393005){_0x5f0a53=_0x393005;_0x79d653=0xc8;}else{_0x79d653=0xce;}_0x5882ba['status'](_0x79d653);return _0x5882ba[_0xf33a('0x24')](_0xf33a('0x25'),_0x4af24a+'-'+_0x5f0a53+'/'+_0x393005)[_0xf33a('0x21')](_0x3f9ef7);}return null;};}function saveUpdates(_0x729fca){return function(_0x4552c9){if(_0x4552c9){return _0x4552c9[_0xf33a('0x26')](_0x729fca)[_0xf33a('0x13')](function(_0x1246ff){return _0x1246ff;});}return null;};}function removeEntity(_0x26e81){return function(_0xf6f9be){if(_0xf6f9be){return _0xf6f9be[_0xf33a('0x27')]()[_0xf33a('0x13')](function(){var _0x22c9f2=_0xf6f9be[_0xf33a('0x28')]({'plain':!![]});if(_0x22c9f2[_0xf33a('0x29')]==='admin')return;var _0x627fd2=[{'name':_0xf33a('0x2a'),'value':_0xf33a('0x2b'),'ignore':!![]},{'name':_0xf33a('0x2c'),'value':'agent','ignore':![]},{'name':_0xf33a('0x2d'),'value':_0xf33a('0x2e'),'ignore':![]}];var _0x2d9a9d=_(_0x627fd2)[_0xf33a('0x2f')](_0xf33a('0x30'))[_0xf33a('0x31')]('value')[_0xf33a('0x32')]();if(_[_0xf33a('0x33')](_0x2d9a9d,_0x22c9f2[_0xf33a('0x29')])){return;}var _0x300007=_[_0xf33a('0x34')](_0x627fd2,['value',_0x22c9f2['role']])[_0xf33a('0x35')];return db['UserProfileResource']['destroy']({'where':{'type':_0x300007,'resourceId':_0x22c9f2['id']}})['then'](function(){return _0xf6f9be;});})[_0xf33a('0x13')](function(){_0x26e81[_0xf33a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f250){return function(_0x55f457){if(!_0x55f457){_0x21f250[_0xf33a('0x36')](0x194);}return _0x55f457;};}function handleError(_0x1f11b3,_0x395ad3){_0x395ad3=_0x395ad3||0x1f4;return function(_0x2a8e9e){logger[_0xf33a('0x18')](_0x2a8e9e[_0xf33a('0x37')]);if(_0x2a8e9e['name']){delete _0x2a8e9e[_0xf33a('0x35')];}_0x1f11b3[_0xf33a('0x1f')](_0x395ad3)['send'](_0x2a8e9e);};}exports[_0xf33a('0x38')]=function(_0x3793b4,_0x3e0a98){var _0x516336={},_0x7a06e1={'count':0x0,'rows':[]};var _0x1650c=_(db[_0xf33a('0x39')][_0xf33a('0x3a')])[_0xf33a('0x31')](function(_0x7a6aa4){return{'name':_0x7a6aa4[_0xf33a('0x3b')],'type':_0x7a6aa4[_0xf33a('0x3c')][_0xf33a('0x3d')]};})['filter'](function(_0x31028b){return!_[_0xf33a('0x33')](['password',_0xf33a('0x3e')],_0x31028b['name']);})['value']();_0x516336=qs[_0xf33a('0x3f')](_0x1650c,_0x3793b4);var _0x893cef={'where':_0x516336['where']};return db[_0xf33a('0x39')][_0xf33a('0x40')](_0x893cef)[_0xf33a('0x13')](function(_0x5776b1){_0x7a06e1[_0xf33a('0x40')]=_0x5776b1;if(_0x3793b4[_0xf33a('0x41')]['includeAll']){_0x516336[_0xf33a('0x42')]=[{'all':!![]}];}if(!_[_0xf33a('0x33')](_0x516336[_0xf33a('0x43')],'id')){_0x516336[_0xf33a('0x43')][_0xf33a('0x44')]('id');}return db['User'][_0xf33a('0x45')](_0x516336);})[_0xf33a('0x13')](function(_0x2325eb){_0x7a06e1[_0xf33a('0x46')]=_0x2325eb;if(_0x3793b4[_0xf33a('0x41')]['openTabs']===_0xf33a('0x47')){var _0x4700df=[];for(var _0x6ae3ef=0x0;_0x6ae3ef<_0x7a06e1['rows'][_0xf33a('0x48')];_0x6ae3ef++){_0x4700df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x49'),_0x7a06e1[_0xf33a('0x46')][_0x6ae3ef][_0xf33a('0x4a')]));_0x4700df[_0xf33a('0x44')](get_open_tabs('sms',_0x7a06e1[_0xf33a('0x46')][_0x6ae3ef][_0xf33a('0x4a')]));_0x4700df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x4b'),_0x7a06e1[_0xf33a('0x46')][_0x6ae3ef]['dataValues']));_0x4700df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x4c'),_0x7a06e1[_0xf33a('0x46')][_0x6ae3ef]['dataValues']));_0x4700df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x4d'),_0x7a06e1['rows'][_0x6ae3ef]['dataValues']));_0x4700df[_0xf33a('0x44')](get_open_tabs('whatsapp',_0x7a06e1[_0xf33a('0x46')][_0x6ae3ef][_0xf33a('0x4a')]));}return BPromise[_0xf33a('0x4e')](_0x4700df)[_0xf33a('0x13')](function(_0xecc82f){return _0x7a06e1;});}else{return _0x7a06e1;}})[_0xf33a('0x13')](respondWithFilteredResult(_0x3e0a98,_0x516336))[_0xf33a('0x1e')](handleError(_0x3e0a98,null));};exports[_0xf33a('0x4f')]=function(_0x205409,_0xbe98a9){var _0x704817={'raw':![],'where':{'id':_0x205409[_0xf33a('0x50')]['id']}},_0x4107b1={};_0x4107b1[_0xf33a('0x51')]=_[_0xf33a('0x52')](_[_0xf33a('0x53')](db[_0xf33a('0x39')][_0xf33a('0x3a')]),[_0xf33a('0x54'),_0xf33a('0x3e')]);_0x4107b1[_0xf33a('0x41')]=_[_0xf33a('0x53')](_0x205409[_0xf33a('0x41')]);_0x4107b1[_0xf33a('0x55')]=_[_0xf33a('0x56')](_0x4107b1[_0xf33a('0x51')],_0x4107b1[_0xf33a('0x41')]);_0x704817[_0xf33a('0x43')]=_[_0xf33a('0x56')](_0x4107b1['model'],qs[_0xf33a('0x57')](_0x205409[_0xf33a('0x41')]['fields']));_0x704817[_0xf33a('0x43')]=_0x704817[_0xf33a('0x43')][_0xf33a('0x48')]?_0x704817['attributes']:_0x4107b1[_0xf33a('0x51')];if(_0x205409[_0xf33a('0x41')][_0xf33a('0x58')]){_0x704817['include']=[{'all':!![]}];}_0x704817=_[_0xf33a('0x59')]({},_0x704817,_0x205409['options']);if(!_[_0xf33a('0x33')](_0x704817[_0xf33a('0x43')],'id')){_0x704817['attributes']['push']('id');}return db[_0xf33a('0x39')][_0xf33a('0x34')](_0x704817)[_0xf33a('0x13')](handleEntityNotFound(_0xbe98a9,null))['then'](function(_0x469d75){var _0x38c5df=[];values=_0x469d75;if(_0x205409[_0xf33a('0x41')][_0xf33a('0x5a')]===_0xf33a('0x47')){_0x38c5df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x49'),_0x469d75['dataValues']));_0x38c5df[_0xf33a('0x44')](get_open_tabs('sms',_0x469d75['dataValues']));_0x38c5df['push'](get_open_tabs(_0xf33a('0x4d'),_0x469d75[_0xf33a('0x4a')]));_0x38c5df[_0xf33a('0x44')](get_open_tabs('whatsapp',_0x469d75[_0xf33a('0x4a')]));_0x38c5df[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x4b'),_0x469d75[_0xf33a('0x4a')]));_0x38c5df[_0xf33a('0x44')](get_open_tabs('mail',_0x469d75['dataValues']));return BPromise['all'](_0x38c5df);}else{return values;}})[_0xf33a('0x13')](function(_0x528ac4){return values;})[_0xf33a('0x13')](respondWithResult(_0xbe98a9,null))[_0xf33a('0x1e')](handleError(_0xbe98a9,null));};exports[_0xf33a('0x26')]=function(_0x430d7b,_0xe5f799){if(_0x430d7b[_0xf33a('0x5b')]['id']){delete _0x430d7b['body']['id'];}delete _0x430d7b[_0xf33a('0x5b')][_0xf33a('0x29')];return db[_0xf33a('0x39')]['find']({'where':{'id':_0x430d7b[_0xf33a('0x50')]['id']}})[_0xf33a('0x13')](handleEntityNotFound(_0xe5f799,null))[_0xf33a('0x13')](saveUpdates(_0x430d7b[_0xf33a('0x5b')],null))[_0xf33a('0x13')](respondWithResult(_0xe5f799,null))[_0xf33a('0x1e')](handleError(_0xe5f799,null));};exports[_0xf33a('0x5c')]=function(_0x244993,_0x13743f){return db[_0xf33a('0x39')][_0xf33a('0x5c')]()[_0xf33a('0x13')](respondWithResult(_0x13743f,null))[_0xf33a('0x1e')](handleError(_0x13743f,null));};exports[_0xf33a('0x5d')]=function(_0x572bb4,_0x489cb2){return db[_0xf33a('0x39')][_0xf33a('0x34')]({'where':{'id':_0x572bb4[_0xf33a('0x50')]['id']}})[_0xf33a('0x13')](handleEntityNotFound(_0x489cb2,null))[_0xf33a('0x13')](function(_0x9e6063){if(_0x9e6063){return _0x9e6063[_0xf33a('0x5d')](_0x572bb4[_0xf33a('0x5b')][_0xf33a('0x5e')],_[_0xf33a('0x5f')](_0x572bb4[_0xf33a('0x5b')],['ids','id'])||{});}})[_0xf33a('0x13')](respondWithResult(_0x489cb2,null))[_0xf33a('0x1e')](handleError(_0x489cb2,null));};function validateUser(_0x3720e1){return new BPromise(function(_0x375889,_0x3ffcca){if(_0x3720e1[_0xf33a('0x60')])return _0x375889(_0x3720e1);return db[_0xf33a('0x61')][_0xf33a('0x62')](0x1)[_0xf33a('0x13')](function(_0x495e87){if(_0x495e87[_0xf33a('0x63')])authService[_0xf33a('0x64')](_0x3720e1['password']);db[_0xf33a('0x39')][_0xf33a('0x65')](_0xf33a('0x60'))[_0xf33a('0x13')](function(_0x7b8d61){if(_[_0xf33a('0x66')](_0x7b8d61)){_0x3720e1['internal']=_0x495e87[_0xf33a('0x67')]||0x1;return;}if(_[_0xf33a('0x66')](_0x495e87[_0xf33a('0x67')])||_0x495e87[_0xf33a('0x67')]===_0x7b8d61){_0x3720e1[_0xf33a('0x60')]=_0x7b8d61+0x1;return;}if(_0x495e87[_0xf33a('0x67')]>_0x7b8d61){_0x3720e1[_0xf33a('0x60')]=_0x495e87['min_internal'];return;}return db[_0xf33a('0x68')][_0xf33a('0x41')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize']['QueryTypes'][_0xf33a('0x69')]})[_0xf33a('0x13')](function(_0xe23c77){if(_0xe23c77&&_0xe23c77[_0xf33a('0x48')]){for(var _0x2a9995=0x0,_0xb3a823=_0xe23c77[_0xf33a('0x48')];_0x2a9995<_0xb3a823&&_[_0xf33a('0x66')](_0x3720e1[_0xf33a('0x60')]);_0x2a9995++){if(_0x495e87[_0xf33a('0x67')]<=_0xe23c77[_0x2a9995][_0xf33a('0x6a')]){_0x3720e1[_0xf33a('0x60')]=_0xe23c77[_0x2a9995]['from'];}else if(_0x495e87[_0xf33a('0x67')]>_0xe23c77[_0x2a9995]['from']&&_0x495e87['min_internal']<=_0xe23c77[_0x2a9995]['to']){_0x3720e1[_0xf33a('0x60')]=_0x495e87[_0xf33a('0x67')];}}}if(_[_0xf33a('0x66')](_0x3720e1['internal'])){_0x3720e1['internal']=_0x7b8d61+0x1;}return _0x375889(_0x3720e1);});});})[_0xf33a('0x1e')](function(_0x4c414c){_0x3ffcca(_0x4c414c);});});}function updateUser(_0x2552f3){return new BPromise(function(_0x15b91b,_0x266d3e){try{if(_0x2552f3[_0xf33a('0x6b')]){_0x2552f3[_0xf33a('0x6c')]=_0x2552f3['internal'];_0x2552f3['VoiceMail']={'mailbox':_0x2552f3[_0xf33a('0x60')],'password':_0x2552f3[_0xf33a('0x54')],'fullname':_0x2552f3[_0xf33a('0x6d')],'email':_0x2552f3[_0xf33a('0x6e')]};}if(_0x2552f3['role']===_0xf33a('0x6f')){if(!_0x2552f3[_0xf33a('0x70')])_0x2552f3['permissions']=[_0xf33a('0x71'),_0xf33a('0x72'),_0xf33a('0x73'),'113',_0xf33a('0x74'),_0xf33a('0x75'),_0xf33a('0x76'),_0xf33a('0x77'),'107',_0xf33a('0x78'),_0xf33a('0x79'),_0xf33a('0x7a'),'111',_0xf33a('0x7b'),_0xf33a('0x7c')];}_0x15b91b(_0x2552f3);}catch(_0x26b3c6){_0x266d3e(_0x26b3c6);}});}exports[_0xf33a('0x7d')]=function(_0x42f669,_0x3c959a){if(_0x42f669[_0xf33a('0x2b')][_0xf33a('0x29')]===_0xf33a('0x6f'))throw new Error(_0xf33a('0x7e'));if(_0x42f669[_0xf33a('0x5b')][_0xf33a('0x29')]===_0xf33a('0x2b')&&_0x42f669[_0xf33a('0x2b')][_0xf33a('0x29')]!=='admin'){throw new Error(_0xf33a('0x7f'));}if(_0x42f669[_0xf33a('0x5b')][_0xf33a('0x29')]===_0xf33a('0x80')&&_0x42f669[_0xf33a('0x2b')][_0xf33a('0x29')]!==_0xf33a('0x80')){throw new Error(_0xf33a('0x81'));}return licenseUtil[_0xf33a('0x82')]([_0x42f669[_0xf33a('0x5b')]])[_0xf33a('0x13')](function(){return validateUser(_0x42f669[_0xf33a('0x5b')]);})[_0xf33a('0x13')](function(_0x439c40){return updateUser(_0x439c40)['then'](function(_0x34417a){if(_0x34417a[_0xf33a('0x29')]===_0xf33a('0x80')){_0x34417a[_0xf33a('0x83')]=_0x42f669['user'][_0xf33a('0x83')];delete _0x34417a[_0xf33a('0x84')];}return _0x34417a;});})[_0xf33a('0x13')](function(_0xfd113f){return db[_0xf33a('0x39')][_0xf33a('0x7d')](_0xfd113f,{'include':[{'model':db[_0xf33a('0x85')],'as':_0xf33a('0x85')}]});})['then'](function(_0x2404dc){if(_0x42f669[_0xf33a('0x5b')][_0xf33a('0x29')]===_0xf33a('0x2b'))return _0x2404dc;if(_0x42f669['user']['role']!==_0xf33a('0x2b'))return _0x2404dc;return db['UserProfileSection'][_0xf33a('0x34')]({'where':{'name':_0x2404dc[_0xf33a('0x29')]===_0xf33a('0x6f')?_0xf33a('0x2c'):'Telephones','userProfileId':_0x42f669['user'][_0xf33a('0x84')]},'raw':!![]})['then'](function(_0x343003){if(!_0x343003||_0x343003[_0xf33a('0x86')]!=0x0)return _0x2404dc;return db[_0xf33a('0x87')][_0xf33a('0x7d')]({'name':_0x2404dc[_0xf33a('0x35')],'resourceId':_0x2404dc['id'],'type':_0x343003[_0xf33a('0x35')],'sectionId':_0x343003['id']},{})[_0xf33a('0x13')](function(){return _0x2404dc;});})[_0xf33a('0x1e')](function(_0x339eaf){logger[_0xf33a('0x18')](_0xf33a('0x88'),_0x339eaf);throw _0x339eaf;});})[_0xf33a('0x13')](respondWithResult(_0x3c959a,0xc9))[_0xf33a('0x1e')](handleError(_0x3c959a,null));};exports[_0xf33a('0x89')]=function(_0xc2e6ae,_0x254c5c){var _0x5b654b=_0xc2e6ae[_0xf33a('0x5b')];var _0x59c9e9=[];if(_0xc2e6ae[_0xf33a('0x2b')]['role']==='agent')throw new Error('Unauthorized');if(_[_0xf33a('0x8a')](_0x5b654b,[_0xf33a('0x29'),'user'])&&_0xc2e6ae[_0xf33a('0x2b')][_0xf33a('0x29')]!==_0xf33a('0x80')){throw new Error(_0xf33a('0x7f'));}if(_[_0xf33a('0x8a')](_0x5b654b,[_0xf33a('0x29'),'admin'])&&_0xc2e6ae[_0xf33a('0x2b')][_0xf33a('0x29')]!=='admin'){throw new Error(_0xf33a('0x8b'));}return licenseUtil[_0xf33a('0x82')](_0x5b654b)[_0xf33a('0x13')](function(){return validateUser(_0x5b654b[0x0]);})['then'](function(){for(var _0x3a550f=0x1;_0x3a550f<_0x5b654b[_0xf33a('0x48')];_0x3a550f++){var _0xb2aa64=_0x5b654b[_0x3a550f-0x1][_0xf33a('0x60')];if(!_0x5b654b[_0x3a550f][_0xf33a('0x60')])_0x5b654b[_0x3a550f]['internal']=_0xb2aa64+0x1;_0x59c9e9[_0xf33a('0x44')](validateUser(_0x5b654b[_0x3a550f]));}return BPromise[_0xf33a('0x4e')](_0x59c9e9);})[_0xf33a('0x13')](function(){_0x59c9e9=[];for(var _0x399b5b=0x0;_0x399b5b<_0x5b654b[_0xf33a('0x48')];_0x399b5b++){_0x59c9e9['push'](updateUser(_0x5b654b[_0x399b5b]));}return BPromise[_0xf33a('0x4e')](_0x59c9e9);})[_0xf33a('0x13')](function(){return BPromise[_0xf33a('0x8c')](_0x5b654b,function(_0x2719c1){return db[_0xf33a('0x39')]['create'](_0x2719c1,{'include':[{'model':db[_0xf33a('0x85')],'as':'VoiceMail'}]})['then'](function(_0x14ff0d){_0x2719c1['id']=_0x14ff0d['id'];return _0x2719c1;});});})['then'](function(_0x1cdfc4){if(_0xc2e6ae[_0xf33a('0x5b')]['role']===_0xf33a('0x2b'))return _0x1cdfc4;if(_0xc2e6ae[_0xf33a('0x2b')][_0xf33a('0x29')]!==_0xf33a('0x2b'))return _0x1cdfc4;var _0x17c6d3=_[_0xf33a('0x8a')](_0x1cdfc4,function(_0x1d5d3f){return _0x1d5d3f['role']===_0xf33a('0x6f')||_0x1d5d3f[_0xf33a('0x29')]===_0xf33a('0x2e');});if(!_0x17c6d3)return _0x1cdfc4;return db[_0xf33a('0x8d')]['findAll']({'where':{'name':{'$or':[_0xf33a('0x2c'),'Telephones']},'userProfileId':_0xc2e6ae[_0xf33a('0x2b')][_0xf33a('0x84')]},'raw':!![]})[_0xf33a('0x13')](function(_0x3facd6){if(_[_0xf33a('0x8e')](_0x3facd6)||!_['some'](_0x3facd6,[_0xf33a('0x86'),0x0]))return _0x1cdfc4;_0x59c9e9=[];var _0x28fbfa=_(_0x3facd6)[_0xf33a('0x31')](function(_0x3c5f46){if(_0x3c5f46[_0xf33a('0x86')]===0x1)return;return _0x3c5f46[_0xf33a('0x35')]==='Agents'?_0xf33a('0x6f'):_0xf33a('0x2e');})['compact']()[_0xf33a('0x32')]();for(var _0x8128a6=0x0;_0x8128a6<_0x1cdfc4[_0xf33a('0x48')];_0x8128a6++){if(!_[_0xf33a('0x33')](_0x28fbfa,_0x1cdfc4[_0x8128a6]['role']))return;var _0x4e5bc8=_0x1cdfc4[_0x8128a6]['role']===_0xf33a('0x6f')?_0xf33a('0x2c'):_0xf33a('0x2d');_0x59c9e9[_0xf33a('0x44')](db[_0xf33a('0x87')][_0xf33a('0x7d')]({'name':_0x1cdfc4[_0x8128a6][_0xf33a('0x35')],'resourceId':_0x1cdfc4[_0x8128a6]['id'],'type':_0x4e5bc8,'sectionId':_['find'](_0x3facd6,[_0xf33a('0x35'),_0x4e5bc8])['id']},{}));}return BPromise[_0xf33a('0x4e')](_0x59c9e9);});})[_0xf33a('0x13')](respondWithResult(_0x254c5c,0xc9))[_0xf33a('0x1e')](handleError(_0x254c5c,null));};exports[_0xf33a('0x8f')]=function(_0x26afb8,_0xbdb564){if(_0x26afb8[_0xf33a('0x5b')]['id']){delete _0x26afb8[_0xf33a('0x5b')]['id'];}return db['User'][_0xf33a('0x34')]({'where':{'id':_0x26afb8[_0xf33a('0x50')]['id']}})[_0xf33a('0x13')](function(_0x63d5ec){if(!_0x63d5ec)return null;if(_0x63d5ec['id']===_0x26afb8['user']['id']){if(!_0x26afb8[_0xf33a('0x5b')][_0xf33a('0x90')]||!_0x26afb8['body'][_0xf33a('0x91')]){throw new db[(_0xf33a('0x92'))][(_0xf33a('0x93'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x63d5ec['authenticate'](_0x26afb8[_0xf33a('0x5b')][_0xf33a('0x90')])){throw new db['Sequelize'][(_0xf33a('0x93'))](_0xf33a('0x94'));}if(_0x26afb8['body'][_0xf33a('0x90')]===_0x26afb8['body'][_0xf33a('0x91')]){throw new db[(_0xf33a('0x92'))][(_0xf33a('0x93'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x26afb8['user']['role']==='admin'){if(!_0x26afb8[_0xf33a('0x5b')][_0xf33a('0x91')]){throw new db[(_0xf33a('0x92'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x26afb8['user'][_0xf33a('0x29')]===_0xf33a('0x2b')){if(!_0x26afb8[_0xf33a('0x5b')][_0xf33a('0x91')]){throw new db[(_0xf33a('0x92'))][(_0xf33a('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x63d5ec[_0xf33a('0x29')]!==_0xf33a('0x6f')){throw new db[(_0xf33a('0x92'))][(_0xf33a('0x93'))]('Unauthorized');}}else{throw new db[(_0xf33a('0x92'))][(_0xf33a('0x93'))]('Unauthorized');}return _0x63d5ec;})['then'](handleEntityNotFound(_0xbdb564,null))['then'](function(_0x1e63d5){return db[_0xf33a('0x61')][_0xf33a('0x95')]({'attributes':['id',_0xf33a('0x63'),_0xf33a('0x96'),_0xf33a('0x97')]})['then'](function(_0x528266){if(_0x528266[_0xf33a('0x63')])authService[_0xf33a('0x64')](_0x26afb8[_0xf33a('0x5b')]['newPassword']);if(!_0x528266[_0xf33a('0x96')]||!_0x1e63d5[_0xf33a('0x98')])return _0x1e63d5;authService[_0xf33a('0x99')](_0x26afb8[_0xf33a('0x5b')][_0xf33a('0x91')],_0x1e63d5[_0xf33a('0x98')],_0x528266[_0xf33a('0x97')]);return _0x1e63d5;})[_0xf33a('0x13')](saveUpdates({'password':_0x26afb8[_0xf33a('0x5b')]['newPassword'],'passwordResetAt':_0x26afb8['user']['id']==_0x26afb8[_0xf33a('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x26afb8['body']['newPassword'],_0x1e63d5['previousPasswords'])},null));})[_0xf33a('0x13')](respondWithResult(_0xbdb564,null))[_0xf33a('0x1e')](handleError(_0xbdb564,null));};exports[_0xf33a('0x9a')]=function(_0x105cb5,_0x56e5bc){var _0x299219=_0x105cb5['body'][_0xf33a('0x9b')];return db['User'][_0xf33a('0x34')]({'where':{'id':_0x105cb5[_0xf33a('0x50')]['id']},'attributes':['id',_0xf33a('0x35'),_0xf33a('0x29'),_0xf33a('0x9c'),_0xf33a('0x9d'),_0xf33a('0x9e'),_0xf33a('0x9f')]})[_0xf33a('0x13')](handleEntityNotFound(_0x56e5bc,null))[_0xf33a('0x13')](function(_0x5ea425){if(_0x5ea425){if(!utils['isValidChannel'](_0x299219)){throw new db['Sequelize'][(_0xf33a('0x93'))](_0xf33a('0xa0'));}return _0x5ea425[_0xf33a('0xa1')+_[_0xf33a('0xa2')](_0x299219[_0xf33a('0xa3')]())+_0xf33a('0xa4')](_0x105cb5[_0xf33a('0x5b')][_0xf33a('0x5e')],{'penalty':_0x105cb5['body'][_0xf33a('0xa5')]||0x0})[_0xf33a('0xa6')](function(_0x55939d){for(var _0x40b5dc=0x0;_0x40b5dc<_0x105cb5[_0xf33a('0x5b')][_0xf33a('0x5e')][_0xf33a('0x48')];_0x40b5dc+=0x1){var _0xcc08ba={'UserId':Number(_0x105cb5[_0xf33a('0x50')]['id'])};_0xcc08ba[_[_0xf33a('0xa2')](_0x299219[_0xf33a('0xa3')]())+'QueueId']=Number(_0x105cb5[_0xf33a('0x5b')]['ids'][_0x40b5dc]);socket[_0xf33a('0xa7')](_0xf33a('0x2b')+_['capitalize'](_0x299219[_0xf33a('0xa3')]())+_0xf33a('0xa8'),_0xcc08ba);}return _0x55939d;})['then'](function(){if(_0x299219==='voice'){return db['VoiceQueue'][_0xf33a('0x45')]({'where':{'id':_0x105cb5[_0xf33a('0x5b')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x90165){var _0x519a3d=_0x5ea425[_0xf33a('0x28')]({'plain':!![]});var _0x4f5192=[];if(_0x299219===_0xf33a('0xa9')&&_0x519a3d[_0xf33a('0x29')]==='agent'&&_0x519a3d[_0xf33a('0x9c')]){for(var _0x3c522d=0x0;_0x3c522d<_0x90165[_0xf33a('0x48')];_0x3c522d+=0x1){_0x4f5192[_0xf33a('0x44')]({'membername':_0x519a3d[_0xf33a('0x35')],'UserId':_0x519a3d['id'],'queue_name':_0x90165[_0x3c522d][_0xf33a('0x35')],'VoiceQueueId':_0x90165[_0x3c522d]['id'],'interface':_[_0xf33a('0x66')](_0x519a3d[_0xf33a('0x9f')])?util[_0xf33a('0xaa')](_0xf33a('0xab'),_0x519a3d['name']):_0x519a3d[_0xf33a('0x9f')],'paused':_0x519a3d['voicePause']||![],'penalty':_0x105cb5[_0xf33a('0x5b')]['penalty']||0x0});}return BPromise[_0xf33a('0x8c')](_0x4f5192,function(_0x2dc74a){return db[_0xf33a('0xac')][_0xf33a('0xad')](_0x2dc74a);});}return _0x5ea425;});}})[_0xf33a('0x13')](respondWithStatusCode(_0x56e5bc,null))['catch'](handleError(_0x56e5bc,null));};exports[_0xf33a('0xae')]=function(_0x102520,_0x402e38){var _0x2ddd8e;return db[_0xf33a('0x39')]['find']({'where':{'id':_0x102520[_0xf33a('0x50')]['id']},'attributes':['id',_0xf33a('0x35'),_0xf33a('0x29')]})[_0xf33a('0x13')](handleEntityNotFound(_0x402e38,null))['then'](function(_0x2f02bb){if(_0x2f02bb){_0x2ddd8e=_0x2f02bb;if(!_0x102520['query'][_0xf33a('0x9b')]||!utils[_0xf33a('0xaf')](_0x102520[_0xf33a('0x41')]['channel'])){throw new db['Sequelize'][(_0xf33a('0x93'))](_0xf33a('0xa0'));}return _0x2f02bb[_0xf33a('0xb0')+_['capitalize'](_0x102520[_0xf33a('0x41')][_0xf33a('0x9b')][_0xf33a('0xa3')]())+_0xf33a('0xa4')](_0x102520[_0xf33a('0x41')][_0xf33a('0x5e')]);}})[_0xf33a('0x13')](function(_0x59a02b){if(_['isArray'](_0x102520[_0xf33a('0x41')]['ids'])){for(var _0x432d08=0x0;_0x432d08<_0x102520[_0xf33a('0x41')][_0xf33a('0x5e')][_0xf33a('0x48')];_0x432d08+=0x1){var _0x34781e={'UserId':Number(_0x102520[_0xf33a('0x50')]['id'])};_0x34781e[_['capitalize'](_0x102520[_0xf33a('0x41')][_0xf33a('0x9b')][_0xf33a('0xa3')]())+_0xf33a('0xb1')]=Number(_0x102520[_0xf33a('0x41')][_0xf33a('0x5e')][_0x432d08]);socket['emit'](_0xf33a('0x2b')+_[_0xf33a('0xa2')](_0x102520['query'][_0xf33a('0x9b')][_0xf33a('0xa3')]())+_0xf33a('0xb2'),_0x34781e);}}else{var _0x34781e={'UserId':Number(_0x102520[_0xf33a('0x50')]['id'])};_0x34781e[_['capitalize'](_0x102520[_0xf33a('0x41')][_0xf33a('0x9b')]['toLowerCase']())+_0xf33a('0xb1')]=Number(_0x102520[_0xf33a('0x41')][_0xf33a('0x5e')]);socket[_0xf33a('0xa7')](_0xf33a('0x2b')+_['capitalize'](_0x102520[_0xf33a('0x41')]['channel'][_0xf33a('0xa3')]())+'Queue:remove',_0x34781e);}return _0x59a02b;})['then'](function(){if(_0x102520[_0xf33a('0x41')]['channel']===_0xf33a('0xa9')){return db[_0xf33a('0xac')][_0xf33a('0x27')]({'where':{'UserId':_0x102520[_0xf33a('0x50')]['id'],'VoiceQueueId':_0x102520[_0xf33a('0x41')]['ids']},'individualHooks':!![]})[_0xf33a('0x13')](function(){return _0x2ddd8e;});}return _0x2ddd8e;})['then'](respondWithStatusCode(_0x402e38,null))[_0xf33a('0x1e')](handleError(_0x402e38,null));};exports[_0xf33a('0xb3')]=function(_0x43883e,_0xb6b478){_0x43883e[_0xf33a('0x5b')][_0xf33a('0xb4')]=_0x43883e[_0xf33a('0xb5')][_0xf33a('0xb6')];return db[_0xf33a('0x39')][_0xf33a('0x34')]({'where':{'id':_0x43883e[_0xf33a('0x50')]['id']}})[_0xf33a('0x13')](handleEntityNotFound(_0xb6b478,null))[_0xf33a('0x13')](saveUpdates(_0x43883e[_0xf33a('0x5b')],null))[_0xf33a('0x13')](respondWithResult(_0xb6b478,null))[_0xf33a('0x1e')](handleError(_0xb6b478,null));};exports[_0xf33a('0xb7')]=function(_0x2df5a9,_0x5664b1){var _0x1f4aec=path[_0xf33a('0xb8')](config[_0xf33a('0xb9')],'server/files/images/logos/default_profile.png');return db[_0xf33a('0x39')][_0xf33a('0x34')]({'where':{'id':_0x2df5a9[_0xf33a('0x50')]['id']},'attributes':['id',_0xf33a('0xb4')],'raw':!![]})[_0xf33a('0x13')](handleEntityNotFound(_0x5664b1,null))[_0xf33a('0x13')](function(_0x2d2293){if(_0x2d2293){if(_[_0xf33a('0x66')](_0x2d2293[_0xf33a('0xb4')])){return _0x5664b1[_0xf33a('0xba')](_0x1f4aec);}else{if(!fs[_0xf33a('0xbb')](path[_0xf33a('0xb8')](config['root'],'server/files/images/',_0x2d2293[_0xf33a('0xb4')]))){return _0x5664b1[_0xf33a('0xba')](_0x1f4aec);}return _0x5664b1[_0xf33a('0xba')](path[_0xf33a('0xb8')](config[_0xf33a('0xb9')],_0xf33a('0xbc'),_0x2d2293['userpic']));}}})['catch'](handleError(_0x5664b1,null));};exports[_0xf33a('0xbd')]=function(_0x56de47,_0x5728a6){return db[_0xf33a('0x39')][_0xf33a('0x34')]({'where':{'id':_0x56de47[_0xf33a('0x50')]['id']},'attributes':['id']})[_0xf33a('0x13')](handleEntityNotFound(_0x5728a6,null))[_0xf33a('0x13')](function(_0x142960){var _0x1c6f2d=[];values=_0x142960[_0xf33a('0x4a')];_0x1c6f2d[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x49'),_0x142960[_0xf33a('0x4a')]));_0x1c6f2d[_0xf33a('0x44')](get_open_tabs(_0xf33a('0xbe'),_0x142960[_0xf33a('0x4a')]));_0x1c6f2d[_0xf33a('0x44')](get_open_tabs(_0xf33a('0x4d'),_0x142960[_0xf33a('0x4a')]));_0x1c6f2d[_0xf33a('0x44')](get_open_tabs(_0xf33a('0xbf'),_0x142960['dataValues']));_0x1c6f2d['push'](get_open_tabs(_0xf33a('0x4b'),_0x142960[_0xf33a('0x4a')]));_0x1c6f2d['push'](get_open_tabs(_0xf33a('0x4c'),_0x142960['dataValues']));return BPromise[_0xf33a('0x4e')](_0x1c6f2d);})[_0xf33a('0x13')](function(_0x5b7fce){var _0x3e0df3=[];if(_0x5b7fce){for(var _0x25f561=0x0;_0x25f561=_0x2db443){_0x315ad7=_0x2db443;_0x337f97=0xc8;}else{_0x337f97=0xce;}_0x2e99ed[_0xa57c('0x1e')](_0x337f97);return _0x2e99ed['set'](_0xa57c('0x25'),_0x27884d+'-'+_0x315ad7+'/'+_0x2db443)['json'](_0x382a26);}return null;};}function saveUpdates(_0x54a18b){return function(_0x257661){if(_0x257661){return _0x257661[_0xa57c('0x26')](_0x54a18b)['then'](function(_0x12898b){return _0x12898b;});}return null;};}function removeEntity(_0x1ef331){return function(_0x3eb9e9){if(_0x3eb9e9){return _0x3eb9e9['destroy']()[_0xa57c('0x13')](function(){var _0x58d46f=_0x3eb9e9[_0xa57c('0x27')]({'plain':!![]});if(_0x58d46f['role']===_0xa57c('0x28'))return;var _0x51ad09=[{'name':_0xa57c('0x29'),'value':'user','ignore':!![]},{'name':_0xa57c('0x2a'),'value':_0xa57c('0x2b'),'ignore':![]},{'name':_0xa57c('0x2c'),'value':_0xa57c('0x2d'),'ignore':![]}];var _0xfd0f66=_(_0x51ad09)[_0xa57c('0x2e')](_0xa57c('0x2f'))['map'](_0xa57c('0x30'))['value']();if(_[_0xa57c('0x31')](_0xfd0f66,_0x58d46f[_0xa57c('0x32')])){return;}var _0x27ada0=_['find'](_0x51ad09,[_0xa57c('0x30'),_0x58d46f['role']])[_0xa57c('0x33')];return db['UserProfileResource'][_0xa57c('0x34')]({'where':{'type':_0x27ada0,'resourceId':_0x58d46f['id']}})['then'](function(){return _0x3eb9e9;});})[_0xa57c('0x13')](function(){_0x1ef331[_0xa57c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8d17){return function(_0x47b65c){if(!_0x47b65c){_0x3b8d17[_0xa57c('0x1d')](0x194);}return _0x47b65c;};}function handleError(_0x5c56d3,_0x189d9b){_0x189d9b=_0x189d9b||0x1f4;return function(_0x3776de){logger[_0xa57c('0x19')](_0x3776de[_0xa57c('0x35')]);if(_0x3776de[_0xa57c('0x33')]){delete _0x3776de[_0xa57c('0x33')];}_0x5c56d3['status'](_0x189d9b)['send'](_0x3776de);};}exports[_0xa57c('0x36')]=function(_0x13e390,_0x2c70d6){var _0x570f6c={},_0x12b644={'count':0x0,'rows':[]};var _0x5308d5=_(db[_0xa57c('0x37')][_0xa57c('0x38')])['map'](function(_0x558cf7){return{'name':_0x558cf7['fieldName'],'type':_0x558cf7[_0xa57c('0x39')][_0xa57c('0x3a')]};})[_0xa57c('0x2e')](function(_0x21e4df){return!_[_0xa57c('0x31')]([_0xa57c('0x3b'),'salt'],_0x21e4df[_0xa57c('0x33')]);})[_0xa57c('0x30')]();_0x570f6c=qs['getOptions'](_0x5308d5,_0x13e390);var _0x5ed42d={'where':_0x570f6c[_0xa57c('0x3c')]};return db[_0xa57c('0x37')]['count'](_0x5ed42d)[_0xa57c('0x13')](function(_0x5603cf){_0x12b644[_0xa57c('0x24')]=_0x5603cf;if(_0x13e390[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x570f6c[_0xa57c('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x570f6c[_0xa57c('0x40')],'id')){_0x570f6c['attributes']['push']('id');}return db['User']['findAll'](_0x570f6c);})['then'](function(_0x39b20f){_0x12b644[_0xa57c('0x41')]=_0x39b20f;if(_0x13e390[_0xa57c('0x3d')]['openTabs']==='true'){var _0x49e072=[];for(var _0x44f1e8=0x0;_0x44f1e8<_0x12b644[_0xa57c('0x41')][_0xa57c('0x42')];_0x44f1e8++){_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x44'),_0x12b644[_0xa57c('0x41')][_0x44f1e8]['dataValues']));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x47'),_0x12b644['rows'][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x48'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072['push'](get_open_tabs(_0xa57c('0x49'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x12b644[_0xa57c('0x41')][_0x44f1e8]['dataValues']));}return BPromise[_0xa57c('0x4b')](_0x49e072)[_0xa57c('0x13')](function(_0x247906){return _0x12b644;});}else{return _0x12b644;}})[_0xa57c('0x13')](respondWithFilteredResult(_0x2c70d6,_0x570f6c))[_0xa57c('0x4c')](handleError(_0x2c70d6,null));};exports[_0xa57c('0x4d')]=function(_0x57533e,_0x516461){var _0x578436={'raw':![],'where':{'id':_0x57533e[_0xa57c('0x4e')]['id']}},_0x5082ef={};_0x5082ef['model']=_[_0xa57c('0x4f')](_[_0xa57c('0x50')](db['User'][_0xa57c('0x38')]),[_0xa57c('0x3b'),_0xa57c('0x51')]);_0x5082ef[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x57533e['query']);_0x5082ef[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x5082ef[_0xa57c('0x54')],_0x5082ef[_0xa57c('0x3d')]);_0x578436[_0xa57c('0x40')]=_['intersection'](_0x5082ef[_0xa57c('0x54')],qs['fields'](_0x57533e['query'][_0xa57c('0x55')]));_0x578436[_0xa57c('0x40')]=_0x578436[_0xa57c('0x40')]['length']?_0x578436['attributes']:_0x5082ef[_0xa57c('0x54')];if(_0x57533e[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x578436[_0xa57c('0x3f')]=[{'all':!![]}];}_0x578436=_['merge']({},_0x578436,_0x57533e[_0xa57c('0x56')]);if(!_[_0xa57c('0x31')](_0x578436[_0xa57c('0x40')],'id')){_0x578436['attributes']['push']('id');}return db[_0xa57c('0x37')][_0xa57c('0x57')](_0x578436)['then'](handleEntityNotFound(_0x516461,null))[_0xa57c('0x13')](function(_0x28f650){var _0x273975=[];values=_0x28f650;if(_0x57533e[_0xa57c('0x3d')][_0xa57c('0x58')]===_0xa57c('0x59')){_0x273975[_0xa57c('0x43')](get_open_tabs('chat',_0x28f650['dataValues']));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x28f650[_0xa57c('0x46')]));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x49'),_0x28f650[_0xa57c('0x46')]));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x28f650['dataValues']));_0x273975['push'](get_open_tabs(_0xa57c('0x47'),_0x28f650['dataValues']));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x48'),_0x28f650[_0xa57c('0x46')]));return BPromise['all'](_0x273975);}else{return values;}})[_0xa57c('0x13')](function(_0x5b3bf0){return values;})[_0xa57c('0x13')](respondWithResult(_0x516461,null))['catch'](handleError(_0x516461,null));};exports[_0xa57c('0x26')]=function(_0x170187,_0x398743){if(_0x170187[_0xa57c('0x5a')]['id']){delete _0x170187['body']['id'];}delete _0x170187[_0xa57c('0x5a')][_0xa57c('0x32')];return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x170187[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x398743,null))[_0xa57c('0x13')](saveUpdates(_0x170187[_0xa57c('0x5a')],null))[_0xa57c('0x13')](respondWithResult(_0x398743,null))[_0xa57c('0x4c')](handleError(_0x398743,null));};exports[_0xa57c('0x5b')]=function(_0xe5e63,_0x143ec3){return db[_0xa57c('0x37')][_0xa57c('0x5b')]()[_0xa57c('0x13')](respondWithResult(_0x143ec3,null))['catch'](handleError(_0x143ec3,null));};exports[_0xa57c('0x5c')]=function(_0x297518,_0x1bc70b){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x297518[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1bc70b,null))[_0xa57c('0x13')](function(_0x15eef4){if(_0x15eef4){return _0x15eef4['addContacts'](_0x297518[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x297518[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x1bc70b,null))[_0xa57c('0x4c')](handleError(_0x1bc70b,null));};function validateUser(_0x5e1103){return new BPromise(function(_0xaa82e1,_0x5a5653){if(_0x5e1103[_0xa57c('0x5f')])return _0xaa82e1(_0x5e1103);return db['Setting'][_0xa57c('0x60')](0x1)['then'](function(_0x3ef1f1){if(_0x3ef1f1[_0xa57c('0x61')])authService['validatePasswordPattern'](_0x5e1103[_0xa57c('0x3b')]);db[_0xa57c('0x37')][_0xa57c('0x62')](_0xa57c('0x5f'))['then'](function(_0x3a3983){if(_[_0xa57c('0x63')](_0x3a3983)){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')]||0x1;return;}if(_[_0xa57c('0x63')](_0x3ef1f1[_0xa57c('0x64')])||_0x3ef1f1[_0xa57c('0x64')]===_0x3a3983){_0x5e1103[_0xa57c('0x5f')]=_0x3a3983+0x1;return;}if(_0x3ef1f1[_0xa57c('0x64')]>_0x3a3983){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')];return;}return db[_0xa57c('0x65')][_0xa57c('0x3d')](_0xa57c('0x66'),{'type':db[_0xa57c('0x65')][_0xa57c('0x67')]['SELECT']})[_0xa57c('0x13')](function(_0x521503){if(_0x521503&&_0x521503[_0xa57c('0x42')]){for(var _0x24b09a=0x0,_0x245238=_0x521503['length'];_0x24b09a<_0x245238&&_[_0xa57c('0x63')](_0x5e1103[_0xa57c('0x5f')]);_0x24b09a++){if(_0x3ef1f1[_0xa57c('0x64')]<=_0x521503[_0x24b09a]['from']){_0x5e1103['internal']=_0x521503[_0x24b09a][_0xa57c('0x68')];}else if(_0x3ef1f1[_0xa57c('0x64')]>_0x521503[_0x24b09a][_0xa57c('0x68')]&&_0x3ef1f1[_0xa57c('0x64')]<=_0x521503[_0x24b09a]['to']){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')];}}}if(_[_0xa57c('0x63')](_0x5e1103[_0xa57c('0x5f')])){_0x5e1103[_0xa57c('0x5f')]=_0x3a3983+0x1;}return _0xaa82e1(_0x5e1103);});});})['catch'](function(_0x25f5f0){_0x5a5653(_0x25f5f0);});});}function updateUser(_0x29951e){return new BPromise(function(_0x55f526,_0x2e37d7){try{if(_0x29951e[_0xa57c('0x69')]){_0x29951e[_0xa57c('0x6a')]=_0x29951e[_0xa57c('0x5f')];_0x29951e[_0xa57c('0x6b')]={'mailbox':_0x29951e[_0xa57c('0x5f')],'password':_0x29951e[_0xa57c('0x3b')],'fullname':_0x29951e[_0xa57c('0x6c')],'email':_0x29951e['email']};}if(_0x29951e[_0xa57c('0x32')]===_0xa57c('0x2b')){if(!_0x29951e['permissions'])_0x29951e[_0xa57c('0x6d')]=[_0xa57c('0x6e'),'102','103',_0xa57c('0x6f'),_0xa57c('0x70'),_0xa57c('0x71'),_0xa57c('0x72'),_0xa57c('0x73'),'107',_0xa57c('0x74'),_0xa57c('0x75'),_0xa57c('0x76'),'111',_0xa57c('0x77'),'115'];}_0x55f526(_0x29951e);}catch(_0x1281ec){_0x2e37d7(_0x1281ec);}});}exports[_0xa57c('0x78')]=function(_0x27321e,_0x2bd081){if(_0x27321e['user'][_0xa57c('0x32')]===_0xa57c('0x2b'))throw new Error(_0xa57c('0x79'));if(_0x27321e[_0xa57c('0x5a')]['role']===_0xa57c('0x7a')&&_0x27321e[_0xa57c('0x7a')][_0xa57c('0x32')]!=='admin'){throw new Error(_0xa57c('0x7b'));}if(_0x27321e[_0xa57c('0x5a')][_0xa57c('0x32')]==='admin'&&_0x27321e[_0xa57c('0x7a')][_0xa57c('0x32')]!==_0xa57c('0x28')){throw new Error(_0xa57c('0x7c'));}return licenseUtil['checkUserLimits']([_0x27321e[_0xa57c('0x5a')]])[_0xa57c('0x13')](function(){return validateUser(_0x27321e['body']);})[_0xa57c('0x13')](function(_0x1157ea){return updateUser(_0x1157ea)['then'](function(_0x29a4e0){if(_0x29a4e0['role']===_0xa57c('0x28')){_0x29a4e0[_0xa57c('0x7d')]=_0x27321e[_0xa57c('0x7a')][_0xa57c('0x7d')];delete _0x29a4e0['userProfileId'];}return _0x29a4e0;});})[_0xa57c('0x13')](function(_0x2288c2){return db[_0xa57c('0x37')][_0xa57c('0x78')](_0x2288c2,{'include':[{'model':db[_0xa57c('0x6b')],'as':_0xa57c('0x6b')}]});})[_0xa57c('0x13')](function(_0x390710){if(_0x27321e[_0xa57c('0x5a')][_0xa57c('0x32')]===_0xa57c('0x7a'))return _0x390710;if(_0x27321e['user']['role']!=='user')return _0x390710;return db[_0xa57c('0x7e')]['find']({'where':{'name':_0x390710[_0xa57c('0x32')]===_0xa57c('0x2b')?_0xa57c('0x2a'):'Telephones','userProfileId':_0x27321e[_0xa57c('0x7a')][_0xa57c('0x7f')]},'raw':!![]})[_0xa57c('0x13')](function(_0x39ae13){if(!_0x39ae13||_0x39ae13[_0xa57c('0x80')]!=0x0)return _0x390710;return db[_0xa57c('0x81')][_0xa57c('0x78')]({'name':_0x390710['name'],'resourceId':_0x390710['id'],'type':_0x39ae13[_0xa57c('0x33')],'sectionId':_0x39ae13['id']},{})[_0xa57c('0x13')](function(){return _0x390710;});})['catch'](function(_0x4e5292){logger[_0xa57c('0x19')](_0xa57c('0x82'),_0x4e5292);throw _0x4e5292;});})['then'](respondWithResult(_0x2bd081,0xc9))['catch'](handleError(_0x2bd081,null));};exports[_0xa57c('0x83')]=function(_0x4962ae,_0x3726ee){var _0x12f5dd=_0x4962ae['body'];var _0x1cda66=[];if(_0x4962ae[_0xa57c('0x7a')][_0xa57c('0x32')]===_0xa57c('0x2b'))throw new Error(_0xa57c('0x79'));if(_['some'](_0x12f5dd,[_0xa57c('0x32'),'user'])&&_0x4962ae[_0xa57c('0x7a')][_0xa57c('0x32')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x12f5dd,[_0xa57c('0x32'),'admin'])&&_0x4962ae['user'][_0xa57c('0x32')]!==_0xa57c('0x28')){throw new Error(_0xa57c('0x84'));}return licenseUtil['checkUserLimits'](_0x12f5dd)[_0xa57c('0x13')](function(){return validateUser(_0x12f5dd[0x0]);})[_0xa57c('0x13')](function(){for(var _0x11e592=0x1;_0x11e592<_0x12f5dd['length'];_0x11e592++){var _0x4b8228=_0x12f5dd[_0x11e592-0x1][_0xa57c('0x5f')];if(!_0x12f5dd[_0x11e592]['internal'])_0x12f5dd[_0x11e592][_0xa57c('0x5f')]=_0x4b8228+0x1;_0x1cda66[_0xa57c('0x43')](validateUser(_0x12f5dd[_0x11e592]));}return BPromise['all'](_0x1cda66);})[_0xa57c('0x13')](function(){_0x1cda66=[];for(var _0x55261e=0x0;_0x55261e<_0x12f5dd['length'];_0x55261e++){_0x1cda66['push'](updateUser(_0x12f5dd[_0x55261e]));}return BPromise[_0xa57c('0x4b')](_0x1cda66);})['then'](function(){return BPromise['each'](_0x12f5dd,function(_0x542194){return db[_0xa57c('0x37')][_0xa57c('0x78')](_0x542194,{'include':[{'model':db['VoiceMail'],'as':_0xa57c('0x6b')}]})[_0xa57c('0x13')](function(_0x25298c){_0x542194['id']=_0x25298c['id'];return _0x542194;});});})['then'](function(_0x31be8e){if(_0x4962ae[_0xa57c('0x5a')][_0xa57c('0x32')]===_0xa57c('0x7a'))return _0x31be8e;if(_0x4962ae['user']['role']!==_0xa57c('0x7a'))return _0x31be8e;var _0x512e3d=_[_0xa57c('0x85')](_0x31be8e,function(_0x3d1e2f){return _0x3d1e2f[_0xa57c('0x32')]==='agent'||_0x3d1e2f[_0xa57c('0x32')]==='telephone';});if(!_0x512e3d)return _0x31be8e;return db['UserProfileSection'][_0xa57c('0x86')]({'where':{'name':{'$or':['Agents',_0xa57c('0x2c')]},'userProfileId':_0x4962ae[_0xa57c('0x7a')]['userProfileId']},'raw':!![]})['then'](function(_0x46fbea){if(_[_0xa57c('0x87')](_0x46fbea)||!_['some'](_0x46fbea,['autoAssociation',0x0]))return _0x31be8e;_0x1cda66=[];var _0x2550bc=_(_0x46fbea)[_0xa57c('0x88')](function(_0xa09ff){if(_0xa09ff['autoAssociation']===0x1)return;return _0xa09ff[_0xa57c('0x33')]===_0xa57c('0x2a')?_0xa57c('0x2b'):_0xa57c('0x2d');})[_0xa57c('0x89')]()[_0xa57c('0x30')]();for(var _0x10f1b5=0x0;_0x10f1b5<_0x31be8e[_0xa57c('0x42')];_0x10f1b5++){if(!_[_0xa57c('0x31')](_0x2550bc,_0x31be8e[_0x10f1b5][_0xa57c('0x32')]))return;var _0x46b223=_0x31be8e[_0x10f1b5][_0xa57c('0x32')]===_0xa57c('0x2b')?'Agents':_0xa57c('0x2c');_0x1cda66[_0xa57c('0x43')](db[_0xa57c('0x81')][_0xa57c('0x78')]({'name':_0x31be8e[_0x10f1b5][_0xa57c('0x33')],'resourceId':_0x31be8e[_0x10f1b5]['id'],'type':_0x46b223,'sectionId':_[_0xa57c('0x57')](_0x46fbea,['name',_0x46b223])['id']},{}));}return BPromise['all'](_0x1cda66);});})[_0xa57c('0x13')](respondWithResult(_0x3726ee,0xc9))['catch'](handleError(_0x3726ee,null));};exports['changePassword']=function(_0x68c843,_0x138edd){if(_0x68c843[_0xa57c('0x5a')]['id']){delete _0x68c843['body']['id'];}return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x68c843[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](function(_0x3eb06d){if(!_0x3eb06d)return null;if(_0x3eb06d['id']===_0x68c843['user']['id']){if(!_0x68c843['body'][_0xa57c('0x8a')]||!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db['Sequelize'][(_0xa57c('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x3eb06d[_0xa57c('0x8d')](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8a')])){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))](_0xa57c('0x8f'));}if(_0x68c843[_0xa57c('0x5a')]['oldPassword']===_0x68c843['body'][_0xa57c('0x8b')]){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x68c843['user'][_0xa57c('0x32')]===_0xa57c('0x28')){if(!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0x90'));}}else if(_0x68c843[_0xa57c('0x7a')][_0xa57c('0x32')]==='user'){if(!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db['Sequelize'][(_0xa57c('0x8c'))](_0xa57c('0x90'));}if(_0x3eb06d[_0xa57c('0x32')]!==_0xa57c('0x2b')){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))](_0xa57c('0x79'));}}else{throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))]('Unauthorized');}return _0x3eb06d;})[_0xa57c('0x13')](handleEntityNotFound(_0x138edd,null))[_0xa57c('0x13')](function(_0xaf7884){return db[_0xa57c('0x91')]['findOne']({'attributes':['id','securePassword',_0xa57c('0x92'),'passwordHistoryLimit']})[_0xa57c('0x13')](function(_0x4a3423){if(_0x4a3423[_0xa57c('0x61')])authService['validatePasswordPattern'](_0x68c843['body'][_0xa57c('0x8b')]);if(!_0x4a3423['enforcePasswordHistory']||!_0xaf7884[_0xa57c('0x93')])return _0xaf7884;authService['validatePasswordHistory'](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')],_0xaf7884[_0xa57c('0x93')],_0x4a3423[_0xa57c('0x94')]);return _0xaf7884;})['then'](saveUpdates({'password':_0x68c843['body'][_0xa57c('0x8b')],'passwordResetAt':_0x68c843[_0xa57c('0x7a')]['id']==_0x68c843['params']['id']?moment():null,'previousPasswords':authService[_0xa57c('0x95')](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')],_0xaf7884[_0xa57c('0x93')])},null));})[_0xa57c('0x13')](respondWithResult(_0x138edd,null))[_0xa57c('0x4c')](handleError(_0x138edd,null));};exports[_0xa57c('0x96')]=function(_0x28dbe2,_0x507814){var _0xb618b4=_0x28dbe2['body']['channel'];return db[_0xa57c('0x37')]['find']({'where':{'id':_0x28dbe2[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),_0xa57c('0x32'),'online',_0xa57c('0x97'),'voicePause','interface']})[_0xa57c('0x13')](handleEntityNotFound(_0x507814,null))[_0xa57c('0x13')](function(_0x1ce6e8){if(_0x1ce6e8){if(!utils[_0xa57c('0x98')](_0xb618b4)){throw new db['Sequelize'][(_0xa57c('0x8c'))]('Unknown\x20channel');}return _0x1ce6e8['add'+_['capitalize'](_0xb618b4[_0xa57c('0x99')]())+_0xa57c('0x9a')](_0x28dbe2[_0xa57c('0x5a')][_0xa57c('0x5d')],{'penalty':_0x28dbe2['body'][_0xa57c('0x9b')]||0x0})['spread'](function(_0x3e9ce5){for(var _0x40577f=0x0;_0x40577f<_0x28dbe2['body'][_0xa57c('0x5d')][_0xa57c('0x42')];_0x40577f+=0x1){var _0x216300={'UserId':Number(_0x28dbe2[_0xa57c('0x4e')]['id'])};_0x216300[_[_0xa57c('0x9c')](_0xb618b4['toLowerCase']())+_0xa57c('0x9d')]=Number(_0x28dbe2['body'][_0xa57c('0x5d')][_0x40577f]);socket[_0xa57c('0x9e')](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0xb618b4[_0xa57c('0x99')]())+_0xa57c('0x9f'),_0x216300);}return _0x3e9ce5;})[_0xa57c('0x13')](function(){if(_0xb618b4===_0xa57c('0xa0')){return db[_0xa57c('0xa1')][_0xa57c('0x86')]({'where':{'id':_0x28dbe2['body'][_0xa57c('0x5d')]||[]},'raw':!![],'attributes':['id',_0xa57c('0x33')]});}})['then'](function(_0x53ef3d){var _0x525865=_0x1ce6e8[_0xa57c('0x27')]({'plain':!![]});var _0x2da247=[];if(_0xb618b4===_0xa57c('0xa0')&&_0x525865['role']===_0xa57c('0x2b')&&_0x525865['online']){for(var _0x2ec3ce=0x0;_0x2ec3ce<_0x53ef3d[_0xa57c('0x42')];_0x2ec3ce+=0x1){_0x2da247['push']({'membername':_0x525865[_0xa57c('0x33')],'UserId':_0x525865['id'],'queue_name':_0x53ef3d[_0x2ec3ce][_0xa57c('0x33')],'VoiceQueueId':_0x53ef3d[_0x2ec3ce]['id'],'interface':_[_0xa57c('0x63')](_0x525865[_0xa57c('0xa2')])?util[_0xa57c('0xa3')](_0xa57c('0xa4'),_0x525865['name']):_0x525865[_0xa57c('0xa2')],'paused':_0x525865[_0xa57c('0xa5')]||![],'penalty':_0x28dbe2[_0xa57c('0x5a')][_0xa57c('0x9b')]||0x0});}return BPromise[_0xa57c('0xa6')](_0x2da247,function(_0x44a93f){return db['UserVoiceQueueRt'][_0xa57c('0xa7')](_0x44a93f);});}return _0x1ce6e8;});}})[_0xa57c('0x13')](respondWithStatusCode(_0x507814,null))[_0xa57c('0x4c')](handleError(_0x507814,null));};exports['removeQueues']=function(_0x3eac3d,_0x582d6b){var _0x521f69;return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3eac3d[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),'role']})[_0xa57c('0x13')](handleEntityNotFound(_0x582d6b,null))['then'](function(_0x20b58c){if(_0x20b58c){_0x521f69=_0x20b58c;if(!_0x3eac3d['query']['channel']||!utils[_0xa57c('0x98')](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')])){throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0xa9'));}return _0x20b58c[_0xa57c('0xaa')+_[_0xa57c('0x9c')](_0x3eac3d[_0xa57c('0x3d')]['channel'][_0xa57c('0x99')]())+_0xa57c('0x9a')](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})[_0xa57c('0x13')](function(_0xb201ad){if(_['isArray'](_0x3eac3d['query']['ids'])){for(var _0x17bb3a=0x0;_0x17bb3a<_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0x5d')]['length'];_0x17bb3a+=0x1){var _0x495718={'UserId':Number(_0x3eac3d[_0xa57c('0x4e')]['id'])};_0x495718[_[_0xa57c('0x9c')](_0x3eac3d['query'][_0xa57c('0xa8')][_0xa57c('0x99')]())+_0xa57c('0x9d')]=Number(_0x3eac3d['query'][_0xa57c('0x5d')][_0x17bb3a]);socket[_0xa57c('0x9e')](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0x3eac3d[_0xa57c('0x3d')]['channel'][_0xa57c('0x99')]())+_0xa57c('0xab'),_0x495718);}}else{var _0x495718={'UserId':Number(_0x3eac3d[_0xa57c('0x4e')]['id'])};_0x495718[_['capitalize'](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')]['toLowerCase']())+_0xa57c('0x9d')]=Number(_0x3eac3d[_0xa57c('0x3d')]['ids']);socket['emit'](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0x3eac3d['query'][_0xa57c('0xa8')][_0xa57c('0x99')]())+_0xa57c('0xab'),_0x495718);}return _0xb201ad;})[_0xa57c('0x13')](function(){if(_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')]==='voice'){return db['UserVoiceQueueRt'][_0xa57c('0x34')]({'where':{'UserId':_0x3eac3d[_0xa57c('0x4e')]['id'],'VoiceQueueId':_0x3eac3d['query'][_0xa57c('0x5d')]},'individualHooks':!![]})[_0xa57c('0x13')](function(){return _0x521f69;});}return _0x521f69;})[_0xa57c('0x13')](respondWithStatusCode(_0x582d6b,null))[_0xa57c('0x4c')](handleError(_0x582d6b,null));};exports[_0xa57c('0xac')]=function(_0x3bcaf4,_0x336354){_0x3bcaf4[_0xa57c('0x5a')][_0xa57c('0xad')]=_0x3bcaf4['file'][_0xa57c('0xae')];return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3bcaf4[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x336354,null))[_0xa57c('0x13')](saveUpdates(_0x3bcaf4[_0xa57c('0x5a')],null))[_0xa57c('0x13')](respondWithResult(_0x336354,null))[_0xa57c('0x4c')](handleError(_0x336354,null));};exports['getAvatar']=function(_0x2f096,_0x26bee7){var _0x19e7ff=path[_0xa57c('0xaf')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x2f096[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0xad')],'raw':!![]})['then'](handleEntityNotFound(_0x26bee7,null))[_0xa57c('0x13')](function(_0x5ab876){if(_0x5ab876){if(_[_0xa57c('0x63')](_0x5ab876['userpic'])){return _0x26bee7[_0xa57c('0xb0')](_0x19e7ff);}else{if(!fs[_0xa57c('0xb1')](path['join'](config['root'],_0xa57c('0xb2'),_0x5ab876['userpic']))){return _0x26bee7[_0xa57c('0xb0')](_0x19e7ff);}return _0x26bee7[_0xa57c('0xb0')](path[_0xa57c('0xaf')](config[_0xa57c('0xb3')],'server/files/images/',_0x5ab876[_0xa57c('0xad')]));}}})['catch'](handleError(_0x26bee7,null));};exports[_0xa57c('0xb4')]=function(_0x1cb54d,_0x2c094f){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x1cb54d[_0xa57c('0x4e')]['id']},'attributes':['id']})[_0xa57c('0x13')](handleEntityNotFound(_0x2c094f,null))[_0xa57c('0x13')](function(_0x3c3292){var _0x145379=[];values=_0x3c3292[_0xa57c('0x46')];_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x44'),_0x3c3292['dataValues']));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x49'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x47'),_0x3c3292[_0xa57c('0x46')]));_0x145379['push'](get_open_tabs(_0xa57c('0x48'),_0x3c3292[_0xa57c('0x46')]));return BPromise[_0xa57c('0x4b')](_0x145379);})['then'](function(_0x5ceafb){var _0x2cda97=[];if(_0x5ceafb){for(var _0x297f25=0x0;_0x297f25=_0x4ae9bd['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x39795f){return db[_0x2ba4('0x54')][_0x2ba4('0x55')]({'where':{'membername':_0x39795f[_0x2ba4('0x2d')]},'individualHooks':!![]});}})[_0x2ba4('0xf')](function(){if(_0x39795f){return _0x39795f[_0x2ba4('0x56')]({'raw':!![]});}})[_0x2ba4('0xf')](function(_0x51fbd0){if(_0x39795f){if(_0x51fbd0){var _0x1225db=[];_0x81540a=_0x51fbd0;if(_0x81540a['length']){for(var _0x2427f9=0x0;_0x2427f9<_0x81540a['length'];_0x2427f9++){_0x1225db[_0x2ba4('0x34')](db[_0x2ba4('0x54')][_0x2ba4('0x57')]({'membername':_0x39795f[_0x2ba4('0x2d')],'UserId':_0x39795f['id'],'queue_name':_0x81540a[_0x2427f9][_0x2ba4('0x2d')],'VoiceQueueId':_0x81540a[_0x2427f9]['id'],'interface':_0x15c61e,'paused':_0x39795f[_0x2ba4('0x58')]||![],'penalty':_0x81540a[_0x2427f9]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x1225db);}}}})[_0x2ba4('0xf')](function(){if(_0x39795f){return db[_0x2ba4('0x3a')][_0x2ba4('0x1c')]({'where':{'membername':_0x39795f[_0x2ba4('0x2d')],'exitAt':null}});}})[_0x2ba4('0xf')](function(_0x56d63d){if(_0x39795f){if(_0x56d63d&&_0x56d63d[_0x2ba4('0x2f')]){var _0x1639b9=[];_0x56d63d['forEach'](function(_0x4e9379){_0x1639b9['push'](_0x4e9379[_0x2ba4('0x2c')]({'exitAt':moment()[_0x2ba4('0x30')](_0x2ba4('0x31'))}));});return BPromise[_0x2ba4('0x4b')](_0x1639b9);}}})[_0x2ba4('0xf')](function(_0x4089f1){if(_0x39795f){var _0x2b02b4=[];var _0x14fd42=[];var _0x365938=utils[_0x2ba4('0x33')]();var _0x49cdb5={'membername':_0x39795f['name'],'interface':_0x15c61e,'enterAt':moment()['format'](_0x2ba4('0x31')),'role':_0x39795f['role'],'internal':_0x39795f[_0x2ba4('0x2a')]};_0x365938[_0x2ba4('0x49')](function(_0x303aa3){_0x2b02b4[_0x2ba4('0x34')](_[_0x2ba4('0x59')]({'channel':_0x303aa3,'type':_0x2ba4('0x5a'),'data1':_0x2ba4('0x5b'),'data2':_0x15c61e},_0x49cdb5));if(_0x39795f[_0x2ba4('0x58')]){_0x14fd42[_0x2ba4('0x34')](_[_0x2ba4('0x59')]({'channel':_0x303aa3,'type':_0x2ba4('0x2e'),'data1':'LOGININPAUSE'},_0x49cdb5));}});return db['MemberReport'][_0x2ba4('0x3b')](_0x2b02b4[_0x2ba4('0x5c')](_0x14fd42),{'individualHooks':!![]});}})['then'](function(){if(_0x39795f){return _0x39795f[_0x2ba4('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x2ba4('0x31')),'voicePause':_0x39795f[_0x2ba4('0x58')]||![],'mailPause':_0x39795f['loginInPause']||![],'chatPause':_0x39795f['loginInPause']||![],'faxPause':_0x39795f['loginInPause']||![],'smsPause':_0x39795f[_0x2ba4('0x58')]||![],'openchannelPause':_0x39795f[_0x2ba4('0x58')]||![],'pauseType':_0x39795f[_0x2ba4('0x58')]?_0x2ba4('0x5d'):null,'lastPauseAt':moment()['format'](_0x2ba4('0x31')),'interface':_0x15c61e});}})[_0x2ba4('0xf')](function(_0x4b12e5){_0xb56773(_0x4b12e5);})['catch'](function(_0x311c2c){_0x4ed9a1(_0x4a5900[_0x2ba4('0x15')](0x1f4,_0x311c2c['message']));});});}; \ No newline at end of file +var _0xef3f=['body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','findOne','channel','Unknown\x20channel','system','mail','chat','sms','set','Pause','all','LogoutUser','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','upsert','loginInPause','UserVoiceQueue.penalty','role','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','limit','include','map','model','attributes','ShowUser','find','where','PauseUser','name','internal','interface','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s'];(function(_0x551d1d,_0x1ade6e){var _0x4720b4=function(_0x353e73){while(--_0x353e73){_0x551d1d['push'](_0x551d1d['shift']());}};_0x4720b4(++_0x1ade6e);}(_0xef3f,0x1e2));var _0xfef3=function(_0x5d6020,_0x2ab917){_0x5d6020=_0x5d6020-0x0;var _0x2f6685=_0xef3f[_0x5d6020];return _0x2f6685;};'use strict';var _=require(_0xfef3('0x0'));var util=require(_0xfef3('0x1'));var moment=require(_0xfef3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfef3('0x3'));var fs=require('fs');var Redis=require(_0xfef3('0x4'));var db=require(_0xfef3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfef3('0x6'))(_0xfef3('0x7'));var config=require('../../config/environment');var jayson=require(_0xfef3('0x8'));var client=jayson[_0xfef3('0x9')][_0xfef3('0xa')]({'port':0x232a});config[_0xfef3('0xb')]=_[_0xfef3('0xc')](config['redis'],{'host':_0xfef3('0xd'),'port':0x18eb});var socket=require(_0xfef3('0xe'))(new Redis(config[_0xfef3('0xb')]));require(_0xfef3('0xf'))[_0xfef3('0x10')](socket);function respondWithRpcPromise(_0x5b39eb,_0x39cd89,_0x471c63){return new BPromise(function(_0xfdd22d,_0x2bd1ab){return client[_0xfef3('0x11')](_0x5b39eb,_0x471c63)[_0xfef3('0x12')](function(_0x3186c1){logger[_0xfef3('0x13')](_0xfef3('0x14'),_0x39cd89,_0xfef3('0x15'));logger[_0xfef3('0x16')](_0xfef3('0x17'),_0x39cd89,_0xfef3('0x15'),JSON[_0xfef3('0x18')](_0x3186c1));if(_0x3186c1[_0xfef3('0x19')]){if(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1a')]===0x1f4){logger[_0xfef3('0x19')](_0xfef3('0x14'),_0x39cd89,_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);return _0x2bd1ab(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);}logger[_0xfef3('0x19')]('User,\x20%s,\x20%s',_0x39cd89,_0x3186c1[_0xfef3('0x19')]['message']);return _0xfdd22d(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);}else{logger['info']('User,\x20%s,\x20%s',_0x39cd89,_0xfef3('0x15'));_0xfdd22d(_0x3186c1[_0xfef3('0x1c')]['message']);}})[_0xfef3('0x1d')](function(_0x364050){logger[_0xfef3('0x19')](_0xfef3('0x14'),_0x39cd89,_0x364050);_0x2bd1ab(_0x364050);});});}exports[_0xfef3('0x1e')]=function(_0x47f655){var _0x191d47=this;return new Promise(function(_0x5badaf,_0x3e5060){return db[_0xfef3('0x1f')][_0xfef3('0x20')]({'raw':_0x47f655[_0xfef3('0x21')]?_0x47f655['options'][_0xfef3('0x22')]===undefined?!![]:![]:!![],'where':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')]['where']||null:null,'attributes':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')]['attributes']||null:null,'limit':_0x47f655[_0xfef3('0x21')]?_0x47f655['options'][_0xfef3('0x23')]||null:null,'include':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')][_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x47f655[_0xfef3('0x21')][_0xfef3('0x24')],function(_0x218968){return{'model':db[_0x218968[_0xfef3('0x26')]],'as':_0x218968['as'],'attributes':_0x218968['attributes'],'include':_0x218968[_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x218968[_0xfef3('0x24')],function(_0x1082e7){return{'model':db[_0x1082e7[_0xfef3('0x26')]],'as':_0x1082e7['as'],'attributes':_0x1082e7[_0xfef3('0x27')],'include':_0x1082e7['include']?_[_0xfef3('0x25')](_0x1082e7[_0xfef3('0x24')],function(_0x5069ae){return{'model':db[_0x5069ae[_0xfef3('0x26')]],'as':_0x5069ae['as'],'attributes':_0x5069ae[_0xfef3('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31e8c2){logger[_0xfef3('0x13')](_0xfef3('0x1e'),_0x47f655);logger[_0xfef3('0x16')](_0xfef3('0x1e'),_0x47f655,JSON[_0xfef3('0x18')](_0x31e8c2));_0x5badaf(_0x31e8c2);})[_0xfef3('0x1d')](function(_0x199e10){logger['error'](_0xfef3('0x1e'),_0x199e10[_0xfef3('0x1b')],_0x47f655);_0x3e5060(_0x191d47['error'](0x1f4,_0x199e10[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x28')]=function(_0x6bc96){var _0x37c22a=this;return new Promise(function(_0x15eb79,_0x15c7fb){return db[_0xfef3('0x1f')][_0xfef3('0x29')]({'raw':_0x6bc96['options']?_0x6bc96[_0xfef3('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x6bc96['options']?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x2a')]||null:null,'attributes':_0x6bc96[_0xfef3('0x21')]?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x27')]||null:null,'include':_0x6bc96[_0xfef3('0x21')]?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x6bc96['options'][_0xfef3('0x24')],function(_0x57c3a9){return{'model':db[_0x57c3a9['model']],'as':_0x57c3a9['as'],'attributes':_0x57c3a9[_0xfef3('0x27')],'include':_0x57c3a9[_0xfef3('0x24')]?_['map'](_0x57c3a9[_0xfef3('0x24')],function(_0x2fba7e){return{'model':db[_0x2fba7e[_0xfef3('0x26')]],'as':_0x2fba7e['as'],'attributes':_0x2fba7e[_0xfef3('0x27')],'include':_0x2fba7e['include']?_[_0xfef3('0x25')](_0x2fba7e['include'],function(_0xfd3789){return{'model':db[_0xfd3789['model']],'as':_0xfd3789['as'],'attributes':_0xfd3789[_0xfef3('0x27')]};}):[]};}):[]};}):[]:[]})[_0xfef3('0x12')](function(_0x4df3f0){logger[_0xfef3('0x13')]('ShowUser',_0x6bc96);logger[_0xfef3('0x16')]('ShowUser',_0x6bc96,JSON[_0xfef3('0x18')](_0x4df3f0));_0x15eb79(_0x4df3f0);})[_0xfef3('0x1d')](function(_0x3e1512){logger[_0xfef3('0x19')](_0xfef3('0x28'),_0x3e1512['message'],_0x6bc96);_0x15c7fb(_0x37c22a['error'](0x1f4,_0x3e1512[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x2b')]=function(_0x59c151){var _0x5d5e8d=this;return new Promise(function(_0x2f1463,_0x2dcfc8){var _0x1e194d;return db[_0xfef3('0x1f')]['find']({'where':_0x59c151[_0xfef3('0x21')]['where']||{},'attributes':['id',_0xfef3('0x2c'),'role',_0xfef3('0x2d'),_0xfef3('0x2e')]})[_0xfef3('0x12')](function(_0x5f0007){if(_0x5f0007){_0x1e194d=_0x5f0007;return db[_0xfef3('0x2f')]['update']({'paused':0x1},{'where':{'UserId':_0x1e194d['id']},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0x1e194d){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0x1e194d[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}});}})['then'](function(_0x1b126d){if(_0x1e194d){if(_0x1b126d&&_0x1b126d[_0xfef3('0x32')]){var _0x454be5=moment()[_0xfef3('0x33')](_0xfef3('0x34'));for(var _0x4a2cc2=0x0,_0x59e1c2=_0x1b126d[_0xfef3('0x32')];_0x4a2cc2<_0x59e1c2;_0x4a2cc2++){_0x1b126d[_0x4a2cc2][_0xfef3('0x35')]({'exitAt':_0x454be5});}}}})['then'](function(){if(_0x1e194d){var _0x5557fc=[];var _0x376f40=utils[_0xfef3('0x36')]();_0x376f40[_0xfef3('0x37')](function(_0x540a90){_0x5557fc[_0xfef3('0x38')]({'channel':_0x540a90,'membername':_0x1e194d[_0xfef3('0x2c')],'interface':_['isNil'](_0x1e194d['interface'])?util[_0xfef3('0x33')](_0xfef3('0x39'),_0x1e194d[_0xfef3('0x2c')]):_0x1e194d['interface'],'type':_0xfef3('0x31'),'enterAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'data1':_0x59c151[_0xfef3('0x3a')][_0xfef3('0x3b')]||_0xfef3('0x3c'),'role':_0x1e194d['role'],'internal':_0x1e194d['internal'],'uniqueid':_0x59c151['body'][_0xfef3('0x3d')]||null});});return db[_0xfef3('0x30')][_0xfef3('0x3e')](_0x5557fc,{'individualHooks':!![]});}})['then'](function(){if(_0x1e194d){return _0x1e194d[_0xfef3('0x3f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x59c151[_0xfef3('0x3a')][_0xfef3('0x3b')]||_0xfef3('0x3c'),'lastPauseAt':moment()[_0xfef3('0x33')](_0xfef3('0x34'))});}})['then'](function(_0x196179){_0x2f1463(_0x196179);})[_0xfef3('0x1d')](function(_0x6ca9eb){_0x2dcfc8(_0x5d5e8d[_0xfef3('0x19')](0x1f4,_0x6ca9eb[_0xfef3('0x1b')]));});});};exports['UnpauseUser']=function(_0x3a88d3){var _0x2bcfe7=this;return new Promise(function(_0xe57518,_0x2e0b83){var _0x3058cd;return db[_0xfef3('0x1f')][_0xfef3('0x40')]({'where':_0x3a88d3['options'][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c')]})[_0xfef3('0x12')](function(_0x4534af){if(_0x4534af){_0x3058cd=_0x4534af;if(_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')]&&!utils['isValidChannel'](_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')])){throw new Error(_0xfef3('0x42'));}switch(_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')]){case'voice':return db['UserVoiceQueueRt'][_0xfef3('0x3f')]({'paused':0x0},{'where':{'UserId':_0x3058cd['id']}})[_0xfef3('0x12')](function(){return db[_0xfef3('0x30')][_0xfef3('0x29')]({'where':{'channel':_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')],'membername':_0x3058cd[_0xfef3('0x2c')],'type':'PAUSE','exitAt':null}});})[_0xfef3('0x12')](function(_0x313045){if(_0x313045){return _0x313045['update']({'exitAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfef3('0x43')},{'individualHooks':!![]});}return null;})[_0xfef3('0x12')](function(){return _0x3058cd['update']({'voicePause':![]});});case _0xfef3('0x44'):case _0xfef3('0x45'):case'fax':case _0xfef3('0x46'):case'openchannel':case'whatsapp':return db[_0xfef3('0x30')]['find']({'where':{'channel':_0x3a88d3[_0xfef3('0x3a')]['channel'],'membername':_0x3058cd[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}})[_0xfef3('0x12')](function(_0x6fc42a){return _0x6fc42a[_0xfef3('0x3f')]({'exitAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'data2':_0xfef3('0x43')},{'individualHooks':!![]});})[_0xfef3('0x12')](function(){var _0x354b5d={};_[_0xfef3('0x47')](_0x354b5d,util[_0xfef3('0x33')]('%s%s',_0x3a88d3['body']['channel'],_0xfef3('0x48')),![]);return _0x3058cd[_0xfef3('0x3f')](_0x354b5d);});default:return db[_0xfef3('0x2f')][_0xfef3('0x3f')]({'paused':0x0},{'where':{'UserId':_0x3058cd['id']}})['then'](function(){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0x3058cd[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}});})[_0xfef3('0x12')](function(_0x27d0dd){var _0x25f11b=[];_0x27d0dd['forEach'](function(_0x1ba712){_0x25f11b[_0xfef3('0x38')](_0x1ba712[_0xfef3('0x3f')]({'exitAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfef3('0x43')}));});return BPromise[_0xfef3('0x49')](_0x25f11b);})['then'](function(){return _0x3058cd[_0xfef3('0x3f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xfef3('0x12')](function(_0x1cd8ca){_0xe57518(_0x1cd8ca);})[_0xfef3('0x1d')](function(_0x58f56e){_0x2e0b83(_0x2bcfe7['error'](0x1f4,_0x58f56e[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x4a')]=function(_0x2040e){var _0x30a732=this;return new Promise(function(_0xa6a59f,_0xf3c26a){var _0x273514;return db[_0xfef3('0x1f')]['findOne']({'where':_0x2040e[_0xfef3('0x21')][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c')]})[_0xfef3('0x12')](function(_0x3738b7){if(_0x3738b7){_0x273514=_0x3738b7;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x273514[_0xfef3('0x2c')]},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0x273514){return db[_0xfef3('0x30')]['findAll']({'where':{'membername':_0x273514[_0xfef3('0x2c')],'exitAt':null}});}})['then'](function(_0x3d5659){if(_0x273514){if(_0x3d5659&&_0x3d5659[_0xfef3('0x32')]){var _0x42e36b=[];_0x3d5659[_0xfef3('0x37')](function(_0x2a33cd){_0x42e36b[_0xfef3('0x38')](_0x2a33cd['update']({'exitAt':moment()[_0xfef3('0x33')](_0xfef3('0x34'))}));});return BPromise[_0xfef3('0x49')](_0x42e36b);}}})['then'](function(){if(_0x273514){return _0x273514[_0xfef3('0x3f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xfef3('0x12')](function(_0x369b53){_0xa6a59f(_0x369b53);})[_0xfef3('0x1d')](function(_0x9da0ed){_0xf3c26a(_0x30a732['error'](0x1f4,_0x9da0ed[_0xfef3('0x1b')]));});});};exports['LoginUser']=function(_0xbaca21){var _0x33985d=this;return new Promise(function(_0x5479df,_0x22a933){var _0xccc4e9;var _0x27a23f;var _0x3b6ea4;var _0x57fdf6;return db[_0xfef3('0x1f')]['findOne']({'where':_0xbaca21[_0xfef3('0x21')][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c'),'role','mobile','phone','internal','loginInPause','interface']})[_0xfef3('0x12')](function(_0x350d4c){if(_0x350d4c){_0xccc4e9=_0x350d4c;_0x57fdf6=_0xbaca21[_0xfef3('0x3a')]['interface']?_0xbaca21[_0xfef3('0x3a')][_0xfef3('0x2e')]:util[_0xfef3('0x33')]('SIP/%s',_0xccc4e9['name']);return db[_0xfef3('0x1f')][_0xfef3('0x4b')]({'where':{'role':_0xfef3('0x4c'),'online':!![],'id':{'$ne':_0xccc4e9['id']}}});}})['then'](function(_0x526bc6){if(_0x526bc6){_0x3b6ea4=_0x526bc6;return require(_0xfef3('0x4d'))['getLicense']();}})[_0xfef3('0x12')](function(_0x586d31){if(_0x586d31&&_0x586d31[_0xfef3('0x4e')]&&_0x3b6ea4>=_0x586d31[_0xfef3('0x4e')]){throw new Error(_0xfef3('0x4f'));}})[_0xfef3('0x12')](function(){if(_0xccc4e9){return db['UserVoiceQueueRt'][_0xfef3('0x50')]({'where':{'membername':_0xccc4e9['name']},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0xccc4e9){return _0xccc4e9['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x436e43){if(_0xccc4e9){if(_0x436e43){var _0x7c5bf4=[];_0x27a23f=_0x436e43;if(_0x27a23f[_0xfef3('0x32')]){for(var _0x20755f=0x0;_0x20755f<_0x27a23f['length'];_0x20755f++){_0x7c5bf4[_0xfef3('0x38')](db[_0xfef3('0x2f')][_0xfef3('0x51')]({'membername':_0xccc4e9[_0xfef3('0x2c')],'UserId':_0xccc4e9['id'],'queue_name':_0x27a23f[_0x20755f][_0xfef3('0x2c')],'VoiceQueueId':_0x27a23f[_0x20755f]['id'],'interface':_0x57fdf6,'paused':_0xccc4e9[_0xfef3('0x52')]||![],'penalty':_0x27a23f[_0x20755f][_0xfef3('0x53')]||0x0}));}return BPromise[_0xfef3('0x49')](_0x7c5bf4);}}}})['then'](function(){if(_0xccc4e9){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0xccc4e9[_0xfef3('0x2c')],'exitAt':null}});}})[_0xfef3('0x12')](function(_0x542be7){if(_0xccc4e9){if(_0x542be7&&_0x542be7[_0xfef3('0x32')]){var _0x3435f7=[];_0x542be7[_0xfef3('0x37')](function(_0x63b533){_0x3435f7[_0xfef3('0x38')](_0x63b533[_0xfef3('0x3f')]({'exitAt':moment()['format'](_0xfef3('0x34'))}));});return BPromise[_0xfef3('0x49')](_0x3435f7);}}})['then'](function(_0x484c15){if(_0xccc4e9){var _0x245318=[];var _0x473381=[];var _0x204f7e=utils[_0xfef3('0x36')]();var _0x2c7471={'membername':_0xccc4e9['name'],'interface':_0x57fdf6,'enterAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xccc4e9[_0xfef3('0x54')],'internal':_0xccc4e9[_0xfef3('0x2d')]};_0x204f7e[_0xfef3('0x37')](function(_0x2e9e41){_0x245318[_0xfef3('0x38')](_['merge']({'channel':_0x2e9e41,'type':_0xfef3('0x55'),'data1':_0xfef3('0x56'),'data2':_0x57fdf6},_0x2c7471));if(_0xccc4e9[_0xfef3('0x52')]){_0x473381['push'](_[_0xfef3('0x57')]({'channel':_0x2e9e41,'type':'PAUSE','data1':_0xfef3('0x58')},_0x2c7471));}});return db[_0xfef3('0x30')][_0xfef3('0x3e')](_0x245318[_0xfef3('0x59')](_0x473381),{'individualHooks':!![]});}})['then'](function(){if(_0xccc4e9){return _0xccc4e9[_0xfef3('0x3f')]({'online':!![],'lastLoginAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'voicePause':_0xccc4e9[_0xfef3('0x52')]||![],'mailPause':_0xccc4e9[_0xfef3('0x52')]||![],'chatPause':_0xccc4e9[_0xfef3('0x52')]||![],'faxPause':_0xccc4e9[_0xfef3('0x52')]||![],'smsPause':_0xccc4e9[_0xfef3('0x52')]||![],'openchannelPause':_0xccc4e9[_0xfef3('0x52')]||![],'pauseType':_0xccc4e9[_0xfef3('0x52')]?_0xfef3('0x58'):null,'lastPauseAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'interface':_0x57fdf6});}})[_0xfef3('0x12')](function(_0x3e5c05){_0x5479df(_0x3e5c05);})[_0xfef3('0x1d')](function(_0xb79a87){_0x22a933(_0x33985d[_0xfef3('0x19')](0x1f4,_0xb79a87[_0xfef3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index db90fa2..bcb6d7d 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 _0xa749=['save','remove','update','removeListener','register','./user.events'];(function(_0x5448ba,_0x1f67c7){var _0x2b14e5=function(_0x2a1bcc){while(--_0x2a1bcc){_0x5448ba['push'](_0x5448ba['shift']());}};_0x2b14e5(++_0x1f67c7);}(_0xa749,0xe3));var _0x9a74=function(_0x3e894d,_0x5300d5){_0x3e894d=_0x3e894d-0x0;var _0x12222a=_0xa749[_0x3e894d];return _0x12222a;};'use strict';var UserEvents=require(_0x9a74('0x0'));var events=[_0x9a74('0x1'),_0x9a74('0x2'),_0x9a74('0x3')];function createListener(_0x961400,_0x47c6b0){return function(_0x2136ea){_0x47c6b0['emit'](_0x961400,_0x2136ea);};}function removeListener(_0x44dd9c,_0x46f7a4){return function(){UserEvents[_0x9a74('0x4')](_0x44dd9c,_0x46f7a4);};}exports[_0x9a74('0x5')]=function(_0x34bb0b){for(var _0x529e32=0x0,_0x3cf44b=events['length'];_0x529e32<_0x3cf44b;_0x529e32++){var _0x270485=events[_0x529e32];var _0x1c21f5=createListener('user:'+_0x270485,_0x34bb0b);UserEvents['on'](_0x270485,_0x1c21f5);}}; \ No newline at end of file +var _0xac80=['./user.events','save','remove','emit','removeListener','register','length','user:'];(function(_0x2e75ad,_0x444919){var _0x286e1e=function(_0x3736c9){while(--_0x3736c9){_0x2e75ad['push'](_0x2e75ad['shift']());}};_0x286e1e(++_0x444919);}(_0xac80,0xb0));var _0x0ac8=function(_0x1dd4d2,_0x21d8cd){_0x1dd4d2=_0x1dd4d2-0x0;var _0x2e5cb2=_0xac80[_0x1dd4d2];return _0x2e5cb2;};'use strict';var UserEvents=require(_0x0ac8('0x0'));var events=[_0x0ac8('0x1'),_0x0ac8('0x2'),'update'];function createListener(_0x3e692a,_0x1d3876){return function(_0x1d53fb){_0x1d3876[_0x0ac8('0x3')](_0x3e692a,_0x1d53fb);};}function removeListener(_0x2466f5,_0x4f4316){return function(){UserEvents[_0x0ac8('0x4')](_0x2466f5,_0x4f4316);};}exports[_0x0ac8('0x5')]=function(_0x275157){for(var _0x4cfa82=0x0,_0x5e3c93=events[_0x0ac8('0x6')];_0x4cfa82<_0x5e3c93;_0x4cfa82++){var _0x47d513=events[_0x4cfa82];var _0x44af2f=createListener(_0x0ac8('0x7')+_0x47d513,_0x275157);UserEvents['on'](_0x47d513,_0x44af2f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b33b200..fd2ad0a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4748d0,_0x2c553d){var _0x5bcd9a=function(_0x5479b2){while(--_0x5479b2){_0x4748d0['push'](_0x4748d0['shift']());}};_0x5bcd9a(++_0x2c553d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0xcb91[_0xd816e2];return _0x1f5924;};'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(_0x2294c7,_0x42d02e){var _0x3eafde=function(_0x29899a){while(--_0x29899a){_0x2294c7['push'](_0x2294c7['shift']());}};_0x3eafde(++_0x42d02e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xcb91[_0x2bf466];return _0x856885;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index a6e77c9..41b6457 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 _0x6e43=['INTEGER','sequelize','exports'];(function(_0x447c78,_0x300603){var _0x302c2d=function(_0x1b279e){while(--_0x1b279e){_0x447c78['push'](_0x447c78['shift']());}};_0x302c2d(++_0x300603);}(_0x6e43,0x11b));var _0x36e4=function(_0x1570b5,_0x3375b7){_0x1570b5=_0x1570b5-0x0;var _0x508d10=_0x6e43[_0x1570b5];return _0x508d10;};'use strict';var Sequelize=require(_0x36e4('0x0'));module[_0x36e4('0x1')]={'penalty':{'type':Sequelize[_0x36e4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e61=['sequelize'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x3e61,0x1ef));var _0x13e6=function(_0xda574f,_0x33fae5){_0xda574f=_0xda574f-0x0;var _0x1a4318=_0x3e61[_0xda574f];return _0x1a4318;};'use strict';var Sequelize=require(_0x13e6('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0784842..5f1b234 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 _0x12c2=['UserChatQueue','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x257268,_0x2d5655){var _0x5a7a98=function(_0x8f3db4){while(--_0x8f3db4){_0x257268['push'](_0x257268['shift']());}};_0x5a7a98(++_0x2d5655);}(_0x12c2,0x177));var _0x212c=function(_0x1fc780,_0x44081c){_0x1fc780=_0x1fc780-0x0;var _0x4a1ebe=_0x12c2[_0x1fc780];return _0x4a1ebe;};'use strict';var _=require(_0x212c('0x0'));var util=require(_0x212c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x212c('0x2'));var rp=require(_0x212c('0x3'));var fs=require('fs');var path=require(_0x212c('0x4'));var rimraf=require(_0x212c('0x5'));var config=require(_0x212c('0x6'));var attributes=require(_0x212c('0x7'));module[_0x212c('0x8')]=function(_0xe1624d,_0xf9dbb9){return _0xe1624d[_0x212c('0x9')](_0x212c('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8f2=['../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x524ee5,_0x27b177){var _0x599b9c=function(_0x40551a){while(--_0x40551a){_0x524ee5['push'](_0x524ee5['shift']());}};_0x599b9c(++_0x27b177);}(_0xa8f2,0x102));var _0x2a8f=function(_0x546965,_0x10df53){_0x546965=_0x546965-0x0;var _0x388515=_0xa8f2[_0x546965];return _0x388515;};'use strict';var _=require(_0x2a8f('0x0'));var util=require(_0x2a8f('0x1'));var logger=require(_0x2a8f('0x2'))(_0x2a8f('0x3'));var moment=require(_0x2a8f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a8f('0x6'));var attributes=require(_0x2a8f('0x7'));module[_0x2a8f('0x8')]=function(_0x14f84f,_0x4a2435){return _0x14f84f[_0x2a8f('0x9')]('UserChatQueue',attributes,{'tableName':_0x2a8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index f9d6f54..820c1c6 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 _0x2cb9=['../../config/logger','rpc','jayson/promise','client','http','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2cb9,0xba));var _0x92cb=function(_0x33dcc8,_0x59bc94){_0x33dcc8=_0x33dcc8-0x0;var _0x16f7f5=_0x2cb9[_0x33dcc8];return _0x16f7f5;};'use strict';var _=require(_0x92cb('0x0'));var util=require(_0x92cb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92cb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x92cb('0x4'))(_0x92cb('0x5'));var config=require('../../config/environment');var jayson=require(_0x92cb('0x6'));var client=jayson[_0x92cb('0x7')][_0x92cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1be9c1,_0x438a28,_0xccf9b3){return new BPromise(function(_0x50d4c9,_0x2718d2){return client['request'](_0x1be9c1,_0xccf9b3)['then'](function(_0x28b651){logger['info'](_0x92cb('0x9'),_0x438a28,_0x92cb('0xa'));logger[_0x92cb('0xb')](_0x92cb('0xc'),_0x438a28,'request\x20sent',JSON[_0x92cb('0xd')](_0x28b651));if(_0x28b651[_0x92cb('0xe')]){if(_0x28b651[_0x92cb('0xe')][_0x92cb('0xf')]===0x1f4){logger[_0x92cb('0xe')](_0x92cb('0x9'),_0x438a28,_0x28b651[_0x92cb('0xe')][_0x92cb('0x10')]);return _0x2718d2(_0x28b651[_0x92cb('0xe')][_0x92cb('0x10')]);}logger[_0x92cb('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x438a28,_0x28b651[_0x92cb('0xe')][_0x92cb('0x10')]);return _0x50d4c9(_0x28b651[_0x92cb('0xe')][_0x92cb('0x10')]);}else{logger['info'](_0x92cb('0x9'),_0x438a28,_0x92cb('0xa'));_0x50d4c9(_0x28b651[_0x92cb('0x11')][_0x92cb('0x10')]);}})[_0x92cb('0x12')](function(_0x19b52e){logger['error'](_0x92cb('0x9'),_0x438a28,_0x19b52e);_0x2718d2(_0x19b52e);});});} \ No newline at end of file +var _0x8115=['UserChatQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8115,0xf6));var _0x5811=function(_0x17b4c0,_0xa80ae){_0x17b4c0=_0x17b4c0-0x0;var _0x49efb9=_0x8115[_0x17b4c0];return _0x49efb9;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require(_0x5811('0x2'));var BPromise=require(_0x5811('0x3'));var rs=require(_0x5811('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x5'))['db'];var utils=require(_0x5811('0x6'));var logger=require(_0x5811('0x7'))(_0x5811('0x8'));var config=require(_0x5811('0x9'));var jayson=require(_0x5811('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3af853,_0x1af6d9,_0x567434){return new BPromise(function(_0x3b6da1,_0x216d1b){return client[_0x5811('0xb')](_0x3af853,_0x567434)[_0x5811('0xc')](function(_0x9b60db){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1af6d9,_0x5811('0xd'));logger[_0x5811('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1af6d9,_0x5811('0xd'),JSON[_0x5811('0xf')](_0x9b60db));if(_0x9b60db[_0x5811('0x10')]){if(_0x9b60db[_0x5811('0x10')][_0x5811('0x11')]===0x1f4){logger[_0x5811('0x10')](_0x5811('0x12'),_0x1af6d9,_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);return _0x216d1b(_0x9b60db['error'][_0x5811('0x13')]);}logger['error'](_0x5811('0x12'),_0x1af6d9,_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);return _0x3b6da1(_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);}else{logger[_0x5811('0x14')](_0x5811('0x12'),_0x1af6d9,'request\x20sent');_0x3b6da1(_0x9b60db[_0x5811('0x15')]['message']);}})['catch'](function(_0x181478){logger[_0x5811('0x10')](_0x5811('0x12'),_0x1af6d9,_0x181478);_0x216d1b(_0x181478);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index df39107..6622289 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x59f4a7,_0x1e7bab){var _0x436030=function(_0x17fe3a){while(--_0x17fe3a){_0x59f4a7['push'](_0x59f4a7['shift']());}};_0x436030(++_0x1e7bab);}(_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(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e4eba0e..577c0b4 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 _0x87bb=['sequelize','INTEGER','STRING'];(function(_0x35de8a,_0x7acd4b){var _0x9c759d=function(_0x1fc3d3){while(--_0x1fc3d3){_0x35de8a['push'](_0x35de8a['shift']());}};_0x9c759d(++_0x7acd4b);}(_0x87bb,0x1d1));var _0xb87b=function(_0x594229,_0x260b88){_0x594229=_0x594229-0x0;var _0x20544f=_0x87bb[_0x594229];return _0x20544f;};'use strict';var Sequelize=require(_0xb87b('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb87b('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb87b('0x2')]}}; \ No newline at end of file +var _0xf084=['STRING','exports','INTEGER'];(function(_0x15ab85,_0x3e15df){var _0x39c07a=function(_0x2a599b){while(--_0x2a599b){_0x15ab85['push'](_0x15ab85['shift']());}};_0x39c07a(++_0x3e15df);}(_0xf084,0xe2));var _0x4f08=function(_0x291262,_0x366104){_0x291262=_0x291262-0x0;var _0x9a5178=_0xf084[_0x291262];return _0x9a5178;};'use strict';var Sequelize=require('sequelize');module[_0x4f08('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4f08('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4f08('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a707ff7..e495f82 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 _0xfd4b=['moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util','../../config/logger'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0xfd4b,0xce));var _0xbfd4=function(_0x2154a4,_0x594a01){_0x2154a4=_0x2154a4-0x0;var _0x1220cc=_0xfd4b[_0x2154a4];return _0x1220cc;};'use strict';var _=require(_0xbfd4('0x0'));var util=require(_0xbfd4('0x1'));var logger=require(_0xbfd4('0x2'))('api');var moment=require(_0xbfd4('0x3'));var BPromise=require(_0xbfd4('0x4'));var rp=require(_0xbfd4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfd4('0x6'));var config=require(_0xbfd4('0x7'));var attributes=require(_0xbfd4('0x8'));module['exports']=function(_0x11eb0b,_0x56022e){return _0x11eb0b[_0xbfd4('0x9')](_0xbfd4('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2115=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','lodash'];(function(_0x428b2c,_0x5616a9){var _0x209877=function(_0x12ea82){while(--_0x12ea82){_0x428b2c['push'](_0x428b2c['shift']());}};_0x209877(++_0x5616a9);}(_0x2115,0x19f));var _0x5211=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x2115[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0x5211('0x0'));var util=require(_0x5211('0x1'));var logger=require(_0x5211('0x2'))(_0x5211('0x3'));var moment=require(_0x5211('0x4'));var BPromise=require(_0x5211('0x5'));var rp=require(_0x5211('0x6'));var fs=require('fs');var path=require(_0x5211('0x7'));var rimraf=require(_0x5211('0x8'));var config=require(_0x5211('0x9'));var attributes=require(_0x5211('0xa'));module[_0x5211('0xb')]=function(_0x2f8123,_0x295083){return _0x2f8123[_0x5211('0xc')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 1729aa0..c0686bf 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 _0x798e=['UserFaxQueue,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x307b5d,_0x244bd8){var _0x4d7dd8=function(_0x438cce){while(--_0x438cce){_0x307b5d['push'](_0x307b5d['shift']());}};_0x4d7dd8(++_0x244bd8);}(_0x798e,0x96));var _0xe798=function(_0x5b7c7d,_0x21f02d){_0x5b7c7d=_0x5b7c7d-0x0;var _0x126039=_0x798e[_0x5b7c7d];return _0x126039;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe798('0x0'));var BPromise=require(_0xe798('0x1'));var rs=require(_0xe798('0x2'));var fs=require('fs');var Redis=require(_0xe798('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe798('0x4'));var logger=require(_0xe798('0x5'))(_0xe798('0x6'));var config=require('../../config/environment');var jayson=require(_0xe798('0x7'));var client=jayson[_0xe798('0x8')][_0xe798('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3509a0,_0x17949d,_0x54cb99){return new BPromise(function(_0x378acc,_0x4a3fac){return client['request'](_0x3509a0,_0x54cb99)[_0xe798('0xa')](function(_0xcbbade){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x17949d,_0xe798('0xb'));logger[_0xe798('0xc')](_0xe798('0xd'),_0x17949d,_0xe798('0xb'),JSON['stringify'](_0xcbbade));if(_0xcbbade[_0xe798('0xe')]){if(_0xcbbade['error'][_0xe798('0xf')]===0x1f4){logger[_0xe798('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x17949d,_0xcbbade[_0xe798('0xe')][_0xe798('0x10')]);return _0x4a3fac(_0xcbbade[_0xe798('0xe')][_0xe798('0x10')]);}logger[_0xe798('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x17949d,_0xcbbade['error'][_0xe798('0x10')]);return _0x378acc(_0xcbbade['error'][_0xe798('0x10')]);}else{logger[_0xe798('0x11')](_0xe798('0x12'),_0x17949d,_0xe798('0xb'));_0x378acc(_0xcbbade[_0xe798('0x13')][_0xe798('0x10')]);}})[_0xe798('0x14')](function(_0x68e2f0){logger[_0xe798('0xe')](_0xe798('0x12'),_0x17949d,_0x68e2f0);_0x4a3fac(_0x68e2f0);});});} \ No newline at end of file +var _0xf382=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xb23ad5,_0x389a3c){var _0x3a9ce2=function(_0x4da668){while(--_0x4da668){_0xb23ad5['push'](_0xb23ad5['shift']());}};_0x3a9ce2(++_0x389a3c);}(_0xf382,0x16d));var _0x2f38=function(_0x252b17,_0x1fbd1d){_0x252b17=_0x252b17-0x0;var _0x4f5a2c=_0xf382[_0x252b17];return _0x4f5a2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f38('0x0'));var BPromise=require(_0x2f38('0x1'));var rs=require(_0x2f38('0x2'));var fs=require('fs');var Redis=require(_0x2f38('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f38('0x4'));var logger=require('../../config/logger')(_0x2f38('0x5'));var config=require(_0x2f38('0x6'));var jayson=require(_0x2f38('0x7'));var client=jayson[_0x2f38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320317,_0x28dc08,_0x1d9c14){return new BPromise(function(_0x52b9a5,_0x1d3f7b){return client[_0x2f38('0x9')](_0x320317,_0x1d9c14)[_0x2f38('0xa')](function(_0xb49e2a){logger[_0x2f38('0xb')](_0x2f38('0xc'),_0x28dc08,_0x2f38('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x28dc08,_0x2f38('0xd'),JSON[_0x2f38('0xe')](_0xb49e2a));if(_0xb49e2a['error']){if(_0xb49e2a['error']['code']===0x1f4){logger[_0x2f38('0xf')](_0x2f38('0xc'),_0x28dc08,_0xb49e2a[_0x2f38('0xf')][_0x2f38('0x10')]);return _0x1d3f7b(_0xb49e2a['error'][_0x2f38('0x10')]);}logger['error'](_0x2f38('0xc'),_0x28dc08,_0xb49e2a[_0x2f38('0xf')]['message']);return _0x52b9a5(_0xb49e2a[_0x2f38('0xf')][_0x2f38('0x10')]);}else{logger[_0x2f38('0xb')](_0x2f38('0xc'),_0x28dc08,'request\x20sent');_0x52b9a5(_0xb49e2a['result'][_0x2f38('0x10')]);}})['catch'](function(_0x15f209){logger[_0x2f38('0xf')](_0x2f38('0xc'),_0x28dc08,_0x15f209);_0x1d3f7b(_0x15f209);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8a890f8..78a81a5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x388169,_0x9996b1){var _0x7591c0=function(_0x27b4b0){while(--_0x27b4b0){_0x388169['push'](_0x388169['shift']());}};_0x7591c0(++_0x9996b1);}(_0xe706,0xa3));var _0x6e70=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0xe706[_0x5d225a];return _0x1e7761;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x7ec97e,_0x3886a6){var _0x14c832=function(_0x38ba2e){while(--_0x38ba2e){_0x7ec97e['push'](_0x7ec97e['shift']());}};_0x14c832(++_0x3886a6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index abe4620..582abcb 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 _0xc8e8=['exports','INTEGER','sequelize'];(function(_0x321db5,_0x3d0a9c){var _0xdf9073=function(_0x5f2707){while(--_0x5f2707){_0x321db5['push'](_0x321db5['shift']());}};_0xdf9073(++_0x3d0a9c);}(_0xc8e8,0x173));var _0x8c8e=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0xc8e8[_0x3aaf0a];return _0x33e6bc;};'use strict';var Sequelize=require(_0x8c8e('0x0'));module[_0x8c8e('0x1')]={'penalty':{'type':Sequelize[_0x8c8e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd5d6=['INTEGER','sequelize'];(function(_0x4109ff,_0x44ab31){var _0x58f82d=function(_0x494b21){while(--_0x494b21){_0x4109ff['push'](_0x4109ff['shift']());}};_0x58f82d(++_0x44ab31);}(_0xd5d6,0xcb));var _0x6d5d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xd5d6[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x6d5d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6d5d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 216ba4f..50e76a0 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 _0x2a2d=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash'];(function(_0x17c8ee,_0x1c0f50){var _0x3b731c=function(_0xe10470){while(--_0xe10470){_0x17c8ee['push'](_0x17c8ee['shift']());}};_0x3b731c(++_0x1c0f50);}(_0x2a2d,0x196));var _0xd2a2=function(_0x583bf0,_0x4b59aa){_0x583bf0=_0x583bf0-0x0;var _0x210ec6=_0x2a2d[_0x583bf0];return _0x210ec6;};'use strict';var _=require(_0xd2a2('0x0'));var util=require(_0xd2a2('0x1'));var logger=require(_0xd2a2('0x2'))(_0xd2a2('0x3'));var moment=require('moment');var BPromise=require(_0xd2a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd2a2('0x5'));var config=require(_0xd2a2('0x6'));var attributes=require(_0xd2a2('0x7'));module[_0xd2a2('0x8')]=function(_0x369889,_0x2da6f7){return _0x369889[_0xd2a2('0x9')](_0xd2a2('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f2=['user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xff95db,_0x3908a9){var _0x19f1c4=function(_0x4d870d){while(--_0x4d870d){_0xff95db['push'](_0xff95db['shift']());}};_0x19f1c4(++_0x3908a9);}(_0x51f2,0xe2));var _0x251f=function(_0xa014e,_0x3d3129){_0xa014e=_0xa014e-0x0;var _0x2ce37d=_0x51f2[_0xa014e];return _0x2ce37d;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))('api');var moment=require(_0x251f('0x3'));var BPromise=require(_0x251f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x251f('0x5'));var rimraf=require(_0x251f('0x6'));var config=require(_0x251f('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x4c2561,_0x47076c){return _0x4c2561['define']('UserMailQueue',attributes,{'tableName':_0x251f('0x8'),'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 0e5325a..f6eaea3 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1cb9,0x14e));var _0x91cb=function(_0x44dbab,_0xcfc15c){_0x44dbab=_0x44dbab-0x0;var _0x43aa58=_0x1cb9[_0x44dbab];return _0x43aa58;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x008c,0x188));var _0xc008=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0x008c[_0xf458be];return _0x52b318;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 4f5a3fb..c6b3152 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 _0x9254=['fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','Router'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x9254,0x1dc));var _0x4925=function(_0x17cabc,_0x2cd911){_0x17cabc=_0x17cabc-0x0;var _0x3cf4fd=_0x9254[_0x17cabc];return _0x3cf4fd;};'use strict';var multer=require('multer');var util=require(_0x4925('0x0'));var path=require(_0x4925('0x1'));var timeout=require(_0x4925('0x2'));var express=require('express');var router=express[_0x4925('0x3')]();var fs_extra=require(_0x4925('0x4'));var auth=require(_0x4925('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4925('0x6'));var controller=require(_0x4925('0x7'));router[_0x4925('0x8')]('/',auth[_0x4925('0x9')](),controller[_0x4925('0xa')]);module[_0x4925('0xb')]=router; \ No newline at end of file +var _0x8f23=['connect-timeout','../../config/environment','isAuthenticated','exports','multer','util','path'];(function(_0x37af4b,_0x29b939){var _0x201f57=function(_0x361417){while(--_0x361417){_0x37af4b['push'](_0x37af4b['shift']());}};_0x201f57(++_0x29b939);}(_0x8f23,0x170));var _0x38f2=function(_0x3c5914,_0x3ecd81){_0x3c5914=_0x3c5914-0x0;var _0x48ffae=_0x8f23[_0x3c5914];return _0x48ffae;};'use strict';var multer=require(_0x38f2('0x0'));var util=require(_0x38f2('0x1'));var path=require(_0x38f2('0x2'));var timeout=require(_0x38f2('0x3'));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(_0x38f2('0x4'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x38f2('0x5')](),controller['sendUserNotification']);module[_0x38f2('0x6')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index dcf9a42..367abae 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 _0x9bea=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x9bea,0x14a));var _0xa9be=function(_0x5ae351,_0x4bbc3c){_0x5ae351=_0x5ae351-0x0;var _0x5225f3=_0x9bea[_0x5ae351];return _0x5225f3;};'use strict';var Sequelize=require(_0xa9be('0x0'));module[_0xa9be('0x1')]={'body':{'type':Sequelize[_0xa9be('0x2')]},'senderName':{'type':Sequelize[_0xa9be('0x3')]},'recipientsId':{'type':Sequelize[_0xa9be('0x2')]},'recipientsDescription':{'type':Sequelize[_0xa9be('0x3')]},'beep':{'type':Sequelize[_0xa9be('0x4')]}}; \ No newline at end of file +var _0xd7ed=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x4987fc,_0x3532df){var _0x34fc6e=function(_0x48932e){while(--_0x48932e){_0x4987fc['push'](_0x4987fc['shift']());}};_0x34fc6e(++_0x3532df);}(_0xd7ed,0x1d1));var _0xdd7e=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xd7ed[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0xdd7e('0x0'));module[_0xdd7e('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xdd7e('0x2')]},'recipientsId':{'type':Sequelize[_0xdd7e('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xdd7e('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a2b2b72..7d5c5f7 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 _0xd7ac=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','ids','queue','replace','push','all','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end'];(function(_0x12b151,_0x5e1ede){var _0x84b013=function(_0x4f2e92){while(--_0x4f2e92){_0x12b151['push'](_0x12b151['shift']());}};_0x84b013(++_0x5e1ede);}(_0xd7ac,0xa1));var _0xcd7a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd7ac[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xcd7a('0x0'));var rimraf=require(_0xcd7a('0x1'));var zipdir=require(_0xcd7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd7a('0x3'));var moment=require(_0xcd7a('0x4'));var BPromise=require(_0xcd7a('0x5'));var Mustache=require(_0xcd7a('0x6'));var util=require(_0xcd7a('0x7'));var path=require('path');var sox=require(_0xcd7a('0x8'));var csv=require(_0xcd7a('0x9'));var ejs=require(_0xcd7a('0xa'));var fs=require('fs');var fs_extra=require(_0xcd7a('0xb'));var _=require(_0xcd7a('0xc'));var squel=require(_0xcd7a('0xd'));var crypto=require(_0xcd7a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcd7a('0xf'));var toCsv=require(_0xcd7a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd7a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd7a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd7a('0x12'))(_0xcd7a('0x13'));var utils=require(_0xcd7a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd7a('0x15'));var db=require(_0xcd7a('0x16'))['db'];config[_0xcd7a('0x17')]=_[_0xcd7a('0x18')](config['redis'],{'host':_0xcd7a('0x19'),'port':0x18eb});var socket=require(_0xcd7a('0x1a'))(new Redis(config[_0xcd7a('0x17')]));require(_0xcd7a('0x1b'))[_0xcd7a('0x1c')](socket);function respondWithStatusCode(_0x49b5e9,_0x519785){_0x519785=_0x519785||0xcc;return function(_0x2f3c91){if(_0x2f3c91){return _0x49b5e9[_0xcd7a('0x1d')](_0x519785);}return _0x49b5e9['status'](_0x519785)[_0xcd7a('0x1e')]();};}function respondWithResult(_0x38554d,_0x195760){_0x195760=_0x195760||0xc8;return function(_0x574418){if(_0x574418){return _0x38554d[_0xcd7a('0x1f')](_0x195760)[_0xcd7a('0x20')](_0x574418);}};}function respondWithFilteredResult(_0x57cdef,_0x25ce5d){return function(_0x2b498d){if(_0x2b498d){var _0x38aaec=typeof _0x25ce5d[_0xcd7a('0x21')]===_0xcd7a('0x22')&&typeof _0x25ce5d[_0xcd7a('0x23')]==='undefined';var _0x427b39=_0x2b498d[_0xcd7a('0x24')];var _0x298718=_0x38aaec?0x0:_0x25ce5d['offset'];var _0x3391d3=_0x38aaec?_0x2b498d['count']:_0x25ce5d[_0xcd7a('0x21')]+_0x25ce5d[_0xcd7a('0x23')];var _0xfa280f;if(_0x3391d3>=_0x427b39){_0x3391d3=_0x427b39;_0xfa280f=0xc8;}else{_0xfa280f=0xce;}_0x57cdef[_0xcd7a('0x1f')](_0xfa280f);return _0x57cdef[_0xcd7a('0x25')](_0xcd7a('0x26'),_0x298718+'-'+_0x3391d3+'/'+_0x427b39)[_0xcd7a('0x20')](_0x2b498d);}return null;};}function patchUpdates(_0x1381f2){return function(_0x309af5){try{jsonpatch[_0xcd7a('0x27')](_0x309af5,_0x1381f2,!![]);}catch(_0x810c86){return BPromise['reject'](_0x810c86);}return _0x309af5[_0xcd7a('0x28')]();};}function saveUpdates(_0x578288,_0x5e39fd){return function(_0x3fbe87){if(_0x3fbe87){return _0x3fbe87['update'](_0x578288)[_0xcd7a('0x29')](function(_0x29d349){return _0x29d349;});}return null;};}function removeEntity(_0x20b63e,_0x1e4e41){return function(_0x39f84c){if(_0x39f84c){return _0x39f84c[_0xcd7a('0x2a')]()[_0xcd7a('0x29')](function(){_0x20b63e[_0xcd7a('0x1f')](0xcc)[_0xcd7a('0x1e')]();});}};}function handleEntityNotFound(_0x5c10fd,_0xd6236c){return function(_0x5458b6){if(!_0x5458b6){_0x5c10fd['sendStatus'](0x194);}return _0x5458b6;};}function handleError(_0x352d39,_0x3e9d64){_0x3e9d64=_0x3e9d64||0x1f4;return function(_0x40af05){logger[_0xcd7a('0x2b')](_0x40af05[_0xcd7a('0x2c')]);if(_0x40af05[_0xcd7a('0x2d')]){delete _0x40af05[_0xcd7a('0x2d')];}_0x352d39['status'](_0x3e9d64)[_0xcd7a('0x2e')](_0x40af05);};}exports['sendUserNotification']=function(_0x14e3d6,_0x2bf5ba,_0x1ba6b4){if(!_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x30')](_0xcd7a('0x31'))&&!_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x30')](_0xcd7a('0x32'))){throw new db['Sequelize'][(_0xcd7a('0x33'))](_0xcd7a('0x34'));}else{if(_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x30')](_0xcd7a('0x32'))&&!_0x14e3d6['body'][_0xcd7a('0x30')](_0xcd7a('0x35'))){throw new db[(_0xcd7a('0x36'))][(_0xcd7a('0x33'))](_0xcd7a('0x37'));}if(!_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x30')](_0xcd7a('0x38'))){throw new db[(_0xcd7a('0x36'))][(_0xcd7a('0x33'))](_0xcd7a('0x39'));}else{try{var _0x571321=JSON['parse'](_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x38')]);}catch(_0x3bd20c){logger[_0xcd7a('0x2b')](_0x3bd20c);throw new db[(_0xcd7a('0x36'))][(_0xcd7a('0x33'))](_0xcd7a('0x3a'));}var _0x5c069e=[_0xcd7a('0x3b'),_0xcd7a('0x3c'),_0xcd7a('0x3d'),_0xcd7a('0x3e'),_0xcd7a('0x3f'),'voicequeue','whatsappqueue',_0xcd7a('0x40'),_0xcd7a('0x41')];if(_['some'](_0x571321,function(_0x2c803a){return!_[_0xcd7a('0x42')](_0x5c069e,_0x2c803a[_0xcd7a('0x43')]['toLowerCase']());})){throw new db[(_0xcd7a('0x36'))]['ValidationError'](_0xcd7a('0x44'));}}}var _0x3300a5={};_0x3300a5['senderName']=_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x30')]('senderName')?_0x14e3d6['body'][_0xcd7a('0x45')]:_0x14e3d6['user']['fullname'];_0x3300a5[_0xcd7a('0x46')]=_['isEmpty'](_0x14e3d6[_0xcd7a('0x2f')][_0xcd7a('0x46')])?null:_0x14e3d6[_0xcd7a('0x2f')]['recipientsDescription'];_0x3300a5[_0xcd7a('0x47')]=_0x14e3d6['body'][_0xcd7a('0x47')]||![];_0x3300a5['SenderId']=_0x14e3d6['user']['id'];return getContent(_0x14e3d6[_0xcd7a('0x2f')])['then'](function(_0x3a3242){_0x3300a5[_0xcd7a('0x2f')]=_0x3a3242;return getRecipients(_0x571321);})['then'](function(_0x2a1723){_0x3300a5['recipientsId']=_[_0xcd7a('0x48')](_0x2a1723)[_0xcd7a('0x49')](',');return db[_0xcd7a('0x4a')][_0xcd7a('0x4b')](function(_0x546984){return db[_0xcd7a('0x4c')][_0xcd7a('0x4d')](_0x3300a5,{'raw':!![],'transaction':_0x546984})['then'](function(_0x2e7afc){var _0x8a2aea={'sender':_0x3300a5[_0xcd7a('0x45')],'description':_0x3300a5[_0xcd7a('0x46')],'content':_0x3300a5[_0xcd7a('0x2f')],'beep':_0x3300a5['beep']};_0x2a1723[_0xcd7a('0x4e')](function(_0x5824c4){_0x8a2aea[_0xcd7a('0x4f')]=_0x5824c4;socket[_0xcd7a('0x50')](_0xcd7a('0x51'),_0x8a2aea);});return _0x2e7afc;});});})[_0xcd7a('0x29')](respondWithResult(_0x2bf5ba,0xc9))[_0xcd7a('0x52')](handleError(_0x2bf5ba,null));};function getContent(_0x42eb2d){return new BPromise(function(_0x4c6f09,_0x3f4bd5){if(_0x42eb2d[_0xcd7a('0x31')]){_0x4c6f09(_0x42eb2d['text']);return;}return db['Template'][_0xcd7a('0x53')]({'attributes':[_0xcd7a('0x54')],'where':{'id':_0x42eb2d[_0xcd7a('0x32')]},'raw':!![]})[_0xcd7a('0x29')](function(_0x101cd3){if(!_0x101cd3)throw new db['Sequelize'][(_0xcd7a('0x33'))](_0xcd7a('0x55'));var _0x3809b2=Mustache[_0xcd7a('0x56')](_0x101cd3['html'],_0x42eb2d['view']);_0x4c6f09(_0x3809b2);})['catch'](function(_0x2012ac){_0x3f4bd5(_0x2012ac);});});}function getRecipients(_0x125f49){return new BPromise(function(_0x571aef,_0xf46324){var _0x262aaf=[];var _0x2ec062=[];_0x125f49['forEach'](function(_0x1c42e0){var _0x149195=_[_0xcd7a('0x57')](_0x1c42e0['model'][_0xcd7a('0x58')]());if(_0x149195===_0xcd7a('0x59')){_0x262aaf=_['union'](_0x262aaf,_0x1c42e0[_0xcd7a('0x5a')]);}else{if(_[_0xcd7a('0x42')](_0x149195,_0xcd7a('0x5b')))_0x149195=_0x149195[_0xcd7a('0x5c')](_0xcd7a('0x5b'),'Queue');_0x1c42e0['ids'][_0xcd7a('0x4e')](function(_0x5cc959){_0x2ec062[_0xcd7a('0x5d')](getAgents(_0x149195,_0x5cc959));});}});return BPromise[_0xcd7a('0x5e')](_0x2ec062)[_0xcd7a('0x29')](function(_0x3d9d14){_0x262aaf=_['union'](_0x262aaf,_['flatten'](_0x3d9d14));_0x571aef(_0x262aaf);})['catch'](function(_0x11e663){_0xf46324(_0x11e663);});});}function getAgents(_0x4e47c2,_0x3fdbd6){return new BPromise(function(_0x105f3e,_0x10f007){return db[_0x4e47c2][_0xcd7a('0x53')]({'where':{'id':_0x3fdbd6}})[_0xcd7a('0x29')](function(_0x3f97d0){return _0x3f97d0[_0xcd7a('0x5f')]({'attributes':['id'],'raw':!![]})[_0xcd7a('0x29')](function(_0x57b592){var _0x12bb9e=_['map'](_0x57b592,'id');_0x105f3e(_0x12bb9e);});})[_0xcd7a('0x52')](function(_0x593640){_0x10f007(_0x593640);});});} \ No newline at end of file +var _0xe836=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','join','transaction','UserNotification','forEach','recipient','userNotification:send','catch','text','Template','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model','union','ids','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xe836,0x16b));var _0x6e83=function(_0x25ee10,_0x4ac659){_0x25ee10=_0x25ee10-0x0;var _0x4f96be=_0xe836[_0x25ee10];return _0x4f96be;};'use strict';var emlformat=require(_0x6e83('0x0'));var rimraf=require(_0x6e83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6e83('0x2'));var moment=require(_0x6e83('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e83('0x4'));var util=require('util');var path=require(_0x6e83('0x5'));var sox=require(_0x6e83('0x6'));var csv=require(_0x6e83('0x7'));var ejs=require(_0x6e83('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e83('0x9'));var crypto=require(_0x6e83('0xa'));var jsforce=require(_0x6e83('0xb'));var deskjs=require(_0x6e83('0xc'));var toCsv=require(_0x6e83('0x7'));var querystring=require(_0x6e83('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e83('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6e83('0xf'));var hardwareService=require(_0x6e83('0x10'));var logger=require(_0x6e83('0x11'))(_0x6e83('0x12'));var utils=require('../../config/utils');var config=require(_0x6e83('0x13'));var licenseUtil=require(_0x6e83('0x14'));var db=require(_0x6e83('0x15'))['db'];config[_0x6e83('0x16')]=_[_0x6e83('0x17')](config[_0x6e83('0x16')],{'host':_0x6e83('0x18'),'port':0x18eb});var socket=require(_0x6e83('0x19'))(new Redis(config['redis']));require(_0x6e83('0x1a'))[_0x6e83('0x1b')](socket);function respondWithStatusCode(_0x53d7d8,_0x66e51d){_0x66e51d=_0x66e51d||0xcc;return function(_0x42c52e){if(_0x42c52e){return _0x53d7d8[_0x6e83('0x1c')](_0x66e51d);}return _0x53d7d8[_0x6e83('0x1d')](_0x66e51d)[_0x6e83('0x1e')]();};}function respondWithResult(_0x18b95a,_0x54ce6c){_0x54ce6c=_0x54ce6c||0xc8;return function(_0x871253){if(_0x871253){return _0x18b95a[_0x6e83('0x1d')](_0x54ce6c)[_0x6e83('0x1f')](_0x871253);}};}function respondWithFilteredResult(_0x1e8ca9,_0x39e3f2){return function(_0xa2e7d9){if(_0xa2e7d9){var _0x5b64d1=typeof _0x39e3f2['offset']===_0x6e83('0x20')&&typeof _0x39e3f2[_0x6e83('0x21')]==='undefined';var _0x188319=_0xa2e7d9[_0x6e83('0x22')];var _0x49145e=_0x5b64d1?0x0:_0x39e3f2[_0x6e83('0x23')];var _0x1dd5bf=_0x5b64d1?_0xa2e7d9[_0x6e83('0x22')]:_0x39e3f2[_0x6e83('0x23')]+_0x39e3f2[_0x6e83('0x21')];var _0x10d4d7;if(_0x1dd5bf>=_0x188319){_0x1dd5bf=_0x188319;_0x10d4d7=0xc8;}else{_0x10d4d7=0xce;}_0x1e8ca9['status'](_0x10d4d7);return _0x1e8ca9[_0x6e83('0x24')](_0x6e83('0x25'),_0x49145e+'-'+_0x1dd5bf+'/'+_0x188319)[_0x6e83('0x1f')](_0xa2e7d9);}return null;};}function patchUpdates(_0x27d3f6){return function(_0x2c6770){try{jsonpatch[_0x6e83('0x26')](_0x2c6770,_0x27d3f6,!![]);}catch(_0x9f3dd1){return BPromise['reject'](_0x9f3dd1);}return _0x2c6770[_0x6e83('0x27')]();};}function saveUpdates(_0xfa78cc,_0x2eee11){return function(_0x5bf1aa){if(_0x5bf1aa){return _0x5bf1aa[_0x6e83('0x28')](_0xfa78cc)[_0x6e83('0x29')](function(_0x4155ad){return _0x4155ad;});}return null;};}function removeEntity(_0x4e62ae,_0xf26972){return function(_0xafc2c){if(_0xafc2c){return _0xafc2c[_0x6e83('0x2a')]()['then'](function(){_0x4e62ae[_0x6e83('0x1d')](0xcc)[_0x6e83('0x1e')]();});}};}function handleEntityNotFound(_0x58f16b,_0x4d6023){return function(_0x3ae451){if(!_0x3ae451){_0x58f16b['sendStatus'](0x194);}return _0x3ae451;};}function handleError(_0x489097,_0x1153e8){_0x1153e8=_0x1153e8||0x1f4;return function(_0x419eb9){logger[_0x6e83('0x2b')](_0x419eb9[_0x6e83('0x2c')]);if(_0x419eb9[_0x6e83('0x2d')]){delete _0x419eb9[_0x6e83('0x2d')];}_0x489097[_0x6e83('0x1d')](_0x1153e8)[_0x6e83('0x2e')](_0x419eb9);};}exports['sendUserNotification']=function(_0x459f97,_0x27676e,_0x5f12e8){if(!_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('text')&&!_0x459f97['body'][_0x6e83('0x30')]('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x6e83('0x31'));}else{if(_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('TemplateId')&&!_0x459f97[_0x6e83('0x2f')]['hasOwnProperty']('view')){throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('recipients')){throw new db['Sequelize']['ValidationError'](_0x6e83('0x34'));}else{try{var _0x21a352=JSON[_0x6e83('0x35')](_0x459f97[_0x6e83('0x2f')]['recipients']);}catch(_0x44e96b){logger[_0x6e83('0x2b')](_0x44e96b);throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5edcd9=['chatqueue',_0x6e83('0x36'),_0x6e83('0x37'),_0x6e83('0x38'),'smsqueue',_0x6e83('0x39'),_0x6e83('0x3a'),_0x6e83('0x3b'),_0x6e83('0x3c')];if(_['some'](_0x21a352,function(_0xf2cb6c){return!_[_0x6e83('0x3d')](_0x5edcd9,_0xf2cb6c['model'][_0x6e83('0x3e')]());})){throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))](_0x6e83('0x3f'));}}}var _0x419fb8={};_0x419fb8['senderName']=_0x459f97[_0x6e83('0x2f')]['hasOwnProperty'](_0x6e83('0x40'))?_0x459f97['body'][_0x6e83('0x40')]:_0x459f97['user']['fullname'];_0x419fb8[_0x6e83('0x41')]=_[_0x6e83('0x42')](_0x459f97[_0x6e83('0x2f')][_0x6e83('0x41')])?null:_0x459f97['body'][_0x6e83('0x41')];_0x419fb8[_0x6e83('0x43')]=_0x459f97[_0x6e83('0x2f')][_0x6e83('0x43')]||![];_0x419fb8['SenderId']=_0x459f97[_0x6e83('0x3c')]['id'];return getContent(_0x459f97[_0x6e83('0x2f')])[_0x6e83('0x29')](function(_0x90ba06){_0x419fb8[_0x6e83('0x2f')]=_0x90ba06;return getRecipients(_0x21a352);})[_0x6e83('0x29')](function(_0x3ff1ca){_0x419fb8[_0x6e83('0x44')]=_['sortBy'](_0x3ff1ca)[_0x6e83('0x45')](',');return db['sequelize'][_0x6e83('0x46')](function(_0x242d76){return db[_0x6e83('0x47')]['create'](_0x419fb8,{'raw':!![],'transaction':_0x242d76})[_0x6e83('0x29')](function(_0x5a8ec){var _0x2fa510={'sender':_0x419fb8[_0x6e83('0x40')],'description':_0x419fb8[_0x6e83('0x41')],'content':_0x419fb8[_0x6e83('0x2f')],'beep':_0x419fb8[_0x6e83('0x43')]};_0x3ff1ca[_0x6e83('0x48')](function(_0x146b7b){_0x2fa510[_0x6e83('0x49')]=_0x146b7b;socket['emit'](_0x6e83('0x4a'),_0x2fa510);});return _0x5a8ec;});});})['then'](respondWithResult(_0x27676e,0xc9))[_0x6e83('0x4b')](handleError(_0x27676e,null));};function getContent(_0x1a2294){return new BPromise(function(_0x5c8e0e,_0x3b8573){if(_0x1a2294[_0x6e83('0x4c')]){_0x5c8e0e(_0x1a2294[_0x6e83('0x4c')]);return;}return db[_0x6e83('0x4d')][_0x6e83('0x4e')]({'attributes':[_0x6e83('0x4f')],'where':{'id':_0x1a2294[_0x6e83('0x50')]},'raw':!![]})['then'](function(_0x31affb){if(!_0x31affb)throw new db[(_0x6e83('0x32'))]['ValidationError'](_0x6e83('0x51'));var _0x269f70=Mustache[_0x6e83('0x52')](_0x31affb[_0x6e83('0x4f')],_0x1a2294[_0x6e83('0x53')]);_0x5c8e0e(_0x269f70);})['catch'](function(_0x2fa604){_0x3b8573(_0x2fa604);});});}function getRecipients(_0x360fe3){return new BPromise(function(_0x20144a,_0x400900){var _0x3cc907=[];var _0x4f5ddd=[];_0x360fe3['forEach'](function(_0x12e06c){var _0xfacd66=_[_0x6e83('0x54')](_0x12e06c[_0x6e83('0x55')][_0x6e83('0x3e')]());if(_0xfacd66==='User'){_0x3cc907=_[_0x6e83('0x56')](_0x3cc907,_0x12e06c[_0x6e83('0x57')]);}else{if(_[_0x6e83('0x3d')](_0xfacd66,_0x6e83('0x58')))_0xfacd66=_0xfacd66[_0x6e83('0x59')](_0x6e83('0x58'),_0x6e83('0x5a'));_0x12e06c[_0x6e83('0x57')][_0x6e83('0x48')](function(_0x56ea9b){_0x4f5ddd[_0x6e83('0x5b')](getAgents(_0xfacd66,_0x56ea9b));});}});return BPromise['all'](_0x4f5ddd)['then'](function(_0x5e96c6){_0x3cc907=_['union'](_0x3cc907,_[_0x6e83('0x5c')](_0x5e96c6));_0x20144a(_0x3cc907);})[_0x6e83('0x4b')](function(_0x48343b){_0x400900(_0x48343b);});});}function getAgents(_0x2d43a9,_0x2368cf){return new BPromise(function(_0x57b6d6,_0xb2c692){return db[_0x2d43a9]['findOne']({'where':{'id':_0x2368cf}})[_0x6e83('0x29')](function(_0x36316b){return _0x36316b[_0x6e83('0x5d')]({'attributes':['id'],'raw':!![]})[_0x6e83('0x29')](function(_0x13287b){var _0x3a1ae4=_[_0x6e83('0x5e')](_0x13287b,'id');_0x57b6d6(_0x3a1ae4);});})[_0x6e83('0x4b')](function(_0x2aca11){_0xb2c692(_0x2aca11);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 2ba7624..6599e9c 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 _0x78fb=['hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','save','emit'];(function(_0x2dff7c,_0x905e0b){var _0x5e7d4d=function(_0x4d183d){while(--_0x4d183d){_0x2dff7c['push'](_0x2dff7c['shift']());}};_0x5e7d4d(++_0x905e0b);}(_0x78fb,0x1db));var _0xb78f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x78fb[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xb78f('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xb78f('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb78f('0x2')](0x0);var events={'afterCreate':_0xb78f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x531de4){return function(_0x4dce40,_0xa6d55a,_0x60f234){UserNotificationEvents[_0xb78f('0x4')](_0x531de4+':'+_0x4dce40['id'],_0x4dce40);UserNotificationEvents['emit'](_0x531de4,_0x4dce40);_0x60f234(null);};}for(var e in events){if(events[_0xb78f('0x5')](e)){var event=events[e];UserNotification[_0xb78f('0x6')](e,emitEvent(event));}}module[_0xb78f('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x9fc7=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x361087,_0x22f6df){var _0x57b4c6=function(_0x37b02d){while(--_0x37b02d){_0x361087['push'](_0x361087['shift']());}};_0x57b4c6(++_0x22f6df);}(_0x9fc7,0x1cb));var _0x79fc=function(_0x4f292f,_0x35d89f){_0x4f292f=_0x4f292f-0x0;var _0x1d9922=_0x9fc7[_0x4f292f];return _0x1d9922;};'use strict';var EventEmitter=require(_0x79fc('0x0'));var UserNotification=require(_0x79fc('0x1'))['db'][_0x79fc('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x79fc('0x3')](0x0);var events={'afterCreate':_0x79fc('0x4'),'afterUpdate':_0x79fc('0x5'),'afterDestroy':_0x79fc('0x6')};function emitEvent(_0x382fa2){return function(_0x3ab5e2,_0x434c04,_0x253a47){UserNotificationEvents['emit'](_0x382fa2+':'+_0x3ab5e2['id'],_0x3ab5e2);UserNotificationEvents[_0x79fc('0x7')](_0x382fa2,_0x3ab5e2);_0x253a47(null);};}for(var e in events){if(events[_0x79fc('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x79fc('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 326788b..445bb59 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 _0x2a0d=['../../config/logger','api','request-promise','path','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','lodash','util'];(function(_0x18e736,_0x1b81e5){var _0x31213c=function(_0x21ddd8){while(--_0x21ddd8){_0x18e736['push'](_0x18e736['shift']());}};_0x31213c(++_0x1b81e5);}(_0x2a0d,0x8e));var _0xd2a0=function(_0x22b710,_0x36595a){_0x22b710=_0x22b710-0x0;var _0x30f71e=_0x2a0d[_0x22b710];return _0x30f71e;};'use strict';var _=require(_0xd2a0('0x0'));var util=require(_0xd2a0('0x1'));var logger=require(_0xd2a0('0x2'))(_0xd2a0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2a0('0x4'));var fs=require('fs');var path=require(_0xd2a0('0x5'));var rimraf=require('rimraf');var config=require(_0xd2a0('0x6'));var attributes=require('./userNotification.attributes');module[_0xd2a0('0x7')]=function(_0x1107c6,_0x549b1d){return _0x1107c6[_0xd2a0('0x8')](_0xd2a0('0x9'),attributes,{'tableName':_0xd2a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2a0('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x941d=['bluebird','request-promise','path','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','util','api','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x941d,0x189));var _0xd941=function(_0x19e915,_0x3ac017){_0x19e915=_0x19e915-0x0;var _0x23c76c=_0x941d[_0x19e915];return _0x23c76c;};'use strict';var _=require('lodash');var util=require(_0xd941('0x0'));var logger=require('../../config/logger')(_0xd941('0x1'));var moment=require(_0xd941('0x2'));var BPromise=require(_0xd941('0x3'));var rp=require(_0xd941('0x4'));var fs=require('fs');var path=require(_0xd941('0x5'));var rimraf=require('rimraf');var config=require(_0xd941('0x6'));var attributes=require('./userNotification.attributes');module[_0xd941('0x7')]=function(_0x388e14,_0x3c0e20){return _0x388e14[_0xd941('0x8')](_0xd941('0x9'),attributes,{'tableName':_0xd941('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd941('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 9694162..115cdbd 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 _0x3ed5=['UserNotification,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','redis','defaults','register','request','then','request\x20sent','stringify','error','code','message'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x3ed5,0x9e));var _0x53ed=function(_0x5d7ade,_0x2fcdc2){_0x5d7ade=_0x5d7ade-0x0;var _0x5499b3=_0x3ed5[_0x5d7ade];return _0x5499b3;};'use strict';var _=require(_0x53ed('0x0'));var util=require(_0x53ed('0x1'));var moment=require('moment');var BPromise=require(_0x53ed('0x2'));var rs=require(_0x53ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53ed('0x4'));var logger=require('../../config/logger')(_0x53ed('0x5'));var config=require(_0x53ed('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x53ed('0x7')]['http']({'port':0x232a});config[_0x53ed('0x8')]=_[_0x53ed('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53ed('0x8')]));require('./userNotification.socket')[_0x53ed('0xa')](socket);function respondWithRpcPromise(_0x99b2d9,_0xe5a33c,_0x2ac91a){return new BPromise(function(_0x4f6246,_0x489270){return client[_0x53ed('0xb')](_0x99b2d9,_0x2ac91a)[_0x53ed('0xc')](function(_0x565804){logger['info']('UserNotification,\x20%s,\x20%s',_0xe5a33c,_0x53ed('0xd'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0xe5a33c,_0x53ed('0xd'),JSON[_0x53ed('0xe')](_0x565804));if(_0x565804[_0x53ed('0xf')]){if(_0x565804[_0x53ed('0xf')][_0x53ed('0x10')]===0x1f4){logger[_0x53ed('0xf')]('UserNotification,\x20%s,\x20%s',_0xe5a33c,_0x565804[_0x53ed('0xf')][_0x53ed('0x11')]);return _0x489270(_0x565804['error'][_0x53ed('0x11')]);}logger[_0x53ed('0xf')](_0x53ed('0x12'),_0xe5a33c,_0x565804[_0x53ed('0xf')][_0x53ed('0x11')]);return _0x4f6246(_0x565804[_0x53ed('0xf')]['message']);}else{logger[_0x53ed('0x13')](_0x53ed('0x12'),_0xe5a33c,'request\x20sent');_0x4f6246(_0x565804[_0x53ed('0x14')]['message']);}})[_0x53ed('0x15')](function(_0x4ffdc6){logger[_0x53ed('0xf')](_0x53ed('0x12'),_0xe5a33c,_0x4ffdc6);_0x489270(_0x4ffdc6);});});} \ No newline at end of file +var _0xfa60=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment'];(function(_0x2b77d0,_0x11f932){var _0x3b1d83=function(_0x27b661){while(--_0x27b661){_0x2b77d0['push'](_0x2b77d0['shift']());}};_0x3b1d83(++_0x11f932);}(_0xfa60,0x65));var _0x0fa6=function(_0x54a733,_0x6355fd){_0x54a733=_0x54a733-0x0;var _0x28a120=_0xfa60[_0x54a733];return _0x28a120;};'use strict';var _=require(_0x0fa6('0x0'));var util=require(_0x0fa6('0x1'));var moment=require(_0x0fa6('0x2'));var BPromise=require(_0x0fa6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fa6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0fa6('0x5'));var config=require(_0x0fa6('0x6'));var jayson=require(_0x0fa6('0x7'));var client=jayson[_0x0fa6('0x8')][_0x0fa6('0x9')]({'port':0x232a});config['redis']=_[_0x0fa6('0xa')](config['redis'],{'host':_0x0fa6('0xb'),'port':0x18eb});var socket=require(_0x0fa6('0xc'))(new Redis(config[_0x0fa6('0xd')]));require(_0x0fa6('0xe'))[_0x0fa6('0xf')](socket);function respondWithRpcPromise(_0x8796da,_0x4d18dd,_0x577ff0){return new BPromise(function(_0x1c3f50,_0xd9459e){return client[_0x0fa6('0x10')](_0x8796da,_0x577ff0)[_0x0fa6('0x11')](function(_0x2d9441){logger['info']('UserNotification,\x20%s,\x20%s',_0x4d18dd,_0x0fa6('0x12'));logger[_0x0fa6('0x13')](_0x0fa6('0x14'),_0x4d18dd,_0x0fa6('0x12'),JSON['stringify'](_0x2d9441));if(_0x2d9441['error']){if(_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x16')]===0x1f4){logger[_0x0fa6('0x15')](_0x0fa6('0x17'),_0x4d18dd,_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);return _0xd9459e(_0x2d9441[_0x0fa6('0x15')]['message']);}logger['error'](_0x0fa6('0x17'),_0x4d18dd,_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);return _0x1c3f50(_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);}else{logger[_0x0fa6('0x19')]('UserNotification,\x20%s,\x20%s',_0x4d18dd,'request\x20sent');_0x1c3f50(_0x2d9441[_0x0fa6('0x1a')][_0x0fa6('0x18')]);}})['catch'](function(_0x3d9f3f){logger[_0x0fa6('0x15')](_0x0fa6('0x17'),_0x4d18dd,_0x3d9f3f);_0xd9459e(_0x3d9f3f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a3caf26..c237fe1 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 _0xb3f8=['removeListener','length','userNotification:','save','remove','update'];(function(_0x2ce7a4,_0x3a3864){var _0x1ba0c9=function(_0x813144){while(--_0x813144){_0x2ce7a4['push'](_0x2ce7a4['shift']());}};_0x1ba0c9(++_0x3a3864);}(_0xb3f8,0x81));var _0x8b3f=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xb3f8[_0xf51c06];return _0x1d5420;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x8b3f('0x0'),_0x8b3f('0x1'),_0x8b3f('0x2')];function createListener(_0x42c6c8,_0x37de0d){return function(_0x1580d6){_0x37de0d['emit'](_0x42c6c8,_0x1580d6);};}function removeListener(_0x3a942a,_0x333641){return function(){UserNotificationEvents[_0x8b3f('0x3')](_0x3a942a,_0x333641);};}exports['register']=function(_0x50434b){for(var _0xa3c93f=0x0,_0x2c583d=events[_0x8b3f('0x4')];_0xa3c93f<_0x2c583d;_0xa3c93f++){var _0x500e5f=events[_0xa3c93f];var _0x586a54=createListener(_0x8b3f('0x5')+_0x500e5f,_0x50434b);UserNotificationEvents['on'](_0x500e5f,_0x586a54);}}; \ No newline at end of file +var _0x5746=['./userNotification.events','update','emit','removeListener','register','length'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x5746,0x150));var _0x6574=function(_0x49b407,_0x189d49){_0x49b407=_0x49b407-0x0;var _0x48ed95=_0x5746[_0x49b407];return _0x48ed95;};'use strict';var UserNotificationEvents=require(_0x6574('0x0'));var events=['save','remove',_0x6574('0x1')];function createListener(_0x1e3cdf,_0x23cc53){return function(_0x553acf){_0x23cc53[_0x6574('0x2')](_0x1e3cdf,_0x553acf);};}function removeListener(_0x146170,_0xd3f56d){return function(){UserNotificationEvents[_0x6574('0x3')](_0x146170,_0xd3f56d);};}exports[_0x6574('0x4')]=function(_0x3a2200){for(var _0x3f7170=0x0,_0x4d497a=events[_0x6574('0x5')];_0x3f7170<_0x4d497a;_0x3f7170++){var _0x5e9ad0=events[_0x3f7170];var _0x50d074=createListener('userNotification:'+_0x5e9ad0,_0x3a2200);UserNotificationEvents['on'](_0x5e9ad0,_0x50d074);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 520f01b..18e4d7e 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(_0x3e655a,_0x1a2097){var _0x40a6c5=function(_0x53044d){while(--_0x53044d){_0x3e655a['push'](_0x3e655a['shift']());}};_0x40a6c5(++_0x1a2097);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2edef3,_0x15e695){var _0x133049=function(_0x49524e){while(--_0x49524e){_0x2edef3['push'](_0x2edef3['shift']());}};_0x133049(++_0x15e695);}(_0x70e0,0x17b));var _0x070e=function(_0x5e91e1,_0x15310a){_0x5e91e1=_0x5e91e1-0x0;var _0x347b31=_0x70e0[_0x5e91e1];return _0x347b31;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f42d199..0f45995 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 _0xe21d=['INTEGER','exports'];(function(_0x112c62,_0x1e0a26){var _0x572610=function(_0x259b3f){while(--_0x259b3f){_0x112c62['push'](_0x112c62['shift']());}};_0x572610(++_0x1e0a26);}(_0xe21d,0x159));var _0xde21=function(_0x545dba,_0x497dc2){_0x545dba=_0x545dba-0x0;var _0x2fbbe6=_0xe21d[_0x545dba];return _0x2fbbe6;};'use strict';var Sequelize=require('sequelize');module[_0xde21('0x0')]={'penalty':{'type':Sequelize[_0xde21('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb7ff=['sequelize','INTEGER'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xb7ff,0x6e));var _0xfb7f=function(_0xbe0f8b,_0x56f63a){_0xbe0f8b=_0xbe0f8b-0x0;var _0x5c4f2b=_0xb7ff[_0xbe0f8b];return _0x5c4f2b;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfb7f('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f297a5d..725da6d 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 _0xdba3=['define','UserOpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports'];(function(_0x304054,_0x36531d){var _0x5755cc=function(_0x3d3583){while(--_0x3d3583){_0x304054['push'](_0x304054['shift']());}};_0x5755cc(++_0x36531d);}(_0xdba3,0xff));var _0x3dba=function(_0x1f864f,_0x2b904a){_0x1f864f=_0x1f864f-0x0;var _0x42faa5=_0xdba3[_0x1f864f];return _0x42faa5;};'use strict';var _=require('lodash');var util=require(_0x3dba('0x0'));var logger=require(_0x3dba('0x1'))(_0x3dba('0x2'));var moment=require(_0x3dba('0x3'));var BPromise=require(_0x3dba('0x4'));var rp=require(_0x3dba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dba('0x6'));var config=require('../../config/environment');var attributes=require(_0x3dba('0x7'));module[_0x3dba('0x8')]=function(_0x55caa4,_0x321ad9){return _0x55caa4[_0x3dba('0x9')](_0x3dba('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac81=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','define'];(function(_0x394d4f,_0x43cf8e){var _0x534041=function(_0x289b9f){while(--_0x289b9f){_0x394d4f['push'](_0x394d4f['shift']());}};_0x534041(++_0x43cf8e);}(_0xac81,0xe6));var _0x1ac8=function(_0x4c91a1,_0x140404){_0x4c91a1=_0x4c91a1-0x0;var _0x2c2390=_0xac81[_0x4c91a1];return _0x2c2390;};'use strict';var _=require(_0x1ac8('0x0'));var util=require(_0x1ac8('0x1'));var logger=require(_0x1ac8('0x2'))(_0x1ac8('0x3'));var moment=require('moment');var BPromise=require(_0x1ac8('0x4'));var rp=require(_0x1ac8('0x5'));var fs=require('fs');var path=require(_0x1ac8('0x6'));var rimraf=require(_0x1ac8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ac8('0x8'));module['exports']=function(_0x59e5f6,_0x57a4fb){return _0x59e5f6[_0x1ac8('0x9')](_0x1ac8('0xa'),attributes,{'tableName':_0x1ac8('0xb'),'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 b5ea333..162663b 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 _0x75b3=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','randomstring'];(function(_0x2f7899,_0x4805d3){var _0x560924=function(_0x332b47){while(--_0x332b47){_0x2f7899['push'](_0x2f7899['shift']());}};_0x560924(++_0x4805d3);}(_0x75b3,0x18d));var _0x375b=function(_0x2ee2b4,_0x5e4ae1){_0x2ee2b4=_0x2ee2b4-0x0;var _0x4249ae=_0x75b3[_0x2ee2b4];return _0x4249ae;};'use strict';var _=require('lodash');var util=require(_0x375b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x375b('0x1'));var fs=require('fs');var Redis=require(_0x375b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x375b('0x3'))(_0x375b('0x4'));var config=require(_0x375b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x375b('0x6')][_0x375b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x196292,_0x2ad4ec,_0x3eb2a0){return new BPromise(function(_0x34a4a2,_0x278760){return client[_0x375b('0x8')](_0x196292,_0x3eb2a0)[_0x375b('0x9')](function(_0x5eb9eb){logger[_0x375b('0xa')](_0x375b('0xb'),_0x2ad4ec,_0x375b('0xc'));logger[_0x375b('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2ad4ec,_0x375b('0xc'),JSON[_0x375b('0xe')](_0x5eb9eb));if(_0x5eb9eb[_0x375b('0xf')]){if(_0x5eb9eb[_0x375b('0xf')][_0x375b('0x10')]===0x1f4){logger[_0x375b('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2ad4ec,_0x5eb9eb[_0x375b('0xf')][_0x375b('0x11')]);return _0x278760(_0x5eb9eb[_0x375b('0xf')][_0x375b('0x11')]);}logger[_0x375b('0xf')](_0x375b('0xb'),_0x2ad4ec,_0x5eb9eb[_0x375b('0xf')][_0x375b('0x11')]);return _0x34a4a2(_0x5eb9eb[_0x375b('0xf')][_0x375b('0x11')]);}else{logger[_0x375b('0xa')](_0x375b('0xb'),_0x2ad4ec,_0x375b('0xc'));_0x34a4a2(_0x5eb9eb['result']['message']);}})[_0x375b('0x12')](function(_0x34ae1e){logger[_0x375b('0xf')](_0x375b('0xb'),_0x2ad4ec,_0x34ae1e);_0x278760(_0x34ae1e);});});} \ No newline at end of file +var _0x9ec3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x22c9d3,_0x307c00){var _0x319833=function(_0x1932c1){while(--_0x1932c1){_0x22c9d3['push'](_0x22c9d3['shift']());}};_0x319833(++_0x307c00);}(_0x9ec3,0x88));var _0x39ec=function(_0x25b7bc,_0x4cb6bf){_0x25b7bc=_0x25b7bc-0x0;var _0x479fdb=_0x9ec3[_0x25b7bc];return _0x479fdb;};'use strict';var _=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var moment=require(_0x39ec('0x2'));var BPromise=require(_0x39ec('0x3'));var rs=require(_0x39ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ec('0x5'))['db'];var utils=require(_0x39ec('0x6'));var logger=require(_0x39ec('0x7'))('rpc');var config=require(_0x39ec('0x8'));var jayson=require(_0x39ec('0x9'));var client=jayson[_0x39ec('0xa')][_0x39ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33f7ca,_0xa6bfd7,_0x286209){return new BPromise(function(_0x838988,_0xe4734f){return client[_0x39ec('0xc')](_0x33f7ca,_0x286209)[_0x39ec('0xd')](function(_0x49daa2){logger[_0x39ec('0xe')](_0x39ec('0xf'),_0xa6bfd7,_0x39ec('0x10'));logger[_0x39ec('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xa6bfd7,_0x39ec('0x10'),JSON[_0x39ec('0x12')](_0x49daa2));if(_0x49daa2[_0x39ec('0x13')]){if(_0x49daa2[_0x39ec('0x13')]['code']===0x1f4){logger['error'](_0x39ec('0xf'),_0xa6bfd7,_0x49daa2[_0x39ec('0x13')][_0x39ec('0x14')]);return _0xe4734f(_0x49daa2['error'][_0x39ec('0x14')]);}logger['error'](_0x39ec('0xf'),_0xa6bfd7,_0x49daa2[_0x39ec('0x13')][_0x39ec('0x14')]);return _0x838988(_0x49daa2['error'][_0x39ec('0x14')]);}else{logger[_0x39ec('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa6bfd7,_0x39ec('0x10'));_0x838988(_0x49daa2[_0x39ec('0x15')][_0x39ec('0x14')]);}})[_0x39ec('0x16')](function(_0x40b6a8){logger[_0x39ec('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa6bfd7,_0x40b6a8);_0xe4734f(_0x40b6a8);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b3cff8b..fea8c9a 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 _0x2395=['update','delete','destroy','removeSections','removeResources','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','index','get','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put'];(function(_0x54adb4,_0x43afc1){var _0x2d61bc=function(_0x3e2ccc){while(--_0x3e2ccc){_0x54adb4['push'](_0x54adb4['shift']());}};_0x2d61bc(++_0x43afc1);}(_0x2395,0x114));var _0x5239=function(_0xe918b,_0x1e7747){_0xe918b=_0xe918b-0x0;var _0x3e1525=_0x2395[_0xe918b];return _0x3e1525;};'use strict';var multer=require('multer');var util=require(_0x5239('0x0'));var path=require(_0x5239('0x1'));var timeout=require(_0x5239('0x2'));var express=require('express');var router=express[_0x5239('0x3')]();var fs_extra=require(_0x5239('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5239('0x5'));var config=require(_0x5239('0x6'));var controller=require(_0x5239('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5239('0x8')]);router[_0x5239('0x9')]('/describe',auth[_0x5239('0xa')](),controller[_0x5239('0xb')]);router[_0x5239('0x9')](_0x5239('0xc'),auth[_0x5239('0xa')](),controller[_0x5239('0xd')]);router[_0x5239('0x9')](_0x5239('0xe'),auth['isAuthenticated'](),controller[_0x5239('0xf')]);router[_0x5239('0x9')](_0x5239('0x10'),auth[_0x5239('0xa')](),controller[_0x5239('0x11')]);router[_0x5239('0x12')]('/',auth[_0x5239('0xa')](),controller[_0x5239('0x13')]);router[_0x5239('0x12')](_0x5239('0x14'),auth[_0x5239('0xa')](),controller['clone']);router[_0x5239('0x12')](_0x5239('0xe'),auth[_0x5239('0xa')](),controller[_0x5239('0x15')]);router[_0x5239('0x12')](_0x5239('0x10'),auth[_0x5239('0xa')](),controller[_0x5239('0x16')]);router[_0x5239('0x17')](_0x5239('0xc'),auth['isAuthenticated'](),controller[_0x5239('0x18')]);router[_0x5239('0x19')](_0x5239('0xc'),auth['isAuthenticated'](),controller[_0x5239('0x1a')]);router['delete']('/:id/sections',auth[_0x5239('0xa')](),controller[_0x5239('0x1b')]);router[_0x5239('0x19')](_0x5239('0x10'),auth[_0x5239('0xa')](),controller[_0x5239('0x1c')]);module[_0x5239('0x1d')]=router; \ No newline at end of file +var _0x9ec3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/:id','getSections','/:id/resources','getResources','create','post','clone','addSections','put','update','destroy','/:id/sections','removeSections','delete','exports','multer','util','express'];(function(_0x889c34,_0x371f4d){var _0x3d5a9c=function(_0xf20390){while(--_0xf20390){_0x889c34['push'](_0x889c34['shift']());}};_0x3d5a9c(++_0x371f4d);}(_0x9ec3,0xcd));var _0x39ec=function(_0x5ea887,_0x5bb376){_0x5ea887=_0x5ea887-0x0;var _0x45c71b=_0x9ec3[_0x5ea887];return _0x45c71b;};'use strict';var multer=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39ec('0x2'));var router=express['Router']();var fs_extra=require(_0x39ec('0x3'));var auth=require(_0x39ec('0x4'));var interaction=require(_0x39ec('0x5'));var config=require(_0x39ec('0x6'));var controller=require(_0x39ec('0x7'));router[_0x39ec('0x8')]('/',auth[_0x39ec('0x9')](),controller[_0x39ec('0xa')]);router['get']('/describe',auth[_0x39ec('0x9')](),controller['describe']);router[_0x39ec('0x8')](_0x39ec('0xb'),auth[_0x39ec('0x9')](),controller['show']);router[_0x39ec('0x8')]('/:id/sections',auth[_0x39ec('0x9')](),controller[_0x39ec('0xc')]);router['get'](_0x39ec('0xd'),auth[_0x39ec('0x9')](),controller[_0x39ec('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x39ec('0xf')]);router[_0x39ec('0x10')]('/:id/clone',auth[_0x39ec('0x9')](),controller[_0x39ec('0x11')]);router[_0x39ec('0x10')]('/:id/sections',auth[_0x39ec('0x9')](),controller[_0x39ec('0x12')]);router[_0x39ec('0x10')](_0x39ec('0xd'),auth[_0x39ec('0x9')](),controller['addResources']);router[_0x39ec('0x13')](_0x39ec('0xb'),auth['isAuthenticated'](),controller[_0x39ec('0x14')]);router['delete'](_0x39ec('0xb'),auth[_0x39ec('0x9')](),controller[_0x39ec('0x15')]);router['delete'](_0x39ec('0x16'),auth[_0x39ec('0x9')](),controller[_0x39ec('0x17')]);router[_0x39ec('0x18')](_0x39ec('0xd'),auth['isAuthenticated'](),controller['removeResources']);module[_0x39ec('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2131a88..c60052e 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 _0x27ca=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x5a9376,_0x3a3bf4){var _0x4187c7=function(_0x5c7893){while(--_0x5c7893){_0x5a9376['push'](_0x5a9376['shift']());}};_0x4187c7(++_0x3a3bf4);}(_0x27ca,0xf4));var _0xa27c=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x27ca[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0xa27c('0x0'));module[_0xa27c('0x1')]={'name':{'type':Sequelize[_0xa27c('0x2')],'allowNull':![],'unique':_0xa27c('0x3')},'crudPermissions':{'type':Sequelize[_0xa27c('0x2')],'set':function(_0x738f4b){this[_0xa27c('0x4')](_0xa27c('0x5'),_0x738f4b?_0x738f4b[_0xa27c('0x6')](''):[]);},'get':function(){return this[_0xa27c('0x7')](_0xa27c('0x5'))?this[_0xa27c('0x7')](_0xa27c('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa27c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa27c('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcd23=['exports','STRING','setDataValue','join','crudPermissions','split','BOOLEAN'];(function(_0x3cfcc3,_0x1b3823){var _0x4e19a7=function(_0x192a14){while(--_0x192a14){_0x3cfcc3['push'](_0x3cfcc3['shift']());}};_0x4e19a7(++_0x1b3823);}(_0xcd23,0x19d));var _0x3cd2=function(_0x37317e,_0x3ce630){_0x37317e=_0x37317e-0x0;var _0x560af0=_0xcd23[_0x37317e];return _0x560af0;};'use strict';var Sequelize=require('sequelize');module[_0x3cd2('0x0')]={'name':{'type':Sequelize[_0x3cd2('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x3cd2('0x1')],'set':function(_0x45ea14){this[_0x3cd2('0x2')]('crudPermissions',_0x45ea14?_0x45ea14[_0x3cd2('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0x3cd2('0x4'))?this['getDataValue']('crudPermissions')[_0x3cd2('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3cd2('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a8942ba..8a1d24c 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 _0xe785=['model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','body','clone','keys','find','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','update','describe','addSections','userProfileId','each','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','UserProfile','fieldName','type'];(function(_0x53ee43,_0x2a63ec){var _0x58b2ca=function(_0x35e8a0){while(--_0x35e8a0){_0x53ee43['push'](_0x53ee43['shift']());}};_0x58b2ca(++_0x2a63ec);}(_0xe785,0x128));var _0x5e78=function(_0x451f72,_0x58043e){_0x451f72=_0x451f72-0x0;var _0x912533=_0xe785[_0x451f72];return _0x912533;};'use strict';var emlformat=require(_0x5e78('0x0'));var rimraf=require(_0x5e78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e78('0x2'));var rp=require(_0x5e78('0x3'));var moment=require(_0x5e78('0x4'));var BPromise=require(_0x5e78('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e78('0x6'));var sox=require(_0x5e78('0x7'));var csv=require(_0x5e78('0x8'));var ejs=require(_0x5e78('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e78('0xa'));var crypto=require(_0x5e78('0xb'));var jsforce=require(_0x5e78('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5e78('0x8'));var querystring=require('querystring');var Papa=require(_0x5e78('0xd'));var Redis=require('ioredis');var authService=require(_0x5e78('0xe'));var qs=require(_0x5e78('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e78('0x10'));var logger=require(_0x5e78('0x11'))(_0x5e78('0x12'));var utils=require(_0x5e78('0x13'));var config=require(_0x5e78('0x14'));var licenseUtil=require(_0x5e78('0x15'));var db=require(_0x5e78('0x16'))['db'];config['redis']=_[_0x5e78('0x17')](config[_0x5e78('0x18')],{'host':_0x5e78('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e78('0x18')]));require(_0x5e78('0x1a'))[_0x5e78('0x1b')](socket);function respondWithStatusCode(_0x1e49bf,_0x51c20f){_0x51c20f=_0x51c20f||0xcc;return function(_0x4f125f){if(_0x4f125f){return _0x1e49bf[_0x5e78('0x1c')](_0x51c20f);}return _0x1e49bf[_0x5e78('0x1d')](_0x51c20f)[_0x5e78('0x1e')]();};}function respondWithResult(_0x399424,_0x154c7f){_0x154c7f=_0x154c7f||0xc8;return function(_0x493adc){if(_0x493adc){return _0x399424['status'](_0x154c7f)[_0x5e78('0x1f')](_0x493adc);}};}function respondWithFilteredResult(_0x263109,_0x40e31a){return function(_0x5d6063){if(_0x5d6063){var _0x5d2fb9=typeof _0x40e31a['offset']==='undefined'&&typeof _0x40e31a[_0x5e78('0x20')]===_0x5e78('0x21');var _0xe0ccf4=_0x5d6063[_0x5e78('0x22')];var _0x1b6721=_0x5d2fb9?0x0:_0x40e31a[_0x5e78('0x23')];var _0x578a61=_0x5d2fb9?_0x5d6063[_0x5e78('0x22')]:_0x40e31a[_0x5e78('0x23')]+_0x40e31a[_0x5e78('0x20')];var _0x10166e;if(_0x578a61>=_0xe0ccf4){_0x578a61=_0xe0ccf4;_0x10166e=0xc8;}else{_0x10166e=0xce;}_0x263109[_0x5e78('0x1d')](_0x10166e);return _0x263109[_0x5e78('0x24')](_0x5e78('0x25'),_0x1b6721+'-'+_0x578a61+'/'+_0xe0ccf4)[_0x5e78('0x1f')](_0x5d6063);}return null;};}function patchUpdates(_0x56a804){return function(_0x2eb71d){try{jsonpatch[_0x5e78('0x26')](_0x2eb71d,_0x56a804,!![]);}catch(_0x5d001a){return BPromise[_0x5e78('0x27')](_0x5d001a);}return _0x2eb71d[_0x5e78('0x28')]();};}function saveUpdates(_0x3e297e,_0x112773){return function(_0x352536){if(_0x352536){return _0x352536['update'](_0x3e297e)[_0x5e78('0x29')](function(_0x874a24){return _0x874a24;});}return null;};}function removeEntity(_0x454404,_0x3b39f4){return function(_0x363696){if(_0x363696){return _0x363696[_0x5e78('0x2a')]()[_0x5e78('0x29')](function(){_0x454404[_0x5e78('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250618,_0x2de40e){return function(_0x4b540c){if(!_0x4b540c){_0x250618['sendStatus'](0x194);}return _0x4b540c;};}function handleError(_0x4ff829,_0x47b385){_0x47b385=_0x47b385||0x1f4;return function(_0x8d0a4a){logger[_0x5e78('0x2b')](_0x8d0a4a['stack']);if(_0x8d0a4a[_0x5e78('0x2c')]){delete _0x8d0a4a[_0x5e78('0x2c')];}_0x4ff829['status'](_0x47b385)[_0x5e78('0x2d')](_0x8d0a4a);};}exports['index']=function(_0xdb88,_0x2b27be){var _0x2a5ad5={},_0x2c68d8={},_0x527843={'count':0x0,'rows':[]};var _0x298cc3=_['map'](db[_0x5e78('0x2e')]['rawAttributes'],function(_0x10329d){return{'name':_0x10329d[_0x5e78('0x2f')],'type':_0x10329d[_0x5e78('0x30')]['key']};});_0x2c68d8[_0x5e78('0x31')]=_[_0x5e78('0x32')](_0x298cc3,'name');_0x2c68d8[_0x5e78('0x33')]=_['keys'](_0xdb88[_0x5e78('0x33')]);_0x2c68d8[_0x5e78('0x34')]=_['intersection'](_0x2c68d8[_0x5e78('0x31')],_0x2c68d8[_0x5e78('0x33')]);_0x2a5ad5[_0x5e78('0x35')]=_[_0x5e78('0x36')](_0x2c68d8[_0x5e78('0x31')],qs[_0x5e78('0x37')](_0xdb88[_0x5e78('0x33')][_0x5e78('0x37')]));_0x2a5ad5[_0x5e78('0x35')]=_0x2a5ad5['attributes'][_0x5e78('0x38')]?_0x2a5ad5['attributes']:_0x2c68d8[_0x5e78('0x31')];if(!_0xdb88['query'][_0x5e78('0x39')]('nolimit')){_0x2a5ad5[_0x5e78('0x20')]=qs[_0x5e78('0x20')](_0xdb88[_0x5e78('0x33')]['limit']);_0x2a5ad5[_0x5e78('0x23')]=qs[_0x5e78('0x23')](_0xdb88['query']['offset']);}_0x2a5ad5[_0x5e78('0x3a')]=qs[_0x5e78('0x3b')](_0xdb88[_0x5e78('0x33')][_0x5e78('0x3b')]);_0x2a5ad5[_0x5e78('0x3c')]=qs[_0x5e78('0x34')](_[_0x5e78('0x3d')](_0xdb88[_0x5e78('0x33')],_0x2c68d8[_0x5e78('0x34')]),_0x298cc3);if(_0xdb88[_0x5e78('0x33')][_0x5e78('0x3e')]){_0x2a5ad5['where']=_[_0x5e78('0x3f')](_0x2a5ad5[_0x5e78('0x3c')],{'$or':_[_0x5e78('0x32')](_0x298cc3,function(_0x32097a){if(_0x32097a['type']!==_0x5e78('0x40')){var _0x2d3012={};_0x2d3012[_0x32097a[_0x5e78('0x2c')]]={'$like':'%'+_0xdb88[_0x5e78('0x33')][_0x5e78('0x3e')]+'%'};return _0x2d3012;}})});}_0x2a5ad5=_[_0x5e78('0x3f')]({},_0x2a5ad5,_0xdb88['options']);var _0x3311d0={'where':_0x2a5ad5[_0x5e78('0x3c')]};return db[_0x5e78('0x2e')][_0x5e78('0x22')](_0x3311d0)[_0x5e78('0x29')](function(_0x4d1ed6){_0x527843[_0x5e78('0x22')]=_0x4d1ed6;if(_0xdb88['query'][_0x5e78('0x41')]){_0x2a5ad5[_0x5e78('0x42')]=[{'all':!![]}];}return db['UserProfile'][_0x5e78('0x43')](_0x2a5ad5);})[_0x5e78('0x29')](function(_0x525a3e){_0x527843[_0x5e78('0x44')]=_0x525a3e;return _0x527843;})[_0x5e78('0x29')](respondWithFilteredResult(_0x2b27be,_0x2a5ad5))[_0x5e78('0x45')](handleError(_0x2b27be,null));};exports['show']=function(_0x64c22,_0x5856e3){var _0x13eed6={'raw':![],'where':{'id':_0x64c22[_0x5e78('0x46')]['id']}},_0x3013e9={};_0x3013e9[_0x5e78('0x31')]=_['keys'](db[_0x5e78('0x2e')][_0x5e78('0x47')]);_0x3013e9['query']=_['keys'](_0x64c22[_0x5e78('0x33')]);_0x3013e9[_0x5e78('0x34')]=_[_0x5e78('0x36')](_0x3013e9[_0x5e78('0x31')],_0x3013e9[_0x5e78('0x33')]);_0x13eed6['attributes']=_[_0x5e78('0x36')](_0x3013e9[_0x5e78('0x31')],qs[_0x5e78('0x37')](_0x64c22[_0x5e78('0x33')][_0x5e78('0x37')]));_0x13eed6['attributes']=_0x13eed6[_0x5e78('0x35')][_0x5e78('0x38')]?_0x13eed6['attributes']:_0x3013e9['model'];if(_0x64c22['query'][_0x5e78('0x41')]){_0x13eed6[_0x5e78('0x42')]=[{'all':!![]}];}_0x13eed6=_[_0x5e78('0x3f')]({},_0x13eed6,_0x64c22[_0x5e78('0x48')]);return db[_0x5e78('0x2e')]['find'](_0x13eed6)[_0x5e78('0x29')](handleEntityNotFound(_0x5856e3,null))[_0x5e78('0x29')](respondWithResult(_0x5856e3,null))[_0x5e78('0x45')](handleError(_0x5856e3,null));};exports['create']=function(_0x2ae6dd,_0xd6522e){return db[_0x5e78('0x2e')][_0x5e78('0x49')](_0x2ae6dd[_0x5e78('0x4a')],{})['then'](respondWithResult(_0xd6522e,0xc9))[_0x5e78('0x45')](handleError(_0xd6522e,null));};exports[_0x5e78('0x4b')]=function(_0x4c8a73,_0x51c807){var _0x291127={'where':{'id':_0x4c8a73[_0x5e78('0x46')]['id']}},_0x55b87c={};_0x55b87c[_0x5e78('0x31')]=_[_0x5e78('0x4c')](db[_0x5e78('0x2e')][_0x5e78('0x47')]);_0x291127[_0x5e78('0x35')]=_[_0x5e78('0x36')](_0x55b87c['model'],qs[_0x5e78('0x37')](_0x4c8a73[_0x5e78('0x33')]['fields']));_0x291127['attributes']=_0x291127[_0x5e78('0x35')][_0x5e78('0x38')]?_0x291127[_0x5e78('0x35')]:_0x55b87c[_0x5e78('0x31')];if(_0x4c8a73[_0x5e78('0x33')][_0x5e78('0x41')]){_0x291127[_0x5e78('0x42')]=[{'all':!![]}];}_0x291127=_['merge']({},_0x291127,_0x4c8a73[_0x5e78('0x48')]);return db[_0x5e78('0x2e')][_0x5e78('0x4d')](_0x291127)[_0x5e78('0x29')](handleEntityNotFound(_0x51c807,null))[_0x5e78('0x29')](function(_0xd27aba){if(_0xd27aba){var _0x47c9f5=_0xd27aba[_0x5e78('0x4e')]({'plain':!![]});_0x47c9f5=qs[_0x5e78('0x4f')](_0x47c9f5,['id',_0x5e78('0x50'),'updatedAt',_0x5e78('0x51')]);_0x4c8a73[_0x5e78('0x4a')]=_[_0x5e78('0x4f')](_0x4c8a73[_0x5e78('0x4a')],['id',_0x5e78('0x50'),_0x5e78('0x52')]);return db[_0x5e78('0x53')][_0x5e78('0x54')](function(_0x2ecd73){return db[_0x5e78('0x2e')][_0x5e78('0x49')](_[_0x5e78('0x3f')](_0x47c9f5,_0x4c8a73[_0x5e78('0x4a')]),{'include':_0x4c8a73[_0x5e78('0x33')][_0x5e78('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x2ecd73})[_0x5e78('0x29')](function(_0x172649){var _0x33cd32=_0x172649['get']({'plain':!![]});return db[_0x5e78('0x55')][_0x5e78('0x43')]({'where':{'userProfileId':_0x4c8a73[_0x5e78('0x46')]['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x15bb14){if(_0x15bb14){return BPromise['each'](_0x15bb14,function(_0x39871e){return new BPromise(function(_0x459d62,_0x53a499){if(_0x39871e[_0x5e78('0x56')]===null||_0x39871e[_0x5e78('0x56')]===0x1)_0x459d62(null);return db[_0x5e78('0x57')][_0x5e78('0x43')]({'where':{'sectionId':_0x39871e['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x3ec04c){var _0x486af0=_['map'](_0x3ec04c,function(_0x3f0dcf){return qs[_0x5e78('0x4f')](_0x3f0dcf,['id',_0x5e78('0x50'),_0x5e78('0x52'),_0x5e78('0x58')]);});_0x459d62(_0x486af0);})[_0x5e78('0x45')](function(_0x28b213){_0x53a499(_0x28b213);});})[_0x5e78('0x29')](function(_0x35fab0){var _0x23490e=qs[_0x5e78('0x4f')](_0x39871e,['id',_0x5e78('0x50'),'updatedAt']);_0x23490e['userProfileId']=_0x33cd32['id'];if(_0x35fab0)_0x23490e[_0x5e78('0x59')]=_0x35fab0;return _0x23490e;})[_0x5e78('0x29')](function(_0x5ae962){return db[_0x5e78('0x55')][_0x5e78('0x49')](_0x5ae962,{'include':[{'model':db[_0x5e78('0x57')],'as':_0x5e78('0x59')}],'raw':!![],'transaction':_0x2ecd73});});})[_0x5e78('0x29')](function(){return _0x33cd32;});}});});});}})[_0x5e78('0x29')](respondWithResult(_0x51c807,0xc9))['catch'](handleError(_0x51c807,null));};exports[_0x5e78('0x5a')]=function(_0x55badd,_0x93cd5f){if(_0x55badd['body']['id']){delete _0x55badd[_0x5e78('0x4a')]['id'];}return db[_0x5e78('0x2e')][_0x5e78('0x4d')]({'where':{'id':_0x55badd[_0x5e78('0x46')]['id']}})[_0x5e78('0x29')](handleEntityNotFound(_0x93cd5f,null))['then'](saveUpdates(_0x55badd['body'],null))[_0x5e78('0x29')](respondWithResult(_0x93cd5f,null))[_0x5e78('0x45')](handleError(_0x93cd5f,null));};exports[_0x5e78('0x2a')]=function(_0x257c3d,_0x564be0){return db[_0x5e78('0x2e')][_0x5e78('0x4d')]({'where':{'id':_0x257c3d[_0x5e78('0x46')]['id']}})['then'](handleEntityNotFound(_0x564be0,null))['then'](removeEntity(_0x564be0,null))[_0x5e78('0x45')](handleError(_0x564be0,null));};exports[_0x5e78('0x5b')]=function(_0x136eb4,_0x531ea4){return db[_0x5e78('0x2e')][_0x5e78('0x5b')]()[_0x5e78('0x29')](respondWithResult(_0x531ea4,null))[_0x5e78('0x45')](handleError(_0x531ea4,null));};exports[_0x5e78('0x5c')]=function(_0x16ca35,_0x190be3){var _0x337f8f=_0x16ca35[_0x5e78('0x4a')];return db[_0x5e78('0x2e')][_0x5e78('0x4d')]({'where':{'id':_0x16ca35['params']['id']}})[_0x5e78('0x29')](handleEntityNotFound(_0x190be3,null))[_0x5e78('0x29')](function(_0x4ecc4c){if(_0x4ecc4c){return db[_0x5e78('0x53')][_0x5e78('0x54')](function(_0x53224d){return db[_0x5e78('0x55')]['destroy']({'where':{'userProfileId':_0x16ca35['params']['id'],'sectionId':_[_0x5e78('0x32')](_0x337f8f,function(_0x701372){return _0x701372['sectionId'];})},'transaction':_0x53224d})[_0x5e78('0x29')](function(){var _0x31bdb0=_['map'](_0x337f8f,function(_0x2f2ab5){_0x2f2ab5[_0x5e78('0x5d')]=_0x16ca35[_0x5e78('0x46')]['id'];return _0x2f2ab5;});var _0x105571=[];return BPromise[_0x5e78('0x5e')](_0x31bdb0,function(_0x1ffa99){return db[_0x5e78('0x55')][_0x5e78('0x49')](_0x1ffa99,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x53224d})[_0x5e78('0x29')](function(_0x37f933){_0x105571['push'](_0x37f933[_0x5e78('0x4e')]({'plain':!![]}));});})[_0x5e78('0x29')](function(){return _0x105571;});});});}})[_0x5e78('0x29')](function(_0x252795){return _0x252795;})[_0x5e78('0x29')](respondWithResult(_0x190be3,null))['catch'](handleError(_0x190be3,null));};exports[_0x5e78('0x5f')]=function(_0x5545bd,_0x300520){var _0x2086b3;return db['UserProfile'][_0x5e78('0x4d')]({'where':{'id':_0x5545bd[_0x5e78('0x46')]['id']},'attributes':['id',_0x5e78('0x2c')]})[_0x5e78('0x29')](handleEntityNotFound(_0x300520,null))['then'](function(_0x42049a){if(_0x42049a){_0x2086b3=_0x42049a;return db[_0x5e78('0x55')][_0x5e78('0x2a')]({'where':{'userProfileId':_0x5545bd[_0x5e78('0x46')]['id'],'sectionId':_0x5545bd[_0x5e78('0x33')]['ids']}});}})['then'](function(){return _0x2086b3;})[_0x5e78('0x29')](respondWithStatusCode(_0x300520,null))[_0x5e78('0x45')](handleError(_0x300520,null));};exports[_0x5e78('0x60')]=function(_0x55bdd0,_0x180d01){var _0xf9ac6b=[];var _0x41d98c=[];return db[_0x5e78('0x55')][_0x5e78('0x43')]({'where':{'userProfileId':_0x55bdd0[_0x5e78('0x46')]['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x20942e){_0xf9ac6b=_[_0x5e78('0x3e')](_0x20942e,function(_0x299045){return _0x299045[_0x5e78('0x61')]===0x1||_[_0x5e78('0x62')]([0x3eb,0x709],_0x299045[_0x5e78('0x58')]);});if(!_[_0x5e78('0x63')](_0xf9ac6b)){return _[_0x5e78('0x32')](_0xf9ac6b,function(_0x140e95){return _0x140e95[_0x5e78('0x58')];});}else{return;}})[_0x5e78('0x29')](function(_0xce14d2){if(_0xce14d2)_0x41d98c=_0xce14d2;if(_[_0x5e78('0x62')](_0x41d98c,0x64)){var _0x2eeb01=_[_0x5e78('0x4d')](_0xf9ac6b,{'sectionId':0x64});return hasDefaultDashboard(_0x2eeb01)[_0x5e78('0x29')](function(_0x1a9056){return _[_0x5e78('0x32')](_0xf9ac6b,function(_0x3fb4d6){if(_0x3fb4d6[_0x5e78('0x58')]===0x64){_0x3fb4d6[_0x5e78('0x64')]=_0x1a9056;}return _0x3fb4d6;});});}else{return;}})['then'](function(_0x468388){if(_0x468388)_0xf9ac6b=_0x468388;if(_[_0x5e78('0x62')](_0x41d98c,0x3eb)){var _0x5fffef=_['find'](_0xf9ac6b,{'sectionId':0x3eb});return getCustomDashboards(_0x5fffef)[_0x5e78('0x29')](function(_0x4719eb){return _[_0x5e78('0x32')](_0xf9ac6b,function(_0x1dcd69){if(_0x5fffef[_0x5e78('0x61')]){if(_0x1dcd69[_0x5e78('0x58')]===0x3eb){_0x1dcd69['subsections']=_0x4719eb;}}else{if(_0x1dcd69[_0x5e78('0x58')]===0x64){_0x1dcd69[_0x5e78('0x64')]=_0x4719eb;}}return _0x1dcd69;});});}else{return;}})[_0x5e78('0x29')](function(_0x57cd66){if(_0x57cd66)_0xf9ac6b=_0x57cd66;if(_['includes'](_0x41d98c,0x709)){var _0x3242e6=_['find'](_0xf9ac6b,{'sectionId':0x709});return getPlugins(_0x3242e6)[_0x5e78('0x29')](function(_0x5ea26f){if(_0x3242e6[_0x5e78('0x61')]){return _['map'](_0xf9ac6b,function(_0x2fc9dc){if(_0x2fc9dc['sectionId']===0x709){_0x2fc9dc[_0x5e78('0x64')]=_0x5ea26f;}return _0x2fc9dc;});}else{var _0x550a33={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5ea26f};var _0x31b01f=_[_0x5e78('0x32')](_0xf9ac6b);_0x31b01f['push'](_0x550a33);return _0x31b01f;}});}else{return;}})[_0x5e78('0x29')](function(_0x1b15a8){if(_0x1b15a8)_0xf9ac6b=_0x1b15a8;return _['filter'](_0xf9ac6b,['enabled',0x1]);})[_0x5e78('0x29')](respondWithResult(_0x180d01,null))[_0x5e78('0x45')](handleError(_0x180d01,null));};function hasDefaultDashboard(_0x209c09){var _0x343d09=[0x65];return new BPromise(function(_0x386234,_0x2a48d1){try{if(_0x209c09[_0x5e78('0x56')]){_0x386234(_0x343d09);}else{return db['UserProfileResource'][_0x5e78('0x65')]({'where':{'sectionId':_0x209c09['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x28631d){_0x28631d?_0x386234(_0x343d09):_0x386234();});}}catch(_0xd5dc3d){_0x2a48d1(_0xd5dc3d);}});}function getCustomDashboards(_0x57e2a2){var _0x1d6288=[];return new BPromise(function(_0x32044e,_0x31a807){try{if(_0x57e2a2[_0x5e78('0x56')]){return db[_0x5e78('0x66')][_0x5e78('0x43')]({'raw':!![]})['then'](function(_0x1a1c90){_0x1a1c90[_0x5e78('0x67')](function(_0x354717){_0x1d6288[_0x5e78('0x68')](_0x354717['id']+0x1869f);});_0x32044e(_0x1d6288);});}else{return db[_0x5e78('0x57')][_0x5e78('0x43')]({'where':{'sectionId':_0x57e2a2['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x2ef75d){_0x2ef75d[_0x5e78('0x67')](function(_0x40a576){_0x1d6288[_0x5e78('0x68')](_0x40a576[_0x5e78('0x69')]+0x1869f);});_0x32044e(_0x1d6288);});}}catch(_0x162778){_0x31a807(_0x162778);}});}function getPlugins(_0x63370b){var _0x266f26=[];return new BPromise(function(_0x251000,_0x57a085){try{if(_0x63370b[_0x5e78('0x56')]){return db[_0x5e78('0x6a')][_0x5e78('0x43')]({'raw':!![]})[_0x5e78('0x29')](function(_0x4d1fe7){_0x4d1fe7[_0x5e78('0x67')](function(_0x2fe3f3){_0x266f26[_0x5e78('0x68')](_0x2fe3f3['id']+0x15b38);});_0x251000(_0x266f26);});}else{return db[_0x5e78('0x57')]['findAll']({'where':{'sectionId':_0x63370b['id']},'raw':!![]})[_0x5e78('0x29')](function(_0x260373){_0x260373['forEach'](function(_0xc69f59){_0x266f26[_0x5e78('0x68')](_0xc69f59['resourceId']+0x15b38);});_0x251000(_0x266f26);});}}catch(_0x2bde45){_0x57a085(_0x2bde45);}});}exports[_0x5e78('0x6b')]=function(_0x3d60e6,_0x4d10cf){return db['UserProfile'][_0x5e78('0x4d')]({'where':{'id':_0x3d60e6[_0x5e78('0x46')]['id']}})[_0x5e78('0x29')](handleEntityNotFound(_0x4d10cf,null))[_0x5e78('0x29')](function(_0x326fbf){if(_0x326fbf){return db[_0x5e78('0x53')][_0x5e78('0x54')](function(_0x26475a){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3d60e6['params']['id']},'attributes':['id'],'raw':!![]})[_0x5e78('0x29')](function(_0xc91fb2){if(_0xc91fb2){return db['UserProfileSection'][_0x5e78('0x2a')]({'where':{'userProfileId':_0x3d60e6[_0x5e78('0x46')]['id'],'id':_['map'](_0xc91fb2,function(_0x55c519){return _0x55c519['id'];})},'transaction':_0x26475a});}})[_0x5e78('0x29')](function(_0x15aff9){var _0x4d62f8=_['map'](_0x3d60e6['body'],function(_0x44bd42){_0x44bd42[_0x5e78('0x5d')]=_0x3d60e6['params']['id'];return _0x44bd42;});return db[_0x5e78('0x55')][_0x5e78('0x6c')](_0x4d62f8,{'raw':!![],'transaction':_0x26475a});})[_0x5e78('0x29')](function(_0x121c64){var _0x406c7e=_[_0x5e78('0x3e')](_[_0x5e78('0x32')](_0x121c64,function(_0x292da1){return _0x292da1[_0x5e78('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x406c7e){return db[_0x5e78('0x55')][_0x5e78('0x43')]({'where':{'userProfileId':_0x3d60e6[_0x5e78('0x46')]['id'],'sectionId':_[_0x5e78('0x32')](_0x406c7e,function(_0x4e5916){return _0x4e5916[_0x5e78('0x58')];})},'attributes':['id',_0x5e78('0x58')],'raw':!![]})[_0x5e78('0x29')](function(_0x9902f8){var _0x400bd0=_[_0x5e78('0x32')](_0x3d60e6[_0x5e78('0x4a')],function(_0x5da82e){_0x5da82e['userProfileId']=_0x3d60e6['params']['id'];return _0x5da82e;});return db['UserProfileResource']['bulkCreate'](_0x400bd0,{'raw':!![],'transaction':_0x26475a});});}})[_0x5e78('0x45')](handleError(_0x4d10cf,null));});}})[_0x5e78('0x29')](function(_0x2a4281){var _0x222154=_[_0x5e78('0x32')](_0x2a4281,function(_0x48b4bc){return _0x48b4bc[_0x5e78('0x4e')]({'plain':!![]});});})[_0x5e78('0x29')](respondWithResult(_0x4d10cf,null))[_0x5e78('0x45')](handleError(_0x4d10cf,null));};exports[_0x5e78('0x6d')]=function(_0x25264d,_0x2408f5,_0x2d4a56){return db[_0x5e78('0x2e')][_0x5e78('0x4d')]({'where':{'id':_0x25264d[_0x5e78('0x46')]['id']}})['then'](handleEntityNotFound(_0x2408f5,null))[_0x5e78('0x29')](function(_0x569b91){if(_0x569b91){return _0x569b91[_0x5e78('0x6d')](_0x25264d['query'][_0x5e78('0x6e')]);}})[_0x5e78('0x29')](respondWithStatusCode(_0x2408f5,null))[_0x5e78('0x45')](handleError(_0x2408f5,null));};exports[_0x5e78('0x6f')]=function(_0x493cfa,_0x508b95){var _0xf54c18={};if(!_0x493cfa[_0x5e78('0x33')][_0x5e78('0x70')])throw new Error(_0x5e78('0x71'));if(!_0x493cfa[_0x5e78('0x33')][_0x5e78('0x39')](_0x5e78('0x72'))){_0xf54c18['limit']=qs['limit'](_0x493cfa[_0x5e78('0x33')][_0x5e78('0x20')]);_0xf54c18[_0x5e78('0x23')]=qs['offset'](_0x493cfa[_0x5e78('0x33')][_0x5e78('0x23')]);}return db[_0x5e78('0x2e')][_0x5e78('0x4d')]({'where':{'id':_0x493cfa['params']['id']}})['then'](function(_0x25bd5b){if(!_0x25bd5b)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x493cfa['params']['id']);return db[_0x5e78('0x2e')]['getResources'](_0x493cfa);})[_0x5e78('0x29')](respondWithFilteredResult(_0x508b95,_0xf54c18))[_0x5e78('0x45')](handleError(_0x508b95,null));}; \ No newline at end of file +var _0x4b11=['ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','UserProfile','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource','sectionId','omit','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','sequelize','push'];(function(_0x31251f,_0x430e3e){var _0x41120a=function(_0x15b9c5){while(--_0x15b9c5){_0x31251f['push'](_0x31251f['shift']());}};_0x41120a(++_0x430e3e);}(_0x4b11,0xf4));var _0x14b1=function(_0x3c4404,_0x482233){_0x3c4404=_0x3c4404-0x0;var _0x55b303=_0x4b11[_0x3c4404];return _0x55b303;};'use strict';var emlformat=require(_0x14b1('0x0'));var rimraf=require(_0x14b1('0x1'));var zipdir=require(_0x14b1('0x2'));var jsonpatch=require(_0x14b1('0x3'));var rp=require('request-promise');var moment=require(_0x14b1('0x4'));var BPromise=require(_0x14b1('0x5'));var Mustache=require(_0x14b1('0x6'));var util=require('util');var path=require(_0x14b1('0x7'));var sox=require(_0x14b1('0x8'));var csv=require(_0x14b1('0x9'));var ejs=require(_0x14b1('0xa'));var fs=require('fs');var fs_extra=require(_0x14b1('0xb'));var _=require(_0x14b1('0xc'));var squel=require(_0x14b1('0xd'));var crypto=require(_0x14b1('0xe'));var jsforce=require(_0x14b1('0xf'));var deskjs=require(_0x14b1('0x10'));var toCsv=require(_0x14b1('0x9'));var querystring=require(_0x14b1('0x11'));var Papa=require(_0x14b1('0x12'));var Redis=require(_0x14b1('0x13'));var authService=require(_0x14b1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x14b1('0x15'));var hardwareService=require(_0x14b1('0x16'));var logger=require('../../config/logger')(_0x14b1('0x17'));var utils=require(_0x14b1('0x18'));var config=require(_0x14b1('0x19'));var licenseUtil=require(_0x14b1('0x1a'));var db=require(_0x14b1('0x1b'))['db'];config[_0x14b1('0x1c')]=_['defaults'](config[_0x14b1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14b1('0x1c')]));require(_0x14b1('0x1d'))[_0x14b1('0x1e')](socket);function respondWithStatusCode(_0xef8e33,_0xe3de6){_0xe3de6=_0xe3de6||0xcc;return function(_0x2bccc6){if(_0x2bccc6){return _0xef8e33['sendStatus'](_0xe3de6);}return _0xef8e33[_0x14b1('0x1f')](_0xe3de6)[_0x14b1('0x20')]();};}function respondWithResult(_0x2f5a3b,_0xee6c2b){_0xee6c2b=_0xee6c2b||0xc8;return function(_0x459033){if(_0x459033){return _0x2f5a3b[_0x14b1('0x1f')](_0xee6c2b)[_0x14b1('0x21')](_0x459033);}};}function respondWithFilteredResult(_0x35bdff,_0x5dcb52){return function(_0x5b9c4e){if(_0x5b9c4e){var _0x54c287=typeof _0x5dcb52[_0x14b1('0x22')]===_0x14b1('0x23')&&typeof _0x5dcb52[_0x14b1('0x24')]===_0x14b1('0x23');var _0x3d0d98=_0x5b9c4e[_0x14b1('0x25')];var _0x36aca6=_0x54c287?0x0:_0x5dcb52[_0x14b1('0x22')];var _0x4f4830=_0x54c287?_0x5b9c4e[_0x14b1('0x25')]:_0x5dcb52['offset']+_0x5dcb52[_0x14b1('0x24')];var _0x1f905c;if(_0x4f4830>=_0x3d0d98){_0x4f4830=_0x3d0d98;_0x1f905c=0xc8;}else{_0x1f905c=0xce;}_0x35bdff['status'](_0x1f905c);return _0x35bdff[_0x14b1('0x26')](_0x14b1('0x27'),_0x36aca6+'-'+_0x4f4830+'/'+_0x3d0d98)['json'](_0x5b9c4e);}return null;};}function patchUpdates(_0x3ceda2){return function(_0x259dc1){try{jsonpatch[_0x14b1('0x28')](_0x259dc1,_0x3ceda2,!![]);}catch(_0x5033ca){return BPromise[_0x14b1('0x29')](_0x5033ca);}return _0x259dc1['save']();};}function saveUpdates(_0x675488,_0x1306ad){return function(_0x4332f1){if(_0x4332f1){return _0x4332f1[_0x14b1('0x2a')](_0x675488)[_0x14b1('0x2b')](function(_0x3ae844){return _0x3ae844;});}return null;};}function removeEntity(_0x17eb54,_0x3453a7){return function(_0x83f502){if(_0x83f502){return _0x83f502['destroy']()['then'](function(){_0x17eb54[_0x14b1('0x1f')](0xcc)[_0x14b1('0x20')]();});}};}function handleEntityNotFound(_0x4b0295,_0x2365e8){return function(_0x35b21b){if(!_0x35b21b){_0x4b0295['sendStatus'](0x194);}return _0x35b21b;};}function handleError(_0x3bf896,_0x326711){_0x326711=_0x326711||0x1f4;return function(_0x12416e){logger[_0x14b1('0x2c')](_0x12416e['stack']);if(_0x12416e[_0x14b1('0x2d')]){delete _0x12416e[_0x14b1('0x2d')];}_0x3bf896[_0x14b1('0x1f')](_0x326711)[_0x14b1('0x2e')](_0x12416e);};}exports[_0x14b1('0x2f')]=function(_0x1c9fd3,_0x5b943e){var _0x1cb354={},_0x5ddffe={},_0x51ac25={'count':0x0,'rows':[]};var _0x4f0042=_[_0x14b1('0x30')](db[_0x14b1('0x31')]['rawAttributes'],function(_0x2d22f5){return{'name':_0x2d22f5[_0x14b1('0x32')],'type':_0x2d22f5['type']['key']};});_0x5ddffe[_0x14b1('0x33')]=_['map'](_0x4f0042,_0x14b1('0x2d'));_0x5ddffe[_0x14b1('0x34')]=_['keys'](_0x1c9fd3[_0x14b1('0x34')]);_0x5ddffe['filters']=_[_0x14b1('0x35')](_0x5ddffe[_0x14b1('0x33')],_0x5ddffe[_0x14b1('0x34')]);_0x1cb354[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x5ddffe[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x1c9fd3[_0x14b1('0x34')]['fields']));_0x1cb354[_0x14b1('0x36')]=_0x1cb354[_0x14b1('0x36')][_0x14b1('0x38')]?_0x1cb354[_0x14b1('0x36')]:_0x5ddffe['model'];if(!_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x39')](_0x14b1('0x3a'))){_0x1cb354['limit']=qs['limit'](_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x24')]);_0x1cb354['offset']=qs[_0x14b1('0x22')](_0x1c9fd3['query'][_0x14b1('0x22')]);}_0x1cb354[_0x14b1('0x3b')]=qs[_0x14b1('0x3c')](_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x3c')]);_0x1cb354[_0x14b1('0x3d')]=qs['filters'](_[_0x14b1('0x3e')](_0x1c9fd3[_0x14b1('0x34')],_0x5ddffe[_0x14b1('0x3f')]),_0x4f0042);if(_0x1c9fd3['query']['filter']){_0x1cb354[_0x14b1('0x3d')]=_[_0x14b1('0x40')](_0x1cb354['where'],{'$or':_['map'](_0x4f0042,function(_0x473216){if(_0x473216[_0x14b1('0x41')]!==_0x14b1('0x42')){var _0x4316c7={};_0x4316c7[_0x473216[_0x14b1('0x2d')]]={'$like':'%'+_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x43')]+'%'};return _0x4316c7;}})});}_0x1cb354=_[_0x14b1('0x40')]({},_0x1cb354,_0x1c9fd3['options']);var _0x117c5b={'where':_0x1cb354[_0x14b1('0x3d')]};return db[_0x14b1('0x31')]['count'](_0x117c5b)[_0x14b1('0x2b')](function(_0x39c96f){_0x51ac25[_0x14b1('0x25')]=_0x39c96f;if(_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x44')]){_0x1cb354[_0x14b1('0x45')]=[{'all':!![]}];}return db[_0x14b1('0x31')][_0x14b1('0x46')](_0x1cb354);})[_0x14b1('0x2b')](function(_0x13029d){_0x51ac25['rows']=_0x13029d;return _0x51ac25;})['then'](respondWithFilteredResult(_0x5b943e,_0x1cb354))[_0x14b1('0x47')](handleError(_0x5b943e,null));};exports[_0x14b1('0x48')]=function(_0x107be0,_0x2946b8){var _0x304935={'raw':![],'where':{'id':_0x107be0[_0x14b1('0x49')]['id']}},_0x4f96de={};_0x4f96de['model']=_[_0x14b1('0x4a')](db[_0x14b1('0x31')][_0x14b1('0x4b')]);_0x4f96de[_0x14b1('0x34')]=_[_0x14b1('0x4a')](_0x107be0[_0x14b1('0x34')]);_0x4f96de[_0x14b1('0x3f')]=_[_0x14b1('0x35')](_0x4f96de['model'],_0x4f96de[_0x14b1('0x34')]);_0x304935[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x4f96de[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x107be0[_0x14b1('0x34')]['fields']));_0x304935[_0x14b1('0x36')]=_0x304935[_0x14b1('0x36')][_0x14b1('0x38')]?_0x304935[_0x14b1('0x36')]:_0x4f96de[_0x14b1('0x33')];if(_0x107be0['query'][_0x14b1('0x44')]){_0x304935[_0x14b1('0x45')]=[{'all':!![]}];}_0x304935=_['merge']({},_0x304935,_0x107be0['options']);return db['UserProfile'][_0x14b1('0x4c')](_0x304935)[_0x14b1('0x2b')](handleEntityNotFound(_0x2946b8,null))[_0x14b1('0x2b')](respondWithResult(_0x2946b8,null))[_0x14b1('0x47')](handleError(_0x2946b8,null));};exports[_0x14b1('0x4d')]=function(_0x23afe1,_0x4f0e17){return db[_0x14b1('0x31')][_0x14b1('0x4d')](_0x23afe1[_0x14b1('0x4e')],{})['then'](respondWithResult(_0x4f0e17,0xc9))['catch'](handleError(_0x4f0e17,null));};exports[_0x14b1('0x4f')]=function(_0x4884e6,_0x425fa1){var _0x252dba={'where':{'id':_0x4884e6['params']['id']}},_0x3d7199={};_0x3d7199[_0x14b1('0x33')]=_[_0x14b1('0x4a')](db[_0x14b1('0x31')][_0x14b1('0x4b')]);_0x252dba[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x3d7199[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x4884e6[_0x14b1('0x34')][_0x14b1('0x37')]));_0x252dba[_0x14b1('0x36')]=_0x252dba[_0x14b1('0x36')][_0x14b1('0x38')]?_0x252dba[_0x14b1('0x36')]:_0x3d7199[_0x14b1('0x33')];if(_0x4884e6['query'][_0x14b1('0x44')]){_0x252dba[_0x14b1('0x45')]=[{'all':!![]}];}_0x252dba=_[_0x14b1('0x40')]({},_0x252dba,_0x4884e6['options']);return db[_0x14b1('0x31')]['find'](_0x252dba)[_0x14b1('0x2b')](handleEntityNotFound(_0x425fa1,null))['then'](function(_0x7b9832){if(_0x7b9832){var _0x52d3ac=_0x7b9832[_0x14b1('0x50')]({'plain':!![]});_0x52d3ac=qs['omit'](_0x52d3ac,['id',_0x14b1('0x51'),_0x14b1('0x52'),_0x14b1('0x53')]);_0x4884e6['body']=_['omit'](_0x4884e6[_0x14b1('0x4e')],['id','createdAt',_0x14b1('0x52')]);return db['sequelize'][_0x14b1('0x54')](function(_0x521db6){return db[_0x14b1('0x31')][_0x14b1('0x4d')](_[_0x14b1('0x40')](_0x52d3ac,_0x4884e6[_0x14b1('0x4e')]),{'include':_0x4884e6[_0x14b1('0x34')][_0x14b1('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x521db6})[_0x14b1('0x2b')](function(_0x4ab1ff){var _0x58ad92=_0x4ab1ff[_0x14b1('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x14b1('0x46')]({'where':{'userProfileId':_0x4884e6['params']['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x2fd36b){if(_0x2fd36b){return BPromise[_0x14b1('0x55')](_0x2fd36b,function(_0x30f913){return new BPromise(function(_0x2ff755,_0x464be3){if(_0x30f913[_0x14b1('0x56')]===null||_0x30f913[_0x14b1('0x56')]===0x1)_0x2ff755(null);return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x30f913['id']},'raw':!![]})['then'](function(_0x2b8f80){var _0x3ab795=_['map'](_0x2b8f80,function(_0x22ac60){return qs['omit'](_0x22ac60,['id','createdAt',_0x14b1('0x52'),_0x14b1('0x58')]);});_0x2ff755(_0x3ab795);})[_0x14b1('0x47')](function(_0x16b5d6){_0x464be3(_0x16b5d6);});})['then'](function(_0x56c53e){var _0x4a9ba2=qs[_0x14b1('0x59')](_0x30f913,['id',_0x14b1('0x51'),_0x14b1('0x52')]);_0x4a9ba2[_0x14b1('0x5a')]=_0x58ad92['id'];if(_0x56c53e)_0x4a9ba2[_0x14b1('0x5b')]=_0x56c53e;return _0x4a9ba2;})['then'](function(_0x5b8a89){return db[_0x14b1('0x5c')][_0x14b1('0x4d')](_0x5b8a89,{'include':[{'model':db[_0x14b1('0x57')],'as':_0x14b1('0x5b')}],'raw':!![],'transaction':_0x521db6});});})[_0x14b1('0x2b')](function(){return _0x58ad92;});}});});});}})[_0x14b1('0x2b')](respondWithResult(_0x425fa1,0xc9))['catch'](handleError(_0x425fa1,null));};exports['update']=function(_0x252ae7,_0x516984){if(_0x252ae7[_0x14b1('0x4e')]['id']){delete _0x252ae7['body']['id'];}return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x252ae7[_0x14b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x516984,null))[_0x14b1('0x2b')](saveUpdates(_0x252ae7[_0x14b1('0x4e')],null))[_0x14b1('0x2b')](respondWithResult(_0x516984,null))[_0x14b1('0x47')](handleError(_0x516984,null));};exports[_0x14b1('0x5d')]=function(_0x4c7952,_0x13c4a8){return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x4c7952[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x13c4a8,null))[_0x14b1('0x2b')](removeEntity(_0x13c4a8,null))['catch'](handleError(_0x13c4a8,null));};exports[_0x14b1('0x5e')]=function(_0x1d0821,_0x4c3e45){return db[_0x14b1('0x31')][_0x14b1('0x5e')]()[_0x14b1('0x2b')](respondWithResult(_0x4c3e45,null))[_0x14b1('0x47')](handleError(_0x4c3e45,null));};exports[_0x14b1('0x5f')]=function(_0x31041a,_0x411460){var _0x1502ce=_0x31041a[_0x14b1('0x4e')];return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x31041a['params']['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x411460,null))[_0x14b1('0x2b')](function(_0x5095fc){if(_0x5095fc){return db[_0x14b1('0x60')][_0x14b1('0x54')](function(_0x1c416f){return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x31041a[_0x14b1('0x49')]['id'],'sectionId':_['map'](_0x1502ce,function(_0x1be7fd){return _0x1be7fd[_0x14b1('0x58')];})},'transaction':_0x1c416f})[_0x14b1('0x2b')](function(){var _0x59d1d6=_[_0x14b1('0x30')](_0x1502ce,function(_0x2f2004){_0x2f2004[_0x14b1('0x5a')]=_0x31041a[_0x14b1('0x49')]['id'];return _0x2f2004;});var _0x33266d=[];return BPromise[_0x14b1('0x55')](_0x59d1d6,function(_0x357ffb){return db['UserProfileSection'][_0x14b1('0x4d')](_0x357ffb,{'include':[{'model':db[_0x14b1('0x57')],'as':_0x14b1('0x5b')}],'raw':!![],'transaction':_0x1c416f})[_0x14b1('0x2b')](function(_0x4c3982){_0x33266d[_0x14b1('0x61')](_0x4c3982[_0x14b1('0x50')]({'plain':!![]}));});})[_0x14b1('0x2b')](function(){return _0x33266d;});});});}})[_0x14b1('0x2b')](function(_0x160ec6){return _0x160ec6;})[_0x14b1('0x2b')](respondWithResult(_0x411460,null))[_0x14b1('0x47')](handleError(_0x411460,null));};exports['removeSections']=function(_0x1ebca5,_0x15da04){var _0x503c48;return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x1ebca5[_0x14b1('0x49')]['id']},'attributes':['id','name']})[_0x14b1('0x2b')](handleEntityNotFound(_0x15da04,null))['then'](function(_0x1a34e2){if(_0x1a34e2){_0x503c48=_0x1a34e2;return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x1ebca5[_0x14b1('0x49')]['id'],'sectionId':_0x1ebca5['query'][_0x14b1('0x62')]}});}})[_0x14b1('0x2b')](function(){return _0x503c48;})[_0x14b1('0x2b')](respondWithStatusCode(_0x15da04,null))[_0x14b1('0x47')](handleError(_0x15da04,null));};exports[_0x14b1('0x63')]=function(_0x1c79fe,_0x463cb9){var _0x1c9b84=[];var _0x574d2d=[];return db[_0x14b1('0x5c')][_0x14b1('0x46')]({'where':{'userProfileId':_0x1c79fe[_0x14b1('0x49')]['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x223fbf){_0x1c9b84=_[_0x14b1('0x43')](_0x223fbf,function(_0x4972e3){return _0x4972e3[_0x14b1('0x64')]===0x1||_[_0x14b1('0x65')]([0x3eb,0x709],_0x4972e3[_0x14b1('0x58')]);});if(!_['isEmpty'](_0x1c9b84)){return _[_0x14b1('0x30')](_0x1c9b84,function(_0xe62cad){return _0xe62cad[_0x14b1('0x58')];});}else{return;}})[_0x14b1('0x2b')](function(_0x101ff5){if(_0x101ff5)_0x574d2d=_0x101ff5;if(_[_0x14b1('0x65')](_0x574d2d,0x64)){var _0x3b9b75=_[_0x14b1('0x4c')](_0x1c9b84,{'sectionId':0x64});return hasDefaultDashboard(_0x3b9b75)[_0x14b1('0x2b')](function(_0x268d88){return _[_0x14b1('0x30')](_0x1c9b84,function(_0x1d56ad){if(_0x1d56ad[_0x14b1('0x58')]===0x64){_0x1d56ad[_0x14b1('0x66')]=_0x268d88;}return _0x1d56ad;});});}else{return;}})[_0x14b1('0x2b')](function(_0x78cc6d){if(_0x78cc6d)_0x1c9b84=_0x78cc6d;if(_[_0x14b1('0x65')](_0x574d2d,0x3eb)){var _0x25d692=_[_0x14b1('0x4c')](_0x1c9b84,{'sectionId':0x3eb});return getCustomDashboards(_0x25d692)['then'](function(_0x4176ed){return _[_0x14b1('0x30')](_0x1c9b84,function(_0x510f0b){if(_0x25d692['enabled']){if(_0x510f0b[_0x14b1('0x58')]===0x3eb){_0x510f0b[_0x14b1('0x66')]=_0x4176ed;}}else{if(_0x510f0b[_0x14b1('0x58')]===0x64){_0x510f0b[_0x14b1('0x66')]=_0x4176ed;}}return _0x510f0b;});});}else{return;}})[_0x14b1('0x2b')](function(_0x21772e){if(_0x21772e)_0x1c9b84=_0x21772e;if(_[_0x14b1('0x65')](_0x574d2d,0x709)){var _0x215f6e=_['find'](_0x1c9b84,{'sectionId':0x709});return getPlugins(_0x215f6e)[_0x14b1('0x2b')](function(_0x3ba80c){if(_0x215f6e[_0x14b1('0x64')]){return _['map'](_0x1c9b84,function(_0x21eb80){if(_0x21eb80['sectionId']===0x709){_0x21eb80[_0x14b1('0x66')]=_0x3ba80c;}return _0x21eb80;});}else{var _0x32c91f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3ba80c};var _0x4912e5=_[_0x14b1('0x30')](_0x1c9b84);_0x4912e5['push'](_0x32c91f);return _0x4912e5;}});}else{return;}})[_0x14b1('0x2b')](function(_0x538b43){if(_0x538b43)_0x1c9b84=_0x538b43;return _[_0x14b1('0x43')](_0x1c9b84,[_0x14b1('0x64'),0x1]);})['then'](respondWithResult(_0x463cb9,null))[_0x14b1('0x47')](handleError(_0x463cb9,null));};function hasDefaultDashboard(_0x1ac5cd){var _0x4ae655=[0x65];return new BPromise(function(_0xc278f3,_0x1cdec7){try{if(_0x1ac5cd[_0x14b1('0x56')]){_0xc278f3(_0x4ae655);}else{return db[_0x14b1('0x57')][_0x14b1('0x67')]({'where':{'sectionId':_0x1ac5cd['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x406626){_0x406626?_0xc278f3(_0x4ae655):_0xc278f3();});}}catch(_0x24ba13){_0x1cdec7(_0x24ba13);}});}function getCustomDashboards(_0x2b4ca2){var _0x38f445=[];return new BPromise(function(_0x2915a5,_0x49b6b6){try{if(_0x2b4ca2[_0x14b1('0x56')]){return db[_0x14b1('0x68')][_0x14b1('0x46')]({'raw':!![]})[_0x14b1('0x2b')](function(_0x5c5b74){_0x5c5b74[_0x14b1('0x69')](function(_0x3df690){_0x38f445[_0x14b1('0x61')](_0x3df690['id']+0x1869f);});_0x2915a5(_0x38f445);});}else{return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x2b4ca2['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x515a29){_0x515a29[_0x14b1('0x69')](function(_0x5a62bd){_0x38f445[_0x14b1('0x61')](_0x5a62bd[_0x14b1('0x6a')]+0x1869f);});_0x2915a5(_0x38f445);});}}catch(_0x9a8d89){_0x49b6b6(_0x9a8d89);}});}function getPlugins(_0x29d124){var _0x5343a1=[];return new BPromise(function(_0x42866d,_0x1658ec){try{if(_0x29d124[_0x14b1('0x56')]){return db['Plugin']['findAll']({'raw':!![]})[_0x14b1('0x2b')](function(_0xa70c5f){_0xa70c5f[_0x14b1('0x69')](function(_0x1e8ed5){_0x5343a1[_0x14b1('0x61')](_0x1e8ed5['id']+0x15b38);});_0x42866d(_0x5343a1);});}else{return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x29d124['id']},'raw':!![]})['then'](function(_0x49ca28){_0x49ca28['forEach'](function(_0xa4d11c){_0x5343a1[_0x14b1('0x61')](_0xa4d11c[_0x14b1('0x6a')]+0x15b38);});_0x42866d(_0x5343a1);});}}catch(_0x2d9af8){_0x1658ec(_0x2d9af8);}});}exports[_0x14b1('0x6b')]=function(_0x4fad16,_0xae7554){return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x4fad16[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0xae7554,null))[_0x14b1('0x2b')](function(_0xd18a3a){if(_0xd18a3a){return db[_0x14b1('0x60')][_0x14b1('0x54')](function(_0x90861b){return db[_0x14b1('0x5c')]['findAll']({'where':{'userProfileId':_0x4fad16[_0x14b1('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x14b1('0x2b')](function(_0x2865dc){if(_0x2865dc){return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x4fad16['params']['id'],'id':_['map'](_0x2865dc,function(_0x4759c1){return _0x4759c1['id'];})},'transaction':_0x90861b});}})[_0x14b1('0x2b')](function(_0x175984){var _0x1098c6=_['map'](_0x4fad16[_0x14b1('0x4e')],function(_0x4f5252){_0x4f5252[_0x14b1('0x5a')]=_0x4fad16[_0x14b1('0x49')]['id'];return _0x4f5252;});return db['UserProfileSection'][_0x14b1('0x6c')](_0x1098c6,{'raw':!![],'transaction':_0x90861b});})[_0x14b1('0x2b')](function(_0xbc0710){var _0x113339=_['filter'](_['map'](_0xbc0710,function(_0x790290){return _0x790290[_0x14b1('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x113339){return db[_0x14b1('0x5c')]['findAll']({'where':{'userProfileId':_0x4fad16[_0x14b1('0x49')]['id'],'sectionId':_['map'](_0x113339,function(_0x378596){return _0x378596[_0x14b1('0x58')];})},'attributes':['id',_0x14b1('0x58')],'raw':!![]})[_0x14b1('0x2b')](function(_0x299ca8){var _0x52cdce=_['map'](_0x4fad16[_0x14b1('0x4e')],function(_0x1f9cfe){_0x1f9cfe['userProfileId']=_0x4fad16[_0x14b1('0x49')]['id'];return _0x1f9cfe;});return db[_0x14b1('0x57')][_0x14b1('0x6c')](_0x52cdce,{'raw':!![],'transaction':_0x90861b});});}})[_0x14b1('0x47')](handleError(_0xae7554,null));});}})[_0x14b1('0x2b')](function(_0x27378f){var _0x50f3e7=_['map'](_0x27378f,function(_0x5613c3){return _0x5613c3[_0x14b1('0x50')]({'plain':!![]});});})['then'](respondWithResult(_0xae7554,null))[_0x14b1('0x47')](handleError(_0xae7554,null));};exports['removeResources']=function(_0x504c3f,_0x30427e,_0x34dddd){return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x504c3f[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x30427e,null))[_0x14b1('0x2b')](function(_0xc0b385){if(_0xc0b385){return _0xc0b385[_0x14b1('0x6d')](_0x504c3f[_0x14b1('0x34')][_0x14b1('0x62')]);}})['then'](respondWithStatusCode(_0x30427e,null))[_0x14b1('0x47')](handleError(_0x30427e,null));};exports[_0x14b1('0x6e')]=function(_0xbac603,_0x374a56){var _0x17f085={};if(!_0xbac603[_0x14b1('0x34')][_0x14b1('0x6f')])throw new Error(_0x14b1('0x70'));if(!_0xbac603[_0x14b1('0x34')][_0x14b1('0x39')](_0x14b1('0x3a'))){_0x17f085[_0x14b1('0x24')]=qs[_0x14b1('0x24')](_0xbac603[_0x14b1('0x34')]['limit']);_0x17f085['offset']=qs[_0x14b1('0x22')](_0xbac603[_0x14b1('0x34')]['offset']);}return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0xbac603[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](function(_0x55a4c0){if(!_0x55a4c0)throw new Error(_0x14b1('0x71')+_0xbac603[_0x14b1('0x49')]['id']);return db[_0x14b1('0x31')][_0x14b1('0x6e')](_0xbac603);})[_0x14b1('0x2b')](respondWithFilteredResult(_0x374a56,_0x17f085))[_0x14b1('0x47')](handleError(_0x374a56,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f84d872..af44dfc 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 _0x975b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x975b,0x1c9));var _0xb975=function(_0xfc273e,_0x57bb39){_0xfc273e=_0xfc273e-0x0;var _0x34656d=_0x975b[_0xfc273e];return _0x34656d;};'use strict';var EventEmitter=require(_0xb975('0x0'));var UserProfile=require(_0xb975('0x1'))['db'][_0xb975('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb975('0x3')](0x0);var events={'afterCreate':_0xb975('0x4'),'afterUpdate':_0xb975('0x5'),'afterDestroy':_0xb975('0x6')};function emitEvent(_0x5e662b){return function(_0xa92c72,_0xfb173,_0x2007e4){UserProfileEvents[_0xb975('0x7')](_0x5e662b+':'+_0xa92c72['id'],_0xa92c72);UserProfileEvents[_0xb975('0x7')](_0x5e662b,_0xa92c72);_0x2007e4(null);};}for(var e in events){if(events[_0xb975('0x8')](e)){var event=events[e];UserProfile[_0xb975('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x1228=['UserProfile','save','update','remove','emit','hook','exports','events'];(function(_0x3bf802,_0x2043c0){var _0x5b820a=function(_0x1f57d9){while(--_0x1f57d9){_0x3bf802['push'](_0x3bf802['shift']());}};_0x5b820a(++_0x2043c0);}(_0x1228,0x12f));var _0x8122=function(_0x2923b8,_0x1dba92){_0x2923b8=_0x2923b8-0x0;var _0x25659a=_0x1228[_0x2923b8];return _0x25659a;};'use strict';var EventEmitter=require(_0x8122('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x8122('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8122('0x2'),'afterUpdate':_0x8122('0x3'),'afterDestroy':_0x8122('0x4')};function emitEvent(_0x49a540){return function(_0x762ce4,_0xf4d3e5,_0x4de3a0){UserProfileEvents[_0x8122('0x5')](_0x49a540+':'+_0x762ce4['id'],_0x762ce4);UserProfileEvents[_0x8122('0x5')](_0x49a540,_0x762ce4);_0x4de3a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x8122('0x6')](e,emitEvent(event));}}module[_0x8122('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 75991b4..70fe634 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c60=['rows','count','CmContact','tag','ThroughTags','color','openTabs','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','filter','field','value','findAll','then','model','associatedResources','map','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','contacts','Lists','ListId','lists','CmList','companies','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','user','Telephones','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','plugins','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','sequelize','query','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','push','UserProfileSection','find','params','all','ignore','isEmpty','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','pick','key','foreignKey','forEach','merge','includeAll','include','default','DefaultReports','custom','CustomReports'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x4c60,0xc1));var _0x04c6=function(_0x4a0892,_0x36bf56){_0x4a0892=_0x4a0892-0x0;var _0x5772d6=_0x4c60[_0x4a0892];return _0x5772d6;};'use strict';var _=require(_0x04c6('0x0'));var attributes=require(_0x04c6('0x1'));var qs=require(_0x04c6('0x2'));var squel=require(_0x04c6('0x3'));module['exports']=function(_0x2a1d36){var _0x5d9fa3=_0x2a1d36['models'];function _0x4ad4f1(_0x53ca7a,_0x3a9493){return new Promise(function(_0xc6e772,_0x2054da){if(!_0x3a9493)return _0xc6e772(null);var _0x12bd5d=_0x3a9493[_0x04c6('0x4')]?{[_0x3a9493[_0x04c6('0x4')][_0x04c6('0x5')]]:_0x3a9493['filter'][_0x04c6('0x6')]}:undefined;return _0x5d9fa3[_0x53ca7a][_0x04c6('0x7')]({'where':_0x12bd5d,'raw':!![]})[_0x04c6('0x8')](function(_0x30b901){_0x3a9493['associatedResources']=_['map'](_0x30b901,'id');_0xc6e772(_0x3a9493);})['catch'](function(_0x376da8){_0x2054da(_0x376da8);});});}function _0x5584cd(_0x15d31a,_0x2772fa){return new Promise(function(_0x5236c8,_0x4316f8){var _0x19eb01=_0x15d31a[_0x04c6('0x4')]?{[_0x15d31a[_0x04c6('0x4')]['field']]:_0x15d31a[_0x04c6('0x4')][_0x04c6('0x6')]}:undefined;return _0x5d9fa3[_0x15d31a[_0x04c6('0x9')]]['findAll']({'where':_0x19eb01,'raw':!![]})[_0x04c6('0x8')](function(_0x15cbe0){_0x2772fa[_0x04c6('0xa')]=_[_0x04c6('0xb')](_0x15cbe0,function(_0x4760f8){return _0x4760f8[_0x04c6('0xc')];});_0x5236c8(_0x2772fa);})[_0x04c6('0xd')](function(_0x3d46a9){_0x4316f8(_0x3d46a9);});});}function _0x5a5a66(_0x31edf9,_0xa2bc92,_0x382e58){if(!_0xa2bc92)return Promise[_0x04c6('0xe')](null);return new Promise(function(_0x43596a,_0xfb4db5){return _0x5d9fa3[_0x04c6('0xf')][_0x04c6('0x7')]({'where':{'sectionId':_0xa2bc92['id']},'raw':!![]})['then'](function(_0x142065){if(_0x31edf9[_0x04c6('0x5')]&&_0x31edf9[_0x04c6('0x5')]!=='id'){_0xa2bc92['associatedResources']=_['map'](_0x142065,function(_0x53ac86){return _0x53ac86[_0x31edf9[_0x04c6('0x5')]];});}else{if(_0x382e58===_0x04c6('0x10')){_0xa2bc92['associatedResources']=_['map'](_0x142065,function(_0x1e6854){return{'id':_0x1e6854[_0x04c6('0x11')],'type':_0x1e6854[_0x04c6('0x12')]};});}else{_0xa2bc92['associatedResources']=_[_0x04c6('0xb')](_0x142065,function(_0x13f2dc){return _0x13f2dc[_0x04c6('0x11')];});}}_0x43596a(_0xa2bc92);})['catch'](function(_0x2d3277){_0xfb4db5(_0x2d3277);});});}function _0x41e29f(_0x562491,_0x54a8b0){var _0x4c8d72={'parentSections':[]};switch(_0x562491[_0x04c6('0x13')]()){case _0x04c6('0x14'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x16');break;case _0x04c6('0x17'):_0x4c8d72['childModel']='SquareOdbc';break;case _0x04c6('0x18'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x19');_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x1b'),'field':_0x04c6('0xc'),'foreignKey':'projectName'}];break;case _0x04c6('0x1c'):_0x4c8d72[_0x04c6('0x15')]='JscriptyProject';break;case _0x04c6('0x1d'):_0x4c8d72[_0x04c6('0x15')]='CmContact';_0x4c8d72['parentSections']=[{'name':_0x04c6('0x1e'),'field':'id','foreignKey':_0x04c6('0x1f')}];break;case _0x04c6('0x20'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x21');break;case _0x04c6('0x22'):_0x4c8d72['childModel']='CmCompany';break;case'globalcustomfields':_0x4c8d72[_0x04c6('0x15')]='CmCustomField';break;case _0x04c6('0x23'):_0x4c8d72[_0x04c6('0x15')]='ChatQueue';break;case _0x04c6('0x24'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x25');break;case _0x04c6('0x26'):_0x4c8d72['childModel']=_0x04c6('0x27');break;case _0x04c6('0x28'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x29');break;case _0x04c6('0x2a'):case _0x04c6('0x2b'):case _0x04c6('0x2c'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x2d');break;case _0x04c6('0x2e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x2f');break;case _0x04c6('0x30'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x31');break;case'voicerecordings':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x32');_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x33'),'field':'name','foreignKey':_0x04c6('0x34'),'model':_0x04c6('0x35'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0x04c6('0xc'),'foreignKey':_0x04c6('0x34'),'model':'User','filter':{'field':_0x04c6('0x36'),'value':['telephone']}},{'name':_0x04c6('0x37'),'field':_0x04c6('0xc'),'foreignKey':_0x04c6('0x38'),'model':_0x04c6('0x39'),'filter':{'field':'type','value':['inbound']}},{'name':_0x04c6('0x3a'),'field':_0x04c6('0xc'),'foreignKey':'queue','model':_0x04c6('0x39'),'filter':{'field':'type','value':['outbound']}}];break;case _0x04c6('0x3b'):_0x4c8d72['childModel']=_0x04c6('0x3c');break;case _0x04c6('0x3d'):_0x4c8d72['childModel']=_0x04c6('0x3e');break;case'voiceprefixes':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x3f');break;case _0x04c6('0x40'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x41');break;case'mailqueues':_0x4c8d72[_0x04c6('0x15')]='MailQueue';break;case _0x04c6('0x42'):_0x4c8d72['childModel']=_0x04c6('0x43');break;case _0x04c6('0x44'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x45');break;case _0x04c6('0x46'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x47');break;case'openchannelaccounts':_0x4c8d72[_0x04c6('0x15')]='OpenchannelAccount';break;case _0x04c6('0x48'):_0x4c8d72['childModel']='SmsQueue';break;case _0x04c6('0x49'):_0x4c8d72['childModel']=_0x04c6('0x4a');break;case _0x04c6('0x4b'):_0x4c8d72[_0x04c6('0x15')]='WhatsappQueue';break;case _0x04c6('0x4c'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x4d');break;case _0x04c6('0x4e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x4f');break;case _0x04c6('0x50'):case'queuecampaigns':_0x4c8d72['childModel']=_0x04c6('0x39');if(_0x54a8b0){_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x37')},{'name':'QueueCampaigns'}];}break;case _0x04c6('0x51'):case _0x04c6('0x52'):case _0x04c6('0x53'):_0x4c8d72['childModel']='User';if(_0x54a8b0){_0x4c8d72['parentSections']=[{'name':_0x04c6('0x54'),'filter':{'field':_0x04c6('0x36'),'value':['admin',_0x04c6('0x55')]},'ignore':!![]},{'name':_0x04c6('0x33')},{'name':_0x04c6('0x56')}];}break;case'zendeskaccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x57');break;case'salesforceaccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x58');break;case _0x04c6('0x59'):_0x4c8d72[_0x04c6('0x15')]='FreshdeskAccount';break;case _0x04c6('0x5a'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x5b');break;case _0x04c6('0x5c'):_0x4c8d72['childModel']=_0x04c6('0x5d');break;case _0x04c6('0x5e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x5f');break;case'vtigeraccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x35');break;case _0x04c6('0x60'):_0x4c8d72['childModel']=_0x04c6('0x61');break;case _0x04c6('0x62'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x63');break;case _0x04c6('0x64'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x65');break;case _0x04c6('0x66'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x67');break;case _0x04c6('0x68'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x69');break;case'scheduler':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6a');break;case _0x04c6('0x6b'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6c');break;case'tags':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6d');break;case _0x04c6('0x6e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6f');break;case _0x04c6('0x70'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x71');break;case _0x04c6('0x72'):_0x4c8d72[_0x04c6('0x15')]='Trunk';break;case'variables':_0x4c8d72['childModel']='Variable';break;case _0x04c6('0x73'):_0x4c8d72['childModel']=_0x04c6('0x74');break;case'extractedreports':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x10');_0x4c8d72['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x04c6('0x75')}];break;case _0x04c6('0x76'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x77');break;}return _0x4c8d72;}function _0x583b3c(_0x2fb324,_0xf4e9d6){var _0x216cb0=_0x2fb324[_0x04c6('0x78')](0x0)[_0x04c6('0x79')]()+_0x2fb324[_0x04c6('0x7a')](0x1);var _0x145854={'type':_0x5d9fa3['Sequelize'][_0x04c6('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x4336a3,_0x3bbd8b){var _0x4bcdab=squel[_0x04c6('0x7c')]()[_0x04c6('0x5')](_0x04c6('0x7d')+_0x216cb0+_0x04c6('0x7e'),'id')[_0x04c6('0x5')](_0x04c6('0x7f'))[_0x04c6('0x80')](_0x04c6('0x81')+_0x2fb324+'_interactions','ui')[_0x04c6('0x82')]('ui.UserId\x20=\x20?',_0xf4e9d6['id']);return _0x5d9fa3[_0x04c6('0x83')][_0x04c6('0x84')](_0x4bcdab['toString'](),_0x145854)['then'](function(_0x2e649d){_0xf4e9d6[_0x216cb0+'OpenTabs']=_0x2e649d;_0x4336a3(_0x2e649d);})[_0x04c6('0xd')](function(_0x4530de){_0x3bbd8b(_0x4530de);});});}return _0x2a1d36['define'](_0x04c6('0x85'),attributes,{'tableName':_0x04c6('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xae0006){var _0x1cc1a1={'raw':![],'where':{}};var _0x2be139={};var _0xd12535={'count':0x0,'rows':[]};var _0x3e5a53=_0xae0006[_0x04c6('0x84')][_0x04c6('0x87')];var _0x129731=_0xae0006[_0x04c6('0x84')]['mergeResources']||![];var _0x3aaa1e=_0x41e29f(_0x3e5a53,_0x129731);if(!_0x3aaa1e[_0x04c6('0x15')])throw new Error(_0x04c6('0x88')+_0x3e5a53+'\x27');var _0x12394f=[{'name':_0x3e5a53}];if(!_['isEmpty'](_0x3aaa1e[_0x04c6('0x1a')]))_0x12394f=_0x3aaa1e[_0x04c6('0x1a')];var _0x1b38d1=[];for(var _0x49be80=0x0;_0x49be80<_0x12394f['length'];_0x49be80++){_0x1b38d1[_0x04c6('0x89')](_0x5d9fa3[_0x04c6('0x8a')][_0x04c6('0x8b')]({'where':{'userProfileId':_0xae0006[_0x04c6('0x8c')]['id'],'name':_0x12394f[_0x49be80][_0x04c6('0xc')]},'raw':!![]}));}return Promise[_0x04c6('0x8d')](_0x1b38d1)['then'](function(_0x375159){var _0x173df7=_[_0x04c6('0x4')](_0x375159,function(_0x596ac0){return _0x596ac0?_0x596ac0:undefined;});var _0x4f0850=_[_0x04c6('0x4')](_0x12394f,[_0x04c6('0x8e'),!![]]);var _0x1c62da=_[_0x04c6('0x8f')](_0x173df7)&&_['isEmpty'](_0x4f0850)?null:_[_0x04c6('0x90')](_0x4f0850,_0x173df7);if(!_0x1c62da)return null;var _0x4d4e50=[];for(var _0x5b5b09=0x0;_0x5b5b09<_0x1c62da[_0x04c6('0x91')];_0x5b5b09++){var _0xe178dd=_[_0x04c6('0x8b')](_0x12394f,function(_0x1904d4){return _0x1c62da[_0x5b5b09]?_0x1904d4[_0x04c6('0xc')]===_0x1c62da[_0x5b5b09][_0x04c6('0xc')]:null;});if(_0xe178dd){if(_0x1c62da[_0x5b5b09][_0x04c6('0x8e')]){_0x4d4e50['push'](_0x4ad4f1(_0x3aaa1e[_0x04c6('0x15')],_0x1c62da[_0x5b5b09]));}else{if(!_0x1c62da[_0x5b5b09][_0x04c6('0x92')]){_0x4d4e50[_0x04c6('0x89')](_0x5a5a66(_0xe178dd,_0x1c62da[_0x5b5b09],_0x3aaa1e[_0x04c6('0x15')]));}else{if(_0xe178dd[_0x04c6('0x9')]){_0x4d4e50['push'](_0x5584cd(_0xe178dd,_0x1c62da[_0x5b5b09]));}}}}}return Promise['all'](_0x4d4e50);})[_0x04c6('0x8')](function(_0x598941){var _0x2df63b=_0x598941;var _0x518e4e=null;if(_0x2df63b){_0x518e4e=_0x2df63b[_0x04c6('0x91')]===0x1?_0x2df63b[0x0]:null;}if(!_0x518e4e&&!_0x2df63b)return _0xd12535;var _0x467f3b=_0x5d9fa3[_0x3aaa1e['childModel']][_0x04c6('0x93')];_0x2be139[_0x04c6('0x9')]=_[_0x04c6('0x94')](_0x467f3b);_0x2be139[_0x04c6('0x84')]=_[_0x04c6('0x94')](_0xae0006[_0x04c6('0x84')]);_0x2be139[_0x04c6('0x95')]=_[_0x04c6('0x96')](_0x2be139[_0x04c6('0x9')],_0x2be139[_0x04c6('0x84')]);_0x1cc1a1[_0x04c6('0x97')]=_[_0x04c6('0x96')](_0x2be139[_0x04c6('0x9')],qs['fields'](_0xae0006[_0x04c6('0x84')][_0x04c6('0x98')]));_0x1cc1a1['attributes']=_0x1cc1a1[_0x04c6('0x97')][_0x04c6('0x91')]?_0x1cc1a1[_0x04c6('0x97')]:_0x2be139[_0x04c6('0x9')];if(!_0xae0006[_0x04c6('0x84')]['hasOwnProperty'](_0x04c6('0x99'))){_0x1cc1a1['limit']=qs[_0x04c6('0x9a')](_0xae0006['query'][_0x04c6('0x9a')]);_0x1cc1a1[_0x04c6('0x9b')]=qs[_0x04c6('0x9b')](_0xae0006[_0x04c6('0x84')][_0x04c6('0x9b')]);}_0x1cc1a1[_0x04c6('0x9c')]=qs[_0x04c6('0x9d')](_0xae0006[_0x04c6('0x84')][_0x04c6('0x9d')]);_0x1cc1a1['where']=qs[_0x04c6('0x95')](_[_0x04c6('0x9e')](_0xae0006['query'],_0x2be139[_0x04c6('0x95')]));if(_0xae0006['query'][_0x04c6('0x4')]){_0x1cc1a1[_0x04c6('0x82')]=_['merge'](_0x1cc1a1[_0x04c6('0x82')],{'$or':_[_0x04c6('0xb')](_0x467f3b,function(_0x5bdad4){if(_0x5bdad4[_0x04c6('0x12')][_0x04c6('0x9f')]!=='VIRTUAL'){var _0x7b9132={};_0x7b9132[_0x5bdad4[_0x04c6('0x5')]]={'$like':'%'+_0xae0006['query'][_0x04c6('0x4')]+'%'};return _0x7b9132;}})});}var _0x186aa0=[];var _0x4f02d9=null;var _0x5314ee={};if(_0x518e4e){_0x4f02d9=_['find'](_0x12394f,[_0x04c6('0xc'),_0x518e4e[_0x04c6('0xc')]]);if(_0x4f02d9[_0x04c6('0x5')]){_0x5314ee={};if(_0x3aaa1e[_0x04c6('0x15')]===_0x04c6('0x10')){_0x5314ee[_0x4f02d9['foreignKey']]=_[_0x04c6('0xb')](_0x518e4e[_0x04c6('0xa')],'id');}else{_0x5314ee[_0x4f02d9[_0x04c6('0xa0')]]=_0x518e4e[_0x04c6('0xa')];}_0x186aa0[_0x04c6('0x89')](_0x5314ee);}else{_0x1cc1a1[_0x04c6('0x82')]['id']=_0x518e4e[_0x04c6('0xa')];}}else{for(var _0x51858a=0x0;_0x51858a<_0x2df63b[_0x04c6('0x91')];_0x51858a++){_0x4f02d9=_['find'](_0x12394f,[_0x04c6('0xc'),_0x2df63b[_0x51858a]['name']]);if(_0x4f02d9['field']){_0x5314ee={};_0x5314ee[_0x4f02d9[_0x04c6('0xa0')]]=_0x2df63b[_0x51858a]['associatedResources'];_0x186aa0[_0x04c6('0x89')](_0x5314ee);}else{if(!_0x1cc1a1[_0x04c6('0x82')]['id'])_0x1cc1a1[_0x04c6('0x82')]['id']=[];_0x2df63b[_0x51858a][_0x04c6('0xa')][_0x04c6('0xa1')](function(_0x48fbdd){_0x1cc1a1['where']['id'][_0x04c6('0x89')](_0x48fbdd);});}}}if(!_[_0x04c6('0x8f')](_0x186aa0)){_0x1cc1a1[_0x04c6('0x82')]=_[_0x04c6('0xa2')](_0x1cc1a1[_0x04c6('0x82')],{'$and':{'$or':_0x186aa0}});}_0x1cc1a1=_[_0x04c6('0xa2')]({},_0x1cc1a1,_0xae0006['options']);if(_0x518e4e&&!_0x518e4e[_0x04c6('0x92')]&&_0x3aaa1e['childModel']==='AnalyticExtractedReport'){if(_0xae0006[_0x04c6('0x84')][_0x04c6('0xa3')]){_0x1cc1a1[_0x04c6('0xa4')]=[{'all':!![]}];}return _0x5d9fa3[_0x3aaa1e[_0x04c6('0x15')]][_0x04c6('0x7')](_0x1cc1a1)[_0x04c6('0x8')](function(_0x2e65f0){var _0x243553=[];_0x2e65f0[_0x04c6('0xa1')](function(_0x3dd78e){var _0x21dc7c;switch(_0x3dd78e['reportType']){case _0x04c6('0xa5'):_0x21dc7c=_['find'](_0x518e4e['associatedResources'],function(_0x38164e){return _0x38164e['id']===_0x3dd78e[_0x04c6('0x75')]&&_0x38164e[_0x04c6('0x12')]===_0x04c6('0xa6');});break;case _0x04c6('0xa7'):_0x21dc7c=_[_0x04c6('0x8b')](_0x518e4e[_0x04c6('0xa')],function(_0x383437){return _0x383437['id']===_0x3dd78e[_0x04c6('0x75')]&&_0x383437[_0x04c6('0x12')]===_0x04c6('0xa8');});break;}if(_0x21dc7c)_0x243553['push'](_0x3dd78e);});_0xd12535['count']=_0x243553[_0x04c6('0x91')];_0xd12535[_0x04c6('0xa9')]=_0x243553;return _0xd12535;});}else{return _0x5d9fa3[_0x3aaa1e['childModel']][_0x04c6('0xaa')]({'where':_0x1cc1a1[_0x04c6('0x82')]})['then'](function(_0x4504fc){_0xd12535[_0x04c6('0xaa')]=_0x4504fc;if(_0xae0006[_0x04c6('0x84')][_0x04c6('0xa3')]){if(_0x3aaa1e[_0x04c6('0x15')]===_0x04c6('0xab')){_0x1cc1a1[_0x04c6('0xa4')]=[{'model':_0x5d9fa3[_0x04c6('0x6d')],'as':'Tags','attributes':['id',_0x04c6('0xc'),'color'],'required':_0xae0006[_0x04c6('0x84')][_0x04c6('0xac')]?!![]:![]},{'model':_0x5d9fa3[_0x04c6('0x6d')],'as':_0x04c6('0xad'),'attributes':['id',_0x04c6('0xc'),_0x04c6('0xae')],'through':_0xae0006['query'][_0x04c6('0xac')]?{'attributes':[],'where':{'TagId':_0xae0006[_0x04c6('0x84')][_0x04c6('0xac')]||undefined}}:{},'required':_0xae0006['query']['tag']?!![]:![]}];}else{_0x1cc1a1['include']=[{'all':!![]}];}}return _0x5d9fa3[_0x3aaa1e[_0x04c6('0x15')]][_0x04c6('0x7')](_0x1cc1a1);})['then'](function(_0xd17fa3){_0xd12535[_0x04c6('0xa9')]=_0xd17fa3;if(_0x3e5a53===_0x04c6('0x33')&&_0xae0006['query'][_0x04c6('0xaf')]==='true'){var _0x1c0c74=[];for(var _0x3a1b76=0x0;_0x3a1b76<_0xd12535[_0x04c6('0xa9')]['length'];_0x3a1b76++){_0x1c0c74['push'](_0x583b3c(_0x04c6('0xb0'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c('sms',_0xd12535['rows'][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb2'),_0xd12535['rows'][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb3'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb4'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c('whatsapp',_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));}return Promise[_0x04c6('0x8d')](_0x1c0c74)[_0x04c6('0x8')](function(){return _0xd12535;});}return _0xd12535;});}});}}});}; \ No newline at end of file +var _0x3e24=['squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','VoiceQueue','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','merge','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','autoAssociation','includeAll','include','default','CustomReports','count','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','map','catch','field','model','findAll','associatedResources','name','resolve','UserProfileResource','resourceId','type','toLowerCase'];(function(_0x3f5d69,_0x39e054){var _0x14f758=function(_0x1cd3c1){while(--_0x1cd3c1){_0x3f5d69['push'](_0x3f5d69['shift']());}};_0x14f758(++_0x39e054);}(_0x3e24,0x167));var _0x43e2=function(_0x419ffd,_0x10bdfe){_0x419ffd=_0x419ffd-0x0;var _0xb0b19d=_0x3e24[_0x419ffd];return _0xb0b19d;};'use strict';var _=require(_0x43e2('0x0'));var attributes=require(_0x43e2('0x1'));var qs=require(_0x43e2('0x2'));var squel=require(_0x43e2('0x3'));module[_0x43e2('0x4')]=function(_0x582ca4){var _0x2f7153=_0x582ca4[_0x43e2('0x5')];function _0x5d2806(_0x1dd127,_0x18629c){return new Promise(function(_0x1a89fc,_0x28b144){if(!_0x18629c)return _0x1a89fc(null);var _0x43b5a7=_0x18629c[_0x43e2('0x6')]?{[_0x18629c[_0x43e2('0x6')]['field']]:_0x18629c[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x1dd127]['findAll']({'where':_0x43b5a7,'raw':!![]})[_0x43e2('0x8')](function(_0x2fdf85){_0x18629c['associatedResources']=_[_0x43e2('0x9')](_0x2fdf85,'id');_0x1a89fc(_0x18629c);})[_0x43e2('0xa')](function(_0x52146c){_0x28b144(_0x52146c);});});}function _0x45848e(_0x48c5f3,_0x547723){return new Promise(function(_0x5847f0,_0x103220){var _0x33dbcb=_0x48c5f3[_0x43e2('0x6')]?{[_0x48c5f3[_0x43e2('0x6')][_0x43e2('0xb')]]:_0x48c5f3[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x48c5f3[_0x43e2('0xc')]][_0x43e2('0xd')]({'where':_0x33dbcb,'raw':!![]})[_0x43e2('0x8')](function(_0x377097){_0x547723[_0x43e2('0xe')]=_['map'](_0x377097,function(_0x376bba){return _0x376bba[_0x43e2('0xf')];});_0x5847f0(_0x547723);})[_0x43e2('0xa')](function(_0x2a0fb0){_0x103220(_0x2a0fb0);});});}function _0x5cea01(_0x4a6443,_0x241da2,_0x417ce5){if(!_0x241da2)return Promise[_0x43e2('0x10')](null);return new Promise(function(_0x3a27eb,_0x105cb8){return _0x2f7153[_0x43e2('0x11')][_0x43e2('0xd')]({'where':{'sectionId':_0x241da2['id']},'raw':!![]})[_0x43e2('0x8')](function(_0x3236b9){if(_0x4a6443[_0x43e2('0xb')]&&_0x4a6443['field']!=='id'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x4de509){return _0x4de509[_0x4a6443[_0x43e2('0xb')]];});}else{if(_0x417ce5==='AnalyticExtractedReport'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x1fac53){return{'id':_0x1fac53[_0x43e2('0x12')],'type':_0x1fac53[_0x43e2('0x13')]};});}else{_0x241da2['associatedResources']=_[_0x43e2('0x9')](_0x3236b9,function(_0x12d842){return _0x12d842[_0x43e2('0x12')];});}}_0x3a27eb(_0x241da2);})['catch'](function(_0x234a1d){_0x105cb8(_0x234a1d);});});}function _0x32f048(_0x43078f,_0x11b285){var _0x4f20e6={'parentSections':[]};switch(_0x43078f[_0x43e2('0x14')]()){case _0x43e2('0x15'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x17');break;case _0x43e2('0x18'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x19');break;case _0x43e2('0x1a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x1b');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x1d'),'field':'name','foreignKey':_0x43e2('0x1e')}];break;case _0x43e2('0x1f'):_0x4f20e6['childModel']=_0x43e2('0x20');break;case _0x43e2('0x21'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x22');_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x43e2('0x23')}];break;case _0x43e2('0x24'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x25');break;case _0x43e2('0x26'):_0x4f20e6[_0x43e2('0x16')]='CmCompany';break;case'globalcustomfields':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x27');break;case _0x43e2('0x28'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x29');break;case'chatwebsites':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2a');break;case _0x43e2('0x2b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2c');break;case _0x43e2('0x2d'):_0x4f20e6[_0x43e2('0x16')]='FaxAccount';break;case'inboundroutes':case _0x43e2('0x2e'):case _0x43e2('0x2f'):_0x4f20e6['childModel']=_0x43e2('0x30');break;case _0x43e2('0x31'):_0x4f20e6['childModel']=_0x43e2('0x32');break;case'voicemails':_0x4f20e6['childModel']='VoiceMail';break;case _0x43e2('0x33'):_0x4f20e6['childModel']=_0x43e2('0x34');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x35'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x39')]}},{'name':_0x43e2('0x3a'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x3b')]}},{'name':_0x43e2('0x3c'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x3d'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x43e2('0x3e'),'field':_0x43e2('0xf'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x43e2('0x13'),'value':[_0x43e2('0x3f')]}}];break;case _0x43e2('0x40'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x41');break;case _0x43e2('0x42'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x43');break;case _0x43e2('0x44'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x45');break;case _0x43e2('0x46'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x47');break;case'mailqueues':_0x4f20e6[_0x43e2('0x16')]='MailQueue';break;case _0x43e2('0x48'):_0x4f20e6['childModel']=_0x43e2('0x49');break;case _0x43e2('0x4a'):_0x4f20e6[_0x43e2('0x16')]='MailSubstatus';break;case _0x43e2('0x4b'):_0x4f20e6['childModel']=_0x43e2('0x4c');break;case _0x43e2('0x4d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x4e');break;case'smsqueues':_0x4f20e6['childModel']=_0x43e2('0x4f');break;case _0x43e2('0x50'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x51');break;case'whatsappqueues':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x52');break;case _0x43e2('0x53'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x54');break;case'teams':_0x4f20e6[_0x43e2('0x16')]='Team';break;case _0x43e2('0x55'):case _0x43e2('0x56'):_0x4f20e6['childModel']=_0x43e2('0x57');if(_0x11b285){_0x4f20e6['parentSections']=[{'name':'VoiceQueues'},{'name':_0x43e2('0x3e')}];}break;case _0x43e2('0x58'):case _0x43e2('0x59'):case _0x43e2('0x5a'):_0x4f20e6[_0x43e2('0x16')]='User';if(_0x11b285){_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x5b'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x5c'),_0x43e2('0x5d')]},'ignore':!![]},{'name':_0x43e2('0x35')},{'name':_0x43e2('0x3a')}];}break;case _0x43e2('0x5e'):_0x4f20e6['childModel']=_0x43e2('0x5f');break;case _0x43e2('0x60'):_0x4f20e6['childModel']=_0x43e2('0x61');break;case _0x43e2('0x62'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x63');break;case'sugarcrmaccounts':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x64');break;case _0x43e2('0x65'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x66');break;case'zohoaccounts':_0x4f20e6['childModel']=_0x43e2('0x67');break;case _0x43e2('0x68'):_0x4f20e6['childModel']=_0x43e2('0x37');break;case _0x43e2('0x69'):_0x4f20e6[_0x43e2('0x16')]='CannedAnswer';break;case'dispositions':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6a');break;case _0x43e2('0x6b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6c');break;case _0x43e2('0x6d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6e');break;case _0x43e2('0x6f'):_0x4f20e6['childModel']=_0x43e2('0x70');break;case'scheduler':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x71');break;case _0x43e2('0x72'):_0x4f20e6['childModel']=_0x43e2('0x73');break;case _0x43e2('0x74'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x75');break;case _0x43e2('0x76'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x77');break;case _0x43e2('0x78'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x79');break;case _0x43e2('0x7a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7b');break;case'variables':_0x4f20e6['childModel']='Variable';break;case'plugins':_0x4f20e6['childModel']='Plugin';break;case _0x43e2('0x7c'):_0x4f20e6['childModel']='AnalyticExtractedReport';_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0x43e2('0x7d')}];break;case'metrics':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7e');break;}return _0x4f20e6;}function _0x1d8647(_0x4cfd0b,_0x21d35d){var _0x13685a=_0x4cfd0b[_0x43e2('0x7f')](0x0)[_0x43e2('0x80')]()+_0x4cfd0b[_0x43e2('0x81')](0x1);var _0x238517={'type':_0x2f7153['Sequelize'][_0x43e2('0x82')][_0x43e2('0x83')],'raw':!![]};return new Promise(function(_0x5b4161,_0x2a795d){var _0x57c7b3=squel['select']()['field']('ui.'+_0x13685a+'InteractionId','id')[_0x43e2('0xb')](_0x43e2('0x84'))[_0x43e2('0x85')](_0x43e2('0x86')+_0x4cfd0b+'_interactions','ui')['where'](_0x43e2('0x87'),_0x21d35d['id']);return _0x2f7153[_0x43e2('0x88')][_0x43e2('0x89')](_0x57c7b3[_0x43e2('0x8a')](),_0x238517)[_0x43e2('0x8')](function(_0x25037d){_0x21d35d[_0x13685a+_0x43e2('0x8b')]=_0x25037d;_0x5b4161(_0x25037d);})[_0x43e2('0xa')](function(_0x2eb2aa){_0x2a795d(_0x2eb2aa);});});}return _0x582ca4[_0x43e2('0x8c')](_0x43e2('0x8d'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e86fb){var _0x477c5f={'raw':![],'where':{}};var _0x139cae={};var _0x30c8f5={'count':0x0,'rows':[]};var _0x1c0a77=_0x2e86fb['query'][_0x43e2('0x8e')];var _0x27e555=_0x2e86fb['query'][_0x43e2('0x8f')]||![];var _0x483315=_0x32f048(_0x1c0a77,_0x27e555);if(!_0x483315[_0x43e2('0x16')])throw new Error(_0x43e2('0x90')+_0x1c0a77+'\x27');var _0x40ee6e=[{'name':_0x1c0a77}];if(!_[_0x43e2('0x91')](_0x483315[_0x43e2('0x1c')]))_0x40ee6e=_0x483315[_0x43e2('0x1c')];var _0x216e57=[];for(var _0xb0c30b=0x0;_0xb0c30b<_0x40ee6e[_0x43e2('0x92')];_0xb0c30b++){_0x216e57['push'](_0x2f7153['UserProfileSection'][_0x43e2('0x93')]({'where':{'userProfileId':_0x2e86fb[_0x43e2('0x94')]['id'],'name':_0x40ee6e[_0xb0c30b][_0x43e2('0xf')]},'raw':!![]}));}return Promise[_0x43e2('0x95')](_0x216e57)['then'](function(_0x453f37){var _0x3485fb=_[_0x43e2('0x6')](_0x453f37,function(_0x54ab4f){return _0x54ab4f?_0x54ab4f:undefined;});var _0x228280=_[_0x43e2('0x6')](_0x40ee6e,[_0x43e2('0x96'),!![]]);var _0x463027=_['isEmpty'](_0x3485fb)&&_[_0x43e2('0x91')](_0x228280)?null:_[_0x43e2('0x97')](_0x228280,_0x3485fb);if(!_0x463027)return null;var _0x4dafc1=[];for(var _0x5d2ae5=0x0;_0x5d2ae5<_0x463027['length'];_0x5d2ae5++){var _0x7e5d4f=_[_0x43e2('0x93')](_0x40ee6e,function(_0x518aa1){return _0x463027[_0x5d2ae5]?_0x518aa1[_0x43e2('0xf')]===_0x463027[_0x5d2ae5][_0x43e2('0xf')]:null;});if(_0x7e5d4f){if(_0x463027[_0x5d2ae5][_0x43e2('0x96')]){_0x4dafc1['push'](_0x5d2806(_0x483315[_0x43e2('0x16')],_0x463027[_0x5d2ae5]));}else{if(!_0x463027[_0x5d2ae5]['autoAssociation']){_0x4dafc1[_0x43e2('0x98')](_0x5cea01(_0x7e5d4f,_0x463027[_0x5d2ae5],_0x483315[_0x43e2('0x16')]));}else{if(_0x7e5d4f[_0x43e2('0xc')]){_0x4dafc1[_0x43e2('0x98')](_0x45848e(_0x7e5d4f,_0x463027[_0x5d2ae5]));}}}}}return Promise[_0x43e2('0x95')](_0x4dafc1);})[_0x43e2('0x8')](function(_0x16dc65){var _0x364a6b=_0x16dc65;var _0x4ece0a=null;if(_0x364a6b){_0x4ece0a=_0x364a6b[_0x43e2('0x92')]===0x1?_0x364a6b[0x0]:null;}if(!_0x4ece0a&&!_0x364a6b)return _0x30c8f5;var _0x44dc86=_0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0x99')];_0x139cae[_0x43e2('0xc')]=_[_0x43e2('0x9a')](_0x44dc86);_0x139cae[_0x43e2('0x89')]=_[_0x43e2('0x9a')](_0x2e86fb[_0x43e2('0x89')]);_0x139cae[_0x43e2('0x9b')]=_[_0x43e2('0x9c')](_0x139cae['model'],_0x139cae[_0x43e2('0x89')]);_0x477c5f[_0x43e2('0x9d')]=_[_0x43e2('0x9c')](_0x139cae['model'],qs[_0x43e2('0x9e')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9e')]));_0x477c5f[_0x43e2('0x9d')]=_0x477c5f['attributes'][_0x43e2('0x92')]?_0x477c5f['attributes']:_0x139cae[_0x43e2('0xc')];if(!_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9f')]('nolimit')){_0x477c5f[_0x43e2('0xa0')]=qs[_0x43e2('0xa0')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa0')]);_0x477c5f[_0x43e2('0xa1')]=qs[_0x43e2('0xa1')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa1')]);}_0x477c5f[_0x43e2('0xa2')]=qs[_0x43e2('0xa3')](_0x2e86fb[_0x43e2('0x89')]['sort']);_0x477c5f[_0x43e2('0xa4')]=qs[_0x43e2('0x9b')](_[_0x43e2('0xa5')](_0x2e86fb[_0x43e2('0x89')],_0x139cae['filters']));if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]){_0x477c5f[_0x43e2('0xa4')]=_[_0x43e2('0xa6')](_0x477c5f[_0x43e2('0xa4')],{'$or':_[_0x43e2('0x9')](_0x44dc86,function(_0x3c176d){if(_0x3c176d[_0x43e2('0x13')]['key']!==_0x43e2('0xa7')){var _0x29c24d={};_0x29c24d[_0x3c176d[_0x43e2('0xb')]]={'$like':'%'+_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]+'%'};return _0x29c24d;}})});}var _0x4704cc=[];var _0x3af5ef=null;var _0x5b5a2e={};if(_0x4ece0a){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,[_0x43e2('0xf'),_0x4ece0a[_0x43e2('0xf')]]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};if(_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){_0x5b5a2e[_0x3af5ef['foreignKey']]=_[_0x43e2('0x9')](_0x4ece0a[_0x43e2('0xe')],'id');}else{_0x5b5a2e[_0x3af5ef[_0x43e2('0xa9')]]=_0x4ece0a[_0x43e2('0xe')];}_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{_0x477c5f[_0x43e2('0xa4')]['id']=_0x4ece0a['associatedResources'];}}else{for(var _0x2d57ff=0x0;_0x2d57ff<_0x364a6b[_0x43e2('0x92')];_0x2d57ff++){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,['name',_0x364a6b[_0x2d57ff]['name']]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};_0x5b5a2e[_0x3af5ef['foreignKey']]=_0x364a6b[_0x2d57ff]['associatedResources'];_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{if(!_0x477c5f[_0x43e2('0xa4')]['id'])_0x477c5f[_0x43e2('0xa4')]['id']=[];_0x364a6b[_0x2d57ff]['associatedResources'][_0x43e2('0xaa')](function(_0x5cdf92){_0x477c5f[_0x43e2('0xa4')]['id'][_0x43e2('0x98')](_0x5cdf92);});}}}if(!_[_0x43e2('0x91')](_0x4704cc)){_0x477c5f['where']=_['merge'](_0x477c5f['where'],{'$and':{'$or':_0x4704cc}});}_0x477c5f=_[_0x43e2('0xa6')]({},_0x477c5f,_0x2e86fb[_0x43e2('0xab')]);if(_0x4ece0a&&!_0x4ece0a[_0x43e2('0xac')]&&_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xad')]){_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f)[_0x43e2('0x8')](function(_0x48f054){var _0x3fb3fe=[];_0x48f054[_0x43e2('0xaa')](function(_0x5a0d57){var _0x2b1a80;switch(_0x5a0d57['reportType']){case _0x43e2('0xaf'):_0x2b1a80=_[_0x43e2('0x93')](_0x4ece0a[_0x43e2('0xe')],function(_0x4a01cf){return _0x4a01cf['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x4a01cf[_0x43e2('0x13')]==='DefaultReports';});break;case'custom':_0x2b1a80=_['find'](_0x4ece0a[_0x43e2('0xe')],function(_0x3574d8){return _0x3574d8['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x3574d8[_0x43e2('0x13')]===_0x43e2('0xb0');});break;}if(_0x2b1a80)_0x3fb3fe[_0x43e2('0x98')](_0x5a0d57);});_0x30c8f5[_0x43e2('0xb1')]=_0x3fb3fe['length'];_0x30c8f5['rows']=_0x3fb3fe;return _0x30c8f5;});}else{return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xb1')]({'where':_0x477c5f['where']})[_0x43e2('0x8')](function(_0x44edab){_0x30c8f5[_0x43e2('0xb1')]=_0x44edab;if(_0x2e86fb['query'][_0x43e2('0xad')]){if(_0x483315[_0x43e2('0x16')]===_0x43e2('0x22')){_0x477c5f[_0x43e2('0xae')]=[{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb2'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'required':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]?!![]:![]},{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb5'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'through':_0x2e86fb['query'][_0x43e2('0xb4')]?{'attributes':[],'where':{'TagId':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]||undefined}}:{},'required':_0x2e86fb['query']['tag']?!![]:![]}];}else{_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f);})['then'](function(_0x5ef6f4){_0x30c8f5[_0x43e2('0xb6')]=_0x5ef6f4;if(_0x1c0a77===_0x43e2('0x35')&&_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb7')]===_0x43e2('0xb8')){var _0x3c273d=[];for(var _0x3ff1c9=0x0;_0x3ff1c9<_0x30c8f5[_0x43e2('0xb6')][_0x43e2('0x92')];_0x3ff1c9++){_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xb9'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbb'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbc'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbd'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d['push'](_0x1d8647('openchannel',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647('whatsapp',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));}return Promise[_0x43e2('0x95')](_0x3c273d)['then'](function(){return _0x30c8f5;});}return _0x30c8f5;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f04b6af..9a435cf 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x2ef3,0xba));var _0x32ef=function(_0x48d610,_0x27e09f){_0x48d610=_0x48d610-0x0;var _0x946827=_0x2ef3[_0x48d610];return _0x946827;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file +var _0x1a38=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1a38,0xb0));var _0x81a3=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x1a38[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});config[_0x81a3('0xb')]=_[_0x81a3('0xc')](config[_0x81a3('0xb')],{'host':_0x81a3('0xd'),'port':0x18eb});var socket=require(_0x81a3('0xe'))(new Redis(config['redis']));require(_0x81a3('0xf'))[_0x81a3('0x10')](socket);function respondWithRpcPromise(_0x3ece9a,_0x10f4c5,_0x3fd4fe){return new BPromise(function(_0x4a7f3a,_0xeef25e){return client[_0x81a3('0x11')](_0x3ece9a,_0x3fd4fe)[_0x81a3('0x12')](function(_0x516492){logger['info'](_0x81a3('0x13'),_0x10f4c5,_0x81a3('0x14'));logger[_0x81a3('0x15')](_0x81a3('0x16'),_0x10f4c5,_0x81a3('0x14'),JSON[_0x81a3('0x17')](_0x516492));if(_0x516492[_0x81a3('0x18')]){if(_0x516492[_0x81a3('0x18')][_0x81a3('0x19')]===0x1f4){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492[_0x81a3('0x18')]['message']);return _0xeef25e(_0x516492[_0x81a3('0x18')][_0x81a3('0x1a')]);}logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492['error'][_0x81a3('0x1a')]);return _0x4a7f3a(_0x516492[_0x81a3('0x18')]['message']);}else{logger[_0x81a3('0x1b')]('UserProfile,\x20%s,\x20%s',_0x10f4c5,'request\x20sent');_0x4a7f3a(_0x516492[_0x81a3('0x1c')][_0x81a3('0x1a')]);}})[_0x81a3('0x1d')](function(_0x18c316){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x18c316);_0xeef25e(_0x18c316);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index b81ffc8..442eba4 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 _0xc7b5=['save','remove','update','emit','removeListener','register','userProfile:','./userProfile.events'];(function(_0x271899,_0x3c843a){var _0x3e12cc=function(_0x3102b8){while(--_0x3102b8){_0x271899['push'](_0x271899['shift']());}};_0x3e12cc(++_0x3c843a);}(_0xc7b5,0x97));var _0x5c7b=function(_0x59e45d,_0x4eae77){_0x59e45d=_0x59e45d-0x0;var _0x10ec22=_0xc7b5[_0x59e45d];return _0x10ec22;};'use strict';var UserProfileEvents=require(_0x5c7b('0x0'));var events=[_0x5c7b('0x1'),_0x5c7b('0x2'),_0x5c7b('0x3')];function createListener(_0x2d4166,_0x1fa9a7){return function(_0x332fc5){_0x1fa9a7[_0x5c7b('0x4')](_0x2d4166,_0x332fc5);};}function removeListener(_0x12b154,_0x123bee){return function(){UserProfileEvents[_0x5c7b('0x5')](_0x12b154,_0x123bee);};}exports[_0x5c7b('0x6')]=function(_0x43bd62){for(var _0x5cb34e=0x0,_0x146bf4=events['length'];_0x5cb34e<_0x146bf4;_0x5cb34e++){var _0x536d51=events[_0x5cb34e];var _0xca6aec=createListener(_0x5c7b('0x7')+_0x536d51,_0x43bd62);UserProfileEvents['on'](_0x536d51,_0xca6aec);}}; \ No newline at end of file +var _0x9bb5=['removeListener','userProfile:','save','remove','update','emit'];(function(_0x2a2385,_0x483814){var _0x2c75=function(_0x1991da){while(--_0x1991da){_0x2a2385['push'](_0x2a2385['shift']());}};_0x2c75(++_0x483814);}(_0x9bb5,0xbc));var _0x59bb=function(_0x455ec9,_0x2f1507){_0x455ec9=_0x455ec9-0x0;var _0x1681b7=_0x9bb5[_0x455ec9];return _0x1681b7;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x59bb('0x0'),_0x59bb('0x1'),_0x59bb('0x2')];function createListener(_0x555832,_0x5116fc){return function(_0x151fbf){_0x5116fc[_0x59bb('0x3')](_0x555832,_0x151fbf);};}function removeListener(_0x2673c0,_0x2bac74){return function(){UserProfileEvents[_0x59bb('0x4')](_0x2673c0,_0x2bac74);};}exports['register']=function(_0xcafb9c){for(var _0x3dc83b=0x0,_0x3a4fc0=events['length'];_0x3dc83b<_0x3a4fc0;_0x3dc83b++){var _0x22bf6f=events[_0x3dc83b];var _0x2da6be=createListener(_0x59bb('0x5')+_0x22bf6f,_0xcafb9c);UserProfileEvents['on'](_0x22bf6f,_0x2da6be);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0628a76..2784374 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 _0x628e=['get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfileResource.controller'];(function(_0x36909f,_0x4f45a5){var _0x512c12=function(_0x45f2a5){while(--_0x45f2a5){_0x36909f['push'](_0x36909f['shift']());}};_0x512c12(++_0x4f45a5);}(_0x628e,0xe9));var _0xe628=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x628e[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xe628('0x0'));var util=require(_0xe628('0x1'));var path=require(_0xe628('0x2'));var timeout=require(_0xe628('0x3'));var express=require(_0xe628('0x4'));var router=express[_0xe628('0x5')]();var fs_extra=require(_0xe628('0x6'));var auth=require(_0xe628('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe628('0x8'));router[_0xe628('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe628('0xa'),auth[_0xe628('0xb')](),controller[_0xe628('0xc')]);router[_0xe628('0x9')]('/:id',auth[_0xe628('0xb')](),controller[_0xe628('0xd')]);router[_0xe628('0xe')]('/',auth[_0xe628('0xb')](),controller[_0xe628('0xf')]);router[_0xe628('0x10')](_0xe628('0x11'),auth[_0xe628('0xb')](),controller[_0xe628('0x12')]);router[_0xe628('0x13')]('/:id',auth[_0xe628('0xb')](),controller[_0xe628('0x14')]);module[_0xe628('0x15')]=router; \ No newline at end of file +var _0x3105=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2cf695,_0x58e294){var _0x44b02c=function(_0x5c329d){while(--_0x5c329d){_0x2cf695['push'](_0x2cf695['shift']());}};_0x44b02c(++_0x58e294);}(_0x3105,0x1ae));var _0x5310=function(_0x2db429,_0x451682){_0x2db429=_0x2db429-0x0;var _0x2248fa=_0x3105[_0x2db429];return _0x2248fa;};'use strict';var multer=require(_0x5310('0x0'));var util=require(_0x5310('0x1'));var path=require(_0x5310('0x2'));var timeout=require(_0x5310('0x3'));var express=require(_0x5310('0x4'));var router=express['Router']();var fs_extra=require(_0x5310('0x5'));var auth=require(_0x5310('0x6'));var interaction=require(_0x5310('0x7'));var config=require(_0x5310('0x8'));var controller=require(_0x5310('0x9'));router[_0x5310('0xa')]('/',auth['isAuthenticated'](),controller[_0x5310('0xb')]);router[_0x5310('0xa')](_0x5310('0xc'),auth[_0x5310('0xd')](),controller[_0x5310('0xe')]);router['get'](_0x5310('0xf'),auth[_0x5310('0xd')](),controller[_0x5310('0x10')]);router[_0x5310('0x11')]('/',auth[_0x5310('0xd')](),controller[_0x5310('0x12')]);router[_0x5310('0x13')](_0x5310('0xf'),auth[_0x5310('0xd')](),controller[_0x5310('0x14')]);router['delete'](_0x5310('0xf'),auth['isAuthenticated'](),controller[_0x5310('0x15')]);module[_0x5310('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 71bfefc..31ff732 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 _0x1d36=['sequelize','exports','STRING'];(function(_0x1155d4,_0x236a16){var _0x2f424a=function(_0x5e6ad4){while(--_0x5e6ad4){_0x1155d4['push'](_0x1155d4['shift']());}};_0x2f424a(++_0x236a16);}(_0x1d36,0x8d));var _0x61d3=function(_0x169163,_0x4737c7){_0x169163=_0x169163-0x0;var _0x4a2080=_0x1d36[_0x169163];return _0x4a2080;};'use strict';var Sequelize=require(_0x61d3('0x0'));module[_0x61d3('0x1')]={'name':{'type':Sequelize[_0x61d3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2530=['INTEGER','sequelize','STRING'];(function(_0x54412d,_0x253e09){var _0x368884=function(_0x366270){while(--_0x366270){_0x54412d['push'](_0x54412d['shift']());}};_0x368884(++_0x253e09);}(_0x2530,0x11b));var _0x0253=function(_0x5034cf,_0x54f09c){_0x5034cf=_0x5034cf-0x0;var _0x3171bc=_0x2530[_0x5034cf];return _0x3171bc;};'use strict';var Sequelize=require(_0x0253('0x0'));module['exports']={'name':{'type':Sequelize[_0x0253('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0253('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0253('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index b33c00a..9b500e8 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 _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xacf4,0xe7));var _0x4acf=function(_0x318309,_0x430ab9){_0x318309=_0x318309-0x0;var _0x4c25ff=_0xacf4[_0x318309];return _0x4c25ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['UserProfileResource'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['UserProfileResource']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file +var _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a37,0xb4));var _0x71a3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1a37[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cd3fd7f..4807d57 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 _0xc5e2=['lodash','bluebird','path','exports','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0xe76139,_0x23acc4){var _0xb2bd6f=function(_0x5e9740){while(--_0x5e9740){_0xe76139['push'](_0xe76139['shift']());}};_0xb2bd6f(++_0x23acc4);}(_0xc5e2,0x16c));var _0x2c5e=function(_0x42676a,_0x5804eb){_0x42676a=_0x42676a-0x0;var _0x1b76d2=_0xc5e2[_0x42676a];return _0x1b76d2;};'use strict';var _=require(_0x2c5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2c5e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c5e('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x2c5e('0x3')]=function(_0x31b284,_0x13f3ae){return _0x31b284['define'](_0x2c5e('0x4'),attributes,{'tableName':_0x2c5e('0x5'),'paranoid':![],'indexes':[{'name':_0x2c5e('0x6'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a3e=['request-promise','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','api','moment'];(function(_0x21a268,_0x57219b){var _0x573dfb=function(_0x36372b){while(--_0x36372b){_0x21a268['push'](_0x21a268['shift']());}};_0x573dfb(++_0x57219b);}(_0x9a3e,0xb1));var _0xe9a3=function(_0x40cba0,_0x5b8e8f){_0x40cba0=_0x40cba0-0x0;var _0x327eb7=_0x9a3e[_0x40cba0];return _0x327eb7;};'use strict';var _=require(_0xe9a3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe9a3('0x1'));var moment=require(_0xe9a3('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9a3('0x3'));var fs=require('fs');var path=require(_0xe9a3('0x4'));var rimraf=require(_0xe9a3('0x5'));var config=require('../../config/environment');var attributes=require(_0xe9a3('0x6'));module['exports']=function(_0x54975f,_0x5b8b3a){return _0x54975f[_0xe9a3('0x7')](_0xe9a3('0x8'),attributes,{'tableName':_0xe9a3('0x9'),'paranoid':![],'indexes':[{'name':_0xe9a3('0xa'),'fields':['resourceId',_0xe9a3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6bc3926..4510fac 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 _0xeae0=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b6f3e,_0x1e3e85){var _0x5b6f9d=function(_0x5a7f92){while(--_0x5a7f92){_0x1b6f3e['push'](_0x1b6f3e['shift']());}};_0x5b6f9d(++_0x1e3e85);}(_0xeae0,0x1b7));var _0x0eae=function(_0x2c40bf,_0x5ce37a){_0x2c40bf=_0x2c40bf-0x0;var _0x31ab19=_0xeae0[_0x2c40bf];return _0x31ab19;};'use strict';var _=require(_0x0eae('0x0'));var util=require(_0x0eae('0x1'));var moment=require(_0x0eae('0x2'));var BPromise=require('bluebird');var rs=require(_0x0eae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0eae('0x4'))['db'];var utils=require(_0x0eae('0x5'));var logger=require(_0x0eae('0x6'))(_0x0eae('0x7'));var config=require(_0x0eae('0x8'));var jayson=require(_0x0eae('0x9'));var client=jayson[_0x0eae('0xa')][_0x0eae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26810d,_0x45e1a6,_0x3435e0){return new BPromise(function(_0x29deb5,_0x42aeb8){return client['request'](_0x26810d,_0x3435e0)[_0x0eae('0xc')](function(_0x58bcf8){logger[_0x0eae('0xd')](_0x0eae('0xe'),_0x45e1a6,_0x0eae('0xf'));logger[_0x0eae('0x10')](_0x0eae('0x11'),_0x45e1a6,_0x0eae('0xf'),JSON[_0x0eae('0x12')](_0x58bcf8));if(_0x58bcf8[_0x0eae('0x13')]){if(_0x58bcf8[_0x0eae('0x13')][_0x0eae('0x14')]===0x1f4){logger[_0x0eae('0x13')](_0x0eae('0xe'),_0x45e1a6,_0x58bcf8[_0x0eae('0x13')]['message']);return _0x42aeb8(_0x58bcf8[_0x0eae('0x13')][_0x0eae('0x15')]);}logger[_0x0eae('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x45e1a6,_0x58bcf8['error'][_0x0eae('0x15')]);return _0x29deb5(_0x58bcf8['error'][_0x0eae('0x15')]);}else{logger['info'](_0x0eae('0xe'),_0x45e1a6,'request\x20sent');_0x29deb5(_0x58bcf8[_0x0eae('0x16')][_0x0eae('0x15')]);}})['catch'](function(_0x1dae44){logger[_0x0eae('0x13')](_0x0eae('0xe'),_0x45e1a6,_0x1dae44);_0x42aeb8(_0x1dae44);});});} \ No newline at end of file +var _0x312e=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x899dff,_0x1c99fb){var _0x4752d0=function(_0x5151e3){while(--_0x5151e3){_0x899dff['push'](_0x899dff['shift']());}};_0x4752d0(++_0x1c99fb);}(_0x312e,0xd7));var _0xe312=function(_0x24ca45,_0x556eda){_0x24ca45=_0x24ca45-0x0;var _0x13ef71=_0x312e[_0x24ca45];return _0x13ef71;};'use strict';var _=require('lodash');var util=require(_0xe312('0x0'));var moment=require(_0xe312('0x1'));var BPromise=require(_0xe312('0x2'));var rs=require(_0xe312('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe312('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe312('0x5'));var config=require(_0xe312('0x6'));var jayson=require(_0xe312('0x7'));var client=jayson[_0xe312('0x8')][_0xe312('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8151,_0x4e06fa,_0x57a18f){return new BPromise(function(_0x22572e,_0x1213d5){return client[_0xe312('0xa')](_0x5c8151,_0x57a18f)[_0xe312('0xb')](function(_0x5c201a){logger['info'](_0xe312('0xc'),_0x4e06fa,_0xe312('0xd'));logger[_0xe312('0xe')](_0xe312('0xf'),_0x4e06fa,_0xe312('0xd'),JSON[_0xe312('0x10')](_0x5c201a));if(_0x5c201a[_0xe312('0x11')]){if(_0x5c201a[_0xe312('0x11')][_0xe312('0x12')]===0x1f4){logger[_0xe312('0x11')](_0xe312('0xc'),_0x4e06fa,_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);return _0x1213d5(_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);}logger['error'](_0xe312('0xc'),_0x4e06fa,_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);return _0x22572e(_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);}else{logger[_0xe312('0x14')](_0xe312('0xc'),_0x4e06fa,_0xe312('0xd'));_0x22572e(_0x5c201a['result']['message']);}})[_0xe312('0x15')](function(_0x2d4041){logger[_0xe312('0x11')](_0xe312('0xc'),_0x4e06fa,_0x2d4041);_0x1213d5(_0x2d4041);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f7bbc8a..d7d5ea9 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 _0x5e58=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0xcbee1d,_0x4bbdfe){var _0x4e64bb=function(_0x202825){while(--_0x202825){_0xcbee1d['push'](_0xcbee1d['shift']());}};_0x4e64bb(++_0x4bbdfe);}(_0x5e58,0x190));var _0x85e5=function(_0x2542d1,_0xdb7645){_0x2542d1=_0x2542d1-0x0;var _0xec2ce7=_0x5e58[_0x2542d1];return _0xec2ce7;};'use strict';var multer=require(_0x85e5('0x0'));var util=require(_0x85e5('0x1'));var path=require(_0x85e5('0x2'));var timeout=require('connect-timeout');var express=require(_0x85e5('0x3'));var router=express['Router']();var fs_extra=require(_0x85e5('0x4'));var auth=require(_0x85e5('0x5'));var interaction=require(_0x85e5('0x6'));var config=require(_0x85e5('0x7'));var controller=require(_0x85e5('0x8'));router[_0x85e5('0x9')]('/',auth[_0x85e5('0xa')](),controller[_0x85e5('0xb')]);router[_0x85e5('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x85e5('0x9')](_0x85e5('0xc'),auth[_0x85e5('0xa')](),controller['show']);router[_0x85e5('0xd')]('/',auth[_0x85e5('0xa')](),controller[_0x85e5('0xe')]);router[_0x85e5('0xf')](_0x85e5('0xc'),auth[_0x85e5('0xa')](),controller[_0x85e5('0x10')]);router[_0x85e5('0x11')]('/:id',auth[_0x85e5('0xa')](),controller[_0x85e5('0x12')]);module[_0x85e5('0x13')]=router; \ No newline at end of file +var _0x4c8a=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x21cc06,_0x1c3faa){var _0x18cb0e=function(_0x3628e3){while(--_0x3628e3){_0x21cc06['push'](_0x21cc06['shift']());}};_0x18cb0e(++_0x1c3faa);}(_0x4c8a,0x1e7));var _0xa4c8=function(_0x51e1af,_0x3085d6){_0x51e1af=_0x51e1af-0x0;var _0x1dfefb=_0x4c8a[_0x51e1af];return _0x1dfefb;};'use strict';var multer=require(_0xa4c8('0x0'));var util=require(_0xa4c8('0x1'));var path=require('path');var timeout=require(_0xa4c8('0x2'));var express=require(_0xa4c8('0x3'));var router=express[_0xa4c8('0x4')]();var fs_extra=require(_0xa4c8('0x5'));var auth=require(_0xa4c8('0x6'));var interaction=require(_0xa4c8('0x7'));var config=require(_0xa4c8('0x8'));var controller=require(_0xa4c8('0x9'));router['get']('/',auth[_0xa4c8('0xa')](),controller['index']);router[_0xa4c8('0xb')](_0xa4c8('0xc'),auth[_0xa4c8('0xa')](),controller[_0xa4c8('0xd')]);router[_0xa4c8('0xb')](_0xa4c8('0xe'),auth['isAuthenticated'](),controller[_0xa4c8('0xf')]);router[_0xa4c8('0x10')]('/',auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x11')]);router[_0xa4c8('0x12')](_0xa4c8('0xe'),auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x13')]);router[_0xa4c8('0x14')]('/:id',auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x15')]);module[_0xa4c8('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index b95aacb..7532fd8 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 _0xb688=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','split','exports'];(function(_0x3a1afc,_0x5efc4c){var _0x261fb2=function(_0x56269b){while(--_0x56269b){_0x3a1afc['push'](_0x3a1afc['shift']());}};_0x261fb2(++_0x5efc4c);}(_0xb688,0xcf));var _0x8b68=function(_0x232672,_0x562bb8){_0x232672=_0x232672-0x0;var _0x71ba81=_0xb688[_0x232672];return _0x71ba81;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41030e){this[_0x8b68('0x4')](_0x8b68('0x5'),_0x41030e?_0x41030e[_0x8b68('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8b68('0x5'))?this['getDataValue'](_0x8b68('0x5'))[_0x8b68('0x7')](''):[];}}}; \ No newline at end of file +var _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x2481d7,_0x32fa02){var _0x4a6cb8=function(_0x5c0833){while(--_0x5c0833){_0x2481d7['push'](_0x2481d7['shift']());}};_0x4a6cb8(++_0x32fa02);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x197c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x197c('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x197c('0x2')],'set':function(_0x26833e){this[_0x197c('0x4')](_0x197c('0x5'),_0x26833e?_0x26833e['join'](''):[]);},'get':function(){return this['getDataValue'](_0x197c('0x5'))?this[_0x197c('0x6')](_0x197c('0x5'))[_0x197c('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index aa79506..fc2d92e 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 _0x5abb=['name','send','index','map','UserProfileSection','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','options','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x5abb,0x1f4));var _0xb5ab=function(_0x2b3ba0,_0x37dc6f){_0x2b3ba0=_0x2b3ba0-0x0;var _0x3e4617=_0x5abb[_0x2b3ba0];return _0x3e4617;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5ab('0x0'));var zipdir=require(_0xb5ab('0x1'));var jsonpatch=require(_0xb5ab('0x2'));var rp=require(_0xb5ab('0x3'));var moment=require(_0xb5ab('0x4'));var BPromise=require(_0xb5ab('0x5'));var Mustache=require(_0xb5ab('0x6'));var util=require(_0xb5ab('0x7'));var path=require('path');var sox=require(_0xb5ab('0x8'));var csv=require('to-csv');var ejs=require(_0xb5ab('0x9'));var fs=require('fs');var fs_extra=require(_0xb5ab('0xa'));var _=require(_0xb5ab('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5ab('0xc'));var deskjs=require(_0xb5ab('0xd'));var toCsv=require(_0xb5ab('0xe'));var querystring=require(_0xb5ab('0xf'));var Papa=require(_0xb5ab('0x10'));var Redis=require(_0xb5ab('0x11'));var authService=require(_0xb5ab('0x12'));var qs=require(_0xb5ab('0x13'));var as=require(_0xb5ab('0x14'));var hardwareService=require(_0xb5ab('0x15'));var logger=require(_0xb5ab('0x16'))(_0xb5ab('0x17'));var utils=require('../../config/utils');var config=require(_0xb5ab('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1266a7,_0x572695){_0x572695=_0x572695||0xcc;return function(_0x53a8e7){if(_0x53a8e7){return _0x1266a7[_0xb5ab('0x19')](_0x572695);}return _0x1266a7[_0xb5ab('0x1a')](_0x572695)[_0xb5ab('0x1b')]();};}function respondWithResult(_0x2c06cc,_0x506aec){_0x506aec=_0x506aec||0xc8;return function(_0x43b8c3){if(_0x43b8c3){return _0x2c06cc[_0xb5ab('0x1a')](_0x506aec)['json'](_0x43b8c3);}};}function respondWithFilteredResult(_0x5ad5f9,_0x420a74){return function(_0x261b8f){if(_0x261b8f){var _0x5209b8=typeof _0x420a74[_0xb5ab('0x1c')]===_0xb5ab('0x1d')&&typeof _0x420a74[_0xb5ab('0x1e')]===_0xb5ab('0x1d');var _0x22e29a=_0x261b8f[_0xb5ab('0x1f')];var _0x1fd4d1=_0x5209b8?0x0:_0x420a74[_0xb5ab('0x1c')];var _0x46b626=_0x5209b8?_0x261b8f[_0xb5ab('0x1f')]:_0x420a74[_0xb5ab('0x1c')]+_0x420a74[_0xb5ab('0x1e')];var _0x26b3cd;if(_0x46b626>=_0x22e29a){_0x46b626=_0x22e29a;_0x26b3cd=0xc8;}else{_0x26b3cd=0xce;}_0x5ad5f9[_0xb5ab('0x1a')](_0x26b3cd);return _0x5ad5f9['set'](_0xb5ab('0x20'),_0x1fd4d1+'-'+_0x46b626+'/'+_0x22e29a)[_0xb5ab('0x21')](_0x261b8f);}return null;};}function patchUpdates(_0x3fe71b){return function(_0x11d035){try{jsonpatch[_0xb5ab('0x22')](_0x11d035,_0x3fe71b,!![]);}catch(_0x4050d1){return BPromise[_0xb5ab('0x23')](_0x4050d1);}return _0x11d035['save']();};}function saveUpdates(_0x5bad58,_0x554a0f){return function(_0x4d9a5e){if(_0x4d9a5e){return _0x4d9a5e[_0xb5ab('0x24')](_0x5bad58)[_0xb5ab('0x25')](function(_0x578b3e){return _0x578b3e;});}return null;};}function removeEntity(_0x53cbf2,_0x342b34){return function(_0x373b52){if(_0x373b52){return _0x373b52['destroy']()['then'](function(){_0x53cbf2['status'](0xcc)[_0xb5ab('0x1b')]();});}};}function handleEntityNotFound(_0x212fbf,_0x3f446a){return function(_0x50c8ea){if(!_0x50c8ea){_0x212fbf['sendStatus'](0x194);}return _0x50c8ea;};}function handleError(_0x14ba66,_0x515552){_0x515552=_0x515552||0x1f4;return function(_0x3db421){logger[_0xb5ab('0x26')](_0x3db421['stack']);if(_0x3db421[_0xb5ab('0x27')]){delete _0x3db421[_0xb5ab('0x27')];}_0x14ba66[_0xb5ab('0x1a')](_0x515552)[_0xb5ab('0x28')](_0x3db421);};}exports[_0xb5ab('0x29')]=function(_0x1ad1ae,_0x452a49){var _0x54a0cd={},_0x33f0be={},_0x9bc996={'count':0x0,'rows':[]};var _0x26d96c=_[_0xb5ab('0x2a')](db[_0xb5ab('0x2b')]['rawAttributes'],function(_0x4213ed){return{'name':_0x4213ed[_0xb5ab('0x2c')],'type':_0x4213ed[_0xb5ab('0x2d')][_0xb5ab('0x2e')]};});_0x33f0be[_0xb5ab('0x2f')]=_[_0xb5ab('0x2a')](_0x26d96c,_0xb5ab('0x27'));_0x33f0be['query']=_['keys'](_0x1ad1ae[_0xb5ab('0x30')]);_0x33f0be['filters']=_[_0xb5ab('0x31')](_0x33f0be[_0xb5ab('0x2f')],_0x33f0be[_0xb5ab('0x30')]);_0x54a0cd[_0xb5ab('0x32')]=_[_0xb5ab('0x31')](_0x33f0be['model'],qs[_0xb5ab('0x33')](_0x1ad1ae[_0xb5ab('0x30')][_0xb5ab('0x33')]));_0x54a0cd['attributes']=_0x54a0cd['attributes'][_0xb5ab('0x34')]?_0x54a0cd[_0xb5ab('0x32')]:_0x33f0be[_0xb5ab('0x2f')];if(!_0x1ad1ae['query'][_0xb5ab('0x35')]('nolimit')){_0x54a0cd['limit']=qs[_0xb5ab('0x1e')](_0x1ad1ae[_0xb5ab('0x30')][_0xb5ab('0x1e')]);_0x54a0cd[_0xb5ab('0x1c')]=qs[_0xb5ab('0x1c')](_0x1ad1ae[_0xb5ab('0x30')]['offset']);}_0x54a0cd[_0xb5ab('0x36')]=qs['sort'](_0x1ad1ae[_0xb5ab('0x30')][_0xb5ab('0x37')]);_0x54a0cd[_0xb5ab('0x38')]=qs['filters'](_[_0xb5ab('0x39')](_0x1ad1ae[_0xb5ab('0x30')],_0x33f0be[_0xb5ab('0x3a')]),_0x26d96c);if(_0x1ad1ae[_0xb5ab('0x30')][_0xb5ab('0x3b')]){_0x54a0cd['where']=_[_0xb5ab('0x3c')](_0x54a0cd[_0xb5ab('0x38')],{'$or':_['map'](_0x26d96c,function(_0x1afc9e){if(_0x1afc9e['type']!==_0xb5ab('0x3d')){var _0x11a949={};_0x11a949[_0x1afc9e[_0xb5ab('0x27')]]={'$like':'%'+_0x1ad1ae[_0xb5ab('0x30')][_0xb5ab('0x3b')]+'%'};return _0x11a949;}})});}_0x54a0cd=_[_0xb5ab('0x3c')]({},_0x54a0cd,_0x1ad1ae['options']);var _0x7ab1c0={'where':_0x54a0cd['where']};return db[_0xb5ab('0x2b')][_0xb5ab('0x1f')](_0x7ab1c0)[_0xb5ab('0x25')](function(_0x223e27){_0x9bc996[_0xb5ab('0x1f')]=_0x223e27;if(_0x1ad1ae[_0xb5ab('0x30')]['includeAll']){_0x54a0cd[_0xb5ab('0x3e')]=[{'all':!![]}];}return db[_0xb5ab('0x2b')][_0xb5ab('0x3f')](_0x54a0cd);})[_0xb5ab('0x25')](function(_0x6d4ee5){_0x9bc996[_0xb5ab('0x40')]=_0x6d4ee5;return _0x9bc996;})[_0xb5ab('0x25')](respondWithFilteredResult(_0x452a49,_0x54a0cd))[_0xb5ab('0x41')](handleError(_0x452a49,null));};exports[_0xb5ab('0x42')]=function(_0x226111,_0x12abc9){var _0x3517b6={'raw':![],'where':{'id':_0x226111[_0xb5ab('0x43')]['id']}},_0x352d49={};_0x352d49[_0xb5ab('0x2f')]=_['keys'](db[_0xb5ab('0x2b')][_0xb5ab('0x44')]);_0x352d49[_0xb5ab('0x30')]=_[_0xb5ab('0x45')](_0x226111[_0xb5ab('0x30')]);_0x352d49[_0xb5ab('0x3a')]=_[_0xb5ab('0x31')](_0x352d49[_0xb5ab('0x2f')],_0x352d49[_0xb5ab('0x30')]);_0x3517b6['attributes']=_[_0xb5ab('0x31')](_0x352d49[_0xb5ab('0x2f')],qs['fields'](_0x226111[_0xb5ab('0x30')][_0xb5ab('0x33')]));_0x3517b6['attributes']=_0x3517b6[_0xb5ab('0x32')][_0xb5ab('0x34')]?_0x3517b6[_0xb5ab('0x32')]:_0x352d49[_0xb5ab('0x2f')];if(_0x226111[_0xb5ab('0x30')][_0xb5ab('0x46')]){_0x3517b6[_0xb5ab('0x3e')]=[{'all':!![]}];}_0x3517b6=_[_0xb5ab('0x3c')]({},_0x3517b6,_0x226111[_0xb5ab('0x47')]);return db[_0xb5ab('0x2b')][_0xb5ab('0x48')](_0x3517b6)[_0xb5ab('0x25')](handleEntityNotFound(_0x12abc9,null))['then'](respondWithResult(_0x12abc9,null))[_0xb5ab('0x41')](handleError(_0x12abc9,null));};exports[_0xb5ab('0x49')]=function(_0x49c0d7,_0x6cdc04){return db[_0xb5ab('0x2b')][_0xb5ab('0x49')](_0x49c0d7[_0xb5ab('0x4a')],{})[_0xb5ab('0x25')](respondWithResult(_0x6cdc04,0xc9))[_0xb5ab('0x41')](handleError(_0x6cdc04,null));};exports['update']=function(_0x2dd780,_0x2c23da){if(_0x2dd780[_0xb5ab('0x4a')]['id']){delete _0x2dd780[_0xb5ab('0x4a')]['id'];}return db[_0xb5ab('0x2b')][_0xb5ab('0x48')]({'where':{'id':_0x2dd780[_0xb5ab('0x43')]['id']}})[_0xb5ab('0x25')](handleEntityNotFound(_0x2c23da,null))[_0xb5ab('0x25')](saveUpdates(_0x2dd780['body'],null))['then'](respondWithResult(_0x2c23da,null))[_0xb5ab('0x41')](handleError(_0x2c23da,null));};exports[_0xb5ab('0x4b')]=function(_0x10bccc,_0x4eff3a){return db['UserProfileSection']['find']({'where':{'id':_0x10bccc[_0xb5ab('0x43')]['id']}})[_0xb5ab('0x25')](handleEntityNotFound(_0x4eff3a,null))[_0xb5ab('0x25')](removeEntity(_0x4eff3a,null))[_0xb5ab('0x41')](handleError(_0x4eff3a,null));};exports[_0xb5ab('0x4c')]=function(_0x51862e,_0x236c35){return db[_0xb5ab('0x2b')][_0xb5ab('0x4c')]()[_0xb5ab('0x25')](respondWithResult(_0x236c35,null))[_0xb5ab('0x41')](handleError(_0x236c35,null));}; \ No newline at end of file +var _0x7dd2=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','UserProfileSection','include','findAll','catch','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dd2,0xc5));var _0x27dd=function(_0x453f0f,_0x2dee3f){_0x453f0f=_0x453f0f-0x0;var _0x17dd08=_0x7dd2[_0x453f0f];return _0x17dd08;};'use strict';var emlformat=require(_0x27dd('0x0'));var rimraf=require(_0x27dd('0x1'));var zipdir=require(_0x27dd('0x2'));var jsonpatch=require(_0x27dd('0x3'));var rp=require('request-promise');var moment=require(_0x27dd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x27dd('0x5'));var path=require(_0x27dd('0x6'));var sox=require(_0x27dd('0x7'));var csv=require(_0x27dd('0x8'));var ejs=require(_0x27dd('0x9'));var fs=require('fs');var fs_extra=require(_0x27dd('0xa'));var _=require(_0x27dd('0xb'));var squel=require(_0x27dd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x27dd('0xd'));var toCsv=require(_0x27dd('0x8'));var querystring=require(_0x27dd('0xe'));var Papa=require(_0x27dd('0xf'));var Redis=require('ioredis');var authService=require(_0x27dd('0x10'));var qs=require(_0x27dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27dd('0x12'));var logger=require(_0x27dd('0x13'))('api');var utils=require(_0x27dd('0x14'));var config=require(_0x27dd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27dd('0x16'))['db'];function respondWithStatusCode(_0x58bf8c,_0x827029){_0x827029=_0x827029||0xcc;return function(_0xc99bcc){if(_0xc99bcc){return _0x58bf8c[_0x27dd('0x17')](_0x827029);}return _0x58bf8c[_0x27dd('0x18')](_0x827029)[_0x27dd('0x19')]();};}function respondWithResult(_0x2c4263,_0x262bdb){_0x262bdb=_0x262bdb||0xc8;return function(_0x26fe09){if(_0x26fe09){return _0x2c4263[_0x27dd('0x18')](_0x262bdb)['json'](_0x26fe09);}};}function respondWithFilteredResult(_0x265e19,_0x2f34df){return function(_0x444516){if(_0x444516){var _0x352c1b=typeof _0x2f34df[_0x27dd('0x1a')]===_0x27dd('0x1b')&&typeof _0x2f34df[_0x27dd('0x1c')]===_0x27dd('0x1b');var _0x3855ff=_0x444516['count'];var _0x1d1a53=_0x352c1b?0x0:_0x2f34df['offset'];var _0x3b4846=_0x352c1b?_0x444516[_0x27dd('0x1d')]:_0x2f34df[_0x27dd('0x1a')]+_0x2f34df[_0x27dd('0x1c')];var _0x345a57;if(_0x3b4846>=_0x3855ff){_0x3b4846=_0x3855ff;_0x345a57=0xc8;}else{_0x345a57=0xce;}_0x265e19[_0x27dd('0x18')](_0x345a57);return _0x265e19['set'](_0x27dd('0x1e'),_0x1d1a53+'-'+_0x3b4846+'/'+_0x3855ff)[_0x27dd('0x1f')](_0x444516);}return null;};}function patchUpdates(_0x2652d6){return function(_0x313229){try{jsonpatch[_0x27dd('0x20')](_0x313229,_0x2652d6,!![]);}catch(_0xfdc236){return BPromise[_0x27dd('0x21')](_0xfdc236);}return _0x313229[_0x27dd('0x22')]();};}function saveUpdates(_0x44fa18,_0x567742){return function(_0x3fb21f){if(_0x3fb21f){return _0x3fb21f[_0x27dd('0x23')](_0x44fa18)[_0x27dd('0x24')](function(_0x26f492){return _0x26f492;});}return null;};}function removeEntity(_0x44aad9,_0x31ced9){return function(_0x2b85cb){if(_0x2b85cb){return _0x2b85cb[_0x27dd('0x25')]()[_0x27dd('0x24')](function(){_0x44aad9[_0x27dd('0x18')](0xcc)[_0x27dd('0x19')]();});}};}function handleEntityNotFound(_0x58e711,_0x5014c2){return function(_0x404c0c){if(!_0x404c0c){_0x58e711[_0x27dd('0x17')](0x194);}return _0x404c0c;};}function handleError(_0x5dfc7d,_0x42179e){_0x42179e=_0x42179e||0x1f4;return function(_0x225e57){logger['error'](_0x225e57['stack']);if(_0x225e57['name']){delete _0x225e57[_0x27dd('0x26')];}_0x5dfc7d[_0x27dd('0x18')](_0x42179e)[_0x27dd('0x27')](_0x225e57);};}exports['index']=function(_0x11615c,_0x125135){var _0x2a4944={},_0x5f5611={},_0x2f9b7f={'count':0x0,'rows':[]};var _0x22cf40=_[_0x27dd('0x28')](db['UserProfileSection']['rawAttributes'],function(_0x401620){return{'name':_0x401620[_0x27dd('0x29')],'type':_0x401620[_0x27dd('0x2a')][_0x27dd('0x2b')]};});_0x5f5611[_0x27dd('0x2c')]=_['map'](_0x22cf40,_0x27dd('0x26'));_0x5f5611['query']=_[_0x27dd('0x2d')](_0x11615c['query']);_0x5f5611[_0x27dd('0x2e')]=_[_0x27dd('0x2f')](_0x5f5611[_0x27dd('0x2c')],_0x5f5611['query']);_0x2a4944[_0x27dd('0x30')]=_[_0x27dd('0x2f')](_0x5f5611[_0x27dd('0x2c')],qs['fields'](_0x11615c[_0x27dd('0x31')][_0x27dd('0x32')]));_0x2a4944[_0x27dd('0x30')]=_0x2a4944[_0x27dd('0x30')][_0x27dd('0x33')]?_0x2a4944[_0x27dd('0x30')]:_0x5f5611['model'];if(!_0x11615c['query'][_0x27dd('0x34')](_0x27dd('0x35'))){_0x2a4944['limit']=qs[_0x27dd('0x1c')](_0x11615c[_0x27dd('0x31')][_0x27dd('0x1c')]);_0x2a4944[_0x27dd('0x1a')]=qs[_0x27dd('0x1a')](_0x11615c[_0x27dd('0x31')]['offset']);}_0x2a4944[_0x27dd('0x36')]=qs[_0x27dd('0x37')](_0x11615c['query'][_0x27dd('0x37')]);_0x2a4944['where']=qs[_0x27dd('0x2e')](_[_0x27dd('0x38')](_0x11615c[_0x27dd('0x31')],_0x5f5611[_0x27dd('0x2e')]),_0x22cf40);if(_0x11615c[_0x27dd('0x31')][_0x27dd('0x39')]){_0x2a4944[_0x27dd('0x3a')]=_['merge'](_0x2a4944[_0x27dd('0x3a')],{'$or':_[_0x27dd('0x28')](_0x22cf40,function(_0xc2923e){if(_0xc2923e[_0x27dd('0x2a')]!=='VIRTUAL'){var _0x1bf622={};_0x1bf622[_0xc2923e['name']]={'$like':'%'+_0x11615c[_0x27dd('0x31')]['filter']+'%'};return _0x1bf622;}})});}_0x2a4944=_[_0x27dd('0x3b')]({},_0x2a4944,_0x11615c['options']);var _0x1df370={'where':_0x2a4944[_0x27dd('0x3a')]};return db[_0x27dd('0x3c')]['count'](_0x1df370)[_0x27dd('0x24')](function(_0xff2aca){_0x2f9b7f[_0x27dd('0x1d')]=_0xff2aca;if(_0x11615c[_0x27dd('0x31')]['includeAll']){_0x2a4944[_0x27dd('0x3d')]=[{'all':!![]}];}return db[_0x27dd('0x3c')][_0x27dd('0x3e')](_0x2a4944);})['then'](function(_0x13b12a){_0x2f9b7f['rows']=_0x13b12a;return _0x2f9b7f;})[_0x27dd('0x24')](respondWithFilteredResult(_0x125135,_0x2a4944))[_0x27dd('0x3f')](handleError(_0x125135,null));};exports['show']=function(_0x492727,_0x55949e){var _0x4f3e46={'raw':![],'where':{'id':_0x492727[_0x27dd('0x40')]['id']}},_0x5151fa={};_0x5151fa['model']=_['keys'](db[_0x27dd('0x3c')][_0x27dd('0x41')]);_0x5151fa[_0x27dd('0x31')]=_[_0x27dd('0x2d')](_0x492727[_0x27dd('0x31')]);_0x5151fa[_0x27dd('0x2e')]=_[_0x27dd('0x2f')](_0x5151fa[_0x27dd('0x2c')],_0x5151fa[_0x27dd('0x31')]);_0x4f3e46[_0x27dd('0x30')]=_[_0x27dd('0x2f')](_0x5151fa[_0x27dd('0x2c')],qs[_0x27dd('0x32')](_0x492727['query'][_0x27dd('0x32')]));_0x4f3e46[_0x27dd('0x30')]=_0x4f3e46[_0x27dd('0x30')]['length']?_0x4f3e46[_0x27dd('0x30')]:_0x5151fa[_0x27dd('0x2c')];if(_0x492727['query'][_0x27dd('0x42')]){_0x4f3e46['include']=[{'all':!![]}];}_0x4f3e46=_['merge']({},_0x4f3e46,_0x492727[_0x27dd('0x43')]);return db[_0x27dd('0x3c')][_0x27dd('0x44')](_0x4f3e46)['then'](handleEntityNotFound(_0x55949e,null))[_0x27dd('0x24')](respondWithResult(_0x55949e,null))['catch'](handleError(_0x55949e,null));};exports[_0x27dd('0x45')]=function(_0xb8f9b1,_0x214593){return db[_0x27dd('0x3c')][_0x27dd('0x45')](_0xb8f9b1[_0x27dd('0x46')],{})[_0x27dd('0x24')](respondWithResult(_0x214593,0xc9))[_0x27dd('0x3f')](handleError(_0x214593,null));};exports[_0x27dd('0x23')]=function(_0x3244b9,_0x50a7e7){if(_0x3244b9[_0x27dd('0x46')]['id']){delete _0x3244b9[_0x27dd('0x46')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x3244b9[_0x27dd('0x40')]['id']}})[_0x27dd('0x24')](handleEntityNotFound(_0x50a7e7,null))['then'](saveUpdates(_0x3244b9[_0x27dd('0x46')],null))['then'](respondWithResult(_0x50a7e7,null))[_0x27dd('0x3f')](handleError(_0x50a7e7,null));};exports[_0x27dd('0x25')]=function(_0x388ce6,_0x1a1875){return db[_0x27dd('0x3c')][_0x27dd('0x44')]({'where':{'id':_0x388ce6['params']['id']}})[_0x27dd('0x24')](handleEntityNotFound(_0x1a1875,null))[_0x27dd('0x24')](removeEntity(_0x1a1875,null))[_0x27dd('0x3f')](handleError(_0x1a1875,null));};exports[_0x27dd('0x47')]=function(_0x270a6e,_0xf9d897){return db[_0x27dd('0x3c')][_0x27dd('0x47')]()[_0x27dd('0x24')](respondWithResult(_0xf9d897,null))[_0x27dd('0x3f')](handleError(_0xf9d897,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index faef379..61df1be 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 _0xc8e8=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','util'];(function(_0x49b61d,_0x2f9675){var _0x1a8eda=function(_0x5ade3b){while(--_0x5ade3b){_0x49b61d['push'](_0x49b61d['shift']());}};_0x1a8eda(++_0x2f9675);}(_0xc8e8,0x1ed));var _0x8c8e=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xc8e8[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var util=require(_0x8c8e('0x0'));var logger=require(_0x8c8e('0x1'))(_0x8c8e('0x2'));var moment=require(_0x8c8e('0x3'));var BPromise=require(_0x8c8e('0x4'));var rp=require(_0x8c8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c8e('0x6'));var attributes=require(_0x8c8e('0x7'));module[_0x8c8e('0x8')]=function(_0x812a44,_0x3e7a01){return _0x812a44[_0x8c8e('0x9')](_0x8c8e('0xa'),attributes,{'tableName':_0x8c8e('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x8c8e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93ef=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','util','../../config/logger','api','moment'];(function(_0x1adffa,_0xad7505){var _0x231f18=function(_0x3d850a){while(--_0x3d850a){_0x1adffa['push'](_0x1adffa['shift']());}};_0x231f18(++_0xad7505);}(_0x93ef,0x192));var _0xf93e=function(_0x41e387,_0x13d62e){_0x41e387=_0x41e387-0x0;var _0x1f01bd=_0x93ef[_0x41e387];return _0x1f01bd;};'use strict';var _=require('lodash');var util=require(_0xf93e('0x0'));var logger=require(_0xf93e('0x1'))(_0xf93e('0x2'));var moment=require(_0xf93e('0x3'));var BPromise=require(_0xf93e('0x4'));var rp=require(_0xf93e('0x5'));var fs=require('fs');var path=require(_0xf93e('0x6'));var rimraf=require(_0xf93e('0x7'));var config=require(_0xf93e('0x8'));var attributes=require(_0xf93e('0x9'));module[_0xf93e('0xa')]=function(_0x3b8b8b,_0xa40702){return _0x3b8b8b[_0xf93e('0xb')]('UserProfileSection',attributes,{'tableName':_0xf93e('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf93e('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d816dba..93568f7 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 _0xbe3b=['request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x8b228f,_0x49891e){var _0x1a6335=function(_0x2168bc){while(--_0x2168bc){_0x8b228f['push'](_0x8b228f['shift']());}};_0x1a6335(++_0x49891e);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x512550,_0x6a8b6f){_0x512550=_0x512550-0x0;var _0x19f661=_0xbe3b[_0x512550];return _0x19f661;};'use strict';var _=require('lodash');var util=require(_0xbbe3('0x0'));var moment=require(_0xbbe3('0x1'));var BPromise=require('bluebird');var rs=require(_0xbbe3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbe3('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbe3('0x4'));var jayson=require(_0xbbe3('0x5'));var client=jayson[_0xbbe3('0x6')][_0xbbe3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c6976,_0x9bd4a9,_0x748756){return new BPromise(function(_0x40199b,_0x3c0c43){return client[_0xbbe3('0x8')](_0x4c6976,_0x748756)['then'](function(_0x1ff205){logger[_0xbbe3('0x9')](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));logger[_0xbbe3('0xc')](_0xbbe3('0xd'),_0x9bd4a9,_0xbbe3('0xb'),JSON[_0xbbe3('0xe')](_0x1ff205));if(_0x1ff205['error']){if(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x10')]===0x1f4){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205['error']['message']);return _0x3c0c43(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);}logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);return _0x40199b(_0x1ff205['error'][_0xbbe3('0x11')]);}else{logger['info'](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));_0x40199b(_0x1ff205[_0xbbe3('0x12')][_0xbbe3('0x11')]);}})[_0xbbe3('0x13')](function(_0x2af60d){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x2af60d);_0x3c0c43(_0x2af60d);});});} \ No newline at end of file +var _0x80f2=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x122943,_0x5c2166){var _0x383304=function(_0x367e0d){while(--_0x367e0d){_0x122943['push'](_0x122943['shift']());}};_0x383304(++_0x5c2166);}(_0x80f2,0xda));var _0x280f=function(_0x314dd6,_0x8576aa){_0x314dd6=_0x314dd6-0x0;var _0x53b99c=_0x80f2[_0x314dd6];return _0x53b99c;};'use strict';var _=require(_0x280f('0x0'));var util=require(_0x280f('0x1'));var moment=require(_0x280f('0x2'));var BPromise=require(_0x280f('0x3'));var rs=require(_0x280f('0x4'));var fs=require('fs');var Redis=require(_0x280f('0x5'));var db=require(_0x280f('0x6'))['db'];var utils=require(_0x280f('0x7'));var logger=require('../../config/logger')(_0x280f('0x8'));var config=require(_0x280f('0x9'));var jayson=require(_0x280f('0xa'));var client=jayson[_0x280f('0xb')][_0x280f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18ec04,_0x169daf,_0x3ca66a){return new BPromise(function(_0x186ad4,_0x5329ef){return client[_0x280f('0xd')](_0x18ec04,_0x3ca66a)[_0x280f('0xe')](function(_0x26e841){logger[_0x280f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,_0x280f('0x10'));logger[_0x280f('0x11')](_0x280f('0x12'),_0x169daf,'request\x20sent',JSON[_0x280f('0x13')](_0x26e841));if(_0x26e841[_0x280f('0x14')]){if(_0x26e841[_0x280f('0x14')][_0x280f('0x15')]===0x1f4){logger[_0x280f('0x14')](_0x280f('0x16'),_0x169daf,_0x26e841[_0x280f('0x14')][_0x280f('0x17')]);return _0x5329ef(_0x26e841['error'][_0x280f('0x17')]);}logger[_0x280f('0x14')](_0x280f('0x16'),_0x169daf,_0x26e841['error'][_0x280f('0x17')]);return _0x186ad4(_0x26e841[_0x280f('0x14')]['message']);}else{logger[_0x280f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,'request\x20sent');_0x186ad4(_0x26e841['result'][_0x280f('0x17')]);}})[_0x280f('0x18')](function(_0x21fe48){logger[_0x280f('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,_0x21fe48);_0x5329ef(_0x21fe48);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 44f8ac1..a3c7eff 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4411a3,_0x382a0e){var _0x42424f=function(_0x495c4e){while(--_0x495c4e){_0x4411a3['push'](_0x4411a3['shift']());}};_0x42424f(++_0x382a0e);}(_0x70e0,0x17b));var _0x070e=function(_0x5ddcc5,_0x453b54){_0x5ddcc5=_0x5ddcc5-0x0;var _0x3a3843=_0x70e0[_0x5ddcc5];return _0x3a3843;};'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(_0x46ee3c,_0x1c08f0){var _0x530a97=function(_0x194bba){while(--_0x194bba){_0x46ee3c['push'](_0x46ee3c['shift']());}};_0x530a97(++_0x1c08f0);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 98ed685..372089b 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 _0x3f14=['sequelize','exports','INTEGER'];(function(_0x4b62c0,_0x1fdac8){var _0x246f5e=function(_0x12e1c6){while(--_0x12e1c6){_0x4b62c0['push'](_0x4b62c0['shift']());}};_0x246f5e(++_0x1fdac8);}(_0x3f14,0x87));var _0x43f1=function(_0x87fb9d,_0x2ba366){_0x87fb9d=_0x87fb9d-0x0;var _0x30dcf6=_0x3f14[_0x87fb9d];return _0x30dcf6;};'use strict';var Sequelize=require(_0x43f1('0x0'));module[_0x43f1('0x1')]={'penalty':{'type':Sequelize[_0x43f1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe93b=['exports','INTEGER','sequelize'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xe93b,0x16a));var _0xbe93=function(_0xf7edae,_0x498714){_0xf7edae=_0xf7edae-0x0;var _0x13e30a=_0xe93b[_0xf7edae];return _0x13e30a;};'use strict';var Sequelize=require(_0xbe93('0x0'));module[_0xbe93('0x1')]={'penalty':{'type':Sequelize[_0xbe93('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index cf1f31b..19fd47f 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues','lodash'];(function(_0x36a8ca,_0x252ef5){var _0x2944c3=function(_0x14e46e){while(--_0x14e46e){_0x36a8ca['push'](_0x36a8ca['shift']());}};_0x2944c3(++_0x252ef5);}(_0x5496,0x175));var _0x6549=function(_0x21844e,_0x18034e){_0x21844e=_0x21844e-0x0;var _0x2681ed=_0x5496[_0x21844e];return _0x2681ed;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('UserSmsQueue',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5af=['exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3d8a41,_0x2b0fbe){var _0x28675e=function(_0x222859){while(--_0x222859){_0x3d8a41['push'](_0x3d8a41['shift']());}};_0x28675e(++_0x2b0fbe);}(_0xe5af,0x9c));var _0xfe5a=function(_0x5c3a99,_0x3a6edc){_0x5c3a99=_0x5c3a99-0x0;var _0x54e700=_0xe5af[_0x5c3a99];return _0x54e700;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require(_0xfe5a('0x2'));var BPromise=require(_0xfe5a('0x3'));var rp=require(_0xfe5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x5'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'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 fc0e26a..43c52d6 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 _0x01cf=['error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x01cf,0x1a6));var _0xf01c=function(_0x26b1cd,_0x34f80d){_0x26b1cd=_0x26b1cd-0x0;var _0x2319d2=_0x01cf[_0x26b1cd];return _0x2319d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf01c('0x0'));var rs=require(_0xf01c('0x1'));var fs=require('fs');var Redis=require(_0xf01c('0x2'));var db=require(_0xf01c('0x3'))['db'];var utils=require(_0xf01c('0x4'));var logger=require(_0xf01c('0x5'))(_0xf01c('0x6'));var config=require(_0xf01c('0x7'));var jayson=require(_0xf01c('0x8'));var client=jayson[_0xf01c('0x9')][_0xf01c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a2024,_0x4a89ec,_0xb7392f){return new BPromise(function(_0x41b0c6,_0x7ed981){return client[_0xf01c('0xb')](_0x1a2024,_0xb7392f)['then'](function(_0x3035aa){logger[_0xf01c('0xc')](_0xf01c('0xd'),_0x4a89ec,_0xf01c('0xe'));logger[_0xf01c('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4a89ec,'request\x20sent',JSON[_0xf01c('0x10')](_0x3035aa));if(_0x3035aa['error']){if(_0x3035aa['error'][_0xf01c('0x11')]===0x1f4){logger['error'](_0xf01c('0xd'),_0x4a89ec,_0x3035aa[_0xf01c('0x12')][_0xf01c('0x13')]);return _0x7ed981(_0x3035aa[_0xf01c('0x12')]['message']);}logger[_0xf01c('0x12')](_0xf01c('0xd'),_0x4a89ec,_0x3035aa[_0xf01c('0x12')][_0xf01c('0x13')]);return _0x41b0c6(_0x3035aa[_0xf01c('0x12')]['message']);}else{logger[_0xf01c('0xc')](_0xf01c('0xd'),_0x4a89ec,_0xf01c('0xe'));_0x41b0c6(_0x3035aa[_0xf01c('0x14')]['message']);}})[_0xf01c('0x15')](function(_0xd783e9){logger[_0xf01c('0x12')](_0xf01c('0xd'),_0x4a89ec,_0xd783e9);_0x7ed981(_0xd783e9);});});} \ No newline at end of file +var _0x6f58=['info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x11e5c0,_0x3d493d){var _0x1270db=function(_0x564804){while(--_0x564804){_0x11e5c0['push'](_0x11e5c0['shift']());}};_0x1270db(++_0x3d493d);}(_0x6f58,0x182));var _0x86f5=function(_0x3aff20,_0x508ccc){_0x3aff20=_0x3aff20-0x0;var _0x389e89=_0x6f58[_0x3aff20];return _0x389e89;};'use strict';var _=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var moment=require(_0x86f5('0x2'));var BPromise=require(_0x86f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86f5('0x5'));var logger=require(_0x86f5('0x6'))(_0x86f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x86f5('0x8'));var client=jayson[_0x86f5('0x9')][_0x86f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c73a,_0x1fbb29,_0x4ac57c){return new BPromise(function(_0x586888,_0x46c885){return client[_0x86f5('0xb')](_0x31c73a,_0x4ac57c)[_0x86f5('0xc')](function(_0x549b8b){logger[_0x86f5('0xd')](_0x86f5('0xe'),_0x1fbb29,'request\x20sent');logger['debug'](_0x86f5('0xf'),_0x1fbb29,_0x86f5('0x10'),JSON[_0x86f5('0x11')](_0x549b8b));if(_0x549b8b['error']){if(_0x549b8b[_0x86f5('0x12')]['code']===0x1f4){logger[_0x86f5('0x12')](_0x86f5('0xe'),_0x1fbb29,_0x549b8b[_0x86f5('0x12')][_0x86f5('0x13')]);return _0x46c885(_0x549b8b[_0x86f5('0x12')][_0x86f5('0x13')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1fbb29,_0x549b8b[_0x86f5('0x12')]['message']);return _0x586888(_0x549b8b['error'][_0x86f5('0x13')]);}else{logger['info'](_0x86f5('0xe'),_0x1fbb29,_0x86f5('0x10'));_0x586888(_0x549b8b[_0x86f5('0x14')][_0x86f5('0x13')]);}})['catch'](function(_0x4889e7){logger[_0x86f5('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x1fbb29,_0x4889e7);_0x46c885(_0x4889e7);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 74b1dab..da28176 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 _0xd58a=['exports','INTEGER','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd58a,0x15b));var _0xad58=function(_0x315432,_0x1f766f){_0x315432=_0x315432-0x0;var _0x52cef5=_0xd58a[_0x315432];return _0x52cef5;};'use strict';var Sequelize=require(_0xad58('0x0'));module[_0xad58('0x1')]={'UserId':{'type':Sequelize[_0xad58('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xad58('0x2')]}}; \ No newline at end of file +var _0x31e8=['exports','INTEGER','sequelize'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x31e8,0x1b2));var _0x831e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x31e8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x831e('0x0'));module[_0x831e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x831e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e7b3014..3e51786 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(_0xc18e8f,_0x5c7b80){var _0x522694=function(_0x303cd6){while(--_0x303cd6){_0xc18e8f['push'](_0xc18e8f['shift']());}};_0x522694(++_0x5c7b80);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x245282,_0x3f8f50){var _0x5c998e=function(_0x212563){while(--_0x212563){_0x245282['push'](_0x245282['shift']());}};_0x5c998e(++_0x3f8f50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 32487e7..08950cf 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x25fc8f,_0x503318){var _0x316eba=function(_0x2c5fce){while(--_0x2c5fce){_0x25fc8f['push'](_0x25fc8f['shift']());}};_0x316eba(++_0x503318);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xcb91[_0x8af54b];return _0x27d8f0;};'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(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 501aa03..e55fe13 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 _0x1f13=['INTEGER','sequelize','exports'];(function(_0x5c0014,_0x7e9328){var _0x9eb66a=function(_0x1bba13){while(--_0x1bba13){_0x5c0014['push'](_0x5c0014['shift']());}};_0x9eb66a(++_0x7e9328);}(_0x1f13,0x1e7));var _0x31f1=function(_0x2db0cd,_0x54b07d){_0x2db0cd=_0x2db0cd-0x0;var _0x21332d=_0x1f13[_0x2db0cd];return _0x21332d;};'use strict';var Sequelize=require(_0x31f1('0x0'));module[_0x31f1('0x1')]={'penalty':{'type':Sequelize[_0x31f1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6088=['sequelize','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6088,0x188));var _0x8608=function(_0x2be345,_0x320e80){_0x2be345=_0x2be345-0x0;var _0x53db79=_0x6088[_0x2be345];return _0x53db79;};'use strict';var Sequelize=require(_0x8608('0x0'));module[_0x8608('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 88a25a2..142c28b 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 _0x2e4e=['./userVoiceQueue.attributes','exports','define','user_has_voice_queues','util','api','request-promise','path','rimraf'];(function(_0x492e2e,_0x5ce525){var _0x5344ec=function(_0x12dec9){while(--_0x12dec9){_0x492e2e['push'](_0x492e2e['shift']());}};_0x5344ec(++_0x5ce525);}(_0x2e4e,0x112));var _0xe2e4=function(_0xc1c9bf,_0x2ee118){_0xc1c9bf=_0xc1c9bf-0x0;var _0x53ee1f=_0x2e4e[_0xc1c9bf];return _0x53ee1f;};'use strict';var _=require('lodash');var util=require(_0xe2e4('0x0'));var logger=require('../../config/logger')(_0xe2e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe2e4('0x2'));var fs=require('fs');var path=require(_0xe2e4('0x3'));var rimraf=require(_0xe2e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xe2e4('0x5'));module[_0xe2e4('0x6')]=function(_0x2721d1,_0x1f9463){return _0x2721d1[_0xe2e4('0x7')]('UserVoiceQueue',attributes,{'tableName':_0xe2e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4cd=['define','UserVoiceQueue','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x19635b,_0x5e7134){var _0x182b89=function(_0x1ec2a1){while(--_0x1ec2a1){_0x19635b['push'](_0x19635b['shift']());}};_0x182b89(++_0x5e7134);}(_0xa4cd,0x70));var _0xda4c=function(_0xa19c53,_0x188f53){_0xa19c53=_0xa19c53-0x0;var _0x447226=_0xa4cd[_0xa19c53];return _0x447226;};'use strict';var _=require(_0xda4c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda4c('0x1'));var moment=require(_0xda4c('0x2'));var BPromise=require('bluebird');var rp=require(_0xda4c('0x3'));var fs=require('fs');var path=require(_0xda4c('0x4'));var rimraf=require(_0xda4c('0x5'));var config=require(_0xda4c('0x6'));var attributes=require(_0xda4c('0x7'));module['exports']=function(_0x5521f8,_0x263496){return _0x5521f8[_0xda4c('0x8')](_0xda4c('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 84fc4a0..53c0f9d 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 _0x90b3=['http','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x90b3,0xf1));var _0x390b=function(_0x57961a,_0x5c91dd){_0x57961a=_0x57961a-0x0;var _0x52fccf=_0x90b3[_0x57961a];return _0x52fccf;};'use strict';var _=require(_0x390b('0x0'));var util=require(_0x390b('0x1'));var moment=require(_0x390b('0x2'));var BPromise=require(_0x390b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x390b('0x4'))['db'];var utils=require(_0x390b('0x5'));var logger=require(_0x390b('0x6'))(_0x390b('0x7'));var config=require(_0x390b('0x8'));var jayson=require(_0x390b('0x9'));var client=jayson[_0x390b('0xa')][_0x390b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc9c89,_0x4537b0,_0x350bca){return new BPromise(function(_0x342d1f,_0x8fa854){return client['request'](_0xc9c89,_0x350bca)['then'](function(_0x134805){logger['info'](_0x390b('0xc'),_0x4537b0,'request\x20sent');logger[_0x390b('0xd')](_0x390b('0xe'),_0x4537b0,_0x390b('0xf'),JSON[_0x390b('0x10')](_0x134805));if(_0x134805[_0x390b('0x11')]){if(_0x134805[_0x390b('0x11')]['code']===0x1f4){logger[_0x390b('0x11')](_0x390b('0xc'),_0x4537b0,_0x134805[_0x390b('0x11')][_0x390b('0x12')]);return _0x8fa854(_0x134805[_0x390b('0x11')][_0x390b('0x12')]);}logger[_0x390b('0x11')](_0x390b('0xc'),_0x4537b0,_0x134805[_0x390b('0x11')][_0x390b('0x12')]);return _0x342d1f(_0x134805['error'][_0x390b('0x12')]);}else{logger[_0x390b('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x4537b0,_0x390b('0xf'));_0x342d1f(_0x134805['result']['message']);}})[_0x390b('0x14')](function(_0x335ebc){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4537b0,_0x335ebc);_0x8fa854(_0x335ebc);});});} \ No newline at end of file +var _0x6cfa=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6cfa,0xa6));var _0xa6cf=function(_0x30726a,_0x5cef0c){_0x30726a=_0x30726a-0x0;var _0x471bd2=_0x6cfa[_0x30726a];return _0x471bd2;};'use strict';var _=require(_0xa6cf('0x0'));var util=require(_0xa6cf('0x1'));var moment=require('moment');var BPromise=require(_0xa6cf('0x2'));var rs=require(_0xa6cf('0x3'));var fs=require('fs');var Redis=require(_0xa6cf('0x4'));var db=require(_0xa6cf('0x5'))['db'];var utils=require(_0xa6cf('0x6'));var logger=require(_0xa6cf('0x7'))(_0xa6cf('0x8'));var config=require(_0xa6cf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa6cf('0xa')][_0xa6cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ad04c,_0x296179,_0x52999e){return new BPromise(function(_0x4eb3c8,_0x4824ec){return client[_0xa6cf('0xc')](_0x1ad04c,_0x52999e)[_0xa6cf('0xd')](function(_0x54a535){logger[_0xa6cf('0xe')](_0xa6cf('0xf'),_0x296179,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x296179,_0xa6cf('0x10'),JSON[_0xa6cf('0x11')](_0x54a535));if(_0x54a535[_0xa6cf('0x12')]){if(_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x13')]===0x1f4){logger['error'](_0xa6cf('0xf'),_0x296179,_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);return _0x4824ec(_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);}logger[_0xa6cf('0x12')](_0xa6cf('0xf'),_0x296179,_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);return _0x4eb3c8(_0x54a535['error'][_0xa6cf('0x14')]);}else{logger[_0xa6cf('0xe')](_0xa6cf('0xf'),_0x296179,_0xa6cf('0x10'));_0x4eb3c8(_0x54a535[_0xa6cf('0x15')]['message']);}})['catch'](function(_0x42b695){logger[_0xa6cf('0x12')](_0xa6cf('0xf'),_0x296179,_0x42b695);_0x4824ec(_0x42b695);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 03dfca6..b0d85e6 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x404a11,_0x5d5647){var _0x471865=function(_0x2e3bc8){while(--_0x2e3bc8){_0x404a11['push'](_0x404a11['shift']());}};_0x471865(++_0x5d5647);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x54e4fd,_0x4059d4){var _0x50cbb2=function(_0x47549d){while(--_0x47549d){_0x54e4fd['push'](_0x54e4fd['shift']());}};_0x50cbb2(++_0x4059d4);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 0948d40..eafaa76 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 _0x25f3=['exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x48e7f9,_0x498542){var _0x10f99e=function(_0x4eb862){while(--_0x4eb862){_0x48e7f9['push'](_0x48e7f9['shift']());}};_0x10f99e(++_0x498542);}(_0x25f3,0xd8));var _0x325f=function(_0x5f2e4a,_0x2ff156){_0x5f2e4a=_0x5f2e4a-0x0;var _0x29dc43=_0x25f3[_0x5f2e4a];return _0x29dc43;};'use strict';var Sequelize=require('sequelize');module[_0x325f('0x0')]={'uniqueid':{'type':Sequelize[_0x325f('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x325f('0x2')},'membername':{'type':Sequelize[_0x325f('0x3')],'allowNull':![],'comment':_0x325f('0x2')},'UserId':{'type':Sequelize[_0x325f('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x325f('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x325f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x325f('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x325f('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x325f('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x325f('0x2')},'paused':{'type':Sequelize[_0x325f('0x1')](0xb),'defaultValue':0x0,'comment':_0x325f('0x2')}}; \ No newline at end of file +var _0xd9b9=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x57aa3d,_0x4c4899){var _0x4a6cc6=function(_0x210859){while(--_0x210859){_0x57aa3d['push'](_0x57aa3d['shift']());}};_0x4a6cc6(++_0x4c4899);}(_0xd9b9,0x118));var _0x9d9b=function(_0x16d278,_0x19ce90){_0x16d278=_0x16d278-0x0;var _0x3e4b01=_0xd9b9[_0x16d278];return _0x3e4b01;};'use strict';var Sequelize=require(_0x9d9b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9d9b('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9d9b('0x2')},'membername':{'type':Sequelize[_0x9d9b('0x3')],'allowNull':![],'comment':_0x9d9b('0x2')},'UserId':{'type':Sequelize[_0x9d9b('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9d9b('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x9d9b('0x2')},'VoiceQueueId':{'type':Sequelize[_0x9d9b('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x9d9b('0x2')},'penalty':{'type':Sequelize[_0x9d9b('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x9d9b('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 2c2e21f..b9912d4 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 _0x9ac8=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xab4a7c,_0x28b640){var _0x4b0bd2=function(_0x254009){while(--_0x254009){_0xab4a7c['push'](_0xab4a7c['shift']());}};_0x4b0bd2(++_0x28b640);}(_0x9ac8,0xea));var _0x89ac=function(_0x3c6f85,_0x46c714){_0x3c6f85=_0x3c6f85-0x0;var _0x48ba4d=_0x9ac8[_0x3c6f85];return _0x48ba4d;};'use strict';var EventEmitter=require(_0x89ac('0x0'));var UserVoiceQueueRt=require(_0x89ac('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x89ac('0x2')](0x0);var events={'afterCreate':_0x89ac('0x3'),'afterUpdate':_0x89ac('0x4'),'afterDestroy':_0x89ac('0x5')};function emitEvent(_0x30f3c8){return function(_0xbeabd,_0x8bc464,_0x25ed22){UserVoiceQueueRtEvents[_0x89ac('0x6')](_0x30f3c8+':'+_0xbeabd['id'],_0xbeabd);UserVoiceQueueRtEvents['emit'](_0x30f3c8,_0xbeabd);_0x25ed22(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x89ac('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x02ca=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5c9403,_0x28e328){var _0x1d05fd=function(_0x2c7a19){while(--_0x2c7a19){_0x5c9403['push'](_0x5c9403['shift']());}};_0x1d05fd(++_0x28e328);}(_0x02ca,0xe7));var _0xa02c=function(_0x2be255,_0x250130){_0x2be255=_0x2be255-0x0;var _0x491cf3=_0x02ca[_0x2be255];return _0x491cf3;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xa02c('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa02c('0x1')](0x0);var events={'afterCreate':_0xa02c('0x2'),'afterUpdate':'update','afterDestroy':_0xa02c('0x3')};function emitEvent(_0x10fbe5){return function(_0x1512d8,_0x2ffe22,_0xebe969){UserVoiceQueueRtEvents['emit'](_0x10fbe5+':'+_0x1512d8['id'],_0x1512d8);UserVoiceQueueRtEvents[_0xa02c('0x4')](_0x10fbe5,_0x1512d8);_0xebe969(null);};}for(var e in events){if(events[_0xa02c('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xa02c('0x6')](e,emitEvent(event));}}module[_0xa02c('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6c10269..2216f01 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 _0x5940=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','util'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x5940,0x137));var _0x0594=function(_0x26b5fa,_0x1bea6f){_0x26b5fa=_0x26b5fa-0x0;var _0x4568c9=_0x5940[_0x26b5fa];return _0x4568c9;};'use strict';var _=require('lodash');var util=require(_0x0594('0x0'));var logger=require(_0x0594('0x1'))(_0x0594('0x2'));var moment=require('moment');var BPromise=require(_0x0594('0x3'));var rp=require(_0x0594('0x4'));var fs=require('fs');var path=require(_0x0594('0x5'));var rimraf=require(_0x0594('0x6'));var config=require(_0x0594('0x7'));var attributes=require(_0x0594('0x8'));module[_0x0594('0x9')]=function(_0x1662d7,_0x3bcf94){return _0x1662d7[_0x0594('0xa')](_0x0594('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56cf=['exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x56cf,0x18b));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require('util');var logger=require(_0xf56c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf56c('0x2'));var rimraf=require('rimraf');var config=require(_0xf56c('0x3'));var attributes=require(_0xf56c('0x4'));module[_0xf56c('0x5')]=function(_0x595b1,_0x51c061){return _0x595b1['define'](_0xf56c('0x6'),attributes,{'tableName':_0xf56c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 0922037..3c6af0e 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 _0x6c79=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x2db458,_0x462095){var _0xa8724a=function(_0x46800a){while(--_0x46800a){_0x2db458['push'](_0x2db458['shift']());}};_0xa8724a(++_0x462095);}(_0x6c79,0xd9));var _0x96c7=function(_0x1fa022,_0x5a1b71){_0x1fa022=_0x1fa022-0x0;var _0x1098d7=_0x6c79[_0x1fa022];return _0x1098d7;};'use strict';var _=require('lodash');var util=require(_0x96c7('0x0'));var moment=require('moment');var BPromise=require(_0x96c7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96c7('0x2'));var db=require(_0x96c7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x96c7('0x4'))(_0x96c7('0x5'));var config=require(_0x96c7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x96c7('0x7')]({'port':0x232a});config[_0x96c7('0x8')]=_[_0x96c7('0x9')](config[_0x96c7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x96c7('0xa'))(new Redis(config['redis']));require(_0x96c7('0xb'))['register'](socket);function respondWithRpcPromise(_0x574653,_0x46894a,_0x518f92){return new BPromise(function(_0x32145f,_0x1ea355){return client[_0x96c7('0xc')](_0x574653,_0x518f92)[_0x96c7('0xd')](function(_0x265ad7){logger[_0x96c7('0xe')](_0x96c7('0xf'),_0x46894a,_0x96c7('0x10'));logger[_0x96c7('0x11')](_0x96c7('0x12'),_0x46894a,_0x96c7('0x10'),JSON[_0x96c7('0x13')](_0x265ad7));if(_0x265ad7[_0x96c7('0x14')]){if(_0x265ad7['error']['code']===0x1f4){logger['error'](_0x96c7('0xf'),_0x46894a,_0x265ad7['error'][_0x96c7('0x15')]);return _0x1ea355(_0x265ad7[_0x96c7('0x14')][_0x96c7('0x15')]);}logger[_0x96c7('0x14')](_0x96c7('0xf'),_0x46894a,_0x265ad7[_0x96c7('0x14')][_0x96c7('0x15')]);return _0x32145f(_0x265ad7[_0x96c7('0x14')][_0x96c7('0x15')]);}else{logger[_0x96c7('0xe')](_0x96c7('0xf'),_0x46894a,_0x96c7('0x10'));_0x32145f(_0x265ad7[_0x96c7('0x16')][_0x96c7('0x15')]);}})[_0x96c7('0x17')](function(_0x119335){logger[_0x96c7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46894a,_0x119335);_0x1ea355(_0x119335);});});}exports[_0x96c7('0x18')]=function(_0x2beee7){var _0x2e6cc4=this;return new Promise(function(_0x58e2ad,_0x240dae){return db[_0x96c7('0x19')]['findAll']({'raw':_0x2beee7['options']?_0x2beee7[_0x96c7('0x1a')][_0x96c7('0x1b')]===undefined?!![]:![]:!![],'where':_0x2beee7[_0x96c7('0x1a')]?_0x2beee7['options']['where']||null:null,'attributes':[[db[_0x96c7('0x1c')]['fn']('COUNT',db[_0x96c7('0x1c')]['fn']('IF',db['sequelize'][_0x96c7('0x1d')](_0x96c7('0x1e')))),'outboundQueuePauses']]})['then'](function(_0x2e7a36){logger[_0x96c7('0xe')](_0x96c7('0x18'),_0x2beee7);logger[_0x96c7('0x11')]('GetVoiceQueueRtPauses',_0x2beee7,JSON[_0x96c7('0x13')](_0x2e7a36));_0x58e2ad(_0x2e7a36);})[_0x96c7('0x17')](function(_0x490923){logger[_0x96c7('0x14')](_0x96c7('0x18'),_0x490923[_0x96c7('0x15')],_0x2beee7);_0x240dae(_0x2e6cc4[_0x96c7('0x14')](0x1f4,_0x490923[_0x96c7('0x15')]));});});}; \ No newline at end of file +var _0xc117=['register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x539e71,_0x4deb48){var _0xe1e8b8=function(_0x37a803){while(--_0x37a803){_0x539e71['push'](_0x539e71['shift']());}};_0xe1e8b8(++_0x4deb48);}(_0xc117,0xbc));var _0x7c11=function(_0x5cef55,_0x53e114){_0x5cef55=_0x5cef55-0x0;var _0x20c353=_0xc117[_0x5cef55];return _0x20c353;};'use strict';var _=require(_0x7c11('0x0'));var util=require(_0x7c11('0x1'));var moment=require('moment');var BPromise=require(_0x7c11('0x2'));var rs=require(_0x7c11('0x3'));var fs=require('fs');var Redis=require(_0x7c11('0x4'));var db=require(_0x7c11('0x5'))['db'];var utils=require(_0x7c11('0x6'));var logger=require(_0x7c11('0x7'))(_0x7c11('0x8'));var config=require(_0x7c11('0x9'));var jayson=require(_0x7c11('0xa'));var client=jayson[_0x7c11('0xb')][_0x7c11('0xc')]({'port':0x232a});config['redis']=_[_0x7c11('0xd')](config[_0x7c11('0xe')],{'host':_0x7c11('0xf'),'port':0x18eb});var socket=require(_0x7c11('0x10'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x7c11('0x11')](socket);function respondWithRpcPromise(_0x1f18da,_0x2d9f8e,_0x55aff7){return new BPromise(function(_0xddde98,_0x4cd340){return client[_0x7c11('0x12')](_0x1f18da,_0x55aff7)[_0x7c11('0x13')](function(_0x541105){logger[_0x7c11('0x14')](_0x7c11('0x15'),_0x2d9f8e,_0x7c11('0x16'));logger[_0x7c11('0x17')](_0x7c11('0x18'),_0x2d9f8e,_0x7c11('0x16'),JSON['stringify'](_0x541105));if(_0x541105[_0x7c11('0x19')]){if(_0x541105[_0x7c11('0x19')][_0x7c11('0x1a')]===0x1f4){logger[_0x7c11('0x19')](_0x7c11('0x15'),_0x2d9f8e,_0x541105['error'][_0x7c11('0x1b')]);return _0x4cd340(_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);return _0xddde98(_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);}else{logger[_0x7c11('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x7c11('0x16'));_0xddde98(_0x541105[_0x7c11('0x1c')][_0x7c11('0x1b')]);}})['catch'](function(_0x9d7246){logger[_0x7c11('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x9d7246);_0x4cd340(_0x9d7246);});});}exports[_0x7c11('0x1d')]=function(_0x4126ee){var _0x2bf566=this;return new Promise(function(_0x1dd0f4,_0x466cf7){return db[_0x7c11('0x1e')]['findAll']({'raw':_0x4126ee[_0x7c11('0x1f')]?_0x4126ee[_0x7c11('0x1f')][_0x7c11('0x20')]===undefined?!![]:![]:!![],'where':_0x4126ee[_0x7c11('0x1f')]?_0x4126ee[_0x7c11('0x1f')][_0x7c11('0x21')]||null:null,'attributes':[[db[_0x7c11('0x22')]['fn'](_0x7c11('0x23'),db[_0x7c11('0x22')]['fn']('IF',db[_0x7c11('0x22')][_0x7c11('0x24')](_0x7c11('0x25')))),_0x7c11('0x26')]]})[_0x7c11('0x13')](function(_0x28d8c3){logger['info'](_0x7c11('0x1d'),_0x4126ee);logger[_0x7c11('0x17')](_0x7c11('0x1d'),_0x4126ee,JSON[_0x7c11('0x27')](_0x28d8c3));_0x1dd0f4(_0x28d8c3);})[_0x7c11('0x28')](function(_0x128f57){logger[_0x7c11('0x19')](_0x7c11('0x1d'),_0x128f57['message'],_0x4126ee);_0x466cf7(_0x2bf566['error'](0x1f4,_0x128f57[_0x7c11('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c234c9e..93668a2 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 _0x8917=['emit','removeListener','length','./userVoiceQueueRt.events','remove','update'];(function(_0x1d80dc,_0xd2303e){var _0x243386=function(_0x588c2d){while(--_0x588c2d){_0x1d80dc['push'](_0x1d80dc['shift']());}};_0x243386(++_0xd2303e);}(_0x8917,0x1d7));var _0x7891=function(_0x6bd399,_0x570a95){_0x6bd399=_0x6bd399-0x0;var _0x3c32ec=_0x8917[_0x6bd399];return _0x3c32ec;};'use strict';var UserVoiceQueueRtEvents=require(_0x7891('0x0'));var events=['save',_0x7891('0x1'),_0x7891('0x2')];function createListener(_0xfc1628,_0x129608){return function(_0xdf5de1){_0x129608[_0x7891('0x3')](_0xfc1628,_0xdf5de1);};}function removeListener(_0x2b5570,_0x24234b){return function(){UserVoiceQueueRtEvents[_0x7891('0x4')](_0x2b5570,_0x24234b);};}exports['register']=function(_0x46b52a){for(var _0x43a48e=0x0,_0x442944=events[_0x7891('0x5')];_0x43a48e<_0x442944;_0x43a48e++){var _0x4722b7=events[_0x43a48e];var _0x452a6d=createListener('userVoiceQueueRt:'+_0x4722b7,_0x46b52a);UserVoiceQueueRtEvents['on'](_0x4722b7,_0x452a6d);}}; \ No newline at end of file +var _0xdf70=['removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x1a1072,_0x84a807){var _0x415142=function(_0x3c20d6){while(--_0x3c20d6){_0x1a1072['push'](_0x1a1072['shift']());}};_0x415142(++_0x84a807);}(_0xdf70,0x86));var _0x0df7=function(_0x4025b4,_0x339dd1){_0x4025b4=_0x4025b4-0x0;var _0x3d5fad=_0xdf70[_0x4025b4];return _0x3d5fad;};'use strict';var UserVoiceQueueRtEvents=require(_0x0df7('0x0'));var events=[_0x0df7('0x1'),_0x0df7('0x2'),'update'];function createListener(_0x380bec,_0x2267dd){return function(_0x530905){_0x2267dd[_0x0df7('0x3')](_0x380bec,_0x530905);};}function removeListener(_0x4ae128,_0x278b96){return function(){UserVoiceQueueRtEvents[_0x0df7('0x4')](_0x4ae128,_0x278b96);};}exports['register']=function(_0x523ac0){for(var _0x2521b6=0x0,_0x42090d=events['length'];_0x2521b6<_0x42090d;_0x2521b6++){var _0x1f1680=events[_0x2521b6];var _0x392337=createListener(_0x0df7('0x5')+_0x1f1680,_0x523ac0);UserVoiceQueueRtEvents['on'](_0x1f1680,_0x392337);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d6d106c..ef66d44 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xcb34e2,_0x1640db){var _0x30caef=function(_0x19e447){while(--_0x19e447){_0xcb34e2['push'](_0xcb34e2['shift']());}};_0x30caef(++_0x1640db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f0948,_0x329e59){var _0x2c8175=function(_0x1bed09){while(--_0x1bed09){_0x1f0948['push'](_0x1f0948['shift']());}};_0x2c8175(++_0x329e59);}(_0xe706,0xa3));var _0x6e70=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xe706[_0x393d69];return _0x3cee37;};'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 bf921a5..548f044 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 _0x9493=['exports','sequelize'];(function(_0x3f1a93,_0x27ee76){var _0x2ca793=function(_0x46234f){while(--_0x46234f){_0x3f1a93['push'](_0x3f1a93['shift']());}};_0x2ca793(++_0x27ee76);}(_0x9493,0x159));var _0x3949=function(_0x1b3894,_0xb39e82){_0x1b3894=_0x1b3894-0x0;var _0x5a5a52=_0x9493[_0x1b3894];return _0x5a5a52;};'use strict';var Sequelize=require(_0x3949('0x0'));module[_0x3949('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa800=['sequelize','exports','INTEGER'];(function(_0x5b376e,_0x61c7c3){var _0x364769=function(_0xa5dce2){while(--_0xa5dce2){_0x5b376e['push'](_0x5b376e['shift']());}};_0x364769(++_0x61c7c3);}(_0xa800,0x1a7));var _0x0a80=function(_0xf93b08,_0x2559d7){_0xf93b08=_0xf93b08-0x0;var _0x12f72e=_0xa800[_0xf93b08];return _0x12f72e;};'use strict';var Sequelize=require(_0x0a80('0x0'));module[_0x0a80('0x1')]={'penalty':{'type':Sequelize[_0x0a80('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 230945d..593aaba 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 _0x5786=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird'];(function(_0x5bc888,_0x3d6d3c){var _0x4a2471=function(_0x1e9cc5){while(--_0x1e9cc5){_0x5bc888['push'](_0x5bc888['shift']());}};_0x4a2471(++_0x3d6d3c);}(_0x5786,0x19f));var _0x6578=function(_0x510d72,_0x4cec2a){_0x510d72=_0x510d72-0x0;var _0xd2db38=_0x5786[_0x510d72];return _0xd2db38;};'use strict';var _=require(_0x6578('0x0'));var util=require(_0x6578('0x1'));var logger=require('../../config/logger')(_0x6578('0x2'));var moment=require(_0x6578('0x3'));var BPromise=require(_0x6578('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6578('0x5'));var rimraf=require(_0x6578('0x6'));var config=require(_0x6578('0x7'));var attributes=require(_0x6578('0x8'));module[_0x6578('0x9')]=function(_0x9529d4,_0xaf6539){return _0x9529d4['define'](_0x6578('0xa'),attributes,{'tableName':_0x6578('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ceb=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x365c92,_0xe33979){var _0x4fa598=function(_0x405d87){while(--_0x405d87){_0x365c92['push'](_0x365c92['shift']());}};_0x4fa598(++_0xe33979);}(_0x9ceb,0x1ed));var _0xb9ce=function(_0x16318f,_0x2edf62){_0x16318f=_0x16318f-0x0;var _0x57ee83=_0x9ceb[_0x16318f];return _0x57ee83;};'use strict';var _=require(_0xb9ce('0x0'));var util=require(_0xb9ce('0x1'));var logger=require('../../config/logger')(_0xb9ce('0x2'));var moment=require(_0xb9ce('0x3'));var BPromise=require(_0xb9ce('0x4'));var rp=require(_0xb9ce('0x5'));var fs=require('fs');var path=require(_0xb9ce('0x6'));var rimraf=require(_0xb9ce('0x7'));var config=require(_0xb9ce('0x8'));var attributes=require(_0xb9ce('0x9'));module[_0xb9ce('0xa')]=function(_0x496276,_0x85b075){return _0x496276[_0xb9ce('0xb')](_0xb9ce('0xc'),attributes,{'tableName':_0xb9ce('0xd'),'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 f1cf522..cdd7841 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 _0x8965=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x62c539,_0x3eb0f0){var _0x89d7f1=function(_0x5f14cf){while(--_0x5f14cf){_0x62c539['push'](_0x62c539['shift']());}};_0x89d7f1(++_0x3eb0f0);}(_0x8965,0x91));var _0x5896=function(_0x9fcefa,_0x56704b){_0x9fcefa=_0x9fcefa-0x0;var _0x304f1a=_0x8965[_0x9fcefa];return _0x304f1a;};'use strict';var _=require(_0x5896('0x0'));var util=require(_0x5896('0x1'));var moment=require('moment');var BPromise=require(_0x5896('0x2'));var rs=require(_0x5896('0x3'));var fs=require('fs');var Redis=require(_0x5896('0x4'));var db=require(_0x5896('0x5'))['db'];var utils=require(_0x5896('0x6'));var logger=require(_0x5896('0x7'))(_0x5896('0x8'));var config=require(_0x5896('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5896('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x121e78,_0x309aff,_0x4c6dd0){return new BPromise(function(_0x3c4796,_0x9cbdf1){return client[_0x5896('0xb')](_0x121e78,_0x4c6dd0)[_0x5896('0xc')](function(_0x3d9463){logger['info'](_0x5896('0xd'),_0x309aff,_0x5896('0xe'));logger[_0x5896('0xf')](_0x5896('0x10'),_0x309aff,'request\x20sent',JSON[_0x5896('0x11')](_0x3d9463));if(_0x3d9463[_0x5896('0x12')]){if(_0x3d9463[_0x5896('0x12')][_0x5896('0x13')]===0x1f4){logger[_0x5896('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x309aff,_0x3d9463['error']['message']);return _0x9cbdf1(_0x3d9463[_0x5896('0x12')][_0x5896('0x14')]);}logger[_0x5896('0x12')](_0x5896('0xd'),_0x309aff,_0x3d9463[_0x5896('0x12')]['message']);return _0x3c4796(_0x3d9463[_0x5896('0x12')][_0x5896('0x14')]);}else{logger[_0x5896('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x309aff,_0x5896('0xe'));_0x3c4796(_0x3d9463[_0x5896('0x16')]['message']);}})[_0x5896('0x17')](function(_0x5d20e8){logger[_0x5896('0x12')](_0x5896('0xd'),_0x309aff,_0x5d20e8);_0x9cbdf1(_0x5d20e8);});});} \ No newline at end of file +var _0x3f5f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x3f5f,0xd0));var _0xf3f5=function(_0x325e1e,_0x903510){_0x325e1e=_0x325e1e-0x0;var _0x33aa0f=_0x3f5f[_0x325e1e];return _0x33aa0f;};'use strict';var _=require(_0xf3f5('0x0'));var util=require(_0xf3f5('0x1'));var moment=require(_0xf3f5('0x2'));var BPromise=require(_0xf3f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3f5('0x4'));var db=require(_0xf3f5('0x5'))['db'];var utils=require(_0xf3f5('0x6'));var logger=require('../../config/logger')(_0xf3f5('0x7'));var config=require(_0xf3f5('0x8'));var jayson=require(_0xf3f5('0x9'));var client=jayson[_0xf3f5('0xa')][_0xf3f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b562,_0x546352,_0x1d4f7e){return new BPromise(function(_0x1d3754,_0x42af1c){return client['request'](_0x15b562,_0x1d4f7e)[_0xf3f5('0xc')](function(_0x2a4e64){logger['info'](_0xf3f5('0xd'),_0x546352,_0xf3f5('0xe'));logger[_0xf3f5('0xf')](_0xf3f5('0x10'),_0x546352,_0xf3f5('0xe'),JSON[_0xf3f5('0x11')](_0x2a4e64));if(_0x2a4e64[_0xf3f5('0x12')]){if(_0x2a4e64[_0xf3f5('0x12')][_0xf3f5('0x13')]===0x1f4){logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x2a4e64['error'][_0xf3f5('0x14')]);return _0x42af1c(_0x2a4e64[_0xf3f5('0x12')][_0xf3f5('0x14')]);}logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x2a4e64['error'][_0xf3f5('0x14')]);return _0x1d3754(_0x2a4e64[_0xf3f5('0x12')]['message']);}else{logger[_0xf3f5('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x546352,_0xf3f5('0xe'));_0x1d3754(_0x2a4e64['result']['message']);}})[_0xf3f5('0x16')](function(_0x35551a){logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x35551a);_0x42af1c(_0x35551a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index c1fb9f7..06a47f2 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 _0x4b1f=['/:id','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x21fd09,_0x4cc84c){var _0xcc02f5=function(_0x138056){while(--_0x138056){_0x21fd09['push'](_0x21fd09['shift']());}};_0xcc02f5(++_0x4cc84c);}(_0x4b1f,0x195));var _0xf4b1=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x4b1f[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var path=require('path');var timeout=require(_0xf4b1('0x2'));var express=require(_0xf4b1('0x3'));var router=express[_0xf4b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf4b1('0x5'));var interaction=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0xf4b1('0x8')](),controller[_0xf4b1('0x9')]);router[_0xf4b1('0xa')](_0xf4b1('0xb'),auth[_0xf4b1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf4b1('0xc')]);router['put'](_0xf4b1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf4b1('0xd')](_0xf4b1('0xb'),auth[_0xf4b1('0x8')](),controller[_0xf4b1('0xe')]);module[_0xf4b1('0xf')]=router; \ No newline at end of file +var _0x8d0e=['./variable.controller','index','get','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22bec2,_0x235160){var _0x259c59=function(_0x2fd02f){while(--_0x2fd02f){_0x22bec2['push'](_0x22bec2['shift']());}};_0x259c59(++_0x235160);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4df4a5,_0x1b8d74){_0x4df4a5=_0x4df4a5-0x0;var _0x4193b8=_0x8d0e[_0x4df4a5];return _0x4193b8;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xf')]('/',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x10')]);router['put'](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x11')]);router['delete']('/:id',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x12')]);module[_0xe8d0('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 776a012..2b23781 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 _0x45a7=['STRING','name','sequelize','exports'];(function(_0x32a109,_0x3bb88d){var _0x342b60=function(_0x3891d4){while(--_0x3891d4){_0x32a109['push'](_0x32a109['shift']());}};_0x342b60(++_0x3bb88d);}(_0x45a7,0x17e));var _0x745a=function(_0x1062e3,_0x49349e){_0x1062e3=_0x1062e3-0x0;var _0x92e616=_0x45a7[_0x1062e3];return _0x92e616;};'use strict';var Sequelize=require(_0x745a('0x0'));module[_0x745a('0x1')]={'name':{'type':Sequelize[_0x745a('0x2')],'unique':_0x745a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x745a('0x2')]}}; \ No newline at end of file +var _0xee54=['sequelize','exports','STRING','name'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xee54,0x1f0));var _0x4ee5=function(_0x2b7c64,_0x1a0100){_0x2b7c64=_0x2b7c64-0x0;var _0x272759=_0xee54[_0x2b7c64];return _0x272759;};'use strict';var Sequelize=require(_0x4ee5('0x0'));module[_0x4ee5('0x1')]={'name':{'type':Sequelize[_0x4ee5('0x2')],'unique':_0x4ee5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4ee5('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 00831a7..8b64e92 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 _0xec5b=['stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','destroy','get','Variables','UserProfileResource','then','error'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xec5b,0x17b));var _0xbec5=function(_0x28aa9b,_0x45bc9a){_0x28aa9b=_0x28aa9b-0x0;var _0x4f4a0e=_0xec5b[_0x28aa9b];return _0x4f4a0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbec5('0x0'));var zipdir=require(_0xbec5('0x1'));var jsonpatch=require(_0xbec5('0x2'));var rp=require(_0xbec5('0x3'));var moment=require(_0xbec5('0x4'));var BPromise=require(_0xbec5('0x5'));var Mustache=require(_0xbec5('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbec5('0x7'));var fs=require('fs');var fs_extra=require(_0xbec5('0x8'));var _=require(_0xbec5('0x9'));var squel=require(_0xbec5('0xa'));var crypto=require(_0xbec5('0xb'));var jsforce=require(_0xbec5('0xc'));var deskjs=require(_0xbec5('0xd'));var toCsv=require(_0xbec5('0xe'));var querystring=require(_0xbec5('0xf'));var Papa=require(_0xbec5('0x10'));var Redis=require(_0xbec5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbec5('0x12'));var as=require(_0xbec5('0x13'));var hardwareService=require(_0xbec5('0x14'));var logger=require(_0xbec5('0x15'))(_0xbec5('0x16'));var utils=require(_0xbec5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x507e31,_0x42a842){_0x42a842=_0x42a842||0xcc;return function(_0x3a857d){if(_0x3a857d){return _0x507e31[_0xbec5('0x18')](_0x42a842);}return _0x507e31[_0xbec5('0x19')](_0x42a842)[_0xbec5('0x1a')]();};}function respondWithResult(_0x13c5a5,_0x25408c){_0x25408c=_0x25408c||0xc8;return function(_0x27091c){if(_0x27091c){return _0x13c5a5[_0xbec5('0x19')](_0x25408c)[_0xbec5('0x1b')](_0x27091c);}};}function respondWithFilteredResult(_0x2099bb,_0x3aab4a){return function(_0x1a88a5){if(_0x1a88a5){var _0x219559=typeof _0x3aab4a[_0xbec5('0x1c')]===_0xbec5('0x1d')&&typeof _0x3aab4a['limit']===_0xbec5('0x1d');var _0x2fda61=_0x1a88a5[_0xbec5('0x1e')];var _0x36ef2b=_0x219559?0x0:_0x3aab4a[_0xbec5('0x1c')];var _0x59c810=_0x219559?_0x1a88a5['count']:_0x3aab4a['offset']+_0x3aab4a['limit'];var _0x3cdd2b;if(_0x59c810>=_0x2fda61){_0x59c810=_0x2fda61;_0x3cdd2b=0xc8;}else{_0x3cdd2b=0xce;}_0x2099bb['status'](_0x3cdd2b);return _0x2099bb[_0xbec5('0x1f')](_0xbec5('0x20'),_0x36ef2b+'-'+_0x59c810+'/'+_0x2fda61)[_0xbec5('0x1b')](_0x1a88a5);}return null;};}function patchUpdates(_0x611d8f){return function(_0x57166b){try{jsonpatch[_0xbec5('0x21')](_0x57166b,_0x611d8f,!![]);}catch(_0x23f425){return BPromise['reject'](_0x23f425);}return _0x57166b[_0xbec5('0x22')]();};}function saveUpdates(_0x3a797c,_0x3b62b0){return function(_0x36faee){if(_0x36faee){return _0x36faee['update'](_0x3a797c)['then'](function(_0x410fd0){return _0x410fd0;});}return null;};}function removeEntity(_0x1a3af2,_0x574164){return function(_0x2a4b82){if(_0x2a4b82){return _0x2a4b82[_0xbec5('0x23')]()['then'](function(){var _0x5f2152=_0x2a4b82[_0xbec5('0x24')]({'plain':!![]});var _0x53ce72=_0xbec5('0x25');return db[_0xbec5('0x26')][_0xbec5('0x23')]({'where':{'type':_0x53ce72,'resourceId':_0x5f2152['id']}})[_0xbec5('0x27')](function(){return _0x2a4b82;});})[_0xbec5('0x27')](function(){_0x1a3af2[_0xbec5('0x19')](0xcc)[_0xbec5('0x1a')]();});}};}function handleEntityNotFound(_0x200a19,_0x578e03){return function(_0x539e97){if(!_0x539e97){_0x200a19[_0xbec5('0x18')](0x194);}return _0x539e97;};}function handleError(_0x4ad11a,_0xa23c9){_0xa23c9=_0xa23c9||0x1f4;return function(_0x12f94f){logger[_0xbec5('0x28')](_0x12f94f[_0xbec5('0x29')]);if(_0x12f94f['name']){delete _0x12f94f[_0xbec5('0x2a')];}_0x4ad11a[_0xbec5('0x19')](_0xa23c9)[_0xbec5('0x2b')](_0x12f94f);};}exports[_0xbec5('0x2c')]=function(_0x27ec0f,_0x24f2f9){var _0x586d47={},_0x32a264={},_0x45957e={'count':0x0,'rows':[]};var _0x570b34=_[_0xbec5('0x2d')](db[_0xbec5('0x2e')][_0xbec5('0x2f')],function(_0x4f1ba7){return{'name':_0x4f1ba7['fieldName'],'type':_0x4f1ba7[_0xbec5('0x30')][_0xbec5('0x31')]};});_0x32a264[_0xbec5('0x32')]=_['map'](_0x570b34,_0xbec5('0x2a'));_0x32a264[_0xbec5('0x33')]=_[_0xbec5('0x34')](_0x27ec0f[_0xbec5('0x33')]);_0x32a264[_0xbec5('0x35')]=_[_0xbec5('0x36')](_0x32a264[_0xbec5('0x32')],_0x32a264['query']);_0x586d47[_0xbec5('0x37')]=_[_0xbec5('0x36')](_0x32a264['model'],qs[_0xbec5('0x38')](_0x27ec0f[_0xbec5('0x33')]['fields']));_0x586d47[_0xbec5('0x37')]=_0x586d47['attributes'][_0xbec5('0x39')]?_0x586d47[_0xbec5('0x37')]:_0x32a264[_0xbec5('0x32')];if(!_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x3a')](_0xbec5('0x3b'))){_0x586d47[_0xbec5('0x3c')]=qs[_0xbec5('0x3c')](_0x27ec0f[_0xbec5('0x33')]['limit']);_0x586d47[_0xbec5('0x1c')]=qs[_0xbec5('0x1c')](_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x1c')]);}_0x586d47[_0xbec5('0x3d')]=qs[_0xbec5('0x3e')](_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x3e')]);_0x586d47[_0xbec5('0x3f')]=qs[_0xbec5('0x35')](_[_0xbec5('0x40')](_0x27ec0f[_0xbec5('0x33')],_0x32a264[_0xbec5('0x35')]),_0x570b34);if(_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x41')]){_0x586d47[_0xbec5('0x3f')]=_[_0xbec5('0x42')](_0x586d47[_0xbec5('0x3f')],{'$or':_[_0xbec5('0x2d')](_0x570b34,function(_0x53b65f){if(_0x53b65f[_0xbec5('0x30')]!=='VIRTUAL'){var _0x211877={};_0x211877[_0x53b65f['name']]={'$like':'%'+_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x41')]+'%'};return _0x211877;}})});}_0x586d47=_[_0xbec5('0x42')]({},_0x586d47,_0x27ec0f['options']);var _0x101136={'where':_0x586d47[_0xbec5('0x3f')]};return db[_0xbec5('0x2e')][_0xbec5('0x1e')](_0x101136)[_0xbec5('0x27')](function(_0x287bd1){_0x45957e[_0xbec5('0x1e')]=_0x287bd1;if(_0x27ec0f[_0xbec5('0x33')][_0xbec5('0x43')]){_0x586d47['include']=[{'all':!![]}];}return db['Variable'][_0xbec5('0x44')](_0x586d47);})['then'](function(_0x46bf56){_0x45957e[_0xbec5('0x45')]=_0x46bf56;return _0x45957e;})[_0xbec5('0x27')](respondWithFilteredResult(_0x24f2f9,_0x586d47))[_0xbec5('0x46')](handleError(_0x24f2f9,null));};exports[_0xbec5('0x47')]=function(_0x2a7b94,_0x1022ad){var _0x5c73c={'raw':!![],'where':{'id':_0x2a7b94[_0xbec5('0x48')]['id']}},_0x28638a={};_0x28638a[_0xbec5('0x32')]=_[_0xbec5('0x34')](db[_0xbec5('0x2e')]['rawAttributes']);_0x28638a[_0xbec5('0x33')]=_[_0xbec5('0x34')](_0x2a7b94[_0xbec5('0x33')]);_0x28638a[_0xbec5('0x35')]=_['intersection'](_0x28638a[_0xbec5('0x32')],_0x28638a[_0xbec5('0x33')]);_0x5c73c[_0xbec5('0x37')]=_[_0xbec5('0x36')](_0x28638a[_0xbec5('0x32')],qs[_0xbec5('0x38')](_0x2a7b94[_0xbec5('0x33')][_0xbec5('0x38')]));_0x5c73c[_0xbec5('0x37')]=_0x5c73c['attributes'][_0xbec5('0x39')]?_0x5c73c['attributes']:_0x28638a[_0xbec5('0x32')];if(_0x2a7b94[_0xbec5('0x33')]['includeAll']){_0x5c73c[_0xbec5('0x49')]=[{'all':!![]}];}_0x5c73c=_['merge']({},_0x5c73c,_0x2a7b94[_0xbec5('0x4a')]);return db[_0xbec5('0x2e')][_0xbec5('0x4b')](_0x5c73c)[_0xbec5('0x27')](handleEntityNotFound(_0x1022ad,null))[_0xbec5('0x27')](respondWithResult(_0x1022ad,null))[_0xbec5('0x46')](handleError(_0x1022ad,null));};exports[_0xbec5('0x4c')]=function(_0x1f96ed,_0x3d6429){return db['Variable'][_0xbec5('0x4c')](_0x1f96ed[_0xbec5('0x4d')],{})[_0xbec5('0x27')](function(_0x246c3b){var _0x254199=_0x1f96ed[_0xbec5('0x4e')][_0xbec5('0x24')]({'plain':!![]});if(!_0x254199)throw new Error(_0xbec5('0x4f'));if(_0x254199[_0xbec5('0x50')]==='user'){var _0x3e6932=_0x246c3b['get']({'plain':!![]});var _0x2b4da7='Variables';return db['UserProfileSection'][_0xbec5('0x4b')]({'where':{'name':_0x2b4da7,'userProfileId':_0x254199[_0xbec5('0x51')]},'raw':!![]})[_0xbec5('0x27')](function(_0x35b878){if(_0x35b878&&_0x35b878['autoAssociation']===0x0){return db[_0xbec5('0x26')][_0xbec5('0x4c')]({'name':_0x3e6932[_0xbec5('0x2a')],'resourceId':_0x3e6932['id'],'type':_0x35b878[_0xbec5('0x2a')],'sectionId':_0x35b878['id']},{})[_0xbec5('0x27')](function(){return _0x246c3b;});}else{return _0x246c3b;}})[_0xbec5('0x46')](function(_0x2d758d){logger[_0xbec5('0x28')](_0xbec5('0x52'),_0x2d758d);throw _0x2d758d;});}return _0x246c3b;})[_0xbec5('0x27')](respondWithResult(_0x3d6429,0xc9))[_0xbec5('0x46')](handleError(_0x3d6429,null));};exports[_0xbec5('0x53')]=function(_0x308ebf,_0x549c8c){if(_0x308ebf[_0xbec5('0x4d')]['id']){delete _0x308ebf[_0xbec5('0x4d')]['id'];}return db[_0xbec5('0x2e')]['find']({'where':{'id':_0x308ebf[_0xbec5('0x48')]['id']}})[_0xbec5('0x27')](handleEntityNotFound(_0x549c8c,null))[_0xbec5('0x27')](saveUpdates(_0x308ebf[_0xbec5('0x4d')],null))[_0xbec5('0x27')](respondWithResult(_0x549c8c,null))[_0xbec5('0x46')](handleError(_0x549c8c,null));};exports[_0xbec5('0x23')]=function(_0x7d1eb9,_0x28c81d){return db[_0xbec5('0x2e')][_0xbec5('0x4b')]({'where':{'id':_0x7d1eb9[_0xbec5('0x48')]['id']}})[_0xbec5('0x27')](handleEntityNotFound(_0x28c81d,null))[_0xbec5('0x27')](removeEntity(_0x28c81d,null))['catch'](handleError(_0x28c81d,null));}; \ No newline at end of file +var _0xcaad=['includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','Variables','UserProfileResource','then','error','stack','name','index','Variable','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rawAttributes'];(function(_0x4368b4,_0xd9647){var _0x1d650b=function(_0x4d60d2){while(--_0x4d60d2){_0x4368b4['push'](_0x4368b4['shift']());}};_0x1d650b(++_0xd9647);}(_0xcaad,0xa5));var _0xdcaa=function(_0x3af3e3,_0x4f1af2){_0x3af3e3=_0x3af3e3-0x0;var _0x112814=_0xcaad[_0x3af3e3];return _0x112814;};'use strict';var emlformat=require(_0xdcaa('0x0'));var rimraf=require(_0xdcaa('0x1'));var zipdir=require(_0xdcaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdcaa('0x4'));var sox=require('sox');var csv=require(_0xdcaa('0x5'));var ejs=require(_0xdcaa('0x6'));var fs=require('fs');var fs_extra=require(_0xdcaa('0x7'));var _=require('lodash');var squel=require(_0xdcaa('0x8'));var crypto=require(_0xdcaa('0x9'));var jsforce=require(_0xdcaa('0xa'));var deskjs=require(_0xdcaa('0xb'));var toCsv=require(_0xdcaa('0x5'));var querystring=require(_0xdcaa('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcaa('0xd'));var qs=require(_0xdcaa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcaa('0xf'));var logger=require(_0xdcaa('0x10'))(_0xdcaa('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdcaa('0x12'));var db=require(_0xdcaa('0x13'))['db'];function respondWithStatusCode(_0x3cb2c8,_0x25da57){_0x25da57=_0x25da57||0xcc;return function(_0x17cade){if(_0x17cade){return _0x3cb2c8[_0xdcaa('0x14')](_0x25da57);}return _0x3cb2c8['status'](_0x25da57)[_0xdcaa('0x15')]();};}function respondWithResult(_0x5458d1,_0x486a42){_0x486a42=_0x486a42||0xc8;return function(_0x440a7d){if(_0x440a7d){return _0x5458d1[_0xdcaa('0x16')](_0x486a42)[_0xdcaa('0x17')](_0x440a7d);}};}function respondWithFilteredResult(_0x20528a,_0x14c45d){return function(_0x604a46){if(_0x604a46){var _0x3ad51d=typeof _0x14c45d[_0xdcaa('0x18')]===_0xdcaa('0x19')&&typeof _0x14c45d['limit']===_0xdcaa('0x19');var _0x8adabb=_0x604a46[_0xdcaa('0x1a')];var _0x159090=_0x3ad51d?0x0:_0x14c45d[_0xdcaa('0x18')];var _0x596a93=_0x3ad51d?_0x604a46[_0xdcaa('0x1a')]:_0x14c45d[_0xdcaa('0x18')]+_0x14c45d[_0xdcaa('0x1b')];var _0x3563fa;if(_0x596a93>=_0x8adabb){_0x596a93=_0x8adabb;_0x3563fa=0xc8;}else{_0x3563fa=0xce;}_0x20528a[_0xdcaa('0x16')](_0x3563fa);return _0x20528a[_0xdcaa('0x1c')](_0xdcaa('0x1d'),_0x159090+'-'+_0x596a93+'/'+_0x8adabb)[_0xdcaa('0x17')](_0x604a46);}return null;};}function patchUpdates(_0x3f72b4){return function(_0x3b39a9){try{jsonpatch['apply'](_0x3b39a9,_0x3f72b4,!![]);}catch(_0x44efd3){return BPromise['reject'](_0x44efd3);}return _0x3b39a9['save']();};}function saveUpdates(_0x1e5f28,_0x27751a){return function(_0x28ef7a){if(_0x28ef7a){return _0x28ef7a[_0xdcaa('0x1e')](_0x1e5f28)['then'](function(_0x3ffd1a){return _0x3ffd1a;});}return null;};}function removeEntity(_0x3f207a,_0x2817f9){return function(_0x3f4cb0){if(_0x3f4cb0){return _0x3f4cb0[_0xdcaa('0x1f')]()['then'](function(){var _0x445cf2=_0x3f4cb0['get']({'plain':!![]});var _0x32424b=_0xdcaa('0x20');return db[_0xdcaa('0x21')][_0xdcaa('0x1f')]({'where':{'type':_0x32424b,'resourceId':_0x445cf2['id']}})[_0xdcaa('0x22')](function(){return _0x3f4cb0;});})[_0xdcaa('0x22')](function(){_0x3f207a[_0xdcaa('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8fdc5,_0x2b7d85){return function(_0x261c97){if(!_0x261c97){_0xd8fdc5[_0xdcaa('0x14')](0x194);}return _0x261c97;};}function handleError(_0x2a06a4,_0x12945a){_0x12945a=_0x12945a||0x1f4;return function(_0xf64250){logger[_0xdcaa('0x23')](_0xf64250[_0xdcaa('0x24')]);if(_0xf64250[_0xdcaa('0x25')]){delete _0xf64250['name'];}_0x2a06a4[_0xdcaa('0x16')](_0x12945a)['send'](_0xf64250);};}exports[_0xdcaa('0x26')]=function(_0x21ccd9,_0x127339){var _0x2f5ac5={},_0x44e25e={},_0x1a9f04={'count':0x0,'rows':[]};var _0x1f5f7e=_['map'](db[_0xdcaa('0x27')]['rawAttributes'],function(_0x47380f){return{'name':_0x47380f[_0xdcaa('0x28')],'type':_0x47380f[_0xdcaa('0x29')]['key']};});_0x44e25e[_0xdcaa('0x2a')]=_[_0xdcaa('0x2b')](_0x1f5f7e,_0xdcaa('0x25'));_0x44e25e[_0xdcaa('0x2c')]=_[_0xdcaa('0x2d')](_0x21ccd9[_0xdcaa('0x2c')]);_0x44e25e[_0xdcaa('0x2e')]=_[_0xdcaa('0x2f')](_0x44e25e['model'],_0x44e25e[_0xdcaa('0x2c')]);_0x2f5ac5['attributes']=_[_0xdcaa('0x2f')](_0x44e25e['model'],qs[_0xdcaa('0x30')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x30')]));_0x2f5ac5[_0xdcaa('0x31')]=_0x2f5ac5[_0xdcaa('0x31')][_0xdcaa('0x32')]?_0x2f5ac5[_0xdcaa('0x31')]:_0x44e25e[_0xdcaa('0x2a')];if(!_0x21ccd9['query'][_0xdcaa('0x33')](_0xdcaa('0x34'))){_0x2f5ac5[_0xdcaa('0x1b')]=qs[_0xdcaa('0x1b')](_0x21ccd9[_0xdcaa('0x2c')]['limit']);_0x2f5ac5[_0xdcaa('0x18')]=qs[_0xdcaa('0x18')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x18')]);}_0x2f5ac5[_0xdcaa('0x35')]=qs[_0xdcaa('0x36')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x36')]);_0x2f5ac5[_0xdcaa('0x37')]=qs[_0xdcaa('0x2e')](_[_0xdcaa('0x38')](_0x21ccd9[_0xdcaa('0x2c')],_0x44e25e[_0xdcaa('0x2e')]),_0x1f5f7e);if(_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x39')]){_0x2f5ac5[_0xdcaa('0x37')]=_[_0xdcaa('0x3a')](_0x2f5ac5[_0xdcaa('0x37')],{'$or':_[_0xdcaa('0x2b')](_0x1f5f7e,function(_0xf93535){if(_0xf93535[_0xdcaa('0x29')]!=='VIRTUAL'){var _0x5c7208={};_0x5c7208[_0xf93535[_0xdcaa('0x25')]]={'$like':'%'+_0x21ccd9[_0xdcaa('0x2c')]['filter']+'%'};return _0x5c7208;}})});}_0x2f5ac5=_[_0xdcaa('0x3a')]({},_0x2f5ac5,_0x21ccd9[_0xdcaa('0x3b')]);var _0x4ad8a4={'where':_0x2f5ac5[_0xdcaa('0x37')]};return db[_0xdcaa('0x27')][_0xdcaa('0x1a')](_0x4ad8a4)[_0xdcaa('0x22')](function(_0x14c1f9){_0x1a9f04[_0xdcaa('0x1a')]=_0x14c1f9;if(_0x21ccd9[_0xdcaa('0x2c')]['includeAll']){_0x2f5ac5[_0xdcaa('0x3c')]=[{'all':!![]}];}return db[_0xdcaa('0x27')][_0xdcaa('0x3d')](_0x2f5ac5);})[_0xdcaa('0x22')](function(_0x2816e5){_0x1a9f04['rows']=_0x2816e5;return _0x1a9f04;})[_0xdcaa('0x22')](respondWithFilteredResult(_0x127339,_0x2f5ac5))['catch'](handleError(_0x127339,null));};exports['show']=function(_0x46c7dc,_0x37c6c2){var _0x4f5ab3={'raw':!![],'where':{'id':_0x46c7dc['params']['id']}},_0xe0b25={};_0xe0b25[_0xdcaa('0x2a')]=_[_0xdcaa('0x2d')](db['Variable'][_0xdcaa('0x3e')]);_0xe0b25[_0xdcaa('0x2c')]=_[_0xdcaa('0x2d')](_0x46c7dc[_0xdcaa('0x2c')]);_0xe0b25[_0xdcaa('0x2e')]=_[_0xdcaa('0x2f')](_0xe0b25[_0xdcaa('0x2a')],_0xe0b25[_0xdcaa('0x2c')]);_0x4f5ab3[_0xdcaa('0x31')]=_['intersection'](_0xe0b25['model'],qs[_0xdcaa('0x30')](_0x46c7dc[_0xdcaa('0x2c')][_0xdcaa('0x30')]));_0x4f5ab3[_0xdcaa('0x31')]=_0x4f5ab3[_0xdcaa('0x31')][_0xdcaa('0x32')]?_0x4f5ab3[_0xdcaa('0x31')]:_0xe0b25['model'];if(_0x46c7dc[_0xdcaa('0x2c')][_0xdcaa('0x3f')]){_0x4f5ab3[_0xdcaa('0x3c')]=[{'all':!![]}];}_0x4f5ab3=_[_0xdcaa('0x3a')]({},_0x4f5ab3,_0x46c7dc[_0xdcaa('0x3b')]);return db[_0xdcaa('0x27')]['find'](_0x4f5ab3)[_0xdcaa('0x22')](handleEntityNotFound(_0x37c6c2,null))[_0xdcaa('0x22')](respondWithResult(_0x37c6c2,null))['catch'](handleError(_0x37c6c2,null));};exports[_0xdcaa('0x40')]=function(_0x2feabe,_0x3148fe){return db[_0xdcaa('0x27')][_0xdcaa('0x40')](_0x2feabe[_0xdcaa('0x41')],{})[_0xdcaa('0x22')](function(_0x12cfa4){var _0x5f1dde=_0x2feabe[_0xdcaa('0x42')][_0xdcaa('0x43')]({'plain':!![]});if(!_0x5f1dde)throw new Error(_0xdcaa('0x44'));if(_0x5f1dde[_0xdcaa('0x45')]===_0xdcaa('0x42')){var _0x4d80a3=_0x12cfa4[_0xdcaa('0x43')]({'plain':!![]});var _0x1a2449=_0xdcaa('0x20');return db[_0xdcaa('0x46')]['find']({'where':{'name':_0x1a2449,'userProfileId':_0x5f1dde[_0xdcaa('0x47')]},'raw':!![]})[_0xdcaa('0x22')](function(_0x27bc46){if(_0x27bc46&&_0x27bc46['autoAssociation']===0x0){return db['UserProfileResource'][_0xdcaa('0x40')]({'name':_0x4d80a3[_0xdcaa('0x25')],'resourceId':_0x4d80a3['id'],'type':_0x27bc46[_0xdcaa('0x25')],'sectionId':_0x27bc46['id']},{})[_0xdcaa('0x22')](function(){return _0x12cfa4;});}else{return _0x12cfa4;}})[_0xdcaa('0x48')](function(_0x2e2aae){logger['error'](_0xdcaa('0x49'),_0x2e2aae);throw _0x2e2aae;});}return _0x12cfa4;})['then'](respondWithResult(_0x3148fe,0xc9))[_0xdcaa('0x48')](handleError(_0x3148fe,null));};exports[_0xdcaa('0x1e')]=function(_0x4b5be1,_0x2ea179){if(_0x4b5be1[_0xdcaa('0x41')]['id']){delete _0x4b5be1[_0xdcaa('0x41')]['id'];}return db[_0xdcaa('0x27')][_0xdcaa('0x4a')]({'where':{'id':_0x4b5be1[_0xdcaa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ea179,null))['then'](saveUpdates(_0x4b5be1[_0xdcaa('0x41')],null))[_0xdcaa('0x22')](respondWithResult(_0x2ea179,null))[_0xdcaa('0x48')](handleError(_0x2ea179,null));};exports[_0xdcaa('0x1f')]=function(_0x468673,_0x55a5ac){return db[_0xdcaa('0x27')][_0xdcaa('0x4a')]({'where':{'id':_0x468673['params']['id']}})[_0xdcaa('0x22')](handleEntityNotFound(_0x55a5ac,null))[_0xdcaa('0x22')](removeEntity(_0x55a5ac,null))[_0xdcaa('0x48')](handleError(_0x55a5ac,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8f3344e..87a0448 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 _0x184b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util'];(function(_0x45ae0d,_0x1ea3b9){var _0x371826=function(_0x20e757){while(--_0x20e757){_0x45ae0d['push'](_0x45ae0d['shift']());}};_0x371826(++_0x1ea3b9);}(_0x184b,0x1b8));var _0xb184=function(_0x2a65f3,_0x2ab326){_0x2a65f3=_0x2a65f3-0x0;var _0x16e328=_0x184b[_0x2a65f3];return _0x16e328;};'use strict';var _=require(_0xb184('0x0'));var util=require(_0xb184('0x1'));var logger=require(_0xb184('0x2'))(_0xb184('0x3'));var moment=require(_0xb184('0x4'));var BPromise=require(_0xb184('0x5'));var rp=require(_0xb184('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb184('0x7'));var config=require(_0xb184('0x8'));var attributes=require(_0xb184('0x9'));module['exports']=function(_0x2b9873,_0x3dec9b){return _0x2b9873[_0xb184('0xa')](_0xb184('0xb'),attributes,{'tableName':_0xb184('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf277=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Variable','lodash'];(function(_0xabeb68,_0x3aecbc){var _0x3ce2cf=function(_0xc599c1){while(--_0xc599c1){_0xabeb68['push'](_0xabeb68['shift']());}};_0x3ce2cf(++_0x3aecbc);}(_0xf277,0x1d8));var _0x7f27=function(_0x243392,_0x712e9){_0x243392=_0x243392-0x0;var _0x35914d=_0xf277[_0x243392];return _0x35914d;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require(_0x7f27('0x2'))('api');var moment=require(_0x7f27('0x3'));var BPromise=require(_0x7f27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./variable.attributes');module[_0x7f27('0x8')]=function(_0x3c27ef,_0x57c1bb){return _0x3c27ef[_0x7f27('0x9')](_0x7f27('0xa'),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 0e74d9b..11aaa67 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(_0x1fa7c6,_0x39b651){var _0xd37a61=function(_0x3582ed){while(--_0x3582ed){_0x1fa7c6['push'](_0x1fa7c6['shift']());}};_0xd37a61(++_0x39b651);}(_0x6aa7,0x178));var _0x76aa=function(_0x102bb2,_0x20156e){_0x102bb2=_0x102bb2-0x0;var _0x30c5d8=_0x6aa7[_0x102bb2];return _0x30c5d8;};'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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x5ade35,_0x35cec6){var _0x21d317=function(_0x4369b1){while(--_0x4369b1){_0x5ade35['push'](_0x5ade35['shift']());}};_0x21d317(++_0x35cec6);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x5fc3[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d16f095..56418cd 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 _0x056e=['/migrations','migrations','express','Router','../../components/auth/service','./version.controller','index','get','isAuthenticated','canUpdate','reset','/restart','restart'];(function(_0x4d18b6,_0x14c208){var _0x191282=function(_0x47af04){while(--_0x47af04){_0x4d18b6['push'](_0x4d18b6['shift']());}};_0x191282(++_0x14c208);}(_0x056e,0x195));var _0xe056=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x056e[_0x531d15];return _0x271a18;};'use strict';var express=require(_0xe056('0x0'));var router=express[_0xe056('0x1')]();var auth=require(_0xe056('0x2'));var controller=require(_0xe056('0x3'));router['get']('/',controller[_0xe056('0x4')]);router[_0xe056('0x5')]('/fetch',auth[_0xe056('0x6')](),auth[_0xe056('0x7')](),controller['fetch']);router[_0xe056('0x5')]('/reset',auth[_0xe056('0x6')](),auth[_0xe056('0x7')](),controller[_0xe056('0x8')]);router[_0xe056('0x5')]('/pull',auth[_0xe056('0x6')](),auth[_0xe056('0x7')](),controller['pull']);router[_0xe056('0x5')](_0xe056('0x9'),auth[_0xe056('0x6')](),controller[_0xe056('0xa')]);router[_0xe056('0x5')](_0xe056('0xb'),controller[_0xe056('0xc')]);module['exports']=router; \ No newline at end of file +var _0xf69d=['express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','reset','/pull','pull','/restart','isAuthenticated','restart','/migrations','migrations'];(function(_0x18b4ed,_0x2862d8){var _0x30e16a=function(_0x50713b){while(--_0x50713b){_0x18b4ed['push'](_0x18b4ed['shift']());}};_0x30e16a(++_0x2862d8);}(_0xf69d,0xea));var _0xdf69=function(_0x554114,_0x5da584){_0x554114=_0x554114-0x0;var _0x7223ae=_0xf69d[_0x554114];return _0x7223ae;};'use strict';var express=require(_0xdf69('0x0'));var router=express[_0xdf69('0x1')]();var auth=require(_0xdf69('0x2'));var controller=require(_0xdf69('0x3'));router[_0xdf69('0x4')]('/',controller[_0xdf69('0x5')]);router[_0xdf69('0x4')](_0xdf69('0x6'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0x8')]);router[_0xdf69('0x4')](_0xdf69('0x9'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0xa')]);router['get'](_0xdf69('0xb'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0xc')]);router['get'](_0xdf69('0xd'),auth[_0xdf69('0xe')](),controller[_0xdf69('0xf')]);router[_0xdf69('0x4')](_0xdf69('0x10'),controller[_0xdf69('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f6f7881..930929d 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 _0xd7a9=['Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','query','latest','fetch','exports','2.0.0','json','status','origin','master','error','git\x20fetch\x20origin\x20master','reset','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xd7a9,0x7e));var _0x9d7a=function(_0x4e4d44,_0x3836ed){_0x4e4d44=_0x4e4d44-0x0;var _0x429cf0=_0xd7a9[_0x4e4d44];return _0x429cf0;};'use strict';var Umzug=require(_0x9d7a('0x0'));var path=require(_0x9d7a('0x1'));var fs=require('fs');var _=require(_0x9d7a('0x2'));var pkginfo=require('pkginfo')(module,_0x9d7a('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x9d7a('0x4'))[_0x9d7a('0x5')];var db=require(_0x9d7a('0x6'))['db'];var config=require(_0x9d7a('0x7'));var pm2=require(_0x9d7a('0x8'));var logger=require(_0x9d7a('0x9'))(_0x9d7a('0xa'));var git=require('simple-git')(config[_0x9d7a('0xb')]);exports[_0x9d7a('0xc')]=function(_0x6bc45d,_0x23fe0f){var _0x3fafe5={'current':module['exports'][_0x9d7a('0x3')],'phonebar':0x2};if(_0x6bc45d['query']&&_0x6bc45d[_0x9d7a('0xd')][_0x9d7a('0xe')]){return git[_0x9d7a('0xf')]()['tags'](function(_0x36ed9a,_0x126a7b){_0x3fafe5[_0x9d7a('0xe')]=(_0x36ed9a?module[_0x9d7a('0x10')][_0x9d7a('0x3')]:_0x126a7b[_0x9d7a('0xe')])||_0x9d7a('0x11');return _0x23fe0f['status'](0xc8)[_0x9d7a('0x12')](_0x3fafe5);});}else{return _0x23fe0f[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')](_0x3fafe5);}};exports[_0x9d7a('0xf')]=function(_0x4e567f,_0x38a46c){return git[_0x9d7a('0xf')]([_0x9d7a('0x14'),_0x9d7a('0x15')],function(_0x51c21e){if(_0x51c21e){logger[_0x9d7a('0x16')](_0x51c21e);return _0x38a46c[_0x9d7a('0x13')](0x1f4)[_0x9d7a('0x12')](_0x51c21e);}logger['info']('git\x20fetch');return _0x38a46c[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')]({'output':_0x9d7a('0x17')});});};exports[_0x9d7a('0x18')]=function(_0x188cfe,_0x1ff377){return git[_0x9d7a('0x18')](['--hard','FETCH_HEAD'],function(_0x57b1d0){if(_0x57b1d0){logger['error'](_0x57b1d0);return _0x1ff377[_0x9d7a('0x13')](0x1f4)[_0x9d7a('0x12')](_0x57b1d0);}logger[_0x9d7a('0x19')](_0x9d7a('0x1a'));return _0x1ff377[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')]({'output':_0x9d7a('0x1b')});});};exports['pull']=function(_0x45b966,_0x5136a6){exec(_0x9d7a('0x1c'),function(_0x262257,_0x494099,_0x14e78f){logger[_0x9d7a('0x19')](_0x494099);logger['info'](_0x14e78f);if(_0x262257){logger[_0x9d7a('0x16')](_0x262257);return _0x5136a6[_0x9d7a('0x13')](0x1f4)[_0x9d7a('0x12')](_0x262257);}return _0x5136a6[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')]({'output':_0x494099});});};exports[_0x9d7a('0x1d')]=function(_0x13c418,_0x28cb9f){return pm2[_0x9d7a('0x1d')](_0x9d7a('0x1e'))[_0x9d7a('0x1f')](function(_0x4ccd88){logger['info'](_0x9d7a('0x20'),_0x4ccd88);return _0x28cb9f[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')]({'output':_0x9d7a('0x21')});})[_0x9d7a('0x22')](function(_0x11ce2d){logger[_0x9d7a('0x16')](_0x11ce2d);return _0x28cb9f['status'](0x1f4)[_0x9d7a('0x12')](_0x11ce2d);});};exports[_0x9d7a('0x23')]=function(_0x1c8e35,_0x310f2c){var _0xe4ab80=fs[_0x9d7a('0x24')](path[_0x9d7a('0x25')](config[_0x9d7a('0xb')],'server',_0x9d7a('0x23')));var _0xc71643=[];for(var _0x1bfc90=0x0;_0x1bfc90<_0xe4ab80['length'];_0x1bfc90++){var _0x41f0ac=_0xe4ab80[_0x1bfc90][_0x9d7a('0x26')](_0x9d7a('0x27'),'');if(compareVersions(module[_0x9d7a('0x10')][_0x9d7a('0x3')],_0x41f0ac)===-0x1){_0xc71643[_0x9d7a('0x28')](_0x41f0ac);}}if(_0xc71643[_0x9d7a('0x29')]){var _0x46e4a4=_0xc71643[_0x9d7a('0x2a')](compareVersions);var _0x4b450e=new Umzug({'storage':_0x9d7a('0x2b'),'storageOptions':{'model':db[_0x9d7a('0x2c')],'modelName':_0x9d7a('0x2c'),'columnName':_0x9d7a('0x3')},'migrations':{'params':[db['sequelize'][_0x9d7a('0x2d')](),db[_0x9d7a('0x2b')][_0x9d7a('0x2e')],function(){throw new Error(_0x9d7a('0x2f'));}],'path':path[_0x9d7a('0x25')](config[_0x9d7a('0xb')],_0x9d7a('0x30'),_0x9d7a('0x23')),'pattern':/\.js$/}});_0x4b450e['up']({'migrations':_[_0x9d7a('0x31')](_0x46e4a4,function(_0x331083){return _0x331083+'.js';})})[_0x9d7a('0x1f')](function(){return _0x310f2c['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9d7a('0x10')][_0x9d7a('0x3')]+'\x20to\x20'+_[_0x9d7a('0x32')](_0x46e4a4),'migrations':_[_0x9d7a('0x25')](_0x46e4a4)});})[_0x9d7a('0x22')](function(_0x131d58){if(_0x131d58 instanceof db[_0x9d7a('0x2b')][_0x9d7a('0x33')]){return _0x310f2c['status'](0xc8)[_0x9d7a('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x310f2c[_0x9d7a('0x13')](0x1f4)[_0x9d7a('0x12')](_0x131d58);}});}else{return _0x310f2c[_0x9d7a('0x13')](0xc8)[_0x9d7a('0x12')]({'output':_0x9d7a('0x34')});}}; \ No newline at end of file +var _0x69e5=['catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','update','root','index','exports','query','latest','fetch','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','replace','.js','length','Migration','sequelize','getQueryInterface','constructor','map','\x20to\x20'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x69e5,0x129));var _0x569e=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x69e5[_0x55c00d];return _0x254a8f;};'use strict';var Umzug=require(_0x569e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x569e('0x1'));var pkginfo=require(_0x569e('0x2'))(module,_0x569e('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x569e('0x4'))[_0x569e('0x5')];var db=require(_0x569e('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x569e('0x7'));var logger=require('../../config/logger')(_0x569e('0x8'));var git=require('simple-git')(config[_0x569e('0x9')]);exports[_0x569e('0xa')]=function(_0x405fc2,_0x3f8818){var _0x9c53a3={'current':module[_0x569e('0xb')][_0x569e('0x3')],'phonebar':0x2};if(_0x405fc2[_0x569e('0xc')]&&_0x405fc2['query'][_0x569e('0xd')]){return git[_0x569e('0xe')]()['tags'](function(_0xd2e3fa,_0xf22cbf){_0x9c53a3[_0x569e('0xd')]=(_0xd2e3fa?module[_0x569e('0xb')][_0x569e('0x3')]:_0xf22cbf[_0x569e('0xd')])||_0x569e('0xf');return _0x3f8818[_0x569e('0x10')](0xc8)[_0x569e('0x11')](_0x9c53a3);});}else{return _0x3f8818[_0x569e('0x10')](0xc8)[_0x569e('0x11')](_0x9c53a3);}};exports['fetch']=function(_0x9076b0,_0x256c07){return git[_0x569e('0xe')]([_0x569e('0x12'),_0x569e('0x13')],function(_0x2a2145){if(_0x2a2145){logger['error'](_0x2a2145);return _0x256c07['status'](0x1f4)[_0x569e('0x11')](_0x2a2145);}logger[_0x569e('0x14')]('git\x20fetch');return _0x256c07['status'](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x15')});});};exports['reset']=function(_0x42edd3,_0x4fd272){return git[_0x569e('0x16')]([_0x569e('0x17'),'FETCH_HEAD'],function(_0x22cb9c){if(_0x22cb9c){logger[_0x569e('0x18')](_0x22cb9c);return _0x4fd272[_0x569e('0x10')](0x1f4)[_0x569e('0x11')](_0x22cb9c);}logger['info'](_0x569e('0x19'));return _0x4fd272['status'](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x1a')});});};exports[_0x569e('0x1b')]=function(_0x319789,_0x5f46c5){exec(_0x569e('0x1c'),function(_0x43d841,_0x4f58ed,_0x4a363f){logger[_0x569e('0x14')](_0x4f58ed);logger['info'](_0x4a363f);if(_0x43d841){logger[_0x569e('0x18')](_0x43d841);return _0x5f46c5[_0x569e('0x10')](0x1f4)[_0x569e('0x11')](_0x43d841);}return _0x5f46c5[_0x569e('0x10')](0xc8)['json']({'output':_0x4f58ed});});};exports[_0x569e('0x1d')]=function(_0xbafa08,_0x505cee){return pm2[_0x569e('0x1d')](_0x569e('0x1e'))[_0x569e('0x1f')](function(_0x2d12f4){logger['info'](_0x569e('0x20'),_0x2d12f4);return _0x505cee[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x21')});})['catch'](function(_0x5e1788){logger[_0x569e('0x18')](_0x5e1788);return _0x505cee[_0x569e('0x10')](0x1f4)['json'](_0x5e1788);});};exports[_0x569e('0x22')]=function(_0x4d5ad1,_0x59f161){var _0x4564b6=fs['readdirSync'](path[_0x569e('0x23')](config[_0x569e('0x9')],_0x569e('0x24'),_0x569e('0x22')));var _0x28f97c=[];for(var _0x1b7959=0x0;_0x1b7959<_0x4564b6['length'];_0x1b7959++){var _0x376945=_0x4564b6[_0x1b7959][_0x569e('0x25')](_0x569e('0x26'),'');if(compareVersions(module[_0x569e('0xb')][_0x569e('0x3')],_0x376945)===-0x1){_0x28f97c['push'](_0x376945);}}if(_0x28f97c[_0x569e('0x27')]){var _0x3abada=_0x28f97c['sort'](compareVersions);var _0x1da8b4=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x569e('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x569e('0x29')][_0x569e('0x2a')](),db[_0x569e('0x29')][_0x569e('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x569e('0x23')](config['root'],_0x569e('0x24'),_0x569e('0x22')),'pattern':/\.js$/}});_0x1da8b4['up']({'migrations':_[_0x569e('0x2c')](_0x3abada,function(_0x16887d){return _0x16887d+_0x569e('0x26');})})[_0x569e('0x1f')](function(){return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0x569e('0x2d')+_['last'](_0x3abada),'migrations':_['join'](_0x3abada)});})[_0x569e('0x2e')](function(_0x24399f){if(_0x24399f instanceof db[_0x569e('0x29')][_0x569e('0x2f')]){return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x59f161[_0x569e('0x10')](0x1f4)['json'](_0x24399f);}});}else{return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 8fc8d93..4162597 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 _0x0050=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','multer','util','path'];(function(_0x2f3f72,_0x49057e){var _0x31f206=function(_0x5c80cc){while(--_0x5c80cc){_0x2f3f72['push'](_0x2f3f72['shift']());}};_0x31f206(++_0x49057e);}(_0x0050,0xe1));var _0x0005=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x0050[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x0005('0x0'));var util=require(_0x0005('0x1'));var path=require(_0x0005('0x2'));var timeout=require(_0x0005('0x3'));var express=require(_0x0005('0x4'));var router=express[_0x0005('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0005('0x6'));var config=require(_0x0005('0x7'));var controller=require(_0x0005('0x8'));router[_0x0005('0x9')]('/',auth[_0x0005('0xa')](),controller['index']);router[_0x0005('0x9')](_0x0005('0xb'),auth[_0x0005('0xa')](),controller[_0x0005('0xc')]);router['get'](_0x0005('0xd'),auth['isAuthenticated'](),controller[_0x0005('0xe')]);router[_0x0005('0xf')]('/',auth[_0x0005('0xa')](),controller[_0x0005('0x10')]);router[_0x0005('0x11')]('/:id',auth[_0x0005('0xa')](),controller['update']);router[_0x0005('0x12')](_0x0005('0xd'),auth[_0x0005('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9cfa=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x23bc66,_0x5c6783){var _0x5d5609=function(_0x21691a){while(--_0x21691a){_0x23bc66['push'](_0x23bc66['shift']());}};_0x5d5609(++_0x5c6783);}(_0x9cfa,0xb3));var _0xa9cf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9cfa[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa9cf('0x0'));var util=require(_0xa9cf('0x1'));var path=require(_0xa9cf('0x2'));var timeout=require(_0xa9cf('0x3'));var express=require('express');var router=express[_0xa9cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa9cf('0x5'));var interaction=require(_0xa9cf('0x6'));var config=require(_0xa9cf('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xa9cf('0x8')](),controller[_0xa9cf('0x9')]);router[_0xa9cf('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xa9cf('0xb')]);router[_0xa9cf('0xa')](_0xa9cf('0xc'),auth[_0xa9cf('0x8')](),controller[_0xa9cf('0xd')]);router[_0xa9cf('0xe')]('/',auth['isAuthenticated'](),controller[_0xa9cf('0xf')]);router['put'](_0xa9cf('0xc'),auth[_0xa9cf('0x8')](),controller[_0xa9cf('0x10')]);router[_0xa9cf('0x11')](_0xa9cf('0xc'),auth['isAuthenticated'](),controller[_0xa9cf('0x12')]);module[_0xa9cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7828db3..18226d7 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 _0x585e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x360502,_0x57313e){var _0xebbf3c=function(_0x5daacc){while(--_0x5daacc){_0x360502['push'](_0x360502['shift']());}};_0xebbf3c(++_0x57313e);}(_0x585e,0x1c2));var _0xe585=function(_0x45c44c,_0x1b11e4){_0x45c44c=_0x45c44c-0x0;var _0xde2824=_0x585e[_0x45c44c];return _0xde2824;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'type':{'type':Sequelize[_0xe585('0x2')]},'uniqueid':{'type':Sequelize[_0xe585('0x2')]},'calleridnum':{'type':Sequelize[_0xe585('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe585('0x2')]},'membername':{'type':Sequelize[_0xe585('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe585('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xe585('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe585('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe585('0x3')]},'holdtime':{'type':Sequelize[_0xe585('0x4')]},'agentcomplete':{'type':Sequelize[_0xe585('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe585('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe585('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe585('0x4')]},'agentacw':{'type':Sequelize[_0xe585('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe585('0x4')]},'reason':{'type':Sequelize[_0xe585('0x2')]},'lastevent':{'type':Sequelize[_0xe585('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe585('0x4')]},'channelstatedesc':{'type':Sequelize[_0xe585('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe585('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe585('0x2')]},'context':{'type':Sequelize[_0xe585('0x2')]},'exten':{'type':Sequelize[_0xe585('0x2')]},'priority':{'type':Sequelize[_0xe585('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe585('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe585('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe585('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe585('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe585('0x2')]},'destlanguage':{'type':Sequelize[_0xe585('0x2')]},'destaccountcode':{'type':Sequelize[_0xe585('0x2')]},'destcontext':{'type':Sequelize[_0xe585('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe585('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xe585('0x2')]},'transfer':{'type':Sequelize[_0xe585('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xe585('0x6')},'transferexten':{'type':Sequelize[_0xe585('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe585('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb3b=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xeb3b[_0x1c34e7];return _0x378cb1;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'type':{'type':Sequelize[_0xbeb3('0x2')]},'uniqueid':{'type':Sequelize[_0xbeb3('0x2')]},'calleridnum':{'type':Sequelize[_0xbeb3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbeb3('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentdumpAt':{'type':Sequelize[_0xbeb3('0x3')]},'holdtime':{'type':Sequelize[_0xbeb3('0x4')]},'agentcomplete':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbeb3('0x4')]},'agentacw':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbeb3('0x4')]},'reason':{'type':Sequelize[_0xbeb3('0x2')]},'lastevent':{'type':Sequelize[_0xbeb3('0x2')]},'channel':{'type':Sequelize[_0xbeb3('0x2')]},'channelstate':{'type':Sequelize[_0xbeb3('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xbeb3('0x2')]},'connectedlinename':{'type':Sequelize[_0xbeb3('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbeb3('0x2')]},'context':{'type':Sequelize[_0xbeb3('0x2')]},'exten':{'type':Sequelize[_0xbeb3('0x2')]},'priority':{'type':Sequelize[_0xbeb3('0x2')]},'destchannel':{'type':Sequelize[_0xbeb3('0x2')]},'destchannelstate':{'type':Sequelize[_0xbeb3('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xbeb3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbeb3('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xbeb3('0x2')]},'destcontext':{'type':Sequelize[_0xbeb3('0x2')]},'destexten':{'type':Sequelize[_0xbeb3('0x2')]},'destpriority':{'type':Sequelize[_0xbeb3('0x2')]},'destuniqueid':{'type':Sequelize[_0xbeb3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xbeb3('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbeb3('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 954d0ed..0027974 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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 8435bcb..223ac0b 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 _0x49c4=['destuniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x49c4,0x9b));var _0x449c=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x49c4[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var logger=require(_0x449c('0x1'))(_0x449c('0x2'));var moment=require(_0x449c('0x3'));var BPromise=require(_0x449c('0x4'));var rp=require(_0x449c('0x5'));var fs=require('fs');var path=require(_0x449c('0x6'));var rimraf=require(_0x449c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x449c('0x8')]=function(_0x442e56,_0x12586c){return _0x442e56[_0x449c('0x9')](_0x449c('0xa'),attributes,{'tableName':_0x449c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x449c('0xc'),_0x449c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16cc=['path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe016b6,_0x3568e3){var _0xe24755=function(_0x109814){while(--_0x109814){_0xe016b6['push'](_0xe016b6['shift']());}};_0xe24755(++_0x3568e3);}(_0x16cc,0x120));var _0xc16c=function(_0x3abbaf,_0x2b778c){_0x3abbaf=_0x3abbaf-0x0;var _0x59db27=_0x16cc[_0x3abbaf];return _0x59db27;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var logger=require(_0xc16c('0x1'))(_0xc16c('0x2'));var moment=require(_0xc16c('0x3'));var BPromise=require(_0xc16c('0x4'));var rp=require(_0xc16c('0x5'));var fs=require('fs');var path=require(_0xc16c('0x6'));var rimraf=require('rimraf');var config=require(_0xc16c('0x7'));var attributes=require(_0xc16c('0x8'));module[_0xc16c('0x9')]=function(_0x1019ec,_0x5ea82b){return _0x1019ec[_0xc16c('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xc16c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc16c('0xc'),_0xc16c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 7fdaf99..d9c2ca1 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 _0xd012=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport','create','body','options','catch','UpdateVoiceAgentReport','VoiceAgentReport','raw','where','lodash','util','moment'];(function(_0x2b4beb,_0x246fb3){var _0x3cc52c=function(_0x5eeda9){while(--_0x5eeda9){_0x2b4beb['push'](_0x2b4beb['shift']());}};_0x3cc52c(++_0x246fb3);}(_0xd012,0x133));var _0x2d01=function(_0x4f1fbe,_0x5b17e5){_0x4f1fbe=_0x4f1fbe-0x0;var _0x40696f=_0xd012[_0x4f1fbe];return _0x40696f;};'use strict';var _=require(_0x2d01('0x0'));var util=require(_0x2d01('0x1'));var moment=require(_0x2d01('0x2'));var BPromise=require(_0x2d01('0x3'));var rs=require(_0x2d01('0x4'));var fs=require('fs');var Redis=require(_0x2d01('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d01('0x6'));var logger=require(_0x2d01('0x7'))(_0x2d01('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7623,_0x4ca3ad,_0x216998){return new BPromise(function(_0x84925,_0x791b9){return client[_0x2d01('0xa')](_0x3d7623,_0x216998)[_0x2d01('0xb')](function(_0x474a76){logger[_0x2d01('0xc')](_0x2d01('0xd'),_0x4ca3ad,'request\x20sent');logger[_0x2d01('0xe')](_0x2d01('0xf'),_0x4ca3ad,_0x2d01('0x10'),JSON[_0x2d01('0x11')](_0x474a76));if(_0x474a76[_0x2d01('0x12')]){if(_0x474a76['error'][_0x2d01('0x13')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4ca3ad,_0x474a76['error']['message']);return _0x791b9(_0x474a76[_0x2d01('0x12')][_0x2d01('0x14')]);}logger['error'](_0x2d01('0xd'),_0x4ca3ad,_0x474a76[_0x2d01('0x12')]['message']);return _0x84925(_0x474a76[_0x2d01('0x12')][_0x2d01('0x14')]);}else{logger[_0x2d01('0xc')](_0x2d01('0xd'),_0x4ca3ad,'request\x20sent');_0x84925(_0x474a76[_0x2d01('0x15')][_0x2d01('0x14')]);}})['catch'](function(_0x2e2058){logger[_0x2d01('0x12')](_0x2d01('0xd'),_0x4ca3ad,_0x2e2058);_0x791b9(_0x2e2058);});});}exports[_0x2d01('0x16')]=function(_0x55353c){var _0x5b6c9b=this;return new Promise(function(_0x445870,_0x814d70){return db['VoiceAgentReport'][_0x2d01('0x17')](_0x55353c[_0x2d01('0x18')],{'raw':_0x55353c['options']?_0x55353c[_0x2d01('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2d01('0xb')](function(_0x5a02ef){logger[_0x2d01('0xc')](_0x2d01('0x16'),_0x55353c);logger[_0x2d01('0xe')](_0x2d01('0x16'),_0x55353c,JSON[_0x2d01('0x11')](_0x5a02ef));_0x445870(_0x5a02ef);})[_0x2d01('0x1a')](function(_0x3af6ab){logger[_0x2d01('0x12')](_0x2d01('0x16'),_0x3af6ab[_0x2d01('0x14')],_0x55353c);_0x814d70(_0x5b6c9b[_0x2d01('0x12')](0x1f4,_0x3af6ab[_0x2d01('0x14')]));});});};exports[_0x2d01('0x1b')]=function(_0x2a2494){var _0x27594a=this;return new Promise(function(_0xec421f,_0x40737d){return db[_0x2d01('0x1c')]['update'](_0x2a2494[_0x2d01('0x18')],{'raw':_0x2a2494['options']?_0x2a2494['options'][_0x2d01('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2494['options']?_0x2a2494['options'][_0x2d01('0x1e')]||null:null,'attributes':_0x2a2494[_0x2d01('0x19')]?_0x2a2494['options']['attributes']||null:null,'limit':_0x2a2494['options']?_0x2a2494['options']['limit']||null:null})[_0x2d01('0xb')](function(_0x390bbf){logger['info'](_0x2d01('0x1b'),_0x2a2494);logger['debug']('UpdateVoiceAgentReport',_0x2a2494,JSON['stringify'](_0x390bbf));_0xec421f(_0x390bbf);})[_0x2d01('0x1a')](function(_0x187a43){logger[_0x2d01('0x12')]('UpdateVoiceAgentReport',_0x187a43[_0x2d01('0x14')],_0x2a2494);_0x40737d(_0x27594a[_0x2d01('0x12')](0x1f4,_0x187a43['message']));});});}; \ No newline at end of file +var _0x1cad=['code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x1cad,0x118));var _0xd1ca=function(_0x2934ef,_0x113448){_0x2934ef=_0x2934ef-0x0;var _0x544a8d=_0x1cad[_0x2934ef];return _0x544a8d;};'use strict';var _=require('lodash');var util=require(_0xd1ca('0x0'));var moment=require(_0xd1ca('0x1'));var BPromise=require(_0xd1ca('0x2'));var rs=require(_0xd1ca('0x3'));var fs=require('fs');var Redis=require(_0xd1ca('0x4'));var db=require(_0xd1ca('0x5'))['db'];var utils=require(_0xd1ca('0x6'));var logger=require('../../config/logger')(_0xd1ca('0x7'));var config=require('../../config/environment');var jayson=require(_0xd1ca('0x8'));var client=jayson['client'][_0xd1ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af3c5,_0x49dea,_0x171647){return new BPromise(function(_0x5ed8df,_0x406b08){return client[_0xd1ca('0xa')](_0x2af3c5,_0x171647)[_0xd1ca('0xb')](function(_0x198702){logger['info'](_0xd1ca('0xc'),_0x49dea,_0xd1ca('0xd'));logger[_0xd1ca('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x49dea,_0xd1ca('0xd'),JSON[_0xd1ca('0xf')](_0x198702));if(_0x198702[_0xd1ca('0x10')]){if(_0x198702[_0xd1ca('0x10')][_0xd1ca('0x11')]===0x1f4){logger[_0xd1ca('0x10')](_0xd1ca('0xc'),_0x49dea,_0x198702[_0xd1ca('0x10')]['message']);return _0x406b08(_0x198702[_0xd1ca('0x10')]['message']);}logger['error'](_0xd1ca('0xc'),_0x49dea,_0x198702[_0xd1ca('0x10')][_0xd1ca('0x12')]);return _0x5ed8df(_0x198702[_0xd1ca('0x10')]['message']);}else{logger[_0xd1ca('0x13')](_0xd1ca('0xc'),_0x49dea,'request\x20sent');_0x5ed8df(_0x198702[_0xd1ca('0x14')][_0xd1ca('0x12')]);}})[_0xd1ca('0x15')](function(_0x336241){logger[_0xd1ca('0x10')](_0xd1ca('0xc'),_0x49dea,_0x336241);_0x406b08(_0x336241);});});}exports[_0xd1ca('0x16')]=function(_0x1068a4){var _0x18d282=this;return new Promise(function(_0x30bd35,_0x198e93){return db[_0xd1ca('0x17')][_0xd1ca('0x18')](_0x1068a4[_0xd1ca('0x19')],{'raw':_0x1068a4[_0xd1ca('0x1a')]?_0x1068a4['options']['raw']===undefined?!![]:![]:!![]})[_0xd1ca('0xb')](function(_0xadc215){logger[_0xd1ca('0x13')](_0xd1ca('0x16'),_0x1068a4);logger[_0xd1ca('0xe')]('CreateVoiceAgentReport',_0x1068a4,JSON[_0xd1ca('0xf')](_0xadc215));_0x30bd35(_0xadc215);})[_0xd1ca('0x15')](function(_0x9c7199){logger[_0xd1ca('0x10')]('CreateVoiceAgentReport',_0x9c7199[_0xd1ca('0x12')],_0x1068a4);_0x198e93(_0x18d282[_0xd1ca('0x10')](0x1f4,_0x9c7199[_0xd1ca('0x12')]));});});};exports[_0xd1ca('0x1b')]=function(_0x4ca918){var _0x4e1674=this;return new Promise(function(_0x4ceb0a,_0x32be53){return db['VoiceAgentReport'][_0xd1ca('0x1c')](_0x4ca918[_0xd1ca('0x19')],{'raw':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918['options'][_0xd1ca('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x1e')]||null:null,'attributes':_0x4ca918['options']?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x1f')]||null:null,'limit':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x20')]||null:null})[_0xd1ca('0xb')](function(_0x3778f2){logger[_0xd1ca('0x13')](_0xd1ca('0x1b'),_0x4ca918);logger[_0xd1ca('0xe')](_0xd1ca('0x1b'),_0x4ca918,JSON[_0xd1ca('0xf')](_0x3778f2));_0x4ceb0a(_0x3778f2);})['catch'](function(_0x65c083){logger[_0xd1ca('0x10')](_0xd1ca('0x1b'),_0x65c083[_0xd1ca('0x12')],_0x4ca918);_0x32be53(_0x4e1674['error'](0x1f4,_0x65c083[_0xd1ca('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c797243..d452500 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 _0x80d9=['get','/:id','show','post','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index','isAuthenticated','describe'];(function(_0x1b7c7b,_0x51b214){var _0x539d94=function(_0x763711){while(--_0x763711){_0x1b7c7b['push'](_0x1b7c7b['shift']());}};_0x539d94(++_0x51b214);}(_0x80d9,0x15c));var _0x980d=function(_0x22988e,_0xa2a206){_0x22988e=_0x22988e-0x0;var _0x226457=_0x80d9[_0x22988e];return _0x226457;};'use strict';var multer=require(_0x980d('0x0'));var util=require('util');var path=require(_0x980d('0x1'));var timeout=require(_0x980d('0x2'));var express=require(_0x980d('0x3'));var router=express['Router']();var fs_extra=require(_0x980d('0x4'));var auth=require(_0x980d('0x5'));var interaction=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var controller=require(_0x980d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x980d('0x9')]);router['get']('/describe',auth[_0x980d('0xa')](),controller[_0x980d('0xb')]);router[_0x980d('0xc')](_0x980d('0xd'),auth[_0x980d('0xa')](),controller[_0x980d('0xe')]);router[_0x980d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x980d('0xd'),auth[_0x980d('0xa')](),controller['update']);router[_0x980d('0x10')]('/:id',auth[_0x980d('0xa')](),controller['destroy']);module[_0x980d('0x11')]=router; \ No newline at end of file +var _0x008c=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x008c,0x188));var _0xc008=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0x008c[_0x308c00];return _0x2b21b2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['update']);router[_0xc008('0x10')](_0xc008('0xf'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);module[_0xc008('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 97892c7..bdb526b 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 _0xe083=['outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound','internal'];(function(_0x3df5fd,_0x4e0c30){var _0x447f01=function(_0x24569c){while(--_0x24569c){_0x3df5fd['push'](_0x3df5fd['shift']());}};_0x447f01(++_0x4e0c30);}(_0xe083,0x1dc));var _0x3e08=function(_0x52d71c,_0x2c8e29){_0x52d71c=_0x52d71c-0x0;var _0x5bb1f7=_0xe083[_0x52d71c];return _0x5bb1f7;};'use strict';var Sequelize=require(_0x3e08('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3e08('0x1')](_0x3e08('0x2'),_0x3e08('0x3'),_0x3e08('0x4'),_0x3e08('0x5'),_0x3e08('0x6'),_0x3e08('0x7'))},'tag':{'type':Sequelize[_0x3e08('0x8')]},'accountcode':{'type':Sequelize[_0x3e08('0x8')]},'source':{'type':Sequelize[_0x3e08('0x8')]},'destination':{'type':Sequelize[_0x3e08('0x8')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3e08('0x8')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x3e08('0x8')]},'lastdata':{'type':Sequelize[_0x3e08('0x9')]},'starttime':{'type':Sequelize[_0x3e08('0xa')]},'systemanswertime':{'type':Sequelize[_0x3e08('0xa')]},'answertime':{'type':Sequelize[_0x3e08('0xa')]},'endtime':{'type':Sequelize[_0x3e08('0xa')]},'duration':{'type':Sequelize[_0x3e08('0xb')]},'billableseconds':{'type':Sequelize[_0x3e08('0xb')]},'mohtime':{'type':Sequelize[_0x3e08('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x3e08('0x8')]},'note':{'type':Sequelize[_0x3e08('0x8')]},'prefix':{'type':Sequelize[_0x3e08('0x8')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x3e08('0x8')]}}; \ No newline at end of file +var _0x5dc7=['ENUM','inbound','internal','outbound','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x2d9be5,_0x38ec53){var _0x86cded=function(_0x33858a){while(--_0x33858a){_0x2d9be5['push'](_0x2d9be5['shift']());}};_0x86cded(++_0x38ec53);}(_0x5dc7,0x148));var _0x75dc=function(_0x49dca5,_0x563f7e){_0x49dca5=_0x49dca5-0x0;var _0x15b7de=_0x5dc7[_0x49dca5];return _0x15b7de;};'use strict';var Sequelize=require(_0x75dc('0x0'));module[_0x75dc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x75dc('0x2')](_0x75dc('0x3'),_0x75dc('0x4'),_0x75dc('0x5'),'inbound-fax','outbound-fax',_0x75dc('0x6'))},'tag':{'type':Sequelize[_0x75dc('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x75dc('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x75dc('0x7')]},'callerid':{'type':Sequelize[_0x75dc('0x7')]},'channel':{'type':Sequelize[_0x75dc('0x7')]},'destinationchannel':{'type':Sequelize[_0x75dc('0x7')]},'lastapplication':{'type':Sequelize[_0x75dc('0x7')]},'lastdata':{'type':Sequelize[_0x75dc('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x75dc('0x9')]},'endtime':{'type':Sequelize[_0x75dc('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x75dc('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x75dc('0x7')]},'amaflags':{'type':Sequelize[_0x75dc('0x7')]},'userfield':{'type':Sequelize[_0x75dc('0x7')]},'userDisposition':{'type':Sequelize[_0x75dc('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x75dc('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x75dc('0x7')]},'note':{'type':Sequelize[_0x75dc('0x7')]},'prefix':{'type':Sequelize[_0x75dc('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x75dc('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 682f05e..088fea5 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32a777,_0x172207){_0x32a777=_0x32a777-0x0;var _0xfd7cd2=_0x5f2f[_0x32a777];return _0xfd7cd2;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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 2b237bb..d5a6287 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 _0x2a36=['path','rimraf','../../config/environment','./voiceCallReport.attributes','define','report_call','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x2a36,0x95));var _0x62a3=function(_0x56d602,_0x37d793){_0x56d602=_0x56d602-0x0;var _0xb2d67f=_0x2a36[_0x56d602];return _0xb2d67f;};'use strict';var _=require(_0x62a3('0x0'));var util=require(_0x62a3('0x1'));var logger=require(_0x62a3('0x2'))(_0x62a3('0x3'));var moment=require(_0x62a3('0x4'));var BPromise=require(_0x62a3('0x5'));var rp=require(_0x62a3('0x6'));var fs=require('fs');var path=require(_0x62a3('0x7'));var rimraf=require(_0x62a3('0x8'));var config=require(_0x62a3('0x9'));var attributes=require(_0x62a3('0xa'));module['exports']=function(_0x53d54a,_0x48f721){return _0x53d54a[_0x62a3('0xb')]('VoiceCallReport',attributes,{'tableName':_0x62a3('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc882=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x40711c,_0x2b24e1){var _0x1d0b89=function(_0xe8884f){while(--_0xe8884f){_0x40711c['push'](_0x40711c['shift']());}};_0x1d0b89(++_0x2b24e1);}(_0xc882,0x126));var _0x2c88=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc882[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var logger=require(_0x2c88('0x2'))('api');var moment=require(_0x2c88('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c88('0x4'));var rimraf=require(_0x2c88('0x5'));var config=require(_0x2c88('0x6'));var attributes=require(_0x2c88('0x7'));module[_0x2c88('0x8')]=function(_0x37e343,_0x322f8c){return _0x37e343[_0x2c88('0x9')](_0x2c88('0xa'),attributes,{'tableName':_0x2c88('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2c88('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f0699db..d180952 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 _0x67a2=['message','info','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','limit','map','model','include','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x67a2,0x142));var _0x267a=function(_0x271f64,_0x18ad21){_0x271f64=_0x271f64-0x0;var _0x4beaaa=_0x67a2[_0x271f64];return _0x4beaaa;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var moment=require(_0x267a('0x2'));var BPromise=require(_0x267a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x267a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x267a('0x5'));var logger=require('../../config/logger')(_0x267a('0x6'));var config=require(_0x267a('0x7'));var jayson=require(_0x267a('0x8'));var client=jayson[_0x267a('0x9')][_0x267a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5269fe,_0x4342ae,_0x56a0aa){return new BPromise(function(_0x27afbe,_0x256008){return client[_0x267a('0xb')](_0x5269fe,_0x56a0aa)[_0x267a('0xc')](function(_0x363cc3){logger['info'](_0x267a('0xd'),_0x4342ae,'request\x20sent');logger[_0x267a('0xe')](_0x267a('0xf'),_0x4342ae,_0x267a('0x10'),JSON[_0x267a('0x11')](_0x363cc3));if(_0x363cc3['error']){if(_0x363cc3[_0x267a('0x12')][_0x267a('0x13')]===0x1f4){logger['error'](_0x267a('0xd'),_0x4342ae,_0x363cc3[_0x267a('0x12')]['message']);return _0x256008(_0x363cc3[_0x267a('0x12')]['message']);}logger[_0x267a('0x12')](_0x267a('0xd'),_0x4342ae,_0x363cc3['error'][_0x267a('0x14')]);return _0x27afbe(_0x363cc3['error']['message']);}else{logger[_0x267a('0x15')](_0x267a('0xd'),_0x4342ae,_0x267a('0x10'));_0x27afbe(_0x363cc3['result'][_0x267a('0x14')]);}})['catch'](function(_0x384ff6){logger['error'](_0x267a('0xd'),_0x4342ae,_0x384ff6);_0x256008(_0x384ff6);});});}exports[_0x267a('0x16')]=function(_0x5c873e){var _0x339577=this;return new Promise(function(_0x135d31,_0x3c9797){return db[_0x267a('0x17')][_0x267a('0x18')]({'raw':_0x5c873e['options']?_0x5c873e['options'][_0x267a('0x19')]===undefined?!![]:![]:!![],'where':_0x5c873e[_0x267a('0x1a')]?_0x5c873e[_0x267a('0x1a')][_0x267a('0x1b')]||null:null,'attributes':_0x5c873e['options']?_0x5c873e[_0x267a('0x1a')]['attributes']||null:null,'limit':_0x5c873e[_0x267a('0x1a')]?_0x5c873e[_0x267a('0x1a')][_0x267a('0x1c')]||null:null,'include':_0x5c873e[_0x267a('0x1a')]?_0x5c873e[_0x267a('0x1a')]['include']?_[_0x267a('0x1d')](_0x5c873e[_0x267a('0x1a')]['include'],function(_0x300021){return{'model':db[_0x300021[_0x267a('0x1e')]],'as':_0x300021['as'],'attributes':_0x300021['attributes'],'include':_0x300021['include']?_[_0x267a('0x1d')](_0x300021[_0x267a('0x1f')],function(_0x5ba0c5){return{'model':db[_0x5ba0c5['model']],'as':_0x5ba0c5['as'],'attributes':_0x5ba0c5['attributes'],'include':_0x5ba0c5[_0x267a('0x1f')]?_[_0x267a('0x1d')](_0x5ba0c5[_0x267a('0x1f')],function(_0x13e517){return{'model':db[_0x13e517[_0x267a('0x1e')]],'as':_0x13e517['as'],'attributes':_0x13e517['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe864cd){logger['info'](_0x267a('0x16'),_0x5c873e);logger['debug'](_0x267a('0x16'),_0x5c873e,JSON[_0x267a('0x11')](_0xe864cd));_0x135d31(_0xe864cd);})[_0x267a('0x20')](function(_0x5f34da){logger[_0x267a('0x12')]('GetVoiceCallReport',_0x5f34da['message'],_0x5c873e);_0x3c9797(_0x339577['error'](0x1f4,_0x5f34da['message']));});});};exports['CreateVoiceCallReport']=function(_0x358916){var _0x45890d=this;return new Promise(function(_0x1acf6b,_0x5e87dd){return db[_0x267a('0x17')][_0x267a('0x21')](_0x358916[_0x267a('0x22')],{'raw':_0x358916['options']?_0x358916[_0x267a('0x1a')][_0x267a('0x19')]===undefined?!![]:![]:!![]})[_0x267a('0xc')](function(_0x412c13){logger['info'](_0x267a('0x23'),_0x358916);logger[_0x267a('0xe')](_0x267a('0x23'),_0x358916,JSON[_0x267a('0x11')](_0x412c13));_0x1acf6b(_0x412c13);})[_0x267a('0x20')](function(_0x1bbc58){logger['error']('CreateVoiceCallReport',_0x1bbc58['message'],_0x358916);_0x5e87dd(_0x45890d[_0x267a('0x12')](0x1f4,_0x1bbc58['message']));});});};exports[_0x267a('0x24')]=function(_0x5b04a9){var _0x4ff316=this;return new Promise(function(_0x4cb072,_0x59dcb8){return db[_0x267a('0x17')]['update'](_0x5b04a9[_0x267a('0x22')],{'raw':_0x5b04a9[_0x267a('0x1a')]?_0x5b04a9[_0x267a('0x1a')][_0x267a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b04a9['options']?_0x5b04a9[_0x267a('0x1a')][_0x267a('0x1b')]||null:null,'attributes':_0x5b04a9[_0x267a('0x1a')]?_0x5b04a9[_0x267a('0x1a')][_0x267a('0x25')]||null:null,'limit':_0x5b04a9[_0x267a('0x1a')]?_0x5b04a9[_0x267a('0x1a')][_0x267a('0x1c')]||null:null})[_0x267a('0xc')](function(_0x403563){logger['info']('UpdateVoiceCallReport',_0x5b04a9);logger[_0x267a('0xe')](_0x267a('0x24'),_0x5b04a9,JSON[_0x267a('0x11')](_0x403563));_0x4cb072(_0x403563);})['catch'](function(_0x27cdf1){logger['error'](_0x267a('0x24'),_0x27cdf1[_0x267a('0x14')],_0x5b04a9);_0x59dcb8(_0x4ff316[_0x267a('0x12')](0x1f4,_0x27cdf1[_0x267a('0x14')]));});});}; \ No newline at end of file +var _0xe521=['../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x463012,_0x4ba3a9){var _0x28fe0c=function(_0x49bdf4){while(--_0x49bdf4){_0x463012['push'](_0x463012['shift']());}};_0x28fe0c(++_0x4ba3a9);}(_0xe521,0x174));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e52('0x0'));var util=require(_0x1e52('0x1'));var moment=require(_0x1e52('0x2'));var BPromise=require(_0x1e52('0x3'));var rs=require(_0x1e52('0x4'));var fs=require('fs');var Redis=require(_0x1e52('0x5'));var db=require(_0x1e52('0x6'))['db'];var utils=require(_0x1e52('0x7'));var logger=require(_0x1e52('0x8'))(_0x1e52('0x9'));var config=require(_0x1e52('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1e52('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa69753,_0x59066b,_0x41a63a){return new BPromise(function(_0x4a093e,_0x16318b){return client[_0x1e52('0xc')](_0xa69753,_0x41a63a)[_0x1e52('0xd')](function(_0x19df65){logger[_0x1e52('0xe')](_0x1e52('0xf'),_0x59066b,_0x1e52('0x10'));logger[_0x1e52('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x59066b,_0x1e52('0x10'),JSON[_0x1e52('0x12')](_0x19df65));if(_0x19df65['error']){if(_0x19df65[_0x1e52('0x13')][_0x1e52('0x14')]===0x1f4){logger['error'](_0x1e52('0xf'),_0x59066b,_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);return _0x16318b(_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);}logger[_0x1e52('0x13')](_0x1e52('0xf'),_0x59066b,_0x19df65['error'][_0x1e52('0x15')]);return _0x4a093e(_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);}else{logger[_0x1e52('0xe')](_0x1e52('0xf'),_0x59066b,_0x1e52('0x10'));_0x4a093e(_0x19df65[_0x1e52('0x16')][_0x1e52('0x15')]);}})[_0x1e52('0x17')](function(_0x4fcda4){logger[_0x1e52('0x13')](_0x1e52('0xf'),_0x59066b,_0x4fcda4);_0x16318b(_0x4fcda4);});});}exports['GetVoiceCallReport']=function(_0x1ab0fd){var _0x29c574=this;return new Promise(function(_0x5812ab,_0xc53c30){return db[_0x1e52('0x18')][_0x1e52('0x19')]({'raw':_0x1ab0fd['options']?_0x1ab0fd[_0x1e52('0x1a')][_0x1e52('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd[_0x1e52('0x1a')]['where']||null:null,'attributes':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd[_0x1e52('0x1a')][_0x1e52('0x1c')]||null:null,'limit':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd['options'][_0x1e52('0x1d')]||null:null,'include':_0x1ab0fd['options']?_0x1ab0fd[_0x1e52('0x1a')]['include']?_['map'](_0x1ab0fd[_0x1e52('0x1a')]['include'],function(_0x9edb99){return{'model':db[_0x9edb99['model']],'as':_0x9edb99['as'],'attributes':_0x9edb99[_0x1e52('0x1c')],'include':_0x9edb99[_0x1e52('0x1e')]?_[_0x1e52('0x1f')](_0x9edb99[_0x1e52('0x1e')],function(_0x48d45c){return{'model':db[_0x48d45c[_0x1e52('0x20')]],'as':_0x48d45c['as'],'attributes':_0x48d45c[_0x1e52('0x1c')],'include':_0x48d45c[_0x1e52('0x1e')]?_[_0x1e52('0x1f')](_0x48d45c[_0x1e52('0x1e')],function(_0x3123b0){return{'model':db[_0x3123b0[_0x1e52('0x20')]],'as':_0x3123b0['as'],'attributes':_0x3123b0[_0x1e52('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e52('0xd')](function(_0x285b17){logger[_0x1e52('0xe')]('GetVoiceCallReport',_0x1ab0fd);logger[_0x1e52('0x11')](_0x1e52('0x21'),_0x1ab0fd,JSON[_0x1e52('0x12')](_0x285b17));_0x5812ab(_0x285b17);})[_0x1e52('0x17')](function(_0x4126c4){logger[_0x1e52('0x13')](_0x1e52('0x21'),_0x4126c4[_0x1e52('0x15')],_0x1ab0fd);_0xc53c30(_0x29c574[_0x1e52('0x13')](0x1f4,_0x4126c4[_0x1e52('0x15')]));});});};exports[_0x1e52('0x22')]=function(_0x2649ae){var _0x56dc7e=this;return new Promise(function(_0x4c6527,_0x4f35a1){return db[_0x1e52('0x18')]['create'](_0x2649ae['body'],{'raw':_0x2649ae[_0x1e52('0x1a')]?_0x2649ae[_0x1e52('0x1a')][_0x1e52('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x430608){logger[_0x1e52('0xe')]('CreateVoiceCallReport',_0x2649ae);logger[_0x1e52('0x11')](_0x1e52('0x22'),_0x2649ae,JSON[_0x1e52('0x12')](_0x430608));_0x4c6527(_0x430608);})[_0x1e52('0x17')](function(_0x95f3c1){logger[_0x1e52('0x13')](_0x1e52('0x22'),_0x95f3c1[_0x1e52('0x15')],_0x2649ae);_0x4f35a1(_0x56dc7e['error'](0x1f4,_0x95f3c1[_0x1e52('0x15')]));});});};exports[_0x1e52('0x23')]=function(_0x562d11){var _0x5b381c=this;return new Promise(function(_0x1b0b37,_0x8a9546){return db['VoiceCallReport'][_0x1e52('0x24')](_0x562d11['body'],{'raw':_0x562d11[_0x1e52('0x1a')]?_0x562d11['options'][_0x1e52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562d11[_0x1e52('0x1a')]?_0x562d11[_0x1e52('0x1a')][_0x1e52('0x25')]||null:null,'attributes':_0x562d11[_0x1e52('0x1a')]?_0x562d11[_0x1e52('0x1a')][_0x1e52('0x1c')]||null:null,'limit':_0x562d11[_0x1e52('0x1a')]?_0x562d11['options'][_0x1e52('0x1d')]||null:null})[_0x1e52('0xd')](function(_0x2b5807){logger[_0x1e52('0xe')](_0x1e52('0x23'),_0x562d11);logger[_0x1e52('0x11')](_0x1e52('0x23'),_0x562d11,JSON[_0x1e52('0x12')](_0x2b5807));_0x1b0b37(_0x2b5807);})[_0x1e52('0x17')](function(_0x1b3872){logger[_0x1e52('0x13')](_0x1e52('0x23'),_0x1b3872[_0x1e52('0x15')],_0x562d11);_0x8a9546(_0x5b381c[_0x1e52('0x13')](0x1f4,_0x1b3872[_0x1e52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 8cc4a7a..c73eb75 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 _0xce4c=['./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xaf1c5f,_0x349e76){var _0x2a3ba6=function(_0x1e329a){while(--_0x1e329a){_0xaf1c5f['push'](_0xaf1c5f['shift']());}};_0x2a3ba6(++_0x349e76);}(_0xce4c,0x162));var _0xcce4=function(_0x46416c,_0x57d97e){_0x46416c=_0x46416c-0x0;var _0x2caeac=_0xce4c[_0x46416c];return _0x2caeac;};'use strict';var multer=require('multer');var util=require(_0xcce4('0x0'));var path=require(_0xcce4('0x1'));var timeout=require(_0xcce4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcce4('0x3'));var auth=require(_0xcce4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcce4('0x5'));var controller=require(_0xcce4('0x6'));router['get']('/',auth[_0xcce4('0x7')](),controller[_0xcce4('0x8')]);router[_0xcce4('0x9')](_0xcce4('0xa'),auth[_0xcce4('0x7')](),controller[_0xcce4('0xb')]);router[_0xcce4('0xc')]('/',auth[_0xcce4('0x7')](),controller[_0xcce4('0xd')]);router[_0xcce4('0xe')](_0xcce4('0xa'),auth[_0xcce4('0x7')](),controller[_0xcce4('0xf')]);router[_0xcce4('0x10')](_0xcce4('0xa'),auth[_0xcce4('0x7')](),controller[_0xcce4('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd3b8=['get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0xd3b8,0xd6));var _0x8d3b=function(_0x23d2a0,_0x516174){_0x23d2a0=_0x23d2a0-0x0;var _0x409e80=_0xd3b8[_0x23d2a0];return _0x409e80;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8d3b('0x0'));var express=require(_0x8d3b('0x1'));var router=express[_0x8d3b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8d3b('0x3'));var interaction=require(_0x8d3b('0x4'));var config=require(_0x8d3b('0x5'));var controller=require(_0x8d3b('0x6'));router[_0x8d3b('0x7')]('/',auth[_0x8d3b('0x8')](),controller[_0x8d3b('0x9')]);router['get'](_0x8d3b('0xa'),auth['isAuthenticated'](),controller[_0x8d3b('0xb')]);router['post']('/',auth[_0x8d3b('0x8')](),controller[_0x8d3b('0xc')]);router[_0x8d3b('0xd')](_0x8d3b('0xa'),auth[_0x8d3b('0x8')](),controller['update']);router[_0x8d3b('0xe')](_0x8d3b('0xa'),auth[_0x8d3b('0x8')](),controller[_0x8d3b('0xf')]);module[_0x8d3b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4462470..7543d12 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 _0x903a=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x406fbb,_0x1093e5){var _0x8e921d=function(_0x410517){while(--_0x410517){_0x406fbb['push'](_0x406fbb['shift']());}};_0x8e921d(++_0x1093e5);}(_0x903a,0x195));var _0xa903=function(_0x42944e,_0x1b008d){_0x42944e=_0x42944e-0x0;var _0x4e7a1b=_0x903a[_0x42944e];return _0x4e7a1b;};'use strict';var Sequelize=require(_0xa903('0x0'));module[_0xa903('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa903('0x2')],'unique':_0xa903('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xa903('0x2')],'set':function(_0x10a9ed){this[_0xa903('0x4')](_0xa903('0x5'),_0x10a9ed?_0x10a9ed[_0xa903('0x6')](''):[]);},'get':function(){return this[_0xa903('0x7')](_0xa903('0x5'))?this[_0xa903('0x7')]('options')[_0xa903('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xa903('0x2')]},'record':{'type':Sequelize[_0xa903('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa903('0x2')]},'description':{'type':Sequelize[_0xa903('0x2')]}}; \ No newline at end of file +var _0xe9ce=['BOOLEAN','sequelize','exports','STRING','name','options','join','getDataValue','split'];(function(_0x7e4e6b,_0x4c26c6){var _0x219afa=function(_0x20e11e){while(--_0x20e11e){_0x7e4e6b['push'](_0x7e4e6b['shift']());}};_0x219afa(++_0x4c26c6);}(_0xe9ce,0xbe));var _0xee9c=function(_0x18ece2,_0xd87505){_0x18ece2=_0x18ece2-0x0;var _0x1c3930=_0xe9ce[_0x18ece2];return _0x1c3930;};'use strict';var Sequelize=require(_0xee9c('0x0'));module[_0xee9c('0x1')]={'name':{'type':Sequelize[_0xee9c('0x2')]},'prefix':{'type':Sequelize[_0xee9c('0x2')],'unique':_0xee9c('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xee9c('0x2')],'set':function(_0x2c13e3){this['setDataValue'](_0xee9c('0x4'),_0x2c13e3?_0x2c13e3[_0xee9c('0x5')](''):[]);},'get':function(){return this[_0xee9c('0x6')](_0xee9c('0x4'))?this[_0xee9c('0x6')](_0xee9c('0x4'))[_0xee9c('0x7')](''):[];}},'auth':{'type':Sequelize[_0xee9c('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xee9c('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee9c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6b77a2e..c7f96d4 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 _0x7dc2=['keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','length','find','create','body','user','role','ChanSpies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27dc('0x0'));var jsonpatch=require(_0x27dc('0x1'));var rp=require(_0x27dc('0x2'));var moment=require(_0x27dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27dc('0x4'));var util=require(_0x27dc('0x5'));var path=require('path');var sox=require(_0x27dc('0x6'));var csv=require(_0x27dc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27dc('0x8'));var _=require('lodash');var squel=require(_0x27dc('0x9'));var crypto=require(_0x27dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x27dc('0xb'));var toCsv=require(_0x27dc('0x7'));var querystring=require(_0x27dc('0xc'));var Papa=require(_0x27dc('0xd'));var Redis=require('ioredis');var authService=require(_0x27dc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x27dc('0xf'));var hardwareService=require(_0x27dc('0x10'));var logger=require(_0x27dc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x27dc('0x12'));var licenseUtil=require(_0x27dc('0x13'));var db=require(_0x27dc('0x14'))['db'];function respondWithStatusCode(_0x1c7a9e,_0x4d8afd){_0x4d8afd=_0x4d8afd||0xcc;return function(_0x2d7799){if(_0x2d7799){return _0x1c7a9e['sendStatus'](_0x4d8afd);}return _0x1c7a9e[_0x27dc('0x15')](_0x4d8afd)['end']();};}function respondWithResult(_0x1282f2,_0x22d9ac){_0x22d9ac=_0x22d9ac||0xc8;return function(_0x7972d8){if(_0x7972d8){return _0x1282f2[_0x27dc('0x15')](_0x22d9ac)['json'](_0x7972d8);}};}function respondWithFilteredResult(_0x110316,_0x1bd473){return function(_0x798f50){if(_0x798f50){var _0x4193f9=typeof _0x1bd473[_0x27dc('0x16')]==='undefined'&&typeof _0x1bd473[_0x27dc('0x17')]===_0x27dc('0x18');var _0x21f537=_0x798f50[_0x27dc('0x19')];var _0x5d308b=_0x4193f9?0x0:_0x1bd473[_0x27dc('0x16')];var _0x1ff9a2=_0x4193f9?_0x798f50[_0x27dc('0x19')]:_0x1bd473[_0x27dc('0x16')]+_0x1bd473[_0x27dc('0x17')];var _0x3dcfca;if(_0x1ff9a2>=_0x21f537){_0x1ff9a2=_0x21f537;_0x3dcfca=0xc8;}else{_0x3dcfca=0xce;}_0x110316[_0x27dc('0x15')](_0x3dcfca);return _0x110316[_0x27dc('0x1a')](_0x27dc('0x1b'),_0x5d308b+'-'+_0x1ff9a2+'/'+_0x21f537)[_0x27dc('0x1c')](_0x798f50);}return null;};}function patchUpdates(_0x5064d5){return function(_0x3b9afc){try{jsonpatch[_0x27dc('0x1d')](_0x3b9afc,_0x5064d5,!![]);}catch(_0x4bb946){return BPromise[_0x27dc('0x1e')](_0x4bb946);}return _0x3b9afc['save']();};}function saveUpdates(_0x5c0fca,_0x2843b1){return function(_0x4eddfe){if(_0x4eddfe){return _0x4eddfe[_0x27dc('0x1f')](_0x5c0fca)['then'](function(_0x4a7d2a){return _0x4a7d2a;});}return null;};}function removeEntity(_0x14fa88,_0x4a9da0){return function(_0x37917e){if(_0x37917e){return _0x37917e['destroy']()[_0x27dc('0x20')](function(){var _0x1eb83d=_0x37917e[_0x27dc('0x21')]({'plain':!![]});var _0x19db16='ChanSpies';return db[_0x27dc('0x22')]['destroy']({'where':{'type':_0x19db16,'resourceId':_0x1eb83d['id']}})['then'](function(){return _0x37917e;});})[_0x27dc('0x20')](function(){_0x14fa88[_0x27dc('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x449610,_0xfe5817){return function(_0x2ac84c){if(!_0x2ac84c){_0x449610[_0x27dc('0x23')](0x194);}return _0x2ac84c;};}function handleError(_0x453dea,_0x548c23){_0x548c23=_0x548c23||0x1f4;return function(_0x76d54b){logger[_0x27dc('0x24')](_0x76d54b[_0x27dc('0x25')]);if(_0x76d54b[_0x27dc('0x26')]){delete _0x76d54b[_0x27dc('0x26')];}_0x453dea['status'](_0x548c23)[_0x27dc('0x27')](_0x76d54b);};}exports[_0x27dc('0x28')]=function(_0x4a2fe6,_0x14a8a1){var _0x2e837a={},_0x1ac11a={},_0xc4e71a={'count':0x0,'rows':[]};var _0x545918=_[_0x27dc('0x29')](db[_0x27dc('0x2a')][_0x27dc('0x2b')],function(_0x58fd4c){return{'name':_0x58fd4c[_0x27dc('0x2c')],'type':_0x58fd4c[_0x27dc('0x2d')][_0x27dc('0x2e')]};});_0x1ac11a[_0x27dc('0x2f')]=_['map'](_0x545918,_0x27dc('0x26'));_0x1ac11a[_0x27dc('0x30')]=_[_0x27dc('0x31')](_0x4a2fe6['query']);_0x1ac11a[_0x27dc('0x32')]=_[_0x27dc('0x33')](_0x1ac11a[_0x27dc('0x2f')],_0x1ac11a[_0x27dc('0x30')]);_0x2e837a[_0x27dc('0x34')]=_['intersection'](_0x1ac11a[_0x27dc('0x2f')],qs[_0x27dc('0x35')](_0x4a2fe6[_0x27dc('0x30')][_0x27dc('0x35')]));_0x2e837a[_0x27dc('0x34')]=_0x2e837a['attributes']['length']?_0x2e837a[_0x27dc('0x34')]:_0x1ac11a[_0x27dc('0x2f')];if(!_0x4a2fe6[_0x27dc('0x30')][_0x27dc('0x36')]('nolimit')){_0x2e837a['limit']=qs[_0x27dc('0x17')](_0x4a2fe6[_0x27dc('0x30')][_0x27dc('0x17')]);_0x2e837a['offset']=qs[_0x27dc('0x16')](_0x4a2fe6['query'][_0x27dc('0x16')]);}_0x2e837a['order']=qs[_0x27dc('0x37')](_0x4a2fe6[_0x27dc('0x30')][_0x27dc('0x37')]);_0x2e837a[_0x27dc('0x38')]=qs[_0x27dc('0x32')](_[_0x27dc('0x39')](_0x4a2fe6[_0x27dc('0x30')],_0x1ac11a[_0x27dc('0x32')]),_0x545918);if(_0x4a2fe6['query'][_0x27dc('0x3a')]){_0x2e837a[_0x27dc('0x38')]=_['merge'](_0x2e837a[_0x27dc('0x38')],{'$or':_[_0x27dc('0x29')](_0x545918,function(_0x320044){if(_0x320044['type']!==_0x27dc('0x3b')){var _0x8ad900={};_0x8ad900[_0x320044[_0x27dc('0x26')]]={'$like':'%'+_0x4a2fe6[_0x27dc('0x30')]['filter']+'%'};return _0x8ad900;}})});}_0x2e837a=_[_0x27dc('0x3c')]({},_0x2e837a,_0x4a2fe6[_0x27dc('0x3d')]);var _0x306330={'where':_0x2e837a[_0x27dc('0x38')]};return db[_0x27dc('0x2a')][_0x27dc('0x19')](_0x306330)['then'](function(_0x5066b5){_0xc4e71a['count']=_0x5066b5;if(_0x4a2fe6[_0x27dc('0x30')][_0x27dc('0x3e')]){_0x2e837a[_0x27dc('0x3f')]=[{'all':!![]}];}return db[_0x27dc('0x2a')]['findAll'](_0x2e837a);})['then'](function(_0x725244){_0xc4e71a['rows']=_0x725244;return _0xc4e71a;})[_0x27dc('0x20')](respondWithFilteredResult(_0x14a8a1,_0x2e837a))[_0x27dc('0x40')](handleError(_0x14a8a1,null));};exports[_0x27dc('0x41')]=function(_0x509dc9,_0x322350){var _0x2441c2={'raw':![],'where':{'id':_0x509dc9[_0x27dc('0x42')]['id']}},_0x25cd9e={};_0x25cd9e['model']=_[_0x27dc('0x31')](db[_0x27dc('0x2a')]['rawAttributes']);_0x25cd9e[_0x27dc('0x30')]=_[_0x27dc('0x31')](_0x509dc9[_0x27dc('0x30')]);_0x25cd9e[_0x27dc('0x32')]=_[_0x27dc('0x33')](_0x25cd9e[_0x27dc('0x2f')],_0x25cd9e[_0x27dc('0x30')]);_0x2441c2[_0x27dc('0x34')]=_[_0x27dc('0x33')](_0x25cd9e['model'],qs[_0x27dc('0x35')](_0x509dc9['query'][_0x27dc('0x35')]));_0x2441c2[_0x27dc('0x34')]=_0x2441c2[_0x27dc('0x34')][_0x27dc('0x43')]?_0x2441c2[_0x27dc('0x34')]:_0x25cd9e['model'];if(_0x509dc9[_0x27dc('0x30')][_0x27dc('0x3e')]){_0x2441c2[_0x27dc('0x3f')]=[{'all':!![]}];}_0x2441c2=_[_0x27dc('0x3c')]({},_0x2441c2,_0x509dc9[_0x27dc('0x3d')]);return db[_0x27dc('0x2a')][_0x27dc('0x44')](_0x2441c2)[_0x27dc('0x20')](handleEntityNotFound(_0x322350,null))[_0x27dc('0x20')](respondWithResult(_0x322350,null))['catch'](handleError(_0x322350,null));};exports['create']=function(_0x8db62d,_0x37517d){return db['VoiceChanSpy'][_0x27dc('0x45')](_0x8db62d[_0x27dc('0x46')],{})['then'](function(_0x4a828c){var _0x5bd8b6=_0x8db62d[_0x27dc('0x47')]['get']({'plain':!![]});if(!_0x5bd8b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bd8b6[_0x27dc('0x48')]===_0x27dc('0x47')){var _0x22f3df=_0x4a828c['get']({'plain':!![]});var _0x220ca3=_0x27dc('0x49');return db['UserProfileSection'][_0x27dc('0x44')]({'where':{'name':_0x220ca3,'userProfileId':_0x5bd8b6[_0x27dc('0x4a')]},'raw':!![]})['then'](function(_0x5a9d38){if(_0x5a9d38&&_0x5a9d38[_0x27dc('0x4b')]===0x0){return db[_0x27dc('0x22')][_0x27dc('0x45')]({'name':_0x22f3df[_0x27dc('0x26')],'resourceId':_0x22f3df['id'],'type':_0x5a9d38[_0x27dc('0x26')],'sectionId':_0x5a9d38['id']},{})['then'](function(){return _0x4a828c;});}else{return _0x4a828c;}})[_0x27dc('0x40')](function(_0x32143a){logger['error'](_0x27dc('0x4c'),_0x32143a);throw _0x32143a;});}return _0x4a828c;})[_0x27dc('0x20')](respondWithResult(_0x37517d,0xc9))['catch'](handleError(_0x37517d,null));};exports[_0x27dc('0x1f')]=function(_0x571f23,_0x32ee93){if(_0x571f23[_0x27dc('0x46')]['id']){delete _0x571f23['body']['id'];}return db[_0x27dc('0x2a')][_0x27dc('0x44')]({'where':{'id':_0x571f23[_0x27dc('0x42')]['id']}})[_0x27dc('0x20')](handleEntityNotFound(_0x32ee93,null))['then'](saveUpdates(_0x571f23['body'],null))[_0x27dc('0x20')](respondWithResult(_0x32ee93,null))[_0x27dc('0x40')](handleError(_0x32ee93,null));};exports['destroy']=function(_0x2736d6,_0x4b45ca){return db[_0x27dc('0x2a')][_0x27dc('0x44')]({'where':{'id':_0x2736d6['params']['id']}})[_0x27dc('0x20')](handleEntityNotFound(_0x4b45ca,null))[_0x27dc('0x20')](removeEntity(_0x4b45ca,null))[_0x27dc('0x40')](handleError(_0x4b45ca,null));}; \ No newline at end of file +var _0x35a9=['attributes','fields','query','length','nolimit','order','sort','pick','merge','where','map','type','VIRTUAL','filter','includeAll','include','VoiceChanSpy','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','key','model','keys','filters','intersection'];(function(_0x1d906c,_0x3a6c23){var _0x4600ff=function(_0x259890){while(--_0x259890){_0x1d906c['push'](_0x1d906c['shift']());}};_0x4600ff(++_0x3a6c23);}(_0x35a9,0x73));var _0x935a=function(_0x55fa2f,_0x215e30){_0x55fa2f=_0x55fa2f-0x0;var _0x538f59=_0x35a9[_0x55fa2f];return _0x538f59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x935a('0x0'));var zipdir=require(_0x935a('0x1'));var jsonpatch=require(_0x935a('0x2'));var rp=require(_0x935a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x935a('0x4'));var util=require('util');var path=require(_0x935a('0x5'));var sox=require(_0x935a('0x6'));var csv=require(_0x935a('0x7'));var ejs=require(_0x935a('0x8'));var fs=require('fs');var fs_extra=require(_0x935a('0x9'));var _=require(_0x935a('0xa'));var squel=require(_0x935a('0xb'));var crypto=require(_0x935a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x935a('0xd'));var toCsv=require(_0x935a('0x7'));var querystring=require(_0x935a('0xe'));var Papa=require(_0x935a('0xf'));var Redis=require(_0x935a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x935a('0x11'));var as=require(_0x935a('0x12'));var hardwareService=require(_0x935a('0x13'));var logger=require('../../config/logger')(_0x935a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x935a('0x15'));var db=require(_0x935a('0x16'))['db'];function respondWithStatusCode(_0x1e5152,_0x441f98){_0x441f98=_0x441f98||0xcc;return function(_0x3ed7e0){if(_0x3ed7e0){return _0x1e5152[_0x935a('0x17')](_0x441f98);}return _0x1e5152[_0x935a('0x18')](_0x441f98)[_0x935a('0x19')]();};}function respondWithResult(_0x5e1131,_0x109a98){_0x109a98=_0x109a98||0xc8;return function(_0x304c38){if(_0x304c38){return _0x5e1131[_0x935a('0x18')](_0x109a98)[_0x935a('0x1a')](_0x304c38);}};}function respondWithFilteredResult(_0xeebc0c,_0x22ab95){return function(_0xf881d6){if(_0xf881d6){var _0x463db1=typeof _0x22ab95[_0x935a('0x1b')]===_0x935a('0x1c')&&typeof _0x22ab95['limit']===_0x935a('0x1c');var _0x2aab94=_0xf881d6[_0x935a('0x1d')];var _0x446232=_0x463db1?0x0:_0x22ab95[_0x935a('0x1b')];var _0x3bac3e=_0x463db1?_0xf881d6[_0x935a('0x1d')]:_0x22ab95['offset']+_0x22ab95[_0x935a('0x1e')];var _0x90ef4;if(_0x3bac3e>=_0x2aab94){_0x3bac3e=_0x2aab94;_0x90ef4=0xc8;}else{_0x90ef4=0xce;}_0xeebc0c[_0x935a('0x18')](_0x90ef4);return _0xeebc0c[_0x935a('0x1f')]('Content-Range',_0x446232+'-'+_0x3bac3e+'/'+_0x2aab94)[_0x935a('0x1a')](_0xf881d6);}return null;};}function patchUpdates(_0x2c6873){return function(_0x53267b){try{jsonpatch[_0x935a('0x20')](_0x53267b,_0x2c6873,!![]);}catch(_0x257eb9){return BPromise[_0x935a('0x21')](_0x257eb9);}return _0x53267b[_0x935a('0x22')]();};}function saveUpdates(_0xe04139,_0x490627){return function(_0x267c48){if(_0x267c48){return _0x267c48[_0x935a('0x23')](_0xe04139)[_0x935a('0x24')](function(_0x4dd7aa){return _0x4dd7aa;});}return null;};}function removeEntity(_0x13e62a,_0x413787){return function(_0x326246){if(_0x326246){return _0x326246[_0x935a('0x25')]()['then'](function(){var _0x540f4e=_0x326246[_0x935a('0x26')]({'plain':!![]});var _0x46b6b8='ChanSpies';return db[_0x935a('0x27')][_0x935a('0x25')]({'where':{'type':_0x46b6b8,'resourceId':_0x540f4e['id']}})[_0x935a('0x24')](function(){return _0x326246;});})[_0x935a('0x24')](function(){_0x13e62a[_0x935a('0x18')](0xcc)[_0x935a('0x19')]();});}};}function handleEntityNotFound(_0x194a2a,_0x752f15){return function(_0x385ca2){if(!_0x385ca2){_0x194a2a[_0x935a('0x17')](0x194);}return _0x385ca2;};}function handleError(_0x31562c,_0x422d1c){_0x422d1c=_0x422d1c||0x1f4;return function(_0x595b1c){logger[_0x935a('0x28')](_0x595b1c[_0x935a('0x29')]);if(_0x595b1c[_0x935a('0x2a')]){delete _0x595b1c['name'];}_0x31562c[_0x935a('0x18')](_0x422d1c)[_0x935a('0x2b')](_0x595b1c);};}exports[_0x935a('0x2c')]=function(_0x1bb4e4,_0x48c9b5){var _0x1ab791={},_0x9c7f8d={},_0x16f0d8={'count':0x0,'rows':[]};var _0x2850fc=_['map'](db['VoiceChanSpy'][_0x935a('0x2d')],function(_0x226bb4){return{'name':_0x226bb4['fieldName'],'type':_0x226bb4['type'][_0x935a('0x2e')]};});_0x9c7f8d[_0x935a('0x2f')]=_['map'](_0x2850fc,_0x935a('0x2a'));_0x9c7f8d['query']=_[_0x935a('0x30')](_0x1bb4e4['query']);_0x9c7f8d[_0x935a('0x31')]=_[_0x935a('0x32')](_0x9c7f8d['model'],_0x9c7f8d['query']);_0x1ab791[_0x935a('0x33')]=_[_0x935a('0x32')](_0x9c7f8d[_0x935a('0x2f')],qs[_0x935a('0x34')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x34')]));_0x1ab791[_0x935a('0x33')]=_0x1ab791[_0x935a('0x33')][_0x935a('0x36')]?_0x1ab791[_0x935a('0x33')]:_0x9c7f8d['model'];if(!_0x1bb4e4['query']['hasOwnProperty'](_0x935a('0x37'))){_0x1ab791[_0x935a('0x1e')]=qs[_0x935a('0x1e')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x1e')]);_0x1ab791[_0x935a('0x1b')]=qs['offset'](_0x1bb4e4[_0x935a('0x35')]['offset']);}_0x1ab791[_0x935a('0x38')]=qs[_0x935a('0x39')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x39')]);_0x1ab791['where']=qs[_0x935a('0x31')](_[_0x935a('0x3a')](_0x1bb4e4[_0x935a('0x35')],_0x9c7f8d[_0x935a('0x31')]),_0x2850fc);if(_0x1bb4e4[_0x935a('0x35')]['filter']){_0x1ab791['where']=_[_0x935a('0x3b')](_0x1ab791[_0x935a('0x3c')],{'$or':_[_0x935a('0x3d')](_0x2850fc,function(_0x43a566){if(_0x43a566[_0x935a('0x3e')]!==_0x935a('0x3f')){var _0x1a245e={};_0x1a245e[_0x43a566[_0x935a('0x2a')]]={'$like':'%'+_0x1bb4e4[_0x935a('0x35')][_0x935a('0x40')]+'%'};return _0x1a245e;}})});}_0x1ab791=_[_0x935a('0x3b')]({},_0x1ab791,_0x1bb4e4['options']);var _0x2a48ef={'where':_0x1ab791['where']};return db['VoiceChanSpy'][_0x935a('0x1d')](_0x2a48ef)['then'](function(_0x3f5653){_0x16f0d8[_0x935a('0x1d')]=_0x3f5653;if(_0x1bb4e4[_0x935a('0x35')][_0x935a('0x41')]){_0x1ab791[_0x935a('0x42')]=[{'all':!![]}];}return db[_0x935a('0x43')][_0x935a('0x44')](_0x1ab791);})['then'](function(_0x2d734d){_0x16f0d8['rows']=_0x2d734d;return _0x16f0d8;})[_0x935a('0x24')](respondWithFilteredResult(_0x48c9b5,_0x1ab791))[_0x935a('0x45')](handleError(_0x48c9b5,null));};exports[_0x935a('0x46')]=function(_0x1bee32,_0x196c4f){var _0x8ba2a9={'raw':![],'where':{'id':_0x1bee32[_0x935a('0x47')]['id']}},_0x4c3a61={};_0x4c3a61['model']=_[_0x935a('0x30')](db['VoiceChanSpy'][_0x935a('0x2d')]);_0x4c3a61[_0x935a('0x35')]=_['keys'](_0x1bee32[_0x935a('0x35')]);_0x4c3a61[_0x935a('0x31')]=_[_0x935a('0x32')](_0x4c3a61[_0x935a('0x2f')],_0x4c3a61[_0x935a('0x35')]);_0x8ba2a9[_0x935a('0x33')]=_['intersection'](_0x4c3a61['model'],qs[_0x935a('0x34')](_0x1bee32['query'][_0x935a('0x34')]));_0x8ba2a9[_0x935a('0x33')]=_0x8ba2a9[_0x935a('0x33')][_0x935a('0x36')]?_0x8ba2a9[_0x935a('0x33')]:_0x4c3a61[_0x935a('0x2f')];if(_0x1bee32[_0x935a('0x35')][_0x935a('0x41')]){_0x8ba2a9['include']=[{'all':!![]}];}_0x8ba2a9=_[_0x935a('0x3b')]({},_0x8ba2a9,_0x1bee32[_0x935a('0x48')]);return db[_0x935a('0x43')][_0x935a('0x49')](_0x8ba2a9)[_0x935a('0x24')](handleEntityNotFound(_0x196c4f,null))[_0x935a('0x24')](respondWithResult(_0x196c4f,null))[_0x935a('0x45')](handleError(_0x196c4f,null));};exports[_0x935a('0x4a')]=function(_0x479124,_0x23e85f){return db['VoiceChanSpy']['create'](_0x479124['body'],{})[_0x935a('0x24')](function(_0x384de0){var _0x1be4e2=_0x479124[_0x935a('0x4b')]['get']({'plain':!![]});if(!_0x1be4e2)throw new Error(_0x935a('0x4c'));if(_0x1be4e2['role']==='user'){var _0x41c5dc=_0x384de0[_0x935a('0x26')]({'plain':!![]});var _0x2d309e=_0x935a('0x4d');return db[_0x935a('0x4e')][_0x935a('0x49')]({'where':{'name':_0x2d309e,'userProfileId':_0x1be4e2[_0x935a('0x4f')]},'raw':!![]})['then'](function(_0x2d48e3){if(_0x2d48e3&&_0x2d48e3[_0x935a('0x50')]===0x0){return db['UserProfileResource'][_0x935a('0x4a')]({'name':_0x41c5dc['name'],'resourceId':_0x41c5dc['id'],'type':_0x2d48e3['name'],'sectionId':_0x2d48e3['id']},{})['then'](function(){return _0x384de0;});}else{return _0x384de0;}})[_0x935a('0x45')](function(_0x2ce8fe){logger['error'](_0x935a('0x51'),_0x2ce8fe);throw _0x2ce8fe;});}return _0x384de0;})[_0x935a('0x24')](respondWithResult(_0x23e85f,0xc9))[_0x935a('0x45')](handleError(_0x23e85f,null));};exports[_0x935a('0x23')]=function(_0xde20f9,_0x22552a){if(_0xde20f9[_0x935a('0x52')]['id']){delete _0xde20f9[_0x935a('0x52')]['id'];}return db[_0x935a('0x43')][_0x935a('0x49')]({'where':{'id':_0xde20f9[_0x935a('0x47')]['id']}})['then'](handleEntityNotFound(_0x22552a,null))[_0x935a('0x24')](saveUpdates(_0xde20f9[_0x935a('0x52')],null))[_0x935a('0x24')](respondWithResult(_0x22552a,null))[_0x935a('0x45')](handleError(_0x22552a,null));};exports[_0x935a('0x25')]=function(_0x5874b6,_0x5601d1){return db[_0x935a('0x43')]['find']({'where':{'id':_0x5874b6[_0x935a('0x47')]['id']}})[_0x935a('0x24')](handleEntityNotFound(_0x5601d1,null))['then'](removeEntity(_0x5601d1,null))[_0x935a('0x45')](handleError(_0x5601d1,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index f50bea2..0134e3a 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 _0x0ab7=['internal','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','destroy','length','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','Set','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor','concat','User'];(function(_0xbc15d0,_0x392236){var _0x3fd35e=function(_0x481857){while(--_0x481857){_0xbc15d0['push'](_0xbc15d0['shift']());}};_0x3fd35e(++_0x392236);}(_0x0ab7,0xcb));var _0x70ab=function(_0xf13f62,_0x1fa2ec){_0xf13f62=_0xf13f62-0x0;var _0x5905e6=_0x0ab7[_0xf13f62];return _0x5905e6;};'use strict';var _=require(_0x70ab('0x0'));var util=require(_0x70ab('0x1'));var BPromise=require(_0x70ab('0x2'));var attributes=require(_0x70ab('0x3'));var getUserApplications=function(_0x32489d,_0x1dc749,_0x66d1b5){var _0x41ecc0=0x1;var _0xe161e7=[];var _0x5ccb5f={'context':_0x1dc749['context']||_0x70ab('0x4'),'exten':util[_0x70ab('0x5')](_0x70ab('0x6'),_0x32489d[_0x70ab('0x7')],_0x66d1b5),'type':_0x70ab('0x8'),'isApp':![],'ChanSpyId':_0x32489d['id'],'UserId':_0x1dc749['id']};_0xe161e7[_0x70ab('0x9')](_[_0x70ab('0xa')]({'app':_0x70ab('0xb'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x41ecc0++},_0x5ccb5f));if(_0x32489d[_0x70ab('0xc')]){_0xe161e7[_0x70ab('0x9')](_[_0x70ab('0xa')]({'app':_0x70ab('0xd'),'appdata':util[_0x70ab('0x5')](_0x70ab('0xe'),_0x32489d[_0x70ab('0xf')]),'priority':_0x41ecc0++},_0x5ccb5f));}if(_0x32489d[_0x70ab('0x10')]){_0xe161e7[_0x70ab('0x9')](_[_0x70ab('0xa')]({'app':'Authenticate','appdata':_0x32489d[_0x70ab('0x11')],'priority':_0x41ecc0++},_0x5ccb5f));}_0xe161e7[_0x70ab('0x9')](_[_0x70ab('0xa')]({'app':'ChanSpy','appdata':util[_0x70ab('0x5')](_0x70ab('0x12'),_0x1dc749[_0x70ab('0x13')],_0x32489d[_0x70ab('0x14')]?_0x32489d['options'][_0x70ab('0x15')](''):''),'priority':_0x41ecc0++},_0x5ccb5f));if(_0x32489d[_0x70ab('0xc')]){_0xe161e7[_0x70ab('0x9')](_[_0x70ab('0xa')]({'app':_0x70ab('0x16'),'priority':_0x41ecc0++},_0x5ccb5f));}return _0xe161e7;};var getChanSpyApplications=function(_0x31f059,_0x2671d5){var _0x42ae5a=[];for(var _0x15c615=0x0,_0x10e7a7=0x1;_0x15c615<_0x2671d5['length'];_0x15c615++,_0x10e7a7=0x1){_0x42ae5a=_0x42ae5a[_0x70ab('0x17')](getUserApplications(_0x31f059,_0x2671d5[_0x15c615],_0x2671d5[_0x15c615]['internal']));if(_0x2671d5[_0x15c615]['internal']!=_0x2671d5[_0x15c615]['name']){_0x42ae5a=_0x42ae5a[_0x70ab('0x17')](getUserApplications(_0x31f059,_0x2671d5[_0x15c615],_0x2671d5[_0x15c615][_0x70ab('0x13')]));}}return _0x42ae5a;};var getChanSpyPromise=function(_0x277727,_0x2049bb){return new BPromise(function(_0x3167bc,_0x52d5ad){return _0x277727[_0x70ab('0x18')]['findAll']({'attributes':['id',_0x70ab('0x13'),_0x70ab('0x19')],'where':{'role':_0x70ab('0x1a'),'chanspy':!![]},'raw':!![]})[_0x70ab('0x1b')](function(_0x42bd05){if(_0x42bd05){return _0x3167bc(getChanSpyApplications(_0x2049bb,_0x42bd05));}return _0x3167bc([]);})['catch'](function(_0x5ec19c){_0x52d5ad(_0x5ec19c);});});};module[_0x70ab('0x1c')]=function(_0x366754,_0x39ab53){var _0xc65d6a=_0x366754[_0x70ab('0x1d')];return _0x366754[_0x70ab('0x1e')](_0x70ab('0x1f'),attributes,{'tableName':_0x70ab('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x32b42a,_0xc13247,_0x2f8eea){return getChanSpyPromise(_0xc65d6a,_0x32b42a)[_0x70ab('0x1b')](function(_0x21f0d8){if(_0x21f0d8&&_0x21f0d8['length']){return _0xc65d6a['VoiceExtension'][_0x70ab('0x21')](_0x21f0d8);}})[_0x70ab('0x1b')](function(){_0x2f8eea();})[_0x70ab('0x22')](function(_0x342a95){_0x2f8eea(_0x342a95);});},'afterUpdate':function(_0x279604,_0x3ab502,_0x2f6b32){return _0xc65d6a['VoiceExtension'][_0x70ab('0x23')]({'where':{'ChanSpyId':_0x279604['id']}})[_0x70ab('0x1b')](function(){return getChanSpyPromise(_0xc65d6a,_0x279604);})[_0x70ab('0x1b')](function(_0x3b1a78){if(_0x3b1a78&&_0x3b1a78[_0x70ab('0x24')]){return _0xc65d6a['VoiceExtension'][_0x70ab('0x21')](_0x3b1a78);}})[_0x70ab('0x1b')](function(){_0x2f6b32();})[_0x70ab('0x22')](function(_0x222082){_0x2f6b32(_0x222082);});},'afterDestroy':function(_0x496d95,_0x575cd9,_0x1bb66b){return _0xc65d6a[_0x70ab('0x25')][_0x70ab('0x23')]({'where':{'ChanSpyId':_0x496d95['id']}})[_0x70ab('0x1b')](function(){_0x1bb66b();})[_0x70ab('0x22')](function(_0x54e2f1){_0x1bb66b(_0x54e2f1);});}}});}; \ No newline at end of file +var _0xd643=['User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd643,0xc5));var _0x3d64=function(_0x5759c0,_0x1f0dcc){_0x5759c0=_0x5759c0-0x0;var _0x5b5059=_0xd643[_0x5759c0];return _0x5b5059;};'use strict';var _=require(_0x3d64('0x0'));var util=require(_0x3d64('0x1'));var BPromise=require(_0x3d64('0x2'));var attributes=require(_0x3d64('0x3'));var getUserApplications=function(_0x6c77f6,_0x362947,_0x453f78){var _0xb2d45d=0x1;var _0x5ac7ae=[];var _0x1ea145={'context':_0x362947[_0x3d64('0x4')]||'from-sip','exten':util['format'](_0x3d64('0x5'),_0x6c77f6[_0x3d64('0x6')],_0x453f78),'type':'system','isApp':![],'ChanSpyId':_0x6c77f6['id'],'UserId':_0x362947['id']};_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':_0x3d64('0x9'),'appdata':util[_0x3d64('0xa')](_0x3d64('0xb'),_0x3d64('0xc')),'priority':_0xb2d45d++},_0x1ea145));if(_0x6c77f6['record']){_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':_0x3d64('0xd'),'appdata':util[_0x3d64('0xa')](_0x3d64('0xe'),_0x6c77f6['recordingFormat']),'priority':_0xb2d45d++},_0x1ea145));}if(_0x6c77f6['auth']){_0x5ac7ae['push'](_[_0x3d64('0x8')]({'app':_0x3d64('0xf'),'appdata':_0x6c77f6[_0x3d64('0x10')],'priority':_0xb2d45d++},_0x1ea145));}_0x5ac7ae['push'](_[_0x3d64('0x8')]({'app':_0x3d64('0x11'),'appdata':util[_0x3d64('0xa')](_0x3d64('0x12'),_0x362947[_0x3d64('0x13')],_0x6c77f6[_0x3d64('0x14')]?_0x6c77f6[_0x3d64('0x14')][_0x3d64('0x15')](''):''),'priority':_0xb2d45d++},_0x1ea145));if(_0x6c77f6['record']){_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':'StopMixMonitor','priority':_0xb2d45d++},_0x1ea145));}return _0x5ac7ae;};var getChanSpyApplications=function(_0x1ff18d,_0x56af87){var _0x1786b1=[];for(var _0x3c759f=0x0,_0x538e64=0x1;_0x3c759f<_0x56af87[_0x3d64('0x16')];_0x3c759f++,_0x538e64=0x1){_0x1786b1=_0x1786b1[_0x3d64('0x17')](getUserApplications(_0x1ff18d,_0x56af87[_0x3c759f],_0x56af87[_0x3c759f][_0x3d64('0x18')]));if(_0x56af87[_0x3c759f][_0x3d64('0x18')]!=_0x56af87[_0x3c759f][_0x3d64('0x13')]){_0x1786b1=_0x1786b1[_0x3d64('0x17')](getUserApplications(_0x1ff18d,_0x56af87[_0x3c759f],_0x56af87[_0x3c759f][_0x3d64('0x13')]));}}return _0x1786b1;};var getChanSpyPromise=function(_0x15d3fb,_0x4cc3fd){return new BPromise(function(_0x6ec185,_0xedaea5){return _0x15d3fb[_0x3d64('0x19')][_0x3d64('0x1a')]({'attributes':['id',_0x3d64('0x13'),_0x3d64('0x18')],'where':{'role':_0x3d64('0x1b'),'chanspy':!![]},'raw':!![]})[_0x3d64('0x1c')](function(_0x5af598){if(_0x5af598){return _0x6ec185(getChanSpyApplications(_0x4cc3fd,_0x5af598));}return _0x6ec185([]);})[_0x3d64('0x1d')](function(_0x3cd984){_0xedaea5(_0x3cd984);});});};module[_0x3d64('0x1e')]=function(_0x19a734,_0x330219){var _0x315914=_0x19a734[_0x3d64('0x1f')];return _0x19a734['define'](_0x3d64('0x20'),attributes,{'tableName':_0x3d64('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa91cd6,_0x95cc75,_0x5cecbe){return getChanSpyPromise(_0x315914,_0xa91cd6)[_0x3d64('0x1c')](function(_0x1cb181){if(_0x1cb181&&_0x1cb181[_0x3d64('0x16')]){return _0x315914[_0x3d64('0x22')][_0x3d64('0x23')](_0x1cb181);}})['then'](function(){_0x5cecbe();})[_0x3d64('0x1d')](function(_0x528dbc){_0x5cecbe(_0x528dbc);});},'afterUpdate':function(_0x4f5f15,_0x4cf04e,_0xf194b7){return _0x315914[_0x3d64('0x22')]['destroy']({'where':{'ChanSpyId':_0x4f5f15['id']}})[_0x3d64('0x1c')](function(){return getChanSpyPromise(_0x315914,_0x4f5f15);})[_0x3d64('0x1c')](function(_0x35861d){if(_0x35861d&&_0x35861d['length']){return _0x315914[_0x3d64('0x22')]['bulkCreate'](_0x35861d);}})[_0x3d64('0x1c')](function(){_0xf194b7();})['catch'](function(_0x3ce031){_0xf194b7(_0x3ce031);});},'afterDestroy':function(_0x1975af,_0x429d18,_0x47edd6){return _0x315914[_0x3d64('0x22')][_0x3d64('0x24')]({'where':{'ChanSpyId':_0x1975af['id']}})[_0x3d64('0x1c')](function(){_0x47edd6();})['catch'](function(_0x1b7c9c){_0x47edd6(_0x1b7c9c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c32e7f1..1344359 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 _0xf109=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x219596,_0x5118b3){var _0x6df62c=function(_0xb9d9b3){while(--_0xb9d9b3){_0x219596['push'](_0x219596['shift']());}};_0x6df62c(++_0x5118b3);}(_0xf109,0xce));var _0x9f10=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xf109[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});} \ No newline at end of file +var _0x1306=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe8125,_0x56a3ad){var _0x468559=function(_0x46a6ac){while(--_0x46a6ac){_0xe8125['push'](_0xe8125['shift']());}};_0x468559(++_0x56a3ad);}(_0x1306,0x17a));var _0x6130=function(_0x388020,_0x417f93){_0x388020=_0x388020-0x0;var _0x4ccfac=_0x1306[_0x388020];return _0x4ccfac;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 93c6e4e..f03cac0 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 _0x015b=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x015b,0x17b));var _0xb015=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x015b[_0x216008];return _0x4d384f;};'use strict';var multer=require('multer');var util=require(_0xb015('0x0'));var path=require(_0xb015('0x1'));var timeout=require(_0xb015('0x2'));var express=require(_0xb015('0x3'));var router=express[_0xb015('0x4')]();var fs_extra=require(_0xb015('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb015('0x6'));var config=require(_0xb015('0x7'));var controller=require(_0xb015('0x8'));router[_0xb015('0x9')]('/',auth[_0xb015('0xa')](),controller[_0xb015('0xb')]);router['get'](_0xb015('0xc'),auth[_0xb015('0xa')](),controller['show']);router[_0xb015('0xd')]('/',auth['isAuthenticated'](),controller[_0xb015('0xe')]);router[_0xb015('0xf')](_0xb015('0xc'),auth[_0xb015('0xa')](),controller[_0xb015('0x10')]);router[_0xb015('0x11')]('/:id',auth[_0xb015('0xa')](),controller[_0xb015('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4c1e=['get','isAuthenticated','index','show','put','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x39ab31,_0x147110){var _0x5d13c7=function(_0x5dff37){while(--_0x5dff37){_0x39ab31['push'](_0x39ab31['shift']());}};_0x5d13c7(++_0x147110);}(_0x4c1e,0x177));var _0xe4c1=function(_0x10fb8c,_0x3b6f74){_0x10fb8c=_0x10fb8c-0x0;var _0x1ecd6e=_0x4c1e[_0x10fb8c];return _0x1ecd6e;};'use strict';var multer=require('multer');var util=require(_0xe4c1('0x0'));var path=require('path');var timeout=require(_0xe4c1('0x1'));var express=require(_0xe4c1('0x2'));var router=express[_0xe4c1('0x3')]();var fs_extra=require(_0xe4c1('0x4'));var auth=require(_0xe4c1('0x5'));var interaction=require(_0xe4c1('0x6'));var config=require(_0xe4c1('0x7'));var controller=require(_0xe4c1('0x8'));router[_0xe4c1('0x9')]('/',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xb')]);router[_0xe4c1('0x9')]('/:id',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xc')]);router['post']('/',auth[_0xe4c1('0xa')](),controller['create']);router[_0xe4c1('0xd')]('/:id',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe4c1('0xf')]);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 3314f06..d41d8d7 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 _0x313b=['STRING','sequelize','exports'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x313b,0x151));var _0xb313=function(_0x1342aa,_0x3ed204){_0x1342aa=_0x1342aa-0x0;var _0x242a80=_0x313b[_0x1342aa];return _0x242a80;};'use strict';var Sequelize=require(_0xb313('0x0'));module[_0xb313('0x1')]={'name':{'type':Sequelize[_0xb313('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb965=['BOOLEAN','sequelize','exports','STRING'];(function(_0xfd6c7e,_0x441bbd){var _0x2082a2=function(_0x2cb753){while(--_0x2cb753){_0xfd6c7e['push'](_0xfd6c7e['shift']());}};_0x2082a2(++_0x441bbd);}(_0xb965,0x9d));var _0x5b96=function(_0x24bcd8,_0x54f8d6){_0x24bcd8=_0x24bcd8-0x0;var _0x2cabab=_0xb965[_0x24bcd8];return _0x2cabab;};'use strict';var Sequelize=require(_0x5b96('0x0'));module[_0x5b96('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x5b96('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5b96('0x3')],'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 cfa1a74..59445a2 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 _0x179c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','request','then','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','keys','length','find','catch','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','autoAssociation'];(function(_0x76dcc5,_0x276beb){var _0x587642=function(_0x4a80d2){while(--_0x4a80d2){_0x76dcc5['push'](_0x76dcc5['shift']());}};_0x587642(++_0x276beb);}(_0x179c,0x144));var _0xc179=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x179c[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xc179('0x0'));var rimraf=require(_0xc179('0x1'));var zipdir=require(_0xc179('0x2'));var jsonpatch=require(_0xc179('0x3'));var rp=require(_0xc179('0x4'));var moment=require(_0xc179('0x5'));var BPromise=require(_0xc179('0x6'));var Mustache=require(_0xc179('0x7'));var util=require(_0xc179('0x8'));var path=require(_0xc179('0x9'));var sox=require(_0xc179('0xa'));var csv=require(_0xc179('0xb'));var ejs=require(_0xc179('0xc'));var fs=require('fs');var fs_extra=require(_0xc179('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc179('0xe'));var jsforce=require(_0xc179('0xf'));var deskjs=require(_0xc179('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc179('0x11'));var Redis=require(_0xc179('0x12'));var authService=require(_0xc179('0x13'));var qs=require(_0xc179('0x14'));var as=require(_0xc179('0x15'));var hardwareService=require(_0xc179('0x16'));var logger=require('../../config/logger')(_0xc179('0x17'));var utils=require(_0xc179('0x18'));var config=require(_0xc179('0x19'));var licenseUtil=require(_0xc179('0x1a'));var db=require(_0xc179('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c071f,_0x577d6e,_0x1c4fe9,_0x4d8985){return new BPromise(function(_0x504d0c,_0xe46cae){var _0x442ce6=_0x4d8985||client;return _0x442ce6[_0xc179('0x1c')](_0x1c071f,_0x1c4fe9)[_0xc179('0x1d')](function(_0x2368e0){logger[_0xc179('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x577d6e,_0xc179('0x1f'));logger[_0xc179('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x577d6e,_0xc179('0x1f'),JSON[_0xc179('0x21')](_0x2368e0));if(_0x2368e0[_0xc179('0x22')]){if(_0x2368e0[_0xc179('0x22')][_0xc179('0x23')]===0x1f4){logger['error'](_0xc179('0x24'),_0x577d6e,_0x2368e0[_0xc179('0x22')][_0xc179('0x25')]);return _0xe46cae(_0x2368e0[_0xc179('0x22')]['message']);}logger[_0xc179('0x22')]('VoiceContext,\x20%s,\x20%s',_0x577d6e,_0x2368e0[_0xc179('0x22')][_0xc179('0x25')]);return _0x504d0c(_0x2368e0[_0xc179('0x22')][_0xc179('0x25')]);}else{logger['info'](_0xc179('0x24'),_0x577d6e,'request\x20sent');_0x504d0c(_0x2368e0[_0xc179('0x26')]['message']);}})['catch'](function(_0x33e333){logger[_0xc179('0x22')](_0xc179('0x24'),_0x577d6e,_0x33e333);_0xe46cae(_0x33e333);});});}function respondWithStatusCode(_0x179798,_0x463eea){_0x463eea=_0x463eea||0xcc;return function(_0x478608){if(_0x478608){return _0x179798[_0xc179('0x27')](_0x463eea);}return _0x179798[_0xc179('0x28')](_0x463eea)[_0xc179('0x29')]();};}function respondWithResult(_0x2f62dc,_0x4aaa31){_0x4aaa31=_0x4aaa31||0xc8;return function(_0xe6157b){if(_0xe6157b){return _0x2f62dc[_0xc179('0x28')](_0x4aaa31)[_0xc179('0x2a')](_0xe6157b);}};}function respondWithFilteredResult(_0x236215,_0x2dbe28){return function(_0x17221e){if(_0x17221e){var _0xa665ca=typeof _0x2dbe28[_0xc179('0x2b')]===_0xc179('0x2c')&&typeof _0x2dbe28[_0xc179('0x2d')]===_0xc179('0x2c');var _0x361387=_0x17221e[_0xc179('0x2e')];var _0x83766f=_0xa665ca?0x0:_0x2dbe28['offset'];var _0x4f8113=_0xa665ca?_0x17221e[_0xc179('0x2e')]:_0x2dbe28['offset']+_0x2dbe28[_0xc179('0x2d')];var _0x3938cf;if(_0x4f8113>=_0x361387){_0x4f8113=_0x361387;_0x3938cf=0xc8;}else{_0x3938cf=0xce;}_0x236215[_0xc179('0x28')](_0x3938cf);return _0x236215['set'](_0xc179('0x2f'),_0x83766f+'-'+_0x4f8113+'/'+_0x361387)[_0xc179('0x2a')](_0x17221e);}return null;};}function patchUpdates(_0x17d692){return function(_0x5ca85d){try{jsonpatch[_0xc179('0x30')](_0x5ca85d,_0x17d692,!![]);}catch(_0x226c7e){return BPromise[_0xc179('0x31')](_0x226c7e);}return _0x5ca85d[_0xc179('0x32')]();};}function saveUpdates(_0x1bdff6,_0xfdd60f){return function(_0x39a853){if(_0x39a853){return _0x39a853['update'](_0x1bdff6)[_0xc179('0x1d')](function(_0x747163){return _0x747163;});}return null;};}function removeEntity(_0x361d6e,_0x1f0160){return function(_0x1a0414){if(_0x1a0414){return _0x1a0414['destroy']()[_0xc179('0x1d')](function(){var _0x27ede4=_0x1a0414['get']({'plain':!![]});var _0x103993='Contexts';return db[_0xc179('0x33')][_0xc179('0x34')]({'where':{'type':_0x103993,'resourceId':_0x27ede4['id']}})['then'](function(){return _0x1a0414;});})['then'](function(){_0x361d6e[_0xc179('0x28')](0xcc)[_0xc179('0x29')]();});}};}function handleEntityNotFound(_0x402dc7,_0x1bba81){return function(_0x2f5f81){if(!_0x2f5f81){_0x402dc7[_0xc179('0x27')](0x194);}return _0x2f5f81;};}function handleError(_0x400390,_0x48a34f){_0x48a34f=_0x48a34f||0x1f4;return function(_0x1d3593){logger[_0xc179('0x22')](_0x1d3593[_0xc179('0x35')]);if(_0x1d3593[_0xc179('0x36')]){delete _0x1d3593[_0xc179('0x36')];}_0x400390['status'](_0x48a34f)[_0xc179('0x37')](_0x1d3593);};}exports[_0xc179('0x38')]=function(_0x5bdcc0,_0x2b9348){var _0x34869e={},_0x4d7ff2={},_0x46d99c={'count':0x0,'rows':[]};var _0x20271f=_[_0xc179('0x39')](db[_0xc179('0x3a')][_0xc179('0x3b')],function(_0x2115db){return{'name':_0x2115db[_0xc179('0x3c')],'type':_0x2115db[_0xc179('0x3d')]['key']};});_0x4d7ff2[_0xc179('0x3e')]=_[_0xc179('0x39')](_0x20271f,'name');_0x4d7ff2['query']=_['keys'](_0x5bdcc0[_0xc179('0x3f')]);_0x4d7ff2['filters']=_[_0xc179('0x40')](_0x4d7ff2[_0xc179('0x3e')],_0x4d7ff2[_0xc179('0x3f')]);_0x34869e[_0xc179('0x41')]=_[_0xc179('0x40')](_0x4d7ff2[_0xc179('0x3e')],qs[_0xc179('0x42')](_0x5bdcc0[_0xc179('0x3f')][_0xc179('0x42')]));_0x34869e[_0xc179('0x41')]=_0x34869e[_0xc179('0x41')]['length']?_0x34869e[_0xc179('0x41')]:_0x4d7ff2[_0xc179('0x3e')];if(!_0x5bdcc0['query']['hasOwnProperty'](_0xc179('0x43'))){_0x34869e[_0xc179('0x2d')]=qs['limit'](_0x5bdcc0[_0xc179('0x3f')]['limit']);_0x34869e[_0xc179('0x2b')]=qs[_0xc179('0x2b')](_0x5bdcc0['query'][_0xc179('0x2b')]);}_0x34869e[_0xc179('0x44')]=qs[_0xc179('0x45')](_0x5bdcc0[_0xc179('0x3f')][_0xc179('0x45')]);_0x34869e[_0xc179('0x46')]=qs[_0xc179('0x47')](_[_0xc179('0x48')](_0x5bdcc0['query'],_0x4d7ff2[_0xc179('0x47')]),_0x20271f);if(_0x5bdcc0['query'][_0xc179('0x49')]){_0x34869e[_0xc179('0x46')]=_['merge'](_0x34869e[_0xc179('0x46')],{'$or':_['map'](_0x20271f,function(_0x1b665f){if(_0x1b665f[_0xc179('0x3d')]!==_0xc179('0x4a')){var _0x113b26={};_0x113b26[_0x1b665f[_0xc179('0x36')]]={'$like':'%'+_0x5bdcc0[_0xc179('0x3f')][_0xc179('0x49')]+'%'};return _0x113b26;}})});}_0x34869e=_[_0xc179('0x4b')]({},_0x34869e,_0x5bdcc0[_0xc179('0x4c')]);var _0x1e79d4={'where':_0x34869e[_0xc179('0x46')]};return db['VoiceContext']['count'](_0x1e79d4)[_0xc179('0x1d')](function(_0x302d86){_0x46d99c['count']=_0x302d86;if(_0x5bdcc0[_0xc179('0x3f')][_0xc179('0x4d')]){_0x34869e['include']=[{'all':!![]}];}return db['VoiceContext'][_0xc179('0x4e')](_0x34869e);})[_0xc179('0x1d')](function(_0x31df59){_0x46d99c[_0xc179('0x4f')]=_0x31df59;return _0x46d99c;})[_0xc179('0x1d')](respondWithFilteredResult(_0x2b9348,_0x34869e))['catch'](handleError(_0x2b9348,null));};exports[_0xc179('0x50')]=function(_0x5681f5,_0x5ebb7e){var _0x331cbf={'raw':![],'where':{'id':_0x5681f5['params']['id']}},_0x46ad6c={};_0x46ad6c[_0xc179('0x3e')]=_[_0xc179('0x51')](db['VoiceContext'][_0xc179('0x3b')]);_0x46ad6c[_0xc179('0x3f')]=_[_0xc179('0x51')](_0x5681f5[_0xc179('0x3f')]);_0x46ad6c[_0xc179('0x47')]=_[_0xc179('0x40')](_0x46ad6c['model'],_0x46ad6c[_0xc179('0x3f')]);_0x331cbf[_0xc179('0x41')]=_[_0xc179('0x40')](_0x46ad6c['model'],qs[_0xc179('0x42')](_0x5681f5[_0xc179('0x3f')][_0xc179('0x42')]));_0x331cbf['attributes']=_0x331cbf['attributes'][_0xc179('0x52')]?_0x331cbf[_0xc179('0x41')]:_0x46ad6c[_0xc179('0x3e')];if(_0x5681f5[_0xc179('0x3f')]['includeAll']){_0x331cbf['include']=[{'all':!![]}];}_0x331cbf=_[_0xc179('0x4b')]({},_0x331cbf,_0x5681f5[_0xc179('0x4c')]);return db['VoiceContext'][_0xc179('0x53')](_0x331cbf)['then'](handleEntityNotFound(_0x5ebb7e,null))[_0xc179('0x1d')](respondWithResult(_0x5ebb7e,null))[_0xc179('0x54')](handleError(_0x5ebb7e,null));};exports['create']=function(_0x51751b,_0x14e699,_0x40d176){var _0x346587;return db[_0xc179('0x3a')][_0xc179('0x55')](_0x51751b[_0xc179('0x56')],{'raw':!![]})[_0xc179('0x1d')](function(_0x57e4c1){_0x346587=_0x57e4c1;return db['VoiceContext'][_0xc179('0x4e')]({'raw':!![]});})[_0xc179('0x1d')](function(_0x123ddb){var _0x5d191e=fs[_0xc179('0x57')](path[_0xc179('0x58')](config[_0xc179('0x59')],_0xc179('0x5a')),_0xc179('0x5b'));var _0x2f3c62=ejs[_0xc179('0x5c')](_0x5d191e,{'contexts':_0x123ddb||[]});fs[_0xc179('0x5d')](_0xc179('0x5e'),_0x2f3c62);})[_0xc179('0x1d')](function(){return respondWithRpcPromise(_0xc179('0x5f'),_0xc179('0x55'),{'module':_0xc179('0x60')});})[_0xc179('0x1d')](function(){var _0x4dc469=_0x51751b[_0xc179('0x61')][_0xc179('0x62')]({'plain':!![]});if(!_0x4dc469)throw new Error(_0xc179('0x63'));if(_0x4dc469[_0xc179('0x64')]==='user'){var _0x25766e=_0x346587['get']({'plain':!![]});return db[_0xc179('0x65')][_0xc179('0x53')]({'where':{'name':_0xc179('0x66'),'userProfileId':_0x4dc469['userProfileId']},'raw':!![]})[_0xc179('0x1d')](function(_0x1af409){if(_0x1af409&&_0x1af409[_0xc179('0x67')]===0x0){return db[_0xc179('0x33')]['create']({'name':_0x25766e[_0xc179('0x36')],'resourceId':_0x25766e['id'],'type':_0x1af409[_0xc179('0x36')],'sectionId':_0x1af409['id']},{})[_0xc179('0x1d')](function(){return _0x346587;});}else{return _0x346587;}})[_0xc179('0x54')](function(_0x5e492a){logger[_0xc179('0x22')](_0xc179('0x68'),_0x5e492a);throw _0x5e492a;});}return _0x346587;})['then'](respondWithResult(_0x14e699,0xc9))[_0xc179('0x54')](handleError(_0x14e699,null));};exports['update']=function(_0x59d345,_0x919f50,_0x4a6a65){var _0x2cb71;return db[_0xc179('0x3a')][_0xc179('0x53')]({'where':{'id':_0x59d345[_0xc179('0x69')]['id']}})[_0xc179('0x1d')](handleEntityNotFound(_0x919f50,null))[_0xc179('0x1d')](saveUpdates(_0x59d345[_0xc179('0x56')],null))['then'](function(_0x2e41d4){if(_0x2e41d4){_0x2cb71=_0x2e41d4;return db['VoiceContext'][_0xc179('0x4e')]({'raw':!![]});}})[_0xc179('0x1d')](function(_0x54ba2f){var _0x4c8163=fs[_0xc179('0x57')](path[_0xc179('0x58')](config[_0xc179('0x59')],_0xc179('0x5a')),_0xc179('0x5b'));var _0x52e697=ejs['render'](_0x4c8163,{'contexts':_0x54ba2f||[]});fs['writeFileSync'](_0xc179('0x5e'),_0x52e697);})[_0xc179('0x1d')](function(){return respondWithRpcPromise(_0xc179('0x5f'),_0xc179('0x6a'),{'module':'chan_sip.so'});})[_0xc179('0x1d')](function(){return _0x2cb71;})[_0xc179('0x1d')](respondWithResult(_0x919f50,null))['catch'](handleError(_0x919f50,null));};exports[_0xc179('0x34')]=function(_0x162434,_0x3200b4,_0x4aa01a){var _0x544205;return db[_0xc179('0x3a')]['find']({'where':{'id':_0x162434[_0xc179('0x69')]['id']}})['then'](handleEntityNotFound(_0x3200b4,null))[_0xc179('0x1d')](removeEntity(_0x3200b4,null))['then'](function(){return db[_0xc179('0x3a')][_0xc179('0x4e')]({'raw':!![]});})[_0xc179('0x1d')](function(_0x1b8ac8){var _0x362959=fs[_0xc179('0x57')](path['join'](config['root'],_0xc179('0x5a')),_0xc179('0x5b'));var _0x47c178=ejs[_0xc179('0x5c')](_0x362959,{'contexts':_0x1b8ac8});fs['writeFileSync'](_0xc179('0x5e'),_0x47c178);return respondWithRpcPromise(_0xc179('0x5f'),_0xc179('0x34'),{'module':'chan_sip.so'});})[_0xc179('0x54')](handleError(_0x3200b4,null));}; \ No newline at end of file +var _0x7a98=['filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','create','readFileSync','join','root','utf8','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4123c6,_0x29e2f3){var _0x4c28bb=function(_0x218d4f){while(--_0x218d4f){_0x4123c6['push'](_0x4123c6['shift']());}};_0x4c28bb(++_0x29e2f3);}(_0x7a98,0x1bb));var _0x87a9=function(_0x3c73e5,_0x198b7b){_0x3c73e5=_0x3c73e5-0x0;var _0x223370=_0x7a98[_0x3c73e5];return _0x223370;};'use strict';var emlformat=require(_0x87a9('0x0'));var rimraf=require(_0x87a9('0x1'));var zipdir=require(_0x87a9('0x2'));var jsonpatch=require(_0x87a9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87a9('0x4'));var util=require(_0x87a9('0x5'));var path=require(_0x87a9('0x6'));var sox=require(_0x87a9('0x7'));var csv=require(_0x87a9('0x8'));var ejs=require(_0x87a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87a9('0xa'));var squel=require('squel');var crypto=require(_0x87a9('0xb'));var jsforce=require(_0x87a9('0xc'));var deskjs=require(_0x87a9('0xd'));var toCsv=require(_0x87a9('0x8'));var querystring=require(_0x87a9('0xe'));var Papa=require(_0x87a9('0xf'));var Redis=require('ioredis');var authService=require(_0x87a9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87a9('0x11'));var hardwareService=require(_0x87a9('0x12'));var logger=require(_0x87a9('0x13'))(_0x87a9('0x14'));var utils=require('../../config/utils');var config=require(_0x87a9('0x15'));var licenseUtil=require(_0x87a9('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x87a9('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x38534a,_0x4d133e,_0x2145de,_0x297e48){return new BPromise(function(_0x1c7aba,_0x2e91bf){var _0x339867=_0x297e48||client;return _0x339867[_0x87a9('0x18')](_0x38534a,_0x2145de)[_0x87a9('0x19')](function(_0x4a02cc){logger[_0x87a9('0x1a')](_0x87a9('0x1b'),_0x4d133e,'request\x20sent');logger[_0x87a9('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4d133e,_0x87a9('0x1d'),JSON[_0x87a9('0x1e')](_0x4a02cc));if(_0x4a02cc[_0x87a9('0x1f')]){if(_0x4a02cc['error'][_0x87a9('0x20')]===0x1f4){logger[_0x87a9('0x1f')](_0x87a9('0x1b'),_0x4d133e,_0x4a02cc['error']['message']);return _0x2e91bf(_0x4a02cc[_0x87a9('0x1f')][_0x87a9('0x21')]);}logger[_0x87a9('0x1f')](_0x87a9('0x1b'),_0x4d133e,_0x4a02cc['error']['message']);return _0x1c7aba(_0x4a02cc[_0x87a9('0x1f')][_0x87a9('0x21')]);}else{logger[_0x87a9('0x1a')](_0x87a9('0x1b'),_0x4d133e,'request\x20sent');_0x1c7aba(_0x4a02cc[_0x87a9('0x22')]['message']);}})[_0x87a9('0x23')](function(_0xfade35){logger['error'](_0x87a9('0x1b'),_0x4d133e,_0xfade35);_0x2e91bf(_0xfade35);});});}function respondWithStatusCode(_0x566e52,_0x21353c){_0x21353c=_0x21353c||0xcc;return function(_0x263cd8){if(_0x263cd8){return _0x566e52[_0x87a9('0x24')](_0x21353c);}return _0x566e52[_0x87a9('0x25')](_0x21353c)[_0x87a9('0x26')]();};}function respondWithResult(_0x34ee79,_0x4aeaf8){_0x4aeaf8=_0x4aeaf8||0xc8;return function(_0x4a90bd){if(_0x4a90bd){return _0x34ee79[_0x87a9('0x25')](_0x4aeaf8)['json'](_0x4a90bd);}};}function respondWithFilteredResult(_0x250153,_0xb90f39){return function(_0x2aca7f){if(_0x2aca7f){var _0x571c5b=typeof _0xb90f39[_0x87a9('0x27')]===_0x87a9('0x28')&&typeof _0xb90f39[_0x87a9('0x29')]===_0x87a9('0x28');var _0x384f0e=_0x2aca7f[_0x87a9('0x2a')];var _0x3594e0=_0x571c5b?0x0:_0xb90f39['offset'];var _0x1e9d0b=_0x571c5b?_0x2aca7f['count']:_0xb90f39['offset']+_0xb90f39['limit'];var _0xec9784;if(_0x1e9d0b>=_0x384f0e){_0x1e9d0b=_0x384f0e;_0xec9784=0xc8;}else{_0xec9784=0xce;}_0x250153[_0x87a9('0x25')](_0xec9784);return _0x250153['set'](_0x87a9('0x2b'),_0x3594e0+'-'+_0x1e9d0b+'/'+_0x384f0e)[_0x87a9('0x2c')](_0x2aca7f);}return null;};}function patchUpdates(_0x578022){return function(_0x5ef4cd){try{jsonpatch[_0x87a9('0x2d')](_0x5ef4cd,_0x578022,!![]);}catch(_0x2077f3){return BPromise['reject'](_0x2077f3);}return _0x5ef4cd[_0x87a9('0x2e')]();};}function saveUpdates(_0x344a35,_0x4d65bd){return function(_0x5746af){if(_0x5746af){return _0x5746af[_0x87a9('0x2f')](_0x344a35)['then'](function(_0x515b9f){return _0x515b9f;});}return null;};}function removeEntity(_0x49c9c5,_0x41ee8d){return function(_0xf39539){if(_0xf39539){return _0xf39539[_0x87a9('0x30')]()[_0x87a9('0x19')](function(){var _0x5ac255=_0xf39539[_0x87a9('0x31')]({'plain':!![]});var _0x47f0d0=_0x87a9('0x32');return db[_0x87a9('0x33')]['destroy']({'where':{'type':_0x47f0d0,'resourceId':_0x5ac255['id']}})['then'](function(){return _0xf39539;});})[_0x87a9('0x19')](function(){_0x49c9c5[_0x87a9('0x25')](0xcc)[_0x87a9('0x26')]();});}};}function handleEntityNotFound(_0x13af7b,_0x52cf3b){return function(_0x2af3ed){if(!_0x2af3ed){_0x13af7b[_0x87a9('0x24')](0x194);}return _0x2af3ed;};}function handleError(_0x502553,_0x4bdcfc){_0x4bdcfc=_0x4bdcfc||0x1f4;return function(_0x56d3ec){logger[_0x87a9('0x1f')](_0x56d3ec[_0x87a9('0x34')]);if(_0x56d3ec[_0x87a9('0x35')]){delete _0x56d3ec[_0x87a9('0x35')];}_0x502553['status'](_0x4bdcfc)[_0x87a9('0x36')](_0x56d3ec);};}exports[_0x87a9('0x37')]=function(_0x4e91d6,_0x2e9268){var _0x6377cb={},_0x5b74c6={},_0x3f7db3={'count':0x0,'rows':[]};var _0x2ef464=_[_0x87a9('0x38')](db[_0x87a9('0x39')][_0x87a9('0x3a')],function(_0x73664b){return{'name':_0x73664b[_0x87a9('0x3b')],'type':_0x73664b[_0x87a9('0x3c')][_0x87a9('0x3d')]};});_0x5b74c6[_0x87a9('0x3e')]=_[_0x87a9('0x38')](_0x2ef464,'name');_0x5b74c6[_0x87a9('0x3f')]=_['keys'](_0x4e91d6[_0x87a9('0x3f')]);_0x5b74c6['filters']=_[_0x87a9('0x40')](_0x5b74c6[_0x87a9('0x3e')],_0x5b74c6[_0x87a9('0x3f')]);_0x6377cb['attributes']=_[_0x87a9('0x40')](_0x5b74c6[_0x87a9('0x3e')],qs[_0x87a9('0x41')](_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x41')]));_0x6377cb['attributes']=_0x6377cb[_0x87a9('0x42')][_0x87a9('0x43')]?_0x6377cb[_0x87a9('0x42')]:_0x5b74c6['model'];if(!_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x44')](_0x87a9('0x45'))){_0x6377cb[_0x87a9('0x29')]=qs[_0x87a9('0x29')](_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x29')]);_0x6377cb['offset']=qs[_0x87a9('0x27')](_0x4e91d6[_0x87a9('0x3f')]['offset']);}_0x6377cb[_0x87a9('0x46')]=qs[_0x87a9('0x47')](_0x4e91d6['query']['sort']);_0x6377cb['where']=qs[_0x87a9('0x48')](_['pick'](_0x4e91d6['query'],_0x5b74c6[_0x87a9('0x48')]),_0x2ef464);if(_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x49')]){_0x6377cb[_0x87a9('0x4a')]=_[_0x87a9('0x4b')](_0x6377cb[_0x87a9('0x4a')],{'$or':_[_0x87a9('0x38')](_0x2ef464,function(_0x523706){if(_0x523706[_0x87a9('0x3c')]!==_0x87a9('0x4c')){var _0x56593b={};_0x56593b[_0x523706[_0x87a9('0x35')]]={'$like':'%'+_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x49')]+'%'};return _0x56593b;}})});}_0x6377cb=_[_0x87a9('0x4b')]({},_0x6377cb,_0x4e91d6[_0x87a9('0x4d')]);var _0x552429={'where':_0x6377cb[_0x87a9('0x4a')]};return db['VoiceContext'][_0x87a9('0x2a')](_0x552429)['then'](function(_0x5e7bbf){_0x3f7db3[_0x87a9('0x2a')]=_0x5e7bbf;if(_0x4e91d6['query']['includeAll']){_0x6377cb[_0x87a9('0x4e')]=[{'all':!![]}];}return db[_0x87a9('0x39')][_0x87a9('0x4f')](_0x6377cb);})['then'](function(_0x2483f1){_0x3f7db3[_0x87a9('0x50')]=_0x2483f1;return _0x3f7db3;})[_0x87a9('0x19')](respondWithFilteredResult(_0x2e9268,_0x6377cb))[_0x87a9('0x23')](handleError(_0x2e9268,null));};exports['show']=function(_0x91aaea,_0x22ce80){var _0x5510f1={'raw':![],'where':{'id':_0x91aaea[_0x87a9('0x51')]['id']}},_0x171568={};_0x171568[_0x87a9('0x3e')]=_['keys'](db['VoiceContext']['rawAttributes']);_0x171568[_0x87a9('0x3f')]=_['keys'](_0x91aaea['query']);_0x171568[_0x87a9('0x48')]=_[_0x87a9('0x40')](_0x171568['model'],_0x171568[_0x87a9('0x3f')]);_0x5510f1[_0x87a9('0x42')]=_[_0x87a9('0x40')](_0x171568[_0x87a9('0x3e')],qs[_0x87a9('0x41')](_0x91aaea['query'][_0x87a9('0x41')]));_0x5510f1['attributes']=_0x5510f1[_0x87a9('0x42')][_0x87a9('0x43')]?_0x5510f1['attributes']:_0x171568[_0x87a9('0x3e')];if(_0x91aaea[_0x87a9('0x3f')][_0x87a9('0x52')]){_0x5510f1[_0x87a9('0x4e')]=[{'all':!![]}];}_0x5510f1=_[_0x87a9('0x4b')]({},_0x5510f1,_0x91aaea[_0x87a9('0x4d')]);return db[_0x87a9('0x39')][_0x87a9('0x53')](_0x5510f1)[_0x87a9('0x19')](handleEntityNotFound(_0x22ce80,null))[_0x87a9('0x19')](respondWithResult(_0x22ce80,null))[_0x87a9('0x23')](handleError(_0x22ce80,null));};exports[_0x87a9('0x54')]=function(_0x3d2eeb,_0x198941,_0x495746){var _0xb56fb1;return db['VoiceContext'][_0x87a9('0x54')](_0x3d2eeb['body'],{'raw':!![]})[_0x87a9('0x19')](function(_0x176112){_0xb56fb1=_0x176112;return db[_0x87a9('0x39')][_0x87a9('0x4f')]({'raw':!![]});})[_0x87a9('0x19')](function(_0x289f24){var _0x17b43f=fs[_0x87a9('0x55')](path[_0x87a9('0x56')](config[_0x87a9('0x57')],'server/files/templates/context.ejs'),_0x87a9('0x58'));var _0x40c64c=ejs['render'](_0x17b43f,{'contexts':_0x289f24||[]});fs[_0x87a9('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x40c64c);})[_0x87a9('0x19')](function(){return respondWithRpcPromise(_0x87a9('0x5a'),_0x87a9('0x54'),{'module':'chan_sip.so'});})[_0x87a9('0x19')](function(){var _0x41ed56=_0x3d2eeb[_0x87a9('0x5b')][_0x87a9('0x31')]({'plain':!![]});if(!_0x41ed56)throw new Error(_0x87a9('0x5c'));if(_0x41ed56[_0x87a9('0x5d')]===_0x87a9('0x5b')){var _0x3661a0=_0xb56fb1[_0x87a9('0x31')]({'plain':!![]});return db[_0x87a9('0x5e')][_0x87a9('0x53')]({'where':{'name':_0x87a9('0x32'),'userProfileId':_0x41ed56[_0x87a9('0x5f')]},'raw':!![]})['then'](function(_0x3c9a08){if(_0x3c9a08&&_0x3c9a08[_0x87a9('0x60')]===0x0){return db[_0x87a9('0x33')][_0x87a9('0x54')]({'name':_0x3661a0[_0x87a9('0x35')],'resourceId':_0x3661a0['id'],'type':_0x3c9a08[_0x87a9('0x35')],'sectionId':_0x3c9a08['id']},{})[_0x87a9('0x19')](function(){return _0xb56fb1;});}else{return _0xb56fb1;}})[_0x87a9('0x23')](function(_0xfde269){logger['error'](_0x87a9('0x61'),_0xfde269);throw _0xfde269;});}return _0xb56fb1;})[_0x87a9('0x19')](respondWithResult(_0x198941,0xc9))[_0x87a9('0x23')](handleError(_0x198941,null));};exports[_0x87a9('0x2f')]=function(_0x371934,_0x97a1d5,_0x3ccc29){var _0x1218f9;return db[_0x87a9('0x39')]['find']({'where':{'id':_0x371934[_0x87a9('0x51')]['id']}})[_0x87a9('0x19')](handleEntityNotFound(_0x97a1d5,null))[_0x87a9('0x19')](saveUpdates(_0x371934[_0x87a9('0x62')],null))[_0x87a9('0x19')](function(_0x16d114){if(_0x16d114){_0x1218f9=_0x16d114;return db[_0x87a9('0x39')][_0x87a9('0x4f')]({'raw':!![]});}})[_0x87a9('0x19')](function(_0x1a2093){var _0xcb3d83=fs['readFileSync'](path[_0x87a9('0x56')](config[_0x87a9('0x57')],_0x87a9('0x63')),'utf8');var _0x15fda9=ejs[_0x87a9('0x64')](_0xcb3d83,{'contexts':_0x1a2093||[]});fs[_0x87a9('0x59')](_0x87a9('0x65'),_0x15fda9);})[_0x87a9('0x19')](function(){return respondWithRpcPromise(_0x87a9('0x5a'),'update',{'module':_0x87a9('0x66')});})[_0x87a9('0x19')](function(){return _0x1218f9;})[_0x87a9('0x19')](respondWithResult(_0x97a1d5,null))['catch'](handleError(_0x97a1d5,null));};exports[_0x87a9('0x30')]=function(_0x2d405f,_0x1234ef,_0x10d73e){var _0x30d41c;return db[_0x87a9('0x39')][_0x87a9('0x53')]({'where':{'id':_0x2d405f[_0x87a9('0x51')]['id']}})[_0x87a9('0x19')](handleEntityNotFound(_0x1234ef,null))['then'](removeEntity(_0x1234ef,null))[_0x87a9('0x19')](function(){return db[_0x87a9('0x39')]['findAll']({'raw':!![]});})[_0x87a9('0x19')](function(_0x4627be){var _0x1a4e65=fs[_0x87a9('0x55')](path[_0x87a9('0x56')](config[_0x87a9('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x5c2394=ejs['render'](_0x1a4e65,{'contexts':_0x4627be});fs[_0x87a9('0x59')](_0x87a9('0x65'),_0x5c2394);return respondWithRpcPromise(_0x87a9('0x5a'),_0x87a9('0x30'),{'module':'chan_sip.so'});})[_0x87a9('0x23')](handleError(_0x1234ef,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 443d5aa..06ca385 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 _0x094c=['rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','util','../../config/logger','moment','bluebird','path'];(function(_0x36c25f,_0x55dfad){var _0x57bd3b=function(_0x50033c){while(--_0x50033c){_0x36c25f['push'](_0x36c25f['shift']());}};_0x57bd3b(++_0x55dfad);}(_0x094c,0x131));var _0xc094=function(_0x569b7a,_0x377a61){_0x569b7a=_0x569b7a-0x0;var _0x39d00a=_0x094c[_0x569b7a];return _0x39d00a;};'use strict';var _=require('lodash');var util=require(_0xc094('0x0'));var logger=require(_0xc094('0x1'))('api');var moment=require(_0xc094('0x2'));var BPromise=require(_0xc094('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc094('0x4'));var rimraf=require(_0xc094('0x5'));var config=require(_0xc094('0x6'));var attributes=require(_0xc094('0x7'));module[_0xc094('0x8')]=function(_0x3226a1,_0x1366bf){return _0x3226a1['define'](_0xc094('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3301=['path','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','request-promise'];(function(_0x16916b,_0x520c80){var _0x12fd40=function(_0x3eedf6){while(--_0x3eedf6){_0x16916b['push'](_0x16916b['shift']());}};_0x12fd40(++_0x520c80);}(_0x3301,0x69));var _0x1330=function(_0xfaaad,_0x4c46e6){_0xfaaad=_0xfaaad-0x0;var _0x59136e=_0x3301[_0xfaaad];return _0x59136e;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var logger=require(_0x1330('0x2'))('api');var moment=require(_0x1330('0x3'));var BPromise=require('bluebird');var rp=require(_0x1330('0x4'));var fs=require('fs');var path=require(_0x1330('0x5'));var rimraf=require('rimraf');var config=require(_0x1330('0x6'));var attributes=require('./voiceContext.attributes');module[_0x1330('0x7')]=function(_0x18ec8a,_0x299e03){return _0x18ec8a[_0x1330('0x8')](_0x1330('0x9'),attributes,{'tableName':_0x1330('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 150d777..bd51c64 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 _0xfd7b=['request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xfd7b[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xbfd7('0x0'));var util=require(_0xbfd7('0x1'));var moment=require(_0xbfd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfd7('0x3'));var fs=require('fs');var Redis=require(_0xbfd7('0x4'));var db=require(_0xbfd7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfd7('0x6'))(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbfd7('0x9')][_0xbfd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e3d61,_0x4210a0,_0x4f25bf){return new BPromise(function(_0x174ff2,_0x51e9cf){return client[_0xbfd7('0xb')](_0x5e3d61,_0x4f25bf)['then'](function(_0x52cc23){logger[_0xbfd7('0xc')](_0xbfd7('0xd'),_0x4210a0,_0xbfd7('0xe'));logger[_0xbfd7('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4210a0,_0xbfd7('0xe'),JSON[_0xbfd7('0x10')](_0x52cc23));if(_0x52cc23[_0xbfd7('0x11')]){if(_0x52cc23['error'][_0xbfd7('0x12')]===0x1f4){logger[_0xbfd7('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4210a0,_0x52cc23[_0xbfd7('0x11')][_0xbfd7('0x13')]);return _0x51e9cf(_0x52cc23['error'][_0xbfd7('0x13')]);}logger[_0xbfd7('0x11')](_0xbfd7('0xd'),_0x4210a0,_0x52cc23[_0xbfd7('0x11')][_0xbfd7('0x13')]);return _0x174ff2(_0x52cc23[_0xbfd7('0x11')][_0xbfd7('0x13')]);}else{logger[_0xbfd7('0xc')](_0xbfd7('0xd'),_0x4210a0,_0xbfd7('0xe'));_0x174ff2(_0x52cc23[_0xbfd7('0x14')][_0xbfd7('0x13')]);}})[_0xbfd7('0x15')](function(_0x19b889){logger[_0xbfd7('0x11')](_0xbfd7('0xd'),_0x4210a0,_0x19b889);_0x51e9cf(_0x19b889);});});} \ No newline at end of file +var _0x8201=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','catch','lodash'];(function(_0x20d6b8,_0xf4c277){var _0x8f4d1e=function(_0x3571fc){while(--_0x3571fc){_0x20d6b8['push'](_0x20d6b8['shift']());}};_0x8f4d1e(++_0xf4c277);}(_0x8201,0x71));var _0x1820=function(_0x100f96,_0x188546){_0x100f96=_0x100f96-0x0;var _0x509e66=_0x8201[_0x100f96];return _0x509e66;};'use strict';var _=require(_0x1820('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1820('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1820('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1820('0x3'));var logger=require(_0x1820('0x4'))('rpc');var config=require(_0x1820('0x5'));var jayson=require(_0x1820('0x6'));var client=jayson[_0x1820('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4297b3,_0x1ee24d,_0x5d33c6){return new BPromise(function(_0x26cd56,_0x395dea){return client[_0x1820('0x8')](_0x4297b3,_0x5d33c6)[_0x1820('0x9')](function(_0x210e2e){logger[_0x1820('0xa')](_0x1820('0xb'),_0x1ee24d,'request\x20sent');logger['debug'](_0x1820('0xc'),_0x1ee24d,_0x1820('0xd'),JSON[_0x1820('0xe')](_0x210e2e));if(_0x210e2e[_0x1820('0xf')]){if(_0x210e2e[_0x1820('0xf')][_0x1820('0x10')]===0x1f4){logger[_0x1820('0xf')]('VoiceContext,\x20%s,\x20%s',_0x1ee24d,_0x210e2e['error']['message']);return _0x395dea(_0x210e2e[_0x1820('0xf')]['message']);}logger[_0x1820('0xf')](_0x1820('0xb'),_0x1ee24d,_0x210e2e[_0x1820('0xf')]['message']);return _0x26cd56(_0x210e2e[_0x1820('0xf')]['message']);}else{logger[_0x1820('0xa')](_0x1820('0xb'),_0x1ee24d,_0x1820('0xd'));_0x26cd56(_0x210e2e[_0x1820('0x11')]['message']);}})[_0x1820('0x12')](function(_0x343387){logger['error'](_0x1820('0xb'),_0x1ee24d,_0x343387);_0x395dea(_0x343387);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f0ed11c..015c87e 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 _0xf4eb=['./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x5c701b,_0x58adc6){var _0x9cf7e4=function(_0x360c46){while(--_0x360c46){_0x5c701b['push'](_0x5c701b['shift']());}};_0x9cf7e4(++_0x58adc6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5a66ca,_0x3b0158){_0x5a66ca=_0x5a66ca-0x0;var _0x3a351b=_0xf4eb[_0x5a66ca];return _0x3a351b;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file +var _0x9909=['show','post','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9909,0x9e));var _0x9990=function(_0x2a0eb8,_0x48affb){_0x2a0eb8=_0x2a0eb8-0x0;var _0x51f8d9=_0x9909[_0x2a0eb8];return _0x51f8d9;};'use strict';var multer=require('multer');var util=require(_0x9990('0x0'));var path=require(_0x9990('0x1'));var timeout=require('connect-timeout');var express=require(_0x9990('0x2'));var router=express[_0x9990('0x3')]();var fs_extra=require(_0x9990('0x4'));var auth=require(_0x9990('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9990('0x6'));var controller=require(_0x9990('0x7'));router['get']('/',auth[_0x9990('0x8')](),controller[_0x9990('0x9')]);router[_0x9990('0xa')]('/describe',auth[_0x9990('0x8')](),controller[_0x9990('0xb')]);router[_0x9990('0xa')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller[_0x9990('0xd')]);router[_0x9990('0xe')]('/',auth[_0x9990('0x8')](),controller[_0x9990('0xf')]);router[_0x9990('0x10')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller['update']);router[_0x9990('0x11')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller[_0x9990('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index e38b6d7..e97415d 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 _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x143a9c,_0x1e391e){var _0x23c8e0=function(_0x47603f){while(--_0x47603f){_0x143a9c['push'](_0x143a9c['shift']());}};_0x23c8e0(++_0x1e391e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x14697e,_0x441fda){_0x14697e=_0x14697e-0x0;var _0x5894e7=_0x9bde[_0x14697e];return _0x5894e7;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x33005d,_0x12837b){var _0x76e4d1=function(_0x38f182){while(--_0x38f182){_0x33005d['push'](_0x33005d['shift']());}};_0x76e4d1(++_0x12837b);}(_0x008c,0x188));var _0xc008=function(_0x5da9e3,_0x3d80cd){_0x5da9e3=_0x5da9e3-0x0;var _0x5a68cd=_0x008c[_0x5da9e3];return _0x5a68cd;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 6be225d..98f90b3 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 _0xb3f0=['filter','merge','options','includeAll','include','VoiceDialReport','findAll','rows','catch','params','filters','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','end','error','stack','name','send','map','rawAttributes','fieldName','keys','query','intersection','model','fields','attributes','length','nolimit','sort','where','pick'];(function(_0x795acb,_0x448e0b){var _0x14ad55=function(_0x4d7c50){while(--_0x4d7c50){_0x795acb['push'](_0x795acb['shift']());}};_0x14ad55(++_0x448e0b);}(_0xb3f0,0x168));var _0x0b3f=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xb3f0[_0x37b7b6];return _0x10c4c3;};'use strict';var emlformat=require(_0x0b3f('0x0'));var rimraf=require(_0x0b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b3f('0x2'));var rp=require(_0x0b3f('0x3'));var moment=require(_0x0b3f('0x4'));var BPromise=require(_0x0b3f('0x5'));var Mustache=require(_0x0b3f('0x6'));var util=require(_0x0b3f('0x7'));var path=require(_0x0b3f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x0b3f('0xa'));var _=require(_0x0b3f('0xb'));var squel=require(_0x0b3f('0xc'));var crypto=require(_0x0b3f('0xd'));var jsforce=require(_0x0b3f('0xe'));var deskjs=require(_0x0b3f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b3f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b3f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b3f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0b3f('0x13'));var config=require(_0x0b3f('0x14'));var licenseUtil=require(_0x0b3f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54284e,_0x24902d){_0x24902d=_0x24902d||0xcc;return function(_0x14dd2c){if(_0x14dd2c){return _0x54284e[_0x0b3f('0x16')](_0x24902d);}return _0x54284e[_0x0b3f('0x17')](_0x24902d)['end']();};}function respondWithResult(_0x54f18b,_0x1c1c95){_0x1c1c95=_0x1c1c95||0xc8;return function(_0x406896){if(_0x406896){return _0x54f18b[_0x0b3f('0x17')](_0x1c1c95)['json'](_0x406896);}};}function respondWithFilteredResult(_0x201149,_0x2913f2){return function(_0xffd7c5){if(_0xffd7c5){var _0x12e709=typeof _0x2913f2[_0x0b3f('0x18')]===_0x0b3f('0x19')&&typeof _0x2913f2[_0x0b3f('0x1a')]===_0x0b3f('0x19');var _0x59f55a=_0xffd7c5[_0x0b3f('0x1b')];var _0x5962c0=_0x12e709?0x0:_0x2913f2[_0x0b3f('0x18')];var _0x5b50c3=_0x12e709?_0xffd7c5[_0x0b3f('0x1b')]:_0x2913f2[_0x0b3f('0x18')]+_0x2913f2[_0x0b3f('0x1a')];var _0x541c4c;if(_0x5b50c3>=_0x59f55a){_0x5b50c3=_0x59f55a;_0x541c4c=0xc8;}else{_0x541c4c=0xce;}_0x201149[_0x0b3f('0x17')](_0x541c4c);return _0x201149[_0x0b3f('0x1c')]('Content-Range',_0x5962c0+'-'+_0x5b50c3+'/'+_0x59f55a)[_0x0b3f('0x1d')](_0xffd7c5);}return null;};}function patchUpdates(_0x4400ca){return function(_0xa120dd){try{jsonpatch[_0x0b3f('0x1e')](_0xa120dd,_0x4400ca,!![]);}catch(_0x309b99){return BPromise['reject'](_0x309b99);}return _0xa120dd[_0x0b3f('0x1f')]();};}function saveUpdates(_0x16858c,_0x3353c0){return function(_0x5f338a){if(_0x5f338a){return _0x5f338a[_0x0b3f('0x20')](_0x16858c)['then'](function(_0x24cb4b){return _0x24cb4b;});}return null;};}function removeEntity(_0x34d19b,_0xa72b9d){return function(_0x106e4e){if(_0x106e4e){return _0x106e4e[_0x0b3f('0x21')]()[_0x0b3f('0x22')](function(){_0x34d19b[_0x0b3f('0x17')](0xcc)[_0x0b3f('0x23')]();});}};}function handleEntityNotFound(_0x1c19a3,_0x1517f1){return function(_0x3c0155){if(!_0x3c0155){_0x1c19a3[_0x0b3f('0x16')](0x194);}return _0x3c0155;};}function handleError(_0x371ba3,_0x3d517a){_0x3d517a=_0x3d517a||0x1f4;return function(_0xca453f){logger[_0x0b3f('0x24')](_0xca453f[_0x0b3f('0x25')]);if(_0xca453f[_0x0b3f('0x26')]){delete _0xca453f[_0x0b3f('0x26')];}_0x371ba3['status'](_0x3d517a)[_0x0b3f('0x27')](_0xca453f);};}exports['index']=function(_0x3a4345,_0x307774){var _0x3dc2db={},_0xddf272={},_0xd623e6={'count':0x0,'rows':[]};var _0x944d39=_[_0x0b3f('0x28')](db['VoiceDialReport'][_0x0b3f('0x29')],function(_0x59ffd2){return{'name':_0x59ffd2[_0x0b3f('0x2a')],'type':_0x59ffd2['type']['key']};});_0xddf272['model']=_[_0x0b3f('0x28')](_0x944d39,_0x0b3f('0x26'));_0xddf272['query']=_[_0x0b3f('0x2b')](_0x3a4345[_0x0b3f('0x2c')]);_0xddf272['filters']=_[_0x0b3f('0x2d')](_0xddf272[_0x0b3f('0x2e')],_0xddf272[_0x0b3f('0x2c')]);_0x3dc2db['attributes']=_[_0x0b3f('0x2d')](_0xddf272[_0x0b3f('0x2e')],qs[_0x0b3f('0x2f')](_0x3a4345[_0x0b3f('0x2c')][_0x0b3f('0x2f')]));_0x3dc2db[_0x0b3f('0x30')]=_0x3dc2db[_0x0b3f('0x30')][_0x0b3f('0x31')]?_0x3dc2db[_0x0b3f('0x30')]:_0xddf272[_0x0b3f('0x2e')];if(!_0x3a4345[_0x0b3f('0x2c')]['hasOwnProperty'](_0x0b3f('0x32'))){_0x3dc2db[_0x0b3f('0x1a')]=qs[_0x0b3f('0x1a')](_0x3a4345[_0x0b3f('0x2c')][_0x0b3f('0x1a')]);_0x3dc2db[_0x0b3f('0x18')]=qs[_0x0b3f('0x18')](_0x3a4345[_0x0b3f('0x2c')][_0x0b3f('0x18')]);}_0x3dc2db['order']=qs[_0x0b3f('0x33')](_0x3a4345[_0x0b3f('0x2c')][_0x0b3f('0x33')]);_0x3dc2db[_0x0b3f('0x34')]=qs['filters'](_[_0x0b3f('0x35')](_0x3a4345[_0x0b3f('0x2c')],_0xddf272['filters']),_0x944d39);if(_0x3a4345['query'][_0x0b3f('0x36')]){_0x3dc2db[_0x0b3f('0x34')]=_['merge'](_0x3dc2db[_0x0b3f('0x34')],{'$or':_['map'](_0x944d39,function(_0x439e56){if(_0x439e56['type']!=='VIRTUAL'){var _0x51fc71={};_0x51fc71[_0x439e56[_0x0b3f('0x26')]]={'$like':'%'+_0x3a4345['query'][_0x0b3f('0x36')]+'%'};return _0x51fc71;}})});}_0x3dc2db=_[_0x0b3f('0x37')]({},_0x3dc2db,_0x3a4345[_0x0b3f('0x38')]);var _0x1b2886={'where':_0x3dc2db[_0x0b3f('0x34')]};return db['VoiceDialReport']['count'](_0x1b2886)[_0x0b3f('0x22')](function(_0x2b9e07){_0xd623e6[_0x0b3f('0x1b')]=_0x2b9e07;if(_0x3a4345[_0x0b3f('0x2c')][_0x0b3f('0x39')]){_0x3dc2db[_0x0b3f('0x3a')]=[{'all':!![]}];}return db[_0x0b3f('0x3b')][_0x0b3f('0x3c')](_0x3dc2db);})[_0x0b3f('0x22')](function(_0x5b6968){_0xd623e6[_0x0b3f('0x3d')]=_0x5b6968;return _0xd623e6;})[_0x0b3f('0x22')](respondWithFilteredResult(_0x307774,_0x3dc2db))[_0x0b3f('0x3e')](handleError(_0x307774,null));};exports['show']=function(_0x1353c4,_0x5cdf35){var _0x4ce5f7={'raw':!![],'where':{'id':_0x1353c4[_0x0b3f('0x3f')]['id']}},_0x21f768={};_0x21f768[_0x0b3f('0x2e')]=_[_0x0b3f('0x2b')](db[_0x0b3f('0x3b')][_0x0b3f('0x29')]);_0x21f768[_0x0b3f('0x2c')]=_[_0x0b3f('0x2b')](_0x1353c4['query']);_0x21f768[_0x0b3f('0x40')]=_['intersection'](_0x21f768['model'],_0x21f768[_0x0b3f('0x2c')]);_0x4ce5f7['attributes']=_[_0x0b3f('0x2d')](_0x21f768[_0x0b3f('0x2e')],qs[_0x0b3f('0x2f')](_0x1353c4[_0x0b3f('0x2c')]['fields']));_0x4ce5f7[_0x0b3f('0x30')]=_0x4ce5f7['attributes'][_0x0b3f('0x31')]?_0x4ce5f7[_0x0b3f('0x30')]:_0x21f768['model'];if(_0x1353c4['query'][_0x0b3f('0x39')]){_0x4ce5f7[_0x0b3f('0x3a')]=[{'all':!![]}];}_0x4ce5f7=_[_0x0b3f('0x37')]({},_0x4ce5f7,_0x1353c4[_0x0b3f('0x38')]);return db[_0x0b3f('0x3b')][_0x0b3f('0x41')](_0x4ce5f7)[_0x0b3f('0x22')](handleEntityNotFound(_0x5cdf35,null))[_0x0b3f('0x22')](respondWithResult(_0x5cdf35,null))[_0x0b3f('0x3e')](handleError(_0x5cdf35,null));};exports[_0x0b3f('0x42')]=function(_0x2b30e4,_0x6d0bba){return db[_0x0b3f('0x3b')][_0x0b3f('0x42')](_0x2b30e4[_0x0b3f('0x43')],{})[_0x0b3f('0x22')](respondWithResult(_0x6d0bba,0xc9))[_0x0b3f('0x3e')](handleError(_0x6d0bba,null));};exports[_0x0b3f('0x20')]=function(_0x2e700a,_0x430c3d){if(_0x2e700a[_0x0b3f('0x43')]['id']){delete _0x2e700a[_0x0b3f('0x43')]['id'];}return db[_0x0b3f('0x3b')]['find']({'where':{'id':_0x2e700a[_0x0b3f('0x3f')]['id']}})[_0x0b3f('0x22')](handleEntityNotFound(_0x430c3d,null))[_0x0b3f('0x22')](saveUpdates(_0x2e700a[_0x0b3f('0x43')],null))['then'](respondWithResult(_0x430c3d,null))[_0x0b3f('0x3e')](handleError(_0x430c3d,null));};exports[_0x0b3f('0x21')]=function(_0x140726,_0x4d854f){return db['VoiceDialReport'][_0x0b3f('0x41')]({'where':{'id':_0x140726['params']['id']}})[_0x0b3f('0x22')](handleEntityNotFound(_0x4d854f,null))[_0x0b3f('0x22')](removeEntity(_0x4d854f,null))['catch'](handleError(_0x4d854f,null));};exports['describe']=function(_0x528044,_0x17b28c){return db[_0x0b3f('0x3b')][_0x0b3f('0x44')]()[_0x0b3f('0x22')](respondWithResult(_0x17b28c,null))[_0x0b3f('0x3e')](handleError(_0x17b28c,null));}; \ No newline at end of file +var _0x3569=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x735da9,_0x38b186){var _0x39160b=function(_0x5cb870){while(--_0x5cb870){_0x735da9['push'](_0x735da9['shift']());}};_0x39160b(++_0x38b186);}(_0x3569,0x94));var _0x9356=function(_0x4c825d,_0x10ec2b){_0x4c825d=_0x4c825d-0x0;var _0x43de87=_0x3569[_0x4c825d];return _0x43de87;};'use strict';var emlformat=require(_0x9356('0x0'));var rimraf=require(_0x9356('0x1'));var zipdir=require(_0x9356('0x2'));var jsonpatch=require(_0x9356('0x3'));var rp=require('request-promise');var moment=require(_0x9356('0x4'));var BPromise=require(_0x9356('0x5'));var Mustache=require(_0x9356('0x6'));var util=require(_0x9356('0x7'));var path=require(_0x9356('0x8'));var sox=require(_0x9356('0x9'));var csv=require(_0x9356('0xa'));var ejs=require(_0x9356('0xb'));var fs=require('fs');var fs_extra=require(_0x9356('0xc'));var _=require(_0x9356('0xd'));var squel=require('squel');var crypto=require(_0x9356('0xe'));var jsforce=require(_0x9356('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9356('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9356('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9356('0x11'));var hardwareService=require(_0x9356('0x12'));var logger=require(_0x9356('0x13'))('api');var utils=require(_0x9356('0x14'));var config=require(_0x9356('0x15'));var licenseUtil=require(_0x9356('0x16'));var db=require(_0x9356('0x17'))['db'];function respondWithStatusCode(_0x399660,_0x37c351){_0x37c351=_0x37c351||0xcc;return function(_0x19b95e){if(_0x19b95e){return _0x399660[_0x9356('0x18')](_0x37c351);}return _0x399660[_0x9356('0x19')](_0x37c351)[_0x9356('0x1a')]();};}function respondWithResult(_0x437af5,_0x15e6d3){_0x15e6d3=_0x15e6d3||0xc8;return function(_0x352153){if(_0x352153){return _0x437af5[_0x9356('0x19')](_0x15e6d3)[_0x9356('0x1b')](_0x352153);}};}function respondWithFilteredResult(_0x2b233c,_0x23b5fd){return function(_0x221478){if(_0x221478){var _0x278765=typeof _0x23b5fd[_0x9356('0x1c')]===_0x9356('0x1d')&&typeof _0x23b5fd[_0x9356('0x1e')]===_0x9356('0x1d');var _0x569cb4=_0x221478[_0x9356('0x1f')];var _0x562609=_0x278765?0x0:_0x23b5fd[_0x9356('0x1c')];var _0x402ac9=_0x278765?_0x221478[_0x9356('0x1f')]:_0x23b5fd['offset']+_0x23b5fd['limit'];var _0x46a17f;if(_0x402ac9>=_0x569cb4){_0x402ac9=_0x569cb4;_0x46a17f=0xc8;}else{_0x46a17f=0xce;}_0x2b233c[_0x9356('0x19')](_0x46a17f);return _0x2b233c['set'](_0x9356('0x20'),_0x562609+'-'+_0x402ac9+'/'+_0x569cb4)[_0x9356('0x1b')](_0x221478);}return null;};}function patchUpdates(_0x327e73){return function(_0x5e6365){try{jsonpatch[_0x9356('0x21')](_0x5e6365,_0x327e73,!![]);}catch(_0x3db9ea){return BPromise[_0x9356('0x22')](_0x3db9ea);}return _0x5e6365[_0x9356('0x23')]();};}function saveUpdates(_0x38a5e0,_0x18cc75){return function(_0x49bc30){if(_0x49bc30){return _0x49bc30[_0x9356('0x24')](_0x38a5e0)[_0x9356('0x25')](function(_0x3b1f6d){return _0x3b1f6d;});}return null;};}function removeEntity(_0x3abeaf,_0x372c49){return function(_0x3bfd6d){if(_0x3bfd6d){return _0x3bfd6d['destroy']()[_0x9356('0x25')](function(){_0x3abeaf[_0x9356('0x19')](0xcc)[_0x9356('0x1a')]();});}};}function handleEntityNotFound(_0x9aaf7c,_0x23dbd1){return function(_0x5a172b){if(!_0x5a172b){_0x9aaf7c[_0x9356('0x18')](0x194);}return _0x5a172b;};}function handleError(_0x966626,_0x465071){_0x465071=_0x465071||0x1f4;return function(_0x5541d1){logger[_0x9356('0x26')](_0x5541d1[_0x9356('0x27')]);if(_0x5541d1['name']){delete _0x5541d1[_0x9356('0x28')];}_0x966626[_0x9356('0x19')](_0x465071)[_0x9356('0x29')](_0x5541d1);};}exports[_0x9356('0x2a')]=function(_0x337a59,_0x47449e){var _0x2098ca={},_0x259c1c={},_0x38d567={'count':0x0,'rows':[]};var _0x437e3e=_[_0x9356('0x2b')](db[_0x9356('0x2c')][_0x9356('0x2d')],function(_0x4e3c66){return{'name':_0x4e3c66['fieldName'],'type':_0x4e3c66[_0x9356('0x2e')][_0x9356('0x2f')]};});_0x259c1c[_0x9356('0x30')]=_['map'](_0x437e3e,_0x9356('0x28'));_0x259c1c[_0x9356('0x31')]=_[_0x9356('0x32')](_0x337a59[_0x9356('0x31')]);_0x259c1c[_0x9356('0x33')]=_['intersection'](_0x259c1c[_0x9356('0x30')],_0x259c1c['query']);_0x2098ca[_0x9356('0x34')]=_[_0x9356('0x35')](_0x259c1c['model'],qs['fields'](_0x337a59[_0x9356('0x31')][_0x9356('0x36')]));_0x2098ca[_0x9356('0x34')]=_0x2098ca[_0x9356('0x34')]['length']?_0x2098ca[_0x9356('0x34')]:_0x259c1c[_0x9356('0x30')];if(!_0x337a59[_0x9356('0x31')][_0x9356('0x37')](_0x9356('0x38'))){_0x2098ca['limit']=qs['limit'](_0x337a59[_0x9356('0x31')]['limit']);_0x2098ca[_0x9356('0x1c')]=qs[_0x9356('0x1c')](_0x337a59['query']['offset']);}_0x2098ca[_0x9356('0x39')]=qs[_0x9356('0x3a')](_0x337a59['query'][_0x9356('0x3a')]);_0x2098ca[_0x9356('0x3b')]=qs['filters'](_[_0x9356('0x3c')](_0x337a59[_0x9356('0x31')],_0x259c1c[_0x9356('0x33')]),_0x437e3e);if(_0x337a59['query'][_0x9356('0x3d')]){_0x2098ca['where']=_[_0x9356('0x3e')](_0x2098ca[_0x9356('0x3b')],{'$or':_['map'](_0x437e3e,function(_0xf2cdb8){if(_0xf2cdb8[_0x9356('0x2e')]!==_0x9356('0x3f')){var _0x9b583={};_0x9b583[_0xf2cdb8[_0x9356('0x28')]]={'$like':'%'+_0x337a59[_0x9356('0x31')][_0x9356('0x3d')]+'%'};return _0x9b583;}})});}_0x2098ca=_['merge']({},_0x2098ca,_0x337a59[_0x9356('0x40')]);var _0x54dbb4={'where':_0x2098ca['where']};return db[_0x9356('0x2c')]['count'](_0x54dbb4)[_0x9356('0x25')](function(_0x3959a7){_0x38d567[_0x9356('0x1f')]=_0x3959a7;if(_0x337a59[_0x9356('0x31')][_0x9356('0x41')]){_0x2098ca['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x9356('0x42')](_0x2098ca);})[_0x9356('0x25')](function(_0x1758cd){_0x38d567[_0x9356('0x43')]=_0x1758cd;return _0x38d567;})[_0x9356('0x25')](respondWithFilteredResult(_0x47449e,_0x2098ca))[_0x9356('0x44')](handleError(_0x47449e,null));};exports[_0x9356('0x45')]=function(_0x55b641,_0x5f5a37){var _0x4c6a3c={'raw':!![],'where':{'id':_0x55b641[_0x9356('0x46')]['id']}},_0x32d161={};_0x32d161['model']=_[_0x9356('0x32')](db[_0x9356('0x2c')][_0x9356('0x2d')]);_0x32d161['query']=_['keys'](_0x55b641[_0x9356('0x31')]);_0x32d161['filters']=_['intersection'](_0x32d161[_0x9356('0x30')],_0x32d161['query']);_0x4c6a3c[_0x9356('0x34')]=_['intersection'](_0x32d161[_0x9356('0x30')],qs[_0x9356('0x36')](_0x55b641[_0x9356('0x31')][_0x9356('0x36')]));_0x4c6a3c['attributes']=_0x4c6a3c['attributes']['length']?_0x4c6a3c[_0x9356('0x34')]:_0x32d161['model'];if(_0x55b641['query']['includeAll']){_0x4c6a3c[_0x9356('0x47')]=[{'all':!![]}];}_0x4c6a3c=_[_0x9356('0x3e')]({},_0x4c6a3c,_0x55b641[_0x9356('0x40')]);return db[_0x9356('0x2c')][_0x9356('0x48')](_0x4c6a3c)['then'](handleEntityNotFound(_0x5f5a37,null))[_0x9356('0x25')](respondWithResult(_0x5f5a37,null))[_0x9356('0x44')](handleError(_0x5f5a37,null));};exports[_0x9356('0x49')]=function(_0x22b97d,_0x162f78){return db[_0x9356('0x2c')][_0x9356('0x49')](_0x22b97d['body'],{})[_0x9356('0x25')](respondWithResult(_0x162f78,0xc9))['catch'](handleError(_0x162f78,null));};exports['update']=function(_0x386013,_0x222450){if(_0x386013[_0x9356('0x4a')]['id']){delete _0x386013[_0x9356('0x4a')]['id'];}return db[_0x9356('0x2c')]['find']({'where':{'id':_0x386013[_0x9356('0x46')]['id']}})[_0x9356('0x25')](handleEntityNotFound(_0x222450,null))[_0x9356('0x25')](saveUpdates(_0x386013[_0x9356('0x4a')],null))[_0x9356('0x25')](respondWithResult(_0x222450,null))[_0x9356('0x44')](handleError(_0x222450,null));};exports[_0x9356('0x4b')]=function(_0x23532d,_0x53fece){return db['VoiceDialReport']['find']({'where':{'id':_0x23532d[_0x9356('0x46')]['id']}})[_0x9356('0x25')](handleEntityNotFound(_0x53fece,null))[_0x9356('0x25')](removeEntity(_0x53fece,null))['catch'](handleError(_0x53fece,null));};exports[_0x9356('0x4c')]=function(_0x332cca,_0x27db95){return db[_0x9356('0x2c')]['describe']()['then'](respondWithResult(_0x27db95,null))[_0x9356('0x44')](handleError(_0x27db95,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 554f3c0..d0c5847 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 _0x4502=['define','VoiceDialReport','uniqueid','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x124eba,_0x22cb6b){var _0x2c8e35=function(_0x4c1cd4){while(--_0x4c1cd4){_0x124eba['push'](_0x124eba['shift']());}};_0x2c8e35(++_0x22cb6b);}(_0x4502,0x157));var _0x2450=function(_0x47a434,_0xc781e8){_0x47a434=_0x47a434-0x0;var _0x978e2f=_0x4502[_0x47a434];return _0x978e2f;};'use strict';var _=require(_0x2450('0x0'));var util=require('util');var logger=require(_0x2450('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2450('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2450('0x3'));var rimraf=require(_0x2450('0x4'));var config=require(_0x2450('0x5'));var attributes=require(_0x2450('0x6'));module['exports']=function(_0x4fcf06,_0x56dcc3){return _0x4fcf06[_0x2450('0x7')](_0x2450('0x8'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x2450('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ddc=['report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x459084,_0x2c4333){var _0x36516e=function(_0x2fe9d9){while(--_0x2fe9d9){_0x459084['push'](_0x459084['shift']());}};_0x36516e(++_0x2c4333);}(_0x5ddc,0x13d));var _0xc5dd=function(_0x876cb,_0x2a5122){_0x876cb=_0x876cb-0x0;var _0x5b09bc=_0x5ddc[_0x876cb];return _0x5b09bc;};'use strict';var _=require('lodash');var util=require(_0xc5dd('0x0'));var logger=require(_0xc5dd('0x1'))(_0xc5dd('0x2'));var moment=require(_0xc5dd('0x3'));var BPromise=require(_0xc5dd('0x4'));var rp=require(_0xc5dd('0x5'));var fs=require('fs');var path=require(_0xc5dd('0x6'));var rimraf=require(_0xc5dd('0x7'));var config=require(_0xc5dd('0x8'));var attributes=require(_0xc5dd('0x9'));module[_0xc5dd('0xa')]=function(_0x3d64a8,_0x2bfe44){return _0x3d64a8[_0xc5dd('0xb')](_0xc5dd('0xc'),attributes,{'tableName':_0xc5dd('0xd'),'paranoid':![],'indexes':[{'fields':[_0xc5dd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ba33be2..ae605e4 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 _0x2a32=['stringify','code','error','message','result','CreateVoiceDialReport','VoiceDialReport','body','options','catch','UpdateVoiceDialReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d9a80,_0x151f07){var _0x557870=function(_0x38f3a7){while(--_0x38f3a7){_0x5d9a80['push'](_0x5d9a80['shift']());}};_0x557870(++_0x151f07);}(_0x2a32,0x130));var _0x22a3=function(_0xf20b6,_0x49ddbb){_0xf20b6=_0xf20b6-0x0;var _0x4ff567=_0x2a32[_0xf20b6];return _0x4ff567;};'use strict';var _=require(_0x22a3('0x0'));var util=require(_0x22a3('0x1'));var moment=require('moment');var BPromise=require(_0x22a3('0x2'));var rs=require(_0x22a3('0x3'));var fs=require('fs');var Redis=require(_0x22a3('0x4'));var db=require(_0x22a3('0x5'))['db'];var utils=require(_0x22a3('0x6'));var logger=require(_0x22a3('0x7'))(_0x22a3('0x8'));var config=require('../../config/environment');var jayson=require(_0x22a3('0x9'));var client=jayson[_0x22a3('0xa')][_0x22a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dc33f,_0x4bd743,_0x42bdd4){return new BPromise(function(_0x59c102,_0x333651){return client['request'](_0x1dc33f,_0x42bdd4)['then'](function(_0x1603b2){logger[_0x22a3('0xc')](_0x22a3('0xd'),_0x4bd743,_0x22a3('0xe'));logger[_0x22a3('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4bd743,_0x22a3('0xe'),JSON[_0x22a3('0x10')](_0x1603b2));if(_0x1603b2['error']){if(_0x1603b2['error'][_0x22a3('0x11')]===0x1f4){logger[_0x22a3('0x12')](_0x22a3('0xd'),_0x4bd743,_0x1603b2[_0x22a3('0x12')]['message']);return _0x333651(_0x1603b2[_0x22a3('0x12')][_0x22a3('0x13')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4bd743,_0x1603b2[_0x22a3('0x12')]['message']);return _0x59c102(_0x1603b2[_0x22a3('0x12')][_0x22a3('0x13')]);}else{logger[_0x22a3('0xc')](_0x22a3('0xd'),_0x4bd743,_0x22a3('0xe'));_0x59c102(_0x1603b2[_0x22a3('0x14')][_0x22a3('0x13')]);}})['catch'](function(_0x46418a){logger[_0x22a3('0x12')](_0x22a3('0xd'),_0x4bd743,_0x46418a);_0x333651(_0x46418a);});});}exports[_0x22a3('0x15')]=function(_0x47cefb){var _0x6cfd4b=this;return new Promise(function(_0x4d1ec0,_0x2202c0){return db[_0x22a3('0x16')]['create'](_0x47cefb[_0x22a3('0x17')],{'raw':_0x47cefb[_0x22a3('0x18')]?_0x47cefb[_0x22a3('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x282c77){logger[_0x22a3('0xc')](_0x22a3('0x15'),_0x47cefb);logger[_0x22a3('0xf')](_0x22a3('0x15'),_0x47cefb,JSON[_0x22a3('0x10')](_0x282c77));_0x4d1ec0(_0x282c77);})[_0x22a3('0x19')](function(_0x2bf387){logger[_0x22a3('0x12')](_0x22a3('0x15'),_0x2bf387[_0x22a3('0x13')],_0x47cefb);_0x2202c0(_0x6cfd4b['error'](0x1f4,_0x2bf387[_0x22a3('0x13')]));});});};exports[_0x22a3('0x1a')]=function(_0x5043ec){var _0x2fd5b8=this;return new Promise(function(_0x258557,_0x394016){return db[_0x22a3('0x16')][_0x22a3('0x1b')](_0x5043ec['body'],{'raw':_0x5043ec[_0x22a3('0x18')]?_0x5043ec['options'][_0x22a3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5043ec[_0x22a3('0x18')]?_0x5043ec[_0x22a3('0x18')][_0x22a3('0x1d')]||null:null,'attributes':_0x5043ec[_0x22a3('0x18')]?_0x5043ec[_0x22a3('0x18')][_0x22a3('0x1e')]||null:null,'limit':_0x5043ec[_0x22a3('0x18')]?_0x5043ec[_0x22a3('0x18')][_0x22a3('0x1f')]||null:null})['then'](function(_0x54ba32){logger[_0x22a3('0xc')](_0x22a3('0x1a'),_0x5043ec);logger[_0x22a3('0xf')](_0x22a3('0x1a'),_0x5043ec,JSON['stringify'](_0x54ba32));_0x258557(_0x54ba32);})[_0x22a3('0x19')](function(_0x45335f){logger[_0x22a3('0x12')](_0x22a3('0x1a'),_0x45335f[_0x22a3('0x13')],_0x5043ec);_0x394016(_0x2fd5b8[_0x22a3('0x12')](0x1f4,_0x45335f['message']));});});}; \ No newline at end of file +var _0xbefc=['info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','stringify','catch','UpdateVoiceDialReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbefc,0x195));var _0xcbef=function(_0x3199ba,_0x42a7a1){_0x3199ba=_0x3199ba-0x0;var _0x37f931=_0xbefc[_0x3199ba];return _0x37f931;};'use strict';var _=require('lodash');var util=require(_0xcbef('0x0'));var moment=require(_0xcbef('0x1'));var BPromise=require(_0xcbef('0x2'));var rs=require(_0xcbef('0x3'));var fs=require('fs');var Redis=require(_0xcbef('0x4'));var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))(_0xcbef('0x8'));var config=require(_0xcbef('0x9'));var jayson=require(_0xcbef('0xa'));var client=jayson[_0xcbef('0xb')][_0xcbef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17bf41,_0x3137a4,_0x36eae6){return new BPromise(function(_0x3c76cd,_0x10e840){return client[_0xcbef('0xd')](_0x17bf41,_0x36eae6)[_0xcbef('0xe')](function(_0x2e10e4){logger[_0xcbef('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));logger[_0xcbef('0x11')](_0xcbef('0x12'),_0x3137a4,'request\x20sent',JSON['stringify'](_0x2e10e4));if(_0x2e10e4[_0xcbef('0x13')]){if(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x14')]===0x1f4){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x10e840(_0x2e10e4['error'][_0xcbef('0x16')]);}logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x3c76cd(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));_0x3c76cd(_0x2e10e4[_0xcbef('0x17')][_0xcbef('0x16')]);}})['catch'](function(_0x48a6c9){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x48a6c9);_0x10e840(_0x48a6c9);});});}exports[_0xcbef('0x18')]=function(_0x5b02be){var _0x2a3887=this;return new Promise(function(_0x17f198,_0x4d59b3){return db[_0xcbef('0x19')][_0xcbef('0x1a')](_0x5b02be['body'],{'raw':_0x5b02be['options']?_0x5b02be[_0xcbef('0x1b')][_0xcbef('0x1c')]===undefined?!![]:![]:!![]})[_0xcbef('0xe')](function(_0x490b04){logger[_0xcbef('0xf')](_0xcbef('0x18'),_0x5b02be);logger[_0xcbef('0x11')]('CreateVoiceDialReport',_0x5b02be,JSON[_0xcbef('0x1d')](_0x490b04));_0x17f198(_0x490b04);})[_0xcbef('0x1e')](function(_0x181f83){logger['error'](_0xcbef('0x18'),_0x181f83[_0xcbef('0x16')],_0x5b02be);_0x4d59b3(_0x2a3887[_0xcbef('0x13')](0x1f4,_0x181f83[_0xcbef('0x16')]));});});};exports[_0xcbef('0x1f')]=function(_0x55a64e){var _0x43046a=this;return new Promise(function(_0x16a7db,_0x38be1f){return db[_0xcbef('0x19')][_0xcbef('0x20')](_0x55a64e['body'],{'raw':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e['options'][_0xcbef('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e[_0xcbef('0x1b')][_0xcbef('0x21')]||null:null,'attributes':_0x55a64e['options']?_0x55a64e[_0xcbef('0x1b')]['attributes']||null:null,'limit':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e[_0xcbef('0x1b')][_0xcbef('0x22')]||null:null})[_0xcbef('0xe')](function(_0x5ef8ce){logger[_0xcbef('0xf')](_0xcbef('0x1f'),_0x55a64e);logger[_0xcbef('0x11')](_0xcbef('0x1f'),_0x55a64e,JSON[_0xcbef('0x1d')](_0x5ef8ce));_0x16a7db(_0x5ef8ce);})[_0xcbef('0x1e')](function(_0x57b8be){logger[_0xcbef('0x13')]('UpdateVoiceDialReport',_0x57b8be[_0xcbef('0x16')],_0x55a64e);_0x38be1f(_0x43046a['error'](0x1f4,_0x57b8be['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index e026ad9..bbdf0d0 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 _0xaaee=['../../config/environment','get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a59af,_0x18d558){var _0x3af243=function(_0x5480d6){while(--_0x5480d6){_0x2a59af['push'](_0x2a59af['shift']());}};_0x3af243(++_0x18d558);}(_0xaaee,0x1b1));var _0xeaae=function(_0x109d94,_0x368562){_0x109d94=_0x109d94-0x0;var _0xcbd14b=_0xaaee[_0x109d94];return _0xcbd14b;};'use strict';var multer=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var path=require(_0xeaae('0x2'));var timeout=require(_0xeaae('0x3'));var express=require(_0xeaae('0x4'));var router=express['Router']();var fs_extra=require(_0xeaae('0x5'));var auth=require(_0xeaae('0x6'));var interaction=require(_0xeaae('0x7'));var config=require(_0xeaae('0x8'));var controller=require('./voiceExtension.controller');router[_0xeaae('0x9')]('/',auth[_0xeaae('0xa')](),controller['index']);router[_0xeaae('0x9')](_0xeaae('0xb'),auth['isAuthenticated'](),controller[_0xeaae('0xc')]);router[_0xeaae('0xd')]('/',auth[_0xeaae('0xa')](),controller['create']);router[_0xeaae('0xd')](_0xeaae('0xe'),auth[_0xeaae('0xa')](),controller[_0xeaae('0xf')]);router[_0xeaae('0x10')](_0xeaae('0xb'),auth[_0xeaae('0xa')](),controller[_0xeaae('0x11')]);router[_0xeaae('0x12')]('/:id',auth[_0xeaae('0xa')](),controller[_0xeaae('0x13')]);module[_0xeaae('0x14')]=router; \ No newline at end of file +var _0x9d84=['get','isAuthenticated','show','post','create','/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x34bfd8,_0x24eaa3){var _0x122c91=function(_0x17081a){while(--_0x17081a){_0x34bfd8['push'](_0x34bfd8['shift']());}};_0x122c91(++_0x24eaa3);}(_0x9d84,0xfd));var _0x49d8=function(_0x489e57,_0x4c2d00){_0x489e57=_0x489e57-0x0;var _0x1adede=_0x9d84[_0x489e57];return _0x1adede;};'use strict';var multer=require(_0x49d8('0x0'));var util=require(_0x49d8('0x1'));var path=require(_0x49d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x49d8('0x3'));var router=express[_0x49d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x49d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x49d8('0x6'));var controller=require('./voiceExtension.controller');router[_0x49d8('0x7')]('/',auth[_0x49d8('0x8')](),controller['index']);router[_0x49d8('0x7')]('/:id',auth[_0x49d8('0x8')](),controller[_0x49d8('0x9')]);router[_0x49d8('0xa')]('/',auth[_0x49d8('0x8')](),controller[_0x49d8('0xb')]);router[_0x49d8('0xa')](_0x49d8('0xc'),auth[_0x49d8('0x8')](),controller[_0x49d8('0xd')]);router[_0x49d8('0xe')](_0x49d8('0xf'),auth[_0x49d8('0x8')](),controller[_0x49d8('0x10')]);router[_0x49d8('0x11')](_0x49d8('0xf'),auth[_0x49d8('0x8')](),controller[_0x49d8('0x12')]);module[_0x49d8('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index f0741b2..15dc7da 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 _0xc2d9=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exports'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0xc2d9,0x1ef));var _0x9c2d=function(_0x54eff8,_0x4ff003){_0x54eff8=_0x54eff8-0x0;var _0x52c59e=_0xc2d9[_0x54eff8];return _0x52c59e;};'use strict';var Sequelize=require('sequelize');module[_0x9c2d('0x0')]={'context':{'type':Sequelize[_0x9c2d('0x1')],'allowNull':![],'unique':_0x9c2d('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x9c2d('0x1')],'allowNull':![],'unique':_0x9c2d('0x2')},'priority':{'type':Sequelize[_0x9c2d('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x9c2d('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9c2d('0x1')],'allowNull':![],'defaultValue':_0x9c2d('0x3')},'appdata':{'type':Sequelize[_0x9c2d('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9c2d('0x4')](_0x9c2d('0x5'),_0x9c2d('0x6'),_0x9c2d('0x7'),'inbound-fax',_0x9c2d('0x8'),'system',_0x9c2d('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9c2d('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x9c2d('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9c2d('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x9c2d('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x9c2d('0xc')]},'recordingFormat':{'type':Sequelize[_0x9c2d('0x1')],'defaultValue':_0x9c2d('0xd')},'answer':{'type':Sequelize[_0x9c2d('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x9c2d('0xe')],'get':function(_0x52db32){return this[_0x9c2d('0xf')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd977=['ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','STRING','compositeIndex','NoOp'];(function(_0x2bdba8,_0x1be69b){var _0x2ddf5e=function(_0x1ef2d4){while(--_0x1ef2d4){_0x2bdba8['push'](_0x2bdba8['shift']());}};_0x2ddf5e(++_0x1be69b);}(_0xd977,0x1c7));var _0x7d97=function(_0x3751a3,_0x485ce5){_0x3751a3=_0x3751a3-0x0;var _0x4a9337=_0xd977[_0x3751a3];return _0x4a9337;};'use strict';var Sequelize=require(_0x7d97('0x0'));module['exports']={'context':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'unique':_0x7d97('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'unique':_0x7d97('0x2')},'priority':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x7d97('0x2')},'tag':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':_0x7d97('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7d97('0x4')](_0x7d97('0x5'),_0x7d97('0x6'),_0x7d97('0x7'),_0x7d97('0x8'),_0x7d97('0x9'),_0x7d97('0xa'),_0x7d97('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x7d97('0x1')]},'interval':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':_0x7d97('0xc')},'IntervalId':{'type':Sequelize[_0x7d97('0xd')]},'isApp':{'type':Sequelize[_0x7d97('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7d97('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7d97('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7d97('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7d97('0xd')]},'recordingFormat':{'type':Sequelize[_0x7d97('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7d97('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7d97('0xf')],'get':function(_0x4e8d12){return this['getDataValue'](_0x7d97('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 06f115f..725757a 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 _0xb433=['query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','show','params','catch','body','outbound','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','InboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','findOne','sequelize','transaction','isApp','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','destroy','then','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','value','type','find','name','UserProfileResource','end','error','stack','index','map','rawAttributes','fieldName'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xb433,0x19b));var _0x3b43=function(_0x35eaac,_0x470cdd){_0x35eaac=_0x35eaac-0x0;var _0x44ff21=_0xb433[_0x35eaac];return _0x44ff21;};'use strict';var _=require(_0x3b43('0x0'));var Redis=require(_0x3b43('0x1'));var qs=require(_0x3b43('0x2'));var logger=require(_0x3b43('0x3'))(_0x3b43('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3b43('0x5')]=_[_0x3b43('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3b43('0x7'))(new Redis(config[_0x3b43('0x5')]));require(_0x3b43('0x8'))[_0x3b43('0x9')](socket);function respondWithStatusCode(_0x4b695c,_0x4fa1ab){_0x4fa1ab=_0x4fa1ab||0xcc;return function(_0x1fea4d){if(_0x1fea4d){return _0x4b695c[_0x3b43('0xa')](_0x4fa1ab);}return _0x4b695c[_0x3b43('0xb')](_0x4fa1ab)['end']();};}function respondWithResult(_0x5deead,_0x43a6c7){_0x43a6c7=_0x43a6c7||0xc8;return function(_0x245936){if(_0x245936){return _0x5deead[_0x3b43('0xb')](_0x43a6c7)[_0x3b43('0xc')](_0x245936);}};}function respondWithFilteredResult(_0x41a331,_0x45bd94){return function(_0x628797){if(_0x628797){var _0x1e7053=typeof _0x45bd94['offset']===_0x3b43('0xd')&&typeof _0x45bd94[_0x3b43('0xe')]===_0x3b43('0xd');var _0x431b29=_0x628797['count'];var _0x4deb97=_0x1e7053?0x0:_0x45bd94[_0x3b43('0xf')];var _0x55468f=_0x1e7053?_0x628797[_0x3b43('0x10')]:_0x45bd94[_0x3b43('0xf')]+_0x45bd94[_0x3b43('0xe')];var _0x23bc20;if(_0x55468f>=_0x431b29){_0x55468f=_0x431b29;_0x23bc20=0xc8;}else{_0x23bc20=0xce;}_0x41a331[_0x3b43('0xb')](_0x23bc20);return _0x41a331[_0x3b43('0x11')](_0x3b43('0x12'),_0x4deb97+'-'+_0x55468f+'/'+_0x431b29)[_0x3b43('0xc')](_0x628797);}return null;};}function removeEntity(_0x4018c4){return function(_0x488774){if(_0x488774){return _0x488774[_0x3b43('0x13')]()[_0x3b43('0x14')](function(){var _0x2d076b=_0x488774['get']({'plain':!![]});var _0x4a4bdc=[{'name':'InboundRoutes','value':_0x3b43('0x15'),'ignore':![]},{'name':_0x3b43('0x16'),'value':'outbound','ignore':![]},{'name':_0x3b43('0x17'),'value':_0x3b43('0x18'),'ignore':![]}];var _0x361898=_(_0x4a4bdc)[_0x3b43('0x19')](_0x3b43('0x1a'))['map'](_0x3b43('0x1b'))[_0x3b43('0x1b')]();if(_['includes'](_0x361898,_0x2d076b[_0x3b43('0x1c')])){return;}var _0x33122c=_[_0x3b43('0x1d')](_0x4a4bdc,[_0x3b43('0x1b'),_0x2d076b['type']])[_0x3b43('0x1e')];return db[_0x3b43('0x1f')][_0x3b43('0x13')]({'where':{'type':_0x33122c,'resourceId':_0x2d076b['id']}})['then'](function(){return _0x488774;});})['then'](function(){_0x4018c4[_0x3b43('0xb')](0xcc)[_0x3b43('0x20')]();});}};}function handleEntityNotFound(_0x454015){return function(_0x421cd8){if(!_0x421cd8){_0x454015[_0x3b43('0xa')](0x194);}return _0x421cd8;};}function handleError(_0x17eb85,_0x4f49fc){_0x4f49fc=_0x4f49fc||0x1f4;return function(_0x2f9b1b){logger[_0x3b43('0x21')](_0x2f9b1b[_0x3b43('0x22')]);if(_0x2f9b1b[_0x3b43('0x1e')]){delete _0x2f9b1b[_0x3b43('0x1e')];}_0x17eb85[_0x3b43('0xb')](_0x4f49fc)['send'](_0x2f9b1b);};}exports[_0x3b43('0x23')]=function(_0x3aca03,_0x49641f){var _0x23ab5f={},_0x1e7d13={},_0x5f5ea4={'count':0x0,'rows':[]};var _0x1af65b=_[_0x3b43('0x24')](db['VoiceExtension'][_0x3b43('0x25')],function(_0x8178c1){return{'name':_0x8178c1[_0x3b43('0x26')],'type':_0x8178c1[_0x3b43('0x1c')]['key']};});_0x1e7d13['model']=_['map'](_0x1af65b,_0x3b43('0x1e'));_0x1e7d13[_0x3b43('0x27')]=_[_0x3b43('0x28')](_0x3aca03['query']);_0x1e7d13['filters']=_[_0x3b43('0x29')](_0x1e7d13['model'],_0x1e7d13['query']);_0x23ab5f['attributes']=_[_0x3b43('0x29')](_0x1e7d13[_0x3b43('0x2a')],qs[_0x3b43('0x2b')](_0x3aca03[_0x3b43('0x27')]['fields']));_0x23ab5f[_0x3b43('0x2c')]=_0x23ab5f[_0x3b43('0x2c')][_0x3b43('0x2d')]?_0x23ab5f['attributes']:_0x1e7d13[_0x3b43('0x2a')];if(!_0x3aca03[_0x3b43('0x27')][_0x3b43('0x2e')](_0x3b43('0x2f'))){_0x23ab5f[_0x3b43('0xe')]=qs['limit'](_0x3aca03[_0x3b43('0x27')][_0x3b43('0xe')]);_0x23ab5f[_0x3b43('0xf')]=qs[_0x3b43('0xf')](_0x3aca03[_0x3b43('0x27')][_0x3b43('0xf')]);}_0x23ab5f['order']=qs[_0x3b43('0x30')](_0x3aca03[_0x3b43('0x27')][_0x3b43('0x30')]);_0x23ab5f[_0x3b43('0x31')]=qs[_0x3b43('0x32')](_[_0x3b43('0x33')](_0x3aca03['query'],_0x1e7d13[_0x3b43('0x32')]),_0x1af65b);if(_0x3aca03['query'][_0x3b43('0x19')]){_0x23ab5f[_0x3b43('0x31')]=_[_0x3b43('0x34')](_0x23ab5f[_0x3b43('0x31')],{'$or':_[_0x3b43('0x24')](_0x1af65b,function(_0x3f3f09){if(_0x3f3f09[_0x3b43('0x1c')]!==_0x3b43('0x35')){var _0x152b86={};_0x152b86[_0x3f3f09['name']]={'$like':'%'+_0x3aca03[_0x3b43('0x27')][_0x3b43('0x19')]+'%'};return _0x152b86;}})});}_0x23ab5f=_[_0x3b43('0x34')]({},_0x23ab5f,_0x3aca03[_0x3b43('0x36')]);var _0x219573={'where':_0x23ab5f[_0x3b43('0x31')]};return db[_0x3b43('0x37')][_0x3b43('0x10')](_0x219573)[_0x3b43('0x14')](function(_0xaa0c92){_0x5f5ea4[_0x3b43('0x10')]=_0xaa0c92;if(_0x3aca03[_0x3b43('0x27')][_0x3b43('0x38')]){_0x23ab5f[_0x3b43('0x39')]=[{'all':!![]}];}return db['VoiceExtension'][_0x3b43('0x3a')](_0x23ab5f);})[_0x3b43('0x14')](function(_0x83cfad){_0x5f5ea4[_0x3b43('0x3b')]=_0x83cfad;return _0x5f5ea4;})[_0x3b43('0x14')](respondWithFilteredResult(_0x49641f,_0x23ab5f))['catch'](handleError(_0x49641f,null));};exports[_0x3b43('0x3c')]=function(_0x7a84c4,_0x190d81){var _0x31373c={'raw':![],'where':{'id':_0x7a84c4[_0x3b43('0x3d')]['id']}},_0x3dc2e9={};_0x3dc2e9[_0x3b43('0x2a')]=_[_0x3b43('0x28')](db[_0x3b43('0x37')][_0x3b43('0x25')]);_0x3dc2e9['query']=_[_0x3b43('0x28')](_0x7a84c4[_0x3b43('0x27')]);_0x3dc2e9[_0x3b43('0x32')]=_[_0x3b43('0x29')](_0x3dc2e9[_0x3b43('0x2a')],_0x3dc2e9[_0x3b43('0x27')]);_0x31373c['attributes']=_['intersection'](_0x3dc2e9[_0x3b43('0x2a')],qs[_0x3b43('0x2b')](_0x7a84c4[_0x3b43('0x27')][_0x3b43('0x2b')]));_0x31373c[_0x3b43('0x2c')]=_0x31373c['attributes'][_0x3b43('0x2d')]?_0x31373c[_0x3b43('0x2c')]:_0x3dc2e9[_0x3b43('0x2a')];if(_0x7a84c4[_0x3b43('0x27')]['includeAll']){_0x31373c[_0x3b43('0x39')]=[{'all':!![]}];}_0x31373c=_['merge']({},_0x31373c,_0x7a84c4[_0x3b43('0x36')]);return db[_0x3b43('0x37')][_0x3b43('0x1d')](_0x31373c)['then'](handleEntityNotFound(_0x190d81,null))[_0x3b43('0x14')](respondWithResult(_0x190d81,null))[_0x3b43('0x3e')](handleError(_0x190d81,null));};exports[_0x3b43('0x13')]=function(_0x5348e3,_0x19a856){return db[_0x3b43('0x37')][_0x3b43('0x1d')]({'where':{'id':_0x5348e3[_0x3b43('0x3d')]['id']}})[_0x3b43('0x14')](handleEntityNotFound(_0x19a856,null))[_0x3b43('0x14')](removeEntity(_0x19a856,null))[_0x3b43('0x3e')](handleError(_0x19a856,null));};exports['create']=function(_0x5e6914,_0x17fbf4){if(_0x5e6914[_0x3b43('0x3f')][_0x3b43('0x1c')]===_0x3b43('0x40')&&!_[_0x3b43('0x41')](_0x5e6914[_0x3b43('0x3f')][_0x3b43('0x42')],'_')){_0x5e6914[_0x3b43('0x3f')][_0x3b43('0x42')]='_'['concat'](_0x5e6914[_0x3b43('0x3f')][_0x3b43('0x42')]);}return db[_0x3b43('0x37')][_0x3b43('0x43')](_0x5e6914[_0x3b43('0x3f')],{'raw':![]})[_0x3b43('0x14')](function(_0x21d4de){var _0x38dee9=_0x5e6914[_0x3b43('0x44')]['get']({'plain':!![]});if(!_0x38dee9)throw new Error(_0x3b43('0x45'));if(_0x38dee9[_0x3b43('0x46')]===_0x3b43('0x44')){var _0x53e138=_0x21d4de[_0x3b43('0x47')]({'plain':!![]});var _0xe2de9d=[{'name':_0x3b43('0x48'),'value':_0x3b43('0x15')},{'name':_0x3b43('0x16'),'value':_0x3b43('0x40')},{'name':'InternalRoutes','value':_0x3b43('0x18')}];var _0x35e0eb=_[_0x3b43('0x1d')](_0xe2de9d,[_0x3b43('0x1b'),_0x53e138['type']])[_0x3b43('0x1e')];return db[_0x3b43('0x49')][_0x3b43('0x1d')]({'where':{'name':_0x35e0eb,'userProfileId':_0x38dee9['userProfileId']},'raw':!![]})[_0x3b43('0x14')](function(_0x35d082){if(_0x35d082&&_0x35d082['autoAssociation']===0x0){return db[_0x3b43('0x1f')]['create']({'name':_0x53e138[_0x3b43('0x1e')],'resourceId':_0x53e138['id'],'type':_0x35d082['name'],'sectionId':_0x35d082['id']},{})[_0x3b43('0x14')](function(){return _0x21d4de;});}else{return _0x21d4de;}})['catch'](function(_0x1bc321){logger[_0x3b43('0x21')](_0x3b43('0x4a'),_0x1bc321);throw _0x1bc321;});}return _0x21d4de;})[_0x3b43('0x14')](respondWithResult(_0x17fbf4,0xc9))[_0x3b43('0x3e')](handleError(_0x17fbf4,null));};exports[_0x3b43('0x4b')]=function(_0x1f202a,_0xb68708){if(_0x1f202a['body']['id']){delete _0x1f202a[_0x3b43('0x3f')]['id'];}return db[_0x3b43('0x37')][_0x3b43('0x1d')]({'where':{'id':_0x1f202a[_0x3b43('0x3d')]['id']}})[_0x3b43('0x14')](handleEntityNotFound(_0xb68708,null))[_0x3b43('0x14')](function(_0x3f542e){if(_0x3f542e){return db[_0x3b43('0x37')][_0x3b43('0x4b')](_[_0x3b43('0x33')](_0x1f202a[_0x3b43('0x3f')],[_0x3b43('0x42'),'context','description',_0x3b43('0x4c'),_0x3b43('0x4d'),_0x3b43('0x4e'),_0x3b43('0x4f')]),{'where':{'context':_0x3f542e[_0x3b43('0x50')],'exten':_0x3f542e[_0x3b43('0x42')]},'individualHooks':!![]})[_0x3b43('0x14')](function(_0x158ecf){return _0x158ecf;});}return null;})[_0x3b43('0x14')](respondWithStatusCode(_0xb68708,null))[_0x3b43('0x3e')](handleError(_0xb68708,null));};exports[_0x3b43('0x51')]=function(_0x17124f,_0x42bccc){return db[_0x3b43('0x37')][_0x3b43('0x52')]({'where':{'id':_0x17124f['params']['id']}})[_0x3b43('0x14')](function(_0x22d8df){if(_0x22d8df){return db[_0x3b43('0x53')][_0x3b43('0x54')](function(_0x190a89){return db[_0x3b43('0x37')][_0x3b43('0x13')]({'where':{'VoiceExtensionId':_0x17124f[_0x3b43('0x3d')]['id']},'transaction':_0x190a89})[_0x3b43('0x14')](function(){var _0x50ea98=_['map'](_0x17124f[_0x3b43('0x3f')],function(_0x32d699){_0x32d699['VoiceExtensionId']=_0x17124f[_0x3b43('0x3d')]['id'];_0x32d699[_0x3b43('0x55')]=!![];return _0x32d699;});return _0x22d8df['createRouting'](_0x50ea98);})[_0x3b43('0x14')](function(_0x9c428f){console['log'](_0x3b43('0x56'),_0x9c428f);return db[_0x3b43('0x37')][_0x3b43('0x57')](_0x9c428f,{'transaction':_0x190a89});});})[_0x3b43('0x14')](function(){return db['VoiceExtension'][_0x3b43('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x17124f[_0x3b43('0x3d')]['id']},'order':_0x3b43('0x59')});});}})['then'](respondWithResult(_0x42bccc,null))[_0x3b43('0x3e')](handleError(_0x42bccc,null));}; \ No newline at end of file +var _0xb910=['include','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','map','value','includes','type','find','error','stack','name','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show'];(function(_0x5a3d6d,_0x2ed4cb){var _0x4e7088=function(_0x1c2ede){while(--_0x1c2ede){_0x5a3d6d['push'](_0x5a3d6d['shift']());}};_0x4e7088(++_0x2ed4cb);}(_0xb910,0x12b));var _0x0b91=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb910[_0x166d93];return _0xba708;};'use strict';var _=require(_0x0b91('0x0'));var Redis=require(_0x0b91('0x1'));var qs=require(_0x0b91('0x2'));var logger=require(_0x0b91('0x3'))(_0x0b91('0x4'));var config=require(_0x0b91('0x5'));var db=require(_0x0b91('0x6'))['db'];config[_0x0b91('0x7')]=_[_0x0b91('0x8')](config[_0x0b91('0x7')],{'host':_0x0b91('0x9'),'port':0x18eb});var socket=require(_0x0b91('0xa'))(new Redis(config[_0x0b91('0x7')]));require(_0x0b91('0xb'))['register'](socket);function respondWithStatusCode(_0x156fd1,_0xc65d86){_0xc65d86=_0xc65d86||0xcc;return function(_0x3e8800){if(_0x3e8800){return _0x156fd1[_0x0b91('0xc')](_0xc65d86);}return _0x156fd1[_0x0b91('0xd')](_0xc65d86)[_0x0b91('0xe')]();};}function respondWithResult(_0x4118b8,_0x13b9b7){_0x13b9b7=_0x13b9b7||0xc8;return function(_0x42e3dc){if(_0x42e3dc){return _0x4118b8['status'](_0x13b9b7)[_0x0b91('0xf')](_0x42e3dc);}};}function respondWithFilteredResult(_0x547a8b,_0x322ff0){return function(_0x5eb743){if(_0x5eb743){var _0x4ee548=typeof _0x322ff0[_0x0b91('0x10')]===_0x0b91('0x11')&&typeof _0x322ff0[_0x0b91('0x12')]===_0x0b91('0x11');var _0x5b6f36=_0x5eb743[_0x0b91('0x13')];var _0x2577a1=_0x4ee548?0x0:_0x322ff0[_0x0b91('0x10')];var _0x2ec488=_0x4ee548?_0x5eb743['count']:_0x322ff0[_0x0b91('0x10')]+_0x322ff0[_0x0b91('0x12')];var _0x1932a9;if(_0x2ec488>=_0x5b6f36){_0x2ec488=_0x5b6f36;_0x1932a9=0xc8;}else{_0x1932a9=0xce;}_0x547a8b[_0x0b91('0xd')](_0x1932a9);return _0x547a8b[_0x0b91('0x14')](_0x0b91('0x15'),_0x2577a1+'-'+_0x2ec488+'/'+_0x5b6f36)['json'](_0x5eb743);}return null;};}function removeEntity(_0x83ffe1){return function(_0x25e66a){if(_0x25e66a){return _0x25e66a[_0x0b91('0x16')]()[_0x0b91('0x17')](function(){var _0x106ec8=_0x25e66a[_0x0b91('0x18')]({'plain':!![]});var _0x1101c3=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a'),'ignore':![]},{'name':_0x0b91('0x1b'),'value':_0x0b91('0x1c'),'ignore':![]},{'name':_0x0b91('0x1d'),'value':'internal','ignore':![]}];var _0x2df818=_(_0x1101c3)['filter']('ignore')[_0x0b91('0x1e')](_0x0b91('0x1f'))[_0x0b91('0x1f')]();if(_[_0x0b91('0x20')](_0x2df818,_0x106ec8[_0x0b91('0x21')])){return;}var _0x5369c0=_[_0x0b91('0x22')](_0x1101c3,[_0x0b91('0x1f'),_0x106ec8[_0x0b91('0x21')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5369c0,'resourceId':_0x106ec8['id']}})['then'](function(){return _0x25e66a;});})[_0x0b91('0x17')](function(){_0x83ffe1[_0x0b91('0xd')](0xcc)[_0x0b91('0xe')]();});}};}function handleEntityNotFound(_0x24b98f){return function(_0x26d2e7){if(!_0x26d2e7){_0x24b98f[_0x0b91('0xc')](0x194);}return _0x26d2e7;};}function handleError(_0x119748,_0x2071c0){_0x2071c0=_0x2071c0||0x1f4;return function(_0x231327){logger[_0x0b91('0x23')](_0x231327[_0x0b91('0x24')]);if(_0x231327[_0x0b91('0x25')]){delete _0x231327['name'];}_0x119748[_0x0b91('0xd')](_0x2071c0)['send'](_0x231327);};}exports['index']=function(_0x1ea590,_0x5b6811){var _0x120ae2={},_0x4afbd1={},_0xb8cebf={'count':0x0,'rows':[]};var _0x15755c=_['map'](db[_0x0b91('0x26')][_0x0b91('0x27')],function(_0x493c5e){return{'name':_0x493c5e['fieldName'],'type':_0x493c5e['type'][_0x0b91('0x28')]};});_0x4afbd1[_0x0b91('0x29')]=_[_0x0b91('0x1e')](_0x15755c,_0x0b91('0x25'));_0x4afbd1[_0x0b91('0x2a')]=_[_0x0b91('0x2b')](_0x1ea590[_0x0b91('0x2a')]);_0x4afbd1[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x4afbd1[_0x0b91('0x29')],_0x4afbd1[_0x0b91('0x2a')]);_0x120ae2['attributes']=_['intersection'](_0x4afbd1[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x2e')]));_0x120ae2[_0x0b91('0x2f')]=_0x120ae2[_0x0b91('0x2f')]['length']?_0x120ae2[_0x0b91('0x2f')]:_0x4afbd1[_0x0b91('0x29')];if(!_0x1ea590['query']['hasOwnProperty'](_0x0b91('0x30'))){_0x120ae2[_0x0b91('0x12')]=qs[_0x0b91('0x12')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x12')]);_0x120ae2['offset']=qs['offset'](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x10')]);}_0x120ae2[_0x0b91('0x31')]=qs[_0x0b91('0x32')](_0x1ea590[_0x0b91('0x2a')]['sort']);_0x120ae2[_0x0b91('0x33')]=qs['filters'](_[_0x0b91('0x34')](_0x1ea590['query'],_0x4afbd1['filters']),_0x15755c);if(_0x1ea590['query'][_0x0b91('0x35')]){_0x120ae2[_0x0b91('0x33')]=_[_0x0b91('0x36')](_0x120ae2['where'],{'$or':_[_0x0b91('0x1e')](_0x15755c,function(_0x17388a){if(_0x17388a[_0x0b91('0x21')]!==_0x0b91('0x37')){var _0x4cd9ac={};_0x4cd9ac[_0x17388a[_0x0b91('0x25')]]={'$like':'%'+_0x1ea590['query'][_0x0b91('0x35')]+'%'};return _0x4cd9ac;}})});}_0x120ae2=_[_0x0b91('0x36')]({},_0x120ae2,_0x1ea590[_0x0b91('0x38')]);var _0x44c2d8={'where':_0x120ae2[_0x0b91('0x33')]};return db['VoiceExtension'][_0x0b91('0x13')](_0x44c2d8)[_0x0b91('0x17')](function(_0x5a7277){_0xb8cebf['count']=_0x5a7277;if(_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x39')]){_0x120ae2['include']=[{'all':!![]}];}return db[_0x0b91('0x26')][_0x0b91('0x3a')](_0x120ae2);})[_0x0b91('0x17')](function(_0x5e1f06){_0xb8cebf['rows']=_0x5e1f06;return _0xb8cebf;})[_0x0b91('0x17')](respondWithFilteredResult(_0x5b6811,_0x120ae2))[_0x0b91('0x3b')](handleError(_0x5b6811,null));};exports[_0x0b91('0x3c')]=function(_0x256887,_0x43b8ee){var _0x18065f={'raw':![],'where':{'id':_0x256887['params']['id']}},_0x1166cc={};_0x1166cc[_0x0b91('0x29')]=_[_0x0b91('0x2b')](db[_0x0b91('0x26')][_0x0b91('0x27')]);_0x1166cc['query']=_[_0x0b91('0x2b')](_0x256887[_0x0b91('0x2a')]);_0x1166cc[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],_0x1166cc[_0x0b91('0x2a')]);_0x18065f['attributes']=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x256887[_0x0b91('0x2a')]['fields']));_0x18065f[_0x0b91('0x2f')]=_0x18065f[_0x0b91('0x2f')]['length']?_0x18065f[_0x0b91('0x2f')]:_0x1166cc[_0x0b91('0x29')];if(_0x256887[_0x0b91('0x2a')]['includeAll']){_0x18065f[_0x0b91('0x3d')]=[{'all':!![]}];}_0x18065f=_[_0x0b91('0x36')]({},_0x18065f,_0x256887[_0x0b91('0x38')]);return db[_0x0b91('0x26')][_0x0b91('0x22')](_0x18065f)[_0x0b91('0x17')](handleEntityNotFound(_0x43b8ee,null))[_0x0b91('0x17')](respondWithResult(_0x43b8ee,null))[_0x0b91('0x3b')](handleError(_0x43b8ee,null));};exports[_0x0b91('0x16')]=function(_0x1a1f74,_0x2fa952){return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x1a1f74[_0x0b91('0x3e')]['id']}})[_0x0b91('0x17')](handleEntityNotFound(_0x2fa952,null))['then'](removeEntity(_0x2fa952,null))[_0x0b91('0x3b')](handleError(_0x2fa952,null));};exports[_0x0b91('0x3f')]=function(_0x2ea30f,_0x78e4db){if(_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x21')]===_0x0b91('0x1c')&&!_[_0x0b91('0x41')](_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')],'_')){_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')]='_'[_0x0b91('0x43')](_0x2ea30f['body']['exten']);}return db[_0x0b91('0x26')][_0x0b91('0x3f')](_0x2ea30f[_0x0b91('0x40')],{'raw':![]})['then'](function(_0x5c3cd7){var _0x1a367b=_0x2ea30f[_0x0b91('0x44')][_0x0b91('0x18')]({'plain':!![]});if(!_0x1a367b)throw new Error(_0x0b91('0x45'));if(_0x1a367b[_0x0b91('0x46')]===_0x0b91('0x44')){var _0x30b94a=_0x5c3cd7['get']({'plain':!![]});var _0x384266=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a')},{'name':_0x0b91('0x1b'),'value':'outbound'},{'name':_0x0b91('0x1d'),'value':_0x0b91('0x47')}];var _0x4f08c5=_[_0x0b91('0x22')](_0x384266,[_0x0b91('0x1f'),_0x30b94a[_0x0b91('0x21')]])[_0x0b91('0x25')];return db['UserProfileSection']['find']({'where':{'name':_0x4f08c5,'userProfileId':_0x1a367b[_0x0b91('0x48')]},'raw':!![]})[_0x0b91('0x17')](function(_0x1bfc77){if(_0x1bfc77&&_0x1bfc77[_0x0b91('0x49')]===0x0){return db[_0x0b91('0x4a')][_0x0b91('0x3f')]({'name':_0x30b94a['name'],'resourceId':_0x30b94a['id'],'type':_0x1bfc77[_0x0b91('0x25')],'sectionId':_0x1bfc77['id']},{})[_0x0b91('0x17')](function(){return _0x5c3cd7;});}else{return _0x5c3cd7;}})[_0x0b91('0x3b')](function(_0x55a664){logger[_0x0b91('0x23')](_0x0b91('0x4b'),_0x55a664);throw _0x55a664;});}return _0x5c3cd7;})[_0x0b91('0x17')](respondWithResult(_0x78e4db,0xc9))['catch'](handleError(_0x78e4db,null));};exports[_0x0b91('0x4c')]=function(_0x3229d7,_0x2b2263){if(_0x3229d7[_0x0b91('0x40')]['id']){delete _0x3229d7['body']['id'];}return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x3229d7[_0x0b91('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b2263,null))['then'](function(_0x3d5ad0){if(_0x3d5ad0){return db[_0x0b91('0x26')][_0x0b91('0x4c')](_[_0x0b91('0x34')](_0x3229d7[_0x0b91('0x40')],[_0x0b91('0x42'),'context','description',_0x0b91('0x4d'),'cutdigits',_0x0b91('0x4e'),_0x0b91('0x4f')]),{'where':{'context':_0x3d5ad0['context'],'exten':_0x3d5ad0[_0x0b91('0x42')]},'individualHooks':!![]})[_0x0b91('0x17')](function(_0x4460e6){return _0x4460e6;});}return null;})[_0x0b91('0x17')](respondWithStatusCode(_0x2b2263,null))['catch'](handleError(_0x2b2263,null));};exports[_0x0b91('0x50')]=function(_0x2f9d1b,_0x2eb38a){return db[_0x0b91('0x26')][_0x0b91('0x51')]({'where':{'id':_0x2f9d1b['params']['id']}})[_0x0b91('0x17')](function(_0x39fd3d){if(_0x39fd3d){return db[_0x0b91('0x52')][_0x0b91('0x53')](function(_0x5397df){return db['VoiceExtension'][_0x0b91('0x16')]({'where':{'VoiceExtensionId':_0x2f9d1b['params']['id']},'transaction':_0x5397df})['then'](function(){var _0x39689c=_['map'](_0x2f9d1b[_0x0b91('0x40')],function(_0x3071de){_0x3071de[_0x0b91('0x54')]=_0x2f9d1b['params']['id'];_0x3071de[_0x0b91('0x55')]=!![];return _0x3071de;});return _0x39fd3d[_0x0b91('0x56')](_0x39689c);})['then'](function(_0x224a90){console['log'](_0x0b91('0x57'),_0x224a90);return db[_0x0b91('0x26')][_0x0b91('0x58')](_0x224a90,{'transaction':_0x5397df});});})[_0x0b91('0x17')](function(){return db[_0x0b91('0x26')][_0x0b91('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f9d1b[_0x0b91('0x3e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x0b91('0x17')](respondWithResult(_0x2eb38a,null))['catch'](handleError(_0x2eb38a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 0c76184..bf5143b 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 _0x6a7a=['update','remove','emit','hook','exports','events','VoiceExtension','setMaxListeners','save'];(function(_0x56b987,_0x116c8a){var _0x1347c7=function(_0x1c6b3b){while(--_0x1c6b3b){_0x56b987['push'](_0x56b987['shift']());}};_0x1347c7(++_0x116c8a);}(_0x6a7a,0x7a));var _0xa6a7=function(_0x1e0bb9,_0x24088b){_0x1e0bb9=_0x1e0bb9-0x0;var _0x24901d=_0x6a7a[_0x1e0bb9];return _0x24901d;};'use strict';var EventEmitter=require(_0xa6a7('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa6a7('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa6a7('0x2')](0x0);var events={'afterCreate':_0xa6a7('0x3'),'afterUpdate':_0xa6a7('0x4'),'afterDestroy':_0xa6a7('0x5')};function emitEvent(_0x2faf44){return function(_0x4f0caf,_0x188886,_0x38f152){VoiceExtensionEvents[_0xa6a7('0x6')](_0x2faf44+':'+_0x4f0caf['id'],_0x4f0caf);VoiceExtensionEvents[_0xa6a7('0x6')](_0x2faf44,_0x4f0caf);_0x38f152(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa6a7('0x7')](e,emitEvent(event));}}module[_0xa6a7('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xe579=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe579,0x118));var _0x9e57=function(_0x27a740,_0x3ffe2a){_0x27a740=_0x27a740-0x0;var _0x3cf3a9=_0xe579[_0x27a740];return _0x3cf3a9;};'use strict';var EventEmitter=require(_0x9e57('0x0'));var VoiceExtension=require(_0x9e57('0x1'))['db'][_0x9e57('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9e57('0x3')](0x0);var events={'afterCreate':_0x9e57('0x4'),'afterUpdate':_0x9e57('0x5'),'afterDestroy':_0x9e57('0x6')};function emitEvent(_0x271606){return function(_0x57aee4,_0x2c0f51,_0x3562f6){VoiceExtensionEvents['emit'](_0x271606+':'+_0x57aee4['id'],_0x57aee4);VoiceExtensionEvents[_0x9e57('0x7')](_0x271606,_0x57aee4);_0x3562f6(null);};}for(var e in events){if(events[_0x9e57('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x9e57('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index af0b01f..8ddfcf8 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 _0xf50b=['indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','IntervalId','then','length','interval','intervals','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','appdata','priority','concat','define','VoiceExtension','voice_extensions','get','last','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','NoOp','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','trunk','param','split','prefix','phone','join'];(function(_0x4a30de,_0x5556f1){var _0x342ee3=function(_0x41e8ac){while(--_0x41e8ac){_0x4a30de['push'](_0x4a30de['shift']());}};_0x342ee3(++_0x5556f1);}(_0xf50b,0xc8));var _0xbf50=function(_0xde0929,_0x56047e){_0xde0929=_0xde0929-0x0;var _0x4d336b=_0xf50b[_0xde0929];return _0x4d336b;};'use strict';var _=require(_0xbf50('0x0'));var attributes=require(_0xbf50('0x1'));module['exports']=function(_0x389fbd){var _0x18c2f1=_0x389fbd[_0xbf50('0x2')];function _0x443bf8(_0x5f0c1a){var _0x32217d=0x2;var _0x4f5ba8=[{'type':_0x5f0c1a[_0xbf50('0x3')],'app':_0xbf50('0x4'),'appdata':_0xbf50('0x5')+_0x5f0c1a[_0xbf50('0x3')],'context':_0x5f0c1a[_0xbf50('0x6')],'exten':_0x5f0c1a[_0xbf50('0x7')],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']},{'type':_0x5f0c1a[_0xbf50('0x3')],'app':_0x5f0c1a['alias']?_0xbf50('0x4'):_0xbf50('0x8'),'appdata':_0x5f0c1a[_0xbf50('0x9')]?'CDR(routeAlias)='+_0x5f0c1a['alias']:_0xbf50('0xa'),'context':_0x5f0c1a[_0xbf50('0x6')],'exten':_0x5f0c1a[_0xbf50('0x7')],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']}];if(_0x5f0c1a['type']===_0xbf50('0xb')){_0x4f5ba8[_0xbf50('0xc')]({'type':_0xbf50('0xb'),'app':_0xbf50('0x4'),'appdata':_0xbf50('0xd')+_0x5f0c1a['id'],'context':_0x5f0c1a[_0xbf50('0x6')],'exten':_0x5f0c1a[_0xbf50('0x7')],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']});}_0x4f5ba8['push']({'type':_0x5f0c1a[_0xbf50('0x3')],'app':_0xbf50('0x4'),'appdata':_0xbf50('0xe'),'context':_0x5f0c1a[_0xbf50('0x6')],'exten':_0x5f0c1a[_0xbf50('0x7')],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']},{'type':_0x5f0c1a['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5f0c1a[_0xbf50('0x6')],'exten':_0x5f0c1a['exten'],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']},{'type':_0x5f0c1a[_0xbf50('0x3')],'app':_0xbf50('0x4'),'appdata':_0xbf50('0xf'),'context':_0x5f0c1a['context'],'exten':_0x5f0c1a[_0xbf50('0x7')],'priority':_0x32217d++,'VoiceExtensionId':_0x5f0c1a['id']});return _0x4f5ba8;}function _0x5be8ae(_0x13a5c9){var _0x2264a0=0x2;var _0x33495f=[{'type':'outbound','app':_0xbf50('0x4'),'appdata':_0xbf50('0x10'),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0x13a5c9['alias']?_0xbf50('0x4'):_0xbf50('0x8'),'appdata':_0x13a5c9[_0xbf50('0x9')]?_0xbf50('0x12')+_0x13a5c9[_0xbf50('0x9')]:'No\x20alias\x20set','context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0xbf50('0x4'),'appdata':_0xbf50('0x13')+(_0x13a5c9[_0xbf50('0x14')]?_0xbf50('0x15')+_0x13a5c9['cutdigits']+'}':_0xbf50('0x16')),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':'Set','appdata':_0xbf50('0xd')+_0x13a5c9['id'],'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0xbf50('0x17'),'appdata':_0xbf50('0x18')+(_0x2264a0+0x2)+'):Goto('+(_0x2264a0+0x1)+')','context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':'Set','appdata':_0x13a5c9['cutdigits']?_0xbf50('0x19')+_0x13a5c9['cutdigits']+'}':_0xbf50('0x1a'),'context':_0x13a5c9['context'],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':'outbound','app':_0xbf50('0x4'),'appdata':_0xbf50('0xe'),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0xbf50('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0xbf50('0x4'),'appdata':_0xbf50('0xf'),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':'Set','appdata':_0xbf50('0x1b')+_0x13a5c9['id'],'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']}];if(_0x13a5c9[_0xbf50('0x1c')]('recordingFormat')&&_0x13a5c9[_0xbf50('0x1d')]!==_0xbf50('0x1e')){_0x33495f[_0xbf50('0xc')]({'type':_0xbf50('0x11'),'app':_0xbf50('0x4'),'appdata':_0xbf50('0x1f'),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9[_0xbf50('0x7')],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']},{'type':_0xbf50('0x11'),'app':_0xbf50('0x4'),'appdata':_0xbf50('0x20')+_0x13a5c9['recordingFormat']||_0xbf50('0x21'),'context':_0x13a5c9[_0xbf50('0x6')],'exten':_0x13a5c9['exten'],'priority':_0x2264a0++,'VoiceExtensionId':_0x13a5c9['id']});}return _0x33495f;}function _0x37a0bf(_0x2becfc,_0x1d3740){var _0x2268c3=[{'name':'trunk','param':0x0},{'name':_0xbf50('0x22'),'param':0x1},{'name':_0xbf50('0x23'),'param':0x2},{'name':_0xbf50('0x24'),'param':0x3}];var _0x6ff880={};var _0x16ef05=_0x1d3740['split'](',');var _0x44f8b1=[];for(var _0x410d5f=0x0;_0x410d5f<_0x2268c3['length'];_0x410d5f++){switch(_0x2268c3[_0x410d5f]['name']){case _0xbf50('0x25'):_0x6ff880[_0xbf50('0x25')]=_0x16ef05[_0x2268c3[_0x410d5f][_0xbf50('0x26')]][_0xbf50('0x27')]('/')[0x1];_0x6ff880['phone']=_0x16ef05[_0x2268c3[_0x410d5f][_0xbf50('0x26')]]['split']('/')[0x2];_0x6ff880[_0xbf50('0x28')]=_0x6ff880[_0xbf50('0x29')]?_0x6ff880[_0xbf50('0x29')][_0xbf50('0x27')]('$')[0x0]:undefined;_0x6ff880[_0xbf50('0x29')]=_0x2becfc[_0xbf50('0x14')]?(_0x6ff880[_0xbf50('0x28')]||'')+_0xbf50('0x15')+_0x2becfc[_0xbf50('0x14')]+'}':(_0x6ff880[_0xbf50('0x28')]||'')+'${EXTEN}';_0x44f8b1[_0x2268c3[_0x410d5f]['param']]=['SIP',_0x6ff880[_0xbf50('0x25')],_0x6ff880['phone']][_0xbf50('0x2a')]('/');break;case'options':_0x6ff880[_0xbf50('0x23')]=_0x16ef05[_0x2268c3[_0x410d5f][_0xbf50('0x26')]];if(_0x2becfc[_0xbf50('0x1d')]!=='none'){if(_0x6ff880[_0xbf50('0x23')][_0xbf50('0x2b')](_0xbf50('0x2c'))<0x0){_0x6ff880[_0xbf50('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x6ff880[_0xbf50('0x23')]=_0x6ff880[_0xbf50('0x23')][_0xbf50('0x2d')](_0xbf50('0x2c'),'');}_0x44f8b1[_0x2268c3[_0x410d5f][_0xbf50('0x26')]]=_0x6ff880[_0xbf50('0x23')];break;default:_0x44f8b1[_0x2268c3[_0x410d5f][_0xbf50('0x26')]]=_0x16ef05[_0x2268c3[_0x410d5f][_0xbf50('0x26')]];}}return _0x44f8b1[_0xbf50('0x2a')](',');}function _0x1bf881(_0x2d2a7c,_0x3fe267,_0x275b93){return new Promise(function(_0x2fd9dc,_0x151d17){var _0x50f8ee=[];if(_[_0xbf50('0x2e')](_0x3fe267))return _0x2fd9dc(_0x50f8ee);_0x18c2f1[_0xbf50('0x2f')]['findAll']({'attributes':['id','interval',_0xbf50('0x30')],'raw':!![]})[_0xbf50('0x31')](function(_0x5cb9d8){for(var _0x398290=0x0,_0x78ce0a=0x0;_0x398290<_0x3fe267[_0xbf50('0x32')];_0x398290++,_0x78ce0a=0x0){var _0x35cb82=_0x3fe267[_0x398290];var _0x78ebbd=[];var _0x478944=[];delete _0x35cb82['id'];if(_0x35cb82[_0xbf50('0x33')]!=='*,*,*,*'){_0x35cb82[_0xbf50('0x34')]=[_0x35cb82['interval']];}else{_0x35cb82['intervals']=_0x35cb82['IntervalId']?_[_0xbf50('0x35')](_['filter'](_0x5cb9d8,{'IntervalId':_0x35cb82[_0xbf50('0x30')]}),'interval'):[];}_0x35cb82[_0xbf50('0x6')]=_0x2d2a7c[_0xbf50('0x6')];_0x35cb82[_0xbf50('0x7')]=_0x2d2a7c[_0xbf50('0x7')];if(_0x35cb82['type'])_0x35cb82[_0xbf50('0x3')]=_0x35cb82[_0xbf50('0x3')]['toLowerCase']();if(_0x2d2a7c[_0xbf50('0x3')]===_0xbf50('0x11')){if(_0x35cb82[_0xbf50('0x1c')](_0xbf50('0x36'))&&_0x35cb82[_0xbf50('0x36')]&&_0x35cb82[_0xbf50('0x36')]!=='--'){_0x78ebbd['push']({'type':_0x35cb82['type'][_0xbf50('0x37')](),'app':_0xbf50('0x4'),'appdata':'CDR(tag)='+_0x35cb82['tag'],'context':_0x2d2a7c['context'],'exten':_0x2d2a7c['exten'],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});}_0x78ebbd['push']({'type':_0x35cb82[_0xbf50('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0xbf50('0x38')+(_0x35cb82[_0xbf50('0x39')]?_0xbf50('0x3a')+_0x35cb82['callerID']+')':_0xbf50('0x3b')),'context':_0x2d2a7c['context'],'exten':_0x2d2a7c[_0xbf50('0x7')],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});}else{if(_0x35cb82[_0xbf50('0x1c')](_0xbf50('0x3c'))){if([_0xbf50('0x3d'),_0xbf50('0x3e')]['includes'](_0x35cb82[_0xbf50('0x3f')][_0xbf50('0x37')]())&&_0x35cb82['appType']!==_0xbf50('0x40')){if(_0x35cb82[_0xbf50('0x3c')]){_0x78ebbd[_0xbf50('0xc')]({'type':_0x35cb82[_0xbf50('0x3')][_0xbf50('0x37')](),'app':'ExecIf','appdata':_0xbf50('0x41'),'context':_0x2d2a7c[_0xbf50('0x6')],'exten':_0x2d2a7c[_0xbf50('0x7')],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});_0x78ebbd[_0xbf50('0xc')]({'type':_0x35cb82[_0xbf50('0x3')][_0xbf50('0x37')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2d2a7c[_0xbf50('0x6')],'exten':_0x2d2a7c[_0xbf50('0x7')],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});}else{_0x78ebbd[_0xbf50('0xc')]({'type':_0x35cb82[_0xbf50('0x3')][_0xbf50('0x37')](),'app':_0xbf50('0x17'),'appdata':_0xbf50('0x42'),'context':_0x2d2a7c['context'],'exten':_0x2d2a7c[_0xbf50('0x7')],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});_0x78ebbd[_0xbf50('0xc')]({'type':_0x35cb82[_0xbf50('0x3')]['toLowerCase'](),'app':_0xbf50('0x4'),'appdata':_0xbf50('0x43'),'context':_0x2d2a7c[_0xbf50('0x6')],'exten':_0x2d2a7c[_0xbf50('0x7')],'priority':_0x35cb82[_0xbf50('0x34')][_0xbf50('0x32')]+_0x275b93+_0x78ce0a++,'VoiceExtensionId':_0x2d2a7c['id']});}}}}for(var _0x21301b=0x0;_0x21301b<_0x35cb82['intervals']['length'];_0x21301b++){var _0x2c9851=_0x275b93+_0x35cb82[_0xbf50('0x34')]['length'];var _0x30b47a=_0x21301b===_0x35cb82['intervals']['length']-0x1?_0x275b93+_0x78ebbd[_0xbf50('0x32')]+_0x478944[_0xbf50('0x32')]+0x2:_0x275b93+_0x21301b+0x1;_0x78ebbd[_0xbf50('0x44')](_0x21301b,0x0,{'type':_0x2d2a7c[_0xbf50('0x3')],'app':_0xbf50('0x45'),'appdata':_0x35cb82[_0xbf50('0x34')][_0x21301b]+'?'+_0x2d2a7c[_0xbf50('0x6')]+',${EXTEN},'+_0x2c9851+':'+_0x2d2a7c[_0xbf50('0x6')]+_0xbf50('0x46')+_0x30b47a,'exten':_0x2d2a7c[_0xbf50('0x7')],'context':_0x2d2a7c[_0xbf50('0x6')],'priority':_0x275b93+_0x21301b,'VoiceExtensionId':_0x2d2a7c['id']});}if(_0x35cb82[_0xbf50('0x47')]==='outboundDial')_0x35cb82[_0xbf50('0x48')]=_0x37a0bf(_0x2d2a7c,_0x35cb82[_0xbf50('0x48')]);_0x35cb82[_0xbf50('0x49')]=_0x78ebbd[_0xbf50('0x32')]?_['last'](_0x78ebbd)[_0xbf50('0x49')]+0x1:_0x275b93;_0x50f8ee=_[_0xbf50('0x4a')](_0x50f8ee,_0x78ebbd,[_0x35cb82],_0x478944);_0x275b93=_['last'](_0x50f8ee)[_0xbf50('0x49')]+0x1;}return _0x2fd9dc(_0x50f8ee);})['catch'](function(_0x2cb4f8){_0x151d17(_0x2cb4f8);});});}return _0x389fbd[_0xbf50('0x4b')](_0xbf50('0x4c'),attributes,{'tableName':_0xbf50('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x465a27){var _0x576916=this[_0xbf50('0x4e')]({'plain':!![]});var _0x2460da=_0x576916[_0xbf50('0x3')]===_0xbf50('0x11')?_0x5be8ae(_0x576916):_0x443bf8(_0x576916);return _0x1bf881(_0x576916,_0x465a27,_[_0xbf50('0x4f')](_0x2460da)[_0xbf50('0x49')]+0x1)[_0xbf50('0x31')](function(_0x1eef49){var _0x47f63f=_['concat'](_0x2460da,_0x1eef49);_0x47f63f[_0xbf50('0xc')]({'type':_0x576916['type'],'app':_0xbf50('0x50'),'exten':_0x576916[_0xbf50('0x7')],'context':_0x576916[_0xbf50('0x6')],'priority':_[_0xbf50('0x4f')](_0x47f63f)['priority']+0x1,'VoiceExtensionId':_0x576916['id']});return _0x47f63f;});}}});}; \ No newline at end of file +var _0xe8cb=['indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','includes','toLowerCase','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','phone','param','prefix','${EXTEN}','join'];(function(_0x33a2f9,_0x5bc81e){var _0x2c595c=function(_0x29a7d3){while(--_0x29a7d3){_0x33a2f9['push'](_0x33a2f9['shift']());}};_0x2c595c(++_0x5bc81e);}(_0xe8cb,0x11a));var _0xbe8c=function(_0x2adf7f,_0xd8c06a){_0x2adf7f=_0x2adf7f-0x0;var _0x5d86b4=_0xe8cb[_0x2adf7f];return _0x5d86b4;};'use strict';var _=require(_0xbe8c('0x0'));var attributes=require(_0xbe8c('0x1'));module[_0xbe8c('0x2')]=function(_0x554340){var _0x525404=_0x554340[_0xbe8c('0x3')];function _0x482715(_0x4d712a){var _0x5e57a5=0x2;var _0x248e82=[{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x6')+_0x4d712a[_0xbe8c('0x4')],'context':_0x4d712a['context'],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0x4d712a[_0xbe8c('0x8')]?_0xbe8c('0x5'):_0xbe8c('0x9'),'appdata':_0x4d712a[_0xbe8c('0x8')]?'CDR(routeAlias)='+_0x4d712a[_0xbe8c('0x8')]:_0xbe8c('0xa'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']}];if(_0x4d712a[_0xbe8c('0x4')]===_0xbe8c('0xc')){_0x248e82[_0xbe8c('0xd')]({'type':_0xbe8c('0xc'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xe')+_0x4d712a['id'],'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']});}_0x248e82[_0xbe8c('0xd')]({'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xf'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x10'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a['type'],'app':_0xbe8c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d712a['context'],'exten':_0x4d712a['exten'],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']});return _0x248e82;}function _0x259ba3(_0x52064d){var _0x6528d5=0x2;var _0x30143f=[{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x12'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':'outbound','app':_0x52064d['alias']?_0xbe8c('0x5'):'NoOp','appdata':_0x52064d['alias']?_0xbe8c('0x13')+_0x52064d['alias']:'No\x20alias\x20set','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x52064d['cutdigits']?'${EXTEN:'+_0x52064d[_0xbe8c('0x14')]+'}':'${EXTEN}'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':'CDR(routeid)='+_0x52064d['id'],'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x15'),'appdata':_0xbe8c('0x16')+(_0x6528d5+0x2)+_0xbe8c('0x17')+(_0x6528d5+0x1)+')','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0x52064d[_0xbe8c('0x14')]?_0xbe8c('0x18')+_0x52064d[_0xbe8c('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xf'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x10'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x52064d['context'],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':'Set','appdata':_0xbe8c('0x19')+_0x52064d['id'],'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']}];if(_0x52064d['hasOwnProperty'](_0xbe8c('0x1a'))&&_0x52064d[_0xbe8c('0x1a')]!==_0xbe8c('0x1b')){_0x30143f[_0xbe8c('0xd')]({'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x1c'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x1d')+_0x52064d[_0xbe8c('0x1a')]||_0xbe8c('0x1e'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']});}return _0x30143f;}function _0x1ffc42(_0x19aed0,_0xb779f2){var _0x1e4965=[{'name':_0xbe8c('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xbe8c('0x20'),'param':0x2},{'name':_0xbe8c('0x21'),'param':0x3}];var _0xab7d2a={};var _0x3971f5=_0xb779f2[_0xbe8c('0x22')](',');var _0x9c25b=[];for(var _0x5ef717=0x0;_0x5ef717<_0x1e4965[_0xbe8c('0x23')];_0x5ef717++){switch(_0x1e4965[_0x5ef717][_0xbe8c('0x24')]){case _0xbe8c('0x1f'):_0xab7d2a[_0xbe8c('0x1f')]=_0x3971f5[_0x1e4965[_0x5ef717]['param']][_0xbe8c('0x22')]('/')[0x1];_0xab7d2a[_0xbe8c('0x25')]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]][_0xbe8c('0x22')]('/')[0x2];_0xab7d2a[_0xbe8c('0x27')]=_0xab7d2a[_0xbe8c('0x25')]?_0xab7d2a[_0xbe8c('0x25')][_0xbe8c('0x22')]('$')[0x0]:undefined;_0xab7d2a[_0xbe8c('0x25')]=_0x19aed0[_0xbe8c('0x14')]?(_0xab7d2a[_0xbe8c('0x27')]||'')+'${EXTEN:'+_0x19aed0[_0xbe8c('0x14')]+'}':(_0xab7d2a[_0xbe8c('0x27')]||'')+_0xbe8c('0x28');_0x9c25b[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]]=['SIP',_0xab7d2a['trunk'],_0xab7d2a[_0xbe8c('0x25')]][_0xbe8c('0x29')]('/');break;case'options':_0xab7d2a[_0xbe8c('0x20')]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]];if(_0x19aed0['recordingFormat']!==_0xbe8c('0x1b')){if(_0xab7d2a['options'][_0xbe8c('0x2a')](_0xbe8c('0x2b'))<0x0){_0xab7d2a['options']+=_0xbe8c('0x2b');}}else{_0xab7d2a[_0xbe8c('0x20')]=_0xab7d2a[_0xbe8c('0x20')][_0xbe8c('0x2c')](_0xbe8c('0x2b'),'');}_0x9c25b[_0x1e4965[_0x5ef717]['param']]=_0xab7d2a[_0xbe8c('0x20')];break;default:_0x9c25b[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]];}}return _0x9c25b['join'](',');}function _0x45dcda(_0x167293,_0x3b0848,_0x1074ec){return new Promise(function(_0x2e3890,_0x1edbb4){var _0x2f5bfb=[];if(_['isEmpty'](_0x3b0848))return _0x2e3890(_0x2f5bfb);_0x525404[_0xbe8c('0x2d')]['findAll']({'attributes':['id',_0xbe8c('0x2e'),_0xbe8c('0x2f')],'raw':!![]})[_0xbe8c('0x30')](function(_0x17d0ae){for(var _0x78ff45=0x0,_0x41c99d=0x0;_0x78ff45<_0x3b0848[_0xbe8c('0x23')];_0x78ff45++,_0x41c99d=0x0){var _0x2c6e62=_0x3b0848[_0x78ff45];var _0x35cec9=[];var _0x23bfa3=[];delete _0x2c6e62['id'];if(_0x2c6e62[_0xbe8c('0x2e')]!==_0xbe8c('0x31')){_0x2c6e62['intervals']=[_0x2c6e62['interval']];}else{_0x2c6e62[_0xbe8c('0x32')]=_0x2c6e62[_0xbe8c('0x2f')]?_[_0xbe8c('0x33')](_[_0xbe8c('0x34')](_0x17d0ae,{'IntervalId':_0x2c6e62[_0xbe8c('0x2f')]}),_0xbe8c('0x2e')):[];}_0x2c6e62[_0xbe8c('0xb')]=_0x167293[_0xbe8c('0xb')];_0x2c6e62[_0xbe8c('0x7')]=_0x167293[_0xbe8c('0x7')];if(_0x2c6e62[_0xbe8c('0x4')])_0x2c6e62[_0xbe8c('0x4')]=_0x2c6e62['type']['toLowerCase']();if(_0x167293[_0xbe8c('0x4')]==='outbound'){if(_0x2c6e62['hasOwnProperty'](_0xbe8c('0x35'))&&_0x2c6e62[_0xbe8c('0x35')]&&_0x2c6e62[_0xbe8c('0x35')]!=='--'){_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')]['toLowerCase'](),'app':_0xbe8c('0x5'),'appdata':'CDR(tag)='+_0x2c6e62[_0xbe8c('0x35')],'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293['exten'],'priority':_0x2c6e62[_0xbe8c('0x32')]['length']+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}_0x35cec9['push']({'type':_0x2c6e62[_0xbe8c('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xbe8c('0x36')+(_0x2c6e62[_0xbe8c('0x37')]?'Set(CALLERID(all)='+_0x2c6e62[_0xbe8c('0x37')]+')':_0xbe8c('0x38')),'context':_0x167293['context'],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')]['length']+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}else{if(_0x2c6e62[_0xbe8c('0x39')](_0xbe8c('0x3a'))){if([_0xbe8c('0x3b'),_0xbe8c('0x3c')][_0xbe8c('0x3d')](_0x2c6e62['app'][_0xbe8c('0x3e')]())&&_0x2c6e62['appType']!==_0xbe8c('0x3f')){if(_0x2c6e62[_0xbe8c('0x3a')]){_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62['type'][_0xbe8c('0x3e')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':'Set','appdata':_0xbe8c('0x40'),'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}else{_0x35cec9['push']({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':'ExecIf','appdata':_0xbe8c('0x41'),'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x42'),'context':_0x167293['context'],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}}}}for(var _0x5a892b=0x0;_0x5a892b<_0x2c6e62['intervals'][_0xbe8c('0x23')];_0x5a892b++){var _0x32b462=_0x1074ec+_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')];var _0xc7565a=_0x5a892b===_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]-0x1?_0x1074ec+_0x35cec9[_0xbe8c('0x23')]+_0x23bfa3[_0xbe8c('0x23')]+0x2:_0x1074ec+_0x5a892b+0x1;_0x35cec9[_0xbe8c('0x43')](_0x5a892b,0x0,{'type':_0x167293[_0xbe8c('0x4')],'app':_0xbe8c('0x44'),'appdata':_0x2c6e62['intervals'][_0x5a892b]+'?'+_0x167293[_0xbe8c('0xb')]+_0xbe8c('0x45')+_0x32b462+':'+_0x167293[_0xbe8c('0xb')]+_0xbe8c('0x45')+_0xc7565a,'exten':_0x167293['exten'],'context':_0x167293['context'],'priority':_0x1074ec+_0x5a892b,'VoiceExtensionId':_0x167293['id']});}if(_0x2c6e62[_0xbe8c('0x46')]===_0xbe8c('0x47'))_0x2c6e62[_0xbe8c('0x48')]=_0x1ffc42(_0x167293,_0x2c6e62['appdata']);_0x2c6e62['priority']=_0x35cec9[_0xbe8c('0x23')]?_['last'](_0x35cec9)[_0xbe8c('0x49')]+0x1:_0x1074ec;_0x2f5bfb=_[_0xbe8c('0x4a')](_0x2f5bfb,_0x35cec9,[_0x2c6e62],_0x23bfa3);_0x1074ec=_[_0xbe8c('0x4b')](_0x2f5bfb)[_0xbe8c('0x49')]+0x1;}return _0x2e3890(_0x2f5bfb);})[_0xbe8c('0x4c')](function(_0x1e6592){_0x1edbb4(_0x1e6592);});});}return _0x554340[_0xbe8c('0x4d')](_0xbe8c('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4c2957){var _0x5d4690=this[_0xbe8c('0x4f')]({'plain':!![]});var _0x2f0308=_0x5d4690[_0xbe8c('0x4')]===_0xbe8c('0x11')?_0x259ba3(_0x5d4690):_0x482715(_0x5d4690);return _0x45dcda(_0x5d4690,_0x4c2957,_[_0xbe8c('0x4b')](_0x2f0308)['priority']+0x1)[_0xbe8c('0x30')](function(_0x9f38e7){var _0x4c8bcb=_['concat'](_0x2f0308,_0x9f38e7);_0x4c8bcb[_0xbe8c('0xd')]({'type':_0x5d4690['type'],'app':_0xbe8c('0x50'),'exten':_0x5d4690[_0xbe8c('0x7')],'context':_0x5d4690['context'],'priority':_[_0xbe8c('0x4b')](_0x4c8bcb)[_0xbe8c('0x49')]+0x1,'VoiceExtensionId':_0x5d4690['id']});return _0x4c8bcb;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 39a4e56..f61c526 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 _0x56a4=['model','stringify','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension','raw','options','limit','include','map','attributes'];(function(_0x1c7d93,_0x3c5644){var _0x2b51aa=function(_0x5c0d10){while(--_0x5c0d10){_0x1c7d93['push'](_0x1c7d93['shift']());}};_0x2b51aa(++_0x3c5644);}(_0x56a4,0x11b));var _0x456a=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x56a4[_0x2338fa];return _0x42df9b;};'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});config['redis']=_['defaults'](config[_0x456a('0xa')],{'host':_0x456a('0xb'),'port':0x18eb});var socket=require(_0x456a('0xc'))(new Redis(config['redis']));require(_0x456a('0xd'))['register'](socket);function respondWithRpcPromise(_0xb56df,_0x29073f,_0x3bb712){return new BPromise(function(_0x3b57ac,_0x2706a7){return client[_0x456a('0xe')](_0xb56df,_0x3bb712)[_0x456a('0xf')](function(_0xe60506){logger[_0x456a('0x10')](_0x456a('0x11'),_0x29073f,_0x456a('0x12'));logger['debug'](_0x456a('0x13'),_0x29073f,'request\x20sent',JSON['stringify'](_0xe60506));if(_0xe60506[_0x456a('0x14')]){if(_0xe60506[_0x456a('0x14')][_0x456a('0x15')]===0x1f4){logger[_0x456a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);return _0x2706a7(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}logger[_0x456a('0x14')](_0x456a('0x11'),_0x29073f,_0xe60506['error'][_0x456a('0x16')]);return _0x3b57ac(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}else{logger[_0x456a('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0x456a('0x12'));_0x3b57ac(_0xe60506[_0x456a('0x17')][_0x456a('0x16')]);}})['catch'](function(_0x3d06b4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0x3d06b4);_0x2706a7(_0x3d06b4);});});}exports[_0x456a('0x18')]=function(_0x562cfa){var _0x44d79a=this;return new Promise(function(_0x4b48bf,_0x962b6d){return db[_0x456a('0x19')]['findAll']({'raw':_0x562cfa['options']?_0x562cfa['options'][_0x456a('0x1a')]===undefined?!![]:![]:!![],'where':_0x562cfa[_0x456a('0x1b')]?_0x562cfa[_0x456a('0x1b')]['where']||null:null,'attributes':_0x562cfa[_0x456a('0x1b')]?_0x562cfa['options']['attributes']||null:null,'limit':_0x562cfa['options']?_0x562cfa[_0x456a('0x1b')][_0x456a('0x1c')]||null:null,'include':_0x562cfa[_0x456a('0x1b')]?_0x562cfa['options'][_0x456a('0x1d')]?_[_0x456a('0x1e')](_0x562cfa['options'][_0x456a('0x1d')],function(_0x561097){return{'model':db[_0x561097['model']],'as':_0x561097['as'],'attributes':_0x561097[_0x456a('0x1f')],'include':_0x561097['include']?_[_0x456a('0x1e')](_0x561097['include'],function(_0x1ee212){return{'model':db[_0x1ee212[_0x456a('0x20')]],'as':_0x1ee212['as'],'attributes':_0x1ee212[_0x456a('0x1f')],'include':_0x1ee212[_0x456a('0x1d')]?_[_0x456a('0x1e')](_0x1ee212[_0x456a('0x1d')],function(_0x46f3b3){return{'model':db[_0x46f3b3[_0x456a('0x20')]],'as':_0x46f3b3['as'],'attributes':_0x46f3b3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48205d){logger[_0x456a('0x10')](_0x456a('0x18'),_0x562cfa);logger['debug'](_0x456a('0x18'),_0x562cfa,JSON[_0x456a('0x21')](_0x48205d));_0x4b48bf(_0x48205d);})[_0x456a('0x22')](function(_0x336993){logger[_0x456a('0x14')]('GetVoiceExtension',_0x336993[_0x456a('0x16')],_0x562cfa);_0x962b6d(_0x44d79a[_0x456a('0x14')](0x1f4,_0x336993[_0x456a('0x16')]));});});}; \ No newline at end of file +var _0xacd6=['info','catch','GetVoiceExtension','findAll','options','where','limit','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5e48f8,_0x54ea70){var _0x15f1da=function(_0x2ae67f){while(--_0x2ae67f){_0x5e48f8['push'](_0x5e48f8['shift']());}};_0x15f1da(++_0x54ea70);}(_0xacd6,0xef));var _0x6acd=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xacd6[_0x3fb030];return _0xd6899b;};'use strict';var _=require(_0x6acd('0x0'));var util=require(_0x6acd('0x1'));var moment=require(_0x6acd('0x2'));var BPromise=require(_0x6acd('0x3'));var rs=require(_0x6acd('0x4'));var fs=require('fs');var Redis=require(_0x6acd('0x5'));var db=require(_0x6acd('0x6'))['db'];var utils=require(_0x6acd('0x7'));var logger=require(_0x6acd('0x8'))(_0x6acd('0x9'));var config=require(_0x6acd('0xa'));var jayson=require(_0x6acd('0xb'));var client=jayson['client'][_0x6acd('0xc')]({'port':0x232a});config[_0x6acd('0xd')]=_[_0x6acd('0xe')](config[_0x6acd('0xd')],{'host':_0x6acd('0xf'),'port':0x18eb});var socket=require(_0x6acd('0x10'))(new Redis(config[_0x6acd('0xd')]));require(_0x6acd('0x11'))['register'](socket);function respondWithRpcPromise(_0x35c08d,_0x20deb7,_0x211c33){return new BPromise(function(_0x3d827b,_0x1352cb){return client[_0x6acd('0x12')](_0x35c08d,_0x211c33)[_0x6acd('0x13')](function(_0x5670cc){logger['info'](_0x6acd('0x14'),_0x20deb7,_0x6acd('0x15'));logger[_0x6acd('0x16')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x20deb7,_0x6acd('0x15'),JSON[_0x6acd('0x17')](_0x5670cc));if(_0x5670cc[_0x6acd('0x18')]){if(_0x5670cc[_0x6acd('0x18')][_0x6acd('0x19')]===0x1f4){logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x5670cc[_0x6acd('0x18')]['message']);return _0x1352cb(_0x5670cc[_0x6acd('0x18')][_0x6acd('0x1a')]);}logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x5670cc[_0x6acd('0x18')]['message']);return _0x3d827b(_0x5670cc['error'][_0x6acd('0x1a')]);}else{logger[_0x6acd('0x1b')]('VoiceExtension,\x20%s,\x20%s',_0x20deb7,_0x6acd('0x15'));_0x3d827b(_0x5670cc['result'][_0x6acd('0x1a')]);}})[_0x6acd('0x1c')](function(_0x21192e){logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x21192e);_0x1352cb(_0x21192e);});});}exports[_0x6acd('0x1d')]=function(_0x2c53b8){var _0x3b5ab2=this;return new Promise(function(_0x595592,_0x3d5a6a){return db['VoiceExtension'][_0x6acd('0x1e')]({'raw':_0x2c53b8[_0x6acd('0x1f')]?_0x2c53b8[_0x6acd('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x20')]||null:null,'attributes':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')]['attributes']||null:null,'limit':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x21')]||null:null,'include':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')]['include']?_[_0x6acd('0x22')](_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x23')],function(_0x48ce7b){return{'model':db[_0x48ce7b[_0x6acd('0x24')]],'as':_0x48ce7b['as'],'attributes':_0x48ce7b[_0x6acd('0x25')],'include':_0x48ce7b[_0x6acd('0x23')]?_[_0x6acd('0x22')](_0x48ce7b[_0x6acd('0x23')],function(_0x29a6d9){return{'model':db[_0x29a6d9[_0x6acd('0x24')]],'as':_0x29a6d9['as'],'attributes':_0x29a6d9['attributes'],'include':_0x29a6d9[_0x6acd('0x23')]?_[_0x6acd('0x22')](_0x29a6d9['include'],function(_0x229269){return{'model':db[_0x229269['model']],'as':_0x229269['as'],'attributes':_0x229269['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ff700){logger[_0x6acd('0x1b')](_0x6acd('0x1d'),_0x2c53b8);logger['debug']('GetVoiceExtension',_0x2c53b8,JSON[_0x6acd('0x17')](_0x1ff700));_0x595592(_0x1ff700);})[_0x6acd('0x1c')](function(_0x4ce355){logger[_0x6acd('0x18')](_0x6acd('0x1d'),_0x4ce355['message'],_0x2c53b8);_0x3d5a6a(_0x3b5ab2[_0x6acd('0x18')](0x1f4,_0x4ce355[_0x6acd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 17d8259..4e0b0ce 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x13c241,_0x1aa643){var _0x12ab87=function(_0x212037){while(--_0x212037){_0x13c241['push'](_0x13c241['shift']());}};_0x12ab87(++_0x1aa643);}(_0x326f,0xd1));var _0xf326=function(_0x3032fd,_0x5944e7){_0x3032fd=_0x3032fd-0x0;var _0x7a0d4e=_0x326f[_0x3032fd];return _0x7a0d4e;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x564b6b,_0x59c3a0){var _0x3dab45=function(_0x2d85d4){while(--_0x2d85d4){_0x564b6b['push'](_0x564b6b['shift']());}};_0x3dab45(++_0x59c3a0);}(_0x1261,0x144));var _0x1126=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x1261[_0x2af29a];return _0x5ef02f;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f243e30..1a68a61 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 _0x323f=['show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id'];(function(_0x544093,_0x2386d4){var _0x5c6cbe=function(_0x1fc84d){while(--_0x1fc84d){_0x544093['push'](_0x544093['shift']());}};_0x5c6cbe(++_0x2386d4);}(_0x323f,0x1ee));var _0xf323=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x323f[_0x618414];return _0x21c19a;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0x9')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0xf')]('/',auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);router[_0xf323('0x13')](_0xf323('0xb'),auth['isAuthenticated'](),controller[_0xf323('0x14')]);module[_0xf323('0x15')]=router; \ No newline at end of file +var _0xa6b0=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x88923f,_0x7c090c){var _0x5a5dda=function(_0x4d1539){while(--_0x4d1539){_0x88923f['push'](_0x88923f['shift']());}};_0x5a5dda(++_0x7c090c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x219653,_0x4f09a6){_0x219653=_0x219653-0x0;var _0x3f96e2=_0xa6b0[_0x219653];return _0x3f96e2;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0a6b('0xe')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);module[_0x0a6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 3d61c3f..c389b3e 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 _0x5f21=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','STRING','from-voicemail','contest_mailbox'];(function(_0x51304a,_0x59885b){var _0x528982=function(_0x58ec7b){while(--_0x58ec7b){_0x51304a['push'](_0x51304a['shift']());}};_0x528982(++_0x59885b);}(_0x5f21,0x96));var _0x15f2=function(_0x46fc6c,_0x297637){_0x46fc6c=_0x46fc6c-0x0;var _0x18694f=_0x5f21[_0x46fc6c];return _0x18694f;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x15f2('0x0')],'defaultValue':_0x15f2('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x15f2('0x0')],'defaultValue':'','allowNull':![],'unique':_0x15f2('0x2')},'password':{'type':Sequelize[_0x15f2('0x0')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x15f2('0x0')],'validate':{'isEmail':!![]},'set':function(_0x1939b3){this[_0x15f2('0x3')](_0x15f2('0x4'),typeof _0x1939b3===_0x15f2('0x5')&&_0x1939b3['trim']()?_0x1939b3[_0x15f2('0x6')]():null);}},'pager':{'type':Sequelize[_0x15f2('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x15f2('0x7')},'attach':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':_0x15f2('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':_0x15f2('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x15f2('0x0')]},'callback':{'type':Sequelize[_0x15f2('0x0')]},'review':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x15f2('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x15f2('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x15f2('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x15f2('0x8')](_0x15f2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x15f2('0x9'),'no'),'defaultValue':_0x15f2('0x9'),'allowNull':![]},'stamp':{'type':_0x15f2('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x15f2('0x0')]},'maxsecs':{'type':Sequelize[_0x15f2('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x15f2('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x15f2('0xd')],'get':function(){return this['getDataValue'](_0x15f2('0xe'))+'\x20-\x20'+this[_0x15f2('0xf')](_0x15f2('0x10'));}}}; \ No newline at end of file +var _0xe13c=['INTEGER','VIRTUAL','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xe13c,0x164));var _0xce13=function(_0x47aadb,_0x5e07cc){_0x47aadb=_0x47aadb-0x0;var _0x1880bf=_0xe13c[_0x47aadb];return _0x1880bf;};'use strict';var Sequelize=require(_0xce13('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xce13('0x1')],'defaultValue':_0xce13('0x2'),'unique':_0xce13('0x3')},'mailbox':{'type':Sequelize[_0xce13('0x1')],'defaultValue':'','allowNull':![],'unique':_0xce13('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xce13('0x1')]},'email':{'type':Sequelize[_0xce13('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2b162b){this[_0xce13('0x4')](_0xce13('0x5'),typeof _0x2b162b===_0xce13('0x6')&&_0x2b162b[_0xce13('0x7')]()?_0x2b162b['trim']():null);}},'pager':{'type':Sequelize[_0xce13('0x1')]},'tz':{'type':Sequelize[_0xce13('0x1')],'defaultValue':_0xce13('0x8')},'attach':{'type':Sequelize[_0xce13('0x9')]('yes','no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xce13('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xce13('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xce13('0xb')},'emailsubject':{'type':Sequelize[_0xce13('0x1')]},'emailbody':{'type':Sequelize[_0xce13('0x1')]},'maxsecs':{'type':Sequelize[_0xce13('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xce13('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xce13('0xd')],'get':function(){return this['getDataValue']('fullname')+_0xce13('0xe')+this['getDataValue'](_0xce13('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4b244c2..0cfc2b6 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 _0x9c00=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','Voicemails','UserProfileResource','then','stack'];(function(_0x18f751,_0x3a52c6){var _0x2002ff=function(_0x4bbf65){while(--_0x4bbf65){_0x18f751['push'](_0x18f751['shift']());}};_0x2002ff(++_0x3a52c6);}(_0x9c00,0x1a0));var _0x09c0=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0x9c00[_0x28509b];return _0x1e0b6;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){var _0x42ebfc=_0x1e8a1c[_0x09c0('0x27')]({'plain':!![]});var _0x56d883=_0x09c0('0x28');return db[_0x09c0('0x29')][_0x09c0('0x26')]({'where':{'type':_0x56d883,'resourceId':_0x42ebfc['id']}})[_0x09c0('0x2a')](function(){return _0x1e8a1c;});})[_0x09c0('0x2a')](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x35b61c,_0x1ea951){return function(_0x1aa80e){if(!_0x1aa80e){_0x35b61c[_0x09c0('0x1b')](0x194);}return _0x1aa80e;};}function handleError(_0x5e53ac,_0x15a667){_0x15a667=_0x15a667||0x1f4;return function(_0x1bdde9){logger['error'](_0x1bdde9[_0x09c0('0x2b')]);if(_0x1bdde9['name']){delete _0x1bdde9[_0x09c0('0x2c')];}_0x5e53ac['status'](_0x15a667)[_0x09c0('0x2d')](_0x1bdde9);};}exports[_0x09c0('0x2e')]=function(_0x108409,_0x4159bc){var _0x4e999a={},_0x5478b7={},_0x17c374={'count':0x0,'rows':[]};var _0x38a315=_[_0x09c0('0x2f')](db['VoiceMail'][_0x09c0('0x30')],function(_0x4bdae9){return{'name':_0x4bdae9[_0x09c0('0x31')],'type':_0x4bdae9[_0x09c0('0x32')][_0x09c0('0x33')]};});_0x5478b7['model']=_[_0x09c0('0x2f')](_0x38a315,_0x09c0('0x2c'));_0x5478b7[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x108409[_0x09c0('0x34')]);_0x5478b7[_0x09c0('0x36')]=_[_0x09c0('0x37')](_0x5478b7['model'],_0x5478b7[_0x09c0('0x34')]);_0x4e999a[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x5478b7[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x108409['query'][_0x09c0('0x3a')]));_0x4e999a[_0x09c0('0x38')]=_0x4e999a[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x4e999a[_0x09c0('0x38')]:_0x5478b7['model'];if(!_0x108409[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x4e999a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x108409[_0x09c0('0x34')][_0x09c0('0x20')]);_0x4e999a['offset']=qs[_0x09c0('0x3e')](_0x108409[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x4e999a[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x108409['query']['sort']);_0x4e999a['where']=qs['filters'](_[_0x09c0('0x41')](_0x108409[_0x09c0('0x34')],_0x5478b7[_0x09c0('0x36')]),_0x38a315);if(_0x108409[_0x09c0('0x34')][_0x09c0('0x42')]){_0x4e999a['where']=_[_0x09c0('0x43')](_0x4e999a[_0x09c0('0x44')],{'$or':_['map'](_0x38a315,function(_0x1067cf){if(_0x1067cf['type']!==_0x09c0('0x45')){var _0x5c80a2={};_0x5c80a2[_0x1067cf[_0x09c0('0x2c')]]={'$like':'%'+_0x108409[_0x09c0('0x34')]['filter']+'%'};return _0x5c80a2;}})});}_0x4e999a=_[_0x09c0('0x43')]({},_0x4e999a,_0x108409[_0x09c0('0x46')]);var _0x5d69fd={'where':_0x4e999a[_0x09c0('0x44')]};return db[_0x09c0('0x47')][_0x09c0('0x21')](_0x5d69fd)[_0x09c0('0x2a')](function(_0xeb8191){_0x17c374[_0x09c0('0x21')]=_0xeb8191;if(_0x108409['query'][_0x09c0('0x48')]){_0x4e999a[_0x09c0('0x49')]=[{'all':!![]}];}return db[_0x09c0('0x47')]['findAll'](_0x4e999a);})[_0x09c0('0x2a')](function(_0x30c0c5){_0x17c374[_0x09c0('0x4a')]=_0x30c0c5;return _0x17c374;})['then'](respondWithFilteredResult(_0x4159bc,_0x4e999a))[_0x09c0('0x4b')](handleError(_0x4159bc,null));};exports[_0x09c0('0x4c')]=function(_0x52cd5c,_0x5bbf4e){var _0x397e73={'raw':!![],'where':{'id':_0x52cd5c['params']['id']}},_0x471078={};_0x471078[_0x09c0('0x39')]=_[_0x09c0('0x35')](db['VoiceMail'][_0x09c0('0x30')]);_0x471078[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x52cd5c[_0x09c0('0x34')]);_0x471078[_0x09c0('0x36')]=_['intersection'](_0x471078[_0x09c0('0x39')],_0x471078['query']);_0x397e73['attributes']=_[_0x09c0('0x37')](_0x471078[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x3a')]));_0x397e73[_0x09c0('0x38')]=_0x397e73['attributes']['length']?_0x397e73['attributes']:_0x471078[_0x09c0('0x39')];if(_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x48')]){_0x397e73['include']=[{'all':!![]}];}_0x397e73=_[_0x09c0('0x43')]({},_0x397e73,_0x52cd5c[_0x09c0('0x46')]);return db[_0x09c0('0x47')][_0x09c0('0x4d')](_0x397e73)[_0x09c0('0x2a')](handleEntityNotFound(_0x5bbf4e,null))[_0x09c0('0x2a')](respondWithResult(_0x5bbf4e,null))[_0x09c0('0x4b')](handleError(_0x5bbf4e,null));};exports[_0x09c0('0x4e')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x47')][_0x09c0('0x4e')](_0x3f6d14[_0x09c0('0x4f')],{})[_0x09c0('0x2a')](function(_0x332b69){var _0x32abbe=_0x3f6d14[_0x09c0('0x50')][_0x09c0('0x27')]({'plain':!![]});if(!_0x32abbe)throw new Error(_0x09c0('0x51'));if(_0x32abbe[_0x09c0('0x52')]==='user'){var _0x4acf54=_0x332b69[_0x09c0('0x27')]({'plain':!![]});var _0x15b0a2=_0x09c0('0x28');return db[_0x09c0('0x53')]['find']({'where':{'name':_0x15b0a2,'userProfileId':_0x32abbe[_0x09c0('0x54')]},'raw':!![]})[_0x09c0('0x2a')](function(_0x1823c2){if(_0x1823c2&&_0x1823c2['autoAssociation']===0x0){return db[_0x09c0('0x29')][_0x09c0('0x4e')]({'name':_0x4acf54[_0x09c0('0x2c')],'resourceId':_0x4acf54['id'],'type':_0x1823c2[_0x09c0('0x2c')],'sectionId':_0x1823c2['id']},{})[_0x09c0('0x2a')](function(){return _0x332b69;});}else{return _0x332b69;}})[_0x09c0('0x4b')](function(_0x45ecd0){logger['error'](_0x09c0('0x55'),_0x45ecd0);throw _0x45ecd0;});}return _0x332b69;})[_0x09c0('0x2a')](respondWithResult(_0x38085c,0xc9))[_0x09c0('0x4b')](handleError(_0x38085c,null));};exports[_0x09c0('0x25')]=function(_0x21fe00,_0x316fbd){if(_0x21fe00[_0x09c0('0x4f')]['id']){delete _0x21fe00['body']['id'];}return db['VoiceMail'][_0x09c0('0x4d')]({'where':{'id':_0x21fe00[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x316fbd,null))['then'](saveUpdates(_0x21fe00[_0x09c0('0x4f')],null))['then'](respondWithResult(_0x316fbd,null))[_0x09c0('0x4b')](handleError(_0x316fbd,null));};exports[_0x09c0('0x26')]=function(_0x42d4dd,_0x290618){return db[_0x09c0('0x47')][_0x09c0('0x4d')]({'where':{'id':_0x42d4dd[_0x09c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x290618,null))[_0x09c0('0x2a')](removeEntity(_0x290618,null))[_0x09c0('0x4b')](handleError(_0x290618,null));};exports[_0x09c0('0x57')]=function(_0x270ff2,_0x3a6845,_0x219195){return db[_0x09c0('0x47')][_0x09c0('0x58')]({'where':{'id':_0x270ff2[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x3a6845,null))[_0x09c0('0x2a')](function(_0x4c4339){var _0x34cc0a;var _0x3564e6={},_0x26dc22={};_0x26dc22[_0x09c0('0x39')]=_['keys'](db[_0x09c0('0x59')]['rawAttributes']);_0x26dc22[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x270ff2[_0x09c0('0x34')]);_0x26dc22['filters']=_['intersection'](_0x26dc22[_0x09c0('0x39')],_0x26dc22[_0x09c0('0x34')]);_0x3564e6[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x26dc22['model'],qs[_0x09c0('0x3a')](_0x270ff2[_0x09c0('0x34')]['fields']));_0x3564e6[_0x09c0('0x38')]=_0x3564e6[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x3564e6[_0x09c0('0x38')]:_0x26dc22['model'];if(!_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x3564e6[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x20')]);_0x3564e6[_0x09c0('0x3e')]=qs[_0x09c0('0x3e')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x3564e6[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x270ff2['query'][_0x09c0('0x40')]);_0x3564e6[_0x09c0('0x44')]=qs[_0x09c0('0x36')](_[_0x09c0('0x41')](_0x270ff2[_0x09c0('0x34')],_0x26dc22['filters']));if(_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]){_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'$or':_[_0x09c0('0x2f')](_0x3564e6[_0x09c0('0x38')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]+'%'};return _0x325013;})});}_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'mailboxuser':_0x4c4339[_0x09c0('0x5a')]});_0x3564e6=_[_0x09c0('0x43')]({},_0x3564e6,_0x270ff2[_0x09c0('0x46')]);return db[_0x09c0('0x59')][_0x09c0('0x5b')](_0x3564e6)['then'](respondWithFilteredResult(_0x3a6845,_0x3564e6));})[_0x09c0('0x4b')](handleError(_0x3a6845,null));}; \ No newline at end of file +var _0x282b=['json','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','VoiceMail','includeAll','include','findAll','catch','show','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x282b,0xec));var _0xb282=function(_0x122298,_0x99c33d){_0x122298=_0x122298-0x0;var _0x127af3=_0x282b[_0x122298];return _0x127af3;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){var _0x5e828e=_0x360f15[_0xb282('0x25')]({'plain':!![]});var _0x114f77=_0xb282('0x26');return db[_0xb282('0x27')][_0xb282('0x24')]({'where':{'type':_0x114f77,'resourceId':_0x5e828e['id']}})[_0xb282('0x23')](function(){return _0x360f15;});})['then'](function(){_0x56645f[_0xb282('0x18')](0xcc)[_0xb282('0x28')]();});}};}function handleEntityNotFound(_0x50bd73,_0x22d895){return function(_0x38a1f8){if(!_0x38a1f8){_0x50bd73[_0xb282('0x17')](0x194);}return _0x38a1f8;};}function handleError(_0x280940,_0x59644e){_0x59644e=_0x59644e||0x1f4;return function(_0x1520b1){logger[_0xb282('0x29')](_0x1520b1[_0xb282('0x2a')]);if(_0x1520b1[_0xb282('0x2b')]){delete _0x1520b1[_0xb282('0x2b')];}_0x280940[_0xb282('0x18')](_0x59644e)[_0xb282('0x2c')](_0x1520b1);};}exports['index']=function(_0x1b15b5,_0x1e2861){var _0x3eb294={},_0xd8780b={},_0x42ef75={'count':0x0,'rows':[]};var _0x5f3ddf=_[_0xb282('0x2d')](db['VoiceMail'][_0xb282('0x2e')],function(_0x1bf721){return{'name':_0x1bf721[_0xb282('0x2f')],'type':_0x1bf721['type'][_0xb282('0x30')]};});_0xd8780b['model']=_[_0xb282('0x2d')](_0x5f3ddf,_0xb282('0x2b'));_0xd8780b[_0xb282('0x31')]=_[_0xb282('0x32')](_0x1b15b5[_0xb282('0x31')]);_0xd8780b[_0xb282('0x33')]=_['intersection'](_0xd8780b[_0xb282('0x34')],_0xd8780b[_0xb282('0x31')]);_0x3eb294['attributes']=_['intersection'](_0xd8780b[_0xb282('0x34')],qs[_0xb282('0x35')](_0x1b15b5[_0xb282('0x31')]['fields']));_0x3eb294['attributes']=_0x3eb294['attributes'][_0xb282('0x36')]?_0x3eb294[_0xb282('0x37')]:_0xd8780b[_0xb282('0x34')];if(!_0x1b15b5[_0xb282('0x31')][_0xb282('0x38')](_0xb282('0x39'))){_0x3eb294[_0xb282('0x1b')]=qs['limit'](_0x1b15b5[_0xb282('0x31')]['limit']);_0x3eb294[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1b15b5[_0xb282('0x31')]['offset']);}_0x3eb294[_0xb282('0x3a')]=qs['sort'](_0x1b15b5[_0xb282('0x31')][_0xb282('0x3b')]);_0x3eb294[_0xb282('0x3c')]=qs[_0xb282('0x33')](_['pick'](_0x1b15b5['query'],_0xd8780b[_0xb282('0x33')]),_0x5f3ddf);if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]){_0x3eb294[_0xb282('0x3c')]=_['merge'](_0x3eb294[_0xb282('0x3c')],{'$or':_['map'](_0x5f3ddf,function(_0x475895){if(_0x475895[_0xb282('0x3e')]!=='VIRTUAL'){var _0x41f2c4={};_0x41f2c4[_0x475895[_0xb282('0x2b')]]={'$like':'%'+_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]+'%'};return _0x41f2c4;}})});}_0x3eb294=_[_0xb282('0x3f')]({},_0x3eb294,_0x1b15b5[_0xb282('0x40')]);var _0x43e87e={'where':_0x3eb294[_0xb282('0x3c')]};return db[_0xb282('0x41')][_0xb282('0x1c')](_0x43e87e)[_0xb282('0x23')](function(_0x91fe43){_0x42ef75[_0xb282('0x1c')]=_0x91fe43;if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x42')]){_0x3eb294[_0xb282('0x43')]=[{'all':!![]}];}return db[_0xb282('0x41')][_0xb282('0x44')](_0x3eb294);})['then'](function(_0x310ad1){_0x42ef75['rows']=_0x310ad1;return _0x42ef75;})[_0xb282('0x23')](respondWithFilteredResult(_0x1e2861,_0x3eb294))[_0xb282('0x45')](handleError(_0x1e2861,null));};exports[_0xb282('0x46')]=function(_0x2f2ce8,_0x197472){var _0x3ddf56={'raw':!![],'where':{'id':_0x2f2ce8['params']['id']}},_0x5a6c0d={};_0x5a6c0d[_0xb282('0x34')]=_['keys'](db[_0xb282('0x41')][_0xb282('0x2e')]);_0x5a6c0d['query']=_[_0xb282('0x32')](_0x2f2ce8[_0xb282('0x31')]);_0x5a6c0d[_0xb282('0x33')]=_['intersection'](_0x5a6c0d['model'],_0x5a6c0d[_0xb282('0x31')]);_0x3ddf56['attributes']=_[_0xb282('0x47')](_0x5a6c0d[_0xb282('0x34')],qs[_0xb282('0x35')](_0x2f2ce8[_0xb282('0x31')][_0xb282('0x35')]));_0x3ddf56[_0xb282('0x37')]=_0x3ddf56['attributes'][_0xb282('0x36')]?_0x3ddf56[_0xb282('0x37')]:_0x5a6c0d[_0xb282('0x34')];if(_0x2f2ce8['query'][_0xb282('0x42')]){_0x3ddf56['include']=[{'all':!![]}];}_0x3ddf56=_[_0xb282('0x3f')]({},_0x3ddf56,_0x2f2ce8['options']);return db[_0xb282('0x41')]['find'](_0x3ddf56)['then'](handleEntityNotFound(_0x197472,null))['then'](respondWithResult(_0x197472,null))[_0xb282('0x45')](handleError(_0x197472,null));};exports[_0xb282('0x48')]=function(_0x42d99f,_0x7a5aa4){return db['VoiceMail']['create'](_0x42d99f['body'],{})[_0xb282('0x23')](function(_0x255ad5){var _0x3bed8d=_0x42d99f[_0xb282('0x49')]['get']({'plain':!![]});if(!_0x3bed8d)throw new Error(_0xb282('0x4a'));if(_0x3bed8d[_0xb282('0x4b')]==='user'){var _0x33bded=_0x255ad5[_0xb282('0x25')]({'plain':!![]});var _0x16f66b=_0xb282('0x26');return db[_0xb282('0x4c')]['find']({'where':{'name':_0x16f66b,'userProfileId':_0x3bed8d[_0xb282('0x4d')]},'raw':!![]})[_0xb282('0x23')](function(_0x465209){if(_0x465209&&_0x465209[_0xb282('0x4e')]===0x0){return db[_0xb282('0x27')][_0xb282('0x48')]({'name':_0x33bded['name'],'resourceId':_0x33bded['id'],'type':_0x465209[_0xb282('0x2b')],'sectionId':_0x465209['id']},{})['then'](function(){return _0x255ad5;});}else{return _0x255ad5;}})[_0xb282('0x45')](function(_0x1e6ade){logger['error'](_0xb282('0x4f'),_0x1e6ade);throw _0x1e6ade;});}return _0x255ad5;})[_0xb282('0x23')](respondWithResult(_0x7a5aa4,0xc9))[_0xb282('0x45')](handleError(_0x7a5aa4,null));};exports['update']=function(_0x51cbb0,_0x1028b9){if(_0x51cbb0[_0xb282('0x50')]['id']){delete _0x51cbb0[_0xb282('0x50')]['id'];}return db['VoiceMail'][_0xb282('0x51')]({'where':{'id':_0x51cbb0['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x1028b9,null))[_0xb282('0x23')](saveUpdates(_0x51cbb0['body'],null))[_0xb282('0x23')](respondWithResult(_0x1028b9,null))['catch'](handleError(_0x1028b9,null));};exports[_0xb282('0x24')]=function(_0x34b31a,_0x2e6eaa){return db[_0xb282('0x41')][_0xb282('0x51')]({'where':{'id':_0x34b31a[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e6eaa,null))[_0xb282('0x23')](removeEntity(_0x2e6eaa,null))['catch'](handleError(_0x2e6eaa,null));};exports[_0xb282('0x53')]=function(_0x34baf2,_0x53d50a,_0x597793){return db[_0xb282('0x41')][_0xb282('0x54')]({'where':{'id':_0x34baf2[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x53d50a,null))['then'](function(_0x40ae87){var _0x2dbbc4;var _0x3716b0={},_0x5d6a78={};_0x5d6a78[_0xb282('0x34')]=_['keys'](db[_0xb282('0x55')][_0xb282('0x2e')]);_0x5d6a78[_0xb282('0x31')]=_[_0xb282('0x32')](_0x34baf2[_0xb282('0x31')]);_0x5d6a78[_0xb282('0x33')]=_[_0xb282('0x47')](_0x5d6a78['model'],_0x5d6a78[_0xb282('0x31')]);_0x3716b0[_0xb282('0x37')]=_[_0xb282('0x47')](_0x5d6a78['model'],qs['fields'](_0x34baf2[_0xb282('0x31')][_0xb282('0x35')]));_0x3716b0[_0xb282('0x37')]=_0x3716b0['attributes']['length']?_0x3716b0[_0xb282('0x37')]:_0x5d6a78[_0xb282('0x34')];if(!_0x34baf2['query'][_0xb282('0x38')](_0xb282('0x39'))){_0x3716b0[_0xb282('0x1b')]=qs['limit'](_0x34baf2[_0xb282('0x31')][_0xb282('0x1b')]);_0x3716b0['offset']=qs[_0xb282('0x19')](_0x34baf2[_0xb282('0x31')][_0xb282('0x19')]);}_0x3716b0[_0xb282('0x3a')]=qs['sort'](_0x34baf2['query'][_0xb282('0x3b')]);_0x3716b0[_0xb282('0x3c')]=qs['filters'](_[_0xb282('0x56')](_0x34baf2[_0xb282('0x31')],_0x5d6a78[_0xb282('0x33')]));if(_0x34baf2[_0xb282('0x31')][_0xb282('0x3d')]){_0x3716b0[_0xb282('0x3c')]=_[_0xb282('0x3f')](_0x3716b0[_0xb282('0x3c')],{'$or':_['map'](_0x3716b0[_0xb282('0x37')],function(_0xb22721){var _0x18f33d={};_0x18f33d[_0xb22721]={'$like':'%'+_0x34baf2['query'][_0xb282('0x3d')]+'%'};return _0x18f33d;})});}_0x3716b0[_0xb282('0x3c')]=_['merge'](_0x3716b0['where'],{'mailboxuser':_0x40ae87[_0xb282('0x57')]});_0x3716b0=_[_0xb282('0x3f')]({},_0x3716b0,_0x34baf2[_0xb282('0x40')]);return db[_0xb282('0x55')][_0xb282('0x58')](_0x3716b0)[_0xb282('0x23')](respondWithFilteredResult(_0x53d50a,_0x3716b0));})[_0xb282('0x45')](handleError(_0x53d50a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b4e2f75..0b51998 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 _0x9f1f=['VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0x9f1f,0x105));var _0xf9f1=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x9f1f[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xf9f1('0x0'));var util=require(_0xf9f1('0x1'));var logger=require(_0xf9f1('0x2'))(_0xf9f1('0x3'));var moment=require('moment');var BPromise=require(_0xf9f1('0x4'));var rp=require(_0xf9f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9f1('0x6'));var config=require(_0xf9f1('0x7'));var attributes=require(_0xf9f1('0x8'));module[_0xf9f1('0x9')]=function(_0x5ac570,_0x3a3644){return _0x5ac570[_0xf9f1('0xa')](_0xf9f1('0xb'),attributes,{'tableName':_0xf9f1('0xc'),'paranoid':![],'indexes':[{'name':_0xf9f1('0xd'),'fields':[_0xf9f1('0xe'),_0xf9f1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb22a=['moment','bluebird','request-promise','path','rimraf','exports','VoiceMail','mailbox_context','mailbox','context','lodash','util','api'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xb22a,0xb3));var _0xab22=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xb22a[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0xab22('0x0'));var util=require(_0xab22('0x1'));var logger=require('../../config/logger')(_0xab22('0x2'));var moment=require(_0xab22('0x3'));var BPromise=require(_0xab22('0x4'));var rp=require(_0xab22('0x5'));var fs=require('fs');var path=require(_0xab22('0x6'));var rimraf=require(_0xab22('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0xab22('0x8')]=function(_0x49a00b,_0x109d0a){return _0x49a00b['define'](_0xab22('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xab22('0xa'),'fields':[_0xab22('0xb'),_0xab22('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 832143f..6875b46 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 _0xf44e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','bluebird','randomstring'];(function(_0x17cf3c,_0x1bc2d1){var _0x404606=function(_0x2dcb27){while(--_0x2dcb27){_0x17cf3c['push'](_0x17cf3c['shift']());}};_0x404606(++_0x1bc2d1);}(_0xf44e,0x16c));var _0xef44=function(_0x3a00b3,_0x4b735a){_0x3a00b3=_0x3a00b3-0x0;var _0x4f87b6=_0xf44e[_0x3a00b3];return _0x4f87b6;};'use strict';var _=require(_0xef44('0x0'));var util=require(_0xef44('0x1'));var moment=require('moment');var BPromise=require(_0xef44('0x2'));var rs=require(_0xef44('0x3'));var fs=require('fs');var Redis=require(_0xef44('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef44('0x5'));var logger=require(_0xef44('0x6'))(_0xef44('0x7'));var config=require(_0xef44('0x8'));var jayson=require(_0xef44('0x9'));var client=jayson[_0xef44('0xa')][_0xef44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35286e,_0x461c96,_0x5b77e2){return new BPromise(function(_0x556627,_0x545a12){return client[_0xef44('0xc')](_0x35286e,_0x5b77e2)[_0xef44('0xd')](function(_0x189eeb){logger['info'](_0xef44('0xe'),_0x461c96,'request\x20sent');logger[_0xef44('0xf')](_0xef44('0x10'),_0x461c96,_0xef44('0x11'),JSON[_0xef44('0x12')](_0x189eeb));if(_0x189eeb[_0xef44('0x13')]){if(_0x189eeb['error'][_0xef44('0x14')]===0x1f4){logger[_0xef44('0x13')](_0xef44('0xe'),_0x461c96,_0x189eeb['error'][_0xef44('0x15')]);return _0x545a12(_0x189eeb['error']['message']);}logger[_0xef44('0x13')]('VoiceMail,\x20%s,\x20%s',_0x461c96,_0x189eeb['error'][_0xef44('0x15')]);return _0x556627(_0x189eeb[_0xef44('0x13')]['message']);}else{logger[_0xef44('0x16')]('VoiceMail,\x20%s,\x20%s',_0x461c96,_0xef44('0x11'));_0x556627(_0x189eeb['result'][_0xef44('0x15')]);}})['catch'](function(_0x1e986f){logger[_0xef44('0x13')](_0xef44('0xe'),_0x461c96,_0x1e986f);_0x545a12(_0x1e986f);});});} \ No newline at end of file +var _0x5543=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x3aa235,_0x27a45a){var _0x17f250=function(_0x4b9d34){while(--_0x4b9d34){_0x3aa235['push'](_0x3aa235['shift']());}};_0x17f250(++_0x27a45a);}(_0x5543,0xce));var _0x3554=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x5543[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x3554('0x0'));var util=require(_0x3554('0x1'));var moment=require('moment');var BPromise=require(_0x3554('0x2'));var rs=require(_0x3554('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3554('0x4'))['db'];var utils=require(_0x3554('0x5'));var logger=require(_0x3554('0x6'))('rpc');var config=require(_0x3554('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45d500,_0x3d3d05,_0x5efb8a){return new BPromise(function(_0x2faa79,_0x5bf3c6){return client[_0x3554('0x8')](_0x45d500,_0x5efb8a)['then'](function(_0x10d216){logger[_0x3554('0x9')](_0x3554('0xa'),_0x3d3d05,_0x3554('0xb'));logger[_0x3554('0xc')](_0x3554('0xd'),_0x3d3d05,'request\x20sent',JSON[_0x3554('0xe')](_0x10d216));if(_0x10d216[_0x3554('0xf')]){if(_0x10d216[_0x3554('0xf')][_0x3554('0x10')]===0x1f4){logger[_0x3554('0xf')](_0x3554('0xa'),_0x3d3d05,_0x10d216[_0x3554('0xf')]['message']);return _0x5bf3c6(_0x10d216['error'][_0x3554('0x11')]);}logger[_0x3554('0xf')](_0x3554('0xa'),_0x3d3d05,_0x10d216[_0x3554('0xf')][_0x3554('0x11')]);return _0x2faa79(_0x10d216[_0x3554('0xf')][_0x3554('0x11')]);}else{logger[_0x3554('0x9')](_0x3554('0xa'),_0x3d3d05,'request\x20sent');_0x2faa79(_0x10d216[_0x3554('0x12')][_0x3554('0x11')]);}})[_0x3554('0x13')](function(_0x3f9e2a){logger[_0x3554('0xf')]('VoiceMail,\x20%s,\x20%s',_0x3d3d05,_0x3f9e2a);_0x5bf3c6(_0x3f9e2a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index b7095c7..259c91f 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 _0xb9b6=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id/download','create','update','delete','destroy'];(function(_0x447ad8,_0x410b9d){var _0x545ef2=function(_0x2cbca6){while(--_0x2cbca6){_0x447ad8['push'](_0x447ad8['shift']());}};_0x545ef2(++_0x410b9d);}(_0xb9b6,0x121));var _0x6b9b=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xb9b6[_0x3c6b7d];return _0x1d3ed2;};'use strict';var multer=require('multer');var util=require(_0x6b9b('0x0'));var path=require(_0x6b9b('0x1'));var timeout=require(_0x6b9b('0x2'));var express=require(_0x6b9b('0x3'));var router=express['Router']();var fs_extra=require(_0x6b9b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6b9b('0x5'));var config=require('../../config/environment');var controller=require(_0x6b9b('0x6'));router['get']('/',auth[_0x6b9b('0x7')](),controller[_0x6b9b('0x8')]);router[_0x6b9b('0x9')]('/:id',auth[_0x6b9b('0x7')](),controller['show']);router[_0x6b9b('0x9')](_0x6b9b('0xa'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6b9b('0x7')](),controller[_0x6b9b('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6b9b('0xc')]);router[_0x6b9b('0xd')]('/:id',auth[_0x6b9b('0x7')](),controller[_0x6b9b('0xe')]);module[_0x6b9b('0xf')]=router; \ No newline at end of file +var _0x9476=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','index','show','get','/:id/download','isAuthenticated','download','post','create','put','/:id','update','delete'];(function(_0x43ec99,_0x376c5){var _0x25b9c8=function(_0x5ade84){while(--_0x5ade84){_0x43ec99['push'](_0x43ec99['shift']());}};_0x25b9c8(++_0x376c5);}(_0x9476,0x80));var _0x6947=function(_0x1aae2e,_0x449ce2){_0x1aae2e=_0x1aae2e-0x0;var _0x25fc7d=_0x9476[_0x1aae2e];return _0x25fc7d;};'use strict';var multer=require(_0x6947('0x0'));var util=require(_0x6947('0x1'));var path=require('path');var timeout=require(_0x6947('0x2'));var express=require('express');var router=express[_0x6947('0x3')]();var fs_extra=require(_0x6947('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6947('0x5'));var controller=require(_0x6947('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6947('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6947('0x8')]);router[_0x6947('0x9')](_0x6947('0xa'),auth[_0x6947('0xb')](),controller[_0x6947('0xc')]);router[_0x6947('0xd')]('/',auth[_0x6947('0xb')](),controller[_0x6947('0xe')]);router[_0x6947('0xf')](_0x6947('0x10'),auth[_0x6947('0xb')](),controller[_0x6947('0x11')]);router[_0x6947('0x12')](_0x6947('0x10'),auth[_0x6947('0xb')](),controller[_0x6947('0x13')]);module[_0x6947('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7e23585..d2926ad 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 _0x89da=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x30cdf0,_0x30cdeb){var _0x593dcc=function(_0x4c2a80){while(--_0x4c2a80){_0x30cdf0['push'](_0x30cdf0['shift']());}};_0x593dcc(++_0x30cdeb);}(_0x89da,0xf4));var _0xa89d=function(_0x30b907,_0x17460f){_0x30b907=_0x30b907-0x0;var _0x47f26a=_0x89da[_0x30b907];return _0x47f26a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa89d('0x0')],'get':function(_0x65419b){return this[_0xa89d('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xa89d('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xa89d('0x4')](_0xa89d('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa89d('0x3')],'defaultValue':''},'stamp':{'type':_0xa89d('0x6'),'defaultValue':Sequelize[_0xa89d('0x7')](_0xa89d('0x8'))}}; \ No newline at end of file +var _0xbc6a=['VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x2533cd,_0x5dd3ae){var _0x4a0cd4=function(_0x262431){while(--_0x262431){_0x2533cd['push'](_0x2533cd['shift']());}};_0x4a0cd4(++_0x5dd3ae);}(_0xbc6a,0x180));var _0xabc6=function(_0x29e7eb,_0x232f12){_0x29e7eb=_0x29e7eb-0x0;var _0x5774e1=_0xbc6a[_0x29e7eb];return _0x5774e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xabc6('0x0')],'get':function(_0x407d7a){return this[_0xabc6('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xabc6('0x3')](_0xabc6('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'stamp':{'type':_0xabc6('0x5'),'defaultValue':Sequelize['literal']('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 d6746bc..b72afc0 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 _0xb81f=['sort','where','pick','filter','merge','options','count','includeAll','include','VoiceMailMessage','show','params','length','find','catch','create','body','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3c2e6b,_0x12f686){var _0x4ddeb7=function(_0x5d8a22){while(--_0x5d8a22){_0x3c2e6b['push'](_0x3c2e6b['shift']());}};_0x4ddeb7(++_0x12f686);}(_0xb81f,0xb8));var _0xfb81=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0xb81f[_0x2d58e6];return _0x5bcd81;};'use strict';var emlformat=require(_0xfb81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb81('0x1'));var jsonpatch=require(_0xfb81('0x2'));var rp=require(_0xfb81('0x3'));var moment=require(_0xfb81('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb81('0x5'));var path=require(_0xfb81('0x6'));var sox=require('sox');var csv=require(_0xfb81('0x7'));var ejs=require(_0xfb81('0x8'));var fs=require('fs');var fs_extra=require(_0xfb81('0x9'));var _=require(_0xfb81('0xa'));var squel=require(_0xfb81('0xb'));var crypto=require(_0xfb81('0xc'));var jsforce=require(_0xfb81('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfb81('0x7'));var querystring=require(_0xfb81('0xe'));var Papa=require(_0xfb81('0xf'));var Redis=require(_0xfb81('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfb81('0x11'));var as=require(_0xfb81('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfb81('0x13'));var config=require(_0xfb81('0x14'));var licenseUtil=require(_0xfb81('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21d292,_0x1ec0c1){_0x1ec0c1=_0x1ec0c1||0xcc;return function(_0x731edf){if(_0x731edf){return _0x21d292[_0xfb81('0x16')](_0x1ec0c1);}return _0x21d292[_0xfb81('0x17')](_0x1ec0c1)['end']();};}function respondWithResult(_0x5bbfb0,_0x54c92b){_0x54c92b=_0x54c92b||0xc8;return function(_0x1ce700){if(_0x1ce700){return _0x5bbfb0['status'](_0x54c92b)[_0xfb81('0x18')](_0x1ce700);}};}function respondWithFilteredResult(_0x52838b,_0x594f48){return function(_0x1f29aa){if(_0x1f29aa){var _0x2e2eb5=typeof _0x594f48[_0xfb81('0x19')]===_0xfb81('0x1a')&&typeof _0x594f48['limit']==='undefined';var _0x239a9a=_0x1f29aa['count'];var _0x174ece=_0x2e2eb5?0x0:_0x594f48[_0xfb81('0x19')];var _0x1078ab=_0x2e2eb5?_0x1f29aa['count']:_0x594f48[_0xfb81('0x19')]+_0x594f48[_0xfb81('0x1b')];var _0x4f744c;if(_0x1078ab>=_0x239a9a){_0x1078ab=_0x239a9a;_0x4f744c=0xc8;}else{_0x4f744c=0xce;}_0x52838b[_0xfb81('0x17')](_0x4f744c);return _0x52838b[_0xfb81('0x1c')](_0xfb81('0x1d'),_0x174ece+'-'+_0x1078ab+'/'+_0x239a9a)[_0xfb81('0x18')](_0x1f29aa);}return null;};}function patchUpdates(_0x1a0599){return function(_0x2698db){try{jsonpatch[_0xfb81('0x1e')](_0x2698db,_0x1a0599,!![]);}catch(_0x3e4218){return BPromise[_0xfb81('0x1f')](_0x3e4218);}return _0x2698db[_0xfb81('0x20')]();};}function saveUpdates(_0x3f8bc4,_0x277ecd){return function(_0x36b894){if(_0x36b894){return _0x36b894[_0xfb81('0x21')](_0x3f8bc4)[_0xfb81('0x22')](function(_0x62e0fa){return _0x62e0fa;});}return null;};}function removeEntity(_0x4e8099,_0x2a5e07){return function(_0x163859){if(_0x163859){return _0x163859[_0xfb81('0x23')]()[_0xfb81('0x22')](function(){_0x4e8099[_0xfb81('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc883be,_0x56a846){return function(_0x209d5e){if(!_0x209d5e){_0xc883be['sendStatus'](0x194);}return _0x209d5e;};}function handleError(_0x5f2fa4,_0x3a346c){_0x3a346c=_0x3a346c||0x1f4;return function(_0xefcf4c){logger[_0xfb81('0x24')](_0xefcf4c[_0xfb81('0x25')]);if(_0xefcf4c['name']){delete _0xefcf4c[_0xfb81('0x26')];}_0x5f2fa4[_0xfb81('0x17')](_0x3a346c)[_0xfb81('0x27')](_0xefcf4c);};}exports[_0xfb81('0x28')]=function(_0x522f46,_0x4452b4){var _0x45e9d7={},_0x3cf9de={},_0x4a36c6={'count':0x0,'rows':[]};var _0x23e77a=_['map'](db['VoiceMailMessage'][_0xfb81('0x29')],function(_0x24cff6){return{'name':_0x24cff6[_0xfb81('0x2a')],'type':_0x24cff6[_0xfb81('0x2b')][_0xfb81('0x2c')]};});_0x3cf9de[_0xfb81('0x2d')]=_[_0xfb81('0x2e')](_[_0xfb81('0x2f')](_0x23e77a,_0xfb81('0x26')),['name']);_0x3cf9de[_0xfb81('0x30')]=_[_0xfb81('0x31')](_0x522f46[_0xfb81('0x30')]);_0x3cf9de[_0xfb81('0x32')]=_[_0xfb81('0x33')](_0x3cf9de[_0xfb81('0x2d')],_0x3cf9de[_0xfb81('0x30')]);_0x45e9d7[_0xfb81('0x34')]=_[_0xfb81('0x33')](_0x3cf9de[_0xfb81('0x2d')],qs[_0xfb81('0x35')](_0x522f46[_0xfb81('0x30')]['fields']));_0x45e9d7[_0xfb81('0x34')]=_0x45e9d7[_0xfb81('0x34')]['length']?_0x45e9d7[_0xfb81('0x34')]:_0x3cf9de[_0xfb81('0x2d')];if(!_0x522f46[_0xfb81('0x30')][_0xfb81('0x36')](_0xfb81('0x37'))){_0x45e9d7['limit']=qs['limit'](_0x522f46[_0xfb81('0x30')][_0xfb81('0x1b')]);_0x45e9d7['offset']=qs[_0xfb81('0x19')](_0x522f46[_0xfb81('0x30')]['offset']);}_0x45e9d7['order']=qs['sort'](_0x522f46[_0xfb81('0x30')][_0xfb81('0x38')]);_0x45e9d7[_0xfb81('0x39')]=qs[_0xfb81('0x32')](_[_0xfb81('0x3a')](_0x522f46[_0xfb81('0x30')],_0x3cf9de[_0xfb81('0x32')]),_0x23e77a);if(_0x522f46[_0xfb81('0x30')][_0xfb81('0x3b')]){_0x45e9d7[_0xfb81('0x39')]=_[_0xfb81('0x3c')](_0x45e9d7[_0xfb81('0x39')],{'$or':_[_0xfb81('0x2f')](_0x23e77a,function(_0x2ccfbb){if(_0x2ccfbb[_0xfb81('0x2b')]!=='VIRTUAL'){var _0x11f8f7={};_0x11f8f7[_0x2ccfbb[_0xfb81('0x26')]]={'$like':'%'+_0x522f46[_0xfb81('0x30')]['filter']+'%'};return _0x11f8f7;}})});}_0x45e9d7=_[_0xfb81('0x3c')]({},_0x45e9d7,_0x522f46[_0xfb81('0x3d')]);var _0x58d97e={'where':_0x45e9d7[_0xfb81('0x39')]};return db['VoiceMailMessage']['count'](_0x58d97e)[_0xfb81('0x22')](function(_0x28ff30){_0x4a36c6[_0xfb81('0x3e')]=_0x28ff30;if(_0x522f46['query'][_0xfb81('0x3f')]){_0x45e9d7[_0xfb81('0x40')]=[{'all':!![]}];}return db[_0xfb81('0x41')]['findAll'](_0x45e9d7);})[_0xfb81('0x22')](function(_0x55ceb8){_0x4a36c6['rows']=_0x55ceb8;return _0x4a36c6;})[_0xfb81('0x22')](respondWithFilteredResult(_0x4452b4,_0x45e9d7))['catch'](handleError(_0x4452b4,null));};exports[_0xfb81('0x42')]=function(_0x19c500,_0x83ff1b){var _0x4d0d6d={'raw':!![],'where':{'id':_0x19c500[_0xfb81('0x43')]['id']}},_0x18cdea={};_0x18cdea['model']=_[_0xfb81('0x31')](db[_0xfb81('0x41')][_0xfb81('0x29')]);_0x18cdea[_0xfb81('0x30')]=_['keys'](_0x19c500[_0xfb81('0x30')]);_0x18cdea['filters']=_[_0xfb81('0x33')](_0x18cdea[_0xfb81('0x2d')],_0x18cdea[_0xfb81('0x30')]);_0x4d0d6d['attributes']=_[_0xfb81('0x33')](_0x18cdea[_0xfb81('0x2d')],qs[_0xfb81('0x35')](_0x19c500[_0xfb81('0x30')][_0xfb81('0x35')]));_0x4d0d6d[_0xfb81('0x34')]=_0x4d0d6d[_0xfb81('0x34')][_0xfb81('0x44')]?_0x4d0d6d['attributes']:_0x18cdea[_0xfb81('0x2d')];if(_0x19c500['query'][_0xfb81('0x3f')]){_0x4d0d6d[_0xfb81('0x40')]=[{'all':!![]}];}_0x4d0d6d=_['merge']({},_0x4d0d6d,_0x19c500['options']);return db[_0xfb81('0x41')][_0xfb81('0x45')](_0x4d0d6d)[_0xfb81('0x22')](handleEntityNotFound(_0x83ff1b,null))[_0xfb81('0x22')](respondWithResult(_0x83ff1b,null))[_0xfb81('0x46')](handleError(_0x83ff1b,null));};exports[_0xfb81('0x47')]=function(_0x2202c1,_0x4e04c6){return db[_0xfb81('0x41')][_0xfb81('0x47')](_0x2202c1['body'],{})['then'](respondWithResult(_0x4e04c6,0xc9))[_0xfb81('0x46')](handleError(_0x4e04c6,null));};exports['update']=function(_0x4bc863,_0x588451){if(_0x4bc863[_0xfb81('0x48')]['id']){delete _0x4bc863['body']['id'];}return db[_0xfb81('0x41')][_0xfb81('0x45')]({'where':{'id':_0x4bc863['params']['id']}})[_0xfb81('0x22')](handleEntityNotFound(_0x588451,null))[_0xfb81('0x22')](saveUpdates(_0x4bc863[_0xfb81('0x48')],null))[_0xfb81('0x22')](respondWithResult(_0x588451,null))[_0xfb81('0x46')](handleError(_0x588451,null));};exports[_0xfb81('0x23')]=function(_0x4cba88,_0x30acff){return db['VoiceMailMessage'][_0xfb81('0x45')]({'where':{'id':_0x4cba88['params']['id']}})[_0xfb81('0x22')](handleEntityNotFound(_0x30acff,null))[_0xfb81('0x22')](removeEntity(_0x30acff,null))['catch'](handleError(_0x30acff,null));};exports['download']=function(_0x17c1a3,_0x25ad74,_0x1796f9){return db[_0xfb81('0x41')][_0xfb81('0x45')]({'where':{'id':_0x17c1a3[_0xfb81('0x43')]['id']},'attributes':['id',_0xfb81('0x49'),_0xfb81('0x4a')]})['then'](handleEntityNotFound(_0x25ad74,null))[_0xfb81('0x22')](function(_0x47980e){if(_0x47980e){if(!_0x47980e['recording']){throw new db[(_0xfb81('0x4b'))]['ValidationError'](_0xfb81('0x4c'));}var _0x1e5f70={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x47980e[_0xfb81('0x4a')]){_0x1e5f70[_0xfb81('0x4d')]=_0xfb81('0x4e')+_0x47980e[_0xfb81('0x4a')]+_0xfb81('0x4f');}_0x25ad74[_0xfb81('0x1c')](_0x1e5f70);return _0x25ad74['send'](new Buffer(_0x47980e['recording']));}})[_0xfb81('0x46')](handleError(_0x25ad74,null));}; \ No newline at end of file +var _0x27b5=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','fast-json-patch'];(function(_0x4a5aa8,_0x31a125){var _0x2ae85b=function(_0x4a5423){while(--_0x4a5423){_0x4a5aa8['push'](_0x4a5aa8['shift']());}};_0x2ae85b(++_0x31a125);}(_0x27b5,0x1f0));var _0x527b=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x27b5[_0x1646fa];return _0x5a47a5;};'use strict';var emlformat=require(_0x527b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x527b('0x1'));var rp=require(_0x527b('0x2'));var moment=require(_0x527b('0x3'));var BPromise=require(_0x527b('0x4'));var Mustache=require(_0x527b('0x5'));var util=require(_0x527b('0x6'));var path=require('path');var sox=require(_0x527b('0x7'));var csv=require(_0x527b('0x8'));var ejs=require(_0x527b('0x9'));var fs=require('fs');var fs_extra=require(_0x527b('0xa'));var _=require('lodash');var squel=require(_0x527b('0xb'));var crypto=require(_0x527b('0xc'));var jsforce=require(_0x527b('0xd'));var deskjs=require(_0x527b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x527b('0xf'));var Redis=require('ioredis');var authService=require(_0x527b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x527b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x527b('0x12'))(_0x527b('0x13'));var utils=require('../../config/utils');var config=require(_0x527b('0x14'));var licenseUtil=require(_0x527b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ff46,_0x2cb221){_0x2cb221=_0x2cb221||0xcc;return function(_0x3bbf84){if(_0x3bbf84){return _0x28ff46[_0x527b('0x16')](_0x2cb221);}return _0x28ff46[_0x527b('0x17')](_0x2cb221)['end']();};}function respondWithResult(_0x524ffc,_0x2ef8c1){_0x2ef8c1=_0x2ef8c1||0xc8;return function(_0x27e910){if(_0x27e910){return _0x524ffc[_0x527b('0x17')](_0x2ef8c1)[_0x527b('0x18')](_0x27e910);}};}function respondWithFilteredResult(_0x2dd235,_0x3e35b9){return function(_0x1c3b74){if(_0x1c3b74){var _0x4f83bc=typeof _0x3e35b9[_0x527b('0x19')]===_0x527b('0x1a')&&typeof _0x3e35b9[_0x527b('0x1b')]===_0x527b('0x1a');var _0x432d48=_0x1c3b74['count'];var _0x333e67=_0x4f83bc?0x0:_0x3e35b9[_0x527b('0x19')];var _0x5a10d8=_0x4f83bc?_0x1c3b74[_0x527b('0x1c')]:_0x3e35b9[_0x527b('0x19')]+_0x3e35b9[_0x527b('0x1b')];var _0x181c17;if(_0x5a10d8>=_0x432d48){_0x5a10d8=_0x432d48;_0x181c17=0xc8;}else{_0x181c17=0xce;}_0x2dd235[_0x527b('0x17')](_0x181c17);return _0x2dd235[_0x527b('0x1d')]('Content-Range',_0x333e67+'-'+_0x5a10d8+'/'+_0x432d48)[_0x527b('0x18')](_0x1c3b74);}return null;};}function patchUpdates(_0x510853){return function(_0x4a0ef7){try{jsonpatch[_0x527b('0x1e')](_0x4a0ef7,_0x510853,!![]);}catch(_0x3456e8){return BPromise[_0x527b('0x1f')](_0x3456e8);}return _0x4a0ef7[_0x527b('0x20')]();};}function saveUpdates(_0x5b07e2,_0x13c1e9){return function(_0x1798fa){if(_0x1798fa){return _0x1798fa[_0x527b('0x21')](_0x5b07e2)[_0x527b('0x22')](function(_0x1fc338){return _0x1fc338;});}return null;};}function removeEntity(_0x34dfc1,_0x5d923d){return function(_0x29c569){if(_0x29c569){return _0x29c569['destroy']()['then'](function(){_0x34dfc1['status'](0xcc)[_0x527b('0x23')]();});}};}function handleEntityNotFound(_0x49eb54,_0x448859){return function(_0x29a881){if(!_0x29a881){_0x49eb54[_0x527b('0x16')](0x194);}return _0x29a881;};}function handleError(_0x3ac34d,_0x25670f){_0x25670f=_0x25670f||0x1f4;return function(_0x2ed3c0){logger[_0x527b('0x24')](_0x2ed3c0[_0x527b('0x25')]);if(_0x2ed3c0[_0x527b('0x26')]){delete _0x2ed3c0[_0x527b('0x26')];}_0x3ac34d[_0x527b('0x17')](_0x25670f)[_0x527b('0x27')](_0x2ed3c0);};}exports[_0x527b('0x28')]=function(_0x4df3e5,_0x14e822){var _0x245da4={},_0x2311dd={},_0x4ad1c1={'count':0x0,'rows':[]};var _0x3a42ed=_[_0x527b('0x29')](db[_0x527b('0x2a')][_0x527b('0x2b')],function(_0x716fe9){return{'name':_0x716fe9[_0x527b('0x2c')],'type':_0x716fe9[_0x527b('0x2d')][_0x527b('0x2e')]};});_0x2311dd[_0x527b('0x2f')]=_['differenceBy'](_[_0x527b('0x29')](_0x3a42ed,_0x527b('0x26')),[_0x527b('0x26')]);_0x2311dd[_0x527b('0x30')]=_[_0x527b('0x31')](_0x4df3e5['query']);_0x2311dd[_0x527b('0x32')]=_[_0x527b('0x33')](_0x2311dd[_0x527b('0x2f')],_0x2311dd[_0x527b('0x30')]);_0x245da4[_0x527b('0x34')]=_[_0x527b('0x33')](_0x2311dd['model'],qs['fields'](_0x4df3e5[_0x527b('0x30')][_0x527b('0x35')]));_0x245da4[_0x527b('0x34')]=_0x245da4[_0x527b('0x34')]['length']?_0x245da4[_0x527b('0x34')]:_0x2311dd['model'];if(!_0x4df3e5['query'][_0x527b('0x36')](_0x527b('0x37'))){_0x245da4['limit']=qs['limit'](_0x4df3e5[_0x527b('0x30')]['limit']);_0x245da4[_0x527b('0x19')]=qs['offset'](_0x4df3e5['query'][_0x527b('0x19')]);}_0x245da4[_0x527b('0x38')]=qs['sort'](_0x4df3e5[_0x527b('0x30')][_0x527b('0x39')]);_0x245da4['where']=qs['filters'](_['pick'](_0x4df3e5[_0x527b('0x30')],_0x2311dd[_0x527b('0x32')]),_0x3a42ed);if(_0x4df3e5[_0x527b('0x30')][_0x527b('0x3a')]){_0x245da4[_0x527b('0x3b')]=_[_0x527b('0x3c')](_0x245da4[_0x527b('0x3b')],{'$or':_['map'](_0x3a42ed,function(_0x53a8bc){if(_0x53a8bc['type']!==_0x527b('0x3d')){var _0x40f546={};_0x40f546[_0x53a8bc[_0x527b('0x26')]]={'$like':'%'+_0x4df3e5['query'][_0x527b('0x3a')]+'%'};return _0x40f546;}})});}_0x245da4=_[_0x527b('0x3c')]({},_0x245da4,_0x4df3e5[_0x527b('0x3e')]);var _0x50c8f5={'where':_0x245da4['where']};return db[_0x527b('0x2a')][_0x527b('0x1c')](_0x50c8f5)[_0x527b('0x22')](function(_0x496219){_0x4ad1c1[_0x527b('0x1c')]=_0x496219;if(_0x4df3e5[_0x527b('0x30')][_0x527b('0x3f')]){_0x245da4[_0x527b('0x40')]=[{'all':!![]}];}return db[_0x527b('0x2a')][_0x527b('0x41')](_0x245da4);})['then'](function(_0x41f1b2){_0x4ad1c1[_0x527b('0x42')]=_0x41f1b2;return _0x4ad1c1;})['then'](respondWithFilteredResult(_0x14e822,_0x245da4))[_0x527b('0x43')](handleError(_0x14e822,null));};exports[_0x527b('0x44')]=function(_0xe2d6cf,_0x4f3f93){var _0xc9a1d9={'raw':!![],'where':{'id':_0xe2d6cf[_0x527b('0x45')]['id']}},_0x2844b1={};_0x2844b1[_0x527b('0x2f')]=_[_0x527b('0x31')](db['VoiceMailMessage']['rawAttributes']);_0x2844b1[_0x527b('0x30')]=_['keys'](_0xe2d6cf[_0x527b('0x30')]);_0x2844b1[_0x527b('0x32')]=_['intersection'](_0x2844b1['model'],_0x2844b1[_0x527b('0x30')]);_0xc9a1d9['attributes']=_[_0x527b('0x33')](_0x2844b1[_0x527b('0x2f')],qs['fields'](_0xe2d6cf[_0x527b('0x30')][_0x527b('0x35')]));_0xc9a1d9['attributes']=_0xc9a1d9[_0x527b('0x34')][_0x527b('0x46')]?_0xc9a1d9[_0x527b('0x34')]:_0x2844b1[_0x527b('0x2f')];if(_0xe2d6cf[_0x527b('0x30')][_0x527b('0x3f')]){_0xc9a1d9['include']=[{'all':!![]}];}_0xc9a1d9=_['merge']({},_0xc9a1d9,_0xe2d6cf[_0x527b('0x3e')]);return db['VoiceMailMessage'][_0x527b('0x47')](_0xc9a1d9)[_0x527b('0x22')](handleEntityNotFound(_0x4f3f93,null))[_0x527b('0x22')](respondWithResult(_0x4f3f93,null))['catch'](handleError(_0x4f3f93,null));};exports[_0x527b('0x48')]=function(_0x2c03c6,_0x1e97d6){return db[_0x527b('0x2a')]['create'](_0x2c03c6[_0x527b('0x49')],{})[_0x527b('0x22')](respondWithResult(_0x1e97d6,0xc9))[_0x527b('0x43')](handleError(_0x1e97d6,null));};exports[_0x527b('0x21')]=function(_0x1b622e,_0x329deb){if(_0x1b622e[_0x527b('0x49')]['id']){delete _0x1b622e[_0x527b('0x49')]['id'];}return db[_0x527b('0x2a')][_0x527b('0x47')]({'where':{'id':_0x1b622e[_0x527b('0x45')]['id']}})[_0x527b('0x22')](handleEntityNotFound(_0x329deb,null))['then'](saveUpdates(_0x1b622e['body'],null))[_0x527b('0x22')](respondWithResult(_0x329deb,null))[_0x527b('0x43')](handleError(_0x329deb,null));};exports['destroy']=function(_0xf50926,_0x2c3f8d){return db[_0x527b('0x2a')][_0x527b('0x47')]({'where':{'id':_0xf50926[_0x527b('0x45')]['id']}})[_0x527b('0x22')](handleEntityNotFound(_0x2c3f8d,null))['then'](removeEntity(_0x2c3f8d,null))[_0x527b('0x43')](handleError(_0x2c3f8d,null));};exports[_0x527b('0x4a')]=function(_0x641a67,_0x17bc3d,_0x13abfb){return db[_0x527b('0x2a')]['find']({'where':{'id':_0x641a67[_0x527b('0x45')]['id']},'attributes':['id',_0x527b('0x4b'),'msg_id']})[_0x527b('0x22')](handleEntityNotFound(_0x17bc3d,null))[_0x527b('0x22')](function(_0x1fa28b){if(_0x1fa28b){if(!_0x1fa28b[_0x527b('0x4b')]){throw new db[(_0x527b('0x4c'))][(_0x527b('0x4d'))](_0x527b('0x4e'));}var _0xe652e={'Content-Type':_0x527b('0x4f'),'Content-Disposition':_0x527b('0x50')};if(_0x1fa28b['msg_id']){_0xe652e[_0x527b('0x51')]=_0x527b('0x52')+_0x1fa28b['msg_id']+'.wav\x22';}_0x17bc3d[_0x527b('0x1d')](_0xe652e);return _0x17bc3d['send'](new Buffer(_0x1fa28b[_0x527b('0x4b')]));}})[_0x527b('0x43')](handleError(_0x17bc3d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6f4064a..edf3e1a 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 _0x424f=['api','moment','bluebird','request-promise','rimraf','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x424f,0x1c1));var _0xf424=function(_0xfdf726,_0x13eb73){_0xfdf726=_0xfdf726-0x0;var _0xb7eb05=_0x424f[_0xfdf726];return _0xb7eb05;};'use strict';var _=require('lodash');var util=require(_0xf424('0x0'));var logger=require('../../config/logger')(_0xf424('0x1'));var moment=require(_0xf424('0x2'));var BPromise=require(_0xf424('0x3'));var rp=require(_0xf424('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf424('0x5'));var config=require('../../config/environment');var attributes=require(_0xf424('0x6'));module[_0xf424('0x7')]=function(_0x2dfedf,_0x4e8518){return _0x2dfedf['define']('VoiceMailMessage',attributes,{'tableName':_0xf424('0x8'),'paranoid':![],'indexes':[{'name':_0xf424('0x9'),'fields':[_0xf424('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe76d=['voice_voicemail_messages','dir','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage'];(function(_0x2fca03,_0x2b5ef5){var _0x6bd452=function(_0x5430b6){while(--_0x5430b6){_0x2fca03['push'](_0x2fca03['shift']());}};_0x6bd452(++_0x2b5ef5);}(_0xe76d,0x16a));var _0xde76=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe76d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xde76('0x0'));var util=require('util');var logger=require(_0xde76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xde76('0x2'));var rp=require(_0xde76('0x3'));var fs=require('fs');var path=require(_0xde76('0x4'));var rimraf=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var attributes=require(_0xde76('0x7'));module[_0xde76('0x8')]=function(_0x15a643,_0x1bf217){return _0x15a643['define'](_0xde76('0x9'),attributes,{'tableName':_0xde76('0xa'),'paranoid':![],'indexes':[{'name':_0xde76('0xb'),'fields':[_0xde76('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e72baa2..6036064 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 _0x0524=['../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0524,0x8c));var _0x4052=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x0524[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0x4052('0x0'));var util=require('util');var moment=require(_0x4052('0x1'));var BPromise=require(_0x4052('0x2'));var rs=require(_0x4052('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4052('0x4'));var logger=require(_0x4052('0x5'))(_0x4052('0x6'));var config=require(_0x4052('0x7'));var jayson=require(_0x4052('0x8'));var client=jayson['client'][_0x4052('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe9f634,_0x3989fc,_0x8887f6){return new BPromise(function(_0x4cdd9c,_0x253a5){return client[_0x4052('0xa')](_0xe9f634,_0x8887f6)['then'](function(_0x3f2075){logger[_0x4052('0xb')](_0x4052('0xc'),_0x3989fc,_0x4052('0xd'));logger[_0x4052('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3989fc,_0x4052('0xd'),JSON[_0x4052('0xf')](_0x3f2075));if(_0x3f2075[_0x4052('0x10')]){if(_0x3f2075[_0x4052('0x10')][_0x4052('0x11')]===0x1f4){logger[_0x4052('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x3989fc,_0x3f2075[_0x4052('0x10')][_0x4052('0x12')]);return _0x253a5(_0x3f2075['error']['message']);}logger[_0x4052('0x10')](_0x4052('0xc'),_0x3989fc,_0x3f2075['error']['message']);return _0x4cdd9c(_0x3f2075['error'][_0x4052('0x12')]);}else{logger[_0x4052('0xb')](_0x4052('0xc'),_0x3989fc,_0x4052('0xd'));_0x4cdd9c(_0x3f2075[_0x4052('0x13')]['message']);}})[_0x4052('0x14')](function(_0x3980e6){logger[_0x4052('0x10')](_0x4052('0xc'),_0x3989fc,_0x3980e6);_0x253a5(_0x3980e6);});});} \ No newline at end of file +var _0x9ac7=['client','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9ac7,0x9a));var _0x79ac=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9ac7[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x79ac('0x0'));var util=require('util');var moment=require(_0x79ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x79ac('0x2'));var fs=require('fs');var Redis=require(_0x79ac('0x3'));var db=require(_0x79ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x79ac('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x79ac('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f656c,_0x53578a,_0x194506){return new BPromise(function(_0x51876a,_0x45a7fd){return client[_0x79ac('0x7')](_0x2f656c,_0x194506)['then'](function(_0x44db39){logger['info'](_0x79ac('0x8'),_0x53578a,_0x79ac('0x9'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x53578a,_0x79ac('0x9'),JSON[_0x79ac('0xa')](_0x44db39));if(_0x44db39['error']){if(_0x44db39['error']['code']===0x1f4){logger[_0x79ac('0xb')](_0x79ac('0x8'),_0x53578a,_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);return _0x45a7fd(_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);}logger[_0x79ac('0xb')](_0x79ac('0x8'),_0x53578a,_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);return _0x51876a(_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);}else{logger[_0x79ac('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x53578a,_0x79ac('0x9'));_0x51876a(_0x44db39[_0x79ac('0xe')]['message']);}})[_0x79ac('0xf')](function(_0x27f5e2){logger[_0x79ac('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x53578a,_0x27f5e2);_0x45a7fd(_0x27f5e2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 85be523..ad06001 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 _0x880e=['delete','destroy','removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','post','create','/:id/sounds'];(function(_0x1968ab,_0x1a70dd){var _0x46be3d=function(_0x34a272){while(--_0x34a272){_0x1968ab['push'](_0x1968ab['shift']());}};_0x46be3d(++_0x1a70dd);}(_0x880e,0xb4));var _0xe880=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x880e[_0x1aeda2];return _0x32dc6d;};'use strict';var multer=require(_0xe880('0x0'));var util=require(_0xe880('0x1'));var path=require(_0xe880('0x2'));var timeout=require(_0xe880('0x3'));var express=require('express');var router=express[_0xe880('0x4')]();var fs_extra=require(_0xe880('0x5'));var auth=require(_0xe880('0x6'));var interaction=require(_0xe880('0x7'));var config=require(_0xe880('0x8'));var controller=require(_0xe880('0x9'));router[_0xe880('0xa')]('/',auth[_0xe880('0xb')](),controller['index']);router['get'](_0xe880('0xc'),auth[_0xe880('0xb')](),controller[_0xe880('0xd')]);router[_0xe880('0xa')]('/:id/sounds',auth[_0xe880('0xb')](),controller[_0xe880('0xe')]);router[_0xe880('0xf')]('/',auth[_0xe880('0xb')](),controller[_0xe880('0x10')]);router['post'](_0xe880('0x11'),auth[_0xe880('0xb')](),controller['addSound']);router['put'](_0xe880('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe880('0x12')](_0xe880('0xc'),auth[_0xe880('0xb')](),controller[_0xe880('0x13')]);router[_0xe880('0x12')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xe880('0x14')]);module[_0xe880('0x15')]=router; \ No newline at end of file +var _0xb4d0=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','util','connect-timeout','express','fs-extra'];(function(_0x31a2e5,_0x4515df){var _0x5ca3bb=function(_0x131983){while(--_0x131983){_0x31a2e5['push'](_0x31a2e5['shift']());}};_0x5ca3bb(++_0x4515df);}(_0xb4d0,0x176));var _0x0b4d=function(_0x2c8b13,_0x12aeb2){_0x2c8b13=_0x2c8b13-0x0;var _0x4df8a7=_0xb4d0[_0x2c8b13];return _0x4df8a7;};'use strict';var multer=require('multer');var util=require(_0x0b4d('0x0'));var path=require('path');var timeout=require(_0x0b4d('0x1'));var express=require(_0x0b4d('0x2'));var router=express['Router']();var fs_extra=require(_0x0b4d('0x3'));var auth=require(_0x0b4d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0b4d('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x0b4d('0x6')]('/',auth[_0x0b4d('0x7')](),controller[_0x0b4d('0x8')]);router['get'](_0x0b4d('0x9'),auth['isAuthenticated'](),controller[_0x0b4d('0xa')]);router[_0x0b4d('0x6')](_0x0b4d('0xb'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0b4d('0xd')]);router[_0x0b4d('0xe')](_0x0b4d('0xb'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0xf')]);router[_0x0b4d('0x10')](_0x0b4d('0x9'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0x11')]);router[_0x0b4d('0x12')](_0x0b4d('0x9'),auth['isAuthenticated'](),controller[_0x0b4d('0x13')]);router[_0x0b4d('0x12')](_0x0b4d('0x14'),auth['isAuthenticated'](),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 0485e84..c4fefe8 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 _0xde2c=['quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','mp3nb'];(function(_0xa676e6,_0x67b51d){var _0x51aa54=function(_0x1fe1e7){while(--_0x1fe1e7){_0xa676e6['push'](_0xa676e6['shift']());}};_0x51aa54(++_0x67b51d);}(_0xde2c,0x13f));var _0xcde2=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xde2c[_0x31a576];return _0x30b1d3;};'use strict';var Sequelize=require(_0xcde2('0x0'));module[_0xcde2('0x1')]={'name':{'type':Sequelize[_0xcde2('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xcde2('0x3')](_0xcde2('0x4'),'files',_0xcde2('0x5'),_0xcde2('0x6'),_0xcde2('0x7'),_0xcde2('0x8')),'allowNull':!![],'defaultValue':_0xcde2('0x9')},'directory':{'type':Sequelize[_0xcde2('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xcde2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcde2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcde2('0x2')],'allowNull':!![],'defaultValue':_0xcde2('0xa')},'format':{'type':Sequelize[_0xcde2('0x2')],'allowNull':!![]},'stamp':{'type':_0xcde2('0xb')},'defaultEntry':{'type':Sequelize[_0xcde2('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb30f=['STRING','name','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x4f7d50,_0x2f7e5b){var _0x8c9db4=function(_0x22f0b9){while(--_0x22f0b9){_0x4f7d50['push'](_0x4f7d50['shift']());}};_0x8c9db4(++_0x2f7e5b);}(_0xb30f,0x195));var _0xfb30=function(_0x477310,_0x5a3209){_0x477310=_0x477310-0x0;var _0x1271cf=_0xb30f[_0x477310];return _0x1271cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb30('0x0')],'allowNull':![],'unique':_0xfb30('0x1')},'mode':{'type':Sequelize['ENUM'](_0xfb30('0x2'),_0xfb30('0x3'),'mp3nb',_0xfb30('0x4'),_0xfb30('0x5'),_0xfb30('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![],'defaultValue':_0xfb30('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xfb30('0x8')},'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 d73b848..3161cda 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 _0x8cfb=['find','body','sequelize','transaction','mode','files','directory','join','root','create','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','message','removeSound','getSounds','map','nolimit','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','update','then','destroy','MusicOnHolds','sendStatus','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params'];(function(_0x51065f,_0xd93aa8){var _0x42bed3=function(_0x2063d5){while(--_0x2063d5){_0x51065f['push'](_0x51065f['shift']());}};_0x42bed3(++_0xd93aa8);}(_0x8cfb,0xfa));var _0xb8cf=function(_0x5ebd8d,_0x498ea2){_0x5ebd8d=_0x5ebd8d-0x0;var _0x43eaf8=_0x8cfb[_0x5ebd8d];return _0x43eaf8;};'use strict';var emlformat=require(_0xb8cf('0x0'));var rimraf=require(_0xb8cf('0x1'));var zipdir=require(_0xb8cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8cf('0x4'));var util=require(_0xb8cf('0x5'));var path=require(_0xb8cf('0x6'));var sox=require('sox');var csv=require(_0xb8cf('0x7'));var ejs=require(_0xb8cf('0x8'));var fs=require('fs');var fs_extra=require(_0xb8cf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb8cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb8cf('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb8cf('0xc'));var Papa=require(_0xb8cf('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8cf('0xe'));var logger=require(_0xb8cf('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xb8cf('0x10'));var licenseUtil=require(_0xb8cf('0x11'));var db=require(_0xb8cf('0x12'))['db'];function respondWithStatusCode(_0x5b8339,_0x163ba5){_0x163ba5=_0x163ba5||0xcc;return function(_0x161c00){if(_0x161c00){return _0x5b8339['sendStatus'](_0x163ba5);}return _0x5b8339[_0xb8cf('0x13')](_0x163ba5)[_0xb8cf('0x14')]();};}function respondWithResult(_0x5e9462,_0x557e98){_0x557e98=_0x557e98||0xc8;return function(_0x2879a7){if(_0x2879a7){return _0x5e9462[_0xb8cf('0x13')](_0x557e98)['json'](_0x2879a7);}};}function respondWithFilteredResult(_0x3607bf,_0x36b53f){return function(_0x44bf12){if(_0x44bf12){var _0x1f844e=typeof _0x36b53f['offset']===_0xb8cf('0x15')&&typeof _0x36b53f[_0xb8cf('0x16')]===_0xb8cf('0x15');var _0x460311=_0x44bf12[_0xb8cf('0x17')];var _0x217425=_0x1f844e?0x0:_0x36b53f[_0xb8cf('0x18')];var _0x5733a7=_0x1f844e?_0x44bf12[_0xb8cf('0x17')]:_0x36b53f['offset']+_0x36b53f[_0xb8cf('0x16')];var _0x3331e2;if(_0x5733a7>=_0x460311){_0x5733a7=_0x460311;_0x3331e2=0xc8;}else{_0x3331e2=0xce;}_0x3607bf['status'](_0x3331e2);return _0x3607bf[_0xb8cf('0x19')]('Content-Range',_0x217425+'-'+_0x5733a7+'/'+_0x460311)[_0xb8cf('0x1a')](_0x44bf12);}return null;};}function patchUpdates(_0x3613d9){return function(_0x2aed4a){try{jsonpatch[_0xb8cf('0x1b')](_0x2aed4a,_0x3613d9,!![]);}catch(_0x584b1c){return BPromise['reject'](_0x584b1c);}return _0x2aed4a['save']();};}function saveUpdates(_0x120521,_0x1bd65d){return function(_0x40072f){if(_0x40072f){return _0x40072f[_0xb8cf('0x1c')](_0x120521)[_0xb8cf('0x1d')](function(_0x34397d){return _0x34397d;});}return null;};}function removeEntity(_0x2d54f5,_0x3e2ada){return function(_0x42f3af){if(_0x42f3af){return _0x42f3af[_0xb8cf('0x1e')]()[_0xb8cf('0x1d')](function(){var _0xd21be9=_0x42f3af['get']({'plain':!![]});var _0x41e390=_0xb8cf('0x1f');return db['UserProfileResource']['destroy']({'where':{'type':_0x41e390,'resourceId':_0xd21be9['id']}})[_0xb8cf('0x1d')](function(){return _0x42f3af;});})['then'](function(){_0x2d54f5[_0xb8cf('0x13')](0xcc)[_0xb8cf('0x14')]();});}};}function handleEntityNotFound(_0x132afd,_0x12789e){return function(_0x3efe04){if(!_0x3efe04){_0x132afd[_0xb8cf('0x20')](0x194);}return _0x3efe04;};}function handleError(_0x3a16f4,_0x1bd926){_0x1bd926=_0x1bd926||0x1f4;return function(_0x333674){logger['error'](_0x333674['stack']);if(_0x333674[_0xb8cf('0x21')]){delete _0x333674[_0xb8cf('0x21')];}_0x3a16f4['status'](_0x1bd926)['send'](_0x333674);};}exports[_0xb8cf('0x22')]=function(_0x466715,_0x2b9681){var _0x226ba6={},_0x4845f2={},_0x42a5af={'count':0x0,'rows':[]};var _0x12f67c=_['map'](db[_0xb8cf('0x23')][_0xb8cf('0x24')],function(_0x35f6cf){return{'name':_0x35f6cf[_0xb8cf('0x25')],'type':_0x35f6cf[_0xb8cf('0x26')][_0xb8cf('0x27')]};});_0x4845f2[_0xb8cf('0x28')]=_['map'](_0x12f67c,_0xb8cf('0x21'));_0x4845f2[_0xb8cf('0x29')]=_[_0xb8cf('0x2a')](_0x466715[_0xb8cf('0x29')]);_0x4845f2[_0xb8cf('0x2b')]=_[_0xb8cf('0x2c')](_0x4845f2['model'],_0x4845f2['query']);_0x226ba6['attributes']=_[_0xb8cf('0x2c')](_0x4845f2[_0xb8cf('0x28')],qs[_0xb8cf('0x2d')](_0x466715[_0xb8cf('0x29')][_0xb8cf('0x2d')]));_0x226ba6[_0xb8cf('0x2e')]=_0x226ba6[_0xb8cf('0x2e')][_0xb8cf('0x2f')]?_0x226ba6[_0xb8cf('0x2e')]:_0x4845f2[_0xb8cf('0x28')];if(!_0x466715[_0xb8cf('0x29')][_0xb8cf('0x30')]('nolimit')){_0x226ba6[_0xb8cf('0x16')]=qs[_0xb8cf('0x16')](_0x466715[_0xb8cf('0x29')][_0xb8cf('0x16')]);_0x226ba6[_0xb8cf('0x18')]=qs[_0xb8cf('0x18')](_0x466715['query'][_0xb8cf('0x18')]);}_0x226ba6[_0xb8cf('0x31')]=qs[_0xb8cf('0x32')](_0x466715[_0xb8cf('0x29')][_0xb8cf('0x32')]);delete _0x466715[_0xb8cf('0x29')][_0xb8cf('0x32')];_0x226ba6['where']=qs[_0xb8cf('0x2b')](_[_0xb8cf('0x33')](_0x466715['query'],_0x4845f2[_0xb8cf('0x2b')]),_0x12f67c);if(_0x466715[_0xb8cf('0x29')][_0xb8cf('0x34')]){_0x226ba6[_0xb8cf('0x35')]=_[_0xb8cf('0x36')](_0x226ba6[_0xb8cf('0x35')],{'$or':_['map'](_0x12f67c,function(_0x28ad6a){if(_0x28ad6a['type']!=='VIRTUAL'){var _0x10e8c0={};_0x10e8c0[_0x28ad6a[_0xb8cf('0x21')]]={'$like':'%'+_0x466715[_0xb8cf('0x29')][_0xb8cf('0x34')]+'%'};return _0x10e8c0;}})});}_0x226ba6=_[_0xb8cf('0x36')]({},_0x226ba6,_0x466715[_0xb8cf('0x37')]);var _0x591d07={'where':_0x226ba6[_0xb8cf('0x35')]};return db[_0xb8cf('0x23')][_0xb8cf('0x17')](_0x591d07)[_0xb8cf('0x1d')](function(_0x297bb9){_0x42a5af['count']=_0x297bb9;if(_0x466715['query'][_0xb8cf('0x38')]){_0x226ba6[_0xb8cf('0x39')]=[{'all':!![]}];}return db[_0xb8cf('0x23')]['findAll'](_0x226ba6);})[_0xb8cf('0x1d')](function(_0x293bbc){_0x42a5af[_0xb8cf('0x3a')]=_0x293bbc;return _0x42a5af;})['then'](respondWithFilteredResult(_0x2b9681,_0x226ba6))[_0xb8cf('0x3b')](handleError(_0x2b9681,null));};exports[_0xb8cf('0x3c')]=function(_0x3b36c0,_0xbdd7a8){var _0x5c524b={'raw':![],'where':{'id':_0x3b36c0[_0xb8cf('0x3d')]['id']}},_0x3f3eb9={};_0x3f3eb9[_0xb8cf('0x28')]=_[_0xb8cf('0x2a')](db['VoiceMusicOnHold'][_0xb8cf('0x24')]);_0x3f3eb9['query']=_[_0xb8cf('0x2a')](_0x3b36c0[_0xb8cf('0x29')]);_0x3f3eb9[_0xb8cf('0x2b')]=_[_0xb8cf('0x2c')](_0x3f3eb9[_0xb8cf('0x28')],_0x3f3eb9[_0xb8cf('0x29')]);_0x5c524b[_0xb8cf('0x2e')]=_[_0xb8cf('0x2c')](_0x3f3eb9[_0xb8cf('0x28')],qs[_0xb8cf('0x2d')](_0x3b36c0['query'][_0xb8cf('0x2d')]));_0x5c524b[_0xb8cf('0x2e')]=_0x5c524b['attributes'][_0xb8cf('0x2f')]?_0x5c524b[_0xb8cf('0x2e')]:_0x3f3eb9[_0xb8cf('0x28')];if(_0x3b36c0['query'][_0xb8cf('0x38')]){_0x5c524b[_0xb8cf('0x39')]=[{'all':!![]}];}_0x5c524b=_['merge']({},_0x5c524b,_0x3b36c0[_0xb8cf('0x37')]);return db[_0xb8cf('0x23')][_0xb8cf('0x3e')](_0x5c524b)[_0xb8cf('0x1d')](handleEntityNotFound(_0xbdd7a8,null))[_0xb8cf('0x1d')](respondWithResult(_0xbdd7a8,null))[_0xb8cf('0x3b')](handleError(_0xbdd7a8,null));};exports[_0xb8cf('0x1c')]=function(_0x51693c,_0x1b57b1){if(_0x51693c['body']['id']){delete _0x51693c[_0xb8cf('0x3f')]['id'];}return db[_0xb8cf('0x23')][_0xb8cf('0x3e')]({'where':{'id':_0x51693c[_0xb8cf('0x3d')]['id']}})[_0xb8cf('0x1d')](handleEntityNotFound(_0x1b57b1,null))[_0xb8cf('0x1d')](saveUpdates(_0x51693c[_0xb8cf('0x3f')],null))[_0xb8cf('0x1d')](respondWithResult(_0x1b57b1,null))[_0xb8cf('0x3b')](handleError(_0x1b57b1,null));};exports['create']=function(_0x10043f,_0x19aa5e,_0x1507e1){return db[_0xb8cf('0x40')][_0xb8cf('0x41')](function(_0x1fa138){if(_0x10043f['body'][_0xb8cf('0x42')]===_0xb8cf('0x43')){_0x10043f[_0xb8cf('0x3f')][_0xb8cf('0x44')]=path[_0xb8cf('0x45')](config[_0xb8cf('0x46')],'server/files/moh',_0x10043f[_0xb8cf('0x3f')][_0xb8cf('0x21')]);}return db[_0xb8cf('0x23')][_0xb8cf('0x47')](_0x10043f[_0xb8cf('0x3f')],{'transaction':_0x1fa138})['then'](function(_0x2eca9e){if(_0x10043f[_0xb8cf('0x3f')][_0xb8cf('0x42')]==='files'){fs[_0xb8cf('0x48')](_0x2eca9e[_0xb8cf('0x44')],parseInt(_0xb8cf('0x49'),0x8));}var _0x1e9a46=_0x10043f[_0xb8cf('0x4a')][_0xb8cf('0x4b')]({'plain':!![]});if(!_0x1e9a46)throw new Error(_0xb8cf('0x4c'));if(_0x1e9a46[_0xb8cf('0x4d')]===_0xb8cf('0x4a')){var _0x4df857=_0x2eca9e[_0xb8cf('0x4b')]({'plain':!![]});return db[_0xb8cf('0x4e')]['find']({'where':{'name':_0xb8cf('0x1f'),'userProfileId':_0x1e9a46[_0xb8cf('0x4f')]},'raw':!![]})[_0xb8cf('0x1d')](function(_0x5d3b19){if(_0x5d3b19&&_0x5d3b19[_0xb8cf('0x50')]===0x0){return db['UserProfileResource'][_0xb8cf('0x47')]({'name':_0x4df857['name'],'resourceId':_0x4df857['id'],'type':_0x5d3b19['name'],'sectionId':_0x5d3b19['id']},{})[_0xb8cf('0x1d')](function(){return _0x2eca9e;});}else{return _0x2eca9e;}})[_0xb8cf('0x3b')](function(_0x5a0fca){logger['error'](_0xb8cf('0x51'),_0x5a0fca);});}return _0x2eca9e;});})[_0xb8cf('0x1d')](respondWithResult(_0x19aa5e,0xc9))[_0xb8cf('0x3b')](handleError(_0x19aa5e,null));};exports[_0xb8cf('0x1e')]=function(_0x18cc2d,_0x376ee3,_0x191cb8){var _0x322df5;return db[_0xb8cf('0x23')][_0xb8cf('0x3e')]({'where':{'id':_0x18cc2d[_0xb8cf('0x3d')]['id']}})[_0xb8cf('0x1d')](function(_0x3c0d6a){if(_0x3c0d6a){return db['sequelize']['transaction'](function(_0xb4fd28){return _0x3c0d6a['destroy']({'transaction':_0xb4fd28,'raw':!![]})['then'](function(_0x1431b5){if(_0x1431b5['directory']){fs[_0xb8cf('0x52')](_0x1431b5['directory'])[_0xb8cf('0x53')](function(_0x3163ac){fs[_0xb8cf('0x54')](path['join'](_0x1431b5[_0xb8cf('0x44')],_0x3163ac));});fs[_0xb8cf('0x55')](_0x1431b5[_0xb8cf('0x44')]);}return _0x1431b5;});})[_0xb8cf('0x3b')](function(_0x22f3a5){throw new db[(_0xb8cf('0x56'))][(_0xb8cf('0x57'))](_0x22f3a5['message']);});}})[_0xb8cf('0x1d')](handleEntityNotFound(_0x376ee3,null))['then'](removeEntity(_0x376ee3,null))[_0xb8cf('0x3b')](handleError(_0x376ee3,null));};exports['addSound']=function(_0x3b94cb,_0x426b4d,_0x3f80d6){return db[_0xb8cf('0x40')][_0xb8cf('0x41')](function(_0x5be963){var _0x3cbac7;return db[_0xb8cf('0x23')]['find']({'where':{'id':_0x3b94cb['params']['id']}})[_0xb8cf('0x1d')](function(_0x13b119){if(_0x13b119){_0x3cbac7=_0x13b119;return _0x13b119[_0xb8cf('0x58')](_0x3b94cb[_0xb8cf('0x3f')]['id'],{'transaction':_0x5be963});}})[_0xb8cf('0x1d')](function(_0x39e1c5){if(_0x39e1c5){return db[_0xb8cf('0x59')][_0xb8cf('0x5a')]({'where':{'id':_0x3b94cb[_0xb8cf('0x3f')]['id']},'attributes':['id','name',_0xb8cf('0x5b'),_0xb8cf('0x5c'),_0xb8cf('0x5d')],'raw':!![]});}})[_0xb8cf('0x1d')](function(_0x2acb47){if(_0x2acb47){var _0x5221a1=path[_0xb8cf('0x45')](config['root'],_0xb8cf('0x5e'),util[_0xb8cf('0x5f')](_0xb8cf('0x60'),path['basename'](_0x2acb47[_0xb8cf('0x5b')],path[_0xb8cf('0x61')](_0x2acb47[_0xb8cf('0x5b')])),_0x2acb47[_0xb8cf('0x5c')]));var _0x3544b4=path['join'](config[_0xb8cf('0x46')],'server/files/moh',_0x3cbac7['name'],util[_0xb8cf('0x5f')](_0xb8cf('0x60'),_0x2acb47[_0xb8cf('0x21')],_0x2acb47[_0xb8cf('0x5c')]));fs[_0xb8cf('0x62')](_0x5221a1,_0x3544b4);return _0x2acb47;}})[_0xb8cf('0x3b')](function(_0x50446d){throw new db[(_0xb8cf('0x56'))][(_0xb8cf('0x57'))](_0x50446d[_0xb8cf('0x63')]);});})[_0xb8cf('0x1d')](handleEntityNotFound(_0x426b4d,null))[_0xb8cf('0x1d')](respondWithResult(_0x426b4d,0xc9))[_0xb8cf('0x3b')](handleError(_0x426b4d,null));};exports[_0xb8cf('0x64')]=function(_0xe3d4dc,_0x204079,_0xf8c1fa){return db[_0xb8cf('0x40')][_0xb8cf('0x41')](function(_0x34943d){var _0x9e57a6;return db[_0xb8cf('0x23')]['findOne']({'where':{'id':_0xe3d4dc['params']['id']}})['then'](handleEntityNotFound(_0x204079,null))[_0xb8cf('0x1d')](function(_0x23d24b){if(_0x23d24b){_0x9e57a6=_0x23d24b;return _0x23d24b[_0xb8cf('0x64')](_0xe3d4dc[_0xb8cf('0x3d')]['id2']);}})['then'](function(_0xd47358){if(_0xd47358){return db[_0xb8cf('0x59')][_0xb8cf('0x5a')]({'where':{'id':_0xe3d4dc[_0xb8cf('0x3d')]['id2']},'attributes':['id','name','save_name',_0xb8cf('0x5c'),_0xb8cf('0x5d')],'raw':!![]});}})[_0xb8cf('0x1d')](function(_0x5351b8){if(_0x5351b8){fs[_0xb8cf('0x54')](path['join'](_0x9e57a6['directory'],util[_0xb8cf('0x5f')](_0xb8cf('0x60'),_0x5351b8[_0xb8cf('0x21')],_0x5351b8[_0xb8cf('0x5c')])));return _0x5351b8;}})[_0xb8cf('0x3b')](function(_0x2e9dfb){throw new db[(_0xb8cf('0x56'))][(_0xb8cf('0x57'))](_0x2e9dfb['message']);});})[_0xb8cf('0x1d')](handleEntityNotFound(_0x204079,null))[_0xb8cf('0x1d')](respondWithStatusCode(_0x204079,0xcc))[_0xb8cf('0x3b')](handleError(_0x204079,null));};exports[_0xb8cf('0x65')]=function(_0x3a2ff2,_0x2ecd1f,_0x49eddd){var _0x28a4b6={};var _0x350d27={};var _0x20dbbb;var _0x259bff;return db[_0xb8cf('0x23')][_0xb8cf('0x5a')]({'where':{'id':_0x3a2ff2[_0xb8cf('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ecd1f,null))[_0xb8cf('0x1d')](function(_0x2f7d08){if(_0x2f7d08){_0x20dbbb=_0x2f7d08;_0x350d27[_0xb8cf('0x28')]=_[_0xb8cf('0x2a')](db['Sound']['rawAttributes']);_0x350d27[_0xb8cf('0x29')]=_['keys'](_0x3a2ff2[_0xb8cf('0x29')]);_0x350d27[_0xb8cf('0x2b')]=_[_0xb8cf('0x2c')](_0x350d27[_0xb8cf('0x28')],_0x350d27['query']);_0x28a4b6[_0xb8cf('0x2e')]=_[_0xb8cf('0x2c')](_0x350d27['model'],qs[_0xb8cf('0x2d')](_0x3a2ff2[_0xb8cf('0x29')]['fields']));_0x28a4b6[_0xb8cf('0x2e')]=_0x28a4b6['attributes'][_0xb8cf('0x2f')]?_0x28a4b6[_0xb8cf('0x2e')]:_0x350d27[_0xb8cf('0x28')];_0x28a4b6[_0xb8cf('0x31')]=qs['sort'](_0x3a2ff2[_0xb8cf('0x29')][_0xb8cf('0x32')]);_0x28a4b6['where']=qs['filters'](_['pick'](_0x3a2ff2[_0xb8cf('0x29')],_0x350d27['filters']));if(_0x3a2ff2[_0xb8cf('0x29')][_0xb8cf('0x34')]){_0x28a4b6[_0xb8cf('0x35')]=_[_0xb8cf('0x36')](_0x28a4b6[_0xb8cf('0x35')],{'$or':_[_0xb8cf('0x66')](_0x28a4b6[_0xb8cf('0x2e')],function(_0x32b79d){var _0xcea108={};_0xcea108[_0x32b79d]={'$like':'%'+_0x3a2ff2[_0xb8cf('0x29')][_0xb8cf('0x34')]+'%'};return _0xcea108;})});}_0x28a4b6=_['merge']({},_0x28a4b6,_0x3a2ff2[_0xb8cf('0x37')]);return _0x20dbbb[_0xb8cf('0x65')](_0x28a4b6);}})[_0xb8cf('0x1d')](function(_0x38a1fb){if(_0x38a1fb){_0x259bff=_0x38a1fb['length'];if(!_0x3a2ff2['query'][_0xb8cf('0x30')](_0xb8cf('0x67'))){_0x28a4b6['limit']=qs[_0xb8cf('0x16')](_0x3a2ff2['query'][_0xb8cf('0x16')]);_0x28a4b6[_0xb8cf('0x18')]=qs[_0xb8cf('0x18')](_0x3a2ff2['query'][_0xb8cf('0x18')]);}return _0x20dbbb[_0xb8cf('0x65')](_0x28a4b6);}})[_0xb8cf('0x1d')](function(_0x4f2ae1){if(_0x4f2ae1){return _0x4f2ae1?{'count':_0x259bff,'rows':_0x4f2ae1}:null;}})[_0xb8cf('0x1d')](respondWithResult(_0x2ecd1f,null))[_0xb8cf('0x3b')](handleError(_0x2ecd1f,null));}; \ No newline at end of file +var _0x0810=['transaction','files','join','root','server/files/moh','mode','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','extname','symlinkSync','message','removeSound','id2','unlinkSync','getSounds','sort','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','reject','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','VoiceMusicOnHold','findAll','rows','params','keys','include','merge','find','catch','body','create','sequelize'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0810,0x1da));var _0x0081=function(_0x126125,_0x1e8479){_0x126125=_0x126125-0x0;var _0x4307dd=_0x0810[_0x126125];return _0x4307dd;};'use strict';var emlformat=require(_0x0081('0x0'));var rimraf=require(_0x0081('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0081('0x2'));var rp=require(_0x0081('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0081('0x4'));var path=require('path');var sox=require(_0x0081('0x5'));var csv=require(_0x0081('0x6'));var ejs=require(_0x0081('0x7'));var fs=require('fs');var fs_extra=require(_0x0081('0x8'));var _=require(_0x0081('0x9'));var squel=require(_0x0081('0xa'));var crypto=require(_0x0081('0xb'));var jsforce=require(_0x0081('0xc'));var deskjs=require(_0x0081('0xd'));var toCsv=require(_0x0081('0x6'));var querystring=require('querystring');var Papa=require(_0x0081('0xe'));var Redis=require(_0x0081('0xf'));var authService=require(_0x0081('0x10'));var qs=require(_0x0081('0x11'));var as=require(_0x0081('0x12'));var hardwareService=require(_0x0081('0x13'));var logger=require(_0x0081('0x14'))(_0x0081('0x15'));var utils=require(_0x0081('0x16'));var config=require(_0x0081('0x17'));var licenseUtil=require(_0x0081('0x18'));var db=require(_0x0081('0x19'))['db'];function respondWithStatusCode(_0xdc2bb8,_0x33c906){_0x33c906=_0x33c906||0xcc;return function(_0x6c4e18){if(_0x6c4e18){return _0xdc2bb8['sendStatus'](_0x33c906);}return _0xdc2bb8[_0x0081('0x1a')](_0x33c906)[_0x0081('0x1b')]();};}function respondWithResult(_0x1e5e65,_0x3a4ef4){_0x3a4ef4=_0x3a4ef4||0xc8;return function(_0x5241eb){if(_0x5241eb){return _0x1e5e65[_0x0081('0x1a')](_0x3a4ef4)['json'](_0x5241eb);}};}function respondWithFilteredResult(_0x3ba6c8,_0x1584dc){return function(_0x2c794c){if(_0x2c794c){var _0x517071=typeof _0x1584dc['offset']===_0x0081('0x1c')&&typeof _0x1584dc[_0x0081('0x1d')]===_0x0081('0x1c');var _0x3cd074=_0x2c794c[_0x0081('0x1e')];var _0x1c835b=_0x517071?0x0:_0x1584dc[_0x0081('0x1f')];var _0x27fb95=_0x517071?_0x2c794c[_0x0081('0x1e')]:_0x1584dc[_0x0081('0x1f')]+_0x1584dc[_0x0081('0x1d')];var _0x50edc6;if(_0x27fb95>=_0x3cd074){_0x27fb95=_0x3cd074;_0x50edc6=0xc8;}else{_0x50edc6=0xce;}_0x3ba6c8[_0x0081('0x1a')](_0x50edc6);return _0x3ba6c8[_0x0081('0x20')]('Content-Range',_0x1c835b+'-'+_0x27fb95+'/'+_0x3cd074)[_0x0081('0x21')](_0x2c794c);}return null;};}function patchUpdates(_0x2bcf40){return function(_0x5b927c){try{jsonpatch['apply'](_0x5b927c,_0x2bcf40,!![]);}catch(_0x3c8cab){return BPromise[_0x0081('0x22')](_0x3c8cab);}return _0x5b927c['save']();};}function saveUpdates(_0x81b4e4,_0x2fb064){return function(_0x41790e){if(_0x41790e){return _0x41790e[_0x0081('0x23')](_0x81b4e4)['then'](function(_0x1cff90){return _0x1cff90;});}return null;};}function removeEntity(_0x83f517,_0xe8be7c){return function(_0x1380ea){if(_0x1380ea){return _0x1380ea[_0x0081('0x24')]()[_0x0081('0x25')](function(){var _0x5c84cf=_0x1380ea[_0x0081('0x26')]({'plain':!![]});var _0x5d43d6=_0x0081('0x27');return db[_0x0081('0x28')][_0x0081('0x24')]({'where':{'type':_0x5d43d6,'resourceId':_0x5c84cf['id']}})[_0x0081('0x25')](function(){return _0x1380ea;});})['then'](function(){_0x83f517[_0x0081('0x1a')](0xcc)[_0x0081('0x1b')]();});}};}function handleEntityNotFound(_0xe5f96a,_0x5dccf7){return function(_0x1a84a0){if(!_0x1a84a0){_0xe5f96a['sendStatus'](0x194);}return _0x1a84a0;};}function handleError(_0x23cfd2,_0x555ce6){_0x555ce6=_0x555ce6||0x1f4;return function(_0x17ed77){logger[_0x0081('0x29')](_0x17ed77['stack']);if(_0x17ed77[_0x0081('0x2a')]){delete _0x17ed77[_0x0081('0x2a')];}_0x23cfd2[_0x0081('0x1a')](_0x555ce6)[_0x0081('0x2b')](_0x17ed77);};}exports[_0x0081('0x2c')]=function(_0x25da50,_0x4b4020){var _0x44d672={},_0x2e5e5f={},_0x24abc0={'count':0x0,'rows':[]};var _0x4f8023=_[_0x0081('0x2d')](db['VoiceMusicOnHold'][_0x0081('0x2e')],function(_0x38c1f1){return{'name':_0x38c1f1['fieldName'],'type':_0x38c1f1[_0x0081('0x2f')][_0x0081('0x30')]};});_0x2e5e5f[_0x0081('0x31')]=_[_0x0081('0x2d')](_0x4f8023,'name');_0x2e5e5f[_0x0081('0x32')]=_['keys'](_0x25da50[_0x0081('0x32')]);_0x2e5e5f[_0x0081('0x33')]=_[_0x0081('0x34')](_0x2e5e5f['model'],_0x2e5e5f['query']);_0x44d672[_0x0081('0x35')]=_['intersection'](_0x2e5e5f[_0x0081('0x31')],qs[_0x0081('0x36')](_0x25da50[_0x0081('0x32')][_0x0081('0x36')]));_0x44d672['attributes']=_0x44d672[_0x0081('0x35')][_0x0081('0x37')]?_0x44d672[_0x0081('0x35')]:_0x2e5e5f[_0x0081('0x31')];if(!_0x25da50['query'][_0x0081('0x38')](_0x0081('0x39'))){_0x44d672['limit']=qs[_0x0081('0x1d')](_0x25da50[_0x0081('0x32')]['limit']);_0x44d672['offset']=qs[_0x0081('0x1f')](_0x25da50['query']['offset']);}_0x44d672[_0x0081('0x3a')]=qs['sort'](_0x25da50['query']['sort']);delete _0x25da50[_0x0081('0x32')]['sort'];_0x44d672[_0x0081('0x3b')]=qs[_0x0081('0x33')](_[_0x0081('0x3c')](_0x25da50[_0x0081('0x32')],_0x2e5e5f[_0x0081('0x33')]),_0x4f8023);if(_0x25da50[_0x0081('0x32')][_0x0081('0x3d')]){_0x44d672[_0x0081('0x3b')]=_['merge'](_0x44d672[_0x0081('0x3b')],{'$or':_[_0x0081('0x2d')](_0x4f8023,function(_0x2dc556){if(_0x2dc556[_0x0081('0x2f')]!==_0x0081('0x3e')){var _0x25280c={};_0x25280c[_0x2dc556[_0x0081('0x2a')]]={'$like':'%'+_0x25da50['query'][_0x0081('0x3d')]+'%'};return _0x25280c;}})});}_0x44d672=_['merge']({},_0x44d672,_0x25da50[_0x0081('0x3f')]);var _0x23eeef={'where':_0x44d672[_0x0081('0x3b')]};return db['VoiceMusicOnHold'][_0x0081('0x1e')](_0x23eeef)[_0x0081('0x25')](function(_0x5c0157){_0x24abc0[_0x0081('0x1e')]=_0x5c0157;if(_0x25da50[_0x0081('0x32')]['includeAll']){_0x44d672['include']=[{'all':!![]}];}return db[_0x0081('0x40')][_0x0081('0x41')](_0x44d672);})[_0x0081('0x25')](function(_0x173a6e){_0x24abc0[_0x0081('0x42')]=_0x173a6e;return _0x24abc0;})[_0x0081('0x25')](respondWithFilteredResult(_0x4b4020,_0x44d672))['catch'](handleError(_0x4b4020,null));};exports['show']=function(_0x5312e0,_0x2aee58){var _0x44bf18={'raw':![],'where':{'id':_0x5312e0[_0x0081('0x43')]['id']}},_0x5994f4={};_0x5994f4[_0x0081('0x31')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x5994f4[_0x0081('0x32')]=_[_0x0081('0x44')](_0x5312e0[_0x0081('0x32')]);_0x5994f4[_0x0081('0x33')]=_[_0x0081('0x34')](_0x5994f4[_0x0081('0x31')],_0x5994f4[_0x0081('0x32')]);_0x44bf18['attributes']=_[_0x0081('0x34')](_0x5994f4[_0x0081('0x31')],qs[_0x0081('0x36')](_0x5312e0[_0x0081('0x32')][_0x0081('0x36')]));_0x44bf18[_0x0081('0x35')]=_0x44bf18[_0x0081('0x35')][_0x0081('0x37')]?_0x44bf18[_0x0081('0x35')]:_0x5994f4['model'];if(_0x5312e0[_0x0081('0x32')]['includeAll']){_0x44bf18[_0x0081('0x45')]=[{'all':!![]}];}_0x44bf18=_[_0x0081('0x46')]({},_0x44bf18,_0x5312e0[_0x0081('0x3f')]);return db[_0x0081('0x40')][_0x0081('0x47')](_0x44bf18)[_0x0081('0x25')](handleEntityNotFound(_0x2aee58,null))[_0x0081('0x25')](respondWithResult(_0x2aee58,null))[_0x0081('0x48')](handleError(_0x2aee58,null));};exports['update']=function(_0x4adec0,_0x211543){if(_0x4adec0[_0x0081('0x49')]['id']){delete _0x4adec0['body']['id'];}return db[_0x0081('0x40')]['find']({'where':{'id':_0x4adec0['params']['id']}})[_0x0081('0x25')](handleEntityNotFound(_0x211543,null))['then'](saveUpdates(_0x4adec0[_0x0081('0x49')],null))[_0x0081('0x25')](respondWithResult(_0x211543,null))[_0x0081('0x48')](handleError(_0x211543,null));};exports[_0x0081('0x4a')]=function(_0x2502f3,_0x4ec89a,_0x5a8e4c){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x18d91b){if(_0x2502f3[_0x0081('0x49')]['mode']===_0x0081('0x4d')){_0x2502f3[_0x0081('0x49')]['directory']=path[_0x0081('0x4e')](config[_0x0081('0x4f')],_0x0081('0x50'),_0x2502f3[_0x0081('0x49')][_0x0081('0x2a')]);}return db[_0x0081('0x40')][_0x0081('0x4a')](_0x2502f3[_0x0081('0x49')],{'transaction':_0x18d91b})[_0x0081('0x25')](function(_0x37dd0e){if(_0x2502f3['body'][_0x0081('0x51')]==='files'){fs['mkdirSync'](_0x37dd0e[_0x0081('0x52')],parseInt(_0x0081('0x53'),0x8));}var _0x57a371=_0x2502f3[_0x0081('0x54')][_0x0081('0x26')]({'plain':!![]});if(!_0x57a371)throw new Error(_0x0081('0x55'));if(_0x57a371[_0x0081('0x56')]==='user'){var _0xf56058=_0x37dd0e['get']({'plain':!![]});return db[_0x0081('0x57')]['find']({'where':{'name':_0x0081('0x27'),'userProfileId':_0x57a371[_0x0081('0x58')]},'raw':!![]})['then'](function(_0xa30b3c){if(_0xa30b3c&&_0xa30b3c[_0x0081('0x59')]===0x0){return db['UserProfileResource'][_0x0081('0x4a')]({'name':_0xf56058['name'],'resourceId':_0xf56058['id'],'type':_0xa30b3c[_0x0081('0x2a')],'sectionId':_0xa30b3c['id']},{})[_0x0081('0x25')](function(){return _0x37dd0e;});}else{return _0x37dd0e;}})[_0x0081('0x48')](function(_0x31ce9a){logger[_0x0081('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ce9a);});}return _0x37dd0e;});})[_0x0081('0x25')](respondWithResult(_0x4ec89a,0xc9))['catch'](handleError(_0x4ec89a,null));};exports[_0x0081('0x24')]=function(_0x51fbf3,_0x59ff5d,_0x46749b){var _0x5717fb;return db[_0x0081('0x40')][_0x0081('0x47')]({'where':{'id':_0x51fbf3['params']['id']}})[_0x0081('0x25')](function(_0x462b5f){if(_0x462b5f){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x22110a){return _0x462b5f['destroy']({'transaction':_0x22110a,'raw':!![]})[_0x0081('0x25')](function(_0x5a6966){if(_0x5a6966[_0x0081('0x52')]){fs['readdirSync'](_0x5a6966['directory'])['forEach'](function(_0x2bc570){fs['unlinkSync'](path[_0x0081('0x4e')](_0x5a6966[_0x0081('0x52')],_0x2bc570));});fs[_0x0081('0x5a')](_0x5a6966[_0x0081('0x52')]);}return _0x5a6966;});})[_0x0081('0x48')](function(_0x393127){throw new db[(_0x0081('0x5b'))][(_0x0081('0x5c'))](_0x393127['message']);});}})['then'](handleEntityNotFound(_0x59ff5d,null))[_0x0081('0x25')](removeEntity(_0x59ff5d,null))[_0x0081('0x48')](handleError(_0x59ff5d,null));};exports[_0x0081('0x5d')]=function(_0x1c63ba,_0x1f9a0,_0xf3915e){return db[_0x0081('0x4b')]['transaction'](function(_0x5508e9){var _0x21018f;return db[_0x0081('0x40')]['find']({'where':{'id':_0x1c63ba[_0x0081('0x43')]['id']}})[_0x0081('0x25')](function(_0x988837){if(_0x988837){_0x21018f=_0x988837;return _0x988837['addSound'](_0x1c63ba[_0x0081('0x49')]['id'],{'transaction':_0x5508e9});}})[_0x0081('0x25')](function(_0x98657d){if(_0x98657d){return db[_0x0081('0x5e')][_0x0081('0x5f')]({'where':{'id':_0x1c63ba[_0x0081('0x49')]['id']},'attributes':['id','name',_0x0081('0x60'),_0x0081('0x61'),_0x0081('0x62')],'raw':!![]});}})[_0x0081('0x25')](function(_0x5ebbb9){if(_0x5ebbb9){var _0x4f8fa4=path[_0x0081('0x4e')](config[_0x0081('0x4f')],'server/files/sounds/converted',util[_0x0081('0x63')](_0x0081('0x64'),path[_0x0081('0x65')](_0x5ebbb9['save_name'],path[_0x0081('0x66')](_0x5ebbb9[_0x0081('0x60')])),_0x5ebbb9[_0x0081('0x61')]));var _0x133199=path[_0x0081('0x4e')](config[_0x0081('0x4f')],'server/files/moh',_0x21018f['name'],util['format'](_0x0081('0x64'),_0x5ebbb9[_0x0081('0x2a')],_0x5ebbb9[_0x0081('0x61')]));fs[_0x0081('0x67')](_0x4f8fa4,_0x133199);return _0x5ebbb9;}})['catch'](function(_0x21b88d){throw new db['Sequelize'][(_0x0081('0x5c'))](_0x21b88d[_0x0081('0x68')]);});})['then'](handleEntityNotFound(_0x1f9a0,null))[_0x0081('0x25')](respondWithResult(_0x1f9a0,0xc9))[_0x0081('0x48')](handleError(_0x1f9a0,null));};exports[_0x0081('0x69')]=function(_0x27e9c2,_0x54b64e,_0x49d07a){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x5c7f64){var _0x115bd4;return db[_0x0081('0x40')]['findOne']({'where':{'id':_0x27e9c2[_0x0081('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b64e,null))[_0x0081('0x25')](function(_0x541989){if(_0x541989){_0x115bd4=_0x541989;return _0x541989[_0x0081('0x69')](_0x27e9c2[_0x0081('0x43')][_0x0081('0x6a')]);}})['then'](function(_0x26bdf2){if(_0x26bdf2){return db[_0x0081('0x5e')][_0x0081('0x5f')]({'where':{'id':_0x27e9c2[_0x0081('0x43')][_0x0081('0x6a')]},'attributes':['id',_0x0081('0x2a'),'save_name',_0x0081('0x61'),_0x0081('0x62')],'raw':!![]});}})[_0x0081('0x25')](function(_0x1f4f3e){if(_0x1f4f3e){fs[_0x0081('0x6b')](path[_0x0081('0x4e')](_0x115bd4['directory'],util[_0x0081('0x63')](_0x0081('0x64'),_0x1f4f3e['name'],_0x1f4f3e[_0x0081('0x61')])));return _0x1f4f3e;}})[_0x0081('0x48')](function(_0x18282f){throw new db[(_0x0081('0x5b'))][(_0x0081('0x5c'))](_0x18282f[_0x0081('0x68')]);});})[_0x0081('0x25')](handleEntityNotFound(_0x54b64e,null))[_0x0081('0x25')](respondWithStatusCode(_0x54b64e,0xcc))['catch'](handleError(_0x54b64e,null));};exports[_0x0081('0x6c')]=function(_0x27f0d5,_0x3d5b2f,_0x37564b){var _0x14eaf1={};var _0x371cb4={};var _0x2a25f4;var _0x4c57e3;return db['VoiceMusicOnHold'][_0x0081('0x5f')]({'where':{'id':_0x27f0d5['params']['id']}})[_0x0081('0x25')](handleEntityNotFound(_0x3d5b2f,null))[_0x0081('0x25')](function(_0x1993a4){if(_0x1993a4){_0x2a25f4=_0x1993a4;_0x371cb4['model']=_['keys'](db['Sound'][_0x0081('0x2e')]);_0x371cb4[_0x0081('0x32')]=_[_0x0081('0x44')](_0x27f0d5[_0x0081('0x32')]);_0x371cb4[_0x0081('0x33')]=_[_0x0081('0x34')](_0x371cb4[_0x0081('0x31')],_0x371cb4[_0x0081('0x32')]);_0x14eaf1['attributes']=_[_0x0081('0x34')](_0x371cb4[_0x0081('0x31')],qs[_0x0081('0x36')](_0x27f0d5['query']['fields']));_0x14eaf1['attributes']=_0x14eaf1[_0x0081('0x35')][_0x0081('0x37')]?_0x14eaf1[_0x0081('0x35')]:_0x371cb4[_0x0081('0x31')];_0x14eaf1[_0x0081('0x3a')]=qs[_0x0081('0x6d')](_0x27f0d5['query'][_0x0081('0x6d')]);_0x14eaf1['where']=qs['filters'](_['pick'](_0x27f0d5[_0x0081('0x32')],_0x371cb4['filters']));if(_0x27f0d5[_0x0081('0x32')][_0x0081('0x3d')]){_0x14eaf1['where']=_['merge'](_0x14eaf1['where'],{'$or':_[_0x0081('0x2d')](_0x14eaf1[_0x0081('0x35')],function(_0x2ff36e){var _0x9c7410={};_0x9c7410[_0x2ff36e]={'$like':'%'+_0x27f0d5['query']['filter']+'%'};return _0x9c7410;})});}_0x14eaf1=_[_0x0081('0x46')]({},_0x14eaf1,_0x27f0d5[_0x0081('0x3f')]);return _0x2a25f4[_0x0081('0x6c')](_0x14eaf1);}})['then'](function(_0x36c839){if(_0x36c839){_0x4c57e3=_0x36c839[_0x0081('0x37')];if(!_0x27f0d5[_0x0081('0x32')][_0x0081('0x38')](_0x0081('0x39'))){_0x14eaf1['limit']=qs['limit'](_0x27f0d5['query'][_0x0081('0x1d')]);_0x14eaf1[_0x0081('0x1f')]=qs[_0x0081('0x1f')](_0x27f0d5[_0x0081('0x32')]['offset']);}return _0x2a25f4[_0x0081('0x6c')](_0x14eaf1);}})['then'](function(_0x4a7aa9){if(_0x4a7aa9){return _0x4a7aa9?{'count':_0x4c57e3,'rows':_0x4a7aa9}:null;}})[_0x0081('0x25')](respondWithResult(_0x3d5b2f,null))[_0x0081('0x48')](handleError(_0x3d5b2f,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3a989fb..e626b75 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 _0x89bb=['bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment'];(function(_0x587b3b,_0x40bca0){var _0x1493e2=function(_0x43305b){while(--_0x43305b){_0x587b3b['push'](_0x587b3b['shift']());}};_0x1493e2(++_0x40bca0);}(_0x89bb,0xb2));var _0xb89b=function(_0x2c6b1a,_0x530f39){_0x2c6b1a=_0x2c6b1a-0x0;var _0x4eab12=_0x89bb[_0x2c6b1a];return _0x4eab12;};'use strict';var _=require('lodash');var util=require(_0xb89b('0x0'));var logger=require(_0xb89b('0x1'))(_0xb89b('0x2'));var moment=require(_0xb89b('0x3'));var BPromise=require(_0xb89b('0x4'));var rp=require(_0xb89b('0x5'));var fs=require('fs');var path=require(_0xb89b('0x6'));var rimraf=require('rimraf');var config=require(_0xb89b('0x7'));var attributes=require(_0xb89b('0x8'));module[_0xb89b('0x9')]=function(_0x2a711f,_0x268854){return _0x2a711f[_0xb89b('0xa')](_0xb89b('0xb'),attributes,{'tableName':_0xb89b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9396=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5ada09,_0x5c2b38){var _0xb89d93=function(_0x7ca413){while(--_0x7ca413){_0x5ada09['push'](_0x5ada09['shift']());}};_0xb89d93(++_0x5c2b38);}(_0x9396,0x10e));var _0x6939=function(_0x3f91f3,_0x294896){_0x3f91f3=_0x3f91f3-0x0;var _0x4a9f96=_0x9396[_0x3f91f3];return _0x4a9f96;};'use strict';var _=require(_0x6939('0x0'));var util=require(_0x6939('0x1'));var logger=require(_0x6939('0x2'))('api');var moment=require(_0x6939('0x3'));var BPromise=require(_0x6939('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6939('0x5'));var rimraf=require(_0x6939('0x6'));var config=require(_0x6939('0x7'));var attributes=require(_0x6939('0x8'));module['exports']=function(_0x3be35c,_0x56ef7b){return _0x3be35c[_0x6939('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x6939('0xa'),'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 a6d5066..035e8d1 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x100d4c,_0x47d49e){var _0x51c17b=function(_0x149376){while(--_0x149376){_0x100d4c['push'](_0x100d4c['shift']());}};_0x51c17b(++_0x47d49e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x138050,_0x4cbc6c){var _0xcdf7b8=function(_0x4e7811){while(--_0x4e7811){_0x138050['push'](_0x138050['shift']());}};_0xcdf7b8(++_0x4cbc6c);}(_0xe706,0xa3));var _0x6e70=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xe706[_0xf1af27];return _0x46b274;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 121136b..8907fdc 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 _0x0689=['destroy','delete','removeAgents','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update'];(function(_0x2e3970,_0x3a80a6){var _0x605962=function(_0x34f9a6){while(--_0x34f9a6){_0x2e3970['push'](_0x2e3970['shift']());}};_0x605962(++_0x3a80a6);}(_0x0689,0x161));var _0x9068=function(_0x257ada,_0x117063){_0x257ada=_0x257ada-0x0;var _0x38bbfd=_0x0689[_0x257ada];return _0x38bbfd;};'use strict';var multer=require('multer');var util=require(_0x9068('0x0'));var path=require('path');var timeout=require(_0x9068('0x1'));var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require(_0x9068('0x5'));var interaction=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var controller=require(_0x9068('0x8'));router[_0x9068('0x9')]('/',auth[_0x9068('0xa')](),controller['index']);router[_0x9068('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9068('0xb')]);router[_0x9068('0x9')](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0xd')]);router[_0x9068('0x9')](_0x9068('0xe'),auth[_0x9068('0xa')](),controller[_0x9068('0xf')]);router['get'](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x11')]);router[_0x9068('0x12')]('/',auth['isAuthenticated'](),controller[_0x9068('0x13')]);router[_0x9068('0x12')](_0x9068('0xe'),auth['isAuthenticated'](),controller[_0x9068('0x14')]);router[_0x9068('0x12')](_0x9068('0x10'),auth['isAuthenticated'](),controller[_0x9068('0x15')]);router[_0x9068('0x16')]('/:id',auth[_0x9068('0xa')](),controller[_0x9068('0x17')]);router['delete'](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0x18')]);router[_0x9068('0x19')]('/:id/users',auth[_0x9068('0xa')](),controller[_0x9068('0x1a')]);router[_0x9068('0x19')](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x1b')]);module[_0x9068('0x1c')]=router; \ No newline at end of file +var _0x3ffb=['getTeams','post','create','/:id/teams','addTeams','put','/:id','update','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','/:id/users','getAgents'];(function(_0x52fadf,_0x3c3d57){var _0x4829c6=function(_0x364fcd){while(--_0x364fcd){_0x52fadf['push'](_0x52fadf['shift']());}};_0x4829c6(++_0x3c3d57);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x27c678,_0x318a2f){_0x27c678=_0x27c678-0x0;var _0x41a5e9=_0x3ffb[_0x27c678];return _0x41a5e9;};'use strict';var multer=require(_0xb3ff('0x0'));var util=require(_0xb3ff('0x1'));var path=require(_0xb3ff('0x2'));var timeout=require(_0xb3ff('0x3'));var express=require(_0xb3ff('0x4'));var router=express['Router']();var fs_extra=require(_0xb3ff('0x5'));var auth=require(_0xb3ff('0x6'));var interaction=require(_0xb3ff('0x7'));var config=require(_0xb3ff('0x8'));var controller=require(_0xb3ff('0x9'));router[_0xb3ff('0xa')]('/',auth[_0xb3ff('0xb')](),controller['index']);router[_0xb3ff('0xa')](_0xb3ff('0xc'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xd')]);router['get']('/:id',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xe')]);router[_0xb3ff('0xa')](_0xb3ff('0xf'),auth['isAuthenticated'](),controller[_0xb3ff('0x10')]);router[_0xb3ff('0xa')]('/:id/teams',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x11')]);router[_0xb3ff('0x12')]('/',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x13')]);router[_0xb3ff('0x12')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller['addAgents']);router[_0xb3ff('0x12')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x15')]);router[_0xb3ff('0x16')](_0xb3ff('0x17'),auth['isAuthenticated'](),controller[_0xb3ff('0x18')]);router['delete'](_0xb3ff('0x17'),auth[_0xb3ff('0xb')](),controller['destroy']);router[_0xb3ff('0x19')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1a')]);router[_0xb3ff('0x19')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 51af9b4..c98a263 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 _0x1f90=['STRING','name','system-','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f90,0x172));var _0x01f9=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x1f90[_0xffa198];return _0x1e4b50;};'use strict';var Sequelize=require(_0x01f9('0x0'));module[_0x01f9('0x1')]={'name':{'type':Sequelize[_0x01f9('0x2')],'allowNull':![],'unique':_0x01f9('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5145ed){return _0x01f9('0x4')+this['getDataValue'](_0x01f9('0x3'))+'-';}},'description':{'type':Sequelize[_0x01f9('0x2')]},'callerIdAll':{'type':Sequelize[_0x01f9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x01f9('0x5')]}}; \ No newline at end of file +var _0xe4bb=['VIRTUAL','system-','getDataValue','name','STRING','exports'];(function(_0x2ee88f,_0x1b4a0c){var _0x4ccc0a=function(_0xbedb63){while(--_0xbedb63){_0x2ee88f['push'](_0x2ee88f['shift']());}};_0x4ccc0a(++_0x1b4a0c);}(_0xe4bb,0x1cd));var _0xbe4b=function(_0x3192db,_0x49172f){_0x3192db=_0x3192db-0x0;var _0x4048a0=_0xe4bb[_0x3192db];return _0x4048a0;};'use strict';var Sequelize=require('sequelize');module[_0xbe4b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xbe4b('0x1')],'get':function(_0x428eb8){return _0xbe4b('0x2')+this[_0xbe4b('0x3')](_0xbe4b('0x4'))+'-';}},'description':{'type':Sequelize[_0xbe4b('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e5ec632..a01e4af 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 _0xfff0=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xfff0,0x139));var _0x0fff=function(_0x40b21f,_0x2d614d){_0x40b21f=_0x40b21f-0x0;var _0x52297e=_0xfff0[_0x40b21f];return _0x52297e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];config[_0x0fff('0x19')]=_['defaults'](config[_0x0fff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0x1a'))(new Redis(config[_0x0fff('0x19')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x55e5fa,_0x53bde9){_0x53bde9=_0x53bde9||0xcc;return function(_0x1daf30){if(_0x1daf30){return _0x55e5fa['sendStatus'](_0x53bde9);}return _0x55e5fa['status'](_0x53bde9)['end']();};}function respondWithResult(_0x1fb430,_0x41e2e7){_0x41e2e7=_0x41e2e7||0xc8;return function(_0x5eab2e){if(_0x5eab2e){return _0x1fb430[_0x0fff('0x1d')](_0x41e2e7)[_0x0fff('0x1e')](_0x5eab2e);}};}function respondWithFilteredResult(_0x540a67,_0x528071){return function(_0x48f36d){if(_0x48f36d){var _0x2337f=typeof _0x528071[_0x0fff('0x1f')]===_0x0fff('0x20')&&typeof _0x528071[_0x0fff('0x21')]===_0x0fff('0x20');var _0xe89b4a=_0x48f36d['count'];var _0x44a54a=_0x2337f?0x0:_0x528071[_0x0fff('0x1f')];var _0x48e6f9=_0x2337f?_0x48f36d['count']:_0x528071['offset']+_0x528071[_0x0fff('0x21')];var _0x330e29;if(_0x48e6f9>=_0xe89b4a){_0x48e6f9=_0xe89b4a;_0x330e29=0xc8;}else{_0x330e29=0xce;}_0x540a67[_0x0fff('0x1d')](_0x330e29);return _0x540a67[_0x0fff('0x22')]('Content-Range',_0x44a54a+'-'+_0x48e6f9+'/'+_0xe89b4a)[_0x0fff('0x1e')](_0x48f36d);}return null;};}function patchUpdates(_0x2f8665){return function(_0x29d703){try{jsonpatch[_0x0fff('0x23')](_0x29d703,_0x2f8665,!![]);}catch(_0x16e7f4){return BPromise[_0x0fff('0x24')](_0x16e7f4);}return _0x29d703['save']();};}function saveUpdates(_0x6a116c,_0x29f702){return function(_0x37e090){if(_0x37e090){return _0x37e090[_0x0fff('0x25')](_0x6a116c)[_0x0fff('0x26')](function(_0x23d9f8){return _0x23d9f8;});}return null;};}function removeEntity(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(_0x87b3a6){return _0x87b3a6[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){var _0x36d268=_0x87b3a6[_0x0fff('0x28')]({'plain':!![]});var _0x27bd76=_0x0fff('0x29');return db[_0x0fff('0x2a')][_0x0fff('0x27')]({'where':{'type':_0x27bd76,'resourceId':_0x36d268['id']}})[_0x0fff('0x26')](function(){return _0x87b3a6;});})[_0x0fff('0x26')](function(){_0x482e1e['status'](0xcc)[_0x0fff('0x2b')]();});}};}function handleEntityNotFound(_0x2d1800,_0x17ab6f){return function(_0x42441e){if(!_0x42441e){_0x2d1800[_0x0fff('0x2c')](0x194);}return _0x42441e;};}function handleError(_0x125844,_0x47dde0){_0x47dde0=_0x47dde0||0x1f4;return function(_0x31f9a4){logger[_0x0fff('0x2d')](_0x31f9a4[_0x0fff('0x2e')]);if(_0x31f9a4['name']){delete _0x31f9a4[_0x0fff('0x2f')];}_0x125844[_0x0fff('0x1d')](_0x47dde0)['send'](_0x31f9a4);};}exports[_0x0fff('0x30')]=function(_0x433de6,_0x15bb46){var _0x15ae24={},_0x25ab2a={},_0x263e9e={'count':0x0,'rows':[]};var _0x1da352=_[_0x0fff('0x31')](db[_0x0fff('0x32')][_0x0fff('0x33')],function(_0x58469b){return{'name':_0x58469b[_0x0fff('0x34')],'type':_0x58469b[_0x0fff('0x35')][_0x0fff('0x36')]};});_0x25ab2a[_0x0fff('0x37')]=_[_0x0fff('0x31')](_0x1da352,'name');_0x25ab2a['query']=_[_0x0fff('0x38')](_0x433de6[_0x0fff('0x39')]);_0x25ab2a[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x25ab2a['model'],_0x25ab2a[_0x0fff('0x39')]);_0x15ae24[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x25ab2a[_0x0fff('0x37')],qs['fields'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x15ae24[_0x0fff('0x3c')]=_0x15ae24[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x15ae24[_0x0fff('0x3c')]:_0x25ab2a[_0x0fff('0x37')];if(!_0x433de6[_0x0fff('0x39')][_0x0fff('0x3f')](_0x0fff('0x40'))){_0x15ae24[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x433de6['query'][_0x0fff('0x21')]);_0x15ae24[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x433de6[_0x0fff('0x39')][_0x0fff('0x1f')]);}_0x15ae24[_0x0fff('0x41')]=qs['sort'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x42')]);_0x15ae24[_0x0fff('0x43')]=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x433de6[_0x0fff('0x39')],_0x25ab2a[_0x0fff('0x3a')]),_0x1da352);if(_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]){_0x15ae24['where']=_[_0x0fff('0x46')](_0x15ae24['where'],{'$or':_[_0x0fff('0x31')](_0x1da352,function(_0x30f329){if(_0x30f329[_0x0fff('0x35')]!=='VIRTUAL'){var _0x5d4c24={};_0x5d4c24[_0x30f329[_0x0fff('0x2f')]]={'$like':'%'+_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]+'%'};return _0x5d4c24;}})});}_0x15ae24=_['merge']({},_0x15ae24,_0x433de6['options']);var _0x4668b3={'where':_0x15ae24['where']};return db[_0x0fff('0x32')][_0x0fff('0x47')](_0x4668b3)[_0x0fff('0x26')](function(_0x309d75){_0x263e9e[_0x0fff('0x47')]=_0x309d75;if(_0x433de6[_0x0fff('0x39')]['includeAll']){_0x15ae24[_0x0fff('0x48')]=[{'all':!![]}];}return db[_0x0fff('0x32')][_0x0fff('0x49')](_0x15ae24);})[_0x0fff('0x26')](function(_0x7157e5){_0x263e9e[_0x0fff('0x4a')]=_0x7157e5;return _0x263e9e;})[_0x0fff('0x26')](respondWithFilteredResult(_0x15bb46,_0x15ae24))['catch'](handleError(_0x15bb46,null));};exports[_0x0fff('0x4b')]=function(_0x244a27,_0x101b3a){var _0x56a121={'raw':![],'where':{'id':_0x244a27[_0x0fff('0x4c')]['id']}},_0x2de540={};_0x2de540[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x32')][_0x0fff('0x33')]);_0x2de540[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x244a27[_0x0fff('0x39')]);_0x2de540[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x2de540['model'],_0x2de540[_0x0fff('0x39')]);_0x56a121[_0x0fff('0x3c')]=_['intersection'](_0x2de540[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x244a27[_0x0fff('0x39')]['fields']));_0x56a121['attributes']=_0x56a121[_0x0fff('0x3c')]['length']?_0x56a121['attributes']:_0x2de540[_0x0fff('0x37')];if(_0x244a27[_0x0fff('0x39')][_0x0fff('0x4d')]){_0x56a121[_0x0fff('0x48')]=[{'all':!![]}];}_0x56a121=_[_0x0fff('0x46')]({},_0x56a121,_0x244a27[_0x0fff('0x4e')]);return db['VoicePrefix'][_0x0fff('0x4f')](_0x56a121)[_0x0fff('0x26')](handleEntityNotFound(_0x101b3a,null))[_0x0fff('0x26')](respondWithResult(_0x101b3a,null))[_0x0fff('0x50')](handleError(_0x101b3a,null));};exports[_0x0fff('0x27')]=function(_0x2c725c,_0x5d1739){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x2c725c['params']['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5d1739,null))['then'](removeEntity(_0x5d1739,null))['catch'](handleError(_0x5d1739,null));};exports['describe']=function(_0x218e1c,_0x30967c){return db[_0x0fff('0x32')][_0x0fff('0x51')]()[_0x0fff('0x26')](respondWithResult(_0x30967c,null))['catch'](handleError(_0x30967c,null));};exports[_0x0fff('0x52')]=function(_0x2c765f,_0x2cbe43){var _0x3b6c98;return db[_0x0fff('0x53')]['transaction'](function(_0x3b401c){return db[_0x0fff('0x32')][_0x0fff('0x52')](_0x2c765f[_0x0fff('0x54')],{'transaction':_0x3b401c})[_0x0fff('0x26')](function(_0x2e8242){_0x3b6c98=_0x2e8242[_0x0fff('0x28')]({'plain':!![]});return db[_0x0fff('0x55')][_0x0fff('0x4f')]({'where':{'id':_0x3b6c98[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x38168e){return createVoicePrefixExtensions(_0x3b6c98,_0x38168e,_0x3b401c);});});})[_0x0fff('0x26')](function(){var _0x2608be=_0x2c765f[_0x0fff('0x57')][_0x0fff('0x28')]({'plain':!![]});if(!_0x2608be)throw new Error(_0x0fff('0x58'));if(_0x2608be[_0x0fff('0x59')]===_0x0fff('0x57')){var _0x398513=_0x3b6c98;return db[_0x0fff('0x5a')]['find']({'where':{'name':_0x0fff('0x29'),'userProfileId':_0x2608be[_0x0fff('0x5b')]},'raw':!![]})[_0x0fff('0x26')](function(_0x2744b4){if(_0x2744b4&&_0x2744b4['autoAssociation']===0x0){return db[_0x0fff('0x2a')]['create']({'name':_0x398513[_0x0fff('0x2f')],'resourceId':_0x398513['id'],'type':_0x2744b4[_0x0fff('0x2f')],'sectionId':_0x2744b4['id']},{})[_0x0fff('0x26')](function(){return _0x3b6c98;});}else{return _0x3b6c98;}})[_0x0fff('0x50')](function(_0x4bf865){logger[_0x0fff('0x2d')](_0x0fff('0x5c'),_0x4bf865);throw _0x4bf865;});}return _0x3b6c98;})[_0x0fff('0x26')](respondWithResult(_0x2cbe43,null))[_0x0fff('0x50')](handleError(_0x2cbe43,null));};function Extension(_0x4cf619,_0x5ba7e7,_0x449da4,_0x40b8f0){this[_0x0fff('0x5d')]=_0x0fff('0x5e');this[_0x0fff('0x5f')]=_0x4cf619;this[_0x0fff('0x60')]=_0x449da4;this['type']='system';this[_0x0fff('0x61')]=_0x0fff('0x62');this[_0x0fff('0x63')]=_0x5ba7e7;this[_0x0fff('0x64')]=_0x40b8f0;}function createVoicePrefixExtensions(_0x28403f,_0x6a37c9,_0x33eb07){return new BPromise(function(_0x40e5ec,_0x5f2fcc){var _0x12fe95=new Extension(formatPrefixName(_0x28403f['prefix']),0x1,_0x0fff('0x65'),_0x0fff('0x66'));_0x12fe95[_0x0fff('0x67')]=_0x28403f['id'];return db['VoiceExtension']['create'](_0x12fe95,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x504212){var _0x140a35=_0x504212[_0x0fff('0x28')]({'plain':!![]});var _0x452160=_[_0x0fff('0x31')](addVoicePrefixExtensions(_0x28403f,_0x6a37c9),function(_0x4e3a31){_0x4e3a31[_0x0fff('0x56')]=_0x140a35['id'];_0x4e3a31[_0x0fff('0x67')]=_0x28403f['id'];return _0x4e3a31;});return db['VoiceExtension'][_0x0fff('0x68')](_0x452160,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x1111c8){if(!_0x1111c8){return _0x5f2fcc('Extensions\x20creation\x20failed');}else{return _0x40e5ec(_0x1111c8);}})[_0x0fff('0x50')](function(_0x1dc3d6){return _0x5f2fcc(_0x1dc3d6);});});;});};function addVoicePrefixExtensions(_0x1414af,_0x383d78){var _0x3bb183=[];var _0xf4fb1e=formatPrefixName(_0x1414af[_0x0fff('0x69')]);_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x2,_0x0fff('0x6b'),_0x0fff('0x6c')+_0x1414af[_0x0fff('0x2f')]));if(_0x1414af[_0x0fff('0x6d')]){_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,'Set',_0x0fff('0x6e')+_0x1414af['callerIdAll']));}else{_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,_0x0fff('0x65'),_0x0fff('0x6f')));}_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x4,'goto',_0x383d78['context']+','+_0x0fff('0x70')+(0x8+_0x1414af[_0x0fff('0x2f')][_0x0fff('0x3e')])+'}'+','+0x1));return _0x3bb183;}function formatPrefixName(_0x2586c6){var _0x5af278='_';for(var _0x2f865a=0x0;_0x2f865a<_0x2586c6[_0x0fff('0x3e')];_0x2f865a++){if(_0x2586c6[_0x0fff('0x71')](_0x2f865a)=='-'){_0x5af278+=_0x2586c6[_0x0fff('0x71')](_0x2f865a);}else{_0x5af278+='['+_0x2586c6['charAt'](_0x2f865a)+']';}}_0x5af278+='.';return _0x5af278;}exports[_0x0fff('0x25')]=function(_0x1858fb,_0x4c08c3,_0x51fbf5){var _0x33ed23=_0x1858fb[_0x0fff('0x54')];_0x33ed23[_0x0fff('0x69')]=_0x0fff('0x72')+_0x33ed23[_0x0fff('0x2f')]+'-';return db['sequelize'][_0x0fff('0x73')](function(_0x7b040){return db[_0x0fff('0x32')][_0x0fff('0x25')](_0x33ed23,{'where':{'id':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension'][_0x0fff('0x4f')]({'where':{'id':_0x33ed23[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x712db4){return createVoicePrefixExtensions(_0x33ed23,_0x712db4,_0x7b040);});});});})[_0x0fff('0x26')](function(){return db['VoicePrefix'][_0x0fff('0x74')](_0x33ed23['id']);})[_0x0fff('0x26')](respondWithResult(_0x4c08c3,null))[_0x0fff('0x50')](handleError(_0x4c08c3,null));};exports[_0x0fff('0x75')]=function(_0x31ff4e,_0x15ab8e,_0x38e2e9){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x31ff4e[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x15ab8e,null))['then'](function(_0x134012){if(_0x134012){return _0x134012[_0x0fff('0x75')](_0x31ff4e['body'][_0x0fff('0x76')],_['omit'](_0x31ff4e[_0x0fff('0x54')],[_0x0fff('0x76'),'id'])||{})[_0x0fff('0x77')](function(_0x8799c2){for(var _0x13d90e=0x0;_0x13d90e<_0x31ff4e['body'][_0x0fff('0x76')][_0x0fff('0x3e')];_0x13d90e+=0x1){socket['emit'](_0x0fff('0x78'),{'UserId':Number(_0x31ff4e[_0x0fff('0x54')][_0x0fff('0x76')][_0x13d90e]),'VoicePrefixId':Number(_0x31ff4e['params']['id'])});}return _0x8799c2;});}})[_0x0fff('0x26')](respondWithResult(_0x15ab8e,null))[_0x0fff('0x50')](handleError(_0x15ab8e,null));};exports['removeAgents']=function(_0x567544,_0x404b97,_0x49711a){return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x567544[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x404b97,null))['then'](function(_0x4f7282){if(_0x4f7282){return _0x4f7282[_0x0fff('0x79')](_0x567544['query'][_0x0fff('0x76')])[_0x0fff('0x26')](function(){if(_[_0x0fff('0x7a')](_0x567544[_0x0fff('0x39')][_0x0fff('0x76')])){for(var _0x1e940c=0x0;_0x1e940c<_0x567544[_0x0fff('0x39')]['ids'][_0x0fff('0x3e')];_0x1e940c+=0x1){socket[_0x0fff('0x7b')](_0x0fff('0x7c'),{'UserId':Number(_0x567544[_0x0fff('0x39')][_0x0fff('0x76')][_0x1e940c]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}}else{socket['emit'](_0x0fff('0x7c'),{'UserId':Number(_0x567544['query'][_0x0fff('0x76')]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}});}})[_0x0fff('0x26')](respondWithStatusCode(_0x404b97,null))[_0x0fff('0x50')](handleError(_0x404b97,null));};exports['getAgents']=function(_0x4fc7c7,_0x34dd99,_0x5baf7f){var _0x3d820e={};var _0x125b12={};var _0x5093fc;var _0x5b04f2;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x4fc7c7[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x34dd99,null))['then'](function(_0x407f0a){if(_0x407f0a){_0x5093fc=_0x407f0a;_0x125b12['model']=_[_0x0fff('0x38')](db[_0x0fff('0x7e')][_0x0fff('0x33')]);_0x125b12['query']=_['keys'](_0x4fc7c7['query']);_0x125b12[_0x0fff('0x3a')]=_['intersection'](_0x125b12[_0x0fff('0x37')],_0x125b12[_0x0fff('0x39')]);_0x3d820e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x125b12[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x3d820e[_0x0fff('0x3c')]=_0x3d820e[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x3d820e['attributes']:_0x125b12[_0x0fff('0x37')];_0x3d820e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x42')]);_0x3d820e['where']=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x4fc7c7['query'],_0x125b12[_0x0fff('0x3a')]));if(_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x45')]){_0x3d820e[_0x0fff('0x43')]=_[_0x0fff('0x46')](_0x3d820e[_0x0fff('0x43')],{'$or':_[_0x0fff('0x31')](_0x3d820e[_0x0fff('0x3c')],function(_0x40c4f3){var _0x1c059b={};_0x1c059b[_0x40c4f3]={'$like':'%'+_0x4fc7c7['query'][_0x0fff('0x45')]+'%'};return _0x1c059b;})});}_0x3d820e=_[_0x0fff('0x46')]({},_0x3d820e,_0x4fc7c7[_0x0fff('0x4e')]);return _0x5093fc[_0x0fff('0x7f')](_0x3d820e);}})[_0x0fff('0x26')](function(_0x2fdf96){if(_0x2fdf96){_0x5b04f2=_0x2fdf96[_0x0fff('0x3e')];if(!_0x4fc7c7['query'][_0x0fff('0x3f')]('nolimit')){_0x3d820e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x21')]);_0x3d820e[_0x0fff('0x1f')]=qs['offset'](_0x4fc7c7[_0x0fff('0x39')]['offset']);}return _0x5093fc['getAgents'](_0x3d820e);}})[_0x0fff('0x26')](function(_0x173b44){if(_0x173b44){return _0x173b44?{'count':_0x5b04f2,'rows':_0x173b44}:null;}})[_0x0fff('0x26')](respondWithResult(_0x34dd99,null))[_0x0fff('0x50')](handleError(_0x34dd99,null));};exports[_0x0fff('0x80')]=function(_0x3995b9,_0x5bc4e1,_0x50f95c){var _0x5b637e={};var _0x1bd02a={};var _0x41b755;var _0x4012aa;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x3995b9[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5bc4e1,null))[_0x0fff('0x26')](function(_0xed7e93){if(_0xed7e93){_0x41b755=_0xed7e93;_0x1bd02a[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x81')][_0x0fff('0x33')]);_0x1bd02a[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x3995b9[_0x0fff('0x39')]);_0x1bd02a[_0x0fff('0x3a')]=_['intersection'](_0x1bd02a[_0x0fff('0x37')],_0x1bd02a[_0x0fff('0x39')]);_0x5b637e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x1bd02a[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x3995b9[_0x0fff('0x39')]['fields']));_0x5b637e[_0x0fff('0x3c')]=_0x5b637e[_0x0fff('0x3c')]['length']?_0x5b637e[_0x0fff('0x3c')]:_0x1bd02a['model'];_0x5b637e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x3995b9['query']['sort']);_0x5b637e['where']=qs[_0x0fff('0x3a')](_['pick'](_0x3995b9['query'],_0x1bd02a['filters']));if(_0x3995b9['query'][_0x0fff('0x45')]){_0x5b637e['where']=_[_0x0fff('0x46')](_0x5b637e['where'],{'$or':_[_0x0fff('0x31')](_0x5b637e['attributes'],function(_0x465dde){var _0x9ca531={};_0x9ca531[_0x465dde]={'$like':'%'+_0x3995b9['query']['filter']+'%'};return _0x9ca531;})});}_0x5b637e=_[_0x0fff('0x46')]({},_0x5b637e,_0x3995b9[_0x0fff('0x4e')]);return _0x41b755[_0x0fff('0x80')](_0x5b637e);}})[_0x0fff('0x26')](function(_0x675250){if(_0x675250){_0x4012aa=_0x675250[_0x0fff('0x3e')];if(!_0x3995b9[_0x0fff('0x39')]['hasOwnProperty'](_0x0fff('0x40'))){_0x5b637e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x3995b9[_0x0fff('0x39')]['limit']);_0x5b637e[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x3995b9[_0x0fff('0x39')]['offset']);}return _0x41b755['getTeams'](_0x5b637e);}})[_0x0fff('0x26')](function(_0x37b5b4){if(_0x37b5b4){return _0x37b5b4?{'count':_0x4012aa,'rows':_0x37b5b4}:null;}})['then'](respondWithResult(_0x5bc4e1,null))[_0x0fff('0x50')](handleError(_0x5bc4e1,null));};exports[_0x0fff('0x82')]=function(_0x4ab665,_0x2ab827,_0x2a2af9){var _0x2ca40b=_0x4ab665['body']['ids'];var _0x2eeee9;return db[_0x0fff('0x81')]['findAll']({'where':{'id':_0x2ca40b},'attributes':['id'],'include':[{'model':db[_0x0fff('0x7e')],'as':_0x0fff('0x83'),'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x84'),_0x0fff('0x85'),_0x0fff('0x86')],'raw':!![]}]})[_0x0fff('0x26')](function(_0x1b500a){if(_0x1b500a){_0x2eeee9=_0x1b500a;var _0x327b5=_[_0x0fff('0x87')](_0x1b500a,function(_0x10aa61){var _0xc99224=_0x10aa61['get']({'plain':!![]});return _0xc99224[_0x0fff('0x83')];});return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x4ab665['params']['id']}})[_0x0fff('0x26')](function(_0x5336){return db[_0x0fff('0x53')][_0x0fff('0x73')](function(_0x42fbff){return _0x5336[_0x0fff('0x82')](_0x2ca40b,{'transaction':_0x42fbff})['then'](function(){return BPromise[_0x0fff('0x88')](_0x2eeee9,function(_0x39565f){return db['TeamVoicePrefix'][_0x0fff('0x89')]({'TeamId':_0x39565f['id'],'VoicePrefixId':_0x4ab665['params']['id']},{'transaction':_0x42fbff});});})['then'](function(){return BPromise[_0x0fff('0x88')](_0x327b5,function(_0x2e38c3){return db[_0x0fff('0x8a')][_0x0fff('0x8b')]({'where':{'UserId':_0x2e38c3['id'],'VoicePrefixId':_0x4ab665[_0x0fff('0x4c')]['id']},'transaction':_0x42fbff});});})[_0x0fff('0x26')](function(){_0x327b5['forEach'](function(_0xe02ca6){socket[_0x0fff('0x7b')](_0x0fff('0x78'),{'UserId':_0xe02ca6['id'],'VoicePrefixId':_0x5336['id']});});});});});}})[_0x0fff('0x26')](respondWithStatusCode(_0x2ab827,null))[_0x0fff('0x50')](handleError(_0x2ab827,null));};exports['removeTeams']=function(_0x25e9f2,_0xf73eb6,_0x87df03){return db[_0x0fff('0x81')][_0x0fff('0x49')]({'where':{'id':_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fff('0x26')](handleEntityNotFound(_0xf73eb6,null))['then'](function(_0x2d206c){var _0x5ed120=_['map'](_0x2d206c,'id');var _0x592341=[];var _0x2e1625=[];var _0x128fe1=squel[_0x0fff('0x8c')]();_0x128fe1[_0x0fff('0x8d')](_0x0fff('0x8e'))['from'](_0x0fff('0x8f'),'tq')[_0x0fff('0x90')](_0x0fff('0x91'),'ut',_0x0fff('0x92'))[_0x0fff('0x43')](_0x0fff('0x93'),_0x25e9f2[_0x0fff('0x4c')]['id']);for(var _0x115445=0x0;_0x115445<_0x2d206c['length'];_0x115445+=0x1){let _0x596074=_0x2d206c[_0x115445];for(var _0x1f1946=0x0;_0x1f1946<_0x596074[_0x0fff('0x83')][_0x0fff('0x3e')];_0x1f1946+=0x1){let _0x47ff09=_0x596074[_0x0fff('0x83')][_0x1f1946];var _0x2ae986=_0x128fe1[_0x0fff('0x94')]();_0x2ae986['where'](_0x0fff('0x95'),_0x47ff09['id']);_0x2e1625[_0x0fff('0x6a')](db[_0x0fff('0x53')][_0x0fff('0x39')](_0x2ae986[_0x0fff('0x96')](),{'type':db[_0x0fff('0x53')][_0x0fff('0x97')]['SELECT']})['then'](function(_0x4a70ee){if(_0x4a70ee[_0x0fff('0x3e')]===0x1){return _0x47ff09['id'];}else{var _0x425412=_[_0x0fff('0x98')](_[_0x0fff('0x31')](_0x4a70ee,_0x0fff('0x99')),function(_0x41afce){return _['includes'](_0x5ed120,_0x41afce);});if(_0x425412){return _0x47ff09['id'];}}}));}}return BPromise[_0x0fff('0x9a')](_0x2e1625)[_0x0fff('0x26')](function(_0x7928f7){_0x592341=_(_0x592341)['union'](_0x7928f7)['compact']()[_0x0fff('0x9b')]();return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x25e9f2[_0x0fff('0x4c')]['id']}})['then'](function(_0x1bf39f){return db[_0x0fff('0x53')]['transaction'](function(_0xb6faf){return _0x1bf39f[_0x0fff('0x9c')](_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')],{'transaction':_0xb6faf})[_0x0fff('0x26')](function(){if(!_[_0x0fff('0x9d')](_0x592341)){return _0x1bf39f['removeAgents'](_0x592341,{'transaction':_0xb6faf});}})[_0x0fff('0x26')](function(){_0x592341['forEach'](function(_0xf72b2b){socket['emit'](_0x0fff('0x7c'),{'UserId':_0xf72b2b,'VoicePrefixId':_0x1bf39f['id']});});});});});});})['then'](respondWithStatusCode(_0xf73eb6,null))[_0x0fff('0x50')](handleError(_0xf73eb6,null));}; \ No newline at end of file +var _0xd4a2=['appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','nolimit','getTeams','Team','Agents','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','isEmpty','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','include','options','find','catch','params','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a2,0x173));var _0x2d4a=function(_0x295d32,_0x3b6bd7){_0x295d32=_0x295d32-0x0;var _0x2db548=_0xd4a2[_0x295d32];return _0x2db548;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];config[_0x2d4a('0x17')]=_[_0x2d4a('0x18')](config[_0x2d4a('0x17')],{'host':_0x2d4a('0x19'),'port':0x18eb});var socket=require(_0x2d4a('0x1a'))(new Redis(config[_0x2d4a('0x17')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x2a1d0f,_0x5b6c4f){_0x5b6c4f=_0x5b6c4f||0xcc;return function(_0x11c64a){if(_0x11c64a){return _0x2a1d0f[_0x2d4a('0x1b')](_0x5b6c4f);}return _0x2a1d0f[_0x2d4a('0x1c')](_0x5b6c4f)[_0x2d4a('0x1d')]();};}function respondWithResult(_0x4c5287,_0x5f825d){_0x5f825d=_0x5f825d||0xc8;return function(_0x5a6378){if(_0x5a6378){return _0x4c5287[_0x2d4a('0x1c')](_0x5f825d)['json'](_0x5a6378);}};}function respondWithFilteredResult(_0x435687,_0xd1dd52){return function(_0x2188b2){if(_0x2188b2){var _0x388371=typeof _0xd1dd52['offset']==='undefined'&&typeof _0xd1dd52['limit']===_0x2d4a('0x1e');var _0x1966d1=_0x2188b2[_0x2d4a('0x1f')];var _0x419df5=_0x388371?0x0:_0xd1dd52[_0x2d4a('0x20')];var _0x2e4069=_0x388371?_0x2188b2['count']:_0xd1dd52['offset']+_0xd1dd52[_0x2d4a('0x21')];var _0x1f3e17;if(_0x2e4069>=_0x1966d1){_0x2e4069=_0x1966d1;_0x1f3e17=0xc8;}else{_0x1f3e17=0xce;}_0x435687[_0x2d4a('0x1c')](_0x1f3e17);return _0x435687[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x419df5+'-'+_0x2e4069+'/'+_0x1966d1)[_0x2d4a('0x24')](_0x2188b2);}return null;};}function patchUpdates(_0x22dd0b){return function(_0xa43fb1){try{jsonpatch['apply'](_0xa43fb1,_0x22dd0b,!![]);}catch(_0x26e7b8){return BPromise[_0x2d4a('0x25')](_0x26e7b8);}return _0xa43fb1[_0x2d4a('0x26')]();};}function saveUpdates(_0x42d813,_0x2c845c){return function(_0xed2822){if(_0xed2822){return _0xed2822[_0x2d4a('0x27')](_0x42d813)[_0x2d4a('0x28')](function(_0x54c910){return _0x54c910;});}return null;};}function removeEntity(_0x544b9b,_0x5cc7d8){return function(_0x2bb9f0){if(_0x2bb9f0){return _0x2bb9f0['destroy']()[_0x2d4a('0x28')](function(){var _0x3a2fd3=_0x2bb9f0[_0x2d4a('0x29')]({'plain':!![]});var _0x1d2fa6=_0x2d4a('0x2a');return db[_0x2d4a('0x2b')][_0x2d4a('0x2c')]({'where':{'type':_0x1d2fa6,'resourceId':_0x3a2fd3['id']}})[_0x2d4a('0x28')](function(){return _0x2bb9f0;});})['then'](function(){_0x544b9b[_0x2d4a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221602,_0x9bac28){return function(_0xc497ce){if(!_0xc497ce){_0x221602[_0x2d4a('0x1b')](0x194);}return _0xc497ce;};}function handleError(_0x101382,_0x1dfc5d){_0x1dfc5d=_0x1dfc5d||0x1f4;return function(_0x25ac5c){logger[_0x2d4a('0x2d')](_0x25ac5c['stack']);if(_0x25ac5c[_0x2d4a('0x2e')]){delete _0x25ac5c[_0x2d4a('0x2e')];}_0x101382[_0x2d4a('0x1c')](_0x1dfc5d)[_0x2d4a('0x2f')](_0x25ac5c);};}exports[_0x2d4a('0x30')]=function(_0x57bf71,_0x217653){var _0x31d8ae={},_0x27015d={},_0x24bcc2={'count':0x0,'rows':[]};var _0x2bb93d=_['map'](db[_0x2d4a('0x31')][_0x2d4a('0x32')],function(_0x46b623){return{'name':_0x46b623[_0x2d4a('0x33')],'type':_0x46b623[_0x2d4a('0x34')][_0x2d4a('0x35')]};});_0x27015d['model']=_[_0x2d4a('0x36')](_0x2bb93d,_0x2d4a('0x2e'));_0x27015d[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x57bf71[_0x2d4a('0x37')]);_0x27015d['filters']=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],_0x27015d['query']);_0x31d8ae[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0x31d8ae['attributes']=_0x31d8ae[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x31d8ae[_0x2d4a('0x3b')]:_0x27015d[_0x2d4a('0x3a')];if(!_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3e')]('nolimit')){_0x31d8ae['limit']=qs[_0x2d4a('0x21')](_0x57bf71['query'][_0x2d4a('0x21')]);_0x31d8ae[_0x2d4a('0x20')]=qs['offset'](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x20')]);}_0x31d8ae[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0x31d8ae[_0x2d4a('0x41')]=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x57bf71[_0x2d4a('0x37')],_0x27015d[_0x2d4a('0x42')]),_0x2bb93d);if(_0x57bf71['query'][_0x2d4a('0x44')]){_0x31d8ae[_0x2d4a('0x41')]=_[_0x2d4a('0x45')](_0x31d8ae[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0x2bb93d,function(_0x483a40){if(_0x483a40['type']!=='VIRTUAL'){var _0x5af510={};_0x5af510[_0x483a40[_0x2d4a('0x2e')]]={'$like':'%'+_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x44')]+'%'};return _0x5af510;}})});}_0x31d8ae=_[_0x2d4a('0x45')]({},_0x31d8ae,_0x57bf71['options']);var _0x155f2d={'where':_0x31d8ae[_0x2d4a('0x41')]};return db['VoicePrefix'][_0x2d4a('0x1f')](_0x155f2d)[_0x2d4a('0x28')](function(_0x8a9375){_0x24bcc2[_0x2d4a('0x1f')]=_0x8a9375;if(_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x31d8ae['include']=[{'all':!![]}];}return db[_0x2d4a('0x31')][_0x2d4a('0x47')](_0x31d8ae);})[_0x2d4a('0x28')](function(_0x365399){_0x24bcc2[_0x2d4a('0x48')]=_0x365399;return _0x24bcc2;})[_0x2d4a('0x28')](respondWithFilteredResult(_0x217653,_0x31d8ae))['catch'](handleError(_0x217653,null));};exports[_0x2d4a('0x49')]=function(_0x1f08a3,_0x10b723){var _0x4e1901={'raw':![],'where':{'id':_0x1f08a3['params']['id']}},_0x2585db={};_0x2585db[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x31')][_0x2d4a('0x32')]);_0x2585db[_0x2d4a('0x37')]=_['keys'](_0x1f08a3['query']);_0x2585db[_0x2d4a('0x42')]=_[_0x2d4a('0x39')](_0x2585db['model'],_0x2585db[_0x2d4a('0x37')]);_0x4e1901['attributes']=_[_0x2d4a('0x39')](_0x2585db[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x1f08a3['query'][_0x2d4a('0x3c')]));_0x4e1901['attributes']=_0x4e1901[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4e1901[_0x2d4a('0x3b')]:_0x2585db[_0x2d4a('0x3a')];if(_0x1f08a3[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x4e1901[_0x2d4a('0x4a')]=[{'all':!![]}];}_0x4e1901=_[_0x2d4a('0x45')]({},_0x4e1901,_0x1f08a3[_0x2d4a('0x4b')]);return db[_0x2d4a('0x31')][_0x2d4a('0x4c')](_0x4e1901)['then'](handleEntityNotFound(_0x10b723,null))[_0x2d4a('0x28')](respondWithResult(_0x10b723,null))[_0x2d4a('0x4d')](handleError(_0x10b723,null));};exports[_0x2d4a('0x2c')]=function(_0x1467ab,_0x2d2e24){return db['VoicePrefix'][_0x2d4a('0x4c')]({'where':{'id':_0x1467ab[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2d2e24,null))[_0x2d4a('0x28')](removeEntity(_0x2d2e24,null))[_0x2d4a('0x4d')](handleError(_0x2d2e24,null));};exports['describe']=function(_0x4b9a52,_0x43e74a){return db[_0x2d4a('0x31')]['describe']()[_0x2d4a('0x28')](respondWithResult(_0x43e74a,null))[_0x2d4a('0x4d')](handleError(_0x43e74a,null));};exports[_0x2d4a('0x4f')]=function(_0x19109b,_0x52a468){var _0x31576d;return db['sequelize'][_0x2d4a('0x50')](function(_0x3fe91b){return db[_0x2d4a('0x31')][_0x2d4a('0x4f')](_0x19109b[_0x2d4a('0x51')],{'transaction':_0x3fe91b})[_0x2d4a('0x28')](function(_0x25fb59){_0x31576d=_0x25fb59[_0x2d4a('0x29')]({'plain':!![]});return db['VoiceExtension'][_0x2d4a('0x4c')]({'where':{'id':_0x31576d[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x67ddff){return createVoicePrefixExtensions(_0x31576d,_0x67ddff,_0x3fe91b);});});})[_0x2d4a('0x28')](function(){var _0x334d6a=_0x19109b[_0x2d4a('0x53')][_0x2d4a('0x29')]({'plain':!![]});if(!_0x334d6a)throw new Error(_0x2d4a('0x54'));if(_0x334d6a[_0x2d4a('0x55')]===_0x2d4a('0x53')){var _0x113bc4=_0x31576d;return db[_0x2d4a('0x56')][_0x2d4a('0x4c')]({'where':{'name':_0x2d4a('0x2a'),'userProfileId':_0x334d6a[_0x2d4a('0x57')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x4cce5e){if(_0x4cce5e&&_0x4cce5e[_0x2d4a('0x58')]===0x0){return db[_0x2d4a('0x2b')]['create']({'name':_0x113bc4[_0x2d4a('0x2e')],'resourceId':_0x113bc4['id'],'type':_0x4cce5e[_0x2d4a('0x2e')],'sectionId':_0x4cce5e['id']},{})[_0x2d4a('0x28')](function(){return _0x31576d;});}else{return _0x31576d;}})[_0x2d4a('0x4d')](function(_0x165c00){logger[_0x2d4a('0x2d')](_0x2d4a('0x59'),_0x165c00);throw _0x165c00;});}return _0x31576d;})[_0x2d4a('0x28')](respondWithResult(_0x52a468,null))[_0x2d4a('0x4d')](handleError(_0x52a468,null));};function Extension(_0x352b50,_0x346f2b,_0x302323,_0x5c7cf9){this[_0x2d4a('0x5a')]=_0x2d4a('0x5b');this['exten']=_0x352b50;this[_0x2d4a('0x5c')]=_0x302323;this[_0x2d4a('0x34')]=_0x2d4a('0x5d');this[_0x2d4a('0x5e')]=_0x2d4a('0x5f');this[_0x2d4a('0x60')]=_0x346f2b;this[_0x2d4a('0x61')]=_0x5c7cf9;}function createVoicePrefixExtensions(_0x43e6a6,_0x1034d2,_0x282df8){return new BPromise(function(_0x5bbc96,_0x2bd137){var _0x8ae6bd=new Extension(formatPrefixName(_0x43e6a6[_0x2d4a('0x62')]),0x1,'NoOp',_0x2d4a('0x63'));_0x8ae6bd[_0x2d4a('0x64')]=_0x43e6a6['id'];return db[_0x2d4a('0x65')][_0x2d4a('0x4f')](_0x8ae6bd,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x278bbc){var _0x7e2699=_0x278bbc[_0x2d4a('0x29')]({'plain':!![]});var _0x1ed616=_['map'](addVoicePrefixExtensions(_0x43e6a6,_0x1034d2),function(_0x21b8e9){_0x21b8e9[_0x2d4a('0x52')]=_0x7e2699['id'];_0x21b8e9[_0x2d4a('0x64')]=_0x43e6a6['id'];return _0x21b8e9;});return db[_0x2d4a('0x65')][_0x2d4a('0x66')](_0x1ed616,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x53f52b){if(!_0x53f52b){return _0x2bd137(_0x2d4a('0x67'));}else{return _0x5bbc96(_0x53f52b);}})[_0x2d4a('0x4d')](function(_0x22707f){return _0x2bd137(_0x22707f);});});;});};function addVoicePrefixExtensions(_0x4809af,_0x465c89){var _0x442691=[];var _0x4f4a09=formatPrefixName(_0x4809af[_0x2d4a('0x62')]);_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x2,'Set',_0x2d4a('0x69')+_0x4809af['name']));if(_0x4809af['callerIdAll']){_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6a'),_0x2d4a('0x6b')+_0x4809af[_0x2d4a('0x6c')]));}else{_0x442691['push'](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6d'),_0x2d4a('0x6e')));}_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x4,_0x2d4a('0x6f'),_0x465c89['context']+','+'${EXTEN:'+(0x8+_0x4809af[_0x2d4a('0x2e')][_0x2d4a('0x3d')])+'}'+','+0x1));return _0x442691;}function formatPrefixName(_0x2a2441){var _0x2aa9e8='_';for(var _0x9e6321=0x0;_0x9e6321<_0x2a2441[_0x2d4a('0x3d')];_0x9e6321++){if(_0x2a2441[_0x2d4a('0x70')](_0x9e6321)=='-'){_0x2aa9e8+=_0x2a2441['charAt'](_0x9e6321);}else{_0x2aa9e8+='['+_0x2a2441[_0x2d4a('0x70')](_0x9e6321)+']';}}_0x2aa9e8+='.';return _0x2aa9e8;}exports[_0x2d4a('0x27')]=function(_0xf3d514,_0x398439,_0x59810d){var _0x299bdf=_0xf3d514[_0x2d4a('0x51')];_0x299bdf[_0x2d4a('0x62')]=_0x2d4a('0x71')+_0x299bdf['name']+'-';return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x55d565){return db[_0x2d4a('0x31')][_0x2d4a('0x27')](_0x299bdf,{'where':{'id':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db['VoiceExtension'][_0x2d4a('0x2c')]({'where':{'VoicePrefixId':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db[_0x2d4a('0x65')][_0x2d4a('0x4c')]({'where':{'id':_0x299bdf[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x3bc965){return createVoicePrefixExtensions(_0x299bdf,_0x3bc965,_0x55d565);});});});})['then'](function(){return db[_0x2d4a('0x31')][_0x2d4a('0x73')](_0x299bdf['id']);})[_0x2d4a('0x28')](respondWithResult(_0x398439,null))[_0x2d4a('0x4d')](handleError(_0x398439,null));};exports[_0x2d4a('0x74')]=function(_0x55ebbb,_0x38e623,_0x5aead3){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x55ebbb[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x38e623,null))[_0x2d4a('0x28')](function(_0x2ba9c2){if(_0x2ba9c2){return _0x2ba9c2[_0x2d4a('0x74')](_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')],_[_0x2d4a('0x76')](_0x55ebbb['body'],[_0x2d4a('0x75'),'id'])||{})['spread'](function(_0x3d7d7d){for(var _0x3c284d=0x0;_0x3c284d<_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x3c284d+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':Number(_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x3c284d]),'VoicePrefixId':Number(_0x55ebbb['params']['id'])});}return _0x3d7d7d;});}})[_0x2d4a('0x28')](respondWithResult(_0x38e623,null))[_0x2d4a('0x4d')](handleError(_0x38e623,null));};exports[_0x2d4a('0x79')]=function(_0xcdf787,_0x574285,_0x36d253){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0xcdf787[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x574285,null))[_0x2d4a('0x28')](function(_0x5769be){if(_0x5769be){return _0x5769be[_0x2d4a('0x79')](_0xcdf787[_0x2d4a('0x37')]['ids'])[_0x2d4a('0x28')](function(){if(_[_0x2d4a('0x7a')](_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')])){for(var _0x429579=0x0;_0x429579<_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x429579+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787['query'][_0x2d4a('0x75')][_0x429579]),'VoicePrefixId':Number(_0xcdf787['params']['id'])});}}else{socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')]),'VoicePrefixId':Number(_0xcdf787[_0x2d4a('0x4e')]['id'])});}});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x574285,null))[_0x2d4a('0x4d')](handleError(_0x574285,null));};exports['getAgents']=function(_0x119c59,_0x2ebb9e,_0xc11b2e){var _0xfc7b53={};var _0x47377e={};var _0x5e7f23;var _0x4ebda1;return db['VoicePrefix'][_0x2d4a('0x7c')]({'where':{'id':_0x119c59[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2ebb9e,null))['then'](function(_0x135f58){if(_0x135f58){_0x5e7f23=_0x135f58;_0x47377e[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x7d')][_0x2d4a('0x32')]);_0x47377e[_0x2d4a('0x37')]=_['keys'](_0x119c59[_0x2d4a('0x37')]);_0x47377e['filters']=_[_0x2d4a('0x39')](_0x47377e[_0x2d4a('0x3a')],_0x47377e['query']);_0xfc7b53[_0x2d4a('0x3b')]=_['intersection'](_0x47377e['model'],qs['fields'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0xfc7b53[_0x2d4a('0x3b')]=_0xfc7b53['attributes'][_0x2d4a('0x3d')]?_0xfc7b53[_0x2d4a('0x3b')]:_0x47377e[_0x2d4a('0x3a')];_0xfc7b53[_0x2d4a('0x3f')]=qs['sort'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0xfc7b53['where']=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x119c59['query'],_0x47377e[_0x2d4a('0x42')]));if(_0x119c59['query']['filter']){_0xfc7b53[_0x2d4a('0x41')]=_['merge'](_0xfc7b53[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0xfc7b53[_0x2d4a('0x3b')],function(_0x44d3b3){var _0x5e939f={};_0x5e939f[_0x44d3b3]={'$like':'%'+_0x119c59[_0x2d4a('0x37')]['filter']+'%'};return _0x5e939f;})});}_0xfc7b53=_[_0x2d4a('0x45')]({},_0xfc7b53,_0x119c59[_0x2d4a('0x4b')]);return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x45f6b7){if(_0x45f6b7){_0x4ebda1=_0x45f6b7['length'];if(!_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0xfc7b53['limit']=qs[_0x2d4a('0x21')](_0x119c59['query']['limit']);_0xfc7b53[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x20')]);}return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x2bffb4){if(_0x2bffb4){return _0x2bffb4?{'count':_0x4ebda1,'rows':_0x2bffb4}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x2ebb9e,null))[_0x2d4a('0x4d')](handleError(_0x2ebb9e,null));};exports[_0x2d4a('0x80')]=function(_0x5ecf3e,_0x16c4fd,_0x2b29b1){var _0x4647cb={};var _0x10d86c={};var _0x36b067;var _0x1cb5b3;return db[_0x2d4a('0x31')][_0x2d4a('0x7c')]({'where':{'id':_0x5ecf3e['params']['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x16c4fd,null))[_0x2d4a('0x28')](function(_0xa4c947){if(_0xa4c947){_0x36b067=_0xa4c947;_0x10d86c['model']=_[_0x2d4a('0x38')](db['Team'][_0x2d4a('0x32')]);_0x10d86c[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x5ecf3e[_0x2d4a('0x37')]);_0x10d86c['filters']=_[_0x2d4a('0x39')](_0x10d86c['model'],_0x10d86c[_0x2d4a('0x37')]);_0x4647cb[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x10d86c['model'],qs[_0x2d4a('0x3c')](_0x5ecf3e['query'][_0x2d4a('0x3c')]));_0x4647cb[_0x2d4a('0x3b')]=_0x4647cb[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4647cb[_0x2d4a('0x3b')]:_0x10d86c[_0x2d4a('0x3a')];_0x4647cb[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x5ecf3e[_0x2d4a('0x37')]['sort']);_0x4647cb['where']=qs['filters'](_[_0x2d4a('0x43')](_0x5ecf3e['query'],_0x10d86c[_0x2d4a('0x42')]));if(_0x5ecf3e['query'][_0x2d4a('0x44')]){_0x4647cb[_0x2d4a('0x41')]=_['merge'](_0x4647cb['where'],{'$or':_[_0x2d4a('0x36')](_0x4647cb['attributes'],function(_0x279c26){var _0x643012={};_0x643012[_0x279c26]={'$like':'%'+_0x5ecf3e[_0x2d4a('0x37')]['filter']+'%'};return _0x643012;})});}_0x4647cb=_[_0x2d4a('0x45')]({},_0x4647cb,_0x5ecf3e[_0x2d4a('0x4b')]);return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x1c3c0f){if(_0x1c3c0f){_0x1cb5b3=_0x1c3c0f[_0x2d4a('0x3d')];if(!_0x5ecf3e[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0x4647cb[_0x2d4a('0x21')]=qs[_0x2d4a('0x21')](_0x5ecf3e[_0x2d4a('0x37')]['limit']);_0x4647cb[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x5ecf3e[_0x2d4a('0x37')]['offset']);}return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x250a9c){if(_0x250a9c){return _0x250a9c?{'count':_0x1cb5b3,'rows':_0x250a9c}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x16c4fd,null))[_0x2d4a('0x4d')](handleError(_0x16c4fd,null));};exports['addTeams']=function(_0x438769,_0x1483af,_0x5413c1){var _0x2d5122=_0x438769['body'][_0x2d4a('0x75')];var _0x1cd7fd;return db[_0x2d4a('0x81')][_0x2d4a('0x47')]({'where':{'id':_0x2d5122},'attributes':['id'],'include':[{'model':db[_0x2d4a('0x7d')],'as':_0x2d4a('0x82'),'attributes':['id',_0x2d4a('0x2e'),'online',_0x2d4a('0x83'),_0x2d4a('0x84')],'raw':!![]}]})[_0x2d4a('0x28')](function(_0x1e5be2){if(_0x1e5be2){_0x1cd7fd=_0x1e5be2;var _0x139e4e=_[_0x2d4a('0x85')](_0x1e5be2,function(_0x58b196){var _0x23577f=_0x58b196[_0x2d4a('0x29')]({'plain':!![]});return _0x23577f[_0x2d4a('0x82')];});return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x438769['params']['id']}})['then'](function(_0x3e276d){return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x2fee11){return _0x3e276d[_0x2d4a('0x86')](_0x2d5122,{'transaction':_0x2fee11})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x1cd7fd,function(_0x1adcbc){return db[_0x2d4a('0x88')]['upsert']({'TeamId':_0x1adcbc['id'],'VoicePrefixId':_0x438769['params']['id']},{'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x139e4e,function(_0x3b4585){return db[_0x2d4a('0x89')][_0x2d4a('0x8a')]({'where':{'UserId':_0x3b4585['id'],'VoicePrefixId':_0x438769[_0x2d4a('0x4e')]['id']},'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){_0x139e4e[_0x2d4a('0x8b')](function(_0x12914d){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':_0x12914d['id'],'VoicePrefixId':_0x3e276d['id']});});});});});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x1483af,null))['catch'](handleError(_0x1483af,null));};exports['removeTeams']=function(_0x51cba2,_0x448b4d,_0x4cefec){return db['Team'][_0x2d4a('0x47')]({'where':{'id':_0x51cba2[_0x2d4a('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2d4a('0x28')](handleEntityNotFound(_0x448b4d,null))[_0x2d4a('0x28')](function(_0x1e05c5){var _0x3e199a=_[_0x2d4a('0x36')](_0x1e05c5,'id');var _0x357dfc=[];var _0xd80165=[];var _0x448664=squel[_0x2d4a('0x8c')]();_0x448664[_0x2d4a('0x8d')]('tq.TeamId')[_0x2d4a('0x8e')](_0x2d4a('0x8f'),'tq')[_0x2d4a('0x90')](_0x2d4a('0x91'),'ut',_0x2d4a('0x92'))[_0x2d4a('0x41')]('VoicePrefixId\x20=\x20?',_0x51cba2[_0x2d4a('0x4e')]['id']);for(var _0x3030e1=0x0;_0x3030e1<_0x1e05c5['length'];_0x3030e1+=0x1){let _0xc5500=_0x1e05c5[_0x3030e1];for(var _0xe198b=0x0;_0xe198b<_0xc5500['Agents']['length'];_0xe198b+=0x1){let _0x497b03=_0xc5500['Agents'][_0xe198b];var _0xb81202=_0x448664['clone']();_0xb81202[_0x2d4a('0x41')](_0x2d4a('0x93'),_0x497b03['id']);_0xd80165[_0x2d4a('0x68')](db[_0x2d4a('0x72')][_0x2d4a('0x37')](_0xb81202[_0x2d4a('0x94')](),{'type':db[_0x2d4a('0x72')]['QueryTypes'][_0x2d4a('0x95')]})['then'](function(_0x2b6040){if(_0x2b6040[_0x2d4a('0x3d')]===0x1){return _0x497b03['id'];}else{var _0x137c57=_[_0x2d4a('0x96')](_[_0x2d4a('0x36')](_0x2b6040,_0x2d4a('0x97')),function(_0x29108f){return _['includes'](_0x3e199a,_0x29108f);});if(_0x137c57){return _0x497b03['id'];}}}));}}return BPromise[_0x2d4a('0x98')](_0xd80165)['then'](function(_0x1d4cc3){_0x357dfc=_(_0x357dfc)[_0x2d4a('0x99')](_0x1d4cc3)[_0x2d4a('0x9a')]()['value']();return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x51cba2[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](function(_0x108cd1){return db[_0x2d4a('0x72')]['transaction'](function(_0x29a294){return _0x108cd1['removeTeams'](_0x51cba2[_0x2d4a('0x37')]['ids'],{'transaction':_0x29a294})['then'](function(){if(!_[_0x2d4a('0x9b')](_0x357dfc)){return _0x108cd1['removeAgents'](_0x357dfc,{'transaction':_0x29a294});}})['then'](function(){_0x357dfc[_0x2d4a('0x8b')](function(_0x206717){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':_0x206717,'VoicePrefixId':_0x108cd1['id']});});});});});});})[_0x2d4a('0x28')](respondWithStatusCode(_0x448b4d,null))[_0x2d4a('0x4d')](handleError(_0x448b4d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index cbcd605..4902f07 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 _0x320b=['emit','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x4759f9,_0x4da9f0){var _0xc3ac06=function(_0x58f657){while(--_0x58f657){_0x4759f9['push'](_0x4759f9['shift']());}};_0xc3ac06(++_0x4da9f0);}(_0x320b,0x103));var _0xb320=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x320b[_0xd39959];return _0x1ff69c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xb320('0x0'))['db'][_0xb320('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb320('0x2')](0x0);var events={'afterCreate':_0xb320('0x3'),'afterUpdate':_0xb320('0x4'),'afterDestroy':'remove'};function emitEvent(_0xb762eb){return function(_0x49f0cc,_0x4da065,_0x374c30){VoicePrefixEvents[_0xb320('0x5')](_0xb762eb+':'+_0x49f0cc['id'],_0x49f0cc);VoicePrefixEvents[_0xb320('0x5')](_0xb762eb,_0x49f0cc);_0x374c30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xb320('0x6')](e,emitEvent(event));}}module[_0xb320('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xddbe=['setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0x215258,_0x1190ad){var _0x52f6a6=function(_0x144046){while(--_0x144046){_0x215258['push'](_0x215258['shift']());}};_0x52f6a6(++_0x1190ad);}(_0xddbe,0x19b));var _0xeddb=function(_0x289a73,_0x339e45){_0x289a73=_0x289a73-0x0;var _0x45ec6d=_0xddbe[_0x289a73];return _0x45ec6d;};'use strict';var EventEmitter=require(_0xeddb('0x0'));var VoicePrefix=require(_0xeddb('0x1'))['db'][_0xeddb('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xeddb('0x3')](0x0);var events={'afterCreate':_0xeddb('0x4'),'afterUpdate':'update','afterDestroy':_0xeddb('0x5')};function emitEvent(_0x105755){return function(_0x1470ba,_0x1900fd,_0x583b59){VoicePrefixEvents['emit'](_0x105755+':'+_0x1470ba['id'],_0x1470ba);VoicePrefixEvents['emit'](_0x105755,_0x1470ba);_0x583b59(null);};}for(var e in events){if(events[_0xeddb('0x6')](e)){var event=events[e];VoicePrefix[_0xeddb('0x7')](e,emitEvent(event));}}module[_0xeddb('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 117773b..a6558b1 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 _0xd133=['request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','bluebird'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0xd133,0x1d6));var _0x3d13=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0xd133[_0x420d8d];return _0x4865d7;};'use strict';var _=require(_0x3d13('0x0'));var util=require('util');var logger=require(_0x3d13('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3d13('0x2'));var rp=require(_0x3d13('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d13('0x4'));var config=require(_0x3d13('0x5'));var attributes=require(_0x3d13('0x6'));module[_0x3d13('0x7')]=function(_0xb0cc89,_0x1406a4){return _0xb0cc89[_0x3d13('0x8')](_0x3d13('0x9'),attributes,{'tableName':_0x3d13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8246=['moment','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x8246,0xa1));var _0x6824=function(_0x440b1c,_0x2e0c71){_0x440b1c=_0x440b1c-0x0;var _0x3997a8=_0x8246[_0x440b1c];return _0x3997a8;};'use strict';var _=require(_0x6824('0x0'));var util=require(_0x6824('0x1'));var logger=require(_0x6824('0x2'))(_0x6824('0x3'));var moment=require(_0x6824('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6824('0x5'));var config=require(_0x6824('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x6824('0x7')]=function(_0x50b570,_0x40c71e){return _0x50b570[_0x6824('0x8')](_0x6824('0x9'),attributes,{'tableName':_0x6824('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 232eeb4..d52850b 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 _0x103f=['register','info','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x3d5a86,_0x1843c4){var _0x4e0cff=function(_0x2222a5){while(--_0x2222a5){_0x3d5a86['push'](_0x3d5a86['shift']());}};_0x4e0cff(++_0x1843c4);}(_0x103f,0x13e));var _0xf103=function(_0x27c25e,_0x3ed8bd){_0x27c25e=_0x27c25e-0x0;var _0xc201f3=_0x103f[_0x27c25e];return _0xc201f3;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});config[_0xf103('0xd')]=_[_0xf103('0xe')](config[_0xf103('0xd')],{'host':_0xf103('0xf'),'port':0x18eb});var socket=require(_0xf103('0x10'))(new Redis(config[_0xf103('0xd')]));require(_0xf103('0x11'))[_0xf103('0x12')](socket);function respondWithRpcPromise(_0x267ec4,_0x47b71b,_0x228805){return new BPromise(function(_0x532559,_0x2aa8fd){return client['request'](_0x267ec4,_0x228805)['then'](function(_0xb3a849){logger[_0xf103('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x47b71b,_0xf103('0x14'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x47b71b,'request\x20sent',JSON[_0xf103('0x15')](_0xb3a849));if(_0xb3a849['error']){if(_0xb3a849[_0xf103('0x16')][_0xf103('0x17')]===0x1f4){logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849[_0xf103('0x16')]['message']);return _0x2aa8fd(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849['error']['message']);return _0x532559(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}else{logger[_0xf103('0x13')](_0xf103('0x18'),_0x47b71b,_0xf103('0x14'));_0x532559(_0xb3a849[_0xf103('0x1a')]['message']);}})[_0xf103('0x1b')](function(_0x338a44){logger['error'](_0xf103('0x18'),_0x47b71b,_0x338a44);_0x2aa8fd(_0x338a44);});});} \ No newline at end of file +var _0x20de=['VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','then','info'];(function(_0x313002,_0x1b748e){var _0x8664e5=function(_0x496dfe){while(--_0x496dfe){_0x313002['push'](_0x313002['shift']());}};_0x8664e5(++_0x1b748e);}(_0x20de,0x134));var _0xe20d=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x20de[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xe20d('0x0'));var util=require('util');var moment=require(_0xe20d('0x1'));var BPromise=require(_0xe20d('0x2'));var rs=require(_0xe20d('0x3'));var fs=require('fs');var Redis=require(_0xe20d('0x4'));var db=require(_0xe20d('0x5'))['db'];var utils=require(_0xe20d('0x6'));var logger=require(_0xe20d('0x7'))(_0xe20d('0x8'));var config=require(_0xe20d('0x9'));var jayson=require(_0xe20d('0xa'));var client=jayson[_0xe20d('0xb')]['http']({'port':0x232a});config[_0xe20d('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe20d('0xd'))(new Redis(config[_0xe20d('0xc')]));require(_0xe20d('0xe'))['register'](socket);function respondWithRpcPromise(_0x288d35,_0x2df52b,_0x5b40ad){return new BPromise(function(_0x339764,_0x337c85){return client['request'](_0x288d35,_0x5b40ad)[_0xe20d('0xf')](function(_0x21763b){logger[_0xe20d('0x10')](_0xe20d('0x11'),_0x2df52b,'request\x20sent');logger['debug'](_0xe20d('0x12'),_0x2df52b,_0xe20d('0x13'),JSON[_0xe20d('0x14')](_0x21763b));if(_0x21763b[_0xe20d('0x15')]){if(_0x21763b[_0xe20d('0x15')][_0xe20d('0x16')]===0x1f4){logger[_0xe20d('0x15')](_0xe20d('0x11'),_0x2df52b,_0x21763b[_0xe20d('0x15')]['message']);return _0x337c85(_0x21763b[_0xe20d('0x15')]['message']);}logger[_0xe20d('0x15')](_0xe20d('0x11'),_0x2df52b,_0x21763b[_0xe20d('0x15')]['message']);return _0x339764(_0x21763b[_0xe20d('0x15')]['message']);}else{logger[_0xe20d('0x10')](_0xe20d('0x11'),_0x2df52b,_0xe20d('0x13'));_0x339764(_0x21763b['result'][_0xe20d('0x17')]);}})[_0xe20d('0x18')](function(_0xd96fa7){logger[_0xe20d('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x2df52b,_0xd96fa7);_0x337c85(_0xd96fa7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 887f92e..9d56288 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 _0x96cc=['./voicePrefix.events','remove','emit','removeListener','register','length','voicePrefix:'];(function(_0x5100ef,_0x2d3ae3){var _0x47a5d=function(_0x3dd6ef){while(--_0x3dd6ef){_0x5100ef['push'](_0x5100ef['shift']());}};_0x47a5d(++_0x2d3ae3);}(_0x96cc,0x16c));var _0xc96c=function(_0x15ad95,_0x566009){_0x15ad95=_0x15ad95-0x0;var _0x439717=_0x96cc[_0x15ad95];return _0x439717;};'use strict';var VoicePrefixEvents=require(_0xc96c('0x0'));var events=['save',_0xc96c('0x1'),'update'];function createListener(_0x30bf8a,_0x3e7a95){return function(_0x107043){_0x3e7a95[_0xc96c('0x2')](_0x30bf8a,_0x107043);};}function removeListener(_0x71140d,_0x29b6f1){return function(){VoicePrefixEvents[_0xc96c('0x3')](_0x71140d,_0x29b6f1);};}exports[_0xc96c('0x4')]=function(_0x3b7f45){for(var _0x5142cd=0x0,_0x10b411=events[_0xc96c('0x5')];_0x5142cd<_0x10b411;_0x5142cd++){var _0x408afb=events[_0x5142cd];var _0x86c1a8=createListener(_0xc96c('0x6')+_0x408afb,_0x3b7f45);VoicePrefixEvents['on'](_0x408afb,_0x86c1a8);}}; \ No newline at end of file +var _0x81a4=['register','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x2512fd,_0x5f5bfd){var _0x576639=function(_0x516f80){while(--_0x516f80){_0x2512fd['push'](_0x2512fd['shift']());}};_0x576639(++_0x5f5bfd);}(_0x81a4,0x1a6));var _0x481a=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x81a4[_0xe4bb3d];return _0xd9e51;};'use strict';var VoicePrefixEvents=require(_0x481a('0x0'));var events=[_0x481a('0x1'),_0x481a('0x2'),_0x481a('0x3')];function createListener(_0x5a1f1f,_0x39262a){return function(_0x4f7de1){_0x39262a[_0x481a('0x4')](_0x5a1f1f,_0x4f7de1);};}function removeListener(_0x27a5dd,_0x2bc9ed){return function(){VoicePrefixEvents['removeListener'](_0x27a5dd,_0x2bc9ed);};}exports[_0x481a('0x5')]=function(_0x3a6458){for(var _0x17d40e=0x0,_0x14b819=events['length'];_0x17d40e<_0x14b819;_0x17d40e++){var _0x13ed10=events[_0x17d40e];var _0x13b771=createListener(_0x481a('0x6')+_0x13ed10,_0x3a6458);VoicePrefixEvents['on'](_0x13ed10,_0x13b771);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 3bd118c..44105e6 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 _0x378b=['destroy','removeTeams','removeAgents','removeLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','show','/:id/hoppers','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','getAgents','/:id/lists','/:id/blacklists','post','/:id/clone','clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','/:id','update','delete'];(function(_0x2ae6ee,_0x16805a){var _0x17653b=function(_0x299fc8){while(--_0x299fc8){_0x2ae6ee['push'](_0x2ae6ee['shift']());}};_0x17653b(++_0x16805a);}(_0x378b,0xef));var _0xb378=function(_0x1f459b,_0x23fde0){_0x1f459b=_0x1f459b-0x0;var _0x41b601=_0x378b[_0x1f459b];return _0x41b601;};'use strict';var multer=require(_0xb378('0x0'));var util=require(_0xb378('0x1'));var path=require(_0xb378('0x2'));var timeout=require(_0xb378('0x3'));var express=require('express');var router=express[_0xb378('0x4')]();var fs_extra=require(_0xb378('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb378('0x6'));var config=require(_0xb378('0x7'));var controller=require(_0xb378('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb378('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb378('0xa')]);router[_0xb378('0x9')](_0xb378('0xb'),auth[_0xb378('0xc')](),controller['getHoppers']);router[_0xb378('0x9')]('/:id/hopper_histories',auth[_0xb378('0xc')](),controller[_0xb378('0xd')]);router[_0xb378('0x9')](_0xb378('0xe'),auth[_0xb378('0xc')](),controller[_0xb378('0xf')]);router[_0xb378('0x9')](_0xb378('0x10'),auth[_0xb378('0xc')](),controller['getHopperBlacks']);router[_0xb378('0x9')](_0xb378('0x11'),auth[_0xb378('0xc')](),controller[_0xb378('0x12')]);router[_0xb378('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb378('0x13')]);router[_0xb378('0x9')]('/:id/members',auth[_0xb378('0xc')](),controller['getMembers']);router['get'](_0xb378('0x14'),auth[_0xb378('0xc')](),controller['getLists']);router['get'](_0xb378('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xb378('0x16')]('/',auth[_0xb378('0xc')](),controller['create']);router[_0xb378('0x16')](_0xb378('0x17'),auth['isAuthenticated'](),controller[_0xb378('0x18')]);router[_0xb378('0x16')](_0xb378('0x11'),auth[_0xb378('0xc')](),controller[_0xb378('0x19')]);router[_0xb378('0x16')](_0xb378('0x1a'),auth[_0xb378('0xc')](),controller[_0xb378('0x1b')]);router[_0xb378('0x16')](_0xb378('0x14'),auth[_0xb378('0xc')](),controller[_0xb378('0x1c')]);router[_0xb378('0x16')](_0xb378('0x15'),auth[_0xb378('0xc')](),controller[_0xb378('0x1d')]);router[_0xb378('0x1e')](_0xb378('0x1f'),auth[_0xb378('0xc')](),controller[_0xb378('0x20')]);router[_0xb378('0x21')](_0xb378('0x1f'),auth[_0xb378('0xc')](),controller[_0xb378('0x22')]);router[_0xb378('0x21')](_0xb378('0x11'),auth[_0xb378('0xc')](),controller[_0xb378('0x23')]);router[_0xb378('0x21')](_0xb378('0x1a'),auth['isAuthenticated'](),controller[_0xb378('0x24')]);router[_0xb378('0x21')](_0xb378('0x14'),auth[_0xb378('0xc')](),controller[_0xb378('0x25')]);router[_0xb378('0x21')](_0xb378('0x15'),auth[_0xb378('0xc')](),controller['removeBlackLists']);module[_0xb378('0x26')]=router; \ No newline at end of file +var _0xb7b8=['get','isAuthenticated','index','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller'];(function(_0x4ed4af,_0x4a1a9c){var _0x4191a3=function(_0x1616f0){while(--_0x1616f0){_0x4ed4af['push'](_0x4ed4af['shift']());}};_0x4191a3(++_0x4a1a9c);}(_0xb7b8,0x168));var _0x8b7b=function(_0x4feec1,_0x149bfb){_0x4feec1=_0x4feec1-0x0;var _0x582e2d=_0xb7b8[_0x4feec1];return _0x582e2d;};'use strict';var multer=require(_0x8b7b('0x0'));var util=require('util');var path=require(_0x8b7b('0x1'));var timeout=require(_0x8b7b('0x2'));var express=require(_0x8b7b('0x3'));var router=express[_0x8b7b('0x4')]();var fs_extra=require(_0x8b7b('0x5'));var auth=require(_0x8b7b('0x6'));var interaction=require(_0x8b7b('0x7'));var config=require('../../config/environment');var controller=require(_0x8b7b('0x8'));router[_0x8b7b('0x9')]('/',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0xb')]);router['get'](_0x8b7b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8b7b('0x9')](_0x8b7b('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x8b7b('0x9')](_0x8b7b('0xe'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0xf')]);router[_0x8b7b('0x9')]('/:id/hopper_finals',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x10')]);router['get'](_0x8b7b('0x11'),auth[_0x8b7b('0xa')](),controller['getHopperBlacks']);router[_0x8b7b('0x9')](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x13')]);router[_0x8b7b('0x9')](_0x8b7b('0x14'),auth[_0x8b7b('0xa')](),controller['getAgents']);router[_0x8b7b('0x9')]('/:id/members',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x15')]);router[_0x8b7b('0x9')]('/:id/lists',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8b7b('0x17')]);router[_0x8b7b('0x18')]('/',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x19')]);router[_0x8b7b('0x18')](_0x8b7b('0x1a'),auth['isAuthenticated'](),controller[_0x8b7b('0x1b')]);router[_0x8b7b('0x18')](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x1c')]);router[_0x8b7b('0x18')](_0x8b7b('0x14'),auth['isAuthenticated'](),controller[_0x8b7b('0x1d')]);router['post'](_0x8b7b('0x1e'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x1f')]);router[_0x8b7b('0x18')](_0x8b7b('0x20'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x21')]);router['put'](_0x8b7b('0xc'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x22')]);router[_0x8b7b('0x23')](_0x8b7b('0xc'),auth[_0x8b7b('0xa')](),controller['destroy']);router['delete'](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x24')]);router['delete'](_0x8b7b('0x14'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x25')]);router['delete'](_0x8b7b('0x1e'),auth['isAuthenticated'](),controller[_0x8b7b('0x26')]);router[_0x8b7b('0x23')](_0x8b7b('0x20'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x27')]);module[_0x8b7b('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index fc38128..b14bbc3 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 _0x41f2=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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\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)','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','setDataValue','rrmemory','getDataValue','dialMethod','booked','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x31d8af,_0x47e7d9){var _0x2b4617=function(_0x943db3){while(--_0x943db3){_0x31d8af['push'](_0x31d8af['shift']());}};_0x2b4617(++_0x47e7d9);}(_0x41f2,0x14f));var _0x241f=function(_0x3f5027,_0x5d4ece){_0x3f5027=_0x3f5027-0x0;var _0x2b30b9=_0x41f2[_0x3f5027];return _0x2b30b9;};'use strict';var Sequelize=require(_0x241f('0x0'));module[_0x241f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x241f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x4'),_0x241f('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x241f('0x6')],'defaultValue':_0x241f('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x241f('0x3')]('rr',_0x241f('0x8'),_0x241f('0x9'),_0x241f('0xa'),_0x241f('0xb'),'rrmemory',_0x241f('0xc'),_0x241f('0xd'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x5eaaf6){this[_0x241f('0xe')]('strategy',_0x5eaaf6?_0x5eaaf6:_0x241f('0xf'));},'get':function(){var _0x497212=this[_0x241f('0x10')]('type');var _0x1cbc55=this['getDataValue'](_0x241f('0x11'));var _0x38d668=this[_0x241f('0x10')]('strategy');if(_0x497212===_0x241f('0x4')){return _0x38d668;}if(_0x1cbc55===_0x241f('0x12')&&_0x38d668===_0x241f('0xf')||_0x1cbc55===_0x241f('0x12')&&_0x38d668==='roundrobin'){return _0x38d668;}if(_0x1cbc55===_0x241f('0x13')||_0x1cbc55==='predictive'||_0x1cbc55===_0x241f('0x14')){return _0x38d668;}return null;}},'servicelevel':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x241f('0x15')](0xb)},'timeout':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x241f('0x6')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x241f('0x3')]('yes','no'),'defaultValue':_0x241f('0x16')},'autopause':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no',_0x241f('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x241f('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x241f('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x241f('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x16'),'no'),'defaultValue':_0x241f('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no',_0x241f('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x241f('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x241f('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x241f('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x241f('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x241f('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x241f('0x6')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x241f('0x19')],'set':function(_0x587256){this[_0x241f('0xe')](_0x241f('0x1a'),_0x587256?_0x587256[_0x241f('0x1b')](','):[]);},'get':function(){return this[_0x241f('0x10')](_0x241f('0x1a'))?this[_0x241f('0x10')](_0x241f('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x241f('0x6')],'defaultValue':_0x241f('0x16'),'set':function(_0x272dcb){this[_0x241f('0xe')](_0x241f('0x1c'),_0x272dcb?_0x272dcb[_0x241f('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x241f('0x1c'))?this[_0x241f('0x10')](_0x241f('0x1c'))[_0x241f('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x241f('0x6')],'defaultValue':'no','set':function(_0x22401a){this['setDataValue']('leavewhenempty',_0x22401a?_0x22401a['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x241f('0x1e'))?this[_0x241f('0x10')](_0x241f('0x1e'))[_0x241f('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x241f('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x241f('0x6')]},'description':{'type':Sequelize[_0x241f('0x6')]},'acw':{'type':Sequelize[_0x241f('0x1f')],'defaultValue':0x0,'set':function(_0x13129f){this[_0x241f('0xe')](_0x241f('0x20'),_0x13129f);if(_0x13129f){if(this[_0x241f('0x10')](_0x241f('0x21'))<0x2){this[_0x241f('0xe')](_0x241f('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x241f('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x241f('0x1f')],'defaultValue':0x0,'comment':_0x241f('0x22')},'dialMethod':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x23'),'progressive',_0x241f('0x14'),_0x241f('0x24'),'booked'),'defaultValue':'progressive','comment':_0x241f('0x25')},'dialLimitChannel':{'type':Sequelize[_0x241f('0x15')](0x4)[_0x241f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x241f('0x27')},'dialLimitQueue':{'type':Sequelize[_0x241f('0x15')](0x4)[_0x241f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x241f('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x241f('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x241f('0x3')](_0x241f('0x2a'),_0x241f('0x2b')),'defaultValue':_0x241f('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x241f('0x28')](0x2)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x241f('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x241f('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x241f('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x241f('0x6')],'comment':_0x241f('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)[_0x241f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)[_0x241f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x241f('0x26')],'defaultValue':0x3,'comment':_0x241f('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x241f('0x35')},'dialTimezone':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x241f('0x36')},'dialPrefix':{'type':Sequelize[_0x241f('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x241f('0x37')),'defaultValue':_0x241f('0x38')},'dialAMDActive':{'type':Sequelize[_0x241f('0x1f')],'defaultValue':0x0,'comment':_0x241f('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x241f('0x15')](0x9)[_0x241f('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x241f('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x241f('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x241f('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x241f('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x241f('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x241f('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x241f('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x241f('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x241f('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x241f('0x15')](0x9)[_0x241f('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x241f('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x241f('0x15')](0x9)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x241f('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x241f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x241f('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x241f('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x241f('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x241f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x241f('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x241f('0x6')],'comment':_0x241f('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x241f('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x241f('0x44')},'dialCutDigit':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x241f('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)[_0x241f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)[_0x241f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x241f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x241f('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x241f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x241f('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x241f('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x241f('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x19305b){if(!_0x19305b)this[_0x241f('0xe')]('mandatoryDispositionPauseId',null);this[_0x241f('0xe')](_0x241f('0x4f'),_0x19305b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x241f('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x241f('0x15')](0x3)[_0x241f('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x522b=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','outbound','inbound','default','STRING','ENUM','ringall','leastrecent','random','rrmemory','rrordered','setDataValue','getDataValue','dialMethod','strategy','booked','roundrobin','predictive','power','INTEGER','yes','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x4273d1,_0x26d223){var _0x3fc1ec=function(_0xcbae6a){while(--_0xcbae6a){_0x4273d1['push'](_0x4273d1['shift']());}};_0x3fc1ec(++_0x26d223);}(_0x522b,0x1c3));var _0xb522=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x522b[_0x8560d3];return _0x33b1b5;};'use strict';var Sequelize=require(_0xb522('0x0'));module[_0xb522('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb522('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xb522('0x3')),'allowNull':![],'defaultValue':_0xb522('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb522('0x5')},'announce':{'type':Sequelize[_0xb522('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb522('0x7')]('rr',_0xb522('0x8'),_0xb522('0x9'),'fewestcalls',_0xb522('0xa'),_0xb522('0xb'),'linear','wrandom',_0xb522('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3f4f63){this[_0xb522('0xd')]('strategy',_0x3f4f63?_0x3f4f63:_0xb522('0xb'));},'get':function(){var _0x2676b7=this[_0xb522('0xe')]('type');var _0x58d053=this[_0xb522('0xe')](_0xb522('0xf'));var _0x37d16c=this['getDataValue'](_0xb522('0x10'));if(_0x2676b7==='inbound'){return _0x37d16c;}if(_0x58d053===_0xb522('0x11')&&_0x37d16c===_0xb522('0xb')||_0x58d053==='booked'&&_0x37d16c===_0xb522('0x12')){return _0x37d16c;}if(_0x58d053==='progressive'||_0x58d053===_0xb522('0x13')||_0x58d053===_0xb522('0x14')){return _0x37d16c;}return null;}},'servicelevel':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb522('0x15')](0xb)},'timeout':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xb522('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':_0xb522('0x16')},'autopause':{'type':Sequelize['ENUM'](_0xb522('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb522('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb522('0x7')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb522('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb522('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb522('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb522('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb522('0x6')]},'queue_youarenext':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb522('0x6')]},'queue_quantity1':{'type':Sequelize[_0xb522('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xb522('0x6')]},'queue_less_than':{'type':Sequelize[_0xb522('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x3ae80d){this[_0xb522('0xd')](_0xb522('0x17'),_0x3ae80d?_0x3ae80d[_0xb522('0x18')](','):[]);},'get':function(){return this[_0xb522('0xe')]('periodic_announce')?this[_0xb522('0xe')](_0xb522('0x17'))[_0xb522('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xb522('0x6')],'defaultValue':_0xb522('0x16'),'set':function(_0xdeba3){this[_0xb522('0xd')]('joinempty',_0xdeba3?_0xdeba3[_0xb522('0x18')](','):undefined);},'get':function(){return this[_0xb522('0xe')](_0xb522('0x1a'))?this['getDataValue'](_0xb522('0x1a'))[_0xb522('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x55f719){this[_0xb522('0xd')](_0xb522('0x1b'),_0x55f719?_0x55f719[_0xb522('0x18')](','):undefined);},'get':function(){return this[_0xb522('0xe')](_0xb522('0x1b'))?this[_0xb522('0xe')](_0xb522('0x1b'))[_0xb522('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb522('0x6')]},'description':{'type':Sequelize[_0xb522('0x6')]},'acw':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'set':function(_0x37853e){this['setDataValue']('acw',_0x37853e);if(_0x37853e){if(this['getDataValue'](_0xb522('0x1d'))<0x2){this[_0xb522('0xd')](_0xb522('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':_0xb522('0x1e')},'dialMethod':{'type':Sequelize[_0xb522('0x7')]('preview','progressive',_0xb522('0x14'),'predictive',_0xb522('0x11')),'defaultValue':_0xb522('0x1f'),'comment':_0xb522('0x20')},'dialLimitChannel':{'type':Sequelize[_0xb522('0x15')](0x4)[_0xb522('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb522('0x22')},'dialLimitQueue':{'type':Sequelize[_0xb522('0x15')](0x4)[_0xb522('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xb522('0x23')](0x2)[_0xb522('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0xb522('0x24')),'defaultValue':_0xb522('0x24'),'comment':_0xb522('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb522('0x23')](0x2)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb522('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb522('0x27')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb522('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb522('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x28')},'dialQueueOptions':{'type':Sequelize[_0xb522('0x6')],'defaultValue':_0xb522('0x29'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb522('0x2a')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x2b')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x2e')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb522('0x2f')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xb522('0x30')},'dialPrefix':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x31'),'never',_0xb522('0x32')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb522('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb522('0x33')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb522('0x34')},'dialAMDMinWordLength':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb522('0x35')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb522('0x36')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb522('0x37')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb522('0x38')},'dialRecallMeTimeout':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb522('0x39')},'dialRecallInQueue':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x3a'),'ASC'),'defaultValue':_0xb522('0x3a')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xb522('0x2a')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb522('0x3b')},'dialCutDigit':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb522('0x3c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x3d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x3e')},'dialDropRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x3f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x40')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x41')},'dialMachineMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x42')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x43')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb522('0x15')],'allowNull':!![],'comment':_0xb522('0x44')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb522('0x45'),'set':function(_0x2c285e){if(!_0x2c285e)this[_0xb522('0xd')](_0xb522('0x46'),null);this[_0xb522('0xd')](_0xb522('0x47'),_0x2c285e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a636a24..54958c3 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 _0xb1b6=['CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','userVoiceQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','cm_contacts','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','VoiceQueues','outbound','ignore','map','value','type','find','name','UserProfileResource','destroy','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','include','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','QueueCampaigns','update','params','getHoppers','findOne'];(function(_0xffe020,_0x29b465){var _0x1ee35a=function(_0xf9581d){while(--_0xf9581d){_0xffe020['push'](_0xffe020['shift']());}};_0x1ee35a(++_0x29b465);}(_0xb1b6,0x111));var _0x6b1b=function(_0x1dbdc2,_0x190d3c){_0x1dbdc2=_0x1dbdc2-0x0;var _0xc320d3=_0xb1b6[_0x1dbdc2];return _0xc320d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6b1b('0x0'));var jsonpatch=require(_0x6b1b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b1b('0x2'));var Mustache=require('mustache');var util=require(_0x6b1b('0x3'));var path=require(_0x6b1b('0x4'));var sox=require(_0x6b1b('0x5'));var csv=require('to-csv');var ejs=require(_0x6b1b('0x6'));var fs=require('fs');var fs_extra=require(_0x6b1b('0x7'));var _=require('lodash');var squel=require(_0x6b1b('0x8'));var crypto=require(_0x6b1b('0x9'));var jsforce=require(_0x6b1b('0xa'));var deskjs=require(_0x6b1b('0xb'));var toCsv=require(_0x6b1b('0xc'));var querystring=require(_0x6b1b('0xd'));var Papa=require(_0x6b1b('0xe'));var Redis=require(_0x6b1b('0xf'));var authService=require(_0x6b1b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6b1b('0x11'));var hardwareService=require(_0x6b1b('0x12'));var logger=require(_0x6b1b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6b1b('0x14'));var licenseUtil=require(_0x6b1b('0x15'));var db=require(_0x6b1b('0x16'))['db'];config['redis']=_[_0x6b1b('0x17')](config[_0x6b1b('0x18')],{'host':_0x6b1b('0x19'),'port':0x18eb});var socket=require(_0x6b1b('0x1a'))(new Redis(config[_0x6b1b('0x18')]));require(_0x6b1b('0x1b'))[_0x6b1b('0x1c')](socket);function respondWithStatusCode(_0x509bc7,_0x63b4c1){_0x63b4c1=_0x63b4c1||0xcc;return function(_0x5f2213){if(_0x5f2213){return _0x509bc7[_0x6b1b('0x1d')](_0x63b4c1);}return _0x509bc7['status'](_0x63b4c1)[_0x6b1b('0x1e')]();};}function respondWithResult(_0x49a9fe,_0x36b547){_0x36b547=_0x36b547||0xc8;return function(_0x2f8df0){if(_0x2f8df0){return _0x49a9fe['status'](_0x36b547)[_0x6b1b('0x1f')](_0x2f8df0);}};}function respondWithFilteredResult(_0x53d11c,_0x47f92f){return function(_0x129985){if(_0x129985){var _0x9d8c06=typeof _0x47f92f[_0x6b1b('0x20')]===_0x6b1b('0x21')&&typeof _0x47f92f[_0x6b1b('0x22')]===_0x6b1b('0x21');var _0x558f41=_0x129985[_0x6b1b('0x23')];var _0xde1d5=_0x9d8c06?0x0:_0x47f92f[_0x6b1b('0x20')];var _0x13d399=_0x9d8c06?_0x129985[_0x6b1b('0x23')]:_0x47f92f[_0x6b1b('0x20')]+_0x47f92f[_0x6b1b('0x22')];var _0x8ad481;if(_0x13d399>=_0x558f41){_0x13d399=_0x558f41;_0x8ad481=0xc8;}else{_0x8ad481=0xce;}_0x53d11c[_0x6b1b('0x24')](_0x8ad481);return _0x53d11c[_0x6b1b('0x25')](_0x6b1b('0x26'),_0xde1d5+'-'+_0x13d399+'/'+_0x558f41)[_0x6b1b('0x1f')](_0x129985);}return null;};}function patchUpdates(_0x45eee7){return function(_0x25c0c2){try{jsonpatch[_0x6b1b('0x27')](_0x25c0c2,_0x45eee7,!![]);}catch(_0x2c27d3){return BPromise[_0x6b1b('0x28')](_0x2c27d3);}return _0x25c0c2['save']();};}function saveUpdates(_0x2e27df,_0x443950){return function(_0x4330b2){if(_0x4330b2){return _0x4330b2['update'](_0x2e27df)[_0x6b1b('0x29')](function(_0x2f4e33){return _0x2f4e33;});}return null;};}function removeEntity(_0x1140a1,_0x3bbb1d){return function(_0x19e202){if(_0x19e202){return _0x19e202['destroy']()['then'](function(){var _0x452869=_0x19e202['get']({'plain':!![]});var _0x205e6d=[{'name':_0x6b1b('0x2a'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x6b1b('0x2b'),'ignore':![]}];var _0x55022a=_(_0x205e6d)['filter'](_0x6b1b('0x2c'))[_0x6b1b('0x2d')](_0x6b1b('0x2e'))[_0x6b1b('0x2e')]();if(_['includes'](_0x55022a,_0x452869[_0x6b1b('0x2f')])){return;}var _0x1f9ac0=_[_0x6b1b('0x30')](_0x205e6d,[_0x6b1b('0x2e'),_0x452869['type']])[_0x6b1b('0x31')];return db[_0x6b1b('0x32')][_0x6b1b('0x33')]({'where':{'type':_0x1f9ac0,'resourceId':_0x452869['id']}})[_0x6b1b('0x29')](function(){return _0x19e202;});})['then'](function(){_0x1140a1[_0x6b1b('0x24')](0xcc)[_0x6b1b('0x1e')]();});}};}function handleEntityNotFound(_0x280a3b,_0x1aecfe){return function(_0x2f4a72){if(!_0x2f4a72){_0x280a3b[_0x6b1b('0x1d')](0x194);}return _0x2f4a72;};}function handleError(_0x262fa3,_0x19fd89){_0x19fd89=_0x19fd89||0x1f4;return function(_0x1ea915){logger['error'](_0x1ea915[_0x6b1b('0x34')]);if(_0x1ea915[_0x6b1b('0x31')]){delete _0x1ea915['name'];}_0x262fa3[_0x6b1b('0x24')](_0x19fd89)['send'](_0x1ea915);};}exports[_0x6b1b('0x35')]=function(_0x26ca10,_0x35d8c5){var _0x1fab79={},_0x19cc57={},_0x59816d={'count':0x0,'rows':[]};var _0x1226c6=_[_0x6b1b('0x2d')](db[_0x6b1b('0x36')][_0x6b1b('0x37')],function(_0x3e04e5){return{'name':_0x3e04e5[_0x6b1b('0x38')],'type':_0x3e04e5[_0x6b1b('0x2f')][_0x6b1b('0x39')]};});_0x19cc57[_0x6b1b('0x3a')]=_[_0x6b1b('0x2d')](_0x1226c6,_0x6b1b('0x31'));_0x19cc57['query']=_[_0x6b1b('0x3b')](_0x26ca10[_0x6b1b('0x3c')]);_0x19cc57[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x19cc57[_0x6b1b('0x3a')],_0x19cc57['query']);_0x1fab79[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0x19cc57[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x26ca10[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x1fab79['attributes']=_0x1fab79[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x1fab79['attributes']:_0x19cc57[_0x6b1b('0x3a')];if(!_0x26ca10['query'][_0x6b1b('0x42')](_0x6b1b('0x43'))){_0x1fab79['limit']=qs[_0x6b1b('0x22')](_0x26ca10[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x1fab79[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x26ca10[_0x6b1b('0x3c')][_0x6b1b('0x20')]);}_0x1fab79[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x26ca10['query'][_0x6b1b('0x45')]);_0x1fab79[_0x6b1b('0x46')]=qs['filters'](_[_0x6b1b('0x47')](_0x26ca10[_0x6b1b('0x3c')],_0x19cc57[_0x6b1b('0x3d')]),_0x1226c6);if(_0x26ca10['query'][_0x6b1b('0x48')]){_0x1fab79[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x1fab79[_0x6b1b('0x46')],{'$or':_['map'](_0x1226c6,function(_0x1db786){if(_0x1db786['type']!==_0x6b1b('0x4a')){var _0x102df3={};_0x102df3[_0x1db786['name']]={'$like':'%'+_0x26ca10[_0x6b1b('0x3c')][_0x6b1b('0x48')]+'%'};return _0x102df3;}})});}_0x1fab79=_[_0x6b1b('0x49')]({},_0x1fab79,_0x26ca10['options']);var _0x33cfb9={'where':_0x1fab79[_0x6b1b('0x46')]};return db[_0x6b1b('0x36')]['count'](_0x33cfb9)['then'](function(_0x591dc4){_0x59816d[_0x6b1b('0x23')]=_0x591dc4;if(_0x26ca10[_0x6b1b('0x3c')][_0x6b1b('0x4b')]){_0x1fab79['include']=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x1fab79);})[_0x6b1b('0x29')](function(_0x20ea9a){_0x59816d[_0x6b1b('0x4c')]=_0x20ea9a;return _0x59816d;})[_0x6b1b('0x29')](respondWithFilteredResult(_0x35d8c5,_0x1fab79))[_0x6b1b('0x4d')](handleError(_0x35d8c5,null));};exports['show']=function(_0x42a8d2,_0x77ca02){var _0x67bf6d={'raw':![],'where':{'id':_0x42a8d2['params']['id']}},_0x56c235={};_0x56c235[_0x6b1b('0x3a')]=_['keys'](db['VoiceQueue'][_0x6b1b('0x37')]);_0x56c235[_0x6b1b('0x3c')]=_['keys'](_0x42a8d2[_0x6b1b('0x3c')]);_0x56c235[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x56c235[_0x6b1b('0x3a')],_0x56c235[_0x6b1b('0x3c')]);_0x67bf6d[_0x6b1b('0x3f')]=_['intersection'](_0x56c235[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x42a8d2[_0x6b1b('0x3c')]['fields']));_0x67bf6d[_0x6b1b('0x3f')]=_0x67bf6d[_0x6b1b('0x3f')]['length']?_0x67bf6d['attributes']:_0x56c235[_0x6b1b('0x3a')];if(_0x42a8d2[_0x6b1b('0x3c')][_0x6b1b('0x4b')]){_0x67bf6d[_0x6b1b('0x4e')]=[{'all':!![]}];}_0x67bf6d=_[_0x6b1b('0x49')]({},_0x67bf6d,_0x42a8d2[_0x6b1b('0x4f')]);return db[_0x6b1b('0x36')][_0x6b1b('0x30')](_0x67bf6d)[_0x6b1b('0x29')](handleEntityNotFound(_0x77ca02,null))['then'](respondWithResult(_0x77ca02,null))['catch'](handleError(_0x77ca02,null));};exports[_0x6b1b('0x50')]=function(_0x24912c,_0x482649){return db['VoiceQueue'][_0x6b1b('0x50')](_0x24912c['body'],{})[_0x6b1b('0x29')](function(_0x5de133){var _0x4b733d=_0x24912c[_0x6b1b('0x51')][_0x6b1b('0x52')]({'plain':!![]});if(!_0x4b733d)throw new Error(_0x6b1b('0x53'));if(_0x4b733d[_0x6b1b('0x54')]===_0x6b1b('0x51')){var _0x54e7e7=_0x5de133[_0x6b1b('0x52')]({'plain':!![]});var _0x198c6b=[{'name':_0x6b1b('0x2a'),'value':_0x6b1b('0x55')},{'name':'QueueCampaigns','value':_0x6b1b('0x2b')}];var _0x240185=_[_0x6b1b('0x30')](_0x198c6b,[_0x6b1b('0x2e'),_0x54e7e7[_0x6b1b('0x2f')]])[_0x6b1b('0x31')];return db[_0x6b1b('0x56')][_0x6b1b('0x30')]({'where':{'name':_0x240185,'userProfileId':_0x4b733d[_0x6b1b('0x57')]},'raw':!![]})[_0x6b1b('0x29')](function(_0x544be1){if(_0x544be1&&_0x544be1[_0x6b1b('0x58')]===0x0){return db[_0x6b1b('0x32')][_0x6b1b('0x50')]({'name':_0x54e7e7[_0x6b1b('0x31')],'resourceId':_0x54e7e7['id'],'type':_0x544be1[_0x6b1b('0x31')],'sectionId':_0x544be1['id']},{})[_0x6b1b('0x29')](function(){return _0x5de133;});}else{return _0x5de133;}})[_0x6b1b('0x4d')](function(_0x746d8e){logger[_0x6b1b('0x59')](_0x6b1b('0x5a'),_0x746d8e);throw _0x746d8e;});}return _0x5de133;})[_0x6b1b('0x29')](respondWithResult(_0x482649,0xc9))[_0x6b1b('0x4d')](handleError(_0x482649,null));};exports[_0x6b1b('0x5b')]=function(_0x14dce5,_0xf70784){var _0x3e9df3={'where':{'id':_0x14dce5['params']['id']}},_0x5d561c={};_0x5d561c[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db[_0x6b1b('0x36')][_0x6b1b('0x37')]);_0x3e9df3[_0x6b1b('0x3f')]=_['intersection'](_0x5d561c['model'],qs[_0x6b1b('0x40')](_0x14dce5[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x3e9df3[_0x6b1b('0x3f')]=_0x3e9df3['attributes'][_0x6b1b('0x41')]?_0x3e9df3[_0x6b1b('0x3f')]:_0x5d561c[_0x6b1b('0x3a')];if(_0x14dce5['query'][_0x6b1b('0x4b')]){_0x3e9df3[_0x6b1b('0x4e')]=[{'all':!![]}];}_0x3e9df3=_['merge']({},_0x3e9df3,_0x14dce5[_0x6b1b('0x4f')]);return db[_0x6b1b('0x36')]['find'](_0x3e9df3)[_0x6b1b('0x29')](handleEntityNotFound(_0xf70784,null))[_0x6b1b('0x29')](function(_0x53b971){if(_0x53b971){var _0x3594ee=_0x53b971['get']({'plain':!![]});_0x3594ee=qs[_0x6b1b('0x5c')](_0x3594ee,['id','createdAt',_0x6b1b('0x5d')]);_0x14dce5['body']=_[_0x6b1b('0x5c')](_0x14dce5[_0x6b1b('0x5e')],['id',_0x6b1b('0x5f'),'updatedAt']);return db[_0x6b1b('0x36')][_0x6b1b('0x50')](_['merge'](_0x3594ee,_0x14dce5[_0x6b1b('0x5e')]),{'include':_0x14dce5['query'][_0x6b1b('0x4b')]?[{'all':!![]}]:undefined})[_0x6b1b('0x29')](function(_0x172cd6){var _0x432e87=_0x14dce5[_0x6b1b('0x51')][_0x6b1b('0x52')]({'plain':!![]});if(!_0x432e87)throw new Error(_0x6b1b('0x53'));if(_0x432e87[_0x6b1b('0x54')]===_0x6b1b('0x51')){var _0x2770a2=_0x172cd6[_0x6b1b('0x52')]({'plain':!![]});var _0x54b94e=[{'name':_0x6b1b('0x2a'),'value':'inbound'},{'name':_0x6b1b('0x60'),'value':'outbound'}];var _0x42a15c=_['find'](_0x54b94e,[_0x6b1b('0x2e'),_0x2770a2[_0x6b1b('0x2f')]])['name'];return db[_0x6b1b('0x56')][_0x6b1b('0x30')]({'where':{'name':_0x42a15c,'userProfileId':_0x432e87[_0x6b1b('0x57')]},'raw':!![]})['then'](function(_0x2b8589){if(_0x2b8589&&_0x2b8589[_0x6b1b('0x58')]===0x0){return db['UserProfileResource'][_0x6b1b('0x50')]({'name':_0x2770a2[_0x6b1b('0x31')],'resourceId':_0x2770a2['id'],'type':_0x2b8589[_0x6b1b('0x31')],'sectionId':_0x2b8589['id']},{})[_0x6b1b('0x29')](function(){return _0x172cd6;});}else{return _0x172cd6;}})[_0x6b1b('0x4d')](function(_0x49784a){logger['error'](_0x6b1b('0x5a'),_0x49784a);throw _0x49784a;});}return _0x172cd6;});}})[_0x6b1b('0x29')](respondWithResult(_0xf70784,0xc9))[_0x6b1b('0x4d')](handleError(_0xf70784,null));};exports[_0x6b1b('0x61')]=function(_0x45653e,_0xed4607){if(_0x45653e[_0x6b1b('0x5e')]['id']){delete _0x45653e[_0x6b1b('0x5e')]['id'];}return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0x45653e[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0xed4607,null))[_0x6b1b('0x29')](saveUpdates(_0x45653e['body'],null))['then'](respondWithResult(_0xed4607,null))['catch'](handleError(_0xed4607,null));};exports[_0x6b1b('0x33')]=function(_0x34edbb,_0x128a82){return db[_0x6b1b('0x36')]['find']({'where':{'id':_0x34edbb['params']['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x128a82,null))['then'](removeEntity(_0x128a82,null))[_0x6b1b('0x4d')](handleError(_0x128a82,null));};exports[_0x6b1b('0x63')]=function(_0x3b39c8,_0x4d7fd6,_0x383be9){var _0x2c74e4={'raw':![],'where':{}};var _0x12374f={};var _0x4c9b45={'count':0x0,'rows':[]};return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x3b39c8[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x4d7fd6,null))['then'](function(_0x3db678){if(_0x3db678){_0x12374f['model']=_[_0x6b1b('0x3b')](db[_0x6b1b('0x65')][_0x6b1b('0x37')]);_0x12374f[_0x6b1b('0x3c')]=_['keys'](_0x3b39c8[_0x6b1b('0x3c')]);_0x12374f[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x12374f['model'],_0x12374f['query']);_0x2c74e4[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0x12374f[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x3b39c8['query']['fields']));_0x2c74e4['attributes']=_0x2c74e4[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x2c74e4['attributes']:_0x12374f[_0x6b1b('0x3a')];if(!_0x3b39c8[_0x6b1b('0x3c')]['hasOwnProperty'](_0x6b1b('0x43'))){_0x2c74e4[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x3b39c8[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x2c74e4[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x3b39c8[_0x6b1b('0x3c')][_0x6b1b('0x20')]);}_0x2c74e4['order']=qs[_0x6b1b('0x45')](_0x3b39c8[_0x6b1b('0x3c')][_0x6b1b('0x45')]);_0x2c74e4['where']=qs['filters'](_[_0x6b1b('0x47')](_0x3b39c8[_0x6b1b('0x3c')],_0x12374f[_0x6b1b('0x3d')]));_0x2c74e4[_0x6b1b('0x46')][_0x6b1b('0x66')]=_0x3db678['id'];if(_0x3b39c8[_0x6b1b('0x3c')][_0x6b1b('0x48')]){_0x2c74e4[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x2c74e4[_0x6b1b('0x46')],{'$or':_[_0x6b1b('0x2d')](_0x2c74e4[_0x6b1b('0x3f')],function(_0x1c6254){var _0x3694c7={};_0x3694c7[_0x1c6254]={'$like':'%'+_0x3b39c8['query'][_0x6b1b('0x48')]+'%'};return _0x3694c7;})});}_0x2c74e4=_[_0x6b1b('0x49')]({},_0x2c74e4,_0x3b39c8[_0x6b1b('0x4f')]);return db[_0x6b1b('0x65')][_0x6b1b('0x23')]({'where':_0x2c74e4['where']})['then'](function(_0x4c49da){_0x4c9b45[_0x6b1b('0x23')]=_0x4c49da;if(_0x3b39c8[_0x6b1b('0x3c')]['includeAll']){_0x2c74e4[_0x6b1b('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x6b1b('0x67')](_0x2c74e4);})[_0x6b1b('0x29')](function(_0x1567a2){_0x4c9b45['rows']=_0x1567a2;return _0x4c9b45;});}})[_0x6b1b('0x29')](respondWithFilteredResult(_0x4d7fd6,_0x2c74e4))[_0x6b1b('0x4d')](handleError(_0x4d7fd6,null));};exports[_0x6b1b('0x68')]=function(_0x155449,_0x180108,_0x43dab5){var _0x47a0f3={'raw':!![],'where':{}};var _0x1938bb={};var _0x2bc7c7={'count':0x0,'rows':[]};return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x155449[_0x6b1b('0x62')]['id']}})['then'](handleEntityNotFound(_0x180108,null))['then'](function(_0x20096e){if(_0x20096e){_0x1938bb[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db[_0x6b1b('0x69')]['rawAttributes']);_0x1938bb[_0x6b1b('0x3c')]=_['keys'](_0x155449[_0x6b1b('0x3c')]);_0x1938bb['filters']=_['intersection'](_0x1938bb[_0x6b1b('0x3a')],_0x1938bb[_0x6b1b('0x3c')]);_0x47a0f3[_0x6b1b('0x3f')]=_['intersection'](_0x1938bb['model'],qs[_0x6b1b('0x40')](_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x47a0f3[_0x6b1b('0x3f')]=_0x47a0f3[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x47a0f3[_0x6b1b('0x3f')]:_0x1938bb[_0x6b1b('0x3a')];if(!_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x42')](_0x6b1b('0x43'))){_0x47a0f3[_0x6b1b('0x22')]=qs['limit'](_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x47a0f3['offset']=qs[_0x6b1b('0x20')](_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x20')]);}_0x47a0f3[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x45')]);_0x47a0f3[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x155449[_0x6b1b('0x3c')],_0x1938bb[_0x6b1b('0x3d')]));_0x47a0f3[_0x6b1b('0x46')][_0x6b1b('0x66')]=_0x20096e['id'];if(_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x48')]){_0x47a0f3[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x47a0f3[_0x6b1b('0x46')],{'$or':_['map'](_0x47a0f3[_0x6b1b('0x3f')],function(_0x59282b){var _0x3f192b={};_0x3f192b[_0x59282b]={'$like':'%'+_0x155449[_0x6b1b('0x3c')]['filter']+'%'};return _0x3f192b;})});}_0x47a0f3=_[_0x6b1b('0x49')]({},_0x47a0f3,_0x155449[_0x6b1b('0x4f')]);return db[_0x6b1b('0x69')]['count']({'where':_0x47a0f3[_0x6b1b('0x46')]})['then'](function(_0x35028e){_0x2bc7c7['count']=_0x35028e;if(_0x155449[_0x6b1b('0x3c')][_0x6b1b('0x4b')]){_0x47a0f3[_0x6b1b('0x4e')]=[{'all':!![]}];}return db[_0x6b1b('0x69')][_0x6b1b('0x67')](_0x47a0f3);})[_0x6b1b('0x29')](function(_0x478ea8){_0x2bc7c7[_0x6b1b('0x4c')]=_0x478ea8;return _0x2bc7c7;});}})['then'](respondWithFilteredResult(_0x180108,_0x47a0f3))['catch'](handleError(_0x180108,null));};exports[_0x6b1b('0x6a')]=function(_0x471710,_0x173e9c,_0x1f6b93){var _0x125137={'raw':!![],'where':{}};var _0x23ff78={};var _0x33788d={'count':0x0,'rows':[]};return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x471710['params']['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x173e9c,null))['then'](function(_0x3f0cf2){if(_0x3f0cf2){_0x23ff78[_0x6b1b('0x3a')]=_['keys'](db[_0x6b1b('0x6b')][_0x6b1b('0x37')]);_0x23ff78['query']=_[_0x6b1b('0x3b')](_0x471710['query']);_0x23ff78['filters']=_[_0x6b1b('0x3e')](_0x23ff78[_0x6b1b('0x3a')],_0x23ff78[_0x6b1b('0x3c')]);_0x125137[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0x23ff78[_0x6b1b('0x3a')],qs['fields'](_0x471710[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x125137[_0x6b1b('0x3f')]=_0x125137[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x125137['attributes']:_0x23ff78[_0x6b1b('0x3a')];if(!_0x471710['query'][_0x6b1b('0x42')](_0x6b1b('0x43'))){_0x125137[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x471710[_0x6b1b('0x3c')]['limit']);_0x125137[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x471710['query'][_0x6b1b('0x20')]);}_0x125137[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x471710[_0x6b1b('0x3c')]['sort']);_0x125137[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x471710[_0x6b1b('0x3c')],_0x23ff78[_0x6b1b('0x3d')]));_0x125137[_0x6b1b('0x46')]['VoiceQueueId']=_0x3f0cf2['id'];if(_0x471710[_0x6b1b('0x3c')][_0x6b1b('0x48')]){_0x125137[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x125137[_0x6b1b('0x46')],{'$or':_[_0x6b1b('0x2d')](_0x125137[_0x6b1b('0x3f')],function(_0x39656d){var _0x24285c={};_0x24285c[_0x39656d]={'$like':'%'+_0x471710['query'][_0x6b1b('0x48')]+'%'};return _0x24285c;})});}_0x125137=_['merge']({},_0x125137,_0x471710[_0x6b1b('0x4f')]);return db['CmHopperFinal'][_0x6b1b('0x23')]({'where':_0x125137[_0x6b1b('0x46')]})[_0x6b1b('0x29')](function(_0xeabc20){_0x33788d[_0x6b1b('0x23')]=_0xeabc20;if(_0x471710[_0x6b1b('0x3c')][_0x6b1b('0x4b')]){_0x125137[_0x6b1b('0x4e')]=[{'all':!![]}];}return db[_0x6b1b('0x6b')][_0x6b1b('0x67')](_0x125137);})[_0x6b1b('0x29')](function(_0x26dbf0){_0x33788d[_0x6b1b('0x4c')]=_0x26dbf0;return _0x33788d;});}})[_0x6b1b('0x29')](respondWithFilteredResult(_0x173e9c,_0x125137))[_0x6b1b('0x4d')](handleError(_0x173e9c,null));};exports[_0x6b1b('0x6c')]=function(_0x14da56,_0xf3f152,_0x452f8a){var _0x5d4a64={'raw':!![],'where':{}};var _0xb0ee2={};var _0x471e60={'count':0x0,'rows':[]};return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x14da56[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0xf3f152,null))[_0x6b1b('0x29')](function(_0x2a2fbe){if(_0x2a2fbe){_0xb0ee2['model']=_[_0x6b1b('0x3b')](db[_0x6b1b('0x6d')]['rawAttributes']);_0xb0ee2[_0x6b1b('0x3c')]=_[_0x6b1b('0x3b')](_0x14da56[_0x6b1b('0x3c')]);_0xb0ee2[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0xb0ee2[_0x6b1b('0x3a')],_0xb0ee2[_0x6b1b('0x3c')]);_0x5d4a64[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0xb0ee2[_0x6b1b('0x3a')],qs['fields'](_0x14da56['query'][_0x6b1b('0x40')]));_0x5d4a64[_0x6b1b('0x3f')]=_0x5d4a64['attributes'][_0x6b1b('0x41')]?_0x5d4a64[_0x6b1b('0x3f')]:_0xb0ee2[_0x6b1b('0x3a')];if(!_0x14da56['query'][_0x6b1b('0x42')](_0x6b1b('0x43'))){_0x5d4a64[_0x6b1b('0x22')]=qs['limit'](_0x14da56[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x5d4a64[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x14da56[_0x6b1b('0x3c')][_0x6b1b('0x20')]);}_0x5d4a64[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x14da56[_0x6b1b('0x3c')]['sort']);_0x5d4a64[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x14da56[_0x6b1b('0x3c')],_0xb0ee2['filters']));_0x5d4a64[_0x6b1b('0x46')]['VoiceQueueId']=_0x2a2fbe['id'];if(_0x14da56[_0x6b1b('0x3c')]['filter']){_0x5d4a64['where']=_[_0x6b1b('0x49')](_0x5d4a64[_0x6b1b('0x46')],{'$or':_[_0x6b1b('0x2d')](_0x5d4a64[_0x6b1b('0x3f')],function(_0xdd7863){var _0x34926b={};_0x34926b[_0xdd7863]={'$like':'%'+_0x14da56[_0x6b1b('0x3c')][_0x6b1b('0x48')]+'%'};return _0x34926b;})});}_0x5d4a64=_[_0x6b1b('0x49')]({},_0x5d4a64,_0x14da56[_0x6b1b('0x4f')]);return db[_0x6b1b('0x6d')][_0x6b1b('0x23')]({'where':_0x5d4a64[_0x6b1b('0x46')]})['then'](function(_0x959102){_0x471e60[_0x6b1b('0x23')]=_0x959102;if(_0x14da56[_0x6b1b('0x3c')][_0x6b1b('0x4b')]){_0x5d4a64['include']=[{'all':!![]}];}return db[_0x6b1b('0x6d')][_0x6b1b('0x67')](_0x5d4a64);})[_0x6b1b('0x29')](function(_0x20458d){_0x471e60['rows']=_0x20458d;return _0x471e60;});}})[_0x6b1b('0x29')](respondWithFilteredResult(_0xf3f152,_0x5d4a64))[_0x6b1b('0x4d')](handleError(_0xf3f152,null));};exports[_0x6b1b('0x6e')]=function(_0x5537c0,_0x4529a6,_0x59056a){var _0xa1b1ea={};var _0x456659={};var _0x5b1c5c;var _0x1cec55;return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x5537c0['params']['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x4529a6,null))[_0x6b1b('0x29')](function(_0x5229e8){if(_0x5229e8){_0x5b1c5c=_0x5229e8;_0x456659[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db[_0x6b1b('0x6f')][_0x6b1b('0x37')]);_0x456659['query']=_[_0x6b1b('0x3b')](_0x5537c0[_0x6b1b('0x3c')]);_0x456659['filters']=_[_0x6b1b('0x3e')](_0x456659[_0x6b1b('0x3a')],_0x456659[_0x6b1b('0x3c')]);_0xa1b1ea['attributes']=_[_0x6b1b('0x3e')](_0x456659['model'],qs[_0x6b1b('0x40')](_0x5537c0[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0xa1b1ea[_0x6b1b('0x3f')]=_0xa1b1ea[_0x6b1b('0x3f')]['length']?_0xa1b1ea[_0x6b1b('0x3f')]:_0x456659[_0x6b1b('0x3a')];_0xa1b1ea[_0x6b1b('0x44')]=qs['sort'](_0x5537c0[_0x6b1b('0x3c')][_0x6b1b('0x45')]);_0xa1b1ea[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x5537c0[_0x6b1b('0x3c')],_0x456659[_0x6b1b('0x3d')]));if(_0x5537c0[_0x6b1b('0x3c')][_0x6b1b('0x48')]){_0xa1b1ea['where']=_[_0x6b1b('0x49')](_0xa1b1ea[_0x6b1b('0x46')],{'$or':_['map'](_0xa1b1ea[_0x6b1b('0x3f')],function(_0x507022){var _0x175fb8={};_0x175fb8[_0x507022]={'$like':'%'+_0x5537c0[_0x6b1b('0x3c')]['filter']+'%'};return _0x175fb8;})});}_0xa1b1ea=_[_0x6b1b('0x49')]({},_0xa1b1ea,_0x5537c0[_0x6b1b('0x4f')]);return _0x5b1c5c[_0x6b1b('0x6e')](_0xa1b1ea);}})['then'](function(_0x2ee724){if(_0x2ee724){_0x1cec55=_0x2ee724['length'];if(!_0x5537c0[_0x6b1b('0x3c')][_0x6b1b('0x42')](_0x6b1b('0x43'))){_0xa1b1ea[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x5537c0[_0x6b1b('0x3c')]['limit']);_0xa1b1ea[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x5537c0['query']['offset']);}return _0x5b1c5c['getTeams'](_0xa1b1ea);}})['then'](function(_0x2a5626){if(_0x2a5626){return _0x2a5626?{'count':_0x1cec55,'rows':_0x2a5626}:null;}})['then'](respondWithResult(_0x4529a6,null))[_0x6b1b('0x4d')](handleError(_0x4529a6,null));};exports[_0x6b1b('0x70')]=function(_0x1e1cec,_0x4112fe,_0x5bcc41){var _0xdaa04c=_0x1e1cec[_0x6b1b('0x5e')][_0x6b1b('0x71')];var _0x485d49=_[_0x6b1b('0x2d')](_0xdaa04c,'id');return db[_0x6b1b('0x6f')][_0x6b1b('0x67')]({'where':{'id':_0x485d49},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6b1b('0x72'),'attributes':['id',_0x6b1b('0x31'),_0x6b1b('0x73'),_0x6b1b('0x74'),'interface'],'raw':!![]}]})[_0x6b1b('0x29')](function(_0x35d0e4){if(_0x35d0e4){var _0x1b203b=_[_0x6b1b('0x75')](_0x35d0e4,function(_0x18b319){var _0x490d52=_0x18b319[_0x6b1b('0x52')]({'plain':!![]});_0x490d52[_0x6b1b('0x72')][_0x6b1b('0x76')](function(_0x54a330){_0x54a330[_0x6b1b('0x77')]=_[_0x6b1b('0x30')](_0xdaa04c,{'id':_0x490d52['id']})['penalty'];});return _0x490d52[_0x6b1b('0x72')];});return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0x1e1cec['params']['id']}})['then'](function(_0x40dd28){return db['sequelize'][_0x6b1b('0x78')](function(_0x48e77b){return _0x40dd28[_0x6b1b('0x70')](_0x485d49,{'transaction':_0x48e77b})[_0x6b1b('0x29')](function(){return BPromise[_0x6b1b('0x79')](_0xdaa04c,function(_0x14f644){return db[_0x6b1b('0x7a')][_0x6b1b('0x7b')]({'TeamId':_0x14f644['id'],'VoiceQueueId':_0x1e1cec[_0x6b1b('0x62')]['id'],'penalty':_0x14f644[_0x6b1b('0x77')]},{'transaction':_0x48e77b});});})[_0x6b1b('0x29')](function(){return BPromise[_0x6b1b('0x79')](_0x1b203b,function(_0x35b382){return db[_0x6b1b('0x7c')]['findOrCreate']({'where':{'UserId':_0x35b382['id'],'VoiceQueueId':_0x1e1cec[_0x6b1b('0x62')]['id']},'defaults':{'penalty':_0x35b382[_0x6b1b('0x77')]},'transaction':_0x48e77b});});})[_0x6b1b('0x29')](function(){return BPromise[_0x6b1b('0x79')](_['filter'](_0x1b203b,{'online':!![]}),function(_0x3f7c63){return db[_0x6b1b('0x7d')][_0x6b1b('0x7b')]({'membername':_0x3f7c63[_0x6b1b('0x31')],'UserId':_0x3f7c63['id'],'queue_name':_0x40dd28['name'],'VoiceQueueId':_0x40dd28['id'],'interface':_['isNil'](_0x3f7c63[_0x6b1b('0x7e')])?util[_0x6b1b('0x7f')](_0x6b1b('0x80'),_0x3f7c63['name']):_0x3f7c63['interface'],'paused':_0x3f7c63['voicePause']||![],'penalty':_0x3f7c63['penalty']},{'transaction':_0x48e77b});});})[_0x6b1b('0x29')](function(){_0x1b203b[_0x6b1b('0x76')](function(_0x2bdd17){socket['emit'](_0x6b1b('0x81'),{'UserId':_0x2bdd17['id'],'VoiceQueueId':_0x40dd28['id']});});});});});}})['then'](respondWithStatusCode(_0x4112fe,null))[_0x6b1b('0x4d')](handleError(_0x4112fe,null));};exports[_0x6b1b('0x82')]=function(_0x17144d,_0x1042a4,_0x56bd93){return db[_0x6b1b('0x6f')]['findAll']({'where':{'id':_0x17144d[_0x6b1b('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6b1b('0x83')],'as':_0x6b1b('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1042a4,null))['then'](function(_0x1ea20b){var _0x6f30c=_[_0x6b1b('0x2d')](_0x1ea20b,'id');var _0x3a26d4=[];var _0x1a7804=[];var _0x16e98f=squel[_0x6b1b('0x84')]();_0x16e98f[_0x6b1b('0x85')](_0x6b1b('0x86'))[_0x6b1b('0x87')](_0x6b1b('0x88'),'tq')['join'](_0x6b1b('0x89'),'ut',_0x6b1b('0x8a'))[_0x6b1b('0x46')](_0x6b1b('0x8b'),_0x17144d[_0x6b1b('0x62')]['id']);for(var _0x3d8339=0x0;_0x3d8339<_0x1ea20b['length'];_0x3d8339+=0x1){let _0x531a7f=_0x1ea20b[_0x3d8339];for(var _0x22edfc=0x0;_0x22edfc<_0x531a7f[_0x6b1b('0x72')][_0x6b1b('0x41')];_0x22edfc+=0x1){let _0x20aa9a=_0x531a7f[_0x6b1b('0x72')][_0x22edfc];var _0x48e6d3=_0x16e98f[_0x6b1b('0x5b')]();_0x48e6d3['where'](_0x6b1b('0x8c'),_0x20aa9a['id']);_0x1a7804[_0x6b1b('0x8d')](db['sequelize']['query'](_0x48e6d3[_0x6b1b('0x8e')](),{'type':db[_0x6b1b('0x8f')][_0x6b1b('0x90')][_0x6b1b('0x91')]})[_0x6b1b('0x29')](function(_0x356ede){if(_0x356ede['length']===0x1){return _0x20aa9a['id'];}else{var _0xadf32e=_[_0x6b1b('0x92')](_[_0x6b1b('0x2d')](_0x356ede,_0x6b1b('0x93')),function(_0x32f26f){return _[_0x6b1b('0x94')](_0x6f30c,_0x32f26f);});if(_0xadf32e){return _0x20aa9a['id'];}}}));}}return BPromise[_0x6b1b('0x95')](_0x1a7804)['then'](function(_0x2a17fc){_0x3a26d4=_(_0x3a26d4)[_0x6b1b('0x96')](_0x2a17fc)[_0x6b1b('0x97')]()[_0x6b1b('0x2e')]();return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0x17144d[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](function(_0x2ed4f9){return db[_0x6b1b('0x8f')][_0x6b1b('0x78')](function(_0x5a57da){return _0x2ed4f9[_0x6b1b('0x82')](_0x17144d[_0x6b1b('0x3c')][_0x6b1b('0x98')],{'transaction':_0x5a57da})[_0x6b1b('0x29')](function(){if(!_[_0x6b1b('0x99')](_0x3a26d4)){return _0x2ed4f9[_0x6b1b('0x9a')](_0x3a26d4,{'transaction':_0x5a57da})[_0x6b1b('0x29')](function(){return db['UserVoiceQueueRt'][_0x6b1b('0x33')]({'where':{'VoiceQueueId':_0x17144d['params']['id'],'UserId':_0x3a26d4},'transaction':_0x5a57da});});}})[_0x6b1b('0x29')](function(){_0x3a26d4[_0x6b1b('0x76')](function(_0xb351e9){socket[_0x6b1b('0x9b')](_0x6b1b('0x9c'),{'UserId':_0xb351e9,'VoiceQueueId':_0x2ed4f9['id']});});});});});});})[_0x6b1b('0x29')](respondWithStatusCode(_0x1042a4,null))[_0x6b1b('0x4d')](handleError(_0x1042a4,null));};exports[_0x6b1b('0x9d')]=function(_0x2f9148,_0x3f9698,_0x2950f6){var _0x351b07,_0x59ef19;return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0x2f9148[_0x6b1b('0x62')]['id']}})['then'](handleEntityNotFound(_0x3f9698,null))[_0x6b1b('0x29')](function(_0x5978dc){if(_0x5978dc){_0x59ef19=_0x5978dc;return _0x5978dc[_0x6b1b('0x9d')](_0x2f9148[_0x6b1b('0x5e')][_0x6b1b('0x98')],_['omit'](_0x2f9148[_0x6b1b('0x5e')],[_0x6b1b('0x98'),'id'])||{})[_0x6b1b('0x9e')](function(_0x43aafc){for(var _0x581f06=0x0;_0x581f06<_0x2f9148['body']['ids']['length'];_0x581f06+=0x1){socket[_0x6b1b('0x9b')]('userVoiceQueue:save',{'UserId':Number(_0x2f9148['body']['ids'][_0x581f06]),'VoiceQueueId':Number(_0x2f9148[_0x6b1b('0x62')]['id'])});}return _0x43aafc;});}})[_0x6b1b('0x29')](function(_0x3cdacf){_0x351b07=_0x3cdacf||[];if(_0x59ef19){return db['User'][_0x6b1b('0x67')]({'where':{'id':_0x2f9148['body'][_0x6b1b('0x98')]},'attributes':['id',_0x6b1b('0x31'),'online',_0x6b1b('0x74'),'interface'],'raw':!![]});}})[_0x6b1b('0x29')](function(_0x44439b){if(!_[_0x6b1b('0x99')](_0x44439b)){var _0x462be6=[];for(var _0x1a0a0b=0x0;_0x1a0a0b<_0x44439b[_0x6b1b('0x41')];_0x1a0a0b++){if(_0x44439b[_0x1a0a0b][_0x6b1b('0x73')]){_0x462be6['push'](db['UserVoiceQueueRt'][_0x6b1b('0x7b')]({'membername':_0x44439b[_0x1a0a0b][_0x6b1b('0x31')],'UserId':_0x44439b[_0x1a0a0b]['id'],'queue_name':_0x59ef19[_0x6b1b('0x31')],'VoiceQueueId':_0x59ef19['id'],'interface':_['isNil'](_0x44439b[_0x1a0a0b][_0x6b1b('0x7e')])?util['format'](_0x6b1b('0x80'),_0x44439b[_0x1a0a0b][_0x6b1b('0x31')]):_0x44439b[_0x1a0a0b]['interface'],'paused':_0x44439b[_0x1a0a0b]['voicePause']||![],'penalty':_0x2f9148[_0x6b1b('0x5e')]['penalty']||0x0}));}}return BPromise[_0x6b1b('0x95')](_0x462be6);}})['then'](function(){return _0x351b07;})['then'](respondWithResult(_0x3f9698,null))[_0x6b1b('0x4d')](handleError(_0x3f9698,null));};exports['removeAgents']=function(_0x3bd3ca,_0x40b5b3,_0x10ddd1){return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0x3bd3ca[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x40b5b3,null))[_0x6b1b('0x29')](function(_0x494301){if(_0x494301){return _0x494301[_0x6b1b('0x9a')](_0x3bd3ca[_0x6b1b('0x3c')]['ids'])[_0x6b1b('0x29')](function(){if(_['isArray'](_0x3bd3ca['query'][_0x6b1b('0x98')])){for(var _0x59d4a9=0x0;_0x59d4a9<_0x3bd3ca[_0x6b1b('0x3c')][_0x6b1b('0x98')][_0x6b1b('0x41')];_0x59d4a9+=0x1){socket[_0x6b1b('0x9b')](_0x6b1b('0x9c'),{'UserId':Number(_0x3bd3ca['query'][_0x6b1b('0x98')][_0x59d4a9]),'VoiceQueueId':Number(_0x3bd3ca[_0x6b1b('0x62')]['id'])});}}else{socket['emit'](_0x6b1b('0x9c'),{'UserId':Number(_0x3bd3ca['query'][_0x6b1b('0x98')]),'VoiceQueueId':Number(_0x3bd3ca[_0x6b1b('0x62')]['id'])});}});}})[_0x6b1b('0x29')](function(_0x5dddd6){return db[_0x6b1b('0x7d')][_0x6b1b('0x33')]({'where':{'VoiceQueueId':_0x3bd3ca[_0x6b1b('0x62')]['id'],'UserId':_0x3bd3ca['query'][_0x6b1b('0x98')]}})['then'](function(){return _0x5dddd6;});})[_0x6b1b('0x29')](respondWithStatusCode(_0x40b5b3,null))[_0x6b1b('0x4d')](handleError(_0x40b5b3,null));};exports[_0x6b1b('0x9f')]=function(_0x4f966b,_0x413219,_0x220a99){var _0x474a19={};var _0x51a318={};var _0x47641a;var _0x278f6a;return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x4f966b[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x413219,null))[_0x6b1b('0x29')](function(_0x2f91e2){if(_0x2f91e2){_0x47641a=_0x2f91e2;_0x51a318['model']=_[_0x6b1b('0x3b')](db[_0x6b1b('0x83')][_0x6b1b('0x37')]);_0x51a318[_0x6b1b('0x3c')]=_[_0x6b1b('0x3b')](_0x4f966b['query']);_0x51a318[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x51a318[_0x6b1b('0x3a')],_0x51a318[_0x6b1b('0x3c')]);_0x474a19['attributes']=_['intersection'](_0x51a318[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x4f966b[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x474a19['attributes']=_0x474a19[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x474a19['attributes']:_0x51a318['model'];_0x474a19['order']=qs['sort'](_0x4f966b['query'][_0x6b1b('0x45')]);_0x474a19[_0x6b1b('0x46')]=qs['filters'](_[_0x6b1b('0x47')](_0x4f966b[_0x6b1b('0x3c')],_0x51a318[_0x6b1b('0x3d')]));if(_0x4f966b[_0x6b1b('0x3c')]['filter']){_0x474a19[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x474a19[_0x6b1b('0x46')],{'$or':_['map'](_0x474a19[_0x6b1b('0x3f')],function(_0x3b7d97){var _0x2fa882={};_0x2fa882[_0x3b7d97]={'$like':'%'+_0x4f966b[_0x6b1b('0x3c')][_0x6b1b('0x48')]+'%'};return _0x2fa882;})});}_0x474a19=_[_0x6b1b('0x49')]({},_0x474a19,_0x4f966b[_0x6b1b('0x4f')]);return _0x47641a[_0x6b1b('0x9f')](_0x474a19);}})['then'](function(_0x1be6df){if(_0x1be6df){_0x278f6a=_0x1be6df[_0x6b1b('0x41')];if(!_0x4f966b[_0x6b1b('0x3c')]['hasOwnProperty'](_0x6b1b('0x43'))){_0x474a19[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x4f966b[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x474a19[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x4f966b[_0x6b1b('0x3c')][_0x6b1b('0x20')]);}return _0x47641a[_0x6b1b('0x9f')](_0x474a19);}})[_0x6b1b('0x29')](function(_0xf2c1a1){if(_0xf2c1a1){return _0xf2c1a1?{'count':_0x278f6a,'rows':_0xf2c1a1}:null;}})[_0x6b1b('0x29')](respondWithResult(_0x413219,null))[_0x6b1b('0x4d')](handleError(_0x413219,null));};exports['getMembers']=function(_0x28937a,_0x17548c,_0x5922ab){var _0x3ecbe8={};var _0x254bb3={};var _0x23906;var _0x563d22;return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x28937a[_0x6b1b('0x62')]['id']}})['then'](handleEntityNotFound(_0x17548c,null))['then'](function(_0x18e866){if(_0x18e866){_0x23906=_0x18e866;_0x254bb3[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db['UserVoiceQueueRt'][_0x6b1b('0x37')]);_0x254bb3[_0x6b1b('0x3c')]=_[_0x6b1b('0x3b')](_0x28937a[_0x6b1b('0x3c')]);_0x254bb3[_0x6b1b('0x3d')]=_['intersection'](_0x254bb3[_0x6b1b('0x3a')],_0x254bb3['query']);_0x3ecbe8[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0x254bb3[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x28937a[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x3ecbe8[_0x6b1b('0x3f')]=_0x3ecbe8[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x3ecbe8[_0x6b1b('0x3f')]:_0x254bb3[_0x6b1b('0x3a')];_0x3ecbe8[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x28937a[_0x6b1b('0x3c')][_0x6b1b('0x45')]);_0x3ecbe8[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x28937a[_0x6b1b('0x3c')],_0x254bb3[_0x6b1b('0x3d')]));if(_0x28937a[_0x6b1b('0x3c')][_0x6b1b('0x48')]){_0x3ecbe8[_0x6b1b('0x46')]=_[_0x6b1b('0x49')](_0x3ecbe8['where'],{'$or':_[_0x6b1b('0x2d')](_0x3ecbe8['attributes'],function(_0x33065c){var _0x4b5c0d={};_0x4b5c0d[_0x33065c]={'$like':'%'+_0x28937a[_0x6b1b('0x3c')]['filter']+'%'};return _0x4b5c0d;})});}_0x3ecbe8=_[_0x6b1b('0x49')]({},_0x3ecbe8,_0x28937a['options']);return _0x23906[_0x6b1b('0xa0')](_0x3ecbe8);}})[_0x6b1b('0x29')](function(_0x36a154){if(_0x36a154){_0x563d22=_0x36a154[_0x6b1b('0x41')];if(!_0x28937a[_0x6b1b('0x3c')]['hasOwnProperty']('nolimit')){_0x3ecbe8[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x28937a['query'][_0x6b1b('0x22')]);_0x3ecbe8[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x28937a[_0x6b1b('0x3c')]['offset']);}return _0x23906['getMembers'](_0x3ecbe8);}})[_0x6b1b('0x29')](function(_0x15f33d){return _0x15f33d?{'count':_0x563d22,'rows':_0x15f33d}:null;})[_0x6b1b('0x29')](respondWithResult(_0x17548c,null))[_0x6b1b('0x4d')](handleError(_0x17548c,null));};exports['getLists']=function(_0x18a620,_0x545a0d,_0xbf1321){var _0x4a0708={};var _0x1a223c={};var _0x5d944d;var _0x35f61b;return db[_0x6b1b('0x36')]['findOne']({'where':{'id':_0x18a620[_0x6b1b('0x62')]['id']}})['then'](handleEntityNotFound(_0x545a0d,null))[_0x6b1b('0x29')](function(_0x378674){if(_0x378674){_0x5d944d=_0x378674;_0x1a223c[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db[_0x6b1b('0xa1')][_0x6b1b('0x37')]);_0x1a223c[_0x6b1b('0x3c')]=_[_0x6b1b('0x3b')](_0x18a620['query']);_0x1a223c[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x1a223c['model'],_0x1a223c[_0x6b1b('0x3c')]);_0x4a0708['attributes']=_['intersection'](_0x1a223c[_0x6b1b('0x3a')],qs['fields'](_0x18a620[_0x6b1b('0x3c')][_0x6b1b('0x40')]));_0x4a0708['attributes']=_0x4a0708[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x4a0708[_0x6b1b('0x3f')]:_0x1a223c['model'];_0x4a0708[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x18a620[_0x6b1b('0x3c')][_0x6b1b('0x45')]);_0x4a0708[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x18a620[_0x6b1b('0x3c')],_0x1a223c[_0x6b1b('0x3d')]));if(_0x18a620['query'][_0x6b1b('0x48')]){_0x4a0708[_0x6b1b('0x46')]=_['merge'](_0x4a0708[_0x6b1b('0x46')],{'$or':_[_0x6b1b('0x2d')](_0x4a0708[_0x6b1b('0x3f')],function(_0x5defc7){var _0x237655={};_0x237655[_0x5defc7]={'$like':'%'+_0x18a620[_0x6b1b('0x3c')][_0x6b1b('0x48')]+'%'};return _0x237655;})});}_0x4a0708=_[_0x6b1b('0x49')]({},_0x4a0708,_0x18a620['options']);return _0x5d944d['getLists'](_0x4a0708);}})[_0x6b1b('0x29')](function(_0xbda2a7){if(_0xbda2a7){_0x35f61b=_0xbda2a7[_0x6b1b('0x41')];if(!_0x18a620[_0x6b1b('0x3c')]['hasOwnProperty'](_0x6b1b('0x43'))){_0x4a0708[_0x6b1b('0x22')]=qs[_0x6b1b('0x22')](_0x18a620[_0x6b1b('0x3c')][_0x6b1b('0x22')]);_0x4a0708[_0x6b1b('0x20')]=qs['offset'](_0x18a620['query'][_0x6b1b('0x20')]);}return _0x5d944d[_0x6b1b('0xa2')](_0x4a0708);}})[_0x6b1b('0x29')](function(_0x50330d){if(_0x50330d){return _0x50330d?{'count':_0x35f61b,'rows':_0x50330d}:null;}})[_0x6b1b('0x29')](respondWithResult(_0x545a0d,null))[_0x6b1b('0x4d')](handleError(_0x545a0d,null));};exports['addLists']=function(_0xa39a9e,_0x1eb407,_0x10fd90){var _0x43037c,_0x4a5918;return db[_0x6b1b('0x36')]['find']({'where':{'id':_0xa39a9e[_0x6b1b('0x62')]['id']}})['then'](handleEntityNotFound(_0x1eb407,null))[_0x6b1b('0x29')](function(_0x2c631a){if(_0x2c631a){_0x4a5918=_0x2c631a;return _0x2c631a[_0x6b1b('0xa3')](_0xa39a9e[_0x6b1b('0x5e')][_0x6b1b('0x98')],_[_0x6b1b('0x5c')](_0xa39a9e[_0x6b1b('0x5e')],['ids','id'])||{});}return null;})['spread'](function(_0x4f6c08){var _0x4871ff;_0x43037c=_0x4f6c08||[];var _0x909306=[];if(_0x4f6c08){for(var _0x20375d=0x0;_0x20375d<_0x4f6c08[_0x6b1b('0x41')];_0x20375d+=0x1){var _0x58bb88=_0x4f6c08[_0x20375d][_0x6b1b('0x52')]({'plain':!![]});_0x4a5918['dialCheckDuplicateType']=_0xa39a9e[_0x6b1b('0x5e')][_0x6b1b('0xa4')]?_0xa39a9e[_0x6b1b('0x5e')]['dialCheckDuplicateType']:_0x4a5918[_0x6b1b('0xa4')];switch(_0x4a5918[_0x6b1b('0xa4')]){case'always':_0x4871ff=squel['insert']()['into'](_0x6b1b('0xa5'))[_0x6b1b('0xa6')]([_0x6b1b('0xa7'),_0x6b1b('0xa8'),'ContactId',_0x6b1b('0xa9'),_0x6b1b('0x66'),_0x6b1b('0x5f'),_0x6b1b('0x5d')],squel[_0x6b1b('0x84')]()['field'](_0x6b1b('0xa7'),'phone')[_0x6b1b('0x85')](_0x6b1b('0xaa'),_0x6b1b('0xa8'))[_0x6b1b('0x85')]('id',_0x6b1b('0xab'))['field'](_0x58bb88[_0x6b1b('0xac')][_0x6b1b('0x8e')](),'ListId')['field'](_0xa39a9e[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')](),_0x6b1b('0x66'))[_0x6b1b('0x85')]('NOW()',_0x6b1b('0x5f'))['field'](_0x6b1b('0xaa'),_0x6b1b('0x5d'))[_0x6b1b('0x87')]('cm_contacts')['where'](_0x6b1b('0xad'))['where'](_0x6b1b('0xae'),_0x58bb88['CmListId'][_0x6b1b('0x8e')]())[_0x6b1b('0x46')](_0x6b1b('0xaf'))[_0x6b1b('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6b1b('0x84')]()[_0x6b1b('0x85')](_0x6b1b('0xb0'))[_0x6b1b('0x87')]('cm_hopper_final')[_0x6b1b('0x46')](_0x6b1b('0x8b'),_0xa39a9e[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')]()))[_0x6b1b('0x46')](_0x6b1b('0xb1'),squel[_0x6b1b('0x84')]()[_0x6b1b('0x85')](_0x6b1b('0xb2'))[_0x6b1b('0x87')](_0x6b1b('0xa5'))[_0x6b1b('0x46')](_0x6b1b('0x8b'),_0xa39a9e[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')]())))['toString']();break;case _0x6b1b('0xb3'):_0x4871ff=squel[_0x6b1b('0xb4')]()[_0x6b1b('0xb5')](_0x6b1b('0xa5'))['fromQuery']([_0x6b1b('0xa7'),_0x6b1b('0xa8'),_0x6b1b('0xab'),'ListId',_0x6b1b('0x66'),'createdAt','updatedAt'],squel[_0x6b1b('0x84')]()[_0x6b1b('0x85')](_0x6b1b('0xa7'),_0x6b1b('0xa7'))[_0x6b1b('0x85')](_0x6b1b('0xaa'),_0x6b1b('0xa8'))[_0x6b1b('0x85')]('id',_0x6b1b('0xab'))[_0x6b1b('0x85')](_0x58bb88[_0x6b1b('0xac')][_0x6b1b('0x8e')](),_0x6b1b('0xa9'))['field'](_0xa39a9e[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')](),_0x6b1b('0x66'))[_0x6b1b('0x85')](_0x6b1b('0xaa'),_0x6b1b('0x5f'))['field'](_0x6b1b('0xaa'),_0x6b1b('0x5d'))[_0x6b1b('0x87')]('cm_contacts')[_0x6b1b('0x46')](_0x6b1b('0xad'))[_0x6b1b('0x46')](_0x6b1b('0xae'),_0x58bb88[_0x6b1b('0xac')][_0x6b1b('0x8e')]())['where'](_0x6b1b('0xaf'))[_0x6b1b('0x46')](_0x6b1b('0xb1'),squel[_0x6b1b('0x84')]()[_0x6b1b('0x85')](_0x6b1b('0xb2'))[_0x6b1b('0x87')]('cm_hopper')['where'](_0x6b1b('0x8b'),_0xa39a9e[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')]())))[_0x6b1b('0x8e')]();break;default:_0x4871ff=squel[_0x6b1b('0xb4')]()[_0x6b1b('0xb5')]('cm_hopper')[_0x6b1b('0xa6')](['phone',_0x6b1b('0xa8'),_0x6b1b('0xab'),'ListId',_0x6b1b('0x66'),_0x6b1b('0x5f'),'updatedAt'],squel['select']()[_0x6b1b('0x85')](_0x6b1b('0xa7'),'phone')['field'](_0x6b1b('0xaa'),_0x6b1b('0xa8'))[_0x6b1b('0x85')]('id',_0x6b1b('0xab'))[_0x6b1b('0x85')](_0x58bb88[_0x6b1b('0xac')][_0x6b1b('0x8e')](),_0x6b1b('0xa9'))[_0x6b1b('0x85')](_0xa39a9e[_0x6b1b('0x62')]['id']['toString'](),_0x6b1b('0x66'))[_0x6b1b('0x85')](_0x6b1b('0xaa'),_0x6b1b('0x5f'))['field'](_0x6b1b('0xaa'),'updatedAt')[_0x6b1b('0x87')](_0x6b1b('0xb6'))[_0x6b1b('0x46')](_0x6b1b('0xad'))[_0x6b1b('0x46')](_0x6b1b('0xae'),_0x58bb88[_0x6b1b('0xac')][_0x6b1b('0x8e')]())[_0x6b1b('0x46')](_0x6b1b('0xaf')))[_0x6b1b('0x8e')]();}_0x909306[_0x6b1b('0x8d')](db[_0x6b1b('0x8f')][_0x6b1b('0x3c')](_0x4871ff));}return BPromise[_0x6b1b('0x95')](_0x909306);}})[_0x6b1b('0x29')](function(){return _0x43037c;})[_0x6b1b('0x29')](respondWithResult(_0x1eb407,null))[_0x6b1b('0x4d')](handleError(_0x1eb407,null));};exports[_0x6b1b('0xb7')]=function(_0x420c80,_0x163920,_0x50eaf2){return db['VoiceQueue'][_0x6b1b('0x30')]({'where':{'id':_0x420c80['params']['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x163920,null))[_0x6b1b('0x29')](function(_0x5b8dc2){if(_0x5b8dc2){return _0x5b8dc2[_0x6b1b('0xb7')](_0x420c80[_0x6b1b('0x3c')][_0x6b1b('0x98')]);}})[_0x6b1b('0x29')](function(_0x432ccf){if(_0x432ccf){return db[_0x6b1b('0x65')][_0x6b1b('0x33')]({'where':{'ListId':_0x420c80[_0x6b1b('0x3c')][_0x6b1b('0x98')],'VoiceQueueId':_0x420c80['params']['id']}})[_0x6b1b('0x29')](function(){return _0x432ccf;});}})[_0x6b1b('0x29')](respondWithStatusCode(_0x163920,null))[_0x6b1b('0x4d')](handleError(_0x163920,null));};exports[_0x6b1b('0xb8')]=function(_0x3f6069,_0x97257f,_0xe92421){var _0x396f04={};var _0x5069a8={};var _0x47c09a;var _0x340de8;return db[_0x6b1b('0x36')][_0x6b1b('0x64')]({'where':{'id':_0x3f6069['params']['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x97257f,null))['then'](function(_0x3c62d8){if(_0x3c62d8){_0x47c09a=_0x3c62d8;_0x5069a8[_0x6b1b('0x3a')]=_[_0x6b1b('0x3b')](db[_0x6b1b('0xa1')][_0x6b1b('0x37')]);_0x5069a8[_0x6b1b('0x3c')]=_[_0x6b1b('0x3b')](_0x3f6069[_0x6b1b('0x3c')]);_0x5069a8[_0x6b1b('0x3d')]=_[_0x6b1b('0x3e')](_0x5069a8[_0x6b1b('0x3a')],_0x5069a8[_0x6b1b('0x3c')]);_0x396f04[_0x6b1b('0x3f')]=_[_0x6b1b('0x3e')](_0x5069a8[_0x6b1b('0x3a')],qs[_0x6b1b('0x40')](_0x3f6069[_0x6b1b('0x3c')]['fields']));_0x396f04[_0x6b1b('0x3f')]=_0x396f04[_0x6b1b('0x3f')][_0x6b1b('0x41')]?_0x396f04[_0x6b1b('0x3f')]:_0x5069a8[_0x6b1b('0x3a')];_0x396f04[_0x6b1b('0x44')]=qs[_0x6b1b('0x45')](_0x3f6069['query'][_0x6b1b('0x45')]);_0x396f04[_0x6b1b('0x46')]=qs[_0x6b1b('0x3d')](_[_0x6b1b('0x47')](_0x3f6069['query'],_0x5069a8[_0x6b1b('0x3d')]));if(_0x3f6069['query']['filter']){_0x396f04['where']=_[_0x6b1b('0x49')](_0x396f04[_0x6b1b('0x46')],{'$or':_[_0x6b1b('0x2d')](_0x396f04[_0x6b1b('0x3f')],function(_0x344822){var _0x4a95bb={};_0x4a95bb[_0x344822]={'$like':'%'+_0x3f6069[_0x6b1b('0x3c')][_0x6b1b('0x48')]+'%'};return _0x4a95bb;})});}_0x396f04=_[_0x6b1b('0x49')]({},_0x396f04,_0x3f6069[_0x6b1b('0x4f')]);return _0x47c09a['getBlackLists'](_0x396f04);}})[_0x6b1b('0x29')](function(_0x8e9317){if(_0x8e9317){_0x340de8=_0x8e9317[_0x6b1b('0x41')];if(!_0x3f6069['query'][_0x6b1b('0x42')]('nolimit')){_0x396f04['limit']=qs[_0x6b1b('0x22')](_0x3f6069[_0x6b1b('0x3c')]['limit']);_0x396f04[_0x6b1b('0x20')]=qs[_0x6b1b('0x20')](_0x3f6069['query'][_0x6b1b('0x20')]);}return _0x47c09a['getBlackLists'](_0x396f04);}})[_0x6b1b('0x29')](function(_0x4c307c){if(_0x4c307c){return _0x4c307c?{'count':_0x340de8,'rows':_0x4c307c}:null;}})[_0x6b1b('0x29')](respondWithResult(_0x97257f,null))[_0x6b1b('0x4d')](handleError(_0x97257f,null));};exports[_0x6b1b('0xb9')]=function(_0x33bcba,_0x36bc21,_0x495c5d){var _0x4df2f2,_0x8aaf74;return db[_0x6b1b('0x36')]['find']({'where':{'id':_0x33bcba[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x36bc21,null))[_0x6b1b('0x29')](function(_0x1a07b5){if(_0x1a07b5){_0x8aaf74=_0x1a07b5;return _0x1a07b5['addBlackLists'](_0x33bcba['body'][_0x6b1b('0x98')],_[_0x6b1b('0x5c')](_0x33bcba[_0x6b1b('0x5e')],[_0x6b1b('0x98'),'id'])||{});}return null;})[_0x6b1b('0x9e')](function(_0x39d593){var _0x193e88;_0x4df2f2=_0x39d593||[];var _0x1b6822=[];if(_0x39d593){for(var _0x42a40c=0x0;_0x42a40c<_0x39d593['length'];_0x42a40c+=0x1){var _0x4611ee=_0x39d593[_0x42a40c][_0x6b1b('0x52')]({'plain':!![]});_0x193e88=squel[_0x6b1b('0xb4')]()[_0x6b1b('0xb5')]('cm_hopper_black')[_0x6b1b('0xa6')]([_0x6b1b('0xa7'),'ContactId','ListId',_0x6b1b('0x66'),_0x6b1b('0x5f'),_0x6b1b('0x5d')],squel[_0x6b1b('0x84')]()[_0x6b1b('0x85')](_0x6b1b('0xa7'),_0x6b1b('0xa7'))['field']('id',_0x6b1b('0xab'))['field'](_0x4611ee['CmListId']['toString'](),_0x6b1b('0xa9'))[_0x6b1b('0x85')](_0x33bcba[_0x6b1b('0x62')]['id'][_0x6b1b('0x8e')](),'VoiceQueueId')[_0x6b1b('0x85')](_0x6b1b('0xaa'),_0x6b1b('0x5f'))[_0x6b1b('0x85')]('NOW()',_0x6b1b('0x5d'))['from'](_0x6b1b('0xb6'))[_0x6b1b('0x46')](_0x6b1b('0xad'))['where'](_0x6b1b('0xae'),_0x4611ee[_0x6b1b('0xac')][_0x6b1b('0x8e')]())[_0x6b1b('0x46')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b1b('0x8e')]();_0x1b6822[_0x6b1b('0x8d')](db[_0x6b1b('0x8f')][_0x6b1b('0x3c')](_0x193e88));}return BPromise[_0x6b1b('0x95')](_0x1b6822);}})[_0x6b1b('0x29')](function(){return _0x4df2f2;})[_0x6b1b('0x29')](respondWithResult(_0x36bc21,null))[_0x6b1b('0x4d')](handleError(_0x36bc21,null));};exports[_0x6b1b('0xba')]=function(_0xbe2e5d,_0x346103,_0x5d7700){return db[_0x6b1b('0x36')][_0x6b1b('0x30')]({'where':{'id':_0xbe2e5d[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](handleEntityNotFound(_0x346103,null))[_0x6b1b('0x29')](function(_0x2faf7b){if(_0x2faf7b){return _0x2faf7b[_0x6b1b('0xba')](_0xbe2e5d[_0x6b1b('0x3c')]['ids']);}})[_0x6b1b('0x29')](function(_0x168e9b){if(_0x168e9b){return db[_0x6b1b('0x6d')]['destroy']({'where':{'ListId':_0xbe2e5d[_0x6b1b('0x3c')][_0x6b1b('0x98')],'VoiceQueueId':_0xbe2e5d[_0x6b1b('0x62')]['id']}})[_0x6b1b('0x29')](function(){return _0x168e9b;});}})[_0x6b1b('0x29')](respondWithStatusCode(_0x346103,null))[_0x6b1b('0x4d')](handleError(_0x346103,null));}; \ No newline at end of file +var _0xcf10=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','QueueCampaigns','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','getHoppers','CmHopper','hasOwnProperty','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','interface','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','ids','spread','isEmpty','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ListId','select','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','outbound','filter','map','value','type','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x3f2329,_0x55490c){var _0x294dd3=function(_0x4eda0d){while(--_0x4eda0d){_0x3f2329['push'](_0x3f2329['shift']());}};_0x294dd3(++_0x55490c);}(_0xcf10,0x1dd));var _0x0cf1=function(_0x9c607a,_0x1cb2c6){_0x9c607a=_0x9c607a-0x0;var _0x3b1311=_0xcf10[_0x9c607a];return _0x3b1311;};'use strict';var emlformat=require(_0x0cf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0cf1('0x2'));var moment=require('moment');var BPromise=require(_0x0cf1('0x3'));var Mustache=require('mustache');var util=require(_0x0cf1('0x4'));var path=require(_0x0cf1('0x5'));var sox=require(_0x0cf1('0x6'));var csv=require(_0x0cf1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cf1('0x8'));var _=require(_0x0cf1('0x9'));var squel=require(_0x0cf1('0xa'));var crypto=require(_0x0cf1('0xb'));var jsforce=require(_0x0cf1('0xc'));var deskjs=require(_0x0cf1('0xd'));var toCsv=require(_0x0cf1('0x7'));var querystring=require(_0x0cf1('0xe'));var Papa=require(_0x0cf1('0xf'));var Redis=require(_0x0cf1('0x10'));var authService=require(_0x0cf1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0cf1('0x12'));var hardwareService=require(_0x0cf1('0x13'));var logger=require(_0x0cf1('0x14'))(_0x0cf1('0x15'));var utils=require(_0x0cf1('0x16'));var config=require(_0x0cf1('0x17'));var licenseUtil=require(_0x0cf1('0x18'));var db=require(_0x0cf1('0x19'))['db'];config[_0x0cf1('0x1a')]=_[_0x0cf1('0x1b')](config[_0x0cf1('0x1a')],{'host':_0x0cf1('0x1c'),'port':0x18eb});var socket=require(_0x0cf1('0x1d'))(new Redis(config[_0x0cf1('0x1a')]));require(_0x0cf1('0x1e'))[_0x0cf1('0x1f')](socket);function respondWithStatusCode(_0x47b619,_0x1cdc15){_0x1cdc15=_0x1cdc15||0xcc;return function(_0x55a068){if(_0x55a068){return _0x47b619[_0x0cf1('0x20')](_0x1cdc15);}return _0x47b619[_0x0cf1('0x21')](_0x1cdc15)[_0x0cf1('0x22')]();};}function respondWithResult(_0x126b0a,_0x21dcd4){_0x21dcd4=_0x21dcd4||0xc8;return function(_0xf578be){if(_0xf578be){return _0x126b0a[_0x0cf1('0x21')](_0x21dcd4)[_0x0cf1('0x23')](_0xf578be);}};}function respondWithFilteredResult(_0x551a37,_0x1de596){return function(_0x1d0452){if(_0x1d0452){var _0x24d57b=typeof _0x1de596[_0x0cf1('0x24')]==='undefined'&&typeof _0x1de596['limit']===_0x0cf1('0x25');var _0xb6b14b=_0x1d0452[_0x0cf1('0x26')];var _0x327dac=_0x24d57b?0x0:_0x1de596[_0x0cf1('0x24')];var _0xa01c20=_0x24d57b?_0x1d0452[_0x0cf1('0x26')]:_0x1de596[_0x0cf1('0x24')]+_0x1de596[_0x0cf1('0x27')];var _0x46a1db;if(_0xa01c20>=_0xb6b14b){_0xa01c20=_0xb6b14b;_0x46a1db=0xc8;}else{_0x46a1db=0xce;}_0x551a37[_0x0cf1('0x21')](_0x46a1db);return _0x551a37[_0x0cf1('0x28')](_0x0cf1('0x29'),_0x327dac+'-'+_0xa01c20+'/'+_0xb6b14b)[_0x0cf1('0x23')](_0x1d0452);}return null;};}function patchUpdates(_0x1a7d82){return function(_0x598970){try{jsonpatch[_0x0cf1('0x2a')](_0x598970,_0x1a7d82,!![]);}catch(_0xe457e0){return BPromise[_0x0cf1('0x2b')](_0xe457e0);}return _0x598970[_0x0cf1('0x2c')]();};}function saveUpdates(_0x3e2e8d,_0x37ed5c){return function(_0x803662){if(_0x803662){return _0x803662[_0x0cf1('0x2d')](_0x3e2e8d)[_0x0cf1('0x2e')](function(_0x21a5d4){return _0x21a5d4;});}return null;};}function removeEntity(_0x23a430,_0x4e76a6){return function(_0x428704){if(_0x428704){return _0x428704[_0x0cf1('0x2f')]()[_0x0cf1('0x2e')](function(){var _0x1ba78d=_0x428704['get']({'plain':!![]});var _0x4ed237=[{'name':_0x0cf1('0x30'),'value':_0x0cf1('0x31'),'ignore':![]},{'name':'QueueCampaigns','value':_0x0cf1('0x32'),'ignore':![]}];var _0x46bf11=_(_0x4ed237)[_0x0cf1('0x33')]('ignore')[_0x0cf1('0x34')](_0x0cf1('0x35'))[_0x0cf1('0x35')]();if(_['includes'](_0x46bf11,_0x1ba78d[_0x0cf1('0x36')])){return;}var _0x50ae4d=_[_0x0cf1('0x37')](_0x4ed237,[_0x0cf1('0x35'),_0x1ba78d[_0x0cf1('0x36')]])[_0x0cf1('0x38')];return db['UserProfileResource']['destroy']({'where':{'type':_0x50ae4d,'resourceId':_0x1ba78d['id']}})[_0x0cf1('0x2e')](function(){return _0x428704;});})[_0x0cf1('0x2e')](function(){_0x23a430['status'](0xcc)[_0x0cf1('0x22')]();});}};}function handleEntityNotFound(_0x5802da,_0x48f4e4){return function(_0x408e24){if(!_0x408e24){_0x5802da['sendStatus'](0x194);}return _0x408e24;};}function handleError(_0x3d5b60,_0x41eb39){_0x41eb39=_0x41eb39||0x1f4;return function(_0x5ed52f){logger[_0x0cf1('0x39')](_0x5ed52f[_0x0cf1('0x3a')]);if(_0x5ed52f[_0x0cf1('0x38')]){delete _0x5ed52f[_0x0cf1('0x38')];}_0x3d5b60[_0x0cf1('0x21')](_0x41eb39)[_0x0cf1('0x3b')](_0x5ed52f);};}exports[_0x0cf1('0x3c')]=function(_0xaa251f,_0x1442b5){var _0x20957e={},_0x4d52e9={},_0x17db63={'count':0x0,'rows':[]};var _0x44964f=_[_0x0cf1('0x34')](db[_0x0cf1('0x3d')][_0x0cf1('0x3e')],function(_0xb5f426){return{'name':_0xb5f426[_0x0cf1('0x3f')],'type':_0xb5f426['type'][_0x0cf1('0x40')]};});_0x4d52e9[_0x0cf1('0x41')]=_['map'](_0x44964f,_0x0cf1('0x38'));_0x4d52e9[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0xaa251f['query']);_0x4d52e9[_0x0cf1('0x44')]=_['intersection'](_0x4d52e9['model'],_0x4d52e9[_0x0cf1('0x42')]);_0x20957e['attributes']=_[_0x0cf1('0x45')](_0x4d52e9[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x20957e[_0x0cf1('0x47')]=_0x20957e['attributes'][_0x0cf1('0x48')]?_0x20957e[_0x0cf1('0x47')]:_0x4d52e9[_0x0cf1('0x41')];if(!_0xaa251f[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x20957e[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x20957e['offset']=qs[_0x0cf1('0x24')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x24')]);}_0x20957e[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0xaa251f['query']['sort']);_0x20957e['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0xaa251f[_0x0cf1('0x42')],_0x4d52e9['filters']),_0x44964f);if(_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x20957e[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x20957e[_0x0cf1('0x4d')],{'$or':_['map'](_0x44964f,function(_0x405f18){if(_0x405f18['type']!==_0x0cf1('0x4f')){var _0x28c0e3={};_0x28c0e3[_0x405f18['name']]={'$like':'%'+_0xaa251f['query'][_0x0cf1('0x33')]+'%'};return _0x28c0e3;}})});}_0x20957e=_[_0x0cf1('0x4e')]({},_0x20957e,_0xaa251f[_0x0cf1('0x50')]);var _0x47e698={'where':_0x20957e[_0x0cf1('0x4d')]};return db[_0x0cf1('0x3d')][_0x0cf1('0x26')](_0x47e698)['then'](function(_0x2ca364){_0x17db63['count']=_0x2ca364;if(_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x20957e[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x3d')][_0x0cf1('0x53')](_0x20957e);})[_0x0cf1('0x2e')](function(_0x3b22d2){_0x17db63[_0x0cf1('0x54')]=_0x3b22d2;return _0x17db63;})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x1442b5,_0x20957e))[_0x0cf1('0x55')](handleError(_0x1442b5,null));};exports[_0x0cf1('0x56')]=function(_0x1be249,_0x2f22f8){var _0x2808b0={'raw':![],'where':{'id':_0x1be249[_0x0cf1('0x57')]['id']}},_0x2063ce={};_0x2063ce[_0x0cf1('0x41')]=_['keys'](db['VoiceQueue'][_0x0cf1('0x3e')]);_0x2063ce['query']=_[_0x0cf1('0x43')](_0x1be249[_0x0cf1('0x42')]);_0x2063ce[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x2063ce['model'],_0x2063ce[_0x0cf1('0x42')]);_0x2808b0[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x2063ce[_0x0cf1('0x41')],qs['fields'](_0x1be249[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x2808b0[_0x0cf1('0x47')]=_0x2808b0['attributes'][_0x0cf1('0x48')]?_0x2808b0[_0x0cf1('0x47')]:_0x2063ce['model'];if(_0x1be249[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x2808b0[_0x0cf1('0x52')]=[{'all':!![]}];}_0x2808b0=_[_0x0cf1('0x4e')]({},_0x2808b0,_0x1be249[_0x0cf1('0x50')]);return db[_0x0cf1('0x3d')][_0x0cf1('0x37')](_0x2808b0)[_0x0cf1('0x2e')](handleEntityNotFound(_0x2f22f8,null))[_0x0cf1('0x2e')](respondWithResult(_0x2f22f8,null))[_0x0cf1('0x55')](handleError(_0x2f22f8,null));};exports[_0x0cf1('0x58')]=function(_0x1ecc79,_0x7b4e3a){return db['VoiceQueue']['create'](_0x1ecc79[_0x0cf1('0x59')],{})[_0x0cf1('0x2e')](function(_0x2b156a){var _0x1ad6f6=_0x1ecc79[_0x0cf1('0x5a')]['get']({'plain':!![]});if(!_0x1ad6f6)throw new Error(_0x0cf1('0x5b'));if(_0x1ad6f6['role']==='user'){var _0x1364b3=_0x2b156a[_0x0cf1('0x5c')]({'plain':!![]});var _0x54c0e1=[{'name':'VoiceQueues','value':_0x0cf1('0x31')},{'name':_0x0cf1('0x5d'),'value':_0x0cf1('0x32')}];var _0x422493=_[_0x0cf1('0x37')](_0x54c0e1,['value',_0x1364b3['type']])[_0x0cf1('0x38')];return db[_0x0cf1('0x5e')]['find']({'where':{'name':_0x422493,'userProfileId':_0x1ad6f6['userProfileId']},'raw':!![]})[_0x0cf1('0x2e')](function(_0x13d126){if(_0x13d126&&_0x13d126[_0x0cf1('0x5f')]===0x0){return db[_0x0cf1('0x60')][_0x0cf1('0x58')]({'name':_0x1364b3[_0x0cf1('0x38')],'resourceId':_0x1364b3['id'],'type':_0x13d126[_0x0cf1('0x38')],'sectionId':_0x13d126['id']},{})[_0x0cf1('0x2e')](function(){return _0x2b156a;});}else{return _0x2b156a;}})['catch'](function(_0x5a44d9){logger['error'](_0x0cf1('0x61'),_0x5a44d9);throw _0x5a44d9;});}return _0x2b156a;})['then'](respondWithResult(_0x7b4e3a,0xc9))[_0x0cf1('0x55')](handleError(_0x7b4e3a,null));};exports['clone']=function(_0x4a89c8,_0x37a207){var _0x456a2a={'where':{'id':_0x4a89c8[_0x0cf1('0x57')]['id']}},_0x2d971b={};_0x2d971b['model']=_['keys'](db[_0x0cf1('0x3d')][_0x0cf1('0x3e')]);_0x456a2a[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x2d971b[_0x0cf1('0x41')],qs['fields'](_0x4a89c8[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x456a2a[_0x0cf1('0x47')]=_0x456a2a[_0x0cf1('0x47')]['length']?_0x456a2a[_0x0cf1('0x47')]:_0x2d971b['model'];if(_0x4a89c8[_0x0cf1('0x42')]['includeAll']){_0x456a2a[_0x0cf1('0x52')]=[{'all':!![]}];}_0x456a2a=_[_0x0cf1('0x4e')]({},_0x456a2a,_0x4a89c8[_0x0cf1('0x50')]);return db[_0x0cf1('0x3d')]['find'](_0x456a2a)[_0x0cf1('0x2e')](handleEntityNotFound(_0x37a207,null))[_0x0cf1('0x2e')](function(_0x3ac72c){if(_0x3ac72c){var _0x577f84=_0x3ac72c[_0x0cf1('0x5c')]({'plain':!![]});_0x577f84=qs['omit'](_0x577f84,['id',_0x0cf1('0x62'),_0x0cf1('0x63')]);_0x4a89c8[_0x0cf1('0x59')]=_[_0x0cf1('0x64')](_0x4a89c8[_0x0cf1('0x59')],['id',_0x0cf1('0x62'),'updatedAt']);return db[_0x0cf1('0x3d')][_0x0cf1('0x58')](_[_0x0cf1('0x4e')](_0x577f84,_0x4a89c8[_0x0cf1('0x59')]),{'include':_0x4a89c8[_0x0cf1('0x42')][_0x0cf1('0x51')]?[{'all':!![]}]:undefined})[_0x0cf1('0x2e')](function(_0x54e47b){var _0x55f88e=_0x4a89c8['user'][_0x0cf1('0x5c')]({'plain':!![]});if(!_0x55f88e)throw new Error(_0x0cf1('0x5b'));if(_0x55f88e[_0x0cf1('0x65')]===_0x0cf1('0x5a')){var _0x5beca9=_0x54e47b['get']({'plain':!![]});var _0x3b657e=[{'name':_0x0cf1('0x30'),'value':_0x0cf1('0x31')},{'name':'QueueCampaigns','value':_0x0cf1('0x32')}];var _0x6a82d4=_[_0x0cf1('0x37')](_0x3b657e,['value',_0x5beca9[_0x0cf1('0x36')]])['name'];return db[_0x0cf1('0x5e')]['find']({'where':{'name':_0x6a82d4,'userProfileId':_0x55f88e['userProfileId']},'raw':!![]})[_0x0cf1('0x2e')](function(_0x1ab17b){if(_0x1ab17b&&_0x1ab17b[_0x0cf1('0x5f')]===0x0){return db[_0x0cf1('0x60')][_0x0cf1('0x58')]({'name':_0x5beca9[_0x0cf1('0x38')],'resourceId':_0x5beca9['id'],'type':_0x1ab17b[_0x0cf1('0x38')],'sectionId':_0x1ab17b['id']},{})[_0x0cf1('0x2e')](function(){return _0x54e47b;});}else{return _0x54e47b;}})[_0x0cf1('0x55')](function(_0x12f479){logger['error'](_0x0cf1('0x61'),_0x12f479);throw _0x12f479;});}return _0x54e47b;});}})[_0x0cf1('0x2e')](respondWithResult(_0x37a207,0xc9))[_0x0cf1('0x55')](handleError(_0x37a207,null));};exports[_0x0cf1('0x2d')]=function(_0x134ba0,_0x3d2c78){if(_0x134ba0[_0x0cf1('0x59')]['id']){delete _0x134ba0[_0x0cf1('0x59')]['id'];}return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x134ba0[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x3d2c78,null))[_0x0cf1('0x2e')](saveUpdates(_0x134ba0[_0x0cf1('0x59')],null))['then'](respondWithResult(_0x3d2c78,null))['catch'](handleError(_0x3d2c78,null));};exports[_0x0cf1('0x2f')]=function(_0x473fce,_0x86d118){return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x473fce['params']['id']}})['then'](handleEntityNotFound(_0x86d118,null))[_0x0cf1('0x2e')](removeEntity(_0x86d118,null))[_0x0cf1('0x55')](handleError(_0x86d118,null));};exports[_0x0cf1('0x66')]=function(_0x2dd964,_0x4b3a26,_0x3f0543){var _0x5e7678={'raw':![],'where':{}};var _0x3bb2df={};var _0x5c2f7f={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2dd964[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x4b3a26,null))[_0x0cf1('0x2e')](function(_0x4b84eb){if(_0x4b84eb){_0x3bb2df[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0x67')][_0x0cf1('0x3e')]);_0x3bb2df[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x2dd964[_0x0cf1('0x42')]);_0x3bb2df['filters']=_[_0x0cf1('0x45')](_0x3bb2df['model'],_0x3bb2df[_0x0cf1('0x42')]);_0x5e7678[_0x0cf1('0x47')]=_['intersection'](_0x3bb2df['model'],qs[_0x0cf1('0x46')](_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x5e7678[_0x0cf1('0x47')]=_0x5e7678[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x5e7678['attributes']:_0x3bb2df['model'];if(!_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x5e7678['limit']=qs[_0x0cf1('0x27')](_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x5e7678[_0x0cf1('0x24')]=qs['offset'](_0x2dd964['query'][_0x0cf1('0x24')]);}_0x5e7678[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0x2dd964['query'][_0x0cf1('0x4b')]);_0x5e7678['where']=qs['filters'](_[_0x0cf1('0x4c')](_0x2dd964[_0x0cf1('0x42')],_0x3bb2df[_0x0cf1('0x44')]));_0x5e7678[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x4b84eb['id'];if(_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x5e7678[_0x0cf1('0x4d')]=_['merge'](_0x5e7678[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x5e7678[_0x0cf1('0x47')],function(_0xae387a){var _0x184283={};_0x184283[_0xae387a]={'$like':'%'+_0x2dd964['query'][_0x0cf1('0x33')]+'%'};return _0x184283;})});}_0x5e7678=_[_0x0cf1('0x4e')]({},_0x5e7678,_0x2dd964[_0x0cf1('0x50')]);return db[_0x0cf1('0x67')]['count']({'where':_0x5e7678[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x3eb557){_0x5c2f7f[_0x0cf1('0x26')]=_0x3eb557;if(_0x2dd964[_0x0cf1('0x42')]['includeAll']){_0x5e7678[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x67')]['findAll'](_0x5e7678);})['then'](function(_0x23d1bc){_0x5c2f7f[_0x0cf1('0x54')]=_0x23d1bc;return _0x5c2f7f;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x4b3a26,_0x5e7678))[_0x0cf1('0x55')](handleError(_0x4b3a26,null));};exports[_0x0cf1('0x6a')]=function(_0x33b3db,_0x5ef347,_0x3d4af6){var _0xc7872d={'raw':!![],'where':{}};var _0x337a16={};var _0x53b152={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x33b3db[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ef347,null))['then'](function(_0x421ab7){if(_0x421ab7){_0x337a16['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x6c')][_0x0cf1('0x3e')]);_0x337a16[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x33b3db['query']);_0x337a16[_0x0cf1('0x44')]=_['intersection'](_0x337a16[_0x0cf1('0x41')],_0x337a16[_0x0cf1('0x42')]);_0xc7872d[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x337a16[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0xc7872d[_0x0cf1('0x47')]=_0xc7872d[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0xc7872d[_0x0cf1('0x47')]:_0x337a16[_0x0cf1('0x41')];if(!_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0xc7872d[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x33b3db[_0x0cf1('0x42')]['limit']);_0xc7872d[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x24')]);}_0xc7872d[_0x0cf1('0x4a')]=qs['sort'](_0x33b3db[_0x0cf1('0x42')]['sort']);_0xc7872d[_0x0cf1('0x4d')]=qs['filters'](_[_0x0cf1('0x4c')](_0x33b3db['query'],_0x337a16[_0x0cf1('0x44')]));_0xc7872d[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x421ab7['id'];if(_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0xc7872d['where']=_[_0x0cf1('0x4e')](_0xc7872d[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0xc7872d[_0x0cf1('0x47')],function(_0x431a07){var _0x44af67={};_0x44af67[_0x431a07]={'$like':'%'+_0x33b3db['query'][_0x0cf1('0x33')]+'%'};return _0x44af67;})});}_0xc7872d=_[_0x0cf1('0x4e')]({},_0xc7872d,_0x33b3db[_0x0cf1('0x50')]);return db['CmHopperHistory']['count']({'where':_0xc7872d[_0x0cf1('0x4d')]})['then'](function(_0x1c02b0){_0x53b152[_0x0cf1('0x26')]=_0x1c02b0;if(_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0xc7872d[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6c')][_0x0cf1('0x53')](_0xc7872d);})[_0x0cf1('0x2e')](function(_0x2ccb58){_0x53b152[_0x0cf1('0x54')]=_0x2ccb58;return _0x53b152;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x5ef347,_0xc7872d))[_0x0cf1('0x55')](handleError(_0x5ef347,null));};exports['getHopperFinals']=function(_0x641bd0,_0x5a363c,_0x4d2546){var _0x1ef54d={'raw':!![],'where':{}};var _0x1cb311={};var _0x4dae21={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x641bd0['params']['id']}})['then'](handleEntityNotFound(_0x5a363c,null))[_0x0cf1('0x2e')](function(_0x26cc9a){if(_0x26cc9a){_0x1cb311['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x6d')][_0x0cf1('0x3e')]);_0x1cb311[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x641bd0[_0x0cf1('0x42')]);_0x1cb311['filters']=_[_0x0cf1('0x45')](_0x1cb311[_0x0cf1('0x41')],_0x1cb311['query']);_0x1ef54d['attributes']=_[_0x0cf1('0x45')](_0x1cb311['model'],qs[_0x0cf1('0x46')](_0x641bd0[_0x0cf1('0x42')]['fields']));_0x1ef54d[_0x0cf1('0x47')]=_0x1ef54d[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x1ef54d[_0x0cf1('0x47')]:_0x1cb311[_0x0cf1('0x41')];if(!_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0x1ef54d[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x1ef54d[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x641bd0['query'][_0x0cf1('0x24')]);}_0x1ef54d['order']=qs[_0x0cf1('0x4b')](_0x641bd0['query']['sort']);_0x1ef54d[_0x0cf1('0x4d')]=qs['filters'](_[_0x0cf1('0x4c')](_0x641bd0[_0x0cf1('0x42')],_0x1cb311[_0x0cf1('0x44')]));_0x1ef54d[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x26cc9a['id'];if(_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x1ef54d[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x1ef54d[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x1ef54d[_0x0cf1('0x47')],function(_0x3a6cc4){var _0x25f99e={};_0x25f99e[_0x3a6cc4]={'$like':'%'+_0x641bd0['query'][_0x0cf1('0x33')]+'%'};return _0x25f99e;})});}_0x1ef54d=_['merge']({},_0x1ef54d,_0x641bd0[_0x0cf1('0x50')]);return db['CmHopperFinal']['count']({'where':_0x1ef54d[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x4fa1d1){_0x4dae21[_0x0cf1('0x26')]=_0x4fa1d1;if(_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x1ef54d[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6d')]['findAll'](_0x1ef54d);})[_0x0cf1('0x2e')](function(_0x4c16b0){_0x4dae21[_0x0cf1('0x54')]=_0x4c16b0;return _0x4dae21;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x5a363c,_0x1ef54d))[_0x0cf1('0x55')](handleError(_0x5a363c,null));};exports[_0x0cf1('0x6e')]=function(_0x529ab2,_0x346724,_0x5d9130){var _0x5c6848={'raw':!![],'where':{}};var _0x3b395f={};var _0x2888e7={'count':0x0,'rows':[]};return db[_0x0cf1('0x3d')][_0x0cf1('0x6b')]({'where':{'id':_0x529ab2[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x346724,null))[_0x0cf1('0x2e')](function(_0x9f3598){if(_0x9f3598){_0x3b395f[_0x0cf1('0x41')]=_['keys'](db[_0x0cf1('0x6f')]['rawAttributes']);_0x3b395f[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x529ab2[_0x0cf1('0x42')]);_0x3b395f[_0x0cf1('0x44')]=_['intersection'](_0x3b395f[_0x0cf1('0x41')],_0x3b395f[_0x0cf1('0x42')]);_0x5c6848[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x3b395f[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x529ab2['query'][_0x0cf1('0x46')]));_0x5c6848[_0x0cf1('0x47')]=_0x5c6848[_0x0cf1('0x47')]['length']?_0x5c6848[_0x0cf1('0x47')]:_0x3b395f['model'];if(!_0x529ab2[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x5c6848[_0x0cf1('0x27')]=qs['limit'](_0x529ab2[_0x0cf1('0x42')]['limit']);_0x5c6848['offset']=qs['offset'](_0x529ab2[_0x0cf1('0x42')]['offset']);}_0x5c6848['order']=qs[_0x0cf1('0x4b')](_0x529ab2[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x5c6848['where']=qs['filters'](_[_0x0cf1('0x4c')](_0x529ab2[_0x0cf1('0x42')],_0x3b395f[_0x0cf1('0x44')]));_0x5c6848[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x9f3598['id'];if(_0x529ab2['query'][_0x0cf1('0x33')]){_0x5c6848[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x5c6848[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x5c6848[_0x0cf1('0x47')],function(_0x1df660){var _0x9f0103={};_0x9f0103[_0x1df660]={'$like':'%'+_0x529ab2[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x9f0103;})});}_0x5c6848=_[_0x0cf1('0x4e')]({},_0x5c6848,_0x529ab2['options']);return db['CmHopperBlack'][_0x0cf1('0x26')]({'where':_0x5c6848[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x411e3a){_0x2888e7['count']=_0x411e3a;if(_0x529ab2[_0x0cf1('0x42')]['includeAll']){_0x5c6848[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6f')][_0x0cf1('0x53')](_0x5c6848);})[_0x0cf1('0x2e')](function(_0x2d4a25){_0x2888e7[_0x0cf1('0x54')]=_0x2d4a25;return _0x2888e7;});}})['then'](respondWithFilteredResult(_0x346724,_0x5c6848))[_0x0cf1('0x55')](handleError(_0x346724,null));};exports[_0x0cf1('0x70')]=function(_0x3c9d95,_0x1c08dc,_0xf019d1){var _0x3a5d11={};var _0x586a27={};var _0x4bcf14;var _0x424a64;return db['VoiceQueue']['findOne']({'where':{'id':_0x3c9d95[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1c08dc,null))[_0x0cf1('0x2e')](function(_0x20041f){if(_0x20041f){_0x4bcf14=_0x20041f;_0x586a27[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0x71')][_0x0cf1('0x3e')]);_0x586a27['query']=_[_0x0cf1('0x43')](_0x3c9d95[_0x0cf1('0x42')]);_0x586a27[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x586a27[_0x0cf1('0x41')],_0x586a27[_0x0cf1('0x42')]);_0x3a5d11[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x586a27[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x3c9d95[_0x0cf1('0x42')]['fields']));_0x3a5d11[_0x0cf1('0x47')]=_0x3a5d11[_0x0cf1('0x47')]['length']?_0x3a5d11[_0x0cf1('0x47')]:_0x586a27[_0x0cf1('0x41')];_0x3a5d11[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0x3c9d95[_0x0cf1('0x42')]['sort']);_0x3a5d11[_0x0cf1('0x4d')]=qs['filters'](_['pick'](_0x3c9d95['query'],_0x586a27['filters']));if(_0x3c9d95['query'][_0x0cf1('0x33')]){_0x3a5d11[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x3a5d11['where'],{'$or':_['map'](_0x3a5d11['attributes'],function(_0x47e57b){var _0x5a73b9={};_0x5a73b9[_0x47e57b]={'$like':'%'+_0x3c9d95['query'][_0x0cf1('0x33')]+'%'};return _0x5a73b9;})});}_0x3a5d11=_[_0x0cf1('0x4e')]({},_0x3a5d11,_0x3c9d95[_0x0cf1('0x50')]);return _0x4bcf14[_0x0cf1('0x70')](_0x3a5d11);}})[_0x0cf1('0x2e')](function(_0x4ea947){if(_0x4ea947){_0x424a64=_0x4ea947[_0x0cf1('0x48')];if(!_0x3c9d95[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0x3a5d11[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x3c9d95['query'][_0x0cf1('0x27')]);_0x3a5d11[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x3c9d95[_0x0cf1('0x42')][_0x0cf1('0x24')]);}return _0x4bcf14[_0x0cf1('0x70')](_0x3a5d11);}})[_0x0cf1('0x2e')](function(_0x23448b){if(_0x23448b){return _0x23448b?{'count':_0x424a64,'rows':_0x23448b}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x1c08dc,null))[_0x0cf1('0x55')](handleError(_0x1c08dc,null));};exports['addTeams']=function(_0x3d171c,_0x115167,_0x22bb2b){var _0x3cffa8=_0x3d171c[_0x0cf1('0x59')][_0x0cf1('0x72')];var _0x178646=_['map'](_0x3cffa8,'id');return db[_0x0cf1('0x71')]['findAll']({'where':{'id':_0x178646},'attributes':['id'],'include':[{'model':db[_0x0cf1('0x73')],'as':'Agents','attributes':['id',_0x0cf1('0x38'),'online','voicePause',_0x0cf1('0x74')],'raw':!![]}]})[_0x0cf1('0x2e')](function(_0x3c0f4e){if(_0x3c0f4e){var _0x553742=_['flatMap'](_0x3c0f4e,function(_0x58ee0f){var _0x1ad822=_0x58ee0f['get']({'plain':!![]});_0x1ad822[_0x0cf1('0x75')][_0x0cf1('0x76')](function(_0x1eaaf5){_0x1eaaf5[_0x0cf1('0x77')]=_['find'](_0x3cffa8,{'id':_0x1ad822['id']})[_0x0cf1('0x77')];});return _0x1ad822[_0x0cf1('0x75')];});return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x3d171c[_0x0cf1('0x57')]['id']}})['then'](function(_0x1372a3){return db[_0x0cf1('0x78')][_0x0cf1('0x79')](function(_0x433a50){return _0x1372a3[_0x0cf1('0x7a')](_0x178646,{'transaction':_0x433a50})[_0x0cf1('0x2e')](function(){return BPromise[_0x0cf1('0x7b')](_0x3cffa8,function(_0x5c16c0){return db['TeamVoiceQueue'][_0x0cf1('0x7c')]({'TeamId':_0x5c16c0['id'],'VoiceQueueId':_0x3d171c['params']['id'],'penalty':_0x5c16c0[_0x0cf1('0x77')]},{'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){return BPromise['each'](_0x553742,function(_0x4ba6d3){return db[_0x0cf1('0x7d')]['findOrCreate']({'where':{'UserId':_0x4ba6d3['id'],'VoiceQueueId':_0x3d171c[_0x0cf1('0x57')]['id']},'defaults':{'penalty':_0x4ba6d3[_0x0cf1('0x77')]},'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){return BPromise['each'](_['filter'](_0x553742,{'online':!![]}),function(_0x57c4ad){return db['UserVoiceQueueRt'][_0x0cf1('0x7c')]({'membername':_0x57c4ad['name'],'UserId':_0x57c4ad['id'],'queue_name':_0x1372a3[_0x0cf1('0x38')],'VoiceQueueId':_0x1372a3['id'],'interface':_['isNil'](_0x57c4ad[_0x0cf1('0x74')])?util[_0x0cf1('0x7e')](_0x0cf1('0x7f'),_0x57c4ad[_0x0cf1('0x38')]):_0x57c4ad[_0x0cf1('0x74')],'paused':_0x57c4ad[_0x0cf1('0x80')]||![],'penalty':_0x57c4ad[_0x0cf1('0x77')]},{'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){_0x553742[_0x0cf1('0x76')](function(_0x24d568){socket[_0x0cf1('0x81')](_0x0cf1('0x82'),{'UserId':_0x24d568['id'],'VoiceQueueId':_0x1372a3['id']});});});});});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x115167,null))['catch'](handleError(_0x115167,null));};exports[_0x0cf1('0x83')]=function(_0x4a7a4b,_0x1383b4,_0x565d3b){return db['Team'][_0x0cf1('0x53')]({'where':{'id':_0x4a7a4b[_0x0cf1('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0cf1('0x73')],'as':_0x0cf1('0x75'),'attributes':['id'],'raw':!![]}]})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1383b4,null))[_0x0cf1('0x2e')](function(_0x18da99){var _0x32cf0c=_['map'](_0x18da99,'id');var _0xbf3ba0=[];var _0x303bb5=[];var _0x4b2179=squel['select']();_0x4b2179[_0x0cf1('0x84')](_0x0cf1('0x85'))[_0x0cf1('0x86')](_0x0cf1('0x87'),'tq')[_0x0cf1('0x88')]('user_has_teams','ut',_0x0cf1('0x89'))[_0x0cf1('0x4d')](_0x0cf1('0x8a'),_0x4a7a4b[_0x0cf1('0x57')]['id']);for(var _0x1bd5d3=0x0;_0x1bd5d3<_0x18da99[_0x0cf1('0x48')];_0x1bd5d3+=0x1){let _0x41cc54=_0x18da99[_0x1bd5d3];for(var _0x5aaa09=0x0;_0x5aaa09<_0x41cc54[_0x0cf1('0x75')][_0x0cf1('0x48')];_0x5aaa09+=0x1){let _0x43767c=_0x41cc54[_0x0cf1('0x75')][_0x5aaa09];var _0x28ed50=_0x4b2179[_0x0cf1('0x8b')]();_0x28ed50[_0x0cf1('0x4d')](_0x0cf1('0x8c'),_0x43767c['id']);_0x303bb5[_0x0cf1('0x8d')](db[_0x0cf1('0x78')][_0x0cf1('0x42')](_0x28ed50[_0x0cf1('0x8e')](),{'type':db[_0x0cf1('0x78')][_0x0cf1('0x8f')][_0x0cf1('0x90')]})[_0x0cf1('0x2e')](function(_0x2db00f){if(_0x2db00f[_0x0cf1('0x48')]===0x1){return _0x43767c['id'];}else{var _0x18560c=_[_0x0cf1('0x91')](_[_0x0cf1('0x34')](_0x2db00f,_0x0cf1('0x92')),function(_0x39ffed){return _[_0x0cf1('0x93')](_0x32cf0c,_0x39ffed);});if(_0x18560c){return _0x43767c['id'];}}}));}}return BPromise[_0x0cf1('0x94')](_0x303bb5)[_0x0cf1('0x2e')](function(_0xae6a7c){_0xbf3ba0=_(_0xbf3ba0)['union'](_0xae6a7c)[_0x0cf1('0x95')]()[_0x0cf1('0x35')]();return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x4a7a4b[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](function(_0x2ad342){return db[_0x0cf1('0x78')][_0x0cf1('0x79')](function(_0x4b9baa){return _0x2ad342[_0x0cf1('0x83')](_0x4a7a4b[_0x0cf1('0x42')]['ids'],{'transaction':_0x4b9baa})[_0x0cf1('0x2e')](function(){if(!_['isEmpty'](_0xbf3ba0)){return _0x2ad342[_0x0cf1('0x96')](_0xbf3ba0,{'transaction':_0x4b9baa})[_0x0cf1('0x2e')](function(){return db[_0x0cf1('0x97')][_0x0cf1('0x2f')]({'where':{'VoiceQueueId':_0x4a7a4b['params']['id'],'UserId':_0xbf3ba0},'transaction':_0x4b9baa});});}})[_0x0cf1('0x2e')](function(){_0xbf3ba0['forEach'](function(_0x2e79a8){socket[_0x0cf1('0x81')](_0x0cf1('0x98'),{'UserId':_0x2e79a8,'VoiceQueueId':_0x2ad342['id']});});});});});});})[_0x0cf1('0x2e')](respondWithStatusCode(_0x1383b4,null))[_0x0cf1('0x55')](handleError(_0x1383b4,null));};exports['addAgents']=function(_0x15751c,_0xda100b,_0x9f9fd0){var _0x2ae6d5,_0x10ee97;return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x15751c[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0xda100b,null))['then'](function(_0x3b8f56){if(_0x3b8f56){_0x10ee97=_0x3b8f56;return _0x3b8f56[_0x0cf1('0x99')](_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')],_[_0x0cf1('0x64')](_0x15751c['body'],[_0x0cf1('0x9a'),'id'])||{})[_0x0cf1('0x9b')](function(_0x4969f5){for(var _0x2c9c9a=0x0;_0x2c9c9a<_0x15751c[_0x0cf1('0x59')]['ids']['length'];_0x2c9c9a+=0x1){socket['emit'](_0x0cf1('0x82'),{'UserId':Number(_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')][_0x2c9c9a]),'VoiceQueueId':Number(_0x15751c[_0x0cf1('0x57')]['id'])});}return _0x4969f5;});}})[_0x0cf1('0x2e')](function(_0x454d90){_0x2ae6d5=_0x454d90||[];if(_0x10ee97){return db[_0x0cf1('0x73')]['findAll']({'where':{'id':_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')]},'attributes':['id',_0x0cf1('0x38'),'online','voicePause','interface'],'raw':!![]});}})[_0x0cf1('0x2e')](function(_0x5f3a49){if(!_[_0x0cf1('0x9c')](_0x5f3a49)){var _0x19231e=[];for(var _0x45c54b=0x0;_0x45c54b<_0x5f3a49['length'];_0x45c54b++){if(_0x5f3a49[_0x45c54b][_0x0cf1('0x9d')]){_0x19231e['push'](db[_0x0cf1('0x97')][_0x0cf1('0x7c')]({'membername':_0x5f3a49[_0x45c54b][_0x0cf1('0x38')],'UserId':_0x5f3a49[_0x45c54b]['id'],'queue_name':_0x10ee97['name'],'VoiceQueueId':_0x10ee97['id'],'interface':_['isNil'](_0x5f3a49[_0x45c54b][_0x0cf1('0x74')])?util[_0x0cf1('0x7e')]('SIP/%s',_0x5f3a49[_0x45c54b][_0x0cf1('0x38')]):_0x5f3a49[_0x45c54b]['interface'],'paused':_0x5f3a49[_0x45c54b][_0x0cf1('0x80')]||![],'penalty':_0x15751c['body'][_0x0cf1('0x77')]||0x0}));}}return BPromise[_0x0cf1('0x94')](_0x19231e);}})[_0x0cf1('0x2e')](function(){return _0x2ae6d5;})[_0x0cf1('0x2e')](respondWithResult(_0xda100b,null))[_0x0cf1('0x55')](handleError(_0xda100b,null));};exports['removeAgents']=function(_0x370a77,_0x336a86,_0x50f18f){return db[_0x0cf1('0x3d')]['find']({'where':{'id':_0x370a77[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x336a86,null))[_0x0cf1('0x2e')](function(_0x3bfbaa){if(_0x3bfbaa){return _0x3bfbaa[_0x0cf1('0x96')](_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')])[_0x0cf1('0x2e')](function(){if(_[_0x0cf1('0x9e')](_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')])){for(var _0x503fdb=0x0;_0x503fdb<_0x370a77['query'][_0x0cf1('0x9a')][_0x0cf1('0x48')];_0x503fdb+=0x1){socket[_0x0cf1('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')][_0x503fdb]),'VoiceQueueId':Number(_0x370a77[_0x0cf1('0x57')]['id'])});}}else{socket[_0x0cf1('0x81')](_0x0cf1('0x98'),{'UserId':Number(_0x370a77['query']['ids']),'VoiceQueueId':Number(_0x370a77[_0x0cf1('0x57')]['id'])});}});}})['then'](function(_0x3c1af9){return db[_0x0cf1('0x97')]['destroy']({'where':{'VoiceQueueId':_0x370a77['params']['id'],'UserId':_0x370a77['query'][_0x0cf1('0x9a')]}})['then'](function(){return _0x3c1af9;});})['then'](respondWithStatusCode(_0x336a86,null))[_0x0cf1('0x55')](handleError(_0x336a86,null));};exports[_0x0cf1('0x9f')]=function(_0x119b8f,_0x1fe608,_0x5acc1){var _0xa37e2f={};var _0x5ac77a={};var _0x3152fa;var _0x6c898f;return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x119b8f[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fe608,null))['then'](function(_0x3743b8){if(_0x3743b8){_0x3152fa=_0x3743b8;_0x5ac77a[_0x0cf1('0x41')]=_['keys'](db[_0x0cf1('0x73')][_0x0cf1('0x3e')]);_0x5ac77a[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x119b8f[_0x0cf1('0x42')]);_0x5ac77a['filters']=_['intersection'](_0x5ac77a[_0x0cf1('0x41')],_0x5ac77a[_0x0cf1('0x42')]);_0xa37e2f[_0x0cf1('0x47')]=_['intersection'](_0x5ac77a[_0x0cf1('0x41')],qs['fields'](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0xa37e2f[_0x0cf1('0x47')]=_0xa37e2f[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0xa37e2f['attributes']:_0x5ac77a['model'];_0xa37e2f[_0x0cf1('0x4a')]=qs['sort'](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0xa37e2f['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x119b8f['query'],_0x5ac77a[_0x0cf1('0x44')]));if(_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0xa37e2f[_0x0cf1('0x4d')]=_['merge'](_0xa37e2f[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0xa37e2f['attributes'],function(_0x452993){var _0x494bc5={};_0x494bc5[_0x452993]={'$like':'%'+_0x119b8f['query'][_0x0cf1('0x33')]+'%'};return _0x494bc5;})});}_0xa37e2f=_[_0x0cf1('0x4e')]({},_0xa37e2f,_0x119b8f[_0x0cf1('0x50')]);return _0x3152fa[_0x0cf1('0x9f')](_0xa37e2f);}})['then'](function(_0x2627d8){if(_0x2627d8){_0x6c898f=_0x2627d8['length'];if(!_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0xa37e2f['limit']=qs[_0x0cf1('0x27')](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0xa37e2f[_0x0cf1('0x24')]=qs['offset'](_0x119b8f['query'][_0x0cf1('0x24')]);}return _0x3152fa[_0x0cf1('0x9f')](_0xa37e2f);}})[_0x0cf1('0x2e')](function(_0x4f78c5){if(_0x4f78c5){return _0x4f78c5?{'count':_0x6c898f,'rows':_0x4f78c5}:null;}})['then'](respondWithResult(_0x1fe608,null))['catch'](handleError(_0x1fe608,null));};exports[_0x0cf1('0xa0')]=function(_0x93edce,_0x30bff3,_0x1e9694){var _0x219db9={};var _0x48ad43={};var _0x5f006d;var _0xa93e52;return db[_0x0cf1('0x3d')]['findOne']({'where':{'id':_0x93edce['params']['id']}})['then'](handleEntityNotFound(_0x30bff3,null))['then'](function(_0x1230d6){if(_0x1230d6){_0x5f006d=_0x1230d6;_0x48ad43['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x97')][_0x0cf1('0x3e')]);_0x48ad43[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x93edce[_0x0cf1('0x42')]);_0x48ad43[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x48ad43['model'],_0x48ad43['query']);_0x219db9[_0x0cf1('0x47')]=_['intersection'](_0x48ad43[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x93edce[_0x0cf1('0x42')]['fields']));_0x219db9[_0x0cf1('0x47')]=_0x219db9[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x219db9[_0x0cf1('0x47')]:_0x48ad43['model'];_0x219db9[_0x0cf1('0x4a')]=qs['sort'](_0x93edce[_0x0cf1('0x42')]['sort']);_0x219db9[_0x0cf1('0x4d')]=qs['filters'](_['pick'](_0x93edce['query'],_0x48ad43[_0x0cf1('0x44')]));if(_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x219db9['where']=_[_0x0cf1('0x4e')](_0x219db9['where'],{'$or':_[_0x0cf1('0x34')](_0x219db9[_0x0cf1('0x47')],function(_0x193b36){var _0x43033f={};_0x43033f[_0x193b36]={'$like':'%'+_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x43033f;})});}_0x219db9=_[_0x0cf1('0x4e')]({},_0x219db9,_0x93edce['options']);return _0x5f006d[_0x0cf1('0xa0')](_0x219db9);}})[_0x0cf1('0x2e')](function(_0xb1ab96){if(_0xb1ab96){_0xa93e52=_0xb1ab96[_0x0cf1('0x48')];if(!_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x219db9['limit']=qs['limit'](_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x219db9[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x24')]);}return _0x5f006d[_0x0cf1('0xa0')](_0x219db9);}})[_0x0cf1('0x2e')](function(_0x2a4e19){return _0x2a4e19?{'count':_0xa93e52,'rows':_0x2a4e19}:null;})[_0x0cf1('0x2e')](respondWithResult(_0x30bff3,null))[_0x0cf1('0x55')](handleError(_0x30bff3,null));};exports[_0x0cf1('0xa1')]=function(_0x48807b,_0x1da063,_0x39a8c0){var _0x325f7c={};var _0x292481={};var _0x4db92e;var _0x581994;return db[_0x0cf1('0x3d')][_0x0cf1('0x6b')]({'where':{'id':_0x48807b[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x1da063,null))[_0x0cf1('0x2e')](function(_0x4a3516){if(_0x4a3516){_0x4db92e=_0x4a3516;_0x292481[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0xa2')][_0x0cf1('0x3e')]);_0x292481[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x48807b['query']);_0x292481[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x292481[_0x0cf1('0x41')],_0x292481['query']);_0x325f7c[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x292481[_0x0cf1('0x41')],qs['fields'](_0x48807b['query']['fields']));_0x325f7c[_0x0cf1('0x47')]=_0x325f7c['attributes'][_0x0cf1('0x48')]?_0x325f7c[_0x0cf1('0x47')]:_0x292481['model'];_0x325f7c[_0x0cf1('0x4a')]=qs['sort'](_0x48807b[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x325f7c['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x48807b[_0x0cf1('0x42')],_0x292481[_0x0cf1('0x44')]));if(_0x48807b['query']['filter']){_0x325f7c[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x325f7c[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x325f7c['attributes'],function(_0x49ea89){var _0xa9e819={};_0xa9e819[_0x49ea89]={'$like':'%'+_0x48807b[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0xa9e819;})});}_0x325f7c=_[_0x0cf1('0x4e')]({},_0x325f7c,_0x48807b[_0x0cf1('0x50')]);return _0x4db92e[_0x0cf1('0xa1')](_0x325f7c);}})['then'](function(_0x43e724){if(_0x43e724){_0x581994=_0x43e724[_0x0cf1('0x48')];if(!_0x48807b[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x325f7c['limit']=qs[_0x0cf1('0x27')](_0x48807b[_0x0cf1('0x42')]['limit']);_0x325f7c['offset']=qs[_0x0cf1('0x24')](_0x48807b[_0x0cf1('0x42')]['offset']);}return _0x4db92e[_0x0cf1('0xa1')](_0x325f7c);}})[_0x0cf1('0x2e')](function(_0x3994ad){if(_0x3994ad){return _0x3994ad?{'count':_0x581994,'rows':_0x3994ad}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x1da063,null))[_0x0cf1('0x55')](handleError(_0x1da063,null));};exports[_0x0cf1('0xa3')]=function(_0x155ac4,_0x1e5c9d,_0x450be9){var _0xe6cacc,_0x259156;return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x155ac4['params']['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1e5c9d,null))[_0x0cf1('0x2e')](function(_0x4a54a5){if(_0x4a54a5){_0x259156=_0x4a54a5;return _0x4a54a5[_0x0cf1('0xa3')](_0x155ac4[_0x0cf1('0x59')][_0x0cf1('0x9a')],_[_0x0cf1('0x64')](_0x155ac4[_0x0cf1('0x59')],[_0x0cf1('0x9a'),'id'])||{});}return null;})[_0x0cf1('0x9b')](function(_0x606208){var _0x111185;_0xe6cacc=_0x606208||[];var _0x204130=[];if(_0x606208){for(var _0x1668c8=0x0;_0x1668c8<_0x606208['length'];_0x1668c8+=0x1){var _0x298895=_0x606208[_0x1668c8][_0x0cf1('0x5c')]({'plain':!![]});_0x259156[_0x0cf1('0xa4')]=_0x155ac4[_0x0cf1('0x59')]['dialCheckDuplicateType']?_0x155ac4[_0x0cf1('0x59')][_0x0cf1('0xa4')]:_0x259156[_0x0cf1('0xa4')];switch(_0x259156[_0x0cf1('0xa4')]){case _0x0cf1('0xa5'):_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))['fromQuery']([_0x0cf1('0xa9'),_0x0cf1('0xaa'),'ContactId',_0x0cf1('0xab'),_0x0cf1('0x69'),'createdAt','updatedAt'],squel[_0x0cf1('0xac')]()['field'](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0xaa'))[_0x0cf1('0x84')]('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),_0x0cf1('0xab'))['field'](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field'](_0x0cf1('0xad'),_0x0cf1('0x63'))['from'](_0x0cf1('0xb0'))[_0x0cf1('0x4d')](_0x0cf1('0xb1'))['where'](_0x0cf1('0xb2'),_0x298895[_0x0cf1('0xaf')]['toString']())[_0x0cf1('0x4d')](_0x0cf1('0xb3'))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel[_0x0cf1('0xac')]()['field'](_0x0cf1('0xb5'))['from'](_0x0cf1('0xb6'))[_0x0cf1('0x4d')](_0x0cf1('0x8a'),_0x155ac4['params']['id'][_0x0cf1('0x8e')]()))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xb7'))[_0x0cf1('0x86')](_0x0cf1('0xa8'))['where'](_0x0cf1('0x8a'),_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')]())))[_0x0cf1('0x8e')]();break;case'onlyIfOpen':_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))[_0x0cf1('0xb8')](['phone',_0x0cf1('0xaa'),_0x0cf1('0xae'),'ListId',_0x0cf1('0x69'),'createdAt','updatedAt'],squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0xaa'))[_0x0cf1('0x84')]('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),_0x0cf1('0xab'))[_0x0cf1('0x84')](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')]('NOW()',_0x0cf1('0x62'))[_0x0cf1('0x84')]('NOW()','updatedAt')[_0x0cf1('0x86')]('cm_contacts')[_0x0cf1('0x4d')]('deletedAt\x20IS\x20NULL')[_0x0cf1('0x4d')]('ListId\x20=\x20?',_0x298895[_0x0cf1('0xaf')]['toString']())[_0x0cf1('0x4d')](_0x0cf1('0xb3'))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel['select']()['field'](_0x0cf1('0xb7'))[_0x0cf1('0x86')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')]())))['toString']();break;default:_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))['fromQuery']([_0x0cf1('0xa9'),_0x0cf1('0xaa'),_0x0cf1('0xae'),_0x0cf1('0xab'),'VoiceQueueId',_0x0cf1('0x62'),_0x0cf1('0x63')],squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')]('NOW()',_0x0cf1('0xaa'))['field']('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895['CmListId'][_0x0cf1('0x8e')](),_0x0cf1('0xab'))['field'](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field'](_0x0cf1('0xad'),_0x0cf1('0x63'))[_0x0cf1('0x86')](_0x0cf1('0xb0'))[_0x0cf1('0x4d')](_0x0cf1('0xb1'))[_0x0cf1('0x4d')]('ListId\x20=\x20?',_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')]())['where'](_0x0cf1('0xb3')))[_0x0cf1('0x8e')]();}_0x204130[_0x0cf1('0x8d')](db[_0x0cf1('0x78')][_0x0cf1('0x42')](_0x111185));}return BPromise[_0x0cf1('0x94')](_0x204130);}})[_0x0cf1('0x2e')](function(){return _0xe6cacc;})[_0x0cf1('0x2e')](respondWithResult(_0x1e5c9d,null))['catch'](handleError(_0x1e5c9d,null));};exports[_0x0cf1('0xb9')]=function(_0x282eb1,_0x5859d2,_0x261c5f){return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x282eb1[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x5859d2,null))['then'](function(_0x5e1835){if(_0x5e1835){return _0x5e1835[_0x0cf1('0xb9')](_0x282eb1[_0x0cf1('0x42')][_0x0cf1('0x9a')]);}})[_0x0cf1('0x2e')](function(_0x5c6f26){if(_0x5c6f26){return db[_0x0cf1('0x67')][_0x0cf1('0x2f')]({'where':{'ListId':_0x282eb1[_0x0cf1('0x42')][_0x0cf1('0x9a')],'VoiceQueueId':_0x282eb1['params']['id']}})[_0x0cf1('0x2e')](function(){return _0x5c6f26;});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x5859d2,null))[_0x0cf1('0x55')](handleError(_0x5859d2,null));};exports[_0x0cf1('0xba')]=function(_0x436def,_0x192aed,_0x4df289){var _0x5bdd11={};var _0xced3d5={};var _0xfb998c;var _0x3d1601;return db['VoiceQueue']['findOne']({'where':{'id':_0x436def['params']['id']}})['then'](handleEntityNotFound(_0x192aed,null))[_0x0cf1('0x2e')](function(_0x3f6fb7){if(_0x3f6fb7){_0xfb998c=_0x3f6fb7;_0xced3d5[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db['CmList'][_0x0cf1('0x3e')]);_0xced3d5['query']=_[_0x0cf1('0x43')](_0x436def[_0x0cf1('0x42')]);_0xced3d5[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0xced3d5[_0x0cf1('0x41')],_0xced3d5[_0x0cf1('0x42')]);_0x5bdd11[_0x0cf1('0x47')]=_['intersection'](_0xced3d5[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x436def[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x5bdd11['attributes']=_0x5bdd11[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x5bdd11['attributes']:_0xced3d5[_0x0cf1('0x41')];_0x5bdd11['order']=qs['sort'](_0x436def[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x5bdd11[_0x0cf1('0x4d')]=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x436def[_0x0cf1('0x42')],_0xced3d5[_0x0cf1('0x44')]));if(_0x436def[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x5bdd11[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x5bdd11['where'],{'$or':_['map'](_0x5bdd11[_0x0cf1('0x47')],function(_0x34818b){var _0x194ded={};_0x194ded[_0x34818b]={'$like':'%'+_0x436def[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x194ded;})});}_0x5bdd11=_[_0x0cf1('0x4e')]({},_0x5bdd11,_0x436def['options']);return _0xfb998c[_0x0cf1('0xba')](_0x5bdd11);}})[_0x0cf1('0x2e')](function(_0x1c93ac){if(_0x1c93ac){_0x3d1601=_0x1c93ac['length'];if(!_0x436def['query'][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x5bdd11[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x436def[_0x0cf1('0x42')]['limit']);_0x5bdd11['offset']=qs[_0x0cf1('0x24')](_0x436def['query']['offset']);}return _0xfb998c[_0x0cf1('0xba')](_0x5bdd11);}})[_0x0cf1('0x2e')](function(_0x111c92){if(_0x111c92){return _0x111c92?{'count':_0x3d1601,'rows':_0x111c92}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x192aed,null))[_0x0cf1('0x55')](handleError(_0x192aed,null));};exports[_0x0cf1('0xbb')]=function(_0x433c96,_0x367e97,_0x28130e){var _0x38f9e5,_0x23459f;return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x433c96[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x367e97,null))[_0x0cf1('0x2e')](function(_0x91c04a){if(_0x91c04a){_0x23459f=_0x91c04a;return _0x91c04a[_0x0cf1('0xbb')](_0x433c96['body']['ids'],_[_0x0cf1('0x64')](_0x433c96['body'],[_0x0cf1('0x9a'),'id'])||{});}return null;})[_0x0cf1('0x9b')](function(_0x141956){var _0x3a40fd;_0x38f9e5=_0x141956||[];var _0x595bc1=[];if(_0x141956){for(var _0x131b7f=0x0;_0x131b7f<_0x141956[_0x0cf1('0x48')];_0x131b7f+=0x1){var _0x4bab57=_0x141956[_0x131b7f][_0x0cf1('0x5c')]({'plain':!![]});_0x3a40fd=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')]('cm_hopper_black')[_0x0cf1('0xb8')]([_0x0cf1('0xa9'),_0x0cf1('0xae'),_0x0cf1('0xab'),_0x0cf1('0x69'),'createdAt','updatedAt'],squel['select']()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')]('id','ContactId')[_0x0cf1('0x84')](_0x4bab57[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),'ListId')['field'](_0x433c96[_0x0cf1('0x57')]['id']['toString'](),_0x0cf1('0x69'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field']('NOW()',_0x0cf1('0x63'))[_0x0cf1('0x86')]('cm_contacts')['where'](_0x0cf1('0xb1'))[_0x0cf1('0x4d')](_0x0cf1('0xb2'),_0x4bab57[_0x0cf1('0xaf')][_0x0cf1('0x8e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0cf1('0x8e')]();_0x595bc1[_0x0cf1('0x8d')](db[_0x0cf1('0x78')]['query'](_0x3a40fd));}return BPromise['all'](_0x595bc1);}})[_0x0cf1('0x2e')](function(){return _0x38f9e5;})[_0x0cf1('0x2e')](respondWithResult(_0x367e97,null))[_0x0cf1('0x55')](handleError(_0x367e97,null));};exports['removeBlackLists']=function(_0x2a9a64,_0x4f5619,_0x3fe477){return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x2a9a64[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x4f5619,null))[_0x0cf1('0x2e')](function(_0x1faea9){if(_0x1faea9){return _0x1faea9[_0x0cf1('0xbc')](_0x2a9a64[_0x0cf1('0x42')][_0x0cf1('0x9a')]);}})[_0x0cf1('0x2e')](function(_0x43d115){if(_0x43d115){return db[_0x0cf1('0x6f')][_0x0cf1('0x2f')]({'where':{'ListId':_0x2a9a64[_0x0cf1('0x42')][_0x0cf1('0x9a')],'VoiceQueueId':_0x2a9a64[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](function(){return _0x43d115;});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x4f5619,null))[_0x0cf1('0x55')](handleError(_0x4f5619,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 9010103..adccae4 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 _0x8a40=['hasOwnProperty','events','../../mysqldb','VoiceQueue','save','emit'];(function(_0xe828c9,_0x3da4c9){var _0x471922=function(_0x162882){while(--_0x162882){_0xe828c9['push'](_0xe828c9['shift']());}};_0x471922(++_0x3da4c9);}(_0x8a40,0x139));var _0x08a4=function(_0x13dd07,_0x49d670){_0x13dd07=_0x13dd07-0x0;var _0x1a00cb=_0x8a40[_0x13dd07];return _0x1a00cb;};'use strict';var EventEmitter=require(_0x08a4('0x0'));var VoiceQueue=require(_0x08a4('0x1'))['db'][_0x08a4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x08a4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xce9bcb){return function(_0x3689dd,_0x34c742,_0x3b5e95){VoiceQueueEvents[_0x08a4('0x4')](_0xce9bcb+':'+_0x3689dd['id'],_0x3689dd);VoiceQueueEvents['emit'](_0xce9bcb,_0x3689dd);_0x3b5e95(null);};}for(var e in events){if(events[_0x08a4('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x5da1=['events','../../mysqldb','VoiceQueue','remove','emit','hasOwnProperty','hook','exports'];(function(_0x322b7e,_0x3c8e7e){var _0x2f0e1f=function(_0x17127c){while(--_0x17127c){_0x322b7e['push'](_0x322b7e['shift']());}};_0x2f0e1f(++_0x3c8e7e);}(_0x5da1,0x128));var _0x15da=function(_0x542540,_0x180cd1){_0x542540=_0x542540-0x0;var _0x3ddeff=_0x5da1[_0x542540];return _0x3ddeff;};'use strict';var EventEmitter=require(_0x15da('0x0'));var VoiceQueue=require(_0x15da('0x1'))['db'][_0x15da('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x15da('0x3')};function emitEvent(_0x1c3b8b){return function(_0x14d54e,_0x37347d,_0x2e633b){VoiceQueueEvents[_0x15da('0x4')](_0x1c3b8b+':'+_0x14d54e['id'],_0x14d54e);VoiceQueueEvents[_0x15da('0x4')](_0x1c3b8b,_0x14d54e);_0x2e633b(null);};}for(var e in events){if(events[_0x15da('0x5')](e)){var event=events[e];VoiceQueue[_0x15da('0x6')](e,emitEvent(event));}}module[_0x15da('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 866cfaf..2d3b08e 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x25092b,_0x19ea27){var _0xba3486=function(_0x16731a){while(--_0x16731a){_0x25092b['push'](_0x25092b['shift']());}};_0xba3486(++_0x19ea27);}(_0x34e8,0x12c));var _0x834e=function(_0x32c62b,_0xe89203){_0x32c62b=_0x32c62b-0x0;var _0x5ed2fa=_0x34e8[_0x32c62b];return _0x5ed2fa;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3937b6,_0xd53d2b){var _0x1ba356=function(_0x4816cc){while(--_0x4816cc){_0x3937b6['push'](_0x3937b6['shift']());}};_0x1ba356(++_0xd53d2b);}(_0x008c,0x188));var _0xc008=function(_0x464e1f,_0x2aa86f){_0x464e1f=_0x464e1f-0x0;var _0x1c1ce2=_0x008c[_0x464e1f];return _0x1c1ce2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index d664856..7cd7ed3 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 _0x3bb5=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceQueue','stringify','find','ShowVoiceQueue','lodash','moment','bluebird'];(function(_0x2b42bf,_0x2f1463){var _0x23c423=function(_0x464e69){while(--_0x464e69){_0x2b42bf['push'](_0x2b42bf['shift']());}};_0x23c423(++_0x2f1463);}(_0x3bb5,0x194));var _0x53bb=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x3bb5[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x53bb('0x0'));var util=require('util');var moment=require(_0x53bb('0x1'));var BPromise=require(_0x53bb('0x2'));var rs=require(_0x53bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53bb('0x5'))(_0x53bb('0x6'));var config=require(_0x53bb('0x7'));var jayson=require(_0x53bb('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x53bb('0x9'),'port':0x18eb});var socket=require(_0x53bb('0xa'))(new Redis(config['redis']));require(_0x53bb('0xb'))[_0x53bb('0xc')](socket);function respondWithRpcPromise(_0x53851f,_0x1473b0,_0x8006d8){return new BPromise(function(_0x4e45a1,_0xf5d9e3){return client[_0x53bb('0xd')](_0x53851f,_0x8006d8)[_0x53bb('0xe')](function(_0xef90e5){logger[_0x53bb('0xf')](_0x53bb('0x10'),_0x1473b0,_0x53bb('0x11'));logger[_0x53bb('0x12')](_0x53bb('0x13'),_0x1473b0,_0x53bb('0x11'),JSON['stringify'](_0xef90e5));if(_0xef90e5[_0x53bb('0x14')]){if(_0xef90e5[_0x53bb('0x14')][_0x53bb('0x15')]===0x1f4){logger['error'](_0x53bb('0x10'),_0x1473b0,_0xef90e5[_0x53bb('0x14')]['message']);return _0xf5d9e3(_0xef90e5[_0x53bb('0x14')][_0x53bb('0x16')]);}logger[_0x53bb('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x1473b0,_0xef90e5['error'][_0x53bb('0x16')]);return _0x4e45a1(_0xef90e5[_0x53bb('0x14')][_0x53bb('0x16')]);}else{logger[_0x53bb('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x1473b0,_0x53bb('0x11'));_0x4e45a1(_0xef90e5['result'][_0x53bb('0x16')]);}})[_0x53bb('0x17')](function(_0x11298c){logger['error'](_0x53bb('0x10'),_0x1473b0,_0x11298c);_0xf5d9e3(_0x11298c);});});}exports['GetVoiceQueue']=function(_0x477352){var _0x5e9afa=this;return new Promise(function(_0xd5ed25,_0x5b7b80){return db['VoiceQueue'][_0x53bb('0x18')]({'raw':_0x477352[_0x53bb('0x19')]?_0x477352[_0x53bb('0x19')][_0x53bb('0x1a')]===undefined?!![]:![]:!![],'where':_0x477352['options']?_0x477352[_0x53bb('0x19')][_0x53bb('0x1b')]||null:null,'attributes':_0x477352[_0x53bb('0x19')]?_0x477352[_0x53bb('0x19')]['attributes']||null:null,'limit':_0x477352[_0x53bb('0x19')]?_0x477352[_0x53bb('0x19')][_0x53bb('0x1c')]||null:null,'include':_0x477352['options']?_0x477352['options'][_0x53bb('0x1d')]?_[_0x53bb('0x1e')](_0x477352[_0x53bb('0x19')][_0x53bb('0x1d')],function(_0x23fe28){return{'model':db[_0x23fe28['model']],'as':_0x23fe28['as'],'attributes':_0x23fe28['attributes'],'include':_0x23fe28['include']?_[_0x53bb('0x1e')](_0x23fe28[_0x53bb('0x1d')],function(_0x4902a9){return{'model':db[_0x4902a9[_0x53bb('0x1f')]],'as':_0x4902a9['as'],'attributes':_0x4902a9[_0x53bb('0x20')],'include':_0x4902a9['include']?_[_0x53bb('0x1e')](_0x4902a9[_0x53bb('0x1d')],function(_0x1d6a33){return{'model':db[_0x1d6a33[_0x53bb('0x1f')]],'as':_0x1d6a33['as'],'attributes':_0x1d6a33[_0x53bb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x53bb('0xe')](function(_0x193725){logger[_0x53bb('0xf')](_0x53bb('0x21'),_0x477352);logger['debug'](_0x53bb('0x21'),_0x477352,JSON[_0x53bb('0x22')](_0x193725));_0xd5ed25(_0x193725);})[_0x53bb('0x17')](function(_0x4136f0){logger[_0x53bb('0x14')](_0x53bb('0x21'),_0x4136f0[_0x53bb('0x16')],_0x477352);_0x5b7b80(_0x5e9afa['error'](0x1f4,_0x4136f0[_0x53bb('0x16')]));});});};exports['ShowVoiceQueue']=function(_0xf49d59){var _0x2ac266=this;return new Promise(function(_0x309f9d,_0x1e0bcd){return db['VoiceQueue'][_0x53bb('0x23')]({'raw':_0xf49d59[_0x53bb('0x19')]?_0xf49d59['options'][_0x53bb('0x1a')]===undefined?!![]:![]:!![],'where':_0xf49d59[_0x53bb('0x19')]?_0xf49d59[_0x53bb('0x19')][_0x53bb('0x1b')]||null:null,'attributes':_0xf49d59['options']?_0xf49d59['options']['attributes']||null:null,'include':_0xf49d59['options']?_0xf49d59['options'][_0x53bb('0x1d')]?_['map'](_0xf49d59[_0x53bb('0x19')][_0x53bb('0x1d')],function(_0x498ed1){return{'model':db[_0x498ed1[_0x53bb('0x1f')]],'as':_0x498ed1['as'],'attributes':_0x498ed1[_0x53bb('0x20')],'include':_0x498ed1[_0x53bb('0x1d')]?_[_0x53bb('0x1e')](_0x498ed1[_0x53bb('0x1d')],function(_0x553b7e){return{'model':db[_0x553b7e[_0x53bb('0x1f')]],'as':_0x553b7e['as'],'attributes':_0x553b7e[_0x53bb('0x20')],'include':_0x553b7e[_0x53bb('0x1d')]?_[_0x53bb('0x1e')](_0x553b7e['include'],function(_0x3517d6){return{'model':db[_0x3517d6[_0x53bb('0x1f')]],'as':_0x3517d6['as'],'attributes':_0x3517d6[_0x53bb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x53bb('0xe')](function(_0x5175bd){logger[_0x53bb('0xf')](_0x53bb('0x24'),_0xf49d59);logger[_0x53bb('0x12')]('ShowVoiceQueue',_0xf49d59,JSON[_0x53bb('0x22')](_0x5175bd));_0x309f9d(_0x5175bd);})[_0x53bb('0x17')](function(_0x4e2255){logger[_0x53bb('0x14')](_0x53bb('0x24'),_0x4e2255[_0x53bb('0x16')],_0xf49d59);_0x1e0bcd(_0x2ac266[_0x53bb('0x14')](0x1f4,_0x4e2255['message']));});});}; \ No newline at end of file +var _0x1600=['request','then','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','VoiceQueue,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','map','include','model','info','ShowVoiceQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x132765,_0x2663cd){var _0x2f3263=function(_0x28c713){while(--_0x28c713){_0x132765['push'](_0x132765['shift']());}};_0x2f3263(++_0x2663cd);}(_0x1600,0xea));var _0x0160=function(_0x22b7ac,_0x473133){_0x22b7ac=_0x22b7ac-0x0;var _0x57f406=_0x1600[_0x22b7ac];return _0x57f406;};'use strict';var _=require(_0x0160('0x0'));var util=require(_0x0160('0x1'));var moment=require(_0x0160('0x2'));var BPromise=require(_0x0160('0x3'));var rs=require(_0x0160('0x4'));var fs=require('fs');var Redis=require(_0x0160('0x5'));var db=require(_0x0160('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0160('0x7'))(_0x0160('0x8'));var config=require(_0x0160('0x9'));var jayson=require(_0x0160('0xa'));var client=jayson['client'][_0x0160('0xb')]({'port':0x232a});config[_0x0160('0xc')]=_[_0x0160('0xd')](config[_0x0160('0xc')],{'host':_0x0160('0xe'),'port':0x18eb});var socket=require(_0x0160('0xf'))(new Redis(config[_0x0160('0xc')]));require(_0x0160('0x10'))[_0x0160('0x11')](socket);function respondWithRpcPromise(_0x2234f4,_0x19f31,_0x274d4d){return new BPromise(function(_0x2bcddd,_0x2ebc1c){return client[_0x0160('0x12')](_0x2234f4,_0x274d4d)[_0x0160('0x13')](function(_0x8fceb6){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x19f31,_0x0160('0x14'));logger['debug'](_0x0160('0x15'),_0x19f31,_0x0160('0x14'),JSON[_0x0160('0x16')](_0x8fceb6));if(_0x8fceb6['error']){if(_0x8fceb6['error']['code']===0x1f4){logger['error'](_0x0160('0x17'),_0x19f31,_0x8fceb6[_0x0160('0x18')][_0x0160('0x19')]);return _0x2ebc1c(_0x8fceb6[_0x0160('0x18')]['message']);}logger[_0x0160('0x18')](_0x0160('0x17'),_0x19f31,_0x8fceb6['error'][_0x0160('0x19')]);return _0x2bcddd(_0x8fceb6[_0x0160('0x18')][_0x0160('0x19')]);}else{logger['info'](_0x0160('0x17'),_0x19f31,_0x0160('0x14'));_0x2bcddd(_0x8fceb6[_0x0160('0x1a')]['message']);}})[_0x0160('0x1b')](function(_0x333054){logger[_0x0160('0x18')](_0x0160('0x17'),_0x19f31,_0x333054);_0x2ebc1c(_0x333054);});});}exports[_0x0160('0x1c')]=function(_0x2b3583){var _0x243cb1=this;return new Promise(function(_0x721b83,_0x342217){return db[_0x0160('0x1d')]['findAll']({'raw':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x20')]||null:null,'attributes':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x21')]||null:null,'limit':_0x2b3583[_0x0160('0x1e')]?_0x2b3583['options'][_0x0160('0x22')]||null:null,'include':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')]['include']?_[_0x0160('0x23')](_0x2b3583[_0x0160('0x1e')][_0x0160('0x24')],function(_0x57a899){return{'model':db[_0x57a899[_0x0160('0x25')]],'as':_0x57a899['as'],'attributes':_0x57a899['attributes'],'include':_0x57a899[_0x0160('0x24')]?_[_0x0160('0x23')](_0x57a899[_0x0160('0x24')],function(_0x1fe08f){return{'model':db[_0x1fe08f[_0x0160('0x25')]],'as':_0x1fe08f['as'],'attributes':_0x1fe08f[_0x0160('0x21')],'include':_0x1fe08f[_0x0160('0x24')]?_['map'](_0x1fe08f[_0x0160('0x24')],function(_0x3e985d){return{'model':db[_0x3e985d[_0x0160('0x25')]],'as':_0x3e985d['as'],'attributes':_0x3e985d[_0x0160('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0160('0x13')](function(_0x46ee65){logger[_0x0160('0x26')](_0x0160('0x1c'),_0x2b3583);logger['debug'](_0x0160('0x1c'),_0x2b3583,JSON[_0x0160('0x16')](_0x46ee65));_0x721b83(_0x46ee65);})[_0x0160('0x1b')](function(_0x44dc87){logger['error'](_0x0160('0x1c'),_0x44dc87[_0x0160('0x19')],_0x2b3583);_0x342217(_0x243cb1[_0x0160('0x18')](0x1f4,_0x44dc87[_0x0160('0x19')]));});});};exports[_0x0160('0x27')]=function(_0x1eb4a2){var _0x3217bb=this;return new Promise(function(_0x591b74,_0x1e3733){return db[_0x0160('0x1d')][_0x0160('0x28')]({'raw':_0x1eb4a2[_0x0160('0x1e')]?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x1f')]===undefined?!![]:![]:!![],'where':_0x1eb4a2[_0x0160('0x1e')]?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x20')]||null:null,'attributes':_0x1eb4a2['options']?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x21')]||null:null,'include':_0x1eb4a2['options']?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x24')]?_['map'](_0x1eb4a2[_0x0160('0x1e')]['include'],function(_0x49832a){return{'model':db[_0x49832a[_0x0160('0x25')]],'as':_0x49832a['as'],'attributes':_0x49832a[_0x0160('0x21')],'include':_0x49832a[_0x0160('0x24')]?_[_0x0160('0x23')](_0x49832a['include'],function(_0x4a940d){return{'model':db[_0x4a940d[_0x0160('0x25')]],'as':_0x4a940d['as'],'attributes':_0x4a940d['attributes'],'include':_0x4a940d[_0x0160('0x24')]?_[_0x0160('0x23')](_0x4a940d[_0x0160('0x24')],function(_0x5d108f){return{'model':db[_0x5d108f[_0x0160('0x25')]],'as':_0x5d108f['as'],'attributes':_0x5d108f[_0x0160('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0160('0x13')](function(_0x4989e7){logger[_0x0160('0x26')]('ShowVoiceQueue',_0x1eb4a2);logger[_0x0160('0x29')](_0x0160('0x27'),_0x1eb4a2,JSON[_0x0160('0x16')](_0x4989e7));_0x591b74(_0x4989e7);})[_0x0160('0x1b')](function(_0x93ae6b){logger['error'](_0x0160('0x27'),_0x93ae6b[_0x0160('0x19')],_0x1eb4a2);_0x1e3733(_0x3217bb[_0x0160('0x18')](0x1f4,_0x93ae6b[_0x0160('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 32a3204..e3824a6 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 _0xd980=['save','update','emit','register','voiceQueue:'];(function(_0x457396,_0xd656b6){var _0x57416a=function(_0x1b4ee0){while(--_0x1b4ee0){_0x457396['push'](_0x457396['shift']());}};_0x57416a(++_0xd656b6);}(_0xd980,0x1e0));var _0x0d98=function(_0xbfbbc9,_0x309058){_0xbfbbc9=_0xbfbbc9-0x0;var _0xd63748=_0xd980[_0xbfbbc9];return _0xd63748;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x0d98('0x0'),'remove',_0x0d98('0x1')];function createListener(_0x302e8c,_0x3e66f5){return function(_0x362f58){_0x3e66f5[_0x0d98('0x2')](_0x302e8c,_0x362f58);};}function removeListener(_0x4d111a,_0x449d10){return function(){VoiceQueueEvents['removeListener'](_0x4d111a,_0x449d10);};}exports[_0x0d98('0x3')]=function(_0x40cb91){for(var _0xb42225=0x0,_0x2abedc=events['length'];_0xb42225<_0x2abedc;_0xb42225++){var _0x3f8d5b=events[_0xb42225];var _0x17d5e3=createListener(_0x0d98('0x4')+_0x3f8d5b,_0x40cb91);VoiceQueueEvents['on'](_0x3f8d5b,_0x17d5e3);}}; \ No newline at end of file +var _0xdf9a=['removeListener','register','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x2052cc,_0x4f76dc){var _0x58609f=function(_0x28bdc9){while(--_0x28bdc9){_0x2052cc['push'](_0x2052cc['shift']());}};_0x58609f(++_0x4f76dc);}(_0xdf9a,0x177));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0xadf9('0x0'));var events=[_0xadf9('0x1'),'remove',_0xadf9('0x2')];function createListener(_0x3381dc,_0x531742){return function(_0x5bd9e4){_0x531742['emit'](_0x3381dc,_0x5bd9e4);};}function removeListener(_0x4c510b,_0x5b23fb){return function(){VoiceQueueEvents[_0xadf9('0x3')](_0x4c510b,_0x5b23fb);};}exports[_0xadf9('0x4')]=function(_0x290a59){for(var _0x2011c7=0x0,_0x18c8cd=events['length'];_0x2011c7<_0x18c8cd;_0x2011c7++){var _0x59a997=events[_0x2011c7];var _0x1b23fb=createListener(_0xadf9('0x5')+_0x59a997,_0x290a59);VoiceQueueEvents['on'](_0x59a997,_0x1b23fb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 7dcc7b0..d8d6e2c 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 _0x44bb=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','/:id','show','post','create','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3213b4,_0x3cddd0){var _0xa97785=function(_0x3c9282){while(--_0x3c9282){_0x3213b4['push'](_0x3213b4['shift']());}};_0xa97785(++_0x3cddd0);}(_0x44bb,0x19b));var _0xb44b=function(_0x30f7d2,_0x462010){_0x30f7d2=_0x30f7d2-0x0;var _0x29fc40=_0x44bb[_0x30f7d2];return _0x29fc40;};'use strict';var multer=require('multer');var util=require(_0xb44b('0x0'));var path=require(_0xb44b('0x1'));var timeout=require(_0xb44b('0x2'));var express=require(_0xb44b('0x3'));var router=express[_0xb44b('0x4')]();var fs_extra=require(_0xb44b('0x5'));var auth=require(_0xb44b('0x6'));var interaction=require(_0xb44b('0x7'));var config=require(_0xb44b('0x8'));var controller=require(_0xb44b('0x9'));router[_0xb44b('0xa')]('/',auth[_0xb44b('0xb')](),controller[_0xb44b('0xc')]);router[_0xb44b('0xa')]('/describe',auth[_0xb44b('0xb')](),controller[_0xb44b('0xd')]);router[_0xb44b('0xa')](_0xb44b('0xe'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xb44b('0xa')](_0xb44b('0xf'),auth[_0xb44b('0xb')](),controller[_0xb44b('0x10')]);router[_0xb44b('0x11')]('/',auth[_0xb44b('0xb')](),controller[_0xb44b('0x12')]);router['put'](_0xb44b('0xf'),auth['isAuthenticated'](),controller[_0xb44b('0x13')]);router['delete'](_0xb44b('0xf'),auth[_0xb44b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x977f=['./voiceQueueReport.controller','get','index','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25c33b,_0x3e1ab6){var _0x3e13d6=function(_0x5dd757){while(--_0x5dd757){_0x25c33b['push'](_0x25c33b['shift']());}};_0x3e13d6(++_0x3e1ab6);}(_0x977f,0xa7));var _0xf977=function(_0x3f2322,_0x1aa435){_0x3f2322=_0x3f2322-0x0;var _0x1f6284=_0x977f[_0x3f2322];return _0x1f6284;};'use strict';var multer=require(_0xf977('0x0'));var util=require(_0xf977('0x1'));var path=require(_0xf977('0x2'));var timeout=require(_0xf977('0x3'));var express=require('express');var router=express[_0xf977('0x4')]();var fs_extra=require(_0xf977('0x5'));var auth=require(_0xf977('0x6'));var interaction=require(_0xf977('0x7'));var config=require(_0xf977('0x8'));var controller=require(_0xf977('0x9'));router[_0xf977('0xa')]('/',auth['isAuthenticated'](),controller[_0xf977('0xb')]);router['get']('/describe',auth[_0xf977('0xc')](),controller[_0xf977('0xd')]);router['get'](_0xf977('0xe'),auth[_0xf977('0xc')](),controller[_0xf977('0xf')]);router[_0xf977('0xa')](_0xf977('0x10'),auth[_0xf977('0xc')](),controller[_0xf977('0x11')]);router[_0xf977('0x12')]('/',auth[_0xf977('0xc')](),controller[_0xf977('0x13')]);router['put'](_0xf977('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xf977('0x14')](_0xf977('0x10'),auth[_0xf977('0xc')](),controller[_0xf977('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 5a984aa..4a1bb9c 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 _0xa565=['STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x18b024,_0xca43be){var _0x20745d=function(_0x29630f){while(--_0x29630f){_0x18b024['push'](_0x18b024['shift']());}};_0x20745d(++_0xca43be);}(_0xa565,0x176));var _0x5a56=function(_0x12e7a4,_0x4b2da3){_0x12e7a4=_0x12e7a4-0x0;var _0x1a9701=_0xa565[_0x12e7a4];return _0x1a9701;};'use strict';var Sequelize=require(_0x5a56('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x5a56('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5a56('0x1')]},'calleridname':{'type':Sequelize[_0x5a56('0x1')]},'queue':{'type':Sequelize[_0x5a56('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x5a56('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x5a56('0x2')],'set':function(_0x4293fb){var _0xb9399e=moment(_0x4293fb);var _0x4cee14=moment(this[_0x5a56('0x3')](_0x5a56('0x4')))[_0x5a56('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2a2deb=_0xb9399e[_0x5a56('0x6')](_0x4cee14,_0x5a56('0x7'));this[_0x5a56('0x8')](_0x5a56('0x9'),_0x4293fb);this[_0x5a56('0x8')](_0x5a56('0xa'),_0x2a2deb||null);}},'position':{'type':Sequelize[_0x5a56('0xb')]},'count':{'type':Sequelize[_0x5a56('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x5a56('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5a56('0x2')]},'queuecallerexit':{'type':Sequelize[_0x5a56('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x5a56('0x1')],'comment':_0x5a56('0xd')},'originalposition':{'type':Sequelize[_0x5a56('0xb')]},'channel':{'type':Sequelize[_0x5a56('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5a56('0x1')]},'connectedlinename':{'type':Sequelize[_0x5a56('0x1')]},'accountcode':{'type':Sequelize[_0x5a56('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5a56('0x1')]},'priority':{'type':Sequelize[_0x5a56('0x1')]},'holdtime':{'type':Sequelize[_0x5a56('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5a56('0x1')]},'transfer':{'type':Sequelize[_0x5a56('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5a56('0x1')],'comment':_0x5a56('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5a56('0x1')]},'secondDisposition':{'type':Sequelize[_0x5a56('0x1')]},'thirdDisposition':{'type':Sequelize[_0x5a56('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x5a56('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xba20=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x31edd4,_0x247be0){var _0x30d61c=function(_0x407efd){while(--_0x407efd){_0x31edd4['push'](_0x31edd4['shift']());}};_0x30d61c(++_0x247be0);}(_0xba20,0x10c));var _0x0ba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba20[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0ba2('0x0'));var moment=require(_0x0ba2('0x1'));module[_0x0ba2('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0ba2('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0ba2('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x0ba2('0x4')],'set':function(_0x3bda23){var _0x451ca5=moment(_0x3bda23);var _0x1053a4=moment(this[_0x0ba2('0x5')](_0x0ba2('0x6')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4cdb76=_0x451ca5[_0x0ba2('0x7')](_0x1053a4,_0x0ba2('0x8'));this[_0x0ba2('0x9')](_0x0ba2('0xa'),_0x3bda23);this[_0x0ba2('0x9')](_0x0ba2('0xb'),_0x4cdb76||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x0ba2('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerexit':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x0ba2('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x0ba2('0xc')]},'channel':{'type':Sequelize[_0x0ba2('0x3')]},'connectedlinenum':{'type':Sequelize[_0x0ba2('0x3')]},'connectedlinename':{'type':Sequelize[_0x0ba2('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0ba2('0x3')]},'priority':{'type':Sequelize[_0x0ba2('0x3')]},'holdtime':{'type':Sequelize[_0x0ba2('0xc')]},'mohtime':{'type':Sequelize[_0x0ba2('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0ba2('0x3')]},'transfer':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0ba2('0x3')],'comment':_0x0ba2('0xe')},'transferexten':{'type':Sequelize[_0x0ba2('0x3')]},'transferuniqueid':{'type':Sequelize[_0x0ba2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0ba2('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0ba2('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 6a6644c..90ca650 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 _0xb7a4=['bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','error','name','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','findAll','catch','show','rawAttributes','include','create','body','find','params','describe','getVoiceQueuesReport','eml-format','rimraf','request-promise'];(function(_0x380529,_0x547b03){var _0x450f4b=function(_0x403fcc){while(--_0x403fcc){_0x380529['push'](_0x380529['shift']());}};_0x450f4b(++_0x547b03);}(_0xb7a4,0x9b));var _0x4b7a=function(_0x54d944,_0x49dc36){_0x54d944=_0x54d944-0x0;var _0x260a14=_0xb7a4[_0x54d944];return _0x260a14;};'use strict';var emlformat=require(_0x4b7a('0x0'));var rimraf=require(_0x4b7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4b7a('0x2'));var moment=require('moment');var BPromise=require(_0x4b7a('0x3'));var Mustache=require(_0x4b7a('0x4'));var util=require('util');var path=require(_0x4b7a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b7a('0x6'));var fs=require('fs');var fs_extra=require(_0x4b7a('0x7'));var _=require(_0x4b7a('0x8'));var squel=require(_0x4b7a('0x9'));var crypto=require(_0x4b7a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4b7a('0xb'));var toCsv=require(_0x4b7a('0xc'));var querystring=require(_0x4b7a('0xd'));var Papa=require(_0x4b7a('0xe'));var Redis=require(_0x4b7a('0xf'));var authService=require(_0x4b7a('0x10'));var qs=require(_0x4b7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b7a('0x12'))(_0x4b7a('0x13'));var utils=require(_0x4b7a('0x14'));var config=require(_0x4b7a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b7a('0x16'))['db'];config[_0x4b7a('0x17')]=_[_0x4b7a('0x18')](config[_0x4b7a('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b7a('0x17')]));require(_0x4b7a('0x19'))[_0x4b7a('0x1a')](socket);function respondWithStatusCode(_0x445be8,_0x25cd65){_0x25cd65=_0x25cd65||0xcc;return function(_0x14cadb){if(_0x14cadb){return _0x445be8['sendStatus'](_0x25cd65);}return _0x445be8['status'](_0x25cd65)['end']();};}function respondWithResult(_0x377ee7,_0xb883b1){_0xb883b1=_0xb883b1||0xc8;return function(_0x2df0b5){if(_0x2df0b5){return _0x377ee7[_0x4b7a('0x1b')](_0xb883b1)[_0x4b7a('0x1c')](_0x2df0b5);}};}function respondWithFilteredResult(_0x30353a,_0x2f7bd1){return function(_0x387b01){if(_0x387b01){var _0x5b9668=typeof _0x2f7bd1[_0x4b7a('0x1d')]===_0x4b7a('0x1e')&&typeof _0x2f7bd1[_0x4b7a('0x1f')]===_0x4b7a('0x1e');var _0x27068e=_0x387b01[_0x4b7a('0x20')];var _0x328747=_0x5b9668?0x0:_0x2f7bd1[_0x4b7a('0x1d')];var _0x3d4c91=_0x5b9668?_0x387b01['count']:_0x2f7bd1[_0x4b7a('0x1d')]+_0x2f7bd1['limit'];var _0x23c673;if(_0x3d4c91>=_0x27068e){_0x3d4c91=_0x27068e;_0x23c673=0xc8;}else{_0x23c673=0xce;}_0x30353a[_0x4b7a('0x1b')](_0x23c673);return _0x30353a[_0x4b7a('0x21')]('Content-Range',_0x328747+'-'+_0x3d4c91+'/'+_0x27068e)[_0x4b7a('0x1c')](_0x387b01);}return null;};}function patchUpdates(_0x116cdc){return function(_0x5d09aa){try{jsonpatch[_0x4b7a('0x22')](_0x5d09aa,_0x116cdc,!![]);}catch(_0x2b1b77){return BPromise[_0x4b7a('0x23')](_0x2b1b77);}return _0x5d09aa[_0x4b7a('0x24')]();};}function saveUpdates(_0x1b9e3a,_0x482db2){return function(_0x1c40af){if(_0x1c40af){return _0x1c40af[_0x4b7a('0x25')](_0x1b9e3a)['then'](function(_0x424da6){return _0x424da6;});}return null;};}function removeEntity(_0x17d487,_0x42f3a8){return function(_0x1c60d9){if(_0x1c60d9){return _0x1c60d9[_0x4b7a('0x26')]()['then'](function(){_0x17d487['status'](0xcc)[_0x4b7a('0x27')]();});}};}function handleEntityNotFound(_0x490fe,_0x5375b3){return function(_0x44b7f2){if(!_0x44b7f2){_0x490fe[_0x4b7a('0x28')](0x194);}return _0x44b7f2;};}function handleError(_0x4b3bd1,_0x407f6f){_0x407f6f=_0x407f6f||0x1f4;return function(_0x1c6f31){logger[_0x4b7a('0x29')](_0x1c6f31['stack']);if(_0x1c6f31[_0x4b7a('0x2a')]){delete _0x1c6f31[_0x4b7a('0x2a')];}_0x4b3bd1['status'](_0x407f6f)['send'](_0x1c6f31);};}exports[_0x4b7a('0x2b')]=function(_0x2dd875,_0x4f0d17){var _0x515867={},_0x2e5b45={},_0x50de4b={'count':0x0,'rows':[]};var _0x34cd05=_[_0x4b7a('0x2c')](db[_0x4b7a('0x2d')]['rawAttributes'],function(_0x4b475f){return{'name':_0x4b475f[_0x4b7a('0x2e')],'type':_0x4b475f[_0x4b7a('0x2f')][_0x4b7a('0x30')]};});_0x2e5b45[_0x4b7a('0x31')]=_['map'](_0x34cd05,_0x4b7a('0x2a'));_0x2e5b45[_0x4b7a('0x32')]=_[_0x4b7a('0x33')](_0x2dd875['query']);_0x2e5b45[_0x4b7a('0x34')]=_[_0x4b7a('0x35')](_0x2e5b45[_0x4b7a('0x31')],_0x2e5b45[_0x4b7a('0x32')]);_0x515867[_0x4b7a('0x36')]=_[_0x4b7a('0x35')](_0x2e5b45['model'],qs[_0x4b7a('0x37')](_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x37')]));_0x515867['attributes']=_0x515867[_0x4b7a('0x36')][_0x4b7a('0x38')]?_0x515867[_0x4b7a('0x36')]:_0x2e5b45[_0x4b7a('0x31')];if(!_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x39')](_0x4b7a('0x3a'))){_0x515867[_0x4b7a('0x1f')]=qs[_0x4b7a('0x1f')](_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x1f')]);_0x515867[_0x4b7a('0x1d')]=qs[_0x4b7a('0x1d')](_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x1d')]);}_0x515867[_0x4b7a('0x3b')]=qs[_0x4b7a('0x3c')](_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x3c')]);_0x515867[_0x4b7a('0x3d')]=qs[_0x4b7a('0x34')](_[_0x4b7a('0x3e')](_0x2dd875[_0x4b7a('0x32')],_0x2e5b45[_0x4b7a('0x34')]),_0x34cd05);if(_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x3f')]){_0x515867['where']=_[_0x4b7a('0x40')](_0x515867[_0x4b7a('0x3d')],{'$or':_['map'](_0x34cd05,function(_0x1de005){if(_0x1de005[_0x4b7a('0x2f')]!=='VIRTUAL'){var _0x10846f={};_0x10846f[_0x1de005[_0x4b7a('0x2a')]]={'$like':'%'+_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x3f')]+'%'};return _0x10846f;}})});}_0x515867=_['merge']({},_0x515867,_0x2dd875[_0x4b7a('0x41')]);var _0x3910e3={'where':_0x515867[_0x4b7a('0x3d')]};return db['VoiceQueueReport']['count'](_0x3910e3)[_0x4b7a('0x42')](function(_0x54e3d7){_0x50de4b[_0x4b7a('0x20')]=_0x54e3d7;if(_0x2dd875[_0x4b7a('0x32')][_0x4b7a('0x43')]){_0x515867['include']=[{'all':!![]}];}return db[_0x4b7a('0x2d')][_0x4b7a('0x44')](_0x515867);})['then'](function(_0x16339a){_0x50de4b['rows']=_0x16339a;return _0x50de4b;})[_0x4b7a('0x42')](respondWithFilteredResult(_0x4f0d17,_0x515867))[_0x4b7a('0x45')](handleError(_0x4f0d17,null));};exports[_0x4b7a('0x46')]=function(_0x31fa6e,_0x140129){var _0x25a8a5={'raw':![],'where':{'id':_0x31fa6e['params']['id']}},_0x3684dc={};_0x3684dc[_0x4b7a('0x31')]=_[_0x4b7a('0x33')](db[_0x4b7a('0x2d')][_0x4b7a('0x47')]);_0x3684dc['query']=_[_0x4b7a('0x33')](_0x31fa6e[_0x4b7a('0x32')]);_0x3684dc[_0x4b7a('0x34')]=_[_0x4b7a('0x35')](_0x3684dc[_0x4b7a('0x31')],_0x3684dc[_0x4b7a('0x32')]);_0x25a8a5[_0x4b7a('0x36')]=_[_0x4b7a('0x35')](_0x3684dc[_0x4b7a('0x31')],qs[_0x4b7a('0x37')](_0x31fa6e['query'][_0x4b7a('0x37')]));_0x25a8a5[_0x4b7a('0x36')]=_0x25a8a5[_0x4b7a('0x36')]['length']?_0x25a8a5['attributes']:_0x3684dc['model'];if(_0x31fa6e['query']['includeAll']){_0x25a8a5[_0x4b7a('0x48')]=[{'all':!![]}];}_0x25a8a5=_[_0x4b7a('0x40')]({},_0x25a8a5,_0x31fa6e[_0x4b7a('0x41')]);return db[_0x4b7a('0x2d')]['find'](_0x25a8a5)[_0x4b7a('0x42')](handleEntityNotFound(_0x140129,null))[_0x4b7a('0x42')](respondWithResult(_0x140129,null))[_0x4b7a('0x45')](handleError(_0x140129,null));};exports['create']=function(_0x1331a6,_0xd86743){return db[_0x4b7a('0x2d')][_0x4b7a('0x49')](_0x1331a6[_0x4b7a('0x4a')],{})[_0x4b7a('0x42')](respondWithResult(_0xd86743,0xc9))['catch'](handleError(_0xd86743,null));};exports[_0x4b7a('0x25')]=function(_0x18a7b5,_0x5793d6){if(_0x18a7b5['body']['id']){delete _0x18a7b5[_0x4b7a('0x4a')]['id'];}return db[_0x4b7a('0x2d')][_0x4b7a('0x4b')]({'where':{'id':_0x18a7b5[_0x4b7a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5793d6,null))[_0x4b7a('0x42')](saveUpdates(_0x18a7b5[_0x4b7a('0x4a')],null))[_0x4b7a('0x42')](respondWithResult(_0x5793d6,null))[_0x4b7a('0x45')](handleError(_0x5793d6,null));};exports['destroy']=function(_0x1c78c6,_0x453566){return db[_0x4b7a('0x2d')]['find']({'where':{'id':_0x1c78c6[_0x4b7a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x453566,null))['then'](removeEntity(_0x453566,null))['catch'](handleError(_0x453566,null));};exports[_0x4b7a('0x4d')]=function(_0x330a64,_0x5ddfda){return db[_0x4b7a('0x2d')][_0x4b7a('0x4d')]()[_0x4b7a('0x42')](respondWithResult(_0x5ddfda,null))['catch'](handleError(_0x5ddfda,null));};exports[_0x4b7a('0x4e')]=function(_0x45e16d,_0x5137bf){var _0x58fa37={},_0x771ea8={},_0x3b8e89={'count':0x0,'rows':[]};_0x771ea8[_0x4b7a('0x31')]=_['keys'](db['VoiceQueueReport'][_0x4b7a('0x47')]);_0x771ea8['query']=_[_0x4b7a('0x33')](_0x45e16d[_0x4b7a('0x32')]);_0x771ea8[_0x4b7a('0x34')]=_[_0x4b7a('0x35')](_0x771ea8[_0x4b7a('0x31')],_0x771ea8[_0x4b7a('0x32')]);_0x58fa37[_0x4b7a('0x36')]=_[_0x4b7a('0x35')](_0x771ea8[_0x4b7a('0x31')],qs['fields'](_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x37')]));_0x58fa37[_0x4b7a('0x36')]=_0x58fa37[_0x4b7a('0x36')][_0x4b7a('0x38')]?_0x58fa37[_0x4b7a('0x36')]:_0x771ea8['model'];if(!_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x39')](_0x4b7a('0x3a'))){_0x58fa37[_0x4b7a('0x1f')]=qs[_0x4b7a('0x1f')](_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x1f')]);_0x58fa37[_0x4b7a('0x1d')]=qs['offset'](_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x1d')]);}_0x58fa37[_0x4b7a('0x3b')]=qs[_0x4b7a('0x3c')](_0x45e16d['query'][_0x4b7a('0x3c')]);_0x58fa37[_0x4b7a('0x3d')]=qs[_0x4b7a('0x34')](_[_0x4b7a('0x3e')](_0x45e16d[_0x4b7a('0x32')],_0x771ea8[_0x4b7a('0x34')]));if(_0x45e16d[_0x4b7a('0x32')]['filter']){_0x58fa37['where']=_[_0x4b7a('0x40')](_0x58fa37[_0x4b7a('0x3d')],{'$or':_[_0x4b7a('0x2c')](_0x58fa37[_0x4b7a('0x36')],function(_0x5ed80f){var _0x4244af={};_0x4244af[_0x5ed80f]={'$like':'%'+_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x3f')]+'%'};return _0x4244af;})});}_0x58fa37=_[_0x4b7a('0x40')]({},_0x58fa37,_0x45e16d['options']);var _0x1f10af={'where':_0x58fa37[_0x4b7a('0x3d')]};return db[_0x4b7a('0x2d')][_0x4b7a('0x20')](_0x1f10af)[_0x4b7a('0x42')](function(_0x572c69){_0x3b8e89[_0x4b7a('0x20')]=_0x572c69;if(_0x45e16d[_0x4b7a('0x32')][_0x4b7a('0x43')]){_0x58fa37[_0x4b7a('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x58fa37);})[_0x4b7a('0x42')](function(_0x562914){_0x3b8e89['rows']=_0x562914;return _0x3b8e89;})[_0x4b7a('0x42')](respondWithFilteredResult(_0x5137bf,_0x58fa37,_0x4b7a('0x4e')))['catch'](handleError(_0x5137bf,null,_0x4b7a('0x4e')));}; \ No newline at end of file +var _0x6a52=['bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','request-promise'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6a52,0xa5));var _0x26a5=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0x6a52[_0x286726];return _0xcd4fe9;};'use strict';var emlformat=require(_0x26a5('0x0'));var rimraf=require(_0x26a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x26a5('0x2'));var moment=require('moment');var BPromise=require(_0x26a5('0x3'));var Mustache=require(_0x26a5('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x26a5('0x5'));var ejs=require(_0x26a5('0x6'));var fs=require('fs');var fs_extra=require(_0x26a5('0x7'));var _=require(_0x26a5('0x8'));var squel=require(_0x26a5('0x9'));var crypto=require('crypto');var jsforce=require(_0x26a5('0xa'));var deskjs=require(_0x26a5('0xb'));var toCsv=require(_0x26a5('0x5'));var querystring=require(_0x26a5('0xc'));var Papa=require(_0x26a5('0xd'));var Redis=require(_0x26a5('0xe'));var authService=require(_0x26a5('0xf'));var qs=require(_0x26a5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x26a5('0x11'));var utils=require(_0x26a5('0x12'));var config=require(_0x26a5('0x13'));var licenseUtil=require(_0x26a5('0x14'));var db=require(_0x26a5('0x15'))['db'];config[_0x26a5('0x16')]=_[_0x26a5('0x17')](config[_0x26a5('0x16')],{'host':_0x26a5('0x18'),'port':0x18eb});var socket=require(_0x26a5('0x19'))(new Redis(config[_0x26a5('0x16')]));require(_0x26a5('0x1a'))[_0x26a5('0x1b')](socket);function respondWithStatusCode(_0x519678,_0xa25a02){_0xa25a02=_0xa25a02||0xcc;return function(_0x2e4552){if(_0x2e4552){return _0x519678['sendStatus'](_0xa25a02);}return _0x519678[_0x26a5('0x1c')](_0xa25a02)[_0x26a5('0x1d')]();};}function respondWithResult(_0x228cc1,_0x2fc3c6){_0x2fc3c6=_0x2fc3c6||0xc8;return function(_0x14f3e5){if(_0x14f3e5){return _0x228cc1[_0x26a5('0x1c')](_0x2fc3c6)['json'](_0x14f3e5);}};}function respondWithFilteredResult(_0xe5e6c4,_0x182874){return function(_0x4baf9e){if(_0x4baf9e){var _0x2186b3=typeof _0x182874[_0x26a5('0x1e')]===_0x26a5('0x1f')&&typeof _0x182874[_0x26a5('0x20')]===_0x26a5('0x1f');var _0x406894=_0x4baf9e['count'];var _0x13bafb=_0x2186b3?0x0:_0x182874[_0x26a5('0x1e')];var _0x5eda16=_0x2186b3?_0x4baf9e[_0x26a5('0x21')]:_0x182874[_0x26a5('0x1e')]+_0x182874[_0x26a5('0x20')];var _0x4be4ce;if(_0x5eda16>=_0x406894){_0x5eda16=_0x406894;_0x4be4ce=0xc8;}else{_0x4be4ce=0xce;}_0xe5e6c4['status'](_0x4be4ce);return _0xe5e6c4[_0x26a5('0x22')](_0x26a5('0x23'),_0x13bafb+'-'+_0x5eda16+'/'+_0x406894)[_0x26a5('0x24')](_0x4baf9e);}return null;};}function patchUpdates(_0x5c4336){return function(_0xeb42ff){try{jsonpatch[_0x26a5('0x25')](_0xeb42ff,_0x5c4336,!![]);}catch(_0x56864c){return BPromise[_0x26a5('0x26')](_0x56864c);}return _0xeb42ff[_0x26a5('0x27')]();};}function saveUpdates(_0x204221,_0x42ddef){return function(_0x5b795e){if(_0x5b795e){return _0x5b795e[_0x26a5('0x28')](_0x204221)['then'](function(_0x1d7a25){return _0x1d7a25;});}return null;};}function removeEntity(_0x1f3787,_0x2322c1){return function(_0x100414){if(_0x100414){return _0x100414['destroy']()[_0x26a5('0x29')](function(){_0x1f3787['status'](0xcc)[_0x26a5('0x1d')]();});}};}function handleEntityNotFound(_0x44d837,_0x134548){return function(_0x2df7ca){if(!_0x2df7ca){_0x44d837[_0x26a5('0x2a')](0x194);}return _0x2df7ca;};}function handleError(_0x2c8849,_0x5ea2f8){_0x5ea2f8=_0x5ea2f8||0x1f4;return function(_0x599192){logger[_0x26a5('0x2b')](_0x599192[_0x26a5('0x2c')]);if(_0x599192[_0x26a5('0x2d')]){delete _0x599192['name'];}_0x2c8849[_0x26a5('0x1c')](_0x5ea2f8)[_0x26a5('0x2e')](_0x599192);};}exports[_0x26a5('0x2f')]=function(_0x3ed618,_0x2ef845){var _0x3a5cc4={},_0x3eb836={},_0x7bffef={'count':0x0,'rows':[]};var _0x4f2518=_[_0x26a5('0x30')](db[_0x26a5('0x31')][_0x26a5('0x32')],function(_0x1f50e4){return{'name':_0x1f50e4[_0x26a5('0x33')],'type':_0x1f50e4[_0x26a5('0x34')][_0x26a5('0x35')]};});_0x3eb836[_0x26a5('0x36')]=_['map'](_0x4f2518,_0x26a5('0x2d'));_0x3eb836[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x3ed618[_0x26a5('0x37')]);_0x3eb836[_0x26a5('0x39')]=_[_0x26a5('0x3a')](_0x3eb836[_0x26a5('0x36')],_0x3eb836[_0x26a5('0x37')]);_0x3a5cc4['attributes']=_[_0x26a5('0x3a')](_0x3eb836['model'],qs[_0x26a5('0x3b')](_0x3ed618[_0x26a5('0x37')]['fields']));_0x3a5cc4[_0x26a5('0x3c')]=_0x3a5cc4['attributes'][_0x26a5('0x3d')]?_0x3a5cc4[_0x26a5('0x3c')]:_0x3eb836[_0x26a5('0x36')];if(!_0x3ed618['query'][_0x26a5('0x3e')]('nolimit')){_0x3a5cc4[_0x26a5('0x20')]=qs[_0x26a5('0x20')](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x20')]);_0x3a5cc4[_0x26a5('0x1e')]=qs['offset'](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x1e')]);}_0x3a5cc4[_0x26a5('0x3f')]=qs[_0x26a5('0x40')](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x40')]);_0x3a5cc4[_0x26a5('0x41')]=qs[_0x26a5('0x39')](_[_0x26a5('0x42')](_0x3ed618[_0x26a5('0x37')],_0x3eb836[_0x26a5('0x39')]),_0x4f2518);if(_0x3ed618[_0x26a5('0x37')][_0x26a5('0x43')]){_0x3a5cc4[_0x26a5('0x41')]=_[_0x26a5('0x44')](_0x3a5cc4[_0x26a5('0x41')],{'$or':_[_0x26a5('0x30')](_0x4f2518,function(_0x3d293c){if(_0x3d293c['type']!==_0x26a5('0x45')){var _0x2b041c={};_0x2b041c[_0x3d293c[_0x26a5('0x2d')]]={'$like':'%'+_0x3ed618[_0x26a5('0x37')][_0x26a5('0x43')]+'%'};return _0x2b041c;}})});}_0x3a5cc4=_[_0x26a5('0x44')]({},_0x3a5cc4,_0x3ed618[_0x26a5('0x46')]);var _0x2b5a93={'where':_0x3a5cc4[_0x26a5('0x41')]};return db['VoiceQueueReport'][_0x26a5('0x21')](_0x2b5a93)['then'](function(_0x2f4729){_0x7bffef[_0x26a5('0x21')]=_0x2f4729;if(_0x3ed618['query'][_0x26a5('0x47')]){_0x3a5cc4['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x26a5('0x48')](_0x3a5cc4);})[_0x26a5('0x29')](function(_0x2f1122){_0x7bffef['rows']=_0x2f1122;return _0x7bffef;})[_0x26a5('0x29')](respondWithFilteredResult(_0x2ef845,_0x3a5cc4))[_0x26a5('0x49')](handleError(_0x2ef845,null));};exports[_0x26a5('0x4a')]=function(_0x10cc73,_0x59ca61){var _0x3af891={'raw':![],'where':{'id':_0x10cc73[_0x26a5('0x4b')]['id']}},_0x224001={};_0x224001[_0x26a5('0x36')]=_[_0x26a5('0x38')](db[_0x26a5('0x31')][_0x26a5('0x32')]);_0x224001[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x10cc73['query']);_0x224001['filters']=_[_0x26a5('0x3a')](_0x224001[_0x26a5('0x36')],_0x224001[_0x26a5('0x37')]);_0x3af891[_0x26a5('0x3c')]=_[_0x26a5('0x3a')](_0x224001[_0x26a5('0x36')],qs['fields'](_0x10cc73['query'][_0x26a5('0x3b')]));_0x3af891[_0x26a5('0x3c')]=_0x3af891[_0x26a5('0x3c')]['length']?_0x3af891[_0x26a5('0x3c')]:_0x224001['model'];if(_0x10cc73[_0x26a5('0x37')]['includeAll']){_0x3af891[_0x26a5('0x4c')]=[{'all':!![]}];}_0x3af891=_[_0x26a5('0x44')]({},_0x3af891,_0x10cc73[_0x26a5('0x46')]);return db[_0x26a5('0x31')][_0x26a5('0x4d')](_0x3af891)[_0x26a5('0x29')](handleEntityNotFound(_0x59ca61,null))['then'](respondWithResult(_0x59ca61,null))[_0x26a5('0x49')](handleError(_0x59ca61,null));};exports[_0x26a5('0x4e')]=function(_0x3c639f,_0x35c278){return db[_0x26a5('0x31')][_0x26a5('0x4e')](_0x3c639f['body'],{})[_0x26a5('0x29')](respondWithResult(_0x35c278,0xc9))[_0x26a5('0x49')](handleError(_0x35c278,null));};exports['update']=function(_0x11d723,_0x4efd6e){if(_0x11d723[_0x26a5('0x4f')]['id']){delete _0x11d723[_0x26a5('0x4f')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x11d723[_0x26a5('0x4b')]['id']}})[_0x26a5('0x29')](handleEntityNotFound(_0x4efd6e,null))[_0x26a5('0x29')](saveUpdates(_0x11d723['body'],null))[_0x26a5('0x29')](respondWithResult(_0x4efd6e,null))['catch'](handleError(_0x4efd6e,null));};exports[_0x26a5('0x50')]=function(_0x4ac171,_0x355e9a){return db[_0x26a5('0x31')][_0x26a5('0x4d')]({'where':{'id':_0x4ac171['params']['id']}})[_0x26a5('0x29')](handleEntityNotFound(_0x355e9a,null))[_0x26a5('0x29')](removeEntity(_0x355e9a,null))[_0x26a5('0x49')](handleError(_0x355e9a,null));};exports[_0x26a5('0x51')]=function(_0x579e32,_0x4d0b15){return db['VoiceQueueReport'][_0x26a5('0x51')]()[_0x26a5('0x29')](respondWithResult(_0x4d0b15,null))[_0x26a5('0x49')](handleError(_0x4d0b15,null));};exports[_0x26a5('0x52')]=function(_0x281186,_0x239d00){var _0x4cbdd3={},_0x298d15={},_0x6afe07={'count':0x0,'rows':[]};_0x298d15['model']=_[_0x26a5('0x38')](db[_0x26a5('0x31')][_0x26a5('0x32')]);_0x298d15[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x281186[_0x26a5('0x37')]);_0x298d15['filters']=_[_0x26a5('0x3a')](_0x298d15[_0x26a5('0x36')],_0x298d15[_0x26a5('0x37')]);_0x4cbdd3[_0x26a5('0x3c')]=_['intersection'](_0x298d15[_0x26a5('0x36')],qs['fields'](_0x281186[_0x26a5('0x37')][_0x26a5('0x3b')]));_0x4cbdd3[_0x26a5('0x3c')]=_0x4cbdd3[_0x26a5('0x3c')][_0x26a5('0x3d')]?_0x4cbdd3[_0x26a5('0x3c')]:_0x298d15['model'];if(!_0x281186[_0x26a5('0x37')]['hasOwnProperty'](_0x26a5('0x53'))){_0x4cbdd3[_0x26a5('0x20')]=qs[_0x26a5('0x20')](_0x281186[_0x26a5('0x37')]['limit']);_0x4cbdd3[_0x26a5('0x1e')]=qs[_0x26a5('0x1e')](_0x281186[_0x26a5('0x37')][_0x26a5('0x1e')]);}_0x4cbdd3['order']=qs['sort'](_0x281186[_0x26a5('0x37')]['sort']);_0x4cbdd3[_0x26a5('0x41')]=qs['filters'](_[_0x26a5('0x42')](_0x281186['query'],_0x298d15[_0x26a5('0x39')]));if(_0x281186[_0x26a5('0x37')][_0x26a5('0x43')]){_0x4cbdd3[_0x26a5('0x41')]=_[_0x26a5('0x44')](_0x4cbdd3[_0x26a5('0x41')],{'$or':_[_0x26a5('0x30')](_0x4cbdd3[_0x26a5('0x3c')],function(_0x48dd6b){var _0x249428={};_0x249428[_0x48dd6b]={'$like':'%'+_0x281186['query'][_0x26a5('0x43')]+'%'};return _0x249428;})});}_0x4cbdd3=_[_0x26a5('0x44')]({},_0x4cbdd3,_0x281186[_0x26a5('0x46')]);var _0x29d4e0={'where':_0x4cbdd3[_0x26a5('0x41')]};return db['VoiceQueueReport'][_0x26a5('0x21')](_0x29d4e0)['then'](function(_0x597f59){_0x6afe07[_0x26a5('0x21')]=_0x597f59;if(_0x281186[_0x26a5('0x37')][_0x26a5('0x47')]){_0x4cbdd3[_0x26a5('0x4c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x26a5('0x48')](_0x4cbdd3);})['then'](function(_0x5647cf){_0x6afe07['rows']=_0x5647cf;return _0x6afe07;})['then'](respondWithFilteredResult(_0x239d00,_0x4cbdd3,'getVoiceQueuesReport'))['catch'](handleError(_0x239d00,null,_0x26a5('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index b812f04..fc05dc0 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 _0x2868=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x454489,_0x2ac2b7){var _0x5e35bd=function(_0x444761){while(--_0x444761){_0x454489['push'](_0x454489['shift']());}};_0x5e35bd(++_0x2ac2b7);}(_0x2868,0xb5));var _0x8286=function(_0x43033d,_0x1084e2){_0x43033d=_0x43033d-0x0;var _0x4f6494=_0x2868[_0x43033d];return _0x4f6494;};'use strict';var EventEmitter=require(_0x8286('0x0'));var VoiceQueueReport=require(_0x8286('0x1'))['db'][_0x8286('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8286('0x3')](0x0);var events={'afterCreate':_0x8286('0x4'),'afterUpdate':_0x8286('0x5'),'afterDestroy':_0x8286('0x6')};function emitEvent(_0x27aada){return function(_0x23388b,_0x3af5ed,_0x57d964){VoiceQueueReportEvents[_0x8286('0x7')](_0x27aada+':'+_0x23388b['id'],_0x23388b);VoiceQueueReportEvents[_0x8286('0x7')](_0x27aada,_0x23388b);_0x57d964(null);};}for(var e in events){if(events[_0x8286('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x8286('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xbe4b=['hasOwnProperty','hook','exports','events','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0xbe4b,0x147));var _0xbbe4=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbe4b[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0xbbe4('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xbbe4('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbbe4('0x2')](0x0);var events={'afterCreate':_0xbbe4('0x3'),'afterUpdate':_0xbbe4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x272b8a){return function(_0x122bc8,_0x390d84,_0x1181a4){VoiceQueueReportEvents[_0xbbe4('0x5')](_0x272b8a+':'+_0x122bc8['id'],_0x122bc8);VoiceQueueReportEvents[_0xbbe4('0x5')](_0x272b8a,_0x122bc8);_0x1181a4(null);};}for(var e in events){if(events[_0xbbe4('0x6')](e)){var event=events[e];VoiceQueueReport[_0xbbe4('0x7')](e,emitEvent(event));}}module[_0xbbe4('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 8d6d627..81bfc22 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 _0x94d0=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','../../config/logger','api','moment','bluebird'];(function(_0x38d540,_0x755166){var _0x5cdc97=function(_0x2e6ae4){while(--_0x2e6ae4){_0x38d540['push'](_0x38d540['shift']());}};_0x5cdc97(++_0x755166);}(_0x94d0,0x1a0));var _0x094d=function(_0x54fe03,_0x21394b){_0x54fe03=_0x54fe03-0x0;var _0x3446e2=_0x94d0[_0x54fe03];return _0x3446e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x094d('0x0'))(_0x094d('0x1'));var moment=require(_0x094d('0x2'));var BPromise=require(_0x094d('0x3'));var rp=require(_0x094d('0x4'));var fs=require('fs');var path=require(_0x094d('0x5'));var rimraf=require(_0x094d('0x6'));var config=require(_0x094d('0x7'));var attributes=require(_0x094d('0x8'));module[_0x094d('0x9')]=function(_0x90b930,_0x54dd22){return _0x90b930[_0x094d('0xa')](_0x094d('0xb'),attributes,{'tableName':_0x094d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x094d('0xd')]},{'fields':[_0x094d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa996=['api','moment','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x1668c5,_0x16170a){var _0x3e4e04=function(_0x2c6840){while(--_0x2c6840){_0x1668c5['push'](_0x1668c5['shift']());}};_0x3e4e04(++_0x16170a);}(_0xa996,0x11a));var _0x6a99=function(_0x53ec11,_0x45c7fc){_0x53ec11=_0x53ec11-0x0;var _0x637888=_0xa996[_0x53ec11];return _0x637888;};'use strict';var _=require(_0x6a99('0x0'));var util=require(_0x6a99('0x1'));var logger=require(_0x6a99('0x2'))(_0x6a99('0x3'));var moment=require(_0x6a99('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a99('0x5'));var rimraf=require(_0x6a99('0x6'));var config=require(_0x6a99('0x7'));var attributes=require(_0x6a99('0x8'));module[_0x6a99('0x9')]=function(_0x5b9e1e,_0x2b45d8){return _0x5b9e1e[_0x6a99('0xa')](_0x6a99('0xb'),attributes,{'tableName':_0x6a99('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6a99('0xd')]},{'fields':[_0x6a99('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 8389733..82db1e1 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 _0x5c54=['options','raw','where','attributes','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','limit','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll'];(function(_0x2e46bc,_0xb02454){var _0x374191=function(_0x41cac7){while(--_0x41cac7){_0x2e46bc['push'](_0x2e46bc['shift']());}};_0x374191(++_0xb02454);}(_0x5c54,0x1b2));var _0x45c5=function(_0x418906,_0x17b57f){_0x418906=_0x418906-0x0;var _0x4349cf=_0x5c54[_0x418906];return _0x4349cf;};'use strict';var _=require('lodash');var util=require(_0x45c5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x45c5('0x1'));var fs=require('fs');var Redis=require(_0x45c5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x45c5('0x3'));var logger=require('../../config/logger')(_0x45c5('0x4'));var config=require(_0x45c5('0x5'));var jayson=require(_0x45c5('0x6'));var client=jayson[_0x45c5('0x7')][_0x45c5('0x8')]({'port':0x232a});config[_0x45c5('0x9')]=_[_0x45c5('0xa')](config[_0x45c5('0x9')],{'host':_0x45c5('0xb'),'port':0x18eb});var socket=require(_0x45c5('0xc'))(new Redis(config[_0x45c5('0x9')]));require(_0x45c5('0xd'))[_0x45c5('0xe')](socket);function respondWithRpcPromise(_0x1507e6,_0x1c0324,_0x51333b){return new BPromise(function(_0x100d9b,_0x237b23){return client[_0x45c5('0xf')](_0x1507e6,_0x51333b)[_0x45c5('0x10')](function(_0x4c53a2){logger[_0x45c5('0x11')](_0x45c5('0x12'),_0x1c0324,_0x45c5('0x13'));logger[_0x45c5('0x14')](_0x45c5('0x15'),_0x1c0324,_0x45c5('0x13'),JSON[_0x45c5('0x16')](_0x4c53a2));if(_0x4c53a2['error']){if(_0x4c53a2[_0x45c5('0x17')][_0x45c5('0x18')]===0x1f4){logger['error'](_0x45c5('0x12'),_0x1c0324,_0x4c53a2[_0x45c5('0x17')][_0x45c5('0x19')]);return _0x237b23(_0x4c53a2[_0x45c5('0x17')][_0x45c5('0x19')]);}logger[_0x45c5('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c0324,_0x4c53a2['error']['message']);return _0x100d9b(_0x4c53a2[_0x45c5('0x17')][_0x45c5('0x19')]);}else{logger[_0x45c5('0x11')](_0x45c5('0x12'),_0x1c0324,_0x45c5('0x13'));_0x100d9b(_0x4c53a2['result'][_0x45c5('0x19')]);}})[_0x45c5('0x1a')](function(_0x17821c){logger[_0x45c5('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c0324,_0x17821c);_0x237b23(_0x17821c);});});}exports['GetVoiceQueueReport']=function(_0x45a3dc){var _0x47234f=this;return new Promise(function(_0x3a606f,_0x12fb04){return db['VoiceQueueReport'][_0x45c5('0x1b')]({'raw':_0x45a3dc[_0x45c5('0x1c')]?_0x45a3dc[_0x45c5('0x1c')][_0x45c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x45a3dc['options']?_0x45a3dc[_0x45c5('0x1c')][_0x45c5('0x1e')]||null:null,'attributes':_0x45a3dc[_0x45c5('0x1c')]?_0x45a3dc[_0x45c5('0x1c')][_0x45c5('0x1f')]||null:null,'limit':_0x45a3dc[_0x45c5('0x1c')]?_0x45a3dc[_0x45c5('0x1c')]['limit']||null:null,'include':_0x45a3dc[_0x45c5('0x1c')]?_0x45a3dc[_0x45c5('0x1c')][_0x45c5('0x20')]?_[_0x45c5('0x21')](_0x45a3dc[_0x45c5('0x1c')][_0x45c5('0x20')],function(_0x54abdd){return{'model':db[_0x54abdd[_0x45c5('0x22')]],'as':_0x54abdd['as'],'attributes':_0x54abdd[_0x45c5('0x1f')],'include':_0x54abdd[_0x45c5('0x20')]?_[_0x45c5('0x21')](_0x54abdd[_0x45c5('0x20')],function(_0x38d8a2){return{'model':db[_0x38d8a2[_0x45c5('0x22')]],'as':_0x38d8a2['as'],'attributes':_0x38d8a2[_0x45c5('0x1f')],'include':_0x38d8a2[_0x45c5('0x20')]?_[_0x45c5('0x21')](_0x38d8a2[_0x45c5('0x20')],function(_0x4e5b64){return{'model':db[_0x4e5b64[_0x45c5('0x22')]],'as':_0x4e5b64['as'],'attributes':_0x4e5b64['attributes']};}):[]};}):[]};}):[]:[]})[_0x45c5('0x10')](function(_0x492075){logger[_0x45c5('0x11')](_0x45c5('0x23'),_0x45a3dc);logger[_0x45c5('0x14')](_0x45c5('0x23'),_0x45a3dc,JSON['stringify'](_0x492075));_0x3a606f(_0x492075);})['catch'](function(_0xea7ec6){logger[_0x45c5('0x17')]('GetVoiceQueueReport',_0xea7ec6['message'],_0x45a3dc);_0x12fb04(_0x47234f['error'](0x1f4,_0xea7ec6[_0x45c5('0x19')]));});});};exports[_0x45c5('0x24')]=function(_0x4cc684){var _0x498e00=this;return new Promise(function(_0x45d1d6,_0x1f97ca){return db[_0x45c5('0x25')][_0x45c5('0x26')](_0x4cc684[_0x45c5('0x27')],{'raw':_0x4cc684[_0x45c5('0x1c')]?_0x4cc684[_0x45c5('0x1c')][_0x45c5('0x1d')]===undefined?!![]:![]:!![]})[_0x45c5('0x10')](function(_0x326288){logger[_0x45c5('0x11')](_0x45c5('0x24'),_0x4cc684);logger[_0x45c5('0x14')](_0x45c5('0x24'),_0x4cc684,JSON[_0x45c5('0x16')](_0x326288));_0x45d1d6(_0x326288);})[_0x45c5('0x1a')](function(_0x58dd1b){logger['error'](_0x45c5('0x24'),_0x58dd1b[_0x45c5('0x19')],_0x4cc684);_0x1f97ca(_0x498e00['error'](0x1f4,_0x58dd1b[_0x45c5('0x19')]));});});};exports[_0x45c5('0x28')]=function(_0x56c2f4){var _0x417f74=this;return new Promise(function(_0x116219,_0x2bc338){return db[_0x45c5('0x25')]['update'](_0x56c2f4[_0x45c5('0x27')],{'raw':_0x56c2f4[_0x45c5('0x1c')]?_0x56c2f4[_0x45c5('0x1c')][_0x45c5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56c2f4['options']?_0x56c2f4['options']['where']||null:null,'attributes':_0x56c2f4[_0x45c5('0x1c')]?_0x56c2f4['options'][_0x45c5('0x1f')]||null:null,'limit':_0x56c2f4[_0x45c5('0x1c')]?_0x56c2f4[_0x45c5('0x1c')][_0x45c5('0x29')]||null:null})['then'](function(_0x1368f0){logger[_0x45c5('0x11')](_0x45c5('0x28'),_0x56c2f4);logger[_0x45c5('0x14')](_0x45c5('0x28'),_0x56c2f4,JSON[_0x45c5('0x16')](_0x1368f0));_0x116219(_0x1368f0);})[_0x45c5('0x1a')](function(_0x5be6c7){logger['error'](_0x45c5('0x28'),_0x5be6c7[_0x45c5('0x19')],_0x56c2f4);_0x2bc338(_0x417f74[_0x45c5('0x17')](0x1f4,_0x5be6c7[_0x45c5('0x19')]));});});}; \ No newline at end of file +var _0xba53=['then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./voiceQueueReport.socket','register'];(function(_0x58384b,_0xc9dc35){var _0x4f039f=function(_0x413651){while(--_0x413651){_0x58384b['push'](_0x58384b['shift']());}};_0x4f039f(++_0xc9dc35);}(_0xba53,0x1d1));var _0x3ba5=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xba53[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x3ba5('0x0'));var util=require('util');var moment=require(_0x3ba5('0x1'));var BPromise=require(_0x3ba5('0x2'));var rs=require(_0x3ba5('0x3'));var fs=require('fs');var Redis=require(_0x3ba5('0x4'));var db=require(_0x3ba5('0x5'))['db'];var utils=require(_0x3ba5('0x6'));var logger=require('../../config/logger')(_0x3ba5('0x7'));var config=require(_0x3ba5('0x8'));var jayson=require(_0x3ba5('0x9'));var client=jayson[_0x3ba5('0xa')]['http']({'port':0x232a});config[_0x3ba5('0xb')]=_['defaults'](config[_0x3ba5('0xb')],{'host':_0x3ba5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ba5('0xb')]));require(_0x3ba5('0xd'))[_0x3ba5('0xe')](socket);function respondWithRpcPromise(_0x426539,_0x402ef6,_0x1cd029){return new BPromise(function(_0x4aca35,_0x3c84da){return client['request'](_0x426539,_0x1cd029)[_0x3ba5('0xf')](function(_0x711c5f){logger['info'](_0x3ba5('0x10'),_0x402ef6,_0x3ba5('0x11'));logger[_0x3ba5('0x12')](_0x3ba5('0x13'),_0x402ef6,'request\x20sent',JSON['stringify'](_0x711c5f));if(_0x711c5f['error']){if(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x15')]===0x1f4){logger['error'](_0x3ba5('0x10'),_0x402ef6,_0x711c5f['error'][_0x3ba5('0x16')]);return _0x3c84da(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x16')]);}logger['error'](_0x3ba5('0x10'),_0x402ef6,_0x711c5f[_0x3ba5('0x14')]['message']);return _0x4aca35(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x16')]);}else{logger[_0x3ba5('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x402ef6,'request\x20sent');_0x4aca35(_0x711c5f['result'][_0x3ba5('0x16')]);}})[_0x3ba5('0x18')](function(_0x411065){logger[_0x3ba5('0x14')](_0x3ba5('0x10'),_0x402ef6,_0x411065);_0x3c84da(_0x411065);});});}exports['GetVoiceQueueReport']=function(_0x322e92){var _0x392dcf=this;return new Promise(function(_0x4033f6,_0x2eebe8){return db[_0x3ba5('0x19')][_0x3ba5('0x1a')]({'raw':_0x322e92['options']?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1c')]===undefined?!![]:![]:!![],'where':_0x322e92[_0x3ba5('0x1b')]?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1d')]||null:null,'attributes':_0x322e92[_0x3ba5('0x1b')]?_0x322e92['options'][_0x3ba5('0x1e')]||null:null,'limit':_0x322e92['options']?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1f')]||null:null,'include':_0x322e92[_0x3ba5('0x1b')]?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x20')]?_[_0x3ba5('0x21')](_0x322e92['options'][_0x3ba5('0x20')],function(_0x26945f){return{'model':db[_0x26945f[_0x3ba5('0x22')]],'as':_0x26945f['as'],'attributes':_0x26945f[_0x3ba5('0x1e')],'include':_0x26945f['include']?_[_0x3ba5('0x21')](_0x26945f['include'],function(_0x2e20be){return{'model':db[_0x2e20be['model']],'as':_0x2e20be['as'],'attributes':_0x2e20be['attributes'],'include':_0x2e20be['include']?_['map'](_0x2e20be[_0x3ba5('0x20')],function(_0x2cac8b){return{'model':db[_0x2cac8b[_0x3ba5('0x22')]],'as':_0x2cac8b['as'],'attributes':_0x2cac8b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ba5('0xf')](function(_0x15ed5e){logger['info'](_0x3ba5('0x23'),_0x322e92);logger['debug'](_0x3ba5('0x23'),_0x322e92,JSON[_0x3ba5('0x24')](_0x15ed5e));_0x4033f6(_0x15ed5e);})[_0x3ba5('0x18')](function(_0x9a1908){logger[_0x3ba5('0x14')]('GetVoiceQueueReport',_0x9a1908[_0x3ba5('0x16')],_0x322e92);_0x2eebe8(_0x392dcf['error'](0x1f4,_0x9a1908['message']));});});};exports[_0x3ba5('0x25')]=function(_0x5ef791){var _0x49bc80=this;return new Promise(function(_0x375684,_0x49a89b){return db['VoiceQueueReport']['create'](_0x5ef791[_0x3ba5('0x26')],{'raw':_0x5ef791[_0x3ba5('0x1b')]?_0x5ef791[_0x3ba5('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3ba5('0xf')](function(_0x2595a6){logger['info'](_0x3ba5('0x25'),_0x5ef791);logger[_0x3ba5('0x12')](_0x3ba5('0x25'),_0x5ef791,JSON['stringify'](_0x2595a6));_0x375684(_0x2595a6);})[_0x3ba5('0x18')](function(_0x44b240){logger[_0x3ba5('0x14')](_0x3ba5('0x25'),_0x44b240[_0x3ba5('0x16')],_0x5ef791);_0x49a89b(_0x49bc80[_0x3ba5('0x14')](0x1f4,_0x44b240['message']));});});};exports[_0x3ba5('0x27')]=function(_0x576324){var _0x49c723=this;return new Promise(function(_0x3014eb,_0x221542){return db['VoiceQueueReport']['update'](_0x576324[_0x3ba5('0x26')],{'raw':_0x576324['options']?_0x576324[_0x3ba5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576324['options']?_0x576324['options'][_0x3ba5('0x1d')]||null:null,'attributes':_0x576324[_0x3ba5('0x1b')]?_0x576324[_0x3ba5('0x1b')][_0x3ba5('0x1e')]||null:null,'limit':_0x576324[_0x3ba5('0x1b')]?_0x576324[_0x3ba5('0x1b')][_0x3ba5('0x1f')]||null:null})['then'](function(_0x521b49){logger[_0x3ba5('0x17')]('UpdateVoiceQueueReport',_0x576324);logger['debug'](_0x3ba5('0x27'),_0x576324,JSON['stringify'](_0x521b49));_0x3014eb(_0x521b49);})[_0x3ba5('0x18')](function(_0x56b4ea){logger[_0x3ba5('0x14')](_0x3ba5('0x27'),_0x56b4ea[_0x3ba5('0x16')],_0x576324);_0x221542(_0x49c723[_0x3ba5('0x14')](0x1f4,_0x56b4ea['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index cfc6f17..770c9cb 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 _0xc6ab=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x222077,_0x180f7c){var _0x59bf61=function(_0x1f4703){while(--_0x1f4703){_0x222077['push'](_0x222077['shift']());}};_0x59bf61(++_0x180f7c);}(_0xc6ab,0x96));var _0xbc6a=function(_0x257652,_0x3005ad){_0x257652=_0x257652-0x0;var _0xbc5883=_0xc6ab[_0x257652];return _0xbc5883;};'use strict';var VoiceQueueReportEvents=require(_0xbc6a('0x0'));var events=[_0xbc6a('0x1'),_0xbc6a('0x2'),_0xbc6a('0x3')];function createListener(_0x3d445d,_0x4fd8be){return function(_0x59baa9){_0x4fd8be[_0xbc6a('0x4')](_0x3d445d,_0x59baa9);};}function removeListener(_0x1c351c,_0x3808e0){return function(){VoiceQueueReportEvents[_0xbc6a('0x5')](_0x1c351c,_0x3808e0);};}exports[_0xbc6a('0x6')]=function(_0x4ccd07){for(var _0x45ed96=0x0,_0x263f4b=events[_0xbc6a('0x7')];_0x45ed96<_0x263f4b;_0x45ed96++){var _0x1b7a4c=events[_0x45ed96];var _0x2f7f5f=createListener('voiceQueueReport:'+_0x1b7a4c,_0x4ccd07);VoiceQueueReportEvents['on'](_0x1b7a4c,_0x2f7f5f);}}; \ No newline at end of file +var _0xdcf0=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','removeListener','register'];(function(_0x216c16,_0x46dc09){var _0x50f07b=function(_0x1f98fe){while(--_0x1f98fe){_0x216c16['push'](_0x216c16['shift']());}};_0x50f07b(++_0x46dc09);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x2c87d9,_0x37b6fd){_0x2c87d9=_0x2c87d9-0x0;var _0xd49741=_0xdcf0[_0x2c87d9];return _0xd49741;};'use strict';var VoiceQueueReportEvents=require(_0x0dcf('0x0'));var events=[_0x0dcf('0x1'),'remove',_0x0dcf('0x2')];function createListener(_0x4390bb,_0x53ce12){return function(_0x41aea7){_0x53ce12['emit'](_0x4390bb,_0x41aea7);};}function removeListener(_0x4b1323,_0x388fc3){return function(){VoiceQueueReportEvents[_0x0dcf('0x3')](_0x4b1323,_0x388fc3);};}exports[_0x0dcf('0x4')]=function(_0x2586c8){for(var _0x1367df=0x0,_0x598cf5=events[_0x0dcf('0x5')];_0x1367df<_0x598cf5;_0x1367df++){var _0x4ea8e2=events[_0x1367df];var _0x37871c=createListener(_0x0dcf('0x6')+_0x4ea8e2,_0x2586c8);VoiceQueueReportEvents['on'](_0x4ea8e2,_0x37871c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 7e6de67..b585728 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 _0xa33b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x177dd2,_0x484644){var _0x3b27c6=function(_0x5736ad){while(--_0x5736ad){_0x177dd2['push'](_0x177dd2['shift']());}};_0x3b27c6(++_0x484644);}(_0xa33b,0xf5));var _0xba33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa33b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xba33('0x0'));var util=require(_0xba33('0x1'));var path=require('path');var timeout=require(_0xba33('0x2'));var express=require(_0xba33('0x3'));var router=express[_0xba33('0x4')]();var fs_extra=require(_0xba33('0x5'));var auth=require(_0xba33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba33('0x7'));var controller=require(_0xba33('0x8'));router[_0xba33('0x9')]('/',auth[_0xba33('0xa')](),controller[_0xba33('0xb')]);router['get'](_0xba33('0xc'),auth[_0xba33('0xa')](),controller[_0xba33('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba33('0xe')]);router['put'](_0xba33('0xc'),auth['isAuthenticated'](),controller[_0xba33('0xf')]);router[_0xba33('0x10')](_0xba33('0xc'),auth['isAuthenticated'](),controller[_0xba33('0x11')]);module[_0xba33('0x12')]=router; \ No newline at end of file +var _0x53a2=['destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','/:id','delete'];(function(_0x36ffbf,_0x170a71){var _0x568c7d=function(_0x4ac6e9){while(--_0x4ac6e9){_0x36ffbf['push'](_0x36ffbf['shift']());}};_0x568c7d(++_0x170a71);}(_0x53a2,0x1ab));var _0x253a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x53a2[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x253a('0x0'));var path=require('path');var timeout=require(_0x253a('0x1'));var express=require(_0x253a('0x2'));var router=express[_0x253a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x253a('0x4'));var interaction=require(_0x253a('0x5'));var config=require(_0x253a('0x6'));var controller=require(_0x253a('0x7'));router[_0x253a('0x8')]('/',auth[_0x253a('0x9')](),controller['index']);router[_0x253a('0x8')]('/:id',auth[_0x253a('0x9')](),controller[_0x253a('0xa')]);router[_0x253a('0xb')]('/',auth[_0x253a('0x9')](),controller[_0x253a('0xc')]);router['put'](_0x253a('0xd'),auth[_0x253a('0x9')](),controller['update']);router[_0x253a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x253a('0xf')]);module[_0x253a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index c17b512..95b6ed1 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 _0x28e4=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x316031,_0x47b9c7){var _0xc96aec=function(_0x1cdeb5){while(--_0x1cdeb5){_0x316031['push'](_0x316031['shift']());}};_0xc96aec(++_0x47b9c7);}(_0x28e4,0x81));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x428e('0x0'));module[_0x428e('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x428e('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x428e('0x3')],'allowNull':![],'defaultValue':moment()[_0x428e('0x4')](_0x428e('0x5'))}}; \ No newline at end of file +var _0x43a5=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x5a83f7,_0x5e5404){var _0x2ab43b=function(_0x1352f9){while(--_0x1352f9){_0x5a83f7['push'](_0x5a83f7['shift']());}};_0x2ab43b(++_0x5e5404);}(_0x43a5,0x196));var _0x543a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x43a5[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x543a('0x0'));module[_0x543a('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x543a('0x3')],'allowNull':![],'defaultValue':moment()[_0x543a('0x4')](_0x543a('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index ba1a2a0..402d803 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 _0x9ad9=['end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x9ad9,0x163));var _0x99ad=function(_0x3aa6ab,_0x3b5f7c){_0x3aa6ab=_0x3aa6ab-0x0;var _0x5789d7=_0x9ad9[_0x3aa6ab];return _0x5789d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99ad('0x0'));var zipdir=require(_0x99ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99ad('0x2'));var BPromise=require(_0x99ad('0x3'));var Mustache=require(_0x99ad('0x4'));var util=require(_0x99ad('0x5'));var path=require(_0x99ad('0x6'));var sox=require(_0x99ad('0x7'));var csv=require(_0x99ad('0x8'));var ejs=require(_0x99ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99ad('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99ad('0xb'));var toCsv=require('to-csv');var querystring=require(_0x99ad('0xc'));var Papa=require(_0x99ad('0xd'));var Redis=require('ioredis');var authService=require(_0x99ad('0xe'));var qs=require(_0x99ad('0xf'));var as=require(_0x99ad('0x10'));var hardwareService=require(_0x99ad('0x11'));var logger=require('../../config/logger')(_0x99ad('0x12'));var utils=require(_0x99ad('0x13'));var config=require(_0x99ad('0x14'));var licenseUtil=require(_0x99ad('0x15'));var db=require(_0x99ad('0x16'))['db'];function respondWithStatusCode(_0xa3c40b,_0x3aa188){_0x3aa188=_0x3aa188||0xcc;return function(_0x548078){if(_0x548078){return _0xa3c40b[_0x99ad('0x17')](_0x3aa188);}return _0xa3c40b[_0x99ad('0x18')](_0x3aa188)[_0x99ad('0x19')]();};}function respondWithResult(_0x3b4067,_0x59aa3a){_0x59aa3a=_0x59aa3a||0xc8;return function(_0x221861){if(_0x221861){return _0x3b4067['status'](_0x59aa3a)['json'](_0x221861);}};}function respondWithFilteredResult(_0x3a505c,_0x1ac276){return function(_0x2db0de){if(_0x2db0de){var _0x3a239a=typeof _0x1ac276[_0x99ad('0x1a')]===_0x99ad('0x1b')&&typeof _0x1ac276['limit']===_0x99ad('0x1b');var _0x448736=_0x2db0de[_0x99ad('0x1c')];var _0x23a05f=_0x3a239a?0x0:_0x1ac276[_0x99ad('0x1a')];var _0x1b7a83=_0x3a239a?_0x2db0de[_0x99ad('0x1c')]:_0x1ac276['offset']+_0x1ac276[_0x99ad('0x1d')];var _0x39a2ff;if(_0x1b7a83>=_0x448736){_0x1b7a83=_0x448736;_0x39a2ff=0xc8;}else{_0x39a2ff=0xce;}_0x3a505c[_0x99ad('0x18')](_0x39a2ff);return _0x3a505c[_0x99ad('0x1e')](_0x99ad('0x1f'),_0x23a05f+'-'+_0x1b7a83+'/'+_0x448736)[_0x99ad('0x20')](_0x2db0de);}return null;};}function patchUpdates(_0x119ab7){return function(_0x52dd7d){try{jsonpatch[_0x99ad('0x21')](_0x52dd7d,_0x119ab7,!![]);}catch(_0x47eb8c){return BPromise[_0x99ad('0x22')](_0x47eb8c);}return _0x52dd7d[_0x99ad('0x23')]();};}function saveUpdates(_0x154ea,_0x29247a){return function(_0x50792d){if(_0x50792d){return _0x50792d[_0x99ad('0x24')](_0x154ea)[_0x99ad('0x25')](function(_0x2f1011){return _0x2f1011;});}return null;};}function removeEntity(_0x53a2b6,_0x33cd05){return function(_0x2f42e1){if(_0x2f42e1){return _0x2f42e1[_0x99ad('0x26')]()[_0x99ad('0x25')](function(){_0x53a2b6[_0x99ad('0x18')](0xcc)[_0x99ad('0x19')]();});}};}function handleEntityNotFound(_0x402b0f,_0x23e2f7){return function(_0x376b38){if(!_0x376b38){_0x402b0f['sendStatus'](0x194);}return _0x376b38;};}function handleError(_0x438953,_0x377475){_0x377475=_0x377475||0x1f4;return function(_0x5803b4){logger[_0x99ad('0x27')](_0x5803b4[_0x99ad('0x28')]);if(_0x5803b4['name']){delete _0x5803b4[_0x99ad('0x29')];}_0x438953['status'](_0x377475)[_0x99ad('0x2a')](_0x5803b4);};}exports['index']=function(_0x236b39,_0x5b0234){var _0x241abe={},_0x55eec0={},_0x4ede0f={'count':0x0,'rows':[]};var _0x41f869=_[_0x99ad('0x2b')](db[_0x99ad('0x2c')][_0x99ad('0x2d')],function(_0x4e94a5){return{'name':_0x4e94a5[_0x99ad('0x2e')],'type':_0x4e94a5['type'][_0x99ad('0x2f')]};});_0x55eec0[_0x99ad('0x30')]=_[_0x99ad('0x2b')](_0x41f869,'name');_0x55eec0[_0x99ad('0x31')]=_['keys'](_0x236b39['query']);_0x55eec0[_0x99ad('0x32')]=_[_0x99ad('0x33')](_0x55eec0[_0x99ad('0x30')],_0x55eec0[_0x99ad('0x31')]);_0x241abe[_0x99ad('0x34')]=_[_0x99ad('0x33')](_0x55eec0[_0x99ad('0x30')],qs['fields'](_0x236b39[_0x99ad('0x31')]['fields']));_0x241abe['attributes']=_0x241abe[_0x99ad('0x34')][_0x99ad('0x35')]?_0x241abe[_0x99ad('0x34')]:_0x55eec0[_0x99ad('0x30')];if(!_0x236b39[_0x99ad('0x31')][_0x99ad('0x36')]('nolimit')){_0x241abe[_0x99ad('0x1d')]=qs[_0x99ad('0x1d')](_0x236b39[_0x99ad('0x31')][_0x99ad('0x1d')]);_0x241abe[_0x99ad('0x1a')]=qs[_0x99ad('0x1a')](_0x236b39[_0x99ad('0x31')][_0x99ad('0x1a')]);}_0x241abe[_0x99ad('0x37')]=qs[_0x99ad('0x38')](_0x236b39[_0x99ad('0x31')][_0x99ad('0x38')]);_0x241abe['where']=qs[_0x99ad('0x32')](_[_0x99ad('0x39')](_0x236b39[_0x99ad('0x31')],_0x55eec0['filters']),_0x41f869);if(_0x236b39[_0x99ad('0x31')][_0x99ad('0x3a')]){_0x241abe['where']=_[_0x99ad('0x3b')](_0x241abe['where'],{'$or':_['map'](_0x41f869,function(_0x54a73a){if(_0x54a73a[_0x99ad('0x3c')]!==_0x99ad('0x3d')){var _0x3e4012={};_0x3e4012[_0x54a73a[_0x99ad('0x29')]]={'$like':'%'+_0x236b39['query'][_0x99ad('0x3a')]+'%'};return _0x3e4012;}})});}_0x241abe=_[_0x99ad('0x3b')]({},_0x241abe,_0x236b39[_0x99ad('0x3e')]);var _0x31065a={'where':_0x241abe[_0x99ad('0x3f')]};return db[_0x99ad('0x2c')][_0x99ad('0x1c')](_0x31065a)[_0x99ad('0x25')](function(_0x69607b){_0x4ede0f[_0x99ad('0x1c')]=_0x69607b;if(_0x236b39[_0x99ad('0x31')][_0x99ad('0x40')]){_0x241abe[_0x99ad('0x41')]=[{'all':!![]}];}return db[_0x99ad('0x2c')][_0x99ad('0x42')](_0x241abe);})[_0x99ad('0x25')](function(_0x2182e8){_0x4ede0f[_0x99ad('0x43')]=_0x2182e8;return _0x4ede0f;})['then'](respondWithFilteredResult(_0x5b0234,_0x241abe))[_0x99ad('0x44')](handleError(_0x5b0234,null));};exports[_0x99ad('0x45')]=function(_0x11a143,_0x7036a9){var _0x25ab59={'raw':!![],'where':{'id':_0x11a143['params']['id']}},_0x55946b={};_0x55946b[_0x99ad('0x30')]=_['keys'](db['VoiceQueuesLog'][_0x99ad('0x2d')]);_0x55946b['query']=_[_0x99ad('0x46')](_0x11a143[_0x99ad('0x31')]);_0x55946b[_0x99ad('0x32')]=_[_0x99ad('0x33')](_0x55946b[_0x99ad('0x30')],_0x55946b[_0x99ad('0x31')]);_0x25ab59[_0x99ad('0x34')]=_[_0x99ad('0x33')](_0x55946b[_0x99ad('0x30')],qs[_0x99ad('0x47')](_0x11a143[_0x99ad('0x31')][_0x99ad('0x47')]));_0x25ab59[_0x99ad('0x34')]=_0x25ab59[_0x99ad('0x34')]['length']?_0x25ab59[_0x99ad('0x34')]:_0x55946b[_0x99ad('0x30')];if(_0x11a143[_0x99ad('0x31')][_0x99ad('0x40')]){_0x25ab59[_0x99ad('0x41')]=[{'all':!![]}];}_0x25ab59=_[_0x99ad('0x3b')]({},_0x25ab59,_0x11a143[_0x99ad('0x3e')]);return db[_0x99ad('0x2c')][_0x99ad('0x48')](_0x25ab59)[_0x99ad('0x25')](handleEntityNotFound(_0x7036a9,null))[_0x99ad('0x25')](respondWithResult(_0x7036a9,null))['catch'](handleError(_0x7036a9,null));};exports[_0x99ad('0x49')]=function(_0x150e5f,_0x505490){return db[_0x99ad('0x2c')]['create'](_0x150e5f[_0x99ad('0x4a')],{})[_0x99ad('0x25')](respondWithResult(_0x505490,0xc9))[_0x99ad('0x44')](handleError(_0x505490,null));};exports[_0x99ad('0x24')]=function(_0x9220,_0x22011e){if(_0x9220[_0x99ad('0x4a')]['id']){delete _0x9220[_0x99ad('0x4a')]['id'];}return db[_0x99ad('0x2c')][_0x99ad('0x48')]({'where':{'id':_0x9220[_0x99ad('0x4b')]['id']}})[_0x99ad('0x25')](handleEntityNotFound(_0x22011e,null))[_0x99ad('0x25')](saveUpdates(_0x9220['body'],null))[_0x99ad('0x25')](respondWithResult(_0x22011e,null))['catch'](handleError(_0x22011e,null));};exports[_0x99ad('0x26')]=function(_0x101724,_0x35cedd){return db[_0x99ad('0x2c')]['find']({'where':{'id':_0x101724[_0x99ad('0x4b')]['id']}})[_0x99ad('0x25')](handleEntityNotFound(_0x35cedd,null))[_0x99ad('0x25')](removeEntity(_0x35cedd,null))[_0x99ad('0x44')](handleError(_0x35cedd,null));}; \ No newline at end of file +var _0x2d61=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','save','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x2d61,0x1bd));var _0x12d6=function(_0x319999,_0x26042c){_0x319999=_0x319999-0x0;var _0xc46ca4=_0x2d61[_0x319999];return _0xc46ca4;};'use strict';var emlformat=require(_0x12d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12d6('0x1'));var jsonpatch=require(_0x12d6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x12d6('0x3'));var Mustache=require(_0x12d6('0x4'));var util=require(_0x12d6('0x5'));var path=require(_0x12d6('0x6'));var sox=require(_0x12d6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12d6('0x8'));var squel=require(_0x12d6('0x9'));var crypto=require(_0x12d6('0xa'));var jsforce=require(_0x12d6('0xb'));var deskjs=require(_0x12d6('0xc'));var toCsv=require(_0x12d6('0xd'));var querystring=require(_0x12d6('0xe'));var Papa=require(_0x12d6('0xf'));var Redis=require(_0x12d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x12d6('0x11'));var as=require(_0x12d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12d6('0x13'))('api');var utils=require(_0x12d6('0x14'));var config=require(_0x12d6('0x15'));var licenseUtil=require(_0x12d6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23c0c1,_0x2729d1){_0x2729d1=_0x2729d1||0xcc;return function(_0x2ddc8a){if(_0x2ddc8a){return _0x23c0c1[_0x12d6('0x17')](_0x2729d1);}return _0x23c0c1[_0x12d6('0x18')](_0x2729d1)['end']();};}function respondWithResult(_0x3388e3,_0x1beb2c){_0x1beb2c=_0x1beb2c||0xc8;return function(_0xa66c62){if(_0xa66c62){return _0x3388e3[_0x12d6('0x18')](_0x1beb2c)[_0x12d6('0x19')](_0xa66c62);}};}function respondWithFilteredResult(_0x33f252,_0x5c8d5e){return function(_0x3bd0d2){if(_0x3bd0d2){var _0x2cf4bc=typeof _0x5c8d5e[_0x12d6('0x1a')]===_0x12d6('0x1b')&&typeof _0x5c8d5e['limit']===_0x12d6('0x1b');var _0x1a29cc=_0x3bd0d2[_0x12d6('0x1c')];var _0x5e13c0=_0x2cf4bc?0x0:_0x5c8d5e[_0x12d6('0x1a')];var _0x30933c=_0x2cf4bc?_0x3bd0d2['count']:_0x5c8d5e[_0x12d6('0x1a')]+_0x5c8d5e[_0x12d6('0x1d')];var _0x1272b6;if(_0x30933c>=_0x1a29cc){_0x30933c=_0x1a29cc;_0x1272b6=0xc8;}else{_0x1272b6=0xce;}_0x33f252['status'](_0x1272b6);return _0x33f252['set']('Content-Range',_0x5e13c0+'-'+_0x30933c+'/'+_0x1a29cc)[_0x12d6('0x19')](_0x3bd0d2);}return null;};}function patchUpdates(_0x2adace){return function(_0x463d98){try{jsonpatch['apply'](_0x463d98,_0x2adace,!![]);}catch(_0xe2ead5){return BPromise['reject'](_0xe2ead5);}return _0x463d98[_0x12d6('0x1e')]();};}function saveUpdates(_0x3fcb8d,_0xab628a){return function(_0x77aefd){if(_0x77aefd){return _0x77aefd[_0x12d6('0x1f')](_0x3fcb8d)[_0x12d6('0x20')](function(_0x3575ff){return _0x3575ff;});}return null;};}function removeEntity(_0x1f30d4,_0xd508f7){return function(_0x38f110){if(_0x38f110){return _0x38f110[_0x12d6('0x21')]()[_0x12d6('0x20')](function(){_0x1f30d4[_0x12d6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b79d7,_0x24dc93){return function(_0x371fdd){if(!_0x371fdd){_0x1b79d7[_0x12d6('0x17')](0x194);}return _0x371fdd;};}function handleError(_0x1921d7,_0x3df137){_0x3df137=_0x3df137||0x1f4;return function(_0x2e8fa7){logger[_0x12d6('0x22')](_0x2e8fa7[_0x12d6('0x23')]);if(_0x2e8fa7[_0x12d6('0x24')]){delete _0x2e8fa7[_0x12d6('0x24')];}_0x1921d7['status'](_0x3df137)['send'](_0x2e8fa7);};}exports[_0x12d6('0x25')]=function(_0x6533a1,_0xd21d8c){var _0x5af2ab={},_0xff4806={},_0x120340={'count':0x0,'rows':[]};var _0x551ef0=_[_0x12d6('0x26')](db[_0x12d6('0x27')][_0x12d6('0x28')],function(_0x1a226e){return{'name':_0x1a226e['fieldName'],'type':_0x1a226e[_0x12d6('0x29')]['key']};});_0xff4806[_0x12d6('0x2a')]=_[_0x12d6('0x26')](_0x551ef0,_0x12d6('0x24'));_0xff4806[_0x12d6('0x2b')]=_['keys'](_0x6533a1[_0x12d6('0x2b')]);_0xff4806[_0x12d6('0x2c')]=_[_0x12d6('0x2d')](_0xff4806[_0x12d6('0x2a')],_0xff4806['query']);_0x5af2ab[_0x12d6('0x2e')]=_['intersection'](_0xff4806[_0x12d6('0x2a')],qs[_0x12d6('0x2f')](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x2f')]));_0x5af2ab[_0x12d6('0x2e')]=_0x5af2ab[_0x12d6('0x2e')][_0x12d6('0x30')]?_0x5af2ab[_0x12d6('0x2e')]:_0xff4806[_0x12d6('0x2a')];if(!_0x6533a1[_0x12d6('0x2b')]['hasOwnProperty'](_0x12d6('0x31'))){_0x5af2ab[_0x12d6('0x1d')]=qs[_0x12d6('0x1d')](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x1d')]);_0x5af2ab['offset']=qs[_0x12d6('0x1a')](_0x6533a1['query']['offset']);}_0x5af2ab[_0x12d6('0x32')]=qs['sort'](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x33')]);_0x5af2ab['where']=qs[_0x12d6('0x2c')](_['pick'](_0x6533a1[_0x12d6('0x2b')],_0xff4806[_0x12d6('0x2c')]),_0x551ef0);if(_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x34')]){_0x5af2ab[_0x12d6('0x35')]=_[_0x12d6('0x36')](_0x5af2ab[_0x12d6('0x35')],{'$or':_[_0x12d6('0x26')](_0x551ef0,function(_0x1f0c29){if(_0x1f0c29[_0x12d6('0x29')]!==_0x12d6('0x37')){var _0x125e77={};_0x125e77[_0x1f0c29['name']]={'$like':'%'+_0x6533a1[_0x12d6('0x2b')]['filter']+'%'};return _0x125e77;}})});}_0x5af2ab=_['merge']({},_0x5af2ab,_0x6533a1[_0x12d6('0x38')]);var _0x4b61af={'where':_0x5af2ab[_0x12d6('0x35')]};return db[_0x12d6('0x27')]['count'](_0x4b61af)[_0x12d6('0x20')](function(_0x195de7){_0x120340[_0x12d6('0x1c')]=_0x195de7;if(_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x39')]){_0x5af2ab[_0x12d6('0x3a')]=[{'all':!![]}];}return db[_0x12d6('0x27')]['findAll'](_0x5af2ab);})[_0x12d6('0x20')](function(_0x419496){_0x120340[_0x12d6('0x3b')]=_0x419496;return _0x120340;})[_0x12d6('0x20')](respondWithFilteredResult(_0xd21d8c,_0x5af2ab))[_0x12d6('0x3c')](handleError(_0xd21d8c,null));};exports['show']=function(_0x5a3a38,_0x245371){var _0x3d3380={'raw':!![],'where':{'id':_0x5a3a38[_0x12d6('0x3d')]['id']}},_0x584005={};_0x584005['model']=_[_0x12d6('0x3e')](db[_0x12d6('0x27')]['rawAttributes']);_0x584005[_0x12d6('0x2b')]=_[_0x12d6('0x3e')](_0x5a3a38[_0x12d6('0x2b')]);_0x584005[_0x12d6('0x2c')]=_[_0x12d6('0x2d')](_0x584005['model'],_0x584005['query']);_0x3d3380[_0x12d6('0x2e')]=_[_0x12d6('0x2d')](_0x584005[_0x12d6('0x2a')],qs[_0x12d6('0x2f')](_0x5a3a38['query'][_0x12d6('0x2f')]));_0x3d3380['attributes']=_0x3d3380['attributes'][_0x12d6('0x30')]?_0x3d3380[_0x12d6('0x2e')]:_0x584005[_0x12d6('0x2a')];if(_0x5a3a38['query']['includeAll']){_0x3d3380['include']=[{'all':!![]}];}_0x3d3380=_['merge']({},_0x3d3380,_0x5a3a38[_0x12d6('0x38')]);return db[_0x12d6('0x27')][_0x12d6('0x3f')](_0x3d3380)[_0x12d6('0x20')](handleEntityNotFound(_0x245371,null))[_0x12d6('0x20')](respondWithResult(_0x245371,null))[_0x12d6('0x3c')](handleError(_0x245371,null));};exports['create']=function(_0x4f6dd0,_0x2b7182){return db[_0x12d6('0x27')]['create'](_0x4f6dd0[_0x12d6('0x40')],{})['then'](respondWithResult(_0x2b7182,0xc9))[_0x12d6('0x3c')](handleError(_0x2b7182,null));};exports['update']=function(_0x5e0215,_0x1c2539){if(_0x5e0215[_0x12d6('0x40')]['id']){delete _0x5e0215[_0x12d6('0x40')]['id'];}return db[_0x12d6('0x27')]['find']({'where':{'id':_0x5e0215['params']['id']}})['then'](handleEntityNotFound(_0x1c2539,null))[_0x12d6('0x20')](saveUpdates(_0x5e0215[_0x12d6('0x40')],null))['then'](respondWithResult(_0x1c2539,null))[_0x12d6('0x3c')](handleError(_0x1c2539,null));};exports[_0x12d6('0x21')]=function(_0x408aa3,_0x4a9f13){return db[_0x12d6('0x27')]['find']({'where':{'id':_0x408aa3['params']['id']}})[_0x12d6('0x20')](handleEntityNotFound(_0x4a9f13,null))[_0x12d6('0x20')](removeEntity(_0x4a9f13,null))['catch'](handleError(_0x4a9f13,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 9430898..224d062 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 _0xd64b=['moment','bluebird','request-promise','path','rimraf','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger'];(function(_0x1c3fe2,_0x21ec94){var _0x2409a5=function(_0x3f3109){while(--_0x3f3109){_0x1c3fe2['push'](_0x1c3fe2['shift']());}};_0x2409a5(++_0x21ec94);}(_0xd64b,0xc1));var _0xbd64=function(_0x4c3a36,_0xdba60f){_0x4c3a36=_0x4c3a36-0x0;var _0x40f945=_0xd64b[_0x4c3a36];return _0x40f945;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[{'name':_0xbd64('0xa'),'fields':[_0xbd64('0xb'),_0xbd64('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe8cf=['event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceQueuesLog'];(function(_0x1f373c,_0x223821){var _0x5c4612=function(_0x378891){while(--_0x378891){_0x1f373c['push'](_0x1f373c['shift']());}};_0x5c4612(++_0x223821);}(_0xe8cf,0x16e));var _0xfe8c=function(_0x933b86,_0x28d64a){_0x933b86=_0x933b86-0x0;var _0x1e2d4e=_0xe8cf[_0x933b86];return _0x1e2d4e;};'use strict';var _=require('lodash');var util=require(_0xfe8c('0x0'));var logger=require(_0xfe8c('0x1'))(_0xfe8c('0x2'));var moment=require(_0xfe8c('0x3'));var BPromise=require(_0xfe8c('0x4'));var rp=require(_0xfe8c('0x5'));var fs=require('fs');var path=require(_0xfe8c('0x6'));var rimraf=require(_0xfe8c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xfe8c('0x8')]=function(_0x49c46b,_0xb5ce37){return _0x49c46b[_0xfe8c('0x9')](_0xfe8c('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xfe8c('0xb'),_0xfe8c('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c41ef50..25a0b0f 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 _0xf031=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2098a2,_0x10d739){var _0xbb3a35=function(_0x328d97){while(--_0x328d97){_0x2098a2['push'](_0x2098a2['shift']());}};_0xbb3a35(++_0x10d739);}(_0xf031,0xfc));var _0x1f03=function(_0x4792cd,_0x163ae6){_0x4792cd=_0x4792cd-0x0;var _0x3d255b=_0xf031[_0x4792cd];return _0x3d255b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f03('0x0'));var BPromise=require(_0x1f03('0x1'));var rs=require(_0x1f03('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1f03('0x3'));var logger=require(_0x1f03('0x4'))(_0x1f03('0x5'));var config=require('../../config/environment');var jayson=require(_0x1f03('0x6'));var client=jayson[_0x1f03('0x7')][_0x1f03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23c63b,_0x416bc0,_0x5e37ab){return new BPromise(function(_0x239813,_0x3c6256){return client[_0x1f03('0x9')](_0x23c63b,_0x5e37ab)[_0x1f03('0xa')](function(_0x136c23){logger[_0x1f03('0xb')](_0x1f03('0xc'),_0x416bc0,_0x1f03('0xd'));logger[_0x1f03('0xe')](_0x1f03('0xf'),_0x416bc0,_0x1f03('0xd'),JSON[_0x1f03('0x10')](_0x136c23));if(_0x136c23['error']){if(_0x136c23[_0x1f03('0x11')][_0x1f03('0x12')]===0x1f4){logger[_0x1f03('0x11')](_0x1f03('0xc'),_0x416bc0,_0x136c23[_0x1f03('0x11')][_0x1f03('0x13')]);return _0x3c6256(_0x136c23['error'][_0x1f03('0x13')]);}logger[_0x1f03('0x11')](_0x1f03('0xc'),_0x416bc0,_0x136c23[_0x1f03('0x11')][_0x1f03('0x13')]);return _0x239813(_0x136c23['error'][_0x1f03('0x13')]);}else{logger[_0x1f03('0xb')](_0x1f03('0xc'),_0x416bc0,'request\x20sent');_0x239813(_0x136c23[_0x1f03('0x14')][_0x1f03('0x13')]);}})['catch'](function(_0xd0e971){logger[_0x1f03('0x11')](_0x1f03('0xc'),_0x416bc0,_0xd0e971);_0x3c6256(_0xd0e971);});});} \ No newline at end of file +var _0xf5b7=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x1d69ba,_0x4090c9){var _0x8bab8c=function(_0x33ce38){while(--_0x33ce38){_0x1d69ba['push'](_0x1d69ba['shift']());}};_0x8bab8c(++_0x4090c9);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x4a9e66,_0x23ce1a){_0x4a9e66=_0x4a9e66-0x0;var _0x1a9d2d=_0xf5b7[_0x4a9e66];return _0x1a9d2d;};'use strict';var _=require('lodash');var util=require(_0x7f5b('0x0'));var moment=require(_0x7f5b('0x1'));var BPromise=require(_0x7f5b('0x2'));var rs=require(_0x7f5b('0x3'));var fs=require('fs');var Redis=require(_0x7f5b('0x4'));var db=require(_0x7f5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f5b('0x6'))('rpc');var config=require(_0x7f5b('0x7'));var jayson=require(_0x7f5b('0x8'));var client=jayson['client'][_0x7f5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fcd6b,_0x185c7c,_0x16ac54){return new BPromise(function(_0x1d1844,_0x384476){return client[_0x7f5b('0xa')](_0x1fcd6b,_0x16ac54)[_0x7f5b('0xb')](function(_0x35fd0a){logger[_0x7f5b('0xc')](_0x7f5b('0xd'),_0x185c7c,_0x7f5b('0xe'));logger[_0x7f5b('0xf')](_0x7f5b('0x10'),_0x185c7c,_0x7f5b('0xe'),JSON['stringify'](_0x35fd0a));if(_0x35fd0a[_0x7f5b('0x11')]){if(_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x12')]===0x1f4){logger[_0x7f5b('0x11')](_0x7f5b('0xd'),_0x185c7c,_0x35fd0a[_0x7f5b('0x11')]['message']);return _0x384476(_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x13')]);}logger[_0x7f5b('0x11')](_0x7f5b('0xd'),_0x185c7c,_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x13')]);return _0x1d1844(_0x35fd0a['error']['message']);}else{logger['info'](_0x7f5b('0xd'),_0x185c7c,_0x7f5b('0xe'));_0x1d1844(_0x35fd0a[_0x7f5b('0x14')][_0x7f5b('0x13')]);}})[_0x7f5b('0x15')](function(_0x9b9d56){logger[_0x7f5b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x185c7c,_0x9b9d56);_0x384476(_0x9b9d56);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 80c011c..0422beb 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 _0xefa3=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','destroy'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xefa3,0x88));var _0x3efa=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xefa3[_0x31ced5];return _0x10d9e5;};'use strict';var multer=require(_0x3efa('0x0'));var util=require(_0x3efa('0x1'));var path=require(_0x3efa('0x2'));var timeout=require(_0x3efa('0x3'));var express=require(_0x3efa('0x4'));var router=express['Router']();var fs_extra=require(_0x3efa('0x5'));var auth=require(_0x3efa('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3efa('0x7'));router[_0x3efa('0x8')]('/',auth[_0x3efa('0x9')](),controller[_0x3efa('0xa')]);router[_0x3efa('0x8')](_0x3efa('0xb'),auth[_0x3efa('0x9')](),controller[_0x3efa('0xc')]);router[_0x3efa('0x8')](_0x3efa('0xd'),auth[_0x3efa('0x9')](),controller[_0x3efa('0xe')]);router[_0x3efa('0x8')](_0x3efa('0xf'),auth['isAuthenticated'](),controller[_0x3efa('0x10')]);router['get'](_0x3efa('0x11'),controller[_0x3efa('0x12')]);router[_0x3efa('0x8')](_0x3efa('0x13'),auth[_0x3efa('0x9')](),controller[_0x3efa('0x14')]);router[_0x3efa('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/transcribe',auth[_0x3efa('0x9')](),controller[_0x3efa('0x16')]);router[_0x3efa('0x17')](_0x3efa('0xd'),auth[_0x3efa('0x9')](),controller[_0x3efa('0x18')]);router['delete'](_0x3efa('0xd'),auth[_0x3efa('0x9')](),controller[_0x3efa('0x19')]);module[_0x3efa('0x1a')]=router; \ No newline at end of file +var _0x058c=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','multer'];(function(_0x29a132,_0x49c0cc){var _0x1443cf=function(_0x25914b){while(--_0x25914b){_0x29a132['push'](_0x29a132['shift']());}};_0x1443cf(++_0x49c0cc);}(_0x058c,0x86));var _0xc058=function(_0x28e609,_0x1e5009){_0x28e609=_0x28e609-0x0;var _0x334c68=_0x058c[_0x28e609];return _0x334c68;};'use strict';var multer=require(_0xc058('0x0'));var util=require(_0xc058('0x1'));var path=require('path');var timeout=require(_0xc058('0x2'));var express=require(_0xc058('0x3'));var router=express[_0xc058('0x4')]();var fs_extra=require(_0xc058('0x5'));var auth=require(_0xc058('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc058('0x7'));var controller=require(_0xc058('0x8'));router[_0xc058('0x9')]('/',auth[_0xc058('0xa')](),controller[_0xc058('0xb')]);router[_0xc058('0x9')](_0xc058('0xc'),auth[_0xc058('0xa')](),controller[_0xc058('0xd')]);router['get'](_0xc058('0xe'),auth['isAuthenticated'](),controller[_0xc058('0xf')]);router['get'](_0xc058('0x10'),auth['isAuthenticated'](),controller[_0xc058('0x11')]);router[_0xc058('0x9')](_0xc058('0x12'),controller[_0xc058('0x13')]);router[_0xc058('0x9')](_0xc058('0x14'),auth[_0xc058('0xa')](),controller[_0xc058('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc058('0x16')]);router[_0xc058('0x17')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xc058('0x18')]);router[_0xc058('0x19')](_0xc058('0xe'),auth[_0xc058('0xa')](),controller[_0xc058('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index acb3f52..4214747 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 3d48ba6..dbd408a 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 _0xc48e=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceRecording','rawAttributes','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','options','findAll','rows','catch','show','length','includeAll','include','find','create','body','describe','download','../../components/encryptor','uniqueid','params','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4da4f8,_0x1742fb){var _0x549574=function(_0x4742c0){while(--_0x4742c0){_0x4da4f8['push'](_0x4da4f8['shift']());}};_0x549574(++_0x1742fb);}(_0xc48e,0x1c1));var _0xec48=function(_0x11c1a1,_0x17ba8c){_0x11c1a1=_0x11c1a1-0x0;var _0x483746=_0xc48e[_0x11c1a1];return _0x483746;};'use strict';var emlformat=require(_0xec48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec48('0x2'));var moment=require(_0xec48('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec48('0x4'));var path=require(_0xec48('0x5'));var sox=require(_0xec48('0x6'));var csv=require(_0xec48('0x7'));var ejs=require(_0xec48('0x8'));var fs=require('fs');var fs_extra=require(_0xec48('0x9'));var _=require(_0xec48('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec48('0xb'));var deskjs=require(_0xec48('0xc'));var toCsv=require('to-csv');var querystring=require(_0xec48('0xd'));var Papa=require(_0xec48('0xe'));var AWS=require(_0xec48('0xf'));var uuidv4=require(_0xec48('0x10'));var Redis=require('ioredis');var authService=require(_0xec48('0x11'));var qs=require(_0xec48('0x12'));var as=require(_0xec48('0x13'));var hardwareService=require(_0xec48('0x14'));var logger=require(_0xec48('0x15'))(_0xec48('0x16'));var utils=require(_0xec48('0x17'));var config=require(_0xec48('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xec48('0x19'))['db'];function respondWithStatusCode(_0x5cc04f,_0x3aee6a){_0x3aee6a=_0x3aee6a||0xcc;return function(_0x2bba52){if(_0x2bba52){return _0x5cc04f[_0xec48('0x1a')](_0x3aee6a);}return _0x5cc04f['status'](_0x3aee6a)[_0xec48('0x1b')]();};}function respondWithResult(_0x2ab503,_0x2e33ee){_0x2e33ee=_0x2e33ee||0xc8;return function(_0xc7e8a5){if(_0xc7e8a5){return _0x2ab503[_0xec48('0x1c')](_0x2e33ee)[_0xec48('0x1d')](_0xc7e8a5);}};}function respondWithFilteredResult(_0x1db858,_0x2d5595){return function(_0x482a6b){if(_0x482a6b){var _0x534c4b=typeof _0x2d5595[_0xec48('0x1e')]===_0xec48('0x1f')&&typeof _0x2d5595[_0xec48('0x20')]===_0xec48('0x1f');var _0x5423ed=_0x482a6b['count'];var _0x28b89d=_0x534c4b?0x0:_0x2d5595[_0xec48('0x1e')];var _0x231f57=_0x534c4b?_0x482a6b[_0xec48('0x21')]:_0x2d5595[_0xec48('0x1e')]+_0x2d5595['limit'];var _0x5478a7;if(_0x231f57>=_0x5423ed){_0x231f57=_0x5423ed;_0x5478a7=0xc8;}else{_0x5478a7=0xce;}_0x1db858['status'](_0x5478a7);return _0x1db858[_0xec48('0x22')]('Content-Range',_0x28b89d+'-'+_0x231f57+'/'+_0x5423ed)[_0xec48('0x1d')](_0x482a6b);}return null;};}function patchUpdates(_0x50aabd){return function(_0x2b2a8a){try{jsonpatch[_0xec48('0x23')](_0x2b2a8a,_0x50aabd,!![]);}catch(_0x436c7d){return BPromise[_0xec48('0x24')](_0x436c7d);}return _0x2b2a8a[_0xec48('0x25')]();};}function saveUpdates(_0x333e87,_0x13cb57){return function(_0x442d38){if(_0x442d38){return _0x442d38[_0xec48('0x26')](_0x333e87)[_0xec48('0x27')](function(_0x4e4a04){return _0x4e4a04;});}return null;};}function removeEntity(_0x208ed7,_0x57d96c){return function(_0x5b8562){if(_0x5b8562){return _0x5b8562[_0xec48('0x28')]()[_0xec48('0x27')](function(){_0x208ed7[_0xec48('0x1c')](0xcc)[_0xec48('0x1b')]();});}};}function handleEntityNotFound(_0x1ba108,_0x52b60d){return function(_0x476330){if(!_0x476330){_0x1ba108[_0xec48('0x1a')](0x194);}return _0x476330;};}function handleError(_0x4de2a2,_0x470424){_0x470424=_0x470424||0x1f4;return function(_0x5c1e6b){logger['error'](_0x5c1e6b[_0xec48('0x29')]);if(_0x5c1e6b[_0xec48('0x2a')]){delete _0x5c1e6b[_0xec48('0x2a')];}_0x4de2a2[_0xec48('0x1c')](_0x470424)[_0xec48('0x2b')](_0x5c1e6b);};}exports['index']=function(_0x13049c,_0x5476c2){var _0x410692={},_0x26bd63={},_0x2284ca={'count':0x0,'rows':[]};var _0x5e1c83=_[_0xec48('0x2c')](db[_0xec48('0x2d')][_0xec48('0x2e')],function(_0x5903a3){return{'name':_0x5903a3['fieldName'],'type':_0x5903a3['type'][_0xec48('0x2f')]};});_0x26bd63[_0xec48('0x30')]=_[_0xec48('0x31')](_[_0xec48('0x2c')](_0x5e1c83,_0xec48('0x2a')),[_0xec48('0x32')]);_0x26bd63[_0xec48('0x33')]=_[_0xec48('0x34')](_0x13049c[_0xec48('0x33')]);_0x26bd63[_0xec48('0x35')]=_[_0xec48('0x36')](_0x26bd63['model'],_0x26bd63[_0xec48('0x33')]);_0x410692[_0xec48('0x37')]=_[_0xec48('0x36')](_0x26bd63[_0xec48('0x30')],qs[_0xec48('0x38')](_0x13049c[_0xec48('0x33')][_0xec48('0x38')]));_0x410692[_0xec48('0x37')]=_0x410692['attributes']['length']?_0x410692['attributes']:_0x26bd63[_0xec48('0x30')];if(!_0x13049c[_0xec48('0x33')][_0xec48('0x39')]('nolimit')){_0x410692[_0xec48('0x20')]=qs['limit'](_0x13049c[_0xec48('0x33')]['limit']);_0x410692[_0xec48('0x1e')]=qs[_0xec48('0x1e')](_0x13049c['query'][_0xec48('0x1e')]);}_0x410692[_0xec48('0x3a')]=qs[_0xec48('0x3b')](_0x13049c[_0xec48('0x33')]['sort']);_0x410692['where']=qs[_0xec48('0x35')](_[_0xec48('0x3c')](_0x13049c['query'],_0x26bd63[_0xec48('0x35')]),_0x5e1c83);if(_0x13049c[_0xec48('0x33')][_0xec48('0x3d')]){_0x410692[_0xec48('0x3e')]=_['merge'](_0x410692[_0xec48('0x3e')],{'$or':_['map'](_0x5e1c83,function(_0x5610ed){if(_0x5610ed[_0xec48('0x3f')]!==_0xec48('0x40')){var _0x32d812={};_0x32d812[_0x5610ed[_0xec48('0x2a')]]={'$like':'%'+_0x13049c[_0xec48('0x33')][_0xec48('0x3d')]+'%'};return _0x32d812;}})});}_0x410692=_['merge']({},_0x410692,_0x13049c[_0xec48('0x41')]);var _0x75830b={'where':_0x410692[_0xec48('0x3e')]};return db[_0xec48('0x2d')][_0xec48('0x21')](_0x75830b)[_0xec48('0x27')](function(_0x19e5ef){_0x2284ca[_0xec48('0x21')]=_0x19e5ef;if(_0x13049c[_0xec48('0x33')]['includeAll']){_0x410692['include']=[{'all':!![]}];}return db[_0xec48('0x2d')][_0xec48('0x42')](_0x410692);})['then'](function(_0x87fad1){_0x2284ca[_0xec48('0x43')]=_0x87fad1;return _0x2284ca;})['then'](respondWithFilteredResult(_0x5476c2,_0x410692))[_0xec48('0x44')](handleError(_0x5476c2,null));};exports[_0xec48('0x45')]=function(_0x4ecc6f,_0x197e87){var _0xc42963={'raw':![],'where':{'id':_0x4ecc6f['params']['id']}},_0x5318ea={};_0x5318ea[_0xec48('0x30')]=_[_0xec48('0x34')](db['VoiceRecording'][_0xec48('0x2e')]);_0x5318ea['query']=_[_0xec48('0x34')](_0x4ecc6f['query']);_0x5318ea[_0xec48('0x35')]=_[_0xec48('0x36')](_0x5318ea['model'],_0x5318ea['query']);_0xc42963[_0xec48('0x37')]=_[_0xec48('0x36')](_0x5318ea['model'],qs[_0xec48('0x38')](_0x4ecc6f[_0xec48('0x33')][_0xec48('0x38')]));_0xc42963[_0xec48('0x37')]=_0xc42963[_0xec48('0x37')][_0xec48('0x46')]?_0xc42963[_0xec48('0x37')]:_0x5318ea[_0xec48('0x30')];if(_0x4ecc6f[_0xec48('0x33')][_0xec48('0x47')]){_0xc42963[_0xec48('0x48')]=[{'all':!![]}];}_0xc42963=_['merge']({},_0xc42963,_0x4ecc6f[_0xec48('0x41')]);return db[_0xec48('0x2d')][_0xec48('0x49')](_0xc42963)[_0xec48('0x27')](handleEntityNotFound(_0x197e87,null))['then'](respondWithResult(_0x197e87,null))[_0xec48('0x44')](handleError(_0x197e87,null));};exports[_0xec48('0x4a')]=function(_0x23d270,_0x2a5cba){return db[_0xec48('0x2d')][_0xec48('0x4a')](_0x23d270[_0xec48('0x4b')],{})['then'](respondWithResult(_0x2a5cba,0xc9))[_0xec48('0x44')](handleError(_0x2a5cba,null));};exports[_0xec48('0x26')]=function(_0x26373a,_0x1beb44){if(_0x26373a[_0xec48('0x4b')]['id']){delete _0x26373a[_0xec48('0x4b')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x26373a['params']['id']}})[_0xec48('0x27')](handleEntityNotFound(_0x1beb44,null))[_0xec48('0x27')](saveUpdates(_0x26373a[_0xec48('0x4b')],null))['then'](respondWithResult(_0x1beb44,null))[_0xec48('0x44')](handleError(_0x1beb44,null));};exports['describe']=function(_0x55772d,_0x49fdf9){return db[_0xec48('0x2d')][_0xec48('0x4c')]()[_0xec48('0x27')](respondWithResult(_0x49fdf9,null))[_0xec48('0x44')](handleError(_0x49fdf9,null));};exports[_0xec48('0x4d')]=function(_0x552676,_0x4d97bd,_0x846989){var _0x25997a=require(_0xec48('0x4e'));var _0x386b13=![];var _0x2d1cb3={};if(_0x552676[_0xec48('0x33')]['type']&&_0x552676[_0xec48('0x33')][_0xec48('0x3f')]===_0xec48('0x4f')){_0x2d1cb3[_0xec48('0x4f')]=_0x552676[_0xec48('0x50')]['id'];}else{_0x2d1cb3['id']=_0x552676[_0xec48('0x50')]['id'];}return db[_0xec48('0x2d')][_0xec48('0x49')]({'where':_0x2d1cb3,'attributes':['id',_0xec48('0x51')],'raw':!![]})[_0xec48('0x27')](handleEntityNotFound(_0x4d97bd,null))[_0xec48('0x27')](function(_0x261535){if(_0x261535){var _0x42cafc=_0x261535[_0xec48('0x51')];var _0x1360eb=util[_0xec48('0x32')](_0xec48('0x52'),_0x42cafc);if(fs[_0xec48('0x53')](_0x1360eb)){_0x386b13=!![];return _0x25997a[_0xec48('0x54')](_0x1360eb,_0x42cafc,config[_0xec48('0x55')][_0xec48('0x56')])[_0xec48('0x27')](function(){return _0x261535;});}return _0x261535;}})[_0xec48('0x27')](function(_0x1bcca4){if(_0x1bcca4){var _0x37202c=_0x1bcca4[_0xec48('0x51')];if(!fs[_0xec48('0x53')](_0x37202c)){throw new db[(_0xec48('0x57'))][(_0xec48('0x58'))](_0xec48('0x59'));}if(_0x1bcca4[_0xec48('0x5a')]){return _0x4d97bd[_0xec48('0x4d')](_0x37202c,_0x1bcca4[_0xec48('0x5a')]+path[_0xec48('0x5b')](_0x37202c),function(){if(_0x386b13){fs['unlink'](_0x37202c);}});}else{return _0x4d97bd['download'](_0x37202c,function(_0x2581dc){if(_0x386b13){fs[_0xec48('0x5c')](_0x37202c);}});}}})[_0xec48('0x44')](function(_0x55228e){if(_0x55228e[_0xec48('0x5d')]==='VoiceRecording\x20not\x20found'){_0x4d97bd[_0xec48('0x1c')](0x194)[_0xec48('0x2b')](_0xec48('0x5e'));}else{return handleError(_0x4d97bd,null);}});};exports[_0xec48('0x5f')]=function(_0x3ae5e0,_0x569969,_0x3bbd15){var _0x37253f=require(_0xec48('0x4e'));var _0x1872e0=![];var _0x1c52e6={'$and':[db[_0xec48('0x60')][_0xec48('0x3e')](db['sequelize']['fn'](_0xec48('0x61'),db['sequelize'][_0xec48('0x62')](_0xec48('0x4f'))),_0x3ae5e0[_0xec48('0x33')]['token'])]};if(_0x3ae5e0[_0xec48('0x33')][_0xec48('0x3f')]&&_0x3ae5e0['query']['type']==='uniqueid'){_0x1c52e6[_0xec48('0x63')][_0xec48('0x64')]({'uniqueid':_0x3ae5e0[_0xec48('0x50')]['id']});}else{_0x1c52e6[_0xec48('0x63')]['push']({'id':_0x3ae5e0[_0xec48('0x50')]['id']});}return db[_0xec48('0x2d')][_0xec48('0x49')]({'where':_0x1c52e6,'attributes':['id',_0xec48('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x569969,null))[_0xec48('0x27')](function(_0xfe7f23){if(_0xfe7f23){var _0x4ada3a=util['format'](_0xec48('0x52'),_0xfe7f23['value']);if(fs[_0xec48('0x53')](_0x4ada3a)){_0x1872e0=!![];return _0x37253f[_0xec48('0x54')](_0x4ada3a,_0xfe7f23[_0xec48('0x51')],config[_0xec48('0x55')]['recording'])['then'](function(){return _0xfe7f23;});}return _0xfe7f23;}})[_0xec48('0x27')](function(_0x273027){if(_0x273027){if(!fs[_0xec48('0x53')](_0x273027['value'])){throw new db['Sequelize']['ValidationError'](_0xec48('0x59'));}if(_0x273027['filename']){return _0x569969[_0xec48('0x4d')](_0x273027[_0xec48('0x51')],_0x273027[_0xec48('0x5a')]+path[_0xec48('0x5b')](_0x273027[_0xec48('0x51')]),function(){if(_0x1872e0){fs['unlink'](_0x273027['value']);}});}else{return _0x569969[_0xec48('0x4d')](_0x273027[_0xec48('0x51')],function(_0x3ec919){if(_0x1872e0){fs[_0xec48('0x5c')](_0x273027['value']);}});}}})['catch'](handleError(_0x569969,null));};exports[_0xec48('0x28')]=function(_0xdd021d,_0x55b7f4){return db[_0xec48('0x2d')][_0xec48('0x49')]({'where':{'id':_0xdd021d[_0xec48('0x50')]['id']}})[_0xec48('0x27')](function(_0x20535d){if(_[_0xec48('0x65')](_0x20535d)){throw new ReferenceError(_0xec48('0x66'));}return _0x20535d;})[_0xec48('0x27')](function(_0x20c3e9){var _0x21bebe=_0x20c3e9[_0xec48('0x51')];logger[_0xec48('0x67')](_0xec48('0x68'),_0x21bebe);if(!_[_0xec48('0x65')](_0x20c3e9[_0xec48('0x51')])&&fs[_0xec48('0x53')](_0x21bebe)){logger['info'](_0xec48('0x69')+_0x21bebe+_0xec48('0x6a'));fs[_0xec48('0x6b')](_0x21bebe);}_0x21bebe=_0x21bebe+_0xec48('0x6c');if(!_[_0xec48('0x65')](_0x20c3e9[_0xec48('0x51')])&&fs[_0xec48('0x53')](_0x21bebe)){logger['info'](_0xec48('0x69')+_0x21bebe+_0xec48('0x6a'));fs[_0xec48('0x6b')](_0x21bebe);}return _0x20c3e9;})['then'](function(_0x481228){if(!_0x481228)throw new InternalError();return _0x481228[_0xec48('0x28')]();})['then'](function(){_0x55b7f4['status'](0xcc)['end']();})['catch'](handleError(_0x55b7f4,null));};function getBucketslist(_0x41c27a,_0xa100f7,_0x384986){return new Promise(function(_0x267872,_0x32d13f){var _0x208d9f=new AWS['S3']({'accessKeyId':_0xa100f7,'secretAccessKey':_0x41c27a,'region':_0x384986});_0x208d9f[_0xec48('0x6d')]({},function(_0x2af33c,_0xe4a294){if(_0x2af33c){return _0x32d13f(_0x2af33c);}else{return _0x267872(_0xe4a294);}});});}function createBucket(_0x350953,_0x3bc238,_0x1ec9a3,_0x554a8e){return new Promise(function(_0x5b21f9,_0x1a70bf){var _0x3e9df8=new AWS['S3']({'accessKeyId':_0x3bc238,'secretAccessKey':_0x350953,'region':_0x1ec9a3});_0x3e9df8['createBucket']({'Bucket':_0x554a8e},function(_0x5c75ba,_0x3b2b2e){if(_0x5c75ba){return _0x1a70bf(_0x5c75ba);}else{return _0x5b21f9(_0x3b2b2e);}});});}function uploadFile(_0x51a923,_0x30d8d0,_0x2a5d02,_0x121662,_0x1b025e,_0x18f979){return new Promise(function(_0x5b5223,_0x38b6d3){var _0x21dff1=new AWS['S3']({'accessKeyId':_0x30d8d0,'secretAccessKey':_0x51a923,'region':_0x2a5d02});_0x21dff1[_0xec48('0x6e')]({'Bucket':_0x121662,'Key':_0x1b025e,'Body':_0x18f979},function(_0x427f50,_0x5c602b){if(_0x427f50){return _0x38b6d3(_0x427f50);}else{return _0x5b5223(_0x5c602b);}});});}function startTranscribe(_0x4b67cc,_0x27fcee,_0x558d79,_0x8db671,_0x58a280,_0x520b3a){return new Promise(function(_0x5973e0,_0x1fe3bf){var _0x304cce=new AWS[(_0xec48('0x6f'))]({'accessKeyId':_0x27fcee,'secretAccessKey':_0x4b67cc,'region':_0x558d79});_0x304cce[_0xec48('0x70')]({'TranscriptionJobName':_0x8db671,'LanguageCode':_0x58a280,'Media':{'MediaFileUri':_0x520b3a}},function(_0x3d5907,_0x42bc11){if(_0x3d5907){return _0x1fe3bf(_0x3d5907);}else{return _0x5973e0(_0x42bc11);}});});}function transcribe(_0x29feb2,_0x571fc2,_0x5e8e7b,_0x540b91,_0x10cb03,_0x64135b,_0x291524){return new Promise(function(_0x35bb89,_0x47f1e0){var _0x573f18={};logger[_0xec48('0x67')](util['format'](_0xec48('0x71'),_0x29feb2,_0x10cb03));return uploadFile(_0x571fc2,_0x5e8e7b,_0x540b91,_0x10cb03,path['basename'](_0x64135b),fs[_0xec48('0x72')](_0x64135b))[_0xec48('0x27')](function(_0x7b80c9){logger[_0xec48('0x67')](util[_0xec48('0x32')](_0xec48('0x73'),_0x29feb2,_0x10cb03,_0x7b80c9[_0xec48('0x74')]));_0x573f18['bucket']=_0x7b80c9[_0xec48('0x75')];_0x573f18[_0xec48('0x76')]=_0x7b80c9['Location'];logger[_0xec48('0x67')](util[_0xec48('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x29feb2));return startTranscribe(_0x571fc2,_0x5e8e7b,_0x540b91,uuidv4(),_0x291524,_0x7b80c9['Location']);})['then'](function(_0x54df1f){logger[_0xec48('0x67')](util['format'](_0xec48('0x77'),_0x29feb2,_0x54df1f['TranscriptionJob'][_0xec48('0x78')]));_0x573f18['transcribeName']=_0x54df1f[_0xec48('0x79')][_0xec48('0x78')];_0x573f18[_0xec48('0x7a')]=_0x54df1f[_0xec48('0x79')][_0xec48('0x7b')];return _0x35bb89(_0x573f18);})[_0xec48('0x44')](function(_0x661f6b){return _0x47f1e0(_0x661f6b);});});}exports[_0xec48('0x7c')]=function(_0x68c357,_0x213822,_0x2e4d0c){var _0x13b466;var _0x5219bf;var _0xa10d3b;var _0x574e05=require(_0xec48('0x4e'));return db[_0xec48('0x2d')]['findOne']({'where':{'id':_0x68c357[_0xec48('0x50')]['id']}})[_0xec48('0x27')](function(_0x488f06){if(_0x488f06){var _0x255423=util[_0xec48('0x32')](_0xec48('0x52'),_0x488f06[_0xec48('0x51')]);if(fs[_0xec48('0x53')](_0x255423)){cypher=!![];return _0x574e05[_0xec48('0x54')](_0x255423,_0x488f06['value'],config[_0xec48('0x55')][_0xec48('0x56')])[_0xec48('0x27')](function(){return _0x488f06;});}return _0x488f06;}})[_0xec48('0x27')](function(_0x3d14c9){if(!_0x3d14c9){throw new db[(_0xec48('0x57'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x5219bf=_0x3d14c9;return db[_0xec48('0x7d')][_0xec48('0x7e')]({'where':{'id':0x1}});})[_0xec48('0x27')](handleEntityNotFound(_0x213822,null))[_0xec48('0x27')](function(_0x37b461){if(_0x37b461){_0x13b466=_0x37b461;if(!_0x13b466[_0xec48('0x7f')]||!_0x13b466[_0xec48('0x80')]||!_0x13b466['transcribeRegion']||!_0x13b466[_0xec48('0x81')]||!_0x13b466['bucket']){throw new db[(_0xec48('0x57'))]['ValidationError'](_0xec48('0x82'));}if(_0x68c357[_0xec48('0x4b')][_0xec48('0x83')]&&(!_0x13b466[_0xec48('0x84')]||!_0x13b466[_0xec48('0x85')]||!_0x13b466[_0xec48('0x86')]||!_0x13b466['language']||!_0x13b466['bucket'])){throw new db[(_0xec48('0x57'))][(_0xec48('0x58'))](_0xec48('0x87'));}return db[_0xec48('0x88')][_0xec48('0x7e')]({'where':{'id':_0x13b466[_0xec48('0x80')]}});}})[_0xec48('0x27')](function(_0x491741){if(!_0x491741){throw new db[(_0xec48('0x57'))][(_0xec48('0x58'))](_0xec48('0x89'));}if(!_0x491741[_0xec48('0x8a')]||!_0x491741[_0xec48('0x8b')]){throw new db['Sequelize'][(_0xec48('0x58'))](_0xec48('0x8c'));}_0xa10d3b=_0x491741;return getBucketslist(_0xa10d3b[_0xec48('0x8a')],_0xa10d3b[_0xec48('0x8b')],_0x13b466['transcribeRegion']);})[_0xec48('0x27')](function(_0xc7bfc3){if(_0xc7bfc3&&_0xc7bfc3[_0xec48('0x8d')]){var _0x4301a9=_[_0xec48('0x49')](_0xc7bfc3[_0xec48('0x8d')],function(_0x21ebcc){return _0x21ebcc[_0xec48('0x8e')]===_0x13b466[_0xec48('0x8f')];});if(!_0x4301a9){logger[_0xec48('0x67')](util[_0xec48('0x32')](_0xec48('0x90'),_0x68c357['params']['id'],_0x13b466['bucket']));return createBucket(_0xa10d3b['data1'],_0xa10d3b[_0xec48('0x8b')],_0x13b466['transcribeRegion'],_0x13b466[_0xec48('0x8f')]);}logger[_0xec48('0x67')](util[_0xec48('0x32')](_0xec48('0x91'),_0x68c357[_0xec48('0x50')]['id'],_0x13b466['bucket']));return;}})[_0xec48('0x27')](function(_0x22f20b){if(_0x5219bf[_0xec48('0x7a')]===_0xec48('0x92')){return transcribe(_0x68c357[_0xec48('0x50')]['id'],_0xa10d3b['data1'],_0xa10d3b[_0xec48('0x8b')],_0x13b466[_0xec48('0x93')],_0x13b466['bucket'],_0x5219bf[_0xec48('0x51')],_0x13b466['language']);}else{logger[_0xec48('0x67')](util[_0xec48('0x32')](_0xec48('0x94'),_0x68c357['params']['id']));return{'transcribeStatus':_0xec48('0x95')};}})[_0xec48('0x27')](function(_0x9783a6){if(_0x9783a6){_0x9783a6[_0xec48('0x96')]=_0x68c357[_0xec48('0x4b')][_0xec48('0x83')];return _0x5219bf[_0xec48('0x97')](_0x9783a6);}})[_0xec48('0x27')](respondWithResult(_0x213822,null))[_0xec48('0x44')](handleError(_0x213822,null));};function writeFile(_0x312226,_0x43f2ae){return new Promise(function(_0x16bf80,_0x4d2291){fs[_0xec48('0x98')](_0x43f2ae,_0x312226,function(_0x3d961c,_0x1a9005){if(_0x3d961c){return _0x4d2291(_0x3d961c);}else{return _0x16bf80(_0x1a9005);}});});}exports[_0xec48('0x99')]=function(_0x2c5ede,_0x56310c,_0x11bafc){return db['VoiceRecording'][_0xec48('0x7e')]({'where':{'id':_0x2c5ede[_0xec48('0x50')]['id']}})[_0xec48('0x27')](handleEntityNotFound(_0x56310c))[_0xec48('0x27')](function(_0x3c8be2){if(_0x3c8be2&&_0x3c8be2[_0xec48('0x9a')]){var _0xa95de7=_0x3c8be2[_0xec48('0x9a')];var _0x34690c=config['root']+_0xec48('0x9b')+_0x3c8be2['id']+_0xec48('0x9c');if(fs[_0xec48('0x53')](_0x34690c)){return _0x34690c;}return writeFile(_0xa95de7,_0x34690c)[_0xec48('0x27')](function(){return _0x34690c;});}else{throw new db[(_0xec48('0x57'))][(_0xec48('0x58'))](_0xec48('0x9d'));}})[_0xec48('0x27')](function(_0x3747a8){return _0x56310c['download'](_0x3747a8);})['catch'](handleError(_0x56310c));}; \ No newline at end of file +var _0xb6e3=['keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','sequelize','MD5','col','token','push','$and','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','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','querystring','papaparse','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','stack','name','map','VoiceRecording','fieldName','type','model','format'];(function(_0x1a357d,_0x23d284){var _0x51a696=function(_0x54ecad){while(--_0x54ecad){_0x1a357d['push'](_0x1a357d['shift']());}};_0x51a696(++_0x23d284);}(_0xb6e3,0x199));var _0x3b6e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb6e3[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x3b6e('0x0'));var rimraf=require(_0x3b6e('0x1'));var zipdir=require(_0x3b6e('0x2'));var jsonpatch=require(_0x3b6e('0x3'));var rp=require(_0x3b6e('0x4'));var moment=require(_0x3b6e('0x5'));var BPromise=require(_0x3b6e('0x6'));var Mustache=require(_0x3b6e('0x7'));var util=require(_0x3b6e('0x8'));var path=require(_0x3b6e('0x9'));var sox=require(_0x3b6e('0xa'));var csv=require(_0x3b6e('0xb'));var ejs=require(_0x3b6e('0xc'));var fs=require('fs');var fs_extra=require(_0x3b6e('0xd'));var _=require(_0x3b6e('0xe'));var squel=require(_0x3b6e('0xf'));var crypto=require(_0x3b6e('0x10'));var jsforce=require(_0x3b6e('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x3b6e('0xb'));var querystring=require(_0x3b6e('0x12'));var Papa=require(_0x3b6e('0x13'));var AWS=require('aws-sdk');var uuidv4=require(_0x3b6e('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b6e('0x15'));var as=require(_0x3b6e('0x16'));var hardwareService=require(_0x3b6e('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3b6e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b6e('0x19'))['db'];function respondWithStatusCode(_0x11fe23,_0x38048a){_0x38048a=_0x38048a||0xcc;return function(_0x22d021){if(_0x22d021){return _0x11fe23[_0x3b6e('0x1a')](_0x38048a);}return _0x11fe23['status'](_0x38048a)['end']();};}function respondWithResult(_0x5ace19,_0x3e7e82){_0x3e7e82=_0x3e7e82||0xc8;return function(_0x1659ca){if(_0x1659ca){return _0x5ace19[_0x3b6e('0x1b')](_0x3e7e82)[_0x3b6e('0x1c')](_0x1659ca);}};}function respondWithFilteredResult(_0x33ac36,_0x46e522){return function(_0x2912eb){if(_0x2912eb){var _0x2388e8=typeof _0x46e522[_0x3b6e('0x1d')]===_0x3b6e('0x1e')&&typeof _0x46e522[_0x3b6e('0x1f')]===_0x3b6e('0x1e');var _0x215ed6=_0x2912eb[_0x3b6e('0x20')];var _0x5e8128=_0x2388e8?0x0:_0x46e522[_0x3b6e('0x1d')];var _0x113285=_0x2388e8?_0x2912eb['count']:_0x46e522['offset']+_0x46e522[_0x3b6e('0x1f')];var _0x2f0d13;if(_0x113285>=_0x215ed6){_0x113285=_0x215ed6;_0x2f0d13=0xc8;}else{_0x2f0d13=0xce;}_0x33ac36[_0x3b6e('0x1b')](_0x2f0d13);return _0x33ac36['set'](_0x3b6e('0x21'),_0x5e8128+'-'+_0x113285+'/'+_0x215ed6)[_0x3b6e('0x1c')](_0x2912eb);}return null;};}function patchUpdates(_0x176518){return function(_0x21d8bc){try{jsonpatch[_0x3b6e('0x22')](_0x21d8bc,_0x176518,!![]);}catch(_0x298a15){return BPromise['reject'](_0x298a15);}return _0x21d8bc[_0x3b6e('0x23')]();};}function saveUpdates(_0x198713,_0x1b268d){return function(_0x3f2c71){if(_0x3f2c71){return _0x3f2c71[_0x3b6e('0x24')](_0x198713)[_0x3b6e('0x25')](function(_0x1d5c98){return _0x1d5c98;});}return null;};}function removeEntity(_0x1db48d,_0x5ecb01){return function(_0xfc1e25){if(_0xfc1e25){return _0xfc1e25['destroy']()[_0x3b6e('0x25')](function(){_0x1db48d[_0x3b6e('0x1b')](0xcc)[_0x3b6e('0x26')]();});}};}function handleEntityNotFound(_0x362eb5,_0xe70fde){return function(_0x5ba4b3){if(!_0x5ba4b3){_0x362eb5[_0x3b6e('0x1a')](0x194);}return _0x5ba4b3;};}function handleError(_0x3c51,_0x358131){_0x358131=_0x358131||0x1f4;return function(_0x2cdc80){logger['error'](_0x2cdc80[_0x3b6e('0x27')]);if(_0x2cdc80[_0x3b6e('0x28')]){delete _0x2cdc80['name'];}_0x3c51[_0x3b6e('0x1b')](_0x358131)['send'](_0x2cdc80);};}exports['index']=function(_0x2c5168,_0x32ae5a){var _0x3166c3={},_0x23b6a7={},_0xe52780={'count':0x0,'rows':[]};var _0x542136=_[_0x3b6e('0x29')](db[_0x3b6e('0x2a')]['rawAttributes'],function(_0x2d9a60){return{'name':_0x2d9a60[_0x3b6e('0x2b')],'type':_0x2d9a60[_0x3b6e('0x2c')]['key']};});_0x23b6a7[_0x3b6e('0x2d')]=_['differenceBy'](_[_0x3b6e('0x29')](_0x542136,_0x3b6e('0x28')),[_0x3b6e('0x2e')]);_0x23b6a7['query']=_[_0x3b6e('0x2f')](_0x2c5168['query']);_0x23b6a7['filters']=_[_0x3b6e('0x30')](_0x23b6a7[_0x3b6e('0x2d')],_0x23b6a7[_0x3b6e('0x31')]);_0x3166c3[_0x3b6e('0x32')]=_['intersection'](_0x23b6a7[_0x3b6e('0x2d')],qs['fields'](_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x33')]));_0x3166c3[_0x3b6e('0x32')]=_0x3166c3[_0x3b6e('0x32')][_0x3b6e('0x34')]?_0x3166c3[_0x3b6e('0x32')]:_0x23b6a7[_0x3b6e('0x2d')];if(!_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x35')](_0x3b6e('0x36'))){_0x3166c3[_0x3b6e('0x1f')]=qs['limit'](_0x2c5168['query'][_0x3b6e('0x1f')]);_0x3166c3[_0x3b6e('0x1d')]=qs[_0x3b6e('0x1d')](_0x2c5168[_0x3b6e('0x31')]['offset']);}_0x3166c3[_0x3b6e('0x37')]=qs[_0x3b6e('0x38')](_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x38')]);_0x3166c3[_0x3b6e('0x39')]=qs[_0x3b6e('0x3a')](_['pick'](_0x2c5168[_0x3b6e('0x31')],_0x23b6a7['filters']),_0x542136);if(_0x2c5168['query'][_0x3b6e('0x3b')]){_0x3166c3[_0x3b6e('0x39')]=_[_0x3b6e('0x3c')](_0x3166c3['where'],{'$or':_[_0x3b6e('0x29')](_0x542136,function(_0x593fc0){if(_0x593fc0[_0x3b6e('0x2c')]!==_0x3b6e('0x3d')){var _0x2cc854={};_0x2cc854[_0x593fc0[_0x3b6e('0x28')]]={'$like':'%'+_0x2c5168[_0x3b6e('0x31')]['filter']+'%'};return _0x2cc854;}})});}_0x3166c3=_[_0x3b6e('0x3c')]({},_0x3166c3,_0x2c5168[_0x3b6e('0x3e')]);var _0x40d073={'where':_0x3166c3[_0x3b6e('0x39')]};return db[_0x3b6e('0x2a')][_0x3b6e('0x20')](_0x40d073)[_0x3b6e('0x25')](function(_0x3a56c8){_0xe52780[_0x3b6e('0x20')]=_0x3a56c8;if(_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x3f')]){_0x3166c3[_0x3b6e('0x40')]=[{'all':!![]}];}return db[_0x3b6e('0x2a')][_0x3b6e('0x41')](_0x3166c3);})[_0x3b6e('0x25')](function(_0x452f79){_0xe52780[_0x3b6e('0x42')]=_0x452f79;return _0xe52780;})['then'](respondWithFilteredResult(_0x32ae5a,_0x3166c3))[_0x3b6e('0x43')](handleError(_0x32ae5a,null));};exports['show']=function(_0x3334a9,_0x5ed05e){var _0x13dce7={'raw':![],'where':{'id':_0x3334a9[_0x3b6e('0x44')]['id']}},_0x572b15={};_0x572b15[_0x3b6e('0x2d')]=_[_0x3b6e('0x2f')](db['VoiceRecording'][_0x3b6e('0x45')]);_0x572b15[_0x3b6e('0x31')]=_[_0x3b6e('0x2f')](_0x3334a9[_0x3b6e('0x31')]);_0x572b15[_0x3b6e('0x3a')]=_[_0x3b6e('0x30')](_0x572b15[_0x3b6e('0x2d')],_0x572b15[_0x3b6e('0x31')]);_0x13dce7['attributes']=_['intersection'](_0x572b15[_0x3b6e('0x2d')],qs['fields'](_0x3334a9[_0x3b6e('0x31')]['fields']));_0x13dce7[_0x3b6e('0x32')]=_0x13dce7[_0x3b6e('0x32')]['length']?_0x13dce7[_0x3b6e('0x32')]:_0x572b15['model'];if(_0x3334a9[_0x3b6e('0x31')]['includeAll']){_0x13dce7['include']=[{'all':!![]}];}_0x13dce7=_['merge']({},_0x13dce7,_0x3334a9['options']);return db[_0x3b6e('0x2a')][_0x3b6e('0x46')](_0x13dce7)[_0x3b6e('0x25')](handleEntityNotFound(_0x5ed05e,null))[_0x3b6e('0x25')](respondWithResult(_0x5ed05e,null))['catch'](handleError(_0x5ed05e,null));};exports[_0x3b6e('0x47')]=function(_0x34ee8d,_0x59f389){return db[_0x3b6e('0x2a')]['create'](_0x34ee8d['body'],{})[_0x3b6e('0x25')](respondWithResult(_0x59f389,0xc9))[_0x3b6e('0x43')](handleError(_0x59f389,null));};exports[_0x3b6e('0x24')]=function(_0x3e8fe6,_0x474c3d){if(_0x3e8fe6[_0x3b6e('0x48')]['id']){delete _0x3e8fe6[_0x3b6e('0x48')]['id'];}return db[_0x3b6e('0x2a')][_0x3b6e('0x46')]({'where':{'id':_0x3e8fe6[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](handleEntityNotFound(_0x474c3d,null))[_0x3b6e('0x25')](saveUpdates(_0x3e8fe6[_0x3b6e('0x48')],null))[_0x3b6e('0x25')](respondWithResult(_0x474c3d,null))[_0x3b6e('0x43')](handleError(_0x474c3d,null));};exports[_0x3b6e('0x49')]=function(_0x3e461e,_0xbc166d){return db['VoiceRecording']['describe']()[_0x3b6e('0x25')](respondWithResult(_0xbc166d,null))['catch'](handleError(_0xbc166d,null));};exports[_0x3b6e('0x4a')]=function(_0x1e1d06,_0x3861f8,_0x146516){var _0x101d92=require(_0x3b6e('0x4b'));var _0x4d1a5d=![];var _0x3a8aa9={};if(_0x1e1d06[_0x3b6e('0x31')][_0x3b6e('0x2c')]&&_0x1e1d06[_0x3b6e('0x31')][_0x3b6e('0x2c')]===_0x3b6e('0x4c')){_0x3a8aa9[_0x3b6e('0x4c')]=_0x1e1d06[_0x3b6e('0x44')]['id'];}else{_0x3a8aa9['id']=_0x1e1d06['params']['id'];}return db[_0x3b6e('0x2a')]['find']({'where':_0x3a8aa9,'attributes':['id',_0x3b6e('0x4d')],'raw':!![]})[_0x3b6e('0x25')](handleEntityNotFound(_0x3861f8,null))[_0x3b6e('0x25')](function(_0x4f50ad){if(_0x4f50ad){var _0x10bbf3=_0x4f50ad[_0x3b6e('0x4d')];var _0x1c43fd=util[_0x3b6e('0x2e')](_0x3b6e('0x4e'),_0x10bbf3);if(fs['existsSync'](_0x1c43fd)){_0x4d1a5d=!![];return _0x101d92[_0x3b6e('0x4f')](_0x1c43fd,_0x10bbf3,config[_0x3b6e('0x50')][_0x3b6e('0x51')])['then'](function(){return _0x4f50ad;});}return _0x4f50ad;}})['then'](function(_0x534afd){if(_0x534afd){var _0x2d6283=_0x534afd[_0x3b6e('0x4d')];if(!fs[_0x3b6e('0x52')](_0x2d6283)){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x534afd[_0x3b6e('0x55')]){return _0x3861f8[_0x3b6e('0x4a')](_0x2d6283,_0x534afd[_0x3b6e('0x55')]+path[_0x3b6e('0x56')](_0x2d6283),function(){if(_0x4d1a5d){fs[_0x3b6e('0x57')](_0x2d6283);}});}else{return _0x3861f8['download'](_0x2d6283,function(_0xdeab19){if(_0x4d1a5d){fs['unlink'](_0x2d6283);}});}}})['catch'](function(_0x12638b){if(_0x12638b[_0x3b6e('0x58')]===_0x3b6e('0x59')){_0x3861f8[_0x3b6e('0x1b')](0x194)[_0x3b6e('0x5a')](_0x3b6e('0x5b'));}else{return handleError(_0x3861f8,null);}});};exports['downloads']=function(_0x57d9b,_0x2a90db,_0x192d5f){var _0xe5af39=require(_0x3b6e('0x4b'));var _0x1dc856=![];var _0x8a811b={'$and':[db['sequelize'][_0x3b6e('0x39')](db[_0x3b6e('0x5c')]['fn'](_0x3b6e('0x5d'),db[_0x3b6e('0x5c')][_0x3b6e('0x5e')](_0x3b6e('0x4c'))),_0x57d9b[_0x3b6e('0x31')][_0x3b6e('0x5f')])]};if(_0x57d9b[_0x3b6e('0x31')][_0x3b6e('0x2c')]&&_0x57d9b[_0x3b6e('0x31')]['type']==='uniqueid'){_0x8a811b['$and'][_0x3b6e('0x60')]({'uniqueid':_0x57d9b[_0x3b6e('0x44')]['id']});}else{_0x8a811b[_0x3b6e('0x61')]['push']({'id':_0x57d9b[_0x3b6e('0x44')]['id']});}return db[_0x3b6e('0x2a')]['find']({'where':_0x8a811b,'attributes':['id',_0x3b6e('0x4d')],'raw':!![]})[_0x3b6e('0x25')](handleEntityNotFound(_0x2a90db,null))['then'](function(_0x3d4e27){if(_0x3d4e27){var _0x5f11c2=util[_0x3b6e('0x2e')]('%s.cypher',_0x3d4e27[_0x3b6e('0x4d')]);if(fs[_0x3b6e('0x52')](_0x5f11c2)){_0x1dc856=!![];return _0xe5af39[_0x3b6e('0x4f')](_0x5f11c2,_0x3d4e27[_0x3b6e('0x4d')],config['secrets'][_0x3b6e('0x51')])[_0x3b6e('0x25')](function(){return _0x3d4e27;});}return _0x3d4e27;}})[_0x3b6e('0x25')](function(_0xb6fd5f){if(_0xb6fd5f){if(!fs[_0x3b6e('0x52')](_0xb6fd5f[_0x3b6e('0x4d')])){throw new db[(_0x3b6e('0x53'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0xb6fd5f[_0x3b6e('0x55')]){return _0x2a90db[_0x3b6e('0x4a')](_0xb6fd5f[_0x3b6e('0x4d')],_0xb6fd5f[_0x3b6e('0x55')]+path[_0x3b6e('0x56')](_0xb6fd5f['value']),function(){if(_0x1dc856){fs[_0x3b6e('0x57')](_0xb6fd5f['value']);}});}else{return _0x2a90db[_0x3b6e('0x4a')](_0xb6fd5f[_0x3b6e('0x4d')],function(_0x42dc2a){if(_0x1dc856){fs['unlink'](_0xb6fd5f['value']);}});}}})['catch'](handleError(_0x2a90db,null));};exports[_0x3b6e('0x62')]=function(_0x244958,_0xe9fb29){return db[_0x3b6e('0x2a')][_0x3b6e('0x46')]({'where':{'id':_0x244958[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](function(_0x413127){if(_[_0x3b6e('0x63')](_0x413127)){throw new ReferenceError(_0x3b6e('0x64'));}return _0x413127;})['then'](function(_0x203011){var _0x351c80=_0x203011[_0x3b6e('0x4d')];logger[_0x3b6e('0x65')](_0x3b6e('0x66'),_0x351c80);if(!_[_0x3b6e('0x63')](_0x203011[_0x3b6e('0x4d')])&&fs[_0x3b6e('0x52')](_0x351c80)){logger[_0x3b6e('0x65')](_0x3b6e('0x67')+_0x351c80+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3b6e('0x68')](_0x351c80);}_0x351c80=_0x351c80+_0x3b6e('0x69');if(!_[_0x3b6e('0x63')](_0x203011[_0x3b6e('0x4d')])&&fs['existsSync'](_0x351c80)){logger[_0x3b6e('0x65')]('File:\x20\x22'+_0x351c80+_0x3b6e('0x6a'));fs[_0x3b6e('0x68')](_0x351c80);}return _0x203011;})[_0x3b6e('0x25')](function(_0x420b82){if(!_0x420b82)throw new InternalError();return _0x420b82[_0x3b6e('0x62')]();})[_0x3b6e('0x25')](function(){_0xe9fb29['status'](0xcc)[_0x3b6e('0x26')]();})[_0x3b6e('0x43')](handleError(_0xe9fb29,null));};function getBucketslist(_0x3c9b88,_0x4866df,_0x35a6da){return new Promise(function(_0x198f3f,_0x4a3e23){var _0x44d502=new AWS['S3']({'accessKeyId':_0x4866df,'secretAccessKey':_0x3c9b88,'region':_0x35a6da});_0x44d502[_0x3b6e('0x6b')]({},function(_0x2bdba0,_0x154240){if(_0x2bdba0){return _0x4a3e23(_0x2bdba0);}else{return _0x198f3f(_0x154240);}});});}function createBucket(_0x50a3cc,_0x490a5b,_0x3b1448,_0x511590){return new Promise(function(_0x27b955,_0x24b498){var _0x342fc4=new AWS['S3']({'accessKeyId':_0x490a5b,'secretAccessKey':_0x50a3cc,'region':_0x3b1448});_0x342fc4[_0x3b6e('0x6c')]({'Bucket':_0x511590},function(_0x5aac9e,_0x44e6aa){if(_0x5aac9e){return _0x24b498(_0x5aac9e);}else{return _0x27b955(_0x44e6aa);}});});}function uploadFile(_0x2e17ae,_0x658d78,_0x28b125,_0xf87b6,_0x807b53,_0x2e3184){return new Promise(function(_0x1af6e3,_0x1ea43e){var _0x278f85=new AWS['S3']({'accessKeyId':_0x658d78,'secretAccessKey':_0x2e17ae,'region':_0x28b125});_0x278f85[_0x3b6e('0x6d')]({'Bucket':_0xf87b6,'Key':_0x807b53,'Body':_0x2e3184},function(_0x1e30b6,_0x10ce81){if(_0x1e30b6){return _0x1ea43e(_0x1e30b6);}else{return _0x1af6e3(_0x10ce81);}});});}function startTranscribe(_0x5f2369,_0x19dcb3,_0x433bc0,_0x3fd703,_0x346d98,_0x1e10d7){return new Promise(function(_0x5585dc,_0x3da064){var _0x4af5f0=new AWS['TranscribeService']({'accessKeyId':_0x19dcb3,'secretAccessKey':_0x5f2369,'region':_0x433bc0});_0x4af5f0[_0x3b6e('0x6e')]({'TranscriptionJobName':_0x3fd703,'LanguageCode':_0x346d98,'Media':{'MediaFileUri':_0x1e10d7}},function(_0x437730,_0x5aadff){if(_0x437730){return _0x3da064(_0x437730);}else{return _0x5585dc(_0x5aadff);}});});}function transcribe(_0x3e8874,_0x37c18a,_0x40bc5a,_0x1c2c96,_0x58ff1a,_0x1ff999,_0x43ee38){return new Promise(function(_0x413af2,_0x58b7b9){var _0x13a935={};logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x6f'),_0x3e8874,_0x58ff1a));return uploadFile(_0x37c18a,_0x40bc5a,_0x1c2c96,_0x58ff1a,path['basename'](_0x1ff999),fs[_0x3b6e('0x70')](_0x1ff999))[_0x3b6e('0x25')](function(_0x1ee941){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x71'),_0x3e8874,_0x58ff1a,_0x1ee941[_0x3b6e('0x72')]));_0x13a935[_0x3b6e('0x73')]=_0x1ee941[_0x3b6e('0x74')];_0x13a935[_0x3b6e('0x75')]=_0x1ee941[_0x3b6e('0x72')];logger['info'](util[_0x3b6e('0x2e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3e8874));return startTranscribe(_0x37c18a,_0x40bc5a,_0x1c2c96,uuidv4(),_0x43ee38,_0x1ee941['Location']);})[_0x3b6e('0x25')](function(_0x5484df){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x76'),_0x3e8874,_0x5484df[_0x3b6e('0x77')][_0x3b6e('0x78')]));_0x13a935['transcribeName']=_0x5484df['TranscriptionJob'][_0x3b6e('0x78')];_0x13a935[_0x3b6e('0x79')]=_0x5484df[_0x3b6e('0x77')][_0x3b6e('0x7a')];return _0x413af2(_0x13a935);})[_0x3b6e('0x43')](function(_0x342054){return _0x58b7b9(_0x342054);});});}exports[_0x3b6e('0x7b')]=function(_0x2217b6,_0x46789e,_0x2fa72f){var _0x3365ce;var _0x549cd;var _0x508a66;var _0xbcb3a=require('../../components/encryptor');return db[_0x3b6e('0x2a')]['findOne']({'where':{'id':_0x2217b6['params']['id']}})['then'](function(_0x4cf38b){if(_0x4cf38b){var _0x1202e6=util[_0x3b6e('0x2e')](_0x3b6e('0x4e'),_0x4cf38b[_0x3b6e('0x4d')]);if(fs['existsSync'](_0x1202e6)){cypher=!![];return _0xbcb3a[_0x3b6e('0x4f')](_0x1202e6,_0x4cf38b[_0x3b6e('0x4d')],config['secrets'][_0x3b6e('0x51')])['then'](function(){return _0x4cf38b;});}return _0x4cf38b;}})[_0x3b6e('0x25')](function(_0x32c7ab){if(!_0x32c7ab){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x7c'));}_0x549cd=_0x32c7ab;return db['Setting'][_0x3b6e('0x7d')]({'where':{'id':0x1}});})[_0x3b6e('0x25')](handleEntityNotFound(_0x46789e,null))[_0x3b6e('0x25')](function(_0x34c423){if(_0x34c423){_0x3365ce=_0x34c423;if(!_0x3365ce['transcribe']||!_0x3365ce[_0x3b6e('0x7e')]||!_0x3365ce[_0x3b6e('0x7f')]||!_0x3365ce[_0x3b6e('0x80')]||!_0x3365ce[_0x3b6e('0x73')]){throw new db['Sequelize'][(_0x3b6e('0x54'))](_0x3b6e('0x81'));}if(_0x2217b6[_0x3b6e('0x48')][_0x3b6e('0x82')]&&(!_0x3365ce['sentiment']||!_0x3365ce[_0x3b6e('0x83')]||!_0x3365ce[_0x3b6e('0x84')]||!_0x3365ce[_0x3b6e('0x80')]||!_0x3365ce['bucket'])){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x85'));}return db[_0x3b6e('0x86')][_0x3b6e('0x7d')]({'where':{'id':_0x3365ce[_0x3b6e('0x7e')]}});}})[_0x3b6e('0x25')](function(_0x2bc51e){if(!_0x2bc51e){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x87'));}if(!_0x2bc51e[_0x3b6e('0x88')]||!_0x2bc51e[_0x3b6e('0x89')]){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x8a'));}_0x508a66=_0x2bc51e;return getBucketslist(_0x508a66[_0x3b6e('0x88')],_0x508a66[_0x3b6e('0x89')],_0x3365ce['transcribeRegion']);})['then'](function(_0x499346){if(_0x499346&&_0x499346[_0x3b6e('0x8b')]){var _0x17b74b=_[_0x3b6e('0x46')](_0x499346[_0x3b6e('0x8b')],function(_0x415fbe){return _0x415fbe[_0x3b6e('0x8c')]===_0x3365ce[_0x3b6e('0x73')];});if(!_0x17b74b){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x8d'),_0x2217b6['params']['id'],_0x3365ce['bucket']));return createBucket(_0x508a66[_0x3b6e('0x88')],_0x508a66['data2'],_0x3365ce[_0x3b6e('0x7f')],_0x3365ce[_0x3b6e('0x73')]);}logger[_0x3b6e('0x65')](util['format'](_0x3b6e('0x8e'),_0x2217b6[_0x3b6e('0x44')]['id'],_0x3365ce[_0x3b6e('0x73')]));return;}})[_0x3b6e('0x25')](function(_0x5df07b){if(_0x549cd[_0x3b6e('0x79')]===_0x3b6e('0x8f')){return transcribe(_0x2217b6[_0x3b6e('0x44')]['id'],_0x508a66['data1'],_0x508a66[_0x3b6e('0x89')],_0x3365ce[_0x3b6e('0x7f')],_0x3365ce[_0x3b6e('0x73')],_0x549cd['value'],_0x3365ce['language']);}else{logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2217b6[_0x3b6e('0x44')]['id']));return{'transcribeStatus':_0x3b6e('0x90')};}})[_0x3b6e('0x25')](function(_0x4d3408){if(_0x4d3408){_0x4d3408['tempSentiment']=_0x2217b6[_0x3b6e('0x48')][_0x3b6e('0x82')];return _0x549cd[_0x3b6e('0x91')](_0x4d3408);}})[_0x3b6e('0x25')](respondWithResult(_0x46789e,null))[_0x3b6e('0x43')](handleError(_0x46789e,null));};function writeFile(_0x4bd1f2,_0x3a828c){return new Promise(function(_0x36549b,_0x55710d){fs[_0x3b6e('0x92')](_0x3a828c,_0x4bd1f2,function(_0x40835c,_0x5130c2){if(_0x40835c){return _0x55710d(_0x40835c);}else{return _0x36549b(_0x5130c2);}});});}exports[_0x3b6e('0x93')]=function(_0x3e4504,_0x3be39d,_0x8a0685){return db[_0x3b6e('0x2a')][_0x3b6e('0x7d')]({'where':{'id':_0x3e4504[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](handleEntityNotFound(_0x3be39d))['then'](function(_0x1c54e1){if(_0x1c54e1&&_0x1c54e1[_0x3b6e('0x94')]){var _0x3a31d4=_0x1c54e1['fileText'];var _0x3ef531=config[_0x3b6e('0x95')]+_0x3b6e('0x96')+_0x1c54e1['id']+_0x3b6e('0x97');if(fs[_0x3b6e('0x52')](_0x3ef531)){return _0x3ef531;}return writeFile(_0x3a31d4,_0x3ef531)[_0x3b6e('0x25')](function(){return _0x3ef531;});}else{throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))]('Transcript\x20not\x20available');}})[_0x3b6e('0x25')](function(_0x4e4941){return _0x3be39d[_0x3b6e('0x4a')](_0x4e4941);})[_0x3b6e('0x43')](handleError(_0x3be39d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4277854..84f9ced 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 _0x6ae6=['lodash','util','api','moment','bluebird','request-promise','rimraf','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6ae6,0x15c));var _0x66ae=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x6ae6[_0x43941d];return _0x27b82a;};'use strict';var _=require(_0x66ae('0x0'));var util=require(_0x66ae('0x1'));var logger=require('../../config/logger')(_0x66ae('0x2'));var moment=require(_0x66ae('0x3'));var BPromise=require(_0x66ae('0x4'));var rp=require(_0x66ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x66ae('0x7'));module[_0x66ae('0x8')]=function(_0x25e7a2,_0x16d34e){return _0x25e7a2['define'](_0x66ae('0x9'),attributes,{'tableName':_0x66ae('0xa'),'paranoid':![],'indexes':[{'name':_0x66ae('0xb'),'fields':[_0x66ae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49a1=['exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49a1,0x190));var _0x149a=function(_0x2f78ef,_0x75e901){_0x2f78ef=_0x2f78ef-0x0;var _0x11036c=_0x49a1[_0x2f78ef];return _0x11036c;};'use strict';var _=require(_0x149a('0x0'));var util=require(_0x149a('0x1'));var logger=require(_0x149a('0x2'))(_0x149a('0x3'));var moment=require(_0x149a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x149a('0x5'));var config=require(_0x149a('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x149a('0x7')]=function(_0x25e18e,_0x5b4b37){return _0x25e18e[_0x149a('0x8')]('VoiceRecording',attributes,{'tableName':_0x149a('0x9'),'paranoid':![],'indexes':[{'name':_0x149a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 37a40df..611174c 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 _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2d582c,_0x424a15){var _0x37e92a=function(_0x142fb1){while(--_0x142fb1){_0x2d582c['push'](_0x2d582c['shift']());}};_0x37e92a(++_0x424a15);}(_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')]('VoiceRecording,\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')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0x1ca5a7,_0x1a2974){var _0x30ca42=function(_0x183f38){while(--_0x183f38){_0x1ca5a7['push'](_0x1ca5a7['shift']());}};_0x30ca42(++_0x1a2974);}(_0x81c6,0x1d5));var _0x681c=function(_0x17fc20,_0x7d3f2f){_0x17fc20=_0x17fc20-0x0;var _0x29d108=_0x81c6[_0x17fc20];return _0x29d108;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c105c16..2cc7178 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 _0x8ed1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','create','put','delete','destroy','exports','multer'];(function(_0x374473,_0x1c4f4b){var _0x506f8e=function(_0x4953af){while(--_0x4953af){_0x374473['push'](_0x374473['shift']());}};_0x506f8e(++_0x1c4f4b);}(_0x8ed1,0x17b));var _0x18ed=function(_0x2a0d06,_0x14e3d3){_0x2a0d06=_0x2a0d06-0x0;var _0x579a8d=_0x8ed1[_0x2a0d06];return _0x579a8d;};'use strict';var multer=require(_0x18ed('0x0'));var util=require(_0x18ed('0x1'));var path=require(_0x18ed('0x2'));var timeout=require(_0x18ed('0x3'));var express=require(_0x18ed('0x4'));var router=express[_0x18ed('0x5')]();var fs_extra=require(_0x18ed('0x6'));var auth=require(_0x18ed('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x18ed('0x8'));var controller=require(_0x18ed('0x9'));router[_0x18ed('0xa')]('/',auth[_0x18ed('0xb')](),controller[_0x18ed('0xc')]);router[_0x18ed('0xa')](_0x18ed('0xd'),auth[_0x18ed('0xb')](),controller['describe']);router['get'](_0x18ed('0xe'),auth[_0x18ed('0xb')](),controller['show']);router['post']('/',auth[_0x18ed('0xb')](),controller[_0x18ed('0xf')]);router[_0x18ed('0x10')]('/:id',auth[_0x18ed('0xb')](),controller['update']);router[_0x18ed('0x11')]('/:id',auth[_0x18ed('0xb')](),controller[_0x18ed('0x12')]);module[_0x18ed('0x13')]=router; \ No newline at end of file +var _0x53dd=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','index','/describe','isAuthenticated','get','/:id','show','post','create','update','delete','destroy'];(function(_0x1ebf22,_0x273424){var _0x326d54=function(_0x55c3e8){while(--_0x55c3e8){_0x1ebf22['push'](_0x1ebf22['shift']());}};_0x326d54(++_0x273424);}(_0x53dd,0xe8));var _0xd53d=function(_0x24982a,_0x335d1c){_0x24982a=_0x24982a-0x0;var _0x57b651=_0x53dd[_0x24982a];return _0x57b651;};'use strict';var multer=require('multer');var util=require(_0xd53d('0x0'));var path=require('path');var timeout=require(_0xd53d('0x1'));var express=require(_0xd53d('0x2'));var router=express[_0xd53d('0x3')]();var fs_extra=require(_0xd53d('0x4'));var auth=require(_0xd53d('0x5'));var interaction=require(_0xd53d('0x6'));var config=require(_0xd53d('0x7'));var controller=require(_0xd53d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd53d('0x9')]);router['get'](_0xd53d('0xa'),auth[_0xd53d('0xb')](),controller['describe']);router[_0xd53d('0xc')](_0xd53d('0xd'),auth['isAuthenticated'](),controller[_0xd53d('0xe')]);router[_0xd53d('0xf')]('/',auth['isAuthenticated'](),controller[_0xd53d('0x10')]);router['put'](_0xd53d('0xd'),auth[_0xd53d('0xb')](),controller[_0xd53d('0x11')]);router[_0xd53d('0x12')](_0xd53d('0xd'),auth[_0xd53d('0xb')](),controller[_0xd53d('0x13')]);module[_0xd53d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 50fc105..3378134 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 _0x6518=['sequelize','blind','attended','STRING','Yes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6518,0x177));var _0x8651=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x6518[_0x373dee];return _0x46798f;};'use strict';var Sequelize=require(_0x8651('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8651('0x1'),_0x8651('0x2'))},'result':{'type':Sequelize[_0x8651('0x3')]},'transfererchannel':{'type':Sequelize[_0x8651('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x8651('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8651('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x8651('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x8651('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8651('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x8651('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x8651('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x8651('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x8651('0x3')]},'transfereecontext':{'type':Sequelize[_0x8651('0x3')]},'transfereeexten':{'type':Sequelize[_0x8651('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x8651('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x8651('0x4'),'No')},'context':{'type':Sequelize[_0x8651('0x3')]},'extension':{'type':Sequelize[_0x8651('0x3')]}}; \ No newline at end of file +var _0x3d1f=['attended','STRING','sequelize','moment','ENUM','blind'];(function(_0x2c30d5,_0x53b615){var _0x56471b=function(_0x507b36){while(--_0x507b36){_0x2c30d5['push'](_0x2c30d5['shift']());}};_0x56471b(++_0x53b615);}(_0x3d1f,0x16a));var _0xf3d1=function(_0x2462ae,_0x1d27e2){_0x2462ae=_0x2462ae-0x0;var _0x493ded=_0x3d1f[_0x2462ae];return _0x493ded;};'use strict';var Sequelize=require(_0xf3d1('0x0'));var moment=require(_0xf3d1('0x1'));module['exports']={'type':{'type':Sequelize[_0xf3d1('0x2')](_0xf3d1('0x3'),_0xf3d1('0x4'))},'result':{'type':Sequelize[_0xf3d1('0x5')]},'transfererchannel':{'type':Sequelize[_0xf3d1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf3d1('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf3d1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf3d1('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf3d1('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf3d1('0x5')]},'transfererexten':{'type':Sequelize[_0xf3d1('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf3d1('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xf3d1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf3d1('0x5')]},'transfereeexten':{'type':Sequelize[_0xf3d1('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf3d1('0x5')]},'isexternal':{'type':Sequelize[_0xf3d1('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xf3d1('0x5')]},'extension':{'type':Sequelize[_0xf3d1('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8f9a8f9..6435ec5 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 _0x2467=['merge','VIRTUAL','options','VoiceTransferReport','include','findAll','rows','params','keys','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filter'];(function(_0x34d54b,_0x7f385b){var _0x358b89=function(_0x2b1f97){while(--_0x2b1f97){_0x34d54b['push'](_0x34d54b['shift']());}};_0x358b89(++_0x7f385b);}(_0x2467,0xd4));var _0x7246=function(_0x2ee476,_0x2623ee){_0x2ee476=_0x2ee476-0x0;var _0x34e877=_0x2467[_0x2ee476];return _0x34e877;};'use strict';var emlformat=require(_0x7246('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7246('0x1'));var jsonpatch=require(_0x7246('0x2'));var rp=require('request-promise');var moment=require(_0x7246('0x3'));var BPromise=require(_0x7246('0x4'));var Mustache=require(_0x7246('0x5'));var util=require(_0x7246('0x6'));var path=require(_0x7246('0x7'));var sox=require(_0x7246('0x8'));var csv=require(_0x7246('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7246('0xa'));var _=require(_0x7246('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7246('0xc'));var toCsv=require(_0x7246('0x9'));var querystring=require('querystring');var Papa=require(_0x7246('0xd'));var Redis=require(_0x7246('0xe'));var authService=require(_0x7246('0xf'));var qs=require(_0x7246('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7246('0x11'));var logger=require('../../config/logger')(_0x7246('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7246('0x13'));var db=require(_0x7246('0x14'))['db'];function respondWithStatusCode(_0x53a72b,_0x5b5fc2){_0x5b5fc2=_0x5b5fc2||0xcc;return function(_0x3cab55){if(_0x3cab55){return _0x53a72b[_0x7246('0x15')](_0x5b5fc2);}return _0x53a72b[_0x7246('0x16')](_0x5b5fc2)[_0x7246('0x17')]();};}function respondWithResult(_0x5a8324,_0x57b525){_0x57b525=_0x57b525||0xc8;return function(_0x47252b){if(_0x47252b){return _0x5a8324[_0x7246('0x16')](_0x57b525)['json'](_0x47252b);}};}function respondWithFilteredResult(_0x34816a,_0x20254c){return function(_0x1432c4){if(_0x1432c4){var _0x2a27b4=typeof _0x20254c[_0x7246('0x18')]===_0x7246('0x19')&&typeof _0x20254c[_0x7246('0x1a')]===_0x7246('0x19');var _0x34c4aa=_0x1432c4['count'];var _0x1694a5=_0x2a27b4?0x0:_0x20254c[_0x7246('0x18')];var _0x16843d=_0x2a27b4?_0x1432c4[_0x7246('0x1b')]:_0x20254c[_0x7246('0x18')]+_0x20254c['limit'];var _0x49a97f;if(_0x16843d>=_0x34c4aa){_0x16843d=_0x34c4aa;_0x49a97f=0xc8;}else{_0x49a97f=0xce;}_0x34816a['status'](_0x49a97f);return _0x34816a[_0x7246('0x1c')](_0x7246('0x1d'),_0x1694a5+'-'+_0x16843d+'/'+_0x34c4aa)['json'](_0x1432c4);}return null;};}function patchUpdates(_0x2f1e30){return function(_0x3c9518){try{jsonpatch['apply'](_0x3c9518,_0x2f1e30,!![]);}catch(_0x1960b9){return BPromise[_0x7246('0x1e')](_0x1960b9);}return _0x3c9518['save']();};}function saveUpdates(_0x5004c7,_0x48df23){return function(_0x3341a2){if(_0x3341a2){return _0x3341a2['update'](_0x5004c7)[_0x7246('0x1f')](function(_0x276b10){return _0x276b10;});}return null;};}function removeEntity(_0x3920f3,_0x291d91){return function(_0x130b4c){if(_0x130b4c){return _0x130b4c[_0x7246('0x20')]()[_0x7246('0x1f')](function(){_0x3920f3[_0x7246('0x16')](0xcc)[_0x7246('0x17')]();});}};}function handleEntityNotFound(_0x4470b8,_0x1bc9ed){return function(_0xa71bc0){if(!_0xa71bc0){_0x4470b8['sendStatus'](0x194);}return _0xa71bc0;};}function handleError(_0x339680,_0x6abd19){_0x6abd19=_0x6abd19||0x1f4;return function(_0x28f153){logger[_0x7246('0x21')](_0x28f153['stack']);if(_0x28f153['name']){delete _0x28f153[_0x7246('0x22')];}_0x339680['status'](_0x6abd19)[_0x7246('0x23')](_0x28f153);};}exports[_0x7246('0x24')]=function(_0x4af1ef,_0x36e009){var _0x517ce3={},_0x25cb5e={},_0x15331a={'count':0x0,'rows':[]};var _0x2d7fe3=_[_0x7246('0x25')](db['VoiceTransferReport'][_0x7246('0x26')],function(_0x20da09){return{'name':_0x20da09['fieldName'],'type':_0x20da09[_0x7246('0x27')][_0x7246('0x28')]};});_0x25cb5e[_0x7246('0x29')]=_[_0x7246('0x25')](_0x2d7fe3,_0x7246('0x22'));_0x25cb5e['query']=_['keys'](_0x4af1ef['query']);_0x25cb5e[_0x7246('0x2a')]=_[_0x7246('0x2b')](_0x25cb5e[_0x7246('0x29')],_0x25cb5e[_0x7246('0x2c')]);_0x517ce3[_0x7246('0x2d')]=_['intersection'](_0x25cb5e[_0x7246('0x29')],qs[_0x7246('0x2e')](_0x4af1ef['query']['fields']));_0x517ce3[_0x7246('0x2d')]=_0x517ce3[_0x7246('0x2d')][_0x7246('0x2f')]?_0x517ce3['attributes']:_0x25cb5e[_0x7246('0x29')];if(!_0x4af1ef[_0x7246('0x2c')][_0x7246('0x30')]('nolimit')){_0x517ce3[_0x7246('0x1a')]=qs['limit'](_0x4af1ef['query'][_0x7246('0x1a')]);_0x517ce3[_0x7246('0x18')]=qs[_0x7246('0x18')](_0x4af1ef[_0x7246('0x2c')][_0x7246('0x18')]);}_0x517ce3['order']=qs[_0x7246('0x31')](_0x4af1ef[_0x7246('0x2c')][_0x7246('0x31')]);_0x517ce3[_0x7246('0x32')]=qs[_0x7246('0x2a')](_['pick'](_0x4af1ef[_0x7246('0x2c')],_0x25cb5e['filters']),_0x2d7fe3);if(_0x4af1ef[_0x7246('0x2c')][_0x7246('0x33')]){_0x517ce3[_0x7246('0x32')]=_[_0x7246('0x34')](_0x517ce3[_0x7246('0x32')],{'$or':_['map'](_0x2d7fe3,function(_0x2ede3f){if(_0x2ede3f['type']!==_0x7246('0x35')){var _0x101300={};_0x101300[_0x2ede3f[_0x7246('0x22')]]={'$like':'%'+_0x4af1ef[_0x7246('0x2c')][_0x7246('0x33')]+'%'};return _0x101300;}})});}_0x517ce3=_[_0x7246('0x34')]({},_0x517ce3,_0x4af1ef[_0x7246('0x36')]);var _0x59192e={'where':_0x517ce3[_0x7246('0x32')]};return db[_0x7246('0x37')][_0x7246('0x1b')](_0x59192e)['then'](function(_0x525f8d){_0x15331a[_0x7246('0x1b')]=_0x525f8d;if(_0x4af1ef[_0x7246('0x2c')]['includeAll']){_0x517ce3[_0x7246('0x38')]=[{'all':!![]}];}return db[_0x7246('0x37')][_0x7246('0x39')](_0x517ce3);})[_0x7246('0x1f')](function(_0x4433bf){_0x15331a[_0x7246('0x3a')]=_0x4433bf;return _0x15331a;})[_0x7246('0x1f')](respondWithFilteredResult(_0x36e009,_0x517ce3))['catch'](handleError(_0x36e009,null));};exports['show']=function(_0x56f46b,_0x22fc44){var _0x271f99={'raw':!![],'where':{'id':_0x56f46b[_0x7246('0x3b')]['id']}},_0x133600={};_0x133600[_0x7246('0x29')]=_[_0x7246('0x3c')](db[_0x7246('0x37')][_0x7246('0x26')]);_0x133600[_0x7246('0x2c')]=_[_0x7246('0x3c')](_0x56f46b['query']);_0x133600[_0x7246('0x2a')]=_['intersection'](_0x133600[_0x7246('0x29')],_0x133600['query']);_0x271f99[_0x7246('0x2d')]=_[_0x7246('0x2b')](_0x133600[_0x7246('0x29')],qs[_0x7246('0x2e')](_0x56f46b[_0x7246('0x2c')][_0x7246('0x2e')]));_0x271f99[_0x7246('0x2d')]=_0x271f99[_0x7246('0x2d')][_0x7246('0x2f')]?_0x271f99[_0x7246('0x2d')]:_0x133600[_0x7246('0x29')];if(_0x56f46b[_0x7246('0x2c')]['includeAll']){_0x271f99[_0x7246('0x38')]=[{'all':!![]}];}_0x271f99=_[_0x7246('0x34')]({},_0x271f99,_0x56f46b[_0x7246('0x36')]);return db['VoiceTransferReport'][_0x7246('0x3d')](_0x271f99)[_0x7246('0x1f')](handleEntityNotFound(_0x22fc44,null))['then'](respondWithResult(_0x22fc44,null))[_0x7246('0x3e')](handleError(_0x22fc44,null));};exports['create']=function(_0x4d473d,_0xd2e060){return db['VoiceTransferReport'][_0x7246('0x3f')](_0x4d473d[_0x7246('0x40')],{})[_0x7246('0x1f')](respondWithResult(_0xd2e060,0xc9))[_0x7246('0x3e')](handleError(_0xd2e060,null));};exports['update']=function(_0x758fbe,_0xa4bb4f){if(_0x758fbe[_0x7246('0x40')]['id']){delete _0x758fbe[_0x7246('0x40')]['id'];}return db[_0x7246('0x37')][_0x7246('0x3d')]({'where':{'id':_0x758fbe[_0x7246('0x3b')]['id']}})[_0x7246('0x1f')](handleEntityNotFound(_0xa4bb4f,null))['then'](saveUpdates(_0x758fbe['body'],null))[_0x7246('0x1f')](respondWithResult(_0xa4bb4f,null))[_0x7246('0x3e')](handleError(_0xa4bb4f,null));};exports['destroy']=function(_0x44849d,_0x18fdf5){return db[_0x7246('0x37')][_0x7246('0x3d')]({'where':{'id':_0x44849d[_0x7246('0x3b')]['id']}})['then'](handleEntityNotFound(_0x18fdf5,null))[_0x7246('0x1f')](removeEntity(_0x18fdf5,null))[_0x7246('0x3e')](handleError(_0x18fdf5,null));};exports[_0x7246('0x41')]=function(_0xcafbca,_0x11992d){return db[_0x7246('0x37')][_0x7246('0x41')]()[_0x7246('0x1f')](respondWithResult(_0x11992d,null))[_0x7246('0x3e')](handleError(_0x11992d,null));}; \ No newline at end of file +var _0xbd29=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd29,0x137));var _0x9bd2=function(_0x1dd2fe,_0x478f00){_0x1dd2fe=_0x1dd2fe-0x0;var _0x281cf0=_0xbd29[_0x1dd2fe];return _0x281cf0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bd2('0x0'));var zipdir=require(_0x9bd2('0x1'));var jsonpatch=require(_0x9bd2('0x2'));var rp=require(_0x9bd2('0x3'));var moment=require(_0x9bd2('0x4'));var BPromise=require(_0x9bd2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9bd2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bd2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9bd2('0x8'));var jsforce=require(_0x9bd2('0x9'));var deskjs=require(_0x9bd2('0xa'));var toCsv=require(_0x9bd2('0xb'));var querystring=require(_0x9bd2('0xc'));var Papa=require(_0x9bd2('0xd'));var Redis=require(_0x9bd2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9bd2('0xf'));var hardwareService=require(_0x9bd2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9bd2('0x11'));var config=require(_0x9bd2('0x12'));var licenseUtil=require(_0x9bd2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5efa53,_0x4da0c0){_0x4da0c0=_0x4da0c0||0xcc;return function(_0x2ed365){if(_0x2ed365){return _0x5efa53[_0x9bd2('0x14')](_0x4da0c0);}return _0x5efa53['status'](_0x4da0c0)[_0x9bd2('0x15')]();};}function respondWithResult(_0x3d1208,_0x1f70e0){_0x1f70e0=_0x1f70e0||0xc8;return function(_0x12720c){if(_0x12720c){return _0x3d1208[_0x9bd2('0x16')](_0x1f70e0)[_0x9bd2('0x17')](_0x12720c);}};}function respondWithFilteredResult(_0xebfa98,_0xaf48f5){return function(_0x4ed7a4){if(_0x4ed7a4){var _0x821211=typeof _0xaf48f5[_0x9bd2('0x18')]==='undefined'&&typeof _0xaf48f5[_0x9bd2('0x19')]===_0x9bd2('0x1a');var _0x28abbd=_0x4ed7a4[_0x9bd2('0x1b')];var _0x4a5e82=_0x821211?0x0:_0xaf48f5['offset'];var _0x28dd57=_0x821211?_0x4ed7a4[_0x9bd2('0x1b')]:_0xaf48f5[_0x9bd2('0x18')]+_0xaf48f5[_0x9bd2('0x19')];var _0x2811a2;if(_0x28dd57>=_0x28abbd){_0x28dd57=_0x28abbd;_0x2811a2=0xc8;}else{_0x2811a2=0xce;}_0xebfa98['status'](_0x2811a2);return _0xebfa98[_0x9bd2('0x1c')](_0x9bd2('0x1d'),_0x4a5e82+'-'+_0x28dd57+'/'+_0x28abbd)[_0x9bd2('0x17')](_0x4ed7a4);}return null;};}function patchUpdates(_0x3ead9b){return function(_0x19ca48){try{jsonpatch[_0x9bd2('0x1e')](_0x19ca48,_0x3ead9b,!![]);}catch(_0x1f4813){return BPromise[_0x9bd2('0x1f')](_0x1f4813);}return _0x19ca48[_0x9bd2('0x20')]();};}function saveUpdates(_0x5883bf,_0x306d1c){return function(_0x376277){if(_0x376277){return _0x376277[_0x9bd2('0x21')](_0x5883bf)[_0x9bd2('0x22')](function(_0x445ad4){return _0x445ad4;});}return null;};}function removeEntity(_0x2a577b,_0xa3ef04){return function(_0x448a42){if(_0x448a42){return _0x448a42[_0x9bd2('0x23')]()[_0x9bd2('0x22')](function(){_0x2a577b[_0x9bd2('0x16')](0xcc)[_0x9bd2('0x15')]();});}};}function handleEntityNotFound(_0x446032,_0x34b236){return function(_0x16a472){if(!_0x16a472){_0x446032[_0x9bd2('0x14')](0x194);}return _0x16a472;};}function handleError(_0x84a31,_0x44d5bd){_0x44d5bd=_0x44d5bd||0x1f4;return function(_0xb35270){logger[_0x9bd2('0x24')](_0xb35270[_0x9bd2('0x25')]);if(_0xb35270[_0x9bd2('0x26')]){delete _0xb35270[_0x9bd2('0x26')];}_0x84a31[_0x9bd2('0x16')](_0x44d5bd)['send'](_0xb35270);};}exports[_0x9bd2('0x27')]=function(_0x2ff9dd,_0x2242c2){var _0x1413ce={},_0x24f70f={},_0x287eaf={'count':0x0,'rows':[]};var _0x282c32=_[_0x9bd2('0x28')](db[_0x9bd2('0x29')][_0x9bd2('0x2a')],function(_0x5ac477){return{'name':_0x5ac477[_0x9bd2('0x2b')],'type':_0x5ac477[_0x9bd2('0x2c')][_0x9bd2('0x2d')]};});_0x24f70f[_0x9bd2('0x2e')]=_[_0x9bd2('0x28')](_0x282c32,'name');_0x24f70f[_0x9bd2('0x2f')]=_['keys'](_0x2ff9dd['query']);_0x24f70f[_0x9bd2('0x30')]=_[_0x9bd2('0x31')](_0x24f70f[_0x9bd2('0x2e')],_0x24f70f[_0x9bd2('0x2f')]);_0x1413ce[_0x9bd2('0x32')]=_[_0x9bd2('0x31')](_0x24f70f['model'],qs['fields'](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x33')]));_0x1413ce['attributes']=_0x1413ce[_0x9bd2('0x32')][_0x9bd2('0x34')]?_0x1413ce['attributes']:_0x24f70f['model'];if(!_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x35')](_0x9bd2('0x36'))){_0x1413ce[_0x9bd2('0x19')]=qs[_0x9bd2('0x19')](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x19')]);_0x1413ce[_0x9bd2('0x18')]=qs[_0x9bd2('0x18')](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x18')]);}_0x1413ce[_0x9bd2('0x37')]=qs[_0x9bd2('0x38')](_0x2ff9dd['query'][_0x9bd2('0x38')]);_0x1413ce[_0x9bd2('0x39')]=qs['filters'](_[_0x9bd2('0x3a')](_0x2ff9dd[_0x9bd2('0x2f')],_0x24f70f[_0x9bd2('0x30')]),_0x282c32);if(_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3b')]){_0x1413ce[_0x9bd2('0x39')]=_[_0x9bd2('0x3c')](_0x1413ce[_0x9bd2('0x39')],{'$or':_[_0x9bd2('0x28')](_0x282c32,function(_0x4fe5dc){if(_0x4fe5dc[_0x9bd2('0x2c')]!==_0x9bd2('0x3d')){var _0x34eaf8={};_0x34eaf8[_0x4fe5dc['name']]={'$like':'%'+_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3b')]+'%'};return _0x34eaf8;}})});}_0x1413ce=_['merge']({},_0x1413ce,_0x2ff9dd['options']);var _0x297ae0={'where':_0x1413ce['where']};return db[_0x9bd2('0x29')][_0x9bd2('0x1b')](_0x297ae0)[_0x9bd2('0x22')](function(_0x1ef87a){_0x287eaf[_0x9bd2('0x1b')]=_0x1ef87a;if(_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3e')]){_0x1413ce[_0x9bd2('0x3f')]=[{'all':!![]}];}return db[_0x9bd2('0x29')][_0x9bd2('0x40')](_0x1413ce);})[_0x9bd2('0x22')](function(_0x91cede){_0x287eaf[_0x9bd2('0x41')]=_0x91cede;return _0x287eaf;})['then'](respondWithFilteredResult(_0x2242c2,_0x1413ce))['catch'](handleError(_0x2242c2,null));};exports[_0x9bd2('0x42')]=function(_0x278917,_0x94a80d){var _0x38d65c={'raw':!![],'where':{'id':_0x278917[_0x9bd2('0x43')]['id']}},_0x1cc323={};_0x1cc323['model']=_[_0x9bd2('0x44')](db[_0x9bd2('0x29')][_0x9bd2('0x2a')]);_0x1cc323[_0x9bd2('0x2f')]=_['keys'](_0x278917[_0x9bd2('0x2f')]);_0x1cc323[_0x9bd2('0x30')]=_[_0x9bd2('0x31')](_0x1cc323[_0x9bd2('0x2e')],_0x1cc323[_0x9bd2('0x2f')]);_0x38d65c['attributes']=_[_0x9bd2('0x31')](_0x1cc323['model'],qs[_0x9bd2('0x33')](_0x278917['query']['fields']));_0x38d65c[_0x9bd2('0x32')]=_0x38d65c['attributes'][_0x9bd2('0x34')]?_0x38d65c[_0x9bd2('0x32')]:_0x1cc323['model'];if(_0x278917[_0x9bd2('0x2f')]['includeAll']){_0x38d65c[_0x9bd2('0x3f')]=[{'all':!![]}];}_0x38d65c=_[_0x9bd2('0x3c')]({},_0x38d65c,_0x278917['options']);return db['VoiceTransferReport'][_0x9bd2('0x45')](_0x38d65c)[_0x9bd2('0x22')](handleEntityNotFound(_0x94a80d,null))[_0x9bd2('0x22')](respondWithResult(_0x94a80d,null))[_0x9bd2('0x46')](handleError(_0x94a80d,null));};exports[_0x9bd2('0x47')]=function(_0x49a956,_0x4fbbb8){return db['VoiceTransferReport'][_0x9bd2('0x47')](_0x49a956[_0x9bd2('0x48')],{})['then'](respondWithResult(_0x4fbbb8,0xc9))['catch'](handleError(_0x4fbbb8,null));};exports[_0x9bd2('0x21')]=function(_0x459ecd,_0x2f6af3){if(_0x459ecd[_0x9bd2('0x48')]['id']){delete _0x459ecd[_0x9bd2('0x48')]['id'];}return db[_0x9bd2('0x29')][_0x9bd2('0x45')]({'where':{'id':_0x459ecd[_0x9bd2('0x43')]['id']}})[_0x9bd2('0x22')](handleEntityNotFound(_0x2f6af3,null))[_0x9bd2('0x22')](saveUpdates(_0x459ecd[_0x9bd2('0x48')],null))['then'](respondWithResult(_0x2f6af3,null))[_0x9bd2('0x46')](handleError(_0x2f6af3,null));};exports['destroy']=function(_0xad5fe3,_0x2470a3){return db[_0x9bd2('0x29')][_0x9bd2('0x45')]({'where':{'id':_0xad5fe3[_0x9bd2('0x43')]['id']}})[_0x9bd2('0x22')](handleEntityNotFound(_0x2470a3,null))[_0x9bd2('0x22')](removeEntity(_0x2470a3,null))[_0x9bd2('0x46')](handleError(_0x2470a3,null));};exports[_0x9bd2('0x49')]=function(_0x435766,_0xf731c3){return db[_0x9bd2('0x29')][_0x9bd2('0x49')]()[_0x9bd2('0x22')](respondWithResult(_0xf731c3,null))[_0x9bd2('0x46')](handleError(_0xf731c3,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 7e6248f..079b694 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 _0xb9cf=['../../config/logger','moment','bluebird','request-promise','path','./voiceTransferReport.attributes','exports','report_call_transfer','util'];(function(_0xb510b9,_0x1312dc){var _0x3c5900=function(_0x549204){while(--_0x549204){_0xb510b9['push'](_0xb510b9['shift']());}};_0x3c5900(++_0x1312dc);}(_0xb9cf,0x1b8));var _0xfb9c=function(_0x43024e,_0x1d1ab5){_0x43024e=_0x43024e-0x0;var _0x10c8ef=_0xb9cf[_0x43024e];return _0x10c8ef;};'use strict';var _=require('lodash');var util=require(_0xfb9c('0x0'));var logger=require(_0xfb9c('0x1'))('api');var moment=require(_0xfb9c('0x2'));var BPromise=require(_0xfb9c('0x3'));var rp=require(_0xfb9c('0x4'));var fs=require('fs');var path=require(_0xfb9c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb9c('0x6'));module[_0xfb9c('0x7')]=function(_0x2e7cd1,_0x51df71){return _0x2e7cd1['define']('VoiceTransferReport',attributes,{'tableName':_0xfb9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa417=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport'];(function(_0x2d68b8,_0xe4fc22){var _0x16bc48=function(_0x53ccf0){while(--_0x53ccf0){_0x2d68b8['push'](_0x2d68b8['shift']());}};_0x16bc48(++_0xe4fc22);}(_0xa417,0x186));var _0x7a41=function(_0xe68a4c,_0x1cfead){_0xe68a4c=_0xe68a4c-0x0;var _0x492b36=_0xa417[_0xe68a4c];return _0x492b36;};'use strict';var _=require(_0x7a41('0x0'));var util=require('util');var logger=require(_0x7a41('0x1'))(_0x7a41('0x2'));var moment=require(_0x7a41('0x3'));var BPromise=require(_0x7a41('0x4'));var rp=require(_0x7a41('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a41('0x6'));var config=require(_0x7a41('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x7a41('0x8')]=function(_0x5c36cb,_0x2a2dee){return _0x5c36cb['define'](_0x7a41('0x9'),attributes,{'tableName':'report_call_transfer','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 a13a15c..bfa27bb 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 _0xd0cf=['message','result','catch','VoiceTransferReport','create','body','options','raw','info','CreateVoiceTransferReport','debug','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xd0cf,0x16b));var _0xfd0c=function(_0x3d773f,_0x3462b3){_0x3d773f=_0x3d773f-0x0;var _0x22bf3a=_0xd0cf[_0x3d773f];return _0x22bf3a;};'use strict';var _=require(_0xfd0c('0x0'));var util=require(_0xfd0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd0c('0x2'));var fs=require('fs');var Redis=require(_0xfd0c('0x3'));var db=require(_0xfd0c('0x4'))['db'];var utils=require(_0xfd0c('0x5'));var logger=require(_0xfd0c('0x6'))('rpc');var config=require(_0xfd0c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd0c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x220e17,_0xf3424b,_0x5cf1b3){return new BPromise(function(_0xb75778,_0x47d94d){return client[_0xfd0c('0x9')](_0x220e17,_0x5cf1b3)[_0xfd0c('0xa')](function(_0x55d00b){logger['info'](_0xfd0c('0xb'),_0xf3424b,_0xfd0c('0xc'));logger['debug'](_0xfd0c('0xd'),_0xf3424b,_0xfd0c('0xc'),JSON['stringify'](_0x55d00b));if(_0x55d00b[_0xfd0c('0xe')]){if(_0x55d00b['error']['code']===0x1f4){logger['error'](_0xfd0c('0xb'),_0xf3424b,_0x55d00b[_0xfd0c('0xe')]['message']);return _0x47d94d(_0x55d00b['error']['message']);}logger[_0xfd0c('0xe')](_0xfd0c('0xb'),_0xf3424b,_0x55d00b[_0xfd0c('0xe')][_0xfd0c('0xf')]);return _0xb75778(_0x55d00b['error'][_0xfd0c('0xf')]);}else{logger['info'](_0xfd0c('0xb'),_0xf3424b,_0xfd0c('0xc'));_0xb75778(_0x55d00b[_0xfd0c('0x10')]['message']);}})[_0xfd0c('0x11')](function(_0x585249){logger['error'](_0xfd0c('0xb'),_0xf3424b,_0x585249);_0x47d94d(_0x585249);});});}exports['CreateVoiceTransferReport']=function(_0x1be97b){var _0x309e58=this;return new Promise(function(_0x277c90,_0x4982e6){return db[_0xfd0c('0x12')][_0xfd0c('0x13')](_0x1be97b[_0xfd0c('0x14')],{'raw':_0x1be97b['options']?_0x1be97b[_0xfd0c('0x15')][_0xfd0c('0x16')]===undefined?!![]:![]:!![]})[_0xfd0c('0xa')](function(_0x28b429){logger[_0xfd0c('0x17')](_0xfd0c('0x18'),_0x1be97b);logger[_0xfd0c('0x19')](_0xfd0c('0x18'),_0x1be97b,JSON[_0xfd0c('0x1a')](_0x28b429));_0x277c90(_0x28b429);})[_0xfd0c('0x11')](function(_0x59327c){logger[_0xfd0c('0xe')]('CreateVoiceTransferReport',_0x59327c[_0xfd0c('0xf')],_0x1be97b);_0x4982e6(_0x309e58['error'](0x1f4,_0x59327c['message']));});});}; \ No newline at end of file +var _0xcc8b=['catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','http','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','VoiceTransferReport,\x20%s,\x20%s','result'];(function(_0xc884ce,_0x559e9a){var _0x1a7379=function(_0x49656f){while(--_0x49656f){_0xc884ce['push'](_0xc884ce['shift']());}};_0x1a7379(++_0x559e9a);}(_0xcc8b,0x14b));var _0xbcc8=function(_0x58a8a4,_0x5bdf62){_0x58a8a4=_0x58a8a4-0x0;var _0x22f94a=_0xcc8b[_0x58a8a4];return _0x22f94a;};'use strict';var _=require(_0xbcc8('0x0'));var util=require(_0xbcc8('0x1'));var moment=require(_0xbcc8('0x2'));var BPromise=require(_0xbcc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcc8('0x4'));var db=require(_0xbcc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbcc8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbcc8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x272451,_0x1682f4,_0x201e32){return new BPromise(function(_0x426b90,_0x52ec5e){return client['request'](_0x272451,_0x201e32)[_0xbcc8('0x8')](function(_0x464b89){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0xbcc8('0x9'));logger[_0xbcc8('0xa')](_0xbcc8('0xb'),_0x1682f4,_0xbcc8('0x9'),JSON[_0xbcc8('0xc')](_0x464b89));if(_0x464b89['error']){if(_0x464b89['error'][_0xbcc8('0xd')]===0x1f4){logger[_0xbcc8('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0x464b89[_0xbcc8('0xe')]['message']);return _0x52ec5e(_0x464b89[_0xbcc8('0xe')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0x464b89[_0xbcc8('0xe')][_0xbcc8('0xf')]);return _0x426b90(_0x464b89[_0xbcc8('0xe')][_0xbcc8('0xf')]);}else{logger[_0xbcc8('0x10')](_0xbcc8('0x11'),_0x1682f4,_0xbcc8('0x9'));_0x426b90(_0x464b89[_0xbcc8('0x12')][_0xbcc8('0xf')]);}})[_0xbcc8('0x13')](function(_0x5905ee){logger[_0xbcc8('0xe')](_0xbcc8('0x11'),_0x1682f4,_0x5905ee);_0x52ec5e(_0x5905ee);});});}exports['CreateVoiceTransferReport']=function(_0x397df5){var _0x2ce9dd=this;return new Promise(function(_0x26b18e,_0x39e50e){return db[_0xbcc8('0x14')][_0xbcc8('0x15')](_0x397df5['body'],{'raw':_0x397df5[_0xbcc8('0x16')]?_0x397df5['options'][_0xbcc8('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x476a1e){logger['info'](_0xbcc8('0x18'),_0x397df5);logger[_0xbcc8('0xa')](_0xbcc8('0x18'),_0x397df5,JSON['stringify'](_0x476a1e));_0x26b18e(_0x476a1e);})[_0xbcc8('0x13')](function(_0x3fda0c){logger[_0xbcc8('0xe')]('CreateVoiceTransferReport',_0x3fda0c['message'],_0x397df5);_0x39e50e(_0x2ce9dd['error'](0x1f4,_0x3fda0c['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 243c45a..487025f 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 _0x7536=['/calls','calls','exports','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','originate','/hangup','canUpdate','hangup','hold','/unhold'];(function(_0xb61168,_0x4fc7ee){var _0x4b6faf=function(_0x48945e){while(--_0x48945e){_0xb61168['push'](_0xb61168['shift']());}};_0x4b6faf(++_0x4fc7ee);}(_0x7536,0xf3));var _0x6753=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x7536[_0x35e124];return _0x53c482;};'use strict';var express=require(_0x6753('0x0'));var router=express[_0x6753('0x1')]();var auth=require(_0x6753('0x2'));var controller=require(_0x6753('0x3'));router[_0x6753('0x4')]('/originate',auth[_0x6753('0x5')](),auth['canUpdate'](),controller[_0x6753('0x6')]);router[_0x6753('0x4')](_0x6753('0x7'),auth[_0x6753('0x5')](),auth[_0x6753('0x8')](),controller[_0x6753('0x9')]);router[_0x6753('0x4')]('/answer',auth['isAuthenticated'](),auth['canUpdate'](),controller['answer']);router[_0x6753('0x4')]('/hold',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x6753('0xa')]);router[_0x6753('0x4')](_0x6753('0xb'),auth[_0x6753('0x5')](),auth[_0x6753('0x8')](),controller['unhold']);router[_0x6753('0x4')](_0x6753('0xc'),auth[_0x6753('0x5')](),auth[_0x6753('0x8')](),controller[_0x6753('0xd')]);router[_0x6753('0x4')]('/transfer',auth[_0x6753('0x5')](),auth[_0x6753('0x8')](),controller['transfer']);module[_0x6753('0xe')]=router; \ No newline at end of file +var _0x41d9=['unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold'];(function(_0x2320bb,_0x18f641){var _0x1fbbff=function(_0x5b595d){while(--_0x5b595d){_0x2320bb['push'](_0x2320bb['shift']());}};_0x1fbbff(++_0x18f641);}(_0x41d9,0x1d4));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x941d('0x0'));var router=express[_0x941d('0x1')]();var auth=require(_0x941d('0x2'));var controller=require(_0x941d('0x3'));router[_0x941d('0x4')](_0x941d('0x5'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x8')]);router[_0x941d('0x4')](_0x941d('0x9'),auth[_0x941d('0x6')](),auth['canUpdate'](),controller[_0x941d('0xa')]);router[_0x941d('0x4')](_0x941d('0xb'),auth[_0x941d('0x6')](),auth['canUpdate'](),controller[_0x941d('0xc')]);router[_0x941d('0x4')](_0x941d('0xd'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0xe')]);router[_0x941d('0x4')](_0x941d('0xf'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x10')]);router[_0x941d('0x4')](_0x941d('0x11'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x941d('0x12')]);router['post'](_0x941d('0x13'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x14')]);module[_0x941d('0x15')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index cbbfe2f..a1f123c 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 _0xde2c=['name','send','status','request','error','code','message','result','catch','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','userId','callNumber','callerId','callbackUrl','format','user:%s','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','hold','hold\x20fired:','entityFound:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack'];(function(_0x2474d3,_0x1208ba){var _0x1b7308=function(_0x10bc8a){while(--_0x10bc8a){_0x2474d3['push'](_0x2474d3['shift']());}};_0x1b7308(++_0x1208ba);}(_0xde2c,0x7f));var _0xcde2=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xde2c[_0x38b14f];return _0x22a324;};'use strict';var path=require(_0xcde2('0x0'));var fs=require('fs');var _=require(_0xcde2('0x1'));var db=require(_0xcde2('0x2'))['db'];var config=require(_0xcde2('0x3'));var util=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var jayson=require(_0xcde2('0x6'));var amiClient=jayson[_0xcde2('0x7')]['http']({'port':0x232a});var logger=require(_0xcde2('0x8'))(_0xcde2('0x9'));var Redis=require(_0xcde2('0xa'));config[_0xcde2('0xb')]=_[_0xcde2('0xc')](config['redis'],{'host':_0xcde2('0xd'),'port':0x18eb});var io=require(_0xcde2('0xe'))(new Redis(config[_0xcde2('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'callNumber':{'type':_0xcde2('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xcde2('0x10')},'callbackUrl':{'type':_0xcde2('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':[!![],_0xcde2('0x12')]},'transferNumber':{'type':'string','required':[!![],_0xcde2('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x39b023,_0x4c558b,_0x31b4a7){logger[_0xcde2('0x14')](_0x39b023,_0x4c558b,JSON[_0xcde2('0x15')](_0x31b4a7));io['to'](_0x39b023)[_0xcde2('0x16')](_0x4c558b,_0x31b4a7);}function handleError(_0x5223f1){return function(_0x4fd5aa){console['log'](_0xcde2('0x17'),_0x4fd5aa,_0x4fd5aa instanceof RangeError);logger['error'](_0x4fd5aa[_0xcde2('0x18')]);if(_0x4fd5aa instanceof RangeError){if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1['status'](0x194)[_0xcde2('0x1a')](_0x4fd5aa);}else{if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1[_0xcde2('0x1b')](0x1f4)[_0xcde2('0x1a')](_0x4fd5aa);}};}function checkError(){return function(_0x57210d){if(!_0x57210d){throw new RangeError('NotFound');}return _0x57210d;};}function respondWithRpcPromise(_0x5a92b9,_0xb96dc0){return new BPromise(function(_0x3e5170,_0x2c9562){var _0x4063d4=amiClient;return _0x4063d4[_0xcde2('0x1c')](_0x5a92b9,_0xb96dc0)['then'](function(_0x1104b8){if(_0x1104b8['error']){if(_0x1104b8[_0xcde2('0x1d')][_0xcde2('0x1e')]===0x1f4){return _0x2c9562(_0x1104b8[_0xcde2('0x1d')]['message']);}return _0x3e5170(_0x1104b8['error'][_0xcde2('0x1f')]);}else{_0x3e5170(_0x1104b8[_0xcde2('0x20')]);}})[_0xcde2('0x21')](function(_0x217ec9){_0x2c9562(_0x217ec9);});});}function getAgent(_0xcadb2){return db['User'][_0xcde2('0x22')]({'where':{'id':_0xcadb2,'role':_0xcde2('0x23')}})[_0xcde2('0x24')](checkError());}function getAgentCheckSession(_0x513965,_0x2487eb){return new BPromise(function(_0x348ca1,_0x8e1655){var _0x40309d=respondWithRpcPromise(_0xcde2('0x25'));var _0x5b2b7=getAgent(_0x513965);Promise[_0xcde2('0x26')]([_0x40309d,_0x5b2b7])[_0xcde2('0x24')](function(_0x5bf1e6){var _0x3c3c01=_0x5bf1e6[0x0];var _0x4a0826=_0x5bf1e6[0x1];var _0x141072=_[_0xcde2('0x27')](_0x3c3c01[_0xcde2('0x28')],function(_0x49cb58){return _0x49cb58[_0xcde2('0x29')]==_0x4a0826['id']&&_0x49cb58[_0xcde2('0x2a')]==_0x2487eb;});if(_0x141072['length']==0x1){_0x348ca1(_0x4a0826);}else{_0x8e1655(new RangeError(_0xcde2('0x2b')+_0x2487eb+_0xcde2('0x2c')));}});});}exports[_0xcde2('0x2d')]=function(_0x2b2ea1,_0x14f784){logger[_0xcde2('0x14')](_0xcde2('0x2e'),_0x2b2ea1[_0xcde2('0x2f')]);var _0x5c08f0=originateValidation[_0xcde2('0x30')](_0x2b2ea1[_0xcde2('0x2f')]);if(_0x5c08f0[_0xcde2('0x31')]>0x0){return _0x14f784[_0xcde2('0x1b')](0x190)['json'](_0x5c08f0);}var _0x2ae8e0=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x2fec6e=_0x2b2ea1['body'][_0xcde2('0x33')];var _0x452816=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x34')];var _0x54ae78=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x35')];return getAgent(_0x2ae8e0)[_0xcde2('0x24')](function(_0x3090b6){logger[_0xcde2('0x14')]('entityFound:',_0x3090b6[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x3090b6[_0xcde2('0x19')]),'webbar:originate',{'callNumber':_0x2fec6e,'callerId':_0x452816,'callbackUrl':_0x54ae78});return _0x14f784['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x39')});})[_0xcde2('0x21')](handleError(_0x14f784));};exports[_0xcde2('0x3a')]=function(_0x10c494,_0x45af6e){logger[_0xcde2('0x14')](_0xcde2('0x3b'),_0x10c494[_0xcde2('0x2f')]);var _0x5d02b3=hangupValidation[_0xcde2('0x30')](_0x10c494[_0xcde2('0x2f')]);if(_0x5d02b3[_0xcde2('0x31')]>0x0){return _0x45af6e[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5d02b3);}var _0x47b6ee=_0x10c494['body'][_0xcde2('0x32')];var _0xc8e8a4=_0x10c494[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x47b6ee)[_0xcde2('0x24')](function(_0x1939a0){logger['info']('entityFound:',_0x1939a0['name']);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x1939a0[_0xcde2('0x19')]),_0xcde2('0x3c'),{'sessionId':_0xc8e8a4});return _0x45af6e[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x3d')});})['catch'](handleError(_0x45af6e));};exports['answer']=function(_0x6f60d5,_0x578bf1){logger[_0xcde2('0x14')]('answer\x20fired:',_0x6f60d5[_0xcde2('0x2f')]);var _0x3239a0=answerValidation[_0xcde2('0x30')](_0x6f60d5['body']);if(_0x3239a0[_0xcde2('0x31')]>0x0){return _0x578bf1['status'](0x190)[_0xcde2('0x38')](_0x3239a0);}var _0x24a46a=_0x6f60d5[_0xcde2('0x2f')][_0xcde2('0x32')];var _0xcafd7=_0x6f60d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x24a46a)['then'](function(_0x22084e){logger['info']('entityFound:',_0x22084e[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x22084e[_0xcde2('0x19')]),'webbar:answer',{'sessionId':_0xcafd7});return _0x578bf1[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xcde2('0x21')](handleError(_0x578bf1));};exports[_0xcde2('0x3e')]=function(_0x4fc9d5,_0x1e05a4){logger['info'](_0xcde2('0x3f'),_0x4fc9d5[_0xcde2('0x2f')]);var _0x2d7b55=holdValidation[_0xcde2('0x30')](_0x4fc9d5[_0xcde2('0x2f')]);if(_0x2d7b55['length']>0x0){return _0x1e05a4[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x2d7b55);}var _0x40d14b=_0x4fc9d5[_0xcde2('0x2f')]['userId'];var _0x58ded4=_0x4fc9d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x40d14b)[_0xcde2('0x24')](function(_0x3e9e79){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x3e9e79[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')]('user:%s',_0x3e9e79[_0xcde2('0x19')]),'webbar:hold',{'sessionId':_0x58ded4});return _0x1e05a4[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':_0xcde2('0x41')});})[_0xcde2('0x21')](handleError(_0x1e05a4));};exports[_0xcde2('0x42')]=function(_0x16cddb,_0x446cf0){logger[_0xcde2('0x14')]('unhold\x20fired:',_0x16cddb[_0xcde2('0x2f')]);var _0x5aa54f=unholdValidation[_0xcde2('0x30')](_0x16cddb[_0xcde2('0x2f')]);if(_0x5aa54f[_0xcde2('0x31')]>0x0){return _0x446cf0[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5aa54f);}var _0x9067c8=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x373cdc=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x9067c8)[_0xcde2('0x24')](function(_0x5d777d){logger['info']('entityFound:',_0x5d777d[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x5d777d[_0xcde2('0x19')]),_0xcde2('0x43'),{'sessionId':_0x373cdc});return _0x446cf0['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':'unhold\x20executed!'});})[_0xcde2('0x21')](handleError(_0x446cf0));};exports['calls']=function(_0x1085d2,_0x10d6ab){logger['info'](_0xcde2('0x44'),_0x10d6ab['body']);var _0x5e6fd3=callsValidation[_0xcde2('0x30')](_0x1085d2[_0xcde2('0x2f')]);if(_0x5e6fd3[_0xcde2('0x31')]>0x0){return _0x10d6ab[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5e6fd3);}var _0x3787b5=_0x1085d2['body'][_0xcde2('0x32')];var _0x44b3fb=respondWithRpcPromise(_0xcde2('0x25'));var _0x145b4a=getAgent(_0x3787b5);return Promise[_0xcde2('0x26')]([_0x44b3fb,_0x145b4a])[_0xcde2('0x24')](function(_0x50892c){var _0x5775bb=_0x50892c[0x0];var _0x30dee3=_0x50892c[0x1];var _0x35c6e5=_[_0xcde2('0x27')](_0x5775bb[_0xcde2('0x28')],function(_0x4c298b){return _0x4c298b[_0xcde2('0x29')]==_0x30dee3['id'];});return _0x10d6ab[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'count':_0x35c6e5[_0xcde2('0x31')],'rows':_0x35c6e5});})[_0xcde2('0x21')](handleError(_0x10d6ab));};exports[_0xcde2('0x45')]=function(_0x50a1db,_0x1bea12){logger[_0xcde2('0x14')]('conference\x20fired:',_0x50a1db[_0xcde2('0x2f')]);var _0x4544bd=conferenceValidation[_0xcde2('0x30')](_0x50a1db[_0xcde2('0x2f')]);if(_0x4544bd[_0xcde2('0x31')]>0x0){return _0x1bea12[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x4544bd);}var _0x2541e0=_0x50a1db[_0xcde2('0x2f')][_0xcde2('0x32')];return getAgent(_0x2541e0)['then'](function(_0x223cb0){logger[_0xcde2('0x14')]('entityFound:',_0x223cb0[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x223cb0['name']),_0xcde2('0x46'));return _0x1bea12[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x47')});})[_0xcde2('0x21')](handleError(_0x1bea12));};exports[_0xcde2('0x48')]=function(_0x21cd07,_0x45bd76){logger[_0xcde2('0x14')](_0xcde2('0x49'),_0x21cd07[_0xcde2('0x2f')]);var _0x5d42f8=transferValidation['validate'](_0x21cd07[_0xcde2('0x2f')]);if(_0x5d42f8[_0xcde2('0x31')]>0x0){return _0x45bd76[_0xcde2('0x1b')](0x190)['json'](_0x5d42f8);}var _0x485a79=_0x21cd07['body'][_0xcde2('0x32')];var _0x367bad=_0x21cd07[_0xcde2('0x2f')][_0xcde2('0x2a')];var _0x325b51=_0x21cd07[_0xcde2('0x2f')]['transferNumber'];return getAgent(_0x485a79)['then'](function(_0x165ec4){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x165ec4[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x165ec4[_0xcde2('0x19')]),_0xcde2('0x4a'),{'sessionId':_0x367bad,'transferNumber':_0x325b51});return _0x45bd76[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x4b')});})[_0xcde2('0x21')](handleError(_0x45bd76));}; \ No newline at end of file +var _0xbec5=['redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','name','status','send','NotFound','request','then','message','result','catch','agent','VoiceChannels','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','format','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','defaults'];(function(_0x20052b,_0xd1fb7d){var _0x31b6f6=function(_0x4f4454){while(--_0x4f4454){_0x20052b['push'](_0x20052b['shift']());}};_0x31b6f6(++_0xd1fb7d);}(_0xbec5,0xe5));var _0x5bec=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xbec5[_0x2a9f4];return _0x3c39e0;};'use strict';var path=require(_0x5bec('0x0'));var fs=require('fs');var _=require(_0x5bec('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x5bec('0x2'));var util=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var jayson=require(_0x5bec('0x5'));var amiClient=jayson[_0x5bec('0x6')]['http']({'port':0x232a});var logger=require(_0x5bec('0x7'))(_0x5bec('0x8'));var Redis=require(_0x5bec('0x9'));config['redis']=_[_0x5bec('0xa')](config[_0x5bec('0xb')],{'host':_0x5bec('0xc'),'port':0x18eb});var io=require(_0x5bec('0xd'))(new Redis(config[_0x5bec('0xb')]));var Schema=require(_0x5bec('0xe'));var originateValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'callNumber':{'type':'string','required':[!![],_0x5bec('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x5bec('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x5bec('0x12'),'required':[!![],_0x5bec('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]}});function emit(_0x11fb8e,_0x506639,_0x4ab821){logger[_0x5bec('0x14')](_0x11fb8e,_0x506639,JSON[_0x5bec('0x15')](_0x4ab821));io['to'](_0x11fb8e)[_0x5bec('0x16')](_0x506639,_0x4ab821);}function handleError(_0x1771e7){return function(_0x5cd7ae){console['log'](_0x5bec('0x17'),_0x5cd7ae,_0x5cd7ae instanceof RangeError);logger[_0x5bec('0x18')](_0x5cd7ae['stack']);if(_0x5cd7ae instanceof RangeError){if(_0x5cd7ae[_0x5bec('0x19')]){delete _0x5cd7ae[_0x5bec('0x19')];}_0x1771e7[_0x5bec('0x1a')](0x194)[_0x5bec('0x1b')](_0x5cd7ae);}else{if(_0x5cd7ae['name']){delete _0x5cd7ae[_0x5bec('0x19')];}_0x1771e7['status'](0x1f4)[_0x5bec('0x1b')](_0x5cd7ae);}};}function checkError(){return function(_0x208d99){if(!_0x208d99){throw new RangeError(_0x5bec('0x1c'));}return _0x208d99;};}function respondWithRpcPromise(_0x43a62d,_0xfed23){return new BPromise(function(_0x5e154e,_0x232584){var _0x4cfcb8=amiClient;return _0x4cfcb8[_0x5bec('0x1d')](_0x43a62d,_0xfed23)[_0x5bec('0x1e')](function(_0x5b2636){if(_0x5b2636[_0x5bec('0x18')]){if(_0x5b2636[_0x5bec('0x18')]['code']===0x1f4){return _0x232584(_0x5b2636[_0x5bec('0x18')][_0x5bec('0x1f')]);}return _0x5e154e(_0x5b2636[_0x5bec('0x18')][_0x5bec('0x1f')]);}else{_0x5e154e(_0x5b2636[_0x5bec('0x20')]);}})[_0x5bec('0x21')](function(_0x2dc014){_0x232584(_0x2dc014);});});}function getAgent(_0x4de66a){return db['User']['findOne']({'where':{'id':_0x4de66a,'role':_0x5bec('0x22')}})[_0x5bec('0x1e')](checkError());}function getAgentCheckSession(_0x338c25,_0x4939a5){return new BPromise(function(_0x2b3b2c,_0x472e54){var _0x57331b=respondWithRpcPromise(_0x5bec('0x23'));var _0x63ac8=getAgent(_0x338c25);Promise['all']([_0x57331b,_0x63ac8])['then'](function(_0x3575e7){var _0x2a82d5=_0x3575e7[0x0];var _0x3039f0=_0x3575e7[0x1];var _0x2c7a7b=_[_0x5bec('0x24')](_0x2a82d5[_0x5bec('0x25')],function(_0x5d6621){return _0x5d6621[_0x5bec('0x26')]==_0x3039f0['id']&&_0x5d6621['sessionId']==_0x4939a5;});if(_0x2c7a7b[_0x5bec('0x27')]==0x1){_0x2b3b2c(_0x3039f0);}else{_0x472e54(new RangeError(_0x5bec('0x28')+_0x4939a5+_0x5bec('0x29')));}});});}exports[_0x5bec('0x2a')]=function(_0x5128c0,_0x2b42c8){logger[_0x5bec('0x14')](_0x5bec('0x2b'),_0x5128c0['body']);var _0xf6ae6b=originateValidation['validate'](_0x5128c0[_0x5bec('0x2c')]);if(_0xf6ae6b[_0x5bec('0x27')]>0x0){return _0x2b42c8[_0x5bec('0x1a')](0x190)['json'](_0xf6ae6b);}var _0xdc831e=_0x5128c0[_0x5bec('0x2c')]['userId'];var _0x34b441=_0x5128c0[_0x5bec('0x2c')][_0x5bec('0x2d')];var _0x170e28=_0x5128c0[_0x5bec('0x2c')]['callerId'];var _0x7ebd9c=_0x5128c0['body'][_0x5bec('0x2e')];return getAgent(_0xdc831e)[_0x5bec('0x1e')](function(_0x182b86){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x182b86[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x182b86[_0x5bec('0x19')]),_0x5bec('0x31'),{'callNumber':_0x34b441,'callerId':_0x170e28,'callbackUrl':_0x7ebd9c});return _0x2b42c8['status'](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x33')});})['catch'](handleError(_0x2b42c8));};exports[_0x5bec('0x34')]=function(_0x58c34e,_0x400e22){logger[_0x5bec('0x14')](_0x5bec('0x35'),_0x58c34e['body']);var _0xd7b727=hangupValidation[_0x5bec('0xe')](_0x58c34e[_0x5bec('0x2c')]);if(_0xd7b727[_0x5bec('0x27')]>0x0){return _0x400e22[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0xd7b727);}var _0x3b7e50=_0x58c34e['body'][_0x5bec('0x36')];var _0x224c2e=_0x58c34e[_0x5bec('0x2c')][_0x5bec('0x37')];return getAgent(_0x3b7e50)['then'](function(_0x27863b){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x27863b['name']);emit(util['format'](_0x5bec('0x30'),_0x27863b[_0x5bec('0x19')]),_0x5bec('0x38'),{'sessionId':_0x224c2e});return _0x400e22[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x400e22));};exports[_0x5bec('0x39')]=function(_0x5cb97e,_0x39597c){logger[_0x5bec('0x14')](_0x5bec('0x3a'),_0x5cb97e['body']);var _0x1e59a3=answerValidation[_0x5bec('0xe')](_0x5cb97e['body']);if(_0x1e59a3[_0x5bec('0x27')]>0x0){return _0x39597c[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x1e59a3);}var _0x2b51f7=_0x5cb97e[_0x5bec('0x2c')][_0x5bec('0x36')];var _0x3a795c=_0x5cb97e['body']['sessionId'];return getAgent(_0x2b51f7)[_0x5bec('0x1e')](function(_0x4bfa57){logger['info'](_0x5bec('0x2f'),_0x4bfa57['name']);emit(util['format']('user:%s',_0x4bfa57[_0x5bec('0x19')]),_0x5bec('0x3b'),{'sessionId':_0x3a795c});return _0x39597c[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x5bec('0x21')](handleError(_0x39597c));};exports[_0x5bec('0x3c')]=function(_0xa4d32,_0x3a88d2){logger['info'](_0x5bec('0x3d'),_0xa4d32[_0x5bec('0x2c')]);var _0x2bbb1a=holdValidation['validate'](_0xa4d32[_0x5bec('0x2c')]);if(_0x2bbb1a['length']>0x0){return _0x3a88d2[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x2bbb1a);}var _0x133d5c=_0xa4d32[_0x5bec('0x2c')]['userId'];var _0x32869f=_0xa4d32[_0x5bec('0x2c')][_0x5bec('0x37')];return getAgent(_0x133d5c)[_0x5bec('0x1e')](function(_0x35b250){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x35b250['name']);emit(util[_0x5bec('0x3e')](_0x5bec('0x30'),_0x35b250['name']),_0x5bec('0x3f'),{'sessionId':_0x32869f});return _0x3a88d2[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x40')});})[_0x5bec('0x21')](handleError(_0x3a88d2));};exports[_0x5bec('0x41')]=function(_0x3545a5,_0x4f08d9){logger[_0x5bec('0x14')]('unhold\x20fired:',_0x3545a5[_0x5bec('0x2c')]);var _0x208c7b=unholdValidation[_0x5bec('0xe')](_0x3545a5[_0x5bec('0x2c')]);if(_0x208c7b[_0x5bec('0x27')]>0x0){return _0x4f08d9[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x208c7b);}var _0x3bc0c9=_0x3545a5[_0x5bec('0x2c')][_0x5bec('0x36')];var _0x580c75=_0x3545a5[_0x5bec('0x2c')]['sessionId'];return getAgent(_0x3bc0c9)['then'](function(_0x45eb95){logger['info']('entityFound:',_0x45eb95[_0x5bec('0x19')]);emit(util[_0x5bec('0x3e')](_0x5bec('0x30'),_0x45eb95['name']),_0x5bec('0x42'),{'sessionId':_0x580c75});return _0x4f08d9[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x43')});})['catch'](handleError(_0x4f08d9));};exports[_0x5bec('0x44')]=function(_0x209da3,_0x9cae50){logger[_0x5bec('0x14')](_0x5bec('0x45'),_0x9cae50[_0x5bec('0x2c')]);var _0x33b924=callsValidation['validate'](_0x209da3['body']);if(_0x33b924[_0x5bec('0x27')]>0x0){return _0x9cae50['status'](0x190)[_0x5bec('0x32')](_0x33b924);}var _0x7ad053=_0x209da3['body'][_0x5bec('0x36')];var _0x5ddf8b=respondWithRpcPromise(_0x5bec('0x23'));var _0x3ed7ba=getAgent(_0x7ad053);return Promise[_0x5bec('0x46')]([_0x5ddf8b,_0x3ed7ba])[_0x5bec('0x1e')](function(_0x2fb334){var _0x340b42=_0x2fb334[0x0];var _0x2e4293=_0x2fb334[0x1];var _0x2c2e44=_[_0x5bec('0x24')](_0x340b42[_0x5bec('0x25')],function(_0x4ca9c3){return _0x4ca9c3[_0x5bec('0x26')]==_0x2e4293['id'];});return _0x9cae50[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'count':_0x2c2e44['length'],'rows':_0x2c2e44});})[_0x5bec('0x21')](handleError(_0x9cae50));};exports[_0x5bec('0x47')]=function(_0x432a26,_0x56a539){logger[_0x5bec('0x14')](_0x5bec('0x48'),_0x432a26[_0x5bec('0x2c')]);var _0x340cd9=conferenceValidation[_0x5bec('0xe')](_0x432a26['body']);if(_0x340cd9[_0x5bec('0x27')]>0x0){return _0x56a539[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x340cd9);}var _0x2abc02=_0x432a26['body'][_0x5bec('0x36')];return getAgent(_0x2abc02)['then'](function(_0x2b701f){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x2b701f[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x2b701f[_0x5bec('0x19')]),_0x5bec('0x49'));return _0x56a539[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x4a')});})[_0x5bec('0x21')](handleError(_0x56a539));};exports[_0x5bec('0x4b')]=function(_0x407828,_0x245932){logger[_0x5bec('0x14')](_0x5bec('0x4c'),_0x407828[_0x5bec('0x2c')]);var _0x5d3092=transferValidation[_0x5bec('0xe')](_0x407828['body']);if(_0x5d3092[_0x5bec('0x27')]>0x0){return _0x245932[_0x5bec('0x1a')](0x190)['json'](_0x5d3092);}var _0xa7a394=_0x407828['body'][_0x5bec('0x36')];var _0x1061d3=_0x407828['body']['sessionId'];var _0xd54be0=_0x407828[_0x5bec('0x2c')][_0x5bec('0x4d')];return getAgent(_0xa7a394)[_0x5bec('0x1e')](function(_0x2c7a94){logger['info'](_0x5bec('0x2f'),_0x2c7a94[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x2c7a94[_0x5bec('0x19')]),_0x5bec('0x4e'),{'sessionId':_0x1061d3,'transferNumber':_0xd54be0});return _0x245932[_0x5bec('0x1a')](0xc8)['json']({'error':![],'message':_0x5bec('0x4f')});})['catch'](handleError(_0x245932));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index fd69416..6b5ef29 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 _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x40e250,_0x4de18e){var _0x26119c=function(_0x2319d4){while(--_0x2319d4){_0x40e250['push'](_0x40e250['shift']());}};_0x26119c(++_0x4de18e);}(_0x4137,0xf8));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('0x24')]=router; \ No newline at end of file +var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x524e,0x15e));var _0xe524=function(_0x4c4700,_0x3cca07){_0x4c4700=_0x4c4700-0x0;var _0x18031b=_0x524e[_0x4c4700];return _0x18031b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index de9a769..837df1e 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 _0x7d51=['generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','randomstring','exports','STRING','name'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7d51,0x14c));var _0x17d5=function(_0x2f3f5a,_0x5064e5){_0x2f3f5a=_0x2f3f5a-0x0;var _0x6a788e=_0x7d51[_0x2f3f5a];return _0x6a788e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x17d5('0x0'));module[_0x17d5('0x1')]={'name':{'type':Sequelize[_0x17d5('0x2')],'unique':_0x17d5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x17d5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x17d5('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x17d5('0x4')]();}},'phone':{'type':Sequelize[_0x17d5('0x2')]},'type':{'type':Sequelize[_0x17d5('0x5')](_0x17d5('0x6'))},'accountSid':{'type':Sequelize[_0x17d5('0x2')]},'authToken':{'type':Sequelize[_0x17d5('0x2')]},'notificationTemplate':{'type':Sequelize[_0x17d5('0x7')],'defaultValue':function(){return _0x17d5('0x8');}},'notificationSound':{'type':Sequelize[_0x17d5('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x17d5('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x17d5('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x17d5('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x17d5('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x17d5('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x29c347){if(!_0x29c347){this[_0x17d5('0xb')]('mandatoryDispositionPauseId',null);}this[_0x17d5('0xb')]('mandatoryDisposition',_0x29c347);}},'description':{'type':Sequelize[_0x17d5('0x2')]}}; \ No newline at end of file +var _0xbe60=['ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate'];(function(_0x188650,_0xc40d8){var _0x4db216=function(_0x42cc5c){while(--_0x42cc5c){_0x188650['push'](_0x188650['shift']());}};_0x4db216(++_0xc40d8);}(_0xbe60,0x173));var _0x0be6=function(_0x485600,_0x5aa262){_0x485600=_0x485600-0x0;var _0x9bec12=_0xbe60[_0x485600];return _0x9bec12;};'use strict';var Sequelize=require(_0x0be6('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x0be6('0x1')],'unique':_0x0be6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0be6('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0be6('0x1')],'defaultValue':function(){return rs[_0x0be6('0x3')]();}},'phone':{'type':Sequelize[_0x0be6('0x1')]},'type':{'type':Sequelize[_0x0be6('0x4')](_0x0be6('0x5'))},'accountSid':{'type':Sequelize[_0x0be6('0x1')]},'authToken':{'type':Sequelize[_0x0be6('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0be6('0x6')],'defaultValue':function(){return _0x0be6('0x7');}},'notificationSound':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0be6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0be6('0x9')],'comment':_0x0be6('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![],'comment':_0x0be6('0xb'),'set':function(_0x25341b){if(!_0x25341b){this[_0x0be6('0xc')](_0x0be6('0xd'),null);}this[_0x0be6('0xc')](_0x0be6('0xe'),_0x25341b);}},'description':{'type':Sequelize[_0x0be6('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 6f7d718..e08303b 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 _0x4cbf=['path','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','map','WhatsappAccount','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','count','includeAll','rows','show','params','mandatoryDispositionPause','rawAttributes','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','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','getApplications','notify','whatsapp','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','messageId','MessageSid','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','DESC','Messages','dataValues','push','eml-format','rimraf','request-promise','moment','bluebird','util'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0x4cbf,0xb6));var _0xf4cb=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4cbf[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xf4cb('0x0'));var rimraf=require(_0xf4cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf4cb('0x2'));var moment=require(_0xf4cb('0x3'));var BPromise=require(_0xf4cb('0x4'));var Mustache=require('mustache');var util=require(_0xf4cb('0x5'));var path=require(_0xf4cb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4cb('0x7'));var _=require(_0xf4cb('0x8'));var squel=require(_0xf4cb('0x9'));var crypto=require(_0xf4cb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf4cb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf4cb('0xc'));var Papa=require('papaparse');var Redis=require(_0xf4cb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf4cb('0xe'));var as=require(_0xf4cb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4cb('0x10'))('api');var utils=require(_0xf4cb('0x11'));var config=require(_0xf4cb('0x12'));var licenseUtil=require(_0xf4cb('0x13'));var db=require(_0xf4cb('0x14'))['db'];config['redis']=_[_0xf4cb('0x15')](config[_0xf4cb('0x16')],{'host':_0xf4cb('0x17'),'port':0x18eb});var socket=require(_0xf4cb('0x18'))(new Redis(config[_0xf4cb('0x16')]));require(_0xf4cb('0x19'))[_0xf4cb('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf4cb('0x1b')][_0xf4cb('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x4e3eb6,_0x33b3da,_0x3bfe4f,_0x3cb598){return new BPromise(function(_0xd5357c,_0x26d723){var _0x5805c2=_0x3cb598||client;return _0x5805c2[_0xf4cb('0x1d')](_0x4e3eb6,_0x3bfe4f)[_0xf4cb('0x1e')](function(_0x249b90){logger[_0xf4cb('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x33b3da,_0xf4cb('0x20'));logger[_0xf4cb('0x21')](_0xf4cb('0x22'),_0x33b3da,'request\x20sent',JSON['stringify'](_0x249b90));if(_0x249b90[_0xf4cb('0x23')]){if(_0x249b90[_0xf4cb('0x23')][_0xf4cb('0x24')]===0x1f4){logger[_0xf4cb('0x23')](_0xf4cb('0x25'),_0x33b3da,_0x249b90['error'][_0xf4cb('0x26')]);return _0x26d723(_0x249b90[_0xf4cb('0x23')][_0xf4cb('0x26')]);}logger[_0xf4cb('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x33b3da,_0x249b90['error'][_0xf4cb('0x26')]);return _0xd5357c(_0x249b90[_0xf4cb('0x23')][_0xf4cb('0x26')]);}else{logger[_0xf4cb('0x1f')](_0xf4cb('0x25'),_0x33b3da,_0xf4cb('0x20'));_0xd5357c(_0x249b90[_0xf4cb('0x27')][_0xf4cb('0x26')]);}})[_0xf4cb('0x28')](function(_0xf55328){logger[_0xf4cb('0x23')](_0xf4cb('0x25'),_0x33b3da,_0xf55328);_0x26d723(_0xf55328);});});}function respondWithStatusCode(_0x3d1122,_0x3e06cb){_0x3e06cb=_0x3e06cb||0xcc;return function(_0xfab133){if(_0xfab133){return _0x3d1122[_0xf4cb('0x29')](_0x3e06cb);}return _0x3d1122[_0xf4cb('0x2a')](_0x3e06cb)[_0xf4cb('0x2b')]();};}function respondWithResult(_0x141c78,_0x3e7cfe){_0x3e7cfe=_0x3e7cfe||0xc8;return function(_0x387f1b){if(_0x387f1b){return _0x141c78[_0xf4cb('0x2a')](_0x3e7cfe)[_0xf4cb('0x2c')](_0x387f1b);}};}function respondWithFilteredResult(_0x5a8c54,_0x226198){return function(_0xcd12c5){if(_0xcd12c5){var _0x52bf8a=typeof _0x226198[_0xf4cb('0x2d')]===_0xf4cb('0x2e')&&typeof _0x226198[_0xf4cb('0x2f')]==='undefined';var _0x37a46f=_0xcd12c5['count'];var _0x58db77=_0x52bf8a?0x0:_0x226198[_0xf4cb('0x2d')];var _0x3a1527=_0x52bf8a?_0xcd12c5['count']:_0x226198[_0xf4cb('0x2d')]+_0x226198['limit'];var _0x1f5998;if(_0x3a1527>=_0x37a46f){_0x3a1527=_0x37a46f;_0x1f5998=0xc8;}else{_0x1f5998=0xce;}_0x5a8c54[_0xf4cb('0x2a')](_0x1f5998);return _0x5a8c54[_0xf4cb('0x30')](_0xf4cb('0x31'),_0x58db77+'-'+_0x3a1527+'/'+_0x37a46f)[_0xf4cb('0x2c')](_0xcd12c5);}return null;};}function patchUpdates(_0x4396aa){return function(_0xc69081){try{jsonpatch[_0xf4cb('0x32')](_0xc69081,_0x4396aa,!![]);}catch(_0x28a9e3){return BPromise['reject'](_0x28a9e3);}return _0xc69081[_0xf4cb('0x33')]();};}function saveUpdates(_0x579df5,_0x20edf9){return function(_0x2f1c87){if(_0x2f1c87){return _0x2f1c87[_0xf4cb('0x34')](_0x579df5)[_0xf4cb('0x1e')](function(_0x264205){return _0x264205;});}return null;};}function removeEntity(_0xf5735d,_0x305f9d){return function(_0x3dcd90){if(_0x3dcd90){return _0x3dcd90[_0xf4cb('0x35')]()[_0xf4cb('0x1e')](function(){var _0x2fdcec=_0x3dcd90['get']({'plain':!![]});var _0x3442ed=_0xf4cb('0x36');return db[_0xf4cb('0x37')][_0xf4cb('0x35')]({'where':{'type':_0x3442ed,'resourceId':_0x2fdcec['id']}})[_0xf4cb('0x1e')](function(){return _0x3dcd90;});})['then'](function(){_0xf5735d[_0xf4cb('0x2a')](0xcc)[_0xf4cb('0x2b')]();});}};}function handleEntityNotFound(_0x545450,_0x20b4ac){return function(_0x3239b8){if(!_0x3239b8){_0x545450['sendStatus'](0x194);}return _0x3239b8;};}function handleError(_0x21a1d9,_0x3ea492){_0x3ea492=_0x3ea492||0x1f4;return function(_0x15902e){logger[_0xf4cb('0x23')](_0x15902e[_0xf4cb('0x38')]);if(_0x15902e['name']){delete _0x15902e[_0xf4cb('0x39')];}_0x21a1d9[_0xf4cb('0x2a')](_0x3ea492)['send'](_0x15902e);};}exports[_0xf4cb('0x3a')]=function(_0x4085cf,_0x16ff1c){var _0x1a6647={'include':[{'model':db[_0xf4cb('0x3b')],'as':'mandatoryDispositionPause'}]},_0x4883d9={},_0x5768fa={'count':0x0,'rows':[]};var _0x4e7b21=_[_0xf4cb('0x3c')](db[_0xf4cb('0x3d')]['rawAttributes'],function(_0x27b4de){return{'name':_0x27b4de[_0xf4cb('0x3e')],'type':_0x27b4de['type']['key']};});_0x4883d9[_0xf4cb('0x3f')]=_['map'](_0x4e7b21,'name');_0x4883d9[_0xf4cb('0x40')]=_[_0xf4cb('0x41')](_0x4085cf['query']);_0x4883d9[_0xf4cb('0x42')]=_[_0xf4cb('0x43')](_0x4883d9['model'],_0x4883d9[_0xf4cb('0x40')]);_0x1a6647[_0xf4cb('0x44')]=_['intersection'](_0x4883d9[_0xf4cb('0x3f')],qs[_0xf4cb('0x45')](_0x4085cf[_0xf4cb('0x40')]['fields']));_0x1a6647['attributes']=_0x1a6647[_0xf4cb('0x44')][_0xf4cb('0x46')]?_0x1a6647[_0xf4cb('0x44')]:_0x4883d9[_0xf4cb('0x3f')];if(!_0x4085cf[_0xf4cb('0x40')][_0xf4cb('0x47')](_0xf4cb('0x48'))){_0x1a6647[_0xf4cb('0x2f')]=qs[_0xf4cb('0x2f')](_0x4085cf[_0xf4cb('0x40')][_0xf4cb('0x2f')]);_0x1a6647[_0xf4cb('0x2d')]=qs['offset'](_0x4085cf[_0xf4cb('0x40')][_0xf4cb('0x2d')]);}_0x1a6647['order']=qs[_0xf4cb('0x49')](_0x4085cf[_0xf4cb('0x40')]['sort']);_0x1a6647['where']=qs['filters'](_['pick'](_0x4085cf[_0xf4cb('0x40')],_0x4883d9[_0xf4cb('0x42')]),_0x4e7b21);if(_0x4085cf[_0xf4cb('0x40')][_0xf4cb('0x4a')]){_0x1a6647[_0xf4cb('0x4b')]=_[_0xf4cb('0x4c')](_0x1a6647['where'],{'$or':_[_0xf4cb('0x3c')](_0x4e7b21,function(_0x3931c7){if(_0x3931c7[_0xf4cb('0x4d')]!==_0xf4cb('0x4e')){var _0x577b04={};_0x577b04[_0x3931c7[_0xf4cb('0x39')]]={'$like':'%'+_0x4085cf['query'][_0xf4cb('0x4a')]+'%'};return _0x577b04;}})});}_0x1a6647=_[_0xf4cb('0x4c')]({},_0x1a6647,_0x4085cf[_0xf4cb('0x4f')]);var _0x51d59b={'where':_0x1a6647[_0xf4cb('0x4b')]};return db['WhatsappAccount']['count'](_0x51d59b)[_0xf4cb('0x1e')](function(_0x46ec6c){_0x5768fa[_0xf4cb('0x50')]=_0x46ec6c;if(_0x4085cf[_0xf4cb('0x40')][_0xf4cb('0x51')]){_0x1a6647['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x1a6647);})[_0xf4cb('0x1e')](function(_0x1a9f64){_0x5768fa[_0xf4cb('0x52')]=_0x1a9f64;return _0x5768fa;})[_0xf4cb('0x1e')](respondWithFilteredResult(_0x16ff1c,_0x1a6647))['catch'](handleError(_0x16ff1c,null));};exports[_0xf4cb('0x53')]=function(_0x2fced7,_0x2cacbe){var _0x370bcb={'raw':![],'where':{'id':_0x2fced7[_0xf4cb('0x54')]['id']},'include':[{'model':db[_0xf4cb('0x3b')],'as':_0xf4cb('0x55')}]},_0x45bcc3={};_0x45bcc3[_0xf4cb('0x3f')]=_[_0xf4cb('0x41')](db[_0xf4cb('0x3d')][_0xf4cb('0x56')]);_0x45bcc3[_0xf4cb('0x40')]=_[_0xf4cb('0x41')](_0x2fced7['query']);_0x45bcc3[_0xf4cb('0x42')]=_[_0xf4cb('0x43')](_0x45bcc3[_0xf4cb('0x3f')],_0x45bcc3[_0xf4cb('0x40')]);_0x370bcb['attributes']=_[_0xf4cb('0x43')](_0x45bcc3[_0xf4cb('0x3f')],qs[_0xf4cb('0x45')](_0x2fced7[_0xf4cb('0x40')][_0xf4cb('0x45')]));_0x370bcb['attributes']=_0x370bcb[_0xf4cb('0x44')]['length']?_0x370bcb[_0xf4cb('0x44')]:_0x45bcc3[_0xf4cb('0x3f')];if(_0x2fced7['query'][_0xf4cb('0x51')]){_0x370bcb[_0xf4cb('0x57')]=[{'all':!![]}];}_0x370bcb=_['merge']({},_0x370bcb,_0x2fced7[_0xf4cb('0x4f')]);return db[_0xf4cb('0x3d')][_0xf4cb('0x58')](_0x370bcb)['then'](handleEntityNotFound(_0x2cacbe,null))[_0xf4cb('0x1e')](respondWithResult(_0x2cacbe,null))[_0xf4cb('0x28')](handleError(_0x2cacbe,null));};exports[_0xf4cb('0x59')]=function(_0x154c8b,_0x325f43){return db[_0xf4cb('0x3d')][_0xf4cb('0x59')](_0x154c8b[_0xf4cb('0x5a')],{})[_0xf4cb('0x1e')](function(_0x3aebc9){var _0x3db265=_0x154c8b[_0xf4cb('0x5b')][_0xf4cb('0x5c')]({'plain':!![]});if(!_0x3db265)throw new Error(_0xf4cb('0x5d'));if(_0x3db265['role']===_0xf4cb('0x5b')){var _0x465703=_0x3aebc9[_0xf4cb('0x5c')]({'plain':!![]});var _0x2e1659=_0xf4cb('0x36');return db[_0xf4cb('0x5e')][_0xf4cb('0x58')]({'where':{'name':_0x2e1659,'userProfileId':_0x3db265[_0xf4cb('0x5f')]},'raw':!![]})[_0xf4cb('0x1e')](function(_0x619877){if(_0x619877&&_0x619877[_0xf4cb('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x465703['name'],'resourceId':_0x465703['id'],'type':_0x619877[_0xf4cb('0x39')],'sectionId':_0x619877['id']},{})[_0xf4cb('0x1e')](function(){return _0x3aebc9;});}else{return _0x3aebc9;}})[_0xf4cb('0x28')](function(_0x26124a){logger[_0xf4cb('0x23')](_0xf4cb('0x61'),_0x26124a);throw _0x26124a;});}return _0x3aebc9;})[_0xf4cb('0x1e')](respondWithResult(_0x325f43,0xc9))[_0xf4cb('0x28')](handleError(_0x325f43,null));};exports[_0xf4cb('0x34')]=function(_0x154474,_0x3298ca){if(_0x154474[_0xf4cb('0x5a')]['id']){delete _0x154474['body']['id'];}return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x154474['params']['id']},'include':[{'model':db[_0xf4cb('0x3b')],'as':_0xf4cb('0x55')}]})[_0xf4cb('0x1e')](handleEntityNotFound(_0x3298ca,null))[_0xf4cb('0x1e')](saveUpdates(_0x154474['body'],null))[_0xf4cb('0x1e')](respondWithResult(_0x3298ca,null))[_0xf4cb('0x28')](handleError(_0x3298ca,null));};exports[_0xf4cb('0x35')]=function(_0x209fc6,_0x4d2a18){return db[_0xf4cb('0x3d')]['find']({'where':{'id':_0x209fc6[_0xf4cb('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d2a18,null))['then'](removeEntity(_0x4d2a18,null))[_0xf4cb('0x28')](handleError(_0x4d2a18,null));};exports[_0xf4cb('0x62')]=function(_0x30fac1,_0x31593f){return db[_0xf4cb('0x3d')][_0xf4cb('0x62')]()[_0xf4cb('0x1e')](respondWithResult(_0x31593f,null))[_0xf4cb('0x28')](handleError(_0x31593f,null));};exports[_0xf4cb('0x63')]=function(_0x34870a,_0x238ec1,_0x1685c7){if(_0x34870a[_0xf4cb('0x5a')]['id']){delete _0x34870a[_0xf4cb('0x5a')]['id'];}return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x34870a['params']['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x238ec1,null))[_0xf4cb('0x1e')](function(_0x31d0ab){if(_0x31d0ab){_0x34870a[_0xf4cb('0x5a')][_0xf4cb('0x64')]=_0x31d0ab['id'];return db[_0xf4cb('0x65')][_0xf4cb('0x59')](_0x34870a[_0xf4cb('0x5a')]);}})[_0xf4cb('0x1e')](respondWithResult(_0x238ec1,null))[_0xf4cb('0x28')](handleError(_0x238ec1,null));};exports[_0xf4cb('0x66')]=function(_0x5c5fb1,_0x299888,_0xb60cd8){var _0x1e3d8a={'raw':![],'where':{}};var _0x2aad62={};var _0x396135={'count':0x0,'rows':[]};return db[_0xf4cb('0x3d')][_0xf4cb('0x67')]({'where':{'id':_0x5c5fb1[_0xf4cb('0x54')]['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x299888,null))[_0xf4cb('0x1e')](function(_0x1152cc){if(_0x1152cc){_0x2aad62[_0xf4cb('0x3f')]=_[_0xf4cb('0x41')](db[_0xf4cb('0x65')][_0xf4cb('0x56')]);_0x2aad62[_0xf4cb('0x40')]=_[_0xf4cb('0x41')](_0x5c5fb1[_0xf4cb('0x40')]);_0x2aad62[_0xf4cb('0x42')]=_[_0xf4cb('0x43')](_0x2aad62[_0xf4cb('0x3f')],_0x2aad62[_0xf4cb('0x40')]);_0x1e3d8a['attributes']=_[_0xf4cb('0x43')](_0x2aad62[_0xf4cb('0x3f')],qs[_0xf4cb('0x45')](_0x5c5fb1[_0xf4cb('0x40')][_0xf4cb('0x45')]));_0x1e3d8a[_0xf4cb('0x44')]=_0x1e3d8a['attributes'][_0xf4cb('0x46')]?_0x1e3d8a[_0xf4cb('0x44')]:_0x2aad62[_0xf4cb('0x3f')];if(!_0x5c5fb1[_0xf4cb('0x40')][_0xf4cb('0x47')](_0xf4cb('0x48'))){_0x1e3d8a['limit']=qs[_0xf4cb('0x2f')](_0x5c5fb1[_0xf4cb('0x40')][_0xf4cb('0x2f')]);_0x1e3d8a[_0xf4cb('0x2d')]=qs[_0xf4cb('0x2d')](_0x5c5fb1[_0xf4cb('0x40')][_0xf4cb('0x2d')]);}_0x1e3d8a[_0xf4cb('0x68')]=qs['sort'](_0x5c5fb1['query']['sort']);_0x1e3d8a['where']=qs[_0xf4cb('0x42')](_[_0xf4cb('0x69')](_0x5c5fb1[_0xf4cb('0x40')],_0x2aad62['filters']));_0x1e3d8a[_0xf4cb('0x4b')][_0xf4cb('0x64')]=_0x1152cc['id'];if(_0x5c5fb1['query'][_0xf4cb('0x4a')]){_0x1e3d8a[_0xf4cb('0x4b')]=_[_0xf4cb('0x4c')](_0x1e3d8a[_0xf4cb('0x4b')],{'$or':_[_0xf4cb('0x3c')](_0x1e3d8a[_0xf4cb('0x44')],function(_0x25d38b){var _0x472901={};_0x472901[_0x25d38b]={'$like':'%'+_0x5c5fb1[_0xf4cb('0x40')][_0xf4cb('0x4a')]+'%'};return _0x472901;})});}_0x1e3d8a=_[_0xf4cb('0x4c')]({},_0x1e3d8a,_0x5c5fb1[_0xf4cb('0x4f')]);return db['Disposition'][_0xf4cb('0x50')]({'where':_0x1e3d8a['where']})[_0xf4cb('0x1e')](function(_0x3193f9){_0x396135[_0xf4cb('0x50')]=_0x3193f9;if(_0x5c5fb1['query']['includeAll']){_0x1e3d8a[_0xf4cb('0x57')]=[{'all':!![]}];}return db[_0xf4cb('0x65')][_0xf4cb('0x6a')](_0x1e3d8a);})[_0xf4cb('0x1e')](function(_0x123122){_0x396135[_0xf4cb('0x52')]=_0x123122;return _0x396135;});}})[_0xf4cb('0x1e')](respondWithFilteredResult(_0x299888,_0x1e3d8a))[_0xf4cb('0x28')](handleError(_0x299888,null));};exports[_0xf4cb('0x6b')]=function(_0x895ee,_0x142cc5,_0x25dc09){return db[_0xf4cb('0x3d')]['find']({'where':{'id':_0x895ee['params']['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x142cc5,null))['then'](function(_0x2c9483){if(_0x2c9483){return _0x2c9483[_0xf4cb('0x6b')](_0x895ee[_0xf4cb('0x40')][_0xf4cb('0x6c')]);}})[_0xf4cb('0x1e')](respondWithStatusCode(_0x142cc5,null))['catch'](handleError(_0x142cc5,null));};exports[_0xf4cb('0x6d')]=function(_0x2bca00,_0x45c1b2,_0x167f54){if(_0x2bca00[_0xf4cb('0x5a')]['id']){delete _0x2bca00[_0xf4cb('0x5a')]['id'];}return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x2bca00[_0xf4cb('0x54')]['id']}})['then'](handleEntityNotFound(_0x45c1b2,null))[_0xf4cb('0x1e')](function(_0x21538a){if(_0x21538a){_0x2bca00[_0xf4cb('0x5a')][_0xf4cb('0x64')]=_0x21538a['id'];return db['CannedAnswer']['create'](_0x2bca00[_0xf4cb('0x5a')]);}})[_0xf4cb('0x1e')](respondWithResult(_0x45c1b2,null))['catch'](handleError(_0x45c1b2,null));};exports['getAnswers']=function(_0x388340,_0x523e67,_0x317839){var _0x28f9fd={'raw':![],'where':{}};var _0x4202ec={};var _0x3d0f48={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf4cb('0x67')]({'where':{'id':_0x388340[_0xf4cb('0x54')]['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x523e67,null))[_0xf4cb('0x1e')](function(_0x22c3b9){if(_0x22c3b9){_0x4202ec[_0xf4cb('0x3f')]=_[_0xf4cb('0x41')](db[_0xf4cb('0x6e')][_0xf4cb('0x56')]);_0x4202ec['query']=_[_0xf4cb('0x41')](_0x388340[_0xf4cb('0x40')]);_0x4202ec[_0xf4cb('0x42')]=_[_0xf4cb('0x43')](_0x4202ec[_0xf4cb('0x3f')],_0x4202ec[_0xf4cb('0x40')]);_0x28f9fd[_0xf4cb('0x44')]=_[_0xf4cb('0x43')](_0x4202ec[_0xf4cb('0x3f')],qs[_0xf4cb('0x45')](_0x388340[_0xf4cb('0x40')][_0xf4cb('0x45')]));_0x28f9fd[_0xf4cb('0x44')]=_0x28f9fd[_0xf4cb('0x44')]['length']?_0x28f9fd[_0xf4cb('0x44')]:_0x4202ec['model'];if(!_0x388340['query'][_0xf4cb('0x47')]('nolimit')){_0x28f9fd[_0xf4cb('0x2f')]=qs[_0xf4cb('0x2f')](_0x388340[_0xf4cb('0x40')][_0xf4cb('0x2f')]);_0x28f9fd[_0xf4cb('0x2d')]=qs[_0xf4cb('0x2d')](_0x388340['query'][_0xf4cb('0x2d')]);}_0x28f9fd[_0xf4cb('0x68')]=qs[_0xf4cb('0x49')](_0x388340[_0xf4cb('0x40')][_0xf4cb('0x49')]);_0x28f9fd[_0xf4cb('0x4b')]=qs[_0xf4cb('0x42')](_['pick'](_0x388340['query'],_0x4202ec[_0xf4cb('0x42')]));_0x28f9fd[_0xf4cb('0x4b')]['WhatsappAccountId']=_0x22c3b9['id'];if(_0x388340[_0xf4cb('0x40')]['filter']){_0x28f9fd['where']=_[_0xf4cb('0x4c')](_0x28f9fd[_0xf4cb('0x4b')],{'$or':_[_0xf4cb('0x3c')](_0x28f9fd[_0xf4cb('0x44')],function(_0x45b8de){var _0x1442de={};_0x1442de[_0x45b8de]={'$like':'%'+_0x388340[_0xf4cb('0x40')][_0xf4cb('0x4a')]+'%'};return _0x1442de;})});}_0x28f9fd=_['merge']({},_0x28f9fd,_0x388340[_0xf4cb('0x4f')]);return db['CannedAnswer']['count']({'where':_0x28f9fd['where']})[_0xf4cb('0x1e')](function(_0x341300){_0x3d0f48[_0xf4cb('0x50')]=_0x341300;if(_0x388340[_0xf4cb('0x40')][_0xf4cb('0x51')]){_0x28f9fd['include']=[{'all':!![]}];}return db[_0xf4cb('0x6e')][_0xf4cb('0x6a')](_0x28f9fd);})[_0xf4cb('0x1e')](function(_0x4a59cd){_0x3d0f48[_0xf4cb('0x52')]=_0x4a59cd;return _0x3d0f48;});}})[_0xf4cb('0x1e')](respondWithFilteredResult(_0x523e67,_0x28f9fd))[_0xf4cb('0x28')](handleError(_0x523e67,null));};exports[_0xf4cb('0x6f')]=function(_0x76023c,_0x717111,_0x322e2f){return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x76023c[_0xf4cb('0x54')]['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x717111,null))['then'](function(_0x260cf7){if(_0x260cf7){return _0x260cf7[_0xf4cb('0x6f')](_0x76023c['query'][_0xf4cb('0x6c')]);}})['then'](respondWithStatusCode(_0x717111,null))[_0xf4cb('0x28')](handleError(_0x717111,null));};exports['addAgents']=function(_0x175377,_0xbe52d0,_0x9c2626){return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x175377[_0xf4cb('0x54')]['id']}})['then'](handleEntityNotFound(_0xbe52d0,null))[_0xf4cb('0x1e')](function(_0x562cb0){if(_0x562cb0){return _0x562cb0[_0xf4cb('0x70')](_0x175377[_0xf4cb('0x5a')][_0xf4cb('0x6c')],_['omit'](_0x175377[_0xf4cb('0x5a')],[_0xf4cb('0x6c'),'id'])||{})[_0xf4cb('0x71')](function(_0x1847d5){for(var _0x1d059a=0x0;_0x1d059a<_0x175377[_0xf4cb('0x5a')]['ids'][_0xf4cb('0x46')];_0x1d059a+=0x1){socket[_0xf4cb('0x72')](_0xf4cb('0x73'),{'UserId':Number(_0x175377[_0xf4cb('0x5a')][_0xf4cb('0x6c')][_0x1d059a]),'WhatsappAccountId':Number(_0x175377[_0xf4cb('0x54')]['id'])});}return _0x1847d5;});}})['then'](respondWithResult(_0xbe52d0,null))['catch'](handleError(_0xbe52d0,null));};exports[_0xf4cb('0x74')]=function(_0x1b2e97,_0x3b8d37,_0x1face6){return db['WhatsappAccount'][_0xf4cb('0x58')]({'where':{'id':_0x1b2e97['params']['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x3b8d37,null))['then'](function(_0x1fed5c){if(_0x1fed5c){return _0x1fed5c[_0xf4cb('0x74')](_0x1b2e97[_0xf4cb('0x40')][_0xf4cb('0x6c')])[_0xf4cb('0x1e')](function(){if(_[_0xf4cb('0x75')](_0x1b2e97[_0xf4cb('0x40')][_0xf4cb('0x6c')])){for(var _0x1c1bd1=0x0;_0x1c1bd1<_0x1b2e97[_0xf4cb('0x40')][_0xf4cb('0x6c')][_0xf4cb('0x46')];_0x1c1bd1+=0x1){socket[_0xf4cb('0x72')](_0xf4cb('0x76'),{'UserId':Number(_0x1b2e97[_0xf4cb('0x40')][_0xf4cb('0x6c')][_0x1c1bd1]),'WhatsappAccountId':Number(_0x1b2e97[_0xf4cb('0x54')]['id'])});}}else{socket[_0xf4cb('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x1b2e97['query'][_0xf4cb('0x6c')]),'WhatsappAccountId':Number(_0x1b2e97[_0xf4cb('0x54')]['id'])});}});}})[_0xf4cb('0x1e')](respondWithStatusCode(_0x3b8d37,null))[_0xf4cb('0x28')](handleError(_0x3b8d37,null));};exports[_0xf4cb('0x77')]=function(_0x84b662,_0x1be624,_0x2d568c){var _0x321f93={};var _0x6e4761={};var _0xcff004;var _0x378779;return db[_0xf4cb('0x3d')][_0xf4cb('0x67')]({'where':{'id':_0x84b662['params']['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x1be624,null))[_0xf4cb('0x1e')](function(_0x12b0e0){if(_0x12b0e0){_0xcff004=_0x12b0e0;_0x6e4761[_0xf4cb('0x3f')]=_['keys'](db[_0xf4cb('0x78')]['rawAttributes']);_0x6e4761['query']=_['keys'](_0x84b662[_0xf4cb('0x40')]);_0x6e4761[_0xf4cb('0x42')]=_['intersection'](_0x6e4761[_0xf4cb('0x3f')],_0x6e4761[_0xf4cb('0x40')]);_0x321f93[_0xf4cb('0x44')]=_[_0xf4cb('0x43')](_0x6e4761['model'],qs[_0xf4cb('0x45')](_0x84b662[_0xf4cb('0x40')][_0xf4cb('0x45')]));_0x321f93[_0xf4cb('0x44')]=_0x321f93[_0xf4cb('0x44')]['length']?_0x321f93[_0xf4cb('0x44')]:_0x6e4761[_0xf4cb('0x3f')];_0x321f93[_0xf4cb('0x68')]=qs['sort'](_0x84b662[_0xf4cb('0x40')][_0xf4cb('0x49')]);_0x321f93[_0xf4cb('0x4b')]=qs[_0xf4cb('0x42')](_[_0xf4cb('0x69')](_0x84b662[_0xf4cb('0x40')],_0x6e4761['filters']));if(_0x84b662[_0xf4cb('0x40')][_0xf4cb('0x4a')]){_0x321f93[_0xf4cb('0x4b')]=_[_0xf4cb('0x4c')](_0x321f93['where'],{'$or':_['map'](_0x321f93['attributes'],function(_0x11eb55){var _0x9f2489={};_0x9f2489[_0x11eb55]={'$like':'%'+_0x84b662[_0xf4cb('0x40')][_0xf4cb('0x4a')]+'%'};return _0x9f2489;})});}_0x321f93=_[_0xf4cb('0x4c')]({},_0x321f93,_0x84b662[_0xf4cb('0x4f')]);return _0xcff004[_0xf4cb('0x77')](_0x321f93);}})[_0xf4cb('0x1e')](function(_0x4f1ef2){if(_0x4f1ef2){_0x378779=_0x4f1ef2[_0xf4cb('0x46')];if(!_0x84b662['query'][_0xf4cb('0x47')]('nolimit')){_0x321f93['limit']=qs[_0xf4cb('0x2f')](_0x84b662['query'][_0xf4cb('0x2f')]);_0x321f93[_0xf4cb('0x2d')]=qs['offset'](_0x84b662['query'][_0xf4cb('0x2d')]);}return _0xcff004[_0xf4cb('0x77')](_0x321f93);}})['then'](function(_0x1638c1){if(_0x1638c1){return _0x1638c1?{'count':_0x378779,'rows':_0x1638c1}:null;}})[_0xf4cb('0x1e')](respondWithResult(_0x1be624,null))[_0xf4cb('0x28')](handleError(_0x1be624,null));};exports['addApplications']=function(_0x4fcd16,_0x1d82e5,_0x2c3081){return db[_0xf4cb('0x3d')][_0xf4cb('0x67')]({'where':{'id':_0x4fcd16[_0xf4cb('0x54')]['id']}})[_0xf4cb('0x1e')](handleEntityNotFound(_0x1d82e5,null))[_0xf4cb('0x1e')](function(_0x333287){if(_0x333287){return db[_0xf4cb('0x79')][_0xf4cb('0x7a')](function(_0x2dc3ce){return db[_0xf4cb('0x7b')][_0xf4cb('0x35')]({'where':{'WhatsappAccountId':_0x4fcd16[_0xf4cb('0x54')]['id']},'transaction':_0x2dc3ce})[_0xf4cb('0x1e')](function(_0x482249){var _0x5087ba=_[_0xf4cb('0x3c')](_0x4fcd16['body'],function(_0x3e05e9){_0x3e05e9[_0xf4cb('0x64')]=_0x4fcd16[_0xf4cb('0x54')]['id'];return _0x3e05e9;});return db['WhatsappApplication'][_0xf4cb('0x7c')](_0x5087ba,{'transaction':_0x2dc3ce});});})[_0xf4cb('0x1e')](function(){return db[_0xf4cb('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4fcd16['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x1d82e5,null))['catch'](handleError(_0x1d82e5,null));};exports[_0xf4cb('0x7d')]=function(_0x407d9c,_0x4b5535,_0x5228ea){var _0x25d8ed={};var _0x3192a3={};var _0x3f7c7a;var _0x3a9880;return db[_0xf4cb('0x3d')][_0xf4cb('0x67')]({'where':{'id':_0x407d9c[_0xf4cb('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b5535,null))['then'](function(_0x35c7e1){if(_0x35c7e1){_0x3f7c7a=_0x35c7e1;_0x3192a3[_0xf4cb('0x3f')]=_['keys'](db[_0xf4cb('0x7b')][_0xf4cb('0x56')]);_0x3192a3[_0xf4cb('0x40')]=_[_0xf4cb('0x41')](_0x407d9c['query']);_0x3192a3[_0xf4cb('0x42')]=_['intersection'](_0x3192a3[_0xf4cb('0x3f')],_0x3192a3[_0xf4cb('0x40')]);_0x25d8ed['attributes']=_['intersection'](_0x3192a3[_0xf4cb('0x3f')],qs[_0xf4cb('0x45')](_0x407d9c[_0xf4cb('0x40')][_0xf4cb('0x45')]));_0x25d8ed[_0xf4cb('0x44')]=_0x25d8ed[_0xf4cb('0x44')][_0xf4cb('0x46')]?_0x25d8ed[_0xf4cb('0x44')]:_0x3192a3['model'];_0x25d8ed[_0xf4cb('0x68')]=qs[_0xf4cb('0x49')](_0x407d9c['query'][_0xf4cb('0x49')]);_0x25d8ed['where']=qs[_0xf4cb('0x42')](_[_0xf4cb('0x69')](_0x407d9c[_0xf4cb('0x40')],_0x3192a3['filters']));if(_0x407d9c[_0xf4cb('0x40')]['filter']){_0x25d8ed[_0xf4cb('0x4b')]=_[_0xf4cb('0x4c')](_0x25d8ed[_0xf4cb('0x4b')],{'$or':_['map'](_0x25d8ed['attributes'],function(_0x5e999a){var _0x3fc7bc={};_0x3fc7bc[_0x5e999a]={'$like':'%'+_0x407d9c[_0xf4cb('0x40')][_0xf4cb('0x4a')]+'%'};return _0x3fc7bc;})});}_0x25d8ed=_['merge']({},_0x25d8ed,_0x407d9c[_0xf4cb('0x4f')]);return _0x3f7c7a[_0xf4cb('0x7d')](_0x25d8ed);}})[_0xf4cb('0x1e')](function(_0x3c4ecb){if(_0x3c4ecb){_0x3a9880=_0x3c4ecb[_0xf4cb('0x46')];if(!_0x407d9c[_0xf4cb('0x40')][_0xf4cb('0x47')](_0xf4cb('0x48'))){_0x25d8ed[_0xf4cb('0x2f')]=qs[_0xf4cb('0x2f')](_0x407d9c[_0xf4cb('0x40')][_0xf4cb('0x2f')]);_0x25d8ed[_0xf4cb('0x2d')]=qs[_0xf4cb('0x2d')](_0x407d9c[_0xf4cb('0x40')][_0xf4cb('0x2d')]);}return _0x3f7c7a[_0xf4cb('0x7d')](_0x25d8ed);}})['then'](function(_0x1e99cb){if(_0x1e99cb){return _0x1e99cb?{'count':_0x3a9880,'rows':_0x1e99cb}:null;}})['then'](respondWithResult(_0x4b5535,null))[_0xf4cb('0x28')](handleError(_0x4b5535,null));};exports[_0xf4cb('0x7e')]=function(_0x1ba375,_0x1b24b6,_0x1af5f1){var _0x778073={'channel':_0xf4cb('0x7f')};var _0x386b15=[];var _0x1ae5c0=[];var _0x410e32={};return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x1ba375['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})[_0xf4cb('0x1e')](handleEntityNotFound(_0x1b24b6,null))[_0xf4cb('0x1e')](function(_0x37d53d){_0x778073[_0xf4cb('0x80')]=_0x37d53d;_0x778073[_0xf4cb('0x81')]=_[_0xf4cb('0x82')](_0x37d53d[_0xf4cb('0x83')],[_0xf4cb('0x84')],[_0xf4cb('0x85')]);if(_0x778073[_0xf4cb('0x80')][_0xf4cb('0x83')]){delete _0x778073[_0xf4cb('0x80')]['Applications'];}return db[_0xf4cb('0x86')][_0xf4cb('0x62')]();})[_0xf4cb('0x1e')](function(_0x2a5dde){if(!_0x2a5dde){throw new db[(_0xf4cb('0x87'))]['ValidationError'](_0xf4cb('0x88'));}_0x386b15=_[_0xf4cb('0x89')](_[_0xf4cb('0x41')](_0x2a5dde),['createdAt',_0xf4cb('0x8a')]);_0x1ae5c0=_['difference'](_[_0xf4cb('0x41')](_0x2a5dde),['createdAt',_0xf4cb('0x8a'),_0xf4cb('0x8b'),_0xf4cb('0x8c')]);_0x778073[_0xf4cb('0x5a')]={'mapKey':_0xf4cb('0x8d')};if(_0x778073[_0xf4cb('0x80')][_0xf4cb('0x4d')]&&_0x778073[_0xf4cb('0x80')][_0xf4cb('0x4d')]==='twilio'){_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x8e')]=_0x1ba375[_0xf4cb('0x5a')][_0xf4cb('0x8f')][_0xf4cb('0x90')](_0xf4cb('0x91'),'');_0x778073[_0xf4cb('0x5a')]['body']=_0x1ba375[_0xf4cb('0x5a')][_0xf4cb('0x92')];_0x778073['body'][_0xf4cb('0x93')]=_0x1ba375[_0xf4cb('0x5a')][_0xf4cb('0x94')];}if(_0x778073[_0xf4cb('0x5a')]['id']){delete _0x778073[_0xf4cb('0x5a')]['id'];}if(_['isNil'](_0x778073['body'][_0xf4cb('0x8e')])){throw new db[(_0xf4cb('0x87'))][(_0xf4cb('0x95'))](_0xf4cb('0x96'));}if(_['isNil'](_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x5a')])||_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x5a')]===''){throw new db['Sequelize'][(_0xf4cb('0x95'))](_0xf4cb('0x97'));}if(_[_0xf4cb('0x98')](_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x99')])){throw new db[(_0xf4cb('0x87'))][(_0xf4cb('0x95'))](_0xf4cb('0x9a')+_0x1ae5c0);}if(!_['includes'](_0x1ae5c0,_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x99')])){throw new db[(_0xf4cb('0x87'))][(_0xf4cb('0x95'))](_0xf4cb('0x9b')+_0x1ae5c0);}_0x410e32[_0x778073['body'][_0xf4cb('0x99')]]=_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x8e')];return db[_0xf4cb('0x9c')][_0xf4cb('0x58')]({'where':{'id':_0x778073[_0xf4cb('0x80')][_0xf4cb('0x8c')]},'include':[{'model':db[_0xf4cb('0x86')],'as':_0xf4cb('0x9d'),'where':_0x410e32,'limit':0x1,'order':[[_0xf4cb('0x8a'),'DESC']]}]});})[_0xf4cb('0x1e')](handleEntityNotFound(_0x1b24b6,null))[_0xf4cb('0x1e')](function(_0x3091c3){if(_0x3091c3){_0x778073['list']=_['omit'](_0x3091c3,[_0xf4cb('0x9d')]);if(_0x3091c3[_0xf4cb('0x9d')][_0xf4cb('0x46')]){return _0x3091c3[_0xf4cb('0x9d')][0x0];}var _0x52ba40=_[_0xf4cb('0x15')](_0x778073[_0xf4cb('0x5a')],{'firstName':_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x8e')],'ListId':_0x3091c3['id']});_0x52ba40[_0x778073[_0xf4cb('0x5a')]['mapKey']]=_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x8e')];return db[_0xf4cb('0x86')][_0xf4cb('0x59')](_0x52ba40,{'fields':_0x386b15,'raw':!![]});}})['then'](handleEntityNotFound(_0x1b24b6,null))['then'](function(_0x25f001){if(_0x25f001){_0x778073[_0xf4cb('0x9e')]=_0x25f001;var _0x661dfe={'ContactId':_0x25f001['id'],'phone':_0x778073[_0xf4cb('0x5a')]['from'],'WhatsappAccountId':_0x1ba375[_0xf4cb('0x54')]['id']};var _0x36e47a={'ContactId':_0x25f001['id'],'WhatsappAccountId':_0x1ba375[_0xf4cb('0x54')]['id'],'closed':![]};return db[_0xf4cb('0x9f')][_0xf4cb('0x58')]({'where':_0x36e47a})[_0xf4cb('0x1e')](function(_0x34a91e){if(_0x34a91e){return[_0x34a91e,![]];}return db[_0xf4cb('0x9f')][_0xf4cb('0x59')](_0x661dfe)[_0xf4cb('0x1e')](function(_0x20249d){return[_0x20249d,!![]];});});}})[_0xf4cb('0x71')](function(_0x4fbc14,_0x5b02d2){_0x778073['interaction']=_0x4fbc14['get']({'plain':!![]});_0x778073[_0xf4cb('0xa0')][_0xf4cb('0xa1')]=![];if(_0x5b02d2){if(_0x778073[_0xf4cb('0x80')][_0xf4cb('0xa2')]){_0x778073['applications']['push']({'id':0x0,'priority':_0x778073[_0xf4cb('0x81')][_0xf4cb('0x46')]+0x1,'app':_0xf4cb('0xa3'),'appdata':_0xf4cb('0xa4'),'interval':_0xf4cb('0xa5')});}_0x778073[_0xf4cb('0xa0')][_0xf4cb('0xa1')]=!![];}return db[_0xf4cb('0xa6')][_0xf4cb('0x59')]({'phone':_0x778073[_0xf4cb('0x5a')]['from'],'messageId':_0x778073[_0xf4cb('0x5a')]['messageId'],'body':_0x778073[_0xf4cb('0x5a')][_0xf4cb('0x5a')],'WhatsappAccountId':_0x1ba375[_0xf4cb('0x54')]['id'],'WhatsappInteractionId':_0x4fbc14['id'],'direction':'in','ContactId':_0x4fbc14['ContactId'],'AttachmentId':_0x778073[_0xf4cb('0x5a')][_0xf4cb('0xa7')]});})[_0xf4cb('0x1e')](function(_0x158fb0){_0x778073[_0xf4cb('0x26')]=_0x158fb0;if(_0x778073[_0xf4cb('0xa0')][_0xf4cb('0xa8')]){return db[_0xf4cb('0x78')][_0xf4cb('0x58')]({'attributes':['id','name'],'where':{'id':_0x778073[_0xf4cb('0xa0')][_0xf4cb('0xa8')]}})[_0xf4cb('0x1e')](function(_0x20e1bc){if(_0x20e1bc){_0x778073['applications'][_0xf4cb('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20e1bc['name']+','+(_0x778073[_0xf4cb('0x80')][_0xf4cb('0xaa')]||0xa),'interval':_0xf4cb('0xa5')});}return respondWithRpcPromise('Start',_0xf4cb('0xab'),_0x778073);});}return respondWithRpcPromise(_0xf4cb('0xac'),'startRouting',_0x778073);})['then'](function(_0x114d30){if(_0x114d30){var _0x31d6d9=0xc8;var _0x10994f=_0xf4cb('0xad');logger['info'](_0xf4cb('0x22'),_0x10994f,_0x31d6d9,_0xf4cb('0xae'));logger[_0xf4cb('0x21')](_0xf4cb('0xaf'),_0x10994f,_0x31d6d9,_0xf4cb('0xae'),JSON[_0xf4cb('0xb0')](_0x114d30));if(_0x778073[_0xf4cb('0x80')][_0xf4cb('0x4d')]===_0xf4cb('0xb1')){return _0x1b24b6[_0xf4cb('0x2a')](_0x31d6d9)['set'](_0xf4cb('0xb2'),_0xf4cb('0xb3'))[_0xf4cb('0xb4')](_0xf4cb('0xb5'));}else{return _0x1b24b6['status'](_0x31d6d9)['json'](_0x114d30);}}})['catch'](handleError(_0x1b24b6,null));};exports[_0xf4cb('0xb4')]=function(_0x1c7806,_0xb4d596,_0x3e2508){var _0x5ee419,_0xb171b6,_0x24d97a;if(_[_0xf4cb('0x98')](_0x1c7806[_0xf4cb('0x5a')][_0xf4cb('0x5a')])||_0x1c7806[_0xf4cb('0x5a')][_0xf4cb('0x5a')]===''){throw new db['Sequelize'][(_0xf4cb('0x95'))](_0xf4cb('0x97'));}if(_[_0xf4cb('0x98')](_0x1c7806[_0xf4cb('0x5a')]['to'])){throw new db[(_0xf4cb('0x87'))][(_0xf4cb('0x95'))](_0xf4cb('0xb6'));}_0x5ee419=_0x1c7806['body']['to'];return db[_0xf4cb('0x3d')][_0xf4cb('0x58')]({'where':{'id':_0x1c7806['params']['id']},'include':[{'model':db[_0xf4cb('0x9c')],'as':_0xf4cb('0xb7'),'include':[{'model':db[_0xf4cb('0x86')],'as':_0xf4cb('0x9d'),'where':{'mobile':_0x5ee419},'limit':0x1,'order':[[_0xf4cb('0x8a'),_0xf4cb('0xb8')]]}]}]})['then'](handleEntityNotFound(_0xb4d596,null))[_0xf4cb('0x1e')](function(_0x43b274){if(_0x43b274&&_0x43b274[_0xf4cb('0xb7')]){_0xb171b6=_0x43b274[_0xf4cb('0x5c')]({'plain':!![]});if(_0xb171b6[_0xf4cb('0xb7')]&&_0xb171b6[_0xf4cb('0xb7')][_0xf4cb('0x9d')][_0xf4cb('0x46')]){return _0xb171b6[_0xf4cb('0xb7')][_0xf4cb('0x9d')][0x0];}return db['CmContact'][_0xf4cb('0x59')](_['defaults'](_0x1c7806[_0xf4cb('0x5a')],{'firstName':_0x5ee419,'mobile':_0x5ee419,'phone':_0x5ee419,'ListId':_0xb171b6['ListId']}));}})['then'](handleEntityNotFound(_0xb4d596,null))[_0xf4cb('0x1e')](function(_0x300087){if(_0x300087){_0x24d97a=_0x300087;return db[_0xf4cb('0x9f')][_0xf4cb('0x58')]({'where':{'ContactId':_0x24d97a['id'],'closed':![],'WhatsappAccountId':_0xb171b6['id']}})['then'](function(_0x46bf30){if(_0x46bf30){return[_0x46bf30,![]];}return db[_0xf4cb('0x9f')]['create']({'UserId':_0x1c7806[_0xf4cb('0x5b')]['id'],'ContactId':_0x24d97a['id'],'WhatsappAccountId':_0xb171b6['id'],'phone':_0x5ee419,'firstMsgDirection':'out','Messages':[_[_0xf4cb('0x4c')](_0x1c7806[_0xf4cb('0x5a')],{'read':![],'body':_0x1c7806['body'][_0xf4cb('0x5a')],'phone':_0x5ee419,'WhatsappAccountId':_0xb171b6['id'],'UserId':_0x1c7806[_0xf4cb('0x5b')]['id'],'ContactId':_0x24d97a['id']})]},{'include':[{'model':db[_0xf4cb('0xa6')],'as':_0xf4cb('0xb9')}]})[_0xf4cb('0x1e')](function(_0x49b6e9){return[_0x49b6e9,!![]];});});}})[_0xf4cb('0x71')](function(_0x1fa5d5,_0x3c6eaa){if(_0x3c6eaa){return _0x1fa5d5;}return db[_0xf4cb('0xa6')][_0xf4cb('0x59')](_[_0xf4cb('0x4c')](_0x1c7806[_0xf4cb('0x5a')],{'read':![],'body':_0x1c7806[_0xf4cb('0x5a')]['body'],'phone':_0x5ee419,'WhatsappAccountId':_0xb171b6['id'],'WhatsappInteractionId':_0x1fa5d5['id'],'UserId':_0x1c7806['user']['id'],'ContactId':_0x24d97a['id']}))[_0xf4cb('0x1e')](function(_0x5be823){_0x1fa5d5['dataValues'][_0xf4cb('0xb9')]=[];_0x1fa5d5[_0xf4cb('0xba')][_0xf4cb('0xb9')][_0xf4cb('0xbb')](_0x5be823[_0xf4cb('0xba')]);return _0x1fa5d5;});})['then'](respondWithResult(_0xb4d596,null))[_0xf4cb('0x28')](handleError(_0xb4d596,null));}; \ No newline at end of file +var _0xc17c=['hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','WhatsappAccount','includeAll','include','findAll','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','rawAttributes','order','rows','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','messageId','MessageSid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','push','applications','close','*,*,*,*','created','WhatsappMessage','ContactId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0xc17c,0x124));var _0xcc17=function(_0x1812bf,_0x35a68d){_0x1812bf=_0x1812bf-0x0;var _0x5f3c47=_0xc17c[_0x1812bf];return _0x5f3c47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc17('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc17('0x1'));var rp=require(_0xcc17('0x2'));var moment=require('moment');var BPromise=require(_0xcc17('0x3'));var Mustache=require(_0xcc17('0x4'));var util=require(_0xcc17('0x5'));var path=require(_0xcc17('0x6'));var sox=require(_0xcc17('0x7'));var csv=require('to-csv');var ejs=require(_0xcc17('0x8'));var fs=require('fs');var fs_extra=require(_0xcc17('0x9'));var _=require('lodash');var squel=require(_0xcc17('0xa'));var crypto=require(_0xcc17('0xb'));var jsforce=require(_0xcc17('0xc'));var deskjs=require(_0xcc17('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc17('0xe'));var Redis=require(_0xcc17('0xf'));var authService=require(_0xcc17('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcc17('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcc17('0x12'));var utils=require(_0xcc17('0x13'));var config=require(_0xcc17('0x14'));var licenseUtil=require(_0xcc17('0x15'));var db=require(_0xcc17('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcc17('0x17'),'port':0x18eb});var socket=require(_0xcc17('0x18'))(new Redis(config[_0xcc17('0x19')]));require(_0xcc17('0x1a'))[_0xcc17('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcc17('0x1c')][_0xcc17('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5490f9,_0x435e76,_0x1adc29,_0x570cdd){return new BPromise(function(_0x39e788,_0x219c80){var _0x220dd3=_0x570cdd||client;return _0x220dd3['request'](_0x5490f9,_0x1adc29)[_0xcc17('0x1e')](function(_0x24b39a){logger[_0xcc17('0x1f')](_0xcc17('0x20'),_0x435e76,_0xcc17('0x21'));logger[_0xcc17('0x22')](_0xcc17('0x23'),_0x435e76,_0xcc17('0x21'),JSON[_0xcc17('0x24')](_0x24b39a));if(_0x24b39a[_0xcc17('0x25')]){if(_0x24b39a['error'][_0xcc17('0x26')]===0x1f4){logger[_0xcc17('0x25')](_0xcc17('0x20'),_0x435e76,_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);return _0x219c80(_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);}logger[_0xcc17('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x435e76,_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);return _0x39e788(_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);}else{logger[_0xcc17('0x1f')](_0xcc17('0x20'),_0x435e76,'request\x20sent');_0x39e788(_0x24b39a[_0xcc17('0x28')][_0xcc17('0x27')]);}})[_0xcc17('0x29')](function(_0x2594d0){logger['error'](_0xcc17('0x20'),_0x435e76,_0x2594d0);_0x219c80(_0x2594d0);});});}function respondWithStatusCode(_0x2246e1,_0x5adc7d){_0x5adc7d=_0x5adc7d||0xcc;return function(_0x19190f){if(_0x19190f){return _0x2246e1[_0xcc17('0x2a')](_0x5adc7d);}return _0x2246e1[_0xcc17('0x2b')](_0x5adc7d)[_0xcc17('0x2c')]();};}function respondWithResult(_0x3f3a8e,_0x2c0b8d){_0x2c0b8d=_0x2c0b8d||0xc8;return function(_0x520951){if(_0x520951){return _0x3f3a8e['status'](_0x2c0b8d)[_0xcc17('0x2d')](_0x520951);}};}function respondWithFilteredResult(_0x1fd78c,_0x17b87c){return function(_0x49ddbf){if(_0x49ddbf){var _0x262f26=typeof _0x17b87c[_0xcc17('0x2e')]===_0xcc17('0x2f')&&typeof _0x17b87c['limit']==='undefined';var _0x5565ce=_0x49ddbf[_0xcc17('0x30')];var _0x9ca5d5=_0x262f26?0x0:_0x17b87c[_0xcc17('0x2e')];var _0x185d6c=_0x262f26?_0x49ddbf[_0xcc17('0x30')]:_0x17b87c[_0xcc17('0x2e')]+_0x17b87c[_0xcc17('0x31')];var _0x3bebcf;if(_0x185d6c>=_0x5565ce){_0x185d6c=_0x5565ce;_0x3bebcf=0xc8;}else{_0x3bebcf=0xce;}_0x1fd78c['status'](_0x3bebcf);return _0x1fd78c[_0xcc17('0x32')](_0xcc17('0x33'),_0x9ca5d5+'-'+_0x185d6c+'/'+_0x5565ce)[_0xcc17('0x2d')](_0x49ddbf);}return null;};}function patchUpdates(_0x464361){return function(_0x303049){try{jsonpatch[_0xcc17('0x34')](_0x303049,_0x464361,!![]);}catch(_0x43b6f0){return BPromise[_0xcc17('0x35')](_0x43b6f0);}return _0x303049['save']();};}function saveUpdates(_0x4e3067,_0x5bb4cb){return function(_0x22e8ec){if(_0x22e8ec){return _0x22e8ec[_0xcc17('0x36')](_0x4e3067)['then'](function(_0x2927de){return _0x2927de;});}return null;};}function removeEntity(_0x2c19b1,_0x3139d2){return function(_0x5def21){if(_0x5def21){return _0x5def21[_0xcc17('0x37')]()['then'](function(){var _0x4f2583=_0x5def21['get']({'plain':!![]});var _0x1795e0=_0xcc17('0x38');return db[_0xcc17('0x39')][_0xcc17('0x37')]({'where':{'type':_0x1795e0,'resourceId':_0x4f2583['id']}})['then'](function(){return _0x5def21;});})[_0xcc17('0x1e')](function(){_0x2c19b1[_0xcc17('0x2b')](0xcc)[_0xcc17('0x2c')]();});}};}function handleEntityNotFound(_0x58f394,_0x2d212b){return function(_0x1ab5c8){if(!_0x1ab5c8){_0x58f394[_0xcc17('0x2a')](0x194);}return _0x1ab5c8;};}function handleError(_0xede912,_0x316502){_0x316502=_0x316502||0x1f4;return function(_0x5bb5a7){logger[_0xcc17('0x25')](_0x5bb5a7[_0xcc17('0x3a')]);if(_0x5bb5a7['name']){delete _0x5bb5a7[_0xcc17('0x3b')];}_0xede912[_0xcc17('0x2b')](_0x316502)[_0xcc17('0x3c')](_0x5bb5a7);};}exports['index']=function(_0x597aa3,_0x5b3772){var _0x346569={'include':[{'model':db[_0xcc17('0x3d')],'as':_0xcc17('0x3e')}]},_0x18209c={},_0x3ef7a4={'count':0x0,'rows':[]};var _0x5dda08=_[_0xcc17('0x3f')](db['WhatsappAccount']['rawAttributes'],function(_0x4695f6){return{'name':_0x4695f6[_0xcc17('0x40')],'type':_0x4695f6['type'][_0xcc17('0x41')]};});_0x18209c['model']=_[_0xcc17('0x3f')](_0x5dda08,_0xcc17('0x3b'));_0x18209c[_0xcc17('0x42')]=_[_0xcc17('0x43')](_0x597aa3[_0xcc17('0x42')]);_0x18209c[_0xcc17('0x44')]=_['intersection'](_0x18209c[_0xcc17('0x45')],_0x18209c[_0xcc17('0x42')]);_0x346569['attributes']=_[_0xcc17('0x46')](_0x18209c['model'],qs[_0xcc17('0x47')](_0x597aa3[_0xcc17('0x42')]['fields']));_0x346569['attributes']=_0x346569[_0xcc17('0x48')][_0xcc17('0x49')]?_0x346569[_0xcc17('0x48')]:_0x18209c[_0xcc17('0x45')];if(!_0x597aa3['query'][_0xcc17('0x4a')]('nolimit')){_0x346569[_0xcc17('0x31')]=qs['limit'](_0x597aa3[_0xcc17('0x42')]['limit']);_0x346569['offset']=qs[_0xcc17('0x2e')](_0x597aa3[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x346569['order']=qs[_0xcc17('0x4b')](_0x597aa3['query'][_0xcc17('0x4b')]);_0x346569[_0xcc17('0x4c')]=qs['filters'](_[_0xcc17('0x4d')](_0x597aa3[_0xcc17('0x42')],_0x18209c[_0xcc17('0x44')]),_0x5dda08);if(_0x597aa3[_0xcc17('0x42')]['filter']){_0x346569[_0xcc17('0x4c')]=_[_0xcc17('0x4e')](_0x346569[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x5dda08,function(_0x475615){if(_0x475615[_0xcc17('0x4f')]!==_0xcc17('0x50')){var _0x40073c={};_0x40073c[_0x475615[_0xcc17('0x3b')]]={'$like':'%'+_0x597aa3[_0xcc17('0x42')][_0xcc17('0x51')]+'%'};return _0x40073c;}})});}_0x346569=_['merge']({},_0x346569,_0x597aa3[_0xcc17('0x52')]);var _0x3d10b5={'where':_0x346569[_0xcc17('0x4c')]};return db[_0xcc17('0x53')][_0xcc17('0x30')](_0x3d10b5)[_0xcc17('0x1e')](function(_0x47b377){_0x3ef7a4[_0xcc17('0x30')]=_0x47b377;if(_0x597aa3[_0xcc17('0x42')][_0xcc17('0x54')]){_0x346569[_0xcc17('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcc17('0x56')](_0x346569);})[_0xcc17('0x1e')](function(_0x573a63){_0x3ef7a4['rows']=_0x573a63;return _0x3ef7a4;})[_0xcc17('0x1e')](respondWithFilteredResult(_0x5b3772,_0x346569))['catch'](handleError(_0x5b3772,null));};exports[_0xcc17('0x57')]=function(_0x254744,_0x500144){var _0xb5cf64={'raw':![],'where':{'id':_0x254744[_0xcc17('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x426129={};_0x426129[_0xcc17('0x45')]=_[_0xcc17('0x43')](db[_0xcc17('0x53')]['rawAttributes']);_0x426129[_0xcc17('0x42')]=_[_0xcc17('0x43')](_0x254744[_0xcc17('0x42')]);_0x426129[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x426129[_0xcc17('0x45')],_0x426129[_0xcc17('0x42')]);_0xb5cf64['attributes']=_[_0xcc17('0x46')](_0x426129[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x254744[_0xcc17('0x42')][_0xcc17('0x47')]));_0xb5cf64['attributes']=_0xb5cf64[_0xcc17('0x48')]['length']?_0xb5cf64['attributes']:_0x426129[_0xcc17('0x45')];if(_0x254744['query'][_0xcc17('0x54')]){_0xb5cf64['include']=[{'all':!![]}];}_0xb5cf64=_[_0xcc17('0x4e')]({},_0xb5cf64,_0x254744[_0xcc17('0x52')]);return db[_0xcc17('0x53')]['find'](_0xb5cf64)['then'](handleEntityNotFound(_0x500144,null))['then'](respondWithResult(_0x500144,null))[_0xcc17('0x29')](handleError(_0x500144,null));};exports[_0xcc17('0x59')]=function(_0x2a1deb,_0x350354){return db[_0xcc17('0x53')][_0xcc17('0x59')](_0x2a1deb[_0xcc17('0x5a')],{})['then'](function(_0x925b84){var _0x1c0528=_0x2a1deb['user'][_0xcc17('0x5b')]({'plain':!![]});if(!_0x1c0528)throw new Error(_0xcc17('0x5c'));if(_0x1c0528['role']===_0xcc17('0x5d')){var _0x496d9a=_0x925b84[_0xcc17('0x5b')]({'plain':!![]});var _0x5312aa=_0xcc17('0x38');return db[_0xcc17('0x5e')][_0xcc17('0x5f')]({'where':{'name':_0x5312aa,'userProfileId':_0x1c0528['userProfileId']},'raw':!![]})[_0xcc17('0x1e')](function(_0x1ebd4c){if(_0x1ebd4c&&_0x1ebd4c[_0xcc17('0x60')]===0x0){return db[_0xcc17('0x39')]['create']({'name':_0x496d9a[_0xcc17('0x3b')],'resourceId':_0x496d9a['id'],'type':_0x1ebd4c[_0xcc17('0x3b')],'sectionId':_0x1ebd4c['id']},{})['then'](function(){return _0x925b84;});}else{return _0x925b84;}})[_0xcc17('0x29')](function(_0x24b9a0){logger[_0xcc17('0x25')](_0xcc17('0x61'),_0x24b9a0);throw _0x24b9a0;});}return _0x925b84;})['then'](respondWithResult(_0x350354,0xc9))['catch'](handleError(_0x350354,null));};exports[_0xcc17('0x36')]=function(_0x5e3aeb,_0x2988fc){if(_0x5e3aeb['body']['id']){delete _0x5e3aeb[_0xcc17('0x5a')]['id'];}return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x5e3aeb[_0xcc17('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcc17('0x1e')](handleEntityNotFound(_0x2988fc,null))[_0xcc17('0x1e')](saveUpdates(_0x5e3aeb['body'],null))[_0xcc17('0x1e')](respondWithResult(_0x2988fc,null))[_0xcc17('0x29')](handleError(_0x2988fc,null));};exports[_0xcc17('0x37')]=function(_0xf453b6,_0x3c758a){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0xf453b6[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c758a,null))['then'](removeEntity(_0x3c758a,null))[_0xcc17('0x29')](handleError(_0x3c758a,null));};exports['describe']=function(_0x284c01,_0x53f139){return db[_0xcc17('0x53')][_0xcc17('0x62')]()[_0xcc17('0x1e')](respondWithResult(_0x53f139,null))[_0xcc17('0x29')](handleError(_0x53f139,null));};exports[_0xcc17('0x63')]=function(_0x3f66ca,_0x26eea3,_0x467b38){if(_0x3f66ca[_0xcc17('0x5a')]['id']){delete _0x3f66ca[_0xcc17('0x5a')]['id'];}return db['WhatsappAccount'][_0xcc17('0x5f')]({'where':{'id':_0x3f66ca['params']['id']}})['then'](handleEntityNotFound(_0x26eea3,null))[_0xcc17('0x1e')](function(_0x1ae93a){if(_0x1ae93a){_0x3f66ca[_0xcc17('0x5a')][_0xcc17('0x64')]=_0x1ae93a['id'];return db['Disposition']['create'](_0x3f66ca[_0xcc17('0x5a')]);}})[_0xcc17('0x1e')](respondWithResult(_0x26eea3,null))[_0xcc17('0x29')](handleError(_0x26eea3,null));};exports[_0xcc17('0x65')]=function(_0x5200b2,_0xff8798,_0x5afe81){var _0x1fd44f={'raw':![],'where':{}};var _0x2dcf9f={};var _0x373b84={'count':0x0,'rows':[]};return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x5200b2[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0xff8798,null))[_0xcc17('0x1e')](function(_0x575c7b){if(_0x575c7b){_0x2dcf9f[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x67')][_0xcc17('0x68')]);_0x2dcf9f[_0xcc17('0x42')]=_['keys'](_0x5200b2[_0xcc17('0x42')]);_0x2dcf9f[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x2dcf9f[_0xcc17('0x45')],_0x2dcf9f[_0xcc17('0x42')]);_0x1fd44f['attributes']=_[_0xcc17('0x46')](_0x2dcf9f[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x5200b2[_0xcc17('0x42')]['fields']));_0x1fd44f[_0xcc17('0x48')]=_0x1fd44f[_0xcc17('0x48')][_0xcc17('0x49')]?_0x1fd44f['attributes']:_0x2dcf9f[_0xcc17('0x45')];if(!_0x5200b2['query'][_0xcc17('0x4a')]('nolimit')){_0x1fd44f['limit']=qs[_0xcc17('0x31')](_0x5200b2['query'][_0xcc17('0x31')]);_0x1fd44f[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x5200b2[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x1fd44f[_0xcc17('0x69')]=qs[_0xcc17('0x4b')](_0x5200b2[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x1fd44f[_0xcc17('0x4c')]=qs[_0xcc17('0x44')](_[_0xcc17('0x4d')](_0x5200b2['query'],_0x2dcf9f[_0xcc17('0x44')]));_0x1fd44f[_0xcc17('0x4c')][_0xcc17('0x64')]=_0x575c7b['id'];if(_0x5200b2[_0xcc17('0x42')]['filter']){_0x1fd44f[_0xcc17('0x4c')]=_['merge'](_0x1fd44f['where'],{'$or':_['map'](_0x1fd44f['attributes'],function(_0x4aad13){var _0x3210f6={};_0x3210f6[_0x4aad13]={'$like':'%'+_0x5200b2[_0xcc17('0x42')]['filter']+'%'};return _0x3210f6;})});}_0x1fd44f=_[_0xcc17('0x4e')]({},_0x1fd44f,_0x5200b2[_0xcc17('0x52')]);return db[_0xcc17('0x67')][_0xcc17('0x30')]({'where':_0x1fd44f[_0xcc17('0x4c')]})['then'](function(_0x2ce383){_0x373b84[_0xcc17('0x30')]=_0x2ce383;if(_0x5200b2[_0xcc17('0x42')]['includeAll']){_0x1fd44f[_0xcc17('0x55')]=[{'all':!![]}];}return db[_0xcc17('0x67')][_0xcc17('0x56')](_0x1fd44f);})[_0xcc17('0x1e')](function(_0x421e60){_0x373b84[_0xcc17('0x6a')]=_0x421e60;return _0x373b84;});}})[_0xcc17('0x1e')](respondWithFilteredResult(_0xff8798,_0x1fd44f))[_0xcc17('0x29')](handleError(_0xff8798,null));};exports['removeDispositions']=function(_0x5e44a1,_0x3eb715,_0x50caea){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x5e44a1[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x3eb715,null))[_0xcc17('0x1e')](function(_0x688b18){if(_0x688b18){return _0x688b18['removeDispositions'](_0x5e44a1['query'][_0xcc17('0x6b')]);}})[_0xcc17('0x1e')](respondWithStatusCode(_0x3eb715,null))['catch'](handleError(_0x3eb715,null));};exports[_0xcc17('0x6c')]=function(_0x563830,_0x4ba313,_0x23ccd9){if(_0x563830[_0xcc17('0x5a')]['id']){delete _0x563830['body']['id'];}return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x563830[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x4ba313,null))[_0xcc17('0x1e')](function(_0x54dab9){if(_0x54dab9){_0x563830[_0xcc17('0x5a')][_0xcc17('0x64')]=_0x54dab9['id'];return db['CannedAnswer'][_0xcc17('0x59')](_0x563830[_0xcc17('0x5a')]);}})[_0xcc17('0x1e')](respondWithResult(_0x4ba313,null))[_0xcc17('0x29')](handleError(_0x4ba313,null));};exports['getAnswers']=function(_0x333bff,_0x33f216,_0x50b921){var _0x1acfd3={'raw':![],'where':{}};var _0x497b03={};var _0x305814={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcc17('0x66')]({'where':{'id':_0x333bff['params']['id']}})['then'](handleEntityNotFound(_0x33f216,null))[_0xcc17('0x1e')](function(_0x139f0c){if(_0x139f0c){_0x497b03[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x6d')][_0xcc17('0x68')]);_0x497b03['query']=_['keys'](_0x333bff[_0xcc17('0x42')]);_0x497b03['filters']=_[_0xcc17('0x46')](_0x497b03[_0xcc17('0x45')],_0x497b03['query']);_0x1acfd3[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x497b03[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x333bff[_0xcc17('0x42')][_0xcc17('0x47')]));_0x1acfd3['attributes']=_0x1acfd3[_0xcc17('0x48')][_0xcc17('0x49')]?_0x1acfd3[_0xcc17('0x48')]:_0x497b03[_0xcc17('0x45')];if(!_0x333bff[_0xcc17('0x42')][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x1acfd3[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x333bff['query'][_0xcc17('0x31')]);_0x1acfd3[_0xcc17('0x2e')]=qs['offset'](_0x333bff[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x1acfd3['order']=qs[_0xcc17('0x4b')](_0x333bff[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x1acfd3['where']=qs[_0xcc17('0x44')](_[_0xcc17('0x4d')](_0x333bff[_0xcc17('0x42')],_0x497b03[_0xcc17('0x44')]));_0x1acfd3[_0xcc17('0x4c')][_0xcc17('0x64')]=_0x139f0c['id'];if(_0x333bff['query'][_0xcc17('0x51')]){_0x1acfd3['where']=_[_0xcc17('0x4e')](_0x1acfd3[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x1acfd3[_0xcc17('0x48')],function(_0x121a44){var _0x3a5931={};_0x3a5931[_0x121a44]={'$like':'%'+_0x333bff['query']['filter']+'%'};return _0x3a5931;})});}_0x1acfd3=_[_0xcc17('0x4e')]({},_0x1acfd3,_0x333bff[_0xcc17('0x52')]);return db['CannedAnswer'][_0xcc17('0x30')]({'where':_0x1acfd3['where']})[_0xcc17('0x1e')](function(_0x4e4bc2){_0x305814[_0xcc17('0x30')]=_0x4e4bc2;if(_0x333bff['query']['includeAll']){_0x1acfd3[_0xcc17('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcc17('0x56')](_0x1acfd3);})[_0xcc17('0x1e')](function(_0x2a79e1){_0x305814[_0xcc17('0x6a')]=_0x2a79e1;return _0x305814;});}})[_0xcc17('0x1e')](respondWithFilteredResult(_0x33f216,_0x1acfd3))[_0xcc17('0x29')](handleError(_0x33f216,null));};exports[_0xcc17('0x6f')]=function(_0x336b33,_0x354b1f,_0x4aa46c){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x336b33['params']['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x354b1f,null))['then'](function(_0x219cdc){if(_0x219cdc){return _0x219cdc[_0xcc17('0x6f')](_0x336b33[_0xcc17('0x42')][_0xcc17('0x6b')]);}})[_0xcc17('0x1e')](respondWithStatusCode(_0x354b1f,null))[_0xcc17('0x29')](handleError(_0x354b1f,null));};exports[_0xcc17('0x70')]=function(_0xdb191,_0x3d0bcb,_0x52705b){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0xdb191[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d0bcb,null))[_0xcc17('0x1e')](function(_0x5428cd){if(_0x5428cd){return _0x5428cd['addAgents'](_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')],_[_0xcc17('0x71')](_0xdb191['body'],[_0xcc17('0x6b'),'id'])||{})[_0xcc17('0x72')](function(_0x143c37){for(var _0x37961e=0x0;_0x37961e<_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')][_0xcc17('0x49')];_0x37961e+=0x1){socket[_0xcc17('0x73')](_0xcc17('0x74'),{'UserId':Number(_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')][_0x37961e]),'WhatsappAccountId':Number(_0xdb191[_0xcc17('0x58')]['id'])});}return _0x143c37;});}})['then'](respondWithResult(_0x3d0bcb,null))['catch'](handleError(_0x3d0bcb,null));};exports[_0xcc17('0x75')]=function(_0x40b41b,_0x3764a7,_0x13a500){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x40b41b[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x3764a7,null))[_0xcc17('0x1e')](function(_0xcbcaff){if(_0xcbcaff){return _0xcbcaff[_0xcc17('0x75')](_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')])[_0xcc17('0x1e')](function(){if(_[_0xcc17('0x76')](_0x40b41b['query'][_0xcc17('0x6b')])){for(var _0x1613ab=0x0;_0x1613ab<_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')]['length'];_0x1613ab+=0x1){socket[_0xcc17('0x73')](_0xcc17('0x77'),{'UserId':Number(_0x40b41b['query']['ids'][_0x1613ab]),'WhatsappAccountId':Number(_0x40b41b[_0xcc17('0x58')]['id'])});}}else{socket[_0xcc17('0x73')](_0xcc17('0x77'),{'UserId':Number(_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')]),'WhatsappAccountId':Number(_0x40b41b[_0xcc17('0x58')]['id'])});}});}})[_0xcc17('0x1e')](respondWithStatusCode(_0x3764a7,null))['catch'](handleError(_0x3764a7,null));};exports[_0xcc17('0x78')]=function(_0x19e993,_0x28b8b8,_0x488662){var _0x38997d={};var _0x52fcf5={};var _0x30f97a;var _0xadd686;return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x19e993['params']['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x28b8b8,null))[_0xcc17('0x1e')](function(_0x45fca2){if(_0x45fca2){_0x30f97a=_0x45fca2;_0x52fcf5[_0xcc17('0x45')]=_[_0xcc17('0x43')](db['User'][_0xcc17('0x68')]);_0x52fcf5[_0xcc17('0x42')]=_['keys'](_0x19e993[_0xcc17('0x42')]);_0x52fcf5[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x52fcf5['model'],_0x52fcf5[_0xcc17('0x42')]);_0x38997d[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x52fcf5[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x19e993[_0xcc17('0x42')][_0xcc17('0x47')]));_0x38997d[_0xcc17('0x48')]=_0x38997d[_0xcc17('0x48')]['length']?_0x38997d['attributes']:_0x52fcf5[_0xcc17('0x45')];_0x38997d[_0xcc17('0x69')]=qs[_0xcc17('0x4b')](_0x19e993['query'][_0xcc17('0x4b')]);_0x38997d['where']=qs['filters'](_[_0xcc17('0x4d')](_0x19e993['query'],_0x52fcf5['filters']));if(_0x19e993[_0xcc17('0x42')][_0xcc17('0x51')]){_0x38997d['where']=_[_0xcc17('0x4e')](_0x38997d[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x38997d['attributes'],function(_0x44a2e4){var _0x172f18={};_0x172f18[_0x44a2e4]={'$like':'%'+_0x19e993[_0xcc17('0x42')][_0xcc17('0x51')]+'%'};return _0x172f18;})});}_0x38997d=_[_0xcc17('0x4e')]({},_0x38997d,_0x19e993[_0xcc17('0x52')]);return _0x30f97a[_0xcc17('0x78')](_0x38997d);}})[_0xcc17('0x1e')](function(_0x46de24){if(_0x46de24){_0xadd686=_0x46de24[_0xcc17('0x49')];if(!_0x19e993['query'][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x38997d[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x19e993[_0xcc17('0x42')]['limit']);_0x38997d[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x19e993[_0xcc17('0x42')]['offset']);}return _0x30f97a[_0xcc17('0x78')](_0x38997d);}})[_0xcc17('0x1e')](function(_0x40dd7c){if(_0x40dd7c){return _0x40dd7c?{'count':_0xadd686,'rows':_0x40dd7c}:null;}})['then'](respondWithResult(_0x28b8b8,null))['catch'](handleError(_0x28b8b8,null));};exports['addApplications']=function(_0x2612ba,_0x335fc3,_0x3925ad){return db['WhatsappAccount'][_0xcc17('0x66')]({'where':{'id':_0x2612ba[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x335fc3,null))[_0xcc17('0x1e')](function(_0x1650e9){if(_0x1650e9){return db[_0xcc17('0x79')][_0xcc17('0x7a')](function(_0x109aba){return db[_0xcc17('0x7b')][_0xcc17('0x37')]({'where':{'WhatsappAccountId':_0x2612ba[_0xcc17('0x58')]['id']},'transaction':_0x109aba})[_0xcc17('0x1e')](function(_0x34e882){var _0x1d5bee=_[_0xcc17('0x3f')](_0x2612ba[_0xcc17('0x5a')],function(_0x2f6459){_0x2f6459[_0xcc17('0x64')]=_0x2612ba['params']['id'];return _0x2f6459;});return db[_0xcc17('0x7b')][_0xcc17('0x7c')](_0x1d5bee,{'transaction':_0x109aba});});})['then'](function(){return db['WhatsappApplication'][_0xcc17('0x7d')]({'where':{'WhatsappAccountId':_0x2612ba[_0xcc17('0x58')]['id']},'order':_0xcc17('0x7e')});});}})['then'](respondWithResult(_0x335fc3,null))[_0xcc17('0x29')](handleError(_0x335fc3,null));};exports[_0xcc17('0x7f')]=function(_0x1e185e,_0x3d64fa,_0x1f9f96){var _0x5b6ca3={};var _0x18ef0a={};var _0x5a56e0;var _0x14bac8;return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x1e185e[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d64fa,null))[_0xcc17('0x1e')](function(_0x4eb3af){if(_0x4eb3af){_0x5a56e0=_0x4eb3af;_0x18ef0a[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x7b')][_0xcc17('0x68')]);_0x18ef0a['query']=_[_0xcc17('0x43')](_0x1e185e[_0xcc17('0x42')]);_0x18ef0a[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x18ef0a['model'],_0x18ef0a[_0xcc17('0x42')]);_0x5b6ca3[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x18ef0a['model'],qs[_0xcc17('0x47')](_0x1e185e[_0xcc17('0x42')]['fields']));_0x5b6ca3[_0xcc17('0x48')]=_0x5b6ca3[_0xcc17('0x48')][_0xcc17('0x49')]?_0x5b6ca3[_0xcc17('0x48')]:_0x18ef0a[_0xcc17('0x45')];_0x5b6ca3['order']=qs[_0xcc17('0x4b')](_0x1e185e[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x5b6ca3[_0xcc17('0x4c')]=qs['filters'](_['pick'](_0x1e185e[_0xcc17('0x42')],_0x18ef0a[_0xcc17('0x44')]));if(_0x1e185e['query'][_0xcc17('0x51')]){_0x5b6ca3[_0xcc17('0x4c')]=_[_0xcc17('0x4e')](_0x5b6ca3[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x5b6ca3[_0xcc17('0x48')],function(_0x9320d9){var _0x3dc68d={};_0x3dc68d[_0x9320d9]={'$like':'%'+_0x1e185e[_0xcc17('0x42')]['filter']+'%'};return _0x3dc68d;})});}_0x5b6ca3=_['merge']({},_0x5b6ca3,_0x1e185e['options']);return _0x5a56e0[_0xcc17('0x7f')](_0x5b6ca3);}})[_0xcc17('0x1e')](function(_0x3b521e){if(_0x3b521e){_0x14bac8=_0x3b521e[_0xcc17('0x49')];if(!_0x1e185e[_0xcc17('0x42')][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x5b6ca3[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x1e185e['query']['limit']);_0x5b6ca3[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x1e185e['query'][_0xcc17('0x2e')]);}return _0x5a56e0[_0xcc17('0x7f')](_0x5b6ca3);}})[_0xcc17('0x1e')](function(_0x3e408a){if(_0x3e408a){return _0x3e408a?{'count':_0x14bac8,'rows':_0x3e408a}:null;}})['then'](respondWithResult(_0x3d64fa,null))[_0xcc17('0x29')](handleError(_0x3d64fa,null));};exports[_0xcc17('0x80')]=function(_0x29ac22,_0xedc31d,_0x496631){var _0x51011f={'channel':_0xcc17('0x81')};var _0x364de3=[];var _0x35fcb6=[];var _0x56deeb={};return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x29ac22[_0xcc17('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xcc17('0x82')}]})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))[_0xcc17('0x1e')](function(_0x3b52b7){_0x51011f[_0xcc17('0x83')]=_0x3b52b7;_0x51011f['applications']=_['orderBy'](_0x3b52b7[_0xcc17('0x82')],[_0xcc17('0x7e')],[_0xcc17('0x84')]);if(_0x51011f[_0xcc17('0x83')][_0xcc17('0x82')]){delete _0x51011f[_0xcc17('0x83')][_0xcc17('0x82')];}return db[_0xcc17('0x85')][_0xcc17('0x62')]();})['then'](function(_0x54d1a9){if(!_0x54d1a9){throw new db['Sequelize'][(_0xcc17('0x86'))](_0xcc17('0x87'));}_0x364de3=_[_0xcc17('0x88')](_['keys'](_0x54d1a9),['createdAt',_0xcc17('0x89')]);_0x35fcb6=_['difference'](_[_0xcc17('0x43')](_0x54d1a9),[_0xcc17('0x8a'),_0xcc17('0x89'),_0xcc17('0x8b'),_0xcc17('0x8c')]);_0x51011f[_0xcc17('0x5a')]={'mapKey':_0xcc17('0x8d')};if(_0x51011f[_0xcc17('0x83')]['type']&&_0x51011f['account'][_0xcc17('0x4f')]===_0xcc17('0x8e')){_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')]=_0x29ac22[_0xcc17('0x5a')][_0xcc17('0x90')]['replace'](_0xcc17('0x91'),'');_0x51011f['body'][_0xcc17('0x5a')]=_0x29ac22['body']['Body'];_0x51011f['body'][_0xcc17('0x92')]=_0x29ac22[_0xcc17('0x5a')][_0xcc17('0x93')];}if(_0x51011f[_0xcc17('0x5a')]['id']){delete _0x51011f[_0xcc17('0x5a')]['id'];}if(_[_0xcc17('0x94')](_0x51011f[_0xcc17('0x5a')]['from'])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))]('from\x20is\x20mandatory');}if(_[_0xcc17('0x94')](_0x51011f['body'][_0xcc17('0x5a')])||_0x51011f[_0xcc17('0x5a')]['body']===''){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0x96'));}if(_['isNil'](_0x51011f['body'][_0xcc17('0x97')])){throw new db['Sequelize']['ValidationError'](_0xcc17('0x98')+_0x35fcb6);}if(!_[_0xcc17('0x99')](_0x35fcb6,_0x51011f[_0xcc17('0x5a')][_0xcc17('0x97')])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35fcb6);}_0x56deeb[_0x51011f[_0xcc17('0x5a')][_0xcc17('0x97')]]=_0x51011f[_0xcc17('0x5a')]['from'];return db[_0xcc17('0x9a')][_0xcc17('0x5f')]({'where':{'id':_0x51011f['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0xcc17('0x9b'),'where':_0x56deeb,'limit':0x1,'order':[[_0xcc17('0x89'),_0xcc17('0x9c')]]}]});})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))['then'](function(_0x31c4ce){if(_0x31c4ce){_0x51011f[_0xcc17('0x9d')]=_[_0xcc17('0x71')](_0x31c4ce,[_0xcc17('0x9b')]);if(_0x31c4ce['Contacts']['length']){return _0x31c4ce['Contacts'][0x0];}var _0x51bd98=_[_0xcc17('0x9e')](_0x51011f['body'],{'firstName':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'ListId':_0x31c4ce['id']});_0x51bd98[_0x51011f[_0xcc17('0x5a')]['mapKey']]=_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')];return db[_0xcc17('0x85')][_0xcc17('0x59')](_0x51bd98,{'fields':_0x364de3,'raw':!![]});}})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))[_0xcc17('0x1e')](function(_0x9ebb64){if(_0x9ebb64){_0x51011f[_0xcc17('0x9f')]=_0x9ebb64;var _0x20e420={'ContactId':_0x9ebb64['id'],'phone':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'WhatsappAccountId':_0x29ac22[_0xcc17('0x58')]['id']};var _0x42fa84={'ContactId':_0x9ebb64['id'],'WhatsappAccountId':_0x29ac22[_0xcc17('0x58')]['id'],'closed':![]};return db[_0xcc17('0xa0')]['find']({'where':_0x42fa84})['then'](function(_0x1abb65){if(_0x1abb65){return[_0x1abb65,![]];}return db[_0xcc17('0xa0')][_0xcc17('0x59')](_0x20e420)[_0xcc17('0x1e')](function(_0xaafefe){return[_0xaafefe,!![]];});});}})['spread'](function(_0x594438,_0x100c42){_0x51011f[_0xcc17('0xa1')]=_0x594438['get']({'plain':!![]});_0x51011f['interaction']['created']=![];if(_0x100c42){if(_0x51011f['account']['autoclose']){_0x51011f['applications'][_0xcc17('0xa2')]({'id':0x0,'priority':_0x51011f[_0xcc17('0xa3')][_0xcc17('0x49')]+0x1,'app':_0xcc17('0xa4'),'appdata':'unmanaged','interval':_0xcc17('0xa5')});}_0x51011f['interaction'][_0xcc17('0xa6')]=!![];}return db[_0xcc17('0xa7')][_0xcc17('0x59')]({'phone':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'messageId':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x92')],'body':_0x51011f['body'][_0xcc17('0x5a')],'WhatsappAccountId':_0x29ac22['params']['id'],'WhatsappInteractionId':_0x594438['id'],'direction':'in','ContactId':_0x594438[_0xcc17('0xa8')],'AttachmentId':_0x51011f[_0xcc17('0x5a')]['AttachmentId']});})[_0xcc17('0x1e')](function(_0x4297e1){_0x51011f['message']=_0x4297e1;if(_0x51011f[_0xcc17('0xa1')]['UserId']){return db[_0xcc17('0xa9')][_0xcc17('0x5f')]({'attributes':['id',_0xcc17('0x3b')],'where':{'id':_0x51011f['interaction']['UserId']}})[_0xcc17('0x1e')](function(_0x5c62a6){if(_0x5c62a6){_0x51011f[_0xcc17('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcc17('0xaa'),'appdata':_0x5c62a6[_0xcc17('0x3b')]+','+(_0x51011f[_0xcc17('0x83')][_0xcc17('0xab')]||0xa),'interval':_0xcc17('0xa5')});}return respondWithRpcPromise(_0xcc17('0xac'),_0xcc17('0xad'),_0x51011f);});}return respondWithRpcPromise(_0xcc17('0xac'),_0xcc17('0xad'),_0x51011f);})[_0xcc17('0x1e')](function(_0x42b794){if(_0x42b794){var _0x40fbcf=0xc8;var _0xadc61d=_0xcc17('0xae');logger[_0xcc17('0x1f')](_0xcc17('0x23'),_0xadc61d,_0x40fbcf,_0xcc17('0xaf'));logger[_0xcc17('0x22')](_0xcc17('0xb0'),_0xadc61d,_0x40fbcf,'entity\x20found',JSON[_0xcc17('0x24')](_0x42b794));if(_0x51011f[_0xcc17('0x83')][_0xcc17('0x4f')]===_0xcc17('0x8e')){return _0xedc31d[_0xcc17('0x2b')](_0x40fbcf)['set'](_0xcc17('0xb1'),'text/xml')[_0xcc17('0x3c')]('\x0a');}else{return _0xedc31d[_0xcc17('0x2b')](_0x40fbcf)[_0xcc17('0x2d')](_0x42b794);}}})[_0xcc17('0x29')](handleError(_0xedc31d,null));};exports[_0xcc17('0x3c')]=function(_0x3f992c,_0x375386,_0x9c5e52){var _0x13f12a,_0x576eb8,_0x480788;if(_[_0xcc17('0x94')](_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')])||_0x3f992c[_0xcc17('0x5a')]['body']===''){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0x96'));}if(_[_0xcc17('0x94')](_0x3f992c[_0xcc17('0x5a')]['to'])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0xb2'));}_0x13f12a=_0x3f992c[_0xcc17('0x5a')]['to'];return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x3f992c[_0xcc17('0x58')]['id']},'include':[{'model':db[_0xcc17('0x9a')],'as':_0xcc17('0xb3'),'include':[{'model':db['CmContact'],'as':_0xcc17('0x9b'),'where':{'mobile':_0x13f12a},'limit':0x1,'order':[[_0xcc17('0x89'),_0xcc17('0x9c')]]}]}]})[_0xcc17('0x1e')](handleEntityNotFound(_0x375386,null))[_0xcc17('0x1e')](function(_0x476edc){if(_0x476edc&&_0x476edc[_0xcc17('0xb3')]){_0x576eb8=_0x476edc[_0xcc17('0x5b')]({'plain':!![]});if(_0x576eb8[_0xcc17('0xb3')]&&_0x576eb8[_0xcc17('0xb3')][_0xcc17('0x9b')]['length']){return _0x576eb8['List'][_0xcc17('0x9b')][0x0];}return db[_0xcc17('0x85')][_0xcc17('0x59')](_[_0xcc17('0x9e')](_0x3f992c['body'],{'firstName':_0x13f12a,'mobile':_0x13f12a,'phone':_0x13f12a,'ListId':_0x576eb8[_0xcc17('0x8c')]}));}})[_0xcc17('0x1e')](handleEntityNotFound(_0x375386,null))['then'](function(_0x578ed6){if(_0x578ed6){_0x480788=_0x578ed6;return db[_0xcc17('0xa0')][_0xcc17('0x5f')]({'where':{'ContactId':_0x480788['id'],'closed':![],'WhatsappAccountId':_0x576eb8['id']}})[_0xcc17('0x1e')](function(_0xaad719){if(_0xaad719){return[_0xaad719,![]];}return db[_0xcc17('0xa0')][_0xcc17('0x59')]({'UserId':_0x3f992c[_0xcc17('0x5d')]['id'],'ContactId':_0x480788['id'],'WhatsappAccountId':_0x576eb8['id'],'phone':_0x13f12a,'firstMsgDirection':_0xcc17('0xb4'),'Messages':[_[_0xcc17('0x4e')](_0x3f992c[_0xcc17('0x5a')],{'read':![],'body':_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')],'phone':_0x13f12a,'WhatsappAccountId':_0x576eb8['id'],'UserId':_0x3f992c[_0xcc17('0x5d')]['id'],'ContactId':_0x480788['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xcc17('0xb5')}]})[_0xcc17('0x1e')](function(_0x5870d3){return[_0x5870d3,!![]];});});}})[_0xcc17('0x72')](function(_0x484d85,_0x807906){if(_0x807906){return _0x484d85;}return db[_0xcc17('0xa7')][_0xcc17('0x59')](_[_0xcc17('0x4e')](_0x3f992c['body'],{'read':![],'body':_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')],'phone':_0x13f12a,'WhatsappAccountId':_0x576eb8['id'],'WhatsappInteractionId':_0x484d85['id'],'UserId':_0x3f992c['user']['id'],'ContactId':_0x480788['id']}))[_0xcc17('0x1e')](function(_0x3ce94f){_0x484d85['dataValues'][_0xcc17('0xb5')]=[];_0x484d85['dataValues'][_0xcc17('0xb5')][_0xcc17('0xa2')](_0x3ce94f[_0xcc17('0xb6')]);return _0x484d85;});})['then'](respondWithResult(_0x375386,null))[_0xcc17('0x29')](handleError(_0x375386,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6cb9491..5c39db3 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 _0x8ab7=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount'];(function(_0xa7e190,_0x4760e8){var _0x171af6=function(_0x4073ed){while(--_0x4073ed){_0xa7e190['push'](_0xa7e190['shift']());}};_0x171af6(++_0x4760e8);}(_0x8ab7,0x76));var _0x78ab=function(_0x31b658,_0x549eb0){_0x31b658=_0x31b658-0x0;var _0x2a4eee=_0x8ab7[_0x31b658];return _0x2a4eee;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x78ab('0x0'))['db'][_0x78ab('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x78ab('0x2'),'afterUpdate':'update','afterDestroy':_0x78ab('0x3')};function emitEvent(_0x81f802){return function(_0x1cad8a,_0xc110b4,_0x55ff80){WhatsappAccountEvents[_0x78ab('0x4')](_0x81f802+':'+_0x1cad8a['id'],_0x1cad8a);WhatsappAccountEvents['emit'](_0x81f802,_0x1cad8a);_0x55ff80(null);};}for(var e in events){if(events[_0x78ab('0x5')](e)){var event=events[e];WhatsappAccount[_0x78ab('0x6')](e,emitEvent(event));}}module[_0x78ab('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x04e0=['setMaxListeners','update','emit','hook','events','../../mysqldb','WhatsappAccount'];(function(_0x137520,_0x4ab4b0){var _0x5d1adb=function(_0x31988e){while(--_0x31988e){_0x137520['push'](_0x137520['shift']());}};_0x5d1adb(++_0x4ab4b0);}(_0x04e0,0x1e7));var _0x004e=function(_0x8e4c02,_0x24c0ac){_0x8e4c02=_0x8e4c02-0x0;var _0x410c6f=_0x04e0[_0x8e4c02];return _0x410c6f;};'use strict';var EventEmitter=require(_0x004e('0x0'));var WhatsappAccount=require(_0x004e('0x1'))['db'][_0x004e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x004e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x004e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e36c2){return function(_0x2cca8c,_0x46bb85,_0x1d334b){WhatsappAccountEvents[_0x004e('0x5')](_0x5e36c2+':'+_0x2cca8c['id'],_0x2cca8c);WhatsappAccountEvents['emit'](_0x5e36c2,_0x2cca8c);_0x1d334b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x004e('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index aff1dbc..051dccc 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 _0x2412=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2412,0x1a3));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2241('0x0'));var util=require(_0x2241('0x1'));var logger=require(_0x2241('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2241('0x3'));var rp=require(_0x2241('0x4'));var fs=require('fs');var path=require(_0x2241('0x5'));var rimraf=require('rimraf');var config=require(_0x2241('0x6'));var attributes=require(_0x2241('0x7'));module[_0x2241('0x8')]=function(_0x2aad7b,_0x11be57){return _0x2aad7b[_0x2241('0x9')](_0x2241('0xa'),attributes,{'tableName':_0x2241('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c8f=['../../config/environment','exports','define','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3294b8,_0x25b32d){var _0x164391=function(_0x4e65eb){while(--_0x4e65eb){_0x3294b8['push'](_0x3294b8['shift']());}};_0x164391(++_0x25b32d);}(_0x7c8f,0xae));var _0xf7c8=function(_0x4f58eb,_0x334778){_0x4f58eb=_0x4f58eb-0x0;var _0x11a1d1=_0x7c8f[_0x4f58eb];return _0x11a1d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf7c8('0x0'))(_0xf7c8('0x1'));var moment=require(_0xf7c8('0x2'));var BPromise=require(_0xf7c8('0x3'));var rp=require(_0xf7c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7c8('0x5'));var config=require(_0xf7c8('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xf7c8('0x7')]=function(_0x3d776f,_0x11905a){return _0x3d776f[_0xf7c8('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 67ec7bb..2e1adcb 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 _0x228d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./whatsappAccount.socket','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x228d,0x87));var _0xd228=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x228d[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var moment=require(_0xd228('0x2'));var BPromise=require(_0xd228('0x3'));var rs=require(_0xd228('0x4'));var fs=require('fs');var Redis=require(_0xd228('0x5'));var db=require(_0xd228('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd228('0x7'))(_0xd228('0x8'));var config=require('../../config/environment');var jayson=require(_0xd228('0x9'));var client=jayson['client'][_0xd228('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd228('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd228('0xc'))(new Redis(config['redis']));require(_0xd228('0xd'))['register'](socket);function respondWithRpcPromise(_0x5625ae,_0x57a7fe,_0xb14295){return new BPromise(function(_0x3602b2,_0x34612a){return client['request'](_0x5625ae,_0xb14295)['then'](function(_0x256d87){logger[_0xd228('0xe')](_0xd228('0xf'),_0x57a7fe,_0xd228('0x10'));logger[_0xd228('0x11')](_0xd228('0x12'),_0x57a7fe,_0xd228('0x10'),JSON[_0xd228('0x13')](_0x256d87));if(_0x256d87[_0xd228('0x14')]){if(_0x256d87[_0xd228('0x14')][_0xd228('0x15')]===0x1f4){logger[_0xd228('0x14')](_0xd228('0xf'),_0x57a7fe,_0x256d87[_0xd228('0x14')][_0xd228('0x16')]);return _0x34612a(_0x256d87[_0xd228('0x14')][_0xd228('0x16')]);}logger['error'](_0xd228('0xf'),_0x57a7fe,_0x256d87[_0xd228('0x14')][_0xd228('0x16')]);return _0x3602b2(_0x256d87[_0xd228('0x14')][_0xd228('0x16')]);}else{logger[_0xd228('0xe')](_0xd228('0xf'),_0x57a7fe,_0xd228('0x10'));_0x3602b2(_0x256d87[_0xd228('0x17')]['message']);}})[_0xd228('0x18')](function(_0xd46a4c){logger['error'](_0xd228('0xf'),_0x57a7fe,_0xd46a4c);_0x34612a(_0xd46a4c);});});}exports[_0xd228('0x19')]=function(_0x196026){var _0x47e910=this;return new Promise(function(_0x46181e,_0x1ed766){return db['WhatsappAccount'][_0xd228('0x1a')]({'raw':_0x196026['options']?_0x196026[_0xd228('0x1b')][_0xd228('0x1c')]===undefined?!![]:![]:!![],'where':_0x196026[_0xd228('0x1b')]?_0x196026[_0xd228('0x1b')][_0xd228('0x1d')]||null:null,'attributes':_0x196026[_0xd228('0x1b')]?_0x196026[_0xd228('0x1b')][_0xd228('0x1e')]||null:null,'include':_0x196026['options']?_0x196026[_0xd228('0x1b')][_0xd228('0x1f')]?_[_0xd228('0x20')](_0x196026[_0xd228('0x1b')]['include'],function(_0x52754f){return{'model':db[_0x52754f['model']],'as':_0x52754f['as'],'attributes':_0x52754f[_0xd228('0x1e')],'include':_0x52754f['include']?_['map'](_0x52754f['include'],function(_0x4da2ef){return{'model':db[_0x4da2ef[_0xd228('0x21')]],'as':_0x4da2ef['as'],'attributes':_0x4da2ef[_0xd228('0x1e')],'include':_0x4da2ef[_0xd228('0x1f')]?_[_0xd228('0x20')](_0x4da2ef[_0xd228('0x1f')],function(_0x62a558){return{'model':db[_0x62a558[_0xd228('0x21')]],'as':_0x62a558['as'],'attributes':_0x62a558[_0xd228('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11cbae){logger[_0xd228('0xe')](_0xd228('0x19'),_0x196026);logger[_0xd228('0x11')](_0xd228('0x19'),_0x196026,JSON[_0xd228('0x13')](_0x11cbae));_0x46181e(_0x11cbae);})[_0xd228('0x18')](function(_0x117388){logger[_0xd228('0x14')](_0xd228('0x19'),_0x117388['message'],_0x196026);_0x1ed766(_0x47e910[_0xd228('0x14')](0x1f4,_0x117388[_0xd228('0x16')]));});});}; \ No newline at end of file +var _0x1ab3=['stringify','error','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0xdcc10a,_0x3687b9){var _0x2afd5b=function(_0x576319){while(--_0x576319){_0xdcc10a['push'](_0xdcc10a['shift']());}};_0x2afd5b(++_0x3687b9);}(_0x1ab3,0x8e));var _0x31ab=function(_0x37d61c,_0x42b68b){_0x37d61c=_0x37d61c-0x0;var _0x303976=_0x1ab3[_0x37d61c];return _0x303976;};'use strict';var _=require(_0x31ab('0x0'));var util=require(_0x31ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31ab('0x2'));var db=require(_0x31ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x31ab('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31ab('0x5'));var client=jayson[_0x31ab('0x6')][_0x31ab('0x7')]({'port':0x232a});config['redis']=_[_0x31ab('0x8')](config[_0x31ab('0x9')],{'host':_0x31ab('0xa'),'port':0x18eb});var socket=require(_0x31ab('0xb'))(new Redis(config[_0x31ab('0x9')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x5179bf,_0x5a45f3,_0x1ab414){return new BPromise(function(_0x2488d4,_0x1399b0){return client[_0x31ab('0xc')](_0x5179bf,_0x1ab414)[_0x31ab('0xd')](function(_0x2c1796){logger['info'](_0x31ab('0xe'),_0x5a45f3,_0x31ab('0xf'));logger[_0x31ab('0x10')](_0x31ab('0x11'),_0x5a45f3,'request\x20sent',JSON[_0x31ab('0x12')](_0x2c1796));if(_0x2c1796[_0x31ab('0x13')]){if(_0x2c1796[_0x31ab('0x13')]['code']===0x1f4){logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x2c1796['error']['message']);return _0x1399b0(_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);}logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);return _0x2488d4(_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);}else{logger[_0x31ab('0x15')](_0x31ab('0xe'),_0x5a45f3,'request\x20sent');_0x2488d4(_0x2c1796['result'][_0x31ab('0x14')]);}})[_0x31ab('0x16')](function(_0x1d9a0f){logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x1d9a0f);_0x1399b0(_0x1d9a0f);});});}exports[_0x31ab('0x17')]=function(_0x561a5e){var _0x13936b=this;return new Promise(function(_0x23ea91,_0x53a57e){return db[_0x31ab('0x18')][_0x31ab('0x19')]({'raw':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1b')]||null:null,'attributes':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1c')]||null:null,'include':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1d')]?_['map'](_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1d')],function(_0x26afb1){return{'model':db[_0x26afb1[_0x31ab('0x1e')]],'as':_0x26afb1['as'],'attributes':_0x26afb1[_0x31ab('0x1c')],'include':_0x26afb1[_0x31ab('0x1d')]?_['map'](_0x26afb1[_0x31ab('0x1d')],function(_0x4cf9e8){return{'model':db[_0x4cf9e8['model']],'as':_0x4cf9e8['as'],'attributes':_0x4cf9e8['attributes'],'include':_0x4cf9e8[_0x31ab('0x1d')]?_[_0x31ab('0x1f')](_0x4cf9e8[_0x31ab('0x1d')],function(_0x4583f9){return{'model':db[_0x4583f9[_0x31ab('0x1e')]],'as':_0x4583f9['as'],'attributes':_0x4583f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x31ab('0xd')](function(_0x437241){logger[_0x31ab('0x15')](_0x31ab('0x17'),_0x561a5e);logger['debug'](_0x31ab('0x17'),_0x561a5e,JSON['stringify'](_0x437241));_0x23ea91(_0x437241);})['catch'](function(_0x3135b4){logger[_0x31ab('0x13')]('ShowWhatsappAccount',_0x3135b4[_0x31ab('0x14')],_0x561a5e);_0x53a57e(_0x13936b['error'](0x1f4,_0x3135b4[_0x31ab('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 092c00a..4d6558e 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 _0xa095=['remove','emit','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x296ca5,_0x207490){var _0x377f87=function(_0x430630){while(--_0x430630){_0x296ca5['push'](_0x296ca5['shift']());}};_0x377f87(++_0x207490);}(_0xa095,0xf3));var _0x5a09=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0xa095[_0x26a10d];return _0xf90201;};'use strict';var WhatsappAccountEvents=require(_0x5a09('0x0'));var events=[_0x5a09('0x1'),_0x5a09('0x2'),'update'];function createListener(_0x43c9ad,_0x89200e){return function(_0x14e579){_0x89200e[_0x5a09('0x3')](_0x43c9ad,_0x14e579);};}function removeListener(_0x3946e9,_0xdd0bef){return function(){WhatsappAccountEvents['removeListener'](_0x3946e9,_0xdd0bef);};}exports[_0x5a09('0x4')]=function(_0x37e9e8){for(var _0x9a7cb3=0x0,_0x5dcfaa=events[_0x5a09('0x5')];_0x9a7cb3<_0x5dcfaa;_0x9a7cb3++){var _0x12bcba=events[_0x9a7cb3];var _0x501883=createListener(_0x5a09('0x6')+_0x12bcba,_0x37e9e8);WhatsappAccountEvents['on'](_0x12bcba,_0x501883);}}; \ No newline at end of file +var _0xbdf0=['length','whatsappAccount:','./whatsappAccount.events','save','emit','register'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0xbdf0,0x188));var _0x0bdf=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0xbdf0[_0x4cd4e4];return _0x18cf3b;};'use strict';var WhatsappAccountEvents=require(_0x0bdf('0x0'));var events=[_0x0bdf('0x1'),'remove','update'];function createListener(_0x3e9014,_0x44735b){return function(_0x437c83){_0x44735b[_0x0bdf('0x2')](_0x3e9014,_0x437c83);};}function removeListener(_0x3816a3,_0x356269){return function(){WhatsappAccountEvents['removeListener'](_0x3816a3,_0x356269);};}exports[_0x0bdf('0x3')]=function(_0x63f54d){for(var _0x271477=0x0,_0x438db0=events[_0x0bdf('0x4')];_0x271477<_0x438db0;_0x271477++){var _0x26843b=events[_0x271477];var _0x117184=createListener(_0x0bdf('0x5')+_0x26843b,_0x63f54d);WhatsappAccountEvents['on'](_0x26843b,_0x117184);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 03792a3..d829c9f 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 _0xa232=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','post','put','isAuthenticated','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xd836a9,_0x2658bf){var _0x1f9d4d=function(_0xeada1e){while(--_0xeada1e){_0xd836a9['push'](_0xd836a9['shift']());}};_0x1f9d4d(++_0x2658bf);}(_0xa232,0xdb));var _0x2a23=function(_0x4da5d1,_0x128317){_0x4da5d1=_0x4da5d1-0x0;var _0xc613a1=_0xa232[_0x4da5d1];return _0xc613a1;};'use strict';var multer=require(_0x2a23('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a23('0x1'));var express=require(_0x2a23('0x2'));var router=express['Router']();var fs_extra=require(_0x2a23('0x3'));var auth=require(_0x2a23('0x4'));var interaction=require(_0x2a23('0x5'));var config=require(_0x2a23('0x6'));var controller=require(_0x2a23('0x7'));router[_0x2a23('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a23('0x9')]);router[_0x2a23('0x8')](_0x2a23('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2a23('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2a23('0xc')](_0x2a23('0xa'),auth[_0x2a23('0xd')](),controller[_0x2a23('0xe')]);router['delete'](_0x2a23('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a23('0xf')]=router; \ No newline at end of file +var _0xd150=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0x22e38e,_0x22b160){var _0x247042=function(_0x3451a9){while(--_0x3451a9){_0x22e38e['push'](_0x22e38e['shift']());}};_0x247042(++_0x22b160);}(_0xd150,0x1a3));var _0x0d15=function(_0x118d59,_0x3fbf95){_0x118d59=_0x118d59-0x0;var _0x5ee7e1=_0xd150[_0x118d59];return _0x5ee7e1;};'use strict';var multer=require(_0x0d15('0x0'));var util=require('util');var path=require(_0x0d15('0x1'));var timeout=require(_0x0d15('0x2'));var express=require(_0x0d15('0x3'));var router=express[_0x0d15('0x4')]();var fs_extra=require(_0x0d15('0x5'));var auth=require(_0x0d15('0x6'));var interaction=require(_0x0d15('0x7'));var config=require(_0x0d15('0x8'));var controller=require(_0x0d15('0x9'));router[_0x0d15('0xa')]('/',auth[_0x0d15('0xb')](),controller[_0x0d15('0xc')]);router['get'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0xe')]);router[_0x0d15('0xf')]('/',auth[_0x0d15('0xb')](),controller['create']);router['put'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0x10')]);router['delete'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0x11')]);module[_0x0d15('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 29c6124..e91b109 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 _0x1a55=['sequelize','STRING','noop','*,*,*,*'];(function(_0x20dd9b,_0x3c0fb8){var _0x2de3b0=function(_0x5673d2){while(--_0x5673d2){_0x20dd9b['push'](_0x20dd9b['shift']());}};_0x2de3b0(++_0x3c0fb8);}(_0x1a55,0x1bc));var _0x51a5=function(_0x4b712c,_0x13c9f2){_0x4b712c=_0x4b712c-0x0;var _0x304110=_0x1a55[_0x4b712c];return _0x304110;};'use strict';var Sequelize=require(_0x51a5('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x51a5('0x1')],'allowNull':![],'defaultValue':_0x51a5('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x51a5('0x1')],'defaultValue':_0x51a5('0x3')}}; \ No newline at end of file +var _0x132a=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5173d1,_0x424b63){var _0x11b350=function(_0x56c629){while(--_0x56c629){_0x5173d1['push'](_0x5173d1['shift']());}};_0x11b350(++_0x424b63);}(_0x132a,0xe7));var _0xa132=function(_0x4334ee,_0x80633){_0x4334ee=_0x4334ee-0x0;var _0x3496ec=_0x132a[_0x4334ee];return _0x3496ec;};'use strict';var Sequelize=require('sequelize');module[_0xa132('0x0')]={'priority':{'type':Sequelize[_0xa132('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa132('0x2')],'allowNull':![],'defaultValue':_0xa132('0x3')},'appdata':{'type':Sequelize[_0xa132('0x4')]()},'description':{'type':Sequelize[_0xa132('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa132('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 82987e1..69aa846 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 _0x3af5=['name','send','index','WhatsappApplication','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack'];(function(_0x3fc01e,_0x11b861){var _0xed9e53=function(_0xc74f40){while(--_0xc74f40){_0x3fc01e['push'](_0x3fc01e['shift']());}};_0xed9e53(++_0x11b861);}(_0x3af5,0x1d3));var _0x53af=function(_0x290a56,_0x5c540a){_0x290a56=_0x290a56-0x0;var _0x89610=_0x3af5[_0x290a56];return _0x89610;};'use strict';var emlformat=require(_0x53af('0x0'));var rimraf=require(_0x53af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53af('0x2'));var rp=require(_0x53af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x53af('0x4'));var util=require('util');var path=require('path');var sox=require(_0x53af('0x5'));var csv=require(_0x53af('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53af('0x7'));var _=require('lodash');var squel=require(_0x53af('0x8'));var crypto=require(_0x53af('0x9'));var jsforce=require(_0x53af('0xa'));var deskjs=require(_0x53af('0xb'));var toCsv=require(_0x53af('0x6'));var querystring=require(_0x53af('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53af('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x53af('0xe'));var hardwareService=require(_0x53af('0xf'));var logger=require('../../config/logger')(_0x53af('0x10'));var utils=require(_0x53af('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x53af('0x12'));var db=require(_0x53af('0x13'))['db'];function respondWithStatusCode(_0x3366ea,_0x59285f){_0x59285f=_0x59285f||0xcc;return function(_0x25a7c9){if(_0x25a7c9){return _0x3366ea['sendStatus'](_0x59285f);}return _0x3366ea[_0x53af('0x14')](_0x59285f)[_0x53af('0x15')]();};}function respondWithResult(_0xee9b56,_0xe7cf2){_0xe7cf2=_0xe7cf2||0xc8;return function(_0x1dea0a){if(_0x1dea0a){return _0xee9b56[_0x53af('0x14')](_0xe7cf2)[_0x53af('0x16')](_0x1dea0a);}};}function respondWithFilteredResult(_0x1c8479,_0x1ee76f){return function(_0x3978f9){if(_0x3978f9){var _0x4d601a=typeof _0x1ee76f[_0x53af('0x17')]===_0x53af('0x18')&&typeof _0x1ee76f[_0x53af('0x19')]===_0x53af('0x18');var _0x1d2747=_0x3978f9[_0x53af('0x1a')];var _0x3fb005=_0x4d601a?0x0:_0x1ee76f['offset'];var _0x207f25=_0x4d601a?_0x3978f9[_0x53af('0x1a')]:_0x1ee76f[_0x53af('0x17')]+_0x1ee76f[_0x53af('0x19')];var _0x568d52;if(_0x207f25>=_0x1d2747){_0x207f25=_0x1d2747;_0x568d52=0xc8;}else{_0x568d52=0xce;}_0x1c8479['status'](_0x568d52);return _0x1c8479[_0x53af('0x1b')](_0x53af('0x1c'),_0x3fb005+'-'+_0x207f25+'/'+_0x1d2747)[_0x53af('0x16')](_0x3978f9);}return null;};}function patchUpdates(_0x5a31d6){return function(_0x28e1fb){try{jsonpatch[_0x53af('0x1d')](_0x28e1fb,_0x5a31d6,!![]);}catch(_0x46d0d5){return BPromise[_0x53af('0x1e')](_0x46d0d5);}return _0x28e1fb[_0x53af('0x1f')]();};}function saveUpdates(_0x217426,_0x222d73){return function(_0x3d04c9){if(_0x3d04c9){return _0x3d04c9['update'](_0x217426)[_0x53af('0x20')](function(_0x26e701){return _0x26e701;});}return null;};}function removeEntity(_0x4fea36,_0x3e164e){return function(_0x363646){if(_0x363646){return _0x363646[_0x53af('0x21')]()['then'](function(){_0x4fea36[_0x53af('0x14')](0xcc)[_0x53af('0x15')]();});}};}function handleEntityNotFound(_0x26a0cf,_0x2b232c){return function(_0x480665){if(!_0x480665){_0x26a0cf[_0x53af('0x22')](0x194);}return _0x480665;};}function handleError(_0x17d47d,_0x25b2cd){_0x25b2cd=_0x25b2cd||0x1f4;return function(_0x530e3c){logger[_0x53af('0x23')](_0x530e3c[_0x53af('0x24')]);if(_0x530e3c[_0x53af('0x25')]){delete _0x530e3c[_0x53af('0x25')];}_0x17d47d['status'](_0x25b2cd)[_0x53af('0x26')](_0x530e3c);};}exports[_0x53af('0x27')]=function(_0xc9b0df,_0x2c27ba){var _0x2820df={},_0x264d0d={},_0x154cc2={'count':0x0,'rows':[]};var _0x584a53=_['map'](db[_0x53af('0x28')]['rawAttributes'],function(_0x308819){return{'name':_0x308819[_0x53af('0x29')],'type':_0x308819[_0x53af('0x2a')][_0x53af('0x2b')]};});_0x264d0d['model']=_[_0x53af('0x2c')](_0x584a53,_0x53af('0x25'));_0x264d0d['query']=_['keys'](_0xc9b0df[_0x53af('0x2d')]);_0x264d0d[_0x53af('0x2e')]=_[_0x53af('0x2f')](_0x264d0d[_0x53af('0x30')],_0x264d0d['query']);_0x2820df['attributes']=_[_0x53af('0x2f')](_0x264d0d[_0x53af('0x30')],qs[_0x53af('0x31')](_0xc9b0df['query']['fields']));_0x2820df[_0x53af('0x32')]=_0x2820df[_0x53af('0x32')][_0x53af('0x33')]?_0x2820df[_0x53af('0x32')]:_0x264d0d[_0x53af('0x30')];if(!_0xc9b0df[_0x53af('0x2d')][_0x53af('0x34')]('nolimit')){_0x2820df[_0x53af('0x19')]=qs[_0x53af('0x19')](_0xc9b0df['query'][_0x53af('0x19')]);_0x2820df[_0x53af('0x17')]=qs[_0x53af('0x17')](_0xc9b0df[_0x53af('0x2d')][_0x53af('0x17')]);}_0x2820df['order']=qs[_0x53af('0x35')](_0xc9b0df['query'][_0x53af('0x35')]);_0x2820df[_0x53af('0x36')]=qs[_0x53af('0x2e')](_[_0x53af('0x37')](_0xc9b0df[_0x53af('0x2d')],_0x264d0d['filters']),_0x584a53);if(_0xc9b0df['query']['filter']){_0x2820df[_0x53af('0x36')]=_['merge'](_0x2820df['where'],{'$or':_['map'](_0x584a53,function(_0x17f024){if(_0x17f024[_0x53af('0x2a')]!==_0x53af('0x38')){var _0x78817a={};_0x78817a[_0x17f024[_0x53af('0x25')]]={'$like':'%'+_0xc9b0df[_0x53af('0x2d')][_0x53af('0x39')]+'%'};return _0x78817a;}})});}_0x2820df=_[_0x53af('0x3a')]({},_0x2820df,_0xc9b0df[_0x53af('0x3b')]);var _0x5906a3={'where':_0x2820df[_0x53af('0x36')]};return db[_0x53af('0x28')][_0x53af('0x1a')](_0x5906a3)[_0x53af('0x20')](function(_0x409c75){_0x154cc2[_0x53af('0x1a')]=_0x409c75;if(_0xc9b0df['query'][_0x53af('0x3c')]){_0x2820df[_0x53af('0x3d')]=[{'all':!![]}];}return db[_0x53af('0x28')][_0x53af('0x3e')](_0x2820df);})['then'](function(_0x12fbf6){_0x154cc2[_0x53af('0x3f')]=_0x12fbf6;return _0x154cc2;})[_0x53af('0x20')](respondWithFilteredResult(_0x2c27ba,_0x2820df))[_0x53af('0x40')](handleError(_0x2c27ba,null));};exports[_0x53af('0x41')]=function(_0x5d1b82,_0x274e72){var _0x3490ff={'raw':!![],'where':{'id':_0x5d1b82[_0x53af('0x42')]['id']}},_0x46e4d9={};_0x46e4d9[_0x53af('0x30')]=_[_0x53af('0x43')](db[_0x53af('0x28')]['rawAttributes']);_0x46e4d9[_0x53af('0x2d')]=_[_0x53af('0x43')](_0x5d1b82[_0x53af('0x2d')]);_0x46e4d9['filters']=_[_0x53af('0x2f')](_0x46e4d9['model'],_0x46e4d9[_0x53af('0x2d')]);_0x3490ff[_0x53af('0x32')]=_[_0x53af('0x2f')](_0x46e4d9[_0x53af('0x30')],qs[_0x53af('0x31')](_0x5d1b82[_0x53af('0x2d')][_0x53af('0x31')]));_0x3490ff['attributes']=_0x3490ff[_0x53af('0x32')][_0x53af('0x33')]?_0x3490ff[_0x53af('0x32')]:_0x46e4d9[_0x53af('0x30')];if(_0x5d1b82[_0x53af('0x2d')][_0x53af('0x3c')]){_0x3490ff[_0x53af('0x3d')]=[{'all':!![]}];}_0x3490ff=_[_0x53af('0x3a')]({},_0x3490ff,_0x5d1b82[_0x53af('0x3b')]);return db['WhatsappApplication']['find'](_0x3490ff)[_0x53af('0x20')](handleEntityNotFound(_0x274e72,null))[_0x53af('0x20')](respondWithResult(_0x274e72,null))['catch'](handleError(_0x274e72,null));};exports['create']=function(_0x651bfe,_0x27c961){return db[_0x53af('0x28')][_0x53af('0x44')](_0x651bfe[_0x53af('0x45')],{})[_0x53af('0x20')](respondWithResult(_0x27c961,0xc9))['catch'](handleError(_0x27c961,null));};exports[_0x53af('0x46')]=function(_0x2f3adb,_0x4586aa){if(_0x2f3adb[_0x53af('0x45')]['id']){delete _0x2f3adb[_0x53af('0x45')]['id'];}return db[_0x53af('0x28')][_0x53af('0x47')]({'where':{'id':_0x2f3adb[_0x53af('0x42')]['id']}})['then'](handleEntityNotFound(_0x4586aa,null))['then'](saveUpdates(_0x2f3adb[_0x53af('0x45')],null))['then'](respondWithResult(_0x4586aa,null))[_0x53af('0x40')](handleError(_0x4586aa,null));};exports[_0x53af('0x21')]=function(_0x3f3483,_0x452e9d){return db[_0x53af('0x28')][_0x53af('0x47')]({'where':{'id':_0x3f3483[_0x53af('0x42')]['id']}})['then'](handleEntityNotFound(_0x452e9d,null))['then'](removeEntity(_0x452e9d,null))['catch'](handleError(_0x452e9d,null));}; \ No newline at end of file +var _0xbd9e=['status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','findAll','rows','catch','length','includeAll','include','find','create','body','params','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5be43e,_0x5341e1){var _0x300aef=function(_0x5ef3c6){while(--_0x5ef3c6){_0x5be43e['push'](_0x5be43e['shift']());}};_0x300aef(++_0x5341e1);}(_0xbd9e,0x108));var _0xebd9=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xbd9e[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebd9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebd9('0x1'));var moment=require(_0xebd9('0x2'));var BPromise=require(_0xebd9('0x3'));var Mustache=require(_0xebd9('0x4'));var util=require(_0xebd9('0x5'));var path=require('path');var sox=require(_0xebd9('0x6'));var csv=require('to-csv');var ejs=require(_0xebd9('0x7'));var fs=require('fs');var fs_extra=require(_0xebd9('0x8'));var _=require(_0xebd9('0x9'));var squel=require(_0xebd9('0xa'));var crypto=require(_0xebd9('0xb'));var jsforce=require(_0xebd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xebd9('0xd'));var querystring=require(_0xebd9('0xe'));var Papa=require(_0xebd9('0xf'));var Redis=require(_0xebd9('0x10'));var authService=require(_0xebd9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebd9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebd9('0x13'))('api');var utils=require(_0xebd9('0x14'));var config=require(_0xebd9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebd9('0x16'))['db'];function respondWithStatusCode(_0x11b8ed,_0x4b1c92){_0x4b1c92=_0x4b1c92||0xcc;return function(_0xd5a048){if(_0xd5a048){return _0x11b8ed[_0xebd9('0x17')](_0x4b1c92);}return _0x11b8ed[_0xebd9('0x18')](_0x4b1c92)[_0xebd9('0x19')]();};}function respondWithResult(_0x5cf3f7,_0x324363){_0x324363=_0x324363||0xc8;return function(_0xdfe08e){if(_0xdfe08e){return _0x5cf3f7[_0xebd9('0x18')](_0x324363)[_0xebd9('0x1a')](_0xdfe08e);}};}function respondWithFilteredResult(_0x1f5dd1,_0x237d00){return function(_0x29fde8){if(_0x29fde8){var _0x35095e=typeof _0x237d00[_0xebd9('0x1b')]===_0xebd9('0x1c')&&typeof _0x237d00[_0xebd9('0x1d')]===_0xebd9('0x1c');var _0x296341=_0x29fde8[_0xebd9('0x1e')];var _0x4d04cb=_0x35095e?0x0:_0x237d00[_0xebd9('0x1b')];var _0x8310f2=_0x35095e?_0x29fde8[_0xebd9('0x1e')]:_0x237d00['offset']+_0x237d00[_0xebd9('0x1d')];var _0x58086a;if(_0x8310f2>=_0x296341){_0x8310f2=_0x296341;_0x58086a=0xc8;}else{_0x58086a=0xce;}_0x1f5dd1[_0xebd9('0x18')](_0x58086a);return _0x1f5dd1[_0xebd9('0x1f')]('Content-Range',_0x4d04cb+'-'+_0x8310f2+'/'+_0x296341)['json'](_0x29fde8);}return null;};}function patchUpdates(_0x5701cd){return function(_0x23b478){try{jsonpatch[_0xebd9('0x20')](_0x23b478,_0x5701cd,!![]);}catch(_0x36bc37){return BPromise['reject'](_0x36bc37);}return _0x23b478[_0xebd9('0x21')]();};}function saveUpdates(_0x44fa41,_0x3fb488){return function(_0x2c17c8){if(_0x2c17c8){return _0x2c17c8[_0xebd9('0x22')](_0x44fa41)[_0xebd9('0x23')](function(_0x5ec121){return _0x5ec121;});}return null;};}function removeEntity(_0x1a3895,_0x259d17){return function(_0x588091){if(_0x588091){return _0x588091['destroy']()[_0xebd9('0x23')](function(){_0x1a3895[_0xebd9('0x18')](0xcc)[_0xebd9('0x19')]();});}};}function handleEntityNotFound(_0x1f2bbb,_0x4b54d7){return function(_0x1ac789){if(!_0x1ac789){_0x1f2bbb[_0xebd9('0x17')](0x194);}return _0x1ac789;};}function handleError(_0x2ef023,_0x1d2330){_0x1d2330=_0x1d2330||0x1f4;return function(_0x5548ae){logger[_0xebd9('0x24')](_0x5548ae['stack']);if(_0x5548ae['name']){delete _0x5548ae[_0xebd9('0x25')];}_0x2ef023[_0xebd9('0x18')](_0x1d2330)[_0xebd9('0x26')](_0x5548ae);};}exports[_0xebd9('0x27')]=function(_0x472601,_0x576834){var _0x5310a8={},_0x4e12bf={},_0x222d94={'count':0x0,'rows':[]};var _0x278edb=_[_0xebd9('0x28')](db[_0xebd9('0x29')][_0xebd9('0x2a')],function(_0xf17a69){return{'name':_0xf17a69[_0xebd9('0x2b')],'type':_0xf17a69[_0xebd9('0x2c')][_0xebd9('0x2d')]};});_0x4e12bf[_0xebd9('0x2e')]=_[_0xebd9('0x28')](_0x278edb,_0xebd9('0x25'));_0x4e12bf['query']=_[_0xebd9('0x2f')](_0x472601['query']);_0x4e12bf[_0xebd9('0x30')]=_[_0xebd9('0x31')](_0x4e12bf['model'],_0x4e12bf['query']);_0x5310a8[_0xebd9('0x32')]=_[_0xebd9('0x31')](_0x4e12bf[_0xebd9('0x2e')],qs[_0xebd9('0x33')](_0x472601[_0xebd9('0x34')][_0xebd9('0x33')]));_0x5310a8[_0xebd9('0x32')]=_0x5310a8[_0xebd9('0x32')]['length']?_0x5310a8[_0xebd9('0x32')]:_0x4e12bf[_0xebd9('0x2e')];if(!_0x472601[_0xebd9('0x34')][_0xebd9('0x35')](_0xebd9('0x36'))){_0x5310a8[_0xebd9('0x1d')]=qs[_0xebd9('0x1d')](_0x472601[_0xebd9('0x34')][_0xebd9('0x1d')]);_0x5310a8['offset']=qs[_0xebd9('0x1b')](_0x472601['query'][_0xebd9('0x1b')]);}_0x5310a8[_0xebd9('0x37')]=qs[_0xebd9('0x38')](_0x472601[_0xebd9('0x34')]['sort']);_0x5310a8[_0xebd9('0x39')]=qs[_0xebd9('0x30')](_['pick'](_0x472601[_0xebd9('0x34')],_0x4e12bf[_0xebd9('0x30')]),_0x278edb);if(_0x472601[_0xebd9('0x34')]['filter']){_0x5310a8[_0xebd9('0x39')]=_['merge'](_0x5310a8[_0xebd9('0x39')],{'$or':_[_0xebd9('0x28')](_0x278edb,function(_0x4f0eb0){if(_0x4f0eb0[_0xebd9('0x2c')]!==_0xebd9('0x3a')){var _0x115e7c={};_0x115e7c[_0x4f0eb0['name']]={'$like':'%'+_0x472601[_0xebd9('0x34')]['filter']+'%'};return _0x115e7c;}})});}_0x5310a8=_[_0xebd9('0x3b')]({},_0x5310a8,_0x472601[_0xebd9('0x3c')]);var _0x2c4f60={'where':_0x5310a8[_0xebd9('0x39')]};return db[_0xebd9('0x29')][_0xebd9('0x1e')](_0x2c4f60)[_0xebd9('0x23')](function(_0x57d0a0){_0x222d94[_0xebd9('0x1e')]=_0x57d0a0;if(_0x472601[_0xebd9('0x34')]['includeAll']){_0x5310a8['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xebd9('0x3d')](_0x5310a8);})[_0xebd9('0x23')](function(_0x1be720){_0x222d94[_0xebd9('0x3e')]=_0x1be720;return _0x222d94;})[_0xebd9('0x23')](respondWithFilteredResult(_0x576834,_0x5310a8))[_0xebd9('0x3f')](handleError(_0x576834,null));};exports['show']=function(_0x3f9f3d,_0x56ba3b){var _0x33ef42={'raw':!![],'where':{'id':_0x3f9f3d['params']['id']}},_0x1f0fcc={};_0x1f0fcc['model']=_['keys'](db[_0xebd9('0x29')][_0xebd9('0x2a')]);_0x1f0fcc[_0xebd9('0x34')]=_[_0xebd9('0x2f')](_0x3f9f3d[_0xebd9('0x34')]);_0x1f0fcc[_0xebd9('0x30')]=_[_0xebd9('0x31')](_0x1f0fcc[_0xebd9('0x2e')],_0x1f0fcc['query']);_0x33ef42[_0xebd9('0x32')]=_['intersection'](_0x1f0fcc[_0xebd9('0x2e')],qs[_0xebd9('0x33')](_0x3f9f3d[_0xebd9('0x34')]['fields']));_0x33ef42[_0xebd9('0x32')]=_0x33ef42[_0xebd9('0x32')][_0xebd9('0x40')]?_0x33ef42['attributes']:_0x1f0fcc[_0xebd9('0x2e')];if(_0x3f9f3d[_0xebd9('0x34')][_0xebd9('0x41')]){_0x33ef42[_0xebd9('0x42')]=[{'all':!![]}];}_0x33ef42=_[_0xebd9('0x3b')]({},_0x33ef42,_0x3f9f3d[_0xebd9('0x3c')]);return db[_0xebd9('0x29')][_0xebd9('0x43')](_0x33ef42)['then'](handleEntityNotFound(_0x56ba3b,null))[_0xebd9('0x23')](respondWithResult(_0x56ba3b,null))['catch'](handleError(_0x56ba3b,null));};exports[_0xebd9('0x44')]=function(_0x4bcc0d,_0xdcae7c){return db[_0xebd9('0x29')][_0xebd9('0x44')](_0x4bcc0d[_0xebd9('0x45')],{})[_0xebd9('0x23')](respondWithResult(_0xdcae7c,0xc9))[_0xebd9('0x3f')](handleError(_0xdcae7c,null));};exports['update']=function(_0x1d2fed,_0x59df76){if(_0x1d2fed[_0xebd9('0x45')]['id']){delete _0x1d2fed[_0xebd9('0x45')]['id'];}return db[_0xebd9('0x29')][_0xebd9('0x43')]({'where':{'id':_0x1d2fed[_0xebd9('0x46')]['id']}})[_0xebd9('0x23')](handleEntityNotFound(_0x59df76,null))[_0xebd9('0x23')](saveUpdates(_0x1d2fed[_0xebd9('0x45')],null))[_0xebd9('0x23')](respondWithResult(_0x59df76,null))[_0xebd9('0x3f')](handleError(_0x59df76,null));};exports[_0xebd9('0x47')]=function(_0x13ade2,_0xe6821f){return db[_0xebd9('0x29')]['find']({'where':{'id':_0x13ade2['params']['id']}})[_0xebd9('0x23')](handleEntityNotFound(_0xe6821f,null))['then'](removeEntity(_0xe6821f,null))[_0xebd9('0x3f')](handleError(_0xe6821f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1f2a9a9..1929878 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 _0xf2cb=['bluebird','path','rimraf','exports','define','whatsapp_applications','utf8mb4_unicode_ci','util','api'];(function(_0xe7ef95,_0x315861){var _0x379c6b=function(_0x10d985){while(--_0x10d985){_0xe7ef95['push'](_0xe7ef95['shift']());}};_0x379c6b(++_0x315861);}(_0xf2cb,0x130));var _0xbf2c=function(_0x5af002,_0x562cef){_0x5af002=_0x5af002-0x0;var _0xc91699=_0xf2cb[_0x5af002];return _0xc91699;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var logger=require('../../config/logger')(_0xbf2c('0x1'));var moment=require('moment');var BPromise=require(_0xbf2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf2c('0x3'));var rimraf=require(_0xbf2c('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0xbf2c('0x5')]=function(_0x46d282,_0x1fc371){return _0x46d282[_0xbf2c('0x6')]('WhatsappApplication',attributes,{'tableName':_0xbf2c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbf2c('0x8')});}; \ No newline at end of file +var _0x6ff1=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications'];(function(_0x3a03be,_0x597b9a){var _0xd572b8=function(_0xdd1ff9){while(--_0xdd1ff9){_0x3a03be['push'](_0x3a03be['shift']());}};_0xd572b8(++_0x597b9a);}(_0x6ff1,0x10a));var _0x16ff=function(_0xf696b4,_0x531efb){_0xf696b4=_0xf696b4-0x0;var _0x1bb8bb=_0x6ff1[_0xf696b4];return _0x1bb8bb;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var logger=require(_0x16ff('0x2'))(_0x16ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x16ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16ff('0x5'));var config=require(_0x16ff('0x6'));var attributes=require(_0x16ff('0x7'));module[_0x16ff('0x8')]=function(_0x5325dd,_0x4f3752){return _0x5325dd['define']('WhatsappApplication',attributes,{'tableName':_0x16ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x16ff('0xa'),'collate':_0x16ff('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index fdfa524..1ff471b 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x40a535,_0x15b587){var _0x39329e=function(_0x31cb6c){while(--_0x31cb6c){_0x40a535['push'](_0x40a535['shift']());}};_0x39329e(++_0x15b587);}(_0x4c4e,0x152));var _0xe4c4=function(_0x25ad5b,_0x3ad255){_0x25ad5b=_0x25ad5b-0x0;var _0x5afec7=_0x4c4e[_0x25ad5b];return _0x5afec7;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2a27de,_0x4aaa18){var _0x4335d=function(_0xc8eb38){while(--_0xc8eb38){_0x2a27de['push'](_0x2a27de['shift']());}};_0x4335d(++_0x4aaa18);}(_0x2d17,0x17e));var _0x72d1=function(_0x900b20,_0x16116c){_0x900b20=_0x900b20-0x0;var _0x2a4b54=_0x2d17[_0x900b20];return _0x2a4b54;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e71d22d..2787092 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 _0xaa37=['describe','show','/:id/messages','getMessages','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated'];(function(_0x4d603f,_0xbe5814){var _0x3a279a=function(_0x4d4d68){while(--_0x4d4d68){_0x4d603f['push'](_0x4d603f['shift']());}};_0x3a279a(++_0xbe5814);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xaa37[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/describe',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0xa')](_0x7aa3('0xf'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x10')]);router['get']('/:id/download',auth[_0x7aa3('0xc')](),controller['download']);router[_0x7aa3('0x11')]('/',auth[_0x7aa3('0xc')](),controller['create']);router[_0x7aa3('0x11')](_0x7aa3('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x7aa3('0x12'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')](_0x7aa3('0x14'),_0x7aa3('0x15')),controller['addTags']);router[_0x7aa3('0x16')](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')]('whatsapp','whatsappinteraction:update'),controller[_0x7aa3('0x18')]);router['delete'](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction['tracked'](_0x7aa3('0x14'),_0x7aa3('0x19')),controller[_0x7aa3('0x1a')]);router[_0x7aa3('0x1b')](_0x7aa3('0x12'),auth['isAuthenticated'](),controller[_0x7aa3('0x1c')]);module[_0x7aa3('0x1d')]=router; \ No newline at end of file +var _0x4074=['destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0x928d7d,_0x27b172){var _0xb1d98=function(_0x383abb){while(--_0x383abb){_0x928d7d['push'](_0x928d7d['shift']());}};_0xb1d98(++_0x27b172);}(_0x4074,0xf0));var _0x4407=function(_0x1bec4a,_0x565187){_0x1bec4a=_0x1bec4a-0x0;var _0x570270=_0x4074[_0x1bec4a];return _0x570270;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xa')](_0x4407('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4407('0x10'),auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);router[_0x4407('0xa')](_0x4407('0x12'),auth[_0x4407('0xb')](),controller[_0x4407('0x13')]);router[_0x4407('0x14')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0x15')]);router[_0x4407('0x14')]('/:id/messages',auth[_0x4407('0xb')](),controller[_0x4407('0x16')]);router['post'](_0x4407('0x17'),auth['isAuthenticated'](),interaction[_0x4407('0x18')](_0x4407('0x19'),_0x4407('0x1a')),controller[_0x4407('0x1b')]);router[_0x4407('0x1c')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction[_0x4407('0x18')]('whatsapp',_0x4407('0x1d')),controller[_0x4407('0x1e')]);router[_0x4407('0x1f')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction['tracked'](_0x4407('0x19'),'whatsappinteraction:destroy'),controller[_0x4407('0x20')]);router[_0x4407('0x1f')](_0x4407('0x17'),auth[_0x4407('0xb')](),controller[_0x4407('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 80f6655..1eb30e0 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 _0x6c65=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x21475f,_0x30aae3){var _0x178b57=function(_0x5c5c37){while(--_0x5c5c37){_0x21475f['push'](_0x21475f['shift']());}};_0x178b57(++_0x30aae3);}(_0x6c65,0x78));var _0x56c6=function(_0x396310,_0x2e2c0a){_0x396310=_0x396310-0x0;var _0x3dfd1e=_0x6c65[_0x396310];return _0x3dfd1e;};'use strict';var Sequelize=require(_0x56c6('0x0'));var moment=require(_0x56c6('0x1'));module[_0x56c6('0x2')]={'closed':{'type':Sequelize[_0x56c6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x56c6('0x4')]},'disposition':{'type':Sequelize[_0x56c6('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x56c6('0x5')]},'note':{'type':Sequelize[_0x56c6('0x5')]},'phone':{'type':Sequelize[_0x56c6('0x5')]},'read1stAt':{'type':Sequelize[_0x56c6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x56c6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x56c6('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x56c6('0x6')]('in',_0x56c6('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x56c6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0960=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x8e6083,_0x10131e){var _0x434191=function(_0x9436fd){while(--_0x9436fd){_0x8e6083['push'](_0x8e6083['shift']());}};_0x434191(++_0x10131e);}(_0x0960,0xc2));var _0x0096=function(_0x4976de,_0xc4566b){_0x4976de=_0x4976de-0x0;var _0x4422c4=_0x0960[_0x4976de];return _0x4422c4;};'use strict';var Sequelize=require(_0x0096('0x0'));var moment=require(_0x0096('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0096('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0096('0x3')]},'disposition':{'type':Sequelize[_0x0096('0x4')]},'secondDisposition':{'type':Sequelize[_0x0096('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0096('0x4')]},'note':{'type':Sequelize[_0x0096('0x4')]},'phone':{'type':Sequelize[_0x0096('0x4')]},'read1stAt':{'type':Sequelize[_0x0096('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0096('0x5')]('in',_0x0096('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0096('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0096('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 16dfaaa..dbab906 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 _0xf6c6=['i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','System','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','UserId','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve'];(function(_0x22aca1,_0x50228b){var _0x49b0df=function(_0x2675e0){while(--_0x2675e0){_0x22aca1['push'](_0x22aca1['shift']());}};_0x49b0df(++_0x50228b);}(_0xf6c6,0x154));var _0x6f6c=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xf6c6[_0x36ed3c];return _0x52a2e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f6c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f6c('0x1'));var rp=require(_0x6f6c('0x2'));var moment=require(_0x6f6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f6c('0x4'));var util=require(_0x6f6c('0x5'));var path=require(_0x6f6c('0x6'));var sox=require('sox');var csv=require(_0x6f6c('0x7'));var ejs=require(_0x6f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x6f6c('0x9'));var _=require(_0x6f6c('0xa'));var squel=require(_0x6f6c('0xb'));var crypto=require(_0x6f6c('0xc'));var jsforce=require(_0x6f6c('0xd'));var deskjs=require(_0x6f6c('0xe'));var toCsv=require(_0x6f6c('0x7'));var querystring=require(_0x6f6c('0xf'));var Papa=require(_0x6f6c('0x10'));var Redis=require(_0x6f6c('0x11'));var authService=require(_0x6f6c('0x12'));var qs=require(_0x6f6c('0x13'));var as=require(_0x6f6c('0x14'));var pdf=require(_0x6f6c('0x15'));var hardwareService=require(_0x6f6c('0x16'));var logger=require(_0x6f6c('0x17'))('api');var utils=require(_0x6f6c('0x18'));var config=require(_0x6f6c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f6c('0x1a'))['db'];config[_0x6f6c('0x1b')]=_['defaults'](config['redis'],{'host':_0x6f6c('0x1c'),'port':0x18eb});var socket=require(_0x6f6c('0x1d'))(new Redis(config[_0x6f6c('0x1b')]));require(_0x6f6c('0x1e'))['register'](socket);function respondWithStatusCode(_0x56e278,_0x16f49e){_0x16f49e=_0x16f49e||0xcc;return function(_0x357dbd){if(_0x357dbd){return _0x56e278[_0x6f6c('0x1f')](_0x16f49e);}return _0x56e278[_0x6f6c('0x20')](_0x16f49e)[_0x6f6c('0x21')]();};}function respondWithResult(_0x105525,_0x2fb74d){_0x2fb74d=_0x2fb74d||0xc8;return function(_0x282b7f){if(_0x282b7f){return _0x105525[_0x6f6c('0x20')](_0x2fb74d)[_0x6f6c('0x22')](_0x282b7f);}};}function respondWithFilteredResult(_0xca6404,_0x57da4e){return function(_0x2d7a4b){if(_0x2d7a4b){var _0x427db3=typeof _0x57da4e['offset']===_0x6f6c('0x23')&&typeof _0x57da4e[_0x6f6c('0x24')]===_0x6f6c('0x23');var _0x251b93=_0x2d7a4b[_0x6f6c('0x25')];var _0x3d98cc=_0x427db3?0x0:_0x57da4e['offset'];var _0x56f536=_0x427db3?_0x2d7a4b[_0x6f6c('0x25')]:_0x57da4e[_0x6f6c('0x26')]+_0x57da4e[_0x6f6c('0x24')];var _0x306f9c;if(_0x56f536>=_0x251b93){_0x56f536=_0x251b93;_0x306f9c=0xc8;}else{_0x306f9c=0xce;}_0xca6404[_0x6f6c('0x20')](_0x306f9c);return _0xca6404[_0x6f6c('0x27')](_0x6f6c('0x28'),_0x3d98cc+'-'+_0x56f536+'/'+_0x251b93)['json'](_0x2d7a4b);}return null;};}function patchUpdates(_0x277821){return function(_0x2f7f14){try{jsonpatch[_0x6f6c('0x29')](_0x2f7f14,_0x277821,!![]);}catch(_0x4e8ce5){return BPromise[_0x6f6c('0x2a')](_0x4e8ce5);}return _0x2f7f14['save']();};}function saveUpdates(_0x4e9258,_0x3828d3){return function(_0x2a1ebe){if(_0x2a1ebe){return _0x2a1ebe[_0x6f6c('0x2b')](_0x4e9258)[_0x6f6c('0x2c')](function(_0x25863f){return _0x25863f;});}return null;};}function removeEntity(_0x5c0adf,_0x4bbf82){return function(_0x3aefbf){if(_0x3aefbf){return _0x3aefbf[_0x6f6c('0x2d')]()[_0x6f6c('0x2c')](function(){_0x5c0adf[_0x6f6c('0x20')](0xcc)[_0x6f6c('0x21')]();});}};}function handleEntityNotFound(_0x348328,_0x2c344f){return function(_0x22ef30){if(!_0x22ef30){_0x348328['sendStatus'](0x194);}return _0x22ef30;};}function handleError(_0x117955,_0x26c6a1){_0x26c6a1=_0x26c6a1||0x1f4;return function(_0x81501d){logger[_0x6f6c('0x2e')](_0x81501d['stack']);if(_0x81501d[_0x6f6c('0x2f')]){delete _0x81501d[_0x6f6c('0x2f')];}_0x117955[_0x6f6c('0x20')](_0x26c6a1)[_0x6f6c('0x30')](_0x81501d);};}function getInteractionUsers(_0x1b34e8,_0xca0504){return new BPromise(function(_0x61795c,_0x490548){try{if(_0xca0504[_0x1b34e8['id']]){_0x1b34e8['Users']=_[_0x6f6c('0x31')](_0xca0504[_0x1b34e8['id']],function(_0x4abfa0){return{'id':_0x4abfa0['id'],'fullname':_0x4abfa0[_0x6f6c('0x32')]};});}}catch(_0x1cc3bd){_0x490548(_0x1cc3bd);}_0x61795c(_0x1b34e8);});}function getInteractionTags(_0x52733a,_0x3e0da6){return new BPromise(function(_0x3c2b41,_0x46e6b4){try{if(_0x52733a['TagIds']){_0x52733a['Tags']=[];_0x52733a[_0x6f6c('0x33')][_0x6f6c('0x34')](',')[_0x6f6c('0x35')](function(_0xf48611){_0x52733a['Tags'][_0x6f6c('0x36')](_0x3e0da6[_0xf48611]);});}delete _0x52733a[_0x6f6c('0x33')];}catch(_0x3e032b){_0x46e6b4(_0x3e032b);}_0x3c2b41(_0x52733a);});}function updateWhatsappInteraction(_0x1ba993,_0x45aebf,_0x239de9){return new BPromise(function(_0x26e51b,_0x30b262){return getInteractionUsers(_0x1ba993,_0x239de9)[_0x6f6c('0x2c')](function(_0x58bb6c){return getInteractionTags(_0x58bb6c,_0x45aebf);})[_0x6f6c('0x2c')](function(_0x5ecea1){_0x26e51b(_0x5ecea1);})[_0x6f6c('0x37')](function(_0x461b18){_0x30b262(_0x461b18);});});}exports[_0x6f6c('0x38')]=function(_0x575ed3,_0x293702){var _0x2453eb={},_0x2b71e7={},_0x3e1424={'count':0x0,'rows':[]};var _0x4a4265=_[_0x6f6c('0x31')](db[_0x6f6c('0x39')]['rawAttributes'],function(_0x25e1f8){return{'name':_0x25e1f8[_0x6f6c('0x3a')],'type':_0x25e1f8[_0x6f6c('0x3b')]['key']};});_0x2b71e7['model']=_[_0x6f6c('0x31')](_0x4a4265,_0x6f6c('0x2f'));_0x2b71e7['query']=_[_0x6f6c('0x3c')](_0x575ed3['query']);_0x2b71e7[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],_0x2b71e7['query']);_0x2453eb[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x2453eb[_0x6f6c('0x40')]=_0x2453eb[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x2453eb[_0x6f6c('0x40')]:_0x2b71e7['model'];if(!_0x575ed3[_0x6f6c('0x42')]['hasOwnProperty']('nolimit')){_0x2453eb[_0x6f6c('0x24')]=qs[_0x6f6c('0x24')](_0x575ed3['query'][_0x6f6c('0x24')]);_0x2453eb[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x575ed3[_0x6f6c('0x42')]['offset']);}_0x2453eb[_0x6f6c('0x44')]=qs['sort'](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x2453eb['where']=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x575ed3[_0x6f6c('0x42')],_0x2b71e7['filters']),_0x4a4265);var _0x5e3c3a=[];var _0x55f56d=squel[_0x6f6c('0x47')]()[_0x6f6c('0x48')]('id')[_0x6f6c('0x48')](_0x6f6c('0x2f'))[_0x6f6c('0x48')](_0x6f6c('0x49'))['from'](_0x6f6c('0x4a'));var _0x483593=squel['select']()[_0x6f6c('0x48')](_0x6f6c('0x4b'))['field'](_0x6f6c('0x4c'))[_0x6f6c('0x48')]('ui.WhatsappInteractionId')[_0x6f6c('0x4d')](_0x6f6c('0x4e'),'ui')[_0x6f6c('0x4f')](_0x6f6c('0x50'),'u',_0x6f6c('0x51'));var _0x1414f7=squel[_0x6f6c('0x47')]()[_0x6f6c('0x4d')](_0x6f6c('0x52'),'i')[_0x6f6c('0x4f')](_0x6f6c('0x53'),'c',_0x6f6c('0x54'))[_0x6f6c('0x4f')](_0x6f6c('0x50'),'o',_0x6f6c('0x55'))[_0x6f6c('0x4f')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x6f6c('0x4f')](_0x6f6c('0x56'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x6f6c('0x4f')](_0x6f6c('0x57'),'it',_0x6f6c('0x58'))['left_join'](_0x6f6c('0x4a'),'t',_0x6f6c('0x59'));var _0x131b2c=squel[_0x6f6c('0x5a')]();var _0x4b682a=[];var _0x4dee76=squel['expr']();var _0x1cea8d;if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]){_0x1cea8d=as[_0x6f6c('0x5c')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]);var _0x3223fe=_0x1cea8d[_0x6f6c('0x5d')];for(var _0x119fba=0x0;_0x119fba<_0x1cea8d[_0x6f6c('0x5e')][_0x6f6c('0x43')];_0x119fba++){var _0x36782a=_0x1cea8d[_0x6f6c('0x5e')][_0x119fba];var _0x1e5395='i';var _0xa73889=_['find'](_0x4a4265,[_0x6f6c('0x2f'),_0x36782a[_0x6f6c('0x48')]]);if(!_0xa73889){switch(_0x36782a[_0x6f6c('0x48')]){case _0x6f6c('0x5f'):if(_0x36782a[_0x6f6c('0x60')]==0x1){_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a['field']+_0x6f6c('0x62'));}else{_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a[_0x6f6c('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){if(_0x36782a[_0x6f6c('0x60')]['split']('\x20')[_0x6f6c('0x43')]>0x1){_0x131b2c[_0x3223fe](_0x6f6c('0x65'),qs['getFullTextValue'](_0x36782a[_0x6f6c('0x60')]),null);}else{var _0x34c0b4='%'+_0x36782a[_0x6f6c('0x60')]+'%';_0x131b2c[_0x3223fe](_0x6f6c('0x66'),_0x34c0b4,_0x34c0b4,_0x34c0b4);}}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,[_0x6f6c('0x2f'),_0x6f6c('0x68')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x68');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239['value'][_0x6f6c('0x6b')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}break;case _0x6f6c('0x6c'):var _0x3f4c1f=_0x36782a[_0x6f6c('0x60')][_0x6f6c('0x34')](',')['map'](function(_0x359a57){return Number(_0x359a57);});_0x3f4c1f[_0x6f6c('0x35')](function(_0x3cfd4d){_0x4dee76['or'](_0x6f6c('0x6d'),'%,'+_0x3cfd4d+',%');});_0x4b682a=_['union'](_0x4b682a,_0x3f4c1f);break;case'User':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){_0x131b2c[_0x3223fe]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36782a['value']+'%',null);}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,['name',_0x6f6c('0x6e')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x6e');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889['type'],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x6b')],_0x322239['value']['end']);}break;case'body':_0x322239=as[_0x6f6c('0x69')]('me',null,_0x36782a);_0x131b2c[_0x3223fe](_0x322239['text'],_0x322239['value']['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);break;}}else{var _0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')]['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}}}else{var _0x35847c=_(_0x575ed3['query'])[_0x6f6c('0x3c')]()[_0x6f6c('0x31')](function(_0x2a845a){return _[_0x6f6c('0x6f')](_0x4a4265,[_0x6f6c('0x2f'),_0x2a845a])?_0x2a845a:undefined;})[_0x6f6c('0x70')]()[_0x6f6c('0x60')]();if(!_[_0x6f6c('0x71')](_0x35847c)){_0x35847c[_0x6f6c('0x35')](function(_0x429b29){if(_0x429b29===_0x6f6c('0x72')){_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x74'),[][_0x6f6c('0x75')](_0x575ed3['query'][_0x429b29]));}else if(_0x429b29===_0x6f6c('0x76')){var _0x570dc8=JSON[_0x6f6c('0x77')](_0x575ed3['query'][_0x429b29])['$gte'];var _0x3c57f4=JSON[_0x6f6c('0x77')](_0x575ed3[_0x6f6c('0x42')][_0x429b29])['$lte'];_0x1414f7['where'](_0x6f6c('0x78'),_0x570dc8,_0x3c57f4);}else{if(_0x575ed3[_0x6f6c('0x42')][_0x429b29]===_0x6f6c('0x79')){_0x1414f7[_0x6f6c('0x73')]('i.'+_0x429b29+_0x6f6c('0x7a'));}else{_0x1414f7['where']('i.'+_0x429b29+_0x6f6c('0x7b'),_0x575ed3[_0x6f6c('0x42')][_0x429b29]);}}});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7c')]){if(_0x575ed3['query']['read']==0x1){_0x1414f7[_0x6f6c('0x61')]('`unreadMessages`\x20=\x200');}else{_0x1414f7[_0x6f6c('0x61')](_0x6f6c('0x7d'));}}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]){_0x4b682a=_[_0x6f6c('0x7f')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')])?_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]:new Array(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]);_0x4b682a['forEach'](function(_0xfc735d){_0x4dee76['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfc735d+',%');});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')]){var _0x11b270=_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')][_0x6f6c('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x11b270)){_0x131b2c['or'](_0x6f6c('0x82'),_0x11b270+'%')['or'](_0x6f6c('0x83'),_0x11b270+'%');}else{_0x131b2c['or'](_0x6f6c('0x84'),qs[_0x6f6c('0x85')](_0x11b270))['or'](_0x6f6c('0x86'),_0x11b270+'%');}}}_0x1414f7[_0x6f6c('0x73')](_0x131b2c);_0x1414f7[_0x6f6c('0x87')](_0x6f6c('0x88'));var _0x54a321={'type':db[_0x6f6c('0x89')][_0x6f6c('0x8a')][_0x6f6c('0x8b')],'raw':!![]};var _0x36d245=_0x1414f7[_0x6f6c('0x8c')]();_0x36d245[_0x6f6c('0x48')]('i.id');_0x36d245[_0x6f6c('0x48')](_0x6f6c('0x8d'),_0x6f6c('0x5f'));if(_0x2453eb[_0x6f6c('0x44')]){_0x2453eb[_0x6f6c('0x44')][_0x6f6c('0x35')](function(_0x239068){var _0x3a85e9=_0x239068[0x0]===_0x6f6c('0x8e')?_0x239068[0x0]:'i.'+_0x239068[0x0];_0x1414f7['order'](_0x3a85e9,_0x239068[0x1]===_0x6f6c('0x8f')?![]:!![]);});}if(!_[_0x6f6c('0x71')](_0x4b682a)){_0x1414f7[_0x6f6c('0x61')](_0x4dee76);_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x90'),_0x4b682a);}BPromise[_0x6f6c('0x91')]()[_0x6f6c('0x2c')](function(){if(!_0x1cea8d){if(_0x575ed3[_0x6f6c('0x42')]['WhatsappAccountId'])return;_0x36d245[_0x6f6c('0x73')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x92'));return;}if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]!==_0x6f6c('0x95'))return;return _0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5eb824){if(_[_0x6f6c('0x71')](_0x5eb824)){_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x97'));_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x97'));}else{_0x36d245['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));_0x1414f7['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));}});})['then'](function(){if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]==='agent'&&!_0x1cea8d&&!_0x575ed3['query']['WhatsappAccountId'])return[];return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x36d245['toString'](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x22bf19){_0x3e1424[_0x6f6c('0x25')]=_0x22bf19[_0x6f6c('0x43')];if(_0x3e1424[_0x6f6c('0x25')]===0x0)return[];return db['sequelize'][_0x6f6c('0x42')](_0x55f56d[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x512e25){_0x5e3c3a=_[_0x6f6c('0x9a')](_0x512e25,'id');_0x54a321=_['merge'](_0x54a321,{'model':db[_0x6f6c('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x575ed3['query']['fields']){_0x2453eb['attributes']['forEach'](function(_0x3e23e5){_0x1414f7[_0x6f6c('0x48')]('i.'+_0x3e23e5);});}else{_0x1414f7[_0x6f6c('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6f6c('0x5f'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9b'),_0x6f6c('0x9c'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9d'),_0x6f6c('0x9e'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9f'),'contactName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa0'));_0x1414f7['field'](_0x6f6c('0xa1'),'Contact.firstName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa2'),'Contact.lastName');_0x1414f7['field'](_0x6f6c('0xa3'),_0x6f6c('0xa4'));_0x1414f7['field'](_0x6f6c('0xa5'),_0x6f6c('0xa6'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa7'),_0x6f6c('0xa8'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa9'),_0x6f6c('0xaa'));_0x1414f7[_0x6f6c('0x48')]('o.fullname',_0x6f6c('0xab'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xac'),_0x6f6c('0xad'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xae'),_0x6f6c('0x33'));}if(_0x2453eb[_0x6f6c('0x24')])_0x1414f7[_0x6f6c('0x24')](_0x2453eb[_0x6f6c('0x24')]);if(_0x2453eb[_0x6f6c('0x26')])_0x1414f7['offset'](_0x2453eb['offset']);return db['sequelize'][_0x6f6c('0x42')](_0x1414f7[_0x6f6c('0x99')](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x1cfdc2){if(_0x1cfdc2[_0x6f6c('0x43')]>0x0)_0x483593[_0x6f6c('0x73')](_0x6f6c('0xaf'),_[_0x6f6c('0x31')](_0x1cfdc2,'id'));return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x483593[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x1c7644){var _0x1c7f06=_[_0x6f6c('0xb0')](_0x1c7644,_0x6f6c('0xb1'));var _0x3a4fe6=[];_0x1cfdc2[_0x6f6c('0x35')](function(_0x53007b){_0x3a4fe6[_0x6f6c('0x36')](updateWhatsappInteraction(_0x53007b,_0x5e3c3a,_0x1c7f06));});return BPromise[_0x6f6c('0xb2')](_0x3a4fe6);});});})['then'](function(_0x406af6){_0x3e1424[_0x6f6c('0xb3')]=_0x406af6;return _0x3e1424;})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x293702,_0x2453eb))[_0x6f6c('0x37')](handleError(_0x293702,null));};exports[_0x6f6c('0xb4')]=function(_0x3b4706,_0xc691c4){var _0x1ae4ad={'raw':![],'where':{'id':_0x3b4706[_0x6f6c('0xb5')]['id']}},_0x2fd4e3={};_0x2fd4e3[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db[_0x6f6c('0x39')][_0x6f6c('0xb6')]);_0x2fd4e3['query']=_['keys'](_0x3b4706[_0x6f6c('0x42')]);_0x2fd4e3[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],_0x2fd4e3[_0x6f6c('0x42')]);_0x1ae4ad[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x1ae4ad[_0x6f6c('0x40')]=_0x1ae4ad[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x1ae4ad[_0x6f6c('0x40')]:_0x2fd4e3['model'];if(_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x1ae4ad[_0x6f6c('0xb8')]=[{'all':!![]}];}_0x1ae4ad=_[_0x6f6c('0xb9')]({},_0x1ae4ad,_0x3b4706[_0x6f6c('0xba')]);return db[_0x6f6c('0x39')][_0x6f6c('0x67')](_0x1ae4ad)[_0x6f6c('0x2c')](handleEntityNotFound(_0xc691c4,null))['then'](respondWithResult(_0xc691c4,null))['catch'](handleError(_0xc691c4,null));};exports[_0x6f6c('0xbb')]=function(_0x5da23c,_0x8fc481){return db['WhatsappInteraction']['create'](_0x5da23c['body'],{})['then'](respondWithResult(_0x8fc481,0xc9))[_0x6f6c('0x37')](handleError(_0x8fc481,null));};exports[_0x6f6c('0x2b')]=function(_0x41e580,_0x5c7621){if(_0x41e580[_0x6f6c('0xbc')]['id']){delete _0x41e580['body']['id'];}return db['WhatsappInteraction'][_0x6f6c('0x67')]({'where':{'id':_0x41e580['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x5c7621,null))[_0x6f6c('0x2c')](saveUpdates(_0x41e580['body'],null))[_0x6f6c('0x2c')](respondWithResult(_0x5c7621,null))['catch'](handleError(_0x5c7621,null));};exports[_0x6f6c('0x2d')]=function(_0x5c99f4,_0x2a462c){return db[_0x6f6c('0x39')]['find']({'where':{'id':_0x5c99f4['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x2a462c,null))[_0x6f6c('0x2c')](removeEntity(_0x2a462c,null))[_0x6f6c('0x37')](handleError(_0x2a462c,null));};exports['describe']=function(_0x77bcc5,_0x351154){return db['WhatsappInteraction'][_0x6f6c('0xbd')]()[_0x6f6c('0x2c')](respondWithResult(_0x351154,null))[_0x6f6c('0x37')](handleError(_0x351154,null));};exports[_0x6f6c('0xbe')]=function(_0x22f3fe,_0x4a3e54,_0x29e58d){return db[_0x6f6c('0xbf')][_0x6f6c('0x67')]({'where':{'id':_0x22f3fe[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x4a3e54,null))[_0x6f6c('0x2c')](function(_0x519695){if(_0x519695){return _0x519695[_0x6f6c('0xbe')](_0x22f3fe[_0x6f6c('0xbc')][_0x6f6c('0xc0')],_[_0x6f6c('0xc1')](_0x22f3fe['body'],[_0x6f6c('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x4a3e54,null))['catch'](handleError(_0x4a3e54,null));};exports['getMessages']=function(_0x554d97,_0x131193,_0x3081f4){var _0x419c99={'raw':![],'where':{}};var _0x201cbc={};var _0x2f5295={'count':0x0,'rows':[]};return db[_0x6f6c('0x39')]['findOne']({'where':{'id':_0x554d97[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x131193,null))[_0x6f6c('0x2c')](function(_0x3b9737){if(_0x3b9737){_0x201cbc[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db['WhatsappMessage'][_0x6f6c('0xb6')]);_0x201cbc[_0x6f6c('0x42')]=_[_0x6f6c('0x3c')](_0x554d97[_0x6f6c('0x42')]);_0x201cbc[_0x6f6c('0x3d')]=_['intersection'](_0x201cbc[_0x6f6c('0x3f')],_0x201cbc[_0x6f6c('0x42')]);_0x419c99[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x201cbc[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x419c99[_0x6f6c('0x40')]=_0x419c99[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x419c99[_0x6f6c('0x40')]:_0x201cbc['model'];if(!_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc2')](_0x6f6c('0xc3'))){_0x419c99['limit']=qs[_0x6f6c('0x24')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x24')]);_0x419c99[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x26')]);}_0x419c99[_0x6f6c('0x44')]=qs['sort'](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x419c99[_0x6f6c('0x73')]=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x554d97[_0x6f6c('0x42')],_0x201cbc['filters']));_0x419c99[_0x6f6c('0x73')][_0x6f6c('0xb1')]=_0x3b9737['id'];if(_0x554d97[_0x6f6c('0x42')]['filter']){_0x419c99[_0x6f6c('0x73')]=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],{'$or':_[_0x6f6c('0x31')](_0x419c99[_0x6f6c('0x40')],function(_0x186df6){var _0x2234c3={};_0x2234c3[_0x186df6]={'$like':'%'+_0x554d97[_0x6f6c('0x42')]['filter']+'%'};return _0x2234c3;})});}if(_0x554d97['query'][_0x6f6c('0xc4')]){var _0x3fc079=_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc4')][_0x6f6c('0x34')](',');var _0x416e6b={};_0x416e6b[_0x3fc079[0x0]]={'$gte':moment(_0x3fc079[0x1])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))};_0x419c99['where']=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],_0x416e6b);}_0x419c99=_[_0x6f6c('0xb9')]({},_0x419c99,_0x554d97[_0x6f6c('0xba')]);return db[_0x6f6c('0xbf')]['count']({'where':_0x419c99[_0x6f6c('0x73')]})['then'](function(_0x13dd6a){_0x2f5295['count']=_0x13dd6a;if(_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x419c99['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x419c99);})['then'](function(_0x50533d){_0x2f5295[_0x6f6c('0xb3')]=_0x50533d;return _0x2f5295;});}})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x131193,_0x419c99))[_0x6f6c('0x37')](handleError(_0x131193,null));};exports[_0x6f6c('0xc7')]=function(_0x4fcbe4,_0xcd4755,_0x1da394){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x4fcbe4[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0xcd4755,null))[_0x6f6c('0x2c')](function(_0x320910){if(_0x320910){return _0x320910[_0x6f6c('0xc8')](_0x4fcbe4[_0x6f6c('0xbc')]['ids'],_[_0x6f6c('0xc1')](_0x4fcbe4[_0x6f6c('0xbc')],[_0x6f6c('0xc0'),'id'])||{})[_0x6f6c('0xc9')](function(){return db[_0x6f6c('0x6c')]['findAll']({'attributes':['id',_0x6f6c('0x2f'),_0x6f6c('0x49')],'where':{'id':_0x4fcbe4[_0x6f6c('0xbc')][_0x6f6c('0xc0')]}});})[_0x6f6c('0x2c')](function(_0xf295c6){socket[_0x6f6c('0xca')](_0x6f6c('0xcb'),{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]});return{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]};});}})[_0x6f6c('0x2c')](respondWithResult(_0xcd4755,null))[_0x6f6c('0x37')](handleError(_0xcd4755,null));};exports[_0x6f6c('0xcc')]=function(_0x542037,_0x58a342,_0x18a07a){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x542037[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x58a342,null))[_0x6f6c('0x2c')](function(_0x45e483){if(_0x45e483){return _0x45e483['removeTags'](_0x542037[_0x6f6c('0x42')]['ids']);}})[_0x6f6c('0x2c')](respondWithStatusCode(_0x58a342,null))['catch'](handleError(_0x58a342,null));};exports[_0x6f6c('0xcd')]=function(_0x564032,_0x9c80b8){var _0x592093=moment()[_0x6f6c('0xce')]()[_0x6f6c('0x99')]();var _0x33b11d=path[_0x6f6c('0xcf')](config[_0x6f6c('0xd0')],'server',_0x6f6c('0xd1'),'tmp');var _0x1f0cdd=path[_0x6f6c('0xcf')](config['root'],_0x6f6c('0xd2'),_0x6f6c('0xd1'),_0x6f6c('0xd3'));var _0x4b70f9=path['join'](_0x33b11d,_0x592093);var _0x2fa7ba=util[_0x6f6c('0xc5')](_0x6f6c('0xd4'),_0x564032[_0x6f6c('0xb5')]['id'],_0x592093);var _0xf4b669=path[_0x6f6c('0xcf')](_0x33b11d,_0x2fa7ba);var _0x1dd405=[];_0x1dd405['push']({'model':db[_0x6f6c('0xd5')],'as':_0x6f6c('0xd5'),'attributes':['id',_0x6f6c('0x32')],'raw':!![]});_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xd6')],'as':_0x6f6c('0xd7'),'attributes':['id',_0x6f6c('0xd8'),_0x6f6c('0xd9')],'raw':!![]});if(_0x564032[_0x6f6c('0x42')][_0x6f6c('0xd3')]){_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xda')],'as':_0x6f6c('0xda'),'raw':!![]});}var _0x4263a8=[{'model':db[_0x6f6c('0xbf')],'as':_0x6f6c('0xdb'),'attributes':['id','body',_0x6f6c('0x76'),_0x6f6c('0xdc'),_0x6f6c('0xdd'),_0x6f6c('0x7c')],'include':_0x1dd405}];_0x4263a8[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xde')],'as':'Account','attributes':['id',_0x6f6c('0x2f')]});_0x4263a8[_0x6f6c('0x36')]({'model':db['User'],'as':_0x6f6c('0xdf'),'attributes':['id',_0x6f6c('0x32')]});return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x564032[_0x6f6c('0xb5')]['id']},'include':_0x4263a8})[_0x6f6c('0x2c')](handleEntityNotFound(_0x9c80b8,null))['then'](function(_0x56f154){if(_0x56f154){var _0x299cba=_0x56f154[_0x6f6c('0xe0')]({'plain':!![]});fs[_0x6f6c('0xe1')](_0x4b70f9);var _0xdfbb66={'channel':_0x6f6c('0xe2'),'account':_0x299cba[_0x6f6c('0xe3')]['name'],'agent':_0x299cba[_0x6f6c('0xdf')]?_0x299cba[_0x6f6c('0xdf')][_0x6f6c('0x32')]:_0x6f6c('0xe4'),'createdAt':moment(_0x299cba[_0x6f6c('0x76')])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))[_0x6f6c('0x99')](),'closedAt':_0x299cba[_0x6f6c('0xe5')]?moment(_0x299cba[_0x6f6c('0xe6')])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')]():'','disposition':_0x299cba[_0x6f6c('0xe7')],'messages':_(_0x299cba[_0x6f6c('0xdb')])[_0x6f6c('0x80')]({'secret':![]})['map'](function(_0x30c391){if(_0x30c391[_0x6f6c('0xda')]){var _0x504107=path[_0x6f6c('0xcf')](_0x1f0cdd,_0x30c391['Attachment'][_0x6f6c('0xe8')]);if(fs['existsSync'](_0x504107)){fs[_0x6f6c('0xe9')](_0x504107)[_0x6f6c('0xea')](fs[_0x6f6c('0xeb')](path[_0x6f6c('0xcf')](_0x4b70f9,_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')])));}}return{'date':moment(_0x30c391['createdAt'])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')](),'sender':_0x30c391['direction']==='out'?_0x30c391[_0x6f6c('0xd5')]?_0x30c391[_0x6f6c('0xd5')][_0x6f6c('0x32')]:_0x6f6c('0xec'):_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd8')]+(_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]?'\x20'+_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]:''),'body':_0x30c391[_0x6f6c('0xda')]?_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')]:_0x30c391[_0x6f6c('0xbc')],'direction':_0x30c391[_0x6f6c('0xdc')]==='out'?'A':'C','secret':_0x30c391['secret'],'read':_0x30c391['read'],'attachment':_0x30c391[_0x6f6c('0xda')]};})[_0x6f6c('0x60')]()};return ejs[_0x6f6c('0xed')](path['join'](config['root'],_0x6f6c('0xd2'),'views','downloadInteraction.ejs'),{'interaction':_0xdfbb66})[_0x6f6c('0x2c')](function(_0xbf23d9){var _0x5bdf5b=path[_0x6f6c('0xcf')](_0x4b70f9,_0x6f6c('0xee')+_0x299cba['id']+'-'+_0x592093+_0x6f6c('0xef'));var _0x2036f5={'path':_0x5bdf5b,'channel':_0x6f6c('0xe2'),'interactionId':_0x299cba['id']};return pdf[_0x6f6c('0xf0')](_0xbf23d9,_0x2036f5);})['then'](function(){return new BPromise(function(_0x31d00c,_0x4afa35){zipdir(_0x4b70f9,{'saveTo':_0xf4b669},function(_0x13c4fc,_0x9eac45){if(_0x13c4fc)return _0x4afa35(_0x13c4fc);return _0x31d00c(_0x9eac45);});})['then'](function(){return new BPromise(function(_0x3c77b0,_0xbc6856){rimraf(_0x4b70f9,function(_0x3873fd){if(_0x3873fd)_0xbc6856(_0x3873fd);return _0x3c77b0();});});})[_0x6f6c('0x2c')](function(){return _0x9c80b8[_0x6f6c('0xcd')](_0xf4b669,_0x2fa7ba,function(_0x19174a){if(_0x19174a){console['log'](_0x6f6c('0xf1'),_0x19174a);}else{fs[_0x6f6c('0xf2')](_0xf4b669);}});});});}else{return _0x9c80b8[_0x6f6c('0x1f')](0xc8);}})['catch'](handleError(_0x9c80b8,null));}; \ No newline at end of file +var _0x548b=['replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','params','includeAll','include','create','describe','WhatsappMessage','addMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','direction','Account','Owner','get','Whatsapp','N.A.','closed','closedAt','disposition','Attachment','basename','existsSync','createReadStream','createWriteStream','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','end','status','offset','limit','undefined','count','set','reject','update','then','destroy','sendStatus','error','name','Users','map','fullname','TagIds','Tags','forEach','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','body','some','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter'];(function(_0x592019,_0x1b695e){var _0xcb2624=function(_0x40ad26){while(--_0x40ad26){_0x592019['push'](_0x592019['shift']());}};_0xcb2624(++_0x1b695e);}(_0x548b,0x14f));var _0xb548=function(_0x539d67,_0x2e2bef){_0x539d67=_0x539d67-0x0;var _0x1b46ab=_0x548b[_0x539d67];return _0x1b46ab;};'use strict';var emlformat=require(_0xb548('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb548('0x1'));var jsonpatch=require(_0xb548('0x2'));var rp=require(_0xb548('0x3'));var moment=require(_0xb548('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb548('0x5'));var path=require(_0xb548('0x6'));var sox=require(_0xb548('0x7'));var csv=require(_0xb548('0x8'));var ejs=require(_0xb548('0x9'));var fs=require('fs');var fs_extra=require(_0xb548('0xa'));var _=require(_0xb548('0xb'));var squel=require(_0xb548('0xc'));var crypto=require(_0xb548('0xd'));var jsforce=require(_0xb548('0xe'));var deskjs=require(_0xb548('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb548('0x10'));var Papa=require(_0xb548('0x11'));var Redis=require(_0xb548('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb548('0x13'));var as=require(_0xb548('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb548('0x15'));var utils=require(_0xb548('0x16'));var config=require(_0xb548('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb548('0x18'))['db'];config[_0xb548('0x19')]=_['defaults'](config[_0xb548('0x19')],{'host':_0xb548('0x1a'),'port':0x18eb});var socket=require(_0xb548('0x1b'))(new Redis(config['redis']));require(_0xb548('0x1c'))[_0xb548('0x1d')](socket);function respondWithStatusCode(_0x26b05c,_0x16822f){_0x16822f=_0x16822f||0xcc;return function(_0x3ee052){if(_0x3ee052){return _0x26b05c['sendStatus'](_0x16822f);}return _0x26b05c['status'](_0x16822f)[_0xb548('0x1e')]();};}function respondWithResult(_0x50dc3e,_0x4e428a){_0x4e428a=_0x4e428a||0xc8;return function(_0x48c6f4){if(_0x48c6f4){return _0x50dc3e[_0xb548('0x1f')](_0x4e428a)['json'](_0x48c6f4);}};}function respondWithFilteredResult(_0x2f1449,_0x4d83eb){return function(_0x2683e9){if(_0x2683e9){var _0x29c552=typeof _0x4d83eb[_0xb548('0x20')]==='undefined'&&typeof _0x4d83eb[_0xb548('0x21')]===_0xb548('0x22');var _0x415450=_0x2683e9[_0xb548('0x23')];var _0x102953=_0x29c552?0x0:_0x4d83eb[_0xb548('0x20')];var _0x5e780e=_0x29c552?_0x2683e9[_0xb548('0x23')]:_0x4d83eb[_0xb548('0x20')]+_0x4d83eb[_0xb548('0x21')];var _0xd51e6;if(_0x5e780e>=_0x415450){_0x5e780e=_0x415450;_0xd51e6=0xc8;}else{_0xd51e6=0xce;}_0x2f1449['status'](_0xd51e6);return _0x2f1449[_0xb548('0x24')]('Content-Range',_0x102953+'-'+_0x5e780e+'/'+_0x415450)['json'](_0x2683e9);}return null;};}function patchUpdates(_0x3329ac){return function(_0x1903f0){try{jsonpatch['apply'](_0x1903f0,_0x3329ac,!![]);}catch(_0x33b780){return BPromise[_0xb548('0x25')](_0x33b780);}return _0x1903f0['save']();};}function saveUpdates(_0x21be53,_0x14f677){return function(_0x1da85f){if(_0x1da85f){return _0x1da85f[_0xb548('0x26')](_0x21be53)[_0xb548('0x27')](function(_0x12f9e0){return _0x12f9e0;});}return null;};}function removeEntity(_0x519038,_0xd6505a){return function(_0x254c58){if(_0x254c58){return _0x254c58[_0xb548('0x28')]()['then'](function(){_0x519038[_0xb548('0x1f')](0xcc)[_0xb548('0x1e')]();});}};}function handleEntityNotFound(_0x31c712,_0x58c5c8){return function(_0x45c1ca){if(!_0x45c1ca){_0x31c712[_0xb548('0x29')](0x194);}return _0x45c1ca;};}function handleError(_0x208fd7,_0x2eb53f){_0x2eb53f=_0x2eb53f||0x1f4;return function(_0x2df09e){logger[_0xb548('0x2a')](_0x2df09e['stack']);if(_0x2df09e[_0xb548('0x2b')]){delete _0x2df09e[_0xb548('0x2b')];}_0x208fd7['status'](_0x2eb53f)['send'](_0x2df09e);};}function getInteractionUsers(_0x496510,_0x13430b){return new BPromise(function(_0x571cd8,_0x2488b6){try{if(_0x13430b[_0x496510['id']]){_0x496510[_0xb548('0x2c')]=_[_0xb548('0x2d')](_0x13430b[_0x496510['id']],function(_0x3fef01){return{'id':_0x3fef01['id'],'fullname':_0x3fef01[_0xb548('0x2e')]};});}}catch(_0x46ebf4){_0x2488b6(_0x46ebf4);}_0x571cd8(_0x496510);});}function getInteractionTags(_0x322505,_0x536689){return new BPromise(function(_0x30153e,_0x281458){try{if(_0x322505[_0xb548('0x2f')]){_0x322505[_0xb548('0x30')]=[];_0x322505[_0xb548('0x2f')]['split'](',')[_0xb548('0x31')](function(_0x190ddf){_0x322505['Tags']['push'](_0x536689[_0x190ddf]);});}delete _0x322505[_0xb548('0x2f')];}catch(_0x217146){_0x281458(_0x217146);}_0x30153e(_0x322505);});}function updateWhatsappInteraction(_0x5b6126,_0x54b421,_0x254c1b){return new BPromise(function(_0x174406,_0x1c7dee){return getInteractionUsers(_0x5b6126,_0x254c1b)['then'](function(_0x777a1e){return getInteractionTags(_0x777a1e,_0x54b421);})[_0xb548('0x27')](function(_0x401ad6){_0x174406(_0x401ad6);})[_0xb548('0x32')](function(_0x5e1e25){_0x1c7dee(_0x5e1e25);});});}exports[_0xb548('0x33')]=function(_0x88a42,_0x38d4d4){var _0xc10fa1={},_0x435415={},_0x3fc1ec={'count':0x0,'rows':[]};var _0x336837=_[_0xb548('0x2d')](db[_0xb548('0x34')][_0xb548('0x35')],function(_0x22a674){return{'name':_0x22a674[_0xb548('0x36')],'type':_0x22a674[_0xb548('0x37')][_0xb548('0x38')]};});_0x435415[_0xb548('0x39')]=_['map'](_0x336837,'name');_0x435415['query']=_[_0xb548('0x3a')](_0x88a42[_0xb548('0x3b')]);_0x435415['filters']=_[_0xb548('0x3c')](_0x435415['model'],_0x435415[_0xb548('0x3b')]);_0xc10fa1[_0xb548('0x3d')]=_[_0xb548('0x3c')](_0x435415[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x88a42['query'][_0xb548('0x3e')]));_0xc10fa1[_0xb548('0x3d')]=_0xc10fa1[_0xb548('0x3d')][_0xb548('0x3f')]?_0xc10fa1['attributes']:_0x435415[_0xb548('0x39')];if(!_0x88a42[_0xb548('0x3b')][_0xb548('0x40')]('nolimit')){_0xc10fa1[_0xb548('0x21')]=qs[_0xb548('0x21')](_0x88a42[_0xb548('0x3b')][_0xb548('0x21')]);_0xc10fa1[_0xb548('0x20')]=qs['offset'](_0x88a42['query'][_0xb548('0x20')]);}_0xc10fa1[_0xb548('0x41')]=qs[_0xb548('0x42')](_0x88a42[_0xb548('0x3b')]['sort']);_0xc10fa1[_0xb548('0x43')]=qs[_0xb548('0x44')](_[_0xb548('0x45')](_0x88a42[_0xb548('0x3b')],_0x435415['filters']),_0x336837);var _0x63bd2b=[];var _0x4889ae=squel[_0xb548('0x46')]()[_0xb548('0x47')]('id')[_0xb548('0x47')]('name')[_0xb548('0x47')](_0xb548('0x48'))[_0xb548('0x49')](_0xb548('0x4a'));var _0x1effa0=squel[_0xb548('0x46')]()[_0xb548('0x47')](_0xb548('0x4b'))[_0xb548('0x47')](_0xb548('0x4c'))['field'](_0xb548('0x4d'))['from']('user_has_whatsapp_interactions','ui')[_0xb548('0x4e')](_0xb548('0x4f'),'u',_0xb548('0x50'));var _0x230795=squel[_0xb548('0x46')]()[_0xb548('0x49')]('whatsapp_interactions','i')['left_join'](_0xb548('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb548('0x4e')]('users','o',_0xb548('0x52'))[_0xb548('0x4e')]('whatsapp_accounts','a',_0xb548('0x53'))[_0xb548('0x4e')]('whatsapp_messages','me',_0xb548('0x54'))[_0xb548('0x4e')](_0xb548('0x55'),'it',_0xb548('0x56'))[_0xb548('0x4e')](_0xb548('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x16ab54=squel[_0xb548('0x57')]();var _0x3f36d8=[];var _0xd72a57=squel['expr']();var _0x4bb126;if(_0x88a42['query']['search']){_0x4bb126=as['parseSearch'](_0x88a42[_0xb548('0x3b')][_0xb548('0x58')]);var _0x5802c7=_0x4bb126[_0xb548('0x59')];for(var _0x5424f9=0x0;_0x5424f9<_0x4bb126[_0xb548('0x5a')][_0xb548('0x3f')];_0x5424f9++){var _0x11d4b7=_0x4bb126[_0xb548('0x5a')][_0x5424f9];var _0x1322bc='i';var _0x11a9e4=_[_0xb548('0x5b')](_0x336837,['name',_0x11d4b7['field']]);if(!_0x11a9e4){switch(_0x11d4b7['field']){case _0xb548('0x5c'):if(_0x11d4b7[_0xb548('0x5d')]==0x1){_0x230795[_0xb548('0x5e')]('`'+_0x11d4b7[_0xb548('0x47')]+_0xb548('0x5f'));}else{_0x230795[_0xb548('0x5e')]('`'+_0x11d4b7[_0xb548('0x47')]+_0xb548('0x60'));}break;case _0xb548('0x61'):if(_0x11d4b7[_0xb548('0x62')]===_0xb548('0x63')){if(_0x11d4b7[_0xb548('0x5d')][_0xb548('0x64')]('\x20')[_0xb548('0x3f')]>0x1){_0x16ab54[_0x5802c7](_0xb548('0x65'),qs[_0xb548('0x66')](_0x11d4b7[_0xb548('0x5d')]),null);}else{var _0x31ef37='%'+_0x11d4b7[_0xb548('0x5d')]+'%';_0x16ab54[_0x5802c7](_0xb548('0x67'),_0x31ef37,_0x31ef37,_0x31ef37);}}else{_0x11a9e4=_[_0xb548('0x5b')](_0x336837,[_0xb548('0x2b'),_0xb548('0x68')]);_0x11d4b7[_0xb548('0x47')]='ContactId';_0x3fed8b=as[_0xb548('0x69')](_0x1322bc,_0x11a9e4['type'],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b['text'],_0x3fed8b['value'][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}break;case _0xb548('0x6b'):var _0x40705c=_0x11d4b7[_0xb548('0x5d')][_0xb548('0x64')](',')['map'](function(_0x2ff049){return Number(_0x2ff049);});_0x40705c[_0xb548('0x31')](function(_0x1a6f75){_0xd72a57['or'](_0xb548('0x6c'),'%,'+_0x1a6f75+',%');});_0x3f36d8=_[_0xb548('0x6d')](_0x3f36d8,_0x40705c);break;case _0xb548('0x6e'):if(_0x11d4b7[_0xb548('0x62')]===_0xb548('0x63')){_0x16ab54[_0x5802c7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x11d4b7[_0xb548('0x5d')]+'%',null);}else{_0x11a9e4=_[_0xb548('0x5b')](_0x336837,[_0xb548('0x2b'),_0xb548('0x6f')]);_0x11d4b7['field']=_0xb548('0x6f');_0x3fed8b=as[_0xb548('0x69')](_0x1322bc,_0x11a9e4['type'],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')]['start'],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}break;case _0xb548('0x71'):_0x3fed8b=as[_0xb548('0x69')]('me',null,_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);break;}}else{var _0x3fed8b=as['buildExpression'](_0x1322bc,_0x11a9e4[_0xb548('0x37')],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}}}else{var _0x3e8dee=_(_0x88a42[_0xb548('0x3b')])['keys']()[_0xb548('0x2d')](function(_0x4d1f09){return _[_0xb548('0x72')](_0x336837,[_0xb548('0x2b'),_0x4d1f09])?_0x4d1f09:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x3e8dee)){_0x3e8dee['forEach'](function(_0x199fff){if(_0x199fff==='WhatsappAccountId'){_0x230795[_0xb548('0x43')](_0xb548('0x73'),[]['concat'](_0x88a42[_0xb548('0x3b')][_0x199fff]));}else if(_0x199fff===_0xb548('0x74')){var _0x331b6c=JSON[_0xb548('0x75')](_0x88a42['query'][_0x199fff])[_0xb548('0x76')];var _0x4c78f6=JSON[_0xb548('0x75')](_0x88a42[_0xb548('0x3b')][_0x199fff])[_0xb548('0x77')];_0x230795[_0xb548('0x43')](_0xb548('0x78'),_0x331b6c,_0x4c78f6);}else{if(_0x88a42[_0xb548('0x3b')][_0x199fff]==='null'){_0x230795[_0xb548('0x43')]('i.'+_0x199fff+_0xb548('0x79'));}else{_0x230795[_0xb548('0x43')]('i.'+_0x199fff+_0xb548('0x7a'),_0x88a42[_0xb548('0x3b')][_0x199fff]);}}});}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7b')]){if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7b')]==0x1){_0x230795[_0xb548('0x5e')](_0xb548('0x7c'));}else{_0x230795[_0xb548('0x5e')](_0xb548('0x7d'));}}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')]){_0x3f36d8=_[_0xb548('0x7f')](_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')])?_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')]:new Array(_0x88a42['query'][_0xb548('0x7e')]);_0x3f36d8[_0xb548('0x31')](function(_0x52fc7c){_0xd72a57['or'](_0xb548('0x6c'),'%,'+_0x52fc7c+',%');});}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x80')]){var _0x5844b0=_0x88a42[_0xb548('0x3b')][_0xb548('0x80')][_0xb548('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5844b0)){_0x16ab54['or'](_0xb548('0x82'),_0x5844b0+'%')['or'](_0xb548('0x83'),_0x5844b0+'%');}else{_0x16ab54['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb548('0x66')](_0x5844b0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5844b0+'%');}}}_0x230795[_0xb548('0x43')](_0x16ab54);_0x230795[_0xb548('0x84')](_0xb548('0x85'));var _0x1514b6={'type':db[_0xb548('0x86')][_0xb548('0x87')][_0xb548('0x88')],'raw':!![]};var _0xa95ae5=_0x230795['clone']();_0xa95ae5[_0xb548('0x47')](_0xb548('0x85'));_0xa95ae5[_0xb548('0x47')](_0xb548('0x89'),_0xb548('0x5c'));if(_0xc10fa1[_0xb548('0x41')]){_0xc10fa1['order'][_0xb548('0x31')](function(_0x507f98){var _0xb32a6e=_0x507f98[0x0]===_0xb548('0x8a')?_0x507f98[0x0]:'i.'+_0x507f98[0x0];_0x230795[_0xb548('0x41')](_0xb32a6e,_0x507f98[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb548('0x8b')](_0x3f36d8)){_0x230795['having'](_0xd72a57);_0xa95ae5[_0xb548('0x43')](_0xb548('0x8c'),_0x3f36d8);}BPromise[_0xb548('0x8d')]()[_0xb548('0x27')](function(){if(!_0x4bb126){if(_0x88a42[_0xb548('0x3b')]['WhatsappAccountId'])return;_0xa95ae5[_0xb548('0x43')](_0xb548('0x8e'));_0x230795[_0xb548('0x43')](_0xb548('0x8e'));return;}if(_0x88a42['user'][_0xb548('0x8f')]!==_0xb548('0x90'))return;return _0x88a42[_0xb548('0x91')][_0xb548('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x34d35e){if(_['isEmpty'](_0x34d35e)){_0xa95ae5[_0xb548('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');_0x230795[_0xb548('0x43')](_0xb548('0x93'));}else{_0xa95ae5[_0xb548('0x43')](_0xb548('0x73'),_[_0xb548('0x2d')](_0x34d35e,'id'));_0x230795[_0xb548('0x43')](_0xb548('0x73'),_[_0xb548('0x2d')](_0x34d35e,'id'));}});})[_0xb548('0x27')](function(){if(_0x88a42[_0xb548('0x91')][_0xb548('0x8f')]===_0xb548('0x90')&&!_0x4bb126&&!_0x88a42[_0xb548('0x3b')]['WhatsappAccountId'])return[];return db[_0xb548('0x94')][_0xb548('0x3b')](_0xa95ae5[_0xb548('0x95')](),_0x1514b6);})[_0xb548('0x27')](function(_0x14b006){_0x3fc1ec[_0xb548('0x23')]=_0x14b006['length'];if(_0x3fc1ec[_0xb548('0x23')]===0x0)return[];return db[_0xb548('0x94')][_0xb548('0x3b')](_0x4889ae[_0xb548('0x95')](),_0x1514b6)[_0xb548('0x27')](function(_0x33ded4){_0x63bd2b=_[_0xb548('0x96')](_0x33ded4,'id');_0x1514b6=_['merge'](_0x1514b6,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x88a42[_0xb548('0x3b')]['fields']){_0xc10fa1[_0xb548('0x3d')][_0xb548('0x31')](function(_0x122a2e){_0x230795[_0xb548('0x47')]('i.'+_0x122a2e);});}else{_0x230795[_0xb548('0x47')](_0xb548('0x89'),'unreadMessages');_0x230795['field'](_0xb548('0x97'),_0xb548('0x98'));_0x230795[_0xb548('0x47')](_0xb548('0x99'),_0xb548('0x9a'));_0x230795[_0xb548('0x47')](_0xb548('0x9b'),'contactName');_0x230795[_0xb548('0x47')](_0xb548('0x9c'));_0x230795[_0xb548('0x47')](_0xb548('0x9d'),_0xb548('0x9e'));_0x230795[_0xb548('0x47')](_0xb548('0x9f'),_0xb548('0xa0'));_0x230795[_0xb548('0x47')](_0xb548('0xa1'),'Contact.email');_0x230795['field']('c.phone',_0xb548('0xa2'));_0x230795[_0xb548('0x47')]('c.mobile','Contact.mobile');_0x230795[_0xb548('0x47')](_0xb548('0xa3'),_0xb548('0xa4'));_0x230795[_0xb548('0x47')](_0xb548('0xa5'),_0xb548('0xa6'));_0x230795[_0xb548('0x47')](_0xb548('0xa7'),'Owner.internal');_0x230795['field'](_0xb548('0xa8'),_0xb548('0x2f'));}if(_0xc10fa1['limit'])_0x230795['limit'](_0xc10fa1[_0xb548('0x21')]);if(_0xc10fa1[_0xb548('0x20')])_0x230795[_0xb548('0x20')](_0xc10fa1['offset']);return db[_0xb548('0x94')][_0xb548('0x3b')](_0x230795[_0xb548('0x95')](),_0x1514b6);})['then'](function(_0x53ccd3){if(_0x53ccd3['length']>0x0)_0x1effa0[_0xb548('0x43')](_0xb548('0xa9'),_['map'](_0x53ccd3,'id'));return db[_0xb548('0x94')][_0xb548('0x3b')](_0x1effa0[_0xb548('0x95')](),_0x1514b6)['then'](function(_0xb0050c){var _0x162126=_[_0xb548('0xaa')](_0xb0050c,_0xb548('0xab'));var _0x50034d=[];_0x53ccd3['forEach'](function(_0x3509c7){_0x50034d[_0xb548('0xac')](updateWhatsappInteraction(_0x3509c7,_0x63bd2b,_0x162126));});return BPromise[_0xb548('0xad')](_0x50034d);});});})[_0xb548('0x27')](function(_0x1632ad){_0x3fc1ec[_0xb548('0xae')]=_0x1632ad;return _0x3fc1ec;})[_0xb548('0x27')](respondWithFilteredResult(_0x38d4d4,_0xc10fa1))[_0xb548('0x32')](handleError(_0x38d4d4,null));};exports[_0xb548('0xaf')]=function(_0x3c81eb,_0x2dd1d5){var _0x2bf79c={'raw':![],'where':{'id':_0x3c81eb[_0xb548('0xb0')]['id']}},_0x45f547={};_0x45f547['model']=_[_0xb548('0x3a')](db[_0xb548('0x34')][_0xb548('0x35')]);_0x45f547[_0xb548('0x3b')]=_[_0xb548('0x3a')](_0x3c81eb[_0xb548('0x3b')]);_0x45f547[_0xb548('0x44')]=_[_0xb548('0x3c')](_0x45f547[_0xb548('0x39')],_0x45f547['query']);_0x2bf79c['attributes']=_[_0xb548('0x3c')](_0x45f547[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x3c81eb[_0xb548('0x3b')][_0xb548('0x3e')]));_0x2bf79c[_0xb548('0x3d')]=_0x2bf79c['attributes']['length']?_0x2bf79c[_0xb548('0x3d')]:_0x45f547[_0xb548('0x39')];if(_0x3c81eb[_0xb548('0x3b')][_0xb548('0xb1')]){_0x2bf79c[_0xb548('0xb2')]=[{'all':!![]}];}_0x2bf79c=_['merge']({},_0x2bf79c,_0x3c81eb['options']);return db[_0xb548('0x34')]['find'](_0x2bf79c)['then'](handleEntityNotFound(_0x2dd1d5,null))[_0xb548('0x27')](respondWithResult(_0x2dd1d5,null))['catch'](handleError(_0x2dd1d5,null));};exports[_0xb548('0xb3')]=function(_0x519364,_0x3c4e3c){return db[_0xb548('0x34')]['create'](_0x519364['body'],{})[_0xb548('0x27')](respondWithResult(_0x3c4e3c,0xc9))['catch'](handleError(_0x3c4e3c,null));};exports[_0xb548('0x26')]=function(_0x595364,_0x242349){if(_0x595364[_0xb548('0x71')]['id']){delete _0x595364[_0xb548('0x71')]['id'];}return db[_0xb548('0x34')][_0xb548('0x5b')]({'where':{'id':_0x595364['params']['id']}})[_0xb548('0x27')](handleEntityNotFound(_0x242349,null))[_0xb548('0x27')](saveUpdates(_0x595364[_0xb548('0x71')],null))['then'](respondWithResult(_0x242349,null))[_0xb548('0x32')](handleError(_0x242349,null));};exports[_0xb548('0x28')]=function(_0x54ba13,_0x58366e){return db[_0xb548('0x34')]['find']({'where':{'id':_0x54ba13[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x58366e,null))[_0xb548('0x27')](removeEntity(_0x58366e,null))['catch'](handleError(_0x58366e,null));};exports[_0xb548('0xb4')]=function(_0x8e8cd0,_0x5e1321){return db[_0xb548('0x34')][_0xb548('0xb4')]()[_0xb548('0x27')](respondWithResult(_0x5e1321,null))[_0xb548('0x32')](handleError(_0x5e1321,null));};exports['addMessage']=function(_0x524d90,_0x5d406a,_0x204805){return db[_0xb548('0xb5')][_0xb548('0x5b')]({'where':{'id':_0x524d90[_0xb548('0xb0')]['id']}})[_0xb548('0x27')](handleEntityNotFound(_0x5d406a,null))['then'](function(_0x2f2285){if(_0x2f2285){return _0x2f2285[_0xb548('0xb6')](_0x524d90[_0xb548('0x71')][_0xb548('0xb7')],_[_0xb548('0xb8')](_0x524d90[_0xb548('0x71')],[_0xb548('0xb7'),'id'])||{});}})[_0xb548('0x27')](respondWithResult(_0x5d406a,null))[_0xb548('0x32')](handleError(_0x5d406a,null));};exports['getMessages']=function(_0x1d54c3,_0x1da0cf,_0x373ad9){var _0x437917={'raw':![],'where':{}};var _0x551ac1={};var _0x2bf77c={'count':0x0,'rows':[]};return db[_0xb548('0x34')][_0xb548('0xb9')]({'where':{'id':_0x1d54c3[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1da0cf,null))['then'](function(_0x49360c){if(_0x49360c){_0x551ac1[_0xb548('0x39')]=_[_0xb548('0x3a')](db[_0xb548('0xb5')][_0xb548('0x35')]);_0x551ac1['query']=_[_0xb548('0x3a')](_0x1d54c3[_0xb548('0x3b')]);_0x551ac1[_0xb548('0x44')]=_[_0xb548('0x3c')](_0x551ac1['model'],_0x551ac1[_0xb548('0x3b')]);_0x437917['attributes']=_[_0xb548('0x3c')](_0x551ac1[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x1d54c3[_0xb548('0x3b')]['fields']));_0x437917['attributes']=_0x437917[_0xb548('0x3d')][_0xb548('0x3f')]?_0x437917['attributes']:_0x551ac1[_0xb548('0x39')];if(!_0x1d54c3[_0xb548('0x3b')][_0xb548('0x40')](_0xb548('0xba'))){_0x437917[_0xb548('0x21')]=qs[_0xb548('0x21')](_0x1d54c3['query'][_0xb548('0x21')]);_0x437917[_0xb548('0x20')]=qs['offset'](_0x1d54c3[_0xb548('0x3b')][_0xb548('0x20')]);}_0x437917[_0xb548('0x41')]=qs[_0xb548('0x42')](_0x1d54c3['query'][_0xb548('0x42')]);_0x437917[_0xb548('0x43')]=qs[_0xb548('0x44')](_[_0xb548('0x45')](_0x1d54c3['query'],_0x551ac1[_0xb548('0x44')]));_0x437917[_0xb548('0x43')][_0xb548('0xab')]=_0x49360c['id'];if(_0x1d54c3[_0xb548('0x3b')][_0xb548('0x80')]){_0x437917['where']=_['merge'](_0x437917[_0xb548('0x43')],{'$or':_['map'](_0x437917[_0xb548('0x3d')],function(_0x2be913){var _0x48cada={};_0x48cada[_0x2be913]={'$like':'%'+_0x1d54c3['query'][_0xb548('0x80')]+'%'};return _0x48cada;})});}if(_0x1d54c3['query'][_0xb548('0x76')]){var _0x9ed3fb=_0x1d54c3[_0xb548('0x3b')][_0xb548('0x76')][_0xb548('0x64')](',');var _0xafa52d={};_0xafa52d[_0x9ed3fb[0x0]]={'$gte':moment(_0x9ed3fb[0x1])[_0xb548('0xbb')](_0xb548('0xbc'))};_0x437917[_0xb548('0x43')]=_[_0xb548('0xbd')](_0x437917[_0xb548('0x43')],_0xafa52d);}_0x437917=_[_0xb548('0xbd')]({},_0x437917,_0x1d54c3[_0xb548('0xbe')]);return db[_0xb548('0xb5')][_0xb548('0x23')]({'where':_0x437917[_0xb548('0x43')]})[_0xb548('0x27')](function(_0x5dba8e){_0x2bf77c[_0xb548('0x23')]=_0x5dba8e;if(_0x1d54c3['query'][_0xb548('0xb1')]){_0x437917[_0xb548('0xb2')]=[{'all':!![]}];}return db[_0xb548('0xb5')]['findAll'](_0x437917);})[_0xb548('0x27')](function(_0x4a42c6){_0x2bf77c[_0xb548('0xae')]=_0x4a42c6;return _0x2bf77c;});}})[_0xb548('0x27')](respondWithFilteredResult(_0x1da0cf,_0x437917))['catch'](handleError(_0x1da0cf,null));};exports[_0xb548('0xbf')]=function(_0x483412,_0x34a070,_0x668914){return db[_0xb548('0x34')]['find']({'where':{'id':_0x483412[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x34a070,null))[_0xb548('0x27')](function(_0x3e9c68){if(_0x3e9c68){return _0x3e9c68[_0xb548('0xc0')](_0x483412[_0xb548('0x71')][_0xb548('0xb7')],_[_0xb548('0xb8')](_0x483412['body'],[_0xb548('0xb7'),'id'])||{})[_0xb548('0xc1')](function(){return db[_0xb548('0x6b')][_0xb548('0xc2')]({'attributes':['id',_0xb548('0x2b'),_0xb548('0x48')],'where':{'id':_0x483412[_0xb548('0x71')]['ids']}});})[_0xb548('0x27')](function(_0x5a27de){socket[_0xb548('0xc3')](_0xb548('0xc4'),{'id':Number(_0x483412['params']['id']),'tags':_0x5a27de||[]});return{'id':Number(_0x483412[_0xb548('0xb0')]['id']),'tags':_0x5a27de||[]};});}})[_0xb548('0x27')](respondWithResult(_0x34a070,null))[_0xb548('0x32')](handleError(_0x34a070,null));};exports['removeTags']=function(_0x8d7a11,_0xbc2e38,_0x3dc285){return db[_0xb548('0x34')]['find']({'where':{'id':_0x8d7a11[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0xbc2e38,null))[_0xb548('0x27')](function(_0x5dc36d){if(_0x5dc36d){return _0x5dc36d[_0xb548('0xc5')](_0x8d7a11['query']['ids']);}})[_0xb548('0x27')](respondWithStatusCode(_0xbc2e38,null))['catch'](handleError(_0xbc2e38,null));};exports['download']=function(_0x2b13ad,_0x4811cf){var _0x496914=moment()[_0xb548('0xc6')]()[_0xb548('0x95')]();var _0x2b0873=path[_0xb548('0xc7')](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xca'),'tmp');var _0x351c63=path[_0xb548('0xc7')](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xca'),_0xb548('0xcb'));var _0x55f69b=path[_0xb548('0xc7')](_0x2b0873,_0x496914);var _0x52ac70=util[_0xb548('0xbb')](_0xb548('0xcc'),_0x2b13ad[_0xb548('0xb0')]['id'],_0x496914);var _0x550d34=path[_0xb548('0xc7')](_0x2b0873,_0x52ac70);var _0x2fabb0=[];_0x2fabb0[_0xb548('0xac')]({'model':db[_0xb548('0x6e')],'as':_0xb548('0x6e'),'attributes':['id',_0xb548('0x2e')],'raw':!![]});_0x2fabb0[_0xb548('0xac')]({'model':db[_0xb548('0xcd')],'as':_0xb548('0x61'),'attributes':['id','firstName',_0xb548('0xce')],'raw':!![]});if(_0x2b13ad[_0xb548('0x3b')]['attachments']){_0x2fabb0[_0xb548('0xac')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x9c829b=[{'model':db['WhatsappMessage'],'as':_0xb548('0xcf'),'attributes':['id','body',_0xb548('0x74'),_0xb548('0xd0'),'secret',_0xb548('0x7b')],'include':_0x2fabb0}];_0x9c829b[_0xb548('0xac')]({'model':db['WhatsappAccount'],'as':_0xb548('0xd1'),'attributes':['id','name']});_0x9c829b['push']({'model':db[_0xb548('0x6e')],'as':_0xb548('0xd2'),'attributes':['id',_0xb548('0x2e')]});return db[_0xb548('0x34')][_0xb548('0x5b')]({'where':{'id':_0x2b13ad[_0xb548('0xb0')]['id']},'include':_0x9c829b})['then'](handleEntityNotFound(_0x4811cf,null))[_0xb548('0x27')](function(_0x4e4693){if(_0x4e4693){var _0x361f8e=_0x4e4693[_0xb548('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x55f69b);var _0x15263c={'channel':_0xb548('0xd4'),'account':_0x361f8e['Account'][_0xb548('0x2b')],'agent':_0x361f8e[_0xb548('0xd2')]?_0x361f8e[_0xb548('0xd2')][_0xb548('0x2e')]:_0xb548('0xd5'),'createdAt':moment(_0x361f8e[_0xb548('0x74')])[_0xb548('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x361f8e[_0xb548('0xd6')]?moment(_0x361f8e[_0xb548('0xd7')])[_0xb548('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x361f8e[_0xb548('0xd8')],'messages':_(_0x361f8e[_0xb548('0xcf')])[_0xb548('0x80')]({'secret':![]})['map'](function(_0x210b6e){if(_0x210b6e['Attachment']){var _0x59c2b3=path[_0xb548('0xc7')](_0x351c63,_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')]);if(fs[_0xb548('0xdb')](_0x59c2b3)){fs[_0xb548('0xdc')](_0x59c2b3)['pipe'](fs[_0xb548('0xdd')](path[_0xb548('0xc7')](_0x55f69b,_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')])));}}return{'date':moment(_0x210b6e['createdAt'])['format'](_0xb548('0xbc'))[_0xb548('0x95')](),'sender':_0x210b6e[_0xb548('0xd0')]===_0xb548('0xde')?_0x210b6e[_0xb548('0x6e')]?_0x210b6e['User'][_0xb548('0x2e')]:_0xb548('0xdf'):_0x210b6e[_0xb548('0x61')]['firstName']+(_0x210b6e['Contact'][_0xb548('0xce')]?'\x20'+_0x210b6e[_0xb548('0x61')][_0xb548('0xce')]:''),'body':_0x210b6e[_0xb548('0xd9')]?_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')]:_0x210b6e[_0xb548('0x71')],'direction':_0x210b6e[_0xb548('0xd0')]===_0xb548('0xde')?'A':'C','secret':_0x210b6e[_0xb548('0xe0')],'read':_0x210b6e['read'],'attachment':_0x210b6e[_0xb548('0xd9')]};})[_0xb548('0x5d')]()};return ejs[_0xb548('0xe1')](path['join'](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xe2'),_0xb548('0xe3')),{'interaction':_0x15263c})[_0xb548('0x27')](function(_0x58bec7){var _0x5ef924=path[_0xb548('0xc7')](_0x55f69b,_0xb548('0xe4')+_0x361f8e['id']+'-'+_0x496914+_0xb548('0xe5'));var _0x2e3a55={'path':_0x5ef924,'channel':_0xb548('0xd4'),'interactionId':_0x361f8e['id']};return pdf[_0xb548('0xe6')](_0x58bec7,_0x2e3a55);})[_0xb548('0x27')](function(){return new BPromise(function(_0x2efad4,_0x251ddb){zipdir(_0x55f69b,{'saveTo':_0x550d34},function(_0x14c288,_0x28e2fc){if(_0x14c288)return _0x251ddb(_0x14c288);return _0x2efad4(_0x28e2fc);});})[_0xb548('0x27')](function(){return new BPromise(function(_0x1c2658,_0x1dde58){rimraf(_0x55f69b,function(_0x5592aa){if(_0x5592aa)_0x1dde58(_0x5592aa);return _0x1c2658();});});})[_0xb548('0x27')](function(){return _0x4811cf['download'](_0x550d34,_0x52ac70,function(_0x19a3a0){if(_0x19a3a0){console[_0xb548('0xe7')]('err',_0x19a3a0);}else{fs['unlinkSync'](_0x550d34);}});});});}else{return _0x4811cf['sendStatus'](0xc8);}})['catch'](handleError(_0x4811cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 5f7046f..f01cbbc 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 _0x0647=['catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','getUsers','then','Users','map','unreadMessages','length','emit'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x0647,0xd0));var _0x7064=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0647[_0x278e3c];return _0x3e2d9b;};'use strict';var EventEmitter=require(_0x7064('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x7064('0x1')];var WhatsappMessage=require(_0x7064('0x2'))['db'][_0x7064('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7064('0x4')](0x0);var events={'afterCreate':_0x7064('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x313dce){return function(_0x34b4d5,_0x31f6a6,_0x44b1bb){_0x34b4d5[_0x7064('0x6')]({'attributes':['id'],'raw':!![]})[_0x7064('0x7')](function(_0x58186b){_0x34b4d5['setDataValue'](_0x7064('0x8'),_0x58186b[_0x7064('0x9')](function(_0x79229e){return{'id':_0x79229e['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x34b4d5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7064('0x7')](function(_0x3f3bdd){_0x34b4d5['setDataValue'](_0x7064('0xa'),_0x3f3bdd[_0x7064('0xb')]);WhatsappInteractionEvents[_0x7064('0xc')](_0x313dce+':'+_0x34b4d5['id'],_0x34b4d5);WhatsappInteractionEvents['emit'](_0x313dce,_0x34b4d5);_0x44b1bb(null);})[_0x7064('0xd')](_0x44b1bb(null));};}for(var e in events){if(events[_0x7064('0xe')](e)){var event=events[e];WhatsappInteraction[_0x7064('0xf')](e,emitEvent(event));}}module[_0x7064('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xea1a=['remove','then','setDataValue','map','findAll','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update'];(function(_0x27571a,_0x453c6e){var _0x2fc807=function(_0x3bacdc){while(--_0x3bacdc){_0x27571a['push'](_0x27571a['shift']());}};_0x2fc807(++_0x453c6e);}(_0xea1a,0x158));var _0xaea1=function(_0x4a71b3,_0x1b7610){_0x4a71b3=_0x4a71b3-0x0;var _0x501268=_0xea1a[_0x4a71b3];return _0x501268;};'use strict';var EventEmitter=require(_0xaea1('0x0'));var WhatsappInteraction=require(_0xaea1('0x1'))['db'][_0xaea1('0x2')];var WhatsappMessage=require(_0xaea1('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaea1('0x3')](0x0);var events={'afterCreate':_0xaea1('0x4'),'afterUpdate':_0xaea1('0x5'),'afterDestroy':_0xaea1('0x6')};function emitEvent(_0x3badb1){return function(_0x1676b5,_0x116caf,_0x246ebc){_0x1676b5['getUsers']({'attributes':['id'],'raw':!![]})[_0xaea1('0x7')](function(_0x8883ab){_0x1676b5[_0xaea1('0x8')]('Users',_0x8883ab[_0xaea1('0x9')](function(_0x553b92){return{'id':_0x553b92['id']};}));return WhatsappMessage[_0xaea1('0xa')]({'where':{'WhatsappInteractionId':_0x1676b5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x26fb87){_0x1676b5['setDataValue']('unreadMessages',_0x26fb87['length']);WhatsappInteractionEvents[_0xaea1('0xb')](_0x3badb1+':'+_0x1676b5['id'],_0x1676b5);WhatsappInteractionEvents['emit'](_0x3badb1,_0x1676b5);_0x246ebc(null);})['catch'](_0x246ebc(null));};}for(var e in events){if(events[_0xaea1('0xc')](e)){var event=events[e];WhatsappInteraction[_0xaea1('0xd')](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 f0b217a..cae94ec 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 _0x1e8c=['closed','closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x1c3d8a,_0x1a9ad2){var _0x14e6f4=function(_0x39f69d){while(--_0x39f69d){_0x1c3d8a['push'](_0x1c3d8a['shift']());}};_0x14e6f4(++_0x1a9ad2);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0x1e8c[_0x28f922];return _0x4eceac;};'use strict';var _=require('lodash');var util=require(_0xc1e8('0x0'));var logger=require(_0xc1e8('0x1'))(_0xc1e8('0x2'));var moment=require(_0xc1e8('0x3'));var BPromise=require(_0xc1e8('0x4'));var rp=require(_0xc1e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1e8('0x6'));var config=require(_0xc1e8('0x7'));var attributes=require(_0xc1e8('0x8'));module[_0xc1e8('0x9')]=function(_0x2547e3,_0x18613e){return _0x2547e3['define'](_0xc1e8('0xa'),attributes,{'tableName':_0xc1e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b5001,_0x48a012,_0x46c1c7){if(_0x3b5001[_0xc1e8('0xc')](_0xc1e8('0xd'))){_0x3b5001[_0xc1e8('0xe')]=moment()[_0xc1e8('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x46c1c7(null,_0x3b5001);}}});}; \ No newline at end of file +var _0x02b3=['./whatsappInteraction.attributes','exports','define','whatsapp_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5d0b7c,_0x90953a){var _0x6c6a1f=function(_0x3155f8){while(--_0x3155f8){_0x5d0b7c['push'](_0x5d0b7c['shift']());}};_0x6c6a1f(++_0x90953a);}(_0x02b3,0x9f));var _0x302b=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x02b3[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require(_0x302b('0x0'));var util=require(_0x302b('0x1'));var logger=require(_0x302b('0x2'))(_0x302b('0x3'));var moment=require(_0x302b('0x4'));var BPromise=require(_0x302b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x302b('0x6'));var rimraf=require(_0x302b('0x7'));var config=require(_0x302b('0x8'));var attributes=require(_0x302b('0x9'));module[_0x302b('0xa')]=function(_0x39db55,_0x428d7d){return _0x39db55[_0x302b('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x302b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x202a8b,_0x5a92b4,_0x418272){if(_0x202a8b['changed']('closed')){_0x202a8b['closedAt']=moment()['format'](_0x302b('0xd'));}_0x418272(null,_0x202a8b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4feb834..e337d62 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 _0xa5d7=['addTags','body','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','WhatsappInteraction','update','options','raw','attributes','limit','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0xa5d7,0x178));var _0x7a5d=function(_0x258e85,_0x4b77e5){_0x258e85=_0x258e85-0x0;var _0x5dc74a=_0xa5d7[_0x258e85];return _0x5dc74a;};'use strict';var _=require(_0x7a5d('0x0'));var util=require('util');var moment=require(_0x7a5d('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a5d('0x2'));var fs=require('fs');var Redis=require(_0x7a5d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a5d('0x4'));var logger=require(_0x7a5d('0x5'))(_0x7a5d('0x6'));var config=require(_0x7a5d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a5d('0x8')][_0x7a5d('0x9')]({'port':0x232a});config[_0x7a5d('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a5d('0xa')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x34a96e,_0xd31172,_0x34c57a){return new BPromise(function(_0x328b47,_0x15005b){return client[_0x7a5d('0xb')](_0x34a96e,_0x34c57a)[_0x7a5d('0xc')](function(_0xe1939a){logger['info'](_0x7a5d('0xd'),_0xd31172,'request\x20sent');logger[_0x7a5d('0xe')](_0x7a5d('0xf'),_0xd31172,_0x7a5d('0x10'),JSON['stringify'](_0xe1939a));if(_0xe1939a[_0x7a5d('0x11')]){if(_0xe1939a['error'][_0x7a5d('0x12')]===0x1f4){logger[_0x7a5d('0x11')](_0x7a5d('0xd'),_0xd31172,_0xe1939a[_0x7a5d('0x11')][_0x7a5d('0x13')]);return _0x15005b(_0xe1939a[_0x7a5d('0x11')][_0x7a5d('0x13')]);}logger[_0x7a5d('0x11')](_0x7a5d('0xd'),_0xd31172,_0xe1939a[_0x7a5d('0x11')][_0x7a5d('0x13')]);return _0x328b47(_0xe1939a[_0x7a5d('0x11')][_0x7a5d('0x13')]);}else{logger[_0x7a5d('0x14')](_0x7a5d('0xd'),_0xd31172,_0x7a5d('0x10'));_0x328b47(_0xe1939a['result'][_0x7a5d('0x13')]);}})[_0x7a5d('0x15')](function(_0x15154f){logger['error'](_0x7a5d('0xd'),_0xd31172,_0x15154f);_0x15005b(_0x15154f);});});}exports['UpdateWhatsappInteraction']=function(_0x72cd01){var _0xeeda6c=this;return new Promise(function(_0x17afa1,_0x361c88){return db[_0x7a5d('0x16')][_0x7a5d('0x17')](_0x72cd01['body'],{'raw':_0x72cd01[_0x7a5d('0x18')]?_0x72cd01['options'][_0x7a5d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x72cd01[_0x7a5d('0x18')]?_0x72cd01[_0x7a5d('0x18')]['where']||null:null,'attributes':_0x72cd01[_0x7a5d('0x18')]?_0x72cd01[_0x7a5d('0x18')][_0x7a5d('0x1a')]||null:null,'limit':_0x72cd01[_0x7a5d('0x18')]?_0x72cd01['options'][_0x7a5d('0x1b')]||null:null})[_0x7a5d('0xc')](function(_0x45d4e4){logger['info']('UpdateWhatsappInteraction',_0x72cd01);logger[_0x7a5d('0xe')](_0x7a5d('0x1c'),_0x72cd01,JSON[_0x7a5d('0x1d')](_0x45d4e4));_0x17afa1(_0x45d4e4);})[_0x7a5d('0x15')](function(_0x112845){logger[_0x7a5d('0x11')](_0x7a5d('0x1c'),_0x112845[_0x7a5d('0x13')],_0x72cd01);_0x361c88(_0xeeda6c[_0x7a5d('0x11')](0x1f4,_0x112845['message']));});});};exports[_0x7a5d('0x1e')]=function(_0x43e1a9){return new Promise(function(_0x26e403,_0x47465f){return db[_0x7a5d('0x16')]['find']({'where':_0x43e1a9[_0x7a5d('0x18')]?_0x43e1a9[_0x7a5d('0x18')]['where']||null:null})[_0x7a5d('0xc')](function(_0x30f540){if(_0x30f540){return _0x30f540[_0x7a5d('0x1f')](_0x43e1a9[_0x7a5d('0x20')][_0x7a5d('0x21')],_[_0x7a5d('0x22')](_0x43e1a9['body'],[_0x7a5d('0x21'),'id'])||{});}})[_0x7a5d('0x23')](function(_0x328444){logger[_0x7a5d('0x14')]('AddTags',_0x43e1a9);logger['debug'](_0x7a5d('0x24'),_0x43e1a9,JSON['stringify'](_0x328444));_0x26e403(_0x328444);})['catch'](function(_0x3d79bc){logger[_0x7a5d('0x11')](_0x7a5d('0x24'),_0x3d79bc['message'],_0x43e1a9);_0x47465f(_this['error'](0x1f4,_0x3d79bc[_0x7a5d('0x13')]));});});}; \ No newline at end of file +var _0xcccc=['options','raw','where','limit','then','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','update','body'];(function(_0x4f03ce,_0x5cb284){var _0x52acd1=function(_0x192bfc){while(--_0x192bfc){_0x4f03ce['push'](_0x4f03ce['shift']());}};_0x52acd1(++_0x5cb284);}(_0xcccc,0x8f));var _0xcccc=function(_0x49ebed,_0x2ed245){_0x49ebed=_0x49ebed-0x0;var _0x247194=_0xcccc[_0x49ebed];return _0x247194;};'use strict';var _=require(_0xcccc('0x0'));var util=require(_0xcccc('0x1'));var moment=require(_0xcccc('0x2'));var BPromise=require(_0xcccc('0x3'));var rs=require(_0xcccc('0x4'));var fs=require('fs');var Redis=require(_0xcccc('0x5'));var db=require(_0xcccc('0x6'))['db'];var utils=require(_0xcccc('0x7'));var logger=require(_0xcccc('0x8'))(_0xcccc('0x9'));var config=require('../../config/environment');var jayson=require(_0xcccc('0xa'));var client=jayson[_0xcccc('0xb')][_0xcccc('0xc')]({'port':0x232a});config[_0xcccc('0xd')]=_['defaults'](config[_0xcccc('0xd')],{'host':_0xcccc('0xe'),'port':0x18eb});var socket=require(_0xcccc('0xf'))(new Redis(config['redis']));require(_0xcccc('0x10'))[_0xcccc('0x11')](socket);function respondWithRpcPromise(_0x5f26be,_0x37633e,_0x46aacc){return new BPromise(function(_0x3204ad,_0x209ae8){return client[_0xcccc('0x12')](_0x5f26be,_0x46aacc)['then'](function(_0x109d0e){logger[_0xcccc('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,'request\x20sent');logger[_0xcccc('0x14')](_0xcccc('0x15'),_0x37633e,_0xcccc('0x16'),JSON[_0xcccc('0x17')](_0x109d0e));if(_0x109d0e[_0xcccc('0x18')]){if(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x19')]===0x1f4){logger[_0xcccc('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);return _0x209ae8(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);}logger[_0xcccc('0x18')](_0xcccc('0x1b'),_0x37633e,_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);return _0x3204ad(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);}else{logger[_0xcccc('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,_0xcccc('0x16'));_0x3204ad(_0x109d0e[_0xcccc('0x1c')]['message']);}})[_0xcccc('0x1d')](function(_0x115ee6){logger[_0xcccc('0x18')](_0xcccc('0x1b'),_0x37633e,_0x115ee6);_0x209ae8(_0x115ee6);});});}exports[_0xcccc('0x1e')]=function(_0x127b56){var _0x31f917=this;return new Promise(function(_0x551c3a,_0x5cb4b0){return db['WhatsappInteraction'][_0xcccc('0x1f')](_0x127b56[_0xcccc('0x20')],{'raw':_0x127b56[_0xcccc('0x21')]?_0x127b56[_0xcccc('0x21')][_0xcccc('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b56[_0xcccc('0x21')]?_0x127b56[_0xcccc('0x21')][_0xcccc('0x23')]||null:null,'attributes':_0x127b56[_0xcccc('0x21')]?_0x127b56['options']['attributes']||null:null,'limit':_0x127b56['options']?_0x127b56['options'][_0xcccc('0x24')]||null:null})[_0xcccc('0x25')](function(_0x5755cc){logger[_0xcccc('0x13')](_0xcccc('0x1e'),_0x127b56);logger[_0xcccc('0x14')](_0xcccc('0x1e'),_0x127b56,JSON[_0xcccc('0x17')](_0x5755cc));_0x551c3a(_0x5755cc);})[_0xcccc('0x1d')](function(_0x57bd3b){logger[_0xcccc('0x18')](_0xcccc('0x1e'),_0x57bd3b[_0xcccc('0x1a')],_0x127b56);_0x5cb4b0(_0x31f917[_0xcccc('0x18')](0x1f4,_0x57bd3b[_0xcccc('0x1a')]));});});};exports[_0xcccc('0x26')]=function(_0x56ab87){return new Promise(function(_0x4a8fd7,_0x111e11){return db[_0xcccc('0x27')]['find']({'where':_0x56ab87[_0xcccc('0x21')]?_0x56ab87[_0xcccc('0x21')][_0xcccc('0x23')]||null:null})[_0xcccc('0x25')](function(_0x5ec9bb){if(_0x5ec9bb){return _0x5ec9bb[_0xcccc('0x28')](_0x56ab87[_0xcccc('0x20')][_0xcccc('0x29')],_['omit'](_0x56ab87[_0xcccc('0x20')],[_0xcccc('0x29'),'id'])||{});}})[_0xcccc('0x2a')](function(_0x142b8c){logger[_0xcccc('0x13')](_0xcccc('0x2b'),_0x56ab87);logger['debug'](_0xcccc('0x2b'),_0x56ab87,JSON['stringify'](_0x142b8c));_0x4a8fd7(_0x142b8c);})[_0xcccc('0x1d')](function(_0x1e47f8){logger[_0xcccc('0x18')](_0xcccc('0x2b'),_0x1e47f8[_0xcccc('0x1a')],_0x56ab87);_0x111e11(_this[_0xcccc('0x18')](0x1f4,_0x1e47f8['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index b5f553c..47d9d68 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 _0x0e15=['register','length','whatsappInteraction:'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0e15,0x11d));var _0x50e1=function(_0xd830e6,_0x447f5c){_0xd830e6=_0xd830e6-0x0;var _0x1efea6=_0x0e15[_0xd830e6];return _0x1efea6;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove','update'];function createListener(_0xf74252,_0x2e8959){return function(_0x536f9a){_0x2e8959['emit'](_0xf74252,_0x536f9a);};}function removeListener(_0x197520,_0x415578){return function(){WhatsappInteractionEvents['removeListener'](_0x197520,_0x415578);};}exports[_0x50e1('0x0')]=function(_0x360b20){for(var _0x2fcb63=0x0,_0x1ce34b=events[_0x50e1('0x1')];_0x2fcb63<_0x1ce34b;_0x2fcb63++){var _0x8e6709=events[_0x2fcb63];var _0x5574b0=createListener(_0x50e1('0x2')+_0x8e6709,_0x360b20);WhatsappInteractionEvents['on'](_0x8e6709,_0x5574b0);}}; \ No newline at end of file +var _0xf2b4=['update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xf2b4,0xcd));var _0x4f2b=function(_0x492c19,_0x323efe){_0x492c19=_0x492c19-0x0;var _0x498a29=_0xf2b4[_0x492c19];return _0x498a29;};'use strict';var WhatsappInteractionEvents=require(_0x4f2b('0x0'));var events=[_0x4f2b('0x1'),_0x4f2b('0x2'),_0x4f2b('0x3')];function createListener(_0xa26222,_0x31f3b){return function(_0x5aa449){_0x31f3b[_0x4f2b('0x4')](_0xa26222,_0x5aa449);};}function removeListener(_0x24a219,_0x460d83){return function(){WhatsappInteractionEvents[_0x4f2b('0x5')](_0x24a219,_0x460d83);};}exports[_0x4f2b('0x6')]=function(_0x58dac5){for(var _0x2dd933=0x0,_0x2aa97e=events['length'];_0x2dd933<_0x2aa97e;_0x2dd933++){var _0x17d9ab=events[_0x2dd933];var _0x405bcb=createListener(_0x4f2b('0x7')+_0x17d9ab,_0x58dac5);WhatsappInteractionEvents['on'](_0x17d9ab,_0x405bcb);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 726aece..573ddaf 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 _0x6786=['./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x575783,_0x4f66f6){var _0x1aeae0=function(_0x3e05cb){while(--_0x3e05cb){_0x575783['push'](_0x575783['shift']());}};_0x1aeae0(++_0x4f66f6);}(_0x6786,0xdb));var _0x6678=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0x6786[_0x5b13c3];return _0x3d6780;};'use strict';var multer=require(_0x6678('0x0'));var util=require(_0x6678('0x1'));var path=require(_0x6678('0x2'));var timeout=require(_0x6678('0x3'));var express=require(_0x6678('0x4'));var router=express['Router']();var fs_extra=require(_0x6678('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6678('0x6'));router[_0x6678('0x7')]('/',auth[_0x6678('0x8')](),controller[_0x6678('0x9')]);router[_0x6678('0x7')](_0x6678('0xa'),auth[_0x6678('0x8')](),controller[_0x6678('0xb')]);router[_0x6678('0x7')]('/:id',auth[_0x6678('0x8')](),controller[_0x6678('0xc')]);router[_0x6678('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x6678('0xe'),_0x6678('0xf')),controller[_0x6678('0x10')]);router['post'](_0x6678('0x11'),controller[_0x6678('0x12')]);router[_0x6678('0x13')](_0x6678('0x14'),auth[_0x6678('0x8')](),controller['update']);router['put']('/:id/accept',auth[_0x6678('0x8')](),controller[_0x6678('0x15')]);router[_0x6678('0x13')](_0x6678('0x16'),auth['isAuthenticated'](),controller[_0x6678('0x17')]);router['delete'](_0x6678('0x14'),auth[_0x6678('0x8')](),controller['destroy']);module[_0x6678('0x18')]=router; \ No newline at end of file +var _0xd839=['whatsapp','whatsappmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','post'];(function(_0x435e4e,_0x1f9a86){var _0x1102b3=function(_0x12ba3a){while(--_0x12ba3a){_0x435e4e['push'](_0x435e4e['shift']());}};_0x1102b3(++_0x1f9a86);}(_0xd839,0x1a6));var _0x9d83=function(_0x4b4cfd,_0x46d47c){_0x4b4cfd=_0x4b4cfd-0x0;var _0x3cec3a=_0xd839[_0x4b4cfd];return _0x3cec3a;};'use strict';var multer=require(_0x9d83('0x0'));var util=require('util');var path=require(_0x9d83('0x1'));var timeout=require(_0x9d83('0x2'));var express=require(_0x9d83('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9d83('0x4'));var interaction=require(_0x9d83('0x5'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x9d83('0x6')]('/',auth[_0x9d83('0x7')](),controller[_0x9d83('0x8')]);router[_0x9d83('0x6')]('/describe',auth[_0x9d83('0x7')](),controller['describe']);router[_0x9d83('0x6')]('/:id',auth[_0x9d83('0x7')](),controller['show']);router[_0x9d83('0x9')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x9d83('0xa'),_0x9d83('0xb')),controller[_0x9d83('0xc')]);router[_0x9d83('0x9')](_0x9d83('0xd'),controller[_0x9d83('0xe')]);router['put'](_0x9d83('0xf'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x10')]);router[_0x9d83('0x11')](_0x9d83('0x12'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x13')]);router[_0x9d83('0x11')](_0x9d83('0x14'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x15')]);router[_0x9d83('0x16')](_0x9d83('0xf'),auth[_0x9d83('0x7')](),controller['destroy']);module[_0x9d83('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5d84077..fa8cfd3 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 _0xe4ce=['sequelize','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x5924e7,_0x5349ea){var _0x560ee5=function(_0xd92499){while(--_0xd92499){_0x5924e7['push'](_0x5924e7['shift']());}};_0x560ee5(++_0x5349ea);}(_0xe4ce,0x198));var _0xee4c=function(_0x3839ab,_0x543056){_0x3839ab=_0x3839ab-0x0;var _0x5a9722=_0xe4ce[_0x3839ab];return _0x5a9722;};'use strict';var Sequelize=require(_0xee4c('0x0'));module['exports']={'body':{'type':Sequelize[_0xee4c('0x1')](_0xee4c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xee4c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xee4c('0x4')),'defaultValue':_0xee4c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xee4c('0x5')](0xbe)},'phone':{'type':Sequelize[_0xee4c('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xee4c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xee4c('0x1')]}}; \ No newline at end of file +var _0xbbd8=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x11f67d,_0x38606d){var _0x1f4872=function(_0x2c4f49){while(--_0x2c4f49){_0x11f67d['push'](_0x11f67d['shift']());}};_0x1f4872(++_0x38606d);}(_0xbbd8,0x174));var _0x8bbd=function(_0x1fc96d,_0x258ddf){_0x1fc96d=_0x1fc96d-0x0;var _0x504006=_0xbbd8[_0x1fc96d];return _0x504006;};'use strict';var Sequelize=require(_0x8bbd('0x0'));module[_0x8bbd('0x1')]={'body':{'type':Sequelize[_0x8bbd('0x2')](_0x8bbd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8bbd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8bbd('0x5')),'defaultValue':_0x8bbd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8bbd('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8bbd('0x6')]},'readAt':{'type':Sequelize[_0x8bbd('0x7')]},'secret':{'type':Sequelize[_0x8bbd('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8bbd('0x6')]},'providerResponse':{'type':Sequelize[_0x8bbd('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index c151a1a..633dda3 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 _0x73bd=['jayson/promise','client','http','request','then','debug','stringify','error','code','message','info','result','WhatsappMessage,\x20%s,\x20%s','status','end','json','offset','limit','undefined','count','set','apply','update','destroy','sendStatus','name','send','index','map','WhatsappMessage','fieldName','model','query','filters','intersection','fields','attributes','length','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','whatsapp-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','event','accept','EventManager','whatsapp','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','User','SIP/%s','motionChannel','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./whatsappMessage.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73bd,0x6b));var _0xd73b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x73bd[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd73b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd73b('0x1'));var jsonpatch=require(_0xd73b('0x2'));var rp=require(_0xd73b('0x3'));var moment=require(_0xd73b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd73b('0x5'));var util=require(_0xd73b('0x6'));var path=require('path');var sox=require(_0xd73b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd73b('0x8'));var _=require(_0xd73b('0x9'));var squel=require(_0xd73b('0xa'));var crypto=require(_0xd73b('0xb'));var jsforce=require(_0xd73b('0xc'));var deskjs=require(_0xd73b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd73b('0xe'));var Papa=require(_0xd73b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd73b('0x10'));var as=require(_0xd73b('0x11'));var hardwareService=require(_0xd73b('0x12'));var logger=require(_0xd73b('0x13'))('api');var utils=require(_0xd73b('0x14'));var config=require(_0xd73b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd73b('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd73b('0x17'),'port':0x18eb});var socket=require(_0xd73b('0x18'))(new Redis(config[_0xd73b('0x19')]));require(_0xd73b('0x1a'))[_0xd73b('0x1b')](socket);var jayson=require(_0xd73b('0x1c'));var client=jayson[_0xd73b('0x1d')][_0xd73b('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xd73b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3cbfa6,_0x3fefaa,_0x3ab9fa,_0x15d491){return new BPromise(function(_0x5b9558,_0x163c64){var _0x45eb23=_0x15d491||client;return _0x45eb23[_0xd73b('0x1f')](_0x3cbfa6,_0x3ab9fa)[_0xd73b('0x20')](function(_0x53a909){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3fefaa,'request\x20sent');logger[_0xd73b('0x21')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3fefaa,'request\x20sent',JSON[_0xd73b('0x22')](_0x53a909));if(_0x53a909[_0xd73b('0x23')]){if(_0x53a909[_0xd73b('0x23')][_0xd73b('0x24')]===0x1f4){logger[_0xd73b('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3fefaa,_0x53a909[_0xd73b('0x23')][_0xd73b('0x25')]);return _0x163c64(_0x53a909['error']['message']);}logger[_0xd73b('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3fefaa,_0x53a909[_0xd73b('0x23')][_0xd73b('0x25')]);return _0x5b9558(_0x53a909[_0xd73b('0x23')][_0xd73b('0x25')]);}else{logger[_0xd73b('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x3fefaa,'request\x20sent');_0x5b9558(_0x53a909[_0xd73b('0x27')][_0xd73b('0x25')]);}})['catch'](function(_0x27f071){logger['error'](_0xd73b('0x28'),_0x3fefaa,_0x27f071);_0x163c64(_0x27f071);});});}function respondWithStatusCode(_0x5081c4,_0x41b090){_0x41b090=_0x41b090||0xcc;return function(_0x1b7505){if(_0x1b7505){return _0x5081c4['sendStatus'](_0x41b090);}return _0x5081c4[_0xd73b('0x29')](_0x41b090)[_0xd73b('0x2a')]();};}function respondWithResult(_0x1c5df8,_0x1ea0e6){_0x1ea0e6=_0x1ea0e6||0xc8;return function(_0x25204d){if(_0x25204d){return _0x1c5df8['status'](_0x1ea0e6)[_0xd73b('0x2b')](_0x25204d);}};}function respondWithFilteredResult(_0x3a2837,_0x2e9289){return function(_0xb6a6a2){if(_0xb6a6a2){var _0x2785e4=typeof _0x2e9289[_0xd73b('0x2c')]==='undefined'&&typeof _0x2e9289[_0xd73b('0x2d')]===_0xd73b('0x2e');var _0x19e166=_0xb6a6a2[_0xd73b('0x2f')];var _0x19f676=_0x2785e4?0x0:_0x2e9289[_0xd73b('0x2c')];var _0x576e3c=_0x2785e4?_0xb6a6a2['count']:_0x2e9289['offset']+_0x2e9289[_0xd73b('0x2d')];var _0x3e0e8d;if(_0x576e3c>=_0x19e166){_0x576e3c=_0x19e166;_0x3e0e8d=0xc8;}else{_0x3e0e8d=0xce;}_0x3a2837[_0xd73b('0x29')](_0x3e0e8d);return _0x3a2837[_0xd73b('0x30')]('Content-Range',_0x19f676+'-'+_0x576e3c+'/'+_0x19e166)['json'](_0xb6a6a2);}return null;};}function patchUpdates(_0x5d3f9e){return function(_0x147ad9){try{jsonpatch[_0xd73b('0x31')](_0x147ad9,_0x5d3f9e,!![]);}catch(_0x7a49b8){return BPromise['reject'](_0x7a49b8);}return _0x147ad9['save']();};}function saveUpdates(_0x5a3630,_0x42aeb6){return function(_0xb16eec){if(_0xb16eec){return _0xb16eec[_0xd73b('0x32')](_0x5a3630)[_0xd73b('0x20')](function(_0x5ee628){return _0x5ee628;});}return null;};}function removeEntity(_0x3513fd,_0x378076){return function(_0x147ad5){if(_0x147ad5){return _0x147ad5[_0xd73b('0x33')]()[_0xd73b('0x20')](function(){_0x3513fd['status'](0xcc)[_0xd73b('0x2a')]();});}};}function handleEntityNotFound(_0x192cce,_0xb3563){return function(_0x2852da){if(!_0x2852da){_0x192cce[_0xd73b('0x34')](0x194);}return _0x2852da;};}function handleError(_0x41a188,_0x1d42e3){_0x1d42e3=_0x1d42e3||0x1f4;return function(_0x2bdb4e){logger['error'](_0x2bdb4e['stack']);if(_0x2bdb4e['name']){delete _0x2bdb4e[_0xd73b('0x35')];}_0x41a188['status'](_0x1d42e3)[_0xd73b('0x36')](_0x2bdb4e);};}exports[_0xd73b('0x37')]=function(_0x1d9d08,_0x577e44){var _0x3b69ae={},_0x5886bf={},_0x44bd2e={'count':0x0,'rows':[]};var _0x418608=_[_0xd73b('0x38')](db[_0xd73b('0x39')]['rawAttributes'],function(_0x372147){return{'name':_0x372147[_0xd73b('0x3a')],'type':_0x372147['type']['key']};});_0x5886bf[_0xd73b('0x3b')]=_[_0xd73b('0x38')](_0x418608,_0xd73b('0x35'));_0x5886bf[_0xd73b('0x3c')]=_['keys'](_0x1d9d08[_0xd73b('0x3c')]);_0x5886bf[_0xd73b('0x3d')]=_[_0xd73b('0x3e')](_0x5886bf['model'],_0x5886bf['query']);_0x3b69ae['attributes']=_['intersection'](_0x5886bf[_0xd73b('0x3b')],qs[_0xd73b('0x3f')](_0x1d9d08['query']['fields']));_0x3b69ae[_0xd73b('0x40')]=_0x3b69ae['attributes'][_0xd73b('0x41')]?_0x3b69ae[_0xd73b('0x40')]:_0x5886bf[_0xd73b('0x3b')];if(!_0x1d9d08[_0xd73b('0x3c')]['hasOwnProperty']('nolimit')){_0x3b69ae[_0xd73b('0x2d')]=qs[_0xd73b('0x2d')](_0x1d9d08[_0xd73b('0x3c')][_0xd73b('0x2d')]);_0x3b69ae[_0xd73b('0x2c')]=qs[_0xd73b('0x2c')](_0x1d9d08[_0xd73b('0x3c')]['offset']);}_0x3b69ae[_0xd73b('0x42')]=qs[_0xd73b('0x43')](_0x1d9d08[_0xd73b('0x3c')][_0xd73b('0x43')]);_0x3b69ae['where']=qs[_0xd73b('0x3d')](_['pick'](_0x1d9d08[_0xd73b('0x3c')],_0x5886bf[_0xd73b('0x3d')]),_0x418608);if(_0x1d9d08[_0xd73b('0x3c')][_0xd73b('0x44')]){_0x3b69ae[_0xd73b('0x45')]=_[_0xd73b('0x46')](_0x3b69ae[_0xd73b('0x45')],{'$or':_[_0xd73b('0x38')](_0x418608,function(_0x374d2b){if(_0x374d2b[_0xd73b('0x47')]!==_0xd73b('0x48')){var _0x5b5efe={};_0x5b5efe[_0x374d2b[_0xd73b('0x35')]]={'$like':'%'+_0x1d9d08[_0xd73b('0x3c')][_0xd73b('0x44')]+'%'};return _0x5b5efe;}})});}_0x3b69ae=_[_0xd73b('0x46')]({},_0x3b69ae,_0x1d9d08['options']);var _0x582b35={'where':_0x3b69ae[_0xd73b('0x45')]};return db[_0xd73b('0x39')][_0xd73b('0x2f')](_0x582b35)[_0xd73b('0x20')](function(_0x39bb66){_0x44bd2e[_0xd73b('0x2f')]=_0x39bb66;if(_0x1d9d08['query'][_0xd73b('0x49')]){_0x3b69ae[_0xd73b('0x4a')]=[{'all':!![]}];}return db[_0xd73b('0x39')]['findAll'](_0x3b69ae);})['then'](function(_0x590948){_0x44bd2e[_0xd73b('0x4b')]=_0x590948;return _0x44bd2e;})['then'](respondWithFilteredResult(_0x577e44,_0x3b69ae))[_0xd73b('0x4c')](handleError(_0x577e44,null));};exports[_0xd73b('0x4d')]=function(_0x5c48c0,_0x4add6e){var _0x2c9fbd={'raw':!![],'where':{'id':_0x5c48c0['params']['id']}},_0x1ae6a4={};_0x1ae6a4[_0xd73b('0x3b')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x1ae6a4['query']=_[_0xd73b('0x4e')](_0x5c48c0['query']);_0x1ae6a4['filters']=_[_0xd73b('0x3e')](_0x1ae6a4['model'],_0x1ae6a4[_0xd73b('0x3c')]);_0x2c9fbd['attributes']=_['intersection'](_0x1ae6a4[_0xd73b('0x3b')],qs[_0xd73b('0x3f')](_0x5c48c0[_0xd73b('0x3c')][_0xd73b('0x3f')]));_0x2c9fbd[_0xd73b('0x40')]=_0x2c9fbd[_0xd73b('0x40')][_0xd73b('0x41')]?_0x2c9fbd[_0xd73b('0x40')]:_0x1ae6a4[_0xd73b('0x3b')];if(_0x5c48c0[_0xd73b('0x3c')]['includeAll']){_0x2c9fbd[_0xd73b('0x4a')]=[{'all':!![]}];}_0x2c9fbd=_[_0xd73b('0x46')]({},_0x2c9fbd,_0x5c48c0[_0xd73b('0x4f')]);return db[_0xd73b('0x39')][_0xd73b('0x50')](_0x2c9fbd)['then'](handleEntityNotFound(_0x4add6e,null))[_0xd73b('0x20')](respondWithResult(_0x4add6e,null))[_0xd73b('0x4c')](handleError(_0x4add6e,null));};exports[_0xd73b('0x51')]=function(_0x40c463,_0x59b68d){return db[_0xd73b('0x39')]['create'](_0x40c463[_0xd73b('0x52')],{})[_0xd73b('0x20')](respondWithResult(_0x59b68d,0xc9))[_0xd73b('0x4c')](handleError(_0x59b68d,null));};exports[_0xd73b('0x32')]=function(_0x4847bb,_0x192fcf){if(_0x4847bb[_0xd73b('0x52')]['id']){delete _0x4847bb[_0xd73b('0x52')]['id'];}return db[_0xd73b('0x39')][_0xd73b('0x50')]({'where':{'id':_0x4847bb[_0xd73b('0x53')]['id']}})[_0xd73b('0x20')](handleEntityNotFound(_0x192fcf,null))['then'](saveUpdates(_0x4847bb[_0xd73b('0x52')],null))[_0xd73b('0x20')](respondWithResult(_0x192fcf,null))[_0xd73b('0x4c')](handleError(_0x192fcf,null));};exports['destroy']=function(_0x463ce7,_0x4742d1){return db['WhatsappMessage'][_0xd73b('0x50')]({'where':{'id':_0x463ce7['params']['id']}})[_0xd73b('0x20')](handleEntityNotFound(_0x4742d1,null))['then'](removeEntity(_0x4742d1,null))[_0xd73b('0x4c')](handleError(_0x4742d1,null));};exports[_0xd73b('0x54')]=function(_0xb55c4a,_0x2381c9){return db[_0xd73b('0x39')][_0xd73b('0x54')]()['then'](respondWithResult(_0x2381c9,null))[_0xd73b('0x4c')](handleError(_0x2381c9,null));};var interaction_log=require('../../config/logger')(_0xd73b('0x55'));exports['accept']=function(_0x104d4e,_0x234fc2,_0x5abb86){var _0x45dcc5={'agent':{},'channel':'whatsapp'};if(_0x104d4e['body']['id']){delete _0x104d4e[_0xd73b('0x52')]['id'];}_0x104d4e[_0xd73b('0x52')]['read']=!![];_0x104d4e['body'][_0xd73b('0x56')]=moment()[_0xd73b('0x57')](_0xd73b('0x58'));_0x104d4e[_0xd73b('0x52')]['UserId']=_0x104d4e['body'][_0xd73b('0x59')]||_0x104d4e[_0xd73b('0x5a')]['id'];_0x45dcc5[_0xd73b('0x5b')]['id']=_0x104d4e[_0xd73b('0x52')]['UserId'];return db[_0xd73b('0x39')]['find']({'where':{'id':_0x104d4e['params']['id'],'UserId':null}})[_0xd73b('0x20')](handleEntityNotFound(_0x234fc2,null))[_0xd73b('0x20')](saveUpdates(_0x104d4e[_0xd73b('0x52')],null))[_0xd73b('0x20')](function(_0x251c20){if(_0x251c20){_0x45dcc5[_0xd73b('0x25')]=_0x251c20[_0xd73b('0x5c')]({'plain':!![]});return db[_0xd73b('0x5d')][_0xd73b('0x50')]({'where':{'id':_0x251c20[_0xd73b('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x234fc2,null))[_0xd73b('0x20')](function(_0x48183b){if(_0x48183b){return _0x48183b[_0xd73b('0x32')]({'UserId':_0x104d4e[_0xd73b('0x52')][_0xd73b('0x59')],'read1stAt':_[_0xd73b('0x5f')](_0x48183b[_0xd73b('0x60')])?moment()['format'](_0xd73b('0x58')):undefined});}return null;})[_0xd73b('0x20')](function(_0x365489){if(_0x365489){_0x45dcc5['interaction']=_0x365489[_0xd73b('0x5c')]({'plain':!![]});interaction_log[_0xd73b('0x26')](_0xd73b('0x61'),_0x104d4e['user']['id'],_0x104d4e[_0xd73b('0x5a')][_0xd73b('0x35')],_0x104d4e[_0xd73b('0x5a')][_0xd73b('0x62')],_0x45dcc5['interaction']['id'],_0x104d4e[_0xd73b('0x52')]?JSON[_0xd73b('0x22')](_0x104d4e[_0xd73b('0x52')]):_0xd73b('0x63'));return respondWithRpcPromise(_0xd73b('0x64'),'acceptMessage',_0x45dcc5);}return null;})[_0xd73b('0x20')](function(_0x17362b){var _0x253535='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17362b['message'][_0xd73b('0x65')];return db[_0xd73b('0x66')][_0xd73b('0x3c')](_0x253535,{'type':db['Sequelize'][_0xd73b('0x67')][_0xd73b('0x68')],'raw':!![]})['then'](function(_0x2ac055){return _0x2ac055;});})[_0xd73b('0x20')](function(_0x567a63){if(_0x567a63){_0x45dcc5[_0xd73b('0x25')][_0xd73b('0x69')]=_0x567a63[0x0];if(!_0x104d4e[_0xd73b('0x52')][_0xd73b('0x59')])return;return db['User'][_0xd73b('0x50')]({'where':{'id':_0x104d4e[_0xd73b('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0xd73b('0x35'),_0xd73b('0x6a'),_0xd73b('0x6b'),_0xd73b('0x6c')],'raw':!![]});}return null;})['then'](function(_0x3c6ae9){if(!_0x3c6ae9)return null;_0x45dcc5[_0xd73b('0x25')][_0xd73b('0x5b')]=_0x3c6ae9;return _0x45dcc5;})[_0xd73b('0x20')](function(_0x2c820e){if(_0x2c820e){if(_0x104d4e['body'][_0xd73b('0x6d')]){_0x45dcc5['message'][_0xd73b('0x6e')]=util[_0xd73b('0x57')]('SIP/%s',_0x104d4e[_0xd73b('0x5a')][_0xd73b('0x35')]);_0x45dcc5[_0xd73b('0x25')][_0xd73b('0x6f')]=_0x45dcc5['channel'];_0x45dcc5[_0xd73b('0x25')]['motionChannel']=_0x45dcc5[_0xd73b('0x6f')];_0x45dcc5['message'][_0xd73b('0x70')]=_0xd73b('0x71');return respondWithRpcPromise(_0xd73b('0x72'),_0xd73b('0x72'),{'event':'acceptmessage','message':_0x45dcc5[_0xd73b('0x25')]},client9002)[_0xd73b('0x20')](function(){return _0x45dcc5;});}return _0x45dcc5;}return null;})[_0xd73b('0x20')](respondWithResult(_0x234fc2,null))[_0xd73b('0x4c')](handleError(_0x234fc2,null));};var interaction_log=require(_0xd73b('0x13'))(_0xd73b('0x55'));exports['reject']=function(_0x572709,_0x2fa1a0,_0x5e5ffd){var _0x3786d8={'agent':{},'channel':_0xd73b('0x73')};if(_0x572709[_0xd73b('0x52')]['id']){delete _0x572709[_0xd73b('0x52')]['id'];}_0x572709[_0xd73b('0x52')][_0xd73b('0x59')]=_0x572709[_0xd73b('0x52')][_0xd73b('0x59')]||_0x572709[_0xd73b('0x5a')]['id'];_0x3786d8[_0xd73b('0x5b')]['id']=_0x572709[_0xd73b('0x52')][_0xd73b('0x59')];return db[_0xd73b('0x39')][_0xd73b('0x50')]({'where':{'id':_0x572709[_0xd73b('0x53')]['id'],'UserId':null}})[_0xd73b('0x20')](handleEntityNotFound(_0x2fa1a0,null))[_0xd73b('0x20')](function(_0xccb778){if(_0xccb778){_0x3786d8[_0xd73b('0x25')]=_0xccb778[_0xd73b('0x5c')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0xccb778[_0xd73b('0x5e')]}});}return null;})[_0xd73b('0x20')](handleEntityNotFound(_0x2fa1a0,null))['then'](function(_0x3fb0b3){if(_0x3fb0b3){_0x3786d8[_0xd73b('0x74')]=_0x3fb0b3[_0xd73b('0x5c')]({'plain':!![]});interaction_log[_0xd73b('0x26')](_0xd73b('0x75'),_0x572709[_0xd73b('0x5a')]['id'],_0x572709['user']['name'],_0x572709['user'][_0xd73b('0x62')],_0x3786d8['interaction']['id'],_0x572709[_0xd73b('0x52')]?JSON[_0xd73b('0x22')](_0x572709[_0xd73b('0x52')]):'null');return respondWithRpcPromise(_0xd73b('0x76'),'rejectMessage',_0x3786d8);}return null;})['then'](function(_0x39c0e4){var _0x308d8b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39c0e4[_0xd73b('0x25')][_0xd73b('0x65')];return db[_0xd73b('0x66')][_0xd73b('0x3c')](_0x308d8b,{'type':db[_0xd73b('0x77')]['QueryTypes'][_0xd73b('0x68')],'raw':!![]})['then'](function(_0x23bfd3){return _0x23bfd3;});})['then'](function(_0x330f61){if(_0x330f61){_0x3786d8[_0xd73b('0x25')]['contact']=_0x330f61[0x0];if(!_0x572709[_0xd73b('0x52')][_0xd73b('0x59')])return;return db[_0xd73b('0x78')][_0xd73b('0x50')]({'where':{'id':_0x572709[_0xd73b('0x52')]['UserId'],'role':_0xd73b('0x5b')},'attributes':['id',_0xd73b('0x35'),'fullname',_0xd73b('0x6b'),_0xd73b('0x6c')],'raw':!![]});}return null;})[_0xd73b('0x20')](function(_0x3f19ef){if(!_0x3f19ef)return null;_0x3786d8['message'][_0xd73b('0x5b')]=_0x3f19ef;return _0x3786d8;})['then'](function(_0x39e1e8){if(_0x39e1e8){_0x39e1e8[_0xd73b('0x25')]['interface']=util[_0xd73b('0x57')](_0xd73b('0x79'),_0x572709['user'][_0xd73b('0x35')]);_0x39e1e8['message'][_0xd73b('0x6f')]=_0x3786d8[_0xd73b('0x6f')];_0x39e1e8['message'][_0xd73b('0x7a')]=_0x3786d8[_0xd73b('0x6f')];_0x39e1e8['message'][_0xd73b('0x70')]=_0xd73b('0x7b');respondWithRpcPromise(_0xd73b('0x72'),_0xd73b('0x72'),{'event':_0xd73b('0x7c'),'message':_0x39e1e8[_0xd73b('0x25')]},client9002);return _0x3786d8;}return null;})[_0xd73b('0x20')](respondWithResult(_0x2fa1a0,null))[_0xd73b('0x4c')](handleError(_0x2fa1a0,null));};exports[_0xd73b('0x29')]=function(_0x2c07c6,_0x28efd0,_0x137ec8){if(_0x2c07c6[_0xd73b('0x52')]['id']){delete _0x2c07c6[_0xd73b('0x52')]['id'];}var _0x1ea584;return db[_0xd73b('0x39')]['find']({'where':{'id':_0x2c07c6[_0xd73b('0x53')]['id']}})['then'](handleEntityNotFound(_0x28efd0,null))[_0xd73b('0x20')](function(_0x4d6d49){if(_0x4d6d49){_0x1ea584=_0x4d6d49;return db[_0xd73b('0x7d')][_0xd73b('0x50')]({'where':{'id':_0x4d6d49[_0xd73b('0x7e')]}});}})[_0xd73b('0x20')](handleEntityNotFound(_0x28efd0,null))[_0xd73b('0x20')](function(_0x4fdca0){if(_0x4fdca0){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0xd73b('0x7f'),_0x4fdca0['type'],util['inspect'](_0x2c07c6['body'],{'showHidden':![],'depth':null}));switch(_0x4fdca0['type']){case'twilio':if(_0x2c07c6['body'][_0xd73b('0x80')]&&_0x2c07c6['body']['MessageSid']===_0x1ea584[_0xd73b('0x81')]&&_0x2c07c6[_0xd73b('0x52')][_0xd73b('0x82')]&&_0x2c07c6[_0xd73b('0x52')][_0xd73b('0x82')]===_0xd73b('0x83')){return _0x1ea584[_0xd73b('0x32')]({'read':!![]});}else{logger['error'](_0xd73b('0x84'),'status',_0xd73b('0x85'),util[_0xd73b('0x86')](_0x2c07c6['body'],{'showHidden':![],'depth':null}));}break;}return _0x1ea584;}})['then'](respondWithResult(_0x28efd0,null))['catch'](handleError(_0x28efd0,null));}; \ No newline at end of file +var _0x87cb=['role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','fullname','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','include','findAll','rows','show','params','options','create','body','find','destroy','describe','whatsapp-interactions','whatsapp','readAt','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x87cb,0xaa));var _0xb87c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x87cb[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require(_0xb87c('0x3'));var rp=require(_0xb87c('0x4'));var moment=require(_0xb87c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb87c('0x6'));var path=require(_0xb87c('0x7'));var sox=require(_0xb87c('0x8'));var csv=require(_0xb87c('0x9'));var ejs=require(_0xb87c('0xa'));var fs=require('fs');var fs_extra=require(_0xb87c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb87c('0xc'));var jsforce=require(_0xb87c('0xd'));var deskjs=require(_0xb87c('0xe'));var toCsv=require(_0xb87c('0x9'));var querystring=require(_0xb87c('0xf'));var Papa=require('papaparse');var Redis=require(_0xb87c('0x10'));var authService=require(_0xb87c('0x11'));var qs=require(_0xb87c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb87c('0x13'));var logger=require(_0xb87c('0x14'))(_0xb87c('0x15'));var utils=require(_0xb87c('0x16'));var config=require(_0xb87c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb87c('0x18')]=_[_0xb87c('0x19')](config[_0xb87c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb87c('0x1a'))(new Redis(config[_0xb87c('0x18')]));require(_0xb87c('0x1b'))[_0xb87c('0x1c')](socket);var jayson=require(_0xb87c('0x1d'));var client=jayson[_0xb87c('0x1e')][_0xb87c('0x1f')]({'port':0x232c});var client9002=jayson[_0xb87c('0x1e')][_0xb87c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5016b0,_0x1bc036,_0x19b014,_0x24c7e0){return new BPromise(function(_0x8cb26c,_0x502127){var _0x3dc99c=_0x24c7e0||client;return _0x3dc99c['request'](_0x5016b0,_0x19b014)['then'](function(_0x2a64a9){logger[_0xb87c('0x20')](_0xb87c('0x21'),_0x1bc036,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1bc036,'request\x20sent',JSON[_0xb87c('0x22')](_0x2a64a9));if(_0x2a64a9['error']){if(_0x2a64a9[_0xb87c('0x23')][_0xb87c('0x24')]===0x1f4){logger['error'](_0xb87c('0x21'),_0x1bc036,_0x2a64a9[_0xb87c('0x23')]['message']);return _0x502127(_0x2a64a9['error'][_0xb87c('0x25')]);}logger[_0xb87c('0x23')](_0xb87c('0x21'),_0x1bc036,_0x2a64a9[_0xb87c('0x23')]['message']);return _0x8cb26c(_0x2a64a9[_0xb87c('0x23')]['message']);}else{logger[_0xb87c('0x20')](_0xb87c('0x21'),_0x1bc036,_0xb87c('0x26'));_0x8cb26c(_0x2a64a9[_0xb87c('0x27')][_0xb87c('0x25')]);}})[_0xb87c('0x28')](function(_0x38738e){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1bc036,_0x38738e);_0x502127(_0x38738e);});});}function respondWithStatusCode(_0x39a0c9,_0x270caf){_0x270caf=_0x270caf||0xcc;return function(_0x514c2a){if(_0x514c2a){return _0x39a0c9[_0xb87c('0x29')](_0x270caf);}return _0x39a0c9[_0xb87c('0x2a')](_0x270caf)[_0xb87c('0x2b')]();};}function respondWithResult(_0x4794b3,_0x53bb92){_0x53bb92=_0x53bb92||0xc8;return function(_0x2c0ebd){if(_0x2c0ebd){return _0x4794b3[_0xb87c('0x2a')](_0x53bb92)[_0xb87c('0x2c')](_0x2c0ebd);}};}function respondWithFilteredResult(_0x4d6c1f,_0x247576){return function(_0x10d80a){if(_0x10d80a){var _0x22171f=typeof _0x247576[_0xb87c('0x2d')]===_0xb87c('0x2e')&&typeof _0x247576['limit']==='undefined';var _0x2dad01=_0x10d80a[_0xb87c('0x2f')];var _0x1610f4=_0x22171f?0x0:_0x247576[_0xb87c('0x2d')];var _0x25ccb1=_0x22171f?_0x10d80a[_0xb87c('0x2f')]:_0x247576[_0xb87c('0x2d')]+_0x247576[_0xb87c('0x30')];var _0xd4938d;if(_0x25ccb1>=_0x2dad01){_0x25ccb1=_0x2dad01;_0xd4938d=0xc8;}else{_0xd4938d=0xce;}_0x4d6c1f[_0xb87c('0x2a')](_0xd4938d);return _0x4d6c1f['set']('Content-Range',_0x1610f4+'-'+_0x25ccb1+'/'+_0x2dad01)[_0xb87c('0x2c')](_0x10d80a);}return null;};}function patchUpdates(_0x30a056){return function(_0x4831a2){try{jsonpatch[_0xb87c('0x31')](_0x4831a2,_0x30a056,!![]);}catch(_0x209733){return BPromise[_0xb87c('0x32')](_0x209733);}return _0x4831a2[_0xb87c('0x33')]();};}function saveUpdates(_0x5df232,_0x54d6db){return function(_0x174c65){if(_0x174c65){return _0x174c65[_0xb87c('0x34')](_0x5df232)[_0xb87c('0x35')](function(_0x4aea22){return _0x4aea22;});}return null;};}function removeEntity(_0x128956,_0x49ac9e){return function(_0x3f7689){if(_0x3f7689){return _0x3f7689['destroy']()[_0xb87c('0x35')](function(){_0x128956[_0xb87c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b724,_0x5ea8f1){return function(_0xdfb600){if(!_0xdfb600){_0x48b724[_0xb87c('0x29')](0x194);}return _0xdfb600;};}function handleError(_0x562bb8,_0x2844ce){_0x2844ce=_0x2844ce||0x1f4;return function(_0x40e418){logger[_0xb87c('0x23')](_0x40e418[_0xb87c('0x36')]);if(_0x40e418[_0xb87c('0x37')]){delete _0x40e418[_0xb87c('0x37')];}_0x562bb8[_0xb87c('0x2a')](_0x2844ce)[_0xb87c('0x38')](_0x40e418);};}exports[_0xb87c('0x39')]=function(_0x3c9633,_0x3fb7e2){var _0xe801aa={},_0x26e21b={},_0x590a66={'count':0x0,'rows':[]};var _0x125c00=_['map'](db[_0xb87c('0x3a')][_0xb87c('0x3b')],function(_0x3c1686){return{'name':_0x3c1686[_0xb87c('0x3c')],'type':_0x3c1686[_0xb87c('0x3d')][_0xb87c('0x3e')]};});_0x26e21b[_0xb87c('0x3f')]=_['map'](_0x125c00,_0xb87c('0x37'));_0x26e21b[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x3c9633['query']);_0x26e21b[_0xb87c('0x42')]=_['intersection'](_0x26e21b[_0xb87c('0x3f')],_0x26e21b[_0xb87c('0x40')]);_0xe801aa[_0xb87c('0x43')]=_[_0xb87c('0x44')](_0x26e21b[_0xb87c('0x3f')],qs[_0xb87c('0x45')](_0x3c9633[_0xb87c('0x40')]['fields']));_0xe801aa[_0xb87c('0x43')]=_0xe801aa[_0xb87c('0x43')][_0xb87c('0x46')]?_0xe801aa['attributes']:_0x26e21b[_0xb87c('0x3f')];if(!_0x3c9633[_0xb87c('0x40')][_0xb87c('0x47')]('nolimit')){_0xe801aa[_0xb87c('0x30')]=qs[_0xb87c('0x30')](_0x3c9633[_0xb87c('0x40')][_0xb87c('0x30')]);_0xe801aa[_0xb87c('0x2d')]=qs[_0xb87c('0x2d')](_0x3c9633[_0xb87c('0x40')][_0xb87c('0x2d')]);}_0xe801aa['order']=qs[_0xb87c('0x48')](_0x3c9633[_0xb87c('0x40')]['sort']);_0xe801aa[_0xb87c('0x49')]=qs[_0xb87c('0x42')](_[_0xb87c('0x4a')](_0x3c9633[_0xb87c('0x40')],_0x26e21b['filters']),_0x125c00);if(_0x3c9633[_0xb87c('0x40')]['filter']){_0xe801aa[_0xb87c('0x49')]=_[_0xb87c('0x4b')](_0xe801aa[_0xb87c('0x49')],{'$or':_['map'](_0x125c00,function(_0x110538){if(_0x110538['type']!=='VIRTUAL'){var _0x99da7a={};_0x99da7a[_0x110538['name']]={'$like':'%'+_0x3c9633['query']['filter']+'%'};return _0x99da7a;}})});}_0xe801aa=_[_0xb87c('0x4b')]({},_0xe801aa,_0x3c9633['options']);var _0x100419={'where':_0xe801aa[_0xb87c('0x49')]};return db[_0xb87c('0x3a')][_0xb87c('0x2f')](_0x100419)[_0xb87c('0x35')](function(_0x5bab30){_0x590a66[_0xb87c('0x2f')]=_0x5bab30;if(_0x3c9633['query']['includeAll']){_0xe801aa[_0xb87c('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb87c('0x4d')](_0xe801aa);})['then'](function(_0x4cb04a){_0x590a66[_0xb87c('0x4e')]=_0x4cb04a;return _0x590a66;})['then'](respondWithFilteredResult(_0x3fb7e2,_0xe801aa))[_0xb87c('0x28')](handleError(_0x3fb7e2,null));};exports[_0xb87c('0x4f')]=function(_0x213eff,_0x1c661a){var _0x461e30={'raw':!![],'where':{'id':_0x213eff[_0xb87c('0x50')]['id']}},_0x55ba81={};_0x55ba81[_0xb87c('0x3f')]=_['keys'](db[_0xb87c('0x3a')][_0xb87c('0x3b')]);_0x55ba81[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x213eff[_0xb87c('0x40')]);_0x55ba81[_0xb87c('0x42')]=_[_0xb87c('0x44')](_0x55ba81[_0xb87c('0x3f')],_0x55ba81[_0xb87c('0x40')]);_0x461e30[_0xb87c('0x43')]=_['intersection'](_0x55ba81[_0xb87c('0x3f')],qs['fields'](_0x213eff[_0xb87c('0x40')][_0xb87c('0x45')]));_0x461e30[_0xb87c('0x43')]=_0x461e30[_0xb87c('0x43')][_0xb87c('0x46')]?_0x461e30['attributes']:_0x55ba81['model'];if(_0x213eff[_0xb87c('0x40')]['includeAll']){_0x461e30[_0xb87c('0x4c')]=[{'all':!![]}];}_0x461e30=_[_0xb87c('0x4b')]({},_0x461e30,_0x213eff[_0xb87c('0x51')]);return db[_0xb87c('0x3a')]['find'](_0x461e30)[_0xb87c('0x35')](handleEntityNotFound(_0x1c661a,null))[_0xb87c('0x35')](respondWithResult(_0x1c661a,null))['catch'](handleError(_0x1c661a,null));};exports['create']=function(_0x23de79,_0x15637b){return db[_0xb87c('0x3a')][_0xb87c('0x52')](_0x23de79[_0xb87c('0x53')],{})[_0xb87c('0x35')](respondWithResult(_0x15637b,0xc9))[_0xb87c('0x28')](handleError(_0x15637b,null));};exports[_0xb87c('0x34')]=function(_0x4c443b,_0x32a4a0){if(_0x4c443b[_0xb87c('0x53')]['id']){delete _0x4c443b[_0xb87c('0x53')]['id'];}return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x4c443b[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x32a4a0,null))[_0xb87c('0x35')](saveUpdates(_0x4c443b[_0xb87c('0x53')],null))[_0xb87c('0x35')](respondWithResult(_0x32a4a0,null))['catch'](handleError(_0x32a4a0,null));};exports[_0xb87c('0x55')]=function(_0x254fa5,_0x17149d){return db[_0xb87c('0x3a')]['find']({'where':{'id':_0x254fa5[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x17149d,null))[_0xb87c('0x35')](removeEntity(_0x17149d,null))[_0xb87c('0x28')](handleError(_0x17149d,null));};exports[_0xb87c('0x56')]=function(_0x1eb9ee,_0x35f331){return db[_0xb87c('0x3a')][_0xb87c('0x56')]()['then'](respondWithResult(_0x35f331,null))[_0xb87c('0x28')](handleError(_0x35f331,null));};var interaction_log=require(_0xb87c('0x14'))(_0xb87c('0x57'));exports['accept']=function(_0x577564,_0x2efade,_0x1201b0){var _0x2a5bd2={'agent':{},'channel':_0xb87c('0x58')};if(_0x577564[_0xb87c('0x53')]['id']){delete _0x577564['body']['id'];}_0x577564[_0xb87c('0x53')]['read']=!![];_0x577564[_0xb87c('0x53')][_0xb87c('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x577564['body'][_0xb87c('0x5a')]=_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')]||_0x577564[_0xb87c('0x5b')]['id'];_0x2a5bd2[_0xb87c('0x5c')]['id']=_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')];return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x577564[_0xb87c('0x50')]['id'],'UserId':null}})[_0xb87c('0x35')](handleEntityNotFound(_0x2efade,null))[_0xb87c('0x35')](saveUpdates(_0x577564[_0xb87c('0x53')],null))[_0xb87c('0x35')](function(_0x384de0){if(_0x384de0){_0x2a5bd2[_0xb87c('0x25')]=_0x384de0['get']({'plain':!![]});return db[_0xb87c('0x5d')][_0xb87c('0x54')]({'where':{'id':_0x384de0[_0xb87c('0x5e')]}});}return null;})[_0xb87c('0x35')](handleEntityNotFound(_0x2efade,null))['then'](function(_0x136c66){if(_0x136c66){return _0x136c66[_0xb87c('0x34')]({'UserId':_0x577564['body'][_0xb87c('0x5a')],'read1stAt':_[_0xb87c('0x5f')](_0x136c66[_0xb87c('0x60')])?moment()[_0xb87c('0x61')](_0xb87c('0x62')):undefined});}return null;})[_0xb87c('0x35')](function(_0x77ed7){if(_0x77ed7){_0x2a5bd2[_0xb87c('0x63')]=_0x77ed7[_0xb87c('0x64')]({'plain':!![]});interaction_log[_0xb87c('0x20')](_0xb87c('0x65'),_0x577564[_0xb87c('0x5b')]['id'],_0x577564[_0xb87c('0x5b')][_0xb87c('0x37')],_0x577564[_0xb87c('0x5b')][_0xb87c('0x66')],_0x2a5bd2[_0xb87c('0x63')]['id'],_0x577564[_0xb87c('0x53')]?JSON[_0xb87c('0x22')](_0x577564[_0xb87c('0x53')]):_0xb87c('0x67'));return respondWithRpcPromise('AcceptMessage',_0xb87c('0x68'),_0x2a5bd2);}return null;})[_0xb87c('0x35')](function(_0x162f48){var _0x427130=_0xb87c('0x69')+_0x162f48['message'][_0xb87c('0x6a')];return db[_0xb87c('0x6b')][_0xb87c('0x40')](_0x427130,{'type':db[_0xb87c('0x6c')][_0xb87c('0x6d')][_0xb87c('0x6e')],'raw':!![]})[_0xb87c('0x35')](function(_0x20c817){return _0x20c817;});})['then'](function(_0x77b694){if(_0x77b694){_0x2a5bd2[_0xb87c('0x25')]['contact']=_0x77b694[0x0];if(!_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')])return;return db[_0xb87c('0x6f')]['find']({'where':{'id':_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')],'role':'agent'},'attributes':['id','name','fullname',_0xb87c('0x70'),_0xb87c('0x71')],'raw':!![]});}return null;})['then'](function(_0x4c2fcc){if(!_0x4c2fcc)return null;_0x2a5bd2[_0xb87c('0x25')][_0xb87c('0x5c')]=_0x4c2fcc;return _0x2a5bd2;})['then'](function(_0x49a8b4){if(_0x49a8b4){if(_0x577564['body'][_0xb87c('0x72')]){_0x2a5bd2[_0xb87c('0x25')]['interface']=util[_0xb87c('0x61')](_0xb87c('0x73'),_0x577564['user'][_0xb87c('0x37')]);_0x2a5bd2['message']['channel']=_0x2a5bd2[_0xb87c('0x74')];_0x2a5bd2['message'][_0xb87c('0x75')]=_0x2a5bd2['channel'];_0x2a5bd2['message'][_0xb87c('0x76')]=_0xb87c('0x77');return respondWithRpcPromise(_0xb87c('0x78'),_0xb87c('0x78'),{'event':_0xb87c('0x79'),'message':_0x2a5bd2[_0xb87c('0x25')]},client9002)['then'](function(){return _0x2a5bd2;});}return _0x2a5bd2;}return null;})[_0xb87c('0x35')](respondWithResult(_0x2efade,null))[_0xb87c('0x28')](handleError(_0x2efade,null));};var interaction_log=require('../../config/logger')(_0xb87c('0x57'));exports[_0xb87c('0x32')]=function(_0x2bc759,_0x584ec4,_0x375759){var _0x20325f={'agent':{},'channel':_0xb87c('0x58')};if(_0x2bc759[_0xb87c('0x53')]['id']){delete _0x2bc759['body']['id'];}_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')]=_0x2bc759['body'][_0xb87c('0x5a')]||_0x2bc759[_0xb87c('0x5b')]['id'];_0x20325f[_0xb87c('0x5c')]['id']=_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')];return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x2bc759[_0xb87c('0x50')]['id'],'UserId':null}})[_0xb87c('0x35')](handleEntityNotFound(_0x584ec4,null))[_0xb87c('0x35')](function(_0x37b9f4){if(_0x37b9f4){_0x20325f[_0xb87c('0x25')]=_0x37b9f4[_0xb87c('0x64')]({'plain':!![]});return db[_0xb87c('0x5d')][_0xb87c('0x54')]({'where':{'id':_0x37b9f4[_0xb87c('0x5e')]}});}return null;})[_0xb87c('0x35')](handleEntityNotFound(_0x584ec4,null))[_0xb87c('0x35')](function(_0x1f1a32){if(_0x1f1a32){_0x20325f['interaction']=_0x1f1a32[_0xb87c('0x64')]({'plain':!![]});interaction_log[_0xb87c('0x20')](_0xb87c('0x7a'),_0x2bc759[_0xb87c('0x5b')]['id'],_0x2bc759[_0xb87c('0x5b')][_0xb87c('0x37')],_0x2bc759[_0xb87c('0x5b')]['role'],_0x20325f['interaction']['id'],_0x2bc759[_0xb87c('0x53')]?JSON[_0xb87c('0x22')](_0x2bc759[_0xb87c('0x53')]):'null');return respondWithRpcPromise('RejectMessage',_0xb87c('0x7b'),_0x20325f);}return null;})[_0xb87c('0x35')](function(_0x180744){var _0x5a0d01=_0xb87c('0x69')+_0x180744[_0xb87c('0x25')][_0xb87c('0x6a')];return db[_0xb87c('0x6b')][_0xb87c('0x40')](_0x5a0d01,{'type':db[_0xb87c('0x6c')][_0xb87c('0x6d')][_0xb87c('0x6e')],'raw':!![]})[_0xb87c('0x35')](function(_0x3bf2d9){return _0x3bf2d9;});})[_0xb87c('0x35')](function(_0x543484){if(_0x543484){_0x20325f[_0xb87c('0x25')][_0xb87c('0x7c')]=_0x543484[0x0];if(!_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')])return;return db['User'][_0xb87c('0x54')]({'where':{'id':_0x2bc759[_0xb87c('0x53')]['UserId'],'role':'agent'},'attributes':['id','name',_0xb87c('0x7d'),_0xb87c('0x70'),_0xb87c('0x71')],'raw':!![]});}return null;})[_0xb87c('0x35')](function(_0x4a3932){if(!_0x4a3932)return null;_0x20325f[_0xb87c('0x25')]['agent']=_0x4a3932;return _0x20325f;})['then'](function(_0x5aa6a7){if(_0x5aa6a7){_0x5aa6a7[_0xb87c('0x25')]['interface']=util[_0xb87c('0x61')]('SIP/%s',_0x2bc759['user'][_0xb87c('0x37')]);_0x5aa6a7['message']['channel']=_0x20325f[_0xb87c('0x74')];_0x5aa6a7[_0xb87c('0x25')][_0xb87c('0x75')]=_0x20325f[_0xb87c('0x74')];_0x5aa6a7['message']['event']=_0xb87c('0x32');respondWithRpcPromise('EventManager',_0xb87c('0x78'),{'event':_0xb87c('0x7e'),'message':_0x5aa6a7['message']},client9002);return _0x20325f;}return null;})[_0xb87c('0x35')](respondWithResult(_0x584ec4,null))[_0xb87c('0x28')](handleError(_0x584ec4,null));};exports[_0xb87c('0x2a')]=function(_0x38d5ca,_0x14d43b,_0x5054f5){if(_0x38d5ca[_0xb87c('0x53')]['id']){delete _0x38d5ca[_0xb87c('0x53')]['id'];}var _0x4555bc;return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x38d5ca[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x14d43b,null))[_0xb87c('0x35')](function(_0x465f24){if(_0x465f24){_0x4555bc=_0x465f24;return db['WhatsappAccount']['find']({'where':{'id':_0x465f24[_0xb87c('0x7f')]}});}})[_0xb87c('0x35')](handleEntityNotFound(_0x14d43b,null))[_0xb87c('0x35')](function(_0x1b994b){if(_0x1b994b){logger['debug'](_0xb87c('0x80'),_0xb87c('0x2a'),_0xb87c('0x81'),_0x1b994b[_0xb87c('0x3d')],util[_0xb87c('0x82')](_0x38d5ca['body'],{'showHidden':![],'depth':null}));switch(_0x1b994b[_0xb87c('0x3d')]){case _0xb87c('0x83'):if(_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x84')]&&_0x38d5ca[_0xb87c('0x53')]['MessageSid']===_0x4555bc[_0xb87c('0x85')]&&_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x86')]&&_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x86')]===_0xb87c('0x87')){return _0x4555bc['update']({'read':!![]});}else{logger[_0xb87c('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xb87c('0x83'),util[_0xb87c('0x82')](_0x38d5ca[_0xb87c('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x4555bc;}})[_0xb87c('0x35')](respondWithResult(_0x14d43b,null))[_0xb87c('0x28')](handleError(_0x14d43b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5838eb0..fa89ed4 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 _0xf7b4=['hook','exports','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4a3f56,_0xcf7839){var _0x31e385=function(_0x5bcaa3){while(--_0x5bcaa3){_0x4a3f56['push'](_0x4a3f56['shift']());}};_0x31e385(++_0xcf7839);}(_0xf7b4,0x152));var _0x4f7b=function(_0x17af33,_0xbd7fd7){_0x17af33=_0x17af33-0x0;var _0xccb817=_0xf7b4[_0x17af33];return _0xccb817;};'use strict';var EventEmitter=require(_0x4f7b('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4f7b('0x1')](0x0);var events={'afterCreate':_0x4f7b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21b85f){return function(_0x3e18fd,_0x2e0e51,_0x44f991){WhatsappMessageEvents[_0x4f7b('0x3')](_0x21b85f+':'+_0x3e18fd['id'],_0x3e18fd);WhatsappMessageEvents[_0x4f7b('0x3')](_0x21b85f,_0x3e18fd);_0x44f991(null);};}for(var e in events){if(events[_0x4f7b('0x4')](e)){var event=events[e];WhatsappMessage[_0x4f7b('0x5')](e,emitEvent(event));}}module[_0x4f7b('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x4af8=['emit','hasOwnProperty','exports','save','update','remove'];(function(_0x5c4a2d,_0x439f24){var _0x1db64c=function(_0x9ad14d){while(--_0x9ad14d){_0x5c4a2d['push'](_0x5c4a2d['shift']());}};_0x1db64c(++_0x439f24);}(_0x4af8,0x1ad));var _0x84af=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x4af8[_0x397cfb];return _0x15fed9;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84af('0x0'),'afterUpdate':_0x84af('0x1'),'afterDestroy':_0x84af('0x2')};function emitEvent(_0x1446d3){return function(_0x482825,_0x294e04,_0x83633){WhatsappMessageEvents['emit'](_0x1446d3+':'+_0x482825['id'],_0x482825);WhatsappMessageEvents[_0x84af('0x3')](_0x1446d3,_0x482825);_0x83633(null);};}for(var e in events){if(events[_0x84af('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x84af('0x5')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 6eef415..4f3b85b 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 _0xdf4b=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4'];(function(_0x56b928,_0x3ae2d7){var _0x2c7f45=function(_0x4bc9d2){while(--_0x4bc9d2){_0x56b928['push'](_0x56b928['shift']());}};_0x2c7f45(++_0x3ae2d7);}(_0xdf4b,0x88));var _0xbdf4=function(_0x3a58f1,_0x1610fc){_0x3a58f1=_0x3a58f1-0x0;var _0x2c62f7=_0xdf4b[_0x3a58f1];return _0x2c62f7;};'use strict';var _=require(_0xbdf4('0x0'));var util=require(_0xbdf4('0x1'));var logger=require('../../config/logger')(_0xbdf4('0x2'));var moment=require(_0xbdf4('0x3'));var BPromise=require(_0xbdf4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbdf4('0x5'));var attributes=require(_0xbdf4('0x6'));module[_0xbdf4('0x7')]=function(_0x2df14a,_0x5830c0){return _0x2df14a[_0xbdf4('0x8')](_0xbdf4('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xbdf4('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0xbdf4('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x475c5d,_0x5ab27b,_0xe300a){var _0x372bce=_0x2df14a['models'];var _0x58824f=_0x475c5d[_0xbdf4('0xc')]({'plain':!![]});if(_0x58824f[_0xbdf4('0xd')]['toLowerCase']()==='in'||_0x58824f[_0xbdf4('0xd')][_0xbdf4('0xe')]()===_0xbdf4('0xf')&&!_0x58824f[_0xbdf4('0x10')]&&!_[_0xbdf4('0x11')](_0x58824f['UserId'])){_0x372bce[_0xbdf4('0x12')][_0xbdf4('0x13')]({'where':{'id':_0x58824f[_0xbdf4('0x14')]}})[_0xbdf4('0x15')](function(_0x3a2f52){if(_0x3a2f52){_0x3a2f52[_0xbdf4('0x16')]({'lastMsgAt':_0x58824f[_0xbdf4('0x17')],'lastMsgDirection':_0x58824f[_0xbdf4('0xd')][_0xbdf4('0xe')]()});}})[_0xbdf4('0x18')](function(_0x5e1831){console[_0xbdf4('0x19')](_0x5e1831);});}if(_0x58824f[_0xbdf4('0xd')]===_0xbdf4('0xf')&&!_0x58824f[_0xbdf4('0x10')]){var _0x38f37b;_0x372bce['WhatsappAccount'][_0xbdf4('0x1a')]({'where':{'id':_0x58824f['WhatsappAccountId']},'raw':!![]})[_0xbdf4('0x15')](function(_0x24e11e){_0x38f37b=_0x24e11e;if(_0x38f37b&&_0x38f37b[_0xbdf4('0x1b')]){switch(_0x38f37b['type']){case'twilio':var _0x4168e4=require(_0xbdf4('0x1c'));if(_0x38f37b[_0xbdf4('0x1d')]&&_0x38f37b[_0xbdf4('0x1e')]&&_0x38f37b[_0xbdf4('0x1f')]){var _0x4d82f5=new _0x4168e4(_0x38f37b['accountSid'],_0x38f37b['authToken']);_0x4d82f5[_0xbdf4('0x20')][_0xbdf4('0x21')]({'body':_0x58824f[_0xbdf4('0xb')],'to':_0xbdf4('0x22')+_0x58824f['phone'],'from':_0xbdf4('0x22')+_0x38f37b[_0xbdf4('0x1f')],'statusCallback':_0x38f37b[_0xbdf4('0x23')]+_0xbdf4('0x24')+_0x58824f['id']+_0xbdf4('0x25')+_0x38f37b[_0xbdf4('0x26')]})['then'](function(_0x1dd1a7){if(_0x1dd1a7['sid']){return _0x475c5d[_0xbdf4('0x16')]({'messageId':_0x1dd1a7[_0xbdf4('0x27')]});}})[_0xbdf4('0x18')](function(_0xddb92f){logger['error'](_0xbdf4('0x28'),'afterCreate',_0xbdf4('0x1c'),util[_0xbdf4('0x29')](_0xddb92f,{'showHidden':![],'depth':null}));});}else{logger[_0xbdf4('0x19')](_0xbdf4('0x28'),'afterCreate',_0xbdf4('0x1c'),_0xbdf4('0x2a'));}break;}}})['finally'](function(){_0xe300a();});}else{_0xe300a();}}},'charset':_0xbdf4('0x2b'),'collate':_0xbdf4('0x2c')});}; \ No newline at end of file +var _0x32e6=['fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','createdAt','catch','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','/api/whatsapp/messages/','/status?token=','token','update','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','error','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId'];(function(_0x3d7365,_0x13ccfb){var _0x3d96ac=function(_0x24135e){while(--_0x24135e){_0x3d7365['push'](_0x3d7365['shift']());}};_0x3d96ac(++_0x13ccfb);}(_0x32e6,0x82));var _0x632e=function(_0x2c9d06,_0x2eb18c){_0x2c9d06=_0x2c9d06-0x0;var _0x2fef1b=_0x32e6[_0x2c9d06];return _0x2fef1b;};'use strict';var _=require(_0x632e('0x0'));var util=require(_0x632e('0x1'));var logger=require(_0x632e('0x2'))(_0x632e('0x3'));var moment=require(_0x632e('0x4'));var BPromise=require('bluebird');var rp=require(_0x632e('0x5'));var fs=require('fs');var path=require(_0x632e('0x6'));var rimraf=require(_0x632e('0x7'));var config=require('../../config/environment');var attributes=require(_0x632e('0x8'));module[_0x632e('0x9')]=function(_0x1abc27,_0x1d2800){return _0x1abc27[_0x632e('0xa')](_0x632e('0xb'),attributes,{'tableName':_0x632e('0xc'),'paranoid':![],'indexes':[{'name':_0x632e('0xd'),'fields':['messageId']},{'name':_0x632e('0xe'),'fields':[_0x632e('0xf')],'type':_0x632e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b8917,_0x582d06,_0x2b783c){var _0x10c92c=_0x1abc27[_0x632e('0x11')];var _0x4169db=_0x5b8917[_0x632e('0x12')]({'plain':!![]});if(_0x4169db[_0x632e('0x13')]['toLowerCase']()==='in'||_0x4169db[_0x632e('0x13')][_0x632e('0x14')]()===_0x632e('0x15')&&!_0x4169db[_0x632e('0x16')]&&!_[_0x632e('0x17')](_0x4169db[_0x632e('0x18')])){_0x10c92c[_0x632e('0x19')][_0x632e('0x1a')]({'where':{'id':_0x4169db['WhatsappInteractionId']}})[_0x632e('0x1b')](function(_0x13da4c){if(_0x13da4c){_0x13da4c['update']({'lastMsgAt':_0x4169db[_0x632e('0x1c')],'lastMsgDirection':_0x4169db[_0x632e('0x13')][_0x632e('0x14')]()});}})[_0x632e('0x1d')](function(_0x266df1){console['error'](_0x266df1);});}if(_0x4169db[_0x632e('0x13')]===_0x632e('0x15')&&!_0x4169db['secret']){var _0x244ad3;_0x10c92c['WhatsappAccount']['find']({'where':{'id':_0x4169db[_0x632e('0x1e')]},'raw':!![]})[_0x632e('0x1b')](function(_0x1996d6){_0x244ad3=_0x1996d6;if(_0x244ad3&&_0x244ad3[_0x632e('0x1f')]){switch(_0x244ad3[_0x632e('0x1f')]){case _0x632e('0x20'):var _0x1a83de=require(_0x632e('0x20'));if(_0x244ad3[_0x632e('0x21')]&&_0x244ad3[_0x632e('0x22')]&&_0x244ad3[_0x632e('0x23')]){var _0x439555=new _0x1a83de(_0x244ad3['accountSid'],_0x244ad3[_0x632e('0x22')]);_0x439555[_0x632e('0x24')]['create']({'body':_0x4169db[_0x632e('0xf')],'to':_0x632e('0x25')+_0x4169db[_0x632e('0x23')],'from':_0x632e('0x25')+_0x244ad3[_0x632e('0x23')],'statusCallback':_0x244ad3['remote']+_0x632e('0x26')+_0x4169db['id']+_0x632e('0x27')+_0x244ad3[_0x632e('0x28')]})['then'](function(_0x161198){if(_0x161198['sid']){return _0x5b8917[_0x632e('0x29')]({'messageId':_0x161198[_0x632e('0x2a')]});}})[_0x632e('0x1d')](function(_0x1fc947){logger['error'](_0x632e('0x2b'),'afterCreate','twilio',util[_0x632e('0x2c')](_0x1fc947,{'showHidden':![],'depth':null}));});}else{logger[_0x632e('0x2d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x632e('0x2e')](function(){_0x2b783c();});}else{_0x2b783c();}}},'charset':_0x632e('0x2f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ff3d9ed..54d47f0 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 _0xec67=['code','message','WhatsappMessage,\x20%s,\x20%s','result','WhatsappMessage','body','options','raw','debug','CreateWhatsappMessage','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','then','info','request\x20sent','stringify','error'];(function(_0x50bc62,_0x4c1800){var _0x3c11c4=function(_0x59bfd9){while(--_0x59bfd9){_0x50bc62['push'](_0x50bc62['shift']());}};_0x3c11c4(++_0x4c1800);}(_0xec67,0x122));var _0x7ec6=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0xec67[_0x337748];return _0x3bb03f;};'use strict';var _=require(_0x7ec6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7ec6('0x1'));var rs=require(_0x7ec6('0x2'));var fs=require('fs');var Redis=require(_0x7ec6('0x3'));var db=require(_0x7ec6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7ec6('0x5'));var config=require(_0x7ec6('0x6'));var jayson=require(_0x7ec6('0x7'));var client=jayson[_0x7ec6('0x8')][_0x7ec6('0x9')]({'port':0x232a});config[_0x7ec6('0xa')]=_[_0x7ec6('0xb')](config['redis'],{'host':_0x7ec6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ec6('0xa')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x14ecb5,_0x123900,_0x4ff181){return new BPromise(function(_0x80a5b1,_0x19ee4b){return client['request'](_0x14ecb5,_0x4ff181)[_0x7ec6('0xd')](function(_0x46b316){logger[_0x7ec6('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0x123900,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x123900,_0x7ec6('0xf'),JSON[_0x7ec6('0x10')](_0x46b316));if(_0x46b316[_0x7ec6('0x11')]){if(_0x46b316[_0x7ec6('0x11')][_0x7ec6('0x12')]===0x1f4){logger[_0x7ec6('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x123900,_0x46b316[_0x7ec6('0x11')][_0x7ec6('0x13')]);return _0x19ee4b(_0x46b316[_0x7ec6('0x11')][_0x7ec6('0x13')]);}logger[_0x7ec6('0x11')](_0x7ec6('0x14'),_0x123900,_0x46b316[_0x7ec6('0x11')]['message']);return _0x80a5b1(_0x46b316[_0x7ec6('0x11')]['message']);}else{logger['info'](_0x7ec6('0x14'),_0x123900,'request\x20sent');_0x80a5b1(_0x46b316[_0x7ec6('0x15')]['message']);}})['catch'](function(_0x5458a3){logger[_0x7ec6('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x123900,_0x5458a3);_0x19ee4b(_0x5458a3);});});}exports['CreateWhatsappMessage']=function(_0x1a1f93){var _0x4439bb=this;return new Promise(function(_0x142fb3,_0xbf7752){return db[_0x7ec6('0x16')]['create'](_0x1a1f93[_0x7ec6('0x17')],{'raw':_0x1a1f93[_0x7ec6('0x18')]?_0x1a1f93[_0x7ec6('0x18')][_0x7ec6('0x19')]===undefined?!![]:![]:!![]})[_0x7ec6('0xd')](function(_0x5b39e8){logger['info']('CreateWhatsappMessage',_0x1a1f93);logger[_0x7ec6('0x1a')]('CreateWhatsappMessage',_0x1a1f93,JSON[_0x7ec6('0x10')](_0x5b39e8));_0x142fb3(_0x5b39e8);})['catch'](function(_0x31138e){logger[_0x7ec6('0x11')](_0x7ec6('0x1b'),_0x31138e['message'],_0x1a1f93);_0xbf7752(_0x4439bb[_0x7ec6('0x11')](0x1f4,_0x31138e[_0x7ec6('0x13')]));});});}; \ No newline at end of file +var _0xdd75=['ioredis','../../mysqldb','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch','lodash','moment','bluebird','randomstring'];(function(_0x3724d1,_0x2f4c95){var _0x5700d5=function(_0x33bdbb){while(--_0x33bdbb){_0x3724d1['push'](_0x3724d1['shift']());}};_0x5700d5(++_0x2f4c95);}(_0xdd75,0x1be));var _0x5dd7=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xdd75[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x5dd7('0x0'));var util=require('util');var moment=require(_0x5dd7('0x1'));var BPromise=require(_0x5dd7('0x2'));var rs=require(_0x5dd7('0x3'));var fs=require('fs');var Redis=require(_0x5dd7('0x4'));var db=require(_0x5dd7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5dd7('0x6'));var config=require(_0x5dd7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dd7('0x8')]['http']({'port':0x232a});config[_0x5dd7('0x9')]=_['defaults'](config[_0x5dd7('0x9')],{'host':_0x5dd7('0xa'),'port':0x18eb});var socket=require(_0x5dd7('0xb'))(new Redis(config[_0x5dd7('0x9')]));require(_0x5dd7('0xc'))[_0x5dd7('0xd')](socket);function respondWithRpcPromise(_0x3f9ed7,_0x4206b8,_0x29b001){return new BPromise(function(_0x5c61a9,_0x37a9d6){return client[_0x5dd7('0xe')](_0x3f9ed7,_0x29b001)[_0x5dd7('0xf')](function(_0x683cf6){logger[_0x5dd7('0x10')](_0x5dd7('0x11'),_0x4206b8,_0x5dd7('0x12'));logger['debug'](_0x5dd7('0x13'),_0x4206b8,_0x5dd7('0x12'),JSON[_0x5dd7('0x14')](_0x683cf6));if(_0x683cf6[_0x5dd7('0x15')]){if(_0x683cf6[_0x5dd7('0x15')]['code']===0x1f4){logger[_0x5dd7('0x15')](_0x5dd7('0x11'),_0x4206b8,_0x683cf6['error'][_0x5dd7('0x16')]);return _0x37a9d6(_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);}logger[_0x5dd7('0x15')](_0x5dd7('0x11'),_0x4206b8,_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);return _0x5c61a9(_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);}else{logger[_0x5dd7('0x10')](_0x5dd7('0x11'),_0x4206b8,'request\x20sent');_0x5c61a9(_0x683cf6[_0x5dd7('0x17')][_0x5dd7('0x16')]);}})['catch'](function(_0xba1652){logger['error'](_0x5dd7('0x11'),_0x4206b8,_0xba1652);_0x37a9d6(_0xba1652);});});}exports[_0x5dd7('0x18')]=function(_0x3ff58e){var _0x5d257e=this;return new Promise(function(_0x492150,_0x24d921){return db[_0x5dd7('0x19')][_0x5dd7('0x1a')](_0x3ff58e['body'],{'raw':_0x3ff58e[_0x5dd7('0x1b')]?_0x3ff58e['options'][_0x5dd7('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3093c2){logger[_0x5dd7('0x10')](_0x5dd7('0x18'),_0x3ff58e);logger['debug'](_0x5dd7('0x18'),_0x3ff58e,JSON[_0x5dd7('0x14')](_0x3093c2));_0x492150(_0x3093c2);})[_0x5dd7('0x1d')](function(_0x38db0f){logger[_0x5dd7('0x15')](_0x5dd7('0x18'),_0x38db0f[_0x5dd7('0x16')],_0x3ff58e);_0x24d921(_0x5d257e[_0x5dd7('0x15')](0x1f4,_0x38db0f[_0x5dd7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f44f739..9f3d4c2 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 _0xb2a1=['length','./whatsappMessage.events','save','remove','update','register'];(function(_0x4fb5d9,_0x1d776f){var _0x25ebe8=function(_0x501c13){while(--_0x501c13){_0x4fb5d9['push'](_0x4fb5d9['shift']());}};_0x25ebe8(++_0x1d776f);}(_0xb2a1,0x8b));var _0x1b2a=function(_0x5207da,_0x4a1dcd){_0x5207da=_0x5207da-0x0;var _0x26407c=_0xb2a1[_0x5207da];return _0x26407c;};'use strict';var WhatsappMessageEvents=require(_0x1b2a('0x0'));var events=[_0x1b2a('0x1'),_0x1b2a('0x2'),_0x1b2a('0x3')];function createListener(_0x4b9328,_0x217ac2){return function(_0x57548a){_0x217ac2['emit'](_0x4b9328,_0x57548a);};}function removeListener(_0x386c9e,_0x4d97){return function(){WhatsappMessageEvents['removeListener'](_0x386c9e,_0x4d97);};}exports[_0x1b2a('0x4')]=function(_0x4cccb3){for(var _0x55fa80=0x0,_0x20b884=events[_0x1b2a('0x5')];_0x55fa80<_0x20b884;_0x55fa80++){var _0x20f2ea=events[_0x55fa80];var _0x1448a9=createListener('whatsappMessage:'+_0x20f2ea,_0x4cccb3);WhatsappMessageEvents['on'](_0x20f2ea,_0x1448a9);}}; \ No newline at end of file +var _0xd946=['update','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x4be326,_0xcae821){var _0x46d1d0=function(_0x29958a){while(--_0x29958a){_0x4be326['push'](_0x4be326['shift']());}};_0x46d1d0(++_0xcae821);}(_0xd946,0x169));var _0x6d94=function(_0x3f83d4,_0x265536){_0x3f83d4=_0x3f83d4-0x0;var _0x5990a4=_0xd946[_0x3f83d4];return _0x5990a4;};'use strict';var WhatsappMessageEvents=require(_0x6d94('0x0'));var events=[_0x6d94('0x1'),_0x6d94('0x2'),_0x6d94('0x3')];function createListener(_0x3e953f,_0x505ab9){return function(_0x56b048){_0x505ab9['emit'](_0x3e953f,_0x56b048);};}function removeListener(_0x4a90ba,_0x52dd7a){return function(){WhatsappMessageEvents[_0x6d94('0x4')](_0x4a90ba,_0x52dd7a);};}exports[_0x6d94('0x5')]=function(_0x2178f5){for(var _0x2a15b2=0x0,_0xf4fa4=events['length'];_0x2a15b2<_0xf4fa4;_0x2a15b2++){var _0x8669ee=events[_0x2a15b2];var _0x25a381=createListener(_0x6d94('0x6')+_0x8669ee,_0x2178f5);WhatsappMessageEvents['on'](_0x8669ee,_0x25a381);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a19e2f0..cf9369b 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 _0xd4df=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','path','express'];(function(_0x306f7a,_0x16764d){var _0x1bbe84=function(_0x3c3937){while(--_0x3c3937){_0x306f7a['push'](_0x306f7a['shift']());}};_0x1bbe84(++_0x16764d);}(_0xd4df,0xb2));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd4d('0x0'));var timeout=require('connect-timeout');var express=require(_0xfd4d('0x1'));var router=express[_0xfd4d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfd4d('0x3'));var interaction=require(_0xfd4d('0x4'));var config=require(_0xfd4d('0x5'));var controller=require(_0xfd4d('0x6'));router[_0xfd4d('0x7')]('/',auth['isAuthenticated'](),controller[_0xfd4d('0x8')]);router[_0xfd4d('0x7')](_0xfd4d('0x9'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0xb')]);router[_0xfd4d('0x7')](_0xfd4d('0xc'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0xd')]);router[_0xfd4d('0x7')](_0xfd4d('0xe'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0xf')]);router[_0xfd4d('0x7')](_0xfd4d('0x10'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0x11')]);router[_0xfd4d('0x7')](_0xfd4d('0x12'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0x13')]);router[_0xfd4d('0x14')]('/',auth[_0xfd4d('0xa')](),controller[_0xfd4d('0x15')]);router[_0xfd4d('0x14')](_0xfd4d('0x10'),auth['isAuthenticated'](),controller[_0xfd4d('0x16')]);router[_0xfd4d('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xfd4d('0x17')]);router[_0xfd4d('0x18')]('/:id',auth[_0xfd4d('0xa')](),controller[_0xfd4d('0x19')]);router[_0xfd4d('0x1a')](_0xfd4d('0xc'),auth[_0xfd4d('0xa')](),controller[_0xfd4d('0x1b')]);router[_0xfd4d('0x1a')](_0xfd4d('0x10'),auth['isAuthenticated'](),controller[_0xfd4d('0x1c')]);router['delete'](_0xfd4d('0x12'),auth[_0xfd4d('0xa')](),controller['removeAgents']);module[_0xfd4d('0x1d')]=router; \ No newline at end of file +var _0xc9ab=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','delete','removeTeams','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9ab,0x65));var _0xbc9a=function(_0xdd999,_0x2c94cf){_0xdd999=_0xdd999-0x0;var _0x3e0e5a=_0xc9ab[_0xdd999];return _0x3e0e5a;};'use strict';var multer=require(_0xbc9a('0x0'));var util=require('util');var path=require(_0xbc9a('0x1'));var timeout=require(_0xbc9a('0x2'));var express=require(_0xbc9a('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9a('0x4'));var auth=require(_0xbc9a('0x5'));var interaction=require(_0xbc9a('0x6'));var config=require(_0xbc9a('0x7'));var controller=require(_0xbc9a('0x8'));router[_0xbc9a('0x9')]('/',auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xb')]);router['get'](_0xbc9a('0xc'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xd')]);router[_0xbc9a('0x9')](_0xbc9a('0xe'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xf')]);router['get'](_0xbc9a('0x10'),auth[_0xbc9a('0xa')](),controller['getMembers']);router[_0xbc9a('0x9')](_0xbc9a('0x11'),auth['isAuthenticated'](),controller[_0xbc9a('0x12')]);router[_0xbc9a('0x9')](_0xbc9a('0x13'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x14')]);router[_0xbc9a('0x15')]('/',auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x16')]);router['post'](_0xbc9a('0x11'),auth[_0xbc9a('0xa')](),controller['addTeams']);router[_0xbc9a('0x15')]('/:id/users',auth[_0xbc9a('0xa')](),controller['addAgents']);router[_0xbc9a('0x17')](_0xbc9a('0xe'),auth['isAuthenticated'](),controller[_0xbc9a('0x18')]);router[_0xbc9a('0x19')](_0xbc9a('0xe'),auth[_0xbc9a('0xa')](),controller['destroy']);router[_0xbc9a('0x19')](_0xbc9a('0x11'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x1a')]);router[_0xbc9a('0x19')](_0xbc9a('0x13'),auth[_0xbc9a('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 133146f..ba741c6 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 _0x54f3=['exports','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x5617b6,_0x3e74d6){var _0x3f780f=function(_0x4c6e07){while(--_0x4c6e07){_0x5617b6['push'](_0x5617b6['shift']());}};_0x3f780f(++_0x3e74d6);}(_0x54f3,0x120));var _0x354f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x54f3[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module[_0x354f('0x0')]={'name':{'type':Sequelize[_0x354f('0x1')],'unique':_0x354f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x354f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x354f('0x4')]('rrmemory','beepall',_0x354f('0x5'))},'description':{'type':Sequelize[_0x354f('0x1')]}}; \ No newline at end of file +var _0xee11=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','name'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0xee11,0x146));var _0x1ee1=function(_0x124d74,_0x18eda2){_0x124d74=_0x124d74-0x0;var _0x46418e=_0xee11[_0x124d74];return _0x46418e;};'use strict';var Sequelize=require(_0x1ee1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1ee1('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1ee1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ee1('0x3')](_0x1ee1('0x4'),_0x1ee1('0x5'),_0x1ee1('0x6'))},'description':{'type':Sequelize[_0x1ee1('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index deadf44..d941175 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 _0xb897=['spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','set','Content-Range','reject','save','update','then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','select','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','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents'];(function(_0x52c1ba,_0x15841f){var _0x579d15=function(_0x245f75){while(--_0x245f75){_0x52c1ba['push'](_0x52c1ba['shift']());}};_0x579d15(++_0x15841f);}(_0xb897,0x1b3));var _0x7b89=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb897[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b89('0x0'));var zipdir=require(_0x7b89('0x1'));var jsonpatch=require(_0x7b89('0x2'));var rp=require('request-promise');var moment=require(_0x7b89('0x3'));var BPromise=require(_0x7b89('0x4'));var Mustache=require(_0x7b89('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7b89('0x6'));var ejs=require(_0x7b89('0x7'));var fs=require('fs');var fs_extra=require(_0x7b89('0x8'));var _=require(_0x7b89('0x9'));var squel=require('squel');var crypto=require(_0x7b89('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b89('0x6'));var querystring=require(_0x7b89('0xb'));var Papa=require(_0x7b89('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b89('0xd'));var logger=require(_0x7b89('0xe'))(_0x7b89('0xf'));var utils=require(_0x7b89('0x10'));var config=require(_0x7b89('0x11'));var licenseUtil=require(_0x7b89('0x12'));var db=require('../../mysqldb')['db'];config[_0x7b89('0x13')]=_[_0x7b89('0x14')](config[_0x7b89('0x13')],{'host':_0x7b89('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b89('0x13')]));require(_0x7b89('0x16'))[_0x7b89('0x17')](socket);function respondWithStatusCode(_0x3ffb39,_0x3ad45a){_0x3ad45a=_0x3ad45a||0xcc;return function(_0x33e79a){if(_0x33e79a){return _0x3ffb39[_0x7b89('0x18')](_0x3ad45a);}return _0x3ffb39[_0x7b89('0x19')](_0x3ad45a)[_0x7b89('0x1a')]();};}function respondWithResult(_0x3f0de0,_0xc55628){_0xc55628=_0xc55628||0xc8;return function(_0x5cba89){if(_0x5cba89){return _0x3f0de0[_0x7b89('0x19')](_0xc55628)[_0x7b89('0x1b')](_0x5cba89);}};}function respondWithFilteredResult(_0x577e2d,_0x279d67){return function(_0x582180){if(_0x582180){var _0x3c75bc=typeof _0x279d67[_0x7b89('0x1c')]==='undefined'&&typeof _0x279d67['limit']===_0x7b89('0x1d');var _0x2bf853=_0x582180['count'];var _0x505e6c=_0x3c75bc?0x0:_0x279d67[_0x7b89('0x1c')];var _0x453495=_0x3c75bc?_0x582180['count']:_0x279d67[_0x7b89('0x1c')]+_0x279d67['limit'];var _0x51841e;if(_0x453495>=_0x2bf853){_0x453495=_0x2bf853;_0x51841e=0xc8;}else{_0x51841e=0xce;}_0x577e2d[_0x7b89('0x19')](_0x51841e);return _0x577e2d[_0x7b89('0x1e')](_0x7b89('0x1f'),_0x505e6c+'-'+_0x453495+'/'+_0x2bf853)[_0x7b89('0x1b')](_0x582180);}return null;};}function patchUpdates(_0x278168){return function(_0x1e24dd){try{jsonpatch['apply'](_0x1e24dd,_0x278168,!![]);}catch(_0x2dc8fe){return BPromise[_0x7b89('0x20')](_0x2dc8fe);}return _0x1e24dd[_0x7b89('0x21')]();};}function saveUpdates(_0x37ddab,_0x51bc4e){return function(_0x5bd792){if(_0x5bd792){return _0x5bd792[_0x7b89('0x22')](_0x37ddab)[_0x7b89('0x23')](function(_0x5af77e){return _0x5af77e;});}return null;};}function removeEntity(_0x30c967,_0x475938){return function(_0x58fd58){if(_0x58fd58){return _0x58fd58['destroy']()[_0x7b89('0x23')](function(){var _0x5a0bf0=_0x58fd58[_0x7b89('0x24')]({'plain':!![]});var _0x4b4a09=_0x7b89('0x25');return db[_0x7b89('0x26')]['destroy']({'where':{'type':_0x4b4a09,'resourceId':_0x5a0bf0['id']}})[_0x7b89('0x23')](function(){return _0x58fd58;});})[_0x7b89('0x23')](function(){_0x30c967[_0x7b89('0x19')](0xcc)[_0x7b89('0x1a')]();});}};}function handleEntityNotFound(_0x401316,_0x2d6f14){return function(_0x4635ea){if(!_0x4635ea){_0x401316[_0x7b89('0x18')](0x194);}return _0x4635ea;};}function handleError(_0x269998,_0x3fbe55){_0x3fbe55=_0x3fbe55||0x1f4;return function(_0x7e25ee){logger[_0x7b89('0x27')](_0x7e25ee[_0x7b89('0x28')]);if(_0x7e25ee[_0x7b89('0x29')]){delete _0x7e25ee[_0x7b89('0x29')];}_0x269998[_0x7b89('0x19')](_0x3fbe55)[_0x7b89('0x2a')](_0x7e25ee);};}exports[_0x7b89('0x2b')]=function(_0x4acb9e,_0x17430a){var _0x26cc9c={},_0x4f5546={},_0x52877f={'count':0x0,'rows':[]};var _0x26412e=_[_0x7b89('0x2c')](db[_0x7b89('0x2d')][_0x7b89('0x2e')],function(_0x486718){return{'name':_0x486718[_0x7b89('0x2f')],'type':_0x486718['type']['key']};});_0x4f5546[_0x7b89('0x30')]=_[_0x7b89('0x2c')](_0x26412e,_0x7b89('0x29'));_0x4f5546['query']=_[_0x7b89('0x31')](_0x4acb9e[_0x7b89('0x32')]);_0x4f5546[_0x7b89('0x33')]=_[_0x7b89('0x34')](_0x4f5546[_0x7b89('0x30')],_0x4f5546[_0x7b89('0x32')]);_0x26cc9c[_0x7b89('0x35')]=_[_0x7b89('0x34')](_0x4f5546[_0x7b89('0x30')],qs[_0x7b89('0x36')](_0x4acb9e[_0x7b89('0x32')][_0x7b89('0x36')]));_0x26cc9c[_0x7b89('0x35')]=_0x26cc9c['attributes']['length']?_0x26cc9c[_0x7b89('0x35')]:_0x4f5546[_0x7b89('0x30')];if(!_0x4acb9e['query'][_0x7b89('0x37')](_0x7b89('0x38'))){_0x26cc9c[_0x7b89('0x39')]=qs[_0x7b89('0x39')](_0x4acb9e[_0x7b89('0x32')][_0x7b89('0x39')]);_0x26cc9c[_0x7b89('0x1c')]=qs[_0x7b89('0x1c')](_0x4acb9e['query'][_0x7b89('0x1c')]);}_0x26cc9c[_0x7b89('0x3a')]=qs[_0x7b89('0x3b')](_0x4acb9e[_0x7b89('0x32')][_0x7b89('0x3b')]);_0x26cc9c[_0x7b89('0x3c')]=qs['filters'](_[_0x7b89('0x3d')](_0x4acb9e[_0x7b89('0x32')],_0x4f5546[_0x7b89('0x33')]),_0x26412e);if(_0x4acb9e[_0x7b89('0x32')][_0x7b89('0x3e')]){_0x26cc9c[_0x7b89('0x3c')]=_[_0x7b89('0x3f')](_0x26cc9c[_0x7b89('0x3c')],{'$or':_['map'](_0x26412e,function(_0xc1f66a){if(_0xc1f66a[_0x7b89('0x40')]!==_0x7b89('0x41')){var _0x41e43c={};_0x41e43c[_0xc1f66a[_0x7b89('0x29')]]={'$like':'%'+_0x4acb9e[_0x7b89('0x32')][_0x7b89('0x3e')]+'%'};return _0x41e43c;}})});}_0x26cc9c=_['merge']({},_0x26cc9c,_0x4acb9e['options']);var _0x5c49b5={'where':_0x26cc9c[_0x7b89('0x3c')]};return db[_0x7b89('0x2d')][_0x7b89('0x42')](_0x5c49b5)[_0x7b89('0x23')](function(_0x23330f){_0x52877f['count']=_0x23330f;if(_0x4acb9e['query'][_0x7b89('0x43')]){_0x26cc9c[_0x7b89('0x44')]=[{'all':!![]}];}return db[_0x7b89('0x2d')][_0x7b89('0x45')](_0x26cc9c);})[_0x7b89('0x23')](function(_0x4f2f68){_0x52877f[_0x7b89('0x46')]=_0x4f2f68;return _0x52877f;})[_0x7b89('0x23')](respondWithFilteredResult(_0x17430a,_0x26cc9c))[_0x7b89('0x47')](handleError(_0x17430a,null));};exports['show']=function(_0x411280,_0x43bbbc){var _0x15d0fd={'raw':!![],'where':{'id':_0x411280[_0x7b89('0x48')]['id']}},_0x1c0a01={};_0x1c0a01[_0x7b89('0x30')]=_[_0x7b89('0x31')](db[_0x7b89('0x2d')][_0x7b89('0x2e')]);_0x1c0a01['query']=_['keys'](_0x411280[_0x7b89('0x32')]);_0x1c0a01['filters']=_['intersection'](_0x1c0a01[_0x7b89('0x30')],_0x1c0a01[_0x7b89('0x32')]);_0x15d0fd[_0x7b89('0x35')]=_['intersection'](_0x1c0a01['model'],qs[_0x7b89('0x36')](_0x411280['query'][_0x7b89('0x36')]));_0x15d0fd[_0x7b89('0x35')]=_0x15d0fd[_0x7b89('0x35')][_0x7b89('0x49')]?_0x15d0fd['attributes']:_0x1c0a01['model'];if(_0x411280[_0x7b89('0x32')][_0x7b89('0x43')]){_0x15d0fd[_0x7b89('0x44')]=[{'all':!![]}];}_0x15d0fd=_[_0x7b89('0x3f')]({},_0x15d0fd,_0x411280[_0x7b89('0x4a')]);return db['WhatsappQueue'][_0x7b89('0x4b')](_0x15d0fd)['then'](handleEntityNotFound(_0x43bbbc,null))[_0x7b89('0x23')](respondWithResult(_0x43bbbc,null))[_0x7b89('0x47')](handleError(_0x43bbbc,null));};exports[_0x7b89('0x4c')]=function(_0x3bce55,_0x24e5fb){return db['WhatsappQueue'][_0x7b89('0x4c')](_0x3bce55[_0x7b89('0x4d')],{})[_0x7b89('0x23')](function(_0x33e289){var _0x5bcd10=_0x3bce55[_0x7b89('0x4e')][_0x7b89('0x24')]({'plain':!![]});if(!_0x5bcd10)throw new Error(_0x7b89('0x4f'));if(_0x5bcd10[_0x7b89('0x50')]===_0x7b89('0x4e')){var _0x1e3a3f=_0x33e289[_0x7b89('0x24')]({'plain':!![]});var _0x4d097f=_0x7b89('0x25');return db[_0x7b89('0x51')]['find']({'where':{'name':_0x4d097f,'userProfileId':_0x5bcd10[_0x7b89('0x52')]},'raw':!![]})[_0x7b89('0x23')](function(_0x4ce7fe){if(_0x4ce7fe&&_0x4ce7fe[_0x7b89('0x53')]===0x0){return db[_0x7b89('0x26')][_0x7b89('0x4c')]({'name':_0x1e3a3f['name'],'resourceId':_0x1e3a3f['id'],'type':_0x4ce7fe[_0x7b89('0x29')],'sectionId':_0x4ce7fe['id']},{})[_0x7b89('0x23')](function(){return _0x33e289;});}else{return _0x33e289;}})[_0x7b89('0x47')](function(_0x44a453){logger[_0x7b89('0x27')](_0x7b89('0x54'),_0x44a453);throw _0x44a453;});}return _0x33e289;})[_0x7b89('0x23')](respondWithResult(_0x24e5fb,0xc9))[_0x7b89('0x47')](handleError(_0x24e5fb,null));};exports['update']=function(_0x9986db,_0x4afe42){if(_0x9986db[_0x7b89('0x4d')]['id']){delete _0x9986db[_0x7b89('0x4d')]['id'];}return db[_0x7b89('0x2d')]['find']({'where':{'id':_0x9986db[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x4afe42,null))['then'](saveUpdates(_0x9986db['body'],null))[_0x7b89('0x23')](respondWithResult(_0x4afe42,null))['catch'](handleError(_0x4afe42,null));};exports['destroy']=function(_0x30ee13,_0x3d2b79){return db[_0x7b89('0x2d')][_0x7b89('0x4b')]({'where':{'id':_0x30ee13[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x3d2b79,null))[_0x7b89('0x23')](removeEntity(_0x3d2b79,null))[_0x7b89('0x47')](handleError(_0x3d2b79,null));};exports[_0x7b89('0x55')]=function(_0x1ce9a3,_0x21af74){return db[_0x7b89('0x2d')][_0x7b89('0x55')]()[_0x7b89('0x23')](respondWithResult(_0x21af74,null))[_0x7b89('0x47')](handleError(_0x21af74,null));};exports[_0x7b89('0x56')]=function(_0x235f6e,_0x446872,_0x34a0b7){var _0xac22b={'raw':!![],'where':{}},_0x228031={},_0x41ee85;return db[_0x7b89('0x2d')][_0x7b89('0x57')]({'where':{'id':_0x235f6e[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x446872,null))[_0x7b89('0x23')](function(_0x324d89){if(_0x324d89){_0x41ee85=_0x324d89[_0x7b89('0x24')]({'plain':!![]});_0x228031[_0x7b89('0x30')]=_[_0x7b89('0x31')](db[_0x7b89('0x58')]['rawAttributes']);_0x228031[_0x7b89('0x32')]=_['keys'](_0x235f6e[_0x7b89('0x32')]);_0x228031[_0x7b89('0x33')]=_[_0x7b89('0x34')](_0x228031[_0x7b89('0x30')],_0x228031[_0x7b89('0x32')]);_0xac22b[_0x7b89('0x35')]=_[_0x7b89('0x34')](_0x228031[_0x7b89('0x30')],qs['fields'](_0x235f6e[_0x7b89('0x32')]['fields']));_0xac22b[_0x7b89('0x35')]=_0xac22b[_0x7b89('0x35')]['length']?_0xac22b['attributes']:_0x228031['model'];if(!_0x235f6e[_0x7b89('0x32')][_0x7b89('0x37')]('nolimit')){_0xac22b[_0x7b89('0x39')]=qs[_0x7b89('0x39')](_0x235f6e[_0x7b89('0x32')][_0x7b89('0x39')]);_0xac22b['offset']=qs[_0x7b89('0x1c')](_0x235f6e[_0x7b89('0x32')][_0x7b89('0x1c')]);}_0xac22b[_0x7b89('0x3a')]=qs[_0x7b89('0x3b')](_0x235f6e['query'][_0x7b89('0x3b')]);_0xac22b[_0x7b89('0x3c')]=qs['filters'](_['pick'](_0x235f6e[_0x7b89('0x32')],_0x228031['filters']));_0xac22b['where']['WhatsappQueueId']=_0x324d89['id'];if(_0x235f6e['query'][_0x7b89('0x3e')]){_0xac22b[_0x7b89('0x3c')]=_[_0x7b89('0x3f')](_0xac22b[_0x7b89('0x3c')],{'$or':_[_0x7b89('0x2c')](_0xac22b[_0x7b89('0x35')],function(_0x563041){var _0x40764c={};_0x40764c[_0x563041]={'$like':'%'+_0x235f6e[_0x7b89('0x32')][_0x7b89('0x3e')]+'%'};return _0x40764c;})});}_0xac22b=_[_0x7b89('0x3f')]({},_0xac22b,_0x235f6e[_0x7b89('0x4a')]);return db[_0x7b89('0x58')][_0x7b89('0x45')](_0xac22b);}})[_0x7b89('0x23')](function(_0x97f608){if(_0x97f608){return db[_0x7b89('0x59')][_0x7b89('0x5a')]({'where':{'id':_[_0x7b89('0x2c')](_0x97f608,_0x7b89('0x5b')),'role':_0x7b89('0x5c')},'attributes':['id',_0x7b89('0x29'),_0x7b89('0x5d'),_0x7b89('0x5e'),_0x7b89('0x5f')]});}})['then'](function(_0x4bb48b){if(_0x4bb48b){return{'count':_0x4bb48b[_0x7b89('0x42')],'rows':_[_0x7b89('0x2c')](_0x4bb48b['rows'],function(_0x3fcbe6){return{'membername':_0x3fcbe6[_0x7b89('0x29')],'UserId':_0x3fcbe6['id'],'queue_name':_0x41ee85[_0x7b89('0x29')],'WhatsappQueueId':_0x41ee85['id'],'interface':util[_0x7b89('0x60')](_0x7b89('0x61'),_0x7b89('0x62'),_0x3fcbe6[_0x7b89('0x29')]),'penalty':0x0,'paused':_0x3fcbe6[_0x7b89('0x5d')],'createdAt':_0x3fcbe6[_0x7b89('0x5f')],'updatedAt':_0x3fcbe6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7b89('0x23')](respondWithFilteredResult(_0x446872,_0xac22b))[_0x7b89('0x47')](handleError(_0x446872,null));};exports[_0x7b89('0x63')]=function(_0x55f7d8,_0x2eb973,_0x2ccf40){var _0x48d27c={};var _0xc953ae={};var _0x341036;var _0x4af741;return db[_0x7b89('0x2d')][_0x7b89('0x57')]({'where':{'id':_0x55f7d8[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x2eb973,null))[_0x7b89('0x23')](function(_0x1d7323){if(_0x1d7323){_0x341036=_0x1d7323;_0xc953ae['model']=_[_0x7b89('0x31')](db['Team'][_0x7b89('0x2e')]);_0xc953ae['query']=_['keys'](_0x55f7d8[_0x7b89('0x32')]);_0xc953ae[_0x7b89('0x33')]=_[_0x7b89('0x34')](_0xc953ae['model'],_0xc953ae[_0x7b89('0x32')]);_0x48d27c[_0x7b89('0x35')]=_[_0x7b89('0x34')](_0xc953ae[_0x7b89('0x30')],qs[_0x7b89('0x36')](_0x55f7d8[_0x7b89('0x32')][_0x7b89('0x36')]));_0x48d27c[_0x7b89('0x35')]=_0x48d27c[_0x7b89('0x35')]['length']?_0x48d27c[_0x7b89('0x35')]:_0xc953ae[_0x7b89('0x30')];_0x48d27c[_0x7b89('0x3a')]=qs['sort'](_0x55f7d8['query'][_0x7b89('0x3b')]);_0x48d27c[_0x7b89('0x3c')]=qs[_0x7b89('0x33')](_['pick'](_0x55f7d8['query'],_0xc953ae[_0x7b89('0x33')]));if(_0x55f7d8[_0x7b89('0x32')][_0x7b89('0x3e')]){_0x48d27c[_0x7b89('0x3c')]=_['merge'](_0x48d27c[_0x7b89('0x3c')],{'$or':_['map'](_0x48d27c[_0x7b89('0x35')],function(_0x5d1985){var _0x336681={};_0x336681[_0x5d1985]={'$like':'%'+_0x55f7d8[_0x7b89('0x32')][_0x7b89('0x3e')]+'%'};return _0x336681;})});}_0x48d27c=_['merge']({},_0x48d27c,_0x55f7d8[_0x7b89('0x4a')]);return _0x341036['getTeams'](_0x48d27c);}})[_0x7b89('0x23')](function(_0x237e86){if(_0x237e86){_0x4af741=_0x237e86[_0x7b89('0x49')];if(!_0x55f7d8['query'][_0x7b89('0x37')](_0x7b89('0x38'))){_0x48d27c[_0x7b89('0x39')]=qs[_0x7b89('0x39')](_0x55f7d8[_0x7b89('0x32')][_0x7b89('0x39')]);_0x48d27c[_0x7b89('0x1c')]=qs[_0x7b89('0x1c')](_0x55f7d8['query'][_0x7b89('0x1c')]);}return _0x341036['getTeams'](_0x48d27c);}})['then'](function(_0x434b27){if(_0x434b27){return _0x434b27?{'count':_0x4af741,'rows':_0x434b27}:null;}})[_0x7b89('0x23')](respondWithResult(_0x2eb973,null))[_0x7b89('0x47')](handleError(_0x2eb973,null));};exports[_0x7b89('0x64')]=function(_0x2a20c6,_0x1cd165,_0x500e52){var _0x3d4b33=_0x2a20c6[_0x7b89('0x4d')][_0x7b89('0x65')];return db[_0x7b89('0x66')][_0x7b89('0x45')]({'where':{'id':_0x3d4b33},'attributes':['id'],'include':[{'model':db[_0x7b89('0x59')],'as':_0x7b89('0x67'),'attributes':['id','name',_0x7b89('0x68'),_0x7b89('0x69'),_0x7b89('0x6a')],'raw':!![]}]})[_0x7b89('0x23')](function(_0x3a27bb){if(_0x3a27bb){var _0x51ac80=_[_0x7b89('0x6b')](_0x3a27bb,function(_0x560862){var _0x28ecde=_0x560862['get']({'plain':!![]});return _0x28ecde[_0x7b89('0x67')];});return db[_0x7b89('0x2d')]['find']({'where':{'id':_0x2a20c6['params']['id']}})[_0x7b89('0x23')](function(_0x54c527){return db[_0x7b89('0x6c')][_0x7b89('0x6d')](function(_0x15b28a){return _0x54c527['addTeams'](_0x3d4b33,{'transaction':_0x15b28a})[_0x7b89('0x23')](function(){return BPromise[_0x7b89('0x6e')](_0x51ac80,function(_0x3f6d4f){return db[_0x7b89('0x58')][_0x7b89('0x6f')]({'where':{'UserId':_0x3f6d4f['id'],'WhatsappQueueId':_0x2a20c6[_0x7b89('0x48')]['id']},'transaction':_0x15b28a});});})[_0x7b89('0x23')](function(){_0x51ac80[_0x7b89('0x70')](function(_0x2e3867){socket['emit'](_0x7b89('0x71'),{'UserId':_0x2e3867['id'],'WhatsappQueueId':_0x54c527['id']});});});});});}})[_0x7b89('0x23')](respondWithStatusCode(_0x1cd165,null))['catch'](handleError(_0x1cd165,null));};exports['removeTeams']=function(_0x54e562,_0x3f53e8,_0x4bbfdb){return db['Team']['findAll']({'where':{'id':_0x54e562[_0x7b89('0x32')][_0x7b89('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7b89('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7b89('0x23')](handleEntityNotFound(_0x3f53e8,null))[_0x7b89('0x23')](function(_0x58caeb){var _0x53e82e=_[_0x7b89('0x2c')](_0x58caeb,'id');var _0x184ffd=[];var _0x15976c=[];var _0x2dbc96=squel[_0x7b89('0x72')]();_0x2dbc96[_0x7b89('0x73')](_0x7b89('0x74'))[_0x7b89('0x75')](_0x7b89('0x76'),'tq')[_0x7b89('0x77')](_0x7b89('0x78'),'ut',_0x7b89('0x79'))[_0x7b89('0x3c')](_0x7b89('0x7a'),_0x54e562['params']['id']);for(var _0x5787f2=0x0;_0x5787f2<_0x58caeb[_0x7b89('0x49')];_0x5787f2+=0x1){let _0x3b8b8b=_0x58caeb[_0x5787f2];for(var _0x331974=0x0;_0x331974<_0x3b8b8b[_0x7b89('0x67')][_0x7b89('0x49')];_0x331974+=0x1){let _0x26b457=_0x3b8b8b['Agents'][_0x331974];var _0x346f54=_0x2dbc96[_0x7b89('0x7b')]();_0x346f54[_0x7b89('0x3c')](_0x7b89('0x7c'),_0x26b457['id']);_0x15976c[_0x7b89('0x7d')](db[_0x7b89('0x6c')][_0x7b89('0x32')](_0x346f54[_0x7b89('0x7e')](),{'type':db[_0x7b89('0x6c')][_0x7b89('0x7f')][_0x7b89('0x80')]})[_0x7b89('0x23')](function(_0x5286e8){if(_0x5286e8[_0x7b89('0x49')]===0x1){return _0x26b457['id'];}else{var _0x4cc1a7=_[_0x7b89('0x81')](_[_0x7b89('0x2c')](_0x5286e8,_0x7b89('0x82')),function(_0x188798){return _[_0x7b89('0x83')](_0x53e82e,_0x188798);});if(_0x4cc1a7){return _0x26b457['id'];}}}));}}return BPromise[_0x7b89('0x84')](_0x15976c)['then'](function(_0x5c3655){_0x184ffd=_(_0x184ffd)[_0x7b89('0x85')](_0x5c3655)[_0x7b89('0x86')]()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0x54e562[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](function(_0x398dff){return db[_0x7b89('0x6c')][_0x7b89('0x6d')](function(_0x87669c){return _0x398dff[_0x7b89('0x87')](_0x54e562[_0x7b89('0x32')][_0x7b89('0x65')],{'transaction':_0x87669c})[_0x7b89('0x23')](function(){if(!_[_0x7b89('0x88')](_0x184ffd)){return _0x398dff[_0x7b89('0x89')](_0x184ffd,{'transaction':_0x87669c});}})['then'](function(){_0x184ffd[_0x7b89('0x70')](function(_0x512973){socket[_0x7b89('0x8a')](_0x7b89('0x8b'),{'UserId':_0x512973,'WhatsappQueueId':_0x398dff['id']});});});});});});})[_0x7b89('0x23')](respondWithStatusCode(_0x3f53e8,null))[_0x7b89('0x47')](handleError(_0x3f53e8,null));};exports[_0x7b89('0x8c')]=function(_0x23c995,_0x13e461,_0x589b77){return db['WhatsappQueue'][_0x7b89('0x4b')]({'where':{'id':_0x23c995['params']['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x13e461,null))[_0x7b89('0x23')](function(_0x388427){if(_0x388427){return _0x388427[_0x7b89('0x8c')](_0x23c995['body'][_0x7b89('0x65')],_['omit'](_0x23c995[_0x7b89('0x4d')],['ids','id'])||{})[_0x7b89('0x8d')](function(_0xdb779b){for(var _0x577c74=0x0;_0x577c74<_0x23c995['body'][_0x7b89('0x65')][_0x7b89('0x49')];_0x577c74+=0x1){socket[_0x7b89('0x8a')](_0x7b89('0x71'),{'UserId':Number(_0x23c995[_0x7b89('0x4d')][_0x7b89('0x65')][_0x577c74]),'WhatsappQueueId':Number(_0x23c995[_0x7b89('0x48')]['id'])});}return _0xdb779b;});}})[_0x7b89('0x23')](respondWithResult(_0x13e461,null))[_0x7b89('0x47')](handleError(_0x13e461,null));};exports[_0x7b89('0x89')]=function(_0x1e8e19,_0x1dca80,_0x1cd773){return db[_0x7b89('0x2d')]['find']({'where':{'id':_0x1e8e19[_0x7b89('0x48')]['id']}})['then'](handleEntityNotFound(_0x1dca80,null))[_0x7b89('0x23')](function(_0x5495c3){if(_0x5495c3){return _0x5495c3[_0x7b89('0x89')](_0x1e8e19['query']['ids'])['then'](function(){if(_[_0x7b89('0x8e')](_0x1e8e19[_0x7b89('0x32')]['ids'])){for(var _0x3969fa=0x0;_0x3969fa<_0x1e8e19[_0x7b89('0x32')][_0x7b89('0x65')][_0x7b89('0x49')];_0x3969fa+=0x1){socket[_0x7b89('0x8a')](_0x7b89('0x8b'),{'UserId':Number(_0x1e8e19[_0x7b89('0x32')]['ids'][_0x3969fa]),'WhatsappQueueId':Number(_0x1e8e19[_0x7b89('0x48')]['id'])});}}else{socket[_0x7b89('0x8a')](_0x7b89('0x8b'),{'UserId':Number(_0x1e8e19[_0x7b89('0x32')][_0x7b89('0x65')]),'WhatsappQueueId':Number(_0x1e8e19[_0x7b89('0x48')]['id'])});}});}})[_0x7b89('0x23')](respondWithStatusCode(_0x1dca80,null))[_0x7b89('0x47')](handleError(_0x1dca80,null));};exports['getAgents']=function(_0x6f0354,_0x52eb0d,_0x1ce2d9){var _0x3aeef6={};var _0x53342b={};var _0x545325;var _0x54223d;return db[_0x7b89('0x2d')][_0x7b89('0x57')]({'where':{'id':_0x6f0354[_0x7b89('0x48')]['id']}})[_0x7b89('0x23')](handleEntityNotFound(_0x52eb0d,null))[_0x7b89('0x23')](function(_0x14e05c){if(_0x14e05c){_0x545325=_0x14e05c;_0x53342b[_0x7b89('0x30')]=_[_0x7b89('0x31')](db[_0x7b89('0x59')]['rawAttributes']);_0x53342b[_0x7b89('0x32')]=_[_0x7b89('0x31')](_0x6f0354[_0x7b89('0x32')]);_0x53342b['filters']=_[_0x7b89('0x34')](_0x53342b[_0x7b89('0x30')],_0x53342b[_0x7b89('0x32')]);_0x3aeef6['attributes']=_[_0x7b89('0x34')](_0x53342b[_0x7b89('0x30')],qs['fields'](_0x6f0354[_0x7b89('0x32')][_0x7b89('0x36')]));_0x3aeef6[_0x7b89('0x35')]=_0x3aeef6['attributes']['length']?_0x3aeef6[_0x7b89('0x35')]:_0x53342b[_0x7b89('0x30')];_0x3aeef6[_0x7b89('0x3a')]=qs[_0x7b89('0x3b')](_0x6f0354[_0x7b89('0x32')][_0x7b89('0x3b')]);_0x3aeef6[_0x7b89('0x3c')]=qs[_0x7b89('0x33')](_[_0x7b89('0x3d')](_0x6f0354[_0x7b89('0x32')],_0x53342b[_0x7b89('0x33')]));if(_0x6f0354[_0x7b89('0x32')][_0x7b89('0x3e')]){_0x3aeef6[_0x7b89('0x3c')]=_[_0x7b89('0x3f')](_0x3aeef6[_0x7b89('0x3c')],{'$or':_[_0x7b89('0x2c')](_0x3aeef6[_0x7b89('0x35')],function(_0x222f4f){var _0x224ca8={};_0x224ca8[_0x222f4f]={'$like':'%'+_0x6f0354[_0x7b89('0x32')][_0x7b89('0x3e')]+'%'};return _0x224ca8;})});}_0x3aeef6=_[_0x7b89('0x3f')]({},_0x3aeef6,_0x6f0354[_0x7b89('0x4a')]);return _0x545325['getAgents'](_0x3aeef6);}})[_0x7b89('0x23')](function(_0xb248f2){if(_0xb248f2){_0x54223d=_0xb248f2[_0x7b89('0x49')];if(!_0x6f0354[_0x7b89('0x32')][_0x7b89('0x37')]('nolimit')){_0x3aeef6['limit']=qs[_0x7b89('0x39')](_0x6f0354[_0x7b89('0x32')][_0x7b89('0x39')]);_0x3aeef6[_0x7b89('0x1c')]=qs[_0x7b89('0x1c')](_0x6f0354[_0x7b89('0x32')]['offset']);}return _0x545325[_0x7b89('0x8f')](_0x3aeef6);}})[_0x7b89('0x23')](function(_0x42dc25){if(_0x42dc25){return _0x42dc25?{'count':_0x54223d,'rows':_0x42dc25}:null;}})[_0x7b89('0x23')](respondWithResult(_0x52eb0d,null))[_0x7b89('0x47')](handleError(_0x52eb0d,null));}; \ No newline at end of file +var _0xde1d=['fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','WhatsappQueue','includeAll','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','nolimit','order','User','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','ids','findAll','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','UserWhatsappQueue','forEach','emit','userWhatsappQueue:save','removeTeams','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','union','value','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes'];(function(_0x2a2cb4,_0x1347cc){var _0x4a8374=function(_0x21f531){while(--_0x21f531){_0x2a2cb4['push'](_0x2a2cb4['shift']());}};_0x4a8374(++_0x1347cc);}(_0xde1d,0x162));var _0xdde1=function(_0x57252a,_0x1ceae9){_0x57252a=_0x57252a-0x0;var _0x2733a8=_0xde1d[_0x57252a];return _0x2733a8;};'use strict';var emlformat=require(_0xdde1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdde1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdde1('0x2'));var moment=require(_0xdde1('0x3'));var BPromise=require(_0xdde1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdde1('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdde1('0x6'));var _=require(_0xdde1('0x7'));var squel=require('squel');var crypto=require(_0xdde1('0x8'));var jsforce=require(_0xdde1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xdde1('0xa'));var querystring=require('querystring');var Papa=require(_0xdde1('0xb'));var Redis=require(_0xdde1('0xc'));var authService=require(_0xdde1('0xd'));var qs=require(_0xdde1('0xe'));var as=require(_0xdde1('0xf'));var hardwareService=require(_0xdde1('0x10'));var logger=require(_0xdde1('0x11'))(_0xdde1('0x12'));var utils=require(_0xdde1('0x13'));var config=require(_0xdde1('0x14'));var licenseUtil=require(_0xdde1('0x15'));var db=require(_0xdde1('0x16'))['db'];config[_0xdde1('0x17')]=_[_0xdde1('0x18')](config[_0xdde1('0x17')],{'host':_0xdde1('0x19'),'port':0x18eb});var socket=require(_0xdde1('0x1a'))(new Redis(config[_0xdde1('0x17')]));require(_0xdde1('0x1b'))[_0xdde1('0x1c')](socket);function respondWithStatusCode(_0x475298,_0x18a79a){_0x18a79a=_0x18a79a||0xcc;return function(_0x27193a){if(_0x27193a){return _0x475298[_0xdde1('0x1d')](_0x18a79a);}return _0x475298[_0xdde1('0x1e')](_0x18a79a)['end']();};}function respondWithResult(_0x28e5a4,_0x54cc76){_0x54cc76=_0x54cc76||0xc8;return function(_0x57aaa4){if(_0x57aaa4){return _0x28e5a4['status'](_0x54cc76)[_0xdde1('0x1f')](_0x57aaa4);}};}function respondWithFilteredResult(_0x50d2e5,_0x5b4388){return function(_0x185b39){if(_0x185b39){var _0x35549f=typeof _0x5b4388[_0xdde1('0x20')]===_0xdde1('0x21')&&typeof _0x5b4388[_0xdde1('0x22')]===_0xdde1('0x21');var _0x171cc0=_0x185b39['count'];var _0x4f76bb=_0x35549f?0x0:_0x5b4388[_0xdde1('0x20')];var _0x407a37=_0x35549f?_0x185b39[_0xdde1('0x23')]:_0x5b4388[_0xdde1('0x20')]+_0x5b4388[_0xdde1('0x22')];var _0x4b3b10;if(_0x407a37>=_0x171cc0){_0x407a37=_0x171cc0;_0x4b3b10=0xc8;}else{_0x4b3b10=0xce;}_0x50d2e5[_0xdde1('0x1e')](_0x4b3b10);return _0x50d2e5[_0xdde1('0x24')](_0xdde1('0x25'),_0x4f76bb+'-'+_0x407a37+'/'+_0x171cc0)['json'](_0x185b39);}return null;};}function patchUpdates(_0xbd4484){return function(_0x5aed15){try{jsonpatch['apply'](_0x5aed15,_0xbd4484,!![]);}catch(_0x190a2e){return BPromise[_0xdde1('0x26')](_0x190a2e);}return _0x5aed15[_0xdde1('0x27')]();};}function saveUpdates(_0x37ac16,_0x39d517){return function(_0x9afcf9){if(_0x9afcf9){return _0x9afcf9['update'](_0x37ac16)[_0xdde1('0x28')](function(_0x5958b9){return _0x5958b9;});}return null;};}function removeEntity(_0x577b07,_0x2e7dcb){return function(_0x42f060){if(_0x42f060){return _0x42f060[_0xdde1('0x29')]()['then'](function(){var _0x8dba09=_0x42f060[_0xdde1('0x2a')]({'plain':!![]});var _0x19740f='WhatsappQueues';return db[_0xdde1('0x2b')]['destroy']({'where':{'type':_0x19740f,'resourceId':_0x8dba09['id']}})[_0xdde1('0x28')](function(){return _0x42f060;});})[_0xdde1('0x28')](function(){_0x577b07[_0xdde1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4729f5,_0x21184a){return function(_0x27bb14){if(!_0x27bb14){_0x4729f5[_0xdde1('0x1d')](0x194);}return _0x27bb14;};}function handleError(_0x3e4855,_0x73dfa4){_0x73dfa4=_0x73dfa4||0x1f4;return function(_0x1665ea){logger[_0xdde1('0x2c')](_0x1665ea[_0xdde1('0x2d')]);if(_0x1665ea[_0xdde1('0x2e')]){delete _0x1665ea[_0xdde1('0x2e')];}_0x3e4855[_0xdde1('0x1e')](_0x73dfa4)[_0xdde1('0x2f')](_0x1665ea);};}exports[_0xdde1('0x30')]=function(_0x5bf70b,_0x1b22fa){var _0x5922dc={},_0x1deb2d={},_0x474d4b={'count':0x0,'rows':[]};var _0x558d73=_[_0xdde1('0x31')](db['WhatsappQueue'][_0xdde1('0x32')],function(_0x7ace81){return{'name':_0x7ace81[_0xdde1('0x33')],'type':_0x7ace81['type'][_0xdde1('0x34')]};});_0x1deb2d[_0xdde1('0x35')]=_[_0xdde1('0x31')](_0x558d73,_0xdde1('0x2e'));_0x1deb2d[_0xdde1('0x36')]=_['keys'](_0x5bf70b['query']);_0x1deb2d['filters']=_[_0xdde1('0x37')](_0x1deb2d[_0xdde1('0x35')],_0x1deb2d[_0xdde1('0x36')]);_0x5922dc[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0x1deb2d['model'],qs[_0xdde1('0x39')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x39')]));_0x5922dc[_0xdde1('0x38')]=_0x5922dc[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x5922dc[_0xdde1('0x38')]:_0x1deb2d['model'];if(!_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x3b')]('nolimit')){_0x5922dc['limit']=qs[_0xdde1('0x22')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x22')]);_0x5922dc[_0xdde1('0x20')]=qs['offset'](_0x5bf70b['query'][_0xdde1('0x20')]);}_0x5922dc['order']=qs[_0xdde1('0x3c')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x3c')]);_0x5922dc['where']=qs[_0xdde1('0x3d')](_[_0xdde1('0x3e')](_0x5bf70b['query'],_0x1deb2d['filters']),_0x558d73);if(_0x5bf70b[_0xdde1('0x36')]['filter']){_0x5922dc[_0xdde1('0x3f')]=_[_0xdde1('0x40')](_0x5922dc[_0xdde1('0x3f')],{'$or':_[_0xdde1('0x31')](_0x558d73,function(_0x112742){if(_0x112742[_0xdde1('0x41')]!==_0xdde1('0x42')){var _0x5b4b22={};_0x5b4b22[_0x112742[_0xdde1('0x2e')]]={'$like':'%'+_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x5b4b22;}})});}_0x5922dc=_[_0xdde1('0x40')]({},_0x5922dc,_0x5bf70b[_0xdde1('0x44')]);var _0x309933={'where':_0x5922dc[_0xdde1('0x3f')]};return db[_0xdde1('0x45')][_0xdde1('0x23')](_0x309933)[_0xdde1('0x28')](function(_0x850fe4){_0x474d4b[_0xdde1('0x23')]=_0x850fe4;if(_0x5bf70b['query'][_0xdde1('0x46')]){_0x5922dc['include']=[{'all':!![]}];}return db[_0xdde1('0x45')]['findAll'](_0x5922dc);})['then'](function(_0x30cdc8){_0x474d4b['rows']=_0x30cdc8;return _0x474d4b;})['then'](respondWithFilteredResult(_0x1b22fa,_0x5922dc))[_0xdde1('0x47')](handleError(_0x1b22fa,null));};exports[_0xdde1('0x48')]=function(_0x4549b4,_0x5e162d){var _0x12cdef={'raw':!![],'where':{'id':_0x4549b4[_0xdde1('0x49')]['id']}},_0x12f216={};_0x12f216[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db['WhatsappQueue'][_0xdde1('0x32')]);_0x12f216[_0xdde1('0x36')]=_[_0xdde1('0x4a')](_0x4549b4[_0xdde1('0x36')]);_0x12f216['filters']=_['intersection'](_0x12f216['model'],_0x12f216[_0xdde1('0x36')]);_0x12cdef[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0x12f216['model'],qs[_0xdde1('0x39')](_0x4549b4[_0xdde1('0x36')][_0xdde1('0x39')]));_0x12cdef['attributes']=_0x12cdef[_0xdde1('0x38')]['length']?_0x12cdef[_0xdde1('0x38')]:_0x12f216['model'];if(_0x4549b4[_0xdde1('0x36')][_0xdde1('0x46')]){_0x12cdef[_0xdde1('0x4b')]=[{'all':!![]}];}_0x12cdef=_[_0xdde1('0x40')]({},_0x12cdef,_0x4549b4['options']);return db[_0xdde1('0x45')][_0xdde1('0x4c')](_0x12cdef)['then'](handleEntityNotFound(_0x5e162d,null))[_0xdde1('0x28')](respondWithResult(_0x5e162d,null))[_0xdde1('0x47')](handleError(_0x5e162d,null));};exports[_0xdde1('0x4d')]=function(_0x43ffd2,_0x261646){return db[_0xdde1('0x45')][_0xdde1('0x4d')](_0x43ffd2[_0xdde1('0x4e')],{})[_0xdde1('0x28')](function(_0x3f8496){var _0xbcb70=_0x43ffd2[_0xdde1('0x4f')][_0xdde1('0x2a')]({'plain':!![]});if(!_0xbcb70)throw new Error(_0xdde1('0x50'));if(_0xbcb70[_0xdde1('0x51')]==='user'){var _0x2e647a=_0x3f8496[_0xdde1('0x2a')]({'plain':!![]});var _0x39ff13=_0xdde1('0x52');return db[_0xdde1('0x53')][_0xdde1('0x4c')]({'where':{'name':_0x39ff13,'userProfileId':_0xbcb70['userProfileId']},'raw':!![]})['then'](function(_0xbb4410){if(_0xbb4410&&_0xbb4410[_0xdde1('0x54')]===0x0){return db[_0xdde1('0x2b')]['create']({'name':_0x2e647a[_0xdde1('0x2e')],'resourceId':_0x2e647a['id'],'type':_0xbb4410[_0xdde1('0x2e')],'sectionId':_0xbb4410['id']},{})[_0xdde1('0x28')](function(){return _0x3f8496;});}else{return _0x3f8496;}})['catch'](function(_0x5d19b1){logger['error'](_0xdde1('0x55'),_0x5d19b1);throw _0x5d19b1;});}return _0x3f8496;})['then'](respondWithResult(_0x261646,0xc9))[_0xdde1('0x47')](handleError(_0x261646,null));};exports['update']=function(_0x2fb58b,_0xbf0df9){if(_0x2fb58b[_0xdde1('0x4e')]['id']){delete _0x2fb58b[_0xdde1('0x4e')]['id'];}return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x2fb58b[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0xbf0df9,null))[_0xdde1('0x28')](saveUpdates(_0x2fb58b[_0xdde1('0x4e')],null))[_0xdde1('0x28')](respondWithResult(_0xbf0df9,null))['catch'](handleError(_0xbf0df9,null));};exports['destroy']=function(_0x1f450e,_0x47e827){return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x1f450e[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x47e827,null))[_0xdde1('0x28')](removeEntity(_0x47e827,null))[_0xdde1('0x47')](handleError(_0x47e827,null));};exports[_0xdde1('0x56')]=function(_0x12c7cd,_0x5993cf){return db[_0xdde1('0x45')]['describe']()[_0xdde1('0x28')](respondWithResult(_0x5993cf,null))[_0xdde1('0x47')](handleError(_0x5993cf,null));};exports['getMembers']=function(_0x3cca5a,_0x1014c5,_0x4a8d97){var _0x18922c={'raw':!![],'where':{}},_0x59cdbd={},_0x39e895;return db[_0xdde1('0x45')][_0xdde1('0x57')]({'where':{'id':_0x3cca5a[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1014c5,null))['then'](function(_0x41bb8c){if(_0x41bb8c){_0x39e895=_0x41bb8c[_0xdde1('0x2a')]({'plain':!![]});_0x59cdbd[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db['UserWhatsappQueue'][_0xdde1('0x32')]);_0x59cdbd['query']=_[_0xdde1('0x4a')](_0x3cca5a[_0xdde1('0x36')]);_0x59cdbd['filters']=_['intersection'](_0x59cdbd[_0xdde1('0x35')],_0x59cdbd[_0xdde1('0x36')]);_0x18922c[_0xdde1('0x38')]=_['intersection'](_0x59cdbd[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x3cca5a['query'][_0xdde1('0x39')]));_0x18922c[_0xdde1('0x38')]=_0x18922c[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x18922c[_0xdde1('0x38')]:_0x59cdbd[_0xdde1('0x35')];if(!_0x3cca5a[_0xdde1('0x36')]['hasOwnProperty'](_0xdde1('0x58'))){_0x18922c[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x3cca5a[_0xdde1('0x36')][_0xdde1('0x22')]);_0x18922c[_0xdde1('0x20')]=qs[_0xdde1('0x20')](_0x3cca5a[_0xdde1('0x36')]['offset']);}_0x18922c[_0xdde1('0x59')]=qs[_0xdde1('0x3c')](_0x3cca5a[_0xdde1('0x36')]['sort']);_0x18922c[_0xdde1('0x3f')]=qs[_0xdde1('0x3d')](_[_0xdde1('0x3e')](_0x3cca5a[_0xdde1('0x36')],_0x59cdbd['filters']));_0x18922c[_0xdde1('0x3f')]['WhatsappQueueId']=_0x41bb8c['id'];if(_0x3cca5a[_0xdde1('0x36')]['filter']){_0x18922c['where']=_[_0xdde1('0x40')](_0x18922c[_0xdde1('0x3f')],{'$or':_[_0xdde1('0x31')](_0x18922c['attributes'],function(_0x4f7ce2){var _0x482094={};_0x482094[_0x4f7ce2]={'$like':'%'+_0x3cca5a[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x482094;})});}_0x18922c=_[_0xdde1('0x40')]({},_0x18922c,_0x3cca5a[_0xdde1('0x44')]);return db['UserWhatsappQueue']['findAll'](_0x18922c);}})[_0xdde1('0x28')](function(_0x14f32f){if(_0x14f32f){return db[_0xdde1('0x5a')]['findAndCountAll']({'where':{'id':_[_0xdde1('0x31')](_0x14f32f,_0xdde1('0x5b')),'role':_0xdde1('0x5c')},'attributes':['id',_0xdde1('0x2e'),_0xdde1('0x5d'),_0xdde1('0x5e'),'createdAt']});}})[_0xdde1('0x28')](function(_0x3d7823){if(_0x3d7823){return{'count':_0x3d7823[_0xdde1('0x23')],'rows':_[_0xdde1('0x31')](_0x3d7823['rows'],function(_0x248a51){return{'membername':_0x248a51[_0xdde1('0x2e')],'UserId':_0x248a51['id'],'queue_name':_0x39e895[_0xdde1('0x2e')],'WhatsappQueueId':_0x39e895['id'],'interface':util[_0xdde1('0x5f')](_0xdde1('0x60'),_0xdde1('0x61'),_0x248a51[_0xdde1('0x2e')]),'penalty':0x0,'paused':_0x248a51[_0xdde1('0x5d')],'createdAt':_0x248a51[_0xdde1('0x62')],'updatedAt':_0x248a51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdde1('0x28')](respondWithFilteredResult(_0x1014c5,_0x18922c))[_0xdde1('0x47')](handleError(_0x1014c5,null));};exports[_0xdde1('0x63')]=function(_0x323c29,_0xd487eb,_0x4bd929){var _0x40292d={};var _0x5db192={};var _0x3a73f9;var _0x192468;return db[_0xdde1('0x45')]['findOne']({'where':{'id':_0x323c29[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0xd487eb,null))[_0xdde1('0x28')](function(_0x1f75ee){if(_0x1f75ee){_0x3a73f9=_0x1f75ee;_0x5db192[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db[_0xdde1('0x64')][_0xdde1('0x32')]);_0x5db192['query']=_['keys'](_0x323c29[_0xdde1('0x36')]);_0x5db192[_0xdde1('0x3d')]=_[_0xdde1('0x37')](_0x5db192[_0xdde1('0x35')],_0x5db192[_0xdde1('0x36')]);_0x40292d[_0xdde1('0x38')]=_['intersection'](_0x5db192[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x323c29['query'][_0xdde1('0x39')]));_0x40292d[_0xdde1('0x38')]=_0x40292d['attributes'][_0xdde1('0x3a')]?_0x40292d[_0xdde1('0x38')]:_0x5db192[_0xdde1('0x35')];_0x40292d[_0xdde1('0x59')]=qs['sort'](_0x323c29['query'][_0xdde1('0x3c')]);_0x40292d[_0xdde1('0x3f')]=qs[_0xdde1('0x3d')](_['pick'](_0x323c29[_0xdde1('0x36')],_0x5db192[_0xdde1('0x3d')]));if(_0x323c29[_0xdde1('0x36')][_0xdde1('0x43')]){_0x40292d['where']=_['merge'](_0x40292d[_0xdde1('0x3f')],{'$or':_['map'](_0x40292d[_0xdde1('0x38')],function(_0x306512){var _0x1bd716={};_0x1bd716[_0x306512]={'$like':'%'+_0x323c29[_0xdde1('0x36')]['filter']+'%'};return _0x1bd716;})});}_0x40292d=_[_0xdde1('0x40')]({},_0x40292d,_0x323c29[_0xdde1('0x44')]);return _0x3a73f9[_0xdde1('0x63')](_0x40292d);}})[_0xdde1('0x28')](function(_0x2fdee8){if(_0x2fdee8){_0x192468=_0x2fdee8[_0xdde1('0x3a')];if(!_0x323c29[_0xdde1('0x36')][_0xdde1('0x3b')](_0xdde1('0x58'))){_0x40292d[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x323c29[_0xdde1('0x36')][_0xdde1('0x22')]);_0x40292d[_0xdde1('0x20')]=qs[_0xdde1('0x20')](_0x323c29[_0xdde1('0x36')]['offset']);}return _0x3a73f9[_0xdde1('0x63')](_0x40292d);}})['then'](function(_0x131c04){if(_0x131c04){return _0x131c04?{'count':_0x192468,'rows':_0x131c04}:null;}})[_0xdde1('0x28')](respondWithResult(_0xd487eb,null))[_0xdde1('0x47')](handleError(_0xd487eb,null));};exports['addTeams']=function(_0x49f3ed,_0x1f1fc6,_0x57fd35){var _0x480a23=_0x49f3ed['body'][_0xdde1('0x65')];return db['Team'][_0xdde1('0x66')]({'where':{'id':_0x480a23},'attributes':['id'],'include':[{'model':db[_0xdde1('0x5a')],'as':_0xdde1('0x67'),'attributes':['id',_0xdde1('0x2e'),'online',_0xdde1('0x68'),'interface'],'raw':!![]}]})[_0xdde1('0x28')](function(_0x440d96){if(_0x440d96){var _0x25943c=_[_0xdde1('0x69')](_0x440d96,function(_0x3098a3){var _0x11f922=_0x3098a3[_0xdde1('0x2a')]({'plain':!![]});return _0x11f922['Agents'];});return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x49f3ed[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](function(_0x1ed812){return db[_0xdde1('0x6a')][_0xdde1('0x6b')](function(_0x47f2b1){return _0x1ed812[_0xdde1('0x6c')](_0x480a23,{'transaction':_0x47f2b1})[_0xdde1('0x28')](function(){return BPromise[_0xdde1('0x6d')](_0x25943c,function(_0x4292da){return db[_0xdde1('0x6e')]['findOrCreate']({'where':{'UserId':_0x4292da['id'],'WhatsappQueueId':_0x49f3ed[_0xdde1('0x49')]['id']},'transaction':_0x47f2b1});});})[_0xdde1('0x28')](function(){_0x25943c[_0xdde1('0x6f')](function(_0x5193e2){socket[_0xdde1('0x70')](_0xdde1('0x71'),{'UserId':_0x5193e2['id'],'WhatsappQueueId':_0x1ed812['id']});});});});});}})[_0xdde1('0x28')](respondWithStatusCode(_0x1f1fc6,null))['catch'](handleError(_0x1f1fc6,null));};exports[_0xdde1('0x72')]=function(_0x47e835,_0x33f916,_0x3e7693){return db['Team'][_0xdde1('0x66')]({'where':{'id':_0x47e835['query'][_0xdde1('0x65')]},'attributes':['id'],'include':[{'model':db[_0xdde1('0x5a')],'as':_0xdde1('0x67'),'attributes':['id'],'raw':!![]}]})[_0xdde1('0x28')](handleEntityNotFound(_0x33f916,null))[_0xdde1('0x28')](function(_0x2a614f){var _0x3b0198=_[_0xdde1('0x31')](_0x2a614f,'id');var _0x235d40=[];var _0x53eb0d=[];var _0x28b510=squel['select']();_0x28b510[_0xdde1('0x73')]('tq.TeamId')[_0xdde1('0x74')](_0xdde1('0x75'),'tq')[_0xdde1('0x76')](_0xdde1('0x77'),'ut',_0xdde1('0x78'))[_0xdde1('0x3f')](_0xdde1('0x79'),_0x47e835[_0xdde1('0x49')]['id']);for(var _0x496de0=0x0;_0x496de0<_0x2a614f[_0xdde1('0x3a')];_0x496de0+=0x1){let _0x151f1e=_0x2a614f[_0x496de0];for(var _0x5d59b0=0x0;_0x5d59b0<_0x151f1e[_0xdde1('0x67')][_0xdde1('0x3a')];_0x5d59b0+=0x1){let _0x21776d=_0x151f1e[_0xdde1('0x67')][_0x5d59b0];var _0xcb4af3=_0x28b510[_0xdde1('0x7a')]();_0xcb4af3[_0xdde1('0x3f')]('ut.UserId\x20=\x20?',_0x21776d['id']);_0x53eb0d['push'](db[_0xdde1('0x6a')]['query'](_0xcb4af3[_0xdde1('0x7b')](),{'type':db[_0xdde1('0x6a')][_0xdde1('0x7c')][_0xdde1('0x7d')]})[_0xdde1('0x28')](function(_0x577ef2){if(_0x577ef2[_0xdde1('0x3a')]===0x1){return _0x21776d['id'];}else{var _0x144389=_['every'](_[_0xdde1('0x31')](_0x577ef2,_0xdde1('0x7e')),function(_0x470130){return _[_0xdde1('0x7f')](_0x3b0198,_0x470130);});if(_0x144389){return _0x21776d['id'];}}}));}}return BPromise['all'](_0x53eb0d)[_0xdde1('0x28')](function(_0x315091){_0x235d40=_(_0x235d40)[_0xdde1('0x80')](_0x315091)['compact']()[_0xdde1('0x81')]();return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x47e835['params']['id']}})[_0xdde1('0x28')](function(_0x1e9f42){return db[_0xdde1('0x6a')][_0xdde1('0x6b')](function(_0x3db140){return _0x1e9f42[_0xdde1('0x72')](_0x47e835[_0xdde1('0x36')][_0xdde1('0x65')],{'transaction':_0x3db140})[_0xdde1('0x28')](function(){if(!_['isEmpty'](_0x235d40)){return _0x1e9f42[_0xdde1('0x82')](_0x235d40,{'transaction':_0x3db140});}})['then'](function(){_0x235d40[_0xdde1('0x6f')](function(_0x428127){socket['emit'](_0xdde1('0x83'),{'UserId':_0x428127,'WhatsappQueueId':_0x1e9f42['id']});});});});});});})[_0xdde1('0x28')](respondWithStatusCode(_0x33f916,null))[_0xdde1('0x47')](handleError(_0x33f916,null));};exports[_0xdde1('0x84')]=function(_0x8c991,_0x672248,_0x294e25){return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x8c991[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x672248,null))[_0xdde1('0x28')](function(_0x3ead8a){if(_0x3ead8a){return _0x3ead8a[_0xdde1('0x84')](_0x8c991['body'][_0xdde1('0x65')],_['omit'](_0x8c991['body'],[_0xdde1('0x65'),'id'])||{})[_0xdde1('0x85')](function(_0x327fdb){for(var _0xc06a7f=0x0;_0xc06a7f<_0x8c991['body']['ids']['length'];_0xc06a7f+=0x1){socket[_0xdde1('0x70')](_0xdde1('0x71'),{'UserId':Number(_0x8c991[_0xdde1('0x4e')]['ids'][_0xc06a7f]),'WhatsappQueueId':Number(_0x8c991[_0xdde1('0x49')]['id'])});}return _0x327fdb;});}})[_0xdde1('0x28')](respondWithResult(_0x672248,null))[_0xdde1('0x47')](handleError(_0x672248,null));};exports['removeAgents']=function(_0x137a6c,_0x31a93a,_0x440d9e){return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x137a6c['params']['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x31a93a,null))[_0xdde1('0x28')](function(_0x4186dc){if(_0x4186dc){return _0x4186dc[_0xdde1('0x82')](_0x137a6c['query'][_0xdde1('0x65')])['then'](function(){if(_['isArray'](_0x137a6c['query'][_0xdde1('0x65')])){for(var _0x2dcfce=0x0;_0x2dcfce<_0x137a6c[_0xdde1('0x36')][_0xdde1('0x65')]['length'];_0x2dcfce+=0x1){socket[_0xdde1('0x70')](_0xdde1('0x83'),{'UserId':Number(_0x137a6c[_0xdde1('0x36')]['ids'][_0x2dcfce]),'WhatsappQueueId':Number(_0x137a6c[_0xdde1('0x49')]['id'])});}}else{socket[_0xdde1('0x70')]('userWhatsappQueue:remove',{'UserId':Number(_0x137a6c[_0xdde1('0x36')][_0xdde1('0x65')]),'WhatsappQueueId':Number(_0x137a6c[_0xdde1('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x31a93a,null))[_0xdde1('0x47')](handleError(_0x31a93a,null));};exports['getAgents']=function(_0x2ffcce,_0x4ac70f,_0x309c52){var _0x251283={};var _0xe479e0={};var _0x186398;var _0x151dfc;return db['WhatsappQueue'][_0xdde1('0x57')]({'where':{'id':_0x2ffcce[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0x4ac70f,null))['then'](function(_0x309d4a){if(_0x309d4a){_0x186398=_0x309d4a;_0xe479e0[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db[_0xdde1('0x5a')][_0xdde1('0x32')]);_0xe479e0[_0xdde1('0x36')]=_['keys'](_0x2ffcce[_0xdde1('0x36')]);_0xe479e0[_0xdde1('0x3d')]=_[_0xdde1('0x37')](_0xe479e0[_0xdde1('0x35')],_0xe479e0['query']);_0x251283[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0xe479e0[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x39')]));_0x251283['attributes']=_0x251283[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x251283['attributes']:_0xe479e0[_0xdde1('0x35')];_0x251283[_0xdde1('0x59')]=qs['sort'](_0x2ffcce['query'][_0xdde1('0x3c')]);_0x251283[_0xdde1('0x3f')]=qs['filters'](_['pick'](_0x2ffcce['query'],_0xe479e0[_0xdde1('0x3d')]));if(_0x2ffcce[_0xdde1('0x36')]['filter']){_0x251283[_0xdde1('0x3f')]=_['merge'](_0x251283[_0xdde1('0x3f')],{'$or':_['map'](_0x251283[_0xdde1('0x38')],function(_0x2ad6ce){var _0x49974f={};_0x49974f[_0x2ad6ce]={'$like':'%'+_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x49974f;})});}_0x251283=_['merge']({},_0x251283,_0x2ffcce['options']);return _0x186398[_0xdde1('0x86')](_0x251283);}})[_0xdde1('0x28')](function(_0x4dbb70){if(_0x4dbb70){_0x151dfc=_0x4dbb70[_0xdde1('0x3a')];if(!_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x3b')](_0xdde1('0x58'))){_0x251283[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x22')]);_0x251283[_0xdde1('0x20')]=qs['offset'](_0x2ffcce['query']['offset']);}return _0x186398['getAgents'](_0x251283);}})[_0xdde1('0x28')](function(_0x266a3e){if(_0x266a3e){return _0x266a3e?{'count':_0x151dfc,'rows':_0x266a3e}:null;}})[_0xdde1('0x28')](respondWithResult(_0x4ac70f,null))[_0xdde1('0x47')](handleError(_0x4ac70f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index c2c5328..b880a31 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 _0x2625=['../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x545b4a,_0x1de254){var _0x1e5849=function(_0x160643){while(--_0x160643){_0x545b4a['push'](_0x545b4a['shift']());}};_0x1e5849(++_0x1de254);}(_0x2625,0x19e));var _0x5262=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2625[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x5262('0x0'))['db'][_0x5262('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5262('0x2')](0x0);var events={'afterCreate':_0x5262('0x3'),'afterUpdate':'update','afterDestroy':_0x5262('0x4')};function emitEvent(_0x159e6f){return function(_0x1873c0,_0x155c5b,_0x5d4646){WhatsappQueueEvents['emit'](_0x159e6f+':'+_0x1873c0['id'],_0x1873c0);WhatsappQueueEvents[_0x5262('0x5')](_0x159e6f,_0x1873c0);_0x5d4646(null);};}for(var e in events){if(events[_0x5262('0x6')](e)){var event=events[e];WhatsappQueue[_0x5262('0x7')](e,emitEvent(event));}}module[_0x5262('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x15a5=['setMaxListeners','remove','emit','hook','events','../../mysqldb','WhatsappQueue'];(function(_0x5efbd0,_0x299553){var _0x475ec9=function(_0x3752ec){while(--_0x3752ec){_0x5efbd0['push'](_0x5efbd0['shift']());}};_0x475ec9(++_0x299553);}(_0x15a5,0x14d));var _0x515a=function(_0xbd72ab,_0x584e04){_0xbd72ab=_0xbd72ab-0x0;var _0x3284cf=_0x15a5[_0xbd72ab];return _0x3284cf;};'use strict';var EventEmitter=require(_0x515a('0x0'));var WhatsappQueue=require(_0x515a('0x1'))['db'][_0x515a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x515a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x515a('0x4')};function emitEvent(_0x5bd119){return function(_0x1a658e,_0x5d9a98,_0x394ab0){WhatsappQueueEvents[_0x515a('0x5')](_0x5bd119+':'+_0x1a658e['id'],_0x1a658e);WhatsappQueueEvents[_0x515a('0x5')](_0x5bd119,_0x1a658e);_0x394ab0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x515a('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 3bb8b27..ffb4f87 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 _0xf07c=['whatsapp_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xf07c,0x175));var _0xcf07=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf07c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xcf07('0x0'));var util=require(_0xcf07('0x1'));var logger=require(_0xcf07('0x2'))(_0xcf07('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf07('0x4'));var fs=require('fs');var path=require(_0xcf07('0x5'));var rimraf=require(_0xcf07('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf07('0x7'));module[_0xcf07('0x8')]=function(_0x456721,_0x291377){return _0x456721[_0xcf07('0x9')](_0xcf07('0xa'),attributes,{'tableName':_0xcf07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c42=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','whatsapp_queues'];(function(_0x1bab18,_0xcf062){var _0x464bd7=function(_0x5008fc){while(--_0x5008fc){_0x1bab18['push'](_0x1bab18['shift']());}};_0x464bd7(++_0xcf062);}(_0x9c42,0x140));var _0x29c4=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0x9c42[_0xec034];return _0x2c5a19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x29c4('0x0'))(_0x29c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x29c4('0x2'));var fs=require('fs');var path=require(_0x29c4('0x3'));var rimraf=require(_0x29c4('0x4'));var config=require(_0x29c4('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x29c4('0x6')]=function(_0x54d352,_0xfd8d2c){return _0x54d352['define']('WhatsappQueue',attributes,{'tableName':_0x29c4('0x7'),'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 79a4f51..87ad285 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 _0x8f56=['GetWhatsappQueue','catch','where','then','ShowWhatsappQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue','options','raw','attributes','limit','include','map','model'];(function(_0x44b346,_0xeb097d){var _0x1c2f2b=function(_0x4e1f23){while(--_0x4e1f23){_0x44b346['push'](_0x44b346['shift']());}};_0x1c2f2b(++_0xeb097d);}(_0x8f56,0x164));var _0x68f5=function(_0x591d50,_0x51d729){_0x591d50=_0x591d50-0x0;var _0x204b72=_0x8f56[_0x591d50];return _0x204b72;};'use strict';var _=require('lodash');var util=require(_0x68f5('0x0'));var moment=require(_0x68f5('0x1'));var BPromise=require(_0x68f5('0x2'));var rs=require(_0x68f5('0x3'));var fs=require('fs');var Redis=require(_0x68f5('0x4'));var db=require(_0x68f5('0x5'))['db'];var utils=require(_0x68f5('0x6'));var logger=require(_0x68f5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x68f5('0x8'));var client=jayson[_0x68f5('0x9')][_0x68f5('0xa')]({'port':0x232a});config[_0x68f5('0xb')]=_[_0x68f5('0xc')](config[_0x68f5('0xb')],{'host':_0x68f5('0xd'),'port':0x18eb});var socket=require(_0x68f5('0xe'))(new Redis(config[_0x68f5('0xb')]));require(_0x68f5('0xf'))['register'](socket);function respondWithRpcPromise(_0x457e0a,_0x1eab6a,_0x414091){return new BPromise(function(_0x54f28d,_0x40ee4e){return client[_0x68f5('0x10')](_0x457e0a,_0x414091)['then'](function(_0x3f4206){logger[_0x68f5('0x11')](_0x68f5('0x12'),_0x1eab6a,_0x68f5('0x13'));logger[_0x68f5('0x14')](_0x68f5('0x15'),_0x1eab6a,_0x68f5('0x13'),JSON[_0x68f5('0x16')](_0x3f4206));if(_0x3f4206[_0x68f5('0x17')]){if(_0x3f4206[_0x68f5('0x17')][_0x68f5('0x18')]===0x1f4){logger[_0x68f5('0x17')](_0x68f5('0x12'),_0x1eab6a,_0x3f4206['error'][_0x68f5('0x19')]);return _0x40ee4e(_0x3f4206['error'][_0x68f5('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x1eab6a,_0x3f4206[_0x68f5('0x17')][_0x68f5('0x19')]);return _0x54f28d(_0x3f4206[_0x68f5('0x17')][_0x68f5('0x19')]);}else{logger[_0x68f5('0x11')](_0x68f5('0x12'),_0x1eab6a,'request\x20sent');_0x54f28d(_0x3f4206['result'][_0x68f5('0x19')]);}})['catch'](function(_0x50d065){logger[_0x68f5('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x1eab6a,_0x50d065);_0x40ee4e(_0x50d065);});});}exports['GetWhatsappQueue']=function(_0xc64b7){var _0x14e403=this;return new Promise(function(_0x5ebd4c,_0x306574){return db[_0x68f5('0x1a')]['findAll']({'raw':_0xc64b7['options']?_0xc64b7[_0x68f5('0x1b')][_0x68f5('0x1c')]===undefined?!![]:![]:!![],'where':_0xc64b7[_0x68f5('0x1b')]?_0xc64b7[_0x68f5('0x1b')]['where']||null:null,'attributes':_0xc64b7['options']?_0xc64b7[_0x68f5('0x1b')][_0x68f5('0x1d')]||null:null,'limit':_0xc64b7[_0x68f5('0x1b')]?_0xc64b7[_0x68f5('0x1b')][_0x68f5('0x1e')]||null:null,'include':_0xc64b7['options']?_0xc64b7[_0x68f5('0x1b')][_0x68f5('0x1f')]?_[_0x68f5('0x20')](_0xc64b7['options']['include'],function(_0x4382fe){return{'model':db[_0x4382fe[_0x68f5('0x21')]],'as':_0x4382fe['as'],'attributes':_0x4382fe[_0x68f5('0x1d')],'include':_0x4382fe[_0x68f5('0x1f')]?_[_0x68f5('0x20')](_0x4382fe['include'],function(_0x30a96c){return{'model':db[_0x30a96c[_0x68f5('0x21')]],'as':_0x30a96c['as'],'attributes':_0x30a96c['attributes'],'include':_0x30a96c['include']?_[_0x68f5('0x20')](_0x30a96c[_0x68f5('0x1f')],function(_0xc91e64){return{'model':db[_0xc91e64[_0x68f5('0x21')]],'as':_0xc91e64['as'],'attributes':_0xc91e64[_0x68f5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a36dc){logger['info'](_0x68f5('0x22'),_0xc64b7);logger[_0x68f5('0x14')](_0x68f5('0x22'),_0xc64b7,JSON[_0x68f5('0x16')](_0x5a36dc));_0x5ebd4c(_0x5a36dc);})[_0x68f5('0x23')](function(_0x4bc7d1){logger[_0x68f5('0x17')](_0x68f5('0x22'),_0x4bc7d1[_0x68f5('0x19')],_0xc64b7);_0x306574(_0x14e403[_0x68f5('0x17')](0x1f4,_0x4bc7d1['message']));});});};exports['ShowWhatsappQueue']=function(_0x261dce){var _0x2f86b6=this;return new Promise(function(_0x26be09,_0xf46c8b){return db[_0x68f5('0x1a')]['find']({'raw':_0x261dce['options']?_0x261dce[_0x68f5('0x1b')][_0x68f5('0x1c')]===undefined?!![]:![]:!![],'where':_0x261dce[_0x68f5('0x1b')]?_0x261dce[_0x68f5('0x1b')][_0x68f5('0x24')]||null:null,'attributes':_0x261dce[_0x68f5('0x1b')]?_0x261dce[_0x68f5('0x1b')]['attributes']||null:null,'include':_0x261dce[_0x68f5('0x1b')]?_0x261dce[_0x68f5('0x1b')]['include']?_[_0x68f5('0x20')](_0x261dce['options'][_0x68f5('0x1f')],function(_0x54ffc5){return{'model':db[_0x54ffc5['model']],'as':_0x54ffc5['as'],'attributes':_0x54ffc5[_0x68f5('0x1d')],'include':_0x54ffc5[_0x68f5('0x1f')]?_[_0x68f5('0x20')](_0x54ffc5['include'],function(_0x4edd12){return{'model':db[_0x4edd12[_0x68f5('0x21')]],'as':_0x4edd12['as'],'attributes':_0x4edd12[_0x68f5('0x1d')],'include':_0x4edd12[_0x68f5('0x1f')]?_['map'](_0x4edd12[_0x68f5('0x1f')],function(_0x5a6428){return{'model':db[_0x5a6428['model']],'as':_0x5a6428['as'],'attributes':_0x5a6428['attributes']};}):[]};}):[]};}):[]:[]})[_0x68f5('0x25')](function(_0xbb9440){logger[_0x68f5('0x11')](_0x68f5('0x26'),_0x261dce);logger['debug'](_0x68f5('0x26'),_0x261dce,JSON[_0x68f5('0x16')](_0xbb9440));_0x26be09(_0xbb9440);})['catch'](function(_0x315fff){logger[_0x68f5('0x17')](_0x68f5('0x26'),_0x315fff[_0x68f5('0x19')],_0x261dce);_0xf46c8b(_0x2f86b6[_0x68f5('0x17')](0x1f4,_0x315fff[_0x68f5('0x19')]));});});}; \ No newline at end of file +var _0x7a82=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then'];(function(_0x31f86e,_0x49ef55){var _0x3018c4=function(_0x41d0ed){while(--_0x41d0ed){_0x31f86e['push'](_0x31f86e['shift']());}};_0x3018c4(++_0x49ef55);}(_0x7a82,0x69));var _0x27a8=function(_0x174e00,_0x225f0c){_0x174e00=_0x174e00-0x0;var _0x346cdf=_0x7a82[_0x174e00];return _0x346cdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27a8('0x0'));var BPromise=require('bluebird');var rs=require(_0x27a8('0x1'));var fs=require('fs');var Redis=require(_0x27a8('0x2'));var db=require(_0x27a8('0x3'))['db'];var utils=require(_0x27a8('0x4'));var logger=require(_0x27a8('0x5'))('rpc');var config=require(_0x27a8('0x6'));var jayson=require(_0x27a8('0x7'));var client=jayson[_0x27a8('0x8')][_0x27a8('0x9')]({'port':0x232a});config[_0x27a8('0xa')]=_[_0x27a8('0xb')](config['redis'],{'host':_0x27a8('0xc'),'port':0x18eb});var socket=require(_0x27a8('0xd'))(new Redis(config['redis']));require(_0x27a8('0xe'))[_0x27a8('0xf')](socket);function respondWithRpcPromise(_0x46070f,_0x6d0f5f,_0x530647){return new BPromise(function(_0x4f0bfd,_0x5d35d7){return client[_0x27a8('0x10')](_0x46070f,_0x530647)[_0x27a8('0x11')](function(_0x5bbf06){logger[_0x27a8('0x12')](_0x27a8('0x13'),_0x6d0f5f,_0x27a8('0x14'));logger[_0x27a8('0x15')](_0x27a8('0x16'),_0x6d0f5f,_0x27a8('0x14'),JSON[_0x27a8('0x17')](_0x5bbf06));if(_0x5bbf06['error']){if(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x19')]===0x1f4){logger[_0x27a8('0x18')](_0x27a8('0x13'),_0x6d0f5f,_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);return _0x5d35d7(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);}logger[_0x27a8('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x6d0f5f,_0x5bbf06[_0x27a8('0x18')]['message']);return _0x4f0bfd(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);}else{logger[_0x27a8('0x12')](_0x27a8('0x13'),_0x6d0f5f,_0x27a8('0x14'));_0x4f0bfd(_0x5bbf06['result']['message']);}})[_0x27a8('0x1b')](function(_0x50f448){logger[_0x27a8('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x6d0f5f,_0x50f448);_0x5d35d7(_0x50f448);});});}exports[_0x27a8('0x1c')]=function(_0x5cf0be){var _0x11a98e=this;return new Promise(function(_0x5f4a2a,_0x57c16b){return db[_0x27a8('0x1d')][_0x27a8('0x1e')]({'raw':_0x5cf0be['options']?_0x5cf0be[_0x27a8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x20')]||null:null,'attributes':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x21')]||null:null,'limit':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x22')]||null:null,'include':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x23')]?_[_0x27a8('0x24')](_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x23')],function(_0x1ba393){return{'model':db[_0x1ba393[_0x27a8('0x25')]],'as':_0x1ba393['as'],'attributes':_0x1ba393[_0x27a8('0x21')],'include':_0x1ba393[_0x27a8('0x23')]?_['map'](_0x1ba393[_0x27a8('0x23')],function(_0x188ad5){return{'model':db[_0x188ad5[_0x27a8('0x25')]],'as':_0x188ad5['as'],'attributes':_0x188ad5[_0x27a8('0x21')],'include':_0x188ad5['include']?_[_0x27a8('0x24')](_0x188ad5['include'],function(_0x3c1ce9){return{'model':db[_0x3c1ce9[_0x27a8('0x25')]],'as':_0x3c1ce9['as'],'attributes':_0x3c1ce9[_0x27a8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd4a5a1){logger[_0x27a8('0x12')]('GetWhatsappQueue',_0x5cf0be);logger[_0x27a8('0x15')](_0x27a8('0x1c'),_0x5cf0be,JSON[_0x27a8('0x17')](_0xd4a5a1));_0x5f4a2a(_0xd4a5a1);})[_0x27a8('0x1b')](function(_0x8b854c){logger[_0x27a8('0x18')](_0x27a8('0x1c'),_0x8b854c[_0x27a8('0x1a')],_0x5cf0be);_0x57c16b(_0x11a98e[_0x27a8('0x18')](0x1f4,_0x8b854c['message']));});});};exports[_0x27a8('0x26')]=function(_0x1f4165){var _0x5a2403=this;return new Promise(function(_0x5e8cf2,_0x4862fa){return db[_0x27a8('0x1d')][_0x27a8('0x27')]({'raw':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165['options'][_0x27a8('0x28')]===undefined?!![]:![]:!![],'where':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165[_0x27a8('0x1f')][_0x27a8('0x20')]||null:null,'attributes':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165['options'][_0x27a8('0x21')]||null:null,'include':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165[_0x27a8('0x1f')][_0x27a8('0x23')]?_[_0x27a8('0x24')](_0x1f4165['options'][_0x27a8('0x23')],function(_0x265df8){return{'model':db[_0x265df8[_0x27a8('0x25')]],'as':_0x265df8['as'],'attributes':_0x265df8[_0x27a8('0x21')],'include':_0x265df8['include']?_[_0x27a8('0x24')](_0x265df8[_0x27a8('0x23')],function(_0x532609){return{'model':db[_0x532609[_0x27a8('0x25')]],'as':_0x532609['as'],'attributes':_0x532609['attributes'],'include':_0x532609['include']?_[_0x27a8('0x24')](_0x532609[_0x27a8('0x23')],function(_0x388528){return{'model':db[_0x388528[_0x27a8('0x25')]],'as':_0x388528['as'],'attributes':_0x388528[_0x27a8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x27a8('0x11')](function(_0x19d0de){logger[_0x27a8('0x12')](_0x27a8('0x26'),_0x1f4165);logger[_0x27a8('0x15')](_0x27a8('0x26'),_0x1f4165,JSON[_0x27a8('0x17')](_0x19d0de));_0x5e8cf2(_0x19d0de);})['catch'](function(_0x3c24ed){logger[_0x27a8('0x18')]('ShowWhatsappQueue',_0x3c24ed[_0x27a8('0x1a')],_0x1f4165);_0x4862fa(_0x5a2403[_0x27a8('0x18')](0x1f4,_0x3c24ed['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 23fca2a..29b6044 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 _0xa89f=['./whatsappQueue.events','remove','update','emit','removeListener','length','whatsappQueue:'];(function(_0x16472b,_0x557088){var _0x53ea3f=function(_0x33a61e){while(--_0x33a61e){_0x16472b['push'](_0x16472b['shift']());}};_0x53ea3f(++_0x557088);}(_0xa89f,0x16c));var _0xfa89=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0xa89f[_0x5341ff];return _0x53be58;};'use strict';var WhatsappQueueEvents=require(_0xfa89('0x0'));var events=['save',_0xfa89('0x1'),_0xfa89('0x2')];function createListener(_0x5503c5,_0x25bddc){return function(_0x46d7e5){_0x25bddc[_0xfa89('0x3')](_0x5503c5,_0x46d7e5);};}function removeListener(_0xe57fb2,_0x1f2b21){return function(){WhatsappQueueEvents[_0xfa89('0x4')](_0xe57fb2,_0x1f2b21);};}exports['register']=function(_0x1b5ad3){for(var _0x1f8dda=0x0,_0x17d940=events[_0xfa89('0x5')];_0x1f8dda<_0x17d940;_0x1f8dda++){var _0x3e1b5e=events[_0x1f8dda];var _0x15ee0f=createListener(_0xfa89('0x6')+_0x3e1b5e,_0x1b5ad3);WhatsappQueueEvents['on'](_0x3e1b5e,_0x15ee0f);}}; \ No newline at end of file +var _0x73a3=['update','emit','removeListener','register','length','./whatsappQueue.events','remove'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x73a3,0x15c));var _0x373a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x73a3[_0xbd08b4];return _0x314f1e;};'use strict';var WhatsappQueueEvents=require(_0x373a('0x0'));var events=['save',_0x373a('0x1'),_0x373a('0x2')];function createListener(_0x1978bd,_0x26b776){return function(_0x5d4377){_0x26b776[_0x373a('0x3')](_0x1978bd,_0x5d4377);};}function removeListener(_0x2e5fcc,_0x4a4971){return function(){WhatsappQueueEvents[_0x373a('0x4')](_0x2e5fcc,_0x4a4971);};}exports[_0x373a('0x5')]=function(_0x34c1ea){for(var _0x113987=0x0,_0x49ff86=events[_0x373a('0x6')];_0x113987<_0x49ff86;_0x113987++){var _0x1a24e3=events[_0x113987];var _0x42f315=createListener('whatsappQueue:'+_0x1a24e3,_0x34c1ea);WhatsappQueueEvents['on'](_0x1a24e3,_0x42f315);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 5fff9ad..3c61b25 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 _0x7f52=['isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe'];(function(_0x70cc36,_0x31a71a){var _0x516ad=function(_0x1187fa){while(--_0x1187fa){_0x70cc36['push'](_0x70cc36['shift']());}};_0x516ad(++_0x31a71a);}(_0x7f52,0x6c));var _0x27f5=function(_0x455580,_0x5cd4dd){_0x455580=_0x455580-0x0;var _0x7aabc2=_0x7f52[_0x455580];return _0x7aabc2;};'use strict';var multer=require(_0x27f5('0x0'));var util=require('util');var path=require(_0x27f5('0x1'));var timeout=require('connect-timeout');var express=require(_0x27f5('0x2'));var router=express[_0x27f5('0x3')]();var fs_extra=require(_0x27f5('0x4'));var auth=require(_0x27f5('0x5'));var interaction=require(_0x27f5('0x6'));var config=require(_0x27f5('0x7'));var controller=require(_0x27f5('0x8'));router[_0x27f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x27f5('0xa')]);router['get'](_0x27f5('0xb'),auth[_0x27f5('0xc')](),controller[_0x27f5('0xd')]);router[_0x27f5('0x9')](_0x27f5('0xe'),auth['isAuthenticated'](),controller[_0x27f5('0xf')]);router[_0x27f5('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x27f5('0x11')](_0x27f5('0xe'),auth[_0x27f5('0xc')](),controller['update']);router['delete'](_0x27f5('0xe'),auth[_0x27f5('0xc')](),controller[_0x27f5('0x12')]);module[_0x27f5('0x13')]=router; \ No newline at end of file +var _0x40e0=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x5bcb50,_0x7861a){var _0x54bc84=function(_0x25639b){while(--_0x25639b){_0x5bcb50['push'](_0x5bcb50['shift']());}};_0x54bc84(++_0x7861a);}(_0x40e0,0x1b9));var _0x040e=function(_0x490699,_0x161e16){_0x490699=_0x490699-0x0;var _0x207b0a=_0x40e0[_0x490699];return _0x207b0a;};'use strict';var multer=require(_0x040e('0x0'));var util=require(_0x040e('0x1'));var path=require(_0x040e('0x2'));var timeout=require('connect-timeout');var express=require(_0x040e('0x3'));var router=express[_0x040e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x040e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x040e('0x6'));var controller=require(_0x040e('0x7'));router[_0x040e('0x8')]('/',auth[_0x040e('0x9')](),controller[_0x040e('0xa')]);router[_0x040e('0x8')](_0x040e('0xb'),auth[_0x040e('0x9')](),controller[_0x040e('0xc')]);router[_0x040e('0x8')](_0x040e('0xd'),auth['isAuthenticated'](),controller[_0x040e('0xe')]);router[_0x040e('0xf')]('/',auth[_0x040e('0x9')](),controller[_0x040e('0x10')]);router[_0x040e('0x11')](_0x040e('0xd'),auth[_0x040e('0x9')](),controller['update']);router['delete'](_0x040e('0xd'),auth[_0x040e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index fed88a6..005a389 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(_0x1ad558,_0x532ea2){var _0x7637fb=function(_0x24309c){while(--_0x24309c){_0x1ad558['push'](_0x1ad558['shift']());}};_0x7637fb(++_0x532ea2);}(_0x7a54,0x106));var _0x47a5=function(_0x1ff24b,_0x3d4188){_0x1ff24b=_0x1ff24b-0x0;var _0x845fdd=_0x7a54[_0x1ff24b];return _0x845fdd;};'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(_0x25a71b,_0x4799c8){var _0xcfa61d=function(_0x2e4602){while(--_0x2e4602){_0x25a71b['push'](_0x25a71b['shift']());}};_0xcfa61d(++_0x4799c8);}(_0x7a54,0x106));var _0x47a5=function(_0x75ca63,_0x155c82){_0x75ca63=_0x75ca63-0x0;var _0x39bae8=_0x7a54[_0x75ca63];return _0x39bae8;};'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 0e955c0..9a7efd9 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 _0x2547=['order','where','pick','filter','merge','VIRTUAL','options','WhatsappQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2547,0x1cd));var _0x7254=function(_0x75126a,_0x22873d){_0x75126a=_0x75126a-0x0;var _0x25ebea=_0x2547[_0x75126a];return _0x25ebea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x50c34b[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x36b5d5,_0x133aee){return function(_0x5d6df5){if(!_0x5d6df5){_0x36b5d5[_0x7254('0x17')](0x194);}return _0x5d6df5;};}function handleError(_0x21a579,_0x2b4f46){_0x2b4f46=_0x2b4f46||0x1f4;return function(_0x494cdb){logger[_0x7254('0x27')](_0x494cdb['stack']);if(_0x494cdb[_0x7254('0x28')]){delete _0x494cdb[_0x7254('0x28')];}_0x21a579['status'](_0x2b4f46)[_0x7254('0x29')](_0x494cdb);};}exports[_0x7254('0x2a')]=function(_0x4f684c,_0x14cbea){var _0x6c4927={},_0x37cb5c={},_0xb9198b={'count':0x0,'rows':[]};var _0x43bf02=_[_0x7254('0x2b')](db['WhatsappQueueReport'][_0x7254('0x2c')],function(_0x2dba3f){return{'name':_0x2dba3f['fieldName'],'type':_0x2dba3f[_0x7254('0x2d')][_0x7254('0x2e')]};});_0x37cb5c[_0x7254('0x2f')]=_['map'](_0x43bf02,_0x7254('0x28'));_0x37cb5c[_0x7254('0x30')]=_[_0x7254('0x31')](_0x4f684c[_0x7254('0x30')]);_0x37cb5c[_0x7254('0x32')]=_[_0x7254('0x33')](_0x37cb5c[_0x7254('0x2f')],_0x37cb5c['query']);_0x6c4927[_0x7254('0x34')]=_['intersection'](_0x37cb5c['model'],qs[_0x7254('0x35')](_0x4f684c[_0x7254('0x30')][_0x7254('0x35')]));_0x6c4927[_0x7254('0x34')]=_0x6c4927[_0x7254('0x34')][_0x7254('0x36')]?_0x6c4927[_0x7254('0x34')]:_0x37cb5c[_0x7254('0x2f')];if(!_0x4f684c[_0x7254('0x30')][_0x7254('0x37')](_0x7254('0x38'))){_0x6c4927[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x4f684c[_0x7254('0x30')]['limit']);_0x6c4927[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x4f684c[_0x7254('0x30')][_0x7254('0x1b')]);}_0x6c4927[_0x7254('0x39')]=qs['sort'](_0x4f684c[_0x7254('0x30')]['sort']);_0x6c4927[_0x7254('0x3a')]=qs[_0x7254('0x32')](_[_0x7254('0x3b')](_0x4f684c[_0x7254('0x30')],_0x37cb5c[_0x7254('0x32')]),_0x43bf02);if(_0x4f684c['query'][_0x7254('0x3c')]){_0x6c4927['where']=_[_0x7254('0x3d')](_0x6c4927[_0x7254('0x3a')],{'$or':_['map'](_0x43bf02,function(_0x1485a0){if(_0x1485a0[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x9273ee={};_0x9273ee[_0x1485a0[_0x7254('0x28')]]={'$like':'%'+_0x4f684c[_0x7254('0x30')]['filter']+'%'};return _0x9273ee;}})});}_0x6c4927=_[_0x7254('0x3d')]({},_0x6c4927,_0x4f684c[_0x7254('0x3f')]);var _0x105b8c={'where':_0x6c4927['where']};return db[_0x7254('0x40')][_0x7254('0x1e')](_0x105b8c)[_0x7254('0x25')](function(_0x4824d5){_0xb9198b[_0x7254('0x1e')]=_0x4824d5;if(_0x4f684c[_0x7254('0x30')][_0x7254('0x41')]){_0x6c4927[_0x7254('0x42')]=[{'all':!![]}];}return db[_0x7254('0x40')]['findAll'](_0x6c4927);})['then'](function(_0x25004f){_0xb9198b[_0x7254('0x43')]=_0x25004f;return _0xb9198b;})[_0x7254('0x25')](respondWithFilteredResult(_0x14cbea,_0x6c4927))[_0x7254('0x44')](handleError(_0x14cbea,null));};exports['show']=function(_0x53a7a7,_0x29821a){var _0x565cd8={'raw':!![],'where':{'id':_0x53a7a7[_0x7254('0x45')]['id']}},_0x2ae22e={};_0x2ae22e[_0x7254('0x2f')]=_[_0x7254('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x2ae22e[_0x7254('0x30')]=_[_0x7254('0x31')](_0x53a7a7[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x32')]=_[_0x7254('0x33')](_0x2ae22e['model'],_0x2ae22e['query']);_0x565cd8[_0x7254('0x34')]=_[_0x7254('0x33')](_0x2ae22e[_0x7254('0x2f')],qs['fields'](_0x53a7a7[_0x7254('0x30')][_0x7254('0x35')]));_0x565cd8['attributes']=_0x565cd8[_0x7254('0x34')][_0x7254('0x36')]?_0x565cd8[_0x7254('0x34')]:_0x2ae22e[_0x7254('0x2f')];if(_0x53a7a7['query'][_0x7254('0x41')]){_0x565cd8[_0x7254('0x42')]=[{'all':!![]}];}_0x565cd8=_['merge']({},_0x565cd8,_0x53a7a7[_0x7254('0x3f')]);return db[_0x7254('0x40')][_0x7254('0x46')](_0x565cd8)['then'](handleEntityNotFound(_0x29821a,null))[_0x7254('0x25')](respondWithResult(_0x29821a,null))[_0x7254('0x44')](handleError(_0x29821a,null));};exports['create']=function(_0x5f101e,_0x10b32f){return db['WhatsappQueueReport'][_0x7254('0x47')](_0x5f101e[_0x7254('0x48')],{})['then'](respondWithResult(_0x10b32f,0xc9))['catch'](handleError(_0x10b32f,null));};exports[_0x7254('0x24')]=function(_0xc40bc5,_0x38bcd5){if(_0xc40bc5[_0x7254('0x48')]['id']){delete _0xc40bc5[_0x7254('0x48')]['id'];}return db[_0x7254('0x40')]['find']({'where':{'id':_0xc40bc5[_0x7254('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bcd5,null))[_0x7254('0x25')](saveUpdates(_0xc40bc5[_0x7254('0x48')],null))[_0x7254('0x25')](respondWithResult(_0x38bcd5,null))['catch'](handleError(_0x38bcd5,null));};exports[_0x7254('0x26')]=function(_0x1c1a0e,_0x252758){return db['WhatsappQueueReport'][_0x7254('0x46')]({'where':{'id':_0x1c1a0e[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x252758,null))[_0x7254('0x25')](removeEntity(_0x252758,null))[_0x7254('0x44')](handleError(_0x252758,null));};exports['describe']=function(_0x5e66c6,_0x24c532){return db[_0x7254('0x40')][_0x7254('0x49')]()[_0x7254('0x25')](respondWithResult(_0x24c532,null))[_0x7254('0x44')](handleError(_0x24c532,null));}; \ No newline at end of file +var _0xc900=['filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query'];(function(_0x5fc42c,_0x42ff9a){var _0x3b791a=function(_0x19052c){while(--_0x19052c){_0x5fc42c['push'](_0x5fc42c['shift']());}};_0x3b791a(++_0x42ff9a);}(_0xc900,0xb3));var _0x0c90=function(_0x473cb7,_0x2e8642){_0x473cb7=_0x473cb7-0x0;var _0x43ce02=_0xc900[_0x473cb7];return _0x43ce02;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];function respondWithStatusCode(_0x50e7db,_0x459cdb){_0x459cdb=_0x459cdb||0xcc;return function(_0x26fc46){if(_0x26fc46){return _0x50e7db[_0x0c90('0x19')](_0x459cdb);}return _0x50e7db[_0x0c90('0x1a')](_0x459cdb)[_0x0c90('0x1b')]();};}function respondWithResult(_0x59ea8e,_0x467b32){_0x467b32=_0x467b32||0xc8;return function(_0x4451e0){if(_0x4451e0){return _0x59ea8e['status'](_0x467b32)[_0x0c90('0x1c')](_0x4451e0);}};}function respondWithFilteredResult(_0x3a492d,_0x3bd5e8){return function(_0x5bef7d){if(_0x5bef7d){var _0x5daeb7=typeof _0x3bd5e8[_0x0c90('0x1d')]===_0x0c90('0x1e')&&typeof _0x3bd5e8[_0x0c90('0x1f')]===_0x0c90('0x1e');var _0x276b92=_0x5bef7d[_0x0c90('0x20')];var _0x42321a=_0x5daeb7?0x0:_0x3bd5e8['offset'];var _0xc3bb47=_0x5daeb7?_0x5bef7d[_0x0c90('0x20')]:_0x3bd5e8[_0x0c90('0x1d')]+_0x3bd5e8[_0x0c90('0x1f')];var _0x594267;if(_0xc3bb47>=_0x276b92){_0xc3bb47=_0x276b92;_0x594267=0xc8;}else{_0x594267=0xce;}_0x3a492d[_0x0c90('0x1a')](_0x594267);return _0x3a492d[_0x0c90('0x21')](_0x0c90('0x22'),_0x42321a+'-'+_0xc3bb47+'/'+_0x276b92)[_0x0c90('0x1c')](_0x5bef7d);}return null;};}function patchUpdates(_0x315932){return function(_0xc08f54){try{jsonpatch['apply'](_0xc08f54,_0x315932,!![]);}catch(_0x365a42){return BPromise['reject'](_0x365a42);}return _0xc08f54[_0x0c90('0x23')]();};}function saveUpdates(_0x1a021e,_0x47b13c){return function(_0x2a053a){if(_0x2a053a){return _0x2a053a[_0x0c90('0x24')](_0x1a021e)[_0x0c90('0x25')](function(_0x86dee){return _0x86dee;});}return null;};}function removeEntity(_0x212164,_0x3b287c){return function(_0x4dfbc3){if(_0x4dfbc3){return _0x4dfbc3[_0x0c90('0x26')]()[_0x0c90('0x25')](function(){_0x212164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28d005,_0x3ea861){return function(_0x35c243){if(!_0x35c243){_0x28d005[_0x0c90('0x19')](0x194);}return _0x35c243;};}function handleError(_0x4dde67,_0x2dfa14){_0x2dfa14=_0x2dfa14||0x1f4;return function(_0x438652){logger[_0x0c90('0x27')](_0x438652[_0x0c90('0x28')]);if(_0x438652[_0x0c90('0x29')]){delete _0x438652[_0x0c90('0x29')];}_0x4dde67['status'](_0x2dfa14)[_0x0c90('0x2a')](_0x438652);};}exports[_0x0c90('0x2b')]=function(_0x39f1b2,_0x13b377){var _0x52d28d={},_0x4c8603={},_0x1f27f1={'count':0x0,'rows':[]};var _0x25da6e=_[_0x0c90('0x2c')](db[_0x0c90('0x2d')][_0x0c90('0x2e')],function(_0x562664){return{'name':_0x562664[_0x0c90('0x2f')],'type':_0x562664[_0x0c90('0x30')][_0x0c90('0x31')]};});_0x4c8603['model']=_[_0x0c90('0x2c')](_0x25da6e,'name');_0x4c8603['query']=_[_0x0c90('0x32')](_0x39f1b2[_0x0c90('0x33')]);_0x4c8603[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x4c8603['model'],_0x4c8603[_0x0c90('0x33')]);_0x52d28d['attributes']=_[_0x0c90('0x35')](_0x4c8603['model'],qs[_0x0c90('0x36')](_0x39f1b2[_0x0c90('0x33')]['fields']));_0x52d28d[_0x0c90('0x37')]=_0x52d28d[_0x0c90('0x37')][_0x0c90('0x38')]?_0x52d28d[_0x0c90('0x37')]:_0x4c8603[_0x0c90('0x39')];if(!_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3a')](_0x0c90('0x3b'))){_0x52d28d['limit']=qs[_0x0c90('0x1f')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1f')]);_0x52d28d[_0x0c90('0x1d')]=qs['offset'](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1d')]);}_0x52d28d[_0x0c90('0x3c')]=qs[_0x0c90('0x3d')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3d')]);_0x52d28d[_0x0c90('0x3e')]=qs[_0x0c90('0x34')](_['pick'](_0x39f1b2[_0x0c90('0x33')],_0x4c8603[_0x0c90('0x34')]),_0x25da6e);if(_0x39f1b2['query'][_0x0c90('0x3f')]){_0x52d28d[_0x0c90('0x3e')]=_[_0x0c90('0x40')](_0x52d28d[_0x0c90('0x3e')],{'$or':_[_0x0c90('0x2c')](_0x25da6e,function(_0x50c126){if(_0x50c126[_0x0c90('0x30')]!==_0x0c90('0x41')){var _0x11530f={};_0x11530f[_0x50c126[_0x0c90('0x29')]]={'$like':'%'+_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3f')]+'%'};return _0x11530f;}})});}_0x52d28d=_[_0x0c90('0x40')]({},_0x52d28d,_0x39f1b2[_0x0c90('0x42')]);var _0x11a8e3={'where':_0x52d28d['where']};return db[_0x0c90('0x2d')]['count'](_0x11a8e3)[_0x0c90('0x25')](function(_0x593cc0){_0x1f27f1[_0x0c90('0x20')]=_0x593cc0;if(_0x39f1b2[_0x0c90('0x33')]['includeAll']){_0x52d28d['include']=[{'all':!![]}];}return db[_0x0c90('0x2d')]['findAll'](_0x52d28d);})[_0x0c90('0x25')](function(_0x4545bb){_0x1f27f1[_0x0c90('0x43')]=_0x4545bb;return _0x1f27f1;})['then'](respondWithFilteredResult(_0x13b377,_0x52d28d))[_0x0c90('0x44')](handleError(_0x13b377,null));};exports[_0x0c90('0x45')]=function(_0x123b58,_0x3e5137){var _0x2139c3={'raw':!![],'where':{'id':_0x123b58['params']['id']}},_0x1184c4={};_0x1184c4[_0x0c90('0x39')]=_[_0x0c90('0x32')](db[_0x0c90('0x2d')][_0x0c90('0x2e')]);_0x1184c4[_0x0c90('0x33')]=_[_0x0c90('0x32')](_0x123b58[_0x0c90('0x33')]);_0x1184c4['filters']=_[_0x0c90('0x35')](_0x1184c4['model'],_0x1184c4[_0x0c90('0x33')]);_0x2139c3[_0x0c90('0x37')]=_[_0x0c90('0x35')](_0x1184c4[_0x0c90('0x39')],qs[_0x0c90('0x36')](_0x123b58[_0x0c90('0x33')][_0x0c90('0x36')]));_0x2139c3[_0x0c90('0x37')]=_0x2139c3[_0x0c90('0x37')][_0x0c90('0x38')]?_0x2139c3[_0x0c90('0x37')]:_0x1184c4[_0x0c90('0x39')];if(_0x123b58[_0x0c90('0x33')][_0x0c90('0x46')]){_0x2139c3[_0x0c90('0x47')]=[{'all':!![]}];}_0x2139c3=_['merge']({},_0x2139c3,_0x123b58[_0x0c90('0x42')]);return db[_0x0c90('0x2d')][_0x0c90('0x48')](_0x2139c3)[_0x0c90('0x25')](handleEntityNotFound(_0x3e5137,null))[_0x0c90('0x25')](respondWithResult(_0x3e5137,null))[_0x0c90('0x44')](handleError(_0x3e5137,null));};exports[_0x0c90('0x49')]=function(_0x302dc6,_0x3bb138){return db[_0x0c90('0x2d')][_0x0c90('0x49')](_0x302dc6[_0x0c90('0x4a')],{})[_0x0c90('0x25')](respondWithResult(_0x3bb138,0xc9))[_0x0c90('0x44')](handleError(_0x3bb138,null));};exports['update']=function(_0x1b4aac,_0x38f492){if(_0x1b4aac['body']['id']){delete _0x1b4aac['body']['id'];}return db['WhatsappQueueReport'][_0x0c90('0x48')]({'where':{'id':_0x1b4aac[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x38f492,null))[_0x0c90('0x25')](saveUpdates(_0x1b4aac[_0x0c90('0x4a')],null))['then'](respondWithResult(_0x38f492,null))[_0x0c90('0x44')](handleError(_0x38f492,null));};exports[_0x0c90('0x26')]=function(_0x2b756d,_0x549c78){return db[_0x0c90('0x2d')][_0x0c90('0x48')]({'where':{'id':_0x2b756d[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x549c78,null))[_0x0c90('0x25')](removeEntity(_0x549c78,null))[_0x0c90('0x44')](handleError(_0x549c78,null));};exports[_0x0c90('0x4c')]=function(_0x2a339d,_0x1daeed){return db[_0x0c90('0x2d')]['describe']()[_0x0c90('0x25')](respondWithResult(_0x1daeed,null))['catch'](handleError(_0x1daeed,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 96acb71..e3e3363 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 _0x85f9=['bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5ed3f4,_0x42d58c){var _0x4a619d=function(_0x1ee01){while(--_0x1ee01){_0x5ed3f4['push'](_0x5ed3f4['shift']());}};_0x4a619d(++_0x42d58c);}(_0x85f9,0x7a));var _0x985f=function(_0x55ac0c,_0x3df355){_0x55ac0c=_0x55ac0c-0x0;var _0x460830=_0x85f9[_0x55ac0c];return _0x460830;};'use strict';var _=require(_0x985f('0x0'));var util=require(_0x985f('0x1'));var logger=require(_0x985f('0x2'))(_0x985f('0x3'));var moment=require('moment');var BPromise=require(_0x985f('0x4'));var rp=require(_0x985f('0x5'));var fs=require('fs');var path=require(_0x985f('0x6'));var rimraf=require('rimraf');var config=require(_0x985f('0x7'));var attributes=require(_0x985f('0x8'));module[_0x985f('0x9')]=function(_0x49eef9,_0x27ec12){return _0x49eef9[_0x985f('0xa')](_0x985f('0xb'),attributes,{'tableName':_0x985f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x985f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x277c=['../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x277c,0x132));var _0xc277=function(_0xae2f00,_0x32d92f){_0xae2f00=_0xae2f00-0x0;var _0x1c9147=_0x277c[_0xae2f00];return _0x1c9147;};'use strict';var _=require('lodash');var util=require(_0xc277('0x0'));var logger=require(_0xc277('0x1'))('api');var moment=require(_0xc277('0x2'));var BPromise=require(_0xc277('0x3'));var rp=require(_0xc277('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc277('0x5'));var config=require(_0xc277('0x6'));var attributes=require(_0xc277('0x7'));module[_0xc277('0x8')]=function(_0x23b82f,_0x19efbd){return _0x23b82f[_0xc277('0x9')](_0xc277('0xa'),attributes,{'tableName':_0xc277('0xb'),'paranoid':![],'indexes':[{'name':_0xc277('0xc'),'fields':[_0xc277('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index dce2282..5a21974 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 _0x912d=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','UpdateWhatsappQueueReport','where','attributes','limit','util','moment'];(function(_0x209c61,_0x46f389){var _0x3994c7=function(_0x423ef8){while(--_0x423ef8){_0x209c61['push'](_0x209c61['shift']());}};_0x3994c7(++_0x46f389);}(_0x912d,0x1de));var _0xd912=function(_0x1e9c70,_0x368b6b){_0x1e9c70=_0x1e9c70-0x0;var _0x517ec3=_0x912d[_0x1e9c70];return _0x517ec3;};'use strict';var _=require('lodash');var util=require(_0xd912('0x0'));var moment=require(_0xd912('0x1'));var BPromise=require(_0xd912('0x2'));var rs=require(_0xd912('0x3'));var fs=require('fs');var Redis=require(_0xd912('0x4'));var db=require(_0xd912('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd912('0x6'));var config=require(_0xd912('0x7'));var jayson=require(_0xd912('0x8'));var client=jayson[_0xd912('0x9')][_0xd912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x246cfd,_0x318704,_0x58765d){return new BPromise(function(_0x5ef44b,_0x194e6e){return client[_0xd912('0xb')](_0x246cfd,_0x58765d)[_0xd912('0xc')](function(_0x38ef58){logger[_0xd912('0xd')](_0xd912('0xe'),_0x318704,_0xd912('0xf'));logger[_0xd912('0x10')](_0xd912('0x11'),_0x318704,_0xd912('0xf'),JSON[_0xd912('0x12')](_0x38ef58));if(_0x38ef58[_0xd912('0x13')]){if(_0x38ef58['error'][_0xd912('0x14')]===0x1f4){logger[_0xd912('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x318704,_0x38ef58['error'][_0xd912('0x15')]);return _0x194e6e(_0x38ef58[_0xd912('0x13')]['message']);}logger[_0xd912('0x13')](_0xd912('0xe'),_0x318704,_0x38ef58[_0xd912('0x13')][_0xd912('0x15')]);return _0x5ef44b(_0x38ef58['error'][_0xd912('0x15')]);}else{logger['info'](_0xd912('0xe'),_0x318704,_0xd912('0xf'));_0x5ef44b(_0x38ef58[_0xd912('0x16')][_0xd912('0x15')]);}})[_0xd912('0x17')](function(_0x29bf91){logger[_0xd912('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x318704,_0x29bf91);_0x194e6e(_0x29bf91);});});}exports[_0xd912('0x18')]=function(_0x5a40cc){var _0x4e1087=this;return new Promise(function(_0x3bf4a9,_0xb79ce9){return db[_0xd912('0x19')]['create'](_0x5a40cc[_0xd912('0x1a')],{'raw':_0x5a40cc[_0xd912('0x1b')]?_0x5a40cc[_0xd912('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xd912('0xc')](function(_0x4690f1){logger[_0xd912('0xd')](_0xd912('0x18'),_0x5a40cc);logger['debug'](_0xd912('0x18'),_0x5a40cc,JSON[_0xd912('0x12')](_0x4690f1));_0x3bf4a9(_0x4690f1);})[_0xd912('0x17')](function(_0x4b2055){logger[_0xd912('0x13')]('CreateWhatsappQueueReport',_0x4b2055['message'],_0x5a40cc);_0xb79ce9(_0x4e1087[_0xd912('0x13')](0x1f4,_0x4b2055[_0xd912('0x15')]));});});};exports[_0xd912('0x1c')]=function(_0x3a22a7){var _0x1e973b=this;return new Promise(function(_0x2d706d,_0x5323fe){return db['WhatsappQueueReport']['update'](_0x3a22a7[_0xd912('0x1a')],{'raw':_0x3a22a7[_0xd912('0x1b')]?_0x3a22a7[_0xd912('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a22a7[_0xd912('0x1b')]?_0x3a22a7['options'][_0xd912('0x1d')]||null:null,'attributes':_0x3a22a7[_0xd912('0x1b')]?_0x3a22a7['options'][_0xd912('0x1e')]||null:null,'limit':_0x3a22a7['options']?_0x3a22a7['options'][_0xd912('0x1f')]||null:null})[_0xd912('0xc')](function(_0x4ea638){logger[_0xd912('0xd')](_0xd912('0x1c'),_0x3a22a7);logger[_0xd912('0x10')](_0xd912('0x1c'),_0x3a22a7,JSON[_0xd912('0x12')](_0x4ea638));_0x2d706d(_0x4ea638);})['catch'](function(_0x5c0f39){logger[_0xd912('0x13')](_0xd912('0x1c'),_0x5c0f39[_0xd912('0x15')],_0x3a22a7);_0x5323fe(_0x1e973b['error'](0x1f4,_0x5c0f39[_0xd912('0x15')]));});});}; \ No newline at end of file +var _0xb7c1=['../../config/utils','rpc','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueueReport','body','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','options','where','attributes','lodash','util','bluebird','randomstring'];(function(_0x31316c,_0x3a77c5){var _0x3c0579=function(_0x4450f7){while(--_0x4450f7){_0x31316c['push'](_0x31316c['shift']());}};_0x3c0579(++_0x3a77c5);}(_0xb7c1,0x10a));var _0x1b7c=function(_0x19fe32,_0x3ff97f){_0x19fe32=_0x19fe32-0x0;var _0x318ab7=_0xb7c1[_0x19fe32];return _0x318ab7;};'use strict';var _=require(_0x1b7c('0x0'));var util=require(_0x1b7c('0x1'));var moment=require('moment');var BPromise=require(_0x1b7c('0x2'));var rs=require(_0x1b7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b7c('0x4'));var logger=require('../../config/logger')(_0x1b7c('0x5'));var config=require('../../config/environment');var jayson=require(_0x1b7c('0x6'));var client=jayson[_0x1b7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d22d5,_0x398d8a,_0x462307){return new BPromise(function(_0x558c84,_0x39dea6){return client[_0x1b7c('0x8')](_0x3d22d5,_0x462307)[_0x1b7c('0x9')](function(_0x232e10){logger[_0x1b7c('0xa')](_0x1b7c('0xb'),_0x398d8a,_0x1b7c('0xc'));logger[_0x1b7c('0xd')](_0x1b7c('0xe'),_0x398d8a,'request\x20sent',JSON[_0x1b7c('0xf')](_0x232e10));if(_0x232e10['error']){if(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x11')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x398d8a,_0x232e10[_0x1b7c('0x10')]['message']);return _0x39dea6(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x12')]);}logger[_0x1b7c('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x398d8a,_0x232e10[_0x1b7c('0x10')]['message']);return _0x558c84(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x12')]);}else{logger[_0x1b7c('0xa')](_0x1b7c('0xb'),_0x398d8a,_0x1b7c('0xc'));_0x558c84(_0x232e10[_0x1b7c('0x13')][_0x1b7c('0x12')]);}})[_0x1b7c('0x14')](function(_0x2f62cd){logger[_0x1b7c('0x10')](_0x1b7c('0xb'),_0x398d8a,_0x2f62cd);_0x39dea6(_0x2f62cd);});});}exports['CreateWhatsappQueueReport']=function(_0x553ee7){var _0xb08836=this;return new Promise(function(_0x2a5cc2,_0x2b5553){return db[_0x1b7c('0x15')]['create'](_0x553ee7[_0x1b7c('0x16')],{'raw':_0x553ee7['options']?_0x553ee7['options'][_0x1b7c('0x17')]===undefined?!![]:![]:!![]})[_0x1b7c('0x9')](function(_0x325b3e){logger[_0x1b7c('0xa')](_0x1b7c('0x18'),_0x553ee7);logger[_0x1b7c('0xd')](_0x1b7c('0x18'),_0x553ee7,JSON[_0x1b7c('0xf')](_0x325b3e));_0x2a5cc2(_0x325b3e);})[_0x1b7c('0x14')](function(_0x58ecd7){logger[_0x1b7c('0x10')](_0x1b7c('0x18'),_0x58ecd7[_0x1b7c('0x12')],_0x553ee7);_0x2b5553(_0xb08836[_0x1b7c('0x10')](0x1f4,_0x58ecd7[_0x1b7c('0x12')]));});});};exports[_0x1b7c('0x19')]=function(_0x19d5e8){var _0x7d9294=this;return new Promise(function(_0x3e8bd1,_0x5e4655){return db[_0x1b7c('0x15')][_0x1b7c('0x1a')](_0x19d5e8[_0x1b7c('0x16')],{'raw':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')][_0x1b7c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d5e8[_0x1b7c('0x1b')]?_0x19d5e8['options'][_0x1b7c('0x1c')]||null:null,'attributes':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')][_0x1b7c('0x1d')]||null:null,'limit':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')]['limit']||null:null})[_0x1b7c('0x9')](function(_0x552963){logger[_0x1b7c('0xa')]('UpdateWhatsappQueueReport',_0x19d5e8);logger[_0x1b7c('0xd')](_0x1b7c('0x19'),_0x19d5e8,JSON[_0x1b7c('0xf')](_0x552963));_0x3e8bd1(_0x552963);})[_0x1b7c('0x14')](function(_0x3e086b){logger[_0x1b7c('0x10')]('UpdateWhatsappQueueReport',_0x3e086b[_0x1b7c('0x12')],_0x19d5e8);_0x5e4655(_0x7d9294[_0x1b7c('0x10')](0x1f4,_0x3e086b[_0x1b7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 669fa9d..0458a3e 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 _0xd241=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd241,0x188));var _0x1d24=function(_0x44c4f9,_0x26fdc8){_0x44c4f9=_0x44c4f9-0x0;var _0x2a3d2e=_0xd241[_0x44c4f9];return _0x2a3d2e;};'use strict';var multer=require(_0x1d24('0x0'));var util=require(_0x1d24('0x1'));var path=require('path');var timeout=require(_0x1d24('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d24('0x3'));var interaction=require(_0x1d24('0x4'));var config=require(_0x1d24('0x5'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x1d24('0x6')](),controller[_0x1d24('0x7')]);router[_0x1d24('0x8')](_0x1d24('0x9'),auth[_0x1d24('0x6')](),controller[_0x1d24('0xa')]);router[_0x1d24('0x8')](_0x1d24('0xb'),auth[_0x1d24('0x6')](),controller[_0x1d24('0xc')]);router[_0x1d24('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1d24('0xe')](_0x1d24('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1d24('0xf')](_0x1d24('0xb'),auth['isAuthenticated'](),controller[_0x1d24('0x10')]);module[_0x1d24('0x11')]=router; \ No newline at end of file +var _0x45c9=['post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x19a43e,_0x7f739c){var _0x52faa8=function(_0x13ee08){while(--_0x13ee08){_0x19a43e['push'](_0x19a43e['shift']());}};_0x52faa8(++_0x7f739c);}(_0x45c9,0x1b5));var _0x945c=function(_0x202d0f,_0x421cb4){_0x202d0f=_0x202d0f-0x0;var _0xdcc5be=_0x45c9[_0x202d0f];return _0xdcc5be;};'use strict';var multer=require(_0x945c('0x0'));var util=require(_0x945c('0x1'));var path=require(_0x945c('0x2'));var timeout=require(_0x945c('0x3'));var express=require(_0x945c('0x4'));var router=express[_0x945c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x945c('0x6'));var config=require(_0x945c('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x945c('0x8')]('/',auth[_0x945c('0x9')](),controller[_0x945c('0xa')]);router['get']('/describe',auth[_0x945c('0x9')](),controller['describe']);router[_0x945c('0x8')](_0x945c('0xb'),auth[_0x945c('0x9')](),controller[_0x945c('0xc')]);router[_0x945c('0xd')]('/',auth[_0x945c('0x9')](),controller[_0x945c('0xe')]);router[_0x945c('0xf')]('/:id',auth[_0x945c('0x9')](),controller['update']);router[_0x945c('0x10')](_0x945c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x945c('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index f550303..9be8011 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 _0x161a=['STRING','ENUM','agent','DATE'];(function(_0x847475,_0x5d0d2a){var _0x36d44a=function(_0x44be7a){while(--_0x44be7a){_0x847475['push'](_0x847475['shift']());}};_0x36d44a(++_0x5d0d2a);}(_0x161a,0x140));var _0xa161=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x161a[_0x53bcc3];return _0x47c959;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa161('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xa161('0x1')]('account',_0xa161('0x2'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xa161('0x3')]}}; \ No newline at end of file +var _0xcbde=['account','agent','queue','sequelize','STRING','ENUM'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xcbde,0x141));var _0xecbd=function(_0x22498e,_0x40b64f){_0x22498e=_0x22498e-0x0;var _0x4c18e7=_0xcbde[_0x22498e];return _0x4c18e7;};'use strict';var Sequelize=require(_0xecbd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xecbd('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xecbd('0x2')](_0xecbd('0x3'),_0xecbd('0x4'),_0xecbd('0x5')),'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 e860cbc..cf624a0 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 _0xbdd4=['includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','type','VIRTUAL','filter'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xbdd4,0xe6));var _0x4bdd=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xbdd4[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x4bdd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bdd('0x1'));var jsonpatch=require(_0x4bdd('0x2'));var rp=require(_0x4bdd('0x3'));var moment=require('moment');var BPromise=require(_0x4bdd('0x4'));var Mustache=require(_0x4bdd('0x5'));var util=require(_0x4bdd('0x6'));var path=require('path');var sox=require(_0x4bdd('0x7'));var csv=require(_0x4bdd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bdd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4bdd('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4bdd('0xb'));var Redis=require(_0x4bdd('0xc'));var authService=require(_0x4bdd('0xd'));var qs=require(_0x4bdd('0xe'));var as=require(_0x4bdd('0xf'));var hardwareService=require(_0x4bdd('0x10'));var logger=require('../../config/logger')(_0x4bdd('0x11'));var utils=require('../../config/utils');var config=require(_0x4bdd('0x12'));var licenseUtil=require(_0x4bdd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b9ea,_0x54c166){_0x54c166=_0x54c166||0xcc;return function(_0x186643){if(_0x186643){return _0x53b9ea[_0x4bdd('0x14')](_0x54c166);}return _0x53b9ea[_0x4bdd('0x15')](_0x54c166)[_0x4bdd('0x16')]();};}function respondWithResult(_0x474b45,_0x444ed6){_0x444ed6=_0x444ed6||0xc8;return function(_0xa6c48c){if(_0xa6c48c){return _0x474b45['status'](_0x444ed6)['json'](_0xa6c48c);}};}function respondWithFilteredResult(_0x870db1,_0x3587ee){return function(_0x1c17fa){if(_0x1c17fa){var _0x1d6af4=typeof _0x3587ee['offset']===_0x4bdd('0x17')&&typeof _0x3587ee[_0x4bdd('0x18')]===_0x4bdd('0x17');var _0x22f90d=_0x1c17fa[_0x4bdd('0x19')];var _0x198ffd=_0x1d6af4?0x0:_0x3587ee[_0x4bdd('0x1a')];var _0x46bb96=_0x1d6af4?_0x1c17fa[_0x4bdd('0x19')]:_0x3587ee['offset']+_0x3587ee[_0x4bdd('0x18')];var _0x4da85e;if(_0x46bb96>=_0x22f90d){_0x46bb96=_0x22f90d;_0x4da85e=0xc8;}else{_0x4da85e=0xce;}_0x870db1[_0x4bdd('0x15')](_0x4da85e);return _0x870db1[_0x4bdd('0x1b')](_0x4bdd('0x1c'),_0x198ffd+'-'+_0x46bb96+'/'+_0x22f90d)[_0x4bdd('0x1d')](_0x1c17fa);}return null;};}function patchUpdates(_0x3a842c){return function(_0x4330cb){try{jsonpatch[_0x4bdd('0x1e')](_0x4330cb,_0x3a842c,!![]);}catch(_0x523de){return BPromise['reject'](_0x523de);}return _0x4330cb[_0x4bdd('0x1f')]();};}function saveUpdates(_0x1952cf,_0x2ac0d2){return function(_0x10947b){if(_0x10947b){return _0x10947b[_0x4bdd('0x20')](_0x1952cf)[_0x4bdd('0x21')](function(_0x2f9f53){return _0x2f9f53;});}return null;};}function removeEntity(_0x489a20,_0x14fc3c){return function(_0xec16c1){if(_0xec16c1){return _0xec16c1[_0x4bdd('0x22')]()['then'](function(){_0x489a20[_0x4bdd('0x15')](0xcc)[_0x4bdd('0x16')]();});}};}function handleEntityNotFound(_0x4e7b92,_0x543217){return function(_0x5527bf){if(!_0x5527bf){_0x4e7b92[_0x4bdd('0x14')](0x194);}return _0x5527bf;};}function handleError(_0x26f4aa,_0x3f6782){_0x3f6782=_0x3f6782||0x1f4;return function(_0x34a576){logger[_0x4bdd('0x23')](_0x34a576[_0x4bdd('0x24')]);if(_0x34a576[_0x4bdd('0x25')]){delete _0x34a576[_0x4bdd('0x25')];}_0x26f4aa[_0x4bdd('0x15')](_0x3f6782)[_0x4bdd('0x26')](_0x34a576);};}exports[_0x4bdd('0x27')]=function(_0x5dde50,_0x301225){var _0x5d601b={},_0x452558={},_0x1276ec={'count':0x0,'rows':[]};var _0x4e775d=_['map'](db[_0x4bdd('0x28')][_0x4bdd('0x29')],function(_0x17634c){return{'name':_0x17634c[_0x4bdd('0x2a')],'type':_0x17634c['type'][_0x4bdd('0x2b')]};});_0x452558[_0x4bdd('0x2c')]=_['map'](_0x4e775d,_0x4bdd('0x25'));_0x452558['query']=_[_0x4bdd('0x2d')](_0x5dde50[_0x4bdd('0x2e')]);_0x452558['filters']=_[_0x4bdd('0x2f')](_0x452558[_0x4bdd('0x2c')],_0x452558[_0x4bdd('0x2e')]);_0x5d601b['attributes']=_[_0x4bdd('0x2f')](_0x452558[_0x4bdd('0x2c')],qs[_0x4bdd('0x30')](_0x5dde50['query'][_0x4bdd('0x30')]));_0x5d601b[_0x4bdd('0x31')]=_0x5d601b[_0x4bdd('0x31')]['length']?_0x5d601b[_0x4bdd('0x31')]:_0x452558['model'];if(!_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x32')](_0x4bdd('0x33'))){_0x5d601b['limit']=qs[_0x4bdd('0x18')](_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x18')]);_0x5d601b[_0x4bdd('0x1a')]=qs[_0x4bdd('0x1a')](_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x1a')]);}_0x5d601b[_0x4bdd('0x34')]=qs[_0x4bdd('0x35')](_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x35')]);_0x5d601b[_0x4bdd('0x36')]=qs['filters'](_[_0x4bdd('0x37')](_0x5dde50[_0x4bdd('0x2e')],_0x452558[_0x4bdd('0x38')]),_0x4e775d);if(_0x5dde50['query']['filter']){_0x5d601b['where']=_[_0x4bdd('0x39')](_0x5d601b[_0x4bdd('0x36')],{'$or':_[_0x4bdd('0x3a')](_0x4e775d,function(_0x384209){if(_0x384209[_0x4bdd('0x3b')]!==_0x4bdd('0x3c')){var _0x155e49={};_0x155e49[_0x384209[_0x4bdd('0x25')]]={'$like':'%'+_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x3d')]+'%'};return _0x155e49;}})});}_0x5d601b=_[_0x4bdd('0x39')]({},_0x5d601b,_0x5dde50['options']);var _0x1c9378={'where':_0x5d601b[_0x4bdd('0x36')]};return db['WhatsappTransferReport'][_0x4bdd('0x19')](_0x1c9378)[_0x4bdd('0x21')](function(_0x312d99){_0x1276ec[_0x4bdd('0x19')]=_0x312d99;if(_0x5dde50[_0x4bdd('0x2e')][_0x4bdd('0x3e')]){_0x5d601b[_0x4bdd('0x3f')]=[{'all':!![]}];}return db[_0x4bdd('0x28')][_0x4bdd('0x40')](_0x5d601b);})[_0x4bdd('0x21')](function(_0xf03c){_0x1276ec[_0x4bdd('0x41')]=_0xf03c;return _0x1276ec;})[_0x4bdd('0x21')](respondWithFilteredResult(_0x301225,_0x5d601b))[_0x4bdd('0x42')](handleError(_0x301225,null));};exports['show']=function(_0x32e8c6,_0x1a2f5b){var _0x43e683={'raw':!![],'where':{'id':_0x32e8c6[_0x4bdd('0x43')]['id']}},_0x24aac9={};_0x24aac9['model']=_[_0x4bdd('0x2d')](db[_0x4bdd('0x28')][_0x4bdd('0x29')]);_0x24aac9[_0x4bdd('0x2e')]=_[_0x4bdd('0x2d')](_0x32e8c6['query']);_0x24aac9['filters']=_[_0x4bdd('0x2f')](_0x24aac9[_0x4bdd('0x2c')],_0x24aac9['query']);_0x43e683[_0x4bdd('0x31')]=_[_0x4bdd('0x2f')](_0x24aac9['model'],qs[_0x4bdd('0x30')](_0x32e8c6[_0x4bdd('0x2e')]['fields']));_0x43e683[_0x4bdd('0x31')]=_0x43e683['attributes']['length']?_0x43e683['attributes']:_0x24aac9[_0x4bdd('0x2c')];if(_0x32e8c6[_0x4bdd('0x2e')]['includeAll']){_0x43e683[_0x4bdd('0x3f')]=[{'all':!![]}];}_0x43e683=_[_0x4bdd('0x39')]({},_0x43e683,_0x32e8c6[_0x4bdd('0x44')]);return db['WhatsappTransferReport'][_0x4bdd('0x45')](_0x43e683)['then'](handleEntityNotFound(_0x1a2f5b,null))[_0x4bdd('0x21')](respondWithResult(_0x1a2f5b,null))[_0x4bdd('0x42')](handleError(_0x1a2f5b,null));};exports['create']=function(_0x34ea8d,_0x102a40){return db['WhatsappTransferReport'][_0x4bdd('0x46')](_0x34ea8d[_0x4bdd('0x47')],{})[_0x4bdd('0x21')](respondWithResult(_0x102a40,0xc9))[_0x4bdd('0x42')](handleError(_0x102a40,null));};exports[_0x4bdd('0x20')]=function(_0x4bb079,_0x34330e){if(_0x4bb079[_0x4bdd('0x47')]['id']){delete _0x4bb079[_0x4bdd('0x47')]['id'];}return db[_0x4bdd('0x28')][_0x4bdd('0x45')]({'where':{'id':_0x4bb079['params']['id']}})[_0x4bdd('0x21')](handleEntityNotFound(_0x34330e,null))[_0x4bdd('0x21')](saveUpdates(_0x4bb079[_0x4bdd('0x47')],null))[_0x4bdd('0x21')](respondWithResult(_0x34330e,null))[_0x4bdd('0x42')](handleError(_0x34330e,null));};exports[_0x4bdd('0x22')]=function(_0x432e47,_0x6b7313){return db['WhatsappTransferReport']['find']({'where':{'id':_0x432e47['params']['id']}})['then'](handleEntityNotFound(_0x6b7313,null))[_0x4bdd('0x21')](removeEntity(_0x6b7313,null))[_0x4bdd('0x42')](handleError(_0x6b7313,null));};exports['describe']=function(_0x2400a6,_0x4691da){return db['WhatsappTransferReport'][_0x4bdd('0x48')]()['then'](respondWithResult(_0x4691da,null))['catch'](handleError(_0x4691da,null));}; \ No newline at end of file +var _0x269b=['fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','show','params','filters','length','include','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x269b,0x9a));var _0xb269=function(_0xc5a490,_0x217ba9){_0xc5a490=_0xc5a490-0x0;var _0x20e3e5=_0x269b[_0xc5a490];return _0x20e3e5;};'use strict';var emlformat=require(_0xb269('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb269('0x1'));var jsonpatch=require(_0xb269('0x2'));var rp=require(_0xb269('0x3'));var moment=require(_0xb269('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb269('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb269('0x6'));var ejs=require(_0xb269('0x7'));var fs=require('fs');var fs_extra=require(_0xb269('0x8'));var _=require(_0xb269('0x9'));var squel=require(_0xb269('0xa'));var crypto=require(_0xb269('0xb'));var jsforce=require(_0xb269('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb269('0xd'));var Papa=require(_0xb269('0xe'));var Redis=require(_0xb269('0xf'));var authService=require(_0xb269('0x10'));var qs=require(_0xb269('0x11'));var as=require(_0xb269('0x12'));var hardwareService=require(_0xb269('0x13'));var logger=require(_0xb269('0x14'))(_0xb269('0x15'));var utils=require(_0xb269('0x16'));var config=require(_0xb269('0x17'));var licenseUtil=require(_0xb269('0x18'));var db=require(_0xb269('0x19'))['db'];function respondWithStatusCode(_0x4ab7e6,_0x261911){_0x261911=_0x261911||0xcc;return function(_0x20e826){if(_0x20e826){return _0x4ab7e6[_0xb269('0x1a')](_0x261911);}return _0x4ab7e6[_0xb269('0x1b')](_0x261911)[_0xb269('0x1c')]();};}function respondWithResult(_0x217954,_0x55636f){_0x55636f=_0x55636f||0xc8;return function(_0x69805f){if(_0x69805f){return _0x217954[_0xb269('0x1b')](_0x55636f)[_0xb269('0x1d')](_0x69805f);}};}function respondWithFilteredResult(_0x32d28c,_0x1b2fdd){return function(_0x4d3c6d){if(_0x4d3c6d){var _0x4ceea4=typeof _0x1b2fdd[_0xb269('0x1e')]==='undefined'&&typeof _0x1b2fdd[_0xb269('0x1f')]===_0xb269('0x20');var _0x3094e1=_0x4d3c6d[_0xb269('0x21')];var _0x18c300=_0x4ceea4?0x0:_0x1b2fdd['offset'];var _0x270244=_0x4ceea4?_0x4d3c6d[_0xb269('0x21')]:_0x1b2fdd['offset']+_0x1b2fdd[_0xb269('0x1f')];var _0x370172;if(_0x270244>=_0x3094e1){_0x270244=_0x3094e1;_0x370172=0xc8;}else{_0x370172=0xce;}_0x32d28c[_0xb269('0x1b')](_0x370172);return _0x32d28c[_0xb269('0x22')](_0xb269('0x23'),_0x18c300+'-'+_0x270244+'/'+_0x3094e1)['json'](_0x4d3c6d);}return null;};}function patchUpdates(_0x171bf9){return function(_0x332e73){try{jsonpatch[_0xb269('0x24')](_0x332e73,_0x171bf9,!![]);}catch(_0x3bdca9){return BPromise[_0xb269('0x25')](_0x3bdca9);}return _0x332e73[_0xb269('0x26')]();};}function saveUpdates(_0x16c0a2,_0x3a2ace){return function(_0x7f43b0){if(_0x7f43b0){return _0x7f43b0[_0xb269('0x27')](_0x16c0a2)[_0xb269('0x28')](function(_0x257adf){return _0x257adf;});}return null;};}function removeEntity(_0x32f0f4,_0x1953c8){return function(_0x5c93c0){if(_0x5c93c0){return _0x5c93c0[_0xb269('0x29')]()[_0xb269('0x28')](function(){_0x32f0f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ff0d,_0x31a9d2){return function(_0x464110){if(!_0x464110){_0x20ff0d[_0xb269('0x1a')](0x194);}return _0x464110;};}function handleError(_0x15f1b5,_0x298502){_0x298502=_0x298502||0x1f4;return function(_0x31956e){logger[_0xb269('0x2a')](_0x31956e[_0xb269('0x2b')]);if(_0x31956e[_0xb269('0x2c')]){delete _0x31956e[_0xb269('0x2c')];}_0x15f1b5['status'](_0x298502)[_0xb269('0x2d')](_0x31956e);};}exports['index']=function(_0xefa3a7,_0x504268){var _0x3e7360={},_0x1763fa={},_0x43c544={'count':0x0,'rows':[]};var _0xac4e17=_[_0xb269('0x2e')](db['WhatsappTransferReport'][_0xb269('0x2f')],function(_0x39f8ee){return{'name':_0x39f8ee[_0xb269('0x30')],'type':_0x39f8ee[_0xb269('0x31')]['key']};});_0x1763fa['model']=_[_0xb269('0x2e')](_0xac4e17,_0xb269('0x2c'));_0x1763fa[_0xb269('0x32')]=_[_0xb269('0x33')](_0xefa3a7[_0xb269('0x32')]);_0x1763fa['filters']=_[_0xb269('0x34')](_0x1763fa['model'],_0x1763fa[_0xb269('0x32')]);_0x3e7360[_0xb269('0x35')]=_['intersection'](_0x1763fa['model'],qs[_0xb269('0x36')](_0xefa3a7[_0xb269('0x32')][_0xb269('0x36')]));_0x3e7360[_0xb269('0x35')]=_0x3e7360[_0xb269('0x35')]['length']?_0x3e7360['attributes']:_0x1763fa[_0xb269('0x37')];if(!_0xefa3a7['query'][_0xb269('0x38')]('nolimit')){_0x3e7360[_0xb269('0x1f')]=qs['limit'](_0xefa3a7[_0xb269('0x32')][_0xb269('0x1f')]);_0x3e7360[_0xb269('0x1e')]=qs['offset'](_0xefa3a7[_0xb269('0x32')][_0xb269('0x1e')]);}_0x3e7360[_0xb269('0x39')]=qs[_0xb269('0x3a')](_0xefa3a7['query']['sort']);_0x3e7360['where']=qs['filters'](_[_0xb269('0x3b')](_0xefa3a7[_0xb269('0x32')],_0x1763fa['filters']),_0xac4e17);if(_0xefa3a7[_0xb269('0x32')][_0xb269('0x3c')]){_0x3e7360[_0xb269('0x3d')]=_[_0xb269('0x3e')](_0x3e7360[_0xb269('0x3d')],{'$or':_[_0xb269('0x2e')](_0xac4e17,function(_0x15ee03){if(_0x15ee03[_0xb269('0x31')]!==_0xb269('0x3f')){var _0x348679={};_0x348679[_0x15ee03[_0xb269('0x2c')]]={'$like':'%'+_0xefa3a7[_0xb269('0x32')][_0xb269('0x3c')]+'%'};return _0x348679;}})});}_0x3e7360=_[_0xb269('0x3e')]({},_0x3e7360,_0xefa3a7[_0xb269('0x40')]);var _0x504331={'where':_0x3e7360['where']};return db[_0xb269('0x41')][_0xb269('0x21')](_0x504331)[_0xb269('0x28')](function(_0x249189){_0x43c544['count']=_0x249189;if(_0xefa3a7['query'][_0xb269('0x42')]){_0x3e7360['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb269('0x43')](_0x3e7360);})[_0xb269('0x28')](function(_0x2de738){_0x43c544['rows']=_0x2de738;return _0x43c544;})[_0xb269('0x28')](respondWithFilteredResult(_0x504268,_0x3e7360))['catch'](handleError(_0x504268,null));};exports[_0xb269('0x44')]=function(_0x1ae22c,_0x5c5978){var _0x18b123={'raw':!![],'where':{'id':_0x1ae22c[_0xb269('0x45')]['id']}},_0x5a76f9={};_0x5a76f9[_0xb269('0x37')]=_['keys'](db[_0xb269('0x41')]['rawAttributes']);_0x5a76f9[_0xb269('0x32')]=_['keys'](_0x1ae22c['query']);_0x5a76f9[_0xb269('0x46')]=_[_0xb269('0x34')](_0x5a76f9[_0xb269('0x37')],_0x5a76f9[_0xb269('0x32')]);_0x18b123[_0xb269('0x35')]=_[_0xb269('0x34')](_0x5a76f9[_0xb269('0x37')],qs[_0xb269('0x36')](_0x1ae22c[_0xb269('0x32')][_0xb269('0x36')]));_0x18b123['attributes']=_0x18b123['attributes'][_0xb269('0x47')]?_0x18b123[_0xb269('0x35')]:_0x5a76f9[_0xb269('0x37')];if(_0x1ae22c[_0xb269('0x32')][_0xb269('0x42')]){_0x18b123[_0xb269('0x48')]=[{'all':!![]}];}_0x18b123=_['merge']({},_0x18b123,_0x1ae22c[_0xb269('0x40')]);return db['WhatsappTransferReport'][_0xb269('0x49')](_0x18b123)[_0xb269('0x28')](handleEntityNotFound(_0x5c5978,null))[_0xb269('0x28')](respondWithResult(_0x5c5978,null))[_0xb269('0x4a')](handleError(_0x5c5978,null));};exports['create']=function(_0x2e16bc,_0x4c2d81){return db[_0xb269('0x41')][_0xb269('0x4b')](_0x2e16bc[_0xb269('0x4c')],{})['then'](respondWithResult(_0x4c2d81,0xc9))[_0xb269('0x4a')](handleError(_0x4c2d81,null));};exports[_0xb269('0x27')]=function(_0x4f099b,_0x3184b4){if(_0x4f099b[_0xb269('0x4c')]['id']){delete _0x4f099b[_0xb269('0x4c')]['id'];}return db[_0xb269('0x41')]['find']({'where':{'id':_0x4f099b[_0xb269('0x45')]['id']}})[_0xb269('0x28')](handleEntityNotFound(_0x3184b4,null))['then'](saveUpdates(_0x4f099b[_0xb269('0x4c')],null))[_0xb269('0x28')](respondWithResult(_0x3184b4,null))[_0xb269('0x4a')](handleError(_0x3184b4,null));};exports[_0xb269('0x29')]=function(_0x5d8669,_0x12e4c7){return db[_0xb269('0x41')][_0xb269('0x49')]({'where':{'id':_0x5d8669[_0xb269('0x45')]['id']}})[_0xb269('0x28')](handleEntityNotFound(_0x12e4c7,null))[_0xb269('0x28')](removeEntity(_0x12e4c7,null))[_0xb269('0x4a')](handleError(_0x12e4c7,null));};exports['describe']=function(_0x3466c1,_0x55e968){return db['WhatsappTransferReport'][_0xb269('0x4d')]()['then'](respondWithResult(_0x55e968,null))[_0xb269('0x4a')](handleError(_0x55e968,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f4ad601..984b3b2 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 _0x5537=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','report_whatsapp_transfer','uniqueid'];(function(_0x50e26a,_0x51e93d){var _0x57b84f=function(_0x5bbea1){while(--_0x5bbea1){_0x50e26a['push'](_0x50e26a['shift']());}};_0x57b84f(++_0x51e93d);}(_0x5537,0x176));var _0x7553=function(_0x31d4f1,_0x3b6f3c){_0x31d4f1=_0x31d4f1-0x0;var _0x15a3fc=_0x5537[_0x31d4f1];return _0x15a3fc;};'use strict';var _=require('lodash');var util=require(_0x7553('0x0'));var logger=require('../../config/logger')(_0x7553('0x1'));var moment=require(_0x7553('0x2'));var BPromise=require(_0x7553('0x3'));var rp=require(_0x7553('0x4'));var fs=require('fs');var path=require(_0x7553('0x5'));var rimraf=require(_0x7553('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x7553('0x7')]=function(_0x29283b,_0xf41882){return _0x29283b[_0x7553('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x7553('0x9'),'paranoid':![],'indexes':[{'name':_0x7553('0xa'),'fields':[_0x7553('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e70=['path','rimraf','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','moment','bluebird','request-promise'];(function(_0x569f12,_0x12cd74){var _0x1618cc=function(_0x5ec355){while(--_0x5ec355){_0x569f12['push'](_0x569f12['shift']());}};_0x1618cc(++_0x12cd74);}(_0x6e70,0x1ca));var _0x06e7=function(_0x4da630,_0x438f94){_0x4da630=_0x4da630-0x0;var _0x42679b=_0x6e70[_0x4da630];return _0x42679b;};'use strict';var _=require(_0x06e7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x06e7('0x1'));var BPromise=require(_0x06e7('0x2'));var rp=require(_0x06e7('0x3'));var fs=require('fs');var path=require(_0x06e7('0x4'));var rimraf=require(_0x06e7('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x06e7('0x6')]=function(_0xf18dce,_0x313933){return _0xf18dce[_0x06e7('0x7')](_0x06e7('0x8'),attributes,{'tableName':_0x06e7('0x9'),'paranoid':![],'indexes':[{'name':_0x06e7('0xa'),'fields':[_0x06e7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 5da2f4b..7a5daf8 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 _0x7e07=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4b8a77,_0x405ab3){var _0x3a3991=function(_0x514ecd){while(--_0x514ecd){_0x4b8a77['push'](_0x4b8a77['shift']());}};_0x3a3991(++_0x405ab3);}(_0x7e07,0x15d));var _0x77e0=function(_0x1289dd,_0x50b9fe){_0x1289dd=_0x1289dd-0x0;var _0x2fd69d=_0x7e07[_0x1289dd];return _0x2fd69d;};'use strict';var _=require(_0x77e0('0x0'));var util=require(_0x77e0('0x1'));var moment=require(_0x77e0('0x2'));var BPromise=require(_0x77e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77e0('0x4'));var db=require(_0x77e0('0x5'))['db'];var utils=require(_0x77e0('0x6'));var logger=require('../../config/logger')(_0x77e0('0x7'));var config=require('../../config/environment');var jayson=require(_0x77e0('0x8'));var client=jayson[_0x77e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22a361,_0x326ef6,_0x4a79fd){return new BPromise(function(_0x3605a4,_0xf5baec){return client[_0x77e0('0xa')](_0x22a361,_0x4a79fd)[_0x77e0('0xb')](function(_0x32e76d){logger[_0x77e0('0xc')](_0x77e0('0xd'),_0x326ef6,_0x77e0('0xe'));logger[_0x77e0('0xf')](_0x77e0('0x10'),_0x326ef6,'request\x20sent',JSON[_0x77e0('0x11')](_0x32e76d));if(_0x32e76d[_0x77e0('0x12')]){if(_0x32e76d['error'][_0x77e0('0x13')]===0x1f4){logger['error'](_0x77e0('0xd'),_0x326ef6,_0x32e76d['error'][_0x77e0('0x14')]);return _0xf5baec(_0x32e76d[_0x77e0('0x12')]['message']);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x326ef6,_0x32e76d[_0x77e0('0x12')][_0x77e0('0x14')]);return _0x3605a4(_0x32e76d['error'][_0x77e0('0x14')]);}else{logger[_0x77e0('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x326ef6,_0x77e0('0xe'));_0x3605a4(_0x32e76d[_0x77e0('0x15')][_0x77e0('0x14')]);}})[_0x77e0('0x16')](function(_0x2670bb){logger['error'](_0x77e0('0xd'),_0x326ef6,_0x2670bb);_0xf5baec(_0x2670bb);});});} \ No newline at end of file +var _0x374a=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2e2d06,_0x5fcc37){var _0x2769a2=function(_0x4e69ad){while(--_0x4e69ad){_0x2e2d06['push'](_0x2e2d06['shift']());}};_0x2769a2(++_0x5fcc37);}(_0x374a,0x92));var _0xa374=function(_0x50183b,_0x718a41){_0x50183b=_0x50183b-0x0;var _0x51e190=_0x374a[_0x50183b];return _0x51e190;};'use strict';var _=require(_0xa374('0x0'));var util=require(_0xa374('0x1'));var moment=require(_0xa374('0x2'));var BPromise=require(_0xa374('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa374('0x4'));var db=require(_0xa374('0x5'))['db'];var utils=require(_0xa374('0x6'));var logger=require(_0xa374('0x7'))(_0xa374('0x8'));var config=require(_0xa374('0x9'));var jayson=require(_0xa374('0xa'));var client=jayson[_0xa374('0xb')][_0xa374('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x90734e,_0x221933,_0x57da12){return new BPromise(function(_0x4efa62,_0x3fa5d9){return client[_0xa374('0xd')](_0x90734e,_0x57da12)[_0xa374('0xe')](function(_0x1bf4a3){logger[_0xa374('0xf')](_0xa374('0x10'),_0x221933,_0xa374('0x11'));logger[_0xa374('0x12')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x221933,_0xa374('0x11'),JSON[_0xa374('0x13')](_0x1bf4a3));if(_0x1bf4a3[_0xa374('0x14')]){if(_0x1bf4a3[_0xa374('0x14')][_0xa374('0x15')]===0x1f4){logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x1bf4a3['error'][_0xa374('0x16')]);return _0x3fa5d9(_0x1bf4a3['error'][_0xa374('0x16')]);}logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x1bf4a3[_0xa374('0x14')][_0xa374('0x16')]);return _0x4efa62(_0x1bf4a3[_0xa374('0x14')]['message']);}else{logger[_0xa374('0xf')](_0xa374('0x10'),_0x221933,'request\x20sent');_0x4efa62(_0x1bf4a3['result']['message']);}})[_0xa374('0x17')](function(_0x54a0a1){logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x54a0a1);_0x3fa5d9(_0x54a0a1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index cc93b19..da89707 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb991=['./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','join','Offline\x20apps:','status','online','name','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp'];(function(_0x40e5ed,_0x4e4c53){var _0x1b6910=function(_0x1bb19b){while(--_0x1bb19b){_0x40e5ed['push'](_0x40e5ed['shift']());}};_0x1b6910(++_0x4e4c53);}(_0xb991,0x1e6));var _0x1b99=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb991[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x1b99('0x0'));var mysqldb=require(_0x1b99('0x1'));var rpc=require(_0x1b99('0x2'));var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require(_0x1b99('0x3'));var pm2Config=require(_0x1b99('0x4'));var schedule=require(_0x1b99('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x1b99('0x6'));var transcribe=require(_0x1b99('0x7'));function main(){return mysqldb['db'][_0x1b99('0x8')][_0x1b99('0x9')]()[_0x1b99('0xa')](function(){return rpc[_0x1b99('0xb')]();})['then'](function(_0x4252e8){logger[_0x1b99('0xc')](_0x4252e8);return chat['start']();})[_0x1b99('0xa')](function(){return whatsapp['start']();})[_0x1b99('0xa')](function(){return schedule[_0x1b99('0xd')]();})[_0x1b99('0xa')](function(){return transcribe[_0x1b99('0xd')]();})['then'](function(_0x31bcfe){logger[_0x1b99('0xc')](_0x31bcfe);return pm2[_0x1b99('0xd')](pm2Config);})[_0x1b99('0xa')](function(_0x4c6a90){logger[_0x1b99('0xc')](_0x1b99('0xe'),_[_0x1b99('0xf')](_['filter'](_0x4c6a90,{'status':'online'}),'name')[_0x1b99('0x10')]());logger['info'](_0x1b99('0x11'),_['map'](_['filter'](_0x4c6a90,function(_0x122bc3){return _0x122bc3[_0x1b99('0x12')]!==_0x1b99('0x13');}),_0x1b99('0x14'))[_0x1b99('0x10')]()||_0x1b99('0x15'));config[_0x1b99('0x16')]&&require(_0x1b99('0x17'))[_0x1b99('0x18')]();require('./config/license')[_0x1b99('0x18')]();})[_0x1b99('0x19')](function(_0x55cb60){logger[_0x1b99('0x1a')](_0x1b99('0x1b'),_0x55cb60);process[_0x1b99('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x6bc1=['./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','None','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x6bc1,0x1aa));var _0x16bc=function(_0xc10495,_0x580b5f){_0xc10495=_0xc10495-0x0;var _0x2f19c4=_0x6bc1[_0xc10495];return _0x2f19c4;};'use strict';var _=require(_0x16bc('0x0'));var mysqldb=require(_0x16bc('0x1'));var rpc=require(_0x16bc('0x2'));var config=require(_0x16bc('0x3'));var logger=require(_0x16bc('0x4'))(_0x16bc('0x5'));var pm2=require(_0x16bc('0x6'));var pm2Config=require(_0x16bc('0x7'));var schedule=require(_0x16bc('0x8'));var chat=require(_0x16bc('0x9'));var whatsapp=require(_0x16bc('0xa'));var transcribe=require(_0x16bc('0xb'));function main(){return mysqldb['db']['sequelize'][_0x16bc('0xc')]()[_0x16bc('0xd')](function(){return rpc[_0x16bc('0xe')]();})[_0x16bc('0xd')](function(_0x420dcf){logger[_0x16bc('0xf')](_0x420dcf);return chat[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return whatsapp[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return schedule[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return transcribe[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(_0xe518ec){logger['info'](_0xe518ec);return pm2[_0x16bc('0x10')](pm2Config);})[_0x16bc('0xd')](function(_0x2cd1f3){logger[_0x16bc('0xf')](_0x16bc('0x11'),_[_0x16bc('0x12')](_[_0x16bc('0x13')](_0x2cd1f3,{'status':'online'}),_0x16bc('0x14'))[_0x16bc('0x15')]());logger[_0x16bc('0xf')](_0x16bc('0x16'),_[_0x16bc('0x12')](_[_0x16bc('0x13')](_0x2cd1f3,function(_0x96e3a5){return _0x96e3a5[_0x16bc('0x17')]!=='online';}),_0x16bc('0x14'))['join']()||_0x16bc('0x18'));config['seedDB']&&require('./config/seedDB')[_0x16bc('0x19')]();require(_0x16bc('0x1a'))[_0x16bc('0x19')]();})[_0x16bc('0x1b')](function(_0x321044){logger['error'](_0x16bc('0x1c'),_0x321044);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index b438ff1..7133045 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 _0x133b=['find','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','promisify','sign','payload','options','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User'];(function(_0x483889,_0x4c80ad){var _0x477f7a=function(_0x574867){while(--_0x574867){_0x483889['push'](_0x483889['shift']());}};_0x477f7a(++_0x4c80ad);}(_0x133b,0x12f));var _0xb133=function(_0x398655,_0x59c439){_0x398655=_0x398655-0x0;var _0x5a6b13=_0x133b[_0x398655];return _0x5a6b13;};'use strict';var db=require(_0xb133('0x0'))['db'];var config=require(_0xb133('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xb133('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0xb133('0x3'));var expressJwt=require(_0xb133('0x4'));var compose=require(_0xb133('0x5'));var basicAuth=require(_0xb133('0x6'));var crypto=require(_0xb133('0x7'));var BPromise=require('bluebird');var util=require(_0xb133('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb133('0x9')][_0xb133('0xa')]});var userAttributes=['id',_0xb133('0xb'),_0xb133('0xc'),_0xb133('0xd'),_0xb133('0xe'),_0xb133('0xf'),_0xb133('0x10'),_0xb133('0x11'),'md5secret',_0xb133('0x12'),_0xb133('0x13'),'mailPause','faxPause','smsPause','openchannelPause',_0xb133('0x14'),_0xb133('0x15'),_0xb133('0x16'),_0xb133('0x17'),_0xb133('0x18'),_0xb133('0x19'),'passwordResetAt',_0xb133('0x1a'),_0xb133('0x1b'),_0xb133('0x1c'),_0xb133('0x1d'),_0xb133('0x1e'),_0xb133('0x1f'),_0xb133('0x20'),_0xb133('0x21'),_0xb133('0x22'),_0xb133('0x23'),'phoneBarRemoteControlPort',_0xb133('0x24'),_0xb133('0x25'),_0xb133('0x26'),_0xb133('0x27'),_0xb133('0x28'),_0xb133('0x29'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0xb133('0x2a')];exports[_0xb133('0x2b')]=function(){return this[_0xb133('0x2c')](!![])[_0xb133('0x2d')](function(_0x3f46da,_0x519e6e,_0x2f04e5){if(_0x3f46da[_0xb133('0x2e')]){_0x2f04e5();}else{return db[_0xb133('0x2f')][_0xb133('0x30')]({'where':{'id':_0x3f46da[_0xb133('0x31')]['id']},'attributes':['id',_0xb133('0x32'),_0xb133('0x33')],'raw':!![]})[_0xb133('0x34')](function(_0x2b6083){if(_0x2b6083&&_0x2b6083['closed']){return _0x519e6e[_0xb133('0x35')](_0x2b6083['disposition']===_0xb133('0x36')?0x195:0x193)['json']({'message':_0x2b6083[_0xb133('0x33')]==='unmanaged'?_0xb133('0x37'):_0xb133('0x38')});}else{_0x2f04e5();}})[_0xb133('0x39')](function(_0x59b52e){_0x2f04e5(_0x59b52e);});}});};exports[_0xb133('0x2c')]=function isAuthenticated(_0x295ef9){return compose()[_0xb133('0x2d')](function(_0x219d98,_0xf227c1,_0x583074){var _0x373f97;if(_0x219d98['headers'][_0xb133('0x3a')]){if(_[_0xb133('0x3b')](_0x219d98[_0xb133('0x3c')][_0xb133('0x3a')],_0xb133('0x3d'))){var _0x153669=basicAuth(_0x219d98);db[_0xb133('0x3e')][_0xb133('0x3f')]({'where':{'name':_0x153669[_0xb133('0xd')]}})[_0xb133('0x34')](function(_0x104193){if(!_0x104193||!_0x104193['authenticate'](_0x153669[_0xb133('0x40')])){return _0xf227c1[_0xb133('0x35')](0x191)[_0xb133('0x41')]({'message':_0xb133('0x42')});}_0x219d98['user']={'id':_0x104193['id']};_0x583074();})[_0xb133('0x39')](function(_0x573793){_0x583074(_0x573793);});}else if(_[_0xb133('0x3b')](_0x219d98[_0xb133('0x3c')][_0xb133('0x3a')],'Bearer')){validateJwt(_0x219d98,_0xf227c1,_0x583074);}else{if(_0x295ef9){_0x583074();}else{return _0xf227c1['status'](0x193)[_0xb133('0x41')]({'message':_0xb133('0x43')});}}}else if(_0x219d98[_0xb133('0x44')]['apikey']){try{var _0x564f7b={'audience':hardwareConf[_0xb133('0x45')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x219d98[_0xb133('0x44')][_0xb133('0x46')],_0x564f7b)[_0xb133('0x34')](function(_0x185d55){return db[_0xb133('0x3e')][_0xb133('0x3f')]({'where':{'id':_0x185d55['sub']}})[_0xb133('0x34')](function(_0x16e416){_0x373f97=_0x16e416;return db[_0xb133('0x47')][_0xb133('0x30')]({'where':{'id':0x1},'attributes':[_0xb133('0x48'),_0xb133('0x49')],'raw':!![]});})['then'](function(_0x287073){if(!_0x373f97||!_[_0xb133('0x4a')](_0x373f97[_0xb133('0x4b')],_0x185d55[_0xb133('0x4c')])){return _0xf227c1['status'](0x191)[_0xb133('0x41')]({'message':_0xb133('0x4d')});}if(_0x373f97['disabled']){return _0xf227c1[_0xb133('0x35')](0x191)['json']({'message':_0xb133('0x4e')});}if(_0x373f97['blocked']){if(_0x287073[_0xb133('0x49')]>0x0){if(moment(_0x373f97['blockedAt'])[_0xb133('0x4f')](_0x287073[_0xb133('0x49')],'minutes')>moment()){return _0xf227c1[_0xb133('0x35')](0x191)[_0xb133('0x41')]({'message':_0xb133('0x4e')});}}else{return _0xf227c1[_0xb133('0x35')](0x191)[_0xb133('0x41')]({'message':_0xb133('0x4e')});}}_0x219d98[_0xb133('0x2e')]={'id':_0x373f97['id']};_0x583074();});})[_0xb133('0x39')](function(){return _0xf227c1[_0xb133('0x35')](0x191)[_0xb133('0x41')]({'message':_0xb133('0x4e')});});}catch(_0x5c1dda){_0x583074(_0x5c1dda);}}else if(_0x295ef9){_0x583074();}else{return _0xf227c1[_0xb133('0x35')](0x193)[_0xb133('0x41')]({'message':_0xb133('0x43')});}})[_0xb133('0x2d')](function(_0x1b0e0b,_0x26caae,_0x1d3abc){if(_0x1b0e0b[_0xb133('0x2e')]){db[_0xb133('0x3e')]['find']({'where':{'id':_0x1b0e0b[_0xb133('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0x5716ec){if(!_0x5716ec){return _0x26caae['status'](0x194)[_0xb133('0x41')]({'message':_0xb133('0x50')});}_0x1b0e0b[_0xb133('0x2e')]=_0x5716ec;_0x1d3abc();})[_0xb133('0x39')](function(_0x5e40f7){_0x1d3abc(_0x5e40f7);});}else if(_0x295ef9){_0x1d3abc();}else{return _0x26caae[_0xb133('0x35')](0x194)[_0xb133('0x41')]({'message':_0xb133('0x51')});}});};exports[_0xb133('0x52')]=function canUpdate(){return compose()[_0xb133('0x2d')](function(_0x2bee75,_0xa2c752,_0x10ec49){return licenseUtil[_0xb133('0x53')]()['then'](function(_0x4dc798){if(_0x4dc798[_0xb133('0x54')]){_0x10ec49();}else{return _0xa2c752[_0xb133('0x35')](0x193)[_0xb133('0x41')]({'message':_0xb133('0x55')});}})[_0xb133('0x39')](function(_0xc89c4f){_0x10ec49(_0xc89c4f);});});};exports[_0xb133('0x56')]=function(_0x7527c6,_0x208e86,_0x3104cb){_0x7527c6['isMiddleware']=!![];return _0x3104cb();};exports['signToken']=function signToken(_0x5a20c7){return signJwt(_0x5a20c7);};exports[_0xb133('0x57')]=function(_0x55c0bf,_0x3c2b19){if(!_0x55c0bf['user']){return _0x3c2b19[_0xb133('0x35')](0x194)[_0xb133('0x41')]({'message':_0xb133('0x58')});}var _0x4dffd0={'payload':{'id':_0x55c0bf[_0xb133('0x2e')]['id'],'role':_0x55c0bf[_0xb133('0x2e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4dffd0)['then'](function(_0x6546fb){_0x3c2b19[_0xb133('0x59')](_0xb133('0x5a'),_0x6546fb);_0x3c2b19[_0xb133('0x5b')](_0xb133('0x5c'));})[_0xb133('0x39')](function(_0x34eb1c){return _0x3c2b19[_0xb133('0x35')](0x1f4)[_0xb133('0x5d')](_0x34eb1c);});};exports[_0xb133('0x5e')]=function(_0x46fb9f){if(_['isNil'](_0x46fb9f['apiKeyNonce'])||_['isNil'](_0x46fb9f[_0xb133('0x5f')])){return null;}else{return createJwt(_0x46fb9f);}};exports[_0xb133('0x60')]=function(_0x273b2c){_0x273b2c[_0xb133('0x4b')]=generateNonce();_0x273b2c[_0xb133('0x5f')]=generateIssuedAt();return createJwt(_0x273b2c);};exports[_0xb133('0x61')]=function(_0x567063,_0x109a03){var _0x316dbb=_0x567063[_0xb133('0x44')][_0xb133('0x46')];if(_0x316dbb){var _0xeafeb0={'nonce':_0x109a03[_0xb133('0x4b')],'iat':_0x109a03[_0xb133('0x5f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb133('0x45')]()};return verifyJwt(_0x316dbb,_0xeafeb0)[_0xb133('0x34')](function(){return generateApiKey(_0x109a03);});}else{throw{'message':_0xb133('0x62')};}};exports[_0xb133('0x63')]=function(_0x3cd7db){var _0x380cfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x380cfa['test'](_0x3cd7db))throw new db[(_0xb133('0x64'))][(_0xb133('0x65'))](_0xb133('0x66'));return;};exports['validatePasswordHistory']=function(_0x40522f,_0x18d6aa,_0x16bfd9){var _0x1b6f14=encryptor['decryptString'](_0x18d6aa)[_0xb133('0x67')](',');for(var _0x37467f=0x0;_0x37467f<_0x16bfd9;_0x37467f++){if(!_0x1b6f14[_0x37467f])break;if(_0x40522f[_0xb133('0x68')]()===_0x1b6f14[_0x37467f][_0xb133('0x68')]()){var _0x5caefa=util[_0xb133('0x69')](_0xb133('0x6a'),_0x16bfd9);if(_0x16bfd9===0x1){_0x5caefa='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xb133('0x64'))]['ValidationError'](_0x5caefa);}}return;};exports[_0xb133('0x6b')]=function(_0x21fd14,_0x577feb){var _0x5b9913=_0x577feb?encryptor[_0xb133('0x6c')](_0x577feb)[_0xb133('0x67')](','):[];if(_0x5b9913[_0xb133('0x6d')]===0x5){_0x5b9913[_0xb133('0x6e')](-0x1,0x1);}_0x5b9913[_0xb133('0x6f')](_0x21fd14);return encryptor[_0xb133('0x70')](_0x5b9913['join'](','));};function signJwt(_0x43466d){var _0x3a2ac2=BPromise[_0xb133('0x71')](jwt[_0xb133('0x72')],{'context':jwt});var _0x57b973=_0x43466d['secret']||config[_0xb133('0x9')][_0xb133('0xa')];return new BPromise(function(_0x4817dc,_0x42ea3f){_0x3a2ac2(_0x43466d[_0xb133('0x73')],_0x57b973,_0x43466d[_0xb133('0x74')])[_0xb133('0x34')](function(_0x5c6cdf){_0x4817dc(_0x5c6cdf);})[_0xb133('0x39')](function(_0xdb1cf4){_0x42ea3f(_0xdb1cf4);});});}function verifyJwt(_0x45b7c6,_0x2875c0,_0xcff227){var _0x540323=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x3298d6=_0xcff227||config['secrets'][_0xb133('0xa')];return new BPromise(function(_0x27a1b2,_0x1b07a5){_0x540323(_0x45b7c6,_0x3298d6,_0x2875c0)['then'](function(_0x2ed67d){_0x27a1b2(_0x2ed67d);})[_0xb133('0x39')](function(_0x3cd238){_0x1b07a5(_0x3cd238);});});}function generateNonce(){return crypto[_0xb133('0x75')](0x10)[_0xb133('0x76')](_0xb133('0x77'));}function generateIssuedAt(){return Math['floor'](Date[_0xb133('0x78')]()/0x3e8)[_0xb133('0x76')]();}function createJwt(_0xcbe324){var _0x1ab5dd={'payload':{'iat':_0xcbe324[_0xb133('0x5f')],'nonce':_0xcbe324[_0xb133('0x4b')]},'options':{'algorithm':_0xb133('0x79'),'subject':_0xcbe324['id'][_0xb133('0x76')](),'issuer':hardwareConf[_0xb133('0x45')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1ab5dd)[_0xb133('0x34')](function(_0x3103ef){return{'iat':_0xcbe324['apiKeyIat'],'nonce':_0xcbe324[_0xb133('0x4b')],'token':_0x3103ef};});} \ No newline at end of file +var _0xf0c9=['canUpdate','Forbidden','isMiddleware','signToken','setTokenCookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','splice','unshift','join','sign','secret','payload','options','verify','floor','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','allowedLoginAttempts','blockDuration','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.'];(function(_0x4c943d,_0x5e3b6f){var _0x508d76=function(_0x484841){while(--_0x484841){_0x4c943d['push'](_0x4c943d['shift']());}};_0x508d76(++_0x5e3b6f);}(_0xf0c9,0x116));var _0x9f0c=function(_0x2d5411,_0x1a439f){_0x2d5411=_0x2d5411-0x0;var _0x4f13d7=_0xf0c9[_0x2d5411];return _0x4f13d7;};'use strict';var db=require(_0x9f0c('0x0'))['db'];var config=require(_0x9f0c('0x1'));var hardwareConf=require(_0x9f0c('0x2'));var licenseUtil=require(_0x9f0c('0x3'));var encryptor=require(_0x9f0c('0x4'));var _=require(_0x9f0c('0x5'));var jwt=require(_0x9f0c('0x6'));var expressJwt=require(_0x9f0c('0x7'));var compose=require(_0x9f0c('0x8'));var basicAuth=require(_0x9f0c('0x9'));var crypto=require(_0x9f0c('0xa'));var BPromise=require('bluebird');var util=require(_0x9f0c('0xb'));var moment=require(_0x9f0c('0xc'));var validateJwt=expressJwt({'secret':config[_0x9f0c('0xd')][_0x9f0c('0xe')]});var userAttributes=['id',_0x9f0c('0xf'),_0x9f0c('0x10'),'name',_0x9f0c('0x11'),_0x9f0c('0x12'),_0x9f0c('0x13'),_0x9f0c('0x14'),_0x9f0c('0x15'),_0x9f0c('0x16'),'chatPause',_0x9f0c('0x17'),_0x9f0c('0x18'),_0x9f0c('0x19'),'openchannelPause',_0x9f0c('0x1a'),_0x9f0c('0x1b'),_0x9f0c('0x1c'),_0x9f0c('0x1d'),'crudPermissions',_0x9f0c('0x1e'),_0x9f0c('0x1f'),'alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x9f0c('0x20'),_0x9f0c('0x21'),_0x9f0c('0x22'),'phoneBarEnableSettings',_0x9f0c('0x23'),_0x9f0c('0x24'),_0x9f0c('0x25'),'phoneBarRemoteControlPort',_0x9f0c('0x26'),_0x9f0c('0x27'),_0x9f0c('0x28'),_0x9f0c('0x29'),_0x9f0c('0x2a'),_0x9f0c('0x2b'),_0x9f0c('0x2c'),_0x9f0c('0x2d'),_0x9f0c('0x2e')];exports[_0x9f0c('0x2f')]=function(){return this[_0x9f0c('0x30')](!![])[_0x9f0c('0x31')](function(_0xad2a99,_0x114d9b,_0x12a204){if(_0xad2a99[_0x9f0c('0x32')]){_0x12a204();}else{return db[_0x9f0c('0x33')][_0x9f0c('0x34')]({'where':{'id':_0xad2a99['params']['id']},'attributes':['id','closed',_0x9f0c('0x35')],'raw':!![]})[_0x9f0c('0x36')](function(_0x5b6f8c){if(_0x5b6f8c&&_0x5b6f8c['closed']){return _0x114d9b['status'](_0x5b6f8c[_0x9f0c('0x35')]===_0x9f0c('0x37')?0x195:0x193)['json']({'message':_0x5b6f8c[_0x9f0c('0x35')]===_0x9f0c('0x37')?_0x9f0c('0x38'):_0x9f0c('0x39')});}else{_0x12a204();}})[_0x9f0c('0x3a')](function(_0x5f14b2){_0x12a204(_0x5f14b2);});}});};exports[_0x9f0c('0x30')]=function isAuthenticated(_0x3b34f2){return compose()[_0x9f0c('0x31')](function(_0x4c6bd8,_0x1ef8c3,_0x2aecab){var _0x55475d;if(_0x4c6bd8[_0x9f0c('0x3b')][_0x9f0c('0x3c')]){if(_[_0x9f0c('0x3d')](_0x4c6bd8[_0x9f0c('0x3b')][_0x9f0c('0x3c')],_0x9f0c('0x3e'))){var _0xe2fb19=basicAuth(_0x4c6bd8);db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'name':_0xe2fb19['name']}})[_0x9f0c('0x36')](function(_0x24d19d){if(!_0x24d19d||!_0x24d19d[_0x9f0c('0x41')](_0xe2fb19[_0x9f0c('0x42')])){return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x45')});}_0x4c6bd8[_0x9f0c('0x32')]={'id':_0x24d19d['id']};_0x2aecab();})[_0x9f0c('0x3a')](function(_0x534efb){_0x2aecab(_0x534efb);});}else if(_[_0x9f0c('0x3d')](_0x4c6bd8[_0x9f0c('0x3b')]['authorization'],_0x9f0c('0x46'))){validateJwt(_0x4c6bd8,_0x1ef8c3,_0x2aecab);}else{if(_0x3b34f2){_0x2aecab();}else{return _0x1ef8c3[_0x9f0c('0x43')](0x193)[_0x9f0c('0x44')]({'message':_0x9f0c('0x47')});}}}else if(_0x4c6bd8['query'][_0x9f0c('0x48')]){try{var _0x4a9dd6={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x9f0c('0x49')]()};verifyJwt(_0x4c6bd8[_0x9f0c('0x4a')]['apikey'],_0x4a9dd6)[_0x9f0c('0x36')](function(_0x165ac8){return db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'id':_0x165ac8[_0x9f0c('0x4b')]}})[_0x9f0c('0x36')](function(_0x165755){_0x55475d=_0x165755;return db['Setting'][_0x9f0c('0x34')]({'where':{'id':0x1},'attributes':[_0x9f0c('0x4c'),_0x9f0c('0x4d')],'raw':!![]});})[_0x9f0c('0x36')](function(_0x346f36){if(!_0x55475d||!_['isEqual'](_0x55475d['apiKeyNonce'],_0x165ac8['nonce'])){return _0x1ef8c3['status'](0x191)[_0x9f0c('0x44')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x55475d[_0x9f0c('0x4e')]){return _0x1ef8c3[_0x9f0c('0x43')](0x191)['json']({'message':_0x9f0c('0x4f')});}if(_0x55475d[_0x9f0c('0x50')]){if(_0x346f36[_0x9f0c('0x4d')]>0x0){if(moment(_0x55475d['blockedAt'])[_0x9f0c('0x51')](_0x346f36[_0x9f0c('0x4d')],_0x9f0c('0x52'))>moment()){return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x4f')});}}else{return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x4f')});}}_0x4c6bd8[_0x9f0c('0x32')]={'id':_0x55475d['id']};_0x2aecab();});})['catch'](function(){return _0x1ef8c3['status'](0x191)[_0x9f0c('0x44')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2a0342){_0x2aecab(_0x2a0342);}}else if(_0x3b34f2){_0x2aecab();}else{return _0x1ef8c3[_0x9f0c('0x43')](0x193)[_0x9f0c('0x44')]({'message':_0x9f0c('0x47')});}})['use'](function(_0x4a3f18,_0x13956e,_0x7e690c){if(_0x4a3f18[_0x9f0c('0x32')]){db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'id':_0x4a3f18[_0x9f0c('0x32')]['id']},'attributes':userAttributes})[_0x9f0c('0x36')](function(_0x31fc67){if(!_0x31fc67){return _0x13956e[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':_0x9f0c('0x53')});}_0x4a3f18[_0x9f0c('0x32')]=_0x31fc67;_0x7e690c();})[_0x9f0c('0x3a')](function(_0x455c85){_0x7e690c(_0x455c85);});}else if(_0x3b34f2){_0x7e690c();}else{return _0x13956e[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':_0x9f0c('0x54')});}});};exports[_0x9f0c('0x55')]=function canUpdate(){return compose()[_0x9f0c('0x31')](function(_0x3e0be7,_0x336ddc,_0x4b0fb9){return licenseUtil['getLicense']()[_0x9f0c('0x36')](function(_0x1cd53f){if(_0x1cd53f['update']){_0x4b0fb9();}else{return _0x336ddc[_0x9f0c('0x43')](0x193)['json']({'message':_0x9f0c('0x56')});}})['catch'](function(_0x15225c){_0x4b0fb9(_0x15225c);});});};exports['isMiddleware']=function(_0x267d12,_0xd8115b,_0xb5f19c){_0x267d12[_0x9f0c('0x57')]=!![];return _0xb5f19c();};exports[_0x9f0c('0x58')]=function signToken(_0x1dcbe8){return signJwt(_0x1dcbe8);};exports[_0x9f0c('0x59')]=function(_0x5470fb,_0x2d5308){if(!_0x5470fb[_0x9f0c('0x32')]){return _0x2d5308[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4cc0c2={'payload':{'id':_0x5470fb['user']['id'],'role':_0x5470fb[_0x9f0c('0x32')][_0x9f0c('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4cc0c2)['then'](function(_0x5d7fe7){_0x2d5308['cookie'](_0x9f0c('0x5a'),_0x5d7fe7);_0x2d5308[_0x9f0c('0x5b')](_0x9f0c('0x5c'));})['catch'](function(_0x4113d6){return _0x2d5308['status'](0x1f4)[_0x9f0c('0x5d')](_0x4113d6);});};exports[_0x9f0c('0x5e')]=function(_0x3a8a52){if(_[_0x9f0c('0x5f')](_0x3a8a52[_0x9f0c('0x60')])||_['isNil'](_0x3a8a52[_0x9f0c('0x61')])){return null;}else{return createJwt(_0x3a8a52);}};exports[_0x9f0c('0x62')]=function(_0x31f039){_0x31f039[_0x9f0c('0x60')]=generateNonce();_0x31f039['apiKeyIat']=generateIssuedAt();return createJwt(_0x31f039);};exports['regenerateApiKey']=function(_0x530ffc,_0x3b6ee5){var _0x390dbe=_0x530ffc[_0x9f0c('0x4a')][_0x9f0c('0x48')];if(_0x390dbe){var _0x583dc2={'nonce':_0x3b6ee5[_0x9f0c('0x60')],'iat':_0x3b6ee5['apiKeyIat'],'audience':hardwareConf[_0x9f0c('0x49')](),'issuer':hardwareConf[_0x9f0c('0x49')]()};return verifyJwt(_0x390dbe,_0x583dc2)['then'](function(){return generateApiKey(_0x3b6ee5);});}else{throw{'message':_0x9f0c('0x63')};}};exports['validatePasswordPattern']=function(_0x438b18){var _0x71b29c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x71b29c[_0x9f0c('0x64')](_0x438b18))throw new db[(_0x9f0c('0x65'))][(_0x9f0c('0x66'))](_0x9f0c('0x67'));return;};exports[_0x9f0c('0x68')]=function(_0x22d771,_0x329fd6,_0x529e96){var _0xe118b7=encryptor['decryptString'](_0x329fd6)[_0x9f0c('0x69')](',');for(var _0x38b228=0x0;_0x38b228<_0x529e96;_0x38b228++){if(!_0xe118b7[_0x38b228])break;if(_0x22d771[_0x9f0c('0x6a')]()===_0xe118b7[_0x38b228][_0x9f0c('0x6a')]()){var _0xffec41=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x529e96);if(_0x529e96===0x1){_0xffec41=_0x9f0c('0x6b');}throw new db[(_0x9f0c('0x65'))][(_0x9f0c('0x66'))](_0xffec41);}}return;};exports[_0x9f0c('0x6c')]=function(_0x36c95b,_0x490622){var _0x4ad908=_0x490622?encryptor[_0x9f0c('0x6d')](_0x490622)[_0x9f0c('0x69')](','):[];if(_0x4ad908['length']===0x5){_0x4ad908[_0x9f0c('0x6e')](-0x1,0x1);}_0x4ad908[_0x9f0c('0x6f')](_0x36c95b);return encryptor['encryptString'](_0x4ad908[_0x9f0c('0x70')](','));};function signJwt(_0x314182){var _0x566bcc=BPromise['promisify'](jwt[_0x9f0c('0x71')],{'context':jwt});var _0x22a974=_0x314182[_0x9f0c('0x72')]||config['secrets']['session'];return new BPromise(function(_0x15fc60,_0x4cd4ff){_0x566bcc(_0x314182[_0x9f0c('0x73')],_0x22a974,_0x314182[_0x9f0c('0x74')])[_0x9f0c('0x36')](function(_0x1dcd9e){_0x15fc60(_0x1dcd9e);})[_0x9f0c('0x3a')](function(_0xb9f2bc){_0x4cd4ff(_0xb9f2bc);});});}function verifyJwt(_0x347231,_0x2b7a94,_0x4c13dd){var _0x479a94=BPromise['promisify'](jwt[_0x9f0c('0x75')],{'context':jwt});var _0xf2fdfa=_0x4c13dd||config['secrets'][_0x9f0c('0xe')];return new BPromise(function(_0x3e4d61,_0x4c710d){_0x479a94(_0x347231,_0xf2fdfa,_0x2b7a94)['then'](function(_0x228faa){_0x3e4d61(_0x228faa);})['catch'](function(_0x3067fc){_0x4c710d(_0x3067fc);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x9f0c('0x76')](Date[_0x9f0c('0x77')]()/0x3e8)['toString']();}function createJwt(_0x1d9d0e){var _0x5aa01d={'payload':{'iat':_0x1d9d0e[_0x9f0c('0x61')],'nonce':_0x1d9d0e[_0x9f0c('0x60')]},'options':{'algorithm':'HS512','subject':_0x1d9d0e['id'][_0x9f0c('0x78')](),'issuer':hardwareConf[_0x9f0c('0x49')](),'audience':hardwareConf[_0x9f0c('0x49')]()}};return signJwt(_0x5aa01d)['then'](function(_0x30eace){return{'iat':_0x1d9d0e[_0x9f0c('0x61')],'nonce':_0x1d9d0e['apiKeyNonce'],'token':_0x30eace};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5926a9c..9657ef5 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 _0x9159=['close','unlink','decryptFile','update','encryptString','secret','utf8','base64','decryptString','createDecipher','../../config/environment','../../config/logger','app','secrets','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','final'];(function(_0x2a8c08,_0x3e10e8){var _0x5010c0=function(_0x349144){while(--_0x349144){_0x2a8c08['push'](_0x2a8c08['shift']());}};_0x5010c0(++_0x3e10e8);}(_0x9159,0x86));var _0x9915=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x9159[_0x221b8c];return _0x3fab9f;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x9915('0x0'));var logger=require(_0x9915('0x1'))(_0x9915('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9915('0x3')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x9915('0x4')};if(config[_0x9915('0x5')]&&config['encrypt'][_0x9915('0x6')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x9915('0x6')]);if(isSupported){fileOptions['algorithm']=config[_0x9915('0x5')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9915('0x7')](',\x20');logger['error'](config[_0x9915('0x5')][_0x9915('0x6')],_0x9915('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x61d353){return AES_SUPPORTED_RX[_0x9915('0x9')](_0x61d353);}function getSupportedCiphers(){return crypto[_0x9915('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x4f91b1){return getSupportedCiphers()[_0x9915('0xb')](_0x4f91b1)>-0x1;}function combineOptions(_0x5b3158){var _0x42194c={};for(var _0x2410d4 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2410d4)){_0x42194c[_0x2410d4]=fileOptions[_0x2410d4];}}if(_0x5b3158){for(var _0x5c2b0b in _0x5b3158){if(_0x5b3158['hasOwnProperty'](_0x5c2b0b)){_0x42194c[_0x5c2b0b]=_0x5b3158[_0x5c2b0b];}}}return _0x42194c;}exports[_0x9915('0xc')]=function(_0x26965a,_0x23efa5,_0x50f96a,_0x48080f){return new BPromise(function(_0x388b24,_0x2115cc){_0x48080f=combineOptions(_0x48080f);var _0x1f6747=new Buffer(_0x50f96a);var _0x5c214e=fs[_0x9915('0xd')](_0x26965a);var _0x1b6eab=fs[_0x9915('0xe')](_0x23efa5);var _0x519f81=crypto[_0x9915('0xf')](_0x48080f[_0x9915('0x6')],_0x1f6747);_0x5c214e['on'](_0x9915('0x10'),function(_0x21fffd){var _0x4e9491=new Buffer(_0x519f81['update'](_0x21fffd),_0x9915('0x11'));_0x1b6eab[_0x9915('0x12')](_0x4e9491);});_0x5c214e['on'](_0x9915('0x13'),function(){try{var _0x3f719e=new Buffer(_0x519f81[_0x9915('0x14')]('binary'),_0x9915('0x11'));_0x1b6eab['write'](_0x3f719e);_0x1b6eab[_0x9915('0x13')]();_0x1b6eab['on'](_0x9915('0x15'),function(){return _0x388b24(_0x23efa5);});}catch(_0x184d02){fs[_0x9915('0x16')](_0x23efa5);return _0x2115cc(_0x184d02);}});});};exports[_0x9915('0x17')]=function(_0x1f115c,_0x521dcc,_0x1c563e,_0x49af51){return new BPromise(function(_0x195f97,_0x44a4b1){_0x49af51=combineOptions(_0x49af51);var _0x419f49=new Buffer(_0x1c563e);var _0x4c4241=fs[_0x9915('0xd')](_0x1f115c);var _0x57f3c6=fs[_0x9915('0xe')](_0x521dcc);var _0x4cfb19=crypto['createDecipher'](_0x49af51[_0x9915('0x6')],_0x419f49);_0x4c4241['on']('data',function(_0x2d575f){var _0x3778bc=new Buffer(_0x4cfb19[_0x9915('0x18')](_0x2d575f),_0x9915('0x11'));_0x57f3c6[_0x9915('0x12')](_0x3778bc);});_0x4c4241['on'](_0x9915('0x13'),function(){try{var _0x509ba4=new Buffer(_0x4cfb19[_0x9915('0x14')](_0x9915('0x11')),_0x9915('0x11'));_0x57f3c6[_0x9915('0x12')](_0x509ba4);_0x57f3c6[_0x9915('0x13')]();_0x57f3c6['on'](_0x9915('0x15'),function(){return _0x195f97(_0x521dcc);});}catch(_0x5e25b7){fs['unlink'](_0x521dcc);return _0x44a4b1(_0x5e25b7);}});});};exports[_0x9915('0x19')]=function(_0x38e257,_0x111a0c,_0x229abf){var _0x4324fe=_0x229abf||stringOptions[_0x9915('0x6')];var _0xae0685=_0x111a0c||stringOptions[_0x9915('0x1a')];var _0x2e71de=crypto['createCipher'](_0x4324fe,_0xae0685);var _0x298641=_0x2e71de['update'](_0x38e257,_0x9915('0x1b'),'base64');_0x298641+=_0x2e71de[_0x9915('0x14')](_0x9915('0x1c'));return _0x298641;};exports[_0x9915('0x1d')]=function(_0x18f9d7,_0x15b7e2,_0x360609){var _0x22775e=_0x360609||stringOptions[_0x9915('0x6')];var _0x3191a0=_0x15b7e2||stringOptions[_0x9915('0x1a')];var _0x55704d=crypto[_0x9915('0x1e')](_0x22775e,_0x3191a0);var _0x3fdfd2=_0x55704d[_0x9915('0x18')](_0x18f9d7,'base64',_0x9915('0x1b'));_0x3fdfd2+=_0x55704d[_0x9915('0x14')](_0x9915('0x1b'));return _0x3fdfd2;}; \ No newline at end of file +var _0xd836=['write','final','end','unlink','createReadStream','createDecipher','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary'];(function(_0x1ca993,_0x243c1e){var _0x150e5e=function(_0xaf1a3e){while(--_0xaf1a3e){_0x1ca993['push'](_0x1ca993['shift']());}};_0x150e5e(++_0x243c1e);}(_0xd836,0x72));var _0x6d83=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd836[_0x4565bf];return _0x5610ba;};'use strict';var crypto=require(_0x6d83('0x0'));var fs=require('fs');var BPromise=require(_0x6d83('0x1'));var _=require(_0x6d83('0x2'));var config=require(_0x6d83('0x3'));var logger=require('../../config/logger')(_0x6d83('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6d83('0x5')]['session'],'algorithm':_0x6d83('0x6')};const fileOptions={'algorithm':_0x6d83('0x7')};if(config[_0x6d83('0x8')]&&config[_0x6d83('0x8')][_0x6d83('0x9')]){var isSupported=isAlgorithmSupported(config[_0x6d83('0x8')]['algorithm']);if(isSupported){fileOptions[_0x6d83('0x9')]=config[_0x6d83('0x8')][_0x6d83('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6d83('0xa')](',\x20');logger[_0x6d83('0xb')](config[_0x6d83('0x8')][_0x6d83('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xb6145c){return AES_SUPPORTED_RX[_0x6d83('0xc')](_0xb6145c);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x6d83('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5ec01f){return getSupportedCiphers()[_0x6d83('0xe')](_0x5ec01f)>-0x1;}function combineOptions(_0x2c1f60){var _0x31fc92={};for(var _0x48939a in fileOptions){if(fileOptions['hasOwnProperty'](_0x48939a)){_0x31fc92[_0x48939a]=fileOptions[_0x48939a];}}if(_0x2c1f60){for(var _0xc1b6da in _0x2c1f60){if(_0x2c1f60[_0x6d83('0xf')](_0xc1b6da)){_0x31fc92[_0xc1b6da]=_0x2c1f60[_0xc1b6da];}}}return _0x31fc92;}exports[_0x6d83('0x10')]=function(_0x5c4e0e,_0x9aa6fa,_0x25f58b,_0x5662de){return new BPromise(function(_0x2e0cf2,_0x1f82b6){_0x5662de=combineOptions(_0x5662de);var _0x41a4cf=new Buffer(_0x25f58b);var _0x173c2a=fs['createReadStream'](_0x5c4e0e);var _0x4da1bb=fs[_0x6d83('0x11')](_0x9aa6fa);var _0x5760fa=crypto[_0x6d83('0x12')](_0x5662de[_0x6d83('0x9')],_0x41a4cf);_0x173c2a['on'](_0x6d83('0x13'),function(_0x2aea95){var _0x4608ec=new Buffer(_0x5760fa[_0x6d83('0x14')](_0x2aea95),_0x6d83('0x15'));_0x4da1bb[_0x6d83('0x16')](_0x4608ec);});_0x173c2a['on']('end',function(){try{var _0x21dbe5=new Buffer(_0x5760fa[_0x6d83('0x17')](_0x6d83('0x15')),_0x6d83('0x15'));_0x4da1bb[_0x6d83('0x16')](_0x21dbe5);_0x4da1bb[_0x6d83('0x18')]();_0x4da1bb['on']('close',function(){return _0x2e0cf2(_0x9aa6fa);});}catch(_0x3cea09){fs[_0x6d83('0x19')](_0x9aa6fa);return _0x1f82b6(_0x3cea09);}});});};exports['decryptFile']=function(_0x51de9a,_0x28bf6a,_0x2148da,_0x59f624){return new BPromise(function(_0x36621f,_0x165c77){_0x59f624=combineOptions(_0x59f624);var _0x5f5cb6=new Buffer(_0x2148da);var _0x1875bd=fs[_0x6d83('0x1a')](_0x51de9a);var _0x55f370=fs[_0x6d83('0x11')](_0x28bf6a);var _0x4038bd=crypto[_0x6d83('0x1b')](_0x59f624['algorithm'],_0x5f5cb6);_0x1875bd['on'](_0x6d83('0x13'),function(_0x461f4d){var _0x30a6df=new Buffer(_0x4038bd['update'](_0x461f4d),_0x6d83('0x15'));_0x55f370[_0x6d83('0x16')](_0x30a6df);});_0x1875bd['on']('end',function(){try{var _0x2f8d5c=new Buffer(_0x4038bd[_0x6d83('0x17')]('binary'),_0x6d83('0x15'));_0x55f370[_0x6d83('0x16')](_0x2f8d5c);_0x55f370[_0x6d83('0x18')]();_0x55f370['on'](_0x6d83('0x1c'),function(){return _0x36621f(_0x28bf6a);});}catch(_0x529359){fs[_0x6d83('0x19')](_0x28bf6a);return _0x165c77(_0x529359);}});});};exports[_0x6d83('0x1d')]=function(_0x1a3f40,_0x3c0491,_0x4e8a9e){var _0x5d21e8=_0x4e8a9e||stringOptions['algorithm'];var _0x59c870=_0x3c0491||stringOptions[_0x6d83('0x1e')];var _0x5d0d13=crypto[_0x6d83('0x12')](_0x5d21e8,_0x59c870);var _0x3d528d=_0x5d0d13[_0x6d83('0x14')](_0x1a3f40,_0x6d83('0x1f'),_0x6d83('0x20'));_0x3d528d+=_0x5d0d13[_0x6d83('0x17')](_0x6d83('0x20'));return _0x3d528d;};exports[_0x6d83('0x21')]=function(_0x31ed65,_0x303a35,_0x1fd6e6){var _0x409fc3=_0x1fd6e6||stringOptions[_0x6d83('0x9')];var _0x3f1e5c=_0x303a35||stringOptions['secret'];var _0x573942=crypto[_0x6d83('0x1b')](_0x409fc3,_0x3f1e5c);var _0x393d46=_0x573942[_0x6d83('0x14')](_0x31ed65,'base64',_0x6d83('0x1f'));_0x393d46+=_0x573942[_0x6d83('0x17')]('utf8');return _0x393d46;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 606973f..1fe387a 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 _0x6cdf=['SELECT','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes'];(function(_0x4addaa,_0x443146){var _0x3eb2eb=function(_0x192442){while(--_0x192442){_0x4addaa['push'](_0x4addaa['shift']());}};_0x3eb2eb(++_0x443146);}(_0x6cdf,0x122));var _0xf6cd=function(_0x22d02c,_0x15300f){_0x22d02c=_0x22d02c-0x0;var _0x5158f1=_0x6cdf[_0x22d02c];return _0x5158f1;};'use strict';var util=require(_0xf6cd('0x0'));var path=require(_0xf6cd('0x1'));var _=require(_0xf6cd('0x2'));var csv=require(_0xf6cd('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xf6cd('0x4'));var rimraf=require(_0xf6cd('0x5'));var db=require(_0xf6cd('0x6'))['db'];var dbH=require(_0xf6cd('0x6'))[_0xf6cd('0x7')];var logger=require(_0xf6cd('0x8'))(_0xf6cd('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf6cd('0xa')][0x2]);var QUERY=process[_0xf6cd('0xa')][0x3];var PATH=process[_0xf6cd('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c6915,_0x2f6de9){var _0x46e593={'status':_0x1c6915};var _0x4a220e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f6de9){_0x46e593[_0xf6cd('0xb')]=_0x2f6de9;}return db[_0xf6cd('0xc')][_0xf6cd('0xd')](_0x46e593,_0x4a220e);}function main(){var _0x34ca8d=0x1388;var _0x6d9260;logger[_0xf6cd('0xe')](util[_0xf6cd('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf6cd('0x10')));return db[_0xf6cd('0x11')][_0xf6cd('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf6cd('0x13'),'splitSizeCsv']})[_0xf6cd('0x14')](function(_0x444744){if(_0x444744){_0x6d9260=_0x444744;_0x34ca8d=_0x6d9260[_0xf6cd('0x15')]||0x1388;}})[_0xf6cd('0x14')](function(){return dbH[_0xf6cd('0x16')][_0xf6cd('0x17')](util[_0xf6cd('0xf')](_0xf6cd('0x18'),QUERY),{'type':dbH[_0xf6cd('0x16')]['QueryTypes']['SELECT']});})[_0xf6cd('0x14')](function(_0xd35f50){if(!_0xd35f50[0x0][_0xf6cd('0x19')]){return analyticExtractedReport(_0xf6cd('0x1a'));}var _0x547842=[];var _0x40d25a=0x0;if(_0x6d9260[_0xf6cd('0x13')]){if(_0xd35f50&&_0xd35f50[_0xf6cd('0x1b')]){var _0x5ae71b=_[_0xf6cd('0x1c')](_0xd35f50[0x0][_0xf6cd('0x19')]/_0x34ca8d);var _0x266772=Number[_0xf6cd('0x1d')](_0xd35f50[0x0][_0xf6cd('0x19')]/_0x34ca8d)?_0xd35f50[0x0][_0xf6cd('0x19')]%_0x34ca8d:0x0;_0x5ae71b[_0xf6cd('0x1e')](function(_0x5be79e){if(_0x5be79e>0x0){_0x40d25a+=_0x34ca8d;}_0x547842[_0xf6cd('0x1f')](dbH[_0xf6cd('0x16')][_0xf6cd('0x17')](util['format'](_0xf6cd('0x20'),QUERY,_0x34ca8d,_0x40d25a),{'type':dbH[_0xf6cd('0x16')][_0xf6cd('0x21')]['SELECT']}));});if(_0x266772>0x0){_0x40d25a+=_0x34ca8d;_0x547842[_0xf6cd('0x1f')](dbH[_0xf6cd('0x16')][_0xf6cd('0x17')](util[_0xf6cd('0xf')](_0xf6cd('0x20'),QUERY,_0x266772,_0x40d25a),{'type':dbH[_0xf6cd('0x16')][_0xf6cd('0x21')][_0xf6cd('0x22')]}));}}}else{_0x547842[_0xf6cd('0x1f')](dbH[_0xf6cd('0x16')][_0xf6cd('0x17')](QUERY,{'type':dbH[_0xf6cd('0x16')]['QueryTypes'][_0xf6cd('0x22')]}));}var _0x4caabb=path[_0xf6cd('0x23')](PATH);var _0x2c9255=path[_0xf6cd('0x24')](PATH,_0xf6cd('0x25'));var _0x53380c=_0x6d9260['split']&&_0x547842[_0xf6cd('0x1b')]>0x1;var _0x3c779a=[];if(!fs[_0xf6cd('0x26')](path[_0xf6cd('0x27')](_0x4caabb,_0x2c9255))&&_0x53380c){fs['mkdirSync'](path[_0xf6cd('0x27')](_0x4caabb,_0x2c9255));}return BPromise[_0xf6cd('0x28')](_0x547842,function(_0x1acf7b){_0x3c779a['push'](_0x1acf7b);})[_0xf6cd('0x14')](function(){for(var _0x175b7f=0x0;_0x175b7f<_0x3c779a[_0xf6cd('0x1b')];_0x175b7f+=0x1){var _0x2dbe34;var _0x4a5244=_0x3c779a[_0x175b7f];if(_0x53380c){_0x2dbe34=path[_0xf6cd('0x27')](_0x4caabb,_0x2c9255,util[_0xf6cd('0xf')](_0xf6cd('0x29'),_0x2c9255,_0x175b7f,_0xf6cd('0x2a')));}else{_0x2dbe34=path['join'](_0x4caabb,util[_0xf6cd('0xf')](_0xf6cd('0x2b'),_0x2c9255,_0xf6cd('0x2a')));}fs[_0xf6cd('0x2c')](_0x2dbe34,csv(_0x4a5244));}})[_0xf6cd('0x14')](function(){if(_0x53380c){return new Promise(function(_0x3756b9){zipdir(path[_0xf6cd('0x27')](_0x4caabb,_0x2c9255),{'saveTo':path[_0xf6cd('0x27')](_0x4caabb,util[_0xf6cd('0xf')]('%s.%s',_0x2c9255,'zip'))},function(_0x214b8e,_0x3de538){rimraf(path[_0xf6cd('0x27')](_0x4caabb,_0x2c9255),function(){});_0x3756b9(_0xf6cd('0x2d'));});});}})[_0xf6cd('0x14')](function(){logger[_0xf6cd('0xe')](util['format'](_0xf6cd('0x2e'),EXTRACTED_REPORT_ID,_0xf6cd('0x10')));return analyticExtractedReport(_0xf6cd('0x2f'),_0x53380c?util[_0xf6cd('0xf')](_0xf6cd('0x2b'),_0x2c9255,_0x53380c?_0xf6cd('0x30'):_0xf6cd('0x2a')):null);});})['catch'](function(_0x510012){logger[_0xf6cd('0xe')](util['format'](_0xf6cd('0x31'),EXTRACTED_REPORT_ID,_0xf6cd('0x10')),util[_0xf6cd('0x32')](_0x510012,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf6cd('0x33'));})[_0xf6cd('0x34')](function(){process[_0xf6cd('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6192=['csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','finally','util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','mkdirSync','join','each','push','then'];(function(_0xd112a4,_0x42ca00){var _0x255a22=function(_0x170903){while(--_0x170903){_0xd112a4['push'](_0xd112a4['shift']());}};_0x255a22(++_0x42ca00);}(_0x6192,0xf3));var _0x2619=function(_0x21c7d9,_0x179196){_0x21c7d9=_0x21c7d9-0x0;var _0xed56f5=_0x6192[_0x21c7d9];return _0xed56f5;};'use strict';var util=require(_0x2619('0x0'));var path=require(_0x2619('0x1'));var _=require(_0x2619('0x2'));var csv=require(_0x2619('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2619('0x4'));var db=require(_0x2619('0x5'))['db'];var dbH=require(_0x2619('0x5'))[_0x2619('0x6')];var logger=require(_0x2619('0x7'))(_0x2619('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x2619('0x9')][0x2]);var QUERY=process[_0x2619('0x9')][0x3];var PATH=process[_0x2619('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3eaf4b,_0x1febd8){var _0x29cc36={'status':_0x3eaf4b};var _0x26d5dc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1febd8){_0x29cc36[_0x2619('0xa')]=_0x1febd8;}return db[_0x2619('0xb')]['update'](_0x29cc36,_0x26d5dc);}function main(){var _0x4a5310=0x1388;var _0x25d666;logger[_0x2619('0xc')](util[_0x2619('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2619('0xe')));return db[_0x2619('0xf')][_0x2619('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2619('0x11'),_0x2619('0x12')]})['then'](function(_0x2e322a){if(_0x2e322a){_0x25d666=_0x2e322a;_0x4a5310=_0x25d666[_0x2619('0x12')]||0x1388;}})['then'](function(){return dbH[_0x2619('0x13')][_0x2619('0x14')](util['format'](_0x2619('0x15'),QUERY),{'type':dbH['sequelize'][_0x2619('0x16')]['SELECT']});})['then'](function(_0x41418d){if(!_0x41418d[0x0][_0x2619('0x17')]){return analyticExtractedReport(_0x2619('0x18'));}var _0x2c539a=[];var _0x3f5197=0x0;if(_0x25d666[_0x2619('0x11')]){if(_0x41418d&&_0x41418d[_0x2619('0x19')]){var _0x3ac551=_[_0x2619('0x1a')](_0x41418d[0x0][_0x2619('0x17')]/_0x4a5310);var _0x38dd3a=Number[_0x2619('0x1b')](_0x41418d[0x0][_0x2619('0x17')]/_0x4a5310)?_0x41418d[0x0][_0x2619('0x17')]%_0x4a5310:0x0;_0x3ac551[_0x2619('0x1c')](function(_0x3ff3f1){if(_0x3ff3f1>0x0){_0x3f5197+=_0x4a5310;}_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](util[_0x2619('0xd')](_0x2619('0x1d'),QUERY,_0x4a5310,_0x3f5197),{'type':dbH[_0x2619('0x13')]['QueryTypes']['SELECT']}));});if(_0x38dd3a>0x0){_0x3f5197+=_0x4a5310;_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](util[_0x2619('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x38dd3a,_0x3f5197),{'type':dbH[_0x2619('0x13')][_0x2619('0x16')][_0x2619('0x1e')]}));}}}else{_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](QUERY,{'type':dbH[_0x2619('0x13')]['QueryTypes']['SELECT']}));}var _0x5c6532=path[_0x2619('0x1f')](PATH);var _0x443947=path[_0x2619('0x20')](PATH,'.csv');var _0x4c84e7=_0x25d666[_0x2619('0x11')]&&_0x2c539a[_0x2619('0x19')]>0x1;var _0x795fee=[];if(!fs[_0x2619('0x21')](path['join'](_0x5c6532,_0x443947))&&_0x4c84e7){fs[_0x2619('0x22')](path[_0x2619('0x23')](_0x5c6532,_0x443947));}return BPromise[_0x2619('0x24')](_0x2c539a,function(_0x2b8e52){_0x795fee[_0x2619('0x25')](_0x2b8e52);})[_0x2619('0x26')](function(){for(var _0xead767=0x0;_0xead767<_0x795fee[_0x2619('0x19')];_0xead767+=0x1){var _0x4035e1;var _0xb51cd6=_0x795fee[_0xead767];if(_0x4c84e7){_0x4035e1=path['join'](_0x5c6532,_0x443947,util[_0x2619('0xd')]('%s%d.%s',_0x443947,_0xead767,_0x2619('0x27')));}else{_0x4035e1=path[_0x2619('0x23')](_0x5c6532,util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,_0x2619('0x27')));}fs[_0x2619('0x29')](_0x4035e1,csv(_0xb51cd6));}})[_0x2619('0x26')](function(){if(_0x4c84e7){return new Promise(function(_0x370e22){zipdir(path[_0x2619('0x23')](_0x5c6532,_0x443947),{'saveTo':path[_0x2619('0x23')](_0x5c6532,util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,'zip'))},function(_0x1e1c61,_0x16e148){rimraf(path['join'](_0x5c6532,_0x443947),function(){});_0x370e22(_0x2619('0x2a'));});});}})[_0x2619('0x26')](function(){logger[_0x2619('0xc')](util[_0x2619('0xd')](_0x2619('0x2b'),EXTRACTED_REPORT_ID,_0x2619('0xe')));return analyticExtractedReport('Completed',_0x4c84e7?util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,_0x4c84e7?'zip':'csv'):null);});})[_0x2619('0x2c')](function(_0x2126c8){logger[_0x2619('0xc')](util[_0x2619('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2619('0xe')),util[_0x2619('0x2d')](_0x2126c8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2619('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5fa9c51..54edf0e 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 _0xe7ef=['landscape','toString','\x20/\x20','footer','Arial','num','Setting','find','split','splitSizePdf','then','range','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','sequelize','SELECT','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','finally','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','path','lodash','util','moment','html-to-pdfmake','zip-dir','jsdom','JSDOM','window','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','pick','value','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before'];(function(_0x3a632b,_0x3606c5){var _0x1a13aa=function(_0x1dec50){while(--_0x1dec50){_0x3a632b['push'](_0x3a632b['shift']());}};_0x1a13aa(++_0x3606c5);}(_0xe7ef,0x130));var _0xfe7e=function(_0x9a7371,_0x18a664){_0x9a7371=_0x9a7371-0x0;var _0x1bcddb=_0xe7ef[_0x9a7371];return _0x1bcddb;};'use strict';var _=require(_0xfe7e('0x0'));var fs=require('fs');var util=require(_0xfe7e('0x1'));var path=require('path');var moment=require(_0xfe7e('0x2'));var htmlToPdfmake=require(_0xfe7e('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xfe7e('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0xfe7e('0x5'))[_0xfe7e('0x6')];var window=new JSDOM('')[_0xfe7e('0x7')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xfe7e('0x8'))(_0xfe7e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xfe7e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xfe7e('0xa')][0x4];var NAME=process[_0xfe7e('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x49007a,_0x42ea02){var _0x1143bd={'status':_0x49007a};var _0x7763e4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42ea02){_0x1143bd[_0xfe7e('0xb')]=_0x42ea02;}return db[_0xfe7e('0xc')][_0xfe7e('0xd')](_0x1143bd,_0x7763e4);}function getHeaders(_0xe4ff3c){return _[_0xfe7e('0xe')](_0xe4ff3c,function(_0x2aac3a){return{'text':_0x2aac3a,'style':'tableHeader'};});}function getRows(_0x49ea20,_0x1a28f7){return _[_0xfe7e('0xe')](_0x1a28f7,function(_0x43a6cc){return _(_0x43a6cc)[_0xfe7e('0xf')](_0x49ea20)[_0xfe7e('0xe')](function(_0x4b3509){return _0x4b3509?_['toString'](_0x4b3509):'';})[_0xfe7e('0x10')]();});}function createTable(_0x5deae6,_0x5ed38e){var _0x160f2d={'widths':_['fill'](Array(_0x5deae6[_0xfe7e('0x11')]),0x91),'heights':function(_0x23952b){return _0x23952b===0x0?_0xfe7e('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x482053=getHeaders(_0x5deae6);_0x160f2d[_0xfe7e('0x13')][_0xfe7e('0x14')](_0x482053);var _0x2a4e46=getRows(_0x5deae6,_0x5ed38e);_0x160f2d[_0xfe7e('0x13')]=_0x160f2d[_0xfe7e('0x13')][_0xfe7e('0x15')](_0x2a4e46);return _0x160f2d;}function createTables(_0x472450){var _0x478bee=[];var _0x58e323=_[_0xfe7e('0x16')](Object[_0xfe7e('0x17')](_0x472450[0x0]),0x5);_0x58e323[_0xfe7e('0x18')](function(_0x3c1fa2){_0x478bee[_0xfe7e('0x14')](createTable(_0x3c1fa2,_0x472450));});return _0x478bee;}function getPDFDocDefinition(_0x5da78b){var _0x4963d0=util[_0xfe7e('0x19')](_0xfe7e('0x1a'),NAME,EXTRACTED_REPORT[_0xfe7e('0x1b')],moment(EXTRACTED_REPORT[_0xfe7e('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xfe7e('0x1d')])[_0xfe7e('0x19')](FORMAT));var _0x24011f=[];for(var _0x1cf14d=0x0;_0x1cf14d<_0x5da78b[_0xfe7e('0x11')];_0x1cf14d++){var _0x57ea90=[];if(_0x1cf14d===0x0){_0x57ea90[_0xfe7e('0x14')]({'text':_0x4963d0,'style':_0xfe7e('0x1e')});}var _0x3bdda2={'table':_0x5da78b[_0x1cf14d]};if(_0x1cf14d>0x0){_0x3bdda2['pageBreak']=_0xfe7e('0x1f');_0x3bdda2['margin']=[0x0,0x46,0x0,0x0];}_0x57ea90[_0xfe7e('0x14')](_0x3bdda2);_0x24011f[_0xfe7e('0x14')](_0x57ea90);}return{'pageSize':'A4','pageOrientation':_0xfe7e('0x20'),'content':_0x24011f,'footer':function(_0x1c9a08,_0x19f272){return{'text':_0x1c9a08[_0xfe7e('0x21')]()+_0xfe7e('0x22')+_0x19f272,'style':_0xfe7e('0x23')};},'defaultStyle':{'font':_0xfe7e('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(_0x240fdc){var _0x814f4e=0x1388;var _0x5344de;if(!_0x240fdc[0x0][_0xfe7e('0x25')]){return analyticExtractedReport('Empty');}return db[_0xfe7e('0x26')][_0xfe7e('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfe7e('0x28'),_0xfe7e('0x29')]})[_0xfe7e('0x2a')](function(_0x41c7f8){if(_0x41c7f8){_0x5344de=_0x41c7f8;_0x814f4e=_0x5344de[_0xfe7e('0x29')]||0x3e8;}})['then'](function(){var _0x229db4=[];var _0x11eff1=0x0;if(_0x5344de[_0xfe7e('0x28')]){if(_0x240fdc&&_0x240fdc[_0xfe7e('0x11')]){var _0x46703c=_[_0xfe7e('0x2b')](_0x240fdc[0x0]['num']/_0x814f4e);var _0x3fc70b=Number['isInteger'](_0x240fdc[0x0][_0xfe7e('0x25')]/_0x814f4e)?_0x240fdc[0x0][_0xfe7e('0x25')]%_0x814f4e:0x0;_0x46703c['forEach'](function(_0x18a86d){if(_0x18a86d>0x0){_0x11eff1+=_0x814f4e;}_0x229db4[_0xfe7e('0x14')](dbH['sequelize']['query'](util[_0xfe7e('0x19')](_0xfe7e('0x2c'),QUERY,_0x814f4e,_0x11eff1),{'type':dbH['sequelize'][_0xfe7e('0x2d')]['SELECT']}));});if(_0x3fc70b>0x0){_0x11eff1+=_0x814f4e;_0x229db4[_0xfe7e('0x14')](dbH['sequelize'][_0xfe7e('0x2e')](util[_0xfe7e('0x19')](_0xfe7e('0x2c'),QUERY,_0x3fc70b,_0x11eff1),{'type':dbH[_0xfe7e('0x2f')][_0xfe7e('0x2d')][_0xfe7e('0x30')]}));}}}else{_0x229db4[_0xfe7e('0x14')](dbH[_0xfe7e('0x2f')]['query'](QUERY,{'type':dbH[_0xfe7e('0x2f')]['QueryTypes'][_0xfe7e('0x30')]}));}var _0x182e30=path[_0xfe7e('0x31')](PATH);var _0x598c4b=path['basename'](PATH,_0xfe7e('0x32'));var _0x22da59=_0x5344de[_0xfe7e('0x28')]&&_0x229db4[_0xfe7e('0x11')]>0x1;var _0x2fade6=[];if(!fs[_0xfe7e('0x33')](path[_0xfe7e('0x34')](_0x182e30,_0x598c4b))&&_0x22da59){fs[_0xfe7e('0x35')](path[_0xfe7e('0x34')](_0x182e30,_0x598c4b));}return BPromise[_0xfe7e('0x36')](_0x229db4,function(_0x441b02){_0x2fade6[_0xfe7e('0x14')](_0x441b02);})[_0xfe7e('0x2a')](function(){var _0x4e3264=[];for(var _0x5acc16=0x0;_0x5acc16<_0x2fade6[_0xfe7e('0x11')];_0x5acc16+=0x1){var _0x47e237=_0x2fade6[_0x5acc16];var _0x88af71=createTables(_[_0xfe7e('0x37')](_0x47e237));var _0x3db892;var _0x835a9e=getPDFDocDefinition(_0x88af71);var _0x7a4894=getPDFPrinter();var _0x2a850f=_0x7a4894[_0xfe7e('0x38')](_0x835a9e);if(_0x22da59){_0x3db892=path[_0xfe7e('0x34')](_0x182e30,_0x598c4b,util[_0xfe7e('0x19')](_0xfe7e('0x39'),_0x598c4b,_0x5acc16,_0xfe7e('0x3a')));}else{_0x3db892=path[_0xfe7e('0x34')](_0x182e30,util[_0xfe7e('0x19')](_0xfe7e('0x3b'),_0x598c4b,_0xfe7e('0x3a')));}_0x4e3264[_0xfe7e('0x14')](writePDFDocument(_0x2a850f,_0x3db892));}return Promise[_0xfe7e('0x3c')](_0x4e3264);})['then'](function(){if(_0x22da59){return new Promise(function(_0x19d31e){zipdir(path[_0xfe7e('0x34')](_0x182e30,_0x598c4b),{'saveTo':path[_0xfe7e('0x34')](_0x182e30,util[_0xfe7e('0x19')]('%s.%s',_0x598c4b,'zip'))},function(){rimraf(path[_0xfe7e('0x34')](_0x182e30,_0x598c4b),function(){});_0x19d31e('zip\x20finished');});});}})[_0xfe7e('0x2a')](function(){if(!_0x22da59)return;rimraf(path['join'](_0x182e30,_0x598c4b),function(){});})['then'](function(){logger[_0xfe7e('0x3d')](util['format'](_0xfe7e('0x3e'),EXTRACTED_REPORT_ID,_0xfe7e('0x3f')));return analyticExtractedReport('Completed',_0x22da59?util['format'](_0xfe7e('0x3b'),_0x598c4b,_0x22da59?_0xfe7e('0x40'):_0xfe7e('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfe7e('0x3d')](util[_0xfe7e('0x19')](_0xfe7e('0x41'),EXTRACTED_REPORT_ID,_0xfe7e('0x3f')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x456670){EXTRACTED_REPORT=_0x456670;return dbH[_0xfe7e('0x2f')]['query'](util[_0xfe7e('0x19')](_0xfe7e('0x42'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xfe7e('0x30')]});})['then'](extractReport)['catch'](function(_0xa731e){logger[_0xfe7e('0x3d')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xfe7e('0x3f')),util[_0xfe7e('0x43')](_0xa731e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfe7e('0x44'));})[_0xfe7e('0x45')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3b7ded=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xfe7e('0x46'),'bolditalics':__dirname+_0xfe7e('0x47')}});return _0x3b7ded;}function getPDFDocDefinitionFromHTML(_0x2e3874,_0x438f4a){var _0x2496bc=util[_0xfe7e('0x19')](_0xfe7e('0x48'),_0x438f4a[_0xfe7e('0x49')],_0x438f4a['interactionId']);var _0x430dd7=moment()['format'](_0xfe7e('0x4a'))[_0xfe7e('0x21')]();var _0x33f45f=htmlToPdfmake(_0x2e3874,{'window':window,'tableAutoSize':!![]});return{'content':[_0x33f45f],'defaultStyle':{'font':_0xfe7e('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xfe7e('0x4b'),'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':'center'}},'header':function(){return[{'text':_0xfe7e('0x4c'),'style':_0xfe7e('0x1e')}];},'footer':function(_0x5d86e8,_0x3e3f24){return[{'text':util['format'](_0xfe7e('0x4d'),_0x2496bc,_0x5d86e8,_0x3e3f24,_0x430dd7),'style':_0xfe7e('0x23')}];}};}function writePDFDocument(_0x3949cd,_0x4975e1){return new Promise(function(_0xb73a79,_0x397a82){var _0x16b400=_0x3949cd[_0xfe7e('0x4e')](fs[_0xfe7e('0x4f')](_0x4975e1));_0x16b400['on'](_0xfe7e('0x50'),function(){_0xb73a79(_0xfe7e('0x50'));});_0x16b400['on'](_0xfe7e('0x51'),function(_0x50aec2){_0x397a82(_0x50aec2);});_0x3949cd[_0xfe7e('0x52')]();});}exports['createPdfFromHTML']=function(_0x25f3f9,_0x2d60b4){var _0x1ee07b=getPDFPrinter();var _0x513c65=getPDFDocDefinitionFromHTML(_0x25f3f9,_0x2d60b4);var _0x566f4f=_0x1ee07b[_0xfe7e('0x38')](_0x513c65);return writePDFDocument(_0x566f4f,_0x2d60b4[_0xfe7e('0x53')])['catch'](function(_0x4f51f1){throw _0x4f51f1;});}; \ No newline at end of file +var _0x17af=['header','before','margin','landscape','toString','\x20/\x20','Arial','black','right','Empty','Setting','find','splitSizePdf','then','split','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','value','fill','length','auto','body','push','concat','chunk','keys','forEach','name','startDate','format','endDate'];(function(_0x11859d,_0x1c9f0e){var _0x6c172e=function(_0x5cc2c5){while(--_0x5cc2c5){_0x11859d['push'](_0x11859d['shift']());}};_0x6c172e(++_0x1c9f0e);}(_0x17af,0x19c));var _0xf17a=function(_0x5e291d,_0x335924){_0x5e291d=_0x5e291d-0x0;var _0x7597ec=_0x17af[_0x5e291d];return _0x7597ec;};'use strict';var _=require(_0xf17a('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xf17a('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xf17a('0x2'));var PdfPrinter=require(_0xf17a('0x3'));var zipdir=require(_0xf17a('0x4'));var rimraf=require(_0xf17a('0x5'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xf17a('0x6'))['db'];var dbH=require(_0xf17a('0x6'))[_0xf17a('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf17a('0x8')][0x3];var PATH=process[_0xf17a('0x8')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf17a('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c4d79,_0x2cf639){var _0x1cf81d={'status':_0x2c4d79};var _0x4f453b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2cf639){_0x1cf81d[_0xf17a('0xa')]=_0x2cf639;}return db[_0xf17a('0xb')]['update'](_0x1cf81d,_0x4f453b);}function getHeaders(_0x126c30){return _[_0xf17a('0xc')](_0x126c30,function(_0x5d8569){return{'text':_0x5d8569,'style':_0xf17a('0xd')};});}function getRows(_0x397f00,_0x1d6838){return _[_0xf17a('0xc')](_0x1d6838,function(_0xa15e9f){return _(_0xa15e9f)['pick'](_0x397f00)[_0xf17a('0xc')](function(_0xf142e){return _0xf142e?_['toString'](_0xf142e):'';})[_0xf17a('0xe')]();});}function createTable(_0x21f77d,_0xfc1098){var _0xa58875={'widths':_[_0xf17a('0xf')](Array(_0x21f77d[_0xf17a('0x10')]),0x91),'heights':function(_0x5440e9){return _0x5440e9===0x0?_0xf17a('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc2c65d=getHeaders(_0x21f77d);_0xa58875[_0xf17a('0x12')][_0xf17a('0x13')](_0xc2c65d);var _0x28d6a1=getRows(_0x21f77d,_0xfc1098);_0xa58875[_0xf17a('0x12')]=_0xa58875[_0xf17a('0x12')][_0xf17a('0x14')](_0x28d6a1);return _0xa58875;}function createTables(_0x1a50a0){var _0x1a247b=[];var _0x2b6198=_[_0xf17a('0x15')](Object[_0xf17a('0x16')](_0x1a50a0[0x0]),0x5);_0x2b6198[_0xf17a('0x17')](function(_0x256407){_0x1a247b[_0xf17a('0x13')](createTable(_0x256407,_0x1a50a0));});return _0x1a247b;}function getPDFDocDefinition(_0x4c5c98){var _0x53bbb4=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xf17a('0x18')],moment(EXTRACTED_REPORT[_0xf17a('0x19')])[_0xf17a('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xf17a('0x1b')])['format'](FORMAT));var _0x3d211c=[];for(var _0x391933=0x0;_0x391933<_0x4c5c98[_0xf17a('0x10')];_0x391933++){var _0x3ac923=[];if(_0x391933===0x0){_0x3ac923['push']({'text':_0x53bbb4,'style':_0xf17a('0x1c')});}var _0x2081f6={'table':_0x4c5c98[_0x391933]};if(_0x391933>0x0){_0x2081f6['pageBreak']=_0xf17a('0x1d');_0x2081f6[_0xf17a('0x1e')]=[0x0,0x46,0x0,0x0];}_0x3ac923[_0xf17a('0x13')](_0x2081f6);_0x3d211c['push'](_0x3ac923);}return{'pageSize':'A4','pageOrientation':_0xf17a('0x1f'),'content':_0x3d211c,'footer':function(_0x1f6a26,_0x5cd8b4){return{'text':_0x1f6a26[_0xf17a('0x20')]()+_0xf17a('0x21')+_0x5cd8b4,'style':'footer'};},'defaultStyle':{'font':_0xf17a('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf17a('0x23')},'footer':{'alignment':_0xf17a('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4bf6e6){var _0x39acdc=0x1388;var _0xd12e42;if(!_0x4bf6e6[0x0]['num']){return analyticExtractedReport(_0xf17a('0x25'));}return db[_0xf17a('0x26')][_0xf17a('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf17a('0x28')]})['then'](function(_0x251416){if(_0x251416){_0xd12e42=_0x251416;_0x39acdc=_0xd12e42[_0xf17a('0x28')]||0x3e8;}})[_0xf17a('0x29')](function(){var _0x40783a=[];var _0x140528=0x0;if(_0xd12e42[_0xf17a('0x2a')]){if(_0x4bf6e6&&_0x4bf6e6[_0xf17a('0x10')]){var _0x5385c7=_['range'](_0x4bf6e6[0x0][_0xf17a('0x2b')]/_0x39acdc);var _0x7df846=Number[_0xf17a('0x2c')](_0x4bf6e6[0x0]['num']/_0x39acdc)?_0x4bf6e6[0x0]['num']%_0x39acdc:0x0;_0x5385c7[_0xf17a('0x17')](function(_0x3fd6e1){if(_0x3fd6e1>0x0){_0x140528+=_0x39acdc;}_0x40783a[_0xf17a('0x13')](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x2f'),QUERY,_0x39acdc,_0x140528),{'type':dbH[_0xf17a('0x2d')]['QueryTypes'][_0xf17a('0x30')]}));});if(_0x7df846>0x0){_0x140528+=_0x39acdc;_0x40783a[_0xf17a('0x13')](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x2f'),QUERY,_0x7df846,_0x140528),{'type':dbH['sequelize'][_0xf17a('0x31')]['SELECT']}));}}}else{_0x40783a['push'](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](QUERY,{'type':dbH[_0xf17a('0x2d')]['QueryTypes'][_0xf17a('0x30')]}));}var _0x5a15cc=path[_0xf17a('0x32')](PATH);var _0x13b712=path[_0xf17a('0x33')](PATH,'.pdf');var _0xcd9089=_0xd12e42[_0xf17a('0x2a')]&&_0x40783a[_0xf17a('0x10')]>0x1;var _0x254c98=[];if(!fs[_0xf17a('0x34')](path['join'](_0x5a15cc,_0x13b712))&&_0xcd9089){fs[_0xf17a('0x35')](path[_0xf17a('0x36')](_0x5a15cc,_0x13b712));}return BPromise[_0xf17a('0x37')](_0x40783a,function(_0x5b47e3){_0x254c98[_0xf17a('0x13')](_0x5b47e3);})[_0xf17a('0x29')](function(){var _0x404358=[];for(var _0x30bd57=0x0;_0x30bd57<_0x254c98[_0xf17a('0x10')];_0x30bd57+=0x1){var _0x5e91ac=_0x254c98[_0x30bd57];var _0x5b63d0=createTables(_[_0xf17a('0x38')](_0x5e91ac));var _0x589d2e;var _0x147f40=getPDFDocDefinition(_0x5b63d0);var _0x4ea364=getPDFPrinter();var _0x565a05=_0x4ea364['createPdfKitDocument'](_0x147f40);if(_0xcd9089){_0x589d2e=path[_0xf17a('0x36')](_0x5a15cc,_0x13b712,util[_0xf17a('0x1a')](_0xf17a('0x39'),_0x13b712,_0x30bd57,_0xf17a('0x3a')));}else{_0x589d2e=path['join'](_0x5a15cc,util['format'](_0xf17a('0x3b'),_0x13b712,'pdf'));}_0x404358[_0xf17a('0x13')](writePDFDocument(_0x565a05,_0x589d2e));}return Promise[_0xf17a('0x3c')](_0x404358);})[_0xf17a('0x29')](function(){if(_0xcd9089){return new Promise(function(_0x4be178){zipdir(path[_0xf17a('0x36')](_0x5a15cc,_0x13b712),{'saveTo':path['join'](_0x5a15cc,util[_0xf17a('0x1a')](_0xf17a('0x3b'),_0x13b712,'zip'))},function(){rimraf(path['join'](_0x5a15cc,_0x13b712),function(){});_0x4be178(_0xf17a('0x3d'));});});}})[_0xf17a('0x29')](function(){if(!_0xcd9089)return;rimraf(path[_0xf17a('0x36')](_0x5a15cc,_0x13b712),function(){});})[_0xf17a('0x29')](function(){logger[_0xf17a('0x3e')](util[_0xf17a('0x1a')](_0xf17a('0x3f'),EXTRACTED_REPORT_ID,_0xf17a('0x40')));return analyticExtractedReport(_0xf17a('0x41'),_0xcd9089?util[_0xf17a('0x1a')](_0xf17a('0x3b'),_0x13b712,_0xcd9089?_0xf17a('0x42'):_0xf17a('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf17a('0x3e')](util['format'](_0xf17a('0x43'),EXTRACTED_REPORT_ID,_0xf17a('0x40')));return db[_0xf17a('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf17a('0x29')](function(_0x5f08fb){EXTRACTED_REPORT=_0x5f08fb;return dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x44'),QUERY),{'type':dbH[_0xf17a('0x2d')][_0xf17a('0x31')]['SELECT']});})[_0xf17a('0x29')](extractReport)[_0xf17a('0x45')](function(_0x2a3e56){logger[_0xf17a('0x3e')](util['format'](_0xf17a('0x46'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x2a3e56,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf17a('0x47')](function(){process[_0xf17a('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x549c9d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xf17a('0x49'),'italics':__dirname+_0xf17a('0x4a'),'bolditalics':__dirname+_0xf17a('0x4b')}});return _0x549c9d;}function getPDFDocDefinitionFromHTML(_0x123b45,_0x1b6e93){var _0x3bd492=util[_0xf17a('0x1a')](_0xf17a('0x4c'),_0x1b6e93[_0xf17a('0x4d')],_0x1b6e93[_0xf17a('0x4e')]);var _0xdab6f7=moment()[_0xf17a('0x1a')](_0xf17a('0x4f'))[_0xf17a('0x20')]();var _0x1c9d21=htmlToPdfmake(_0x123b45,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c9d21],'defaultStyle':{'font':_0xf17a('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf17a('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf17a('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf17a('0x50')}},'header':function(){return[{'text':_0xf17a('0x51'),'style':_0xf17a('0x1c')}];},'footer':function(_0x2112ee,_0x3abd06){return[{'text':util[_0xf17a('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3bd492,_0x2112ee,_0x3abd06,_0xdab6f7),'style':_0xf17a('0x52')}];}};}function writePDFDocument(_0x1877ef,_0x6fb7f4){return new Promise(function(_0x4540f9,_0x252a9c){var _0x2df2ba=_0x1877ef[_0xf17a('0x53')](fs['createWriteStream'](_0x6fb7f4));_0x2df2ba['on'](_0xf17a('0x54'),function(){_0x4540f9(_0xf17a('0x54'));});_0x2df2ba['on'](_0xf17a('0x55'),function(_0xbcbcc7){_0x252a9c(_0xbcbcc7);});_0x1877ef[_0xf17a('0x56')]();});}exports[_0xf17a('0x57')]=function(_0x53e213,_0x273e02){var _0x2ca177=getPDFPrinter();var _0x9c996c=getPDFDocDefinitionFromHTML(_0x53e213,_0x273e02);var _0x52e67c=_0x2ca177['createPdfKitDocument'](_0x9c996c);return writePDFDocument(_0x52e67c,_0x273e02['path'])[_0xf17a('0x45')](function(_0x11881b){throw _0x11881b;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index fc27d7e..fddb463 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 _0xec21=['each','xlsx','%s.%s','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','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','QueryTypes','SELECT','range','num','isInteger','forEach','query','push','dirname','basename','.xlsx','length','existsSync','join','mkdirSync'];(function(_0x324811,_0x24f644){var _0x237e85=function(_0x53c171){while(--_0x53c171){_0x324811['push'](_0x324811['shift']());}};_0x237e85(++_0x24f644);}(_0xec21,0x1d9));var _0x1ec2=function(_0x89f772,_0x45088a){_0x89f772=_0x89f772-0x0;var _0x4857a3=_0xec21[_0x89f772];return _0x4857a3;};'use strict';var util=require(_0x1ec2('0x0'));var path=require(_0x1ec2('0x1'));var _=require(_0x1ec2('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x1ec2('0x3'));var zipdir=require(_0x1ec2('0x4'));var rimraf=require(_0x1ec2('0x5'));var db=require(_0x1ec2('0x6'))['db'];var dbH=require('../../mysqldb')[_0x1ec2('0x7')];var logger=require(_0x1ec2('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x1ec2('0x9')][0x2]);var QUERY=process[_0x1ec2('0x9')][0x3];var PATH=process[_0x1ec2('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3fea3a,_0x459c30){var _0x55115a={'status':_0x3fea3a};var _0x419300={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x459c30){_0x55115a[_0x1ec2('0xa')]=_0x459c30;}return db[_0x1ec2('0xb')]['update'](_0x55115a,_0x419300);}function main(){var _0x41e276=0x1388;var _0x411d2c;logger[_0x1ec2('0xc')](util[_0x1ec2('0xd')](_0x1ec2('0xe'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')));return db[_0x1ec2('0x10')][_0x1ec2('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1ec2('0x12'),_0x1ec2('0x13')]})[_0x1ec2('0x14')](function(_0x65a0a9){if(_0x65a0a9){_0x411d2c=_0x65a0a9;_0x41e276=_0x411d2c[_0x1ec2('0x13')]||0x1388;}})['then'](function(){return dbH[_0x1ec2('0x15')]['query'](util[_0x1ec2('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1ec2('0x15')][_0x1ec2('0x16')][_0x1ec2('0x17')]});})[_0x1ec2('0x14')](function(_0x34a9b9){if(!_0x34a9b9[0x0]['num']){return analyticExtractedReport('Empty');}var _0xd5666b=[];var _0x1892a1=0x0;if(_0x411d2c['split']){if(_0x34a9b9&&_0x34a9b9['length']){var _0x3d7cb3=_[_0x1ec2('0x18')](_0x34a9b9[0x0][_0x1ec2('0x19')]/_0x41e276);var _0x2859b3=Number[_0x1ec2('0x1a')](_0x34a9b9[0x0][_0x1ec2('0x19')]/_0x41e276)?_0x34a9b9[0x0][_0x1ec2('0x19')]%_0x41e276:0x0;_0x3d7cb3[_0x1ec2('0x1b')](function(_0x2f4673){if(_0x2f4673>0x0){_0x1892a1+=_0x41e276;}_0xd5666b['push'](dbH[_0x1ec2('0x15')][_0x1ec2('0x1c')](util[_0x1ec2('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x41e276,_0x1892a1),{'type':dbH[_0x1ec2('0x15')]['QueryTypes'][_0x1ec2('0x17')]}));});if(_0x2859b3>0x0){_0x1892a1+=_0x41e276;_0xd5666b[_0x1ec2('0x1d')](dbH['sequelize'][_0x1ec2('0x1c')](util[_0x1ec2('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2859b3,_0x1892a1),{'type':dbH['sequelize'][_0x1ec2('0x16')][_0x1ec2('0x17')]}));}}}else{_0xd5666b[_0x1ec2('0x1d')](dbH[_0x1ec2('0x15')][_0x1ec2('0x1c')](QUERY,{'type':dbH[_0x1ec2('0x15')]['QueryTypes']['SELECT']}));}var _0x33c0d3=path[_0x1ec2('0x1e')](PATH);var _0x1ff956=path[_0x1ec2('0x1f')](PATH,_0x1ec2('0x20'));var _0x3e5e55=_0x411d2c[_0x1ec2('0x12')]&&_0xd5666b[_0x1ec2('0x21')]>0x1;var _0x14b6c2=[];if(!fs[_0x1ec2('0x22')](path[_0x1ec2('0x23')](_0x33c0d3,_0x1ff956))&&_0x3e5e55){fs[_0x1ec2('0x24')](path['join'](_0x33c0d3,_0x1ff956));}return BPromise[_0x1ec2('0x25')](_0xd5666b,function(_0x1ff8f8){_0x14b6c2[_0x1ec2('0x1d')](_0x1ff8f8);})[_0x1ec2('0x14')](function(){for(var _0x4c2536=0x0;_0x4c2536<_0x14b6c2[_0x1ec2('0x21')];_0x4c2536+=0x1){var _0x51b0bb;var _0x3974e9=_0x14b6c2[_0x4c2536];if(_0x3e5e55){_0x51b0bb=path[_0x1ec2('0x23')](_0x33c0d3,_0x1ff956,util['format']('%s%d.%s',_0x1ff956,_0x4c2536,_0x1ec2('0x26')));}else{_0x51b0bb=path[_0x1ec2('0x23')](_0x33c0d3,util[_0x1ec2('0xd')](_0x1ec2('0x27'),_0x1ff956,'xlsx'));}fs['writeFileSync'](_0x51b0bb,json2xls(_0x3974e9),_0x1ec2('0x28'));}})[_0x1ec2('0x14')](function(){if(_0x3e5e55){return new Promise(function(_0x373bc9){zipdir(path[_0x1ec2('0x23')](_0x33c0d3,_0x1ff956),{'saveTo':path[_0x1ec2('0x23')](_0x33c0d3,util[_0x1ec2('0xd')](_0x1ec2('0x27'),_0x1ff956,_0x1ec2('0x29')))},function(_0x163151,_0xf398ce){rimraf(path[_0x1ec2('0x23')](_0x33c0d3,_0x1ff956),function(){});_0x373bc9(_0x1ec2('0x2a'));});});}})[_0x1ec2('0x14')](function(){logger[_0x1ec2('0xc')](util[_0x1ec2('0xd')](_0x1ec2('0x2b'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')));return analyticExtractedReport(_0x1ec2('0x2c'),_0x3e5e55?util[_0x1ec2('0xd')](_0x1ec2('0x27'),_0x1ff956,_0x3e5e55?_0x1ec2('0x29'):_0x1ec2('0x26')):null);});})[_0x1ec2('0x2d')](function(_0x3803fa){logger['info'](util[_0x1ec2('0xd')](_0x1ec2('0x2e'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')),util[_0x1ec2('0x2f')](_0x3803fa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1ec2('0x30'));})[_0x1ec2('0x31')](function(){process[_0x1ec2('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x336d=['existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx'];(function(_0x4df7de,_0x5da937){var _0x9c5e47=function(_0x2b66db){while(--_0x2b66db){_0x4df7de['push'](_0x4df7de['shift']());}};_0x9c5e47(++_0x5da937);}(_0x336d,0xae));var _0xd336=function(_0x22bd21,_0x1b17ac){_0x22bd21=_0x22bd21-0x0;var _0x279cd0=_0x336d[_0x22bd21];return _0x279cd0;};'use strict';var util=require('util');var path=require(_0xd336('0x0'));var _=require(_0xd336('0x1'));var fs=require('fs');var json2xls=require(_0xd336('0x2'));var BPromise=require(_0xd336('0x3'));var zipdir=require(_0xd336('0x4'));var rimraf=require(_0xd336('0x5'));var db=require(_0xd336('0x6'))['db'];var dbH=require(_0xd336('0x6'))[_0xd336('0x7')];var logger=require(_0xd336('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd336('0x9')][0x3];var PATH=process[_0xd336('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3cf826,_0x5debef){var _0x419f42={'status':_0x3cf826};var _0x223e93={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5debef){_0x419f42[_0xd336('0xa')]=_0x5debef;}return db[_0xd336('0xb')][_0xd336('0xc')](_0x419f42,_0x223e93);}function main(){var _0x294d96=0x1388;var _0x177f64;logger[_0xd336('0xd')](util[_0xd336('0xe')](_0xd336('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xd336('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd336('0x11'),_0xd336('0x12')]})[_0xd336('0x13')](function(_0x29aa4a){if(_0x29aa4a){_0x177f64=_0x29aa4a;_0x294d96=_0x177f64[_0xd336('0x12')]||0x1388;}})[_0xd336('0x13')](function(){return dbH[_0xd336('0x14')][_0xd336('0x15')](util[_0xd336('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd336('0x14')]['QueryTypes'][_0xd336('0x16')]});})[_0xd336('0x13')](function(_0x1b3cd8){if(!_0x1b3cd8[0x0][_0xd336('0x17')]){return analyticExtractedReport(_0xd336('0x18'));}var _0x96cab8=[];var _0x22e5a5=0x0;if(_0x177f64[_0xd336('0x11')]){if(_0x1b3cd8&&_0x1b3cd8[_0xd336('0x19')]){var _0x3a6e60=_[_0xd336('0x1a')](_0x1b3cd8[0x0][_0xd336('0x17')]/_0x294d96);var _0x3dfc7b=Number[_0xd336('0x1b')](_0x1b3cd8[0x0][_0xd336('0x17')]/_0x294d96)?_0x1b3cd8[0x0][_0xd336('0x17')]%_0x294d96:0x0;_0x3a6e60[_0xd336('0x1c')](function(_0x4a4945){if(_0x4a4945>0x0){_0x22e5a5+=_0x294d96;}_0x96cab8[_0xd336('0x1d')](dbH[_0xd336('0x14')][_0xd336('0x15')](util['format'](_0xd336('0x1e'),QUERY,_0x294d96,_0x22e5a5),{'type':dbH[_0xd336('0x14')]['QueryTypes'][_0xd336('0x16')]}));});if(_0x3dfc7b>0x0){_0x22e5a5+=_0x294d96;_0x96cab8[_0xd336('0x1d')](dbH['sequelize'][_0xd336('0x15')](util['format'](_0xd336('0x1e'),QUERY,_0x3dfc7b,_0x22e5a5),{'type':dbH[_0xd336('0x14')][_0xd336('0x1f')][_0xd336('0x16')]}));}}}else{_0x96cab8[_0xd336('0x1d')](dbH[_0xd336('0x14')]['query'](QUERY,{'type':dbH[_0xd336('0x14')][_0xd336('0x1f')][_0xd336('0x16')]}));}var _0xfa45e8=path[_0xd336('0x20')](PATH);var _0x2f16dd=path['basename'](PATH,_0xd336('0x21'));var _0x297fee=_0x177f64['split']&&_0x96cab8['length']>0x1;var _0x38ebd9=[];if(!fs[_0xd336('0x22')](path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd))&&_0x297fee){fs[_0xd336('0x24')](path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd));}return BPromise[_0xd336('0x25')](_0x96cab8,function(_0x2c11d6){_0x38ebd9[_0xd336('0x1d')](_0x2c11d6);})[_0xd336('0x13')](function(){for(var _0x449314=0x0;_0x449314<_0x38ebd9['length'];_0x449314+=0x1){var _0x4f183a;var _0x3fa6e6=_0x38ebd9[_0x449314];if(_0x297fee){_0x4f183a=path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd,util['format'](_0xd336('0x26'),_0x2f16dd,_0x449314,_0xd336('0x27')));}else{_0x4f183a=path['join'](_0xfa45e8,util[_0xd336('0xe')](_0xd336('0x28'),_0x2f16dd,_0xd336('0x27')));}fs[_0xd336('0x29')](_0x4f183a,json2xls(_0x3fa6e6),_0xd336('0x2a'));}})[_0xd336('0x13')](function(){if(_0x297fee){return new Promise(function(_0x18e96d){zipdir(path['join'](_0xfa45e8,_0x2f16dd),{'saveTo':path[_0xd336('0x23')](_0xfa45e8,util['format'](_0xd336('0x28'),_0x2f16dd,_0xd336('0x2b')))},function(_0x22a29d,_0x41550c){rimraf(path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd),function(){});_0x18e96d(_0xd336('0x2c'));});});}})[_0xd336('0x13')](function(){logger[_0xd336('0xd')](util[_0xd336('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd336('0x2d')));return analyticExtractedReport(_0xd336('0x2e'),_0x297fee?util[_0xd336('0xe')](_0xd336('0x28'),_0x2f16dd,_0x297fee?_0xd336('0x2b'):_0xd336('0x27')):null);});})['catch'](function(_0x205230){logger[_0xd336('0xd')](util['format'](_0xd336('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xd336('0x30')](_0x205230,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd336('0x31'));})[_0xd336('0x32')](function(){process[_0xd336('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 143229d..5819b45 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 _0xc483=['CDR(routeid)=','context','outbound','extension','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','updatedAt','interval','*,*,*,*','intervals','IntervalId','tag','CDR(tag)=','length','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','app','toLowerCase','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','VoiceExtension','then','uniq','map','filter','groupBy','exten','queue','playback','priority','extensions','find','type','Set','format','CDR(type)=%s','VoiceExtensionId','push'];(function(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_0xc483,0xbe));var _0x3c48=function(_0x212a88,_0x9f8de9){_0x212a88=_0x212a88-0x0;var _0x48e43d=_0xc483[_0x212a88];return _0x48e43d;};'use strict';var _=require(_0x3c48('0x0'));var util=require(_0x3c48('0x1'));function rewrite(_0x48ddab,_0x1ca472){var _0x3285b0=this;return _0x48ddab[_0x3c48('0x2')][_0x3c48('0x3')][_0x3c48('0x4')]({'raw':!![]})['then'](function(_0x371328){_0x3285b0['intervals']=_0x371328;return _0x48ddab[_0x3c48('0x2')][_0x3c48('0x5')][_0x3c48('0x4')]({'where':{'IntervalId':_0x1ca472['IntervalId']},'raw':!![]});})[_0x3c48('0x6')](function(_0x2a1765){return _0x48ddab[_0x3c48('0x2')][_0x3c48('0x5')][_0x3c48('0x4')]({'where':{'exten':{'$in':_[_0x3c48('0x7')](_[_0x3c48('0x8')](_0x2a1765,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3c48('0x6')](function(_0x3e2886){var _0x437611=_[_0x3c48('0x9')](_0x3e2886,{'priority':'1'});var _0x366abd=_['filter'](_0x3e2886,{'isApp':0x1});var _0x449d1c=_[_0x3c48('0xa')](_0x366abd,_0x3c48('0xb'));var _0x409e2f=[_0x3c48('0xc'),_0x3c48('0xd')];var _0x5535fe=[];var _0x1d82d7=[];for(var _0x592f1d in _0x449d1c){if(_0x449d1c['hasOwnProperty'](_0x592f1d)){_0x3285b0[_0x3c48('0xe')]=0x2;_0x3285b0[_0x3c48('0xf')]=[];_0x3285b0['extension']=_[_0x3c48('0x10')](_0x437611,{'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')]});_0x3285b0[_0x3c48('0xf')]['push']({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':util[_0x3c48('0x13')](_0x3c48('0x14'),_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')]),'context':_0x449d1c[_0x592f1d][0x0]['context'],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});if(_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')]==='inbound'){_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x17')+_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')],'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0]['exten'],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});}else if(_0x449d1c[_0x592f1d][0x0]['type']===_0x3c48('0x19')){if(_0x3285b0[_0x3c48('0x1a')]){_0x3285b0['extensions'][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':_0x3c48('0x12'),'appdata':'CDR(destination)='+(_0x3285b0[_0x3c48('0x1a')]['cutdigits']?_0x3c48('0x1b')+_0x3285b0[_0x3c48('0x1a')][_0x3c48('0x1c')]+'}':_0x3c48('0x1d')),'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});}_0x3285b0['extensions'][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x17')+_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')],'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0]['exten'],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']});var _0x4060f1=_0x3285b0['priority']++;_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':'ExecIf','appdata':_0x3c48('0x1e')+(_0x4060f1+0x2)+'):Goto('+(_0x4060f1+0x1)+')','context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x4060f1,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});if(_0x3285b0[_0x3c48('0x1a')]){_0x3285b0['extensions'][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':_0x3c48('0x12'),'appdata':_0x3285b0[_0x3c48('0x1a')][_0x3c48('0x1c')]?_0x3c48('0x1f')+_0x3285b0[_0x3c48('0x1a')]['cutdigits']+'}':_0x3c48('0x20'),'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0]['exten'],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});}_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':'outboundrouteid='+_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')],'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']});if(_0x3285b0[_0x3c48('0x1a')]&&_0x3285b0['extension'][_0x3c48('0x21')](_0x3c48('0x22'))&&_0x3285b0[_0x3c48('0x1a')][_0x3c48('0x22')]!==_0x3c48('0x23')){_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':_0x3c48('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0]['exten'],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});_0x3285b0['extensions'][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x24')+_0x3285b0[_0x3c48('0x1a')]['recordingFormat']||_0x3c48('0x25'),'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']});}}_0x3285b0['extensions'][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x26'),'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0]['type'],'app':'Set','appdata':_0x3c48('0x27'),'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});_0x3285b0[_0x3c48('0xf')]['push']({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'exten':_0x449d1c[_0x592f1d][0x0][_0x3c48('0xb')],'priority':_0x3285b0[_0x3c48('0xe')]++,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']});for(var _0xfdd2d6=0x0,_0x32c649=0x0;_0xfdd2d6<_0x449d1c[_0x592f1d]['length'];_0xfdd2d6+=0x1,_0x32c649=0x0){var _0x17e910=_0x449d1c[_0x592f1d][_0xfdd2d6];if(_0x17e910[_0x3c48('0x11')]){_0x17e910['type']=_0x17e910[_0x3c48('0x11')]['toLowerCase']();}var _0x29e3b8=[];var _0xfee3d6=[];delete _0x17e910['id'];delete _0x17e910[_0x3c48('0x28')];delete _0x17e910[_0x3c48('0x29')];var _0x1900b3=_0x17e910[_0x3c48('0x2a')]!==_0x3c48('0x2b')?[_0x17e910[_0x3c48('0x2a')]]:_0x17e910['IntervalId']?_[_0x3c48('0x8')](_['filter'](_0x3285b0[_0x3c48('0x2c')],{'IntervalId':_0x17e910[_0x3c48('0x2d')]}),_0x3c48('0x2a')):[];if(_0x17e910[_0x3c48('0x21')](_0x3c48('0x2e'))){if(_0x17e910['tag']&&_0x17e910['tag']!=='--'){_0x29e3b8['push']({'type':_0x17e910[_0x3c48('0x11')],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x2f')+_0x17e910['tag'],'context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3[_0x3c48('0x30')]+_0x3285b0['priority']+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});}}if(_0x17e910['type']===_0x3c48('0x19')&&_0x17e910['hasOwnProperty'](_0x3c48('0x31'))){if(_0x17e910[_0x3c48('0x31')]){_0x29e3b8[_0x3c48('0x16')]({'type':_0x17e910['type'],'app':_0x3c48('0x32'),'appdata':_0x3c48('0x33')+_0x17e910[_0x3c48('0x31')]+')','context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3['length']+_0x3285b0[_0x3c48('0xe')]+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});}else{_0x29e3b8[_0x3c48('0x16')]({'type':_0x17e910[_0x3c48('0x11')],'app':'ExecIf','appdata':_0x3c48('0x34'),'context':_0x17e910['context'],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3[_0x3c48('0x30')]+_0x3285b0[_0x3c48('0xe')]+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});}}if(_0x17e910[_0x3c48('0x21')](_0x3c48('0x35'))){if(_0x409e2f['indexOf'](_0x17e910[_0x3c48('0x36')][_0x3c48('0x37')]())>=0x0&&_0x17e910['appType']!=='custom'){if(_0x17e910[_0x3c48('0x35')]){_0x29e3b8[_0x3c48('0x16')]({'type':_0x17e910[_0x3c48('0x11')],'app':_0x3c48('0x32'),'appdata':_0x3c48('0x38'),'context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910['exten'],'priority':_0x1900b3[_0x3c48('0x30')]+_0x3285b0[_0x3c48('0xe')]+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});_0x29e3b8['push']({'type':_0x17e910['type'],'app':_0x3c48('0x12'),'appdata':_0x3c48('0x39'),'context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3[_0x3c48('0x30')]+_0x3285b0[_0x3c48('0xe')]+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});}else{_0x29e3b8[_0x3c48('0x16')]({'type':_0x17e910['type'],'app':'ExecIf','appdata':_0x3c48('0x3a'),'context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3['length']+_0x3285b0['priority']+_0x32c649++,'VoiceExtensionId':_0x17e910['VoiceExtensionId']});_0x29e3b8[_0x3c48('0x16')]({'type':_0x17e910['type'],'app':_0x3c48('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x17e910[_0x3c48('0x18')],'exten':_0x17e910[_0x3c48('0xb')],'priority':_0x1900b3[_0x3c48('0x30')]+_0x3285b0[_0x3c48('0xe')]+_0x32c649++,'VoiceExtensionId':_0x17e910[_0x3c48('0x15')]});}}}for(var _0x2253a2=0x0;_0x2253a2<_0x1900b3[_0x3c48('0x30')];_0x2253a2+=0x1){var _0x44e0e7=_0x3285b0[_0x3c48('0xe')]+_0x1900b3[_0x3c48('0x30')];var _0x1df43b=_0x2253a2===_0x1900b3['length']-0x1?_0x3285b0[_0x3c48('0xe')]+_0x29e3b8[_0x3c48('0x30')]+_0xfee3d6[_0x3c48('0x30')]+0x2:_0x3285b0['priority']+_0x2253a2+0x1;_0x29e3b8[_0x3c48('0x3b')](_0x2253a2,0x0,{'type':_0x17e910[_0x3c48('0x11')],'app':'GotoIfTime','appdata':_0x1900b3[_0x2253a2]+'?'+_0x17e910[_0x3c48('0x18')]+_0x3c48('0x3c')+_0x44e0e7+':'+_0x17e910[_0x3c48('0x18')]+_0x3c48('0x3c')+_0x1df43b,'exten':_0x17e910[_0x3c48('0xb')],'context':_0x17e910[_0x3c48('0x18')],'priority':_0x3285b0[_0x3c48('0xe')]+_0x2253a2,'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']});}_0x17e910[_0x3c48('0xe')]=_0x29e3b8[_0x3c48('0x30')]?_[_0x3c48('0x3d')](_0x29e3b8)[_0x3c48('0xe')]+0x1:_0x3285b0[_0x3c48('0xe')];_0x3285b0['priority']=(_0xfee3d6[_0x3c48('0x30')]?_[_0x3c48('0x3d')](_0xfee3d6)[_0x3c48('0xe')]:_0x17e910[_0x3c48('0xe')])+0x1;_0x3285b0[_0x3c48('0xf')]=_['concat'](_0x3285b0[_0x3c48('0xf')],_0x29e3b8,[_0x17e910],_0xfee3d6);}_0x3285b0[_0x3c48('0xf')][_0x3c48('0x16')]({'type':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x11')],'app':_0x3c48('0x3e'),'exten':_0x449d1c[_0x592f1d][0x0]['exten'],'context':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x18')],'priority':_0x3285b0['priority'],'VoiceExtensionId':_0x449d1c[_0x592f1d][0x0][_0x3c48('0x15')]});_0x5535fe[_0x3c48('0x16')](_0x449d1c[_0x592f1d][0x0]['VoiceExtensionId']);_0x1d82d7=_[_0x3c48('0x3f')](_0x1d82d7,_0x3285b0[_0x3c48('0xf')]);}}return _0x48ddab[_0x3c48('0x40')](function(_0x83230d){return _0x48ddab[_0x3c48('0x2')]['VoiceExtension'][_0x3c48('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x5535fe}},'transaction':_0x83230d})[_0x3c48('0x6')](function(_0x21367f){return _0x48ddab[_0x3c48('0x2')][_0x3c48('0x5')][_0x3c48('0x42')](_[_0x3c48('0x43')](_0x1d82d7,_0x3c48('0xe')),{'transaction':_0x83230d});});});})[_0x3c48('0x44')](function(_0x4c23d0){console[_0x3c48('0x45')](_0x4c23d0);});}exports[_0x3c48('0x46')]=rewrite; \ No newline at end of file +var _0xaae6=['type','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','intervals','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','rewrite','lodash','util','Interval','findAll','models','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xaae6,0x198));var _0x6aae=function(_0x4b8567,_0xce992){_0x4b8567=_0x4b8567-0x0;var _0x3ac2fb=_0xaae6[_0x4b8567];return _0x3ac2fb;};'use strict';var _=require(_0x6aae('0x0'));var util=require(_0x6aae('0x1'));function rewrite(_0x4ce0da,_0x43c322){var _0x316ae6=this;return _0x4ce0da['models'][_0x6aae('0x2')][_0x6aae('0x3')]({'raw':!![]})['then'](function(_0x2987eb){_0x316ae6['intervals']=_0x2987eb;return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x3')]({'where':{'IntervalId':_0x43c322[_0x6aae('0x6')]},'raw':!![]});})[_0x6aae('0x7')](function(_0x2ec4fa){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x3')]({'where':{'exten':{'$in':_[_0x6aae('0x8')](_[_0x6aae('0x9')](_0x2ec4fa,_0x6aae('0xa')))}},'order':[{'raw':_0x6aae('0xb')}],'raw':!![]});})[_0x6aae('0x7')](function(_0x4ca99a){var _0x2c1d71=_['filter'](_0x4ca99a,{'priority':'1'});var _0x17305c=_[_0x6aae('0xc')](_0x4ca99a,{'isApp':0x1});var _0x5c368b=_[_0x6aae('0xd')](_0x17305c,_0x6aae('0xa'));var _0x5921b9=[_0x6aae('0xe'),_0x6aae('0xf')];var _0x1a1de9=[];var _0x61a7eb=[];for(var _0x29f23c in _0x5c368b){if(_0x5c368b[_0x6aae('0x10')](_0x29f23c)){_0x316ae6[_0x6aae('0x11')]=0x2;_0x316ae6[_0x6aae('0x12')]=[];_0x316ae6[_0x6aae('0x13')]=_[_0x6aae('0x14')](_0x2c1d71,{'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')]});_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x16'),'appdata':util[_0x6aae('0x17')]('CDR(type)=%s',_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]===_0x6aae('0x1a')){_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x1b')+_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}else if(_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]===_0x6aae('0x1d')){if(_0x316ae6[_0x6aae('0x13')]){_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':'Set','appdata':_0x6aae('0x1e')+(_0x316ae6[_0x6aae('0x13')]['cutdigits']?_0x6aae('0x1f')+_0x316ae6[_0x6aae('0x13')]['cutdigits']+'}':_0x6aae('0x20')),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});}_0x316ae6[_0x6aae('0x12')]['push']({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x1b')+_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')],'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});var _0x331112=_0x316ae6[_0x6aae('0x11')]++;_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x331112+0x2)+'):Goto('+(_0x331112+0x1)+')','context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x331112,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x316ae6['extension']){_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':'Set','appdata':_0x316ae6['extension'][_0x6aae('0x22')]?_0x6aae('0x23')+_0x316ae6[_0x6aae('0x13')][_0x6aae('0x22')]+'}':_0x6aae('0x24'),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}_0x316ae6[_0x6aae('0x12')]['push']({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x16'),'appdata':'outboundrouteid='+_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId'],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x316ae6[_0x6aae('0x13')]&&_0x316ae6[_0x6aae('0x13')][_0x6aae('0x10')](_0x6aae('0x25'))&&_0x316ae6['extension']['recordingFormat']!=='none'){_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x26'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':'Set','appdata':_0x6aae('0x27')+_0x316ae6[_0x6aae('0x13')]['recordingFormat']||_0x6aae('0x28'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}}_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x29'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x2a'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x2b'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});for(var _0x53b1c4=0x0,_0x487dfa=0x0;_0x53b1c4<_0x5c368b[_0x29f23c][_0x6aae('0x2c')];_0x53b1c4+=0x1,_0x487dfa=0x0){var _0x1da782=_0x5c368b[_0x29f23c][_0x53b1c4];if(_0x1da782[_0x6aae('0x18')]){_0x1da782['type']=_0x1da782['type'][_0x6aae('0x2d')]();}var _0x3a4533=[];var _0x4cc60a=[];delete _0x1da782['id'];delete _0x1da782[_0x6aae('0x2e')];delete _0x1da782[_0x6aae('0x2f')];var _0x27487a=_0x1da782['interval']!==_0x6aae('0x30')?[_0x1da782['interval']]:_0x1da782[_0x6aae('0x6')]?_['map'](_[_0x6aae('0xc')](_0x316ae6[_0x6aae('0x31')],{'IntervalId':_0x1da782['IntervalId']}),_0x6aae('0x32')):[];if(_0x1da782[_0x6aae('0x10')](_0x6aae('0x33'))){if(_0x1da782[_0x6aae('0x33')]&&_0x1da782[_0x6aae('0x33')]!=='--'){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x34')+_0x1da782['tag'],'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}if(_0x1da782['type']==='outbound'&&_0x1da782[_0x6aae('0x10')](_0x6aae('0x35'))){if(_0x1da782[_0x6aae('0x35')]){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x36')+_0x1da782['callerID']+')','context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782['exten'],'priority':_0x27487a['length']+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782['VoiceExtensionId']});}else{_0x3a4533['push']({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x37'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}if(_0x1da782[_0x6aae('0x10')](_0x6aae('0x38'))){if(_0x5921b9[_0x6aae('0x39')](_0x1da782[_0x6aae('0x3a')][_0x6aae('0x2d')]())>=0x0&&_0x1da782[_0x6aae('0x3b')]!==_0x6aae('0x3c')){if(_0x1da782['answer']){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782['type'],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x3d'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a['length']+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782['exten'],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782['VoiceExtensionId']});}else{_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x3e'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x3f'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}}for(var _0x4be7bb=0x0;_0x4be7bb<_0x27487a['length'];_0x4be7bb+=0x1){var _0x31c5c0=_0x316ae6[_0x6aae('0x11')]+_0x27487a[_0x6aae('0x2c')];var _0x2a3b51=_0x4be7bb===_0x27487a[_0x6aae('0x2c')]-0x1?_0x316ae6[_0x6aae('0x11')]+_0x3a4533['length']+_0x4cc60a[_0x6aae('0x2c')]+0x2:_0x316ae6[_0x6aae('0x11')]+_0x4be7bb+0x1;_0x3a4533['splice'](_0x4be7bb,0x0,{'type':_0x1da782[_0x6aae('0x18')],'app':'GotoIfTime','appdata':_0x27487a[_0x4be7bb]+'?'+_0x1da782[_0x6aae('0x1c')]+_0x6aae('0x40')+_0x31c5c0+':'+_0x1da782['context']+_0x6aae('0x40')+_0x2a3b51,'exten':_0x1da782[_0x6aae('0xa')],'context':_0x1da782[_0x6aae('0x1c')],'priority':_0x316ae6[_0x6aae('0x11')]+_0x4be7bb,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}_0x1da782['priority']=_0x3a4533[_0x6aae('0x2c')]?_['last'](_0x3a4533)[_0x6aae('0x11')]+0x1:_0x316ae6[_0x6aae('0x11')];_0x316ae6['priority']=(_0x4cc60a[_0x6aae('0x2c')]?_[_0x6aae('0x41')](_0x4cc60a)[_0x6aae('0x11')]:_0x1da782['priority'])+0x1;_0x316ae6['extensions']=_[_0x6aae('0x42')](_0x316ae6['extensions'],_0x3a4533,[_0x1da782],_0x4cc60a);}_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x43'),'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'priority':_0x316ae6[_0x6aae('0x11')],'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});_0x1a1de9['push'](_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]);_0x61a7eb=_['concat'](_0x61a7eb,_0x316ae6[_0x6aae('0x12')]);}}return _0x4ce0da[_0x6aae('0x44')](function(_0x12cc45){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x1a1de9}},'transaction':_0x12cc45})[_0x6aae('0x7')](function(_0x3232cc){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')]['bulkCreate'](_['sortBy'](_0x61a7eb,_0x6aae('0x11')),{'transaction':_0x12cc45});});});})[_0x6aae('0x46')](function(_0x543f63){console['error'](_0x543f63);});}exports[_0x6aae('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c8bb440..7305e56 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 _0xdb5b=['ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','message','stringify','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','updatedAt','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','query','onlyIfOpen','sequelize','VoiceQueueId','catch','all','Campaign','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0xdb5b,0x194));var _0xbdb5=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xdb5b[_0x2b7764];return _0x848dcb;};'use strict';var BPromise=require(_0xbdb5('0x0'));var util=require('util');var _=require(_0xbdb5('0x1'));var fs=require('fs');var squel=require(_0xbdb5('0x2'));var Papa=require(_0xbdb5('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xbdb5('0x4'));var logger=require(_0xbdb5('0x5'))(_0xbdb5('0x6'));config[_0xbdb5('0x7')]=_[_0xbdb5('0x8')](config[_0xbdb5('0x7')],{'host':_0xbdb5('0x9'),'port':0x18eb});var socket=require(_0xbdb5('0xa'))(new Redis(config[_0xbdb5('0x7')]));require(_0xbdb5('0xb'))['register'](socket);try{if(!process['argv'][0x2]||process[_0xbdb5('0xc')][0x2]===_0xbdb5('0xd')||process[_0xbdb5('0xc')][0x2]===_0xbdb5('0xe')){throw new Error(_0xbdb5('0xf'));}var FILEPATH=process[_0xbdb5('0xc')][0x2];if(!process[_0xbdb5('0xc')][0x3]||process[_0xbdb5('0xc')][0x3]===_0xbdb5('0xd')||process['argv'][0x3]===_0xbdb5('0xe')||!process[_0xbdb5('0xc')][0x4]||process[_0xbdb5('0xc')][0x4]===_0xbdb5('0xd')||process[_0xbdb5('0xc')][0x4]===_0xbdb5('0xe')){throw new Error(_0xbdb5('0x10'));}var FIELDS=_[_0xbdb5('0x11')](process[_0xbdb5('0xc')][0x3][_0xbdb5('0x12')](','),process['argv'][0x4]['split'](','));if(!process[_0xbdb5('0xc')][0x5]||process[_0xbdb5('0xc')][0x5]==='undefined'||process['argv'][0x5]===_0xbdb5('0xe')){throw new Error(_0xbdb5('0x13'));}var LISTID=process[_0xbdb5('0xc')][0x5];var COMPANYID=process[_0xbdb5('0xc')][0x6]&&process[_0xbdb5('0xc')][0x6]!==_0xbdb5('0xd')&&process[_0xbdb5('0xc')][0x6]!==_0xbdb5('0xe')?process[_0xbdb5('0xc')][0x6]:null;var DUPLICATES=process[_0xbdb5('0xc')][0x7]&&process['argv'][0x7]!==_0xbdb5('0xd')&&process[_0xbdb5('0xc')][0x7]!==_0xbdb5('0xe')?process['argv'][0x7]:null;if(!process[_0xbdb5('0xc')][0x8]||process[_0xbdb5('0xc')][0x8]===_0xbdb5('0xd')||process[_0xbdb5('0xc')][0x8]===_0xbdb5('0xe')){throw new Error(_0xbdb5('0x14'));}var SOCKET_TIMESTAMP=process[_0xbdb5('0xc')][0x8];}catch(_0x3704e1){logger['error'](_0x3704e1);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(_0x5dc1b0,_0xefb564,_0x3e138a,_0x19f6c9){var _0x559a8c={'message':_0xefb564};_0x559a8c[_0x5dc1b0]=!![];if(_0x3e138a){_0x559a8c['contact']=_0x3e138a;}if(_0x19f6c9){_0x559a8c[_0xbdb5('0x15')]=_0x19f6c9;}return _0x559a8c;}function isEmail(_0x452c7f){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))*$/[_0xbdb5('0x16')](_0x452c7f);}function checkRow(_0x348a8a,_0x4c05df,_0x3c00f6){return new BPromise(function(_0x37ced0,_0x4f6649){if(_[_0xbdb5('0x17')](_0x348a8a)){return _0x4f6649(handleCheckRowError('error',_0xbdb5('0x18'),null,_0x3c00f6));}if(_0x348a8a[_0xbdb5('0x19')]&&_0x348a8a['errors']['length']){var _0x31549f=_[_0xbdb5('0x1a')](_0x348a8a[_0xbdb5('0x19')],'message')[_0xbdb5('0x1b')](';');return _0x4f6649(handleCheckRowError(_0xbdb5('0x1c'),_0x31549f,null,_0x3c00f6));}var _0x55dce6={};for(var _0x2c7c54 in FIELDS){if(FIELDS[_0xbdb5('0x1d')](_0x2c7c54)&&FIELDS[_0x2c7c54]){_0x55dce6[_0x2c7c54]=_0x348a8a[_0xbdb5('0x1e')][0x0][FIELDS[_0x2c7c54]]||_0x348a8a['data'][0x0]['\ufeff'+FIELDS[_0x2c7c54]];}}if(!_0x55dce6[_0xbdb5('0x1f')]){return _0x4f6649(handleCheckRowError('error',_0xbdb5('0x20'),null,_0x3c00f6));}if(!_0x55dce6['phone']){return _0x4f6649(handleCheckRowError(_0xbdb5('0x1c'),'phone\x20not\x20specified!',null,_0x3c00f6));}if(_0x55dce6['birthDate']){var _0x4047b0=moment(_0x55dce6['birthDate'],'YYYY-MM-DD');if(!_0x4047b0['isValid']()){return _0x4f6649(handleCheckRowError(_0xbdb5('0x1c'),_0xbdb5('0x21'),null,_0x3c00f6));}}if(_0x55dce6[_0xbdb5('0x22')]){if(!isEmail(_0x55dce6['email'])){return _0x4f6649(handleCheckRowError(_0xbdb5('0x1c'),_0xbdb5('0x23'),null,_0x3c00f6));}}_0x55dce6[_0xbdb5('0x24')]=LISTID;_0x55dce6['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x4c05df){var _0x17a7db={};for(var _0x4a583c=0x0,_0x14b84b=DUPLICATES[_0xbdb5('0x25')];_0x4a583c<_0x14b84b;_0x4a583c+=0x1){_0x17a7db[DUPLICATES[_0x4a583c]]=_0x55dce6[DUPLICATES[_0x4a583c]];}var _0x52e2a9=_[_0xbdb5('0x26')](_0x4c05df,_0x17a7db);if(_0x52e2a9){return _0x4f6649(handleCheckRowError(_0xbdb5('0x27'),_0xbdb5('0x28'),_0x52e2a9,_0x3c00f6));}}return db[_0xbdb5('0x29')][_0xbdb5('0x2a')](_0x55dce6,{'raw':!![],'hooks':![],'fields':_[_0xbdb5('0x2b')](_0x55dce6)})['then'](function(_0x54a96b){if(DUPLICATES&&DUPLICATES['length']&&_0x4c05df){_0x4c05df[_0xbdb5('0x2c')](_[_0xbdb5('0x2d')](_0x55dce6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x54a96b['id'];return _0x37ced0();})['catch'](function(_0x13fbd7){return _0x4f6649(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x13fbd7[_0xbdb5('0x2e')]||JSON[_0xbdb5('0x2f')](_0x13fbd7)),null,_0x3c00f6));});});}function checkHopper(){function _0x387f09(){return function(_0x86170e){logger[_0xbdb5('0x1c')]('cmContact','checkHopper',util['inspect'](_0x86170e,{'showHidden':![],'depth':null}));};}var _0x29475b=function(_0x5897f7,_0x400ac8){var _0x3c1f39=squel[_0xbdb5('0x30')]()[_0xbdb5('0x31')]('cm_hopper')[_0xbdb5('0x32')]([_0xbdb5('0x33'),_0xbdb5('0x34'),_0xbdb5('0x35'),'ListId',_0x400ac8,_0xbdb5('0x36'),'updatedAt'],squel[_0xbdb5('0x37')]()[_0xbdb5('0x38')](_0xbdb5('0x33'),_0xbdb5('0x33'))['field'](_0xbdb5('0x39'),_0xbdb5('0x34'))[_0xbdb5('0x38')]('id',_0xbdb5('0x35'))[_0xbdb5('0x38')](LISTID[_0xbdb5('0x3a')](),_0xbdb5('0x24'))[_0xbdb5('0x38')](_0x5897f7['id'][_0xbdb5('0x3a')](),_0x400ac8)[_0xbdb5('0x38')]('NOW()',_0xbdb5('0x36'))[_0xbdb5('0x38')](_0xbdb5('0x39'),'updatedAt')[_0xbdb5('0x3b')](_0xbdb5('0x3c'))[_0xbdb5('0x3d')](_0xbdb5('0x3e'))['where'](_0xbdb5('0x3f'),LISTID[_0xbdb5('0x3a')]())[_0xbdb5('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xbdb5('0x3d')](_0xbdb5('0x40'),squel[_0xbdb5('0x37')]()[_0xbdb5('0x38')](_0xbdb5('0x33'))[_0xbdb5('0x3b')](_0xbdb5('0x41'))[_0xbdb5('0x3d')](_0x400ac8+'\x20=\x20?',_0x5897f7['id'][_0xbdb5('0x3a')]())))[_0xbdb5('0x3a')]();return _0x3c1f39;};var _0x42a4b3=function(_0x1dfe24,_0xc5df13){var _0x33a0d=squel[_0xbdb5('0x30')]()[_0xbdb5('0x31')](_0xbdb5('0x41'))[_0xbdb5('0x32')](['phone',_0xbdb5('0x34'),'ContactId',_0xbdb5('0x24'),_0xc5df13,_0xbdb5('0x36'),_0xbdb5('0x42')],squel[_0xbdb5('0x37')]()[_0xbdb5('0x38')](_0xbdb5('0x33'),_0xbdb5('0x33'))[_0xbdb5('0x38')](_0xbdb5('0x39'),'scheduledAt')['field']('id','ContactId')['field'](LISTID[_0xbdb5('0x3a')](),_0xbdb5('0x24'))[_0xbdb5('0x38')](_0x1dfe24['id'][_0xbdb5('0x3a')](),_0xc5df13)['field'](_0xbdb5('0x39'),'createdAt')[_0xbdb5('0x38')](_0xbdb5('0x39'),'updatedAt')['from'](_0xbdb5('0x3c'))[_0xbdb5('0x3d')](_0xbdb5('0x3e'))['where']('ListId\x20=\x20?',LISTID[_0xbdb5('0x3a')]())[_0xbdb5('0x3d')](_0xbdb5('0x43'),squel[_0xbdb5('0x44')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xbdb5('0x3d')](_0xbdb5('0x40'),squel[_0xbdb5('0x37')]()[_0xbdb5('0x38')](_0xbdb5('0x45'))[_0xbdb5('0x3b')](_0xbdb5('0x46'))[_0xbdb5('0x3d')](_0xc5df13+_0xbdb5('0x47'),_0x1dfe24['id'][_0xbdb5('0x3a')]()))[_0xbdb5('0x3d')](_0xbdb5('0x40'),squel[_0xbdb5('0x37')]()['field'](_0xbdb5('0x33'))[_0xbdb5('0x3b')](_0xbdb5('0x41'))['where'](_0xc5df13+'\x20=\x20?',_0x1dfe24['id']['toString']())))['toString']();return _0x33a0d;};function _0x15fd64(_0x4f10f1,_0x13f235){var _0x45aac7=squel['insert']()[_0xbdb5('0x31')](_0xbdb5('0x41'))[_0xbdb5('0x32')](['phone',_0xbdb5('0x34'),_0xbdb5('0x35'),'ListId',_0x13f235,'createdAt',_0xbdb5('0x42')],squel[_0xbdb5('0x37')]()[_0xbdb5('0x38')](_0xbdb5('0x33'),'phone')[_0xbdb5('0x38')](_0xbdb5('0x39'),_0xbdb5('0x34'))[_0xbdb5('0x38')]('id','ContactId')[_0xbdb5('0x38')](LISTID[_0xbdb5('0x3a')](),_0xbdb5('0x24'))[_0xbdb5('0x38')](_0x4f10f1['id'][_0xbdb5('0x3a')](),_0x13f235)[_0xbdb5('0x38')]('NOW()',_0xbdb5('0x36'))[_0xbdb5('0x38')](_0xbdb5('0x39'),_0xbdb5('0x42'))['from']('cm_contacts')[_0xbdb5('0x3d')](_0xbdb5('0x3e'))[_0xbdb5('0x3d')](_0xbdb5('0x3f'),LISTID[_0xbdb5('0x3a')]())[_0xbdb5('0x3d')](_0xbdb5('0x43'),squel[_0xbdb5('0x44')](hopperContacts))[_0xbdb5('0x3d')](_0xbdb5('0x48')))[_0xbdb5('0x3a')]();return _0x45aac7;}function _0x2a2f31(_0x2edd9e,_0x4a7f8c){var _0x41886c=squel['insert']()[_0xbdb5('0x31')](_0xbdb5('0x49'))[_0xbdb5('0x32')]([_0xbdb5('0x33'),_0xbdb5('0x35'),_0xbdb5('0x24'),_0x4a7f8c,_0xbdb5('0x36'),_0xbdb5('0x42')],squel[_0xbdb5('0x37')]()['field'](_0xbdb5('0x33'),'phone')['field']('id',_0xbdb5('0x35'))['field'](LISTID['toString'](),_0xbdb5('0x24'))[_0xbdb5('0x38')](_0x2edd9e['id']['toString'](),_0x4a7f8c)[_0xbdb5('0x38')](_0xbdb5('0x39'),_0xbdb5('0x36'))['field'](_0xbdb5('0x39'),_0xbdb5('0x42'))[_0xbdb5('0x3b')](_0xbdb5('0x3c'))[_0xbdb5('0x3d')](_0xbdb5('0x3e'))[_0xbdb5('0x3d')](_0xbdb5('0x3f'),LISTID[_0xbdb5('0x3a')]())[_0xbdb5('0x3d')]('id\x20IN\x20?',squel[_0xbdb5('0x44')](hopperContacts))[_0xbdb5('0x3d')](_0xbdb5('0x48')))[_0xbdb5('0x3a')]();return _0x41886c;}return db[_0xbdb5('0x4a')][_0xbdb5('0x4b')]({'where':{'type':_0xbdb5('0x4c')},'attributes':['id',_0xbdb5('0x4d')],'include':[{'model':db[_0xbdb5('0x4e')],'as':_0xbdb5('0x4f'),'where':{'id':LISTID}}]})[_0xbdb5('0x50')](function(_0x3f4200){var _0xd25404=[];if(_0x3f4200){var _0x112377;for(var _0x272baa=0x0,_0x45c186;_0x272baa<_0x3f4200[_0xbdb5('0x25')];_0x272baa+=0x1){_0x45c186=_0x3f4200[_0x272baa][_0xbdb5('0x51')]({'plain':!![]});switch(_0x45c186[_0xbdb5('0x4d')]){case _0xbdb5('0x52'):_0xd25404[_0xbdb5('0x2c')](db['sequelize'][_0xbdb5('0x53')](_0x42a4b3(_0x45c186,'VoiceQueueId'))['then'](function(){})['catch'](_0x387f09()));break;case _0xbdb5('0x54'):_0xd25404['push'](db[_0xbdb5('0x55')][_0xbdb5('0x53')](_0x29475b(_0x45c186,_0xbdb5('0x56')))[_0xbdb5('0x50')](function(){})[_0xbdb5('0x57')](_0x387f09()));break;default:_0xd25404[_0xbdb5('0x2c')](db[_0xbdb5('0x55')][_0xbdb5('0x53')](_0x15fd64(_0x45c186,'VoiceQueueId'))[_0xbdb5('0x50')](function(){})[_0xbdb5('0x57')](_0x387f09()));}}}return _0xd25404;})[_0xbdb5('0x58')]()['then'](function(){return db['VoiceQueue'][_0xbdb5('0x4b')]({'where':{'type':_0xbdb5('0x4c')},'attributes':['id'],'include':[{'model':db[_0xbdb5('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4d0152){var _0x4e9200=[];if(_0x4d0152){var _0x37c6fd;for(var _0x4b9707=0x0,_0x20cb35;_0x4b9707<_0x4d0152[_0xbdb5('0x25')];_0x4b9707+=0x1){_0x20cb35=_0x4d0152[_0x4b9707]['get']({'plain':!![]});_0x4e9200['push'](db[_0xbdb5('0x55')]['query'](_0x2a2f31(_0x20cb35,_0xbdb5('0x56')))['then'](function(){})[_0xbdb5('0x57')](_0x387f09()));}}return _0x4e9200;})['all']();})[_0xbdb5('0x50')](function(){return db[_0xbdb5('0x59')][_0xbdb5('0x4b')]({'attributes':['id',_0xbdb5('0x4d')],'include':[{'model':db['CmList'],'as':_0xbdb5('0x4f'),'where':{'id':LISTID}}]})[_0xbdb5('0x50')](function(_0x31e1c1){var _0x29731e=[];if(_0x31e1c1){for(var _0x5eae89=0x0,_0x1b6b81;_0x5eae89<_0x31e1c1[_0xbdb5('0x25')];_0x5eae89+=0x1){_0x1b6b81=_0x31e1c1[_0x5eae89]['get']({'plain':!![]});switch(_0x1b6b81['dialCheckDuplicateType']){case _0xbdb5('0x52'):_0x29731e['push'](db[_0xbdb5('0x55')][_0xbdb5('0x53')](_0x42a4b3(_0x1b6b81,'CampaignId'))['then'](function(){})[_0xbdb5('0x57')](_0x387f09()));break;case'onlyIfOpen':_0x29731e['push'](db[_0xbdb5('0x55')]['query'](_0x29475b(_0x1b6b81,_0xbdb5('0x5a')))[_0xbdb5('0x50')](function(){})[_0xbdb5('0x57')](_0x387f09()));break;default:_0x29731e[_0xbdb5('0x2c')](db['sequelize'][_0xbdb5('0x53')](_0x15fd64(_0x1b6b81,_0xbdb5('0x5a')))[_0xbdb5('0x50')](function(){})[_0xbdb5('0x57')](_0x387f09()));}}}return _0x29731e;})['all']();})[_0xbdb5('0x50')](function(){return db[_0xbdb5('0x59')][_0xbdb5('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xbdb5('0x4e')],'as':_0xbdb5('0x5b'),'where':{'id':LISTID}}]})[_0xbdb5('0x50')](function(_0x184944){var _0x36dab9=[];if(_0x184944){for(var _0x2d42d9=0x0,_0x17e062;_0x2d42d9<_0x184944[_0xbdb5('0x25')];_0x2d42d9+=0x1){_0x17e062=_0x184944[_0x2d42d9][_0xbdb5('0x51')]({'plain':!![]});_0x36dab9['push'](db['sequelize'][_0xbdb5('0x53')](_0x2a2f31(_0x17e062,_0xbdb5('0x5a')))[_0xbdb5('0x50')](function(){})[_0xbdb5('0x57')](_0x387f09()));}}return _0x36dab9;})[_0xbdb5('0x58')]();})[_0xbdb5('0x57')](function(_0x2bfb14){logger[_0xbdb5('0x1c')]('cmContact,\x20%s,\x20%s',_0xbdb5('0x5c'),_0x2bfb14['message']);});}var processPromises=function(_0x55e6f7){return BPromise[_0xbdb5('0x58')](promises)['then'](function(_0x17e6f7){})[_0xbdb5('0x57')](function(_0x23b970){logger[_0xbdb5('0x1c')](_0xbdb5('0x5d'),JSON[_0xbdb5('0x2f')](_0x23b970));})[_0xbdb5('0x5e')](function(){socket[_0xbdb5('0x5f')](_0xbdb5('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x55e6f7){return _0x55e6f7[_0xbdb5('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xbdb5('0x50')](function(){if(hopperContacts){return checkHopper();}})[_0xbdb5('0x50')](function(){socket[_0xbdb5('0x5f')](_0xbdb5('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xbdb5('0x62')](FILEPATH);}catch(_0xf1a061){logger[_0xbdb5('0x1c')](_0xbdb5('0x63'),JSON[_0xbdb5('0x2f')](_0xf1a061));}finally{process[_0xbdb5('0x64')](0x0);}});};process['on'](_0xbdb5('0x65'),function(){logger['info'](_0xbdb5('0x66'));endCsv();});function main(){return BPromise[_0xbdb5('0x67')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xbdb5('0x12')](',');return db['CmContact'][_0xbdb5('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xbdb5('0x50')](function(_0x39754f){var _0x5906d9=fs[_0xbdb5('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xbdb5('0x69')](_0x5906d9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x430529,_0x567494){total+=0x1;var _0x1c522b=total;promises['push'](checkRow(_0x430529,_0x39754f,_0x1c522b)[_0xbdb5('0x50')](function(){success+=0x1;})[_0xbdb5('0x57')](function(_0x27473a){if(_0x27473a['error']){errors+=0x1;delete _0x27473a[_0xbdb5('0x1c')];}else if(_0x27473a[_0xbdb5('0x27')]){duplicates+=0x1;delete _0x27473a[_0xbdb5('0x27')];}rows[_0xbdb5('0x2c')](_0x27473a);}));if(total%0xc8===0x0){_0x567494[_0xbdb5('0x6a')]();return processPromises(_0x567494);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xbdb5('0x6b'));endCsv();});},'error':function(_0x3ae41b,_0x4668ef){logger[_0xbdb5('0x6c')](_0xbdb5('0x6d'),JSON['stringify'](_0x3ae41b));endCsv();}});})[_0xbdb5('0x57')](function(_0x1e68fb){logger[_0xbdb5('0x1c')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xbdb5('0x2f')](_0x1e68fb));});}main(); \ No newline at end of file +var _0x9d7b=['dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','all','BlackLists','get','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','NOW()','createdAt','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','toString','insert','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists'];(function(_0x4ebb5d,_0x1e92b6){var _0x5abafd=function(_0x2e1f57){while(--_0x2e1f57){_0x4ebb5d['push'](_0x4ebb5d['shift']());}};_0x5abafd(++_0x1e92b6);}(_0x9d7b,0x86));var _0xb9d7=function(_0x3151e3,_0x500d5f){_0x3151e3=_0x3151e3-0x0;var _0x1c4d5e=_0x9d7b[_0x3151e3];return _0x1c4d5e;};'use strict';var BPromise=require('bluebird');var util=require(_0xb9d7('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0xb9d7('0x1'));var Papa=require(_0xb9d7('0x2'));var Redis=require(_0xb9d7('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xb9d7('0x4'));var logger=require(_0xb9d7('0x5'))('api');config[_0xb9d7('0x6')]=_[_0xb9d7('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb9d7('0x8'))(new Redis(config['redis']));require(_0xb9d7('0x9'))[_0xb9d7('0xa')](socket);try{if(!process[_0xb9d7('0xb')][0x2]||process[_0xb9d7('0xb')][0x2]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x2]===_0xb9d7('0xd')){throw new Error(_0xb9d7('0xe'));}var FILEPATH=process[_0xb9d7('0xb')][0x2];if(!process[_0xb9d7('0xb')][0x3]||process['argv'][0x3]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x3]===_0xb9d7('0xd')||!process[_0xb9d7('0xb')][0x4]||process[_0xb9d7('0xb')][0x4]==='undefined'||process[_0xb9d7('0xb')][0x4]===_0xb9d7('0xd')){throw new Error(_0xb9d7('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xb9d7('0x10')](','),process[_0xb9d7('0xb')][0x4]['split'](','));if(!process[_0xb9d7('0xb')][0x5]||process[_0xb9d7('0xb')][0x5]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x5]===_0xb9d7('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb9d7('0xb')][0x6]!==_0xb9d7('0xc')&&process['argv'][0x6]!==_0xb9d7('0xd')?process[_0xb9d7('0xb')][0x6]:null;var DUPLICATES=process[_0xb9d7('0xb')][0x7]&&process[_0xb9d7('0xb')][0x7]!==_0xb9d7('0xc')&&process[_0xb9d7('0xb')][0x7]!==_0xb9d7('0xd')?process[_0xb9d7('0xb')][0x7]:null;if(!process[_0xb9d7('0xb')][0x8]||process[_0xb9d7('0xb')][0x8]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x8]===_0xb9d7('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xb9d7('0xb')][0x8];}catch(_0x94da30){logger['error'](_0x94da30);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(_0xe45a0b,_0x4e3fb5,_0x1927ef,_0x557387){var _0x4c375b={'message':_0x4e3fb5};_0x4c375b[_0xe45a0b]=!![];if(_0x1927ef){_0x4c375b[_0xb9d7('0x11')]=_0x1927ef;}if(_0x557387){_0x4c375b[_0xb9d7('0x12')]=_0x557387;}return _0x4c375b;}function isEmail(_0x5c155a){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))*$/[_0xb9d7('0x13')](_0x5c155a);}function checkRow(_0x1074a0,_0x3963ef,_0x38ec22){return new BPromise(function(_0x4705ee,_0x42db45){if(_['isNil'](_0x1074a0)){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),_0xb9d7('0x15'),null,_0x38ec22));}if(_0x1074a0['errors']&&_0x1074a0[_0xb9d7('0x16')][_0xb9d7('0x17')]){var _0x566dc2=_[_0xb9d7('0x18')](_0x1074a0[_0xb9d7('0x16')],_0xb9d7('0x19'))['join'](';');return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),_0x566dc2,null,_0x38ec22));}var _0x2a4ae9={};for(var _0x4a7036 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4a7036)&&FIELDS[_0x4a7036]){_0x2a4ae9[_0x4a7036]=_0x1074a0[_0xb9d7('0x1a')][0x0][FIELDS[_0x4a7036]]||_0x1074a0[_0xb9d7('0x1a')][0x0]['\ufeff'+FIELDS[_0x4a7036]];}}if(!_0x2a4ae9[_0xb9d7('0x1b')]){return _0x42db45(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x38ec22));}if(!_0x2a4ae9[_0xb9d7('0x1c')]){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),'phone\x20not\x20specified!',null,_0x38ec22));}if(_0x2a4ae9[_0xb9d7('0x1d')]){var _0x291876=moment(_0x2a4ae9['birthDate'],_0xb9d7('0x1e'));if(!_0x291876[_0xb9d7('0x1f')]()){return _0x42db45(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x38ec22));}}if(_0x2a4ae9[_0xb9d7('0x20')]){if(!isEmail(_0x2a4ae9[_0xb9d7('0x20')])){return _0x42db45(handleCheckRowError('error',_0xb9d7('0x21'),null,_0x38ec22));}}_0x2a4ae9[_0xb9d7('0x22')]=LISTID;_0x2a4ae9[_0xb9d7('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb9d7('0x17')]&&_0x3963ef){var _0x294b89={};for(var _0x1019a2=0x0,_0x4884c4=DUPLICATES[_0xb9d7('0x17')];_0x1019a2<_0x4884c4;_0x1019a2+=0x1){_0x294b89[DUPLICATES[_0x1019a2]]=_0x2a4ae9[DUPLICATES[_0x1019a2]];}var _0x6aca37=_[_0xb9d7('0x24')](_0x3963ef,_0x294b89);if(_0x6aca37){return _0x42db45(handleCheckRowError(_0xb9d7('0x25'),_0xb9d7('0x26'),_0x6aca37,_0x38ec22));}}return db['CmContact']['create'](_0x2a4ae9,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2a4ae9)})[_0xb9d7('0x27')](function(_0x5b8bad){if(DUPLICATES&&DUPLICATES[_0xb9d7('0x17')]&&_0x3963ef){_0x3963ef[_0xb9d7('0x28')](_[_0xb9d7('0x29')](_0x2a4ae9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5b8bad['id'];return _0x4705ee();})[_0xb9d7('0x2a')](function(_0x50e860){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x50e860[_0xb9d7('0x19')]||JSON[_0xb9d7('0x2b')](_0x50e860)),null,_0x38ec22));});});}function checkHopper(){function _0x463af9(){return function(_0x3b84c4){logger['error'](_0xb9d7('0x2c'),_0xb9d7('0x2d'),util[_0xb9d7('0x2e')](_0x3b84c4,{'showHidden':![],'depth':null}));};}var _0x271e1e=function(_0x3d6126,_0x17427b){var _0x53a794=squel['insert']()['into'](_0xb9d7('0x2f'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x31'),_0xb9d7('0x32'),'ListId',_0x17427b,'createdAt','updatedAt'],squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'),_0xb9d7('0x1c'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))['field'](LISTID['toString'](),_0xb9d7('0x22'))['field'](_0x3d6126['id']['toString'](),_0x17427b)['field'](_0xb9d7('0x35'),_0xb9d7('0x36'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xb9d7('0x3b'),LISTID['toString']())[_0xb9d7('0x3a')](_0xb9d7('0x3c'))[_0xb9d7('0x3a')](_0xb9d7('0x3d'),squel[_0xb9d7('0x33')]()['field']('phone')[_0xb9d7('0x38')]('cm_hopper')[_0xb9d7('0x3a')](_0x17427b+_0xb9d7('0x3e'),_0x3d6126['id'][_0xb9d7('0x3f')]())))['toString']();return _0x53a794;};var _0x198132=function(_0x199243,_0x446e8f){var _0x5e190e=squel[_0xb9d7('0x40')]()[_0xb9d7('0x41')](_0xb9d7('0x2f'))[_0xb9d7('0x30')](['phone',_0xb9d7('0x31'),_0xb9d7('0x32'),_0xb9d7('0x22'),_0x446e8f,'createdAt',_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()['field']('phone',_0xb9d7('0x1c'))[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))[_0xb9d7('0x34')](LISTID[_0xb9d7('0x3f')](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x199243['id'][_0xb9d7('0x3f')](),_0x446e8f)[_0xb9d7('0x34')](_0xb9d7('0x35'),'createdAt')[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')](_0xb9d7('0x42'))[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel[_0xb9d7('0x44')](hopperContacts))['where'](_0xb9d7('0x3c'))['where'](_0xb9d7('0x3d'),squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')]('calleridnum')[_0xb9d7('0x38')](_0xb9d7('0x45'))['where'](_0x446e8f+_0xb9d7('0x3e'),_0x199243['id'][_0xb9d7('0x3f')]()))[_0xb9d7('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'))[_0xb9d7('0x38')](_0xb9d7('0x2f'))[_0xb9d7('0x3a')](_0x446e8f+'\x20=\x20?',_0x199243['id'][_0xb9d7('0x3f')]())))[_0xb9d7('0x3f')]();return _0x5e190e;};function _0xa4f3fd(_0x10cce3,_0x13839e){var _0x45e868=squel[_0xb9d7('0x40')]()['into'](_0xb9d7('0x2f'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x31'),_0xb9d7('0x32'),'ListId',_0x13839e,'createdAt',_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'),'phone')[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))['field'](LISTID['toString'](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x10cce3['id'][_0xb9d7('0x3f')](),_0x13839e)['field'](_0xb9d7('0x35'),_0xb9d7('0x36'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')](_0xb9d7('0x42'))[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel[_0xb9d7('0x44')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x45e868;}function _0x440dd4(_0x24ea19,_0x37bc18){var _0x4b5008=squel[_0xb9d7('0x40')]()['into'](_0xb9d7('0x46'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x32'),_0xb9d7('0x22'),_0x37bc18,_0xb9d7('0x36'),_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()['field']('phone','phone')[_0xb9d7('0x34')]('id','ContactId')[_0xb9d7('0x34')](LISTID['toString'](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x24ea19['id']['toString'](),_0x37bc18)[_0xb9d7('0x34')]('NOW()','createdAt')[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')]('deletedAt\x20IS\x20NULL')[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel['str'](hopperContacts))['where'](_0xb9d7('0x3c')))[_0xb9d7('0x3f')]();return _0x4b5008;}return db[_0xb9d7('0x47')][_0xb9d7('0x48')]({'where':{'type':_0xb9d7('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb9d7('0x4a')],'as':_0xb9d7('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x2632bb){var _0xe2b9c0=[];if(_0x2632bb){var _0x53fe76;for(var _0x239ed5=0x0,_0x10a3ed;_0x239ed5<_0x2632bb[_0xb9d7('0x17')];_0x239ed5+=0x1){_0x10a3ed=_0x2632bb[_0x239ed5]['get']({'plain':!![]});switch(_0x10a3ed[_0xb9d7('0x4c')]){case _0xb9d7('0x4d'):_0xe2b9c0[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x198132(_0x10a3ed,_0xb9d7('0x50')))['then'](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;case'onlyIfOpen':_0xe2b9c0[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x271e1e(_0x10a3ed,_0xb9d7('0x50')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;default:_0xe2b9c0['push'](db[_0xb9d7('0x4e')]['query'](_0xa4f3fd(_0x10a3ed,'VoiceQueueId'))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}}return _0xe2b9c0;})[_0xb9d7('0x51')]()[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x47')]['findAll']({'where':{'type':_0xb9d7('0x49')},'attributes':['id'],'include':[{'model':db[_0xb9d7('0x4a')],'as':_0xb9d7('0x52'),'where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x59f76c){var _0x2108c7=[];if(_0x59f76c){var _0x172db0;for(var _0x116ed5=0x0,_0x391226;_0x116ed5<_0x59f76c[_0xb9d7('0x17')];_0x116ed5+=0x1){_0x391226=_0x59f76c[_0x116ed5][_0xb9d7('0x53')]({'plain':!![]});_0x2108c7[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x440dd4(_0x391226,_0xb9d7('0x50')))[_0xb9d7('0x27')](function(){})['catch'](_0x463af9()));}}return _0x2108c7;})[_0xb9d7('0x51')]();})[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x54')][_0xb9d7('0x48')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x536232){var _0x45384e=[];if(_0x536232){for(var _0x22601d=0x0,_0x6d046d;_0x22601d<_0x536232['length'];_0x22601d+=0x1){_0x6d046d=_0x536232[_0x22601d][_0xb9d7('0x53')]({'plain':!![]});switch(_0x6d046d[_0xb9d7('0x4c')]){case _0xb9d7('0x4d'):_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')]['query'](_0x198132(_0x6d046d,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})['catch'](_0x463af9()));break;case _0xb9d7('0x56'):_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x271e1e(_0x6d046d,_0xb9d7('0x55')))['then'](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;default:_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0xa4f3fd(_0x6d046d,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}}return _0x45384e;})['all']();})[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x54')][_0xb9d7('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb9d7('0x52'),'where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x3fc2b7){var _0x2ffec0=[];if(_0x3fc2b7){for(var _0x4332d0=0x0,_0x33bf63;_0x4332d0<_0x3fc2b7[_0xb9d7('0x17')];_0x4332d0+=0x1){_0x33bf63=_0x3fc2b7[_0x4332d0][_0xb9d7('0x53')]({'plain':!![]});_0x2ffec0[_0xb9d7('0x28')](db['sequelize'][_0xb9d7('0x4f')](_0x440dd4(_0x33bf63,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}return _0x2ffec0;})['all']();})['catch'](function(_0x210436){logger[_0xb9d7('0x14')](_0xb9d7('0x57'),_0xb9d7('0x58'),_0x210436['message']);});}var processPromises=function(_0xcb1529){return BPromise[_0xb9d7('0x51')](promises)['then'](function(_0x5d5ec7){})[_0xb9d7('0x2a')](function(_0x38cfe1){logger[_0xb9d7('0x14')](_0xb9d7('0x59'),JSON['stringify'](_0x38cfe1));})[_0xb9d7('0x5a')](function(){socket[_0xb9d7('0x5b')](_0xb9d7('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xcb1529){return _0xcb1529[_0xb9d7('0x5d')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xb9d7('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0xb9d7('0x27')](function(){socket[_0xb9d7('0x5b')](_0xb9d7('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb9d7('0x5e')](FILEPATH);}catch(_0x31562c){logger[_0xb9d7('0x14')](_0xb9d7('0x5f'),JSON['stringify'](_0x31562c));}finally{process[_0xb9d7('0x60')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xb9d7('0x61'));endCsv();});function main(){return BPromise['resolve']()[_0xb9d7('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb9d7('0x10')](',');return db['CmContact'][_0xb9d7('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x597458){var _0xf1a994=fs[_0xb9d7('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb9d7('0x63')](_0xf1a994,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cee1f,_0x35a639){total+=0x1;var _0x398767=total;promises['push'](checkRow(_0x1cee1f,_0x597458,_0x398767)['then'](function(){success+=0x1;})[_0xb9d7('0x2a')](function(_0x364542){if(_0x364542[_0xb9d7('0x14')]){errors+=0x1;delete _0x364542[_0xb9d7('0x14')];}else if(_0x364542['duplicate']){duplicates+=0x1;delete _0x364542['duplicate'];}rows[_0xb9d7('0x28')](_0x364542);}));if(total%0xc8===0x0){_0x35a639[_0xb9d7('0x64')]();return processPromises(_0x35a639);}},'complete':function(){return processPromises()[_0xb9d7('0x27')](function(){logger[_0xb9d7('0x65')](_0xb9d7('0x66'));endCsv();});},'error':function(_0x422f93,_0x5c1427){logger[_0xb9d7('0x65')](_0xb9d7('0x67'),JSON[_0xb9d7('0x2b')](_0x422f93));endCsv();}});})[_0xb9d7('0x2a')](function(_0x3deb3e){logger[_0xb9d7('0x14')](_0xb9d7('0x68'),JSON[_0xb9d7('0x2b')](_0x3deb3e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 084f622..6aa4838 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 _0x164b=['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','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','UserId','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_contacts.updatedAt','cm_hopper_black','ContactId','from','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','fields','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','catch','stringify','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','trim','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x164b,0x92));var _0xb164=function(_0x19a5d8,_0x347207){_0x19a5d8=_0x19a5d8-0x0;var _0x30104a=_0x164b[_0x19a5d8];return _0x30104a;};'use strict';var fs=require('fs');var path=require(_0xb164('0x0'));var _=require(_0xb164('0x1'));var Papa=require(_0xb164('0x2'));var util=require('util');var BPromise=require(_0xb164('0x3'));var moment=require(_0xb164('0x4'));var squel=require(_0xb164('0x5'));var Redis=require(_0xb164('0x6'));var db=require(_0xb164('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0xb164('0x8'))(_0xb164('0x9'));config[_0xb164('0xa')]=_[_0xb164('0xb')](config[_0xb164('0xa')],{'host':_0xb164('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb164('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xb164('0xd'));function isEmail(_0x409fe7){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))*$/[_0xb164('0xe')](_0x409fe7);}function selectNotIn(_0x3a99dc,_0x32dcfd,_0x399c36,_0x1e405f,_0x9bab2b){return squel['select']()[_0xb164('0xf')](_0xb164('0x10'))['from'](_0x1e405f)[_0xb164('0x11')](_0x32dcfd,null,_0x32dcfd+_0xb164('0x12')+_0x1e405f+'.'+_0x399c36)['where'](_0x1e405f+'.'+_0x399c36+_0xb164('0x13')+_0x3a99dc+'.'+_0x399c36)['where'](_0x32dcfd+_0xb164('0x14')+_0x9bab2b[_0xb164('0x11')]()+')');}function insertCmHopper(_0x13b85f,_0x1f06ce,_0xd7a5ea,_0x4c1c54,_0x33f840){var _0x34a013=[_0xb164('0x15'),'cm_contacts.scheduledat','cm_contacts.id',_0xb164('0x16'),_0x1f06ce+'.'+_0x4c1c54,_0xb164('0x17'),'cm_contacts.updatedAt',_0xb164('0x18'),_0xb164('0x19'),'\x22'+_0x33f840+'\x22'];return squel[_0xb164('0x1a')]()[_0xb164('0x1b')](_0xb164('0x1c'))[_0xb164('0x1d')](['phone','scheduledat','ContactId',_0xb164('0x1e'),_0x4c1c54,_0xb164('0x1f'),_0xb164('0x20'),_0xb164('0x21'),_0xb164('0x22'),_0xb164('0x23')],squel[_0xb164('0x24')]()['fields'](_0x34a013)['from'](_0x1f06ce)[_0xb164('0x11')](_0xb164('0x25'),null,_0xb164('0x26')+_0x1f06ce+'.CmListId')[_0xb164('0x11')](_0xd7a5ea,null,_0xd7a5ea+_0xb164('0x12')+_0x1f06ce+'.'+_0x4c1c54)[_0xb164('0x27')](_0x1f06ce+_0xb164('0x28'),_0x13b85f)[_0xb164('0x27')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb164('0x29'),selectNotIn(_0x1f06ce,_0xd7a5ea,_0x4c1c54,_0xb164('0x1c'),['\x22always\x22',_0xb164('0x2a')]))['where'](_0xb164('0x29'),selectNotIn(_0x1f06ce,_0xd7a5ea,_0x4c1c54,_0xb164('0x1c'),[_0xb164('0x2b')])))[_0xb164('0x2c')]();}function insertCmHopperBlack(_0x4844df,_0xee761a,_0x4cce66,_0x3afb69){var _0x241c1a=[_0xb164('0x15'),_0xb164('0x2d'),_0xb164('0x16'),_0xee761a+'.'+_0x3afb69,_0xb164('0x17'),_0xb164('0x2e')];return squel[_0xb164('0x1a')]()[_0xb164('0x1b')](_0xb164('0x2f'))['fromQuery'](['phone',_0xb164('0x30'),'ListId',_0x3afb69,_0xb164('0x1f'),_0xb164('0x20')],squel[_0xb164('0x24')]()['fields'](_0x241c1a)[_0xb164('0x31')](_0xee761a)[_0xb164('0x11')](_0xb164('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0xee761a+'.CmListId')[_0xb164('0x11')](_0x4cce66,null,_0x4cce66+_0xb164('0x12')+_0xee761a+'.'+_0x3afb69)[_0xb164('0x27')](_0xee761a+_0xb164('0x28'),_0x4844df)[_0xb164('0x27')](_0xb164('0x32'),NOW)['where'](_0xb164('0x29'),squel['select']()[_0xb164('0xf')](_0xb164('0x10'))['from'](_0xb164('0x2f'))[_0xb164('0x27')](_0xb164('0x33'),_0x4844df)['where'](_0x3afb69+_0xb164('0x34'),_0xee761a+'.'+_0x3afb69)))[_0xb164('0x2c')]();}function insertCmContact(_0x2b570d,_0x4eb2ee,_0x5bcfba,_0xe9feb8){var _0x30ceba=_[_0xb164('0x35')](_[_0xb164('0x36')](_0xe9feb8),[_0xb164('0x1e'),_0xb164('0x37'),_0xb164('0x1f'),_0xb164('0x20')]);return squel['insert']()[_0xb164('0x1b')](_0xb164('0x25'))[_0xb164('0x1d')](_0x30ceba,squel[_0xb164('0x24')]()[_0xb164('0x38')](_0x30ceba)[_0xb164('0x31')](_0x4eb2ee)['where']('('+_0x5bcfba[_0xb164('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0xb164('0x24')]()['fields'](_0x5bcfba)['from'](_0xb164('0x25'))['where'](_0xb164('0x33'),_0x2b570d)[_0xb164('0x27')](_0xb164('0x39')))['where'](_0xb164('0x3a'),squel[_0xb164('0x24')]()['field'](_0xb164('0x3b'),_0xb164('0x3c'))[_0xb164('0x31')](_0x4eb2ee)[_0xb164('0x3d')](_0x5bcfba[_0xb164('0x11')](','))))[_0xb164('0x2c')]();}function handleStop(){logger[_0xb164('0x3e')](_0xb164('0x3f'));stopped=!![];}function handleUncaughtException(_0x3c4b12){logger[_0xb164('0x40')](_0x3c4b12[_0xb164('0x41')]);process[_0xb164('0x42')](0x1);}function handleError(_0x485fca,_0x32e6db){stats[_0xb164('0x43')][_0xb164('0x44')]({'name':_0x32e6db[_0xb164('0x45')],'message':_0x32e6db[_0xb164('0x41')],'row':_0x485fca});}function handleQuery(_0x57a5ca){logger[_0xb164('0x3e')](_0x57a5ca);return db[_0xb164('0x46')]['query'](_0x57a5ca)['spread'](function(_0x49071f){results[_0xb164('0x44')](_0x49071f);})[_0xb164('0x47')](function(_0x37c370){logger[_0xb164('0x40')](_0x37c370[_0xb164('0x41')]);});}function main(_0x4cd23c,_0x528744,_0x3ce966,_0x1d2173){logger['info']('main',_0x4cd23c,JSON[_0xb164('0x48')](_0x528744));process['send'](_0xb164('0x49'));var _0x2c87ad=_0x528744[_0xb164('0x4a')];var _0x43ed28=_0x528744[_0xb164('0x4b')];var _0x34ffe9=path[_0xb164('0x11')](config[_0xb164('0x4c')],_0xb164('0x4d'),_0x43ed28+'.csv');var _0x4b3777=_[_0xb164('0x36')](_0x2c87ad)[_0xb164('0x11')]();logger[_0xb164('0x3e')](_0xb164('0x4e'),_0x4b3777);fs[_0xb164('0x4f')](_0x34ffe9,_0x4b3777+'\x0a');Papa[_0xb164('0x50')](fs[_0xb164('0x51')](_0x4cd23c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1017c2,_0x2b85f8){try{for(var _0x28cca0=0x0,_0x5202e1=[];_0x28cca0<_0x1017c2['data'][_0xb164('0x52')];_0x28cca0++){stats[_0xb164('0x53')]+=0x1;if(_0x1017c2[_0xb164('0x43')][_0x28cca0]){handleError(_0x1017c2[_0xb164('0x54')][_0x28cca0],_0x1017c2[_0xb164('0x43')][_0x28cca0]);}else{var _0x1995fe=[];for(var _0x2039bb in _0x2c87ad){if(_0x2c87ad[_0xb164('0x55')](_0x2039bb)){if(_0x1017c2[_0xb164('0x54')][_0x28cca0][_0x2c87ad[_0x2039bb]]){var _0xdff62a=_[_0xb164('0x56')](_0x1017c2[_0xb164('0x54')][_0x28cca0][_0x2c87ad[_0x2039bb]]['replace'](/"/g,'\x27'));switch(_0x2039bb){case _0xb164('0x57'):var _0x539308=moment(_0xdff62a,_0xb164('0xd'),!![]);if(_0x539308['isValid']()){_0x5202e1[_0xb164('0x44')]('\x22'+_0xdff62a+'\x22');}else{_0x1995fe[_0xb164('0x44')](_0xb164('0x58'));}break;case'priority':var _0x47eebc=parseInt(_0xdff62a);_0xdff62a=_['isNaN'](_0x47eebc)||_0x47eebc<0x0||_0x47eebc>0x4?_0x1d2173?0x3:0x2:_0x47eebc;_0x5202e1[_0xb164('0x44')]('\x22'+_0xdff62a+'\x22');break;case _0xb164('0x22'):var _0x4de442=parseInt(_0xdff62a);if(_[_0xb164('0x59')](_0x4de442)&&_[_0xb164('0x5a')](_0x3ce966,_0x4de442)){_0x5202e1[_0xb164('0x44')]('\x22'+_0x4de442+'\x22');}else{_0x1995fe[_0xb164('0x44')](_0xb164('0x5b'));}break;case _0xb164('0x5c'):if(isEmail(_0xdff62a)){_0x5202e1['push']('\x22'+_0xdff62a+'\x22');}else{_0x1995fe[_0xb164('0x44')](_0xb164('0x5d'));}break;case _0xb164('0x5e'):var _0x47c6b6=moment(_0xdff62a,_0xb164('0x5f'),!![]);if(_0x47c6b6[_0xb164('0x60')]()){_0x5202e1[_0xb164('0x44')]('\x22'+_0xdff62a+'\x22');}else{_0x1995fe[_0xb164('0x44')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5202e1['push']('\x22'+_0xdff62a+'\x22');}}else{switch(_0x2039bb){case'firstName':case _0xb164('0x10'):_0x1995fe[_0xb164('0x44')](_0x2039bb+'\x20not\x20specified');break;default:_0x5202e1[_0xb164('0x44')]('\x22\x22');}}}}if(_0x1995fe[_0xb164('0x52')]){handleError(_0x1017c2[_0xb164('0x54')][_0x28cca0],{'code':_0xb164('0x61'),'message':_0x1995fe['join']()});}else{fs[_0xb164('0x62')](_0x34ffe9,_0x5202e1[_0xb164('0x11')]()+'\x0a');}_0x5202e1=[];}if(!(stats[_0xb164('0x53')]%0xc8)){socket[_0xb164('0x63')](_0xb164('0x64')+_0x43ed28,stats);stats[_0xb164('0x43')]=[];}}if(stopped){logger[_0xb164('0x3e')](_0xb164('0x65'));_0x2b85f8[_0xb164('0x66')]();}}catch(_0x37fca7){handleError(_0x1017c2['data'][_0x28cca0],{'code':'SystemError','message':_0x37fca7['message']});logger['error']('step',_0x37fca7[_0xb164('0x41')]);}},'complete':function(){try{var _0x2c006b=[];var _0x45cfba=_0xb164('0x25');if(_0x528744[_0xb164('0x67')]&&_0x528744[_0xb164('0x67')][_0xb164('0x52')]){_0x45cfba=_0xb164('0x68')+_0x43ed28;_0x2c006b[_0xb164('0x44')](_0xb164('0x69')+_0x45cfba+_0xb164('0x6a'));}var _0x4eaecc=util[_0xb164('0x6b')](_0xb164('0x6c'),_0x34ffe9,_0x45cfba,_0x4b3777,_0x528744['ListId'],_0x528744[_0xb164('0x37')]||null,NOW,NOW);if(_[_0xb164('0x6d')](_0x2c87ad[_0xb164('0x57')])){_0x4eaecc+=',\x20scheduledAt\x20=\x20NOW()';}_0x2c006b['push'](_0x4eaecc);if(_0x528744[_0xb164('0x67')]&&_0x528744[_0xb164('0x67')][_0xb164('0x52')]){_0x2c006b[_0xb164('0x44')](insertCmContact(_0x528744[_0xb164('0x1e')],_0x45cfba,_0x528744[_0xb164('0x67')],_0x2c87ad));_0x2c006b[_0xb164('0x44')]('DROP\x20TABLE\x20'+_0x45cfba+';');}_0x2c006b[_0xb164('0x44')](insertCmHopper(_0x528744[_0xb164('0x1e')],_0xb164('0x6e'),_0xb164('0x6f'),_0xb164('0x70'),_0x1d2173));_0x2c006b[_0xb164('0x44')](insertCmHopperBlack(_0x528744[_0xb164('0x1e')],'voice_queues_has_cm_blacklists',_0xb164('0x6f'),_0xb164('0x70')));_0x2c006b[_0xb164('0x44')](insertCmHopper(_0x528744[_0xb164('0x1e')],_0xb164('0x71'),_0xb164('0x72'),_0xb164('0x73'),_0x1d2173));_0x2c006b[_0xb164('0x44')](insertCmHopperBlack(_0x528744[_0xb164('0x1e')],_0xb164('0x74'),_0xb164('0x72'),_0xb164('0x73')));BPromise[_0xb164('0x75')](_0x2c006b,handleQuery)['then'](function(_0x4a22c2){stats[_0xb164('0x76')]=!![];stats[_0xb164('0x77')]=_0x528744[_0xb164('0x67')]&&_0x528744[_0xb164('0x67')]['length']?results[0x2][_0xb164('0x77')]:results[0x0][_0xb164('0x77')];socket[_0xb164('0x63')](_0xb164('0x64')+_0x43ed28,stats);fs['unlink'](_0x4cd23c);fs[_0xb164('0x78')](_0x34ffe9);process['exit'](0x0);})[_0xb164('0x47')](function(_0x5eebbc){logger[_0xb164('0x40')](_0x5eebbc[_0xb164('0x41')]);process[_0xb164('0x42')](0x1);});}catch(_0x5a68a4){logger['error'](_0xb164('0x79'),_0x5a68a4[_0xb164('0x41')]);process[_0xb164('0x42')](0x1);}},'error':function(_0x20ce3a,_0x2b9823,_0x595e54,_0x30fd0c){throw new Error(_0x30fd0c);}});}function validate(){if(process[_0xb164('0x7a')]&&process['argv'][_0xb164('0x52')]<0x4){throw new Error(_0xb164('0x7b'));}var _0x46bd72=path[_0xb164('0x11')](config['root'],'server/files/tmp',process[_0xb164('0x7a')][0x2]);if(!fs[_0xb164('0x7c')](_0x46bd72)){throw new Error(_0xb164('0x7d'));}var _0x8a0c70={};try{_0x8a0c70=JSON[_0xb164('0x50')](process[_0xb164('0x7a')][0x3]);if(!_0x8a0c70[_0xb164('0x4a')]){throw new Error(_0xb164('0x7e'));}if(!_0x8a0c70[_0xb164('0x4a')][_0xb164('0x10')]){throw new Error(_0xb164('0x7f'));}if(!_0x8a0c70[_0xb164('0x4a')]['firstName']){throw new Error(_0xb164('0x80'));}var _0x1a7b46=0x0;if(_0x8a0c70[_0xb164('0x4a')][_0xb164('0x22')]){_0x1a7b46=0x1;}if(!_0x8a0c70[_0xb164('0x1e')]){throw new Error(_0xb164('0x81'));}}catch(_0x2fcec1){throw new Error(_0xb164('0x82'));}var _0xbcdd45=[];try{_0xbcdd45=_[_0xb164('0x83')](JSON['parse'](process[_0xb164('0x7a')][0x4]),'id');}catch(_0x330a95){logger[_0xb164('0x3e')](_0xb164('0x84'));}main(_0x46bd72,_0x8a0c70,_0xbcdd45,_0x1a7b46);}validate();process['on']('SIGINT',handleStop);process['on'](_0xb164('0x85'),handleUncaughtException); \ No newline at end of file +var _0x7a82=['code','sequelize','query','spread','catch','main','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','length','rows','errors','data','hasOwnProperty','trim','replace','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','isValid','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','then','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','where','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_hopper_black','ContactId','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','push'];(function(_0x4a0066,_0x16fb7e){var _0x611761=function(_0x4c040d){while(--_0x4c040d){_0x4a0066['push'](_0x4a0066['shift']());}};_0x611761(++_0x16fb7e);}(_0x7a82,0xbc));var _0x27a8=function(_0x573087,_0x2d0d09){_0x573087=_0x573087-0x0;var _0x300b0d=_0x7a82[_0x573087];return _0x300b0d;};'use strict';var fs=require('fs');var path=require(_0x27a8('0x0'));var _=require(_0x27a8('0x1'));var Papa=require(_0x27a8('0x2'));var util=require(_0x27a8('0x3'));var BPromise=require(_0x27a8('0x4'));var moment=require(_0x27a8('0x5'));var squel=require('squel');var Redis=require(_0x27a8('0x6'));var db=require(_0x27a8('0x7'))['db'];var config=require(_0x27a8('0x8'));var logger=require('../../../config/logger')('import');config[_0x27a8('0x9')]=_[_0x27a8('0xa')](config[_0x27a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x27a8('0xb'))(new Redis(config[_0x27a8('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x27a8('0xc')](_0x27a8('0xd'));function isEmail(_0x259e0e){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))*$/[_0x27a8('0xe')](_0x259e0e);}function selectNotIn(_0x20f0c6,_0x2808bb,_0x140d8a,_0xb71531,_0x28e45a){return squel[_0x27a8('0xf')]()[_0x27a8('0x10')](_0x27a8('0x11'))[_0x27a8('0x12')](_0xb71531)['join'](_0x2808bb,null,_0x2808bb+_0x27a8('0x13')+_0xb71531+'.'+_0x140d8a)['where'](_0xb71531+'.'+_0x140d8a+_0x27a8('0x14')+_0x20f0c6+'.'+_0x140d8a)[_0x27a8('0x15')](_0x2808bb+'.dialCheckDuplicateType\x20IN\x20('+_0x28e45a[_0x27a8('0x16')]()+')');}function insertCmHopper(_0x137bf5,_0x28761d,_0x236865,_0x48e85c,_0x489aab){var _0x50854f=[_0x27a8('0x17'),_0x27a8('0x18'),'cm_contacts.id',_0x27a8('0x19'),_0x28761d+'.'+_0x48e85c,_0x27a8('0x1a'),'cm_contacts.updatedAt',_0x27a8('0x1b'),_0x27a8('0x1c'),'\x22'+_0x489aab+'\x22'];return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x1f'))[_0x27a8('0x20')]([_0x27a8('0x11'),_0x27a8('0x21'),'ContactId',_0x27a8('0x22'),_0x48e85c,_0x27a8('0x23'),_0x27a8('0x24'),_0x27a8('0x25'),_0x27a8('0x26'),_0x27a8('0x27')],squel[_0x27a8('0xf')]()[_0x27a8('0x28')](_0x50854f)[_0x27a8('0x12')](_0x28761d)['join'](_0x27a8('0x29'),null,_0x27a8('0x2a')+_0x28761d+_0x27a8('0x2b'))[_0x27a8('0x16')](_0x236865,null,_0x236865+_0x27a8('0x13')+_0x28761d+'.'+_0x48e85c)[_0x27a8('0x15')](_0x28761d+_0x27a8('0x2c'),_0x137bf5)[_0x27a8('0x15')](_0x27a8('0x2d'),NOW)[_0x27a8('0x15')](_0x27a8('0x2e'),selectNotIn(_0x28761d,_0x236865,_0x48e85c,'cm_hopper',[_0x27a8('0x2f'),_0x27a8('0x30')]))[_0x27a8('0x15')](_0x27a8('0x2e'),selectNotIn(_0x28761d,_0x236865,_0x48e85c,_0x27a8('0x1f'),[_0x27a8('0x2f')])))[_0x27a8('0x31')]();}function insertCmHopperBlack(_0x175066,_0x56e297,_0x1fedcb,_0x1b670e){var _0x77d92b=[_0x27a8('0x17'),_0x27a8('0x32'),_0x27a8('0x19'),_0x56e297+'.'+_0x1b670e,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x33'))['fromQuery'](['phone',_0x27a8('0x34'),_0x27a8('0x22'),_0x1b670e,'createdAt',_0x27a8('0x24')],squel[_0x27a8('0xf')]()['fields'](_0x77d92b)[_0x27a8('0x12')](_0x56e297)[_0x27a8('0x16')](_0x27a8('0x29'),null,_0x27a8('0x2a')+_0x56e297+'.CmListId')[_0x27a8('0x16')](_0x1fedcb,null,_0x1fedcb+'.id\x20=\x20'+_0x56e297+'.'+_0x1b670e)[_0x27a8('0x15')](_0x56e297+_0x27a8('0x2c'),_0x175066)[_0x27a8('0x15')](_0x27a8('0x2d'),NOW)[_0x27a8('0x15')](_0x27a8('0x2e'),squel['select']()[_0x27a8('0x10')](_0x27a8('0x11'))[_0x27a8('0x12')]('cm_hopper_black')['where'](_0x27a8('0x35'),_0x175066)['where'](_0x1b670e+_0x27a8('0x36'),_0x56e297+'.'+_0x1b670e)))['toString']();}function insertCmContact(_0x2ca1cc,_0x163930,_0x12be89,_0x44a630){var _0x23543d=_['concat'](_[_0x27a8('0x37')](_0x44a630),[_0x27a8('0x22'),_0x27a8('0x38'),'createdAt',_0x27a8('0x24')]);return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x29'))[_0x27a8('0x20')](_0x23543d,squel['select']()['fields'](_0x23543d)['from'](_0x163930)[_0x27a8('0x15')]('('+_0x12be89[_0x27a8('0x16')](',')+_0x27a8('0x39'),squel[_0x27a8('0xf')]()[_0x27a8('0x28')](_0x12be89)[_0x27a8('0x12')](_0x27a8('0x29'))[_0x27a8('0x15')](_0x27a8('0x35'),_0x2ca1cc)[_0x27a8('0x15')](_0x27a8('0x3a')))[_0x27a8('0x15')](_0x27a8('0x3b'),squel[_0x27a8('0xf')]()[_0x27a8('0x10')](_0x27a8('0x3c'),_0x27a8('0x3d'))['from'](_0x163930)[_0x27a8('0x3e')](_0x12be89['join'](','))))[_0x27a8('0x31')]();}function handleStop(){logger[_0x27a8('0x3f')](_0x27a8('0x40'));stopped=!![];}function handleUncaughtException(_0xbefc60){logger[_0x27a8('0x41')](_0xbefc60[_0x27a8('0x42')]);process['exit'](0x1);}function handleError(_0x182b5c,_0x153d70){stats['errors'][_0x27a8('0x43')]({'name':_0x153d70[_0x27a8('0x44')],'message':_0x153d70['message'],'row':_0x182b5c});}function handleQuery(_0x182a1){logger[_0x27a8('0x3f')](_0x182a1);return db[_0x27a8('0x45')][_0x27a8('0x46')](_0x182a1)[_0x27a8('0x47')](function(_0x3d4c11){results['push'](_0x3d4c11);})[_0x27a8('0x48')](function(_0xba14b9){logger[_0x27a8('0x41')](_0xba14b9[_0x27a8('0x42')]);});}function main(_0x531380,_0x59209c,_0x323b33,_0x2e80b4){logger[_0x27a8('0x3f')](_0x27a8('0x49'),_0x531380,JSON[_0x27a8('0x4a')](_0x59209c));process['send']('start');var _0x4586d5=_0x59209c[_0x27a8('0x4b')];var _0x1fa784=_0x59209c[_0x27a8('0x4c')];var _0x4bb46d=path['join'](config[_0x27a8('0x4d')],_0x27a8('0x4e'),_0x1fa784+_0x27a8('0x4f'));var _0x86436a=_[_0x27a8('0x37')](_0x4586d5)[_0x27a8('0x16')]();logger[_0x27a8('0x3f')]('header',_0x86436a);fs[_0x27a8('0x50')](_0x4bb46d,_0x86436a+'\x0a');Papa[_0x27a8('0x51')](fs[_0x27a8('0x52')](_0x531380),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1350f6,_0x315cc2){try{for(var _0x592297=0x0,_0x3bdfab=[];_0x592297<_0x1350f6['data'][_0x27a8('0x53')];_0x592297++){stats[_0x27a8('0x54')]+=0x1;if(_0x1350f6[_0x27a8('0x55')][_0x592297]){handleError(_0x1350f6[_0x27a8('0x56')][_0x592297],_0x1350f6['errors'][_0x592297]);}else{var _0xbbf321=[];for(var _0x386d1d in _0x4586d5){if(_0x4586d5[_0x27a8('0x57')](_0x386d1d)){if(_0x1350f6[_0x27a8('0x56')][_0x592297][_0x4586d5[_0x386d1d]]){var _0x3a5031=_[_0x27a8('0x58')](_0x1350f6['data'][_0x592297][_0x4586d5[_0x386d1d]][_0x27a8('0x59')](/"/g,'\x27'));switch(_0x386d1d){case _0x27a8('0x21'):var _0x3f1861=moment(_0x3a5031,_0x27a8('0xd'),!![]);if(_0x3f1861['isValid']()){_0x3bdfab['push']('\x22'+_0x3a5031+'\x22');}else{_0xbbf321['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x27a8('0x25'):var _0x276e30=parseInt(_0x3a5031);_0x3a5031=_[_0x27a8('0x5a')](_0x276e30)||_0x276e30<0x0||_0x276e30>0x4?_0x2e80b4?0x3:0x2:_0x276e30;_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');break;case'UserId':var _0x45953f=parseInt(_0x3a5031);if(_[_0x27a8('0x5b')](_0x45953f)&&_['includes'](_0x323b33,_0x45953f)){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x45953f+'\x22');}else{_0xbbf321['push'](_0x27a8('0x5c'));}break;case _0x27a8('0x5d'):if(isEmail(_0x3a5031)){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}else{_0xbbf321[_0x27a8('0x43')](_0x27a8('0x5e'));}break;case'dateOfBirth':var _0x360af2=moment(_0x3a5031,'YYYY-MM-DD',!![]);if(_0x360af2[_0x27a8('0x5f')]()){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}else{_0xbbf321[_0x27a8('0x43')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}}else{switch(_0x386d1d){case _0x27a8('0x60'):case _0x27a8('0x11'):_0xbbf321['push'](_0x386d1d+_0x27a8('0x61'));break;default:_0x3bdfab[_0x27a8('0x43')]('\x22\x22');}}}}if(_0xbbf321[_0x27a8('0x53')]){handleError(_0x1350f6['data'][_0x592297],{'code':_0x27a8('0x62'),'message':_0xbbf321['join']()});}else{fs[_0x27a8('0x63')](_0x4bb46d,_0x3bdfab[_0x27a8('0x16')]()+'\x0a');}_0x3bdfab=[];}if(!(stats[_0x27a8('0x54')]%0xc8)){socket[_0x27a8('0x64')](_0x27a8('0x65')+_0x1fa784,stats);stats['errors']=[];}}if(stopped){logger[_0x27a8('0x3f')](_0x27a8('0x66'));_0x315cc2[_0x27a8('0x67')]();}}catch(_0x37fde8){handleError(_0x1350f6['data'][_0x592297],{'code':'SystemError','message':_0x37fde8['message']});logger[_0x27a8('0x41')](_0x27a8('0x68'),_0x37fde8[_0x27a8('0x42')]);}},'complete':function(){try{var _0x18809b=[];var _0x2867e5=_0x27a8('0x29');if(_0x59209c[_0x27a8('0x69')]&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]){_0x2867e5=_0x27a8('0x6a')+_0x1fa784;_0x18809b[_0x27a8('0x43')]('CREATE\x20TABLE\x20'+_0x2867e5+'\x20LIKE\x20cm_contacts;');}var _0x439f4d=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4bb46d,_0x2867e5,_0x86436a,_0x59209c[_0x27a8('0x22')],_0x59209c['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x4586d5[_0x27a8('0x21')])){_0x439f4d+=_0x27a8('0x6b');}_0x18809b[_0x27a8('0x43')](_0x439f4d);if(_0x59209c[_0x27a8('0x69')]&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]){_0x18809b['push'](insertCmContact(_0x59209c[_0x27a8('0x22')],_0x2867e5,_0x59209c[_0x27a8('0x69')],_0x4586d5));_0x18809b[_0x27a8('0x43')](_0x27a8('0x6c')+_0x2867e5+';');}_0x18809b[_0x27a8('0x43')](insertCmHopper(_0x59209c['ListId'],'voice_queues_has_cm_lists',_0x27a8('0x6d'),_0x27a8('0x6e'),_0x2e80b4));_0x18809b[_0x27a8('0x43')](insertCmHopperBlack(_0x59209c['ListId'],_0x27a8('0x6f'),'voice_queues',_0x27a8('0x6e')));_0x18809b[_0x27a8('0x43')](insertCmHopper(_0x59209c[_0x27a8('0x22')],'campaigns_has_cm_lists',_0x27a8('0x70'),_0x27a8('0x71'),_0x2e80b4));_0x18809b['push'](insertCmHopperBlack(_0x59209c[_0x27a8('0x22')],'campaigns_has_cm_blacklists',_0x27a8('0x70'),_0x27a8('0x71')));BPromise['each'](_0x18809b,handleQuery)[_0x27a8('0x72')](function(_0x34aa80){stats['finish']=!![];stats[_0x27a8('0x73')]=_0x59209c['duplicates']&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]?results[0x2][_0x27a8('0x73')]:results[0x0]['affectedRows'];socket[_0x27a8('0x64')](_0x27a8('0x65')+_0x1fa784,stats);fs[_0x27a8('0x74')](_0x531380);fs[_0x27a8('0x74')](_0x4bb46d);process[_0x27a8('0x75')](0x0);})[_0x27a8('0x48')](function(_0x443550){logger[_0x27a8('0x41')](_0x443550[_0x27a8('0x42')]);process[_0x27a8('0x75')](0x1);});}catch(_0x32a78f){logger['error'](_0x27a8('0x76'),_0x32a78f[_0x27a8('0x42')]);process['exit'](0x1);}},'error':function(_0x4f9081,_0x30068d,_0x57b2a7,_0x25d346){throw new Error(_0x25d346);}});}function validate(){if(process[_0x27a8('0x77')]&&process[_0x27a8('0x77')]['length']<0x4){throw new Error(_0x27a8('0x78'));}var _0x3c7fd4=path['join'](config[_0x27a8('0x4d')],_0x27a8('0x4e'),process['argv'][0x2]);if(!fs['existsSync'](_0x3c7fd4)){throw new Error(_0x27a8('0x79'));}var _0x2073a2={};try{_0x2073a2=JSON[_0x27a8('0x51')](process[_0x27a8('0x77')][0x3]);if(!_0x2073a2[_0x27a8('0x4b')]){throw new Error(_0x27a8('0x7a'));}if(!_0x2073a2[_0x27a8('0x4b')][_0x27a8('0x11')]){throw new Error(_0x27a8('0x7b'));}if(!_0x2073a2['binding']['firstName']){throw new Error(_0x27a8('0x7c'));}var _0x180698=0x0;if(_0x2073a2[_0x27a8('0x4b')]['UserId']){_0x180698=0x1;}if(!_0x2073a2['ListId']){throw new Error(_0x27a8('0x7d'));}}catch(_0x56604a){throw new Error(_0x27a8('0x7e'));}var _0x4d6fb6=[];try{_0x4d6fb6=_['map'](JSON[_0x27a8('0x51')](process['argv'][0x4]),'id');}catch(_0x3accad){logger['info'](_0x27a8('0x7f'));}main(_0x3c7fd4,_0x2073a2,_0x4d6fb6,_0x180698);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e41a4ad..1e3c388 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff16=['inbound','variable','push','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','voice','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','uniqueid','Date','agentcalledAt','Agent\x20Name','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Member\x20Name','membername','UniqueId','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase'];(function(_0x1012c1,_0x251951){var _0x580111=function(_0x4999){while(--_0x4999){_0x1012c1['push'](_0x1012c1['shift']());}};_0x580111(++_0x251951);}(_0xff16,0xad));var _0x6ff1=function(_0x1b3fb6,_0x1e60d0){_0x1b3fb6=_0x1b3fb6-0x0;var _0x56d137=_0xff16[_0x1b3fb6];return _0x56d137;};'use strict';exports[_0x6ff1('0x0')]=function(_0x2298f4,_0x45f770){var _0x3408c2=[{'type':'string','content':_0x6ff1('0x1'),'variableName':null}];switch(_0x2298f4[_0x6ff1('0x2')]()){case'voice':switch(_0x45f770[_0x6ff1('0x2')]()){case _0x6ff1('0x3'):_0x3408c2['push']({'type':_0x6ff1('0x4'),'content':'','variableName':'queue'});_0x3408c2[_0x6ff1('0x5')]({'type':_0x6ff1('0x4'),'content':'','variableName':_0x6ff1('0x6')});break;case _0x6ff1('0x7'):_0x3408c2[_0x6ff1('0x5')]({'type':_0x6ff1('0x8'),'content':_0x6ff1('0x9'),'variableName':null});_0x3408c2[_0x6ff1('0x5')]({'type':_0x6ff1('0x4'),'content':'','variableName':_0x6ff1('0xa')});break;}}return _0x3408c2;};exports['getDescriptions']=function(_0x41c1d0,_0x544162){var _0x4dcef6=[];switch(_0x41c1d0[_0x6ff1('0x2')]()){case _0x6ff1('0xb'):switch(_0x544162[_0x6ff1('0x2')]()){case _0x6ff1('0x3'):_0x4dcef6=[{'type':_0x6ff1('0x8'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x6ff1('0xc'),'keyType':_0x6ff1('0x4'),'variableName':'calleridnum'},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0xe'),'keyType':'variable','variableName':_0x6ff1('0xf')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x10'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x11')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x12'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x13')},{'type':_0x6ff1('0xd'),'content':'','key':'UniqueId','keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x14')},{'type':'keyValue','content':'','key':_0x6ff1('0x15'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x16')},{'type':_0x6ff1('0x8'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x6ff1('0x17'),'keyType':_0x6ff1('0x4'),'variableName':'destcalleridname'},{'type':_0x6ff1('0xd'),'content':'','key':'Agent\x20Number','keyType':_0x6ff1('0x4'),'variableName':'destcalleridnum'},{'type':_0x6ff1('0x8'),'content':_0x6ff1('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x6ff1('0x19'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x16')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x1a'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x1b')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x1c'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x1d')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x1e'),'keyType':_0x6ff1('0x4'),'variableName':_0x6ff1('0x1f')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x20'),'keyType':_0x6ff1('0x4'),'variableName':'talktime'}];break;case _0x6ff1('0x7'):_0x4dcef6=[{'type':_0x6ff1('0x8'),'content':_0x6ff1('0x21'),'variableName':null},{'type':_0x6ff1('0xd'),'content':'','key':'Called\x20Number','keyType':_0x6ff1('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x22'),'keyType':'variable','keyContent':'','variableName':_0x6ff1('0x23')},{'type':'keyValue','content':'','key':_0x6ff1('0x24'),'keyType':_0x6ff1('0x4'),'keyContent':'','variableName':_0x6ff1('0x14')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x15'),'keyType':_0x6ff1('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0x6ff1('0x8'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x25'),'keyType':_0x6ff1('0x4'),'keyContent':'','variableName':_0x6ff1('0x26')},{'type':'keyValue','content':'','key':_0x6ff1('0x27'),'keyType':_0x6ff1('0x4'),'keyContent':'','variableName':_0x6ff1('0x28')},{'type':_0x6ff1('0xd'),'content':'','key':_0x6ff1('0x29'),'keyType':_0x6ff1('0x4'),'keyContent':'','variableName':_0x6ff1('0x2a')},{'type':_0x6ff1('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x6ff1('0x4'),'keyContent':'','variableName':_0x6ff1('0x2b')}];break;}}return _0x4dcef6;}; \ No newline at end of file +var _0xe98a=['getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','UniqueId','Date','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Member\x20Name','membername','uniqueid','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds'];(function(_0x17ab69,_0x531650){var _0x366e83=function(_0x418485){while(--_0x418485){_0x17ab69['push'](_0x17ab69['shift']());}};_0x366e83(++_0x531650);}(_0xe98a,0x7e));var _0xae98=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xe98a[_0x1f83a5];return _0x45edf0;};'use strict';exports[_0xae98('0x0')]=function(_0x207271,_0x357b13){var _0xbfbf37=[{'type':_0xae98('0x1'),'content':_0xae98('0x2'),'variableName':null}];switch(_0x207271['toLowerCase']()){case _0xae98('0x3'):switch(_0x357b13[_0xae98('0x4')]()){case _0xae98('0x5'):_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':'queue'});_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':_0xae98('0x8')});break;case _0xae98('0x9'):_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x1'),'content':'Outbound\x20Call','variableName':null});_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':_0xae98('0xa')});break;}}return _0xbfbf37;};exports[_0xae98('0xb')]=function(_0x21dff0,_0x5c8c33){var _0x477ddd=[];switch(_0x21dff0['toLowerCase']()){case _0xae98('0x3'):switch(_0x5c8c33['toLowerCase']()){case _0xae98('0x5'):_0x477ddd=[{'type':_0xae98('0x1'),'content':_0xae98('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0xe'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x8')},{'type':_0xae98('0xd'),'content':'','key':'Caller\x20Name','keyType':_0xae98('0x7'),'variableName':_0xae98('0xf')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x10'),'keyType':'variable','variableName':_0xae98('0x11')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x12'),'keyType':'variable','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xae98('0x13'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xae98('0xd'),'content':'','key':'Agent\x20Name','keyType':_0xae98('0x7'),'variableName':_0xae98('0x14')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x15'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0xa')},{'type':'string','content':_0xae98('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xae98('0x17'),'keyType':'variable','variableName':_0xae98('0x18')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x19'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x1a')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x1b'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x1c')},{'type':_0xae98('0xd'),'content':'','key':'Hold\x20Time','keyType':_0xae98('0x7'),'variableName':_0xae98('0x1d')},{'type':_0xae98('0xd'),'content':'','key':'Talk\x20Time','keyType':_0xae98('0x7'),'variableName':_0xae98('0x1e')}];break;case _0xae98('0x9'):_0x477ddd=[{'type':_0xae98('0x1'),'content':_0xae98('0xc'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0xa')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x1f'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x20')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x12'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x21')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x13'),'keyType':'variable','keyContent':'','variableName':_0xae98('0x22')},{'type':'string','content':_0xae98('0x16')},{'type':_0xae98('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xae98('0x23')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x24'),'keyType':'variable','keyContent':'','variableName':_0xae98('0x25')},{'type':'keyValue','content':'','key':_0xae98('0x26'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x27')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x28'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x29')}];break;}}return _0x477ddd;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 7a5e113..9391757 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd13=['info','tracked','user','query','body','html','phone','fax','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then'];(function(_0x5bc678,_0x49b8fc){var _0x3ea263=function(_0x2c5d01){while(--_0x2c5d01){_0x5bc678['push'](_0x5bc678['shift']());}};_0x3ea263(++_0x49b8fc);}(_0xcd13,0xbe));var _0x3cd1=function(_0x58de95,_0x4fc3ea){_0x58de95=_0x58de95-0x0;var _0x540403=_0xcd13[_0x58de95];return _0x540403;};'use strict';var _=require('lodash');var db=require(_0x3cd1('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x3cd1('0x1')),'mail':require('../../config/logger')(_0x3cd1('0x2')),'fax':require(_0x3cd1('0x3'))(_0x3cd1('0x4')),'sms':require(_0x3cd1('0x3'))('sms-interactions'),'chat':require(_0x3cd1('0x3'))(_0x3cd1('0x5')),'whatsapp':require(_0x3cd1('0x3'))('whatsapp-interactions')};function getInteractionId(_0x507bcf,_0x3bb075,_0xe57003){if(_0x507bcf&&_0x507bcf[_['upperFirst'](_0xe57003)+'InteractionId']){return _0x507bcf[_[_0x3cd1('0x6')](_0xe57003)+_0x3cd1('0x7')];}else if(_0x507bcf&&_0x507bcf['id']){return _0x507bcf['id'];}else if(_0x3bb075&&_0x3bb075['id']){return _0x3bb075['id'];}else{return _0x3cd1('0x8');}}function log(_0x26628f,_0x353283,_0x537ce7,_0x386746,_0x2b617f,_0x4e136a){loggers[_0x2b617f['toLowerCase']()][_0x26628f](_0x3cd1('0x9'),_0x4e136a[_0x3cd1('0xa')](),_0x353283?_0x353283['id']:null,_0x353283?_0x353283[_0x3cd1('0xb')]:null,_0x353283?_0x353283[_0x3cd1('0xc')]:null,getInteractionId(_0x537ce7,_0x386746,_0x2b617f),_0x537ce7?JSON[_0x3cd1('0xd')](_0x537ce7):_0x3cd1('0xe'));}function updateUser(_0x5e8d51,_0x1ff7e0,_0x42ba3a,_0xad8524,_0x115e84){db[_[_0x3cd1('0x6')](_0xad8524)+_0x3cd1('0xf')][_0x3cd1('0x10')]({'where':{'id':getInteractionId(_0x1ff7e0,_0x42ba3a,_0xad8524)}})[_0x3cd1('0x11')](function(_0x135bde){if(_0x135bde){return _0x135bde['update']({'UserId':_0x5e8d51?_0x5e8d51['id']:null});}})[_0x3cd1('0x11')](function(_0x18f3ff){if(_0x18f3ff){log(_0x3cd1('0x12'),_0x5e8d51,_0x1ff7e0,_0x42ba3a,_0xad8524,_0x115e84);}})['catch'](function(){log('error',_0x5e8d51,_0x1ff7e0,_0x42ba3a,_0xad8524,_0x115e84);});}exports[_0x3cd1('0x13')]=function(_0x4f4034,_0x10eff4){return function(_0x443559,_0x526182,_0x58ca38){var _0x15ab32=_0x443559[_0x3cd1('0x14')];var _0x3f98b8={};var _0xf4d618=_0x443559[_0x3cd1('0x15')];if(_0x3f98b8){_0x3f98b8=_['clone'](_0x443559[_0x3cd1('0x16')]);_0x3f98b8=_['omit'](_0x3f98b8,[_0x3cd1('0x16'),_0x3cd1('0x17'),_0x3cd1('0x18'),_0x3cd1('0x19'),'mobile']);}updateUser(_0x15ab32,_0x3f98b8,_0xf4d618,_0x4f4034,_0x10eff4);_0x58ca38(null);};}; \ No newline at end of file +var _0x275f=['role','stringify','null','findOne','then','update','info','catch','error','tracked','user','body','html','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','InteractionId','upperFirst','unknown','toLowerCase','toUpperCase','name'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x275f,0x193));var _0xf275=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x275f[_0x715d76];return _0x48fe88;};'use strict';var _=require(_0xf275('0x0'));var db=require(_0xf275('0x1'))['db'];var loggers={'openchannel':require(_0xf275('0x2'))(_0xf275('0x3')),'mail':require('../../config/logger')(_0xf275('0x4')),'fax':require('../../config/logger')(_0xf275('0x5')),'sms':require(_0xf275('0x2'))(_0xf275('0x6')),'chat':require(_0xf275('0x2'))('chat-interactions'),'whatsapp':require(_0xf275('0x2'))('whatsapp-interactions')};function getInteractionId(_0x1ded5d,_0x329843,_0x419281){if(_0x1ded5d&&_0x1ded5d[_['upperFirst'](_0x419281)+_0xf275('0x7')]){return _0x1ded5d[_[_0xf275('0x8')](_0x419281)+_0xf275('0x7')];}else if(_0x1ded5d&&_0x1ded5d['id']){return _0x1ded5d['id'];}else if(_0x329843&&_0x329843['id']){return _0x329843['id'];}else{return _0xf275('0x9');}}function log(_0x2a88e1,_0x46aa34,_0x2af4fa,_0x521dc7,_0xa885f7,_0x199387){loggers[_0xa885f7[_0xf275('0xa')]()][_0x2a88e1]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x199387[_0xf275('0xb')](),_0x46aa34?_0x46aa34['id']:null,_0x46aa34?_0x46aa34[_0xf275('0xc')]:null,_0x46aa34?_0x46aa34[_0xf275('0xd')]:null,getInteractionId(_0x2af4fa,_0x521dc7,_0xa885f7),_0x2af4fa?JSON[_0xf275('0xe')](_0x2af4fa):_0xf275('0xf'));}function updateUser(_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521){db[_[_0xf275('0x8')](_0x4d64e2)+'Interaction'][_0xf275('0x10')]({'where':{'id':getInteractionId(_0x4e8385,_0x12379f,_0x4d64e2)}})[_0xf275('0x11')](function(_0x1bff13){if(_0x1bff13){return _0x1bff13[_0xf275('0x12')]({'UserId':_0x3bdb4c?_0x3bdb4c['id']:null});}})[_0xf275('0x11')](function(_0x1e374e){if(_0x1e374e){log(_0xf275('0x13'),_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521);}})[_0xf275('0x14')](function(){log(_0xf275('0x15'),_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521);});}exports[_0xf275('0x16')]=function(_0x5ec890,_0x4d9a87){return function(_0x59fdec,_0x175b4d,_0x5e5319){var _0x5e3f1b=_0x59fdec[_0xf275('0x17')];var _0x1a32b2={};var _0x2016c0=_0x59fdec['query'];if(_0x1a32b2){_0x1a32b2=_['clone'](_0x59fdec[_0xf275('0x18')]);_0x1a32b2=_['omit'](_0x1a32b2,[_0xf275('0x18'),_0xf275('0x19'),'phone','fax','mobile']);}updateUser(_0x5e3f1b,_0x1a32b2,_0x2016c0,_0x5ec890,_0x4d9a87);_0x5e5319(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 529446f..d412732 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 _0x26ad=['data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','count','json','users','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x26ad,0x128));var _0xd26a=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x26ad[_0x204eb7];return _0x37e444;};'use strict';var crypto=require('crypto');var util=require(_0xd26a('0x0'));var compose=require(_0xd26a('0x1'));var db=require(_0xd26a('0x2'))['db'];var config=require(_0xd26a('0x3'));function getValueFromLicense(_0x2ce2a8,_0x2a66c8){if(_0x2ce2a8&&_0x2a66c8){if(_0x2a66c8[_0xd26a('0x4')]&&_0x2a66c8['license']){var _0x48ab40=_0x2a66c8[_0xd26a('0x4')];var _0x3a35ba=_0x2a66c8[_0xd26a('0x5')];var _0x1d8bea=_0x48ab40[_0xd26a('0x6')]('-')[0x4];var _0x5e8fdf=_0x48ab40[_0xd26a('0x6')]('-')[0x0];var _0xf9a05d=crypto['createDecipher'](_0xd26a('0x7'),util[_0xd26a('0x8')](_0xd26a('0x9'),_0x1d8bea,_0x48ab40,_0x5e8fdf));var _0xec9ff5=_0xf9a05d[_0xd26a('0xa')](_0x3a35ba,_0xd26a('0xb'),_0xd26a('0xc'));_0xec9ff5+=_0xf9a05d[_0xd26a('0xd')](_0xd26a('0xc'));var _0x421fbc=JSON[_0xd26a('0xe')](_0xec9ff5);return _0x421fbc['hasOwnProperty'](_0x2ce2a8)?_0x421fbc[_0x2ce2a8]:null;}}return null;}function isLimit(_0x31e403,_0x4ef511,_0x4ab668,_0x5c28ea){var _0x565a76=_0x4ef511;return compose()[_0xd26a('0xf')](function(_0xa4fe30,_0x2b1884,_0x4ece87){return db[_0xd26a('0x10')][_0xd26a('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x58c1a8){var _0x519fc9=getValueFromLicense(_0x31e403,_0x58c1a8);return _0x519fc9?_0x519fc9:_0x565a76;})[_0xd26a('0x12')](function(_0x1a099a){_0x565a76=_0x1a099a;return _0x4ab668[_0xd26a('0x13')](_0x5c28ea);})['then'](function(_0x811f2f){if(_0x811f2f>=_0x565a76){return _0x2b1884['status'](0x193)[_0xd26a('0x14')]({'message':util[_0xd26a('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x31e403)});}_0x4ece87();})['catch'](function(_0x231c30){_0x4ece87(_0x231c30);});});}function isUserLimit(){return isLimit(_0xd26a('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0xd26a('0x16')},{'role':_0xd26a('0x17')}]}});}exports[_0xd26a('0x18')]=isUserLimit; \ No newline at end of file +var _0x885a=['status','admin','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','then','count'];(function(_0x3bc89f,_0x317b1a){var _0x1c764c=function(_0x22fec1){while(--_0x22fec1){_0x3bc89f['push'](_0x3bc89f['shift']());}};_0x1c764c(++_0x317b1a);}(_0x885a,0x14d));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0xa885('0x0'));var util=require('util');var compose=require(_0xa885('0x1'));var db=require(_0xa885('0x2'))['db'];var config=require(_0xa885('0x3'));function getValueFromLicense(_0x5a7411,_0x44b41d){if(_0x5a7411&&_0x44b41d){if(_0x44b41d[_0xa885('0x4')]&&_0x44b41d[_0xa885('0x5')]){var _0x177cd5=_0x44b41d[_0xa885('0x4')];var _0x119686=_0x44b41d[_0xa885('0x5')];var _0x5ac179=_0x177cd5['split']('-')[0x4];var _0x2a136c=_0x177cd5['split']('-')[0x0];var _0x2bb864=crypto[_0xa885('0x6')](_0xa885('0x7'),util[_0xa885('0x8')](_0xa885('0x9'),_0x5ac179,_0x177cd5,_0x2a136c));var _0x70a8ab=_0x2bb864['update'](_0x119686,_0xa885('0xa'),_0xa885('0xb'));_0x70a8ab+=_0x2bb864[_0xa885('0xc')]('utf8');var _0x315064=JSON[_0xa885('0xd')](_0x70a8ab);return _0x315064[_0xa885('0xe')](_0x5a7411)?_0x315064[_0x5a7411]:null;}}return null;}function isLimit(_0xadc12f,_0x3b4371,_0x311fcf,_0x19371d){var _0xf5985a=_0x3b4371;return compose()[_0xa885('0xf')](function(_0x5f2c20,_0x53fa32,_0x10859d){return db[_0xa885('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xa885('0x11')](function(_0x3a5274){var _0x15e6c9=getValueFromLicense(_0xadc12f,_0x3a5274);return _0x15e6c9?_0x15e6c9:_0xf5985a;})[_0xa885('0x11')](function(_0x13fbd6){_0xf5985a=_0x13fbd6;return _0x311fcf[_0xa885('0x12')](_0x19371d);})[_0xa885('0x11')](function(_0x4355e5){if(_0x4355e5>=_0xf5985a){return _0x53fa32[_0xa885('0x13')](0x193)['json']({'message':util[_0xa885('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xadc12f)});}_0x10859d();})['catch'](function(_0x4fd721){_0x10859d(_0x4fd721);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0xa885('0x14')},{'role':'user'}]}});}exports[_0xa885('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 23ee311..5aca7c1 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 _0x7cfc=['field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','start','$startsWith','$endsWith','DATE','utcOffset','format','add','minutes','seconds','lodash','moment','parseSearch','startsWith','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push','operator','$between','value','includes','$gt','$lte','days','castTo','CAST('];(function(_0x59ec0c,_0x44f64d){var _0x1490ab=function(_0x5bf807){while(--_0x5bf807){_0x59ec0c['push'](_0x59ec0c['shift']());}};_0x1490ab(++_0x44f64d);}(_0x7cfc,0x19e));var _0xc7cf=function(_0x29c1c0,_0x4b9049){_0x29c1c0=_0x29c1c0-0x0;var _0x31f4ac=_0x7cfc[_0x29c1c0];return _0x31f4ac;};'use strict';var _=require(_0xc7cf('0x0'));var moment=require(_0xc7cf('0x1'));exports[_0xc7cf('0x2')]=function(_0x3db963){var _0x1fee08={'conditions':[]};_0x1fee08['sqlOperator']=_[_0xc7cf('0x3')](_0x3db963,'[$or]')?'or':_0xc7cf('0x4');var _0x4859fa=_0x3db963[_0xc7cf('0x5')](_0xc7cf('0x6'),'')[_0xc7cf('0x5')]('[$or]','')[_0xc7cf('0x7')]('||');for(var _0x433ba0=0x0;_0x433ba0<_0x4859fa[_0xc7cf('0x8')];_0x433ba0++){var _0x496970=_0x4859fa[_0x433ba0][_0xc7cf('0x7')](':=');var _0x1eb550=_0x496970[0x0];var _0x5ad727=_0x496970[_0xc7cf('0x9')](0x1);_0x5ad727[_0xc7cf('0xa')](function(_0x52197b){var _0x26df3e=_0x52197b['split']('[')[_0xc7cf('0xb')]();var _0xfe3885=_0x52197b[_0xc7cf('0xc')](/\[(.*?)\]/g);_0xfe3885[_0xc7cf('0xa')](function(_0x36e257){var _0x4a90b4=_0x36e257[_0xc7cf('0x7')]('[')[_0xc7cf('0xd')](function(_0x59b15a){return _0x59b15a[_0xc7cf('0xe')](']')>-0x1;})['map'](function(_0x262100){return _0x262100[_0xc7cf('0x7')](']')[0x0];})[0x0];_0x1fee08[_0xc7cf('0xf')][_0xc7cf('0x10')]({'field':_0x1eb550,'operator':_0x26df3e,'value':_0x4a90b4});});});}return _0x1fee08;};exports['buildExpression']=function(_0x4e8e90,_0x37bc6f,_0x30a508){var _0x374292={};if(_0x37bc6f==='DATE'){if(_0x30a508[_0xc7cf('0x11')]==='$eq'){_0x30a508['operator']=_0xc7cf('0x12');_0x30a508[_0xc7cf('0x13')]+=','+_0x30a508[_0xc7cf('0x13')];}else if(_[_0xc7cf('0x14')]([_0xc7cf('0x15'),_0xc7cf('0x16')],_0x30a508[_0xc7cf('0x11')])){_0x30a508['value']=moment(_0x30a508[_0xc7cf('0x13')])['add'](0x1,_0xc7cf('0x17'))['format']('YYYY-MM-DD');}}if(_0x30a508[_0xc7cf('0x18')]){_0x37bc6f=_0x30a508[_0xc7cf('0x18')];_0x374292['text']=_0xc7cf('0x19')+_0x4e8e90+'.'+_0x30a508[_0xc7cf('0x1a')]+_0xc7cf('0x1b')+_0x30a508['castTo']+')\x20'+parseOperator(_0x30a508['operator']);}else{_0x374292[_0xc7cf('0x1c')]=_0x4e8e90+'.'+_0x30a508[_0xc7cf('0x1a')]+'\x20'+parseOperator(_0x30a508['operator']);}if(_[_0xc7cf('0x14')]([_0xc7cf('0x1d'),_0xc7cf('0x1e')],_0x30a508[_0xc7cf('0x11')]))_0x374292[_0xc7cf('0x1c')]='('+_0x374292[_0xc7cf('0x1c')]+_0xc7cf('0x1f')+_0x4e8e90+'.'+_0x30a508[_0xc7cf('0x1a')]+_0xc7cf('0x20');_0x374292['value']=parseValue(_0x37bc6f,_0x30a508[_0xc7cf('0x11')],_0x30a508[_0xc7cf('0x13')]);return _0x374292;};function parseOperator(_0x45130e){var _0x46ec9d;switch(_0x45130e){case _0xc7cf('0x21'):_0x46ec9d=_0xc7cf('0x22');break;case _0xc7cf('0x1e'):_0x46ec9d=_0xc7cf('0x23');break;case _0xc7cf('0x24'):_0x46ec9d=_0xc7cf('0x25');break;case _0xc7cf('0x1d'):_0x46ec9d=_0xc7cf('0x26');break;case _0xc7cf('0x27'):case'$startsWith':case'$endsWith':_0x46ec9d=_0xc7cf('0x28');break;case _0xc7cf('0x29'):_0x46ec9d=_0xc7cf('0x2a');break;case _0xc7cf('0x15'):_0x46ec9d=_0xc7cf('0x2b');break;case _0xc7cf('0x16'):_0x46ec9d=_0xc7cf('0x2c');break;case'$gte':_0x46ec9d=_0xc7cf('0x2d');break;case _0xc7cf('0x12'):_0x46ec9d='BETWEEN\x20?\x20AND\x20?';break;}return _0x46ec9d;}function parseValue(_0x2ca776,_0x4c39eb,_0x548d87){var _0x42c8db={'start':undefined,'end':undefined};switch(_0x4c39eb){case _0xc7cf('0x21'):case _0xc7cf('0x1e'):_0x42c8db[_0xc7cf('0x2e')]=_0x548d87[_0xc7cf('0x7')](',');break;case _0xc7cf('0x27'):_0x42c8db[_0xc7cf('0x2e')]='%'+_0x548d87+'%';break;case _0xc7cf('0x2f'):_0x42c8db[_0xc7cf('0x2e')]=_0x548d87+'%';break;case _0xc7cf('0x30'):_0x42c8db[_0xc7cf('0x2e')]='%'+_0x548d87;break;case _0xc7cf('0x12'):var _0x5b5a63=_0x548d87[_0xc7cf('0x7')](',');var _0x548d87=_0x5b5a63[_0xc7cf('0xb')]();var _0xa0d74a=_0x5b5a63['pop']();if(_0x2ca776===_0xc7cf('0x31')){_0x548d87=moment(_0x548d87)[_0xc7cf('0x32')](0x0,!![])[_0xc7cf('0x33')]();_0xa0d74a=moment(_0xa0d74a)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0xc7cf('0x34')](0x3b,_0xc7cf('0x35'))[_0xc7cf('0x34')](0x3b,_0xc7cf('0x36'))[_0xc7cf('0x33')]();}_0x42c8db={'start':_0x548d87,'end':_0xa0d74a};break;default:_0x42c8db[_0xc7cf('0x2e')]=_0x548d87;break;}return _0x42c8db;} \ No newline at end of file +var _0xace4=['pop','DATE','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','conditions','push','$eq','operator','$between','includes','$gt','$lte','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','$substring','shift'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xace4,0x75));var _0x4ace=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xace4[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x4ace('0x0'));var moment=require('moment');exports[_0x4ace('0x1')]=function(_0x21c61f){var _0x582c82={'conditions':[]};_0x582c82[_0x4ace('0x2')]=_[_0x4ace('0x3')](_0x21c61f,_0x4ace('0x4'))?'or':_0x4ace('0x5');var _0x42f972=_0x21c61f[_0x4ace('0x6')](_0x4ace('0x7'),'')[_0x4ace('0x6')](_0x4ace('0x4'),'')[_0x4ace('0x8')]('||');for(var _0x319b5f=0x0;_0x319b5f<_0x42f972['length'];_0x319b5f++){var _0x56421f=_0x42f972[_0x319b5f]['split'](':=');var _0x54b2f9=_0x56421f[0x0];var _0x3deaa2=_0x56421f[_0x4ace('0x9')](0x1);_0x3deaa2[_0x4ace('0xa')](function(_0x2278fe){var _0x1cd443=_0x2278fe[_0x4ace('0x8')]('[')['shift']();var _0x25144a=_0x2278fe[_0x4ace('0xb')](/\[(.*?)\]/g);_0x25144a[_0x4ace('0xa')](function(_0x49cbee){var _0x9465a8=_0x49cbee[_0x4ace('0x8')]('[')[_0x4ace('0xc')](function(_0x40296f){return _0x40296f[_0x4ace('0xd')](']')>-0x1;})['map'](function(_0x1e58df){return _0x1e58df[_0x4ace('0x8')](']')[0x0];})[0x0];_0x582c82[_0x4ace('0xe')][_0x4ace('0xf')]({'field':_0x54b2f9,'operator':_0x1cd443,'value':_0x9465a8});});});}return _0x582c82;};exports['buildExpression']=function(_0x34ac6f,_0x4e8234,_0x5b1875){var _0x15c967={};if(_0x4e8234==='DATE'){if(_0x5b1875['operator']===_0x4ace('0x10')){_0x5b1875[_0x4ace('0x11')]=_0x4ace('0x12');_0x5b1875['value']+=','+_0x5b1875['value'];}else if(_[_0x4ace('0x13')]([_0x4ace('0x14'),_0x4ace('0x15')],_0x5b1875[_0x4ace('0x11')])){_0x5b1875[_0x4ace('0x16')]=moment(_0x5b1875[_0x4ace('0x16')])[_0x4ace('0x17')](0x1,_0x4ace('0x18'))[_0x4ace('0x19')](_0x4ace('0x1a'));}}if(_0x5b1875[_0x4ace('0x1b')]){_0x4e8234=_0x5b1875[_0x4ace('0x1b')];_0x15c967[_0x4ace('0x1c')]=_0x4ace('0x1d')+_0x34ac6f+'.'+_0x5b1875[_0x4ace('0x1e')]+_0x4ace('0x1f')+_0x5b1875[_0x4ace('0x1b')]+')\x20'+parseOperator(_0x5b1875[_0x4ace('0x11')]);}else{_0x15c967[_0x4ace('0x1c')]=_0x34ac6f+'.'+_0x5b1875[_0x4ace('0x1e')]+'\x20'+parseOperator(_0x5b1875[_0x4ace('0x11')]);}if(_[_0x4ace('0x13')]([_0x4ace('0x20'),_0x4ace('0x21')],_0x5b1875[_0x4ace('0x11')]))_0x15c967[_0x4ace('0x1c')]='('+_0x15c967[_0x4ace('0x1c')]+_0x4ace('0x22')+_0x34ac6f+'.'+_0x5b1875['field']+_0x4ace('0x23');_0x15c967['value']=parseValue(_0x4e8234,_0x5b1875[_0x4ace('0x11')],_0x5b1875[_0x4ace('0x16')]);return _0x15c967;};function parseOperator(_0x2c28f2){var _0x844c01;switch(_0x2c28f2){case'$in':_0x844c01=_0x4ace('0x24');break;case _0x4ace('0x21'):_0x844c01=_0x4ace('0x25');break;case _0x4ace('0x10'):_0x844c01=_0x4ace('0x26');break;case'$ne':_0x844c01='<>\x20?';break;case'$substring':case _0x4ace('0x27'):case _0x4ace('0x28'):_0x844c01='LIKE\x20?';break;case _0x4ace('0x29'):_0x844c01=_0x4ace('0x2a');break;case _0x4ace('0x14'):_0x844c01=_0x4ace('0x2b');break;case _0x4ace('0x15'):_0x844c01=_0x4ace('0x2c');break;case _0x4ace('0x2d'):_0x844c01=_0x4ace('0x2e');break;case'$between':_0x844c01='BETWEEN\x20?\x20AND\x20?';break;}return _0x844c01;}function parseValue(_0x1adc7e,_0x566aff,_0x140702){var _0xf633b6={'start':undefined,'end':undefined};switch(_0x566aff){case _0x4ace('0x2f'):case _0x4ace('0x21'):_0xf633b6[_0x4ace('0x30')]=_0x140702['split'](',');break;case _0x4ace('0x31'):_0xf633b6['start']='%'+_0x140702+'%';break;case'$startsWith':_0xf633b6[_0x4ace('0x30')]=_0x140702+'%';break;case _0x4ace('0x28'):_0xf633b6[_0x4ace('0x30')]='%'+_0x140702;break;case _0x4ace('0x12'):var _0x1ec876=_0x140702[_0x4ace('0x8')](',');var _0x140702=_0x1ec876[_0x4ace('0x32')]();var _0xd82d83=_0x1ec876[_0x4ace('0x33')]();if(_0x1adc7e===_0x4ace('0x34')){_0x140702=moment(_0x140702)[_0x4ace('0x35')](0x0,!![])[_0x4ace('0x19')]();_0xd82d83=moment(_0xd82d83)['utcOffset'](0x0,!![])[_0x4ace('0x17')](0x17,'hours')[_0x4ace('0x17')](0x3b,_0x4ace('0x36'))['add'](0x3b,_0x4ace('0x37'))[_0x4ace('0x19')]();}_0xf633b6={'start':_0x140702,'end':_0xd82d83};break;default:_0xf633b6['start']=_0x140702;break;}return _0xf633b6;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 7cb28d5..341dd98 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 _0xe32c=['attributes','limit','order','where','filters','pick','filter','type','lower','merge','options','lodash','sequelize','parse','includes','keys','fields','split','isEmpty','forOwn','find','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','name','intersection'];(function(_0x51b4b0,_0x3ffba9){var _0x2b2e4d=function(_0xd896a2){while(--_0xd896a2){_0x51b4b0['push'](_0x51b4b0['shift']());}};_0x2b2e4d(++_0x3ffba9);}(_0xe32c,0x83));var _0xce32=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xe32c[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require(_0xce32('0x0'));var sequelize=require(_0xce32('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2de1cc){var _0x3c3eab=['ne'];try{var _0x4ac142=JSON[_0xce32('0x2')](_0x2de1cc);var _0x49d8d8=Object['keys'](_0x4ac142)[0x0];return _0x3c3eab[_0xce32('0x3')](_0x49d8d8);}catch(_0x19b656){return![];}}function getOperatorValue(_0x96347a){var _0x2d0c2a=JSON[_0xce32('0x2')](_0x96347a);var _0x1f7632=Object[_0xce32('0x4')](_0x2d0c2a)[0x0];var _0x5ed36a=_0x2d0c2a[_0x1f7632];return{['$'+_0x1f7632]:_0x5ed36a};}exports[_0xce32('0x5')]=function(_0x192871){var _0x49bba2=null;if(_0x192871){_0x49bba2=_0x192871[_0xce32('0x6')](',');}return _0x49bba2;};exports['filters']=function(_0x1642a2,_0x3686ac){var _0x5a5263={};if(!_[_0xce32('0x7')](_0x1642a2)){_[_0xce32('0x8')](_0x1642a2,function(_0x408559,_0x2c3701){try{if(_0x3686ac){var _0x417003=_[_0xce32('0x9')](_0x3686ac,{'name':_0x2c3701})||{};if(hasSequelizeOperator(_0x408559)){_0x5a5263[_0x2c3701]=getOperatorValue(_0x408559);}else if(_0x417003['type']===_0xce32('0xa')&&_['isPlainObject'](_0x408559)){var _0x2d8af9=JSON['parse'](_0x408559);var _0x3e9d6c={'$gte':moment(moment(_0x2d8af9[_0xce32('0xb')])[_0xce32('0xc')](_0xce32('0xd')))[_0xce32('0xe')]()[_0xce32('0xc')](),'$lte':moment(moment(_0x2d8af9[_0xce32('0xf')])[_0xce32('0xc')](_0xce32('0xd')))['utc']()[_0xce32('0x10')](0x1,'s')['format']()};_0x5a5263[_0x2c3701]=_0x3e9d6c;}else if(_0x417003['name']===_0xce32('0x11')){_0x5a5263[_0x2c3701]=_0x408559;}else{_0x5a5263[_0x2c3701]=_['isArray'](_0x408559)?_0x408559:JSON[_0xce32('0x2')](_0x408559);}}else{_0x5a5263[_0x2c3701]=_[_0xce32('0x12')](_0x408559)?_0x408559:JSON[_0xce32('0x2')](_0x408559);}}catch(_0x4944ec){_0x5a5263[_0x2c3701]=_0x408559[_0xce32('0x6')](',');}});}return _0x5a5263;};exports['limit']=function(_0x4ae0bb){_0x4ae0bb=parseInt(_0x4ae0bb,0xa);if(!_0x4ae0bb||_0x4ae0bb<0x0){_0x4ae0bb=LIMIT_VALUE;}return _0x4ae0bb;};exports[_0xce32('0x13')]=function(_0x5a14a1){_0x5a14a1=parseInt(_0x5a14a1,0xa);if(!_0x5a14a1||_0x5a14a1<0x0){_0x5a14a1=0x0;}return _0x5a14a1;};exports[_0xce32('0x14')]=function(_0x326fa0){var _0x265a3d,_0x5e3be1=null;if(_0x326fa0){_0x265a3d=_0x326fa0[_0xce32('0x6')](',');_0x5e3be1=_[_0xce32('0x15')](_0x265a3d,function(_0x25e01b){if(_0x25e01b[_0xce32('0x16')]('-')===0x0){return[_0x25e01b===_0xce32('0x17')?sequelize['cast'](sequelize[_0xce32('0x18')](_0xce32('0x17')),_0xce32('0x19')):_0x25e01b[_0xce32('0x1a')](0x1),_0xce32('0x1b')];}else{return[_0x25e01b===_0xce32('0x17')?sequelize[_0xce32('0x1c')](sequelize[_0xce32('0x18')](_0xce32('0x17')),'unsigned'):_0x25e01b,'ASC'];}});}return _0x5e3be1;};exports[_0xce32('0x1d')]=function(_0x327dca,_0x50c596){if(_[_0xce32('0x7')](_0x327dca)){return _0x327dca;}if(_[_0xce32('0x12')](_0x327dca)){for(var _0x2cdc51=0x0;_0x2cdc51<_0x327dca[_0xce32('0x1e')];_0x2cdc51+=0x1){_0x327dca[_0x2cdc51]=this[_0xce32('0x1d')](_0x327dca[_0x2cdc51],_0x50c596);}return _0x327dca;}if(!_[_0xce32('0x1f')](_0x327dca)){return _0x327dca;}if(_[_0xce32('0x20')](_0x50c596)){_0x50c596=[_0x50c596];}if(!_[_0xce32('0x12')](_0x50c596)){return _0x327dca;}for(var _0x5f552e=0x0;_0x5f552e<_0x50c596[_0xce32('0x1e')];_0x5f552e+=0x1){_[_0xce32('0x21')](_0x327dca,_0x50c596[_0x5f552e]);}for(var _0x3aa956 in _0x327dca){if(_0x327dca[_0xce32('0x22')](_0x3aa956)){_0x327dca[_0x3aa956]=this[_0xce32('0x1d')](_0x327dca[_0x3aa956],_0x50c596);}}return _0x327dca;};exports[_0xce32('0x23')]=function(_0x3d285f){return _0x3d285f[_0xce32('0x24')](RegExp(_0xce32('0x25')))?!![]:![];};exports[_0xce32('0x26')]=function(_0x765311){return _0x765311[_0xce32('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xce32('0x27')]=function(_0x520224){var _0xb562dd=[];_0x520224['split'](/[ ,]+/)[_0xce32('0x28')](function(_0x196747){_0x196747=_0x196747[_0xce32('0x29')](/([^:]")"+/g,'$1');_0x196747='+'+_0x196747+'*';if(_0x196747[_0xce32('0x3')]('@'))_0x196747='\x22'+_0x196747+'\x22';_0xb562dd[_0xce32('0x2a')](_0x196747);});return _0xb562dd['join']('\x20');};exports[_0xce32('0x2b')]=function(_0x1b7a4b,_0x2e3bda,_0x5f5443){var _0x43e07d={},_0x4c3fb9={};if(_0x2e3bda[_0xce32('0x2c')][_0xce32('0x2d')]){_0x2e3bda['query']['id']=_0x2e3bda[_0xce32('0x2c')][_0xce32('0x2d')];delete _0x2e3bda[_0xce32('0x2c')][_0xce32('0x2d')];}_0x43e07d[_0xce32('0x2e')]=_[_0xce32('0x15')](_0x1b7a4b,_0xce32('0x2f'));_0x43e07d['query']=_['keys'](_0x2e3bda[_0xce32('0x2c')]);_0x43e07d['filters']=_[_0xce32('0x30')](_0x43e07d['model'],_0x43e07d['query']);_0x4c3fb9['attributes']=_[_0xce32('0x30')](_0x43e07d[_0xce32('0x2e')],this[_0xce32('0x5')](_0x2e3bda[_0xce32('0x2c')]['fields']));_0x4c3fb9[_0xce32('0x31')]=_0x4c3fb9['attributes']['length']?_0x4c3fb9[_0xce32('0x31')]:_0x43e07d[_0xce32('0x2e')];if(!_0x2e3bda[_0xce32('0x2c')][_0xce32('0x22')]('nolimit')){_0x4c3fb9[_0xce32('0x32')]=this['limit'](_0x2e3bda['query'][_0xce32('0x32')]);_0x4c3fb9[_0xce32('0x13')]=this[_0xce32('0x13')](_0x2e3bda['query'][_0xce32('0x13')]);}_0x4c3fb9[_0xce32('0x33')]=this['sort'](_0x2e3bda['query'][_0xce32('0x14')]);_0x4c3fb9[_0xce32('0x34')]=this[_0xce32('0x35')](_[_0xce32('0x36')](_0x2e3bda[_0xce32('0x2c')],_0x43e07d[_0xce32('0x35')]),_0x1b7a4b);if(_0x2e3bda[_0xce32('0x2c')][_0xce32('0x37')]){_0x4c3fb9[_0xce32('0x34')]=_['merge'](_0x4c3fb9[_0xce32('0x34')],{'$or':_[_0xce32('0x15')](_0x1b7a4b,function(_0x7fc74d){if(_0x7fc74d[_0xce32('0x38')]!=='VIRTUAL'){if(_0x5f5443){return sequelize[_0xce32('0x34')](sequelize['fn'](_0xce32('0x39'),sequelize[_0xce32('0x18')](_0x7fc74d[_0xce32('0x2f')])),{'$like':sequelize['fn'](_0xce32('0x39'),'%'+_0x2e3bda[_0xce32('0x2c')][_0xce32('0x37')]+'%')});}else{var _0x5e4312={};_0x5e4312[_0x7fc74d[_0xce32('0x2f')]]={'$like':'%'+_0x2e3bda['query'][_0xce32('0x37')]+'%'};return _0x5e4312;}}})});}_0x4c3fb9=_[_0xce32('0x3a')]({},_0x4c3fb9,_0x2e3bda[_0xce32('0x3b')]);return _0x4c3fb9;}; \ No newline at end of file +var _0x7d5b=['query','model','map','intersection','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','lodash','parse','keys','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','includes','push','join','$id'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7d5b,0x1e5));var _0xb7d5=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x7d5b[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0xb7d5('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x433ea8){var _0x40dfec=['ne'];try{var _0x3cbc8b=JSON[_0xb7d5('0x1')](_0x433ea8);var _0x4d8578=Object[_0xb7d5('0x2')](_0x3cbc8b)[0x0];return _0x40dfec['includes'](_0x4d8578);}catch(_0x5bb2c9){return![];}}function getOperatorValue(_0x3eaee0){var _0x40c123=JSON['parse'](_0x3eaee0);var _0xef09ef=Object[_0xb7d5('0x2')](_0x40c123)[0x0];var _0x4d68c9=_0x40c123[_0xef09ef];return{['$'+_0xef09ef]:_0x4d68c9};}exports[_0xb7d5('0x3')]=function(_0x3061f0){var _0x2d7116=null;if(_0x3061f0){_0x2d7116=_0x3061f0[_0xb7d5('0x4')](',');}return _0x2d7116;};exports[_0xb7d5('0x5')]=function(_0x3c44a0,_0x80f90a){var _0x4417ce={};if(!_[_0xb7d5('0x6')](_0x3c44a0)){_['forOwn'](_0x3c44a0,function(_0x15f481,_0x12c3a4){try{if(_0x80f90a){var _0x184ad1=_[_0xb7d5('0x7')](_0x80f90a,{'name':_0x12c3a4})||{};if(hasSequelizeOperator(_0x15f481)){_0x4417ce[_0x12c3a4]=getOperatorValue(_0x15f481);}else if(_0x184ad1[_0xb7d5('0x8')]===_0xb7d5('0x9')&&_[_0xb7d5('0xa')](_0x15f481)){var _0xc18624=JSON['parse'](_0x15f481);var _0x264a96={'$gte':moment(moment(_0xc18624[_0xb7d5('0xb')])[_0xb7d5('0xc')]('YYYY-MM-DD'))[_0xb7d5('0xd')]()[_0xb7d5('0xc')](),'$lte':moment(moment(_0xc18624[_0xb7d5('0xe')])[_0xb7d5('0xc')](_0xb7d5('0xf')))[_0xb7d5('0xd')]()[_0xb7d5('0x10')](0x1,'s')['format']()};_0x4417ce[_0x12c3a4]=_0x264a96;}else if(_0x184ad1[_0xb7d5('0x11')]===_0xb7d5('0x12')){_0x4417ce[_0x12c3a4]=_0x15f481;}else{_0x4417ce[_0x12c3a4]=_['isArray'](_0x15f481)?_0x15f481:JSON[_0xb7d5('0x1')](_0x15f481);}}else{_0x4417ce[_0x12c3a4]=_[_0xb7d5('0x13')](_0x15f481)?_0x15f481:JSON[_0xb7d5('0x1')](_0x15f481);}}catch(_0x1900b8){_0x4417ce[_0x12c3a4]=_0x15f481[_0xb7d5('0x4')](',');}});}return _0x4417ce;};exports[_0xb7d5('0x14')]=function(_0x2a5f08){_0x2a5f08=parseInt(_0x2a5f08,0xa);if(!_0x2a5f08||_0x2a5f08<0x0){_0x2a5f08=LIMIT_VALUE;}return _0x2a5f08;};exports[_0xb7d5('0x15')]=function(_0x102d6f){_0x102d6f=parseInt(_0x102d6f,0xa);if(!_0x102d6f||_0x102d6f<0x0){_0x102d6f=0x0;}return _0x102d6f;};exports[_0xb7d5('0x16')]=function(_0x46a04f){var _0x425e4c,_0xe1e737=null;if(_0x46a04f){_0x425e4c=_0x46a04f[_0xb7d5('0x4')](',');_0xe1e737=_['map'](_0x425e4c,function(_0x3eaea4){if(_0x3eaea4[_0xb7d5('0x17')]('-')===0x0){return[_0x3eaea4===_0xb7d5('0x18')?sequelize[_0xb7d5('0x19')](sequelize[_0xb7d5('0x1a')]('priority'),_0xb7d5('0x1b')):_0x3eaea4['substr'](0x1),_0xb7d5('0x1c')];}else{return[_0x3eaea4===_0xb7d5('0x18')?sequelize['cast'](sequelize['col'](_0xb7d5('0x18')),_0xb7d5('0x1b')):_0x3eaea4,_0xb7d5('0x1d')];}});}return _0xe1e737;};exports[_0xb7d5('0x1e')]=function(_0x110dd1,_0x3946ef){if(_['isEmpty'](_0x110dd1)){return _0x110dd1;}if(_['isArray'](_0x110dd1)){for(var _0x5c49ca=0x0;_0x5c49ca<_0x110dd1[_0xb7d5('0x1f')];_0x5c49ca+=0x1){_0x110dd1[_0x5c49ca]=this[_0xb7d5('0x1e')](_0x110dd1[_0x5c49ca],_0x3946ef);}return _0x110dd1;}if(!_[_0xb7d5('0x20')](_0x110dd1)){return _0x110dd1;}if(_[_0xb7d5('0x21')](_0x3946ef)){_0x3946ef=[_0x3946ef];}if(!_[_0xb7d5('0x13')](_0x3946ef)){return _0x110dd1;}for(var _0x1d8440=0x0;_0x1d8440<_0x3946ef['length'];_0x1d8440+=0x1){_[_0xb7d5('0x22')](_0x110dd1,_0x3946ef[_0x1d8440]);}for(var _0x44dd0b in _0x110dd1){if(_0x110dd1[_0xb7d5('0x23')](_0x44dd0b)){_0x110dd1[_0x44dd0b]=this[_0xb7d5('0x1e')](_0x110dd1[_0x44dd0b],_0x3946ef);}}return _0x110dd1;};exports[_0xb7d5('0x24')]=function(_0x1e250c){return _0x1e250c[_0xb7d5('0x25')](RegExp(_0xb7d5('0x26')))?!![]:![];};exports['isEmail']=function(_0x323eac){return _0x323eac[_0xb7d5('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xb7d5('0x27')]=function(_0x2fe861){var _0x4d7623=[];_0x2fe861['split'](/[ ,]+/)[_0xb7d5('0x28')](function(_0x5588bb){_0x5588bb=_0x5588bb[_0xb7d5('0x29')](/([^:]")"+/g,'$1');_0x5588bb='+'+_0x5588bb+'*';if(_0x5588bb[_0xb7d5('0x2a')]('@'))_0x5588bb='\x22'+_0x5588bb+'\x22';_0x4d7623[_0xb7d5('0x2b')](_0x5588bb);});return _0x4d7623[_0xb7d5('0x2c')]('\x20');};exports['getOptions']=function(_0x46d768,_0x411cb6,_0x5d6dc0){var _0x574ebf={},_0x398885={};if(_0x411cb6['query'][_0xb7d5('0x2d')]){_0x411cb6[_0xb7d5('0x2e')]['id']=_0x411cb6['query'][_0xb7d5('0x2d')];delete _0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x2d')];}_0x574ebf[_0xb7d5('0x2f')]=_[_0xb7d5('0x30')](_0x46d768,_0xb7d5('0x11'));_0x574ebf[_0xb7d5('0x2e')]=_[_0xb7d5('0x2')](_0x411cb6['query']);_0x574ebf[_0xb7d5('0x5')]=_[_0xb7d5('0x31')](_0x574ebf['model'],_0x574ebf[_0xb7d5('0x2e')]);_0x398885['attributes']=_['intersection'](_0x574ebf[_0xb7d5('0x2f')],this[_0xb7d5('0x3')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x3')]));_0x398885[_0xb7d5('0x32')]=_0x398885['attributes']['length']?_0x398885[_0xb7d5('0x32')]:_0x574ebf[_0xb7d5('0x2f')];if(!_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x23')](_0xb7d5('0x33'))){_0x398885[_0xb7d5('0x14')]=this['limit'](_0x411cb6['query'][_0xb7d5('0x14')]);_0x398885[_0xb7d5('0x15')]=this[_0xb7d5('0x15')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x15')]);}_0x398885[_0xb7d5('0x34')]=this[_0xb7d5('0x16')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x16')]);_0x398885[_0xb7d5('0x35')]=this[_0xb7d5('0x5')](_[_0xb7d5('0x36')](_0x411cb6[_0xb7d5('0x2e')],_0x574ebf[_0xb7d5('0x5')]),_0x46d768);if(_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x37')]){_0x398885[_0xb7d5('0x35')]=_[_0xb7d5('0x38')](_0x398885[_0xb7d5('0x35')],{'$or':_[_0xb7d5('0x30')](_0x46d768,function(_0x30705e){if(_0x30705e['type']!==_0xb7d5('0x39')){if(_0x5d6dc0){return sequelize[_0xb7d5('0x35')](sequelize['fn']('lower',sequelize[_0xb7d5('0x1a')](_0x30705e[_0xb7d5('0x11')])),{'$like':sequelize['fn'](_0xb7d5('0x3a'),'%'+_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x37')]+'%')});}else{var _0x328944={};_0x328944[_0x30705e[_0xb7d5('0x11')]]={'$like':'%'+_0x411cb6[_0xb7d5('0x2e')]['filter']+'%'};return _0x328944;}}})});}_0x398885=_['merge']({},_0x398885,_0x411cb6['options']);return _0x398885;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6438744..7af2245 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2271=['html','ejs','renderFile','view\x20engine','urlencoded','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','path','cors','moment','../mysqldb','default','get','env','production','join','root','public','test','appPath','client','use','set','split','static','views','/server/views','engine'];(function(_0x1abe07,_0x44ec3b){var _0x45336c=function(_0xa5c86c){while(--_0xa5c86c){_0x1abe07['push'](_0x1abe07['shift']());}};_0x45336c(++_0x44ec3b);}(_0x2271,0xac));var _0x1227=function(_0x370fd2,_0x413f1d){_0x370fd2=_0x370fd2-0x0;var _0x2acc0d=_0x2271[_0x370fd2];return _0x2acc0d;};'use strict';var express=require(_0x1227('0x0'));var favicon=require(_0x1227('0x1'));var bodyParser=require(_0x1227('0x2'));var methodOverride=require(_0x1227('0x3'));var cookieParser=require(_0x1227('0x4'));var errorHandler=require('errorhandler');var path=require(_0x1227('0x5'));var passport=require('passport');var cors=require(_0x1227('0x6'));var moment=require(_0x1227('0x7'));var config=require('./environment');var db=require(_0x1227('0x8'))['db'];exports[_0x1227('0x9')]=function(_0x6e8c7a){var _0x533844=_0x6e8c7a[_0x1227('0xa')](_0x1227('0xb'));if(_0x533844===_0x1227('0xc')){_0x6e8c7a['set']('appPath',path[_0x1227('0xd')](config[_0x1227('0xe')],_0x1227('0xf')));}if(_0x533844==='development'||_0x533844===_0x1227('0x10')){_0x6e8c7a['set'](_0x1227('0x11'),path[_0x1227('0xd')](config[_0x1227('0xe')],_0x1227('0x12')));_0x6e8c7a[_0x1227('0x13')](errorHandler());}_0x6e8c7a[_0x1227('0x14')]('json\x20replacer',function(_0x19dcbe,_0x355473){if(this[_0x19dcbe]instanceof Date){_0x355473=this[_0x19dcbe]['toISOString']()[_0x1227('0x15')]('.')[0x0]+'Z';}return _0x355473;});_0x6e8c7a[_0x1227('0x13')](express[_0x1227('0x16')](_0x6e8c7a['get'](_0x1227('0x11'))));_0x6e8c7a['set'](_0x1227('0x17'),config['root']+_0x1227('0x18'));_0x6e8c7a[_0x1227('0x19')](_0x1227('0x1a'),require(_0x1227('0x1b'))[_0x1227('0x1c')]);_0x6e8c7a['set'](_0x1227('0x1d'),_0x1227('0x1a'));_0x6e8c7a[_0x1227('0x13')](bodyParser[_0x1227('0x1e')]({'limit':'50mb','extended':!![]}));_0x6e8c7a[_0x1227('0x13')](bodyParser[_0x1227('0x1f')]({'limit':'50mb'}));_0x6e8c7a[_0x1227('0x13')](cors());_0x6e8c7a[_0x1227('0x13')](methodOverride());_0x6e8c7a[_0x1227('0x13')](cookieParser());_0x6e8c7a[_0x1227('0x13')](passport[_0x1227('0x20')]());}; \ No newline at end of file +var _0x4c89=['join','public','development','test','client','json\x20replacer','split','views','/server/views','html','ejs','renderFile','use','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','production','set','appPath'];(function(_0x42c410,_0x18238c){var _0x45df40=function(_0x1693b4){while(--_0x1693b4){_0x42c410['push'](_0x42c410['shift']());}};_0x45df40(++_0x18238c);}(_0x4c89,0xcb));var _0x94c8=function(_0x56ab4e,_0x2f6d9e){_0x56ab4e=_0x56ab4e-0x0;var _0x593823=_0x4c89[_0x56ab4e];return _0x593823;};'use strict';var express=require(_0x94c8('0x0'));var favicon=require(_0x94c8('0x1'));var bodyParser=require(_0x94c8('0x2'));var methodOverride=require(_0x94c8('0x3'));var cookieParser=require(_0x94c8('0x4'));var errorHandler=require(_0x94c8('0x5'));var path=require('path');var passport=require(_0x94c8('0x6'));var cors=require(_0x94c8('0x7'));var moment=require('moment');var config=require(_0x94c8('0x8'));var db=require('../mysqldb')['db'];exports[_0x94c8('0x9')]=function(_0x3e693a){var _0x3946e2=_0x3e693a[_0x94c8('0xa')]('env');if(_0x3946e2===_0x94c8('0xb')){_0x3e693a[_0x94c8('0xc')](_0x94c8('0xd'),path[_0x94c8('0xe')](config['root'],_0x94c8('0xf')));}if(_0x3946e2===_0x94c8('0x10')||_0x3946e2===_0x94c8('0x11')){_0x3e693a[_0x94c8('0xc')](_0x94c8('0xd'),path[_0x94c8('0xe')](config['root'],_0x94c8('0x12')));_0x3e693a['use'](errorHandler());}_0x3e693a[_0x94c8('0xc')](_0x94c8('0x13'),function(_0x10724a,_0x19e415){if(this[_0x10724a]instanceof Date){_0x19e415=this[_0x10724a]['toISOString']()[_0x94c8('0x14')]('.')[0x0]+'Z';}return _0x19e415;});_0x3e693a['use'](express['static'](_0x3e693a[_0x94c8('0xa')]('appPath')));_0x3e693a[_0x94c8('0xc')](_0x94c8('0x15'),config['root']+_0x94c8('0x16'));_0x3e693a['engine'](_0x94c8('0x17'),require(_0x94c8('0x18'))[_0x94c8('0x19')]);_0x3e693a[_0x94c8('0xc')]('view\x20engine',_0x94c8('0x17'));_0x3e693a[_0x94c8('0x1a')](bodyParser[_0x94c8('0x1b')]({'limit':_0x94c8('0x1c'),'extended':!![]}));_0x3e693a['use'](bodyParser[_0x94c8('0x1d')]({'limit':_0x94c8('0x1c')}));_0x3e693a[_0x94c8('0x1a')](cors());_0x3e693a[_0x94c8('0x1a')](methodOverride());_0x3e693a[_0x94c8('0x1a')](cookieParser());_0x3e693a[_0x94c8('0x1a')](passport[_0x94c8('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6f10552..d380e06 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 _0x7f53=['hostname','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','address','127.0.0.1','join','md5','update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace'];(function(_0x497803,_0x74b769){var _0x5dfc95=function(_0x2bf5fe){while(--_0x2bf5fe){_0x497803['push'](_0x497803['shift']());}};_0x5dfc95(++_0x74b769);}(_0x7f53,0xf2));var _0x37f5=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0x7f53[_0x4664db];return _0x5615b4;};'use strict';var _=require(_0x37f5('0x0'));var os=require('os');var crypto=require(_0x37f5('0x1'));var machine=require(_0x37f5('0x2'));var exec=require(_0x37f5('0x3'))[_0x37f5('0x4')];var config=require(_0x37f5('0x5'));function getInterfaces(){var _0x3335a9=[];var _0x22e39a=os[_0x37f5('0x6')]();var _0x2d6d97=_[_0x37f5('0x7')](_[_0x37f5('0x8')](_0x22e39a));for(var _0x1b1ac7=0x0;_0x1b1ac7<_0x2d6d97[_0x37f5('0x9')];_0x1b1ac7++){var _0x497e6e=_0x22e39a[_0x2d6d97[_0x1b1ac7]][_0x37f5('0xa')](function(_0x4ff8fa){return _0x4ff8fa[_0x37f5('0xb')]===_0x37f5('0xc')&&_0x4ff8fa[_0x37f5('0xd')]===![];});_0x3335a9=_0x3335a9[_0x37f5('0xe')](_0x497e6e);}return _0x3335a9;}function getFirstInterface(){var _0x27881c=_['head'](getInterfaces());return{'macAddress':_0x27881c&&_0x27881c[_0x37f5('0xf')]?_0x27881c[_0x37f5('0xf')]:'00:00:00:00:00:00','ipAddress':_0x27881c&&_0x27881c[_0x37f5('0x10')]?_0x27881c['address']:_0x37f5('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x346b99=_[_0x37f5('0x7')](os['cpus']()['map'](function(_0xdda373){return _0xdda373['model'];}))[_0x37f5('0x12')](':');return crypto['createHash'](_0x37f5('0x13'))[_0x37f5('0x14')](_0x346b99)[_0x37f5('0x15')](_0x37f5('0x16'));}exports[_0x37f5('0x17')]=function(){var _0x1de067=os[_0x37f5('0x18')]();var _0x35073f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x35073f[_0x37f5('0x19')](config[_0x37f5('0x1a')])){return config[_0x37f5('0x1a')];}else if(_0x1de067===_0x37f5('0x1b')){return exec(_0x37f5('0x1c'),{'encoding':'utf8'})[_0x37f5('0x1d')]('\x0d\x0a','');}else{var _0x3dcb7b=getFirstInterface();var _0x31557c=getCPUhash();var _0x5b304a=_0x31557c+'|'+os[_0x37f5('0x1e')]()+'|'+_0x3dcb7b['macAddress']+'|'+_0x3dcb7b[_0x37f5('0x1f')];var _0x461e2=crypto[_0x37f5('0x20')](_0x37f5('0x13'))[_0x37f5('0x14')](_0x5b304a)[_0x37f5('0x15')](_0x37f5('0x16'));return _0x461e2[_0x37f5('0x21')](0x0,0x8)+'-'+_0x461e2[_0x37f5('0x21')](0x8,0xc)+'-'+_0x461e2['substring'](0xc,0x10)+'-'+_0x461e2[_0x37f5('0x21')](0x10,0x14)+'-'+_0x461e2[_0x37f5('0x21')](0x14);}}; \ No newline at end of file +var _0xccb2=['test','licenseToken','win32','utf8','replace','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','platform'];(function(_0x1390a0,_0x499668){var _0x359f67=function(_0x3daff4){while(--_0x3daff4){_0x1390a0['push'](_0x1390a0['shift']());}};_0x359f67(++_0x499668);}(_0xccb2,0xfd));var _0x2ccb=function(_0x2764c8,_0x37c224){_0x2764c8=_0x2764c8-0x0;var _0x5e8dc1=_0xccb2[_0x2764c8];return _0x5e8dc1;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2ccb('0x0'));var machine=require(_0x2ccb('0x1'));var exec=require(_0x2ccb('0x2'))[_0x2ccb('0x3')];var config=require(_0x2ccb('0x4'));function getInterfaces(){var _0x287ea2=[];var _0x36969a=os[_0x2ccb('0x5')]();var _0x13b9dc=_['orderBy'](_['keys'](_0x36969a));for(var _0x3a032b=0x0;_0x3a032b<_0x13b9dc[_0x2ccb('0x6')];_0x3a032b++){var _0x533500=_0x36969a[_0x13b9dc[_0x3a032b]][_0x2ccb('0x7')](function(_0x12ac4f){return _0x12ac4f[_0x2ccb('0x8')]===_0x2ccb('0x9')&&_0x12ac4f[_0x2ccb('0xa')]===![];});_0x287ea2=_0x287ea2[_0x2ccb('0xb')](_0x533500);}return _0x287ea2;}function getFirstInterface(){var _0x5576f1=_[_0x2ccb('0xc')](getInterfaces());return{'macAddress':_0x5576f1&&_0x5576f1[_0x2ccb('0xd')]?_0x5576f1[_0x2ccb('0xd')]:_0x2ccb('0xe'),'ipAddress':_0x5576f1&&_0x5576f1[_0x2ccb('0xf')]?_0x5576f1[_0x2ccb('0xf')]:_0x2ccb('0x10')};}exports[_0x2ccb('0x11')]=getFirstInterface;function getCPUhash(){var _0x30a794=_['orderBy'](os[_0x2ccb('0x12')]()[_0x2ccb('0x13')](function(_0x30a6c7){return _0x30a6c7[_0x2ccb('0x14')];}))[_0x2ccb('0x15')](':');return crypto[_0x2ccb('0x16')](_0x2ccb('0x17'))[_0x2ccb('0x18')](_0x30a794)['digest'](_0x2ccb('0x19'));}exports['getUuid']=function(){var _0x5440aa=os[_0x2ccb('0x1a')]();var _0x7b512=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x7b512[_0x2ccb('0x1b')](config[_0x2ccb('0x1c')])){return config[_0x2ccb('0x1c')];}else if(_0x5440aa===_0x2ccb('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x2ccb('0x1e')})[_0x2ccb('0x1f')]('\x0d\x0a','');}else{var _0x41f5ff=getFirstInterface();var _0x8b632d=getCPUhash();var _0x4965fe=_0x8b632d+'|'+os[_0x2ccb('0x20')]()+'|'+_0x41f5ff[_0x2ccb('0x21')]+'|'+_0x41f5ff['ipAddress'];var _0xcf697d=crypto[_0x2ccb('0x16')](_0x2ccb('0x17'))[_0x2ccb('0x18')](_0x4965fe)['digest'](_0x2ccb('0x19'));return _0xcf697d[_0x2ccb('0x22')](0x0,0x8)+'-'+_0xcf697d[_0x2ccb('0x22')](0x8,0xc)+'-'+_0xcf697d[_0x2ccb('0x22')](0xc,0x10)+'-'+_0xcf697d[_0x2ccb('0x22')](0x10,0x14)+'-'+_0xcf697d['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index e7efe7e..3c752f5 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 _0x5470=['get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','version','../../mysqldb','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch'];(function(_0x16083b,_0x21dfb4){var _0x582fc2=function(_0x5854d4){while(--_0x5854d4){_0x16083b['push'](_0x16083b['shift']());}};_0x582fc2(++_0x21dfb4);}(_0x5470,0x153));var _0x0547=function(_0x3e23ae,_0x5009f7){_0x3e23ae=_0x3e23ae-0x0;var _0x4690c6=_0x5470[_0x3e23ae];return _0x4690c6;};'use strict';var util=require(_0x0547('0x0'));var moment=require(_0x0547('0x1'));var rp=require(_0x0547('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x0547('0x3'));var db=require(_0x0547('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require('../logger')('license');var HOST=_0x0547('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x43328d){return new BPromise(function(_0x121e51,_0x545021){var _0x1f51ce=util[_0x0547('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x43328d,module['exports']['version']);if(oldToken){_0x1f51ce=util[_0x0547('0x6')](_0x0547('0x7'),HOST,_0x43328d,module['exports']['version'],oldToken);}var _0x411625={'uri':_0x1f51ce,'method':_0x0547('0x8'),'timeout':0xea60,'json':!![]};return rp(_0x411625)[_0x0547('0x9')](function(_0x4e04ec){_0x121e51(_0x4e04ec);})[_0x0547('0xa')](function(_0x154261){_0x545021(_0x154261);});});}function manageLicense(_0xdc2973,_0x394c69){var _0x48519a=_0x394c69[_0x0547('0xb')]({'plain':!![]});if(!isOldTokenSent&&_0x48519a[_0x0547('0xc')]!==_0xdc2973&&!_0x48519a[_0x0547('0xd')]){oldToken=_0x48519a['data1'];}httpRequest(_0xdc2973)['then'](function(_0x5239d0){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5239d0[_0x0547('0xe')]){isOldTokenSent=![];if(!_0x48519a[_0x0547('0xf')]&&_0x48519a[_0x0547('0xf')]!=_0x5239d0[_0x0547('0xf')]||_0x48519a[_0x0547('0xf')]&&_0x48519a[_0x0547('0xd')]){logger[_0x0547('0x10')](_0x0547('0x11'));}if(_0x48519a[_0x0547('0xf')]&&!_0x48519a[_0x0547('0xd')]&&_0x48519a[_0x0547('0xf')]!=_0x5239d0['license']){logger['info'](_0x0547('0x12'));}if(_0x48519a['license']&&!_0x48519a[_0x0547('0xd')]&&_0x48519a[_0x0547('0xf')]==_0x5239d0[_0x0547('0xf')]){return _0x394c69;}return _0x394c69[_0x0547('0x13')]({'data1':_0xdc2973,'data2':null,'license':_0x5239d0[_0x0547('0xf')]});}else{if(_0x5239d0[_0x0547('0xf')]||_0x48519a['license']){if(!_0x48519a['data2']){if(_0x48519a['data1']==_0xdc2973){GRAY_PERIOD_REASON=_0x0547('0x14');logger['info'](_0x0547('0x15'));}else{GRAY_PERIOD_REASON=_0x0547('0x16');logger['info'](_0x0547('0x17'),_0x48519a[_0x0547('0xc')],_0xdc2973);}logger['info'](_0x0547('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x0547('0x6')](_0x0547('0x19')));return _0x394c69['update']({'data2':encryptor['encryptString'](moment()[_0x0547('0x6')](_0x0547('0x19')))});}else{if(moment()[_0x0547('0x1a')](encryptor[_0x0547('0x1b')](_0x48519a[_0x0547('0xd')]),_0x0547('0x1c'))>DAYS){logger['info'](_0x0547('0x1d'),moment()[_0x0547('0x6')](_0x0547('0x19')));isOldTokenSent=![];return _0x394c69[_0x0547('0x13')]({'data1':_0xdc2973,'data2':null,'license':null});}}}else{if(_0x48519a[_0x0547('0xc')]!=_0xdc2973){logger['info'](_0x0547('0x17'),_0x48519a['data1'],_0xdc2973);return _0x394c69['update']({'data1':_0xdc2973,'data2':null,'license':null});}}}return _0x394c69;})['then'](function(_0x4cf72f){_0x394c69=_0x4cf72f;})[_0x0547('0xa')](function(_0x2a963e){logger[_0x0547('0x1e')](_0x2a963e[_0x0547('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0547('0x20')](),_0x394c69);},TIME);});}function defaultLicense(){var _0x55ec2b=hardware[_0x0547('0x20')]();if(_0x55ec2b){return db[_0x0547('0x21')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x55ec2b}})['spread'](function(_0x3a0c45,_0x114930){logger[_0x0547('0x10')](_0x0547('0x22'),_0x55ec2b);manageLicense(_0x55ec2b,_0x3a0c45);})[_0x0547('0xa')](function(_0x2a1ca0){logger['error'](_0x2a1ca0[_0x0547('0x1f')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xbca2=['https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','../../mysqldb','./hardware','../logger','license'];(function(_0x468dd8,_0x497171){var _0x560346=function(_0x4c699a){while(--_0x4c699a){_0x468dd8['push'](_0x468dd8['shift']());}};_0x560346(++_0x497171);}(_0xbca2,0x189));var _0x2bca=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xbca2[_0x1cb18a];return _0x22442e;};'use strict';var util=require('util');var moment=require(_0x2bca('0x0'));var rp=require(_0x2bca('0x1'));var BPromise=require(_0x2bca('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x2bca('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x2bca('0x4'));var logger=require(_0x2bca('0x5'))(_0x2bca('0x6'));var HOST=_0x2bca('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x688316){return new BPromise(function(_0x271c6b,_0x3e74ea){var _0x3ebbd6=util['format'](_0x2bca('0x8'),HOST,_0x688316,module[_0x2bca('0x9')][_0x2bca('0xa')]);if(oldToken){_0x3ebbd6=util[_0x2bca('0xb')](_0x2bca('0xc'),HOST,_0x688316,module[_0x2bca('0x9')]['version'],oldToken);}var _0x4b2d1a={'uri':_0x3ebbd6,'method':_0x2bca('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4b2d1a)['then'](function(_0x40522a){_0x271c6b(_0x40522a);})['catch'](function(_0x597221){_0x3e74ea(_0x597221);});});}function manageLicense(_0x4628af,_0x1cb624){var _0x324375=_0x1cb624[_0x2bca('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x324375['data1']!==_0x4628af&&!_0x324375[_0x2bca('0xf')]){oldToken=_0x324375['data1'];}httpRequest(_0x4628af)[_0x2bca('0x10')](function(_0x4182a9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4182a9[_0x2bca('0x11')]){isOldTokenSent=![];if(!_0x324375[_0x2bca('0x6')]&&_0x324375['license']!=_0x4182a9['license']||_0x324375[_0x2bca('0x6')]&&_0x324375['data2']){logger['info'](_0x2bca('0x12'));}if(_0x324375[_0x2bca('0x6')]&&!_0x324375[_0x2bca('0xf')]&&_0x324375[_0x2bca('0x6')]!=_0x4182a9[_0x2bca('0x6')]){logger[_0x2bca('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x324375[_0x2bca('0x6')]&&!_0x324375[_0x2bca('0xf')]&&_0x324375[_0x2bca('0x6')]==_0x4182a9[_0x2bca('0x6')]){return _0x1cb624;}return _0x1cb624['update']({'data1':_0x4628af,'data2':null,'license':_0x4182a9['license']});}else{if(_0x4182a9[_0x2bca('0x6')]||_0x324375[_0x2bca('0x6')]){if(!_0x324375[_0x2bca('0xf')]){if(_0x324375['data1']==_0x4628af){GRAY_PERIOD_REASON=_0x2bca('0x14');logger['info'](_0x2bca('0x15'));}else{GRAY_PERIOD_REASON=_0x2bca('0x16');logger[_0x2bca('0x13')](_0x2bca('0x17'),_0x324375[_0x2bca('0x18')],_0x4628af);}logger['info'](_0x2bca('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2bca('0xb')](_0x2bca('0x1a')));return _0x1cb624[_0x2bca('0x1b')]({'data2':encryptor['encryptString'](moment()[_0x2bca('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x324375['data2']),_0x2bca('0x1c'))>DAYS){logger[_0x2bca('0x13')](_0x2bca('0x1d'),moment()[_0x2bca('0xb')](_0x2bca('0x1a')));isOldTokenSent=![];return _0x1cb624['update']({'data1':_0x4628af,'data2':null,'license':null});}}}else{if(_0x324375['data1']!=_0x4628af){logger[_0x2bca('0x13')](_0x2bca('0x17'),_0x324375[_0x2bca('0x18')],_0x4628af);return _0x1cb624[_0x2bca('0x1b')]({'data1':_0x4628af,'data2':null,'license':null});}}}return _0x1cb624;})[_0x2bca('0x10')](function(_0x36beff){_0x1cb624=_0x36beff;})[_0x2bca('0x1e')](function(_0xada042){logger[_0x2bca('0x1f')](_0xada042[_0x2bca('0x20')]);})[_0x2bca('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x2bca('0x22')](),_0x1cb624);},TIME);});}function defaultLicense(){var _0x240286=hardware[_0x2bca('0x22')]();if(_0x240286){return db[_0x2bca('0x23')][_0x2bca('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x240286}})[_0x2bca('0x25')](function(_0x5e53d0,_0x5046a3){logger[_0x2bca('0x13')](_0x2bca('0x26'),_0x240286);manageLicense(_0x240286,_0x5e53d0);})['catch'](function(_0x139131){logger['error'](_0x139131[_0x2bca('0x20')]);});}}exports[_0x2bca('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 56df7f2..1f52c13 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 _0x5c35=['telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','days','changed','message','User','findAll','role','COUNT','sequelize','count','admin','user'];(function(_0x3779ae,_0x563f5c){var _0x550cf8=function(_0x514c1b){while(--_0x514c1b){_0x3779ae['push'](_0x3779ae['shift']());}};_0x550cf8(++_0x563f5c);}(_0x5c35,0x1a5));var _0x55c3=function(_0xaaffc9,_0x1db33d){_0xaaffc9=_0xaaffc9-0x0;var _0xf447d3=_0x5c35[_0xaaffc9];return _0xf447d3;};'use strict';var util=require(_0x55c3('0x0'));var _=require(_0x55c3('0x1'));var moment=require(_0x55c3('0x2'));var BPromise=require('bluebird');var hardware=require(_0x55c3('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x55c3('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x55c3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x55c3('0x6'),'machineUuid':hardware[_0x55c3('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x55c3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x55c3('0x8'),'machineUuid':hardware[_0x55c3('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x34bc52){return new BPromise(function(_0x5d5297,_0x3abcbc){return db[_0x55c3('0x9')][_0x55c3('0xa')](_[_0x55c3('0xb')](_0x34bc52,{'raw':!![],'where':{'id':0x1}}))[_0x55c3('0xc')](function(_0x598645){return checkLicense(_0x598645,null);})[_0x55c3('0xc')](function(_0xe59e9c){_0x5d5297(_0xe59e9c);return;})[_0x55c3('0xd')](function(_0x2dcbd9){_0x3abcbc(_0x2dcbd9);});});}function checkLicense(_0x171634,_0x4487cc){if(!_0x171634){demoLicense[_0x55c3('0xe')]=_0x171634[_0x55c3('0xf')];return demoLicense;}try{var _0xa04461=_0x4487cc||_0x171634[_0x55c3('0x10')];if(_['isEmpty'](_0xa04461)){throw new Error(_0x55c3('0x11'));}var _0x3111fc=_0x171634[_0x55c3('0xf')];var _0x3e45ec=_0x171634[_0x55c3('0x12')];var _0x938bf0=_0x3111fc[_0x55c3('0x13')]('-')[0x4];var _0x224ca3=_0x3111fc[_0x55c3('0x13')]('-')[0x0];var _0xd479ec=encryptor[_0x55c3('0x14')](_0xa04461,util[_0x55c3('0x15')](_0x55c3('0x16'),_0x938bf0,_0x3111fc,_0x224ca3));var _0xee6223=JSON[_0x55c3('0x17')](_0xd479ec);_0xee6223[_0x55c3('0x18')]=![];_0xee6223['uuid']=_0x3111fc;_0xee6223[_0x55c3('0x19')]=hardware[_0x55c3('0x7')]();if(_0x3e45ec){var _0x5bd497=encryptor[_0x55c3('0x14')](_0x3e45ec);_0xee6223['gray']=_0x5bd497;_0xee6223[_0x55c3('0x1a')]=moment(_0x5bd497)[_0x55c3('0x1b')](0x7,_0x55c3('0x1c'))['format']();_0xee6223['grayReason']=_0xee6223['uuid']!=_0xee6223[_0x55c3('0x19')]?_0x55c3('0x1d'):'disabled';}return _0xee6223;}catch(_0x16f5c4){breakingLicense['uuid']=_0x171634[_0x55c3('0xf')];breakingLicense[_0x55c3('0x1e')]=_0x16f5c4[_0x55c3('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xffd731,_0x239dd2){getLicense()[_0x55c3('0xc')](function(_0x4741fd){return db[_0x55c3('0x1f')][_0x55c3('0x20')]({'attributes':[_0x55c3('0x21'),[db['sequelize']['fn'](_0x55c3('0x22'),db[_0x55c3('0x23')]['col'](_0x55c3('0x21'))),_0x55c3('0x24')]],'group':_0x55c3('0x21'),'where':{'role':{'$or':[_0x55c3('0x25'),_0x55c3('0x26'),_0x55c3('0x27')]}},'raw':!![]})[_0x55c3('0xc')](function(_0x3cb707){var _0x1a6598={'user':_0x4741fd['users']||0x0,'telephone':_0x4741fd[_0x55c3('0x28')]||0x0};_0x3cb707[_0x55c3('0x29')](function(_0x7ee75e){var _0x51f1be=_0x7ee75e['role']===_0x55c3('0x25')?'user':_0x7ee75e[_0x55c3('0x21')];_0x1a6598[_0x51f1be]-=_0x7ee75e[_0x55c3('0x24')];if(_0x1a6598[_0x51f1be]<0x0)_0x1a6598[_0x51f1be]=0x0;});_0xffd731(_0x1a6598);return;});})[_0x55c3('0xd')](function(_0x1d33cf){_0x239dd2(_0x1d33cf);});});}function checkUserLimits(_0x243b30){return new BPromise(function(_0x2d946c,_0x511603){getLimits()[_0x55c3('0xc')](function(_0x2594d5){var _0x14c72a=_[_0x55c3('0x2a')](_[_0x55c3('0x2b')](_0x243b30,'role'),['admin',_0x55c3('0x26'),_0x55c3('0x27')]);var _0x6bb7f0=(_0x14c72a[_0x55c3('0x25')]||0x0)+(_0x14c72a['user']||0x0);var _0x12f1d4=_0x14c72a[_0x55c3('0x27')]||0x0;if(_0x6bb7f0>_0x2594d5[_0x55c3('0x26')])return _0x511603('License\x20limit\x20reached\x20for\x20users');if(_0x12f1d4>_0x2594d5[_0x55c3('0x27')])return _0x511603(_0x55c3('0x2c'));return _0x2d946c();})[_0x55c3('0xd')](function(_0x363f7f){_0x511603(_0x363f7f);});});}module[_0x55c3('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xeee5=['../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','format','grayReason','changed','message','sequelize','COUNT','col','role','user','telephone','users','telephones','admin','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0xeee5,0x1c7));var _0x5eee=function(_0x508fb4,_0x153f85){_0x508fb4=_0x508fb4-0x0;var _0x5abce3=_0xeee5[_0x508fb4];return _0x5abce3;};'use strict';var util=require(_0x5eee('0x0'));var _=require(_0x5eee('0x1'));var moment=require(_0x5eee('0x2'));var BPromise=require(_0x5eee('0x3'));var hardware=require(_0x5eee('0x4'));var encryptor=require(_0x5eee('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5eee('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5eee('0x7'),'machineUuid':hardware[_0x5eee('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5eee('0x9'),'machineUuid':hardware[_0x5eee('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x17002a){return new BPromise(function(_0x3bfbf2,_0x551b00){return db[_0x5eee('0xa')]['find'](_['defaults'](_0x17002a,{'raw':!![],'where':{'id':0x1}}))[_0x5eee('0xb')](function(_0x2c2b8b){return checkLicense(_0x2c2b8b,null);})[_0x5eee('0xb')](function(_0x1ec4dd){_0x3bfbf2(_0x1ec4dd);return;})[_0x5eee('0xc')](function(_0x25271d){_0x551b00(_0x25271d);});});}function checkLicense(_0xadc6ab,_0x5ea940){if(!_0xadc6ab){demoLicense[_0x5eee('0xd')]=_0xadc6ab['data1'];return demoLicense;}try{var _0x209e98=_0x5ea940||_0xadc6ab[_0x5eee('0xe')];if(_[_0x5eee('0xf')](_0x209e98)){throw new Error(_0x5eee('0x10'));}var _0x1a4936=_0xadc6ab[_0x5eee('0x11')];var _0x1c5d8a=_0xadc6ab[_0x5eee('0x12')];var _0x254513=_0x1a4936[_0x5eee('0x13')]('-')[0x4];var _0x351a09=_0x1a4936['split']('-')[0x0];var _0x172476=encryptor[_0x5eee('0x14')](_0x209e98,util['format'](_0x5eee('0x15'),_0x254513,_0x1a4936,_0x351a09));var _0x34e329=JSON[_0x5eee('0x16')](_0x172476);_0x34e329['demo']=![];_0x34e329[_0x5eee('0xd')]=_0x1a4936;_0x34e329[_0x5eee('0x17')]=hardware[_0x5eee('0x8')]();if(_0x1c5d8a){var _0x30bb52=encryptor[_0x5eee('0x14')](_0x1c5d8a);_0x34e329[_0x5eee('0x18')]=_0x30bb52;_0x34e329[_0x5eee('0x19')]=moment(_0x30bb52)[_0x5eee('0x1a')](0x7,_0x5eee('0x1b'))[_0x5eee('0x1c')]();_0x34e329[_0x5eee('0x1d')]=_0x34e329['uuid']!=_0x34e329[_0x5eee('0x17')]?_0x5eee('0x1e'):'disabled';}return _0x34e329;}catch(_0x19e9c1){breakingLicense['uuid']=_0xadc6ab[_0x5eee('0x11')];breakingLicense[_0x5eee('0x1f')]=_0x19e9c1['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4a9f43,_0x1029d7){getLicense()[_0x5eee('0xb')](function(_0x46614f){return db['User']['findAll']({'attributes':['role',[db[_0x5eee('0x20')]['fn'](_0x5eee('0x21'),db[_0x5eee('0x20')][_0x5eee('0x22')](_0x5eee('0x23'))),'count']],'group':_0x5eee('0x23'),'where':{'role':{'$or':['admin',_0x5eee('0x24'),_0x5eee('0x25')]}},'raw':!![]})['then'](function(_0x3ece67){var _0x3a4f8d={'user':_0x46614f[_0x5eee('0x26')]||0x0,'telephone':_0x46614f[_0x5eee('0x27')]||0x0};_0x3ece67['forEach'](function(_0x37c2a0){var _0x1f7721=_0x37c2a0[_0x5eee('0x23')]===_0x5eee('0x28')?'user':_0x37c2a0['role'];_0x3a4f8d[_0x1f7721]-=_0x37c2a0[_0x5eee('0x29')];if(_0x3a4f8d[_0x1f7721]<0x0)_0x3a4f8d[_0x1f7721]=0x0;});_0x4a9f43(_0x3a4f8d);return;});})[_0x5eee('0xc')](function(_0x54b706){_0x1029d7(_0x54b706);});});}function checkUserLimits(_0x4fe041){return new BPromise(function(_0x1b3c9c,_0x5e4e4a){getLimits()['then'](function(_0x20fc07){var _0x243e96=_[_0x5eee('0x2a')](_[_0x5eee('0x2b')](_0x4fe041,_0x5eee('0x23')),[_0x5eee('0x28'),_0x5eee('0x24'),_0x5eee('0x25')]);var _0x5dfcfc=(_0x243e96[_0x5eee('0x28')]||0x0)+(_0x243e96[_0x5eee('0x24')]||0x0);var _0x433765=_0x243e96['telephone']||0x0;if(_0x5dfcfc>_0x20fc07['user'])return _0x5e4e4a(_0x5eee('0x2c'));if(_0x433765>_0x20fc07[_0x5eee('0x25')])return _0x5e4e4a('License\x20limit\x20reached\x20for\x20telephones');return _0x1b3c9c();})['catch'](function(_0x33b6e5){_0x5e4e4a(_0x33b6e5);});});}module[_0x5eee('0x2d')]={'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 9013211..f27298b 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 _0xaebd=['secret','exports','myappanuglar-secret','app-id'];(function(_0x38a14d,_0x470117){var _0x1ef4ad=function(_0x48b3bf){while(--_0x48b3bf){_0x38a14d['push'](_0x38a14d['shift']());}};_0x1ef4ad(++_0x470117);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5dc41e,_0x1fe79b){_0x5dc41e=_0x5dc41e-0x0;var _0x4884ed=_0xaebd[_0x5dc41e];return _0x4884ed;};'use strict';module[_0xdaeb('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xdaeb('0x1'),'GOOGLE_ID':_0xdaeb('0x2'),'GOOGLE_SECRET':_0xdaeb('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x25e7=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x25e7,0x1d6));var _0x725e=function(_0x3fe2ef,_0x211196){_0x3fe2ef=_0x3fe2ef-0x0;var _0x1fa60b=_0x25e7[_0x3fe2ef];return _0x1fa60b;};'use strict';module[_0x725e('0x0')]={'DOMAIN':_0x725e('0x1'),'SESSION_SECRET':_0x725e('0x2'),'GOOGLE_ID':_0x725e('0x3'),'GOOGLE_SECRET':_0x725e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c60735b..77f95e3 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36d3=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','error','%s-%s','info','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','format','message','{{{','replace','}}}'];(function(_0x2c4d38,_0x2b6820){var _0x22e5d9=function(_0x87d074){while(--_0x87d074){_0x2c4d38['push'](_0x2c4d38['shift']());}};_0x22e5d9(++_0x2b6820);}(_0x36d3,0x1e1));var _0x336d=function(_0x372938,_0x454f2a){_0x372938=_0x372938-0x0;var _0x39ebc5=_0x36d3[_0x372938];return _0x39ebc5;};'use strict';var moment=require(_0x336d('0x0'));var winston=require(_0x336d('0x1'));var util=require(_0x336d('0x2'));var path=require(_0x336d('0x3'));var debugLevel=_0x336d('0x4');function filename(_0x3b3bc9,_0x236601){return path[_0x336d('0x5')](_0x336d('0x6'),_0x336d('0x7'),'xcally',util[_0x336d('0x8')]('%s-%s.log',_0x3b3bc9,_0x236601));}function formatter(_0x3b7417,_0x21f950){_0x21f950[_0x336d('0x9')]=_0x21f950[_0x336d('0x9')]['replace'](/@@{/g,_0x336d('0xa'))[_0x336d('0xb')](/}@@/g,_0x336d('0xc'))['replace'](/@{/g,'{{')[_0x336d('0xb')](/}@/g,'}}');return util[_0x336d('0x8')](_0x336d('0xd'),moment()[_0x336d('0x8')](_0x336d('0xe')),_0x21f950[_0x336d('0xf')][_0x336d('0x10')](),_0x3b7417,_0x21f950[_0x336d('0x9')]);}module[_0x336d('0x11')]=function(_0x27c7c1){return new winston[(_0x336d('0x12'))]({'transports':[new winston[(_0x336d('0x13'))][(_0x336d('0x14'))]({'name':util[_0x336d('0x8')]('%s-%s',_0x27c7c1,_0x336d('0x15')),'filename':filename(_0x27c7c1,_0x336d('0x15')),'level':_0x336d('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xa0c5c2){return formatter(_0x27c7c1,_0xa0c5c2);}}),new winston[(_0x336d('0x13'))][(_0x336d('0x14'))]({'name':util['format'](_0x336d('0x16'),_0x27c7c1,_0x336d('0x17')),'filename':filename(_0x27c7c1,_0x336d('0x17')),'level':_0x336d('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ff225){return formatter(_0x27c7c1,_0x1ff225);}}),new winston['transports']['Console']({'level':process[_0x336d('0x18')][_0x336d('0x19')]||debugLevel,'json':![],'formatter':function(_0x1fbb29){return formatter(_0x27c7c1,_0x1fbb29);}})]});}; \ No newline at end of file +var _0xefde=['util','path','INFO','join','/var','format','%s-%s.log','message','replace','{{{','}}}','level','toUpperCase','exports','Logger','File','error','transports','info','Console','debugLevel','winston'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xefde,0x1a1));var _0xeefd=function(_0x50f3f7,_0x2d6e58){_0x50f3f7=_0x50f3f7-0x0;var _0x53ae8d=_0xefde[_0x50f3f7];return _0x53ae8d;};'use strict';var moment=require('moment');var winston=require(_0xeefd('0x0'));var util=require(_0xeefd('0x1'));var path=require(_0xeefd('0x2'));var debugLevel=_0xeefd('0x3');function filename(_0x5675e7,_0x2c1006){return path[_0xeefd('0x4')](_0xeefd('0x5'),'log','xcally',util[_0xeefd('0x6')](_0xeefd('0x7'),_0x5675e7,_0x2c1006));}function formatter(_0xe8200f,_0x3adc1d){_0x3adc1d[_0xeefd('0x8')]=_0x3adc1d[_0xeefd('0x8')][_0xeefd('0x9')](/@@{/g,_0xeefd('0xa'))[_0xeefd('0x9')](/}@@/g,_0xeefd('0xb'))[_0xeefd('0x9')](/@{/g,'{{')[_0xeefd('0x9')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x3adc1d[_0xeefd('0xc')][_0xeefd('0xd')](),_0xe8200f,_0x3adc1d['message']);}module[_0xeefd('0xe')]=function(_0x1c9fe2){return new winston[(_0xeefd('0xf'))]({'transports':[new winston['transports'][(_0xeefd('0x10'))]({'name':util[_0xeefd('0x6')]('%s-%s',_0x1c9fe2,_0xeefd('0x11')),'filename':filename(_0x1c9fe2,_0xeefd('0x11')),'level':_0xeefd('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x56863c){return formatter(_0x1c9fe2,_0x56863c);}}),new winston[(_0xeefd('0x12'))][(_0xeefd('0x10'))]({'name':util[_0xeefd('0x6')]('%s-%s',_0x1c9fe2,_0xeefd('0x13')),'filename':filename(_0x1c9fe2,_0xeefd('0x13')),'level':_0xeefd('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4daef1){return formatter(_0x1c9fe2,_0x4daef1);}}),new winston[(_0xeefd('0x12'))][(_0xeefd('0x14'))]({'level':process['env'][_0xeefd('0x15')]||debugLevel,'json':![],'formatter':function(_0x1aaf96){return formatter(_0x1c9fe2,_0x1aaf96);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c51d880..c5cacfe 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 _0x3a94=['../../services/xdr/index.js','path','express','join','agi','../../services/agi/index.js','email','routing','xdr'];(function(_0x5f5641,_0x20bd42){var _0x3090cb=function(_0x2dfbe3){while(--_0x2dfbe3){_0x5f5641['push'](_0x5f5641['shift']());}};_0x3090cb(++_0x20bd42);}(_0x3a94,0xd0));var _0x43a9=function(_0x197058,_0xa42002){_0x197058=_0x197058-0x0;var _0x10df0d=_0x3a94[_0x197058];return _0x10df0d;};'use strict';var path=require(_0x43a9('0x0'));var os=require('os');var config={'apps':[{'name':_0x43a9('0x1'),'script':path[_0x43a9('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0x43a9('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x43a9('0x3'),'script':path['join'](__dirname,_0x43a9('0x4'))},{'name':_0x43a9('0x5'),'script':path[_0x43a9('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x43a9('0x6'),'script':path[_0x43a9('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x43a9('0x7'),'script':path[_0x43a9('0x2')](__dirname,_0x43a9('0x8'))}]};module['exports']=config; \ No newline at end of file +var _0x4e2b=['../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x45a541,_0x55e3c9){var _0x27cae8=function(_0x2648dd){while(--_0x2648dd){_0x45a541['push'](_0x45a541['shift']());}};_0x27cae8(++_0x55e3c9);}(_0x4e2b,0x76));var _0xb4e2=function(_0x53bf4b,_0x5b587b){_0x53bf4b=_0x53bf4b-0x0;var _0x3d160e=_0x4e2b[_0x53bf4b];return _0x3d160e;};'use strict';var path=require(_0xb4e2('0x0'));var os=require('os');var config={'apps':[{'name':_0xb4e2('0x1'),'script':path[_0xb4e2('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x3'))},{'name':'agi','script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x4'))},{'name':'email','script':path['join'](__dirname,_0xb4e2('0x5'))},{'name':_0xb4e2('0x6'),'script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x7'))},{'name':_0xb4e2('0x8'),'script':path['join'](__dirname,_0xb4e2('0x9'))}]};module[_0xb4e2('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2e0c69b..4281f42 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 _0x691f=['saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x691f,0xc4));var _0xf691=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x691f[_0x2212d1];return _0x15eec5;};'use strict';var pm2=require(_0xf691('0x0'));var BPromise=require(_0xf691('0x1'));var config=require(_0xf691('0x2'));function connect(){return new BPromise(function(_0x5d8893,_0x4515db){return pm2[_0xf691('0x3')](function(_0x519ee9){if(_0x519ee9){return _0x4515db(_0x519ee9);}return _0x5d8893(_0xf691('0x4'));});});};exports[_0xf691('0x5')]=function(_0x54d82d){return connect()[_0xf691('0x6')](function(){return new BPromise(function(_0x329337,_0xee4835){return pm2['start'](_0x54d82d,function(_0x39ab62,_0x5a282f){if(_0x39ab62){return _0xee4835(_0x39ab62);}pm2[_0xf691('0x7')]();return _0x329337(_0x5a282f);});});});};exports[_0xf691('0x8')]=function(_0x442938){return connect()['then'](function(){return new BPromise(function(_0x3f220d,_0x1a1519){return pm2['stop'](_0x442938,function(_0x228c3c,_0x38bf00){if(_0x228c3c){return _0x1a1519(_0x228c3c);}pm2[_0xf691('0x7')]();return _0x3f220d(_0x38bf00);});});});};exports[_0xf691('0x9')]=function(_0x3d2075){return connect()[_0xf691('0x6')](function(){return new BPromise(function(_0x40bfb5,_0x5b4d91){return pm2[_0xf691('0x9')](_0x3d2075,function(_0x5f92c6,_0x55adf2){if(_0x5f92c6){return _0x5b4d91(_0x5f92c6);}pm2['disconnect']();return _0x40bfb5(_0x55adf2);});});});};exports[_0xf691('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x28ed23,_0x3c662b){return pm2[_0xf691('0xa')](function(_0x28c904,_0x3dfa5d){if(_0x28c904){return _0x3c662b(_0x28c904);}pm2[_0xf691('0x7')]();return _0x28ed23(_0x3dfa5d);});});});};exports['describe']=function(_0x423f23){return connect()['then'](function(){return new BPromise(function(_0x2bc592,_0x1a567d){return pm2[_0xf691('0xb')](_0x423f23,function(_0x4823cf,_0x4f5737){if(_0x4823cf){return _0x1a567d(_0x4823cf);}pm2[_0xf691('0x7')]();return _0x2bc592(_0x4f5737);});});});};exports[_0xf691('0xc')]=function(_0x2d2833){return connect()[_0xf691('0x6')](function(){return new BPromise(function(_0x252132,_0x7885e2){return pm2[_0xf691('0xc')](_0x2d2833,function(_0x5b00d8,_0x4ff64f){if(_0x5b00d8){return _0x7885e2(_0x5b00d8);}pm2['disconnect']();return _0x252132(_0x4ff64f);});});});};exports[_0xf691('0xd')]=function(){return connect()[_0xf691('0x6')](function(){return new BPromise(function(_0x581e89,_0x59861d){return pm2[_0xf691('0xd')](function(_0x3978b2){if(_0x3978b2){return _0x59861d(_0x3978b2);}return _0x581e89(_0xf691('0xe'));});});});}; \ No newline at end of file +var _0xfe11=['bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x283b55,_0x279bee){var _0x192e58=function(_0x535c7c){while(--_0x535c7c){_0x283b55['push'](_0x283b55['shift']());}};_0x192e58(++_0x279bee);}(_0xfe11,0x1dc));var _0x1fe1=function(_0x2a8010,_0x464b2a){_0x2a8010=_0x2a8010-0x0;var _0xddf282=_0xfe11[_0x2a8010];return _0xddf282;};'use strict';var pm2=require('pm2');var BPromise=require(_0x1fe1('0x0'));var config=require(_0x1fe1('0x1'));function connect(){return new BPromise(function(_0x3449ba,_0x46686a){return pm2[_0x1fe1('0x2')](function(_0x6bd38e){if(_0x6bd38e){return _0x46686a(_0x6bd38e);}return _0x3449ba(_0x1fe1('0x3'));});});};exports[_0x1fe1('0x4')]=function(_0x40e262){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x4b0504,_0x24804c){return pm2[_0x1fe1('0x4')](_0x40e262,function(_0x12ec13,_0x2a587f){if(_0x12ec13){return _0x24804c(_0x12ec13);}pm2[_0x1fe1('0x6')]();return _0x4b0504(_0x2a587f);});});});};exports[_0x1fe1('0x7')]=function(_0x2586e5){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x252513,_0x2e5681){return pm2[_0x1fe1('0x7')](_0x2586e5,function(_0x5cbdcb,_0x1f560a){if(_0x5cbdcb){return _0x2e5681(_0x5cbdcb);}pm2[_0x1fe1('0x6')]();return _0x252513(_0x1f560a);});});});};exports[_0x1fe1('0x8')]=function(_0xd5c2b3){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x2bbd74,_0x2db316){return pm2[_0x1fe1('0x8')](_0xd5c2b3,function(_0x5b82ed,_0x41a38d){if(_0x5b82ed){return _0x2db316(_0x5b82ed);}pm2[_0x1fe1('0x6')]();return _0x2bbd74(_0x41a38d);});});});};exports[_0x1fe1('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5b1e87,_0x117458){return pm2[_0x1fe1('0x9')](function(_0x5e354a,_0x2ebc4b){if(_0x5e354a){return _0x117458(_0x5e354a);}pm2[_0x1fe1('0x6')]();return _0x5b1e87(_0x2ebc4b);});});});};exports[_0x1fe1('0xa')]=function(_0x387795){return connect()['then'](function(){return new BPromise(function(_0x2e1439,_0x4667dc){return pm2['describe'](_0x387795,function(_0x573dc8,_0x12c249){if(_0x573dc8){return _0x4667dc(_0x573dc8);}pm2[_0x1fe1('0x6')]();return _0x2e1439(_0x12c249);});});});};exports[_0x1fe1('0xb')]=function(_0x39e582){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0xcd2ab1,_0x475d3a){return pm2[_0x1fe1('0xb')](_0x39e582,function(_0x33aa9d,_0x461fdf){if(_0x33aa9d){return _0x475d3a(_0x33aa9d);}pm2[_0x1fe1('0x6')]();return _0xcd2ab1(_0x461fdf);});});});};exports[_0x1fe1('0xc')]=function(){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x2821a5,_0x306b8f){return pm2['dump'](function(_0x49c8ea){if(_0x49c8ea){return _0x306b8f(_0x49c8ea);}return _0x2821a5(_0x1fe1('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d2e0329..48d1407 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 _0x1fb9=['format','YYYY-MM-DD\x20HH:mm:ss','info','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout'];(function(_0x5d71fb,_0x5b3f42){var _0x19bac8=function(_0x436c7d){while(--_0x436c7d){_0x5d71fb['push'](_0x5d71fb['shift']());}};_0x19bac8(++_0x5b3f42);}(_0x1fb9,0x91));var _0x91fb=function(_0x276f6d,_0x10a50e){_0x276f6d=_0x276f6d-0x0;var _0xda31b5=_0x1fb9[_0x276f6d];return _0xda31b5;};'use strict';var _=require(_0x91fb('0x0'));var moment=require(_0x91fb('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x91fb('0x2'));var db=require(_0x91fb('0x3'))['db'];var logger=require('../logger')(_0x91fb('0x4'));config[_0x91fb('0x5')]=_[_0x91fb('0x6')](config['redis'],{'host':_0x91fb('0x7'),'port':0x18eb});var io=require(_0x91fb('0x8'))(new Redis(config[_0x91fb('0x5')]));function closeInteractions(){var _0x2c47f7=0x0;var _0x30a268=[];return db[_0x91fb('0x9')][_0x91fb('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x91fb('0xb')](function(_0x54bc59){_0x2c47f7=_0x54bc59[_0x91fb('0xc')];if(_0x2c47f7){return db[_0x91fb('0xd')][_0x91fb('0xe')]({'raw':!![],'attributes':['id',_0x91fb('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x91fb('0x10')](_0x54bc59[_0x91fb('0xc')],_0x91fb('0x11'))}}});}else{return[];}})['then'](function(_0xb0ae12){if(_0xb0ae12&&_0xb0ae12[_0x91fb('0x12')]){_0x30a268=_[_0x91fb('0x13')](_0xb0ae12||[],'id');logger['info'](_0x91fb('0x14'),_0x30a268[_0x91fb('0x15')]());return db[_0x91fb('0xd')][_0x91fb('0x16')]({'closeReason':_0x91fb('0x17'),'disposition':_0x91fb('0x18'),'closed':!![],'closedAt':moment()[_0x91fb('0x19')](_0x91fb('0x1a'))},{'where':{'id':_0x30a268}});}})['then'](function(){if(_0x30a268&&_0x30a268['length']){logger[_0x91fb('0x1b')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x30a268[_0x91fb('0x15')]());for(var _0x50c2e7=0x0;_0x50c2e7<_0x30a268[_0x91fb('0x12')];_0x50c2e7++){io[_0x91fb('0x1c')](_0x91fb('0x1d'),{'id':_0x30a268[_0x50c2e7],'closed':!![]});}}})[_0x91fb('0x1e')](function(_0x1ac7c8){logger[_0x91fb('0x1f')]('[CHAT]\x20Error\x20closing\x20interactions',_0x1ac7c8?util[_0x91fb('0x20')](_0x1ac7c8,{'showHidden':![],'depth':null}):'');});}exports[_0x91fb('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x090b=['ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','join','chatInteraction:update','catch','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','find','then','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x1c9b9f,_0xe5a84a){var _0x56684a=function(_0x3917ee){while(--_0x3917ee){_0x1c9b9f['push'](_0x1c9b9f['shift']());}};_0x56684a(++_0xe5a84a);}(_0x090b,0x19f));var _0xb090=function(_0x131248,_0x324b5e){_0x131248=_0x131248-0x0;var _0x14c54f=_0x090b[_0x131248];return _0x14c54f;};'use strict';var _=require(_0xb090('0x0'));var moment=require(_0xb090('0x1'));var Redis=require(_0xb090('0x2'));var util=require(_0xb090('0x3'));var config=require('../../config/environment');var db=require(_0xb090('0x4'))['db'];var logger=require(_0xb090('0x5'))(_0xb090('0x6'));config['redis']=_[_0xb090('0x7')](config[_0xb090('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb090('0x9'))(new Redis(config[_0xb090('0x8')]));function closeInteractions(){var _0xe4431e=0x0;var _0x2797c5=[];return db['Setting'][_0xb090('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xb090('0xb')](function(_0x457666){_0xe4431e=_0x457666['chatTimeout'];if(_0xe4431e){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x457666['chatTimeout'],_0xb090('0xc'))}}});}else{return[];}})[_0xb090('0xb')](function(_0x2805b2){if(_0x2805b2&&_0x2805b2[_0xb090('0xd')]){_0x2797c5=_[_0xb090('0xe')](_0x2805b2||[],'id');logger[_0xb090('0xf')](_0xb090('0x10'),_0x2797c5['join']());return db[_0xb090('0x11')][_0xb090('0x12')]({'closeReason':_0xb090('0x13'),'disposition':_0xb090('0x14'),'closed':!![],'closedAt':moment()['format'](_0xb090('0x15'))},{'where':{'id':_0x2797c5}});}})['then'](function(){if(_0x2797c5&&_0x2797c5[_0xb090('0xd')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2797c5[_0xb090('0x16')]());for(var _0x13aa7e=0x0;_0x13aa7e<_0x2797c5[_0xb090('0xd')];_0x13aa7e++){io['emit'](_0xb090('0x17'),{'id':_0x2797c5[_0x13aa7e],'closed':!![]});}}})[_0xb090('0x18')](function(_0x116c9b){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x116c9b?util[_0xb090('0x19')](_0x116c9b,{'showHidden':![],'depth':null}):'');});}exports[_0xb090('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ebca9a2..7cdaef8 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 _0x8a5b=['basename','savename','extname','status','Sent','message','attachments','text','stringify','existsSync','empty\x20file,\x20email\x20not\x20sent','request','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','keys','jobs','map','toString','difference','intersection','stop','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','add\x20cron','exists','stop\x20cron','isBetween','update','update\x20cron','run','start','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','%s.%s'];(function(_0x3d2a90,_0x2073ae){var _0x33fb5c=function(_0x107138){while(--_0x107138){_0x3d2a90['push'](_0x3d2a90['shift']());}};_0x33fb5c(++_0x2073ae);}(_0x8a5b,0x93));var _0xb8a5=function(_0x4681e7,_0x3ab7f2){_0x4681e7=_0x4681e7-0x0;var _0x4531f6=_0x8a5b[_0x4681e7];return _0x4531f6;};'use strict';var fs=require('fs');var util=require(_0xb8a5('0x0'));var path=require(_0xb8a5('0x1'));var _=require(_0xb8a5('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xb8a5('0x3'));var BPromise=require(_0xb8a5('0x4'));var logger=require(_0xb8a5('0x5'))(_0xb8a5('0x6'));var db=require(_0xb8a5('0x7'))['db'];var analyticCustomReportController=require(_0xb8a5('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb8a5('0x9')][_0xb8a5('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2de14b,_0x3f13ff){return function(){logger[_0xb8a5('0xb')](_0xb8a5('0xc'),_0x2de14b[_0xb8a5('0xd')]);var _0x5b900a=!![];var _0x31212f={'tls':{'rejectUnauthorized':![]}};if(_0x2de14b[_0xb8a5('0xe')]['Smtp'][_0xb8a5('0xf')]){_0x31212f[_0xb8a5('0xf')]=_0x2de14b[_0xb8a5('0xe')][_0xb8a5('0x10')][_0xb8a5('0xf')];}else{_0x31212f[_0xb8a5('0x11')]=_0x2de14b[_0xb8a5('0xe')][_0xb8a5('0x10')][_0xb8a5('0x11')];_0x31212f[_0xb8a5('0x12')]=_0x2de14b['MailAccount'][_0xb8a5('0x10')][_0xb8a5('0x12')];_0x31212f[_0xb8a5('0x13')]=_0x2de14b[_0xb8a5('0xe')][_0xb8a5('0x10')][_0xb8a5('0x13')];}if(_0x2de14b['MailAccount']['Smtp'][_0xb8a5('0x14')]){_0x31212f[_0xb8a5('0x15')]={'user':_0x2de14b[_0xb8a5('0xe')]['Smtp'][_0xb8a5('0x16')],'pass':_0x2de14b[_0xb8a5('0xe')][_0xb8a5('0x10')][_0xb8a5('0x17')]};}var _0x126ee1={'account':_0x31212f,'message':{'from':util[_0xb8a5('0x18')](_0xb8a5('0x19'),_0x2de14b['MailAccount']['name'],_0x2de14b[_0xb8a5('0xe')][_0xb8a5('0xd')]||_0x2de14b['MailAccount'][_0xb8a5('0x10')][_0xb8a5('0x16')]),'to':_0x2de14b[_0xb8a5('0xd')],'cc':_0x2de14b['cc'],'bcc':_0x2de14b[_0xb8a5('0x1a')],'subject':util[_0xb8a5('0x18')](_0xb8a5('0x1b'),_0x3f13ff['name'],_0x2de14b['subtractNumber'],_0x2de14b[_0xb8a5('0x1c')])}};var _0x2969b3=path[_0xb8a5('0x1d')](__dirname,'../../files/reports');var _0x35a868=_0x3f13ff['savename'];var _0x40e161=util[_0xb8a5('0x18')](_0xb8a5('0x1e'),path[_0xb8a5('0x1f')](_0x3f13ff[_0xb8a5('0x20')],path[_0xb8a5('0x21')](_0x3f13ff['savename'])),'zip');var _0x5e93c7=path[_0xb8a5('0x1d')](_0x2969b3,_0x35a868);var _0x4f6da9=path[_0xb8a5('0x1d')](_0x2969b3,_0x40e161);if(fs['existsSync'](_0x5e93c7)){_0x3f13ff[_0xb8a5('0x22')]=_0xb8a5('0x23');_0x126ee1[_0xb8a5('0x24')][_0xb8a5('0x25')]=[{'filename':_0x35a868,'path':_0x5e93c7}];_0x126ee1[_0xb8a5('0x24')][_0xb8a5('0x26')]=util[_0xb8a5('0x18')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xb8a5('0x27')](_0x3f13ff,null,0x2));}else if(fs[_0xb8a5('0x28')](_0x4f6da9)){_0x3f13ff[_0xb8a5('0x22')]=_0xb8a5('0x23');_0x126ee1['message'][_0xb8a5('0x25')]=[{'filename':_0x40e161,'path':_0x4f6da9}];}else{_0x126ee1[_0xb8a5('0x24')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2de14b['sendIfEmpty']){_0x5b900a=![];logger[_0xb8a5('0xb')](_0xb8a5('0x29'));}}if(_0x5b900a){return client[_0xb8a5('0x2a')]('SendMail',_0x126ee1)['then'](function(_0x5ac5b2){if(_0x5ac5b2[_0xb8a5('0x2b')]){return logger[_0xb8a5('0x2b')](_0xb8a5('0x2c'),JSON['stringify'](_0x5ac5b2));}return logger[_0xb8a5('0xb')](_0xb8a5('0x2d'));})[_0xb8a5('0x2e')](function(_0x1bda95){return logger['error'](_0xb8a5('0x2c'),JSON['stringify'](_0x1bda95));});}};}function handleError(){return function(_0x308852){return logger['error'](JSON[_0xb8a5('0x27')](_0x308852));};}function handleResult(_0xef2b1a){return function(_0x2297db){logger[_0xb8a5('0xb')](_0xb8a5('0x2f'),JSON[_0xb8a5('0x27')](_0x2297db));if(_0xef2b1a[_0xb8a5('0xe')]&&_0xef2b1a['MailAccount'][_0xb8a5('0x10')]&&!_[_0xb8a5('0x30')](_0xef2b1a[_0xb8a5('0xd')])){setTimeout(handleSendEmail(_0xef2b1a,_0x2297db),0x3c*0x3e8);}};}function handleJob(_0x403ef6){return function(){try{if(_[_0xb8a5('0x30')](_0x403ef6[_0xb8a5('0x31')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb8a5('0x30')](_0x403ef6[_0xb8a5('0x1c')])){return logger[_0xb8a5('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5a2c26={'startDate':moment()[_0xb8a5('0x32')](_0x403ef6[_0xb8a5('0x31')],_0x403ef6['subtractUnit'])[_0xb8a5('0x18')](_0xb8a5('0x33')),'endDate':moment()[_0xb8a5('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb8a5('0x34'),'output':_0x403ef6[_0xb8a5('0x35')],'name':_0x403ef6[_0xb8a5('0x36')]};if(!_['isNil'](_0x403ef6[_0xb8a5('0x37')])){logger[_0xb8a5('0xb')](_0xb8a5('0x38'),_0x403ef6['DefaultReportId']);return analyticDefaultReportController[_0xb8a5('0x39')]({'id':_0x403ef6[_0xb8a5('0x37')]},_0x5a2c26)[_0xb8a5('0x3a')](handleResult(_0x403ef6))[_0xb8a5('0x2e')](handleError());}if(!_[_0xb8a5('0x30')](_0x403ef6[_0xb8a5('0x3b')])){logger['info'](_0xb8a5('0x3c'),_0x403ef6[_0xb8a5('0x3b')]);return analyticCustomReportController[_0xb8a5('0x39')]({'id':_0x403ef6[_0xb8a5('0x3b')]},_0x5a2c26)[_0xb8a5('0x3a')](handleResult(_0x403ef6))[_0xb8a5('0x2e')](handleError());}}catch(_0x587bc5){logger[_0xb8a5('0x2b')](JSON['stringify'](_0x587bc5));}return logger[_0xb8a5('0xb')]('no\x20report\x20id');};}function getJobs(_0x1c6f54){var _0x57ac4e={};if(_0x1c6f54){_0x57ac4e['id']=_0x1c6f54;}return db[_0xb8a5('0x3d')]['findAll']({'where':_0x57ac4e,'include':[{'model':db[_0xb8a5('0xe')],'attributes':['id',_0xb8a5('0x36'),_0xb8a5('0xd')],'include':[{'model':db['MailServerOut'],'as':_0xb8a5('0x10')}]}]})[_0xb8a5('0x3a')](function(_0x5738e5){var _0x35840a=_[_0xb8a5('0x3e')](manager[_0xb8a5('0x3f')]);var _0x4f5d22=_[_0xb8a5('0x40')](_0x5738e5,function(_0x36be5d){return _0x36be5d['id']['toString']();});var _0x43bb59=_['keyBy'](_0x5738e5,function(_0x5813aa){return _0x5813aa['id'][_0xb8a5('0x41')]();});var _0x1a7cd6=_0x1c6f54?_0x4f5d22:_[_0xb8a5('0x42')](_0x4f5d22,_0x35840a);var _0x4c38b2=_[_0xb8a5('0x43')](_0x4f5d22,_0x35840a);var _0x2098e5=_[_0xb8a5('0x42')](_0x35840a,_0x4f5d22);var _0x549152;var _0x136c8d;for(_0x549152=0x0;_0x549152<_0x2098e5['length']&&!_0x1c6f54;_0x549152+=0x1){_0x136c8d=_0x2098e5[_0x549152]['toString']();if(manager['exists'](_0x136c8d)){manager[_0xb8a5('0x44')](_0x136c8d);manager[_0xb8a5('0x45')](_0x136c8d);logger['info'](_0xb8a5('0x46'),_0x136c8d);}}logger[_0xb8a5('0xb')](_0xb8a5('0x47'),JSON[_0xb8a5('0x27')](_0x1a7cd6));for(_0x549152=0x0;_0x549152<_0x1a7cd6[_0xb8a5('0x48')];_0x549152+=0x1){_0x136c8d=_0x1a7cd6[_0x549152][_0xb8a5('0x41')]();logger[_0xb8a5('0xb')]('index',_0x136c8d);if(_0x1c6f54){logger[_0xb8a5('0xb')](_0xb8a5('0x49'),_0x1c6f54);logger[_0xb8a5('0xb')](JSON[_0xb8a5('0x27')](_0x43bb59[_0x136c8d]));BPromise[_0xb8a5('0x4a')]()[_0xb8a5('0x3a')](handleJob(_0x43bb59[_0x136c8d]));logger['info'](_0xb8a5('0x4b'),_0x43bb59[_0x136c8d]['name'],_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]);}else if(_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]&&_0x43bb59[_0x136c8d][_0xb8a5('0x4d')]&&moment()['isBetween'](_0x43bb59[_0x136c8d][_0xb8a5('0x4e')],_0x43bb59[_0x136c8d][_0xb8a5('0x4f')])){manager[_0xb8a5('0x50')](_0x136c8d,_0x43bb59[_0x136c8d]['cron'],handleJob(_0x43bb59[_0x136c8d]));manager['start'](_0x136c8d);logger[_0xb8a5('0xb')](_0xb8a5('0x51'),_0x43bb59[_0x136c8d][_0xb8a5('0x36')],_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]);}else if(manager[_0xb8a5('0x52')](_0x136c8d)){manager[_0xb8a5('0x44')](_0x136c8d);manager['deleteJob'](_0x136c8d);logger[_0xb8a5('0xb')](_0xb8a5('0x53'),_0x43bb59[_0x136c8d][_0xb8a5('0x36')],_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]);}}for(_0x549152=0x0,_0x136c8d;_0x549152<_0x4c38b2[_0xb8a5('0x48')]&&!_0x1c6f54;_0x549152+=0x1){_0x136c8d=_0x4c38b2[_0x549152][_0xb8a5('0x41')]();if(manager['exists'](_0x136c8d)){if(_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]&&_0x43bb59[_0x136c8d]['active']&&moment()[_0xb8a5('0x54')](_0x43bb59[_0x136c8d][_0xb8a5('0x4e')],_0x43bb59[_0x136c8d][_0xb8a5('0x4f')])){manager[_0xb8a5('0x55')](_0x136c8d,_0x43bb59[_0x136c8d]['cron'],handleJob(_0x43bb59[_0x136c8d]));logger[_0xb8a5('0xb')](_0xb8a5('0x56'),_0x43bb59[_0x136c8d]['name'],_0x43bb59[_0x136c8d]['cron']);}else{manager['stop'](_0x136c8d);manager[_0xb8a5('0x45')](_0x136c8d);logger[_0xb8a5('0xb')](_0xb8a5('0x53'),_0x43bb59[_0x136c8d][_0xb8a5('0x36')],_0x43bb59[_0x136c8d][_0xb8a5('0x4c')]);}}}})[_0xb8a5('0x2e')](function(_0x4a5176){logger['error'](JSON[_0xb8a5('0x27')](_0x4a5176));});}exports[_0xb8a5('0x57')]=function(_0x17a8e2){return getJobs(_0x17a8e2);};exports[_0xb8a5('0x58')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xdada=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','catch','CustomReportId','Schedule','findAll','MailServerOut','keys','map','toString','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','add\x20cron','exists','deleteJob','stop\x20cron','active','update','run','start','util','path','lodash','moment','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','%s.%s','zip','join','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','text'];(function(_0xeb8c5c,_0x5ae487){var _0x445bcf=function(_0x400a40){while(--_0x400a40){_0xeb8c5c['push'](_0xeb8c5c['shift']());}};_0x445bcf(++_0x5ae487);}(_0xdada,0x1d6));var _0xadad=function(_0x2ff42d,_0x251617){_0x2ff42d=_0x2ff42d-0x0;var _0x4a0c87=_0xdada[_0x2ff42d];return _0x4a0c87;};'use strict';var fs=require('fs');var util=require(_0xadad('0x0'));var path=require(_0xadad('0x1'));var _=require(_0xadad('0x2'));var moment=require(_0xadad('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xadad('0x4'));var BPromise=require('bluebird');var logger=require(_0xadad('0x5'))('schedule');var db=require(_0xadad('0x6'))['db'];var analyticCustomReportController=require(_0xadad('0x7'));var analyticDefaultReportController=require(_0xadad('0x8'));var client=jayson['client'][_0xadad('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2ea8ba,_0x18f9c3){return function(){logger[_0xadad('0xa')](_0xadad('0xb'),_0x2ea8ba[_0xadad('0xc')]);var _0x267497=!![];var _0x338aca={'tls':{'rejectUnauthorized':![]}};if(_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0xf')]){_0x338aca[_0xadad('0xf')]=_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0xf')];}else{_0x338aca[_0xadad('0x10')]=_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x10')];_0x338aca['port']=_0x2ea8ba[_0xadad('0xd')]['Smtp'][_0xadad('0x11')];_0x338aca[_0xadad('0x12')]=_0x2ea8ba['MailAccount'][_0xadad('0xe')][_0xadad('0x12')];}if(_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x13')]){_0x338aca[_0xadad('0x14')]={'user':_0x2ea8ba['MailAccount']['Smtp'][_0xadad('0x15')],'pass':_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x16')]};}var _0x217d2f={'account':_0x338aca,'message':{'from':util[_0xadad('0x17')](_0xadad('0x18'),_0x2ea8ba[_0xadad('0xd')][_0xadad('0x19')],_0x2ea8ba['MailAccount'][_0xadad('0xc')]||_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x15')]),'to':_0x2ea8ba[_0xadad('0xc')],'cc':_0x2ea8ba['cc'],'bcc':_0x2ea8ba['bcc'],'subject':util[_0xadad('0x17')](_0xadad('0x1a'),_0x18f9c3[_0xadad('0x19')],_0x2ea8ba[_0xadad('0x1b')],_0x2ea8ba[_0xadad('0x1c')])}};var _0x740501=path['join'](__dirname,_0xadad('0x1d'));var _0x2adf76=_0x18f9c3['savename'];var _0x133b97=util[_0xadad('0x17')](_0xadad('0x1e'),path['basename'](_0x18f9c3['savename'],path['extname'](_0x18f9c3['savename'])),_0xadad('0x1f'));var _0x398ce5=path[_0xadad('0x20')](_0x740501,_0x2adf76);var _0x2c530f=path['join'](_0x740501,_0x133b97);if(fs['existsSync'](_0x398ce5)){_0x18f9c3[_0xadad('0x21')]=_0xadad('0x22');_0x217d2f[_0xadad('0x23')]['attachments']=[{'filename':_0x2adf76,'path':_0x398ce5}];_0x217d2f['message']['text']=util[_0xadad('0x17')](_0xadad('0x24'),JSON[_0xadad('0x25')](_0x18f9c3,null,0x2));}else if(fs[_0xadad('0x26')](_0x2c530f)){_0x18f9c3[_0xadad('0x21')]='Sent';_0x217d2f[_0xadad('0x23')]['attachments']=[{'filename':_0x133b97,'path':_0x2c530f}];}else{_0x217d2f[_0xadad('0x23')][_0xadad('0x27')]=_0xadad('0x28');if(!_0x2ea8ba[_0xadad('0x29')]){_0x267497=![];logger['info'](_0xadad('0x2a'));}}if(_0x267497){return client['request']('SendMail',_0x217d2f)[_0xadad('0x2b')](function(_0x2e22ac){if(_0x2e22ac[_0xadad('0x2c')]){return logger[_0xadad('0x2c')](_0xadad('0x2d'),JSON[_0xadad('0x25')](_0x2e22ac));}return logger[_0xadad('0xa')](_0xadad('0x2e'));})['catch'](function(_0x582e48){return logger['error'](_0xadad('0x2d'),JSON['stringify'](_0x582e48));});}};}function handleError(){return function(_0x4e9a14){return logger[_0xadad('0x2c')](JSON[_0xadad('0x25')](_0x4e9a14));};}function handleResult(_0x5ce726){return function(_0x24e9ba){logger[_0xadad('0xa')](_0xadad('0x2f'),JSON['stringify'](_0x24e9ba));if(_0x5ce726[_0xadad('0xd')]&&_0x5ce726['MailAccount'][_0xadad('0xe')]&&!_['isNil'](_0x5ce726[_0xadad('0xc')])){setTimeout(handleSendEmail(_0x5ce726,_0x24e9ba),0x3c*0x3e8);}};}function handleJob(_0x594e9b){return function(){try{if(_[_0xadad('0x30')](_0x594e9b[_0xadad('0x1b')])){return logger[_0xadad('0xa')](_0xadad('0x31'));}if(_[_0xadad('0x30')](_0x594e9b[_0xadad('0x1c')])){return logger[_0xadad('0xa')](_0xadad('0x32'));}var _0xdf17ab={'startDate':moment()['subtract'](_0x594e9b['subtractNumber'],_0x594e9b[_0xadad('0x1c')])[_0xadad('0x17')](_0xadad('0x33')),'endDate':moment()[_0xadad('0x17')](_0xadad('0x33')),'type':'scheduled','output':_0x594e9b[_0xadad('0x34')],'name':_0x594e9b[_0xadad('0x19')]};if(!_['isNil'](_0x594e9b[_0xadad('0x35')])){logger[_0xadad('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x594e9b[_0xadad('0x35')]);return analyticDefaultReportController[_0xadad('0x36')]({'id':_0x594e9b[_0xadad('0x35')]},_0xdf17ab)[_0xadad('0x2b')](handleResult(_0x594e9b))[_0xadad('0x37')](handleError());}if(!_[_0xadad('0x30')](_0x594e9b[_0xadad('0x38')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x594e9b[_0xadad('0x38')]);return analyticCustomReportController[_0xadad('0x36')]({'id':_0x594e9b[_0xadad('0x38')]},_0xdf17ab)[_0xadad('0x2b')](handleResult(_0x594e9b))['catch'](handleError());}}catch(_0xd44355){logger['error'](JSON['stringify'](_0xd44355));}return logger[_0xadad('0xa')]('no\x20report\x20id');};}function getJobs(_0x1402ec){var _0x3f34c5={};if(_0x1402ec){_0x3f34c5['id']=_0x1402ec;}return db[_0xadad('0x39')][_0xadad('0x3a')]({'where':_0x3f34c5,'include':[{'model':db[_0xadad('0xd')],'attributes':['id','name',_0xadad('0xc')],'include':[{'model':db[_0xadad('0x3b')],'as':_0xadad('0xe')}]}]})['then'](function(_0x23dfd0){var _0x1c0433=_[_0xadad('0x3c')](manager['jobs']);var _0x2b9107=_[_0xadad('0x3d')](_0x23dfd0,function(_0x1598ce){return _0x1598ce['id'][_0xadad('0x3e')]();});var _0xfee21c=_['keyBy'](_0x23dfd0,function(_0x15639c){return _0x15639c['id']['toString']();});var _0xc79a18=_0x1402ec?_0x2b9107:_[_0xadad('0x3f')](_0x2b9107,_0x1c0433);var _0x4e305e=_[_0xadad('0x40')](_0x2b9107,_0x1c0433);var _0x1fd271=_['difference'](_0x1c0433,_0x2b9107);var _0x45c81f;var _0x913aa9;for(_0x45c81f=0x0;_0x45c81f<_0x1fd271[_0xadad('0x41')]&&!_0x1402ec;_0x45c81f+=0x1){_0x913aa9=_0x1fd271[_0x45c81f][_0xadad('0x3e')]();if(manager['exists'](_0x913aa9)){manager[_0xadad('0x42')](_0x913aa9);manager['deleteJob'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x43'),_0x913aa9);}}logger[_0xadad('0xa')](_0xadad('0x44'),JSON[_0xadad('0x25')](_0xc79a18));for(_0x45c81f=0x0;_0x45c81f<_0xc79a18['length'];_0x45c81f+=0x1){_0x913aa9=_0xc79a18[_0x45c81f]['toString']();logger[_0xadad('0xa')](_0xadad('0x45'),_0x913aa9);if(_0x1402ec){logger['info'](_0xadad('0x46'),_0x1402ec);logger[_0xadad('0xa')](JSON[_0xadad('0x25')](_0xfee21c[_0x913aa9]));BPromise[_0xadad('0x47')]()[_0xadad('0x2b')](handleJob(_0xfee21c[_0x913aa9]));logger[_0xadad('0xa')](_0xadad('0x48'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else if(_0xfee21c[_0x913aa9][_0xadad('0x49')]&&_0xfee21c[_0x913aa9]['active']&&moment()[_0xadad('0x4a')](_0xfee21c[_0x913aa9][_0xadad('0x4b')],_0xfee21c[_0x913aa9]['endAt'])){manager[_0xadad('0x4c')](_0x913aa9,_0xfee21c[_0x913aa9][_0xadad('0x49')],handleJob(_0xfee21c[_0x913aa9]));manager['start'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x4d'),_0xfee21c[_0x913aa9]['name'],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else if(manager[_0xadad('0x4e')](_0x913aa9)){manager[_0xadad('0x42')](_0x913aa9);manager[_0xadad('0x4f')](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x50'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9]['cron']);}}for(_0x45c81f=0x0,_0x913aa9;_0x45c81f<_0x4e305e[_0xadad('0x41')]&&!_0x1402ec;_0x45c81f+=0x1){_0x913aa9=_0x4e305e[_0x45c81f][_0xadad('0x3e')]();if(manager[_0xadad('0x4e')](_0x913aa9)){if(_0xfee21c[_0x913aa9][_0xadad('0x49')]&&_0xfee21c[_0x913aa9][_0xadad('0x51')]&&moment()[_0xadad('0x4a')](_0xfee21c[_0x913aa9][_0xadad('0x4b')],_0xfee21c[_0x913aa9]['endAt'])){manager[_0xadad('0x52')](_0x913aa9,_0xfee21c[_0x913aa9][_0xadad('0x49')],handleJob(_0xfee21c[_0x913aa9]));logger[_0xadad('0xa')]('update\x20cron',_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else{manager[_0xadad('0x42')](_0x913aa9);manager['deleteJob'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x50'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}}}})[_0xadad('0x37')](function(_0xbd3674){logger[_0xadad('0x2c')](JSON[_0xadad('0x25')](_0xbd3674));});}exports[_0xadad('0x53')]=function(_0x17232e){return getJobs(_0x17232e);};exports[_0xadad('0x54')]=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 599aaa9..83e3e88 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 _0x0caf=['SentimentScore','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','resolve','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','error','start','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','info','format','transcribeName','transcribeRegion','then','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','Sentiment','Positive'];(function(_0x3c007e,_0x2e6adc){var _0x851f31=function(_0x12bf84){while(--_0x12bf84){_0x3c007e['push'](_0x3c007e['shift']());}};_0x851f31(++_0x2e6adc);}(_0x0caf,0x9f));var _0xf0ca=function(_0x4cb32b,_0x93a808){_0x4cb32b=_0x4cb32b-0x0;var _0x107356=_0x0caf[_0x4cb32b];return _0x107356;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xf0ca('0x0'));var BPromise=require(_0xf0ca('0x1'));var db=require(_0xf0ca('0x2'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x465754,_0x1f5d08,_0x5166b4,_0x25d49b){return new Promise(function(_0x1053ad,_0xe9a74){var _0x59f602=new AWS[(_0xf0ca('0x3'))]({'accessKeyId':_0x1f5d08,'secretAccessKey':_0x465754,'region':_0x5166b4});_0x59f602[_0xf0ca('0x4')]({'TranscriptionJobName':_0x25d49b},function(_0x10d826,_0x271297){if(_0x10d826){return _0xe9a74(_0x10d826);}else{return _0x1053ad(_0x271297);}});});}function sentiment(_0x46711a,_0x455d0f,_0x36e2aa,_0x5bbec7,_0x11aa70){return new Promise(function(_0x78f205,_0x1542b6){var _0xa3f45=new AWS[(_0xf0ca('0x5'))]({'accessKeyId':_0x455d0f,'secretAccessKey':_0x46711a,'region':_0x36e2aa});_0xa3f45['detectSentiment']({'Text':_0x5bbec7,'LanguageCode':_0x11aa70['substring'](0x0,0x2)},function(_0x37c70c,_0x4bc890){if(_0x37c70c){return _0x1542b6(_0x37c70c);}else{return _0x78f205(_0x4bc890);}});});}function checkTranscribeJob(_0x330946,_0x582e00,_0x3c1332){var _0x38c595;return new BPromise(function(_0x24fd06,_0x3d52ff){logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x330946['id'],_0x330946[_0xf0ca('0x8')]));return getTranscriptionJob(_0x3c1332['data1'],_0x3c1332['data2'],_0x582e00[_0xf0ca('0x9')],_0x330946[_0xf0ca('0x8')])[_0xf0ca('0xa')](function(_0x2b074e){logger[_0xf0ca('0x6')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x330946['id'],_0x330946[_0xf0ca('0x8')],_0x2b074e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x330946[_0xf0ca('0xb')]){switch(_0x2b074e[_0xf0ca('0xc')][_0xf0ca('0xd')]){case _0xf0ca('0xe'):var _0x3a1466={'transcribeStatus':_0x2b074e[_0xf0ca('0xc')]['TranscriptionJobStatus'],'fileUri':_0x2b074e[_0xf0ca('0xc')]['Transcript'][_0xf0ca('0xf')]};logger[_0xf0ca('0x6')](util['format'](_0xf0ca('0x10'),_0x330946['id']));return rp({'uri':_0x2b074e[_0xf0ca('0xc')][_0xf0ca('0x11')][_0xf0ca('0xf')],'json':!![]})[_0xf0ca('0xa')](function(_0x2e54bf){logger[_0xf0ca('0x6')](util['format'](_0xf0ca('0x12'),_0x330946['id']));if(_0x2e54bf&&_0x2e54bf[_0xf0ca('0x13')]&&_0x2e54bf[_0xf0ca('0x13')][_0xf0ca('0x14')]&&_0x2e54bf[_0xf0ca('0x13')][_0xf0ca('0x14')]['length']){_0x3a1466['fileText']='';for(var _0x1eea57=0x0;_0x1eea57<_0x2e54bf[_0xf0ca('0x13')][_0xf0ca('0x14')][_0xf0ca('0x15')];_0x1eea57++){_0x3a1466[_0xf0ca('0xb')]+=_0x2e54bf[_0xf0ca('0x13')][_0xf0ca('0x14')][_0x1eea57][_0xf0ca('0x16')]+'';}}return _0x330946['update'](_0x3a1466);})['then'](function(){logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x330946['id']));if(!_0x330946[_0xf0ca('0x17')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x1a'));}if(!_0x582e00['sentiment']||!_0x582e00[_0xf0ca('0x1b')]||!_0x582e00[_0xf0ca('0x1c')]||!_0x582e00[_0xf0ca('0x1d')]||!_0x582e00[_0xf0ca('0x1e')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x1f'));}if(!_0x3a1466['fileText']){throw new Error(_0xf0ca('0x20'));}if(_0x582e00['sentimentAccountId']===_0x3c1332['id']){return _0x3c1332;}else{return db[_0xf0ca('0x21')]['findOne']({'where':{'id':_settings[_0xf0ca('0x1b')]}});}})[_0xf0ca('0xa')](function(_0x29202a){if(!_0x29202a){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x22'));}if(!_0x29202a[_0xf0ca('0x23')]||!_0x29202a[_0xf0ca('0x24')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x25'));}_0x38c595=_0x29202a;logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')](_0xf0ca('0x26'),_0x330946['id']));return sentiment(_0x38c595['data1'],_0x38c595[_0xf0ca('0x24')],_0x582e00[_0xf0ca('0x1c')],_0x3a1466[_0xf0ca('0xb')],_0x582e00[_0xf0ca('0x1d')]);})['then'](function(_0x147aeb){logger['info'](util[_0xf0ca('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x330946['id']));return _0x330946[_0xf0ca('0x27')]({'sentiment':_0x147aeb[_0xf0ca('0x28')],'sPositive':_0x147aeb['SentimentScore'][_0xf0ca('0x29')],'sNegative':_0x147aeb['SentimentScore']['Negative'],'sMixed':_0x147aeb[_0xf0ca('0x2a')][_0xf0ca('0x2b')],'sNeutral':_0x147aeb[_0xf0ca('0x2a')][_0xf0ca('0x2c')]});})[_0xf0ca('0xa')](function(){logger['info'](util[_0xf0ca('0x7')](_0xf0ca('0x2d'),_0x330946['id']));_0x24fd06();});case _0xf0ca('0x2e'):return _0x330946[_0xf0ca('0x27')]({'transcribeStatus':_0xf0ca('0x2e'),'failureReason':_0x2b074e[_0xf0ca('0xc')]['FailureReason']})[_0xf0ca('0xa')](function(){logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')](_0xf0ca('0x2d'),_0x330946['id']));_0x24fd06();});default:logger['info'](util[_0xf0ca('0x7')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x330946['id']));break;}}else{return BPromise[_0xf0ca('0x2f')]()[_0xf0ca('0xa')](function(){if(!_0x330946[_0xf0ca('0x17')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x582e00['sentiment']||!_0x582e00[_0xf0ca('0x1b')]||!_0x582e00[_0xf0ca('0x1c')]||!_0x582e00[_0xf0ca('0x1d')]||!_0x582e00[_0xf0ca('0x1e')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x1f'));}if(!_0x330946[_0xf0ca('0xb')]){throw new Error(_0xf0ca('0x20'));}if(_0x582e00[_0xf0ca('0x1b')]===_0x3c1332['id']){return _0x3c1332;}else{return db['CloudProvider'][_0xf0ca('0x30')]({'where':{'id':_settings[_0xf0ca('0x1b')]}});}})[_0xf0ca('0xa')](function(_0x23f901){if(!_0x23f901){throw new db['Sequelize']['ValidationError'](_0xf0ca('0x22'));}if(!_0x23f901[_0xf0ca('0x23')]||!_0x23f901[_0xf0ca('0x24')]){throw new db['Sequelize'][(_0xf0ca('0x19'))](_0xf0ca('0x25'));}_0x38c595=_0x23f901;logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')](_0xf0ca('0x26'),_0x330946['id']));return sentiment(_0x38c595[_0xf0ca('0x23')],_0x38c595[_0xf0ca('0x24')],_0x582e00[_0xf0ca('0x1c')],_0x330946[_0xf0ca('0xb')],_0x582e00[_0xf0ca('0x1d')]);})[_0xf0ca('0xa')](function(_0x328a7a){logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')](_0xf0ca('0x31'),_0x330946['id']));return _0x330946[_0xf0ca('0x27')]({'sentiment':_0x328a7a[_0xf0ca('0x28')],'sPositive':_0x328a7a[_0xf0ca('0x2a')][_0xf0ca('0x29')],'sNegative':_0x328a7a[_0xf0ca('0x2a')][_0xf0ca('0x32')],'sMixed':_0x328a7a[_0xf0ca('0x2a')][_0xf0ca('0x2b')],'sNeutral':_0x328a7a[_0xf0ca('0x2a')][_0xf0ca('0x2c')],'transcribeStatus':'COMPLETED'});})[_0xf0ca('0xa')](function(){logger[_0xf0ca('0x6')](util[_0xf0ca('0x7')](_0xf0ca('0x2d'),_0x330946['id']));_0x24fd06();});}})[_0xf0ca('0x33')](function(_0x5e1b71){if(_0x5e1b71){if(!_0x5e1b71[_0xf0ca('0x34')]||_0x5e1b71[_0xf0ca('0x34')]!=='SequelizeValidationError'){logger['error'](util[_0xf0ca('0x7')](_0xf0ca('0x35'),_0x330946['id']),util[_0xf0ca('0x36')](_0x5e1b71,{'showHidden':![],'depth':null}));}}_0x24fd06();});});}function checkTranscribe(){var _0x500cfb;var _0x17b48a;var _0x5dad46;return db['VoiceRecording'][_0xf0ca('0x37')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x10e117){if(!_0x10e117||!_0x10e117['length']){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x38'));}_0x500cfb=_0x10e117;return db[_0xf0ca('0x39')][_0xf0ca('0x30')]({'where':{'id':0x1}});})[_0xf0ca('0xa')](function(_0x5ef4dc){if(!_0x5ef4dc){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x3a'));}_0x17b48a=_0x5ef4dc;if(!_0x17b48a[_0xf0ca('0x3b')]||!_0x17b48a['transcribeAccountId']||!_0x17b48a[_0xf0ca('0x9')]||!_0x17b48a[_0xf0ca('0x1d')]||!_0x17b48a[_0xf0ca('0x1e')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x3c'));}return db[_0xf0ca('0x21')][_0xf0ca('0x30')]({'where':{'id':_0x17b48a['transcribeAccountId']}});})['then'](function(_0x2333f5){if(!_0x2333f5){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x22'));}if(!_0x2333f5[_0xf0ca('0x23')]||!_0x2333f5[_0xf0ca('0x24')]){throw new db[(_0xf0ca('0x18'))][(_0xf0ca('0x19'))](_0xf0ca('0x25'));}_0x5dad46=_0x2333f5;var _0x2de7e0=[];_0x500cfb[_0xf0ca('0x3d')](function(_0x9fed6d){_0x2de7e0[_0xf0ca('0x3e')](checkTranscribeJob(_0x9fed6d,_0x17b48a,_0x5dad46));});return BPromise[_0xf0ca('0x3f')](_0x2de7e0);})['catch'](function(_0x1f535e){if(_0x1f535e){if(!_0x1f535e[_0xf0ca('0x34')]||_0x1f535e['name']!==_0xf0ca('0x40')){logger[_0xf0ca('0x41')](util['inspect'](_0x1f535e,{'showHidden':![],'depth':null}));}}});}exports[_0xf0ca('0x42')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xbee0=['COMPLETED','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Mixed','catch','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','name','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','transcribeName','data1','data2','transcribeRegion','info','format','TranscriptionJob','fileText'];(function(_0x237956,_0x39a33f){var _0x38e407=function(_0x6e5616){while(--_0x6e5616){_0x237956['push'](_0x237956['shift']());}};_0x38e407(++_0x39a33f);}(_0xbee0,0x147));var _0x0bee=function(_0x334344,_0x4ec177){_0x334344=_0x334344-0x0;var _0x2b035b=_0xbee0[_0x334344];return _0x2b035b;};var _=require('lodash');var AWS=require(_0x0bee('0x0'));var rp=require(_0x0bee('0x1'));var util=require(_0x0bee('0x2'));var BPromise=require(_0x0bee('0x3'));var db=require(_0x0bee('0x4'))['db'];var logger=require(_0x0bee('0x5'))(_0x0bee('0x6'));function getTranscriptionJob(_0xaed51f,_0x4ac5c8,_0x57973b,_0x5871bc){return new Promise(function(_0xd0c8f,_0xa3a091){var _0x3e499b=new AWS[(_0x0bee('0x7'))]({'accessKeyId':_0x4ac5c8,'secretAccessKey':_0xaed51f,'region':_0x57973b});_0x3e499b['getTranscriptionJob']({'TranscriptionJobName':_0x5871bc},function(_0x163a08,_0x123424){if(_0x163a08){return _0xa3a091(_0x163a08);}else{return _0xd0c8f(_0x123424);}});});}function sentiment(_0x19d117,_0x314f79,_0x53a9af,_0x45b1aa,_0x36bb41){return new Promise(function(_0x162614,_0x100031){var _0xe11dcb=new AWS[(_0x0bee('0x8'))]({'accessKeyId':_0x314f79,'secretAccessKey':_0x19d117,'region':_0x53a9af});_0xe11dcb[_0x0bee('0x9')]({'Text':_0x45b1aa,'LanguageCode':_0x36bb41['substring'](0x0,0x2)},function(_0xa2e4f3,_0x5166a0){if(_0xa2e4f3){return _0x100031(_0xa2e4f3);}else{return _0x162614(_0x5166a0);}});});}function checkTranscribeJob(_0x25ab0b,_0x3b99a4,_0x3ab183){var _0x1d85c4;return new BPromise(function(_0x1f50e8,_0x141d88){logger['info'](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x25ab0b['id'],_0x25ab0b[_0x0bee('0xa')]));return getTranscriptionJob(_0x3ab183[_0x0bee('0xb')],_0x3ab183[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0xd')],_0x25ab0b['transcribeName'])['then'](function(_0x54aca4){logger[_0x0bee('0xe')](util[_0x0bee('0xf')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x25ab0b['id'],_0x25ab0b[_0x0bee('0xa')],_0x54aca4[_0x0bee('0x10')]['TranscriptionJobStatus']));if(!_0x25ab0b[_0x0bee('0x11')]){switch(_0x54aca4[_0x0bee('0x10')]['TranscriptionJobStatus']){case _0x0bee('0x12'):var _0x52bbbb={'transcribeStatus':_0x54aca4[_0x0bee('0x10')][_0x0bee('0x13')],'fileUri':_0x54aca4[_0x0bee('0x10')]['Transcript'][_0x0bee('0x14')]};logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x15'),_0x25ab0b['id']));return rp({'uri':_0x54aca4[_0x0bee('0x10')]['Transcript'][_0x0bee('0x14')],'json':!![]})['then'](function(_0x1397f0){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x16'),_0x25ab0b['id']));if(_0x1397f0&&_0x1397f0['results']&&_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')]&&_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')]['length']){_0x52bbbb[_0x0bee('0x11')]='';for(var _0x252ed0=0x0;_0x252ed0<_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')][_0x0bee('0x19')];_0x252ed0++){_0x52bbbb[_0x0bee('0x11')]+=_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')][_0x252ed0][_0x0bee('0x1a')]+'';}}return _0x25ab0b[_0x0bee('0x1b')](_0x52bbbb);})[_0x0bee('0x1c')](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));if(!_0x25ab0b[_0x0bee('0x1e')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x21'));}if(!_0x3b99a4['sentiment']||!_0x3b99a4['sentimentAccountId']||!_0x3b99a4[_0x0bee('0x22')]||!_0x3b99a4[_0x0bee('0x23')]||!_0x3b99a4[_0x0bee('0x24')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x25'));}if(!_0x52bbbb[_0x0bee('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x3b99a4['sentimentAccountId']===_0x3ab183['id']){return _0x3ab183;}else{return db['CloudProvider'][_0x0bee('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0bee('0x1c')](function(_0x3e5a09){if(!_0x3e5a09){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3e5a09[_0x0bee('0xb')]||!_0x3e5a09[_0x0bee('0xc')]){throw new db['Sequelize'][(_0x0bee('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d85c4=_0x3e5a09;logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x27'),_0x25ab0b['id']));return sentiment(_0x1d85c4['data1'],_0x1d85c4[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0x22')],_0x52bbbb['fileText'],_0x3b99a4[_0x0bee('0x23')]);})[_0x0bee('0x1c')](function(_0x40e516){logger['info'](util[_0x0bee('0xf')](_0x0bee('0x28'),_0x25ab0b['id']));return _0x25ab0b['update']({'sentiment':_0x40e516[_0x0bee('0x29')],'sPositive':_0x40e516[_0x0bee('0x2a')][_0x0bee('0x2b')],'sNegative':_0x40e516[_0x0bee('0x2a')][_0x0bee('0x2c')],'sMixed':_0x40e516[_0x0bee('0x2a')]['Mixed'],'sNeutral':_0x40e516[_0x0bee('0x2a')]['Neutral']});})[_0x0bee('0x1c')](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));_0x1f50e8();});case _0x0bee('0x2d'):return _0x25ab0b[_0x0bee('0x1b')]({'transcribeStatus':_0x0bee('0x2d'),'failureReason':_0x54aca4[_0x0bee('0x10')]['FailureReason']})['then'](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));_0x1f50e8();});default:logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x2e'),_0x25ab0b['id']));break;}}else{return BPromise[_0x0bee('0x2f')]()[_0x0bee('0x1c')](function(){if(!_0x25ab0b[_0x0bee('0x1e')]){throw new db['Sequelize'][(_0x0bee('0x20'))](_0x0bee('0x21'));}if(!_0x3b99a4[_0x0bee('0x30')]||!_0x3b99a4['sentimentAccountId']||!_0x3b99a4[_0x0bee('0x22')]||!_0x3b99a4['language']||!_0x3b99a4[_0x0bee('0x24')]){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x25'));}if(!_0x25ab0b[_0x0bee('0x11')]){throw new Error(_0x0bee('0x31'));}if(_0x3b99a4[_0x0bee('0x32')]===_0x3ab183['id']){return _0x3ab183;}else{return db[_0x0bee('0x33')][_0x0bee('0x26')]({'where':{'id':_settings[_0x0bee('0x32')]}});}})[_0x0bee('0x1c')](function(_0x37da91){if(!_0x37da91){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x34'));}if(!_0x37da91[_0x0bee('0xb')]||!_0x37da91[_0x0bee('0xc')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x35'));}_0x1d85c4=_0x37da91;logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x27'),_0x25ab0b['id']));return sentiment(_0x1d85c4['data1'],_0x1d85c4[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0x22')],_0x25ab0b['fileText'],_0x3b99a4[_0x0bee('0x23')]);})[_0x0bee('0x1c')](function(_0x1ed25b){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x28'),_0x25ab0b['id']));return _0x25ab0b['update']({'sentiment':_0x1ed25b['Sentiment'],'sPositive':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x2b')],'sNegative':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x2c')],'sMixed':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x36')],'sNeutral':_0x1ed25b[_0x0bee('0x2a')]['Neutral'],'transcribeStatus':_0x0bee('0x12')});})['then'](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25ab0b['id']));_0x1f50e8();});}})[_0x0bee('0x37')](function(_0x2e0386){if(_0x2e0386){if(!_0x2e0386['name']||_0x2e0386['name']!==_0x0bee('0x38')){logger[_0x0bee('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x25ab0b['id']),util[_0x0bee('0x3a')](_0x2e0386,{'showHidden':![],'depth':null}));}}_0x1f50e8();});});}function checkTranscribe(){var _0x1cf2ee;var _0x22a9b8;var _0xcf823c;return db[_0x0bee('0x3b')][_0x0bee('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x0bee('0x1c')](function(_0x16a085){if(!_0x16a085||!_0x16a085[_0x0bee('0x19')]){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x3d'));}_0x1cf2ee=_0x16a085;return db['Setting'][_0x0bee('0x26')]({'where':{'id':0x1}});})[_0x0bee('0x1c')](function(_0x2949e3){if(!_0x2949e3){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x3e'));}_0x22a9b8=_0x2949e3;if(!_0x22a9b8['transcribe']||!_0x22a9b8[_0x0bee('0x3f')]||!_0x22a9b8[_0x0bee('0xd')]||!_0x22a9b8[_0x0bee('0x23')]||!_0x22a9b8['bucket']){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))]('Transcribe\x20not\x20configured');}return db[_0x0bee('0x33')][_0x0bee('0x26')]({'where':{'id':_0x22a9b8[_0x0bee('0x3f')]}});})[_0x0bee('0x1c')](function(_0x5c152c){if(!_0x5c152c){throw new db['Sequelize'][(_0x0bee('0x20'))](_0x0bee('0x34'));}if(!_0x5c152c[_0x0bee('0xb')]||!_0x5c152c['data2']){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x35'));}_0xcf823c=_0x5c152c;var _0x58d49e=[];_0x1cf2ee[_0x0bee('0x40')](function(_0x5b3146){_0x58d49e[_0x0bee('0x41')](checkTranscribeJob(_0x5b3146,_0x22a9b8,_0xcf823c));});return BPromise[_0x0bee('0x42')](_0x58d49e);})[_0x0bee('0x37')](function(_0x59b502){if(_0x59b502){if(!_0x59b502[_0x0bee('0x43')]||_0x59b502[_0x0bee('0x43')]!==_0x0bee('0x38')){logger[_0x0bee('0x39')](util[_0x0bee('0x3a')](_0x59b502,{'showHidden':![],'depth':null}));}}});}exports[_0x0bee('0x44')]=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 6354311..040eecf 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 _0xcff9=['WhatsappInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','catch','error','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','subtract','then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x246e1a,_0x30ee98){var _0x19a13c=function(_0x3c4cd8){while(--_0x3c4cd8){_0x246e1a['push'](_0x246e1a['shift']());}};_0x19a13c(++_0x30ee98);}(_0xcff9,0x8c));var _0x9cff=function(_0x4e0457,_0x5f3ce9){_0x4e0457=_0x4e0457-0x0;var _0x52defc=_0xcff9[_0x4e0457];return _0x52defc;};'use strict';var _=require(_0x9cff('0x0'));var moment=require(_0x9cff('0x1'));var Redis=require(_0x9cff('0x2'));var util=require(_0x9cff('0x3'));var config=require('../../config/environment');var db=require(_0x9cff('0x4'))['db'];var logger=require(_0x9cff('0x5'))('schedule');config[_0x9cff('0x6')]=_[_0x9cff('0x7')](config[_0x9cff('0x6')],{'host':_0x9cff('0x8'),'port':0x18eb});var io=require(_0x9cff('0x9'))(new Redis(config[_0x9cff('0x6')]));function closeInteractions(){var _0x48e4d8=[];return db['WhatsappInteraction'][_0x9cff('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9cff('0xb')](0x18,'hours')}}})[_0x9cff('0xc')](function(_0x2c9906){if(_0x2c9906&&_0x2c9906['length']){_0x48e4d8=_['map'](_0x2c9906||[],'id');logger[_0x9cff('0xd')](_0x9cff('0xe'),_0x48e4d8[_0x9cff('0xf')]());return db[_0x9cff('0x10')]['update']({'closeReason':_0x9cff('0x11'),'disposition':_0x9cff('0x12'),'closed':!![],'closedAt':moment()[_0x9cff('0x13')](_0x9cff('0x14'))},{'where':{'id':_0x48e4d8}});}})[_0x9cff('0xc')](function(){if(_0x48e4d8&&_0x48e4d8[_0x9cff('0x15')]){logger[_0x9cff('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x48e4d8[_0x9cff('0xf')]());for(var _0x41953d=0x0;_0x41953d<_0x48e4d8[_0x9cff('0x15')];_0x41953d++){io['emit']('whatsappInteraction:update',{'id':_0x48e4d8[_0x41953d],'closed':!![]});}}})[_0x9cff('0x16')](function(_0x440451){logger[_0x9cff('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x440451?util[_0x9cff('0x18')](_0x440451,{'showHidden':![],'depth':null}):'');});}exports[_0x9cff('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd880=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0xd71feb,_0x5a7e7c){var _0x342abb=function(_0x2cc443){while(--_0x2cc443){_0xd71feb['push'](_0xd71feb['shift']());}};_0x342abb(++_0x5a7e7c);}(_0xd880,0x7e));var _0x0d88=function(_0x49cb23,_0x40a318){_0x49cb23=_0x49cb23-0x0;var _0x33862f=_0xd880[_0x49cb23];return _0x33862f;};'use strict';var _=require(_0x0d88('0x0'));var moment=require(_0x0d88('0x1'));var Redis=require(_0x0d88('0x2'));var util=require(_0x0d88('0x3'));var config=require(_0x0d88('0x4'));var db=require(_0x0d88('0x5'))['db'];var logger=require('../logger')(_0x0d88('0x6'));config[_0x0d88('0x7')]=_['defaults'](config['redis'],{'host':_0x0d88('0x8'),'port':0x18eb});var io=require(_0x0d88('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x3d22d0=[];return db[_0x0d88('0xa')][_0x0d88('0xb')]({'raw':!![],'attributes':['id',_0x0d88('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0d88('0xd')](0x18,_0x0d88('0xe'))}}})['then'](function(_0x476948){if(_0x476948&&_0x476948['length']){_0x3d22d0=_[_0x0d88('0xf')](_0x476948||[],'id');logger[_0x0d88('0x10')](_0x0d88('0x11'),_0x3d22d0[_0x0d88('0x12')]());return db[_0x0d88('0xa')][_0x0d88('0x13')]({'closeReason':_0x0d88('0x14'),'disposition':_0x0d88('0x15'),'closed':!![],'closedAt':moment()['format'](_0x0d88('0x16'))},{'where':{'id':_0x3d22d0}});}})[_0x0d88('0x17')](function(){if(_0x3d22d0&&_0x3d22d0[_0x0d88('0x18')]){logger[_0x0d88('0x10')](_0x0d88('0x19'),_0x3d22d0['join']());for(var _0x13cb95=0x0;_0x13cb95<_0x3d22d0[_0x0d88('0x18')];_0x13cb95++){io['emit']('whatsappInteraction:update',{'id':_0x3d22d0[_0x13cb95],'closed':!![]});}}})[_0x0d88('0x1a')](function(_0x1c780c){logger[_0x0d88('0x1b')](_0x0d88('0x1c'),_0x1c780c?util[_0x0d88('0x1d')](_0x1c780c,{'showHidden':![],'depth':null}):'');});}exports[_0x0d88('0x1e')]=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 f62ed94..5f94530 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8005=['catch','util','../mysqldb','Innocenzo','innocenzo.biondo','push','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2'];(function(_0x2cf062,_0x3c15c6){var _0x376203=function(_0x23ca8e){while(--_0x23ca8e){_0x2cf062['push'](_0x2cf062['shift']());}};_0x376203(++_0x3c15c6);}(_0x8005,0x122));var _0x5800=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x8005[_0x2ac71a];return _0x3ee904;};'use strict';var util=require(_0x5800('0x0'));var db=require(_0x5800('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5800('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5800('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5800('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5800('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5800('0x4')]({'id':i,'firstName':_0x5800('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x5800('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5800('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x5800('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5800('0x5')](),'updatedAt':Date[_0x5800('0x5')]()});}db[_0x5800('0x7')][_0x5800('0x8')]({'where':{}})[_0x5800('0x9')](function(){return db[_0x5800('0x7')][_0x5800('0xa')](contacts);})[_0x5800('0x9')](function(){console[_0x5800('0xb')](_0x5800('0xc'),_0x5800('0xd'));return db[_0x5800('0xe')][_0x5800('0x8')]({'where':{}});})[_0x5800('0x9')](function(){return db[_0x5800('0xe')][_0x5800('0xa')](hopper);})['then'](function(){console[_0x5800('0xb')](_0x5800('0xc'),'hopper1');return db[_0x5800('0x7')]['bulkCreate'](contacts2);})[_0x5800('0x9')](function(){console[_0x5800('0xb')]('finished\x20populating',_0x5800('0xf'));return db['CmHopper'][_0x5800('0xa')](hopper2);})[_0x5800('0x9')](function(){console[_0x5800('0xb')](_0x5800('0xc'),'hopper2');})[_0x5800('0x10')](function(_0x4d78c1){console[_0x5800('0xb')](_0x4d78c1);}); \ No newline at end of file +var _0xd945=['finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','then','log','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact'];(function(_0xae9e35,_0x4e272b){var _0x3509be=function(_0x379bc7){while(--_0x379bc7){_0xae9e35['push'](_0xae9e35['shift']());}};_0x3509be(++_0x4e272b);}(_0xd945,0x195));var _0x5d94=function(_0x14ed93,_0x2bbefd){_0x14ed93=_0x14ed93-0x0;var _0x2c3490=_0xd945[_0x14ed93];return _0x2c3490;};'use strict';var util=require(_0x5d94('0x0'));var db=require(_0x5d94('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5d94('0x2')]({'id':i,'firstName':_0x5d94('0x3')+i,'lastName':_0x5d94('0x4')+i,'phone':0xf879fb460+i,'email':_0x5d94('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x5d94('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x5d94('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5d94('0x2')]({'id':i,'firstName':_0x5d94('0x3')+i,'lastName':_0x5d94('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x5d94('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5d94('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5d94('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d94('0x6')](),'updatedAt':Date[_0x5d94('0x6')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db[_0x5d94('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x5d94('0x9'),_0x5d94('0xa'));return db[_0x5d94('0xb')][_0x5d94('0xc')]({'where':{}});})['then'](function(){return db[_0x5d94('0xb')][_0x5d94('0xd')](hopper);})[_0x5d94('0xe')](function(){console[_0x5d94('0xf')]('finished\x20populating','hopper1');return db['CmContact'][_0x5d94('0xd')](contacts2);})[_0x5d94('0xe')](function(){console[_0x5d94('0xf')](_0x5d94('0x9'),_0x5d94('0x10'));return db[_0x5d94('0xb')]['bulkCreate'](hopper2);})['then'](function(){console[_0x5d94('0xf')](_0x5d94('0x9'),'hopper2');})[_0x5d94('0x11')](function(_0x26ee8f){console[_0x5d94('0xf')](_0x26ee8f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index df798d5..59e7ed3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0009=['actpass','\x22%s\x22\x20<%s>','then','catch','log','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x0009,0x1bd));var _0x9000=function(_0x32056c,_0x1b6db7){_0x32056c=_0x32056c-0x0;var _0x317313=_0x0009[_0x32056c];return _0x317313;};'use strict';var util=require(_0x9000('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9000('0x1')]({'name':util[_0x9000('0x2')](_0x9000('0x3'),_0x9000('0x4'),i),'fullname':util['format'](_0x9000('0x3'),_0x9000('0x4'),i),'email':util['format'](_0x9000('0x5'),_0x9000('0x4'),i),'role':_0x9000('0x4'),'password':_0x9000('0x6'),'internal':0xfa0+i,'type':_0x9000('0x7'),'transport':[_0x9000('0x8'),'ws',_0x9000('0x9')],'disallow':[_0x9000('0xa')],'allow':[_0x9000('0xb')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0x9000('0xc'),'avpf':_0x9000('0xc'),'force_avp':'yes','icesupport':_0x9000('0xc'),'dtlsenable':_0x9000('0xc'),'dtlsverify':'no','dtlscertfile':_0x9000('0xd'),'dtlsprivatekey':_0x9000('0xe'),'dtlssetup':_0x9000('0xf'),'callerid':util[_0x9000('0x2')](_0x9000('0x10'),util[_0x9000('0x2')]('%s%s',_0x9000('0x4'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x9000('0x11')](function(){console['log']('add\x20user');})[_0x9000('0x12')](function(_0x2374b6){console[_0x9000('0x13')](_0x2374b6);}); \ No newline at end of file +var _0x48a2=['udp','all','yes','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','password','friend'];(function(_0x5a24fc,_0x8d4266){var _0xe44766=function(_0x5aaefb){while(--_0x5aaefb){_0x5a24fc['push'](_0x5a24fc['shift']());}};_0xe44766(++_0x8d4266);}(_0x48a2,0x190));var _0x248a=function(_0x295b61,_0x20b436){_0x295b61=_0x295b61-0x0;var _0x2d9519=_0x48a2[_0x295b61];return _0x2d9519;};'use strict';var util=require(_0x248a('0x0'));var db=require(_0x248a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x248a('0x2')]({'name':util[_0x248a('0x3')](_0x248a('0x4'),_0x248a('0x5'),i),'fullname':util[_0x248a('0x3')](_0x248a('0x4'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x248a('0x5'),i),'role':_0x248a('0x5'),'password':_0x248a('0x6'),'internal':0xfa0+i,'type':_0x248a('0x7'),'transport':[_0x248a('0x8'),'ws','wss'],'disallow':[_0x248a('0x9')],'allow':['ulaw'],'defaultuser':util[_0x248a('0x3')](_0x248a('0x4'),_0x248a('0x5'),i),'encryption':'yes','avpf':_0x248a('0xa'),'force_avp':_0x248a('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x248a('0xb'),'callerid':util[_0x248a('0x3')](_0x248a('0xc'),util[_0x248a('0x3')]('%s%s',_0x248a('0x5'),i),0xfa0+i)});}db['User'][_0x248a('0xd')](users)[_0x248a('0xe')](function(){console[_0x248a('0xf')]('add\x20user');})[_0x248a('0x10')](function(_0x5f5bfb){console[_0x248a('0xf')](_0x5f5bfb);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 5dcdb3a..4fc43e9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba79=['userProfileId','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueues','WhatsappQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','emit','MailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','User','name','role','agent','type','ivr','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','then','resourceId','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','ChatInteraction','MailInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','user','voice:outbound'];(function(_0x4ae8c2,_0x409a64){var _0x252e29=function(_0x4ead37){while(--_0x4ead37){_0x4ae8c2['push'](_0x4ae8c2['shift']());}};_0x252e29(++_0x409a64);}(_0xba79,0x153));var _0x9ba7=function(_0x42b1a2,_0x570b82){_0x42b1a2=_0x42b1a2-0x0;var _0x17af3e=_0xba79[_0x42b1a2];return _0x17af3e;};'use strict';var _=require(_0x9ba7('0x0'));var util=require(_0x9ba7('0x1'));var BPromise=require(_0x9ba7('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x9ba7('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x9ba7('0x4')],'attributes':['id',_0x9ba7('0x5'),_0x9ba7('0x6')],'raw':!![],'where':{'role':_0x9ba7('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x9ba7('0x5')],'where':{'role':_0x9ba7('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x9ba7('0x8')],'where':{'type':_0x9ba7('0x9')}};function getAssociatedResources(_0x3d714c,_0xfec018,_0x15869d){return db['UserProfileSection']['findOne']({'where':{'name':_0x3d714c,'userProfileId':_0xfec018},'raw':!![]})['then'](function(_0x59df53){if(_0x59df53){if(_0x59df53[_0x9ba7('0xa')]){switch(_0x3d714c){case _0x9ba7('0xb'):case _0x9ba7('0xc'):case _0x9ba7('0xd'):case _0x9ba7('0xe'):case _0x9ba7('0xf'):case _0x9ba7('0x10'):case'WhatsappQueues':return db[_0x15869d][_0x9ba7('0x11')](queryQueues);case'Telephones':return db[_0x15869d]['findAll'](queryTelephones);case _0x9ba7('0x12'):return db[_0x15869d]['findAll'](queryTrunks);case _0x9ba7('0x13'):return db[_0x15869d][_0x9ba7('0x11')](queryCampaigns);}}else{return db[_0x9ba7('0x14')][_0x9ba7('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x59df53['id']},'raw':!![]})[_0x9ba7('0x15')](function(_0xeff954){if(_0xeff954){var _0x114f7c={'where':{'id':_['map'](_0xeff954,_0x9ba7('0x16'))},'raw':!![]};switch(_0x15869d){case _0x9ba7('0x4'):_0x114f7c[_0x9ba7('0x17')][_0x9ba7('0x6')]='telephone';break;case _0x9ba7('0x18'):_0x114f7c[_0x9ba7('0x17')][_0x9ba7('0x8')]=_0x9ba7('0x9');break;}return db[_0x15869d]['findAll'](_0x114f7c);}else{return[];}});}}else{return[];}})[_0x9ba7('0x15')](function(_0x4e91c5){return _0x4e91c5;});}function joinOrLeaveQueues(_0x55493b,_0x37bd9f,_0x2f8651,_0x1f5400){_0x55493b[_0x37bd9f](util[_0x9ba7('0x19')](_0x9ba7('0x1a'),_0x2f8651,_0x1f5400[_0x9ba7('0x5')]));if(_0x1f5400[_0x9ba7('0x1b')]){for(var _0x1ccd48=0x0;_0x1ccd48<_0x1f5400[_0x9ba7('0x1b')][_0x9ba7('0x1c')];_0x1ccd48+=0x1){_0x55493b[_0x37bd9f](util[_0x9ba7('0x19')](_0x9ba7('0x1d'),_0x1f5400['Agents'][_0x1ccd48]['name']));}}}function joinOrLeave(_0x4e2c9a,_0x5dcba2,_0x3abecf){var _0x285374;if(_0x4e2c9a[_0x9ba7('0x1e')][_0x9ba7('0x1f')]['id']){db[_0x9ba7('0x4')][_0x9ba7('0x20')]({'attributes':['id',_0x9ba7('0x5'),_0x9ba7('0x6'),'userProfileId'],'where':{'id':_0x4e2c9a[_0x9ba7('0x1e')][_0x9ba7('0x1f')]['id']},'include':[{'model':db[_0x9ba7('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9ba7('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9ba7('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9ba7('0x24')],'as':_0x9ba7('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9ba7('0x26')],'as':_0x9ba7('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x270da2){if(_0x270da2){_0x285374=_0x270da2;_0x4e2c9a[_0x5dcba2](util[_0x9ba7('0x19')](_0x9ba7('0x1d'),_0x270da2[_0x9ba7('0x5')]));var _0x2695a4=[];switch(_0x270da2['role']){case'admin':_0x4e2c9a[_0x5dcba2](_0x9ba7('0x28'));_0x4e2c9a[_0x5dcba2]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x9ba7('0x29')];}_0x2695a4[_0x9ba7('0x2a')](db[_0x9ba7('0x2b')]['findAll'](queryQueues));_0x2695a4[_0x9ba7('0x2a')](db['ChatQueue'][_0x9ba7('0x11')](queryQueues));_0x2695a4['push'](db['FaxQueue']['findAll'](queryQueues));_0x2695a4[_0x9ba7('0x2a')](db[_0x9ba7('0x2c')][_0x9ba7('0x11')](queryQueues));_0x2695a4[_0x9ba7('0x2a')](db[_0x9ba7('0x2d')][_0x9ba7('0x11')](queryQueues));_0x2695a4[_0x9ba7('0x2a')](db['OpenchannelQueue']['findAll'](queryQueues));_0x2695a4['push'](db['WhatsappQueue'][_0x9ba7('0x11')](queryQueues));_0x2695a4['push'](db[_0x9ba7('0x4')][_0x9ba7('0x11')](queryTelephones));_0x2695a4['push'](db[_0x9ba7('0x2e')][_0x9ba7('0x11')](queryTrunks));_0x2695a4[_0x9ba7('0x2a')](db[_0x9ba7('0x18')][_0x9ba7('0x11')](queryCampaigns));_0x2695a4['push'](db[_0x9ba7('0x4')][_0x9ba7('0x11')](queryAgents));break;case _0x9ba7('0x2f'):_0x4e2c9a[_0x5dcba2]('voice:inbound');_0x4e2c9a[_0x5dcba2](_0x9ba7('0x30'));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0xb'),_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x2b')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0xc'),_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x32')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0xd'),_0x270da2['userProfileId'],_0x9ba7('0x33')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0xe'),_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x2c')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0xf'),_0x270da2[_0x9ba7('0x31')],'MailQueue'));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0x10'),_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x34')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0x35'),_0x270da2['userProfileId'],_0x9ba7('0x36')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0x37'),_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x4')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources('Trunks',_0x270da2[_0x9ba7('0x31')],_0x9ba7('0x2e')));_0x2695a4[_0x9ba7('0x2a')](getAssociatedResources(_0x9ba7('0x13'),_0x270da2['userProfileId'],'Campaign'));_0x2695a4[_0x9ba7('0x2a')](db[_0x9ba7('0x4')]['findAll'](queryAgents));break;case _0x9ba7('0x7'):_0x4e2c9a[_0x5dcba2]('voice:inbound');_0x4e2c9a[_0x5dcba2]('voice:outbound');_0x2695a4[_0x9ba7('0x2a')](_0x270da2[_0x9ba7('0x38')]({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2[_0x9ba7('0x39')]({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2[_0x9ba7('0x3a')]({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2[_0x9ba7('0x3b')]({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2['getMailQueues']({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2['getOpenchannelQueues']({'attributes':['id',_0x9ba7('0x5')]}));_0x2695a4[_0x9ba7('0x2a')](_0x270da2[_0x9ba7('0x3c')]({'attributes':['id',_0x9ba7('0x5')]}));break;}return BPromise['all'](_0x2695a4);}})[_0x9ba7('0x15')](function(_0x196d86){if(_0x196d86&&_0x196d86[_0x9ba7('0x1c')]){for(var _0x3c39bb=0x0;_0x3c39bb<_0x196d86['length'];_0x3c39bb+=0x1){for(var _0x19a571=0x0;_0x19a571<_0x196d86[_0x3c39bb][_0x9ba7('0x1c')];_0x19a571+=0x1){switch(_0x3c39bb){case 0x0:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x3d'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x1:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x3e'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x2:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x3f'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x3:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x40'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x4:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x41'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x5:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,_0x9ba7('0x42'),_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x6:joinOrLeaveQueues(_0x4e2c9a,_0x5dcba2,'whatsapp',_0x196d86[_0x3c39bb][_0x19a571]);break;case 0x7:if(_0x285374[_0x9ba7('0x6')]!==_0x9ba7('0x7'))_0x4e2c9a[_0x5dcba2](util['format'](_0x9ba7('0x43'),_0x196d86[_0x3c39bb][_0x19a571][_0x9ba7('0x5')]));break;case 0x8:if(_0x285374[_0x9ba7('0x6')]!=='agent')_0x4e2c9a[_0x5dcba2](util[_0x9ba7('0x19')](_0x9ba7('0x44'),_0x196d86[_0x3c39bb][_0x19a571][_0x9ba7('0x5')]));break;case 0x9:if(_0x285374['role']!==_0x9ba7('0x7'))_0x4e2c9a[_0x5dcba2](util[_0x9ba7('0x19')](_0x9ba7('0x45'),_0x196d86[_0x3c39bb][_0x19a571][_0x9ba7('0x8')],_0x196d86[_0x3c39bb][_0x19a571][_0x9ba7('0x5')]));break;case 0xa:_0x4e2c9a[_0x5dcba2](util['format'](_0x9ba7('0x1d'),_0x196d86[_0x3c39bb][_0x19a571][_0x9ba7('0x5')]));break;}}}}})[_0x9ba7('0x15')](function(){if(_0x5dcba2===_0x9ba7('0x46')){var _0x746c36=_[_0x9ba7('0x47')](_0x285374[_0x9ba7('0x48')],'id');return _0x285374['removeChatInteractions'](_0x746c36)[_0x9ba7('0x15')](function(){for(var _0x2d97e9=0x0;_0x2d97e9<_0x746c36['length'];_0x2d97e9+=0x1){_0x3abecf[_0x9ba7('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x746c36[_0x2d97e9]),'UserId':Number(_0x285374['id'])});}});}})[_0x9ba7('0x15')](function(){if(_0x5dcba2===_0x9ba7('0x46')){var _0x36da5b=_[_0x9ba7('0x47')](_0x285374[_0x9ba7('0x4a')],'id');return _0x285374['removeMailInteractions'](_0x36da5b)['then'](function(){for(var _0x30c6df=0x0;_0x30c6df<_0x36da5b[_0x9ba7('0x1c')];_0x30c6df+=0x1){_0x3abecf['emit'](_0x9ba7('0x4b'),{'MailInteractionId':Number(_0x36da5b[_0x30c6df]),'UserId':Number(_0x285374['id'])});}});}})[_0x9ba7('0x15')](function(){if(_0x5dcba2==='leave'){var _0x1699d6=_['map'](_0x285374[_0x9ba7('0x4c')],'id');return _0x285374[_0x9ba7('0x4d')](_0x1699d6)['then'](function(){for(var _0x33cada=0x0;_0x33cada<_0x1699d6[_0x9ba7('0x1c')];_0x33cada+=0x1){_0x3abecf['emit'](_0x9ba7('0x4e'),{'FaxInteractionId':Number(_0x1699d6[_0x33cada]),'UserId':Number(_0x285374['id'])});}});}})['then'](function(){if(_0x5dcba2===_0x9ba7('0x46')){var _0x333eaf=_[_0x9ba7('0x47')](_0x285374[_0x9ba7('0x4f')],'id');return _0x285374[_0x9ba7('0x50')](_0x333eaf)[_0x9ba7('0x15')](function(){for(var _0x141321=0x0;_0x141321<_0x333eaf['length'];_0x141321+=0x1){_0x3abecf[_0x9ba7('0x49')](_0x9ba7('0x51'),{'SmsInteractionId':Number(_0x333eaf[_0x141321]),'UserId':Number(_0x285374['id'])});}});}})[_0x9ba7('0x15')](function(){if(_0x5dcba2===_0x9ba7('0x46')){var _0x69e58=_[_0x9ba7('0x47')](_0x285374['OpenchannelInteractions'],'id');return _0x285374['removeOpenchannelInteractions'](_0x69e58)[_0x9ba7('0x15')](function(){for(var _0x5ae9d3=0x0;_0x5ae9d3<_0x69e58[_0x9ba7('0x1c')];_0x5ae9d3+=0x1){_0x3abecf[_0x9ba7('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x69e58[_0x5ae9d3]),'UserId':Number(_0x285374['id'])});}});}})[_0x9ba7('0x15')](function(){if(_0x5dcba2===_0x9ba7('0x46')){var _0x2e6887=_['map'](_0x285374[_0x9ba7('0x27')],'id');return _0x285374[_0x9ba7('0x52')](_0x2e6887)['then'](function(){for(var _0x23bcd7=0x0;_0x23bcd7<_0x2e6887['length'];_0x23bcd7+=0x1){_0x3abecf['emit'](_0x9ba7('0x53'),{'WhatsappInteractionId':Number(_0x2e6887[_0x23bcd7]),'UserId':Number(_0x285374['id'])});}});}})[_0x9ba7('0x54')](function(_0x389b1c){_0x4e2c9a[_0x9ba7('0x55')](_0x389b1c);});}}function onDisconnect(_0x2f4f13,_0xbfb677){joinOrLeave(_0x2f4f13,_0x9ba7('0x46'),_0xbfb677);}function onConnect(_0x57cd03){joinOrLeave(_0x57cd03,'join');}exports[_0x9ba7('0x56')]=function(_0x27fd3c){_0x27fd3c['on'](_0x9ba7('0x57'),function(_0xfdb32){_0xfdb32[_0x9ba7('0x58')](0x0);_0xfdb32[_0x9ba7('0x59')]=_0xfdb32[_0x9ba7('0x5a')][_0x9ba7('0x57')]['remoteAddress']+':'+_0xfdb32['request'][_0x9ba7('0x57')][_0x9ba7('0x5b')];_0xfdb32[_0x9ba7('0x5c')]=new Date();_0xfdb32[_0x9ba7('0x55')]=function(_0x45e5c0){console[_0x9ba7('0x55')](_0x9ba7('0x5d')+_0xfdb32[_0x9ba7('0x5e')]['name']+'['+_0xfdb32[_0x9ba7('0x59')]+']',_0x45e5c0);};_0xfdb32['on']('disconnect',function(){onDisconnect(_0xfdb32,_0x27fd3c);_0xfdb32['log'](_0x9ba7('0x5f'));});onConnect(_0xfdb32);_0xfdb32[_0x9ba7('0x55')](_0x9ba7('0x60'));});}; \ No newline at end of file +var _0x7939=['query','User','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','join','default','connection','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','Agents','length','handshake'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7939,0x11c));var _0x9793=function(_0x154bca,_0x170ba1){_0x154bca=_0x154bca-0x0;var _0x46f55d=_0x7939[_0x154bca];return _0x46f55d;};'use strict';var _=require('lodash');var util=require(_0x9793('0x0'));var BPromise=require(_0x9793('0x1'));var db=require(_0x9793('0x2'))['db'];var config=require(_0x9793('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x9793('0x4'),_0x9793('0x5')],'raw':!![],'where':{'role':_0x9793('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':_0x9793('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9793('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9793('0x4'),_0x9793('0x8')],'where':{'type':_0x9793('0x9')}};function getAssociatedResources(_0x2a9b7c,_0x4e5923,_0x3901f3){return db['UserProfileSection'][_0x9793('0xa')]({'where':{'name':_0x2a9b7c,'userProfileId':_0x4e5923},'raw':!![]})[_0x9793('0xb')](function(_0x5ea2e2){if(_0x5ea2e2){if(_0x5ea2e2[_0x9793('0xc')]){switch(_0x2a9b7c){case _0x9793('0xd'):case _0x9793('0xe'):case _0x9793('0xf'):case _0x9793('0x10'):case'MailQueues':case'OpenchannelQueues':case _0x9793('0x11'):return db[_0x3901f3][_0x9793('0x12')](queryQueues);case _0x9793('0x13'):return db[_0x3901f3][_0x9793('0x12')](queryTelephones);case _0x9793('0x14'):return db[_0x3901f3][_0x9793('0x12')](queryTrunks);case _0x9793('0x15'):return db[_0x3901f3][_0x9793('0x12')](queryCampaigns);}}else{return db[_0x9793('0x16')][_0x9793('0x12')]({'attributes':[_0x9793('0x17')],'where':{'sectionId':_0x5ea2e2['id']},'raw':!![]})[_0x9793('0xb')](function(_0x4f0d68){if(_0x4f0d68){var _0x277e9b={'where':{'id':_[_0x9793('0x18')](_0x4f0d68,'resourceId')},'raw':!![]};switch(_0x3901f3){case'User':_0x277e9b[_0x9793('0x19')]['role']=_0x9793('0x7');break;case'Campaign':_0x277e9b[_0x9793('0x19')][_0x9793('0x8')]=_0x9793('0x9');break;}return db[_0x3901f3]['findAll'](_0x277e9b);}else{return[];}});}}else{return[];}})['then'](function(_0x2d6656){return _0x2d6656;});}function joinOrLeaveQueues(_0x53aa43,_0x5407c5,_0x369f5e,_0x4d1769){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')](_0x9793('0x1b'),_0x369f5e,_0x4d1769[_0x9793('0x4')]));if(_0x4d1769[_0x9793('0x1c')]){for(var _0x23b51e=0x0;_0x23b51e<_0x4d1769['Agents'][_0x9793('0x1d')];_0x23b51e+=0x1){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')]('user:%s',_0x4d1769[_0x9793('0x1c')][_0x23b51e]['name']));}}}function joinOrLeave(_0x3054ec,_0x1f079d,_0x566c92){var _0x4eacb2;if(_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']){db[_0x9793('0x20')]['find']({'attributes':['id',_0x9793('0x4'),_0x9793('0x5'),_0x9793('0x21')],'where':{'id':_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']},'include':[{'model':db[_0x9793('0x22')],'as':_0x9793('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x24')],'as':_0x9793('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x26')],'as':_0x9793('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x28')],'as':_0x9793('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9793('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x2b')],'as':_0x9793('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x9793('0xb')](function(_0x481e8a){if(_0x481e8a){_0x4eacb2=_0x481e8a;_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x2d'),_0x481e8a['name']));var _0x3048d8=[];switch(_0x481e8a[_0x9793('0x5')]){case _0x9793('0x2e'):_0x3054ec[_0x1f079d]('voice:inbound');_0x3054ec[_0x1f079d](_0x9793('0x2f'));if(queryQueues[_0x9793('0x30')](_0x9793('0x31'))){delete queryQueues['include'];}_0x3048d8[_0x9793('0x32')](db[_0x9793('0x33')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x34')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x35')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x36')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x37')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x38')][_0x9793('0x12')](queryQueues));_0x3048d8['push'](db[_0x9793('0x39')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db['User']['findAll'](queryTelephones));_0x3048d8['push'](db[_0x9793('0x3a')]['findAll'](queryTrunks));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x3b')][_0x9793('0x12')](queryCampaigns));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x20')][_0x9793('0x12')](queryAgents));break;case _0x9793('0x3c'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d]('voice:outbound');_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xd'),_0x481e8a[_0x9793('0x21')],_0x9793('0x33')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('ChatQueues',_0x481e8a['userProfileId'],_0x9793('0x34')));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xf'),_0x481e8a[_0x9793('0x21')],_0x9793('0x35')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('SmsQueues',_0x481e8a[_0x9793('0x21')],_0x9793('0x36')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('MailQueues',_0x481e8a[_0x9793('0x21')],'MailQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x3e'),_0x481e8a['userProfileId'],'OpenchannelQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x11'),_0x481e8a[_0x9793('0x21')],_0x9793('0x39')));_0x3048d8['push'](getAssociatedResources(_0x9793('0x13'),_0x481e8a['userProfileId'],'User'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x14'),_0x481e8a['userProfileId'],'Trunk'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x15'),_0x481e8a[_0x9793('0x21')],_0x9793('0x3b')));_0x3048d8['push'](db[_0x9793('0x20')]['findAll'](queryAgents));break;case _0x9793('0x6'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d](_0x9793('0x2f'));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x3f')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x40')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x41')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x42')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8['push'](_0x481e8a[_0x9793('0x43')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x44')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x45')]({'attributes':['id','name']}));break;}return BPromise[_0x9793('0x46')](_0x3048d8);}})['then'](function(_0xe4171c){if(_0xe4171c&&_0xe4171c['length']){for(var _0x6c8092=0x0;_0x6c8092<_0xe4171c[_0x9793('0x1d')];_0x6c8092+=0x1){for(var _0x1c9d48=0x0;_0x1c9d48<_0xe4171c[_0x6c8092][_0x9793('0x1d')];_0x1c9d48+=0x1){switch(_0x6c8092){case 0x0:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x47'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x1:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x48'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x2:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x49'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x3:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4a'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x4:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4b'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x5:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'openchannel',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x6:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'whatsapp',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x7:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4c'),_0xe4171c[_0x6c8092][_0x1c9d48]['name']));break;case 0x8:if(_0x4eacb2[_0x9793('0x5')]!==_0x9793('0x6'))_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4d'),_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0x9:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('campaign:%s:%s',_0xe4171c[_0x6c8092][_0x1c9d48]['type'],_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0xa:_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('user:%s',_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;}}}}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x2445fa=_['map'](_0x4eacb2[_0x9793('0x23')],'id');return _0x4eacb2[_0x9793('0x4f')](_0x2445fa)[_0x9793('0xb')](function(){for(var _0x3ca143=0x0;_0x3ca143<_0x2445fa[_0x9793('0x1d')];_0x3ca143+=0x1){_0x566c92['emit'](_0x9793('0x50'),{'ChatInteractionId':Number(_0x2445fa[_0x3ca143]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0xed9987=_['map'](_0x4eacb2['MailInteractions'],'id');return _0x4eacb2[_0x9793('0x51')](_0xed9987)[_0x9793('0xb')](function(){for(var _0xb15e63=0x0;_0xb15e63<_0xed9987['length'];_0xb15e63+=0x1){_0x566c92['emit'](_0x9793('0x52'),{'MailInteractionId':Number(_0xed9987[_0xb15e63]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3dbf43=_['map'](_0x4eacb2[_0x9793('0x27')],'id');return _0x4eacb2[_0x9793('0x53')](_0x3dbf43)[_0x9793('0xb')](function(){for(var _0x2298c6=0x0;_0x2298c6<_0x3dbf43['length'];_0x2298c6+=0x1){_0x566c92['emit'](_0x9793('0x54'),{'FaxInteractionId':Number(_0x3dbf43[_0x2298c6]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x40c043=_['map'](_0x4eacb2['SmsInteractions'],'id');return _0x4eacb2[_0x9793('0x55')](_0x40c043)[_0x9793('0xb')](function(){for(var _0x1ffe3d=0x0;_0x1ffe3d<_0x40c043[_0x9793('0x1d')];_0x1ffe3d+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x57'),{'SmsInteractionId':Number(_0x40c043[_0x1ffe3d]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d==='leave'){var _0x1d6f8b=_[_0x9793('0x18')](_0x4eacb2['OpenchannelInteractions'],'id');return _0x4eacb2[_0x9793('0x58')](_0x1d6f8b)[_0x9793('0xb')](function(){for(var _0x43e872=0x0;_0x43e872<_0x1d6f8b[_0x9793('0x1d')];_0x43e872+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x59'),{'OpenchannelInteractionId':Number(_0x1d6f8b[_0x43e872]),'UserId':Number(_0x4eacb2['id'])});}});}})['then'](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3572db=_[_0x9793('0x18')](_0x4eacb2[_0x9793('0x2c')],'id');return _0x4eacb2[_0x9793('0x5a')](_0x3572db)[_0x9793('0xb')](function(){for(var _0x4fd474=0x0;_0x4fd474<_0x3572db[_0x9793('0x1d')];_0x4fd474+=0x1){_0x566c92[_0x9793('0x56')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3572db[_0x4fd474]),'UserId':Number(_0x4eacb2['id'])});}});}})['catch'](function(_0x31fad5){_0x3054ec['log'](_0x31fad5);});}}function onDisconnect(_0x3cccfa,_0x14bcba){joinOrLeave(_0x3cccfa,_0x9793('0x4e'),_0x14bcba);}function onConnect(_0x37e70b){joinOrLeave(_0x37e70b,_0x9793('0x5b'));}exports[_0x9793('0x5c')]=function(_0x643d8){_0x643d8['on'](_0x9793('0x5d'),function(_0x1f5b60){_0x1f5b60['setMaxListeners'](0x0);_0x1f5b60['address']=_0x1f5b60[_0x9793('0x5e')]['connection'][_0x9793('0x5f')]+':'+_0x1f5b60[_0x9793('0x5e')][_0x9793('0x5d')][_0x9793('0x60')];_0x1f5b60[_0x9793('0x61')]=new Date();_0x1f5b60['log']=function(_0x23dccc){console[_0x9793('0x62')](_0x9793('0x63')+_0x1f5b60[_0x9793('0x64')][_0x9793('0x4')]+'['+_0x1f5b60[_0x9793('0x65')]+']',_0x23dccc);};_0x1f5b60['on'](_0x9793('0x66'),function(){onDisconnect(_0x1f5b60,_0x643d8);_0x1f5b60[_0x9793('0x62')](_0x9793('0x67'));});onConnect(_0x1f5b60);_0x1f5b60[_0x9793('0x62')](_0x9793('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d333283..b53396a 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 _0x4cb2=['../logger','triggers','lodash','client','http','ChatInteraction','newinteraction','Chat','afterUpdate','closedinteraction','SmsInteraction','afterCreate','Sms','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','motionChannel','direction','ContactId','query','Sequelize','QueryTypes','contact','UserId','User','find','fullname','internal','interface','SIP/%s','name','agent','incomingmessage','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','changed','closed','substatus','format','default','length','model','hook','callback','condition','util','../../mysqldb','jayson/promise'];(function(_0x58ee51,_0x19cd2e){var _0x306749=function(_0x46d21f){while(--_0x46d21f){_0x58ee51['push'](_0x58ee51['shift']());}};_0x306749(++_0x19cd2e);}(_0x4cb2,0x89));var _0x24cb=function(_0x1e7a73,_0x11bdf2){_0x1e7a73=_0x1e7a73-0x0;var _0x1a8aa5=_0x4cb2[_0x1e7a73];return _0x1a8aa5;};'use strict';var util=require(_0x24cb('0x0'));var db=require(_0x24cb('0x1'))['db'];var jayson=require(_0x24cb('0x2'));var logger=require(_0x24cb('0x3'))(_0x24cb('0x4'));var _=require(_0x24cb('0x5'));var client=jayson[_0x24cb('0x6')][_0x24cb('0x7')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x24cb('0x8'),'event':'afterCreate','condition':_0x24cb('0x9'),'callback':afterCreate},{'channel':_0x24cb('0xa'),'model':_0x24cb('0x8'),'event':_0x24cb('0xb'),'condition':_0x24cb('0xc'),'callback':afterUpdate},{'channel':_0x24cb('0xa'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':_0x24cb('0xd'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x9'),'callback':afterCreate},{'channel':_0x24cb('0xf'),'model':'SmsInteraction','event':_0x24cb('0xb'),'condition':_0x24cb('0xc'),'callback':afterUpdate},{'channel':_0x24cb('0xf'),'model':_0x24cb('0x10'),'event':'afterCreate','condition':_0x24cb('0x11'),'callback':afterCreateMessage},{'channel':_0x24cb('0x12'),'model':'WhatsappInteraction','event':_0x24cb('0xe'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x24cb('0x12'),'model':_0x24cb('0x13'),'event':_0x24cb('0xb'),'condition':_0x24cb('0xc'),'callback':afterUpdate},{'channel':_0x24cb('0x12'),'model':_0x24cb('0x14'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x11'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x24cb('0xe'),'condition':_0x24cb('0x9'),'callback':afterCreate},{'channel':_0x24cb('0x15'),'model':_0x24cb('0x16'),'event':_0x24cb('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x24cb('0x15'),'model':_0x24cb('0x17'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x11'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x24cb('0x18'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x9'),'callback':afterCreate},{'channel':_0x24cb('0x19'),'model':_0x24cb('0x18'),'event':_0x24cb('0xb'),'condition':_0x24cb('0xc'),'callback':afterUpdate},{'channel':_0x24cb('0x19'),'model':_0x24cb('0x1a'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x11'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x24cb('0x1b'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x9'),'callback':afterCreate},{'channel':_0x24cb('0x1c'),'model':_0x24cb('0x1b'),'event':'afterUpdate','condition':_0x24cb('0xc'),'callback':afterUpdate},{'channel':_0x24cb('0x1c'),'model':_0x24cb('0x1d'),'event':_0x24cb('0xe'),'condition':_0x24cb('0x11'),'callback':afterCreateMessage}];function request(_0x59d1f1){return client[_0x24cb('0x1e')](_0x24cb('0x1f'),_0x59d1f1)[_0x24cb('0x20')](function(_0x213c30){logger[_0x24cb('0x21')]('Trigger,\x20%s','EventManager',_0x213c30);if(_0x213c30[_0x24cb('0x22')]){if(_0x213c30['error'][_0x24cb('0x23')]===0x1f4){logger[_0x24cb('0x22')](_0x24cb('0x24'),'EventManager',_0x213c30['error']);}}})[_0x24cb('0x25')](function(_0x311115){logger[_0x24cb('0x22')](_0x24cb('0x24'),_0x24cb('0x1f'),_0x311115);});}function afterCreateMessage(_0x2ed8b7,_0xc673bb){return function(_0x3ef838,_0x589775){_0x3ef838=_0x3ef838[_0x24cb('0x26')]({'plain':!![]});_0x3ef838[_0x24cb('0x27')]=_0x2ed8b7;_0x3ef838[_0x24cb('0x28')]=_0x2ed8b7;_0x3ef838['event']=_0x3ef838[_0x24cb('0x29')];var _0x184702='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ef838[_0x24cb('0x2a')];return db['sequelize'][_0x24cb('0x2b')](_0x184702,{'type':db[_0x24cb('0x2c')][_0x24cb('0x2d')]['SELECT'],'raw':!![]})['then'](function(_0x2a6782){return _0x2a6782;})[_0x24cb('0x20')](function(_0x3cf35c){if(_0x3cf35c){_0x3ef838[_0x24cb('0x2e')]=_0x3cf35c[0x0];}if(_0x3ef838[_0x24cb('0x2f')]){return db[_0x24cb('0x30')][_0x24cb('0x31')]({'where':{'id':_0x3ef838[_0x24cb('0x2f')]},'attributes':['id','name',_0x24cb('0x32'),'email',_0x24cb('0x33')],'raw':!![]})[_0x24cb('0x20')](function(_0x302735){_0x3ef838[_0x24cb('0x34')]=util['format'](_0x24cb('0x35'),_0x302735[_0x24cb('0x36')]);_0x3ef838[_0x24cb('0x27')]=_0x2ed8b7;_0x3ef838[_0x24cb('0x37')]=_0x302735;return request({'event':_0x24cb('0x38'),'message':_0x3ef838});})[_0x24cb('0x25')](function(_0x5910b4){console[_0x24cb('0x22')](_0x5910b4);});}else{return request({'event':'outgoingmessage','message':_0x3ef838});}});};}function afterCreate(_0x402517,_0xdeac63){return function(_0x3afe9c,_0x55fb76){_0x3afe9c=_0x3afe9c[_0x24cb('0x26')]({'plain':!![]});_0x3afe9c[_0x24cb('0x27')]=_0x402517;_0x3afe9c[_0x24cb('0x28')]=_0x402517;_0x3afe9c[_0x24cb('0x39')]='opened';var _0x595a8d=_0x24cb('0x3a')+_0x3afe9c['ContactId'];return db['sequelize']['query'](_0x595a8d,{'type':db[_0x24cb('0x2c')][_0x24cb('0x2d')][_0x24cb('0x3b')],'raw':!![]})[_0x24cb('0x20')](function(_0x5d2a7c){return _0x5d2a7c;})[_0x24cb('0x20')](function(_0x5d0be5){if(_0x5d0be5){_0x3afe9c[_0x24cb('0x2e')]=_0x5d0be5[0x0];}return request({'event':_0xdeac63,'message':_0x3afe9c});});};}function afterUpdate(_0xdc229){return function(_0x4e697c){var _0x5acc08=_0x4e697c[_0x24cb('0x3c')](_0x24cb('0x3d'))&&_0x4e697c[_0x24cb('0x3d')];var _0x574480=_0x4e697c['changed']('substatus');if(_0x5acc08||_0x574480){var _0x17782d=_0x5acc08?_0x24cb('0xc'):_0x24cb('0x3e');var _0x3ec3bf=_0x4e697c[_0x24cb('0x26')]({'plain':!![]});_0x3ec3bf[_0x24cb('0x27')]=_0xdc229;_0x3ec3bf[_0x24cb('0x28')]=_0xdc229;_0x3ec3bf[_0x24cb('0x39')]=_0x5acc08?_0x24cb('0x3d'):'substatus';var _0x2c922a=_0x24cb('0x3a')+_0x3ec3bf[_0x24cb('0x2a')];return db['sequelize'][_0x24cb('0x2b')](_0x2c922a,{'type':db[_0x24cb('0x2c')][_0x24cb('0x2d')][_0x24cb('0x3b')],'raw':!![]})[_0x24cb('0x20')](function(_0x3cb2e5){if(_0x3cb2e5){_0x3ec3bf['contact']=_0x3cb2e5[0x0];}if(_0x3ec3bf[_0x24cb('0x2f')]){return db[_0x24cb('0x30')]['find']({'where':{'id':_0x3ec3bf[_0x24cb('0x2f')]},'attributes':['id',_0x24cb('0x36'),_0x24cb('0x32'),'email',_0x24cb('0x33')],'raw':!![]})[_0x24cb('0x20')](function(_0x46c059){_0x3ec3bf[_0x24cb('0x34')]=util[_0x24cb('0x3f')](_0x24cb('0x35'),_0x46c059[_0x24cb('0x36')]);_0x3ec3bf[_0x24cb('0x37')]=_0x46c059;return request({'event':_0x17782d,'message':_0x3ec3bf});})[_0x24cb('0x25')](function(_0x578b4f){console[_0x24cb('0x22')](_0x578b4f);});}else{return request({'event':_0x17782d,'message':_0x3ec3bf});}});}};}exports[_0x24cb('0x40')]=function(){for(var _0x4f19e4=0x0;_0x4f19e4=_0x186512[_0xc1df('0x12')]){throw Error(_0xc1df('0x13'));}_0x18965b(_0x27c57f);})[_0xc1df('0x14')](function(_0x5f2dfa){_0x2d707b(_0x5f2dfa);});});}; \ No newline at end of file +var _0xd235=['mail','chat','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','User','agent','then','agents','catch','bluebird','./license/util','voice'];(function(_0x146a5f,_0x504b47){var _0x5f24d9=function(_0x3c16ff){while(--_0x3c16ff){_0x146a5f['push'](_0x146a5f['shift']());}};_0x5f24d9(++_0x504b47);}(_0xd235,0x1a1));var _0x5d23=function(_0x57b982,_0x510dea){_0x57b982=_0x57b982-0x0;var _0x187bc2=_0xd235[_0x57b982];return _0x187bc2;};'use strict';var _=require('lodash');var BPromise=require(_0x5d23('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x5d23('0x1'));var channels=[_0x5d23('0x2'),_0x5d23('0x3'),_0x5d23('0x4'),'fax',_0x5d23('0x5'),'whatsapp',_0x5d23('0x6')];exports[_0x5d23('0x7')]=function(){return channels;};exports[_0x5d23('0x8')]=function(_0x50acad){_0x50acad=_0x50acad[_0x5d23('0x9')]();return _[_0x5d23('0xa')](channels,_0x50acad);};exports['clearBlockUser']=function(_0x27e99c,_0x6ec54d,_0x1ed9f7,_0x5f3c83){var _0x2a1677={'loginAttempts':_0x6ec54d,'blocked':_0x1ed9f7};if(!_[_0x5d23('0xb')](_0x5f3c83)){_0x2a1677[_0x5d23('0xc')]=_0x5f3c83;}return _0x27e99c[_0x5d23('0xd')](_0x2a1677);};exports[_0x5d23('0xe')]=function(_0x3c2a26){return new BPromise(function(_0x4d3e3a,_0x1bf3e9){var _0x46f4d8=0x0;if(_0x3c2a26[_0x5d23('0xf')]!=='agent'){_0x4d3e3a(_0x3c2a26);}db[_0x5d23('0x10')]['count']({'where':{'role':_0x5d23('0x11'),'online':!![],'id':{'$ne':_0x3c2a26['id']}}})[_0x5d23('0x12')](function(_0x51e841){_0x46f4d8=_0x51e841;return util[_0x5d23('0xe')]();})[_0x5d23('0x12')](function(_0x4baa1a){if(_0x4baa1a&&_0x4baa1a[_0x5d23('0x13')]&&_0x46f4d8>=_0x4baa1a[_0x5d23('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4d3e3a(_0x3c2a26);})[_0x5d23('0x14')](function(_0x1643b5){_0x1bf3e9(_0x1643b5);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d6c1440..b5e408b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2d0=['send','404','status','render','json'];(function(_0x3ba625,_0x25feaa){var _0x53b151=function(_0x3159e7){while(--_0x3159e7){_0x3ba625['push'](_0x3ba625['shift']());}};_0x53b151(++_0x25feaa);}(_0xf2d0,0x137));var _0x0f2d=function(_0x16e772,_0x592d80){_0x16e772=_0x16e772-0x0;var _0x5c9b11=_0xf2d0[_0x16e772];return _0x5c9b11;};'use strict';module['exports'][0x194]=function pageNotFound(_0x118153,_0x28a869){var _0x155898=_0x0f2d('0x0');var _0x19305c=0x194;var _0x444d5a={'status':_0x19305c};_0x28a869[_0x0f2d('0x1')](_0x444d5a[_0x0f2d('0x1')]);_0x28a869[_0x0f2d('0x2')](_0x155898,{},function(_0x57020c,_0x27e73f){if(_0x57020c){return _0x28a869[_0x0f2d('0x1')](_0x444d5a[_0x0f2d('0x1')])[_0x0f2d('0x3')](_0x444d5a);}_0x28a869[_0x0f2d('0x4')](_0x27e73f);});}; \ No newline at end of file +var _0xa896=['exports','404','status','json'];(function(_0x584b6a,_0x4238e0){var _0x3d2ec9=function(_0x43a652){while(--_0x43a652){_0x584b6a['push'](_0x584b6a['shift']());}};_0x3d2ec9(++_0x4238e0);}(_0xa896,0xe0));var _0x6a89=function(_0x369b63,_0x229937){_0x369b63=_0x369b63-0x0;var _0x146990=_0xa896[_0x369b63];return _0x146990;};'use strict';module[_0x6a89('0x0')][0x194]=function pageNotFound(_0x413ff0,_0x50700b){var _0x311208=_0x6a89('0x1');var _0x1d79bb=0x194;var _0x28b980={'status':_0x1d79bb};_0x50700b[_0x6a89('0x2')](_0x28b980[_0x6a89('0x2')]);_0x50700b['render'](_0x311208,{},function(_0x4ae19d,_0x27a06c){if(_0x4ae19d){return _0x50700b[_0x6a89('0x2')](_0x28b980[_0x6a89('0x2')])[_0x6a89('0x3')](_0x28b980);}_0x50700b['send'](_0x27a06c);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 3dbc35c..94b1567 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','JscriptySessionReport','Trunk','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','ListId','TemplateId','team_has_mail_queues','Teams','Messages','MailInteractionId','Account','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','mandatoryDispositionPauseId','SmsInteractionId','Owner','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatGroupId','Company','CompanyId','cm_contact_has_tags','Agent','CampaignId','OwnerId','Automation','Condition','All','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Fields','Subject','DescriptionId','FieldId','Variable','VariableId','SugarcrmField','Description','Field','DeskConfiguration','Descriptions','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','FreshsalesAccount','FreshsalesConfiguration','ChatQueueReport','ToId','SessionId','JscriptyProject','ProjectId','JscriptyQuestionReport','user_has_square_projects','TeamVoiceQueue','team_has_chat_queues','team_has_sms_queues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappMessage','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','password','options','database','username','User','../api/user/user.model','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','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','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','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','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','UserChatQueue','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues'];(function(_0x42a26a,_0xcd612a){var _0x4def88=function(_0x4f2b26){while(--_0x4f2b26){_0x42a26a['push'](_0x42a26a['shift']());}};_0x4def88(++_0xcd612a);}(_0xdace,0xc5));var _0xedac=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xdace[_0x47e549];return _0x251374;};'use strict';var config=require(_0xedac('0x0'));var Sequelize=require('sequelize');var _=require(_0xedac('0x1'));var jstz=require(_0xedac('0x2'));var timezone=jstz[_0xedac('0x3')]();config['sequelize']=_[_0xedac('0x4')](config[_0xedac('0x5')],{'database':_0xedac('0x6'),'username':_0xedac('0x7'),'password':'xC@LL1234','options':{'host':_0xedac('0x8'),'port':0xcea,'dialect':_0xedac('0x9'),'dialectOptions':{'charset':_0xedac('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xedac('0xb'),'collate':_0xedac('0xc')}}});config[_0xedac('0xd')]=_['defaultsDeep'](config[_0xedac('0xd')],{'database':_0xedac('0x6'),'username':_0xedac('0x7'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xedac('0x9'),'dialectOptions':{'charset':_0xedac('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xedac('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xedac('0x5')]['database'],config[_0xedac('0x5')]['username'],config[_0xedac('0x5')][_0xedac('0xe')],config[_0xedac('0x5')][_0xedac('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xedac('0xd')][_0xedac('0x10')],config[_0xedac('0xd')][_0xedac('0x11')],config['sequelizeHistory'][_0xedac('0xe')],config[_0xedac('0xd')][_0xedac('0xf')])};db[_0xedac('0x12')]=db[_0xedac('0x5')]['import'](_0xedac('0x13'));db['VoiceChanSpy']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x15'));db[_0xedac('0x16')]=db['sequelize']['import'](_0xedac('0x17'));db[_0xedac('0x18')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x19'));db[_0xedac('0x1a')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x1b'));db[_0xedac('0x1c')]=db['sequelize'][_0xedac('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0xedac('0x1d')]=db[_0xedac('0x5')]['import'](_0xedac('0x1e'));db[_0xedac('0x1f')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x20'));db[_0xedac('0x21')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x22'));db[_0xedac('0x23')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x24'));db[_0xedac('0x25')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x26'));db['VoiceAgentReport']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x27'));db['VoiceQueueReport']=db[_0xedac('0x5')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0xedac('0x28')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x29'));db['Trunk']=db['sequelize'][_0xedac('0x14')](_0xedac('0x2a'));db[_0xedac('0x2b')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x2c'));db[_0xedac('0x2d')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x2e'));db[_0xedac('0x2f')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x30'));db['UserChatQueue']=db[_0xedac('0x5')][_0xedac('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0xedac('0x31')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x32'));db[_0xedac('0x33')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x34'));db[_0xedac('0x35')]=db[_0xedac('0x5')]['import'](_0xedac('0x36'));db[_0xedac('0x37')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x38'));db[_0xedac('0x39')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x3a'));db[_0xedac('0x3b')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x3c'));db[_0xedac('0x3d')]=db[_0xedac('0x5')]['import'](_0xedac('0x3e'));db[_0xedac('0x3f')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/mailAccount/mailAccount.model');db[_0xedac('0x40')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/mailQueue/mailQueue.model');db[_0xedac('0x41')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0xedac('0x42')]=db[_0xedac('0x5')]['import'](_0xedac('0x43'));db[_0xedac('0x44')]=db['sequelize'][_0xedac('0x14')]('../api/mailMessage/mailMessage.model');db[_0xedac('0x45')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x46'));db[_0xedac('0x47')]=db[_0xedac('0x5')]['import'](_0xedac('0x48'));db[_0xedac('0x49')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x4a'));db[_0xedac('0x4b')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x4c'));db[_0xedac('0x4d')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x4e'));db[_0xedac('0x4f')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/faxApplication/faxApplication.model');db[_0xedac('0x50')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize'][_0xedac('0x14')](_0xedac('0x51'));db['FaxQueue']=db[_0xedac('0x5')]['import'](_0xedac('0x52'));db['FaxQueueReport']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x53'));db[_0xedac('0x54')]=db[_0xedac('0x5')]['import']('../api/smsAccount/smsAccount.model');db[_0xedac('0x55')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x56'));db[_0xedac('0x57')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x58'));db[_0xedac('0x59')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x5a'));db[_0xedac('0x5b')]=db['sequelize']['import'](_0xedac('0x5c'));db[_0xedac('0x5d')]=db['sequelize']['import'](_0xedac('0x5e'));db[_0xedac('0x5f')]=db['sequelize'][_0xedac('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0xedac('0x60')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x61'));db[_0xedac('0x62')]=db[_0xedac('0x5')]['import'](_0xedac('0x63'));db[_0xedac('0x64')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x65'));db[_0xedac('0x66')]=db['sequelize']['import'](_0xedac('0x67'));db[_0xedac('0x68')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x69'));db[_0xedac('0x6a')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x6b'));db[_0xedac('0x6c')]=db[_0xedac('0x5')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xedac('0x6d')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/chatMessage/chatMessage.model');db[_0xedac('0x6e')]=db[_0xedac('0x5')]['import'](_0xedac('0x6f'));db[_0xedac('0x70')]=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0xedac('0x71')]=db['sequelize'][_0xedac('0x14')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x72'));db[_0xedac('0x73')]=db[_0xedac('0x5')]['import'](_0xedac('0x74'));db['CmContact']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x75'));db[_0xedac('0x76')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x77'));db['CmHopperBlack']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x78'));db[_0xedac('0x79')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x7a'));db[_0xedac('0x7b')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x7c'));db[_0xedac('0x7d')]=db[_0xedac('0x5')]['import'](_0xedac('0x7e'));db['Action']=db[_0xedac('0x5')][_0xedac('0x14')]('../api/action/action.model');db['Automation']=db['sequelize'][_0xedac('0x14')](_0xedac('0x7f'));db[_0xedac('0x80')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x81'));db[_0xedac('0x82')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x83'));db['Condition']=db[_0xedac('0x5')][_0xedac('0x14')]('../api/condition/condition.model');db[_0xedac('0x84')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x85'));db[_0xedac('0x86')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x87'));db[_0xedac('0x88')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x89'));db[_0xedac('0x8a')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x8b'));db[_0xedac('0x8c')]=db[_0xedac('0x5')]['import'](_0xedac('0x8d'));db['Sound']=db[_0xedac('0x5')]['import'](_0xedac('0x8e'));db[_0xedac('0x8f')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x90'));db[_0xedac('0x91')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x92'));db[_0xedac('0x93')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x94'));db['Variable']=db[_0xedac('0x5')]['import'](_0xedac('0x95'));db[_0xedac('0x96')]=db[_0xedac('0x5')]['import'](_0xedac('0x97'));db['IntegrationReport']=db['sequelize'][_0xedac('0x14')](_0xedac('0x98'));db[_0xedac('0x99')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xedac('0x9a')]=db['sequelize'][_0xedac('0x14')](_0xedac('0x9b'));db[_0xedac('0x9c')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x9d'));db['AnalyticMetric']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x9e'));db[_0xedac('0x9f')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xa0'));db[_0xedac('0xa1')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xa2'));db[_0xedac('0xa3')]=db['sequelize'][_0xedac('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xedac('0x5')]['import'](_0xedac('0xa4'));db[_0xedac('0xa5')]=db['sequelize'][_0xedac('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0xedac('0xa6')]=db['sequelize'][_0xedac('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xedac('0xa7')]=db[_0xedac('0x5')]['import'](_0xedac('0xa8'));db['SugarcrmField']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xa9'));db[_0xedac('0xaa')]=db[_0xedac('0x5')]['import'](_0xedac('0xab'));db['DeskConfiguration']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xac'));db[_0xedac('0xad')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/intDeskField/intDeskField.model');db[_0xedac('0xae')]=db[_0xedac('0x5')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xedac('0xaf')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xb0'));db[_0xedac('0xb1')]=db['sequelize'][_0xedac('0x14')](_0xedac('0xb2'));db['ZendeskAccount']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xb3'));db[_0xedac('0xb4')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xb5'));db[_0xedac('0xb6')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xedac('0xb7')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xb8'));db[_0xedac('0xb9')]=db['sequelize'][_0xedac('0x14')](_0xedac('0xba'));db[_0xedac('0xbb')]=db[_0xedac('0x5')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xedac('0xbc')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xbd'));db[_0xedac('0xbe')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xbf'));db[_0xedac('0xc0')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xc1'));db['ServicenowAccount']=db[_0xedac('0x5')]['import'](_0xedac('0xc2'));db['ServicenowConfiguration']=db[_0xedac('0x5')][_0xedac('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xedac('0xc3')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0xedac('0xc4')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xedac('0xc5')]=db['sequelize'][_0xedac('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xedac('0xc6')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xc7'));db['FreshsalesAccount']=db['sequelize'][_0xedac('0x14')](_0xedac('0xc8'));db['FreshsalesConfiguration']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xc9'));db[_0xedac('0xca')]=db[_0xedac('0x5')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xedac('0x96')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/integration/integration.model');db[_0xedac('0xcb')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xcc'));db['ChatQueueReport']=db[_0xedac('0x5')][_0xedac('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0xedac('0xcd')]=db['sequelize'][_0xedac('0x14')](_0xedac('0xce'));db[_0xedac('0xcf')]=db[_0xedac('0x5')]['import'](_0xedac('0xd0'));db['JscriptyQuestionReport']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xd1'));db['JscriptySessionReport']=db['sequelize'][_0xedac('0x14')](_0xedac('0xd2'));db[_0xedac('0xd3')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xedac('0xd4')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xd5'));db[_0xedac('0xd6')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xd7'));db['JscriptyProject']=db[_0xedac('0x5')]['import'](_0xedac('0xd8'));db[_0xedac('0xd9')]=db['sequelize'][_0xedac('0x14')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xda'));db[_0xedac('0xdb')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xdc'));db['SquareMessage']=db['sequelize'][_0xedac('0x14')](_0xedac('0xdd'));db[_0xedac('0xde')]=db[_0xedac('0x5')]['import'](_0xedac('0xdf'));db[_0xedac('0xe0')]=db['sequelize'][_0xedac('0x14')](_0xedac('0xe1'));db[_0xedac('0xe2')]=db['sequelize']['import'](_0xedac('0xe3'));db[_0xedac('0xe4')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xe5'));db[_0xedac('0xe6')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xe7'));db[_0xedac('0xe8')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/plugin/plugin.model');db[_0xedac('0xe9')]=db['sequelize']['import'](_0xedac('0xea'));db[_0xedac('0xeb')]=db[_0xedac('0x5')]['import'](_0xedac('0xec'));db[_0xedac('0xed')]=db[_0xedac('0x5')][_0xedac('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0xedac('0xee')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xef'));db[_0xedac('0xf0')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xf1'));db[_0xedac('0xf2')]=db['sequelize'][_0xedac('0x14')](_0xedac('0xf3'));db[_0xedac('0xf4')]=db[_0xedac('0x5')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xf5'));db[_0xedac('0xf6')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xf7'));db['UserProfileResource']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xf8'));db[_0xedac('0xf9')]=db['sequelize']['import'](_0xedac('0xfa'));db[_0xedac('0xfb')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xfc'));db['WhatsappApplication']=db['sequelize'][_0xedac('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0xedac('0xfd')]=db[_0xedac('0x5')]['import'](_0xedac('0xfe'));db['WhatsappMessage']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0xff'));db[_0xedac('0x100')]=db[_0xedac('0x5')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xedac('0x5')]['import'](_0xedac('0x101'));db['WhatsappQueue']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x102'));db[_0xedac('0x103')]=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x104'));db['TeamVoiceQueue']=db['sequelize'][_0xedac('0x14')](_0xedac('0x105'));db['TeamVoicePrefix']=db[_0xedac('0x5')][_0xedac('0x14')](_0xedac('0x106'));db[_0xedac('0x107')]=db[_0xedac('0x5')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xedac('0x12')]['hasOne'](db[_0xedac('0x1f')],{'as':'VoiceMail','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x1c')],{'as':_0xedac('0x10b'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db['VoiceExtension'],{'as':_0xedac('0x10c'),'onDelete':'cascade','hooks':!![]});db[_0xedac('0x12')]['hasMany'](db['CmHopperFinal'],{'as':_0xedac('0x10d'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x7b')],{'as':_0xedac('0x10e'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x10f')],{'as':_0xedac('0x10f'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db['OpenchannelInteraction'],{'as':_0xedac('0x110'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x6c')],{'as':_0xedac('0x111'),'foreignKey':'UserId'});db[_0xedac('0x12')][_0xedac('0x10a')](db['SmsInteraction'],{'as':_0xedac('0x112'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0x50')],{'as':_0xedac('0x113'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db['MailInteraction'],{'as':_0xedac('0x114'),'foreignKey':_0xedac('0x109')});db['User'][_0xedac('0x10a')](db[_0xedac('0xfd')],{'as':_0xedac('0x115'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x12')][_0xedac('0x10a')](db[_0xedac('0xf9')],{'as':_0xedac('0x116'),'foreignKey':'SenderId'});db[_0xedac('0x12')][_0xedac('0x117')](db[_0xedac('0x118')],{'as':'UserProfile','foreignKey':_0xedac('0x119')});db['User'][_0xedac('0x11a')](db[_0xedac('0x71')],{'as':'Groups','through':_0xedac('0x11b')});db['User'][_0xedac('0x11a')](db[_0xedac('0x11c')],{'as':_0xedac('0x11d'),'through':_0xedac('0x11e')});db['User'][_0xedac('0x11a')](db[_0xedac('0xf2')],{'as':_0xedac('0x11f'),'through':_0xedac('0x120')});db['User']['belongsToMany'](db[_0xedac('0xde')],{'through':_0xedac('0x121')});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x42')],{'as':_0xedac('0x114'),'through':_0xedac('0x122')});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x6c')],{'as':_0xedac('0x111'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0xedac('0x50')],{'as':_0xedac('0x113'),'through':_0xedac('0x123')});db[_0xedac('0x12')]['belongsToMany'](db[_0xedac('0x57')],{'as':'SmsInteractions','through':_0xedac('0x124')});db[_0xedac('0x12')]['belongsToMany'](db[_0xedac('0x60')],{'as':_0xedac('0x110'),'through':_0xedac('0x125')});db['User'][_0xedac('0x11a')](db[_0xedac('0xfd')],{'as':'WhatsappInteractions','through':_0xedac('0x126')});db['User'][_0xedac('0x11a')](db[_0xedac('0x1a')],{'as':_0xedac('0x127'),'through':_0xedac('0x2f'),'required':![]});db[_0xedac('0x12')]['belongsToMany'](db[_0xedac('0xf4')],{'as':'VoicePrefixes','through':_0xedac('0x107'),'required':![]});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x40')],{'as':_0xedac('0x128'),'through':_0xedac('0x31'),'required':![]});db[_0xedac('0x12')][_0xedac('0x11a')](db['ChatQueue'],{'as':_0xedac('0x129'),'through':_0xedac('0x12a'),'required':![],'hooks':!![]});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x12b')],{'as':_0xedac('0x12c'),'through':'UserFaxQueue','required':![]});db[_0xedac('0x12')]['belongsToMany'](db[_0xedac('0x5b')],{'as':_0xedac('0x12d'),'through':_0xedac('0x35'),'required':![]});db['User'][_0xedac('0x11a')](db[_0xedac('0x64')],{'as':_0xedac('0x12e'),'through':_0xedac('0x37'),'required':![]});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x12f')],{'as':_0xedac('0x130'),'through':_0xedac('0x39'),'required':![]});db['User']['belongsToMany'](db[_0xedac('0xf2')],{'through':_0xedac('0x120')});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x66')],{'as':'ChatWebsites','through':_0xedac('0x131')});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x4d')],{'as':'FaxAccounts','through':_0xedac('0x132')});db[_0xedac('0x12')][_0xedac('0x11a')](db[_0xedac('0x3f')],{'as':_0xedac('0x133'),'through':_0xedac('0x134')});db['User']['belongsToMany'](db[_0xedac('0x5d')],{'as':_0xedac('0x135'),'through':_0xedac('0x136')});db['User'][_0xedac('0x11a')](db[_0xedac('0x54')],{'as':_0xedac('0x137'),'through':'user_has_sms_accounts'});db['User'][_0xedac('0x11a')](db['WhatsappAccount'],{'as':_0xedac('0x138'),'through':_0xedac('0x139')});db['User']['belongsToMany'](db['SquareProject'],{'as':_0xedac('0x13a'),'through':'user_has_square_projects'});db['VoiceChanSpy'][_0xedac('0x10a')](db[_0xedac('0x18')],{'as':_0xedac('0x13b'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x13c')});db[_0xedac('0x16')][_0xedac('0x10a')](db[_0xedac('0x18')],{'onDelete':_0xedac('0x108')});db[_0xedac('0x18')][_0xedac('0x10a')](db[_0xedac('0x18')],{'as':_0xedac('0x13d'),'onDelete':'cascade'});db[_0xedac('0x13e')][_0xedac('0x11a')](db[_0xedac('0x13f')],{'as':_0xedac('0x140'),'through':_0xedac('0x141')});db[_0xedac('0x1a')][_0xedac('0x10a')](db['UserVoiceQueueRt'],{'as':_0xedac('0x142'),'foreignKey':_0xedac('0x143')});db[_0xedac('0x1a')][_0xedac('0x10a')](db[_0xedac('0x76')],{'as':_0xedac('0x144'),'foreignKey':'VoiceQueueId'});db[_0xedac('0x1a')][_0xedac('0x10a')](db[_0xedac('0x79')],{'as':_0xedac('0x10d'),'foreignKey':_0xedac('0x143')});db['VoiceQueue'][_0xedac('0x10a')](db[_0xedac('0x7b')],{'as':_0xedac('0x145'),'foreignKey':_0xedac('0x143')});db[_0xedac('0x1a')][_0xedac('0x10a')](db[_0xedac('0x10f')],{'as':_0xedac('0x10f'),'foreignKey':_0xedac('0x143')});db[_0xedac('0x1a')][_0xedac('0x10a')](db[_0xedac('0x146')],{'as':'HopperBlacks','foreignKey':_0xedac('0x143')});db[_0xedac('0x1a')][_0xedac('0x10a')](db[_0xedac('0x147')],{'as':'JscriptySessions','foreignKey':_0xedac('0x143')});db[_0xedac('0x1a')][_0xedac('0x117')](db[_0xedac('0x148')],{'as':'Trunk','foreignKey':_0xedac('0x149')});db[_0xedac('0x1a')]['belongsTo'](db[_0xedac('0x148')],{'as':'TrunkBackup','foreignKey':_0xedac('0x14a')});db[_0xedac('0x1a')][_0xedac('0x117')](db[_0xedac('0x84')],{'as':_0xedac('0x84'),'foreignKey':_0xedac('0x14b')});db[_0xedac('0x1a')]['belongsTo'](db[_0xedac('0x86')],{'as':_0xedac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xedac('0x11a')](db[_0xedac('0xf2')],{'as':_0xedac('0x11f'),'through':_0xedac('0x14d')});db[_0xedac('0x1a')]['belongsToMany'](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0xedac('0xde')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0xedac('0x1a')]['belongsToMany'](db['CmList'],{'as':'BlackLists','through':_0xedac('0x14f')});db[_0xedac('0x1c')]['belongsTo'](db[_0xedac('0x12')],{'as':_0xedac('0x12'),'foreignKey':'UserId'});db[_0xedac('0x1d')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':_0xedac('0x12'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x1f')]['hasMany'](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x150'),'sourceKey':_0xedac('0x151')});db[_0xedac('0x21')]['belongsTo'](db[_0xedac('0x1f')],{'foreignKey':_0xedac('0x150'),'targetKey':'mailbox'});db[_0xedac('0x23')][_0xedac('0x10a')](db[_0xedac('0x152')],{'as':_0xedac('0x153'),'foreignKey':_0xedac('0x154'),'constraints':![]});db[_0xedac('0x23')][_0xedac('0x10a')](db[_0xedac('0x155')],{'as':'AgentReports','foreignKey':_0xedac('0x154'),'constraints':![]});db[_0xedac('0x23')][_0xedac('0x117')](db['User'],{'as':_0xedac('0x12'),'foreignKey':_0xedac('0x109')});db['VoiceCallReport'][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x3b')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xedac('0x158')});db[_0xedac('0x3d')][_0xedac('0x117')](db[_0xedac('0x3f')],{'as':_0xedac('0x3f'),'foreignKey':'MailAccountId'});db[_0xedac('0x3f')]['hasOne'](db[_0xedac('0x3b')],{'as':_0xedac('0x159'),'onDelete':_0xedac('0x108')});db['MailAccount']['hasOne'](db[_0xedac('0x3d')],{'as':_0xedac('0x15a'),'onDelete':_0xedac('0x108')});db['MailAccount'][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':_0xedac('0x15b'),'foreignKey':_0xedac('0x158'),'onDelete':_0xedac('0x108')});db['MailAccount'][_0xedac('0x10a')](db[_0xedac('0x80')],{'as':_0xedac('0x15c'),'foreignKey':'MailAccountId'});db[_0xedac('0x3f')][_0xedac('0x10a')](db[_0xedac('0x44')],{'as':'Messages','foreignKey':_0xedac('0x158')});db[_0xedac('0x3f')][_0xedac('0x10a')](db[_0xedac('0x42')],{'as':'Interactions'});db[_0xedac('0x3f')][_0xedac('0x10a')](db[_0xedac('0x45')],{'as':_0xedac('0x13d')});db[_0xedac('0x3f')]['belongsTo'](db[_0xedac('0xf2')],{'as':'List','foreignKey':_0xedac('0x15d')});db['MailAccount'][_0xedac('0x117')](db[_0xedac('0x91')],{'as':'Template','foreignKey':_0xedac('0x15e')});db[_0xedac('0x3f')]['belongsTo'](db['Pause'],{'as':_0xedac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x134')});db[_0xedac('0x40')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x14e'),'through':_0xedac('0x31')});db['MailQueue'][_0xedac('0x11a')](db['Team'],{'through':_0xedac('0x15f'),'as':_0xedac('0x160')});db['MailInteraction'][_0xedac('0x10a')](db[_0xedac('0x44')],{'as':_0xedac('0x161'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x162')});db['MailInteraction'][_0xedac('0x117')](db[_0xedac('0x3f')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x158')});db[_0xedac('0x42')][_0xedac('0x117')](db['CmContact'],{'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x42')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':'Owner','foreignKey':_0xedac('0x109')});db[_0xedac('0x42')][_0xedac('0x11a')](db[_0xedac('0x8f')],{'through':'mail_interaction_has_tags','as':_0xedac('0x164')});db[_0xedac('0x42')][_0xedac('0x11a')](db[_0xedac('0x8f')],{'through':_0xedac('0x165'),'as':_0xedac('0x166')});db[_0xedac('0x42')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x167'),'through':_0xedac('0x122'),'foreignKey':'MailInteractionId'});db[_0xedac('0x44')]['hasMany'](db[_0xedac('0xe6')],{'as':_0xedac('0x168'),'onDelete':_0xedac('0x108')});db[_0xedac('0x44')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':'User'});db['MailMessage'][_0xedac('0x117')](db[_0xedac('0x11c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156')});db[_0xedac('0x44')][_0xedac('0x117')](db[_0xedac('0x42')],{'as':_0xedac('0x169'),'foreignKey':_0xedac('0x162')});db[_0xedac('0x44')][_0xedac('0x117')](db[_0xedac('0x3f')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x158')});db[_0xedac('0x44')]['belongsTo'](db['ChatWebsite'],{'as':_0xedac('0x66'),'foreignKey':_0xedac('0x16a')});db[_0xedac('0x44')][_0xedac('0x117')](db[_0xedac('0x6e')],{'as':_0xedac('0x6e'),'foreignKey':_0xedac('0x16b')});db[_0xedac('0x45')][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':'restrict'});db[_0xedac('0x45')]['belongsTo'](db[_0xedac('0x40')],{'onDelete':'restrict'});db['MailApplication'][_0xedac('0x117')](db[_0xedac('0x3f')],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x45')][_0xedac('0x117')](db[_0xedac('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xedac('0x45')][_0xedac('0x117')](db[_0xedac('0x8f')],{'onDelete':_0xedac('0x16c'),'foreignKey':_0xedac('0x16d')});db[_0xedac('0x47')][_0xedac('0x117')](db['MailAccount'],{});db[_0xedac('0x47')][_0xedac('0x117')](db['CmList'],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d')});db[_0xedac('0x47')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x47')][_0xedac('0x117')](db['MailInteraction'],{});db[_0xedac('0x47')][_0xedac('0x117')](db[_0xedac('0x44')],{});db[_0xedac('0x47')][_0xedac('0x117')](db[_0xedac('0x12')],{});db[_0xedac('0x47')][_0xedac('0x117')](db[_0xedac('0x40')],{});db[_0xedac('0x49')][_0xedac('0x10a')](db[_0xedac('0x4b')],{'as':_0xedac('0x16f'),'onDelete':'cascade'});db['FaxAccount'][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':_0xedac('0x15b'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0xedac('0x4d')][_0xedac('0x10a')](db[_0xedac('0x80')],{'as':_0xedac('0x15c'),'foreignKey':_0xedac('0x170')});db['FaxAccount'][_0xedac('0x10a')](db[_0xedac('0x50')],{'as':_0xedac('0x171')});db[_0xedac('0x4d')][_0xedac('0x10a')](db['FaxApplication'],{'as':'Applications'});db[_0xedac('0x4d')]['hasMany'](db[_0xedac('0x18')],{'as':_0xedac('0x172'),'onDelete':_0xedac('0x108')});db['FaxAccount']['hasMany'](db[_0xedac('0x173')],{'as':'Messages'});db[_0xedac('0x4d')][_0xedac('0x117')](db[_0xedac('0x148')],{'as':_0xedac('0x148')});db[_0xedac('0x4d')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d')});db['FaxAccount']['belongsTo'](db[_0xedac('0x86')],{'as':_0xedac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xedac('0x4d')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x14e'),'through':_0xedac('0x132')});db['FaxApplication'][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x4f')][_0xedac('0x117')](db[_0xedac('0x12b')],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x4f')][_0xedac('0x117')](db['FaxAccount'],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x4f')][_0xedac('0x117')](db[_0xedac('0x8f')],{'onDelete':'restrict','foreignKey':_0xedac('0x16d')});db['FaxInteraction'][_0xedac('0x10a')](db['FaxMessage'],{'as':'Messages','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x174')});db[_0xedac('0x50')][_0xedac('0x117')](db[_0xedac('0x4d')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xedac('0x50')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x50')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xedac('0x109')});db[_0xedac('0x50')][_0xedac('0x11a')](db['Tag'],{'through':_0xedac('0x175'),'as':_0xedac('0x164')});db[_0xedac('0x50')][_0xedac('0x11a')](db[_0xedac('0x8f')],{'through':_0xedac('0x175'),'as':_0xedac('0x166')});db[_0xedac('0x50')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':'Users','through':_0xedac('0x123'),'foreignKey':_0xedac('0x174')});db[_0xedac('0x173')][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x12')});db[_0xedac('0x173')][_0xedac('0x117')](db[_0xedac('0x50')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0xedac('0x173')]['belongsTo'](db['CmContact'],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156')});db[_0xedac('0x173')][_0xedac('0x117')](db[_0xedac('0xe6')],{'as':_0xedac('0xe6'),'foreignKey':_0xedac('0x176')});db[_0xedac('0x173')][_0xedac('0x117')](db[_0xedac('0x4d')],{'as':'Account','foreignKey':_0xedac('0x170')});db[_0xedac('0x12b')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':'UserFaxQueue'});db[_0xedac('0x12b')][_0xedac('0x11a')](db['Team'],{'through':_0xedac('0x177'),'as':_0xedac('0x160')});db['FaxQueueReport'][_0xedac('0x117')](db[_0xedac('0x4d')],{});db[_0xedac('0x178')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':'ListId'});db[_0xedac('0x178')]['belongsTo'](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x178')][_0xedac('0x117')](db[_0xedac('0x50')],{});db[_0xedac('0x178')][_0xedac('0x117')](db[_0xedac('0x173')],{});db['FaxQueueReport']['belongsTo'](db[_0xedac('0x12')],{});db[_0xedac('0x178')]['belongsTo'](db['FaxQueue'],{});db[_0xedac('0x54')][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':_0xedac('0x15b'),'foreignKey':_0xedac('0x179'),'onDelete':_0xedac('0x108')});db[_0xedac('0x54')][_0xedac('0x10a')](db[_0xedac('0x80')],{'as':_0xedac('0x15c'),'foreignKey':_0xedac('0x179')});db['SmsAccount'][_0xedac('0x10a')](db[_0xedac('0x59')],{'as':_0xedac('0x161'),'foreignKey':_0xedac('0x179')});db[_0xedac('0x54')]['hasMany'](db[_0xedac('0x57')],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0xedac('0x55')],{'as':_0xedac('0x13d')});db[_0xedac('0x54')]['belongsTo'](db[_0xedac('0xf2')],{'as':'List','foreignKey':'ListId'});db[_0xedac('0x54')][_0xedac('0x117')](db[_0xedac('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xedac('0x17a')});db[_0xedac('0x54')]['belongsToMany'](db[_0xedac('0x12')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0xedac('0x55')][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':'restrict'});db[_0xedac('0x55')][_0xedac('0x117')](db[_0xedac('0x5b')],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x55')][_0xedac('0x117')](db[_0xedac('0x54')],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x55')][_0xedac('0x117')](db[_0xedac('0x84')],{'onDelete':_0xedac('0x16c'),'foreignKey':'IntervalId'});db[_0xedac('0x55')][_0xedac('0x117')](db[_0xedac('0x8f')],{'onDelete':_0xedac('0x16c'),'foreignKey':_0xedac('0x16d')});db[_0xedac('0x57')][_0xedac('0x10a')](db[_0xedac('0x59')],{'as':_0xedac('0x161'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x17b')});db[_0xedac('0x57')][_0xedac('0x117')](db[_0xedac('0x54')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x179')});db['SmsInteraction'][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x57')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':_0xedac('0x17c'),'foreignKey':'UserId'});db[_0xedac('0x57')][_0xedac('0x11a')](db[_0xedac('0x8f')],{'through':_0xedac('0x17d'),'as':_0xedac('0x164')});db['SmsInteraction']['belongsToMany'](db[_0xedac('0x8f')],{'through':_0xedac('0x17d'),'as':'ThroughTags'});db[_0xedac('0x57')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0xedac('0x17b')});db['SmsMessage'][_0xedac('0x117')](db['User'],{'as':_0xedac('0x12')});db['SmsMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156')});db[_0xedac('0x59')][_0xedac('0x117')](db[_0xedac('0x57')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x169'),'foreignKey':_0xedac('0x17b')});db[_0xedac('0x59')]['belongsTo'](db[_0xedac('0x54')],{'as':'Account','foreignKey':_0xedac('0x179')});db[_0xedac('0x5b')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':'Agents','through':_0xedac('0x35'),'foreignKey':_0xedac('0x17e')});db['SmsQueue'][_0xedac('0x11a')](db[_0xedac('0xde')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xedac('0x5d')][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':'Dispositions','foreignKey':_0xedac('0x17f'),'onDelete':_0xedac('0x108')});db['OpenchannelAccount']['hasMany'](db[_0xedac('0x80')],{'as':_0xedac('0x15c'),'foreignKey':_0xedac('0x17f')});db['OpenchannelAccount']['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0xedac('0x17f')});db[_0xedac('0x5d')]['hasMany'](db[_0xedac('0x62')],{'as':_0xedac('0x161'),'foreignKey':_0xedac('0x17f')});db[_0xedac('0x5d')][_0xedac('0x10a')](db[_0xedac('0x5f')],{'as':'Applications','foreignKey':_0xedac('0x17f')});db[_0xedac('0x5d')]['belongsTo'](db[_0xedac('0xf2')],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount'][_0xedac('0x117')](db['Pause'],{'as':_0xedac('0x14c'),'foreignKey':_0xedac('0x17a')});db[_0xedac('0x5d')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x136')});db[_0xedac('0x5f')][_0xedac('0x117')](db['User'],{'onDelete':_0xedac('0x16c')});db['OpenchannelApplication'][_0xedac('0x117')](db[_0xedac('0x64')],{'onDelete':_0xedac('0x16c'),'foreignKey':_0xedac('0x180')});db['OpenchannelApplication']['belongsTo'](db[_0xedac('0x5d')],{'onDelete':_0xedac('0x16c'),'foreignKey':_0xedac('0x17f')});db[_0xedac('0x5f')]['belongsTo'](db[_0xedac('0x84')],{'onDelete':_0xedac('0x16c'),'foreignKey':_0xedac('0x14b')});db[_0xedac('0x5f')][_0xedac('0x117')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xedac('0x60')][_0xedac('0x10a')](db[_0xedac('0x62')],{'as':_0xedac('0x161'),'onDelete':'cascade','foreignKey':_0xedac('0x181')});db[_0xedac('0x60')][_0xedac('0x117')](db[_0xedac('0x5d')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x17f')});db[_0xedac('0x60')]['belongsTo'](db['CmContact'],{'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x60')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':_0xedac('0x17c'),'foreignKey':_0xedac('0x109')});db['OpenchannelInteraction'][_0xedac('0x11a')](db[_0xedac('0x8f')],{'through':_0xedac('0x182'),'as':_0xedac('0x164')});db[_0xedac('0x60')]['belongsToMany'](db['Tag'],{'through':_0xedac('0x182'),'as':_0xedac('0x166')});db[_0xedac('0x60')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x167'),'through':'user_has_openchannel_interactions','foreignKey':_0xedac('0x181')});db[_0xedac('0x62')][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x12')});db['OpenchannelMessage'][_0xedac('0x117')](db[_0xedac('0x11c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156')});db[_0xedac('0x62')][_0xedac('0x117')](db[_0xedac('0x60')],{'onDelete':'cascade','as':_0xedac('0x169'),'foreignKey':_0xedac('0x181')});db['OpenchannelMessage'][_0xedac('0x117')](db[_0xedac('0xe6')],{'as':_0xedac('0xe6'),'foreignKey':_0xedac('0x176')});db['OpenchannelMessage'][_0xedac('0x117')](db[_0xedac('0x5d')],{'as':_0xedac('0x163'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x37'),'foreignKey':_0xedac('0x180')});db[_0xedac('0x64')][_0xedac('0x11a')](db[_0xedac('0xde')],{'through':_0xedac('0x183'),'as':_0xedac('0x160')});db[_0xedac('0x66')][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':_0xedac('0x15b'),'foreignKey':_0xedac('0x16a'),'onDelete':_0xedac('0x108')});db[_0xedac('0x66')][_0xedac('0x10a')](db[_0xedac('0x80')],{'as':_0xedac('0x15c'),'foreignKey':_0xedac('0x16a')});db[_0xedac('0x66')][_0xedac('0x10a')](db[_0xedac('0x184')],{'as':_0xedac('0x185')});db[_0xedac('0x66')]['hasMany'](db[_0xedac('0x6c')],{'as':'Interactions'});db[_0xedac('0x66')][_0xedac('0x10a')](db[_0xedac('0x6a')],{'as':'Applications'});db[_0xedac('0x66')][_0xedac('0x10a')](db[_0xedac('0x6d')],{'as':_0xedac('0x161')});db[_0xedac('0x66')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':'ListId'});db[_0xedac('0x66')][_0xedac('0x117')](db['Interval'],{'as':'Interval','foreignKey':_0xedac('0x14b')});db['ChatWebsite'][_0xedac('0x117')](db['MailAccount'],{'as':_0xedac('0x3f'),'foreignKey':_0xedac('0x158')});db[_0xedac('0x66')]['belongsTo'](db['Pause'],{'as':_0xedac('0x14c'),'foreignKey':_0xedac('0x17a')});db[_0xedac('0x66')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x131')});db[_0xedac('0x68')][_0xedac('0x117')](db[_0xedac('0x5d')],{});db[_0xedac('0x68')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d')});db['OpenchannelQueueReport'][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x68')][_0xedac('0x117')](db[_0xedac('0x60')],{});db[_0xedac('0x68')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xedac('0x68')][_0xedac('0x117')](db[_0xedac('0x12')],{});db[_0xedac('0x68')][_0xedac('0x117')](db[_0xedac('0x64')],{});db[_0xedac('0x6a')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':_0xedac('0x16c')});db[_0xedac('0x6a')][_0xedac('0x117')](db[_0xedac('0x70')],{'as':_0xedac('0x186'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db['ChatApplication'][_0xedac('0x117')](db[_0xedac('0x66')],{'as':_0xedac('0x187'),'foreignKey':'ChatWebsiteId','onDelete':_0xedac('0x16c')});db[_0xedac('0x6a')][_0xedac('0x117')](db[_0xedac('0x8f')],{'onDelete':_0xedac('0x16c'),'foreignKey':'TagId'});db[_0xedac('0x6c')][_0xedac('0x10a')](db[_0xedac('0x6d')],{'as':_0xedac('0x161'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x188')});db[_0xedac('0x6c')]['belongsTo'](db[_0xedac('0x66')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x16a')});db['ChatInteraction']['belongsTo'](db['CmContact'],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db['ChatInteraction'][_0xedac('0x117')](db[_0xedac('0x12')],{'as':'Owner','foreignKey':_0xedac('0x109')});db[_0xedac('0x6c')][_0xedac('0x11a')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xedac('0x164')});db[_0xedac('0x6c')][_0xedac('0x11a')](db['Tag'],{'through':_0xedac('0x189'),'as':'ThroughTags'});db[_0xedac('0x6c')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x167'),'through':_0xedac('0x18a'),'foreignKey':'ChatInteractionId'});db[_0xedac('0x6d')][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x12')});db[_0xedac('0x6d')][_0xedac('0x117')](db[_0xedac('0x11c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x6d')][_0xedac('0x117')](db[_0xedac('0x6c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x169'),'foreignKey':_0xedac('0x188')});db['ChatMessage'][_0xedac('0x117')](db[_0xedac('0xe6')],{'as':_0xedac('0xe6'),'foreignKey':_0xedac('0x176')});db[_0xedac('0x6d')][_0xedac('0x117')](db[_0xedac('0x66')],{'as':_0xedac('0x163'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xedac('0x10a')](db['Attachment'],{'as':_0xedac('0x168'),'foreignKey':_0xedac('0x16b'),'onDelete':_0xedac('0x108'),'hooks':!![]});db['ChatOfflineMessage'][_0xedac('0x117')](db[_0xedac('0x11c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x6e')][_0xedac('0x117')](db[_0xedac('0x66')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x16a')});db['ChatQueue']['belongsToMany'](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x12a'),'hooks':!![]});db[_0xedac('0x70')]['belongsToMany'](db[_0xedac('0xde')],{'through':'team_has_chat_queues','as':_0xedac('0x160')});db['ChatGroup'][_0xedac('0x10a')](db['ChatInternalMessage'],{'as':_0xedac('0x161'),'foreignKey':_0xedac('0x18b'),'onDelete':'cascade'});db[_0xedac('0x71')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':'Members','through':_0xedac('0x11b')});db['ChatProactiveAction'][_0xedac('0x117')](db[_0xedac('0x66')],{'as':_0xedac('0x187'),'foreignKey':_0xedac('0x16a')});db['CmCompany'][_0xedac('0x10a')](db[_0xedac('0x11c')],{'as':_0xedac('0x11d'),'foreignKey':'CompanyId'});db['CmContact'][_0xedac('0x10a')](db[_0xedac('0x76')],{'as':'Hoppers','foreignKey':_0xedac('0x157')});db[_0xedac('0x11c')][_0xedac('0x10a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xedac('0x157')});db[_0xedac('0x11c')][_0xedac('0x10a')](db[_0xedac('0x7b')],{'as':_0xedac('0x145'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x11c')][_0xedac('0x10a')](db[_0xedac('0x10f')],{'as':_0xedac('0x10f'),'foreignKey':_0xedac('0x157')});db[_0xedac('0x11c')]['hasMany'](db[_0xedac('0x147')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0xedac('0x11c')][_0xedac('0x10a')](db[_0xedac('0x60')],{'as':_0xedac('0x110'),'foreignKey':_0xedac('0x157'),'onDelete':_0xedac('0x16c')});db[_0xedac('0x11c')][_0xedac('0x10a')](db['ChatInteraction'],{'as':_0xedac('0x111'),'foreignKey':_0xedac('0x157'),'onDelete':'restrict'});db['CmContact'][_0xedac('0x10a')](db[_0xedac('0x57')],{'as':_0xedac('0x112'),'foreignKey':_0xedac('0x157'),'onDelete':_0xedac('0x16c')});db[_0xedac('0x11c')]['hasMany'](db['FaxInteraction'],{'as':_0xedac('0x113'),'foreignKey':'ContactId','onDelete':_0xedac('0x16c')});db[_0xedac('0x11c')][_0xedac('0x10a')](db['MailInteraction'],{'as':_0xedac('0x114'),'foreignKey':_0xedac('0x157'),'onDelete':_0xedac('0x16c')});db[_0xedac('0x11c')]['belongsTo'](db['CmCompany'],{'as':_0xedac('0x18c'),'foreignKey':_0xedac('0x18d')});db[_0xedac('0x11c')]['belongsTo'](db['CmList'],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d'),'onDelete':_0xedac('0x108')});db[_0xedac('0x11c')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x167'),'through':_0xedac('0x11e')});db[_0xedac('0x11c')]['belongsToMany'](db['Tag'],{'as':_0xedac('0x164'),'through':'cm_contact_has_tags'});db[_0xedac('0x11c')]['belongsToMany'](db['Tag'],{'through':_0xedac('0x18e'),'as':_0xedac('0x166')});db[_0xedac('0x76')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':'ContactId','onDelete':_0xedac('0x108')});db[_0xedac('0x76')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':'ListId','onDelete':_0xedac('0x108')});db[_0xedac('0x76')][_0xedac('0x117')](db[_0xedac('0x12')],{'as':_0xedac('0x18f'),'foreignKey':_0xedac('0x109')});db[_0xedac('0x76')][_0xedac('0x117')](db[_0xedac('0x1a')],{'as':_0xedac('0x186'),'foreignKey':_0xedac('0x143'),'onDelete':_0xedac('0x108')});db['CmHopper'][_0xedac('0x117')](db[_0xedac('0xe2')],{'as':_0xedac('0xe2'),'foreignKey':_0xedac('0x190'),'onDelete':_0xedac('0x108')});db['CmHopper'][_0xedac('0x117')](db[_0xedac('0x12')],{'as':'Owner','foreignKey':_0xedac('0x191')});db[_0xedac('0x146')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':'ContactId','onDelete':_0xedac('0x108')});db[_0xedac('0x146')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':'List','foreignKey':_0xedac('0x15d'),'onDelete':_0xedac('0x108')});db[_0xedac('0x146')][_0xedac('0x117')](db[_0xedac('0x1a')],{'as':_0xedac('0x186'),'foreignKey':_0xedac('0x143'),'onDelete':_0xedac('0x108')});db[_0xedac('0x146')][_0xedac('0x117')](db[_0xedac('0xe2')],{'as':_0xedac('0xe2'),'foreignKey':_0xedac('0x190'),'onDelete':_0xedac('0x108')});db[_0xedac('0x192')][_0xedac('0x10a')](db[_0xedac('0x193')],{'as':{'plural':_0xedac('0x194'),'singular':'OneAll'},'foreignKey':_0xedac('0x195'),'onDelete':_0xedac('0x108'),'hooks':!![]});db[_0xedac('0x192')][_0xedac('0x10a')](db['Condition'],{'as':{'plural':_0xedac('0x196'),'singular':_0xedac('0x197')},'foreignKey':_0xedac('0x198'),'onDelete':_0xedac('0x108'),'hooks':!![]});db[_0xedac('0x192')][_0xedac('0x10a')](db[_0xedac('0x199')],{'as':_0xedac('0x19a'),'foreignKey':_0xedac('0x19b'),'onDelete':_0xedac('0x108'),'hooks':!![]});db['Disposition'][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':_0xedac('0x15b'),'foreignKey':_0xedac('0x19c'),'onDelete':_0xedac('0x108')});db[_0xedac('0x84')][_0xedac('0x10a')](db['Interval'],{'as':'Intervals','foreignKey':_0xedac('0x14b'),'onDelete':_0xedac('0x108'),'hooks':!![],'required':![]});db[_0xedac('0x84')][_0xedac('0x10a')](db[_0xedac('0x18')],{'as':_0xedac('0x10c'),'foreignKey':_0xedac('0x14b'),'onDelete':_0xedac('0x16c')});db[_0xedac('0x84')]['hasMany'](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xedac('0x14b')});db[_0xedac('0x84')][_0xedac('0x10a')](db['ChatApplication'],{'as':_0xedac('0x19d'),'foreignKey':_0xedac('0x14b')});db[_0xedac('0x84')][_0xedac('0x10a')](db[_0xedac('0x4f')],{'as':_0xedac('0x19e'),'foreignKey':_0xedac('0x14b')});db[_0xedac('0x84')][_0xedac('0x10a')](db[_0xedac('0x55')],{'as':_0xedac('0x19f'),'foreignKey':_0xedac('0x14b')});db[_0xedac('0x8c')]['belongsTo'](db[_0xedac('0x3f')],{});db['Schedule'][_0xedac('0x117')](db[_0xedac('0x9a')],{'foreignKey':_0xedac('0x1a0')});db[_0xedac('0x8c')]['belongsTo'](db[_0xedac('0x99')],{'foreignKey':_0xedac('0x1a1')});db[_0xedac('0x13f')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0xedac('0x1a2'),'through':_0xedac('0x141'),'onDelete':_0xedac('0x16c')});db[_0xedac('0x8f')][_0xedac('0x11a')](db[_0xedac('0x11c')],{'through':_0xedac('0x18e')});db[_0xedac('0x8f')][_0xedac('0x11a')](db[_0xedac('0x6c')],{'through':_0xedac('0x189')});db[_0xedac('0x8f')][_0xedac('0x11a')](db[_0xedac('0x42')],{'through':_0xedac('0x165')});db[_0xedac('0x8f')]['belongsToMany'](db[_0xedac('0x57')],{'through':_0xedac('0x17d')});db[_0xedac('0x8f')]['belongsToMany'](db[_0xedac('0x50')],{'through':_0xedac('0x175')});db[_0xedac('0x8f')]['belongsToMany'](db[_0xedac('0x60')],{'through':_0xedac('0x182')});db[_0xedac('0x8f')][_0xedac('0x11a')](db[_0xedac('0xfd')],{'through':_0xedac('0x1a3')});db[_0xedac('0x93')][_0xedac('0x10a')](db[_0xedac('0x193')],{'as':{'plural':_0xedac('0x1a4'),'singular':_0xedac('0x1a5')},'foreignKey':_0xedac('0x1a6'),'onDelete':_0xedac('0x108'),'hooks':!![]});db[_0xedac('0x93')]['hasMany'](db[_0xedac('0x193')],{'as':{'plural':_0xedac('0x1a7'),'singular':_0xedac('0x1a8')},'foreignKey':_0xedac('0x1a9'),'onDelete':_0xedac('0x108'),'hooks':!![]});db['Trigger'][_0xedac('0x10a')](db[_0xedac('0x199')],{'as':_0xedac('0x19a'),'foreignKey':_0xedac('0x1aa'),'onDelete':_0xedac('0x108'),'hooks':!![]});db[_0xedac('0x99')][_0xedac('0x10a')](db[_0xedac('0x9f')],{'as':'Fields','onDelete':_0xedac('0x108'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xedac('0x9a')][_0xedac('0x10a')](db[_0xedac('0x9f')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xedac('0x1ab')][_0xedac('0x10a')](db[_0xedac('0x9f')],{'as':'Fields','onDelete':_0xedac('0x108'),'foreignKey':'MetricId'});db[_0xedac('0x9f')][_0xedac('0x117')](db[_0xedac('0x1ab')],{'foreignKey':_0xedac('0x1ac')});db['SalesforceAccount'][_0xedac('0x10a')](db[_0xedac('0x1ad')],{'as':_0xedac('0x1ae'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0x1ad')][_0xedac('0x10a')](db[_0xedac('0xa5')],{'as':_0xedac('0x1b0'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0x1ad')][_0xedac('0x10a')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xedac('0x108'),'foreignKey':'DescriptionId'});db[_0xedac('0x1ad')][_0xedac('0x10a')](db['SalesforceField'],{'as':_0xedac('0x1b2'),'onDelete':_0xedac('0x108'),'foreignKey':'FieldId'});db[_0xedac('0x1ad')][_0xedac('0x117')](db[_0xedac('0xa3')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db['SalesforceField'][_0xedac('0x10a')](db[_0xedac('0xa5')],{'as':_0xedac('0x1b3'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0xa5')][_0xedac('0x10a')](db['SalesforceField'],{'as':'Description','foreignKey':_0xedac('0x1b4')});db[_0xedac('0xa5')][_0xedac('0x10a')](db[_0xedac('0xa5')],{'as':'Field','foreignKey':_0xedac('0x1b5')});db[_0xedac('0xa5')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':_0xedac('0x1b7')});db[_0xedac('0xa6')][_0xedac('0x10a')](db[_0xedac('0xa7')],{'as':'Configurations','onDelete':_0xedac('0x108'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xedac('0x10a')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0xa7')][_0xedac('0x10a')](db[_0xedac('0x1b8')],{'as':'Descriptions','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xa7')][_0xedac('0x10a')](db[_0xedac('0x1b8')],{'as':_0xedac('0x1b2'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xedac('0xa7')][_0xedac('0x117')](db['SugarcrmAccount'],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0x1b8')][_0xedac('0x10a')](db[_0xedac('0x1b8')],{'as':_0xedac('0x1b3'),'foreignKey':'SubjectId'});db[_0xedac('0x1b8')][_0xedac('0x10a')](db['SugarcrmField'],{'as':_0xedac('0x1b9'),'foreignKey':'DescriptionId'});db[_0xedac('0x1b8')][_0xedac('0x10a')](db['SugarcrmField'],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db[_0xedac('0x1b8')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':'Variable','foreignKey':_0xedac('0x1b7')});db['DeskAccount'][_0xedac('0x10a')](db[_0xedac('0x1bb')],{'as':_0xedac('0x1ae'),'onDelete':'cascade','foreignKey':_0xedac('0x1af')});db[_0xedac('0x1bb')][_0xedac('0x10a')](db[_0xedac('0xad')],{'as':_0xedac('0x1b0'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0x1bb')][_0xedac('0x10a')](db['DeskField'],{'as':_0xedac('0x1bc'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0x1bb')]['hasMany'](db[_0xedac('0xad')],{'as':_0xedac('0x1b2'),'onDelete':'cascade','foreignKey':_0xedac('0x1b5')});db[_0xedac('0x1bb')][_0xedac('0x117')](db[_0xedac('0xaa')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db['DeskConfiguration']['belongsToMany'](db[_0xedac('0x8f')],{'through':'int_desk_configuration_has_tags'});db[_0xedac('0xad')]['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':_0xedac('0x1b1')});db[_0xedac('0xad')][_0xedac('0x10a')](db[_0xedac('0xad')],{'as':_0xedac('0x1b9'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xad')][_0xedac('0x10a')](db[_0xedac('0xad')],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db[_0xedac('0xad')][_0xedac('0x117')](db['Variable'],{'as':'Variable','foreignKey':_0xedac('0x1b7')});db[_0xedac('0xae')][_0xedac('0x10a')](db['ZohoConfiguration'],{'as':_0xedac('0x1ae'),'onDelete':_0xedac('0x108'),'foreignKey':'AccountId'});db[_0xedac('0xaf')][_0xedac('0x10a')](db[_0xedac('0xb1')],{'as':_0xedac('0x1b0'),'onDelete':'cascade','foreignKey':_0xedac('0x1b1')});db[_0xedac('0xaf')][_0xedac('0x10a')](db[_0xedac('0xb1')],{'as':_0xedac('0x1bc'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xaf')][_0xedac('0x10a')](db['ZohoField'],{'as':'Fields','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b5')});db[_0xedac('0xaf')]['belongsTo'](db[_0xedac('0xae')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0xb1')][_0xedac('0x10a')](db[_0xedac('0xb1')],{'as':_0xedac('0x1b3'),'foreignKey':'SubjectId'});db[_0xedac('0xb1')][_0xedac('0x10a')](db[_0xedac('0xb1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xedac('0xb1')][_0xedac('0x10a')](db[_0xedac('0xb1')],{'as':_0xedac('0x1ba'),'foreignKey':'FieldId'});db[_0xedac('0xb1')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':'Variable','foreignKey':_0xedac('0x1b7')});db[_0xedac('0x1bd')][_0xedac('0x10a')](db[_0xedac('0xb4')],{'as':_0xedac('0x1ae'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xedac('0xb4')]['hasMany'](db[_0xedac('0xb6')],{'as':_0xedac('0x1b0'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0xb4')][_0xedac('0x10a')](db[_0xedac('0xb6')],{'as':_0xedac('0x1bc'),'foreignKey':'DescriptionId'});db[_0xedac('0xb4')][_0xedac('0x10a')](db[_0xedac('0xb6')],{'as':_0xedac('0x1b2'),'foreignKey':_0xedac('0x1b5')});db['ZendeskConfiguration'][_0xedac('0x117')](db[_0xedac('0x1bd')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0xb4')]['belongsToMany'](db['Tag'],{'through':_0xedac('0x1be')});db[_0xedac('0xb6')][_0xedac('0x10a')](db[_0xedac('0xb6')],{'as':_0xedac('0x1b3'),'foreignKey':'SubjectId'});db[_0xedac('0xb6')]['hasMany'](db[_0xedac('0xb6')],{'as':_0xedac('0x1b9'),'foreignKey':'DescriptionId'});db[_0xedac('0xb6')][_0xedac('0x10a')](db['ZendeskField'],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db[_0xedac('0xb6')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':_0xedac('0x1b7')});db[_0xedac('0xb7')]['hasMany'](db[_0xedac('0xb9')],{'as':_0xedac('0x1ae'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0xb9')]['hasMany'](db[_0xedac('0xbb')],{'as':_0xedac('0x1b0'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b1')});db[_0xedac('0xb9')]['hasMany'](db[_0xedac('0xbb')],{'as':_0xedac('0x1bc'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b4')});db['FreshdeskConfiguration'][_0xedac('0x10a')](db[_0xedac('0xbb')],{'as':_0xedac('0x1b2'),'onDelete':_0xedac('0x108'),'foreignKey':'FieldId'});db[_0xedac('0xb9')][_0xedac('0x117')](db['FreshdeskAccount'],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db['FreshdeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xedac('0x1bf')});db[_0xedac('0xbb')][_0xedac('0x10a')](db['FreshdeskField'],{'as':_0xedac('0x1b3'),'foreignKey':_0xedac('0x1b1')});db['FreshdeskField']['hasMany'](db[_0xedac('0xbb')],{'as':_0xedac('0x1b9'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xbb')][_0xedac('0x10a')](db[_0xedac('0xbb')],{'as':_0xedac('0x1ba'),'foreignKey':'FieldId'});db[_0xedac('0xbb')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':_0xedac('0x1b7')});db[_0xedac('0xbc')][_0xedac('0x10a')](db[_0xedac('0xbe')],{'as':'Configurations','onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1af')});db['VtigerConfiguration'][_0xedac('0x10a')](db[_0xedac('0xc0')],{'as':'Subjects','foreignKey':_0xedac('0x1b1')});db[_0xedac('0xbe')][_0xedac('0x10a')](db[_0xedac('0xc0')],{'as':_0xedac('0x1bc'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xbe')]['hasMany'](db[_0xedac('0xc0')],{'as':'Fields','foreignKey':_0xedac('0x1b5')});db['VtigerConfiguration']['belongsTo'](db[_0xedac('0xbc')],{'as':'Account','foreignKey':_0xedac('0x1af')});db[_0xedac('0xc0')][_0xedac('0x10a')](db[_0xedac('0xc0')],{'as':_0xedac('0x1b3'),'foreignKey':'SubjectId'});db[_0xedac('0xc0')]['hasMany'](db['VtigerField'],{'as':_0xedac('0x1b9'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xc0')][_0xedac('0x10a')](db[_0xedac('0xc0')],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db['VtigerField'][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':'VariableId'});db[_0xedac('0x1c0')]['hasMany'](db[_0xedac('0x1c1')],{'as':_0xedac('0x1ae'),'onDelete':'cascade','foreignKey':_0xedac('0x1af')});db[_0xedac('0x1c1')][_0xedac('0x10a')](db[_0xedac('0xc3')],{'as':_0xedac('0x1b0'),'foreignKey':'SubjectId'});db[_0xedac('0x1c1')][_0xedac('0x10a')](db['ServicenowField'],{'as':_0xedac('0x1bc'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0x1c1')][_0xedac('0x10a')](db[_0xedac('0xc3')],{'as':'Fields','foreignKey':_0xedac('0x1b5')});db[_0xedac('0x1c1')][_0xedac('0x117')](db['ServicenowAccount'],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0xc3')][_0xedac('0x10a')](db[_0xedac('0xc3')],{'as':'Subject','foreignKey':_0xedac('0x1b1')});db[_0xedac('0xc3')]['hasMany'](db[_0xedac('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db['ServicenowField'][_0xedac('0x10a')](db[_0xedac('0xc3')],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db['ServicenowField'][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':_0xedac('0x1b7')});db[_0xedac('0xc4')][_0xedac('0x10a')](db[_0xedac('0xc5')],{'as':_0xedac('0x1ae'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xedac('0xc5')][_0xedac('0x10a')](db[_0xedac('0xc6')],{'as':_0xedac('0x1b0'),'onDelete':_0xedac('0x108'),'foreignKey':'SubjectId'});db['Dynamics365Configuration']['hasMany'](db[_0xedac('0xc6')],{'as':_0xedac('0x1bc'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1b4')});db['Dynamics365Configuration'][_0xedac('0x10a')](db[_0xedac('0xc6')],{'as':_0xedac('0x1b2'),'onDelete':_0xedac('0x108'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xedac('0x117')](db[_0xedac('0xc4')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0xc6')]['hasMany'](db['Dynamics365Field'],{'as':_0xedac('0x1b3'),'foreignKey':'SubjectId'});db[_0xedac('0xc6')][_0xedac('0x10a')](db[_0xedac('0xc6')],{'as':_0xedac('0x1b9'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0xc6')][_0xedac('0x10a')](db[_0xedac('0xc6')],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db['Dynamics365Field'][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':'VariableId'});db[_0xedac('0x1c2')][_0xedac('0x10a')](db[_0xedac('0x1c3')],{'as':_0xedac('0x1ae'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1af')});db[_0xedac('0x1c3')][_0xedac('0x10a')](db['FreshsalesField'],{'as':_0xedac('0x1b0'),'foreignKey':_0xedac('0x1b1')});db['FreshsalesConfiguration'][_0xedac('0x10a')](db[_0xedac('0xca')],{'as':_0xedac('0x1bc'),'foreignKey':_0xedac('0x1b4')});db[_0xedac('0x1c3')][_0xedac('0x10a')](db['FreshsalesField'],{'as':_0xedac('0x1b2'),'foreignKey':'FieldId'});db[_0xedac('0x1c3')][_0xedac('0x117')](db['FreshsalesAccount'],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1af')});db['FreshsalesField'][_0xedac('0x10a')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xedac('0x1b1')});db['FreshsalesField'][_0xedac('0x10a')](db[_0xedac('0xca')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xedac('0xca')][_0xedac('0x10a')](db['FreshsalesField'],{'as':_0xedac('0x1ba'),'foreignKey':_0xedac('0x1b5')});db[_0xedac('0xca')][_0xedac('0x117')](db[_0xedac('0x1b6')],{'as':_0xedac('0x1b6'),'foreignKey':'VariableId'});db[_0xedac('0x1c4')][_0xedac('0x117')](db[_0xedac('0x66')],{});db['ChatQueueReport'][_0xedac('0x117')](db['CmList'],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d')});db['ChatQueueReport'][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':'ContactId'});db[_0xedac('0x1c4')][_0xedac('0x117')](db[_0xedac('0x6c')],{});db[_0xedac('0x1c4')][_0xedac('0x117')](db['ChatMessage'],{});db[_0xedac('0x1c4')][_0xedac('0x117')](db['User'],{});db[_0xedac('0x1c4')]['belongsTo'](db[_0xedac('0x70')],{});db['ChatInternalMessage']['belongsTo'](db[_0xedac('0x12')],{'onDelete':_0xedac('0x108'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xedac('0x117')](db[_0xedac('0x12')],{'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1c5')});db[_0xedac('0x147')][_0xedac('0x10a')](db['JscriptyQuestionReport'],{'foreignKey':_0xedac('0x1c6'),'onDelete':_0xedac('0x108')});db[_0xedac('0x147')]['hasMany'](db[_0xedac('0xcf')],{'foreignKey':_0xedac('0x1c6'),'onDelete':'cascade'});db[_0xedac('0xd3')]['belongsTo'](db[_0xedac('0x54')],{});db[_0xedac('0xd3')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':_0xedac('0x16e'),'foreignKey':_0xedac('0x15d')});db[_0xedac('0xd3')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db[_0xedac('0xd3')][_0xedac('0x117')](db[_0xedac('0x57')],{});db[_0xedac('0xd3')][_0xedac('0x117')](db[_0xedac('0x59')],{});db[_0xedac('0xd3')]['belongsTo'](db[_0xedac('0x12')],{});db[_0xedac('0xd3')][_0xedac('0x117')](db['SmsQueue'],{});db[_0xedac('0x1c7')][_0xedac('0x10a')](db[_0xedac('0x147')],{'foreignKey':_0xedac('0x1c8')});db[_0xedac('0x1c7')][_0xedac('0x10a')](db[_0xedac('0x1c9')],{'foreignKey':_0xedac('0x1c8')});db[_0xedac('0x1c7')]['hasMany'](db[_0xedac('0xcf')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':'Users','through':_0xedac('0x1ca')});db[_0xedac('0xde')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':_0xedac('0x121')});db[_0xedac('0xde')][_0xedac('0x11a')](db['VoiceQueue'],{'through':_0xedac('0x1cb'),'as':_0xedac('0x127')});db['Team']['belongsToMany'](db[_0xedac('0x40')],{'through':'team_has_mail_queues','as':_0xedac('0x128')});db[_0xedac('0xde')][_0xedac('0x11a')](db[_0xedac('0x70')],{'through':_0xedac('0x1cc'),'as':_0xedac('0x129')});db[_0xedac('0xde')][_0xedac('0x11a')](db[_0xedac('0x12b')],{'through':_0xedac('0x177'),'as':_0xedac('0x12c')});db[_0xedac('0xde')][_0xedac('0x11a')](db[_0xedac('0x5b')],{'through':_0xedac('0x1cd'),'as':_0xedac('0x12d')});db[_0xedac('0xde')][_0xedac('0x11a')](db['OpenchannelQueue'],{'through':_0xedac('0x183'),'as':_0xedac('0x12e')});db[_0xedac('0xde')]['belongsToMany'](db[_0xedac('0x12f')],{'through':_0xedac('0x1ce'),'as':_0xedac('0x130')});db[_0xedac('0xde')][_0xedac('0x11a')](db[_0xedac('0xf4')],{'through':_0xedac('0x1cf'),'as':_0xedac('0x1d0')});db[_0xedac('0xe2')][_0xedac('0x10a')](db[_0xedac('0x76')],{'as':_0xedac('0x144'),'foreignKey':_0xedac('0x190')});db[_0xedac('0xe2')]['hasMany'](db[_0xedac('0x79')],{'as':'HopperFinals','foreignKey':_0xedac('0x190')});db['Campaign'][_0xedac('0x10a')](db[_0xedac('0x7b')],{'as':_0xedac('0x145'),'foreignKey':_0xedac('0x190')});db[_0xedac('0xe2')][_0xedac('0x10a')](db['CmHopperBlack'],{'as':_0xedac('0x1d1'),'foreignKey':_0xedac('0x190')});db[_0xedac('0xe2')][_0xedac('0x117')](db['Trunk'],{'as':_0xedac('0x148'),'foreignKey':_0xedac('0x149')});db[_0xedac('0xe2')][_0xedac('0x117')](db[_0xedac('0x148')],{'as':'TrunkBackup','foreignKey':_0xedac('0x14a')});db['Campaign'][_0xedac('0x117')](db[_0xedac('0x84')],{'as':_0xedac('0x84'),'foreignKey':'IntervalId'});db[_0xedac('0xe2')][_0xedac('0x117')](db[_0xedac('0xdb')],{'as':_0xedac('0xdb'),'foreignKey':_0xedac('0x1d2')});db[_0xedac('0xe2')][_0xedac('0x11a')](db[_0xedac('0xf2')],{'as':_0xedac('0x11f'),'through':_0xedac('0x1d3')});db['Campaign'][_0xedac('0x11a')](db[_0xedac('0xf2')],{'as':_0xedac('0x1d4'),'through':_0xedac('0x1d5')});db[_0xedac('0xe6')][_0xedac('0x117')](db['ChatOfflineMessage'],{'as':_0xedac('0x6e'),'foreignKey':_0xedac('0x16b')});db[_0xedac('0xe9')]['belongsTo'](db[_0xedac('0x44')],{});db['MailTransferReport'][_0xedac('0x117')](db[_0xedac('0x42')],{});db[_0xedac('0xe9')][_0xedac('0x117')](db[_0xedac('0x3f')],{'foreignKey':_0xedac('0x1d6'),'as':_0xedac('0x1d7')});db[_0xedac('0xe9')][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1d8'),'as':_0xedac('0x1d9')});db['MailTransferReport'][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1da'),'as':_0xedac('0x1db')});db[_0xedac('0xe9')][_0xedac('0x117')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xedac('0x1dc')});db['MailTransferReport'][_0xedac('0x117')](db[_0xedac('0x3f')],{'foreignKey':_0xedac('0x1dd'),'as':_0xedac('0x1de')});db[_0xedac('0xeb')][_0xedac('0x117')](db[_0xedac('0x6d')],{});db[_0xedac('0xeb')][_0xedac('0x117')](db[_0xedac('0x6c')],{});db['ChatTransferReport'][_0xedac('0x117')](db[_0xedac('0x66')],{'foreignKey':'FromChatWebsiteId','as':_0xedac('0x1d7')});db[_0xedac('0xeb')][_0xedac('0x117')](db['User'],{'foreignKey':_0xedac('0x1d8'),'as':_0xedac('0x1d9')});db[_0xedac('0xeb')][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1da'),'as':'ToAgent'});db[_0xedac('0xeb')][_0xedac('0x117')](db['ChatQueue'],{'foreignKey':_0xedac('0x1df'),'as':_0xedac('0x1dc')});db[_0xedac('0xeb')][_0xedac('0x117')](db['ChatWebsite'],{'foreignKey':_0xedac('0x1e0'),'as':_0xedac('0x1de')});db[_0xedac('0xed')]['belongsTo'](db[_0xedac('0x173')],{});db[_0xedac('0xed')]['belongsTo'](db[_0xedac('0x50')],{});db[_0xedac('0xed')][_0xedac('0x117')](db['FaxAccount'],{'foreignKey':_0xedac('0x1e1'),'as':_0xedac('0x1d7')});db['FaxTransferReport']['belongsTo'](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1d8'),'as':'FromAgent'});db[_0xedac('0xed')][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':'ToUserId','as':_0xedac('0x1db')});db[_0xedac('0xed')][_0xedac('0x117')](db[_0xedac('0x12b')],{'foreignKey':_0xedac('0x1e2'),'as':'ToQueue'});db[_0xedac('0xed')][_0xedac('0x117')](db[_0xedac('0x4d')],{'foreignKey':_0xedac('0x1e3'),'as':_0xedac('0x1de')});db[_0xedac('0xee')][_0xedac('0x117')](db[_0xedac('0x62')],{});db[_0xedac('0xee')]['belongsTo'](db[_0xedac('0x60')],{});db[_0xedac('0xee')][_0xedac('0x117')](db[_0xedac('0x5d')],{'foreignKey':'FromOpenchannelAccountId','as':_0xedac('0x1d7')});db['OpenchannelTransferReport'][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':'FromUserId','as':_0xedac('0x1d9')});db[_0xedac('0xee')][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1da'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0xedac('0x117')](db[_0xedac('0x64')],{'foreignKey':_0xedac('0x1e4'),'as':_0xedac('0x1dc')});db[_0xedac('0xee')][_0xedac('0x117')](db[_0xedac('0x5d')],{'foreignKey':_0xedac('0x1e5'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0xedac('0x59')],{});db[_0xedac('0xf0')][_0xedac('0x117')](db[_0xedac('0x57')],{});db['SmsTransferReport']['belongsTo'](db[_0xedac('0x54')],{'foreignKey':_0xedac('0x1e6'),'as':_0xedac('0x1d7')});db['SmsTransferReport'][_0xedac('0x117')](db[_0xedac('0x12')],{'foreignKey':_0xedac('0x1d8'),'as':_0xedac('0x1d9')});db[_0xedac('0xf0')][_0xedac('0x117')](db['User'],{'foreignKey':_0xedac('0x1da'),'as':_0xedac('0x1db')});db[_0xedac('0xf0')][_0xedac('0x117')](db['SmsQueue'],{'foreignKey':_0xedac('0x1e7'),'as':_0xedac('0x1dc')});db[_0xedac('0xf0')][_0xedac('0x117')](db[_0xedac('0x54')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xedac('0xf2')][_0xedac('0x10a')](db[_0xedac('0x82')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xedac('0x108')});db[_0xedac('0xf2')][_0xedac('0x10a')](db[_0xedac('0x7d')],{'as':_0xedac('0x1e8'),'foreignKey':'ListId'});db[_0xedac('0xf2')]['hasMany'](db[_0xedac('0x11c')],{'as':_0xedac('0x11d'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x15d')});db['CmList'][_0xedac('0x10a')](db[_0xedac('0x79')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0xedac('0xf2')][_0xedac('0x10a')](db[_0xedac('0x7b')],{'as':_0xedac('0x10e'),'foreignKey':_0xedac('0x15d')});db['CmList'][_0xedac('0x10a')](db[_0xedac('0x10f')],{'as':_0xedac('0x10f'),'foreignKey':'ListId'});db[_0xedac('0xf2')][_0xedac('0x11a')](db[_0xedac('0x1a')],{'as':_0xedac('0x1e9'),'through':_0xedac('0x14d')});db[_0xedac('0xf2')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x14e'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xedac('0x10a')](db[_0xedac('0x18')],{'as':'Extensions','onDelete':'cascade'});db[_0xedac('0xf4')]['belongsToMany'](db[_0xedac('0x12')],{'as':'Agents','through':_0xedac('0x107')});db[_0xedac('0xf4')]['belongsToMany'](db[_0xedac('0xde')],{'through':_0xedac('0x1cf'),'as':_0xedac('0x160')});db[_0xedac('0x118')][_0xedac('0x10a')](db[_0xedac('0x12')],{'as':'Users','foreignKey':_0xedac('0x119')});db[_0xedac('0x118')]['hasMany'](db[_0xedac('0xf6')],{'as':_0xedac('0x1ea'),'foreignKey':_0xedac('0x119'),'onDelete':_0xedac('0x108')});db['UserProfileSection'][_0xedac('0x10a')](db['UserProfileResource'],{'as':_0xedac('0x1eb'),'foreignKey':_0xedac('0x1ec'),'onDelete':_0xedac('0x108')});db[_0xedac('0xfb')][_0xedac('0x10a')](db['Disposition'],{'as':_0xedac('0x15b'),'foreignKey':_0xedac('0x1ed'),'onDelete':_0xedac('0x108')});db[_0xedac('0xfb')]['hasMany'](db[_0xedac('0x80')],{'as':'Answers','foreignKey':_0xedac('0x1ed')});db[_0xedac('0xfb')][_0xedac('0x10a')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xedac('0x1ed')});db[_0xedac('0xfb')][_0xedac('0x10a')](db[_0xedac('0xfd')],{'as':_0xedac('0x171')});db[_0xedac('0xfb')][_0xedac('0x10a')](db[_0xedac('0x1ee')],{'as':_0xedac('0x13d')});db['WhatsappAccount']['belongsTo'](db[_0xedac('0xf2')],{'as':'List','foreignKey':_0xedac('0x15d')});db['WhatsappAccount']['belongsTo'](db['Pause'],{'as':_0xedac('0x14c'),'foreignKey':_0xedac('0x17a')});db[_0xedac('0xfb')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x14e'),'through':_0xedac('0x139')});db['WhatsappApplication'][_0xedac('0x117')](db['User'],{'onDelete':_0xedac('0x16c')});db['WhatsappApplication'][_0xedac('0x117')](db['WhatsappQueue'],{'onDelete':_0xedac('0x16c')});db[_0xedac('0x1ee')][_0xedac('0x117')](db[_0xedac('0xfb')],{'onDelete':_0xedac('0x16c')});db['WhatsappApplication'][_0xedac('0x117')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xedac('0x14b')});db['WhatsappApplication'][_0xedac('0x117')](db[_0xedac('0x8f')],{'onDelete':_0xedac('0x16c'),'foreignKey':'TagId'});db[_0xedac('0xfd')][_0xedac('0x10a')](db[_0xedac('0x1ef')],{'as':_0xedac('0x161'),'onDelete':_0xedac('0x108'),'foreignKey':_0xedac('0x1f0')});db[_0xedac('0xfd')][_0xedac('0x117')](db[_0xedac('0xfb')],{'as':_0xedac('0x163'),'foreignKey':_0xedac('0x1ed')});db[_0xedac('0xfd')][_0xedac('0x117')](db[_0xedac('0x11c')],{'as':'Contact','foreignKey':_0xedac('0x157')});db['WhatsappInteraction'][_0xedac('0x117')](db[_0xedac('0x12')],{'as':_0xedac('0x17c'),'foreignKey':_0xedac('0x109')});db[_0xedac('0xfd')][_0xedac('0x11a')](db['Tag'],{'through':_0xedac('0x1a3'),'as':_0xedac('0x164')});db[_0xedac('0xfd')]['belongsToMany'](db[_0xedac('0x8f')],{'through':_0xedac('0x1a3'),'as':_0xedac('0x166')});db[_0xedac('0xfd')][_0xedac('0x11a')](db[_0xedac('0x12')],{'as':_0xedac('0x167'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xedac('0x1ef')][_0xedac('0x117')](db['User'],{'as':_0xedac('0x12')});db[_0xedac('0x1ef')][_0xedac('0x117')](db[_0xedac('0x11c')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x156')});db['WhatsappMessage'][_0xedac('0x117')](db[_0xedac('0xfd')],{'onDelete':_0xedac('0x108'),'as':_0xedac('0x169'),'foreignKey':_0xedac('0x1f0')});db[_0xedac('0x1ef')][_0xedac('0x117')](db[_0xedac('0xfb')],{'as':'Account','foreignKey':_0xedac('0x1ed')});db['WhatsappQueueReport'][_0xedac('0x117')](db[_0xedac('0xfb')],{});db[_0xedac('0x100')][_0xedac('0x117')](db[_0xedac('0xf2')],{'as':'List','foreignKey':_0xedac('0x15d')});db[_0xedac('0x100')]['belongsTo'](db[_0xedac('0x11c')],{'as':_0xedac('0x156'),'foreignKey':_0xedac('0x157')});db['WhatsappQueueReport'][_0xedac('0x117')](db[_0xedac('0xfd')],{});db[_0xedac('0x100')]['belongsTo'](db[_0xedac('0x12f')],{});db[_0xedac('0x100')][_0xedac('0x117')](db['WhatsappMessage'],{});db[_0xedac('0x100')]['belongsTo'](db['User'],{});db[_0xedac('0x1f1')][_0xedac('0x117')](db[_0xedac('0x1ef')],{});db['WhatsappTransferReport'][_0xedac('0x117')](db['WhatsappInteraction'],{});db[_0xedac('0x1f1')]['belongsTo'](db[_0xedac('0xfb')],{'foreignKey':_0xedac('0x1f2'),'as':_0xedac('0x1d7')});db[_0xedac('0x1f1')]['belongsTo'](db[_0xedac('0xfb')],{'foreignKey':_0xedac('0x1f3'),'as':'ToAccount'});db[_0xedac('0x1f1')][_0xedac('0x117')](db[_0xedac('0x12f')],{'foreignKey':_0xedac('0x1f4'),'as':_0xedac('0x1dc')});db[_0xedac('0x1f1')]['belongsTo'](db['User'],{'foreignKey':_0xedac('0x1d8'),'as':_0xedac('0x1d9')});db[_0xedac('0x1f1')][_0xedac('0x117')](db['User'],{'foreignKey':_0xedac('0x1da'),'as':_0xedac('0x1db')});db[_0xedac('0x12f')][_0xedac('0x11a')](db['User'],{'as':_0xedac('0x14e'),'through':_0xedac('0x39'),'foreignKey':_0xedac('0x1f5')});db[_0xedac('0x12f')][_0xedac('0x11a')](db['Team'],{'through':_0xedac('0x1ce'),'as':_0xedac('0x160')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0xcba291,_0x10e9d5){var _0x162274=function(_0x38100e){while(--_0x38100e){_0xcba291['push'](_0xcba291['shift']());}};_0x162274(++_0x10e9d5);}(_0xa75b,0x170));var _0xba75=function(_0x145f49,_0x49f2e9){_0x145f49=_0x145f49-0x0;var _0x9b7a51=_0xa75b[_0x145f49];return _0x9b7a51;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index aa40ba2..43a617e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f0=['./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','secretaccesskey','key','pass','accountSid','dsn','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','lodash','express','util','./errors','./config/environment','api','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','connection','url','statusCode','responseTime','user','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','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)','x-forwarded-for','name','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport'];(function(_0x2418bd,_0x1ddd5){var _0x12d19c=function(_0x3fc285){while(--_0x3fc285){_0x2418bd['push'](_0x2418bd['shift']());}};_0x12d19c(++_0x1ddd5);}(_0xd4f0,0xa8));var _0x0d4f=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd4f0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0d4f('0x0'));var path=require('path');var express=require(_0x0d4f('0x1'));var ewinston=require('express-winston');var util=require(_0x0d4f('0x2'));var errors=require(_0x0d4f('0x3'));var config=require(_0x0d4f('0x4'));var logger=require('./config/logger')(_0x0d4f('0x5'));var authLogger=require('./config/logger')('auth');var safeTemplate=require('./safe-template')['safeTemplate'];exports['default']=function(_0x598cba){_0x598cba[_0x0d4f('0x6')](ewinston[_0x0d4f('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x52d2c1,_0x37dce0){var _0x511bc4=_0x0d4f('0x8');if(!_[_0x0d4f('0x9')](_0x52d2c1['body'])){_0x511bc4+=_0x0d4f('0xa');var _0x28c1c9=_0x52d2c1[_0x0d4f('0xb')];maskSensitiveData(_0x28c1c9);}return safeTemplate(util[_0x0d4f('0xc')](_0x511bc4,_0x52d2c1[_0x0d4f('0xd')],_0x52d2c1[_0x0d4f('0xe')]['x-forwarded-for']?_0x52d2c1[_0x0d4f('0xe')]['x-forwarded-for']:_0x52d2c1[_0x0d4f('0xf')]['remoteAddress']||_0x52d2c1['ip'],_0x52d2c1[_0x0d4f('0x10')],_0x37dce0[_0x0d4f('0x11')],_0x37dce0[_0x0d4f('0x12')],_0x52d2c1[_0x0d4f('0x13')]?_0x52d2c1[_0x0d4f('0x13')]['id']:null,_0x52d2c1[_0x0d4f('0x13')]?_0x52d2c1[_0x0d4f('0x13')]['name']:null,_0x52d2c1[_0x0d4f('0x13')]?_0x52d2c1[_0x0d4f('0x13')]['role']:null,_0x28c1c9?util[_0x0d4f('0x14')](_0x28c1c9,![],null):''));}}));_0x598cba[_0x0d4f('0x6')](ewinston[_0x0d4f('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x984c9e,_0x5ec31a){var _0x27e1ad=_0x0d4f('0x15');if(_0x984c9e[_0x0d4f('0xb')]&&_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x16')]&&_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x17')]){_0x27e1ad=_0x0d4f('0x18');}return util['format'](_0x27e1ad,_0x984c9e[_0x0d4f('0xd')],_0x984c9e[_0x0d4f('0xe')]['x-forwarded-for']?_0x984c9e[_0x0d4f('0xe')][_0x0d4f('0x19')]:_0x984c9e['connection']['remoteAddress']||_0x984c9e['ip'],_0x984c9e[_0x0d4f('0x10')],_0x5ec31a['statusCode'],_0x5ec31a[_0x0d4f('0x12')],_0x984c9e['user']?_0x984c9e[_0x0d4f('0x13')]['id']:null,_0x984c9e[_0x0d4f('0x13')]?_0x984c9e['user'][_0x0d4f('0x1a')]:null,_0x984c9e['user']?_0x984c9e[_0x0d4f('0x13')]['role']:null,_0x984c9e[_0x0d4f('0xb')]&&_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x16')]?_0x984c9e[_0x0d4f('0xb')]['device']:_0x0d4f('0x1b'),_0x984c9e['body']&&_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x17')]?_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x17')]:'',_0x984c9e[_0x0d4f('0xb')]&&_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x1c')]?_0x984c9e[_0x0d4f('0xb')][_0x0d4f('0x1c')]:'');},'ignoreRoute':function(_0x76a648){var _0x3a5cc6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3a5cc6[_0x0d4f('0x1d')](_0x76a648[_0x0d4f('0x10')]);}}));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x1e'),require(_0x0d4f('0x1f')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x20'),require(_0x0d4f('0x21')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x22'),require('./api/voiceContext'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x23'),require(_0x0d4f('0x24')));_0x598cba['use'](_0x0d4f('0x25'),require(_0x0d4f('0x26')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x27'),require(_0x0d4f('0x28')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x29'),require(_0x0d4f('0x2a')));_0x598cba['use'](_0x0d4f('0x2b'),require(_0x0d4f('0x2c')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x2d'),require('./api/voiceMail'));_0x598cba[_0x0d4f('0x6')]('/api/voice/mails/messages',require(_0x0d4f('0x2e')));_0x598cba[_0x0d4f('0x6')]('/api/voice/calls/reports',require(_0x0d4f('0x2f')));_0x598cba['use'](_0x0d4f('0x30'),require(_0x0d4f('0x31')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x32'),require('./api/voiceAgentReport'));_0x598cba['use'](_0x0d4f('0x33'),require('./api/voiceQueueReport'));_0x598cba['use'](_0x0d4f('0x34'),require(_0x0d4f('0x35')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x36'),require(_0x0d4f('0x37')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x38'),require(_0x0d4f('0x39')));_0x598cba['use'](_0x0d4f('0x3a'),require('./api/mailServerOut'));_0x598cba[_0x0d4f('0x6')]('/api/mail/accounts',require('./api/mailAccount'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x3b'),require('./api/mailQueue'));_0x598cba['use'](_0x0d4f('0x3c'),require('./api/mailSubstatus'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x3d'),require('./api/mailInteraction'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x3e'),require(_0x0d4f('0x3f')));_0x598cba['use']('/api/mail/applications',require('./api/mailApplication'));_0x598cba['use']('/api/mail/reports/queue',require(_0x0d4f('0x40')));_0x598cba['use'](_0x0d4f('0x41'),require(_0x0d4f('0x42')));_0x598cba['use'](_0x0d4f('0x43'),require(_0x0d4f('0x44')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x45'),require(_0x0d4f('0x46')));_0x598cba[_0x0d4f('0x6')]('/api/fax/applications',require(_0x0d4f('0x47')));_0x598cba['use'](_0x0d4f('0x48'),require(_0x0d4f('0x49')));_0x598cba[_0x0d4f('0x6')]('/api/fax/messages',require(_0x0d4f('0x4a')));_0x598cba[_0x0d4f('0x6')]('/api/fax/queues',require(_0x0d4f('0x4b')));_0x598cba['use'](_0x0d4f('0x4c'),require('./api/faxQueueReport'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x4d'),require(_0x0d4f('0x4e')));_0x598cba['use'](_0x0d4f('0x4f'),require(_0x0d4f('0x50')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x51'),require(_0x0d4f('0x52')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x53'),require(_0x0d4f('0x54')));_0x598cba['use'](_0x0d4f('0x55'),require('./api/smsQueue'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x56'),require(_0x0d4f('0x57')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x58'),require(_0x0d4f('0x59')));_0x598cba[_0x0d4f('0x6')]('/api/openchannel/interactions',require(_0x0d4f('0x5a')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x5b'),require(_0x0d4f('0x5c')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x5d'),require(_0x0d4f('0x5e')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x5f'),require(_0x0d4f('0x60')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x61'),require(_0x0d4f('0x62')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x63'),require(_0x0d4f('0x64')));_0x598cba[_0x0d4f('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x65'),require(_0x0d4f('0x66')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x67'),require(_0x0d4f('0x68')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x69'),require(_0x0d4f('0x6a')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x6b'),require(_0x0d4f('0x6c')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x6d'),require(_0x0d4f('0x6e')));_0x598cba['use'](_0x0d4f('0x6f'),require('./api/cmCompany'));_0x598cba[_0x0d4f('0x6')]('/api/cm/contacts',require(_0x0d4f('0x70')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x71'),require(_0x0d4f('0x72')));_0x598cba['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x73'),require(_0x0d4f('0x74')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x75'),require(_0x0d4f('0x76')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x77'),require(_0x0d4f('0x78')));_0x598cba[_0x0d4f('0x6')]('/api/actions',require(_0x0d4f('0x79')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x7a'),require(_0x0d4f('0x7b')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x7c'),require(_0x0d4f('0x7d')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x7e'),require(_0x0d4f('0x7f')));_0x598cba['use'](_0x0d4f('0x80'),require('./api/condition'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x81'),require(_0x0d4f('0x82')));_0x598cba[_0x0d4f('0x6')]('/api/pauses',require(_0x0d4f('0x83')));_0x598cba['use'](_0x0d4f('0x84'),require('./api/cdr'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x85'),require('./api/voiceQueuesLog'));_0x598cba[_0x0d4f('0x6')]('/api/schedules',require(_0x0d4f('0x86')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x87'),require(_0x0d4f('0x88')));_0x598cba['use'](_0x0d4f('0x89'),require(_0x0d4f('0x8a')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x8b'),require(_0x0d4f('0x8c')));_0x598cba[_0x0d4f('0x6')]('/api/triggers',require(_0x0d4f('0x8d')));_0x598cba[_0x0d4f('0x6')]('/api/variables',require(_0x0d4f('0x8e')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x8f'),require(_0x0d4f('0x90')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x91'),require(_0x0d4f('0x92')));_0x598cba[_0x0d4f('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x598cba['use'](_0x0d4f('0x93'),require(_0x0d4f('0x94')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x95'),require(_0x0d4f('0x96')));_0x598cba['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x97'),require(_0x0d4f('0x98')));_0x598cba[_0x0d4f('0x6')]('/api/analytics/tree_reports',require(_0x0d4f('0x99')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x9a'),require(_0x0d4f('0x9b')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x9c'),require('./api/intSalesforceConfiguration'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x9d'),require(_0x0d4f('0x9e')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x0d4f('0x9f')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xa0'),require(_0x0d4f('0xa1')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xa2'),require(_0x0d4f('0xa3')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/desk/accounts',require(_0x0d4f('0xa4')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xa5'),require('./api/intDeskConfiguration'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xa6'),require(_0x0d4f('0xa7')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xa8'),require(_0x0d4f('0xa9')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xaa'),require('./api/intZohoConfiguration'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xab'),require(_0x0d4f('0xac')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xad'),require(_0x0d4f('0xae')));_0x598cba['use']('/api/integrations/zendesk/configurations',require(_0x0d4f('0xaf')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xb0'),require(_0x0d4f('0xb1')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xb2'),require(_0x0d4f('0xb3')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/freshdesk/configurations',require(_0x0d4f('0xb4')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xb5'),require('./api/intFreshdeskField'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xb6'),require(_0x0d4f('0xb7')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x598cba['use'](_0x0d4f('0xb8'),require(_0x0d4f('0xb9')));_0x598cba['use'](_0x0d4f('0xba'),require(_0x0d4f('0xbb')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/servicenow/configurations',require(_0x0d4f('0xbc')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/servicenow/fields',require(_0x0d4f('0xbd')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/dynamics365/accounts',require(_0x0d4f('0xbe')));_0x598cba[_0x0d4f('0x6')]('/api/integrations/dynamics365/configurations',require(_0x0d4f('0xbf')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xc0'),require(_0x0d4f('0xc1')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xc2'),require('./api/intFreshsalesAccount'));_0x598cba['use'](_0x0d4f('0xc3'),require(_0x0d4f('0xc4')));_0x598cba['use'](_0x0d4f('0xc5'),require('./api/intFreshsalesField'));_0x598cba['use'](_0x0d4f('0xc6'),require('./api/network'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xc7'),require('./api/chatQueueReport'));_0x598cba[_0x0d4f('0x6')]('/api/chat/internal/messages',require(_0x0d4f('0xc8')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xc9'),require(_0x0d4f('0xca')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xcb'),require(_0x0d4f('0xcc')));_0x598cba[_0x0d4f('0x6')]('/api/jscripty/sessions/reports',require(_0x0d4f('0xcd')));_0x598cba[_0x0d4f('0x6')]('/api/sms/reports/queue',require(_0x0d4f('0xce')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xcf'),require(_0x0d4f('0xd0')));_0x598cba['use']('/api/square/details/reports',require(_0x0d4f('0xd1')));_0x598cba['use'](_0x0d4f('0xd2'),require(_0x0d4f('0xd3')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xd4'),require(_0x0d4f('0xd5')));_0x598cba[_0x0d4f('0x6')]('/api/square/odbc',require('./api/squareOdbc'));_0x598cba[_0x0d4f('0x6')]('/api/square/projects',require('./api/squareProject'));_0x598cba[_0x0d4f('0x6')]('/api/square/recordings',require('./api/squareRecording'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xd6'),require('./api/squareMessage'));_0x598cba['use'](_0x0d4f('0xd7'),require('./api/team'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xd8'),require(_0x0d4f('0xd9')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xda'),require(_0x0d4f('0xdb')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xdc'),require('./api/migration'));_0x598cba[_0x0d4f('0x6')]('/api/attachments',require(_0x0d4f('0xdd')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xde'),require(_0x0d4f('0xdf')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xe0'),require(_0x0d4f('0xe1')));_0x598cba['use'](_0x0d4f('0xe2'),require(_0x0d4f('0xe3')));_0x598cba['use'](_0x0d4f('0xe4'),require(_0x0d4f('0xe5')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xe6'),require(_0x0d4f('0xe7')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xe8'),require('./api/smsTransferReport'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xe9'),require('./api/cmList'));_0x598cba['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xea'),require(_0x0d4f('0xeb')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xec'),require(_0x0d4f('0xed')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xee'),require(_0x0d4f('0xef')));_0x598cba['use'](_0x0d4f('0xf0'),require(_0x0d4f('0xf1')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xf2'),require(_0x0d4f('0xf3')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xf4'),require(_0x0d4f('0xf5')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xf6'),require('./api/whatsappInteraction'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xf7'),require(_0x0d4f('0xf8')));_0x598cba[_0x0d4f('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x598cba[_0x0d4f('0x6')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x598cba['use'](_0x0d4f('0xf9'),require(_0x0d4f('0xfa')));_0x598cba[_0x0d4f('0x6')]('/api/cloudProviders',require(_0x0d4f('0xfb')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xfc'),require('./api/realtime'));_0x598cba[_0x0d4f('0x6')]('/api/auth/local',require(_0x0d4f('0xfd')));_0x598cba['use']('/api/auth/google',require(_0x0d4f('0xfe')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0xff'),require(_0x0d4f('0x100')));_0x598cba['use'](_0x0d4f('0x101'),require(_0x0d4f('0x102')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x103'),require('./api/version'));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x104'),require(_0x0d4f('0x105')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x106'),require(_0x0d4f('0x107')));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x108'),require('./api/webbar'));_0x598cba['use']('/apidoc',express[_0x0d4f('0x109')](path['join'](config['root'],'/apidoc')));_0x598cba[_0x0d4f('0x6')]('/www',express['static'](path[_0x0d4f('0x10a')](config[_0x0d4f('0x10b')],_0x0d4f('0x10c'))));_0x598cba['use'](_0x0d4f('0x10d'),express[_0x0d4f('0x109')](path[_0x0d4f('0x10a')](config['root'],_0x0d4f('0x10d'))));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x10e'),express[_0x0d4f('0x109')](path[_0x0d4f('0x10a')](config[_0x0d4f('0x10b')],_0x0d4f('0x10f'),_0x0d4f('0x110'))));_0x598cba[_0x0d4f('0x6')](_0x0d4f('0x111'),express[_0x0d4f('0x109')](path[_0x0d4f('0x10a')](config['root'],_0x0d4f('0x112'))));_0x598cba[_0x0d4f('0x113')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0d4f('0x114')](errors[0x194]);_0x598cba['route']('/*')[_0x0d4f('0x114')](function(_0x45b5ed,_0x5daf01){_0x5daf01[_0x0d4f('0x115')](path[_0x0d4f('0x116')](_0x598cba[_0x0d4f('0x114')](_0x0d4f('0x117'))+_0x0d4f('0x118')));});};var sensitiveFields=[_0x0d4f('0x119'),_0x0d4f('0x11a'),_0x0d4f('0x11b'),_0x0d4f('0x11c'),_0x0d4f('0x11d'),_0x0d4f('0x11e'),_0x0d4f('0x11f'),_0x0d4f('0x120'),_0x0d4f('0x121'),'fax',_0x0d4f('0x122'),_0x0d4f('0x123'),_0x0d4f('0x124'),_0x0d4f('0x125'),'code',_0x0d4f('0x126'),_0x0d4f('0x127'),_0x0d4f('0x128'),_0x0d4f('0x129'),_0x0d4f('0x12a'),'accessTokenSecret',_0x0d4f('0x12b'),_0x0d4f('0x12c'),'consumerSecret',_0x0d4f('0x12d'),_0x0d4f('0x12e'),_0x0d4f('0x12f'),_0x0d4f('0x130'),_0x0d4f('0x131'),_0x0d4f('0x132'),'privateKey','accesskeyid',_0x0d4f('0x133'),_0x0d4f('0x134'),_0x0d4f('0x13'),_0x0d4f('0x135'),_0x0d4f('0x136'),'localstationid',_0x0d4f('0x137'),'secret','registry',_0x0d4f('0x138')];function maskSensitiveData(_0x271de8){var _0x23db00=/(?!^)[\s\S](?!$)/g;if(!_[_0x0d4f('0x139')](_0x271de8))return;for(var _0x45cabe in _0x271de8){if(_[_0x0d4f('0x13a')](_0x271de8[_0x45cabe])){for(var _0x5d667f=0x0;_0x5d667f<_0x271de8[_0x45cabe][_0x0d4f('0x13b')];_0x5d667f++){maskSensitiveData(_0x271de8[_0x45cabe][_0x5d667f]);}}else if(_[_0x0d4f('0x139')](_0x271de8[_0x45cabe])){maskSensitiveData(_0x271de8[_0x45cabe]);}else if(_[_0x0d4f('0x13c')](_0x271de8[_0x45cabe])){_0x271de8[_0x45cabe]=_0x271de8[_0x45cabe]['replace'](/{{{/g,_0x0d4f('0x13d'))[_0x0d4f('0x13e')](/}}}/g,_0x0d4f('0x13f'))[_0x0d4f('0x13e')](/{{/g,'@{')[_0x0d4f('0x13e')](/}}/g,'}@');if(_[_0x0d4f('0x140')](sensitiveFields,_0x45cabe)){_0x271de8[_0x45cabe]=_0x271de8[_0x45cabe]['replace'](_0x23db00,'*');}}}} \ No newline at end of file +var _0x7573=['./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','username','password','newPassword','apiKey','lastName','street','phone','fax','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','./safe-template','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','statusCode','responseTime','user','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','url','name','role','agent_id','agent_name','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','/api/variables','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./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/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects'];(function(_0x82269b,_0x5c0d57){var _0x312a18=function(_0x292cc1){while(--_0x292cc1){_0x82269b['push'](_0x82269b['shift']());}};_0x312a18(++_0x5c0d57);}(_0x7573,0x72));var _0x3757=function(_0x4c69d1,_0x7fcd8){_0x4c69d1=_0x4c69d1-0x0;var _0x470fc4=_0x7573[_0x4c69d1];return _0x470fc4;};'use strict';var _=require(_0x3757('0x0'));var path=require(_0x3757('0x1'));var express=require(_0x3757('0x2'));var ewinston=require(_0x3757('0x3'));var util=require(_0x3757('0x4'));var errors=require(_0x3757('0x5'));var config=require(_0x3757('0x6'));var logger=require(_0x3757('0x7'))(_0x3757('0x8'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0x3757('0x9'))['safeTemplate'];exports[_0x3757('0xa')]=function(_0x5b1212){_0x5b1212[_0x3757('0xb')](ewinston[_0x3757('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xdd275a,_0x2ce77b){var _0xd1a9c5=_0x3757('0xd');if(!_[_0x3757('0xe')](_0xdd275a[_0x3757('0xf')])){_0xd1a9c5+=_0x3757('0x10');var _0xd139da=_0xdd275a[_0x3757('0xf')];maskSensitiveData(_0xd139da);}return safeTemplate(util[_0x3757('0x11')](_0xd1a9c5,_0xdd275a[_0x3757('0x12')],_0xdd275a[_0x3757('0x13')][_0x3757('0x14')]?_0xdd275a[_0x3757('0x13')][_0x3757('0x14')]:_0xdd275a['connection'][_0x3757('0x15')]||_0xdd275a['ip'],_0xdd275a['url'],_0x2ce77b[_0x3757('0x16')],_0x2ce77b[_0x3757('0x17')],_0xdd275a[_0x3757('0x18')]?_0xdd275a[_0x3757('0x18')]['id']:null,_0xdd275a[_0x3757('0x18')]?_0xdd275a['user']['name']:null,_0xdd275a[_0x3757('0x18')]?_0xdd275a[_0x3757('0x18')]['role']:null,_0xd139da?util['inspect'](_0xd139da,![],null):''));}}));_0x5b1212['use'](ewinston[_0x3757('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5b62e7,_0x100283){var _0x56053a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5b62e7['body']&&_0x5b62e7[_0x3757('0xf')][_0x3757('0x19')]&&_0x5b62e7['body']['agent_id']){_0x56053a=_0x3757('0x1a');}return util[_0x3757('0x11')](_0x56053a,_0x5b62e7[_0x3757('0x12')],_0x5b62e7[_0x3757('0x13')][_0x3757('0x14')]?_0x5b62e7[_0x3757('0x13')][_0x3757('0x14')]:_0x5b62e7[_0x3757('0x1b')]['remoteAddress']||_0x5b62e7['ip'],_0x5b62e7[_0x3757('0x1c')],_0x100283[_0x3757('0x16')],_0x100283[_0x3757('0x17')],_0x5b62e7[_0x3757('0x18')]?_0x5b62e7[_0x3757('0x18')]['id']:null,_0x5b62e7[_0x3757('0x18')]?_0x5b62e7[_0x3757('0x18')][_0x3757('0x1d')]:null,_0x5b62e7['user']?_0x5b62e7['user'][_0x3757('0x1e')]:null,_0x5b62e7['body']&&_0x5b62e7['body'][_0x3757('0x19')]?_0x5b62e7['body'][_0x3757('0x19')]:'other',_0x5b62e7[_0x3757('0xf')]&&_0x5b62e7['body'][_0x3757('0x1f')]?_0x5b62e7[_0x3757('0xf')][_0x3757('0x1f')]:'',_0x5b62e7[_0x3757('0xf')]&&_0x5b62e7['body'][_0x3757('0x20')]?_0x5b62e7[_0x3757('0xf')][_0x3757('0x20')]:'');},'ignoreRoute':function(_0x57d841){var _0x3912f4=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3912f4['test'](_0x57d841['url']);}}));_0x5b1212[_0x3757('0xb')](_0x3757('0x21'),require('./api/user'));_0x5b1212[_0x3757('0xb')]('/api/voice/chanspy',require(_0x3757('0x22')));_0x5b1212[_0x3757('0xb')](_0x3757('0x23'),require(_0x3757('0x24')));_0x5b1212['use'](_0x3757('0x25'),require(_0x3757('0x26')));_0x5b1212[_0x3757('0xb')]('/api/voice/mohs',require(_0x3757('0x27')));_0x5b1212[_0x3757('0xb')]('/api/voice/queues',require(_0x3757('0x28')));_0x5b1212['use'](_0x3757('0x29'),require(_0x3757('0x2a')));_0x5b1212[_0x3757('0xb')](_0x3757('0x2b'),require('./api/screenRecording'));_0x5b1212[_0x3757('0xb')](_0x3757('0x2c'),require(_0x3757('0x2d')));_0x5b1212['use'](_0x3757('0x2e'),require('./api/voiceMailMessage'));_0x5b1212[_0x3757('0xb')]('/api/voice/calls/reports',require(_0x3757('0x2f')));_0x5b1212['use'](_0x3757('0x30'),require('./api/voiceDialReport'));_0x5b1212[_0x3757('0xb')]('/api/voice/agents/reports',require(_0x3757('0x31')));_0x5b1212[_0x3757('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x5b1212['use']('/api/members/reports',require(_0x3757('0x32')));_0x5b1212[_0x3757('0xb')](_0x3757('0x33'),require(_0x3757('0x34')));_0x5b1212[_0x3757('0xb')](_0x3757('0x35'),require(_0x3757('0x36')));_0x5b1212[_0x3757('0xb')](_0x3757('0x37'),require(_0x3757('0x38')));_0x5b1212[_0x3757('0xb')](_0x3757('0x39'),require('./api/mailAccount'));_0x5b1212['use'](_0x3757('0x3a'),require('./api/mailQueue'));_0x5b1212[_0x3757('0xb')]('/api/mail/substatuses',require(_0x3757('0x3b')));_0x5b1212['use'](_0x3757('0x3c'),require(_0x3757('0x3d')));_0x5b1212[_0x3757('0xb')]('/api/mail/messages',require(_0x3757('0x3e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x3f'),require(_0x3757('0x40')));_0x5b1212['use'](_0x3757('0x41'),require('./api/mailQueueReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x42'),require('./api/dashboard'));_0x5b1212[_0x3757('0xb')](_0x3757('0x43'),require(_0x3757('0x44')));_0x5b1212[_0x3757('0xb')]('/api/fax/accounts',require(_0x3757('0x45')));_0x5b1212['use'](_0x3757('0x46'),require(_0x3757('0x47')));_0x5b1212[_0x3757('0xb')](_0x3757('0x48'),require('./api/faxInteraction'));_0x5b1212['use'](_0x3757('0x49'),require('./api/faxMessage'));_0x5b1212['use']('/api/fax/queues',require(_0x3757('0x4a')));_0x5b1212[_0x3757('0xb')]('/api/fax/reports/queue',require(_0x3757('0x4b')));_0x5b1212['use'](_0x3757('0x4c'),require(_0x3757('0x4d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x4e'),require(_0x3757('0x4f')));_0x5b1212['use'](_0x3757('0x50'),require('./api/smsInteraction'));_0x5b1212[_0x3757('0xb')]('/api/sms/messages',require(_0x3757('0x51')));_0x5b1212[_0x3757('0xb')](_0x3757('0x52'),require(_0x3757('0x53')));_0x5b1212['use'](_0x3757('0x54'),require('./api/openchannelAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0x55'),require('./api/openchannelApplication'));_0x5b1212[_0x3757('0xb')](_0x3757('0x56'),require(_0x3757('0x57')));_0x5b1212['use'](_0x3757('0x58'),require(_0x3757('0x59')));_0x5b1212['use'](_0x3757('0x5a'),require(_0x3757('0x5b')));_0x5b1212[_0x3757('0xb')](_0x3757('0x5c'),require(_0x3757('0x5d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x5e'),require(_0x3757('0x5f')));_0x5b1212[_0x3757('0xb')](_0x3757('0x60'),require(_0x3757('0x61')));_0x5b1212[_0x3757('0xb')]('/api/chat/interactions',require('./api/chatInteraction'));_0x5b1212[_0x3757('0xb')](_0x3757('0x62'),require(_0x3757('0x63')));_0x5b1212[_0x3757('0xb')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x5b1212['use'](_0x3757('0x64'),require('./api/chatQueue'));_0x5b1212[_0x3757('0xb')]('/api/chat/groups',require(_0x3757('0x65')));_0x5b1212['use'](_0x3757('0x66'),require(_0x3757('0x67')));_0x5b1212[_0x3757('0xb')](_0x3757('0x68'),require(_0x3757('0x69')));_0x5b1212[_0x3757('0xb')](_0x3757('0x6a'),require(_0x3757('0x6b')));_0x5b1212['use'](_0x3757('0x6c'),require(_0x3757('0x6d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x6e'),require(_0x3757('0x6f')));_0x5b1212[_0x3757('0xb')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x5b1212['use'](_0x3757('0x70'),require(_0x3757('0x71')));_0x5b1212[_0x3757('0xb')](_0x3757('0x72'),require('./api/cmCustomField'));_0x5b1212[_0x3757('0xb')](_0x3757('0x73'),require(_0x3757('0x74')));_0x5b1212[_0x3757('0xb')](_0x3757('0x75'),require(_0x3757('0x76')));_0x5b1212[_0x3757('0xb')](_0x3757('0x77'),require(_0x3757('0x78')));_0x5b1212[_0x3757('0xb')](_0x3757('0x79'),require(_0x3757('0x7a')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7b'),require(_0x3757('0x7c')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7d'),require(_0x3757('0x7e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7f'),require('./api/pause'));_0x5b1212['use'](_0x3757('0x80'),require('./api/cdr'));_0x5b1212[_0x3757('0xb')](_0x3757('0x81'),require(_0x3757('0x82')));_0x5b1212[_0x3757('0xb')](_0x3757('0x83'),require(_0x3757('0x84')));_0x5b1212[_0x3757('0xb')](_0x3757('0x85'),require(_0x3757('0x86')));_0x5b1212[_0x3757('0xb')](_0x3757('0x87'),require(_0x3757('0x88')));_0x5b1212[_0x3757('0xb')](_0x3757('0x89'),require('./api/template'));_0x5b1212[_0x3757('0xb')](_0x3757('0x8a'),require('./api/trigger'));_0x5b1212[_0x3757('0xb')](_0x3757('0x8b'),require(_0x3757('0x8c')));_0x5b1212[_0x3757('0xb')]('/api/integrations',require(_0x3757('0x8d')));_0x5b1212[_0x3757('0xb')]('/api/integrations/reports',require(_0x3757('0x8e')));_0x5b1212['use'](_0x3757('0x8f'),require(_0x3757('0x90')));_0x5b1212[_0x3757('0xb')]('/api/analytics/default_reports',require(_0x3757('0x91')));_0x5b1212[_0x3757('0xb')](_0x3757('0x92'),require('./api/analyticExtractedReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x93'),require(_0x3757('0x94')));_0x5b1212[_0x3757('0xb')](_0x3757('0x95'),require('./api/analyticFieldReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x96'),require(_0x3757('0x97')));_0x5b1212[_0x3757('0xb')](_0x3757('0x98'),require(_0x3757('0x99')));_0x5b1212[_0x3757('0xb')](_0x3757('0x9a'),require(_0x3757('0x9b')));_0x5b1212['use'](_0x3757('0x9c'),require(_0x3757('0x9d')));_0x5b1212[_0x3757('0xb')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0x9e'),require(_0x3757('0x9f')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa0'),require(_0x3757('0xa1')));_0x5b1212[_0x3757('0xb')]('/api/integrations/desk/accounts',require(_0x3757('0xa2')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa3'),require(_0x3757('0xa4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa5'),require(_0x3757('0xa6')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa7'),require('./api/intZohoAccount'));_0x5b1212['use'](_0x3757('0xa8'),require(_0x3757('0xa9')));_0x5b1212[_0x3757('0xb')]('/api/integrations/zoho/fields',require(_0x3757('0xaa')));_0x5b1212[_0x3757('0xb')](_0x3757('0xab'),require(_0x3757('0xac')));_0x5b1212[_0x3757('0xb')]('/api/integrations/zendesk/configurations',require(_0x3757('0xad')));_0x5b1212[_0x3757('0xb')](_0x3757('0xae'),require(_0x3757('0xaf')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb0'),require(_0x3757('0xb1')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb2'),require(_0x3757('0xb3')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb4'),require(_0x3757('0xb5')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb6'),require(_0x3757('0xb7')));_0x5b1212['use']('/api/integrations/vtiger/configurations',require(_0x3757('0xb8')));_0x5b1212['use'](_0x3757('0xb9'),require('./api/intVtigerField'));_0x5b1212['use'](_0x3757('0xba'),require(_0x3757('0xbb')));_0x5b1212[_0x3757('0xb')](_0x3757('0xbc'),require(_0x3757('0xbd')));_0x5b1212['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5b1212[_0x3757('0xb')](_0x3757('0xbe'),require(_0x3757('0xbf')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc0'),require(_0x3757('0xc1')));_0x5b1212['use']('/api/integrations/dynamics365/fields',require(_0x3757('0xc2')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc3'),require(_0x3757('0xc4')));_0x5b1212[_0x3757('0xb')]('/api/integrations/freshsales/configurations',require(_0x3757('0xc5')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc6'),require(_0x3757('0xc7')));_0x5b1212[_0x3757('0xb')]('/api/networks',require(_0x3757('0xc8')));_0x5b1212['use'](_0x3757('0xc9'),require(_0x3757('0xca')));_0x5b1212[_0x3757('0xb')](_0x3757('0xcb'),require('./api/chatInternalMessage'));_0x5b1212[_0x3757('0xb')](_0x3757('0xcc'),require(_0x3757('0xcd')));_0x5b1212[_0x3757('0xb')](_0x3757('0xce'),require(_0x3757('0xcf')));_0x5b1212[_0x3757('0xb')]('/api/jscripty/sessions/reports',require(_0x3757('0xd0')));_0x5b1212['use'](_0x3757('0xd1'),require(_0x3757('0xd2')));_0x5b1212['use'](_0x3757('0xd3'),require(_0x3757('0xd4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xd5'),require(_0x3757('0xd6')));_0x5b1212[_0x3757('0xb')](_0x3757('0xd7'),require('./api/jscriptyProject'));_0x5b1212[_0x3757('0xb')](_0x3757('0xd8'),require(_0x3757('0xd9')));_0x5b1212[_0x3757('0xb')](_0x3757('0xda'),require(_0x3757('0xdb')));_0x5b1212['use'](_0x3757('0xdc'),require(_0x3757('0xdd')));_0x5b1212[_0x3757('0xb')](_0x3757('0xde'),require(_0x3757('0xdf')));_0x5b1212['use'](_0x3757('0xe0'),require(_0x3757('0xe1')));_0x5b1212[_0x3757('0xb')](_0x3757('0xe2'),require('./api/team'));_0x5b1212['use'](_0x3757('0xe3'),require(_0x3757('0xe4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xe5'),require(_0x3757('0xe6')));_0x5b1212[_0x3757('0xb')]('/api/migrations',require('./api/migration'));_0x5b1212[_0x3757('0xb')](_0x3757('0xe7'),require(_0x3757('0xe8')));_0x5b1212['use'](_0x3757('0xe9'),require(_0x3757('0xea')));_0x5b1212['use'](_0x3757('0xeb'),require('./api/mailTransferReport'));_0x5b1212['use']('/api/chat/reports/transfer',require(_0x3757('0xec')));_0x5b1212[_0x3757('0xb')](_0x3757('0xed'),require(_0x3757('0xee')));_0x5b1212['use'](_0x3757('0xef'),require('./api/openchannelTransferReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf0'),require(_0x3757('0xf1')));_0x5b1212[_0x3757('0xb')]('/api/cm/lists',require('./api/cmList'));_0x5b1212[_0x3757('0xb')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x5b1212['use'](_0x3757('0xf2'),require('./api/userProfile'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf3'),require(_0x3757('0xf4')));_0x5b1212['use'](_0x3757('0xf5'),require(_0x3757('0xf6')));_0x5b1212['use'](_0x3757('0xf7'),require('./api/userNotification'));_0x5b1212['use'](_0x3757('0xf8'),require('./api/whatsappAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf9'),require(_0x3757('0xfa')));_0x5b1212[_0x3757('0xb')](_0x3757('0xfb'),require('./api/whatsappInteraction'));_0x5b1212[_0x3757('0xb')](_0x3757('0xfc'),require('./api/whatsappMessage'));_0x5b1212[_0x3757('0xb')](_0x3757('0xfd'),require(_0x3757('0xfe')));_0x5b1212['use'](_0x3757('0xff'),require('./api/whatsappTransferReport'));_0x5b1212['use'](_0x3757('0x100'),require(_0x3757('0x101')));_0x5b1212['use'](_0x3757('0x102'),require(_0x3757('0x103')));_0x5b1212[_0x3757('0xb')](_0x3757('0x104'),require(_0x3757('0x105')));_0x5b1212[_0x3757('0xb')](_0x3757('0x106'),require(_0x3757('0x107')));_0x5b1212[_0x3757('0xb')]('/api/auth/google',require(_0x3757('0x108')));_0x5b1212[_0x3757('0xb')](_0x3757('0x109'),require(_0x3757('0x10a')));_0x5b1212['use'](_0x3757('0x10b'),require(_0x3757('0x10c')));_0x5b1212[_0x3757('0xb')](_0x3757('0x10d'),require(_0x3757('0x10e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x10f'),require('./api/system'));_0x5b1212[_0x3757('0xb')](_0x3757('0x110'),require(_0x3757('0x111')));_0x5b1212[_0x3757('0xb')]('/api/webbar',require(_0x3757('0x112')));_0x5b1212[_0x3757('0xb')](_0x3757('0x113'),express['static'](path['join'](config['root'],_0x3757('0x113'))));_0x5b1212['use']('/www',express[_0x3757('0x114')](path['join'](config[_0x3757('0x115')],_0x3757('0x116'))));_0x5b1212[_0x3757('0xb')](_0x3757('0x117'),express[_0x3757('0x114')](path[_0x3757('0x118')](config[_0x3757('0x115')],_0x3757('0x117'))));_0x5b1212[_0x3757('0xb')](_0x3757('0x119'),express[_0x3757('0x114')](path[_0x3757('0x118')](config['root'],_0x3757('0x11a'),_0x3757('0x11b'))));_0x5b1212[_0x3757('0xb')]('/plugins',express[_0x3757('0x114')](path['join'](config['root'],_0x3757('0x11c'))));_0x5b1212[_0x3757('0x11d')](_0x3757('0x11e'))[_0x3757('0x11f')](errors[0x194]);_0x5b1212[_0x3757('0x11d')]('/*')[_0x3757('0x11f')](function(_0x533db7,_0xde7de9){_0xde7de9[_0x3757('0x120')](path[_0x3757('0x121')](_0x5b1212[_0x3757('0x11f')](_0x3757('0x122'))+'/index.html'));});};var sensitiveFields=[_0x3757('0x123'),_0x3757('0x124'),_0x3757('0x125'),_0x3757('0x126'),'firstName',_0x3757('0x127'),_0x3757('0x128'),_0x3757('0x129'),'mobile',_0x3757('0x12a'),_0x3757('0x12b'),_0x3757('0x12c'),'clientSecret','securityToken',_0x3757('0x12d'),_0x3757('0x12e'),_0x3757('0x12f'),_0x3757('0x130'),_0x3757('0x131'),_0x3757('0x132'),_0x3757('0x133'),_0x3757('0x134'),_0x3757('0x135'),_0x3757('0x136'),_0x3757('0x137'),_0x3757('0x138'),_0x3757('0x139'),_0x3757('0x13a'),_0x3757('0x13b'),_0x3757('0x13c'),_0x3757('0x13d'),_0x3757('0x13e'),_0x3757('0x13f'),_0x3757('0x140'),_0x3757('0x18'),_0x3757('0x141'),'accountSid',_0x3757('0x142'),_0x3757('0x143'),_0x3757('0x144'),_0x3757('0x145'),_0x3757('0x146')];function maskSensitiveData(_0x5b3c60){var _0x2173f9=/(?!^)[\s\S](?!$)/g;if(!_[_0x3757('0x147')](_0x5b3c60))return;for(var _0x3cb70c in _0x5b3c60){if(_[_0x3757('0x148')](_0x5b3c60[_0x3cb70c])){for(var _0x327000=0x0;_0x327000<_0x5b3c60[_0x3cb70c][_0x3757('0x149')];_0x327000++){maskSensitiveData(_0x5b3c60[_0x3cb70c][_0x327000]);}}else if(_[_0x3757('0x147')](_0x5b3c60[_0x3cb70c])){maskSensitiveData(_0x5b3c60[_0x3cb70c]);}else if(_[_0x3757('0x14a')](_0x5b3c60[_0x3cb70c])){_0x5b3c60[_0x3cb70c]=_0x5b3c60[_0x3cb70c][_0x3757('0x14b')](/{{{/g,_0x3757('0x14c'))[_0x3757('0x14b')](/}}}/g,_0x3757('0x14d'))[_0x3757('0x14b')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x3757('0x14e')](sensitiveFields,_0x3cb70c)){_0x5b3c60[_0x3cb70c]=_0x5b3c60[_0x3cb70c][_0x3757('0x14b')](_0x2173f9,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0071e15..ffca243 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b5a=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.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/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','listen','log','../config/triggers','jayson/promise','bluebird','lodash','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x5ab3a8,_0x357688){var _0x4619de=function(_0x321ec2){while(--_0x321ec2){_0x5ab3a8['push'](_0x5ab3a8['shift']());}};_0x4619de(++_0x357688);}(_0x6b5a,0xf8));var _0xa6b5=function(_0x4570fa,_0x2ed425){_0x4570fa=_0x4570fa-0x0;var _0x2c9217=_0x6b5a[_0x4570fa];return _0x2c9217;};'use strict';var jayson=require(_0xa6b5('0x0'));var BPromise=require(_0xa6b5('0x1'));var _=require(_0xa6b5('0x2'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x2dfa3d,_0x50224d){var _0x4bde47={};_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x4')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x5')));_0x4bde47=_['merge'](_0x4bde47,require('../api/voiceQueue/voiceQueue.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/voiceRecording/voiceRecording.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x6')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x7')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x8')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x9')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0xa')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0xb')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0xc')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0xd')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0xe')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/mailInteraction/mailInteraction.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0xf')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x10')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x11')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x12')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x13')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x14')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x15')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x16')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x17')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x18')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x19')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1a')));_0x4bde47=_['merge'](_0x4bde47,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1b')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1c')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1d')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1e')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x1f')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x20')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x21')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x22')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x23')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x24')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x25')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x26')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x27')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x28')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x29')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x2a')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x2b')));_0x4bde47=_['merge'](_0x4bde47,require('../api/variable/variable.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x2c')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x2d')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x2e')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4bde47=_['merge'](_0x4bde47,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x2f')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x30')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x31')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x32')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x33')));_0x4bde47=_['merge'](_0x4bde47,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x34')));_0x4bde47=_['merge'](_0x4bde47,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/setting/setting.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x35')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x36')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/squareRecording/squareRecording.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x37')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x38')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x39')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x3a')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x3b')));_0x4bde47=_[_0xa6b5('0x3')](_0x4bde47,require(_0xa6b5('0x3c')));_0x4bde47=_['merge'](_0x4bde47,require(_0xa6b5('0x3d')));var _0x37e62d=jayson[_0xa6b5('0x3e')](_0x4bde47)[_0xa6b5('0x3f')]();var _0xbac5d5=config[_0xa6b5('0x40')][_0xa6b5('0x41')]||config[_0xa6b5('0x41')]+0x1;var _0x34a471=config[_0xa6b5('0x40')]['ip']||'localhost';_0x37e62d['on'](_0xa6b5('0x42'),function(_0x264ea9){return _0x50224d(_0x264ea9);});_0x37e62d[_0xa6b5('0x43')](_0xbac5d5,_0x34a471,function(){console[_0xa6b5('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x34a471,_0xbac5d5);require(_0xa6b5('0x45'))['default']();return _0x2dfa3d('RPC\x20listening\x20on\x20'+_0x34a471+':'+_0xbac5d5);});});}; \ No newline at end of file +var _0x5896=['merge','../api/user/user.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0x5896,0x1f4));var _0x6589=function(_0x4987fc,_0x582842){_0x4987fc=_0x4987fc-0x0;var _0xe5a68d=_0x5896[_0x4987fc];return _0xe5a68d;};'use strict';var jayson=require(_0x6589('0x0'));var BPromise=require(_0x6589('0x1'));var _=require('lodash');var config=require(_0x6589('0x2'));exports[_0x6589('0x3')]=function(){return new BPromise(function(_0x241b5b,_0x222274){var _0x41c3f6={};_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x5')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceExtension/voiceExtension.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/voiceQueue/voiceQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceRecording/voiceRecording.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x6')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x7')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x8')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/memberReport/memberReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/trunk/trunk.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x9')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xa')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xb')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0xc')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/mailQueue/mailQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xd')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xe')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xf')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x10')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x11')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x12')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x13')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x14')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x15')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x16')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x17')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x18')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x19')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x1a')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1f')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x20')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/chatQueue/chatQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x21')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/cmHopper/cmHopper.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x22')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x23')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x24')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x25')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x26')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x27')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x28')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x29')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x2a')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x2b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2f')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x30')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x31')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x32')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x33')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x34')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x35')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/squareReport/squareReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x36')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/setting/setting.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x37')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x38')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/squareRecording/squareRecording.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/squareMessage/squareMessage.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x39')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3a')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x453285=jayson[_0x6589('0x3f')](_0x41c3f6)[_0x6589('0x40')]();var _0x2e1675=config[_0x6589('0x41')]['port']||config['port']+0x1;var _0x3632d2=config[_0x6589('0x41')]['ip']||_0x6589('0x42');_0x453285['on'](_0x6589('0x43'),function(_0x176793){return _0x222274(_0x176793);});_0x453285[_0x6589('0x3')](_0x2e1675,_0x3632d2,function(){console[_0x6589('0x44')](_0x6589('0x45'),_0x3632d2,_0x2e1675);require('../config/triggers')[_0x6589('0x46')]();return _0x241b5b(_0x6589('0x47')+_0x3632d2+':'+_0x2e1675);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 56a94e2..fe75c83 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x4e231a,_0x378441){var _0x482b1d=function(_0x30b9bf){while(--_0x30b9bf){_0x4e231a['push'](_0x4e231a['shift']());}};_0x482b1d(++_0x378441);}(_0x8f4c,0x113));var _0xc8f4=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x8f4c[_0xb77dfe];return _0x5e4f5d;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file +var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x446455,_0x19af51){var _0x57b6c8=function(_0xacf350){while(--_0xacf350){_0x446455['push'](_0x446455['shift']());}};_0x57b6c8(++_0x19af51);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3fdc019..2c58ee8 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 _0x852c=['label','exports','util','lodash','EventEmitter','./reply','call','setTimeout','setEncoding','emit','ready','line','toLowerCase','hangup','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','inherits','prototype','sendRequest','command','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT'];(function(_0x48a749,_0xf82755){var _0x507a1e=function(_0x34e14d){while(--_0x34e14d){_0x48a749['push'](_0x48a749['shift']());}};_0x507a1e(++_0xf82755);}(_0x852c,0x179));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc852('0x0'));var _=require(_0xc852('0x1'));var EventEmitter=require('events')[_0xc852('0x2')];var AGIReply=require(_0xc852('0x3'));var AGIError=require('./error');function AGIChannel(_0x592b1c){var _0x29ba2a=this,_0x35c0a2=new AGIReply(),_0xd4b975=![],_0x98e8e4={};EventEmitter[_0xc852('0x4')](_0x29ba2a);_0x592b1c['setEncoding']('utf8');_0x592b1c[_0xc852('0x5')](0x8*0x3c*0x3c*0x3e8);_0x35c0a2[_0xc852('0x6')]('utf8');_0x35c0a2['on']('headers',function(_0x3a1139){for(var _0x30d4f0 in _0x3a1139){_0x29ba2a[_0x30d4f0]=_0x3a1139[_0x30d4f0];}_0x29ba2a[_0xc852('0x7')](_0xc852('0x8'));});_0x35c0a2['on'](_0xc852('0x9'),function(_0x26097d){if(_0x26097d[_0xc852('0xa')]()==_0xc852('0xb')){_0x29ba2a['emit'](_0xc852('0xb'));return;}if(_0x26097d['substring'](0x0,0xb)==_0xc852('0xc')){_0xd4b975=!![];}if(_0xd4b975){_0x98e8e4['rx']+=_0x26097d+'\x0a';if(_0x26097d[_0xc852('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0xd4b975=![];}}else{_0x98e8e4['rx']=_0x26097d;}if(_0xd4b975){return;}if(typeof _0x98e8e4['cb']==_0xc852('0xe')){var _0x5dcae3=_0x98e8e4['rx']['substring'](0x0,0x3),_0x1b0e2a=null,_0x2de381=null;_0x5dcae3=parseInt(_0x5dcae3);if(isNaN(_0x5dcae3)){_0x98e8e4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc852('0xf')});return;}if(_0x5dcae3!=0xc8){_0x98e8e4['cb'](null,{'code':_0x5dcae3,'result':-0x1,'extra':'KO'});return;}_0x1b0e2a=_0x98e8e4['rx']['substring'](0x4)[_0xc852('0x10')](_0xc852('0x11'),'');if(_0x1b0e2a[_0xc852('0x12')]('\x20')!=-0x1){_0x1b0e2a=_0x1b0e2a[_0xc852('0x13')](0x0,_0x1b0e2a[_0xc852('0x12')]('\x20'));}if(_[_0xc852('0x14')](_0x1b0e2a,'-1')){_0x1b0e2a=parseInt(_0x1b0e2a);}_0x2de381=_0x98e8e4['rx'][_0xc852('0x15')]('\x20');if(_0x2de381['length']==0x3){_0x2de381=_0x2de381[0x2]['substring'](0x1,_0x2de381[0x2][_0xc852('0x16')]-0x1);}else if(_0x2de381[_0xc852('0x16')]>0x3){var _0x4c38d7=/\((.+)\)/;var _0x4d0e96=_0x98e8e4['rx'][_0xc852('0x17')](_0x4c38d7);if(_0x4d0e96){_0x2de381=_0x4d0e96[0x1];}else{_0x2de381=null;}}else{_0x2de381=null;}_0x98e8e4['cb'](null,{'code':_0x5dcae3,'result':_0x1b0e2a,'extra':_0x2de381});}});_0x592b1c['on']('error',function(_0xb9f57b){_0x29ba2a[_0xc852('0x7')](_0xc852('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0xb9f57b[_0xc852('0x19')]));});_0x592b1c['on'](_0xc852('0x1a'),function(){_0x29ba2a[_0xc852('0x7')](_0xc852('0x1a'),new AGIError(_0xc852('0x1b')));});_0x592b1c['on'](_0xc852('0x1c'),function(){_0x29ba2a[_0xc852('0x7')](_0xc852('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x592b1c[_0xc852('0x1d')]();});_0x592b1c[_0xc852('0x1e')](_0x35c0a2);this['command']=function(_0x493188,_0x1b04b5){var _0x493188=_0x493188||'',_0x1b04b5=typeof _0x1b04b5==_0xc852('0xe')?_0x1b04b5:new Function();_0x98e8e4={'tx':_0x493188,'rx':'','cb':_0x1b04b5};_0x592b1c['write'](_0x493188+'\x0a');},this[_0xc852('0x1a')]=function(){_0x592b1c['destroy']();};}util[_0xc852('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0xc852('0x20')][_0xc852('0x21')]=function(_0xa6f49c){return this[_0xc852('0x22')][_0xc852('0x23')](this,_0xa6f49c);};AGIChannel[_0xc852('0x20')]['answer']=function(){return this[_0xc852('0x21')](_0xc852('0x24'));};AGIChannel[_0xc852('0x20')][_0xc852('0x25')]=function(_0x1a7b45,_0x17a5a6,_0x40f228){_0x1a7b45=_0x1a7b45===undefined?'beep':_0x1a7b45;_0x17a5a6=_0x17a5a6===undefined?'5':_0x17a5a6;_0x40f228=_0x40f228===undefined?'1':_0x40f228;return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x27'),_0x1a7b45,_0x17a5a6*0x3e8,_0x40f228));};AGIChannel['prototype'][_0xc852('0x28')]=function(_0x49f65){_0x49f65=_0x49f65||_0xc852('0x29');return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x2a'),_0x49f65));};AGIChannel['prototype'][_0xc852('0x2b')]=function(_0x2d6aa7,_0x439fd5){if(_['isArray'](_0x439fd5)){return this[_0xc852('0x21')](util[_0xc852('0x26')]('EXEC\x20%s\x20%s',_0x2d6aa7,_0x439fd5[_0xc852('0x2c')](',')));}return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x2d'),_0x2d6aa7,_0x439fd5));};AGIChannel[_0xc852('0x20')]['setContext']=function(_0x2b912a){return this[_0xc852('0x21')](util['format'](_0xc852('0x2e'),_0x2b912a));};AGIChannel[_0xc852('0x20')][_0xc852('0x2f')]=function(_0x124b54){return this['sendRequest'](util['format'](_0xc852('0x30'),_0x124b54));};AGIChannel[_0xc852('0x20')]['setPriority']=function(_0x6ef3f2){return this['sendRequest'](util[_0xc852('0x26')](_0xc852('0x31'),_0x6ef3f2));};AGIChannel[_0xc852('0x20')][_0xc852('0xb')]=function(){return this['sendRequest'](_0xc852('0x32'));};AGIChannel['prototype']['setVariable']=function(_0x23440a,_0x448031){var _0x3acdbe=_['isBoolean'](_0x448031)||_[_0xc852('0x33')](_0x448031)?_0x448031[_0xc852('0x34')]():_0x448031;return this['sendRequest'](util[_0xc852('0x26')](_0xc852('0x35'),_0x23440a,_0x3acdbe?_0x3acdbe[_0xc852('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xc852('0x20')][_0xc852('0x36')]=function(_0x1001db,_0x2cb3e0){return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x37'),_0x1001db,_0x2cb3e0));};AGIChannel[_0xc852('0x20')][_0xc852('0x38')]=function(_0x3157be,_0x17c543){return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x39'),_0x3157be,_0x17c543));};AGIChannel[_0xc852('0x20')][_0xc852('0x3a')]=function(_0xa03df9,_0x56fa88){return this[_0xc852('0x21')](util['format'](_0xc852('0x3b'),_0xa03df9,_0x56fa88));};AGIChannel[_0xc852('0x20')][_0xc852('0x3c')]=function(_0x310452,_0x1c5626,_0x5e4948){_0x1c5626=_0x1c5626||this[_0xc852('0x3d')];_0x5e4948=_0x5e4948||0x1;this[_0xc852('0x3e')](_0x310452);this['setExtension'](_0x1c5626);this[_0xc852('0x3f')](_0x5e4948);return this[_0xc852('0x28')](util[_0xc852('0x26')](_0xc852('0x40'),_0x310452,_0x1c5626,_0x5e4948));};AGIChannel['prototype'][_0xc852('0x41')]=function(_0x2cb8a5){return this[_0xc852('0x21')](util[_0xc852('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2cb8a5));};AGIChannel[_0xc852('0x20')][_0xc852('0x42')]=function(_0x371096,_0x2618f3,_0x44f227,_0x208ec0,_0xed13eb,_0x5aa7ba){_0x2618f3=_0x2618f3||'wav';_0x44f227=_0x44f227||'';_0x208ec0=_0x208ec0===undefined?-0x1:_0x208ec0==='-1'?-0x1:_0x208ec0*0x3e8;_0xed13eb=_0xed13eb===undefined?'':'s='+_0xed13eb;_0x5aa7ba=_0x5aa7ba?'BEEP':'';return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x43'),_0x371096,_0x2618f3,_0x44f227,_0x208ec0,_0x5aa7ba,_0xed13eb));};AGIChannel[_0xc852('0x20')][_0xc852('0x44')]=function(_0x157800,_0xe33e6d){_0xe33e6d=_0xe33e6d||'';return this[_0xc852('0x21')](util[_0xc852('0x26')](_0xc852('0x45'),_0x157800,_0xe33e6d));};AGIChannel[_0xc852('0x20')]['agi']=function(_0x428286){return this[_0xc852('0x2b')](_0xc852('0x46'),_0x428286);};AGIChannel[_0xc852('0x20')][_0xc852('0x47')]=function(_0xf8405e){return this[_0xc852('0x2b')](_0xc852('0x48'),_0xf8405e);};AGIChannel[_0xc852('0x20')][_0xc852('0x18')]=function(_0x2e9e34,_0x3e259b){this[_0xc852('0x28')](util[_0xc852('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2e9e34['id'],_0x2e9e34[_0xc852('0x49')],_0x3e259b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xc852('0x4a')]=AGIChannel; \ No newline at end of file +var _0x42fa=['hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','replace','result=','indexOf','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','label','util','lodash','./reply','./error','call','utf8','setTimeout','headers','emit','ready','line','toLowerCase'];(function(_0x465c3b,_0x384cf1){var _0x67f5d8=function(_0x4dbbaf){while(--_0x4dbbaf){_0x465c3b['push'](_0x465c3b['shift']());}};_0x67f5d8(++_0x384cf1);}(_0x42fa,0x161));var _0xa42f=function(_0x3734ca,_0x554044){_0x3734ca=_0x3734ca-0x0;var _0xc17aa2=_0x42fa[_0x3734ca];return _0xc17aa2;};'use strict';var util=require(_0xa42f('0x0'));var _=require(_0xa42f('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xa42f('0x2'));var AGIError=require(_0xa42f('0x3'));function AGIChannel(_0x4001b5){var _0xe7cc95=this,_0x365971=new AGIReply(),_0x657df3=![],_0x3aabbe={};EventEmitter[_0xa42f('0x4')](_0xe7cc95);_0x4001b5['setEncoding'](_0xa42f('0x5'));_0x4001b5[_0xa42f('0x6')](0x8*0x3c*0x3c*0x3e8);_0x365971['setEncoding'](_0xa42f('0x5'));_0x365971['on'](_0xa42f('0x7'),function(_0x2376f0){for(var _0x2638cf in _0x2376f0){_0xe7cc95[_0x2638cf]=_0x2376f0[_0x2638cf];}_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x9'));});_0x365971['on'](_0xa42f('0xa'),function(_0x304f50){if(_0x304f50[_0xa42f('0xb')]()==_0xa42f('0xc')){_0xe7cc95[_0xa42f('0x8')]('hangup');return;}if(_0x304f50['substring'](0x0,0xb)==_0xa42f('0xd')){_0x657df3=!![];}if(_0x657df3){_0x3aabbe['rx']+=_0x304f50+'\x0a';if(_0x304f50[_0xa42f('0xe')](_0xa42f('0xf'))!=-0x1){_0x657df3=![];}}else{_0x3aabbe['rx']=_0x304f50;}if(_0x657df3){return;}if(typeof _0x3aabbe['cb']=='function'){var _0x2c9cb4=_0x3aabbe['rx'][_0xa42f('0x10')](0x0,0x3),_0x362b83=null,_0x4eeca9=null;_0x2c9cb4=parseInt(_0x2c9cb4);if(isNaN(_0x2c9cb4)){_0x3aabbe['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2c9cb4!=0xc8){_0x3aabbe['cb'](null,{'code':_0x2c9cb4,'result':-0x1,'extra':'KO'});return;}_0x362b83=_0x3aabbe['rx']['substring'](0x4)[_0xa42f('0x11')](_0xa42f('0x12'),'');if(_0x362b83[_0xa42f('0x13')]('\x20')!=-0x1){_0x362b83=_0x362b83['substr'](0x0,_0x362b83[_0xa42f('0x13')]('\x20'));}if(_['startsWith'](_0x362b83,'-1')){_0x362b83=parseInt(_0x362b83);}_0x4eeca9=_0x3aabbe['rx'][_0xa42f('0x14')]('\x20');if(_0x4eeca9['length']==0x3){_0x4eeca9=_0x4eeca9[0x2][_0xa42f('0x10')](0x1,_0x4eeca9[0x2][_0xa42f('0x15')]-0x1);}else if(_0x4eeca9[_0xa42f('0x15')]>0x3){var _0x313373=/\((.+)\)/;var _0x1c9400=_0x3aabbe['rx'][_0xa42f('0x16')](_0x313373);if(_0x1c9400){_0x4eeca9=_0x1c9400[0x1];}else{_0x4eeca9=null;}}else{_0x4eeca9=null;}_0x3aabbe['cb'](null,{'code':_0x2c9cb4,'result':_0x362b83,'extra':_0x4eeca9});}});_0x4001b5['on']('error',function(_0x289efd){_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x289efd[_0xa42f('0x18')]));});_0x4001b5['on'](_0xa42f('0x19'),function(){_0xe7cc95['emit'](_0xa42f('0x19'),new AGIError(_0xa42f('0x1a')));});_0x4001b5['on'](_0xa42f('0x1b'),function(){_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x1b'),new AGIError(_0xa42f('0x1c')));_0x4001b5[_0xa42f('0x1d')]();});_0x4001b5[_0xa42f('0x1e')](_0x365971);this['command']=function(_0xe42cde,_0x42ff90){var _0xe42cde=_0xe42cde||'',_0x42ff90=typeof _0x42ff90==_0xa42f('0x1f')?_0x42ff90:new Function();_0x3aabbe={'tx':_0xe42cde,'rx':'','cb':_0x42ff90};_0x4001b5[_0xa42f('0x20')](_0xe42cde+'\x0a');},this[_0xa42f('0x19')]=function(){_0x4001b5[_0xa42f('0x1d')]();};}util[_0xa42f('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xa42f('0x22')][_0xa42f('0x23')]=function(_0x363bce){return this[_0xa42f('0x24')][_0xa42f('0x25')](this,_0x363bce);};AGIChannel[_0xa42f('0x22')][_0xa42f('0x26')]=function(){return this[_0xa42f('0x23')](_0xa42f('0x27'));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x28')]=function(_0x3a8f11,_0x114e00,_0x1c03fa){_0x3a8f11=_0x3a8f11===undefined?_0xa42f('0x29'):_0x3a8f11;_0x114e00=_0x114e00===undefined?'5':_0x114e00;_0x1c03fa=_0x1c03fa===undefined?'1':_0x1c03fa;return this[_0xa42f('0x23')](util['format'](_0xa42f('0x2a'),_0x3a8f11,_0x114e00*0x3e8,_0x1c03fa));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x2b')]=function(_0x298512){_0x298512=_0x298512||_0xa42f('0x2c');return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x2e'),_0x298512));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x2f')]=function(_0xae7e64,_0x5b8577){if(_[_0xa42f('0x30')](_0x5b8577)){return this['sendRequest'](util[_0xa42f('0x2d')]('EXEC\x20%s\x20%s',_0xae7e64,_0x5b8577[_0xa42f('0x31')](',')));}return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x32'),_0xae7e64,_0x5b8577));};AGIChannel[_0xa42f('0x22')]['setContext']=function(_0x2ff3e5){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SET\x20CONTEXT\x20%s',_0x2ff3e5));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x33')]=function(_0x3d11d9){return this[_0xa42f('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x3d11d9));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x34')]=function(_0x1fedf9){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x35'),_0x1fedf9));};AGIChannel['prototype'][_0xa42f('0xc')]=function(){return this[_0xa42f('0x23')](_0xa42f('0x36'));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x37')]=function(_0x3beecb,_0x13afaa){var _0x3c1647=_['isBoolean'](_0x13afaa)||_[_0xa42f('0x38')](_0x13afaa)?_0x13afaa[_0xa42f('0x39')]():_0x13afaa;return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3beecb,_0x3c1647?_0x3c1647[_0xa42f('0x39')]()[_0xa42f('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xa42f('0x3a')]=function(_0x5af5c1,_0x4f67fb){return this[_0xa42f('0x23')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x5af5c1,_0x4f67fb));};AGIChannel['prototype'][_0xa42f('0x3b')]=function(_0x951e48,_0x5c05c8){return this[_0xa42f('0x23')](util['format'](_0xa42f('0x3c'),_0x951e48,_0x5c05c8));};AGIChannel[_0xa42f('0x22')]['sayPhonetic']=function(_0x134086,_0x491f18){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x134086,_0x491f18));};AGIChannel[_0xa42f('0x22')]['continueAt']=function(_0x2211f6,_0x7f6e63,_0x3f3984){_0x7f6e63=_0x7f6e63||this[_0xa42f('0x3d')];_0x3f3984=_0x3f3984||0x1;this[_0xa42f('0x3e')](_0x2211f6);this['setExtension'](_0x7f6e63);this[_0xa42f('0x34')](_0x3f3984);return this[_0xa42f('0x2b')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x2211f6,_0x7f6e63,_0x3f3984));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x3f')]=function(_0x130bcf){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x40'),_0x130bcf));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x41')]=function(_0x10b315,_0x381422,_0x46ad2b,_0x463283,_0xdabb50,_0x3d7c5b){_0x381422=_0x381422||'wav';_0x46ad2b=_0x46ad2b||'';_0x463283=_0x463283===undefined?-0x1:_0x463283==='-1'?-0x1:_0x463283*0x3e8;_0xdabb50=_0xdabb50===undefined?'':'s='+_0xdabb50;_0x3d7c5b=_0x3d7c5b?_0xa42f('0x42'):'';return this['sendRequest'](util['format'](_0xa42f('0x43'),_0x10b315,_0x381422,_0x46ad2b,_0x463283,_0x3d7c5b,_0xdabb50));};AGIChannel['prototype'][_0xa42f('0x44')]=function(_0x5c548b,_0x55e14e){_0x55e14e=_0x55e14e||'';return this['sendRequest'](util[_0xa42f('0x2d')](_0xa42f('0x45'),_0x5c548b,_0x55e14e));};AGIChannel['prototype'][_0xa42f('0x46')]=function(_0x24ff7f){return this[_0xa42f('0x2f')]('AGI',_0x24ff7f);};AGIChannel['prototype'][_0xa42f('0x47')]=function(_0x29f6eb){return this[_0xa42f('0x2f')]('WAIT',_0x29f6eb);};AGIChannel['prototype'][_0xa42f('0x17')]=function(_0x13edad,_0x26fd6d){this[_0xa42f('0x2b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x13edad['id'],_0x13edad[_0xa42f('0x48')],_0x26fd6d));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 4bdab9c..21904bf 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 _0x8538=['E_AGI_UNDEFINED','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x8538,0x1f4));var _0x8853=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8538[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8853('0x0'));var error={'E_AGI_UNDEFINED':_0x8853('0x1'),'E_AGI_ARGUMENT_PORT':_0x8853('0x2'),'E_AGI_SERVER_ERROR':_0x8853('0x3'),'E_AGI_SERVER_CLOSE':_0x8853('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8853('0x5'),'E_AGI_SOCKET_ERROR':_0x8853('0x6'),'E_AGI_SOCKET_CLOSE':_0x8853('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x8853('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x8853('0x9')};function AGIError(_0x39f42b){var _0x39f42b=_0x39f42b||null,_0x36ad36=_0x36ad36||[],_0xb6ca4c=0x1,_0x27f90a='';if(!error[_0x39f42b]){_0x39f42b=_0x8853('0xa');}_0x36ad36[_0x8853('0xb')](error[_0x39f42b]);while(arguments[_0xb6ca4c]){_0x36ad36[_0x8853('0xb')](arguments[_0xb6ca4c]);_0xb6ca4c++;}_0x27f90a=util[_0x8853('0xc')][_0x8853('0xd')](util,_0x36ad36);this['message']=_0x27f90a;this['name']=_0x39f42b;}module[_0x8853('0xe')]=AGIError; \ No newline at end of file +var _0xf465=['E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x1f9501,_0x26db9d){var _0x503adf=function(_0x29280d){while(--_0x29280d){_0x1f9501['push'](_0x1f9501['shift']());}};_0x503adf(++_0x26db9d);}(_0xf465,0x172));var _0x5f46=function(_0x2c4f3f,_0x266947){_0x2c4f3f=_0x2c4f3f-0x0;var _0x3d0234=_0xf465[_0x2c4f3f];return _0x3d0234;};'use strict';var util=require(_0x5f46('0x0'));var error={'E_AGI_UNDEFINED':_0x5f46('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x5f46('0x2'),'E_AGI_SERVER_CLOSE':_0x5f46('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5f46('0x4'),'E_AGI_SOCKET_CLOSE':_0x5f46('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x5f46('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5f46('0x7')};function AGIError(_0x433860){var _0x433860=_0x433860||null,_0x61bfb2=_0x61bfb2||[],_0x130d06=0x1,_0xe04776='';if(!error[_0x433860]){_0x433860=_0x5f46('0x8');}_0x61bfb2[_0x5f46('0x9')](error[_0x433860]);while(arguments[_0x130d06]){_0x61bfb2[_0x5f46('0x9')](arguments[_0x130d06]);_0x130d06++;}_0xe04776=util[_0x5f46('0xa')]['apply'](util,_0x61bfb2);this[_0x5f46('0xb')]=_0xe04776;this[_0x5f46('0xc')]=_0x433860;}module[_0x5f46('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e7af3d0..d33d901 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 _0x4b74=['size','relations','traverseBFS','info','length','condition','split','vswitch','default','target','agicommand','menu','invalid','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b74,0x103));var _0x44b7=function(_0xed7897,_0xa3cdc8){_0xed7897=_0xed7897-0x0;var _0x37d013=_0x4b74[_0xed7897];return _0x37d013;};'use strict';var _=require(_0x44b7('0x0'));var logger=require(_0x44b7('0x1'))(_0x44b7('0x2'));var verticesWithRetry=['menu',_0x44b7('0x3'),_0x44b7('0x4')];var Graph=function(){this[_0x44b7('0x5')]={};this[_0x44b7('0x6')]={};this[_0x44b7('0x7')]=0x0;};Graph[_0x44b7('0x8')][_0x44b7('0x9')]=function(_0x123a0d){this['vertices'][_0x123a0d['id']]=_0x123a0d;this[_0x44b7('0x6')][_0x123a0d['id']]=[];};Graph[_0x44b7('0x8')][_0x44b7('0xa')]=function(_0x4a582b,_0x45dfbe,_0xabf05c){this[_0x44b7('0x6')][_0x4a582b]['push']({'target':_0x45dfbe,'condition':_0xabf05c});this[_0x44b7('0x7')]+=0x1;};Graph[_0x44b7('0x8')]['size']=function(){return _[_0x44b7('0xb')](this[_0x44b7('0x5')]);};Graph['prototype'][_0x44b7('0xc')]=function(){return this[_0x44b7('0x7')];};Graph[_0x44b7('0x8')]['getVertex']=function(_0xfb9a6d){return this[_0x44b7('0x5')][_0xfb9a6d];};Graph['prototype'][_0x44b7('0xd')]=function(_0x53628d,_0x2f9e62){if(!this[_0x44b7('0x5')][_0x53628d]){return logger[_0x44b7('0xe')]('no\x20vertex\x20found');}var _0x590ba5=_0x2f9e62(this[_0x44b7('0x5')][_0x53628d]);if(!_0x590ba5){return logger['info']('stop\x20traverse');}if(this['edges'][_0x53628d][_0x44b7('0xf')]===0x0){return logger[_0x44b7('0xe')]('no\x20edge/s\x20available');}for(var _0x304807=0x0,_0x3ba9b0=[],_0x3528c8=![];_0x304807\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','target','addEdge','value','getSquareProject','then','indexOf','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','production','start','root','joinAt','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','context','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','extension','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','listening','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./mailRpc','./vertices','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2969f3,_0x21c69b){var _0x25af83=function(_0x3d33f4){while(--_0x3d33f4){_0x2969f3['push'](_0x2969f3['shift']());}};_0x25af83(++_0x21c69b);}(_0xe975,0x1dc));var _0x5e97=function(_0x5b9e5f,_0x334006){_0x5b9e5f=_0x5b9e5f-0x0;var _0x28ddbb=_0xe975[_0x5b9e5f];return _0x28ddbb;};'use strict';var parser=require('xml2json');var _=require(_0x5e97('0x0'));var syncho=require(_0x5e97('0x1'));var util=require(_0x5e97('0x2'));var moment=require(_0x5e97('0x3'));var config=require(_0x5e97('0x4'));var logger=require(_0x5e97('0x5'))(_0x5e97('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x5e97('0x7'));var Graph=require('./graph');var Vertices=require(_0x5e97('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5e97('0x6')]=_['defaults'](config['agi'],{'ip':_0x5e97('0x9'),'port':0x11dd});function connectionHandler(_0x4a00e8){process[_0x5e97('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4a00e8);agiHandler(_0x4a00e8);}catch(_0x5c2c14){logger[_0x5e97('0xb')](_0x5c2c14['stack']);}});});}function listeningHandler(){console[_0x5e97('0xc')](_0x5e97('0xd'),config['agi'][_0x5e97('0xe')]);logger[_0x5e97('0xf')](util[_0x5e97('0x10')](_0x5e97('0x11'),config[_0x5e97('0x6')]['ip'],config[_0x5e97('0x6')]['port']));}function errorHandler(_0x1ece51){if(_0x1ece51&&_0x1ece51[_0x5e97('0x12')]&&_0x1ece51[_0x5e97('0x13')]){logger['error'](util[_0x5e97('0x10')](_0x5e97('0x14'),_0x1ece51[_0x5e97('0x12')],_0x1ece51[_0x5e97('0x13')]));}else{logger[_0x5e97('0xb')](util[_0x5e97('0x10')](_0x5e97('0x15'),_0x1ece51[_0x5e97('0x16')]));}}function closeHandler(){logger['info'](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x5e97('0x17')],this[_0x5e97('0x18')],this[_0x5e97('0x19')],this[_0x5e97('0x1a')]));try{createSquareReport(this);}catch(_0x2e4ff3){logger[_0x5e97('0xb')](_0x2e4ff3[_0x5e97('0x16')]);}}function timeoutHandler(){logger[_0x5e97('0xf')](util[_0x5e97('0x10')](_0x5e97('0x1b'),this[_0x5e97('0x1c')],this[_0x5e97('0x17')],this['callerid'],this[_0x5e97('0x19')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x5e97('0x10')](_0x5e97('0x1d'),this[_0x5e97('0x1c')],this[_0x5e97('0x17')],this[_0x5e97('0x18')],this[_0x5e97('0x19')],this[_0x5e97('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x5c40f6){return parser[_0x5e97('0x1e')](_0x5c40f6,{'object':!![]})[_0x5e97('0x1f')]['root'];}function addVertex(_0x50486f,_0x37608e,_0x3c1fc0){_0x37608e[_0x5e97('0x20')]=_0x3c1fc0;if(_0x37608e[_0x5e97('0x21')]('retry')){_0x37608e[_0x5e97('0x22')]=parseInt(_0x37608e[_0x5e97('0x23')],0xa);}_0x50486f[_0x5e97('0x24')](_[_0x5e97('0x25')](_0x37608e,'mxCell'));}function initGraph(_0x3f334d,_0x37cbb1){var _0x2b6dc0=new Graph();for(var _0x605edc in _0x3f334d){if(_0x3f334d['hasOwnProperty'](_0x605edc)){if(_[_0x5e97('0x26')](_0x3f334d[_0x605edc])){for(var _0x28c524=0x0;_0x28c524<_0x3f334d[_0x605edc][_0x5e97('0x27')];_0x28c524+=0x1){addVertex(_0x2b6dc0,_0x3f334d[_0x605edc][_0x28c524],_0x605edc);}}else{addVertex(_0x2b6dc0,_0x3f334d[_0x605edc],_0x605edc);}}}for(var _0x36f601=0x0;_0x36f601<_0x37cbb1[_0x5e97('0x27')];_0x36f601+=0x1){if(_0x37cbb1[_0x36f601]['source']&&_0x37cbb1[_0x36f601][_0x5e97('0x28')]){_0x2b6dc0[_0x5e97('0x29')](_0x37cbb1[_0x36f601]['source'],_0x37cbb1[_0x36f601][_0x5e97('0x28')],_0x37cbb1[_0x36f601][_0x5e97('0x2a')]);}}return _0x2b6dc0;}function getSquareProject(_0x2c784b,_0x44f8eb){rpc[_0x5e97('0x2b')](_0x2c784b)[_0x5e97('0x2c')](function(_0xb643cb){_0x44f8eb(null,_0xb643cb);})['catch'](function(_0x54e4cc){_0x44f8eb(null,_0x54e4cc);});}function createSquareReport(_0x215259,_0x4971bd){rpc['createSquareReport'](_0x215259)[_0x5e97('0x2c')](function(_0xbb5411){if(_0x4971bd){_0x4971bd(null,_0xbb5411);}})['catch'](function(_0x292fa1){if(_0x4971bd){_0x4971bd(null,_0x292fa1);}});}function setChannelVariables(_0x13f328){for(var _0x15f8b4 in _0x13f328){if(_0x13f328[_0x5e97('0x21')](_0x15f8b4)){if(_0x15f8b4[_0x5e97('0x2d')]('agi_')===0x0){_0x13f328[_0x15f8b4['substring'](0x4)]=_0x13f328[_0x15f8b4];delete _0x13f328[_0x15f8b4];}}}}function getLogFromObject(_0x14e380){return util[_0x5e97('0x2e')](_0x14e380,{'showHidden':![],'depth':null});}function agiHandler(_0x2fc944){var _0x23144e,_0x144aba,_0x59f3c2,_0x3bc164,_0x1fdc62;logger[_0x5e97('0x2f')](_0x5e97('0x30'),JSON[_0x5e97('0x31')](_0x2fc944,null,0x2));logger[_0x5e97('0xf')](util['format'](_0x5e97('0x32'),_0x2fc944['arg_1'],_0x2fc944['calleridname'],_0x2fc944['callerid'],_0x2fc944[_0x5e97('0x19')],_0x2fc944[_0x5e97('0x1a')]));_0x2fc944['on'](_0x5e97('0xb'),errorHandler);_0x2fc944['on'](_0x5e97('0x33'),closeHandler);_0x2fc944['on']('timeout',timeoutHandler);_0x2fc944[_0x5e97('0x34')]=![];_0x2fc944['on']('hangup',hangupHandler);var _0x3dcc80=getSquareProject['sync'](null,_0x2fc944[_0x5e97('0x1c')]);if(_0x3dcc80){if(_0x3dcc80[_0x5e97('0x35')]){_0x23144e=getRoot(_0x3dcc80[_0x5e97('0x35')]);if(_0x23144e&&_0x23144e[_0x5e97('0x36')]){logger[_0x5e97('0x2f')](_0x5e97('0x37'),JSON['stringify'](_0x23144e,null,0x2));_0x2fc944[_0x5e97('0x38')]=moment()[_0x5e97('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x144aba=initGraph(_['omit'](_0x23144e,_0x5e97('0x39')),_0x23144e[_0x5e97('0x39')]);_0x59f3c2=new Vertices(_0x2fc944,rpc,mailRpc);logger[_0x5e97('0xf')](util[_0x5e97('0x10')](_0x5e97('0x3a'),_0x2fc944[_0x5e97('0x1c')],_0x2fc944['calleridname'],_0x2fc944[_0x5e97('0x18')],_0x2fc944[_0x5e97('0x19')],_0x2fc944[_0x5e97('0x1a')]));_0x144aba[_0x5e97('0x3b')](_0x23144e[_0x5e97('0x36')]['id'],function(_0x93d8d){try{_0x93d8d=_0x59f3c2[_0x5e97('0x3c')](_0x93d8d);logger[_0x5e97('0x2f')]('vertex',JSON['stringify'](_0x93d8d,null,0x2));if(_0x93d8d[_0x5e97('0x20')]===_0x5e97('0x3d')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2fc944[_0x5e97('0x3e')]=_0x93d8d[_0x5e97('0x3e')]||_0x2fc944['context'];_0x2fc944['extension']=_0x93d8d['extension'];_0x2fc944[_0x5e97('0x3f')]=_0x93d8d[_0x5e97('0x3f')]?_0x93d8d[_0x5e97('0x3f')]-0x1:0x1;return null;}else if(_0x93d8d&&_0x59f3c2[_0x93d8d[_0x5e97('0x20')]]){_0x1fdc62=_0x59f3c2[_0x93d8d[_0x5e97('0x20')]](_0x93d8d);logger[_0x5e97('0xf')](_0x5e97('0x40'),JSON[_0x5e97('0x31')](_0x1fdc62,null,0x2));if(_0x1fdc62&&_0x1fdc62[_0x5e97('0x41')]===AGI_CODE_SUCCESS&&_0x1fdc62[_0x5e97('0x42')]!==AGI_RESULT_ERROR&&!_0x2fc944[_0x5e97('0x34')]){logger[_0x5e97('0x2f')](_0x5e97('0x40'),getLogFromObject(_0x1fdc62));return _[_0x5e97('0x43')](_0x1fdc62[_0x5e97('0x42')])?null:_0x1fdc62['result'][_0x5e97('0x44')]();}else{logger[_0x5e97('0xb')](_0x5e97('0x40'),getLogFromObject(_0x1fdc62));return null;}}else{logger['error'](_0x5e97('0x45'));return null;}}catch(_0x20592b){logger['error'](_0x20592b['stack']);return null;}});if(_0x23144e['finally']){logger[_0x5e97('0xf')](util[_0x5e97('0x10')](_0x5e97('0x46'),_0x2fc944['arg_1'],_0x2fc944[_0x5e97('0x17')],_0x2fc944[_0x5e97('0x18')],_0x2fc944[_0x5e97('0x19')],_0x2fc944[_0x5e97('0x1a')]));_0x144aba[_0x5e97('0x3b')](_0x23144e['finally']['id'],function(_0x30f193){try{_0x30f193=_0x59f3c2[_0x5e97('0x3c')](_0x30f193);logger[_0x5e97('0x2f')](_0x5e97('0x47'),JSON[_0x5e97('0x31')](_0x30f193,null,0x2));if(_0x30f193&&_0x59f3c2[_0x30f193[_0x5e97('0x20')]]){_0x1fdc62=_0x59f3c2[_0x30f193[_0x5e97('0x20')]](_0x30f193);if(_0x1fdc62){logger['debug']('response',getLogFromObject(_0x1fdc62));return _[_0x5e97('0x43')](_0x1fdc62[_0x5e97('0x42')])?null:_0x1fdc62['result']['toString']();}else{logger[_0x5e97('0xb')](_0x5e97('0x40'),getLogFromObject(_0x1fdc62));return null;}}else{logger[_0x5e97('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x19fe80){logger['error'](_0x19fe80['stack']);return null;}});}logger['info'](util[_0x5e97('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2fc944[_0x5e97('0x1c')],_0x2fc944[_0x5e97('0x17')],_0x2fc944['callerid'],_0x2fc944[_0x5e97('0x19')],_0x2fc944[_0x5e97('0x1a')]));logger[_0x5e97('0xf')](util[_0x5e97('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2fc944[_0x5e97('0x3e')],_0x2fc944[_0x5e97('0x48')],parseInt(_0x2fc944[_0x5e97('0x3f')],0xa)+0x1));_0x2fc944['continueAt'](_0x2fc944[_0x5e97('0x3e')],_0x2fc944['extension'],parseInt(_0x2fc944[_0x5e97('0x3f')],0xa)+0x1);_0x2fc944['close']();}}else{logger[_0x5e97('0xb')](util[_0x5e97('0x10')]('Project\x20%s\x20not\x20published',_0x2fc944[_0x5e97('0x1c')]));_0x2fc944['continueAt'](_0x2fc944[_0x5e97('0x3e')],_0x2fc944['extension'],parseInt(_0x2fc944['priority'],0xa)+0x1);_0x2fc944[_0x5e97('0x33')]();}}else{logger[_0x5e97('0xb')](util[_0x5e97('0x10')]('Project\x20%s\x20not\x20found',_0x2fc944[_0x5e97('0x1c')]));_0x2fc944[_0x5e97('0x49')](_0x2fc944['context'],_0x2fc944['extension'],parseInt(_0x2fc944[_0x5e97('0x3f')],0xa)+0x1);_0x2fc944[_0x5e97('0x33')]();}}function main(){var _0x30f7d1;return utilLicense['getLicense']()[_0x5e97('0x2c')](function(_0x86f625){if(_0x86f625){if(_0x86f625[_0x5e97('0x4a')]){if(_0x86f625[_0x5e97('0x4b')]&&_0x86f625[_0x5e97('0x4b')]>0x0){logger['info'](util['format'](_0x5e97('0x4c'),_0x86f625[_0x5e97('0x4b')]));_0x30f7d1=_0x86f625[_0x5e97('0x4b')];}else{logger['info'](_0x5e97('0x4d'));}}else{logger[_0x5e97('0xf')](_0x5e97('0x4e'));_0x30f7d1=-0x1;}}})[_0x5e97('0x4f')](function(_0x26a1ae){logger[_0x5e97('0xb')](_0x5e97('0x50'),_0x26a1ae['stack']);})['finally'](function(){var _0x4ebc31=require(_0x5e97('0x51'))(config[_0x5e97('0x6')][_0x5e97('0xe')],config['agi']['ip'],_0x30f7d1);_0x4ebc31['on']('error',errorHandler);_0x4ebc31['on'](_0x5e97('0x52'),listeningHandler);_0x4ebc31['on'](_0x5e97('0x53'),connectionHandler);_0x4ebc31['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xc272=['log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','evtHangup','mxGraphModel','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','agi_','substring','debug','stringify','info','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','start','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','127.0.0.1','error','stack'];(function(_0x374202,_0x4d6227){var _0xbc3162=function(_0x2760fa){while(--_0x2760fa){_0x374202['push'](_0x374202['shift']());}};_0xbc3162(++_0x4d6227);}(_0xc272,0xfc));var _0x2c27=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xc272[_0x3e6d5d];return _0x238923;};'use strict';var parser=require(_0x2c27('0x0'));var _=require('lodash');var syncho=require(_0x2c27('0x1'));var util=require(_0x2c27('0x2'));var moment=require('moment');var config=require(_0x2c27('0x3'));var logger=require('../../config/logger')(_0x2c27('0x4'));var utilLicense=require(_0x2c27('0x5'));var rpc=require(_0x2c27('0x6'));var mailRpc=require(_0x2c27('0x7'));var Graph=require(_0x2c27('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x2c27('0x4')],{'ip':_0x2c27('0x9'),'port':0x11dd});function connectionHandler(_0x36b763){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x36b763);agiHandler(_0x36b763);}catch(_0x502d64){logger[_0x2c27('0xa')](_0x502d64[_0x2c27('0xb')]);}});});}function listeningHandler(){console[_0x2c27('0xc')](_0x2c27('0xd'),config[_0x2c27('0x4')][_0x2c27('0xe')]);logger['info'](util[_0x2c27('0xf')](_0x2c27('0x10'),config[_0x2c27('0x4')]['ip'],config['agi'][_0x2c27('0xe')]));}function errorHandler(_0x57e122){if(_0x57e122&&_0x57e122['name']&&_0x57e122[_0x2c27('0x11')]){logger['error'](util[_0x2c27('0xf')](_0x2c27('0x12'),_0x57e122[_0x2c27('0x13')],_0x57e122['message']));}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')](_0x2c27('0x14'),_0x57e122[_0x2c27('0xb')]));}}function closeHandler(){logger['info'](util[_0x2c27('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2c27('0x15')],this[_0x2c27('0x16')],this['callerid'],this['dnid'],this[_0x2c27('0x17')]));try{createSquareReport(this);}catch(_0x5a916e){logger['error'](_0x5a916e[_0x2c27('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x2c27('0xf')](_0x2c27('0x18'),this[_0x2c27('0x15')],this[_0x2c27('0x16')],this[_0x2c27('0x19')],this[_0x2c27('0x1a')],this[_0x2c27('0x17')]));}function hangupHandler(){logger['info'](util[_0x2c27('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x2c27('0x16')],this[_0x2c27('0x19')],this[_0x2c27('0x1a')],this[_0x2c27('0x17')]));this[_0x2c27('0x1b')]=!![];}function getRoot(_0x3d29cd){return parser['toJson'](_0x3d29cd,{'object':!![]})[_0x2c27('0x1c')]['root'];}function addVertex(_0xe89869,_0x53d9fa,_0x14f59f){_0x53d9fa['agicommand']=_0x14f59f;if(_0x53d9fa[_0x2c27('0x1d')]('retry')){_0x53d9fa[_0x2c27('0x1e')]=parseInt(_0x53d9fa[_0x2c27('0x1f')],0xa);}_0xe89869[_0x2c27('0x20')](_[_0x2c27('0x21')](_0x53d9fa,_0x2c27('0x22')));}function initGraph(_0x4b8da3,_0x3f2d56){var _0x269008=new Graph();for(var _0x464f70 in _0x4b8da3){if(_0x4b8da3['hasOwnProperty'](_0x464f70)){if(_[_0x2c27('0x23')](_0x4b8da3[_0x464f70])){for(var _0x505293=0x0;_0x505293<_0x4b8da3[_0x464f70]['length'];_0x505293+=0x1){addVertex(_0x269008,_0x4b8da3[_0x464f70][_0x505293],_0x464f70);}}else{addVertex(_0x269008,_0x4b8da3[_0x464f70],_0x464f70);}}}for(var _0x1f8933=0x0;_0x1f8933<_0x3f2d56[_0x2c27('0x24')];_0x1f8933+=0x1){if(_0x3f2d56[_0x1f8933][_0x2c27('0x25')]&&_0x3f2d56[_0x1f8933][_0x2c27('0x26')]){_0x269008[_0x2c27('0x27')](_0x3f2d56[_0x1f8933][_0x2c27('0x25')],_0x3f2d56[_0x1f8933]['target'],_0x3f2d56[_0x1f8933][_0x2c27('0x28')]);}}return _0x269008;}function getSquareProject(_0x5b76b2,_0x6d2827){rpc[_0x2c27('0x29')](_0x5b76b2)[_0x2c27('0x2a')](function(_0xd25602){_0x6d2827(null,_0xd25602);})['catch'](function(_0x289503){_0x6d2827(null,_0x289503);});}function createSquareReport(_0x480f71,_0x13ebe6){rpc['createSquareReport'](_0x480f71)[_0x2c27('0x2a')](function(_0x3a9a02){if(_0x13ebe6){_0x13ebe6(null,_0x3a9a02);}})[_0x2c27('0x2b')](function(_0x3c1e89){if(_0x13ebe6){_0x13ebe6(null,_0x3c1e89);}});}function setChannelVariables(_0x307eb8){for(var _0x51813a in _0x307eb8){if(_0x307eb8[_0x2c27('0x1d')](_0x51813a)){if(_0x51813a['indexOf'](_0x2c27('0x2c'))===0x0){_0x307eb8[_0x51813a[_0x2c27('0x2d')](0x4)]=_0x307eb8[_0x51813a];delete _0x307eb8[_0x51813a];}}}}function getLogFromObject(_0x3ab979){return util['inspect'](_0x3ab979,{'showHidden':![],'depth':null});}function agiHandler(_0x4985f0){var _0x320bfd,_0x4041d7,_0x2aab81,_0x1303bb,_0x3a9995;logger[_0x2c27('0x2e')]('variables',JSON[_0x2c27('0x2f')](_0x4985f0,null,0x2));logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x31'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4985f0['on'](_0x2c27('0xa'),errorHandler);_0x4985f0['on'](_0x2c27('0x32'),closeHandler);_0x4985f0['on'](_0x2c27('0x33'),timeoutHandler);_0x4985f0[_0x2c27('0x1b')]=![];_0x4985f0['on']('hangup',hangupHandler);var _0x4fc322=getSquareProject[_0x2c27('0x34')](null,_0x4985f0[_0x2c27('0x15')]);if(_0x4fc322){if(_0x4fc322[_0x2c27('0x35')]){_0x320bfd=getRoot(_0x4fc322[_0x2c27('0x35')]);if(_0x320bfd&&_0x320bfd['start']){logger['debug'](_0x2c27('0x36'),JSON[_0x2c27('0x2f')](_0x320bfd,null,0x2));_0x4985f0[_0x2c27('0x37')]=moment()['format'](_0x2c27('0x38'));_0x4041d7=initGraph(_[_0x2c27('0x21')](_0x320bfd,_0x2c27('0x22')),_0x320bfd['mxCell']);_0x2aab81=new Vertices(_0x4985f0,rpc,mailRpc);logger[_0x2c27('0x30')](util[_0x2c27('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4041d7[_0x2c27('0x39')](_0x320bfd[_0x2c27('0x3a')]['id'],function(_0x3b56d7){try{_0x3b56d7=_0x2aab81[_0x2c27('0x3b')](_0x3b56d7);logger[_0x2c27('0x2e')](_0x2c27('0x3c'),JSON[_0x2c27('0x2f')](_0x3b56d7,null,0x2));if(_0x3b56d7[_0x2c27('0x3d')]===_0x2c27('0x3e')){logger[_0x2c27('0x30')](_0x2c27('0x3f'));_0x4985f0['context']=_0x3b56d7[_0x2c27('0x40')]||_0x4985f0['context'];_0x4985f0[_0x2c27('0x41')]=_0x3b56d7[_0x2c27('0x41')];_0x4985f0[_0x2c27('0x42')]=_0x3b56d7[_0x2c27('0x42')]?_0x3b56d7[_0x2c27('0x42')]-0x1:0x1;return null;}else if(_0x3b56d7&&_0x2aab81[_0x3b56d7[_0x2c27('0x3d')]]){_0x3a9995=_0x2aab81[_0x3b56d7[_0x2c27('0x3d')]](_0x3b56d7);logger[_0x2c27('0x30')]('response',JSON[_0x2c27('0x2f')](_0x3a9995,null,0x2));if(_0x3a9995&&_0x3a9995[_0x2c27('0x43')]===AGI_CODE_SUCCESS&&_0x3a9995['result']!==AGI_RESULT_ERROR&&!_0x4985f0['evtHangup']){logger[_0x2c27('0x2e')](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return _[_0x2c27('0x45')](_0x3a9995[_0x2c27('0x46')])?null:_0x3a9995[_0x2c27('0x46')][_0x2c27('0x47')]();}else{logger[_0x2c27('0xa')](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return null;}}else{logger[_0x2c27('0xa')](_0x2c27('0x48'));return null;}}catch(_0x37b759){logger[_0x2c27('0xa')](_0x37b759[_0x2c27('0xb')]);return null;}});if(_0x320bfd[_0x2c27('0x49')]){logger['info'](util['format'](_0x2c27('0x4a'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4041d7['traverseBFS'](_0x320bfd['finally']['id'],function(_0x14bcf6){try{_0x14bcf6=_0x2aab81['clear'](_0x14bcf6);logger[_0x2c27('0x2e')](_0x2c27('0x3c'),JSON['stringify'](_0x14bcf6,null,0x2));if(_0x14bcf6&&_0x2aab81[_0x14bcf6['agicommand']]){_0x3a9995=_0x2aab81[_0x14bcf6['agicommand']](_0x14bcf6);if(_0x3a9995){logger['debug'](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return _[_0x2c27('0x45')](_0x3a9995[_0x2c27('0x46')])?null:_0x3a9995['result'][_0x2c27('0x47')]();}else{logger['error']('response',getLogFromObject(_0x3a9995));return null;}}else{logger[_0x2c27('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x10d209){logger['error'](_0x10d209[_0x2c27('0xb')]);return null;}});}logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x4b'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0['callerid'],_0x4985f0[_0x2c27('0x1a')],_0x4985f0['uniqueid']));logger[_0x2c27('0x30')](util[_0x2c27('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1));_0x4985f0[_0x2c27('0x4c')](_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0['priority'],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')]('Project\x20%s\x20not\x20published',_0x4985f0[_0x2c27('0x15')]));_0x4985f0[_0x2c27('0x4c')](_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')](_0x2c27('0x4d'),_0x4985f0['arg_1']));_0x4985f0[_0x2c27('0x4c')](_0x4985f0['context'],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}function main(){var _0x49cb1f;return utilLicense[_0x2c27('0x4e')]()['then'](function(_0x5b40f1){if(_0x5b40f1){if(_0x5b40f1[_0x2c27('0x4f')]){if(_0x5b40f1[_0x2c27('0x50')]&&_0x5b40f1[_0x2c27('0x50')]>0x0){logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x51'),_0x5b40f1[_0x2c27('0x50')]));_0x49cb1f=_0x5b40f1[_0x2c27('0x50')];}else{logger[_0x2c27('0x30')](_0x2c27('0x52'));}}else{logger[_0x2c27('0x30')](_0x2c27('0x53'));_0x49cb1f=-0x1;}}})[_0x2c27('0x2b')](function(_0x10c60d){logger[_0x2c27('0xa')](_0x2c27('0x54'),_0x10c60d[_0x2c27('0xb')]);})['finally'](function(){var _0x331978=require(_0x2c27('0x55'))(config['agi'][_0x2c27('0xe')],config[_0x2c27('0x4')]['ip'],_0x49cb1f);_0x331978['on'](_0x2c27('0xa'),errorHandler);_0x331978['on'](_0x2c27('0x56'),listeningHandler);_0x331978['on'](_0x2c27('0x57'),connectionHandler);_0x331978['on'](_0x2c27('0x32'),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 836b65d..c3a2161 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 _0x309c=['http','request','then','error','result','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x445b7e,_0x3ea85f){var _0x17d997=function(_0x805f31){while(--_0x805f31){_0x445b7e['push'](_0x445b7e['shift']());}};_0x17d997(++_0x3ea85f);}(_0x309c,0x10c));var _0xc309=function(_0x5e220c,_0x120018){_0x5e220c=_0x5e220c-0x0;var _0xbfbd23=_0x309c[_0x5e220c];return _0xbfbd23;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc309('0x0'));var client=jayson[_0xc309('0x1')][_0xc309('0x2')]({'port':0x232b});function request(_0x1e9092,_0x51984f){return new BPromise(function(_0x10a93e,_0x157525){return client[_0xc309('0x3')](_0x1e9092,_0x51984f)[_0xc309('0x4')](function(_0x7ad7fa){if(_0x7ad7fa[_0xc309('0x5')]){return _0x157525(_0x7ad7fa[_0xc309('0x5')]['message']);}else{return _0x10a93e(_0x7ad7fa[_0xc309('0x6')]);}})[_0xc309('0x7')](function(_0x38190b){return _0x157525(_0x38190b);});});}exports[_0xc309('0x8')]=function(_0x735dfe,_0x3086c1){return request(_0xc309('0x9'),{'account':_0x735dfe,'message':_0x3086c1});}; \ No newline at end of file +var _0x38e5=['jayson/promise','http','then','error','result','SendMail','bluebird'];(function(_0x1ef0cf,_0x261ab7){var _0x2fcec7=function(_0x22a4b6){while(--_0x22a4b6){_0x1ef0cf['push'](_0x1ef0cf['shift']());}};_0x2fcec7(++_0x261ab7);}(_0x38e5,0x99));var _0x538e=function(_0x3fa40d,_0x4ab277){_0x3fa40d=_0x3fa40d-0x0;var _0x494d33=_0x38e5[_0x3fa40d];return _0x494d33;};'use strict';var BPromise=require(_0x538e('0x0'));var jayson=require(_0x538e('0x1'));var client=jayson['client'][_0x538e('0x2')]({'port':0x232b});function request(_0x83802,_0x59587f){return new BPromise(function(_0xb2a2e0,_0x1fb728){return client['request'](_0x83802,_0x59587f)[_0x538e('0x3')](function(_0x1cf28c){if(_0x1cf28c[_0x538e('0x4')]){return _0x1fb728(_0x1cf28c[_0x538e('0x4')]['message']);}else{return _0xb2a2e0(_0x1cf28c[_0x538e('0x5')]);}})['catch'](function(_0x1f599f){return _0x1fb728(_0x1f599f);});});}exports['sendMailMessage']=function(_0x2d85e6,_0x5ea6d3){return request(_0x538e('0x6'),{'account':_0x2d85e6,'message':_0x5ea6d3});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index d0b02bb..6518450 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 _0x3dd3=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','length','split','indexOf','slice','trim','headers','emit','util','stream'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x3dd3,0x1d2));var _0x33dd=function(_0x23d10c,_0x3a1f58){_0x23d10c=_0x23d10c-0x0;var _0x3cf657=_0x3dd3[_0x23d10c];return _0x3cf657;};'use strict';var util=require(_0x33dd('0x0'));var Transform=require(_0x33dd('0x1'))[_0x33dd('0x2')];function AGIReply(_0x53288a){Transform[_0x33dd('0x3')](this,_0x53288a);this[_0x33dd('0x4')]='';this[_0x33dd('0x5')]=![];}util[_0x33dd('0x6')](AGIReply,Transform);AGIReply[_0x33dd('0x7')][_0x33dd('0x8')]=function(_0x358f1c,_0x18d946,_0x396990){var _0x5d7276='\x0a',_0x57c4fe=['\x0a\x0a',_0x33dd('0x9')],_0x12b2cb=-0x1,_0x1adf78=-0x1,_0x1f4801='',_0x446c36=0x0,_0x3b5a63='',_0x83c115='';this[_0x33dd('0x4')]+=_0x358f1c[_0x33dd('0xa')]();_0x3b5a63=this[_0x33dd('0x4')];if(!this[_0x33dd('0x5')]){_0x446c36=0x0;while(_0x57c4fe[_0x446c36]){while((_0x1adf78=_0x3b5a63['indexOf'](_0x57c4fe[_0x446c36]))!=-0x1){_0x1f4801=_0x57c4fe[_0x446c36];_0x83c115=_0x3b5a63['substring'](0x0,_0x1adf78);_0x3b5a63=_0x3b5a63['substring'](_0x1adf78+_0x1f4801[_0x33dd('0xb')]);var _0x4faab6=_0x83c115[_0x33dd('0xc')](_0x5d7276),_0x4496e0=0x0,_0x5b14b4={},_0x1e6e3d='',_0xb4aeba='',_0x31d23f=-0x1;while(_0x4faab6[_0x4496e0]){_0x31d23f=_0x4faab6[_0x4496e0][_0x33dd('0xd')](':');if(_0x31d23f!=-0x1){_0x1e6e3d=_0x4faab6[_0x4496e0][_0x33dd('0xe')](0x0,_0x31d23f)[_0x33dd('0xf')]();_0xb4aeba=_0x4faab6[_0x4496e0]['slice'](_0x31d23f+0x1)['trim']();if(_0x1e6e3d[_0x33dd('0xb')]>0x0){_0x5b14b4[_0x1e6e3d]=_0xb4aeba;}}else{}_0x4496e0++;}this['emit'](_0x33dd('0x10'),_0x5b14b4);this[_0x33dd('0x5')]=!![];}_0x446c36++;}this['_localBuffer']=_0x3b5a63;}else{while((_0x12b2cb=_0x3b5a63[_0x33dd('0xd')](_0x5d7276))!=-0x1){_0x83c115=_0x3b5a63['substring'](0x0,_0x12b2cb);this[_0x33dd('0x11')]('line',_0x83c115);_0x3b5a63=_0x3b5a63['substring'](_0x12b2cb+_0x5d7276[_0x33dd('0xb')]);}this[_0x33dd('0x4')]=_0x3b5a63;}_0x396990();};module['exports']=AGIReply; \ No newline at end of file +var _0xad22=['util','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','substring','length','split','trim','slice','emit','headers','line'];(function(_0x1d0bdd,_0x52c6d1){var _0x205377=function(_0x2ff6fc){while(--_0x2ff6fc){_0x1d0bdd['push'](_0x1d0bdd['shift']());}};_0x205377(++_0x52c6d1);}(_0xad22,0x1ed));var _0x2ad2=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xad22[_0x50e40b];return _0x2608b7;};'use strict';var util=require(_0x2ad2('0x0'));var Transform=require('stream')[_0x2ad2('0x1')];function AGIReply(_0x2292b2){Transform[_0x2ad2('0x2')](this,_0x2292b2);this[_0x2ad2('0x3')]='';this[_0x2ad2('0x4')]=![];}util[_0x2ad2('0x5')](AGIReply,Transform);AGIReply[_0x2ad2('0x6')][_0x2ad2('0x7')]=function(_0x54c4df,_0x1ad0a6,_0x192488){var _0x3624da='\x0a',_0x7ada0c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0xaee54b=-0x1,_0x525470=-0x1,_0x152385='',_0x52efdb=0x0,_0x4b05d7='',_0x431f5c='';this[_0x2ad2('0x3')]+=_0x54c4df['toString']();_0x4b05d7=this[_0x2ad2('0x3')];if(!this[_0x2ad2('0x4')]){_0x52efdb=0x0;while(_0x7ada0c[_0x52efdb]){while((_0x525470=_0x4b05d7[_0x2ad2('0x8')](_0x7ada0c[_0x52efdb]))!=-0x1){_0x152385=_0x7ada0c[_0x52efdb];_0x431f5c=_0x4b05d7['substring'](0x0,_0x525470);_0x4b05d7=_0x4b05d7[_0x2ad2('0x9')](_0x525470+_0x152385[_0x2ad2('0xa')]);var _0x4c867f=_0x431f5c[_0x2ad2('0xb')](_0x3624da),_0x36415d=0x0,_0x527d10={},_0x1aa55b='',_0x399020='',_0x3f06e3=-0x1;while(_0x4c867f[_0x36415d]){_0x3f06e3=_0x4c867f[_0x36415d][_0x2ad2('0x8')](':');if(_0x3f06e3!=-0x1){_0x1aa55b=_0x4c867f[_0x36415d]['slice'](0x0,_0x3f06e3)[_0x2ad2('0xc')]();_0x399020=_0x4c867f[_0x36415d][_0x2ad2('0xd')](_0x3f06e3+0x1)[_0x2ad2('0xc')]();if(_0x1aa55b['length']>0x0){_0x527d10[_0x1aa55b]=_0x399020;}}else{}_0x36415d++;}this[_0x2ad2('0xe')](_0x2ad2('0xf'),_0x527d10);this[_0x2ad2('0x4')]=!![];}_0x52efdb++;}this[_0x2ad2('0x3')]=_0x4b05d7;}else{while((_0xaee54b=_0x4b05d7[_0x2ad2('0x8')](_0x3624da))!=-0x1){_0x431f5c=_0x4b05d7[_0x2ad2('0x9')](0x0,_0xaee54b);this['emit'](_0x2ad2('0x10'),_0x431f5c);_0x4b05d7=_0x4b05d7[_0x2ad2('0x9')](_0xaee54b+_0x3624da[_0x2ad2('0xa')]);}this[_0x2ad2('0x3')]=_0x4b05d7;}_0x192488();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 15fce19..3030fbb 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 _0x13b6=['arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getMailAccountById','MailServerOut','name','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVariable','getSquareOdbcById','getUserById','getSoundById','save_name','getIntervalById','ShowInterval','getSmsAccountById','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge'];(function(_0x24d72c,_0x24fe61){var _0x39c9d6=function(_0x265058){while(--_0x265058){_0x24d72c['push'](_0x24d72c['shift']());}};_0x39c9d6(++_0x24fe61);}(_0x13b6,0xaf));var _0x613b=function(_0x231970,_0x5df805){_0x231970=_0x231970-0x0;var _0x1477ac=_0x13b6[_0x231970];return _0x1477ac;};'use strict';var BPromise=require(_0x613b('0x0'));var moment=require(_0x613b('0x1'));var _=require(_0x613b('0x2'));var util=require(_0x613b('0x3'));var jayson=require(_0x613b('0x4'));var client=jayson[_0x613b('0x5')][_0x613b('0x6')]({'port':0x2329});function request(_0x3f5c71,_0x3d3149){return new BPromise(function(_0x167fc5,_0x4ef416){return client[_0x613b('0x7')](_0x3f5c71,_0x3d3149)[_0x613b('0x8')](function(_0x239697){if(_0x239697['error']){return _0x4ef416(_0x239697[_0x613b('0x9')][_0x613b('0xa')]);}else{return _0x167fc5(_0x239697[_0x613b('0xb')]);}})[_0x613b('0xc')](function(_0xa65380){return _0x4ef416(_0xa65380);});});}exports['getSquareProject']=function(_0x4ada35){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4ada35},'attributes':['production']}});};exports[_0x613b('0xd')]=function(_0x87feb0){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x87feb0},'include':[{'model':_0x613b('0xe'),'as':'Smtp'}],'attributes':['id',_0x613b('0xf'),'email']}});};exports[_0x613b('0x10')]=function(_0xcecf23){return request(_0x613b('0x11'),{'options':{'where':{'id':_0xcecf23},'attributes':[_0x613b('0xf')]}});};exports[_0x613b('0x12')]=function(_0x1934f5){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1934f5},'attributes':[_0x613b('0xf')]}});};exports['getVariableById']=function(_0x5ebace){return request(_0x613b('0x13'),{'options':{'where':{'id':_0x5ebace},'attributes':[_0x613b('0xf')]}});};exports[_0x613b('0x14')]=function(_0x2cabce){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2cabce},'attributes':['dsn']}});};exports[_0x613b('0x15')]=function(_0x4b5256){return request('ShowUser',{'options':{'where':{'id':_0x4b5256},'attributes':[_0x613b('0xf')]}});};exports['getTrunkById']=function(_0x4a07e8){return request('ShowTrunk',{'options':{'where':{'id':_0x4a07e8},'attributes':['name']}});};exports[_0x613b('0x16')]=function(_0x457a1){return request('ShowSound',{'options':{'where':{'id':_0x457a1},'attributes':[_0x613b('0x17')]}});};exports[_0x613b('0x18')]=function(_0x132b89){return request(_0x613b('0x19'),{'options':{'raw':![],'where':{'id':_0x132b89},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x613b('0x1a')]=function(_0x19c5c9){return request('ShowSmsAccount',{'options':{'where':{'id':_0x19c5c9},'attributes':['id',_0x613b('0xf')]}});};exports[_0x613b('0x1b')]=function(_0x393c50){return request(_0x613b('0x1c'),{'body':_0x393c50});};exports['createSquareDetailsReport']=function(_0x229835){return request(_0x613b('0x1d'),{'body':_0x229835});};exports[_0x613b('0x1e')]=function(_0x3f6b80){return request(_0x613b('0x1f'),{'body':_[_0x613b('0x20')](_0x3f6b80,{'project_name':_0x3f6b80[_0x613b('0x21')],'prev_project_name':_0x3f6b80[_0x613b('0x22')]||'','is_subproject':_0x3f6b80[_0x613b('0x22')]?!![]:![],'leaveAt':moment()[_0x613b('0x23')](_0x613b('0x24'))})});};exports['createSquareRecording']=function(_0x1f7ba3){return request(_0x613b('0x25'),{'body':_0x1f7ba3});};exports[_0x613b('0x26')]=function(_0x30b6ed){return request(_0x613b('0x27'),{'body':_0x30b6ed});};exports[_0x613b('0x28')]=function(_0x50a701){return request(_0x613b('0x29'),{'options':{'raw':![],'where':{'phone':_0x50a701[_0x613b('0x2a')],'ListId':_0x50a701['ListId']}}})[_0x613b('0x8')](function(_0x261569){if(_0x261569){return _0x261569;}return request(_0x613b('0x2b'),{'body':_0x50a701});});};exports['getPauseById']=function(_0x4ad21f){return request(_0x613b('0x2c'),{'options':{'where':{'id':_0x4ad21f},'attributes':['name']}});};exports[_0x613b('0x2d')]=function(_0x403390,_0x2131af){return request(_0x613b('0x2e'),{'body':{'interface':_0x2131af},'options':{'where':_0x403390}});};exports[_0x613b('0x2f')]=function(_0x1b02f6,_0x3b2c5e,_0x53e9a2){return request(_0x613b('0x30'),{'body':{'type':_0x3b2c5e,'uniqueid':_0x53e9a2},'options':{'where':_0x1b02f6}});};exports[_0x613b('0x31')]=function(_0x14f705){return request(_0x613b('0x32'),{'body':{},'options':{'where':_0x14f705}});};exports['agentLogout']=function(_0x38b2fe){return request(_0x613b('0x33'),{'body':{},'options':{'where':_0x38b2fe}});}; \ No newline at end of file +var _0x8bb6=['CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','bluebird','moment','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','name','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage'];(function(_0x34f72e,_0xaf909f){var _0x444d63=function(_0x4de80e){while(--_0x4de80e){_0x34f72e['push'](_0x34f72e['shift']());}};_0x444d63(++_0xaf909f);}(_0x8bb6,0x1d3));var _0x68bb=function(_0x24d5a8,_0x3a36b3){_0x24d5a8=_0x24d5a8-0x0;var _0xa26640=_0x8bb6[_0x24d5a8];return _0xa26640;};'use strict';var BPromise=require(_0x68bb('0x0'));var moment=require(_0x68bb('0x1'));var _=require('lodash');var util=require(_0x68bb('0x2'));var jayson=require(_0x68bb('0x3'));var client=jayson[_0x68bb('0x4')]['http']({'port':0x2329});function request(_0x2399d2,_0x3e70de){return new BPromise(function(_0x4689ac,_0xdd3e86){return client[_0x68bb('0x5')](_0x2399d2,_0x3e70de)[_0x68bb('0x6')](function(_0x2f018d){if(_0x2f018d[_0x68bb('0x7')]){return _0xdd3e86(_0x2f018d[_0x68bb('0x7')][_0x68bb('0x8')]);}else{return _0x4689ac(_0x2f018d[_0x68bb('0x9')]);}})[_0x68bb('0xa')](function(_0x3ca3ad){return _0xdd3e86(_0x3ca3ad);});});}exports[_0x68bb('0xb')]=function(_0x4f5478){return request(_0x68bb('0xc'),{'options':{'raw':![],'where':{'name':_0x4f5478},'attributes':['production']}});};exports[_0x68bb('0xd')]=function(_0x2b6d84){return request(_0x68bb('0xe'),{'options':{'raw':![],'where':{'id':_0x2b6d84},'include':[{'model':_0x68bb('0xf'),'as':_0x68bb('0x10')}],'attributes':['id','name','email']}});};exports[_0x68bb('0x11')]=function(_0x2670cc){return request('ShowSquareProject',{'options':{'where':{'id':_0x2670cc},'attributes':['name']}});};exports[_0x68bb('0x12')]=function(_0x3b1654){return request(_0x68bb('0x13'),{'options':{'where':{'id':_0x3b1654},'attributes':['name']}});};exports[_0x68bb('0x14')]=function(_0x3afd4e){return request(_0x68bb('0x15'),{'options':{'where':{'id':_0x3afd4e},'attributes':[_0x68bb('0x16')]}});};exports[_0x68bb('0x17')]=function(_0x3c69aa){return request(_0x68bb('0x18'),{'options':{'where':{'id':_0x3c69aa},'attributes':[_0x68bb('0x19')]}});};exports[_0x68bb('0x1a')]=function(_0x5733f6){return request(_0x68bb('0x1b'),{'options':{'where':{'id':_0x5733f6},'attributes':[_0x68bb('0x16')]}});};exports[_0x68bb('0x1c')]=function(_0xed07b0){return request(_0x68bb('0x1d'),{'options':{'where':{'id':_0xed07b0},'attributes':[_0x68bb('0x16')]}});};exports['getSoundById']=function(_0x48924a){return request(_0x68bb('0x1e'),{'options':{'where':{'id':_0x48924a},'attributes':[_0x68bb('0x1f')]}});};exports[_0x68bb('0x20')]=function(_0x283680){return request(_0x68bb('0x21'),{'options':{'raw':![],'where':{'id':_0x283680},'include':[{'model':_0x68bb('0x22'),'as':'Intervals'}]}});};exports[_0x68bb('0x23')]=function(_0x10bc89){return request('ShowSmsAccount',{'options':{'where':{'id':_0x10bc89},'attributes':['id','name']}});};exports[_0x68bb('0x24')]=function(_0x383839){return request(_0x68bb('0x25'),{'body':_0x383839});};exports[_0x68bb('0x26')]=function(_0x30d3d2){return request('CreateSquareDetailsReport',{'body':_0x30d3d2});};exports[_0x68bb('0x27')]=function(_0x24005c){return request(_0x68bb('0x28'),{'body':_[_0x68bb('0x29')](_0x24005c,{'project_name':_0x24005c['arg_1'],'prev_project_name':_0x24005c[_0x68bb('0x2a')]||'','is_subproject':_0x24005c[_0x68bb('0x2a')]?!![]:![],'leaveAt':moment()[_0x68bb('0x2b')](_0x68bb('0x2c'))})});};exports['createSquareRecording']=function(_0x329572){return request('CreateSquareRecording',{'body':_0x329572});};exports[_0x68bb('0x2d')]=function(_0x488c9e){return request(_0x68bb('0x2e'),{'body':_0x488c9e});};exports[_0x68bb('0x2f')]=function(_0xc04ffb){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xc04ffb[_0x68bb('0x30')],'ListId':_0xc04ffb[_0x68bb('0x31')]}}})['then'](function(_0x39b2a8){if(_0x39b2a8){return _0x39b2a8;}return request(_0x68bb('0x32'),{'body':_0xc04ffb});});};exports[_0x68bb('0x33')]=function(_0x42cbae){return request(_0x68bb('0x34'),{'options':{'where':{'id':_0x42cbae},'attributes':[_0x68bb('0x16')]}});};exports['agentLogin']=function(_0x35d323,_0x37a922){return request(_0x68bb('0x35'),{'body':{'interface':_0x37a922},'options':{'where':_0x35d323}});};exports[_0x68bb('0x36')]=function(_0x526c52,_0xf31a2c,_0xe46507){return request(_0x68bb('0x37'),{'body':{'type':_0xf31a2c,'uniqueid':_0xe46507},'options':{'where':_0x526c52}});};exports[_0x68bb('0x38')]=function(_0x5c6743){return request('UnpauseUser',{'body':{},'options':{'where':_0x5c6743}});};exports['agentLogout']=function(_0x3f38b2){return request('LogoutUser',{'body':{},'options':{'where':_0x3f38b2}});}; \ 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 220467c..23cc0d7 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 _0x1059=['./polly','./lex'];(function(_0x366162,_0xc606b6){var _0x528966=function(_0x26ae87){while(--_0x26ae87){_0x366162['push'](_0x366162['shift']());}};_0x528966(++_0xc606b6);}(_0x1059,0x176));var _0x9105=function(_0x21bc27,_0x20c9da){_0x21bc27=_0x21bc27-0x0;var _0x56790c=_0x1059[_0x21bc27];return _0x56790c;};var polly=require(_0x9105('0x0'));var lex=require(_0x9105('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbe2c=['./lex','./polly'];(function(_0x378ad0,_0x44b4d2){var _0x1a65cf=function(_0x47a4a6){while(--_0x47a4a6){_0x378ad0['push'](_0x378ad0['shift']());}};_0x1a65cf(++_0x44b4d2);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x549c64,_0x4b27ae){_0x549c64=_0x549c64-0x0;var _0x4184e9=_0xbe2c[_0x549c64];return _0x4184e9;};var polly=require(_0xcbe2('0x0'));var lex=require(_0xcbe2('0x1'));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 0ddccf5..cc3ca53 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 _0xe706=['exports','./lib/api'];(function(_0x24a145,_0x4fa848){var _0x407a33=function(_0x3842a6){while(--_0x3842a6){_0x24a145['push'](_0x24a145['shift']());}};_0x407a33(++_0x4fa848);}(_0xe706,0xa3));var _0x6e70=function(_0x17a842,_0x1ac67a){_0x17a842=_0x17a842-0x0;var _0x142199=_0xe706[_0x17a842];return _0x142199;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file +var _0x5ff3=['exports'];(function(_0x4735d7,_0x121e5a){var _0x1ac3ca=function(_0x405e42){while(--_0x405e42){_0x4735d7['push'](_0x4735d7['shift']());}};_0x1ac3ca(++_0x121e5a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x41b6e3,_0x2c8673){_0x41b6e3=_0x41b6e3-0x0;var _0x2883b8=_0x5ff3[_0x41b6e3];return _0x2883b8;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);}; \ 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 a8c259b..7bf92d8 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(_0x46a266,_0x499e9f){var _0x819f86=function(_0x1ffa44){while(--_0x1ffa44){_0x46a266['push'](_0x46a266['shift']());}};_0x819f86(++_0x499e9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x748214,_0x57f26e){var _0x4cc94a=function(_0x32d26a){while(--_0x32d26a){_0x748214['push'](_0x748214['shift']());}};_0x4cc94a(++_0x57f26e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 6e55ff4..d2738c6 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 _0x21b6=['./lib/api','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x21b6,0x1ce));var _0x621b=function(_0x244188,_0x5f0b9a){_0x244188=_0x244188-0x0;var _0x2f6270=_0x21b6[_0x244188];return _0x2f6270;};'use strict';var polly=require(_0x621b('0x0'));module[_0x621b('0x1')]=function(_0xd1437a,_0xf24ce0,_0x47f830,_0x110961,_0x5c60b2,_0x4343bf,_0x3f8875){return polly(_0xd1437a,_0xf24ce0,_0x47f830,_0x110961,_0x5c60b2,_0x4343bf,_0x3f8875);}; \ No newline at end of file +var _0x66dc=['./lib/api','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x66dc,0xa2));var _0xc66d=function(_0x5edac0,_0x4140fb){_0x5edac0=_0x5edac0-0x0;var _0x194236=_0x66dc[_0x5edac0];return _0x194236;};'use strict';var polly=require(_0xc66d('0x0'));module[_0xc66d('0x1')]=function(_0x1cf60e,_0x19019e,_0x2d67ba,_0xf7f1ef,_0x21eb7f,_0xd4ef40,_0x49e734){return polly(_0x1cf60e,_0x19019e,_0x2d67ba,_0xf7f1ef,_0x21eb7f,_0xd4ef40,_0x49e734);}; \ 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 b276037..c9de0bd 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 _0x8229=['mp3','path','bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x18afdb,_0xa73905){var _0x4f22e5=function(_0xdf86d9){while(--_0xdf86d9){_0x18afdb['push'](_0x18afdb['shift']());}};_0x4f22e5(++_0xa73905);}(_0x8229,0xbc));var _0x9822=function(_0x3fbfc4,_0x33991f){_0x3fbfc4=_0x3fbfc4-0x0;var _0x445130=_0x8229[_0x3fbfc4];return _0x445130;};'use strict';var fs=require('fs');var path=require(_0x9822('0x0'));var BPromise=require(_0x9822('0x1'));var rs=require(_0x9822('0x2'));var AWS=require(_0x9822('0x3'));function pollyResult(_0x5872fb,_0x4722ce,_0x61d1e7){return new BPromise(function(_0x46f91,_0x13265a){_0x5872fb['synthesizeSpeech'](_0x4722ce,function(_0x5e1476,_0x1ce4ff){if(_0x5e1476){_0x13265a(_0x5e1476);}else if(_0x1ce4ff){if(_0x1ce4ff[_0x9822('0x4')]instanceof Buffer){fs['writeFile'](_0x61d1e7,_0x1ce4ff[_0x9822('0x4')],function(_0x28c1ea){if(_0x28c1ea){_0x13265a(_0x28c1ea);}else{_0x46f91();}});}else{_0x13265a(new Error(_0x9822('0x5')));}}else{_0x13265a(new Error(_0x9822('0x6')));}});});}module[_0x9822('0x7')]=function(_0x495d29,_0x3ffbd6,_0x6af6ea,_0x26cf7c,_0xa03aed,_0x39e8bc,_0x43f920){var _0x13c81e=new AWS[(_0x9822('0x8'))]({'accessKeyId':_0x495d29,'secretAccessKey':_0x3ffbd6,'region':_0x6af6ea});var _0xd22a41={'Text':_0xa03aed,'TextType':_0x39e8bc||_0x9822('0x9'),'OutputFormat':_0x9822('0xa'),'VoiceId':_0x26cf7c};return pollyResult(_0x13c81e,_0xd22a41,_0x43f920);}; \ No newline at end of file +var _0x17ea=['exports','Polly','text','mp3','path','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x30c260,_0xf32209){var _0x126897=function(_0xa7f2c8){while(--_0xa7f2c8){_0x30c260['push'](_0x30c260['shift']());}};_0x126897(++_0xf32209);}(_0x17ea,0x17a));var _0xa17e=function(_0x3409cc,_0x48a866){_0x3409cc=_0x3409cc-0x0;var _0x8bbcd0=_0x17ea[_0x3409cc];return _0x8bbcd0;};'use strict';var fs=require('fs');var path=require(_0xa17e('0x0'));var BPromise=require('bluebird');var rs=require(_0xa17e('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x1c987d,_0x4a7fac,_0x4d0481){return new BPromise(function(_0x3c3bd4,_0x1ae9db){_0x1c987d[_0xa17e('0x2')](_0x4a7fac,function(_0x4c872a,_0x5ebf66){if(_0x4c872a){_0x1ae9db(_0x4c872a);}else if(_0x5ebf66){if(_0x5ebf66[_0xa17e('0x3')]instanceof Buffer){fs[_0xa17e('0x4')](_0x4d0481,_0x5ebf66[_0xa17e('0x3')],function(_0x2cad85){if(_0x2cad85){_0x1ae9db(_0x2cad85);}else{_0x3c3bd4();}});}else{_0x1ae9db(new Error(_0xa17e('0x5')));}}else{_0x1ae9db(new Error(_0xa17e('0x6')));}});});}module[_0xa17e('0x7')]=function(_0x565776,_0x301927,_0x4c5c2f,_0x5d4770,_0x2a3801,_0x38d30c,_0xd36801){var _0x2532b8=new AWS[(_0xa17e('0x8'))]({'accessKeyId':_0x565776,'secretAccessKey':_0x301927,'region':_0x4c5c2f});var _0x4aabde={'Text':_0x2a3801,'TextType':_0x38d30c||_0xa17e('0x9'),'OutputFormat':_0xa17e('0xa'),'VoiceId':_0x5d4770};return pollyResult(_0x2532b8,_0x4aabde,_0xd36801);}; \ 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 ce4ee18..1531b72 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x54455f,_0x76d3f2,_0x24edfd,_0x46f0ca){return asr(_0x54455f,_0x76d3f2,_0x24edfd);}; \ No newline at end of file +var _0x5738=['./lib/api','exports'];(function(_0x47275c,_0x4bd743){var _0x1e892f=function(_0x3ff529){while(--_0x3ff529){_0x47275c['push'](_0x47275c['shift']());}};_0x1e892f(++_0x4bd743);}(_0x5738,0x70));var _0x8573=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5738[_0x28107d];return _0x2b1cbe;};'use strict';var asr=require(_0x8573('0x0'));module[_0x8573('0x1')]=function(_0x367227,_0x433fd6,_0x1e2292,_0x5f2f3a){return asr(_0x367227,_0x433fd6,_0x1e2292);}; \ 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 280810b..b3d7e51 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 _0xe829=['filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe829,0x1d8));var _0x9e82=function(_0x36cf3c,_0x317ae3){_0x36cf3c=_0x36cf3c-0x0;var _0x2a2c00=_0xe829[_0x36cf3c];return _0x2a2c00;};'use strict';var url=require(_0x9e82('0x0'));var BPromise=require(_0x9e82('0x1'));var fs=require('fs');var host=_0x9e82('0x2');module['exports']=function(_0x559076,_0xf56525,_0x337730){return new BPromise(function(_0x1b47d8,_0x168d3e){var _0x31591a;if(typeof _0x559076!==_0x9e82('0x3')||_0x559076['length']===0x0){return _0x168d3e(_0x9e82('0x4'));}if(typeof _0xf56525!==_0x9e82('0x3')||_0xf56525[_0x9e82('0x5')]===0x0){return _0x168d3e(_0x9e82('0x6'));}if(typeof _0x337730!==_0x9e82('0x7')&&(typeof _0x337730!=='string'||_0x337730[_0x9e82('0x5')]===0x0)){return _0x168d3e('lang\x20should\x20be\x20a\x20string');}try{_0x31591a=fs[_0x9e82('0x8')](_0x559076)[_0x9e82('0x9')]('base64');}catch(_0x5965b0){return _0x168d3e(_0x5965b0);}return _0x1b47d8({'method':_0x9e82('0xa'),'uri':host+_0x9e82('0xb')+_0xf56525,'body':{'config':{'encoding':_0x9e82('0xc'),'sampleRateHertz':_0x9e82('0xd'),'languageCode':_0x337730},'audio':{'content':_0x31591a}},'json':!![]});});}; \ No newline at end of file +var _0xde56=['url','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','toString','base64','POST','LINEAR16','8000'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0xde56,0x144));var _0x6de5=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xde56[_0x1d8119];return _0x3e30f6;};'use strict';var url=require(_0x6de5('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6de5('0x1');module[_0x6de5('0x2')]=function(_0x2d8342,_0x44082d,_0x2484e4){return new BPromise(function(_0x30b0d7,_0x1cdb30){var _0x382a2a;if(typeof _0x2d8342!==_0x6de5('0x3')||_0x2d8342[_0x6de5('0x4')]===0x0){return _0x1cdb30('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x44082d!==_0x6de5('0x3')||_0x44082d[_0x6de5('0x4')]===0x0){return _0x1cdb30(_0x6de5('0x5'));}if(typeof _0x2484e4!==_0x6de5('0x6')&&(typeof _0x2484e4!==_0x6de5('0x3')||_0x2484e4[_0x6de5('0x4')]===0x0)){return _0x1cdb30('lang\x20should\x20be\x20a\x20string');}try{_0x382a2a=fs['readFileSync'](_0x2d8342)[_0x6de5('0x7')](_0x6de5('0x8'));}catch(_0x1eed8f){return _0x1cdb30(_0x1eed8f);}return _0x30b0d7({'method':_0x6de5('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x44082d,'body':{'config':{'encoding':_0x6de5('0xa'),'sampleRateHertz':_0x6de5('0xb'),'languageCode':_0x2484e4},'audio':{'content':_0x382a2a}},'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 a2be242..2661358 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 _0xb131=['exports','./asr'];(function(_0x843880,_0x1516d1){var _0x49943f=function(_0x4fc04b){while(--_0x4fc04b){_0x843880['push'](_0x843880['shift']());}};_0x49943f(++_0x1516d1);}(_0xb131,0x171));var _0x1b13=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0xb131[_0xaf025d];return _0x1c77cb;};var asr=require(_0x1b13('0x0'));module[_0x1b13('0x1')]={'asr':asr}; \ No newline at end of file +var _0x69c2=['exports'];(function(_0x54de3a,_0x2a34c9){var _0x4ac73d=function(_0x3f6031){while(--_0x3f6031){_0x54de3a['push'](_0x54de3a['shift']());}};_0x4ac73d(++_0x2a34c9);}(_0x69c2,0x127));var _0x269c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x69c2[_0x397e5f];return _0x5302b8;};var asr=require('./asr');module[_0x269c('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 e7fa9e7..e5cc7e6 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 _0x7559=['fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','AudioFromTts','dirName','bluebird','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','protocol','https:','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish\x20download\x20file','unlink','pipe','end','host','WHAT_EVER','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','action','fulfillment','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','languageCode','intentDetectionConfidence'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x7559,0x1b5));var _0x9755=function(_0x281935,_0x1ef2f6){_0x281935=_0x281935-0x0;var _0x1d44da=_0x7559[_0x281935];return _0x1d44da;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x9755('0x0'));var dialogflow=require(_0x9755('0x1'));var fs=require('fs');var http=require(_0x9755('0x2'));var https=require(_0x9755('0x3'));var md5=require(_0x9755('0x4'));var path=require('path');var querystring=require(_0x9755('0x5'));var rp=require(_0x9755('0x6'));var rs=require(_0x9755('0x7'));var sox=require(_0x9755('0x8'));var tts=require(_0x9755('0x9'));var urlParse=require(_0x9755('0xa'))[_0x9755('0xb')];var util=require(_0x9755('0xc'));var aws=require(_0x9755('0xd'));var google=require(_0x9755('0xe'));var sestek=require(_0x9755('0xf'));var tilde=require(_0x9755('0x10'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x9755('0x11');function downloadFile(_0x526bd8,_0x5a2715){return new BPromise(function(_0x3e4206,_0x4f0262){var _0x169c2d=urlParse(_0x526bd8);var _0x4f0786=_0x169c2d[_0x9755('0x12')]===_0x9755('0x13')?https:http;var _0x99bc41={'host':_0x169c2d['host'],'path':_0x169c2d[_0x9755('0x14')],'headers':{'user-agent':'WHAT_EVER'}};_0x4f0786[_0x9755('0x15')](_0x99bc41,function(_0x2923bd){if(_0x2923bd[_0x9755('0x16')]!==0xc8){logger[_0x9755('0x17')](_0x9755('0x18')+_0x526bd8+_0x9755('0x19')+_0x2923bd[_0x9755('0x16')]+'\x20('+_0x2923bd[_0x9755('0x1a')]+')');_0x4f0262(new Error(_0x9755('0x18')+_0x526bd8+'\x20failed,\x20status\x20code\x20=\x20'+_0x2923bd[_0x9755('0x16')]+'\x20('+_0x2923bd[_0x9755('0x1a')]+')'));return;}var _0x20a686=fs[_0x9755('0x1b')](_0x5a2715);_0x20a686['on']('finish',function(){logger['info'](_0x9755('0x1c'));_0x20a686['close'](_0x3e4206);});_0x20a686['on'](_0x9755('0x17'),function(_0x54ac52){fs[_0x9755('0x1d')](_0x5a2715);logger[_0x9755('0x17')]('download\x20error',_0x54ac52);_0x4f0262(_0x54ac52);});_0x2923bd[_0x9755('0x1e')](_0x20a686);})['on'](_0x9755('0x17'),function(_0x17ef9c){logger[_0x9755('0x17')](_0x17ef9c);_0x4f0262(_0x17ef9c);})[_0x9755('0x1f')]();});}function uploadFile(_0x44a9ed){return new BPromise(function(_0x5e260d,_0x56869c){var _0x476546=urlParse(_0x44a9ed);var _0x4df807=_0x476546['protocol']===_0x9755('0x13')?https:http;var _0x553740={'host':_0x476546[_0x9755('0x20')],'path':_0x476546['path'],'headers':{'user-agent':_0x9755('0x21')}};_0x4df807[_0x9755('0x15')](_0x553740,function(_0x5c1a82){if(_0x5c1a82[_0x9755('0x16')]!==0xc8){_0x56869c(new Error(_0x9755('0x18')+_0x44a9ed+_0x9755('0x19')+_0x5c1a82[_0x9755('0x16')]+'\x20('+_0x5c1a82[_0x9755('0x1a')]+')'));return;}var _0x14f374='';_0x5c1a82['on'](_0x9755('0x22'),function(_0x45c117){_0x14f374+=_0x45c117;});_0x5c1a82['on']('end',function(){_0x5e260d(_0x14f374);});})['on']('error',function(_0x125816){_0x56869c(_0x125816);})[_0x9755('0x1f')]();});}function convertFile(_0x1bd75b,_0x306240){return new BPromise(function(_0x2c8586,_0x3c0034){var _0x1da816=sox[_0x9755('0x23')](_0x1bd75b,_0x306240,{'sampleRate':0x1f40,'format':_0x9755('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1da816['on'](_0x9755('0x17'),function(_0x40ade3){logger['error'](_0x9755('0x25'),_0x40ade3);_0x3c0034(_0x40ade3);});_0x1da816['on'](_0x9755('0x1f'),function(){logger[_0x9755('0x26')](_0x9755('0x27'));_0x2c8586();});_0x1da816[_0x9755('0x28')]();});}function base64Decode(_0x3fb242,_0x4aa09b){var _0xfdf65a=path[_0x9755('0x29')](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+_0x9755('0x2c'));fs[_0x9755('0x2d')](_0xfdf65a,_0x3fb242,_0x9755('0x2e'));return convertFile(_0xfdf65a,_0x4aa09b)['then'](function(){try{fs[_0x9755('0x1d')](_0xfdf65a);fs[_0x9755('0x2f')](_0x4aa09b,_0x9755('0x30'));}catch(_0x10804c){logger[_0x9755('0x17')](_0x10804c);}return _0x4aa09b[_0x9755('0x31')]('.')[0x0];});}function base64Encode(_0xfcece6){var _0x8c7a03=fs['readFileSync'](_0xfcece6);return new Buffer(_0x8c7a03)[_0x9755('0x32')]('base64');}exports[_0x9755('0x33')]=function(_0x4f02a8,_0x4a567e,_0x427dc6,_0x313210,_0xf1c15e,_0x36c32f){var _0x469226,_0x13fe12;var _0x5a3530=_0x9755('0x34');var _0x1added=_0x9755('0x35')+_0x4f02a8;var _0x5daa8b={};if(_0x4a567e===_0x9755('0x36')){_0x5daa8b[_0x9755('0x37')]={'ssml':_0x427dc6};}else{_0x5daa8b[_0x9755('0x37')]={'text':_0x427dc6};};_0x5daa8b[_0x9755('0x38')]={'languageCode':_0x313210,'ssmlGender':_0xf1c15e};_0x5daa8b[_0x9755('0x39')]={'audioEncoding':_0x9755('0x3a'),'sampleRateHertz':0x1f40};var _0x1122bf={'url':_0x5a3530+_0x9755('0x3b')+_0x1added,'method':_0x9755('0x3c'),'json':!![],'body':_0x5daa8b};return rp(_0x1122bf)[_0x9755('0x3d')](function(_0x46b644){return new BPromise(function(_0x2d8cff,_0x4bf198){_0x469226=path['resolve'](__dirname,_0x9755('0x2a'),rs['generate'](0x4)+'.mp3');var _0x26b76c=Buffer[_0x9755('0x3e')](_0x46b644[_0x9755('0x3f')],_0x9755('0x2e'));return fs[_0x9755('0x40')](_0x469226,_0x26b76c,function(_0x2a9b38){_0x4bf198(_0x2a9b38);},function(_0x2ef7fb){fs[_0x9755('0x2f')](_0x469226,_0x9755('0x30'));_0x2d8cff(_0x2ef7fb);});});})[_0x9755('0x3d')](function(_0x6c9037){_0x13fe12=path[_0x9755('0x29')](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+'.wav');return convertFile(_0x469226,_0x13fe12);})[_0x9755('0x3d')](function(){try{fs[_0x9755('0x1d')](_0x469226);fs['chmodSync'](_0x13fe12,_0x9755('0x30'));}catch(_0xa7f1e1){logger[_0x9755('0x17')](_0xa7f1e1);}logger[_0x9755('0x26')](_0x9755('0x41'),_0x13fe12[_0x9755('0x31')]('.')[0x0]);return _0x13fe12[_0x9755('0x31')]('.')[0x0];});};exports[_0x9755('0x42')]=function(_0x3e4652,_0x5c8e0a){var _0x2c9843=_0x9755('0x43');var _0x428dbc,_0x584c69;var _0x5a9e5e;var _0x1fb11d={'encoding':_0x9755('0x44'),'method':'POST','timeout':0x2710,'url':_0x2c9843,'headers':{'Content-Type':_0x9755('0x45')},'body':_0x9755('0x46')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x9755('0x47')]([_0x3e4652,_0x5c8e0a||'en',![],_0x9755('0x48')]),null,_0x9755('0x49')]]]))};return rp(_0x1fb11d)['then'](function(_0x504a6b){try{_0x5a9e5e=eval(_0x504a6b[_0x9755('0x4a')](0x5))[0x0][0x2];}catch(_0x5c67d5){throw new Error(_0x9755('0x4b')+_0x504a6b['data']);}if(!_0x5a9e5e){if(_0x3e4652['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x9755('0x4c')+_0x5c8e0a+'\x22\x20might\x20not\x20exist');}}try{_0x5a9e5e=eval(_0x5a9e5e)[0x0];}catch(_0x23eebf){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x2d7e1e=_0x5a9e5e;_0x428dbc=path[_0x9755('0x29')](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+'.mp3');fs[_0x9755('0x2d')](_0x428dbc,_0x5a9e5e,{'encoding':_0x9755('0x2e')});_0x584c69=path[_0x9755('0x29')](__dirname,'tmp',rs['generate'](0x4)+_0x9755('0x2c'));return convertFile(_0x428dbc,_0x584c69);})[_0x9755('0x3d')](function(){try{fs[_0x9755('0x1d')](_0x428dbc);fs['chmodSync'](_0x584c69,'777');}catch(_0xaf1f58){logger[_0x9755('0x17')](_0xaf1f58);}logger[_0x9755('0x26')](_0x9755('0x4d'),_0x584c69[_0x9755('0x31')]('.')[0x0]);return _0x584c69['split']('.')[0x0];});};exports[_0x9755('0x4e')]=function(_0x5e4833,_0x5ce195,_0x51fa86){return google[_0x9755('0x4f')](_0x5e4833,_0x5ce195,_0x51fa86)['then'](function(_0x149300){logger[_0x9755('0x26')](_0x149300['uri']);return rp(_0x149300);})['then'](function(_0x31c020){var _0x40c5a0='';var _0x424988=0x0;try{fs[_0x9755('0x1d')](_0x5e4833);}catch(_0x558230){logger[_0x9755('0x17')](_0x558230);}if(_0x31c020&&_0x31c020['results']){_0x40c5a0=_0x31c020[_0x9755('0x50')][_0x9755('0x51')](function(_0x2da0cc){return _0x2da0cc&&_0x2da0cc[_0x9755('0x52')][0x0]&&_0x2da0cc[_0x9755('0x52')][0x0]['transcript']?_0x2da0cc['alternatives'][0x0][_0x9755('0x53')]:'';})['join']('\x0a');_0x424988=_0x31c020[_0x9755('0x50')]['map'](function(_0x42364c){return _0x42364c&&_0x42364c['alternatives'][0x0]&&_0x42364c[_0x9755('0x52')][0x0][_0x9755('0x54')]?_0x42364c[_0x9755('0x52')][0x0][_0x9755('0x54')]:0x0;})[_0x9755('0x55')]('\x0a');}logger[_0x9755('0x26')](_0x9755('0x56'),_0x40c5a0);logger[_0x9755('0x26')](_0x9755('0x57'),_0x424988);return{'transcript':_0x40c5a0,'confidence':_0x424988};})['catch'](function(_0x3265c4){logger[_0x9755('0x17')](_0x9755('0x58'),_0x3265c4['statusCode'],_0x3265c4[_0x9755('0x59')],_0x3265c4[_0x9755('0x5a')]);});};exports['googleDialogflow']=function(_0x1fca4f,_0x2db03c,_0x54e87b,_0x421041){var _0xe57fff=apiai(_0x2db03c,{'language':_0x421041||'en'});return _0xe57fff[_0x9755('0x5b')](_0x54e87b,{'sessionId':md5(_0x1fca4f)})['then'](function(_0x370e93){logger[_0x9755('0x26')](JSON[_0x9755('0x47')](_0x370e93));return{'source':_0x370e93[_0x9755('0x5c')][_0x9755('0x5d')],'resolvedQuery':_0x370e93[_0x9755('0x5c')][_0x9755('0x5e')],'action':_0x370e93[_0x9755('0x5c')][_0x9755('0x5f')],'actionIncomplete':_0x370e93['result']['actionIncomplete'],'speech':_0x370e93[_0x9755('0x5c')][_0x9755('0x60')]['speech'],'score':_0x370e93[_0x9755('0x5c')][_0x9755('0x61')],'statusCode':_0x370e93[_0x9755('0x62')][_0x9755('0x63')],'endConversation':_0x370e93[_0x9755('0x5c')]['metadata'][_0x9755('0x64')]||![],'isFallbackIntent':_0x370e93[_0x9755('0x5c')][_0x9755('0x65')][_0x9755('0x66')]};});};exports[_0x9755('0x67')]=function(_0x1b6b33,_0x4b137e,_0x149a56,_0x1dbbe4,_0x75f61a,_0x2ef9f6){var _0x5da0c7=_0x1dbbe4[_0x9755('0x68')](/\\n/g,'\x0a');var _0x215f8c={'credentials':{'private_key':_0x5da0c7,'client_email':_0x149a56}};var _0x5b2f80=new dialogflow[(_0x9755('0x69'))](_0x215f8c);var _0xaae38b=_0x5b2f80[_0x9755('0x6a')](_0x4b137e,md5(_0x1b6b33));var _0x32ea0d={'session':_0xaae38b,'queryInput':{'text':{'text':_0x75f61a,'languageCode':_0x2ef9f6}}};return _0x5b2f80[_0x9755('0x6b')](_0x32ea0d)[_0x9755('0x3d')](function(_0x3150d3){if(_0x3150d3&&_0x3150d3[_0x9755('0x6c')]){logger['info']('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x3150d3));var _0x32578e=_0x3150d3[0x0];if(_0x32578e){var _0x4cfd10={'action':_0x32578e[_0x9755('0x6d')]['action'],'allRequiredParamsPresent':_0x32578e[_0x9755('0x6d')][_0x9755('0x6e')],'endConversation':_0x32578e['queryResult'][_0x9755('0x6f')]&&_0x32578e[_0x9755('0x6d')][_0x9755('0x6f')][_0x9755('0x70')]?_0x32578e[_0x9755('0x6d')][_0x9755('0x6f')][_0x9755('0x70')][_0x9755('0x71')][_0x9755('0x72')]:![],'fulfillmentText':_0x32578e['queryResult']['fulfillmentText'],'intentName':_0x32578e['queryResult'][_0x9755('0x73')][_0x9755('0x59')],'intentDisplayName':_0x32578e['queryResult'][_0x9755('0x73')]['displayName'],'isFallbackIntent':_0x32578e[_0x9755('0x6d')]['intent'][_0x9755('0x74')],'languageCode':_0x32578e['queryResult'][_0x9755('0x75')],'queryText':_0x32578e[_0x9755('0x6d')]['queryText'],'responseId':_0x32578e['responseId'],'score':_0x32578e[_0x9755('0x6d')][_0x9755('0x76')],'speech':_0x32578e['queryResult'][_0x9755('0x77')],'providerResponse':JSON[_0x9755('0x47')](_0x3150d3)};return _0x4cfd10;}}});};exports[_0x9755('0x78')]=function(_0x4dd8d0,_0x470595,_0x4f3e16,_0x259cf7){return tilde[_0x9755('0x4f')](_0x4dd8d0,_0x470595,_0x4f3e16,_0x259cf7)[_0x9755('0x3d')](function(_0x6a82f3){try{fs[_0x9755('0x1d')](_0x4dd8d0);}catch(_0x140685){logger[_0x9755('0x17')](_0x140685);}logger[_0x9755('0x26')](_0x9755('0x79'),_0x6a82f3[_0x9755('0x53')]);logger['info'](_0x9755('0x7a'),_0x6a82f3[_0x9755('0x54')]);return _0x6a82f3;});};exports[_0x9755('0x7b')]=function(_0x447a33,_0x34930,_0x43a252,_0x50426c,_0x2b21f6,_0x233985){var _0x57f0b6=path[_0x9755('0x29')](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+_0x9755('0x7c'));var _0x44a959;return aws[_0x9755('0x7d')](_0x447a33,_0x34930,_0x43a252,_0x50426c,_0x2b21f6,_0x233985,_0x57f0b6)[_0x9755('0x3d')](function(){_0x44a959=path[_0x9755('0x29')](__dirname,_0x9755('0x2a'),rs['generate'](0x4)+_0x9755('0x2c'));return convertFile(_0x57f0b6,_0x44a959);})['then'](function(){try{fs[_0x9755('0x1d')](_0x57f0b6);fs[_0x9755('0x2f')](_0x44a959,_0x9755('0x30'));}catch(_0x2f4df2){logger[_0x9755('0x17')](_0x2f4df2);}return _0x44a959[_0x9755('0x31')]('.')[0x0];});};exports[_0x9755('0x7e')]=function(_0xa91e71,_0x594397,_0xf160c5,_0x59ab21,_0x5ddc4d,_0x1512d1){return aws['lex'](_0xa91e71,_0x594397,_0xf160c5,_0x59ab21,_0x5ddc4d,_0x1512d1)['then'](function(_0x120616){logger[_0x9755('0x26')](JSON['stringify'](_0x120616));return _0x120616;});};exports[_0x9755('0x7f')]=function(_0x492b28,_0x3a0208,_0x7b0d6a,_0x582169){var _0x4d3fbc=util[_0x9755('0x80')](_0x9755('0x81'),ISPEECH_API,_0x492b28,encodeURIComponent(_0x3a0208),_0x7b0d6a,_0x582169);var _0x1ee8af=path['resolve'](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+_0x9755('0x7c'));var _0x20a65c;return downloadFile(_0x4d3fbc,_0x1ee8af)[_0x9755('0x3d')](function(){_0x20a65c=path['resolve'](__dirname,_0x9755('0x2a'),rs['generate'](0x4)+_0x9755('0x2c'));return convertFile(_0x1ee8af,_0x20a65c);})[_0x9755('0x3d')](function(){try{fs[_0x9755('0x1d')](_0x1ee8af);fs[_0x9755('0x2f')](_0x20a65c,_0x9755('0x30'));}catch(_0x12a04e){logger[_0x9755('0x17')](_0x12a04e);}return _0x20a65c[_0x9755('0x31')]('.')[0x0];});};exports[_0x9755('0x82')]=function(_0x399e64,_0x2258b1,_0x3f3c7e,_0x1f0280){var _0x187068=util[_0x9755('0x80')](_0x9755('0x83'),ISPEECH_API,_0x2258b1,_0x3f3c7e,base64Encode(_0x399e64),_0x1f0280?util[_0x9755('0x80')](_0x9755('0x84'),encodeURIComponent(_0x1f0280)):'freeform=3');return uploadFile(_0x187068)[_0x9755('0x3d')](function(_0x2c50f3){return querystring[_0x9755('0xb')](_0x2c50f3);});};exports[_0x9755('0x85')]=function(_0x4c309d,_0x94bcf8){return sestek[_0x9755('0x86')](_0x4c309d,_0x94bcf8)['then'](function(_0xa3fec6){logger[_0x9755('0x26')](JSON[_0x9755('0x47')](_0xa3fec6));var _0x5769bb={'speech':_0xa3fec6[_0x9755('0x87')],'action':_0xa3fec6['channelData']?_0xa3fec6[_0x9755('0x88')]['CustomAction']:undefined,'actiondata':_0xa3fec6[_0x9755('0x88')]?_0xa3fec6[_0x9755('0x88')]['CustomActionData']:undefined};if(_0xa3fec6['channelData']&&_0xa3fec6['channelData'][_0x9755('0x89')]){return base64Decode(_0xa3fec6['channelData'][_0x9755('0x89')]['Data'],path['resolve'](__dirname,_0x9755('0x2a'),rs[_0x9755('0x2b')](0x4)+_0x9755('0x2c')))[_0x9755('0x3d')](function(_0x2c8831){_0x5769bb['audiofile']=_0x2c8831;return _0x5769bb;});}return _0x5769bb;});};exports[_0x9755('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x9433=['goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','source','result','action','fulfillment','speech','score','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','querystring','request-promise','sox','url','parse','./aws','./google','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','path','request\x20to\x20','data','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','split','toString','googleCloudTTS','ssml','input','text:synthesize','.mp3','audioContent','777','.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist'];(function(_0x4128fd,_0x1cd89c){var _0x1d02dd=function(_0x37e5b8){while(--_0x37e5b8){_0x4128fd['push'](_0x4128fd['shift']());}};_0x1d02dd(++_0x1cd89c);}(_0x9433,0x1c5));var _0x3943=function(_0x58168a,_0x11221f){_0x58168a=_0x58168a-0x0;var _0x5114ad=_0x9433[_0x58168a];return _0x5114ad;};'use strict';var apiai=require(_0x3943('0x0'));var BPromise=require(_0x3943('0x1'));var dialogflow=require(_0x3943('0x2'));var fs=require('fs');var http=require(_0x3943('0x3'));var https=require(_0x3943('0x4'));var md5=require('md5');var path=require('path');var querystring=require(_0x3943('0x5'));var rp=require(_0x3943('0x6'));var rs=require('randomstring');var sox=require(_0x3943('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x3943('0x8'))[_0x3943('0x9')];var util=require('util');var aws=require(_0x3943('0xa'));var google=require(_0x3943('0xb'));var sestek=require(_0x3943('0xc'));var tilde=require('./tilde');var logger=require(_0x3943('0xd'))('agi');var ISPEECH_API=_0x3943('0xe');function downloadFile(_0x487b12,_0x5e668c){return new BPromise(function(_0x1667c9,_0x4e31fe){var _0x5c12b9=urlParse(_0x487b12);var _0x4c7770=_0x5c12b9['protocol']===_0x3943('0xf')?https:http;var _0x42fd20={'host':_0x5c12b9[_0x3943('0x10')],'path':_0x5c12b9['path'],'headers':{'user-agent':_0x3943('0x11')}};_0x4c7770[_0x3943('0x12')](_0x42fd20,function(_0x41502d){if(_0x41502d[_0x3943('0x13')]!==0xc8){logger[_0x3943('0x14')]('request\x20to\x20'+_0x487b12+_0x3943('0x15')+_0x41502d[_0x3943('0x13')]+'\x20('+_0x41502d['statusMessage']+')');_0x4e31fe(new Error('request\x20to\x20'+_0x487b12+_0x3943('0x15')+_0x41502d[_0x3943('0x13')]+'\x20('+_0x41502d[_0x3943('0x16')]+')'));return;}var _0x39dc1b=fs['createWriteStream'](_0x5e668c);_0x39dc1b['on'](_0x3943('0x17'),function(){logger[_0x3943('0x18')](_0x3943('0x19'));_0x39dc1b[_0x3943('0x1a')](_0x1667c9);});_0x39dc1b['on'](_0x3943('0x14'),function(_0x15f7a8){fs[_0x3943('0x1b')](_0x5e668c);logger[_0x3943('0x14')](_0x3943('0x1c'),_0x15f7a8);_0x4e31fe(_0x15f7a8);});_0x41502d[_0x3943('0x1d')](_0x39dc1b);})['on']('error',function(_0x581371){logger[_0x3943('0x14')](_0x581371);_0x4e31fe(_0x581371);})[_0x3943('0x1e')]();});}function uploadFile(_0x5d6d3f){return new BPromise(function(_0x3ac97a,_0x15a0ed){var _0x340e67=urlParse(_0x5d6d3f);var _0x46c05b=_0x340e67['protocol']==='https:'?https:http;var _0x2367f3={'host':_0x340e67[_0x3943('0x10')],'path':_0x340e67[_0x3943('0x1f')],'headers':{'user-agent':'WHAT_EVER'}};_0x46c05b[_0x3943('0x12')](_0x2367f3,function(_0xdf4390){if(_0xdf4390['statusCode']!==0xc8){_0x15a0ed(new Error(_0x3943('0x20')+_0x5d6d3f+_0x3943('0x15')+_0xdf4390[_0x3943('0x13')]+'\x20('+_0xdf4390['statusMessage']+')'));return;}var _0x193a4c='';_0xdf4390['on'](_0x3943('0x21'),function(_0x13a2a7){_0x193a4c+=_0x13a2a7;});_0xdf4390['on'](_0x3943('0x1e'),function(){_0x3ac97a(_0x193a4c);});})['on']('error',function(_0x121a5f){_0x15a0ed(_0x121a5f);})[_0x3943('0x1e')]();});}function convertFile(_0x27c67b,_0x4a9500){return new BPromise(function(_0x2e040d,_0x132c53){var _0x596007=sox['transcode'](_0x27c67b,_0x4a9500,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x596007['on'](_0x3943('0x14'),function(_0x24714e){logger[_0x3943('0x14')](_0x3943('0x22'),_0x24714e);_0x132c53(_0x24714e);});_0x596007['on']('end',function(){logger['info'](_0x3943('0x23'));_0x2e040d();});_0x596007['start']();});}function base64Decode(_0x133f9c,_0x4b398e){var _0x585673=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.wav');fs[_0x3943('0x27')](_0x585673,_0x133f9c,_0x3943('0x28'));return convertFile(_0x585673,_0x4b398e)[_0x3943('0x29')](function(){try{fs['unlink'](_0x585673);fs[_0x3943('0x2a')](_0x4b398e,'777');}catch(_0x215b72){logger[_0x3943('0x14')](_0x215b72);}return _0x4b398e[_0x3943('0x2b')]('.')[0x0];});}function base64Encode(_0x11f9bd){var _0x96d24a=fs['readFileSync'](_0x11f9bd);return new Buffer(_0x96d24a)[_0x3943('0x2c')](_0x3943('0x28'));}exports[_0x3943('0x2d')]=function(_0x50a9b9,_0x359607,_0x5e9564,_0x3312de,_0x12f3a6,_0x1d0965){var _0x1b74ca,_0x28fae1;var _0x38cbd1='https://texttospeech.googleapis.com/v1/';var _0x53c5a0='?key='+_0x50a9b9;var _0x1ac02f={};if(_0x359607===_0x3943('0x2e')){_0x1ac02f[_0x3943('0x2f')]={'ssml':_0x5e9564};}else{_0x1ac02f[_0x3943('0x2f')]={'text':_0x5e9564};};_0x1ac02f['voice']={'languageCode':_0x3312de,'ssmlGender':_0x12f3a6};_0x1ac02f['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0xeedc55={'url':_0x38cbd1+_0x3943('0x30')+_0x53c5a0,'method':'POST','json':!![],'body':_0x1ac02f};return rp(_0xeedc55)[_0x3943('0x29')](function(_0x4b05c6){return new BPromise(function(_0x3766b2,_0x1479b8){_0x1b74ca=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x3943('0x31'));var _0x192bff=Buffer['from'](_0x4b05c6[_0x3943('0x32')],_0x3943('0x28'));return fs['writeFile'](_0x1b74ca,_0x192bff,function(_0x2a2c90){_0x1479b8(_0x2a2c90);},function(_0x73b5db){fs[_0x3943('0x2a')](_0x1b74ca,_0x3943('0x33'));_0x3766b2(_0x73b5db);});});})[_0x3943('0x29')](function(_0x11c823){_0x28fae1=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x1b74ca,_0x28fae1);})['then'](function(){try{fs['unlink'](_0x1b74ca);fs[_0x3943('0x2a')](_0x28fae1,_0x3943('0x33'));}catch(_0x57e272){logger[_0x3943('0x14')](_0x57e272);}logger['info'](_0x3943('0x35'),_0x28fae1[_0x3943('0x2b')]('.')[0x0]);return _0x28fae1['split']('.')[0x0];});};exports['googleTTS']=function(_0x2fcae1,_0xe922d1){var _0x51d1aa=_0x3943('0x36');var _0x110a80,_0xd25884;var _0x486f71;var _0x472258={'encoding':_0x3943('0x37'),'method':'POST','timeout':0x2710,'url':_0x51d1aa,'headers':{'Content-Type':_0x3943('0x38')},'body':_0x3943('0x39')+encodeURIComponent(JSON[_0x3943('0x3a')]([[[_0x3943('0x3b'),JSON['stringify']([_0x2fcae1,_0xe922d1||'en',![],_0x3943('0x3c')]),null,'generic']]]))};return rp(_0x472258)['then'](function(_0x3b5182){try{_0x486f71=eval(_0x3b5182[_0x3943('0x3d')](0x5))[0x0][0x2];}catch(_0x31f680){throw new Error(_0x3943('0x3e')+_0x3b5182[_0x3943('0x21')]);}if(!_0x486f71){if(_0x2fcae1[_0x3943('0x3f')]>0xc8){throw new Error(_0x3943('0x40'));}else{throw new Error(_0x3943('0x41')+_0xe922d1+_0x3943('0x42'));}}try{_0x486f71=eval(_0x486f71)[0x0];}catch(_0x39a2fd){throw new Error(_0x3943('0x3e')+res['data']);}const _0x2c45fe=_0x486f71;_0x110a80=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x31'));fs[_0x3943('0x27')](_0x110a80,_0x486f71,{'encoding':_0x3943('0x28')});_0xd25884=path[_0x3943('0x24')](__dirname,'tmp',rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x110a80,_0xd25884);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0x110a80);fs[_0x3943('0x2a')](_0xd25884,_0x3943('0x33'));}catch(_0x5e3d4c){logger[_0x3943('0x14')](_0x5e3d4c);}logger['info'](_0x3943('0x43'),_0xd25884['split']('.')[0x0]);return _0xd25884[_0x3943('0x2b')]('.')[0x0];});};exports[_0x3943('0x44')]=function(_0x4a5d64,_0x5c9b39,_0x38c547){return google[_0x3943('0x45')](_0x4a5d64,_0x5c9b39,_0x38c547)[_0x3943('0x29')](function(_0x2c439b){logger[_0x3943('0x18')](_0x2c439b[_0x3943('0x46')]);return rp(_0x2c439b);})[_0x3943('0x29')](function(_0x16a29f){var _0x2d725b='';var _0x2f0e40=0x0;try{fs[_0x3943('0x1b')](_0x4a5d64);}catch(_0x24d8cb){logger[_0x3943('0x14')](_0x24d8cb);}if(_0x16a29f&&_0x16a29f[_0x3943('0x47')]){_0x2d725b=_0x16a29f[_0x3943('0x47')]['map'](function(_0x3d3ac5){return _0x3d3ac5&&_0x3d3ac5[_0x3943('0x48')][0x0]&&_0x3d3ac5[_0x3943('0x48')][0x0][_0x3943('0x49')]?_0x3d3ac5[_0x3943('0x48')][0x0]['transcript']:'';})[_0x3943('0x4a')]('\x0a');_0x2f0e40=_0x16a29f[_0x3943('0x47')][_0x3943('0x4b')](function(_0x25c59b){return _0x25c59b&&_0x25c59b[_0x3943('0x48')][0x0]&&_0x25c59b[_0x3943('0x48')][0x0][_0x3943('0x4c')]?_0x25c59b['alternatives'][0x0][_0x3943('0x4c')]:0x0;})[_0x3943('0x4a')]('\x0a');}logger['info'](_0x3943('0x4d'),_0x2d725b);logger[_0x3943('0x18')](_0x3943('0x4e'),_0x2f0e40);return{'transcript':_0x2d725b,'confidence':_0x2f0e40};})[_0x3943('0x4f')](function(_0x5ba43b){logger['error'](_0x3943('0x50'),_0x5ba43b[_0x3943('0x13')],_0x5ba43b[_0x3943('0x51')],_0x5ba43b[_0x3943('0x52')]);});};exports[_0x3943('0x53')]=function(_0x3eefd2,_0x1fecf1,_0xe6be42,_0x34561c){var _0x48e277=apiai(_0x1fecf1,{'language':_0x34561c||'en'});return _0x48e277['textRequest'](_0xe6be42,{'sessionId':md5(_0x3eefd2)})[_0x3943('0x29')](function(_0x6ee0b){logger[_0x3943('0x18')](JSON[_0x3943('0x3a')](_0x6ee0b));return{'source':_0x6ee0b['result'][_0x3943('0x54')],'resolvedQuery':_0x6ee0b[_0x3943('0x55')]['resolvedQuery'],'action':_0x6ee0b[_0x3943('0x55')][_0x3943('0x56')],'actionIncomplete':_0x6ee0b[_0x3943('0x55')]['actionIncomplete'],'speech':_0x6ee0b[_0x3943('0x55')][_0x3943('0x57')][_0x3943('0x58')],'score':_0x6ee0b[_0x3943('0x55')][_0x3943('0x59')],'statusCode':_0x6ee0b['status'][_0x3943('0x5a')],'endConversation':_0x6ee0b[_0x3943('0x55')]['metadata']['endConversation']||![],'isFallbackIntent':_0x6ee0b[_0x3943('0x55')][_0x3943('0x5b')][_0x3943('0x5c')]};});};exports[_0x3943('0x5d')]=function(_0xf3f92c,_0x250874,_0x4d8716,_0x3af4b7,_0x14cd1d,_0x287f5a){var _0x454526=_0x3af4b7[_0x3943('0x5e')](/\\n/g,'\x0a');var _0x3fe759={'credentials':{'private_key':_0x454526,'client_email':_0x4d8716}};var _0x128755=new dialogflow[(_0x3943('0x5f'))](_0x3fe759);var _0xf78197=_0x128755[_0x3943('0x60')](_0x250874,md5(_0xf3f92c));var _0x442bc4={'session':_0xf78197,'queryInput':{'text':{'text':_0x14cd1d,'languageCode':_0x287f5a}}};return _0x128755[_0x3943('0x61')](_0x442bc4)[_0x3943('0x29')](function(_0x2da8a6){if(_0x2da8a6&&_0x2da8a6['length']){logger[_0x3943('0x18')](_0x3943('0x62'),JSON[_0x3943('0x3a')](_0x2da8a6));var _0x26902e=_0x2da8a6[0x0];if(_0x26902e){var _0x487ec2={'action':_0x26902e[_0x3943('0x63')][_0x3943('0x56')],'allRequiredParamsPresent':_0x26902e[_0x3943('0x63')]['allRequiredParamsPresent'],'endConversation':_0x26902e['queryResult']['diagnosticInfo']&&_0x26902e[_0x3943('0x63')][_0x3943('0x64')][_0x3943('0x65')]?_0x26902e[_0x3943('0x63')][_0x3943('0x64')]['fields'][_0x3943('0x66')][_0x3943('0x67')]:![],'fulfillmentText':_0x26902e[_0x3943('0x63')][_0x3943('0x68')],'intentName':_0x26902e[_0x3943('0x63')]['intent'][_0x3943('0x51')],'intentDisplayName':_0x26902e['queryResult'][_0x3943('0x69')]['displayName'],'isFallbackIntent':_0x26902e[_0x3943('0x63')][_0x3943('0x69')]['isFallback'],'languageCode':_0x26902e[_0x3943('0x63')][_0x3943('0x6a')],'queryText':_0x26902e[_0x3943('0x63')][_0x3943('0x6b')],'responseId':_0x26902e['responseId'],'score':_0x26902e['queryResult'][_0x3943('0x6c')],'speech':_0x26902e['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x3943('0x3a')](_0x2da8a6)};return _0x487ec2;}}});};exports[_0x3943('0x6d')]=function(_0x412531,_0x130572,_0x3d3c5d,_0x456b6c){return tilde[_0x3943('0x45')](_0x412531,_0x130572,_0x3d3c5d,_0x456b6c)['then'](function(_0x51c255){try{fs[_0x3943('0x1b')](_0x412531);}catch(_0x5d3a98){logger['error'](_0x5d3a98);}logger[_0x3943('0x18')](_0x3943('0x6e'),_0x51c255[_0x3943('0x49')]);logger['info'](_0x3943('0x6f'),_0x51c255[_0x3943('0x4c')]);return _0x51c255;});};exports[_0x3943('0x70')]=function(_0x1bb959,_0x429c03,_0xc0180b,_0x4e179c,_0x81ae48,_0x2be05b){var _0x28a7cf=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x31'));var _0x1bac80;return aws[_0x3943('0x71')](_0x1bb959,_0x429c03,_0xc0180b,_0x4e179c,_0x81ae48,_0x2be05b,_0x28a7cf)[_0x3943('0x29')](function(){_0x1bac80=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x28a7cf,_0x1bac80);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0x28a7cf);fs[_0x3943('0x2a')](_0x1bac80,'777');}catch(_0x18264c){logger[_0x3943('0x14')](_0x18264c);}return _0x1bac80['split']('.')[0x0];});};exports['awsLex']=function(_0x202a3a,_0x43a7ee,_0x23b860,_0x525a42,_0x2bc23f,_0x499f12){return aws[_0x3943('0x72')](_0x202a3a,_0x43a7ee,_0x23b860,_0x525a42,_0x2bc23f,_0x499f12)['then'](function(_0x101153){logger[_0x3943('0x18')](JSON['stringify'](_0x101153));return _0x101153;});};exports[_0x3943('0x73')]=function(_0x239101,_0x499202,_0x1f4bb0,_0x1d8383){var _0x4460e0=util[_0x3943('0x74')](_0x3943('0x75'),ISPEECH_API,_0x239101,encodeURIComponent(_0x499202),_0x1f4bb0,_0x1d8383);var _0xd62390=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.mp3');var _0x59454c;return downloadFile(_0x4460e0,_0xd62390)[_0x3943('0x29')](function(){_0x59454c=path[_0x3943('0x24')](__dirname,'tmp',rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0xd62390,_0x59454c);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0xd62390);fs[_0x3943('0x2a')](_0x59454c,_0x3943('0x33'));}catch(_0x1b542f){logger[_0x3943('0x14')](_0x1b542f);}return _0x59454c[_0x3943('0x2b')]('.')[0x0];});};exports[_0x3943('0x76')]=function(_0x5586b2,_0x363d2d,_0x5b69fe,_0x559261){var _0x4fd4ea=util[_0x3943('0x74')](_0x3943('0x77'),ISPEECH_API,_0x363d2d,_0x5b69fe,base64Encode(_0x5586b2),_0x559261?util[_0x3943('0x74')]('model=%s',encodeURIComponent(_0x559261)):_0x3943('0x78'));return uploadFile(_0x4fd4ea)[_0x3943('0x29')](function(_0x281d00){return querystring[_0x3943('0x9')](_0x281d00);});};exports[_0x3943('0x79')]=function(_0xf24e79,_0x1e6694){return sestek[_0x3943('0x7a')](_0xf24e79,_0x1e6694)[_0x3943('0x29')](function(_0x22773b){logger[_0x3943('0x18')](JSON[_0x3943('0x3a')](_0x22773b));var _0x2ef30d={'speech':_0x22773b[_0x3943('0x7b')],'action':_0x22773b[_0x3943('0x7c')]?_0x22773b[_0x3943('0x7c')]['CustomAction']:undefined,'actiondata':_0x22773b[_0x3943('0x7c')]?_0x22773b[_0x3943('0x7c')][_0x3943('0x7d')]:undefined};if(_0x22773b[_0x3943('0x7c')]&&_0x22773b[_0x3943('0x7c')][_0x3943('0x7e')]){return base64Decode(_0x22773b['channelData'][_0x3943('0x7e')][_0x3943('0x7f')],path['resolve'](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.wav'))['then'](function(_0x5e489d){_0x2ef30d[_0x3943('0x80')]=_0x5e489d;return _0x2ef30d;});}return _0x2ef30d;});};exports[_0x3943('0x81')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index eeb141d..7a76ca3 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 _0x4c75=['exports','./nda'];(function(_0x16737f,_0x2a8cf3){var _0x18fd36=function(_0x4d5f57){while(--_0x4d5f57){_0x16737f['push'](_0x16737f['shift']());}};_0x18fd36(++_0x2a8cf3);}(_0x4c75,0x129));var _0x54c7=function(_0x3b395a,_0xb9a82d){_0x3b395a=_0x3b395a-0x0;var _0x4aeef2=_0x4c75[_0x3b395a];return _0x4aeef2;};var nda=require(_0x54c7('0x0'));module[_0x54c7('0x1')]={'nda':nda}; \ No newline at end of file +var _0x82e9=['exports','./nda'];(function(_0x4f83ea,_0x4b484e){var _0x3e41f6=function(_0x5cfcdc){while(--_0x5cfcdc){_0x4f83ea['push'](_0x4f83ea['shift']());}};_0x3e41f6(++_0x4b484e);}(_0x82e9,0xe9));var _0x982e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82e9[_0x2763f2];return _0x3ef471;};var nda=require(_0x982e('0x0'));module[_0x982e('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 c81c1ef..6390fb7 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 _0xa0bc=['channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var url=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('agi');module[_0xca0b('0x2')]=function(_0x3031b2,_0x113486){var _0x68ff4={'method':_0xca0b('0x3'),'uri':url[_0xca0b('0x4')](_0x113486[_0xca0b('0x5')],_0xca0b('0x6')),'form':{'grant_type':_0xca0b('0x7'),'username':_0x113486[_0xca0b('0x8')],'password':_0x113486[_0xca0b('0x7')]},'json':!![]};return rp(_0x68ff4)[_0xca0b('0x9')](function(_0xa506a4){var _0x19acc2={'method':'POST','uri':url[_0xca0b('0x4')](_0x113486[_0xca0b('0xa')],_0xca0b('0xb')),'body':{'type':_0x113486[_0xca0b('0xc')]||_0xca0b('0xd'),'channelId':_0xca0b('0xe'),'conversation':{'id':_0x3031b2['uniqueid']},'from':{'id':_0x3031b2[_0xca0b('0xf')],'name':_0x3031b2[_0xca0b('0x10')]},'recipient':{'id':_0x3031b2[_0xca0b('0x11')],'name':_0x3031b2[_0xca0b('0x12')]},'text':_0x113486[_0xca0b('0x13')],'channelData':{}},'headers':{'Authorization':_0xca0b('0x14')+_0xa506a4[_0xca0b('0x15')]},'json':!![]};if(_0x113486[_0xca0b('0x16')]){_0x19acc2[_0xca0b('0x17')][_0xca0b('0x18')]['ProjectName']=_0x113486[_0xca0b('0x16')];}if(_0x113486[_0xca0b('0x19')]=='1'){_0x19acc2[_0xca0b('0x17')]['channelData'][_0xca0b('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xca0b('0x1b')};}if(_0x113486[_0xca0b('0x1c')]){_0x19acc2[_0xca0b('0x17')][_0xca0b('0x18')][_0xca0b('0x1d')]=_0x113486['custom_action'];if(_0x113486[_0xca0b('0x1e')]){_0x19acc2[_0xca0b('0x17')]['channelData'][_0xca0b('0x1f')]=_0x113486['custom_action_data'];}}logger[_0xca0b('0x20')](JSON['stringify'](_0x19acc2));return rp(_0x19acc2);});}; \ No newline at end of file +var _0x0bb5=['exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','channelData','ProjectName','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x0bb5,0x148));var _0x50bb=function(_0xf59184,_0x278da9){_0xf59184=_0xf59184-0x0;var _0x10d82d=_0x0bb5[_0xf59184];return _0x10d82d;};'use strict';var rp=require(_0x50bb('0x0'));var url=require(_0x50bb('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x50bb('0x2')]=function(_0x1aaa37,_0x6b7575){var _0x117e36={'method':_0x50bb('0x3'),'uri':url[_0x50bb('0x4')](_0x6b7575[_0x50bb('0x5')],_0x50bb('0x6')),'form':{'grant_type':'password','username':_0x6b7575['username'],'password':_0x6b7575[_0x50bb('0x7')]},'json':!![]};return rp(_0x117e36)[_0x50bb('0x8')](function(_0x2e5463){var _0x33ff54={'method':'POST','uri':url['resolve'](_0x6b7575[_0x50bb('0x9')],_0x50bb('0xa')),'body':{'type':_0x6b7575[_0x50bb('0xb')]||_0x50bb('0xc'),'channelId':'Nda','conversation':{'id':_0x1aaa37[_0x50bb('0xd')]},'from':{'id':_0x1aaa37[_0x50bb('0xe')],'name':_0x1aaa37[_0x50bb('0xf')]},'recipient':{'id':_0x1aaa37[_0x50bb('0x10')],'name':_0x1aaa37[_0x50bb('0x11')]},'text':_0x6b7575[_0x50bb('0x12')],'channelData':{}},'headers':{'Authorization':_0x50bb('0x13')+_0x2e5463['access_token']},'json':!![]};if(_0x6b7575[_0x50bb('0x14')]){_0x33ff54['body'][_0x50bb('0x15')][_0x50bb('0x16')]=_0x6b7575[_0x50bb('0x14')];}if(_0x6b7575['ndagenerate_audio']=='1'){_0x33ff54[_0x50bb('0x17')][_0x50bb('0x15')][_0x50bb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x6b7575[_0x50bb('0x19')]){_0x33ff54['body'][_0x50bb('0x15')][_0x50bb('0x1a')]=_0x6b7575[_0x50bb('0x19')];if(_0x6b7575[_0x50bb('0x1b')]){_0x33ff54[_0x50bb('0x17')]['channelData'][_0x50bb('0x1c')]=_0x6b7575[_0x50bb('0x1b')];}}logger['info'](JSON[_0x50bb('0x1d')](_0x33ff54));return rp(_0x33ff54);});}; \ 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 2f37404..178ecae 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x546c=['exports'];(function(_0x537f2e,_0x4debe3){var _0x51f3e5=function(_0x3a4c5b){while(--_0x3a4c5b){_0x537f2e['push'](_0x537f2e['shift']());}};_0x51f3e5(++_0x4debe3);}(_0x546c,0x1cb));var _0xc546=function(_0x851b5a,_0x24b1ff){_0x851b5a=_0x851b5a-0x0;var _0x365960=_0x546c[_0x851b5a];return _0x365960;};'use strict';var asr=require('./lib/api');module[_0xc546('0x0')]=function(_0xa00fe,_0xf5626a,_0x4a730e,_0xe82b72){return asr(_0xa00fe,_0xf5626a,_0x4a730e,_0xe82b72);}; \ No newline at end of file +var _0xa558=['./lib/api'];(function(_0x1d5a24,_0x12b487){var _0x322f43=function(_0x766e79){while(--_0x766e79){_0x1d5a24['push'](_0x1d5a24['shift']());}};_0x322f43(++_0x12b487);}(_0xa558,0x1a7));var _0x8a55=function(_0x205d4d,_0x4c1717){_0x205d4d=_0x205d4d-0x0;var _0x1bc898=_0xa558[_0x205d4d];return _0x1bc898;};'use strict';var asr=require(_0x8a55('0x0'));module['exports']=function(_0x3a783e,_0x532167,_0xe73306,_0x236ecd){return asr(_0x3a783e,_0x532167,_0xe73306,_0x236ecd);}; \ 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 bf8ab29..90e24f9 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 _0x0f3a=['Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x521599,_0x38dcf0){var _0x4441c1=function(_0x1dfd0f){while(--_0x1dfd0f){_0x521599['push'](_0x521599['shift']());}};_0x4441c1(++_0x38dcf0);}(_0x0f3a,0x1d0));var _0xa0f3=function(_0x311c4d,_0xd99948){_0x311c4d=_0x311c4d-0x0;var _0x2677ce=_0x0f3a[_0x311c4d];return _0x2677ce;};'use strict';var BPromise=require('bluebird');var _=require(_0xa0f3('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa0f3('0x1'));var crypto=require(_0xa0f3('0x2'));var logger=require(_0xa0f3('0x3'))(_0xa0f3('0x4'));module[_0xa0f3('0x5')]=function(_0x422c7b,_0x27a3fc,_0x494721,_0x3e5df6){return new BPromise(function(_0x504d41,_0x3a3eda){logger[_0xa0f3('0x6')](_0xa0f3('0x7'),_0x3e5df6||_0xa0f3('0x8'));var _0x219254=new WebSocket(_0x3e5df6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4f07e4='';var _0x558b37='0';var _0x598a78='1';var _0x329ede='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x36e5df(_0x5336ca){var _0x4bd79e=crypto[_0xa0f3('0x9')](_0xa0f3('0xa'));_0x4bd79e[_0xa0f3('0xb')](_0x5336ca);return _0x4bd79e['digest'](_0xa0f3('0xc'));}function _0x1318c4(){try{logger[_0xa0f3('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x4d6578=moment()['unix']();var _0x3ce2c0=_0x36e5df(_0x4d6578+_0x27a3fc+_0x494721);_0x219254[_0xa0f3('0xd')](JSON['stringify']({'appID':_0x27a3fc,'timestamp':_0x4d6578,'appKey':_0x3ce2c0}));var _0x5b79b5=fs[_0xa0f3('0xe')](_0x422c7b);_0x5b79b5['on']('data',function(_0x11f55f){_0x219254[_0xa0f3('0xd')](_0x11f55f);});_0x5b79b5['on'](_0xa0f3('0xf'),function(){_0x219254[_0xa0f3('0xd')](_0xa0f3('0x10'));});}catch(_0x1cf85c){logger[_0xa0f3('0x11')](_0xa0f3('0x12'),JSON[_0xa0f3('0x13')](_0x1cf85c));_0x219254[_0xa0f3('0x14')]();}}function _0x4ebfdc(_0x12b4d8){try{if(_0x12b4d8){var _0x134f9f=JSON[_0xa0f3('0x15')](_0x12b4d8);switch(_0x134f9f[_0xa0f3('0x16')]){case 0x0:if(_0x134f9f[_0xa0f3('0x17')]){if(_0x134f9f[_0xa0f3('0x17')][_0xa0f3('0x18')]){logger[_0xa0f3('0x6')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x134f9f[_0xa0f3('0x17')][_0xa0f3('0x19')]));_0x4f07e4=_0x134f9f[_0xa0f3('0x17')]['hypotheses'][0x0][_0xa0f3('0x1a')];_0x558b37=_0x134f9f[_0xa0f3('0x17')][_0xa0f3('0x19')][0x0]['likelihood'];_0x598a78='0';_0x329ede=_0xa0f3('0x1b');_0x219254[_0xa0f3('0x14')]();}}break;case 0x1:logger[_0xa0f3('0x6')](_0xa0f3('0x1c'));_0x598a78='1';_0x329ede=_0xa0f3('0x1c');break;case 0x2:logger[_0xa0f3('0x6')](_0xa0f3('0x1d'));_0x598a78='2';_0x329ede=_0xa0f3('0x1d');break;case 0x9:logger[_0xa0f3('0x6')](_0xa0f3('0x1e'));_0x598a78='9';_0x329ede=_0xa0f3('0x1e');break;case 0xa:logger['info'](_0xa0f3('0x1f'));_0x598a78='10';_0x329ede=_0xa0f3('0x1f');break;case 0xb:logger[_0xa0f3('0x6')](_0xa0f3('0x20'));_0x598a78='11';_0x329ede=_0xa0f3('0x20');}}}catch(_0x1f53e2){logger[_0xa0f3('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x1f53e2));_0x219254[_0xa0f3('0x14')]();}}function _0x9699b(){logger[_0xa0f3('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x504d41({'transcript':_0x4f07e4,'confidence':_0x558b37,'status':_0x598a78,'status_message':_0x329ede});}function _0x291a87(_0x37f7bc){logger[_0xa0f3('0x11')](_0xa0f3('0x21'));if(!_[_0xa0f3('0x22')](_0x37f7bc)){logger[_0xa0f3('0x11')](_[_0xa0f3('0x23')](_0x37f7bc)?JSON[_0xa0f3('0x13')](_0x37f7bc):_0x37f7bc);}}_0x219254['on'](_0xa0f3('0x24'),_0x1318c4);_0x219254['on'](_0xa0f3('0x25'),_0x4ebfdc);_0x219254['on']('close',_0x9699b);_0x219254['on'](_0xa0f3('0x11'),_0x291a87);});}; \ No newline at end of file +var _0xe927=['agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','transcript','likelihood','Success.','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.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0xe927,0x193));var _0x7e92=function(_0x189e7c,_0x1de1c0){_0x189e7c=_0x189e7c-0x0;var _0xf85261=_0xe927[_0x189e7c];return _0xf85261;};'use strict';var BPromise=require(_0x7e92('0x0'));var _=require(_0x7e92('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x7e92('0x2'));var logger=require(_0x7e92('0x3'))(_0x7e92('0x4'));module['exports']=function(_0x4bdee5,_0x42ff00,_0x266571,_0x17f1b3){return new BPromise(function(_0x2f047b,_0x2fb79f){logger[_0x7e92('0x5')]('Tilde\x20URI',_0x17f1b3||_0x7e92('0x6'));var _0xbb7b7f=new WebSocket(_0x17f1b3||_0x7e92('0x6'),{'perMessageDeflate':![]});var _0x1a3877='';var _0x27b0f3='0';var _0x3994a1='1';var _0x41391b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4b14c2(_0x55c13a){var _0x209bb7=crypto['createHash']('sha1');_0x209bb7[_0x7e92('0x7')](_0x55c13a);return _0x209bb7[_0x7e92('0x8')](_0x7e92('0x9'));}function _0x14ea4b(){try{logger[_0x7e92('0x5')](_0x7e92('0xa'));var _0x44874d=moment()[_0x7e92('0xb')]();var _0x59831d=_0x4b14c2(_0x44874d+_0x42ff00+_0x266571);_0xbb7b7f[_0x7e92('0xc')](JSON[_0x7e92('0xd')]({'appID':_0x42ff00,'timestamp':_0x44874d,'appKey':_0x59831d}));var _0x9fafe8=fs[_0x7e92('0xe')](_0x4bdee5);_0x9fafe8['on']('data',function(_0x192eab){_0xbb7b7f[_0x7e92('0xc')](_0x192eab);});_0x9fafe8['on'](_0x7e92('0xf'),function(){_0xbb7b7f[_0x7e92('0xc')](_0x7e92('0x10'));});}catch(_0x5a1c80){logger[_0x7e92('0x11')](_0x7e92('0x12'),JSON[_0x7e92('0xd')](_0x5a1c80));_0xbb7b7f[_0x7e92('0x13')]();}}function _0x1455f7(_0x41567b){try{if(_0x41567b){var _0xcc07b5=JSON[_0x7e92('0x14')](_0x41567b);switch(_0xcc07b5[_0x7e92('0x15')]){case 0x0:if(_0xcc07b5[_0x7e92('0x16')]){if(_0xcc07b5['result']['final']){logger[_0x7e92('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')]));_0x1a3877=_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')][0x0][_0x7e92('0x18')];_0x27b0f3=_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')][0x0][_0x7e92('0x19')];_0x3994a1='0';_0x41391b=_0x7e92('0x1a');_0xbb7b7f['terminate']();}}break;case 0x1:logger['info'](_0x7e92('0x1b'));_0x3994a1='1';_0x41391b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7e92('0x5')](_0x7e92('0x1c'));_0x3994a1='2';_0x41391b=_0x7e92('0x1c');break;case 0x9:logger[_0x7e92('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3994a1='9';_0x41391b=_0x7e92('0x1d');break;case 0xa:logger[_0x7e92('0x5')](_0x7e92('0x1e'));_0x3994a1='10';_0x41391b='Authentication\x20failed.';break;case 0xb:logger[_0x7e92('0x5')](_0x7e92('0x1f'));_0x3994a1='11';_0x41391b=_0x7e92('0x1f');}}}catch(_0x13c9bf){logger[_0x7e92('0x11')](_0x7e92('0x20'),JSON[_0x7e92('0xd')](_0x13c9bf));_0xbb7b7f[_0x7e92('0x13')]();}}function _0x398d4e(){logger[_0x7e92('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x2f047b({'transcript':_0x1a3877,'confidence':_0x27b0f3,'status':_0x3994a1,'status_message':_0x41391b});}function _0x19baf3(_0x2234fb){logger[_0x7e92('0x11')](_0x7e92('0x21'));if(!_[_0x7e92('0x22')](_0x2234fb)){logger[_0x7e92('0x11')](_[_0x7e92('0x23')](_0x2234fb)?JSON[_0x7e92('0xd')](_0x2234fb):_0x2234fb);}}_0xbb7b7f['on']('open',_0x14ea4b);_0xbb7b7f['on'](_0x7e92('0x24'),_0x1455f7);_0xbb7b7f['on']('close',_0x398d4e);_0xbb7b7f['on'](_0x7e92('0x11'),_0x19baf3);});}; \ 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 bb59288..860e803 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 _0xd1b9=['./asr'];(function(_0x1f075e,_0x4d8fa7){var _0x5a79a4=function(_0x1dbc56){while(--_0x1dbc56){_0x1f075e['push'](_0x1f075e['shift']());}};_0x5a79a4(++_0x4d8fa7);}(_0xd1b9,0x13c));var _0x9d1b=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0xd1b9[_0x1b70e3];return _0x1452ab;};var asr=require(_0x9d1b('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x09f2=['exports','./asr'];(function(_0x2d7e09,_0x16be83){var _0x1ba707=function(_0x4d3063){while(--_0x4d3063){_0x2d7e09['push'](_0x2d7e09['shift']());}};_0x1ba707(++_0x16be83);}(_0x09f2,0x1e7));var _0x209f=function(_0x45cb03,_0x2c48dd){_0x45cb03=_0x45cb03-0x0;var _0x35d94f=_0x09f2[_0x45cb03];return _0x35d94f;};var asr=require(_0x209f('0x0'));module[_0x209f('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 1b91b33..e1a8b61 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 _0x98c4=['E_AGI_SERVER_MAXCONNECTION','ready','code','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','EventEmitter','./error','error','E_AGI_ARGUMENT_PORT','createServer','listen','emit','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x98c4,0x180));var _0x498c=function(_0x3f3c24,_0x3d1dd6){_0x3f3c24=_0x3f3c24-0x0;var _0x3c7cf7=_0x98c4[_0x3f3c24];return _0x3c7cf7;};'use strict';var util=require(_0x498c('0x0'));var net=require(_0x498c('0x1'));var EventEmitter=require('events')[_0x498c('0x2')];var AGIError=require(_0x498c('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x55abf5,_0x3d687a,_0x1321f4){var _0x2e75da=this,_0x55abf5=_0x55abf5||0x11dd,_0x3d687a=_0x3d687a||'127.0.0.1',_0x49150d=null,_0x267864=0x0;EventEmitter['call'](_0x2e75da);function _0x29cd85(){if(!_0x55abf5){_0x2e75da['emit'](_0x498c('0x4'),new AGIError(_0x498c('0x5')));return![];}_0x49150d=net[_0x498c('0x6')]();_0x49150d[_0x498c('0x7')](_0x55abf5,_0x3d687a);_0x49150d['on']('listening',function(){_0x2e75da[_0x498c('0x8')](_0x498c('0x9'));});_0x49150d['on'](_0x498c('0xa'),function(_0x52821e){_0x49150d[_0x498c('0xb')](function(_0x34794e,_0x28219c){if(_0x34794e){_0x2e75da['emit']('error',new AGIError(_0x498c('0xc'),_0x34794e));}else if(_0x1321f4&&_0x1321f4<0x0){_0x2e75da[_0x498c('0x8')]('error',new AGIError(_0x498c('0xd')));_0x52821e[_0x498c('0xe')]();}else if(_0x1321f4&&_0x1321f4>0x0&&_0x1321f4<_0x28219c){_0x267864+=0x1;_0x2e75da[_0x498c('0x8')](_0x498c('0x4'),new AGIError(_0x498c('0xf'),_0x267864));_0x52821e[_0x498c('0xe')]();}else{var _0x17f17a=new AGIChannel(_0x52821e);_0x17f17a['on'](_0x498c('0x10'),function(){_0x2e75da[_0x498c('0x8')](_0x498c('0xa'),_0x17f17a);});}});});_0x49150d['on']('error',function(_0x37e642){_0x2e75da[_0x498c('0x8')](_0x498c('0x4'),new AGIError(_0x498c('0xc'),_0x37e642[_0x498c('0x11')]));});_0x49150d['on']('close',function(){_0x2e75da[_0x498c('0x8')]('close',new AGIError(_0x498c('0x12')));});}process[_0x498c('0x13')](function(){_0x29cd85();});};util['inherits'](AGIServer,EventEmitter);module[_0x498c('0x14')]=function(_0x7c97ad,_0x575bf3,_0x17df7d){return new AGIServer(_0x7c97ad,_0x575bf3,_0x17df7d);}; \ No newline at end of file +var _0x118a=['error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections'];(function(_0x2e5405,_0x42ec09){var _0x2f0270=function(_0x70c5c8){while(--_0x70c5c8){_0x2e5405['push'](_0x2e5405['shift']());}};_0x2f0270(++_0x42ec09);}(_0x118a,0x183));var _0xa118=function(_0x1a4164,_0x523316){_0x1a4164=_0x1a4164-0x0;var _0x579fda=_0x118a[_0x1a4164];return _0x579fda;};'use strict';var util=require(_0xa118('0x0'));var net=require('net');var EventEmitter=require(_0xa118('0x1'))[_0xa118('0x2')];var AGIError=require(_0xa118('0x3'));var AGIChannel=require(_0xa118('0x4'));var AGIServer=function(_0xdd77b3,_0x4ce730,_0x58689c){var _0x153e50=this,_0xdd77b3=_0xdd77b3||0x11dd,_0x4ce730=_0x4ce730||_0xa118('0x5'),_0x43f050=null,_0x4219d9=0x0;EventEmitter[_0xa118('0x6')](_0x153e50);function _0x129e9f(){if(!_0xdd77b3){_0x153e50[_0xa118('0x7')]('error',new AGIError(_0xa118('0x8')));return![];}_0x43f050=net['createServer']();_0x43f050[_0xa118('0x9')](_0xdd77b3,_0x4ce730);_0x43f050['on'](_0xa118('0xa'),function(){_0x153e50[_0xa118('0x7')](_0xa118('0xa'));});_0x43f050['on'](_0xa118('0xb'),function(_0x4e61e5){_0x43f050[_0xa118('0xc')](function(_0x56172f,_0x358219){if(_0x56172f){_0x153e50[_0xa118('0x7')](_0xa118('0xd'),new AGIError(_0xa118('0xe'),_0x56172f));}else if(_0x58689c&&_0x58689c<0x0){_0x153e50[_0xa118('0x7')]('error',new AGIError(_0xa118('0xf')));_0x4e61e5[_0xa118('0x10')]();}else if(_0x58689c&&_0x58689c>0x0&&_0x58689c<_0x358219){_0x4219d9+=0x1;_0x153e50[_0xa118('0x7')](_0xa118('0xd'),new AGIError(_0xa118('0x11'),_0x4219d9));_0x4e61e5[_0xa118('0x10')]();}else{var _0x3832c7=new AGIChannel(_0x4e61e5);_0x3832c7['on'](_0xa118('0x12'),function(){_0x153e50[_0xa118('0x7')](_0xa118('0xb'),_0x3832c7);});}});});_0x43f050['on'](_0xa118('0xd'),function(_0x1c942a){_0x153e50['emit'](_0xa118('0xd'),new AGIError(_0xa118('0xe'),_0x1c942a[_0xa118('0x13')]));});_0x43f050['on'](_0xa118('0x14'),function(){_0x153e50['emit'](_0xa118('0x14'),new AGIError(_0xa118('0x15')));});}process[_0xa118('0x16')](function(){_0x129e9f();});};util[_0xa118('0x17')](AGIServer,EventEmitter);module[_0xa118('0x18')]=function(_0x173fcc,_0x2d4428,_0x4a4968){return new AGIServer(_0x173fcc,_0x2d4428,_0x4a4968);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 11d1569..8184674 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 _0x27d6=['500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','saveRestApiResult','isPlainObject','%s.%s','isArray','length','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','result','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','no\x20list\x20selected','scheduledAt','delay','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','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','createSquareMessage','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','dialogflowV2_language','no\x20anguage\x20configured','googleDialogflowV2','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','getData','response','maxdigit','test','mindigit','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','condition','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','command','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','arg_1','file','createCmContact','isEmpty','isNil','callback_','random','phone','list_id','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','timeout','includes','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message'];(function(_0x5abd92,_0x101b1e){var _0x3b4dff=function(_0x54d83b){while(--_0x54d83b){_0x5abd92['push'](_0x5abd92['shift']());}};_0x3b4dff(++_0x101b1e);}(_0x27d6,0x14a));var _0x627d=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x27d6[_0x15bc81];return _0x59440e;};'use strict';var fs=require('fs');var path=require(_0x627d('0x0'));var util=require(_0x627d('0x1'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x627d('0x2'))();var rs=require('randomstring');var moment=require(_0x627d('0x3'));var Mustache=require(_0x627d('0x4'));var rp=require(_0x627d('0x5'));var logger=require(_0x627d('0x6'))(_0x627d('0x7'));var config=require(_0x627d('0x8'));var scripts=require(_0x627d('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x627d('0xa'),_0x627d('0xb')];var verticesWithRetry=[_0x627d('0xc'),_0x627d('0xd'),_0x627d('0xe')];var AGIVertices=function(_0x4ac54c,_0x86189a,_0x5ce511){this[_0x627d('0xf')]=_0x4ac54c;this[_0x627d('0x10')]=_0x86189a;this[_0x627d('0x11')]=_0x5ce511;};AGIVertices[_0x627d('0x12')]['getVariable']=function(_0x41a54b,_0x4d910f){this[_0x627d('0x10')][_0x627d('0x13')](_0x41a54b)[_0x627d('0x14')](function(_0x400044){_0x4d910f(null,_0x400044?_0x400044[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0x58b912){_0x4d910f(_0x58b912);});};AGIVertices[_0x627d('0x12')][_0x627d('0x17')]=function(_0x34457e,_0x192481){this[_0x627d('0x10')][_0x627d('0x18')](_0x34457e)[_0x627d('0x14')](function(_0xb56a0b){_0x192481(null,_0xb56a0b?_0xb56a0b[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0x3f6a1d){_0x192481(_0x3f6a1d);});};AGIVertices[_0x627d('0x12')][_0x627d('0x19')]=function(_0x930cba,_0x4b2fc7){this[_0x627d('0x10')][_0x627d('0x1a')](_0x930cba)[_0x627d('0x14')](function(_0x169c96){_0x4b2fc7(null,_0x169c96?_0x169c96[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0x1de41a){_0x4b2fc7(_0x1de41a);});};AGIVertices[_0x627d('0x12')][_0x627d('0x1b')]=function(_0x88303d,_0xb3ea3){this['rpc'][_0x627d('0x1c')](_0x88303d)['then'](function(_0x117a0f){_0xb3ea3(null,_0x117a0f?_0x117a0f[_0x627d('0x1d')]:![]);})['catch'](function(_0x49a931){_0xb3ea3(_0x49a931);});};AGIVertices[_0x627d('0x12')][_0x627d('0x1e')]=function(_0x98e0b2,_0x2d5bb9){this[_0x627d('0x10')][_0x627d('0x1f')](_0x98e0b2)[_0x627d('0x14')](function(_0x369524){_0x2d5bb9(null,_0x369524?_0x369524[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0x5472fd){_0x2d5bb9(_0x5472fd);});};AGIVertices[_0x627d('0x12')][_0x627d('0x20')]=function(_0x2b800e,_0x1ac247){this[_0x627d('0x10')][_0x627d('0x21')](_0x2b800e)[_0x627d('0x14')](function(_0xc9b740){_0x1ac247(null,_0xc9b740?_0xc9b740[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0x4a7d5c){_0x1ac247(_0x4a7d5c);});};AGIVertices[_0x627d('0x12')]['getSound']=function(_0x798362,_0x323d76){var _0x245f7d=this;this[_0x627d('0x10')]['getSoundById'](_0x798362)[_0x627d('0x14')](function(_0xa151bf){_0x323d76(null,_0xa151bf?_0x245f7d[_0x627d('0x22')](_0xa151bf['save_name']):![]);})[_0x627d('0x16')](function(_0x809b){_0x323d76(_0x809b);});};AGIVertices[_0x627d('0x12')][_0x627d('0x23')]=function(_0x451555,_0x4daeb2){this[_0x627d('0x10')][_0x627d('0x24')](_0x451555)[_0x627d('0x14')](function(_0x2bd728){_0x4daeb2(null,_0x2bd728?_0x2bd728:![]);})['catch'](function(_0x5c6221){_0x4daeb2(_0x5c6221);});};AGIVertices[_0x627d('0x12')]['sendMailMessage']=function(_0x9dcaf3,_0x3a5232,_0x4104ab){this[_0x627d('0x11')][_0x627d('0x25')](_0x9dcaf3,_0x3a5232)['then'](function(){_0x4104ab(null);})['catch'](function(_0xff1d35){_0x4104ab(_0xff1d35);});};AGIVertices[_0x627d('0x12')][_0x627d('0x26')]=function(_0x40026d,_0x6a4193){this[_0x627d('0x10')]['getIntervalById'](_0x40026d)[_0x627d('0x14')](function(_0x41fe51){if(_0x41fe51){if(_0x41fe51[_0x627d('0x27')]){_0x6a4193(null,[_0x41fe51[_0x627d('0x28')]]);}else{_0x6a4193(null,_[_0x627d('0x29')](_0x41fe51['Intervals'],_0x627d('0x28')));}}else{_0x6a4193(null,![]);}})[_0x627d('0x16')](function(_0x349605){_0x6a4193(_0x349605);});};AGIVertices['prototype'][_0x627d('0x22')]=function(_0x17ba4f){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x17ba4f);};AGIVertices[_0x627d('0x12')][_0x627d('0x2a')]=function(_0x41c6a4,_0x5f4210,_0x237134){odbc['open'](_0x41c6a4,function(_0x5ee1c4){if(_0x5ee1c4){logger[_0x627d('0x2b')](_0x627d('0x2c'),_0x5ee1c4);_0x237134(_0x5ee1c4);}else{logger['info'](_0x627d('0x2d'));odbc['query'](_0x5f4210,function(_0x55ee26,_0x3ab202){if(_0x55ee26){logger[_0x627d('0x2e')](_0x627d('0x2f'),_0x5f4210);_0x237134(_0x55ee26);}else{logger[_0x627d('0x2e')]('Query\x20executed\x20correctly\x20%s',_0x5f4210);odbc[_0x627d('0x30')](function(_0x1b86f8){if(_0x1b86f8){logger[_0x627d('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1b86f8);}_0x237134(null,_0x3ab202);});}});}});};AGIVertices[_0x627d('0x12')][_0x627d('0x31')]=function(_0x3793ea,_0x26f92c){this['rpc'][_0x627d('0x32')](_0x3793ea)[_0x627d('0x14')](function(_0x2a0f5a){_0x26f92c(null,_0x2a0f5a?_0x2a0f5a:![]);})[_0x627d('0x16')](function(_0x45b952){_0x26f92c(_0x45b952);});};AGIVertices[_0x627d('0x12')][_0x627d('0x33')]=function(_0x41e711,_0x36955c){this[_0x627d('0x10')][_0x627d('0x33')](_0x41e711)[_0x627d('0x14')](function(_0x2b18a2){_0x36955c(null,_0x2b18a2);})[_0x627d('0x16')](function(_0x103dd2){_0x36955c(_0x103dd2);});};AGIVertices['prototype'][_0x627d('0x34')]=function(_0x4b994b,_0x566e48,_0xa8efe8){this[_0x627d('0x10')][_0x627d('0x34')]({'uniqueid':this['channel'][_0x627d('0x35')],'node':_0x4b994b[_0x627d('0x36')],'application':_0x4b994b[_0x627d('0x37')],'data':_0x566e48||null,'project_name':this[_0x627d('0xf')]['arg_1'],'callerid':this[_0x627d('0xf')][_0x627d('0x38')]})[_0x627d('0x14')](function(_0x1abc18){if(_0xa8efe8){_0xa8efe8(null,_0x1abc18);}})[_0x627d('0x16')](function(_0x35b41f){if(_0xa8efe8){_0xa8efe8(_0x35b41f);}});};AGIVertices[_0x627d('0x12')][_0x627d('0x39')]=function(_0x2988cc,_0x4446cf,_0x182bbf,_0x233794){this[_0x627d('0x10')][_0x627d('0x39')]({'uniqueid':this[_0x627d('0xf')][_0x627d('0x35')],'callerid':this['channel'][_0x627d('0x38')],'calleridname':this[_0x627d('0xf')][_0x627d('0x3a')],'context':this[_0x627d('0xf')]['context'],'extension':this[_0x627d('0xf')][_0x627d('0x3b')],'priority':this[_0x627d('0xf')][_0x627d('0x3c')],'accountcode':this['channel'][_0x627d('0x3d')],'dnid':this['channel'][_0x627d('0x3e')],'projectName':this[_0x627d('0xf')][_0x627d('0x3f')],'saveName':_0x4446cf,'filename':_0x2988cc[_0x627d('0x40')]||_0x4446cf,'savePath':_0x182bbf})[_0x627d('0x14')](function(_0x38bcc9){_0x233794(null,_0x38bcc9);})[_0x627d('0x16')](function(_0x2f8676){_0x233794(_0x2f8676);});};AGIVertices[_0x627d('0x12')]['createSquareMessage']=function(_0x2aa737,_0x22586f,_0x3cb804,_0x59764c,_0x2377c4){this[_0x627d('0x10')]['createSquareMessage']({'uniqueid':this[_0x627d('0xf')]['uniqueid'],'body':_0x2aa737,'direction':_0x22586f,'providerName':_0x3cb804,'providerResponse':_0x59764c})[_0x627d('0x14')](function(_0x42dd43){if(_0x2377c4){_0x2377c4(null,_0x42dd43);}})[_0x627d('0x16')](function(_0x3606a0){if(_0x2377c4){_0x2377c4(_0x3606a0);}});};AGIVertices[_0x627d('0x12')][_0x627d('0x41')]=function(_0x29fbc3,_0x267794){this[_0x627d('0x10')][_0x627d('0x41')]({'firstName':_[_0x627d('0x42')](_0x29fbc3[_0x627d('0x15')])||_[_0x627d('0x43')](_0x29fbc3['name'])?_0x627d('0x44')+Math[_0x627d('0x45')]():_0x29fbc3[_0x627d('0x15')],'lastName':_['isEmpty'](_0x29fbc3['lastName'])||_['isNil'](_0x29fbc3['lastName'])?null:_0x29fbc3['lastName'],'phone':_0x29fbc3[_0x627d('0x46')],'ListId':_0x29fbc3[_0x627d('0x47')],'scheduledat':_0x29fbc3['scheduledAt'],'callbackUniqueid':this[_0x627d('0xf')][_0x627d('0x35')],'tags':_0x627d('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x29fbc3['scheduledAt'][_0x627d('0x49')](),'priority':_0x29fbc3[_0x627d('0x4a')]})[_0x627d('0x14')](function(_0x13efef){_0x267794(null,_0x13efef);})[_0x627d('0x16')](function(_0x61e009){_0x267794(_0x61e009);});};AGIVertices[_0x627d('0x12')][_0x627d('0x4b')]=function(_0x25a191,_0x4018ab){this[_0x627d('0x10')][_0x627d('0x4c')](_0x25a191)[_0x627d('0x14')](function(_0xf8fc2a){_0x4018ab(null,_0xf8fc2a?_0xf8fc2a[_0x627d('0x15')]:![]);})[_0x627d('0x16')](function(_0xb87e26){_0x4018ab(_0xb87e26);});};AGIVertices[_0x627d('0x12')][_0x627d('0x4d')]=function(_0x495976,_0x591913,_0x318355){var _0x51fc7f={'role':_0x627d('0x4e')};_0x51fc7f[_0x495976]=this[_0x627d('0xf')][_0x627d('0x38')];this[_0x627d('0x10')][_0x627d('0x4d')](_0x51fc7f,_0x591913,this[_0x627d('0xf')][_0x627d('0x35')])[_0x627d('0x14')](function(_0x15b158){_0x318355(null,_[_0x627d('0x43')](_0x15b158)?![]:!![]);})[_0x627d('0x16')](function(_0x34215c){logger['error'](_0x34215c);_0x318355(null,![]);});};AGIVertices[_0x627d('0x12')][_0x627d('0x4f')]=function(_0x3be896,_0x4a0e44){var _0x206099={'role':_0x627d('0x4e')};_0x206099[_0x3be896]=this[_0x627d('0xf')][_0x627d('0x38')];this[_0x627d('0x10')][_0x627d('0x4f')](_0x206099)[_0x627d('0x14')](function(_0x5690a5){_0x4a0e44(null,_[_0x627d('0x43')](_0x5690a5)?![]:!![]);})[_0x627d('0x16')](function(_0x181a4e){logger['error'](_0x181a4e);_0x4a0e44(null,![]);});};AGIVertices[_0x627d('0x12')][_0x627d('0x50')]=function(_0x468dd6,_0x1b6deb){var _0x3900a1={'role':_0x627d('0x4e')};_0x3900a1[_0x468dd6]=this['channel'][_0x627d('0x38')];this[_0x627d('0x10')][_0x627d('0x50')](_0x3900a1)[_0x627d('0x14')](function(_0x4d495d){_0x1b6deb(null,_[_0x627d('0x43')](_0x4d495d)?![]:!![]);})[_0x627d('0x16')](function(_0x18b36a){logger[_0x627d('0x2b')](_0x18b36a);_0x1b6deb(null,![]);});};AGIVertices[_0x627d('0x12')][_0x627d('0x51')]=function(_0xb6796e,_0x3fdc37){var _0x299bb2={'role':_0x627d('0x4e')};_0x299bb2[_0xb6796e]=this['channel']['callerid'];var _0x56b6db=_0xb6796e!=_0x627d('0x52')?util[_0x627d('0x53')]('%s/%s@from-sip/n',_0x627d('0x54'),this['channel'][_0x627d('0x38')]):undefined;this[_0x627d('0x10')][_0x627d('0x51')](_0x299bb2,_0x56b6db)[_0x627d('0x14')](function(_0x34d98f){_0x3fdc37(null,_['isNil'](_0x34d98f)?![]:!![]);})[_0x627d('0x16')](function(_0x350989){logger[_0x627d('0x2b')](_0x350989);_0x3fdc37(null,![]);});};AGIVertices[_0x627d('0x12')][_0x627d('0x55')]=function(_0x6d14a3,_0x5d3b52){sh[_0x627d('0x56')](_[_0x627d('0x57')](_0x6d14a3),function(_0x70dfc8,_0x73c961){var _0x2afbea=_0x73c961[_0x627d('0x58')](/(\r\n|\n|\r)/gm,'');_0x5d3b52(null,_0x2afbea);});};AGIVertices['prototype'][_0x627d('0x59')]=function(_0x355ecf,_0x383d03){scripts['googleCloudTTS'](_0x355ecf[_0x627d('0x5a')],_0x355ecf['google_cloud_tts_text_type']||_0x627d('0x5b'),_0x355ecf[_0x627d('0x5b')],_0x355ecf['languageCode']||_0x627d('0x5c'),_0x355ecf[_0x627d('0x5d')]||_0x627d('0x5e'),_0x355ecf['audioEncoding']||_0x627d('0x5f'))['then'](function(_0x5cc6e6){_0x383d03(null,_0x5cc6e6);})[_0x627d('0x16')](function(_0x1cc482){_0x383d03(_0x1cc482);});};AGIVertices[_0x627d('0x12')][_0x627d('0x60')]=function(_0x206a41,_0x5bfe1c){scripts['googleTTS'](_0x206a41[_0x627d('0x5b')],_0x206a41[_0x627d('0x61')]||'en',0x1)['then'](function(_0x49b912){_0x5bfe1c(null,_0x49b912);})[_0x627d('0x16')](function(_0x378b26){_0x5bfe1c(_0x378b26);});};AGIVertices[_0x627d('0x12')][_0x627d('0x62')]=function(_0x130ad2,_0x6d7f48){var _0x583ac7={'uri':_0x130ad2[_0x627d('0x63')],'method':_0x130ad2['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x130ad2[_0x627d('0x64')])==='number'&&parseInt(_0x130ad2[_0x627d('0x64')])>=0x1?parseInt(_0x130ad2[_0x627d('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x627d('0x65')](['POST','PUT'],_0x583ac7['method'][_0x627d('0x66')]())){try{_0x583ac7[_0x627d('0x67')]=_0x130ad2[_0x627d('0xb')]?JSON['parse'](_0x130ad2[_0x627d('0xb')]):{};}catch(_0x41e474){logger[_0x627d('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x41e474);}}try{_0x583ac7[_0x627d('0x68')]=_0x130ad2[_0x627d('0xa')]?JSON[_0x627d('0x69')](_0x130ad2[_0x627d('0xa')]):{};}catch(_0x117a22){logger['error'](_0x627d('0x6a'),_0x117a22);}if(_0x130ad2[_0x627d('0x6b')]){try{var _0x556bbc=require(_0x130ad2[_0x627d('0x6b')])[_0x627d('0x6c')](this,_0x583ac7);_0x583ac7[_0x627d('0x6d')]=Mustache['render'](_0x130ad2[_0x627d('0x63')],_0x556bbc,{},['$$','$$']);if(_0x583ac7[_0x627d('0x68')]){_0x583ac7[_0x627d('0x68')]=JSON[_0x627d('0x69')](Mustache[_0x627d('0x6e')](JSON['stringify'](_0x583ac7[_0x627d('0x68')]),_0x556bbc,{},['$$','$$']));}if(_0x583ac7[_0x627d('0x67')]){_0x583ac7[_0x627d('0x67')]=JSON[_0x627d('0x69')](Mustache[_0x627d('0x6e')](JSON[_0x627d('0x6f')](_0x583ac7[_0x627d('0x67')]),_0x556bbc,{},['$$','$$']));}}catch(_0x5ae2d4){logger['error'](_0x627d('0x70'),_0x5ae2d4);}}rp(_0x583ac7)[_0x627d('0x14')](function(_0x494bde){var _0x3efdef={'statusCode':_0x494bde['statusCode']||0xc8,'statusMessage':_0x494bde['statusMessage']||'OK','headers':_0x494bde[_0x627d('0x68')]||{},'body':_0x494bde[_0x627d('0x67')]||{}};_0x6d7f48(null,_0x3efdef);})[_0x627d('0x16')](function(_0x1d0500){var _0x3d3354={'statusCode':_0x1d0500[_0x627d('0x71')]||0x1f4,'statusMessage':_0x1d0500[_0x627d('0x72')]||_0x627d('0x73'),'headers':_0x1d0500[_0x627d('0x74')][_0x627d('0x68')]||{},'body':_0x1d0500['options']['body']||{}};_0x6d7f48(null,_0x3d3354);});};AGIVertices[_0x627d('0x12')][_0x627d('0x75')]=function(_0x9682ef,_0x1fdc8c){scripts['googleDialogflow'](this[_0x627d('0xf')][_0x627d('0x35')],_0x9682ef[_0x627d('0x76')],_0x9682ef[_0x627d('0x5b')],_0x9682ef[_0x627d('0x77')]||'en')[_0x627d('0x14')](function(_0x1181c7){_0x1fdc8c(null,_0x1181c7);})[_0x627d('0x16')](function(_0x21abbb){_0x1fdc8c(_0x21abbb);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x144956,_0x46c2b7){scripts['googleDialogflowV2'](this[_0x627d('0xf')][_0x627d('0x35')],_0x144956[_0x627d('0x78')],_0x144956[_0x627d('0x79')],_0x144956['private_key'],_0x144956['text'],_0x144956['dialogflowV2_language']||'en')[_0x627d('0x14')](function(_0xfe8e38){_0x46c2b7(null,_0xfe8e38);})['catch'](function(_0x5c94f2){_0x46c2b7(_0x5c94f2);});};AGIVertices[_0x627d('0x12')]['sestekNDA']=function(_0x5dd1a7,_0x50b277){scripts[_0x627d('0x7a')](this[_0x627d('0xf')],_0x5dd1a7)[_0x627d('0x14')](function(_0x3b8166){_0x50b277(null,_0x3b8166);})[_0x627d('0x16')](function(_0x3a11d2){_0x50b277(_0x3a11d2);});};AGIVertices[_0x627d('0x12')][_0x627d('0x7b')]=function(_0x29dfeb,_0x214073){scripts[_0x627d('0x7b')](_0x29dfeb[_0x627d('0x76')],_0x29dfeb[_0x627d('0x5b')],_0x29dfeb['ispeech_tts_language']||_0x627d('0x5c'),_0x29dfeb[_0x627d('0x7c')])['then'](function(_0x4d2ac6){_0x214073(null,_0x4d2ac6);})['catch'](function(_0x47bac6){_0x214073(_0x47bac6);});};AGIVertices[_0x627d('0x12')][_0x627d('0x7d')]=function(_0x4210b1,_0xcda6b0,_0xcf505d){scripts[_0x627d('0x7d')](_0xcda6b0,_0x4210b1[_0x627d('0x76')],_0x4210b1[_0x627d('0x7e')]||'en-US',this[_0x627d('0x7f')](_0x4210b1[_0x627d('0x80')])?_0x4210b1['model']:undefined)[_0x627d('0x14')](function(_0x4a1550){_0xcf505d(null,_0x4a1550);})[_0x627d('0x16')](function(_0x1a4734){_0xcf505d(_0x1a4734);});};AGIVertices[_0x627d('0x12')][_0x627d('0x81')]=function(_0x5bba22,_0x3ea490){scripts[_0x627d('0x81')](_0x5bba22['aws_access_key_id'],_0x5bba22[_0x627d('0x82')],_0x5bba22[_0x627d('0x83')],_0x5bba22[_0x627d('0x84')]||_0x627d('0x85'),_0x5bba22[_0x627d('0x5b')],_0x5bba22[_0x627d('0x86')]||'text')[_0x627d('0x14')](function(_0x47fbaf){_0x3ea490(null,_0x47fbaf);})[_0x627d('0x16')](function(_0x46e8f4){_0x3ea490(_0x46e8f4);});};AGIVertices[_0x627d('0x12')][_0x627d('0x87')]=function(_0x287736,_0x316cce){scripts[_0x627d('0x87')](this[_0x627d('0xf')]['uniqueid'],_0x287736[_0x627d('0x88')],_0x287736[_0x627d('0x82')],_0x287736[_0x627d('0x89')],_0x287736['text'],_0x287736[_0x627d('0x8a')])[_0x627d('0x14')](function(_0x2d8c42){_0x316cce(null,_0x2d8c42);})[_0x627d('0x16')](function(_0xa4f975){_0x316cce(_0xa4f975);});};AGIVertices[_0x627d('0x12')][_0x627d('0x8b')]=function(_0x4424c0,_0x57e2a7,_0x47df47){scripts[_0x627d('0x8b')](_0x57e2a7,_0x4424c0['key'],_0x4424c0[_0x627d('0x8c')]||_0x627d('0x5c'))[_0x627d('0x14')](function(_0x4c306e){_0x47df47(null,_0x4c306e);})['catch'](function(_0x527535){_0x47df47(_0x527535);});};AGIVertices[_0x627d('0x12')]['tildeASR']=function(_0x521377,_0x44acaa,_0x527330){scripts[_0x627d('0x8d')](_0x44acaa,_0x521377[_0x627d('0x8e')],_0x521377[_0x627d('0x8f')],_0x521377['uri'])['then'](function(_0x3aba93){_0x527330(null,_0x3aba93);})[_0x627d('0x16')](function(_0x531f9c){_0x527330(_0x531f9c);});};AGIVertices[_0x627d('0x12')][_0x627d('0x90')]=function(_0x5e84c5){var _0x423fa6=_[_0x627d('0x65')](verticesWithRetry,_0x5e84c5[_0x627d('0x37')])?_0x5e84c5:_[_0x627d('0x91')](_0x5e84c5);for(var _0x5e9789 in _0x423fa6){if(_0x423fa6[_0x627d('0x92')](_0x5e9789)){if(_0x423fa6[_0x5e9789]&&_[_0x627d('0x93')](_0x423fa6[_0x5e9789])){if(_[_0x627d('0x65')](recursiveMapAttributes,_0x5e9789)){_0x423fa6[_0x5e9789]=this[_0x627d('0x94')](_0x423fa6[_0x5e9789]);}else{_0x423fa6[_0x5e9789]=this[_0x627d('0x95')](_0x423fa6[_0x5e9789]);}}}}return _0x423fa6;};AGIVertices[_0x627d('0x12')][_0x627d('0x96')]=function(_0x57bdeb){for(var _0x37a4d5 in _0x57bdeb){if(_0x57bdeb[_0x627d('0x92')](_0x37a4d5)){if(_['isPlainObject'](_0x57bdeb[_0x37a4d5])){this[_0x627d('0x96')](_0x57bdeb[_0x37a4d5]);}else if(_['isArray'](_0x57bdeb[_0x37a4d5])){for(var _0x367813=0x0;_0x367813<_0x57bdeb[_0x37a4d5]['length'];_0x367813++){this[_0x627d('0x96')](_0x57bdeb[_0x37a4d5][_0x367813]);}}else if(_['isString'](_0x57bdeb[_0x37a4d5])){_0x57bdeb[_0x37a4d5]=this[_0x627d('0x95')](_0x57bdeb[_0x37a4d5]);}}}};AGIVertices[_0x627d('0x12')][_0x627d('0x97')]=function(_0x417d8b,_0xb8a428){for(var _0x1f5910 in _0x417d8b){if(_0x417d8b[_0x627d('0x92')](_0x1f5910)){if(_[_0x627d('0x98')](_0x417d8b[_0x1f5910])){if(!_[_0x627d('0x42')](_0x417d8b[_0x1f5910])){this['saveRestApiResult'](_0x417d8b[_0x1f5910],util[_0x627d('0x53')](_0x627d('0x99'),_0xb8a428,_0x1f5910));}}else if(_[_0x627d('0x9a')](_0x417d8b[_0x1f5910])){for(var _0x3e793b=0x0;_0x3e793b<_0x417d8b[_0x1f5910][_0x627d('0x9b')];_0x3e793b++){this['saveRestApiResult'](_0x417d8b[_0x1f5910][_0x3e793b],util['format']('%s.%s',_0xb8a428,_0x1f5910+'['+_0x3e793b+']'));}}else{if(!_[_0x627d('0x43')](_0x417d8b[_0x1f5910])){this[_0x627d('0xf')][_0x627d('0x9c')](util['format'](_0x627d('0x99'),_0xb8a428,_0x1f5910),_0x417d8b[_0x1f5910]);}}}}};AGIVertices['prototype'][_0x627d('0x94')]=function(_0x35fa7d){try{var _0x272326=JSON[_0x627d('0x69')](_0x35fa7d);this[_0x627d('0x96')](_0x272326);return JSON['stringify'](_0x272326);}catch(_0x48534e){return this[_0x627d('0x95')](_0x35fa7d);}};AGIVertices[_0x627d('0x12')][_0x627d('0x95')]=function(_0x2ff8ce){var _0x400831=_0x2ff8ce[_0x627d('0x9d')]('{');for(var _0x3f9c16=0x1;_0x3f9c16<_0x400831[_0x627d('0x9b')];_0x3f9c16+=0x1){var _0x1e7434=_0x400831[_0x3f9c16][_0x627d('0x9d')]('}');if(_0x1e7434[_0x627d('0x9b')]>0x1){_0x2ff8ce=_0x2ff8ce[_0x627d('0x9e')]('{'+_0x1e7434[0x0]+'}',this[_0x627d('0xf')][_0x627d('0x9f')](_0x1e7434[0x0])[_0x627d('0xa0')]||_0x1e7434[0x0]);}}if(_0x400831[_0x627d('0x9b')]===0x1){return _0x2ff8ce[_0x627d('0x49')]();}return this['replaceAllVariables'](_0x2ff8ce);};AGIVertices['prototype'][_0x627d('0xa1')]=function(_0x1cb302,_0x3e4227){var _0x1f53c1=this[_0x627d('0xf')][_0x627d('0x9f')](_0x1cb302);if(_0x1f53c1['result']===-0x1){return _0x1f53c1;}logger['info'](util[_0x627d('0x53')](_0x627d('0xa2'),_0x3e4227,_0x1f53c1['extra']));return this[_0x627d('0xf')][_0x627d('0x9c')](_0x3e4227,_0x1f53c1[_0x627d('0xa0')]);};AGIVertices['prototype']['isConfigured']=function(_0xc960c0){return _0xc960c0&&_0xc960c0!=='0'&&_0xc960c0!=='-1'&&_0xc960c0!=='';};AGIVertices[_0x627d('0x12')][_0x627d('0xa3')]=function(_0xcb3d7a){this[_0x627d('0x34')][_0x627d('0x6c')](this,_0xcb3d7a,'-');_0xcb3d7a[_0x627d('0xa4')]=_0xcb3d7a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x627d('0x12')]['mrcpsynth']=function(_0x425636){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x425636[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x425636[_0x627d('0x5b')])){return this[_0x627d('0xf')]['noop'](_0x627d('0xa5'));}var _0x39846d='\x22'+_0x425636[_0x627d('0x5b')]+'\x22';if(this['isConfigured'](_0x425636[_0x627d('0x74')])){_0x39846d+=','+_0x425636[_0x627d('0x74')];}var _0x11f0a5=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0xa6'),_0x39846d);if(_0x11f0a5['result']===-0x1){return _0x11f0a5;}return this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xa8'),_0x39846d));};AGIVertices[_0x627d('0x12')][_0x627d('0xa9')]=function(_0x1ab406){logger[_0x627d('0x2e')](util['format'](_0x627d('0xaa'),_0x1ab406[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x1ab406[_0x627d('0xab')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xac'));}var _0xa833b6=_0x1ab406[_0x627d('0xab')];if(this[_0x627d('0x7f')](_0x1ab406['options'])){_0xa833b6+=','+_0x1ab406[_0x627d('0x74')];}var _0x391be9=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0xad'),_0xa833b6);if(_0x391be9[_0x627d('0xae')]===-0x1){return _0x391be9;}var _0x545e36=this[_0x627d('0xa1')](_0x627d('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x545e36[_0x627d('0xae')]===-0x1){return _0x545e36;}var _0x3d2795=this[_0x627d('0xa1')](_0x627d('0xb0'),_0x627d('0xb1'));if(_0x3d2795[_0x627d('0xae')]===-0x1){return _0x3d2795;}var _0x302546=this['getAndSetVariable'](_0x627d('0xb2'),_0x627d('0xb3'));if(_0x302546['result']===-0x1){return _0x302546;}return this['channel'][_0x627d('0xa7')](util['format'](_0x627d('0xb4'),_0xa833b6));};AGIVertices[_0x627d('0x12')][_0x627d('0x7')]=function(_0x157b26){logger[_0x627d('0x2e')](util['format'](_0x627d('0xb5'),_0x157b26['label']));return this[_0x627d('0xf')][_0x627d('0x7')]([_0x157b26['command'],_0x157b26[_0x627d('0xb6')]]);};AGIVertices[_0x627d('0x12')]['answer']=function(_0x32205b){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x32205b[_0x627d('0x36')]));if(this['isConfigured'](_0x32205b['timeout'])){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0xb7'),_0x32205b[_0x627d('0x64')]));var _0x247c7c=this[_0x627d('0xf')][_0x627d('0xb8')](_0x32205b['timeout']);if(_0x247c7c[_0x627d('0xae')]===-0x1){return _0x247c7c;}}return this[_0x627d('0xf')][_0x627d('0xb9')]();};AGIVertices[_0x627d('0x12')][_0x627d('0x48')]=function(_0x40ce39){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x40ce39[_0x627d('0x36')]));if(!this['isConfigured'](_0x40ce39['list_id'])){return this['channel']['error'](_0x40ce39,_0x627d('0xba'));}_0x40ce39[_0x627d('0xbb')]=moment();if(this[_0x627d('0x7f')](_0x40ce39['delay'])){_0x40ce39['scheduledAt']=moment()['add'](_0x40ce39[_0x627d('0xbc')],_0x627d('0xbd'));}if(!this[_0x627d('0x7f')](_0x40ce39[_0x627d('0x4a')])){_0x40ce39[_0x627d('0x4a')]=0x2;}this[_0x627d('0x41')][_0x627d('0x6c')](this,_0x40ce39);return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xbe'),_0x40ce39['phone'],_0x40ce39[_0x627d('0x47')],_0x40ce39[_0x627d('0xbb')]));};AGIVertices[_0x627d('0x12')][_0x627d('0xbf')]=function(_0x16a157){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x16a157['label']));var _0x85bc3c=this['channel']['exec'](_0x16a157[_0x627d('0xc0')],_0x16a157['options']);if(_0x85bc3c[_0x627d('0xae')]===-0x1){return _0x85bc3c;}return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xc1'),_0x16a157[_0x627d('0xc0')],_0x16a157[_0x627d('0x74')]));};AGIVertices[_0x627d('0x12')][_0x627d('0xc2')]=function(_0x54488b){logger['info'](util['format'](_0x627d('0xc3'),_0x54488b[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x54488b['text'])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20text\x20configured');}var _0x8018d5='\x22'+_0x54488b[_0x627d('0x5b')]+'\x22';if(this[_0x627d('0x7f')](_0x54488b[_0x627d('0x74')])){_0x8018d5+=','+_0x54488b[_0x627d('0x74')];}var _0xfa994e=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0xa6'),_0x8018d5);if(_0xfa994e[_0x627d('0xae')]===-0x1){return _0xfa994e;}return this[_0x627d('0xf')][_0x627d('0xa7')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x8018d5));};AGIVertices[_0x627d('0x12')][_0x627d('0xc4')]=function(_0x224d43){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0xc5'),_0x224d43[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x224d43[_0x627d('0x5b')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xa5'));}var _0x5735cd='\x22'+_0x224d43[_0x627d('0x5b')]+'\x22';if(this[_0x627d('0x7f')](_0x224d43[_0x627d('0x74')])){_0x5735cd+=','+_0x224d43[_0x627d('0x74')];}var _0x12e8e7=this['channel'][_0x627d('0x56')](_0x627d('0xa6'),_0x5735cd);if(_0x12e8e7[_0x627d('0xae')]===-0x1){return _0x12e8e7;}return this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xa8'),_0x5735cd));};AGIVertices['prototype']['lumenvoxasr']=function(_0x233362){logger[_0x627d('0x2e')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x233362[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x233362[_0x627d('0xab')])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20grammar\x20configured');}var _0x46d1d7=_0x233362[_0x627d('0xab')];if(this[_0x627d('0x7f')](_0x233362[_0x627d('0x74')])){_0x46d1d7+=','+_0x233362['options'];}var _0x3cb8f1=this[_0x627d('0xf')]['exec'](_0x627d('0xad'),_0x46d1d7);if(_0x3cb8f1[_0x627d('0xae')]===-0x1){return _0x3cb8f1;}var _0x340bf1=this[_0x627d('0xa1')](_0x627d('0xaf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x340bf1['result']===-0x1){return _0x340bf1;}var _0x131865=this[_0x627d('0xa1')]('RECOG_INPUT()',_0x627d('0xc6'));if(_0x131865[_0x627d('0xae')]===-0x1){return _0x131865;}var _0x4320f1=this[_0x627d('0xa1')]('RECOG_INSTANCE()',_0x627d('0xc7'));if(_0x4320f1['result']===-0x1){return _0x4320f1;}return this['channel']['noop'](util[_0x627d('0x53')](_0x627d('0xb4'),_0x46d1d7));};AGIVertices['prototype'][_0x627d('0xc8')]=function(_0x355b2e){logger['info'](util[_0x627d('0x53')](_0x627d('0xc9'),_0x355b2e[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x355b2e[_0x627d('0xab')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xac'));}var _0x464c5a=_0x355b2e[_0x627d('0xab')];if(this[_0x627d('0x7f')](_0x355b2e[_0x627d('0x74')])){_0x464c5a+=','+_0x355b2e['options'];}var _0x7c0c81=this[_0x627d('0xf')][_0x627d('0x56')]('MRCPRecog',_0x464c5a);if(_0x7c0c81[_0x627d('0xae')]===-0x1){return _0x7c0c81;}var _0x3b0ac9=this[_0x627d('0xa1')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x3b0ac9[_0x627d('0xae')]===-0x1){return _0x3b0ac9;}var _0x267214=this[_0x627d('0xa1')](_0x627d('0xb0'),_0x627d('0xca'));if(_0x267214[_0x627d('0xae')]===-0x1){return _0x267214;}var _0x3164c9=this[_0x627d('0xa1')]('RECOG_INSTANCE()',_0x627d('0xcb'));if(_0x3164c9[_0x627d('0xae')]===-0x1){return _0x3164c9;}return this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xb4'),_0x464c5a));};AGIVertices[_0x627d('0x12')]['database']=function(_0x1bbfb9){logger[_0x627d('0x2e')](util['format'](_0x627d('0xcc'),_0x1bbfb9[_0x627d('0x36')]));if(!this['isConfigured'](_0x1bbfb9[_0x627d('0xcd')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1bbfb9,_0x627d('0xce'));}var _0x97a56c=this[_0x627d('0x1b')]['sync'](this,_0x1bbfb9[_0x627d('0xcd')]);if(!_0x97a56c){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1bbfb9,_0x627d('0xcf'));}if(!this[_0x627d('0x7f')](_0x1bbfb9[_0x627d('0xd0')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1bbfb9,_0x627d('0xd1'));}var _0x2e5337=_0x1bbfb9['query'][_0x627d('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0xd2'),_0x2e5337));var _0x2d6601=this[_0x627d('0x2a')]['sync'](this,_0x97a56c,_0x2e5337);this['createSquareDetailsReport']['sync'](this,_0x1bbfb9,_0x2e5337);if(!this[_0x627d('0x7f')](_0x1bbfb9[_0x627d('0xd3')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xd4'));}var _0x195fd3=this[_0x627d('0x9f')]['sync'](this,_0x1bbfb9[_0x627d('0xd3')]);if(!_0x195fd3){return this['channel'][_0x627d('0x2b')](_0x1bbfb9,_0x627d('0xd5'));}var _0x53cce6=this;_0x2d6601['forEach'](function(_0x475c0b,_0x4153ec){Object[_0x627d('0xd6')](_0x475c0b)[_0x627d('0xd7')](function(_0x548d72){_0x53cce6['channel'][_0x627d('0x9c')](util[_0x627d('0x53')](_0x627d('0xd8'),_0x195fd3,_0x4153ec,_0x548d72),_0x475c0b[_0x548d72]);});});this[_0x627d('0xf')][_0x627d('0x9c')](util[_0x627d('0x53')]('%s_ROWS_COUNT',_0x195fd3),_0x2d6601[_0x627d('0x9b')]);return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xd9'),_0x195fd3));};AGIVertices['prototype'][_0x627d('0xda')]=function(_0x6d789){logger[_0x627d('0xdb')](util[_0x627d('0x53')](_0x627d('0xdc'),_0x6d789[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x6d789[_0x627d('0xdd')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x6d789,'no\x20user\x20selected');}var _0xbacfc9=this['getUser'][_0x627d('0x6c')](this,_0x6d789['sip_id']);if(!_0xbacfc9){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x6d789,_0x627d('0xde'));}var _0x109f56=this['channel'][_0x627d('0x56')]('DIAL',[util['format'](_0x627d('0xdf'),_0xbacfc9),_0x6d789[_0x627d('0x64')],_0x6d789[_0x627d('0xe0')],_0x6d789[_0x627d('0x63')]]);if(_0x109f56[_0x627d('0xae')]===-0x1){return _0x109f56;}return this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x627d('0xe1')]=function(_0x8b886f){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0xe2'),_0x8b886f[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x8b886f[_0x627d('0x76')])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20key\x20configured');}if(!this[_0x627d('0x7f')](_0x8b886f[_0x627d('0x5b')])){return this[_0x627d('0xf')]['noop'](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xe3')]=!![];this[_0x627d('0x34')](_0x8b886f);this[_0x627d('0xe4')](_0x8b886f[_0x627d('0x5b')],'in','','');this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('Trying\x20Dialogflow:\x20%s',_0x8b886f['text']));var _0x21c8e7=this['googleDialogflow'][_0x627d('0x6c')](this,_0x8b886f);if(_0x21c8e7){for(var _0x5996b4 in _0x21c8e7){if(_0x21c8e7['hasOwnProperty'](_0x5996b4)){this[_0x627d('0xf')][_0x627d('0x9c')](util['format'](_0x627d('0xe5'),_0x5996b4[_0x627d('0x66')]()),_0x21c8e7[_0x5996b4]);}}this[_0x627d('0xe4')](_0x21c8e7[_0x627d('0xe6')],'out','dialogflow','');return this['channel'][_0x627d('0xa7')](util['format'](_0x627d('0xe7'),_0x21c8e7[_0x627d('0xe6')]));}return this['channel']['error'](_0x8b886f,_0x627d('0xe8'));};AGIVertices[_0x627d('0x12')][_0x627d('0xe9')]=function(_0x1a1669){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0xea'),_0x1a1669[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x1a1669[_0x627d('0x78')])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20project_id\x20configured');}if(!this[_0x627d('0x7f')](_0x1a1669[_0x627d('0x79')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xeb'));}if(!this[_0x627d('0x7f')](_0x1a1669['private_key'])){return this[_0x627d('0xf')]['noop']('no\x20private_key\x20configured');}if(!this[_0x627d('0x7f')](_0x1a1669[_0x627d('0xec')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xed'));}if(!this[_0x627d('0x7f')](_0x1a1669[_0x627d('0x5b')])){return this['channel'][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xe3')]=!![];this[_0x627d('0x34')](_0x1a1669);this[_0x627d('0xe4')](_0x1a1669['text'],'in','','');this[_0x627d('0xf')][_0x627d('0xa7')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x1a1669[_0x627d('0x5b')]));var _0x2b754f=this[_0x627d('0xee')][_0x627d('0x6c')](this,_0x1a1669);if(_0x2b754f){for(var _0xc206f6 in _0x2b754f){if(_0x2b754f['hasOwnProperty'](_0xc206f6)){if(_0xc206f6!==_0x627d('0xef')){this[_0x627d('0xf')][_0x627d('0x9c')](util[_0x627d('0x53')](_0x627d('0xe5'),_0xc206f6[_0x627d('0x66')]()),_0x2b754f[_0xc206f6]);}}}this[_0x627d('0xe4')](_0x2b754f[_0x627d('0xe6')],_0x627d('0xf0'),_0x627d('0xe9'),_0x2b754f[_0x627d('0xef')]);return this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0xf1'),_0x2b754f[_0x627d('0xe6')]));}return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1a1669,_0x627d('0xf2'));};AGIVertices[_0x627d('0x12')][_0x627d('0xf3')]=function(_0x52d77a){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x52d77a[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x52d77a['ndauth_url'])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xf4'));}if(!this[_0x627d('0x7f')](_0x52d77a['username'])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xf5'));}if(!this[_0x627d('0x7f')](_0x52d77a[_0x627d('0xf6')])){return this['channel'][_0x627d('0xa7')]('no\x20password\x20configured');}if(!this[_0x627d('0x7f')](_0x52d77a['ndassistant_url'])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')]['bot']=!![];this[_0x627d('0x34')](_0x52d77a);this[_0x627d('0xe4')](_0x52d77a['text'],'in','','');this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0xf7'),_0x52d77a['text']));var _0x782d5e=this['sestekNDA'][_0x627d('0x6c')](this,_0x52d77a);if(_0x782d5e){for(var _0x23598a in _0x782d5e){if(_0x782d5e['hasOwnProperty'](_0x23598a)){this[_0x627d('0xf')][_0x627d('0x9c')](util['format'](_0x627d('0xf8'),_0x23598a[_0x627d('0x66')]()),_0x782d5e[_0x23598a]);}}this[_0x627d('0xe4')](_0x782d5e[_0x627d('0xe6')],_0x627d('0xf0'),_0x627d('0xf3'),'');if(_0x782d5e[_0x627d('0xf9')]){this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0xfa'),_0x782d5e[_0x627d('0xf9')]));var _0x13c5db=this[_0x627d('0xf')]['streamFile'](_0x782d5e[_0x627d('0xf9')]);try{fs[_0x627d('0xfb')](_0x782d5e[_0x627d('0xf9')]+_0x627d('0xfc'));}catch(_0x78784e){logger['error'](_0x78784e);}return _0x13c5db;}else{return this[_0x627d('0xf')][_0x627d('0xa7')](util['format']('SestekNDA\x20Result\x20%s',_0x782d5e['speech']));}}return this['channel'][_0x627d('0x2b')](_0x52d77a,_0x627d('0xfd'));};AGIVertices[_0x627d('0x12')][_0x627d('0xfe')]=function(_0x3283e4){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3283e4[_0x627d('0x36')]));return this[_0x627d('0xf')][_0x627d('0xa7')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x5d2de3){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5d2de3[_0x627d('0x36')]));var _0x30c5d3='';if(_0x5d2de3[_0x627d('0xff')]){if(!this[_0x627d('0x7f')](_0x5d2de3[_0x627d('0xff')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x5d2de3,_0x627d('0x100'));}else{var _0x52891f=parseInt(_0x5d2de3[_0x627d('0xff')],0xa);if(isNaN(_0x52891f)){_0x30c5d3=_0x5d2de3[_0x627d('0xff')];}else{_0x30c5d3=this[_0x627d('0x20')][_0x627d('0x6c')](this,_0x5d2de3[_0x627d('0xff')]);if(!_0x30c5d3){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x5d2de3,_0x627d('0x101'));}}}}else if(_0x5d2de3[_0x627d('0x102')]){_0x30c5d3=_0x5d2de3[_0x627d('0x102')];}else{return this[_0x627d('0xf')][_0x627d('0x2b')](_0x5d2de3,_0x627d('0x100'));}var _0xa42687=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0x103'),[util['format'](_0x627d('0x104'),_0x30c5d3,_0x5d2de3[_0x627d('0x46')]),_0x5d2de3[_0x627d('0x64')],_0x5d2de3[_0x627d('0xe0')],_0x5d2de3['url']]);if(_0xa42687['result']===-0x1){return _0xa42687;}return this[_0x627d('0xf')]['noop'](util['format'](_0x627d('0x105'),_0x627d('0x103')));};AGIVertices['prototype']['finally']=function(_0x52c498){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x106'),_0x52c498['label']));return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x107'));};AGIVertices[_0x627d('0x12')][_0x627d('0xd')]=function(_0x36c094){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x108'),_0x36c094[_0x627d('0x36')]));if(_0x36c094[_0x627d('0xa4')]===0x0){return this[_0x627d('0xa3')](_0x36c094);}_0x36c094['retry']-=0x1;if(!this[_0x627d('0x7f')](_0x36c094[_0x627d('0x109')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x36c094,_0x627d('0x10a'));}var _0x3cbf4b=this[_0x627d('0x10b')][_0x627d('0x6c')](this,_0x36c094[_0x627d('0x109')]);if(!_0x3cbf4b){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x36c094,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x36c094['variable_id'])){return this[_0x627d('0xf')]['error'](_0x627d('0xd4'));}var _0x2116d2=this[_0x627d('0xf')][_0x627d('0x10c')](_0x3cbf4b,_0x36c094[_0x627d('0x10d')],_0x36c094[_0x627d('0x10e')]);var _0x4a5396=_0x2116d2[_0x627d('0xae')]?_0x2116d2['result'][_0x627d('0x49')]():'';logger['info'](_0x627d('0x10f'),JSON['stringify'](_0x2116d2));if(_0x2116d2[_0x627d('0xae')]===-0x1){this[_0x627d('0x34')]['sync'](this,_0x36c094,_0x4a5396);return _0x2116d2;}else if(_0x2116d2[_0x627d('0xa0')]==='timeout'){_0x2116d2[_0x627d('0xae')]=_0x4a5396[_0x627d('0x9b')]>=parseInt(_0x36c094['mindigit'])?'x':'i';}else{_0x2116d2[_0x627d('0xae')]=_0x4a5396['length']>=parseInt(_0x36c094[_0x627d('0x110')])&&_0x4a5396[_0x627d('0x9b')]<=parseInt(_0x36c094[_0x627d('0x10e')])?'x':'i';}var _0x292ed3=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0x36c094[_0x627d('0xd3')]);if(!_0x292ed3){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x36c094,_0x627d('0xd5'));}this[_0x627d('0xf')][_0x627d('0x9c')](_0x292ed3,_0x4a5396);if(this[_0x627d('0x7f')](_0x36c094[_0x627d('0x111')])){var _0x3d6c43=parseInt(_0x36c094[_0x627d('0x111')],0xa);var _0x3852f7=rs['generate']({'charset':'*','length':_0x3d6c43});var _0x5845d1=_0x4a5396[_0x627d('0x9b')];if(_0x5845d1>0x0){if(_0x5845d1>_0x3d6c43){this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x36c094,_0x36c094['hiddendigitspos']===_0x627d('0x112')?_0x3852f7+_0x4a5396[_0x627d('0x113')](_0x3d6c43):_0x4a5396[_0x627d('0x113')](0x0,_0x5845d1-_0x3d6c43)+_0x3852f7);}else{this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x36c094,rs[_0x627d('0x114')]({'charset':'*','length':_0x5845d1}));}}else{this[_0x627d('0x34')]['sync'](this,_0x36c094,'');}}else{this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x36c094,_0x4a5396);}return _0x2116d2;};AGIVertices[_0x627d('0x12')][_0x627d('0xe')]=function(_0x2f81ce){logger[_0x627d('0x2e')](util['format'](_0x627d('0x115'),_0x2f81ce['label']));return this['getdigits'](_0x2f81ce);};AGIVertices[_0x627d('0x12')][_0x627d('0x116')]=function(_0x3c2393){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x117'),_0x3c2393[_0x627d('0x36')]));this['createSquareDetailsReport'][_0x627d('0x6c')](this,_0x3c2393,_0x3c2393['goalname']);return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x118'),_0x3c2393['goalname']));};AGIVertices[_0x627d('0x12')][_0x627d('0x119')]=function(_0x244fe0){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x244fe0[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x244fe0[_0x627d('0x88')])||!this['isConfigured'](_0x244fe0[_0x627d('0x82')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x11a'));}if(!this[_0x627d('0x7f')](_0x244fe0['text'])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0x11b'),_0x244fe0['text']));var _0xc4a70f=this[_0x627d('0x81')][_0x627d('0x6c')](this,_0x244fe0);if(_0xc4a70f){this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')]('aws\x20Polly\x20%s\x20file\x20created',_0xc4a70f));var _0x67c89b=this[_0x627d('0xf')][_0x627d('0x11c')](_0xc4a70f);try{fs[_0x627d('0xfb')](_0xc4a70f+_0x627d('0xfc'));}catch(_0x52d374){logger[_0x627d('0x2b')](_0x52d374);}return _0x67c89b;}return this[_0x627d('0xf')][_0x627d('0x2b')](_0x244fe0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x627d('0x12')]['awslex']=function(_0x3e94ea){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x11d'),_0x3e94ea[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x3e94ea['aws_access_key_id'])||!this[_0x627d('0x7f')](_0x3e94ea[_0x627d('0x82')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x11a'));}if(!this[_0x627d('0x7f')](_0x3e94ea['aws_bot_name'])){return this[_0x627d('0xf')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x3e94ea[_0x627d('0x5b')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xe3')]=!![];this[_0x627d('0x34')](_0x3e94ea);this[_0x627d('0xe4')](_0x3e94ea[_0x627d('0x5b')],'in','','');this['channel']['noop'](util[_0x627d('0x53')](_0x627d('0x11e'),_0x3e94ea[_0x627d('0x5b')]));var _0x3d1778=this['awsLex'][_0x627d('0x6c')](this,_0x3e94ea);if(_0x3d1778){for(var _0x1a011f in _0x3d1778){if(_0x3d1778[_0x627d('0x92')](_0x1a011f)&&_[_0x627d('0x93')](_0x3d1778[_0x1a011f])){this['channel']['setVariable'](util['format'](_0x627d('0x11f'),_0x1a011f['toUpperCase']()),_0x3d1778[_0x1a011f]);}}if(_['isNil'](_0x3d1778['message'])){return this['channel'][_0x627d('0xa7')](_0x627d('0x120'));}else{this[_0x627d('0xe4')](_0x3d1778['message'],_0x627d('0xf0'),'amazonlex','');return this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0x121'),_0x3d1778[_0x627d('0x72')]));}}return this[_0x627d('0xf')][_0x627d('0x2b')](_0x3e94ea,_0x627d('0x122'));};AGIVertices[_0x627d('0x12')][_0x627d('0x123')]=function(_0x4b9b45){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x124'),_0x4b9b45['label'],_0x4b9b45[_0x627d('0x64')]));if(!this[_0x627d('0x7f')](_0x4b9b45[_0x627d('0x76')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x125'));}var _0x253450=_0x627d('0x126');var _0xb93406=util[_0x627d('0x53')](_0x627d('0x127'),FILES_PATH,rs[_0x627d('0x114')](0x4));var _0x5edce0=util[_0x627d('0x53')](_0x627d('0x99'),_0xb93406,_0x253450);var _0x55a3d3=!![];if(_0x4b9b45[_0x627d('0x128')]===_0x627d('0x129')){_0x55a3d3=![];}var _0x136a6e=this[_0x627d('0xf')][_0x627d('0x12a')](_0xb93406,_0x253450,_0x4b9b45['intKey'],_0x4b9b45[_0x627d('0x64')],undefined,_0x55a3d3);if(_0x136a6e[_0x627d('0xae')]!==-0x1){this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('google\x20%s\x20file\x20created',_0x5edce0));var _0x525ad2=this[_0x627d('0x8b')][_0x627d('0x6c')](this,_0x4b9b45,_0x5edce0);if(_0x525ad2){for(var _0x1d12f9 in _0x525ad2){if(_0x525ad2[_0x627d('0x92')](_0x1d12f9)){this[_0x627d('0xf')]['setVariable'](util['format'](_0x627d('0x12b'),_0x1d12f9[_0x627d('0x66')]()),_0x525ad2[_0x1d12f9]);}}return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x525ad2)));}}return _0x136a6e;};AGIVertices['prototype'][_0x627d('0x12c')]=function(_0x57a757){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x12d'),_0x57a757[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x57a757['appid'])){return this['channel'][_0x627d('0xa7')](_0x627d('0x12e'));}if(!this[_0x627d('0x7f')](_0x57a757[_0x627d('0x8f')])){return this[_0x627d('0xf')]['noop'](_0x627d('0x12f'));}var _0x358846=_0x627d('0x126');var _0x1cff87=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3af154=util[_0x627d('0x53')](_0x627d('0x99'),_0x1cff87,_0x358846);var _0x5e84a2=!![];if(_0x57a757[_0x627d('0x128')]===_0x627d('0x129')){_0x5e84a2=![];}var _0x13a626=this['channel'][_0x627d('0x12a')](_0x1cff87,_0x358846,_0x57a757[_0x627d('0x130')],_0x57a757[_0x627d('0x64')],undefined,_0x5e84a2);if(_0x13a626[_0x627d('0xae')]!==-0x1){this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x131'),_0x3af154));var _0x379874=this[_0x627d('0x8d')][_0x627d('0x6c')](this,_0x57a757,_0x3af154);if(_0x379874){for(var _0x2d2062 in _0x379874){if(_0x379874[_0x627d('0x92')](_0x2d2062)){this[_0x627d('0xf')]['setVariable'](util[_0x627d('0x53')](_0x627d('0x132'),_0x2d2062[_0x627d('0x66')]()),_0x379874[_0x2d2062]);}}return this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x133'),JSON['stringify'](_0x379874)));}}return _0x13a626;};AGIVertices['prototype'][_0x627d('0x134')]=function(_0x151369){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x135'),_0x151369[_0x627d('0x36')]));return this['channel'][_0x627d('0x136')](_0x151369[_0x627d('0x137')],_0x151369[_0x627d('0x3b')],_0x151369['priority']);};AGIVertices['prototype'][_0x627d('0x138')]=function(_0x3f828e){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x139'),_0x3f828e[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x3f828e['condition'])){return this['channel'][_0x627d('0x2b')](_0x3f828e,_0x627d('0x13a'));}try{var _0x3f12a1=eval(_0x3f828e['condition'])?_0x627d('0x13b'):_0x627d('0x13c');this['channel'][_0x627d('0xa7')](util['format'](_0x627d('0x13d'),_0x3f828e[_0x627d('0x13e')],_0x3f12a1));return{'code':0xc8,'result':_0x3f12a1};}catch(_0x3f04cb){return{'code':0xc8,'result':_0x627d('0x13c')};}};AGIVertices[_0x627d('0x12')]['gotoiftime']=function(_0xc377fb){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x13f'),_0xc377fb[_0x627d('0x36')]));if(!this['isConfigured'](_0xc377fb[_0x627d('0x140')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0xc377fb,_0x627d('0x141'));}var _0x5aaf51=this[_0x627d('0x26')][_0x627d('0x6c')](this,_0xc377fb[_0x627d('0x140')]);if(!_0x5aaf51){return this['channel']['error'](_0xc377fb,_0x627d('0x142'));}for(var _0x308179=0x0;_0x308179<_0x5aaf51[_0x627d('0x9b')];_0x308179+=0x1){var _0x43519b=this[_0x627d('0xf')][_0x627d('0x9f')](util[_0x627d('0x53')](_0x627d('0x143'),_0x5aaf51[_0x308179]));if(_0x43519b[_0x627d('0xae')]===-0x1){return _0x43519b;}logger[_0x627d('0x2e')](util['format'](_0x627d('0x144'),_0x5aaf51[_0x308179],_0x43519b[_0x627d('0xa0')]));if(_0x43519b[_0x627d('0xa0')]===_0x627d('0x13b')){logger[_0x627d('0x2e')](util['format'](_0x627d('0x144'),_0x5aaf51[_0x308179],_0x627d('0x13b')));this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')]('IFTIME\x20%s\x20%s',_0x5aaf51[_0x308179],_0x627d('0x13b')));return{'code':0xc8,'result':_0x627d('0x13b')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x5aaf51[_0x308179],_0x627d('0x13c')));this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0x144'),_0x5aaf51[_0x308179],'false'));}}return{'code':0xc8,'result':_0x627d('0x13c')};};AGIVertices[_0x627d('0x12')]['hangup']=function(_0xf1e5cd){logger[_0x627d('0x2e')](util['format'](_0x627d('0x145'),_0xf1e5cd[_0x627d('0x36')]));return this[_0x627d('0xf')]['hangup']();};AGIVertices[_0x627d('0x12')]['ispeechasr']=function(_0x57f873){logger[_0x627d('0x2e')](util['format'](_0x627d('0x146'),_0x57f873['label']));if(!this[_0x627d('0x7f')](_0x57f873['key'])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x125'));}var _0x2c97b5=_0x627d('0x126');var _0x48e476=util[_0x627d('0x53')](_0x627d('0x127'),FILES_PATH,rs[_0x627d('0x114')](0x4));var _0x6c2fc9=util['format'](_0x627d('0x99'),_0x48e476,_0x2c97b5);var _0x4f9c94=!![];if(_0x57f873['beep']===_0x627d('0x129')){_0x4f9c94=![];}var _0x2f52ff=this[_0x627d('0xf')]['recordFile'](_0x48e476,_0x2c97b5,_0x57f873['intKey'],_0x57f873['timeout'],undefined,_0x4f9c94);if(_0x2f52ff[_0x627d('0xae')]!==-0x1){this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0x147'),_0x6c2fc9));var _0x1b17a2=this[_0x627d('0x7d')][_0x627d('0x6c')](this,_0x57f873,_0x6c2fc9);if(_0x1b17a2){for(var _0x28453f in _0x1b17a2){if(_0x1b17a2[_0x627d('0x92')](_0x28453f)){this[_0x627d('0xf')][_0x627d('0x9c')](util['format']('ISPEECH_ASR_%s',_0x28453f[_0x627d('0x66')]()),_0x1b17a2[_0x28453f]);}}return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x148'),JSON[_0x627d('0x6f')](_0x1b17a2)));}}return _0x2f52ff;};AGIVertices[_0x627d('0x12')][_0x627d('0x149')]=function(_0x4b833e){logger['info'](util[_0x627d('0x53')](_0x627d('0x14a'),_0x4b833e[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x4b833e[_0x627d('0x76')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x125'));}if(!this['isConfigured'](_0x4b833e['text'])){return this['channel'][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('Trying\x20ispeech\x20TTS\x20%s',_0x4b833e[_0x627d('0x5b')]));var _0x51bce4=this['ispeechTTS'][_0x627d('0x6c')](this,_0x4b833e);if(_0x51bce4){this['channel']['noop'](util[_0x627d('0x53')](_0x627d('0x147'),_0x51bce4));var _0x383096=this[_0x627d('0xf')][_0x627d('0x11c')](_0x51bce4,_0x4b833e['intKey']);try{fs[_0x627d('0xfb')](_0x51bce4+_0x627d('0xfc'));}catch(_0x16484d){logger['error'](_0x16484d);}return _0x383096;}return this[_0x627d('0xf')][_0x627d('0x2b')](_0x4b833e,_0x627d('0x14b'));};AGIVertices[_0x627d('0x12')]['login']=function(_0x1cafaa){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x14c'),_0x1cafaa[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x1cafaa['findBy'])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1cafaa,_0x627d('0x14d'));}logger[_0x627d('0x2e')](util[_0x627d('0x53')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x627d('0xf')]['callerid'],_0x1cafaa['findBy']));var _0x4a3764=this['agentLogin'][_0x627d('0x6c')](this,_0x1cafaa['findBy']);if(_0x4a3764){logger['info'](util[_0x627d('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x627d('0xf')][_0x627d('0x38')],_0x1cafaa[_0x627d('0x14e')]));this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0x14f'),this['channel']['callerid'],_0x1cafaa[_0x627d('0x14e')]));return{'code':0xc8,'result':_0x627d('0x150')};}else{logger['info'](util['format'](_0x627d('0x151'),this[_0x627d('0xf')]['callerid'],_0x1cafaa[_0x627d('0x14e')]));this[_0x627d('0xf')][_0x627d('0xa7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x627d('0x38')],_0x1cafaa['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x627d('0x152')]=function(_0x3cd2f2){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x153'),_0x3cd2f2[_0x627d('0x36')]));if(!this['isConfigured'](_0x3cd2f2[_0x627d('0x14e')])){return this[_0x627d('0xf')]['error'](_0x3cd2f2,_0x627d('0x14d'));}logger['info'](util[_0x627d('0x53')](_0x627d('0x154'),this[_0x627d('0xf')][_0x627d('0x38')],_0x3cd2f2[_0x627d('0x14e')]));var _0xd46690=this[_0x627d('0x50')]['sync'](this,_0x3cd2f2[_0x627d('0x14e')]);if(_0xd46690){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x14f'),this[_0x627d('0xf')][_0x627d('0x38')],_0x3cd2f2[_0x627d('0x14e')]));this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x14f'),this['channel']['callerid'],_0x3cd2f2[_0x627d('0x14e')]));return{'code':0xc8,'result':_0x627d('0x150')};}else{logger[_0x627d('0x2e')](util['format'](_0x627d('0x151'),this[_0x627d('0xf')]['callerid'],_0x3cd2f2['findBy']));this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0x151'),this[_0x627d('0xf')]['callerid'],_0x3cd2f2[_0x627d('0x14e')]));return{'code':0xc8,'result':_0x627d('0x155')};}};AGIVertices[_0x627d('0x12')][_0x627d('0x156')]=function(_0x22952a){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x157'),_0x22952a[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x22952a['operation'])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x22952a,_0x627d('0x158'));}this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x159'),_0x22952a['operation']));var _0x9fe290=eval(_0x22952a[_0x627d('0x15a')]);if(!this[_0x627d('0x7f')](_0x22952a[_0x627d('0xd3')])){return this['channel'][_0x627d('0xa7')](_0x627d('0xd4'));}var _0x2e2b83=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0x22952a['variable_id']);if(!_0x2e2b83){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x22952a,_0x627d('0xd5'));}if(_[_0x627d('0x9a')](_0x9fe290)){var _0x1be378=this;_0x9fe290['forEach'](function(_0x498d1,_0x4a6338){_0x1be378['channel']['setVariable'](util[_0x627d('0x53')]('%s[%s]',_0x2e2b83,_0x4a6338),_0x498d1);});return this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')]('variable\x20%s[key]\x20set',_0x2e2b83));}else{return this[_0x627d('0xf')][_0x627d('0x9c')](_0x2e2b83,_0x9fe290);}};AGIVertices[_0x627d('0x12')][_0x627d('0xc')]=function(_0x679e91){logger['info'](util['format'](_0x627d('0x15b'),_0x679e91[_0x627d('0x36')]));if(_0x679e91[_0x627d('0xa4')]===0x0){return this['maxRetry'](_0x679e91);}_0x679e91[_0x627d('0xa4')]-=0x1;if(!this[_0x627d('0x7f')](_0x679e91[_0x627d('0x109')])){return this[_0x627d('0xf')]['error'](_0x679e91,_0x627d('0x10a'));}var _0x3dfbbe=this['getSound'][_0x627d('0x6c')](this,_0x679e91[_0x627d('0x109')]);if(!_0x3dfbbe){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x679e91,_0x627d('0x15c'));}var _0x3dd813=this[_0x627d('0xf')]['getData'](_0x3dfbbe,_0x679e91[_0x627d('0x10d')],_0x679e91[_0x627d('0x15d')]);var _0x3e2cde=_0x3dd813[_0x627d('0xae')];if(_0x3dd813[_0x627d('0xae')]===-0x1){this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x679e91,'-1');return _0x3dd813;}else if(_0x3dd813[_0x627d('0xa0')]==='timeout'){_0x3dd813[_0x627d('0xae')]=_0x3dd813[_0x627d('0xae')][_0x627d('0x9b')]>0x0?_0x3dd813[_0x627d('0xae')]:'t';}else if(_[_0x627d('0x42')](_0x3dd813[_0x627d('0xae')])){_0x3dd813[_0x627d('0xae')]='#';_0x3e2cde='#';}if(!this[_0x627d('0x7f')](_0x679e91[_0x627d('0xd3')])){this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xd4'));}else{var _0x5f3a24=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0x679e91[_0x627d('0xd3')]);if(!_0x5f3a24){return this[_0x627d('0xf')]['error'](_0x679e91,_0x627d('0xd5'));}this[_0x627d('0xf')]['setVariable'](_0x5f3a24,_0x3e2cde);}this['createSquareDetailsReport'][_0x627d('0x6c')](this,_0x679e91,_0x3e2cde);return _0x3dd813;};AGIVertices[_0x627d('0x12')]['noop']=function(_0x45a452){logger['info'](util['format'](_0x627d('0x15e'),_0x45a452[_0x627d('0x36')]));return this[_0x627d('0xf')][_0x627d('0xa7')](_0x45a452[_0x627d('0x15f')]||_0x45a452[_0x627d('0x36')]);};AGIVertices[_0x627d('0x12')][_0x627d('0x160')]=function(_0x269bdc){logger['info'](util[_0x627d('0x53')](_0x627d('0x161'),_0x269bdc[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x269bdc[_0x627d('0x14e')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x269bdc,_0x627d('0x14d'));}logger[_0x627d('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x627d('0xf')][_0x627d('0x38')],_0x269bdc[_0x627d('0x14e')]));var _0x4ad513=this[_0x627d('0x4b')]['sync'](this,_0x269bdc['pause_id']);var _0xd090aa=this[_0x627d('0x4d')][_0x627d('0x6c')](this,_0x269bdc[_0x627d('0x14e')],_0x4ad513);if(_0xd090aa){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x14f'),this[_0x627d('0xf')][_0x627d('0x38')],_0x269bdc['findBy']));this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x14f'),this['channel']['callerid'],_0x269bdc[_0x627d('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x151'),this[_0x627d('0xf')][_0x627d('0x38')],_0x269bdc[_0x627d('0x14e')]));this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0x14f'),this[_0x627d('0xf')][_0x627d('0x38')],_0x269bdc[_0x627d('0x14e')]));return{'code':0xc8,'result':_0x627d('0x155')};}};AGIVertices[_0x627d('0x12')][_0x627d('0x162')]=function(_0x33d395){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x33d395[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x33d395[_0x627d('0x109')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x33d395,'no\x20file\x20audio\x20selected');}var _0x125bab=this[_0x627d('0x10b')][_0x627d('0x6c')](this,_0x33d395[_0x627d('0x109')]);if(!_0x125bab){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x33d395,'no\x20file\x20audio\x20found');}var _0x1cf44f=this[_0x627d('0xf')]['exec'](_0x627d('0x163'),[_0x125bab,_0x33d395[_0x627d('0xe0')]]);if(_0x1cf44f[_0x627d('0xae')]===-0x1){return _0x1cf44f;}return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('Executed\x20command\x20%s\x20%s',_0x627d('0x163'),_0x125bab));};AGIVertices[_0x627d('0x12')][_0x627d('0x164')]=function(_0x1e8b27){logger[_0x627d('0x2e')](util['format'](_0x627d('0x165'),_0x1e8b27[_0x627d('0x36')]));if(!this['isConfigured'](_0x1e8b27[_0x627d('0x166')])){return this['channel'][_0x627d('0x2b')](_0x1e8b27,_0x627d('0x167'));}var _0x486ef4='';var _0x5e1324=parseInt(_0x1e8b27[_0x627d('0x166')],0xa);if(isNaN(_0x5e1324)){_0x486ef4=_0x1e8b27['queue_id'];}else{_0x486ef4=this[_0x627d('0x17')][_0x627d('0x6c')](this,_0x1e8b27['queue_id']);if(!_0x486ef4){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x1e8b27,_0x627d('0x168'));}}var _0x57343a='';if(this[_0x627d('0x7f')](_0x1e8b27['file_id'])){var _0x3af5bd=this[_0x627d('0x10b')][_0x627d('0x6c')](this,_0x1e8b27[_0x627d('0x109')]);if(_0x3af5bd){_0x57343a=_0x3af5bd;}}this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x1e8b27,_0x486ef4);if(_0x1e8b27[_0x627d('0xe0')][_0x627d('0x169')]('x')<0x0){_0x1e8b27['opts']+='x';}if(_0x1e8b27[_0x627d('0xe0')][_0x627d('0x169')]('X')<0x0){_0x1e8b27[_0x627d('0xe0')]+='X';}this[_0x627d('0xf')][_0x627d('0x9c')](_0x627d('0x16a'),_0x486ef4?_0x486ef4[_0x627d('0x16b')]():'');var _0x5a40d2=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0x16c'),[_0x486ef4,_0x1e8b27[_0x627d('0xe0')],_0x1e8b27['url'],_0x57343a,_0x1e8b27[_0x627d('0x64')],_0x1e8b27[_0x627d('0x7')],_0x1e8b27[_0x627d('0x16d')],_0x1e8b27['gosub'],'',_0x1e8b27['position']]);if(_0x5a40d2['result']===-0x1){return _0x5a40d2;}return this['channel']['noop'](util[_0x627d('0x53')](_0x627d('0xc1'),_0x627d('0x16c'),_0x486ef4));};AGIVertices[_0x627d('0x12')][_0x627d('0x16e')]=function(_0xb4c440){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x16f'),_0xb4c440[_0x627d('0x36')]));var _0x24e990=_0xb4c440[_0x627d('0x170')]||_0x627d('0x126');var _0x5d058b=util[_0x627d('0x53')](_0x627d('0x171'),this[_0x627d('0xf')][_0x627d('0x35')],rs['generate'](0x5));var _0xd3e4a9=util['format'](_0x627d('0x172'),FILES_PATH,_0x5d058b,_0x24e990);var _0x594fb0=util['format'](_0x627d('0x127'),FILES_PATH,_0x5d058b);this['createSquareRecording'][_0x627d('0x6c')](this,_0xb4c440,_0x5d058b,_0xd3e4a9);this[_0x627d('0xf')]['setVariable'](_0x627d('0x173'),_0x5d058b);logger[_0x627d('0x2e')](_0x627d('0x174'),_0x594fb0,_0x24e990,_0xb4c440[_0x627d('0x175')],_0xb4c440['timeout']);return this[_0x627d('0xf')]['recordFile'](_0x594fb0,_0x24e990,_0xb4c440[_0x627d('0x175')],_0xb4c440[_0x627d('0x64')],undefined,!![]);};AGIVertices[_0x627d('0x12')]['restapi']=function(_0xc5f33){logger['info'](util[_0x627d('0x53')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xc5f33[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0xc5f33['url'])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20url\x20configured');}var _0x321f20=this[_0x627d('0x62')][_0x627d('0x6c')](this,_0xc5f33);logger['info'](util[_0x627d('0x53')](_0x627d('0x176'),util['inspect'](_0x321f20,{'showHidden':![],'depth':null})));if(!this[_0x627d('0x7f')](_0xc5f33[_0x627d('0xd3')])){return this['channel'][_0x627d('0xa7')](_0x627d('0x177'));}var _0x49585a=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0xc5f33[_0x627d('0xd3')]);if(!_0x49585a){return this['channel'][_0x627d('0x2b')](_0xc5f33,'no\x20variable\x20found');}this['channel'][_0x627d('0x9c')](util[_0x627d('0x53')](_0x627d('0x178'),_0x49585a),_0x321f20[_0x627d('0x71')]?_0x321f20[_0x627d('0x71')]:'200');this[_0x627d('0xf')]['setVariable'](util[_0x627d('0x53')](_0x627d('0x179'),_0x49585a),_0x321f20[_0x627d('0x17a')]?_0x321f20[_0x627d('0x17a')]:'OK');if(_0x321f20[_0x627d('0x67')]){try{this[_0x627d('0x97')](_0x321f20['body'],_0x49585a);}catch(_0x924d87){logger[_0x627d('0x2b')](util[_0x627d('0x53')](_0x627d('0x17b'),_0x49585a));}}return this[_0x627d('0xf')]['noop'](util[_0x627d('0x53')](_0x627d('0xd9'),_0x49585a));};AGIVertices[_0x627d('0x12')][_0x627d('0x17c')]=function(_0x2341ba){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x17d'),_0x2341ba[_0x627d('0x36')]));return this[_0x627d('0xf')][_0x627d('0x17e')](_0x2341ba[_0x627d('0x17f')][_0x627d('0x58')](/\s+/g,''),_0x2341ba[_0x627d('0x175')]);};AGIVertices[_0x627d('0x12')]['saynumber']=function(_0x47c244){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x180'),_0x47c244['label']));return this[_0x627d('0xf')]['sayNumber'](_0x47c244['number'][_0x627d('0x58')](/\s+/g,''),_0x47c244[_0x627d('0x175')]);};AGIVertices[_0x627d('0x12')][_0x627d('0x181')]=function(_0x4fea22){logger[_0x627d('0x2e')](util['format'](_0x627d('0x182'),_0x4fea22[_0x627d('0x36')]));return this[_0x627d('0xf')]['sayPhonetic'](_0x4fea22[_0x627d('0x5b')],_0x4fea22[_0x627d('0x175')]);};AGIVertices[_0x627d('0x12')]['sendMail']=function(_0x275e99){logger[_0x627d('0x2e')](util['format'](_0x627d('0x183'),_0x275e99[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x275e99['account_id'])){return this[_0x627d('0xf')]['noop'](_0x627d('0x184'));}var _0x33b211=this[_0x627d('0x23')][_0x627d('0x6c')](this,_0x275e99[_0x627d('0x185')]);if(!_0x33b211||!_0x33b211[_0x627d('0x186')]){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x275e99,'no\x20mail\x20account\x20found');}var _0x4d6215={'from':util[_0x627d('0x53')](_0x627d('0x187'),_0x33b211[_0x627d('0x15')],_0x33b211[_0x627d('0x188')]||_0x33b211[_0x627d('0x186')][_0x627d('0x189')]),'to':_0x275e99['to']||'','cc':_0x275e99['cc']||'','bcc':_0x275e99['bcc']||'','subject':_0x275e99[_0x627d('0x18a')],'html':_0x275e99[_0x627d('0x5b')],'text':_0x275e99[_0x627d('0x5b')]};var _0x5e47bb={'tls':{'rejectUnauthorized':![]}};if(_0x33b211[_0x627d('0x186')][_0x627d('0x18b')]){_0x5e47bb[_0x627d('0x18b')]=_0x33b211[_0x627d('0x186')]['service'];}else{_0x5e47bb[_0x627d('0x18c')]=_0x33b211[_0x627d('0x186')][_0x627d('0x18c')];_0x5e47bb[_0x627d('0x18d')]=_0x33b211[_0x627d('0x186')][_0x627d('0x18d')];_0x5e47bb[_0x627d('0x18e')]=_0x33b211[_0x627d('0x186')][_0x627d('0x18e')];}if(_0x33b211[_0x627d('0x186')]['authentication']){_0x5e47bb[_0x627d('0x18f')]={'user':_0x33b211[_0x627d('0x186')][_0x627d('0x189')],'pass':_0x33b211[_0x627d('0x186')][_0x627d('0x190')]};}if(this[_0x627d('0x7f')](_0x275e99['template_id'])){}logger[_0x627d('0xdb')](_0x627d('0x191'),JSON[_0x627d('0x6f')](_0x4d6215));this['createSquareDetailsReport'][_0x627d('0x6c')](this,_0x275e99,_0x275e99[_0x627d('0x185')]);this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x192'),_0x33b211[_0x627d('0x15')]));this['sendMailMessage'][_0x627d('0x6c')](this,_0x5e47bb,_0x4d6215);return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x193'));};AGIVertices[_0x627d('0x12')][_0x627d('0x194')]=function(_0x507c3a){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x195'),_0x507c3a[_0x627d('0x36')]));return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x196'));};AGIVertices[_0x627d('0x12')][_0x627d('0x197')]=function(_0x2e0db3){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x198'),_0x2e0db3['label']));if(!this[_0x627d('0x7f')](_0x2e0db3[_0x627d('0x199')])){return this[_0x627d('0xf')][_0x627d('0xa7')]('no\x20sms\x20account\x20configured');}var _0x581cf4=this['getSmsAccount'][_0x627d('0x6c')](this,_0x2e0db3[_0x627d('0x199')]);if(!_0x581cf4){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x2e0db3,'no\x20sms\x20account\x20found');}var _0x4219b4={'body':_0x2e0db3[_0x627d('0x19a')],'phone':_0x2e0db3['to']||'','SmsAccountId':_0x581cf4['id']};logger[_0x627d('0xdb')](_0x627d('0x19b'),JSON[_0x627d('0x6f')](_0x4219b4));this['createSquareDetailsReport'][_0x627d('0x6c')](this,_0x2e0db3,_0x2e0db3[_0x627d('0x199')]);this[_0x627d('0xf')][_0x627d('0xa7')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x581cf4['name']));this[_0x627d('0x33')][_0x627d('0x6c')](this,_0x4219b4);return this[_0x627d('0xf')][_0x627d('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x627d('0x12')][_0x627d('0x19c')]=function(_0x45bcb1){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x19d'),_0x45bcb1[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x45bcb1[_0x627d('0xd3')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x45bcb1,_0x627d('0x19e'));}var _0x862f82=this['getVariable'][_0x627d('0x6c')](this,_0x45bcb1['variable_id']);if(!_0x862f82){return this['channel'][_0x627d('0x2b')](_0x45bcb1,_0x627d('0xd5'));}return this['channel'][_0x627d('0x9c')](_0x862f82,_0x45bcb1[_0x627d('0x19f')]);};AGIVertices[_0x627d('0x12')]['start']=function(_0x5541fd){logger['info'](util[_0x627d('0x53')](_0x627d('0x1a0'),_0x5541fd['label']));this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x1a1'));if(_0x5541fd[_0x627d('0xb9')]===_0x627d('0x1a2')){this['channel'][_0x627d('0xa7')](_0x627d('0x1a3'));return this[_0x627d('0xf')][_0x627d('0xb9')]();}return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0x1a4'));};AGIVertices[_0x627d('0x12')][_0x627d('0x1a5')]=function(_0x109a38){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x109a38[_0x627d('0x36')]));if(!this[_0x627d('0x7f')](_0x109a38[_0x627d('0x1a6')])){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x109a38,_0x627d('0x1a7'));}var _0x437337=this[_0x627d('0x19')][_0x627d('0x6c')](this,_0x109a38['project_id']);if(!this[_0x627d('0x7f')](_0x437337)){return this[_0x627d('0xf')][_0x627d('0x2b')](_0x109a38,util['format'](_0x627d('0x1a8'),_0x109a38['project_id']));}if(_0x437337===this['channel']['arg_1']){return this[_0x627d('0xf')]['error'](_0x109a38,_0x627d('0x1a9'));}this[_0x627d('0x34')][_0x627d('0x6c')](this,_0x109a38,_0x437337);var _0xd6f715=this['channel']['exec']('AGI',util[_0x627d('0x53')](_0x627d('0x1aa'),config['agi'][_0x627d('0x18c')]||_0x627d('0x1ab'),_0x437337,this[_0x627d('0xf')]['arg_1']));if(_0xd6f715['result']===-0x1){return _0xd6f715;}return this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0xc1'),_0x627d('0x1ac'),_0x437337));};AGIVertices['prototype'][_0x627d('0x1ad')]=function(_0x2bd2c1){logger[_0x627d('0x2e')](util[_0x627d('0x53')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2bd2c1[_0x627d('0x36')]));var _0x5f1b10=this[_0x627d('0x55')][_0x627d('0x6c')](this,_0x2bd2c1['command']);this['createSquareDetailsReport'][_0x627d('0x6c')](this,_0x2bd2c1,_0x2bd2c1['command']);if(this[_0x627d('0x7f')](_0x2bd2c1[_0x627d('0xd3')])){var _0x303309=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0x2bd2c1[_0x627d('0xd3')]);if(_0x303309){this['channel']['setVariable'](_0x303309,_0x5f1b10);return this['channel']['noop'](util[_0x627d('0x53')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2bd2c1[_0x627d('0x1ae')],_0x303309));}}return this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x1af'),_0x2bd2c1[_0x627d('0x1ae')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x3eaaab){logger[_0x627d('0x2e')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3eaaab[_0x627d('0x36')]));_0x3eaaab[_0x627d('0x5b')]=_0x3eaaab[_0x627d('0x5b')][_0x627d('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x627d('0x7f')](_0x3eaaab[_0x627d('0x5a')])){return this[_0x627d('0xf')]['noop'](_0x627d('0x1b0'));}if(!this[_0x627d('0x7f')](_0x3eaaab['text'])){return this['channel'][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x1b1'),_0x3eaaab[_0x627d('0x5b')]));var _0x3845a7=this[_0x627d('0x59')][_0x627d('0x6c')](this,_0x3eaaab);if(_0x3845a7){this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')](_0x627d('0x1b2'),_0x3845a7));var _0x100120=this['channel']['streamFile'](_0x3845a7);try{fs[_0x627d('0xfb')](_0x3845a7+_0x627d('0xfc'));}catch(_0x3542d6){logger[_0x627d('0x2b')](_0x3542d6);}return _0x100120;}return this['channel']['error'](_0x3eaaab,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x627d('0x12')][_0x627d('0x1b3')]=function(_0x2396de){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x1b4'),_0x2396de[_0x627d('0x36')]));_0x2396de[_0x627d('0x5b')]=_0x2396de[_0x627d('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x627d('0x7f')](_0x2396de[_0x627d('0x5b')])){return this[_0x627d('0xf')][_0x627d('0xa7')](_0x627d('0xa5'));}this[_0x627d('0xf')][_0x627d('0xa7')](util[_0x627d('0x53')]('Trying\x20Google\x20TTS\x20%s',_0x2396de['text']));var _0x109a5a=this[_0x627d('0x60')]['sync'](this,_0x2396de);if(_0x109a5a){this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0x1b5'),_0x109a5a));var _0x7b1dfc=this[_0x627d('0xf')][_0x627d('0x11c')](_0x109a5a);try{fs[_0x627d('0xfb')](_0x109a5a+_0x627d('0xfc'));}catch(_0x16503d){logger[_0x627d('0x2b')](_0x16503d);}return _0x7b1dfc;}return this['channel'][_0x627d('0x2b')](_0x2396de,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x627d('0x12')][_0x627d('0x1b6')]=function(_0x16adf2){logger['info'](util[_0x627d('0x53')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16adf2['label']));if(!this[_0x627d('0x7f')](_0x16adf2[_0x627d('0x14e')])){return this[_0x627d('0xf')]['error'](_0x16adf2,'no\x20find\x20by\x20configured');}logger[_0x627d('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x627d('0xf')][_0x627d('0x38')],_0x16adf2['findBy']));var _0x856853=this[_0x627d('0x4f')][_0x627d('0x6c')](this,_0x16adf2[_0x627d('0x14e')]);if(_0x856853){logger[_0x627d('0x2e')](util[_0x627d('0x53')](_0x627d('0x14f'),this['channel'][_0x627d('0x38')],_0x16adf2[_0x627d('0x14e')]));this['channel']['noop'](util[_0x627d('0x53')](_0x627d('0x14f'),this[_0x627d('0xf')][_0x627d('0x38')],_0x16adf2[_0x627d('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0x627d('0x2e')](util['format'](_0x627d('0x151'),this[_0x627d('0xf')][_0x627d('0x38')],_0x16adf2[_0x627d('0x14e')]));this[_0x627d('0xf')][_0x627d('0xa7')](util['format'](_0x627d('0x151'),this['channel'][_0x627d('0x38')],_0x16adf2[_0x627d('0x14e')]));return{'code':0xc8,'result':_0x627d('0x155')};}};AGIVertices[_0x627d('0x12')]['voicemail']=function(_0x2d5da4){logger[_0x627d('0x2e')](util['format'](_0x627d('0x1b7'),_0x2d5da4[_0x627d('0x36')]));var _0x339594=this[_0x627d('0xf')][_0x627d('0x56')](_0x627d('0x1b8'),[_0x2d5da4[_0x627d('0x1b9')],_0x2d5da4[_0x627d('0x74')]]);if(_0x339594[_0x627d('0xae')]===-0x1){return _0x339594;}return this['channel'][_0x627d('0xa7')](util[_0x627d('0x53')]('Executed\x20command\x20%s\x20%s',_0x627d('0x1b8'),_0x2d5da4[_0x627d('0x1b9')]));};AGIVertices[_0x627d('0x12')]['vswitch']=function(_0xaec172){logger['info'](util[_0x627d('0x53')](_0x627d('0x1ba'),_0xaec172['label']));if(!this[_0x627d('0x7f')](_0xaec172['variable_id'])){return this[_0x627d('0xf')]['error'](_0xaec172,_0x627d('0x19e'));}var _0x1b981b=this[_0x627d('0x9f')][_0x627d('0x6c')](this,_0xaec172[_0x627d('0xd3')]);if(!_0x1b981b){return this[_0x627d('0xf')][_0x627d('0x2b')](_0xaec172,_0x627d('0xd5'));}var _0x2dab22=this['channel']['getVariable'](_0x1b981b);return{'code':0xc8,'result':_0x2dab22[_0x627d('0xa0')]?_0x2dab22[_0x627d('0xa0')]:'-'};};String[_0x627d('0x12')][_0x627d('0x9e')]=function(_0x23fa6a,_0x314df0){return this['split'](_0x23fa6a)[_0x627d('0x1bb')](_0x314df0);};module[_0x627d('0x1bc')]=AGIVertices; \ No newline at end of file +var _0xb0cb=['split','join','exports','path','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','createSquareRecording','callerid','calleridname','context','extension','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','parse','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','extra','getAndSetVariable','getVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','sync','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','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','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xb0cb,0x1d0));var _0xbb0c=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb0cb[_0x4c440b];return _0x2d48cf;};'use strict';var fs=require('fs');var path=require(_0xbb0c('0x0'));var util=require('util');var _=require(_0xbb0c('0x1'));var sh=require(_0xbb0c('0x2'));var odbc=require(_0xbb0c('0x3'))();var rs=require(_0xbb0c('0x4'));var moment=require(_0xbb0c('0x5'));var Mustache=require(_0xbb0c('0x6'));var rp=require(_0xbb0c('0x7'));var logger=require(_0xbb0c('0x8'))(_0xbb0c('0x9'));var config=require(_0xbb0c('0xa'));var scripts=require(_0xbb0c('0xb'));var FILES_PATH=_0xbb0c('0xc');var recursiveMapAttributes=[_0xbb0c('0xd'),_0xbb0c('0xe')];var verticesWithRetry=['menu',_0xbb0c('0xf'),_0xbb0c('0x10')];var AGIVertices=function(_0x4b11a3,_0x1632a4,_0x41f9bb){this[_0xbb0c('0x11')]=_0x4b11a3;this['rpc']=_0x1632a4;this[_0xbb0c('0x12')]=_0x41f9bb;};AGIVertices[_0xbb0c('0x13')]['getVariable']=function(_0x129402,_0x1633fb){this[_0xbb0c('0x14')][_0xbb0c('0x15')](_0x129402)['then'](function(_0x4ef046){_0x1633fb(null,_0x4ef046?_0x4ef046[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x2a2a89){_0x1633fb(_0x2a2a89);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x18')]=function(_0xcbe86b,_0x5c1262){this[_0xbb0c('0x14')][_0xbb0c('0x19')](_0xcbe86b)[_0xbb0c('0x1a')](function(_0x3e7e19){_0x5c1262(null,_0x3e7e19?_0x3e7e19[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x2d9ad5){_0x5c1262(_0x2d9ad5);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b')]=function(_0x1ecbfe,_0x2987e9){this['rpc'][_0xbb0c('0x1c')](_0x1ecbfe)[_0xbb0c('0x1a')](function(_0x50897d){_0x2987e9(null,_0x50897d?_0x50897d['name']:![]);})['catch'](function(_0x487a5c){_0x2987e9(_0x487a5c);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1d')]=function(_0x5460b1,_0x5e6d75){this[_0xbb0c('0x14')]['getSquareOdbcById'](_0x5460b1)[_0xbb0c('0x1a')](function(_0x1595ee){_0x5e6d75(null,_0x1595ee?_0x1595ee[_0xbb0c('0x1e')]:![]);})[_0xbb0c('0x17')](function(_0x2e5702){_0x5e6d75(_0x2e5702);});};AGIVertices['prototype'][_0xbb0c('0x1f')]=function(_0x23e034,_0x48ae39){this[_0xbb0c('0x14')][_0xbb0c('0x20')](_0x23e034)[_0xbb0c('0x1a')](function(_0x35b172){_0x48ae39(null,_0x35b172?_0x35b172[_0xbb0c('0x16')]:![]);})['catch'](function(_0x4b0d75){_0x48ae39(_0x4b0d75);});};AGIVertices['prototype'][_0xbb0c('0x21')]=function(_0x3fde1c,_0x4798f7){this['rpc'][_0xbb0c('0x22')](_0x3fde1c)[_0xbb0c('0x1a')](function(_0x247073){_0x4798f7(null,_0x247073?_0x247073[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x544faa){_0x4798f7(_0x544faa);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x23')]=function(_0x5e51f3,_0x39d607){var _0x4f38c6=this;this['rpc'][_0xbb0c('0x24')](_0x5e51f3)[_0xbb0c('0x1a')](function(_0xb1fe66){_0x39d607(null,_0xb1fe66?_0x4f38c6[_0xbb0c('0x25')](_0xb1fe66[_0xbb0c('0x26')]):![]);})[_0xbb0c('0x17')](function(_0x30f616){_0x39d607(_0x30f616);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x27')]=function(_0x3315a9,_0x56cdaa){this[_0xbb0c('0x14')][_0xbb0c('0x28')](_0x3315a9)['then'](function(_0x680b3e){_0x56cdaa(null,_0x680b3e?_0x680b3e:![]);})[_0xbb0c('0x17')](function(_0x5dbd58){_0x56cdaa(_0x5dbd58);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x29')]=function(_0x4a129a,_0x353b11,_0x52eb5b){this[_0xbb0c('0x12')][_0xbb0c('0x29')](_0x4a129a,_0x353b11)[_0xbb0c('0x1a')](function(){_0x52eb5b(null);})[_0xbb0c('0x17')](function(_0x2bbbe0){_0x52eb5b(_0x2bbbe0);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x2a')]=function(_0x4beee0,_0x156d78){this[_0xbb0c('0x14')][_0xbb0c('0x2b')](_0x4beee0)[_0xbb0c('0x1a')](function(_0xc1de4b){if(_0xc1de4b){if(_0xc1de4b[_0xbb0c('0x2c')]){_0x156d78(null,[_0xc1de4b[_0xbb0c('0x2d')]]);}else{_0x156d78(null,_[_0xbb0c('0x2e')](_0xc1de4b[_0xbb0c('0x2f')],_0xbb0c('0x2d')));}}else{_0x156d78(null,![]);}})[_0xbb0c('0x17')](function(_0x4ec654){_0x156d78(_0x4ec654);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x25')]=function(_0x3d1a27){return util['format'](_0xbb0c('0x30'),FILES_PATH,_0x3d1a27);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x31')]=function(_0x2d4f87,_0x558fa4,_0x56883e){odbc[_0xbb0c('0x32')](_0x2d4f87,function(_0x5a1943){if(_0x5a1943){logger[_0xbb0c('0x33')](_0xbb0c('0x34'),_0x5a1943);_0x56883e(_0x5a1943);}else{logger[_0xbb0c('0x35')]('ODBC\x20connection\x20successfully');odbc[_0xbb0c('0x36')](_0x558fa4,function(_0x246f46,_0x334375){if(_0x246f46){logger[_0xbb0c('0x35')](_0xbb0c('0x37'),_0x558fa4);_0x56883e(_0x246f46);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x558fa4);odbc[_0xbb0c('0x38')](function(_0x5dae40){if(_0x5dae40){logger[_0xbb0c('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x5dae40);}_0x56883e(null,_0x334375);});}});}});};AGIVertices['prototype'][_0xbb0c('0x39')]=function(_0x48c389,_0x1a33af){this[_0xbb0c('0x14')][_0xbb0c('0x3a')](_0x48c389)[_0xbb0c('0x1a')](function(_0x27a8ef){_0x1a33af(null,_0x27a8ef?_0x27a8ef:![]);})['catch'](function(_0x803c0a){_0x1a33af(_0x803c0a);});};AGIVertices[_0xbb0c('0x13')]['createSmsMessage']=function(_0x16a8ad,_0x231cfa){this[_0xbb0c('0x14')][_0xbb0c('0x3b')](_0x16a8ad)['then'](function(_0x3c595f){_0x231cfa(null,_0x3c595f);})['catch'](function(_0x4402d3){_0x231cfa(_0x4402d3);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x3c')]=function(_0x5d5f53,_0x3adf8d,_0x3469a6){this[_0xbb0c('0x14')][_0xbb0c('0x3c')]({'uniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'node':_0x5d5f53[_0xbb0c('0x3e')],'application':_0x5d5f53['agicommand'],'data':_0x3adf8d||null,'project_name':this[_0xbb0c('0x11')]['arg_1'],'callerid':this[_0xbb0c('0x11')]['callerid']})[_0xbb0c('0x1a')](function(_0x18a30c){if(_0x3469a6){_0x3469a6(null,_0x18a30c);}})['catch'](function(_0x42e87f){if(_0x3469a6){_0x3469a6(_0x42e87f);}});};AGIVertices[_0xbb0c('0x13')]['createSquareRecording']=function(_0x3cad26,_0x1faa94,_0x12dc5f,_0x1a2b85){this[_0xbb0c('0x14')][_0xbb0c('0x3f')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xbb0c('0x11')][_0xbb0c('0x40')],'calleridname':this[_0xbb0c('0x11')][_0xbb0c('0x41')],'context':this[_0xbb0c('0x11')][_0xbb0c('0x42')],'extension':this['channel'][_0xbb0c('0x43')],'priority':this[_0xbb0c('0x11')]['priority'],'accountcode':this[_0xbb0c('0x11')][_0xbb0c('0x44')],'dnid':this[_0xbb0c('0x11')]['dnid'],'projectName':this[_0xbb0c('0x11')][_0xbb0c('0x45')],'saveName':_0x1faa94,'filename':_0x3cad26[_0xbb0c('0x46')]||_0x1faa94,'savePath':_0x12dc5f})['then'](function(_0x32be21){_0x1a2b85(null,_0x32be21);})['catch'](function(_0x31dd9e){_0x1a2b85(_0x31dd9e);});};AGIVertices['prototype']['createSquareMessage']=function(_0x4be952,_0x17027d,_0x39c2cd,_0x4d9274,_0x4435ab){this[_0xbb0c('0x14')][_0xbb0c('0x47')]({'uniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'body':_0x4be952,'direction':_0x17027d,'providerName':_0x39c2cd,'providerResponse':_0x4d9274})['then'](function(_0x22d466){if(_0x4435ab){_0x4435ab(null,_0x22d466);}})['catch'](function(_0x4e5b33){if(_0x4435ab){_0x4435ab(_0x4e5b33);}});};AGIVertices[_0xbb0c('0x13')]['createCmContact']=function(_0x263f9f,_0x24653b){this[_0xbb0c('0x14')][_0xbb0c('0x48')]({'firstName':_[_0xbb0c('0x49')](_0x263f9f[_0xbb0c('0x16')])||_[_0xbb0c('0x4a')](_0x263f9f['name'])?_0xbb0c('0x4b')+Math[_0xbb0c('0x4c')]():_0x263f9f['name'],'lastName':_['isEmpty'](_0x263f9f[_0xbb0c('0x4d')])||_[_0xbb0c('0x4a')](_0x263f9f['lastName'])?null:_0x263f9f[_0xbb0c('0x4d')],'phone':_0x263f9f[_0xbb0c('0x4e')],'ListId':_0x263f9f['list_id'],'scheduledat':_0x263f9f[_0xbb0c('0x4f')],'callbackUniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'tags':'callback','description':_0xbb0c('0x50')+_0x263f9f[_0xbb0c('0x4f')][_0xbb0c('0x51')](),'priority':_0x263f9f[_0xbb0c('0x52')]})[_0xbb0c('0x1a')](function(_0x2f1df9){_0x24653b(null,_0x2f1df9);})[_0xbb0c('0x17')](function(_0x209744){_0x24653b(_0x209744);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x53')]=function(_0x31d0d0,_0x33a718){this[_0xbb0c('0x14')][_0xbb0c('0x54')](_0x31d0d0)[_0xbb0c('0x1a')](function(_0x264312){_0x33a718(null,_0x264312?_0x264312['name']:![]);})[_0xbb0c('0x17')](function(_0x50cbc7){_0x33a718(_0x50cbc7);});};AGIVertices[_0xbb0c('0x13')]['agentPause']=function(_0xd5bf97,_0x2ebf6b,_0x4d2742){var _0x166b35={'role':_0xbb0c('0x55')};_0x166b35[_0xd5bf97]=this[_0xbb0c('0x11')][_0xbb0c('0x40')];this['rpc']['agentPause'](_0x166b35,_0x2ebf6b,this[_0xbb0c('0x11')][_0xbb0c('0x3d')])[_0xbb0c('0x1a')](function(_0x16a6b0){_0x4d2742(null,_[_0xbb0c('0x4a')](_0x16a6b0)?![]:!![]);})[_0xbb0c('0x17')](function(_0x263622){logger[_0xbb0c('0x33')](_0x263622);_0x4d2742(null,![]);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x56')]=function(_0x28f0d6,_0x80aef8){var _0x56a0e7={'role':_0xbb0c('0x55')};_0x56a0e7[_0x28f0d6]=this[_0xbb0c('0x11')]['callerid'];this[_0xbb0c('0x14')][_0xbb0c('0x56')](_0x56a0e7)['then'](function(_0xe51716){_0x80aef8(null,_['isNil'](_0xe51716)?![]:!![]);})[_0xbb0c('0x17')](function(_0x3535a9){logger['error'](_0x3535a9);_0x80aef8(null,![]);});};AGIVertices['prototype'][_0xbb0c('0x57')]=function(_0x303827,_0x503c0e){var _0xec57e5={'role':'agent'};_0xec57e5[_0x303827]=this[_0xbb0c('0x11')][_0xbb0c('0x40')];this[_0xbb0c('0x14')][_0xbb0c('0x57')](_0xec57e5)[_0xbb0c('0x1a')](function(_0x471908){_0x503c0e(null,_['isNil'](_0x471908)?![]:!![]);})['catch'](function(_0x199a8e){logger[_0xbb0c('0x33')](_0x199a8e);_0x503c0e(null,![]);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x58')]=function(_0x90b48f,_0x2de891){var _0x4655d8={'role':_0xbb0c('0x55')};_0x4655d8[_0x90b48f]=this['channel'][_0xbb0c('0x40')];var _0x214aec=_0x90b48f!=_0xbb0c('0x59')?util[_0xbb0c('0x5a')](_0xbb0c('0x5b'),'LOCAL',this[_0xbb0c('0x11')][_0xbb0c('0x40')]):undefined;this[_0xbb0c('0x14')][_0xbb0c('0x58')](_0x4655d8,_0x214aec)[_0xbb0c('0x1a')](function(_0x59d097){_0x2de891(null,_[_0xbb0c('0x4a')](_0x59d097)?![]:!![]);})[_0xbb0c('0x17')](function(_0x59c0e9){logger[_0xbb0c('0x33')](_0x59c0e9);_0x2de891(null,![]);});};AGIVertices['prototype'][_0xbb0c('0x5c')]=function(_0x35a3f9,_0x15e794){sh[_0xbb0c('0x5d')](_[_0xbb0c('0x5e')](_0x35a3f9),function(_0x4eeead,_0x2bdf66){var _0x253e30=_0x2bdf66[_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'');_0x15e794(null,_0x253e30);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x60')]=function(_0x474a6f,_0x3b993f){scripts['googleCloudTTS'](_0x474a6f[_0xbb0c('0x61')],_0x474a6f[_0xbb0c('0x62')]||_0xbb0c('0x63'),_0x474a6f['text'],_0x474a6f['languageCode']||_0xbb0c('0x64'),_0x474a6f['ssmlGender']||'MALE',_0x474a6f[_0xbb0c('0x65')]||'MP3')[_0xbb0c('0x1a')](function(_0x49260b){_0x3b993f(null,_0x49260b);})[_0xbb0c('0x17')](function(_0x147159){_0x3b993f(_0x147159);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x66')]=function(_0x36e97d,_0x30da4a){scripts[_0xbb0c('0x66')](_0x36e97d[_0xbb0c('0x63')],_0x36e97d['google_tts_language']||'en',0x1)[_0xbb0c('0x1a')](function(_0x5f3acd){_0x30da4a(null,_0x5f3acd);})[_0xbb0c('0x17')](function(_0xcf1667){_0x30da4a(_0xcf1667);});};AGIVertices['prototype'][_0xbb0c('0x67')]=function(_0x3ffa0c,_0x31ab70){var _0x2c1452={'uri':_0x3ffa0c[_0xbb0c('0x68')],'method':_0x3ffa0c[_0xbb0c('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3ffa0c[_0xbb0c('0x6a')])===_0xbb0c('0x6b')&&parseInt(_0x3ffa0c[_0xbb0c('0x6a')])>=0x1?parseInt(_0x3ffa0c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xbb0c('0x6c')]([_0xbb0c('0x6d'),_0xbb0c('0x6e')],_0x2c1452[_0xbb0c('0x69')][_0xbb0c('0x6f')]())){try{_0x2c1452[_0xbb0c('0x70')]=_0x3ffa0c[_0xbb0c('0xe')]?JSON['parse'](_0x3ffa0c['rawBody']):{};}catch(_0x29736c){logger[_0xbb0c('0x33')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x29736c);}}try{_0x2c1452[_0xbb0c('0x71')]=_0x3ffa0c[_0xbb0c('0xd')]?JSON[_0xbb0c('0x72')](_0x3ffa0c['rawHeaders']):{};}catch(_0x4bcb60){logger[_0xbb0c('0x33')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4bcb60);}if(_0x3ffa0c[_0xbb0c('0x73')]){try{var _0x412724=require(_0x3ffa0c['computedVariables'])['sync'](this,_0x2c1452);_0x2c1452[_0xbb0c('0x74')]=Mustache[_0xbb0c('0x75')](_0x3ffa0c[_0xbb0c('0x68')],_0x412724,{},['$$','$$']);if(_0x2c1452[_0xbb0c('0x71')]){_0x2c1452[_0xbb0c('0x71')]=JSON[_0xbb0c('0x72')](Mustache[_0xbb0c('0x75')](JSON[_0xbb0c('0x76')](_0x2c1452[_0xbb0c('0x71')]),_0x412724,{},['$$','$$']));}if(_0x2c1452[_0xbb0c('0x70')]){_0x2c1452[_0xbb0c('0x70')]=JSON['parse'](Mustache[_0xbb0c('0x75')](JSON['stringify'](_0x2c1452['body']),_0x412724,{},['$$','$$']));}}catch(_0x951239){logger[_0xbb0c('0x33')](_0xbb0c('0x77'),_0x951239);}}rp(_0x2c1452)['then'](function(_0x32de69){var _0x18be5f={'statusCode':_0x32de69['statusCode']||0xc8,'statusMessage':_0x32de69[_0xbb0c('0x78')]||'OK','headers':_0x32de69[_0xbb0c('0x71')]||{},'body':_0x32de69['body']||{}};_0x31ab70(null,_0x18be5f);})['catch'](function(_0x3370e8){var _0x28e762={'statusCode':_0x3370e8[_0xbb0c('0x79')]||0x1f4,'statusMessage':_0x3370e8[_0xbb0c('0x7a')]||_0xbb0c('0x7b'),'headers':_0x3370e8[_0xbb0c('0x7c')][_0xbb0c('0x71')]||{},'body':_0x3370e8['options'][_0xbb0c('0x70')]||{}};_0x31ab70(null,_0x28e762);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x7d')]=function(_0x9369f,_0x4c506e){scripts[_0xbb0c('0x7d')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x9369f[_0xbb0c('0x7e')],_0x9369f[_0xbb0c('0x63')],_0x9369f['dialogflow_language']||'en')[_0xbb0c('0x1a')](function(_0x50d3f8){_0x4c506e(null,_0x50d3f8);})[_0xbb0c('0x17')](function(_0x4fad06){_0x4c506e(_0x4fad06);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x7f')]=function(_0x2e8102,_0x516335){scripts[_0xbb0c('0x7f')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x2e8102[_0xbb0c('0x80')],_0x2e8102[_0xbb0c('0x81')],_0x2e8102[_0xbb0c('0x82')],_0x2e8102[_0xbb0c('0x63')],_0x2e8102['dialogflowV2_language']||'en')[_0xbb0c('0x1a')](function(_0x55ee5c){_0x516335(null,_0x55ee5c);})['catch'](function(_0x4392ff){_0x516335(_0x4392ff);});};AGIVertices[_0xbb0c('0x13')]['sestekNDA']=function(_0x18bcee,_0x69c614){scripts['sestekNDA'](this[_0xbb0c('0x11')],_0x18bcee)[_0xbb0c('0x1a')](function(_0xa9910d){_0x69c614(null,_0xa9910d);})['catch'](function(_0xa1ee27){_0x69c614(_0xa1ee27);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x83')]=function(_0x245ef1,_0x2a144a){scripts[_0xbb0c('0x83')](_0x245ef1['key'],_0x245ef1['text'],_0x245ef1['ispeech_tts_language']||'en-US',_0x245ef1[_0xbb0c('0x84')])['then'](function(_0x5638ca){_0x2a144a(null,_0x5638ca);})[_0xbb0c('0x17')](function(_0x3f500c){_0x2a144a(_0x3f500c);});};AGIVertices['prototype'][_0xbb0c('0x85')]=function(_0x219c1c,_0x11d814,_0x200a70){scripts[_0xbb0c('0x85')](_0x11d814,_0x219c1c[_0xbb0c('0x7e')],_0x219c1c['ispeech_asr_language']||_0xbb0c('0x64'),this[_0xbb0c('0x86')](_0x219c1c[_0xbb0c('0x87')])?_0x219c1c[_0xbb0c('0x87')]:undefined)[_0xbb0c('0x1a')](function(_0x5b273f){_0x200a70(null,_0x5b273f);})['catch'](function(_0xb83d8f){_0x200a70(_0xb83d8f);});};AGIVertices['prototype'][_0xbb0c('0x88')]=function(_0x4148f5,_0x5f4449){scripts[_0xbb0c('0x88')](_0x4148f5[_0xbb0c('0x89')],_0x4148f5['aws_secret_access_key'],_0x4148f5[_0xbb0c('0x8a')],_0x4148f5[_0xbb0c('0x8b')]||'Amy',_0x4148f5[_0xbb0c('0x63')],_0x4148f5[_0xbb0c('0x8c')]||_0xbb0c('0x63'))['then'](function(_0x5897a4){_0x5f4449(null,_0x5897a4);})['catch'](function(_0x7da317){_0x5f4449(_0x7da317);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x8d')]=function(_0x54619c,_0x4602f3){scripts[_0xbb0c('0x8d')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x54619c[_0xbb0c('0x89')],_0x54619c[_0xbb0c('0x8e')],_0x54619c['aws_lex_region'],_0x54619c[_0xbb0c('0x63')],_0x54619c[_0xbb0c('0x8f')])['then'](function(_0x8d75b1){_0x4602f3(null,_0x8d75b1);})['catch'](function(_0x485bb4){_0x4602f3(_0x485bb4);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x90')]=function(_0x5ed15c,_0x1a807e,_0x166514){scripts[_0xbb0c('0x90')](_0x1a807e,_0x5ed15c['key'],_0x5ed15c['google_asr_language']||_0xbb0c('0x64'))['then'](function(_0x5e51f6){_0x166514(null,_0x5e51f6);})[_0xbb0c('0x17')](function(_0x1a2a3e){_0x166514(_0x1a2a3e);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x91')]=function(_0x99a4ef,_0x163886,_0x59c842){scripts[_0xbb0c('0x91')](_0x163886,_0x99a4ef[_0xbb0c('0x92')],_0x99a4ef['appsecret'],_0x99a4ef[_0xbb0c('0x74')])[_0xbb0c('0x1a')](function(_0xf134a5){_0x59c842(null,_0xf134a5);})['catch'](function(_0x5c444a){_0x59c842(_0x5c444a);});};AGIVertices[_0xbb0c('0x13')]['clear']=function(_0x48acab){var _0x47e860=_[_0xbb0c('0x6c')](verticesWithRetry,_0x48acab['agicommand'])?_0x48acab:_[_0xbb0c('0x93')](_0x48acab);for(var _0x5cb773 in _0x47e860){if(_0x47e860[_0xbb0c('0x94')](_0x5cb773)){if(_0x47e860[_0x5cb773]&&_[_0xbb0c('0x95')](_0x47e860[_0x5cb773])){if(_[_0xbb0c('0x6c')](recursiveMapAttributes,_0x5cb773)){_0x47e860[_0x5cb773]=this[_0xbb0c('0x96')](_0x47e860[_0x5cb773]);}else{_0x47e860[_0x5cb773]=this[_0xbb0c('0x97')](_0x47e860[_0x5cb773]);}}}}return _0x47e860;};AGIVertices['prototype'][_0xbb0c('0x98')]=function(_0x314552){for(var _0x382655 in _0x314552){if(_0x314552[_0xbb0c('0x94')](_0x382655)){if(_['isPlainObject'](_0x314552[_0x382655])){this[_0xbb0c('0x98')](_0x314552[_0x382655]);}else if(_[_0xbb0c('0x99')](_0x314552[_0x382655])){for(var _0x2a72b3=0x0;_0x2a72b3<_0x314552[_0x382655][_0xbb0c('0x9a')];_0x2a72b3++){this[_0xbb0c('0x98')](_0x314552[_0x382655][_0x2a72b3]);}}else if(_[_0xbb0c('0x95')](_0x314552[_0x382655])){_0x314552[_0x382655]=this[_0xbb0c('0x97')](_0x314552[_0x382655]);}}}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x9b')]=function(_0x597924,_0x2ca062){for(var _0x202313 in _0x597924){if(_0x597924[_0xbb0c('0x94')](_0x202313)){if(_[_0xbb0c('0x9c')](_0x597924[_0x202313])){if(!_[_0xbb0c('0x49')](_0x597924[_0x202313])){this[_0xbb0c('0x9b')](_0x597924[_0x202313],util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x2ca062,_0x202313));}}else if(_[_0xbb0c('0x99')](_0x597924[_0x202313])){for(var _0x5cbe8d=0x0;_0x5cbe8d<_0x597924[_0x202313]['length'];_0x5cbe8d++){this[_0xbb0c('0x9b')](_0x597924[_0x202313][_0x5cbe8d],util['format'](_0xbb0c('0x9d'),_0x2ca062,_0x202313+'['+_0x5cbe8d+']'));}}else{if(!_[_0xbb0c('0x4a')](_0x597924[_0x202313])){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x2ca062,_0x202313),_0x597924[_0x202313]);}}}}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x96')]=function(_0x4646ec){try{var _0x3bd4c4=JSON[_0xbb0c('0x72')](_0x4646ec);this[_0xbb0c('0x98')](_0x3bd4c4);return JSON['stringify'](_0x3bd4c4);}catch(_0x13e492){return this[_0xbb0c('0x97')](_0x4646ec);}};AGIVertices['prototype'][_0xbb0c('0x97')]=function(_0x3bbc42){var _0x2e2014=_0x3bbc42['split']('{');for(var _0x490919=0x1;_0x490919<_0x2e2014['length'];_0x490919+=0x1){var _0xdfb02=_0x2e2014[_0x490919]['split']('}');if(_0xdfb02[_0xbb0c('0x9a')]>0x1){_0x3bbc42=_0x3bbc42['replaceAll']('{'+_0xdfb02[0x0]+'}',this['channel']['getVariable'](_0xdfb02[0x0])[_0xbb0c('0x9f')]||_0xdfb02[0x0]);}}if(_0x2e2014['length']===0x1){return _0x3bbc42[_0xbb0c('0x51')]();}return this[_0xbb0c('0x97')](_0x3bbc42);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa0')]=function(_0xbe6268,_0x24ee75){var _0x4283bc=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](_0xbe6268);if(_0x4283bc[_0xbb0c('0xa2')]===-0x1){return _0x4283bc;}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x24ee75,_0x4283bc[_0xbb0c('0x9f')]));return this[_0xbb0c('0x11')]['setVariable'](_0x24ee75,_0x4283bc[_0xbb0c('0x9f')]);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x86')]=function(_0x5837f3){return _0x5837f3&&_0x5837f3!=='0'&&_0x5837f3!=='-1'&&_0x5837f3!=='';};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa3')]=function(_0x5a8e98){this[_0xbb0c('0x3c')]['sync'](this,_0x5a8e98,'-');_0x5a8e98[_0xbb0c('0xa4')]=_0x5a8e98[_0xbb0c('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa5')]=function(_0x47b2fc){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xa6'),_0x47b2fc[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x47b2fc[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x5246b9='\x22'+_0x47b2fc[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x47b2fc[_0xbb0c('0x7c')])){_0x5246b9+=','+_0x47b2fc[_0xbb0c('0x7c')];}var _0x19f7f9=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xa9'),_0x5246b9);if(_0x19f7f9['result']===-0x1){return _0x19f7f9;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xaa'),_0x5246b9));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xab')]=function(_0x20b8a3){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xac'),_0x20b8a3[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x20b8a3[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xae'));}var _0x4cb466=_0x20b8a3[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0x20b8a3['options'])){_0x4cb466+=','+_0x20b8a3[_0xbb0c('0x7c')];}var _0x101f73=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xaf'),_0x4cb466);if(_0x101f73[_0xbb0c('0xa2')]===-0x1){return _0x101f73;}var _0x5b68df=this[_0xbb0c('0xa0')](_0xbb0c('0xb0'),_0xbb0c('0xb1'));if(_0x5b68df[_0xbb0c('0xa2')]===-0x1){return _0x5b68df;}var _0x2490c7=this[_0xbb0c('0xa0')](_0xbb0c('0xb2'),'MRCP_RECOG_TRANSCRIPT');if(_0x2490c7[_0xbb0c('0xa2')]===-0x1){return _0x2490c7;}var _0x144892=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x144892[_0xbb0c('0xa2')]===-0x1){return _0x144892;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4cb466));};AGIVertices['prototype'][_0xbb0c('0x9')]=function(_0x3aa706){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3aa706['label']));return this[_0xbb0c('0x11')][_0xbb0c('0x9')]([_0x3aa706[_0xbb0c('0xb4')],_0x3aa706[_0xbb0c('0xb5')]]);};AGIVertices[_0xbb0c('0x13')]['answer']=function(_0x44db62){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xb6'),_0x44db62[_0xbb0c('0x3e')]));if(this[_0xbb0c('0x86')](_0x44db62[_0xbb0c('0x6a')])){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x44db62[_0xbb0c('0x6a')]));var _0x2ad27d=this[_0xbb0c('0x11')][_0xbb0c('0xb7')](_0x44db62[_0xbb0c('0x6a')]);if(_0x2ad27d[_0xbb0c('0xa2')]===-0x1){return _0x2ad27d;}}return this[_0xbb0c('0x11')][_0xbb0c('0xb8')]();};AGIVertices['prototype'][_0xbb0c('0xb9')]=function(_0x3f7ee0){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xba'),_0x3f7ee0[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x3f7ee0[_0xbb0c('0xbb')])){return this['channel'][_0xbb0c('0x33')](_0x3f7ee0,_0xbb0c('0xbc'));}_0x3f7ee0[_0xbb0c('0x4f')]=moment();if(this[_0xbb0c('0x86')](_0x3f7ee0['delay'])){_0x3f7ee0['scheduledAt']=moment()['add'](_0x3f7ee0[_0xbb0c('0xbd')],_0xbb0c('0xbe'));}if(!this[_0xbb0c('0x86')](_0x3f7ee0[_0xbb0c('0x52')])){_0x3f7ee0[_0xbb0c('0x52')]=0x2;}this[_0xbb0c('0x48')][_0xbb0c('0xbf')](this,_0x3f7ee0);return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3f7ee0[_0xbb0c('0x4e')],_0x3f7ee0[_0xbb0c('0xbb')],_0x3f7ee0[_0xbb0c('0x4f')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc0')]=function(_0x45c3a5){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x45c3a5[_0xbb0c('0x3e')]));var _0x2bee3f=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0x45c3a5[_0xbb0c('0xc1')],_0x45c3a5[_0xbb0c('0x7c')]);if(_0x2bee3f[_0xbb0c('0xa2')]===-0x1){return _0x2bee3f;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xc2'),_0x45c3a5[_0xbb0c('0xc1')],_0x45c3a5[_0xbb0c('0x7c')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc3')]=function(_0x4c1efc){logger['info'](util['format'](_0xbb0c('0xc4'),_0x4c1efc[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x4c1efc['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x2889c8='\x22'+_0x4c1efc[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x4c1efc[_0xbb0c('0x7c')])){_0x2889c8+=','+_0x4c1efc[_0xbb0c('0x7c')];}var _0x23d0cd=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0xa9'),_0x2889c8);if(_0x23d0cd[_0xbb0c('0xa2')]===-0x1){return _0x23d0cd;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xaa'),_0x2889c8));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc5')]=function(_0x3fcd44){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3fcd44['label']));if(!this['isConfigured'](_0x3fcd44[_0xbb0c('0x63')])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x3c98a5='\x22'+_0x3fcd44[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x3fcd44['options'])){_0x3c98a5+=','+_0x3fcd44['options'];}var _0x56c412=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0xa9'),_0x3c98a5);if(_0x56c412[_0xbb0c('0xa2')]===-0x1){return _0x56c412;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xaa'),_0x3c98a5));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc6')]=function(_0xd0de62){logger['info'](util['format'](_0xbb0c('0xc7'),_0xd0de62['label']));if(!this[_0xbb0c('0x86')](_0xd0de62[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20grammar\x20configured');}var _0x4a2c61=_0xd0de62[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0xd0de62[_0xbb0c('0x7c')])){_0x4a2c61+=','+_0xd0de62[_0xbb0c('0x7c')];}var _0x5ebb27=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xaf'),_0x4a2c61);if(_0x5ebb27[_0xbb0c('0xa2')]===-0x1){return _0x5ebb27;}var _0x1f9791=this['getAndSetVariable'](_0xbb0c('0xb0'),_0xbb0c('0xc8'));if(_0x1f9791[_0xbb0c('0xa2')]===-0x1){return _0x1f9791;}var _0x241809=this['getAndSetVariable'](_0xbb0c('0xb2'),_0xbb0c('0xc9'));if(_0x241809[_0xbb0c('0xa2')]===-0x1){return _0x241809;}var _0x2f0af7=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x2f0af7[_0xbb0c('0xa2')]===-0x1){return _0x2f0af7;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xca'),_0x4a2c61));};AGIVertices['prototype'][_0xbb0c('0xcb')]=function(_0x2ab79c){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xcc'),_0x2ab79c[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2ab79c[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xae'));}var _0x180f77=_0x2ab79c[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0x2ab79c[_0xbb0c('0x7c')])){_0x180f77+=','+_0x2ab79c['options'];}var _0x352ab9=this[_0xbb0c('0x11')][_0xbb0c('0x5d')]('MRCPRecog',_0x180f77);if(_0x352ab9[_0xbb0c('0xa2')]===-0x1){return _0x352ab9;}var _0x1be967=this[_0xbb0c('0xa0')](_0xbb0c('0xb0'),_0xbb0c('0xcd'));if(_0x1be967[_0xbb0c('0xa2')]===-0x1){return _0x1be967;}var _0x1df23d=this[_0xbb0c('0xa0')](_0xbb0c('0xb2'),_0xbb0c('0xce'));if(_0x1df23d['result']===-0x1){return _0x1df23d;}var _0x5c3751=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),_0xbb0c('0xcf'));if(_0x5c3751[_0xbb0c('0xa2')]===-0x1){return _0x5c3751;}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xca'),_0x180f77));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xd0')]=function(_0x529454){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xd1'),_0x529454[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x529454[_0xbb0c('0xd2')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,'no\x20database\x20selected');}var _0x23a76b=this[_0xbb0c('0x1d')][_0xbb0c('0xbf')](this,_0x529454[_0xbb0c('0xd2')]);if(!_0x23a76b){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,'no\x20odbc\x20database\x20found');}if(!this[_0xbb0c('0x86')](_0x529454['query'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,_0xbb0c('0xd3'));}var _0xac3c93=_0x529454['query'][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xd4'),_0xac3c93));var _0xb7bd17=this[_0xbb0c('0x31')]['sync'](this,_0x23a76b,_0xac3c93);this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x529454,_0xac3c93);if(!this[_0xbb0c('0x86')](_0x529454[_0xbb0c('0xd5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xb8c94=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x529454['variable_id']);if(!_0xb8c94){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,_0xbb0c('0xd6'));}var _0x412bfb=this;_0xb7bd17[_0xbb0c('0xd7')](function(_0x3d1b6d,_0x116b22){Object[_0xbb0c('0xd8')](_0x3d1b6d)[_0xbb0c('0xd7')](function(_0x55a402){_0x412bfb['channel'][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xd9'),_0xb8c94,_0x116b22,_0x55a402),_0x3d1b6d[_0x55a402]);});});this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xda'),_0xb8c94),_0xb7bd17[_0xbb0c('0x9a')]);return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xdb'),_0xb8c94));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xdc')]=function(_0x56e89f){logger[_0xbb0c('0xdd')](util[_0xbb0c('0x5a')](_0xbb0c('0xde'),_0x56e89f[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x56e89f[_0xbb0c('0xdf')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x56e89f,_0xbb0c('0xe0'));}var _0x2dd730=this[_0xbb0c('0x1f')][_0xbb0c('0xbf')](this,_0x56e89f[_0xbb0c('0xdf')]);if(!_0x2dd730){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x56e89f,_0xbb0c('0xe1'));}var _0x5a8e46=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xe2'),[util[_0xbb0c('0x5a')](_0xbb0c('0xe3'),_0x2dd730),_0x56e89f['timeout'],_0x56e89f['opts'],_0x56e89f['url']]);if(_0x5a8e46[_0xbb0c('0xa2')]===-0x1){return _0x5a8e46;}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xe4'),_0xbb0c('0xe2')));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xe5')]=function(_0x264bf0){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xe6'),_0x264bf0[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x264bf0['key'])){return this[_0xbb0c('0x11')]['noop']('no\x20key\x20configured');}if(!this[_0xbb0c('0x86')](_0x264bf0[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x264bf0);this[_0xbb0c('0x47')](_0x264bf0[_0xbb0c('0x63')],'in','','');this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xe8'),_0x264bf0['text']));var _0x3c7061=this[_0xbb0c('0x7d')]['sync'](this,_0x264bf0);if(_0x3c7061){for(var _0x345fa4 in _0x3c7061){if(_0x3c7061['hasOwnProperty'](_0x345fa4)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xe9'),_0x345fa4['toUpperCase']()),_0x3c7061[_0x345fa4]);}}this[_0xbb0c('0x47')](_0x3c7061[_0xbb0c('0xea')],_0xbb0c('0xeb'),'dialogflow','');return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xec'),_0x3c7061[_0xbb0c('0xea')]));}return this['channel'][_0xbb0c('0x33')](_0x264bf0,_0xbb0c('0xed'));};AGIVertices[_0xbb0c('0x13')]['dialogflowV2']=function(_0x4d059d){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4d059d['label']));if(!this[_0xbb0c('0x86')](_0x4d059d['dialogflowV2_project_id'])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0xee'));}if(!this['isConfigured'](_0x4d059d[_0xbb0c('0x81')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20client_email\x20configured');}if(!this[_0xbb0c('0x86')](_0x4d059d[_0xbb0c('0x82')])){return this['channel'][_0xbb0c('0xa7')]('no\x20private_key\x20configured');}if(!this[_0xbb0c('0x86')](_0x4d059d['dialogflowV2_language'])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0xef'));}if(!this[_0xbb0c('0x86')](_0x4d059d[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')]['noop']('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x4d059d);this['createSquareMessage'](_0x4d059d[_0xbb0c('0x63')],'in','','');this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0xf0'),_0x4d059d['text']));var _0x45ee29=this['googleDialogflowV2'][_0xbb0c('0xbf')](this,_0x4d059d);if(_0x45ee29){for(var _0x1e8cae in _0x45ee29){if(_0x45ee29['hasOwnProperty'](_0x1e8cae)){if(_0x1e8cae!=='providerResponse'){this[_0xbb0c('0x11')]['setVariable'](util['format'](_0xbb0c('0xe9'),_0x1e8cae[_0xbb0c('0x6f')]()),_0x45ee29[_0x1e8cae]);}}}this[_0xbb0c('0x47')](_0x45ee29[_0xbb0c('0xea')],_0xbb0c('0xeb'),'dialogflowV2',_0x45ee29['providerResponse']);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xf1'),_0x45ee29[_0xbb0c('0xea')]));}return this['channel'][_0xbb0c('0x33')](_0x4d059d,_0xbb0c('0xf2'));};AGIVertices['prototype'][_0xbb0c('0xf3')]=function(_0x2a7366){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xf4'),_0x2a7366[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xf5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf6'));}if(!this['isConfigured'](_0x2a7366['username'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf7'));}if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xf8')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf9'));}if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xfa')])){return this['channel'][_0xbb0c('0xa7')]('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this[_0xbb0c('0x3c')](_0x2a7366);this[_0xbb0c('0x47')](_0x2a7366['text'],'in','','');this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xfb'),_0x2a7366['text']));var _0x420329=this['sestekNDA'][_0xbb0c('0xbf')](this,_0x2a7366);if(_0x420329){for(var _0x87b76a in _0x420329){if(_0x420329[_0xbb0c('0x94')](_0x87b76a)){this['channel']['setVariable'](util['format'](_0xbb0c('0xfc'),_0x87b76a[_0xbb0c('0x6f')]()),_0x420329[_0x87b76a]);}}this['createSquareMessage'](_0x420329[_0xbb0c('0xea')],'out',_0xbb0c('0xf3'),'');if(_0x420329[_0xbb0c('0xfd')]){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xfe'),_0x420329[_0xbb0c('0xfd')]));var _0x4f68bf=this[_0xbb0c('0x11')][_0xbb0c('0xff')](_0x420329[_0xbb0c('0xfd')]);try{fs['unlink'](_0x420329[_0xbb0c('0xfd')]+_0xbb0c('0x100'));}catch(_0x5b5c9d){logger[_0xbb0c('0x33')](_0x5b5c9d);}return _0x4f68bf;}else{return this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0x101'),_0x420329[_0xbb0c('0xea')]));}}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x2a7366,_0xbb0c('0x102'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x103')]=function(_0x18595b){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x18595b[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x103'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x104')]=function(_0x1d8a3b){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x105'),_0x1d8a3b[_0xbb0c('0x3e')]));var _0x31162f='';if(_0x1d8a3b[_0xbb0c('0x106')]){if(!this[_0xbb0c('0x86')](_0x1d8a3b[_0xbb0c('0x106')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1d8a3b,_0xbb0c('0x107'));}else{var _0x2ba6d2=parseInt(_0x1d8a3b['trunk_id'],0xa);if(isNaN(_0x2ba6d2)){_0x31162f=_0x1d8a3b['trunk_id'];}else{_0x31162f=this[_0xbb0c('0x21')]['sync'](this,_0x1d8a3b[_0xbb0c('0x106')]);if(!_0x31162f){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1d8a3b,_0xbb0c('0x108'));}}}}else if(_0x1d8a3b[_0xbb0c('0x109')]){_0x31162f=_0x1d8a3b['trunk_name'];}else{return this[_0xbb0c('0x11')]['error'](_0x1d8a3b,'no\x20trunk\x20selected');}var _0x5f3c9f=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xe2'),[util['format'](_0xbb0c('0x10a'),_0x31162f,_0x1d8a3b[_0xbb0c('0x4e')]),_0x1d8a3b['timeout'],_0x1d8a3b[_0xbb0c('0x10b')],_0x1d8a3b[_0xbb0c('0x68')]]);if(_0x5f3c9f[_0xbb0c('0xa2')]===-0x1){return _0x5f3c9f;}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xe4'),_0xbb0c('0xe2')));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x10c')]=function(_0x3217aa){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x3217aa[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x10c'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xf')]=function(_0x3272c4){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x10d'),_0x3272c4[_0xbb0c('0x3e')]));if(_0x3272c4['retry']===0x0){return this[_0xbb0c('0xa3')](_0x3272c4);}_0x3272c4['retry']-=0x1;if(!this['isConfigured'](_0x3272c4[_0xbb0c('0x10e')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x3272c4,'no\x20file\x20audio\x20selected');}var _0x243f36=this['getSound'][_0xbb0c('0xbf')](this,_0x3272c4[_0xbb0c('0x10e')]);if(!_0x243f36){return this['channel'][_0xbb0c('0x33')](_0x3272c4,_0xbb0c('0x10f'));}if(!this[_0xbb0c('0x86')](_0x3272c4[_0xbb0c('0xd5')])){return this['channel'][_0xbb0c('0x33')](_0xbb0c('0x110'));}var _0x1b70a6=this[_0xbb0c('0x11')]['getData'](_0x243f36,_0x3272c4[_0xbb0c('0x111')],_0x3272c4[_0xbb0c('0x112')]);var _0x47c8d1=_0x1b70a6['result']?_0x1b70a6[_0xbb0c('0xa2')][_0xbb0c('0x51')]():'';logger[_0xbb0c('0x35')]('test',JSON['stringify'](_0x1b70a6));if(_0x1b70a6[_0xbb0c('0xa2')]===-0x1){this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,_0x47c8d1);return _0x1b70a6;}else if(_0x1b70a6[_0xbb0c('0x9f')]===_0xbb0c('0x6a')){_0x1b70a6['result']=_0x47c8d1[_0xbb0c('0x9a')]>=parseInt(_0x3272c4[_0xbb0c('0x113')])?'x':'i';}else{_0x1b70a6['result']=_0x47c8d1[_0xbb0c('0x9a')]>=parseInt(_0x3272c4[_0xbb0c('0x113')])&&_0x47c8d1[_0xbb0c('0x9a')]<=parseInt(_0x3272c4['maxdigit'])?'x':'i';}var _0x43f9ae=this['getVariable'][_0xbb0c('0xbf')](this,_0x3272c4[_0xbb0c('0xd5')]);if(!_0x43f9ae){return this['channel'][_0xbb0c('0x33')](_0x3272c4,_0xbb0c('0xd6'));}this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x43f9ae,_0x47c8d1);if(this[_0xbb0c('0x86')](_0x3272c4[_0xbb0c('0x114')])){var _0x3c19d4=parseInt(_0x3272c4[_0xbb0c('0x114')],0xa);var _0x1d7599=rs[_0xbb0c('0x115')]({'charset':'*','length':_0x3c19d4});var _0x4c752e=_0x47c8d1['length'];if(_0x4c752e>0x0){if(_0x4c752e>_0x3c19d4){this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,_0x3272c4['hiddendigitspos']==='first'?_0x1d7599+_0x47c8d1['substr'](_0x3c19d4):_0x47c8d1[_0xbb0c('0x116')](0x0,_0x4c752e-_0x3c19d4)+_0x1d7599);}else{this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x3272c4,rs[_0xbb0c('0x115')]({'charset':'*','length':_0x4c752e}));}}else{this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,'');}}else{this[_0xbb0c('0x3c')]['sync'](this,_0x3272c4,_0x47c8d1);}return _0x1b70a6;};AGIVertices['prototype']['getsecretdigits']=function(_0x7db850){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x117'),_0x7db850['label']));return this[_0xbb0c('0xf')](_0x7db850);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x118')]=function(_0x42ecd9){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x119'),_0x42ecd9[_0xbb0c('0x3e')]));this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x42ecd9,_0x42ecd9['goalname']);return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x11a'),_0x42ecd9['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x2d1a7b){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2d1a7b[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2d1a7b[_0xbb0c('0x89')])||!this[_0xbb0c('0x86')](_0x2d1a7b['aws_secret_access_key'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbb0c('0x86')](_0x2d1a7b[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x11b'),_0x2d1a7b[_0xbb0c('0x63')]));var _0x2e8af6=this[_0xbb0c('0x88')]['sync'](this,_0x2d1a7b);if(_0x2e8af6){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x11c'),_0x2e8af6));var _0x5e5a7f=this[_0xbb0c('0x11')]['streamFile'](_0x2e8af6);try{fs[_0xbb0c('0x11d')](_0x2e8af6+_0xbb0c('0x100'));}catch(_0x51ca44){logger[_0xbb0c('0x33')](_0x51ca44);}return _0x5e5a7f;}return this['channel'][_0xbb0c('0x33')](_0x2d1a7b,_0xbb0c('0x11e'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x11f')]=function(_0x48d3fd){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x120'),_0x48d3fd['label']));if(!this['isConfigured'](_0x48d3fd[_0xbb0c('0x89')])||!this[_0xbb0c('0x86')](_0x48d3fd[_0xbb0c('0x8e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x121'));}if(!this[_0xbb0c('0x86')](_0x48d3fd[_0xbb0c('0x8f')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x122'));}if(!this[_0xbb0c('0x86')](_0x48d3fd['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x48d3fd);this['createSquareMessage'](_0x48d3fd['text'],'in','','');this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x48d3fd[_0xbb0c('0x63')]));var _0x3440e3=this['awsLex'][_0xbb0c('0xbf')](this,_0x48d3fd);if(_0x3440e3){for(var _0xc87a2f in _0x3440e3){if(_0x3440e3['hasOwnProperty'](_0xc87a2f)&&_[_0xbb0c('0x95')](_0x3440e3[_0xc87a2f])){this['channel'][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')]('AWS_LEX_%s',_0xc87a2f[_0xbb0c('0x6f')]()),_0x3440e3[_0xc87a2f]);}}if(_[_0xbb0c('0x4a')](_0x3440e3['message'])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x123'));}else{this['createSquareMessage'](_0x3440e3[_0xbb0c('0x7a')],_0xbb0c('0xeb'),_0xbb0c('0x124'),'');return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x125'),_0x3440e3[_0xbb0c('0x7a')]));}}return this[_0xbb0c('0x11')]['error'](_0x48d3fd,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x126')]=function(_0x49acda){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x49acda[_0xbb0c('0x3e')],_0x49acda[_0xbb0c('0x6a')]));if(!this[_0xbb0c('0x86')](_0x49acda[_0xbb0c('0x7e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x127'));}var _0x550e34=_0xbb0c('0x128');var _0x1969d8=util[_0xbb0c('0x5a')](_0xbb0c('0x129'),FILES_PATH,rs[_0xbb0c('0x115')](0x4));var _0x5eb429=util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x1969d8,_0x550e34);var _0x1fd9d3=!![];if(_0x49acda['beep']==='NOBEEP'){_0x1fd9d3=![];}var _0x2ac26a=this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x1969d8,_0x550e34,_0x49acda[_0xbb0c('0x12b')],_0x49acda['timeout'],undefined,_0x1fd9d3);if(_0x2ac26a[_0xbb0c('0xa2')]!==-0x1){this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x12c'),_0x5eb429));var _0x3032fe=this[_0xbb0c('0x90')][_0xbb0c('0xbf')](this,_0x49acda,_0x5eb429);if(_0x3032fe){for(var _0x4154ac in _0x3032fe){if(_0x3032fe[_0xbb0c('0x94')](_0x4154ac)){this['channel']['setVariable'](util[_0xbb0c('0x5a')](_0xbb0c('0x12d'),_0x4154ac[_0xbb0c('0x6f')]()),_0x3032fe[_0x4154ac]);}}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('GoogleASR\x20Result\x20%s',JSON[_0xbb0c('0x76')](_0x3032fe)));}}return _0x2ac26a;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x12e')]=function(_0x299d84){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x12f'),_0x299d84[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x299d84[_0xbb0c('0x92')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x130'));}if(!this[_0xbb0c('0x86')](_0x299d84[_0xbb0c('0x131')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x132'));}var _0x631f80=_0xbb0c('0x128');var _0x2498f6=util['format'](_0xbb0c('0x129'),FILES_PATH,rs['generate'](0x4));var _0x36375a=util['format'](_0xbb0c('0x9d'),_0x2498f6,_0x631f80);var _0xc82ce=!![];if(_0x299d84[_0xbb0c('0x133')]===_0xbb0c('0x134')){_0xc82ce=![];}var _0x172eb6=this[_0xbb0c('0x11')]['recordFile'](_0x2498f6,_0x631f80,_0x299d84[_0xbb0c('0x12b')],_0x299d84[_0xbb0c('0x6a')],undefined,_0xc82ce);if(_0x172eb6[_0xbb0c('0xa2')]!==-0x1){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('tilde\x20%s\x20file\x20created',_0x36375a));var _0x1112d0=this['tildeASR'][_0xbb0c('0xbf')](this,_0x299d84,_0x36375a);if(_0x1112d0){for(var _0x42e55d in _0x1112d0){if(_0x1112d0[_0xbb0c('0x94')](_0x42e55d)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x135'),_0x42e55d[_0xbb0c('0x6f')]()),_0x1112d0[_0x42e55d]);}}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x136'),JSON['stringify'](_0x1112d0)));}}return _0x172eb6;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x137')]=function(_0x2d8afc){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x138'),_0x2d8afc[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0x139')](_0x2d8afc['context'],_0x2d8afc['extension'],_0x2d8afc['priority']);};AGIVertices['prototype'][_0xbb0c('0x13a')]=function(_0x51fe7e){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x13b'),_0x51fe7e[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x51fe7e[_0xbb0c('0x13c')])){return this['channel'][_0xbb0c('0x33')](_0x51fe7e,_0xbb0c('0x13d'));}try{var _0x8c8f02=eval(_0x51fe7e[_0xbb0c('0x13c')])?'true':_0xbb0c('0x13e');this[_0xbb0c('0x11')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x51fe7e[_0xbb0c('0x13c')],_0x8c8f02));return{'code':0xc8,'result':_0x8c8f02};}catch(_0xf5ba31){return{'code':0xc8,'result':_0xbb0c('0x13e')};}};AGIVertices['prototype'][_0xbb0c('0x13f')]=function(_0x19cc11){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x140'),_0x19cc11[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x19cc11[_0xbb0c('0x141')])){return this['channel'][_0xbb0c('0x33')](_0x19cc11,_0xbb0c('0x142'));}var _0x9b799=this[_0xbb0c('0x2a')][_0xbb0c('0xbf')](this,_0x19cc11[_0xbb0c('0x141')]);if(!_0x9b799){return this[_0xbb0c('0x11')]['error'](_0x19cc11,'no\x20intervals\x20found');}for(var _0x1a7772=0x0;_0x1a7772<_0x9b799['length'];_0x1a7772+=0x1){var _0x123156=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](util[_0xbb0c('0x5a')](_0xbb0c('0x143'),_0x9b799[_0x1a7772]));if(_0x123156[_0xbb0c('0xa2')]===-0x1){return _0x123156;}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0x123156['extra']));if(_0x123156[_0xbb0c('0x9f')]===_0xbb0c('0x144')){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0x145'),_0x9b799[_0x1a7772],_0xbb0c('0x144')));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0xbb0c('0x144')));return{'code':0xc8,'result':_0xbb0c('0x144')};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x145'),_0x9b799[_0x1a7772],_0xbb0c('0x13e')));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0xbb0c('0x13e')));}}return{'code':0xc8,'result':_0xbb0c('0x13e')};};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x146')]=function(_0x3844b1){logger[_0xbb0c('0x35')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3844b1[_0xbb0c('0x3e')]));return this[_0xbb0c('0x11')]['hangup']();};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x147')]=function(_0x123fa4){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x148'),_0x123fa4['label']));if(!this[_0xbb0c('0x86')](_0x123fa4['key'])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x127'));}var _0x5a1698=_0xbb0c('0x128');var _0x1f0750=util[_0xbb0c('0x5a')](_0xbb0c('0x129'),FILES_PATH,rs[_0xbb0c('0x115')](0x4));var _0x475ec9=util['format'](_0xbb0c('0x9d'),_0x1f0750,_0x5a1698);var _0x27cb6b=!![];if(_0x123fa4['beep']===_0xbb0c('0x134')){_0x27cb6b=![];}var _0x47497b=this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x1f0750,_0x5a1698,_0x123fa4[_0xbb0c('0x12b')],_0x123fa4[_0xbb0c('0x6a')],undefined,_0x27cb6b);if(_0x47497b[_0xbb0c('0xa2')]!==-0x1){this['channel']['noop'](util['format'](_0xbb0c('0x149'),_0x475ec9));var _0x21fdaf=this[_0xbb0c('0x85')]['sync'](this,_0x123fa4,_0x475ec9);if(_0x21fdaf){for(var _0xce0bad in _0x21fdaf){if(_0x21fdaf[_0xbb0c('0x94')](_0xce0bad)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')]('ISPEECH_ASR_%s',_0xce0bad[_0xbb0c('0x6f')]()),_0x21fdaf[_0xce0bad]);}}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x14a'),JSON['stringify'](_0x21fdaf)));}}return _0x47497b;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x14b')]=function(_0x4ed4ea){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x14c'),_0x4ed4ea[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x4ed4ea[_0xbb0c('0x7e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20key\x20configured');}if(!this[_0xbb0c('0x86')](_0x4ed4ea['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x14d'),_0x4ed4ea[_0xbb0c('0x63')]));var _0x39e37a=this[_0xbb0c('0x83')][_0xbb0c('0xbf')](this,_0x4ed4ea);if(_0x39e37a){this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x149'),_0x39e37a));var _0x173a74=this['channel'][_0xbb0c('0xff')](_0x39e37a,_0x4ed4ea[_0xbb0c('0x12b')]);try{fs[_0xbb0c('0x11d')](_0x39e37a+_0xbb0c('0x100'));}catch(_0xe11798){logger[_0xbb0c('0x33')](_0xe11798);}return _0x173a74;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x4ed4ea,_0xbb0c('0x14e'));};AGIVertices[_0xbb0c('0x13')]['login']=function(_0x255b56){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x14f'),_0x255b56[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x255b56[_0xbb0c('0x150')])){return this['channel'][_0xbb0c('0x33')](_0x255b56,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x152'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56[_0xbb0c('0x150')]));var _0x902152=this[_0xbb0c('0x58')][_0xbb0c('0xbf')](this,_0x255b56[_0xbb0c('0x150')]);if(_0x902152){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')]['callerid'],_0x255b56[_0xbb0c('0x150')]));this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x154')};}else{logger['info'](util['format'](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x155'),this['channel'][_0xbb0c('0x40')],_0x255b56['findBy']));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x157')]=function(_0x22c402){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x158'),_0x22c402[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x22c402[_0xbb0c('0x150')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x22c402,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));var _0x2c05db=this[_0xbb0c('0x57')][_0xbb0c('0xbf')](this,_0x22c402[_0xbb0c('0x150')]);if(_0x2c05db){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices['prototype'][_0xbb0c('0x159')]=function(_0x2edfc8){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x15a'),_0x2edfc8[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x2edfc8[_0xbb0c('0x15b')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x2edfc8,'no\x20operation\x20configured');}this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x15c'),_0x2edfc8[_0xbb0c('0x15b')]));var _0x93c962=eval(_0x2edfc8[_0xbb0c('0x15b')]);if(!this[_0xbb0c('0x86')](_0x2edfc8['variable_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x110'));}var _0xc21914=this[_0xbb0c('0xa1')]['sync'](this,_0x2edfc8[_0xbb0c('0xd5')]);if(!_0xc21914){return this[_0xbb0c('0x11')]['error'](_0x2edfc8,_0xbb0c('0xd6'));}if(_[_0xbb0c('0x99')](_0x93c962)){var _0x8be04=this;_0x93c962['forEach'](function(_0x24a980,_0x46ebbc){_0x8be04[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x15d'),_0xc21914,_0x46ebbc),_0x24a980);});return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x15e'),_0xc21914));}else{return this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0xc21914,_0x93c962);}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x15f')]=function(_0x112587){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x160'),_0x112587[_0xbb0c('0x3e')]));if(_0x112587[_0xbb0c('0xa4')]===0x0){return this[_0xbb0c('0xa3')](_0x112587);}_0x112587[_0xbb0c('0xa4')]-=0x1;if(!this[_0xbb0c('0x86')](_0x112587['file_id'])){return this['channel'][_0xbb0c('0x33')](_0x112587,'no\x20file\x20audio\x20selected');}var _0x114389=this['getSound']['sync'](this,_0x112587[_0xbb0c('0x10e')]);if(!_0x114389){return this['channel'][_0xbb0c('0x33')](_0x112587,_0xbb0c('0x10f'));}var _0x53330f=this[_0xbb0c('0x11')][_0xbb0c('0x161')](_0x114389,_0x112587[_0xbb0c('0x111')],_0x112587[_0xbb0c('0x162')]);var _0x1463fc=_0x53330f[_0xbb0c('0xa2')];if(_0x53330f[_0xbb0c('0xa2')]===-0x1){this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x112587,'-1');return _0x53330f;}else if(_0x53330f[_0xbb0c('0x9f')]===_0xbb0c('0x6a')){_0x53330f[_0xbb0c('0xa2')]=_0x53330f[_0xbb0c('0xa2')]['length']>0x0?_0x53330f['result']:'t';}else if(_[_0xbb0c('0x49')](_0x53330f[_0xbb0c('0xa2')])){_0x53330f[_0xbb0c('0xa2')]='#';_0x1463fc='#';}if(!this[_0xbb0c('0x86')](_0x112587[_0xbb0c('0xd5')])){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x110'));}else{var _0x2dc419=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x112587['variable_id']);if(!_0x2dc419){return this['channel']['error'](_0x112587,'no\x20variable\x20found');}this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x2dc419,_0x1463fc);}this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x112587,_0x1463fc);return _0x53330f;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa7')]=function(_0x24954f){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x163'),_0x24954f[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0x24954f[_0xbb0c('0x164')]||_0x24954f[_0xbb0c('0x3e')]);};AGIVertices['prototype']['pause']=function(_0x387a38){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x165'),_0x387a38[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x387a38['findBy'])){return this['channel'][_0xbb0c('0x33')](_0x387a38,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));var _0xf684f0=this[_0xbb0c('0x53')][_0xbb0c('0xbf')](this,_0x387a38[_0xbb0c('0x166')]);var _0x31fc44=this[_0xbb0c('0x167')][_0xbb0c('0xbf')](this,_0x387a38[_0xbb0c('0x150')],_0xf684f0);if(_0x31fc44){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')]['callerid'],_0x387a38['findBy']));this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this['channel'][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x168')]=function(_0x26c6d0){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x169'),_0x26c6d0[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x26c6d0[_0xbb0c('0x10e')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x26c6d0,_0xbb0c('0x16a'));}var _0x55ad63=this['getSound'][_0xbb0c('0xbf')](this,_0x26c6d0[_0xbb0c('0x10e')]);if(!_0x55ad63){return this[_0xbb0c('0x11')]['error'](_0x26c6d0,'no\x20file\x20audio\x20found');}var _0x117a63=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0x16b'),[_0x55ad63,_0x26c6d0[_0xbb0c('0x10b')]]);if(_0x117a63['result']===-0x1){return _0x117a63;}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xc2'),_0xbb0c('0x16b'),_0x55ad63));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x16c')]=function(_0x377834){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x377834[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x377834[_0xbb0c('0x16d')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x377834,'no\x20queue\x20selected');}var _0x276857='';var _0x4d4fd6=parseInt(_0x377834['queue_id'],0xa);if(isNaN(_0x4d4fd6)){_0x276857=_0x377834[_0xbb0c('0x16d')];}else{_0x276857=this[_0xbb0c('0x18')][_0xbb0c('0xbf')](this,_0x377834[_0xbb0c('0x16d')]);if(!_0x276857){return this['channel'][_0xbb0c('0x33')](_0x377834,_0xbb0c('0x16e'));}}var _0x2b1cc1='';if(this[_0xbb0c('0x86')](_0x377834[_0xbb0c('0x10e')])){var _0x517b1b=this[_0xbb0c('0x23')][_0xbb0c('0xbf')](this,_0x377834[_0xbb0c('0x10e')]);if(_0x517b1b){_0x2b1cc1=_0x517b1b;}}this['createSquareDetailsReport']['sync'](this,_0x377834,_0x276857);if(_0x377834['opts'][_0xbb0c('0x16f')]('x')<0x0){_0x377834[_0xbb0c('0x10b')]+='x';}if(_0x377834[_0xbb0c('0x10b')][_0xbb0c('0x16f')]('X')<0x0){_0x377834[_0xbb0c('0x10b')]+='X';}this[_0xbb0c('0x11')]['setVariable']('XMCS-QUEUE',_0x276857?_0x276857[_0xbb0c('0x170')]():'');var _0x575e58=this['channel'][_0xbb0c('0x5d')](_0xbb0c('0x171'),[_0x276857,_0x377834[_0xbb0c('0x10b')],_0x377834[_0xbb0c('0x68')],_0x2b1cc1,_0x377834['timeout'],_0x377834[_0xbb0c('0x9')],_0x377834[_0xbb0c('0x172')],_0x377834[_0xbb0c('0x173')],'',_0x377834[_0xbb0c('0x174')]]);if(_0x575e58[_0xbb0c('0xa2')]===-0x1){return _0x575e58;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0xbb0c('0x171'),_0x276857));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x175')]=function(_0x1c8210){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x176'),_0x1c8210[_0xbb0c('0x3e')]));var _0x2ef3ff=_0x1c8210[_0xbb0c('0x177')]||_0xbb0c('0x128');var _0x5a32e3=util[_0xbb0c('0x5a')](_0xbb0c('0x178'),this[_0xbb0c('0x11')][_0xbb0c('0x3d')],rs[_0xbb0c('0x115')](0x5));var _0x18246b=util[_0xbb0c('0x5a')]('%s/recordings/%s.%s',FILES_PATH,_0x5a32e3,_0x2ef3ff);var _0x300f34=util['format'](_0xbb0c('0x129'),FILES_PATH,_0x5a32e3);this[_0xbb0c('0x3f')][_0xbb0c('0xbf')](this,_0x1c8210,_0x5a32e3,_0x18246b);this[_0xbb0c('0x11')]['setVariable'](_0xbb0c('0x179'),_0x5a32e3);logger[_0xbb0c('0x35')](_0xbb0c('0x17a'),_0x300f34,_0x2ef3ff,_0x1c8210[_0xbb0c('0x17b')],_0x1c8210[_0xbb0c('0x6a')]);return this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x300f34,_0x2ef3ff,_0x1c8210['escape_digits'],_0x1c8210['timeout'],undefined,!![]);};AGIVertices[_0xbb0c('0x13')]['restapi']=function(_0xebb74d){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x17c'),_0xebb74d[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0xebb74d['url'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x17d'));}var _0xe8dc5d=this[_0xbb0c('0x67')][_0xbb0c('0xbf')](this,_0xebb74d);logger['info'](util['format'](_0xbb0c('0x17e'),util['inspect'](_0xe8dc5d,{'showHidden':![],'depth':null})));if(!this[_0xbb0c('0x86')](_0xebb74d[_0xbb0c('0xd5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x17f'));}var _0x5841dd=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0xebb74d[_0xbb0c('0xd5')]);if(!_0x5841dd){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0xebb74d,_0xbb0c('0xd6'));}this['channel']['setVariable'](util[_0xbb0c('0x5a')](_0xbb0c('0x180'),_0x5841dd),_0xe8dc5d[_0xbb0c('0x79')]?_0xe8dc5d[_0xbb0c('0x79')]:_0xbb0c('0x181'));this['channel'][_0xbb0c('0x9e')](util['format'](_0xbb0c('0x182'),_0x5841dd),_0xe8dc5d['statusMessage']?_0xe8dc5d[_0xbb0c('0x78')]:'OK');if(_0xe8dc5d['body']){try{this[_0xbb0c('0x9b')](_0xe8dc5d[_0xbb0c('0x70')],_0x5841dd);}catch(_0xfea576){logger[_0xbb0c('0x33')](util[_0xbb0c('0x5a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5841dd));}}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xdb'),_0x5841dd));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x183')]=function(_0x338ec3){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0x184'),_0x338ec3['label']));return this[_0xbb0c('0x11')]['sayDigits'](_0x338ec3[_0xbb0c('0x185')][_0xbb0c('0x5f')](/\s+/g,''),_0x338ec3['escape_digits']);};AGIVertices['prototype'][_0xbb0c('0x186')]=function(_0x3e1b77){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x187'),_0x3e1b77['label']));return this[_0xbb0c('0x11')][_0xbb0c('0x188')](_0x3e1b77[_0xbb0c('0x6b')][_0xbb0c('0x5f')](/\s+/g,''),_0x3e1b77['escape_digits']);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x189')]=function(_0x136c35){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x18a'),_0x136c35[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0x18b')](_0x136c35[_0xbb0c('0x63')],_0x136c35[_0xbb0c('0x17b')]);};AGIVertices[_0xbb0c('0x13')]['sendMail']=function(_0x38d4ca){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x18c'),_0x38d4ca[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x38d4ca[_0xbb0c('0x18d')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x18e'));}var _0x22ebad=this['getMailAccount'][_0xbb0c('0xbf')](this,_0x38d4ca[_0xbb0c('0x18d')]);if(!_0x22ebad||!_0x22ebad[_0xbb0c('0x18f')]){return this[_0xbb0c('0x11')]['error'](_0x38d4ca,_0xbb0c('0x190'));}var _0x108f44={'from':util[_0xbb0c('0x5a')]('\x22%s\x22\x20<%s>',_0x22ebad[_0xbb0c('0x16')],_0x22ebad[_0xbb0c('0x191')]||_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x192')]),'to':_0x38d4ca['to']||'','cc':_0x38d4ca['cc']||'','bcc':_0x38d4ca[_0xbb0c('0x193')]||'','subject':_0x38d4ca[_0xbb0c('0x194')],'html':_0x38d4ca['text'],'text':_0x38d4ca[_0xbb0c('0x63')]};var _0x3aaf3c={'tls':{'rejectUnauthorized':![]}};if(_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x195')]){_0x3aaf3c[_0xbb0c('0x195')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x195')];}else{_0x3aaf3c[_0xbb0c('0x196')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x196')];_0x3aaf3c[_0xbb0c('0x197')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x197')];_0x3aaf3c[_0xbb0c('0x198')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x198')];}if(_0x22ebad[_0xbb0c('0x18f')]['authentication']){_0x3aaf3c['auth']={'user':_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x192')],'pass':_0x22ebad[_0xbb0c('0x18f')]['pass']};}if(this['isConfigured'](_0x38d4ca[_0xbb0c('0x199')])){}logger[_0xbb0c('0xdd')](_0xbb0c('0x19a'),JSON[_0xbb0c('0x76')](_0x108f44));this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x38d4ca,_0x38d4ca[_0xbb0c('0x18d')]);this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x19b'),_0x22ebad[_0xbb0c('0x16')]));this['sendMailMessage'][_0xbb0c('0xbf')](this,_0x3aaf3c,_0x108f44);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x19c'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x19d')]=function(_0x477189){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x19e'),_0x477189['label']));return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x19f'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1a0')]=function(_0x16613c){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1a1'),_0x16613c[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x16613c[_0xbb0c('0x1a2')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x1a3'));}var _0xebb127=this[_0xbb0c('0x39')][_0xbb0c('0xbf')](this,_0x16613c[_0xbb0c('0x1a2')]);if(!_0xebb127){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x16613c,_0xbb0c('0x1a4'));}var _0xd9d7d9={'body':_0x16613c[_0xbb0c('0x1a5')],'phone':_0x16613c['to']||'','SmsAccountId':_0xebb127['id']};logger['debug'](_0xbb0c('0x1a6'),JSON[_0xbb0c('0x76')](_0xd9d7d9));this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x16613c,_0x16613c[_0xbb0c('0x1a2')]);this['channel'][_0xbb0c('0xa7')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0xebb127[_0xbb0c('0x16')]));this[_0xbb0c('0x3b')][_0xbb0c('0xbf')](this,_0xd9d7d9);return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x1a7'));};AGIVertices['prototype'][_0xbb0c('0x1a8')]=function(_0x1acca2){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1acca2['label']));if(!this[_0xbb0c('0x86')](_0x1acca2['variable_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1acca2,_0xbb0c('0x1a9'));}var _0x26eb83=this[_0xbb0c('0xa1')]['sync'](this,_0x1acca2['variable_id']);if(!_0x26eb83){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1acca2,_0xbb0c('0xd6'));}return this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x26eb83,_0x1acca2['variable_value']);};AGIVertices['prototype']['start']=function(_0x347c11){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1aa'),_0x347c11[_0xbb0c('0x3e')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('START\x20CALLY\x20SQUARE');if(_0x347c11['answer']===_0xbb0c('0x1ab')){this['channel']['noop'](_0xbb0c('0x1ac'));return this['channel'][_0xbb0c('0xb8')]();}return this['channel']['noop'](_0xbb0c('0x1ad'));};AGIVertices['prototype'][_0xbb0c('0x1ae')]=function(_0x1e4a93){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1af'),_0x1e4a93[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x1e4a93['project_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,_0xbb0c('0x1b0'));}var _0x549929=this['getSquareProject'][_0xbb0c('0xbf')](this,_0x1e4a93[_0xbb0c('0x1b1')]);if(!this['isConfigured'](_0x549929)){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,util[_0xbb0c('0x5a')](_0xbb0c('0x1b2'),_0x1e4a93[_0xbb0c('0x1b1')]));}if(_0x549929===this[_0xbb0c('0x11')][_0xbb0c('0x45')]){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x1e4a93,_0x549929);var _0x170fb4=this['channel'][_0xbb0c('0x5d')]('AGI',util[_0xbb0c('0x5a')](_0xbb0c('0x1b3'),config[_0xbb0c('0x9')]['host']||_0xbb0c('0x1b4'),_0x549929,this[_0xbb0c('0x11')][_0xbb0c('0x45')]));if(_0x170fb4[_0xbb0c('0xa2')]===-0x1){return _0x170fb4;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xc2'),_0xbb0c('0x1b5'),_0x549929));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b6')]=function(_0x1a3248){logger[_0xbb0c('0x35')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1a3248[_0xbb0c('0x3e')]));var _0x55728a=this[_0xbb0c('0x5c')][_0xbb0c('0xbf')](this,_0x1a3248[_0xbb0c('0xb4')]);this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x1a3248,_0x1a3248[_0xbb0c('0xb4')]);if(this[_0xbb0c('0x86')](_0x1a3248['variable_id'])){var _0xdf3cf8=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x1a3248[_0xbb0c('0xd5')]);if(_0xdf3cf8){this[_0xbb0c('0x11')]['setVariable'](_0xdf3cf8,_0x55728a);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x1b7'),_0x1a3248[_0xbb0c('0xb4')],_0xdf3cf8));}}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1a3248[_0xbb0c('0xb4')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b8')]=function(_0x1ddfb3){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1b9'),_0x1ddfb3[_0xbb0c('0x3e')]));_0x1ddfb3[_0xbb0c('0x63')]=_0x1ddfb3[_0xbb0c('0x63')][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1ddfb3[_0xbb0c('0x61')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x1ba'));}if(!this['isConfigured'](_0x1ddfb3[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x1bb'),_0x1ddfb3[_0xbb0c('0x63')]));var _0x30582c=this[_0xbb0c('0x60')][_0xbb0c('0xbf')](this,_0x1ddfb3);if(_0x30582c){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x1bc'),_0x30582c));var _0x3446e2=this['channel'][_0xbb0c('0xff')](_0x30582c);try{fs[_0xbb0c('0x11d')](_0x30582c+_0xbb0c('0x100'));}catch(_0x4549ea){logger[_0xbb0c('0x33')](_0x4549ea);}return _0x3446e2;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1ddfb3,_0xbb0c('0x1bd'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1be')]=function(_0x244a03){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x244a03['label']));_0x244a03[_0xbb0c('0x63')]=_0x244a03['text'][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbb0c('0x86')](_0x244a03[_0xbb0c('0x63')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x1bf'),_0x244a03[_0xbb0c('0x63')]));var _0x4db807=this[_0xbb0c('0x66')][_0xbb0c('0xbf')](this,_0x244a03);if(_0x4db807){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x1c0'),_0x4db807));var _0x52d471=this[_0xbb0c('0x11')]['streamFile'](_0x4db807);try{fs[_0xbb0c('0x11d')](_0x4db807+_0xbb0c('0x100'));}catch(_0x5e459e){logger[_0xbb0c('0x33')](_0x5e459e);}return _0x52d471;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x244a03,_0xbb0c('0x1c1'));};AGIVertices[_0xbb0c('0x13')]['unpause']=function(_0x5510c8){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x1c2'),_0x5510c8[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x5510c8[_0xbb0c('0x150')])){return this['channel'][_0xbb0c('0x33')](_0x5510c8,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xbb0c('0x152'),this['channel'][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));var _0x22ed03=this[_0xbb0c('0x56')][_0xbb0c('0xbf')](this,_0x5510c8[_0xbb0c('0x150')]);if(_0x22ed03){logger['info'](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xbb0c('0x40')],_0x5510c8['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1c3')]=function(_0x877aab){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1c4'),_0x877aab[_0xbb0c('0x3e')]));var _0x4410ee=this[_0xbb0c('0x11')][_0xbb0c('0x5d')]('VOICEMAIL',[_0x877aab[_0xbb0c('0x1c5')],_0x877aab['options']]);if(_0x4410ee[_0xbb0c('0xa2')]===-0x1){return _0x4410ee;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('Executed\x20command\x20%s\x20%s',_0xbb0c('0x1c6'),_0x877aab[_0xbb0c('0x1c5')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1c7')]=function(_0x495501){logger['info'](util['format'](_0xbb0c('0x1c8'),_0x495501[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x495501[_0xbb0c('0xd5')])){return this['channel'][_0xbb0c('0x33')](_0x495501,'no\x20variable\x20selected');}var _0x2d0b5e=this['getVariable'][_0xbb0c('0xbf')](this,_0x495501['variable_id']);if(!_0x2d0b5e){return this['channel']['error'](_0x495501,'no\x20variable\x20found');}var _0xe7051c=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](_0x2d0b5e);return{'code':0xc8,'result':_0xe7051c[_0xbb0c('0x9f')]?_0xe7051c['extra']:'-'};};String[_0xbb0c('0x13')][_0xbb0c('0x1c9')]=function(_0x55c30e,_0x15944f){return this[_0xbb0c('0x1ca')](_0x55c30e)[_0xbb0c('0x1cb')](_0x15944f);};module[_0xbb0c('0x1cc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index e5be849..f6ed211 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 _0x8826=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','interface','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','ACW','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8826,0x1bd));var _0x6882=function(_0x46b273,_0x4c62a2){_0x46b273=_0x46b273-0x0;var _0x21e654=_0x8826[_0x46b273];return _0x21e654;};'use strict';var util=require(_0x6882('0x0'));var _=require(_0x6882('0x1'));var moment=require(_0x6882('0x2'));var ami=require(_0x6882('0x3'));var logger=require(_0x6882('0x4'))(_0x6882('0x5'));var RpcUser=require(_0x6882('0x6'));var RpcVoiceAgentReport=require(_0x6882('0x7'));function Acw(_0x4d1261){this[_0x6882('0x8')]=_0x4d1261['voiceQueues'];this[_0x6882('0x9')]=_0x4d1261[_0x6882('0x9')];this[_0x6882('0xa')]=_0x4d1261[_0x6882('0xa')];this[_0x6882('0xb')]={};ami['on'](_0x6882('0xc'),this[_0x6882('0xd')][_0x6882('0xe')](this));ami['on'](_0x6882('0xf'),this[_0x6882('0x10')][_0x6882('0xe')](this));ami['on'](_0x6882('0x11'),this['syncHangup'][_0x6882('0xe')](this));ami['on'](_0x6882('0x12'),this[_0x6882('0x13')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x6882('0x14')][_0x6882('0xe')](this));ami['on']('custom:agentConnectPreview',this[_0x6882('0x15')][_0x6882('0xe')](this));}function getDiff(_0x5e92dc){var _0x45464c=moment()['milliseconds'](0x0);var _0x40790d=moment(_0x5e92dc)[_0x6882('0x16')](0x0);return _0x45464c['diff'](_0x40790d,_0x6882('0x17'));}Acw[_0x6882('0x18')][_0x6882('0x19')]=function(_0x28ad20){try{var _0x403663=this;var _0x68397a=this[_0x6882('0xb')][_0x28ad20]['interface'];var _0x12e7dd=this[_0x6882('0xb')][_0x28ad20]['queue'];var _0x3ef867=this[_0x6882('0x8')][_0x12e7dd];var _0x3b1911=![];var _0x322a52=_0x6882('0x1a');if(_0x3ef867['mandatoryDisposition']){if(_0x3ef867['mandatoryDispositionPause'][_0x6882('0x1b')]){_0x3b1911=!![];_0x322a52=_0x3ef867[_0x6882('0x1c')][_0x6882('0x1b')];}}ami[_0x6882('0x1d')]({'action':_0x6882('0x1e'),'interface':_0x68397a,'paused':!![],'reason':_0x322a52})[_0x6882('0x1f')](function(_0x3574b6){if(_0x403663[_0x6882('0x9')][_0x68397a]){return RpcUser[_0x6882('0x20')](_0x403663[_0x6882('0x9')][_0x68397a]['id'])[_0x6882('0x1f')](function(_0x3f10e6){if(_0x3f10e6&&!_0x3f10e6[_0x6882('0x21')]){logger['info'](_0x6882('0x22'),_0x28ad20,_0x68397a,_0x12e7dd);var _0x2ab000=_0x403663[_0x6882('0xb')][_0x28ad20]['attended']&&_0x403663['channels'][_0x28ad20]['destlinkedid']?_0x403663[_0x6882('0xb')][_0x28ad20][_0x6882('0x23')]:_0x28ad20;return RpcUser[_0x6882('0x24')](_0x403663['agents'][_0x68397a],_0x322a52,_0x2ab000)[_0x6882('0x1f')](function(_0x428f74){if(!_0x3b1911){_0x403663[_0x6882('0xa')][_0x68397a]={};logger[_0x6882('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x28ad20,_0x403663[_0x6882('0x8')][_0x12e7dd][_0x6882('0x26')],_0x68397a,_0x12e7dd);_0x403663[_0x6882('0xa')][_0x68397a][_0x6882('0x27')]=setTimeout(_0x403663[_0x6882('0x28')]['bind'](_0x403663,_0x68397a),_0x403663[_0x6882('0x8')][_0x12e7dd][_0x6882('0x26')]*0x3e8);_0x403663['timers'][_0x68397a][_0x6882('0x29')]=moment()[_0x6882('0x2a')](_0x6882('0x2b'));_0x403663[_0x6882('0xa')][_0x68397a]['uniqueid']=_0x28ad20;_0x403663[_0x6882('0xa')][_0x68397a][_0x6882('0x2c')]=_0x12e7dd;_0x403663['timers'][_0x68397a][_0x6882('0x2d')]=function(){var _0x5c42bb=getDiff(_0x403663[_0x6882('0xa')][_0x68397a][_0x6882('0x29')]);clearTimeout(_0x403663[_0x6882('0xa')][_0x68397a]['timer']);_0x403663[_0x6882('0xa')][_0x68397a][_0x6882('0x27')]=![];RpcVoiceAgentReport[_0x6882('0x2e')]({'acwtime':_0x5c42bb},_0x403663[_0x6882('0xa')][_0x68397a][_0x6882('0x2f')],_0x68397a)[_0x6882('0x1f')](function(_0x492791){logger[_0x6882('0x25')](_0x6882('0x30'),_0x28ad20,_0x5c42bb,_0x492791);})[_0x6882('0x31')](function(_0x35d120){logger[_0x6882('0x32')](_0x6882('0x33'),_0x28ad20,_0x35d120);});delete _0x403663['timers'][_0x68397a];};}});}else{logger[_0x6882('0x25')](_0x6882('0x34'),_0x28ad20,_0x68397a,_0x12e7dd);}});}})[_0x6882('0x31')](function(_0x25b58b){logger[_0x6882('0x32')](_0x6882('0x35'),_0x28ad20,_0x403663[_0x6882('0x8')][_0x12e7dd][_0x6882('0x26')],_0x68397a,_0x12e7dd);})[_0x6882('0x36')](function(){delete _0x403663[_0x6882('0xb')][_0x28ad20];});}catch(_0x146a78){logger['error'](_0x6882('0x37'),_0x146a78[_0x6882('0x38')]);}};Acw[_0x6882('0x18')][_0x6882('0x28')]=function(_0x26960d){try{var _0x132cd9=this;if(_0x132cd9[_0x6882('0xa')][_0x26960d]){_0x132cd9[_0x6882('0xa')][_0x26960d][_0x6882('0x27')]=![];var _0x4fe39d=_0x132cd9[_0x6882('0xa')][_0x26960d][_0x6882('0x2f')];var _0x3694a8=_0x132cd9[_0x6882('0xa')][_0x26960d][_0x6882('0x2c')];var _0x1b4110=_0x132cd9[_0x6882('0x8')][_0x3694a8][_0x6882('0x26')];logger['info'](_0x6882('0x39'),_0x4fe39d,_0x26960d);RpcUser[_0x6882('0x3a')](this['agents'][_0x26960d]);RpcVoiceAgentReport[_0x6882('0x2e')]({'acwtime':_0x1b4110,'agentacw':!![]},_0x4fe39d,_0x26960d)[_0x6882('0x1f')](function(_0x35b235){logger[_0x6882('0x25')](_0x6882('0x30'),_0x4fe39d,_0x1b4110,_0x35b235);})['catch'](function(_0x37cc6c){logger[_0x6882('0x32')](_0x6882('0x33'),_0x4fe39d,_0x37cc6c);});}else{logger['error'](_0x6882('0x3b'),_0x26960d);if(_0x132cd9[_0x6882('0xa')]){logger[_0x6882('0x25')](_0x6882('0x3c'),JSON[_0x6882('0x3d')](_0x132cd9['timers']));}}}catch(_0x26bd52){logger[_0x6882('0x32')]('[ACW][STOP]\x20%s',_0x26bd52[_0x6882('0x38')]);}};Acw['prototype'][_0x6882('0xd')]=function(_0x1aa7b9){try{if(this[_0x6882('0x8')][_0x1aa7b9[_0x6882('0x2c')]]&&(this['voiceQueues'][_0x1aa7b9[_0x6882('0x2c')]]['acw']||this[_0x6882('0x8')][_0x1aa7b9[_0x6882('0x2c')]]['mandatoryDisposition'])){if(this[_0x6882('0x9')][_0x1aa7b9[_0x6882('0x3e')]]){this[_0x6882('0xb')][_0x1aa7b9[_0x6882('0x2f')]]={'queue':_0x1aa7b9[_0x6882('0x2c')],'interface':_0x1aa7b9['interface'],'destlinkedid':_0x1aa7b9['destlinkedid']};}}}catch(_0x3977b6){logger[_0x6882('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x3977b6[_0x6882('0x38')]);}};Acw[_0x6882('0x18')]['syncAgentConnectPreview']=function(_0x4f0007){try{if(this[_0x6882('0x8')][_0x4f0007[_0x6882('0x2c')]]&&(this[_0x6882('0x8')][_0x4f0007[_0x6882('0x2c')]][_0x6882('0x5')]||this['voiceQueues'][_0x4f0007[_0x6882('0x2c')]][_0x6882('0x3f')])){if(this[_0x6882('0x9')][_0x4f0007['interface']]){this[_0x6882('0xb')][_0x4f0007[_0x6882('0x2f')]]={'queue':_0x4f0007[_0x6882('0x2c')],'interface':_0x4f0007[_0x6882('0x3e')]};}}}catch(_0x22f26b){logger[_0x6882('0x32')](_0x6882('0x40'),_0x22f26b[_0x6882('0x38')]);}};Acw[_0x6882('0x18')][_0x6882('0x10')]=function(_0xb054bd){try{if(this[_0x6882('0xb')][_0xb054bd[_0x6882('0x2f')]]&&_['isUndefined'](this[_0x6882('0xb')][_0xb054bd['uniqueid']][_0x6882('0x41')])){logger[_0x6882('0x25')](_0x6882('0x42'),_0xb054bd[_0x6882('0x2f')]);this[_0x6882('0x19')](_0xb054bd['uniqueid']);}else if(this[_0x6882('0xb')][_0xb054bd[_0x6882('0x43')]]&&_['isUndefined'](this[_0x6882('0xb')][_0xb054bd['linkedid']]['attended'])){logger[_0x6882('0x25')]('[%s][HANGUP:LINKEDID]',_0xb054bd[_0x6882('0x43')]);this['startAcw'](_0xb054bd['linkedid']);}}catch(_0x4c8423){logger[_0x6882('0x32')](_0x6882('0x44'),_0x4c8423[_0x6882('0x38')]);}};Acw[_0x6882('0x18')]['syncHangup']=function(_0x5df8e7){try{if(this[_0x6882('0xb')][_0x5df8e7[_0x6882('0x2f')]]&&this[_0x6882('0xb')][_0x5df8e7[_0x6882('0x2f')]][_0x6882('0x41')]){logger[_0x6882('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5df8e7[_0x6882('0x2f')]);this[_0x6882('0x19')](_0x5df8e7['uniqueid']);}else if(this[_0x6882('0xb')][_0x5df8e7[_0x6882('0x43')]]&&this[_0x6882('0xb')][_0x5df8e7[_0x6882('0x43')]][_0x6882('0x41')]){logger[_0x6882('0x25')](_0x6882('0x45'),_0x5df8e7['linkedid']);this['startAcw'](_0x5df8e7[_0x6882('0x43')]);}}catch(_0x4239e8){logger[_0x6882('0x32')]('[ACW][syncHangup]\x20%s',_0x4239e8[_0x6882('0x38')]);}};Acw[_0x6882('0x18')][_0x6882('0x46')]=function(_0x2910a9){try{if(!_['isNil'](this['channels'][_0x2910a9[_0x6882('0x47')]])){this[_0x6882('0x19')](_0x2910a9[_0x6882('0x47')]);if(this[_0x6882('0xb')][_0x2910a9[_0x6882('0x48')]]){this[_0x6882('0xb')][_0x2910a9[_0x6882('0x48')]][_0x6882('0x41')]=!![];this[_0x6882('0xb')][_0x2910a9['transfertargetuniqueid']]=this['channels'][_0x2910a9[_0x6882('0x48')]];delete this[_0x6882('0xb')][_0x2910a9[_0x6882('0x48')]];}}else if(!_['isNil'](this[_0x6882('0xb')][_0x2910a9[_0x6882('0x49')]])){this[_0x6882('0x19')](_0x2910a9[_0x6882('0x49')]);if(this['channels'][_0x2910a9[_0x6882('0x4a')]]){this[_0x6882('0xb')][_0x2910a9['origtransfereruniqueid']][_0x6882('0x41')]=!![];this[_0x6882('0xb')][_0x2910a9[_0x6882('0x47')]]=this[_0x6882('0xb')][_0x2910a9[_0x6882('0x4a')]];delete this['channels'][_0x2910a9[_0x6882('0x4a')]];}}}catch(_0x1e6e7e){logger['error'](_0x6882('0x4b'),_0x1e6e7e[_0x6882('0x38')]);}};Acw[_0x6882('0x18')][_0x6882('0x14')]=function(_0x29ba74){try{if(this['channels'][_0x29ba74[_0x6882('0x4c')]]){logger[_0x6882('0x25')](_0x6882('0x4d'),JSON['stringify'](_0x29ba74['transfereruniqueid']));this[_0x6882('0x19')](_0x29ba74[_0x6882('0x4c')]);}else if(this[_0x6882('0xb')][_0x29ba74[_0x6882('0x4e')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x29ba74[_0x6882('0x4e')]));this[_0x6882('0x19')](_0x29ba74[_0x6882('0x4e')]);}}catch(_0x3b945c){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x3b945c['message']);}};Acw[_0x6882('0x18')][_0x6882('0x13')]=function(_0x5625a7){try{if(this[_0x6882('0x8')][_0x5625a7['queue']]&&this[_0x6882('0x8')][_0x5625a7[_0x6882('0x2c')]][_0x6882('0x4f')]==='all'){if(this[_0x6882('0x9')][_0x5625a7['interface']]){logger[_0x6882('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5625a7[_0x6882('0x2f')],_0x5625a7[_0x6882('0x3e')],_0x5625a7[_0x6882('0x2c')]);return RpcUser['savePause'](this['agents'][_0x5625a7['interface']],_0x6882('0x50'),_0x5625a7[_0x6882('0x2f')]);}}}catch(_0x1fafe0){logger[_0x6882('0x32')](_0x6882('0x51'),_0x1fafe0[_0x6882('0x38')]);}};module[_0x6882('0x52')]=Acw; \ No newline at end of file +var _0x5a9e=['[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','startAcw','interface','queue','mandatoryDisposition','name','Action','QueuePause','then','getAgent','info'];(function(_0x41c88c,_0x381f8d){var _0x2c97ea=function(_0x35fd44){while(--_0x35fd44){_0x41c88c['push'](_0x41c88c['shift']());}};_0x2c97ea(++_0x381f8d);}(_0x5a9e,0xd7));var _0xe5a9=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5a9e[_0x17928f];return _0x500b63;};'use strict';var util=require(_0xe5a9('0x0'));var _=require('lodash');var moment=require(_0xe5a9('0x1'));var ami=require('../ami');var logger=require(_0xe5a9('0x2'))(_0xe5a9('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe5a9('0x4'));function Acw(_0x129387){this[_0xe5a9('0x5')]=_0x129387[_0xe5a9('0x5')];this[_0xe5a9('0x6')]=_0x129387[_0xe5a9('0x6')];this[_0xe5a9('0x7')]=_0x129387[_0xe5a9('0x7')];this[_0xe5a9('0x8')]={};ami['on'](_0xe5a9('0x9'),this[_0xe5a9('0xa')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0xc'),this[_0xe5a9('0xd')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0xe'),this['syncHangup']['bind'](this));ami['on'](_0xe5a9('0xf'),this[_0xe5a9('0x10')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0x11'),this[_0xe5a9('0x12')]['bind'](this));ami['on'](_0xe5a9('0x13'),this[_0xe5a9('0x14')][_0xe5a9('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xe5a9('0xb')](this));}function getDiff(_0x3c9522){var _0x4eca73=moment()['milliseconds'](0x0);var _0x2e6425=moment(_0x3c9522)[_0xe5a9('0x15')](0x0);return _0x4eca73[_0xe5a9('0x16')](_0x2e6425,_0xe5a9('0x17'));}Acw['prototype'][_0xe5a9('0x18')]=function(_0x47de23){try{var _0x44381f=this;var _0x5debc8=this['channels'][_0x47de23][_0xe5a9('0x19')];var _0x542dca=this[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x1a')];var _0x1d80d9=this[_0xe5a9('0x5')][_0x542dca];var _0x283e51=![];var _0x3eaab9='ACW';if(_0x1d80d9[_0xe5a9('0x1b')]){if(_0x1d80d9['mandatoryDispositionPause'][_0xe5a9('0x1c')]){_0x283e51=!![];_0x3eaab9=_0x1d80d9['mandatoryDispositionPause'][_0xe5a9('0x1c')];}}ami[_0xe5a9('0x1d')]({'action':_0xe5a9('0x1e'),'interface':_0x5debc8,'paused':!![],'reason':_0x3eaab9})[_0xe5a9('0x1f')](function(_0x510602){if(_0x44381f[_0xe5a9('0x6')][_0x5debc8]){return RpcUser[_0xe5a9('0x20')](_0x44381f[_0xe5a9('0x6')][_0x5debc8]['id'])[_0xe5a9('0x1f')](function(_0xa77af6){if(_0xa77af6&&!_0xa77af6['voicePause']){logger[_0xe5a9('0x21')](_0xe5a9('0x22'),_0x47de23,_0x5debc8,_0x542dca);var _0x552d2e=_0x44381f[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x23')]&&_0x44381f[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x24')]?_0x44381f[_0xe5a9('0x8')][_0x47de23]['destlinkedid']:_0x47de23;return RpcUser[_0xe5a9('0x25')](_0x44381f[_0xe5a9('0x6')][_0x5debc8],_0x3eaab9,_0x552d2e)['then'](function(_0x3e1869){if(!_0x283e51){_0x44381f[_0xe5a9('0x7')][_0x5debc8]={};logger[_0xe5a9('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47de23,_0x44381f[_0xe5a9('0x5')][_0x542dca][_0xe5a9('0x26')],_0x5debc8,_0x542dca);_0x44381f[_0xe5a9('0x7')][_0x5debc8]['timer']=setTimeout(_0x44381f[_0xe5a9('0x27')][_0xe5a9('0xb')](_0x44381f,_0x5debc8),_0x44381f['voiceQueues'][_0x542dca][_0xe5a9('0x26')]*0x3e8);_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x28')]=moment()[_0xe5a9('0x29')](_0xe5a9('0x2a'));_0x44381f[_0xe5a9('0x7')][_0x5debc8]['uniqueid']=_0x47de23;_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x1a')]=_0x542dca;_0x44381f[_0xe5a9('0x7')][_0x5debc8]['updateAcw']=function(){var _0x4a73fb=getDiff(_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x28')]);clearTimeout(_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2b')]);_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2b')]=![];RpcVoiceAgentReport[_0xe5a9('0x2c')]({'acwtime':_0x4a73fb},_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2d')],_0x5debc8)[_0xe5a9('0x1f')](function(_0x1457ae){logger['info'](_0xe5a9('0x2e'),_0x47de23,_0x4a73fb,_0x1457ae);})['catch'](function(_0x1c72e5){logger[_0xe5a9('0x2f')](_0xe5a9('0x30'),_0x47de23,_0x1c72e5);});delete _0x44381f['timers'][_0x5debc8];};}});}else{logger[_0xe5a9('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x47de23,_0x5debc8,_0x542dca);}});}})[_0xe5a9('0x31')](function(_0x525898){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47de23,_0x44381f[_0xe5a9('0x5')][_0x542dca][_0xe5a9('0x26')],_0x5debc8,_0x542dca);})[_0xe5a9('0x32')](function(){delete _0x44381f[_0xe5a9('0x8')][_0x47de23];});}catch(_0x4dbbaf){logger[_0xe5a9('0x2f')](_0xe5a9('0x33'),_0x4dbbaf[_0xe5a9('0x34')]);}};Acw['prototype'][_0xe5a9('0x27')]=function(_0x3dacfe){try{var _0x7e4146=this;if(_0x7e4146['timers'][_0x3dacfe]){_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x2b')]=![];var _0x39c235=_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x2d')];var _0x429edc=_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x1a')];var _0x36917a=_0x7e4146[_0xe5a9('0x5')][_0x429edc]['acwTimeout'];logger[_0xe5a9('0x21')](_0xe5a9('0x35'),_0x39c235,_0x3dacfe);RpcUser[_0xe5a9('0x36')](this[_0xe5a9('0x6')][_0x3dacfe]);RpcVoiceAgentReport[_0xe5a9('0x2c')]({'acwtime':_0x36917a,'agentacw':!![]},_0x39c235,_0x3dacfe)['then'](function(_0x446dba){logger['info'](_0xe5a9('0x2e'),_0x39c235,_0x36917a,_0x446dba);})[_0xe5a9('0x31')](function(_0x380fc1){logger['error'](_0xe5a9('0x30'),_0x39c235,_0x380fc1);});}else{logger[_0xe5a9('0x2f')](_0xe5a9('0x37'),_0x3dacfe);if(_0x7e4146[_0xe5a9('0x7')]){logger[_0xe5a9('0x21')](_0xe5a9('0x38'),JSON[_0xe5a9('0x39')](_0x7e4146[_0xe5a9('0x7')]));}}}catch(_0x5a6817){logger['error'](_0xe5a9('0x3a'),_0x5a6817['message']);}};Acw[_0xe5a9('0x3b')][_0xe5a9('0xa')]=function(_0x25b3b4){try{if(this['voiceQueues'][_0x25b3b4[_0xe5a9('0x1a')]]&&(this[_0xe5a9('0x5')][_0x25b3b4[_0xe5a9('0x1a')]][_0xe5a9('0x3')]||this[_0xe5a9('0x5')][_0x25b3b4[_0xe5a9('0x1a')]]['mandatoryDisposition'])){if(this[_0xe5a9('0x6')][_0x25b3b4[_0xe5a9('0x19')]]){this[_0xe5a9('0x8')][_0x25b3b4[_0xe5a9('0x2d')]]={'queue':_0x25b3b4[_0xe5a9('0x1a')],'interface':_0x25b3b4[_0xe5a9('0x19')],'destlinkedid':_0x25b3b4[_0xe5a9('0x24')]};}}}catch(_0x1d814f){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1d814f[_0xe5a9('0x34')]);}};Acw[_0xe5a9('0x3b')]['syncAgentConnectPreview']=function(_0x24a7e8){try{if(this[_0xe5a9('0x5')][_0x24a7e8[_0xe5a9('0x1a')]]&&(this['voiceQueues'][_0x24a7e8[_0xe5a9('0x1a')]]['acw']||this[_0xe5a9('0x5')][_0x24a7e8[_0xe5a9('0x1a')]]['mandatoryDisposition'])){if(this[_0xe5a9('0x6')][_0x24a7e8[_0xe5a9('0x19')]]){this[_0xe5a9('0x8')][_0x24a7e8['uniqueid']]={'queue':_0x24a7e8['queue'],'interface':_0x24a7e8[_0xe5a9('0x19')]};}}}catch(_0x9195ed){logger['error'](_0xe5a9('0x3c'),_0x9195ed['message']);}};Acw['prototype'][_0xe5a9('0xd')]=function(_0x4655bd){try{if(this[_0xe5a9('0x8')][_0x4655bd['uniqueid']]&&_[_0xe5a9('0x3d')](this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x2d')]][_0xe5a9('0x23')])){logger[_0xe5a9('0x21')](_0xe5a9('0x3e'),_0x4655bd[_0xe5a9('0x2d')]);this['startAcw'](_0x4655bd['uniqueid']);}else if(this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x3f')]]&&_['isUndefined'](this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x3f')]][_0xe5a9('0x23')])){logger[_0xe5a9('0x21')](_0xe5a9('0x40'),_0x4655bd[_0xe5a9('0x3f')]);this[_0xe5a9('0x18')](_0x4655bd[_0xe5a9('0x3f')]);}}catch(_0x499671){logger[_0xe5a9('0x2f')](_0xe5a9('0x41'),_0x499671[_0xe5a9('0x34')]);}};Acw['prototype']['syncHangup']=function(_0x31e83a){try{if(this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x2d')]]&&this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x2d')]]['attended']){logger[_0xe5a9('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x31e83a[_0xe5a9('0x2d')]);this['startAcw'](_0x31e83a[_0xe5a9('0x2d')]);}else if(this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x3f')]]&&this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x3f')]][_0xe5a9('0x23')]){logger['info'](_0xe5a9('0x42'),_0x31e83a['linkedid']);this[_0xe5a9('0x18')](_0x31e83a[_0xe5a9('0x3f')]);}}catch(_0x154393){logger[_0xe5a9('0x2f')]('[ACW][syncHangup]\x20%s',_0x154393[_0xe5a9('0x34')]);}};Acw['prototype'][_0xe5a9('0x12')]=function(_0x5d5eb1){try{if(!_[_0xe5a9('0x43')](this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x44')]])){this['startAcw'](_0x5d5eb1['transfereeuniqueid']);if(this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]]){this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]][_0xe5a9('0x23')]=!![];this[_0xe5a9('0x8')][_0x5d5eb1['transfertargetuniqueid']]=this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]];delete this['channels'][_0x5d5eb1[_0xe5a9('0x45')]];}}else if(!_[_0xe5a9('0x43')](this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x46')]])){this[_0xe5a9('0x18')](_0x5d5eb1[_0xe5a9('0x46')]);if(this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x47')]]){this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x47')]][_0xe5a9('0x23')]=!![];this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x44')]]=this['channels'][_0x5d5eb1[_0xe5a9('0x47')]];delete this[_0xe5a9('0x8')][_0x5d5eb1['origtransfereruniqueid']];}}}catch(_0x3b481a){logger[_0xe5a9('0x2f')](_0xe5a9('0x48'),_0x3b481a['message']);}};Acw[_0xe5a9('0x3b')]['syncBlindTransfer']=function(_0xdb74c1){try{if(this[_0xe5a9('0x8')][_0xdb74c1[_0xe5a9('0x49')]]){logger[_0xe5a9('0x21')](_0xe5a9('0x4a'),JSON['stringify'](_0xdb74c1[_0xe5a9('0x49')]));this['startAcw'](_0xdb74c1[_0xe5a9('0x49')]);}else if(this[_0xe5a9('0x8')][_0xdb74c1['transfererlinkedid']]){logger[_0xe5a9('0x21')](_0xe5a9('0x4b'),JSON['stringify'](_0xdb74c1[_0xe5a9('0x4c')]));this[_0xe5a9('0x18')](_0xdb74c1[_0xe5a9('0x4c')]);}}catch(_0x50d46c){logger['error'](_0xe5a9('0x4d'),_0x50d46c['message']);}};Acw['prototype'][_0xe5a9('0x10')]=function(_0x42b23f){try{if(this[_0xe5a9('0x5')][_0x42b23f['queue']]&&this[_0xe5a9('0x5')][_0x42b23f[_0xe5a9('0x1a')]][_0xe5a9('0x4e')]===_0xe5a9('0x4f')){if(this[_0xe5a9('0x6')][_0x42b23f[_0xe5a9('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x42b23f[_0xe5a9('0x2d')],_0x42b23f[_0xe5a9('0x19')],_0x42b23f[_0xe5a9('0x1a')]);return RpcUser[_0xe5a9('0x25')](this['agents'][_0x42b23f[_0xe5a9('0x19')]],_0xe5a9('0x50'),_0x42b23f[_0xe5a9('0x2d')]);}}}catch(_0x3ab357){logger['error'](_0xe5a9('0x51'),_0x3ab357[_0xe5a9('0x34')]);}};module[_0xe5a9('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a75e27d..cb5761c 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 _0x2d3c=['lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','username','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionSipShowRegistry','then','actionDeviceStateList','actionQueueSummary','catch','log','exports','asterisk-manager','util'];(function(_0x3c63f2,_0xbe25b8){var _0x26e984=function(_0x2e0baa){while(--_0x2e0baa){_0x3c63f2['push'](_0x3c63f2['shift']());}};_0x26e984(++_0xbe25b8);}(_0x2d3c,0x79));var _0xc2d3=function(_0x19f2cc,_0x55fc35){_0x19f2cc=_0x19f2cc-0x0;var _0xed6f81=_0x2d3c[_0x19f2cc];return _0xed6f81;};'use strict';var Manager=require(_0xc2d3('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0xc2d3('0x1'));var _=require(_0xc2d3('0x2'));var logger=require(_0xc2d3('0x3'))(_0xc2d3('0x4'));var config=require(_0xc2d3('0x5'));var ami=new Manager(config[_0xc2d3('0x6')][_0xc2d3('0x7')],config['asterisk']['ip'],config[_0xc2d3('0x6')]['username'],config[_0xc2d3('0x6')][_0xc2d3('0x8')],!![]);ami[_0xc2d3('0x9')]();ami[_0xc2d3('0xa')]=BPromise[_0xc2d3('0xb')](ami[_0xc2d3('0xc')]);function error(_0x1b734e){logger[_0xc2d3('0xd')](util['format'](_0xc2d3('0xe'),config[_0xc2d3('0x6')]['username'],config['asterisk']['ip'],config[_0xc2d3('0x6')][_0xc2d3('0x7')],util[_0xc2d3('0xf')](_0x1b734e,![],null)));}function close(){logger[_0xc2d3('0xd')](util[_0xc2d3('0x10')](_0xc2d3('0x11'),config['asterisk']['username'],config[_0xc2d3('0x6')]['ip'],config[_0xc2d3('0x6')][_0xc2d3('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xc2d3('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xc2d3('0xa')]({'action':_0xc2d3('0x13')});};};ami[_0xc2d3('0x14')]=function(){return function(){return ami[_0xc2d3('0xa')]({'action':_0xc2d3('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0xc2d3('0x16')]=function(){return function(){return ami[_0xc2d3('0xa')]({'action':_0xc2d3('0x17')});};};function connect(_0x33df07){logger[_0xc2d3('0x18')](util[_0xc2d3('0x10')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xc2d3('0x6')][_0xc2d3('0x19')],config[_0xc2d3('0x6')]['ip'],config[_0xc2d3('0x6')][_0xc2d3('0x7')]));ami[_0xc2d3('0x1a')](_0xc2d3('0xd'),error);ami[_0xc2d3('0x1a')](_0xc2d3('0x1b'),close);}ami['on'](_0xc2d3('0x1c'),connect);ami['on'](_0xc2d3('0x1d'),function(_0x56947a){logger['info'](util[_0xc2d3('0x10')](_0xc2d3('0x1e'),config[_0xc2d3('0x6')][_0xc2d3('0x19')],config[_0xc2d3('0x6')]['ip'],config['asterisk'][_0xc2d3('0x7')],util['inspect'](_0x56947a,![],null)));});ami['on'](_0xc2d3('0x1f'),function(_0x3b9c87){logger[_0xc2d3('0x18')](util[_0xc2d3('0x10')](_0xc2d3('0x20'),config[_0xc2d3('0x6')][_0xc2d3('0x19')],config[_0xc2d3('0x6')]['ip'],config['asterisk'][_0xc2d3('0x7')]));return BPromise[_0xc2d3('0x21')]()['then'](ami[_0xc2d3('0x22')]())[_0xc2d3('0x23')](ami[_0xc2d3('0x24')]())[_0xc2d3('0x23')](ami[_0xc2d3('0x14')]())[_0xc2d3('0x23')](ami[_0xc2d3('0x25')]())[_0xc2d3('0x23')](ami[_0xc2d3('0x16')]())[_0xc2d3('0x26')](function(_0x41f9af){console[_0xc2d3('0x27')](_0x41f9af);});});ami['once'](_0xc2d3('0xd'),error);ami[_0xc2d3('0x1a')](_0xc2d3('0x1b'),close);module[_0xc2d3('0x28')]=ami; \ No newline at end of file +var _0x83c4=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','moment','util','lodash','../../config/logger','ami','asterisk','username','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port'];(function(_0x195c6b,_0x558639){var _0x239123=function(_0x31b683){while(--_0x31b683){_0x195c6b['push'](_0x195c6b['shift']());}};_0x239123(++_0x558639);}(_0x83c4,0x168));var _0x483c=function(_0x320ff6,_0x223d7a){_0x320ff6=_0x320ff6-0x0;var _0x5685e6=_0x83c4[_0x320ff6];return _0x5685e6;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x483c('0x0'));var util=require(_0x483c('0x1'));var _=require(_0x483c('0x2'));var logger=require(_0x483c('0x3'))(_0x483c('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x483c('0x5')]['port'],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['password'],!![]);ami[_0x483c('0x7')]();ami[_0x483c('0x8')]=BPromise['promisify'](ami[_0x483c('0x9')]);function error(_0x31d4ab){logger[_0x483c('0xa')](util[_0x483c('0xb')](_0x483c('0xc'),config['asterisk']['username'],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')],util['inspect'](_0x31d4ab,![],null)));}function close(){logger[_0x483c('0xa')](util[_0x483c('0xb')](_0x483c('0xe'),config[_0x483c('0x5')][_0x483c('0x6')],config['asterisk']['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));}ami[_0x483c('0xf')]=function(){return function(){return ami[_0x483c('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x483c('0x8')]({'action':_0x483c('0x10')});};};ami[_0x483c('0x11')]=function(){return function(){return ami['Action']({'action':_0x483c('0x12')});};};ami[_0x483c('0x13')]=function(){return function(){return ami[_0x483c('0x8')]({'action':'queuesummary'});};};ami[_0x483c('0x14')]=function(){return function(){return ami[_0x483c('0x8')]({'action':_0x483c('0x15')});};};function connect(_0x31e082){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x17'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));ami['once'](_0x483c('0xa'),error);ami[_0x483c('0x18')]('close',close);}ami['on'](_0x483c('0x19'),connect);ami['on'](_0x483c('0x1a'),function(_0x311d2d){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x1b'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')]['port'],util[_0x483c('0x1c')](_0x311d2d,![],null)));});ami['on'](_0x483c('0x1d'),function(_0x3901e3){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x1e'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));return BPromise[_0x483c('0x1f')]()[_0x483c('0x20')](ami[_0x483c('0xf')]())[_0x483c('0x20')](ami['actionDeviceStateList']())[_0x483c('0x20')](ami[_0x483c('0x11')]())[_0x483c('0x20')](ami[_0x483c('0x13')]())[_0x483c('0x20')](ami[_0x483c('0x14')]())['catch'](function(_0x166902){console[_0x483c('0x21')](_0x166902);});});ami[_0x483c('0x18')](_0x483c('0xa'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d76b78b..a1e242c 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x59c46a,_0x26548b){var _0x4f61d3=function(_0x3a9e01){while(--_0x3a9e01){_0x59c46a['push'](_0x59c46a['shift']());}};_0x4f61d3(++_0x26548b);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xc905bf,_0x3fb45d){_0xc905bf=_0xc905bf-0x0;var _0x3ffd14=_0xbdb7[_0xc905bf];return _0x3ffd14;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x70e0,0x17b));var _0x070e=function(_0x58e927,_0x46696e){_0x58e927=_0x58e927-0x0;var _0x46231e=_0x70e0[_0x58e927];return _0x46231e;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 4725e72..39a1604 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 _0x96f4=['scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','number','queue','active','type','dialQueueTimeout'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x96f4,0xc8));var _0x496f=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x96f4[_0x22ffbf];return _0x360c17;};'use strict';var util=require(_0x496f('0x0'));var _=require(_0x496f('0x1'));var moment=require(_0x496f('0x2'));function checkNameSurname(_0x76f4df,_0x221b29,_0x4c9578){var _0x45cc11='';if(!_[_0x496f('0x3')](_0x221b29)&&'string'===typeof _0x221b29){_0x45cc11+=_0x221b29;}if(!_[_0x496f('0x3')](_0x4c9578)&&_0x496f('0x4')===typeof _0x4c9578){_0x45cc11+='\x20'+_0x4c9578;}if(_0x45cc11!==''){return _0x45cc11;}return _0x76f4df;}function Action(_0x540edc,_0xcd6b10,_0x48e8a8){this[_0x496f('0x5')]=_0x540edc;this[_0x496f('0x6')]=_0x48e8a8||undefined;this[_0x496f('0x7')]=checkNameSurname(_0xcd6b10[_0x496f('0x8')][_0x496f('0x9')],_0xcd6b10['Contact']['firstName'],_0xcd6b10[_0x496f('0x8')]['lastName']);this[_0x496f('0xa')]=_0xcd6b10[_0x496f('0x8')][_0x496f('0x9')];this[_0x496f('0xb')]=_0x540edc[_0x496f('0x7')];this[_0x496f('0xc')]=_0xcd6b10[_0x496f('0xc')]||![];this[_0x496f('0xd')]=_0x540edc[_0x496f('0xd')];this[_0x496f('0xe')]=_0x540edc['dialQueueTimeout']||0x3;this[_0x496f('0xf')]=_0xcd6b10[_0x496f('0xf')];this['countbusyretry']=_0xcd6b10[_0x496f('0x10')];this['countcongestionretry']=_0xcd6b10['countcongestionretry'];this[_0x496f('0x11')]=_0xcd6b10[_0x496f('0x11')];this[_0x496f('0x12')]=_0xcd6b10[_0x496f('0x12')];this[_0x496f('0x13')]=_0xcd6b10[_0x496f('0x13')];this[_0x496f('0x14')]=_0xcd6b10[_0x496f('0x14')];this['countmachineretry']=_0xcd6b10[_0x496f('0x15')];this[_0x496f('0x16')]=_0xcd6b10[_0x496f('0x16')];this['ContactId']=_0xcd6b10['ContactId'];this[_0x496f('0x17')]=_0xcd6b10[_0x496f('0x17')];this[_0x496f('0x18')]=_0xcd6b10[_0x496f('0x18')];this[_0x496f('0x19')]=_0xcd6b10[_0x496f('0x19')];this['CampaignId']=_0xcd6b10[_0x496f('0x1a')];this[_0x496f('0x1b')]=_0xcd6b10['id'];this[_0x496f('0x1c')]=_0xcd6b10['Contact'][_0x496f('0x1d')]||'';this[_0x496f('0x1e')]=moment()['format'](_0x496f('0x1f'));this['callback']=_0xcd6b10[_0x496f('0x20')];this[_0x496f('0x21')]=_0xcd6b10[_0x496f('0x21')];this[_0x496f('0x22')]=_0xcd6b10['callbackat'];this[_0x496f('0x23')]=_0xcd6b10[_0x496f('0x23')];this[_0x496f('0x24')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format'](_0x496f('0x25'),this[_0x496f('0x7')],this['voiceQueue'][_0x496f('0x26')]>0x0?this[_0x496f('0xa')][_0x496f('0x27')](this[_0x496f('0x5')]['dialCutDigit']):this[_0x496f('0xa')]);};Action[_0x496f('0x28')][_0x496f('0x29')]=function(){return this['queue'];};module[_0x496f('0x2a')]=Action; \ No newline at end of file +var _0x4ec8=['CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','voiceQueue','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','Contact','firstName','lastName','number','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x4ec8,0xf7));var _0x84ec=function(_0x466855,_0x3851ac){_0x466855=_0x466855-0x0;var _0x60b632=_0x4ec8[_0x466855];return _0x60b632;};'use strict';var util=require(_0x84ec('0x0'));var _=require(_0x84ec('0x1'));var moment=require(_0x84ec('0x2'));function checkNameSurname(_0x18b6c0,_0x50526b,_0x407ec7){var _0x28dc87='';if(!_[_0x84ec('0x3')](_0x50526b)&&'string'===typeof _0x50526b){_0x28dc87+=_0x50526b;}if(!_['isNil'](_0x407ec7)&&_0x84ec('0x4')===typeof _0x407ec7){_0x28dc87+='\x20'+_0x407ec7;}if(_0x28dc87!==''){return _0x28dc87;}return _0x18b6c0;}function Action(_0x7f9c3,_0x234f24,_0x2cabc9){this['voiceQueue']=_0x7f9c3;this[_0x84ec('0x5')]=_0x2cabc9||undefined;this['name']=checkNameSurname(_0x234f24[_0x84ec('0x6')]['phone'],_0x234f24[_0x84ec('0x6')][_0x84ec('0x7')],_0x234f24[_0x84ec('0x6')][_0x84ec('0x8')]);this[_0x84ec('0x9')]=_0x234f24[_0x84ec('0x6')][_0x84ec('0xa')];this[_0x84ec('0xb')]=_0x7f9c3[_0x84ec('0xc')];this[_0x84ec('0xd')]=_0x234f24[_0x84ec('0xd')]||![];this[_0x84ec('0xe')]=_0x7f9c3[_0x84ec('0xe')];this[_0x84ec('0xf')]=_0x7f9c3['dialQueueTimeout']||0x3;this[_0x84ec('0x10')]=_0x234f24[_0x84ec('0x10')];this['countbusyretry']=_0x234f24[_0x84ec('0x11')];this['countcongestionretry']=_0x234f24[_0x84ec('0x12')];this[_0x84ec('0x13')]=_0x234f24['countnoanswerretry'];this['countnosuchnumberretry']=_0x234f24[_0x84ec('0x14')];this[_0x84ec('0x15')]=_0x234f24[_0x84ec('0x15')];this['countabandonedretry']=_0x234f24[_0x84ec('0x16')];this[_0x84ec('0x17')]=_0x234f24[_0x84ec('0x17')];this[_0x84ec('0x18')]=_0x234f24[_0x84ec('0x18')];this[_0x84ec('0x19')]=_0x234f24[_0x84ec('0x19')];this['ListId']=_0x234f24[_0x84ec('0x1a')];this[_0x84ec('0x1b')]=_0x234f24[_0x84ec('0x1b')];this[_0x84ec('0x1c')]=_0x234f24[_0x84ec('0x1c')];this[_0x84ec('0x1d')]=_0x234f24[_0x84ec('0x1d')];this['idHopper']=_0x234f24['id'];this[_0x84ec('0x1e')]=_0x234f24[_0x84ec('0x6')][_0x84ec('0x7')]||'';this[_0x84ec('0x1f')]=moment()[_0x84ec('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x84ec('0x21')]=_0x234f24['callback'];this[_0x84ec('0x22')]=_0x234f24[_0x84ec('0x22')];this[_0x84ec('0x23')]=_0x234f24[_0x84ec('0x23')];this[_0x84ec('0x24')]=_0x234f24[_0x84ec('0x24')];this[_0x84ec('0x25')]='';this[_0x84ec('0x26')]='';}Action['prototype'][_0x84ec('0x27')]=function(){return util[_0x84ec('0x20')]('\x22%s\x22\x20<%s>',this['name'],this[_0x84ec('0x28')][_0x84ec('0x29')]>0x0?this[_0x84ec('0x9')][_0x84ec('0x2a')](this['voiceQueue'][_0x84ec('0x29')]):this['number']);};Action[_0x84ec('0x2b')][_0x84ec('0x2c')]=function(){return this[_0x84ec('0xb')];};module[_0x84ec('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 7852e3b..2148422 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 _0x2367=['moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x2367,0xb3));var _0x7236=function(_0x29e701,_0x3c5a8e){_0x29e701=_0x29e701-0x0;var _0x22c164=_0x2367[_0x29e701];return _0x22c164;};'use strict';var util=require('util');var _=require(_0x7236('0x0'));var moment=require(_0x7236('0x1'));function getSeconds(_0x18b14c,_0x5ac973){var _0x24fb2e=moment(_0x18b14c)[_0x7236('0x2')](0x0);var _0x39361f=moment(_0x5ac973)[_0x7236('0x2')](0x0);return _0x24fb2e[_0x7236('0x3')](_0x39361f,_0x7236('0x4'));}function AgentComplete(_0x468450,_0x13d301){this['state']=0x4;this[_0x7236('0x5')]=_0x7236('0x6');this['scheduledat']=_0x468450[_0x7236('0x7')];this[_0x7236('0x8')]=_0x468450[_0x7236('0x8')];this[_0x7236('0x9')]=_0x468450[_0x7236('0x8')]==='outbound'?_0x7236('0xa'):_0x468450['type'];this['countbusyretry']=_0x468450['countbusyretry'];this[_0x7236('0xb')]=_0x468450[_0x7236('0xb')];this[_0x7236('0xc')]=_0x468450[_0x7236('0xc')];this[_0x7236('0xd')]=_0x468450[_0x7236('0xe')]+_0x468450['countcongestionretry']+_0x468450[_0x7236('0xc')]+_0x468450[_0x7236('0xf')]+_0x468450[_0x7236('0x10')]+_0x468450[_0x7236('0x11')]+_0x468450[_0x7236('0x12')]+_0x468450[_0x7236('0x13')];this[_0x7236('0xf')]=_0x468450[_0x7236('0xf')];this[_0x7236('0x10')]=_0x468450[_0x7236('0x10')];this[_0x7236('0x11')]=_0x468450[_0x7236('0x11')];this['countmachineretry']=_0x468450[_0x7236('0x12')];this[_0x7236('0x13')]=_0x468450['countagentrejectretry'];this['uniqueid']=_0x13d301['uniqueid'];this[_0x7236('0x14')]=_0x468450[_0x7236('0x15')];this[_0x7236('0x16')]=_0x468450[_0x7236('0x17')];this[_0x7236('0x18')]=_0x468450[_0x7236('0x18')];this[_0x7236('0x19')]=_0x468450[_0x7236('0x19')];this[_0x7236('0x1a')]=_0x468450[_0x7236('0x1a')];this[_0x7236('0x1b')]=moment()['format'](_0x7236('0x1c'));this[_0x7236('0x1d')]=getSeconds(_0x468450[_0x7236('0x19')],_0x468450[_0x7236('0x18')]);this[_0x7236('0x1e')]=getSeconds(_0x468450['answertime'],_0x468450['responsetime']);this[_0x7236('0x1f')]=getSeconds(this[_0x7236('0x1b')],_0x468450['answertime']);this[_0x7236('0xa')]=_0x13d301['queue'];this[_0x7236('0x20')]=_0x13d301[_0x7236('0x20')];this[_0x7236('0x21')]=_0x13d301[_0x7236('0x21')];this[_0x7236('0x22')]=_0x468450[_0x7236('0x22')];this[_0x7236('0x23')]=_0x468450['callbackuniqueid'];this[_0x7236('0x24')]=_0x468450[_0x7236('0x24')];this[_0x7236('0x25')]=_0x468450[_0x7236('0x25')];this['ContactId']=_0x468450[_0x7236('0x26')];this[_0x7236('0x27')]=_0x468450['ListId'];this[_0x7236('0x28')]=_0x468450['UserId'];this[_0x7236('0x29')]=_0x468450[_0x7236('0x29')];this['CampaignId']=_0x468450['CampaignId'];this[_0x7236('0x2a')]=_0x468450[_0x7236('0x2a')]||'';this[_0x7236('0x2b')]=_0x468450[_0x7236('0x2b')]||'';}module[_0x7236('0x2c')]=AgentComplete; \ No newline at end of file +var _0xc87e=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x55e189,_0x5b53da){var _0x5db261=function(_0x3ea7f0){while(--_0x3ea7f0){_0x55e189['push'](_0x55e189['shift']());}};_0x5db261(++_0x5b53da);}(_0xc87e,0x117));var _0xec87=function(_0x4d7fac,_0x5e4e65){_0x4d7fac=_0x4d7fac-0x0;var _0xf81629=_0xc87e[_0x4d7fac];return _0xf81629;};'use strict';var util=require(_0xec87('0x0'));var _=require(_0xec87('0x1'));var moment=require(_0xec87('0x2'));function getSeconds(_0x3e161b,_0x210c1b){var _0x5386bf=moment(_0x3e161b)['milliseconds'](0x0);var _0x2eb210=moment(_0x210c1b)['milliseconds'](0x0);return _0x5386bf[_0xec87('0x3')](_0x2eb210,_0xec87('0x4'));}function AgentComplete(_0xa03ecf,_0x59a009){this[_0xec87('0x5')]=0x4;this[_0xec87('0x6')]='Answer';this[_0xec87('0x7')]=_0xa03ecf[_0xec87('0x7')];this[_0xec87('0x8')]=_0xa03ecf[_0xec87('0x8')];this[_0xec87('0x9')]=_0xa03ecf[_0xec87('0x8')]===_0xec87('0xa')?_0xec87('0xb'):_0xa03ecf[_0xec87('0x8')];this[_0xec87('0xc')]=_0xa03ecf['countbusyretry'];this['countcongestionretry']=_0xa03ecf[_0xec87('0xd')];this[_0xec87('0xe')]=_0xa03ecf['countnoanswerretry'];this['countglobal']=_0xa03ecf['countbusyretry']+_0xa03ecf[_0xec87('0xd')]+_0xa03ecf[_0xec87('0xe')]+_0xa03ecf[_0xec87('0xf')]+_0xa03ecf['countdropretry']+_0xa03ecf[_0xec87('0x10')]+_0xa03ecf[_0xec87('0x11')]+_0xa03ecf[_0xec87('0x12')];this['countnosuchnumberretry']=_0xa03ecf[_0xec87('0xf')];this[_0xec87('0x13')]=_0xa03ecf[_0xec87('0x13')];this[_0xec87('0x10')]=_0xa03ecf[_0xec87('0x10')];this['countmachineretry']=_0xa03ecf[_0xec87('0x11')];this['countagentrejectretry']=_0xa03ecf[_0xec87('0x12')];this['uniqueid']=_0x59a009['uniqueid'];this['calleridname']=_0xa03ecf[_0xec87('0x14')];this['calleridnum']=_0xa03ecf[_0xec87('0x15')];this[_0xec87('0x16')]=_0xa03ecf[_0xec87('0x16')];this[_0xec87('0x17')]=_0xa03ecf[_0xec87('0x17')];this[_0xec87('0x18')]=_0xa03ecf[_0xec87('0x18')];this[_0xec87('0x19')]=moment()[_0xec87('0x1a')](_0xec87('0x1b'));this[_0xec87('0x1c')]=getSeconds(_0xa03ecf[_0xec87('0x17')],_0xa03ecf[_0xec87('0x16')]);this[_0xec87('0x1d')]=getSeconds(_0xa03ecf['answertime'],_0xa03ecf[_0xec87('0x17')]);this[_0xec87('0x1e')]=getSeconds(this[_0xec87('0x19')],_0xa03ecf[_0xec87('0x18')]);this[_0xec87('0xb')]=_0x59a009[_0xec87('0xb')];this[_0xec87('0x1f')]=_0x59a009[_0xec87('0x1f')];this['reason']=_0x59a009[_0xec87('0x20')];this['callback']=_0xa03ecf[_0xec87('0x21')];this[_0xec87('0x22')]=_0xa03ecf[_0xec87('0x22')];this[_0xec87('0x23')]=_0xa03ecf[_0xec87('0x23')];this['recallme']=_0xa03ecf[_0xec87('0x24')];this[_0xec87('0x25')]=_0xa03ecf[_0xec87('0x25')];this[_0xec87('0x26')]=_0xa03ecf[_0xec87('0x26')];this[_0xec87('0x27')]=_0xa03ecf[_0xec87('0x27')];this[_0xec87('0x28')]=_0xa03ecf[_0xec87('0x28')];this[_0xec87('0x29')]=_0xa03ecf[_0xec87('0x29')];this[_0xec87('0x2a')]=_0xa03ecf[_0xec87('0x2a')]||'';this[_0xec87('0x2b')]=_0xa03ecf[_0xec87('0x2b')]||'';}module[_0xec87('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 7900cf5..804680d 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 _0xa990=['starttime','endtime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridnum'];(function(_0x365ca7,_0x48dc76){var _0x882916=function(_0x20451c){while(--_0x20451c){_0x365ca7['push'](_0x365ca7['shift']());}};_0x882916(++_0x48dc76);}(_0xa990,0xc9));var _0x0a99=function(_0x4e3b4a,_0x12c4b5){_0x4e3b4a=_0x4e3b4a-0x0;var _0x1190b9=_0xa990[_0x4e3b4a];return _0x1190b9;};'use strict';var util=require(_0x0a99('0x0'));var _=require(_0x0a99('0x1'));var moment=require(_0x0a99('0x2'));function getSeconds(_0x1270a9,_0x8c0f6){var _0x3d0232=moment(_0x1270a9)[_0x0a99('0x3')](0x0);var _0x394f1c=moment(_0x8c0f6)['milliseconds'](0x0);return _0x3d0232['diff'](_0x394f1c,_0x0a99('0x4'));}function Final(_0x3ed6d0){this[_0x0a99('0x5')]=_0x3ed6d0[_0x0a99('0x5')];this[_0x0a99('0x6')]=_0x3ed6d0[_0x0a99('0x6')];this[_0x0a99('0x7')]=_0x3ed6d0[_0x0a99('0x7')];this[_0x0a99('0x8')]=_0x3ed6d0[_0x0a99('0x7')]===_0x0a99('0x9')?'queue':_0x3ed6d0[_0x0a99('0x7')];this[_0x0a99('0xa')]=_0x3ed6d0['countbusyretry'];this['countcongestionretry']=_0x3ed6d0[_0x0a99('0xb')];this[_0x0a99('0xc')]=_0x3ed6d0[_0x0a99('0xc')];this[_0x0a99('0xd')]=_0x3ed6d0[_0x0a99('0xa')]+_0x3ed6d0['countcongestionretry']+_0x3ed6d0[_0x0a99('0xc')]+_0x3ed6d0[_0x0a99('0xe')]+_0x3ed6d0['countdropretry']+_0x3ed6d0[_0x0a99('0xf')]+_0x3ed6d0[_0x0a99('0x10')]+_0x3ed6d0[_0x0a99('0x11')];this[_0x0a99('0xe')]=_0x3ed6d0[_0x0a99('0xe')];this[_0x0a99('0x12')]=_0x3ed6d0[_0x0a99('0x12')];this[_0x0a99('0xf')]=_0x3ed6d0['countabandonedretry'];this['countmachineretry']=_0x3ed6d0[_0x0a99('0x10')];this[_0x0a99('0x11')]=_0x3ed6d0[_0x0a99('0x11')];this['queue']=_0x3ed6d0[_0x0a99('0x13')];this['calleridname']=_0x3ed6d0['calleridname'];this[_0x0a99('0x14')]=_0x3ed6d0[_0x0a99('0x14')];this[_0x0a99('0x15')]=_0x3ed6d0[_0x0a99('0x15')];this['responsetime']=_0x3ed6d0['responsetime'];this[_0x0a99('0x16')]=_0x3ed6d0[_0x0a99('0x17')];this[_0x0a99('0x18')]=_0x3ed6d0[_0x0a99('0x18')]||0x0;this['holdtime']=_0x3ed6d0['holdtime']||0x0;this[_0x0a99('0x19')]=_0x3ed6d0['talktime']||0x0;this[_0x0a99('0x1a')]=_0x3ed6d0['callback'];this[_0x0a99('0x1b')]=_0x3ed6d0['callbackuniqueid'];this[_0x0a99('0x1c')]=_0x3ed6d0[_0x0a99('0x1c')];this[_0x0a99('0x1d')]=_0x3ed6d0[_0x0a99('0x1d')];this[_0x0a99('0x1e')]=_0x3ed6d0[_0x0a99('0x1e')];this[_0x0a99('0x1f')]=_0x3ed6d0[_0x0a99('0x1f')];this[_0x0a99('0x20')]=_0x3ed6d0['UserId'];this['VoiceQueueId']=_0x3ed6d0[_0x0a99('0x21')];this[_0x0a99('0x22')]=_0x3ed6d0[_0x0a99('0x22')];this['originatecalleridnum']=_0x3ed6d0['originatecalleridnum']||'';this[_0x0a99('0x23')]=_0x3ed6d0[_0x0a99('0x23')]||'';}module[_0x0a99('0x24')]=Final; \ No newline at end of file +var _0xd67b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x5e17b5,_0x67cc67){var _0x51fef1=function(_0x2cebde){while(--_0x2cebde){_0x5e17b5['push'](_0x5e17b5['shift']());}};_0x51fef1(++_0x67cc67);}(_0xd67b,0x133));var _0xbd67=function(_0x306628,_0x2701a3){_0x306628=_0x306628-0x0;var _0x409342=_0xd67b[_0x306628];return _0x409342;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var moment=require('moment');function getSeconds(_0x1da24d,_0x280954){var _0x317e33=moment(_0x1da24d)['milliseconds'](0x0);var _0x40e384=moment(_0x280954)['milliseconds'](0x0);return _0x317e33[_0xbd67('0x1')](_0x40e384,'seconds');}function Final(_0x309962){this[_0xbd67('0x2')]=_0x309962[_0xbd67('0x2')];this[_0xbd67('0x3')]=_0x309962[_0xbd67('0x3')];this[_0xbd67('0x4')]=_0x309962[_0xbd67('0x4')];this[_0xbd67('0x5')]=_0x309962[_0xbd67('0x4')]===_0xbd67('0x6')?_0xbd67('0x7'):_0x309962[_0xbd67('0x4')];this[_0xbd67('0x8')]=_0x309962['countbusyretry'];this['countcongestionretry']=_0x309962[_0xbd67('0x9')];this['countnoanswerretry']=_0x309962[_0xbd67('0xa')];this[_0xbd67('0xb')]=_0x309962[_0xbd67('0x8')]+_0x309962[_0xbd67('0x9')]+_0x309962[_0xbd67('0xa')]+_0x309962[_0xbd67('0xc')]+_0x309962[_0xbd67('0xd')]+_0x309962[_0xbd67('0xe')]+_0x309962[_0xbd67('0xf')]+_0x309962[_0xbd67('0x10')];this['countnosuchnumberretry']=_0x309962[_0xbd67('0xc')];this[_0xbd67('0xd')]=_0x309962[_0xbd67('0xd')];this[_0xbd67('0xe')]=_0x309962[_0xbd67('0xe')];this[_0xbd67('0xf')]=_0x309962[_0xbd67('0xf')];this[_0xbd67('0x10')]=_0x309962[_0xbd67('0x10')];this[_0xbd67('0x7')]=_0x309962['queue'];this['calleridname']=_0x309962[_0xbd67('0x11')];this[_0xbd67('0x12')]=_0x309962[_0xbd67('0x12')];this['starttime']=_0x309962[_0xbd67('0x13')];this[_0xbd67('0x14')]=_0x309962[_0xbd67('0x14')];this['endtime']=_0x309962[_0xbd67('0x14')];this['ringtime']=_0x309962[_0xbd67('0x15')]||0x0;this[_0xbd67('0x16')]=_0x309962[_0xbd67('0x16')]||0x0;this['talktime']=_0x309962[_0xbd67('0x17')]||0x0;this[_0xbd67('0x18')]=_0x309962[_0xbd67('0x18')];this[_0xbd67('0x19')]=_0x309962[_0xbd67('0x19')];this[_0xbd67('0x1a')]=_0x309962['callbackat'];this[_0xbd67('0x1b')]=_0x309962[_0xbd67('0x1b')];this[_0xbd67('0x1c')]=_0x309962[_0xbd67('0x1c')];this[_0xbd67('0x1d')]=_0x309962[_0xbd67('0x1d')];this[_0xbd67('0x1e')]=_0x309962[_0xbd67('0x1e')];this[_0xbd67('0x1f')]=_0x309962[_0xbd67('0x1f')];this[_0xbd67('0x20')]=_0x309962['CampaignId'];this[_0xbd67('0x21')]=_0x309962['originatecalleridnum']||'';this[_0xbd67('0x22')]=_0x309962[_0xbd67('0x22')]||'';}module[_0xbd67('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8883060..7b6a7e0 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 _0x7487=['VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x17772e,_0x3d4d93){var _0x21e766=function(_0x474f74){while(--_0x474f74){_0x17772e['push'](_0x17772e['shift']());}};_0x21e766(++_0x3d4d93);}(_0x7487,0x14c));var _0x7748=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x7487[_0x42c118];return _0x112ebd;};'use strict';var util=require(_0x7748('0x0'));var _=require(_0x7748('0x1'));var moment=require(_0x7748('0x2'));function getSeconds(_0x562d6c,_0x35ece4){var _0x384a79=moment(_0x562d6c)['milliseconds'](0x0);var _0x218291=moment(_0x35ece4)[_0x7748('0x3')](0x0);return _0x384a79[_0x7748('0x4')](_0x218291,_0x7748('0x5'));}function Hangup(_0xe7a48d,_0x590ee0){this[_0x7748('0x6')]=0x4;this[_0x7748('0x7')]=_0x7748('0x8');this['scheduledat']=_0xe7a48d['scheduledat'];this[_0x7748('0x9')]=_0xe7a48d[_0x7748('0x9')];this[_0x7748('0xa')]=_0xe7a48d[_0x7748('0x9')]===_0x7748('0xb')?_0x7748('0xc'):_0xe7a48d[_0x7748('0x9')];this[_0x7748('0xd')]=_0xe7a48d['countbusyretry'];this[_0x7748('0xe')]=_0xe7a48d['countcongestionretry'];this['countnoanswerretry']=_0xe7a48d[_0x7748('0xf')];this[_0x7748('0x10')]=_0xe7a48d[_0x7748('0xd')]+_0xe7a48d[_0x7748('0xe')]+_0xe7a48d[_0x7748('0xf')]+_0xe7a48d['countnosuchnumberretry']+_0xe7a48d[_0x7748('0x11')]+_0xe7a48d[_0x7748('0x12')]+_0xe7a48d[_0x7748('0x13')]+_0xe7a48d['countagentrejectretry'];this['countnosuchnumberretry']=_0xe7a48d[_0x7748('0x14')];this['countdropretry']=_0xe7a48d['countdropretry'];this[_0x7748('0x12')]=_0xe7a48d[_0x7748('0x12')];this[_0x7748('0x13')]=_0xe7a48d[_0x7748('0x13')];this[_0x7748('0x15')]=_0xe7a48d[_0x7748('0x15')];this[_0x7748('0x16')]=_0x590ee0[_0x7748('0x16')];this[_0x7748('0x17')]=_0xe7a48d[_0x7748('0x18')];this[_0x7748('0x19')]=_0xe7a48d[_0x7748('0x1a')];this['starttime']=_0xe7a48d[_0x7748('0x1b')];this[_0x7748('0x1c')]=_0xe7a48d['responsetime'];this[_0x7748('0x1d')]=moment()[_0x7748('0x1e')](_0x7748('0x1f'));this[_0x7748('0x20')]=getSeconds(_0xe7a48d['responsetime'],_0xe7a48d['starttime']);this[_0x7748('0x21')]=0x0;this[_0x7748('0x22')]=getSeconds(this['endtime'],_0xe7a48d[_0x7748('0x1c')]);this[_0x7748('0xc')]=_0xe7a48d[_0x7748('0xc')];this[_0x7748('0x23')]=_0x7748('0x24');this['reason']=_0x590ee0['cause-txt'];this['callback']=_0xe7a48d[_0x7748('0x25')];this['callbackuniqueid']=_0xe7a48d[_0x7748('0x26')];this['callbackat']=_0xe7a48d[_0x7748('0x27')];this[_0x7748('0x28')]=_0xe7a48d[_0x7748('0x28')];this['ContactId']=_0xe7a48d[_0x7748('0x29')];this[_0x7748('0x2a')]=_0xe7a48d[_0x7748('0x2a')];this[_0x7748('0x2b')]=_0xe7a48d[_0x7748('0x2b')];this[_0x7748('0x2c')]=_0xe7a48d[_0x7748('0x2c')];this[_0x7748('0x2d')]=_0xe7a48d[_0x7748('0x2d')];}module[_0x7748('0x2e')]=Hangup; \ No newline at end of file +var _0x0992=['milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment'];(function(_0x595b9b,_0xa58ff){var _0x3be4c6=function(_0x324f94){while(--_0x324f94){_0x595b9b['push'](_0x595b9b['shift']());}};_0x3be4c6(++_0xa58ff);}(_0x0992,0x10c));var _0x2099=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0x0992[_0xf6e75d];return _0x27514d;};'use strict';var util=require('util');var _=require(_0x2099('0x0'));var moment=require(_0x2099('0x1'));function getSeconds(_0x16e67a,_0x2a50db){var _0x506f9d=moment(_0x16e67a)[_0x2099('0x2')](0x0);var _0x594bff=moment(_0x2a50db)['milliseconds'](0x0);return _0x506f9d[_0x2099('0x3')](_0x594bff,_0x2099('0x4'));}function Hangup(_0x5e26c6,_0x169d64){this['state']=0x4;this[_0x2099('0x5')]=_0x2099('0x6');this['scheduledat']=_0x5e26c6[_0x2099('0x7')];this[_0x2099('0x8')]=_0x5e26c6[_0x2099('0x8')];this[_0x2099('0x9')]=_0x5e26c6['type']===_0x2099('0xa')?_0x2099('0xb'):_0x5e26c6[_0x2099('0x8')];this[_0x2099('0xc')]=_0x5e26c6[_0x2099('0xc')];this[_0x2099('0xd')]=_0x5e26c6[_0x2099('0xd')];this['countnoanswerretry']=_0x5e26c6['countnoanswerretry'];this[_0x2099('0xe')]=_0x5e26c6[_0x2099('0xc')]+_0x5e26c6[_0x2099('0xd')]+_0x5e26c6[_0x2099('0xf')]+_0x5e26c6[_0x2099('0x10')]+_0x5e26c6['countdropretry']+_0x5e26c6[_0x2099('0x11')]+_0x5e26c6['countmachineretry']+_0x5e26c6[_0x2099('0x12')];this[_0x2099('0x10')]=_0x5e26c6[_0x2099('0x10')];this['countdropretry']=_0x5e26c6[_0x2099('0x13')];this[_0x2099('0x11')]=_0x5e26c6['countabandonedretry'];this[_0x2099('0x14')]=_0x5e26c6[_0x2099('0x14')];this[_0x2099('0x12')]=_0x5e26c6[_0x2099('0x12')];this[_0x2099('0x15')]=_0x169d64['uniqueid'];this[_0x2099('0x16')]=_0x5e26c6[_0x2099('0x17')];this[_0x2099('0x18')]=_0x5e26c6[_0x2099('0x19')];this[_0x2099('0x1a')]=_0x5e26c6[_0x2099('0x1a')];this[_0x2099('0x1b')]=_0x5e26c6[_0x2099('0x1b')];this[_0x2099('0x1c')]=moment()[_0x2099('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x5e26c6[_0x2099('0x1b')],_0x5e26c6['starttime']);this[_0x2099('0x1e')]=0x0;this[_0x2099('0x1f')]=getSeconds(this[_0x2099('0x1c')],_0x5e26c6[_0x2099('0x1b')]);this['queue']=_0x5e26c6[_0x2099('0xb')];this[_0x2099('0x20')]=_0x2099('0x21');this[_0x2099('0x22')]=_0x169d64[_0x2099('0x23')];this[_0x2099('0x24')]=_0x5e26c6[_0x2099('0x24')];this['callbackuniqueid']=_0x5e26c6['callbackuniqueid'];this[_0x2099('0x25')]=_0x5e26c6[_0x2099('0x25')];this[_0x2099('0x26')]=_0x5e26c6[_0x2099('0x26')];this[_0x2099('0x27')]=_0x5e26c6[_0x2099('0x27')];this[_0x2099('0x28')]=_0x5e26c6[_0x2099('0x28')];this[_0x2099('0x29')]=_0x5e26c6[_0x2099('0x29')];this[_0x2099('0x2a')]=_0x5e26c6[_0x2099('0x2a')];this[_0x2099('0x2b')]=_0x5e26c6[_0x2099('0x2b')];}module[_0x2099('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 336ef53..221d763 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 _0x911a=['exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x1c1bd,_0x1c6b84){var _0x38ae2f=function(_0x7dcf4a){while(--_0x7dcf4a){_0x1c1bd['push'](_0x1c1bd['shift']());}};_0x38ae2f(++_0x1c6b84);}(_0x911a,0xba));var _0xa911=function(_0x58dd10,_0xbcfbdb){_0x58dd10=_0x58dd10-0x0;var _0x2cbc51=_0x911a[_0x58dd10];return _0x2cbc51;};'use strict';var util=require('util');var _=require(_0xa911('0x0'));var moment=require(_0xa911('0x1'));function getSeconds(_0x4d33b0,_0x1ac851){var _0x329786=moment(_0x4d33b0)[_0xa911('0x2')](0x0);var _0x59ef96=moment(_0x1ac851)[_0xa911('0x2')](0x0);return _0x329786[_0xa911('0x3')](_0x59ef96,_0xa911('0x4'));}function History(_0x2dbbe4){this[_0xa911('0x5')]=_0x2dbbe4['uniqueid'];this[_0xa911('0x6')]=_0x2dbbe4['scheduledat']||undefined;this[_0xa911('0x7')]=_0x2dbbe4[_0xa911('0x7')];this[_0xa911('0x8')]=_0x2dbbe4['type']==='outbound'?_0xa911('0x9'):_0x2dbbe4[_0xa911('0x7')];this[_0xa911('0xa')]=_0x2dbbe4[_0xa911('0xa')];this[_0xa911('0xb')]=_0x2dbbe4[_0xa911('0xb')];this['countnoanswerretry']=_0x2dbbe4[_0xa911('0xc')];this['countglobal']=_0x2dbbe4[_0xa911('0xa')]+_0x2dbbe4['countcongestionretry']+_0x2dbbe4[_0xa911('0xc')]+_0x2dbbe4[_0xa911('0xd')]+_0x2dbbe4[_0xa911('0xe')]+_0x2dbbe4[_0xa911('0xf')]+_0x2dbbe4[_0xa911('0x10')]+_0x2dbbe4[_0xa911('0x11')];this['countnosuchnumberretry']=_0x2dbbe4['countnosuchnumberretry'];this[_0xa911('0xe')]=_0x2dbbe4[_0xa911('0xe')];this[_0xa911('0xf')]=_0x2dbbe4[_0xa911('0xf')];this[_0xa911('0x10')]=_0x2dbbe4['countmachineretry'];this[_0xa911('0x11')]=_0x2dbbe4[_0xa911('0x11')];this[_0xa911('0x9')]=_0x2dbbe4[_0xa911('0x9')];this[_0xa911('0x12')]=_0x2dbbe4[_0xa911('0x13')];this[_0xa911('0x14')]=_0x2dbbe4['number'];this['starttime']=_0x2dbbe4[_0xa911('0x15')];this[_0xa911('0x16')]=_0x2dbbe4[_0xa911('0x16')];this['endtime']=_0x2dbbe4[_0xa911('0x16')];this[_0xa911('0x17')]=getSeconds(_0x2dbbe4[_0xa911('0x16')],_0x2dbbe4[_0xa911('0x15')]);this[_0xa911('0x18')]=0x0;this['talktime']=0x0;this['callback']=_0x2dbbe4[_0xa911('0x19')];this['callbackuniqueid']=_0x2dbbe4[_0xa911('0x1a')];this[_0xa911('0x1b')]=_0x2dbbe4['callbackat'];this[_0xa911('0x1c')]=_0x2dbbe4[_0xa911('0x1c')];this[_0xa911('0x1d')]=_0x2dbbe4[_0xa911('0x1d')];this[_0xa911('0x1e')]=_0x2dbbe4[_0xa911('0x1e')];this['UserId']=_0x2dbbe4[_0xa911('0x1f')];this[_0xa911('0x20')]=_0x2dbbe4[_0xa911('0x20')];this[_0xa911('0x21')]=_0x2dbbe4[_0xa911('0x21')];this[_0xa911('0x22')]=_0x2dbbe4[_0xa911('0x22')]||'';this['originatecalleridname']=_0x2dbbe4[_0xa911('0x23')]||'';}module[_0xa911('0x24')]=History; \ No newline at end of file +var _0xac63=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x2b4f2e,_0x1b1604){var _0x36eec0=function(_0x76f112){while(--_0x76f112){_0x2b4f2e['push'](_0x2b4f2e['shift']());}};_0x36eec0(++_0x1b1604);}(_0xac63,0x122));var _0x3ac6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xac63[_0x33032e];return _0x13316b;};'use strict';var util=require('util');var _=require(_0x3ac6('0x0'));var moment=require(_0x3ac6('0x1'));function getSeconds(_0x2d374f,_0x725895){var _0xe5b24c=moment(_0x2d374f)[_0x3ac6('0x2')](0x0);var _0x3b568e=moment(_0x725895)[_0x3ac6('0x2')](0x0);return _0xe5b24c['diff'](_0x3b568e,_0x3ac6('0x3'));}function History(_0x11f598){this[_0x3ac6('0x4')]=_0x11f598[_0x3ac6('0x4')];this['scheduledat']=_0x11f598[_0x3ac6('0x5')]||undefined;this['type']=_0x11f598['type'];this[_0x3ac6('0x6')]=_0x11f598[_0x3ac6('0x7')]===_0x3ac6('0x8')?_0x3ac6('0x9'):_0x11f598[_0x3ac6('0x7')];this[_0x3ac6('0xa')]=_0x11f598['countbusyretry'];this[_0x3ac6('0xb')]=_0x11f598['countcongestionretry'];this[_0x3ac6('0xc')]=_0x11f598[_0x3ac6('0xc')];this['countglobal']=_0x11f598[_0x3ac6('0xa')]+_0x11f598[_0x3ac6('0xb')]+_0x11f598[_0x3ac6('0xc')]+_0x11f598[_0x3ac6('0xd')]+_0x11f598[_0x3ac6('0xe')]+_0x11f598[_0x3ac6('0xf')]+_0x11f598[_0x3ac6('0x10')]+_0x11f598[_0x3ac6('0x11')];this['countnosuchnumberretry']=_0x11f598[_0x3ac6('0xd')];this[_0x3ac6('0xe')]=_0x11f598[_0x3ac6('0xe')];this[_0x3ac6('0xf')]=_0x11f598[_0x3ac6('0xf')];this['countmachineretry']=_0x11f598[_0x3ac6('0x10')];this[_0x3ac6('0x11')]=_0x11f598[_0x3ac6('0x11')];this['queue']=_0x11f598[_0x3ac6('0x9')];this[_0x3ac6('0x12')]=_0x11f598[_0x3ac6('0x13')];this[_0x3ac6('0x14')]=_0x11f598[_0x3ac6('0x15')];this[_0x3ac6('0x16')]=_0x11f598[_0x3ac6('0x16')];this[_0x3ac6('0x17')]=_0x11f598['responsetime'];this['endtime']=_0x11f598[_0x3ac6('0x17')];this['ringtime']=getSeconds(_0x11f598[_0x3ac6('0x17')],_0x11f598[_0x3ac6('0x16')]);this[_0x3ac6('0x18')]=0x0;this[_0x3ac6('0x19')]=0x0;this[_0x3ac6('0x1a')]=_0x11f598[_0x3ac6('0x1a')];this[_0x3ac6('0x1b')]=_0x11f598[_0x3ac6('0x1b')];this[_0x3ac6('0x1c')]=_0x11f598['callbackat'];this[_0x3ac6('0x1d')]=_0x11f598[_0x3ac6('0x1d')];this[_0x3ac6('0x1e')]=_0x11f598[_0x3ac6('0x1e')];this[_0x3ac6('0x1f')]=_0x11f598[_0x3ac6('0x1f')];this[_0x3ac6('0x20')]=_0x11f598[_0x3ac6('0x20')];this[_0x3ac6('0x21')]=_0x11f598[_0x3ac6('0x21')];this[_0x3ac6('0x22')]=_0x11f598['CampaignId'];this['originatecalleridnum']=_0x11f598[_0x3ac6('0x23')]||'';this[_0x3ac6('0x24')]=_0x11f598[_0x3ac6('0x24')]||'';}module[_0x3ac6('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 73fa424..ffd4d6c 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 _0x6f0d=['Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr]','Machine','countnoanswerretry','countdropretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','dialQueueProject2','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','stateinterface','queueBooked','push','merge','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','paused','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','syncQueueSummary','dialMethod','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\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]','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Error','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','stringify','md5','format','voice:queue:%s','type','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\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\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','seconds','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','isNil'];(function(_0x2488a2,_0x50f57a){var _0x58e303=function(_0x46ddf1){while(--_0x46ddf1){_0x2488a2['push'](_0x2488a2['shift']());}};_0x58e303(++_0x50f57a);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x56a429,_0x5b3432){_0x56a429=_0x56a429-0x0;var _0x541a2f=_0x6f0d[_0x56a429];return _0x541a2f;};'use strict';var util=require('util');var _=require(_0xd6f0('0x0'));var BPromise=require(_0xd6f0('0x1'));var uuid=require(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xd6f0('0x4'));var ut=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var logger=require(_0xd6f0('0x7'))(_0xd6f0('0x8'));var loggerBooked=require('../../../config/logger')(_0xd6f0('0x9'));var loggerPredictive=require('../../../config/logger')(_0xd6f0('0xa'));var loggerPredictiveCalls=require(_0xd6f0('0x7'))(_0xd6f0('0xb'));var loggerSyncQueueSummary=require(_0xd6f0('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0xd6f0('0xc')]=_[_0xd6f0('0xd')](config[_0xd6f0('0xc')],{'host':_0xd6f0('0xe'),'port':0x18eb});var io=require(_0xd6f0('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xd6f0('0x10'));var cmHopperHistory=require(_0xd6f0('0x11'));var cmHopperBlack=require(_0xd6f0('0x12'));var voiceQueueRt=require(_0xd6f0('0x13'));var Action=require('./action');var History=require(_0xd6f0('0x14'));var Final=require(_0xd6f0('0x15'));var AgentComplete=require(_0xd6f0('0x16'));var QueueCallerAbandon=require(_0xd6f0('0x17'));var Hangup=require(_0xd6f0('0x18'));var ipAgi=process[_0xd6f0('0x19')][_0xd6f0('0x1a')]||_0xd6f0('0x1b');var strategy={'rrmemory':_0xd6f0('0x1c'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xd6f0('0x1d')][_0xd6f0('0x1e')]=function(_0x4c1559){this[_0xd6f0('0x1f')]=this['tail']?this[_0xd6f0('0x1f')][_0xd6f0('0x20')](_0x4c1559):_0x4c1559();};function Dialer(_0x41bd99,_0x472156){this[_0xd6f0('0x21')]=new Sequence();this[_0xd6f0('0x22')]=_0x472156;this[_0xd6f0('0x23')]=_0x41bd99[_0xd6f0('0x23')];this[_0xd6f0('0x24')]=_0x41bd99[_0xd6f0('0x24')];this[_0xd6f0('0x25')]=_0x41bd99[_0xd6f0('0x25')];this[_0xd6f0('0x26')]=_0x41bd99[_0xd6f0('0x26')];this[_0xd6f0('0x27')]=config[_0xd6f0('0x27')]||0x2;this['channels']={};this['actions']={};this[_0xd6f0('0x28')]={};this[_0xd6f0('0x29')]={};this[_0xd6f0('0x2a')]={};this['startPredictive']={};this[_0xd6f0('0x2b')]={};this[_0xd6f0('0x2c')]={};this['queueBooked']={};this[_0xd6f0('0x2d')]={};ami['on']('agentconnect',this[_0xd6f0('0x2e')][_0xd6f0('0x2f')](this));ami['on']('queuecallerabandon',this[_0xd6f0('0x30')][_0xd6f0('0x2f')](this));ami['on']('originateresponse',this[_0xd6f0('0x31')][_0xd6f0('0x2f')](this));ami['on'](_0xd6f0('0x32'),this['syncAgentComplete'][_0xd6f0('0x2f')](this));ami['on'](_0xd6f0('0x33'),this['syncQueueSummary'][_0xd6f0('0x2f')](this));ami['on']('hangup',this[_0xd6f0('0x34')][_0xd6f0('0x2f')](this));ami['on'](_0xd6f0('0x35'),this[_0xd6f0('0x36')][_0xd6f0('0x2f')](this));ami['on'](_0xd6f0('0x37'),this[_0xd6f0('0x38')][_0xd6f0('0x2f')](this));ami['on']('queuemember',this[_0xd6f0('0x39')][_0xd6f0('0x2f')](this));ami['on']('queuestatuscomplete',this[_0xd6f0('0x3a')][_0xd6f0('0x2f')](this));this[_0xd6f0('0x3b')]();this[_0xd6f0('0x3c')]();}function isNotNull(_0x1a3967){return _0x1a3967!==null&&!_[_0xd6f0('0x3d')](_0x1a3967);}function checkIsLoggedIn(_0x351fda,_0x3151f8){return function(){if(_0x3151f8<=0x0){_0x351fda[_0xd6f0('0x3e')]=_0xd6f0('0x3f');throw _0x351fda[_0xd6f0('0x40')]+_0xd6f0('0x41');}};}function isActive(_0x348529){return _0x348529;}function checkIsActive(_0xa863d9,_0xbdd223){return function(){if(!isActive(_0xbdd223)){_0xa863d9[_0xd6f0('0x3e')]=_0xd6f0('0x42');throw _0xa863d9[_0xd6f0('0x40')]+_0xd6f0('0x43');}};}function checkInterval(_0x180e5f){return function(){if(!isNotNull(_0x180e5f[_0xd6f0('0x44')])){_0x180e5f[_0xd6f0('0x3e')]='INTERVAL_IS_NULL';throw _0x180e5f[_0xd6f0('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x180e5f['Interval'][_0xd6f0('0x45')])){_0x180e5f[_0xd6f0('0x3e')]=_0xd6f0('0x46');throw _0x180e5f[_0xd6f0('0x40')]+_0xd6f0('0x47');}if(!isNotNull(_['isEmpty'](_0x180e5f[_0xd6f0('0x44')]['Intervals']))){_0x180e5f[_0xd6f0('0x3e')]=_0xd6f0('0x46');throw _0x180e5f[_0xd6f0('0x40')]+_0xd6f0('0x47');}};}function msgResponse(_0x518751,_0x5c3132,_0x47b33d){return{'action':_0x518751,'response':_0x5c3132,'message':_0x47b33d,'stack':_0x47b33d};}function myreject(_0x3b6463){return function(_0xe2958d){return _0x3b6463(msgResponse('[ifTime][Action]',_0xd6f0('0x48'),JSON['stringify'](_0xe2958d)));};}function getSeconds(_0x507f66,_0x2fd7b8){var _0x28659e=moment(_0x507f66)[_0xd6f0('0x49')](0x0);var _0x451834=moment(_0x2fd7b8)[_0xd6f0('0x49')](0x0);return _0x28659e[_0xd6f0('0x4a')](_0x451834,'seconds');}function emit(_0x52203d,_0x162537,_0xf879a6){io['to'](_0x52203d)[_0xd6f0('0x4b')](_0x162537,_0xf879a6);}function emitVoiceQueueSummary(_0x5c2d9a){if(_0x5c2d9a['type']===_0xd6f0('0x4c')){var _0x2def01={'id':_0x5c2d9a['id'],'name':_0x5c2d9a[_0xd6f0('0x40')],'strategy':_0x5c2d9a[_0xd6f0('0x4d')],'answered':_0x5c2d9a[_0xd6f0('0x4e')],'available':_0x5c2d9a[_0xd6f0('0x4f')],'loggedIn':_0x5c2d9a[_0xd6f0('0x50')],'pTalking':_0x5c2d9a[_0xd6f0('0x51')],'sumBillable':_0x5c2d9a['sumBillable'],'sumDuration':_0x5c2d9a[_0xd6f0('0x52')],'sumHoldTime':_0x5c2d9a[_0xd6f0('0x53')]||0x0,'talking':_0x5c2d9a[_0xd6f0('0x54')],'total':_0x5c2d9a[_0xd6f0('0x55')],'type':_0x5c2d9a['type'],'unmanaged':_0x5c2d9a[_0xd6f0('0x56')],'abandoned':_0x5c2d9a[_0xd6f0('0x57')],'waiting':_0x5c2d9a[_0xd6f0('0x58')],'loggedInDb':_0x5c2d9a[_0xd6f0('0x59')],'dialActive':_0x5c2d9a[_0xd6f0('0x5a')],'dialMethod':_0x5c2d9a['dialMethod'],'dialOriginateCallerIdName':_0x5c2d9a[_0xd6f0('0x5b')],'dialOriginateCallerIdNumber':_0x5c2d9a[_0xd6f0('0x5c')],'dialOriginateTimeout':_0x5c2d9a[_0xd6f0('0x5d')],'dialPrefix':_0x5c2d9a['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5c2d9a[_0xd6f0('0x5e')],'outboundAnswerCallsDay':_0x5c2d9a[_0xd6f0('0x5f')],'outboundBlacklistCallsDay':_0x5c2d9a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5c2d9a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5c2d9a[_0xd6f0('0x60')],'outboundDropCallsDayACS':_0x5c2d9a[_0xd6f0('0x61')],'outboundDropCallsDayCallersExit':_0x5c2d9a[_0xd6f0('0x62')],'outboundDropCallsDayTimeout':_0x5c2d9a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5c2d9a[_0xd6f0('0x63')],'outboundNoSuchCallsDay':_0x5c2d9a[_0xd6f0('0x64')],'outboundOriginateFailureCallsDay':_0x5c2d9a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5c2d9a[_0xd6f0('0x65')],'outboundRejectCallsDay':_0x5c2d9a[_0xd6f0('0x66')],'outboundUnknownCallsDay':_0x5c2d9a[_0xd6f0('0x67')],'predictiveIntervalAnsweredCalls':_0x5c2d9a[_0xd6f0('0x68')],'predictiveIntervalAvgHoldtime':_0x5c2d9a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5c2d9a[_0xd6f0('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x5c2d9a[_0xd6f0('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x5c2d9a[_0xd6f0('0x6b')],'predictiveIntervalErlangCalls':_0x5c2d9a[_0xd6f0('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x5c2d9a[_0xd6f0('0x6d')],'predictiveIntervalHitRate':_0x5c2d9a[_0xd6f0('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x5c2d9a[_0xd6f0('0x6f')],'predictiveIntervalPauses':_0x5c2d9a[_0xd6f0('0x70')],'predictiveIntervalAvailable':_0x5c2d9a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5c2d9a[_0xd6f0('0x71')],'message':_0x5c2d9a[_0xd6f0('0x3e')],'originated':_0x5c2d9a['originated'],'erlangCalls':_0x5c2d9a[_0xd6f0('0x72')],'erlangCallToSecond':_0x5c2d9a[_0xd6f0('0x73')],'erlangAbandonmentRate':_0x5c2d9a[_0xd6f0('0x74')],'erlangBusyFactor':_0x5c2d9a[_0xd6f0('0x75')],'startPredictive':_0x5c2d9a['startPredictive'],'startProgressive':_0x5c2d9a[_0xd6f0('0x2b')]};if(_0x5c2d9a[_0xd6f0('0x76')]){_0x2def01['Trunk']={'id':_0x5c2d9a['Trunk']['id'],'name':_0x5c2d9a[_0xd6f0('0x76')]['name'],'active':_0x5c2d9a[_0xd6f0('0x76')][_0xd6f0('0x77')],'callerid':_0x5c2d9a[_0xd6f0('0x76')]['callerid']};}if(_0x5c2d9a[_0xd6f0('0x44')]){_0x2def01[_0xd6f0('0x44')]={'id':_0x5c2d9a[_0xd6f0('0x44')]['id'],'name':_0x5c2d9a[_0xd6f0('0x44')][_0xd6f0('0x40')]};}var _0x4c42ce=md5(JSON[_0xd6f0('0x78')](_0x2def01));if(_0x5c2d9a['md5']!==_0x4c42ce){_0x5c2d9a[_0xd6f0('0x79')]=_0x4c42ce;emit(util[_0xd6f0('0x7a')](_0xd6f0('0x7b'),_0x2def01[_0xd6f0('0x40')]),'voice_queue:save',_0x2def01);}}}function emitCampaignSummary(_0x5ceb6b){if(_0x5ceb6b[_0xd6f0('0x7c')]===_0xd6f0('0x7d')){emit(util['format'](_0xd6f0('0x7e'),_0x5ceb6b['name']),_0xd6f0('0x7f'),_0x5ceb6b);}}function checkGetDataPredictive(_0x3cbbbd){if(isNotNull(_0x3cbbbd)&&!_[_0xd6f0('0x80')](_0x3cbbbd)){loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x82'));loggerPredictive['info'](_0xd6f0('0x83'),_0x3cbbbd[_0xd6f0('0x71')]);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x84'),_0x3cbbbd[_0xd6f0('0x68')]);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x85'),_0x3cbbbd[_0xd6f0('0x6b')]);loggerPredictive['info'](_0xd6f0('0x86'),_0x3cbbbd[_0xd6f0('0x6a')]);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x87'),_0x3cbbbd[_0xd6f0('0x88')]);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x89'),_0x3cbbbd[_0xd6f0('0x69')]);loggerPredictive[_0xd6f0('0x81')]('---------------------------');if(_0x3cbbbd[_0xd6f0('0x71')]>0x0){if(!_['isUndefined'](_0x3cbbbd['predictiveIntervalAvgTalktime'])&&_0x3cbbbd[_0xd6f0('0x69')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xd6f0('0x3d')](_0x3cbbbd[_0xd6f0('0x88')])&&_0x3cbbbd[_0xd6f0('0x88')]>0x0){return!![];}loggerPredictive['info'](_0xd6f0('0x8a'));}else{loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x8b'));}}else{loggerPredictive['info'](_0xd6f0('0x8c'));}return![];}function mergeDataErlangB(_0x357193){return function(_0x498ca5){loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x8d'));loggerPredictive['info'](_0xd6f0('0x8e'),_0x498ca5[_0xd6f0('0x72')]);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x8f'),_0x498ca5[_0xd6f0('0x73')]);loggerPredictive['info'](_0xd6f0('0x90'),_0x498ca5[_0xd6f0('0x74')]);loggerPredictive['info'](_0xd6f0('0x91'),_0x498ca5[_0xd6f0('0x75')]);loggerPredictive[_0xd6f0('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x498ca5[_0xd6f0('0x74')]);loggerPredictive['info']('---------------------------');_['merge'](_0x357193,_0x498ca5);};}function getDiff(_0x5c5aa4){var _0x311140=moment()[_0xd6f0('0x49')](0x0);var _0x1a8984=moment(_0x5c5aa4)[_0xd6f0('0x49')](0x0);return _0x311140['diff'](_0x1a8984,_0xd6f0('0x92'));}function ifInterval(_0x5a6ee0,_0x13c194){if(_[_0xd6f0('0x3d')](_0x13c194)){return![];}return getDiff(_0x13c194)<_0x5a6ee0*0x3c;}function freeVariablesPredictive(_0x2ba889){if(isNotNull(_0x2ba889)){if(!_['isUndefined'](_0x2ba889[_0xd6f0('0x2b')])){_0x2ba889[_0xd6f0('0x2b')]=undefined;loggerPredictive[_0xd6f0('0x81')](_0x2ba889[_0xd6f0('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xd6f0('0x3d')](_0x2ba889[_0xd6f0('0x93')])){_0x2ba889[_0xd6f0('0x93')]=undefined;loggerPredictive['info'](_0x2ba889[_0xd6f0('0x40')],_0xd6f0('0x94'));}if(!_[_0xd6f0('0x3d')](_0x2ba889[_0xd6f0('0x95')])){clearInterval(_0x2ba889['handlePredictive']);_0x2ba889[_0xd6f0('0x95')]=undefined;loggerPredictive[_0xd6f0('0x81')](_0x2ba889[_0xd6f0('0x40')],_0xd6f0('0x96'));}}}function erlangb(_0x49fc4a,_0x535910){if(_0x535910===0x0){return 0x0;}var _0x490bc4=0x1;for(var _0x5ed780=0x1;_0x5ed780<=_0x535910;_0x5ed780+=0x1){_0x490bc4=0x1+_0x490bc4*_0x5ed780/_0x49fc4a;}return 0x1/_0x490bc4;}function isVoiceQueueOutbound(_0x144a77){return _0x144a77===_0xd6f0('0x4c');}function isNotPreview(_0xa1ff68){return _0xa1ff68!==_0xd6f0('0x22');}function isCampaignIvr(_0x318a64){return _0x318a64===_0xd6f0('0x7d');}function getCallerId(_0x39f937,_0x1b298a,_0x1ce601){if(!_['isUndefined'](_0x1ce601)&&typeof _0x1ce601==='string'&&!_[_0xd6f0('0x80')](_0x1ce601)){if(!_['isUndefined'](_0x1b298a)&&typeof _0x1b298a===_0xd6f0('0x97')&&!_[_0xd6f0('0x80')](_0x1b298a)){return util[_0xd6f0('0x7a')](_0xd6f0('0x98'),_0x1b298a,_0x1ce601);}return util[_0xd6f0('0x7a')](_0xd6f0('0x98'),_0x1ce601,_0x1ce601);}if(!_[_0xd6f0('0x3d')](_0x39f937)&&typeof _0x39f937==='string'&&!_[_0xd6f0('0x80')](_0x39f937)){return _0x39f937;}return _0xd6f0('0x99');}function loggerCatchQueueSummary(_0x40cdae,_0x5b687f){return function(_0x20feae){freeVariablesPredictive(_0x5b687f);emitVoiceQueueSummary(_0x5b687f);emitCampaignSummary(_0x5b687f);loggerSyncQueueSummary[_0xd6f0('0x9a')](_0x40cdae,util['inspect'](_0x20feae,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xad50ac,_0x80f21c){return function(_0x1bf313){loggerPredictive[_0xd6f0('0x9a')](_0x80f21c[_0xd6f0('0x40')],_0xad50ac);loggerPredictive[_0xd6f0('0x9a')](_0x1bf313[_0xd6f0('0x9b')]);freeVariablesPredictive(_0x80f21c);};}function loggerCatch(_0x2efbad){return function(_0x3502ea){logger['error'](_0x2efbad,util[_0xd6f0('0x9c')](_0x3502ea,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x205b6a){return _0x205b6a&&!_[_0xd6f0('0x3d')](_0x205b6a)&&_0x205b6a[_0xd6f0('0x9d')]>0x0;}function decremetOriginate(_0x5f1321){if(!_[_0xd6f0('0x3d')](_0x5f1321)&&_0x5f1321!==null){if(typeof _0x5f1321[_0xd6f0('0x9e')]!==_0xd6f0('0x9f')){if(_0x5f1321[_0xd6f0('0x9e')]>0x0){_0x5f1321[_0xd6f0('0x9e')]-=0x1;}else{logger[_0xd6f0('0x9a')](_0xd6f0('0xa0'));}}}else{logger[_0xd6f0('0x9a')](_0xd6f0('0xa1'));}}function checkContactLowerLimitOriginate(_0x1d8221,_0x5df593,_0x440d5c){if(_0x5df593>_0x440d5c){for(var _0x16c255=0x0;_0x16c255<_0x5df593-_0x440d5c;_0x16c255+=0x1){decremetOriginate(_0x1d8221);}}}function loggerGetContactDialer(_0x1dc77c,_0x580c93,_0x12a37c){return function(_0x2b5411){checkContactLowerLimitOriginate(_0x580c93,_0x12a37c,0x0);logger[_0xd6f0('0x9a')](_0x1dc77c,util[_0xd6f0('0x9c')](_0x2b5411,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2f6b18){return function(_0xa41e33){if(isNotNull(_0xa41e33)&&isNotNull(_0xa41e33[0x0])){if(_0xa41e33[0x0][_0xd6f0('0xa2')]>0x0){_0x2f6b18[_0xd6f0('0x3e')]=_0xd6f0('0xa3');logger[_0xd6f0('0x81')](_0xd6f0('0xa4')+_0x2f6b18['name'],_0xa41e33[0x0]['contactsRescheduled'],_0xd6f0('0xa5'));}else{_0x2f6b18[_0xd6f0('0x3e')]=_0xd6f0('0xa6');logger[_0xd6f0('0x81')](_0xd6f0('0xa7')+_0x2f6b18['name']);}}};}function notSendMessagesQueue(_0x15143a){if(_0x15143a[_0xd6f0('0xa8')]){freeVariablesPredictive(_0x15143a);if(_0x15143a['originated']===0x0&&_0x15143a[_0xd6f0('0x54')]===0x0&&_0x15143a['waiting']===0x0&&(_0x15143a[_0xd6f0('0x51')]||0x0)===0x0){_0x15143a[_0xd6f0('0xa8')]=![];_0x15143a[_0xd6f0('0x4f')]=0x0;_0x15143a[_0xd6f0('0x3e')]=_0xd6f0('0x42');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x15143a[_0xd6f0('0x40')],_0xd6f0('0xa9'));}else{_0x15143a['message']=_0xd6f0('0xaa');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x15143a[_0xd6f0('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x15143a);}}function notSendMessagesCampaign(_0x5dc1c7){if(_0x5dc1c7['sendMessageOneNotActive']){if(_0x5dc1c7['originated']===0x0){_0x5dc1c7[_0xd6f0('0xa8')]=![];_0x5dc1c7[_0xd6f0('0x3e')]=_0xd6f0('0x42');loggerSyncQueueSummary[_0xd6f0('0x9a')](_0xd6f0('0xab'),_0x5dc1c7[_0xd6f0('0x40')],_0xd6f0('0xa9'));}else{_0x5dc1c7[_0xd6f0('0x3e')]=_0xd6f0('0xaa');loggerSyncQueueSummary['error'](_0xd6f0('0xab'),_0x5dc1c7['name'],'is\x20disactive');}emitCampaignSummary(_0x5dc1c7);}}function createObjHistory(_0x1309d9,_0x83913c,_0x397f2c,_0x54aea7,_0x12e166){_0x1309d9[_0xd6f0('0x3e')]=_0x397f2c;var _0xc0585c=new Action(_0x1309d9,_0x83913c);var _0xf7ade1=new History(_0xc0585c);_0xf7ade1[_0xd6f0('0xac')]=_0x54aea7;_0xf7ade1[_0xd6f0('0xad')]=_0x12e166;_0xf7ade1[_0xd6f0('0xae')]=_0xc0585c[_0xd6f0('0xaf')];return _0xf7ade1;}Dialer['prototype'][_0xd6f0('0x3c')]=function(){var _0x37a29b=this;setInterval(function(){_0x37a29b['clearZombieChannels'](_0x37a29b[_0xd6f0('0x29')],_0xd6f0('0xb0'));_0x37a29b[_0xd6f0('0xb1')](_0x37a29b[_0xd6f0('0xb2')],_0xd6f0('0xb3'));},0x32c8);};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xb1')]=function(_0x51aa88,_0x2de847){var _0x24c31d=this;for(var _0x5c3659 in _0x51aa88){if(typeof _0x51aa88[_0x5c3659]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0xd6f0('0xb4')](_0x51aa88[_0x5c3659])){return ami[_0xd6f0('0xb5')]({'action':_0xd6f0('0xb6'),'channel':_0x51aa88[_0x5c3659][_0xd6f0('0xb7')]})[_0xd6f0('0xb8')](function(_0x48d87d){if(_0x48d87d['message']===_0xd6f0('0xb9')){setTimeout(function(){if(_0x51aa88[_0x5c3659]&&_0x51aa88[_0x5c3659][_0xd6f0('0x7c')]!==_0xd6f0('0x7d')){_0x24c31d[_0xd6f0('0xba')](_0x24c31d['voiceQueues'][_0x51aa88[_0x5c3659][_0xd6f0('0xbb')]]);logger['error'](_0xd6f0('0xbc'),_0x2de847,_0x5c3659,_0x51aa88[_0x5c3659]['queue']);delete _0x51aa88[_0x5c3659];}if(_0x51aa88[_0x5c3659]&&_0x51aa88[_0x5c3659][_0xd6f0('0x7c')]===_0xd6f0('0x7d')){_0x24c31d['updateOriginated'](_0x24c31d[_0xd6f0('0x24')][_0x51aa88[_0x5c3659][_0xd6f0('0xbb')]]);logger[_0xd6f0('0x9a')](_0xd6f0('0xbd'),_0x2de847,_0x5c3659,_0x51aa88[_0x5c3659][_0xd6f0('0xbb')]);delete _0x51aa88[_0x5c3659];}},0x2328);}});}});}}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xbe')]=function(_0xb9ee3a){return BPromise[_0xd6f0('0xbf')]()[_0xd6f0('0xc0')](cmHopper[_0xd6f0('0xbe')](_0xb9ee3a))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc1')));};Dialer[_0xd6f0('0x1d')]['checkIsBlackList']=function(_0x119865){return BPromise[_0xd6f0('0xbf')]()[_0xd6f0('0xc0')](cmHopperBlack[_0xd6f0('0xc2')](_0x119865))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc3')));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xc4')]=function(_0x5d0600){return BPromise[_0xd6f0('0xbf')]()[_0xd6f0('0xc0')](cmHopperBlack[_0xd6f0('0xc4')](_0x5d0600))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc5')));};Dialer['prototype']['averageHandleTime']=function(_0x2638c3){return BPromise[_0xd6f0('0xbf')]()[_0xd6f0('0xc0')](cmHopperHistory[_0xd6f0('0xc6')](_0x2638c3))[_0xd6f0('0xb8')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xc7')]=function(_0x2d0d8a){return BPromise[_0xd6f0('0xbf')]()['then'](cmHopper[_0xd6f0('0xc7')](_0x2d0d8a))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc8')));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xc9')]=function(_0x229631,_0x50d310,_0x585495){return BPromise[_0xd6f0('0xbf')]()['then'](cmHopper[_0xd6f0('0xc9')](_0x229631,_0x50d310,_0x585495))['catch'](loggerCatch(_0xd6f0('0xca')));};Dialer[_0xd6f0('0x1d')]['getContactDialer']=function(_0x3bf3b9,_0x5cc944,_0x2cec2b,_0x1756c,_0x65b7c){return BPromise[_0xd6f0('0xbf')]()['then'](cmHopper[_0xd6f0('0xcb')](_0x3bf3b9,_0x5cc944,_0x2cec2b,_0x1756c))[_0xd6f0('0xb8')](function(_0x2f64f1){_0x65b7c['temp']-=_0x2cec2b;_0x65b7c[_0xd6f0('0xcc')]=_0x65b7c[_0xd6f0('0xcc')]>0x0?_0x65b7c[_0xd6f0('0xcc')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x2f64f1);});};Dialer['prototype'][_0xd6f0('0xcd')]=function(_0x22c3fa,_0x42b756,_0x4b113a,_0x40d4b3){return BPromise[_0xd6f0('0xbf')]()[_0xd6f0('0xc0')](cmHopper[_0xd6f0('0xcd')](_0x22c3fa,_0x42b756,_0x4b113a))[_0xd6f0('0xb8')](function(_0x37ad52){_0x40d4b3[_0xd6f0('0xcc')]-=_0x42b756;_0x40d4b3['temp']=_0x40d4b3[_0xd6f0('0xcc')]>0x0?_0x40d4b3['temp']:0x0;loggerCatch(_0xd6f0('0xce'))(_0x37ad52);});};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xcf')]=function(_0x4f5f39){return BPromise[_0xd6f0('0xbf')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x4f5f39))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xd0')));};Dialer[_0xd6f0('0x1d')]['moveContactManagedDialer']=function(_0x446896){return BPromise['resolve']()['then'](cmHopper[_0xd6f0('0xd1')](_0x446896))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xd2')));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xd3')]=function(_0x468cf5){return BPromise['resolve']()[_0xd6f0('0xc0')](cmHopperHistory['createHistory'](_0x468cf5))[_0xd6f0('0xb8')](loggerCatch('[createHistory]\x20'));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xba')]=function(_0x58c187){if(!_[_0xd6f0('0x3d')](_0x58c187)&&_0x58c187!==null){if(typeof _0x58c187[_0xd6f0('0x9e')]!==_0xd6f0('0x9f')){if(_0x58c187[_0xd6f0('0x9e')]>0x0){_0x58c187[_0xd6f0('0x9e')]-=0x1;}else{logger[_0xd6f0('0x9a')](_0xd6f0('0xd4'));}}}else{logger[_0xd6f0('0x9a')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xd5')]=function(_0x529c3d,_0x282736){var _0x527e05=this;return function(_0x1f980f){_0x527e05[_0xd6f0('0xba')](_0x282736);logger[_0xd6f0('0x9a')](_0x529c3d,util[_0xd6f0('0x9c')](_0x1f980f,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x3638b7,_0x16160d,_0xe96c8a){var _0xf5b37a={'state':0x19,'statedesc':_0xd6f0('0xd6')};this[_0xd6f0('0xba')](_0x16160d);this[_0xd6f0('0xd7')](_['merge'](_0xf5b37a,_[_0xd6f0('0xd8')](_0xe96c8a,[_0xd6f0('0xd9'),_0xd6f0('0xda'),_0xd6f0('0xdb'),'VoiceQueueId',_0xd6f0('0xdc')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xd6f0('0x9a')](_0x3638b7);};Dialer['prototype'][_0xd6f0('0xdd')]=function(_0x3e799e){return _0x3e799e===_0xd6f0('0xde');};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xdf')]=function(_0x2c25b4){return!_[_0xd6f0('0x3d')](_0x2c25b4)&&_0x2c25b4&&!_['isUndefined'](_0x2c25b4[_0xd6f0('0x40')])&&!_[_0xd6f0('0x3d')](_0x2c25b4[_0xd6f0('0x77')])&&_0x2c25b4['active']&&(this[_0xd6f0('0x26')][util[_0xd6f0('0x7a')](_0xd6f0('0xe0'),_0x2c25b4[_0xd6f0('0x40')])]['status']===_0xd6f0('0xe1')||this['trunks'][util[_0xd6f0('0x7a')]('SIP/%s',_0x2c25b4[_0xd6f0('0x40')])][_0xd6f0('0xb6')]===_0xd6f0('0xe2'));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xd7')]=function(_0xb997e1,_0x238663,_0x49c544){this['createHistory'](_0xb997e1)[_0xd6f0('0xb8')](loggerCatch(_0x238663));this['moveContactManagedDialer'](_0xb997e1)[_0xd6f0('0xb8')](loggerCatch(_0x49c544));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x38')]=function(_0x2bae25){var _0x961e4f=this[_0xd6f0('0x29')][_0x2bae25[_0xd6f0('0xe3')]];var _0x83b80a;if(!_[_0xd6f0('0xb4')](_0x2bae25)&&!_[_0xd6f0('0xb4')](_0x2bae25[_0xd6f0('0xe4')])&&!_['isNil'](_0x2bae25[_0xd6f0('0xe4')]['amdstatus'])&&_0x2bae25[_0xd6f0('0xe5')]===_0xd6f0('0xe6')&&_0x961e4f){if(_0x961e4f['type']!==_0xd6f0('0x7d')&&this[_0xd6f0('0x23')][_0x961e4f[_0xd6f0('0xbb')]][_0xd6f0('0xe7')]&&_0x2bae25[_0xd6f0('0xe8')]===_0xd6f0('0xe9')){delete this[_0xd6f0('0x29')][_0x2bae25[_0xd6f0('0xe3')]];this[_0xd6f0('0xba')](this['voiceQueues'][_0x961e4f[_0xd6f0('0xbb')]]);this[_0xd6f0('0x23')][_0x961e4f['queue']][_0xd6f0('0x5f')]+=0x1;this['voiceQueues'][_0x961e4f['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x83b80a=new Hangup(_0x961e4f,_0x2bae25);_0x83b80a[_0xd6f0('0xac')]=0x12;_0x83b80a[_0xd6f0('0xad')]='HangupInAMD';_0x83b80a[_0xd6f0('0xea')]=_0xd6f0('0xeb');ami[_0xd6f0('0x4b')](_0xd6f0('0xec'),ut[_0xd6f0('0xed')](_0x83b80a,_0xd6f0('0xee')));this[_0xd6f0('0xd7')](_0x83b80a,_0xd6f0('0xef'),'[syncHangupInAMD]');}if(_0x961e4f[_0xd6f0('0x7c')]!==_0xd6f0('0x7d')&&this['voiceQueues'][_0x961e4f[_0xd6f0('0xbb')]]['dialAMDActive']&&_0x2bae25[_0xd6f0('0xe8')]===_0xd6f0('0xf0')){var _0xa3546a=this;return new BPromise(function(_0x405d56,_0x5a7129){delete _0xa3546a[_0xd6f0('0x29')][_0x2bae25['uniqueid']];_0xa3546a['updateOriginated'](_0xa3546a[_0xd6f0('0x23')][_0x961e4f[_0xd6f0('0xbb')]]);_0xa3546a[_0xd6f0('0x23')][_0x961e4f['queue']][_0xd6f0('0x5f')]+=0x1;_0xa3546a[_0xd6f0('0x23')][_0x961e4f[_0xd6f0('0xbb')]][_0xd6f0('0x5e')]+=0x1;var _0x259b01=_0xa3546a['voiceQueues'][_0x961e4f[_0xd6f0('0xbb')]];var _0x265fd4=new Hangup(_0x961e4f,_0x2bae25);_0x265fd4['state']=0x13;_0x265fd4[_0xd6f0('0xad')]='Machine';_0x265fd4[_0xd6f0('0xea')]=_0xd6f0('0xeb');_0x265fd4[_0xd6f0('0xf1')]+=0x1;_0x265fd4[_0xd6f0('0xf2')]+=0x1;_0x265fd4[_0xd6f0('0xee')]=!![];ami[_0xd6f0('0x4b')](_0xd6f0('0xec'),ut['buildObj'](_0x265fd4,'amd'));_0xa3546a[_0xd6f0('0xd3')](_0x265fd4)['catch'](loggerCatch(_0xd6f0('0xf3')));if(_0x265fd4[_0xd6f0('0xf4')]+_0x265fd4[_0xd6f0('0xf5')]+_0x265fd4['countnoanswerretry']+_0x265fd4[_0xd6f0('0xf6')]+_0x265fd4['countdropretry']+_0x265fd4[_0xd6f0('0xf7')]+_0x265fd4[_0xd6f0('0xf1')]+_0x265fd4['countagentrejectretry']>=_0x259b01[_0xd6f0('0xf8')]){_0xa3546a[_0xd6f0('0xf9')](_0x265fd4,_0x405d56,_0x5a7129,'reason19\x20machine....');}else{if(_0x265fd4['countmachineretry']>=_0x259b01['dialMachineMaxRetry']){_0xa3546a[_0xd6f0('0xfa')](_0x265fd4,_0x405d56,_0x5a7129,_0xd6f0('0xfb'));}else{_0xa3546a[_0xd6f0('0xc7')]({'active':![],'countmachineretry':_0x265fd4[_0xd6f0('0xf1')],'scheduledat':moment()[_0xd6f0('0xfc')](_0x259b01['dialMachineRetryFrequency'],_0xd6f0('0xfd'))[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x265fd4[_0xd6f0('0xd9')],'ListId':_0x265fd4[_0xd6f0('0xda')],'VoiceQueueId':_0x265fd4[_0xd6f0('0xff')]||undefined,'CampaignId':_0x265fd4[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x100')));_0x405d56({'reschedule':0x1});}}});}if(_0x961e4f[_0xd6f0('0x7c')]===_0xd6f0('0x7d')&&this[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]][_0xd6f0('0xe7')]&&_0x2bae25['value']==='HANGUP'){delete this[_0xd6f0('0x29')][_0x2bae25[_0xd6f0('0xe3')]];this['updateOriginated'](this[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]]);_0x83b80a=new Hangup(_0x961e4f,_0x2bae25);_0x83b80a[_0xd6f0('0xac')]=0x12;_0x83b80a[_0xd6f0('0xad')]=_0xd6f0('0x101');_0x83b80a[_0xd6f0('0xea')]=_0xd6f0('0xeb');ami['emit'](_0xd6f0('0xec'),ut[_0xd6f0('0xed')](_0x83b80a,_0xd6f0('0xee')));this[_0xd6f0('0xd7')](_0x83b80a,'[syncHangupInAMDIvr][createHistory]',_0xd6f0('0x102'));}if(_0x961e4f[_0xd6f0('0x7c')]===_0xd6f0('0x7d')&&this['campaigns'][_0x961e4f[_0xd6f0('0xbb')]]['dialAMDActive']&&_0x2bae25[_0xd6f0('0xe8')]===_0xd6f0('0xf0')){var _0xa3546a=this;return new BPromise(function(_0x2aa249,_0x356b9b){delete _0xa3546a[_0xd6f0('0x29')][_0x2bae25[_0xd6f0('0xe3')]];_0xa3546a[_0xd6f0('0xba')](_0xa3546a[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]]);_0xa3546a[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]][_0xd6f0('0x5f')]+=0x1;_0xa3546a[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]][_0xd6f0('0x5e')]+=0x1;var _0x482248=_0xa3546a[_0xd6f0('0x24')][_0x961e4f[_0xd6f0('0xbb')]];var _0x31d723=new Hangup(_0x961e4f,_0x2bae25);_0x31d723[_0xd6f0('0xac')]=0x13;_0x31d723['statedesc']=_0xd6f0('0x103');_0x31d723['membername']='AMD';_0x31d723[_0xd6f0('0xf1')]+=0x1;_0x31d723['countglobal']+=0x1;_0x31d723[_0xd6f0('0xee')]=!![];ami[_0xd6f0('0x4b')](_0xd6f0('0xec'),ut['buildObj'](_0x31d723,_0xd6f0('0xee')));_0xa3546a['createHistory'](_0x31d723)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xf3')));if(_0x31d723[_0xd6f0('0xf4')]+_0x31d723['countcongestionretry']+_0x31d723[_0xd6f0('0x104')]+_0x31d723[_0xd6f0('0xf6')]+_0x31d723[_0xd6f0('0x105')]+_0x31d723[_0xd6f0('0xf7')]+_0x31d723[_0xd6f0('0xf1')]+_0x31d723[_0xd6f0('0x106')]>=_0x482248['dialGlobalMaxRetry']){_0xa3546a[_0xd6f0('0xf9')](_0x31d723,_0x2aa249,_0x356b9b,_0xd6f0('0x107'));}else{if(_0x31d723[_0xd6f0('0xf1')]>=_0x482248[_0xd6f0('0x108')]){_0xa3546a['createStateFinal'](_0x31d723,_0x2aa249,_0x356b9b,_0xd6f0('0xfb'));}else{_0xa3546a['rescheduleContact']({'active':![],'countmachineretry':_0x31d723[_0xd6f0('0xf1')],'scheduledat':moment()['add'](_0x482248['dialMachineRetryFrequency'],_0xd6f0('0xfd'))[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x31d723['ContactId'],'ListId':_0x31d723[_0xd6f0('0xda')],'VoiceQueueId':_0x31d723['VoiceQueueId']||undefined,'CampaignId':_0x31d723[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x100')));_0x2aa249({'reschedule':0x1});}}});}}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x34')]=function(_0x33a5c9){var _0x3cdcf1=this[_0xd6f0('0x29')][_0x33a5c9[_0xd6f0('0xe3')]];var _0x148bf3=this;var _0x26a9ef;if(_0x3cdcf1&&_0x3cdcf1[_0xd6f0('0x7c')]==='ivr'){delete this['uniqueId'][_0x33a5c9[_0xd6f0('0xe3')]];this[_0xd6f0('0xba')](this[_0xd6f0('0x24')][_0x3cdcf1[_0xd6f0('0xbb')]]);this['campaigns'][_0x3cdcf1[_0xd6f0('0xbb')]]['ivrAnswerCallsDay']+=0x1;_0x26a9ef=new Hangup(_0x3cdcf1,_0x33a5c9);this[_0xd6f0('0xd3')](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x109')));this[_0xd6f0('0xd1')](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch('[syncHangupIvr]'));}if(_0x3cdcf1&&_0x3cdcf1[_0xd6f0('0x7c')]!==_0xd6f0('0x7d')&&isNotNull(this['voiceQueues'][_0x3cdcf1[_0xd6f0('0xbb')]][_0xd6f0('0x10a')])){delete this[_0xd6f0('0x29')][_0x33a5c9[_0xd6f0('0xe3')]];this['updateOriginated'](this['voiceQueues'][_0x3cdcf1[_0xd6f0('0xbb')]]);this[_0xd6f0('0x23')][_0x3cdcf1[_0xd6f0('0xbb')]][_0xd6f0('0x5f')]+=0x1;this[_0xd6f0('0x23')][_0x3cdcf1[_0xd6f0('0xbb')]][_0xd6f0('0x5e')]+=0x1;_0x26a9ef=new Hangup(_0x3cdcf1,_0x33a5c9);_0x26a9ef[_0xd6f0('0xac')]=0x10;_0x26a9ef['statedesc']=_0xd6f0('0x10b');_0x26a9ef[_0xd6f0('0xea')]=_0xd6f0('0x10c');this[_0xd6f0('0xd3')](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x109')));this[_0xd6f0('0xd1')](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x10d')));}if(_0x3cdcf1&&_0x3cdcf1[_0xd6f0('0x7c')]!==_0xd6f0('0x7d')&&!isNotNull(this['voiceQueues'][_0x3cdcf1['queue']][_0xd6f0('0x10a')])){delete this['uniqueId'][_0x33a5c9[_0xd6f0('0xe3')]];this[_0xd6f0('0xba')](this[_0xd6f0('0x23')][_0x3cdcf1[_0xd6f0('0xbb')]]);this[_0xd6f0('0x23')][_0x3cdcf1[_0xd6f0('0xbb')]][_0xd6f0('0x67')]+=0x1;_0x26a9ef=new Hangup(_0x3cdcf1,_0x33a5c9);_0x26a9ef['state']=0xc;_0x26a9ef[_0xd6f0('0xad')]=_0x33a5c9[_0xd6f0('0x10e')];_0x26a9ef[_0xd6f0('0xea')]='Unknow';this['createHistory'](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x109')));this[_0xd6f0('0xd1')](_0x26a9ef)[_0xd6f0('0xb8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x10f')]=function(_0x5a4203){var _0x2b98f4=this[_0xd6f0('0x29')][_0x5a4203[_0xd6f0('0xe3')]];var _0xb2bce6=this;if(this['voiceQueues'][_0x5a4203[_0xd6f0('0xbb')]]){if(_0x2b98f4&&_0x2b98f4[_0xd6f0('0x7c')]!=='ivr'){delete this['uniqueId'][_0x5a4203[_0xd6f0('0xe3')]];this[_0xd6f0('0x23')][_0x5a4203[_0xd6f0('0xbb')]][_0xd6f0('0x5f')]+=0x1;var _0x1acefc=new AgentComplete(_0x2b98f4,_0x5a4203);if(_0x5a4203[_0xd6f0('0x110')]===_0xd6f0('0x111')){_0x1acefc[_0xd6f0('0x112')]=this[_0xd6f0('0x23')][_0x5a4203[_0xd6f0('0xbb')]]['dialQueueProject2']&&this[_0xd6f0('0x23')][_0x5a4203[_0xd6f0('0xbb')]][_0xd6f0('0x113')]?moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe')):undefined;}this[_0xd6f0('0xd3')](_0x1acefc)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xd6f0('0xd1')](_0x1acefc)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x114')));}}};Dialer[_0xd6f0('0x1d')]['syncAgentConnect']=function(_0x477673){if(this[_0xd6f0('0x23')][_0x477673[_0xd6f0('0xbb')]]){if(this[_0xd6f0('0x29')][_0x477673[_0xd6f0('0xe3')]]&&this['uniqueId'][_0x477673[_0xd6f0('0xe3')]][_0xd6f0('0x7c')]!=='ivr'){this[_0xd6f0('0xba')](this[_0xd6f0('0x23')][_0x477673['queue']]);this[_0xd6f0('0x29')][_0x477673[_0xd6f0('0xe3')]][_0xd6f0('0x115')]=moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe'));}}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x116')]=function(_0x3c1e84){this[_0xd6f0('0xd3')](_0x3c1e84)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x117')));this['moveContactManagedDialer'](_0x3c1e84)[_0xd6f0('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x30')]=function(_0x336cba){var _0x585084=this[_0xd6f0('0x29')][_0x336cba[_0xd6f0('0xe3')]];var _0x3ddd4b=this;if(this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]]){if(_0x585084&&_0x585084['type']!=='ivr'){delete this[_0xd6f0('0x29')][_0x336cba[_0xd6f0('0xe3')]];this[_0xd6f0('0xba')](this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]]);_0x585084[_0xd6f0('0x118')]=moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe'));var _0x4a5407=new QueueCallerAbandon(_0x585084,_0x336cba);if(getSeconds(_0x585084['droptime'],_0x585084['responsetime'])>=_0x585084[_0xd6f0('0x119')]){this['voiceQueues'][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x6b')]+=0x1;this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x11a')]+=0x1;this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x6d')]+=0x1;_0x4a5407[_0xd6f0('0xac')]=0xa;_0x4a5407[_0xd6f0('0xad')]='Drop';_0x4a5407[_0xd6f0('0x11b')]='TIMEOUT';_0x4a5407[_0xd6f0('0x112')]=this[_0xd6f0('0x23')][_0x336cba['queue']][_0xd6f0('0x11c')]?moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe')):undefined;_0x4a5407[_0xd6f0('0x105')]+=0x1;_0x4a5407[_0xd6f0('0xf2')]+=0x1;if(_0x4a5407['countdropretry']>=this['voiceQueues'][_0x336cba['queue']]['dialDropMaxRetry']){this[_0xd6f0('0x116')](_0x4a5407);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4a5407[_0xd6f0('0x105')],'scheduledat':moment()[_0xd6f0('0xfc')](this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x11d')],_0xd6f0('0xfd'))['format'](_0xd6f0('0xfe')),'ContactId':_0x585084[_0xd6f0('0xd9')],'ListId':_0x585084[_0xd6f0('0xda')],'VoiceQueueId':_0x585084[_0xd6f0('0xff')]||undefined,'CampaignId':_0x585084[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch('[rescheduleContact][Drop]'));var _0x1520cc=new History(_0x4a5407);_0x1520cc[_0xd6f0('0xac')]=0xa;_0x1520cc[_0xd6f0('0xad')]='Drop';_0x1520cc[_0xd6f0('0xaf')]=moment()[_0xd6f0('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1520cc[_0xd6f0('0xae')]=_0x1520cc[_0xd6f0('0xaf')];_0x1520cc[_0xd6f0('0x11e')]=_0x4a5407['calleridname'];_0x1520cc[_0xd6f0('0x11f')]=_0x4a5407[_0xd6f0('0x11f')];this[_0xd6f0('0xd3')](_0x1520cc)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x120')));}}else{this['voiceQueues'][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x6a')]+=0x1;this[_0xd6f0('0x23')][_0x336cba[_0xd6f0('0xbb')]][_0xd6f0('0x62')]+=0x1;_0x4a5407[_0xd6f0('0xac')]=0xb;_0x4a5407[_0xd6f0('0xad')]=_0xd6f0('0x121');_0x4a5407[_0xd6f0('0x11b')]=_0xd6f0('0x122');_0x4a5407[_0xd6f0('0xf7')]+=0x1;_0x4a5407['countglobal']+=0x1;if(_0x4a5407[_0xd6f0('0xf7')]>=this[_0xd6f0('0x23')][_0x336cba['queue']][_0xd6f0('0x123')]){this['queueCallerAbandonCreateState'](_0x4a5407);}else{this[_0xd6f0('0xc7')]({'active':![],'countabandonedretry':_0x4a5407[_0xd6f0('0xf7')],'scheduledat':moment()['add'](this[_0xd6f0('0x23')][_0x336cba['queue']][_0xd6f0('0x124')],'minutes')[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x585084['ContactId'],'ListId':_0x585084['ListId'],'VoiceQueueId':_0x585084[_0xd6f0('0xff')]||undefined,'CampaignId':_0x585084[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1520cc=new History(_0x4a5407);_0x1520cc[_0xd6f0('0xac')]=0xb;_0x1520cc[_0xd6f0('0xad')]=_0xd6f0('0x121');_0x1520cc[_0xd6f0('0xaf')]=moment()['format'](_0xd6f0('0xfe'));_0x1520cc[_0xd6f0('0xae')]=_0x1520cc[_0xd6f0('0xaf')];_0x1520cc[_0xd6f0('0x11e')]=_0x4a5407[_0xd6f0('0x11e')];_0x1520cc[_0xd6f0('0x11f')]=_0x4a5407[_0xd6f0('0x11f')];this['createHistory'](_0x1520cc)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x125')));}}}}};Dialer['prototype'][_0xd6f0('0x36')]=function(_0x47126a){if(this['actions'][_0x47126a[_0xd6f0('0xe3')]]){this[_0xd6f0('0xb2')][_0x47126a[_0xd6f0('0xe3')]][_0xd6f0('0xb7')]=_0x47126a[_0xd6f0('0xb7')];}if(this[_0xd6f0('0x29')][_0x47126a[_0xd6f0('0xe3')]]){this[_0xd6f0('0x29')][_0x47126a['uniqueid']][_0xd6f0('0xb7')]=_0x47126a[_0xd6f0('0xb7')];}};Dialer['prototype'][_0xd6f0('0x39')]=function(_0x48f192){if(strategy[this[_0xd6f0('0x23')][this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0xbb')]][_0xd6f0('0x4d')]]===_0xd6f0('0x127')){if(this[_0xd6f0('0xb2')][_0x48f192['actionid']]&&_[_0xd6f0('0xb4')](this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0x128')])&&_0x48f192[_0xd6f0('0xb6')]==='1'&&_0x48f192['paused']==='0'){if(this[_0xd6f0('0x25')][_0x48f192['stateinterface']]){if(!this[_0xd6f0('0x25')][_0x48f192['stateinterface']][_0xd6f0('0x128')]){this[_0xd6f0('0x25')][_0x48f192['stateinterface']][_0xd6f0('0x128')]=!![];this['actions'][_0x48f192['actionid']][_0xd6f0('0x128')]=!![];this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0x129')]=_0x48f192[_0xd6f0('0x129')];}}}}else if((strategy[this[_0xd6f0('0x23')][this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0xbb')]][_0xd6f0('0x4d')]]||_0xd6f0('0x1c'))===_0xd6f0('0x1c')){if(this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]]){if(this[_0xd6f0('0x25')][_0x48f192['stateinterface']]){this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]]['stateinterface']=_0x48f192[_0xd6f0('0x129')];if(_[_0xd6f0('0xb4')](this[_0xd6f0('0x12a')][this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0xbb')]])){this[_0xd6f0('0x12a')][this['actions'][_0x48f192[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]=[];}this[_0xd6f0('0x12a')][this[_0xd6f0('0xb2')][_0x48f192[_0xd6f0('0x126')]]['queue']][_0xd6f0('0x12b')](_[_0xd6f0('0x12c')](_[_0xd6f0('0xd8')](this['actions'][_0x48f192[_0xd6f0('0x126')]],[_0xd6f0('0x12d'),_0xd6f0('0x129')]),{'status':_0x48f192[_0xd6f0('0xb6')],'paused':_0x48f192['paused']}));}}}};function unlockQueueStatus(_0xc2bf9d,_0x3a76c6){setTimeout(function(){if(_[_0xd6f0('0x3d')](_0xc2bf9d[_0xd6f0('0x12e')])){loggerBooked[_0xd6f0('0x9a')](_0xd6f0('0x12f'),_0x3a76c6);}_0xc2bf9d[_0xd6f0('0x12e')]=!![];loggerBooked[_0xd6f0('0x81')](_0xd6f0('0x130'),_0x3a76c6,JSON[_0xd6f0('0x78')](_['pick'](_0xc2bf9d,['name',_0xd6f0('0x12e')])));},0x1f3);}Dialer[_0xd6f0('0x1d')][_0xd6f0('0x3a')]=function(_0x3f0b23){var _0x422cd8=this;var _0x40bbd9=_0x422cd8[_0xd6f0('0x23')][_0x422cd8[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]];if(strategy[this[_0xd6f0('0x23')][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]][_0xd6f0('0x4d')]]==='roundrobin'){if(this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]]&&this['actions'][_0x3f0b23[_0xd6f0('0x126')]]['stateinterface']){this[_0xd6f0('0x22')][_0xd6f0('0x131')](this[_0xd6f0('0xb2')][_0x3f0b23['actionid']][_0xd6f0('0x12d')],this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0x129')])['catch'](function(_0x227a3f){logger[_0xd6f0('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xd6f0('0x9c')](_0x227a3f,{'showHidden':![],'depth':null}));})[_0xd6f0('0x20')](function(){_0x422cd8[_0xd6f0('0xba')](_0x422cd8[_0xd6f0('0x23')][_0x422cd8['actions'][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]);_0x422cd8['agents'][_0x422cd8[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]]['stateinterface']][_0xd6f0('0x128')]=![];delete _0x422cd8[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]];unlockQueueStatus(_0x40bbd9);});}else{this[_0xd6f0('0xba')](this[_0xd6f0('0x23')][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]);this[_0xd6f0('0xc7')]({'active':![],'ContactId':this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]]['ContactId'],'ListId':this[_0xd6f0('0xb2')][_0x3f0b23['actionid']][_0xd6f0('0xda')],'VoiceQueueId':this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xff')]||undefined,'CampaignId':this['actions'][_0x3f0b23['actionid']][_0xd6f0('0xdc')]||undefined})['catch'](loggerCatch(_0xd6f0('0x132')));delete this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]];unlockQueueStatus(_0x40bbd9);}}else if((strategy[this['voiceQueues'][this['actions'][_0x3f0b23[_0xd6f0('0x126')]]['queue']][_0xd6f0('0x4d')]]||_0xd6f0('0x1c'))===_0xd6f0('0x1c')){var _0x202805;if(this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]]&&!_['isEmpty'](this[_0xd6f0('0x12a')][this[_0xd6f0('0xb2')][_0x3f0b23['actionid']][_0xd6f0('0xbb')]])){if(this[_0xd6f0('0x2d')][_0x422cd8[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]){this['queueBookedRR'][_0x422cd8['actions'][_0x3f0b23[_0xd6f0('0x126')]]['queue']]=this[_0xd6f0('0x2d')][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]]['queue']]?this['queueBookedRR'][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]:this[_0xd6f0('0x12a')][this['actions'][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]]?this['queueBooked'][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]][_0xd6f0('0x133')]||0x0:0x0;}this[_0xd6f0('0x12a')][this['actions'][_0x3f0b23['actionid']][_0xd6f0('0xbb')]][_0xd6f0('0x133')]=this['queueBookedRR'][this[_0xd6f0('0xb2')][_0x3f0b23[_0xd6f0('0x126')]][_0xd6f0('0xbb')]];for(var _0x2de951=0x0;_0x2de951=0x0;})[_0xd6f0('0xb8')](myreject(_0x31f41a)));}}else{_0x7d5ab4[_0xd6f0('0x12b')](ami[_0xd6f0('0xb5')]({'action':'command','command':util[_0xd6f0('0x7a')](_0xd6f0('0x14e'),_0x323e20,!_[_0xd6f0('0x3d')](config[_0xd6f0('0x149')][_0x5350a4])?_0x5350a4:'')})['then'](function(_0x1f3b5c){return _0x1f3b5c['content'][_0xd6f0('0x151')]('true')>=0x0;})[_0xd6f0('0xb8')](myreject(_0x31f41a)));}BPromise[_0xd6f0('0x153')](_0x7d5ab4)[_0xd6f0('0xc0')](function(_0xdade07){var _0x50b6a7=_[_0xd6f0('0x154')](_0xdade07);if(_0x50b6a7){return _0x131008(_0x50b6a7);}else{_0x104ce5['message']=_0x44dca4?_0xd6f0('0x155'):_0xd6f0('0x156');return _0x31f41a(msgResponse('[ifTime][promiseAll]',_0xd6f0('0x147'),_0xd6f0('0x157')+_0x44dca4+'\x20'+_0x17ab54+_0xd6f0('0x158')+util[_0xd6f0('0x9c')](_0x323e20,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5350a4));}})[_0xd6f0('0xb8')](function(_0x2e9d29){return _0x31f41a(msgResponse('ifTime',_0xd6f0('0x147'),JSON[_0xd6f0('0x78')](_0x2e9d29)));});});};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x159')]=function(_0x143f66){var _0x194cbd=this;return function(){switch(_0x143f66['dialMethod']){case _0xd6f0('0x15a'):freeVariablesPredictive(_0x143f66);_0x194cbd[_0xd6f0('0x15b')](_0x143f66,0x1);break;case _0xd6f0('0x15c'):freeVariablesPredictive(_0x143f66);_0x194cbd[_0xd6f0('0x15b')](_0x143f66,_0x143f66[_0xd6f0('0x15d')]);break;case _0xd6f0('0xa'):_0x194cbd[_0xd6f0('0xa')](_0x143f66);break;case _0xd6f0('0x9'):freeVariablesPredictive(_0x143f66);_0x194cbd[_0xd6f0('0x15b')](_0x143f66,0x1);break;default:freeVariablesPredictive(_0x143f66);logger[_0xd6f0('0x9a')](_0xd6f0('0x15e'),_0x143f66[_0xd6f0('0x40')],_0xd6f0('0x15f'));}};};Dialer[_0xd6f0('0x1d')]['launchHandleIvr']=function(_0x1e2489){var _0x518b14=this;return function(){_0x518b14['handleIvr'](_0x1e2489);};};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x160')]=function(_0x1d004a){var _0x5ae610=this;if(isNotPreview(_0x1d004a[_0xd6f0('0x161')])){if(isVoiceQueueOutbound(_0x1d004a[_0xd6f0('0x7c')])&&isActive(_0x1d004a[_0xd6f0('0x5a')])){_0x1d004a['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xd6f0('0xc0')](checkIsLoggedIn(_0x1d004a,_0x1d004a[_0xd6f0('0x50')]))[_0xd6f0('0xc0')](checkIsActive(_0x1d004a,_0x1d004a['dialActive']))[_0xd6f0('0xc0')](checkInterval(_0x1d004a))[_0xd6f0('0xc0')](_0x5ae610['checkIsTrunkReachable'](_0x1d004a))['then'](_0x5ae610[_0xd6f0('0x143')](_0x1d004a[_0xd6f0('0x162')],_0x1d004a['dialTimezone'],_0x1d004a[_0xd6f0('0x40')],_0x1d004a))['then'](_0x5ae610[_0xd6f0('0x163')](_0x1d004a['Interval'],_0x1d004a[_0xd6f0('0x164')],_0x1d004a[_0xd6f0('0x40')],_0x1d004a))[_0xd6f0('0xc0')](_0x5ae610[_0xd6f0('0x159')](_0x1d004a))[_0xd6f0('0xb8')](loggerCatchQueueSummary(_0xd6f0('0x165'),_0x1d004a));}else{notSendMessagesQueue(_0x1d004a);}}else{freeVariablesPredictive(_0x1d004a);}};Dialer['prototype'][_0xd6f0('0x13e')]=function(){var _0x60191a=this;var _0x25d74b;for(var _0x920a62 in this[_0xd6f0('0x24')]){if(typeof this[_0xd6f0('0x24')][_0x920a62]!==_0xd6f0('0x9f')){_0x25d74b=this[_0xd6f0('0x24')][_0x920a62];if(isCampaignIvr(_0x25d74b[_0xd6f0('0x7c')])&&isActive(_0x25d74b[_0xd6f0('0x77')])){_0x25d74b[_0xd6f0('0xa8')]=!![];BPromise['resolve']()[_0xd6f0('0xc0')](checkIsActive(_0x25d74b,_0x25d74b[_0xd6f0('0x77')]))[_0xd6f0('0xc0')](checkInterval(_0x25d74b))[_0xd6f0('0xc0')](_0x60191a[_0xd6f0('0x13f')](_0x25d74b))[_0xd6f0('0xc0')](_0x60191a[_0xd6f0('0x143')](_0x25d74b['dialGlobalInterval'],_0x25d74b[_0xd6f0('0x164')],_0x25d74b['name'],_0x25d74b))[_0xd6f0('0xc0')](_0x60191a[_0xd6f0('0x163')](_0x25d74b[_0xd6f0('0x44')],_0x25d74b['dialTimezone'],_0x25d74b['name'],_0x25d74b))['then'](_0x60191a[_0xd6f0('0x166')](_0x25d74b))[_0xd6f0('0xb8')](loggerCatchQueueSummary(_0xd6f0('0x167'),_0x25d74b));}else{notSendMessagesCampaign(_0x25d74b);}}}};function getCallerIdRandom(_0x27eba0,_0x4ace28){var _0x15d8b1;var _0x1cd834;var _0x5840cd;if(_0x4ace28<=0x0){_0x4ace28=0x1;}_0x15d8b1=new RegExp(_0xd6f0('0x168')+_0x4ace28+'}$');_0x1cd834=Math[_0xd6f0('0x169')](0xa,_0x4ace28-0x1);_0x5840cd=Math[_0xd6f0('0x169')](0xa,_0x4ace28)-0x1;return util[_0xd6f0('0x7a')]('%s',_['replace'](_0x27eba0,_0x15d8b1,_[_0xd6f0('0x16a')](_0x1cd834,_0x5840cd)));}function extractCalleridName(_0x369dcf){var _0x16533b=_0x369dcf[_0xd6f0('0x16b')](/"(.*?)"/);return _0x16533b?_0x16533b[0x1]:_0x369dcf;}function extractCalleridNumber(_0x1ac07c){var _0x4e7cb4=_0x1ac07c[_0xd6f0('0x16b')](/<(.*?)>/);return _0x4e7cb4?_0x4e7cb4[0x1]:_0x1ac07c;}Dialer[_0xd6f0('0x1d')][_0xd6f0('0x16c')]=function(_0x439aca,_0x18085f){var _0x31c40c=this;var _0x945e09=uuid['v4']();this[_0xd6f0('0xb2')][_0x945e09]=new Action(_0x439aca,_0x18085f,_0x945e09);return new BPromise(function(_0x1ee291,_0x100b4d){if(_[_0xd6f0('0x3d')](_0x439aca)&&typeof _0x439aca!==_0xd6f0('0x16d')){return _0x100b4d(msgResponse(_0xd6f0('0x16e'),_0xd6f0('0x147'),'voiceQueue\x20is\x20undefine'));}if(_[_0xd6f0('0x3d')](_0x18085f[_0xd6f0('0x16f')][_0xd6f0('0x170')])||_0x18085f[_0xd6f0('0x16f')]['phone']===null){return _0x100b4d(msgResponse(_0xd6f0('0x16e'),_0xd6f0('0x147'),_0xd6f0('0x171')));}var _0x33c9a8={'XMD-CALLERID':_0x31c40c[_0xd6f0('0xb2')][_0x945e09][_0xd6f0('0x172')](),'XMD-AGI':_0x439aca[_0xd6f0('0x10a')]?util[_0xd6f0('0x7a')](_0xd6f0('0x173'),ipAgi,_0x439aca['dialQueueProject']):_0xd6f0('0x174'),'XMD-AGIAFTER':_0x439aca[_0xd6f0('0x11c')]?util['format'](_0xd6f0('0x173'),ipAgi,_0x439aca[_0xd6f0('0x11c')]):'NONE','XMD-QUEUE':_0x439aca[_0xd6f0('0x7c')]===_0xd6f0('0x4c')?util['format'](_0xd6f0('0x175'),_0x439aca['name'],_0x439aca[_0xd6f0('0x176')]||'',_0x439aca[_0xd6f0('0x113')]?'c':'',_0x439aca[_0xd6f0('0x119')]||0x3):'NONE','XMD-CONTACTID':_0x18085f[_0xd6f0('0xd9')],'XMD-CDRTYPE':_0xd6f0('0x8'),'CALLERID(all)':_0x31c40c[_0xd6f0('0xb2')][_0x945e09][_0xd6f0('0x172')](),'XMD-AMD':_0x439aca[_0xd6f0('0xe7')]?_0xd6f0('0x177'):_0xd6f0('0x174'),'XMD-DESTINATION':_0xd6f0('0xe6')};if(_0x439aca['dialAMDActive']){_0x33c9a8[_0xd6f0('0x178')]=_0x439aca[_0xd6f0('0x179')]||0x9c4;_0x33c9a8['XMD-AMDGREETING']=_0x439aca[_0xd6f0('0x17a')]||0x5dc;_0x33c9a8[_0xd6f0('0x17b')]=_0x439aca[_0xd6f0('0x17c')]||0x320;_0x33c9a8[_0xd6f0('0x17d')]=_0x439aca[_0xd6f0('0x17e')]||0x1388;_0x33c9a8[_0xd6f0('0x17f')]=_0x439aca[_0xd6f0('0x180')]||0x64;_0x33c9a8[_0xd6f0('0x181')]=_0x439aca[_0xd6f0('0x182')]||0x32;_0x33c9a8[_0xd6f0('0x183')]=_0x439aca[_0xd6f0('0x184')]||0x3;_0x33c9a8[_0xd6f0('0x185')]=_0x439aca['dialAMDSilenceThreshold']||0x100;_0x33c9a8[_0xd6f0('0x186')]=_0x439aca['dialAMDMaximumWordLength']||0x1388;}if(_0x439aca[_0xd6f0('0x7c')]===_0xd6f0('0x4c')){_0x33c9a8[_0xd6f0('0x187')]=_0x18085f[_0xd6f0('0xff')];}else{_0x33c9a8[_0xd6f0('0x188')]=_0x18085f['CampaignId'];}for(var _0x52ce04 in _0x18085f[_0xd6f0('0x16f')]){if(typeof _0x18085f[_0xd6f0('0x16f')][_0x52ce04]!==_0xd6f0('0x9f')){if(isNotNull(_0x18085f[_0xd6f0('0x16f')][_0x52ce04])&&_0x52ce04!=='id'&&_0x52ce04!==_0xd6f0('0x189')&&_0x52ce04!=='createdAt'&&_0x52ce04!==_0xd6f0('0x18a')){_0x33c9a8[util[_0xd6f0('0x7a')](_0xd6f0('0x18b'),'XMD-',_[_0xd6f0('0x18c')](_0x52ce04))]=_0x18085f[_0xd6f0('0x16f')][_0x52ce04];}}}var _0x455f9c=_0x31c40c[_0xd6f0('0xdf')](_0x439aca[_0xd6f0('0x76')])?getCallerId(_0x439aca[_0xd6f0('0x76')]['callerid'],_0x439aca['dialOriginateCallerIdName'],_0x439aca[_0xd6f0('0x18d')]>0x0?getCallerIdRandom(_0x439aca[_0xd6f0('0x5c')],_0x439aca['dialRandomLastDigitCallerIdNumber']):_0x439aca['dialOriginateCallerIdNumber']):getCallerId(_[_0xd6f0('0xb4')](_0x439aca[_0xd6f0('0x140')])?_0x439aca[_0xd6f0('0x76')]['callerid']:_0x439aca[_0xd6f0('0x140')]['callerid'],_0x439aca[_0xd6f0('0x5b')],_0x439aca['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x439aca['dialOriginateCallerIdNumber'],_0x439aca[_0xd6f0('0x18d')]):_0x439aca['dialOriginateCallerIdNumber']);if(_0x455f9c){_0x33c9a8[_0xd6f0('0x18e')]=_0x31c40c[_0xd6f0('0xb2')][_0x945e09][_0xd6f0('0x18f')]=extractCalleridName(_0x455f9c);_0x33c9a8[_0xd6f0('0x190')]=_0x31c40c[_0xd6f0('0xb2')][_0x945e09]['originatecalleridnum']=extractCalleridNumber(_0x455f9c);}return ami['Action']({'actionid':_0x945e09,'action':_0xd6f0('0x16e'),'channel':_0x31c40c[_0xd6f0('0xdf')](_0x439aca[_0xd6f0('0x76')])?util[_0xd6f0('0x7a')]('SIP/%s/%s%s',_0x439aca[_0xd6f0('0x76')]['name'],isNotNull(_0x439aca['dialPrefix'])?_0x439aca[_0xd6f0('0x191')][_0xd6f0('0x192')]()||'':'',_0x439aca[_0xd6f0('0x193')]>0x0?_0x18085f[_0xd6f0('0x16f')]['phone'][_0xd6f0('0x194')](_0x439aca[_0xd6f0('0x193')]):_0x18085f[_0xd6f0('0x16f')][_0xd6f0('0x170')]):util['format'](_0xd6f0('0x195'),_['isNil'](_0x439aca[_0xd6f0('0x140')])?_0x439aca['Trunk']['name']:_0x439aca[_0xd6f0('0x140')][_0xd6f0('0x40')],isNotNull(_0x439aca['dialPrefix'])?_0x439aca[_0xd6f0('0x191')]['trim']()||'':'',_0x439aca['dialCutDigit']>0x0?_0x18085f['Contact']['phone'][_0xd6f0('0x194')](_0x439aca[_0xd6f0('0x193')]):_0x18085f[_0xd6f0('0x16f')][_0xd6f0('0x170')]),'callerid':_0x455f9c,'Exten':_0xd6f0('0xe6'),'Context':_0xd6f0('0x196'),'Priority':'1','variable':_0x33c9a8,'timeout':(_0x439aca[_0xd6f0('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x945e09})[_0xd6f0('0xc0')](function(_0x58b12b){return _0x1ee291(_0x58b12b);})['catch'](function(_0x5af027){_0x439aca['outboundOriginateFailureCallsDay']+=0x1;var _0x58a848=new History(_0x31c40c[_0xd6f0('0xb2')][_0x945e09]);logger[_0xd6f0('0x9a')](util[_0xd6f0('0x7a')]('[originateError]:\x20%s',JSON[_0xd6f0('0x78')](_0x5af027)));_0x58a848[_0xd6f0('0xac')]=0xe;_0x58a848[_0xd6f0('0xad')]='OriginateError';_0x58a848[_0xd6f0('0xaf')]=moment()[_0xd6f0('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x58a848[_0xd6f0('0xae')]=_0x58a848['starttime'];_0x31c40c[_0xd6f0('0xd3')](_0x58a848)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x197')));_0x31c40c[_0xd6f0('0xd1')](_0x58a848)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x197')))[_0xd6f0('0x20')](function(){delete _0x31c40c[_0xd6f0('0xb2')][_0x945e09];return _0x100b4d(msgResponse(_0xd6f0('0x16e'),_0xd6f0('0x48'),_0xd6f0('0x198')));});});});};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x31')]=function(_0x55f6b1){var _0x1aa29d=this[_0xd6f0('0xb2')][_0x55f6b1[_0xd6f0('0x126')]];if(_0x1aa29d){delete this[_0xd6f0('0xb2')][_0x55f6b1[_0xd6f0('0x126')]];_0x1aa29d[_0xd6f0('0x199')]=moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe'));var _0x565bca=_0x1aa29d[_0xd6f0('0x7c')]===_0xd6f0('0x7d')?this[_0xd6f0('0x24')][_0x1aa29d[_0xd6f0('0xbb')]]:this[_0xd6f0('0x23')][_0x1aa29d[_0xd6f0('0x19a')]()];if(!this['isSuccess'](_0x55f6b1[_0xd6f0('0x19b')])){this['updateOriginated'](_0x565bca);return this[_0xd6f0('0x19c')](_0x1aa29d,_0x565bca,_0x55f6b1)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x19d')));}this['uniqueId'][_0x55f6b1[_0xd6f0('0xe3')]]=_0x1aa29d;}};Dialer[_0xd6f0('0x1d')]['checkRetriveMax']=function(_0x129f95,_0x22afa5,_0x56133d){var _0x2e26d8=new History(_0x22afa5);if(_0x2e26d8[_0xd6f0('0xf4')]+_0x2e26d8['countcongestionretry']+_0x2e26d8[_0xd6f0('0x104')]+_0x2e26d8[_0xd6f0('0xf6')]+_0x2e26d8[_0xd6f0('0x105')]+_0x2e26d8[_0xd6f0('0xf7')]+_0x2e26d8[_0xd6f0('0xf1')]+_0x2e26d8[_0xd6f0('0x106')]>=_0x56133d[_0xd6f0('0xf8')]-0x1){return!![];}switch(_0x129f95){case 0x3:if(_0x2e26d8['countnoanswerretry']>=_0x56133d['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2e26d8[_0xd6f0('0x104')]+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d[_0xd6f0('0x19e')],_0xd6f0('0xfd'))[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x2e26d8['ContactId'],'ListId':_0x2e26d8['ListId'],'VoiceQueueId':_0x2e26d8[_0xd6f0('0xff')]||undefined,'CampaignId':_0x2e26d8[_0xd6f0('0xdc')]||undefined})['catch'](loggerCatch(_0xd6f0('0x19f')));break;case 0x5:if(_0x2e26d8['countbusyretry']>=_0x56133d[_0xd6f0('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x2e26d8[_0xd6f0('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x56133d['dialBusyRetryFrequency'],_0xd6f0('0xfd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2e26d8['ContactId'],'ListId':_0x2e26d8[_0xd6f0('0xda')],'VoiceQueueId':_0x2e26d8[_0xd6f0('0xff')]||undefined,'CampaignId':_0x2e26d8[_0xd6f0('0xdc')]||undefined})['catch'](loggerCatch(_0xd6f0('0x1a1')));break;case 0x8:if(_0x2e26d8[_0xd6f0('0xf5')]>=_0x56133d['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2e26d8[_0xd6f0('0xf5')]+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d[_0xd6f0('0x1a2')],_0xd6f0('0xfd'))[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x2e26d8[_0xd6f0('0xd9')],'ListId':_0x2e26d8[_0xd6f0('0xda')],'VoiceQueueId':_0x2e26d8['VoiceQueueId']||undefined,'CampaignId':_0x2e26d8[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1a3')));break;case 0x0:if(_0x2e26d8['countnosuchnumberretry']>=_0x56133d[_0xd6f0('0x1a4')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2e26d8[_0xd6f0('0xf6')]+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d[_0xd6f0('0x1a5')],'minutes')[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x2e26d8[_0xd6f0('0xd9')],'ListId':_0x2e26d8[_0xd6f0('0xda')],'VoiceQueueId':_0x2e26d8[_0xd6f0('0xff')]||undefined,'CampaignId':_0x2e26d8['CampaignId']||undefined})['catch'](loggerCatch(_0xd6f0('0x1a6')));}break;case 0xa:if(_0x2e26d8[_0xd6f0('0x105')]>=_0x56133d['dialDropMaxRetry']-0x1){return!![];}this[_0xd6f0('0xc7')]({'active':![],'countdropretry':_0x2e26d8['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x56133d['dialDropRetryFrequency'],_0xd6f0('0xfd'))[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x2e26d8[_0xd6f0('0xd9')],'ListId':_0x2e26d8[_0xd6f0('0xda')],'VoiceQueueId':_0x2e26d8[_0xd6f0('0xff')]||undefined,'CampaignId':_0x2e26d8['CampaignId']||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1a7')));break;case 0xb:if(_0x2e26d8[_0xd6f0('0xf7')]>=_0x56133d[_0xd6f0('0x123')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x2e26d8['countabandonedretry']+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d[_0xd6f0('0x124')],'minutes')[_0xd6f0('0x7a')](_0xd6f0('0xfe')),'ContactId':_0x2e26d8['ContactId'],'ListId':_0x2e26d8['ListId'],'VoiceQueueId':_0x2e26d8['VoiceQueueId']||undefined,'CampaignId':_0x2e26d8[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1a8')));break;case 0x13:if(_0x2e26d8[_0xd6f0('0xf1')]>=_0x56133d['dialMachineMaxRetry']-0x1){return!![];}this[_0xd6f0('0xc7')]({'active':![],'countmachineretry':_0x2e26d8[_0xd6f0('0xf1')]+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d['dialMachineRetryFrequency'],_0xd6f0('0xfd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2e26d8[_0xd6f0('0xd9')],'ListId':_0x2e26d8[_0xd6f0('0xda')],'VoiceQueueId':_0x2e26d8[_0xd6f0('0xff')]||undefined,'CampaignId':_0x2e26d8['CampaignId']||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x100')));break;case 0x14:if(_0x2e26d8[_0xd6f0('0x106')]>=_0x56133d[_0xd6f0('0x1a9')]-0x1){return!![];}this[_0xd6f0('0xc7')]({'active':![],'countagentrejectretry':_0x2e26d8['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xd6f0('0xfc')](_0x56133d[_0xd6f0('0x1aa')],_0xd6f0('0xfd'))['format'](_0xd6f0('0xfe')),'ContactId':_0x2e26d8[_0xd6f0('0xd9')],'ListId':_0x2e26d8['ListId'],'VoiceQueueId':_0x2e26d8['VoiceQueueId']||undefined,'CampaignId':_0x2e26d8[_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1ab')));break;default:return!![];}};Dialer[_0xd6f0('0x1d')]['callProgressDetecting']=function(_0x9bc9c1,_0xd12f50,_0xea0635){var _0x402900=this;var _0x172e8a=new History(_0x9bc9c1);return new BPromise(function(_0x19a51c,_0x31b16d){if(_['isUndefined'](_0xd12f50)&&typeof _0xd12f50!=='object'){return _0x31b16d(msgResponse(_0xd6f0('0x1ac'),'Failure','entity\x20is\x20undefine'));}if(_[_0xd6f0('0x3d')](_0xea0635)&&typeof _0xea0635!=='object'){return _0x31b16d(msgResponse('[callProgressDetecting]',_0xd6f0('0x147'),_0xd6f0('0x1ad')));}switch(_0xea0635[_0xd6f0('0x110')]){case'0':_0xd12f50['outboundNoSuchCallsDay']+=0x1;_0x172e8a[_0xd6f0('0xac')]=0x0;_0x172e8a[_0xd6f0('0xad')]=_0xd6f0('0x1ae');_0x172e8a[_0xd6f0('0xf6')]+=0x1;_0x172e8a[_0xd6f0('0xf2')]+=0x1;ami[_0xd6f0('0x4b')](_0xd6f0('0x1af'),ut[_0xd6f0('0xed')](_0x9bc9c1,_0xd6f0('0x1b0')));_0x402900[_0xd6f0('0xd3')](_0x172e8a)['catch'](loggerCatch(_0xd6f0('0xf3')));if(_0x402900[_0xd6f0('0x1b1')](0x0,_0x9bc9c1,_0xd12f50)){if(_0x172e8a[_0xd6f0('0xf6')]>=_0xd12f50[_0xd6f0('0x1a4')]){_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1b2'));}else{_0x402900['stateGlobal'](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1b2'));}}break;case'3':_0xd12f50[_0xd6f0('0x63')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0x3;_0x172e8a[_0xd6f0('0xad')]=_0xd6f0('0x1b3');_0x172e8a[_0xd6f0('0x104')]+=0x1;_0x172e8a[_0xd6f0('0xf2')]+=0x1;ami[_0xd6f0('0x4b')]('custom:agentnoanswer',ut['buildObj'](_0x9bc9c1,_0xd6f0('0x1b4')));_0x402900[_0xd6f0('0xd3')](_0x172e8a)['catch'](loggerCatch(_0xd6f0('0x1b5')));if(_0x402900[_0xd6f0('0x1b1')](0x3,_0x9bc9c1,_0xd12f50)){if(_0x172e8a[_0xd6f0('0x104')]>=_0xd12f50[_0xd6f0('0x1b6')]){_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1b7'));}else{_0x402900[_0xd6f0('0xf9')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1b7'));}}break;case'5':_0xd12f50[_0xd6f0('0x1b8')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0x5;_0x172e8a['statedesc']=_0xd6f0('0x1b9');_0x172e8a[_0xd6f0('0xf4')]+=0x1;_0x172e8a[_0xd6f0('0xf2')]+=0x1;ami[_0xd6f0('0x4b')](_0xd6f0('0x1ba'),ut[_0xd6f0('0xed')](_0x9bc9c1,_0xd6f0('0x1bb')));_0x402900[_0xd6f0('0xd3')](_0x172e8a)['catch'](loggerCatch(_0xd6f0('0x1bc')));if(_0x402900[_0xd6f0('0x1b1')](0x5,_0x9bc9c1,_0xd12f50)){if(_0x172e8a[_0xd6f0('0xf4')]>=_0xd12f50[_0xd6f0('0x1a0')]){_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1bd'));}else{_0x402900['stateGlobal'](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1bd'));}}break;case'8':_0xd12f50[_0xd6f0('0x60')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0x8;_0x172e8a[_0xd6f0('0xad')]=_0xd6f0('0x1be');_0x172e8a[_0xd6f0('0xf5')]+=0x1;_0x172e8a[_0xd6f0('0xf2')]+=0x1;ami[_0xd6f0('0x4b')](_0xd6f0('0x1bf'),ut['buildObj'](_0x9bc9c1,_0xd6f0('0x1c0')));_0x402900['createHistory'](_0x172e8a)[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1c1')));if(_0x402900['checkRetriveMax'](0x8,_0x9bc9c1,_0xd12f50)){if(_0x172e8a[_0xd6f0('0xf5')]>=_0xd12f50[_0xd6f0('0x1c2')]){_0x402900['createStateFinal'](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1c3'));}else{_0x402900[_0xd6f0('0xf9')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1c3'));}}break;case'11':_0xd12f50[_0xd6f0('0x1c4')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0xb;_0x172e8a[_0xd6f0('0xad')]=_0xd6f0('0x121');_0x172e8a['countabandonedretry']+=0x1;_0x172e8a['countglobal']+=0x1;_0x402900[_0xd6f0('0xd3')](_0x172e8a)['catch'](loggerCatch(_0xd6f0('0x125')));if(_0x402900[_0xd6f0('0x1b1')](0xb,_0x9bc9c1,_0xd12f50)){if(_0x172e8a[_0xd6f0('0xf7')]>=_0xd12f50[_0xd6f0('0x123')]){_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,'reason\x2011\x20abandoned');}else{_0x402900[_0xd6f0('0xf9')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1c5'));}}break;case'20':_0xd12f50[_0xd6f0('0x66')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0x14;_0x172e8a['statedesc']='AgentReject';_0x172e8a[_0xd6f0('0x106')]+=0x1;_0x172e8a[_0xd6f0('0xf2')]+=0x1;ami[_0xd6f0('0x4b')](_0xd6f0('0x1c6'),ut['buildObj'](_0x9bc9c1,'agentreject'));_0x402900[_0xd6f0('0xd3')](_0x172e8a)[_0xd6f0('0xb8')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x402900[_0xd6f0('0x1b1')](0x14,_0x9bc9c1,_0xd12f50)){if(_0x172e8a['countagentrejectretry']>=_0xd12f50[_0xd6f0('0x1a9')]){_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1c7'));}else{_0x402900[_0xd6f0('0xf9')](_0x172e8a,_0x19a51c,_0x31b16d,_0xd6f0('0x1c7'));}}break;default:_0xd12f50[_0xd6f0('0x67')]+=0x1;_0x172e8a[_0xd6f0('0xac')]=0xc;_0x172e8a['statedesc']=_0xea0635[_0xd6f0('0x110')];_0x402900[_0xd6f0('0xd3')](_0x172e8a)[_0xd6f0('0xb8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x402900[_0xd6f0('0x1b1')](_0xea0635[_0xd6f0('0x110')],_0x9bc9c1,_0xd12f50)){if(_0x172e8a['countbusyretry']+_0x172e8a[_0xd6f0('0xf5')]+_0x172e8a[_0xd6f0('0x104')]+_0x172e8a[_0xd6f0('0xf6')]+_0x172e8a[_0xd6f0('0x105')]+_0x172e8a[_0xd6f0('0xf7')]+_0x172e8a['countmachineretry']+_0x172e8a[_0xd6f0('0x106')]>=_0xd12f50['dialGlobalMaxRetry']){_0x402900[_0xd6f0('0xf9')](_0x172e8a,_0x19a51c,_0x31b16d,_0xea0635[_0xd6f0('0x110')]);}else{_0x402900[_0xd6f0('0xfa')](_0x172e8a,_0x19a51c,_0x31b16d,_0xea0635[_0xd6f0('0x110')]);}}}});};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xf9')]=function(_0x2e90ec,_0x4e9df5,_0x510f8d,_0x25e297){var _0x50e1ef=new Final(_0x2e90ec);_0x50e1ef[_0xd6f0('0xac')]=0xf;_0x50e1ef[_0xd6f0('0xad')]=_0xd6f0('0x1c8');this[_0xd6f0('0xfa')](_0x50e1ef,_0x4e9df5,_0x510f8d,_0x25e297);};Dialer[_0xd6f0('0x1d')][_0xd6f0('0xfa')]=function(_0x367791,_0x388dd0,_0x4ee4d1,_0x1679ae){this[_0xd6f0('0xd1')](_0x367791)[_0xd6f0('0xc0')](function(){return _0x388dd0(msgResponse(_0xd6f0('0x1ac'),_0xd6f0('0xde'),_0x1679ae));})[_0xd6f0('0xb8')](function(){return _0x4ee4d1(msgResponse('[moveContactManagedDialer][0]','Failure',_0xd6f0('0x1c9')));});};Dialer['prototype'][_0xd6f0('0xa')]=function(_0x4cd339){var _0x51de1f=_0x4cd339[_0xd6f0('0x1ca')]/0x64;var _0x3c541d=_0x4cd339[_0xd6f0('0x11a')]/(_0x4cd339['outboundDropCallsDayTimeout']+_0x4cd339[_0xd6f0('0x5f')]);var _0x1e59ba=Math['round'](_0x4cd339[_0xd6f0('0x1cb')]*(_0x4cd339[_0xd6f0('0x1cc')]/0x64));var _0x1b9a30=Math[_0xd6f0('0x1cd')](_0x4cd339[_0xd6f0('0x1cb')]*(_0x4cd339[_0xd6f0('0x1ce')]/0x64));var _0x498ac8=_0x4cd339[_0xd6f0('0x4f')]+_0x4cd339[_0xd6f0('0x54')];var _0x212f18=Math[_0xd6f0('0x1cf')](_0x4cd339[_0xd6f0('0x72')]*_0x4cd339[_0xd6f0('0x74')]*_0x4cd339['predictiveIntervalHitRate']*_0x4cd339[_0xd6f0('0x6f')]);if(_[_0xd6f0('0x3d')](_0x4cd339['startProgressive'])){if(!_['isUndefined'](_0x4cd339[_0xd6f0('0x93')])){_0x4cd339[_0xd6f0('0x93')]=undefined;loggerPredictive[_0xd6f0('0x9a')](_0xd6f0('0x1d0'),_0xd6f0('0x1d1'));}if(!_['isUndefined'](_0x4cd339[_0xd6f0('0x95')])){loggerPredictive['error'](_0xd6f0('0x1d0'),_0xd6f0('0x1d2'));clearInterval(_0x4cd339['handlePredictive']);_0x4cd339[_0xd6f0('0x95')]=undefined;}_0x4cd339[_0xd6f0('0x2b')]=moment()[_0xd6f0('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xd6f0('0x81')](_0x4cd339[_0xd6f0('0x40')],_0xd6f0('0x1d3'),_0x4cd339[_0xd6f0('0x2b')]);this[_0xd6f0('0x15b')](_0x4cd339,0x1);}else if(ifInterval(_0x4cd339[_0xd6f0('0x1d4')],_0x4cd339['startProgressive'])){this[_0xd6f0('0x15b')](_0x4cd339,0x1);loggerPredictiveCalls[_0xd6f0('0x81')](_0xd6f0('0x1d5'),_0x4cd339[_0xd6f0('0x2b')],_0x4cd339['name']);_0x4cd339[_0xd6f0('0x72')]=0x0;_0x4cd339['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x51de1f<_0x3c541d&&_0x4cd339[_0xd6f0('0x1d6')]===_0xd6f0('0x1d7')){freeVariablesPredictive(_0x4cd339);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x1d8'),'Dropped\x20calls\x20day',_0x3c541d,'startProgressive',_0x4cd339[_0xd6f0('0x40')]);}else if(_0x212f18<_0x4cd339['predictiveIntervalErlangCallsDroppedCalls']&&_0x4cd339[_0xd6f0('0x1d6')]===_0xd6f0('0x1d7')){freeVariablesPredictive(_0x4cd339);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x1d9'),_0xd6f0('0x1da'),_0x212f18,'Drop\x20in\x20this\x20interval',_0x4cd339[_0xd6f0('0x6d')],_0xd6f0('0x2b'),_0x4cd339[_0xd6f0('0x40')]);}else if(!ifInterval(_0x4cd339[_0xd6f0('0x1d4')],_0x4cd339[_0xd6f0('0x2b')])&&_[_0xd6f0('0x3d')](_0x4cd339[_0xd6f0('0x93')])&&!_[_0xd6f0('0x3d')](_0x4cd339[_0xd6f0('0x2b')])){_0x4cd339[_0xd6f0('0x93')]=moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe'));loggerPredictive[_0xd6f0('0x81')](_0x4cd339[_0xd6f0('0x40')],_0xd6f0('0x1db'),_0x4cd339[_0xd6f0('0x93')]);this['averageHandleTime'](_0x4cd339[_0xd6f0('0x1d4')])['then'](this[_0xd6f0('0x1dc')](_0x4cd339))['then'](mergeDataErlangB(_0x4cd339))['then'](this[_0xd6f0('0x1dd')](_0x4cd339))[_0xd6f0('0xb8')](loggerCatchPredictive(_0xd6f0('0x1de'),_0x4cd339));}else if(!ifInterval(_0x4cd339[_0xd6f0('0x1d4')],_0x4cd339[_0xd6f0('0x93')])){_0x4cd339[_0xd6f0('0x6d')]=0x0;_0x4cd339[_0xd6f0('0x93')]=moment()[_0xd6f0('0x7a')](_0xd6f0('0xfe'));loggerPredictive['info'](_0x4cd339['name'],_0xd6f0('0x1df'),_0x4cd339[_0xd6f0('0x93')]);clearInterval(_0x4cd339['handlePredictive']);_0x4cd339[_0xd6f0('0x95')]=undefined;this['averageHandleTime'](_0x4cd339[_0xd6f0('0x1d4')])['then'](this['getDataPredictive'](_0x4cd339))[_0xd6f0('0xc0')](mergeDataErlangB(_0x4cd339))[_0xd6f0('0xc0')](this['startMethodPredictive'](_0x4cd339))[_0xd6f0('0xb8')](loggerCatchPredictive(_0xd6f0('0x1e0'),_0x4cd339));}else if(_0x4cd339['predictiveIntervalAvailable']&&_0x498ac8<_0x4cd339[_0xd6f0('0x1cb')]-_0x1b9a30){freeVariablesPredictive(_0x4cd339);loggerPredictive[_0xd6f0('0x81')](_0x4cd339['name'],_0xd6f0('0x1e1'),_0x498ac8,_0xd6f0('0x1e2'),_0x4cd339[_0xd6f0('0x1cb')],'-',_0x1b9a30,'=',_0x4cd339[_0xd6f0('0x1cb')]-_0x1b9a30,')');}else if(_0x4cd339[_0xd6f0('0x1cb')]&&_0x498ac8>_0x4cd339[_0xd6f0('0x1cb')]+_0x1e59ba){freeVariablesPredictive(_0x4cd339);loggerPredictive['info'](_0x4cd339['name'],_0xd6f0('0x1e1'),_0x498ac8,_0xd6f0('0x1e3'),_0x4cd339[_0xd6f0('0x1cb')],'+',_0x1e59ba,'=',_0x4cd339[_0xd6f0('0x1cb')]+_0x1e59ba,')');}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x1dc')]=function(_0x53eb93){var _0x386dc2=this;return function(_0x1f9774){return new BPromise(function(_0x278c16,_0x460bd5){_[_0xd6f0('0x12c')](_0x53eb93,_0x1f9774[0x0]);if(checkGetDataPredictive(_0x1f9774[0x0])){var _0x1ad377=_0x53eb93[_0xd6f0('0x1cb')]=_0x53eb93['talking']+_0x53eb93[_0xd6f0('0x4f')];var _0x14f925=_0x53eb93[_0xd6f0('0x1d4')]*0x3c;var _0x48235b=_0x1f9774[0x0][_0xd6f0('0x69')]+_0x1f9774[0x0]['predictiveIntervalAvgHoldtime'];var _0x54b755=(_0x1f9774[0x0][_0xd6f0('0x68')]+_0x1f9774[0x0][_0xd6f0('0x6b')]+_0x1f9774[0x0][_0xd6f0('0x6a')])/_0x1f9774[0x0][_0xd6f0('0x71')];_0x53eb93['predictiveIntervalHitRate']=_0x54b755>0x0?_0x54b755:0x1;switch(_0x53eb93[_0xd6f0('0x1d6')]){case _0xd6f0('0x1d7'):var _0x515257=_0x53eb93[_0xd6f0('0x1ca')]/0x64;return _0x386dc2[_0xd6f0('0x1e4')](_0x1ad377,_0x14f925,_0x48235b,_0x54b755,_0x515257)['then'](function(_0x2c48a6){return _0x278c16(_0x2c48a6);});case _0xd6f0('0x1e5'):var _0x663471=_0x53eb93[_0xd6f0('0x1ca')]/0x64;return _0x386dc2[_0xd6f0('0x1e6')](_0x1ad377,_0x14f925,_0x48235b,_0x54b755,_0x663471)[_0xd6f0('0xc0')](function(_0x2e0294){return _0x278c16(_0x2e0294);});default:return _0x460bd5(msgResponse(_0xd6f0('0x1e7'),_0xd6f0('0x147'),'Unknown\x20Predictive'));}}else{return _0x460bd5(msgResponse(_0xd6f0('0x1e7'),_0xd6f0('0x147'),_0xd6f0('0x1e8')));}});};};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x1e9')]=function(_0x8a4988){var _0x454dd5=this;return function(_0x245549){return new BPromise(function(_0x41ec2d,_0x7d0081){_[_0xd6f0('0x12c')](_0x8a4988,_0x245549[0x0]);if(checkGetDataPredictive(_0x245549[0x0])){loggerPredictive[_0xd6f0('0x81')](JSON[_0xd6f0('0x78')](_0x245549[0x0]));if(_0x8a4988[_0xd6f0('0x1d6')]===_0xd6f0('0x1d7')){return _0x454dd5[_0xd6f0('0xcf')](_0x8a4988['id'])[_0xd6f0('0xc0')](function(_0x1c743c){var _0x670494=_0x8a4988[_0xd6f0('0x50')]-_0x1c743c[0x0][_0xd6f0('0x1ea')];var _0x4d9328=_0x8a4988[_0xd6f0('0x1d4')]*0x3c;var _0x2aafb4=_0x245549[0x0][_0xd6f0('0x69')]+_0x245549[0x0][_0xd6f0('0x88')];var _0x1846e9=(_0x245549[0x0][_0xd6f0('0x68')]+_0x245549[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x245549[0x0][_0xd6f0('0x6a')])/_0x245549[0x0]['predictiveIntervalTotalCalls'];var _0x12db26=_0x8a4988[_0xd6f0('0x1ca')]/0x64;_0x8a4988['predictiveIntervalPauses']=_0x1c743c[0x0][_0xd6f0('0x1ea')]||0x0;_0x8a4988[_0xd6f0('0x6e')]=_0x1846e9>0x0?_0x1846e9:0x1;return _0x454dd5['abandonmentRate'](_0x670494,_0x4d9328,_0x2aafb4,_0x1846e9,_0x12db26);})[_0xd6f0('0xc0')](function(_0x14beff){return _0x41ec2d(_0x14beff);})[_0xd6f0('0xb8')](function(_0x53afb0){return _0x7d0081(msgResponse(_0xd6f0('0x1eb'),_0xd6f0('0x147'),JSON[_0xd6f0('0x78')](_0x53afb0)));});}if(_0x8a4988['dialPredictiveOptimization']==='agentBusyFactor'){return _0x454dd5[_0xd6f0('0xcf')](_0x8a4988['id'])[_0xd6f0('0xc0')](function(_0x3a8562){var _0x332117=_0x8a4988[_0xd6f0('0x50')]-_0x3a8562[0x0][_0xd6f0('0x1ea')];var _0x33ca87=_0x8a4988['dialPredictiveInterval']*0x3c;var _0x44329e=_0x245549[0x0][_0xd6f0('0x69')]+_0x245549[0x0][_0xd6f0('0x88')];var _0x558955=(_0x245549[0x0][_0xd6f0('0x68')]+_0x245549[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x245549[0x0][_0xd6f0('0x6a')])/_0x245549[0x0][_0xd6f0('0x71')];var _0x2bf94b=_0x8a4988[_0xd6f0('0x1ca')]/0x64;_0x8a4988[_0xd6f0('0x70')]=_0x3a8562[0x0][_0xd6f0('0x1ea')]||0x0;_0x8a4988[_0xd6f0('0x6e')]=_0x558955>0x0?_0x558955:0x1;return _0x454dd5[_0xd6f0('0x1e6')](_0x332117,_0x33ca87,_0x44329e,_0x558955,_0x2bf94b);})[_0xd6f0('0xc0')](function(_0x8941e2){return _0x41ec2d(_0x8941e2);})[_0xd6f0('0xb8')](function(_0x50fd01){return _0x7d0081(msgResponse('[CatchErlangB]',_0xd6f0('0x147'),JSON[_0xd6f0('0x78')](_0x50fd01)));});}}else{return _0x7d0081(msgResponse(_0xd6f0('0x1e7'),_0xd6f0('0x147'),_0xd6f0('0x1e8')));}});};};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x1dd')]=function(_0x1d0f6c){var _0xcf9328=this;return function(){var _0x437523=0x0;var _0x181e90=Math[_0xd6f0('0x1cf')](_0x1d0f6c[_0xd6f0('0x73')]*0x3e8);if(_0x181e90>0x0){_0x181e90=_0x181e90<0x64?0x64:_0x181e90;loggerPredictive[_0xd6f0('0x81')](_0x1d0f6c[_0xd6f0('0x40')],_0xd6f0('0x1ec'),_0x181e90,_0xd6f0('0x49'));_0x1d0f6c[_0xd6f0('0x95')]=setInterval(function(){_0xcf9328['handlePredictive'](_0x1d0f6c);loggerPredictiveCalls[_0xd6f0('0x81')]('[handlePredictive]',_0x437523+=0x1);},_0x181e90);}else{loggerPredictive[_0xd6f0('0x81')](_0x1d0f6c[_0xd6f0('0x40')],_0xd6f0('0x1ed'));}};};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x1ee')]=function(_0xcad5a3,_0x55011b){var _0x1fe44d=this;return function(_0x172397){if(_[_0xd6f0('0x80')](_0x172397)){if(_[_0xd6f0('0xb4')](_0x55011b['UserId'])||!_0x55011b[_0xd6f0('0x1ef')]){if(_0xcad5a3[_0xd6f0('0x161')]==='booked'){_0xcad5a3[_0xd6f0('0x12e')]=_['isUndefined'](_0xcad5a3['queueStatusComplete'])?!![]:_0xcad5a3['queueStatusComplete'];var _0x4532e5=uuid['v4']();_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5]=new Action(_0xcad5a3,_0x55011b,_0x4532e5);loggerBooked[_0xd6f0('0x81')](_0xd6f0('0x1f0'),_0x4532e5,_0xd6f0('0x1f1'),JSON[_0xd6f0('0x78')](_0xcad5a3['queueStatusComplete']),'Queue:\x20',_0xcad5a3[_0xd6f0('0x40')]);if(_0xcad5a3['queueStatusComplete']){_0xcad5a3[_0xd6f0('0x12e')]=![];_0x1fe44d[_0xd6f0('0x12a')][_0x1fe44d['actions'][_0x4532e5]['queue']]=[];ami['Action']({'actionid':_0x4532e5,'action':'queuestatus','queue':_0xcad5a3['name']})[_0xd6f0('0xb8')](function(){_0x1fe44d['updateOriginated'](_0xcad5a3);_0x1fe44d[_0xd6f0('0xc7')]({'active':![],'ContactId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5]['ContactId'],'ListId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5][_0xd6f0('0xda')],'VoiceQueueId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5][_0xd6f0('0xff')]||undefined,'CampaignId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5][_0xd6f0('0xdc')]||undefined})['catch'](loggerCatch(_0xd6f0('0x1f2')));delete _0x1fe44d[_0xd6f0('0xb2')][_0x4532e5];});}else{loggerBooked['info'](_0xd6f0('0x1f3'),JSON[_0xd6f0('0x78')](_0xcad5a3['queueStatusComplete']),'Queue:\x20',_0xcad5a3[_0xd6f0('0x40')]);_0x1fe44d[_0xd6f0('0xba')](_0xcad5a3);_0x1fe44d[_0xd6f0('0xc7')]({'active':![],'ContactId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5]['ContactId'],'ListId':_0x1fe44d['actions'][_0x4532e5][_0xd6f0('0xda')],'VoiceQueueId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5][_0xd6f0('0xff')]||undefined,'CampaignId':_0x1fe44d[_0xd6f0('0xb2')][_0x4532e5][_0xd6f0('0xdc')]||undefined})[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1f2')));delete _0x1fe44d['actions'][_0x4532e5];}}else{return _0x1fe44d[_0xd6f0('0x16c')](_0xcad5a3,_0x55011b);}}else{if(getDiff(_0x55011b[_0xd6f0('0x1f4')])<_0xcad5a3[_0xd6f0('0x1f5')]*0x3c){if(_0x55011b[_0xd6f0('0x1f6')]&&!_0x55011b[_0xd6f0('0x1f6')][_0xd6f0('0x1f7')]){_0x1fe44d[_0xd6f0('0x22')]['run'](_0x55011b['id'])[_0xd6f0('0x20')](function(){_0x1fe44d['updateOriginated'](_0xcad5a3);});}else{_0x1fe44d['unlockContact']({'active':![]},_0x55011b['id'],0x1)[_0xd6f0('0x20')](function(){_0x1fe44d[_0xd6f0('0xba')](_0xcad5a3);});}}else{_0xcad5a3['outboundReCallsDay']+=0x1;_0x1fe44d['updateOriginated'](_0xcad5a3);if(_0xcad5a3[_0xd6f0('0x1f8')]){_0x1fe44d[_0xd6f0('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x55011b[_0xd6f0('0xd9')],'ListId':_0x55011b[_0xd6f0('0xda')],'VoiceQueueId':_0x55011b[_0xd6f0('0xff')]||undefined,'CampaignId':_0x55011b['CampaignId']||undefined})[_0xd6f0('0xb8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1fe44d[_0xd6f0('0xd3')](createObjHistory(_0xcad5a3,_0x55011b,'RECALLINQUEUE',0x17,_0xd6f0('0x1f9')))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0x1fa')));}else{_0x1fe44d[_0xd6f0('0xd7')](createObjHistory(_0xcad5a3,_0x55011b,'RECALLFAILEDTIMEOUT',0x16,_0xd6f0('0x1fb')),_0xd6f0('0x1fc'),_0xd6f0('0x1fd'));}}}}else{_0xcad5a3['outboundBlacklistCallsDay']+=0x1;_0x1fe44d['saveInDb'](createObjHistory(_0xcad5a3,_0x55011b,'BLACKLIST',0xd,'Blacklist'),_0xd6f0('0x1fe'),_0xd6f0('0x1ff'));throw _0xd6f0('0x200');}};};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x201')]=function(_0x430416){var _0x35edfe=this;var _0x1bc35b=_0x430416[_0xd6f0('0x202')]-_0x430416[_0xd6f0('0x9e')]-_0x430416[_0xd6f0('0xcc')];emitCampaignSummary(_0x430416);if(_0x1bc35b>0x0){if(_0x1bc35b>this[_0xd6f0('0x27')]){_0x1bc35b=this['maxNumberOriginate'];}_0x430416[_0xd6f0('0xcc')]+=_0x1bc35b;this[_0xd6f0('0xcd')](_0x430416['id'],_0x1bc35b,_0x430416[_0xd6f0('0x203')],_0x430416)[_0xd6f0('0xc0')](function(_0x54d973){_0x430416[_0xd6f0('0xcc')]-=_0x1bc35b;_0x430416[_0xd6f0('0xcc')]=_0x430416[_0xd6f0('0xcc')]>0x0?_0x430416['temp']:0x0;if(!checkContactEmpty(_0x54d973)){_0x430416[_0xd6f0('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xd6f0('0x81')]('[getContactCampaign2][Empty]'+_0x430416[_0xd6f0('0x40')]);}else{_0x430416[_0xd6f0('0x9e')]+=_0x54d973[_0xd6f0('0x9d')];_0x430416['message']=_0xd6f0('0x204');for(var _0x55d512=0x0;_0x55d512<_0x54d973[_0xd6f0('0x9d')];_0x55d512+=0x1){_0x430416[_0xd6f0('0x205')]+=0x1;if(_[_0xd6f0('0xb4')](_0x54d973[_0x55d512])||_['isNil'](_0x54d973[_0x55d512][_0xd6f0('0x16f')])||_[_0xd6f0('0xb4')](_0x54d973[_0x55d512][_0xd6f0('0x16f')][_0xd6f0('0x170')])){_0x35edfe['emptyContact'](_0xd6f0('0x206'),_0x430416,_0x54d973[_0x55d512]);}else{_0x35edfe[_0xd6f0('0xc4')](_[_0xd6f0('0xd8')](_0x54d973[_0x55d512],[_0xd6f0('0xdc'),'Contact.phone']))['then'](_0x35edfe[_0xd6f0('0x1ee')](_0x430416,_0x54d973[_0x55d512]))[_0xd6f0('0xb8')](_0x35edfe[_0xd6f0('0xd5')]('[actionOriginateIvr]\x20',_0x430416));}}}})[_0xd6f0('0xb8')](loggerGetContactDialer(_0xd6f0('0x207'),_0x430416,_0x1bc35b));}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x15b')]=function(_0x1e27b9,_0x28de3a){var _0x2d1c6f=this;var _0x4e2992=[];var _0x250cb9=_0x28de3a>=0x1?_0x28de3a:0x1;if(_0x1e27b9[_0xd6f0('0x161')]===_0xd6f0('0x9')){_0x250cb9=0x1;}var _0x3963cb=Math[_0xd6f0('0x1cf')](_0x1e27b9[_0xd6f0('0x4f')]*_0x250cb9)-_0x1e27b9[_0xd6f0('0x9e')]-_0x1e27b9[_0xd6f0('0xcc')];emitVoiceQueueSummary(_0x1e27b9);if(_0x1e27b9[_0xd6f0('0x208')]>0x0){var _0x2bbf7f=_0x1e27b9[_0xd6f0('0x208')]-_0x1e27b9[_0xd6f0('0x9e')]-_0x1e27b9[_0xd6f0('0x54')]-_0x1e27b9[_0xd6f0('0xcc')]-_0x1e27b9[_0xd6f0('0x51')];if(_0x3963cb>_0x2bbf7f){_0x3963cb=_0x2bbf7f;}}if(_0x3963cb>0x0){if(_0x1e27b9[_0xd6f0('0x161')]==='booked'){_0x3963cb=0x1;}if(_0x3963cb>this['maxNumberOriginate']){_0x3963cb=this[_0xd6f0('0x27')];}_0x1e27b9['temp']+=_0x3963cb;for(var _0x501f8c in this[_0xd6f0('0x25')]){if(typeof this[_0xd6f0('0x25')][_0x501f8c]!=='undefined'){if(this['agents'][_0x501f8c][_0xd6f0('0xac')]===_0xd6f0('0x209')&&this[_0xd6f0('0x25')][_0x501f8c][_0xd6f0('0xb6')]===_0xd6f0('0xe1')){_0x4e2992[_0xd6f0('0x12b')](this[_0xd6f0('0x25')][_0x501f8c]['id']);}}}this[_0xd6f0('0xcb')](_0x1e27b9['id'],_0x4e2992,_0x3963cb,_0x1e27b9[_0xd6f0('0x203')],_0x1e27b9)[_0xd6f0('0xc0')](function(_0x37d0a5){_0x1e27b9[_0xd6f0('0xcc')]-=_0x3963cb;_0x1e27b9['temp']=_0x1e27b9[_0xd6f0('0xcc')]>0x0?_0x1e27b9[_0xd6f0('0xcc')]:0x0;if(!checkContactEmpty(_0x37d0a5)){_0x2d1c6f[_0xd6f0('0xbe')](_0x1e27b9)[_0xd6f0('0xc0')](sendMessageReschedule(_0x1e27b9))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc1')));}else{_0x1e27b9[_0xd6f0('0x9e')]+=_0x37d0a5[_0xd6f0('0x9d')];_0x1e27b9[_0xd6f0('0x3e')]=_0x1e27b9[_0xd6f0('0x161')]==='booked'?'ACTIVE':_0xd6f0('0x204');for(var _0x57a646=0x0;_0x57a646<_0x37d0a5[_0xd6f0('0x9d')];_0x57a646+=0x1){if(_['isNil'](_0x37d0a5[_0x57a646])||_[_0xd6f0('0xb4')](_0x37d0a5[_0x57a646][_0xd6f0('0x16f')])||_['isNil'](_0x37d0a5[_0x57a646][_0xd6f0('0x16f')][_0xd6f0('0x170')])){_0x2d1c6f[_0xd6f0('0x20a')](_0xd6f0('0x206'),_0x1e27b9,_0x37d0a5[_0x57a646]);}else{_0x2d1c6f[_0xd6f0('0xc2')](_[_0xd6f0('0xd8')](_0x37d0a5[_0x57a646],[_0xd6f0('0xff'),_0xd6f0('0x20b')]))['then'](_0x2d1c6f[_0xd6f0('0x1ee')](_0x1e27b9,_0x37d0a5[_0x57a646]))[_0xd6f0('0xb8')](_0x2d1c6f[_0xd6f0('0xd5')](_0xd6f0('0x206'),_0x1e27b9));}}}})[_0xd6f0('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x1e27b9,_0x3963cb));}};Dialer['prototype'][_0xd6f0('0x95')]=function(_0x381dd0){if(_0x381dd0[_0xd6f0('0x208')]>0x0){var _0xb8d8b8=_0x381dd0[_0xd6f0('0x208')]-_0x381dd0[_0xd6f0('0x9e')]-_0x381dd0[_0xd6f0('0x54')];if(_0xb8d8b8>0x0){this[_0xd6f0('0x20c')](_0x381dd0);}else{loggerPredictiveCalls['info'](_0xd6f0('0x20d'));}}else{this[_0xd6f0('0x20c')](_0x381dd0);}};Dialer[_0xd6f0('0x1d')][_0xd6f0('0x20c')]=function(_0x5c642a){var _0xd3a7f=this;var _0xa00cef=[];_0x5c642a[_0xd6f0('0x9e')]+=0x1;for(var _0x289b58 in this[_0xd6f0('0x25')]){if(typeof this['agents'][_0x289b58]!==_0xd6f0('0x9f')){if(this[_0xd6f0('0x25')][_0x289b58][_0xd6f0('0xac')]===_0xd6f0('0x209')&&this[_0xd6f0('0x25')][_0x289b58]['status']===_0xd6f0('0xe1')){_0xa00cef[_0xd6f0('0x12b')](this['agents'][_0x289b58]['id']);}}}this[_0xd6f0('0xcb')](_0x5c642a['id'],_0xa00cef,0x1,_0x5c642a[_0xd6f0('0x203')],_0x5c642a)[_0xd6f0('0xc0')](function(_0x59f2f6){if(!checkContactEmpty(_0x59f2f6)){checkContactLowerLimitOriginate(_0x5c642a,0x1,0x0);_0xd3a7f[_0xd6f0('0xbe')](_0x5c642a)[_0xd6f0('0xc0')](sendMessageReschedule(_0x5c642a))[_0xd6f0('0xb8')](loggerCatch(_0xd6f0('0xc1')));}else{_0x5c642a[_0xd6f0('0x3e')]=_0xd6f0('0x204');if(_['isNil'](_0x59f2f6[0x0])||_['isNil'](_0x59f2f6[0x0][_0xd6f0('0x16f')])||_[_0xd6f0('0xb4')](_0x59f2f6[0x0]['Contact']['phone'])){_0xd3a7f[_0xd6f0('0x20a')]('[actionOriginate]\x20',_0x5c642a,_0x59f2f6[0x0]);}else{_0xd3a7f[_0xd6f0('0xc2')](_[_0xd6f0('0xd8')](_0x59f2f6[0x0],[_0xd6f0('0xff'),'Contact.phone']))[_0xd6f0('0xc0')](_0xd3a7f['checkContactBlack'](_0x5c642a,_0x59f2f6[0x0]))[_0xd6f0('0xb8')](_0xd3a7f[_0xd6f0('0xd5')](_0xd6f0('0x20e'),_0x5c642a));}}})[_0xd6f0('0xb8')](loggerGetContactDialer(_0xd6f0('0x20f'),_0x5c642a,0x1));emitVoiceQueueSummary(_0x5c642a);};Dialer['prototype'][_0xd6f0('0x1e4')]=function(_0x213025,_0x4cb65f,_0x2d027a,_0x23ceff,_0x49b590,_0xd5f542){loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x210'));loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x211'),_0x213025);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x212'),_0x4cb65f);loggerPredictive['info'](_0xd6f0('0x213'),_0x2d027a);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x214'),_0x23ceff);loggerPredictive[_0xd6f0('0x81')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49b590);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x215'));return new BPromise(function(_0x218d5a,_0x2a824c){if(_0x213025<=0x0||isNaN(_0x213025)){return _0x2a824c(msgResponse(_0xd6f0('0x216'),_0xd6f0('0x48'),_0xd6f0('0x217')+_0x213025));}if(_0x2d027a<=0x0||isNaN(_0x2d027a)){return _0x2a824c(msgResponse(_0xd6f0('0x216'),_0xd6f0('0x48'),_0xd6f0('0x218')+_0x2d027a));}if(_0x23ceff<=0x0||isNaN(_0x23ceff)){return _0x2a824c(msgResponse('[abandonmentRate]','Error',_0xd6f0('0x219')+_0x23ceff));}if(_0x4cb65f<=0x0||isNaN(_0x4cb65f)){return _0x2a824c(msgResponse(_0xd6f0('0x216'),_0xd6f0('0x48'),_0xd6f0('0x21a')+_0x4cb65f));}if(_0x49b590<=0x0||isNaN(_0x49b590)){return _0x2a824c(msgResponse('[abandonmentRate]',_0xd6f0('0x48'),_0xd6f0('0x21b')+_0x49b590));}_0xd5f542=_0xd5f542||0x0;var _0x1e9462=0x1/_0x2d027a;var _0x40b0e3=0x0;var _0x539152=0x0;var _0x5223df=0x0;var _0x1b2cd9=0x0;for(var _0x56596e=0x0;_0x5223df<_0x49b590;_0x56596e+=0x1){_0x539152=_0x56596e/_0x4cb65f;_0x40b0e3=(_0x23ceff*_0x539152+_0xd5f542)/_0x1e9462;_0x5223df=erlangb(_0x40b0e3,_0x213025);_0x1b2cd9=_0x40b0e3/_0x213025*(0x1-erlangb(_0x40b0e3,_0x213025));}return _0x218d5a({'erlangCalls':_0x56596e,'erlangCallToSecond':_0x4cb65f/_0x56596e,'erlangAbandonmentRate':_0x5223df,'erlangBusyFactor':_0x1b2cd9});});};Dialer['prototype']['busyFactor']=function(_0x522199,_0x41e6eb,_0x3f1a60,_0x675918,_0x478ff9,_0x2a8bd5){loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x21c'));loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x211'),_0x522199);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x212'),_0x41e6eb);loggerPredictive['info'](_0xd6f0('0x213'),_0x3f1a60);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x214'),_0x675918);loggerPredictive['info'](_0xd6f0('0x21d'),_0x478ff9);loggerPredictive[_0xd6f0('0x81')](_0xd6f0('0x215'));return new BPromise(function(_0x3b52d8,_0x192c04){if(_0x522199<=0x0||isNaN(_0x522199)){return _0x192c04(msgResponse(_0xd6f0('0x21e'),_0xd6f0('0x48'),_0xd6f0('0x217')+_0x522199));}if(_0x3f1a60<=0x0||isNaN(_0x3f1a60)){return _0x192c04(msgResponse('[busyFactor]',_0xd6f0('0x48'),_0xd6f0('0x218')+_0x3f1a60));}if(_0x675918<=0x0||isNaN(_0x675918)){return _0x192c04(msgResponse('[busyFactor]',_0xd6f0('0x48'),'p\x20=\x20'+_0x675918));}if(_0x41e6eb<=0x0||isNaN(_0x41e6eb)){return _0x192c04(msgResponse(_0xd6f0('0x21e'),'Error','interval\x20=\x20'+_0x41e6eb));}if(_0x478ff9<=0x0||isNaN(_0x478ff9)){return _0x192c04(msgResponse(_0xd6f0('0x21e'),_0xd6f0('0x48'),_0xd6f0('0x21f')+_0x478ff9));}_0x2a8bd5=_0x2a8bd5||0x0;var _0x1cd81c=0x1/_0x3f1a60;var _0x407af9=0x0;var _0x2df05c=0x0;var _0x4fdc47=0x0;var _0x3bd6ee=0x0;for(var _0x137fe4=0x0;_0x3bd6ee<_0x478ff9;_0x137fe4+=0x1){_0x2df05c=_0x137fe4/_0x41e6eb;_0x407af9=(_0x675918*_0x2df05c+_0x2a8bd5)/_0x1cd81c;_0x4fdc47=erlangb(_0x407af9,_0x522199);_0x3bd6ee=_0x407af9/_0x522199*(0x1-erlangb(_0x407af9,_0x522199));}return _0x3b52d8({'erlangCalls':_0x137fe4,'erlangCallToSecond':_0x41e6eb/_0x137fe4,'erlangAbandonmentRate':_0x4fdc47,'erlangBusyFactor':_0x3bd6ee});});};module[_0xd6f0('0x220')]=Dialer; \ No newline at end of file +var _0x8a55=['---------\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','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','channel','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','isSuccess','isTrunkReachable','active','trunks','SIP/%s','status','reachable','unmonitored','saveInDb','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','add','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actions','actionid','roundrobin','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','isArray','command','iftime\x20%s,%s','interval','timezones','indexOf','true','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAvgHoldtime','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','RUNNING','[actionOriginate]\x20','Contact.phone','dialLimitQueue','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\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]','interval\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty'];(function(_0x38cc8a,_0x245f10){var _0x1a7826=function(_0x2aa6bb){while(--_0x2aa6bb){_0x38cc8a['push'](_0x38cc8a['shift']());}};_0x1a7826(++_0x245f10);}(_0x8a55,0x185));var _0x58a5=function(_0x51a453,_0x2c8f72){_0x51a453=_0x51a453-0x0;var _0x381239=_0x8a55[_0x51a453];return _0x381239;};'use strict';var util=require(_0x58a5('0x0'));var _=require(_0x58a5('0x1'));var BPromise=require(_0x58a5('0x2'));var uuid=require(_0x58a5('0x3'));var moment=require(_0x58a5('0x4'));var rr=require('rr');var md5=require(_0x58a5('0x5'));var Redis=require(_0x58a5('0x6'));var ut=require(_0x58a5('0x7'));var config=require('../../../config/environment/');var logger=require(_0x58a5('0x8'))(_0x58a5('0x9'));var loggerBooked=require(_0x58a5('0x8'))(_0x58a5('0xa'));var loggerPredictive=require(_0x58a5('0x8'))(_0x58a5('0xb'));var loggerPredictiveCalls=require(_0x58a5('0x8'))(_0x58a5('0xc'));var loggerSyncQueueSummary=require(_0x58a5('0x8'))('syncQueueSummary');var ami=require(_0x58a5('0xd'));config[_0x58a5('0xe')]=_[_0x58a5('0xf')](config[_0x58a5('0xe')],{'host':_0x58a5('0x10'),'port':0x18eb});var io=require(_0x58a5('0x11'))(new Redis(config[_0x58a5('0xe')]));var cmHopper=require(_0x58a5('0x12'));var cmHopperHistory=require(_0x58a5('0x13'));var cmHopperBlack=require(_0x58a5('0x14'));var voiceQueueRt=require(_0x58a5('0x15'));var Action=require(_0x58a5('0x16'));var History=require(_0x58a5('0x17'));var Final=require(_0x58a5('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x58a5('0x19'));var Hangup=require(_0x58a5('0x1a'));var ipAgi=process[_0x58a5('0x1b')][_0x58a5('0x1c')]||_0x58a5('0x1d');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x58a5('0x1e')][_0x58a5('0x1f')]=function(_0x47e3f5){this[_0x58a5('0x20')]=this[_0x58a5('0x20')]?this['tail'][_0x58a5('0x21')](_0x47e3f5):_0x47e3f5();};function Dialer(_0x42ea0c,_0x4f8e3f){this[_0x58a5('0x22')]=new Sequence();this[_0x58a5('0x23')]=_0x4f8e3f;this['voiceQueues']=_0x42ea0c[_0x58a5('0x24')];this[_0x58a5('0x25')]=_0x42ea0c['campaigns'];this['agents']=_0x42ea0c[_0x58a5('0x26')];this['trunks']=_0x42ea0c['trunks'];this['maxNumberOriginate']=config[_0x58a5('0x27')]||0x2;this[_0x58a5('0x28')]={};this['actions']={};this[_0x58a5('0x29')]={};this[_0x58a5('0x2a')]={};this[_0x58a5('0x2b')]={};this['startPredictive']={};this[_0x58a5('0x2c')]={};this[_0x58a5('0x2d')]={};this[_0x58a5('0x2e')]={};this[_0x58a5('0x2f')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x31'),this[_0x58a5('0x32')]['bind'](this));ami['on']('originateresponse',this[_0x58a5('0x33')][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x34'),this[_0x58a5('0x35')][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x36'),this[_0x58a5('0x37')]['bind'](this));ami['on'](_0x58a5('0x38'),this['syncHangup'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x39'),this['syncNewExten'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x3a'),this['syncVarSet'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x3b'),this[_0x58a5('0x3c')]['bind'](this));ami['on'](_0x58a5('0x3d'),this[_0x58a5('0x3e')][_0x58a5('0x30')](this));this[_0x58a5('0x3f')]();this[_0x58a5('0x40')]();}function isNotNull(_0x5bbb59){return _0x5bbb59!==null&&!_[_0x58a5('0x41')](_0x5bbb59);}function checkIsLoggedIn(_0x2912bc,_0x11efc4){return function(){if(_0x11efc4<=0x0){_0x2912bc[_0x58a5('0x42')]=_0x58a5('0x43');throw _0x2912bc[_0x58a5('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3df480){return _0x3df480;}function checkIsActive(_0x47f85,_0x3f7659){return function(){if(!isActive(_0x3f7659)){_0x47f85[_0x58a5('0x42')]=_0x58a5('0x45');throw _0x47f85[_0x58a5('0x44')]+_0x58a5('0x46');}};}function checkInterval(_0x404605){return function(){if(!isNotNull(_0x404605[_0x58a5('0x47')])){_0x404605[_0x58a5('0x42')]=_0x58a5('0x48');throw _0x404605['name']+_0x58a5('0x49');}if(!isNotNull(_0x404605[_0x58a5('0x47')]['Intervals'])){_0x404605[_0x58a5('0x42')]=_0x58a5('0x48');throw _0x404605['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x404605['Interval'][_0x58a5('0x4a')]))){_0x404605[_0x58a5('0x42')]='INTERVAL_IS_NULL';throw _0x404605[_0x58a5('0x44')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x748650,_0x5dbef6,_0x41fa38){return{'action':_0x748650,'response':_0x5dbef6,'message':_0x41fa38,'stack':_0x41fa38};}function myreject(_0x297076){return function(_0x3a8b94){return _0x297076(msgResponse(_0x58a5('0x4b'),_0x58a5('0x4c'),JSON['stringify'](_0x3a8b94)));};}function getSeconds(_0xa367b1,_0x55f69b){var _0x5c46f8=moment(_0xa367b1)[_0x58a5('0x4d')](0x0);var _0x186ebe=moment(_0x55f69b)[_0x58a5('0x4d')](0x0);return _0x5c46f8[_0x58a5('0x4e')](_0x186ebe,_0x58a5('0x4f'));}function emit(_0x1d8255,_0x6a2f20,_0x9b7db8){io['to'](_0x1d8255)[_0x58a5('0x50')](_0x6a2f20,_0x9b7db8);}function emitVoiceQueueSummary(_0x3cbdea){if(_0x3cbdea[_0x58a5('0x51')]==='outbound'){var _0x135915={'id':_0x3cbdea['id'],'name':_0x3cbdea['name'],'strategy':_0x3cbdea[_0x58a5('0x52')],'answered':_0x3cbdea['answered'],'available':_0x3cbdea[_0x58a5('0x53')],'loggedIn':_0x3cbdea[_0x58a5('0x54')],'pTalking':_0x3cbdea[_0x58a5('0x55')],'sumBillable':_0x3cbdea[_0x58a5('0x56')],'sumDuration':_0x3cbdea[_0x58a5('0x57')],'sumHoldTime':_0x3cbdea[_0x58a5('0x58')]||0x0,'talking':_0x3cbdea[_0x58a5('0x59')],'total':_0x3cbdea['total'],'type':_0x3cbdea[_0x58a5('0x51')],'unmanaged':_0x3cbdea['unmanaged'],'abandoned':_0x3cbdea[_0x58a5('0x5a')],'waiting':_0x3cbdea[_0x58a5('0x5b')],'loggedInDb':_0x3cbdea[_0x58a5('0x5c')],'dialActive':_0x3cbdea[_0x58a5('0x5d')],'dialMethod':_0x3cbdea['dialMethod'],'dialOriginateCallerIdName':_0x3cbdea['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3cbdea[_0x58a5('0x5e')],'dialOriginateTimeout':_0x3cbdea[_0x58a5('0x5f')],'dialPrefix':_0x3cbdea[_0x58a5('0x60')],'outboundAnswerAgiCallsDay':_0x3cbdea['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3cbdea['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3cbdea['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3cbdea[_0x58a5('0x61')],'outboundCongestionCallsDay':_0x3cbdea[_0x58a5('0x62')],'outboundDropCallsDayACS':_0x3cbdea['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cbdea[_0x58a5('0x63')],'outboundDropCallsDayTimeout':_0x3cbdea[_0x58a5('0x64')],'outboundNoAnswerCallsDay':_0x3cbdea[_0x58a5('0x65')],'outboundNoSuchCallsDay':_0x3cbdea[_0x58a5('0x66')],'outboundOriginateFailureCallsDay':_0x3cbdea[_0x58a5('0x67')],'outboundReCallsDay':_0x3cbdea[_0x58a5('0x68')],'outboundRejectCallsDay':_0x3cbdea[_0x58a5('0x69')],'outboundUnknownCallsDay':_0x3cbdea[_0x58a5('0x6a')],'predictiveIntervalAnsweredCalls':_0x3cbdea[_0x58a5('0x6b')],'predictiveIntervalAvgHoldtime':_0x3cbdea['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3cbdea[_0x58a5('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x3cbdea[_0x58a5('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x3cbdea[_0x58a5('0x6e')],'predictiveIntervalErlangCalls':_0x3cbdea['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3cbdea[_0x58a5('0x6f')],'predictiveIntervalHitRate':_0x3cbdea[_0x58a5('0x70')],'predictiveIntervalMultiplicativeFactor':_0x3cbdea[_0x58a5('0x71')],'predictiveIntervalPauses':_0x3cbdea[_0x58a5('0x72')],'predictiveIntervalAvailable':_0x3cbdea[_0x58a5('0x73')],'predictiveIntervalTotalCalls':_0x3cbdea[_0x58a5('0x74')],'message':_0x3cbdea['message'],'originated':_0x3cbdea[_0x58a5('0x75')],'erlangCalls':_0x3cbdea[_0x58a5('0x76')],'erlangCallToSecond':_0x3cbdea[_0x58a5('0x77')],'erlangAbandonmentRate':_0x3cbdea[_0x58a5('0x78')],'erlangBusyFactor':_0x3cbdea[_0x58a5('0x79')],'startPredictive':_0x3cbdea[_0x58a5('0x7a')],'startProgressive':_0x3cbdea[_0x58a5('0x2c')]};if(_0x3cbdea[_0x58a5('0x7b')]){_0x135915[_0x58a5('0x7b')]={'id':_0x3cbdea[_0x58a5('0x7b')]['id'],'name':_0x3cbdea[_0x58a5('0x7b')][_0x58a5('0x44')],'active':_0x3cbdea[_0x58a5('0x7b')]['active'],'callerid':_0x3cbdea[_0x58a5('0x7b')][_0x58a5('0x7c')]};}if(_0x3cbdea[_0x58a5('0x47')]){_0x135915['Interval']={'id':_0x3cbdea[_0x58a5('0x47')]['id'],'name':_0x3cbdea[_0x58a5('0x47')][_0x58a5('0x44')]};}var _0x381426=md5(JSON[_0x58a5('0x7d')](_0x135915));if(_0x3cbdea[_0x58a5('0x5')]!==_0x381426){_0x3cbdea['md5']=_0x381426;emit(util[_0x58a5('0x7e')](_0x58a5('0x7f'),_0x135915[_0x58a5('0x44')]),_0x58a5('0x80'),_0x135915);}}}function emitCampaignSummary(_0x2a2bd1){if(_0x2a2bd1[_0x58a5('0x51')]===_0x58a5('0x81')){emit(util['format'](_0x58a5('0x82'),_0x2a2bd1['name']),_0x58a5('0x83'),_0x2a2bd1);}}function checkGetDataPredictive(_0x266a78){if(isNotNull(_0x266a78)&&!_[_0x58a5('0x84')](_0x266a78)){loggerPredictive['info'](_0x58a5('0x85'));loggerPredictive['info'](_0x58a5('0x86'),_0x266a78[_0x58a5('0x74')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6b')]);loggerPredictive[_0x58a5('0x87')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6e')]);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x88'),_0x266a78[_0x58a5('0x6d')]);loggerPredictive[_0x58a5('0x87')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6c')]);loggerPredictive[_0x58a5('0x87')]('---------------------------');if(_0x266a78['predictiveIntervalTotalCalls']>0x0){if(!_[_0x58a5('0x41')](_0x266a78[_0x58a5('0x6c')])&&_0x266a78[_0x58a5('0x6c')]>0x0){return!![];}loggerPredictive[_0x58a5('0x87')](_0x58a5('0x89'));if(!_[_0x58a5('0x41')](_0x266a78['predictiveIntervalAvgHoldtime'])&&_0x266a78['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8a'));}else{loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8b'));}}else{loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8c'));}return![];}function mergeDataErlangB(_0x399ff6){return function(_0x49f66f){loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8d'));loggerPredictive['info'](_0x58a5('0x8e'),_0x49f66f[_0x58a5('0x76')]);loggerPredictive['info'](_0x58a5('0x8f'),_0x49f66f[_0x58a5('0x77')]);loggerPredictive[_0x58a5('0x87')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f[_0x58a5('0x78')]);loggerPredictive[_0x58a5('0x87')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f['erlangBusyFactor']);loggerPredictive[_0x58a5('0x87')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f[_0x58a5('0x78')]);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x90'));_[_0x58a5('0x91')](_0x399ff6,_0x49f66f);};}function getDiff(_0x53bd51){var _0x2b6672=moment()[_0x58a5('0x4d')](0x0);var _0x1af2de=moment(_0x53bd51)[_0x58a5('0x4d')](0x0);return _0x2b6672[_0x58a5('0x4e')](_0x1af2de,_0x58a5('0x4f'));}function ifInterval(_0x5b4a90,_0x49621d){if(_[_0x58a5('0x41')](_0x49621d)){return![];}return getDiff(_0x49621d)<_0x5b4a90*0x3c;}function freeVariablesPredictive(_0x12d43e){if(isNotNull(_0x12d43e)){if(!_[_0x58a5('0x41')](_0x12d43e[_0x58a5('0x2c')])){_0x12d43e[_0x58a5('0x2c')]=undefined;loggerPredictive['info'](_0x12d43e[_0x58a5('0x44')],_0x58a5('0x92'));}if(!_['isUndefined'](_0x12d43e[_0x58a5('0x7a')])){_0x12d43e[_0x58a5('0x7a')]=undefined;loggerPredictive[_0x58a5('0x87')](_0x12d43e['name'],_0x58a5('0x93'));}if(!_[_0x58a5('0x41')](_0x12d43e['handlePredictive'])){clearInterval(_0x12d43e['handlePredictive']);_0x12d43e[_0x58a5('0x94')]=undefined;loggerPredictive[_0x58a5('0x87')](_0x12d43e['name'],_0x58a5('0x95'));}}}function erlangb(_0x3bb87c,_0x19aa86){if(_0x19aa86===0x0){return 0x0;}var _0xcfea87=0x1;for(var _0x4f9b45=0x1;_0x4f9b45<=_0x19aa86;_0x4f9b45+=0x1){_0xcfea87=0x1+_0xcfea87*_0x4f9b45/_0x3bb87c;}return 0x1/_0xcfea87;}function isVoiceQueueOutbound(_0x455f2e){return _0x455f2e===_0x58a5('0x96');}function isNotPreview(_0x3d7030){return _0x3d7030!==_0x58a5('0x23');}function isCampaignIvr(_0x225866){return _0x225866===_0x58a5('0x81');}function getCallerId(_0x4fe8b9,_0x2ce6f1,_0x5d719d){if(!_[_0x58a5('0x41')](_0x5d719d)&&typeof _0x5d719d===_0x58a5('0x97')&&!_['isEmpty'](_0x5d719d)){if(!_[_0x58a5('0x41')](_0x2ce6f1)&&typeof _0x2ce6f1==='string'&&!_[_0x58a5('0x84')](_0x2ce6f1)){return util[_0x58a5('0x7e')](_0x58a5('0x98'),_0x2ce6f1,_0x5d719d);}return util[_0x58a5('0x7e')](_0x58a5('0x98'),_0x5d719d,_0x5d719d);}if(!_[_0x58a5('0x41')](_0x4fe8b9)&&typeof _0x4fe8b9===_0x58a5('0x97')&&!_[_0x58a5('0x84')](_0x4fe8b9)){return _0x4fe8b9;}return _0x58a5('0x99');}function loggerCatchQueueSummary(_0x1c0cd5,_0x150160){return function(_0x1a2af7){freeVariablesPredictive(_0x150160);emitVoiceQueueSummary(_0x150160);emitCampaignSummary(_0x150160);loggerSyncQueueSummary[_0x58a5('0x9a')](_0x1c0cd5,util[_0x58a5('0x9b')](_0x1a2af7,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f9ffa,_0xfdc5ac){return function(_0x132189){loggerPredictive['error'](_0xfdc5ac[_0x58a5('0x44')],_0x2f9ffa);loggerPredictive['error'](_0x132189[_0x58a5('0x9c')]);freeVariablesPredictive(_0xfdc5ac);};}function loggerCatch(_0x3ba9c1){return function(_0x48b0c1){logger['error'](_0x3ba9c1,util[_0x58a5('0x9b')](_0x48b0c1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xc6d36b){return _0xc6d36b&&!_['isUndefined'](_0xc6d36b)&&_0xc6d36b['length']>0x0;}function decremetOriginate(_0x1c16f6){if(!_[_0x58a5('0x41')](_0x1c16f6)&&_0x1c16f6!==null){if(typeof _0x1c16f6[_0x58a5('0x75')]!==_0x58a5('0x9d')){if(_0x1c16f6['originated']>0x0){_0x1c16f6[_0x58a5('0x75')]-=0x1;}else{logger[_0x58a5('0x9a')](_0x58a5('0x9e'));}}}else{logger[_0x58a5('0x9a')](_0x58a5('0x9f'));}}function checkContactLowerLimitOriginate(_0x34b372,_0x3be9bb,_0x59430d){if(_0x3be9bb>_0x59430d){for(var _0x432ba8=0x0;_0x432ba8<_0x3be9bb-_0x59430d;_0x432ba8+=0x1){decremetOriginate(_0x34b372);}}}function loggerGetContactDialer(_0x5d85ce,_0x4688c8,_0x12263f){return function(_0x8994b){checkContactLowerLimitOriginate(_0x4688c8,_0x12263f,0x0);logger[_0x58a5('0x9a')](_0x5d85ce,util[_0x58a5('0x9b')](_0x8994b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5ae32a){return function(_0x5ed013){if(isNotNull(_0x5ed013)&&isNotNull(_0x5ed013[0x0])){if(_0x5ed013[0x0][_0x58a5('0xa0')]>0x0){_0x5ae32a[_0x58a5('0x42')]=_0x58a5('0xa1');logger[_0x58a5('0x87')]('[getContactDialer2][ReScheduled]'+_0x5ae32a[_0x58a5('0x44')],_0x5ed013[0x0][_0x58a5('0xa0')],'contacts');}else{_0x5ae32a[_0x58a5('0x42')]=_0x58a5('0xa2');logger[_0x58a5('0x87')](_0x58a5('0xa3')+_0x5ae32a[_0x58a5('0x44')]);}}};}function notSendMessagesQueue(_0x19eb07){if(_0x19eb07[_0x58a5('0xa4')]){freeVariablesPredictive(_0x19eb07);if(_0x19eb07[_0x58a5('0x75')]===0x0&&_0x19eb07[_0x58a5('0x59')]===0x0&&_0x19eb07[_0x58a5('0x5b')]===0x0&&(_0x19eb07[_0x58a5('0x55')]||0x0)===0x0){_0x19eb07[_0x58a5('0xa4')]=![];_0x19eb07[_0x58a5('0x53')]=0x0;_0x19eb07[_0x58a5('0x42')]=_0x58a5('0x45');loggerSyncQueueSummary[_0x58a5('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x19eb07[_0x58a5('0x44')],_0x58a5('0xa5'));}else{_0x19eb07[_0x58a5('0x42')]=_0x58a5('0xa6');loggerSyncQueueSummary['error'](_0x58a5('0xa7'),_0x19eb07[_0x58a5('0x44')],'is\x20disactive');}emitVoiceQueueSummary(_0x19eb07);}}function notSendMessagesCampaign(_0x23ee41){if(_0x23ee41[_0x58a5('0xa4')]){if(_0x23ee41['originated']===0x0){_0x23ee41[_0x58a5('0xa4')]=![];_0x23ee41[_0x58a5('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x58a5('0x9a')](_0x58a5('0xa8'),_0x23ee41[_0x58a5('0x44')],'is\x20not\x20active');}else{_0x23ee41[_0x58a5('0x42')]=_0x58a5('0xa6');loggerSyncQueueSummary[_0x58a5('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x23ee41[_0x58a5('0x44')],'is\x20disactive');}emitCampaignSummary(_0x23ee41);}}function createObjHistory(_0x28d3a9,_0x44ed56,_0x58e9ac,_0x1fea06,_0xe0f6a5){_0x28d3a9[_0x58a5('0x42')]=_0x58e9ac;var _0x56df94=new Action(_0x28d3a9,_0x44ed56);var _0x2bc036=new History(_0x56df94);_0x2bc036[_0x58a5('0xa9')]=_0x1fea06;_0x2bc036[_0x58a5('0xaa')]=_0xe0f6a5;_0x2bc036[_0x58a5('0xab')]=_0x56df94[_0x58a5('0xac')];return _0x2bc036;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0xc535d2=this;setInterval(function(){_0xc535d2[_0x58a5('0xad')](_0xc535d2[_0x58a5('0x2a')],_0x58a5('0xae'));_0xc535d2[_0x58a5('0xad')](_0xc535d2['actions'],_0x58a5('0xaf'));},0x32c8);};Dialer[_0x58a5('0x1e')][_0x58a5('0xad')]=function(_0x4c3fe8,_0x3649ce){var _0x1ef39e=this;for(var _0x135073 in _0x4c3fe8){if(typeof _0x4c3fe8[_0x135073]!=='undefined'){this[_0x58a5('0x22')]['enqueue'](function(){if(!_['isNil'](_0x4c3fe8[_0x135073])){return ami[_0x58a5('0xb0')]({'action':'status','channel':_0x4c3fe8[_0x135073][_0x58a5('0xb1')]})['catch'](function(_0x1dcbfa){if(_0x1dcbfa[_0x58a5('0x42')]===_0x58a5('0xb2')){setTimeout(function(){if(_0x4c3fe8[_0x135073]&&_0x4c3fe8[_0x135073][_0x58a5('0x51')]!=='ivr'){_0x1ef39e[_0x58a5('0xb3')](_0x1ef39e[_0x58a5('0x24')][_0x4c3fe8[_0x135073][_0x58a5('0xb4')]]);logger[_0x58a5('0x9a')]('[Dialer][checkChannel]',_0x3649ce,_0x135073,_0x4c3fe8[_0x135073]['queue']);delete _0x4c3fe8[_0x135073];}if(_0x4c3fe8[_0x135073]&&_0x4c3fe8[_0x135073][_0x58a5('0x51')]===_0x58a5('0x81')){_0x1ef39e['updateOriginated'](_0x1ef39e[_0x58a5('0x25')][_0x4c3fe8[_0x135073][_0x58a5('0xb4')]]);logger[_0x58a5('0x9a')]('[Dialer][checkChannel][ivr]',_0x3649ce,_0x135073,_0x4c3fe8[_0x135073][_0x58a5('0xb4')]);delete _0x4c3fe8[_0x135073];}},0x2328);}});}});}}};Dialer[_0x58a5('0x1e')][_0x58a5('0xb5')]=function(_0x5b201f){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xb5')](_0x5b201f))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xb9')));};Dialer[_0x58a5('0x1e')]['checkIsBlackList']=function(_0x390c28){return BPromise['resolve']()[_0x58a5('0xb7')](cmHopperBlack[_0x58a5('0xba')](_0x390c28))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xbb')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xbc')]=function(_0x9e9861){return BPromise['resolve']()['then'](cmHopperBlack[_0x58a5('0xbc')](_0x9e9861))[_0x58a5('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x58a5('0xbd')]=function(_0x2318be){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopperHistory[_0x58a5('0xbe')](_0x2318be))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xbf')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xc0')]=function(_0x32c9f1){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc0')](_0x32c9f1))[_0x58a5('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x58a5('0xc1')]=function(_0x1d9523,_0x4dff37,_0x484f0d){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0x1d9523,_0x4dff37,_0x484f0d))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xc2')));};Dialer['prototype'][_0x58a5('0xc3')]=function(_0x47b75c,_0x15d04a,_0x443899,_0x5be114,_0x3824d2){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc3')](_0x47b75c,_0x15d04a,_0x443899,_0x5be114))[_0x58a5('0xb8')](function(_0x22c08d){_0x3824d2['temp']-=_0x443899;_0x3824d2[_0x58a5('0xc4')]=_0x3824d2['temp']>0x0?_0x3824d2[_0x58a5('0xc4')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x22c08d);});};Dialer[_0x58a5('0x1e')][_0x58a5('0xc5')]=function(_0xe35124,_0x3db109,_0x4172e0,_0x4a5d4b){return BPromise[_0x58a5('0xb6')]()['then'](cmHopper[_0x58a5('0xc5')](_0xe35124,_0x3db109,_0x4172e0))[_0x58a5('0xb8')](function(_0x589979){_0x4a5d4b[_0x58a5('0xc4')]-=_0x3db109;_0x4a5d4b[_0x58a5('0xc4')]=_0x4a5d4b[_0x58a5('0xc4')]>0x0?_0x4a5d4b[_0x58a5('0xc4')]:0x0;loggerCatch(_0x58a5('0xc6'))(_0x589979);});};Dialer[_0x58a5('0x1e')]['getVoiceQueueRtPauses']=function(_0x1244d4){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](voiceQueueRt[_0x58a5('0xc7')](_0x1244d4))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xc8')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xc9')]=function(_0x2c9ca4){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc9')](_0x2c9ca4))[_0x58a5('0xb8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x58a5('0x1e')][_0x58a5('0xca')]=function(_0x3aa8da){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopperHistory[_0x58a5('0xca')](_0x3aa8da))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xcb')));};Dialer['prototype'][_0x58a5('0xb3')]=function(_0x5ba77f){if(!_[_0x58a5('0x41')](_0x5ba77f)&&_0x5ba77f!==null){if(typeof _0x5ba77f[_0x58a5('0x75')]!=='undefined'){if(_0x5ba77f['originated']>0x0){_0x5ba77f[_0x58a5('0x75')]-=0x1;}else{logger[_0x58a5('0x9a')](_0x58a5('0xcc'));}}}else{logger[_0x58a5('0x9a')](_0x58a5('0xcd'));}};Dialer[_0x58a5('0x1e')][_0x58a5('0xce')]=function(_0x583322,_0x126166){var _0x58b42b=this;return function(_0x579114){_0x58b42b[_0x58a5('0xb3')](_0x126166);logger[_0x58a5('0x9a')](_0x583322,util['inspect'](_0x579114,{'showHidden':![],'depth':null}));};};Dialer[_0x58a5('0x1e')][_0x58a5('0xcf')]=function(_0xa7b938,_0x1ffd17,_0x40fea9){var _0x1a8bb5={'state':0x19,'statedesc':_0x58a5('0xd0')};this[_0x58a5('0xb3')](_0x1ffd17);this['saveInDb'](_[_0x58a5('0x91')](_0x1a8bb5,_[_0x58a5('0xd1')](_0x40fea9,[_0x58a5('0xd2'),_0x58a5('0xd3'),_0x58a5('0xd4'),'VoiceQueueId',_0x58a5('0xd5')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x58a5('0x9a')](_0xa7b938);};Dialer[_0x58a5('0x1e')][_0x58a5('0xd6')]=function(_0x555dbb){return _0x555dbb==='Success';};Dialer['prototype'][_0x58a5('0xd7')]=function(_0x266c1e){return!_[_0x58a5('0x41')](_0x266c1e)&&_0x266c1e&&!_[_0x58a5('0x41')](_0x266c1e[_0x58a5('0x44')])&&!_[_0x58a5('0x41')](_0x266c1e[_0x58a5('0xd8')])&&_0x266c1e['active']&&(this[_0x58a5('0xd9')][util['format'](_0x58a5('0xda'),_0x266c1e[_0x58a5('0x44')])][_0x58a5('0xdb')]===_0x58a5('0xdc')||this['trunks'][util[_0x58a5('0x7e')](_0x58a5('0xda'),_0x266c1e[_0x58a5('0x44')])][_0x58a5('0xdb')]===_0x58a5('0xdd'));};Dialer[_0x58a5('0x1e')][_0x58a5('0xde')]=function(_0x133d4f,_0x5ddb24,_0x2dc6c7){this[_0x58a5('0xca')](_0x133d4f)['catch'](loggerCatch(_0x5ddb24));this[_0x58a5('0xc9')](_0x133d4f)['catch'](loggerCatch(_0x2dc6c7));};Dialer[_0x58a5('0x1e')][_0x58a5('0xdf')]=function(_0x11d4e8){var _0x21eb31=this[_0x58a5('0x2a')][_0x11d4e8[_0x58a5('0xe0')]];var _0x324cb7;if(!_[_0x58a5('0xe1')](_0x11d4e8)&&!_[_0x58a5('0xe1')](_0x11d4e8[_0x58a5('0xe2')])&&!_[_0x58a5('0xe1')](_0x11d4e8[_0x58a5('0xe2')][_0x58a5('0xe3')])&&_0x11d4e8[_0x58a5('0xe4')]==='xcally-motion-dialer'&&_0x21eb31){if(_0x21eb31[_0x58a5('0x51')]!==_0x58a5('0x81')&&this[_0x58a5('0x24')][_0x21eb31['queue']][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xe7')){delete this['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]);this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;this['voiceQueues'][_0x21eb31['queue']][_0x58a5('0xe9')]+=0x1;_0x324cb7=new Hangup(_0x21eb31,_0x11d4e8);_0x324cb7[_0x58a5('0xa9')]=0x12;_0x324cb7[_0x58a5('0xaa')]=_0x58a5('0xea');_0x324cb7[_0x58a5('0xeb')]=_0x58a5('0xec');ami[_0x58a5('0x50')](_0x58a5('0xed'),ut['buildObj'](_0x324cb7,_0x58a5('0xee')));this['saveInDb'](_0x324cb7,_0x58a5('0xef'),_0x58a5('0xf0'));}if(_0x21eb31[_0x58a5('0x51')]!==_0x58a5('0x81')&&this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xf1')){var _0x8fd0ee=this;return new BPromise(function(_0x54462e,_0x3b9e4c){delete _0x8fd0ee['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];_0x8fd0ee[_0x58a5('0xb3')](_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]);_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe9')]+=0x1;var _0x23c082=_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]];var _0x1daa00=new Hangup(_0x21eb31,_0x11d4e8);_0x1daa00[_0x58a5('0xa9')]=0x13;_0x1daa00[_0x58a5('0xaa')]=_0x58a5('0xf2');_0x1daa00[_0x58a5('0xeb')]=_0x58a5('0xec');_0x1daa00[_0x58a5('0xf3')]+=0x1;_0x1daa00[_0x58a5('0xf4')]+=0x1;_0x1daa00[_0x58a5('0xee')]=!![];ami[_0x58a5('0x50')](_0x58a5('0xed'),ut[_0x58a5('0xf5')](_0x1daa00,_0x58a5('0xee')));_0x8fd0ee[_0x58a5('0xca')](_0x1daa00)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1daa00['countbusyretry']+_0x1daa00[_0x58a5('0xf6')]+_0x1daa00[_0x58a5('0xf7')]+_0x1daa00[_0x58a5('0xf8')]+_0x1daa00[_0x58a5('0xf9')]+_0x1daa00[_0x58a5('0xfa')]+_0x1daa00[_0x58a5('0xf3')]+_0x1daa00[_0x58a5('0xfb')]>=_0x23c082[_0x58a5('0xfc')]){_0x8fd0ee[_0x58a5('0xfd')](_0x1daa00,_0x54462e,_0x3b9e4c,'reason19\x20machine....');}else{if(_0x1daa00['countmachineretry']>=_0x23c082[_0x58a5('0xfe')]){_0x8fd0ee['createStateFinal'](_0x1daa00,_0x54462e,_0x3b9e4c,'reason\x2019\x20machine....');}else{_0x8fd0ee[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x1daa00[_0x58a5('0xf3')],'scheduledat':moment()[_0x58a5('0xff')](_0x23c082['dialMachineRetryFrequency'],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x1daa00[_0x58a5('0xd2')],'ListId':_0x1daa00[_0x58a5('0xd3')],'VoiceQueueId':_0x1daa00[_0x58a5('0x102')]||undefined,'CampaignId':_0x1daa00[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x54462e({'reschedule':0x1});}}});}if(_0x21eb31[_0x58a5('0x51')]===_0x58a5('0x81')&&this[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xe7')){delete this['uniqueId'][_0x11d4e8['uniqueid']];this['updateOriginated'](this[_0x58a5('0x25')][_0x21eb31['queue']]);_0x324cb7=new Hangup(_0x21eb31,_0x11d4e8);_0x324cb7[_0x58a5('0xa9')]=0x12;_0x324cb7['statedesc']=_0x58a5('0xea');_0x324cb7[_0x58a5('0xeb')]=_0x58a5('0xec');ami[_0x58a5('0x50')]('custom:amd',ut[_0x58a5('0xf5')](_0x324cb7,_0x58a5('0xee')));this[_0x58a5('0xde')](_0x324cb7,'[syncHangupInAMDIvr][createHistory]',_0x58a5('0x103'));}if(_0x21eb31[_0x58a5('0x51')]===_0x58a5('0x81')&&this[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]]['dialAMDActive']&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xf1')){var _0x8fd0ee=this;return new BPromise(function(_0x5d91e4,_0x4a6a14){delete _0x8fd0ee['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];_0x8fd0ee[_0x58a5('0xb3')](_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]]);_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe9')]+=0x1;var _0x43b6a7=_0x8fd0ee[_0x58a5('0x25')][_0x21eb31['queue']];var _0x1c501f=new Hangup(_0x21eb31,_0x11d4e8);_0x1c501f[_0x58a5('0xa9')]=0x13;_0x1c501f[_0x58a5('0xaa')]=_0x58a5('0xf2');_0x1c501f[_0x58a5('0xeb')]=_0x58a5('0xec');_0x1c501f[_0x58a5('0xf3')]+=0x1;_0x1c501f['countglobal']+=0x1;_0x1c501f['amd']=!![];ami[_0x58a5('0x50')](_0x58a5('0xed'),ut['buildObj'](_0x1c501f,_0x58a5('0xee')));_0x8fd0ee[_0x58a5('0xca')](_0x1c501f)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x104')));if(_0x1c501f[_0x58a5('0x105')]+_0x1c501f[_0x58a5('0xf6')]+_0x1c501f[_0x58a5('0xf7')]+_0x1c501f[_0x58a5('0xf8')]+_0x1c501f[_0x58a5('0xf9')]+_0x1c501f[_0x58a5('0xfa')]+_0x1c501f['countmachineretry']+_0x1c501f[_0x58a5('0xfb')]>=_0x43b6a7[_0x58a5('0xfc')]){_0x8fd0ee['stateGlobal'](_0x1c501f,_0x5d91e4,_0x4a6a14,_0x58a5('0x106'));}else{if(_0x1c501f[_0x58a5('0xf3')]>=_0x43b6a7['dialMachineMaxRetry']){_0x8fd0ee[_0x58a5('0x107')](_0x1c501f,_0x5d91e4,_0x4a6a14,_0x58a5('0x108'));}else{_0x8fd0ee[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x1c501f[_0x58a5('0xf3')],'scheduledat':moment()[_0x58a5('0xff')](_0x43b6a7['dialMachineRetryFrequency'],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x1c501f['ContactId'],'ListId':_0x1c501f[_0x58a5('0xd3')],'VoiceQueueId':_0x1c501f[_0x58a5('0x102')]||undefined,'CampaignId':_0x1c501f[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x5d91e4({'reschedule':0x1});}}});}}};Dialer[_0x58a5('0x1e')][_0x58a5('0x109')]=function(_0x469edf){var _0x44ed6b=this[_0x58a5('0x2a')][_0x469edf['uniqueid']];var _0x461f2b=this;var _0x275e6a;if(_0x44ed6b&&_0x44ed6b['type']==='ivr'){delete this[_0x58a5('0x2a')][_0x469edf['uniqueid']];this[_0x58a5('0xb3')](this[_0x58a5('0x25')][_0x44ed6b['queue']]);this['campaigns'][_0x44ed6b[_0x58a5('0xb4')]][_0x58a5('0x10a')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);this[_0x58a5('0xca')](_0x275e6a)['catch'](loggerCatch(_0x58a5('0x10b')));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}if(_0x44ed6b&&_0x44ed6b['type']!==_0x58a5('0x81')&&isNotNull(this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0x10d')])){delete this['uniqueId'][_0x469edf[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x44ed6b[_0x58a5('0xb4')]]);this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0xe8')]+=0x1;this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0xe9')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);_0x275e6a[_0x58a5('0xa9')]=0x10;_0x275e6a[_0x58a5('0xaa')]=_0x58a5('0x10e');_0x275e6a[_0x58a5('0xeb')]='AGI';this['createHistory'](_0x275e6a)[_0x58a5('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}if(_0x44ed6b&&_0x44ed6b[_0x58a5('0x51')]!=='ivr'&&!isNotNull(this[_0x58a5('0x24')][_0x44ed6b['queue']]['dialQueueProject'])){delete this[_0x58a5('0x2a')][_0x469edf[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x44ed6b['queue']]);this['voiceQueues'][_0x44ed6b['queue']][_0x58a5('0x6a')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);_0x275e6a[_0x58a5('0xa9')]=0xc;_0x275e6a[_0x58a5('0xaa')]=_0x469edf[_0x58a5('0x10f')];_0x275e6a[_0x58a5('0xeb')]='Unknow';this[_0x58a5('0xca')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10b')));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}};Dialer['prototype'][_0x58a5('0x35')]=function(_0x1b69cb){var _0x3d88cb=this[_0x58a5('0x2a')][_0x1b69cb[_0x58a5('0xe0')]];var _0x3b31e1=this;if(this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]]){if(_0x3d88cb&&_0x3d88cb[_0x58a5('0x51')]!==_0x58a5('0x81')){delete this[_0x58a5('0x2a')][_0x1b69cb['uniqueid']];this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;var _0x459234=new AgentComplete(_0x3d88cb,_0x1b69cb);if(_0x1b69cb[_0x58a5('0x110')]===_0x58a5('0x111')){_0x459234[_0x58a5('0x112')]=this['voiceQueues'][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0x113')]&&this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0x114')]?moment()[_0x58a5('0x7e')](_0x58a5('0x101')):undefined;}this['createHistory'](_0x459234)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x115')));this[_0x58a5('0xc9')](_0x459234)[_0x58a5('0xb8')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x58a5('0x1e')]['syncAgentConnect']=function(_0x1cf422){if(this['voiceQueues'][_0x1cf422[_0x58a5('0xb4')]]){if(this['uniqueId'][_0x1cf422['uniqueid']]&&this[_0x58a5('0x2a')][_0x1cf422[_0x58a5('0xe0')]][_0x58a5('0x51')]!==_0x58a5('0x81')){this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x1cf422['queue']]);this[_0x58a5('0x2a')][_0x1cf422[_0x58a5('0xe0')]][_0x58a5('0x116')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));}}};Dialer[_0x58a5('0x1e')]['queueCallerAbandonCreateState']=function(_0x216d21){this['createHistory'](_0x216d21)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x115')));this[_0x58a5('0xc9')](_0x216d21)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x117')));};Dialer[_0x58a5('0x1e')]['syncQueueCallerAbandon']=function(_0xd9e8ce){var _0x129c81=this[_0x58a5('0x2a')][_0xd9e8ce[_0x58a5('0xe0')]];var _0x7f2e71=this;if(this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]){if(_0x129c81&&_0x129c81[_0x58a5('0x51')]!==_0x58a5('0x81')){delete this['uniqueId'][_0xd9e8ce[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]);_0x129c81['droptime']=moment()['format'](_0x58a5('0x101'));var _0x5528ee=new QueueCallerAbandon(_0x129c81,_0xd9e8ce);if(getSeconds(_0x129c81[_0x58a5('0x118')],_0x129c81[_0x58a5('0x119')])>=_0x129c81[_0x58a5('0x11a')]){this['voiceQueues'][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x6e')]+=0x1;this['voiceQueues'][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x64')]+=0x1;this[_0x58a5('0x24')][_0xd9e8ce['queue']][_0x58a5('0x6f')]+=0x1;_0x5528ee[_0x58a5('0xa9')]=0xa;_0x5528ee[_0x58a5('0xaa')]='Drop';_0x5528ee['dropreason']='TIMEOUT';_0x5528ee[_0x58a5('0x112')]=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x113')]?moment()[_0x58a5('0x7e')](_0x58a5('0x101')):undefined;_0x5528ee[_0x58a5('0xf9')]+=0x1;_0x5528ee[_0x58a5('0xf4')]+=0x1;if(_0x5528ee['countdropretry']>=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x11b')]){this[_0x58a5('0x11c')](_0x5528ee);}else{this[_0x58a5('0xc0')]({'active':![],'countdropretry':_0x5528ee[_0x58a5('0xf9')],'scheduledat':moment()[_0x58a5('0xff')](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x11d')],'minutes')['format'](_0x58a5('0x101')),'ContactId':_0x129c81[_0x58a5('0xd2')],'ListId':_0x129c81[_0x58a5('0xd3')],'VoiceQueueId':_0x129c81[_0x58a5('0x102')]||undefined,'CampaignId':_0x129c81[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x11e')));var _0x3d934b=new History(_0x5528ee);_0x3d934b[_0x58a5('0xa9')]=0xa;_0x3d934b[_0x58a5('0xaa')]=_0x58a5('0x11f');_0x3d934b['starttime']=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));_0x3d934b[_0x58a5('0xab')]=_0x3d934b[_0x58a5('0xac')];_0x3d934b[_0x58a5('0x120')]=_0x5528ee['calleridname'];_0x3d934b[_0x58a5('0x121')]=_0x5528ee['calleridnum'];this[_0x58a5('0xca')](_0x3d934b)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x122')));}}else{this[_0x58a5('0x24')][_0xd9e8ce['queue']][_0x58a5('0x6d')]+=0x1;this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x63')]+=0x1;_0x5528ee[_0x58a5('0xa9')]=0xb;_0x5528ee[_0x58a5('0xaa')]='Abandoned';_0x5528ee[_0x58a5('0x123')]=_0x58a5('0x124');_0x5528ee[_0x58a5('0xfa')]+=0x1;_0x5528ee[_0x58a5('0xf4')]+=0x1;if(_0x5528ee['countabandonedretry']>=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x125')]){this[_0x58a5('0x11c')](_0x5528ee);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x5528ee[_0x58a5('0xfa')],'scheduledat':moment()['add'](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]['dialAbandonedRetryFrequency'],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x129c81['ContactId'],'ListId':_0x129c81['ListId'],'VoiceQueueId':_0x129c81['VoiceQueueId']||undefined,'CampaignId':_0x129c81[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x126')));var _0x3d934b=new History(_0x5528ee);_0x3d934b[_0x58a5('0xa9')]=0xb;_0x3d934b[_0x58a5('0xaa')]=_0x58a5('0x127');_0x3d934b[_0x58a5('0xac')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));_0x3d934b['endtime']=_0x3d934b[_0x58a5('0xac')];_0x3d934b[_0x58a5('0x120')]=_0x5528ee[_0x58a5('0x120')];_0x3d934b[_0x58a5('0x121')]=_0x5528ee[_0x58a5('0x121')];this['createHistory'](_0x3d934b)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x128')));}}}}};Dialer[_0x58a5('0x1e')]['syncNewExten']=function(_0x514a06){if(this['actions'][_0x514a06[_0x58a5('0xe0')]]){this[_0x58a5('0x129')][_0x514a06[_0x58a5('0xe0')]]['channel']=_0x514a06[_0x58a5('0xb1')];}if(this['uniqueId'][_0x514a06[_0x58a5('0xe0')]]){this[_0x58a5('0x2a')][_0x514a06['uniqueid']][_0x58a5('0xb1')]=_0x514a06['channel'];}};Dialer[_0x58a5('0x1e')][_0x58a5('0x3c')]=function(_0xb23f2e){if(strategy[this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x52')]]===_0x58a5('0x12b')){if(this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]&&_[_0x58a5('0xe1')](this[_0x58a5('0x129')][_0xb23f2e['actionid']][_0x58a5('0x12c')])&&_0xb23f2e[_0x58a5('0xdb')]==='1'&&_0xb23f2e[_0x58a5('0x12d')]==='0'){if(this[_0x58a5('0x26')][_0xb23f2e[_0x58a5('0x12e')]]){if(!this[_0x58a5('0x26')][_0xb23f2e['stateinterface']][_0x58a5('0x12c')]){this[_0x58a5('0x26')][_0xb23f2e[_0x58a5('0x12e')]][_0x58a5('0x12c')]=!![];this['actions'][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0x12c')]=!![];this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]['stateinterface']=_0xb23f2e[_0x58a5('0x12e')];}}}}else if((strategy[this['voiceQueues'][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]]['strategy']]||'rrmemory')===_0x58a5('0x12f')){if(this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]){if(this['agents'][_0xb23f2e[_0x58a5('0x12e')]]){this['actions'][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0x12e')]=_0xb23f2e[_0x58a5('0x12e')];if(_['isNil'](this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e['actionid']][_0x58a5('0xb4')]])){this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]]=[];}this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x130')](_['merge'](_[_0x58a5('0xd1')](this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]],[_0x58a5('0x131'),_0x58a5('0x12e')]),{'status':_0xb23f2e[_0x58a5('0xdb')],'paused':_0xb23f2e[_0x58a5('0x12d')]}));}}}};function unlockQueueStatus(_0x510a9f,_0x11b21e){setTimeout(function(){if(_[_0x58a5('0x41')](_0x510a9f[_0x58a5('0x132')])){loggerBooked[_0x58a5('0x9a')](_0x58a5('0x133'),_0x11b21e);}_0x510a9f['queueStatusComplete']=!![];loggerBooked[_0x58a5('0x87')]('[booked][unlockQueueStatus]',_0x11b21e,JSON[_0x58a5('0x7d')](_[_0x58a5('0xd1')](_0x510a9f,[_0x58a5('0x44'),_0x58a5('0x132')])));},0x1f3);}Dialer[_0x58a5('0x1e')][_0x58a5('0x3e')]=function(_0x5e4d9a){var _0x5a8b52=this;var _0x8d35a=_0x5a8b52[_0x58a5('0x24')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']];if(strategy[this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']][_0x58a5('0x52')]]==='roundrobin'){if(this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]&&this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x12e')]){this['preview'][_0x58a5('0x134')](this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['idHopper'],this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x12e')])[_0x58a5('0xb8')](function(_0x3e3da5){logger['error'](_0x58a5('0x135'),util[_0x58a5('0x9b')](_0x3e3da5,{'showHidden':![],'depth':null}));})[_0x58a5('0x21')](function(){_0x5a8b52[_0x58a5('0xb3')](_0x5a8b52[_0x58a5('0x24')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);_0x5a8b52[_0x58a5('0x26')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0x12e')]][_0x58a5('0x12c')]=![];delete _0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);});}else{this['updateOriginated'](this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);this[_0x58a5('0xc0')]({'active':![],'ContactId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd2')],'ListId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['ListId'],'VoiceQueueId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x102')]||undefined,'CampaignId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x136')));delete this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);}}else if((strategy[this['voiceQueues'][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x52')]]||_0x58a5('0x12f'))===_0x58a5('0x12f')){var _0x22c1a0;if(this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]&&!_[_0x58a5('0x84')](this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]])){if(this[_0x58a5('0x2f')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]){this['queueBookedRR'][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]=this[_0x58a5('0x2f')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]?this['queueBookedRR'][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]:this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]?this['queueBooked'][this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['queue']]['_rr']||0x0:0x0;}this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]['_rr']=this['queueBookedRR'][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]];for(var _0x57039a=0x0;_0x57039a=0x0;})[_0x58a5('0xb8')](myreject(_0x3ce27a)));}}else{_0x5deda5['push'](ami[_0x58a5('0xb0')]({'action':_0x58a5('0x14d'),'command':util[_0x58a5('0x7e')](_0x58a5('0x14e'),_0x49bc0b,!_[_0x58a5('0x41')](config[_0x58a5('0x150')][_0x2f8da1])?_0x2f8da1:'')})[_0x58a5('0xb7')](function(_0x590ff6){return _0x590ff6['content'][_0x58a5('0x151')](_0x58a5('0x152'))>=0x0;})[_0x58a5('0xb8')](myreject(_0x3ce27a)));}BPromise['all'](_0x5deda5)[_0x58a5('0xb7')](function(_0x40087d){var _0x182f3a=_[_0x58a5('0x153')](_0x40087d);if(_0x182f3a){return _0x46510a(_0x182f3a);}else{_0x3f00fe[_0x58a5('0x42')]=_0x32c14a?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x3ce27a(msgResponse(_0x58a5('0x154'),_0x58a5('0x148'),_0x58a5('0x155')+_0x32c14a+'\x20'+_0x58092b+_0x58a5('0x156')+util[_0x58a5('0x9b')](_0x49bc0b,{'showHidden':![],'depth':null})+_0x58a5('0x157')+_0x2f8da1));}})['catch'](function(_0x3c8faf){return _0x3ce27a(msgResponse(_0x58a5('0x146'),_0x58a5('0x148'),JSON['stringify'](_0x3c8faf)));});});};Dialer[_0x58a5('0x1e')][_0x58a5('0x158')]=function(_0x10f318){var _0xfda9c=this;return function(){switch(_0x10f318['dialMethod']){case'progressive':freeVariablesPredictive(_0x10f318);_0xfda9c[_0x58a5('0x159')](_0x10f318,0x1);break;case'power':freeVariablesPredictive(_0x10f318);_0xfda9c['handlePower'](_0x10f318,_0x10f318[_0x58a5('0x15a')]);break;case _0x58a5('0xb'):_0xfda9c[_0x58a5('0xb')](_0x10f318);break;case'booked':freeVariablesPredictive(_0x10f318);_0xfda9c['handlePower'](_0x10f318,0x1);break;default:freeVariablesPredictive(_0x10f318);logger[_0x58a5('0x9a')](_0x58a5('0x15b'),_0x10f318[_0x58a5('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x58a5('0x1e')][_0x58a5('0x15c')]=function(_0x229e05){var _0x4a316c=this;return function(){_0x4a316c[_0x58a5('0x15d')](_0x229e05);};};Dialer['prototype'][_0x58a5('0x37')]=function(_0x2404d1){var _0x26ad43=this;if(isNotPreview(_0x2404d1[_0x58a5('0x15e')])){if(isVoiceQueueOutbound(_0x2404d1[_0x58a5('0x51')])&&isActive(_0x2404d1[_0x58a5('0x5d')])){_0x2404d1[_0x58a5('0xa4')]=!![];BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](checkIsLoggedIn(_0x2404d1,_0x2404d1[_0x58a5('0x54')]))[_0x58a5('0xb7')](checkIsActive(_0x2404d1,_0x2404d1['dialActive']))[_0x58a5('0xb7')](checkInterval(_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x142')](_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x145')](_0x2404d1[_0x58a5('0x15f')],_0x2404d1[_0x58a5('0x160')],_0x2404d1[_0x58a5('0x44')],_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x147')](_0x2404d1['Interval'],_0x2404d1[_0x58a5('0x160')],_0x2404d1[_0x58a5('0x44')],_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x158')](_0x2404d1))[_0x58a5('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x2404d1));}else{notSendMessagesQueue(_0x2404d1);}}else{freeVariablesPredictive(_0x2404d1);}};Dialer['prototype']['syncCampaigns']=function(){var _0x4f3244=this;var _0x4fda2f;for(var _0x25b526 in this[_0x58a5('0x25')]){if(typeof this[_0x58a5('0x25')][_0x25b526]!==_0x58a5('0x9d')){_0x4fda2f=this[_0x58a5('0x25')][_0x25b526];if(isCampaignIvr(_0x4fda2f[_0x58a5('0x51')])&&isActive(_0x4fda2f[_0x58a5('0xd8')])){_0x4fda2f[_0x58a5('0xa4')]=!![];BPromise['resolve']()[_0x58a5('0xb7')](checkIsActive(_0x4fda2f,_0x4fda2f['active']))['then'](checkInterval(_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244['checkIsTrunkReachable'](_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x145')](_0x4fda2f[_0x58a5('0x15f')],_0x4fda2f[_0x58a5('0x160')],_0x4fda2f['name'],_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x147')](_0x4fda2f[_0x58a5('0x47')],_0x4fda2f[_0x58a5('0x160')],_0x4fda2f[_0x58a5('0x44')],_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x15c')](_0x4fda2f))[_0x58a5('0xb8')](loggerCatchQueueSummary('[syncCampaigns]',_0x4fda2f));}else{notSendMessagesCampaign(_0x4fda2f);}}}};function getCallerIdRandom(_0x3c6bc1,_0x3057d3){var _0x2b7274;var _0x500c14;var _0x1fe743;if(_0x3057d3<=0x0){_0x3057d3=0x1;}_0x2b7274=new RegExp(_0x58a5('0x161')+_0x3057d3+'}$');_0x500c14=Math[_0x58a5('0x162')](0xa,_0x3057d3-0x1);_0x1fe743=Math[_0x58a5('0x162')](0xa,_0x3057d3)-0x1;return util[_0x58a5('0x7e')]('%s',_[_0x58a5('0x163')](_0x3c6bc1,_0x2b7274,_[_0x58a5('0x164')](_0x500c14,_0x1fe743)));}function extractCalleridName(_0x1bb051){var _0x3d1765=_0x1bb051[_0x58a5('0x165')](/"(.*?)"/);return _0x3d1765?_0x3d1765[0x1]:_0x1bb051;}function extractCalleridNumber(_0x236ba2){var _0x230f6a=_0x236ba2[_0x58a5('0x165')](/<(.*?)>/);return _0x230f6a?_0x230f6a[0x1]:_0x236ba2;}Dialer['prototype'][_0x58a5('0x166')]=function(_0x29c3d6,_0x5e07ea){var _0x249fbb=this;var _0x45ff80=uuid['v4']();this[_0x58a5('0x129')][_0x45ff80]=new Action(_0x29c3d6,_0x5e07ea,_0x45ff80);return new BPromise(function(_0x54aeda,_0x13b64d){if(_[_0x58a5('0x41')](_0x29c3d6)&&typeof _0x29c3d6!==_0x58a5('0x167')){return _0x13b64d(msgResponse(_0x58a5('0x168'),'Failure',_0x58a5('0x169')));}if(_[_0x58a5('0x41')](_0x5e07ea['Contact'][_0x58a5('0x16a')])||_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')]===null){return _0x13b64d(msgResponse('originate',_0x58a5('0x148'),_0x58a5('0x16c')));}var _0x5f1608={'XMD-CALLERID':_0x249fbb['actions'][_0x45ff80]['getCaller'](),'XMD-AGI':_0x29c3d6[_0x58a5('0x10d')]?util[_0x58a5('0x7e')](_0x58a5('0x16d'),ipAgi,_0x29c3d6['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x29c3d6[_0x58a5('0x113')]?util[_0x58a5('0x7e')](_0x58a5('0x16d'),ipAgi,_0x29c3d6[_0x58a5('0x113')]):'NONE','XMD-QUEUE':_0x29c3d6[_0x58a5('0x51')]===_0x58a5('0x96')?util[_0x58a5('0x7e')](_0x58a5('0x16e'),_0x29c3d6[_0x58a5('0x44')],_0x29c3d6[_0x58a5('0x16f')]||'',_0x29c3d6[_0x58a5('0x114')]?'c':'',_0x29c3d6[_0x58a5('0x11a')]||0x3):_0x58a5('0x170'),'XMD-CONTACTID':_0x5e07ea[_0x58a5('0xd2')],'XMD-CDRTYPE':_0x58a5('0x9'),'CALLERID(all)':_0x249fbb[_0x58a5('0x129')][_0x45ff80]['getCaller'](),'XMD-AMD':_0x29c3d6[_0x58a5('0xe5')]?_0x58a5('0x171'):_0x58a5('0x170'),'XMD-DESTINATION':_0x58a5('0x172')};if(_0x29c3d6[_0x58a5('0xe5')]){_0x5f1608[_0x58a5('0x173')]=_0x29c3d6[_0x58a5('0x174')]||0x9c4;_0x5f1608['XMD-AMDGREETING']=_0x29c3d6[_0x58a5('0x175')]||0x5dc;_0x5f1608[_0x58a5('0x176')]=_0x29c3d6['dialAMDAfterGreetingSilence']||0x320;_0x5f1608['XMD-AMDTOTALANALYSISTIME']=_0x29c3d6[_0x58a5('0x177')]||0x1388;_0x5f1608[_0x58a5('0x178')]=_0x29c3d6[_0x58a5('0x179')]||0x64;_0x5f1608[_0x58a5('0x17a')]=_0x29c3d6['dialAMDBetweenWordsSilence']||0x32;_0x5f1608[_0x58a5('0x17b')]=_0x29c3d6[_0x58a5('0x17c')]||0x3;_0x5f1608[_0x58a5('0x17d')]=_0x29c3d6[_0x58a5('0x17e')]||0x100;_0x5f1608[_0x58a5('0x17f')]=_0x29c3d6[_0x58a5('0x180')]||0x1388;}if(_0x29c3d6[_0x58a5('0x51')]===_0x58a5('0x96')){_0x5f1608[_0x58a5('0x181')]=_0x5e07ea[_0x58a5('0x102')];}else{_0x5f1608[_0x58a5('0x182')]=_0x5e07ea[_0x58a5('0xd5')];}for(var _0x56535a in _0x5e07ea[_0x58a5('0x16b')]){if(typeof _0x5e07ea[_0x58a5('0x16b')][_0x56535a]!==_0x58a5('0x9d')){if(isNotNull(_0x5e07ea[_0x58a5('0x16b')][_0x56535a])&&_0x56535a!=='id'&&_0x56535a!==_0x58a5('0x183')&&_0x56535a!=='createdAt'&&_0x56535a!==_0x58a5('0x184')){_0x5f1608[util[_0x58a5('0x7e')](_0x58a5('0x185'),_0x58a5('0x186'),_[_0x58a5('0x187')](_0x56535a))]=_0x5e07ea[_0x58a5('0x16b')][_0x56535a];}}}var _0x1fcc96=_0x249fbb['isTrunkReachable'](_0x29c3d6['Trunk'])?getCallerId(_0x29c3d6[_0x58a5('0x7b')]['callerid'],_0x29c3d6['dialOriginateCallerIdName'],_0x29c3d6[_0x58a5('0x188')]>0x0?getCallerIdRandom(_0x29c3d6[_0x58a5('0x5e')],_0x29c3d6[_0x58a5('0x188')]):_0x29c3d6['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x29c3d6[_0x58a5('0x143')])?_0x29c3d6[_0x58a5('0x7b')]['callerid']:_0x29c3d6[_0x58a5('0x143')][_0x58a5('0x7c')],_0x29c3d6[_0x58a5('0x189')],_0x29c3d6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x29c3d6[_0x58a5('0x5e')],_0x29c3d6[_0x58a5('0x188')]):_0x29c3d6[_0x58a5('0x5e')]);if(_0x1fcc96){_0x5f1608[_0x58a5('0x18a')]=_0x249fbb[_0x58a5('0x129')][_0x45ff80][_0x58a5('0x18b')]=extractCalleridName(_0x1fcc96);_0x5f1608[_0x58a5('0x18c')]=_0x249fbb[_0x58a5('0x129')][_0x45ff80][_0x58a5('0x18d')]=extractCalleridNumber(_0x1fcc96);}return ami[_0x58a5('0xb0')]({'actionid':_0x45ff80,'action':_0x58a5('0x168'),'channel':_0x249fbb[_0x58a5('0xd7')](_0x29c3d6[_0x58a5('0x7b')])?util[_0x58a5('0x7e')](_0x58a5('0x18e'),_0x29c3d6[_0x58a5('0x7b')][_0x58a5('0x44')],isNotNull(_0x29c3d6[_0x58a5('0x60')])?_0x29c3d6[_0x58a5('0x60')]['trim']()||'':'',_0x29c3d6['dialCutDigit']>0x0?_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')][_0x58a5('0x18f')](_0x29c3d6[_0x58a5('0x190')]):_0x5e07ea['Contact'][_0x58a5('0x16a')]):util['format'](_0x58a5('0x18e'),_[_0x58a5('0xe1')](_0x29c3d6[_0x58a5('0x143')])?_0x29c3d6[_0x58a5('0x7b')]['name']:_0x29c3d6[_0x58a5('0x143')][_0x58a5('0x44')],isNotNull(_0x29c3d6[_0x58a5('0x60')])?_0x29c3d6[_0x58a5('0x60')][_0x58a5('0x191')]()||'':'',_0x29c3d6['dialCutDigit']>0x0?_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')][_0x58a5('0x18f')](_0x29c3d6['dialCutDigit']):_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')]),'callerid':_0x1fcc96,'Exten':_0x58a5('0x172'),'Context':'from-sip','Priority':'1','variable':_0x5f1608,'timeout':(_0x29c3d6[_0x58a5('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45ff80})[_0x58a5('0xb7')](function(_0xf48aeb){return _0x54aeda(_0xf48aeb);})[_0x58a5('0xb8')](function(_0x3cfc43){_0x29c3d6['outboundOriginateFailureCallsDay']+=0x1;var _0x275622=new History(_0x249fbb[_0x58a5('0x129')][_0x45ff80]);logger[_0x58a5('0x9a')](util['format'](_0x58a5('0x192'),JSON[_0x58a5('0x7d')](_0x3cfc43)));_0x275622[_0x58a5('0xa9')]=0xe;_0x275622[_0x58a5('0xaa')]=_0x58a5('0x193');_0x275622['starttime']=moment()['format'](_0x58a5('0x101'));_0x275622[_0x58a5('0xab')]=_0x275622[_0x58a5('0xac')];_0x249fbb[_0x58a5('0xca')](_0x275622)['catch'](loggerCatch(_0x58a5('0x194')));_0x249fbb[_0x58a5('0xc9')](_0x275622)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x194')))[_0x58a5('0x21')](function(){delete _0x249fbb[_0x58a5('0x129')][_0x45ff80];return _0x13b64d(msgResponse(_0x58a5('0x168'),_0x58a5('0x4c'),_0x58a5('0x195')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x2795f5){var _0x2a1733=this[_0x58a5('0x129')][_0x2795f5['actionid']];if(_0x2a1733){delete this[_0x58a5('0x129')][_0x2795f5[_0x58a5('0x12a')]];_0x2a1733[_0x58a5('0x119')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x120ca1=_0x2a1733['type']===_0x58a5('0x81')?this[_0x58a5('0x25')][_0x2a1733['queue']]:this[_0x58a5('0x24')][_0x2a1733[_0x58a5('0x196')]()];if(!this['isSuccess'](_0x2795f5[_0x58a5('0x197')])){this[_0x58a5('0xb3')](_0x120ca1);return this[_0x58a5('0x198')](_0x2a1733,_0x120ca1,_0x2795f5)['catch'](loggerCatch(_0x58a5('0x199')));}this[_0x58a5('0x2a')][_0x2795f5[_0x58a5('0xe0')]]=_0x2a1733;}};Dialer[_0x58a5('0x1e')][_0x58a5('0x19a')]=function(_0x2d39a8,_0x246c42,_0x5cb7c5){var _0x2fcce9=new History(_0x246c42);if(_0x2fcce9['countbusyretry']+_0x2fcce9['countcongestionretry']+_0x2fcce9[_0x58a5('0xf7')]+_0x2fcce9[_0x58a5('0xf8')]+_0x2fcce9[_0x58a5('0xf9')]+_0x2fcce9[_0x58a5('0xfa')]+_0x2fcce9[_0x58a5('0xf3')]+_0x2fcce9['countagentrejectretry']>=_0x5cb7c5[_0x58a5('0xfc')]-0x1){return!![];}switch(_0x2d39a8){case 0x3:if(_0x2fcce9[_0x58a5('0xf7')]>=_0x5cb7c5['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countnoanswerretry':_0x2fcce9[_0x58a5('0xf7')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19b')],_0x58a5('0x100'))[_0x58a5('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2fcce9['ContactId'],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9['VoiceQueueId']||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x19c')));break;case 0x5:if(_0x2fcce9['countbusyretry']>=_0x5cb7c5[_0x58a5('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x2fcce9[_0x58a5('0x105')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19e')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2fcce9[_0x58a5('0xf6')]>=_0x5cb7c5['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2fcce9['countcongestionretry']+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19f')],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x1a0')));break;case 0x0:if(_0x2fcce9[_0x58a5('0xf8')]>=_0x5cb7c5[_0x58a5('0x1a1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2fcce9['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x5cb7c5[_0x58a5('0x1a2')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9['VoiceQueueId']||undefined,'CampaignId':_0x2fcce9['CampaignId']||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1a3')));}break;case 0xa:if(_0x2fcce9[_0x58a5('0xf9')]>=_0x5cb7c5[_0x58a5('0x11b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2fcce9[_0x58a5('0xf9')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x11d')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9['ContactId'],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x11e')));break;case 0xb:if(_0x2fcce9[_0x58a5('0xfa')]>=_0x5cb7c5[_0x58a5('0x125')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x2fcce9[_0x58a5('0xfa')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a4')],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2fcce9['countmachineretry']>=_0x5cb7c5[_0x58a5('0xfe')]-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x2fcce9['countmachineretry']+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a5')],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9['ListId'],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2fcce9[_0x58a5('0xfb')]>=_0x5cb7c5[_0x58a5('0x1a6')]-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countagentrejectretry':_0x2fcce9[_0x58a5('0xfb')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a7')],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x1a8')));break;default:return!![];}};Dialer['prototype'][_0x58a5('0x198')]=function(_0x1b7138,_0x5720da,_0x7d8939){var _0x88d00d=this;var _0x5f4525=new History(_0x1b7138);return new BPromise(function(_0x24f33a,_0x25954e){if(_[_0x58a5('0x41')](_0x5720da)&&typeof _0x5720da!==_0x58a5('0x167')){return _0x25954e(msgResponse(_0x58a5('0x1a9'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x7d8939)&&typeof _0x7d8939!==_0x58a5('0x167')){return _0x25954e(msgResponse(_0x58a5('0x1a9'),_0x58a5('0x148'),'evt\x20is\x20undefine'));}switch(_0x7d8939['reason']){case'0':_0x5720da[_0x58a5('0x66')]+=0x1;_0x5f4525['state']=0x0;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1aa');_0x5f4525['countnosuchnumberretry']+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1ab'),ut[_0x58a5('0xf5')](_0x1b7138,_0x58a5('0x1ac')));_0x88d00d['createHistory'](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x104')));if(_0x88d00d[_0x58a5('0x19a')](0x0,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xf8')]>=_0x5720da[_0x58a5('0x1a1')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ad'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ad'));}}break;case'3':_0x5720da[_0x58a5('0x65')]+=0x1;_0x5f4525['state']=0x3;_0x5f4525[_0x58a5('0xaa')]='NoAnswer';_0x5f4525['countnoanswerretry']+=0x1;_0x5f4525['countglobal']+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1ae'),ut[_0x58a5('0xf5')](_0x1b7138,'noanswer'));_0x88d00d[_0x58a5('0xca')](_0x5f4525)['catch'](loggerCatch(_0x58a5('0x1af')));if(_0x88d00d[_0x58a5('0x19a')](0x3,_0x1b7138,_0x5720da)){if(_0x5f4525['countnoanswerretry']>=_0x5720da[_0x58a5('0x1b0')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b1'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b1'));}}break;case'5':_0x5720da[_0x58a5('0x61')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0x5;_0x5f4525[_0x58a5('0xaa')]='Busy';_0x5f4525[_0x58a5('0x105')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1b2'),ut['buildObj'](_0x1b7138,'busy'));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1b3')));if(_0x88d00d[_0x58a5('0x19a')](0x5,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0x105')]>=_0x5720da[_0x58a5('0x19d')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b4'));}else{_0x88d00d['stateGlobal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b4'));}}break;case'8':_0x5720da[_0x58a5('0x62')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0x8;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1b5');_0x5f4525['countcongestionretry']+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami['emit'](_0x58a5('0x1b6'),ut[_0x58a5('0xf5')](_0x1b7138,_0x58a5('0x1b7')));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1b8')));if(_0x88d00d[_0x58a5('0x19a')](0x8,_0x1b7138,_0x5720da)){if(_0x5f4525['countcongestionretry']>=_0x5720da[_0x58a5('0x1b9')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,'reason\x208\x20congestion');}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ba'));}}break;case'11':_0x5720da[_0x58a5('0x1bb')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0xb;_0x5f4525['statedesc']=_0x58a5('0x127');_0x5f4525[_0x58a5('0xfa')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x128')));if(_0x88d00d[_0x58a5('0x19a')](0xb,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xfa')]>=_0x5720da[_0x58a5('0x125')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1bc'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1bc'));}}break;case'20':_0x5720da[_0x58a5('0x69')]+=0x1;_0x5f4525['state']=0x14;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1bd');_0x5f4525[_0x58a5('0xfb')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1be'),ut['buildObj'](_0x1b7138,_0x58a5('0x1bf')));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1c0')));if(_0x88d00d[_0x58a5('0x19a')](0x14,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xfb')]>=_0x5720da[_0x58a5('0x1a6')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1c1'));}else{_0x88d00d['stateGlobal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1c1'));}}break;default:_0x5720da[_0x58a5('0x6a')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0xc;_0x5f4525[_0x58a5('0xaa')]=_0x7d8939['reason'];_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x88d00d[_0x58a5('0x19a')](_0x7d8939[_0x58a5('0x110')],_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0x105')]+_0x5f4525[_0x58a5('0xf6')]+_0x5f4525[_0x58a5('0xf7')]+_0x5f4525[_0x58a5('0xf8')]+_0x5f4525[_0x58a5('0xf9')]+_0x5f4525[_0x58a5('0xfa')]+_0x5f4525[_0x58a5('0xf3')]+_0x5f4525[_0x58a5('0xfb')]>=_0x5720da['dialGlobalMaxRetry']){_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x7d8939[_0x58a5('0x110')]);}else{_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x7d8939['reason']);}}}});};Dialer[_0x58a5('0x1e')][_0x58a5('0xfd')]=function(_0x6d4088,_0x1c0af5,_0x362ec6,_0x269c56){var _0x1c2b57=new Final(_0x6d4088);_0x1c2b57[_0x58a5('0xa9')]=0xf;_0x1c2b57[_0x58a5('0xaa')]='Global';this[_0x58a5('0x107')](_0x1c2b57,_0x1c0af5,_0x362ec6,_0x269c56);};Dialer['prototype'][_0x58a5('0x107')]=function(_0x1309bd,_0x161978,_0x4d5fb1,_0x24de4b){this['moveContactManagedDialer'](_0x1309bd)[_0x58a5('0xb7')](function(){return _0x161978(msgResponse(_0x58a5('0x1a9'),_0x58a5('0x1c2'),_0x24de4b));})[_0x58a5('0xb8')](function(){return _0x4d5fb1(msgResponse(_0x58a5('0x1c3'),_0x58a5('0x148'),_0x58a5('0x1c4')));});};Dialer[_0x58a5('0x1e')]['predictive']=function(_0x2d918c){var _0x513423=_0x2d918c[_0x58a5('0x1c5')]/0x64;var _0x1598e0=_0x2d918c[_0x58a5('0x64')]/(_0x2d918c[_0x58a5('0x64')]+_0x2d918c[_0x58a5('0xe8')]);var _0x27fbdb=Math[_0x58a5('0x1c6')](_0x2d918c['predictiveIntervalAvailable']*(_0x2d918c[_0x58a5('0x1c7')]/0x64));var _0x290ad6=Math[_0x58a5('0x1c6')](_0x2d918c['predictiveIntervalAvailable']*(_0x2d918c['predictiveIntervalMinThreshold']/0x64));var _0x16f90d=_0x2d918c[_0x58a5('0x53')]+_0x2d918c['talking'];var _0x48d442=Math[_0x58a5('0x1c8')](_0x2d918c[_0x58a5('0x76')]*_0x2d918c['erlangAbandonmentRate']*_0x2d918c[_0x58a5('0x70')]*_0x2d918c['predictiveIntervalMultiplicativeFactor']);if(_[_0x58a5('0x41')](_0x2d918c['startProgressive'])){if(!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x7a')])){_0x2d918c[_0x58a5('0x7a')]=undefined;loggerPredictive[_0x58a5('0x9a')](_0x58a5('0x1c9'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x94')])){loggerPredictive[_0x58a5('0x9a')](_0x58a5('0x1c9'),_0x58a5('0x1ca'));clearInterval(_0x2d918c[_0x58a5('0x94')]);_0x2d918c[_0x58a5('0x94')]=undefined;}_0x2d918c[_0x58a5('0x2c')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x2d918c['startProgressive']);this['handlePower'](_0x2d918c,0x1);}else if(ifInterval(_0x2d918c['dialPredictiveInterval'],_0x2d918c[_0x58a5('0x2c')])){this['handlePower'](_0x2d918c,0x1);loggerPredictiveCalls[_0x58a5('0x87')](_0x58a5('0x1cb'),_0x2d918c[_0x58a5('0x2c')],_0x2d918c[_0x58a5('0x44')]);_0x2d918c[_0x58a5('0x76')]=0x0;_0x2d918c[_0x58a5('0x6f')]=0x0;}else if(_0x513423<_0x1598e0&&_0x2d918c[_0x58a5('0x1cc')]===_0x58a5('0x1cd')){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x1ce'),_0x58a5('0x1cf'),_0x1598e0,_0x58a5('0x2c'),_0x2d918c[_0x58a5('0x44')]);}else if(_0x48d442<_0x2d918c['predictiveIntervalErlangCallsDroppedCalls']&&_0x2d918c['dialPredictiveOptimization']===_0x58a5('0x1cd')){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x1d0'),'Max\x20Drop\x20',_0x48d442,_0x58a5('0x1d1'),_0x2d918c[_0x58a5('0x6f')],_0x58a5('0x2c'),_0x2d918c[_0x58a5('0x44')]);}else if(!ifInterval(_0x2d918c[_0x58a5('0x1d2')],_0x2d918c['startProgressive'])&&_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x7a')])&&!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x2c')])){_0x2d918c[_0x58a5('0x7a')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));loggerPredictive[_0x58a5('0x87')](_0x2d918c['name'],_0x58a5('0x1d3'),_0x2d918c['startPredictive']);this[_0x58a5('0xbd')](_0x2d918c[_0x58a5('0x1d2')])[_0x58a5('0xb7')](this[_0x58a5('0x1d4')](_0x2d918c))['then'](mergeDataErlangB(_0x2d918c))[_0x58a5('0xb7')](this[_0x58a5('0x1d5')](_0x2d918c))[_0x58a5('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2d918c));}else if(!ifInterval(_0x2d918c[_0x58a5('0x1d2')],_0x2d918c[_0x58a5('0x7a')])){_0x2d918c[_0x58a5('0x6f')]=0x0;_0x2d918c[_0x58a5('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],_0x58a5('0x1d6'),_0x2d918c[_0x58a5('0x7a')]);clearInterval(_0x2d918c[_0x58a5('0x94')]);_0x2d918c[_0x58a5('0x94')]=undefined;this[_0x58a5('0xbd')](_0x2d918c[_0x58a5('0x1d2')])[_0x58a5('0xb7')](this[_0x58a5('0x1d4')](_0x2d918c))[_0x58a5('0xb7')](mergeDataErlangB(_0x2d918c))[_0x58a5('0xb7')](this[_0x58a5('0x1d5')](_0x2d918c))[_0x58a5('0xb8')](loggerCatchPredictive(_0x58a5('0x1d7'),_0x2d918c));}else if(_0x2d918c[_0x58a5('0x73')]&&_0x16f90d<_0x2d918c[_0x58a5('0x73')]-_0x290ad6){freeVariablesPredictive(_0x2d918c);loggerPredictive['info'](_0x2d918c['name'],_0x58a5('0x1d8'),_0x16f90d,_0x58a5('0x1d9'),_0x2d918c[_0x58a5('0x73')],'-',_0x290ad6,'=',_0x2d918c[_0x58a5('0x73')]-_0x290ad6,')');}else if(_0x2d918c[_0x58a5('0x73')]&&_0x16f90d>_0x2d918c[_0x58a5('0x73')]+_0x27fbdb){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x16f90d,')\x20are\x20more\x20than\x20threshold\x20(',_0x2d918c['predictiveIntervalAvailable'],'+',_0x27fbdb,'=',_0x2d918c[_0x58a5('0x73')]+_0x27fbdb,')');}};Dialer[_0x58a5('0x1e')][_0x58a5('0x1d4')]=function(_0x516910){var _0xa2fc53=this;return function(_0x13877b){return new BPromise(function(_0x2ab2b7,_0x58c101){_['merge'](_0x516910,_0x13877b[0x0]);if(checkGetDataPredictive(_0x13877b[0x0])){var _0x4acd6f=_0x516910[_0x58a5('0x73')]=_0x516910[_0x58a5('0x59')]+_0x516910[_0x58a5('0x53')];var _0x5784a0=_0x516910[_0x58a5('0x1d2')]*0x3c;var _0x210f41=_0x13877b[0x0][_0x58a5('0x6c')]+_0x13877b[0x0][_0x58a5('0x1da')];var _0x536f58=(_0x13877b[0x0][_0x58a5('0x6b')]+_0x13877b[0x0][_0x58a5('0x6e')]+_0x13877b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x13877b[0x0][_0x58a5('0x74')];_0x516910[_0x58a5('0x70')]=_0x536f58>0x0?_0x536f58:0x1;switch(_0x516910[_0x58a5('0x1cc')]){case _0x58a5('0x1cd'):var _0x2bb8f4=_0x516910[_0x58a5('0x1c5')]/0x64;return _0xa2fc53[_0x58a5('0x1db')](_0x4acd6f,_0x5784a0,_0x210f41,_0x536f58,_0x2bb8f4)[_0x58a5('0xb7')](function(_0x1a610d){return _0x2ab2b7(_0x1a610d);});case _0x58a5('0x1dc'):var _0x5b4a83=_0x516910[_0x58a5('0x1c5')]/0x64;return _0xa2fc53[_0x58a5('0x1dd')](_0x4acd6f,_0x5784a0,_0x210f41,_0x536f58,_0x5b4a83)[_0x58a5('0xb7')](function(_0x4b386f){return _0x2ab2b7(_0x4b386f);});default:return _0x58c101(msgResponse(_0x58a5('0x1de'),_0x58a5('0x148'),_0x58a5('0x1df')));}}else{return _0x58c101(msgResponse(_0x58a5('0x1de'),_0x58a5('0x148'),_0x58a5('0x1e0')));}});};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1e1')]=function(_0x43fa20){var _0x1777f5=this;return function(_0x2d074d){return new BPromise(function(_0xc010d,_0x244eed){_['merge'](_0x43fa20,_0x2d074d[0x0]);if(checkGetDataPredictive(_0x2d074d[0x0])){loggerPredictive[_0x58a5('0x87')](JSON[_0x58a5('0x7d')](_0x2d074d[0x0]));if(_0x43fa20[_0x58a5('0x1cc')]==='dropRate'){return _0x1777f5[_0x58a5('0xc7')](_0x43fa20['id'])[_0x58a5('0xb7')](function(_0x26fb9f){var _0x46faca=_0x43fa20[_0x58a5('0x54')]-_0x26fb9f[0x0][_0x58a5('0x1e2')];var _0x1ec02f=_0x43fa20[_0x58a5('0x1d2')]*0x3c;var _0x294470=_0x2d074d[0x0]['predictiveIntervalAvgTalktime']+_0x2d074d[0x0][_0x58a5('0x1da')];var _0x1cfd4a=(_0x2d074d[0x0][_0x58a5('0x6b')]+_0x2d074d[0x0][_0x58a5('0x6e')]+_0x2d074d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2d074d[0x0][_0x58a5('0x74')];var _0x1251f7=_0x43fa20[_0x58a5('0x1c5')]/0x64;_0x43fa20[_0x58a5('0x72')]=_0x26fb9f[0x0][_0x58a5('0x1e2')]||0x0;_0x43fa20[_0x58a5('0x70')]=_0x1cfd4a>0x0?_0x1cfd4a:0x1;return _0x1777f5[_0x58a5('0x1db')](_0x46faca,_0x1ec02f,_0x294470,_0x1cfd4a,_0x1251f7);})[_0x58a5('0xb7')](function(_0x2e04e3){return _0xc010d(_0x2e04e3);})[_0x58a5('0xb8')](function(_0x1c4cbb){return _0x244eed(msgResponse('[CatchErlangB]',_0x58a5('0x148'),JSON['stringify'](_0x1c4cbb)));});}if(_0x43fa20[_0x58a5('0x1cc')]===_0x58a5('0x1dc')){return _0x1777f5[_0x58a5('0xc7')](_0x43fa20['id'])[_0x58a5('0xb7')](function(_0x3bf6ab){var _0x34dd85=_0x43fa20[_0x58a5('0x54')]-_0x3bf6ab[0x0][_0x58a5('0x1e2')];var _0x2cb63b=_0x43fa20[_0x58a5('0x1d2')]*0x3c;var _0x3f6985=_0x2d074d[0x0][_0x58a5('0x6c')]+_0x2d074d[0x0][_0x58a5('0x1da')];var _0x12fec9=(_0x2d074d[0x0]['predictiveIntervalAnsweredCalls']+_0x2d074d[0x0][_0x58a5('0x6e')]+_0x2d074d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2d074d[0x0]['predictiveIntervalTotalCalls'];var _0xd93d8f=_0x43fa20[_0x58a5('0x1c5')]/0x64;_0x43fa20[_0x58a5('0x72')]=_0x3bf6ab[0x0]['outboundQueuePauses']||0x0;_0x43fa20[_0x58a5('0x70')]=_0x12fec9>0x0?_0x12fec9:0x1;return _0x1777f5[_0x58a5('0x1dd')](_0x34dd85,_0x2cb63b,_0x3f6985,_0x12fec9,_0xd93d8f);})[_0x58a5('0xb7')](function(_0x13936){return _0xc010d(_0x13936);})[_0x58a5('0xb8')](function(_0x340217){return _0x244eed(msgResponse(_0x58a5('0x1e3'),_0x58a5('0x148'),JSON['stringify'](_0x340217)));});}}else{return _0x244eed(msgResponse(_0x58a5('0x1de'),'Failure',_0x58a5('0x1e0')));}});};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1d5')]=function(_0x108179){var _0x1e1182=this;return function(){var _0x4e9ef0=0x0;var _0x3f6a2f=Math[_0x58a5('0x1c8')](_0x108179['erlangCallToSecond']*0x3e8);if(_0x3f6a2f>0x0){_0x3f6a2f=_0x3f6a2f<0x64?0x64:_0x3f6a2f;loggerPredictive['info'](_0x108179[_0x58a5('0x44')],'one\x20call\x20every:',_0x3f6a2f,_0x58a5('0x4d'));_0x108179[_0x58a5('0x94')]=setInterval(function(){_0x1e1182[_0x58a5('0x94')](_0x108179);loggerPredictiveCalls[_0x58a5('0x87')](_0x58a5('0x1e4'),_0x4e9ef0+=0x1);},_0x3f6a2f);}else{loggerPredictive['info'](_0x108179['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1e5')]=function(_0x3db520,_0x3c2e42){var _0x4f4aef=this;return function(_0x322e37){if(_['isEmpty'](_0x322e37)){if(_['isNil'](_0x3c2e42['UserId'])||!_0x3c2e42['recallme']){if(_0x3db520[_0x58a5('0x15e')]==='booked'){_0x3db520[_0x58a5('0x132')]=_[_0x58a5('0x41')](_0x3db520['queueStatusComplete'])?!![]:_0x3db520[_0x58a5('0x132')];var _0x186d0a=uuid['v4']();_0x4f4aef[_0x58a5('0x129')][_0x186d0a]=new Action(_0x3db520,_0x3c2e42,_0x186d0a);loggerBooked[_0x58a5('0x87')](_0x58a5('0x1e6'),_0x186d0a,_0x58a5('0x1e7'),JSON[_0x58a5('0x7d')](_0x3db520[_0x58a5('0x132')]),_0x58a5('0x1e8'),_0x3db520[_0x58a5('0x44')]);if(_0x3db520['queueStatusComplete']){_0x3db520[_0x58a5('0x132')]=![];_0x4f4aef['queueBooked'][_0x4f4aef['actions'][_0x186d0a]['queue']]=[];ami[_0x58a5('0xb0')]({'actionid':_0x186d0a,'action':_0x58a5('0x1e9'),'queue':_0x3db520[_0x58a5('0x44')]})[_0x58a5('0xb8')](function(){_0x4f4aef[_0x58a5('0xb3')](_0x3db520);_0x4f4aef['rescheduleContact']({'active':![],'ContactId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a]['ContactId'],'ListId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a][_0x58a5('0xd3')],'VoiceQueueId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0x102')]||undefined,'CampaignId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1ea')));delete _0x4f4aef['actions'][_0x186d0a];});}else{loggerBooked[_0x58a5('0x87')]('[booked][checkContactBlack][else]',JSON[_0x58a5('0x7d')](_0x3db520['queueStatusComplete']),_0x58a5('0x1e8'),_0x3db520[_0x58a5('0x44')]);_0x4f4aef['updateOriginated'](_0x3db520);_0x4f4aef[_0x58a5('0xc0')]({'active':![],'ContactId':_0x4f4aef['actions'][_0x186d0a]['ContactId'],'ListId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0xd3')],'VoiceQueueId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a]['VoiceQueueId']||undefined,'CampaignId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1ea')));delete _0x4f4aef[_0x58a5('0x129')][_0x186d0a];}}else{return _0x4f4aef['actionOriginate'](_0x3db520,_0x3c2e42);}}else{if(getDiff(_0x3c2e42[_0x58a5('0x1eb')])<_0x3db520[_0x58a5('0x1ec')]*0x3c){if(_0x3c2e42['Agent']&&!_0x3c2e42[_0x58a5('0x1ed')][_0x58a5('0x1ee')]){_0x4f4aef[_0x58a5('0x23')]['run'](_0x3c2e42['id'])['finally'](function(){_0x4f4aef['updateOriginated'](_0x3db520);});}else{_0x4f4aef['unlockContact']({'active':![]},_0x3c2e42['id'],0x1)[_0x58a5('0x21')](function(){_0x4f4aef[_0x58a5('0xb3')](_0x3db520);});}}else{_0x3db520['outboundReCallsDay']+=0x1;_0x4f4aef[_0x58a5('0xb3')](_0x3db520);if(_0x3db520[_0x58a5('0x1ef')]){_0x4f4aef[_0x58a5('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c2e42[_0x58a5('0xd2')],'ListId':_0x3c2e42[_0x58a5('0xd3')],'VoiceQueueId':_0x3c2e42['VoiceQueueId']||undefined,'CampaignId':_0x3c2e42['CampaignId']||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1f0')));_0x4f4aef['createHistory'](createObjHistory(_0x3db520,_0x3c2e42,'RECALLINQUEUE',0x17,_0x58a5('0x1f1')))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1f2')));}else{_0x4f4aef['saveInDb'](createObjHistory(_0x3db520,_0x3c2e42,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x58a5('0x1f3'));}}}}else{_0x3db520[_0x58a5('0x1f4')]+=0x1;_0x4f4aef['saveInDb'](createObjHistory(_0x3db520,_0x3c2e42,'BLACKLIST',0xd,_0x58a5('0x1f5')),_0x58a5('0x1f6'),_0x58a5('0x1f7'));throw _0x58a5('0x1f8');}};};Dialer['prototype'][_0x58a5('0x15d')]=function(_0x1a1fc4){var _0x3d07ff=this;var _0x588c3b=_0x1a1fc4[_0x58a5('0x1f9')]-_0x1a1fc4[_0x58a5('0x75')]-_0x1a1fc4[_0x58a5('0xc4')];emitCampaignSummary(_0x1a1fc4);if(_0x588c3b>0x0){if(_0x588c3b>this[_0x58a5('0x27')]){_0x588c3b=this[_0x58a5('0x27')];}_0x1a1fc4['temp']+=_0x588c3b;this[_0x58a5('0xc5')](_0x1a1fc4['id'],_0x588c3b,_0x1a1fc4['dialOrderByScheduledAt'],_0x1a1fc4)[_0x58a5('0xb7')](function(_0x3e4ab4){_0x1a1fc4[_0x58a5('0xc4')]-=_0x588c3b;_0x1a1fc4[_0x58a5('0xc4')]=_0x1a1fc4[_0x58a5('0xc4')]>0x0?_0x1a1fc4[_0x58a5('0xc4')]:0x0;if(!checkContactEmpty(_0x3e4ab4)){_0x1a1fc4[_0x58a5('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x58a5('0x87')]('[getContactCampaign2][Empty]'+_0x1a1fc4['name']);}else{_0x1a1fc4[_0x58a5('0x75')]+=_0x3e4ab4[_0x58a5('0x137')];_0x1a1fc4['message']=_0x58a5('0x1fa');for(var _0x1b7a50=0x0;_0x1b7a50<_0x3e4ab4['length'];_0x1b7a50+=0x1){_0x1a1fc4['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3e4ab4[_0x1b7a50])||_[_0x58a5('0xe1')](_0x3e4ab4[_0x1b7a50][_0x58a5('0x16b')])||_[_0x58a5('0xe1')](_0x3e4ab4[_0x1b7a50][_0x58a5('0x16b')][_0x58a5('0x16a')])){_0x3d07ff[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0x1a1fc4,_0x3e4ab4[_0x1b7a50]);}else{_0x3d07ff[_0x58a5('0xbc')](_[_0x58a5('0xd1')](_0x3e4ab4[_0x1b7a50],[_0x58a5('0xd5'),_0x58a5('0x1fc')]))[_0x58a5('0xb7')](_0x3d07ff[_0x58a5('0x1e5')](_0x1a1fc4,_0x3e4ab4[_0x1b7a50]))[_0x58a5('0xb8')](_0x3d07ff['loggerHandler']('[actionOriginateIvr]\x20',_0x1a1fc4));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x1a1fc4,_0x588c3b));}};Dialer[_0x58a5('0x1e')]['handlePower']=function(_0x2dfb6c,_0x5ce1e1){var _0x3db894=this;var _0x4794c5=[];var _0x5348c4=_0x5ce1e1>=0x1?_0x5ce1e1:0x1;if(_0x2dfb6c['dialMethod']===_0x58a5('0xa')){_0x5348c4=0x1;}var _0x3f9bb8=Math[_0x58a5('0x1c8')](_0x2dfb6c[_0x58a5('0x53')]*_0x5348c4)-_0x2dfb6c[_0x58a5('0x75')]-_0x2dfb6c[_0x58a5('0xc4')];emitVoiceQueueSummary(_0x2dfb6c);if(_0x2dfb6c['dialLimitQueue']>0x0){var _0x5ce7c6=_0x2dfb6c[_0x58a5('0x1fd')]-_0x2dfb6c[_0x58a5('0x75')]-_0x2dfb6c[_0x58a5('0x59')]-_0x2dfb6c[_0x58a5('0xc4')]-_0x2dfb6c[_0x58a5('0x55')];if(_0x3f9bb8>_0x5ce7c6){_0x3f9bb8=_0x5ce7c6;}}if(_0x3f9bb8>0x0){if(_0x2dfb6c[_0x58a5('0x15e')]==='booked'){_0x3f9bb8=0x1;}if(_0x3f9bb8>this[_0x58a5('0x27')]){_0x3f9bb8=this['maxNumberOriginate'];}_0x2dfb6c[_0x58a5('0xc4')]+=_0x3f9bb8;for(var _0x23ded6 in this[_0x58a5('0x26')]){if(typeof this[_0x58a5('0x26')][_0x23ded6]!==_0x58a5('0x9d')){if(this[_0x58a5('0x26')][_0x23ded6][_0x58a5('0xa9')]==='not_inuse'&&this[_0x58a5('0x26')][_0x23ded6][_0x58a5('0xdb')]===_0x58a5('0xdc')){_0x4794c5[_0x58a5('0x130')](this['agents'][_0x23ded6]['id']);}}}this[_0x58a5('0xc3')](_0x2dfb6c['id'],_0x4794c5,_0x3f9bb8,_0x2dfb6c[_0x58a5('0x1fe')],_0x2dfb6c)['then'](function(_0x13ef64){_0x2dfb6c[_0x58a5('0xc4')]-=_0x3f9bb8;_0x2dfb6c[_0x58a5('0xc4')]=_0x2dfb6c[_0x58a5('0xc4')]>0x0?_0x2dfb6c[_0x58a5('0xc4')]:0x0;if(!checkContactEmpty(_0x13ef64)){_0x3db894[_0x58a5('0xb5')](_0x2dfb6c)[_0x58a5('0xb7')](sendMessageReschedule(_0x2dfb6c))['catch'](loggerCatch(_0x58a5('0xb9')));}else{_0x2dfb6c['originated']+=_0x13ef64[_0x58a5('0x137')];_0x2dfb6c[_0x58a5('0x42')]=_0x2dfb6c[_0x58a5('0x15e')]==='booked'?_0x58a5('0x171'):'RUNNING';for(var _0x343ab5=0x0;_0x343ab5<_0x13ef64[_0x58a5('0x137')];_0x343ab5+=0x1){if(_[_0x58a5('0xe1')](_0x13ef64[_0x343ab5])||_['isNil'](_0x13ef64[_0x343ab5][_0x58a5('0x16b')])||_['isNil'](_0x13ef64[_0x343ab5][_0x58a5('0x16b')][_0x58a5('0x16a')])){_0x3db894[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0x2dfb6c,_0x13ef64[_0x343ab5]);}else{_0x3db894[_0x58a5('0xba')](_[_0x58a5('0xd1')](_0x13ef64[_0x343ab5],[_0x58a5('0x102'),_0x58a5('0x1fc')]))['then'](_0x3db894[_0x58a5('0x1e5')](_0x2dfb6c,_0x13ef64[_0x343ab5]))['catch'](_0x3db894[_0x58a5('0xce')](_0x58a5('0x1fb'),_0x2dfb6c));}}}})[_0x58a5('0xb8')](loggerGetContactDialer(_0x58a5('0x1ff'),_0x2dfb6c,_0x3f9bb8));}};Dialer['prototype'][_0x58a5('0x94')]=function(_0x5c87b1){if(_0x5c87b1[_0x58a5('0x1fd')]>0x0){var _0x421c9e=_0x5c87b1[_0x58a5('0x1fd')]-_0x5c87b1[_0x58a5('0x75')]-_0x5c87b1[_0x58a5('0x59')];if(_0x421c9e>0x0){this[_0x58a5('0x200')](_0x5c87b1);}else{loggerPredictiveCalls['info'](_0x58a5('0x201'));}}else{this[_0x58a5('0x200')](_0x5c87b1);}};Dialer[_0x58a5('0x1e')][_0x58a5('0x200')]=function(_0xf62576){var _0x337412=this;var _0x5c6b3a=[];_0xf62576[_0x58a5('0x75')]+=0x1;for(var _0x3527e8 in this['agents']){if(typeof this['agents'][_0x3527e8]!==_0x58a5('0x9d')){if(this[_0x58a5('0x26')][_0x3527e8][_0x58a5('0xa9')]===_0x58a5('0x202')&&this['agents'][_0x3527e8]['status']===_0x58a5('0xdc')){_0x5c6b3a[_0x58a5('0x130')](this['agents'][_0x3527e8]['id']);}}}this['getContactDialer'](_0xf62576['id'],_0x5c6b3a,0x1,_0xf62576[_0x58a5('0x1fe')],_0xf62576)[_0x58a5('0xb7')](function(_0x344271){if(!checkContactEmpty(_0x344271)){checkContactLowerLimitOriginate(_0xf62576,0x1,0x0);_0x337412[_0x58a5('0xb5')](_0xf62576)[_0x58a5('0xb7')](sendMessageReschedule(_0xf62576))['catch'](loggerCatch(_0x58a5('0xb9')));}else{_0xf62576['message']=_0x58a5('0x1fa');if(_[_0x58a5('0xe1')](_0x344271[0x0])||_[_0x58a5('0xe1')](_0x344271[0x0]['Contact'])||_['isNil'](_0x344271[0x0][_0x58a5('0x16b')]['phone'])){_0x337412[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0xf62576,_0x344271[0x0]);}else{_0x337412[_0x58a5('0xba')](_['pick'](_0x344271[0x0],[_0x58a5('0x102'),'Contact.phone']))[_0x58a5('0xb7')](_0x337412['checkContactBlack'](_0xf62576,_0x344271[0x0]))[_0x58a5('0xb8')](_0x337412[_0x58a5('0xce')](_0x58a5('0x203'),_0xf62576));}}})[_0x58a5('0xb8')](loggerGetContactDialer(_0x58a5('0x204'),_0xf62576,0x1));emitVoiceQueueSummary(_0xf62576);};Dialer[_0x58a5('0x1e')][_0x58a5('0x1db')]=function(_0x4fadcd,_0x5b38ea,_0x549c9f,_0x41c09f,_0x46e33d,_0x317ecc){loggerPredictive[_0x58a5('0x87')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x58a5('0x87')](_0x58a5('0x205'),_0x4fadcd);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x206'),_0x5b38ea);loggerPredictive['info'](_0x58a5('0x207'),_0x549c9f);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x208'),_0x41c09f);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46e33d);loggerPredictive[_0x58a5('0x87')]('---------------------------');return new BPromise(function(_0x1b7580,_0x45c06b){if(_0x4fadcd<=0x0||isNaN(_0x4fadcd)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),'m\x20=\x20'+_0x4fadcd));}if(_0x549c9f<=0x0||isNaN(_0x549c9f)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),_0x58a5('0x20a')+_0x549c9f));}if(_0x41c09f<=0x0||isNaN(_0x41c09f)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),_0x58a5('0x20b')+_0x41c09f));}if(_0x5b38ea<=0x0||isNaN(_0x5b38ea)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),'interval\x20=\x20'+_0x5b38ea));}if(_0x46e33d<=0x0||isNaN(_0x46e33d)){return _0x45c06b(msgResponse('[abandonmentRate]',_0x58a5('0x4c'),_0x58a5('0x20c')+_0x46e33d));}_0x317ecc=_0x317ecc||0x0;var _0xaade06=0x1/_0x549c9f;var _0x16d24b=0x0;var _0x40e01f=0x0;var _0x59351a=0x0;var _0x33adfa=0x0;for(var _0x22f2e4=0x0;_0x59351a<_0x46e33d;_0x22f2e4+=0x1){_0x40e01f=_0x22f2e4/_0x5b38ea;_0x16d24b=(_0x41c09f*_0x40e01f+_0x317ecc)/_0xaade06;_0x59351a=erlangb(_0x16d24b,_0x4fadcd);_0x33adfa=_0x16d24b/_0x4fadcd*(0x1-erlangb(_0x16d24b,_0x4fadcd));}return _0x1b7580({'erlangCalls':_0x22f2e4,'erlangCallToSecond':_0x5b38ea/_0x22f2e4,'erlangAbandonmentRate':_0x59351a,'erlangBusyFactor':_0x33adfa});});};Dialer[_0x58a5('0x1e')]['busyFactor']=function(_0x15c92e,_0x33a4d9,_0x13586c,_0x23b329,_0x30ef85,_0x53b0b0){loggerPredictive[_0x58a5('0x87')](_0x58a5('0x20d'));loggerPredictive[_0x58a5('0x87')](_0x58a5('0x205'),_0x15c92e);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33a4d9);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x207'),_0x13586c);loggerPredictive['info'](_0x58a5('0x208'),_0x23b329);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x20e'),_0x30ef85);loggerPredictive[_0x58a5('0x87')]('---------------------------');return new BPromise(function(_0x182e16,_0x3c0542){if(_0x15c92e<=0x0||isNaN(_0x15c92e)){return _0x3c0542(msgResponse('[busyFactor]',_0x58a5('0x4c'),'m\x20=\x20'+_0x15c92e));}if(_0x13586c<=0x0||isNaN(_0x13586c)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x20a')+_0x13586c));}if(_0x23b329<=0x0||isNaN(_0x23b329)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x20b')+_0x23b329));}if(_0x33a4d9<=0x0||isNaN(_0x33a4d9)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x210')+_0x33a4d9));}if(_0x30ef85<=0x0||isNaN(_0x30ef85)){return _0x3c0542(msgResponse('[busyFactor]',_0x58a5('0x4c'),'Umin\x20=\x20'+_0x30ef85));}_0x53b0b0=_0x53b0b0||0x0;var _0x1cadb9=0x1/_0x13586c;var _0x17b30b=0x0;var _0x5d776d=0x0;var _0x4a8f17=0x0;var _0x248bb8=0x0;for(var _0x44412a=0x0;_0x248bb8<_0x30ef85;_0x44412a+=0x1){_0x5d776d=_0x44412a/_0x33a4d9;_0x17b30b=(_0x23b329*_0x5d776d+_0x53b0b0)/_0x1cadb9;_0x4a8f17=erlangb(_0x17b30b,_0x15c92e);_0x248bb8=_0x17b30b/_0x15c92e*(0x1-erlangb(_0x17b30b,_0x15c92e));}return _0x182e16({'erlangCalls':_0x44412a,'erlangCallToSecond':_0x33a4d9/_0x44412a,'erlangAbandonmentRate':_0x4a8f17,'erlangBusyFactor':_0x248bb8});});};module[_0x58a5('0x211')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5660c0f..d5318fc 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 _0x6906=['outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','endtime','droptime','ringtime','responsetime','holdtime','talktime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype'];(function(_0x31d01d,_0x5991a5){var _0x1ff226=function(_0x1bd568){while(--_0x1bd568){_0x31d01d['push'](_0x31d01d['shift']());}};_0x1ff226(++_0x5991a5);}(_0x6906,0x76));var _0x6690=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6906[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x6690('0x0'));var _=require('lodash');var moment=require(_0x6690('0x1'));function getSeconds(_0x42e2da,_0x3c3b51){var _0x5c6f40=moment(_0x42e2da)[_0x6690('0x2')](0x0);var _0x30e195=moment(_0x3c3b51)[_0x6690('0x2')](0x0);return _0x5c6f40[_0x6690('0x3')](_0x30e195,_0x6690('0x4'));}function QueueCallerAbandon(_0x3a33c6,_0x4bb143){this[_0x6690('0x5')]=_0x3a33c6[_0x6690('0x5')];this[_0x6690('0x6')]=_0x3a33c6[_0x6690('0x6')];this[_0x6690('0x7')]=_0x3a33c6[_0x6690('0x6')]===_0x6690('0x8')?_0x6690('0x9'):_0x3a33c6['type'];this[_0x6690('0xa')]=_0x3a33c6['countbusyretry'];this[_0x6690('0xb')]=_0x3a33c6['countcongestionretry'];this['countnoanswerretry']=_0x3a33c6['countnoanswerretry'];this[_0x6690('0xc')]=_0x3a33c6[_0x6690('0xa')]+_0x3a33c6[_0x6690('0xb')]+_0x3a33c6[_0x6690('0xd')]+_0x3a33c6[_0x6690('0xe')]+_0x3a33c6[_0x6690('0xf')]+_0x3a33c6[_0x6690('0x10')]+_0x3a33c6[_0x6690('0x11')]+_0x3a33c6[_0x6690('0x12')];this[_0x6690('0xe')]=_0x3a33c6[_0x6690('0xe')];this['countdropretry']=_0x3a33c6[_0x6690('0xf')];this[_0x6690('0x10')]=_0x3a33c6[_0x6690('0x10')];this[_0x6690('0x11')]=_0x3a33c6[_0x6690('0x11')];this[_0x6690('0x12')]=_0x3a33c6[_0x6690('0x12')];this[_0x6690('0x13')]=_0x4bb143[_0x6690('0x13')];this[_0x6690('0x14')]=_0x3a33c6[_0x6690('0x15')];this[_0x6690('0x16')]=_0x3a33c6['number'];this[_0x6690('0x17')]=_0x3a33c6['starttime'];this['responsetime']=_0x3a33c6['responsetime'];this['droptime']=_0x3a33c6['droptime'];this[_0x6690('0x18')]=this[_0x6690('0x19')];this[_0x6690('0x1a')]=getSeconds(_0x3a33c6[_0x6690('0x1b')],_0x3a33c6[_0x6690('0x17')]);this[_0x6690('0x1c')]=getSeconds(this['droptime'],_0x3a33c6[_0x6690('0x1b')]);this[_0x6690('0x1d')]=0x0;this[_0x6690('0x9')]=_0x4bb143[_0x6690('0x9')];this['membername']=_0x4bb143[_0x6690('0x1e')];this[_0x6690('0x1f')]=_0x4bb143[_0x6690('0x1f')];this[_0x6690('0x20')]=_0x3a33c6[_0x6690('0x20')];this['callbackuniqueid']=_0x3a33c6['callbackuniqueid'];this[_0x6690('0x21')]=_0x3a33c6[_0x6690('0x21')];this[_0x6690('0x22')]=_0x3a33c6[_0x6690('0x22')];this[_0x6690('0x23')]=_0x3a33c6[_0x6690('0x23')];this[_0x6690('0x24')]=_0x3a33c6[_0x6690('0x24')];this[_0x6690('0x25')]=_0x3a33c6[_0x6690('0x25')];this[_0x6690('0x26')]=_0x3a33c6[_0x6690('0x26')];this[_0x6690('0x27')]=_0x3a33c6[_0x6690('0x27')];this[_0x6690('0x28')]=_0x3a33c6[_0x6690('0x28')]||'';this[_0x6690('0x29')]=_0x3a33c6['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xbe73=['ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x23a608,_0x554d43){var _0x64e20b=function(_0x22b5a6){while(--_0x22b5a6){_0x23a608['push'](_0x23a608['shift']());}};_0x64e20b(++_0x554d43);}(_0xbe73,0x18d));var _0x3be7=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xbe73[_0x178856];return _0x3c7fe7;};'use strict';var util=require(_0x3be7('0x0'));var _=require(_0x3be7('0x1'));var moment=require(_0x3be7('0x2'));function getSeconds(_0x4c9a7a,_0xbbbbbf){var _0x2a3f48=moment(_0x4c9a7a)[_0x3be7('0x3')](0x0);var _0x580f3d=moment(_0xbbbbbf)[_0x3be7('0x3')](0x0);return _0x2a3f48[_0x3be7('0x4')](_0x580f3d,_0x3be7('0x5'));}function QueueCallerAbandon(_0x593c3e,_0x556aef){this[_0x3be7('0x6')]=_0x593c3e[_0x3be7('0x6')];this['type']=_0x593c3e[_0x3be7('0x7')];this['campaigntype']=_0x593c3e[_0x3be7('0x7')]===_0x3be7('0x8')?'queue':_0x593c3e['type'];this[_0x3be7('0x9')]=_0x593c3e[_0x3be7('0x9')];this[_0x3be7('0xa')]=_0x593c3e[_0x3be7('0xa')];this[_0x3be7('0xb')]=_0x593c3e[_0x3be7('0xb')];this[_0x3be7('0xc')]=_0x593c3e[_0x3be7('0x9')]+_0x593c3e[_0x3be7('0xa')]+_0x593c3e['countnoanswerretry']+_0x593c3e[_0x3be7('0xd')]+_0x593c3e[_0x3be7('0xe')]+_0x593c3e[_0x3be7('0xf')]+_0x593c3e[_0x3be7('0x10')]+_0x593c3e['countagentrejectretry'];this['countnosuchnumberretry']=_0x593c3e[_0x3be7('0xd')];this['countdropretry']=_0x593c3e[_0x3be7('0xe')];this[_0x3be7('0xf')]=_0x593c3e[_0x3be7('0xf')];this['countmachineretry']=_0x593c3e['countmachineretry'];this[_0x3be7('0x11')]=_0x593c3e[_0x3be7('0x11')];this[_0x3be7('0x12')]=_0x556aef[_0x3be7('0x12')];this['calleridname']=_0x593c3e[_0x3be7('0x13')];this[_0x3be7('0x14')]=_0x593c3e[_0x3be7('0x15')];this[_0x3be7('0x16')]=_0x593c3e[_0x3be7('0x16')];this[_0x3be7('0x17')]=_0x593c3e[_0x3be7('0x17')];this['droptime']=_0x593c3e[_0x3be7('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x593c3e[_0x3be7('0x17')],_0x593c3e[_0x3be7('0x16')]);this['holdtime']=getSeconds(this[_0x3be7('0x18')],_0x593c3e['responsetime']);this[_0x3be7('0x19')]=0x0;this['queue']=_0x556aef['queue'];this[_0x3be7('0x1a')]=_0x556aef['connectedlinename'];this[_0x3be7('0x1b')]=_0x556aef[_0x3be7('0x1b')];this[_0x3be7('0x1c')]=_0x593c3e['callback'];this[_0x3be7('0x1d')]=_0x593c3e['callbackuniqueid'];this[_0x3be7('0x1e')]=_0x593c3e[_0x3be7('0x1e')];this['recallme']=_0x593c3e[_0x3be7('0x1f')];this[_0x3be7('0x20')]=_0x593c3e[_0x3be7('0x20')];this[_0x3be7('0x21')]=_0x593c3e[_0x3be7('0x21')];this['UserId']=_0x593c3e[_0x3be7('0x22')];this['VoiceQueueId']=_0x593c3e['VoiceQueueId'];this['CampaignId']=_0x593c3e[_0x3be7('0x23')];this[_0x3be7('0x24')]=_0x593c3e[_0x3be7('0x24')]||'';this[_0x3be7('0x25')]=_0x593c3e['originatecalleridname']||'';}module[_0x3be7('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d8b6f15..18fe439 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(_0x2130d3,_0x3955be){var _0x1992c3=function(_0x50b50a){while(--_0x50b50a){_0x2130d3['push'](_0x2130d3['shift']());}};_0x1992c3(++_0x3955be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x236324,_0x2e24bc){var _0x16ef65=function(_0x56147e){while(--_0x56147e){_0x236324['push'](_0x236324['shift']());}};_0x16ef65(++_0x2e24bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 d397996..8555762 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 _0xf0a6=['%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','syncNewExten','faxstatus','hangup','syncHangup','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','name','info','\x20syncNewchannel\x20','channel','prototype','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','syncReceiveFax','remotestationid','resolution','transferrate','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','.pdf','then','notify','catch','\x20notify\x20','error','stringify','\x20receiveFax\x20','syncOriginateResponse','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','parse','format'];(function(_0x1c7abf,_0x4964f1){var _0x42d357=function(_0x4b179e){while(--_0x4b179e){_0x1c7abf['push'](_0x1c7abf['shift']());}};_0x42d357(++_0x4964f1);}(_0xf0a6,0xf9));var _0x6f0a=function(_0x3abd3d,_0x561589){_0x3abd3d=_0x3abd3d-0x0;var _0x65f93c=_0xf0a6[_0x3abd3d];return _0x65f93c;};'use strict';var util=require(_0x6f0a('0x0'));var _=require('lodash');var BPromise=require(_0x6f0a('0x1'));var uuid=require(_0x6f0a('0x2'));var moment=require(_0x6f0a('0x3'));var path=require(_0x6f0a('0x4'));var tiff2pdf=require(_0x6f0a('0x5'));var gs=require(_0x6f0a('0x6'));var logger=require('../../../config/logger')(_0x6f0a('0x7'));var ami=require(_0x6f0a('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x6f0a('0x9'));var ut=require(_0x6f0a('0xa'));var Action=require('./action');var faxAccount=require(_0x6f0a('0xb'));var attachment=require(_0x6f0a('0xc'));var faxMessage=require(_0x6f0a('0xd'));function Fax(_0x447642){this['channels']={};this['faxAccounts']=_0x447642[_0x6f0a('0xe')];this[_0x6f0a('0xf')]=_0x447642[_0x6f0a('0xf')];this[_0x6f0a('0x10')]={};ami['on'](_0x6f0a('0x11'),this[_0x6f0a('0x12')][_0x6f0a('0x13')](this));ami['on'](_0x6f0a('0x14'),this['syncVarSet'][_0x6f0a('0x13')](this));ami['on'](_0x6f0a('0x15'),this['syncNewState'][_0x6f0a('0x13')](this));ami['on'](_0x6f0a('0x16'),this[_0x6f0a('0x17')][_0x6f0a('0x13')](this));ami['on'](_0x6f0a('0x18'),this['syncFaxStatus'][_0x6f0a('0x13')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x6f0a('0x13')](this));ami['on'](_0x6f0a('0x19'),this[_0x6f0a('0x1a')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x6f0a('0x13')](this));}Fax['prototype'][_0x6f0a('0x12')]=function(_0x46abac){if(_0x46abac[_0x6f0a('0x1b')]===_0x6f0a('0x1c')){for(var _0xac30d0 in this[_0x6f0a('0xe')]){if(this['faxAccounts'][_0x6f0a('0x1d')](_0xac30d0)){if(_0x46abac['exten']===this['faxAccounts'][_0xac30d0][_0x6f0a('0x1e')]){this[_0x6f0a('0x1f')][_0x46abac[_0x6f0a('0x20')]]={};this[_0x6f0a('0x1f')][_0x46abac['uniqueid']]['channel']=_0x46abac['channel'];this[_0x6f0a('0x1f')][_0x46abac[_0x6f0a('0x20')]]['id']=this[_0x6f0a('0xe')][_0xac30d0]['id'];this['channels'][_0x46abac[_0x6f0a('0x20')]]['name']=this['faxAccounts'][_0xac30d0][_0x6f0a('0x21')];logger[_0x6f0a('0x22')](_0x46abac[_0x6f0a('0x20')],_0x6f0a('0x23'));}}}}if(this[_0x6f0a('0x10')][_0x46abac[_0x6f0a('0x20')]]){this[_0x6f0a('0x1f')][_0x46abac[_0x6f0a('0x20')]]={};this['channels'][_0x46abac[_0x6f0a('0x20')]][_0x6f0a('0x24')]=_0x46abac[_0x6f0a('0x24')];logger[_0x6f0a('0x22')](_0x46abac[_0x6f0a('0x20')],_0x6f0a('0x23'));}};Fax[_0x6f0a('0x25')]['syncVarSet']=function(_0x2afd74){if(this['channels'][_0x2afd74[_0x6f0a('0x20')]]){for(var _0x54e654 in _0x2afd74[_0x6f0a('0x26')]){if(_0x2afd74['variable'][_0x6f0a('0x1d')](_0x54e654)){this['channels'][_0x2afd74[_0x6f0a('0x20')]][_0x54e654]=_0x2afd74[_0x6f0a('0x27')];}}}};Fax[_0x6f0a('0x25')][_0x6f0a('0x28')]=function(_0x128459){if(this[_0x6f0a('0x1f')][_0x128459[_0x6f0a('0x20')]]){this['channels'][_0x128459[_0x6f0a('0x20')]][_0x6f0a('0x29')]=_0x128459[_0x6f0a('0x29')];this[_0x6f0a('0x1f')][_0x128459[_0x6f0a('0x20')]][_0x6f0a('0x2a')]=_0x128459[_0x6f0a('0x2a')];}};Fax[_0x6f0a('0x25')][_0x6f0a('0x17')]=function(_0x4c2ffa){if(this[_0x6f0a('0x1f')][_0x4c2ffa[_0x6f0a('0x20')]]){for(var _0x3512fe in _0x4c2ffa[_0x6f0a('0x26')]){if(_0x4c2ffa[_0x6f0a('0x26')][_0x6f0a('0x1d')](_0x3512fe)){this[_0x6f0a('0x1f')][_0x4c2ffa[_0x6f0a('0x20')]][_0x3512fe]=_0x4c2ffa[_0x6f0a('0x27')];}}}};Fax['prototype'][_0x6f0a('0x2b')]=function(_0x49b99f){if(this['channels'][_0x49b99f[_0x6f0a('0x20')]]){this[_0x6f0a('0x1f')][_0x49b99f[_0x6f0a('0x20')]]['operation']=_0x49b99f[_0x6f0a('0x2c')];this[_0x6f0a('0x1f')][_0x49b99f['uniqueid']][_0x6f0a('0x2d')]=_0x49b99f[_0x6f0a('0x2d')];this['channels'][_0x49b99f[_0x6f0a('0x20')]][_0x6f0a('0x1e')]=_0x49b99f[_0x6f0a('0x1e')];this[_0x6f0a('0x1f')][_0x49b99f[_0x6f0a('0x20')]][_0x6f0a('0x2e')]=_0x49b99f[_0x6f0a('0x2e')];logger[_0x6f0a('0x22')](_0x49b99f[_0x6f0a('0x20')],'\x20syncFaxStatus\x20');}};Fax[_0x6f0a('0x25')][_0x6f0a('0x2f')]=function(_0x5a73cd){var _0x4f147d=this;if(this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]]){var _0x4eacf6=this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]]['id'];this['channels'][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x30')]=_0x5a73cd[_0x6f0a('0x30')];this['channels'][_0x5a73cd[_0x6f0a('0x20')]]['pagestransferred']=_0x5a73cd['pagestransferred'];this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x1e')]=_0x5a73cd[_0x6f0a('0x1e')];this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]]['resolution']=_0x5a73cd[_0x6f0a('0x31')];this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x32')]=_0x5a73cd['transferrate'];this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x2e')]=_0x5a73cd[_0x6f0a('0x2e')];this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x33')]=_0x5a73cd[_0x6f0a('0x33')];if(this[_0x6f0a('0x1f')][_0x5a73cd[_0x6f0a('0x20')]][_0x6f0a('0x34')]>0x0){tiff2pdf(_0x5a73cd[_0x6f0a('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x343acf){logger[_0x6f0a('0x22')](_0x5a73cd[_0x6f0a('0x20')],_0x6f0a('0x35'),_0x343acf[_0x6f0a('0x36')]);attachment['create']({'name':path['parse'](_0x5a73cd[_0x6f0a('0x2e')])['name'],'basename':path['parse'](_0x5a73cd['filename'])[_0x6f0a('0x21')]+_0x6f0a('0x37'),'type':'application/pdf'})[_0x6f0a('0x38')](function(_0x173ee5){faxAccount[_0x6f0a('0x39')](_0x4eacf6,{'from':_0x5a73cd[_0x6f0a('0x33')],'mapKey':_0x6f0a('0x7'),'body':path['parse'](_0x5a73cd[_0x6f0a('0x2e')])[_0x6f0a('0x21')]+_0x6f0a('0x37'),'AttachmentId':_0x173ee5['id']})[_0x6f0a('0x3a')](function(_0x3f86d8){logger['error'](_0x5a73cd['uniqueid'],_0x6f0a('0x3b'),JSON['stringify'](_0x3f86d8));});})[_0x6f0a('0x3a')](function(_0x1b6364){logger[_0x6f0a('0x3c')](_0x5a73cd['uniqueid'],'\x20receiveFax\x20',JSON[_0x6f0a('0x3d')](_0x1b6364));});});}logger[_0x6f0a('0x22')](_0x5a73cd['uniqueid'],_0x6f0a('0x3e'));}};Fax['prototype'][_0x6f0a('0x3f')]=function(_0x5a6076){if(this[_0x6f0a('0x10')][_0x5a6076['uniqueid']]){_['merge'](this[_0x6f0a('0x1f')][_0x5a6076['uniqueid']],_[_0x6f0a('0x40')](_0x5a6076,[_0x6f0a('0x41'),_0x6f0a('0x42')]));}};function updateStatus(_0x27d437){if(_0x27d437[_0x6f0a('0x43')]){faxMessage['update'](_0x27d437[_0x6f0a('0x43')],{'failMessage':_0x6f0a('0x44')})[_0x6f0a('0x38')](function(_0xeb40b){ut[_0x6f0a('0x45')](_0x6f0a('0x46'),_0xeb40b);})[_0x6f0a('0x3a')](function(_0x22d3ad){ut[_0x6f0a('0x45')](_0x6f0a('0x47'),_0x22d3ad);});}else{ut[_0x6f0a('0x45')](_0x6f0a('0x48'));}}Fax[_0x6f0a('0x25')][_0x6f0a('0x49')]=function(_0x984389,_0x13d6ae,_0x49233e){var _0xd55de3=this;var _0x35906a={};if(_0x13d6ae){_0x35906a={'read':_0x13d6ae};}else{_0x35906a={'failMessage':_0x49233e};}if(this[_0x6f0a('0x10')][_0x984389]['AttachmentId']){faxMessage[_0x6f0a('0x4a')](this[_0x6f0a('0x10')][_0x984389]['AttachmentId'],_0x35906a)[_0x6f0a('0x38')](function(_0x3a5eca){ut[_0x6f0a('0x45')]('[Fax][Message][Updated]',_0x3a5eca);})[_0x6f0a('0x3a')](function(_0x5af590){ut[_0x6f0a('0x45')](_0x6f0a('0x4b'),_0x5af590);})['finally'](function(){delete _0xd55de3[_0x6f0a('0x1f')][_0x984389];delete _0xd55de3[_0x6f0a('0x10')][_0x984389];});}else{ut[_0x6f0a('0x45')](_0x6f0a('0x4c'));delete this[_0x6f0a('0x1f')][_0x984389];delete this[_0x6f0a('0x10')][_0x984389];}};Fax['prototype'][_0x6f0a('0x1a')]=function(_0x430c68){var _0x26e717=this;if(this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]]){if(this[_0x6f0a('0x10')][_0x430c68[_0x6f0a('0x20')]]){this['channels'][_0x430c68[_0x6f0a('0x20')]]['id']=this[_0x6f0a('0x10')][_0x430c68[_0x6f0a('0x20')]]['id'];this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]]['name']=this[_0x6f0a('0x10')][_0x430c68['uniqueid']]['name'];}logger[_0x6f0a('0x22')](_0x430c68['uniqueid'],this[_0x6f0a('0x10')][_0x430c68['uniqueid']]?_0x6f0a('0x4d'):_0x6f0a('0x4e'),JSON[_0x6f0a('0x3d')](this[_0x6f0a('0x1f')][_0x430c68['uniqueid']]));if(this['actions'][_0x430c68[_0x6f0a('0x20')]]){if(this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]][_0x6f0a('0x4f')]>0x0&&this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]][_0x6f0a('0x18')]==='SUCCESS'){this[_0x6f0a('0x49')](_0x430c68[_0x6f0a('0x20')],!![]);}else{this['updateStatus'](_0x430c68['uniqueid'],![],this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]][_0x6f0a('0x50')]?_0x6f0a('0x51')+this[_0x6f0a('0x1f')][_0x430c68[_0x6f0a('0x20')]][_0x6f0a('0x50')]:_0x6f0a('0x52'));}}}};Fax[_0x6f0a('0x25')][_0x6f0a('0x53')]=function(_0x2e6864){var _0x44608b=this;return new BPromise(function(_0xc30cd0,_0x463899){_0x44608b[_0x6f0a('0x54')](_0x2e6864,_0x44608b[_0x6f0a('0xe')][_0x2e6864[_0x6f0a('0x55')]])[_0x6f0a('0x38')](function(_0x18401f){ut[_0x6f0a('0x45')](_0x6f0a('0x56'),_0x18401f);_0xc30cd0(ut[_0x6f0a('0x36')](_0x6f0a('0x57')));})[_0x6f0a('0x3a')](function(_0x5e901b){ut[_0x6f0a('0x45')](_0x6f0a('0x58'),_0x5e901b);updateStatus(_0x2e6864);_0x463899(ut[_0x6f0a('0x36')](_0x6f0a('0x59')));});});};Fax[_0x6f0a('0x25')][_0x6f0a('0x5a')]=function(_0x2ecb2a){var _0x20f3e4=this;return new BPromise(function(_0x51b665,_0x5e2e9d){var _0x2a779c=_0x20f3e4['checkTrunk'](_0x20f3e4[_0x6f0a('0xe')][_0x2ecb2a[_0x6f0a('0x55')]][_0x6f0a('0x5b')],_0x2ecb2a);if(_0x2a779c[_0x6f0a('0x5c')]){_0x51b665(ut[_0x6f0a('0x36')](_0x6f0a('0x5d')));}else{_0x5e2e9d(ut[_0x6f0a('0x36')](_0x2a779c['message']));}});};function originate(_0x59b9bf,_0x1f8d8b,_0x52e624){return new BPromise(function(_0x4864a9,_0x25cf02){if(_0x52e624){var _0x5a1a6b=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x6f0a('0x5e')](_0x59b9bf[_0x6f0a('0x4')])['name'],_0x59b9bf[_0x6f0a('0x4')]);gs['execute'](_0x5a1a6b)[_0x6f0a('0x38')](function(){_0x59b9bf[_0x6f0a('0x4')]=util[_0x6f0a('0x5f')](_0x6f0a('0x60'),path['parse'](_0x59b9bf[_0x6f0a('0x4')])[_0x6f0a('0x61')],path[_0x6f0a('0x5e')](_0x59b9bf[_0x6f0a('0x4')])[_0x6f0a('0x21')]);_0x1f8d8b[_0x6f0a('0x62')]=_0x59b9bf['path'];ut[_0x6f0a('0x45')](_0x6f0a('0x63'),'');ami[_0x6f0a('0x64')](ut[_0x6f0a('0x65')](_0x59b9bf,_0x1f8d8b))[_0x6f0a('0x38')](function(_0x1853d8){_0x4864a9(_0x1853d8);})[_0x6f0a('0x3a')](function(_0x23bcb6){_0x25cf02(_0x23bcb6);});})[_0x6f0a('0x3a')](function(_0x44a4ad){_0x25cf02(_0x44a4ad);});}else{ami[_0x6f0a('0x64')](ut[_0x6f0a('0x65')](_0x59b9bf,_0x1f8d8b))[_0x6f0a('0x38')](function(_0x490912){_0x4864a9(_0x490912);})[_0x6f0a('0x3a')](function(_0xc55c3d){_0x25cf02(_0xc55c3d);});}});}Fax[_0x6f0a('0x25')][_0x6f0a('0x54')]=function(_0x332787,_0x33a8d5){var _0x8c752a=this;return new BPromise(function(_0x15c87a,_0x2268ea){var _0x58b1c6=uuid['v4']();var _0x563b7d=ut['addVariables'](_0x332787,_0x33a8d5);_0x8c752a[_0x6f0a('0x10')][_0x58b1c6]=new Action(_0x58b1c6,_0x33a8d5,_0x332787);var _0x1e463f=_0x8c752a['actions'][_0x58b1c6];if(path[_0x6f0a('0x5e')](_0x332787[_0x6f0a('0x4')])['ext']==='.pdf'){originate(_0x1e463f,_0x563b7d,!![])['then'](function(_0x1a9846){_0x15c87a(_0x1a9846);})[_0x6f0a('0x3a')](function(_0x3ad55b){_0x2268ea(_0x3ad55b);});}else{originate(_0x1e463f,_0x563b7d,![])['then'](function(_0x3bdd1c){_0x15c87a(_0x3bdd1c);})[_0x6f0a('0x3a')](function(_0x34f1ab){_0x2268ea(_0x34f1ab);});}});};Fax[_0x6f0a('0x25')][_0x6f0a('0x66')]=function(_0x437b13){return!_[_0x6f0a('0x67')](_0x437b13)&&!_[_0x6f0a('0x67')](_0x437b13['name'])&&!_['isNil'](_0x437b13[_0x6f0a('0x68')])&&_0x437b13[_0x6f0a('0x68')]&&!_[_0x6f0a('0x67')](this[_0x6f0a('0xf')][util[_0x6f0a('0x5f')](_0x6f0a('0x69'),_0x437b13[_0x6f0a('0x21')])])&&!_[_0x6f0a('0x67')](this[_0x6f0a('0xf')][util[_0x6f0a('0x5f')](_0x6f0a('0x69'),_0x437b13['name'])][_0x6f0a('0x2d')])&&(this[_0x6f0a('0xf')][util[_0x6f0a('0x5f')](_0x6f0a('0x69'),_0x437b13[_0x6f0a('0x21')])][_0x6f0a('0x2d')]===_0x6f0a('0x6a')||this[_0x6f0a('0xf')][util[_0x6f0a('0x5f')]('SIP/%s',_0x437b13['name'])][_0x6f0a('0x2d')]==='unmonitored');};Fax[_0x6f0a('0x25')][_0x6f0a('0x6b')]=function(_0x113e64,_0x2e7f1e){if(!this[_0x6f0a('0x66')](_0x113e64)){ut[_0x6f0a('0x45')](_0x6f0a('0x6c'),_[_0x6f0a('0x67')](_0x113e64)?'':_0x113e64[_0x6f0a('0x21')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x6f0a('0x6d')};}if(_[_0x6f0a('0x67')](_0x2e7f1e[_0x6f0a('0x7')])){ut[_0x6f0a('0x45')](_0x6f0a('0x6e'),JSON[_0x6f0a('0x3d')](_0x2e7f1e));return{'isValid':![],'message':_0x6f0a('0x6f')};}if(_['isNil'](_0x2e7f1e[_0x6f0a('0x4')])){ut['logger'](_0x6f0a('0x70'),JSON[_0x6f0a('0x3d')](_0x2e7f1e));return{'isValid':![],'message':_0x6f0a('0x71')};}return{'isValid':!![],'message':_0x6f0a('0x72')};};module['exports']=Fax; \ No newline at end of file +var _0x70a7=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','application/pdf','then','notify','parse','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','logger','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid'];(function(_0x19360a,_0x124f84){var _0x164092=function(_0x526b64){while(--_0x526b64){_0x19360a['push'](_0x19360a['shift']());}};_0x164092(++_0x124f84);}(_0x70a7,0x134));var _0x770a=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x70a7[_0x119705];return _0x2affc2;};'use strict';var util=require('util');var _=require(_0x770a('0x0'));var BPromise=require(_0x770a('0x1'));var uuid=require('uuid');var moment=require(_0x770a('0x2'));var path=require(_0x770a('0x3'));var tiff2pdf=require(_0x770a('0x4'));var gs=require(_0x770a('0x5'));var logger=require(_0x770a('0x6'))(_0x770a('0x7'));var ami=require(_0x770a('0x8'));var rpcDb=require(_0x770a('0x9'));var Channel=require('./channel');var ut=require(_0x770a('0xa'));var Action=require(_0x770a('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x770a('0xc'));function Fax(_0x47e138){this[_0x770a('0xd')]={};this[_0x770a('0xe')]=_0x47e138[_0x770a('0xe')];this[_0x770a('0xf')]=_0x47e138[_0x770a('0xf')];this[_0x770a('0x10')]={};ami['on'](_0x770a('0x11'),this[_0x770a('0x12')][_0x770a('0x13')](this));ami['on'](_0x770a('0x14'),this[_0x770a('0x15')][_0x770a('0x13')](this));ami['on'](_0x770a('0x16'),this['syncNewState']['bind'](this));ami['on'](_0x770a('0x17'),this['syncNewExten'][_0x770a('0x13')](this));ami['on'](_0x770a('0x18'),this[_0x770a('0x19')][_0x770a('0x13')](this));ami['on'](_0x770a('0x1a'),this[_0x770a('0x1b')][_0x770a('0x13')](this));ami['on'](_0x770a('0x1c'),this['syncHangup']['bind'](this));ami['on'](_0x770a('0x1d'),this[_0x770a('0x1e')]['bind'](this));}Fax['prototype'][_0x770a('0x12')]=function(_0x3bf1f1){if(_0x3bf1f1['context']===_0x770a('0x1f')){for(var _0x342e01 in this[_0x770a('0xe')]){if(this[_0x770a('0xe')][_0x770a('0x20')](_0x342e01)){if(_0x3bf1f1[_0x770a('0x21')]===this[_0x770a('0xe')][_0x342e01]['localstationid']){this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]={};this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]][_0x770a('0x23')]=_0x3bf1f1[_0x770a('0x23')];this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]['id']=this['faxAccounts'][_0x342e01]['id'];this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]['name']=this['faxAccounts'][_0x342e01][_0x770a('0x24')];logger[_0x770a('0x25')](_0x3bf1f1[_0x770a('0x22')],_0x770a('0x26'));}}}}if(this[_0x770a('0x10')][_0x3bf1f1['uniqueid']]){this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]={};this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]][_0x770a('0x23')]=_0x3bf1f1[_0x770a('0x23')];logger['info'](_0x3bf1f1[_0x770a('0x22')],_0x770a('0x26'));}};Fax['prototype'][_0x770a('0x15')]=function(_0x388bed){if(this[_0x770a('0xd')][_0x388bed[_0x770a('0x22')]]){for(var _0x2f217a in _0x388bed[_0x770a('0x27')]){if(_0x388bed[_0x770a('0x27')]['hasOwnProperty'](_0x2f217a)){this[_0x770a('0xd')][_0x388bed['uniqueid']][_0x2f217a]=_0x388bed[_0x770a('0x28')];}}}};Fax[_0x770a('0x29')][_0x770a('0x2a')]=function(_0x5397cb){if(this[_0x770a('0xd')][_0x5397cb[_0x770a('0x22')]]){this['channels'][_0x5397cb[_0x770a('0x22')]][_0x770a('0x2b')]=_0x5397cb[_0x770a('0x2b')];this[_0x770a('0xd')][_0x5397cb[_0x770a('0x22')]][_0x770a('0x2c')]=_0x5397cb[_0x770a('0x2c')];}};Fax['prototype'][_0x770a('0x2d')]=function(_0x4344cb){if(this[_0x770a('0xd')][_0x4344cb[_0x770a('0x22')]]){for(var _0x1c54cc in _0x4344cb[_0x770a('0x27')]){if(_0x4344cb[_0x770a('0x27')][_0x770a('0x20')](_0x1c54cc)){this[_0x770a('0xd')][_0x4344cb['uniqueid']][_0x1c54cc]=_0x4344cb['value'];}}}};Fax[_0x770a('0x29')][_0x770a('0x19')]=function(_0x463ef7){if(this[_0x770a('0xd')][_0x463ef7[_0x770a('0x22')]]){this['channels'][_0x463ef7['uniqueid']][_0x770a('0x2e')]=_0x463ef7['operation'];this[_0x770a('0xd')][_0x463ef7[_0x770a('0x22')]][_0x770a('0x2f')]=_0x463ef7[_0x770a('0x2f')];this['channels'][_0x463ef7[_0x770a('0x22')]][_0x770a('0x30')]=_0x463ef7[_0x770a('0x30')];this[_0x770a('0xd')][_0x463ef7['uniqueid']][_0x770a('0x31')]=_0x463ef7['filename'];logger[_0x770a('0x25')](_0x463ef7[_0x770a('0x22')],_0x770a('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0x36774d){var _0x5854cf=this;if(this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]){var _0x20762e=this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]['id'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x33')]=_0x36774d['remotestationid'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x34')]=_0x36774d[_0x770a('0x34')];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x30')]=_0x36774d['localstationid'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x35')]=_0x36774d['resolution'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x36')]=_0x36774d[_0x770a('0x36')];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x31')]=_0x36774d[_0x770a('0x31')];this['channels'][_0x36774d[_0x770a('0x22')]][_0x770a('0x37')]=_0x36774d[_0x770a('0x37')];if(this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x36774d['filename'],_0x770a('0x38'),function(_0x1a677a){logger[_0x770a('0x25')](_0x36774d[_0x770a('0x22')],_0x770a('0x39'),_0x1a677a[_0x770a('0x3a')]);attachment['create']({'name':path['parse'](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')],'basename':path['parse'](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')]+'.pdf','type':_0x770a('0x3b')})[_0x770a('0x3c')](function(_0x3e9aa7){faxAccount[_0x770a('0x3d')](_0x20762e,{'from':_0x36774d['calleridnum'],'mapKey':_0x770a('0x7'),'body':path[_0x770a('0x3e')](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')]+'.pdf','AttachmentId':_0x3e9aa7['id']})[_0x770a('0x3f')](function(_0x908c42){logger[_0x770a('0x40')](_0x36774d[_0x770a('0x22')],'\x20notify\x20',JSON[_0x770a('0x41')](_0x908c42));});})[_0x770a('0x3f')](function(_0x4e5a72){logger[_0x770a('0x40')](_0x36774d[_0x770a('0x22')],_0x770a('0x42'),JSON['stringify'](_0x4e5a72));});});}logger['info'](_0x36774d[_0x770a('0x22')],_0x770a('0x42'));}};Fax[_0x770a('0x29')][_0x770a('0x1e')]=function(_0x45d624){if(this[_0x770a('0x10')][_0x45d624[_0x770a('0x22')]]){_[_0x770a('0x43')](this[_0x770a('0xd')][_0x45d624[_0x770a('0x22')]],_[_0x770a('0x44')](_0x45d624,[_0x770a('0x45'),_0x770a('0x46')]));}};function updateStatus(_0x4e42d6){if(_0x4e42d6[_0x770a('0x47')]){faxMessage[_0x770a('0x48')](_0x4e42d6['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x770a('0x3c')](function(_0x19ca52){ut['logger'](_0x770a('0x49'),_0x19ca52);})[_0x770a('0x3f')](function(_0xf605da){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0xf605da);});}else{ut[_0x770a('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x770a('0x29')][_0x770a('0x4b')]=function(_0x14c0be,_0x721b77,_0x5e3168){var _0x4c88e0=this;var _0x59f7a3={};if(_0x721b77){_0x59f7a3={'read':_0x721b77};}else{_0x59f7a3={'failMessage':_0x5e3168};}if(this['actions'][_0x14c0be]['AttachmentId']){faxMessage[_0x770a('0x48')](this[_0x770a('0x10')][_0x14c0be]['AttachmentId'],_0x59f7a3)[_0x770a('0x3c')](function(_0x3855d5){ut['logger'](_0x770a('0x4c'),_0x3855d5);})[_0x770a('0x3f')](function(_0x157754){ut[_0x770a('0x4a')]('[Fax][Message][NoUpdate1]',_0x157754);})[_0x770a('0x4d')](function(){delete _0x4c88e0[_0x770a('0xd')][_0x14c0be];delete _0x4c88e0[_0x770a('0x10')][_0x14c0be];});}else{ut[_0x770a('0x4a')](_0x770a('0x4e'));delete this[_0x770a('0xd')][_0x14c0be];delete this[_0x770a('0x10')][_0x14c0be];}};Fax[_0x770a('0x29')]['syncHangup']=function(_0x1c6e5c){var _0x336a3b=this;if(this[_0x770a('0xd')][_0x1c6e5c['uniqueid']]){if(this['actions'][_0x1c6e5c[_0x770a('0x22')]]){this['channels'][_0x1c6e5c[_0x770a('0x22')]]['id']=this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]['id'];this['channels'][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x24')]=this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x24')];}logger['info'](_0x1c6e5c[_0x770a('0x22')],this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]?_0x770a('0x4f'):_0x770a('0x50'),JSON[_0x770a('0x41')](this[_0x770a('0xd')][_0x1c6e5c[_0x770a('0x22')]]));if(this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]){if(this['channels'][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x51')]>0x0&&this['channels'][_0x1c6e5c[_0x770a('0x22')]]['faxstatus']===_0x770a('0x52')){this['updateStatus'](_0x1c6e5c[_0x770a('0x22')],!![]);}else{this[_0x770a('0x4b')](_0x1c6e5c[_0x770a('0x22')],![],this['channels'][_0x1c6e5c['uniqueid']][_0x770a('0x53')]?_0x770a('0x54')+this[_0x770a('0xd')][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x770a('0x29')][_0x770a('0x55')]=function(_0x595626){var _0x529292=this;return new BPromise(function(_0x231c1,_0x519b4c){_0x529292['execOriginate'](_0x595626,_0x529292[_0x770a('0xe')][_0x595626[_0x770a('0x56')]])[_0x770a('0x3c')](function(_0x1c3569){ut[_0x770a('0x4a')](_0x770a('0x57'),_0x1c3569);_0x231c1(ut[_0x770a('0x3a')](_0x770a('0x58')));})[_0x770a('0x3f')](function(_0x3bef19){ut['logger']('[Fax][execOriginate][failure]',_0x3bef19);updateStatus(_0x595626);_0x519b4c(ut[_0x770a('0x3a')](_0x770a('0x59')));});});};Fax[_0x770a('0x29')][_0x770a('0x5a')]=function(_0x37ee03){var _0x247c5a=this;return new BPromise(function(_0x5e0377,_0x31ed7b){var _0x1c6833=_0x247c5a[_0x770a('0x5b')](_0x247c5a[_0x770a('0xe')][_0x37ee03['FaxAccountId']][_0x770a('0x5c')],_0x37ee03);if(_0x1c6833[_0x770a('0x5d')]){_0x5e0377(ut[_0x770a('0x3a')](_0x770a('0x5e')));}else{_0x31ed7b(ut[_0x770a('0x3a')](_0x1c6833[_0x770a('0x3a')]));}});};function originate(_0x5b57dd,_0x1725df,_0x157d17){return new BPromise(function(_0x1897ac,_0x4150c6){if(_0x157d17){var _0x709b8e=util[_0x770a('0x5f')]('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[_0x770a('0x3e')](_0x5b57dd[_0x770a('0x3')])[_0x770a('0x24')],_0x5b57dd[_0x770a('0x3')]);gs[_0x770a('0x60')](_0x709b8e)[_0x770a('0x3c')](function(){_0x5b57dd[_0x770a('0x3')]=util[_0x770a('0x5f')](_0x770a('0x61'),path['parse'](_0x5b57dd[_0x770a('0x3')])['dir'],path[_0x770a('0x3e')](_0x5b57dd[_0x770a('0x3')])['name']);_0x1725df[_0x770a('0x62')]=_0x5b57dd[_0x770a('0x3')];ut[_0x770a('0x4a')](_0x770a('0x63'),'');ami['Action'](ut[_0x770a('0x64')](_0x5b57dd,_0x1725df))['then'](function(_0x21abbe){_0x1897ac(_0x21abbe);})[_0x770a('0x3f')](function(_0x41b332){_0x4150c6(_0x41b332);});})[_0x770a('0x3f')](function(_0xb8c8d8){_0x4150c6(_0xb8c8d8);});}else{ami[_0x770a('0x65')](ut['variablesAction'](_0x5b57dd,_0x1725df))[_0x770a('0x3c')](function(_0x1c8cbb){_0x1897ac(_0x1c8cbb);})[_0x770a('0x3f')](function(_0x1fd348){_0x4150c6(_0x1fd348);});}});}Fax['prototype'][_0x770a('0x66')]=function(_0x25b2f5,_0x525f0c){var _0x89a70a=this;return new BPromise(function(_0x2fdb6a,_0x553682){var _0x277123=uuid['v4']();var _0x1fa743=ut[_0x770a('0x67')](_0x25b2f5,_0x525f0c);_0x89a70a['actions'][_0x277123]=new Action(_0x277123,_0x525f0c,_0x25b2f5);var _0x25a342=_0x89a70a[_0x770a('0x10')][_0x277123];if(path[_0x770a('0x3e')](_0x25b2f5[_0x770a('0x3')])[_0x770a('0x68')]===_0x770a('0x69')){originate(_0x25a342,_0x1fa743,!![])[_0x770a('0x3c')](function(_0x2e8807){_0x2fdb6a(_0x2e8807);})[_0x770a('0x3f')](function(_0x3489bf){_0x553682(_0x3489bf);});}else{originate(_0x25a342,_0x1fa743,![])[_0x770a('0x3c')](function(_0x30c506){_0x2fdb6a(_0x30c506);})[_0x770a('0x3f')](function(_0x1e147b){_0x553682(_0x1e147b);});}});};Fax[_0x770a('0x29')][_0x770a('0x6a')]=function(_0x408c79){return!_['isNil'](_0x408c79)&&!_[_0x770a('0x6b')](_0x408c79[_0x770a('0x24')])&&!_['isNil'](_0x408c79[_0x770a('0x6c')])&&_0x408c79[_0x770a('0x6c')]&&!_['isNil'](this['trunks'][util[_0x770a('0x5f')]('SIP/%s',_0x408c79[_0x770a('0x24')])])&&!_[_0x770a('0x6b')](this[_0x770a('0xf')][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')])&&(this[_0x770a('0xf')][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')]==='reachable'||this['trunks'][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')]===_0x770a('0x6e'));};Fax[_0x770a('0x29')][_0x770a('0x5b')]=function(_0x43697e,_0xfddb0){if(!this[_0x770a('0x6a')](_0x43697e)){ut[_0x770a('0x4a')](_0x770a('0x6f'),_['isNil'](_0x43697e)?'':_0x43697e['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x770a('0x70')};}if(_['isNil'](_0xfddb0[_0x770a('0x7')])){ut[_0x770a('0x4a')](_0x770a('0x71'),JSON[_0x770a('0x41')](_0xfddb0));return{'isValid':![],'message':_0x770a('0x72')};}if(_[_0x770a('0x6b')](_0xfddb0[_0x770a('0x3')])){ut[_0x770a('0x4a')](_0x770a('0x73'),JSON[_0x770a('0x41')](_0xfddb0));return{'isValid':![],'message':_0x770a('0x74')};}return{'isValid':!![],'message':_0x770a('0x75')};};module[_0x770a('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6e198ac..66bdd18 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 _0x67f3=['lodash','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x67f3,0xce));var _0x367f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x67f3[_0x46e363];return _0x3fb059;};'use strict';var util=require('util');var BPromise=require(_0x367f('0x0'));var logger=require(_0x367f('0x1'))(_0x367f('0x2'));var _=require(_0x367f('0x3'));var faxAccount=require(_0x367f('0x4'));function loggerCatch(_0x1d5fe9){return function(_0x281b1b){logger[_0x367f('0x5')](_0x1d5fe9,util[_0x367f('0x6')](_0x281b1b,{'showHidden':![],'depth':null}));};}exports[_0x367f('0x7')]=function(_0x25e1e1,_0x17e425){return BPromise['resolve']()[_0x367f('0x8')](faxAccount[_0x367f('0x7')](_0x25e1e1,_0x17e425))[_0x367f('0x9')](loggerCatch(_0x367f('0xa')));}; \ No newline at end of file +var _0xa67c=['bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','notify','resolve','then','util'];(function(_0x4b2571,_0x20d8f3){var _0x2c571c=function(_0x51029c){while(--_0x51029c){_0x4b2571['push'](_0x4b2571['shift']());}};_0x2c571c(++_0x20d8f3);}(_0xa67c,0x11f));var _0xca67=function(_0x5e43e8,_0x336881){_0x5e43e8=_0x5e43e8-0x0;var _0x139dfa=_0xa67c[_0x5e43e8];return _0x139dfa;};'use strict';var util=require(_0xca67('0x0'));var BPromise=require(_0xca67('0x1'));var logger=require(_0xca67('0x2'))('preview');var _=require(_0xca67('0x3'));var faxAccount=require(_0xca67('0x4'));function loggerCatch(_0x51f781){return function(_0x8808b8){logger[_0xca67('0x5')](_0x51f781,util['inspect'](_0x8808b8,{'showHidden':![],'depth':null}));};}exports[_0xca67('0x6')]=function(_0x368d3b,_0x33a1ae){return BPromise[_0xca67('0x7')]()[_0xca67('0x8')](faxAccount[_0xca67('0x6')](_0x368d3b,_0x33a1ae))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 4590269..f5cbead 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 _0x2547=['Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x1af25e,_0x35c029){var _0x15318e=function(_0x4d8845){while(--_0x4d8845){_0x1af25e['push'](_0x1af25e['shift']());}};_0x15318e(++_0x35c029);}(_0x2547,0x92));var _0x7254=function(_0x22b257,_0xc85f7e){_0x22b257=_0x22b257-0x0;var _0x11fb1f=_0x2547[_0x22b257];return _0x11fb1f;};'use strict';var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var BPromise=require(_0x7254('0x3'));var exec=require(_0x7254('0x4'))[_0x7254('0x5')];exports[_0x7254('0x6')]=function(_0x1f9aca){return new BPromise(function(_0x36c426,_0x5056da){exec(_0x1f9aca,function(_0x5c26ac,_0x1088bc,_0x576d8c){logger[_0x7254('0x7')](_0x7254('0x8'),_0x1088bc);if(_0x5c26ac){logger[_0x7254('0x7')](_0x7254('0x8'),_0x7254('0x9'),util[_0x7254('0xa')](_0x5c26ac,{'showHidden':![],'depth':null}),_0x1088bc,_0x576d8c);_0x5056da(_0x5c26ac);}_0x36c426(_0x1088bc);});});}; \ No newline at end of file +var _0xc0dd=['util','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0dd,0xb8));var _0xdc0d=function(_0x3a05dd,_0x3d7b00){_0x3a05dd=_0x3a05dd-0x0;var _0x3beb75=_0xc0dd[_0x3a05dd];return _0x3beb75;};'use strict';var util=require(_0xdc0d('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xdc0d('0x1'));var exec=require('child_process')[_0xdc0d('0x2')];exports[_0xdc0d('0x3')]=function(_0xeba1da){return new BPromise(function(_0x407115,_0x46f223){exec(_0xeba1da,function(_0x5c9708,_0x53ce88,_0x285e7f){logger[_0xdc0d('0x4')](_0xdc0d('0x5'),_0x53ce88);if(_0x5c9708){logger['info'](_0xdc0d('0x5'),_0xdc0d('0x6'),util[_0xdc0d('0x7')](_0x5c9708,{'showHidden':![],'depth':null}),_0x53ce88,_0x285e7f);_0x46f223(_0x5c9708);}_0x407115(_0x53ce88);});});}; \ 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 baac970..c9b3471 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 _0x3fe5=['util','moment','../../../../config/logger','fax','logger','inspect','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>'];(function(_0x63db7d,_0x33f080){var _0x4576f0=function(_0x1c21a3){while(--_0x1c21a3){_0x63db7d['push'](_0x63db7d['shift']());}};_0x4576f0(++_0x33f080);}(_0x3fe5,0x1b8));var _0x53fe=function(_0x546950,_0x331303){_0x546950=_0x546950-0x0;var _0xd2d140=_0x3fe5[_0x546950];return _0xd2d140;};'use strict';var util=require(_0x53fe('0x0'));var _=require('lodash');var moment=require(_0x53fe('0x1'));var logger=require(_0x53fe('0x2'))(_0x53fe('0x3'));exports['message']=function(_0x397b87){return{'message':_0x397b87};};exports[_0x53fe('0x4')]=function(_0xca90e9,_0x1d88b6){logger['info'](_0xca90e9,util[_0x53fe('0x5')](_0x1d88b6,{'showHidden':![],'depth':null}));};exports[_0x53fe('0x6')]=function(_0x2295ca,_0x2725a9){var _0x550e43={'XMF-ECM':_0x2725a9[_0x53fe('0x7')],'XMF-HEADERINFO':_0x2725a9[_0x53fe('0x8')],'XMF-MINRATE':_0x2725a9['minrate'],'XMF-MAXRATE':_0x2725a9[_0x53fe('0x9')],'XMF-MODEM':util['format'](_0x53fe('0xa'),_0x2725a9[_0x53fe('0xb')]),'XMF-GATEWAY':_0x2725a9[_0x53fe('0xc')],'XMF-FAXDETECT':_0x2725a9[_0x53fe('0xd')],'XMF-T38TIMEOUT':_0x2725a9[_0x53fe('0xe')],'XMF-LOCALSTATIONID':_0x2725a9[_0x53fe('0xf')],'XMF-PATH':_0x2295ca['path']};return _0x550e43;};exports['variablesAction']=function(_0xd3f0cd,_0x50efd7){return{'actionid':_0xd3f0cd[_0x53fe('0x10')],'action':_0x53fe('0x11'),'channel':_0xd3f0cd[_0x53fe('0x12')],'Exten':_0x53fe('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0x53fe('0x14')](_0x53fe('0x15'),_0xd3f0cd[_0x53fe('0x8')]?_0xd3f0cd['headerinfo']:'',_0xd3f0cd['localstationid']),'variable':_0x50efd7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xd3f0cd[_0x53fe('0x10')]};}; \ No newline at end of file +var _0x7ca2=['maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','headerinfo'];(function(_0x174c68,_0x23e307){var _0x440378=function(_0x20e4e9){while(--_0x20e4e9){_0x174c68['push'](_0x174c68['shift']());}};_0x440378(++_0x23e307);}(_0x7ca2,0xdd));var _0x27ca=function(_0x4609b7,_0x5e5c19){_0x4609b7=_0x4609b7-0x0;var _0x3f4757=_0x7ca2[_0x4609b7];return _0x3f4757;};'use strict';var util=require(_0x27ca('0x0'));var _=require(_0x27ca('0x1'));var moment=require(_0x27ca('0x2'));var logger=require(_0x27ca('0x3'))(_0x27ca('0x4'));exports[_0x27ca('0x5')]=function(_0x1a0a1e){return{'message':_0x1a0a1e};};exports['logger']=function(_0x26bbca,_0x1c5098){logger[_0x27ca('0x6')](_0x26bbca,util[_0x27ca('0x7')](_0x1c5098,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x291384,_0x56760e){var _0x33b78c={'XMF-ECM':_0x56760e['ecm'],'XMF-HEADERINFO':_0x56760e[_0x27ca('0x8')],'XMF-MINRATE':_0x56760e['minrate'],'XMF-MAXRATE':_0x56760e[_0x27ca('0x9')],'XMF-MODEM':util[_0x27ca('0xa')](_0x27ca('0xb'),_0x56760e['modem']),'XMF-GATEWAY':_0x56760e[_0x27ca('0xc')],'XMF-FAXDETECT':_0x56760e[_0x27ca('0xd')],'XMF-T38TIMEOUT':_0x56760e[_0x27ca('0xe')],'XMF-LOCALSTATIONID':_0x56760e[_0x27ca('0xf')],'XMF-PATH':_0x291384[_0x27ca('0x10')]};return _0x33b78c;};exports[_0x27ca('0x11')]=function(_0x4ffbcb,_0x1963f5){return{'actionid':_0x4ffbcb['uniqueid'],'action':_0x27ca('0x12'),'channel':_0x4ffbcb[_0x27ca('0x13')],'Exten':_0x27ca('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x27ca('0xa')](_0x27ca('0x15'),_0x4ffbcb[_0x27ca('0x8')]?_0x4ffbcb['headerinfo']:'',_0x4ffbcb[_0x27ca('0xf')]),'variable':_0x1963f5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4ffbcb[_0x27ca('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index dc32ec9..41a4fd1 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 _0xacd1=['getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','listen','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x2c0389,_0x2d49e0){var _0x4d70d2=function(_0x4f55fb){while(--_0x4f55fb){_0x2c0389['push'](_0x2c0389['shift']());}};_0x4d70d2(++_0x2d49e0);}(_0xacd1,0x160));var _0x1acd=function(_0x568781,_0x45539f){_0x568781=_0x568781-0x0;var _0x3ca732=_0xacd1[_0x568781];return _0x3ca732;};'use strict';var BPromise=require(_0x1acd('0x0'));var util=require(_0x1acd('0x1'));var moment=require(_0x1acd('0x2'));var server=require('./server');var Realtime=require(_0x1acd('0x3'));var Report=require(_0x1acd('0x4'));var Acw=require(_0x1acd('0x5'));var Trigger=require(_0x1acd('0x6'));var Dialer=require('./dialer');var Preview=require(_0x1acd('0x7'));var Fax=require(_0x1acd('0x8'));var user=require(_0x1acd('0x9'));var voiceQueue=require(_0x1acd('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x1acd('0xb'));var trunk=require(_0x1acd('0xc'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x1acd('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1acd('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x1acd('0xf'));var sugarcrm=require(_0x1acd('0x10'));var freshdesk=require(_0x1acd('0x11'));var desk=require(_0x1acd('0x12'));var zoho=require(_0x1acd('0x13'));var vtiger=require(_0x1acd('0x14'));var freshsales=require(_0x1acd('0x15'));var servicenow=require(_0x1acd('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1acd('0x17')](_0x1acd('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x1acd('0x19')](user[_0x1acd('0x1a')]())[_0x1acd('0x19')](realtime[_0x1acd('0x1b')]())[_0x1acd('0x19')](user[_0x1acd('0x1c')]())[_0x1acd('0x19')](realtime[_0x1acd('0x1d')]())[_0x1acd('0x19')](trunk[_0x1acd('0x1e')]())[_0x1acd('0x19')](realtime['initTrunks']())[_0x1acd('0x19')](voiceQueue[_0x1acd('0x1f')]())[_0x1acd('0x19')](realtime[_0x1acd('0x20')]())[_0x1acd('0x19')](trigger[_0x1acd('0x21')]())[_0x1acd('0x19')](realtime['initTriggers']())[_0x1acd('0x19')](template[_0x1acd('0x22')]())[_0x1acd('0x19')](realtime[_0x1acd('0x23')]())[_0x1acd('0x19')](zendesk['getZendeskAccounts']())[_0x1acd('0x19')](realtime[_0x1acd('0x24')]())[_0x1acd('0x19')](salesforce[_0x1acd('0x25')]())[_0x1acd('0x19')](realtime[_0x1acd('0x26')]())[_0x1acd('0x19')](sugarcrm[_0x1acd('0x27')]())[_0x1acd('0x19')](realtime[_0x1acd('0x28')]())[_0x1acd('0x19')](freshdesk['getFreshdeskAccounts']())[_0x1acd('0x19')](realtime['initFreshdeskAccounts']())[_0x1acd('0x19')](desk[_0x1acd('0x29')]())[_0x1acd('0x19')](realtime[_0x1acd('0x2a')]())[_0x1acd('0x19')](zoho[_0x1acd('0x2b')]())[_0x1acd('0x19')](realtime[_0x1acd('0x2c')]())['then'](vtiger[_0x1acd('0x2d')]())[_0x1acd('0x19')](realtime[_0x1acd('0x2e')]())[_0x1acd('0x19')](freshsales[_0x1acd('0x2f')]())[_0x1acd('0x19')](realtime[_0x1acd('0x30')]())['then'](servicenow[_0x1acd('0x31')]())['then'](realtime['initServicenowAccounts']())[_0x1acd('0x19')](dynamics365[_0x1acd('0x32')]())['then'](realtime[_0x1acd('0x33')]())[_0x1acd('0x19')](campaign[_0x1acd('0x34')]())[_0x1acd('0x19')](realtime[_0x1acd('0x35')]())[_0x1acd('0x19')](voiceExtension[_0x1acd('0x36')]())[_0x1acd('0x19')](realtime[_0x1acd('0x37')]())['then'](faxAccount[_0x1acd('0x38')]())['then'](realtime[_0x1acd('0x39')]())[_0x1acd('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x1acd('0x3a')]()[_0x1acd('0x19')](voiceQueueReport[_0x1acd('0x3b')]())['then'](realtime[_0x1acd('0x3c')]())[_0x1acd('0x19')](cmHopperHistory[_0x1acd('0x3d')]())[_0x1acd('0x19')](realtime['initVoiceQueueHopperHistory']())[_0x1acd('0x19')](cmHopperHistory[_0x1acd('0x3e')]())[_0x1acd('0x19')](realtime[_0x1acd('0x3f')]())[_0x1acd('0x19')](voiceCallReport[_0x1acd('0x40')]())[_0x1acd('0x19')](realtime['initVoiceCallReports']())[_0x1acd('0x19')](function(_0x7da7a6){})[_0x1acd('0x41')](function(_0x40c1d2){console['log'](_0x40c1d2);});}function main(){return server[_0x1acd('0x42')](realtime,preview,fax)[_0x1acd('0x19')](function(_0x392a8d){return initRealtime();})[_0x1acd('0x19')](function(){return initParams();})[_0x1acd('0x19')](function(){report[_0x1acd('0x43')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x160557){console['log'](_0x160557);});}main(); \ No newline at end of file +var _0xd780=['getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','hour','get','resolve','getAgents','initAgents','getTelephones','then','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0xd780,0x1d2));var _0x0d78=function(_0x4ad861,_0x12cc40){_0x4ad861=_0x4ad861-0x0;var _0x3ff01f=_0xd780[_0x4ad861];return _0x3ff01f;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0x0d78('0x0'));var Realtime=require(_0x0d78('0x1'));var Report=require('./report');var Acw=require(_0x0d78('0x2'));var Trigger=require(_0x0d78('0x3'));var Dialer=require(_0x0d78('0x4'));var Preview=require(_0x0d78('0x5'));var Fax=require(_0x0d78('0x6'));var user=require(_0x0d78('0x7'));var voiceQueue=require(_0x0d78('0x8'));var voiceQueueReport=require(_0x0d78('0x9'));var voiceCallReport=require(_0x0d78('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x0d78('0xb'));var template=require(_0x0d78('0xc'));var cmHopperHistory=require(_0x0d78('0xd'));var campaign=require(_0x0d78('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x0d78('0xf'));var zendesk=require(_0x0d78('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x0d78('0x11'));var freshdesk=require(_0x0d78('0x12'));var desk=require(_0x0d78('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x0d78('0x14'));var freshsales=require(_0x0d78('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0d78('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x0d78('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0d78('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0d78('0x19')]()['then'](user[_0x0d78('0x1a')]())['then'](realtime[_0x0d78('0x1b')]())['then'](user[_0x0d78('0x1c')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x1e')]())[_0x0d78('0x1d')](trunk['getTrunks']())['then'](realtime[_0x0d78('0x1f')]())[_0x0d78('0x1d')](voiceQueue['getVoiceQueues']())[_0x0d78('0x1d')](realtime[_0x0d78('0x20')]())[_0x0d78('0x1d')](trigger[_0x0d78('0x21')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x22')]())[_0x0d78('0x1d')](template['getTemplates']())[_0x0d78('0x1d')](realtime[_0x0d78('0x23')]())[_0x0d78('0x1d')](zendesk[_0x0d78('0x24')]())[_0x0d78('0x1d')](realtime['initZendeskAccounts']())[_0x0d78('0x1d')](salesforce[_0x0d78('0x25')]())['then'](realtime[_0x0d78('0x26')]())['then'](sugarcrm[_0x0d78('0x27')]())[_0x0d78('0x1d')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x0d78('0x28')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x29')]())[_0x0d78('0x1d')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x0d78('0x1d')](zoho[_0x0d78('0x2a')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x2b')]())['then'](vtiger['getVtigerAccounts']())[_0x0d78('0x1d')](realtime[_0x0d78('0x2c')]())[_0x0d78('0x1d')](freshsales['getFreshsalesAccounts']())[_0x0d78('0x1d')](realtime[_0x0d78('0x2d')]())[_0x0d78('0x1d')](servicenow[_0x0d78('0x2e')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x2f')]())[_0x0d78('0x1d')](dynamics365[_0x0d78('0x30')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x31')]())['then'](campaign['getCampaigns']())[_0x0d78('0x1d')](realtime[_0x0d78('0x32')]())[_0x0d78('0x1d')](voiceExtension['getVoiceExtensions']())[_0x0d78('0x1d')](realtime[_0x0d78('0x33')]())[_0x0d78('0x1d')](faxAccount[_0x0d78('0x34')]())['then'](realtime[_0x0d78('0x35')]())[_0x0d78('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x0d78('0x19')]()[_0x0d78('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x0d78('0x1d')](realtime['initVoiceQueueReports']())[_0x0d78('0x1d')](cmHopperHistory[_0x0d78('0x36')]())['then'](realtime[_0x0d78('0x37')]())[_0x0d78('0x1d')](cmHopperHistory[_0x0d78('0x38')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x39')]())[_0x0d78('0x1d')](voiceCallReport[_0x0d78('0x3a')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x3b')]())['then'](function(_0x158749){})[_0x0d78('0x3c')](function(_0x5ea896){console[_0x0d78('0x3d')](_0x5ea896);});}function main(){return server[_0x0d78('0x3e')](realtime,preview,fax)[_0x0d78('0x1d')](function(_0x3a28eb){return initRealtime();})[_0x0d78('0x1d')](function(){return initParams();})[_0x0d78('0x1d')](function(){report[_0x0d78('0x3f')]();setInterval(initRealtime,0x1388);})[_0x0d78('0x3c')](function(_0x1f92eb){console[_0x0d78('0x3d')](_0x1f92eb);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3ff19f6..09e74a3 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x55acb9,_0x1e7fda){var _0x2e96b3=function(_0xc52ff3){while(--_0xc52ff3){_0x55acb9['push'](_0x55acb9['shift']());}};_0x2e96b3(++_0x1e7fda);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f4d6f,_0x51aac7){_0x1f4d6f=_0x1f4d6f-0x0;var _0x389e47=_0xedd9[_0x1f4d6f];return _0x389e47;};'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 295b0e0..cdfeb71 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 _0x8f16=['ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp'];(function(_0x84c261,_0x2cfcbd){var _0x4d4432=function(_0x4900cf){while(--_0x4900cf){_0x84c261['push'](_0x84c261['shift']());}};_0x4d4432(++_0x2cfcbd);}(_0x8f16,0x88));var _0x68f1=function(_0x39aef8,_0x408b06){_0x39aef8=_0x39aef8-0x0;var _0x43e31c=_0x8f16[_0x39aef8];return _0x43e31c;};'use strict';function Campaign(_0x43e988){this['id']=_0x43e988['id']||0x0;this[_0x68f1('0x0')]=_0x43e988[_0x68f1('0x0')]||'';this[_0x68f1('0x1')]=_0x43e988[_0x68f1('0x1')]||_0x68f1('0x2');this[_0x68f1('0x3')]=0x0;this[_0x68f1('0x4')]=0x0;this[_0x68f1('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x68f1('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x68f1('0x7')]=_0x43e988[_0x68f1('0x7')];this['limitCalls']=_0x43e988[_0x68f1('0x8')];this[_0x68f1('0x9')]=_0x43e988[_0x68f1('0x9')]||null;this[_0x68f1('0xa')]=_0x43e988[_0x68f1('0xa')]?_0x43e988[_0x68f1('0xa')]:null;this['dialOriginateCallerIdName']=_0x43e988['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x43e988[_0x68f1('0xb')];this['dialOriginateTimeout']=_0x43e988[_0x68f1('0xc')]||0x1e;this[_0x68f1('0xd')]=_0x43e988[_0x68f1('0xd')];this[_0x68f1('0xe')]=_0x43e988['dialCongestionRetryFrequency'];this[_0x68f1('0xf')]=_0x43e988[_0x68f1('0xf')];this[_0x68f1('0x10')]=_0x43e988[_0x68f1('0x10')];this[_0x68f1('0x11')]=_0x43e988[_0x68f1('0x11')];this['dialNoAnswerRetryFrequency']=_0x43e988[_0x68f1('0x12')];this[_0x68f1('0x13')]=_0x43e988['dialGlobalMaxRetry'];this[_0x68f1('0x14')]=_0x43e988[_0x68f1('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x43e988[_0x68f1('0x15')]||0x96;this[_0x68f1('0x16')]=_0x43e988[_0x68f1('0x16')]||0x3;this[_0x68f1('0x17')]=_0x43e988[_0x68f1('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x43e988['dialAbandonedMaxRetry']||0x3;this[_0x68f1('0x18')]=_0x43e988[_0x68f1('0x18')]||0x96;this[_0x68f1('0x19')]=_0x43e988['dialMachineMaxRetry']||0x3;this[_0x68f1('0x1a')]=_0x43e988[_0x68f1('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x43e988[_0x68f1('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x43e988['dialAgentRejectRetryFrequency']||0x96;this[_0x68f1('0x1c')]=_0x43e988[_0x68f1('0x1c')]||'DESC';this[_0x68f1('0x1d')]=_0x43e988['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x43e988['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x43e988[_0x68f1('0x1e')]||undefined;this[_0x68f1('0x1f')]=_0x43e988[_0x68f1('0x1f')]?_0x43e988['TrunkBackup']:undefined;this[_0x68f1('0x20')]=_0x43e988['Trunk']?_0x43e988['Trunk']:undefined;this[_0x68f1('0x21')]=_0x43e988[_0x68f1('0x21')]?_0x43e988[_0x68f1('0x21')]:undefined;this['SquareProject']=_0x43e988['SquareProject']?_0x43e988[_0x68f1('0x22')]:undefined;this[_0x68f1('0x23')]=_0x43e988[_0x68f1('0x22')]?_0x43e988[_0x68f1('0x22')][_0x68f1('0x0')]:undefined;this[_0x68f1('0x24')]=_0x43e988[_0x68f1('0x24')]||![];this[_0x68f1('0x25')]=_0x43e988['dialAMDInitialSilence'];this[_0x68f1('0x26')]=_0x43e988[_0x68f1('0x26')];this[_0x68f1('0x27')]=_0x43e988[_0x68f1('0x27')];this[_0x68f1('0x28')]=_0x43e988[_0x68f1('0x28')];this['dialAMDMinWordLength']=_0x43e988[_0x68f1('0x29')];this[_0x68f1('0x2a')]=_0x43e988[_0x68f1('0x2a')];this[_0x68f1('0x2b')]=_0x43e988[_0x68f1('0x2b')];this[_0x68f1('0x2c')]=_0x43e988[_0x68f1('0x2c')];this[_0x68f1('0x2d')]=_0x43e988[_0x68f1('0x2d')];}module[_0x68f1('0x2e')]=Campaign; \ No newline at end of file +var _0x32ca=['SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x5ad82e,_0x3a21c5){var _0x288010=function(_0x289bf8){while(--_0x289bf8){_0x5ad82e['push'](_0x5ad82e['shift']());}};_0x288010(++_0x3a21c5);}(_0x32ca,0x19c));var _0xa32c=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0x32ca[_0x2299e8];return _0x433c0e;};'use strict';function Campaign(_0x3aec2d){this['id']=_0x3aec2d['id']||0x0;this['name']=_0x3aec2d[_0xa32c('0x0')]||'';this[_0xa32c('0x1')]=_0x3aec2d[_0xa32c('0x1')]||_0xa32c('0x2');this[_0xa32c('0x3')]=0x0;this[_0xa32c('0x4')]=0x0;this[_0xa32c('0x5')]=0x0;this[_0xa32c('0x6')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x3aec2d['active'];this[_0xa32c('0x7')]=_0x3aec2d[_0xa32c('0x7')];this[_0xa32c('0x8')]=_0x3aec2d[_0xa32c('0x8')]||null;this[_0xa32c('0x9')]=_0x3aec2d['dialGlobalInterval']?_0x3aec2d['dialGlobalInterval']:null;this[_0xa32c('0xa')]=_0x3aec2d['dialOriginateCallerIdName'];this[_0xa32c('0xb')]=_0x3aec2d['dialOriginateCallerIdNumber'];this[_0xa32c('0xc')]=_0x3aec2d['dialOriginateTimeout']||0x1e;this[_0xa32c('0xd')]=_0x3aec2d[_0xa32c('0xd')];this[_0xa32c('0xe')]=_0x3aec2d[_0xa32c('0xe')];this[_0xa32c('0xf')]=_0x3aec2d[_0xa32c('0xf')];this[_0xa32c('0x10')]=_0x3aec2d[_0xa32c('0x10')];this[_0xa32c('0x11')]=_0x3aec2d[_0xa32c('0x11')];this['dialNoAnswerRetryFrequency']=_0x3aec2d[_0xa32c('0x12')];this['dialGlobalMaxRetry']=_0x3aec2d[_0xa32c('0x13')];this[_0xa32c('0x14')]=_0x3aec2d[_0xa32c('0x14')]||0x3;this[_0xa32c('0x15')]=_0x3aec2d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa32c('0x16')]=_0x3aec2d[_0xa32c('0x16')]||0x3;this['dialDropRetryFrequency']=_0x3aec2d[_0xa32c('0x17')]||0x96;this[_0xa32c('0x18')]=_0x3aec2d[_0xa32c('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x3aec2d[_0xa32c('0x19')]||0x96;this[_0xa32c('0x1a')]=_0x3aec2d[_0xa32c('0x1a')]||0x3;this[_0xa32c('0x1b')]=_0x3aec2d['dialMachineRetryFrequency']||0x96;this[_0xa32c('0x1c')]=_0x3aec2d[_0xa32c('0x1c')]||0x3;this[_0xa32c('0x1d')]=_0x3aec2d['dialAgentRejectRetryFrequency']||0x96;this[_0xa32c('0x1e')]=_0x3aec2d['dialOrderByScheduledAt']||_0xa32c('0x1f');this[_0xa32c('0x20')]=_0x3aec2d[_0xa32c('0x20')]||undefined;this[_0xa32c('0x21')]=_0x3aec2d[_0xa32c('0x21')]||undefined;this['dialCutDigit']=_0x3aec2d[_0xa32c('0x22')]||undefined;this[_0xa32c('0x23')]=_0x3aec2d[_0xa32c('0x23')]?_0x3aec2d[_0xa32c('0x23')]:undefined;this[_0xa32c('0x24')]=_0x3aec2d['Trunk']?_0x3aec2d[_0xa32c('0x24')]:undefined;this[_0xa32c('0x25')]=_0x3aec2d[_0xa32c('0x25')]?_0x3aec2d['Interval']:undefined;this[_0xa32c('0x26')]=_0x3aec2d[_0xa32c('0x26')]?_0x3aec2d[_0xa32c('0x26')]:undefined;this[_0xa32c('0x27')]=_0x3aec2d[_0xa32c('0x26')]?_0x3aec2d['SquareProject']['name']:undefined;this['dialAMDActive']=_0x3aec2d['dialAMDActive']||![];this[_0xa32c('0x28')]=_0x3aec2d[_0xa32c('0x28')];this['dialAMDGreeting']=_0x3aec2d[_0xa32c('0x29')];this[_0xa32c('0x2a')]=_0x3aec2d[_0xa32c('0x2a')];this['dialAMDTotalAnalysisTime']=_0x3aec2d[_0xa32c('0x2b')];this[_0xa32c('0x2c')]=_0x3aec2d['dialAMDMinWordLength'];this[_0xa32c('0x2d')]=_0x3aec2d['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x3aec2d[_0xa32c('0x2e')];this['dialAMDSilenceThreshold']=_0x3aec2d[_0xa32c('0x2f')];this[_0xa32c('0x30')]=_0x3aec2d[_0xa32c('0x30')];}module[_0xa32c('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 caceadc..b02e67f 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 _0xcbcd=['tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastdata','duration','type'];(function(_0x414935,_0x447c67){var _0x4eed8e=function(_0x56878f){while(--_0x56878f){_0x414935['push'](_0x414935['shift']());}};_0x4eed8e(++_0x447c67);}(_0xcbcd,0x1bb));var _0xdcbc=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xcbcd[_0x4d08b8];return _0x70214a;};'use strict';function Channel(){this['starttime']=null;this[_0xdcbc('0x0')]='';this[_0xdcbc('0x1')]='';this[_0xdcbc('0x2')]=0x0;this[_0xdcbc('0x3')]='';this[_0xdcbc('0x4')]=undefined;this[_0xdcbc('0x5')]=undefined;this['accountcode']=0x0;this[_0xdcbc('0x6')]='';this[_0xdcbc('0x7')]=0x0;this[_0xdcbc('0x8')]=0x0;this[_0xdcbc('0x9')]=0x0;this['answered']=![];this[_0xdcbc('0xa')]=null;this[_0xdcbc('0xb')]=null;this['unmanaged']=![];this[_0xdcbc('0xc')]=![];this['lastapplication']='';this[_0xdcbc('0xd')]='';this[_0xdcbc('0xe')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xdcbc('0xf')]=null;this[_0xdcbc('0x10')]=null;this[_0xdcbc('0x11')]=null;this[_0xdcbc('0x12')]=![];this[_0xdcbc('0x13')]=null;this[_0xdcbc('0x14')]=null;this[_0xdcbc('0x15')]=[];this[_0xdcbc('0x16')]=undefined;this[_0xdcbc('0x17')]=undefined;this[_0xdcbc('0x18')]=undefined;this[_0xdcbc('0x19')]=0x0;}module[_0xdcbc('0x1a')]=Channel; \ No newline at end of file +var _0x8b26=['queue','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','tag','disposition','monitor'];(function(_0x44541c,_0x43eb5b){var _0x244fb1=function(_0x2e2068){while(--_0x2e2068){_0x44541c['push'](_0x44541c['shift']());}};_0x244fb1(++_0x43eb5b);}(_0x8b26,0x1f3));var _0x68b2=function(_0x36fd79,_0x5c2f22){_0x36fd79=_0x36fd79-0x0;var _0x1347c1=_0x8b26[_0x36fd79];return _0x1347c1;};'use strict';function Channel(){this[_0x68b2('0x0')]=null;this[_0x68b2('0x1')]='';this[_0x68b2('0x2')]='';this['calleridnum']=0x0;this[_0x68b2('0x3')]='';this[_0x68b2('0x4')]=undefined;this[_0x68b2('0x5')]=undefined;this[_0x68b2('0x6')]=0x0;this[_0x68b2('0x7')]='';this[_0x68b2('0x8')]=0x0;this[_0x68b2('0x9')]=0x0;this[_0x68b2('0xa')]=0x0;this[_0x68b2('0xb')]=![];this[_0x68b2('0xc')]=null;this['endtime']=null;this[_0x68b2('0xd')]=![];this[_0x68b2('0xe')]=![];this[_0x68b2('0xf')]='';this[_0x68b2('0x10')]='';this['duration']=0x0;this[_0x68b2('0x11')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x68b2('0x12')]=null;this[_0x68b2('0x13')]=null;this[_0x68b2('0x14')]=![];this['monitorFilename']=null;this[_0x68b2('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x68b2('0x16')]=undefined;this[_0x68b2('0x17')]=undefined;this[_0x68b2('0x18')]=0x0;}module[_0x68b2('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index effd09d..b88fb8e 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 _0xe7e7=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','token'];(function(_0x285216,_0x28f4e8){var _0x199c22=function(_0x5a1ff1){while(--_0x5a1ff1){_0x285216['push'](_0x285216['shift']());}};_0x199c22(++_0x28f4e8);}(_0xe7e7,0x191));var _0x7e7e=function(_0x5473c6,_0xe0bc9c){_0x5473c6=_0x5473c6-0x0;var _0x5b1fcf=_0xe7e7[_0x5473c6];return _0x5b1fcf;};'use strict';function DeskAccount(_0x4821ca){this['id']=_0x4821ca['id']||0x0;this['name']=_0x4821ca['name']||'';this[_0x7e7e('0x0')]=_0x4821ca[_0x7e7e('0x0')]||'';this[_0x7e7e('0x1')]=_0x4821ca[_0x7e7e('0x1')]||'';this[_0x7e7e('0x2')]=_0x4821ca['authType']||'';this[_0x7e7e('0x3')]=_0x4821ca['password']||'';this['consumerKey']=_0x4821ca[_0x7e7e('0x4')]||'';this['consumerSecret']=_0x4821ca['consumerSecret']||'';this[_0x7e7e('0x5')]=_0x4821ca[_0x7e7e('0x5')]||'';this[_0x7e7e('0x6')]=_0x4821ca[_0x7e7e('0x6')]||'';this[_0x7e7e('0x7')]=_0x4821ca['type']||'';this[_0x7e7e('0x8')]=_0x4821ca[_0x7e7e('0x8')]||'';this[_0x7e7e('0x9')]=_0x4821ca['Configurations']||{};}module[_0x7e7e('0xa')]=DeskAccount; \ No newline at end of file +var _0xb856=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0xf244e0,_0x20556c){var _0xe94095=function(_0x409d0a){while(--_0x409d0a){_0xf244e0['push'](_0xf244e0['shift']());}};_0xe94095(++_0x20556c);}(_0xb856,0x11a));var _0x6b85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb856[_0x321bb2];return _0x9c12ed;};'use strict';function DeskAccount(_0x29036d){this['id']=_0x29036d['id']||0x0;this[_0x6b85('0x0')]=_0x29036d[_0x6b85('0x0')]||'';this[_0x6b85('0x1')]=_0x29036d['username']||'';this[_0x6b85('0x2')]=_0x29036d[_0x6b85('0x2')]||'';this[_0x6b85('0x3')]=_0x29036d[_0x6b85('0x3')]||'';this[_0x6b85('0x4')]=_0x29036d[_0x6b85('0x4')]||'';this['consumerKey']=_0x29036d[_0x6b85('0x5')]||'';this[_0x6b85('0x6')]=_0x29036d['consumerSecret']||'';this[_0x6b85('0x7')]=_0x29036d[_0x6b85('0x7')]||'';this[_0x6b85('0x8')]=_0x29036d[_0x6b85('0x8')]||'';this['type']=_0x29036d[_0x6b85('0x9')]||'';this[_0x6b85('0xa')]=_0x29036d[_0x6b85('0xa')]||'';this[_0x6b85('0xb')]=_0x29036d[_0x6b85('0xb')]||{};}module[_0x6b85('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 93fe393..b7e1559 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96cc=['clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x11ab83,_0x25a955){var _0x59b3c2=function(_0x2f8ec2){while(--_0x2f8ec2){_0x11ab83['push'](_0x11ab83['shift']());}};_0x59b3c2(++_0x25a955);}(_0x96cc,0x16c));var _0xc96c=function(_0x254461,_0x45615a){_0x254461=_0x254461-0x0;var _0x28ee0e=_0x96cc[_0x254461];return _0x28ee0e;};'use strict';function Dynamics365Account(_0x540e05){this['id']=_0x540e05['id']||0x0;this['name']=_0x540e05[_0xc96c('0x0')]||'';this['username']=_0x540e05[_0xc96c('0x1')]||'';this[_0xc96c('0x2')]=_0x540e05[_0xc96c('0x2')]||'';this[_0xc96c('0x3')]=_0x540e05[_0xc96c('0x3')]||'';this[_0xc96c('0x4')]=_0x540e05[_0xc96c('0x4')]||'';this[_0xc96c('0x5')]=_0x540e05[_0xc96c('0x5')]||'';this['clientSecret']=_0x540e05[_0xc96c('0x6')]||{};this[_0xc96c('0x7')]=_0x540e05[_0xc96c('0x7')]||'';this[_0xc96c('0x8')]=_0x540e05[_0xc96c('0x8')]||{};}module[_0xc96c('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3fa103,_0x9a7a10){_0x3fa103=_0x3fa103-0x0;var _0x69bc78=_0xee5b[_0x3fa103];return _0x69bc78;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}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 ad7d10b..b5d71ad 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 _0xbeec=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xbeec,0x11a));var _0xcbee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbeec[_0x14add3];return _0x4a174f;};'use strict';function FaxAccount(_0x46cef3){this['id']=_0x46cef3['id']||0x0;this[_0xcbee('0x0')]=_0x46cef3['name']||'';this['description']=_0x46cef3[_0xcbee('0x1')];this[_0xcbee('0x2')]=_0x46cef3[_0xcbee('0x2')];this[_0xcbee('0x3')]=_0x46cef3[_0xcbee('0x3')];this['localstationid']=_0x46cef3[_0xcbee('0x4')];this[_0xcbee('0x5')]=_0x46cef3[_0xcbee('0x5')]||0x960;this[_0xcbee('0x6')]=_0x46cef3[_0xcbee('0x6')]||0x3840;this[_0xcbee('0x7')]=_0x46cef3['modem']||_0xcbee('0x8');this[_0xcbee('0x9')]=_0x46cef3['gateway']||'no';this[_0xcbee('0xa')]=_0x46cef3[_0xcbee('0xa')]||'no';this['t38timeout']=_0x46cef3[_0xcbee('0xb')]||0x1388;this[_0xcbee('0xc')]=_0x46cef3['tech']||'SIP';this[_0xcbee('0xd')]=_0x46cef3[_0xcbee('0xd')]?_0x46cef3[_0xcbee('0xd')]:undefined;this[_0xcbee('0xe')]=_0x46cef3[_0xcbee('0xe')];this[_0xcbee('0xf')]=_0x46cef3[_0xcbee('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x252e=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x252e,0x15e));var _0xe252=function(_0x1d829e,_0x279c95){_0x1d829e=_0x1d829e-0x0;var _0x25d9fd=_0x252e[_0x1d829e];return _0x25d9fd;};'use strict';function FaxAccount(_0x415209){this['id']=_0x415209['id']||0x0;this[_0xe252('0x0')]=_0x415209['name']||'';this[_0xe252('0x1')]=_0x415209[_0xe252('0x1')];this[_0xe252('0x2')]=_0x415209[_0xe252('0x2')];this[_0xe252('0x3')]=_0x415209[_0xe252('0x3')];this[_0xe252('0x4')]=_0x415209[_0xe252('0x4')];this['minrate']=_0x415209[_0xe252('0x5')]||0x960;this[_0xe252('0x6')]=_0x415209['maxrate']||0x3840;this[_0xe252('0x7')]=_0x415209[_0xe252('0x7')]||_0xe252('0x8');this[_0xe252('0x9')]=_0x415209[_0xe252('0x9')]||'no';this['faxdetect']=_0x415209[_0xe252('0xa')]||'no';this['t38timeout']=_0x415209[_0xe252('0xb')]||0x1388;this[_0xe252('0xc')]=_0x415209[_0xe252('0xc')]||_0xe252('0xd');this[_0xe252('0xe')]=_0x415209['Trunk']?_0x415209[_0xe252('0xe')]:undefined;this[_0xe252('0xf')]=_0x415209[_0xe252('0xf')];this[_0xe252('0x10')]=_0x415209[_0xe252('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 55d88c0..a2b207d 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 _0x64a9=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1c87a1,_0x536b21){var _0x23e918=function(_0x461234){while(--_0x461234){_0x1c87a1['push'](_0x1c87a1['shift']());}};_0x23e918(++_0x536b21);}(_0x64a9,0x1b5));var _0x964a=function(_0x3c5681,_0x1d4561){_0x3c5681=_0x3c5681-0x0;var _0x4b3ec9=_0x64a9[_0x3c5681];return _0x4b3ec9;};'use strict';function FreshdeskAccount(_0x4cc6a2){this['id']=_0x4cc6a2['id']||0x0;this[_0x964a('0x0')]=_0x4cc6a2[_0x964a('0x0')]||'';this[_0x964a('0x1')]=_0x4cc6a2[_0x964a('0x1')]||'';this[_0x964a('0x2')]=_0x4cc6a2[_0x964a('0x3')]||'';this[_0x964a('0x4')]=_0x4cc6a2['remoteUri']||'';this[_0x964a('0x5')]=_0x4cc6a2[_0x964a('0x5')]||'';this[_0x964a('0x6')]=_0x4cc6a2[_0x964a('0x6')]||{};}module[_0x964a('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xd37b=['serverUrl','Configurations','name','apiKey','remoteUri'];(function(_0x379010,_0x3b8dca){var _0x116f09=function(_0x3a7756){while(--_0x3a7756){_0x379010['push'](_0x379010['shift']());}};_0x116f09(++_0x3b8dca);}(_0xd37b,0x14c));var _0xbd37=function(_0x5bc240,_0x34de0f){_0x5bc240=_0x5bc240-0x0;var _0x149b09=_0xd37b[_0x5bc240];return _0x149b09;};'use strict';function FreshdeskAccount(_0x14a0ed){this['id']=_0x14a0ed['id']||0x0;this[_0xbd37('0x0')]=_0x14a0ed['name']||'';this['username']=_0x14a0ed['username']||'';this[_0xbd37('0x1')]=_0x14a0ed['token']||'';this[_0xbd37('0x2')]=_0x14a0ed['remoteUri']||'';this[_0xbd37('0x3')]=_0x14a0ed['serverUrl']||'';this[_0xbd37('0x4')]=_0x14a0ed['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 632a1a9..3052968 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 _0x4f5d=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x1dc4d4,_0x3f596d){var _0x58d5ea=function(_0x378e91){while(--_0x378e91){_0x1dc4d4['push'](_0x1dc4d4['shift']());}};_0x58d5ea(++_0x3f596d);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4f5d[_0x209941];return _0x1e8729;};'use strict';function FreshsalesAccount(_0x30ec55){this['id']=_0x30ec55['id']||0x0;this[_0xd4f5('0x0')]=_0x30ec55[_0xd4f5('0x0')]||'';this[_0xd4f5('0x1')]=_0x30ec55[_0xd4f5('0x1')]||'';this[_0xd4f5('0x2')]=_0x30ec55['token']||'';this[_0xd4f5('0x3')]=_0x30ec55[_0xd4f5('0x3')]||'';this[_0xd4f5('0x4')]=_0x30ec55[_0xd4f5('0x4')]||'';this[_0xd4f5('0x5')]=_0x30ec55[_0xd4f5('0x5')]||{};}module[_0xd4f5('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x644f=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x644f,0x177));var _0xf644=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x644f[_0x166e96];return _0x553d73;};'use strict';function FreshsalesAccount(_0x5ccdaf){this['id']=_0x5ccdaf['id']||0x0;this[_0xf644('0x0')]=_0x5ccdaf[_0xf644('0x0')]||'';this[_0xf644('0x1')]=_0x5ccdaf[_0xf644('0x1')]||'';this[_0xf644('0x2')]=_0x5ccdaf[_0xf644('0x3')]||'';this[_0xf644('0x4')]=_0x5ccdaf[_0xf644('0x4')]||'';this[_0xf644('0x5')]=_0x5ccdaf['serverUrl']||'';this['Configurations']=_0x5ccdaf[_0xf644('0x6')]||{};}module[_0xf644('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 c6080f7..66b4e37 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 _0xce4d=['exports','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','accountcode','exten','priority','holdtime','assigned','motionChannel','mohtime','variables'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xce4d,0xd0));var _0xdce4=function(_0x3b50d6,_0x2bd840){_0x3b50d6=_0x3b50d6-0x0;var _0x426402=_0xce4d[_0x3b50d6];return _0x426402;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this[_0xdce4('0x0')]='';this[_0xdce4('0x1')]='';this[_0xdce4('0x2')]='';this[_0xdce4('0x3')]=null;this[_0xdce4('0x4')]=null;this[_0xdce4('0x5')]=0x1;this[_0xdce4('0x6')]=0x1;this[_0xdce4('0x7')]=![];this[_0xdce4('0x8')]=null;this[_0xdce4('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xdce4('0xa')]=![];this[_0xdce4('0xb')]=null;this[_0xdce4('0xc')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xdce4('0xd')]='';this[_0xdce4('0xe')]='';this['context']='';this[_0xdce4('0xf')]='';this[_0xdce4('0x10')]='';this[_0xdce4('0x11')]=0x0;this[_0xdce4('0x12')]=![];this['lastAssignedTo']='';this[_0xdce4('0x13')]='voice';this[_0xdce4('0x14')]=0x0;this[_0xdce4('0x15')]={};}module[_0xdce4('0x16')]=QueueReport; \ No newline at end of file +var _0x0719=['queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','calleridnum','calleridname'];(function(_0x1156d3,_0x1899b4){var _0x146fe2=function(_0x806d3f){while(--_0x806d3f){_0x1156d3['push'](_0x1156d3['shift']());}};_0x146fe2(++_0x1899b4);}(_0x0719,0x1f4));var _0x9071=function(_0x6dc2ee,_0x1af658){_0x6dc2ee=_0x6dc2ee-0x0;var _0x4a9848=_0x0719[_0x6dc2ee];return _0x4a9848;};'use strict';function QueueReport(){this[_0x9071('0x0')]=_0x9071('0x1');this['uniqueid']='';this[_0x9071('0x2')]='';this[_0x9071('0x3')]='';this[_0x9071('0x4')]='';this['queuecallerjoinAt']=null;this[_0x9071('0x5')]=null;this[_0x9071('0x6')]=0x1;this[_0x9071('0x7')]=0x1;this[_0x9071('0x8')]=![];this[_0x9071('0x9')]=null;this['queuecallercomplete']=![];this[_0x9071('0xa')]=null;this['queuecallerexit']=![];this[_0x9071('0xb')]=null;this[_0x9071('0xc')]=0x1;this[_0x9071('0xd')]='';this[_0x9071('0xe')]='';this['connectedlinename']='';this[_0x9071('0xf')]='';this[_0x9071('0x10')]='';this['exten']='';this['priority']='';this[_0x9071('0x11')]=0x0;this[_0x9071('0x12')]=![];this[_0x9071('0x13')]='';this[_0x9071('0x14')]=_0x9071('0x15');this['mohtime']=0x0;this[_0x9071('0x16')]={};}module[_0x9071('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9efa2d2..ea9b497 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 _0x6d11=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','Configurations'];(function(_0x33314d,_0x499628){var _0x4ffe8e=function(_0xb1ec35){while(--_0xb1ec35){_0x33314d['push'](_0x33314d['shift']());}};_0x4ffe8e(++_0x499628);}(_0x6d11,0xbf));var _0x16d1=function(_0x4f2930,_0x40ad4b){_0x4f2930=_0x4f2930-0x0;var _0x397db7=_0x6d11[_0x4f2930];return _0x397db7;};'use strict';function SalesforceAccount(_0x5b97e4){this['id']=_0x5b97e4['id']||0x0;this[_0x16d1('0x0')]=_0x5b97e4[_0x16d1('0x0')]||'';this['username']=_0x5b97e4[_0x16d1('0x1')]||'';this['remoteUri']=_0x5b97e4[_0x16d1('0x2')]||'';this[_0x16d1('0x3')]=_0x5b97e4['password']||'';this['clientId']=_0x5b97e4[_0x16d1('0x4')]||'';this[_0x16d1('0x5')]=_0x5b97e4[_0x16d1('0x5')]||'';this[_0x16d1('0x6')]=_0x5b97e4[_0x16d1('0x6')]||'';this[_0x16d1('0x7')]=_0x5b97e4[_0x16d1('0x7')]||'integrationTab';this['serverUrl']=_0x5b97e4['serverUrl']||'';this[_0x16d1('0x8')]=_0x5b97e4[_0x16d1('0x8')]||{};}module[_0x16d1('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x2b59=['remoteUri','password','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2b59,0x1de));var _0x92b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b59[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x4245c7){this['id']=_0x4245c7['id']||0x0;this[_0x92b5('0x0')]=_0x4245c7['name']||'';this['username']=_0x4245c7[_0x92b5('0x1')]||'';this[_0x92b5('0x2')]=_0x4245c7[_0x92b5('0x2')]||'';this['password']=_0x4245c7[_0x92b5('0x3')]||'';this['clientId']=_0x4245c7['clientId']||'';this[_0x92b5('0x4')]=_0x4245c7[_0x92b5('0x4')]||'';this[_0x92b5('0x5')]=_0x4245c7[_0x92b5('0x5')]||'';this[_0x92b5('0x6')]=_0x4245c7[_0x92b5('0x6')]||'integrationTab';this[_0x92b5('0x7')]=_0x4245c7[_0x92b5('0x7')]||'';this[_0x92b5('0x8')]=_0x4245c7['Configurations']||{};}module[_0x92b5('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a015bf5..33eab94 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 _0xc001=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x259340,_0x55c405){var _0x36bfbd=function(_0x4b47f6){while(--_0x4b47f6){_0x259340['push'](_0x259340['shift']());}};_0x36bfbd(++_0x55c405);}(_0xc001,0x1d8));var _0x1c00=function(_0x2b08c6,_0x3e604d){_0x2b08c6=_0x2b08c6-0x0;var _0x479c84=_0xc001[_0x2b08c6];return _0x479c84;};'use strict';function ServicenowAccount(_0x146508){this['id']=_0x146508['id']||0x0;this[_0x1c00('0x0')]=_0x146508[_0x1c00('0x0')]||'';this['username']=_0x146508['username']||'';this[_0x1c00('0x1')]=_0x146508[_0x1c00('0x1')]||'';this[_0x1c00('0x2')]=_0x146508[_0x1c00('0x2')]||'';this['serverUrl']=_0x146508[_0x1c00('0x3')]||'';this[_0x1c00('0x4')]=_0x146508[_0x1c00('0x4')]||{};}module[_0x1c00('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xa7c1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x43499f,_0x3eb8ae){var _0x39503b=function(_0x10c4bc){while(--_0x10c4bc){_0x43499f['push'](_0x43499f['shift']());}};_0x39503b(++_0x3eb8ae);}(_0xa7c1,0x110));var _0x1a7c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa7c1[_0x5d6456];return _0x4d66c1;};'use strict';function ServicenowAccount(_0x15c76b){this['id']=_0x15c76b['id']||0x0;this['name']=_0x15c76b[_0x1a7c('0x0')]||'';this[_0x1a7c('0x1')]=_0x15c76b[_0x1a7c('0x1')]||'';this[_0x1a7c('0x2')]=_0x15c76b[_0x1a7c('0x2')]||'';this[_0x1a7c('0x3')]=_0x15c76b[_0x1a7c('0x3')]||'';this[_0x1a7c('0x4')]=_0x15c76b[_0x1a7c('0x4')]||'';this[_0x1a7c('0x5')]=_0x15c76b[_0x1a7c('0x5')]||{};}module[_0x1a7c('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 8b66772..39b45dd 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 _0x9dc3=['serverUrl','Configurations','exports','name','password','remoteUri'];(function(_0x51f812,_0x36212c){var _0x1ad290=function(_0x1f03b7){while(--_0x1f03b7){_0x51f812['push'](_0x51f812['shift']());}};_0x1ad290(++_0x36212c);}(_0x9dc3,0xa5));var _0x39dc=function(_0x27d11f,_0x2c59a8){_0x27d11f=_0x27d11f-0x0;var _0x36c1a5=_0x9dc3[_0x27d11f];return _0x36c1a5;};'use strict';function SugarcrmAccount(_0x28e1a5){this['id']=_0x28e1a5['id']||0x0;this[_0x39dc('0x0')]=_0x28e1a5[_0x39dc('0x0')]||'';this['username']=_0x28e1a5['username']||'';this[_0x39dc('0x1')]=_0x28e1a5[_0x39dc('0x1')]||'';this[_0x39dc('0x2')]=_0x28e1a5[_0x39dc('0x2')]||'';this[_0x39dc('0x3')]=_0x28e1a5[_0x39dc('0x3')]||'';this['Configurations']=_0x28e1a5[_0x39dc('0x4')]||{};}module[_0x39dc('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xcbb0=['password','remoteUri','Configurations','exports','name','username'];(function(_0x5c43d8,_0x5c68d6){var _0x15939c=function(_0x434498){while(--_0x434498){_0x5c43d8['push'](_0x5c43d8['shift']());}};_0x15939c(++_0x5c68d6);}(_0xcbb0,0x1d8));var _0x0cbb=function(_0x2b3014,_0x2748a8){_0x2b3014=_0x2b3014-0x0;var _0x35b6b7=_0xcbb0[_0x2b3014];return _0x35b6b7;};'use strict';function SugarcrmAccount(_0x26bfbe){this['id']=_0x26bfbe['id']||0x0;this[_0x0cbb('0x0')]=_0x26bfbe[_0x0cbb('0x0')]||'';this['username']=_0x26bfbe[_0x0cbb('0x1')]||'';this[_0x0cbb('0x2')]=_0x26bfbe[_0x0cbb('0x2')]||'';this[_0x0cbb('0x3')]=_0x26bfbe['remoteUri']||'';this['serverUrl']=_0x26bfbe['serverUrl']||'';this[_0x0cbb('0x4')]=_0x26bfbe[_0x0cbb('0x4')]||{};}module[_0x0cbb('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 68ae7c1..1b244c0 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 _0x1588=['status','unknown','address','name','accountcode','stateTime'];(function(_0x8a10fb,_0x561ba2){var _0x550732=function(_0x4e5607){while(--_0x4e5607){_0x8a10fb['push'](_0x8a10fb['shift']());}};_0x550732(++_0x561ba2);}(_0x1588,0x195));var _0x8158=function(_0x3b170f,_0x4a01b1){_0x3b170f=_0x3b170f-0x0;var _0xb27e90=_0x1588[_0x3b170f];return _0xb27e90;};'use strict';function Telephone(_0x5a1ee7){this['id']=_0x5a1ee7['id']||0x0;this[_0x8158('0x0')]=_0x5a1ee7[_0x8158('0x0')]||'';this[_0x8158('0x1')]=_0x5a1ee7[_0x8158('0x1')]||'';this['state']='unknown';this[_0x8158('0x2')]=0x0;this[_0x8158('0x3')]=_0x8158('0x4');this[_0x8158('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xd561=['exports','accountcode','unknown','stateTime','status','address'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd561,0xc7));var _0x1d56=function(_0x52f0e4,_0x224a31){_0x52f0e4=_0x52f0e4-0x0;var _0x88052f=_0xd561[_0x52f0e4];return _0x88052f;};'use strict';function Telephone(_0x279e23){this['id']=_0x279e23['id']||0x0;this['name']=_0x279e23['name']||'';this['accountcode']=_0x279e23[_0x1d56('0x0')]||'';this['state']=_0x1d56('0x1');this[_0x1d56('0x2')]=0x0;this[_0x1d56('0x3')]='unknown';this[_0x1d56('0x4')]='';}module[_0x1d56('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index eb3eb4c..d0e38c3 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(_0x344e2d,_0xbd413e){var _0x19c6d4=function(_0x777f37){while(--_0x777f37){_0x344e2d['push'](_0x344e2d['shift']());}};_0x19c6d4(++_0xbd413e);}(_0xb10b,0x12a));var _0xbb10=function(_0x9f9ed5,_0x56f438){_0x9f9ed5=_0x9f9ed5-0x0;var _0xbc71e3=_0xb10b[_0x9f9ed5];return _0xbc71e3;};'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(_0x1d0f96,_0x350093){var _0x27b07e=function(_0x529f87){while(--_0x529f87){_0x1d0f96['push'](_0x1d0f96['shift']());}};_0x27b07e(++_0x350093);}(_0xb10b,0x12a));var _0xbb10=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0xb10b[_0x345a1b];return _0x1b24ec;};'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 d575249..e0108b1 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0xf3221e,_0x371371){var _0x4cfb2d=function(_0x137a07){while(--_0x137a07){_0xf3221e['push'](_0xf3221e['shift']());}};_0x4cfb2d(++_0x371371);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x43ad8d,_0x223ced){_0x43ad8d=_0x43ad8d-0x0;var _0x58f7b5=_0x9ffd[_0x43ad8d];return _0x58f7b5;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x379df3,_0x491c31){var _0x2211e3=function(_0x2ae189){while(--_0x2ae189){_0x379df3['push'](_0x379df3['shift']());}};_0x2211e3(++_0x491c31);}(_0x2032,0xd9));var _0x2203=function(_0x338293,_0x2b7457){_0x338293=_0x338293-0x0;var _0x5a2edb=_0x2032[_0x338293];return _0x5a2edb;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 22e07eb..6a637eb 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 _0x21d0=['status','unknown','registry','indexOf','host','port','domainport','stateRegistry','address','defaultuser','exports','active','name','state','stateTime'];(function(_0xdf13c9,_0x5da43f){var _0x302aaa=function(_0x42cc73){while(--_0x42cc73){_0xdf13c9['push'](_0xdf13c9['shift']());}};_0x302aaa(++_0x5da43f);}(_0x21d0,0xa1));var _0x021d=function(_0x1935c8,_0x410d3d){_0x1935c8=_0x1935c8-0x0;var _0x414a06=_0x21d0[_0x1935c8];return _0x414a06;};'use strict';function Trunk(_0x18cbf0){this['id']=_0x18cbf0['id']||0x0;this['active']=_0x18cbf0[_0x021d('0x0')]||![];this['name']=_0x18cbf0[_0x021d('0x1')]||'';this[_0x021d('0x2')]='unknown';this[_0x021d('0x3')]=0x0;this[_0x021d('0x4')]=_0x021d('0x5');this[_0x021d('0x6')]=_0x18cbf0['registry']&&_0x18cbf0[_0x021d('0x6')][_0x021d('0x7')](':')?_0x18cbf0[_0x021d('0x6')]['split'](':')[0x0]:'';this[_0x021d('0x8')]='';this[_0x021d('0x9')]='';this['domain']='';this[_0x021d('0xa')]='';this['refresh']='';this[_0x021d('0xb')]=_0x021d('0x5');this['registrationtime']='';this[_0x021d('0xc')]='';this[_0x021d('0xd')]=_0x18cbf0[_0x021d('0xd')]||'';}module[_0x021d('0xe')]=Trunk; \ No newline at end of file +var _0x7d6f=['name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active'];(function(_0x2e8ae6,_0x4c3899){var _0x3981dd=function(_0x20d341){while(--_0x20d341){_0x2e8ae6['push'](_0x2e8ae6['shift']());}};_0x3981dd(++_0x4c3899);}(_0x7d6f,0xe3));var _0xf7d6=function(_0xfcc39b,_0x294e2a){_0xfcc39b=_0xfcc39b-0x0;var _0x34f377=_0x7d6f[_0xfcc39b];return _0x34f377;};'use strict';function Trunk(_0x24928b){this['id']=_0x24928b['id']||0x0;this[_0xf7d6('0x0')]=_0x24928b[_0xf7d6('0x0')]||![];this[_0xf7d6('0x1')]=_0x24928b[_0xf7d6('0x1')]||'';this[_0xf7d6('0x2')]=_0xf7d6('0x3');this[_0xf7d6('0x4')]=0x0;this[_0xf7d6('0x5')]=_0xf7d6('0x3');this[_0xf7d6('0x6')]=_0x24928b['registry']&&_0x24928b['registry'][_0xf7d6('0x7')](':')?_0x24928b[_0xf7d6('0x6')][_0xf7d6('0x8')](':')[0x0]:'';this[_0xf7d6('0x9')]='';this[_0xf7d6('0xa')]='';this[_0xf7d6('0xb')]='';this[_0xf7d6('0xc')]='';this[_0xf7d6('0xd')]='';this[_0xf7d6('0xe')]=_0xf7d6('0x3');this[_0xf7d6('0xf')]='';this[_0xf7d6('0x10')]='';this[_0xf7d6('0x11')]=_0x24928b['defaultuser']||'';}module[_0xf7d6('0x12')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index fbb6ab0..2da8c1d 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 _0xcbfc=['exports','exten','none','mandatoryDisposition'];(function(_0x5eed03,_0x703be0){var _0x327b45=function(_0x10f1e8){while(--_0x10f1e8){_0x5eed03['push'](_0x5eed03['shift']());}};_0x327b45(++_0x703be0);}(_0xcbfc,0x185));var _0xccbf=function(_0x1c6514,_0x252778){_0x1c6514=_0x1c6514-0x0;var _0x28c571=_0xcbfc[_0x1c6514];return _0x28c571;};'use strict';function voiceExtension(_0x587422){this['id']=_0x587422['id']||0x0;this[_0xccbf('0x0')]=_0x587422[_0xccbf('0x0')]||'';this['recordingFormat']=_0x587422['recordingFormat']||_0xccbf('0x1');this[_0xccbf('0x2')]=_0x587422[_0xccbf('0x2')]||![];}module[_0xccbf('0x3')]=voiceExtension; \ No newline at end of file +var _0xd32c=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x14d6e8,_0x131c97){var _0x510e3b=function(_0x65c164){while(--_0x65c164){_0x14d6e8['push'](_0x14d6e8['shift']());}};_0x510e3b(++_0x131c97);}(_0xd32c,0x82));var _0xcd32=function(_0x822939,_0x34bc67){_0x822939=_0x822939-0x0;var _0x476773=_0xd32c[_0x822939];return _0x476773;};'use strict';function voiceExtension(_0x11c5c3){this['id']=_0x11c5c3['id']||0x0;this['exten']=_0x11c5c3[_0xcd32('0x0')]||'';this[_0xcd32('0x1')]=_0x11c5c3[_0xcd32('0x1')]||_0xcd32('0x2');this[_0xcd32('0x3')]=_0x11c5c3['mandatoryDisposition']||![];}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 5f3a3d4..5ee7c6d 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 _0x60d7=['sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x60d7,0x149));var _0x760d=function(_0x3409a6,_0xe2533d){_0x3409a6=_0x3409a6-0x0;var _0x33c490=_0x60d7[_0x3409a6];return _0x33c490;};'use strict';var statusDesc=[_0x760d('0x0'),_0x760d('0x1'),_0x760d('0x2'),_0x760d('0x3'),_0x760d('0x4'),_0x760d('0x5'),_0x760d('0x6'),_0x760d('0x7'),_0x760d('0x8')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0x760d('0x9')};var strategy={'rrmemory':_0x760d('0xa'),'roundrobin':_0x760d('0xb')};function VoiceQueue(_0x4717c2){this['id']=_0x4717c2['id']||0x0;this[_0x760d('0xc')]=_0x4717c2[_0x760d('0xc')]||'';this[_0x760d('0xd')]=_0x4717c2[_0x760d('0xd')]||'';this[_0x760d('0xe')]=_0x4717c2[_0x760d('0xe')]||_0x760d('0xf');this[_0x760d('0x10')]=0x0;this[_0x760d('0x11')]=0x0;this['total']=0x0;this[_0x760d('0x12')]=0x0;this[_0x760d('0x13')]=0x0;this[_0x760d('0x14')]=0x0;this[_0x760d('0x15')]=0x0;this[_0x760d('0x16')]=0x0;this['abandoned']=0x0;this[_0x760d('0x17')]=0x0;this[_0x760d('0x18')]=0x0;this[_0x760d('0x19')]=_0x4717c2[_0x760d('0x19')]||![];this[_0x760d('0x1a')]=_0x4717c2[_0x760d('0x1a')]||0xa;this[_0x760d('0x1b')]=_0x4717c2[_0x760d('0x1b')]||'no';this[_0x760d('0x1c')]=!![];this['message']='';this['originated']=0x0;this[_0x760d('0x1d')]=0x0;this['dialTimezone']=_0x4717c2[_0x760d('0x1e')]||null;this['dialGlobalInterval']=_0x4717c2[_0x760d('0x1f')]?_0x4717c2['dialGlobalInterval']:null;this[_0x760d('0x20')]=_0x4717c2['dialActive'];this[_0x760d('0x21')]=_0x4717c2[_0x760d('0x21')]||_0x760d('0x22');this['dialLimitChannel']=_0x4717c2[_0x760d('0x23')]||0x0;this[_0x760d('0x24')]=_0x4717c2['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4717c2[_0x760d('0x25')]||0x1;this[_0x760d('0x26')]=_0x4717c2[_0x760d('0x26')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x4717c2['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x4717c2[_0x760d('0x27')]||0x258;this[_0x760d('0x28')]=_0x4717c2[_0x760d('0x28')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4717c2[_0x760d('0x29')]||_0x760d('0x2a');this['dialOriginateTimeout']=_0x4717c2['dialOriginateTimeout']||0x1e;this[_0x760d('0x2b')]=_0x4717c2[_0x760d('0x2b')]||_0x760d('0x2c');this['dialQueueTimeout']=_0x4717c2[_0x760d('0x2d')]||0x3;this[_0x760d('0x2e')]=_0x4717c2[_0x760d('0x2e')]||undefined;this[_0x760d('0x2f')]=_0x4717c2[_0x760d('0x2f')]||0x3;this[_0x760d('0x30')]=_0x4717c2[_0x760d('0x30')]||0x96;this['dialBusyMaxRetry']=_0x4717c2[_0x760d('0x31')]||0x3;this[_0x760d('0x32')]=_0x4717c2['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x4717c2[_0x760d('0x33')]||0x3;this[_0x760d('0x34')]=_0x4717c2[_0x760d('0x34')]||0x96;this[_0x760d('0x35')]=_0x4717c2['dialNoSuchNumberMaxRetry']||0x3;this[_0x760d('0x36')]=_0x4717c2[_0x760d('0x36')]||0x96;this[_0x760d('0x37')]=_0x4717c2[_0x760d('0x37')]||0x3;this[_0x760d('0x38')]=_0x4717c2[_0x760d('0x38')]||0x96;this[_0x760d('0x39')]=_0x4717c2[_0x760d('0x39')]||0x3;this[_0x760d('0x3a')]=_0x4717c2[_0x760d('0x3a')]||0x96;this[_0x760d('0x3b')]=_0x4717c2[_0x760d('0x3b')]||0x3;this['dialMachineRetryFrequency']=_0x4717c2[_0x760d('0x3c')]||0x96;this[_0x760d('0x3d')]=_0x4717c2[_0x760d('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4717c2[_0x760d('0x3e')]||0x96;this[_0x760d('0x3f')]=_0x4717c2['dialGlobalMaxRetry']||0x4;this[_0x760d('0x40')]=_0x4717c2[_0x760d('0x40')]?_0x4717c2[_0x760d('0x40')]:undefined;this[_0x760d('0x41')]=_0x4717c2[_0x760d('0x41')]?_0x4717c2['TrunkBackup']:undefined;this[_0x760d('0x42')]=_0x4717c2['dialPrefix']||undefined;this['Interval']=_0x4717c2[_0x760d('0x43')]?_0x4717c2[_0x760d('0x43')]:undefined;this[_0x760d('0x44')]=_0x4717c2[_0x760d('0x44')]||'DESC';this[_0x760d('0x45')]=_0x4717c2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x760d('0x46')]=_0x4717c2['dialCutDigit']||undefined;this[_0x760d('0x47')]=strategy[_0x4717c2['strategy']]||_0x760d('0xa');this[_0x760d('0x48')]=!![];this[_0x760d('0x49')]=_0x4717c2[_0x760d('0x49')]||![];this[_0x760d('0x4a')]=_0x4717c2[_0x760d('0x4a')];this[_0x760d('0x4b')]=_0x4717c2[_0x760d('0x4b')];this[_0x760d('0x4c')]=_0x4717c2[_0x760d('0x4c')];this['dialAMDTotalAnalysisTime']=_0x4717c2['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x4717c2[_0x760d('0x4d')];this[_0x760d('0x4e')]=_0x4717c2[_0x760d('0x4e')];this[_0x760d('0x4f')]=_0x4717c2['dialAMDMaximumNumberOfWords'];this[_0x760d('0x50')]=_0x4717c2[_0x760d('0x50')];this[_0x760d('0x51')]=_0x4717c2[_0x760d('0x51')];this[_0x760d('0x52')]=0x0;this['pTalking']=0x0;this[_0x760d('0x53')]=_0x4717c2['timeout'];this[_0x760d('0x54')]=0x0;this[_0x760d('0x55')]=0x0;this[_0x760d('0x56')]=0x0;this[_0x760d('0x57')]=0x0;this[_0x760d('0x58')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x760d('0x59')]=0x0;this[_0x760d('0x5a')]=0x0;this[_0x760d('0x5b')]=0x0;this[_0x760d('0x5c')]=0x0;this[_0x760d('0x5d')]=0x0;this[_0x760d('0x5e')]=0x0;this[_0x760d('0x5f')]=0x0;this[_0x760d('0x60')]=0x0;this[_0x760d('0x61')]=undefined;this[_0x760d('0x62')]=undefined;this[_0x760d('0x63')]=undefined;this[_0x760d('0x64')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x760d('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x760d('0x66')]=0x0;this[_0x760d('0x67')]=0x0;this[_0x760d('0x68')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x4717c2[_0x760d('0x69')]||0x14;this['predictiveIntervalMinThreshold']=_0x4717c2[_0x760d('0x69')]||0xa;this[_0x760d('0x6a')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x760d('0x6b')]=0x1;this[_0x760d('0x6c')]=0x0;this[_0x760d('0x6d')]=0x0;this[_0x760d('0x6e')]=0x0;this['erlangBusyFactor']=0x0;this[_0x760d('0x6f')]=_0x4717c2['dialRecallMeTimeout']||0x1e;this[_0x760d('0x70')]=_0x4717c2[_0x760d('0x70')]||![];this['dialQueueProject2']=_0x4717c2[_0x760d('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x4717c2[_0x760d('0x72')]||![];this[_0x760d('0x73')]=_0x4717c2[_0x760d('0x73')]||![];this[_0x760d('0xd')]=monitorFormat[_0x4717c2[_0x760d('0xd')]]?monitorFormat[_0x4717c2[_0x760d('0xd')]]:undefined;this['mandatoryDisposition']=_0x4717c2[_0x760d('0x74')]||![];this['mandatoryDispositionPause']=_0x4717c2[_0x760d('0x75')]?_0x4717c2[_0x760d('0x75')]:undefined;}module[_0x760d('0x76')]=VoiceQueue; \ No newline at end of file +var _0x9500=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','loggedIn','acwTimeout','autopause','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x424be0,_0x5b1245){var _0x2fff85=function(_0x334746){while(--_0x334746){_0x424be0['push'](_0x424be0['shift']());}};_0x2fff85(++_0x5b1245);}(_0x9500,0xb6));var _0x0950=function(_0x5c7b65,_0x58a8b7){_0x5c7b65=_0x5c7b65-0x0;var _0xff998=_0x9500[_0x5c7b65];return _0xff998;};'use strict';var statusDesc=[_0x0950('0x0'),_0x0950('0x1'),_0x0950('0x2'),_0x0950('0x3'),_0x0950('0x4'),_0x0950('0x5'),_0x0950('0x6'),_0x0950('0x7'),_0x0950('0x8')];var monitorFormat={'wav':_0x0950('0x9'),'wav49':_0x0950('0xa'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x1edfd0){this['id']=_0x1edfd0['id']||0x0;this[_0x0950('0xb')]=_0x1edfd0[_0x0950('0xb')]||'';this['monitor_format']=_0x1edfd0[_0x0950('0xc')]||'';this[_0x0950('0xd')]=_0x1edfd0['type']||_0x0950('0xe');this[_0x0950('0xf')]=0x0;this[_0x0950('0x10')]=0x0;this[_0x0950('0x11')]=0x0;this[_0x0950('0x12')]=0x0;this['sumDuration']=0x0;this[_0x0950('0x13')]=0x0;this['sumBillable']=0x0;this[_0x0950('0x14')]=0x0;this[_0x0950('0x15')]=0x0;this[_0x0950('0x16')]=0x0;this['available']=0x0;this['acw']=_0x1edfd0['acw']||![];this['acwTimeout']=_0x1edfd0[_0x0950('0x17')]||0xa;this[_0x0950('0x18')]=_0x1edfd0[_0x0950('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0x0950('0x19')]=0x0;this[_0x0950('0x1a')]=_0x1edfd0[_0x0950('0x1a')]||null;this[_0x0950('0x1b')]=_0x1edfd0[_0x0950('0x1b')]?_0x1edfd0[_0x0950('0x1b')]:null;this[_0x0950('0x1c')]=_0x1edfd0['dialActive'];this['dialMethod']=_0x1edfd0[_0x0950('0x1d')]||_0x0950('0x1e');this[_0x0950('0x1f')]=_0x1edfd0[_0x0950('0x1f')]||0x0;this['dialLimitQueue']=_0x1edfd0[_0x0950('0x20')]||0x0;this[_0x0950('0x21')]=_0x1edfd0[_0x0950('0x21')]||0x1;this[_0x0950('0x22')]=_0x1edfd0[_0x0950('0x22')]||_0x0950('0x23');this[_0x0950('0x24')]=_0x1edfd0['dialPredictiveOptimizationPercentage']||0.03;this[_0x0950('0x25')]=_0x1edfd0[_0x0950('0x25')]||0x258;this['dialOriginateCallerIdName']=_0x1edfd0['dialOriginateCallerIdName']||_0x0950('0x26');this[_0x0950('0x27')]=_0x1edfd0['dialOriginateCallerIdNumber']||_0x0950('0x26');this[_0x0950('0x28')]=_0x1edfd0[_0x0950('0x28')]||0x1e;this[_0x0950('0x29')]=_0x1edfd0[_0x0950('0x29')]||_0x0950('0x2a');this['dialQueueTimeout']=_0x1edfd0[_0x0950('0x2b')]||0x3;this[_0x0950('0x2c')]=_0x1edfd0[_0x0950('0x2c')]||undefined;this[_0x0950('0x2d')]=_0x1edfd0[_0x0950('0x2d')]||0x3;this[_0x0950('0x2e')]=_0x1edfd0[_0x0950('0x2e')]||0x96;this[_0x0950('0x2f')]=_0x1edfd0['dialBusyMaxRetry']||0x3;this[_0x0950('0x30')]=_0x1edfd0[_0x0950('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x1edfd0[_0x0950('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1edfd0['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x1edfd0[_0x0950('0x32')]||0x3;this[_0x0950('0x33')]=_0x1edfd0[_0x0950('0x33')]||0x96;this[_0x0950('0x34')]=_0x1edfd0[_0x0950('0x34')]||0x3;this['dialDropRetryFrequency']=_0x1edfd0[_0x0950('0x35')]||0x96;this[_0x0950('0x36')]=_0x1edfd0[_0x0950('0x36')]||0x3;this[_0x0950('0x37')]=_0x1edfd0[_0x0950('0x37')]||0x96;this[_0x0950('0x38')]=_0x1edfd0[_0x0950('0x38')]||0x3;this[_0x0950('0x39')]=_0x1edfd0['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1edfd0['dialAgentRejectMaxRetry']||0x3;this[_0x0950('0x3a')]=_0x1edfd0['dialAgentRejectRetryFrequency']||0x96;this[_0x0950('0x3b')]=_0x1edfd0[_0x0950('0x3b')]||0x4;this[_0x0950('0x3c')]=_0x1edfd0[_0x0950('0x3c')]?_0x1edfd0[_0x0950('0x3c')]:undefined;this[_0x0950('0x3d')]=_0x1edfd0[_0x0950('0x3d')]?_0x1edfd0[_0x0950('0x3d')]:undefined;this['dialPrefix']=_0x1edfd0[_0x0950('0x3e')]||undefined;this['Interval']=_0x1edfd0[_0x0950('0x3f')]?_0x1edfd0[_0x0950('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x1edfd0[_0x0950('0x40')]||_0x0950('0x41');this[_0x0950('0x42')]=_0x1edfd0[_0x0950('0x42')]||undefined;this['dialCutDigit']=_0x1edfd0['dialCutDigit']||undefined;this[_0x0950('0x43')]=strategy[_0x1edfd0[_0x0950('0x43')]]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x1edfd0[_0x0950('0x44')]||![];this[_0x0950('0x45')]=_0x1edfd0[_0x0950('0x45')];this['dialAMDGreeting']=_0x1edfd0[_0x0950('0x46')];this['dialAMDAfterGreetingSilence']=_0x1edfd0[_0x0950('0x47')];this[_0x0950('0x48')]=_0x1edfd0[_0x0950('0x48')];this[_0x0950('0x49')]=_0x1edfd0['dialAMDMinWordLength'];this[_0x0950('0x4a')]=_0x1edfd0[_0x0950('0x4a')];this[_0x0950('0x4b')]=_0x1edfd0[_0x0950('0x4b')];this[_0x0950('0x4c')]=_0x1edfd0['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1edfd0[_0x0950('0x4d')];this[_0x0950('0x4e')]=0x0;this[_0x0950('0x4f')]=0x0;this[_0x0950('0x50')]=_0x1edfd0[_0x0950('0x50')];this[_0x0950('0x51')]=0x0;this[_0x0950('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x0950('0x53')]=0x0;this[_0x0950('0x54')]=0x0;this[_0x0950('0x55')]=0x0;this[_0x0950('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x0950('0x57')]=0x0;this[_0x0950('0x58')]=0x0;this[_0x0950('0x59')]=0x0;this['outboundReCallsDay']=0x0;this[_0x0950('0x5a')]=0x0;this[_0x0950('0x5b')]=undefined;this[_0x0950('0x5c')]=undefined;this[_0x0950('0x5d')]=undefined;this[_0x0950('0x5e')]=1.05;this[_0x0950('0x5f')]=0x0;this[_0x0950('0x60')]=0x0;this[_0x0950('0x61')]=0x0;this[_0x0950('0x62')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x0950('0x63')]=0x0;this[_0x0950('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0950('0x65')]=_0x1edfd0[_0x0950('0x66')]||0x14;this[_0x0950('0x67')]=_0x1edfd0[_0x0950('0x66')]||0xa;this[_0x0950('0x68')]=0x0;this[_0x0950('0x69')]=0x0;this[_0x0950('0x6a')]=0x1;this[_0x0950('0x6b')]=0x0;this[_0x0950('0x6c')]=0x0;this[_0x0950('0x6d')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1edfd0[_0x0950('0x6e')]||0x1e;this[_0x0950('0x6f')]=_0x1edfd0[_0x0950('0x6f')]||![];this['dialQueueProject2']=_0x1edfd0['dialQueueProject2']||undefined;this[_0x0950('0x70')]=_0x1edfd0['dialAgiAfterHangupClient']||![];this[_0x0950('0x71')]=_0x1edfd0[_0x0950('0x71')]||![];this[_0x0950('0xc')]=monitorFormat[_0x1edfd0[_0x0950('0xc')]]?monitorFormat[_0x1edfd0[_0x0950('0xc')]]:undefined;this[_0x0950('0x72')]=_0x1edfd0[_0x0950('0x72')]||![];this['mandatoryDispositionPause']=_0x1edfd0[_0x0950('0x73')]?_0x1edfd0[_0x0950('0x73')]: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 a9bfe80..b165e6d 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 _0x1146=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x5e3201,_0x14348a){var _0x502eca=function(_0xe0be5b){while(--_0xe0be5b){_0x5e3201['push'](_0x5e3201['shift']());}};_0x502eca(++_0x14348a);}(_0x1146,0xf9));var _0x6114=function(_0x56191f,_0x1da145){_0x56191f=_0x56191f-0x0;var _0x14ee3c=_0x1146[_0x56191f];return _0x14ee3c;};'use strict';function VtigerAccount(_0x28fe72){this['id']=_0x28fe72['id']||0x0;this['name']=_0x28fe72[_0x6114('0x0')]||'';this[_0x6114('0x1')]=_0x28fe72[_0x6114('0x1')]||'';this[_0x6114('0x2')]=_0x28fe72[_0x6114('0x2')]||'';this[_0x6114('0x3')]=_0x28fe72[_0x6114('0x3')]||'';this[_0x6114('0x4')]=_0x28fe72[_0x6114('0x4')]||'';this[_0x6114('0x5')]=_0x28fe72[_0x6114('0x5')]||{};}module[_0x6114('0x6')]=VtigerAccount; \ No newline at end of file +var _0x3b82=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x35843c,_0x291a51){var _0x3dfae3=function(_0x1c302c){while(--_0x1c302c){_0x35843c['push'](_0x35843c['shift']());}};_0x3dfae3(++_0x291a51);}(_0x3b82,0x115));var _0x23b8=function(_0x55da99,_0x4a6b0c){_0x55da99=_0x55da99-0x0;var _0x575612=_0x3b82[_0x55da99];return _0x575612;};'use strict';function VtigerAccount(_0x56f90c){this['id']=_0x56f90c['id']||0x0;this[_0x23b8('0x0')]=_0x56f90c[_0x23b8('0x0')]||'';this[_0x23b8('0x1')]=_0x56f90c[_0x23b8('0x1')]||'';this[_0x23b8('0x2')]=_0x56f90c[_0x23b8('0x2')]||'';this[_0x23b8('0x3')]=_0x56f90c[_0x23b8('0x3')]||'';this['serverUrl']=_0x56f90c[_0x23b8('0x4')]||'';this[_0x23b8('0x5')]=_0x56f90c[_0x23b8('0x5')]||{};}module[_0x23b8('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 119ad43..ebad4be 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 _0x8d15=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x18deef,_0x5b8774){var _0x3f4361=function(_0xc61e4d){while(--_0xc61e4d){_0x18deef['push'](_0x18deef['shift']());}};_0x3f4361(++_0x5b8774);}(_0x8d15,0x93));var _0x58d1=function(_0x213547,_0x309820){_0x213547=_0x213547-0x0;var _0x5ce78b=_0x8d15[_0x213547];return _0x5ce78b;};'use strict';function ZendeskAccount(_0x1f1e63){this['id']=_0x1f1e63['id']||0x0;this['name']=_0x1f1e63[_0x58d1('0x0')]||'';this[_0x58d1('0x1')]=_0x1f1e63['username']||'';this[_0x58d1('0x2')]=_0x1f1e63[_0x58d1('0x2')]||'';this['token']=_0x1f1e63[_0x58d1('0x3')]||'';this['remoteUri']=_0x1f1e63[_0x58d1('0x4')]||'';this['authType']=_0x1f1e63[_0x58d1('0x5')]||'';this[_0x58d1('0x6')]=_0x1f1e63['type']||_0x58d1('0x7');this['serverUrl']=_0x1f1e63[_0x58d1('0x8')]||'';this[_0x58d1('0x9')]=_0x1f1e63[_0x58d1('0x9')]||{};}module[_0x58d1('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x875c=['integrationTab','serverUrl','Configurations','name','username','token','remoteUri','authType','type'];(function(_0x3308e1,_0x3a318d){var _0x368941=function(_0x2113b1){while(--_0x2113b1){_0x3308e1['push'](_0x3308e1['shift']());}};_0x368941(++_0x3a318d);}(_0x875c,0x1c5));var _0xc875=function(_0x6d18f7,_0x3af254){_0x6d18f7=_0x6d18f7-0x0;var _0x30dbcb=_0x875c[_0x6d18f7];return _0x30dbcb;};'use strict';function ZendeskAccount(_0x23a90b){this['id']=_0x23a90b['id']||0x0;this[_0xc875('0x0')]=_0x23a90b[_0xc875('0x0')]||'';this['username']=_0x23a90b[_0xc875('0x1')]||'';this['password']=_0x23a90b['password']||'';this['token']=_0x23a90b[_0xc875('0x2')]||'';this[_0xc875('0x3')]=_0x23a90b[_0xc875('0x3')]||'';this[_0xc875('0x4')]=_0x23a90b[_0xc875('0x4')]||'';this[_0xc875('0x5')]=_0x23a90b['type']||_0xc875('0x6');this[_0xc875('0x7')]=_0x23a90b[_0xc875('0x7')]||'';this[_0xc875('0x8')]=_0x23a90b[_0xc875('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index eff0dde..c4b4f5f 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 _0x1750=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4561f1,_0x171083){var _0x1ddfb4=function(_0x2ccadc){while(--_0x2ccadc){_0x4561f1['push'](_0x4561f1['shift']());}};_0x1ddfb4(++_0x171083);}(_0x1750,0x65));var _0x0175=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x1750[_0x31e29a];return _0x32d892;};'use strict';function ZohoAccount(_0x8e89fe){this['id']=_0x8e89fe['id']||0x0;this[_0x0175('0x0')]=_0x8e89fe[_0x0175('0x0')]||'';this[_0x0175('0x1')]=_0x8e89fe['description']||'';this[_0x0175('0x2')]=_0x8e89fe[_0x0175('0x2')]||'';this[_0x0175('0x3')]=_0x8e89fe[_0x0175('0x3')]||'';this['clientId']=_0x8e89fe[_0x0175('0x4')]||'';this[_0x0175('0x5')]=_0x8e89fe['clientSecret']||'';this[_0x0175('0x6')]=_0x8e89fe[_0x0175('0x6')]||'';this[_0x0175('0x7')]=_0x8e89fe[_0x0175('0x7')]||'';this[_0x0175('0x8')]=_0x8e89fe['refreshToken']||'';this[_0x0175('0x9')]=_0x8e89fe['Configurations']||{};}module[_0x0175('0xa')]=ZohoAccount; \ No newline at end of file +var _0x62b0=['Configurations','exports','name','description','host','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4dd623,_0x2c29a3){var _0x3e94cb=function(_0x4b2063){while(--_0x4b2063){_0x4dd623['push'](_0x4dd623['shift']());}};_0x3e94cb(++_0x2c29a3);}(_0x62b0,0x106));var _0x062b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62b0[_0x14add3];return _0x4a174f;};'use strict';function ZohoAccount(_0x43be02){this['id']=_0x43be02['id']||0x0;this['name']=_0x43be02[_0x062b('0x0')]||'';this[_0x062b('0x1')]=_0x43be02[_0x062b('0x1')]||'';this[_0x062b('0x2')]=_0x43be02['host']||'';this['zone']=_0x43be02['zone']||'';this[_0x062b('0x3')]=_0x43be02[_0x062b('0x3')]||'';this['clientSecret']=_0x43be02[_0x062b('0x4')]||'';this[_0x062b('0x5')]=_0x43be02[_0x062b('0x5')]||'';this[_0x062b('0x6')]=_0x43be02[_0x062b('0x6')]||'';this[_0x062b('0x7')]=_0x43be02[_0x062b('0x7')]||'';this[_0x062b('0x8')]=_0x43be02[_0x062b('0x8')]||{};}module[_0x062b('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 580042d..d47dd7a 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 _0x8213=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x8213,0x17c));var _0x3821=function(_0x3ab0cf,_0x32a93f){_0x3ab0cf=_0x3ab0cf-0x0;var _0x4e85e6=_0x8213[_0x3ab0cf];return _0x4e85e6;};'use strict';var util=require('util');var _=require(_0x3821('0x0'));var moment=require('moment');function checkNameSurname(_0x5b5778,_0x3e4482,_0x130808){var _0x3b0cff='';if(!_[_0x3821('0x1')](_0x3e4482)&&_0x3821('0x2')===typeof _0x3e4482){_0x3b0cff+=_0x3e4482;}if(!_[_0x3821('0x1')](_0x130808)&&_0x3821('0x2')===typeof _0x130808){_0x3b0cff+='\x20'+_0x130808;}if(_0x3b0cff!==''){return _0x3b0cff;}return _0x5b5778;}function Action(_0x107a3c,_0x5eed49,_0x5c612e,_0x125d44,_0x4625de){this['uniqueid']=_0x5c612e||undefined;this[_0x3821('0x3')]=_0x107a3c['id'];this[_0x3821('0x4')]=_0x5eed49['name'];this[_0x3821('0x5')]=_0x5eed49[_0x3821('0x5')];this[_0x3821('0x6')]=_0x3821('0x4');this[_0x3821('0x7')]=![];this[_0x3821('0x8')]=_[_0x3821('0x1')](_0x107a3c[_0x3821('0x9')])?undefined:_0x107a3c[_0x3821('0x9')][_0x3821('0xa')];this[_0x3821('0xb')]=this[_0x3821('0x8')]?util[_0x3821('0xc')]('SIP/%s',this[_0x3821('0x8')]):_0x125d44||undefined;this[_0x3821('0xd')]=checkNameSurname(_0x107a3c[_0x3821('0xe')][_0x3821('0xf')],_0x107a3c[_0x3821('0xe')]['firstName'],_0x107a3c[_0x3821('0xe')][_0x3821('0x10')]);this[_0x3821('0x11')]=_0x107a3c[_0x3821('0x11')]||![];this[_0x3821('0x12')]=_0x107a3c['Contact'][_0x3821('0xf')];this[_0x3821('0x13')]=_0x107a3c[_0x3821('0x13')];this[_0x3821('0x14')]=_0x107a3c[_0x3821('0x14')]||0x0;this[_0x3821('0x15')]=_0x107a3c[_0x3821('0x15')]||0x0;this[_0x3821('0x16')]=_0x107a3c[_0x3821('0x16')]||0x0;this['countglobal']=(_0x107a3c[_0x3821('0x14')]||0x0)+(_0x107a3c['countcongestionretry']||0x0)+(_0x107a3c[_0x3821('0x16')]||0x0)+(_0x107a3c[_0x3821('0x17')]||0x0)+(_0x107a3c[_0x3821('0x18')]||0x0)+(_0x107a3c['countabandonedretry']||0x0)+(_0x107a3c[_0x3821('0x19')]||0x0)+(_0x107a3c[_0x3821('0x1a')]||0x0);this[_0x3821('0x17')]=_0x107a3c[_0x3821('0x17')]||0x0;this['countdropretry']=_0x107a3c[_0x3821('0x18')]||0x0;this['countabandonedretry']=_0x107a3c[_0x3821('0x1b')]||0x0;this[_0x3821('0x19')]=_0x107a3c[_0x3821('0x19')]||0x0;this[_0x3821('0x1a')]=_0x107a3c[_0x3821('0x1a')]||0x0;this['callback']=_0x107a3c['callback'];this[_0x3821('0x1c')]=_0x107a3c[_0x3821('0x1c')];this['callbackat']=_0x107a3c[_0x3821('0x1d')];this['recallme']=_0x107a3c[_0x3821('0x1e')];this['ContactId']=_0x107a3c['ContactId'];this[_0x3821('0x1f')]=_0x107a3c['ListId'];this[_0x3821('0x20')]=_[_0x3821('0x1')](_0x107a3c[_0x3821('0x9')])?_0x107a3c['UserId']:_0x107a3c[_0x3821('0x9')]['id'];this[_0x3821('0x21')]=_0x107a3c[_0x3821('0x21')];this[_0x3821('0x22')]='';this['originatecalleridname']='';}Action[_0x3821('0x23')][_0x3821('0x24')]=function(){return util[_0x3821('0xc')](_0x3821('0x25'),this[_0x3821('0xd')],this[_0x3821('0x26')]);};module[_0x3821('0x27')]=Action; \ No newline at end of file +var _0xc0a1=['util','moment','isNil','string','uniqueid','queue','name','campaigntype','Agent','membername','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc0a1,0x171));var _0x1c0a=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0xc0a1[_0x4450b1];return _0x399b0b;};'use strict';var util=require(_0x1c0a('0x0'));var _=require('lodash');var moment=require(_0x1c0a('0x1'));function checkNameSurname(_0x50375d,_0x3145c9,_0x3b33e1){var _0x3c49e6='';if(!_[_0x1c0a('0x2')](_0x3145c9)&&_0x1c0a('0x3')===typeof _0x3145c9){_0x3c49e6+=_0x3145c9;}if(!_[_0x1c0a('0x2')](_0x3b33e1)&&_0x1c0a('0x3')===typeof _0x3b33e1){_0x3c49e6+='\x20'+_0x3b33e1;}if(_0x3c49e6!==''){return _0x3c49e6;}return _0x50375d;}function Action(_0x46775f,_0x5bb8c4,_0x1ce60c,_0x57d621,_0x3980d1){this[_0x1c0a('0x4')]=_0x1ce60c||undefined;this['idContact']=_0x46775f['id'];this[_0x1c0a('0x5')]=_0x5bb8c4[_0x1c0a('0x6')];this['type']=_0x5bb8c4['type'];this[_0x1c0a('0x7')]='queue';this['dialAnswer']=![];this['membername']=_['isNil'](_0x46775f[_0x1c0a('0x8')])?undefined:_0x46775f['Agent'][_0x1c0a('0x6')];this['channelAgent']=this[_0x1c0a('0x9')]?util['format'](_0x1c0a('0xa'),this['membername']):_0x57d621||undefined;this[_0x1c0a('0xb')]=checkNameSurname(_0x46775f['Contact'][_0x1c0a('0xc')],_0x46775f['Contact'][_0x1c0a('0xd')],_0x46775f[_0x1c0a('0xe')][_0x1c0a('0xf')]);this[_0x1c0a('0x10')]=_0x46775f[_0x1c0a('0x10')]||![];this[_0x1c0a('0x11')]=_0x46775f[_0x1c0a('0xe')]['phone'];this[_0x1c0a('0x12')]=_0x46775f[_0x1c0a('0x12')];this[_0x1c0a('0x13')]=_0x46775f[_0x1c0a('0x13')]||0x0;this['countcongestionretry']=_0x46775f[_0x1c0a('0x14')]||0x0;this[_0x1c0a('0x15')]=_0x46775f[_0x1c0a('0x15')]||0x0;this[_0x1c0a('0x16')]=(_0x46775f['countbusyretry']||0x0)+(_0x46775f[_0x1c0a('0x14')]||0x0)+(_0x46775f['countnoanswerretry']||0x0)+(_0x46775f[_0x1c0a('0x17')]||0x0)+(_0x46775f[_0x1c0a('0x18')]||0x0)+(_0x46775f[_0x1c0a('0x19')]||0x0)+(_0x46775f[_0x1c0a('0x1a')]||0x0)+(_0x46775f[_0x1c0a('0x1b')]||0x0);this['countnosuchnumberretry']=_0x46775f[_0x1c0a('0x17')]||0x0;this[_0x1c0a('0x18')]=_0x46775f[_0x1c0a('0x18')]||0x0;this['countabandonedretry']=_0x46775f[_0x1c0a('0x19')]||0x0;this[_0x1c0a('0x1a')]=_0x46775f['countmachineretry']||0x0;this['countagentrejectretry']=_0x46775f['countagentrejectretry']||0x0;this[_0x1c0a('0x1c')]=_0x46775f['callback'];this[_0x1c0a('0x1d')]=_0x46775f[_0x1c0a('0x1d')];this['callbackat']=_0x46775f[_0x1c0a('0x1e')];this['recallme']=_0x46775f[_0x1c0a('0x1f')];this[_0x1c0a('0x20')]=_0x46775f[_0x1c0a('0x20')];this[_0x1c0a('0x21')]=_0x46775f[_0x1c0a('0x21')];this[_0x1c0a('0x22')]=_[_0x1c0a('0x2')](_0x46775f[_0x1c0a('0x8')])?_0x46775f[_0x1c0a('0x22')]:_0x46775f[_0x1c0a('0x8')]['id'];this['VoiceQueueId']=_0x46775f[_0x1c0a('0x23')];this['originatecalleridnum']='';this[_0x1c0a('0x24')]='';}Action[_0x1c0a('0x25')][_0x1c0a('0x26')]=function(){return util['format'](_0x1c0a('0x27'),this[_0x1c0a('0xb')],this[_0x1c0a('0x28')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index abc3d94..27480bd 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 _0x7bf1=['dialRecallMeTimeout','Agent','logger2','[RecallMe]','disableContact','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','emit','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','activeContact','YYYY-MM-DD\x20HH:mm:ss','responsetime','uniqueid','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','\x20Queue','pTalking:\x20','linkedid','BUSY','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','countagentrejectretry','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','execRun','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','prototype','syncCampaigns','clockClearZombieChannels','preview','booked','hasOwnProperty','recallMe','isNil','originated:\x20','queue','dialAnswer','contactId','UserId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','scheduledat'];(function(_0x4e53be,_0x25ed6b){var _0x3b5092=function(_0x3c157d){while(--_0x3c157d){_0x4e53be['push'](_0x4e53be['shift']());}};_0x3b5092(++_0x25ed6b);}(_0x7bf1,0xd8));var _0x17bf=function(_0x3c37cd,_0x32a69c){_0x3c37cd=_0x3c37cd-0x0;var _0xbeaa6=_0x7bf1[_0x3c37cd];return _0xbeaa6;};'use strict';var util=require(_0x17bf('0x0'));var _=require(_0x17bf('0x1'));var BPromise=require(_0x17bf('0x2'));var uuid=require(_0x17bf('0x3'));var moment=require(_0x17bf('0x4'));var md5=require('md5');var Redis=require(_0x17bf('0x5'));var config=require(_0x17bf('0x6'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0x17bf('0x7'))('actionPreview');var ami=require(_0x17bf('0x8'));var rpcDb=require(_0x17bf('0x9'));var Action=require(_0x17bf('0xa'));var ut=require('./util/util');config[_0x17bf('0xb')]=_[_0x17bf('0xc')](config['redis'],{'host':_0x17bf('0xd'),'port':0x18eb});var io=require(_0x17bf('0xe'))(new Redis(config[_0x17bf('0xb')]));var Sequence=function(){};Sequence['prototype'][_0x17bf('0xf')]=function(_0x1db6c4){this[_0x17bf('0x10')]=this[_0x17bf('0x10')]?this[_0x17bf('0x10')][_0x17bf('0x11')](_0x1db6c4):_0x1db6c4();};function Preview(_0x52fc4c){this[_0x17bf('0x12')]=new Sequence();this[_0x17bf('0x13')]=_0x52fc4c[_0x17bf('0x14')];this['trunks']=_0x52fc4c[_0x17bf('0x15')];this[_0x17bf('0x16')]={};this[_0x17bf('0x17')]=_0x52fc4c[_0x17bf('0x17')];this['clockClearZombieChannels']=0x0;ami['on'](_0x17bf('0x18'),this[_0x17bf('0x19')][_0x17bf('0x1a')](this));ami['on'](_0x17bf('0x1b'),this[_0x17bf('0x1c')][_0x17bf('0x1a')](this));ami['on']('hanguprequest',this[_0x17bf('0x1d')][_0x17bf('0x1a')](this));ami['on'](_0x17bf('0x1e'),this['syncDialEnd'][_0x17bf('0x1a')](this));ami['on'](_0x17bf('0x1f'),this[_0x17bf('0x20')]['bind'](this));ami['on'](_0x17bf('0x21'),this[_0x17bf('0x22')][_0x17bf('0x1a')](this));ami['on'](_0x17bf('0x23'),this[_0x17bf('0x24')][_0x17bf('0x1a')](this));ami['on'](_0x17bf('0x25'),this[_0x17bf('0x26')]['bind'](this));this[_0x17bf('0x27')](this[_0x17bf('0x13')]);}function emit(_0x3d1506,_0x57b796,_0x222595){io['to'](_0x3d1506)['emit'](_0x57b796,_0x222595);}function emitCampaignPreview(_0x44733b){if(_0x44733b[_0x17bf('0x28')]===_0x17bf('0x29')){var _0x374fb6={'id':_0x44733b['id'],'name':_0x44733b[_0x17bf('0x2a')],'strategy':_0x44733b['strategy'],'answered':_0x44733b['answered'],'available':_0x44733b[_0x17bf('0x2b')],'loggedIn':_0x44733b['loggedIn'],'pTalking':_0x44733b[_0x17bf('0x2c')],'sumBillable':_0x44733b[_0x17bf('0x2d')],'sumDuration':_0x44733b[_0x17bf('0x2e')],'sumHoldTime':_0x44733b[_0x17bf('0x2f')]||0x0,'talking':_0x44733b[_0x17bf('0x30')],'total':_0x44733b['total'],'type':_0x44733b[_0x17bf('0x28')],'unmanaged':_0x44733b[_0x17bf('0x31')],'abandoned':_0x44733b[_0x17bf('0x32')],'waiting':_0x44733b['waiting'],'loggedInDb':_0x44733b[_0x17bf('0x33')],'dialActive':_0x44733b[_0x17bf('0x34')],'dialMethod':_0x44733b[_0x17bf('0x35')],'dialOriginateCallerIdName':_0x44733b[_0x17bf('0x36')],'dialOriginateCallerIdNumber':_0x44733b[_0x17bf('0x37')],'dialOriginateTimeout':_0x44733b['dialOriginateTimeout'],'dialPrefix':_0x44733b[_0x17bf('0x38')],'outboundAnswerAgiCallsDay':_0x44733b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x44733b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x44733b[_0x17bf('0x39')],'outboundBusyCallsDay':_0x44733b[_0x17bf('0x3a')],'outboundCongestionCallsDay':_0x44733b[_0x17bf('0x3b')],'outboundDropCallsDayACS':_0x44733b[_0x17bf('0x3c')],'outboundDropCallsDayCallersExit':_0x44733b[_0x17bf('0x3d')],'outboundDropCallsDayTimeout':_0x44733b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x44733b[_0x17bf('0x3e')],'outboundNoSuchCallsDay':_0x44733b[_0x17bf('0x3f')],'outboundOriginateFailureCallsDay':_0x44733b[_0x17bf('0x40')],'outboundReCallsDay':_0x44733b[_0x17bf('0x41')],'outboundRejectCallsDay':_0x44733b[_0x17bf('0x42')],'outboundUnknownCallsDay':_0x44733b[_0x17bf('0x43')],'outboundAbandonedCallsDay':_0x44733b[_0x17bf('0x44')],'predictiveIntervalAnsweredCalls':_0x44733b[_0x17bf('0x45')],'predictiveIntervalAvgHoldtime':_0x44733b[_0x17bf('0x46')],'predictiveIntervalAvgTalktime':_0x44733b[_0x17bf('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x44733b[_0x17bf('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x44733b[_0x17bf('0x49')],'predictiveIntervalErlangCalls':_0x44733b['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x44733b['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x44733b[_0x17bf('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x44733b[_0x17bf('0x4b')],'predictiveIntervalPauses':_0x44733b[_0x17bf('0x4c')],'predictiveIntervalAvailable':_0x44733b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x44733b[_0x17bf('0x4d')],'message':_0x44733b[_0x17bf('0x4e')],'originated':_0x44733b[_0x17bf('0x4f')],'erlangCalls':_0x44733b[_0x17bf('0x50')],'erlangCallToSecond':_0x44733b['erlangCallToSecond'],'erlangAbandonmentRate':_0x44733b['erlangAbandonmentRate'],'erlangBusyFactor':_0x44733b['erlangBusyFactor'],'startPredictive':_0x44733b[_0x17bf('0x51')],'startProgressive':_0x44733b[_0x17bf('0x52')]};if(_0x44733b[_0x17bf('0x53')]){_0x374fb6['Trunk']={'id':_0x44733b[_0x17bf('0x53')]['id'],'name':_0x44733b['Trunk'][_0x17bf('0x2a')],'active':_0x44733b[_0x17bf('0x53')][_0x17bf('0x54')],'callerid':_0x44733b[_0x17bf('0x53')][_0x17bf('0x55')]};}if(_0x44733b[_0x17bf('0x56')]){_0x374fb6[_0x17bf('0x56')]={'id':_0x44733b[_0x17bf('0x56')]['id'],'name':_0x44733b['Interval']['name']};}var _0x58efc9=md5(JSON[_0x17bf('0x57')](_0x374fb6));if(_0x44733b['md5']!==_0x58efc9){_0x44733b[_0x17bf('0x58')]=_0x58efc9;emit(util['format'](_0x17bf('0x59'),_0x374fb6[_0x17bf('0x2a')]),'voice_queue:save',_0x374fb6);}}}function emitVoiceQueueChannelRemove(_0xe58e42){logger[_0x17bf('0x5a')](_0x17bf('0x5b'),JSON['stringify'](_0xe58e42));emit(util[_0x17bf('0x5c')](_0x17bf('0x59'),_0xe58e42['name']),_0x17bf('0x5d'),_0xe58e42);io['emit'](_0x17bf('0x5e'),_0xe58e42);}function notSendMessagesQueue(_0x58a93e){if(_0x58a93e[_0x17bf('0x5f')]){if(_0x58a93e[_0x17bf('0x4f')]===0x0&&_0x58a93e[_0x17bf('0x2c')]===0x0){_0x58a93e[_0x17bf('0x5f')]=![];_0x58a93e[_0x17bf('0x2b')]=0x0;_0x58a93e[_0x17bf('0x60')]=0x0;_0x58a93e[_0x17bf('0x4e')]=_0x17bf('0x61');ut[_0x17bf('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58a93e[_0x17bf('0x2a')]+_0x17bf('0x63'));}else{_0x58a93e[_0x17bf('0x4e')]=_0x17bf('0x64');ut[_0x17bf('0x62')](_0x17bf('0x65'),_0x58a93e[_0x17bf('0x2a')]+_0x17bf('0x66'));}emitCampaignPreview(_0x58a93e);}}Preview[_0x17bf('0x67')][_0x17bf('0x27')]=function(){var _0x4d9462=this;setInterval(function(){_0x4d9462[_0x17bf('0x68')]();},0x7cf);};Preview[_0x17bf('0x67')]['syncCampaigns']=function(){var _0x4a6254=this[_0x17bf('0x13')];this[_0x17bf('0x69')]+=0x1;for(var _0x5a6c49 in _0x4a6254){if(_0x4a6254['hasOwnProperty'](_0x5a6c49)&&(_0x4a6254[_0x5a6c49][_0x17bf('0x35')]===_0x17bf('0x6a')||_0x4a6254[_0x5a6c49]['dialMethod']===_0x17bf('0x6b'))&&_0x4a6254[_0x5a6c49][_0x17bf('0x28')]===_0x17bf('0x29')){if(this['clockClearZombieChannels']>0x7){this[_0x17bf('0x69')]=0x0;this['clearZombieChannels']();}}if(_0x4a6254[_0x17bf('0x6c')](_0x5a6c49)&&_0x4a6254[_0x5a6c49][_0x17bf('0x35')]===_0x17bf('0x6a')&&_0x4a6254[_0x5a6c49]['type']===_0x17bf('0x29')){if(_0x4a6254[_0x5a6c49][_0x17bf('0x34')]){this['setMessage'](_0x4a6254[_0x5a6c49]);this[_0x17bf('0x6d')](_0x4a6254[_0x5a6c49]);}else{notSendMessagesQueue(_0x4a6254[_0x5a6c49]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x1dc621){var _0x3f593a=this;this[_0x17bf('0x12')][_0x17bf('0xf')](function(){if(!_[_0x17bf('0x6e')](_0x3f593a[_0x17bf('0x16')][_0x1dc621])){loggerAction[_0x17bf('0x5a')]('[clearZombieChannels][talking]',_0x1dc621,'Queue',_0x3f593a['actions'][_0x1dc621]['queue'],_0x17bf('0x6f'),JSON[_0x17bf('0x57')](_0x3f593a[_0x17bf('0x13')][_0x3f593a['actions'][_0x1dc621][_0x17bf('0x70')]][_0x17bf('0x4f')]),'pTalking:\x20',JSON['stringify'](_0x3f593a[_0x17bf('0x13')][_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x70')]]['pTalking']),JSON[_0x17bf('0x57')](_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x71')]),JSON[_0x17bf('0x57')](_['pick'](_0x3f593a['actions'][_0x1dc621],[_0x17bf('0x72'),_0x17bf('0x73'),_0x17bf('0x74'),'ListId'])));return ami[_0x17bf('0x75')]({'action':_0x17bf('0x76'),'channel':_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x77')]})[_0x17bf('0x78')](function(_0x526f4c){if(_0x526f4c[_0x17bf('0x4e')]===_0x17bf('0x79')){setTimeout(function(){if(_0x3f593a[_0x17bf('0x16')][_0x1dc621]){ut[_0x17bf('0x7a')](_0x3f593a[_0x17bf('0x13')][_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x70')]],_0x17bf('0x7b'));if(_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x71')]===!![]){ut[_0x17bf('0x7c')](_0x3f593a[_0x17bf('0x13')][_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x70')]],_0x17bf('0x7b'));ut['loggerError'](_0x17bf('0x7d')+_0x1dc621,_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x70')]);}ut[_0x17bf('0x7e')](_0x17bf('0x7f')+_0x1dc621,_0x3f593a[_0x17bf('0x16')][_0x1dc621][_0x17bf('0x70')]);delete _0x3f593a[_0x17bf('0x16')][_0x1dc621];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0xab7e2c=this;loggerAction[_0x17bf('0x5a')]('[action]',_[_0x17bf('0x80')](this['actions']));for(var _0x2d7385 in this[_0x17bf('0x16')]){if(_0xab7e2c[_0x17bf('0x16')][_0x17bf('0x6c')](_0x2d7385)){_0xab7e2c[_0x17bf('0x81')](_0x2d7385);}}};Preview['prototype'][_0x17bf('0x6d')]=function(_0x91374){var _0x1e6af7=this;rpcDb[_0x17bf('0x82')](_0x91374['id'],ut[_0x17bf('0x83')](this['agents']))[_0x17bf('0x84')](function(_0xf970ea){if(!_[_0x17bf('0x6e')](_0xf970ea)){for(var _0x15baf4=0x0;_0x15baf4<_0xf970ea[_0x17bf('0x85')];_0x15baf4+=0x1){if(ut['getDiff'](_0xf970ea[_0x15baf4][_0x17bf('0x86')])<_0x91374[_0x17bf('0x87')]*0x3c){if(_0xf970ea[_0x15baf4][_0x17bf('0x88')]&&!_0xf970ea[_0x15baf4][_0x17bf('0x88')]['voicePause']){_0x1e6af7['run'](_0xf970ea[_0x15baf4]['id'])[_0x17bf('0x84')](ut[_0x17bf('0x89')](_0x17bf('0x8a')))['catch'](ut['logger2'](_0x17bf('0x8a')));}else{rpcDb[_0x17bf('0x8b')](_0xf970ea[_0x15baf4]['id']);}}else{var _0x4ecca1=new Action(_0xf970ea[_0x15baf4],_0x91374);_0x4ecca1['starttime']=moment()[_0x17bf('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x91374[_0x17bf('0x41')]+=0x1;ut[_0x17bf('0x8c')](_0x4ecca1,0x17,_0x17bf('0x8d'));if(_0x91374['dialRecallInQueue']){rpcDb[_0x17bf('0x8e')](ut[_0x17bf('0x8f')](_0xf970ea[_0x15baf4]));rpcDb[_0x17bf('0x90')](_0x4ecca1,_0x17bf('0x91'));}else{ut[_0x17bf('0x8c')](_0x4ecca1,0x16,_0x17bf('0x92'));rpcDb[_0x17bf('0x90')](_0x4ecca1,_0x17bf('0x93'));rpcDb[_0x17bf('0x94')](_0x4ecca1,_0x17bf('0x93'));}}}}})[_0x17bf('0x78')](ut['logger2'](_0x17bf('0x95')));};Preview[_0x17bf('0x67')][_0x17bf('0x96')]=function(_0x55af1d){_0x55af1d[_0x17bf('0x5f')]=!![];if(ut[_0x17bf('0x97')](_0x55af1d[_0x17bf('0x98')])){_0x55af1d['message']=_0x17bf('0x99');}else if(!ut['isActive'](_0x55af1d[_0x17bf('0x34')])){_0x55af1d[_0x17bf('0x4e')]=_0x17bf('0x61');}else if(!this['isTrunkReachable'](_0x55af1d['Trunk'])){if(!this[_0x17bf('0x9a')](_0x55af1d['TrunkBackup'])){_0x55af1d[_0x17bf('0x4e')]=_0x17bf('0x9b');}else{_0x55af1d[_0x17bf('0x4e')]=_0x17bf('0x9c');}}else{_0x55af1d['message']=_0x17bf('0x9c');}emitCampaignPreview(_0x55af1d);};Preview[_0x17bf('0x67')][_0x17bf('0x9d')]=function(_0x3be492,_0x120d80,_0x2918d6){var _0x5b9a77=this;var _0x3f5d5f=this[_0x17bf('0x16')][_0x120d80];var _0x47fa36=this[_0x17bf('0x13')][_0x3f5d5f[_0x17bf('0x70')]];var _0x343d10;if(_0x47fa36){switch(_0x2918d6){case'1':_0x47fa36[_0x17bf('0x3f')]+=0x1;_0x3f5d5f[_0x17bf('0x9e')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut['logCustomer'](_0x3f5d5f,0x0,_0x17bf('0xa1'));ami[_0x17bf('0xa2')](_0x17bf('0xa3'),ut['buildObj'](_0x3f5d5f,_0x17bf('0xa4')));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xa5'));if(ut[_0x17bf('0xa0')](_0x3f5d5f)>=_0x47fa36['dialGlobalMaxRetry']){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb['createCustomerFinal'](_0x343d10,_0x17bf('0xa8'));}else{if(_0x3f5d5f['countnosuchnumberretry']>=_0x47fa36[_0x17bf('0xa9')]){rpcDb['createCustomerFinal'](_0x3f5d5f,_0x17bf('0xa8'));}else{rpcDb[_0x17bf('0xaa')](ut[_0x17bf('0xab')](_0x3f5d5f,_0x17bf('0x9e'),_0x47fa36['dialNoSuchNumberRetryFrequency']),_0x3f5d5f['unlockAgent'],_0x3f5d5f[_0x17bf('0xac')]);}}delete this[_0x17bf('0x16')][_0x3be492['linkedid']];break;case'ANSWER':var _0xb10416=moment()[_0x17bf('0x5c')](_0x17bf('0xad'));_0x3f5d5f[_0x17bf('0xae')]=_0xb10416;_0x3f5d5f['answertime']=_0xb10416;_0x3f5d5f[_0x17bf('0x71')]=!![];_0x47fa36['pTalking']+=0x1;logger[_0x17bf('0x5a')]('[syncHangup][talking][increment]',_0x3f5d5f[_0x17bf('0xaf')],'\x20Queue',_0x47fa36[_0x17bf('0x2a')],'pTalking:\x20',_0x47fa36[_0x17bf('0x2c')]);ami[_0x17bf('0xa2')](_0x17bf('0xb0'),ut['buildObj'](_0x3f5d5f,'connect',this[_0x17bf('0x13')][_0x3f5d5f[_0x17bf('0x70')]]));if(_0x47fa36[_0x17bf('0xb1')]){ami[_0x17bf('0xa2')](_0x17bf('0xb2'),ut['buildAcw'](_0x3f5d5f));}break;case'16':ami['emit'](_0x17bf('0xb3'),ut[_0x17bf('0xb4')](_0x3f5d5f,_0x17bf('0xb5'),this[_0x17bf('0x13')][_0x3f5d5f[_0x17bf('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x17bf('0xb4')](_0x3f5d5f,_0x17bf('0xb5')));_0x47fa36[_0x17bf('0xb6')]+=0x1;_0x47fa36[_0x17bf('0xb7')]+=0x1;_0x47fa36[_0x17bf('0xb8')]+=0x1;ut['decrementTalkink'](_0x47fa36,_0x17bf('0xb9'));_0x3f5d5f['countglobal']=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x4,_0x17bf('0xba'));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xbb'));rpcDb[_0x17bf('0x94')](_0x3f5d5f,_0x17bf('0xbc'));rpcDb['crateCustomerReportQueue'](_0x3f5d5f);_0x47fa36['sumDuration']+=_0x3f5d5f[_0x17bf('0xbd')];_0x47fa36[_0x17bf('0x2d')]+=_0x3f5d5f[_0x17bf('0xbd')];logger[_0x17bf('0x5a')](_0x17bf('0xbe'),_0x3f5d5f[_0x17bf('0xaf')],_0x17bf('0xbf'),_0x47fa36['name'],_0x17bf('0xc0'),_0x47fa36[_0x17bf('0x2c')]);delete this[_0x17bf('0x16')][_0x3be492[_0x17bf('0xc1')]];break;case _0x17bf('0xc2'):_0x47fa36[_0x17bf('0x3a')]+=0x1;_0x3f5d5f['countbusyretry']+=0x1;_0x3f5d5f['countglobal']=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x5,_0x17bf('0xc3'));ami['emit']('custom:agentbusy',ut[_0x17bf('0xb4')](_0x3f5d5f,'busy'));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xc4'));if(ut['totalGlobal'](_0x3f5d5f)>=_0x47fa36['dialGlobalMaxRetry']){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb['createCustomerFinal'](_0x343d10,_0x17bf('0xc5'));}else{if(_0x3f5d5f[_0x17bf('0xc6')]>=_0x47fa36[_0x17bf('0xc7')]){rpcDb[_0x17bf('0x94')](_0x3f5d5f,_0x17bf('0xc4'));}else{rpcDb[_0x17bf('0xaa')](ut[_0x17bf('0xab')](_0x3f5d5f,'countbusyretry',_0x47fa36[_0x17bf('0xc8')]),_0x3f5d5f[_0x17bf('0xc9')],_0x3f5d5f['activeContact']);}}break;case _0x17bf('0xca'):_0x47fa36[_0x17bf('0x3e')]+=0x1;_0x3f5d5f[_0x17bf('0xcb')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x3,'NoAnswer');ami[_0x17bf('0xa2')](_0x17bf('0xcc'),ut['buildObj'](_0x3f5d5f,'noanswer'));rpcDb['createCustomerHistory'](_0x3f5d5f,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x17bf('0xa0')](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb[_0x17bf('0x94')](_0x343d10,_0x17bf('0xce'));}else{if(_0x3f5d5f[_0x17bf('0xcb')]>=_0x47fa36['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x3f5d5f,_0x17bf('0xcf'));}else{rpcDb[_0x17bf('0xaa')](ut['scheduledAt'](_0x3f5d5f,'countnoanswerretry',_0x47fa36['dialNoAnswerRetryFrequency']),_0x3f5d5f[_0x17bf('0xc9')],_0x3f5d5f['activeContact']);}}break;case _0x17bf('0xd0'):_0x47fa36[_0x17bf('0x3b')]+=0x1;_0x3f5d5f['countcongestionretry']+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x8,_0x17bf('0xd1'));ami[_0x17bf('0xa2')](_0x17bf('0xd2'),ut['buildObj'](_0x3f5d5f,_0x17bf('0xd3')));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xd4'));if(ut[_0x17bf('0xa0')](_0x3f5d5f)>=_0x47fa36['dialGlobalMaxRetry']){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb[_0x17bf('0x94')](_0x343d10,_0x17bf('0xd5'));}else{if(_0x3f5d5f[_0x17bf('0xd6')]>=_0x47fa36[_0x17bf('0xd7')]){rpcDb[_0x17bf('0x94')](_0x3f5d5f,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x17bf('0xaa')](ut['scheduledAt'](_0x3f5d5f,_0x17bf('0xd6'),_0x47fa36['dialBusyRetryFrequency']),_0x3f5d5f[_0x17bf('0xc9')],_0x3f5d5f[_0x17bf('0xac')]);}}break;case'CANCEL':_0x47fa36['outboundRejectCallsDay']+=0x1;_0x3f5d5f[_0x17bf('0xd8')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x14,'AgentReject');ami[_0x17bf('0xa2')]('custom:agentreject',ut[_0x17bf('0xb4')](_0x3f5d5f,_0x17bf('0xd9')));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xda'));if(ut[_0x17bf('0xa0')](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut['cloneAction'](_0x3f5d5f,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x343d10,_0x17bf('0xdb'));}else{if(_0x3f5d5f[_0x17bf('0xd8')]>=_0x47fa36[_0x17bf('0xdc')]){rpcDb['createCustomerFinal'](_0x3f5d5f,_0x17bf('0xdb'));}else{rpcDb['rescheduleContact'](ut[_0x17bf('0xab')](_0x3f5d5f,'countagentrejectretry',_0x47fa36[_0x17bf('0xdd')]),_0x3f5d5f[_0x17bf('0xc9')],_0x3f5d5f[_0x17bf('0xac')]);}}break;case _0x17bf('0xde'):_0x47fa36[_0x17bf('0x44')]+=0x1;_0x3f5d5f[_0x17bf('0xdf')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0xb,_0x17bf('0xe0'));rpcDb['createCustomerHistory'](_0x3f5d5f,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb['createCustomerFinal'](_0x343d10,_0x17bf('0xe1'));}else{if(_0x3f5d5f[_0x17bf('0xe2')]>=_0x47fa36[_0x17bf('0xe3')]){rpcDb[_0x17bf('0x94')](_0x3f5d5f,_0x17bf('0xe1'));}else{rpcDb[_0x17bf('0xaa')](ut[_0x17bf('0xab')](_0x3f5d5f,_0x17bf('0xdf'),_0x47fa36[_0x17bf('0xe4')]),_0x3f5d5f['unlockAgent'],_0x3f5d5f[_0x17bf('0xac')]);}}break;case'18':_0x47fa36['outboundUnknownCallsDay']+=0x1;_0x3f5d5f[_0x17bf('0xe5')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut['totalGlobal'](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x12,_0x3be492[_0x17bf('0xe6')]||_0x3be492[_0x17bf('0xe7')]);ami['emit'](_0x17bf('0xe8'),ut['buildObj'](_0x3f5d5f,_0x17bf('0xe9')));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xea'));if(ut['totalGlobal'](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,'Global');rpcDb[_0x17bf('0x94')](_0x343d10,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x17bf('0x94')](_0x3f5d5f,_0x17bf('0xea'));}delete this[_0x17bf('0x16')][_0x3be492[_0x17bf('0xc1')]];break;case'19':_0x47fa36[_0x17bf('0x43')]+=0x1;_0x3f5d5f[_0x17bf('0x9f')]=ut[_0x17bf('0xa0')](_0x3f5d5f);ut[_0x17bf('0x8c')](_0x3f5d5f,0x13,_0x3be492['cause-txt']||_0x3be492['dialstatus']);ami[_0x17bf('0xa2')](_0x17bf('0xe8'),ut[_0x17bf('0xb4')](_0x3f5d5f,'amd'));rpcDb[_0x17bf('0x90')](_0x3f5d5f,_0x17bf('0xeb'));if(ut['totalGlobal'](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut['cloneAction'](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb[_0x17bf('0x94')](_0x343d10,_0x17bf('0xeb'));}else{rpcDb[_0x17bf('0x94')](_0x3f5d5f,'[callProgressDetectingCustomer][machine]');}delete this[_0x17bf('0x16')][_0x3be492[_0x17bf('0xc1')]];break;default:if(_0x3f5d5f['dialAnswer']){ut['decrementTalkink'](_0x47fa36,'[default]');ut['loggerError'](_0x17bf('0xec')+_0x47fa36[_0x17bf('0x2a')],_0x3be492);}_0x47fa36[_0x17bf('0x43')]+=0x1;_0x3f5d5f['countglobal']=ut['totalGlobal'](_0x3f5d5f);ut['logCustomer'](_0x3f5d5f,0xc,_0x3be492[_0x17bf('0xe6')]||_0x3be492[_0x17bf('0xe7')]);rpcDb['createCustomerHistory'](_0x3f5d5f,_0x17bf('0xed'));if(ut[_0x17bf('0xa0')](_0x3f5d5f)>=_0x47fa36[_0x17bf('0xcd')]){_0x343d10=ut[_0x17bf('0xa6')](_0x3f5d5f,0xf,_0x17bf('0xa7'));rpcDb[_0x17bf('0x94')](_0x343d10,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x17bf('0x94')](_0x3f5d5f,_0x17bf('0xee'));}delete this['actions'][_0x3be492[_0x17bf('0xc1')]];}if(!(_0x3f5d5f['dialAnswer']&&_0x2918d6==='16')){ut[_0x17bf('0x7a')](_0x47fa36,'[callProgressDetectingCustomer]');logger[_0x17bf('0x5a')](_0x17bf('0xef'),_0x3f5d5f[_0x17bf('0xaf')],'\x20Queue',_0x47fa36['name'],_0x17bf('0x6f'),_0x47fa36[_0x17bf('0x4f')]);}if(_0x2918d6!==_0x17bf('0xf0')){delete this[_0x17bf('0x16')][_0x3be492[_0x17bf('0xc1')]];delete this[_0x17bf('0x16')][_0x3be492[_0x17bf('0xf1')]];}}};Preview['prototype'][_0x17bf('0xf2')]=function(_0x47c140,_0x4c3cd8,_0x3aedcd){if(_[_0x17bf('0xf3')](_0x4c3cd8)&&_0x17bf('0xf4')!==typeof _0x4c3cd8){return;}if(_['isUndefined'](_0x3aedcd)&&_0x17bf('0xf4')!==typeof _0x3aedcd){return;}switch(_0x3aedcd[_0x17bf('0xf5')]){case'0':ut['logAgent'](_0x47c140,0x0,_0x17bf('0xa1'));rpcDb[_0x17bf('0xf6')](_0x47c140,_0x17bf('0xf7'));break;case'3':ut[_0x17bf('0xf8')](_0x47c140,0x3,_0x17bf('0xf9'));rpcDb[_0x17bf('0xf6')](_0x47c140,_0x17bf('0xfa'));break;case'5':ut['logAgent'](_0x47c140,0x5,'Busy');rpcDb[_0x17bf('0xf6')](_0x47c140,_0x17bf('0xfb'));break;case'8':ut[_0x17bf('0xf8')](_0x47c140,0x8,'Congestion');rpcDb['createAgentHistory'](_0x47c140,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x17bf('0xf8')](_0x47c140,0x16,_0x17bf('0xfc'));rpcDb[_0x17bf('0xf6')](_0x47c140,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x17bf('0xf8')](_0x47c140,0xc,_0x3aedcd['reason']);rpcDb[_0x17bf('0xf6')](_0x47c140,_0x17bf('0xfd'));}ut['updateOriginated'](_0x4c3cd8,'[callProgressDetectingAgent]');logger[_0x17bf('0x5a')]('[originated][decrement][callProgressDetectingAgent]',_0x47c140[_0x17bf('0xaf')],_0x17bf('0xbf'),_0x4c3cd8['name'],_0x17bf('0x6f'),_0x4c3cd8['originated']);delete this[_0x17bf('0x16')][_0x47c140[_0x17bf('0xaf')]];};Preview['prototype'][_0x17bf('0xfe')]=function(_0x4af96c,_0x2b037f,_0x3b5b0d,_0x2b3212,_0x36f0c5){var _0x5dcbf5=this;return new BPromise(function(_0x413cd8,_0x33f3ff){if(_[_0x17bf('0x6e')](_0x2b037f)||_[_0x17bf('0x6e')](_0x2b037f['Contact'])||_[_0x17bf('0x6e')](_0x2b037f[_0x17bf('0xff')][_0x17bf('0x100')])||_['isNil'](_0x2b037f['VoiceQueueId'])){_0x33f3ff(ut[_0x17bf('0x4e')](_0x17bf('0x101'),_0x2b3212,_0x36f0c5));return;}var _0x10ae09=uuid['v4']();var _0x360bcd=_0x5dcbf5['campaignsPreview'][_0x2b037f[_0x17bf('0x102')][_0x17bf('0x2a')]];var _0x42d376=_0x3b5b0d?_0x5dcbf5[_0x17bf('0x17')][_0x3b5b0d]['id']:undefined;_0x5dcbf5[_0x17bf('0x16')][_0x10ae09]=new Action(_0x2b037f,_0x360bcd,_0x10ae09,_0x3b5b0d,_0x42d376);var _0x59cc88=_0x5dcbf5[_0x17bf('0x16')][_0x10ae09];_0x59cc88[_0x17bf('0xc9')]=_0x2b3212;_0x59cc88[_0x17bf('0xac')]=_0x36f0c5;_0x59cc88[_0x17bf('0x103')]=_0x3b5b0d;if(_[_0x17bf('0x104')](_0x4af96c)){_0x5dcbf5[_0x17bf('0x105')](_0x59cc88,_0x360bcd,_0x2b037f,_0x3b5b0d)[_0x17bf('0x84')](function(_0x2c6ff3){logger[_0x17bf('0x5a')](_0x17bf('0x106'),_0x17bf('0x107')+_0x59cc88[_0x17bf('0x70')]+_0x17bf('0x108')+_0x59cc88[_0x17bf('0x109')],JSON[_0x17bf('0x57')](_0x2c6ff3));ami[_0x17bf('0xa2')](_0x17bf('0x10a'),ut[_0x17bf('0xb4')](_0x59cc88,_0x17bf('0x10b'),_0x5dcbf5['campaignsPreview'][_0x59cc88['queue']]));_0x413cd8(ut[_0x17bf('0x4e')](_0x17bf('0x10c')));})['catch'](function(_0x45d2b5){ut[_0x17bf('0x62')](_0x17bf('0x10d'),_0x45d2b5);_0x33f3ff(ut['message'](_0x17bf('0x10e'),_0x2b3212,_0x36f0c5));});}else{_0x360bcd['outboundBlacklistCallsDay']+=0x1;ut[_0x17bf('0x10f')](_0x59cc88);rpcDb['createHistory'](_0x59cc88,_0x17bf('0x110'));delete _0x5dcbf5[_0x17bf('0x16')][_0x10ae09];_0x33f3ff(ut[_0x17bf('0x4e')](_0x17bf('0x111'),_0x2b3212,_0x36f0c5));}});};Preview[_0x17bf('0x67')][_0x17bf('0x9a')]=function(_0x27b87f){return!_[_0x17bf('0x6e')](_0x27b87f)&&!_[_0x17bf('0x6e')](_0x27b87f[_0x17bf('0x2a')])&&!_['isNil'](_0x27b87f[_0x17bf('0x54')])&&_0x27b87f[_0x17bf('0x54')]&&!_['isNil'](this[_0x17bf('0x15')][util['format'](_0x17bf('0x112'),_0x27b87f[_0x17bf('0x2a')])])&&!_[_0x17bf('0x6e')](this['trunks'][util['format']('SIP/%s',_0x27b87f[_0x17bf('0x2a')])][_0x17bf('0x76')])&&(this['trunks'][util[_0x17bf('0x5c')](_0x17bf('0x112'),_0x27b87f['name'])]['status']===_0x17bf('0x113')||this[_0x17bf('0x15')][util[_0x17bf('0x5c')](_0x17bf('0x112'),_0x27b87f[_0x17bf('0x2a')])][_0x17bf('0x76')]===_0x17bf('0x114'));};Preview[_0x17bf('0x67')][_0x17bf('0x115')]=function(_0x290c0b,_0x18bf8c){var _0x23a5ad=this;return new BPromise(function(_0x39333b,_0x3b7bd9){_0x23a5ad[_0x17bf('0x116')](_0x290c0b,_0x18bf8c)['then'](function(_0x401583){_0x39333b(_[_0x17bf('0x117')](_0x401583,[_0x17bf('0x4e')]));})[_0x17bf('0x78')](function(_0x59922a){if(_0x59922a['unlock']){rpcDb['unlockContact'](_0x290c0b);}if(_0x59922a['active']){rpcDb[_0x17bf('0x8b')](_0x290c0b);}_0x3b7bd9(_[_0x17bf('0x117')](_0x59922a,[_0x17bf('0x4e')]));});});};Preview[_0x17bf('0x67')][_0x17bf('0x116')]=function(_0x4f2357,_0x11163a){var _0x51f41a=this;return new BPromise(function(_0x58185c,_0x5e034f){var _0x3ddcc9,_0x584aee;rpcDb[_0x17bf('0x118')](_0x4f2357)[_0x17bf('0x84')](function(_0x224799){if(!_[_0x17bf('0x6e')](_0x224799[0x0])){_0x584aee=_0x224799[0x0]['recallme']?![]:!![];_0x3ddcc9=_0x224799[0x0][_0x17bf('0x119')]?!![]:![];_0x3ddcc9=_0x11163a?!![]:_0x3ddcc9;}var _0x4ea413=_0x51f41a[_0x17bf('0x11a')](_0x224799);if(_0x4ea413[_0x17bf('0x11b')]){rpcDb[_0x17bf('0x11c')](_[_0x17bf('0x117')](_0x224799[0x0],[_0x17bf('0x74'),'Contact.phone']))[_0x17bf('0x84')](function(_0x1a9a36){_0x51f41a['checkInBlack'](_0x1a9a36,_0x224799[0x0],_0x11163a,_0x584aee,_0x3ddcc9)[_0x17bf('0x84')](function(_0xa5ac2b){_0x58185c(_0xa5ac2b);})[_0x17bf('0x78')](function(_0x38aa52){_0x5e034f(_0x38aa52);});})['catch'](function(_0x180afe){ut['logger']('[Preview][checkIsBlackList]',_0x180afe);_0x5e034f(ut[_0x17bf('0x4e')]('Call\x20unsuccessful',_0x584aee,_0x3ddcc9));});}else{_0x5e034f(ut[_0x17bf('0x4e')](_0x4ea413['message'],_0x584aee,_0x3ddcc9));}})[_0x17bf('0x78')](function(_0x10db06){ut['logger'](_0x17bf('0x11d'),_0x10db06);_0x5e034f(ut['message'](_0x17bf('0x11e'),![],!![]));});});};Preview['prototype'][_0x17bf('0x11a')]=function(_0x12ab20){if(_[_0x17bf('0x6e')](_0x12ab20)||_[_0x17bf('0x104')](_0x12ab20)||!_[_0x17bf('0x6e')](_0x12ab20[0x0][_0x17bf('0x88')])&&_[_0x17bf('0x6e')](_0x12ab20[0x0][_0x17bf('0x88')][_0x17bf('0x2a')])){ut[_0x17bf('0x62')](_0x17bf('0x11f'),_0x12ab20);return{'isValid':![],'message':_0x17bf('0x120')};}var _0x357a8f=this[_0x17bf('0x13')][_0x12ab20[0x0]['Queue'][_0x17bf('0x2a')]];_0x357a8f[_0x17bf('0x4e')]='ACTIVE';if(_[_0x17bf('0x6e')](_0x357a8f)){ut[_0x17bf('0x62')](_0x17bf('0x121'),_0x357a8f);return{'isValid':![],'message':_0x17bf('0x122')};}if(!this[_0x17bf('0x9a')](_0x357a8f[_0x17bf('0x53')])){ut[_0x17bf('0x62')](_0x17bf('0x123'),'campaign\x20Name:\x20'+_0x357a8f[_0x17bf('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x17bf('0x9a')](_0x357a8f['TrunkBackup'])){ut[_0x17bf('0x62')](_0x17bf('0x123'),_0x357a8f[_0x17bf('0x2a')]+_0x17bf('0x124'));return{'isValid':![],'message':_0x17bf('0x125')};}}if(!ut[_0x17bf('0x126')](_0x357a8f[_0x17bf('0x34')])){ut[_0x17bf('0x62')](_0x17bf('0x127'),_0x357a8f['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x17bf('0x128')+_0x357a8f['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x17bf('0x129')};};Preview[_0x17bf('0x67')]['execCall']=function(_0x5edcfb,_0x5932cb,_0x26976c,_0xc75f5a){var _0x571111=this;return new BPromise(function(_0xc00b39,_0xc0605a){var _0x1e5d0d=_0x5edcfb[_0x17bf('0xaf')];var _0x1bd304=_0x571111[_0x17bf('0x9a')](_0x5932cb[_0x17bf('0x53')])?util[_0x17bf('0x5c')](_0x17bf('0x12a'),_0x5932cb['Trunk']['name'],_[_0x17bf('0x6e')](_0x5932cb[_0x17bf('0x38')])?'':_0x5932cb['dialPrefix'][_0x17bf('0x12b')]()||'',_0x5932cb[_0x17bf('0x12c')]>0x0?_0x26976c['Contact'][_0x17bf('0x100')][_0x17bf('0x12d')](_0x5932cb[_0x17bf('0x12c')]):_0x26976c[_0x17bf('0xff')]['phone']):util[_0x17bf('0x5c')](_0x17bf('0x12a'),_[_0x17bf('0x6e')](_0x5932cb[_0x17bf('0x12e')])?_0x5932cb[_0x17bf('0x53')][_0x17bf('0x2a')]:_0x5932cb[_0x17bf('0x12e')][_0x17bf('0x2a')],_[_0x17bf('0x6e')](_0x5932cb['dialPrefix'])?'':_0x5932cb[_0x17bf('0x38')]['trim']()||'',_0x5932cb[_0x17bf('0x12c')]>0x0?_0x26976c[_0x17bf('0xff')][_0x17bf('0x100')][_0x17bf('0x12d')](_0x5932cb[_0x17bf('0x12c')]):_0x26976c[_0x17bf('0xff')][_0x17bf('0x100')]);var _0x5f497d=_0x571111['isTrunkReachable'](_0x5932cb[_0x17bf('0x53')])?ut['getCallerId'](_0x5932cb[_0x17bf('0x53')]['callerid'],_0x5932cb[_0x17bf('0x36')],_0x5932cb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x17bf('0x12f')](_0x5932cb[_0x17bf('0x37')],_0x5932cb[_0x17bf('0x130')]):_0x5932cb['dialOriginateCallerIdNumber']):ut[_0x17bf('0x131')](_['isNil'](_0x5932cb[_0x17bf('0x12e')])?_0x5932cb[_0x17bf('0x53')][_0x17bf('0x55')]:_0x5932cb[_0x17bf('0x12e')][_0x17bf('0x55')],_0x5932cb[_0x17bf('0x36')],_0x5932cb[_0x17bf('0x130')]>0x0?ut[_0x17bf('0x12f')](_0x5932cb['dialOriginateCallerIdNumber'],_0x5932cb['dialRandomLastDigitCallerIdNumber']):_0x5932cb[_0x17bf('0x37')]);if(_0x5f497d){_0x5edcfb[_0x17bf('0x132')]=ut[_0x17bf('0x133')](_0x5f497d);_0x5edcfb[_0x17bf('0x134')]=ut[_0x17bf('0x135')](_0x5f497d);}var _0x5f4653=ut[_0x17bf('0x136')](_0x5932cb,_0x26976c,_0x1bd304,_0x5f497d,_0x1e5d0d,_0x5edcfb);_[_0x17bf('0x137')](_0x5edcfb,ut[_0x17bf('0x138')](_0x5f4653));_0x5edcfb[_0x17bf('0x139')]=moment()[_0x17bf('0x5c')](_0x17bf('0xad'));ami['Action'](ut[_0x17bf('0x13a')](_0x5edcfb,_0x5932cb,_0x5f4653,_0x5edcfb['activeContact'],_0xc75f5a))[_0x17bf('0x84')](function(_0x2a519e){var _0x36cad5=_0x5edcfb['channelAgent'];if(!_[_0x17bf('0x6e')](_0x36cad5)){if(!_[_0x17bf('0x6e')](_0x571111[_0x17bf('0x17')][_0x36cad5])){_0x571111[_0x17bf('0x17')][_0x36cad5][_0x17bf('0x13b')]=_0x5edcfb[_0x17bf('0x13c')];emit(util['format'](_0x17bf('0x13d'),_0x571111[_0x17bf('0x17')][_0x36cad5][_0x17bf('0x2a')]),_0x17bf('0x13e'),{'destaccountcode':_0x571111[_0x17bf('0x17')][_0x36cad5][_0x17bf('0x13f')],'destconnectedlinenum':_0x5edcfb[_0x17bf('0x13c')]});}}_0x5932cb[_0x17bf('0x4f')]+=0x1;logger[_0x17bf('0x5a')](_0x17bf('0x140'),_0x1e5d0d,'\x20Queue',_0x5932cb[_0x17bf('0x2a')],_0x17bf('0x6f'),_0x5932cb['originated']);_0xc00b39(_0x2a519e);})[_0x17bf('0x78')](function(_0x2aa507){ut[_0x17bf('0xf8')](_0x5edcfb,0xe,_0x17bf('0x141'));rpcDb['createAgentHistory'](_0x5edcfb,_0x17bf('0x142'));_0xc0605a(_0x2aa507);});});};Preview[_0x17bf('0x67')]['syncNewExten']=function(_0x189136){if(this[_0x17bf('0x16')][_0x189136[_0x17bf('0xc1')]]){this[_0x17bf('0x16')][_0x189136['linkedid']][_0x17bf('0x77')]=_0x189136['channel'];}};Preview[_0x17bf('0x67')][_0x17bf('0x19')]=function(_0x42893c){var _0x4916a0=this;var _0xe610d7=this[_0x17bf('0x16')][_0x42893c[_0x17bf('0x143')]];if(_0xe610d7){if(_0xe610d7[_0x17bf('0x103')]&&this['agents'][_0xe610d7[_0x17bf('0x103')]]){ut[_0x17bf('0x144')](_0xe610d7,this[_0x17bf('0x17')][_0xe610d7[_0x17bf('0x103')]][_0x17bf('0x2a')],this[_0x17bf('0x17')][_0xe610d7[_0x17bf('0x103')]]['id']);}var _0x3e6f94=_['clone'](_0xe610d7);_0x3e6f94[_0x17bf('0xae')]=moment()[_0x17bf('0x5c')](_0x17bf('0xad'));var _0xb62feb=_0x4916a0['campaignsPreview'][_0xe610d7[_0x17bf('0x70')]];if(ut[_0x17bf('0x145')](_0x42893c[_0x17bf('0x146')])){if(_0xe610d7[_0x17bf('0xc9')]){rpcDb[_0x17bf('0x147')](_0xe610d7[_0x17bf('0x109')]);}if(_0xe610d7[_0x17bf('0xac')]){rpcDb['disableContact'](_0xe610d7[_0x17bf('0x109')]);}ami[_0x17bf('0xa2')](_0x17bf('0x148'),ut['buildObj'](_0xe610d7,'rejected',this['campaignsPreview'][_0xe610d7[_0x17bf('0x70')]]));this[_0x17bf('0xf2')](_0x3e6f94,_0xb62feb,_0x42893c);}else{_0xe610d7[_0x17bf('0x139')]=moment()['format'](_0x17bf('0xad'));ut[_0x17bf('0xf8')](_0x3e6f94,0x4,'Answer');rpcDb[_0x17bf('0xf6')](_0x3e6f94,_0x17bf('0x149'));}}};Preview[_0x17bf('0x67')][_0x17bf('0x1c')]=function(_0x2c9612){var _0xbb1227=this;var _0x33376c=this[_0x17bf('0x16')][_0x2c9612[_0x17bf('0xc1')]];var _0x467407;if(_0x33376c){_0x467407=this['campaignsPreview'][_0x33376c[_0x17bf('0x70')]];logger['info'](_0x17bf('0x14a'),_0x2c9612[_0x17bf('0xc1')],_0x17bf('0xbf'),_0x467407['name'],'pTalking:\x20',_0x467407['pTalking']);}if(this['actions'][_0x2c9612['linkedid']]&&_0x2c9612[_0x17bf('0xc1')]!==_0x2c9612[_0x17bf('0xaf')]){if(_0x2c9612['cause']==='16'&&this[_0x17bf('0x16')][_0x2c9612['linkedid']][_0x17bf('0x71')]){this['callProgressDetectingCustomer'](_0x2c9612,_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')]);}else if(this[_0x17bf('0x16')][_0x2c9612['linkedid']][_0x17bf('0x71')]){logger[_0x17bf('0x5a')](_0x17bf('0x14c'),_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')],_0x17bf('0xbf'),_0x467407[_0x17bf('0x2a')],_0x17bf('0xc0'),_0x467407[_0x17bf('0x2c')]);this[_0x17bf('0x9d')](_0x2c9612,_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')]);}}else if(_0x33376c&&_[_0x17bf('0x6e')](_0x33376c[_0x17bf('0x14d')])&&_0x467407[_0x17bf('0x14e')]&&_0x2c9612['linkedid']===_0x2c9612['uniqueid']&&_[_0x17bf('0x6e')](_0x2c9612['reason'])&&_0x2c9612[_0x17bf('0x14b')]==='16'&&_0x2c9612[_0x17bf('0x14f')]==='6'&&_[_0x17bf('0xf3')](_0x33376c[_0x17bf('0x150')])){if(_0x33376c[_0x17bf('0xc9')]){rpcDb['unlockContact'](_0x33376c[_0x17bf('0x109')]);}if(_0x33376c[_0x17bf('0xac')]){rpcDb[_0x17bf('0x8b')](_0x33376c[_0x17bf('0x109')]);}_0x2c9612[_0x17bf('0xf5')]='22';this[_0x17bf('0xf2')](_0x33376c,_0x467407,_0x2c9612);}else if(_0x33376c&&_0x33376c[_0x17bf('0x150')]){if(_0x2c9612[_0x17bf('0x14b')]==='16'&&this[_0x17bf('0x16')][_0x2c9612['linkedid']][_0x17bf('0x71')]){logger[_0x17bf('0x5a')](_0x17bf('0x151'),_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')],_0x17bf('0xbf'),_0x467407['name'],_0x17bf('0xc0'),_0x467407[_0x17bf('0x2c')]);this[_0x17bf('0x9d')](_0x2c9612,_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')]);}else if(this[_0x17bf('0x16')][_0x2c9612[_0x17bf('0xc1')]]['dialAnswer']){logger['info'](_0x17bf('0x14c'),_0x2c9612[_0x17bf('0xc1')],_0x2c9612['cause'],_0x17bf('0xbf'),_0x467407['name'],_0x17bf('0xc0'),_0x467407[_0x17bf('0x2c')]);this[_0x17bf('0x9d')](_0x2c9612,_0x2c9612[_0x17bf('0xc1')],_0x2c9612[_0x17bf('0x14b')]);}}};Preview[_0x17bf('0x67')][_0x17bf('0x152')]=function(_0x2edfd3){if(this[_0x17bf('0x16')][_0x2edfd3[_0x17bf('0xf1')]]&&_0x2edfd3[_0x17bf('0xf1')]!==_0x2edfd3[_0x17bf('0x153')]){this[_0x17bf('0x9d')](_0x2edfd3,_0x2edfd3[_0x17bf('0xf1')],_0x2edfd3[_0x17bf('0xe7')]);}};Preview[_0x17bf('0x67')][_0x17bf('0x1d')]=function(_0x49e708){if(this['actions'][_0x49e708[_0x17bf('0xc1')]]&&_0x49e708[_0x17bf('0xc1')]!==_0x49e708[_0x17bf('0xaf')]&&!this['actions'][_0x49e708[_0x17bf('0xc1')]][_0x17bf('0x71')]){if(_0x49e708[_0x17bf('0x14b')]==='1'){this[_0x17bf('0x9d')](_0x49e708,_0x49e708[_0x17bf('0xc1')],_0x49e708[_0x17bf('0x14b')]);}}};Preview[_0x17bf('0x67')][_0x17bf('0x154')]=function(_0x20f701,_0x3535e0,_0x5282c0){if(this[_0x17bf('0x16')][_0x20f701]){if(_[_0x17bf('0x6e')](this[_0x17bf('0x16')][_0x20f701][_0x17bf('0x155')])){this['actions'][_0x20f701][_0x17bf('0x155')]={};}this[_0x17bf('0x16')][_0x20f701][_0x17bf('0x155')][_0x3535e0]=_0x5282c0;}};Preview[_0x17bf('0x67')][_0x17bf('0x22')]=function(_0x282974){try{if(!_[_0x17bf('0x6e')](_0x282974)){if(ut[_0x17bf('0x156')](_[_0x17bf('0x157')](_0x282974[_0x17bf('0x158')])[0x0])){this['addVariable'](_0x282974[_0x17bf('0xaf')],_[_0x17bf('0x157')](_0x282974[_0x17bf('0x158')])[0x0],_0x282974['value']);}}}catch(_0x33bbe6){logger[_0x17bf('0x159')](_0x17bf('0x15a'),util[_0x17bf('0x15b')](_0x33bbe6,{'showHidden':![],'depth':null}));}};Preview[_0x17bf('0x67')]['syncAttendedTransfer']=function(_0x5e91ff){if(_0x5e91ff){if(this[_0x17bf('0x16')][_0x5e91ff[_0x17bf('0x15c')]]){this[_0x17bf('0x16')][_0x5e91ff['transfertargetlinkedid']][_0x17bf('0x150')]=!![];}}};Preview[_0x17bf('0x67')][_0x17bf('0x26')]=function(_0x33abb2){if(_0x33abb2){if(this[_0x17bf('0x16')][_0x33abb2[_0x17bf('0x15d')]]){this[_0x17bf('0x16')][_0x33abb2[_0x17bf('0x15d')]][_0x17bf('0x150')]=!![];}}};module[_0x17bf('0x15e')]=Preview; \ No newline at end of file +var _0x0f26=['accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[action]','getContactRecallMe','agentReadyId','length','getDiff','dialRecallMeTimeout','Agent','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','totalGlobal','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','activeContact','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','execRun','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','phone','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect'];(function(_0x1c852c,_0x113e2d){var _0x5037f4=function(_0x1b93d1){while(--_0x1b93d1){_0x1c852c['push'](_0x1c852c['shift']());}};_0x5037f4(++_0x113e2d);}(_0x0f26,0x189));var _0x60f2=function(_0x268cd1,_0x46fe2d){_0x268cd1=_0x268cd1-0x0;var _0x7066cd=_0x0f26[_0x268cd1];return _0x7066cd;};'use strict';var util=require(_0x60f2('0x0'));var _=require(_0x60f2('0x1'));var BPromise=require(_0x60f2('0x2'));var uuid=require(_0x60f2('0x3'));var moment=require(_0x60f2('0x4'));var md5=require(_0x60f2('0x5'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x60f2('0x6'));var loggerAction=require(_0x60f2('0x7'))(_0x60f2('0x8'));var ami=require(_0x60f2('0x9'));var rpcDb=require(_0x60f2('0xa'));var Action=require(_0x60f2('0xb'));var ut=require(_0x60f2('0xc'));config[_0x60f2('0xd')]=_[_0x60f2('0xe')](config[_0x60f2('0xd')],{'host':_0x60f2('0xf'),'port':0x18eb});var io=require(_0x60f2('0x10'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x51789a){this[_0x60f2('0x11')]=this['tail']?this[_0x60f2('0x11')][_0x60f2('0x12')](_0x51789a):_0x51789a();};function Preview(_0x4c47b1){this['sequence']=new Sequence();this[_0x60f2('0x13')]=_0x4c47b1[_0x60f2('0x14')];this['trunks']=_0x4c47b1[_0x60f2('0x15')];this[_0x60f2('0x16')]={};this[_0x60f2('0x17')]=_0x4c47b1['agents'];this[_0x60f2('0x18')]=0x0;ami['on'](_0x60f2('0x19'),this[_0x60f2('0x1a')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x1c'),this[_0x60f2('0x1d')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x1e'),this[_0x60f2('0x1f')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x20'),this[_0x60f2('0x21')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x22'),this['syncNewExten'][_0x60f2('0x1b')](this));ami['on']('varset',this[_0x60f2('0x23')]['bind'](this));ami['on']('attendedtransfer',this[_0x60f2('0x24')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x25'),this['syncBlindTransfer'][_0x60f2('0x1b')](this));this[_0x60f2('0x26')](this[_0x60f2('0x13')]);}function emit(_0x2f2322,_0xcea69f,_0x8fe337){io['to'](_0x2f2322)[_0x60f2('0x27')](_0xcea69f,_0x8fe337);}function emitCampaignPreview(_0x32327a){if(_0x32327a[_0x60f2('0x28')]==='outbound'){var _0x248abb={'id':_0x32327a['id'],'name':_0x32327a['name'],'strategy':_0x32327a[_0x60f2('0x29')],'answered':_0x32327a[_0x60f2('0x2a')],'available':_0x32327a[_0x60f2('0x2b')],'loggedIn':_0x32327a[_0x60f2('0x2c')],'pTalking':_0x32327a['pTalking'],'sumBillable':_0x32327a[_0x60f2('0x2d')],'sumDuration':_0x32327a[_0x60f2('0x2e')],'sumHoldTime':_0x32327a[_0x60f2('0x2f')]||0x0,'talking':_0x32327a[_0x60f2('0x30')],'total':_0x32327a[_0x60f2('0x31')],'type':_0x32327a[_0x60f2('0x28')],'unmanaged':_0x32327a[_0x60f2('0x32')],'abandoned':_0x32327a[_0x60f2('0x33')],'waiting':_0x32327a[_0x60f2('0x34')],'loggedInDb':_0x32327a[_0x60f2('0x35')],'dialActive':_0x32327a[_0x60f2('0x36')],'dialMethod':_0x32327a[_0x60f2('0x37')],'dialOriginateCallerIdName':_0x32327a[_0x60f2('0x38')],'dialOriginateCallerIdNumber':_0x32327a[_0x60f2('0x39')],'dialOriginateTimeout':_0x32327a['dialOriginateTimeout'],'dialPrefix':_0x32327a[_0x60f2('0x3a')],'outboundAnswerAgiCallsDay':_0x32327a[_0x60f2('0x3b')],'outboundAnswerCallsDay':_0x32327a['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x32327a[_0x60f2('0x3c')],'outboundBusyCallsDay':_0x32327a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x32327a[_0x60f2('0x3d')],'outboundDropCallsDayACS':_0x32327a[_0x60f2('0x3e')],'outboundDropCallsDayCallersExit':_0x32327a[_0x60f2('0x3f')],'outboundDropCallsDayTimeout':_0x32327a[_0x60f2('0x40')],'outboundNoAnswerCallsDay':_0x32327a[_0x60f2('0x41')],'outboundNoSuchCallsDay':_0x32327a[_0x60f2('0x42')],'outboundOriginateFailureCallsDay':_0x32327a[_0x60f2('0x43')],'outboundReCallsDay':_0x32327a[_0x60f2('0x44')],'outboundRejectCallsDay':_0x32327a[_0x60f2('0x45')],'outboundUnknownCallsDay':_0x32327a[_0x60f2('0x46')],'outboundAbandonedCallsDay':_0x32327a[_0x60f2('0x47')],'predictiveIntervalAnsweredCalls':_0x32327a[_0x60f2('0x48')],'predictiveIntervalAvgHoldtime':_0x32327a[_0x60f2('0x49')],'predictiveIntervalAvgTalktime':_0x32327a[_0x60f2('0x4a')],'predictiveIntervalDroppedCallsCallersExit':_0x32327a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x32327a[_0x60f2('0x4b')],'predictiveIntervalErlangCalls':_0x32327a[_0x60f2('0x4c')],'predictiveIntervalErlangCallsDroppedCalls':_0x32327a[_0x60f2('0x4d')],'predictiveIntervalHitRate':_0x32327a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x32327a[_0x60f2('0x4e')],'predictiveIntervalPauses':_0x32327a[_0x60f2('0x4f')],'predictiveIntervalAvailable':_0x32327a[_0x60f2('0x50')],'predictiveIntervalTotalCalls':_0x32327a[_0x60f2('0x51')],'message':_0x32327a[_0x60f2('0x52')],'originated':_0x32327a[_0x60f2('0x53')],'erlangCalls':_0x32327a[_0x60f2('0x54')],'erlangCallToSecond':_0x32327a['erlangCallToSecond'],'erlangAbandonmentRate':_0x32327a['erlangAbandonmentRate'],'erlangBusyFactor':_0x32327a[_0x60f2('0x55')],'startPredictive':_0x32327a[_0x60f2('0x56')],'startProgressive':_0x32327a[_0x60f2('0x57')]};if(_0x32327a[_0x60f2('0x58')]){_0x248abb['Trunk']={'id':_0x32327a[_0x60f2('0x58')]['id'],'name':_0x32327a['Trunk'][_0x60f2('0x59')],'active':_0x32327a[_0x60f2('0x58')][_0x60f2('0x5a')],'callerid':_0x32327a[_0x60f2('0x58')][_0x60f2('0x5b')]};}if(_0x32327a[_0x60f2('0x5c')]){_0x248abb['Interval']={'id':_0x32327a['Interval']['id'],'name':_0x32327a[_0x60f2('0x5c')][_0x60f2('0x59')]};}var _0x19d5dd=md5(JSON[_0x60f2('0x5d')](_0x248abb));if(_0x32327a[_0x60f2('0x5')]!==_0x19d5dd){_0x32327a[_0x60f2('0x5')]=_0x19d5dd;emit(util[_0x60f2('0x5e')](_0x60f2('0x5f'),_0x248abb[_0x60f2('0x59')]),_0x60f2('0x60'),_0x248abb);}}}function emitVoiceQueueChannelRemove(_0x8e2d68){logger[_0x60f2('0x61')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x60f2('0x5d')](_0x8e2d68));emit(util[_0x60f2('0x5e')](_0x60f2('0x5f'),_0x8e2d68[_0x60f2('0x59')]),_0x60f2('0x62'),_0x8e2d68);io['emit'](_0x60f2('0x63'),_0x8e2d68);}function notSendMessagesQueue(_0x4beee3){if(_0x4beee3['sendMessageOneNotActive']){if(_0x4beee3[_0x60f2('0x53')]===0x0&&_0x4beee3['pTalking']===0x0){_0x4beee3[_0x60f2('0x64')]=![];_0x4beee3[_0x60f2('0x2b')]=0x0;_0x4beee3[_0x60f2('0x65')]=0x0;_0x4beee3[_0x60f2('0x52')]=_0x60f2('0x66');ut[_0x60f2('0x67')](_0x60f2('0x68'),_0x4beee3[_0x60f2('0x59')]+_0x60f2('0x69'));}else{_0x4beee3[_0x60f2('0x52')]=_0x60f2('0x6a');ut['logger'](_0x60f2('0x68'),_0x4beee3[_0x60f2('0x59')]+_0x60f2('0x6b'));}emitCampaignPreview(_0x4beee3);}}Preview[_0x60f2('0x6c')][_0x60f2('0x26')]=function(){var _0x16e9f4=this;setInterval(function(){_0x16e9f4[_0x60f2('0x6d')]();},0x7cf);};Preview[_0x60f2('0x6c')][_0x60f2('0x6d')]=function(){var _0x274c79=this[_0x60f2('0x13')];this[_0x60f2('0x18')]+=0x1;for(var _0xbe30ee in _0x274c79){if(_0x274c79[_0x60f2('0x6e')](_0xbe30ee)&&(_0x274c79[_0xbe30ee]['dialMethod']===_0x60f2('0x6')||_0x274c79[_0xbe30ee][_0x60f2('0x37')]===_0x60f2('0x6f'))&&_0x274c79[_0xbe30ee][_0x60f2('0x28')]===_0x60f2('0x70')){if(this[_0x60f2('0x18')]>0x7){this[_0x60f2('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x274c79['hasOwnProperty'](_0xbe30ee)&&_0x274c79[_0xbe30ee][_0x60f2('0x37')]==='preview'&&_0x274c79[_0xbe30ee][_0x60f2('0x28')]===_0x60f2('0x70')){if(_0x274c79[_0xbe30ee]['dialActive']){this[_0x60f2('0x71')](_0x274c79[_0xbe30ee]);this[_0x60f2('0x72')](_0x274c79[_0xbe30ee]);}else{notSendMessagesQueue(_0x274c79[_0xbe30ee]);}}}};Preview[_0x60f2('0x6c')][_0x60f2('0x73')]=function(_0x1f435b){var _0x16ff58=this;this[_0x60f2('0x74')][_0x60f2('0x75')](function(){if(!_[_0x60f2('0x76')](_0x16ff58[_0x60f2('0x16')][_0x1f435b])){loggerAction[_0x60f2('0x61')](_0x60f2('0x77'),_0x1f435b,'Queue',_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')],_0x60f2('0x79'),JSON[_0x60f2('0x5d')](_0x16ff58[_0x60f2('0x13')][_0x16ff58[_0x60f2('0x16')][_0x1f435b]['queue']][_0x60f2('0x53')]),_0x60f2('0x7a'),JSON['stringify'](_0x16ff58[_0x60f2('0x13')][_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')]][_0x60f2('0x7b')]),JSON[_0x60f2('0x5d')](_0x16ff58['actions'][_0x1f435b]['dialAnswer']),JSON[_0x60f2('0x5d')](_[_0x60f2('0x7c')](_0x16ff58[_0x60f2('0x16')][_0x1f435b],[_0x60f2('0x7d'),_0x60f2('0x7e'),_0x60f2('0x7f'),_0x60f2('0x80')])));return ami[_0x60f2('0x81')]({'action':'status','channel':_0x16ff58[_0x60f2('0x16')][_0x1f435b]['channel']})[_0x60f2('0x82')](function(_0x2e85b9){if(_0x2e85b9['message']===_0x60f2('0x83')){setTimeout(function(){if(_0x16ff58['actions'][_0x1f435b]){ut[_0x60f2('0x84')](_0x16ff58[_0x60f2('0x13')][_0x16ff58['actions'][_0x1f435b][_0x60f2('0x78')]],_0x60f2('0x85'));if(_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x86')]===!![]){ut['decrementTalkink'](_0x16ff58[_0x60f2('0x13')][_0x16ff58['actions'][_0x1f435b][_0x60f2('0x78')]],_0x60f2('0x85'));ut[_0x60f2('0x87')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1f435b,_0x16ff58[_0x60f2('0x16')][_0x1f435b]['queue']);}ut[_0x60f2('0x87')]('[Dialer][checkChannel][Preview]'+_0x1f435b,_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')]);delete _0x16ff58[_0x60f2('0x16')][_0x1f435b];}},0x2328);}});}});};Preview[_0x60f2('0x6c')]['clearZombieChannels']=function(){var _0x497b37=this;loggerAction[_0x60f2('0x61')](_0x60f2('0x88'),_['size'](this['actions']));for(var _0x3c6580 in this['actions']){if(_0x497b37[_0x60f2('0x16')][_0x60f2('0x6e')](_0x3c6580)){_0x497b37[_0x60f2('0x73')](_0x3c6580);}}};Preview[_0x60f2('0x6c')][_0x60f2('0x72')]=function(_0x4df0e5){var _0x2009e7=this;rpcDb[_0x60f2('0x89')](_0x4df0e5['id'],ut[_0x60f2('0x8a')](this[_0x60f2('0x17')]))['then'](function(_0x132842){if(!_['isNil'](_0x132842)){for(var _0xcc9168=0x0;_0xcc9168<_0x132842[_0x60f2('0x8b')];_0xcc9168+=0x1){if(ut[_0x60f2('0x8c')](_0x132842[_0xcc9168]['scheduledat'])<_0x4df0e5[_0x60f2('0x8d')]*0x3c){if(_0x132842[_0xcc9168]['Agent']&&!_0x132842[_0xcc9168][_0x60f2('0x8e')]['voicePause']){_0x2009e7['run'](_0x132842[_0xcc9168]['id'])['then'](ut['logger2'](_0x60f2('0x8f')))[_0x60f2('0x82')](ut[_0x60f2('0x90')](_0x60f2('0x8f')));}else{rpcDb[_0x60f2('0x91')](_0x132842[_0xcc9168]['id']);}}else{var _0x29b86c=new Action(_0x132842[_0xcc9168],_0x4df0e5);_0x29b86c[_0x60f2('0x92')]=moment()[_0x60f2('0x5e')](_0x60f2('0x93'));_0x4df0e5[_0x60f2('0x44')]+=0x1;ut[_0x60f2('0x94')](_0x29b86c,0x17,_0x60f2('0x95'));if(_0x4df0e5['dialRecallInQueue']){rpcDb[_0x60f2('0x96')](ut[_0x60f2('0x97')](_0x132842[_0xcc9168]));rpcDb[_0x60f2('0x98')](_0x29b86c,_0x60f2('0x99'));}else{ut[_0x60f2('0x94')](_0x29b86c,0x16,_0x60f2('0x9a'));rpcDb[_0x60f2('0x98')](_0x29b86c,_0x60f2('0x9b'));rpcDb[_0x60f2('0x9c')](_0x29b86c,_0x60f2('0x9b'));}}}}})[_0x60f2('0x82')](ut[_0x60f2('0x90')]('[getContactRecallMe]'));};Preview[_0x60f2('0x6c')][_0x60f2('0x71')]=function(_0x57c8e5){_0x57c8e5['sendMessageOneNotActive']=!![];if(ut[_0x60f2('0x9d')](_0x57c8e5[_0x60f2('0x2c')])){_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0x9e');}else if(!ut[_0x60f2('0x9f')](_0x57c8e5[_0x60f2('0x36')])){_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0x66');}else if(!this['isTrunkReachable'](_0x57c8e5[_0x60f2('0x58')])){if(!this[_0x60f2('0xa0')](_0x57c8e5[_0x60f2('0xa1')])){_0x57c8e5[_0x60f2('0x52')]='TRUNK_IS_NOT_REACHABLE';}else{_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0xa2');}}else{_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0xa2');}emitCampaignPreview(_0x57c8e5);};Preview[_0x60f2('0x6c')]['callProgressDetectingCustomer']=function(_0xb87285,_0xd44361,_0x59a2f6){var _0x37d1b4=this;var _0x58108c=this[_0x60f2('0x16')][_0xd44361];var _0x57eb76=this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]];var _0x5f57d1;if(_0x57eb76){switch(_0x59a2f6){case'1':_0x57eb76['outboundNoSuchCallsDay']+=0x1;_0x58108c['countnosuchnumberretry']+=0x1;_0x58108c[_0x60f2('0xa3')]=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x0,_0x60f2('0xa4'));ami['emit'](_0x60f2('0xa5'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xa7')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xa8'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xac'));}else{if(_0x58108c[_0x60f2('0xad')]>=_0x57eb76[_0x60f2('0xae')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xac'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x58108c,_0x60f2('0xad'),_0x57eb76[_0x60f2('0xaf')]),_0x58108c[_0x60f2('0xb0')],_0x58108c['activeContact']);}}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;case _0x60f2('0xb2'):var _0x85ab94=moment()['format'](_0x60f2('0x93'));_0x58108c[_0x60f2('0xb3')]=_0x85ab94;_0x58108c['answertime']=_0x85ab94;_0x58108c['dialAnswer']=!![];_0x57eb76[_0x60f2('0x7b')]+=0x1;logger['info'](_0x60f2('0xb4'),_0x58108c[_0x60f2('0xb5')],'\x20Queue',_0x57eb76[_0x60f2('0x59')],'pTalking:\x20',_0x57eb76[_0x60f2('0x7b')]);ami[_0x60f2('0x27')](_0x60f2('0xb6'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xb7'),this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]]));if(_0x57eb76[_0x60f2('0xb8')]){ami[_0x60f2('0x27')](_0x60f2('0xb9'),ut[_0x60f2('0xba')](_0x58108c));}break;case'16':ami[_0x60f2('0x27')](_0x60f2('0xbb'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xbc'),this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]]));emitVoiceQueueChannelRemove(ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xbc')));_0x57eb76[_0x60f2('0xbd')]+=0x1;_0x57eb76[_0x60f2('0x31')]+=0x1;_0x57eb76['answered']+=0x1;ut['decrementTalkink'](_0x57eb76,_0x60f2('0xbe'));_0x58108c['countglobal']=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x4,'Answer');rpcDb['createCustomerHistory'](_0x58108c,_0x60f2('0xbf'));rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xc0'));rpcDb['crateCustomerReportQueue'](_0x58108c);_0x57eb76[_0x60f2('0x2e')]+=_0x58108c['talktime'];_0x57eb76[_0x60f2('0x2d')]+=_0x58108c[_0x60f2('0xc1')];logger[_0x60f2('0x61')](_0x60f2('0xc2'),_0x58108c[_0x60f2('0xb5')],_0x60f2('0xc3'),_0x57eb76[_0x60f2('0x59')],_0x60f2('0x7a'),_0x57eb76[_0x60f2('0x7b')]);delete this[_0x60f2('0x16')][_0xb87285['linkedid']];break;case'BUSY':_0x57eb76[_0x60f2('0xc4')]+=0x1;_0x58108c[_0x60f2('0xc5')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x5,'Busy');ami[_0x60f2('0x27')](_0x60f2('0xc7'),ut[_0x60f2('0xa6')](_0x58108c,'busy'));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb['createCustomerFinal'](_0x5f57d1,_0x60f2('0xc8'));}else{if(_0x58108c[_0x60f2('0xc5')]>=_0x57eb76[_0x60f2('0xc9')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xca'));}else{rpcDb['rescheduleContact'](ut[_0x60f2('0xcb')](_0x58108c,'countbusyretry',_0x57eb76[_0x60f2('0xcc')]),_0x58108c['unlockAgent'],_0x58108c[_0x60f2('0xcd')]);}}break;case'NOANSWER':_0x57eb76[_0x60f2('0x41')]+=0x1;_0x58108c[_0x60f2('0xce')]+=0x1;_0x58108c['countglobal']=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x3,_0x60f2('0xcf'));ami['emit'](_0x60f2('0xd0'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xd1')));rpcDb['createCustomerHistory'](_0x58108c,_0x60f2('0xd2'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,'Global');rpcDb['createCustomerFinal'](_0x5f57d1,_0x60f2('0xd3'));}else{if(_0x58108c[_0x60f2('0xce')]>=_0x57eb76[_0x60f2('0xd4')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xd2'));}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xce'),_0x57eb76[_0x60f2('0xd6')]),_0x58108c['unlockAgent'],_0x58108c[_0x60f2('0xcd')]);}}break;case _0x60f2('0xd7'):_0x57eb76[_0x60f2('0x3d')]+=0x1;_0x58108c[_0x60f2('0xd8')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x8,_0x60f2('0xd9'));ami['emit'](_0x60f2('0xda'),ut['buildObj'](_0x58108c,_0x60f2('0xdb')));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x58108c)>=_0x57eb76['dialGlobalMaxRetry']){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x58108c['countcongestionretry']>=_0x57eb76[_0x60f2('0xdc')]){rpcDb['createCustomerFinal'](_0x58108c,_0x60f2('0xdd'));}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xd8'),_0x57eb76['dialBusyRetryFrequency']),_0x58108c[_0x60f2('0xb0')],_0x58108c['activeContact']);}}break;case _0x60f2('0xde'):_0x57eb76[_0x60f2('0x45')]+=0x1;_0x58108c[_0x60f2('0xdf')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x14,_0x60f2('0xe0'));ami['emit'](_0x60f2('0xe1'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xe2')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xe3'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut['cloneAction'](_0x58108c,0x14,_0x60f2('0xe0'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xe4'));}else{if(_0x58108c['countagentrejectretry']>=_0x57eb76['dialAgentRejectMaxRetry']){rpcDb[_0x60f2('0x9c')](_0x58108c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xdf'),_0x57eb76[_0x60f2('0xe5')]),_0x58108c[_0x60f2('0xb0')],_0x58108c[_0x60f2('0xcd')]);}}break;case _0x60f2('0xe6'):_0x57eb76[_0x60f2('0x47')]+=0x1;_0x58108c['countabandonedretry']+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0xb,_0x60f2('0xe7'));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x58108c[_0x60f2('0xe8')]>=_0x57eb76[_0x60f2('0xe9')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xea'));}else{rpcDb[_0x60f2('0xd5')](ut['scheduledAt'](_0x58108c,_0x60f2('0xeb'),_0x57eb76[_0x60f2('0xec')]),_0x58108c[_0x60f2('0xb0')],_0x58108c[_0x60f2('0xcd')]);}}break;case'18':_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c[_0x60f2('0xed')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x12,_0xb87285[_0x60f2('0xee')]||_0xb87285[_0x60f2('0xef')]);ami['emit']('custom:amd',ut['buildObj'](_0x58108c,_0x60f2('0xf0')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf1'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf1'));}else{rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xf1'));}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;case'19':_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c['countglobal']=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x13,_0xb87285['cause-txt']||_0xb87285[_0x60f2('0xef')]);ami['emit'](_0x60f2('0xf2'),ut['buildObj'](_0x58108c,'amd'));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf3'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf3'));}else{rpcDb['createCustomerFinal'](_0x58108c,'[callProgressDetectingCustomer][machine]');}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;default:if(_0x58108c['dialAnswer']){ut[_0x60f2('0xf4')](_0x57eb76,_0x60f2('0xf5'));ut[_0x60f2('0x87')](_0x60f2('0xf6')+_0x57eb76[_0x60f2('0x59')],_0xb87285);}_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0xc,_0xb87285[_0x60f2('0xee')]||_0xb87285[_0x60f2('0xef')]);rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf7'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76['dialGlobalMaxRetry']){_0x5f57d1=ut['cloneAction'](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf8'));}else{rpcDb[_0x60f2('0x9c')](_0x58108c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];}if(!(_0x58108c['dialAnswer']&&_0x59a2f6==='16')){ut[_0x60f2('0x84')](_0x57eb76,'[callProgressDetectingCustomer]');logger[_0x60f2('0x61')]('[originated][decrement][callProgressDetectingCustomer]',_0x58108c[_0x60f2('0xb5')],_0x60f2('0xc3'),_0x57eb76[_0x60f2('0x59')],_0x60f2('0x79'),_0x57eb76[_0x60f2('0x53')]);}if(_0x59a2f6!==_0x60f2('0xb2')){delete this['actions'][_0xb87285['linkedid']];delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xf9')]];}}};Preview[_0x60f2('0x6c')][_0x60f2('0xfa')]=function(_0x485ccd,_0x23af57,_0xac6261){if(_[_0x60f2('0xfb')](_0x23af57)&&_0x60f2('0xfc')!==typeof _0x23af57){return;}if(_[_0x60f2('0xfb')](_0xac6261)&&'object'!==typeof _0xac6261){return;}switch(_0xac6261[_0x60f2('0xfd')]){case'0':ut[_0x60f2('0xfe')](_0x485ccd,0x0,_0x60f2('0xa4'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x100'));break;case'3':ut['logAgent'](_0x485ccd,0x3,_0x60f2('0xcf'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x101'));break;case'5':ut[_0x60f2('0xfe')](_0x485ccd,0x5,'Busy');rpcDb[_0x60f2('0xff')](_0x485ccd,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x485ccd,0x8,_0x60f2('0xd9'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x102'));break;case'22':ut['logAgent'](_0x485ccd,0x16,'AnswerAGI');rpcDb[_0x60f2('0xff')](_0x485ccd,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x60f2('0xfe')](_0x485ccd,0xc,_0xac6261[_0x60f2('0xfd')]);rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x102'));}ut[_0x60f2('0x84')](_0x23af57,_0x60f2('0x103'));logger[_0x60f2('0x61')]('[originated][decrement][callProgressDetectingAgent]',_0x485ccd[_0x60f2('0xb5')],'\x20Queue',_0x23af57[_0x60f2('0x59')],'originated:\x20',_0x23af57['originated']);delete this[_0x60f2('0x16')][_0x485ccd[_0x60f2('0xb5')]];};Preview['prototype'][_0x60f2('0x104')]=function(_0x5845a9,_0x11a484,_0x289691,_0x7e87c2,_0x18f90d){var _0x992704=this;return new BPromise(function(_0x3314f9,_0x257296){if(_[_0x60f2('0x76')](_0x11a484)||_[_0x60f2('0x76')](_0x11a484[_0x60f2('0x105')])||_['isNil'](_0x11a484[_0x60f2('0x105')]['phone'])||_['isNil'](_0x11a484[_0x60f2('0x7f')])){_0x257296(ut['message'](_0x60f2('0x106'),_0x7e87c2,_0x18f90d));return;}var _0x1f2c3b=uuid['v4']();var _0xa9aa96=_0x992704['campaignsPreview'][_0x11a484['Queue'][_0x60f2('0x59')]];var _0x47e8f4=_0x289691?_0x992704[_0x60f2('0x17')][_0x289691]['id']:undefined;_0x992704[_0x60f2('0x16')][_0x1f2c3b]=new Action(_0x11a484,_0xa9aa96,_0x1f2c3b,_0x289691,_0x47e8f4);var _0x29a48b=_0x992704[_0x60f2('0x16')][_0x1f2c3b];_0x29a48b[_0x60f2('0xb0')]=_0x7e87c2;_0x29a48b[_0x60f2('0xcd')]=_0x18f90d;_0x29a48b['lookAgent']=_0x289691;if(_[_0x60f2('0x107')](_0x5845a9)){_0x992704[_0x60f2('0x108')](_0x29a48b,_0xa9aa96,_0x11a484,_0x289691)[_0x60f2('0x109')](function(_0x4bc254){logger[_0x60f2('0x61')](_0x60f2('0x10a'),_0x60f2('0x10b')+_0x29a48b['queue']+_0x60f2('0x10c')+_0x29a48b[_0x60f2('0x10d')],JSON[_0x60f2('0x5d')](_0x4bc254));ami[_0x60f2('0x27')](_0x60f2('0x10e'),ut[_0x60f2('0xa6')](_0x29a48b,_0x60f2('0x10f'),_0x992704[_0x60f2('0x13')][_0x29a48b['queue']]));_0x3314f9(ut[_0x60f2('0x52')]('Calling'));})[_0x60f2('0x82')](function(_0x36f40f){ut[_0x60f2('0x67')](_0x60f2('0x110'),_0x36f40f);_0x257296(ut[_0x60f2('0x52')]('Call\x20failed',_0x7e87c2,_0x18f90d));});}else{_0xa9aa96[_0x60f2('0x3c')]+=0x1;ut[_0x60f2('0x111')](_0x29a48b);rpcDb['createHistory'](_0x29a48b,_0x60f2('0x112'));delete _0x992704[_0x60f2('0x16')][_0x1f2c3b];_0x257296(ut[_0x60f2('0x52')](_0x60f2('0x113'),_0x7e87c2,_0x18f90d));}});};Preview[_0x60f2('0x6c')][_0x60f2('0xa0')]=function(_0x28a53f){return!_[_0x60f2('0x76')](_0x28a53f)&&!_['isNil'](_0x28a53f['name'])&&!_['isNil'](_0x28a53f[_0x60f2('0x5a')])&&_0x28a53f[_0x60f2('0x5a')]&&!_[_0x60f2('0x76')](this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f['name'])])&&!_[_0x60f2('0x76')](this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f[_0x60f2('0x59')])][_0x60f2('0x115')])&&(this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f[_0x60f2('0x59')])]['status']===_0x60f2('0x116')||this[_0x60f2('0x15')][util[_0x60f2('0x5e')]('SIP/%s',_0x28a53f[_0x60f2('0x59')])]['status']==='unmonitored');};Preview[_0x60f2('0x6c')]['run']=function(_0x4d2459,_0xb7e5aa){var _0x4692d1=this;return new BPromise(function(_0x47e03c,_0x1042af){_0x4692d1[_0x60f2('0x117')](_0x4d2459,_0xb7e5aa)[_0x60f2('0x109')](function(_0x11ab40){_0x47e03c(_[_0x60f2('0x7c')](_0x11ab40,['message']));})[_0x60f2('0x82')](function(_0x51f185){if(_0x51f185['unlock']){rpcDb['unlockContact'](_0x4d2459);}if(_0x51f185[_0x60f2('0x5a')]){rpcDb[_0x60f2('0x91')](_0x4d2459);}_0x1042af(_[_0x60f2('0x7c')](_0x51f185,['message']));});});};Preview[_0x60f2('0x6c')][_0x60f2('0x117')]=function(_0x342c77,_0x2943ca){var _0x5633a9=this;return new BPromise(function(_0x54fad8,_0x3eb307){var _0x5a2bcc,_0x11c63c;rpcDb['getContactPreview'](_0x342c77)[_0x60f2('0x109')](function(_0x1b98db){if(!_[_0x60f2('0x76')](_0x1b98db[0x0])){_0x11c63c=_0x1b98db[0x0]['recallme']?![]:!![];_0x5a2bcc=_0x1b98db[0x0][_0x60f2('0x118')]?!![]:![];_0x5a2bcc=_0x2943ca?!![]:_0x5a2bcc;}var _0x3b492c=_0x5633a9[_0x60f2('0x119')](_0x1b98db);if(_0x3b492c['isValid']){rpcDb[_0x60f2('0x11a')](_[_0x60f2('0x7c')](_0x1b98db[0x0],[_0x60f2('0x7f'),'Contact.phone']))[_0x60f2('0x109')](function(_0x4d2ebe){_0x5633a9[_0x60f2('0x104')](_0x4d2ebe,_0x1b98db[0x0],_0x2943ca,_0x11c63c,_0x5a2bcc)[_0x60f2('0x109')](function(_0x51995e){_0x54fad8(_0x51995e);})[_0x60f2('0x82')](function(_0x72c42){_0x3eb307(_0x72c42);});})[_0x60f2('0x82')](function(_0x3956af){ut[_0x60f2('0x67')](_0x60f2('0x11b'),_0x3956af);_0x3eb307(ut['message'](_0x60f2('0x11c'),_0x11c63c,_0x5a2bcc));});}else{_0x3eb307(ut[_0x60f2('0x52')](_0x3b492c[_0x60f2('0x52')],_0x11c63c,_0x5a2bcc));}})[_0x60f2('0x82')](function(_0x325869){ut[_0x60f2('0x67')](_0x60f2('0x11d'),_0x325869);_0x3eb307(ut[_0x60f2('0x52')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x60f2('0x6c')][_0x60f2('0x119')]=function(_0x1d3022){if(_['isNil'](_0x1d3022)||_[_0x60f2('0x107')](_0x1d3022)||!_[_0x60f2('0x76')](_0x1d3022[0x0][_0x60f2('0x8e')])&&_['isNil'](_0x1d3022[0x0]['Agent'][_0x60f2('0x59')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x1d3022);return{'isValid':![],'message':_0x60f2('0x11e')};}var _0xaec6da=this['campaignsPreview'][_0x1d3022[0x0][_0x60f2('0x11f')][_0x60f2('0x59')]];_0xaec6da[_0x60f2('0x52')]=_0x60f2('0xa2');if(_[_0x60f2('0x76')](_0xaec6da)){ut[_0x60f2('0x67')](_0x60f2('0x120'),_0xaec6da);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x60f2('0xa0')](_0xaec6da['Trunk'])){ut[_0x60f2('0x67')](_0x60f2('0x121'),_0x60f2('0x122')+_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x123'));if(!this[_0x60f2('0xa0')](_0xaec6da['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x124'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x60f2('0x9f')](_0xaec6da[_0x60f2('0x36')])){ut['logger'](_0x60f2('0x125'),_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x126'));return{'isValid':![],'message':_0x60f2('0x122')+_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x126')};}return{'isValid':!![],'message':_0x60f2('0x127')};};Preview[_0x60f2('0x6c')]['execCall']=function(_0x23f143,_0x484a50,_0x3623a8,_0x2782f5){var _0x361f48=this;return new BPromise(function(_0x1c0bac,_0x761994){var _0x42714a=_0x23f143[_0x60f2('0xb5')];var _0x480470=_0x361f48[_0x60f2('0xa0')](_0x484a50[_0x60f2('0x58')])?util[_0x60f2('0x5e')]('SIP/%s/%s%s',_0x484a50['Trunk'][_0x60f2('0x59')],_['isNil'](_0x484a50[_0x60f2('0x3a')])?'':_0x484a50['dialPrefix'][_0x60f2('0x128')]()||'',_0x484a50['dialCutDigit']>0x0?_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')][_0x60f2('0x12a')](_0x484a50[_0x60f2('0x12b')]):_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')]):util[_0x60f2('0x5e')](_0x60f2('0x12c'),_[_0x60f2('0x76')](_0x484a50['TrunkBackup'])?_0x484a50['Trunk'][_0x60f2('0x59')]:_0x484a50[_0x60f2('0xa1')]['name'],_[_0x60f2('0x76')](_0x484a50[_0x60f2('0x3a')])?'':_0x484a50['dialPrefix'][_0x60f2('0x128')]()||'',_0x484a50[_0x60f2('0x12b')]>0x0?_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')][_0x60f2('0x12a')](_0x484a50[_0x60f2('0x12b')]):_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')]);var _0x4388e7=_0x361f48[_0x60f2('0xa0')](_0x484a50[_0x60f2('0x58')])?ut[_0x60f2('0x12d')](_0x484a50[_0x60f2('0x58')]['callerid'],_0x484a50[_0x60f2('0x38')],_0x484a50[_0x60f2('0x12e')]>0x0?ut[_0x60f2('0x12f')](_0x484a50[_0x60f2('0x39')],_0x484a50[_0x60f2('0x12e')]):_0x484a50[_0x60f2('0x39')]):ut[_0x60f2('0x12d')](_[_0x60f2('0x76')](_0x484a50[_0x60f2('0xa1')])?_0x484a50[_0x60f2('0x58')][_0x60f2('0x5b')]:_0x484a50[_0x60f2('0xa1')][_0x60f2('0x5b')],_0x484a50['dialOriginateCallerIdName'],_0x484a50[_0x60f2('0x12e')]>0x0?ut[_0x60f2('0x12f')](_0x484a50[_0x60f2('0x39')],_0x484a50[_0x60f2('0x12e')]):_0x484a50[_0x60f2('0x39')]);if(_0x4388e7){_0x23f143[_0x60f2('0x130')]=ut[_0x60f2('0x131')](_0x4388e7);_0x23f143[_0x60f2('0x132')]=ut[_0x60f2('0x133')](_0x4388e7);}var _0xa4837a=ut[_0x60f2('0x134')](_0x484a50,_0x3623a8,_0x480470,_0x4388e7,_0x42714a,_0x23f143);_['merge'](_0x23f143,ut[_0x60f2('0x135')](_0xa4837a));_0x23f143['starttime']=moment()[_0x60f2('0x5e')](_0x60f2('0x93'));ami[_0x60f2('0x81')](ut[_0x60f2('0x136')](_0x23f143,_0x484a50,_0xa4837a,_0x23f143['activeContact'],_0x2782f5))[_0x60f2('0x109')](function(_0x1ce3f8){var _0x505d9b=_0x23f143[_0x60f2('0x137')];if(!_['isNil'](_0x505d9b)){if(!_[_0x60f2('0x76')](_0x361f48['agents'][_0x505d9b])){_0x361f48['agents'][_0x505d9b][_0x60f2('0x138')]=_0x23f143[_0x60f2('0x139')];emit(util['format']('user:%s',_0x361f48[_0x60f2('0x17')][_0x505d9b]['name']),_0x60f2('0x13a'),{'destaccountcode':_0x361f48[_0x60f2('0x17')][_0x505d9b][_0x60f2('0x13b')],'destconnectedlinenum':_0x23f143[_0x60f2('0x139')]});}}_0x484a50['originated']+=0x1;logger[_0x60f2('0x61')](_0x60f2('0x13c'),_0x42714a,_0x60f2('0xc3'),_0x484a50[_0x60f2('0x59')],_0x60f2('0x79'),_0x484a50['originated']);_0x1c0bac(_0x1ce3f8);})[_0x60f2('0x82')](function(_0x57bd7f){ut[_0x60f2('0xfe')](_0x23f143,0xe,_0x60f2('0x13d'));rpcDb['createAgentHistory'](_0x23f143,_0x60f2('0x13e'));_0x761994(_0x57bd7f);});});};Preview[_0x60f2('0x6c')][_0x60f2('0x13f')]=function(_0x4d7f38){if(this[_0x60f2('0x16')][_0x4d7f38['linkedid']]){this[_0x60f2('0x16')][_0x4d7f38[_0x60f2('0xb1')]][_0x60f2('0x140')]=_0x4d7f38[_0x60f2('0x140')];}};Preview[_0x60f2('0x6c')][_0x60f2('0x1a')]=function(_0x4d002c){var _0x3ccee8=this;var _0x2ce870=this[_0x60f2('0x16')][_0x4d002c[_0x60f2('0x141')]];if(_0x2ce870){if(_0x2ce870[_0x60f2('0x142')]&&this[_0x60f2('0x17')][_0x2ce870['lookAgent']]){ut[_0x60f2('0x143')](_0x2ce870,this[_0x60f2('0x17')][_0x2ce870[_0x60f2('0x142')]][_0x60f2('0x59')],this[_0x60f2('0x17')][_0x2ce870[_0x60f2('0x142')]]['id']);}var _0x170dc1=_[_0x60f2('0x144')](_0x2ce870);_0x170dc1['responsetime']=moment()[_0x60f2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ef79a=_0x3ccee8[_0x60f2('0x13')][_0x2ce870[_0x60f2('0x78')]];if(ut[_0x60f2('0x145')](_0x4d002c[_0x60f2('0x146')])){if(_0x2ce870['unlockAgent']){rpcDb['unlockContact'](_0x2ce870['idContact']);}if(_0x2ce870[_0x60f2('0xcd')]){rpcDb[_0x60f2('0x91')](_0x2ce870[_0x60f2('0x10d')]);}ami[_0x60f2('0x27')](_0x60f2('0x147'),ut[_0x60f2('0xa6')](_0x2ce870,_0x60f2('0x148'),this['campaignsPreview'][_0x2ce870['queue']]));this['callProgressDetectingAgent'](_0x170dc1,_0x3ef79a,_0x4d002c);}else{_0x2ce870[_0x60f2('0x92')]=moment()['format'](_0x60f2('0x93'));ut[_0x60f2('0xfe')](_0x170dc1,0x4,_0x60f2('0x149'));rpcDb[_0x60f2('0xff')](_0x170dc1,_0x60f2('0x14a'));}}};Preview['prototype'][_0x60f2('0x1d')]=function(_0x5182bd){var _0x58fd46=this;var _0x5442d8=this[_0x60f2('0x16')][_0x5182bd[_0x60f2('0xb1')]];var _0x322ed9;if(_0x5442d8){_0x322ed9=this[_0x60f2('0x13')][_0x5442d8[_0x60f2('0x78')]];logger[_0x60f2('0x61')](_0x60f2('0x14b'),_0x5182bd[_0x60f2('0xb1')],'\x20Queue',_0x322ed9['name'],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);}if(this['actions'][_0x5182bd[_0x60f2('0xb1')]]&&_0x5182bd[_0x60f2('0xb1')]!==_0x5182bd[_0x60f2('0xb5')]){if(_0x5182bd[_0x60f2('0x14c')]==='16'&&this[_0x60f2('0x16')][_0x5182bd[_0x60f2('0xb1')]][_0x60f2('0x86')]){this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}else if(this['actions'][_0x5182bd[_0x60f2('0xb1')]]['dialAnswer']){logger[_0x60f2('0x61')](_0x60f2('0x14e'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],_0x60f2('0xc3'),_0x322ed9[_0x60f2('0x59')],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}}else if(_0x5442d8&&_[_0x60f2('0x76')](_0x5442d8[_0x60f2('0x14f')])&&_0x322ed9[_0x60f2('0x150')]&&_0x5182bd[_0x60f2('0xb1')]===_0x5182bd['uniqueid']&&_['isNil'](_0x5182bd['reason'])&&_0x5182bd[_0x60f2('0x14c')]==='16'&&_0x5182bd[_0x60f2('0x151')]==='6'&&_[_0x60f2('0xfb')](_0x5442d8[_0x60f2('0x152')])){if(_0x5442d8[_0x60f2('0xb0')]){rpcDb[_0x60f2('0x153')](_0x5442d8[_0x60f2('0x10d')]);}if(_0x5442d8[_0x60f2('0xcd')]){rpcDb[_0x60f2('0x91')](_0x5442d8[_0x60f2('0x10d')]);}_0x5182bd[_0x60f2('0xfd')]='22';this[_0x60f2('0xfa')](_0x5442d8,_0x322ed9,_0x5182bd);}else if(_0x5442d8&&_0x5442d8[_0x60f2('0x152')]){if(_0x5182bd[_0x60f2('0x14c')]==='16'&&this['actions'][_0x5182bd[_0x60f2('0xb1')]]['dialAnswer']){logger['info'](_0x60f2('0x154'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],'\x20Queue',_0x322ed9[_0x60f2('0x59')],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')]);}else if(this['actions'][_0x5182bd[_0x60f2('0xb1')]][_0x60f2('0x86')]){logger['info'](_0x60f2('0x14e'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],_0x60f2('0xc3'),_0x322ed9[_0x60f2('0x59')],'pTalking:\x20',_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}}};Preview[_0x60f2('0x6c')]['syncDialEnd']=function(_0x565aa5){if(this[_0x60f2('0x16')][_0x565aa5[_0x60f2('0xf9')]]&&_0x565aa5[_0x60f2('0xf9')]!==_0x565aa5[_0x60f2('0x155')]){this[_0x60f2('0x14d')](_0x565aa5,_0x565aa5[_0x60f2('0xf9')],_0x565aa5['dialstatus']);}};Preview[_0x60f2('0x6c')][_0x60f2('0x1f')]=function(_0x301fc2){if(this[_0x60f2('0x16')][_0x301fc2[_0x60f2('0xb1')]]&&_0x301fc2['linkedid']!==_0x301fc2[_0x60f2('0xb5')]&&!this[_0x60f2('0x16')][_0x301fc2[_0x60f2('0xb1')]][_0x60f2('0x86')]){if(_0x301fc2[_0x60f2('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x301fc2,_0x301fc2[_0x60f2('0xb1')],_0x301fc2[_0x60f2('0x14c')]);}}};Preview[_0x60f2('0x6c')][_0x60f2('0x156')]=function(_0x547903,_0x3ddd64,_0x34ca93){if(this[_0x60f2('0x16')][_0x547903]){if(_[_0x60f2('0x76')](this[_0x60f2('0x16')][_0x547903][_0x60f2('0x157')])){this[_0x60f2('0x16')][_0x547903][_0x60f2('0x157')]={};}this[_0x60f2('0x16')][_0x547903]['variables'][_0x3ddd64]=_0x34ca93;}};Preview[_0x60f2('0x6c')][_0x60f2('0x23')]=function(_0x3b7b59){try{if(!_[_0x60f2('0x76')](_0x3b7b59)){if(ut[_0x60f2('0x158')](_['keys'](_0x3b7b59[_0x60f2('0x159')])[0x0])){this[_0x60f2('0x156')](_0x3b7b59[_0x60f2('0xb5')],_[_0x60f2('0x15a')](_0x3b7b59[_0x60f2('0x159')])[0x0],_0x3b7b59[_0x60f2('0x15b')]);}}}catch(_0x2c952b){logger[_0x60f2('0x15c')](_0x60f2('0x15d'),util['inspect'](_0x2c952b,{'showHidden':![],'depth':null}));}};Preview[_0x60f2('0x6c')]['syncAttendedTransfer']=function(_0x4f2a28){if(_0x4f2a28){if(this[_0x60f2('0x16')][_0x4f2a28['transfertargetlinkedid']]){this[_0x60f2('0x16')][_0x4f2a28[_0x60f2('0x15e')]][_0x60f2('0x152')]=!![];}}};Preview[_0x60f2('0x6c')][_0x60f2('0x15f')]=function(_0x6484c9){if(_0x6484c9){if(this[_0x60f2('0x16')][_0x6484c9[_0x60f2('0x160')]]){this[_0x60f2('0x16')][_0x6484c9['transfererlinkedid']][_0x60f2('0x152')]=!![];}}};module[_0x60f2('0x161')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index fc0348e..8b1d278 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 _0x760d=['[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','membername','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact'];(function(_0x1b9bd4,_0x276012){var _0x18dde6=function(_0x59b521){while(--_0x59b521){_0x1b9bd4['push'](_0x1b9bd4['shift']());}};_0x18dde6(++_0x276012);}(_0x760d,0x148));var _0xd760=function(_0x4e0c5a,_0x3f970c){_0x4e0c5a=_0x4e0c5a-0x0;var _0x4daacf=_0x760d[_0x4e0c5a];return _0x4daacf;};'use strict';var util=require(_0xd760('0x0'));var BPromise=require(_0xd760('0x1'));var logger=require(_0xd760('0x2'))(_0xd760('0x3'));var _=require(_0xd760('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xd760('0x5'));var voiceQueueRt=require(_0xd760('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xd760('0x7'));function loggerCatch(_0x10ecec){return function(_0x37a608){logger[_0xd760('0x8')](_0x10ecec,util[_0xd760('0x9')](_0x37a608,{'showHidden':![],'depth':null}));};}function create(_0x4a9c59){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopperHistory[_0xd760('0xc')](_0x4a9c59))[_0xd760('0xd')](loggerCatch(_0xd760('0xe')));}function createAgent(_0x299d8f){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](agentReportPreview[_0xd760('0xc')](_0x299d8f))['catch'](loggerCatch(_0xd760('0xe')));}function moveContact(_0x131ba0){return BPromise['resolve']()[_0xd760('0xb')](cmHopper[_0xd760('0xf')](_0x131ba0,!![]))[_0xd760('0xd')](loggerCatch(_0xd760('0x10')));}exports['checkIsBlackList']=function(_0x69d6b4){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopperBlack['checkIsBlackList'](_0x69d6b4))['catch'](loggerCatch(_0xd760('0x11')));};exports[_0xd760('0x12')]=function(_0x3663b2){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopper['getContactPreview'](_0x3663b2))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xd760('0xc')]=function(_0x3f36da,_0x3d9180){create(_0x3f36da)[_0xd760('0xd')](loggerCatch(_0x3d9180));moveContact(_0x3f36da)[_0xd760('0xd')](loggerCatch(_0x3d9180));};exports[_0xd760('0x13')]=function(_0x1a48fd,_0x10e4e3){createAgent(_0x1a48fd)['catch'](loggerCatch(_0x10e4e3));};exports['createCustomerHistory']=function(_0x71c846,_0x26943d){create(_0x71c846)[_0xd760('0xd')](loggerCatch(_0x26943d));};exports[_0xd760('0x14')]=function(_0x547920,_0x2d3d1b){moveContact(_0x547920)['catch'](loggerCatch(_0x2d3d1b));};exports[_0xd760('0x15')]=function(_0x23a513,_0x35cefd,_0x44c045){if(_0x35cefd){_0x23a513['UserId']=null;}if(_0x44c045){_0x23a513[_0xd760('0x16')]=![];}return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopper[_0xd760('0x15')](_0x23a513))['catch'](loggerCatch(_0xd760('0x17')));};exports[_0xd760('0x18')]=function(_0x1ed02c){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopper[_0xd760('0x18')](_0x1ed02c))[_0xd760('0xd')](loggerCatch(_0xd760('0x19')));};exports[_0xd760('0x1a')]=function(_0x1fe1fd){return BPromise[_0xd760('0xa')]()['then'](cmHopper[_0xd760('0x1a')]({'UserId':null},_0x1fe1fd,0x1))[_0xd760('0xd')](loggerCatch(_0xd760('0x1b')));};exports[_0xd760('0x1c')]=function(_0x2b59d6){return BPromise['resolve']()[_0xd760('0xb')](cmHopper[_0xd760('0x1a')]({'active':![]},_0x2b59d6,0x1))[_0xd760('0xd')](loggerCatch(_0xd760('0x1d')));};exports['crateCustomerReportQueue']=function(_0x46960f){var _0x4d4309={};_0x4d4309[_0xd760('0x1e')]=_0x46960f[_0xd760('0x1e')];_0x4d4309['uniqueid']=_0x46960f[_0xd760('0x1f')];_0x4d4309[_0xd760('0x20')]=_0x46960f[_0xd760('0x20')];_0x4d4309[_0xd760('0x21')]=_0x46960f[_0xd760('0x21')];_0x4d4309[_0xd760('0x22')]=_0x46960f[_0xd760('0x22')];_0x4d4309[_0xd760('0x23')]=_0x46960f[_0xd760('0x24')];_0x4d4309[_0xd760('0x25')]=_0x46960f[_0xd760('0x24')];_0x4d4309['queuecallercomplete']=0x1;_0x4d4309[_0xd760('0x26')]=_0x46960f['endtime'];_0x4d4309['connectedlinename']=_0x46960f[_0xd760('0x27')];_0x4d4309['context']=_0xd760('0x28');_0x4d4309['exten']=_0xd760('0x29');_0x4d4309[_0xd760('0x2a')]=0x0;_0x4d4309[_0xd760('0x2b')]=0x1;_0x4d4309[_0xd760('0x2c')]=_0x46960f[_0xd760('0x27')];_0x4d4309['queuecallerexitreason']=_0xd760('0x2d');return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](voiceQueueReport[_0xd760('0x2e')](_0x4d4309))[_0xd760('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xd760('0x2f')]=function(_0x585798,_0x3ddd49){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopper['getContactRecallMe'](_0x585798,_0x3ddd49))[_0xd760('0xd')](loggerCatch(_0xd760('0x30')));};exports[_0xd760('0x31')]=function(_0x39c258){return BPromise[_0xd760('0xa')]()[_0xd760('0xb')](cmHopper['rescheduleContact'](_0x39c258,!![],!![]))[_0xd760('0xd')](loggerCatch(_0xd760('0x32')));}; \ No newline at end of file +var _0x82a3=['[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x82a3,0x1b2));var _0x382a=function(_0x579121,_0x27e9e2){_0x579121=_0x579121-0x0;var _0x38a4ae=_0x82a3[_0x579121];return _0x38a4ae;};'use strict';var util=require(_0x382a('0x0'));var BPromise=require(_0x382a('0x1'));var logger=require(_0x382a('0x2'))(_0x382a('0x3'));var _=require(_0x382a('0x4'));var cmHopper=require(_0x382a('0x5'));var cmHopperFinal=require(_0x382a('0x6'));var cmHopperHistory=require(_0x382a('0x7'));var cmHopperBlack=require(_0x382a('0x8'));var voiceQueueRt=require(_0x382a('0x9'));var agentReportPreview=require(_0x382a('0xa'));var voiceQueueReport=require(_0x382a('0xb'));function loggerCatch(_0x8c11aa){return function(_0x2e9619){logger['error'](_0x8c11aa,util[_0x382a('0xc')](_0x2e9619,{'showHidden':![],'depth':null}));};}function create(_0x11f2b7){return BPromise[_0x382a('0xd')]()['then'](cmHopperHistory[_0x382a('0xe')](_0x11f2b7))[_0x382a('0xf')](loggerCatch(_0x382a('0x10')));}function createAgent(_0x2128d5){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](agentReportPreview[_0x382a('0xe')](_0x2128d5))[_0x382a('0xf')](loggerCatch(_0x382a('0x10')));}function moveContact(_0x21e05b){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x12')](_0x21e05b,!![]))[_0x382a('0xf')](loggerCatch(_0x382a('0x13')));}exports['checkIsBlackList']=function(_0x4dfe1e){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopperBlack[_0x382a('0x14')](_0x4dfe1e))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x382a('0x15')]=function(_0x22fecd){return BPromise[_0x382a('0xd')]()['then'](cmHopper[_0x382a('0x15')](_0x22fecd))['catch'](loggerCatch(_0x382a('0x16')));};exports[_0x382a('0xe')]=function(_0x15d571,_0x2d138b){create(_0x15d571)['catch'](loggerCatch(_0x2d138b));moveContact(_0x15d571)['catch'](loggerCatch(_0x2d138b));};exports[_0x382a('0x17')]=function(_0x27213d,_0x1172b0){createAgent(_0x27213d)['catch'](loggerCatch(_0x1172b0));};exports[_0x382a('0x18')]=function(_0x205db9,_0x2ae9a){create(_0x205db9)[_0x382a('0xf')](loggerCatch(_0x2ae9a));};exports[_0x382a('0x19')]=function(_0x150953,_0x4099c7){moveContact(_0x150953)['catch'](loggerCatch(_0x4099c7));};exports[_0x382a('0x1a')]=function(_0x36b684,_0x1bc8de,_0x47a89d){if(_0x1bc8de){_0x36b684['UserId']=null;}if(_0x47a89d){_0x36b684[_0x382a('0x1b')]=![];}return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x1a')](_0x36b684))['catch'](loggerCatch(_0x382a('0x1c')));};exports['countReScheduled']=function(_0x3b59d1){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x1d')](_0x3b59d1))[_0x382a('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x382a('0x1e')]=function(_0x31b1ba){return BPromise['resolve']()[_0x382a('0x11')](cmHopper['unlockContact']({'UserId':null},_0x31b1ba,0x1))[_0x382a('0xf')](loggerCatch(_0x382a('0x1f')));};exports['disableContact']=function(_0x5b6458){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x1e')]({'active':![]},_0x5b6458,0x1))[_0x382a('0xf')](loggerCatch(_0x382a('0x20')));};exports[_0x382a('0x21')]=function(_0x1066f6){var _0x1f763c={};_0x1f763c[_0x382a('0x22')]=_0x1066f6[_0x382a('0x22')];_0x1f763c[_0x382a('0x23')]=_0x1066f6['uniqueid'];_0x1f763c['calleridnum']=_0x1066f6['calleridnum'];_0x1f763c[_0x382a('0x24')]=_0x1066f6[_0x382a('0x24')];_0x1f763c[_0x382a('0x25')]=_0x1066f6[_0x382a('0x25')];_0x1f763c[_0x382a('0x26')]=_0x1066f6[_0x382a('0x27')];_0x1f763c[_0x382a('0x28')]=_0x1066f6['answertime'];_0x1f763c[_0x382a('0x29')]=0x1;_0x1f763c['queuecallercompleteAt']=_0x1066f6['endtime'];_0x1f763c[_0x382a('0x2a')]=_0x1066f6['membername'];_0x1f763c[_0x382a('0x2b')]='from-sip';_0x1f763c[_0x382a('0x2c')]=_0x382a('0x2d');_0x1f763c[_0x382a('0x2e')]=0x0;_0x1f763c[_0x382a('0x2f')]=0x1;_0x1f763c[_0x382a('0x30')]=_0x1066f6[_0x382a('0x31')];_0x1f763c[_0x382a('0x32')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x382a('0x33')](_0x1f763c))[_0x382a('0xf')](loggerCatch(_0x382a('0x34')));};exports[_0x382a('0x35')]=function(_0x4a3229,_0x46671d){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x35')](_0x4a3229,_0x46671d))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0xfcae5f){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x1a')](_0xfcae5f,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 9467675..13bdd7f 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 _0x642e=['IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','not_inuse','status','reachable','getDiff','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','calleridname','countbusyretry','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepvtcallid','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','diff','seconds','loggerCatch','inspect','logger','error','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined'];(function(_0x722103,_0x5732f3){var _0x3e2435=function(_0x44c44a){while(--_0x44c44a){_0x722103['push'](_0x722103['shift']());}};_0x3e2435(++_0x5732f3);}(_0x642e,0x14c));var _0xe642=function(_0x17846a,_0xae7151){_0x17846a=_0x17846a-0x0;var _0x2d3ec4=_0x642e[_0x17846a];return _0x2d3ec4;};'use strict';var util=require(_0xe642('0x0'));var _=require('lodash');var moment=require(_0xe642('0x1'));var logger=require(_0xe642('0x2'))(_0xe642('0x3'));var ipAgi=process['env'][_0xe642('0x4')]||_0xe642('0x5');function getSeconds(_0x28c7af,_0x17b03d){var _0x2aef47=moment(_0x28c7af)['milliseconds'](0x0);var _0x3a3a11=moment(_0x17b03d)['milliseconds'](0x0);return _0x2aef47[_0xe642('0x6')](_0x3a3a11,_0xe642('0x7'));}exports[_0xe642('0x8')]=function(_0x537451){return function(_0x4efed9){logger['error'](_0x537451,util[_0xe642('0x9')](_0x4efed9,{'showHidden':![],'depth':null}));};};exports[_0xe642('0xa')]=function(_0x32bb92,_0x53b313){logger['info'](_0x32bb92,util['inspect'](_0x53b313,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x16bd33,_0x447f15){logger[_0xe642('0xb')](_0x16bd33,util[_0xe642('0x9')](_0x447f15,{'showHidden':![],'depth':null}));};exports[_0xe642('0xc')]=function(_0x5ce726){return function(_0x483996){logger['info'](_0x5ce726,util[_0xe642('0x9')](_0x483996,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x395110,_0x7aaf3e,_0x33ad03){return{'message':_0x395110,'unlock':_0x7aaf3e,'active':_0x33ad03};};exports[_0xe642('0xd')]=function(_0x1d5b93,_0x156399,_0x2c6473){if(!_[_0xe642('0xe')](_0x2c6473)&&_0xe642('0xf')===typeof _0x2c6473&&!_[_0xe642('0x10')](_0x2c6473)){if(!_[_0xe642('0xe')](_0x156399)&&_0xe642('0xf')===typeof _0x156399&&!_[_0xe642('0x10')](_0x156399)){return util[_0xe642('0x11')](_0xe642('0x12'),_0x156399,_0x2c6473);}return util[_0xe642('0x11')](_0xe642('0x12'),_0x2c6473,_0x2c6473);}if(!_[_0xe642('0xe')](_0x1d5b93)&&_0xe642('0xf')===typeof _0x1d5b93&&!_['isEmpty'](_0x1d5b93)){return _0x1d5b93;}return _0xe642('0x13');};exports[_0xe642('0x14')]=function(_0x4e314a){if(_['isNil'](_0x4e314a)){return![];}return _0x4e314a;};exports[_0xe642('0x15')]=function(_0x11ba24,_0xd42d2c,_0x342f9c,_0x5140ab,_0x19e3c3,_0x1283d1){var _0x57c54f={'XMD-QUEUE':_0xd42d2c['Queue']?_0xd42d2c[_0xe642('0x16')][_0xe642('0x17')]:'','XMD-CALLERID':_0x5140ab,'XMD-CALLERID-PREVIEW':_0x1283d1?util[_0xe642('0x11')]('\x22%s\x22\x20<%s>',_0x1283d1['calleridname'],_0x1283d1[_0xe642('0x18')]):_0x5140ab,'XMD-DIALID':_0x19e3c3,'XMD-CONTACTID':_0xd42d2c[_0xe642('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5140ab,'XMD-VOICEQUEUEID':_0xd42d2c[_0xe642('0x1a')],'XMD-DIALCHANNEL':_0x342f9c,'XMD-DIALTIMEOUT':_0x11ba24['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xe642('0x11')](_0xe642('0x1b'),_0x11ba24[_0xe642('0x1c')]?'g':'',_['isEmpty'](_0x11ba24['monitor_format'])?'':_0xe642('0x1d')),'XMD-DIALURL':_0x11ba24[_0xe642('0x1e')]||'','XMD-AGI':_0x11ba24[_0xe642('0x1f')]?util[_0xe642('0x11')](_0xe642('0x20'),ipAgi,_0x11ba24['dialQueueProject']):_0xe642('0x21'),'XMD-AGIAFTER':_0x11ba24[_0xe642('0x1c')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x11ba24['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1283d1?_0x1283d1[_0xe642('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x1283d1?_0x1283d1['originatecalleridname']:'','XMD-DESTINATION':_0xe642('0x23')};if(!_[_0xe642('0x10')](_0x11ba24[_0xe642('0x24')])){_0x57c54f[util['format']('%s',_0xe642('0x25'))]=_0x11ba24[_0xe642('0x24')];_0x57c54f[util[_0xe642('0x11')]('%s',_0xe642('0x26'))]=_0x19e3c3;}if(_0xd42d2c&&_0xd42d2c[_0xe642('0x27')]){for(var _0x29518a in _0xd42d2c[_0xe642('0x27')]){if(_0xd42d2c[_0xe642('0x27')][_0xe642('0x28')](_0x29518a)){if(!_[_0xe642('0x29')](_0xd42d2c[_0xe642('0x27')][_0x29518a])&&_0x29518a!=='id'&&_0x29518a!=='tags'&&_0x29518a!==_0xe642('0x2a')&&_0x29518a!=='updatedAt'){_0x57c54f[util['format'](_0xe642('0x2b'),'XMD-',_[_0xe642('0x2c')](_0x29518a))]=_0xd42d2c['Contact'][_0x29518a];}}}}return _0x57c54f;};exports[_0xe642('0x2d')]=function(_0x4852f9){var _0x325003={};for(var _0x37110c in _0x4852f9){if(_0x4852f9['hasOwnProperty'](_0x37110c)){_0x325003[util[_0xe642('0x11')]('%s',_[_0xe642('0x2e')](_0x37110c))]=_0x4852f9[_0x37110c];}}return{'variables':_0x325003};};exports[_0xe642('0x2f')]=function(_0x5f4f0f,_0x587730){if(!_['isNil'](_0x5f4f0f)){if(_0x5f4f0f[_0xe642('0x28')]('originated')){if(_0x5f4f0f[_0xe642('0x30')]>0x0){_0x5f4f0f[_0xe642('0x30')]-=0x1;}else{logger[_0xe642('0xb')](_0xe642('0x31'),_0x587730);}}}else{logger[_0xe642('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x587730);}};exports[_0xe642('0x32')]=function(_0x3ad2c7){var _0xe9a537=moment()[_0xe642('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ad2c7[_0xe642('0x33')]=0xd;_0x3ad2c7[_0xe642('0x34')]=_0xe642('0x35');_0x3ad2c7['starttime']=_0xe9a537;_0x3ad2c7[_0xe642('0x36')]=_0xe9a537;_0x3ad2c7[_0xe642('0x37')]=_0xe9a537;};exports['logAgent']=function(_0x52a1a6,_0x5481d9,_0x150bdf){var _0x283f0e=moment()[_0xe642('0x11')](_0xe642('0x38'));_0x52a1a6[_0xe642('0x33')]=_0x5481d9;_0x52a1a6['statedesc']=_0x150bdf;_0x52a1a6['responsetime']=_0x283f0e;_0x52a1a6[_0xe642('0x39')]=getSeconds(_0x52a1a6[_0xe642('0x36')],_0x52a1a6[_0xe642('0x3a')]);};exports[_0xe642('0x3b')]=function(_0x487d9f,_0x4953e9,_0x2d66e4){_0x487d9f[_0xe642('0x3c')]=_0x4953e9;_0x487d9f[_0xe642('0x3d')]=_0x2d66e4;};exports[_0xe642('0x3e')]=function(_0x5e0ec6,_0x4f727d,_0x446a66){var _0x533361=moment()[_0xe642('0x11')](_0xe642('0x38'));_0x5e0ec6['state']=_0x4f727d;_0x5e0ec6[_0xe642('0x34')]=_0x446a66;_0x5e0ec6['responsetime']=_0x5e0ec6[_0xe642('0x36')]?_0x5e0ec6[_0xe642('0x36')]:_0x533361;_0x5e0ec6[_0xe642('0x37')]=_0x5e0ec6[_0xe642('0x37')]?_0x5e0ec6[_0xe642('0x37')]:_0x533361;_0x5e0ec6[_0xe642('0x39')]=getSeconds(_0x5e0ec6['responsetime']||0x0,_0x5e0ec6[_0xe642('0x3a')]||0x0);_0x5e0ec6[_0xe642('0x3f')]=_0x5e0ec6[_0xe642('0x40')]?getSeconds(_0x5e0ec6[_0xe642('0x37')],_0x5e0ec6[_0xe642('0x40')]):0x0;};exports[_0xe642('0x41')]=function(_0x2fdd75){return _0x2fdd75===_0xe642('0x42');};exports[_0xe642('0x43')]=function(_0x2dd0a6,_0x456f25,_0x243aee,_0x3d7f2a,_0x30b838){var _0x18a925=_0x3d7f2a?_0xe642('0x44'):_0x2dd0a6['calleridname'];_0x18a925=_0x30b838?'BOOKED':_0x18a925;return{'actionid':_0x2dd0a6[_0xe642('0x45')],'action':_0xe642('0x46'),'channel':_0x2dd0a6[_0xe642('0x47')],'callerid':util[_0xe642('0x11')]('\x22%s\x22\x20<%s>',_0x18a925,_0x2dd0a6[_0xe642('0x18')]),'Exten':_0xe642('0x23'),'Context':'from-sip','Priority':'1','variable':_0x243aee,'timeout':(_0x456f25[_0xe642('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2dd0a6[_0xe642('0x45')]};};exports[_0xe642('0x49')]=function(_0x24f4e8){return _0x24f4e8['countbusyretry']+_0x24f4e8['countcongestionretry']+_0x24f4e8[_0xe642('0x4a')]+_0x24f4e8[_0xe642('0x4b')]+_0x24f4e8[_0xe642('0x4c')];};exports['cloneAction']=function(_0x4b1f04){var _0x38acb2=_[_0xe642('0x4d')](_0x4b1f04);_0x38acb2['state']=0xf;_0x38acb2[_0xe642('0x34')]=_0xe642('0x4e');return _0x38acb2;};exports[_0xe642('0x4f')]=function(_0x24c03d,_0x5cbd85,_0x19557d){var _0x3e0ae8={};_0x3e0ae8[_0x5cbd85]=_0x24c03d[_0x5cbd85];_0x3e0ae8[_0xe642('0x50')]=![];_0x3e0ae8['scheduledat']=moment()[_0xe642('0x51')](_0x19557d,_0xe642('0x52'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e0ae8[_0xe642('0x19')]=_0x24c03d[_0xe642('0x19')];_0x3e0ae8[_0xe642('0x53')]=_0x24c03d[_0xe642('0x53')];_0x3e0ae8[_0xe642('0x1a')]=_0x24c03d[_0xe642('0x1a')]||undefined;return _0x3e0ae8;};exports[_0xe642('0x54')]=function(_0x201916,_0xa62fb7){if(!_['isNil'](_0x201916)){if(_0x201916[_0xe642('0x55')]>0x0){_0x201916[_0xe642('0x55')]-=0x1;}else{logger[_0xe642('0xb')](_0xa62fb7,_0xe642('0x56'));}}else{logger['error'](_0xa62fb7,_0xe642('0x57'));}};exports[_0xe642('0x58')]=function(_0x495aea){if(_0x495aea<=0x0){return!![];}return![];};exports[_0xe642('0x59')]=function(_0x318adb,_0x54444b,_0x1ce437){_0x318adb[_0xe642('0x5a')]=_0x54444b;_0x318adb[_0xe642('0x17')]=_0x318adb[_0xe642('0x5b')];_0x318adb[_0xe642('0x5c')]=_0x318adb['channelAgent'];_0x318adb['motionChannel']=_0xe642('0x5d');if(_0x1ce437){_0x318adb['mandatoryDisposition']=_0x1ce437[_0xe642('0x5e')];}return _0x318adb;};exports[_0xe642('0x5f')]=function(_0x5b6f11){var _0x4b6837={};_0x4b6837[_0xe642('0x5b')]=_0x5b6f11['queue'];_0x4b6837['interface']=_0x5b6f11['channelAgent'];_0x4b6837[_0xe642('0x45')]=_0x5b6f11[_0xe642('0x45')];return _0x4b6837;};exports['agentReadyId']=function(_0xe050de){var _0x4d58d9=[];for(var _0x2fda28 in _0xe050de){if(_0xe050de[_0xe642('0x28')](_0x2fda28)){if(!_[_0xe642('0x29')](_0xe050de[_0x2fda28])&&_0xe050de[_0x2fda28][_0xe642('0x33')]===_0xe642('0x60')&&_0xe050de[_0x2fda28][_0xe642('0x61')]===_0xe642('0x62')){_0x4d58d9['push'](_0xe050de[_0x2fda28]['id']);}}}return _0x4d58d9;};exports[_0xe642('0x63')]=function(_0x349ecf){var _0x29f873=moment()[_0xe642('0x64')](0x0);var _0x5a2de0=moment(_0x349ecf)['milliseconds'](0x0);return _0x29f873['diff'](_0x5a2de0,_0xe642('0x7'));};exports[_0xe642('0x65')]=function(_0xd7fe55){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd7fe55[_0xe642('0x19')],'ListId':_0xd7fe55[_0xe642('0x53')],'VoiceQueueId':_0xd7fe55[_0xe642('0x1a')]||undefined,'CampaignId':_0xd7fe55[_0xe642('0x66')]||undefined};};exports[_0xe642('0x67')]=function(_0x44d945){if(_0x44d945===_0xe642('0x45')||_0x44d945===_0xe642('0x68')||_0x44d945===_0xe642('0x5b')||_0x44d945===_0xe642('0x69')||_0x44d945===_0xe642('0x6a')||_0x44d945===_0xe642('0x6b')||_0x44d945===_0xe642('0x3c')||_0x44d945===_0xe642('0x47')||_0x44d945===_0xe642('0x6c')||_0x44d945==='active'||_0x44d945===_0xe642('0x18')||_0x44d945==='scheduledat'||_0x44d945===_0xe642('0x6d')||_0x44d945===_0xe642('0x6e')||_0x44d945==='countnoanswerretry'||_0x44d945===_0xe642('0x6f')||_0x44d945===_0xe642('0x70')||_0x44d945===_0xe642('0x71')||_0x44d945===_0xe642('0x72')||_0x44d945===_0xe642('0x73')||_0x44d945===_0xe642('0x19')||_0x44d945===_0xe642('0x53')||_0x44d945==='UserId'||_0x44d945===_0xe642('0x1a')||_0x44d945===_0xe642('0x74')||_0x44d945===_0xe642('0x75')||_0x44d945===_0xe642('0x76')||_0x44d945===_0xe642('0x77')||_0x44d945==='xmd-listid'||_0x44d945==='xmd-dialurl'||_0x44d945===_0xe642('0x78')||_0x44d945===_0xe642('0x79')||_0x44d945===_0xe642('0x7a')||_0x44d945==='xmd-dialchannel'||_0x44d945===_0xe642('0x7b')||_0x44d945==='xmd-cdrtype'||_0x44d945===_0xe642('0x7c')||_0x44d945===_0xe642('0x7d')||_0x44d945==='xmd-agi'||_0x44d945===_0xe642('0x7e')||_0x44d945===_0xe642('0x7f')||_0x44d945===_0xe642('0x80')||_0x44d945==='rtpaudioqosjitterbridged'||_0x44d945===_0xe642('0x81')||_0x44d945==='rtpaudioqoslossbridged'||_0x44d945==='rtpaudioqosrtt'||_0x44d945===_0xe642('0x82')||_0x44d945===_0xe642('0x7e')||_0x44d945==='rtpaudioqosbridged'||_0x44d945==='rtpaudioqosjitter'||_0x44d945===_0xe642('0x83')||_0x44d945==='rtpaudioqosloss'||_0x44d945==='rtpaudioqoslossbridged'||_0x44d945===_0xe642('0x84')||_0x44d945==='rtpaudioqosrttbridged'||_0x44d945==='bridgepeer'||_0x44d945===_0xe642('0x85')||_0x44d945===_0xe642('0x33')||_0x44d945==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4a3469,_0x137c4c){var _0x5e9ff2,_0x1b3f20,_0x581d73;if(_0x137c4c<=0x0){_0x137c4c=0x1;}_0x5e9ff2=new RegExp('\x5cw{0,'+_0x137c4c+'}$');_0x1b3f20=Math[_0xe642('0x86')](0xa,_0x137c4c-0x1);_0x581d73=Math[_0xe642('0x86')](0xa,_0x137c4c)-0x1;return util['format']('%s',_[_0xe642('0x87')](_0x4a3469,_0x5e9ff2,_[_0xe642('0x88')](_0x1b3f20,_0x581d73)));};exports[_0xe642('0x89')]=function(_0x338640){var _0x1a5563=_0x338640[_0xe642('0x8a')](/"(.*?)"/);return _0x1a5563?_0x1a5563[0x1]:_0x338640;};exports[_0xe642('0x8b')]=function(_0x557600){var _0x3b0700=_0x557600['match'](/<(.*?)>/);return _0x3b0700?_0x3b0700[0x1]:_0x557600;}; \ No newline at end of file +var _0x876c=['Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','active','add','minutes','ContactId','ListId','pTalking','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','motionChannel','voice','agentReadyId','not_inuse','status','reachable','getDiff','diff','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countcongestionretry','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','env','127.0.0.1','milliseconds','seconds','loggerCatch','error','info','inspect','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT'];(function(_0x342594,_0x8f2cc7){var _0x4a08c4=function(_0x6ddde6){while(--_0x6ddde6){_0x342594['push'](_0x342594['shift']());}};_0x4a08c4(++_0x8f2cc7);}(_0x876c,0xe4));var _0xc876=function(_0x1172ea,_0x2a32d7){_0x1172ea=_0x1172ea-0x0;var _0x5945b6=_0x876c[_0x1172ea];return _0x5945b6;};'use strict';var util=require(_0xc876('0x0'));var _=require(_0xc876('0x1'));var moment=require(_0xc876('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xc876('0x3')]['XCALLY_IP_AGI']||_0xc876('0x4');function getSeconds(_0x5ab87d,_0x34a99e){var _0x4a34cc=moment(_0x5ab87d)[_0xc876('0x5')](0x0);var _0x8da04a=moment(_0x34a99e)['milliseconds'](0x0);return _0x4a34cc['diff'](_0x8da04a,_0xc876('0x6'));}exports[_0xc876('0x7')]=function(_0x36070f){return function(_0x27e090){logger[_0xc876('0x8')](_0x36070f,util['inspect'](_0x27e090,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4b52bb,_0x1a4b50){logger[_0xc876('0x9')](_0x4b52bb,util[_0xc876('0xa')](_0x1a4b50,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x31b91d,_0x577d16){logger['error'](_0x31b91d,util['inspect'](_0x577d16,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x743df8){return function(_0x40d7a8){logger[_0xc876('0x9')](_0x743df8,util[_0xc876('0xa')](_0x40d7a8,{'showHidden':![],'depth':null}));};};exports[_0xc876('0xb')]=function(_0x4c3f65,_0x3a4b1a,_0xcd5ec9){return{'message':_0x4c3f65,'unlock':_0x3a4b1a,'active':_0xcd5ec9};};exports[_0xc876('0xc')]=function(_0x2f52ac,_0x222acd,_0x5031e7){if(!_[_0xc876('0xd')](_0x5031e7)&&_0xc876('0xe')===typeof _0x5031e7&&!_[_0xc876('0xf')](_0x5031e7)){if(!_[_0xc876('0xd')](_0x222acd)&&'string'===typeof _0x222acd&&!_[_0xc876('0xf')](_0x222acd)){return util[_0xc876('0x10')](_0xc876('0x11'),_0x222acd,_0x5031e7);}return util[_0xc876('0x10')]('\x22%s\x22\x20<%s>',_0x5031e7,_0x5031e7);}if(!_['isUndefined'](_0x2f52ac)&&'string'===typeof _0x2f52ac&&!_[_0xc876('0xf')](_0x2f52ac)){return _0x2f52ac;}return'\x22\x22\x20<>';};exports[_0xc876('0x12')]=function(_0x2231e5){if(_[_0xc876('0x13')](_0x2231e5)){return![];}return _0x2231e5;};exports['addVariables']=function(_0xbf2972,_0x3eabd5,_0xb9a4ab,_0x4b4472,_0x49b0bb,_0x52dacb){var _0x219703={'XMD-QUEUE':_0x3eabd5[_0xc876('0x14')]?_0x3eabd5[_0xc876('0x14')]['name']:'','XMD-CALLERID':_0x4b4472,'XMD-CALLERID-PREVIEW':_0x52dacb?util[_0xc876('0x10')](_0xc876('0x11'),_0x52dacb['calleridname'],_0x52dacb['calleridnum']):_0x4b4472,'XMD-DIALID':_0x49b0bb,'XMD-CONTACTID':_0x3eabd5['ContactId'],'XMD-CDRTYPE':_0xc876('0x15'),'CALLERID(all)':_0x4b4472,'XMD-VOICEQUEUEID':_0x3eabd5[_0xc876('0x16')],'XMD-DIALCHANNEL':_0xb9a4ab,'XMD-DIALTIMEOUT':_0xbf2972[_0xc876('0x17')]||0x1e,'XMD-DIALOPTIONS':util[_0xc876('0x10')](_0xc876('0x18'),_0xbf2972[_0xc876('0x19')]?'g':'',_[_0xc876('0xf')](_0xbf2972[_0xc876('0x1a')])?'':_0xc876('0x1b')),'XMD-DIALURL':_0xbf2972[_0xc876('0x1c')]||'','XMD-AGI':_0xbf2972[_0xc876('0x1d')]?util[_0xc876('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0xbf2972[_0xc876('0x1d')]):_0xc876('0x1e'),'XMD-AGIAFTER':_0xbf2972[_0xc876('0x19')]?util[_0xc876('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0xbf2972['dialQueueProject2']):_0xc876('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x52dacb?_0x52dacb[_0xc876('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x52dacb?_0x52dacb[_0xc876('0x20')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xc876('0xf')](_0xbf2972[_0xc876('0x1a')])){_0x219703[util['format']('%s',_0xc876('0x21'))]=_0xbf2972[_0xc876('0x1a')];_0x219703[util[_0xc876('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x49b0bb;}if(_0x3eabd5&&_0x3eabd5[_0xc876('0x22')]){for(var _0x38e594 in _0x3eabd5[_0xc876('0x22')]){if(_0x3eabd5[_0xc876('0x22')]['hasOwnProperty'](_0x38e594)){if(!_[_0xc876('0x13')](_0x3eabd5[_0xc876('0x22')][_0x38e594])&&_0x38e594!=='id'&&_0x38e594!==_0xc876('0x23')&&_0x38e594!==_0xc876('0x24')&&_0x38e594!==_0xc876('0x25')){_0x219703[util[_0xc876('0x10')](_0xc876('0x26'),_0xc876('0x27'),_[_0xc876('0x28')](_0x38e594))]=_0x3eabd5['Contact'][_0x38e594];}}}}return _0x219703;};exports['toLowerVariables']=function(_0x567d47){var _0x358f8c={};for(var _0x321fc9 in _0x567d47){if(_0x567d47['hasOwnProperty'](_0x321fc9)){_0x358f8c[util['format']('%s',_['toLower'](_0x321fc9))]=_0x567d47[_0x321fc9];}}return{'variables':_0x358f8c};};exports[_0xc876('0x29')]=function(_0x3abd69,_0x148564){if(!_[_0xc876('0x13')](_0x3abd69)){if(_0x3abd69['hasOwnProperty'](_0xc876('0x2a'))){if(_0x3abd69[_0xc876('0x2a')]>0x0){_0x3abd69['originated']-=0x1;}else{logger[_0xc876('0x8')](_0xc876('0x2b'),_0x148564);}}}else{logger[_0xc876('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x148564);}};exports[_0xc876('0x2c')]=function(_0x11df7b){var _0x50df28=moment()['format'](_0xc876('0x2d'));_0x11df7b[_0xc876('0x2e')]=0xd;_0x11df7b[_0xc876('0x2f')]=_0xc876('0x30');_0x11df7b[_0xc876('0x31')]=_0x50df28;_0x11df7b[_0xc876('0x32')]=_0x50df28;_0x11df7b[_0xc876('0x33')]=_0x50df28;};exports[_0xc876('0x34')]=function(_0x119cb1,_0x4c3656,_0x1d83a3){var _0x126272=moment()[_0xc876('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x119cb1[_0xc876('0x2e')]=_0x4c3656;_0x119cb1['statedesc']=_0x1d83a3;_0x119cb1['responsetime']=_0x126272;_0x119cb1[_0xc876('0x35')]=getSeconds(_0x119cb1[_0xc876('0x32')],_0x119cb1['starttime']);};exports['logLookAgent']=function(_0x27cc64,_0xd9e8ee,_0x37651f){_0x27cc64[_0xc876('0x36')]=_0xd9e8ee;_0x27cc64[_0xc876('0x37')]=_0x37651f;};exports['logCustomer']=function(_0x2bef06,_0x2b9337,_0x168c58){var _0x44e847=moment()[_0xc876('0x10')](_0xc876('0x2d'));_0x2bef06[_0xc876('0x2e')]=_0x2b9337;_0x2bef06['statedesc']=_0x168c58;_0x2bef06[_0xc876('0x32')]=_0x2bef06[_0xc876('0x32')]?_0x2bef06['responsetime']:_0x44e847;_0x2bef06[_0xc876('0x33')]=_0x2bef06[_0xc876('0x33')]?_0x2bef06['endtime']:_0x44e847;_0x2bef06[_0xc876('0x35')]=getSeconds(_0x2bef06[_0xc876('0x32')]||0x0,_0x2bef06[_0xc876('0x31')]||0x0);_0x2bef06[_0xc876('0x38')]=_0x2bef06[_0xc876('0x39')]?getSeconds(_0x2bef06[_0xc876('0x33')],_0x2bef06[_0xc876('0x39')]):0x0;};exports[_0xc876('0x3a')]=function(_0x147e53){return _0x147e53===_0xc876('0x3b');};exports[_0xc876('0x3c')]=function(_0x4db48b,_0x1898ef,_0x5158f9,_0x3a4177,_0x278ddc){var _0x282b31=_0x3a4177?_0xc876('0x3d'):_0x4db48b[_0xc876('0x3e')];_0x282b31=_0x278ddc?_0xc876('0x3f'):_0x282b31;return{'actionid':_0x4db48b[_0xc876('0x40')],'action':'originate','channel':_0x4db48b[_0xc876('0x41')],'callerid':util[_0xc876('0x10')](_0xc876('0x11'),_0x282b31,_0x4db48b[_0xc876('0x42')]),'Exten':'xcally-motion-preview','Context':_0xc876('0x43'),'Priority':'1','variable':_0x5158f9,'timeout':(_0x1898ef[_0xc876('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4db48b[_0xc876('0x40')]};};exports['totalGlobal']=function(_0x3ae337){return _0x3ae337[_0xc876('0x45')]+_0x3ae337['countcongestionretry']+_0x3ae337[_0xc876('0x46')]+_0x3ae337[_0xc876('0x47')]+_0x3ae337['countnosuchnumberretry'];};exports[_0xc876('0x48')]=function(_0x12d9ab){var _0x3376f5=_['clone'](_0x12d9ab);_0x3376f5[_0xc876('0x2e')]=0xf;_0x3376f5['statedesc']=_0xc876('0x49');return _0x3376f5;};exports['scheduledAt']=function(_0x434f01,_0xbd927b,_0xa01059){var _0x1b1990={};_0x1b1990[_0xbd927b]=_0x434f01[_0xbd927b];_0x1b1990[_0xc876('0x4a')]=![];_0x1b1990['scheduledat']=moment()[_0xc876('0x4b')](_0xa01059,_0xc876('0x4c'))[_0xc876('0x10')](_0xc876('0x2d'));_0x1b1990[_0xc876('0x4d')]=_0x434f01[_0xc876('0x4d')];_0x1b1990[_0xc876('0x4e')]=_0x434f01[_0xc876('0x4e')];_0x1b1990[_0xc876('0x16')]=_0x434f01[_0xc876('0x16')]||undefined;return _0x1b1990;};exports['decrementTalkink']=function(_0x37d20c,_0x557dfc){if(!_[_0xc876('0x13')](_0x37d20c)){if(_0x37d20c[_0xc876('0x4f')]>0x0){_0x37d20c[_0xc876('0x4f')]-=0x1;}else{logger['error'](_0x557dfc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xc876('0x8')](_0x557dfc,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc876('0x50')]=function(_0x4e215a){if(_0x4e215a<=0x0){return!![];}return![];};exports[_0xc876('0x51')]=function(_0x4bb5eb,_0xa44b3,_0x3d2819){_0x4bb5eb[_0xc876('0x52')]=_0xa44b3;_0x4bb5eb[_0xc876('0x53')]=_0x4bb5eb[_0xc876('0x54')];_0x4bb5eb[_0xc876('0x55')]=_0x4bb5eb[_0xc876('0x41')];_0x4bb5eb[_0xc876('0x56')]=_0xc876('0x57');if(_0x3d2819){_0x4bb5eb['mandatoryDisposition']=_0x3d2819['mandatoryDisposition'];}return _0x4bb5eb;};exports['buildAcw']=function(_0x376e81){var _0x534024={};_0x534024[_0xc876('0x54')]=_0x376e81[_0xc876('0x54')];_0x534024['interface']=_0x376e81[_0xc876('0x41')];_0x534024[_0xc876('0x40')]=_0x376e81['uniqueid'];return _0x534024;};exports[_0xc876('0x58')]=function(_0x266640){var _0x4f17f1=[];for(var _0x3cf204 in _0x266640){if(_0x266640['hasOwnProperty'](_0x3cf204)){if(!_[_0xc876('0x13')](_0x266640[_0x3cf204])&&_0x266640[_0x3cf204][_0xc876('0x2e')]===_0xc876('0x59')&&_0x266640[_0x3cf204][_0xc876('0x5a')]===_0xc876('0x5b')){_0x4f17f1['push'](_0x266640[_0x3cf204]['id']);}}}return _0x4f17f1;};exports[_0xc876('0x5c')]=function(_0x30244a){var _0x49e265=moment()[_0xc876('0x5')](0x0);var _0x7fa821=moment(_0x30244a)['milliseconds'](0x0);return _0x49e265[_0xc876('0x5d')](_0x7fa821,_0xc876('0x6'));};exports['createBody']=function(_0x28f05e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x28f05e[_0xc876('0x4d')],'ListId':_0x28f05e[_0xc876('0x4e')],'VoiceQueueId':_0x28f05e[_0xc876('0x16')]||undefined,'CampaignId':_0x28f05e[_0xc876('0x5e')]||undefined};};exports[_0xc876('0x5f')]=function(_0x444ba7){if(_0x444ba7==='uniqueid'||_0x444ba7===_0xc876('0x60')||_0x444ba7===_0xc876('0x54')||_0x444ba7===_0xc876('0x61')||_0x444ba7===_0xc876('0x62')||_0x444ba7==='dialAnswer'||_0x444ba7===_0xc876('0x36')||_0x444ba7===_0xc876('0x41')||_0x444ba7==='calleridname'||_0x444ba7==='active'||_0x444ba7===_0xc876('0x42')||_0x444ba7===_0xc876('0x63')||_0x444ba7==='countbusyretry'||_0x444ba7===_0xc876('0x64')||_0x444ba7===_0xc876('0x46')||_0x444ba7==='countglobal'||_0x444ba7===_0xc876('0x65')||_0x444ba7==='callbackuniqueid'||_0x444ba7===_0xc876('0x66')||_0x444ba7===_0xc876('0x67')||_0x444ba7===_0xc876('0x4d')||_0x444ba7===_0xc876('0x4e')||_0x444ba7===_0xc876('0x37')||_0x444ba7===_0xc876('0x16')||_0x444ba7===_0xc876('0x68')||_0x444ba7===_0xc876('0x69')||_0x444ba7===_0xc876('0x6a')||_0x444ba7===_0xc876('0x6b')||_0x444ba7==='xmd-listid'||_0x444ba7==='xmd-dialurl'||_0x444ba7===_0xc876('0x6c')||_0x444ba7===_0xc876('0x6d')||_0x444ba7===_0xc876('0x6e')||_0x444ba7==='xmd-dialchannel'||_0x444ba7===_0xc876('0x6f')||_0x444ba7==='xmd-cdrtype'||_0x444ba7===_0xc876('0x70')||_0x444ba7===_0xc876('0x71')||_0x444ba7===_0xc876('0x72')||_0x444ba7===_0xc876('0x73')||_0x444ba7===_0xc876('0x74')||_0x444ba7===_0xc876('0x75')||_0x444ba7===_0xc876('0x76')||_0x444ba7===_0xc876('0x77')||_0x444ba7==='rtpaudioqoslossbridged'||_0x444ba7===_0xc876('0x78')||_0x444ba7===_0xc876('0x79')||_0x444ba7===_0xc876('0x73')||_0x444ba7===_0xc876('0x74')||_0x444ba7==='rtpaudioqosjitter'||_0x444ba7===_0xc876('0x76')||_0x444ba7===_0xc876('0x77')||_0x444ba7==='rtpaudioqoslossbridged'||_0x444ba7==='rtpaudioqosrtt'||_0x444ba7===_0xc876('0x79')||_0x444ba7===_0xc876('0x7a')||_0x444ba7===_0xc876('0x7b')||_0x444ba7===_0xc876('0x2e')||_0x444ba7===_0xc876('0x2f')){return![];}return!![];};exports[_0xc876('0x7c')]=function(_0x546c26,_0x123484){var _0x47ceb7,_0x4aeff7,_0x21fa18;if(_0x123484<=0x0){_0x123484=0x1;}_0x47ceb7=new RegExp(_0xc876('0x7d')+_0x123484+'}$');_0x4aeff7=Math[_0xc876('0x7e')](0xa,_0x123484-0x1);_0x21fa18=Math[_0xc876('0x7e')](0xa,_0x123484)-0x1;return util['format']('%s',_[_0xc876('0x7f')](_0x546c26,_0x47ceb7,_[_0xc876('0x80')](_0x4aeff7,_0x21fa18)));};exports[_0xc876('0x81')]=function(_0x4dffbb){var _0x1a6197=_0x4dffbb[_0xc876('0x82')](/"(.*?)"/);return _0x1a6197?_0x1a6197[0x1]:_0x4dffbb;};exports['extractCalleridNumber']=function(_0x18f9ec){var _0x2980d2=_0x18f9ec[_0xc876('0x82')](/<(.*?)>/);return _0x2980d2?_0x2980d2[0x1]:_0x18f9ec;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 14fadb1..b9b8e64 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 _0xafcc=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x315610,_0x88b51e){var _0x3ebec0=function(_0x14ef8a){while(--_0x14ef8a){_0x315610['push'](_0x315610['shift']());}};_0x3ebec0(++_0x88b51e);}(_0xafcc,0xa1));var _0xcafc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafcc[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xcafc('0x0')]={'queue':{'type':_0xcafc('0x1'),'required':!![]},'interface':{'type':_0xcafc('0x1'),'required':!![]},'membername':{'type':_0xcafc('0x1'),'required':!![]},'penalty':{'type':_0xcafc('0x2'),'required':![]},'paused':{'type':_0xcafc('0x3'),'required':![]}};exports[_0xcafc('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xcafc('0x1'),'required':!![]}};exports[_0xcafc('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xcafc('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xcafc('0x6')]={'uniqueid':{'type':_0xcafc('0x1'),'required':!![]}};exports[_0xcafc('0x7')]={'uniqueid':{'type':_0xcafc('0x1'),'required':!![]},'filename':{'type':_0xcafc('0x1')},'format':{'type':_0xcafc('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xcafc('0x8')]={'uniqueid':{'type':_0xcafc('0x1'),'required':!![]}};exports[_0xcafc('0x9')]={'uniqueid':{'type':_0xcafc('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xcafc('0x1')}}; \ No newline at end of file +var _0x8625=['string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8625,0x90));var _0x5862=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x8625[_0x5235a6];return _0x1cf37e;};'use strict';exports['queueadd']={'queue':{'type':_0x5862('0x0'),'required':!![]},'interface':{'type':_0x5862('0x0'),'required':!![]},'membername':{'type':_0x5862('0x0'),'required':!![]},'penalty':{'type':_0x5862('0x1'),'required':![]},'paused':{'type':_0x5862('0x2'),'required':![]}};exports[_0x5862('0x3')]={'queue':{'type':_0x5862('0x0'),'required':!![]},'interface':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x4')]={'interface':{'type':_0x5862('0x0'),'required':!![]},'paused':{'type':_0x5862('0x2')},'reason':{'type':_0x5862('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x5862('0x0'),'required':![]}};exports[_0x5862('0x5')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5862('0x0')},'format':{'type':_0x5862('0x0')},'mixmonitorid':{'type':_0x5862('0x0')}};exports[_0x5862('0x7')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x8')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]},'exten':{'type':_0x5862('0x0'),'required':!![]},'context':{'type':_0x5862('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7893815..4104787 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 _0xca87=['voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initVoiceQueueReports','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','merge','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates'];(function(_0x29f1bb,_0x10ca68){var _0x15c0e5=function(_0x570613){while(--_0x570613){_0x29f1bb['push'](_0x29f1bb['shift']());}};_0x15c0e5(++_0x10ca68);}(_0xca87,0x193));var _0x7ca8=function(_0x2de123,_0xc380d0){_0x2de123=_0x2de123-0x0;var _0x2256d3=_0xca87[_0x2de123];return _0x2256d3;};'use strict';var BPromise=require(_0x7ca8('0x0'));var util=require(_0x7ca8('0x1'));var _=require(_0x7ca8('0x2'));var moment=require(_0x7ca8('0x3'));var Agent=require(_0x7ca8('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x7ca8('0x5'));var VoiceQueue=require(_0x7ca8('0x6'));var Trigger=require(_0x7ca8('0x7'));var Template=require('../model/template');var Campaign=require(_0x7ca8('0x8'));var VoiceExtension=require(_0x7ca8('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x7ca8('0xa'));var FreshdeskAccount=require(_0x7ca8('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x7ca8('0xc'));var DeskAccount=require(_0x7ca8('0xd'));var VtigerAccount=require(_0x7ca8('0xe'));var ServicenowAccount=require(_0x7ca8('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x7ca8('0x10'));var FaxAccount=require(_0x7ca8('0x11'));var Realtime=function(){this[_0x7ca8('0x12')]={};this[_0x7ca8('0x13')]={};this[_0x7ca8('0x14')]={};this[_0x7ca8('0x15')]={};this[_0x7ca8('0x16')]={};this[_0x7ca8('0x17')]={};this[_0x7ca8('0x18')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7ca8('0x19')]={};this[_0x7ca8('0x1a')]={};this[_0x7ca8('0x1b')]={};this[_0x7ca8('0x1c')]={};this[_0x7ca8('0x1d')]={};this[_0x7ca8('0x1e')]={};this[_0x7ca8('0x1f')]={};this[_0x7ca8('0x20')]={};this['sugarcrmAccounts']={};this[_0x7ca8('0x21')]={};this[_0x7ca8('0x22')]={};this[_0x7ca8('0x23')]={};this['vtigerAccounts']={};this[_0x7ca8('0x24')]={};this[_0x7ca8('0x25')]={};this[_0x7ca8('0x26')]={};this[_0x7ca8('0x27')]={};};function freeIsNotKey(_0x507cb1,_0x3a899e,_0x5523d0){var _0x2145ef=_[_0x7ca8('0x28')](_0x507cb1,function(_0x2ecaf6,_0x1767cc){return _0x2ecaf6[_0x5523d0];});for(var _0x50feb4 in _0x3a899e){if(_0x3a899e[_0x7ca8('0x29')](_0x50feb4)){if(!_0x2145ef[_0x50feb4]){delete _0x3a899e[_0x50feb4];}}}}function freeIsNotKeySip(_0x2f5d1b,_0x755b56){var _0x54cb24=_['mapKeys'](_0x2f5d1b,function(_0x55bfca,_0x326880){return util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0x55bfca[_0x7ca8('0x2c')]);});for(var _0x1d77b6 in _0x755b56){if(_0x755b56[_0x7ca8('0x29')](_0x1d77b6)){if(!_0x54cb24[_0x1d77b6]){delete _0x755b56[_0x1d77b6];}}}}function freeIsNotKeyAgent(_0x2ad85e,_0x32e8f2){var _0x41c5a5=_[_0x7ca8('0x28')](_0x2ad85e,function(_0x16ad44,_0x3ef2eb){var _0x20ab62=_['isNil'](_0x16ad44['interface'])?util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0x16ad44[_0x7ca8('0x2c')]):_0x16ad44['interface'];return _0x20ab62;});for(var _0x345e86 in _0x32e8f2){if(_0x32e8f2[_0x7ca8('0x29')](_0x345e86)){if(!_0x41c5a5[_0x345e86]){delete _0x32e8f2[_0x345e86];}}}}function clearVoiceCallReports(_0x3c2745){_0x3c2745[_0x7ca8('0x2d')]=0x0;_0x3c2745[_0x7ca8('0x2e')]=0x0;_0x3c2745['sumHoldTime']=0x0;_0x3c2745[_0x7ca8('0x2f')]=0x0;_0x3c2745[_0x7ca8('0x30')]=0x0;}function clearCampaigns(_0x268821){if(!_[_0x7ca8('0x31')](_0x268821)){for(var _0x29f080 in _0x268821){if(_0x268821[_0x7ca8('0x29')](_0x29f080)){_0x268821[_0x29f080][_0x7ca8('0x32')]=0x0;_0x268821[_0x29f080][_0x7ca8('0x33')]=0x0;}}}}function clearVoiceQueues(_0x2ceeee){if(!_[_0x7ca8('0x31')](_0x2ceeee)){for(var _0x575ec9 in _0x2ceeee){if(_0x2ceeee[_0x7ca8('0x29')](_0x575ec9)){_0x2ceeee[_0x575ec9][_0x7ca8('0x2d')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x2e')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x34')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x35')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x36')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x2f')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x30')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x37')]=0x0;_0x2ceeee[_0x575ec9]['outboundNoAnswerCallsDay']=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x38')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x39')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3a')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3b')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3c')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3d')]=0x0;_0x2ceeee[_0x575ec9]['outboundBlacklistCallsDay']=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3e')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x3f')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x40')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x37')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x41')]=0x0;_0x2ceeee[_0x575ec9][_0x7ca8('0x42')]=!![];}}}}Realtime[_0x7ca8('0x43')]['mergeFromDatabase']=function(_0x112395,_0x592bd2){for(var _0x421ff8 in _0x592bd2){if(_0x112395[_0x7ca8('0x29')](_0x421ff8)){_0x112395[_0x421ff8]=_0x592bd2[_0x421ff8];}}};Realtime[_0x7ca8('0x43')]['initAgents']=function(){var _0x2aec1a=this;return function(_0x24107c){if(_0x24107c){freeIsNotKeyAgent(_0x24107c,_0x2aec1a[_0x7ca8('0x12')]);for(var _0x4fbd90=0x0,_0xcd5d8c={},_0x4511ef={};_0x4fbd90<_0x24107c[_0x7ca8('0x44')];_0x4fbd90+=0x1){_0xcd5d8c=_0x24107c[_0x4fbd90];var _0x414843=_[_0x7ca8('0x45')](_0xcd5d8c['interface'])?util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0xcd5d8c[_0x7ca8('0x2c')]):_0xcd5d8c['interface'];if(_[_0x7ca8('0x46')](_0x2aec1a['agents'][_0x414843])){_0x2aec1a[_0x7ca8('0x12')][_0x414843]=new Agent(_0xcd5d8c);}else{_0x2aec1a[_0x7ca8('0x47')](_0x2aec1a[_0x7ca8('0x12')][_0x414843],_0xcd5d8c);}}}return _0x2aec1a[_0x7ca8('0x12')];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x48')]=function(){var _0x2590cf=this;return function(_0x28a0dc){if(_0x28a0dc){freeIsNotKeySip(_0x28a0dc,_0x2590cf['telephones']);for(var _0x1214ee=0x0,_0x43fe7f={},_0x42fef5={};_0x1214ee<_0x28a0dc['length'];_0x1214ee+=0x1){_0x43fe7f=_0x28a0dc[_0x1214ee];if(_[_0x7ca8('0x46')](_0x2590cf[_0x7ca8('0x13')][util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0x43fe7f[_0x7ca8('0x2c')])])){_0x2590cf[_0x7ca8('0x13')][util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0x43fe7f[_0x7ca8('0x2c')])]=new Telephone(_0x43fe7f);}else{_0x2590cf[_0x7ca8('0x47')](_0x2590cf['telephones'][util[_0x7ca8('0x2a')]('SIP/%s',_0x43fe7f[_0x7ca8('0x2c')])],_0x43fe7f);}}}return _0x2590cf['telephones'];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x49')]=function(){var _0x503d14=this;return function(_0x1f96b4){if(_0x1f96b4){freeIsNotKeySip(_0x1f96b4,_0x503d14[_0x7ca8('0x14')]);for(var _0x4e3265=0x0,_0x309b68={},_0x111e9c={};_0x4e3265<_0x1f96b4[_0x7ca8('0x44')];_0x4e3265+=0x1){_0x309b68=_0x1f96b4[_0x4e3265];if(_[_0x7ca8('0x46')](_0x503d14[_0x7ca8('0x14')][util['format'](_0x7ca8('0x2b'),_0x309b68[_0x7ca8('0x2c')])])){_0x503d14[_0x7ca8('0x14')][util['format']('SIP/%s',_0x309b68[_0x7ca8('0x2c')])]=new Trunk(_0x309b68);}else{_0x503d14[_0x7ca8('0x47')](_0x503d14[_0x7ca8('0x14')][util[_0x7ca8('0x2a')](_0x7ca8('0x2b'),_0x309b68[_0x7ca8('0x2c')])],_0x309b68);}}}return _0x503d14['trunks'];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x4a')]=function(){var _0x1740fd=this;return function(_0x5767b5){if(_0x5767b5){freeIsNotKey(_0x5767b5,_0x1740fd[_0x7ca8('0x15')],_0x7ca8('0x2c'));for(var _0x12398b=0x0,_0xb98374={},_0x20d118={};_0x12398b<_0x5767b5[_0x7ca8('0x44')];_0x12398b+=0x1){_0xb98374=_0x5767b5[_0x12398b];if(_['isUndefined'](_0x1740fd['voiceQueues'][_0xb98374[_0x7ca8('0x2c')]])){_0x1740fd[_0x7ca8('0x15')][_0xb98374['name']]=new VoiceQueue(_0xb98374);}else{_0x1740fd[_0x7ca8('0x47')](_0x1740fd[_0x7ca8('0x15')][_0xb98374[_0x7ca8('0x2c')]],_0xb98374);}}}return _0x1740fd[_0x7ca8('0x15')];};};Realtime['prototype'][_0x7ca8('0x4b')]=function(){var _0x3ae2e2=this;return function(_0x523145){if(_0x523145){freeIsNotKey(_0x523145,_0x3ae2e2[_0x7ca8('0x16')],'id');for(var _0x13f474=0x0,_0x5c2479={},_0x339133={};_0x13f474<_0x523145[_0x7ca8('0x44')];_0x13f474+=0x1){_0x5c2479=_0x523145[_0x13f474];if(_[_0x7ca8('0x46')](_0x3ae2e2[_0x7ca8('0x16')][_0x5c2479['id']])){_0x3ae2e2[_0x7ca8('0x16')][_0x5c2479['id']]=new Trigger(_0x5c2479);}else{_0x3ae2e2[_0x7ca8('0x47')](_0x3ae2e2[_0x7ca8('0x16')][_0x5c2479['id']],_0x5c2479);}}}return _0x3ae2e2['triggers'];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x4c')]=function(){var _0x40c0d9=this;return function(_0x37d2d2){if(_0x37d2d2){freeIsNotKey(_0x37d2d2,_0x40c0d9[_0x7ca8('0x18')],'id');for(var _0x3eea6a=0x0,_0xec6f35={},_0x246666={};_0x3eea6a<_0x37d2d2[_0x7ca8('0x44')];_0x3eea6a+=0x1){_0xec6f35=_0x37d2d2[_0x3eea6a];if(_[_0x7ca8('0x46')](_0x40c0d9[_0x7ca8('0x18')][_0xec6f35['id']])){_0x40c0d9['templates'][_0xec6f35['id']]=new Template(_0xec6f35);}else{_0x40c0d9[_0x7ca8('0x47')](_0x40c0d9[_0x7ca8('0x18')][_0xec6f35['id']],_0xec6f35);}}}return _0x40c0d9[_0x7ca8('0x18')];};};Realtime['prototype'][_0x7ca8('0x4d')]=function(){var _0x1288f3=this;return function(_0x54806a){if(_0x54806a){freeIsNotKey(_0x54806a,_0x1288f3[_0x7ca8('0x1f')],'id');for(var _0x167f65=0x0,_0xb388a4={},_0x1700c5={};_0x167f65<_0x54806a['length'];_0x167f65+=0x1){_0xb388a4=_0x54806a[_0x167f65];if(_[_0x7ca8('0x46')](_0x1288f3[_0x7ca8('0x1f')][_0xb388a4['id']])){_0x1288f3[_0x7ca8('0x1f')][_0xb388a4['id']]=new ZendeskAccount(_0xb388a4);}else{_0x1288f3[_0x7ca8('0x47')](_0x1288f3[_0x7ca8('0x1f')][_0xb388a4['id']],_0xb388a4);}}}return _0x1288f3[_0x7ca8('0x1f')];};};Realtime['prototype'][_0x7ca8('0x4e')]=function(){var _0x35a710=this;return function(_0x445112){if(_0x445112){freeIsNotKey(_0x445112,_0x35a710[_0x7ca8('0x20')],'id');for(var _0x376367=0x0,_0x116e66={},_0x5175ae={};_0x376367<_0x445112['length'];_0x376367+=0x1){_0x116e66=_0x445112[_0x376367];if(_[_0x7ca8('0x46')](_0x35a710[_0x7ca8('0x20')][_0x116e66['id']])){_0x35a710[_0x7ca8('0x20')][_0x116e66['id']]=new SalesforceAccount(_0x116e66);}else{_0x35a710[_0x7ca8('0x47')](_0x35a710[_0x7ca8('0x20')][_0x116e66['id']],_0x116e66);}}}return _0x35a710[_0x7ca8('0x20')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x39affd=this;return function(_0x236580){if(_0x236580){freeIsNotKey(_0x236580,_0x39affd[_0x7ca8('0x21')],'id');for(var _0x758f5a=0x0,_0x1e2d06={},_0x20cb41={};_0x758f5a<_0x236580[_0x7ca8('0x44')];_0x758f5a+=0x1){_0x1e2d06=_0x236580[_0x758f5a];if(_['isUndefined'](_0x39affd[_0x7ca8('0x21')][_0x1e2d06['id']])){_0x39affd['freshdeskAccounts'][_0x1e2d06['id']]=new FreshdeskAccount(_0x1e2d06);}else{_0x39affd[_0x7ca8('0x47')](_0x39affd['freshdeskAccounts'][_0x1e2d06['id']],_0x1e2d06);}}}return _0x39affd[_0x7ca8('0x21')];};};Realtime[_0x7ca8('0x43')]['initZohoAccounts']=function(){var _0x4991c2=this;return function(_0xed946){if(_0xed946){freeIsNotKey(_0xed946,_0x4991c2[_0x7ca8('0x22')],'id');for(var _0x51d046=0x0,_0x4781a1={},_0x308185={};_0x51d046<_0xed946[_0x7ca8('0x44')];_0x51d046+=0x1){_0x4781a1=_0xed946[_0x51d046];if(_[_0x7ca8('0x46')](_0x4991c2[_0x7ca8('0x22')][_0x4781a1['id']])){_0x4991c2['zohoAccounts'][_0x4781a1['id']]=new ZohoAccount(_0x4781a1);}else{_0x4991c2[_0x7ca8('0x47')](_0x4991c2['zohoAccounts'][_0x4781a1['id']],_0x4781a1);}}}return _0x4991c2[_0x7ca8('0x22')];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x4f')]=function(){var _0x59135f=this;return function(_0x1d9bcb){if(_0x1d9bcb){freeIsNotKey(_0x1d9bcb,_0x59135f[_0x7ca8('0x23')],'id');for(var _0x38bf3c=0x0,_0x59401d={},_0x2f7cb2={};_0x38bf3c<_0x1d9bcb[_0x7ca8('0x44')];_0x38bf3c+=0x1){_0x59401d=_0x1d9bcb[_0x38bf3c];if(_[_0x7ca8('0x46')](_0x59135f[_0x7ca8('0x23')][_0x59401d['id']])){_0x59135f[_0x7ca8('0x23')][_0x59401d['id']]=new DeskAccount(_0x59401d);}else{_0x59135f[_0x7ca8('0x47')](_0x59135f[_0x7ca8('0x23')][_0x59401d['id']],_0x59401d);}}}return _0x59135f[_0x7ca8('0x23')];};};Realtime[_0x7ca8('0x43')]['initSugarcrmAccounts']=function(){var _0x66e525=this;return function(_0x1f4548){if(_0x1f4548){freeIsNotKey(_0x1f4548,_0x66e525[_0x7ca8('0x50')],'id');for(var _0x2b9252=0x0,_0x5720ea={},_0x4e9349={};_0x2b9252<_0x1f4548[_0x7ca8('0x44')];_0x2b9252+=0x1){_0x5720ea=_0x1f4548[_0x2b9252];if(_['isUndefined'](_0x66e525[_0x7ca8('0x50')][_0x5720ea['id']])){_0x66e525[_0x7ca8('0x50')][_0x5720ea['id']]=new SugarcrmAccount(_0x5720ea);}else{_0x66e525['mergeFromDatabase'](_0x66e525['sugarcrmAccounts'][_0x5720ea['id']],_0x5720ea);}}}return _0x66e525[_0x7ca8('0x50')];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x51')]=function(){var _0x5830cb=this;return function(_0x21874a){if(_0x21874a){freeIsNotKey(_0x21874a,_0x5830cb[_0x7ca8('0x52')],'id');for(var _0x349e38=0x0,_0x454b86={},_0x5deba6={};_0x349e38<_0x21874a[_0x7ca8('0x44')];_0x349e38+=0x1){_0x454b86=_0x21874a[_0x349e38];if(_[_0x7ca8('0x46')](_0x5830cb['vtigerAccounts'][_0x454b86['id']])){_0x5830cb[_0x7ca8('0x52')][_0x454b86['id']]=new VtigerAccount(_0x454b86);}else{_0x5830cb[_0x7ca8('0x47')](_0x5830cb[_0x7ca8('0x52')][_0x454b86['id']],_0x454b86);}}}return _0x5830cb['vtigerAccounts'];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x53')]=function(){var _0x496746=this;return function(_0x4a21a2){if(_0x4a21a2){freeIsNotKey(_0x4a21a2,_0x496746[_0x7ca8('0x24')],'id');for(var _0x545ab2=0x0,_0x27f3e9={},_0x86af07={};_0x545ab2<_0x4a21a2['length'];_0x545ab2+=0x1){_0x27f3e9=_0x4a21a2[_0x545ab2];if(_[_0x7ca8('0x46')](_0x496746[_0x7ca8('0x24')][_0x27f3e9['id']])){_0x496746['servicenowAccounts'][_0x27f3e9['id']]=new ServicenowAccount(_0x27f3e9);}else{_0x496746[_0x7ca8('0x47')](_0x496746[_0x7ca8('0x24')][_0x27f3e9['id']],_0x27f3e9);}}}return _0x496746[_0x7ca8('0x24')];};};Realtime[_0x7ca8('0x43')]['initDynamics365Accounts']=function(){var _0x3bc862=this;return function(_0x178008){if(_0x178008){freeIsNotKey(_0x178008,_0x3bc862['dynamics365Accounts'],'id');for(var _0x1a16bb=0x0,_0x54afa3={},_0x458cd5={};_0x1a16bb<_0x178008[_0x7ca8('0x44')];_0x1a16bb+=0x1){_0x54afa3=_0x178008[_0x1a16bb];if(_[_0x7ca8('0x46')](_0x3bc862[_0x7ca8('0x25')][_0x54afa3['id']])){_0x3bc862[_0x7ca8('0x25')][_0x54afa3['id']]=new Dynamics365Account(_0x54afa3);}else{_0x3bc862['mergeFromDatabase'](_0x3bc862[_0x7ca8('0x25')][_0x54afa3['id']],_0x54afa3);}}}return _0x3bc862[_0x7ca8('0x25')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x5a5614=this;return function(_0x5edfc1){if(_0x5edfc1){freeIsNotKey(_0x5edfc1,_0x5a5614[_0x7ca8('0x26')],'id');for(var _0x2cb510=0x0,_0x487bd6={},_0xc822ee={};_0x2cb510<_0x5edfc1[_0x7ca8('0x44')];_0x2cb510+=0x1){_0x487bd6=_0x5edfc1[_0x2cb510];if(_['isUndefined'](_0x5a5614['freshsalesAccounts'][_0x487bd6['id']])){_0x5a5614[_0x7ca8('0x26')][_0x487bd6['id']]=new FreshsalesAccount(_0x487bd6);}else{_0x5a5614[_0x7ca8('0x47')](_0x5a5614[_0x7ca8('0x26')][_0x487bd6['id']],_0x487bd6);}}}return _0x5a5614[_0x7ca8('0x26')];};};Realtime[_0x7ca8('0x43')]['initVoiceQueueHopperHistory']=function(){var _0x327b9c=this;return function(_0x3d8b33){for(var _0x57ef1e=0x0;_0x57ef1e<_0x3d8b33['length'];_0x57ef1e+=0x1){_['merge'](_0x327b9c[_0x7ca8('0x15')][_0x3d8b33[_0x57ef1e]['name']],_0x3d8b33[_0x57ef1e]);}return _0x327b9c[_0x7ca8('0x15')];};};Realtime['prototype'][_0x7ca8('0x54')]=function(){var _0x32b97b=this;return function(_0x5121ea){clearVoiceQueues(_0x32b97b[_0x7ca8('0x15')]);if(_0x5121ea){_0x5121ea=_['groupBy'](_0x5121ea,_0x7ca8('0x55'));for(var _0x43b08c in _0x5121ea){if(_0x5121ea[_0x7ca8('0x29')](_0x43b08c)){var _0x56e5ed={};for(var _0x5c90b4=0x0;_0x5c90b4<_0x5121ea[_0x43b08c][_0x7ca8('0x44')];_0x5c90b4+=0x1){var _0x4b68ab=_0x5121ea[_0x43b08c][_0x5c90b4]['queue'];if(_0x32b97b[_0x7ca8('0x15')][_0x4b68ab]){if(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x56')]){_0x32b97b[_0x7ca8('0x15')][_0x4b68ab][_0x7ca8('0x34')]+=0x1;}if(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x57')]){_0x32b97b[_0x7ca8('0x15')][_0x4b68ab][_0x7ca8('0x35')]+=0x1;}_0x32b97b['voiceQueues'][_0x4b68ab]['sumHoldTime']+=moment(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x58')])[_0x7ca8('0x59')](moment(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5a')]),_0x7ca8('0x5b'))||0x0;if(_0x5c90b4===_0x5121ea[_0x43b08c][_0x7ca8('0x44')]-0x1){_0x32b97b[_0x7ca8('0x15')][_0x4b68ab][_0x7ca8('0x2f')]+=moment(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5c')]||_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5d')]||_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5e')])[_0x7ca8('0x59')](moment(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5a')]),_0x7ca8('0x5b'))||0x0;_0x32b97b[_0x7ca8('0x15')][_0x4b68ab][_0x7ca8('0x2d')]+=0x1;if(_0x5121ea[_0x43b08c][_0x5c90b4]['queuecallercomplete']){_0x32b97b[_0x7ca8('0x15')][_0x4b68ab][_0x7ca8('0x2e')]+=0x1;_0x32b97b[_0x7ca8('0x15')][_0x4b68ab]['sumBillable']+=moment(_0x5121ea[_0x43b08c][_0x5c90b4][_0x7ca8('0x5c')])[_0x7ca8('0x59')](moment(_0x5121ea[_0x43b08c][_0x5c90b4]['queuecallerleaveAt']),_0x7ca8('0x5b'))||0x0;}}else{_0x32b97b['voiceQueues'][_0x4b68ab][_0x7ca8('0x2f')]+=_0x32b97b['voiceQueues'][_0x4b68ab][_0x7ca8('0x36')]||0x0;}}}}}}return _0x32b97b[_0x7ca8('0x15')];};};Realtime['prototype'][_0x7ca8('0x5f')]=function(){var _0x735360=this;return function(_0x43365c){clearVoiceCallReports(_0x735360[_0x7ca8('0x60')]);if(_0x43365c){for(var _0x50b03c=0x0;_0x50b03c<_0x43365c[_0x7ca8('0x44')];_0x50b03c+=0x1){_0x735360['outbound'][_0x7ca8('0x2d')]+=0x1;_0x735360[_0x7ca8('0x60')][_0x7ca8('0x2f')]+=_0x43365c[_0x50b03c]['duration'];if(_0x43365c[_0x50b03c][_0x7ca8('0x61')]===_0x7ca8('0x62')){_0x735360[_0x7ca8('0x60')][_0x7ca8('0x2e')]+=0x1;_0x735360[_0x7ca8('0x60')][_0x7ca8('0x36')]+=_0x43365c[_0x50b03c][_0x7ca8('0x63')]-_0x43365c[_0x50b03c][_0x7ca8('0x64')]||0x0;_0x735360[_0x7ca8('0x60')][_0x7ca8('0x30')]+=_0x43365c[_0x50b03c]['billableseconds'];}}}return _0x735360[_0x7ca8('0x60')];};};Realtime['prototype'][_0x7ca8('0x65')]=function(){var _0xe9e64c=this;return function(_0x54e07e){if(_0x54e07e){freeIsNotKey(_0x54e07e,_0xe9e64c['campaigns'],_0x7ca8('0x2c'));for(var _0x243aab=0x0,_0x263f23={};_0x243aab<_0x54e07e[_0x7ca8('0x44')];_0x243aab+=0x1){_0x263f23=_0x54e07e[_0x243aab];if(_['isUndefined'](_0xe9e64c[_0x7ca8('0x17')][_0x263f23[_0x7ca8('0x2c')]])){_0xe9e64c['campaigns'][_0x263f23[_0x7ca8('0x2c')]]=new Campaign(_0x263f23);}else{_0xe9e64c[_0x7ca8('0x47')](_0xe9e64c[_0x7ca8('0x17')][_0x263f23[_0x7ca8('0x2c')]],_0x263f23);_0xe9e64c[_0x7ca8('0x17')][_0x263f23[_0x7ca8('0x2c')]][_0x7ca8('0x66')]=_0x263f23[_0x7ca8('0x67')]?_0x263f23[_0x7ca8('0x67')][_0x7ca8('0x2c')]:undefined;}}}return _0xe9e64c[_0x7ca8('0x17')];};};Realtime[_0x7ca8('0x43')][_0x7ca8('0x68')]=function(){var _0x58ffce=this;return function(_0x18a328){if(_0x18a328){freeIsNotKey(_0x18a328,_0x58ffce[_0x7ca8('0x19')],'id');for(var _0x491790=0x0,_0x52b12a={};_0x491790<_0x18a328[_0x7ca8('0x44')];_0x491790+=0x1){_0x52b12a=_0x18a328[_0x491790];if(_[_0x7ca8('0x46')](_0x58ffce['voiceExtensions'][_0x52b12a['id']])){_0x58ffce[_0x7ca8('0x19')][_0x52b12a['id']]=new VoiceExtension(_0x52b12a);}else{_0x58ffce[_0x7ca8('0x47')](_0x58ffce[_0x7ca8('0x19')][_0x52b12a['id']],_0x52b12a);}}}return _0x58ffce['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x3cd960=this;return function(_0x44bb6e){clearCampaigns(_0x3cd960['campaigns']);for(var _0x217762=0x0;_0x217762<_0x44bb6e['length'];_0x217762+=0x1){_[_0x7ca8('0x69')](_0x3cd960[_0x7ca8('0x17')][_0x44bb6e[_0x217762][_0x7ca8('0x2c')]],_0x44bb6e[_0x217762]);}return _0x3cd960[_0x7ca8('0x17')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0xf7d9e0=this;return function(_0x26b2ed){if(_0x26b2ed){freeIsNotKey(_0x26b2ed,_0xf7d9e0['faxAccounts'],'id');for(var _0x326f1f=0x0,_0x724787={},_0x44615e={};_0x326f1f<_0x26b2ed[_0x7ca8('0x44')];_0x326f1f+=0x1){_0x724787=_0x26b2ed[_0x326f1f];if(_['isUndefined'](_0xf7d9e0[_0x7ca8('0x27')][_0x724787['id']])){_0xf7d9e0['faxAccounts'][_0x724787['id']]=new FaxAccount(_0x724787);}else{_0xf7d9e0[_0x7ca8('0x47')](_0xf7d9e0['faxAccounts'][_0x724787['id']],_0x724787);}}}return _0xf7d9e0[_0x7ca8('0x27')];};};module[_0x7ca8('0x6a')]=Realtime; \ No newline at end of file +var _0x6f2e=['queue','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','agents','length','isUndefined','initTelephones','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid'];(function(_0x13e9b0,_0x454fe9){var _0x28aca2=function(_0x510d77){while(--_0x510d77){_0x13e9b0['push'](_0x13e9b0['shift']());}};_0x28aca2(++_0x454fe9);}(_0x6f2e,0x7f));var _0xe6f2=function(_0x278e69,_0x1b80ef){_0x278e69=_0x278e69-0x0;var _0x4e9595=_0x6f2e[_0x278e69];return _0x4e9595;};'use strict';var BPromise=require(_0xe6f2('0x0'));var util=require(_0xe6f2('0x1'));var _=require(_0xe6f2('0x2'));var moment=require(_0xe6f2('0x3'));var Agent=require(_0xe6f2('0x4'));var Telephone=require(_0xe6f2('0x5'));var Trunk=require(_0xe6f2('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xe6f2('0x7'));var Campaign=require(_0xe6f2('0x8'));var VoiceExtension=require(_0xe6f2('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xe6f2('0xa'));var FreshdeskAccount=require(_0xe6f2('0xb'));var SugarcrmAccount=require(_0xe6f2('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xe6f2('0xd'));var VtigerAccount=require(_0xe6f2('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xe6f2('0xf'));var FreshsalesAccount=require(_0xe6f2('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xe6f2('0x11')]={};this[_0xe6f2('0x12')]={};this[_0xe6f2('0x13')]={};this[_0xe6f2('0x14')]={};this['campaigns']={};this[_0xe6f2('0x15')]={};this[_0xe6f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xe6f2('0x17')]={};this[_0xe6f2('0x18')]={};this[_0xe6f2('0x19')]={};this['timers']={};this['settings']={};this[_0xe6f2('0x1a')]={};this[_0xe6f2('0x1b')]={};this[_0xe6f2('0x1c')]={};this['freshdeskAccounts']={};this[_0xe6f2('0x1d')]={};this[_0xe6f2('0x1e')]={};this[_0xe6f2('0x1f')]={};this['servicenowAccounts']={};this[_0xe6f2('0x20')]={};this[_0xe6f2('0x21')]={};this[_0xe6f2('0x22')]={};};function freeIsNotKey(_0x352616,_0x5c3fec,_0x466fc1){var _0x459945=_[_0xe6f2('0x23')](_0x352616,function(_0xa911c4,_0x31a027){return _0xa911c4[_0x466fc1];});for(var _0x47beee in _0x5c3fec){if(_0x5c3fec[_0xe6f2('0x24')](_0x47beee)){if(!_0x459945[_0x47beee]){delete _0x5c3fec[_0x47beee];}}}}function freeIsNotKeySip(_0x24b742,_0xc2dca2){var _0x2e23c4=_[_0xe6f2('0x23')](_0x24b742,function(_0x40977c,_0x1193f0){return util['format'](_0xe6f2('0x25'),_0x40977c[_0xe6f2('0x26')]);});for(var _0x31773f in _0xc2dca2){if(_0xc2dca2['hasOwnProperty'](_0x31773f)){if(!_0x2e23c4[_0x31773f]){delete _0xc2dca2[_0x31773f];}}}}function freeIsNotKeyAgent(_0x4e0af6,_0x162799){var _0x39564b=_[_0xe6f2('0x23')](_0x4e0af6,function(_0x2d8af7,_0x3689df){var _0x34ff28=_[_0xe6f2('0x27')](_0x2d8af7[_0xe6f2('0x28')])?util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x2d8af7[_0xe6f2('0x26')]):_0x2d8af7[_0xe6f2('0x28')];return _0x34ff28;});for(var _0x5a495a in _0x162799){if(_0x162799['hasOwnProperty'](_0x5a495a)){if(!_0x39564b[_0x5a495a]){delete _0x162799[_0x5a495a];}}}}function clearVoiceCallReports(_0x44a69a){_0x44a69a[_0xe6f2('0x2a')]=0x0;_0x44a69a[_0xe6f2('0x2b')]=0x0;_0x44a69a[_0xe6f2('0x2c')]=0x0;_0x44a69a[_0xe6f2('0x2d')]=0x0;_0x44a69a['sumBillable']=0x0;}function clearCampaigns(_0x2e753a){if(!_[_0xe6f2('0x2e')](_0x2e753a)){for(var _0x283fe7 in _0x2e753a){if(_0x2e753a['hasOwnProperty'](_0x283fe7)){_0x2e753a[_0x283fe7][_0xe6f2('0x2f')]=0x0;_0x2e753a[_0x283fe7]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x402f79){if(!_[_0xe6f2('0x2e')](_0x402f79)){for(var _0x65027f in _0x402f79){if(_0x402f79[_0xe6f2('0x24')](_0x65027f)){_0x402f79[_0x65027f]['total']=0x0;_0x402f79[_0x65027f]['answered']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x30')]=0x0;_0x402f79[_0x65027f]['abandoned']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x2c')]=0x0;_0x402f79[_0x65027f]['sumDuration']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x31')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x32')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x33')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x34')]=0x0;_0x402f79[_0x65027f]['outboundCongestionCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x35')]=0x0;_0x402f79[_0x65027f]['outboundUnknownCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x36')]=0x0;_0x402f79[_0x65027f]['outboundDropCallsDayCallersExit']=0x0;_0x402f79[_0x65027f]['outboundBlacklistCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x37')]=0x0;_0x402f79[_0x65027f]['outboundRejectCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x38')]=0x0;_0x402f79[_0x65027f]['outboundAnswerAgiCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x39')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x3a')]=!![];}}}}Realtime['prototype'][_0xe6f2('0x3b')]=function(_0xb3522e,_0x3e9784){for(var _0x4a49de in _0x3e9784){if(_0xb3522e[_0xe6f2('0x24')](_0x4a49de)){_0xb3522e[_0x4a49de]=_0x3e9784[_0x4a49de];}}};Realtime[_0xe6f2('0x3c')]['initAgents']=function(){var _0x26f1ad=this;return function(_0x3268ae){if(_0x3268ae){freeIsNotKeyAgent(_0x3268ae,_0x26f1ad[_0xe6f2('0x3d')]);for(var _0x5f2e1b=0x0,_0x498ae3={},_0x37f7de={};_0x5f2e1b<_0x3268ae[_0xe6f2('0x3e')];_0x5f2e1b+=0x1){_0x498ae3=_0x3268ae[_0x5f2e1b];var _0x4335a1=_[_0xe6f2('0x27')](_0x498ae3[_0xe6f2('0x28')])?util[_0xe6f2('0x29')]('SIP/%s',_0x498ae3[_0xe6f2('0x26')]):_0x498ae3[_0xe6f2('0x28')];if(_[_0xe6f2('0x3f')](_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1])){_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1]=new Agent(_0x498ae3);}else{_0x26f1ad[_0xe6f2('0x3b')](_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1],_0x498ae3);}}}return _0x26f1ad[_0xe6f2('0x3d')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x40')]=function(){var _0x5c478c=this;return function(_0x405619){if(_0x405619){freeIsNotKeySip(_0x405619,_0x5c478c['telephones']);for(var _0x1475a5=0x0,_0x58b8ff={},_0x3a6b05={};_0x1475a5<_0x405619[_0xe6f2('0x3e')];_0x1475a5+=0x1){_0x58b8ff=_0x405619[_0x1475a5];if(_[_0xe6f2('0x3f')](_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')]('SIP/%s',_0x58b8ff[_0xe6f2('0x26')])])){_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x58b8ff[_0xe6f2('0x26')])]=new Telephone(_0x58b8ff);}else{_0x5c478c[_0xe6f2('0x3b')](_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')]('SIP/%s',_0x58b8ff[_0xe6f2('0x26')])],_0x58b8ff);}}}return _0x5c478c[_0xe6f2('0x11')];};};Realtime[_0xe6f2('0x3c')]['initTrunks']=function(){var _0x13a756=this;return function(_0x58baf1){if(_0x58baf1){freeIsNotKeySip(_0x58baf1,_0x13a756['trunks']);for(var _0x53ffc4=0x0,_0x5e800b={},_0x19e562={};_0x53ffc4<_0x58baf1[_0xe6f2('0x3e')];_0x53ffc4+=0x1){_0x5e800b=_0x58baf1[_0x53ffc4];if(_[_0xe6f2('0x3f')](_0x13a756['trunks'][util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x5e800b[_0xe6f2('0x26')])])){_0x13a756[_0xe6f2('0x12')][util['format'](_0xe6f2('0x25'),_0x5e800b['name'])]=new Trunk(_0x5e800b);}else{_0x13a756['mergeFromDatabase'](_0x13a756[_0xe6f2('0x12')][util['format'](_0xe6f2('0x25'),_0x5e800b[_0xe6f2('0x26')])],_0x5e800b);}}}return _0x13a756['trunks'];};};Realtime[_0xe6f2('0x3c')]['initVoiceQueues']=function(){var _0x4111bc=this;return function(_0xf5537){if(_0xf5537){freeIsNotKey(_0xf5537,_0x4111bc[_0xe6f2('0x13')],_0xe6f2('0x26'));for(var _0x5cadd4=0x0,_0x4f3018={},_0x32a257={};_0x5cadd4<_0xf5537[_0xe6f2('0x3e')];_0x5cadd4+=0x1){_0x4f3018=_0xf5537[_0x5cadd4];if(_[_0xe6f2('0x3f')](_0x4111bc[_0xe6f2('0x13')][_0x4f3018[_0xe6f2('0x26')]])){_0x4111bc['voiceQueues'][_0x4f3018[_0xe6f2('0x26')]]=new VoiceQueue(_0x4f3018);}else{_0x4111bc[_0xe6f2('0x3b')](_0x4111bc[_0xe6f2('0x13')][_0x4f3018[_0xe6f2('0x26')]],_0x4f3018);}}}return _0x4111bc[_0xe6f2('0x13')];};};Realtime['prototype'][_0xe6f2('0x41')]=function(){var _0x2104a5=this;return function(_0x411b84){if(_0x411b84){freeIsNotKey(_0x411b84,_0x2104a5[_0xe6f2('0x14')],'id');for(var _0x12e614=0x0,_0x2fcb55={},_0x103e5d={};_0x12e614<_0x411b84[_0xe6f2('0x3e')];_0x12e614+=0x1){_0x2fcb55=_0x411b84[_0x12e614];if(_['isUndefined'](_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']])){_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']]=new Trigger(_0x2fcb55);}else{_0x2104a5[_0xe6f2('0x3b')](_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']],_0x2fcb55);}}}return _0x2104a5['triggers'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x42')]=function(){var _0x44c86c=this;return function(_0xa9a580){if(_0xa9a580){freeIsNotKey(_0xa9a580,_0x44c86c['templates'],'id');for(var _0x5bbb97=0x0,_0x153910={},_0x3dc69f={};_0x5bbb97<_0xa9a580[_0xe6f2('0x3e')];_0x5bbb97+=0x1){_0x153910=_0xa9a580[_0x5bbb97];if(_[_0xe6f2('0x3f')](_0x44c86c[_0xe6f2('0x15')][_0x153910['id']])){_0x44c86c[_0xe6f2('0x15')][_0x153910['id']]=new Template(_0x153910);}else{_0x44c86c[_0xe6f2('0x3b')](_0x44c86c['templates'][_0x153910['id']],_0x153910);}}}return _0x44c86c[_0xe6f2('0x15')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x43')]=function(){var _0x42045c=this;return function(_0x219da3){if(_0x219da3){freeIsNotKey(_0x219da3,_0x42045c[_0xe6f2('0x1a')],'id');for(var _0xab446e=0x0,_0xfbcc41={},_0x552e4c={};_0xab446e<_0x219da3[_0xe6f2('0x3e')];_0xab446e+=0x1){_0xfbcc41=_0x219da3[_0xab446e];if(_[_0xe6f2('0x3f')](_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']])){_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']]=new ZendeskAccount(_0xfbcc41);}else{_0x42045c[_0xe6f2('0x3b')](_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']],_0xfbcc41);}}}return _0x42045c[_0xe6f2('0x1a')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x44')]=function(){var _0x3051a7=this;return function(_0x30979b){if(_0x30979b){freeIsNotKey(_0x30979b,_0x3051a7[_0xe6f2('0x1b')],'id');for(var _0x21ca74=0x0,_0x51c939={},_0x552a3f={};_0x21ca74<_0x30979b[_0xe6f2('0x3e')];_0x21ca74+=0x1){_0x51c939=_0x30979b[_0x21ca74];if(_[_0xe6f2('0x3f')](_0x3051a7['salesforceAccounts'][_0x51c939['id']])){_0x3051a7[_0xe6f2('0x1b')][_0x51c939['id']]=new SalesforceAccount(_0x51c939);}else{_0x3051a7[_0xe6f2('0x3b')](_0x3051a7[_0xe6f2('0x1b')][_0x51c939['id']],_0x51c939);}}}return _0x3051a7[_0xe6f2('0x1b')];};};Realtime['prototype'][_0xe6f2('0x45')]=function(){var _0x30ca48=this;return function(_0x2b2987){if(_0x2b2987){freeIsNotKey(_0x2b2987,_0x30ca48['freshdeskAccounts'],'id');for(var _0x134e0a=0x0,_0x1542d7={},_0x4fbc08={};_0x134e0a<_0x2b2987['length'];_0x134e0a+=0x1){_0x1542d7=_0x2b2987[_0x134e0a];if(_[_0xe6f2('0x3f')](_0x30ca48[_0xe6f2('0x46')][_0x1542d7['id']])){_0x30ca48['freshdeskAccounts'][_0x1542d7['id']]=new FreshdeskAccount(_0x1542d7);}else{_0x30ca48[_0xe6f2('0x3b')](_0x30ca48[_0xe6f2('0x46')][_0x1542d7['id']],_0x1542d7);}}}return _0x30ca48[_0xe6f2('0x46')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x47')]=function(){var _0x15ef67=this;return function(_0x59950b){if(_0x59950b){freeIsNotKey(_0x59950b,_0x15ef67[_0xe6f2('0x1d')],'id');for(var _0x1814d7=0x0,_0x529494={},_0x5716b6={};_0x1814d7<_0x59950b[_0xe6f2('0x3e')];_0x1814d7+=0x1){_0x529494=_0x59950b[_0x1814d7];if(_['isUndefined'](_0x15ef67[_0xe6f2('0x1d')][_0x529494['id']])){_0x15ef67[_0xe6f2('0x1d')][_0x529494['id']]=new ZohoAccount(_0x529494);}else{_0x15ef67[_0xe6f2('0x3b')](_0x15ef67['zohoAccounts'][_0x529494['id']],_0x529494);}}}return _0x15ef67['zohoAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x48')]=function(){var _0x49d173=this;return function(_0x41882b){if(_0x41882b){freeIsNotKey(_0x41882b,_0x49d173[_0xe6f2('0x1e')],'id');for(var _0x440e95=0x0,_0x3a3562={},_0x2c86a9={};_0x440e95<_0x41882b['length'];_0x440e95+=0x1){_0x3a3562=_0x41882b[_0x440e95];if(_[_0xe6f2('0x3f')](_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']])){_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']]=new DeskAccount(_0x3a3562);}else{_0x49d173[_0xe6f2('0x3b')](_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']],_0x3a3562);}}}return _0x49d173[_0xe6f2('0x1e')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x49')]=function(){var _0x144bca=this;return function(_0x863001){if(_0x863001){freeIsNotKey(_0x863001,_0x144bca[_0xe6f2('0x1c')],'id');for(var _0x46da06=0x0,_0x1fd37e={},_0xcc4133={};_0x46da06<_0x863001[_0xe6f2('0x3e')];_0x46da06+=0x1){_0x1fd37e=_0x863001[_0x46da06];if(_[_0xe6f2('0x3f')](_0x144bca['sugarcrmAccounts'][_0x1fd37e['id']])){_0x144bca[_0xe6f2('0x1c')][_0x1fd37e['id']]=new SugarcrmAccount(_0x1fd37e);}else{_0x144bca[_0xe6f2('0x3b')](_0x144bca[_0xe6f2('0x1c')][_0x1fd37e['id']],_0x1fd37e);}}}return _0x144bca['sugarcrmAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4a')]=function(){var _0x2cda53=this;return function(_0x108b5c){if(_0x108b5c){freeIsNotKey(_0x108b5c,_0x2cda53[_0xe6f2('0x1f')],'id');for(var _0xb8d6c6=0x0,_0x3f1d85={},_0x5a9ab4={};_0xb8d6c6<_0x108b5c['length'];_0xb8d6c6+=0x1){_0x3f1d85=_0x108b5c[_0xb8d6c6];if(_[_0xe6f2('0x3f')](_0x2cda53[_0xe6f2('0x1f')][_0x3f1d85['id']])){_0x2cda53['vtigerAccounts'][_0x3f1d85['id']]=new VtigerAccount(_0x3f1d85);}else{_0x2cda53[_0xe6f2('0x3b')](_0x2cda53['vtigerAccounts'][_0x3f1d85['id']],_0x3f1d85);}}}return _0x2cda53['vtigerAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4b')]=function(){var _0x1644d4=this;return function(_0x4ce034){if(_0x4ce034){freeIsNotKey(_0x4ce034,_0x1644d4['servicenowAccounts'],'id');for(var _0x4cd47d=0x0,_0x5a4a70={},_0x37ed18={};_0x4cd47d<_0x4ce034[_0xe6f2('0x3e')];_0x4cd47d+=0x1){_0x5a4a70=_0x4ce034[_0x4cd47d];if(_['isUndefined'](_0x1644d4[_0xe6f2('0x4c')][_0x5a4a70['id']])){_0x1644d4['servicenowAccounts'][_0x5a4a70['id']]=new ServicenowAccount(_0x5a4a70);}else{_0x1644d4[_0xe6f2('0x3b')](_0x1644d4[_0xe6f2('0x4c')][_0x5a4a70['id']],_0x5a4a70);}}}return _0x1644d4[_0xe6f2('0x4c')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4d')]=function(){var _0x49d9e6=this;return function(_0x53f47b){if(_0x53f47b){freeIsNotKey(_0x53f47b,_0x49d9e6[_0xe6f2('0x20')],'id');for(var _0x3faa27=0x0,_0x4da5a1={},_0x46e3b5={};_0x3faa27<_0x53f47b[_0xe6f2('0x3e')];_0x3faa27+=0x1){_0x4da5a1=_0x53f47b[_0x3faa27];if(_[_0xe6f2('0x3f')](_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']])){_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']]=new Dynamics365Account(_0x4da5a1);}else{_0x49d9e6[_0xe6f2('0x3b')](_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']],_0x4da5a1);}}}return _0x49d9e6[_0xe6f2('0x20')];};};Realtime['prototype'][_0xe6f2('0x4e')]=function(){var _0x20cacb=this;return function(_0x194580){if(_0x194580){freeIsNotKey(_0x194580,_0x20cacb[_0xe6f2('0x21')],'id');for(var _0x5725f4=0x0,_0x3546cd={},_0x2579d0={};_0x5725f4<_0x194580[_0xe6f2('0x3e')];_0x5725f4+=0x1){_0x3546cd=_0x194580[_0x5725f4];if(_[_0xe6f2('0x3f')](_0x20cacb[_0xe6f2('0x21')][_0x3546cd['id']])){_0x20cacb[_0xe6f2('0x21')][_0x3546cd['id']]=new FreshsalesAccount(_0x3546cd);}else{_0x20cacb[_0xe6f2('0x3b')](_0x20cacb['freshsalesAccounts'][_0x3546cd['id']],_0x3546cd);}}}return _0x20cacb[_0xe6f2('0x21')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4f')]=function(){var _0xdb85ed=this;return function(_0x40ed40){for(var _0x3ac974=0x0;_0x3ac974<_0x40ed40['length'];_0x3ac974+=0x1){_[_0xe6f2('0x50')](_0xdb85ed['voiceQueues'][_0x40ed40[_0x3ac974][_0xe6f2('0x26')]],_0x40ed40[_0x3ac974]);}return _0xdb85ed[_0xe6f2('0x13')];};};Realtime['prototype'][_0xe6f2('0x51')]=function(){var _0x522202=this;return function(_0x663138){clearVoiceQueues(_0x522202[_0xe6f2('0x13')]);if(_0x663138){_0x663138=_['groupBy'](_0x663138,_0xe6f2('0x52'));for(var _0x580ff9 in _0x663138){if(_0x663138[_0xe6f2('0x24')](_0x580ff9)){var _0x10b59f={};for(var _0xb2b8e0=0x0;_0xb2b8e0<_0x663138[_0x580ff9][_0xe6f2('0x3e')];_0xb2b8e0+=0x1){var _0x112a3b=_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x53')];if(_0x522202[_0xe6f2('0x13')][_0x112a3b]){if(_0x663138[_0x580ff9][_0xb2b8e0]['queuecallerexit']){_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x30')]+=0x1;}if(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x54')]){_0x522202['voiceQueues'][_0x112a3b][_0xe6f2('0x55')]+=0x1;}_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2c')]+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x56')])[_0xe6f2('0x57')](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x58')]),_0xe6f2('0x59'))||0x0;if(_0xb2b8e0===_0x663138[_0x580ff9]['length']-0x1){_0x522202[_0xe6f2('0x13')][_0x112a3b]['sumDuration']+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5a')]||_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5b')]||_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5c')])['diff'](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x58')]),_0xe6f2('0x59'))||0x0;_0x522202['voiceQueues'][_0x112a3b][_0xe6f2('0x2a')]+=0x1;if(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5d')]){_0x522202[_0xe6f2('0x13')][_0x112a3b]['answered']+=0x1;_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x31')]+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5a')])[_0xe6f2('0x57')](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x56')]),_0xe6f2('0x59'))||0x0;}}else{_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2d')]+=_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2c')]||0x0;}}}}}}return _0x522202[_0xe6f2('0x13')];};};Realtime[_0xe6f2('0x3c')]['initVoiceCallReports']=function(){var _0x317a00=this;return function(_0x411a67){clearVoiceCallReports(_0x317a00[_0xe6f2('0x16')]);if(_0x411a67){for(var _0x204ddc=0x0;_0x204ddc<_0x411a67[_0xe6f2('0x3e')];_0x204ddc+=0x1){_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x2a')]+=0x1;_0x317a00['outbound']['sumDuration']+=_0x411a67[_0x204ddc][_0xe6f2('0x5e')];if(_0x411a67[_0x204ddc][_0xe6f2('0x5f')]===_0xe6f2('0x60')){_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x2b')]+=0x1;_0x317a00['outbound'][_0xe6f2('0x2c')]+=_0x411a67[_0x204ddc][_0xe6f2('0x5e')]-_0x411a67[_0x204ddc][_0xe6f2('0x61')]||0x0;_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x31')]+=_0x411a67[_0x204ddc][_0xe6f2('0x61')];}}}return _0x317a00[_0xe6f2('0x16')];};};Realtime[_0xe6f2('0x3c')]['initCampaigns']=function(){var _0x76e6fe=this;return function(_0x1ee34c){if(_0x1ee34c){freeIsNotKey(_0x1ee34c,_0x76e6fe['campaigns'],_0xe6f2('0x26'));for(var _0x6507f0=0x0,_0x813ccc={};_0x6507f0<_0x1ee34c['length'];_0x6507f0+=0x1){_0x813ccc=_0x1ee34c[_0x6507f0];if(_['isUndefined'](_0x76e6fe[_0xe6f2('0x62')][_0x813ccc['name']])){_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]]=new Campaign(_0x813ccc);}else{_0x76e6fe[_0xe6f2('0x3b')](_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]],_0x813ccc);_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]][_0xe6f2('0x63')]=_0x813ccc[_0xe6f2('0x64')]?_0x813ccc[_0xe6f2('0x64')][_0xe6f2('0x26')]:undefined;}}}return _0x76e6fe[_0xe6f2('0x62')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x65')]=function(){var _0x1c0d23=this;return function(_0x3382c7){if(_0x3382c7){freeIsNotKey(_0x3382c7,_0x1c0d23[_0xe6f2('0x66')],'id');for(var _0x1bbbb9=0x0,_0x2297fe={};_0x1bbbb9<_0x3382c7['length'];_0x1bbbb9+=0x1){_0x2297fe=_0x3382c7[_0x1bbbb9];if(_[_0xe6f2('0x3f')](_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']])){_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']]=new VoiceExtension(_0x2297fe);}else{_0x1c0d23[_0xe6f2('0x3b')](_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']],_0x2297fe);}}}return _0x1c0d23[_0xe6f2('0x66')];};};Realtime[_0xe6f2('0x3c')]['initCampaignHopperHistory']=function(){var _0x976510=this;return function(_0x525c13){clearCampaigns(_0x976510[_0xe6f2('0x62')]);for(var _0xdc329f=0x0;_0xdc329f<_0x525c13[_0xe6f2('0x3e')];_0xdc329f+=0x1){_['merge'](_0x976510[_0xe6f2('0x62')][_0x525c13[_0xdc329f][_0xe6f2('0x26')]],_0x525c13[_0xdc329f]);}return _0x976510[_0xe6f2('0x62')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x67')]=function(){var _0x2605af=this;return function(_0x20e608){if(_0x20e608){freeIsNotKey(_0x20e608,_0x2605af[_0xe6f2('0x22')],'id');for(var _0x2474e7=0x0,_0x2b5823={},_0x4fafda={};_0x2474e7<_0x20e608[_0xe6f2('0x3e')];_0x2474e7+=0x1){_0x2b5823=_0x20e608[_0x2474e7];if(_[_0xe6f2('0x3f')](_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']])){_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']]=new FaxAccount(_0x2b5823);}else{_0x2605af[_0xe6f2('0x3b')](_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']],_0x2b5823);}}}return _0x2605af['faxAccounts'];};};module[_0xe6f2('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0f3c1b0..0170679 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 _0x2e81=['\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','create','monitor','monitors','filename','createdAt','connectedlinename','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','voiceDialReport','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedTransfer','findAgent','name','isNil','find','accountcode','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','destination','exten','lastdata','queue','context','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','channel','destinationchannel','calleridpreview'];(function(_0x9dd220,_0xacfcf){var _0x55e92d=function(_0x3c16dc){while(--_0x3c16dc){_0x9dd220['push'](_0x9dd220['shift']());}};_0x55e92d(++_0xacfcf);}(_0x2e81,0xc2));var _0x12e8=function(_0x2f02d4,_0x27b24a){_0x2f02d4=_0x2f02d4-0x0;var _0x4b707d=_0x2e81[_0x2f02d4];return _0x4b707d;};'use strict';var _=require(_0x12e8('0x0'));var moment=require(_0x12e8('0x1'));var util=require(_0x12e8('0x2'));var config=require(_0x12e8('0x3'));var ami=require(_0x12e8('0x4'));var RpcVoiceAgentReport=require(_0x12e8('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x12e8('0x6'));var RpcMemberReport=require(_0x12e8('0x7'));var RpcVoiceQueueReport=require(_0x12e8('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x12e8('0x9'));var VoiceCallReport=require(_0x12e8('0xa'));var VoiceAgentReport=require(_0x12e8('0xb'));var VoiceDialReport=require(_0x12e8('0xc'));var UserReport=require(_0x12e8('0xd'));function Report(_0x3da9e4){this[_0x12e8('0xe')]=_0x3da9e4;this[_0x12e8('0xf')]=_0x3da9e4[_0x12e8('0xf')];this['telephones']=_0x3da9e4[_0x12e8('0x10')];}Report[_0x12e8('0x11')][_0x12e8('0x12')]=function(_0x275306){var _0x1af5ba=new VoiceQueueReport(this[_0x12e8('0xe')]);var _0x2d32b1=new VoiceAgentReport(this['realtime']);var _0x488f7e=new VoiceDialReport(this[_0x12e8('0xe')]);var _0x34e566=new VoiceCallReport(this['realtime']);var _0x1ec05c=new UserReport(this['realtime']);if(config['xdr']&&config[_0x12e8('0x13')][_0x12e8('0x14')]){ami['on'](_0x12e8('0x15'),this['voiceQueueReport'][_0x12e8('0x16')](this));ami['on'](_0x12e8('0x17'),this['voiceCallReport'][_0x12e8('0x16')](this));ami['on'](_0x12e8('0x18'),this['voiceAgentReport']['bind'](this));ami['on'](_0x12e8('0x19'),this['voiceDialReport'][_0x12e8('0x16')](this));ami['on'](_0x12e8('0x1a'),this['blindTransfer'][_0x12e8('0x16')](this));ami['on']('attendedtransfer',this[_0x12e8('0x1b')]['bind'](this));}};Report[_0x12e8('0x11')][_0x12e8('0x1c')]=function(_0x2e5f28){var _0x75b8cd;_0x75b8cd=_['find'](this['agents'],function(_0x12f1dc){return _0x12f1dc['accountcode']==_0x2e5f28||_0x12f1dc[_0x12e8('0x1d')]==_0x2e5f28;});if(_[_0x12e8('0x1e')](_0x75b8cd)){var _0x1f7b5e=_[_0x12e8('0x1f')](this['telephones'],function(_0x3f2763){return _0x3f2763[_0x12e8('0x20')]==_0x2e5f28||_0x3f2763['name']==_0x2e5f28;});if(_0x1f7b5e){_0x75b8cd=_[_0x12e8('0x1f')](this[_0x12e8('0xf')],function(_0x50189a){return _0x50189a[_0x12e8('0x21')]==util[_0x12e8('0x22')](_0x12e8('0x23'),_0x1f7b5e[_0x12e8('0x1d')]);});}}return _0x75b8cd;};Report[_0x12e8('0x11')][_0x12e8('0x24')]=function(_0x5c5ffc){for(var _0x9b2a22=0x0;_0x9b2a22<_0x5c5ffc[_0x12e8('0x25')];_0x9b2a22+=0x1){var _0x21d2df=this[_0x12e8('0x1c')](_0x5c5ffc[_0x9b2a22][_0x12e8('0x26')]);if(_0x21d2df){_0x5c5ffc[_0x9b2a22][_0x12e8('0x20')]=_0x21d2df['accountcode'];_0x5c5ffc[_0x9b2a22][_0x12e8('0x27')]=!![];_0x5c5ffc[_0x9b2a22]['lastAssignedTo']=_0x21d2df['name'];_0x5c5ffc[_0x9b2a22][_0x12e8('0x21')]=_[_0x12e8('0x1e')](_0x21d2df[_0x12e8('0x21')])?util[_0x12e8('0x22')](_0x12e8('0x23'),_0x21d2df[_0x12e8('0x1d')]):_0x21d2df[_0x12e8('0x21')];if(_0x5c5ffc[_0x9b2a22][_0x12e8('0x28')]){_0x5c5ffc[_0x9b2a22][_0x12e8('0x29')]=moment()[_0x12e8('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5c5ffc[_0x9b2a22][_0x12e8('0x2a')]){_0x5c5ffc[_0x9b2a22][_0x12e8('0x2b')]=moment()[_0x12e8('0x22')](_0x12e8('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x5c5ffc[_0x9b2a22]);}RpcVoiceQueueReport['create'](_0x5c5ffc[_0x9b2a22]);}};function extractCalleridNumber(_0x54444b){var _0x5b106d=_0x54444b[_0x12e8('0x2d')](/<(.*?)>/);return _0x5b106d?_0x5b106d[0x1]:_0x54444b;}Report[_0x12e8('0x11')]['voiceCallReport']=function(_0x5d5279){_0x5d5279[_0x12e8('0x2e')]=_0x5d5279[_0x12e8('0x2e')]||_0x5d5279[_0x12e8('0x2f')];if(_0x5d5279['type']=='dialer'){_0x5d5279['lastapplication']='queue';_0x5d5279[_0x12e8('0x30')]=_0x5d5279[_0x12e8('0x31')];if(_0x5d5279[_0x12e8('0x32')]=='from-voip-provider'){_0x5d5279['accountcode']='';_0x5d5279[_0x12e8('0x2e')]=extractCalleridNumber(_0x5d5279['callerid']);}else if(_0x5d5279['context']==_0x12e8('0x33')){if(_0x5d5279['destination']==_0x12e8('0x34')){_0x5d5279[_0x12e8('0x2e')]=extractCalleridNumber(_0x5d5279['calleridpreview']);_0x5d5279[_0x12e8('0x35')]=_0x5d5279[_0x12e8('0x36')];_0x5d5279['destinationchannel']=[_0x5d5279['channel'],_0x5d5279[_0x12e8('0x37')]=_0x5d5279[_0x12e8('0x38')]][0x0];_0x5d5279['callerid']=_0x5d5279[_0x12e8('0x39')];}else{_0x5d5279['destination']=_0x5d5279['calleridnum'];_0x5d5279[_0x12e8('0x35')]=_0x5d5279[_0x12e8('0x36')];if(_0x5d5279['disposition']=='ANSWERED'){_0x5d5279[_0x12e8('0x20')]=_0x5d5279[_0x12e8('0x26')];}else{_0x5d5279['accountcode']='';}}}}else{_0x5d5279['callerid']=util[_0x12e8('0x22')](_0x12e8('0x3a'),_0x5d5279[_0x12e8('0x3b')],_0x5d5279[_0x12e8('0x35')]);}if(RpcVoiceTransferReport[_0x12e8('0x3c')][_0x5d5279[_0x12e8('0x3d')]]){var _0x594f8d=RpcVoiceTransferReport[_0x12e8('0x3c')][_0x5d5279[_0x12e8('0x3d')]];_0x594f8d[_0x12e8('0x3e')]=_0x5d5279['uniqueid'];RpcVoiceTransferReport[_0x12e8('0x3f')](_0x594f8d);delete RpcVoiceTransferReport['transfers'][_0x5d5279['linkedid']];}RpcVoiceCallReport[_0x12e8('0x40')](_0x5d5279);if(_0x5d5279[_0x12e8('0x41')]){for(var _0x81900b=0x0;_0x81900b<_0x5d5279[_0x12e8('0x42')][_0x12e8('0x25')];_0x81900b+=0x1){_0x5d5279['monitorFilename']=_0x5d5279[_0x12e8('0x42')][_0x81900b][_0x12e8('0x43')];_0x5d5279['createdAt']=_0x5d5279[_0x12e8('0x42')][_0x81900b][_0x12e8('0x44')];if(_0x5d5279[_0x12e8('0x2f')]==_0x12e8('0x34')){_0x5d5279[_0x12e8('0x35')]=_0x5d5279[_0x12e8('0x26')];_0x5d5279[_0x12e8('0x3b')]=_0x5d5279[_0x12e8('0x45')];_0x5d5279[_0x12e8('0x26')]=_0x5d5279[_0x12e8('0x20')];_0x5d5279[_0x12e8('0x45')]=_0x5d5279['membername'];_0x5d5279[_0x12e8('0x2f')]=_0x5d5279[_0x12e8('0x36')];}else if(_0x5d5279[_0x12e8('0x2f')]=='xcally-motion-dialer'){_0x5d5279[_0x12e8('0x35')]=_0x5d5279[_0x12e8('0x2e')];_0x5d5279['exten']=_0x5d5279['originatecalleridnum'];}RpcVoiceRecording['create'](_0x5d5279);}}};Report[_0x12e8('0x11')][_0x12e8('0x46')]=function(_0x2d6d5d){if(_[_0x12e8('0x47')](_0x2d6d5d)){_0x2d6d5d[_0x12e8('0x48')](function(_0x1b8b6a){RpcVoiceAgentReport[_0x12e8('0x40')](_0x1b8b6a);});}else{RpcVoiceAgentReport[_0x12e8('0x40')](_0x2d6d5d);}};Report[_0x12e8('0x11')]['voiceDialReport']=function(_0x41399e){RpcVoiceDialReport['create'](_0x41399e);var _0x35f045;var _0x302f13;var _0x2269e2=_0x41399e[_0x12e8('0x37')];if(_[_0x12e8('0x49')](_0x2269e2,_0x12e8('0x4a'))){_0x302f13=_0x2269e2[_0x12e8('0x4b')](_0x2269e2[_0x12e8('0x4c')]('/')+0x1,_0x2269e2[_0x12e8('0x4c')]('@'));_0x35f045=_[_0x12e8('0x1f')](this[_0x12e8('0xf')],function(_0x100fc6){return _0x100fc6[_0x12e8('0x4d')]==_0x302f13||_0x100fc6[_0x12e8('0x4e')]==_0x302f13||_0x100fc6['accountcode']==_0x302f13;});}else{_0x302f13=_0x2269e2[_0x12e8('0x4b')](_0x2269e2['indexOf']('/')+0x1,_0x2269e2[_0x12e8('0x4f')]('-'));_0x35f045=this[_0x12e8('0x1c')](_0x302f13);}if(_0x35f045){_0x41399e['interface']=_[_0x12e8('0x1e')](_0x35f045[_0x12e8('0x21')])?util['format'](_0x12e8('0x23'),_0x35f045[_0x12e8('0x1d')]):_0x35f045[_0x12e8('0x21')];_0x41399e[_0x12e8('0x50')]=_0x35f045['name'];_0x41399e[_0x12e8('0x20')]=_0x35f045['accountcode'];RpcMemberReport[_0x12e8('0x51')](_0x41399e);}};Report[_0x12e8('0x11')]['blindTransfer']=function(_0x378978){RpcVoiceTransferReport[_0x12e8('0x3c')][_0x378978[_0x12e8('0x52')]]=_0x378978;};Report[_0x12e8('0x11')][_0x12e8('0x1b')]=function(_0x31979c){RpcVoiceTransferReport[_0x12e8('0x1b')](_0x31979c);};module[_0x12e8('0x53')]=Report; \ No newline at end of file +var _0x81b3=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','transfereelinkedid','uniqueid','create','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','blindTransfer','exports','lodash','moment','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x3c0acc,_0x5a6de5){var _0x1669b4=function(_0x52f069){while(--_0x52f069){_0x3c0acc['push'](_0x3c0acc['shift']());}};_0x1669b4(++_0x5a6de5);}(_0x81b3,0x98));var _0x381b=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x81b3[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x381b('0x0'));var moment=require(_0x381b('0x1'));var util=require('util');var config=require(_0x381b('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x381b('0x3'));var RpcVoiceDialReport=require(_0x381b('0x4'));var RpcMemberReport=require(_0x381b('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x381b('0x6'));var RpcVoiceTransferReport=require(_0x381b('0x7'));var VoiceQueueReport=require(_0x381b('0x8'));var VoiceCallReport=require(_0x381b('0x9'));var VoiceAgentReport=require(_0x381b('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x4a1fc4){this['realtime']=_0x4a1fc4;this[_0x381b('0xb')]=_0x4a1fc4['agents'];this[_0x381b('0xc')]=_0x4a1fc4[_0x381b('0xc')];}Report[_0x381b('0xd')][_0x381b('0xe')]=function(_0x5e3dc6){var _0x3dbe47=new VoiceQueueReport(this[_0x381b('0xf')]);var _0x4992ce=new VoiceAgentReport(this[_0x381b('0xf')]);var _0x1967fd=new VoiceDialReport(this[_0x381b('0xf')]);var _0x53453f=new VoiceCallReport(this[_0x381b('0xf')]);var _0x38a12b=new UserReport(this[_0x381b('0xf')]);if(config['xdr']&&config['xdr'][_0x381b('0x10')]){ami['on'](_0x381b('0x11'),this[_0x381b('0x12')][_0x381b('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x381b('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x381b('0x14')][_0x381b('0x13')](this));ami['on'](_0x381b('0x15'),this['voiceDialReport'][_0x381b('0x13')](this));ami['on'](_0x381b('0x16'),this['blindTransfer'][_0x381b('0x13')](this));ami['on'](_0x381b('0x17'),this[_0x381b('0x18')][_0x381b('0x13')](this));}};Report['prototype'][_0x381b('0x19')]=function(_0x50d799){var _0x1e65bf;_0x1e65bf=_[_0x381b('0x1a')](this['agents'],function(_0x25372f){return _0x25372f[_0x381b('0x1b')]==_0x50d799||_0x25372f['name']==_0x50d799;});if(_[_0x381b('0x1c')](_0x1e65bf)){var _0x59e68d=_[_0x381b('0x1a')](this[_0x381b('0xc')],function(_0x5255bf){return _0x5255bf[_0x381b('0x1b')]==_0x50d799||_0x5255bf[_0x381b('0x1d')]==_0x50d799;});if(_0x59e68d){_0x1e65bf=_['find'](this[_0x381b('0xb')],function(_0x215dcb){return _0x215dcb[_0x381b('0x1e')]==util[_0x381b('0x1f')](_0x381b('0x20'),_0x59e68d[_0x381b('0x1d')]);});}}return _0x1e65bf;};Report['prototype'][_0x381b('0x12')]=function(_0x2d5823){for(var _0x1798f5=0x0;_0x1798f5<_0x2d5823[_0x381b('0x21')];_0x1798f5+=0x1){var _0x4c3c56=this[_0x381b('0x19')](_0x2d5823[_0x1798f5]['connectedlinenum']);if(_0x4c3c56){_0x2d5823[_0x1798f5][_0x381b('0x1b')]=_0x4c3c56[_0x381b('0x1b')];_0x2d5823[_0x1798f5]['assigned']=!![];_0x2d5823[_0x1798f5]['lastAssignedTo']=_0x4c3c56[_0x381b('0x1d')];_0x2d5823[_0x1798f5][_0x381b('0x1e')]=_['isNil'](_0x4c3c56[_0x381b('0x1e')])?util[_0x381b('0x1f')](_0x381b('0x20'),_0x4c3c56[_0x381b('0x1d')]):_0x4c3c56[_0x381b('0x1e')];if(_0x2d5823[_0x1798f5][_0x381b('0x22')]){_0x2d5823[_0x1798f5]['queuecallercompleteAt']=moment()[_0x381b('0x1f')](_0x381b('0x23'));}if(_0x2d5823[_0x1798f5][_0x381b('0x24')]){_0x2d5823[_0x1798f5][_0x381b('0x25')]=moment()['format'](_0x381b('0x23'));}RpcMemberReport[_0x381b('0x12')](_0x2d5823[_0x1798f5]);}RpcVoiceQueueReport['create'](_0x2d5823[_0x1798f5]);}};function extractCalleridNumber(_0x56bdc0){var _0x18cb0d=_0x56bdc0['match'](/<(.*?)>/);return _0x18cb0d?_0x18cb0d[0x1]:_0x56bdc0;}Report[_0x381b('0xd')][_0x381b('0x26')]=function(_0x3417c2){_0x3417c2[_0x381b('0x27')]=_0x3417c2['destination']||_0x3417c2[_0x381b('0x28')];if(_0x3417c2[_0x381b('0x29')]==_0x381b('0x2a')){_0x3417c2[_0x381b('0x2b')]='queue';_0x3417c2[_0x381b('0x2c')]=_0x3417c2['queue'];if(_0x3417c2['context']=='from-voip-provider'){_0x3417c2[_0x381b('0x1b')]='';_0x3417c2[_0x381b('0x27')]=extractCalleridNumber(_0x3417c2[_0x381b('0x2d')]);}else if(_0x3417c2['context']==_0x381b('0x2e')){if(_0x3417c2[_0x381b('0x27')]==_0x381b('0x2f')){_0x3417c2[_0x381b('0x27')]=extractCalleridNumber(_0x3417c2[_0x381b('0x30')]);_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x32')];_0x3417c2['destinationchannel']=[_0x3417c2[_0x381b('0x33')],_0x3417c2['channel']=_0x3417c2[_0x381b('0x34')]][0x0];_0x3417c2[_0x381b('0x2d')]=_0x3417c2[_0x381b('0x30')];}else{_0x3417c2[_0x381b('0x27')]=_0x3417c2[_0x381b('0x31')];_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x32')];if(_0x3417c2[_0x381b('0x35')]==_0x381b('0x36')){_0x3417c2[_0x381b('0x1b')]=_0x3417c2[_0x381b('0x37')];}else{_0x3417c2[_0x381b('0x1b')]='';}}}}else{_0x3417c2[_0x381b('0x2d')]=util[_0x381b('0x1f')](_0x381b('0x38'),_0x3417c2['calleridname'],_0x3417c2[_0x381b('0x31')]);}if(RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']]){var _0x4379fd=RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']];_0x4379fd[_0x381b('0x3a')]=_0x3417c2[_0x381b('0x3b')];RpcVoiceTransferReport['blindTransfer'](_0x4379fd);delete RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']];}RpcVoiceCallReport[_0x381b('0x3c')](_0x3417c2);if(_0x3417c2[_0x381b('0x3d')]){for(var _0x49391d=0x0;_0x49391d<_0x3417c2[_0x381b('0x3e')][_0x381b('0x21')];_0x49391d+=0x1){_0x3417c2[_0x381b('0x3f')]=_0x3417c2[_0x381b('0x3e')][_0x49391d][_0x381b('0x40')];_0x3417c2[_0x381b('0x41')]=_0x3417c2[_0x381b('0x3e')][_0x49391d][_0x381b('0x41')];if(_0x3417c2['exten']==_0x381b('0x2f')){_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x37')];_0x3417c2[_0x381b('0x42')]=_0x3417c2[_0x381b('0x43')];_0x3417c2[_0x381b('0x37')]=_0x3417c2[_0x381b('0x1b')];_0x3417c2[_0x381b('0x43')]=_0x3417c2[_0x381b('0x44')];_0x3417c2['exten']=_0x3417c2[_0x381b('0x32')];}else if(_0x3417c2[_0x381b('0x28')]==_0x381b('0x45')){_0x3417c2[_0x381b('0x31')]=_0x3417c2['destination'];_0x3417c2['exten']=_0x3417c2[_0x381b('0x32')];}RpcVoiceRecording[_0x381b('0x3c')](_0x3417c2);}}};Report['prototype'][_0x381b('0x14')]=function(_0x5471d4){if(_[_0x381b('0x46')](_0x5471d4)){_0x5471d4['forEach'](function(_0x38fa04){RpcVoiceAgentReport['create'](_0x38fa04);});}else{RpcVoiceAgentReport[_0x381b('0x3c')](_0x5471d4);}};Report[_0x381b('0xd')][_0x381b('0x47')]=function(_0x46cab7){RpcVoiceDialReport[_0x381b('0x3c')](_0x46cab7);var _0x29384b;var _0x549dad;var _0x457352=_0x46cab7[_0x381b('0x33')];if(_[_0x381b('0x48')](_0x457352,_0x381b('0x49'))){_0x549dad=_0x457352[_0x381b('0x4a')](_0x457352[_0x381b('0x4b')]('/')+0x1,_0x457352[_0x381b('0x4b')]('@'));_0x29384b=_['find'](this[_0x381b('0xb')],function(_0x22c36f){return _0x22c36f[_0x381b('0x4c')]==_0x549dad||_0x22c36f['phone']==_0x549dad||_0x22c36f[_0x381b('0x1b')]==_0x549dad;});}else{_0x549dad=_0x457352[_0x381b('0x4a')](_0x457352['indexOf']('/')+0x1,_0x457352[_0x381b('0x4d')]('-'));_0x29384b=this['findAgent'](_0x549dad);}if(_0x29384b){_0x46cab7[_0x381b('0x1e')]=_['isNil'](_0x29384b[_0x381b('0x1e')])?util['format'](_0x381b('0x20'),_0x29384b['name']):_0x29384b[_0x381b('0x1e')];_0x46cab7[_0x381b('0x44')]=_0x29384b['name'];_0x46cab7[_0x381b('0x1b')]=_0x29384b['accountcode'];RpcMemberReport[_0x381b('0x47')](_0x46cab7);}};Report['prototype'][_0x381b('0x4e')]=function(_0x2f1c4b){RpcVoiceTransferReport['transfers'][_0x2f1c4b['transfererlinkedid']]=_0x2f1c4b;};Report[_0x381b('0xd')][_0x381b('0x18')]=function(_0x241efe){RpcVoiceTransferReport[_0x381b('0x18')](_0x241efe);};module[_0x381b('0x4f')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index fbe61cd..8cf377b 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 _0x5f64=['bluebird','../../../config/logger','ami','../ami','redis','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','stateRegistry','state','merge','actionid','format','trunk:%s','name','trunk:save','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','telephone:save','startsWith','Local','substring','indexOf','find','phone','updateStatusRealtime','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','exports','lodash','moment','util','ioredis'];(function(_0x3ac1fd,_0x358b96){var _0x20036d=function(_0x4fcc4b){while(--_0x4fcc4b){_0x3ac1fd['push'](_0x3ac1fd['shift']());}};_0x20036d(++_0x358b96);}(_0x5f64,0x1ac));var _0x45f6=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x5f64[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x45f6('0x0'));var moment=require(_0x45f6('0x1'));var util=require(_0x45f6('0x2'));var Redis=require(_0x45f6('0x3'));var BPromise=require(_0x45f6('0x4'));var config=require('../../../config/environment');var logger=require(_0x45f6('0x5'))(_0x45f6('0x6'));var ami=require(_0x45f6('0x7'));config[_0x45f6('0x8')]=_['defaults'](config[_0x45f6('0x8')],{'host':_0x45f6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x45f6('0x8')]));function UserReport(_0x292592){this[_0x45f6('0xa')]=_0x292592[_0x45f6('0xa')];this['agents']=_0x292592[_0x45f6('0xb')];this['telephones']=_0x292592[_0x45f6('0xc')];ami['on']('registryentry',this[_0x45f6('0xd')]['bind'](this));ami['on']('registry',this[_0x45f6('0xd')][_0x45f6('0xe')](this));ami['on'](_0x45f6('0xf'),this[_0x45f6('0x10')][_0x45f6('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x45f6('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x45f6('0x11')](ami[_0x45f6('0x12')]())['catch'](function(_0x4e5781){logger[_0x45f6('0x13')](_0x45f6('0x14'),util[_0x45f6('0x15')](_0x4e5781,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x45f6('0x16')]()[_0x45f6('0x11')](ami[_0x45f6('0x17')]())[_0x45f6('0x18')](function(_0x429333){logger[_0x45f6('0x13')](_0x45f6('0x19'),util[_0x45f6('0x15')](_0x429333,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x45f6('0x16')]()[_0x45f6('0x11')](ami[_0x45f6('0x1a')]())[_0x45f6('0x18')](function(_0x3523ee){logger['error'](_0x45f6('0x1b'),util[_0x45f6('0x15')](_0x3523ee,{'showHidden':![],'depth':null}));});}UserReport[_0x45f6('0x1c')][_0x45f6('0x1d')]=function(){setInterval(function(){BPromise[_0x45f6('0x16')]()[_0x45f6('0x11')](showSipRegistrations())[_0x45f6('0x11')](listDeviceStates())[_0x45f6('0x11')](showPeersStatus());},0x32c8);};UserReport[_0x45f6('0x1c')][_0x45f6('0x1e')]=function(_0x1cad41){return _0x1cad41!==null&&!_[_0x45f6('0x1f')](_0x1cad41);};UserReport[_0x45f6('0x1c')][_0x45f6('0x20')]=function(_0x1e47f8,_0x5834be,_0x5c8947){io['to'](_0x1e47f8)['emit'](_0x5834be,_0x5c8947);};UserReport[_0x45f6('0x1c')]['syncRegistry']=function(_0x4a2f95){try{if(this['isNotNull'](_0x4a2f95)){logger[_0x45f6('0x21')](_0x45f6('0x22'),_0x4a2f95[_0x45f6('0x23')],_0x4a2f95['state']);logger[_0x45f6('0x24')](_0x45f6('0x25'),util[_0x45f6('0x15')](_0x4a2f95,{'showHidden':![],'depth':null}));var _0x30c681=_['find'](this[_0x45f6('0xa')],{'defaultuser':_0x4a2f95[_0x45f6('0x23')]});if(_0x30c681){_0x4a2f95[_0x45f6('0x26')]=_0x4a2f95[_0x45f6('0x27')];_[_0x45f6('0x28')](_0x30c681,_['omit'](_0x4a2f95,['event',_0x45f6('0x29'),'username',_0x45f6('0x27')]));logger[_0x45f6('0x24')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x45f6('0x15')](_0x30c681,{'showHidden':![],'depth':null}));this[_0x45f6('0x20')](util[_0x45f6('0x2a')](_0x45f6('0x2b'),_0x30c681[_0x45f6('0x2c')]),_0x45f6('0x2d'),_0x30c681);}}}catch(_0x2cfd3d){logger[_0x45f6('0x13')]('[userReport][registry]',util[_0x45f6('0x15')](_0x2cfd3d,{'showHidden':![],'depth':null}));}};UserReport[_0x45f6('0x1c')]['syncDeviceState']=function(_0x2e6e01){try{if(this[_0x45f6('0x1e')](_0x2e6e01)){logger[_0x45f6('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x2e6e01[_0x45f6('0x2e')],_0x2e6e01[_0x45f6('0x27')]);logger[_0x45f6('0x24')](_0x45f6('0x2f'),util[_0x45f6('0x15')](_0x2e6e01,{'showHidden':![],'depth':null}));if(this['agents'][_0x2e6e01[_0x45f6('0x2e')]]){if(!this[_0x45f6('0xb')][_0x2e6e01[_0x45f6('0x2e')]][_0x45f6('0x30')]||_0x2e6e01['state']['toLowerCase']()==_0x45f6('0x31')){this[_0x45f6('0xb')][_0x2e6e01[_0x45f6('0x2e')]]['local']=![];if(this[_0x45f6('0xb')][_0x2e6e01[_0x45f6('0x2e')]][_0x45f6('0x27')]!==_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]()){this[_0x45f6('0xb')][_0x2e6e01[_0x45f6('0x2e')]][_0x45f6('0x33')]=_[_0x45f6('0x34')](moment()['format']('x'));}this['agents'][_0x2e6e01[_0x45f6('0x2e')]][_0x45f6('0x27')]=_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]();this['agents'][_0x2e6e01['device']]['updateStatusRealtime'](_0x2e6e01);}}else if(this[_0x45f6('0xc')][_0x2e6e01[_0x45f6('0x2e')]]){if(this[_0x45f6('0xc')][_0x2e6e01['device']]['state']!==_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]()){this[_0x45f6('0xc')][_0x2e6e01[_0x45f6('0x2e')]]['stateTime']=_[_0x45f6('0x34')](moment()[_0x45f6('0x2a')]('x'));}this[_0x45f6('0xc')][_0x2e6e01['device']][_0x45f6('0x27')]=_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]();logger[_0x45f6('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x45f6('0xc')][_0x2e6e01[_0x45f6('0x2e')]],{'showHidden':![],'depth':null}));this[_0x45f6('0x20')](util['format']('telephone:%s',this[_0x45f6('0xc')][_0x2e6e01[_0x45f6('0x2e')]][_0x45f6('0x2c')]),_0x45f6('0x35'),this['telephones'][_0x2e6e01[_0x45f6('0x2e')]]);}else if(this[_0x45f6('0xa')][_0x2e6e01[_0x45f6('0x2e')]]){if(this[_0x45f6('0xa')][_0x2e6e01['device']][_0x45f6('0x27')]!==_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]()){this[_0x45f6('0xa')][_0x2e6e01['device']]['stateTime']=_[_0x45f6('0x34')](moment()['format']('x'));}this[_0x45f6('0xa')][_0x2e6e01['device']][_0x45f6('0x27')]=_0x2e6e01[_0x45f6('0x27')]['toLowerCase']();logger[_0x45f6('0x24')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x45f6('0x15')](this[_0x45f6('0xa')][_0x2e6e01[_0x45f6('0x2e')]],{'showHidden':![],'depth':null}));this[_0x45f6('0x20')](util[_0x45f6('0x2a')]('trunk:%s',this['trunks'][_0x2e6e01[_0x45f6('0x2e')]]['name']),_0x45f6('0x2d'),this[_0x45f6('0xa')][_0x2e6e01[_0x45f6('0x2e')]]);}else if(_[_0x45f6('0x36')](_0x2e6e01[_0x45f6('0x2e')],_0x45f6('0x37'))){var _0x4e4487=_0x2e6e01['device'];var _0x52dc25=_0x4e4487[_0x45f6('0x38')](_0x4e4487[_0x45f6('0x39')]('/')+0x1,_0x4e4487[_0x45f6('0x39')]('@'));var _0x541875=_[_0x45f6('0x3a')](this['agents'],function(_0x32d2ec){return _0x32d2ec['mobile']==_0x52dc25||_0x32d2ec[_0x45f6('0x3b')]==_0x52dc25||_0x32d2ec['accountcode']==_0x52dc25;});if(_0x541875){if(_0x541875['state']!==_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]()){_0x541875[_0x45f6('0x33')]=_[_0x45f6('0x34')](moment()[_0x45f6('0x2a')]('x'));}_0x541875[_0x45f6('0x27')]=_0x2e6e01[_0x45f6('0x27')][_0x45f6('0x32')]();_0x541875['local']=!![];_0x541875[_0x45f6('0x3c')](_0x2e6e01);}}}}catch(_0x28fe53){logger[_0x45f6('0x13')]('[userReport][devicestatechange]',util[_0x45f6('0x15')](_0x28fe53,{'showHidden':![],'depth':null}));}};UserReport[_0x45f6('0x1c')][_0x45f6('0x3d')]=function(_0x2c03b1){try{if(this[_0x45f6('0x1e')](_0x2c03b1)&&this[_0x45f6('0x1e')](_0x2c03b1[_0x45f6('0x3e')])){logger[_0x45f6('0x21')](_0x45f6('0x3f'),_0x2c03b1['peer'],_0x2c03b1[_0x45f6('0x40')],_0x2c03b1['peerstatus']);logger[_0x45f6('0x24')](_0x45f6('0x41'),util[_0x45f6('0x15')](_0x2c03b1,{'showHidden':![],'depth':null}));if(this[_0x45f6('0xb')][_0x2c03b1['peer']]){if(!this[_0x45f6('0xb')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x30')]||_0x2c03b1[_0x45f6('0x3e')]['toLowerCase']()==_0x45f6('0x43')){this[_0x45f6('0xb')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x30')]=![];this['agents'][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x44')]=_0x2c03b1[_0x45f6('0x3e')][_0x45f6('0x32')]();this[_0x45f6('0xb')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x40')]=_0x2c03b1[_0x45f6('0x40')];this[_0x45f6('0xb')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x3c')](_0x2c03b1);}}else if(this[_0x45f6('0xc')][_0x2c03b1['peer']]){this[_0x45f6('0xc')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x44')]=_0x2c03b1[_0x45f6('0x3e')]['toLowerCase']();this[_0x45f6('0xc')][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x40')]=_0x2c03b1['address'];logger[_0x45f6('0x24')](_0x45f6('0x45'),util['inspect'](this[_0x45f6('0xc')][_0x2c03b1[_0x45f6('0x42')]],{'showHidden':![],'depth':null}));this[_0x45f6('0x20')](util['format'](_0x45f6('0x46'),this[_0x45f6('0xc')][_0x2c03b1[_0x45f6('0x42')]]['name']),_0x45f6('0x35'),this[_0x45f6('0xc')][_0x2c03b1['peer']]);}else if(this['trunks'][_0x2c03b1[_0x45f6('0x42')]]){this[_0x45f6('0xa')][_0x2c03b1['peer']]['status']=_0x2c03b1['peerstatus'][_0x45f6('0x32')]();this[_0x45f6('0xa')][_0x2c03b1['peer']][_0x45f6('0x40')]=_0x2c03b1[_0x45f6('0x40')];logger[_0x45f6('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x45f6('0x15')](this[_0x45f6('0xa')][_0x2c03b1[_0x45f6('0x42')]],{'showHidden':![],'depth':null}));this[_0x45f6('0x20')](util[_0x45f6('0x2a')](_0x45f6('0x2b'),this['trunks'][_0x2c03b1[_0x45f6('0x42')]][_0x45f6('0x2c')]),'trunk:save',this[_0x45f6('0xa')][_0x2c03b1[_0x45f6('0x42')]]);}}}catch(_0x2abe86){logger[_0x45f6('0x13')](_0x45f6('0x41'),util[_0x45f6('0x15')](_0x2abe86,{'showHidden':![],'depth':null}));}};module[_0x45f6('0x47')]=UserReport; \ No newline at end of file +var _0x8d37=['peer','address','peerstatus','[userReport][peerstatus]','registered','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','socket.io-emitter','trunks','agents','telephones','registry','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','find','stateRegistry','merge','actionid','format','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','startsWith','indexOf','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s'];(function(_0x4cb252,_0x3df164){var _0x3c7a29=function(_0xd19e63){while(--_0xd19e63){_0x4cb252['push'](_0x4cb252['shift']());}};_0x3c7a29(++_0x3df164);}(_0x8d37,0x1ec));var _0x78d3=function(_0x3ae82c,_0x2c9146){_0x3ae82c=_0x3ae82c-0x0;var _0x3f0979=_0x8d37[_0x3ae82c];return _0x3f0979;};'use strict';var _=require(_0x78d3('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x78d3('0x1'));var BPromise=require(_0x78d3('0x2'));var config=require(_0x78d3('0x3'));var logger=require(_0x78d3('0x4'))('ami');var ami=require(_0x78d3('0x5'));config[_0x78d3('0x6')]=_['defaults'](config[_0x78d3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x78d3('0x7'))(new Redis(config['redis']));function UserReport(_0x2c8023){this[_0x78d3('0x8')]=_0x2c8023[_0x78d3('0x8')];this[_0x78d3('0x9')]=_0x2c8023[_0x78d3('0x9')];this[_0x78d3('0xa')]=_0x2c8023[_0x78d3('0xa')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0x78d3('0xb'),this[_0x78d3('0xc')][_0x78d3('0xd')](this));ami['on'](_0x78d3('0xe'),this[_0x78d3('0xf')][_0x78d3('0xd')](this));ami['on']('peerstatus',this[_0x78d3('0x10')][_0x78d3('0xd')](this));return this[_0x78d3('0x11')]();}function showSipRegistrations(){Promise[_0x78d3('0x12')]()[_0x78d3('0x13')](ami[_0x78d3('0x14')]())[_0x78d3('0x15')](function(_0xa8638){logger[_0x78d3('0x16')]('[userReport][sipshowregistry]',util[_0x78d3('0x17')](_0xa8638,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x78d3('0x12')]()[_0x78d3('0x13')](ami['actionDeviceStateList']())[_0x78d3('0x15')](function(_0x542e1a){logger[_0x78d3('0x16')](_0x78d3('0x18'),util['inspect'](_0x542e1a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x78d3('0x12')]()['then'](ami[_0x78d3('0x19')]())[_0x78d3('0x15')](function(_0x425718){logger[_0x78d3('0x16')](_0x78d3('0x1a'),util[_0x78d3('0x17')](_0x425718,{'showHidden':![],'depth':null}));});}UserReport[_0x78d3('0x1b')][_0x78d3('0x11')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x78d3('0x13')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x78d3('0x1b')][_0x78d3('0x1c')]=function(_0x25066a){return _0x25066a!==null&&!_[_0x78d3('0x1d')](_0x25066a);};UserReport[_0x78d3('0x1b')][_0x78d3('0x1e')]=function(_0x40936f,_0x6a9933,_0x41ffc3){io['to'](_0x40936f)['emit'](_0x6a9933,_0x41ffc3);};UserReport[_0x78d3('0x1b')]['syncRegistry']=function(_0x427362){try{if(this['isNotNull'](_0x427362)){logger[_0x78d3('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x427362[_0x78d3('0x20')],_0x427362[_0x78d3('0x21')]);logger[_0x78d3('0x22')](_0x78d3('0x23'),util[_0x78d3('0x17')](_0x427362,{'showHidden':![],'depth':null}));var _0x177a79=_[_0x78d3('0x24')](this[_0x78d3('0x8')],{'defaultuser':_0x427362['username']});if(_0x177a79){_0x427362[_0x78d3('0x25')]=_0x427362['state'];_[_0x78d3('0x26')](_0x177a79,_['omit'](_0x427362,['event',_0x78d3('0x27'),_0x78d3('0x20'),'state']));logger[_0x78d3('0x22')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x177a79,{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')]('trunk:%s',_0x177a79[_0x78d3('0x29')]),'trunk:save',_0x177a79);}}}catch(_0x7cbe89){logger['error'](_0x78d3('0x23'),util[_0x78d3('0x17')](_0x7cbe89,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x78d3('0xf')]=function(_0x3ea69c){try{if(this[_0x78d3('0x1c')](_0x3ea69c)){logger[_0x78d3('0x1f')](_0x78d3('0x2a'),_0x3ea69c[_0x78d3('0x2b')],_0x3ea69c[_0x78d3('0x21')]);logger[_0x78d3('0x22')]('[userReport][devicestatechange]',util[_0x78d3('0x17')](_0x3ea69c,{'showHidden':![],'depth':null}));if(this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]){if(!this[_0x78d3('0x9')][_0x3ea69c['device']][_0x78d3('0x2c')]||_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]()==_0x78d3('0x2e')){this['agents'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x2c')]=![];if(this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]['state']!==_0x3ea69c['state'][_0x78d3('0x2d')]()){this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]['stateTime']=_['toNumber'](moment()[_0x78d3('0x28')]('x'));}this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c['state'][_0x78d3('0x2d')]();this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x2f')](_0x3ea69c);}}else if(this['telephones'][_0x3ea69c[_0x78d3('0x2b')]]){if(this[_0x78d3('0xa')][_0x3ea69c['device']][_0x78d3('0x21')]!==_0x3ea69c['state']['toLowerCase']()){this[_0x78d3('0xa')][_0x3ea69c['device']]['stateTime']=_[_0x78d3('0x30')](moment()['format']('x'));}this['telephones'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]();logger['debug'](_0x78d3('0x31'),util['inspect'](this['telephones'][_0x3ea69c[_0x78d3('0x2b')]],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')]('telephone:%s',this['telephones'][_0x3ea69c['device']][_0x78d3('0x29')]),_0x78d3('0x32'),this[_0x78d3('0xa')][_0x3ea69c[_0x78d3('0x2b')]]);}else if(this[_0x78d3('0x8')][_0x3ea69c['device']]){if(this['trunks'][_0x3ea69c['device']]['state']!==_0x3ea69c['state']['toLowerCase']()){this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x33')]=_[_0x78d3('0x30')](moment()[_0x78d3('0x28')]('x'));}this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c['state'][_0x78d3('0x2d')]();logger[_0x78d3('0x22')](_0x78d3('0x34'),util[_0x78d3('0x17')](this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')](_0x78d3('0x35'),this['trunks'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x29')]),_0x78d3('0x36'),this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]]);}else if(_[_0x78d3('0x37')](_0x3ea69c['device'],'Local')){var _0x291cc2=_0x3ea69c[_0x78d3('0x2b')];var _0x43bdb5=_0x291cc2['substring'](_0x291cc2[_0x78d3('0x38')]('/')+0x1,_0x291cc2[_0x78d3('0x38')]('@'));var _0x45d8b4=_['find'](this[_0x78d3('0x9')],function(_0x451656){return _0x451656['mobile']==_0x43bdb5||_0x451656['phone']==_0x43bdb5||_0x451656[_0x78d3('0x39')]==_0x43bdb5;});if(_0x45d8b4){if(_0x45d8b4['state']!==_0x3ea69c['state'][_0x78d3('0x2d')]()){_0x45d8b4[_0x78d3('0x33')]=_[_0x78d3('0x30')](moment()[_0x78d3('0x28')]('x'));}_0x45d8b4[_0x78d3('0x21')]=_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]();_0x45d8b4[_0x78d3('0x2c')]=!![];_0x45d8b4['updateStatusRealtime'](_0x3ea69c);}}}}catch(_0x4a1eb0){logger[_0x78d3('0x16')](_0x78d3('0x3a'),util['inspect'](_0x4a1eb0,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x78d3('0x10')]=function(_0xca0c77){try{if(this[_0x78d3('0x1c')](_0xca0c77)&&this['isNotNull'](_0xca0c77['peerstatus'])){logger[_0x78d3('0x1f')](_0x78d3('0x3b'),_0xca0c77[_0x78d3('0x3c')],_0xca0c77[_0x78d3('0x3d')],_0xca0c77[_0x78d3('0x3e')]);logger[_0x78d3('0x22')](_0x78d3('0x3f'),util['inspect'](_0xca0c77,{'showHidden':![],'depth':null}));if(this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]]){if(!this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x2c')]||_0xca0c77['peerstatus'][_0x78d3('0x2d')]()==_0x78d3('0x40')){this[_0x78d3('0x9')][_0xca0c77['peer']][_0x78d3('0x2c')]=![];this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x41')]=_0xca0c77[_0x78d3('0x3e')]['toLowerCase']();this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x2f')](_0xca0c77);}}else if(this[_0x78d3('0xa')][_0xca0c77['peer']]){this['telephones'][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x41')]=_0xca0c77[_0x78d3('0x3e')][_0x78d3('0x2d')]();this[_0x78d3('0xa')][_0xca0c77['peer']][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];logger[_0x78d3('0x22')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x78d3('0x17')](this[_0x78d3('0xa')][_0xca0c77[_0x78d3('0x3c')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x78d3('0x28')](_0x78d3('0x42'),this[_0x78d3('0xa')][_0xca0c77['peer']][_0x78d3('0x29')]),_0x78d3('0x32'),this[_0x78d3('0xa')][_0xca0c77['peer']]);}else if(this[_0x78d3('0x8')][_0xca0c77['peer']]){this[_0x78d3('0x8')][_0xca0c77[_0x78d3('0x3c')]]['status']=_0xca0c77[_0x78d3('0x3e')][_0x78d3('0x2d')]();this[_0x78d3('0x8')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];logger['debug'](_0x78d3('0x43'),util[_0x78d3('0x17')](this[_0x78d3('0x8')][_0xca0c77['peer']],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')](_0x78d3('0x35'),this['trunks'][_0xca0c77[_0x78d3('0x3c')]]['name']),'trunk:save',this['trunks'][_0xca0c77['peer']]);}}}catch(_0x1c32e6){logger[_0x78d3('0x16')]('[userReport][peerstatus]',util[_0x78d3('0x17')](_0x1c32e6,{'showHidden':![],'depth':null}));}};module[_0x78d3('0x44')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 1f1cb46..65cfe94 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 _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%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:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%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:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x394241,_0x50e232){var _0x17b9ac=function(_0x4bbb27){while(--_0x4bbb27){_0x394241['push'](_0x394241['shift']());}};_0x17b9ac(++_0x50e232);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%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:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%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:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x5c4527,_0x4557f8){var _0x4d3bf2=function(_0x290c41){while(--_0x290c41){_0x5c4527['push'](_0x5c4527['shift']());}};_0x4d3bf2(++_0x4557f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 47ba24a..5fdf9e2 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 _0xa921=['[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastdata','cdr(','error','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','destinationchannel','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','monitors','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','util','ioredis','../../../config/logger','ami','../ami','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','newstate','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','blindtransfer','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','pick','keys','context','from-sip','channel','split','xcally-motion-preview','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','destconnectedlinenum'];(function(_0x456e2a,_0x9112c4){var _0xb79447=function(_0x44519e){while(--_0x44519e){_0x456e2a['push'](_0x456e2a['shift']());}};_0xb79447(++_0x9112c4);}(_0xa921,0x77));var _0x1a92=function(_0x33f26a,_0x1a833){_0x33f26a=_0x33f26a-0x0;var _0x46854c=_0xa921[_0x33f26a];return _0x46854c;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x1a92('0x0'));var path=require('path');var Redis=require(_0x1a92('0x1'));var config=require('../../../config/environment');var logger=require(_0x1a92('0x2'))(_0x1a92('0x3'));var ami=require(_0x1a92('0x4'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var applications=[_0x1a92('0x5'),_0x1a92('0x6'),_0x1a92('0x7'),_0x1a92('0x8'),_0x1a92('0x9'),'voicemail'];var dispositions=[_0x1a92('0xa'),_0x1a92('0xb'),'FAILED',_0x1a92('0xa'),'NO\x20ANSWER',_0x1a92('0xa'),_0x1a92('0xc'),'BUSY',_0x1a92('0xb'),_0x1a92('0xb'),_0x1a92('0xb')];config[_0x1a92('0xd')]=_['defaults'](config[_0x1a92('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x1a92('0xe'))(new Redis(config[_0x1a92('0xd')]));function VoiceCallReport(_0x579f26){this[_0x1a92('0xf')]=_0x579f26[_0x1a92('0xf')];this[_0x1a92('0x10')]=_0x579f26[_0x1a92('0x10')];this[_0x1a92('0x11')]={};ami['on'](_0x1a92('0x12'),this[_0x1a92('0x13')][_0x1a92('0x14')](this));ami['on']('newexten',this[_0x1a92('0x13')]['bind'](this));ami['on'](_0x1a92('0x15'),this['syncNewChannel'][_0x1a92('0x14')](this));ami['on'](_0x1a92('0x16'),this['syncNewState'][_0x1a92('0x14')](this));ami['on'](_0x1a92('0x17'),this[_0x1a92('0x18')]['bind'](this));ami['on'](_0x1a92('0x19'),this[_0x1a92('0x1a')][_0x1a92('0x14')](this));ami['on']('newcallerid',this[_0x1a92('0x1b')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x1a92('0x1c'),this['syncBlindTransfer'][_0x1a92('0x14')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x1a92('0x14')](this));ami['on'](_0x1a92('0x1d'),this[_0x1a92('0x1e')][_0x1a92('0x14')](this));try{logger['info'](_0x1a92('0x1f'));ami[_0x1a92('0x20')]();}catch(_0x1a6384){logger['error'](_0x1a92('0x21'),util[_0x1a92('0x22')](_0x1a6384,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x1a92('0x23')]=function(_0x5a8f45){return _0x5a8f45!==null&&!_['isUndefined'](_0x5a8f45);};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x25')]=function(_0x50b0f1,_0xa8afac,_0x132b3){io['to'](_0x50b0f1)['emit'](_0xa8afac,_0x132b3);};VoiceCallReport['prototype'][_0x1a92('0x1b')]=function(_0x1c330a){try{if(this[_0x1a92('0x23')](_0x1c330a)){logger[_0x1a92('0x26')](_0x1a92('0x27'),_0x1c330a[_0x1a92('0x28')],_0x1c330a[_0x1a92('0x29')],_0x1c330a[_0x1a92('0x2a')]);logger['debug'](_0x1a92('0x2b'),_0x1c330a[_0x1a92('0x28')],util[_0x1a92('0x22')](_0x1c330a,{'showHidden':![],'depth':null}));if(_0x1c330a[_0x1a92('0x28')]===_0x1c330a[_0x1a92('0x2c')]){if(!_[_0x1a92('0x2d')](this[_0x1a92('0xf')][_0x1c330a[_0x1a92('0x28')]])){_['merge'](this['channels'][_0x1c330a[_0x1a92('0x28')]],_[_0x1a92('0x2e')](_0x1c330a,_[_0x1a92('0x2f')](this[_0x1a92('0xf')][_0x1c330a[_0x1a92('0x28')]])));}}if(_0x1c330a[_0x1a92('0x30')]===_0x1a92('0x31')){if(this[_0x1a92('0x10')][_0x1c330a[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]){if(_0x1c330a['exten']==_0x1a92('0x34')){this['agents'][_0x1c330a[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['destconnectedlinenum']=_0x1c330a[_0x1a92('0x35')];this['emit'](util[_0x1a92('0x36')](_0x1a92('0x37'),this[_0x1a92('0x10')][_0x1c330a[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x38')]),_0x1a92('0x39'),{'destaccountcode':this[_0x1a92('0x10')][_0x1c330a['channel'][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x3a')],'destconnectedlinenum':_0x1c330a['connectedlinenum']});}}}}}catch(_0xdd1065){logger['error'](_0x1a92('0x3b'),_0x1c330a['uniqueid'],util[_0x1a92('0x22')](_0xdd1065,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x3c')]=function(_0x4c04cb){try{if(this['isNotNull'](_0x4c04cb)){logger[_0x1a92('0x3d')](_0x1a92('0x3e'),_0x4c04cb[_0x1a92('0x28')],util[_0x1a92('0x22')](_0x4c04cb,{'showHidden':![],'depth':null}));if(_0x4c04cb['uniqueid']===_0x4c04cb[_0x1a92('0x2c')]&&_0x4c04cb['channel']!=_0x1a92('0x3f')){if(_[_0x1a92('0x2d')](this[_0x1a92('0xf')][_0x4c04cb[_0x1a92('0x28')]])){logger['info'](_0x1a92('0x40'),_0x4c04cb[_0x1a92('0x28')],_0x4c04cb['context'],_0x4c04cb[_0x1a92('0x41')]);this['channels'][_0x4c04cb[_0x1a92('0x28')]]=new Channel();this[_0x1a92('0xf')][_0x4c04cb[_0x1a92('0x28')]]['starttime']=moment()['format'](_0x1a92('0x42'));this[_0x1a92('0xf')][_0x4c04cb[_0x1a92('0x28')]][_0x1a92('0x43')]=dispositions[_[_0x1a92('0x44')](_0x4c04cb[_0x1a92('0x45')])];_[_0x1a92('0x46')](this[_0x1a92('0xf')][_0x4c04cb[_0x1a92('0x28')]],_[_0x1a92('0x2e')](_0x4c04cb,_[_0x1a92('0x2f')](this[_0x1a92('0xf')][_0x4c04cb['uniqueid']])));if(_0x4c04cb[_0x1a92('0x30')]===_0x1a92('0x31')){if(this[_0x1a92('0x10')][_0x4c04cb['channel']['split']('-')[0x0]]){if(_[_0x1a92('0x2d')](this[_0x1a92('0x10')][_0x4c04cb[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x47')])){this[_0x1a92('0x10')][_0x4c04cb[_0x1a92('0x32')]['split']('-')[0x0]][_0x1a92('0x47')]=_0x4c04cb[_0x1a92('0x41')];logger[_0x1a92('0x3d')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x4c04cb[_0x1a92('0x28')],util[_0x1a92('0x22')]({'id':this[_0x1a92('0x10')][_0x4c04cb[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['id'],'destaccountcode':this[_0x1a92('0x10')][_0x4c04cb['channel'][_0x1a92('0x33')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4c04cb[_0x1a92('0x41')]},{'showHidden':![],'depth':null}));this[_0x1a92('0x25')](util[_0x1a92('0x36')](_0x1a92('0x37'),this[_0x1a92('0x10')][_0x4c04cb[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['name']),_0x1a92('0x39'),{'id':this['agents'][_0x4c04cb[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4c04cb[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4c04cb[_0x1a92('0x41')]});}}}}}}}catch(_0x580435){logger['error'](_0x1a92('0x48'),_0x4c04cb['uniqueid'],util['inspect'](_0x580435,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')]['syncNewExten']=function(_0x35ef14){try{if(this[_0x1a92('0x23')](_0x35ef14)){logger[_0x1a92('0x3d')](_0x1a92('0x49'),_0x35ef14[_0x1a92('0x28')],util[_0x1a92('0x22')](_0x35ef14,{'showHidden':![],'depth':null}));if(_0x35ef14[_0x1a92('0x28')]===_0x35ef14['linkedid']&&_0x35ef14[_0x1a92('0x41')]!='h'&&_0x35ef14['channel']!=_0x1a92('0x3f')){_0x35ef14[_0x1a92('0x4a')]=_0x35ef14['application'][_0x1a92('0x4b')]();_0x35ef14[_0x1a92('0x4c')]=_0x35ef14['appdata']&&_0x35ef14[_0x1a92('0x4d')]['startsWith'](_0x1a92('0x4e'))?_0x35ef14[_0x1a92('0x4d')]:(_0x35ef14[_0x1a92('0x4d')]||_0x35ef14['applicationdata'])[_0x1a92('0x4b')]();logger[_0x1a92('0x26')](_0x1a92('0x4f'),_0x35ef14['uniqueid'],_0x35ef14[_0x1a92('0x4a')],_0x35ef14['applicationdata']);if(_['isUndefined'](this[_0x1a92('0xf')][_0x35ef14['uniqueid']])){this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]]=new Channel();this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]][_0x1a92('0x50')]=_0x35ef14[_0x1a92('0x51')]?moment()[_0x1a92('0x52')](moment[_0x1a92('0x51')](_0x35ef14[_0x1a92('0x51')])[_0x1a92('0x53')](),_0x1a92('0x53'))['format'](_0x1a92('0x42')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]]['disposition']=_0x1a92('0xa');}_[_0x1a92('0x46')](this['channels'][_0x35ef14[_0x1a92('0x28')]],_['pick'](_0x35ef14,_[_0x1a92('0x2f')](this['channels'][_0x35ef14['uniqueid']])));if(_[_0x1a92('0x54')](applications,_0x35ef14[_0x1a92('0x4a')])){this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]]['lastapplication']=_0x35ef14[_0x1a92('0x4a')];this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]][_0x1a92('0x55')]=_0x35ef14[_0x1a92('0x4c')];if(_0x35ef14['application']==='set'&&_['startsWith'](_0x35ef14['applicationdata'][_0x1a92('0x4b')](),_0x1a92('0x56'))){var _0x4dde0c=_0x35ef14[_0x1a92('0x4c')][_0x1a92('0x33')]('=');var _0x5852ef=_0x4dde0c[0x0][_0x1a92('0x4b')]()['match'](/cdr\((.*)\)/);if(_0x5852ef){this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]][_0x5852ef[0x1]]=_0x4dde0c[0x1];}}else if(_0x35ef14[_0x1a92('0x4a')]===_0x1a92('0x6')){this[_0x1a92('0xf')][_0x35ef14[_0x1a92('0x28')]][_0x1a92('0x6')]=_0x35ef14[_0x1a92('0x4c')][_0x1a92('0x33')](',')[0x0];}}}}}catch(_0x162c05){logger[_0x1a92('0x57')](_0x1a92('0x58'),_0x35ef14[_0x1a92('0x28')],util['inspect'](_0x162c05,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x59')]=function(_0x69db3b){try{if(this[_0x1a92('0x23')](_0x69db3b)){logger[_0x1a92('0x26')](_0x1a92('0x5a'),_0x69db3b[_0x1a92('0x28')],_0x69db3b[_0x1a92('0x2c')],_0x69db3b[_0x1a92('0x29')],_0x69db3b[_0x1a92('0x2a')]);logger['debug'](_0x1a92('0x5b'),_0x69db3b['uniqueid'],util['inspect'](_0x69db3b,{'showHidden':![],'depth':null}));if(_0x69db3b['uniqueid']!==_0x69db3b['linkedid']){if(this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]]){if(_0x69db3b[_0x1a92('0x45')]==='6'){if(!this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x5c')]){var _0x1aac99=moment();this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x5c')]=!![];this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x5d')]=_0x1aac99[_0x1a92('0x36')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x50')]){this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x5e')]=_0x1aac99[_0x1a92('0x5f')](this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x50')],'seconds');}}this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x2c')]=_0x69db3b[_0x1a92('0x28')];if(_0x69db3b[_0x1a92('0x2a')]!=='xcally-motion-preview'){this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x35')]=_0x69db3b['calleridnum'];}this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]]['connectedlinename']=_0x69db3b[_0x1a92('0x29')];this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x60')]=_0x69db3b[_0x1a92('0x32')];this['channels'][_0x69db3b['linkedid']][_0x1a92('0x43')]=dispositions[_[_0x1a92('0x44')](_0x69db3b[_0x1a92('0x45')])];if(this[_0x1a92('0x10')][_0x69db3b['channel'][_0x1a92('0x33')]('-')[0x0]]){this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x61')]=this[_0x1a92('0x10')][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]]['id'];this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]]['membername']=this['agents'][_0x69db3b[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x38')];}}}}else{if(this['channels'][_0x69db3b[_0x1a92('0x28')]]){if(_0x69db3b['channelstate']==='6'){if(this[_0x1a92('0x10')][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]]){this[_0x1a92('0xf')][_0x69db3b['uniqueid']]['UserId']=this['agents'][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]]['id'];this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x28')]]['membername']=this['agents'][_0x69db3b[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x38')];}}}}if(_0x69db3b[_0x1a92('0x45')]==='6'&&_0x69db3b[_0x1a92('0x30')]===_0x1a92('0x31')){if(this[_0x1a92('0x10')][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]]){this['agents'][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]][_0x1a92('0x47')]=_0x69db3b[_0x1a92('0x41')];var _0x332260,_0x59bb95;if(this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x28')]]){_0x332260=this[_0x1a92('0xf')][_0x69db3b['uniqueid']][_0x1a92('0x62')];_0x59bb95=this['channels'][_0x69db3b[_0x1a92('0x28')]][_0x1a92('0x6')];}else if(this[_0x1a92('0xf')][_0x69db3b[_0x1a92('0x2c')]]){_0x332260=this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x62')];_0x59bb95=this['channels'][_0x69db3b[_0x1a92('0x2c')]][_0x1a92('0x6')];}logger[_0x1a92('0x3d')](_0x1a92('0x63'),_0x69db3b['uniqueid'],util[_0x1a92('0x22')]({'id':this[_0x1a92('0x10')][_0x69db3b['channel']['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x69db3b[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x3a')],'destconnectedlinenum':_0x69db3b[_0x1a92('0x41')],'routealias':_0x332260,'queue':_0x59bb95||undefined},{'showHidden':![],'depth':null}));this[_0x1a92('0x25')](util[_0x1a92('0x36')]('user:%s',this['agents'][_0x69db3b['channel'][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x38')]),_0x1a92('0x39'),{'id':this[_0x1a92('0x10')][_0x69db3b[_0x1a92('0x32')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x69db3b[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x3a')],'destconnectedlinenum':_0x69db3b[_0x1a92('0x41')],'routealias':_0x332260,'queue':_0x59bb95||undefined});}}}}catch(_0x10a405){logger[_0x1a92('0x57')](_0x1a92('0x64'),_0x69db3b['uniqueid'],util[_0x1a92('0x22')](_0x10a405,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x65')]=function(_0x4412ab,_0x146773){try{if(this[_0x1a92('0xf')][_0x4412ab]){logger[_0x1a92('0x26')](_0x1a92('0x66'),_0x4412ab,_0x146773);this[_0x1a92('0xf')][_0x4412ab][_0x1a92('0x67')]=!![];if(_[_0x1a92('0x68')](_0x146773,_0x1a92('0x69'))){_0x146773=_0x146773[_0x1a92('0x6a')](_0x1a92('0x69'),_0x1a92('0x6b'));}this[_0x1a92('0xf')][_0x4412ab][_0x1a92('0x6c')]=_0x146773;var _0x288931=_['find'](this[_0x1a92('0xf')][_0x4412ab]['monitors'],{'filename':_0x146773});if(_[_0x1a92('0x6d')](_0x288931)){this['channels'][_0x4412ab]['monitors'][_0x1a92('0x6e')]({'filename':_0x146773,'createdAt':moment()[_0x1a92('0x36')](_0x1a92('0x42')),'mixmonitorid':'','status':_0x1a92('0x6f')});}}}catch(_0x2878cf){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x4412ab,util[_0x1a92('0x22')](_0x2878cf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x18')]=function(_0x1ee01e){try{if(this[_0x1a92('0x23')](_0x1ee01e)){logger[_0x1a92('0x3d')](_0x1a92('0x70'),_0x1ee01e['uniqueid'],util[_0x1a92('0x22')](_0x1ee01e,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ee01e[_0x1a92('0x28')]]&&_0x1ee01e[_0x1a92('0x32')]!='OutgoingSpoolFailed'){if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')])){if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x72')])){logger[_0x1a92('0x26')](_0x1a92('0x73'),_0x1ee01e[_0x1a92('0x28')],_0x1ee01e[_0x1a92('0x74')]);this[_0x1a92('0x65')](_0x1ee01e['uniqueid'],_0x1ee01e['value']);}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x75')])){logger[_0x1a92('0x26')](_0x1a92('0x76'),_0x1ee01e['uniqueid'],_0x1ee01e[_0x1a92('0x74')]);this[_0x1a92('0xf')][_0x1ee01e[_0x1a92('0x28')]][_0x1a92('0x2a')]=_0x1ee01e[_0x1a92('0x74')];}else if(this['isNotNull'](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x77')])){logger[_0x1a92('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x1ee01e['uniqueid'],_0x1ee01e[_0x1a92('0x74')]);this['channels'][_0x1ee01e[_0x1a92('0x28')]]['callerid']=_0x1ee01e['value'];}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x78')])){logger[_0x1a92('0x26')](_0x1a92('0x79'),_0x1ee01e[_0x1a92('0x28')],_0x1ee01e[_0x1a92('0x74')]);this[_0x1a92('0xf')][_0x1ee01e['uniqueid']][_0x1a92('0x7a')]=_0x1ee01e[_0x1a92('0x74')];}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x7b')])){logger[_0x1a92('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x1ee01e[_0x1a92('0x28')],_0x1ee01e[_0x1a92('0x74')][_0x1a92('0x33')](',')[0x0]);this[_0x1a92('0xf')][_0x1ee01e[_0x1a92('0x28')]]['queue']=_0x1ee01e[_0x1a92('0x74')][_0x1a92('0x33')](',')[0x0];}else if(this['isNotNull'](_0x1ee01e['variable'][_0x1a92('0x7c')])){logger[_0x1a92('0x26')](_0x1a92('0x7d'),_0x1ee01e[_0x1a92('0x28')],_0x1ee01e[_0x1a92('0x74')]);this['channels'][_0x1ee01e[_0x1a92('0x28')]][_0x1a92('0x7e')]=_0x1ee01e[_0x1a92('0x74')];}else if(this['isNotNull'](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x7f')])){logger['info'](_0x1a92('0x80'),_0x1ee01e[_0x1a92('0x28')],_0x1ee01e[_0x1a92('0x74')]);this['channels'][_0x1ee01e[_0x1a92('0x28')]][_0x1a92('0x81')]=_0x1ee01e[_0x1a92('0x74')];}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x82')])){logger[_0x1a92('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x1ee01e['uniqueid'],_0x1ee01e['value']);this[_0x1a92('0xf')][_0x1ee01e[_0x1a92('0x28')]]['calleridpreview']=_0x1ee01e[_0x1a92('0x74')];}else if(this['isNotNull'](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x83')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x1ee01e[_0x1a92('0x28')],_0x1ee01e['value']);this[_0x1a92('0xf')][_0x1ee01e[_0x1a92('0x28')]][_0x1a92('0x6')]=_0x1ee01e['value'];}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x84')])){logger['info'](_0x1a92('0x85'),_0x1ee01e['uniqueid'],_0x1ee01e[_0x1a92('0x74')]);this['channels'][_0x1ee01e[_0x1a92('0x28')]][_0x1a92('0x86')]=_0x1ee01e['value'];}}}else if(this[_0x1a92('0x23')](_0x1ee01e[_0x1a92('0x71')][_0x1a92('0x72')])){if(_0x1ee01e['value']){var _0x44b6b7=path[_0x1a92('0x87')](_0x1ee01e[_0x1a92('0x74')])['name'];logger['info'](_0x1a92('0x73'),_0x44b6b7,_0x1ee01e[_0x1a92('0x74')]);this['syncMixMonitorFilename'](_0x44b6b7,_0x1ee01e[_0x1a92('0x74')]);}}else if(this['channels'][_0x1ee01e[_0x1a92('0x2c')]]){if(this[_0x1a92('0x23')](_0x1ee01e['variable'])){if(this[_0x1a92('0x23')](_0x1ee01e['variable'][_0x1a92('0x84')])){logger[_0x1a92('0x26')](_0x1a92('0x85'),_0x1ee01e['linkedid'],_0x1ee01e[_0x1a92('0x74')]);this[_0x1a92('0xf')][_0x1ee01e[_0x1a92('0x2c')]][_0x1a92('0x88')]=_0x1ee01e[_0x1a92('0x74')];}}}}}catch(_0x16917d){logger[_0x1a92('0x57')](_0x1a92('0x89'),_0x1ee01e['uniqueid'],util[_0x1a92('0x22')](_0x16917d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a92('0x24')][_0x1a92('0x1a')]=function(_0x463b44){try{if(this['isNotNull'](_0x463b44)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x463b44[_0x1a92('0x28')],util['inspect'](_0x463b44,{'showHidden':![],'depth':null}));if(this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]]){logger[_0x1a92('0x26')](_0x1a92('0x8a'),_0x463b44[_0x1a92('0x28')],_0x463b44[_0x1a92('0x8b')]);var _0x5d8049=moment();this[_0x1a92('0xf')][_0x463b44['uniqueid']]['endtime']=_0x5d8049[_0x1a92('0x36')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]]['duration']=_0x5d8049[_0x1a92('0x5f')](this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x50')],_0x1a92('0x53'));if(this[_0x1a92('0xf')][_0x463b44['uniqueid']][_0x1a92('0x5c')]){this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x8c')]=_0x5d8049[_0x1a92('0x5f')](this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x5d')],_0x1a92('0x53'));this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x5e')]=this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x51')]-this[_0x1a92('0xf')][_0x463b44[_0x1a92('0x28')]][_0x1a92('0x8c')];}if(_0x463b44[_0x1a92('0x30')]===_0x1a92('0x31')){if(this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]){this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]=_[_0x1a92('0x8d')](this[_0x1a92('0x10')][_0x463b44['channel']['split']('-')[0x0]],['destconnectedlinenum']);logger[_0x1a92('0x3d')](_0x1a92('0x8e'),_0x463b44[_0x1a92('0x28')],util[_0x1a92('0x22')]({'id':this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['id'],'destaccountcode':this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')]['split']('-')[0x0]][_0x1a92('0x3a')]},{'showHidden':![],'depth':null}));this[_0x1a92('0x25')](util[_0x1a92('0x36')]('user:%s',this[_0x1a92('0x10')][_0x463b44['channel'][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x38')]),_0x1a92('0x8f'),{'id':this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]]['id'],'destaccountcode':this[_0x1a92('0x10')][_0x463b44[_0x1a92('0x32')][_0x1a92('0x33')]('-')[0x0]][_0x1a92('0x3a')]});for(var _0x1b61f6=0x0;_0x1b61f60x0?_0x25f94f:0x0;this[_0xd4a3('0x14')][_0x85c3e2['queue']][_0xd4a3('0x32')]=this[_0xd4a3('0x14')][_0x85c3e2['queue']]['talking']>_['toNumber'](_0x85c3e2[_0xd4a3('0x6f')])?_[_0xd4a3('0x6e')](_0x85c3e2[_0xd4a3('0x6f')]):this[_0xd4a3('0x14')][_0x85c3e2[_0xd4a3('0x68')]][_0xd4a3('0x32')];this['emitVoiceQueueSummary'](this[_0xd4a3('0x14')][_0x85c3e2['queue']],'queuesummary');}logger['debug'](_0xd4a3('0x70'),util[_0xd4a3('0x40')](this[_0xd4a3('0x14')][_0x85c3e2[_0xd4a3('0x68')]],{'showHidden':![],'depth':null}));ami[_0xd4a3('0x45')](_0xd4a3('0x71'),this[_0xd4a3('0x14')][_0x85c3e2['queue']]);}}}catch(_0x3e3f1b){logger[_0xd4a3('0x3e')](_0xd4a3('0x67'),util[_0xd4a3('0x40')](_0x3e3f1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')][_0xd4a3('0x1c')]=function(_0x2cc696){logger[_0xd4a3('0x47')](_0xd4a3('0x72'),util[_0xd4a3('0x40')](_0x2cc696,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xd4a3('0x35')]['syncQueueCallerJoin']=function(_0xc80536){try{if(this['isNotNull'](_0xc80536)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0xc80536[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0xc80536,{'showHidden':![],'depth':null}));if(_[_0xd4a3('0x63')](this['queueReports'][_0xc80536[_0xd4a3('0x48')]]))this['queueReports'][_0xc80536[_0xd4a3('0x48')]]=[];if(_[_0xd4a3('0x63')](this[_0xd4a3('0x12')][_0xc80536[_0xd4a3('0x48')]]))this['channels'][_0xc80536[_0xd4a3('0x48')]]={};var _0x2d08b2=new QueueReport();_0x2d08b2[_0xd4a3('0x4b')]=_0xc80536[_0xd4a3('0x68')];_0x2d08b2['type']=this['voiceQueues'][_0x2d08b2[_0xd4a3('0x4b')]]&&this[_0xd4a3('0x14')][_0x2d08b2[_0xd4a3('0x4b')]][_0xd4a3('0x5a')]?this['voiceQueues'][_0x2d08b2[_0xd4a3('0x4b')]]['type']||'inbound':_0xd4a3('0x52');_0x2d08b2[_0xd4a3('0x68')]=_0xc80536[_0xd4a3('0x68')];_0x2d08b2[_0xd4a3('0x73')]=moment()[_0xd4a3('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d08b2['position']=_0xc80536['position'];_0x2d08b2[_0xd4a3('0x74')]=_0xc80536[_0xd4a3('0x74')];_0x2d08b2['uniqueid']=_0xc80536[_0xd4a3('0x48')];_0x2d08b2[_0xd4a3('0x75')]=this['channels'][_0xc80536[_0xd4a3('0x48')]][_0xd4a3('0x75')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2d08b2[_0xd4a3('0x4b')],_0x2d08b2[_0xd4a3('0x5a')]);_[_0xd4a3('0x76')](_0x2d08b2,_['pick'](_0xc80536,_[_0xd4a3('0x77')](_0x2d08b2)));this[_0xd4a3('0x10')][_0xc80536[_0xd4a3('0x48')]][_0xd4a3('0x78')](_0x2d08b2);this[_0xd4a3('0x12')][_0xc80536[_0xd4a3('0x48')]]=_0x2d08b2;this[_0xd4a3('0x46')](_0x2d08b2,_0xd4a3('0x1d'));}}catch(_0xa019d4){logger[_0xd4a3('0x3e')](_0xd4a3('0x79'),_0xc80536['uniqueid'],util[_0xd4a3('0x40')](_0xa019d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')]['syncQueueCallerAbandon']=function(_0x3a3f3c){try{if(this[_0xd4a3('0x62')](_0x3a3f3c)){logger['debug'](_0xd4a3('0x7a'),_0x3a3f3c[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x3a3f3c,{'showHidden':![],'depth':null}));if(this[_0xd4a3('0x10')][_0x3a3f3c[_0xd4a3('0x48')]]){var _0x529ffb=_[_0xd4a3('0x7b')](this['queueReports'][_0x3a3f3c['uniqueid']]);_0x529ffb[_0xd4a3('0x7c')]=![];_0x529ffb[_0xd4a3('0x7d')]=null;_0x529ffb[_0xd4a3('0x7e')]=_0x3a3f3c['holdtime'];_0x529ffb['originalposition']=_0x3a3f3c[_0xd4a3('0x7f')];_0x529ffb[_0xd4a3('0x1e')]=!![];_0x529ffb[_0xd4a3('0x80')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x529ffb[_0xd4a3('0x82')]=_0xd4a3('0x83');_0x529ffb['lastAssignedTo']=null;logger[_0xd4a3('0x6a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x529ffb[_0xd4a3('0x4b')],_0x529ffb[_0xd4a3('0x5a')]);this[_0xd4a3('0x12')][_0x3a3f3c[_0xd4a3('0x48')]]=_0x529ffb;this[_0xd4a3('0x43')](_0x529ffb,'queuecallerabandon');}}}catch(_0x102c5b){logger[_0xd4a3('0x3e')](_0xd4a3('0x7a'),_0x3a3f3c[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x102c5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')][_0xd4a3('0x21')]=function(_0x5599fc){try{if(this['isNotNull'](_0x5599fc)){logger[_0xd4a3('0x47')](_0xd4a3('0x84'),_0x5599fc['uniqueid'],util[_0xd4a3('0x40')](_0x5599fc,{'showHidden':![],'depth':null}));if(this[_0xd4a3('0x10')][_0x5599fc[_0xd4a3('0x48')]]){var _0x1147fc=_[_0xd4a3('0x7b')](this[_0xd4a3('0x10')][_0x5599fc['uniqueid']]);_0x1147fc[_0xd4a3('0x85')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x1147fc[_0xd4a3('0x86')]=_0x5599fc[_0xd4a3('0x86')];_0x1147fc[_0xd4a3('0x87')]=_0x5599fc[_0xd4a3('0x87')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1147fc['name'],_0x1147fc[_0xd4a3('0x5a')],_0x5599fc[_0xd4a3('0x86')],_0x5599fc[_0xd4a3('0x87')]);this[_0xd4a3('0x12')][_0x5599fc[_0xd4a3('0x48')]]=_0x1147fc;this[_0xd4a3('0x46')](_0x1147fc,'queuecallerleave');}}}catch(_0x143e7d){logger[_0xd4a3('0x3e')](_0xd4a3('0x84'),_0x5599fc[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x143e7d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')][_0xd4a3('0x88')]=function(_0x582430){try{if(this[_0xd4a3('0x62')](_0x582430)){logger['debug'](_0xd4a3('0x89'),_0x582430['uniqueid'],util['inspect'](_0x582430,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x582430[_0xd4a3('0x48')]]){var _0x100952=_[_0xd4a3('0x7b')](this[_0xd4a3('0x10')][_0x582430[_0xd4a3('0x48')]]);_0x100952[_0xd4a3('0x7c')]=!![];_0x100952[_0xd4a3('0x82')]='COMPLETEDBYAGENT';logger[_0xd4a3('0x6a')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x100952[_0xd4a3('0x4b')],_0x100952[_0xd4a3('0x5a')]);}}}catch(_0x285869){logger[_0xd4a3('0x3e')](_0xd4a3('0x89'),_0x582430[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x285869,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd4a3('0x22')]=function(_0x1d14b3){try{if(this[_0xd4a3('0x62')](_0x1d14b3)){logger[_0xd4a3('0x47')](_0xd4a3('0x8a'),_0x1d14b3[_0xd4a3('0x48')],util['inspect'](_0x1d14b3,{'showHidden':![],'depth':null}));if(this[_0xd4a3('0x10')][_0x1d14b3[_0xd4a3('0x48')]]){var _0x3652b1=_[_0xd4a3('0x7b')](this['queueReports'][_0x1d14b3[_0xd4a3('0x48')]]);_0x3652b1['queuecallerabandon']=![];_0x3652b1['queuecallerabandonAt']=null;_0x3652b1['assigned']=!![];_0x3652b1[_0xd4a3('0x8b')]=_0x1d14b3[_0xd4a3('0x8c')];_0x3652b1[_0xd4a3('0x7e')]=_0x1d14b3[_0xd4a3('0x7e')];_0x3652b1['queuecallercomplete']=!![];_0x3652b1[_0xd4a3('0x8d')]=![];_0x3652b1['queuecallerexitAt']=null;if(!_0x3652b1['transfer']){if(_0x1d14b3[_0xd4a3('0x8e')]==_0xd4a3('0x8f')){_0x3652b1[_0xd4a3('0x82')]=_0xd4a3('0x90');logger[_0xd4a3('0x6a')](_0xd4a3('0x91'),_0x3652b1[_0xd4a3('0x4b')],_0x3652b1[_0xd4a3('0x5a')]);}else{if(_['startsWith'](_0x1d14b3[_0xd4a3('0x3a')][_0xd4a3('0x92')](),_0xd4a3('0x93'))){if(this[_0xd4a3('0x10')][_0x1d14b3[_0xd4a3('0x94')]]){var _0x1d1b7e=_[_0xd4a3('0x7b')](this['queueReports'][_0x1d14b3['linkedid']]);_0x1d1b7e[_0xd4a3('0x7c')]=![];_0x1d1b7e[_0xd4a3('0x8d')]=!![];_0x1d1b7e[_0xd4a3('0x95')]=moment(_0x3652b1[_0xd4a3('0x73')])[_0xd4a3('0x96')](_0x1d14b3['holdtime'],_0xd4a3('0x97'))[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x1d1b7e[_0xd4a3('0x82')]=_0xd4a3('0x98');_0x1d1b7e[_0xd4a3('0x8f')]=!![];_0x1d1b7e[_0xd4a3('0x99')]=_0xd4a3('0x9a');_0x1d1b7e[_0xd4a3('0x9b')]=_0x1d14b3['destexten'];_0x1d1b7e[_0xd4a3('0x9c')]=_0x1d14b3[_0xd4a3('0x48')];logger['info'](_0xd4a3('0x9d'),_0x1d1b7e['name'],_0x1d1b7e[_0xd4a3('0x5a')]);var _0x9d1431=this[_0xd4a3('0x10')][_0x1d14b3['linkedid']];this[_0xd4a3('0x10')][_0x1d14b3[_0xd4a3('0x94')]]=this[_0xd4a3('0x10')][_0x1d14b3[_0xd4a3('0x48')]];this[_0xd4a3('0x10')][_0x1d14b3[_0xd4a3('0x48')]]=_0x9d1431;}}else{_0x3652b1[_0xd4a3('0x82')]=_0xd4a3('0x9e')+_0x1d14b3[_0xd4a3('0x8e')][_0xd4a3('0x9f')]();logger[_0xd4a3('0x6a')](_0xd4a3('0xa0'),_0x3652b1['name'],_0x3652b1[_0xd4a3('0x5a')],_0x3652b1[_0xd4a3('0x82')]);}}}this[_0xd4a3('0x12')][_0x1d14b3[_0xd4a3('0x48')]]=_0x3652b1;this['emitVoiceQueueChannelRemove'](_0x3652b1,'agentcomplete');}}}catch(_0x416e5d){logger[_0xd4a3('0x3e')]('[%s][voiceQueueReport][agentcomplete]',_0x1d14b3['uniqueid'],util[_0xd4a3('0x40')](_0x416e5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')][_0xd4a3('0x24')]=function(_0x265490){try{if(this[_0xd4a3('0x62')](_0x265490)){logger[_0xd4a3('0x47')](_0xd4a3('0xa1'),_0x265490[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x265490,{'showHidden':![],'depth':null}));this[_0xd4a3('0xa2')](_0x265490[_0xd4a3('0x48')],_[_0xd4a3('0x77')](_0x265490[_0xd4a3('0xa3')])[0x0],_0x265490[_0xd4a3('0xa4')]);if(this['queueReports'][_0x265490['uniqueid']]){var _0x2a5bdc=_[_0xd4a3('0x7b')](this[_0xd4a3('0x10')][_0x265490['uniqueid']]);if(_0x2a5bdc){if(this['isNotNull'](_0x265490[_0xd4a3('0xa3')])&&this['isNotNull'](_0x265490[_0xd4a3('0xa3')]['queuestatus'])){switch(_0x265490[_0xd4a3('0xa4')]){case _0xd4a3('0xa5'):_0x2a5bdc['queuecallerexit']=![];_0x2a5bdc[_0xd4a3('0x95')]=null;break;case'TIMEOUT':_0x2a5bdc['lastevent']=_0xd4a3('0xa6');_0x2a5bdc['queuecallerexit']=!![];_0x2a5bdc[_0xd4a3('0x95')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x2a5bdc[_0xd4a3('0x85')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));logger[_0xd4a3('0x47')](_0xd4a3('0xa7'),_0x265490[_0xd4a3('0x48')],util['inspect'](_0x2a5bdc,{'showHidden':![],'depth':null}));ami[_0xd4a3('0x45')](_0xd4a3('0xa8'),_0x2a5bdc);break;default:_0x2a5bdc['queuecallerexit']=!![];_0x2a5bdc[_0xd4a3('0x95')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x2a5bdc['queuecallerleaveAt']=moment()['format'](_0xd4a3('0x81'));}_0x2a5bdc[_0xd4a3('0x1e')]=![];_0x2a5bdc[_0xd4a3('0x80')]=null;_0x2a5bdc[_0xd4a3('0x82')]=_0x265490[_0xd4a3('0xa4')];this[_0xd4a3('0x12')][_0x265490[_0xd4a3('0x48')]]=_0x2a5bdc;this[_0xd4a3('0x43')](_0x2a5bdc,'varset');}else if(this[_0xd4a3('0x62')](_0x265490['variable'])&&this[_0xd4a3('0x62')](_0x265490['variable'][_0xd4a3('0xa9')])){if(!_0x2a5bdc[_0xd4a3('0x1e')]){_0x2a5bdc[_0xd4a3('0x8d')]=!![];_0x2a5bdc[_0xd4a3('0x95')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));_0x2a5bdc['queuecallerexitreason']=_0xd4a3('0xaa');_0x2a5bdc[_0xd4a3('0x85')]=moment()[_0xd4a3('0x49')](_0xd4a3('0x81'));this['channels'][_0x265490[_0xd4a3('0x48')]]=_0x2a5bdc;}}logger[_0xd4a3('0x6a')](_0xd4a3('0xab'),_0x265490[_0xd4a3('0x48')],_0x2a5bdc[_0xd4a3('0x4b')],_0x2a5bdc[_0xd4a3('0x5a')],_[_0xd4a3('0x77')](_0x265490[_0xd4a3('0xa3')])[0x0],_0x265490[_0xd4a3('0xa4')]);_0x2a5bdc[_0xd4a3('0x17')]=this[_0xd4a3('0x17')][_0x265490[_0xd4a3('0x48')]];}}}}catch(_0x3e3b3b){logger[_0xd4a3('0x3e')](_0xd4a3('0xa1'),_0x265490[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x3e3b3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd4a3('0x35')]['addVariable']=function(_0x4f4d4d,_0x52c023,_0x42d828){var _0x5bb102=[_0xd4a3('0xac'),_0xd4a3('0xad'),_0xd4a3('0xae'),'rtpaudioqosjitterbridged',_0xd4a3('0xaf'),_0xd4a3('0xb0'),_0xd4a3('0xb1'),_0xd4a3('0xb2'),_0xd4a3('0xb3'),'sipuri',_0xd4a3('0xb4'),'bridgepvtcallid',_0xd4a3('0xb5'),_0xd4a3('0xb6'),_0xd4a3('0xb7'),_0xd4a3('0xb8'),_0xd4a3('0x8c'),_0xd4a3('0xb9'),_0xd4a3('0xba')];if(!_['isNil'](_0x52c023)&&!_[_0xd4a3('0xbb')](_0x5bb102,_0x52c023)){if(_[_0xd4a3('0x63')](this['variables'][_0x4f4d4d])){this[_0xd4a3('0x17')][_0x4f4d4d]={};}this[_0xd4a3('0x17')][_0x4f4d4d][_0x52c023]=_0x42d828;}};VoiceQueueReport[_0xd4a3('0x35')][_0xd4a3('0x25')]=function(_0x46f0af){try{if(this[_0xd4a3('0x62')](_0x46f0af)){logger[_0xd4a3('0x47')](_0xd4a3('0xbc'),_0x46f0af[_0xd4a3('0x48')],util[_0xd4a3('0x40')](_0x46f0af,{'showHidden':![],'depth':null}));if(this[_0xd4a3('0x10')][_0x46f0af[_0xd4a3('0x48')]]){for(var _0x22e879=0x0,_0x42ec39={};_0x22e8790x0?_0xc10e82:0x0;this['voiceQueues'][_0x3c35b9[_0xd028('0x6d')]]['talking']=this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]['talking']>_[_0xd028('0x72')](_0x3c35b9['loggedin'])?_[_0xd028('0x72')](_0x3c35b9[_0xd028('0x73')]):this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]][_0xd028('0x35')];this[_0xd028('0x53')](this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]],_0xd028('0x16'));}logger['debug'](_0xd028('0x74'),util['inspect'](this['voiceQueues'][_0x3c35b9[_0xd028('0x6d')]],{'showHidden':![],'depth':null}));ami[_0xd028('0x47')]('custom:queuesummary',this[_0xd028('0x14')][_0x3c35b9['queue']]);}}}catch(_0x24bb58){logger[_0xd028('0x41')](_0xd028('0x6b'),util['inspect'](_0x24bb58,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x1a')]=function(_0x4ac66b){logger[_0xd028('0x49')](_0xd028('0x75'),util[_0xd028('0x43')](_0x4ac66b,{'showHidden':![],'depth':null}));this[_0xd028('0x69')]=!![];};VoiceQueueReport[_0xd028('0xc')]['syncQueueCallerJoin']=function(_0x5ca787){try{if(this[_0xd028('0x6c')](_0x5ca787)){logger['debug'](_0xd028('0x76'),_0x5ca787[_0xd028('0x4b')],util[_0xd028('0x43')](_0x5ca787,{'showHidden':![],'depth':null}));if(_[_0xd028('0x66')](this[_0xd028('0x44')][_0x5ca787[_0xd028('0x4b')]]))this[_0xd028('0x44')][_0x5ca787['uniqueid']]=[];if(_[_0xd028('0x66')](this[_0xd028('0x12')][_0x5ca787['uniqueid']]))this['channels'][_0x5ca787[_0xd028('0x4b')]]={};var _0x22baf1=new QueueReport();_0x22baf1['name']=_0x5ca787['queue'];_0x22baf1[_0xd028('0x54')]=this[_0xd028('0x14')][_0x22baf1[_0xd028('0x51')]]&&this[_0xd028('0x14')][_0x22baf1[_0xd028('0x51')]][_0xd028('0x54')]?this[_0xd028('0x14')][_0x22baf1['name']][_0xd028('0x54')]||_0xd028('0x55'):_0xd028('0x55');_0x22baf1[_0xd028('0x6d')]=_0x5ca787[_0xd028('0x6d')];_0x22baf1[_0xd028('0x77')]=moment()[_0xd028('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x22baf1[_0xd028('0x78')]=_0x5ca787[_0xd028('0x78')];_0x22baf1[_0xd028('0x79')]=_0x5ca787[_0xd028('0x79')];_0x22baf1['uniqueid']=_0x5ca787[_0xd028('0x4b')];_0x22baf1[_0xd028('0x7a')]=this[_0xd028('0x12')][_0x5ca787[_0xd028('0x4b')]][_0xd028('0x7a')];logger[_0xd028('0x6f')](_0xd028('0x7b'),_0x22baf1[_0xd028('0x51')],_0x22baf1['type']);_[_0xd028('0x7c')](_0x22baf1,_[_0xd028('0x7d')](_0x5ca787,_[_0xd028('0x7e')](_0x22baf1)));this['queueReports'][_0x5ca787['uniqueid']]['push'](_0x22baf1);this[_0xd028('0x12')][_0x5ca787[_0xd028('0x4b')]]=_0x22baf1;this[_0xd028('0x48')](_0x22baf1,'queuecallerjoin');}}catch(_0x140a2b){logger[_0xd028('0x41')](_0xd028('0x76'),_0x5ca787[_0xd028('0x4b')],util[_0xd028('0x43')](_0x140a2b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x1e')]=function(_0x78762b){try{if(this[_0xd028('0x6c')](_0x78762b)){logger['debug'](_0xd028('0x7f'),_0x78762b[_0xd028('0x4b')],util[_0xd028('0x43')](_0x78762b,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x78762b['uniqueid']]){var _0x73e37=_[_0xd028('0x80')](this['queueReports'][_0x78762b[_0xd028('0x4b')]]);_0x73e37[_0xd028('0x81')]=![];_0x73e37[_0xd028('0x82')]=null;_0x73e37[_0xd028('0x83')]=_0x78762b[_0xd028('0x83')];_0x73e37['originalposition']=_0x78762b[_0xd028('0x84')];_0x73e37[_0xd028('0x1d')]=!![];_0x73e37[_0xd028('0x85')]=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x73e37['queuecallerexitreason']=_0xd028('0x87');_0x73e37[_0xd028('0x88')]=null;logger[_0xd028('0x6f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x73e37[_0xd028('0x51')],_0x73e37[_0xd028('0x54')]);this[_0xd028('0x12')][_0x78762b[_0xd028('0x4b')]]=_0x73e37;this['emitVoiceQueueChannelRemove'](_0x73e37,'queuecallerabandon');}}}catch(_0x5764ba){logger[_0xd028('0x41')](_0xd028('0x7f'),_0x78762b[_0xd028('0x4b')],util['inspect'](_0x5764ba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x1f')]=function(_0x3917e1){try{if(this[_0xd028('0x6c')](_0x3917e1)){logger[_0xd028('0x49')](_0xd028('0x89'),_0x3917e1[_0xd028('0x4b')],util[_0xd028('0x43')](_0x3917e1,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x3917e1[_0xd028('0x4b')]]){var _0x53ca5c=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x3917e1[_0xd028('0x4b')]]);_0x53ca5c['queuecallerleaveAt']=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x53ca5c[_0xd028('0x8a')]=_0x3917e1['connectedlinenum'];_0x53ca5c['connectedlinename']=_0x3917e1[_0xd028('0x8b')];logger[_0xd028('0x6f')](_0xd028('0x8c'),_0x53ca5c[_0xd028('0x51')],_0x53ca5c[_0xd028('0x54')],_0x3917e1[_0xd028('0x8a')],_0x3917e1[_0xd028('0x8b')]);this[_0xd028('0x12')][_0x3917e1['uniqueid']]=_0x53ca5c;this[_0xd028('0x48')](_0x53ca5c,'queuecallerleave');}}}catch(_0x527c11){logger[_0xd028('0x41')](_0xd028('0x89'),_0x3917e1[_0xd028('0x4b')],util[_0xd028('0x43')](_0x527c11,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x22')]=function(_0x8e4f7){try{if(this['isNotNull'](_0x8e4f7)){logger[_0xd028('0x49')](_0xd028('0x8d'),_0x8e4f7[_0xd028('0x4b')],util['inspect'](_0x8e4f7,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x8e4f7[_0xd028('0x4b')]]){var _0x51a222=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x8e4f7[_0xd028('0x4b')]]);_0x51a222[_0xd028('0x81')]=!![];_0x51a222[_0xd028('0x8e')]=_0xd028('0x8f');logger[_0xd028('0x6f')](_0xd028('0x90'),_0x51a222[_0xd028('0x51')],_0x51a222[_0xd028('0x54')]);}}}catch(_0x17c5f3){logger[_0xd028('0x41')](_0xd028('0x8d'),_0x8e4f7[_0xd028('0x4b')],util[_0xd028('0x43')](_0x17c5f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x21')]=function(_0x4d541e){try{if(this['isNotNull'](_0x4d541e)){logger['debug'](_0xd028('0x91'),_0x4d541e['uniqueid'],util[_0xd028('0x43')](_0x4d541e,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]]){var _0x57eb5f=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]]);_0x57eb5f[_0xd028('0x1d')]=![];_0x57eb5f[_0xd028('0x85')]=null;_0x57eb5f[_0xd028('0x92')]=!![];_0x57eb5f[_0xd028('0x88')]=_0x4d541e[_0xd028('0x93')];_0x57eb5f['holdtime']=_0x4d541e[_0xd028('0x83')];_0x57eb5f[_0xd028('0x81')]=!![];_0x57eb5f[_0xd028('0x94')]=![];_0x57eb5f[_0xd028('0x95')]=null;if(!_0x57eb5f[_0xd028('0x96')]){if(_0x4d541e[_0xd028('0x97')]=='transfer'){_0x57eb5f[_0xd028('0x8e')]=_0xd028('0x98');logger[_0xd028('0x6f')](_0xd028('0x99'),_0x57eb5f['name'],_0x57eb5f['type']);}else{if(_[_0xd028('0x9a')](_0x4d541e[_0xd028('0x3e')][_0xd028('0x9b')](),'local/')){if(this[_0xd028('0x44')][_0x4d541e[_0xd028('0x9c')]]){var _0x5435d4=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x4d541e['linkedid']]);_0x5435d4[_0xd028('0x81')]=![];_0x5435d4['queuecallerexit']=!![];_0x5435d4[_0xd028('0x95')]=moment(_0x57eb5f[_0xd028('0x77')])[_0xd028('0x9d')](_0x4d541e[_0xd028('0x83')],_0xd028('0x9e'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5435d4[_0xd028('0x8e')]=_0xd028('0x9f');_0x5435d4[_0xd028('0x96')]=!![];_0x5435d4[_0xd028('0xa0')]=_0xd028('0xa1');_0x5435d4[_0xd028('0xa2')]=_0x4d541e[_0xd028('0xa3')];_0x5435d4[_0xd028('0xa4')]=_0x4d541e[_0xd028('0x4b')];logger[_0xd028('0x6f')](_0xd028('0xa5'),_0x5435d4['name'],_0x5435d4[_0xd028('0x54')]);var _0x6d8f6=this[_0xd028('0x44')][_0x4d541e[_0xd028('0x9c')]];this['queueReports'][_0x4d541e[_0xd028('0x9c')]]=this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]];this['queueReports'][_0x4d541e[_0xd028('0x4b')]]=_0x6d8f6;}}else{_0x57eb5f[_0xd028('0x8e')]=_0xd028('0xa6')+_0x4d541e[_0xd028('0x97')]['toUpperCase']();logger[_0xd028('0x6f')](_0xd028('0xa7'),_0x57eb5f[_0xd028('0x51')],_0x57eb5f[_0xd028('0x54')],_0x57eb5f[_0xd028('0x8e')]);}}}this[_0xd028('0x12')][_0x4d541e[_0xd028('0x4b')]]=_0x57eb5f;this[_0xd028('0x4f')](_0x57eb5f,_0xd028('0x20'));}}}catch(_0xaeedc6){logger[_0xd028('0x41')](_0xd028('0x91'),_0x4d541e[_0xd028('0x4b')],util[_0xd028('0x43')](_0xaeedc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0xa8')]=function(_0x536deb){try{if(this[_0xd028('0x6c')](_0x536deb)){logger[_0xd028('0x49')](_0xd028('0xa9'),_0x536deb[_0xd028('0x4b')],util[_0xd028('0x43')](_0x536deb,{'showHidden':![],'depth':null}));this['addVariable'](_0x536deb['uniqueid'],_[_0xd028('0x7e')](_0x536deb['variable'])[0x0],_0x536deb[_0xd028('0xaa')]);if(this[_0xd028('0x44')][_0x536deb['uniqueid']]){var _0x24f823=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x536deb[_0xd028('0x4b')]]);if(_0x24f823){if(this[_0xd028('0x6c')](_0x536deb['variable'])&&this[_0xd028('0x6c')](_0x536deb[_0xd028('0xab')]['queuestatus'])){switch(_0x536deb['value']){case _0xd028('0xac'):_0x24f823['queuecallerexit']=![];_0x24f823[_0xd028('0x95')]=null;break;case _0xd028('0xad'):_0x24f823[_0xd028('0xae')]=_0xd028('0xaf');_0x24f823[_0xd028('0x94')]=!![];_0x24f823[_0xd028('0x95')]=moment()['format'](_0xd028('0x86'));_0x24f823[_0xd028('0xb0')]=moment()[_0xd028('0x50')](_0xd028('0x86'));logger[_0xd028('0x49')](_0xd028('0xb1'),_0x536deb['uniqueid'],util['inspect'](_0x24f823,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x24f823);break;default:_0x24f823['queuecallerexit']=!![];_0x24f823[_0xd028('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x24f823[_0xd028('0xb0')]=moment()[_0xd028('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x24f823[_0xd028('0x1d')]=![];_0x24f823[_0xd028('0x85')]=null;_0x24f823[_0xd028('0x8e')]=_0x536deb[_0xd028('0xaa')];this[_0xd028('0x12')][_0x536deb['uniqueid']]=_0x24f823;this[_0xd028('0x4f')](_0x24f823,_0xd028('0x23'));}else if(this[_0xd028('0x6c')](_0x536deb[_0xd028('0xab')])&&this['isNotNull'](_0x536deb[_0xd028('0xab')][_0xd028('0xb2')])){if(!_0x24f823[_0xd028('0x1d')]){_0x24f823[_0xd028('0x94')]=!![];_0x24f823[_0xd028('0x95')]=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x24f823['queuecallerexitreason']='EXITWITHKEY';_0x24f823['queuecallerleaveAt']=moment()[_0xd028('0x50')](_0xd028('0x86'));this[_0xd028('0x12')][_0x536deb[_0xd028('0x4b')]]=_0x24f823;}}logger['info'](_0xd028('0xb3'),_0x536deb['uniqueid'],_0x24f823[_0xd028('0x51')],_0x24f823['type'],_[_0xd028('0x7e')](_0x536deb[_0xd028('0xab')])[0x0],_0x536deb[_0xd028('0xaa')]);_0x24f823[_0xd028('0xb4')]=this[_0xd028('0xb4')][_0x536deb[_0xd028('0x4b')]];}}}}catch(_0x4cdce8){logger[_0xd028('0x41')]('[%s][voiceQueueReport][varset]',_0x536deb[_0xd028('0x4b')],util['inspect'](_0x4cdce8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')]['addVariable']=function(_0x44af27,_0x3f1b54,_0x237528){var _0x25b12d=[_0xd028('0xb5'),_0xd028('0xb6'),'rtpaudioqosjitter',_0xd028('0xb7'),_0xd028('0xb8'),_0xd028('0xb9'),_0xd028('0xba'),_0xd028('0xbb'),'sipcallid',_0xd028('0xbc'),'bridgepeer',_0xd028('0xbd'),_0xd028('0xbe'),_0xd028('0xbf'),_0xd028('0xc0'),'memberlastcall',_0xd028('0x93'),_0xd028('0xc1'),_0xd028('0xc2')];if(!_['isNil'](_0x3f1b54)&&!_[_0xd028('0xc3')](_0x25b12d,_0x3f1b54)){if(_[_0xd028('0x66')](this[_0xd028('0xb4')][_0x44af27])){this['variables'][_0x44af27]={};}this[_0xd028('0xb4')][_0x44af27][_0x3f1b54]=_0x237528;}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x25')]=function(_0x15ff43){try{if(this[_0xd028('0x6c')](_0x15ff43)){logger['debug'](_0xd028('0xc4'),_0x15ff43[_0xd028('0x4b')],util[_0xd028('0x43')](_0x15ff43,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x15ff43[_0xd028('0x4b')]]){for(var _0x568a08=0x0,_0x177aa1={};_0x568a08=0x0?moment(_0x25fda1[_0x38b0('0x1b')])[_0x38b0('0xf')](_0x25fda1[_0x38b0('0x1c')],_0x38b0('0x11')):null,'data1':_0x38b0('0x1d'),'data2':_0x25fda1['accountcode'],'data3':_0x25fda1[_0x38b0('0x14')],'data4':_0x25fda1[_0x38b0('0x1e')]||null,'role':_0x38b0('0x16'),'internal':_0x25fda1[_0x38b0('0x1f')]?_[_0x38b0('0x17')](_0x25fda1[_0x38b0('0x1f')]):undefined,'uniqueid':_0x25fda1['uniqueid']},'log':_0x38b0('0x8')});}; \ No newline at end of file +var _0xe895=['starttime','seconds','outbound','dialstring','agent','toNumber','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','accountcode','voiceDialReport','voice','membername','TALKING','endtime'];(function(_0x2d1525,_0x4dfa53){var _0x285faf=function(_0x229cee){while(--_0x229cee){_0x2d1525['push'](_0x2d1525['shift']());}};_0x285faf(++_0x4dfa53);}(_0xe895,0x162));var _0x5e89=function(_0x285cf1,_0x47e330){_0x285cf1=_0x285cf1-0x0;var _0x2fea93=_0xe895[_0x285cf1];return _0x2fea93;};'use strict';var moment=require('moment');var _=require(_0x5e89('0x0'));var util=require(_0x5e89('0x1'));var client=require(_0x5e89('0x2'));exports[_0x5e89('0x3')]=function(_0x563b20){var _0x1ea0ed=_0x563b20[_0x5e89('0x4')]||_0x563b20['queuecallerexitAt'];return client[_0x5e89('0x5')](_0x5e89('0x6'),{'body':{'channel':'voice','membername':_0x563b20[_0x5e89('0x7')],'interface':_[_0x5e89('0x8')](_0x563b20[_0x5e89('0x9')])?util['format'](_0x5e89('0xa'),_0x563b20[_0x5e89('0x7')]):_0x563b20[_0x5e89('0x9')],'type':'TALKING','enterAt':_0x563b20[_0x5e89('0xb')],'exitAt':_0x1ea0ed,'duration':moment(_0x1ea0ed)[_0x5e89('0xc')](_0x563b20[_0x5e89('0xb')],'seconds'),'data1':_0x5e89('0xd'),'data2':_0x563b20[_0x5e89('0xe')],'data3':_0x563b20[_0x5e89('0xf')],'data4':null,'data5':_0x563b20[_0x5e89('0x10')],'role':'agent','internal':_0x563b20[_0x5e89('0x11')]?_['toNumber'](_0x563b20[_0x5e89('0x11')]):undefined,'uniqueid':_0x563b20['uniqueid']},'log':_0x5e89('0x6')});};exports[_0x5e89('0x12')]=function(_0x5d2b01){return client[_0x5e89('0x5')](_0x5e89('0x6'),{'body':{'channel':_0x5e89('0x13'),'membername':_0x5d2b01[_0x5e89('0x14')],'interface':_0x5d2b01[_0x5e89('0x9')],'type':_0x5e89('0x15'),'enterAt':_0x5d2b01['starttime'],'exitAt':_0x5d2b01[_0x5e89('0x16')],'duration':moment(_0x5d2b01[_0x5e89('0x16')])[_0x5e89('0xc')](_0x5d2b01[_0x5e89('0x17')],_0x5e89('0x18'))>=0x0?moment(_0x5d2b01[_0x5e89('0x16')])[_0x5e89('0xc')](_0x5d2b01['starttime'],'seconds'):null,'data1':_0x5e89('0x19'),'data2':_0x5d2b01[_0x5e89('0x11')],'data3':_0x5d2b01[_0x5e89('0xf')],'data4':_0x5d2b01[_0x5e89('0x1a')]||null,'role':_0x5e89('0x1b'),'internal':_0x5d2b01[_0x5e89('0x11')]?_[_0x5e89('0x1c')](_0x5d2b01[_0x5e89('0x11')]):undefined,'uniqueid':_0x5d2b01['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e2ecb7d..298eded 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 _0xebe6=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xebe6,0x13a));var _0x6ebe=function(_0x2cefd2,_0x3eed48){_0x2cefd2=_0x2cefd2-0x0;var _0x528537=_0xebe6[_0x2cefd2];return _0x528537;};'use strict';var client=require(_0x6ebe('0x0'));exports[_0x6ebe('0x1')]=function(){return client[_0x6ebe('0x2')](_0x6ebe('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6ebe('0x4')]},'log':_0x6ebe('0x5')});}; \ No newline at end of file +var _0x48b2=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0x48b2,0x176));var _0x248b=function(_0x420544,_0x1cf8c7){_0x420544=_0x420544-0x0;var _0x151b06=_0x48b2[_0x420544];return _0x151b06;};'use strict';var client=require(_0x248b('0x0'));exports[_0x248b('0x1')]=function(){return client[_0x248b('0x2')](_0x248b('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x248b('0x4')]},'log':_0x248b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3666256..4bc17f1 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 _0x8efb=['name','html','../client','Request','GetTemplate'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x8efb,0xed));var _0xb8ef=function(_0xeae185,_0x395d70){_0xeae185=_0xeae185-0x0;var _0x170ac0=_0x8efb[_0xeae185];return _0x170ac0;};'use strict';var client=require(_0xb8ef('0x0'));exports['getTemplates']=function(_0x97a62b){return function(_0x3c73c7){return client[_0xb8ef('0x1')](_0xb8ef('0x2'),{'options':{'raw':!![],'attributes':['id',_0xb8ef('0x3'),_0xb8ef('0x4')]},'log':_0xb8ef('0x2')});};}; \ No newline at end of file +var _0xf846=['GetTemplate','name','html','../client','getTemplates'];(function(_0x47bc20,_0x4bf725){var _0x172b91=function(_0x13b77e){while(--_0x13b77e){_0x47bc20['push'](_0x47bc20['shift']());}};_0x172b91(++_0x4bf725);}(_0xf846,0x85));var _0x6f84=function(_0xd64ae4,_0x2ea904){_0xd64ae4=_0xd64ae4-0x0;var _0x39d14f=_0xf846[_0xd64ae4];return _0x39d14f;};'use strict';var client=require(_0x6f84('0x0'));exports[_0x6f84('0x1')]=function(_0xc3809a){return function(_0xf01500){return client['Request'](_0x6f84('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6f84('0x3'),_0x6f84('0x4')]},'log':_0x6f84('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1a6ac2f..46142cd 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 _0x91b0=['status','AllConditions','field','Condition','AnyConditions','Actions','action','data1','data2','data3','data4','data5','data7','GetTrigger','../client','getTriggers','Request','name','channel'];(function(_0x14712a,_0x18735c){var _0x315307=function(_0x199a5e){while(--_0x199a5e){_0x14712a['push'](_0x14712a['shift']());}};_0x315307(++_0x18735c);}(_0x91b0,0x6d));var _0x091b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x91b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x091b('0x0'));exports[_0x091b('0x1')]=function(_0x579255){return function(_0x2aab92){return client[_0x091b('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x091b('0x3'),_0x091b('0x4'),_0x091b('0x5')],'include':[{'model':'Condition','as':_0x091b('0x6'),'attributes':['id',_0x091b('0x7'),'operator','value']},{'model':_0x091b('0x8'),'as':_0x091b('0x9'),'attributes':['id',_0x091b('0x7'),'operator','value']},{'model':'Action','as':_0x091b('0xa'),'attributes':['id',_0x091b('0xb'),_0x091b('0xc'),_0x091b('0xd'),_0x091b('0xe'),_0x091b('0xf'),_0x091b('0x10'),'data6',_0x091b('0x11')]}]},'log':_0x091b('0x12')});};}; \ No newline at end of file +var _0xc97e=['Request','GetTrigger','name','channel','status','Condition','AnyConditions','field','value','Action','Actions','action','data2','data3','data4','data5','data6','../client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc97e,0x6b));var _0xec97=function(_0x1dbfa3,_0x5717dd){_0x1dbfa3=_0x1dbfa3-0x0;var _0x4f8e54=_0xc97e[_0x1dbfa3];return _0x4f8e54;};'use strict';var client=require(_0xec97('0x0'));exports['getTriggers']=function(_0xe56945){return function(_0x997ff3){return client[_0xec97('0x1')](_0xec97('0x2'),{'options':{'raw':![],'attributes':['id',_0xec97('0x3'),_0xec97('0x4'),_0xec97('0x5')],'include':[{'model':_0xec97('0x6'),'as':'AllConditions','attributes':['id','field','operator','value']},{'model':_0xec97('0x6'),'as':_0xec97('0x7'),'attributes':['id',_0xec97('0x8'),'operator',_0xec97('0x9')]},{'model':_0xec97('0xa'),'as':_0xec97('0xb'),'attributes':['id',_0xec97('0xc'),'data1',_0xec97('0xd'),_0xec97('0xe'),_0xec97('0xf'),_0xec97('0x10'),_0xec97('0x11'),'data7']}]},'log':_0xec97('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4fb7840..31e060e 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 _0x87f8=['defaultuser','GetTrunk','Request','name'];(function(_0x251429,_0x55f265){var _0x2d5d69=function(_0x5f93c8){while(--_0x5f93c8){_0x251429['push'](_0x251429['shift']());}};_0x2d5d69(++_0x55f265);}(_0x87f8,0x152));var _0x887f=function(_0x3eba87,_0x1a6e26){_0x3eba87=_0x3eba87-0x0;var _0x108b6d=_0x87f8[_0x3eba87];return _0x108b6d;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x52e3a6){return function(_0x379ad6){return client[_0x887f('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x887f('0x1'),'registry',_0x887f('0x2')]},'log':_0x887f('0x3')});};}; \ No newline at end of file +var _0x0214=['GetTrunk','registry','defaultuser','../client','getTrunks','Request'];(function(_0x5230a4,_0x4e430f){var _0xdb8b1f=function(_0x4dd8cb){while(--_0x4dd8cb){_0x5230a4['push'](_0x5230a4['shift']());}};_0xdb8b1f(++_0x4e430f);}(_0x0214,0x15f));var _0x4021=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x0214[_0x292f93];return _0x5a94b1;};'use strict';var client=require(_0x4021('0x0'));exports[_0x4021('0x1')]=function(_0x1ad413){return function(_0x1ec2bf){return client[_0x4021('0x2')](_0x4021('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x4021('0x4'),_0x4021('0x5')]},'log':_0x4021('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5b99c16..5d2d856 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x2b330e,_0xda6026){var _0x15228d=function(_0x3d08bb){while(--_0x3d08bb){_0x2b330e['push'](_0x2b330e['shift']());}};_0x15228d(++_0xda6026);}(_0x34e8,0x12c));var _0x834e=function(_0x1666dc,_0x5d0d02){_0x1666dc=_0x1666dc-0x0;var _0x33499b=_0x34e8[_0x1666dc];return _0x33499b;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ 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(_0x59a8fb,_0x1bf222){var _0x87a642=function(_0x34fa61){while(--_0x34fa61){_0x59a8fb['push'](_0x59a8fb['shift']());}};_0x87a642(++_0x1bf222);}(_0x70e0,0x17b));var _0x070e=function(_0x5db4fe,_0x1b47b3){_0x5db4fe=_0x5db4fe-0x0;var _0x2b2101=_0x70e0[_0x5db4fe];return _0x2b2101;};'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 f7b16ec..ff8ae3a 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 _0xeaaf=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x1c94ee,_0x18819e){var _0x198256=function(_0x33b362){while(--_0x33b362){_0x1c94ee['push'](_0x1c94ee['shift']());}};_0x198256(++_0x18819e);}(_0xeaaf,0xdb));var _0xfeaa=function(_0x47b3cb,_0x3c2026){_0x47b3cb=_0x47b3cb-0x0;var _0xfa8cdb=_0xeaaf[_0x47b3cb];return _0xfa8cdb;};'use strict';var client=require(_0xfeaa('0x0'));exports[_0xfeaa('0x1')]=function(_0x270812){return client[_0xfeaa('0x2')](_0xfeaa('0x3'),{'body':_0x270812,'log':_0xfeaa('0x3')});};exports[_0xfeaa('0x4')]=function(_0x136f62,_0x145134,_0x3306ba){return client['Request'](_0xfeaa('0x5'),{'body':_0x136f62,'options':{'where':{'uniqueid':_0x145134,'interface':_0x3306ba,'agentcomplete':!![]}},'log':_0xfeaa('0x5')});}; \ No newline at end of file +var _0x2e2b=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1d88f6,_0x51545b){var _0x21b601=function(_0x4b1998){while(--_0x4b1998){_0x1d88f6['push'](_0x1d88f6['shift']());}};_0x21b601(++_0x51545b);}(_0x2e2b,0x86));var _0xb2e2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2e2b[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0xb2e2('0x0'));exports[_0xb2e2('0x1')]=function(_0x1c5470){return client[_0xb2e2('0x2')](_0xb2e2('0x3'),{'body':_0x1c5470,'log':_0xb2e2('0x3')});};exports[_0xb2e2('0x4')]=function(_0x5f3fd5,_0x5ab22f,_0x4aad70){return client[_0xb2e2('0x2')](_0xb2e2('0x5'),{'body':_0x5f3fd5,'options':{'where':{'uniqueid':_0x5ab22f,'interface':_0x4aad70,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e1a791c..3fa401d 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 _0x4efb=['YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','create','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day'];(function(_0x521790,_0x4174ed){var _0x168e2a=function(_0x371514){while(--_0x371514){_0x521790['push'](_0x521790['shift']());}};_0x168e2a(++_0x4174ed);}(_0x4efb,0x1c1));var _0xb4ef=function(_0x5a9b57,_0x4dacee){_0x5a9b57=_0x5a9b57-0x0;var _0x11f759=_0x4efb[_0x5a9b57];return _0x11f759;};'use strict';var moment=require('moment');var util=require(_0xb4ef('0x0'));var _=require(_0xb4ef('0x1'));var client=require('../client');exports[_0xb4ef('0x2')]=function(_0x93b4eb){return client['Request'](_0xb4ef('0x3'),{'body':_[_0xb4ef('0x4')](_0x93b4eb,{'source':_0x93b4eb[_0xb4ef('0x5')],'destinationcontext':_0x93b4eb['context'],'callerid':_0x93b4eb[_0xb4ef('0x6')],'amaflags':_0xb4ef('0x7')}),'log':_0xb4ef('0x3')});};exports[_0xb4ef('0x8')]=function(){return function(){return client[_0xb4ef('0x9')](_0xb4ef('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xb4ef('0xb')](_0xb4ef('0xc'))['format'](_0xb4ef('0xd')),moment()[_0xb4ef('0xe')](_0xb4ef('0xc'))[_0xb4ef('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xb4ef('0x10'),_0xb4ef('0x11'),_0xb4ef('0x12'),_0xb4ef('0x13')]},'log':_0xb4ef('0x14')});};}; \ No newline at end of file +var _0xe5ff=['calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x28e637,_0x3a0717){var _0x1f8271=function(_0x36c122){while(--_0x36c122){_0x28e637['push'](_0x28e637['shift']());}};_0x1f8271(++_0x3a0717);}(_0xe5ff,0x19d));var _0xfe5f=function(_0xb5f4f6,_0x44e6f0){_0xb5f4f6=_0xb5f4f6-0x0;var _0x45fbc0=_0xe5ff[_0xb5f4f6];return _0x45fbc0;};'use strict';var moment=require(_0xfe5f('0x0'));var util=require('util');var _=require(_0xfe5f('0x1'));var client=require(_0xfe5f('0x2'));exports[_0xfe5f('0x3')]=function(_0x3275ed){return client[_0xfe5f('0x4')](_0xfe5f('0x5'),{'body':_[_0xfe5f('0x6')](_0x3275ed,{'source':_0x3275ed[_0xfe5f('0x7')],'destinationcontext':_0x3275ed['context'],'callerid':_0x3275ed[_0xfe5f('0x8')],'amaflags':_0xfe5f('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xfe5f('0xa')]=function(){return function(){return client[_0xfe5f('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xfe5f('0xb')],'createdAt':{'$between':[moment()[_0xfe5f('0xc')](_0xfe5f('0xd'))['format'](_0xfe5f('0xe')),moment()[_0xfe5f('0xf')](_0xfe5f('0xd'))[_0xfe5f('0x10')](_0xfe5f('0xe'))]}},'attributes':['type','disposition',_0xfe5f('0x11'),_0xfe5f('0x12')]},'log':_0xfe5f('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7cac595..5bd8d21 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 _0x9693=['../client','create','Request','CreateVoiceDialReport'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0x9693,0xf8));var _0x3969=function(_0x2f7d22,_0xcb0c4b){_0x2f7d22=_0x2f7d22-0x0;var _0x4619fb=_0x9693[_0x2f7d22];return _0x4619fb;};'use strict';var client=require(_0x3969('0x0'));exports[_0x3969('0x1')]=function(_0x5e920c){return client[_0x3969('0x2')](_0x3969('0x3'),{'body':_0x5e920c,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xebb1=['Request','CreateVoiceDialReport','../client','create'];(function(_0x24c30e,_0x3e8888){var _0x4f87a7=function(_0x163823){while(--_0x163823){_0x24c30e['push'](_0x24c30e['shift']());}};_0x4f87a7(++_0x3e8888);}(_0xebb1,0xbe));var _0x1ebb=function(_0x5688f8,_0x2252f3){_0x5688f8=_0x5688f8-0x0;var _0x31f44a=_0xebb1[_0x5688f8];return _0x31f44a;};'use strict';var client=require(_0x1ebb('0x0'));exports[_0x1ebb('0x1')]=function(_0x3030e9){return client[_0x1ebb('0x2')](_0x1ebb('0x3'),{'body':_0x3030e9,'log':_0x1ebb('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1528ae6..cfc2f25 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 _0x2904=['getVoiceExtensions','GetVoiceExtension','recordingFormat','../client'];(function(_0x3bbbb3,_0x80f7bb){var _0x1ac27c=function(_0x1db716){while(--_0x1db716){_0x3bbbb3['push'](_0x3bbbb3['shift']());}};_0x1ac27c(++_0x80f7bb);}(_0x2904,0x137));var _0x4290=function(_0x348375,_0x58c372){_0x348375=_0x348375-0x0;var _0x47ed4d=_0x2904[_0x348375];return _0x47ed4d;};'use strict';var client=require(_0x4290('0x0'));exports[_0x4290('0x1')]=function(){return function(){return client['Request'](_0x4290('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x4290('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x4290('0x1')});};}; \ No newline at end of file +var _0x593e=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x1efd6a,_0x3bd5e5){var _0x102817=function(_0x4a9e13){while(--_0x4a9e13){_0x1efd6a['push'](_0x1efd6a['shift']());}};_0x102817(++_0x3bd5e5);}(_0x593e,0xcb));var _0xe593=function(_0x2e44da,_0x5f4366){_0x2e44da=_0x2e44da-0x0;var _0x2a859f=_0x593e[_0x2e44da];return _0x2a859f;};'use strict';var client=require(_0xe593('0x0'));exports[_0xe593('0x1')]=function(){return function(){return client[_0xe593('0x2')](_0xe593('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe593('0x4'),_0xe593('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xe593('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e00411c..cea754f 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 _0x0a15=['dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','TrunkBackup','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x31ac3d,_0x111777){var _0x147a09=function(_0x53b81d){while(--_0x53b81d){_0x31ac3d['push'](_0x31ac3d['shift']());}};_0x147a09(++_0x111777);}(_0x0a15,0xa0));var _0x50a1=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x0a15[_0x819464];return _0x49dcc0;};'use strict';var client=require('../client');exports[_0x50a1('0x0')]=function(){return function(){return client[_0x50a1('0x1')](_0x50a1('0x2'),{'options':{'raw':![],'attributes':['id',_0x50a1('0x3'),_0x50a1('0x4'),'acwTimeout',_0x50a1('0x5'),_0x50a1('0x6'),'type',_0x50a1('0x7'),_0x50a1('0x8'),_0x50a1('0x9'),_0x50a1('0xa'),_0x50a1('0xb'),_0x50a1('0xc'),_0x50a1('0xd'),_0x50a1('0xe'),_0x50a1('0xf'),_0x50a1('0x10'),'dialOriginateTimeout',_0x50a1('0x11'),_0x50a1('0x12'),_0x50a1('0x13'),_0x50a1('0x14'),_0x50a1('0x15'),_0x50a1('0x16'),'dialBusyRetryFrequency',_0x50a1('0x17'),_0x50a1('0x18'),_0x50a1('0x19'),'dialTimezone',_0x50a1('0x1a'),_0x50a1('0x1b'),_0x50a1('0x1c'),'dialAMDActive',_0x50a1('0x1d'),_0x50a1('0x1e'),_0x50a1('0x1f'),_0x50a1('0x20'),_0x50a1('0x21'),_0x50a1('0x22'),'dialAMDMaximumNumberOfWords',_0x50a1('0x23'),'dialAMDMaximumWordLength',_0x50a1('0x24'),'dialRecallMeTimeout',_0x50a1('0x25'),_0x50a1('0x26'),_0x50a1('0x27'),_0x50a1('0x28'),_0x50a1('0x29'),'monitor_format',_0x50a1('0x2a'),_0x50a1('0x2b'),_0x50a1('0x2c'),_0x50a1('0x2d'),'dialNoSuchNumberRetryFrequency',_0x50a1('0x2e'),_0x50a1('0x2f'),_0x50a1('0x30'),_0x50a1('0x31'),_0x50a1('0x32'),_0x50a1('0x33'),'dialAgentRejectMaxRetry',_0x50a1('0x34'),_0x50a1('0x35'),_0x50a1('0x36'),_0x50a1('0x37')],'include':[{'model':_0x50a1('0x38'),'as':'Trunk','attributes':['id',_0x50a1('0x3'),'callerid',_0x50a1('0x39')]},{'model':_0x50a1('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0x50a1('0x3')]},{'model':'Trunk','as':_0x50a1('0x3b'),'attributes':['id',_0x50a1('0x3'),'callerid','active']},{'model':_0x50a1('0x3c'),'as':'Interval','attributes':['id',_0x50a1('0x3')],'include':[{'model':_0x50a1('0x3c'),'as':_0x50a1('0x3d'),'attributes':['id',_0x50a1('0x3'),'interval']}]}]},'log':_0x50a1('0x0')});};}; \ No newline at end of file +var _0x594c=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','../client','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x27a0bd,_0x41e831){var _0xa68da6=function(_0x5abb69){while(--_0x5abb69){_0x27a0bd['push'](_0x27a0bd['shift']());}};_0xa68da6(++_0x41e831);}(_0x594c,0x174));var _0xc594=function(_0x4f155b,_0x2b3319){_0x4f155b=_0x4f155b-0x0;var _0x5a8943=_0x594c[_0x4f155b];return _0x5a8943;};'use strict';var client=require(_0xc594('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xc594('0x1'),_0xc594('0x2'),_0xc594('0x3'),_0xc594('0x4'),_0xc594('0x5'),'type',_0xc594('0x6'),_0xc594('0x7'),_0xc594('0x8'),_0xc594('0x9'),'dialPowerLevel',_0xc594('0xa'),_0xc594('0xb'),_0xc594('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xc594('0xd'),_0xc594('0xe'),'dialQueueTimeout','dialQueueProject',_0xc594('0xf'),'dialCongestionRetryFrequency',_0xc594('0x10'),_0xc594('0x11'),_0xc594('0x12'),_0xc594('0x13'),_0xc594('0x14'),'dialTimezone',_0xc594('0x15'),_0xc594('0x16'),_0xc594('0x17'),_0xc594('0x18'),_0xc594('0x19'),_0xc594('0x1a'),'dialAMDAfterGreetingSilence',_0xc594('0x1b'),_0xc594('0x1c'),_0xc594('0x1d'),_0xc594('0x1e'),_0xc594('0x1f'),_0xc594('0x20'),_0xc594('0x21'),'dialRecallMeTimeout',_0xc594('0x22'),_0xc594('0x23'),_0xc594('0x24'),'dialAgiAfterHangupClient','dialQueueProject2',_0xc594('0x5'),_0xc594('0x25'),_0xc594('0x26'),_0xc594('0x27'),_0xc594('0x28'),_0xc594('0x29'),_0xc594('0x2a'),_0xc594('0x2b'),_0xc594('0x2c'),_0xc594('0x2d'),'dialMachineMaxRetry',_0xc594('0x2e'),_0xc594('0x2f'),'dialAgentRejectRetryFrequency',_0xc594('0x30'),'dialPredictiveIntervalMaxThreshold',_0xc594('0x31')],'include':[{'model':_0xc594('0x32'),'as':_0xc594('0x32'),'attributes':['id',_0xc594('0x1'),'callerid',_0xc594('0x33')]},{'model':_0xc594('0x34'),'as':_0xc594('0x35'),'attributes':['id',_0xc594('0x1')]},{'model':'Trunk','as':_0xc594('0x36'),'attributes':['id','name',_0xc594('0x37'),_0xc594('0x33')]},{'model':_0xc594('0x38'),'as':_0xc594('0x38'),'attributes':['id',_0xc594('0x1')],'include':[{'model':'Interval','as':_0xc594('0x39'),'attributes':['id',_0xc594('0x1'),'interval']}]}]},'log':_0xc594('0x3a')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 36561a8..e0b5963 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(_0x2df311,_0x39efda){var _0x47877f=function(_0x1f4ac5){while(--_0x1f4ac5){_0x2df311['push'](_0x2df311['shift']());}};_0x47877f(++_0x39efda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x5edfc5,_0x1563ab){var _0x35a64a=function(_0x18fefd){while(--_0x18fefd){_0x5edfc5['push'](_0x5edfc5['shift']());}};_0x35a64a(++_0x1563ab);}(_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 diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index c31f0ca..e3aeb4c 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 _0x090f=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x090f,0x152));var _0xf090=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x090f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf090('0x0'));exports[_0xf090('0x1')]=function(_0x2a12fd){return function(){return client[_0xf090('0x2')](_0xf090('0x3'),{'options':{'where':{'VoiceQueueId':_0x2a12fd,'paused':!![]},'raw':!![]},'log':_0xf090('0x1')});};}; \ No newline at end of file +var _0xd7e9=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x25e532,_0x4a2f35){var _0x2f29ca=function(_0x5333e2){while(--_0x5333e2){_0x25e532['push'](_0x25e532['shift']());}};_0x2f29ca(++_0x4a2f35);}(_0xd7e9,0x1bf));var _0x9d7e=function(_0x2ba901,_0x5e6c6b){_0x2ba901=_0x2ba901-0x0;var _0x1803aa=_0xd7e9[_0x2ba901];return _0x1803aa;};'use strict';var client=require(_0x9d7e('0x0'));exports[_0x9d7e('0x1')]=function(_0x2b7dbe){return function(){return client[_0x9d7e('0x2')](_0x9d7e('0x3'),{'options':{'where':{'VoiceQueueId':_0x2b7dbe,'paused':!![]},'raw':!![]},'log':_0x9d7e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index a8621b0..58bf548 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(_0x525b78,_0x5b7345){var _0x53a75f=function(_0x4fc4df){while(--_0x4fc4df){_0x525b78['push'](_0x525b78['shift']());}};_0x53a75f(++_0x5b7345);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x320627,_0x58a94a){var _0x35b028=function(_0xde5e1c){while(--_0xde5e1c){_0x320627['push'](_0x320627['shift']());}};_0x35b028(++_0x58a94a);}(_0x7a54,0x106));var _0x47a5=function(_0x339b52,_0x21a8bd){_0x339b52=_0x339b52-0x0;var _0xae13c7=_0x7a54[_0x339b52];return _0xae13c7;};'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 0311700..75677bf 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 _0xde78=['secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext'];(function(_0xcc220b,_0xd09185){var _0x1f3c65=function(_0x5c7bac){while(--_0x5c7bac){_0xcc220b['push'](_0xcc220b['shift']());}};_0x1f3c65(++_0xd09185);}(_0xde78,0xfd));var _0x8de7=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0xde78[_0x5cc8b9];return _0x58892e;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x23ad4a){return client[_0x8de7('0x0')](_0x8de7('0x1'),{'body':{'result':_0x23ad4a[_0x8de7('0x2')],'transfererchannel':_0x23ad4a[_0x8de7('0x3')],'transferercalleridnum':_0x23ad4a[_0x8de7('0x4')],'transferercalleridname':_0x23ad4a[_0x8de7('0x5')],'transfererconnectedlinenum':_0x23ad4a[_0x8de7('0x6')],'transfererconnectedlinename':_0x23ad4a[_0x8de7('0x7')],'transfereraccountcode':_0x23ad4a['transfereraccountcode'],'transferercontext':_0x23ad4a[_0x8de7('0x8')],'transfererexten':_0x23ad4a[_0x8de7('0x9')],'transfererlinkedid':_0x23ad4a[_0x8de7('0xa')],'transfereechannel':_0x23ad4a[_0x8de7('0xb')],'transfereecalleridnum':_0x23ad4a[_0x8de7('0xc')],'transfereecalleridname':_0x23ad4a[_0x8de7('0xd')],'transfereeconnectedlinenum':_0x23ad4a[_0x8de7('0xe')],'transfereeconnectedlinename':_0x23ad4a[_0x8de7('0xf')],'transfereeaccountcode':_0x23ad4a[_0x8de7('0x10')],'transfereecontext':_0x23ad4a[_0x8de7('0x11')],'transfereeexten':_0x23ad4a[_0x8de7('0x12')],'transfereelinkedid':_0x23ad4a['transfereelinkedid'],'isexternal':_0x23ad4a[_0x8de7('0x13')],'context':_0x23ad4a['context'],'extension':_0x23ad4a[_0x8de7('0x14')],'type':_0x8de7('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x8de7('0x16')]=function(_0x1eddb){return client[_0x8de7('0x0')](_0x8de7('0x1'),{'body':{'result':_0x1eddb[_0x8de7('0x2')],'transfererchannel':_0x1eddb['origtransfererchannel'],'transferercalleridnum':_0x1eddb['origtransferercalleridnum'],'transferercalleridname':_0x1eddb[_0x8de7('0x17')],'transfererconnectedlinenum':_0x1eddb[_0x8de7('0x18')],'transfererconnectedlinename':_0x1eddb[_0x8de7('0x19')],'transfereraccountcode':_0x1eddb['origtransfereraccountcode'],'transferercontext':_0x1eddb[_0x8de7('0x1a')],'transfererexten':_0x1eddb[_0x8de7('0x1b')],'transfererlinkedid':_0x1eddb[_0x8de7('0x1c')],'transfereechannel':_0x1eddb[_0x8de7('0x1d')],'transfereecalleridnum':_0x1eddb[_0x8de7('0x1e')],'transfereecalleridname':_0x1eddb[_0x8de7('0x1f')],'transfereeconnectedlinenum':_0x1eddb[_0x8de7('0x20')],'transfereeconnectedlinename':_0x1eddb[_0x8de7('0x21')],'transfereeaccountcode':_0x1eddb[_0x8de7('0x22')],'transfereecontext':_0x1eddb[_0x8de7('0x23')],'transfereeexten':_0x1eddb[_0x8de7('0x24')],'transfereelinkedid':_0x1eddb[_0x8de7('0x25')],'isexternal':_0x1eddb[_0x8de7('0x13')],'context':_0x1eddb['origtransferercontext'],'extension':_0x1eddb[_0x8de7('0x26')],'type':_0x8de7('0x27')},'log':_0x8de7('0x1')});}; \ No newline at end of file +var _0xbfac=['transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x1af85c,_0x1844d7){var _0x1c61c7=function(_0x99cd2e){while(--_0x99cd2e){_0x1af85c['push'](_0x1af85c['shift']());}};_0x1c61c7(++_0x1844d7);}(_0xbfac,0x6f));var _0xcbfa=function(_0x5f0c9b,_0x2a9ce6){_0x5f0c9b=_0x5f0c9b-0x0;var _0x71ff86=_0xbfac[_0x5f0c9b];return _0x71ff86;};'use strict';var client=require(_0xcbfa('0x0'));exports[_0xcbfa('0x1')]={};exports[_0xcbfa('0x2')]=function(_0x20b69e){return client[_0xcbfa('0x3')](_0xcbfa('0x4'),{'body':{'result':_0x20b69e[_0xcbfa('0x5')],'transfererchannel':_0x20b69e['transfererchannel'],'transferercalleridnum':_0x20b69e[_0xcbfa('0x6')],'transferercalleridname':_0x20b69e['transferercalleridname'],'transfererconnectedlinenum':_0x20b69e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x20b69e[_0xcbfa('0x7')],'transfereraccountcode':_0x20b69e['transfereraccountcode'],'transferercontext':_0x20b69e['transferercontext'],'transfererexten':_0x20b69e[_0xcbfa('0x8')],'transfererlinkedid':_0x20b69e[_0xcbfa('0x9')],'transfereechannel':_0x20b69e[_0xcbfa('0xa')],'transfereecalleridnum':_0x20b69e[_0xcbfa('0xb')],'transfereecalleridname':_0x20b69e[_0xcbfa('0xc')],'transfereeconnectedlinenum':_0x20b69e[_0xcbfa('0xd')],'transfereeconnectedlinename':_0x20b69e[_0xcbfa('0xe')],'transfereeaccountcode':_0x20b69e[_0xcbfa('0xf')],'transfereecontext':_0x20b69e[_0xcbfa('0x10')],'transfereeexten':_0x20b69e[_0xcbfa('0x11')],'transfereelinkedid':_0x20b69e[_0xcbfa('0x12')],'isexternal':_0x20b69e[_0xcbfa('0x13')],'context':_0x20b69e[_0xcbfa('0x14')],'extension':_0x20b69e[_0xcbfa('0x15')],'type':_0xcbfa('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0xcbfa('0x17')]=function(_0x50c835){return client['Request'](_0xcbfa('0x4'),{'body':{'result':_0x50c835['result'],'transfererchannel':_0x50c835[_0xcbfa('0x18')],'transferercalleridnum':_0x50c835[_0xcbfa('0x19')],'transferercalleridname':_0x50c835[_0xcbfa('0x1a')],'transfererconnectedlinenum':_0x50c835[_0xcbfa('0x1b')],'transfererconnectedlinename':_0x50c835[_0xcbfa('0x1c')],'transfereraccountcode':_0x50c835[_0xcbfa('0x1d')],'transferercontext':_0x50c835[_0xcbfa('0x1e')],'transfererexten':_0x50c835[_0xcbfa('0x1f')],'transfererlinkedid':_0x50c835[_0xcbfa('0x20')],'transfereechannel':_0x50c835['transfertargetchannel'],'transfereecalleridnum':_0x50c835[_0xcbfa('0x21')],'transfereecalleridname':_0x50c835['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x50c835[_0xcbfa('0x22')],'transfereeconnectedlinename':_0x50c835[_0xcbfa('0x23')],'transfereeaccountcode':_0x50c835['transfertargetaccountcode'],'transfereecontext':_0x50c835[_0xcbfa('0x24')],'transfereeexten':_0x50c835[_0xcbfa('0x25')],'transfereelinkedid':_0x50c835[_0xcbfa('0x26')],'isexternal':_0x50c835['isexternal'],'context':_0x50c835[_0xcbfa('0x27')],'extension':_0x50c835[_0xcbfa('0x28')],'type':_0xcbfa('0x29')},'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 bd398df..0726719 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 _0xfd20=['sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','join','voicechannel','validate','map','channels','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','bluebird','moment','../properties','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','keys','action','Action','message','username','command','then','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','pTalking','sumBillable','sumDuration'];(function(_0x2e44cf,_0x16f684){var _0x361268=function(_0x2a59db){while(--_0x2a59db){_0x2e44cf['push'](_0x2e44cf['shift']());}};_0x361268(++_0x16f684);}(_0xfd20,0x66));var _0x0fd2=function(_0x2ec9a3,_0x4c511d){_0x2ec9a3=_0x2ec9a3-0x0;var _0x245fc0=_0xfd20[_0x2ec9a3];return _0x245fc0;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var config=require('../../../config/environment');var properties=require(_0x0fd2('0x3'));var ami=require('../ami');exports[_0x0fd2('0x4')]=function(_0x24292c,_0x2ef0c3,_0xf25991){return new BPromise(function(_0x247d6e,_0x4d114c){var _0x55467b={'QueuePause':function(_0x32d460){return new Promise(function(_0x15ba86,_0x24d6f4){var _0x946c0c=util[_0x0fd2('0x5')](_0x0fd2('0x6'),_0x0fd2('0x7'),_0x32d460['name']);if(_0x24292c[_0x0fd2('0x8')]&&_0x24292c[_0x0fd2('0x8')][_0x946c0c]&&_0x24292c['timers'][_0x946c0c][_0x0fd2('0x9')]){_0x24292c['timers'][_0x946c0c][_0x0fd2('0xa')]();}if(_0x24292c[_0x0fd2('0xb')][_0x946c0c]){_0x24292c[_0x0fd2('0xb')][_0x946c0c][_0x0fd2('0xc')]({'statePause':_0x32d460[_0x0fd2('0xd')]?!![]:![]});}_0x15ba86({'code':0xc8,'message':_0x0fd2('0xe')});});},'Reload':function(_0x1f7a6e){var _0x7b05c3=this;return new Promise(function(_0x51390c,_0x48c2f1){if(ami[_0x0fd2('0xf')]()==![]){return _0x48c2f1(_0x7b05c3[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config[_0x0fd2('0x11')]['username'],_0x0fd2('0x12')]['join']('\x20')));}_0x1f7a6e=_['pick'](_0x1f7a6e,_[_0x0fd2('0x13')](properties['module']));_0x1f7a6e[_0x0fd2('0x14')]='Reload';return ami[_0x0fd2('0x15')](_0x1f7a6e)['then'](function(_0x267dfb){_0x51390c({'code':0xc8,'message':_0x267dfb[_0x0fd2('0x16')]});})['catch'](function(_0x2b25d2){_0x48c2f1(_0x7b05c3['error'](0x1f5,_0x2b25d2[_0x0fd2('0x16')]));});});},'Command':function(_0x37c7fc){var _0x3fb07e=this;return new Promise(function(_0x11b423,_0x2977ef){if(ami[_0x0fd2('0xf')]()==![]){return _0x2977ef(_0x3fb07e[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config[_0x0fd2('0x11')][_0x0fd2('0x17')],'ami\x20disconnected']['join']('\x20')));}_0x37c7fc=_['pick'](_0x37c7fc,_0x0fd2('0x18'));_0x37c7fc[_0x0fd2('0x14')]='Command';return ami['Action'](_0x37c7fc)[_0x0fd2('0x19')](function(_0x25563c){_0x11b423({'code':0xc8,'message':_0x25563c[_0x0fd2('0x1a')]});})[_0x0fd2('0x1b')](function(_0x25cdd2){_0x2977ef(_0x3fb07e['error'](0x1f5,_0x25cdd2[_0x0fd2('0x16')]));});});},'VoiceQueues':function(_0x42e988){return new Promise(function(_0xd0a2cc,_0x54cce1){var _0x4c77a8=[];for(var _0x11bb10 in _0x24292c[_0x0fd2('0x1c')]){if(_0x24292c['voiceQueues'][_0x0fd2('0x1d')](_0x11bb10)){var _0x429fef=_0x24292c[_0x0fd2('0x1c')][_0x11bb10];var _0x1defb4={'id':_0x429fef['id'],'name':_0x429fef[_0x0fd2('0x1e')],'strategy':_0x429fef[_0x0fd2('0x1f')],'answered':_0x429fef[_0x0fd2('0x20')],'available':_0x429fef[_0x0fd2('0x21')],'loggedIn':_0x429fef['loggedIn'],'pTalking':_0x429fef[_0x0fd2('0x22')],'sumBillable':_0x429fef[_0x0fd2('0x23')],'sumDuration':_0x429fef[_0x0fd2('0x24')],'sumHoldTime':_0x429fef[_0x0fd2('0x25')]||0x0,'talking':_0x429fef[_0x0fd2('0x26')],'total':_0x429fef['total'],'type':_0x429fef[_0x0fd2('0x27')],'unmanaged':_0x429fef[_0x0fd2('0x28')],'abandoned':_0x429fef[_0x0fd2('0x29')],'waiting':_0x429fef[_0x0fd2('0x2a')],'loggedInDb':_0x429fef[_0x0fd2('0x2b')]};if(_0x429fef[_0x0fd2('0x27')]===_0x0fd2('0x2c')){_0x1defb4[_0x0fd2('0x2d')]=_0x429fef['dialActive'];_0x1defb4[_0x0fd2('0x2e')]=_0x429fef['dialMethod'];_0x1defb4['dialOriginateCallerIdName']=_0x429fef[_0x0fd2('0x2f')];_0x1defb4['dialOriginateCallerIdNumber']=_0x429fef[_0x0fd2('0x30')];_0x1defb4['dialOriginateTimeout']=_0x429fef[_0x0fd2('0x31')];_0x1defb4['dialPrefix']=_0x429fef['dialPrefix'];_0x1defb4[_0x0fd2('0x32')]=_0x429fef[_0x0fd2('0x32')];_0x1defb4[_0x0fd2('0x33')]=_0x429fef['outboundAnswerAgiCallsDay'];_0x1defb4['outboundAnswerCallsDay']=_0x429fef[_0x0fd2('0x34')];_0x1defb4['outboundBlacklistCallsDay']=_0x429fef[_0x0fd2('0x35')];_0x1defb4[_0x0fd2('0x36')]=_0x429fef[_0x0fd2('0x36')];_0x1defb4[_0x0fd2('0x37')]=_0x429fef[_0x0fd2('0x37')];_0x1defb4[_0x0fd2('0x38')]=_0x429fef[_0x0fd2('0x38')];_0x1defb4['outboundDropCallsDayCallersExit']=_0x429fef[_0x0fd2('0x39')];_0x1defb4[_0x0fd2('0x3a')]=_0x429fef['outboundDropCallsDayTimeout'];_0x1defb4['outboundNoAnswerCallsDay']=_0x429fef[_0x0fd2('0x3b')];_0x1defb4['outboundNoSuchCallsDay']=_0x429fef['outboundNoSuchCallsDay'];_0x1defb4[_0x0fd2('0x3c')]=_0x429fef[_0x0fd2('0x3c')];_0x1defb4[_0x0fd2('0x3d')]=_0x429fef[_0x0fd2('0x3d')];_0x1defb4[_0x0fd2('0x3e')]=_0x429fef[_0x0fd2('0x3e')];_0x1defb4[_0x0fd2('0x3f')]=_0x429fef[_0x0fd2('0x3f')];_0x1defb4[_0x0fd2('0x40')]=_0x429fef[_0x0fd2('0x40')];_0x1defb4[_0x0fd2('0x41')]=_0x429fef[_0x0fd2('0x41')];_0x1defb4[_0x0fd2('0x42')]=_0x429fef[_0x0fd2('0x42')];_0x1defb4[_0x0fd2('0x43')]=_0x429fef[_0x0fd2('0x43')];_0x1defb4['predictiveIntervalDroppedCallsTimeout']=_0x429fef[_0x0fd2('0x44')];_0x1defb4[_0x0fd2('0x45')]=_0x429fef[_0x0fd2('0x45')];_0x1defb4[_0x0fd2('0x46')]=_0x429fef['predictiveIntervalErlangCallsDroppedCalls'];_0x1defb4[_0x0fd2('0x47')]=_0x429fef['predictiveIntervalHitRate'];_0x1defb4[_0x0fd2('0x48')]=_0x429fef[_0x0fd2('0x48')];_0x1defb4['predictiveIntervalPauses']=_0x429fef[_0x0fd2('0x49')];_0x1defb4[_0x0fd2('0x4a')]=_0x429fef[_0x0fd2('0x4a')];_0x1defb4[_0x0fd2('0x4b')]=_0x429fef[_0x0fd2('0x4b')];_0x1defb4[_0x0fd2('0x16')]=_0x429fef['message'];_0x1defb4[_0x0fd2('0x4c')]=_0x429fef[_0x0fd2('0x4c')];_0x1defb4[_0x0fd2('0x4d')]=_0x429fef[_0x0fd2('0x4d')];_0x1defb4[_0x0fd2('0x4e')]=_0x429fef['erlangCallToSecond'];_0x1defb4[_0x0fd2('0x4f')]=_0x429fef[_0x0fd2('0x4f')];_0x1defb4['erlangBusyFactor']=_0x429fef[_0x0fd2('0x50')];_0x1defb4[_0x0fd2('0x51')]=_0x429fef[_0x0fd2('0x51')];_0x1defb4[_0x0fd2('0x52')]=_0x429fef[_0x0fd2('0x52')];}if(_0x429fef[_0x0fd2('0x53')]){_0x1defb4[_0x0fd2('0x53')]={'id':_0x429fef[_0x0fd2('0x53')]['id'],'name':_0x429fef['Trunk']['name'],'active':_0x429fef[_0x0fd2('0x53')][_0x0fd2('0x54')],'callerid':_0x429fef['Trunk'][_0x0fd2('0x55')]};}if(_0x429fef['Interval']){_0x1defb4[_0x0fd2('0x56')]={'id':_0x429fef[_0x0fd2('0x56')]['id'],'name':_0x429fef[_0x0fd2('0x56')][_0x0fd2('0x1e')]};}_0x4c77a8[_0x0fd2('0x57')](_0x1defb4);}}_0xd0a2cc({'count':_0x4c77a8[_0x0fd2('0x58')],'rows':_0x4c77a8});});},'UpdateVoiceQueue':function(_0x49237b){return new Promise(function(_0x558c5f,_0x1070e5){var _0x5065dc=_[_0x0fd2('0x59')](_0x24292c[_0x0fd2('0x1c')],{'id':parseInt(_0x49237b['id'])});var _0x272c0f=_[_0x0fd2('0x5a')](_0x49237b,['id']);if(_0x5065dc){for(var _0x2f47f9 in _0x272c0f){if(typeof _0x272c0f[_0x2f47f9]!=='undefined'&&typeof _0x5065dc[_0x2f47f9]!==_0x0fd2('0x5b')){_0x5065dc[_0x2f47f9]=_0x272c0f[_0x2f47f9];}}_0x558c5f(_0x5065dc);}else{_0x1070e5();}});},'VoiceChannels':function(_0x49f5c2){return new Promise(function(_0x2f0684,_0x3c3066){var _0x5352cc=_[_0x0fd2('0x5c')](_0x24292c['channels']);_0x2f0684({'count':_0x5352cc['length'],'rows':_0x5352cc});});},'VoiceChannelMixMonitor':function(_0x197b74){var _0x2bb20f=this;return new Promise(function(_0x2f27ed,_0x4e28f3){if(ami[_0x0fd2('0xf')]()==![]){return _0x4e28f3(_0x2bb20f[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config[_0x0fd2('0x11')]['username'],_0x0fd2('0x12')][_0x0fd2('0x5d')]('\x20')));}var _0x28eafe=schema(properties[_0x0fd2('0x5e')])[_0x0fd2('0x5f')](_0x197b74);if(_0x28eafe[_0x0fd2('0x58')]>0x0){return _0x4e28f3(_0x2bb20f[_0x0fd2('0x10')](0x1f4,_[_0x0fd2('0x60')](_0x28eafe,_0x0fd2('0x16'))[_0x0fd2('0x5d')](',\x20')));}var _0x7e86ca=_['find'](_0x24292c[_0x0fd2('0x61')],{'uniqueid':_0x197b74[_0x0fd2('0x62')]});if(_0x7e86ca&&_0x7e86ca['channel']){var _0x4504f7=util['format'](_0x0fd2('0x63'),_0x197b74[_0x0fd2('0x64')]||_0x197b74[_0x0fd2('0x62')],_0x197b74[_0x0fd2('0x5')]||_0x0fd2('0x65'));return ami['Action']({'action':_0x0fd2('0x66'),'channel':_0x7e86ca[_0x0fd2('0x67')],'file':_0x4504f7,'options':_0x0fd2('0x68')})['then'](function(_0x488478){var _0x23a55d=_[_0x0fd2('0x59')](_0x7e86ca[_0x0fd2('0x69')],{'filename':_0x0fd2('0x6a')+_0x4504f7[_0x0fd2('0x6b')]()});if(_[_0x0fd2('0x6c')](_0x23a55d)){_0x7e86ca['monitors'][_0x0fd2('0x57')]({'filename':_0x0fd2('0x6a')+_0x4504f7[_0x0fd2('0x6b')](),'createdAt':moment()[_0x0fd2('0x5')](_0x0fd2('0x6d')),'mixmonitorid':_0x488478[_0x0fd2('0x6e')],'status':_0x0fd2('0x6f')});}else{_0x23a55d[_0x0fd2('0x6e')]=_0x488478[_0x0fd2('0x6e')];_0x23a55d[_0x0fd2('0x70')]=_0x0fd2('0x6f');}_0x2f27ed({'code':0xc8,'message':[_0x197b74[_0x0fd2('0x62')],_0x0fd2('0x71'),_0x488478['mixmonitorid']][_0x0fd2('0x5d')]('\x20'),'mixmonitorid':_0x488478[_0x0fd2('0x6e')]});})['catch'](function(_0x230d69){_0x4e28f3(_0x2bb20f[_0x0fd2('0x10')](0x1f5,[_0x197b74[_0x0fd2('0x62')],_0x230d69[_0x0fd2('0x16')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4e28f3(_0x2bb20f['error'](0x1f5,_0x0fd2('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0x14ff78){var _0x3561ab=this;return new Promise(function(_0x27754d,_0x41dd02){if(ami[_0x0fd2('0xf')]()==![]){return _0x41dd02(_0x3561ab[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config[_0x0fd2('0x11')][_0x0fd2('0x17')],'ami\x20disconnected']['join']('\x20')));}var _0x574ff7=schema(properties['voicechannel'])['validate'](_0x14ff78);if(_0x574ff7[_0x0fd2('0x58')]>0x0){return _0x41dd02(_0x3561ab['error'](0x1f4,_[_0x0fd2('0x60')](_0x574ff7,'message')[_0x0fd2('0x5d')](',\x20')));}var _0x525b8a=_[_0x0fd2('0x59')](_0x24292c[_0x0fd2('0x61')],{'uniqueid':_0x14ff78[_0x0fd2('0x62')]});if(_0x525b8a){return BPromise['resolve']()['then'](function(){if(_0x525b8a[_0x0fd2('0x67')]){return ami[_0x0fd2('0x15')]({'action':_0x0fd2('0x73'),'channel':_0x525b8a[_0x0fd2('0x67')],'mixmonitorid':_0x14ff78[_0x0fd2('0x6e')]})[_0x0fd2('0x1b')](function(_0x359ee2){});}})[_0x0fd2('0x19')](function(){if(_0x525b8a[_0x0fd2('0x74')]){return ami['Action']({'action':_0x0fd2('0x73'),'channel':_0x525b8a[_0x0fd2('0x74')],'mixmonitorid':_0x14ff78[_0x0fd2('0x6e')]})['catch'](function(_0x3ca213){});}})['then'](function(_0x3659b6){var _0x4244cf=_[_0x0fd2('0x59')](_0x525b8a[_0x0fd2('0x69')],{'mixmonitorid':_0x14ff78[_0x0fd2('0x6e')]});if(_0x4244cf){_0x4244cf[_0x0fd2('0x70')]=_0x0fd2('0x75');}})[_0x0fd2('0x19')](function(){var _0x53bb88=util[_0x0fd2('0x5')](_0x0fd2('0x63'),_0x14ff78['filename']||_0x14ff78[_0x0fd2('0x62')],_0x14ff78[_0x0fd2('0x5')]||_0x0fd2('0x65'));var _0x58d2f1=_[_0x0fd2('0x59')](_0x525b8a[_0x0fd2('0x69')],{'filename':_0x0fd2('0x6a')+_0x53bb88[_0x0fd2('0x6b')]()});if(_0x58d2f1){_0x58d2f1[_0x0fd2('0x70')]=_0x0fd2('0x75');}})[_0x0fd2('0x19')](function(){_0x27754d({'code':0xc8,'message':[_0x14ff78[_0x0fd2('0x62')],_0x0fd2('0x76')]['join']('\x20')});})[_0x0fd2('0x1b')](function(_0x10b4ce){_0x41dd02(_0x3561ab[_0x0fd2('0x10')](0x1f5,[_0x14ff78['uniqueid'],_0x10b4ce[_0x0fd2('0x16')][_0x0fd2('0x6b')]()][_0x0fd2('0x5d')]('\x20')));});}else{return _0x41dd02(_0x3561ab[_0x0fd2('0x10')](0x1f5,_0x0fd2('0x72')));}});},'VoiceQueuesChannels':function(_0x4c1039){return new Promise(function(_0x4fa4a8,_0x43533a){var _0x3f606d=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x77')]);_0x4fa4a8({'count':_0x3f606d[_0x0fd2('0x58')],'rows':_0x3f606d});});},'VoiceQueuesChannel':function(_0x446cf5){var _0x3b4296=this;return new Promise(function(_0x3c65f5,_0x54aadc){var _0x14f6fb=schema(properties[_0x0fd2('0x78')])[_0x0fd2('0x5f')](_0x446cf5);if(_0x14f6fb[_0x0fd2('0x58')]>0x0){return _0x54aadc(_0x3b4296['error'](0x1f4,_[_0x0fd2('0x60')](_0x14f6fb,_0x0fd2('0x16'))[_0x0fd2('0x5d')](',\x20')));}var _0x3209fc=_[_0x0fd2('0x59')](_0x24292c[_0x0fd2('0x77')],{'uniqueid':_0x446cf5[_0x0fd2('0x62')]});if(_0x3209fc){_0x3c65f5(_0x3209fc);}else{return _0x54aadc(_0x3b4296[_0x0fd2('0x10')](0x1f5,_0x0fd2('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x52bf46){var _0x117d48=this;return new Promise(function(_0x28a1e3,_0x16b326){if(ami[_0x0fd2('0xf')]()==![]){return _0x16b326(_0x117d48[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config[_0x0fd2('0x11')][_0x0fd2('0x17')],'ami\x20disconnected'][_0x0fd2('0x5d')]('\x20')));}var _0x3b4bfc=schema(properties[_0x0fd2('0x79')])[_0x0fd2('0x5f')](_0x52bf46);if(_0x3b4bfc[_0x0fd2('0x58')]>0x0){return _0x16b326(_0x117d48['error'](0x1f4,_['map'](_0x3b4bfc,_0x0fd2('0x16'))[_0x0fd2('0x5d')](',\x20')));}var _0x23627c=_['find'](_0x24292c[_0x0fd2('0x77')],{'uniqueid':_0x52bf46[_0x0fd2('0x62')]});if(_0x23627c&&_0x23627c[_0x0fd2('0x67')]){return ami[_0x0fd2('0x15')]({'action':_0x0fd2('0x7a'),'channel':_0x23627c[_0x0fd2('0x67')]})[_0x0fd2('0x19')](function(_0x107720){_0x28a1e3({'code':0xc8,'message':[_0x52bf46[_0x0fd2('0x62')],_0x107720[_0x0fd2('0x16')][_0x0fd2('0x6b')]()][_0x0fd2('0x5d')]('\x20')});})[_0x0fd2('0x1b')](function(_0xdd828a){_0x16b326(_0x117d48['error'](0x1f5,[_0x52bf46[_0x0fd2('0x62')],_0xdd828a[_0x0fd2('0x16')][_0x0fd2('0x6b')]()]['join']('\x20')));});}else{return _0x16b326(_0x117d48[_0x0fd2('0x10')](0x1f5,_0x0fd2('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x812b5b){var _0x208dbb=this;return new Promise(function(_0x9bc301,_0x137dde){if(ami[_0x0fd2('0xf')]()==![]){return _0x137dde(_0x208dbb[_0x0fd2('0x10')](0x1f4,[config[_0x0fd2('0x11')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x0fd2('0x5d')]('\x20')));}var _0x7dd1d4=schema(properties[_0x0fd2('0x7b')])[_0x0fd2('0x5f')](_0x812b5b);if(_0x7dd1d4[_0x0fd2('0x58')]>0x0){return _0x137dde(_0x208dbb[_0x0fd2('0x10')](0x1f4,_['map'](_0x7dd1d4,_0x0fd2('0x16'))['join'](',\x20')));}var _0x144883=_[_0x0fd2('0x59')](_0x24292c['queueChannels'],{'uniqueid':_0x812b5b[_0x0fd2('0x62')]});if(_0x144883&&_0x144883[_0x0fd2('0x67')]){return ami[_0x0fd2('0x15')]({'action':'Redirect','channel':_0x144883[_0x0fd2('0x67')],'exten':_0x812b5b[_0x0fd2('0x7c')],'context':_0x812b5b['context']||_0x144883['context'],'priority':0x1})[_0x0fd2('0x19')](function(_0x399912){_0x9bc301({'code':0xc8,'message':[_0x812b5b[_0x0fd2('0x62')],_0x399912[_0x0fd2('0x16')][_0x0fd2('0x6b')]()]['join']('\x20')});})[_0x0fd2('0x1b')](function(_0x18e41a){_0x137dde(_0x208dbb['error'](0x1f5,[_0x812b5b[_0x0fd2('0x62')],_0x18e41a[_0x0fd2('0x16')][_0x0fd2('0x6b')]()][_0x0fd2('0x5d')]('\x20')));});}else{return _0x137dde(_0x208dbb['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x166caa){return new Promise(function(_0x524528,_0x2d13cf){var _0x4174be=_['values'](_0x24292c['agents']);_0x524528({'count':_0x4174be[_0x0fd2('0x58')],'rows':_0x4174be});});},'Telephones':function(_0x21d371){return new Promise(function(_0x2043f5,_0x552dcd){var _0x22c88a=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x7d')]);_0x2043f5({'count':_0x22c88a['length'],'rows':_0x22c88a});});},'Trunks':function(_0x2bc09e){return new Promise(function(_0x3d65f,_0x4b634c){var _0x5cc6fe=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x7e')]);_0x3d65f({'count':_0x5cc6fe[_0x0fd2('0x58')],'rows':_0x5cc6fe});});},'OutboundChannels':function(_0x26e1ef){return new Promise(function(_0x394aba,_0x4b2b12){var _0xa4f2=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x7f')]);_0x394aba({'count':_0xa4f2[_0x0fd2('0x58')],'rows':_0xa4f2});});},'Outbound':function(_0xcde4ef){return new Promise(function(_0x348e47,_0x5ac703){_0x348e47(_0x24292c[_0x0fd2('0x2c')]);});},'Campaigns':function(_0x55d1b4){return new Promise(function(_0x5e6f0f,_0x284bce){var _0x334fc6=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x80')]);_0x5e6f0f({'count':_0x334fc6['length'],'rows':_0x334fc6});});},'VoiceQueuesPreview':function(_0x1becbc){var _0x222cd7=this;return new Promise(function(_0x4c8b8e,_0x511bb5){_0x2ef0c3['run'](_0x1becbc['id'])[_0x0fd2('0x19')](function(_0x2abc7e){_0x4c8b8e({'code':0xc8,'message':_0x2abc7e[_0x0fd2('0x16')]});})[_0x0fd2('0x1b')](function(_0x15644a){_0x511bb5(_0x222cd7[_0x0fd2('0x10')](0x1f4,_0x15644a[_0x0fd2('0x16')]));});});},'EventManager':function(_0x3a58cb){var _0x20ff5c=this;return new Promise(function(_0xf3a887,_0x5c3e9f){if(!_0x3a58cb[_0x0fd2('0x81')]){return _0x5c3e9f(_0x20ff5c[_0x0fd2('0x10')](0x1f4,_0x0fd2('0x82')));}ami[_0x0fd2('0x83')](_0x0fd2('0x84')+_0x3a58cb[_0x0fd2('0x81')],_0x3a58cb[_0x0fd2('0x16')]);_0xf3a887({'code':0xc8,'message':_0x3a58cb});});},'FaxAccounts':function(_0x480ff5){return new Promise(function(_0x3d2035,_0x1ceb35){var _0x19bc9a=_[_0x0fd2('0x5c')](_0x24292c[_0x0fd2('0x85')]);_0x3d2035({'count':_0x19bc9a[_0x0fd2('0x58')],'rows':_0x19bc9a});});},'SendFax':function(_0x203979){var _0x4141de=this;return new Promise(function(_0x5f2d08,_0x472399){_0xf25991[_0x0fd2('0x86')](_0x203979)[_0x0fd2('0x19')](function(_0x475249){_0x5f2d08({'code':0xc8,'message':_0x475249[_0x0fd2('0x16')]});})[_0x0fd2('0x1b')](function(_0x51a77f){_0x472399(_0x4141de[_0x0fd2('0x10')](0x1f4,_0x51a77f[_0x0fd2('0x16')]));});});},'CheckAfterSend':function(_0x568518){var _0x26dfe7=this;return new Promise(function(_0x293f51,_0x4f0a35){_0xf25991['checkAfterSend'](_0x568518)[_0x0fd2('0x19')](function(_0x27e6ac){_0x293f51({'code':0xc8,'message':_0x27e6ac[_0x0fd2('0x16')]});})[_0x0fd2('0x1b')](function(_0x548f50){_0x4f0a35(_0x26dfe7['error'](0x1f4,_0x548f50[_0x0fd2('0x16')]));});});}};var _0x46d4f2=jayson[_0x0fd2('0x87')](_0x55467b)['http']();_0x46d4f2['on'](_0x0fd2('0x10'),function(_0x2acc75){return _0x4d114c(_0x2acc75);});_0x46d4f2[_0x0fd2('0x4')](0x232a,_0x0fd2('0x88'),function(){console[_0x0fd2('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x247d6e(_0x0fd2('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x5162=['ami\x20disconnected','join','pick','keys','module','action','Action','then','catch','message','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','validate','uniqueid','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','filename','status','stop','StopMixMonitor\x20Success','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x483e4a,_0x32aa45){_0x483e4a=_0x483e4a-0x0;var _0x31fba5=_0x5162[_0x483e4a];return _0x31fba5;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x2516('0x1'));var config=require(_0x2516('0x2'));var properties=require(_0x2516('0x3'));var ami=require(_0x2516('0x4'));exports[_0x2516('0x5')]=function(_0x25dce6,_0x3a7984,_0x5b71b5){return new BPromise(function(_0x48f411,_0x5beeb3){var _0x20a4a4={'QueuePause':function(_0xba4b36){return new Promise(function(_0xa1557,_0x3a8834){var _0x3abc5d=util[_0x2516('0x6')](_0x2516('0x7'),'SIP',_0xba4b36[_0x2516('0x8')]);if(_0x25dce6[_0x2516('0x9')]&&_0x25dce6[_0x2516('0x9')][_0x3abc5d]&&_0x25dce6['timers'][_0x3abc5d]['timer']){_0x25dce6['timers'][_0x3abc5d]['updateAcw']();}if(_0x25dce6[_0x2516('0xa')][_0x3abc5d]){_0x25dce6[_0x2516('0xa')][_0x3abc5d][_0x2516('0xb')]({'statePause':_0xba4b36[_0x2516('0xc')]?!![]:![]});}_0xa1557({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x33496b){var _0x458aca=this;return new Promise(function(_0x171da2,_0xb28714){if(ami[_0x2516('0xd')]()==![]){return _0xb28714(_0x458aca[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}_0x33496b=_[_0x2516('0x13')](_0x33496b,_[_0x2516('0x14')](properties[_0x2516('0x15')]));_0x33496b[_0x2516('0x16')]='Reload';return ami[_0x2516('0x17')](_0x33496b)[_0x2516('0x18')](function(_0x1a1005){_0x171da2({'code':0xc8,'message':_0x1a1005['message']});})[_0x2516('0x19')](function(_0x5e96c7){_0xb28714(_0x458aca['error'](0x1f5,_0x5e96c7[_0x2516('0x1a')]));});});},'Command':function(_0x3583cf){var _0x151168=this;return new Promise(function(_0x618aed,_0x198b93){if(ami[_0x2516('0xd')]()==![]){return _0x198b93(_0x151168[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}_0x3583cf=_[_0x2516('0x13')](_0x3583cf,'command');_0x3583cf['action']=_0x2516('0x1b');return ami[_0x2516('0x17')](_0x3583cf)[_0x2516('0x18')](function(_0x2d5b1b){_0x618aed({'code':0xc8,'message':_0x2d5b1b[_0x2516('0x1c')]});})[_0x2516('0x19')](function(_0x3d906d){_0x198b93(_0x151168[_0x2516('0xe')](0x1f5,_0x3d906d['message']));});});},'VoiceQueues':function(_0xa4538d){return new Promise(function(_0x39c63f,_0x774b60){var _0x434d54=[];for(var _0x47f4fb in _0x25dce6[_0x2516('0x1d')]){if(_0x25dce6[_0x2516('0x1d')][_0x2516('0x1e')](_0x47f4fb)){var _0x3d728a=_0x25dce6[_0x2516('0x1d')][_0x47f4fb];var _0x4a3dc8={'id':_0x3d728a['id'],'name':_0x3d728a[_0x2516('0x8')],'strategy':_0x3d728a[_0x2516('0x1f')],'answered':_0x3d728a[_0x2516('0x20')],'available':_0x3d728a[_0x2516('0x21')],'loggedIn':_0x3d728a[_0x2516('0x22')],'pTalking':_0x3d728a[_0x2516('0x23')],'sumBillable':_0x3d728a['sumBillable'],'sumDuration':_0x3d728a[_0x2516('0x24')],'sumHoldTime':_0x3d728a[_0x2516('0x25')]||0x0,'talking':_0x3d728a['talking'],'total':_0x3d728a[_0x2516('0x26')],'type':_0x3d728a[_0x2516('0x27')],'unmanaged':_0x3d728a[_0x2516('0x28')],'abandoned':_0x3d728a[_0x2516('0x29')],'waiting':_0x3d728a[_0x2516('0x2a')],'loggedInDb':_0x3d728a[_0x2516('0x2b')]};if(_0x3d728a[_0x2516('0x27')]===_0x2516('0x2c')){_0x4a3dc8[_0x2516('0x2d')]=_0x3d728a[_0x2516('0x2d')];_0x4a3dc8[_0x2516('0x2e')]=_0x3d728a[_0x2516('0x2e')];_0x4a3dc8[_0x2516('0x2f')]=_0x3d728a[_0x2516('0x2f')];_0x4a3dc8[_0x2516('0x30')]=_0x3d728a['dialOriginateCallerIdNumber'];_0x4a3dc8[_0x2516('0x31')]=_0x3d728a['dialOriginateTimeout'];_0x4a3dc8[_0x2516('0x32')]=_0x3d728a['dialPrefix'];_0x4a3dc8[_0x2516('0x33')]=_0x3d728a['temp'];_0x4a3dc8[_0x2516('0x34')]=_0x3d728a[_0x2516('0x34')];_0x4a3dc8[_0x2516('0x35')]=_0x3d728a[_0x2516('0x35')];_0x4a3dc8[_0x2516('0x36')]=_0x3d728a[_0x2516('0x36')];_0x4a3dc8[_0x2516('0x37')]=_0x3d728a[_0x2516('0x37')];_0x4a3dc8[_0x2516('0x38')]=_0x3d728a['outboundCongestionCallsDay'];_0x4a3dc8[_0x2516('0x39')]=_0x3d728a[_0x2516('0x39')];_0x4a3dc8[_0x2516('0x3a')]=_0x3d728a[_0x2516('0x3a')];_0x4a3dc8['outboundDropCallsDayTimeout']=_0x3d728a['outboundDropCallsDayTimeout'];_0x4a3dc8[_0x2516('0x3b')]=_0x3d728a[_0x2516('0x3b')];_0x4a3dc8[_0x2516('0x3c')]=_0x3d728a[_0x2516('0x3c')];_0x4a3dc8[_0x2516('0x3d')]=_0x3d728a[_0x2516('0x3d')];_0x4a3dc8[_0x2516('0x3e')]=_0x3d728a[_0x2516('0x3e')];_0x4a3dc8[_0x2516('0x3f')]=_0x3d728a[_0x2516('0x3f')];_0x4a3dc8['outboundUnknownCallsDay']=_0x3d728a['outboundUnknownCallsDay'];_0x4a3dc8[_0x2516('0x40')]=_0x3d728a[_0x2516('0x40')];_0x4a3dc8['predictiveIntervalAvgHoldtime']=_0x3d728a['predictiveIntervalAvgHoldtime'];_0x4a3dc8[_0x2516('0x41')]=_0x3d728a[_0x2516('0x41')];_0x4a3dc8['predictiveIntervalDroppedCallsCallersExit']=_0x3d728a[_0x2516('0x42')];_0x4a3dc8['predictiveIntervalDroppedCallsTimeout']=_0x3d728a[_0x2516('0x43')];_0x4a3dc8[_0x2516('0x44')]=_0x3d728a['predictiveIntervalErlangCalls'];_0x4a3dc8[_0x2516('0x45')]=_0x3d728a[_0x2516('0x45')];_0x4a3dc8[_0x2516('0x46')]=_0x3d728a[_0x2516('0x46')];_0x4a3dc8[_0x2516('0x47')]=_0x3d728a[_0x2516('0x47')];_0x4a3dc8[_0x2516('0x48')]=_0x3d728a[_0x2516('0x48')];_0x4a3dc8[_0x2516('0x49')]=_0x3d728a[_0x2516('0x49')];_0x4a3dc8[_0x2516('0x4a')]=_0x3d728a[_0x2516('0x4a')];_0x4a3dc8[_0x2516('0x1a')]=_0x3d728a['message'];_0x4a3dc8[_0x2516('0x4b')]=_0x3d728a[_0x2516('0x4b')];_0x4a3dc8['erlangCalls']=_0x3d728a[_0x2516('0x4c')];_0x4a3dc8[_0x2516('0x4d')]=_0x3d728a[_0x2516('0x4d')];_0x4a3dc8[_0x2516('0x4e')]=_0x3d728a[_0x2516('0x4e')];_0x4a3dc8['erlangBusyFactor']=_0x3d728a[_0x2516('0x4f')];_0x4a3dc8[_0x2516('0x50')]=_0x3d728a[_0x2516('0x50')];_0x4a3dc8[_0x2516('0x51')]=_0x3d728a[_0x2516('0x51')];}if(_0x3d728a[_0x2516('0x52')]){_0x4a3dc8['Trunk']={'id':_0x3d728a[_0x2516('0x52')]['id'],'name':_0x3d728a[_0x2516('0x52')][_0x2516('0x8')],'active':_0x3d728a[_0x2516('0x52')][_0x2516('0x53')],'callerid':_0x3d728a[_0x2516('0x52')][_0x2516('0x54')]};}if(_0x3d728a['Interval']){_0x4a3dc8[_0x2516('0x55')]={'id':_0x3d728a['Interval']['id'],'name':_0x3d728a[_0x2516('0x55')]['name']};}_0x434d54[_0x2516('0x56')](_0x4a3dc8);}}_0x39c63f({'count':_0x434d54[_0x2516('0x57')],'rows':_0x434d54});});},'UpdateVoiceQueue':function(_0x427cf6){return new Promise(function(_0x47f9a0,_0x4a2de3){var _0x2ede9f=_[_0x2516('0x58')](_0x25dce6['voiceQueues'],{'id':parseInt(_0x427cf6['id'])});var _0x5471e5=_[_0x2516('0x59')](_0x427cf6,['id']);if(_0x2ede9f){for(var _0x147e05 in _0x5471e5){if(typeof _0x5471e5[_0x147e05]!==_0x2516('0x5a')&&typeof _0x2ede9f[_0x147e05]!=='undefined'){_0x2ede9f[_0x147e05]=_0x5471e5[_0x147e05];}}_0x47f9a0(_0x2ede9f);}else{_0x4a2de3();}});},'VoiceChannels':function(_0xddc748){return new Promise(function(_0x4899ae,_0x2c7e2d){var _0x39fd32=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x5c')]);_0x4899ae({'count':_0x39fd32['length'],'rows':_0x39fd32});});},'VoiceChannelMixMonitor':function(_0x56d3e5){var _0xa08af4=this;return new Promise(function(_0x16b382,_0x236048){if(ami[_0x2516('0xd')]()==![]){return _0x236048(_0xa08af4['error'](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')]['join']('\x20')));}var _0x45e179=schema(properties[_0x2516('0x5d')])[_0x2516('0x5e')](_0x56d3e5);if(_0x45e179[_0x2516('0x57')]>0x0){return _0x236048(_0xa08af4[_0x2516('0xe')](0x1f4,_['map'](_0x45e179,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0x136d5c=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x5c')],{'uniqueid':_0x56d3e5[_0x2516('0x5f')]});if(_0x136d5c&&_0x136d5c['channel']){var _0x4f3eba=util['format'](_0x2516('0x60'),_0x56d3e5['filename']||_0x56d3e5['uniqueid'],_0x56d3e5['format']||_0x2516('0x61'));return ami[_0x2516('0x17')]({'action':_0x2516('0x62'),'channel':_0x136d5c[_0x2516('0x63')],'file':_0x4f3eba,'options':_0x2516('0x64')})['then'](function(_0x1c1e14){var _0x32b432=_[_0x2516('0x58')](_0x136d5c['monitors'],{'filename':_0x2516('0x65')+_0x4f3eba[_0x2516('0x66')]()});if(_['isNil'](_0x32b432)){_0x136d5c[_0x2516('0x67')][_0x2516('0x56')]({'filename':_0x2516('0x65')+_0x4f3eba[_0x2516('0x66')](),'createdAt':moment()[_0x2516('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x1c1e14['mixmonitorid'],'status':_0x2516('0x68')});}else{_0x32b432['mixmonitorid']=_0x1c1e14[_0x2516('0x69')];_0x32b432['status']=_0x2516('0x68');}_0x16b382({'code':0xc8,'message':[_0x56d3e5[_0x2516('0x5f')],_0x2516('0x6a'),_0x1c1e14[_0x2516('0x69')]][_0x2516('0x12')]('\x20'),'mixmonitorid':_0x1c1e14[_0x2516('0x69')]});})[_0x2516('0x19')](function(_0xf9c375){_0x236048(_0xa08af4[_0x2516('0xe')](0x1f5,[_0x56d3e5[_0x2516('0x5f')],_0xf9c375[_0x2516('0x1a')]['toLowerCase']()][_0x2516('0x12')]('\x20')));});}else{return _0x236048(_0xa08af4[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x48dc96){var _0x26715c=this;return new Promise(function(_0x58eff3,_0x435450){if(ami[_0x2516('0xd')]()==![]){return _0x435450(_0x26715c[_0x2516('0xe')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x2c2032=schema(properties[_0x2516('0x5d')])['validate'](_0x48dc96);if(_0x2c2032[_0x2516('0x57')]>0x0){return _0x435450(_0x26715c[_0x2516('0xe')](0x1f4,_[_0x2516('0x6c')](_0x2c2032,'message')[_0x2516('0x12')](',\x20')));}var _0x4300b0=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x5c')],{'uniqueid':_0x48dc96[_0x2516('0x5f')]});if(_0x4300b0){return BPromise[_0x2516('0x6d')]()[_0x2516('0x18')](function(){if(_0x4300b0[_0x2516('0x63')]){return ami[_0x2516('0x17')]({'action':_0x2516('0x6e'),'channel':_0x4300b0[_0x2516('0x63')],'mixmonitorid':_0x48dc96[_0x2516('0x69')]})[_0x2516('0x19')](function(_0x47f211){});}})[_0x2516('0x18')](function(){if(_0x4300b0[_0x2516('0x6f')]){return ami[_0x2516('0x17')]({'action':_0x2516('0x6e'),'channel':_0x4300b0[_0x2516('0x6f')],'mixmonitorid':_0x48dc96[_0x2516('0x69')]})[_0x2516('0x19')](function(_0x496001){});}})[_0x2516('0x18')](function(_0xab7abf){var _0x2ee658=_[_0x2516('0x58')](_0x4300b0[_0x2516('0x67')],{'mixmonitorid':_0x48dc96[_0x2516('0x69')]});if(_0x2ee658){_0x2ee658['status']='stop';}})['then'](function(){var _0x331d78=util[_0x2516('0x6')](_0x2516('0x60'),_0x48dc96[_0x2516('0x70')]||_0x48dc96['uniqueid'],_0x48dc96['format']||_0x2516('0x61'));var _0x56645a=_[_0x2516('0x58')](_0x4300b0[_0x2516('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x331d78[_0x2516('0x66')]()});if(_0x56645a){_0x56645a[_0x2516('0x71')]=_0x2516('0x72');}})[_0x2516('0x18')](function(){_0x58eff3({'code':0xc8,'message':[_0x48dc96[_0x2516('0x5f')],_0x2516('0x73')][_0x2516('0x12')]('\x20')});})[_0x2516('0x19')](function(_0x120f03){_0x435450(_0x26715c['error'](0x1f5,[_0x48dc96['uniqueid'],_0x120f03[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')));});}else{return _0x435450(_0x26715c['error'](0x1f5,_0x2516('0x6b')));}});},'VoiceQueuesChannels':function(_0x556641){return new Promise(function(_0x44bfef,_0x3f6601){var _0x1b8c97=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x74')]);_0x44bfef({'count':_0x1b8c97[_0x2516('0x57')],'rows':_0x1b8c97});});},'VoiceQueuesChannel':function(_0x3d0d99){var _0x3379f8=this;return new Promise(function(_0x6029a3,_0x129987){var _0x4eaddd=schema(properties['voicequeuechannel'])[_0x2516('0x5e')](_0x3d0d99);if(_0x4eaddd['length']>0x0){return _0x129987(_0x3379f8['error'](0x1f4,_[_0x2516('0x6c')](_0x4eaddd,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0xa4eeae=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x3d0d99[_0x2516('0x5f')]});if(_0xa4eeae){_0x6029a3(_0xa4eeae);}else{return _0x129987(_0x3379f8[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x5d481b){var _0xe966c8=this;return new Promise(function(_0x2e1029,_0x350562){if(ami[_0x2516('0xd')]()==![]){return _0x350562(_0xe966c8['error'](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x3c4f24=schema(properties['voicequeuechannelhangup'])[_0x2516('0x5e')](_0x5d481b);if(_0x3c4f24['length']>0x0){return _0x350562(_0xe966c8['error'](0x1f4,_[_0x2516('0x6c')](_0x3c4f24,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0x49a992=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x5d481b[_0x2516('0x5f')]});if(_0x49a992&&_0x49a992[_0x2516('0x63')]){return ami['Action']({'action':_0x2516('0x75'),'channel':_0x49a992[_0x2516('0x63')]})[_0x2516('0x18')](function(_0x1d1983){_0x2e1029({'code':0xc8,'message':[_0x5d481b['uniqueid'],_0x1d1983[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')});})['catch'](function(_0x2397ba){_0x350562(_0xe966c8['error'](0x1f5,[_0x5d481b[_0x2516('0x5f')],_0x2397ba[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')));});}else{return _0x350562(_0xe966c8[_0x2516('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5f0806){var _0x4d671b=this;return new Promise(function(_0x3d8389,_0x444391){if(ami['isConnected']()==![]){return _0x444391(_0x4d671b[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x493c5c=schema(properties[_0x2516('0x76')])[_0x2516('0x5e')](_0x5f0806);if(_0x493c5c[_0x2516('0x57')]>0x0){return _0x444391(_0x4d671b['error'](0x1f4,_['map'](_0x493c5c,'message')[_0x2516('0x12')](',\x20')));}var _0x2dc677=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x5f0806['uniqueid']});if(_0x2dc677&&_0x2dc677['channel']){return ami['Action']({'action':_0x2516('0x77'),'channel':_0x2dc677[_0x2516('0x63')],'exten':_0x5f0806[_0x2516('0x78')],'context':_0x5f0806[_0x2516('0x79')]||_0x2dc677[_0x2516('0x79')],'priority':0x1})[_0x2516('0x18')](function(_0x3b8348){_0x3d8389({'code':0xc8,'message':[_0x5f0806[_0x2516('0x5f')],_0x3b8348['message'][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')});})[_0x2516('0x19')](function(_0x320d38){_0x444391(_0x4d671b[_0x2516('0xe')](0x1f5,[_0x5f0806['uniqueid'],_0x320d38[_0x2516('0x1a')][_0x2516('0x66')]()]['join']('\x20')));});}else{return _0x444391(_0x4d671b[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'Agents':function(_0x1a1297){return new Promise(function(_0x1b517c,_0x9f96cf){var _0x3b1a02=_['values'](_0x25dce6[_0x2516('0xa')]);_0x1b517c({'count':_0x3b1a02[_0x2516('0x57')],'rows':_0x3b1a02});});},'Telephones':function(_0x24f7d7){return new Promise(function(_0x23ef83,_0x4493ab){var _0xe93655=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x7a')]);_0x23ef83({'count':_0xe93655[_0x2516('0x57')],'rows':_0xe93655});});},'Trunks':function(_0x559f5d){return new Promise(function(_0x57b13b,_0x5ba32a){var _0x447786=_[_0x2516('0x5b')](_0x25dce6['trunks']);_0x57b13b({'count':_0x447786['length'],'rows':_0x447786});});},'OutboundChannels':function(_0x40efc6){return new Promise(function(_0x1d2e2f,_0x6e55a6){var _0x158a9a=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x7b')]);_0x1d2e2f({'count':_0x158a9a[_0x2516('0x57')],'rows':_0x158a9a});});},'Outbound':function(_0x4ccd7d){return new Promise(function(_0x3b71a1,_0x36eab7){_0x3b71a1(_0x25dce6[_0x2516('0x2c')]);});},'Campaigns':function(_0x18a9e9){return new Promise(function(_0x7c48ce,_0x7cedc9){var _0x273b11=_['values'](_0x25dce6['campaigns']);_0x7c48ce({'count':_0x273b11[_0x2516('0x57')],'rows':_0x273b11});});},'VoiceQueuesPreview':function(_0x3de1cd){var _0x1cea65=this;return new Promise(function(_0x56aa6c,_0x17548a){_0x3a7984[_0x2516('0x7c')](_0x3de1cd['id'])[_0x2516('0x18')](function(_0x3ebdd5){_0x56aa6c({'code':0xc8,'message':_0x3ebdd5[_0x2516('0x1a')]});})[_0x2516('0x19')](function(_0x581c2c){_0x17548a(_0x1cea65[_0x2516('0xe')](0x1f4,_0x581c2c[_0x2516('0x1a')]));});});},'EventManager':function(_0x2e58b1){var _0x38cf65=this;return new Promise(function(_0x124371,_0x2d9c8e){if(!_0x2e58b1[_0x2516('0x7d')]){return _0x2d9c8e(_0x38cf65[_0x2516('0xe')](0x1f4,_0x2516('0x7e')));}ami[_0x2516('0x7f')](_0x2516('0x80')+_0x2e58b1[_0x2516('0x7d')],_0x2e58b1[_0x2516('0x1a')]);_0x124371({'code':0xc8,'message':_0x2e58b1});});},'FaxAccounts':function(_0x18c309){return new Promise(function(_0xbb1c7d,_0x41cdef){var _0x4d9432=_['values'](_0x25dce6[_0x2516('0x81')]);_0xbb1c7d({'count':_0x4d9432[_0x2516('0x57')],'rows':_0x4d9432});});},'SendFax':function(_0xe66cb3){var _0x4099fc=this;return new Promise(function(_0x33da91,_0x14208b){_0x5b71b5[_0x2516('0x82')](_0xe66cb3)[_0x2516('0x18')](function(_0x5d6926){_0x33da91({'code':0xc8,'message':_0x5d6926[_0x2516('0x1a')]});})[_0x2516('0x19')](function(_0xfd644c){_0x14208b(_0x4099fc['error'](0x1f4,_0xfd644c[_0x2516('0x1a')]));});});},'CheckAfterSend':function(_0x498661){var _0x12caef=this;return new Promise(function(_0x48863e,_0x3ecad0){_0x5b71b5[_0x2516('0x83')](_0x498661)['then'](function(_0xd47496){_0x48863e({'code':0xc8,'message':_0xd47496['message']});})[_0x2516('0x19')](function(_0xd649dc){_0x3ecad0(_0x12caef[_0x2516('0xe')](0x1f4,_0xd649dc[_0x2516('0x1a')]));});});}};var _0x3f9d07=jayson[_0x2516('0x84')](_0x20a4a4)[_0x2516('0x85')]();_0x3f9d07['on'](_0x2516('0xe'),function(_0x1e40f0){return _0x5beeb3(_0x1e40f0);});_0x3f9d07['listen'](0x232a,_0x2516('0x86'),function(){console[_0x2516('0x87')](_0x2516('0x88'),0x232a);return _0x48f411(_0x2516('0x89')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 7a027de..e73c5d7 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 _0x5636=['data3','split','phone','$or','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','routeId','firstName','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','data5','xmd-contactid','ListId'];(function(_0x4b1e84,_0x5063eb){var _0x384546=function(_0x4d0f0f){while(--_0x4d0f0f){_0x4b1e84['push'](_0x4b1e84['shift']());}};_0x384546(++_0x5063eb);}(_0x5636,0x102));var _0x6563=function(_0x55ebe3,_0x49607c){_0x55ebe3=_0x55ebe3-0x0;var _0x1b0991=_0x5636[_0x55ebe3];return _0x1b0991;};'use strict';var _=require(_0x6563('0x0'));var BPromise=require(_0x6563('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x6563('0x2'))(_0x6563('0x3'));var cmContactRpc=require(_0x6563('0x4'));config['redis']=_[_0x6563('0x5')](config[_0x6563('0x6')],{'host':_0x6563('0x7'),'port':0x18eb});var io=require(_0x6563('0x8'))(new Redis(config[_0x6563('0x6')]));function emit(_0x193942,_0x9884a9,_0x2d57d5,_0x2d0d5b,_0x98fcd4){logger[_0x6563('0x9')](_0x6563('0xa'),_0x193942,_0x9884a9['id'],_0x2d57d5,_0x2d0d5b,JSON[_0x6563('0xb')](_0x98fcd4));io['to'](_0x2d57d5)['emit'](_0x2d0d5b,_0x98fcd4);}exports['exec']=function(_0x2946f3,_0x129fa3,_0x490a56,_0x506ee9){var _0x5da960,_0x1ef002;var _0x111d38={};var _0x35936d=Number(_0x490a56[_0x6563('0xc')]);var _0x33816e=_0x490a56[_0x6563('0xd')]?Boolean(Number(_0x490a56[_0x6563('0xd')])):![];var _0xbbae72;var _0x447f9a=![];if(!_['isNil'](_0x490a56[_0x6563('0xe')])){if(_0x490a56['data5']=='1')_0x447f9a=!![];}if(!_0x447f9a){if(_0x506ee9[_0x6563('0xf')]){_0x111d38['id']=_0x506ee9[_0x6563('0xf')];}}if(!_0x111d38['id']){_0x111d38[_0x6563('0x10')]=_0x35936d;_0xbbae72=_0x490a56[_0x6563('0x11')]&&_0x490a56['data3']!=='0'?_0x490a56[_0x6563('0x11')][_0x6563('0x12')](','):[_0x6563('0x13')];_0x111d38[_0x6563('0x14')]=_['map'](_0xbbae72,function(_0x3563fd){var _0x589632={};_0x589632[_0x3563fd]=_0x506ee9['routeId']?_0x506ee9['destcalleridnum']:_0x506ee9[_0x6563('0x15')];return _0x589632;});}var _0x4f5609=['id','firstName',_0x6563('0x16'),_0x6563('0x13'),_0x6563('0x17'),_0x6563('0x18'),_0x6563('0x10'),_0x6563('0x19'),_0x6563('0x1a'),_0x6563('0x1b')];var _0x2a70f0=_['union'](_0x4f5609,_0xbbae72);BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x1e')]({'attributes':_0x2a70f0,'where':_0x111d38}))['then'](function(_0x293db2){_0x1ef002=_0x293db2;if(!_['isEmpty'](_0x1ef002)){if(_0x1ef002[_0x6563('0x1f')]===0x1){_0x5da960=_0x1ef002[0x0];logger[_0x6563('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x506ee9['uniqueid'],_0x129fa3['id'],_0x5da960['id']);}else{logger[_0x6563('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_[_0x6563('0x21')](_0x1ef002,'id')[_0x6563('0x22')](','));}return;}else{logger['info'](_0x6563('0x23'),_0x506ee9['uniqueid'],_0x129fa3['id']);var _0x7ea857={'ListId':_0x35936d};var _0x1590e6=_0x490a56['data4']&&_0x490a56[_0x6563('0x24')]!=='0'?_0x490a56[_0x6563('0x24')]:'phone';if(_0x33816e){logger[_0x6563('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x506ee9[_0x6563('0x20')],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_['isNil'](_0x506ee9['routeId'])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857[_0x6563('0x28')]=_0x506ee9['calleridname']&&_0x506ee9[_0x6563('0x29')]!==''?_0x506ee9['calleridname']:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9[_0x6563('0x2b')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:_0x6563('0x2a');}return BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x2d')](_0x7ea857))['then'](function(_0x9b3d86){_0x5da960=_0x9b3d86;_0x1ef002[_0x6563('0x2e')](_0x9b3d86);if(_0x5da960){logger[_0x6563('0x9')](_0x6563('0x2f'),_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_0x5da960['id']);}return;});}else{logger[_0x6563('0x9')](_0x6563('0x30'),_0x506ee9['uniqueid'],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857['firstName']=_0x506ee9[_0x6563('0x29')]&&_0x506ee9[_0x6563('0x29')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x29')]:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9['destcalleridname']!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:'Unknown';}_0x5da960=_0x7ea857;_0x1ef002[_0x6563('0x2e')](_0x7ea857);return;}}})[_0x6563('0x1d')](function(){if(_0x2946f3){emit(_0x506ee9['uniqueid'],_0x129fa3,util['format'](_0x6563('0x31'),_0x2946f3[_0x6563('0x32')]),util[_0x6563('0x33')](_0x6563('0x34'),_0x490a56['action'][_0x6563('0x35')]()),{'evt':_[_0x6563('0x36')](_0x506ee9,{'autoCreate':_0x33816e}),'contact':_0x5da960===undefined?{}:_0x5da960,'contacts':_0x1ef002['length']===0x0?undefined:_0x1ef002});}});}; \ No newline at end of file +var _0x668b=['join','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','format','user:%s','action','lodash','bluebird','util','../../../../config/environment','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','firstName','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','map'];(function(_0x1fc86a,_0x278ca2){var _0x1f667b=function(_0x57e581){while(--_0x57e581){_0x1fc86a['push'](_0x1fc86a['shift']());}};_0x1f667b(++_0x278ca2);}(_0x668b,0x140));var _0xb668=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x668b[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0xb668('0x0'));var BPromise=require(_0xb668('0x1'));var Redis=require('ioredis');var util=require(_0xb668('0x2'));var config=require(_0xb668('0x3'));var logger=require('../../../../config/logger')(_0xb668('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xb668('0x5')]=_[_0xb668('0x6')](config[_0xb668('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb668('0x7'))(new Redis(config[_0xb668('0x5')]));function emit(_0x3be92e,_0x2778e9,_0x20b749,_0x3f01bc,_0x517fc5){logger[_0xb668('0x8')](_0xb668('0x9'),_0x3be92e,_0x2778e9['id'],_0x20b749,_0x3f01bc,JSON[_0xb668('0xa')](_0x517fc5));io['to'](_0x20b749)[_0xb668('0xb')](_0x3f01bc,_0x517fc5);}exports[_0xb668('0xc')]=function(_0x3606a7,_0x45bc39,_0x3616e9,_0x567ea9){var _0x3b15a6,_0x27dbf7;var _0x27de15={};var _0x2ea5fc=Number(_0x3616e9[_0xb668('0xd')]);var _0x167057=_0x3616e9[_0xb668('0xe')]?Boolean(Number(_0x3616e9[_0xb668('0xe')])):![];var _0x3e5be0;var _0x25c5c5=![];if(!_[_0xb668('0xf')](_0x3616e9[_0xb668('0x10')])){if(_0x3616e9[_0xb668('0x10')]=='1')_0x25c5c5=!![];}if(!_0x25c5c5){if(_0x567ea9[_0xb668('0x11')]){_0x27de15['id']=_0x567ea9[_0xb668('0x11')];}}if(!_0x27de15['id']){_0x27de15[_0xb668('0x12')]=_0x2ea5fc;_0x3e5be0=_0x3616e9[_0xb668('0x13')]&&_0x3616e9[_0xb668('0x13')]!=='0'?_0x3616e9[_0xb668('0x13')][_0xb668('0x14')](','):[_0xb668('0x15')];_0x27de15[_0xb668('0x16')]=_['map'](_0x3e5be0,function(_0x13ee71){var _0x567ad7={};_0x567ad7[_0x13ee71]=_0x567ea9[_0xb668('0x17')]?_0x567ea9[_0xb668('0x18')]:_0x567ea9['calleridnum'];return _0x567ad7;});}var _0x38595d=['id',_0xb668('0x19'),'lastName',_0xb668('0x15'),'mobile',_0xb668('0x1a'),_0xb668('0x12'),_0xb668('0x1b'),_0xb668('0x1c'),'updatedAt'];var _0x2b7f96=_[_0xb668('0x1d')](_0x38595d,_0x3e5be0);BPromise[_0xb668('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x2b7f96,'where':_0x27de15}))[_0xb668('0x1f')](function(_0x1e5620){_0x27dbf7=_0x1e5620;if(!_['isEmpty'](_0x27dbf7)){if(_0x27dbf7[_0xb668('0x20')]===0x1){_0x3b15a6=_0x27dbf7[0x0];logger['info'](_0xb668('0x21'),_0x567ea9['uniqueid'],_0x45bc39['id'],_0x3b15a6['id']);}else{logger[_0xb668('0x8')](_0xb668('0x22'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_[_0xb668('0x24')](_0x27dbf7,'id')[_0xb668('0x25')](','));}return;}else{logger[_0xb668('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);var _0x10d767={'ListId':_0x2ea5fc};var _0x2ab8c2=_0x3616e9['data4']&&_0x3616e9['data4']!=='0'?_0x3616e9[_0xb668('0x26')]:_0xb668('0x15');if(_0x167057){logger[_0xb668('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])?_0x567ea9['calleridnum']:_0x567ea9['destcalleridnum'];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767['firstName']=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9[_0xb668('0x2a')]!==''?_0x567ea9[_0xb668('0x2a')]:'Unknown';}return BPromise[_0xb668('0x1e')]()[_0xb668('0x1f')](cmContactRpc[_0xb668('0x2b')](_0x10d767))[_0xb668('0x1f')](function(_0x2e40dd){_0x3b15a6=_0x2e40dd;_0x27dbf7[_0xb668('0x2c')](_0x2e40dd);if(_0x3b15a6){logger[_0xb668('0x8')](_0xb668('0x2d'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_0x3b15a6['id']);}return;});}else{logger['info'](_0xb668('0x2e'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9['routeId'])?_0x567ea9[_0xb668('0x2f')]:_0x567ea9[_0xb668('0x18')];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767[_0xb668('0x19')]=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9['destcalleridname']!==_0xb668('0x28')?_0x567ea9[_0xb668('0x2a')]:'Unknown';}_0x3b15a6=_0x10d767;_0x27dbf7[_0xb668('0x2c')](_0x10d767);return;}}})['then'](function(){if(_0x3606a7){emit(_0x567ea9['uniqueid'],_0x45bc39,util[_0xb668('0x30')](_0xb668('0x31'),_0x3606a7['name']),util[_0xb668('0x30')]('trigger:%s',_0x3616e9[_0xb668('0x32')]['toLowerCase']()),{'evt':_['merge'](_0x567ea9,{'autoCreate':_0x167057}),'contact':_0x3b15a6===undefined?{}:_0x3b15a6,'contacts':_0x27dbf7[_0xb668('0x20')]===0x0?undefined:_0x27dbf7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6eae5c7..b204b2f 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 _0xb151=['defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','prototype','info','stringify','emit','motionChannel','undefined','voice','checkTriggers','interface','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','600','data6','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','queue','routeId','urlforward','parse','render','search','channel','AllConditions','length','every','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','membername','lastevent','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb151,0x151));var _0x1b15=function(_0x203af2,_0x590f29){_0x203af2=_0x203af2-0x0;var _0x512432=_0xb151[_0x203af2];return _0x512432;};'use strict';var util=require(_0x1b15('0x0'));var _=require(_0x1b15('0x1'));var url=require(_0x1b15('0x2'));var Mustache=require(_0x1b15('0x3'));var Redis=require(_0x1b15('0x4'));var urlforward=require(_0x1b15('0x5'));var integration=require(_0x1b15('0x6'));var cmContact=require(_0x1b15('0x7'));var script=require(_0x1b15('0x8'));var config=require('../../../config/environment');var logger=require(_0x1b15('0x9'))(_0x1b15('0xa'));var ami=require('../ami');config['redis']=_[_0x1b15('0xb')](config['redis'],{'host':_0x1b15('0xc'),'port':0x18eb});var io=require(_0x1b15('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0xcf573c,_0x4e1b55){return _0xcf573c==_0x4e1b55;},'not_equals':function(_0x12d0b2,_0x1b2c47){return _0x12d0b2!=_0x1b2c47;}};var barAndWebActions=[_0x1b15('0xe'),'url',_0x1b15('0xf')];function Trigger(_0x3bf8be){this[_0x1b15('0x10')]=_0x3bf8be[_0x1b15('0x10')];this['agents']=_0x3bf8be[_0x1b15('0x11')];this[_0x1b15('0x12')]=_0x3bf8be[_0x1b15('0x12')];this[_0x1b15('0x13')]=_0x3bf8be[_0x1b15('0x13')];this['voiceExtensions']=_0x3bf8be[_0x1b15('0x14')];this[_0x1b15('0x15')]=_0x3bf8be[_0x1b15('0x15')];this[_0x1b15('0x16')]=_0x3bf8be[_0x1b15('0x16')];this[_0x1b15('0x17')]=_0x3bf8be[_0x1b15('0x17')];this[_0x1b15('0x18')]=_0x3bf8be['sugarcrmAccounts'];this[_0x1b15('0x19')]=_0x3bf8be[_0x1b15('0x19')];this['deskAccounts']=_0x3bf8be['deskAccounts'];this[_0x1b15('0x1a')]=_0x3bf8be[_0x1b15('0x1a')];this[_0x1b15('0x1b')]=_0x3bf8be[_0x1b15('0x1b')];this['dynamics365Accounts']=_0x3bf8be[_0x1b15('0x1c')];this[_0x1b15('0x1d')]=_0x3bf8be[_0x1b15('0x1d')];this[_0x1b15('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x1b15('0x17')],'freshdesk':this[_0x1b15('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x1b15('0x1f')],'vtiger':this[_0x1b15('0x1a')],'dynamics365':this[_0x1b15('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x1b15('0x1b')]};ami['on'](_0x1b15('0x20'),this[_0x1b15('0x21')]['bind'](this));ami['on'](_0x1b15('0x22'),this[_0x1b15('0x21')]['bind'](this));ami['on'](_0x1b15('0x23'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x25'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on']('custom:agentnosuchnumber',this[_0x1b15('0x21')]['bind'](this));ami['on'](_0x1b15('0x26'),this[_0x1b15('0x21')]['bind'](this));ami['on'](_0x1b15('0x27'),this['syncCustomEvent'][_0x1b15('0x24')](this));ami['on']('custom:agentcongestion',this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x28'),this['syncCustomEvent'][_0x1b15('0x24')](this));ami['on']('custom:amd',this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x29'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x2a'),this[_0x1b15('0x21')]['bind'](this));ami['on'](_0x1b15('0x2b'),this[_0x1b15('0x2c')]['bind'](this));ami['on'](_0x1b15('0x2d'),this[_0x1b15('0x2c')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x2e'),this[_0x1b15('0x2c')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x2f'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x30'),this['syncCustomEvent'][_0x1b15('0x24')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x1b15('0x24')](this));ami['on'](_0x1b15('0x31'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0x1b15('0x32'),this[_0x1b15('0x21')][_0x1b15('0x24')](this));ami['on']('custom:rejectmessage',this[_0x1b15('0x21')][_0x1b15('0x24')](this));}Trigger[_0x1b15('0x33')]['emit']=function(_0x5404fb,_0x2a9637,_0xe92fd6){logger[_0x1b15('0x34')](_0x5404fb,_0x2a9637,JSON[_0x1b15('0x35')](_0xe92fd6));io['to'](_0x5404fb)[_0x1b15('0x36')](_0x2a9637,_0xe92fd6);};Trigger[_0x1b15('0x33')][_0x1b15('0x21')]=function(_0x496136){var _0x59defb=_['clone'](_0x496136);if(typeof _0x59defb[_0x1b15('0x37')]===_0x1b15('0x38')){_0x59defb[_0x1b15('0x37')]=_0x1b15('0x39');}this[_0x1b15('0x3a')](_0x59defb);};Trigger[_0x1b15('0x33')][_0x1b15('0x2c')]=function(_0x16530c){if(this['agents'][_0x16530c[_0x1b15('0x3b')]]){this['syncCustomEvent'](_0x16530c);}};Trigger['prototype'][_0x1b15('0x3a')]=function(_0x59a87f){var _0x4b8295;for(var _0xb9693c in this[_0x1b15('0x10')]){if(this[_0x1b15('0x10')]['hasOwnProperty'](_0xb9693c)){if(this[_0x1b15('0x10')][_0xb9693c]['status']){_0x4b8295=this[_0x1b15('0x3c')](this[_0x1b15('0x10')][_0xb9693c],_0x59a87f);if(_0x4b8295){_[_0x1b15('0x3d')](_0x59a87f,_0x59a87f[_0x1b15('0x3e')]);for(var _0x82b0a2=0x0,_0x30efdd,_0x1158c7,_0xa06593;_0x82b0a20x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _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(_0x45c2f1,_0x338273){var _0x4c7c67=function(_0x5ece67){while(--_0x5ece67){_0x45c2f1['push'](_0x45c2f1['shift']());}};_0x4c7c67(++_0x338273);}(_0x3e74,0x175));var _0x43e7=function(_0x1a8572,_0x37021a){_0x1a8572=_0x1a8572-0x0;var _0x4b90db=_0x3e74[_0x1a8572];return _0x4b90db;};'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 7a85a39..fc37815 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 _0x8af2=['localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','Bearer\x20','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','username','toLowerCase','calleridnum','/systemusers(','userId','4.0','substring','lastIndexOf','enduserId','outbound','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1',']\x20Enduser\x20Created!','includes','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecalls','Subjects','callDirection','queue','odata-entityid','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis'];(function(_0x5bccdc,_0x2e66f0){var _0x133637=function(_0x487c2e){while(--_0x487c2e){_0x5bccdc['push'](_0x5bccdc['shift']());}};_0x133637(++_0x2e66f0);}(_0x8af2,0xb6));var _0x28af=function(_0x3604fd,_0x3c6297){_0x3604fd=_0x3604fd-0x0;var _0x18c989=_0x8af2[_0x3604fd];return _0x18c989;};'use strict';var _=require(_0x28af('0x0'));var BPromise=require(_0x28af('0x1'));var rp=require('request-promise');var util=require(_0x28af('0x2'));var intUtil=require(_0x28af('0x3'));var md5=require(_0x28af('0x4'));var Redis=require(_0x28af('0x5'));var logger=require(_0x28af('0x6'))(_0x28af('0x7'));var config=require(_0x28af('0x8'));config[_0x28af('0x9')]=_['defaults'](config[_0x28af('0x9')],{'host':_0x28af('0xa'),'port':0x18eb});var io=require(_0x28af('0xb'))(new Redis(config[_0x28af('0x9')]));function getAuthToken(_0xd989ea,_0x4d28eb,_0x12cf36){var _0x9ab4a3={'method':_0x28af('0xc'),'uri':_0x4d28eb,'form':{'client_id':_0xd989ea[_0x28af('0xd')],'resource':_0xd989ea['remoteUri'],'username':_0xd989ea['username'],'password':_0xd989ea['password'],'grant_type':_0x28af('0xe'),'client_secret':_0xd989ea[_0x28af('0xf')]},'json':!![]};return rp(_0x9ab4a3)[_0x28af('0x10')](function(_0x39228a){return _0x39228a[_0x28af('0x11')];})[_0x28af('0x12')](function(_0x17f86a){logger[_0x28af('0x13')]('['+[_0x12cf36[_0x28af('0x14')]()]+']\x20Wrong\x20credentials!');return _0x17f86a[_0x28af('0x15')];});}function getUser(_0x2c045e,_0x22f5c8,_0x5499ca,_0x23a973,_0x5a930a,_0x13314b){return new BPromise(function(_0x35420c,_0x3e5159){return getAuthToken(_0x22f5c8,_0x23a973,_0x13314b)['then'](function(_0x3fcb12){var _0x2f621c={'method':_0x28af('0x16'),'uri':_0x5a930a+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x28af('0x17')+_0x3fcb12,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f621c);})[_0x28af('0x10')](function(_0x1dbb09){var _0x152a71=_0x1dbb09[_0x28af('0x18')];var _0x3ca5bf=![];var _0x3bbf09=null;if(!_[_0x28af('0x19')](_0x5499ca)){if(intUtil[_0x28af('0x1a')](_0x5499ca[_0x28af('0x1b')])){_0x2c045e['userEmail']=_0x5499ca[_0x28af('0x1b')];for(_0x3bbf09=0x0;_0x3bbf09<_0x152a71[_0x28af('0x1c')];_0x3bbf09++){if(_0x152a71[_0x3bbf09][_0x28af('0x1d')]===_0x5499ca[_0x28af('0x1b')]&&!_0x152a71[_0x3bbf09][_0x28af('0x1e')]){_0x3ca5bf=!![];logger[_0x28af('0x1f')]('['+[_0x13314b['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x152a71[_0x3bbf09]['systemuserid']+'!');_0x2c045e['userId']=_0x152a71[_0x3bbf09][_0x28af('0x20')];}}}}if(!_0x3ca5bf){logger[_0x28af('0x1f')]('['+[_0x13314b[_0x28af('0x14')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2c045e['userEmail']=_0x22f5c8[_0x28af('0x21')];for(_0x3bbf09=0x0;_0x3bbf09<_0x152a71['length'];_0x3bbf09++){if(_0x152a71[_0x3bbf09][_0x28af('0x1d')]===_0x22f5c8[_0x28af('0x21')]){_0x2c045e['userId']=_0x152a71[_0x3bbf09][_0x28af('0x20')];}}}_0x35420c(_0x2c045e);})[_0x28af('0x12')](function(_0x4e8e2b){_0x3e5159(_0x4e8e2b['message']);});});}function createEndUser(_0x14114c,_0x18c785,_0xc3c1d0,_0x5ced50,_0x45c7f2,_0x1fd846){return new BPromise(function(_0xf3d7d,_0x2d7405){return getAuthToken(_0x18c785,_0xc3c1d0,_0x1fd846)[_0x28af('0x10')](function(_0x2a12d3){var _0x58fc65=_0x1fd846[_0x28af('0x22')]()==='outbound'?_0x45c7f2['destcalleridnum']:_0x45c7f2[_0x28af('0x23')];var _0x246a5e={'method':_0x28af('0xc'),'uri':_0x5ced50+'contacts','body':{'telephone1':_0x58fc65,'fullname':_0x58fc65,'firstname':_0x58fc65,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x28af('0x24')+_0x14114c[_0x28af('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2a12d3,'OData-Version':_0x28af('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x246a5e);})['then'](function(_0x2edef9){var _0x185e2c=_0x2edef9['headers']['odata-entityid'];var _0xc9c48e=_0x185e2c[_0x28af('0x27')](_0x185e2c[_0x28af('0x28')]('(')+0x1,_0x185e2c[_0x28af('0x28')](')'));_0x14114c[_0x28af('0x29')]=_0xc9c48e;_0xf3d7d(_0x14114c);})[_0x28af('0x12')](function(_0x13f886){_0x2d7405(_0x13f886[_0x28af('0x15')]);});});}function getEndUser(_0x14c550,_0x1c28e9,_0x2ff40f,_0x49b088,_0x403b52,_0x2dafbe){return new BPromise(function(_0x427916,_0x25eda5){var _0x56bad0=_0x2dafbe['toLowerCase']()===_0x28af('0x2a')?_0x403b52[_0x28af('0x2b')]:_0x403b52[_0x28af('0x23')];return getAuthToken(_0x1c28e9,_0x2ff40f,_0x2dafbe)['then'](function(_0x77e5a0){var _0x431f01={'method':_0x28af('0x16'),'uri':_0x49b088+_0x28af('0x2c')+_0x56bad0[_0x28af('0x2d')]('+',_0x28af('0x2e'))+'\x27','headers':{'Authorization':_0x28af('0x17')+_0x77e5a0,'If-None-Match':null,'OData-Version':_0x28af('0x26')},'json':!![]};return rp(_0x431f01);})['then'](function(_0x4d49e5){var _0xdd3934=null;if(_0x4d49e5){var _0x48c7f6=_0x4d49e5['value'];var _0x8fb521=![];for(_0xdd3934=0x0;_0xdd3934<_0x48c7f6[_0x28af('0x1c')];_0xdd3934++){if(_0x48c7f6[_0xdd3934][_0x28af('0x2f')]===_0x56bad0){_0x8fb521=!![];_0x14c550[_0x28af('0x29')]=_0x48c7f6[_0xdd3934]['contactid'];}}if(_0x8fb521){_0x427916(_0x14c550);}else{return createEndUser(_0x14c550,_0x1c28e9,_0x2ff40f,_0x49b088,_0x403b52,_0x2dafbe)[_0x28af('0x10')](function(_0xde3f3d){logger[_0x28af('0x1f')]('['+[_0x2dafbe[_0x28af('0x14')]()]+']\x20Enduser\x20created!',_0xde3f3d[_0x28af('0x29')]);_0x427916(_0xde3f3d);});}}else{return createEndUser(_0x14c550,_0x1c28e9,_0x2ff40f,_0x49b088,_0x403b52,_0x2dafbe)['then'](function(_0x4eb646){logger[_0x28af('0x1f')]('['+[_0x2dafbe[_0x28af('0x14')]()]+_0x28af('0x30'),_0x4eb646[_0x28af('0x29')]);_0x427916(_0x4eb646);});}});});}function getCustomFields(_0x488b7d,_0x2f30d5,_0xb396f){var _0x454472={};if(_0x488b7d[_0x28af('0x1c')]>0x0){_['forEach'](_0x488b7d,function(_0x2442e4){if(_[_0x28af('0x31')](['string',_0x28af('0x32')],_0x2442e4[_0x28af('0x33')])&&_0x2442e4[_0x28af('0x34')]&&!_0x2442e4[_0x28af('0x35')]){var _0x1fc4c9=_0x2442e4[_0x28af('0x36')]['toLowerCase']();var _0x30f0ee=_0x1fc4c9[_0x28af('0x27')](0x0,_0x1fc4c9['indexOf']('_'));var _0x5652ac=_0x1fc4c9['substring'](_0x1fc4c9[_0x28af('0x37')]('_')+0x1);if(_0x30f0ee===_0xb396f){_0x454472[_0x5652ac]=_0x2442e4[_0x28af('0x38')];}}});}return _0x454472;}function getTicket(_0x3e8d03,_0x38d398,_0x1db219,_0x2f28cd,_0x1d724f,_0x28308f,_0xeb8847){return new BPromise(function(_0x49ef1a,_0x3cc7e5){var _0x4c85b3;return getAuthToken(_0x38d398,_0x1db219,_0xeb8847)['then'](function(_0x1362cc){if(_0x28308f['ticketType']===_0x28af('0x39')){_0x4c85b3={'method':_0x28af('0xc'),'uri':_0x2f28cd+_0x28af('0x3a'),'body':Object[_0x28af('0x3b')]({},{'title':intUtil['getString'](_0x28308f['Subjects'],_0x1d724f,'\x20'),'description':intUtil[_0x28af('0x3c')](_0x28308f[_0x28af('0x3d')],_0x1d724f,'\x0a'),'customerid_contact@odata.bind':_0x28af('0x3e')+_0x3e8d03[_0x28af('0x29')]+')','ownerid@odata.bind':_0x28af('0x24')+_0x3e8d03['userId']+')','caseorigincode':'1'},getCustomFields(_0x28308f[_0x28af('0x3f')],_0x1d724f,_0x28308f[_0x28af('0x40')])),'headers':{'Authorization':_0x28af('0x17')+_0x1362cc,'OData-Version':_0x28af('0x26')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x28308f[_0x28af('0x40')]==='phonecall'){_0x4c85b3={'method':_0x28af('0xc'),'uri':_0x2f28cd+_0x28af('0x41'),'body':Object[_0x28af('0x3b')]({},{'subject':intUtil[_0x28af('0x3c')](_0x28308f[_0x28af('0x42')],_0x1d724f,'\x20'),'phonenumber':String(_0x1d724f[_0x28af('0x23')]),'description':intUtil[_0x28af('0x3c')](_0x28308f[_0x28af('0x3d')],_0x1d724f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x28af('0x3e')+_0x3e8d03[_0x28af('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x3e8d03[_0x28af('0x25')]+')','directioncode':_0x3e8d03[_0x28af('0x43')]===_0x28af('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3e8d03[_0x28af('0x25')]+')','participationtypemask':_0x3e8d03[_0x28af('0x43')]===_0x28af('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x28af('0x3e')+_0x3e8d03[_0x28af('0x29')]+')','participationtypemask':_0x3e8d03[_0x28af('0x43')]===_0x28af('0x44')?0x1:0x2}]},getCustomFields(_0x28308f[_0x28af('0x3f')],_0x1d724f,_0x28308f['ticketType'])),'headers':{'Authorization':_0x28af('0x17')+_0x1362cc,'OData-Version':_0x28af('0x26')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4c85b3);})[_0x28af('0x10')](function(_0x343ab1){var _0x4aa9a3=_0x343ab1['headers'][_0x28af('0x45')];var _0x45c39f=_0x4aa9a3[_0x28af('0x27')](_0x4aa9a3[_0x28af('0x28')]('(')+0x1,_0x4aa9a3[_0x28af('0x28')](')'));_0x3e8d03['ticketId']=_0x45c39f;_0x49ef1a(_0x3e8d03);})['catch'](function(_0x2ff904){_0x3cc7e5(_0x2ff904[_0x28af('0x15')]);});});}function emit(_0x3acf4f,_0x4fdda7,_0x4db573,_0x30b368){var _0x1547da={'uri':util['format'](_0x28af('0x46'),_0x3acf4f,_0x4db573,_0x30b368)};io['to'](util['format'](_0x28af('0x47'),_0x4fdda7))[_0x28af('0x48')](_0x28af('0x49'),_0x1547da);}exports['cs']=function(_0x1af07d,_0x275a1a,_0x452ef4,_0x540b07,_0x4eeb7a,_0x2fdd4d,_0x26370a,_0x346ca9){var _0x42e759={};_0x2fdd4d[_0x28af('0x4a')]=intUtil[_0x28af('0x4b')](_0x2fdd4d[_0x28af('0x4a')]);_0x2fdd4d[_0x28af('0x4c')]=intUtil[_0x28af('0x4b')](_0x2fdd4d[_0x28af('0x4c')]);_0x42e759[_0x28af('0x43')]=_0x346ca9===_0x28af('0x44')||_0x346ca9===_0x28af('0x4d')?_0x28af('0x44'):'outbound';var _0x40fd68=util[_0x28af('0x4e')](_0x28af('0x4f'),_0x2fdd4d[_0x28af('0x4a')]);var _0x61756c=util['format'](_0x28af('0x50'),_0x2fdd4d[_0x28af('0x51')]);var _0x12898e=util[_0x28af('0x4e')](_0x28af('0x52'),_0x2fdd4d[_0x28af('0x4c')],_0x275a1a[_0x28af('0x53')],md5(_0x275a1a['uniqueid']));if(_0x4eeb7a&&_0x4eeb7a['monitor_format']){logger['info'](_0x28af('0x54'),_0x28af('0x55'));_0x275a1a[_0x28af('0x56')]=_0x12898e;}else if(_0x26370a&&_0x26370a[_0x28af('0x57')]&&_0x26370a[_0x28af('0x57')]!=='none'){logger[_0x28af('0x1f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x275a1a[_0x28af('0x56')]=_0x12898e;}else{_0x275a1a['recordingURL']='';}return getUser(_0x42e759,_0x2fdd4d,_0x540b07,_0x61756c,_0x40fd68,_0x346ca9)[_0x28af('0x10')](function(_0x5b004f){logger[_0x28af('0x1f')]('['+_0x346ca9[_0x28af('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x5b004f[_0x28af('0x25')]);logger[_0x28af('0x1f')]('['+_0x346ca9[_0x28af('0x14')]()+_0x28af('0x58'),_0x5b004f[_0x28af('0x59')]);return getEndUser(_0x5b004f,_0x2fdd4d,_0x61756c,_0x40fd68,_0x275a1a,_0x346ca9);})[_0x28af('0x10')](function(_0x480826){logger[_0x28af('0x1f')]('['+_0x346ca9['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x480826[_0x28af('0x29')]);logger[_0x28af('0x1f')]('['+_0x346ca9[_0x28af('0x14')]()+_0x28af('0x5a'),_0x275a1a[_0x28af('0x23')]);return getTicket(_0x480826,_0x2fdd4d,_0x61756c,_0x40fd68,_0x275a1a,_0x452ef4,_0x346ca9);})[_0x28af('0x10')](function(_0x574847){logger[_0x28af('0x1f')](util[_0x28af('0x4e')]('['+_0x346ca9['toUpperCase']()+_0x28af('0x5b'),_0x452ef4[_0x28af('0x40')],_0x574847[_0x28af('0x5c')]));logger[_0x28af('0x1f')](util[_0x28af('0x4e')]('['+_0x346ca9[_0x28af('0x14')]()+_0x28af('0x5d'),_0x346ca9));if(_0x346ca9!==_0x28af('0x4d')){logger[_0x28af('0x1f')]('['+_0x346ca9[_0x28af('0x14')]()+']',_0x28af('0x5e'));emit(_0x2fdd4d['remoteUri'],_0x540b07['name'],_0x452ef4[_0x28af('0x40')],_0x574847[_0x28af('0x5c')]);}})[_0x28af('0x12')](function(_0x6ef45){logger[_0x28af('0x13')]('['+_0x346ca9[_0x28af('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x28af('0x5f')](_0x6ef45,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc316=[']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','length','internalemailaddress','isdisabled','toUpperCase','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','destcalleridnum','calleridnum','headers','substring','lastIndexOf','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','value','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','phonecalls','getString','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name'];(function(_0x27e946,_0x42f92e){var _0x57a8c2=function(_0x4dedd1){while(--_0x4dedd1){_0x27e946['push'](_0x27e946['shift']());}};_0x57a8c2(++_0x42f92e);}(_0xc316,0x19e));var _0x6c31=function(_0x1f961d,_0x14fd96){_0x1f961d=_0x1f961d-0x0;var _0x26d648=_0xc316[_0x1f961d];return _0x26d648;};'use strict';var _=require(_0x6c31('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x6c31('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x6c31('0x2'));var config=require(_0x6c31('0x3'));config[_0x6c31('0x4')]=_[_0x6c31('0x5')](config['redis'],{'host':_0x6c31('0x6'),'port':0x18eb});var io=require(_0x6c31('0x7'))(new Redis(config[_0x6c31('0x4')]));function getAuthToken(_0x3f996d,_0x3a2ac1,_0x192cf7){var _0x44316d={'method':_0x6c31('0x8'),'uri':_0x3a2ac1,'form':{'client_id':_0x3f996d[_0x6c31('0x9')],'resource':_0x3f996d[_0x6c31('0xa')],'username':_0x3f996d[_0x6c31('0xb')],'password':_0x3f996d[_0x6c31('0xc')],'grant_type':'password','client_secret':_0x3f996d[_0x6c31('0xd')]},'json':!![]};return rp(_0x44316d)[_0x6c31('0xe')](function(_0x3744e8){return _0x3744e8[_0x6c31('0xf')];})[_0x6c31('0x10')](function(_0x4f6422){logger[_0x6c31('0x11')]('['+[_0x192cf7['toUpperCase']()]+_0x6c31('0x12'));return _0x4f6422[_0x6c31('0x13')];});}function getUser(_0x5161fd,_0x48e6e2,_0x5167c4,_0x34f03a,_0x1c78ef,_0x100b6e){return new BPromise(function(_0x25d142,_0x2779ae){return getAuthToken(_0x48e6e2,_0x34f03a,_0x100b6e)['then'](function(_0x52e8c3){var _0x40d795={'method':_0x6c31('0x14'),'uri':_0x1c78ef+_0x6c31('0x15'),'headers':{'Authorization':_0x6c31('0x16')+_0x52e8c3,'OData-Version':_0x6c31('0x17')},'json':!![]};return rp(_0x40d795);})[_0x6c31('0xe')](function(_0x2ccc5c){var _0x46fcae=_0x2ccc5c['value'];var _0x45216c=![];var _0x132f89=null;if(!_[_0x6c31('0x18')](_0x5167c4)){if(intUtil[_0x6c31('0x19')](_0x5167c4[_0x6c31('0x1a')])){_0x5161fd['userEmail']=_0x5167c4[_0x6c31('0x1a')];for(_0x132f89=0x0;_0x132f89<_0x46fcae[_0x6c31('0x1b')];_0x132f89++){if(_0x46fcae[_0x132f89][_0x6c31('0x1c')]===_0x5167c4[_0x6c31('0x1a')]&&!_0x46fcae[_0x132f89][_0x6c31('0x1d')]){_0x45216c=!![];logger['info']('['+[_0x100b6e[_0x6c31('0x1e')]()]+']\x20Agent\x20found\x20'+_0x46fcae[_0x132f89][_0x6c31('0x1f')]+'!');_0x5161fd[_0x6c31('0x20')]=_0x46fcae[_0x132f89][_0x6c31('0x1f')];}}}}if(!_0x45216c){logger[_0x6c31('0x21')]('['+[_0x100b6e['toUpperCase']()]+_0x6c31('0x22'));_0x5161fd[_0x6c31('0x23')]=_0x48e6e2[_0x6c31('0xb')];for(_0x132f89=0x0;_0x132f89<_0x46fcae[_0x6c31('0x1b')];_0x132f89++){if(_0x46fcae[_0x132f89][_0x6c31('0x1c')]===_0x48e6e2[_0x6c31('0xb')]){_0x5161fd[_0x6c31('0x20')]=_0x46fcae[_0x132f89][_0x6c31('0x1f')];}}}_0x25d142(_0x5161fd);})[_0x6c31('0x10')](function(_0x29a59a){_0x2779ae(_0x29a59a['message']);});});}function createEndUser(_0x4f63c0,_0x1dca65,_0x5b7aa0,_0x51dc0f,_0x5ee2de,_0x33405f){return new BPromise(function(_0x5387c0,_0x501ef3){return getAuthToken(_0x1dca65,_0x5b7aa0,_0x33405f)[_0x6c31('0xe')](function(_0x2283d4){var _0x19237b=_0x33405f['toLowerCase']()===_0x6c31('0x24')?_0x5ee2de[_0x6c31('0x25')]:_0x5ee2de[_0x6c31('0x26')];var _0x23946d={'method':_0x6c31('0x8'),'uri':_0x51dc0f+'contacts','body':{'telephone1':_0x19237b,'fullname':_0x19237b,'firstname':_0x19237b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4f63c0[_0x6c31('0x20')]+')'},'headers':{'Authorization':_0x6c31('0x16')+_0x2283d4,'OData-Version':_0x6c31('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x23946d);})[_0x6c31('0xe')](function(_0xe984bc){var _0x3ad6a0=_0xe984bc[_0x6c31('0x27')]['odata-entityid'];var _0x305ba8=_0x3ad6a0[_0x6c31('0x28')](_0x3ad6a0[_0x6c31('0x29')]('(')+0x1,_0x3ad6a0[_0x6c31('0x29')](')'));_0x4f63c0['enduserId']=_0x305ba8;_0x5387c0(_0x4f63c0);})[_0x6c31('0x10')](function(_0x552a2d){_0x501ef3(_0x552a2d[_0x6c31('0x13')]);});});}function getEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580){return new BPromise(function(_0x4fe1a6,_0x24e378){var _0x8ba354=_0x1df580[_0x6c31('0x2a')]()===_0x6c31('0x24')?_0xb7e11b[_0x6c31('0x25')]:_0xb7e11b[_0x6c31('0x26')];return getAuthToken(_0x2db08f,_0x43576b,_0x1df580)[_0x6c31('0xe')](function(_0x20ecbd){var _0x1334c1={'method':_0x6c31('0x14'),'uri':_0x1c3942+_0x6c31('0x2b')+_0x8ba354['replace']('+',_0x6c31('0x2c'))+'\x27','headers':{'Authorization':_0x6c31('0x16')+_0x20ecbd,'If-None-Match':null,'OData-Version':_0x6c31('0x17')},'json':!![]};return rp(_0x1334c1);})[_0x6c31('0xe')](function(_0x3d8d76){var _0x378483=null;if(_0x3d8d76){var _0x916eba=_0x3d8d76[_0x6c31('0x2d')];var _0x7386fe=![];for(_0x378483=0x0;_0x378483<_0x916eba[_0x6c31('0x1b')];_0x378483++){if(_0x916eba[_0x378483]['telephone1']===_0x8ba354){_0x7386fe=!![];_0x47fa91[_0x6c31('0x2e')]=_0x916eba[_0x378483][_0x6c31('0x2f')];}}if(_0x7386fe){_0x4fe1a6(_0x47fa91);}else{return createEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580)['then'](function(_0x3c3dc8){logger[_0x6c31('0x21')]('['+[_0x1df580[_0x6c31('0x1e')]()]+_0x6c31('0x30'),_0x3c3dc8[_0x6c31('0x2e')]);_0x4fe1a6(_0x3c3dc8);});}}else{return createEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580)[_0x6c31('0xe')](function(_0x2bd65a){logger['info']('['+[_0x1df580[_0x6c31('0x1e')]()]+_0x6c31('0x31'),_0x2bd65a[_0x6c31('0x2e')]);_0x4fe1a6(_0x2bd65a);});}});});}function getCustomFields(_0x497773,_0x62b06f,_0x1980a1){var _0x160c9d={};if(_0x497773[_0x6c31('0x1b')]>0x0){_[_0x6c31('0x32')](_0x497773,function(_0x411c0a){if(_[_0x6c31('0x33')]([_0x6c31('0x34'),_0x6c31('0x35')],_0x411c0a[_0x6c31('0x36')])&&_0x411c0a[_0x6c31('0x37')]&&!_0x411c0a[_0x6c31('0x38')]){var _0x50d009=_0x411c0a[_0x6c31('0x39')][_0x6c31('0x2a')]();var _0x4045ea=_0x50d009['substring'](0x0,_0x50d009[_0x6c31('0x3a')]('_'));var _0x34149e=_0x50d009[_0x6c31('0x28')](_0x50d009[_0x6c31('0x3a')]('_')+0x1);if(_0x4045ea===_0x1980a1){_0x160c9d[_0x34149e]=_0x411c0a[_0x6c31('0x3b')];}}});}return _0x160c9d;}function getTicket(_0xb7133f,_0x1169ba,_0x1379cc,_0x4c2981,_0x30fc58,_0x39eb30,_0x30842e){return new BPromise(function(_0x281928,_0x3fd977){var _0xd29df0;return getAuthToken(_0x1169ba,_0x1379cc,_0x30842e)['then'](function(_0x1f3793){if(_0x39eb30[_0x6c31('0x3c')]===_0x6c31('0x3d')){_0xd29df0={'method':_0x6c31('0x8'),'uri':_0x4c2981+_0x6c31('0x3e'),'body':Object[_0x6c31('0x3f')]({},{'title':intUtil['getString'](_0x39eb30[_0x6c31('0x40')],_0x30fc58,'\x20'),'description':intUtil['getString'](_0x39eb30[_0x6c31('0x41')],_0x30fc58,'\x0a'),'customerid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f[_0x6c31('0x2e')]+')','ownerid@odata.bind':_0x6c31('0x43')+_0xb7133f[_0x6c31('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x39eb30[_0x6c31('0x44')],_0x30fc58,_0x39eb30[_0x6c31('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x1f3793,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39eb30['ticketType']===_0x6c31('0x45')){_0xd29df0={'method':_0x6c31('0x8'),'uri':_0x4c2981+_0x6c31('0x46'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x39eb30['Subjects'],_0x30fc58,'\x20'),'phonenumber':String(_0x30fc58[_0x6c31('0x26')]),'description':intUtil[_0x6c31('0x47')](_0x39eb30[_0x6c31('0x41')],_0x30fc58,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f[_0x6c31('0x2e')]+')','ownerid@odata.bind':_0x6c31('0x43')+_0xb7133f[_0x6c31('0x20')]+')','directioncode':_0xb7133f[_0x6c31('0x48')]===_0x6c31('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6c31('0x43')+_0xb7133f['userId']+')','participationtypemask':_0xb7133f[_0x6c31('0x48')]===_0x6c31('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f['enduserId']+')','participationtypemask':_0xb7133f['callDirection']===_0x6c31('0x49')?0x1:0x2}]},getCustomFields(_0x39eb30['Fields'],_0x30fc58,_0x39eb30[_0x6c31('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x1f3793,'OData-Version':_0x6c31('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xd29df0);})[_0x6c31('0xe')](function(_0x16aaa5){var _0x42ffce=_0x16aaa5[_0x6c31('0x27')][_0x6c31('0x4a')];var _0x3cff5e=_0x42ffce[_0x6c31('0x28')](_0x42ffce[_0x6c31('0x29')]('(')+0x1,_0x42ffce[_0x6c31('0x29')](')'));_0xb7133f[_0x6c31('0x4b')]=_0x3cff5e;_0x281928(_0xb7133f);})[_0x6c31('0x10')](function(_0x2d0fad){_0x3fd977(_0x2d0fad[_0x6c31('0x13')]);});});}function emit(_0x46890c,_0x5a756e,_0x1bae0e,_0x29f006){var _0x5d7430={'uri':util[_0x6c31('0x4c')](_0x6c31('0x4d'),_0x46890c,_0x1bae0e,_0x29f006)};io['to'](util[_0x6c31('0x4c')](_0x6c31('0x4e'),_0x5a756e))[_0x6c31('0x4f')](_0x6c31('0x50'),_0x5d7430);}exports['cs']=function(_0x3aa720,_0x3e0c7f,_0x4af760,_0x3301ba,_0x43de32,_0xe5fce3,_0x17e4f0,_0x28e39b){var _0x290532={};_0xe5fce3[_0x6c31('0xa')]=intUtil[_0x6c31('0x51')](_0xe5fce3[_0x6c31('0xa')]);_0xe5fce3[_0x6c31('0x52')]=intUtil[_0x6c31('0x51')](_0xe5fce3['serverUrl']);_0x290532[_0x6c31('0x48')]=_0x28e39b==='queue'||_0x28e39b===_0x6c31('0x53')?_0x6c31('0x49'):'outbound';var _0xc176bf=util[_0x6c31('0x4c')]('%s/api/data/v9.0/',_0xe5fce3['remoteUri']);var _0xa983da=util[_0x6c31('0x4c')](_0x6c31('0x54'),_0xe5fce3['tenantId']);var _0x199a98=util[_0x6c31('0x4c')](_0x6c31('0x55'),_0xe5fce3[_0x6c31('0x52')],_0x3e0c7f[_0x6c31('0x56')],md5(_0x3e0c7f[_0x6c31('0x56')]));if(_0x43de32&&_0x43de32[_0x6c31('0x57')]){logger['info'](_0x6c31('0x58'),_0x6c31('0x59'));_0x3e0c7f[_0x6c31('0x5a')]=_0x199a98;}else if(_0x17e4f0&&_0x17e4f0['recordingFormat']&&_0x17e4f0[_0x6c31('0x5b')]!==_0x6c31('0x5c')){logger[_0x6c31('0x21')]('[OUTBOUND]',_0x6c31('0x59'));_0x3e0c7f[_0x6c31('0x5a')]=_0x199a98;}else{_0x3e0c7f[_0x6c31('0x5a')]='';}return getUser(_0x290532,_0xe5fce3,_0x3301ba,_0xa983da,_0xc176bf,_0x28e39b)[_0x6c31('0xe')](function(_0x10a9c3){logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5d'),_0x10a9c3['userId']);logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5e'),_0x10a9c3[_0x6c31('0x23')]);return getEndUser(_0x10a9c3,_0xe5fce3,_0xa983da,_0xc176bf,_0x3e0c7f,_0x28e39b);})[_0x6c31('0xe')](function(_0x8b2394){logger['info']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5f'),_0x8b2394[_0x6c31('0x2e')]);logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x60'),_0x3e0c7f[_0x6c31('0x26')]);return getTicket(_0x8b2394,_0xe5fce3,_0xa983da,_0xc176bf,_0x3e0c7f,_0x4af760,_0x28e39b);})[_0x6c31('0xe')](function(_0x3ef94a){logger[_0x6c31('0x21')](util[_0x6c31('0x4c')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x61'),_0x4af760[_0x6c31('0x3c')],_0x3ef94a[_0x6c31('0x4b')]));logger[_0x6c31('0x21')](util['format']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x62'),_0x28e39b));if(_0x28e39b!==_0x6c31('0x53')){logger['info']('['+_0x28e39b[_0x6c31('0x1e')]()+']',_0x6c31('0x63'));emit(_0xe5fce3[_0x6c31('0xa')],_0x3301ba[_0x6c31('0x64')],_0x4af760[_0x6c31('0x3c')],_0x3ef94a['ticketId']);}})['catch'](function(_0x18df89){logger['error']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x65'),util[_0x6c31('0x66')](_0x18df89,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index bd06d3b..658ceb0 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 _0xea7c=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','unmanaged','lastevent','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','getString','Subjects','Descriptions','
','Tags','name','mapValues','custom_fields','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','apiKey','toString','base64','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','push','idField','variable','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:'];(function(_0x102a3e,_0x1f75d3){var _0x1e3e8f=function(_0x1505f3){while(--_0x1505f3){_0x102a3e['push'](_0x102a3e['shift']());}};_0x1e3e8f(++_0x1f75d3);}(_0xea7c,0x115));var _0xcea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea7c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xcea7('0x0'));var rp=require(_0xcea7('0x1'));var md5=require(_0xcea7('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xcea7('0x3'));var config=require(_0xcea7('0x4'));var logger=require(_0xcea7('0x5'))(_0xcea7('0x6'));config[_0xcea7('0x7')]=_[_0xcea7('0x8')](config[_0xcea7('0x7')],{'host':_0xcea7('0x9'),'port':0x18eb});var io=require(_0xcea7('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xcea7('0xb'),'Accept':_0xcea7('0xb')};function emit(_0x3f8ddb,_0xc22cc8,_0x33fb6b){io['to'](_0x3f8ddb)[_0xcea7('0xc')](_0xc22cc8,_0x33fb6b);}function getTicket(_0x338b1b,_0x3d338a,_0x9cbeea,_0x4cad83,_0x2d46b6){logger[_0xcea7('0xd')]('Creating\x20new\x20ticket...');var _0xabf56f=_[_0xcea7('0xe')]({'responder_id':_0x3d338a['id'],'requester_id':_0x9cbeea['id'],'name':util[_0xcea7('0xf')]('Caller\x20-\x20%s',_0x2d46b6[_0xcea7('0x10')]),'phone':_0x2d46b6['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcea7('0x11')](_0x4cad83[_0xcea7('0x12')],_0x2d46b6,'\x20'),'description':intUtil[_0xcea7('0x11')](_0x4cad83[_0xcea7('0x13')],_0x2d46b6,_0xcea7('0x14')),'tags':getTags(_0x4cad83[_0xcea7('0x15')],_0xcea7('0x16'))},getCustomFields(_0x4cad83['Fields'],_0x2d46b6));_0xabf56f['custom_fields']=_[_0xcea7('0x17')](_['keyBy'](_0xabf56f[_0xcea7('0x18')],'id'),'value');return request({'uri':util[_0xcea7('0xf')]('%s/api/v2/tickets',_0x338b1b['remoteUri']),'method':'POST','body':_0xabf56f})['then'](function(_0x4d847c){logger[_0xcea7('0xd')](_0xcea7('0x19'));return _0x4d847c;});}function getUser(_0x1e221a,_0x324048){if(intUtil[_0xcea7('0x1a')](_0x324048)){return request({'uri':util[_0xcea7('0xf')](_0xcea7('0x1b'),_0x1e221a[_0xcea7('0x1c')]),'qs':{'email':_0x324048}})[_0xcea7('0x1d')](function(_0x125a68){if(_0x125a68[_0xcea7('0x1e')]){logger[_0xcea7('0xd')](_0xcea7('0x1f'));return _['find'](_0x125a68,function(_0x36bb79){return _0x36bb79[_0xcea7('0x20')][_0xcea7('0x21')]===_0x324048;});}else{logger['info'](_0xcea7('0x22'));return request({'uri':util[_0xcea7('0xf')]('%s/api/v2/agents/me',_0x1e221a[_0xcea7('0x1c')])})[_0xcea7('0x1d')](function(_0x7ec26a){logger[_0xcea7('0xd')](_0xcea7('0x23'));return _0x7ec26a;});}});}else{logger[_0xcea7('0xd')](_0xcea7('0x24'));return request({'uri':util[_0xcea7('0xf')]('%s/api/v2/agents/me',_0x1e221a[_0xcea7('0x1c')])})[_0xcea7('0x1d')](function(_0x178a32){logger[_0xcea7('0xd')]('Admin\x20account\x20selected.');return _0x178a32;});}}function getEndUser(_0x4f17d8,_0x539e5a,_0x150f18){logger['info'](_0xcea7('0x25'),_0x150f18);return request({'uri':util[_0xcea7('0xf')](_0xcea7('0x26'),_0x4f17d8[_0xcea7('0x1c')]),'qs':{'phone':_0x150f18}})[_0xcea7('0x1d')](function(_0x421915){if(_0x421915[_0xcea7('0x1e')]){logger[_0xcea7('0xd')](_0xcea7('0x27'));return _[_0xcea7('0x28')](_0x421915,{'phone':_0x150f18});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xcea7('0x26'),_0x4f17d8[_0xcea7('0x1c')]),'method':'POST','body':{'name':_0x539e5a,'phone':_0x150f18}})[_0xcea7('0x1d')](function(_0x1726a2){logger['info']('Enduser\x20created.');return _0x1726a2;});}});}function getAuth(_0x15af18){return util[_0xcea7('0xf')]('Basic\x20%s',new Buffer(_0x15af18[_0xcea7('0x29')]+':X')[_0xcea7('0x2a')](_0xcea7('0x2b')));}function request(_0x3cb619){logger['debug'](_0xcea7('0x2c'),JSON[_0xcea7('0x2d')](_0x3cb619));return rp(_[_0xcea7('0x8')](_0x3cb619,{'method':_0xcea7('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x37f238,_0x17d25c){var _0x5e32d3=[];if(_0x37f238&&_0x37f238[_0xcea7('0x1e')]>0x0){_0x5e32d3=_['map'](_0x37f238,_0x17d25c);}return _0x5e32d3;}function getCustomFields(_0x23a3ed,_0x442217){var _0x5ed253=[];var _0x4f2045={'custom_fields':[]};if(_0x23a3ed[_0xcea7('0x1e')]>0x0){_[_0xcea7('0x2f')](_0x23a3ed,function(_0x5e5c1f){if(_[_0xcea7('0x30')]([_0xcea7('0x31'),_0xcea7('0x32')],_0x5e5c1f[_0xcea7('0x33')])&&_0x5e5c1f[_0xcea7('0x34')]&&!_0x5e5c1f[_0xcea7('0x35')]){_0x4f2045[_0x5e5c1f['nameField'][_0xcea7('0x36')]()]=_0x5e5c1f[_0xcea7('0x37')][_0xcea7('0x2a')]();}else if(_[_0xcea7('0x30')](['string',_0xcea7('0x32')],_0x5e5c1f[_0xcea7('0x33')])&&_0x5e5c1f['idField']&&_0x5e5c1f[_0xcea7('0x35')]){_0x4f2045['custom_fields'][_0xcea7('0x38')]({'id':_0x5e5c1f[_0xcea7('0x39')],'value':_0x5e5c1f['content'][_0xcea7('0x2a')]()});}else if(_0x5e5c1f[_0xcea7('0x33')]===_0xcea7('0x3a')&&_0x5e5c1f['variableName']&&_0x5e5c1f[_0xcea7('0x39')]&&_0x5e5c1f[_0xcea7('0x35')]){_0x442217[_0x5e5c1f['variableName']]&&_0x4f2045[_0xcea7('0x18')]['push']({'id':_0x5e5c1f[_0xcea7('0x39')],'value':_0x442217[_0x5e5c1f['variableName']][_0xcea7('0x2a')]()});}else if(_0x5e5c1f[_0xcea7('0x33')]===_0xcea7('0x3b')&&_0x5e5c1f[_0xcea7('0x3c')]&&_0x5e5c1f[_0xcea7('0x3c')][_0xcea7('0x16')]&&_0x5e5c1f[_0xcea7('0x39')]&&_0x5e5c1f[_0xcea7('0x35')]){_0x442217[_0x5e5c1f[_0xcea7('0x3c')][_0xcea7('0x16')][_0xcea7('0x36')]()]&&_0x4f2045[_0xcea7('0x18')][_0xcea7('0x38')]({'id':_0x5e5c1f['idField'],'value':_0x442217[_0x5e5c1f[_0xcea7('0x3c')]['name']['toLowerCase']()][_0xcea7('0x2a')]()});}});}return _0x4f2045;}exports[_0xcea7('0x3d')]=function(_0x448d52,_0x52c543,_0x42e26c,_0x55de7c,_0x12d1ca,_0x23ef72){var _0x3da05c,_0x5d971c;_0x23ef72[_0xcea7('0x1c')]=intUtil[_0xcea7('0x3e')](_0x23ef72[_0xcea7('0x1c')]);_0x23ef72[_0xcea7('0x3f')]=intUtil[_0xcea7('0x3e')](_0x23ef72[_0xcea7('0x3f')]);if(_0x12d1ca&&_0x12d1ca[_0xcea7('0x40')]){logger[_0xcea7('0xd')](_0xcea7('0x41'),_0xcea7('0x42'));_0x52c543[_0xcea7('0x43')]=util[_0xcea7('0xf')](_0xcea7('0x44'),_0x23ef72[_0xcea7('0x3f')],_0x52c543[_0xcea7('0x45')],md5(_0x52c543[_0xcea7('0x45')]));}else{_0x52c543[_0xcea7('0x43')]='';}headers['Authorization']=getAuth(_0x23ef72);return getUser(_0x23ef72,_0x55de7c[_0xcea7('0x21')])[_0xcea7('0x1d')](function(_0x2b7efb){_0x3da05c=_0x2b7efb;logger[_0xcea7('0xd')](_0xcea7('0x46'),_0x3da05c['id']);return getEndUser(_0x23ef72,_0x52c543[_0xcea7('0x10')],_0x52c543['calleridnum']);})[_0xcea7('0x1d')](function(_0x4fd62c){_0x5d971c=_0x4fd62c;logger[_0xcea7('0xd')](_0xcea7('0x47'),_0x5d971c['id']);return getTicket(_0x23ef72,_0x3da05c,_0x5d971c,_0x42e26c,_0x52c543);})[_0xcea7('0x1d')](function(_0x97723e){if(_0x97723e&&_0x97723e['id']){logger[_0xcea7('0xd')](_0xcea7('0x19'));logger['info'](_0xcea7('0x48'),_0x97723e['id']);logger[_0xcea7('0xd')]('[QUEUE]',_0xcea7('0x49'));emit(util[_0xcea7('0xf')](_0xcea7('0x4a'),_0x55de7c[_0xcea7('0x16')]),_0xcea7('0x4b'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x23ef72['remoteUri'],_0x97723e['id'])});}})[_0xcea7('0x4c')](function(_0x1d4703){logger[_0xcea7('0x4d')](_0xcea7('0x41'),JSON['stringify'](_0x1d4703));});};exports[_0xcea7('0x4e')]=function(_0x249306,_0x24e105,_0xdaf743,_0x277205,_0xf3105e,_0x153335,_0x1bd6ed){var _0x2a7d31,_0x590099;_0x153335[_0xcea7('0x1c')]=intUtil[_0xcea7('0x3e')](_0x153335[_0xcea7('0x1c')]);_0x153335['serverUrl']=intUtil[_0xcea7('0x3e')](_0x153335['serverUrl']);if(_0x1bd6ed&&_0x1bd6ed[_0xcea7('0x4f')]&&_0x1bd6ed[_0xcea7('0x4f')]!==_0xcea7('0x50')){logger['info'](_0xcea7('0x51'),'Recording\x20is\x20enabled!');_0x24e105[_0xcea7('0x43')]=util[_0xcea7('0xf')](_0xcea7('0x44'),_0x153335[_0xcea7('0x3f')],_0x24e105[_0xcea7('0x45')],md5(_0x24e105[_0xcea7('0x45')]));}headers[_0xcea7('0x52')]=getAuth(_0x153335);return getUser(_0x153335,_0x277205[_0xcea7('0x21')])[_0xcea7('0x1d')](function(_0x15e392){_0x2a7d31=_0x15e392;logger['info'](_0xcea7('0x46'),_0x2a7d31['id']);return getEndUser(_0x153335,_0x24e105[_0xcea7('0x53')],_0x24e105[_0xcea7('0x54')]);})[_0xcea7('0x1d')](function(_0xe93b5a){_0x590099=_0xe93b5a;logger[_0xcea7('0xd')]('The\x20Enduser\x20ID\x20is:',_0x590099['id']);return getTicket(_0x153335,_0x2a7d31,_0x590099,_0xdaf743,_0x24e105);})[_0xcea7('0x1d')](function(_0x2353da){if(_0x2353da&&_0x2353da['id']){logger['info']('Ticket\x20created!');logger[_0xcea7('0xd')](_0xcea7('0x48'),_0x2353da['id']);logger[_0xcea7('0xd')](_0xcea7('0x51'),_0xcea7('0x49'));emit(util[_0xcea7('0xf')](_0xcea7('0x4a'),_0x277205['name']),_0xcea7('0x4b'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x153335[_0xcea7('0x1c')],_0x2353da['id'])});}})[_0xcea7('0x4c')](function(_0x624d6){logger[_0xcea7('0x4d')](_0xcea7('0x51'),JSON[_0xcea7('0x2d')](_0x624d6));});};exports[_0xcea7('0x55')]=function(_0xc9b0c3,_0x462b0f,_0x47e97d,_0x148679,_0x35820e,_0x174160){var _0x1b2b27,_0x339e8;_0x174160[_0xcea7('0x1c')]=intUtil[_0xcea7('0x3e')](_0x174160[_0xcea7('0x1c')]);_0x174160[_0xcea7('0x3f')]=intUtil[_0xcea7('0x3e')](_0x174160[_0xcea7('0x3f')]);if(_0x35820e&&_0x35820e[_0xcea7('0x40')]){logger[_0xcea7('0xd')]('['+_0x462b0f[_0xcea7('0x56')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x462b0f[_0xcea7('0x43')]=util[_0xcea7('0xf')](_0xcea7('0x44'),_0x174160[_0xcea7('0x3f')],_0x462b0f[_0xcea7('0x45')],md5(_0x462b0f['uniqueid']));}else{_0x462b0f['recordingURL']='';}headers[_0xcea7('0x52')]=getAuth(_0x174160);return getUser(_0x174160,'')[_0xcea7('0x1d')](function(_0x390347){_0x1b2b27=_0x390347;logger[_0xcea7('0xd')](_0xcea7('0x46'),_0x1b2b27['id']);return getEndUser(_0x174160,_0x462b0f['calleridname'],_0x462b0f['calleridnum']);})[_0xcea7('0x1d')](function(_0x6d4a48){_0x339e8=_0x6d4a48;logger[_0xcea7('0xd')](_0xcea7('0x47'),_0x339e8['id']);return getTicket(_0x174160,_0x1b2b27,_0x339e8,_0x47e97d,_0x462b0f);})['then'](function(_0x34192b){if(_0x34192b){logger['info'](_0xcea7('0x19'));logger['info'](_0xcea7('0x48'),_0x34192b['id']);}})[_0xcea7('0x4c')](function(_0x38c21b){logger[_0xcea7('0x4d')]('['+_0x462b0f[_0xcea7('0x56')]['toUpperCase']()+']',JSON['stringify'](_0x38c21b));});}; \ No newline at end of file +var _0xa8e8=['type','nameField','customField','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','stripTrailingSlash','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','%s/helpdesk/tickets/%d','catch','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','info','%s/api/v2/agents','Agent\x20found!','find','contact','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','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','string','picklist'];(function(_0x59a78f,_0x170af3){var _0x88f1d5=function(_0x44f5e2){while(--_0x44f5e2){_0x59a78f['push'](_0x59a78f['shift']());}};_0x88f1d5(++_0x170af3);}(_0xa8e8,0x19b));var _0x8a8e=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xa8e8[_0x80f51a];return _0x327148;};'use strict';var _=require('lodash');var rp=require(_0x8a8e('0x0'));var md5=require(_0x8a8e('0x1'));var util=require(_0x8a8e('0x2'));var Redis=require(_0x8a8e('0x3'));var intUtil=require(_0x8a8e('0x4'));var config=require(_0x8a8e('0x5'));var logger=require(_0x8a8e('0x6'))('freshdesk');config[_0x8a8e('0x7')]=_[_0x8a8e('0x8')](config[_0x8a8e('0x7')],{'host':_0x8a8e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8a8e('0x7')]));var headers={'Content-Type':_0x8a8e('0xa'),'Accept':_0x8a8e('0xa')};function emit(_0x2ee266,_0x3c93c3,_0x33b0bd){io['to'](_0x2ee266)[_0x8a8e('0xb')](_0x3c93c3,_0x33b0bd);}function getTicket(_0x2b8a74,_0xbf4b93,_0x4068a7,_0x1e42c9,_0x442a17){logger['info'](_0x8a8e('0xc'));var _0x65e0fe=_[_0x8a8e('0xd')]({'responder_id':_0xbf4b93['id'],'requester_id':_0x4068a7['id'],'name':util[_0x8a8e('0xe')](_0x8a8e('0xf'),_0x442a17['calleridname']),'phone':_0x442a17['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8a8e('0x10')](_0x1e42c9[_0x8a8e('0x11')],_0x442a17,'\x20'),'description':intUtil[_0x8a8e('0x10')](_0x1e42c9[_0x8a8e('0x12')],_0x442a17,'
'),'tags':getTags(_0x1e42c9[_0x8a8e('0x13')],_0x8a8e('0x14'))},getCustomFields(_0x1e42c9[_0x8a8e('0x15')],_0x442a17));_0x65e0fe[_0x8a8e('0x16')]=_['mapValues'](_[_0x8a8e('0x17')](_0x65e0fe[_0x8a8e('0x16')],'id'),'value');return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x18'),_0x2b8a74[_0x8a8e('0x19')]),'method':_0x8a8e('0x1a'),'body':_0x65e0fe})[_0x8a8e('0x1b')](function(_0x3f766b){logger[_0x8a8e('0x1c')]('Ticket\x20created!');return _0x3f766b;});}function getUser(_0x1a0f99,_0x4a2014){if(intUtil['validateEmail'](_0x4a2014)){return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x1d'),_0x1a0f99[_0x8a8e('0x19')]),'qs':{'email':_0x4a2014}})[_0x8a8e('0x1b')](function(_0x13ddf0){if(_0x13ddf0['length']){logger[_0x8a8e('0x1c')](_0x8a8e('0x1e'));return _[_0x8a8e('0x1f')](_0x13ddf0,function(_0x4315ca){return _0x4315ca[_0x8a8e('0x20')]['email']===_0x4a2014;});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x21'));return request({'uri':util['format'](_0x8a8e('0x22'),_0x1a0f99['remoteUri'])})[_0x8a8e('0x1b')](function(_0x44f000){logger[_0x8a8e('0x1c')](_0x8a8e('0x23'));return _0x44f000;});}});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x24'));return request({'uri':util['format'](_0x8a8e('0x22'),_0x1a0f99['remoteUri'])})[_0x8a8e('0x1b')](function(_0x41b36e){logger[_0x8a8e('0x1c')]('Admin\x20account\x20selected.');return _0x41b36e;});}}function getEndUser(_0x9da652,_0x31138a,_0x333c1a){logger[_0x8a8e('0x1c')](_0x8a8e('0x25'),_0x333c1a);return request({'uri':util['format'](_0x8a8e('0x26'),_0x9da652[_0x8a8e('0x19')]),'qs':{'phone':_0x333c1a}})[_0x8a8e('0x1b')](function(_0x55ff7b){if(_0x55ff7b['length']){logger[_0x8a8e('0x1c')](_0x8a8e('0x27'));return _['find'](_0x55ff7b,{'phone':_0x333c1a});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x28'));return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x26'),_0x9da652['remoteUri']),'method':_0x8a8e('0x1a'),'body':{'name':_0x31138a,'phone':_0x333c1a}})[_0x8a8e('0x1b')](function(_0x1223a2){logger[_0x8a8e('0x1c')]('Enduser\x20created.');return _0x1223a2;});}});}function getAuth(_0x214849){return util[_0x8a8e('0xe')](_0x8a8e('0x29'),new Buffer(_0x214849[_0x8a8e('0x2a')]+':X')[_0x8a8e('0x2b')](_0x8a8e('0x2c')));}function request(_0x4afcb1){logger[_0x8a8e('0x2d')](_0x8a8e('0x2e'),JSON[_0x8a8e('0x2f')](_0x4afcb1));return rp(_['defaults'](_0x4afcb1,{'method':_0x8a8e('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x5002d6,_0x50bd57){var _0x5d658f=[];if(_0x5002d6&&_0x5002d6[_0x8a8e('0x31')]>0x0){_0x5d658f=_[_0x8a8e('0x32')](_0x5002d6,_0x50bd57);}return _0x5d658f;}function getCustomFields(_0x1fa730,_0x2bf4f8){var _0x41f5e3=[];var _0x28a40c={'custom_fields':[]};if(_0x1fa730['length']>0x0){_[_0x8a8e('0x33')](_0x1fa730,function(_0x242b1c){if(_['includes']([_0x8a8e('0x34'),_0x8a8e('0x35')],_0x242b1c[_0x8a8e('0x36')])&&_0x242b1c[_0x8a8e('0x37')]&&!_0x242b1c[_0x8a8e('0x38')]){_0x28a40c[_0x242b1c[_0x8a8e('0x37')]['toLowerCase']()]=_0x242b1c['content'][_0x8a8e('0x2b')]();}else if(_['includes']([_0x8a8e('0x34'),'picklist'],_0x242b1c['type'])&&_0x242b1c[_0x8a8e('0x39')]&&_0x242b1c['customField']){_0x28a40c[_0x8a8e('0x16')]['push']({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x242b1c['content']['toString']()});}else if(_0x242b1c['type']===_0x8a8e('0x3a')&&_0x242b1c[_0x8a8e('0x3b')]&&_0x242b1c[_0x8a8e('0x39')]&&_0x242b1c[_0x8a8e('0x38')]){_0x2bf4f8[_0x242b1c[_0x8a8e('0x3b')]]&&_0x28a40c[_0x8a8e('0x16')][_0x8a8e('0x3c')]({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x2bf4f8[_0x242b1c['variableName']]['toString']()});}else if(_0x242b1c['type']===_0x8a8e('0x3d')&&_0x242b1c[_0x8a8e('0x3e')]&&_0x242b1c['Variable'][_0x8a8e('0x14')]&&_0x242b1c['idField']&&_0x242b1c['customField']){_0x2bf4f8[_0x242b1c[_0x8a8e('0x3e')][_0x8a8e('0x14')]['toLowerCase']()]&&_0x28a40c[_0x8a8e('0x16')][_0x8a8e('0x3c')]({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x2bf4f8[_0x242b1c[_0x8a8e('0x3e')][_0x8a8e('0x14')][_0x8a8e('0x3f')]()]['toString']()});}});}return _0x28a40c;}exports[_0x8a8e('0x40')]=function(_0x1ccb2f,_0x40c3e8,_0x59b942,_0x48370c,_0x513ab6,_0x2da20c){var _0x412aeb,_0x37bb51;_0x2da20c[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x2da20c[_0x8a8e('0x19')]);_0x2da20c[_0x8a8e('0x41')]=intUtil['stripTrailingSlash'](_0x2da20c[_0x8a8e('0x41')]);if(_0x513ab6&&_0x513ab6['monitor_format']){logger[_0x8a8e('0x1c')]('[QUEUE]',_0x8a8e('0x42'));_0x40c3e8[_0x8a8e('0x43')]=util[_0x8a8e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2da20c['serverUrl'],_0x40c3e8[_0x8a8e('0x44')],md5(_0x40c3e8[_0x8a8e('0x44')]));}else{_0x40c3e8[_0x8a8e('0x43')]='';}headers[_0x8a8e('0x45')]=getAuth(_0x2da20c);return getUser(_0x2da20c,_0x48370c['email'])['then'](function(_0x1f92ed){_0x412aeb=_0x1f92ed;logger[_0x8a8e('0x1c')](_0x8a8e('0x46'),_0x412aeb['id']);return getEndUser(_0x2da20c,_0x40c3e8[_0x8a8e('0x47')],_0x40c3e8[_0x8a8e('0x48')]);})[_0x8a8e('0x1b')](function(_0x1828f9){_0x37bb51=_0x1828f9;logger[_0x8a8e('0x1c')](_0x8a8e('0x49'),_0x37bb51['id']);return getTicket(_0x2da20c,_0x412aeb,_0x37bb51,_0x59b942,_0x40c3e8);})[_0x8a8e('0x1b')](function(_0x5d759c){if(_0x5d759c&&_0x5d759c['id']){logger['info'](_0x8a8e('0x4a'));logger[_0x8a8e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x5d759c['id']);logger['info'](_0x8a8e('0x4b'),_0x8a8e('0x4c'));emit(util[_0x8a8e('0xe')](_0x8a8e('0x4d'),_0x48370c['name']),_0x8a8e('0x4e'),{'uri':util[_0x8a8e('0xe')]('%s/helpdesk/tickets/%d',_0x2da20c[_0x8a8e('0x19')],_0x5d759c['id'])});}})['catch'](function(_0x2b7198){logger[_0x8a8e('0x4f')](_0x8a8e('0x4b'),JSON[_0x8a8e('0x2f')](_0x2b7198));});};exports[_0x8a8e('0x50')]=function(_0xca0385,_0xc2b2a1,_0x3d470f,_0x585e50,_0x3e1167,_0x301636,_0xb2c9ed){var _0x28698d,_0x58b4d4;_0x301636[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x301636[_0x8a8e('0x19')]);_0x301636[_0x8a8e('0x41')]=intUtil[_0x8a8e('0x51')](_0x301636[_0x8a8e('0x41')]);if(_0xb2c9ed&&_0xb2c9ed['recordingFormat']&&_0xb2c9ed['recordingFormat']!==_0x8a8e('0x52')){logger[_0x8a8e('0x1c')](_0x8a8e('0x53'),'Recording\x20is\x20enabled!');_0xc2b2a1[_0x8a8e('0x43')]=util['format'](_0x8a8e('0x54'),_0x301636[_0x8a8e('0x41')],_0xc2b2a1[_0x8a8e('0x44')],md5(_0xc2b2a1['uniqueid']));}headers[_0x8a8e('0x45')]=getAuth(_0x301636);return getUser(_0x301636,_0x585e50[_0x8a8e('0x55')])['then'](function(_0x2cd604){_0x28698d=_0x2cd604;logger[_0x8a8e('0x1c')](_0x8a8e('0x46'),_0x28698d['id']);return getEndUser(_0x301636,_0xc2b2a1[_0x8a8e('0x56')],_0xc2b2a1['destcalleridnum']);})[_0x8a8e('0x1b')](function(_0x55e4ba){_0x58b4d4=_0x55e4ba;logger[_0x8a8e('0x1c')](_0x8a8e('0x49'),_0x58b4d4['id']);return getTicket(_0x301636,_0x28698d,_0x58b4d4,_0x3d470f,_0xc2b2a1);})[_0x8a8e('0x1b')](function(_0x23e66d){if(_0x23e66d&&_0x23e66d['id']){logger['info']('Ticket\x20created!');logger[_0x8a8e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x23e66d['id']);logger[_0x8a8e('0x1c')](_0x8a8e('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8a8e('0xe')](_0x8a8e('0x4d'),_0x585e50[_0x8a8e('0x14')]),_0x8a8e('0x4e'),{'uri':util[_0x8a8e('0xe')](_0x8a8e('0x57'),_0x301636['remoteUri'],_0x23e66d['id'])});}})[_0x8a8e('0x58')](function(_0x692b94){logger[_0x8a8e('0x4f')]('[OUTBOUND]',JSON[_0x8a8e('0x2f')](_0x692b94));});};exports[_0x8a8e('0x59')]=function(_0xa671b4,_0x2dbaac,_0x2d285f,_0x289d2f,_0x54cb70,_0x12a227){var _0x513fdb,_0x538e2d;_0x12a227[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x12a227[_0x8a8e('0x19')]);_0x12a227[_0x8a8e('0x41')]=intUtil['stripTrailingSlash'](_0x12a227[_0x8a8e('0x41')]);if(_0x54cb70&&_0x54cb70['monitor_format']){logger['info']('['+_0x2dbaac[_0x8a8e('0x5a')]['toUpperCase']()+']',_0x8a8e('0x42'));_0x2dbaac[_0x8a8e('0x43')]=util[_0x8a8e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12a227[_0x8a8e('0x41')],_0x2dbaac[_0x8a8e('0x44')],md5(_0x2dbaac['uniqueid']));}else{_0x2dbaac[_0x8a8e('0x43')]='';}headers[_0x8a8e('0x45')]=getAuth(_0x12a227);return getUser(_0x12a227,'')[_0x8a8e('0x1b')](function(_0x476999){_0x513fdb=_0x476999;logger['info'](_0x8a8e('0x46'),_0x513fdb['id']);return getEndUser(_0x12a227,_0x2dbaac[_0x8a8e('0x47')],_0x2dbaac[_0x8a8e('0x48')]);})['then'](function(_0x51d7e9){_0x538e2d=_0x51d7e9;logger[_0x8a8e('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x538e2d['id']);return getTicket(_0x12a227,_0x513fdb,_0x538e2d,_0x2d285f,_0x2dbaac);})[_0x8a8e('0x1b')](function(_0x1f7ea5){if(_0x1f7ea5){logger[_0x8a8e('0x1c')](_0x8a8e('0x4a'));logger[_0x8a8e('0x1c')](_0x8a8e('0x5b'),_0x1f7ea5['id']);}})[_0x8a8e('0x58')](function(_0x1b69c3){logger['error']('['+_0x2dbaac['lastevent'][_0x8a8e('0x5c')]()+']',JSON[_0x8a8e('0x2f')](_0x1b69c3));});}; \ 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 1175098..f20ebc2 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 _0xd290=['bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','GET','/api/selector/owners','headers','info','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userId','userEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment'];(function(_0x27ae2d,_0x5850e8){var _0x57cf90=function(_0x4ea833){while(--_0x4ea833){_0x27ae2d['push'](_0x27ae2d['shift']());}};_0x57cf90(++_0x5850e8);}(_0xd290,0x14c));var _0x0d29=function(_0x31336b,_0x3638db){_0x31336b=_0x31336b-0x0;var _0x483308=_0xd290[_0x31336b];return _0x483308;};'use strict';var _=require(_0x0d29('0x0'));var rp=require(_0x0d29('0x1'));var md5=require('md5');var util=require(_0x0d29('0x2'));var moment=require(_0x0d29('0x3'));var Promise=require(_0x0d29('0x4'));var Redis=require(_0x0d29('0x5'));var intUtil=require(_0x0d29('0x6'));var config=require('../../../../config/environment');var logger=require(_0x0d29('0x7'))(_0x0d29('0x8'));config[_0x0d29('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x433e90,_0xd9d1fa,_0x4d0390,_0x10b040){return new Promise(function(_0x45b1b5,_0xf152a8){var _0x663ae5=![];var _0x51a2d2={'method':_0x0d29('0xa'),'uri':_0x10b040+_0x0d29('0xb'),'json':!![]};_0x51a2d2[_0x0d29('0xc')]=_0x4d0390;logger[_0x0d29('0xd')]('Getting\x20admin\x20information');return rp(_0x51a2d2)['then'](function(_0x471568){if(_0x471568){var _0x20a4f2=_0x471568[_0x0d29('0xe')];var _0x2caaeb=null;for(_0x2caaeb=0x0;_0x2caaeb<_0x20a4f2[_0x0d29('0xf')];_0x2caaeb++){if(_0x20a4f2[_0x2caaeb][_0x0d29('0x10')]===_0x433e90[_0x0d29('0x11')]){_0x433e90[_0x0d29('0x12')]=_0x20a4f2[_0x2caaeb]['id'];_0x663ae5=!![];}}if(_0x663ae5){logger[_0x0d29('0xd')](_0x0d29('0x13'),_0x433e90[_0x0d29('0x12')]);_0x45b1b5(_0x433e90);}else{_0xf152a8({'statusCode':0x194,'message':_0x0d29('0x14')});}}else{_0xf152a8({'statusCode':0x194,'message':_0x0d29('0x14')});}})[_0x0d29('0x15')](function(_0x16b0ee){logger[_0x0d29('0x16')]('['+[_0xd9d1fa[_0x0d29('0x17')]()]+']',_0x16b0ee[_0x0d29('0x18')]);_0xf152a8(_0x16b0ee);});});}function getUser(_0x11c3b6,_0x3ff37e,_0x251f8f){return function(_0x5b56f3){return new Promise(function(_0x6af846,_0x3d6b49){var _0xe89885={'method':_0x0d29('0xa'),'uri':_0x251f8f+_0x0d29('0xb'),'json':!![]};_0xe89885['headers']=_0x3ff37e;logger[_0x0d29('0xd')](_0x0d29('0x19'));return rp(_0xe89885)[_0x0d29('0x1a')](function(_0x33765c){if(_0x33765c){var _0x4757ff=_0x33765c[_0x0d29('0xe')];var _0x55bffd=![];var _0xce40f9=null;if(_0x5b56f3[_0x0d29('0x1b')]!==null){logger[_0x0d29('0xd')](_0x0d29('0x1c'),_0x5b56f3[_0x0d29('0x1b')]);_0x5b56f3['userEmail']=_0x5b56f3[_0x0d29('0x1b')];for(_0xce40f9=0x0;_0xce40f9<_0x4757ff['length'];_0xce40f9++){if(_0x4757ff[_0xce40f9]['email']===_0x5b56f3[_0x0d29('0x1b')]){_0x55bffd=!![];_0x5b56f3[_0x0d29('0x1d')]=_0x4757ff[_0xce40f9]['id'];logger[_0x0d29('0xd')]('User\x20found:',_0x5b56f3[_0x0d29('0x1d')]);}}}if(!_0x55bffd){logger[_0x0d29('0xd')]('Admin\x20selected');_0x5b56f3[_0x0d29('0x1e')]=_0x5b56f3[_0x0d29('0x11')];_0x5b56f3[_0x0d29('0x1d')]=_0x5b56f3[_0x0d29('0x12')];_0x55bffd=!![];}if(_0x55bffd){_0x6af846(_0x5b56f3);}else{_0x3d6b49({'statusCode':0x194,'message':_0x0d29('0x14')});}}else{_0x3d6b49({'statusCode':0x194,'message':_0x0d29('0x14')});}})[_0x0d29('0x15')](function(_0x2fd0be){logger['error']('['+[_0x11c3b6[_0x0d29('0x17')]()]+']',_0x2fd0be[_0x0d29('0x18')]);_0x3d6b49(_0x2fd0be);});});};}function searchContact(_0x5e506c,_0xcd930,_0xec3fcb,_0x4109e6){return new Promise(function(_0x3ce9a9,_0x2fca31){var _0x59ef6a={'method':_0x0d29('0xa'),'headers':_0xcd930,'uri':_0x5e506c+_0x0d29('0x1f')+_0x4109e6+_0x0d29('0x20')+_0xec3fcb+_0x0d29('0x21'),'json':!![]};rp(_0x59ef6a)['then'](function(_0x1e466c){var _0x39f175=_[_0x0d29('0x22')](_0x1e466c[_0x0d29('0x23')][_0x0d29('0x23')],[_0xec3fcb,_0x4109e6]);_0x3ce9a9(_0x39f175);})[_0x0d29('0x15')](function(_0x3a2e54){_0x2fca31(_0x3a2e54);});});}function getEndUser(_0x3c4744,_0x3385ec,_0x5e85cc){return function(_0x3e9b63){return new Promise(function(_0xf04d5,_0x2e7412){logger[_0x0d29('0xd')](util[_0x0d29('0x24')](_0x0d29('0x25'),_0x3e9b63['contactNumber']));searchContact(_0x5e85cc,_0x3385ec,'mobile_number',_0x3e9b63[_0x0d29('0x26')])[_0x0d29('0x1a')](function(_0x301635){if(_0x301635){_0x3e9b63['endUserId']=_0x301635['id'];logger[_0x0d29('0xd')](_0x0d29('0x27'),_0x3e9b63[_0x0d29('0x28')]);return _0xf04d5(_0x3e9b63);}searchContact(_0x5e85cc,_0x3385ec,'work_number',_0x3e9b63[_0x0d29('0x26')])['then'](function(_0x4d4f82){if(_0x4d4f82){_0x3e9b63['endUserId']=_0x4d4f82['id'];logger[_0x0d29('0xd')](_0x0d29('0x29'),_0x3e9b63[_0x0d29('0x28')]);return _0xf04d5(_0x3e9b63);}createEndUser(_0x3e9b63,_0x3c4744,_0x3385ec,_0x5e85cc)[_0x0d29('0x1a')](function(_0x3dc797){logger[_0x0d29('0xd')](_0x0d29('0x2a'),_0x3dc797[_0x0d29('0x28')]);return _0xf04d5(_0x3dc797);});});})[_0x0d29('0x15')](function(_0x51c789){_0x2e7412(_0x51c789);});});};}function createEndUser(_0xdb2076,_0x43edf1,_0x32fa27,_0x3fefaa){return new Promise(function(_0x5d698c,_0x4d1115){var _0x1412ab=moment();var _0x5212ff={'method':_0x0d29('0x2b'),'uri':_0x3fefaa+_0x0d29('0x2c'),'body':{'contact':{'last_name':_0xdb2076[_0x0d29('0x26')],'work_number':_0xdb2076[_0x0d29('0x26')],'mobile_number':_0xdb2076[_0x0d29('0x26')],'owner_id':_0xdb2076['userId'],'created_at':_0x1412ab[_0x0d29('0x24')](_0x0d29('0x2d'))}},'json':!![]};_0x5212ff['headers']=_0x32fa27;logger[_0x0d29('0xd')](_0x0d29('0x2e'));return rp(_0x5212ff)[_0x0d29('0x1a')](function(_0x2ce651){_0xdb2076['endUserId']=_0x2ce651['contact']['id'];_0x5d698c(_0xdb2076);})[_0x0d29('0x15')](function(_0x49f7f6){logger[_0x0d29('0x16')]('['+[_0x43edf1['toUpperCase']()]+']',_0x49f7f6[_0x0d29('0x18')]);_0x4d1115(_0x49f7f6[_0x0d29('0x18')]);});});}function getTicket(_0x4875fd,_0x4636fc,_0x6eba4e,_0x477a04,_0x304a63){return function(_0x4be4c4){logger[_0x0d29('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x210b22,_0x39d736){var _0x47a4c5=moment();var _0x13479a={'method':_0x0d29('0x2b'),'uri':_0x6eba4e+_0x0d29('0x2f'),'body':{'title':intUtil['getString'](_0x477a04['Subjects'],_0x304a63,'\x20'),'description':intUtil[_0x0d29('0x30')](_0x477a04[_0x0d29('0x31')],_0x304a63,'\x0a'),'owner_id':_0x4be4c4[_0x0d29('0x1d')],'creater_id':_0x4be4c4[_0x0d29('0x12')],'targetable_id':_0x4be4c4[_0x0d29('0x28')],'targetable_type':_0x0d29('0x32'),'created_at':_0x47a4c5[_0x0d29('0x24')](_0x0d29('0x2d')),'due_date':_0x47a4c5['add'](0x1e,'m')[_0x0d29('0x24')](_0x0d29('0x2d'))},'json':!![]};_0x13479a[_0x0d29('0xc')]=_0x4636fc;return rp(_0x13479a)['then'](function(_0x5e9baa){_0x4be4c4[_0x0d29('0x33')]=_0x5e9baa[_0x0d29('0x34')]['id'];logger[_0x0d29('0xd')](_0x0d29('0x35'),_0x4be4c4['ticketId']);_0x210b22(_0x4be4c4);})['catch'](function(_0x57cc6f){logger[_0x0d29('0x16')]('['+[_0x4875fd[_0x0d29('0x17')]()]+']',_0x57cc6f[_0x0d29('0x18')]);_0x39d736(_0x57cc6f[_0x0d29('0x18')]);});});};}function emit(_0x4f9ef7,_0x5b53bf,_0x2c1cd4){var _0x5b7d29={'uri':_0x4f9ef7+_0x0d29('0x36')+_0x2c1cd4};io['to'](util[_0x0d29('0x24')](_0x0d29('0x37'),_0x5b53bf))[_0x0d29('0x38')](_0x0d29('0x39'),_0x5b7d29);}exports['cs']=function(_0x1381fd,_0x266374,_0x27f853,_0x168730,_0x1c59bc,_0x114d76,_0x467b58,_0x5281b4){var _0x6a15c3={};var _0x3e36f3={'Authorization':_0x0d29('0x3a')+_0x114d76[_0x0d29('0x3b')]};_0x114d76['remoteUri']=intUtil[_0x0d29('0x3c')](_0x114d76[_0x0d29('0x3d')]);_0x114d76[_0x0d29('0x3e')]=intUtil['stripTrailingSlash'](_0x114d76[_0x0d29('0x3e')]);var _0x5aa594=_0x114d76[_0x0d29('0x3d')];_0x6a15c3['adminEmail']=_0x114d76[_0x0d29('0x3f')];_0x6a15c3[_0x0d29('0x26')]=_0x5281b4[_0x0d29('0x40')]()===_0x0d29('0x41')?_0x266374[_0x0d29('0x42')]:_0x266374[_0x0d29('0x43')];_0x6a15c3[_0x0d29('0x44')]=_0x5281b4===_0x0d29('0x45')||_0x5281b4===_0x0d29('0x46')?'queue':_0x0d29('0x41');if(_0x168730){_0x6a15c3[_0x0d29('0x1b')]=_0x168730['email'];}var _0x26964e=util['format'](_0x0d29('0x47'),_0x114d76[_0x0d29('0x3e')],_0x266374[_0x0d29('0x48')],md5(_0x266374[_0x0d29('0x48')]));if(_0x1c59bc&&_0x1c59bc[_0x0d29('0x49')]){logger[_0x0d29('0xd')](_0x0d29('0x4a'),'Recording\x20is\x20enabled!');_0x266374[_0x0d29('0x4b')]=_0x26964e;}else if(_0x467b58&&_0x467b58[_0x0d29('0x4c')]&&_0x467b58[_0x0d29('0x4c')]!==_0x0d29('0x4d')){logger[_0x0d29('0xd')](_0x0d29('0x4e'),_0x0d29('0x4f'));_0x266374['recordingURL']=_0x26964e;}else{_0x266374[_0x0d29('0x4b')]='';}return getAdminId(_0x6a15c3,_0x5281b4,_0x3e36f3,_0x5aa594)[_0x0d29('0x1a')](getUser(_0x5281b4,_0x3e36f3,_0x5aa594))[_0x0d29('0x1a')](getEndUser(_0x5281b4,_0x3e36f3,_0x5aa594))[_0x0d29('0x1a')](getTicket(_0x5281b4,_0x3e36f3,_0x5aa594,_0x27f853,_0x266374))[_0x0d29('0x1a')](function(_0x18c97a){logger['info'](util[_0x0d29('0x24')](_0x0d29('0x50'),_0x18c97a[_0x0d29('0x33')]));if(_0x5281b4!==_0x0d29('0x46')){logger[_0x0d29('0xd')]('['+[_0x5281b4['toUpperCase']()]+']',_0x0d29('0x51'));emit(_0x5aa594,_0x168730['name'],_0x18c97a['endUserId']);}})[_0x0d29('0x15')](function(_0x219857){logger[_0x0d29('0x16')]('['+[_0x5281b4['toUpperCase']()]+_0x0d29('0x52'),util[_0x0d29('0x53')](_0x219857,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa941=['adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','info','Getting\x20admin\x20information','users','email','adminEmail'];(function(_0x42ae5a,_0xb0e4a4){var _0x20900c=function(_0x3d249b){while(--_0x3d249b){_0x42ae5a['push'](_0x42ae5a['shift']());}};_0x20900c(++_0xb0e4a4);}(_0xa941,0x18e));var _0x1a94=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa941[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var rp=require(_0x1a94('0x0'));var md5=require(_0x1a94('0x1'));var util=require(_0x1a94('0x2'));var moment=require(_0x1a94('0x3'));var Promise=require(_0x1a94('0x4'));var Redis=require(_0x1a94('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1a94('0x6'))(_0x1a94('0x7'));config[_0x1a94('0x8')]=_[_0x1a94('0x9')](config[_0x1a94('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a94('0x8')]));function getAdminId(_0x89eba7,_0x4f5585,_0x184c7c,_0x13aea3){return new Promise(function(_0x4ea048,_0x31a5c9){var _0x1ad1fd=![];var _0x17d360={'method':_0x1a94('0xa'),'uri':_0x13aea3+_0x1a94('0xb'),'json':!![]};_0x17d360['headers']=_0x184c7c;logger[_0x1a94('0xc')](_0x1a94('0xd'));return rp(_0x17d360)['then'](function(_0x3e1844){if(_0x3e1844){var _0x3a7ebe=_0x3e1844[_0x1a94('0xe')];var _0xe8e0de=null;for(_0xe8e0de=0x0;_0xe8e0de<_0x3a7ebe['length'];_0xe8e0de++){if(_0x3a7ebe[_0xe8e0de][_0x1a94('0xf')]===_0x89eba7[_0x1a94('0x10')]){_0x89eba7[_0x1a94('0x11')]=_0x3a7ebe[_0xe8e0de]['id'];_0x1ad1fd=!![];}}if(_0x1ad1fd){logger[_0x1a94('0xc')](_0x1a94('0x12'),_0x89eba7[_0x1a94('0x11')]);_0x4ea048(_0x89eba7);}else{_0x31a5c9({'statusCode':0x194,'message':_0x1a94('0x13')});}}else{_0x31a5c9({'statusCode':0x194,'message':_0x1a94('0x13')});}})['catch'](function(_0x39a2f2){logger[_0x1a94('0x14')]('['+[_0x4f5585[_0x1a94('0x15')]()]+']',_0x39a2f2[_0x1a94('0x16')]);_0x31a5c9(_0x39a2f2);});});}function getUser(_0x486151,_0x298593,_0x23b140){return function(_0x2a80be){return new Promise(function(_0x354214,_0x3276f8){var _0x3f20c8={'method':_0x1a94('0xa'),'uri':_0x23b140+_0x1a94('0xb'),'json':!![]};_0x3f20c8[_0x1a94('0x17')]=_0x298593;logger['info'](_0x1a94('0x18'));return rp(_0x3f20c8)[_0x1a94('0x19')](function(_0x1afc09){if(_0x1afc09){var _0x1dfd4a=_0x1afc09['users'];var _0x1e6434=![];var _0x1505e0=null;if(_0x2a80be[_0x1a94('0x1a')]!==null){logger[_0x1a94('0xc')](_0x1a94('0x1b'),_0x2a80be[_0x1a94('0x1a')]);_0x2a80be[_0x1a94('0x1c')]=_0x2a80be['agentEmail'];for(_0x1505e0=0x0;_0x1505e0<_0x1dfd4a[_0x1a94('0x1d')];_0x1505e0++){if(_0x1dfd4a[_0x1505e0][_0x1a94('0xf')]===_0x2a80be[_0x1a94('0x1a')]){_0x1e6434=!![];_0x2a80be[_0x1a94('0x1e')]=_0x1dfd4a[_0x1505e0]['id'];logger[_0x1a94('0xc')](_0x1a94('0x1f'),_0x2a80be[_0x1a94('0x1e')]);}}}if(!_0x1e6434){logger[_0x1a94('0xc')](_0x1a94('0x20'));_0x2a80be[_0x1a94('0x1c')]=_0x2a80be[_0x1a94('0x10')];_0x2a80be[_0x1a94('0x1e')]=_0x2a80be['adminId'];_0x1e6434=!![];}if(_0x1e6434){_0x354214(_0x2a80be);}else{_0x3276f8({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3276f8({'statusCode':0x194,'message':_0x1a94('0x13')});}})['catch'](function(_0x45815d){logger['error']('['+[_0x486151['toUpperCase']()]+']',_0x45815d[_0x1a94('0x16')]);_0x3276f8(_0x45815d);});});};}function searchContact(_0x1c36e3,_0x4753f6,_0x25e617,_0x5ceb3a){return new Promise(function(_0x144ff5,_0x1c7b25){var _0x2aba36={'method':_0x1a94('0xa'),'headers':_0x4753f6,'uri':_0x1c36e3+_0x1a94('0x21')+_0x5ceb3a+_0x1a94('0x22')+_0x25e617+_0x1a94('0x23'),'json':!![]};rp(_0x2aba36)[_0x1a94('0x19')](function(_0x12abaf){var _0x2d56de=_[_0x1a94('0x24')](_0x12abaf[_0x1a94('0x25')][_0x1a94('0x25')],[_0x25e617,_0x5ceb3a]);_0x144ff5(_0x2d56de);})[_0x1a94('0x26')](function(_0x122eaf){_0x1c7b25(_0x122eaf);});});}function getEndUser(_0x4b8b67,_0x868804,_0x17d277){return function(_0x387762){return new Promise(function(_0x592bfa,_0x396bea){logger[_0x1a94('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x387762[_0x1a94('0x27')]));searchContact(_0x17d277,_0x868804,_0x1a94('0x28'),_0x387762[_0x1a94('0x27')])[_0x1a94('0x19')](function(_0x3f6403){if(_0x3f6403){_0x387762[_0x1a94('0x29')]=_0x3f6403['id'];logger['info'](_0x1a94('0x2a'),_0x387762[_0x1a94('0x29')]);return _0x592bfa(_0x387762);}searchContact(_0x17d277,_0x868804,_0x1a94('0x2b'),_0x387762[_0x1a94('0x27')])['then'](function(_0x2f45d7){if(_0x2f45d7){_0x387762['endUserId']=_0x2f45d7['id'];logger['info'](_0x1a94('0x2c'),_0x387762[_0x1a94('0x29')]);return _0x592bfa(_0x387762);}createEndUser(_0x387762,_0x4b8b67,_0x868804,_0x17d277)[_0x1a94('0x19')](function(_0x428a9a){logger[_0x1a94('0xc')](_0x1a94('0x2d'),_0x428a9a[_0x1a94('0x29')]);return _0x592bfa(_0x428a9a);});});})[_0x1a94('0x26')](function(_0x487402){_0x396bea(_0x487402);});});};}function createEndUser(_0x12a6d9,_0x33a644,_0x24a0ee,_0xf28928){return new Promise(function(_0x3e134e,_0x35e687){var _0x159554=moment();var _0xef757={'method':'POST','uri':_0xf28928+_0x1a94('0x2e'),'body':{'contact':{'last_name':_0x12a6d9['contactNumber'],'work_number':_0x12a6d9['contactNumber'],'mobile_number':_0x12a6d9[_0x1a94('0x27')],'owner_id':_0x12a6d9['userId'],'created_at':_0x159554[_0x1a94('0x2f')](_0x1a94('0x30'))}},'json':!![]};_0xef757[_0x1a94('0x17')]=_0x24a0ee;logger['info'](_0x1a94('0x31'));return rp(_0xef757)[_0x1a94('0x19')](function(_0xda8a0c){_0x12a6d9[_0x1a94('0x29')]=_0xda8a0c[_0x1a94('0x32')]['id'];_0x3e134e(_0x12a6d9);})[_0x1a94('0x26')](function(_0x19ff23){logger[_0x1a94('0x14')]('['+[_0x33a644[_0x1a94('0x15')]()]+']',_0x19ff23[_0x1a94('0x16')]);_0x35e687(_0x19ff23['message']);});});}function getTicket(_0x444a3c,_0x44ffdd,_0x2618d9,_0xd7ede3,_0x26f1e9){return function(_0x524ecd){logger[_0x1a94('0xc')](_0x1a94('0x33'));return new Promise(function(_0x4ddc8c,_0x306753){var _0x2a14ab=moment();var _0x2ba4b5={'method':_0x1a94('0x34'),'uri':_0x2618d9+_0x1a94('0x35'),'body':{'title':intUtil[_0x1a94('0x36')](_0xd7ede3[_0x1a94('0x37')],_0x26f1e9,'\x20'),'description':intUtil['getString'](_0xd7ede3['Descriptions'],_0x26f1e9,'\x0a'),'owner_id':_0x524ecd['userId'],'creater_id':_0x524ecd[_0x1a94('0x11')],'targetable_id':_0x524ecd[_0x1a94('0x29')],'targetable_type':_0x1a94('0x38'),'created_at':_0x2a14ab[_0x1a94('0x2f')](_0x1a94('0x30')),'due_date':_0x2a14ab[_0x1a94('0x39')](0x1e,'m')[_0x1a94('0x2f')](_0x1a94('0x30'))},'json':!![]};_0x2ba4b5[_0x1a94('0x17')]=_0x44ffdd;return rp(_0x2ba4b5)[_0x1a94('0x19')](function(_0x474943){_0x524ecd[_0x1a94('0x3a')]=_0x474943['task']['id'];logger[_0x1a94('0xc')](_0x1a94('0x3b'),_0x524ecd[_0x1a94('0x3a')]);_0x4ddc8c(_0x524ecd);})[_0x1a94('0x26')](function(_0x58f27c){logger['error']('['+[_0x444a3c[_0x1a94('0x15')]()]+']',_0x58f27c[_0x1a94('0x16')]);_0x306753(_0x58f27c[_0x1a94('0x16')]);});});};}function emit(_0x57305c,_0x3fc039,_0x27ff8e){var _0x2bcce7={'uri':_0x57305c+_0x1a94('0x3c')+_0x27ff8e};io['to'](util[_0x1a94('0x2f')](_0x1a94('0x3d'),_0x3fc039))[_0x1a94('0x3e')](_0x1a94('0x3f'),_0x2bcce7);}exports['cs']=function(_0x730141,_0x4bdba7,_0x58c743,_0x10fb3c,_0x4b0e23,_0x1b6809,_0x54bdce,_0x5af64f){var _0x5a91dd={};var _0x8f5506={'Authorization':'Token\x20token='+_0x1b6809['apiKey']};_0x1b6809[_0x1a94('0x40')]=intUtil[_0x1a94('0x41')](_0x1b6809['remoteUri']);_0x1b6809[_0x1a94('0x42')]=intUtil[_0x1a94('0x41')](_0x1b6809[_0x1a94('0x42')]);var _0x184cf6=_0x1b6809[_0x1a94('0x40')];_0x5a91dd[_0x1a94('0x10')]=_0x1b6809['username'];_0x5a91dd[_0x1a94('0x27')]=_0x5af64f[_0x1a94('0x43')]()==='outbound'?_0x4bdba7[_0x1a94('0x44')]:_0x4bdba7['calleridnum'];_0x5a91dd[_0x1a94('0x45')]=_0x5af64f===_0x1a94('0x46')||_0x5af64f===_0x1a94('0x47')?_0x1a94('0x46'):'outbound';if(_0x10fb3c){_0x5a91dd[_0x1a94('0x1a')]=_0x10fb3c[_0x1a94('0xf')];}var _0x3750ed=util[_0x1a94('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b6809[_0x1a94('0x42')],_0x4bdba7[_0x1a94('0x48')],md5(_0x4bdba7[_0x1a94('0x48')]));if(_0x4b0e23&&_0x4b0e23[_0x1a94('0x49')]){logger[_0x1a94('0xc')](_0x1a94('0x4a'),_0x1a94('0x4b'));_0x4bdba7['recordingURL']=_0x3750ed;}else if(_0x54bdce&&_0x54bdce[_0x1a94('0x4c')]&&_0x54bdce['recordingFormat']!==_0x1a94('0x4d')){logger['info'](_0x1a94('0x4e'),_0x1a94('0x4b'));_0x4bdba7[_0x1a94('0x4f')]=_0x3750ed;}else{_0x4bdba7[_0x1a94('0x4f')]='';}return getAdminId(_0x5a91dd,_0x5af64f,_0x8f5506,_0x184cf6)[_0x1a94('0x19')](getUser(_0x5af64f,_0x8f5506,_0x184cf6))['then'](getEndUser(_0x5af64f,_0x8f5506,_0x184cf6))[_0x1a94('0x19')](getTicket(_0x5af64f,_0x8f5506,_0x184cf6,_0x58c743,_0x4bdba7))['then'](function(_0x5950c9){logger[_0x1a94('0xc')](util[_0x1a94('0x2f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5950c9[_0x1a94('0x3a')]));if(_0x5af64f!=='unmanaged'){logger[_0x1a94('0xc')]('['+[_0x5af64f['toUpperCase']()]+']',_0x1a94('0x50'));emit(_0x184cf6,_0x10fb3c[_0x1a94('0x51')],_0x5950c9['endUserId']);}})['catch'](function(_0x11c75e){logger[_0x1a94('0x14')]('['+[_0x5af64f[_0x1a94('0x15')]()]+_0x1a94('0x52'),util['inspect'](_0x11c75e,{'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 edf536a..c60a62f 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 _0xeede=['%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error'];(function(_0x2f4ad9,_0x14ba33){var _0x3c7827=function(_0x20abd7){while(--_0x20abd7){_0x2f4ad9['push'](_0x2f4ad9['shift']());}};_0x3c7827(++_0x14ba33);}(_0xeede,0x131));var _0xeeed=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0xeede[_0x44afa4];return _0xcad289;};'use strict';var _=require('lodash');var util=require(_0xeeed('0x0'));var zendesk=require(_0xeeed('0x1'));var salesforce=require(_0xeeed('0x2'));var sugarcrm=require(_0xeeed('0x3'));var freshdesk=require(_0xeeed('0x4'));var zoho=require(_0xeeed('0x5'));var desk=require(_0xeeed('0x6'));var vtiger=require(_0xeeed('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xeeed('0x8'));var freshsales=require(_0xeeed('0x9'));var integrations=[_0xeeed('0xa'),_0xeeed('0xb'),_0xeeed('0xc'),_0xeeed('0xd'),_0xeeed('0xe'),_0xeeed('0xf'),_0xeeed('0x10'),_0xeeed('0x11'),_0xeeed('0x12'),_0xeeed('0x13')];exports[_0xeeed('0x14')]=function(_0x2c5c66,_0x427b8d,_0x5e7b18,_0x273976,_0x5815f3,_0x3f6622){if(_0x5e7b18){if(_['includes'](integrations,_0x2c5c66[_0xeeed('0x15')]['toLowerCase']())){try{var _0x2e247f=null;var _0x37ca5b='';var _0xa2f8de=_0x5e7b18[_0x2c5c66[_0xeeed('0x15')][_0xeeed('0x16')]()];if(_0xa2f8de){var _0x59aa8a=_0xa2f8de[_0x2c5c66[_0xeeed('0x17')]];if(_0x59aa8a){var _0x222fcf=_[_0xeeed('0x18')](_0x59aa8a[_0xeeed('0x19')],{'id':parseInt(_0x2c5c66[_0xeeed('0x1a')],0xa)});if(_0x222fcf){if(_0x273976){if(_0x5815f3&&_0x427b8d[_0xeeed('0x1b')]){_0x37ca5b=_0xeeed('0x1b');}else if(_0x427b8d['routeId']){_0x37ca5b=_0xeeed('0x1c');}else{console[_0xeeed('0x1d')](_0xeeed('0x1e'),_0x427b8d);}}else{_0x37ca5b='unmanaged';}switch(_0x2c5c66[_0xeeed('0x15')][_0xeeed('0x16')]()){case _0xeeed('0xa'):zendesk[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0xb'):salesforce[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0xc'):sugarcrm[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0xd'):freshdesk[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0xe'):zoho[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0xf'):desk[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0x10'):vtiger[_0x37ca5b](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622);break;case _0xeeed('0x12'):freshsales['cs'](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622,_0x37ca5b);break;case'servicenow':servicenow['cs'](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622,_0x37ca5b);break;case _0xeeed('0x11'):dynamics365['cs'](_0x2c5c66,_0x427b8d,_0x222fcf,_0x273976,_0x5815f3,_0x59aa8a,_0x3f6622,_0x37ca5b);break;default:console[_0xeeed('0x1d')](_0xeeed('0x1f'));}}else{_0x2e247f=require(_0xeeed('0x20'))(_0x2c5c66[_0xeeed('0x15')][_0xeeed('0x16')]());_0x2e247f['error'](_0xeeed('0x21'),util[_0xeeed('0x22')](_0xeeed('0x23'),_0x2c5c66[_0xeeed('0x15')]['toLowerCase'](),_0x2c5c66['data3']));}}else{_0x2e247f=require(_0xeeed('0x20'))(_0x2c5c66[_0xeeed('0x15')]['toLowerCase']());_0x2e247f[_0xeeed('0x24')](_0xeeed('0x21'),util[_0xeeed('0x22')](_0xeeed('0x25'),_0x2c5c66[_0xeeed('0x15')][_0xeeed('0x16')](),_0x2c5c66['data2']));}}else{}}catch(_0x3c4a87){console[_0xeeed('0x24')](_0x3c4a87);}}}}; \ No newline at end of file +var _0x76b8=['vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','zendesk','freshdesk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','desk'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x76b8,0x127));var _0x876b=function(_0x245ff8,_0x2e81f8){_0x245ff8=_0x245ff8-0x0;var _0x5a4faa=_0x76b8[_0x245ff8];return _0x5a4faa;};'use strict';var _=require('lodash');var util=require(_0x876b('0x0'));var zendesk=require(_0x876b('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x876b('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x876b('0x3'));var desk=require(_0x876b('0x4'));var vtiger=require(_0x876b('0x5'));var servicenow=require(_0x876b('0x6'));var dynamics365=require(_0x876b('0x7'));var freshsales=require(_0x876b('0x8'));var integrations=['zendesk','salesforce',_0x876b('0x9'),'freshdesk','zoho',_0x876b('0xa'),_0x876b('0xb'),_0x876b('0xc'),_0x876b('0xd'),_0x876b('0xe')];exports[_0x876b('0xf')]=function(_0x32f429,_0x50b805,_0x3ed72f,_0x126e40,_0x3dc543,_0x8d59c){if(_0x3ed72f){if(_[_0x876b('0x10')](integrations,_0x32f429[_0x876b('0x11')][_0x876b('0x12')]())){try{var _0x67da0a=null;var _0x524290='';var _0x2dcbfb=_0x3ed72f[_0x32f429['data1'][_0x876b('0x12')]()];if(_0x2dcbfb){var _0x72af04=_0x2dcbfb[_0x32f429[_0x876b('0x13')]];if(_0x72af04){var _0xa63258=_[_0x876b('0x14')](_0x72af04[_0x876b('0x15')],{'id':parseInt(_0x32f429[_0x876b('0x16')],0xa)});if(_0xa63258){if(_0x126e40){if(_0x3dc543&&_0x50b805[_0x876b('0x17')]){_0x524290=_0x876b('0x17');}else if(_0x50b805['routeId']){_0x524290=_0x876b('0x18');}else{console['log'](_0x876b('0x19'),_0x50b805);}}else{_0x524290='unmanaged';}switch(_0x32f429[_0x876b('0x11')][_0x876b('0x12')]()){case _0x876b('0x1a'):zendesk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'salesforce':salesforce[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0x9'):sugarcrm[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0x1b'):freshdesk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'zoho':zoho[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0xa'):desk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0xb'):vtiger[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'freshsales':freshsales['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;case'servicenow':servicenow['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;case _0x876b('0xc'):dynamics365['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;default:console['log'](_0x876b('0x1c'));}}else{_0x67da0a=require(_0x876b('0x1d'))(_0x32f429[_0x876b('0x11')][_0x876b('0x12')]());_0x67da0a['error'](_0x876b('0x1e'),util[_0x876b('0x1f')](_0x876b('0x20'),_0x32f429[_0x876b('0x11')][_0x876b('0x12')](),_0x32f429[_0x876b('0x16')]));}}else{_0x67da0a=require('../../../../config/logger')(_0x32f429[_0x876b('0x11')]['toLowerCase']());_0x67da0a['error'](_0x876b('0x1e'),util[_0x876b('0x1f')](_0x876b('0x21'),_0x32f429[_0x876b('0x11')][_0x876b('0x12')](),_0x32f429[_0x876b('0x13')]));}}else{}}catch(_0x2aa474){console['error'](_0x2aa474);}}}}; \ 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 91d6c4d..96b512f 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 _0xd016=['defaults','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','execute','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','contact','first','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','picklist','type','content','toString','variable','variableName','idField','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:browser:url','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','redis'];(function(_0x50a448,_0x3d1a4d){var _0x5da8c6=function(_0x3310a6){while(--_0x3310a6){_0x50a448['push'](_0x50a448['shift']());}};_0x5da8c6(++_0x3d1a4d);}(_0xd016,0x1ef));var _0x6d01=function(_0x2b0875,_0x21ff12){_0x2b0875=_0x2b0875-0x0;var _0xedb8d7=_0xd016[_0x2b0875];return _0xedb8d7;};'use strict';var _=require('lodash');var rp=require(_0x6d01('0x0'));var moment=require(_0x6d01('0x1'));var BPromise=require(_0x6d01('0x2'));var md5=require(_0x6d01('0x3'));var jsforce=require(_0x6d01('0x4'));var util=require('util');var Redis=require(_0x6d01('0x5'));var intUtil=require(_0x6d01('0x6'));var config=require(_0x6d01('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0x6d01('0x8')]=_[_0x6d01('0x9')](config[_0x6d01('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x6d01('0xa'))(new Redis(config['redis']));function emit(_0x184c5b,_0x2cc09a,_0x188cd4){io['to'](_0x184c5b)[_0x6d01('0xb')](_0x2cc09a,_0x188cd4);}function getTicket(_0x477bbc,_0x6f20a8,_0x172699,_0x3ff6e9,_0x2ffca6,_0x3f6736,_0x2e08aa,_0xc0795){var _0x269234=Object[_0x6d01('0xc')]({},{'OwnerId':_0x6f20a8['id'],'Subject':intUtil['getString'](_0x3ff6e9[_0x6d01('0xd')],_0x2ffca6,'\x20'),'Description':intUtil[_0x6d01('0xe')](_0x3ff6e9[_0x6d01('0xf')],_0x2ffca6,'\x0a')},getCustomFields(_0x3f6736,_0x2ffca6));if(_0x172699){if(_0x3ff6e9[_0x6d01('0x10')]==='Task'){_0x269234[_0x6d01('0x11')]=moment[_0x6d01('0x12')]();_0x269234[_0x6d01('0x13')]=![];_0x269234[_0x6d01('0x14')]=![];if(_0x172699['endUserType']==='contact'||_0x172699[_0x6d01('0x15')]===_0x6d01('0x16')){_0x269234['WhoId']=_0x172699['id'];}else if(_0x172699['endUserType']===_0x6d01('0x17')){_0x269234['WhatId']=_0x172699['id'];}}else if(_0x3ff6e9[_0x6d01('0x10')]===_0x6d01('0x18')){if(_0x172699['endUserType']==='contact'){_0x269234[_0x6d01('0x19')]=_0x172699['id'];}else if(_0x172699[_0x6d01('0x15')]===_0x6d01('0x17')){_0x269234[_0x6d01('0x1a')]=_0x172699['id'];}else if(_0x172699[_0x6d01('0x15')]===_0x6d01('0x16')&&_0x3ff6e9[_0x6d01('0x1b')]){_0x269234[_0x3ff6e9['leadId']]=_0x172699['id'];}else{logger[_0x6d01('0x1c')](_0x6d01('0x1d'));}}}return _0x2e08aa[_0x6d01('0x1e')](_0x3ff6e9['ticketType'])[_0x6d01('0x1f')](_0x269234);}function getUser(_0x1cc0c2,_0x1da881,_0x4faf1c){if(!_[_0x6d01('0x20')](_0x1da881)&&intUtil['validateEmail'](_0x1da881)){var _0x2ff306={'Email':_0x1da881};var _0x15dfd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4faf1c[_0x6d01('0x1e')](_0x6d01('0x21'))['find'](_0x2ff306,_0x15dfd6)['execute']()['then'](function(_0x3498c){if(_0x3498c[_0x6d01('0x22')]){var _0x39af05=_[_0x6d01('0x23')](_0x3498c,function(_0xaa460b){return _0xaa460b[_0x6d01('0x24')]===_0x1da881;});if(_0x39af05){logger[_0x6d01('0x1c')](_0x6d01('0x25'),_0x1da881);return BPromise[_0x6d01('0x26')]({'id':_0x39af05['Id'],'name':_0x39af05[_0x6d01('0x27')]});}}else{logger[_0x6d01('0x1c')](_0x6d01('0x28'),_0x1da881);return _0x4faf1c[_0x6d01('0x29')]()[_0x6d01('0x2a')](function(_0x5b014d){return BPromise[_0x6d01('0x26')]({'id':_0x5b014d[_0x6d01('0x2b')],'name':_0x5b014d[_0x6d01('0x2c')]});});}});}else{logger[_0x6d01('0x1c')](_0x6d01('0x28'),_0x1da881);return _0x4faf1c[_0x6d01('0x29')]()[_0x6d01('0x2a')](function(_0x1862d1){return BPromise[_0x6d01('0x26')]({'id':_0x1862d1[_0x6d01('0x2b')],'name':_0x1862d1['display_name']});});}}function getEndUser(_0x422e86,_0x5889b8,_0x5de94d,_0x521862,_0x229557){var _0x299a7a={'$or':{'Phone':_0x521862}};var _0x54cf82={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6d01('0x26')]()[_0x6d01('0x2a')](function(){logger[_0x6d01('0x1c')](_0x6d01('0x2d'),_0x521862,_0x5889b8[_0x6d01('0x2e')]);switch(_0x5889b8['moduleSearch']){case'contact_lead':var _0x2b5293=_[_0x6d01('0x2f')](_0x299a7a);if(_0x5889b8[_0x6d01('0x30')]){var _0x9a7a1a={};_0x9a7a1a[_0x5889b8[_0x6d01('0x30')]]=_0x521862;_['merge'](_0x2b5293[_0x6d01('0x31')],_0x9a7a1a);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x32'))['find'](_0x2b5293,_0x54cf82)[_0x6d01('0x33')]()[_0x6d01('0x2a')](function(_0x21e47a){if(_0x21e47a&&_0x21e47a[_0x6d01('0x22')]){return _0x21e47a;}else{var _0x3104f4=_[_0x6d01('0x2f')](_0x299a7a);if(_0x5889b8[_0x6d01('0x34')]){var _0x1840ca={};_0x1840ca[_0x5889b8[_0x6d01('0x34')]]=_0x521862;_[_0x6d01('0x35')](_0x3104f4[_0x6d01('0x31')],_0x1840ca);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x36'))['find'](_0x3104f4,_0x54cf82);}});case'account_contact_lead':var _0x218e1a=_['cloneDeep'](_0x299a7a);if(_0x5889b8[_0x6d01('0x37')]){var _0x9a7a1a={};_0x9a7a1a[_0x5889b8[_0x6d01('0x37')]]=_0x521862;_[_0x6d01('0x35')](_0x218e1a[_0x6d01('0x31')],_0x9a7a1a);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x38'))[_0x6d01('0x23')](_0x218e1a,_0x54cf82)[_0x6d01('0x33')]()[_0x6d01('0x2a')](function(_0x34953e){if(_0x34953e&&_0x34953e[_0x6d01('0x22')]){return _0x34953e;}else{var _0x108b0d=_[_0x6d01('0x2f')](_0x299a7a);if(_0x5889b8[_0x6d01('0x30')]){var _0xe136cd={};_0xe136cd[_0x5889b8['additionalSearchContact']]=_0x521862;_['merge'](_0x108b0d['$or'],_0xe136cd);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x32'))['find'](_0x108b0d,_0x54cf82)[_0x6d01('0x2a')](function(_0x1dcce1){if(_0x1dcce1&&_0x1dcce1['length']){return _0x1dcce1;}else{var _0x1d85e7=_[_0x6d01('0x2f')](_0x299a7a);if(_0x5889b8['additionalSearchLead']){var _0x3a2e88={};_0x3a2e88[_0x5889b8['additionalSearchLead']]=_0x521862;_[_0x6d01('0x35')](_0x1d85e7[_0x6d01('0x31')],_0x3a2e88);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x36'))[_0x6d01('0x23')](_0x1d85e7,_0x54cf82);}});}});case _0x6d01('0x39'):var _0x2b5293=_[_0x6d01('0x2f')](_0x299a7a);if(_0x5889b8[_0x6d01('0x30')]){var _0x9a7a1a={};_0x9a7a1a[_0x5889b8['additionalSearchContact']]=_0x521862;_[_0x6d01('0x35')](_0x2b5293[_0x6d01('0x31')],_0x9a7a1a);}return _0x229557['sobject']('Contact')[_0x6d01('0x23')](_0x2b5293,_0x54cf82)[_0x6d01('0x33')]();case _0x6d01('0x16'):var _0x40c6ae=_['cloneDeep'](_0x299a7a);if(_0x5889b8[_0x6d01('0x34')]){var _0x9a7a1a={};_0x9a7a1a[_0x5889b8[_0x6d01('0x34')]]=_0x521862;_[_0x6d01('0x35')](_0x40c6ae[_0x6d01('0x31')],_0x9a7a1a);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x36'))[_0x6d01('0x23')](_0x40c6ae,_0x54cf82);case _0x6d01('0x17'):var _0x218e1a=_['cloneDeep'](_0x299a7a);if(_0x5889b8[_0x6d01('0x37')]){var _0x9a7a1a={};_0x9a7a1a[_0x5889b8[_0x6d01('0x37')]]=_0x521862;_[_0x6d01('0x35')](_0x218e1a[_0x6d01('0x31')],_0x9a7a1a);}return _0x229557[_0x6d01('0x1e')](_0x6d01('0x38'))[_0x6d01('0x23')](_0x218e1a,_0x54cf82);default:return null;}})[_0x6d01('0x2a')](function(_0x13ea76){if(_0x13ea76&&_0x13ea76[_0x6d01('0x22')]){var _0x1830d6=_[_0x6d01('0x3a')](_0x13ea76);if(_0x1830d6){return BPromise[_0x6d01('0x26')]({'id':_0x1830d6['Id'],'name':_0x1830d6['Name'],'phone':_0x1830d6['Phone'],'endUserType':_0x1830d6['attributes']['type'][_0x6d01('0x3b')]()});}}})[_0x6d01('0x2a')](function(_0x312a61){if(_0x312a61){logger[_0x6d01('0x1c')](_0x6d01('0x3c'),_0x312a61[_0x6d01('0x15')],_0x521862);return BPromise[_0x6d01('0x26')](_0x312a61);}else{logger[_0x6d01('0x1c')](_0x6d01('0x3d'),_0x521862);var _0x37141a={'Phone':_0x521862};if(_0x5889b8[_0x6d01('0x3e')]){if(_0x5889b8[_0x6d01('0x3e')]===_0x6d01('0x39')){logger[_0x6d01('0x1c')](_0x6d01('0x3f'),_0x521862,_0x5889b8[_0x6d01('0x3e')]);_0x37141a[_0x6d01('0x40')]=_0x5de94d!==_0x6d01('0x41')?_0x5de94d:util[_0x6d01('0x42')]('Caller\x20-\x20%s',_0x521862);}else if(_0x5889b8[_0x6d01('0x3e')]===_0x6d01('0x16')){logger[_0x6d01('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x521862,_0x5889b8[_0x6d01('0x3e')]);_0x37141a[_0x6d01('0x40')]=_0x5de94d!==''?_0x5de94d:util[_0x6d01('0x42')](_0x6d01('0x43'),_0x521862);_0x37141a[_0x6d01('0x44')]=_0x6d01('0x45');}else if(_0x5889b8[_0x6d01('0x3e')]===_0x6d01('0x17')){logger[_0x6d01('0x1c')](_0x6d01('0x3f'),_0x521862,_0x5889b8[_0x6d01('0x3e')]);_0x37141a['Name']=_0x5de94d!==_0x6d01('0x41')?_0x5de94d:util[_0x6d01('0x42')](_0x6d01('0x43'),_0x521862);}else{return null;}}return _0x229557['sobject'](_[_0x6d01('0x46')](_0x5889b8[_0x6d01('0x3e')]))[_0x6d01('0x1f')](_0x37141a)[_0x6d01('0x2a')](function(_0x3f5d1c){return BPromise[_0x6d01('0x26')]({'id':_0x3f5d1c['id'],'endUserType':_0x5889b8[_0x6d01('0x3e')]});});}});}function getCustomFields(_0x559098,_0x222ac9){var _0x38e9d2={};if(_0x559098[_0x6d01('0x22')]>0x0){_[_0x6d01('0x47')](_0x559098,function(_0x538bee){if(_['includes'](['string',_0x6d01('0x48')],_0x538bee[_0x6d01('0x49')])&&_0x538bee['idField']){_0x38e9d2[_0x538bee['idField']]=_0x538bee[_0x6d01('0x4a')][_0x6d01('0x4b')]();}else if(_0x538bee['type']===_0x6d01('0x4c')&&_0x538bee[_0x6d01('0x4d')]&&_0x538bee[_0x6d01('0x4e')]){_0x222ac9[_0x538bee[_0x6d01('0x4d')]]&&(_0x38e9d2[_0x538bee[_0x6d01('0x4e')]]=_0x222ac9[_0x538bee[_0x6d01('0x4d')]][_0x6d01('0x4b')]());}else if(_0x538bee[_0x6d01('0x49')]===_0x6d01('0x4f')&&_0x538bee[_0x6d01('0x50')]&&_0x538bee[_0x6d01('0x50')]['name']&&_0x538bee[_0x6d01('0x4e')]){_0x222ac9[_0x538bee[_0x6d01('0x50')][_0x6d01('0x51')][_0x6d01('0x3b')]()]&&(_0x38e9d2[_0x538bee[_0x6d01('0x4e')]]=_0x222ac9[_0x538bee[_0x6d01('0x50')]['name'][_0x6d01('0x3b')]()][_0x6d01('0x4b')]());}});}return _0x38e9d2;}function getConnection(_0x4812fd){var _0xd3fa5=_0x4812fd[_0x6d01('0x52')][_0x6d01('0x53')](_0x4812fd[_0x6d01('0x54')]);var _0xeec161=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4812fd[_0x6d01('0x55')]||_0x6d01('0x56'),'clientId':_0x4812fd['clientId'],'clientSecret':_0x4812fd[_0x6d01('0x57')]}});return _0xeec161[_0x6d01('0x58')](_0x4812fd[_0x6d01('0x59')],_0xd3fa5)[_0x6d01('0x2a')](function(){logger['info'](_0x6d01('0x5a'));return _0xeec161;});}exports['queue']=function(_0xaef17d,_0xa5d978,_0x1cc51f,_0x12e3e6,_0xc083c7,_0x3217a9){var _0x4f9b49,_0x501b03,_0x342f0c,_0x4dbdf1;_0x3217a9[_0x6d01('0x5b')]=intUtil[_0x6d01('0x5c')](_0x3217a9['serverUrl']);_0x3217a9['remoteUri']=intUtil['stripTrailingSlash'](_0x3217a9[_0x6d01('0x55')]);if(_0xc083c7&&_0xc083c7[_0x6d01('0x5d')]){logger[_0x6d01('0x1c')](_0x6d01('0x5e'),'Recording\x20is\x20enabled!');_0xa5d978[_0x6d01('0x5f')]=util[_0x6d01('0x42')](_0x6d01('0x60'),_0x3217a9[_0x6d01('0x5b')],_0xa5d978['uniqueid'],md5(_0xa5d978['uniqueid']));}else{_0xa5d978[_0x6d01('0x5f')]='';}return getConnection(_0x3217a9)[_0x6d01('0x2a')](function(_0x491666){_0x4dbdf1=_0x491666;return getUser(_0x3217a9,_0x12e3e6[_0x6d01('0x61')],_0x4dbdf1);})['then'](function(_0x383fe4){_0x4f9b49=_0x383fe4;return getEndUser(_0x3217a9,_0x1cc51f,_0xa5d978[_0x6d01('0x62')],_0xa5d978[_0x6d01('0x63')],_0x4dbdf1);})[_0x6d01('0x2a')](function(_0x572d8f){_0x501b03=_0x572d8f;return getTicket(_0x3217a9,_0x4f9b49,_0x501b03,_0x1cc51f,_0xa5d978,_0x1cc51f[_0x6d01('0x64')],_0x4dbdf1,'queue');})['then'](function(_0x5e2d9a){_0x342f0c=_0x5e2d9a;logger[_0x6d01('0x1c')](_0x6d01('0x65'),_0x342f0c['id']);logger[_0x6d01('0x1c')](_0x6d01('0x66'),_0x342f0c['id'],_0x12e3e6[_0x6d01('0x51')],_0x3217a9[_0x6d01('0x49')]);switch(_0x3217a9[_0x6d01('0x49')]){case _0x6d01('0x67'):emit(util[_0x6d01('0x42')]('user:%s',_0x12e3e6[_0x6d01('0x51')]),_0x6d01('0x68'),{'recordId':_0x342f0c['id']});break;case _0x6d01('0x69'):emit(util[_0x6d01('0x42')](_0x6d01('0x6a'),_0x12e3e6['name']),'trigger:browser:url',{'uri':util[_0x6d01('0x42')]('%s/%s/e',_0x4dbdf1[_0x6d01('0x6b')],_0x342f0c['id'])});break;default:logger[_0x6d01('0x6c')](_0x6d01('0x6d'));}})['catch'](function(_0x523fa8){logger['error'](_0x6d01('0x5e'),_0x523fa8);});};exports[_0x6d01('0x6e')]=function(_0x1e401b,_0x489b89,_0x1a8e5e,_0x4a4caf,_0x49db24,_0x4fbfb9,_0x58f296){var _0x3f21e2,_0x2b4dc8,_0x355932,_0x21f2aa;_0x4fbfb9[_0x6d01('0x5b')]=intUtil['stripTrailingSlash'](_0x4fbfb9['serverUrl']);_0x4fbfb9[_0x6d01('0x55')]=intUtil[_0x6d01('0x5c')](_0x4fbfb9[_0x6d01('0x55')]);if(_0x58f296&&_0x58f296['recordingFormat']&&_0x58f296[_0x6d01('0x6f')]!==_0x6d01('0x70')){logger[_0x6d01('0x1c')](_0x6d01('0x71'),_0x6d01('0x72'));_0x489b89[_0x6d01('0x5f')]=util['format'](_0x6d01('0x60'),_0x4fbfb9[_0x6d01('0x5b')],_0x489b89[_0x6d01('0x73')],md5(_0x489b89[_0x6d01('0x73')]));}return getConnection(_0x4fbfb9)[_0x6d01('0x2a')](function(_0x4cc9ef){_0x21f2aa=_0x4cc9ef;return getUser(_0x4fbfb9,_0x4a4caf['email'],_0x21f2aa);})[_0x6d01('0x2a')](function(_0x485362){_0x3f21e2=_0x485362;return getEndUser(_0x4fbfb9,_0x1a8e5e,_0x489b89[_0x6d01('0x74')],_0x489b89[_0x6d01('0x75')],_0x21f2aa);})[_0x6d01('0x2a')](function(_0x242679){_0x2b4dc8=_0x242679;return getTicket(_0x4fbfb9,_0x3f21e2,_0x2b4dc8,_0x1a8e5e,_0x489b89,_0x1a8e5e[_0x6d01('0x64')],_0x21f2aa,_0x6d01('0x6e'));})[_0x6d01('0x2a')](function(_0x2d14f2){_0x355932=_0x2d14f2;logger['info'](_0x6d01('0x76'),_0x355932['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x355932['id'],_0x4a4caf['name'],_0x4fbfb9[_0x6d01('0x49')]);switch(_0x4fbfb9[_0x6d01('0x49')]){case'integrationTab':emit(util[_0x6d01('0x42')](_0x6d01('0x6a'),_0x4a4caf[_0x6d01('0x51')]),'trigger:salesforce:display',{'recordId':_0x355932['id']});break;case'newTab':emit(util[_0x6d01('0x42')](_0x6d01('0x6a'),_0x4a4caf['name']),_0x6d01('0x77'),{'uri':util['format'](_0x6d01('0x78'),_0x21f2aa[_0x6d01('0x6b')],_0x355932['id'])});break;default:logger[_0x6d01('0x6c')](_0x6d01('0x71'),_0x6d01('0x79'));}})[_0x6d01('0x7a')](function(_0x53a7ca){logger[_0x6d01('0x6c')](_0x6d01('0x71'),_0x53a7ca);});};exports['unmanaged']=function(_0x40eb1e,_0x550dd7,_0x3d0d89,_0x102997,_0x52d3d9,_0x599dd7){var _0x59a05b,_0x19b4bc,_0x25b933,_0x1a2452;_0x599dd7['serverUrl']=intUtil[_0x6d01('0x5c')](_0x599dd7[_0x6d01('0x5b')]);_0x599dd7[_0x6d01('0x55')]=intUtil[_0x6d01('0x5c')](_0x599dd7[_0x6d01('0x55')]);if(_0x52d3d9&&_0x52d3d9['monitor_format']){logger[_0x6d01('0x1c')]('['+_0x550dd7[_0x6d01('0x7b')][_0x6d01('0x7c')]()+']',_0x6d01('0x72'));_0x550dd7['recordingURL']=util[_0x6d01('0x42')](_0x6d01('0x60'),_0x599dd7['serverUrl'],_0x550dd7[_0x6d01('0x73')],md5(_0x550dd7['uniqueid']));}else{_0x550dd7['recordingURL']='';}return getConnection(_0x599dd7)[_0x6d01('0x2a')](function(_0x2d1bf7){_0x1a2452=_0x2d1bf7;if(!_[_0x6d01('0x20')](_0x102997)){return getUser(_0x599dd7,_0x102997[_0x6d01('0x51')],_0x1a2452);}else{return getUser(_0x599dd7,null,_0x1a2452);}})[_0x6d01('0x2a')](function(_0x32e606){_0x59a05b=_0x32e606;return getEndUser(_0x599dd7,_0x3d0d89,_0x550dd7[_0x6d01('0x62')],_0x550dd7[_0x6d01('0x63')],_0x1a2452);})[_0x6d01('0x2a')](function(_0x325b0d){_0x19b4bc=_0x325b0d;return getTicket(_0x599dd7,_0x59a05b,_0x19b4bc,_0x3d0d89,_0x550dd7,_0x3d0d89[_0x6d01('0x64')],_0x1a2452);})[_0x6d01('0x2a')](function(_0x168a85){_0x25b933=_0x168a85;logger[_0x6d01('0x1c')]('['+_0x550dd7[_0x6d01('0x7b')][_0x6d01('0x7c')]()+_0x6d01('0x7d'),_0x25b933['id']);logger[_0x6d01('0x1c')]('['+_0x550dd7[_0x6d01('0x7b')][_0x6d01('0x7c')]()+']\x20Integration\x20account\x20type\x20%s.',_0x599dd7[_0x6d01('0x49')]);})[_0x6d01('0x7a')](function(_0x937f18){logger[_0x6d01('0x6c')]('['+_0x550dd7[_0x6d01('0x7b')][_0x6d01('0x7c')]()+']',_0x937f18);});}; \ No newline at end of file +var _0x60de=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Task','ActivityDate','IsRecurrence','endUserType','lead','WhoId','WhatId','ticketType','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','variableName','toString','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl'];(function(_0x5ceb9c,_0xe04ef9){var _0x4ac02f=function(_0x28abf9){while(--_0x28abf9){_0x5ceb9c['push'](_0x5ceb9c['shift']());}};_0x4ac02f(++_0xe04ef9);}(_0x60de,0x19b));var _0xe60d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x60de[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe60d('0x0'));var rp=require(_0xe60d('0x1'));var moment=require(_0xe60d('0x2'));var BPromise=require('bluebird');var md5=require(_0xe60d('0x3'));var jsforce=require(_0xe60d('0x4'));var util=require('util');var Redis=require(_0xe60d('0x5'));var intUtil=require(_0xe60d('0x6'));var config=require(_0xe60d('0x7'));var logger=require(_0xe60d('0x8'))(_0xe60d('0x9'));config[_0xe60d('0xa')]=_[_0xe60d('0xb')](config[_0xe60d('0xa')],{'host':_0xe60d('0xc'),'port':0x18eb});var io=require(_0xe60d('0xd'))(new Redis(config[_0xe60d('0xa')]));function emit(_0x355ab3,_0x16ff6a,_0x3d2a6f){io['to'](_0x355ab3)[_0xe60d('0xe')](_0x16ff6a,_0x3d2a6f);}function getTicket(_0x34d42e,_0x239743,_0x5e0ba0,_0x295a0e,_0x3e58e3,_0x4103df,_0x4d196a,_0x12f9d7){var _0x3e3de3=Object[_0xe60d('0xf')]({},{'OwnerId':_0x239743['id'],'Subject':intUtil[_0xe60d('0x10')](_0x295a0e[_0xe60d('0x11')],_0x3e58e3,'\x20'),'Description':intUtil[_0xe60d('0x10')](_0x295a0e['Descriptions'],_0x3e58e3,'\x0a')},getCustomFields(_0x4103df,_0x3e58e3));if(_0x5e0ba0){if(_0x295a0e['ticketType']===_0xe60d('0x12')){_0x3e3de3[_0xe60d('0x13')]=moment['utc']();_0x3e3de3['IsReminderSet']=![];_0x3e3de3[_0xe60d('0x14')]=![];if(_0x5e0ba0[_0xe60d('0x15')]==='contact'||_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x16')){_0x3e3de3[_0xe60d('0x17')]=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]==='account'){_0x3e3de3[_0xe60d('0x18')]=_0x5e0ba0['id'];}}else if(_0x295a0e[_0xe60d('0x19')]==='Case'){if(_0x5e0ba0[_0xe60d('0x15')]==='contact'){_0x3e3de3['ContactId']=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x1a')){_0x3e3de3['AccountId']=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x16')&&_0x295a0e[_0xe60d('0x1b')]){_0x3e3de3[_0x295a0e[_0xe60d('0x1b')]]=_0x5e0ba0['id'];}else{logger[_0xe60d('0x1c')](_0xe60d('0x1d'));}}}return _0x4d196a[_0xe60d('0x1e')](_0x295a0e[_0xe60d('0x19')])['create'](_0x3e3de3);}function getUser(_0x2224b4,_0x1136c8,_0x4da842){if(!_[_0xe60d('0x1f')](_0x1136c8)&&intUtil[_0xe60d('0x20')](_0x1136c8)){var _0x56cfca={'Email':_0x1136c8};var _0x576a20={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4da842['sobject'](_0xe60d('0x21'))[_0xe60d('0x22')](_0x56cfca,_0x576a20)[_0xe60d('0x23')]()[_0xe60d('0x24')](function(_0x5d887c){if(_0x5d887c[_0xe60d('0x25')]){var _0x5ada00=_[_0xe60d('0x22')](_0x5d887c,function(_0x5f252f){return _0x5f252f[_0xe60d('0x26')]===_0x1136c8;});if(_0x5ada00){logger[_0xe60d('0x1c')]('Agent\x20%s\x20found.',_0x1136c8);return BPromise[_0xe60d('0x27')]({'id':_0x5ada00['Id'],'name':_0x5ada00[_0xe60d('0x28')]});}}else{logger[_0xe60d('0x1c')](_0xe60d('0x29'),_0x1136c8);return _0x4da842['identity']()['then'](function(_0x293c6d){return BPromise[_0xe60d('0x27')]({'id':_0x293c6d[_0xe60d('0x2a')],'name':_0x293c6d['display_name']});});}});}else{logger['info'](_0xe60d('0x29'),_0x1136c8);return _0x4da842[_0xe60d('0x2b')]()['then'](function(_0x280e62){return BPromise[_0xe60d('0x27')]({'id':_0x280e62['user_id'],'name':_0x280e62[_0xe60d('0x2c')]});});}}function getEndUser(_0x2fb81a,_0x3164ac,_0x3beeb4,_0x33cfc8,_0x39736b){var _0x1ba264={'$or':{'Phone':_0x33cfc8}};var _0x113d11={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe60d('0x27')]()[_0xe60d('0x24')](function(){logger[_0xe60d('0x1c')](_0xe60d('0x2d'),_0x33cfc8,_0x3164ac['moduleSearch']);switch(_0x3164ac['moduleSearch']){case _0xe60d('0x2e'):var _0x202db6=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x30')]){var _0x1484e8={};_0x1484e8[_0x3164ac['additionalSearchContact']]=_0x33cfc8;_[_0xe60d('0x31')](_0x202db6[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x33'))[_0xe60d('0x22')](_0x202db6,_0x113d11)[_0xe60d('0x23')]()[_0xe60d('0x24')](function(_0x477827){if(_0x477827&&_0x477827['length']){return _0x477827;}else{var _0x33b4f5=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x37357c={};_0x37357c[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x33b4f5[_0xe60d('0x32')],_0x37357c);}return _0x39736b[_0xe60d('0x1e')]('Lead')['find'](_0x33b4f5,_0x113d11);}});case _0xe60d('0x35'):var _0x5aaf1d=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchAccount']){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x36')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x5aaf1d['$or'],_0x1484e8);}return _0x39736b['sobject'](_0xe60d('0x37'))[_0xe60d('0x22')](_0x5aaf1d,_0x113d11)['execute']()[_0xe60d('0x24')](function(_0x16cba6){if(_0x16cba6&&_0x16cba6[_0xe60d('0x25')]){return _0x16cba6;}else{var _0x191728=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x30')]){var _0x46e0a3={};_0x46e0a3[_0x3164ac[_0xe60d('0x30')]]=_0x33cfc8;_['merge'](_0x191728[_0xe60d('0x32')],_0x46e0a3);}return _0x39736b[_0xe60d('0x1e')]('Contact')['find'](_0x191728,_0x113d11)['then'](function(_0x49c22a){if(_0x49c22a&&_0x49c22a[_0xe60d('0x25')]){return _0x49c22a;}else{var _0x5b913a=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x48879c={};_0x48879c[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x5b913a[_0xe60d('0x32')],_0x48879c);}return _0x39736b['sobject'](_0xe60d('0x38'))[_0xe60d('0x22')](_0x5b913a,_0x113d11);}});}});case'contact':var _0x202db6=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchContact']){var _0x1484e8={};_0x1484e8[_0x3164ac['additionalSearchContact']]=_0x33cfc8;_[_0xe60d('0x31')](_0x202db6[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x33'))[_0xe60d('0x22')](_0x202db6,_0x113d11)[_0xe60d('0x23')]();case _0xe60d('0x16'):var _0x3ebff4=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x3ebff4[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x38'))['find'](_0x3ebff4,_0x113d11);case'account':var _0x5aaf1d=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchAccount']){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x36')]]=_0x33cfc8;_['merge'](_0x5aaf1d['$or'],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x37'))[_0xe60d('0x22')](_0x5aaf1d,_0x113d11);default:return null;}})['then'](function(_0x348bd0){if(_0x348bd0&&_0x348bd0['length']){var _0x3ee136=_[_0xe60d('0x39')](_0x348bd0);if(_0x3ee136){return BPromise['resolve']({'id':_0x3ee136['Id'],'name':_0x3ee136[_0xe60d('0x28')],'phone':_0x3ee136[_0xe60d('0x3a')],'endUserType':_0x3ee136['attributes'][_0xe60d('0x3b')][_0xe60d('0x3c')]()});}}})[_0xe60d('0x24')](function(_0x3f4f5f){if(_0x3f4f5f){logger[_0xe60d('0x1c')](_0xe60d('0x3d'),_0x3f4f5f[_0xe60d('0x15')],_0x33cfc8);return BPromise[_0xe60d('0x27')](_0x3f4f5f);}else{logger[_0xe60d('0x1c')](_0xe60d('0x3e'),_0x33cfc8);var _0x9060c3={'Phone':_0x33cfc8};if(_0x3164ac[_0xe60d('0x3f')]){if(_0x3164ac[_0xe60d('0x3f')]===_0xe60d('0x40')){logger[_0xe60d('0x1c')](_0xe60d('0x41'),_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x42')]=_0x3beeb4!==_0xe60d('0x43')?_0x3beeb4:util[_0xe60d('0x44')](_0xe60d('0x45'),_0x33cfc8);}else if(_0x3164ac[_0xe60d('0x3f')]==='lead'){logger[_0xe60d('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x42')]=_0x3beeb4!==''?_0x3beeb4:util[_0xe60d('0x44')]('Caller\x20-\x20%s',_0x33cfc8);_0x9060c3[_0xe60d('0x46')]=_0xe60d('0x47');}else if(_0x3164ac['moduleCreate']===_0xe60d('0x1a')){logger[_0xe60d('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x28')]=_0x3beeb4!==_0xe60d('0x43')?_0x3beeb4:util[_0xe60d('0x44')](_0xe60d('0x45'),_0x33cfc8);}else{return null;}}return _0x39736b[_0xe60d('0x1e')](_[_0xe60d('0x48')](_0x3164ac['moduleCreate']))['create'](_0x9060c3)[_0xe60d('0x24')](function(_0x3f918e){return BPromise[_0xe60d('0x27')]({'id':_0x3f918e['id'],'endUserType':_0x3164ac[_0xe60d('0x3f')]});});}});}function getCustomFields(_0x21c2b5,_0x14a1ee){var _0x18b299={};if(_0x21c2b5[_0xe60d('0x25')]>0x0){_[_0xe60d('0x49')](_0x21c2b5,function(_0xb1b39f){if(_[_0xe60d('0x4a')](['string',_0xe60d('0x4b')],_0xb1b39f[_0xe60d('0x3b')])&&_0xb1b39f['idField']){_0x18b299[_0xb1b39f[_0xe60d('0x4c')]]=_0xb1b39f[_0xe60d('0x4d')]['toString']();}else if(_0xb1b39f['type']==='variable'&&_0xb1b39f[_0xe60d('0x4e')]&&_0xb1b39f[_0xe60d('0x4c')]){_0x14a1ee[_0xb1b39f[_0xe60d('0x4e')]]&&(_0x18b299[_0xb1b39f[_0xe60d('0x4c')]]=_0x14a1ee[_0xb1b39f[_0xe60d('0x4e')]][_0xe60d('0x4f')]());}else if(_0xb1b39f[_0xe60d('0x3b')]==='customVariable'&&_0xb1b39f[_0xe60d('0x50')]&&_0xb1b39f['Variable']['name']&&_0xb1b39f['idField']){_0x14a1ee[_0xb1b39f['Variable'][_0xe60d('0x51')][_0xe60d('0x3c')]()]&&(_0x18b299[_0xb1b39f['idField']]=_0x14a1ee[_0xb1b39f[_0xe60d('0x50')][_0xe60d('0x51')][_0xe60d('0x3c')]()][_0xe60d('0x4f')]());}});}return _0x18b299;}function getConnection(_0x4de78f){var _0x357e87=_0x4de78f[_0xe60d('0x52')][_0xe60d('0x53')](_0x4de78f[_0xe60d('0x54')]);var _0x3e662b=new jsforce[(_0xe60d('0x55'))]({'oauth2':{'loginUrl':_0x4de78f[_0xe60d('0x56')]||_0xe60d('0x57'),'clientId':_0x4de78f[_0xe60d('0x58')],'clientSecret':_0x4de78f[_0xe60d('0x59')]}});return _0x3e662b[_0xe60d('0x5a')](_0x4de78f[_0xe60d('0x5b')],_0x357e87)[_0xe60d('0x24')](function(){logger[_0xe60d('0x1c')]('Connection\x20established.');return _0x3e662b;});}exports['queue']=function(_0x32542e,_0x6c8bd9,_0x2035e1,_0x19b71c,_0x3e8a03,_0x5000c0){var _0x551f91,_0x53af22,_0x164762,_0x45f972;_0x5000c0[_0xe60d('0x5c')]=intUtil['stripTrailingSlash'](_0x5000c0[_0xe60d('0x5c')]);_0x5000c0[_0xe60d('0x56')]=intUtil['stripTrailingSlash'](_0x5000c0[_0xe60d('0x56')]);if(_0x3e8a03&&_0x3e8a03[_0xe60d('0x5d')]){logger[_0xe60d('0x1c')](_0xe60d('0x5e'),_0xe60d('0x5f'));_0x6c8bd9[_0xe60d('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5000c0[_0xe60d('0x5c')],_0x6c8bd9[_0xe60d('0x61')],md5(_0x6c8bd9[_0xe60d('0x61')]));}else{_0x6c8bd9[_0xe60d('0x60')]='';}return getConnection(_0x5000c0)[_0xe60d('0x24')](function(_0x4eb7f6){_0x45f972=_0x4eb7f6;return getUser(_0x5000c0,_0x19b71c[_0xe60d('0x62')],_0x45f972);})['then'](function(_0xc4dfe4){_0x551f91=_0xc4dfe4;return getEndUser(_0x5000c0,_0x2035e1,_0x6c8bd9['calleridname'],_0x6c8bd9[_0xe60d('0x63')],_0x45f972);})[_0xe60d('0x24')](function(_0x190dcf){_0x53af22=_0x190dcf;return getTicket(_0x5000c0,_0x551f91,_0x53af22,_0x2035e1,_0x6c8bd9,_0x2035e1['Fields'],_0x45f972,_0xe60d('0x64'));})['then'](function(_0x4ccc83){_0x164762=_0x4ccc83;logger['info'](_0xe60d('0x65'),_0x164762['id']);logger['info'](_0xe60d('0x66'),_0x164762['id'],_0x19b71c[_0xe60d('0x51')],_0x5000c0['type']);switch(_0x5000c0['type']){case'integrationTab':emit(util['format'](_0xe60d('0x67'),_0x19b71c[_0xe60d('0x51')]),_0xe60d('0x68'),{'recordId':_0x164762['id']});break;case _0xe60d('0x69'):emit(util[_0xe60d('0x44')]('user:%s',_0x19b71c[_0xe60d('0x51')]),'trigger:browser:url',{'uri':util[_0xe60d('0x44')](_0xe60d('0x6a'),_0x45f972[_0xe60d('0x6b')],_0x164762['id'])});break;default:logger[_0xe60d('0x6c')](_0xe60d('0x6d'));}})[_0xe60d('0x6e')](function(_0x132e23){logger[_0xe60d('0x6c')]('[QUEUE]',_0x132e23);});};exports[_0xe60d('0x6f')]=function(_0x276da1,_0x550578,_0x3422a6,_0x76d175,_0x822646,_0x4875c9,_0x16a49c){var _0xd85696,_0x26c8da,_0x3bab9a,_0x37b7cf;_0x4875c9['serverUrl']=intUtil['stripTrailingSlash'](_0x4875c9[_0xe60d('0x5c')]);_0x4875c9[_0xe60d('0x56')]=intUtil[_0xe60d('0x70')](_0x4875c9[_0xe60d('0x56')]);if(_0x16a49c&&_0x16a49c['recordingFormat']&&_0x16a49c[_0xe60d('0x71')]!=='none'){logger['info'](_0xe60d('0x72'),_0xe60d('0x5f'));_0x550578[_0xe60d('0x60')]=util[_0xe60d('0x44')](_0xe60d('0x73'),_0x4875c9[_0xe60d('0x5c')],_0x550578[_0xe60d('0x61')],md5(_0x550578[_0xe60d('0x61')]));}return getConnection(_0x4875c9)[_0xe60d('0x24')](function(_0x322eed){_0x37b7cf=_0x322eed;return getUser(_0x4875c9,_0x76d175[_0xe60d('0x62')],_0x37b7cf);})[_0xe60d('0x24')](function(_0x51fd86){_0xd85696=_0x51fd86;return getEndUser(_0x4875c9,_0x3422a6,_0x550578['destcalleridname'],_0x550578['destcalleridnum'],_0x37b7cf);})['then'](function(_0x4fd30a){_0x26c8da=_0x4fd30a;return getTicket(_0x4875c9,_0xd85696,_0x26c8da,_0x3422a6,_0x550578,_0x3422a6[_0xe60d('0x74')],_0x37b7cf,_0xe60d('0x6f'));})[_0xe60d('0x24')](function(_0x1139dc){_0x3bab9a=_0x1139dc;logger[_0xe60d('0x1c')](_0xe60d('0x75'),_0x3bab9a['id']);logger['info'](_0xe60d('0x76'),_0x3bab9a['id'],_0x76d175[_0xe60d('0x51')],_0x4875c9[_0xe60d('0x3b')]);switch(_0x4875c9[_0xe60d('0x3b')]){case'integrationTab':emit(util[_0xe60d('0x44')](_0xe60d('0x67'),_0x76d175['name']),_0xe60d('0x68'),{'recordId':_0x3bab9a['id']});break;case'newTab':emit(util[_0xe60d('0x44')](_0xe60d('0x67'),_0x76d175['name']),'trigger:browser:url',{'uri':util[_0xe60d('0x44')]('%s/%s/e',_0x37b7cf[_0xe60d('0x6b')],_0x3bab9a['id'])});break;default:logger[_0xe60d('0x6c')]('[OUTBOUND]',_0xe60d('0x77'));}})['catch'](function(_0x395175){logger['error'](_0xe60d('0x72'),_0x395175);});};exports[_0xe60d('0x78')]=function(_0x382b50,_0x3f8ff9,_0x4d20a7,_0x4dc43e,_0x37825c,_0x3a953b){var _0x21bfd1,_0x1c623c,_0xc18ad1,_0x12e13d;_0x3a953b[_0xe60d('0x5c')]=intUtil[_0xe60d('0x70')](_0x3a953b[_0xe60d('0x5c')]);_0x3a953b[_0xe60d('0x56')]=intUtil[_0xe60d('0x70')](_0x3a953b[_0xe60d('0x56')]);if(_0x37825c&&_0x37825c[_0xe60d('0x5d')]){logger['info']('['+_0x3f8ff9[_0xe60d('0x79')][_0xe60d('0x7a')]()+']','Recording\x20is\x20enabled!');_0x3f8ff9[_0xe60d('0x60')]=util[_0xe60d('0x44')](_0xe60d('0x73'),_0x3a953b[_0xe60d('0x5c')],_0x3f8ff9[_0xe60d('0x61')],md5(_0x3f8ff9[_0xe60d('0x61')]));}else{_0x3f8ff9['recordingURL']='';}return getConnection(_0x3a953b)[_0xe60d('0x24')](function(_0x20b88d){_0x12e13d=_0x20b88d;if(!_['isNil'](_0x4dc43e)){return getUser(_0x3a953b,_0x4dc43e[_0xe60d('0x51')],_0x12e13d);}else{return getUser(_0x3a953b,null,_0x12e13d);}})[_0xe60d('0x24')](function(_0x1f07b8){_0x21bfd1=_0x1f07b8;return getEndUser(_0x3a953b,_0x4d20a7,_0x3f8ff9[_0xe60d('0x7b')],_0x3f8ff9[_0xe60d('0x63')],_0x12e13d);})[_0xe60d('0x24')](function(_0x449f30){_0x1c623c=_0x449f30;return getTicket(_0x3a953b,_0x21bfd1,_0x1c623c,_0x4d20a7,_0x3f8ff9,_0x4d20a7[_0xe60d('0x74')],_0x12e13d);})['then'](function(_0x377d6f){_0xc18ad1=_0x377d6f;logger['info']('['+_0x3f8ff9[_0xe60d('0x79')][_0xe60d('0x7a')]()+_0xe60d('0x7c'),_0xc18ad1['id']);logger[_0xe60d('0x1c')]('['+_0x3f8ff9['lastevent'][_0xe60d('0x7a')]()+_0xe60d('0x7d'),_0x3a953b[_0xe60d('0x3b')]);})[_0xe60d('0x6e')](function(_0x593075){logger[_0xe60d('0x6c')]('['+_0x3f8ff9['lastevent']['toUpperCase']()+']',_0x593075);});}; \ 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 47bbce7..8c236c1 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 _0x6a88=['recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','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','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!'];(function(_0x3513c7,_0x23a696){var _0x5afebf=function(_0x112d09){while(--_0x112d09){_0x3513c7['push'](_0x3513c7['shift']());}};_0x5afebf(++_0x23a696);}(_0x6a88,0xef));var _0x86a8=function(_0x4855a7,_0x133b87){_0x4855a7=_0x4855a7-0x0;var _0x2d3855=_0x6a88[_0x4855a7];return _0x2d3855;};'use strict';var _=require(_0x86a8('0x0'));var Promise=require('bluebird');var rp=require(_0x86a8('0x1'));var util=require('util');var md5=require(_0x86a8('0x2'));var Redis=require('ioredis');var intUtil=require(_0x86a8('0x3'));var config=require(_0x86a8('0x4'));var logger=require(_0x86a8('0x5'))(_0x86a8('0x6'));config[_0x86a8('0x7')]=_[_0x86a8('0x8')](config[_0x86a8('0x7')],{'host':_0x86a8('0x9'),'port':0x18eb});var io=require(_0x86a8('0xa'))(new Redis(config[_0x86a8('0x7')]));function getAdminUser(_0x560966,_0xf15eb8,_0x28195c,_0x4a1137,_0x1d94ae,_0x4095a2){return new Promise(function(_0x17eb0a,_0x143b3d){var _0x2e83cb={'method':_0x86a8('0xb'),'uri':_0x4a1137+_0x86a8('0xc')+'&'+_0x1d94ae+'&'+_0x4095a2,'auth':_0xf15eb8,'json':!![]};return rp(_0x2e83cb)[_0x86a8('0xd')](function(_0x2e2d99){if(_0x2e2d99['result'][_0x86a8('0xe')]>0x0){_0x28195c[_0x86a8('0xf')]=_0x2e2d99[_0x86a8('0x10')][0x0][_0x86a8('0x11')];}logger[_0x86a8('0x12')]('['+[_0x560966['toUpperCase']()]+_0x86a8('0x13'),_0x28195c);_0x17eb0a(_0x28195c);})[_0x86a8('0x14')](function(_0x1faabd){logger[_0x86a8('0x15')]('['+[_0x560966[_0x86a8('0x16')]()]+']',_0x1faabd[_0x86a8('0x17')]);_0x143b3d(_0x1faabd[_0x86a8('0x17')]);});});}function getUser(_0x564ab6,_0x5e12ae,_0x3e69e8,_0x20eb7d,_0x5397c9){return function(_0x442c86){logger[_0x86a8('0x12')]('['+[_0x564ab6['toUpperCase']()]+_0x86a8('0x18'),_0x442c86);return new Promise(function(_0x447fd5,_0xebe34b){if(intUtil[_0x86a8('0x19')](_0x442c86[_0x86a8('0x1a')])){var _0xd7911c={'method':_0x86a8('0xb'),'uri':_0x3e69e8+_0x86a8('0x1b')+_0x442c86[_0x86a8('0x1a')]+'&'+_0x20eb7d+'&'+_0x5397c9,'auth':_0x5e12ae,'json':!![]};logger[_0x86a8('0x12')]('['+[_0x564ab6['toUpperCase']()]+_0x86a8('0x1c'),_0xd7911c);return rp(_0xd7911c)[_0x86a8('0xd')](function(_0x50fef4){logger[_0x86a8('0x12')]('['+[_0x564ab6[_0x86a8('0x16')]()]+'],\x20getUser\x20entity',_0x50fef4);if(_0x50fef4['result']['length']>0x0&&String(_0x50fef4[_0x86a8('0x10')][0x0][_0x86a8('0x1d')])===_0x86a8('0x1e')){_0x442c86['userId']=_0x50fef4[_0x86a8('0x10')][0x0][_0x86a8('0x11')];}else{_0x442c86[_0x86a8('0x1f')]=_0x442c86[_0x86a8('0xf')];_0x442c86[_0x86a8('0x1a')]=_0x442c86[_0x86a8('0x20')];}logger[_0x86a8('0x12')]('['+[_0x564ab6[_0x86a8('0x16')]()]+_0x86a8('0x21'),_0x442c86);_0x447fd5(_0x442c86);})[_0x86a8('0x14')](function(_0x296b46){logger[_0x86a8('0x15')]('['+[_0x564ab6[_0x86a8('0x16')]()]+']',_0x296b46[_0x86a8('0x17')]);_0xebe34b(_0x296b46[_0x86a8('0x17')]);});}else{logger[_0x86a8('0x12')]('['+[_0x564ab6['toUpperCase']()]+_0x86a8('0x22'));_0x442c86['userId']=_0x442c86[_0x86a8('0xf')];_0x442c86[_0x86a8('0x1a')]=_0x442c86['adminEmail'];_0x447fd5(_0x442c86);}});};}function createEndUser(_0x5a976b,_0x116399,_0x1a3e50,_0x26737a,_0x569ca6){logger[_0x86a8('0x12')]('['+[_0x5a976b[_0x86a8('0x16')]()]+'],\x20createEndUser\x20input\x20crm',_0x1a3e50);return new Promise(function(_0x468864,_0x434982){var _0x57d5f6={'method':'POST','uri':_0x26737a+_0x86a8('0x23')+_0x569ca6,'body':{'user_name':_0x1a3e50[_0x86a8('0x24')],'roles':'user','first_name':_0x1a3e50[_0x86a8('0x24')],'active':_0x86a8('0x1e'),'date_format':_0x86a8('0x25'),'phone':_0x1a3e50['endUserNumber']},'auth':_0x116399,'json':!![]};return rp(_0x57d5f6)[_0x86a8('0xd')](function(_0x162107){logger[_0x86a8('0x12')]('['+[_0x5a976b[_0x86a8('0x16')]()]+_0x86a8('0x26'),_0x162107[_0x86a8('0x10')]);_0x1a3e50['endUserId']=_0x162107[_0x86a8('0x10')][_0x86a8('0x11')];_0x468864(_0x1a3e50);})['catch'](function(_0x297b1b){logger[_0x86a8('0x15')]('['+[_0x5a976b[_0x86a8('0x16')]()]+']',_0x297b1b[_0x86a8('0x17')]);_0x434982(_0x297b1b[_0x86a8('0x17')]);});});}function getEndUser(_0x2eb152,_0x2b7e1d,_0x1a3fc7,_0x43d20f,_0x10f734){return function(_0x1a2a48){logger[_0x86a8('0x12')]('['+[_0x2eb152['toUpperCase']()]+_0x86a8('0x27'),_0x1a2a48);return new Promise(function(_0x3f90fe,_0x2b0fb1){var _0x25846f={'method':'GET','uri':_0x1a3fc7+_0x86a8('0x28')+_0x1a2a48[_0x86a8('0x24')]+'&'+_0x43d20f+'&'+_0x10f734,'auth':_0x2b7e1d,'json':!![]};return rp(_0x25846f)[_0x86a8('0xd')](function(_0x1d5213){if(_0x1d5213['result'][_0x86a8('0xe')]>0x0){_0x1a2a48[_0x86a8('0x29')]=_0x1d5213[_0x86a8('0x10')][0x0]['sys_id'];logger[_0x86a8('0x12')]('['+[_0x2eb152[_0x86a8('0x16')]()]+_0x86a8('0x2a'),_0x1a2a48);_0x3f90fe(_0x1a2a48);}else{return createEndUser(_0x2eb152,_0x2b7e1d,_0x1a2a48,_0x1a3fc7,_0x43d20f)[_0x86a8('0xd')](function(_0xac6a8c){logger[_0x86a8('0x12')]('['+[_0x2eb152[_0x86a8('0x16')]()]+_0x86a8('0x2b'),_0xac6a8c);_0x3f90fe(_0xac6a8c);});}})[_0x86a8('0x14')](function(_0x55d748){logger[_0x86a8('0x15')]('['+[_0x2eb152[_0x86a8('0x16')]()]+']',_0x55d748[_0x86a8('0x17')]);_0x2b0fb1(_0x55d748['message']);});});};}function getCustomFields(_0x480477,_0x5f4800){var _0x587eb7={};if(_0x480477['length']>0x0){_['forEach'](_0x480477,function(_0x27fd15){if(_[_0x86a8('0x2c')]([_0x86a8('0x2d'),'picklist'],_0x27fd15[_0x86a8('0x2e')])&&_0x27fd15[_0x86a8('0x2f')]&&!_0x27fd15[_0x86a8('0x30')]){_0x587eb7[_0x27fd15['nameField'][_0x86a8('0x31')]()]=_0x27fd15[_0x86a8('0x32')][_0x86a8('0x33')]();}else if(_[_0x86a8('0x2c')]([_0x86a8('0x2d'),'picklist'],_0x27fd15[_0x86a8('0x2e')])&&_0x27fd15[_0x86a8('0x34')]&&_0x27fd15[_0x86a8('0x30')]){_0x587eb7[_0x27fd15['idField'][_0x86a8('0x31')]()]=_0x27fd15['content'][_0x86a8('0x33')]();}else if(_0x27fd15['type']===_0x86a8('0x35')&&_0x27fd15[_0x86a8('0x36')]&&_0x27fd15['idField']&&_0x27fd15[_0x86a8('0x30')]){_0x587eb7[_0x27fd15[_0x86a8('0x34')][_0x86a8('0x31')]()]=_0x5f4800[_0x27fd15[_0x86a8('0x36')]]['toString']();}else if(_0x27fd15['type']===_0x86a8('0x37')&&_0x27fd15[_0x86a8('0x38')]&&_0x27fd15[_0x86a8('0x38')][_0x86a8('0x39')]&&_0x27fd15[_0x86a8('0x34')]&&_0x27fd15[_0x86a8('0x30')]){_0x587eb7[_0x27fd15[_0x86a8('0x34')][_0x86a8('0x31')]()]=_0x5f4800[_0x27fd15[_0x86a8('0x38')]['name'][_0x86a8('0x31')]()][_0x86a8('0x33')]();}});}return _0x587eb7;}function getTicket(_0x3bd489,_0x5d423a,_0x3993f0,_0x183cff,_0x4e81e2,_0x6144b3){return function(_0x355dba){logger[_0x86a8('0x12')]('['+[_0x3bd489[_0x86a8('0x16')]()]+_0x86a8('0x3a'),_0x355dba);return new Promise(function(_0x29f5ea,_0x233738){var _0x1c691f=_0x3bd489['toLowerCase']()===_0x86a8('0x3b')?_0x355dba[_0x86a8('0x1f')]:_0x355dba[_0x86a8('0x29')];var _0x47cbee={'method':'POST','uri':_0x3993f0+_0x86a8('0x3c')+'?'+_0x6144b3,'body':Object[_0x86a8('0x3d')]({},{'active':_0x86a8('0x1e'),'caller_id':_0x1c691f,'assigned_to':_0x355dba[_0x86a8('0x1f')],'short_description':intUtil[_0x86a8('0x3e')](_0x183cff[_0x86a8('0x3f')],_0x4e81e2,'\x20'),'description':intUtil['getString'](_0x183cff['Descriptions'],_0x4e81e2,'\x0a')},getCustomFields(_0x183cff['Fields'],_0x4e81e2)),'auth':_0x5d423a,'json':!![]};return rp(_0x47cbee)[_0x86a8('0xd')](function(_0xd4b5d9){logger[_0x86a8('0x12')]('['+[_0x3bd489['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0xd4b5d9[_0x86a8('0x10')]);_0x355dba[_0x86a8('0x40')]=_0xd4b5d9[_0x86a8('0x10')][_0x86a8('0x11')];_0x355dba[_0x86a8('0x41')]=_0xd4b5d9[_0x86a8('0x10')][_0x86a8('0x42')];logger[_0x86a8('0x12')]('['+[_0x3bd489[_0x86a8('0x16')]()]+_0x86a8('0x43'),_0x355dba);_0x29f5ea(_0x355dba);})[_0x86a8('0x14')](function(_0x58dd39){logger[_0x86a8('0x15')]('['+[_0x3bd489['toUpperCase']()]+']',_0x58dd39['message']);_0x233738(_0x58dd39['message']);});});};}function createRemoteTag(_0x4f8fd7,_0x1627c9,_0x4064ee,_0x3d3d00){return new Promise(function(_0x24d8ed,_0x2825d8){var _0x33cf7b={'method':_0x86a8('0x44'),'uri':_0x4064ee+_0x86a8('0x45')+'?'+_0x3d3d00,'body':{'short_description':_0x4f8fd7,'global':!![],'active':!![],'name':_0x4f8fd7},'auth':_0x1627c9,'json':!![]};return rp(_0x33cf7b)['then'](function(_0x4c698e){var _0x1d9f12=_0x4c698e[_0x86a8('0x10')]['sys_id'];_0x24d8ed(_0x1d9f12);});});}function getRemoteTag(_0x22ea91,_0x9d8d3d,_0xd57966,_0x1e2380,_0x392bd6){return new Promise(function(_0x36e722,_0x3b7c1b){var _0x53de9c={'method':_0x86a8('0xb'),'uri':_0xd57966+_0x86a8('0x45')+_0x86a8('0x46')+_0x22ea91+'&'+_0x1e2380,'auth':_0x9d8d3d,'json':!![]};return rp(_0x53de9c)['then'](function(_0x242b58){if(_0x242b58['result']['length']>0x0){var _0x1796c3=_0x242b58[_0x86a8('0x10')][0x0]['sys_id'];_0x36e722(_0x1796c3);}else{return createRemoteTag(_0x22ea91,_0x9d8d3d,_0xd57966,_0x1e2380)['then'](function(_0x2b9e98){_0x36e722(_0x2b9e98);});}});});}function assignTagToIncident(_0x36c998,_0x5fcbe5,_0x114a3a,_0x6d3e9e,_0x54bcf3){return new Promise(function(_0x5a543c,_0x4de48f){var _0x17d6f7={'method':'POST','uri':_0x114a3a+_0x86a8('0x47')+'?'+_0x54bcf3,'body':{'label':_0x36c998,'table':_0x86a8('0x3c'),'id_type':_0x86a8('0x48'),'table_key':_0x6d3e9e[_0x86a8('0x40')],'title':'Incident\x20-\x20'+_0x6d3e9e[_0x86a8('0x41')],'id_display':_0x6d3e9e[_0x86a8('0x41')]},'auth':_0x5fcbe5,'json':!![]};return rp(_0x17d6f7)[_0x86a8('0xd')](function(_0xfd0ee7){_0x5a543c();})['catch'](function(){_0x5a543c();});});}function manageTags(_0x56f57b,_0x1a57ba,_0x1345f3,_0x59d67a,_0x2794e4,_0x37cab8,_0x43726b){return new Promise(function(_0x12c16c,_0x403df9){var _0x1c64db=[];_0x1a57ba['forEach'](function(_0x14e652){_0x1c64db[_0x86a8('0x49')](getRemoteTag(_0x14e652,_0x1345f3,_0x59d67a,_0x37cab8,_0x43726b));});return Promise[_0x86a8('0x4a')](_0x1c64db)[_0x86a8('0xd')](function(_0x368d6a){if(_0x368d6a[_0x86a8('0xe')]){logger['info']('['+[_0x56f57b['toUpperCase']()]+_0x86a8('0x4b'),_0x368d6a);var _0x1255ed=[];_0x368d6a[_0x86a8('0x4c')](function(_0x3e0709){_0x1255ed['push'](assignTagToIncident(_0x3e0709,_0x1345f3,_0x59d67a,_0x2794e4,_0x37cab8));});return Promise[_0x86a8('0x4a')](_0x1255ed)[_0x86a8('0xd')](function(){_0x12c16c();})['catch'](function(){_0x12c16c();});}else{_0x12c16c();}});});}function getTags(_0x4f6fa8,_0x5e86a2,_0x133f00,_0x2abe61,_0x466a1b,_0xec7f7){return function(_0x561f81){return new Promise(function(_0x3512ec,_0xf5d577){var _0x57d1eb=[];var _0x23f0e6=_0x2abe61[_0x86a8('0x4d')];if(_0x23f0e6&&_0x23f0e6[_0x86a8('0xe')]>0x0){_0x57d1eb=_[_0x86a8('0x4e')](_0x23f0e6,'name');}if(_0x57d1eb[_0x86a8('0xe')]>0x0){return manageTags(_0x4f6fa8,_0x57d1eb,_0x5e86a2,_0x133f00,_0x561f81,_0x466a1b,_0xec7f7)[_0x86a8('0xd')](function(){_0x3512ec(_0x561f81);});}else{_0x3512ec(_0x561f81);}});};}function emit(_0x534c22,_0x3b1e09,_0x2cdf70){var _0x281dd7=_0x86a8('0x4f')+_0x86a8('0x50')+_0x86a8('0x51')+_0x86a8('0x52');var _0xaaed65={'uri':_0x534c22+_0x86a8('0x53')+_0x2cdf70+_0x281dd7};io['to'](util[_0x86a8('0x54')](_0x86a8('0x55'),_0x3b1e09))[_0x86a8('0x56')](_0x86a8('0x57'),_0xaaed65);}exports['cs']=function(_0x25112a,_0x583d55,_0x200049,_0x2bb3d1,_0x49f7c3,_0x5ba071,_0x5b5cca,_0x21437f){var _0x54d2e3={};var _0x2de475={'user':_0x5ba071[_0x86a8('0x58')],'pass':_0x5ba071[_0x86a8('0x59')]};var _0x5e733b=_0x86a8('0x5a');var _0x5b0eb1=_0x86a8('0x5b');_0x5ba071[_0x86a8('0x5c')]=intUtil[_0x86a8('0x5d')](_0x5ba071[_0x86a8('0x5c')]);_0x5ba071[_0x86a8('0x5e')]=intUtil[_0x86a8('0x5d')](_0x5ba071[_0x86a8('0x5e')]);var _0x4dc630=util[_0x86a8('0x54')](_0x86a8('0x5f'),_0x5ba071['remoteUri']);_0x54d2e3['userEmail']=!_[_0x86a8('0x60')](_0x2bb3d1)?_0x2bb3d1[_0x86a8('0x61')]:null;_0x54d2e3[_0x86a8('0x20')]=_0x5ba071[_0x86a8('0x61')];_0x54d2e3[_0x86a8('0x24')]=_0x21437f[_0x86a8('0x31')]()===_0x86a8('0x3b')?_0x583d55[_0x86a8('0x62')]:_0x583d55[_0x86a8('0x63')];_0x54d2e3[_0x86a8('0x64')]=_0x21437f===_0x86a8('0x65')||_0x21437f===_0x86a8('0x66')?_0x86a8('0x65'):_0x86a8('0x3b');var _0x3dc345=util['format'](_0x86a8('0x67'),_0x5ba071[_0x86a8('0x5e')],_0x583d55[_0x86a8('0x68')],md5(_0x583d55[_0x86a8('0x68')]));if(_0x49f7c3&&_0x49f7c3['monitor_format']){logger['info']('[QUEUE]',_0x86a8('0x69'));_0x583d55['recordingURL']=_0x3dc345;}else if(_0x5b5cca&&_0x5b5cca[_0x86a8('0x6a')]&&_0x5b5cca['recordingFormat']!==_0x86a8('0x6b')){logger[_0x86a8('0x12')](_0x86a8('0x6c'),'Recording\x20is\x20enabled!');_0x583d55['recordingURL']=_0x3dc345;}else{_0x583d55[_0x86a8('0x6d')]='';}return getAdminUser(_0x21437f,_0x2de475,_0x54d2e3,_0x4dc630,_0x5b0eb1,_0x5e733b)[_0x86a8('0xd')](getUser(_0x21437f,_0x2de475,_0x4dc630,_0x5b0eb1,_0x5e733b))['then'](getEndUser(_0x21437f,_0x2de475,_0x4dc630,_0x5b0eb1,_0x5e733b))[_0x86a8('0xd')](getTicket(_0x21437f,_0x2de475,_0x4dc630,_0x200049,_0x583d55,_0x5b0eb1))[_0x86a8('0xd')](function(_0x5aad6b){logger['info'](util[_0x86a8('0x54')](_0x86a8('0x6e'),_0x5aad6b[_0x86a8('0x40')]));logger[_0x86a8('0x12')](util[_0x86a8('0x54')](_0x86a8('0x6f'),_0x21437f));if(_0x21437f!==_0x86a8('0x66')){logger[_0x86a8('0x12')]('['+[_0x21437f[_0x86a8('0x16')]()]+']',_0x86a8('0x70'));emit(_0x5ba071[_0x86a8('0x5c')],_0x2bb3d1[_0x86a8('0x39')],_0x5aad6b[_0x86a8('0x40')]);}})[_0x86a8('0x14')](function(_0x2aa7e4){logger['error']('['+[_0x21437f['toUpperCase']()]+_0x86a8('0x71'),util[_0x86a8('0x72')](_0x2aa7e4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcc5c=['serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','picklist','nameField','customField','content','toString','includes','idField','toLowerCase','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','userId','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash'];(function(_0x89ec94,_0x4eaba1){var _0x17cac6=function(_0x375b14){while(--_0x375b14){_0x89ec94['push'](_0x89ec94['shift']());}};_0x17cac6(++_0x4eaba1);}(_0xcc5c,0xef));var _0xccc5=function(_0x408aff,_0x26369b){_0x408aff=_0x408aff-0x0;var _0x32494e=_0xcc5c[_0x408aff];return _0x32494e;};'use strict';var _=require(_0xccc5('0x0'));var Promise=require(_0xccc5('0x1'));var rp=require(_0xccc5('0x2'));var util=require(_0xccc5('0x3'));var md5=require(_0xccc5('0x4'));var Redis=require(_0xccc5('0x5'));var intUtil=require(_0xccc5('0x6'));var config=require('../../../../config/environment');var logger=require(_0xccc5('0x7'))(_0xccc5('0x8'));config[_0xccc5('0x9')]=_[_0xccc5('0xa')](config[_0xccc5('0x9')],{'host':_0xccc5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xccc5('0x9')]));function getAdminUser(_0x53102b,_0x434f7e,_0x1eaee2,_0x46830c,_0x68702e,_0x7b3323){return new Promise(function(_0x43e4da,_0x17d5eb){var _0x24d626={'method':_0xccc5('0xc'),'uri':_0x46830c+_0xccc5('0xd')+'&'+_0x68702e+'&'+_0x7b3323,'auth':_0x434f7e,'json':!![]};return rp(_0x24d626)[_0xccc5('0xe')](function(_0x29c60c){if(_0x29c60c[_0xccc5('0xf')][_0xccc5('0x10')]>0x0){_0x1eaee2[_0xccc5('0x11')]=_0x29c60c[_0xccc5('0xf')][0x0][_0xccc5('0x12')];}logger[_0xccc5('0x13')]('['+[_0x53102b[_0xccc5('0x14')]()]+_0xccc5('0x15'),_0x1eaee2);_0x43e4da(_0x1eaee2);})[_0xccc5('0x16')](function(_0x3b9e05){logger[_0xccc5('0x17')]('['+[_0x53102b['toUpperCase']()]+']',_0x3b9e05[_0xccc5('0x18')]);_0x17d5eb(_0x3b9e05[_0xccc5('0x18')]);});});}function getUser(_0x3db379,_0x52e3ea,_0x3226a0,_0x202456,_0x38868a){return function(_0x162568){logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x19'),_0x162568);return new Promise(function(_0x1addda,_0x3a2cd4){if(intUtil['validateEmail'](_0x162568[_0xccc5('0x1a')])){var _0x543a86={'method':'GET','uri':_0x3226a0+_0xccc5('0x1b')+_0x162568[_0xccc5('0x1a')]+'&'+_0x202456+'&'+_0x38868a,'auth':_0x52e3ea,'json':!![]};logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+'],\x20getUser\x20rp\x20obj',_0x543a86);return rp(_0x543a86)[_0xccc5('0xe')](function(_0x2749eb){logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x1c'),_0x2749eb);if(_0x2749eb[_0xccc5('0xf')][_0xccc5('0x10')]>0x0&&String(_0x2749eb[_0xccc5('0xf')][0x0][_0xccc5('0x1d')])===_0xccc5('0x1e')){_0x162568['userId']=_0x2749eb['result'][0x0][_0xccc5('0x12')];}else{_0x162568['userId']=_0x162568[_0xccc5('0x11')];_0x162568['userEmail']=_0x162568[_0xccc5('0x1f')];}logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x20'),_0x162568);_0x1addda(_0x162568);})[_0xccc5('0x16')](function(_0xc4395f){logger[_0xccc5('0x17')]('['+[_0x3db379[_0xccc5('0x14')]()]+']',_0xc4395f[_0xccc5('0x18')]);_0x3a2cd4(_0xc4395f[_0xccc5('0x18')]);});}else{logger[_0xccc5('0x13')]('['+[_0x3db379['toUpperCase']()]+_0xccc5('0x21'));_0x162568['userId']=_0x162568['adminId'];_0x162568['userEmail']=_0x162568['adminEmail'];_0x1addda(_0x162568);}});};}function createEndUser(_0x2c6baa,_0x401cb1,_0x48f015,_0x17dbbb,_0x1e8164){logger[_0xccc5('0x13')]('['+[_0x2c6baa['toUpperCase']()]+_0xccc5('0x22'),_0x48f015);return new Promise(function(_0x376697,_0x3bcab3){var _0x522049={'method':_0xccc5('0x23'),'uri':_0x17dbbb+_0xccc5('0x24')+_0x1e8164,'body':{'user_name':_0x48f015[_0xccc5('0x25')],'roles':_0xccc5('0x26'),'first_name':_0x48f015['endUserNumber'],'active':_0xccc5('0x1e'),'date_format':_0xccc5('0x27'),'phone':_0x48f015[_0xccc5('0x25')]},'auth':_0x401cb1,'json':!![]};return rp(_0x522049)[_0xccc5('0xe')](function(_0x570c7d){logger['info']('['+[_0x2c6baa['toUpperCase']()]+'],\x20EndUser\x20schema',_0x570c7d['result']);_0x48f015[_0xccc5('0x28')]=_0x570c7d[_0xccc5('0xf')][_0xccc5('0x12')];_0x376697(_0x48f015);})[_0xccc5('0x16')](function(_0x41b85c){logger['error']('['+[_0x2c6baa['toUpperCase']()]+']',_0x41b85c[_0xccc5('0x18')]);_0x3bcab3(_0x41b85c[_0xccc5('0x18')]);});});}function getEndUser(_0x314fc3,_0x1202f8,_0x2eb0c5,_0x203dc3,_0xab7e74){return function(_0x593654){logger[_0xccc5('0x13')]('['+[_0x314fc3['toUpperCase']()]+_0xccc5('0x29'),_0x593654);return new Promise(function(_0x347d7e,_0x139d48){var _0x2d2f56={'method':'GET','uri':_0x2eb0c5+_0xccc5('0x2a')+_0x593654[_0xccc5('0x25')]+'&'+_0x203dc3+'&'+_0xab7e74,'auth':_0x1202f8,'json':!![]};return rp(_0x2d2f56)['then'](function(_0x22c55e){if(_0x22c55e['result'][_0xccc5('0x10')]>0x0){_0x593654[_0xccc5('0x28')]=_0x22c55e['result'][0x0][_0xccc5('0x12')];logger[_0xccc5('0x13')]('['+[_0x314fc3[_0xccc5('0x14')]()]+'],\x20getEndUser\x20crm',_0x593654);_0x347d7e(_0x593654);}else{return createEndUser(_0x314fc3,_0x1202f8,_0x593654,_0x2eb0c5,_0x203dc3)['then'](function(_0x18ffca){logger[_0xccc5('0x13')]('['+[_0x314fc3[_0xccc5('0x14')]()]+_0xccc5('0x2b'),_0x18ffca);_0x347d7e(_0x18ffca);});}})['catch'](function(_0x308d96){logger['error']('['+[_0x314fc3['toUpperCase']()]+']',_0x308d96[_0xccc5('0x18')]);_0x139d48(_0x308d96[_0xccc5('0x18')]);});});};}function getCustomFields(_0x3f0733,_0xb6eed){var _0x12780e={};if(_0x3f0733[_0xccc5('0x10')]>0x0){_[_0xccc5('0x2c')](_0x3f0733,function(_0x377670){if(_['includes'](['string',_0xccc5('0x2d')],_0x377670['type'])&&_0x377670[_0xccc5('0x2e')]&&!_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670[_0xccc5('0x2e')]['toLowerCase']()]=_0x377670[_0xccc5('0x30')][_0xccc5('0x31')]();}else if(_[_0xccc5('0x32')](['string','picklist'],_0x377670['type'])&&_0x377670[_0xccc5('0x33')]&&_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0x377670[_0xccc5('0x30')][_0xccc5('0x31')]();}else if(_0x377670[_0xccc5('0x35')]===_0xccc5('0x36')&&_0x377670['variableName']&&_0x377670['idField']&&_0x377670['customField']){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0xb6eed[_0x377670[_0xccc5('0x37')]][_0xccc5('0x31')]();}else if(_0x377670[_0xccc5('0x35')]===_0xccc5('0x38')&&_0x377670['Variable']&&_0x377670[_0xccc5('0x39')][_0xccc5('0x3a')]&&_0x377670[_0xccc5('0x33')]&&_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0xb6eed[_0x377670[_0xccc5('0x39')][_0xccc5('0x3a')]['toLowerCase']()][_0xccc5('0x31')]();}});}return _0x12780e;}function getTicket(_0x5ecc0c,_0x575d69,_0x55018f,_0x5f4ecd,_0xb4f8bc,_0x529b61){return function(_0x2b25d6){logger[_0xccc5('0x13')]('['+[_0x5ecc0c['toUpperCase']()]+_0xccc5('0x3b'),_0x2b25d6);return new Promise(function(_0x566e6d,_0x28966b){var _0x1f4a19=_0x5ecc0c['toLowerCase']()==='outbound'?_0x2b25d6['userId']:_0x2b25d6[_0xccc5('0x28')];var _0x7a3ef9={'method':_0xccc5('0x23'),'uri':_0x55018f+_0xccc5('0x3c')+'?'+_0x529b61,'body':Object[_0xccc5('0x3d')]({},{'active':_0xccc5('0x1e'),'caller_id':_0x1f4a19,'assigned_to':_0x2b25d6[_0xccc5('0x3e')],'short_description':intUtil[_0xccc5('0x3f')](_0x5f4ecd[_0xccc5('0x40')],_0xb4f8bc,'\x20'),'description':intUtil[_0xccc5('0x3f')](_0x5f4ecd[_0xccc5('0x41')],_0xb4f8bc,'\x0a')},getCustomFields(_0x5f4ecd['Fields'],_0xb4f8bc)),'auth':_0x575d69,'json':!![]};return rp(_0x7a3ef9)['then'](function(_0x4af975){logger['info']('['+[_0x5ecc0c[_0xccc5('0x14')]()]+_0xccc5('0x42'),_0x4af975['result']);_0x2b25d6[_0xccc5('0x43')]=_0x4af975[_0xccc5('0xf')]['sys_id'];_0x2b25d6[_0xccc5('0x44')]=_0x4af975[_0xccc5('0xf')][_0xccc5('0x45')];logger[_0xccc5('0x13')]('['+[_0x5ecc0c[_0xccc5('0x14')]()]+_0xccc5('0x46'),_0x2b25d6);_0x566e6d(_0x2b25d6);})[_0xccc5('0x16')](function(_0x6dd873){logger['error']('['+[_0x5ecc0c[_0xccc5('0x14')]()]+']',_0x6dd873[_0xccc5('0x18')]);_0x28966b(_0x6dd873[_0xccc5('0x18')]);});});};}function createRemoteTag(_0x155976,_0x5ba029,_0x441f94,_0x53da05){return new Promise(function(_0x487fa,_0x59eada){var _0x17ab66={'method':'POST','uri':_0x441f94+_0xccc5('0x47')+'?'+_0x53da05,'body':{'short_description':_0x155976,'global':!![],'active':!![],'name':_0x155976},'auth':_0x5ba029,'json':!![]};return rp(_0x17ab66)[_0xccc5('0xe')](function(_0x119098){var _0x4acdc0=_0x119098[_0xccc5('0xf')]['sys_id'];_0x487fa(_0x4acdc0);});});}function getRemoteTag(_0x163253,_0x388189,_0x303167,_0x2c75b2,_0x1624df){return new Promise(function(_0x2bd7a6,_0x311205){var _0x1e2db4={'method':_0xccc5('0xc'),'uri':_0x303167+_0xccc5('0x47')+_0xccc5('0x48')+_0x163253+'&'+_0x2c75b2,'auth':_0x388189,'json':!![]};return rp(_0x1e2db4)[_0xccc5('0xe')](function(_0xa151b){if(_0xa151b[_0xccc5('0xf')]['length']>0x0){var _0x1ffec3=_0xa151b[_0xccc5('0xf')][0x0][_0xccc5('0x12')];_0x2bd7a6(_0x1ffec3);}else{return createRemoteTag(_0x163253,_0x388189,_0x303167,_0x2c75b2)[_0xccc5('0xe')](function(_0x4b4d3b){_0x2bd7a6(_0x4b4d3b);});}});});}function assignTagToIncident(_0x44a7e1,_0x47bfcd,_0x19c57a,_0x274e2c,_0x1eaa06){return new Promise(function(_0x186239,_0x5ce41b){var _0x47245c={'method':'POST','uri':_0x19c57a+'label_entry'+'?'+_0x1eaa06,'body':{'label':_0x44a7e1,'table':_0xccc5('0x3c'),'id_type':_0xccc5('0x49'),'table_key':_0x274e2c['ticketId'],'title':'Incident\x20-\x20'+_0x274e2c[_0xccc5('0x44')],'id_display':_0x274e2c['ticketNumber']},'auth':_0x47bfcd,'json':!![]};return rp(_0x47245c)['then'](function(_0x390db0){_0x186239();})['catch'](function(){_0x186239();});});}function manageTags(_0xeea54f,_0x4c890e,_0x2a0a08,_0x42c302,_0x435cbb,_0x582546,_0x198057){return new Promise(function(_0x432985,_0x1b7709){var _0xee82b7=[];_0x4c890e[_0xccc5('0x2c')](function(_0x346b10){_0xee82b7['push'](getRemoteTag(_0x346b10,_0x2a0a08,_0x42c302,_0x582546,_0x198057));});return Promise[_0xccc5('0x4a')](_0xee82b7)[_0xccc5('0xe')](function(_0x56429d){if(_0x56429d['length']){logger[_0xccc5('0x13')]('['+[_0xeea54f[_0xccc5('0x14')]()]+_0xccc5('0x4b'),_0x56429d);var _0x5c8e81=[];_0x56429d[_0xccc5('0x2c')](function(_0x5e2c75){_0x5c8e81[_0xccc5('0x4c')](assignTagToIncident(_0x5e2c75,_0x2a0a08,_0x42c302,_0x435cbb,_0x582546));});return Promise[_0xccc5('0x4a')](_0x5c8e81)[_0xccc5('0xe')](function(){_0x432985();})['catch'](function(){_0x432985();});}else{_0x432985();}});});}function getTags(_0x1d0e24,_0x42e5da,_0x159c72,_0x4ab57b,_0x2833f9,_0x4a3160){return function(_0x378d24){return new Promise(function(_0x2530be,_0x1867ba){var _0x4e59fe=[];var _0x1e7c0d=_0x4ab57b['Tags'];if(_0x1e7c0d&&_0x1e7c0d[_0xccc5('0x10')]>0x0){_0x4e59fe=_['map'](_0x1e7c0d,'name');}if(_0x4e59fe[_0xccc5('0x10')]>0x0){return manageTags(_0x1d0e24,_0x4e59fe,_0x42e5da,_0x159c72,_0x378d24,_0x2833f9,_0x4a3160)['then'](function(){_0x2530be(_0x378d24);});}else{_0x2530be(_0x378d24);}});};}function emit(_0x3c410b,_0x46cae8,_0x2eafd0){var _0xbad5b6=_0xccc5('0x4d')+_0xccc5('0x4e')+_0xccc5('0x4f')+_0xccc5('0x50');var _0x44e3b3={'uri':_0x3c410b+_0xccc5('0x51')+_0x2eafd0+_0xbad5b6};io['to'](util[_0xccc5('0x52')](_0xccc5('0x53'),_0x46cae8))[_0xccc5('0x54')](_0xccc5('0x55'),_0x44e3b3);}exports['cs']=function(_0x236121,_0xc6cf83,_0x1114b7,_0x550895,_0x5bb84b,_0x21b653,_0x142aea,_0xa8402){var _0x13a830={};var _0x25160d={'user':_0x21b653[_0xccc5('0x56')],'pass':_0x21b653[_0xccc5('0x57')]};var _0x3249b7=_0xccc5('0x58');var _0x1e3bf0='sysparm_display_value=true';_0x21b653[_0xccc5('0x59')]=intUtil[_0xccc5('0x5a')](_0x21b653[_0xccc5('0x59')]);_0x21b653[_0xccc5('0x5b')]=intUtil[_0xccc5('0x5a')](_0x21b653[_0xccc5('0x5b')]);var _0xb4840f=util['format'](_0xccc5('0x5c'),_0x21b653[_0xccc5('0x59')]);_0x13a830[_0xccc5('0x1a')]=!_[_0xccc5('0x5d')](_0x550895)?_0x550895[_0xccc5('0x5e')]:null;_0x13a830['adminEmail']=_0x21b653[_0xccc5('0x5e')];_0x13a830[_0xccc5('0x25')]=_0xa8402['toLowerCase']()===_0xccc5('0x5f')?_0xc6cf83[_0xccc5('0x60')]:_0xc6cf83[_0xccc5('0x61')];_0x13a830['callDirection']=_0xa8402===_0xccc5('0x62')||_0xa8402==='unmanaged'?_0xccc5('0x62'):_0xccc5('0x5f');var _0x401297=util['format'](_0xccc5('0x63'),_0x21b653[_0xccc5('0x5b')],_0xc6cf83[_0xccc5('0x64')],md5(_0xc6cf83[_0xccc5('0x64')]));if(_0x5bb84b&&_0x5bb84b[_0xccc5('0x65')]){logger['info']('[QUEUE]',_0xccc5('0x66'));_0xc6cf83[_0xccc5('0x67')]=_0x401297;}else if(_0x142aea&&_0x142aea[_0xccc5('0x68')]&&_0x142aea[_0xccc5('0x68')]!=='none'){logger[_0xccc5('0x13')]('[OUTBOUND]',_0xccc5('0x66'));_0xc6cf83[_0xccc5('0x67')]=_0x401297;}else{_0xc6cf83[_0xccc5('0x67')]='';}return getAdminUser(_0xa8402,_0x25160d,_0x13a830,_0xb4840f,_0x1e3bf0,_0x3249b7)[_0xccc5('0xe')](getUser(_0xa8402,_0x25160d,_0xb4840f,_0x1e3bf0,_0x3249b7))['then'](getEndUser(_0xa8402,_0x25160d,_0xb4840f,_0x1e3bf0,_0x3249b7))['then'](getTicket(_0xa8402,_0x25160d,_0xb4840f,_0x1114b7,_0xc6cf83,_0x1e3bf0))[_0xccc5('0xe')](function(_0x80eab){logger[_0xccc5('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x80eab[_0xccc5('0x43')]));logger['info'](util[_0xccc5('0x52')](_0xccc5('0x69'),_0xa8402));if(_0xa8402!==_0xccc5('0x6a')){logger[_0xccc5('0x13')]('['+[_0xa8402[_0xccc5('0x14')]()]+']',_0xccc5('0x6b'));emit(_0x21b653[_0xccc5('0x59')],_0x550895['name'],_0x80eab[_0xccc5('0x43')]);}})[_0xccc5('0x16')](function(_0x3e73c4){logger[_0xccc5('0x17')]('['+[_0xa8402[_0xccc5('0x14')]()]+_0xccc5('0x6c'),util[_0xccc5('0x6d')](_0x3e73c4,{'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 705e461..6e42b72 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 _0x7fcf=['Contacts','parent_name','name','length','forEach','variableName','JSON','format','Basic\x20%s','apiKey','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','value','info','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','customField','nameField','toLowerCase','content','string','idField','custom_fields','push','toString','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','Outbound','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','Inbound','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','replace','parent_type'];(function(_0x3f4c63,_0xfcbd51){var _0x3c4ef7=function(_0x305a81){while(--_0x305a81){_0x3f4c63['push'](_0x3f4c63['shift']());}};_0x3c4ef7(++_0xfcbd51);}(_0x7fcf,0x159));var _0xf7fc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7fcf[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xf7fc('0x0'));var rp=require(_0xf7fc('0x1'));var BPromise=require(_0xf7fc('0x2'));var md5=require(_0xf7fc('0x3'));var util=require(_0xf7fc('0x4'));var Redis=require(_0xf7fc('0x5'));var intUtil=require(_0xf7fc('0x6'));var config=require(_0xf7fc('0x7'));var logger=require(_0xf7fc('0x8'))('sugarcrm');config[_0xf7fc('0x9')]=_['defaults'](config[_0xf7fc('0x9')],{'host':_0xf7fc('0xa'),'port':0x18eb});var io=require(_0xf7fc('0xb'))(new Redis(config[_0xf7fc('0x9')]));var def={'method':_0xf7fc('0xc'),'json':!![]};function emit(_0x800b36,_0x259249,_0x667aec){io['to'](_0x800b36)[_0xf7fc('0xd')](_0x259249,_0x667aec);}function getTicket(_0x5a7df7,_0x5c6edc,_0x1602a3,_0x5a53c4,_0x91c95a,_0x394a6d,_0x373ab8,_0xc2ee89){logger['info'](_0xf7fc('0xe'));var _0x2c4b22=new Date();var _0x1e8de0=[{'name':'name','value':intUtil[_0xf7fc('0xf')](_0x5a53c4[_0xf7fc('0x10')],_0x91c95a,'\x20')},{'name':_0xf7fc('0x11'),'value':_0x5c6edc['id']},{'name':_0xf7fc('0x12'),'value':_0x5c6edc['id']},{'name':_0xf7fc('0x13'),'value':intUtil[_0xf7fc('0xf')](_0x5a53c4[_0xf7fc('0x14')],_0x91c95a,'\x0a')},{'name':_0xf7fc('0x15'),'value':_0x2c4b22['toISOString']()['slice'](0x0,0x13)[_0xf7fc('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1602a3['id']},{'name':_0xf7fc('0x17'),'value':_0xf7fc('0x18')},{'name':_0xf7fc('0x19'),'value':_0x1602a3[_0xf7fc('0x1a')]},{'name':'direction','value':_0xc2ee89}];if(_0x394a6d[_0xf7fc('0x1b')]){_[_0xf7fc('0x1c')](_0x394a6d,function(_0x236e22){if(_0x91c95a[_0x236e22[_0xf7fc('0x1d')]]){_0x1e8de0['push']({'name':_0x236e22['idField'],'value':_0x91c95a[_0x236e22[_0xf7fc('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xf7fc('0x1e'),'response_type':_0xf7fc('0x1e'),'rest_data':JSON['stringify']({'session':_0x373ab8['id'],'module_name':'Calls','name_value_list':_0x1e8de0})}});}function getAuth(_0x279a93){return util[_0xf7fc('0x1f')](_0xf7fc('0x20'),new Buffer(_0x279a93[_0xf7fc('0x21')]+':X')['toString']('base64'));}function getServerInfo(_0x3f3374){return request({'form':{'method':_0xf7fc('0x22'),'input_type':_0xf7fc('0x1e'),'response_type':_0xf7fc('0x1e'),'rest_data':JSON[_0xf7fc('0x23')]({'session':_0x3f3374['id']})}});}function getUser(_0x41d2e,_0x5a96b0,_0x45b9fa){if(!_[_0xf7fc('0x24')](_0x5a96b0)){logger['info']('Getting\x20agent\x20with\x20name',_0x5a96b0);return request({'form':{'method':_0xf7fc('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf7fc('0x23')]({'session':_0x45b9fa['id'],'module_name':_0xf7fc('0x26'),'query':util['format'](_0xf7fc('0x27'),_0x5a96b0),'order_by':'','offset':'0','select_fields':['id',_0xf7fc('0x1a'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x421877){if(_0x421877[_0xf7fc('0x28')][_0xf7fc('0x1b')]){var _0x3d1436=_[_0xf7fc('0x29')](_0x421877['entry_list'],function(_0x3d3a86){return _0x3d3a86[_0xf7fc('0x2a')]['user_name'][_0xf7fc('0x2b')]===_0x5a96b0;});if(_0x3d1436){logger[_0xf7fc('0x2c')](_0xf7fc('0x2d'));return BPromise[_0xf7fc('0x2e')]({'id':_0x3d1436[_0xf7fc('0x2a')]['id'][_0xf7fc('0x2b')],'name':_0x3d1436[_0xf7fc('0x2a')][_0xf7fc('0x1a')][_0xf7fc('0x2b')]});}}logger[_0xf7fc('0x2c')](_0xf7fc('0x2f'));return BPromise['resolve']({'id':_0x45b9fa['name_value_list'][_0xf7fc('0x30')]['value'],'name':_0x45b9fa['name_value_list'][_0xf7fc('0x31')][_0xf7fc('0x2b')]});});}else{logger[_0xf7fc('0x2c')](_0xf7fc('0x32'));return BPromise[_0xf7fc('0x2e')]({'id':_0x45b9fa[_0xf7fc('0x2a')][_0xf7fc('0x30')]['value'],'name':_0x45b9fa[_0xf7fc('0x2a')][_0xf7fc('0x31')]['value']});}}function getEndUser(_0x380a5f,_0x2fe3c3,_0x39530a,_0x44b540){logger[_0xf7fc('0x2c')](_0xf7fc('0x33'),_0x39530a);return request({'form':{'method':_0xf7fc('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf7fc('0x23')]({'session':_0x44b540['id'],'module_name':_0xf7fc('0x18'),'query':util[_0xf7fc('0x1f')](_0xf7fc('0x34'),_0x39530a),'order_by':'','offset':'0','select_fields':['id',_0xf7fc('0x1a'),_0xf7fc('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7fc('0x36')](function(_0x5ae3f4){if(_0x5ae3f4['entry_list']['length']){var _0x313b4a=_[_0xf7fc('0x29')](_0x5ae3f4['entry_list'],function(_0xc629eb){return _0xc629eb[_0xf7fc('0x2a')]['phone_home'][_0xf7fc('0x2b')]===_0x39530a;});if(_0x313b4a){logger[_0xf7fc('0x2c')](_0xf7fc('0x37'));return BPromise[_0xf7fc('0x2e')]({'id':_0x313b4a[_0xf7fc('0x2a')]['id'][_0xf7fc('0x2b')],'name':_0x313b4a[_0xf7fc('0x2a')][_0xf7fc('0x1a')][_0xf7fc('0x2b')],'phone':_0x313b4a[_0xf7fc('0x2a')]['phone_home'][_0xf7fc('0x2b')]});}}else{logger[_0xf7fc('0x2c')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xf7fc('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf7fc('0x23')]({'session':_0x44b540['id'],'module_name':_0xf7fc('0x18'),'name_value_list':[{'name':_0xf7fc('0x39'),'value':_0x2fe3c3!==_0xf7fc('0x3a')?_0x2fe3c3:util[_0xf7fc('0x1f')](_0xf7fc('0x3b'),_0x39530a)},{'name':_0xf7fc('0x35'),'value':_0x39530a}]})}})['then'](function(_0x3d95a3){logger[_0xf7fc('0x2c')]('Enduser\x20created.');return BPromise[_0xf7fc('0x2e')]({'id':_0x3d95a3['id'],'name':_0x3d95a3[_0xf7fc('0x28')][_0xf7fc('0x39')][_0xf7fc('0x2b')],'phone':_0x3d95a3[_0xf7fc('0x28')][_0xf7fc('0x35')][_0xf7fc('0x2b')]});});}});}function request(_0x28f5b5){logger[_0xf7fc('0x3c')](_0xf7fc('0x3d'),JSON['stringify'](_0x28f5b5));return rp(_[_0xf7fc('0x3e')](def,_0x28f5b5));}function getTags(_0x5766c2,_0x849978){var _0x3b315b=[];if(_0x5766c2&&_0x5766c2['length']>0x0){_0x3b315b=_[_0xf7fc('0x3f')](_0x5766c2,_0x849978);}return _0x3b315b;}function getCustomFields(_0x50bd19,_0x5e40c0){var _0x5829eb=[];var _0x1607af={'custom_fields':[]};if(_0x50bd19[_0xf7fc('0x1b')]>0x0){_[_0xf7fc('0x1c')](_0x50bd19,function(_0x4a9bbf){if(_0x4a9bbf[_0xf7fc('0x40')]==='string'&&_0x4a9bbf['nameField']&&!_0x4a9bbf[_0xf7fc('0x41')]){_0x1607af[_0x4a9bbf[_0xf7fc('0x42')][_0xf7fc('0x43')]()]=_0x4a9bbf[_0xf7fc('0x44')]['toString']();}else if(_0x4a9bbf[_0xf7fc('0x40')]===_0xf7fc('0x45')&&_0x4a9bbf[_0xf7fc('0x46')]&&_0x4a9bbf[_0xf7fc('0x41')]){_0x1607af[_0xf7fc('0x47')][_0xf7fc('0x48')]({'id':_0x4a9bbf['idField'],'value':_0x4a9bbf['content'][_0xf7fc('0x49')]()});}else if(_0x4a9bbf['type']==='variable'&&_0x4a9bbf[_0xf7fc('0x1d')]&&_0x4a9bbf[_0xf7fc('0x46')]&&_0x4a9bbf[_0xf7fc('0x41')]){_0x5e40c0[_0x4a9bbf['variableName']]&&_0x1607af['custom_fields'][_0xf7fc('0x48')]({'id':_0x4a9bbf['idField'],'value':_0x5e40c0[_0x4a9bbf[_0xf7fc('0x1d')]][_0xf7fc('0x49')]()});}else if(_0x4a9bbf['type']===_0xf7fc('0x4a')&&_0x4a9bbf[_0xf7fc('0x4b')]&&_0x4a9bbf[_0xf7fc('0x4b')][_0xf7fc('0x1a')]&&_0x4a9bbf['idField']&&_0x4a9bbf[_0xf7fc('0x41')]){_0x5e40c0[_0x4a9bbf['Variable'][_0xf7fc('0x1a')]['toLowerCase']()]&&_0x1607af[_0xf7fc('0x47')][_0xf7fc('0x48')]({'id':_0x4a9bbf[_0xf7fc('0x46')],'value':_0x5e40c0[_0x4a9bbf['Variable'][_0xf7fc('0x1a')][_0xf7fc('0x43')]()]['toString']()});}});}return _0x1607af;}function getConnection(_0x4edf14){return request({'method':_0xf7fc('0xc'),'form':{'method':_0xf7fc('0x4c'),'input_type':'JSON','response_type':_0xf7fc('0x1e'),'rest_data':JSON[_0xf7fc('0x23')]({'user_auth':{'user_name':_0x4edf14['username'],'password':_0x4edf14['password'],'encryption':_0xf7fc('0x4d')},'application':_0xf7fc('0x4e')})}})[_0xf7fc('0x36')](function(_0x26cc1d){var _0x2709a5=_0x26cc1d;if(_0x2709a5['id']){def[_0xf7fc('0x4f')]=_0x2709a5['id'];return BPromise[_0xf7fc('0x2e')](_0x2709a5);}else{throw new Error(util[_0xf7fc('0x1f')](_0xf7fc('0x50'),_0x4edf14['id']));}});}function setRelationship(_0x42463e,_0x166f53,_0x55cc8b,_0x182fb5){return request({'form':{'method':_0xf7fc('0x51'),'input_type':_0xf7fc('0x1e'),'response_type':_0xf7fc('0x1e'),'rest_data':JSON[_0xf7fc('0x23')]({'session':_0x42463e['id'],'module_name':_0xf7fc('0x52'),'module_id':_0x55cc8b['id'],'link_field_name':_0x182fb5,'related_ids':[_0x166f53['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf7fc('0x53')]=function(_0x848cfe,_0x22c221,_0x47d184,_0x20ae0c,_0xf8d7d8,_0x16ca43){var _0x5bfe37,_0x1abb56,_0x3b4979,_0x3497cd;_0x16ca43[_0xf7fc('0x54')]=intUtil[_0xf7fc('0x55')](_0x16ca43[_0xf7fc('0x54')]);_0x16ca43['serverUrl']=intUtil[_0xf7fc('0x55')](_0x16ca43['serverUrl']);def['uri']=util['format'](_0xf7fc('0x56'),_0x16ca43[_0xf7fc('0x54')]);if(_0xf8d7d8&&_0xf8d7d8[_0xf7fc('0x57')]){logger['info'](_0xf7fc('0x58'),_0xf7fc('0x59'));_0x22c221[_0xf7fc('0x5a')]=util['format'](_0xf7fc('0x5b'),_0x16ca43[_0xf7fc('0x5c')],_0x22c221['uniqueid'],md5(_0x22c221[_0xf7fc('0x5d')]));}else{_0x22c221[_0xf7fc('0x5a')]='';}return getConnection(_0x16ca43)['then'](function(_0x3451f8){_0x3497cd=_0x3451f8;return getUser(_0x16ca43,_0x20ae0c[_0xf7fc('0x1a')],_0x3497cd);})[_0xf7fc('0x36')](function(_0x1c5d8a){_0x5bfe37=_0x1c5d8a;logger[_0xf7fc('0x2c')](_0xf7fc('0x5e'),_0x5bfe37['id']);return getEndUser(_0x16ca43,_0x22c221[_0xf7fc('0x5f')],_0x22c221[_0xf7fc('0x60')],_0x3497cd);})[_0xf7fc('0x36')](function(_0x50d757){_0x1abb56=_0x50d757;logger['info'](_0xf7fc('0x61'),_0x1abb56['id']);return getTicket(_0x16ca43,_0x5bfe37,_0x1abb56,_0x47d184,_0x22c221,_0x47d184['Fields'],_0x3497cd,'Inbound');})[_0xf7fc('0x36')](function(_0x157aa6){_0x3b4979=_0x157aa6;logger[_0xf7fc('0x2c')](_0xf7fc('0x62'));logger['info'](_0xf7fc('0x63'),_0x3b4979['id']);return setRelationship(_0x3497cd,_0x5bfe37,_0x3b4979,_0xf7fc('0x64'));})[_0xf7fc('0x36')](function(){return setRelationship(_0x3497cd,_0x1abb56,_0x3b4979,'contacts');})[_0xf7fc('0x36')](function(){return getServerInfo(_0x3497cd);})[_0xf7fc('0x36')](function(_0x2bd97c){var _0x1110b8=parseInt(_0x2bd97c[_0xf7fc('0x65')][_0xf7fc('0x66')](0x0));var _0x26a8ec=util[_0xf7fc('0x1f')](_0xf7fc('0x67'),_0x16ca43[_0xf7fc('0x54')],_0x3b4979['id']);if(_0x1110b8>0x6){_0x26a8ec=util[_0xf7fc('0x1f')](_0xf7fc('0x68'),_0x16ca43[_0xf7fc('0x54')],_0x3b4979['id']);}logger[_0xf7fc('0x2c')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf7fc('0x1f')](_0xf7fc('0x69'),_0x20ae0c[_0xf7fc('0x1a')]),'trigger:browser:url',{'uri':_0x26a8ec});})[_0xf7fc('0x6a')](function(_0x411262){logger[_0xf7fc('0x6b')](_0xf7fc('0x58'),JSON[_0xf7fc('0x23')](_0x411262));});};exports[_0xf7fc('0x6c')]=function(_0x47d368,_0x4e7ddc,_0x2d8d23,_0x4b140e,_0x35e6b4,_0x5a1c07,_0x458ee7){var _0x1b9f1e,_0x1c0326,_0x47e77f,_0x2369bc;_0x5a1c07['remoteUri']=intUtil[_0xf7fc('0x55')](_0x5a1c07[_0xf7fc('0x54')]);_0x5a1c07['serverUrl']=intUtil['stripTrailingSlash'](_0x5a1c07[_0xf7fc('0x5c')]);def[_0xf7fc('0x6d')]=util[_0xf7fc('0x1f')](_0xf7fc('0x56'),_0x5a1c07[_0xf7fc('0x54')]);if(_0x458ee7&&_0x458ee7[_0xf7fc('0x6e')]&&_0x458ee7[_0xf7fc('0x6e')]!==_0xf7fc('0x6f')){logger[_0xf7fc('0x2c')](_0xf7fc('0x70'),'Recording\x20is\x20enabled!');_0x4e7ddc['recordingURL']=util[_0xf7fc('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a1c07[_0xf7fc('0x5c')],_0x4e7ddc[_0xf7fc('0x5d')],md5(_0x4e7ddc['uniqueid']));}return getConnection(_0x5a1c07)[_0xf7fc('0x36')](function(_0x24ee73){_0x2369bc=_0x24ee73;return getUser(_0x5a1c07,_0x4b140e[_0xf7fc('0x1a')],_0x2369bc);})[_0xf7fc('0x36')](function(_0x4ec6cf){_0x1b9f1e=_0x4ec6cf;logger[_0xf7fc('0x2c')]('The\x20User\x20ID\x20is:',_0x1b9f1e['id']);return getEndUser(_0x5a1c07,_0x4e7ddc[_0xf7fc('0x71')],_0x4e7ddc['destcalleridnum'],_0x2369bc);})[_0xf7fc('0x36')](function(_0x3366eb){_0x1c0326=_0x3366eb;logger[_0xf7fc('0x2c')]('The\x20Enduser\x20ID\x20is:',_0x1c0326['id']);return getTicket(_0x5a1c07,_0x1b9f1e,_0x1c0326,_0x2d8d23,_0x4e7ddc,_0x2d8d23[_0xf7fc('0x72')],_0x2369bc,_0xf7fc('0x73'));})['then'](function(_0x5ab513){_0x47e77f=_0x5ab513;logger[_0xf7fc('0x2c')](_0xf7fc('0x62'));logger['info'](_0xf7fc('0x63'),_0x47e77f['id']);return setRelationship(_0x2369bc,_0x1b9f1e,_0x47e77f,_0xf7fc('0x64'));})[_0xf7fc('0x36')](function(){return setRelationship(_0x2369bc,_0x1c0326,_0x47e77f,_0xf7fc('0x74'));})[_0xf7fc('0x36')](function(){return getServerInfo(_0x2369bc);})[_0xf7fc('0x36')](function(_0x3a8270){var _0x1da282=parseInt(_0x3a8270[_0xf7fc('0x65')]['charAt'](0x0));var _0x5cbb1e=util[_0xf7fc('0x1f')](_0xf7fc('0x67'),_0x5a1c07[_0xf7fc('0x54')],_0x47e77f['id']);if(_0x1da282>0x6){_0x5cbb1e=util[_0xf7fc('0x1f')](_0xf7fc('0x68'),_0x5a1c07[_0xf7fc('0x54')],_0x47e77f['id']);}logger[_0xf7fc('0x2c')]('[OUTBOUND]',_0xf7fc('0x75'));emit(util[_0xf7fc('0x1f')]('user:%s',_0x4b140e[_0xf7fc('0x1a')]),_0xf7fc('0x76'),{'uri':_0x5cbb1e});})[_0xf7fc('0x6a')](function(_0x2e1d12){logger[_0xf7fc('0x6b')]('[OUTBOUND]',JSON['stringify'](_0x2e1d12));});};exports[_0xf7fc('0x77')]=function(_0x5b6bcb,_0x2aae74,_0x1a266d,_0x39b7f6,_0x885504,_0x5427d5){var _0x5d49ec,_0x32ef63,_0x117268,_0x191c52;_0x5427d5[_0xf7fc('0x54')]=intUtil['stripTrailingSlash'](_0x5427d5[_0xf7fc('0x54')]);_0x5427d5[_0xf7fc('0x5c')]=intUtil[_0xf7fc('0x55')](_0x5427d5[_0xf7fc('0x5c')]);def[_0xf7fc('0x6d')]=util[_0xf7fc('0x1f')](_0xf7fc('0x56'),_0x5427d5[_0xf7fc('0x54')]);if(_0x885504&&_0x885504[_0xf7fc('0x57')]){logger[_0xf7fc('0x2c')]('['+_0x2aae74[_0xf7fc('0x78')][_0xf7fc('0x79')]()+']',_0xf7fc('0x59'));_0x2aae74[_0xf7fc('0x5a')]=util['format'](_0xf7fc('0x5b'),_0x5427d5[_0xf7fc('0x5c')],_0x2aae74[_0xf7fc('0x5d')],md5(_0x2aae74['uniqueid']));}else{_0x2aae74[_0xf7fc('0x5a')]='';}return getConnection(_0x5427d5)[_0xf7fc('0x36')](function(_0xa97f19){_0x191c52=_0xa97f19;if(!_[_0xf7fc('0x24')](_0x39b7f6)){return getUser(_0x5427d5,_0x39b7f6['name'],_0x191c52);}else{return getUser(_0x5427d5,null,_0x191c52);}})[_0xf7fc('0x36')](function(_0x4577d0){_0x5d49ec=_0x4577d0;logger['info'](_0xf7fc('0x5e'),_0x5d49ec['id']);return getEndUser(_0x5427d5,_0x2aae74[_0xf7fc('0x5f')],_0x2aae74[_0xf7fc('0x60')],_0x191c52);})[_0xf7fc('0x36')](function(_0x108675){_0x32ef63=_0x108675;logger[_0xf7fc('0x2c')]('The\x20Enduser\x20ID\x20is:',_0x32ef63['id']);return getTicket(_0x5427d5,_0x5d49ec,_0x32ef63,_0x1a266d,_0x2aae74,_0x1a266d['Fields'],_0x191c52,_0xf7fc('0x7a'));})[_0xf7fc('0x36')](function(_0x57c20c){_0x117268=_0x57c20c;logger['info'](_0xf7fc('0x62'));logger[_0xf7fc('0x2c')](_0xf7fc('0x63'),_0x117268['id']);return setRelationship(_0x191c52,_0x5d49ec,_0x117268,_0xf7fc('0x64'));})[_0xf7fc('0x36')](function(){return setRelationship(_0x191c52,_0x32ef63,_0x117268,_0xf7fc('0x74'));})['then'](function(){return getServerInfo(_0x191c52);})[_0xf7fc('0x6a')](function(_0x584db8){logger[_0xf7fc('0x6b')]('['+_0x2aae74[_0xf7fc('0x78')]['toUpperCase']()+']',JSON[_0xf7fc('0x23')](_0x584db8));});}; \ No newline at end of file +var _0xa51e=['JSON','Calls','format','Basic\x20%s','apiKey','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','PLAIN','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','calleridnum','The\x20Ticket\x20ID\x20is:','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','variableName','push','idField'];(function(_0xabcbf0,_0x1046df){var _0x292f2f=function(_0x3badf9){while(--_0x3badf9){_0xabcbf0['push'](_0xabcbf0['shift']());}};_0x292f2f(++_0x1046df);}(_0xa51e,0xcb));var _0xea51=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xa51e[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xea51('0x0'));var md5=require(_0xea51('0x1'));var util=require(_0xea51('0x2'));var Redis=require(_0xea51('0x3'));var intUtil=require(_0xea51('0x4'));var config=require(_0xea51('0x5'));var logger=require(_0xea51('0x6'))('sugarcrm');config['redis']=_[_0xea51('0x7')](config[_0xea51('0x8')],{'host':_0xea51('0x9'),'port':0x18eb});var io=require(_0xea51('0xa'))(new Redis(config['redis']));var def={'method':_0xea51('0xb'),'json':!![]};function emit(_0x2fbef6,_0x1ce0e5,_0xbdec84){io['to'](_0x2fbef6)['emit'](_0x1ce0e5,_0xbdec84);}function getTicket(_0x129eb8,_0xc34529,_0xadb91c,_0x49e128,_0x171ad8,_0x5ec47f,_0x2e4130,_0x3ee1f7){logger[_0xea51('0xc')](_0xea51('0xd'));var _0x3244b8=new Date();var _0xe23fb0=[{'name':'name','value':intUtil['getString'](_0x49e128[_0xea51('0xe')],_0x171ad8,'\x20')},{'name':_0xea51('0xf'),'value':_0xc34529['id']},{'name':_0xea51('0x10'),'value':_0xc34529['id']},{'name':_0xea51('0x11'),'value':intUtil[_0xea51('0x12')](_0x49e128['Descriptions'],_0x171ad8,'\x0a')},{'name':_0xea51('0x13'),'value':_0x3244b8['toISOString']()[_0xea51('0x14')](0x0,0x13)[_0xea51('0x15')]('T','\x20')},{'name':_0xea51('0x16'),'value':'0'},{'name':_0xea51('0x17'),'value':'15'},{'name':_0xea51('0x18'),'value':_0xadb91c['id']},{'name':_0xea51('0x19'),'value':_0xea51('0x1a')},{'name':_0xea51('0x1b'),'value':_0xadb91c[_0xea51('0x1c')]},{'name':'direction','value':_0x3ee1f7}];if(_0x5ec47f[_0xea51('0x1d')]){_['forEach'](_0x5ec47f,function(_0x1c3fb8){if(_0x171ad8[_0x1c3fb8[_0xea51('0x1e')]]){_0xe23fb0[_0xea51('0x1f')]({'name':_0x1c3fb8[_0xea51('0x20')],'value':_0x171ad8[_0x1c3fb8[_0xea51('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON['stringify']({'session':_0x2e4130['id'],'module_name':_0xea51('0x22'),'name_value_list':_0xe23fb0})}});}function getAuth(_0xbb62bc){return util[_0xea51('0x23')](_0xea51('0x24'),new Buffer(_0xbb62bc[_0xea51('0x25')]+':X')['toString']('base64'));}function getServerInfo(_0x505243){return request({'form':{'method':_0xea51('0x26'),'input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x505243['id']})}});}function getUser(_0x5880b8,_0x5ec6a7,_0x462914){if(!_[_0xea51('0x28')](_0x5ec6a7)){logger[_0xea51('0xc')](_0xea51('0x29'),_0x5ec6a7);return request({'form':{'method':'get_entry_list','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON['stringify']({'session':_0x462914['id'],'module_name':'Employees','query':util[_0xea51('0x23')](_0xea51('0x2a'),_0x5ec6a7),'order_by':'','offset':'0','select_fields':['id',_0xea51('0x1c'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x517325){if(_0x517325[_0xea51('0x2b')]['length']){var _0x1be63b=_['find'](_0x517325['entry_list'],function(_0x31f49b){return _0x31f49b[_0xea51('0x2c')]['user_name']['value']===_0x5ec6a7;});if(_0x1be63b){logger[_0xea51('0xc')](_0xea51('0x2d'));return BPromise['resolve']({'id':_0x1be63b['name_value_list']['id']['value'],'name':_0x1be63b['name_value_list'][_0xea51('0x1c')][_0xea51('0x2e')]});}}logger[_0xea51('0xc')](_0xea51('0x2f'));return BPromise[_0xea51('0x30')]({'id':_0x462914[_0xea51('0x2c')][_0xea51('0x31')][_0xea51('0x2e')],'name':_0x462914['name_value_list']['user_name'][_0xea51('0x2e')]});});}else{logger[_0xea51('0xc')](_0xea51('0x32'));return BPromise[_0xea51('0x30')]({'id':_0x462914['name_value_list'][_0xea51('0x31')][_0xea51('0x2e')],'name':_0x462914['name_value_list'][_0xea51('0x33')][_0xea51('0x2e')]});}}function getEndUser(_0x1235c0,_0x59d22c,_0x4148f5,_0x42cbdd){logger[_0xea51('0xc')]('Searching\x20enduser\x20with\x20phone',_0x4148f5);return request({'form':{'method':'get_entry_list','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x42cbdd['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x4148f5),'order_by':'','offset':'0','select_fields':['id',_0xea51('0x1c'),_0xea51('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea51('0x35')](function(_0x222dc9){if(_0x222dc9[_0xea51('0x2b')][_0xea51('0x1d')]){var _0x303ae8=_[_0xea51('0x36')](_0x222dc9[_0xea51('0x2b')],function(_0x263b1b){return _0x263b1b[_0xea51('0x2c')][_0xea51('0x34')][_0xea51('0x2e')]===_0x4148f5;});if(_0x303ae8){logger[_0xea51('0xc')](_0xea51('0x37'));return BPromise[_0xea51('0x30')]({'id':_0x303ae8[_0xea51('0x2c')]['id'][_0xea51('0x2e')],'name':_0x303ae8['name_value_list']['name'][_0xea51('0x2e')],'phone':_0x303ae8[_0xea51('0x2c')]['phone_home']['value']});}}else{logger[_0xea51('0xc')](_0xea51('0x38'));return request({'form':{'method':_0xea51('0x39'),'input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x42cbdd['id'],'module_name':_0xea51('0x1a'),'name_value_list':[{'name':_0xea51('0x3a'),'value':_0x59d22c!==_0xea51('0x3b')?_0x59d22c:util[_0xea51('0x23')](_0xea51('0x3c'),_0x4148f5)},{'name':_0xea51('0x34'),'value':_0x4148f5}]})}})[_0xea51('0x35')](function(_0x204a4f){logger['info']('Enduser\x20created.');return BPromise[_0xea51('0x30')]({'id':_0x204a4f['id'],'name':_0x204a4f[_0xea51('0x2b')][_0xea51('0x3a')][_0xea51('0x2e')],'phone':_0x204a4f[_0xea51('0x2b')][_0xea51('0x34')]['value']});});}});}function request(_0x32ebd6){logger[_0xea51('0x3d')](_0xea51('0x3e'),JSON[_0xea51('0x27')](_0x32ebd6));return rp(_[_0xea51('0x3f')](def,_0x32ebd6));}function getTags(_0x382286,_0x431d13){var _0xb6ac36=[];if(_0x382286&&_0x382286['length']>0x0){_0xb6ac36=_[_0xea51('0x40')](_0x382286,_0x431d13);}return _0xb6ac36;}function getCustomFields(_0x3a5441,_0x6a71ab){var _0x20e58e=[];var _0x43c532={'custom_fields':[]};if(_0x3a5441['length']>0x0){_[_0xea51('0x41')](_0x3a5441,function(_0x3e57e2){if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x43')&&_0x3e57e2[_0xea51('0x44')]&&!_0x3e57e2[_0xea51('0x45')]){_0x43c532[_0x3e57e2[_0xea51('0x44')][_0xea51('0x46')]()]=_0x3e57e2['content'][_0xea51('0x47')]();}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x43')&&_0x3e57e2['idField']&&_0x3e57e2[_0xea51('0x45')]){_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2['idField'],'value':_0x3e57e2[_0xea51('0x49')][_0xea51('0x47')]()});}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x4a')&&_0x3e57e2[_0xea51('0x1e')]&&_0x3e57e2[_0xea51('0x20')]&&_0x3e57e2[_0xea51('0x45')]){_0x6a71ab[_0x3e57e2[_0xea51('0x1e')]]&&_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2[_0xea51('0x20')],'value':_0x6a71ab[_0x3e57e2['variableName']][_0xea51('0x47')]()});}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x4b')&&_0x3e57e2['Variable']&&_0x3e57e2[_0xea51('0x4c')][_0xea51('0x1c')]&&_0x3e57e2['idField']&&_0x3e57e2[_0xea51('0x45')]){_0x6a71ab[_0x3e57e2[_0xea51('0x4c')][_0xea51('0x1c')][_0xea51('0x46')]()]&&_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2['idField'],'value':_0x6a71ab[_0x3e57e2[_0xea51('0x4c')]['name'][_0xea51('0x46')]()]['toString']()});}});}return _0x43c532;}function getConnection(_0x4eac3e){return request({'method':_0xea51('0xb'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xea51('0x27')]({'user_auth':{'user_name':_0x4eac3e['username'],'password':_0x4eac3e['password'],'encryption':_0xea51('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xea51('0x35')](function(_0xe85fc1){var _0x4084ca=_0xe85fc1;if(_0x4084ca['id']){def['sessionID']=_0x4084ca['id'];return BPromise['resolve'](_0x4084ca);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x4eac3e['id']));}});}function setRelationship(_0x29220f,_0x5c614b,_0x4c5fa0,_0x282cfa){return request({'form':{'method':_0xea51('0x4e'),'input_type':'JSON','response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x29220f['id'],'module_name':_0xea51('0x22'),'module_id':_0x4c5fa0['id'],'link_field_name':_0x282cfa,'related_ids':[_0x5c614b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xea51('0x4f')]=function(_0x82b8a5,_0x274bb7,_0x4f8b53,_0x124d21,_0xd1cd44,_0x425d4c){var _0x38c8cf,_0xe3f96a,_0x2cc531,_0xd81bb5;_0x425d4c[_0xea51('0x50')]=intUtil[_0xea51('0x51')](_0x425d4c['remoteUri']);_0x425d4c[_0xea51('0x52')]=intUtil['stripTrailingSlash'](_0x425d4c[_0xea51('0x52')]);def['uri']=util[_0xea51('0x23')](_0xea51('0x53'),_0x425d4c[_0xea51('0x50')]);if(_0xd1cd44&&_0xd1cd44[_0xea51('0x54')]){logger[_0xea51('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x274bb7[_0xea51('0x55')]=util['format'](_0xea51('0x56'),_0x425d4c[_0xea51('0x52')],_0x274bb7[_0xea51('0x57')],md5(_0x274bb7[_0xea51('0x57')]));}else{_0x274bb7[_0xea51('0x55')]='';}return getConnection(_0x425d4c)[_0xea51('0x35')](function(_0x2c4b45){_0xd81bb5=_0x2c4b45;return getUser(_0x425d4c,_0x124d21[_0xea51('0x1c')],_0xd81bb5);})['then'](function(_0x7a23f5){_0x38c8cf=_0x7a23f5;logger[_0xea51('0xc')](_0xea51('0x58'),_0x38c8cf['id']);return getEndUser(_0x425d4c,_0x274bb7[_0xea51('0x59')],_0x274bb7['calleridnum'],_0xd81bb5);})[_0xea51('0x35')](function(_0x48cb7c){_0xe3f96a=_0x48cb7c;logger['info']('The\x20Enduser\x20ID\x20is:',_0xe3f96a['id']);return getTicket(_0x425d4c,_0x38c8cf,_0xe3f96a,_0x4f8b53,_0x274bb7,_0x4f8b53[_0xea51('0x5a')],_0xd81bb5,_0xea51('0x5b'));})[_0xea51('0x35')](function(_0x4dbc53){_0x2cc531=_0x4dbc53;logger[_0xea51('0xc')](_0xea51('0x5c'));logger[_0xea51('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2cc531['id']);return setRelationship(_0xd81bb5,_0x38c8cf,_0x2cc531,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0xd81bb5,_0xe3f96a,_0x2cc531,_0xea51('0x5e'));})[_0xea51('0x35')](function(){return getServerInfo(_0xd81bb5);})[_0xea51('0x35')](function(_0xfb5440){var _0x562bdc=parseInt(_0xfb5440[_0xea51('0x5f')][_0xea51('0x60')](0x0));var _0x5b9a44=util[_0xea51('0x23')](_0xea51('0x61'),_0x425d4c[_0xea51('0x50')],_0x2cc531['id']);if(_0x562bdc>0x6){_0x5b9a44=util[_0xea51('0x23')](_0xea51('0x62'),_0x425d4c[_0xea51('0x50')],_0x2cc531['id']);}logger[_0xea51('0xc')](_0xea51('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea51('0x23')](_0xea51('0x64'),_0x124d21[_0xea51('0x1c')]),_0xea51('0x65'),{'uri':_0x5b9a44});})[_0xea51('0x66')](function(_0x3caa97){logger[_0xea51('0x67')](_0xea51('0x63'),JSON[_0xea51('0x27')](_0x3caa97));});};exports[_0xea51('0x68')]=function(_0x3f07ac,_0x108a5d,_0x19d221,_0x27cec9,_0x55708c,_0x49d6e7,_0x302c5f){var _0x401478,_0x14ae3e,_0x47448b,_0x6f3db5;_0x49d6e7[_0xea51('0x50')]=intUtil[_0xea51('0x51')](_0x49d6e7[_0xea51('0x50')]);_0x49d6e7[_0xea51('0x52')]=intUtil[_0xea51('0x51')](_0x49d6e7[_0xea51('0x52')]);def[_0xea51('0x69')]=util[_0xea51('0x23')](_0xea51('0x53'),_0x49d6e7[_0xea51('0x50')]);if(_0x302c5f&&_0x302c5f[_0xea51('0x6a')]&&_0x302c5f[_0xea51('0x6a')]!==_0xea51('0x6b')){logger[_0xea51('0xc')](_0xea51('0x6c'),_0xea51('0x6d'));_0x108a5d['recordingURL']=util[_0xea51('0x23')](_0xea51('0x56'),_0x49d6e7[_0xea51('0x52')],_0x108a5d[_0xea51('0x57')],md5(_0x108a5d[_0xea51('0x57')]));}return getConnection(_0x49d6e7)[_0xea51('0x35')](function(_0x501040){_0x6f3db5=_0x501040;return getUser(_0x49d6e7,_0x27cec9[_0xea51('0x1c')],_0x6f3db5);})['then'](function(_0x320617){_0x401478=_0x320617;logger[_0xea51('0xc')](_0xea51('0x58'),_0x401478['id']);return getEndUser(_0x49d6e7,_0x108a5d[_0xea51('0x6e')],_0x108a5d[_0xea51('0x6f')],_0x6f3db5);})[_0xea51('0x35')](function(_0x542bbf){_0x14ae3e=_0x542bbf;logger['info']('The\x20Enduser\x20ID\x20is:',_0x14ae3e['id']);return getTicket(_0x49d6e7,_0x401478,_0x14ae3e,_0x19d221,_0x108a5d,_0x19d221[_0xea51('0x5a')],_0x6f3db5,_0xea51('0x70'));})[_0xea51('0x35')](function(_0xf7b091){_0x47448b=_0xf7b091;logger[_0xea51('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x47448b['id']);return setRelationship(_0x6f3db5,_0x401478,_0x47448b,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0x6f3db5,_0x14ae3e,_0x47448b,_0xea51('0x5e'));})[_0xea51('0x35')](function(){return getServerInfo(_0x6f3db5);})[_0xea51('0x35')](function(_0x4c83b5){var _0x43a2af=parseInt(_0x4c83b5[_0xea51('0x5f')][_0xea51('0x60')](0x0));var _0x156ecd=util['format'](_0xea51('0x61'),_0x49d6e7[_0xea51('0x50')],_0x47448b['id']);if(_0x43a2af>0x6){_0x156ecd=util[_0xea51('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x49d6e7['remoteUri'],_0x47448b['id']);}logger[_0xea51('0xc')](_0xea51('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea51('0x23')](_0xea51('0x64'),_0x27cec9[_0xea51('0x1c')]),_0xea51('0x65'),{'uri':_0x156ecd});})[_0xea51('0x66')](function(_0x547341){logger['error'](_0xea51('0x6c'),JSON['stringify'](_0x547341));});};exports[_0xea51('0x71')]=function(_0x291ae5,_0x2d197f,_0x18ca6c,_0x3564b2,_0x177960,_0x39b7a6){var _0x3bcae0,_0x59b04d,_0x56e214,_0x56576e;_0x39b7a6[_0xea51('0x50')]=intUtil['stripTrailingSlash'](_0x39b7a6[_0xea51('0x50')]);_0x39b7a6[_0xea51('0x52')]=intUtil[_0xea51('0x51')](_0x39b7a6[_0xea51('0x52')]);def[_0xea51('0x69')]=util['format']('%s/service/v4_1/rest.php',_0x39b7a6[_0xea51('0x50')]);if(_0x177960&&_0x177960[_0xea51('0x54')]){logger[_0xea51('0xc')]('['+_0x2d197f[_0xea51('0x72')][_0xea51('0x73')]()+']','Recording\x20is\x20enabled!');_0x2d197f[_0xea51('0x55')]=util[_0xea51('0x23')](_0xea51('0x56'),_0x39b7a6['serverUrl'],_0x2d197f['uniqueid'],md5(_0x2d197f[_0xea51('0x57')]));}else{_0x2d197f[_0xea51('0x55')]='';}return getConnection(_0x39b7a6)[_0xea51('0x35')](function(_0x3f59c2){_0x56576e=_0x3f59c2;if(!_[_0xea51('0x28')](_0x3564b2)){return getUser(_0x39b7a6,_0x3564b2['name'],_0x56576e);}else{return getUser(_0x39b7a6,null,_0x56576e);}})['then'](function(_0x3af2ab){_0x3bcae0=_0x3af2ab;logger[_0xea51('0xc')]('The\x20User\x20ID\x20is:',_0x3bcae0['id']);return getEndUser(_0x39b7a6,_0x2d197f[_0xea51('0x59')],_0x2d197f[_0xea51('0x74')],_0x56576e);})[_0xea51('0x35')](function(_0x4afa3d){_0x59b04d=_0x4afa3d;logger[_0xea51('0xc')]('The\x20Enduser\x20ID\x20is:',_0x59b04d['id']);return getTicket(_0x39b7a6,_0x3bcae0,_0x59b04d,_0x18ca6c,_0x2d197f,_0x18ca6c['Fields'],_0x56576e,'Inbound');})[_0xea51('0x35')](function(_0x5c2283){_0x56e214=_0x5c2283;logger[_0xea51('0xc')](_0xea51('0x5c'));logger['info'](_0xea51('0x75'),_0x56e214['id']);return setRelationship(_0x56576e,_0x3bcae0,_0x56e214,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0x56576e,_0x59b04d,_0x56e214,_0xea51('0x5e'));})['then'](function(){return getServerInfo(_0x56576e);})[_0xea51('0x66')](function(_0xa9e0e4){logger['error']('['+_0x2d197f[_0xea51('0x72')]['toUpperCase']()+']',JSON[_0xea51('0x27')](_0xa9e0e4));});}; \ 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 d7cfa5b..2abea13 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 _0xad21=['keyType','key','format','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x4d8d8b,_0x40c3b0){var _0x672730=function(_0x398b7b){while(--_0x398b7b){_0x4d8d8b['push'](_0x4d8d8b['shift']());}};_0x672730(++_0x40c3b0);}(_0xad21,0x1d6));var _0x1ad2=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0xad21[_0x2bd88d];return _0x5516d4;};'use strict';var _=require(_0x1ad2('0x0'));var util=require(_0x1ad2('0x1'));exports[_0x1ad2('0x2')]=function(_0x27f571,_0xde99f3,_0x131a77){var _0x21aa4f=[];if(_0x27f571[_0x1ad2('0x3')]>0x0){var _0x4f6413=_['sortBy'](_0x27f571,['id']);for(var _0x290ae8=0x0;_0x290ae8<_0x4f6413[_0x1ad2('0x3')];_0x290ae8++){var _0x1de749=_0x4f6413[_0x290ae8];if(_0x1de749[_0x1ad2('0x4')]===_0x1ad2('0x5')){_0x21aa4f[_0x1ad2('0x6')](_0x1de749[_0x1ad2('0x7')]);}else if(_0x1de749['type']===_0x1ad2('0x8')&&_0x1de749['variableName']){_0xde99f3[_0x1de749[_0x1ad2('0x9')]]&&_0x21aa4f[_0x1ad2('0x6')](_0xde99f3[_0x1de749[_0x1ad2('0x9')]][_0x1ad2('0xa')]());}else if(_0x1de749[_0x1ad2('0x4')]===_0x1ad2('0xb')&&_0x1de749[_0x1ad2('0xc')]&&_0x1de749[_0x1ad2('0xc')][_0x1ad2('0xd')]){_0xde99f3[_0x1de749['Variable'][_0x1ad2('0xd')][_0x1ad2('0xe')]()]&&_0x21aa4f[_0x1ad2('0x6')](_0xde99f3[_0x1de749[_0x1ad2('0xc')][_0x1ad2('0xd')][_0x1ad2('0xe')]()][_0x1ad2('0xa')]());}else if(_0x1de749[_0x1ad2('0x4')]===_0x1ad2('0xf')){if(_0x1de749[_0x1ad2('0x10')]===_0x1ad2('0x5')&&_0x1de749[_0x1ad2('0x11')]){_0x21aa4f[_0x1ad2('0x6')](util[_0x1ad2('0x12')]('%s:\x20%s',_0x1de749['key'],_0x1de749[_0x1ad2('0x13')]));}else if(_0x1de749[_0x1ad2('0x10')]===_0x1ad2('0x8')&&_0x1de749[_0x1ad2('0x9')]&&_0x1de749[_0x1ad2('0x11')]){_0xde99f3[_0x1de749[_0x1ad2('0x9')]]&&_0x21aa4f[_0x1ad2('0x6')](util[_0x1ad2('0x12')](_0x1ad2('0x14'),_0x1de749[_0x1ad2('0x11')],_0xde99f3[_0x1de749['variableName']]));}else if(_0x1de749[_0x1ad2('0x10')]==='customVariable'&&_0x1de749[_0x1ad2('0xc')]&&_0x1de749[_0x1ad2('0xc')][_0x1ad2('0xd')]&&_0x1de749['key']){_0xde99f3[_0x1de749[_0x1ad2('0xc')][_0x1ad2('0xd')]['toLowerCase']()]&&_0x21aa4f[_0x1ad2('0x6')](util[_0x1ad2('0x12')](_0x1ad2('0x14'),_0x1de749[_0x1ad2('0x11')],_0xde99f3[_0x1de749['Variable'][_0x1ad2('0xd')][_0x1ad2('0xe')]()]));}}}}return _0x21aa4f['join'](_0x131a77);};exports[_0x1ad2('0x15')]=function(_0x535857){var _0x5dc770=_0x535857[_0x1ad2('0x16')](-0x1);if(_0x5dc770==='/'){_0x535857=_0x535857[_0x1ad2('0x17')](0x0,_0x535857[_0x1ad2('0x18')](_0x5dc770));}return _0x535857;};exports['validateEmail']=function(_0x16c7c1){if(!_[_0x1ad2('0x19')](_0x16c7c1)&&_0x16c7c1!==''){var _0x3e7579=/^(([^<>()\[\]\\.,;:\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 _0x3e7579[_0x1ad2('0x1a')](String(_0x16c7c1)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xdbcb=['lodash','util','length','sortBy','type','push','content','variable','customVariable','name','Variable','toLowerCase','toString','keyType','string','%s:\x20%s','key','keyContent','variableName','format','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil'];(function(_0x1f90d4,_0x57d533){var _0x367ac1=function(_0x143d80){while(--_0x143d80){_0x1f90d4['push'](_0x1f90d4['shift']());}};_0x367ac1(++_0x57d533);}(_0xdbcb,0xa2));var _0xbdbc=function(_0x4ba8c3,_0x33c457){_0x4ba8c3=_0x4ba8c3-0x0;var _0xf65364=_0xdbcb[_0x4ba8c3];return _0xf65364;};'use strict';var _=require(_0xbdbc('0x0'));var util=require(_0xbdbc('0x1'));exports['getString']=function(_0x371170,_0x14dbf9,_0x1deb28){var _0xf0f3c6=[];if(_0x371170[_0xbdbc('0x2')]>0x0){var _0x434b29=_[_0xbdbc('0x3')](_0x371170,['id']);for(var _0x2bc8c6=0x0;_0x2bc8c6<_0x434b29[_0xbdbc('0x2')];_0x2bc8c6++){var _0x11f711=_0x434b29[_0x2bc8c6];if(_0x11f711[_0xbdbc('0x4')]==='string'){_0xf0f3c6[_0xbdbc('0x5')](_0x11f711[_0xbdbc('0x6')]);}else if(_0x11f711[_0xbdbc('0x4')]===_0xbdbc('0x7')&&_0x11f711['variableName']){_0x14dbf9[_0x11f711['variableName']]&&_0xf0f3c6[_0xbdbc('0x5')](_0x14dbf9[_0x11f711['variableName']]['toString']());}else if(_0x11f711['type']===_0xbdbc('0x8')&&_0x11f711['Variable']&&_0x11f711['Variable'][_0xbdbc('0x9')]){_0x14dbf9[_0x11f711['Variable']['name']['toLowerCase']()]&&_0xf0f3c6['push'](_0x14dbf9[_0x11f711[_0xbdbc('0xa')][_0xbdbc('0x9')][_0xbdbc('0xb')]()][_0xbdbc('0xc')]());}else if(_0x11f711[_0xbdbc('0x4')]==='keyValue'){if(_0x11f711[_0xbdbc('0xd')]===_0xbdbc('0xe')&&_0x11f711['key']){_0xf0f3c6[_0xbdbc('0x5')](util['format'](_0xbdbc('0xf'),_0x11f711[_0xbdbc('0x10')],_0x11f711[_0xbdbc('0x11')]));}else if(_0x11f711['keyType']===_0xbdbc('0x7')&&_0x11f711[_0xbdbc('0x12')]&&_0x11f711[_0xbdbc('0x10')]){_0x14dbf9[_0x11f711[_0xbdbc('0x12')]]&&_0xf0f3c6[_0xbdbc('0x5')](util[_0xbdbc('0x13')]('%s:\x20%s',_0x11f711[_0xbdbc('0x10')],_0x14dbf9[_0x11f711[_0xbdbc('0x12')]]));}else if(_0x11f711[_0xbdbc('0xd')]===_0xbdbc('0x8')&&_0x11f711['Variable']&&_0x11f711['Variable']['name']&&_0x11f711[_0xbdbc('0x10')]){_0x14dbf9[_0x11f711['Variable'][_0xbdbc('0x9')][_0xbdbc('0xb')]()]&&_0xf0f3c6[_0xbdbc('0x5')](util[_0xbdbc('0x13')]('%s:\x20%s',_0x11f711[_0xbdbc('0x10')],_0x14dbf9[_0x11f711[_0xbdbc('0xa')][_0xbdbc('0x9')][_0xbdbc('0xb')]()]));}}}}return _0xf0f3c6[_0xbdbc('0x14')](_0x1deb28);};exports[_0xbdbc('0x15')]=function(_0x1429e7){var _0x3886a0=_0x1429e7[_0xbdbc('0x16')](-0x1);if(_0x3886a0==='/'){_0x1429e7=_0x1429e7[_0xbdbc('0x17')](0x0,_0x1429e7[_0xbdbc('0x18')](_0x3886a0));}return _0x1429e7;};exports[_0xbdbc('0x19')]=function(_0x4b6f14){if(!_[_0xbdbc('0x1a')](_0x4b6f14)&&_0x4b6f14!==''){var _0x421430=/^(([^<>()\[\]\\.,;:\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 _0x421430['test'](String(_0x4b6f14)[_0xbdbc('0xb')]());}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 e5d73d3..0ca08ee 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x310482,_0x51c144){var _0x4320b0=function(_0x12d875){while(--_0x12d875){_0x310482['push'](_0x310482['shift']());}};_0x4320b0(++_0x51c144);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1fd538,_0x18061f){var _0x3b1e2c=function(_0x2fd43a){while(--_0x2fd43a){_0x1fd538['push'](_0x1fd538['shift']());}};_0x3b1e2c(++_0x18061f);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 64c3afb..d845f87 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 _0x0516=['request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','emit','application/json','info','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','format','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','authType','token','%s/token:%s','username','Basic\x20%s','toString','[HTTP]','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','variableName','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','destcalleridname','destcalleridnum','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','toUpperCase','calleridnum','The\x20Enduser\x20ID\x20is:','lastevent','lodash'];(function(_0x452456,_0xfd55fa){var _0x41bac5=function(_0x53dd45){while(--_0x53dd45){_0x452456['push'](_0x452456['shift']());}};_0x41bac5(++_0xfd55fa);}(_0x0516,0x146));var _0x6051=function(_0x47cd62,_0x19bbf3){_0x47cd62=_0x47cd62-0x0;var _0x7923b9=_0x0516[_0x47cd62];return _0x7923b9;};'use strict';var _=require(_0x6051('0x0'));var rp=require(_0x6051('0x1'));var md5=require(_0x6051('0x2'));var util=require(_0x6051('0x3'));var Redis=require(_0x6051('0x4'));var intUtil=require(_0x6051('0x5'));var config=require(_0x6051('0x6'));var logger=require(_0x6051('0x7'))('zendesk');config[_0x6051('0x8')]=_['defaults'](config[_0x6051('0x8')],{'host':_0x6051('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6051('0x8')]));function emit(_0x1caa49,_0x438099,_0x3c2cf6){io['to'](_0x1caa49)[_0x6051('0xa')](_0x438099,_0x3c2cf6);}var headers={'Content-Type':_0x6051('0xb'),'Accept':_0x6051('0xb')};function getTicket(_0x2f8c6e,_0x375077,_0x11390d,_0x2a4401,_0x1f284c){logger[_0x6051('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x2f8c6e[_0x6051('0xd')]),'method':_0x6051('0xe'),'body':{'ticket':_[_0x6051('0xf')]({'requester_id':_0x11390d['id'],'submitter_id':_0x375077?_0x375077['id']:undefined,'assignee_id':_0x375077?_0x375077['id']:undefined,'tags':getTags(_0x2a4401[_0x6051('0x10')],'name'),'subject':intUtil[_0x6051('0x11')](_0x2a4401[_0x6051('0x12')],_0x1f284c,'\x20'),'description':intUtil[_0x6051('0x11')](_0x2a4401[_0x6051('0x13')],_0x1f284c,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2a4401[_0x6051('0x13')],_0x1f284c,'\x0a')}},getCustomFields(_0x2a4401[_0x6051('0x14')],_0x1f284c))}})[_0x6051('0x15')](function(_0x509e17){logger[_0x6051('0xc')](_0x6051('0x16'));return _0x509e17[_0x6051('0x17')];});}function getUser(_0x4dd2a1,_0x4bc326){if(intUtil['validateEmail'](_0x4bc326)){logger[_0x6051('0xc')]('Getting\x20agent\x20with\x20email',_0x4bc326);return request({'uri':util['format']('%s/search.json',_0x4dd2a1[_0x6051('0xd')]),'qs':{'query':util[_0x6051('0x18')](_0x6051('0x19'),_0x4bc326)}})[_0x6051('0x15')](function(_0x31c2ad){if(_0x31c2ad[_0x6051('0x1a')]){logger['info']('Agent\x20found!');return _['find'](_0x31c2ad[_0x6051('0x1b')],{'email':_0x4bc326,'role':_0x6051('0x1c')});}else{logger[_0x6051('0xc')](_0x6051('0x1d'));return request({'uri':util[_0x6051('0x18')](_0x6051('0x1e'),_0x4dd2a1['remoteUri'])})[_0x6051('0x15')](function(_0xcabda8){logger[_0x6051('0xc')](_0x6051('0x1f'));return _0xcabda8[_0x6051('0x20')];});}});}else{logger[_0x6051('0xc')](_0x6051('0x1d'));return request({'uri':util[_0x6051('0x18')](_0x6051('0x1e'),_0x4dd2a1['remoteUri'])})[_0x6051('0x15')](function(_0x3a188a){logger['info'](_0x6051('0x1f'));return _0x3a188a[_0x6051('0x20')];});}}function getEndUser(_0x482c27,_0x43adfe,_0x2daf15){logger['info'](_0x6051('0x21'),_0x2daf15);return request({'uri':util[_0x6051('0x18')](_0x6051('0x22'),_0x482c27['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x2daf15)}})['then'](function(_0x5c9b3c){var _0x4820a7;if(_0x5c9b3c['results'][_0x6051('0x23')]){_0x5c9b3c['results']=_[_0x6051('0x24')](_0x5c9b3c[_0x6051('0x1b')],{'suspended':![],'role':'end-user'});if(_0x5c9b3c[_0x6051('0x1b')]['length']){_0x4820a7=_['first'](_0x5c9b3c[_0x6051('0x1b')]);}}if(_0x4820a7){logger[_0x6051('0xc')](_0x6051('0x25'));return _0x4820a7;}else{logger['info'](_0x6051('0x26'));return request({'uri':util[_0x6051('0x18')](_0x6051('0x27'),_0x482c27[_0x6051('0xd')]),'method':_0x6051('0xe'),'body':{'user':{'role':_0x6051('0x28'),'name':util[_0x6051('0x18')](_0x6051('0x29'),_0x43adfe||_0x2daf15),'phone':_0x2daf15}}})[_0x6051('0x15')](function(_0xd6e1c2){logger['info'](_0x6051('0x2a'));return _0xd6e1c2[_0x6051('0x20')];});}});}function getAuth(_0x1910d7){var _0x1e3fbd;if(_0x1910d7['authType']===_0x6051('0x2b')){_0x1e3fbd=util[_0x6051('0x18')]('%s:%s',_0x1910d7['username'],_0x1910d7[_0x6051('0x2b')]);}else if(_0x1910d7[_0x6051('0x2c')]===_0x6051('0x2d')){_0x1e3fbd=util[_0x6051('0x18')](_0x6051('0x2e'),_0x1910d7[_0x6051('0x2f')],_0x1910d7[_0x6051('0x2d')]);}return util[_0x6051('0x18')](_0x6051('0x30'),new Buffer(_0x1e3fbd)[_0x6051('0x31')]('base64'));}function request(_0x137d51){logger['debug'](_0x6051('0x32'),JSON['stringify'](_0x137d51));return rp(_[_0x6051('0x33')](_0x137d51,{'method':_0x6051('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x4f0976,_0x5f85f4){var _0x21e72b=[];if(_0x4f0976&&_0x4f0976['length']>0x0){_0x21e72b=_[_0x6051('0x35')](_0x4f0976,_0x5f85f4);}return _0x21e72b;}function getCustomFields(_0x4f6f8a,_0x154346){var _0x163dd1=[];var _0x568dfb={'custom_fields':[]};if(_0x4f6f8a[_0x6051('0x23')]>0x0){_[_0x6051('0x36')](_0x4f6f8a,function(_0x7b179e){if(_[_0x6051('0x37')]([_0x6051('0x38'),_0x6051('0x39')],_0x7b179e[_0x6051('0x3a')])&&_0x7b179e[_0x6051('0x3b')]&&!_0x7b179e[_0x6051('0x3c')]){_0x568dfb[_0x7b179e[_0x6051('0x3b')][_0x6051('0x3d')]()]=_0x7b179e[_0x6051('0x3e')]['toString']();}else if(_[_0x6051('0x37')]([_0x6051('0x38'),_0x6051('0x39')],_0x7b179e[_0x6051('0x3a')])&&_0x7b179e['idField']&&_0x7b179e[_0x6051('0x3c')]){_0x568dfb[_0x6051('0x3f')][_0x6051('0x40')]({'id':_0x7b179e[_0x6051('0x41')],'value':_0x7b179e[_0x6051('0x3e')][_0x6051('0x31')]()});}else if(_0x7b179e['type']===_0x6051('0x42')&&_0x7b179e['variableName']&&_0x7b179e[_0x6051('0x41')]&&_0x7b179e[_0x6051('0x3c')]){_0x154346[_0x7b179e[_0x6051('0x43')]]&&_0x568dfb[_0x6051('0x3f')]['push']({'id':_0x7b179e[_0x6051('0x41')],'value':_0x154346[_0x7b179e['variableName']][_0x6051('0x31')]()});}else if(_0x7b179e[_0x6051('0x3a')]===_0x6051('0x44')&&_0x7b179e['Variable']&&_0x7b179e[_0x6051('0x45')][_0x6051('0x46')]&&_0x7b179e[_0x6051('0x41')]&&_0x7b179e[_0x6051('0x3c')]){_0x154346[_0x7b179e[_0x6051('0x45')]['name']['toLowerCase']()]&&_0x568dfb[_0x6051('0x3f')][_0x6051('0x40')]({'id':_0x7b179e['idField'],'value':_0x154346[_0x7b179e[_0x6051('0x45')]['name'][_0x6051('0x3d')]()][_0x6051('0x31')]()});}});}return _0x568dfb;}exports[_0x6051('0x47')]=function(_0x310043,_0x484b8b,_0x4a8c1,_0x3fa328,_0x6cc2e3,_0x2f768){var _0x4389e4,_0x53b0dc;_0x2f768[_0x6051('0xd')]=intUtil['stripTrailingSlash'](_0x2f768[_0x6051('0xd')]);_0x2f768[_0x6051('0x48')]=intUtil[_0x6051('0x49')](_0x2f768[_0x6051('0x48')]);if(_0x6cc2e3&&_0x6cc2e3[_0x6051('0x4a')]){logger[_0x6051('0xc')](_0x6051('0x4b'),_0x6051('0x4c'));_0x484b8b[_0x6051('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f768['serverUrl'],_0x484b8b['uniqueid'],md5(_0x484b8b['uniqueid']));}else{_0x484b8b[_0x6051('0x4d')]='';}headers['Authorization']=getAuth(_0x2f768);return getUser(_0x2f768,_0x3fa328[_0x6051('0x4e')])[_0x6051('0x15')](function(_0x132f00){_0x4389e4=_0x132f00;logger[_0x6051('0xc')](_0x6051('0x4f'),_0x4389e4['id']);return getEndUser(_0x2f768,_0x484b8b[_0x6051('0x50')],_0x484b8b['calleridnum']);})['then'](function(_0x26dedc){_0x53b0dc=_0x26dedc;logger[_0x6051('0xc')]('The\x20Enduser\x20ID\x20is:',_0x53b0dc['id']);return getTicket(_0x2f768,_0x4389e4,_0x53b0dc,_0x4a8c1,_0x484b8b);})[_0x6051('0x15')](function(_0x3d0231){if(_0x3d0231){logger['info'](_0x6051('0x51'),_0x3d0231['id']);switch(_0x2f768['type']){case _0x6051('0x52'):logger[_0x6051('0xc')]('[QUEUE]',_0x6051('0x53'));return request({'uri':util[_0x6051('0x18')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2f768[_0x6051('0xd')],_0x4389e4['id'],_0x3d0231['id']),'method':_0x6051('0xe')});case _0x6051('0x54'):logger[_0x6051('0xc')](_0x6051('0x4b'),_0x6051('0x55'));emit(util[_0x6051('0x18')](_0x6051('0x56'),_0x3fa328[_0x6051('0x46')]),_0x6051('0x57'),{'uri':util['format'](_0x6051('0x58'),_0x2f768[_0x6051('0xd')][_0x6051('0x59')](_0x6051('0x5a'),''),_0x3d0231['id'])});break;default:logger['error'](_0x6051('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6051('0x5b')](function(_0x378d83){logger[_0x6051('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x6051('0x5d')](_0x378d83,{'showHidden':!![],'depth':null}));});};exports[_0x6051('0x5e')]=function(_0x27e035,_0x5f07f1,_0x528816,_0x43ba68,_0x1a38cb,_0x5b8b57,_0x1a0420){var _0x188642,_0x5e9998;_0x5b8b57[_0x6051('0xd')]=intUtil['stripTrailingSlash'](_0x5b8b57[_0x6051('0xd')]);_0x5b8b57[_0x6051('0x48')]=intUtil[_0x6051('0x49')](_0x5b8b57[_0x6051('0x48')]);if(_0x1a0420&&_0x1a0420['recordingFormat']&&_0x1a0420[_0x6051('0x5f')]!==_0x6051('0x60')){logger['info'](_0x6051('0x61'),_0x6051('0x4c'));_0x5f07f1[_0x6051('0x4d')]=util['format'](_0x6051('0x62'),_0x5b8b57[_0x6051('0x48')],_0x5f07f1[_0x6051('0x63')],md5(_0x5f07f1[_0x6051('0x63')]));}headers[_0x6051('0x64')]=getAuth(_0x5b8b57);return getUser(_0x5b8b57,_0x43ba68[_0x6051('0x4e')])[_0x6051('0x15')](function(_0x539fab){_0x188642=_0x539fab;logger[_0x6051('0xc')](_0x6051('0x4f'),_0x188642['id']);return getEndUser(_0x5b8b57,_0x5f07f1[_0x6051('0x65')],_0x5f07f1[_0x6051('0x66')]);})[_0x6051('0x15')](function(_0x19324c){_0x5e9998=_0x19324c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5e9998['id']);return getTicket(_0x5b8b57,_0x188642,_0x5e9998,_0x528816,_0x5f07f1);})['then'](function(_0x2b8463){if(_0x2b8463){logger[_0x6051('0xc')](_0x6051('0x51'),_0x2b8463['id']);switch(_0x5b8b57[_0x6051('0x3a')]){case _0x6051('0x52'):logger[_0x6051('0xc')](_0x6051('0x61'),_0x6051('0x53'));return request({'uri':util[_0x6051('0x18')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5b8b57[_0x6051('0xd')],_0x188642['id'],_0x2b8463['id']),'method':_0x6051('0xe')});case _0x6051('0x54'):logger['info']('[OUTBOUND]',_0x6051('0x55'));emit(util[_0x6051('0x18')]('user:%s',_0x43ba68[_0x6051('0x46')]),_0x6051('0x57'),{'uri':util[_0x6051('0x18')](_0x6051('0x58'),_0x5b8b57['remoteUri'][_0x6051('0x59')](_0x6051('0x5a'),''),_0x2b8463['id'])});break;default:logger['error'](_0x6051('0x61'),_0x6051('0x67'));}}})[_0x6051('0x5b')](function(_0x136f57){logger[_0x6051('0x5c')](_0x6051('0x68'),util[_0x6051('0x5d')](_0x136f57,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x209ee0,_0x5f4aa3,_0x5c33d1,_0x1ed8d6,_0x2f4165,_0x4a3ea4){var _0x4bc68c,_0x223aeb;_0x4a3ea4[_0x6051('0xd')]=intUtil[_0x6051('0x49')](_0x4a3ea4[_0x6051('0xd')]);_0x4a3ea4['serverUrl']=intUtil[_0x6051('0x49')](_0x4a3ea4[_0x6051('0x48')]);if(_0x2f4165&&_0x2f4165[_0x6051('0x4a')]){logger['info']('['+_0x5f4aa3['lastevent'][_0x6051('0x69')]()+']',_0x6051('0x4c'));_0x5f4aa3[_0x6051('0x4d')]=util['format'](_0x6051('0x62'),_0x4a3ea4[_0x6051('0x48')],_0x5f4aa3[_0x6051('0x63')],md5(_0x5f4aa3[_0x6051('0x63')]));}else{_0x5f4aa3[_0x6051('0x4d')]='';}headers[_0x6051('0x64')]=getAuth(_0x4a3ea4);return getUser(_0x4a3ea4)['then'](function(_0x1fd935){_0x4bc68c=_0x1fd935;logger['info'](_0x6051('0x4f'),_0x4bc68c['id']);return getEndUser(_0x4a3ea4,_0x5f4aa3['calleridname'],_0x5f4aa3[_0x6051('0x6a')]);})[_0x6051('0x15')](function(_0x5ddebe){_0x223aeb=_0x5ddebe;logger['info'](_0x6051('0x6b'),_0x223aeb['id']);return getTicket(_0x4a3ea4,_0x4bc68c,_0x223aeb,_0x5c33d1,_0x5f4aa3);})[_0x6051('0x15')](function(_0x52d60b){if(_0x52d60b){logger[_0x6051('0xc')](_0x6051('0x51'),_0x52d60b['id']);}})[_0x6051('0x5b')](function(_0x44af29){logger['error']('['+_0x5f4aa3[_0x6051('0x6c')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x6051('0x5d')](_0x44af29,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7f28=['ioredis','./util','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','name','Subjects','getString','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','filter','results','first','Enduser\x20found!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','length','map','forEach','includes','picklist','type','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util'];(function(_0x1b8807,_0x4f6962){var _0x4a9429=function(_0x32b0d6){while(--_0x32b0d6){_0x1b8807['push'](_0x1b8807['shift']());}};_0x4a9429(++_0x4f6962);}(_0x7f28,0x143));var _0x87f2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7f28[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x87f2('0x0'));var rp=require(_0x87f2('0x1'));var md5=require(_0x87f2('0x2'));var util=require(_0x87f2('0x3'));var Redis=require(_0x87f2('0x4'));var intUtil=require(_0x87f2('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x87f2('0x6'));config[_0x87f2('0x7')]=_['defaults'](config[_0x87f2('0x7')],{'host':_0x87f2('0x8'),'port':0x18eb});var io=require(_0x87f2('0x9'))(new Redis(config[_0x87f2('0x7')]));function emit(_0x5e325e,_0x432859,_0x28b149){io['to'](_0x5e325e)[_0x87f2('0xa')](_0x432859,_0x28b149);}var headers={'Content-Type':_0x87f2('0xb'),'Accept':_0x87f2('0xb')};function getTicket(_0x55c222,_0x1d5566,_0x449895,_0x4e812a,_0xaf7e00){logger[_0x87f2('0xc')](_0x87f2('0xd'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0xf'),_0x55c222[_0x87f2('0x10')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x449895['id'],'submitter_id':_0x1d5566?_0x1d5566['id']:undefined,'assignee_id':_0x1d5566?_0x1d5566['id']:undefined,'tags':getTags(_0x4e812a['Tags'],_0x87f2('0x11')),'subject':intUtil['getString'](_0x4e812a[_0x87f2('0x12')],_0xaf7e00,'\x20'),'description':intUtil[_0x87f2('0x13')](_0x4e812a['Descriptions'],_0xaf7e00,'\x0a'),'comment':{'public':![],'body':intUtil[_0x87f2('0x13')](_0x4e812a['Descriptions'],_0xaf7e00,'\x0a')}},getCustomFields(_0x4e812a['Fields'],_0xaf7e00))}})[_0x87f2('0x14')](function(_0x57a8f0){logger[_0x87f2('0xc')](_0x87f2('0x15'));return _0x57a8f0['ticket'];});}function getUser(_0x5c6af4,_0x5515fb){if(intUtil[_0x87f2('0x16')](_0x5515fb)){logger['info'](_0x87f2('0x17'),_0x5515fb);return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x18'),_0x5c6af4['remoteUri']),'qs':{'query':util[_0x87f2('0xe')](_0x87f2('0x19'),_0x5515fb)}})[_0x87f2('0x14')](function(_0x2fdc04){if(_0x2fdc04['count']){logger[_0x87f2('0xc')](_0x87f2('0x1a'));return _[_0x87f2('0x1b')](_0x2fdc04['results'],{'email':_0x5515fb,'role':'agent'});}else{logger[_0x87f2('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x1c'),_0x5c6af4[_0x87f2('0x10')])})['then'](function(_0x1a905a){logger[_0x87f2('0xc')](_0x87f2('0x1d'));return _0x1a905a[_0x87f2('0x1e')];});}});}else{logger[_0x87f2('0xc')](_0x87f2('0x1f'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x1c'),_0x5c6af4[_0x87f2('0x10')])})[_0x87f2('0x14')](function(_0x1c6ecd){logger['info'](_0x87f2('0x1d'));return _0x1c6ecd[_0x87f2('0x1e')];});}}function getEndUser(_0x37448b,_0x161d00,_0x1cf6b4){logger[_0x87f2('0xc')](_0x87f2('0x20'),_0x1cf6b4);return request({'uri':util['format'](_0x87f2('0x18'),_0x37448b['remoteUri']),'qs':{'query':util[_0x87f2('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x1cf6b4)}})[_0x87f2('0x14')](function(_0x2b4b0b){var _0x2d0fdd;if(_0x2b4b0b['results']['length']){_0x2b4b0b['results']=_[_0x87f2('0x21')](_0x2b4b0b[_0x87f2('0x22')],{'suspended':![],'role':'end-user'});if(_0x2b4b0b[_0x87f2('0x22')]['length']){_0x2d0fdd=_[_0x87f2('0x23')](_0x2b4b0b[_0x87f2('0x22')]);}}if(_0x2d0fdd){logger[_0x87f2('0xc')](_0x87f2('0x24'));return _0x2d0fdd;}else{logger[_0x87f2('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x25'),_0x37448b['remoteUri']),'method':_0x87f2('0x26'),'body':{'user':{'role':_0x87f2('0x27'),'name':util[_0x87f2('0xe')](_0x87f2('0x28'),_0x161d00||_0x1cf6b4),'phone':_0x1cf6b4}}})['then'](function(_0x174064){logger[_0x87f2('0xc')](_0x87f2('0x29'));return _0x174064[_0x87f2('0x1e')];});}});}function getAuth(_0xfcb3ea){var _0x5bb480;if(_0xfcb3ea['authType']===_0x87f2('0x2a')){_0x5bb480=util[_0x87f2('0xe')](_0x87f2('0x2b'),_0xfcb3ea[_0x87f2('0x2c')],_0xfcb3ea[_0x87f2('0x2a')]);}else if(_0xfcb3ea[_0x87f2('0x2d')]===_0x87f2('0x2e')){_0x5bb480=util['format']('%s/token:%s',_0xfcb3ea[_0x87f2('0x2c')],_0xfcb3ea['token']);}return util['format'](_0x87f2('0x2f'),new Buffer(_0x5bb480)[_0x87f2('0x30')](_0x87f2('0x31')));}function request(_0x43415f){logger['debug'](_0x87f2('0x32'),JSON[_0x87f2('0x33')](_0x43415f));return rp(_['defaults'](_0x43415f,{'method':_0x87f2('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x20e6f0,_0xa9af4e){var _0x253663=[];if(_0x20e6f0&&_0x20e6f0[_0x87f2('0x35')]>0x0){_0x253663=_[_0x87f2('0x36')](_0x20e6f0,_0xa9af4e);}return _0x253663;}function getCustomFields(_0x4fca38,_0x25e65a){var _0x44013b=[];var _0x1f990a={'custom_fields':[]};if(_0x4fca38[_0x87f2('0x35')]>0x0){_[_0x87f2('0x37')](_0x4fca38,function(_0x3fa323){if(_[_0x87f2('0x38')](['string',_0x87f2('0x39')],_0x3fa323[_0x87f2('0x3a')])&&_0x3fa323['nameField']&&!_0x3fa323[_0x87f2('0x3b')]){_0x1f990a[_0x3fa323['nameField'][_0x87f2('0x3c')]()]=_0x3fa323[_0x87f2('0x3d')]['toString']();}else if(_['includes']([_0x87f2('0x3e'),_0x87f2('0x39')],_0x3fa323[_0x87f2('0x3a')])&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323[_0x87f2('0x3b')]){_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323['idField'],'value':_0x3fa323['content']['toString']()});}else if(_0x3fa323['type']===_0x87f2('0x42')&&_0x3fa323[_0x87f2('0x43')]&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323['customField']){_0x25e65a[_0x3fa323[_0x87f2('0x43')]]&&_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323[_0x87f2('0x3f')],'value':_0x25e65a[_0x3fa323[_0x87f2('0x43')]][_0x87f2('0x30')]()});}else if(_0x3fa323[_0x87f2('0x3a')]===_0x87f2('0x44')&&_0x3fa323['Variable']&&_0x3fa323[_0x87f2('0x45')]['name']&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323['customField']){_0x25e65a[_0x3fa323['Variable'][_0x87f2('0x11')][_0x87f2('0x3c')]()]&&_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323[_0x87f2('0x3f')],'value':_0x25e65a[_0x3fa323['Variable'][_0x87f2('0x11')][_0x87f2('0x3c')]()][_0x87f2('0x30')]()});}});}return _0x1f990a;}exports[_0x87f2('0x46')]=function(_0x943a4d,_0x20063d,_0x3c2bb0,_0x1b9bee,_0x504cb5,_0x46e77c){var _0x520139,_0x30481e;_0x46e77c[_0x87f2('0x10')]=intUtil[_0x87f2('0x47')](_0x46e77c['remoteUri']);_0x46e77c[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x46e77c[_0x87f2('0x48')]);if(_0x504cb5&&_0x504cb5[_0x87f2('0x49')]){logger[_0x87f2('0xc')]('[QUEUE]',_0x87f2('0x4a'));_0x20063d[_0x87f2('0x4b')]=util[_0x87f2('0xe')](_0x87f2('0x4c'),_0x46e77c[_0x87f2('0x48')],_0x20063d[_0x87f2('0x4d')],md5(_0x20063d[_0x87f2('0x4d')]));}else{_0x20063d[_0x87f2('0x4b')]='';}headers['Authorization']=getAuth(_0x46e77c);return getUser(_0x46e77c,_0x1b9bee['email'])['then'](function(_0x5e8b78){_0x520139=_0x5e8b78;logger['info'](_0x87f2('0x4e'),_0x520139['id']);return getEndUser(_0x46e77c,_0x20063d[_0x87f2('0x4f')],_0x20063d[_0x87f2('0x50')]);})['then'](function(_0x6220b6){_0x30481e=_0x6220b6;logger[_0x87f2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x30481e['id']);return getTicket(_0x46e77c,_0x520139,_0x30481e,_0x3c2bb0,_0x20063d);})[_0x87f2('0x14')](function(_0x7ceb79){if(_0x7ceb79){logger[_0x87f2('0xc')](_0x87f2('0x51'),_0x7ceb79['id']);switch(_0x46e77c['type']){case _0x87f2('0x52'):logger['info'](_0x87f2('0x53'),_0x87f2('0x54'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x55'),_0x46e77c[_0x87f2('0x10')],_0x520139['id'],_0x7ceb79['id']),'method':_0x87f2('0x26')});case _0x87f2('0x56'):logger[_0x87f2('0xc')]('[QUEUE]',_0x87f2('0x57'));emit(util[_0x87f2('0xe')]('user:%s',_0x1b9bee[_0x87f2('0x11')]),_0x87f2('0x58'),{'uri':util[_0x87f2('0xe')](_0x87f2('0x59'),_0x46e77c[_0x87f2('0x10')]['replace'](_0x87f2('0x5a'),''),_0x7ceb79['id'])});break;default:logger[_0x87f2('0x5b')](_0x87f2('0x53'),_0x87f2('0x5c'));}}})[_0x87f2('0x5d')](function(_0x2aa387){logger[_0x87f2('0x5b')](_0x87f2('0x5e'),util[_0x87f2('0x5f')](_0x2aa387,{'showHidden':!![],'depth':null}));});};exports[_0x87f2('0x60')]=function(_0x3dbcfb,_0x3492a9,_0x2d05dd,_0x11c4e2,_0xab3867,_0x2aff1c,_0x43f2d1){var _0x8817ab,_0x5a271f;_0x2aff1c['remoteUri']=intUtil[_0x87f2('0x47')](_0x2aff1c['remoteUri']);_0x2aff1c[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x2aff1c['serverUrl']);if(_0x43f2d1&&_0x43f2d1[_0x87f2('0x61')]&&_0x43f2d1[_0x87f2('0x61')]!=='none'){logger[_0x87f2('0xc')](_0x87f2('0x62'),_0x87f2('0x4a'));_0x3492a9[_0x87f2('0x4b')]=util[_0x87f2('0xe')](_0x87f2('0x4c'),_0x2aff1c[_0x87f2('0x48')],_0x3492a9[_0x87f2('0x4d')],md5(_0x3492a9[_0x87f2('0x4d')]));}headers['Authorization']=getAuth(_0x2aff1c);return getUser(_0x2aff1c,_0x11c4e2[_0x87f2('0x63')])[_0x87f2('0x14')](function(_0x2dd5ec){_0x8817ab=_0x2dd5ec;logger[_0x87f2('0xc')](_0x87f2('0x4e'),_0x8817ab['id']);return getEndUser(_0x2aff1c,_0x3492a9[_0x87f2('0x64')],_0x3492a9['destcalleridnum']);})[_0x87f2('0x14')](function(_0x486dd4){_0x5a271f=_0x486dd4;logger[_0x87f2('0xc')](_0x87f2('0x65'),_0x5a271f['id']);return getTicket(_0x2aff1c,_0x8817ab,_0x5a271f,_0x2d05dd,_0x3492a9);})[_0x87f2('0x14')](function(_0x4f0fc9){if(_0x4f0fc9){logger['info'](_0x87f2('0x51'),_0x4f0fc9['id']);switch(_0x2aff1c[_0x87f2('0x3a')]){case _0x87f2('0x52'):logger['info'](_0x87f2('0x62'),_0x87f2('0x54'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x55'),_0x2aff1c[_0x87f2('0x10')],_0x8817ab['id'],_0x4f0fc9['id']),'method':'POST'});case'newTab':logger[_0x87f2('0xc')](_0x87f2('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x87f2('0xe')](_0x87f2('0x66'),_0x11c4e2[_0x87f2('0x11')]),_0x87f2('0x58'),{'uri':util['format'](_0x87f2('0x59'),_0x2aff1c['remoteUri'][_0x87f2('0x67')](_0x87f2('0x5a'),''),_0x4f0fc9['id'])});break;default:logger[_0x87f2('0x5b')](_0x87f2('0x62'),_0x87f2('0x5c'));}}})[_0x87f2('0x5d')](function(_0x3a3102){logger[_0x87f2('0x5b')](_0x87f2('0x68'),util['inspect'](_0x3a3102,{'showHidden':!![],'depth':null}));});};exports[_0x87f2('0x69')]=function(_0x53fa12,_0x1636a1,_0x5c338b,_0x5e5d68,_0x2ecf89,_0x20f830){var _0x5cf03d,_0x559352;_0x20f830[_0x87f2('0x10')]=intUtil['stripTrailingSlash'](_0x20f830[_0x87f2('0x10')]);_0x20f830[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x20f830[_0x87f2('0x48')]);if(_0x2ecf89&&_0x2ecf89['monitor_format']){logger[_0x87f2('0xc')]('['+_0x1636a1['lastevent']['toUpperCase']()+']',_0x87f2('0x4a'));_0x1636a1[_0x87f2('0x4b')]=util[_0x87f2('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20f830[_0x87f2('0x48')],_0x1636a1[_0x87f2('0x4d')],md5(_0x1636a1[_0x87f2('0x4d')]));}else{_0x1636a1[_0x87f2('0x4b')]='';}headers['Authorization']=getAuth(_0x20f830);return getUser(_0x20f830)[_0x87f2('0x14')](function(_0x4bc491){_0x5cf03d=_0x4bc491;logger[_0x87f2('0xc')]('The\x20User\x20ID\x20is:',_0x5cf03d['id']);return getEndUser(_0x20f830,_0x1636a1[_0x87f2('0x4f')],_0x1636a1[_0x87f2('0x50')]);})['then'](function(_0x13bdc6){_0x559352=_0x13bdc6;logger['info'](_0x87f2('0x65'),_0x559352['id']);return getTicket(_0x20f830,_0x5cf03d,_0x559352,_0x5c338b,_0x1636a1);})[_0x87f2('0x14')](function(_0x3b2be4){if(_0x3b2be4){logger[_0x87f2('0xc')](_0x87f2('0x51'),_0x3b2be4['id']);}})['catch'](function(_0x7e0ef1){logger[_0x87f2('0x5b')]('['+_0x1636a1[_0x87f2('0x6a')][_0x87f2('0x6b')]()+']'+_0x87f2('0x6c'),util[_0x87f2('0x5f')](_0x7e0ef1,{'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 1ede4ba..0bbc9d8 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 _0x3cbd=['variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','expires_in','seconds','catch','error','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','data','details','enduserType','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','administrator','Subject','getString','Descriptions','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','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Fields','/crm/v2/Calls','code','stack','err','queue','host','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','recordingURL','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','monitor_format','toUpperCase','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable'];(function(_0x31b4db,_0x2385e2){var _0x3fe8f0=function(_0x51117f){while(--_0x51117f){_0x31b4db['push'](_0x31b4db['shift']());}};_0x3fe8f0(++_0x2385e2);}(_0x3cbd,0x1c0));var _0xd3cb=function(_0x4b5787,_0x2c5aa2){_0x4b5787=_0x4b5787-0x0;var _0x827b80=_0x3cbd[_0x4b5787];return _0x827b80;};'use strict';var _=require('lodash');var rp=require(_0xd3cb('0x0'));var md5=require(_0xd3cb('0x1'));var util=require('util');var intUtil=require(_0xd3cb('0x2'));var moment=require(_0xd3cb('0x3'));var Redis=require(_0xd3cb('0x4'));var BPromise=require(_0xd3cb('0x5'));var config=require(_0xd3cb('0x6'));var logger=require(_0xd3cb('0x7'))(_0xd3cb('0x8'));config[_0xd3cb('0x9')]=_[_0xd3cb('0xa')](config[_0xd3cb('0x9')],{'host':_0xd3cb('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd3cb('0x9')]));function emit(_0x43e0f7,_0x2bff1c,_0x3334e3){io['to'](_0x43e0f7)[_0xd3cb('0xc')](_0x2bff1c,_0x3334e3);}function request(_0x5ab271){logger[_0xd3cb('0xd')](_0xd3cb('0xe'),JSON[_0xd3cb('0xf')](_0x5ab271));return rp(_0x5ab271);}function getCustomFields(_0x2b6114,_0x2078a6){var _0x5c149f={};if(_0x2b6114[_0xd3cb('0x10')]>0x0){_[_0xd3cb('0x11')](_0x2b6114,function(_0x38a256){if(_[_0xd3cb('0x12')]([_0xd3cb('0x13'),_0xd3cb('0x14')],_0x38a256[_0xd3cb('0x15')])&&_0x38a256[_0xd3cb('0x16')]){_0x5c149f[_0x38a256[_0xd3cb('0x16')]]=_0x38a256[_0xd3cb('0x17')][_0xd3cb('0x18')]();}else if(_0x38a256[_0xd3cb('0x15')]===_0xd3cb('0x19')&&_0x38a256[_0xd3cb('0x1a')]&&_0x38a256[_0xd3cb('0x16')]&&_0x2078a6[_0x38a256['variableName']]){_0x5c149f[_0x38a256['idField']]=_0x2078a6[_0x38a256[_0xd3cb('0x1a')]][_0xd3cb('0x18')]();}else if(_0x38a256[_0xd3cb('0x15')]==='customVariable'&&_0x38a256[_0xd3cb('0x1b')]&&_0x38a256['Variable'][_0xd3cb('0x1c')]&&_0x38a256[_0xd3cb('0x16')]&&_0x2078a6[_0x38a256['Variable'][_0xd3cb('0x1c')][_0xd3cb('0x1d')]()]){_0x5c149f[_0x38a256[_0xd3cb('0x16')]]=_0x2078a6[_0x38a256[_0xd3cb('0x1b')][_0xd3cb('0x1c')][_0xd3cb('0x1d')]()][_0xd3cb('0x18')]();}});}return _0x5c149f;}function getName(_0x43e701){if(_0x43e701[_0xd3cb('0x1e')]('\x20')>0x0){var _0x443b6f=_0x43e701[_0xd3cb('0x1f')](/ (.+)/);if(_0x443b6f[0x1]){return _0x443b6f;}}return[_0x43e701,_0x43e701];}var accountsTokens={};function getAccessToken(_0x5c495a){return new Promise(function(_0x13d017,_0x414300){if(!_[_0xd3cb('0x20')](accountsTokens[_0x5c495a['id']])&&!_['isNil'](accountsTokens[_0x5c495a['id']][_0xd3cb('0x21')])){if(moment()[_0xd3cb('0x22')](accountsTokens[_0x5c495a['id']]['expires_in'])){_0x13d017(accountsTokens[_0x5c495a['id']][_0xd3cb('0x21')]);}}var _0xa2eed7;switch(_0x5c495a[_0xd3cb('0x23')]){case'US':_0xa2eed7=_0xd3cb('0x24');break;case'AU':_0xa2eed7=_0xd3cb('0x25');break;case'EU':_0xa2eed7=_0xd3cb('0x26');break;case'IN':_0xa2eed7='https://accounts.zoho.in';break;case'CN':_0xa2eed7=_0xd3cb('0x27');break;default:_0xa2eed7=_0xd3cb('0x26');break;}var _0x152a5b={'method':_0xd3cb('0x28'),'uri':_0xa2eed7+_0xd3cb('0x29'),'qs':{'refresh_token':_0x5c495a[_0xd3cb('0x2a')],'client_id':_0x5c495a[_0xd3cb('0x2b')],'client_secret':_0x5c495a[_0xd3cb('0x2c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x152a5b)[_0xd3cb('0x2d')](function(_0x1b87e2){accountsTokens[_0x5c495a['id']]={'access_token':_0x1b87e2[_0xd3cb('0x21')],'expires_in':moment()[_0xd3cb('0x2e')](_0x1b87e2[_0xd3cb('0x2f')],_0xd3cb('0x30'))};_0x13d017(_0x1b87e2[_0xd3cb('0x21')]);})[_0xd3cb('0x31')](function(_0xf27541){logger[_0xd3cb('0x32')]('Failing\x20creating\x20the\x20access_token',_0xf27541['stack']);_0x414300(_0xf27541);});});}function getUser(_0x339448,_0x42bcea,_0x51e84c,_0x17b98e){logger['info']('Search\x20user');return request({'method':_0xd3cb('0x33'),'uri':util[_0xd3cb('0x34')](_0xd3cb('0x35'),_0x42bcea),'qs':{'type':_0xd3cb('0x36')},'headers':{'Authorization':_0xd3cb('0x37')+_0x339448},'json':!![]})[_0xd3cb('0x2d')](function(_0x5d8bef){if(_0x5d8bef[_0xd3cb('0x38')]){var _0x5b8ba7=-0x1;if(_[_0xd3cb('0x39')](_0x5d8bef[_0xd3cb('0x38')])){if(!_[_0xd3cb('0x20')](_0x17b98e)){_0x5b8ba7=_[_0xd3cb('0x3a')](_0x5d8bef['users'],function(_0x308859){return _0x308859[_0xd3cb('0x3b')]===_0x17b98e;});}if(_0x5b8ba7>=0x0){logger[_0xd3cb('0x3c')](_0xd3cb('0x3d'));}else{logger[_0xd3cb('0x3c')](_0xd3cb('0x3e'));_0x5b8ba7=_[_0xd3cb('0x3a')](_0x5d8bef[_0xd3cb('0x38')],function(_0x227f48){return _0x227f48['profile'][_0xd3cb('0x1c')]===_0xd3cb('0x3f');});}return _0x5d8bef[_0xd3cb('0x38')][_0x5b8ba7];}else{if(_0x5d8bef[_0xd3cb('0x40')][_0xd3cb('0x41')][_0xd3cb('0x1c')]===_0xd3cb('0x3f')){logger[_0xd3cb('0x3c')]('Using\x20the\x20admin\x20account!');user=_0x5d8bef['user'];return user;}else{logger[_0xd3cb('0x32')](_0xd3cb('0x42'),JSON[_0xd3cb('0xf')](_0x5d8bef));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xd3cb('0xf')](_0x5d8bef));}}}else{logger[_0xd3cb('0x32')](_0xd3cb('0x42'),JSON[_0xd3cb('0xf')](_0x5d8bef));throw new Error(_0xd3cb('0x43')+JSON['stringify'](_0x5d8bef));}})[_0xd3cb('0x31')](function(_0x2b0104){console[_0xd3cb('0x32')](_0x2b0104);});}function getZohoUser(_0x137dd7,_0x4be02e){return new BPromise(function(_0x52bf0a,_0x3c5d3c){request(_0x137dd7)['then'](function(_0x125f39){var _0x2db0db=null;if(_0x125f39){_0x2db0db=_0x125f39['data'][0x0];_0x2db0db['enduserType']=_0x4be02e;}_0x52bf0a(_0x2db0db);})[_0xd3cb('0x31')](function(_0x28de3b){_0x3c5d3c(_0x28de3b);});});}function createEndUser(_0x278d14,_0x36b784,_0x25712b,_0x36bdcc,_0x230faf,_0x387cd0){var _0x25712b=getName(_0x25712b);return request({'method':_0xd3cb('0x28'),'uri':_0xd3cb('0x44')+_0x36b784+_0xd3cb('0x45')+_[_0xd3cb('0x46')](_0x387cd0[_0xd3cb('0x47')])+'s','body':{'data':[{'Last_Name':_0x25712b[0x1],'First_Name':_0x25712b[0x0],'Phone':_0x36bdcc,'Owner':{'name':!_['isNil'](_0x230faf[_0xd3cb('0x48')][_0xd3cb('0x1c')])?_0x230faf[_0xd3cb('0x48')][_0xd3cb('0x1c')]:!_[_0xd3cb('0x20')](_0x230faf['first_name'])?_0x230faf[_0xd3cb('0x49')]+'\x20'+_0x230faf[_0xd3cb('0x4a')]:_0x230faf[_0xd3cb('0x4a')],'id':_0x230faf['id']}}]},'headers':{'Authorization':_0xd3cb('0x37')+_0x278d14},'json':!![]})[_0xd3cb('0x2d')](function(_0xc568a7){if(_0xc568a7&&_0xc568a7['data'][0x0]['code']===_0xd3cb('0x4b')){var _0x2353b8=_0xc568a7[_0xd3cb('0x4c')][0x0][_0xd3cb('0x4d')];_0x2353b8[_0xd3cb('0x4e')]=_['startCase'](_0x387cd0[_0xd3cb('0x47')])+'s';return _0x2353b8;}logger['error'](_0xd3cb('0x42'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xd3cb('0xf')](data));})[_0xd3cb('0x31')](function(_0x3a3b26){console[_0xd3cb('0x4f')]('CREATE\x20ERROR',_0x3a3b26);});}function getEndUser(_0x29ceb6,_0x560951,_0x38b3e5,_0x19e2c2,_0x5c2e36,_0x36132d,_0x5bf93c){var _0x4f1784={'method':_0xd3cb('0x33'),'uri':'','headers':{'Authorization':_0xd3cb('0x37')+_0x29ceb6},'json':!![]};switch(_0x5bf93c[_0xd3cb('0x50')]){case _0xd3cb('0x51'):_0x4f1784[_0xd3cb('0x52')]=_0xd3cb('0x44')+_0x560951+_0xd3cb('0x53')+_0x5c2e36+'))';return getZohoUser(_0x4f1784,'Contacts')[_0xd3cb('0x2d')](function(_0x5981db){if(_0x5981db)return _0x5981db;_0x4f1784[_0xd3cb('0x52')]=_0xd3cb('0x44')+_0x560951+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5c2e36+'))';return getZohoUser(_0x4f1784,'Leads')[_0xd3cb('0x2d')](function(_0x177d24){if(_0x177d24)return _0x177d24;if(_0x5bf93c['moduleCreate']!=_0xd3cb('0x54')){return createEndUser(_0x29ceb6,_0x560951,_0x19e2c2,_0x5c2e36,_0x36132d,_0x5bf93c);}else{return{};}});});break;case _0xd3cb('0x55'):_0x4f1784[_0xd3cb('0x52')]='https://www.zohoapis.'+_0x560951+_0xd3cb('0x53')+_0x5c2e36+'))';return getZohoUser(_0x4f1784,_0xd3cb('0x56'))[_0xd3cb('0x2d')](function(_0x2128cd){if(_0x2128cd)return _0x2128cd;if(_0x5bf93c[_0xd3cb('0x47')]!=_0xd3cb('0x54')){return createEndUser(_0x29ceb6,_0x560951,_0x19e2c2,_0x5c2e36,_0x36132d,_0x5bf93c);}else{return{};}});break;case'lead':_0x4f1784['uri']=_0xd3cb('0x44')+_0x560951+_0xd3cb('0x57')+_0x5c2e36+'))';return getZohoUser(_0x4f1784,_0xd3cb('0x58'))[_0xd3cb('0x2d')](function(_0x18b18c){if(_0x18b18c)return _0x18b18c;if(_0x5bf93c[_0xd3cb('0x47')]!=_0xd3cb('0x54')){return createEndUser(_0x29ceb6,_0x560951,_0x19e2c2,_0x5c2e36,_0x36132d,_0x5bf93c);}else{return{};}});break;}}function getCall(_0x1dd0a0,_0x5d6717,_0x289531,_0x47b90e,_0x1dffda,_0x25c05b,_0x573939,_0x2ee8a3){logger[_0xd3cb('0x3c')]('Creating\x20new\x20call...');var _0x3af505={};_0x3af505['Owner']={'name':!_['isNil'](_0x47b90e[_0xd3cb('0x48')][_0xd3cb('0x1c')])&&!_['isNil'](_0x47b90e[_0xd3cb('0x41')][_0xd3cb('0x1c')])&&_0x47b90e[_0xd3cb('0x41')][_0xd3cb('0x1c')]===_0xd3cb('0x59')?_0x47b90e['role'][_0xd3cb('0x1c')]:!_[_0xd3cb('0x20')](_0x47b90e['first_name'])?_0x47b90e[_0xd3cb('0x49')]+'\x20'+_0x47b90e[_0xd3cb('0x4a')]:_0x47b90e['last_name'],'id':_0x47b90e['id']};_0x3af505[_0xd3cb('0x5a')]=intUtil['getString'](_0x25c05b['Subjects'],_0x573939,'\x20');_0x3af505['Description']=intUtil[_0xd3cb('0x5b')](_0x25c05b[_0xd3cb('0x5c')],_0x573939,'\x0a');if(_0x1dffda[_0xd3cb('0x4e')]===_0xd3cb('0x56')){_0x3af505[_0xd3cb('0x5d')]={'name':!_[_0xd3cb('0x20')](_0x1dffda[_0xd3cb('0x5e')])?_0x1dffda[_0xd3cb('0x5e')]:!_[_0xd3cb('0x20')](_0x1dffda[_0xd3cb('0x5f')])?_0x1dffda[_0xd3cb('0x5f')]+'\x20'+_0x1dffda[_0xd3cb('0x60')]:_0x1dffda[_0xd3cb('0x60')],'id':_0x1dffda['id']};}if(_0x1dffda[_0xd3cb('0x4e')]===_0xd3cb('0x58')){_0x3af505['What_Id']={'name':!_[_0xd3cb('0x20')](_0x1dffda['Full_Name'])?_0x1dffda[_0xd3cb('0x5e')]:!_[_0xd3cb('0x20')](_0x1dffda[_0xd3cb('0x5f')])?_0x1dffda['First_Name']+'\x20'+_0x1dffda[_0xd3cb('0x60')]:_0x1dffda[_0xd3cb('0x60')],'id':_0x1dffda['id']};_0x3af505[_0xd3cb('0x61')]=_[_0xd3cb('0x46')](_0x1dffda[_0xd3cb('0x4e')]);}if(_0x573939[_0xd3cb('0x62')]){_0x3af505[_0xd3cb('0x63')]=moment[_0xd3cb('0x64')](parseInt(_0x573939[_0xd3cb('0x62')])*0x3e8)[_0xd3cb('0x34')](_0xd3cb('0x65'));}else if(_0x573939[_0xd3cb('0x66')]&&_0x573939[_0xd3cb('0x67')]){_0x3af505[_0xd3cb('0x63')]=moment[_0xd3cb('0x64')](moment(_0x573939[_0xd3cb('0x67')],'YYYY-MM-DDTHH:mm:ss')[_0xd3cb('0x68')](moment(_0x573939[_0xd3cb('0x69')],_0xd3cb('0x6a'))))[_0xd3cb('0x34')](_0xd3cb('0x65'));}switch(_0x573939[_0xd3cb('0x6b')]){case _0xd3cb('0x6c'):_0x3af505['Call_Result']=_0xd3cb('0x6d');break;case _0xd3cb('0x6e'):case'connect':_0x3af505[_0xd3cb('0x6f')]=_0xd3cb('0x70');break;case _0xd3cb('0x71'):_0x3af505[_0xd3cb('0x6f')]=_0xd3cb('0x72');break;case _0xd3cb('0x73'):_0x3af505[_0xd3cb('0x6f')]=_0xd3cb('0x74');break;case _0xd3cb('0x75'):_0x3af505['Call_Result']=_0xd3cb('0x76');default:}_0x3af505[_0xd3cb('0x77')]=(_0x2ee8a3===_0xd3cb('0x78')?moment(_0x573939[_0xd3cb('0x69')])[_0xd3cb('0x34')](_0xd3cb('0x6a')):moment(_0x573939[_0xd3cb('0x79')])[_0xd3cb('0x34')](_0xd3cb('0x6a')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x3af505[_0xd3cb('0x7a')]=_0x2ee8a3||'Inbound';_0x3af505=_['merge'](_0x3af505,getCustomFields(_0x25c05b[_0xd3cb('0x7b')],_0x573939));return request({'method':_0xd3cb('0x28'),'uri':'https://www.zohoapis.'+_0x5d6717+_0xd3cb('0x7c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1dd0a0},'body':{'data':[_0x3af505]},'json':!![]})['then'](function(_0x270e9f){if(_0x270e9f&&_0x270e9f['data'][0x0][_0xd3cb('0x7d')]==='SUCCESS'){logger[_0xd3cb('0x3c')]('Call\x20created!');return{'id':_0x270e9f['data'][0x0][_0xd3cb('0x4d')]['id']};}})[_0xd3cb('0x31')](function(_0x268a24){logger[_0xd3cb('0x3c')]('err',_0x268a24[_0xd3cb('0x7e')]);console[_0xd3cb('0x4f')](_0xd3cb('0x7f'),_0x268a24);});}exports[_0xd3cb('0x80')]=function(_0x227f59,_0x2f82d7,_0x22128a,_0x4a4bcd,_0x4b254d,_0x30d6c0){var _0x2851f2,_0x30d7b0,_0x234ed8;_0x30d6c0[_0xd3cb('0x81')]=intUtil['stripTrailingSlash'](_0x30d6c0[_0xd3cb('0x81')]);_0x30d6c0[_0xd3cb('0x82')]=intUtil[_0xd3cb('0x83')](_0x30d6c0[_0xd3cb('0x82')]);if(_0x4b254d&&_0x4b254d['monitor_format']){logger[_0xd3cb('0x3c')]('[QUEUE]',_0xd3cb('0x84'));_0x2f82d7['recordingURL']=_0x30d6c0[_0xd3cb('0x82')]+_0xd3cb('0x85')+_0x2f82d7[_0xd3cb('0x86')]+_0xd3cb('0x87')+md5(_0x2f82d7[_0xd3cb('0x86')]);}else{_0x2f82d7['recordingURL']='';}var _0x331487=_0x30d6c0[_0xd3cb('0x81')]===_0xd3cb('0x88')?'eu':_0xd3cb('0x89');return getAccessToken(_0x30d6c0)['then'](function(_0x4a4d01){_0x234ed8=_0x4a4d01;return getUser(_0x234ed8,_0x331487,_0x30d6c0,_0x4a4bcd[_0xd3cb('0x3b')]);})[_0xd3cb('0x2d')](function(_0x150719){_0x2851f2=_0x150719;logger['info'](_0xd3cb('0x8a'),_0x2851f2['id']);return getEndUser(_0x234ed8,_0x331487,_0x30d6c0,_0x2f82d7[_0xd3cb('0x8b')],_0x2f82d7[_0xd3cb('0x8c')],_0x2851f2,_0x22128a);})[_0xd3cb('0x2d')](function(_0x4f2173){_0x30d7b0=_0x4f2173;return getCall(_0x234ed8,_0x331487,_0x30d6c0,_0x2851f2,_0x30d7b0,_0x22128a,_0x2f82d7,_0xd3cb('0x8d'));})[_0xd3cb('0x2d')](function(_0x1748d0){if(_0x1748d0){logger[_0xd3cb('0x3c')](_0xd3cb('0x8e'),_0x1748d0['id']);logger['info'](_0xd3cb('0x8f'),_0xd3cb('0x90'));emit(util[_0xd3cb('0x34')](_0xd3cb('0x91'),_0x4a4bcd[_0xd3cb('0x1c')]),_0xd3cb('0x92'),{'uri':_0xd3cb('0x93')+_0x30d6c0[_0xd3cb('0x81')]+_0xd3cb('0x94')+_0x1748d0['id']});}})['catch'](function(_0x35496c){logger[_0xd3cb('0x32')](_0xd3cb('0x8f'),JSON[_0xd3cb('0xf')](_0x35496c));});};exports[_0xd3cb('0x78')]=function(_0x3cf67a,_0x322346,_0x30a38a,_0x27b976,_0x477387,_0x436685,_0x1f8eab){var _0x4e34f8,_0x35e653,_0x30787b;_0x436685['host']=intUtil[_0xd3cb('0x83')](_0x436685['host']);_0x436685[_0xd3cb('0x82')]=intUtil['stripTrailingSlash'](_0x436685['serverUrl']);if(_0x1f8eab&&_0x1f8eab['recordingFormat']&&_0x1f8eab[_0xd3cb('0x95')]!==_0xd3cb('0x96')){logger[_0xd3cb('0x3c')]('[OUTBOUND]',_0xd3cb('0x84'));_0x322346[_0xd3cb('0x97')]=_0x436685[_0xd3cb('0x82')]+_0xd3cb('0x85')+_0x322346[_0xd3cb('0x86')]+_0xd3cb('0x87')+md5(_0x322346['uniqueid']);}var _0x19dec4=_0x436685[_0xd3cb('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x436685)[_0xd3cb('0x2d')](function(_0x1513f2){_0x30787b=_0x1513f2;return getUser(_0x30787b,_0x19dec4,_0x436685,_0x27b976[_0xd3cb('0x3b')]);})['then'](function(_0xd296e1){_0x4e34f8=_0xd296e1;logger[_0xd3cb('0x3c')]('The\x20User\x20ID\x20is:',_0x4e34f8['id']);return getEndUser(_0x30787b,_0x19dec4,_0x436685,_0x322346[_0xd3cb('0x98')],_0x322346[_0xd3cb('0x99')],_0x4e34f8,_0x30a38a);})['then'](function(_0x23abe4){_0x35e653=_0x23abe4;return getCall(_0x30787b,_0x19dec4,_0x436685,_0x4e34f8,_0x35e653,_0x30a38a,_0x322346,_0xd3cb('0x9a'));})['then'](function(_0x21d234){if(_0x21d234){logger[_0xd3cb('0x3c')](_0xd3cb('0x8e'),_0x21d234['id']);logger[_0xd3cb('0x3c')](_0xd3cb('0x9b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd3cb('0x34')](_0xd3cb('0x91'),_0x27b976['name']),_0xd3cb('0x92'),{'uri':_0xd3cb('0x93')+_0x436685[_0xd3cb('0x81')]+_0xd3cb('0x94')+_0x21d234['id']});}})[_0xd3cb('0x31')](function(_0x19e78f){logger[_0xd3cb('0x32')]('[OUTBOUND]',JSON[_0xd3cb('0xf')](_0x19e78f));});};exports['unmanaged']=function(_0x70141b,_0x28edb6,_0x1a38c0,_0xe5c61e,_0x1ea675,_0x612a44){var _0x5ab199,_0x4ae22a,_0x2a5c5b;_0x612a44[_0xd3cb('0x81')]=intUtil[_0xd3cb('0x83')](_0x612a44[_0xd3cb('0x81')]);_0x612a44[_0xd3cb('0x82')]=intUtil[_0xd3cb('0x83')](_0x612a44[_0xd3cb('0x82')]);if(_0x1ea675&&_0x1ea675[_0xd3cb('0x9c')]){logger['info']('['+_0x28edb6[_0xd3cb('0x6b')][_0xd3cb('0x9d')]()+']',_0xd3cb('0x84'));_0x28edb6['recordingURL']=_0x612a44[_0xd3cb('0x82')]+_0xd3cb('0x85')+_0x28edb6[_0xd3cb('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x28edb6[_0xd3cb('0x86')]);}else{_0x28edb6['recordingURL']='';}var _0x52b2cb=_0x612a44[_0xd3cb('0x81')]===_0xd3cb('0x88')?'eu':'com';return getAccessToken(_0x612a44)[_0xd3cb('0x2d')](function(_0x5050f5){_0x2a5c5b=_0x5050f5;return getUser(_0x2a5c5b,_0x52b2cb,_0x612a44);})[_0xd3cb('0x2d')](function(_0x258251){_0x5ab199=_0x258251;logger[_0xd3cb('0x3c')]('The\x20User\x20ID\x20is:',_0x5ab199['id']);return getEndUser(_0x2a5c5b,_0x52b2cb,_0x612a44,_0x28edb6['calleridname'],_0x28edb6['calleridnum'],_0x5ab199,_0x1a38c0);})[_0xd3cb('0x2d')](function(_0x198304){_0x4ae22a=_0x198304;return getCall(_0x2a5c5b,_0x52b2cb,_0x612a44,_0x5ab199,_0x4ae22a,_0x1a38c0,_0x28edb6,'Inbound');})[_0xd3cb('0x2d')](function(_0x36c5ee){if(_0x36c5ee){logger[_0xd3cb('0x3c')]('The\x20Call\x20ID\x20is:',_0x36c5ee['id']);}})[_0xd3cb('0x31')](function(_0x28824b){logger[_0xd3cb('0x32')]('['+_0x28edb6[_0xd3cb('0x6b')][_0xd3cb('0x9d')]()+']',JSON[_0xd3cb('0xf')](_0x28824b));});}; \ No newline at end of file +var _0xab1e=['isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','enduserType','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','Contacts','moduleCreate','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','com','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','monitor_format','Inbound','toUpperCase','util','./util','moment','ioredis','bluebird','zoho','defaults','localhost','redis','emit','debug','[HTTP]','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','isNil','access_token'];(function(_0x56c2c1,_0x6737c8){var _0x20005b=function(_0x1f371b){while(--_0x1f371b){_0x56c2c1['push'](_0x56c2c1['shift']());}};_0x20005b(++_0x6737c8);}(_0xab1e,0x81));var _0xeab1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xab1e[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xeab1('0x0'));var intUtil=require(_0xeab1('0x1'));var moment=require(_0xeab1('0x2'));var Redis=require(_0xeab1('0x3'));var BPromise=require(_0xeab1('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xeab1('0x5'));config['redis']=_[_0xeab1('0x6')](config['redis'],{'host':_0xeab1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeab1('0x8')]));function emit(_0x214ec8,_0x491455,_0x291edd){io['to'](_0x214ec8)[_0xeab1('0x9')](_0x491455,_0x291edd);}function request(_0x36fccb){logger[_0xeab1('0xa')](_0xeab1('0xb'),JSON['stringify'](_0x36fccb));return rp(_0x36fccb);}function getCustomFields(_0x20a23f,_0x4560f3){var _0x2ce755={};if(_0x20a23f[_0xeab1('0xc')]>0x0){_[_0xeab1('0xd')](_0x20a23f,function(_0x4cec24){if(_['includes']([_0xeab1('0xe'),_0xeab1('0xf')],_0x4cec24[_0xeab1('0x10')])&&_0x4cec24[_0xeab1('0x11')]){_0x2ce755[_0x4cec24[_0xeab1('0x11')]]=_0x4cec24[_0xeab1('0x12')][_0xeab1('0x13')]();}else if(_0x4cec24[_0xeab1('0x10')]===_0xeab1('0x14')&&_0x4cec24['variableName']&&_0x4cec24[_0xeab1('0x11')]&&_0x4560f3[_0x4cec24['variableName']]){_0x2ce755[_0x4cec24[_0xeab1('0x11')]]=_0x4560f3[_0x4cec24[_0xeab1('0x15')]][_0xeab1('0x13')]();}else if(_0x4cec24['type']===_0xeab1('0x16')&&_0x4cec24['Variable']&&_0x4cec24['Variable'][_0xeab1('0x17')]&&_0x4cec24[_0xeab1('0x11')]&&_0x4560f3[_0x4cec24[_0xeab1('0x18')]['name'][_0xeab1('0x19')]()]){_0x2ce755[_0x4cec24['idField']]=_0x4560f3[_0x4cec24[_0xeab1('0x18')][_0xeab1('0x17')][_0xeab1('0x19')]()][_0xeab1('0x13')]();}});}return _0x2ce755;}function getName(_0x36e187){if(_0x36e187[_0xeab1('0x1a')]('\x20')>0x0){var _0x2b8cf8=_0x36e187[_0xeab1('0x1b')](/ (.+)/);if(_0x2b8cf8[0x1]){return _0x2b8cf8;}}return[_0x36e187,_0x36e187];}var accountsTokens={};function getAccessToken(_0x392062){return new Promise(function(_0x124acb,_0x39d500){if(!_[_0xeab1('0x1c')](accountsTokens[_0x392062['id']])&&!_[_0xeab1('0x1c')](accountsTokens[_0x392062['id']][_0xeab1('0x1d')])){if(moment()[_0xeab1('0x1e')](accountsTokens[_0x392062['id']][_0xeab1('0x1f')])){_0x124acb(accountsTokens[_0x392062['id']][_0xeab1('0x1d')]);}}var _0x36d61a;switch(_0x392062[_0xeab1('0x20')]){case'US':_0x36d61a=_0xeab1('0x21');break;case'AU':_0x36d61a=_0xeab1('0x22');break;case'EU':_0x36d61a=_0xeab1('0x23');break;case'IN':_0x36d61a='https://accounts.zoho.in';break;case'CN':_0x36d61a=_0xeab1('0x24');break;default:_0x36d61a=_0xeab1('0x23');break;}var _0x179dba={'method':_0xeab1('0x25'),'uri':_0x36d61a+_0xeab1('0x26'),'qs':{'refresh_token':_0x392062['refreshToken'],'client_id':_0x392062[_0xeab1('0x27')],'client_secret':_0x392062[_0xeab1('0x28')],'grant_type':_0xeab1('0x29')},'json':!![]};return rp(_0x179dba)[_0xeab1('0x2a')](function(_0x576d9a){accountsTokens[_0x392062['id']]={'access_token':_0x576d9a[_0xeab1('0x1d')],'expires_in':moment()['add'](_0x576d9a[_0xeab1('0x1f')],_0xeab1('0x2b'))};_0x124acb(_0x576d9a['access_token']);})[_0xeab1('0x2c')](function(_0x15f317){logger['error'](_0xeab1('0x2d'),_0x15f317[_0xeab1('0x2e')]);_0x39d500(_0x15f317);});});}function getUser(_0x3f67fb,_0x1eda15,_0x10f1a0,_0x3893ba){logger[_0xeab1('0x2f')](_0xeab1('0x30'));return request({'method':'GET','uri':util[_0xeab1('0x31')](_0xeab1('0x32'),_0x1eda15),'qs':{'type':_0xeab1('0x33')},'headers':{'Authorization':_0xeab1('0x34')+_0x3f67fb},'json':!![]})[_0xeab1('0x2a')](function(_0x2cd7ae){if(_0x2cd7ae[_0xeab1('0x35')]){var _0x7119fc=-0x1;if(_[_0xeab1('0x36')](_0x2cd7ae[_0xeab1('0x35')])){if(!_['isNil'](_0x3893ba)){_0x7119fc=_['findIndex'](_0x2cd7ae[_0xeab1('0x35')],function(_0x3f3e07){return _0x3f3e07[_0xeab1('0x37')]===_0x3893ba;});}if(_0x7119fc>=0x0){logger[_0xeab1('0x2f')]('Agent\x20found!');}else{logger[_0xeab1('0x2f')](_0xeab1('0x38'));_0x7119fc=_[_0xeab1('0x39')](_0x2cd7ae[_0xeab1('0x35')],function(_0x394843){return _0x394843[_0xeab1('0x3a')]['name']===_0xeab1('0x3b');});}return _0x2cd7ae['users'][_0x7119fc];}else{if(_0x2cd7ae['user'][_0xeab1('0x3a')][_0xeab1('0x17')]===_0xeab1('0x3b')){logger[_0xeab1('0x2f')](_0xeab1('0x38'));user=_0x2cd7ae[_0xeab1('0x3c')];return user;}else{logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](_0x2cd7ae));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xeab1('0x3f')](_0x2cd7ae));}}}else{logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](_0x2cd7ae));throw new Error(_0xeab1('0x40')+JSON['stringify'](_0x2cd7ae));}})[_0xeab1('0x2c')](function(_0x4932ce){console[_0xeab1('0x3d')](_0x4932ce);});}function getZohoUser(_0x5e6364,_0x113835){return new BPromise(function(_0x5c36a2,_0xa23050){request(_0x5e6364)['then'](function(_0x58730e){var _0x12a7f1=null;if(_0x58730e){_0x12a7f1=_0x58730e[_0xeab1('0x41')][0x0];_0x12a7f1['enduserType']=_0x113835;}_0x5c36a2(_0x12a7f1);})['catch'](function(_0xe9d64){_0xa23050(_0xe9d64);});});}function createEndUser(_0x38a427,_0x3d7236,_0x4e0eee,_0x415307,_0x31b1de,_0x2034b2){var _0x4e0eee=getName(_0x4e0eee);return request({'method':_0xeab1('0x25'),'uri':_0xeab1('0x42')+_0x3d7236+_0xeab1('0x43')+_[_0xeab1('0x44')](_0x2034b2['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4e0eee[0x1],'First_Name':_0x4e0eee[0x0],'Phone':_0x415307,'Owner':{'name':!_['isNil'](_0x31b1de[_0xeab1('0x45')][_0xeab1('0x17')])?_0x31b1de[_0xeab1('0x45')][_0xeab1('0x17')]:!_[_0xeab1('0x1c')](_0x31b1de[_0xeab1('0x46')])?_0x31b1de[_0xeab1('0x46')]+'\x20'+_0x31b1de[_0xeab1('0x47')]:_0x31b1de[_0xeab1('0x47')],'id':_0x31b1de['id']}}]},'headers':{'Authorization':_0xeab1('0x34')+_0x38a427},'json':!![]})[_0xeab1('0x2a')](function(_0x3fb265){if(_0x3fb265&&_0x3fb265['data'][0x0][_0xeab1('0x48')]===_0xeab1('0x49')){var _0x101d77=_0x3fb265[_0xeab1('0x41')][0x0]['details'];_0x101d77[_0xeab1('0x4a')]=_['startCase'](_0x2034b2['moduleCreate'])+'s';return _0x101d77;}logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](data));throw new Error(_0xeab1('0x4b')+JSON[_0xeab1('0x3f')](data));})[_0xeab1('0x2c')](function(_0x24739a){console[_0xeab1('0x4c')](_0xeab1('0x4d'),_0x24739a);});}function getEndUser(_0x35f1b4,_0x5131ca,_0x506fbd,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c){var _0x5897d6={'method':_0xeab1('0x4e'),'uri':'','headers':{'Authorization':_0xeab1('0x34')+_0x35f1b4},'json':!![]};switch(_0x4da62c['moduleSearch']){case _0xeab1('0x4f'):_0x5897d6[_0xeab1('0x50')]='https://www.zohoapis.'+_0x5131ca+_0xeab1('0x51')+_0x22d305+'))';return getZohoUser(_0x5897d6,'Contacts')[_0xeab1('0x2a')](function(_0x24ebeb){if(_0x24ebeb)return _0x24ebeb;_0x5897d6[_0xeab1('0x50')]=_0xeab1('0x42')+_0x5131ca+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x52'))['then'](function(_0x3d5971){if(_0x3d5971)return _0x3d5971;if(_0x4da62c['moduleCreate']!=_0xeab1('0x53')){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});});break;case'contact':_0x5897d6[_0xeab1('0x50')]='https://www.zohoapis.'+_0x5131ca+_0xeab1('0x51')+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x54'))[_0xeab1('0x2a')](function(_0xbb20bb){if(_0xbb20bb)return _0xbb20bb;if(_0x4da62c[_0xeab1('0x55')]!='nothing'){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});break;case _0xeab1('0x56'):_0x5897d6['uri']=_0xeab1('0x42')+_0x5131ca+_0xeab1('0x57')+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x52'))[_0xeab1('0x2a')](function(_0x2c7e40){if(_0x2c7e40)return _0x2c7e40;if(_0x4da62c['moduleCreate']!='nothing'){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});break;}}function getCall(_0x5682a1,_0x27ac73,_0x672a7c,_0x32eb23,_0x4093f5,_0x5e47e9,_0x4691c9,_0x30f90d){logger[_0xeab1('0x2f')](_0xeab1('0x58'));var _0x48a391={};_0x48a391[_0xeab1('0x59')]={'name':!_[_0xeab1('0x1c')](_0x32eb23[_0xeab1('0x45')]['name'])&&!_[_0xeab1('0x1c')](_0x32eb23['profile']['name'])&&_0x32eb23[_0xeab1('0x3a')]['name']===_0xeab1('0x5a')?_0x32eb23['role'][_0xeab1('0x17')]:!_[_0xeab1('0x1c')](_0x32eb23[_0xeab1('0x46')])?_0x32eb23[_0xeab1('0x46')]+'\x20'+_0x32eb23['last_name']:_0x32eb23[_0xeab1('0x47')],'id':_0x32eb23['id']};_0x48a391[_0xeab1('0x5b')]=intUtil[_0xeab1('0x5c')](_0x5e47e9[_0xeab1('0x5d')],_0x4691c9,'\x20');_0x48a391[_0xeab1('0x5e')]=intUtil[_0xeab1('0x5c')](_0x5e47e9[_0xeab1('0x5f')],_0x4691c9,'\x0a');if(_0x4093f5[_0xeab1('0x4a')]==='Contacts'){_0x48a391[_0xeab1('0x60')]={'name':!_[_0xeab1('0x1c')](_0x4093f5[_0xeab1('0x61')])?_0x4093f5[_0xeab1('0x61')]:!_['isNil'](_0x4093f5[_0xeab1('0x62')])?_0x4093f5['First_Name']+'\x20'+_0x4093f5[_0xeab1('0x63')]:_0x4093f5[_0xeab1('0x63')],'id':_0x4093f5['id']};}if(_0x4093f5[_0xeab1('0x4a')]===_0xeab1('0x52')){_0x48a391[_0xeab1('0x64')]={'name':!_[_0xeab1('0x1c')](_0x4093f5['Full_Name'])?_0x4093f5[_0xeab1('0x61')]:!_['isNil'](_0x4093f5[_0xeab1('0x62')])?_0x4093f5[_0xeab1('0x62')]+'\x20'+_0x4093f5[_0xeab1('0x63')]:_0x4093f5[_0xeab1('0x63')],'id':_0x4093f5['id']};_0x48a391[_0xeab1('0x65')]=_['startCase'](_0x4093f5[_0xeab1('0x4a')]);}if(_0x4691c9['talktime']){_0x48a391[_0xeab1('0x66')]=moment[_0xeab1('0x67')](parseInt(_0x4691c9[_0xeab1('0x68')])*0x3e8)[_0xeab1('0x31')](_0xeab1('0x69'));}else if(_0x4691c9[_0xeab1('0x6a')]&&_0x4691c9[_0xeab1('0x6b')]){_0x48a391[_0xeab1('0x66')]=moment[_0xeab1('0x67')](moment(_0x4691c9[_0xeab1('0x6b')],_0xeab1('0x6c'))[_0xeab1('0x6d')](moment(_0x4691c9[_0xeab1('0x6e')],_0xeab1('0x6c'))))[_0xeab1('0x31')](_0xeab1('0x69'));}switch(_0x4691c9[_0xeab1('0x6f')]){case _0xeab1('0x70'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x72');break;case _0xeab1('0x73'):case _0xeab1('0x74'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x75');break;case'rejected':_0x48a391[_0xeab1('0x71')]='Rejected';break;case _0xeab1('0x76'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x77');break;case _0xeab1('0x78'):_0x48a391['Call_Result']=_0xeab1('0x79');default:}_0x48a391[_0xeab1('0x7a')]=(_0x30f90d===_0xeab1('0x7b')?moment(_0x4691c9[_0xeab1('0x6e')])[_0xeab1('0x31')](_0xeab1('0x6c')):moment(_0x4691c9[_0xeab1('0x7c')])['format'](_0xeab1('0x6c')))||moment()['format'](_0xeab1('0x6c'));_0x48a391['Call_Type']=_0x30f90d||'Inbound';_0x48a391=_['merge'](_0x48a391,getCustomFields(_0x5e47e9[_0xeab1('0x7d')],_0x4691c9));return request({'method':_0xeab1('0x25'),'uri':_0xeab1('0x42')+_0x27ac73+_0xeab1('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5682a1},'body':{'data':[_0x48a391]},'json':!![]})[_0xeab1('0x2a')](function(_0x26936f){if(_0x26936f&&_0x26936f[_0xeab1('0x41')][0x0]['code']===_0xeab1('0x49')){logger['info'](_0xeab1('0x7f'));return{'id':_0x26936f['data'][0x0]['details']['id']};}})[_0xeab1('0x2c')](function(_0x205b45){logger['info'](_0xeab1('0x80'),_0x205b45[_0xeab1('0x2e')]);console[_0xeab1('0x4c')](_0xeab1('0x80'),_0x205b45);});}exports['queue']=function(_0x180eef,_0x50c723,_0x35dea5,_0x3d2d62,_0x56a901,_0x5c10cf){var _0x32b836,_0x1de292,_0x476c6f;_0x5c10cf[_0xeab1('0x81')]=intUtil[_0xeab1('0x82')](_0x5c10cf[_0xeab1('0x81')]);_0x5c10cf['serverUrl']=intUtil['stripTrailingSlash'](_0x5c10cf[_0xeab1('0x83')]);if(_0x56a901&&_0x56a901['monitor_format']){logger['info'](_0xeab1('0x84'),_0xeab1('0x85'));_0x50c723[_0xeab1('0x86')]=_0x5c10cf[_0xeab1('0x83')]+_0xeab1('0x87')+_0x50c723[_0xeab1('0x88')]+_0xeab1('0x89')+md5(_0x50c723[_0xeab1('0x88')]);}else{_0x50c723['recordingURL']='';}var _0x41ee93=_0x5c10cf[_0xeab1('0x81')]===_0xeab1('0x8a')?'eu':'com';return getAccessToken(_0x5c10cf)[_0xeab1('0x2a')](function(_0x1b8678){_0x476c6f=_0x1b8678;return getUser(_0x476c6f,_0x41ee93,_0x5c10cf,_0x3d2d62[_0xeab1('0x37')]);})['then'](function(_0xca6fd7){_0x32b836=_0xca6fd7;logger[_0xeab1('0x2f')](_0xeab1('0x8b'),_0x32b836['id']);return getEndUser(_0x476c6f,_0x41ee93,_0x5c10cf,_0x50c723[_0xeab1('0x8c')],_0x50c723[_0xeab1('0x8d')],_0x32b836,_0x35dea5);})['then'](function(_0x43ea73){_0x1de292=_0x43ea73;return getCall(_0x476c6f,_0x41ee93,_0x5c10cf,_0x32b836,_0x1de292,_0x35dea5,_0x50c723,'Inbound');})[_0xeab1('0x2a')](function(_0x11e71f){if(_0x11e71f){logger[_0xeab1('0x2f')](_0xeab1('0x8e'),_0x11e71f['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeab1('0x31')](_0xeab1('0x8f'),_0x3d2d62['name']),'trigger:browser:url',{'uri':_0xeab1('0x90')+_0x5c10cf[_0xeab1('0x81')]+_0xeab1('0x91')+_0x11e71f['id']});}})[_0xeab1('0x2c')](function(_0x3ec4b1){logger[_0xeab1('0x3d')](_0xeab1('0x84'),JSON[_0xeab1('0x3f')](_0x3ec4b1));});};exports['outbound']=function(_0x5b8664,_0x3acd78,_0x485cf8,_0x38a0b1,_0x4de2ef,_0x126c4b,_0x4b4bb3){var _0x4fc414,_0x59c11c,_0x197758;_0x126c4b[_0xeab1('0x81')]=intUtil['stripTrailingSlash'](_0x126c4b[_0xeab1('0x81')]);_0x126c4b[_0xeab1('0x83')]=intUtil[_0xeab1('0x82')](_0x126c4b[_0xeab1('0x83')]);if(_0x4b4bb3&&_0x4b4bb3[_0xeab1('0x92')]&&_0x4b4bb3[_0xeab1('0x92')]!==_0xeab1('0x93')){logger[_0xeab1('0x2f')]('[OUTBOUND]',_0xeab1('0x85'));_0x3acd78[_0xeab1('0x86')]=_0x126c4b['serverUrl']+_0xeab1('0x87')+_0x3acd78[_0xeab1('0x88')]+_0xeab1('0x89')+md5(_0x3acd78['uniqueid']);}var _0x1eb247=_0x126c4b['host']==='zoho.eu'?'eu':_0xeab1('0x94');return getAccessToken(_0x126c4b)[_0xeab1('0x2a')](function(_0x3b8697){_0x197758=_0x3b8697;return getUser(_0x197758,_0x1eb247,_0x126c4b,_0x38a0b1['email']);})['then'](function(_0x542b0c){_0x4fc414=_0x542b0c;logger[_0xeab1('0x2f')](_0xeab1('0x8b'),_0x4fc414['id']);return getEndUser(_0x197758,_0x1eb247,_0x126c4b,_0x3acd78[_0xeab1('0x95')],_0x3acd78[_0xeab1('0x96')],_0x4fc414,_0x485cf8);})[_0xeab1('0x2a')](function(_0x18afd6){_0x59c11c=_0x18afd6;return getCall(_0x197758,_0x1eb247,_0x126c4b,_0x4fc414,_0x59c11c,_0x485cf8,_0x3acd78,_0xeab1('0x97'));})[_0xeab1('0x2a')](function(_0x1fe3c9){if(_0x1fe3c9){logger[_0xeab1('0x2f')](_0xeab1('0x8e'),_0x1fe3c9['id']);logger[_0xeab1('0x2f')](_0xeab1('0x98'),_0xeab1('0x99'));emit(util[_0xeab1('0x31')]('user:%s',_0x38a0b1[_0xeab1('0x17')]),_0xeab1('0x9a'),{'uri':_0xeab1('0x90')+_0x126c4b['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x1fe3c9['id']});}})[_0xeab1('0x2c')](function(_0x1a6498){logger[_0xeab1('0x3d')](_0xeab1('0x98'),JSON[_0xeab1('0x3f')](_0x1a6498));});};exports[_0xeab1('0x9b')]=function(_0x2f6c28,_0x3e088b,_0x572e35,_0x5abf4f,_0x1bcd57,_0x579d06){var _0x2eabe1,_0x2c6a3f,_0x848b6d;_0x579d06[_0xeab1('0x81')]=intUtil['stripTrailingSlash'](_0x579d06[_0xeab1('0x81')]);_0x579d06[_0xeab1('0x83')]=intUtil[_0xeab1('0x82')](_0x579d06[_0xeab1('0x83')]);if(_0x1bcd57&&_0x1bcd57[_0xeab1('0x9c')]){logger['info']('['+_0x3e088b[_0xeab1('0x6f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3e088b[_0xeab1('0x86')]=_0x579d06[_0xeab1('0x83')]+_0xeab1('0x87')+_0x3e088b['uniqueid']+_0xeab1('0x89')+md5(_0x3e088b[_0xeab1('0x88')]);}else{_0x3e088b[_0xeab1('0x86')]='';}var _0x29fd43=_0x579d06['host']===_0xeab1('0x8a')?'eu':_0xeab1('0x94');return getAccessToken(_0x579d06)['then'](function(_0x1bf7c3){_0x848b6d=_0x1bf7c3;return getUser(_0x848b6d,_0x29fd43,_0x579d06);})[_0xeab1('0x2a')](function(_0x563a75){_0x2eabe1=_0x563a75;logger['info'](_0xeab1('0x8b'),_0x2eabe1['id']);return getEndUser(_0x848b6d,_0x29fd43,_0x579d06,_0x3e088b[_0xeab1('0x8c')],_0x3e088b[_0xeab1('0x8d')],_0x2eabe1,_0x572e35);})[_0xeab1('0x2a')](function(_0x25c49b){_0x2c6a3f=_0x25c49b;return getCall(_0x848b6d,_0x29fd43,_0x579d06,_0x2eabe1,_0x2c6a3f,_0x572e35,_0x3e088b,_0xeab1('0x9d'));})[_0xeab1('0x2a')](function(_0x40b7f1){if(_0x40b7f1){logger['info'](_0xeab1('0x8e'),_0x40b7f1['id']);}})['catch'](function(_0x2ad7e7){logger['error']('['+_0x3e088b[_0xeab1('0x6f')][_0xeab1('0x9e')]()+']',JSON[_0xeab1('0x3f')](_0x2ad7e7));});}; \ 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 c929130..f1ad013 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 _0x04bd=['../../../../config/logger','trigger','exec','data2','Script','data3','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','shelljs','mustache'];(function(_0x1655c6,_0xaac21e){var _0x50df2f=function(_0x8cd0ad){while(--_0x8cd0ad){_0x1655c6['push'](_0x1655c6['shift']());}};_0x50df2f(++_0xaac21e);}(_0x04bd,0x169));var _0xd04b=function(_0xe1c86b,_0x5ee94b){_0xe1c86b=_0xe1c86b-0x0;var _0x5c4faf=_0x04bd[_0xe1c86b];return _0x5c4faf;};'use strict';var util=require(_0xd04b('0x0'));var sh=require(_0xd04b('0x1'));var Mustache=require(_0xd04b('0x2'));var logger=require(_0xd04b('0x3'))(_0xd04b('0x4'));exports[_0xd04b('0x5')]=function(_0x4aea0d,_0x5afd0e){var _0x2a3320=_0x4aea0d[_0xd04b('0x6')]?_0x4aea0d[_0xd04b('0x6')]:_0xd04b('0x7');var _0x5bc853=_0x4aea0d[_0xd04b('0x8')]?Mustache['render'](_0x4aea0d[_0xd04b('0x8')],_0x5afd0e):_0x5afd0e;sh['exec'](_0x5bc853,function(_0x37a57c,_0x979a73,_0x4c8867){if(_0x37a57c!==0x0){logger[_0xd04b('0x9')](util[_0xd04b('0xa')](_0xd04b('0xb'),_0x2a3320,_0x5bc853,_0x37a57c,_0x4c8867));}else{logger[_0xd04b('0xc')](util[_0xd04b('0xa')](_0xd04b('0xd'),_0x2a3320,_0x5bc853,_0x979a73));}});}; \ No newline at end of file +var _0x74f1=['format','util','shelljs','mustache','trigger','exec','data2','data3','error'];(function(_0x4bbc65,_0x5737e9){var _0x288343=function(_0x1e2c4a){while(--_0x1e2c4a){_0x4bbc65['push'](_0x4bbc65['shift']());}};_0x288343(++_0x5737e9);}(_0x74f1,0x184));var _0x174f=function(_0x2c94a5,_0x128193){_0x2c94a5=_0x2c94a5-0x0;var _0x472eac=_0x74f1[_0x2c94a5];return _0x472eac;};'use strict';var util=require(_0x174f('0x0'));var sh=require(_0x174f('0x1'));var Mustache=require(_0x174f('0x2'));var logger=require('../../../../config/logger')(_0x174f('0x3'));exports[_0x174f('0x4')]=function(_0x487be3,_0x5e7478){var _0x439d00=_0x487be3[_0x174f('0x5')]?_0x487be3[_0x174f('0x5')]:'Script';var _0x35e11c=_0x487be3[_0x174f('0x6')]?Mustache['render'](_0x487be3[_0x174f('0x6')],_0x5e7478):_0x5e7478;sh[_0x174f('0x4')](_0x35e11c,function(_0x337334,_0x1611d9,_0x3b4d2f){if(_0x337334!==0x0){logger[_0x174f('0x7')](util[_0x174f('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x439d00,_0x35e11c,_0x337334,_0x3b4d2f));}else{logger['info'](util[_0x174f('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x439d00,_0x35e11c,_0x1611d9));}});}; \ 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 86a9571..5257d90 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 _0x6cc6=['data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','object','%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','request-promise','util','lodash','mustache','trigger','exec','render','data2','data5','number','headers','data6','parse','stack','data1','GET','DELETE','PUT'];(function(_0x7ecf62,_0x1da8e9){var _0x5e9451=function(_0xa5e280){while(--_0xa5e280){_0x7ecf62['push'](_0x7ecf62['shift']());}};_0x5e9451(++_0x1da8e9);}(_0x6cc6,0x1a0));var _0x66cc=function(_0x554acd,_0x350d2a){_0x554acd=_0x554acd-0x0;var _0x1d2a22=_0x6cc6[_0x554acd];return _0x1d2a22;};'use strict';var rp=require(_0x66cc('0x0'));var util=require(_0x66cc('0x1'));var _=require(_0x66cc('0x2'));var Mustache=require(_0x66cc('0x3'));var logger=require('../../../../config/logger')(_0x66cc('0x4'));exports[_0x66cc('0x5')]=function(_0xe6a422,_0x517e77){var _0x320674,_0x2babaa;var _0x5041cf={'method':_0xe6a422['data1']['toUpperCase'](),'uri':Mustache[_0x66cc('0x6')](_0xe6a422[_0x66cc('0x7')],_0x517e77),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xe6a422[_0x66cc('0x8')])===_0x66cc('0x9')&&parseInt(_0xe6a422[_0x66cc('0x8')])>=0x1&&parseInt(_0xe6a422[_0x66cc('0x8')])<=0xa?parseInt(_0xe6a422['data5'])*0x3e8:0x5*0x3e8};try{_0x5041cf[_0x66cc('0xa')]=_0xe6a422[_0x66cc('0xb')]?JSON[_0x66cc('0xc')](Mustache[_0x66cc('0x6')](_0xe6a422['data6'],_0x517e77)):{};}catch(_0x34c62b){logger['error'](_0x34c62b[_0x66cc('0xd')]);}switch(_0xe6a422[_0x66cc('0xe')]['toUpperCase']()){case _0x66cc('0xf'):case _0x66cc('0x10'):_0x320674=null;_0x5041cf['qs']=_0x517e77;break;case'POST':case _0x66cc('0x11'):if(_0xe6a422[_0x66cc('0x12')]){try{_0x320674=JSON[_0x66cc('0xc')](Mustache[_0x66cc('0x6')](_0xe6a422[_0x66cc('0x12')],_0x517e77));_0x5041cf[_0x66cc('0x13')]=_0x320674;}catch(_0x12d572){logger['error'](_0x12d572['stack']);logger[_0x66cc('0x14')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x320674=_0x517e77;_0x5041cf[_0x66cc('0x13')]=_0x320674;}break;}logger[_0x66cc('0x15')](util[_0x66cc('0x16')](_0x66cc('0x17'),_0xe6a422['data1'],_0xe6a422[_0x66cc('0x7')],JSON['stringify'](_0x5041cf)));rp(_0x5041cf)[_0x66cc('0x18')](function(_0x320ac2){_0x320674=!_['isNil'](_0x320674)?',\x20request\x20body:\x20'+_0x320674:'';_0x2babaa=typeof _0x320ac2['body']===_0x66cc('0x19')?JSON['stringify'](_0x320ac2[_0x66cc('0x13')]):_0x320ac2[_0x66cc('0x13')];logger[_0x66cc('0x15')](util[_0x66cc('0x16')](_0x66cc('0x1a'),_0xe6a422[_0x66cc('0xe')],_0xe6a422[_0x66cc('0x7')],_0x320ac2['statusCode'],_0x2babaa));})[_0x66cc('0x1b')](function(_0x490ab2){logger[_0x66cc('0x14')](util[_0x66cc('0x16')](_0x66cc('0x1c'),_0xe6a422[_0x66cc('0xe')],_0xe6a422[_0x66cc('0x7')],_0x490ab2[_0x66cc('0x1d')],_0x490ab2[_0x66cc('0x1e')],_0x490ab2['message']));});}; \ No newline at end of file +var _0x40c5=['toUpperCase','render','data2','data5','parse','data6','error','stack','DELETE','POST','PUT','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','statusCode','catch','name','message','request-promise','util','lodash','trigger','exec','data1'];(function(_0x5158ac,_0x245f83){var _0x25f3c6=function(_0x3ae2ff){while(--_0x3ae2ff){_0x5158ac['push'](_0x5158ac['shift']());}};_0x25f3c6(++_0x245f83);}(_0x40c5,0x76));var _0x540c=function(_0xee17ce,_0x3d4c9f){_0xee17ce=_0xee17ce-0x0;var _0x2486b2=_0x40c5[_0xee17ce];return _0x2486b2;};'use strict';var rp=require(_0x540c('0x0'));var util=require(_0x540c('0x1'));var _=require(_0x540c('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x540c('0x3'));exports[_0x540c('0x4')]=function(_0x280b18,_0x176f50){var _0x4c0f15,_0x36c804;var _0xdc5338={'method':_0x280b18[_0x540c('0x5')][_0x540c('0x6')](),'uri':Mustache[_0x540c('0x7')](_0x280b18[_0x540c('0x8')],_0x176f50),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x280b18[_0x540c('0x9')])==='number'&&parseInt(_0x280b18['data5'])>=0x1&&parseInt(_0x280b18[_0x540c('0x9')])<=0xa?parseInt(_0x280b18[_0x540c('0x9')])*0x3e8:0x5*0x3e8};try{_0xdc5338['headers']=_0x280b18['data6']?JSON[_0x540c('0xa')](Mustache[_0x540c('0x7')](_0x280b18[_0x540c('0xb')],_0x176f50)):{};}catch(_0x5c7c8b){logger[_0x540c('0xc')](_0x5c7c8b[_0x540c('0xd')]);}switch(_0x280b18['data1'][_0x540c('0x6')]()){case'GET':case _0x540c('0xe'):_0x4c0f15=null;_0xdc5338['qs']=_0x176f50;break;case _0x540c('0xf'):case _0x540c('0x10'):if(_0x280b18[_0x540c('0x11')]){try{_0x4c0f15=JSON[_0x540c('0xa')](Mustache['render'](_0x280b18[_0x540c('0x11')],_0x176f50));_0xdc5338[_0x540c('0x12')]=_0x4c0f15;}catch(_0x5d3d3f){logger[_0x540c('0xc')](_0x5d3d3f[_0x540c('0xd')]);logger[_0x540c('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4c0f15=_0x176f50;_0xdc5338[_0x540c('0x12')]=_0x4c0f15;}break;}logger[_0x540c('0x13')](util['format'](_0x540c('0x14'),_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],JSON[_0x540c('0x15')](_0xdc5338)));rp(_0xdc5338)[_0x540c('0x16')](function(_0x3c896f){_0x4c0f15=!_[_0x540c('0x17')](_0x4c0f15)?_0x540c('0x18')+_0x4c0f15:'';_0x36c804=typeof _0x3c896f[_0x540c('0x12')]===_0x540c('0x19')?JSON[_0x540c('0x15')](_0x3c896f[_0x540c('0x12')]):_0x3c896f[_0x540c('0x12')];logger[_0x540c('0x13')](util[_0x540c('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],_0x3c896f[_0x540c('0x1b')],_0x36c804));})[_0x540c('0x1c')](function(_0x2ac7f6){logger[_0x540c('0xc')](util[_0x540c('0x1a')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],_0x2ac7f6['statusCode'],_0x2ac7f6[_0x540c('0x1d')],_0x2ac7f6[_0x540c('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7437232..16e0c7f 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 _0xf437=['routing','client','Request','request','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x548483,_0x5e53ab){var _0x53afbd=function(_0x4c9f9c){while(--_0x4c9f9c){_0x548483['push'](_0x548483['shift']());}};_0x53afbd(++_0x5e53ab);}(_0xf437,0x196));var _0x7f43=function(_0x42835a,_0x5259a7){_0x42835a=_0x42835a-0x0;var _0xa4f23b=_0xf437[_0x42835a];return _0xa4f23b;};'use strict';var jayson=require(_0x7f43('0x0'));var BPromise=require(_0x7f43('0x1'));var logger=require('../../config/logger')(_0x7f43('0x2'));var client=jayson[_0x7f43('0x3')]['http']({'port':0x2329});client[_0x7f43('0x4')]=function(_0x484ae7,_0x5b1ed2){return new BPromise(function(_0x3b3d51,_0x24b325){return client[_0x7f43('0x5')](_0x484ae7,_0x5b1ed2)['then'](function(_0x336cbb){logger['debug'](_0x7f43('0x6'),'routing',_0x484ae7,_0x5b1ed2,_0x336cbb);if(_0x336cbb[_0x7f43('0x7')]){logger[_0x7f43('0x7')](_0x7f43('0x6'),_0x7f43('0x2'),_0x484ae7,_0x336cbb[_0x7f43('0x7')]['message'],_0x5b1ed2);return _0x24b325(_0x336cbb[_0x7f43('0x7')][_0x7f43('0x8')]);}else{return _0x3b3d51(_0x336cbb[_0x7f43('0x9')]);}})[_0x7f43('0xa')](function(_0x336d02){logger[_0x7f43('0x7')](_0x7f43('0x6'),_0x7f43('0x2'),_0x484ae7,_0x336d02,_0x5b1ed2);return _0x24b325(_0x336d02);});});};module[_0x7f43('0xb')]=client; \ No newline at end of file +var _0x42ac=['message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','then','debug','rpc','error'];(function(_0x425c4a,_0x3bde21){var _0x3537ea=function(_0xac6874){while(--_0xac6874){_0x425c4a['push'](_0x425c4a['shift']());}};_0x3537ea(++_0x3bde21);}(_0x42ac,0x92));var _0xc42a=function(_0x4a1cb2,_0x40660c){_0x4a1cb2=_0x4a1cb2-0x0;var _0xc6693a=_0x42ac[_0x4a1cb2];return _0xc6693a;};'use strict';var jayson=require(_0xc42a('0x0'));var BPromise=require(_0xc42a('0x1'));var logger=require(_0xc42a('0x2'))(_0xc42a('0x3'));var client=jayson[_0xc42a('0x4')]['http']({'port':0x2329});client[_0xc42a('0x5')]=function(_0x52c68e,_0x38fc62){return new BPromise(function(_0x4a97e4,_0x2c8c1e){return client['request'](_0x52c68e,_0x38fc62)[_0xc42a('0x6')](function(_0x3fe07d){logger[_0xc42a('0x7')](_0xc42a('0x8'),_0xc42a('0x3'),_0x52c68e,_0x38fc62,_0x3fe07d);if(_0x3fe07d[_0xc42a('0x9')]){logger[_0xc42a('0x9')]('rpc','routing',_0x52c68e,_0x3fe07d[_0xc42a('0x9')][_0xc42a('0xa')],_0x38fc62);return _0x2c8c1e(_0x3fe07d[_0xc42a('0x9')]['message']);}else{return _0x4a97e4(_0x3fe07d['result']);}})[_0xc42a('0xb')](function(_0x31c518){logger['error']('rpc',_0xc42a('0x3'),_0x52c68e,_0x31c518,_0x38fc62);return _0x2c8c1e(_0x31c518);});});};module[_0xc42a('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7350dbf..b7a0e10 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 _0xc2d3=['catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x13d52d,_0xd2e31d){var _0x59eddf=function(_0x38ecdd){while(--_0x38ecdd){_0x13d52d['push'](_0x13d52d['shift']());}};_0x59eddf(++_0xd2e31d);}(_0xc2d3,0xfe));var _0x3c2d=function(_0x2902e2,_0x5033a1){_0x2902e2=_0x2902e2-0x0;var _0x5d3589=_0xc2d3[_0x2902e2];return _0x5d3589;};'use strict';var BPromise=require(_0x3c2d('0x0'));var server=require(_0x3c2d('0x1'));var Realtime=require(_0x3c2d('0x2'));var EmailChannel=require(_0x3c2d('0x3'));var mailAccount=require(_0x3c2d('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3c2d('0x5')]()[_0x3c2d('0x6')](mailAccount['getMailAccounts']())[_0x3c2d('0x6')](realtime[_0x3c2d('0x7')]())[_0x3c2d('0x6')](function(){email['refresh'](realtime[_0x3c2d('0x8')]);return realtime;});}function main(){return server[_0x3c2d('0x9')](realtime,email)[_0x3c2d('0x6')](function(){return initRealtime();})[_0x3c2d('0x6')](function(){return setting[_0x3c2d('0xa')]();})['then'](function(_0x74547c){return setInterval(initRealtime,_0x74547c[_0x3c2d('0xb')]*0x3e8);})[_0x3c2d('0xc')](function(_0x285d3a){console[_0x3c2d('0xd')](_0x285d3a);});}main(); \ No newline at end of file +var _0xa587=['listen','getSettings','loginMailFrequency','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x4a6802,_0x4ec00b){var _0x5e407b=function(_0x45bd4a){while(--_0x45bd4a){_0x4a6802['push'](_0x4a6802['shift']());}};_0x5e407b(++_0x4ec00b);}(_0xa587,0xa9));var _0x7a58=function(_0x5ae4e9,_0x937967){_0x5ae4e9=_0x5ae4e9-0x0;var _0x552c84=_0xa587[_0x5ae4e9];return _0x552c84;};'use strict';var BPromise=require(_0x7a58('0x0'));var server=require(_0x7a58('0x1'));var Realtime=require(_0x7a58('0x2'));var EmailChannel=require(_0x7a58('0x3'));var mailAccount=require(_0x7a58('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x7a58('0x5')]()[_0x7a58('0x6')](mailAccount[_0x7a58('0x7')]())[_0x7a58('0x6')](realtime[_0x7a58('0x8')]())[_0x7a58('0x6')](function(){email[_0x7a58('0x9')](realtime[_0x7a58('0xa')]);return realtime;});}function main(){return server[_0x7a58('0xb')](realtime,email)[_0x7a58('0x6')](function(){return initRealtime();})[_0x7a58('0x6')](function(){return setting[_0x7a58('0xc')]();})['then'](function(_0x15efe4){return setInterval(initRealtime,_0x15efe4[_0x7a58('0xd')]*0x3e8);})['catch'](function(_0xc7974){console[_0x7a58('0xe')](_0xc7974);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d4ff9f5..e1ab63b 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 _0x4381=['messageStatus','isNil','stringify','refresh','hasOwnProperty','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','connected','total','messages','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status'];(function(_0xfca14d,_0x90643e){var _0x270063=function(_0x5aae85){while(--_0x5aae85){_0xfca14d['push'](_0xfca14d['shift']());}};_0x270063(++_0x90643e);}(_0x4381,0x1bf));var _0x1438=function(_0x16710a,_0x512193){_0x16710a=_0x16710a-0x0;var _0x25fcb5=_0x4381[_0x16710a];return _0x25fcb5;};'use strict';var _=require(_0x1438('0x0'));var moment=require(_0x1438('0x1'));var BPromise=require('bluebird');var md5=require(_0x1438('0x2'));var Redis=require('ioredis');var config=require(_0x1438('0x3'));var logger=require(_0x1438('0x4'))(_0x1438('0x5'));config[_0x1438('0x6')]=_[_0x1438('0x7')](config[_0x1438('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1438('0x8'))(new Redis(config[_0x1438('0x6')]));var EmailImap=require(_0x1438('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x1438('0xa'));var md5Accounts={};function EmailChannel(_0x433762){logger[_0x1438('0xb')]('start\x20email\x20channel');this[_0x1438('0xc')]=_0x433762[_0x1438('0xc')];this[_0x1438('0xd')]={};this[_0x1438('0xe')]=new EmailSmtp();}EmailChannel[_0x1438('0xf')][_0x1438('0x10')]=function(_0xa4da55){var _0x33caeb=this[_0x1438('0xc')][_0xa4da55];var _0x1efb21={'id':_0x33caeb['id'],'name':_0x33caeb[_0x1438('0x11')],'key':_0x33caeb['key'],'active':_0x33caeb[_0x1438('0x12')],'Imap':{'status':_0x33caeb[_0x1438('0x13')][_0x1438('0x14')],'messageStatus':_0x33caeb[_0x1438('0x13')][_0x1438('0x15')],'total':_0x33caeb[_0x1438('0x13')]['total']}};if(_[_0x1438('0x16')](md5Accounts[_0xa4da55])){md5Accounts[_0xa4da55]={};}var _0x273f87=md5(JSON[_0x1438('0x17')](_0x1efb21));if(md5Accounts[_0xa4da55][_0x1438('0x2')]!==_0x273f87){md5Accounts[_0xa4da55]['md5']=_0x273f87;io[_0x1438('0x10')]('mailAccount:update',_0x1efb21);}};EmailChannel['prototype'][_0x1438('0x18')]=function(_0x1344ee){for(var _0xf433d4 in _0x1344ee){if(_0x1344ee[_0x1438('0x19')](_0xf433d4)){if(_0x1344ee[_0xf433d4][_0x1438('0x13')]&&_0x1344ee[_0xf433d4]['active']){var _0x5d1b6c=_0x1344ee[_0xf433d4][_0x1438('0x13')];if(!this[_0x1438('0xd')]['hasOwnProperty'](_0x5d1b6c['id'])){this[_0x1438('0xd')][_0x5d1b6c['id']]=new EmailImap(_0x5d1b6c,_0x1344ee[_0xf433d4][_0x1438('0x5')]);this['imapAccounts'][_0x5d1b6c['id']]['on'](_0x1438('0x1a'),this['handleImapBox'][_0x1438('0x1b')](this,_0xf433d4));this['imapAccounts'][_0x5d1b6c['id']]['on'](_0x1438('0x5'),this[_0x1438('0x1c')][_0x1438('0x1b')](this,_0xf433d4));this[_0x1438('0xd')][_0x5d1b6c['id']]['on'](_0x1438('0x1d'),this['handleImapEnd']['bind'](this,_0xf433d4));this['imapAccounts'][_0x5d1b6c['id']]['on'](_0x1438('0x1e'),this[_0x1438('0x1f')][_0x1438('0x1b')](this,_0xf433d4));}}else{if(_['isNil'](this[_0x1438('0xc')][_0xf433d4][_0x1438('0x13')])){this[_0x1438('0xc')][_0xf433d4][_0x1438('0x13')]={};}this[_0x1438('0xc')][_0xf433d4][_0x1438('0x13')]['status']=_0x1438('0x20');this[_0x1438('0xc')][_0xf433d4]['Imap']['messageStatus']='';this[_0x1438('0x10')](_0xf433d4);}}}};EmailChannel[_0x1438('0xf')][_0x1438('0x21')]=function(_0x2b96ea,_0x991aaf){if(this[_0x1438('0xc')][_0x2b96ea]){this[_0x1438('0xc')][_0x2b96ea][_0x1438('0x13')][_0x1438('0x14')]=_0x1438('0x22');this[_0x1438('0xc')][_0x2b96ea]['Imap']['messageStatus']=_0x991aaf[_0x1438('0x11')];if(_0x991aaf['messages']){this['mailAccounts'][_0x2b96ea][_0x1438('0x13')][_0x1438('0x23')]=_0x991aaf[_0x1438('0x24')][_0x1438('0x23')];}return this[_0x1438('0x10')](_0x2b96ea);}};EmailChannel['prototype'][_0x1438('0x1c')]=function(_0x1d6bfd,_0x555a8c){logger[_0x1438('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x555a8c[_0x1438('0x25')],_0x555a8c[_0x1438('0x26')],_0x555a8c['from'],_0x1d6bfd);if(this[_0x1438('0xc')][_0x1d6bfd]){return mailAccount[_0x1438('0x27')](_0x1d6bfd,_0x555a8c)[_0x1438('0x28')](function(_0x5557a5){if(_0x5557a5){logger[_0x1438('0xb')](_0x1438('0x29'));}})[_0x1438('0x2a')](function(_0x4a0f83){logger[_0x1438('0x1e')](_0x1438('0x2b'),JSON[_0x1438('0x17')](_0x4a0f83));});}};EmailChannel[_0x1438('0xf')][_0x1438('0x2c')]=function(_0x590647){if(this[_0x1438('0xc')][_0x590647]&&this[_0x1438('0xc')][_0x590647][_0x1438('0x13')]){if(this[_0x1438('0xd')][this[_0x1438('0xc')][_0x590647][_0x1438('0x13')]['id']]){delete this[_0x1438('0xd')][this[_0x1438('0xc')][_0x590647][_0x1438('0x13')]['id']];}this['mailAccounts'][_0x590647]['Imap'][_0x1438('0x2d')]=moment();this['emit'](_0x590647);}};EmailChannel[_0x1438('0xf')][_0x1438('0x1f')]=function(_0x364faa,_0x118cf6){if(this[_0x1438('0xc')][_0x364faa]){this[_0x1438('0xc')][_0x364faa][_0x1438('0x13')][_0x1438('0x14')]=_0x1438('0x1e');this[_0x1438('0xc')][_0x364faa][_0x1438('0x13')][_0x1438('0x15')]=_0x118cf6;return this[_0x1438('0x10')](_0x364faa);}};EmailChannel[_0x1438('0xf')][_0x1438('0x2e')]=function(_0x2341a2,_0x344667){return this[_0x1438('0xe')]['send'](_0x2341a2,_0x344667);};EmailChannel[_0x1438('0xf')][_0x1438('0x2f')]=function(_0x30bf67){var _0x4e8bc6=this;if(this[_0x1438('0xc')][_0x30bf67['id']]){if(_['isNil'](this[_0x1438('0xc')][_0x30bf67['id']][_0x1438('0x30')])){this['mailAccounts'][_0x30bf67['id']]['Smtp']={};}this['mailAccounts'][_0x30bf67['id']][_0x1438('0x30')][_0x1438('0x2d')]=moment();return new BPromise(function(_0x3ad961,_0x36bd88){return _0x4e8bc6['smtp'][_0x1438('0x31')](_0x30bf67)['then'](function(_0x80795f){_0x4e8bc6[_0x1438('0xc')][_0x30bf67['id']]['Smtp'][_0x1438('0x14')]=_0x1438('0x32');_0x4e8bc6[_0x1438('0xc')][_0x30bf67['id']][_0x1438('0x30')][_0x1438('0x15')]='';_0x4e8bc6['emit'](_0x30bf67['id']);_0x3ad961(_0x80795f);})[_0x1438('0x2a')](function(_0x4163c7){_0x4e8bc6['mailAccounts'][_0x30bf67['id']]['Smtp'][_0x1438('0x14')]='error';_0x4e8bc6[_0x1438('0xc')][_0x30bf67['id']][_0x1438('0x30')]['messageStatus']=_0x4163c7;_0x4e8bc6[_0x1438('0x10')](_0x30bf67['id']);_0x36bd88(_0x4163c7);});});}return this[_0x1438('0xe')]['verify'](_0x30bf67);};module[_0x1438('0x33')]=EmailChannel; \ No newline at end of file +var _0x4b35=['defaults','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','active','Imap','status','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','messageStatus','connected','name','total','messages','from','notify','Mail\x20accepted\x20from\x20routing','lastSync','send','verifySmtp','Smtp','verify','then','verified','catch','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','redis'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0x4b35,0x1e3));var _0x54b3=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0x4b35[_0x159f8e];return _0x458e17;};'use strict';var _=require(_0x54b3('0x0'));var moment=require(_0x54b3('0x1'));var BPromise=require(_0x54b3('0x2'));var md5=require(_0x54b3('0x3'));var Redis=require('ioredis');var config=require(_0x54b3('0x4'));var logger=require(_0x54b3('0x5'))('email');config[_0x54b3('0x6')]=_[_0x54b3('0x7')](config[_0x54b3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x54b3('0x8'))(new Redis(config[_0x54b3('0x6')]));var EmailImap=require(_0x54b3('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x292fc8){logger[_0x54b3('0xa')](_0x54b3('0xb'));this[_0x54b3('0xc')]=_0x292fc8['mailAccounts'];this[_0x54b3('0xd')]={};this[_0x54b3('0xe')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x2b1d1a){var _0x5e1ec4=this[_0x54b3('0xc')][_0x2b1d1a];var _0x47adff={'id':_0x5e1ec4['id'],'name':_0x5e1ec4['name'],'key':_0x5e1ec4['key'],'active':_0x5e1ec4[_0x54b3('0xf')],'Imap':{'status':_0x5e1ec4[_0x54b3('0x10')][_0x54b3('0x11')],'messageStatus':_0x5e1ec4[_0x54b3('0x10')]['messageStatus'],'total':_0x5e1ec4[_0x54b3('0x10')]['total']}};if(_['isNil'](md5Accounts[_0x2b1d1a])){md5Accounts[_0x2b1d1a]={};}var _0x507581=md5(JSON[_0x54b3('0x12')](_0x47adff));if(md5Accounts[_0x2b1d1a]['md5']!==_0x507581){md5Accounts[_0x2b1d1a][_0x54b3('0x3')]=_0x507581;io[_0x54b3('0x13')](_0x54b3('0x14'),_0x47adff);}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x16')]=function(_0xdeba46){for(var _0x58d992 in _0xdeba46){if(_0xdeba46[_0x54b3('0x17')](_0x58d992)){if(_0xdeba46[_0x58d992]['Imap']&&_0xdeba46[_0x58d992]['active']){var _0x4a43e2=_0xdeba46[_0x58d992]['Imap'];if(!this['imapAccounts'][_0x54b3('0x17')](_0x4a43e2['id'])){this[_0x54b3('0xd')][_0x4a43e2['id']]=new EmailImap(_0x4a43e2,_0xdeba46[_0x58d992][_0x54b3('0x18')]);this['imapAccounts'][_0x4a43e2['id']]['on'](_0x54b3('0x19'),this[_0x54b3('0x1a')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on'](_0x54b3('0x18'),this[_0x54b3('0x1c')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on']('end',this[_0x54b3('0x1d')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on'](_0x54b3('0x1e'),this[_0x54b3('0x1f')][_0x54b3('0x1b')](this,_0x58d992));}}else{if(_[_0x54b3('0x20')](this[_0x54b3('0xc')][_0x58d992]['Imap'])){this[_0x54b3('0xc')][_0x58d992][_0x54b3('0x10')]={};}this['mailAccounts'][_0x58d992][_0x54b3('0x10')][_0x54b3('0x11')]='disabled';this[_0x54b3('0xc')][_0x58d992][_0x54b3('0x10')][_0x54b3('0x21')]='';this[_0x54b3('0x13')](_0x58d992);}}}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x1a')]=function(_0x53227c,_0x22874b){if(this[_0x54b3('0xc')][_0x53227c]){this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x11')]=_0x54b3('0x22');this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x21')]=_0x22874b[_0x54b3('0x23')];if(_0x22874b['messages']){this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x24')]=_0x22874b[_0x54b3('0x25')][_0x54b3('0x24')];}return this[_0x54b3('0x13')](_0x53227c);}};EmailChannel[_0x54b3('0x15')]['handleImapEmail']=function(_0x16fd3d,_0x2d504c){logger[_0x54b3('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2d504c['firstName'],_0x2d504c['lastName'],_0x2d504c[_0x54b3('0x26')],_0x16fd3d);if(this['mailAccounts'][_0x16fd3d]){return mailAccount[_0x54b3('0x27')](_0x16fd3d,_0x2d504c)['then'](function(_0xabeeee){if(_0xabeeee){logger[_0x54b3('0xa')](_0x54b3('0x28'));}})['catch'](function(_0x2e9b92){logger[_0x54b3('0x1e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x54b3('0x12')](_0x2e9b92));});}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x1d')]=function(_0x4b1929){if(this[_0x54b3('0xc')][_0x4b1929]&&this[_0x54b3('0xc')][_0x4b1929][_0x54b3('0x10')]){if(this[_0x54b3('0xd')][this['mailAccounts'][_0x4b1929][_0x54b3('0x10')]['id']]){delete this['imapAccounts'][this[_0x54b3('0xc')][_0x4b1929]['Imap']['id']];}this[_0x54b3('0xc')][_0x4b1929][_0x54b3('0x10')][_0x54b3('0x29')]=moment();this[_0x54b3('0x13')](_0x4b1929);}};EmailChannel[_0x54b3('0x15')]['handleImapError']=function(_0x413947,_0x16699b){if(this[_0x54b3('0xc')][_0x413947]){this[_0x54b3('0xc')][_0x413947][_0x54b3('0x10')][_0x54b3('0x11')]=_0x54b3('0x1e');this[_0x54b3('0xc')][_0x413947][_0x54b3('0x10')][_0x54b3('0x21')]=_0x16699b;return this['emit'](_0x413947);}};EmailChannel[_0x54b3('0x15')]['sendMail']=function(_0x19a78a,_0x46417d){return this[_0x54b3('0xe')][_0x54b3('0x2a')](_0x19a78a,_0x46417d);};EmailChannel[_0x54b3('0x15')][_0x54b3('0x2b')]=function(_0x4bcaef){var _0x3739c4=this;if(this[_0x54b3('0xc')][_0x4bcaef['id']]){if(_[_0x54b3('0x20')](this['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')])){this[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')]={};}this[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x29')]=moment();return new BPromise(function(_0x493447,_0x63d9be){return _0x3739c4[_0x54b3('0xe')][_0x54b3('0x2d')](_0x4bcaef)[_0x54b3('0x2e')](function(_0x130f3a){_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x11')]=_0x54b3('0x2f');_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x21')]='';_0x3739c4[_0x54b3('0x13')](_0x4bcaef['id']);_0x493447(_0x130f3a);})[_0x54b3('0x30')](function(_0x14f8ba){_0x3739c4[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x11')]=_0x54b3('0x1e');_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')]['messageStatus']=_0x14f8ba;_0x3739c4['emit'](_0x4bcaef['id']);_0x63d9be(_0x14f8ba);});});}return this[_0x54b3('0xe')][_0x54b3('0x2d')](_0x4bcaef);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 3280439..b56b6fd 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 _0xd0d5=['handleCloseBox','handleReadUnseen','length','fetch','message','error','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','handleEnd','stringify','textCode','exports','mailparser','simpleParser','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','imap','end','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','required','getHost','service','openBox','handleOpenBox','handleError','emit','box','readUnseen'];(function(_0x5a4e5a,_0x5eea47){var _0x3685f5=function(_0x1a5c5d){while(--_0x1a5c5d){_0x5a4e5a['push'](_0x5a4e5a['shift']());}};_0x3685f5(++_0x5eea47);}(_0xd0d5,0x1ed));var _0x5d0d=function(_0x139ed9,_0x18cb87){_0x139ed9=_0x139ed9-0x0;var _0x46fd60=_0xd0d5[_0x139ed9];return _0x46fd60;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require('imap');var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x5d0d('0x0'))[_0x5d0d('0x1')];var Iconv=require(_0x5d0d('0x2'))['Iconv'];var EventEmitter=require('events')[_0x5d0d('0x3')];var utils=require(_0x5d0d('0x4'));var logger=require(_0x5d0d('0x5'))(_0x5d0d('0x6'));function EmailImap(_0x5ace89,_0x36598d){this[_0x5d0d('0x7')]=_0x5d0d('0x8');this[_0x5d0d('0x9')]=this[_0x5d0d('0xa')](_0x5ace89,_0x36598d);this['imap']=new Imap(this[_0x5d0d('0x9')]);this['imap'][_0x5d0d('0xb')](_0x5d0d('0xc'),this[_0x5d0d('0xd')][_0x5d0d('0xe')](this));this[_0x5d0d('0xf')][_0x5d0d('0xb')](_0x5d0d('0x10'),this['handleEnd'][_0x5d0d('0xe')](this));this[_0x5d0d('0xf')]['on']('error',this['handleError'][_0x5d0d('0xe')](this));this[_0x5d0d('0xf')][_0x5d0d('0x11')]();}util[_0x5d0d('0x12')](EmailImap,EventEmitter);EmailImap[_0x5d0d('0x13')][_0x5d0d('0xa')]=function(_0x352f7e,_0x36e7a2){var _0x409d77={'connTimeout':_0x352f7e[_0x5d0d('0x14')]?_0x352f7e[_0x5d0d('0x14')]*0x3e8:0x2710,'authTimeout':_0x352f7e[_0x5d0d('0x15')]?_0x352f7e[_0x5d0d('0x15')]*0x3e8:0x1388};if(_[_0x5d0d('0x16')](_0x352f7e['service'])){if(_0x352f7e[_0x5d0d('0x17')]){_0x409d77[_0x5d0d('0x18')]=_0x352f7e['user'];_0x409d77[_0x5d0d('0x19')]=_0x352f7e[_0x5d0d('0x19')];}_0x409d77[_0x5d0d('0x1a')]=_0x352f7e[_0x5d0d('0x1a')];_0x409d77[_0x5d0d('0x1b')]=_0x352f7e[_0x5d0d('0x1b')]||0x3e1;if(_0x352f7e[_0x5d0d('0x1c')]){_0x409d77[_0x5d0d('0x1c')]=!![];}else{_0x409d77[_0x5d0d('0x1c')]=![];_0x409d77['autotls']=_0x5d0d('0x1d');}}else{_0x409d77[_0x5d0d('0x18')]=_0x352f7e[_0x5d0d('0x18')];_0x409d77['password']=_0x352f7e[_0x5d0d('0x19')];_0x409d77[_0x5d0d('0x1a')]=utils[_0x5d0d('0x1e')](_0x352f7e[_0x5d0d('0x1f')]);_0x409d77['port']=0x3e1;_0x409d77['tls']=!![];}_0x409d77[_0x5d0d('0x6')]=_0x36e7a2||_0x352f7e[_0x5d0d('0x18')]||'anonymous@xcally.com';return _0x409d77;};EmailImap[_0x5d0d('0x13')][_0x5d0d('0xd')]=function(){this[_0x5d0d('0xf')][_0x5d0d('0x20')](this[_0x5d0d('0x7')],![],this[_0x5d0d('0x21')][_0x5d0d('0xe')](this));};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x21')]=function(_0x5008de,_0x3df4f0){if(_0x5008de){this[_0x5d0d('0x22')](_0x5008de,!![]);}else{this[_0x5d0d('0x23')](_0x5d0d('0x24'),_0x3df4f0);this[_0x5d0d('0x25')]();}};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x26')]=function(_0x1e94a2){if(_0x1e94a2){this[_0x5d0d('0x22')](_0x1e94a2,!![]);}else{this[_0x5d0d('0xf')][_0x5d0d('0x10')]();}};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x25')]=function(){this['imap']['search'](['UNSEEN'],this[_0x5d0d('0x27')][_0x5d0d('0xe')](this));};EmailImap[_0x5d0d('0x13')]['handleReadUnseen']=function(_0x132242,_0x39d2a2){if(_0x132242){this[_0x5d0d('0x22')](_0x132242,!![]);}else{if(_0x39d2a2[_0x5d0d('0x28')]){try{var _0x32c570=this[_0x5d0d('0xf')][_0x5d0d('0x29')](_0x39d2a2,{'bodies':'','markSeen':!![]});_0x32c570['on'](_0x5d0d('0x2a'),this['handleFetchMessage'][_0x5d0d('0xe')](this));_0x32c570[_0x5d0d('0xb')](_0x5d0d('0x2b'),this['handleFetchError'][_0x5d0d('0xe')](this));_0x32c570[_0x5d0d('0xb')](_0x5d0d('0x10'),this[_0x5d0d('0x2c')][_0x5d0d('0xe')](this));}catch(_0x5a15e6){logger[_0x5d0d('0x2b')](_0x5a15e6);}}else{this[_0x5d0d('0xf')][_0x5d0d('0x2d')](!![],this[_0x5d0d('0x26')][_0x5d0d('0xe')](this));}}};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x2e')]=function(_0x2564dd,_0xe81e76){_0x2564dd['on'](_0x5d0d('0x2f'),this[_0x5d0d('0x30')][_0x5d0d('0xe')](this));_0x2564dd[_0x5d0d('0xb')](_0x5d0d('0x31'),this[_0x5d0d('0x32')][_0x5d0d('0xe')](this));_0x2564dd['once'](_0x5d0d('0x10'),this[_0x5d0d('0x33')][_0x5d0d('0xe')](this));};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x30')]=function(_0x13fc1e,_0x185279){simpleParser(_0x13fc1e,{'Iconv':Iconv},this[_0x5d0d('0x34')][_0x5d0d('0xe')](this));};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x32')]=function(_0x28f1d7){};EmailImap[_0x5d0d('0x13')]['handleMessageEnd']=function(){};EmailImap[_0x5d0d('0x13')]['handleSimpleParser']=function(_0x266f85,_0x4e794e){if(_0x266f85){logger['error'](_0x266f85);}else{var _0x1274c2=this;utils[_0x5d0d('0x35')](this['account'],_0x4e794e,function(_0x1decfe){_0x1274c2[_0x5d0d('0x23')](_0x5d0d('0x6'),_0x1decfe);});}};EmailImap['prototype'][_0x5d0d('0x2c')]=function(){this[_0x5d0d('0xf')]['closeBox'](!![],this['handleCloseBox'][_0x5d0d('0xe')](this));};EmailImap['prototype'][_0x5d0d('0x36')]=function(_0x5a2c5f){this[_0x5d0d('0x22')](_0x5a2c5f);this[_0x5d0d('0xf')][_0x5d0d('0x2d')](!![],this[_0x5d0d('0x26')][_0x5d0d('0xe')](this));};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x37')]=function(){this[_0x5d0d('0x23')]('end');};EmailImap[_0x5d0d('0x13')][_0x5d0d('0x22')]=function(_0xed3cd0,_0x24f363){logger[_0x5d0d('0x2b')](_0x5d0d('0x22'),this[_0x5d0d('0x9')][_0x5d0d('0x6')],JSON[_0x5d0d('0x38')](_0xed3cd0));var _0xbee16='';if(_0xed3cd0){if(_0xed3cd0['textCode']){_0xbee16=_0xed3cd0[_0x5d0d('0x39')];}else{for(var _0x50f006 in _0xed3cd0){if(_0xed3cd0['hasOwnProperty'](_0x50f006)){_0xbee16+=_['upperFirst'](_0x50f006)+':\x20'+_0xed3cd0[_0x50f006]+'\x0a';}}}}if(_0x24f363){this[_0x5d0d('0xf')][_0x5d0d('0x10')]();}else{this[_0x5d0d('0x23')]('error',_0xbee16);this[_0x5d0d('0x23')](_0x5d0d('0x10'));}};module[_0x5d0d('0x3a')]=EmailImap; \ No newline at end of file +var _0x2064=['events','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','imap','account','once','ready','handleReady','bind','end','error','connect','connTimeout','authTimeout','isNil','service','user','host','port','tls','autotls','required','password','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchError','textCode','hasOwnProperty','upperFirst','exports','path','randomstring','mailparser','simpleParser','iconv','Iconv'];(function(_0x325286,_0x1c7e8c){var _0x6c154b=function(_0x219229){while(--_0x219229){_0x325286['push'](_0x325286['shift']());}};_0x6c154b(++_0x1c7e8c);}(_0x2064,0x1ac));var _0x4206=function(_0x3dc240,_0x5e60a6){_0x3dc240=_0x3dc240-0x0;var _0x525373=_0x2064[_0x3dc240];return _0x525373;};'use strict';var fs=require('fs');var path=require(_0x4206('0x0'));var util=require('util');var Imap=require('imap');var _=require('lodash');var rs=require(_0x4206('0x1'));var simpleParser=require(_0x4206('0x2'))[_0x4206('0x3')];var Iconv=require(_0x4206('0x4'))[_0x4206('0x5')];var EventEmitter=require(_0x4206('0x6'))['EventEmitter'];var utils=require(_0x4206('0x7'));var logger=require(_0x4206('0x8'))(_0x4206('0x9'));function EmailImap(_0x11a49d,_0x3f8ccd){this[_0x4206('0xa')]=_0x4206('0xb');this['account']=this[_0x4206('0xc')](_0x11a49d,_0x3f8ccd);this[_0x4206('0xd')]=new Imap(this[_0x4206('0xe')]);this[_0x4206('0xd')][_0x4206('0xf')](_0x4206('0x10'),this[_0x4206('0x11')][_0x4206('0x12')](this));this[_0x4206('0xd')][_0x4206('0xf')](_0x4206('0x13'),this['handleEnd'][_0x4206('0x12')](this));this[_0x4206('0xd')]['on'](_0x4206('0x14'),this['handleError']['bind'](this));this[_0x4206('0xd')][_0x4206('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x4206('0xc')]=function(_0x27c6b1,_0x4217bb){var _0x2f676f={'connTimeout':_0x27c6b1[_0x4206('0x16')]?_0x27c6b1[_0x4206('0x16')]*0x3e8:0x2710,'authTimeout':_0x27c6b1[_0x4206('0x17')]?_0x27c6b1['authTimeout']*0x3e8:0x1388};if(_[_0x4206('0x18')](_0x27c6b1[_0x4206('0x19')])){if(_0x27c6b1['authentication']){_0x2f676f[_0x4206('0x1a')]=_0x27c6b1['user'];_0x2f676f['password']=_0x27c6b1['password'];}_0x2f676f['host']=_0x27c6b1[_0x4206('0x1b')];_0x2f676f[_0x4206('0x1c')]=_0x27c6b1[_0x4206('0x1c')]||0x3e1;if(_0x27c6b1['tls']){_0x2f676f[_0x4206('0x1d')]=!![];}else{_0x2f676f['tls']=![];_0x2f676f[_0x4206('0x1e')]=_0x4206('0x1f');}}else{_0x2f676f[_0x4206('0x1a')]=_0x27c6b1[_0x4206('0x1a')];_0x2f676f['password']=_0x27c6b1[_0x4206('0x20')];_0x2f676f[_0x4206('0x1b')]=utils[_0x4206('0x21')](_0x27c6b1[_0x4206('0x19')]);_0x2f676f[_0x4206('0x1c')]=0x3e1;_0x2f676f['tls']=!![];}_0x2f676f[_0x4206('0x9')]=_0x4217bb||_0x27c6b1[_0x4206('0x1a')]||_0x4206('0x22');return _0x2f676f;};EmailImap[_0x4206('0x23')][_0x4206('0x11')]=function(){this[_0x4206('0xd')][_0x4206('0x24')](this['mailbox'],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x4206('0x23')][_0x4206('0x25')]=function(_0x1b1960,_0x27ef52){if(_0x1b1960){this[_0x4206('0x26')](_0x1b1960,!![]);}else{this['emit'](_0x4206('0x27'),_0x27ef52);this[_0x4206('0x28')]();}};EmailImap[_0x4206('0x23')][_0x4206('0x29')]=function(_0x50d09a){if(_0x50d09a){this[_0x4206('0x26')](_0x50d09a,!![]);}else{this[_0x4206('0xd')][_0x4206('0x13')]();}};EmailImap[_0x4206('0x23')][_0x4206('0x28')]=function(){this[_0x4206('0xd')][_0x4206('0x2a')]([_0x4206('0x2b')],this['handleReadUnseen'][_0x4206('0x12')](this));};EmailImap[_0x4206('0x23')][_0x4206('0x2c')]=function(_0xbe5e7,_0x5128ec){if(_0xbe5e7){this[_0x4206('0x26')](_0xbe5e7,!![]);}else{if(_0x5128ec['length']){try{var _0x203660=this[_0x4206('0xd')]['fetch'](_0x5128ec,{'bodies':'','markSeen':!![]});_0x203660['on'](_0x4206('0x2d'),this[_0x4206('0x2e')]['bind'](this));_0x203660[_0x4206('0xf')](_0x4206('0x14'),this['handleFetchError'][_0x4206('0x12')](this));_0x203660[_0x4206('0xf')](_0x4206('0x13'),this[_0x4206('0x2f')]['bind'](this));}catch(_0x2dd50e){logger[_0x4206('0x14')](_0x2dd50e);}}else{this[_0x4206('0xd')][_0x4206('0x30')](!![],this['handleCloseBox'][_0x4206('0x12')](this));}}};EmailImap[_0x4206('0x23')][_0x4206('0x2e')]=function(_0x3d504f,_0x2f6863){_0x3d504f['on'](_0x4206('0x31'),this[_0x4206('0x32')][_0x4206('0x12')](this));_0x3d504f[_0x4206('0xf')](_0x4206('0x33'),this[_0x4206('0x34')]['bind'](this));_0x3d504f['once'](_0x4206('0x13'),this[_0x4206('0x35')]['bind'](this));};EmailImap[_0x4206('0x23')]['handleMessageBody']=function(_0x58b07e,_0x311cdc){simpleParser(_0x58b07e,{'Iconv':Iconv},this[_0x4206('0x36')][_0x4206('0x12')](this));};EmailImap['prototype'][_0x4206('0x34')]=function(_0x154597){};EmailImap[_0x4206('0x23')][_0x4206('0x35')]=function(){};EmailImap[_0x4206('0x23')]['handleSimpleParser']=function(_0x34e6e9,_0xb0a1b9){if(_0x34e6e9){logger['error'](_0x34e6e9);}else{var _0x53805e=this;utils[_0x4206('0x37')](this[_0x4206('0xe')],_0xb0a1b9,function(_0x194305){_0x53805e[_0x4206('0x38')](_0x4206('0x9'),_0x194305);});}};EmailImap[_0x4206('0x23')][_0x4206('0x2f')]=function(){this[_0x4206('0xd')]['closeBox'](!![],this[_0x4206('0x29')][_0x4206('0x12')](this));};EmailImap[_0x4206('0x23')][_0x4206('0x39')]=function(_0x366772){this[_0x4206('0x26')](_0x366772);this[_0x4206('0xd')][_0x4206('0x30')](!![],this[_0x4206('0x29')][_0x4206('0x12')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit']('end');};EmailImap['prototype']['handleError']=function(_0x480cc1,_0x431d73){logger['error'](_0x4206('0x26'),this[_0x4206('0xe')][_0x4206('0x9')],JSON['stringify'](_0x480cc1));var _0x344f0a='';if(_0x480cc1){if(_0x480cc1[_0x4206('0x3a')]){_0x344f0a=_0x480cc1[_0x4206('0x3a')];}else{for(var _0x5f0f60 in _0x480cc1){if(_0x480cc1[_0x4206('0x3b')](_0x5f0f60)){_0x344f0a+=_[_0x4206('0x3c')](_0x5f0f60)+':\x20'+_0x480cc1[_0x5f0f60]+'\x0a';}}}}if(_0x431d73){this[_0x4206('0xd')][_0x4206('0x13')]();}else{this['emit']('error',_0x344f0a);this[_0x4206('0x38')](_0x4206('0x13'));}};module[_0x4206('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 88999a4..497add7 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 _0xbcdf=['bluebird','prototype','send','use','compile','toString','verify','exports','nodemailer'];(function(_0x16cb34,_0x36ddf1){var _0x565707=function(_0x326d43){while(--_0x326d43){_0x16cb34['push'](_0x16cb34['shift']());}};_0x565707(++_0x36ddf1);}(_0xbcdf,0x1af));var _0xfbcd=function(_0x112112,_0x5dd2e8){_0x112112=_0x112112-0x0;var _0x3fb2a0=_0xbcdf[_0x112112];return _0x3fb2a0;};'use strict';var nodemailer=require(_0xfbcd('0x0'));var BPromise=require(_0xfbcd('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xfbcd('0x2')][_0xfbcd('0x3')]=function(_0x1b9fc3,_0x1b6c0b){return new BPromise(function(_0x81e9cc,_0xd4d256){var _0x4e1e64=nodemailer['createTransport'](_0x1b9fc3);_0x4e1e64[_0xfbcd('0x4')](_0xfbcd('0x5'),inlineBase64());_0x4e1e64['sendMail'](_0x1b6c0b,function(_0x9877c2,_0x4bf83e){if(_0x9877c2){_0xd4d256(_0x9877c2[_0xfbcd('0x6')]());}else{_0x81e9cc(_0x4bf83e);}});});};EmailSmtp['prototype'][_0xfbcd('0x7')]=function(_0x170de4){return new BPromise(function(_0x2e26f4,_0x310b1b){var _0x58e19f=nodemailer['createTransport'](_0x170de4);_0x58e19f[_0xfbcd('0x7')](function(_0x398b3a,_0x2e5cfb){if(_0x398b3a){_0x310b1b(_0x398b3a[_0xfbcd('0x6')]());}else{if(_0x2e5cfb){_0x2e26f4(_0x2e5cfb);}else{_0x310b1b('Not\x20verifired');}}});});};module[_0xfbcd('0x8')]=EmailSmtp; \ No newline at end of file +var _0xae60=['prototype','verify','Not\x20verifired','exports','nodemailer','send','createTransport','compile','sendMail','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae60,0x68));var _0x0ae6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xae60[_0x4fbfd9];return _0x31dc94;};'use strict';var nodemailer=require(_0x0ae6('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x0ae6('0x1')]=function(_0x4b2aff,_0x668d04){return new BPromise(function(_0x37ec26,_0x51c6fc){var _0x451563=nodemailer[_0x0ae6('0x2')](_0x4b2aff);_0x451563['use'](_0x0ae6('0x3'),inlineBase64());_0x451563[_0x0ae6('0x4')](_0x668d04,function(_0x4d0a28,_0x228d4b){if(_0x4d0a28){_0x51c6fc(_0x4d0a28[_0x0ae6('0x5')]());}else{_0x37ec26(_0x228d4b);}});});};EmailSmtp[_0x0ae6('0x6')]['verify']=function(_0x5ece4a){return new BPromise(function(_0x505214,_0x5ac3de){var _0x5c93ff=nodemailer[_0x0ae6('0x2')](_0x5ece4a);_0x5c93ff[_0x0ae6('0x7')](function(_0xc0d0b3,_0x318869){if(_0xc0d0b3){_0x5ac3de(_0xc0d0b3[_0x0ae6('0x5')]());}else{if(_0x318869){_0x505214(_0x318869);}else{_0x5ac3de(_0x0ae6('0x8'));}}});});};module[_0x0ae6('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 aa247df..fbad0e3 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 _0xad40=['imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','split','length','slice','join','Anonymous','pop','html','test','replace','includes','','body','Empty\x20message

','Attachments','Title','Data'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xad40,0xfa));var _0x0ad4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xad40[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0ad4('0x0'));var moment=require(_0x0ad4('0x1'));var random=require(_0x0ad4('0x2'));var fs=require('fs');var path=require(_0x0ad4('0x3'));var util=require('util');var tnef=require(_0x0ad4('0x4'));var logger=require(_0x0ad4('0x5'))(_0x0ad4('0x6'));var config=require(_0x0ad4('0x7'));function getAddress(_0x85c3b9){var _0x34f7cb=_[_0x0ad4('0x8')](_0x85c3b9['value']);return _0x34f7cb&&_0x34f7cb[_0x0ad4('0x9')]?_0x34f7cb[_0x0ad4('0x9')]:_0x0ad4('0xa')+random[_0x0ad4('0xb')](0x6)+_0x0ad4('0xc');}function getFirstName(_0x29f1ee){var _0x239e92=_['head'](_0x29f1ee[_0x0ad4('0xd')]);if(_0x239e92&&_0x239e92[_0x0ad4('0xe')]){if(_0x239e92[_0x0ad4('0xe')]==_0x239e92[_0x0ad4('0x9')]){return _0x239e92[_0x0ad4('0xe')][_0x0ad4('0xf')](0x0,_0x239e92[_0x0ad4('0xe')]['indexOf']('@'));}var _0x1b9921=_0x239e92[_0x0ad4('0xe')][_0x0ad4('0x10')](/\s+/);return _0x1b9921[_0x0ad4('0x11')]>0x1?_0x1b9921[_0x0ad4('0x12')](0x0,-0x1)[_0x0ad4('0x13')]('\x20'):_0x239e92[_0x0ad4('0xe')];}return _0x0ad4('0x14');}function getLastName(_0xd8cad3){var _0x3808c2=_['head'](_0xd8cad3[_0x0ad4('0xd')]);if(_0x3808c2&&_0x3808c2['name']){var _0x2286e6=_0x3808c2['name'][_0x0ad4('0x10')](/\s+/);return _0x2286e6['length']>0x1?_0x2286e6[_0x0ad4('0x15')]():'';}return'';}function getMails(_0x58397f,_0x26190d){var _0x5a611f='';for(var _0x244474=0x0;_0x244474<_0x26190d[_0x0ad4('0xd')]['length'];_0x244474+=0x1){if(_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0x9')]!==_0x58397f){if(!_['isEmpty'](_0x5a611f)){_0x5a611f+=',';}_0x5a611f+=_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0xe')]||_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0x9')]||'';_0x5a611f+='\x20<';_0x5a611f+=_0x26190d[_0x0ad4('0xd')][_0x244474]['address']?_0x26190d['value'][_0x244474][_0x0ad4('0x9')]:'anonymous'+random['generate'](0x6)+_0x0ad4('0xc');_0x5a611f+='>';}}return _0x5a611f;}function parseEmail(_0x5e3c56,_0x411acc,_0x1bb68b){if(_0x411acc[_0x0ad4('0x16')]){var _0x147361=/)<[^<]*)*<\/script>/gi;while(_0x147361[_0x0ad4('0x17')](_0x411acc[_0x0ad4('0x16')])){_0x411acc[_0x0ad4('0x16')]=_0x411acc[_0x0ad4('0x16')][_0x0ad4('0x18')](_0x147361,'');}if(_0x411acc[_0x0ad4('0x16')][_0x0ad4('0x19')](_0x0ad4('0x1a'))){var _0x428bb9=[];_0x411acc[_0x0ad4('0x1b')]['forEach'](_0x1f7515=>{_0x428bb9['push'](_0x1f7515['filename']);});var _0xa3a218=/]+>/g;var _0x595431=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x567c73=_0x411acc[_0x0ad4('0x16')][_0x0ad4('0x18')](_0x595431,_0x0ad4('0x1c'));var _0x193a8a=_0x567c73['replace'](_0xa3a218,_0x0ad4('0x1d'));for(let _0x34847b=0x0;_0x34847b<_0x428bb9[_0x0ad4('0x11')];_0x34847b++){var _0xcbf86e=_0x193a8a[_0x0ad4('0x18')](_0x0ad4('0x1d'),'\x20[Attachment:\x20'+_0x428bb9[_0x34847b]+_0x0ad4('0x1e'));_0x193a8a=_0xcbf86e;}_0x411acc[_0x0ad4('0x16')]=_0x193a8a;}_0x1bb68b['body']=_0x411acc['html'];}else{_0x1bb68b[_0x0ad4('0x1f')]=_0x411acc['textAsHtml'];}if(_0x1bb68b['body']){_0x1bb68b[_0x0ad4('0x1f')]=_0x1bb68b['body'][_0x0ad4('0x18')](/0x0){var _0x35df9b=[_0x0ad4('0x33'),_0x0ad4('0x34'),_0x0ad4('0x35')];for(var _0x18bf38=0x0;_0x18bf38<_0x411acc[_0x0ad4('0x32')][_0x0ad4('0x11')];_0x18bf38++){var _0x441a7b=_[_0x0ad4('0x36')](_0x35df9b,_0x411acc[_0x0ad4('0x32')][_0x18bf38][_0x0ad4('0x37')]);if(_0x441a7b>=0x0){_0x1bb68b['isAutoreply']=!![];}}}return _0x1bb68b;}exports['parser']=function(_0x3e755f,_0xc69b7f,_0x2224de){var _0x4b8634={'from':getAddress(_0xc69b7f[_0x0ad4('0x38')]),'firstName':getFirstName(_0xc69b7f[_0x0ad4('0x38')]),'lastName':getLastName(_0xc69b7f['from']),'mapKey':_0x0ad4('0x6'),'message':{'from':getMails(_0x3e755f[_0x0ad4('0x6')],_0xc69b7f['from']),'to':_0x3e755f[_0x0ad4('0x6')],'cc':'','subject':_0xc69b7f[_0x0ad4('0x39')]||'','messageId':_0xc69b7f[_0x0ad4('0x3a')],'inReplyTo':_0xc69b7f[_0x0ad4('0x3b')],'sentAt':moment(_0xc69b7f[_0x0ad4('0x3c')])['format'](_0x0ad4('0x3d')),'attach':![],'attachments':[]}};if(!_0xc69b7f[_0x0ad4('0x16')]&&!_0xc69b7f[_0x0ad4('0x3e')]){var _0x1699fb=_[_0x0ad4('0x3f')](_0xc69b7f[_0x0ad4('0x1b')],{'contentType':_0x0ad4('0x40')});if(_0x1699fb[_0x0ad4('0x11')]){logger[_0x0ad4('0x41')](util['format'](_0x0ad4('0x42'),_0xc69b7f[_0x0ad4('0x3a')]));tnef[_0x0ad4('0x43')](_[_0x0ad4('0x44')](_0x1699fb)[_0x0ad4('0x2f')],function(_0x2c0bec,_0x5f1eb9){if(_0x5f1eb9){_0xc69b7f[_0x0ad4('0x16')]=_0x5f1eb9[_0x0ad4('0x45')]||_0x0ad4('0x46');if(_0x5f1eb9[_0x0ad4('0x47')]){for(var _0x2cc8f8=0x0;_0x2cc8f8<_0x5f1eb9[_0x0ad4('0x47')][_0x0ad4('0x11')];_0x2cc8f8++){var _0x1af2d9=_0x5f1eb9[_0x0ad4('0x47')][_0x2cc8f8];_0x4b8634[_0x0ad4('0x21')][_0x0ad4('0x1b')]['push']({'filename':_0x1af2d9[_0x0ad4('0x48')],'content':Buffer[_0x0ad4('0x38')](_0x1af2d9[_0x0ad4('0x49')])});}}}_0x2224de(parseEmail(_0x3e755f,_0xc69b7f,_0x4b8634));});}else{_0xc69b7f[_0x0ad4('0x16')]='

Empty\x20message

';_0x2224de(parseEmail(_0x3e755f,_0xc69b7f,_0x4b8634));}}else{_0x2224de(parseEmail(_0x3e755f,_0xc69b7f,_0x4b8634));}};exports['getHost']=function(_0x245b56){switch(_0x245b56){case'gmail':return _0x0ad4('0x4a');case _0x0ad4('0x4b'):return _0x0ad4('0x4c');case'hotmail':return _0x0ad4('0x4d');case _0x0ad4('0x4e'):return _0x0ad4('0x4f');}return _0x0ad4('0x50');}; \ No newline at end of file +var _0x4489=['message','originCc','email','originTo','bcc','attach','type','attachment','format','%s-%s','root','server/files/attachments/','writeFileSync','content','push','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','head','pop','isEmpty','anonymous','html','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x444830[_0x9448('0xf')](0x0,-0x1)[_0x9448('0x10')]('\x20'):_0x4b81f9[_0x9448('0xa')];}return'Anonymous';}function getLastName(_0x75cf9c){var _0x56fd4a=_[_0x9448('0x11')](_0x75cf9c[_0x9448('0x6')]);if(_0x56fd4a&&_0x56fd4a['name']){var _0x21a6ee=_0x56fd4a[_0x9448('0xa')][_0x9448('0xd')](/\s+/);return _0x21a6ee[_0x9448('0xe')]>0x1?_0x21a6ee[_0x9448('0x12')]():'';}return'';}function getMails(_0x3564c0,_0xcaf7ac){var _0x9b9fd3='';for(var _0x5a24de=0x0;_0x5a24de<_0xcaf7ac[_0x9448('0x6')]['length'];_0x5a24de+=0x1){if(_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]!==_0x3564c0){if(!_[_0x9448('0x13')](_0x9b9fd3)){_0x9b9fd3+=',';}_0x9b9fd3+=_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0xa')]||_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]||'';_0x9b9fd3+='\x20<';_0x9b9fd3+=_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]?_0xcaf7ac[_0x9448('0x6')][_0x5a24de]['address']:_0x9448('0x14')+random['generate'](0x6)+'@xcally.com';_0x9b9fd3+='>';}}return _0x9b9fd3;}function parseEmail(_0x43d5ac,_0x5cc7da,_0x594b6b){if(_0x5cc7da['html']){var _0x9d711a=/)<[^<]*)*<\/script>/gi;while(_0x9d711a['test'](_0x5cc7da[_0x9448('0x15')])){_0x5cc7da[_0x9448('0x15')]=_0x5cc7da[_0x9448('0x15')]['replace'](_0x9d711a,'');}if(_0x5cc7da[_0x9448('0x15')][_0x9448('0x16')](_0x9448('0x17'))){var _0x4430ad=[];_0x5cc7da[_0x9448('0x18')][_0x9448('0x19')](_0x4d8a8a=>{_0x4430ad['push'](_0x4d8a8a[_0x9448('0x1a')]);});var _0x124892=/]+>/g;var _0x24240d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x161b1d=_0x5cc7da[_0x9448('0x15')]['replace'](_0x24240d,_0x9448('0x1b'));var _0x4e4134=_0x161b1d[_0x9448('0x1c')](_0x124892,_0x9448('0x1d'));for(let _0x245ec8=0x0;_0x245ec8<_0x4430ad['length'];_0x245ec8++){var _0x2dd998=_0x4e4134[_0x9448('0x1c')](_0x9448('0x1d'),_0x9448('0x1e')+_0x4430ad[_0x245ec8]+_0x9448('0x1f'));_0x4e4134=_0x2dd998;}_0x5cc7da[_0x9448('0x15')]=_0x4e4134;}_0x594b6b['body']=_0x5cc7da[_0x9448('0x15')];}else{_0x594b6b[_0x9448('0x20')]=_0x5cc7da['textAsHtml'];}if(_0x594b6b[_0x9448('0x20')]){_0x594b6b[_0x9448('0x20')]=_0x594b6b[_0x9448('0x20')][_0x9448('0x1c')](/0x0){var _0x489c78=[_0x9448('0x32'),_0x9448('0x33'),'Precedence:\x20auto_reply'];for(var _0x525cd6=0x0;_0x525cd6<_0x5cc7da[_0x9448('0x31')][_0x9448('0xe')];_0x525cd6++){var _0x5e6276=_[_0x9448('0xc')](_0x489c78,_0x5cc7da['headerLines'][_0x525cd6][_0x9448('0x34')]);if(_0x5e6276>=0x0){_0x594b6b[_0x9448('0x35')]=!![];}}}return _0x594b6b;}exports[_0x9448('0x36')]=function(_0x28f2fe,_0x8ffab4,_0xc3b1b){var _0x276897={'from':getAddress(_0x8ffab4[_0x9448('0x37')]),'firstName':getFirstName(_0x8ffab4[_0x9448('0x37')]),'lastName':getLastName(_0x8ffab4[_0x9448('0x37')]),'mapKey':'email','message':{'from':getMails(_0x28f2fe['email'],_0x8ffab4[_0x9448('0x37')]),'to':_0x28f2fe[_0x9448('0x24')],'cc':'','subject':_0x8ffab4[_0x9448('0x38')]||'','messageId':_0x8ffab4[_0x9448('0x39')],'inReplyTo':_0x8ffab4[_0x9448('0x3a')],'sentAt':moment(_0x8ffab4[_0x9448('0x3b')])[_0x9448('0x2a')](_0x9448('0x3c')),'attach':![],'attachments':[]}};if(!_0x8ffab4['html']&&!_0x8ffab4['textAsHtml']){var _0x281c4d=_[_0x9448('0x3d')](_0x8ffab4[_0x9448('0x18')],{'contentType':_0x9448('0x3e')});if(_0x281c4d[_0x9448('0xe')]){logger[_0x9448('0x3f')](util[_0x9448('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x8ffab4['messageId']));tnef[_0x9448('0x40')](_[_0x9448('0x41')](_0x281c4d)[_0x9448('0x2f')],function(_0x411c3e,_0x22cc9c){if(_0x22cc9c){_0x8ffab4['html']=_0x22cc9c[_0x9448('0x42')]||_0x9448('0x43');if(_0x22cc9c[_0x9448('0x44')]){for(var _0x479b60=0x0;_0x479b60<_0x22cc9c[_0x9448('0x44')][_0x9448('0xe')];_0x479b60++){var _0x380521=_0x22cc9c[_0x9448('0x44')][_0x479b60];_0x276897[_0x9448('0x22')][_0x9448('0x18')][_0x9448('0x30')]({'filename':_0x380521[_0x9448('0x45')],'content':Buffer[_0x9448('0x37')](_0x380521[_0x9448('0x46')])});}}}_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));});}else{_0x8ffab4[_0x9448('0x15')]=_0x9448('0x43');_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));}}else{_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));}};exports[_0x9448('0x47')]=function(_0x263bbe){switch(_0x263bbe){case'gmail':return'imap.gmail.com';case _0x9448('0x48'):return'imap.mail.yahoo.com';case _0x9448('0x49'):return _0x9448('0x4a');case _0x9448('0x4b'):return _0x9448('0x4c');}return _0x9448('0x4d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 39730b5..830b6c3 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 _0x8325=['active','Imap','Smtp','exports','lodash','name','key','SERV'];(function(_0x1bd163,_0x573f20){var _0x17b20f=function(_0x3e1bf1){while(--_0x3e1bf1){_0x1bd163['push'](_0x1bd163['shift']());}};_0x17b20f(++_0x573f20);}(_0x8325,0x1dc));var _0x5832=function(_0x3e291,_0x4e1425){_0x3e291=_0x3e291-0x0;var _0x48efd7=_0x8325[_0x3e291];return _0x48efd7;};'use strict';var _=require(_0x5832('0x0'));function MailAccount(_0x412770){this['id']=_0x412770['id']||0x0;this[_0x5832('0x1')]=_0x412770[_0x5832('0x1')]||'Service';this[_0x5832('0x2')]=_0x412770['key']||_0x5832('0x3');this[_0x5832('0x4')]=_0x412770[_0x5832('0x4')]||![];this[_0x5832('0x5')]=_0x412770[_0x5832('0x5')]||[];this[_0x5832('0x6')]=_0x412770['Smtp']||[];}module[_0x5832('0x7')]=MailAccount; \ No newline at end of file +var _0x8a19=['name','Service','key','active','Imap','Smtp'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8a19,0x15c));var _0x98a1=function(_0x59baa4,_0x542116){_0x59baa4=_0x59baa4-0x0;var _0x4186b1=_0x8a19[_0x59baa4];return _0x4186b1;};'use strict';var _=require('lodash');function MailAccount(_0x5b1e00){this['id']=_0x5b1e00['id']||0x0;this['name']=_0x5b1e00[_0x98a1('0x0')]||_0x98a1('0x1');this[_0x98a1('0x2')]=_0x5b1e00['key']||'SERV';this[_0x98a1('0x3')]=_0x5b1e00[_0x98a1('0x3')]||![];this['Imap']=_0x5b1e00[_0x98a1('0x4')]||[];this[_0x98a1('0x5')]=_0x5b1e00['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 824aa36..d765883 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 _0x75fc=['length','isUndefined','merge','exports','lodash','mailAccounts','hasOwnProperty','mergeFromDatabase','initMailAccounts'];(function(_0x49bb91,_0x86ecf3){var _0x2b4339=function(_0x4fb062){while(--_0x4fb062){_0x49bb91['push'](_0x49bb91['shift']());}};_0x2b4339(++_0x86ecf3);}(_0x75fc,0x199));var _0xc75f=function(_0x3ba68b,_0x13c2d7){_0x3ba68b=_0x3ba68b-0x0;var _0x1d7114=_0x75fc[_0x3ba68b];return _0x1d7114;};'use strict';var _=require(_0xc75f('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xc75f('0x1')]={};};function freeIsNotKey(_0x4d73f7,_0x54f5d5,_0x1fa930){var _0x1c938b=_['mapKeys'](_0x4d73f7,function(_0x3cd51d,_0xd310b9){return _0x3cd51d[_0x1fa930];});for(var _0x108111 in _0x54f5d5){if(_0x54f5d5[_0xc75f('0x2')](_0x108111)){if(!_0x1c938b[_0x108111]){delete _0x54f5d5[_0x108111];}}}}Realtime['prototype'][_0xc75f('0x3')]=function(_0xc17493,_0x84109d){for(var _0xaae6d0 in _0x84109d){if(_0xc17493[_0xc75f('0x2')](_0xaae6d0)){_0xc17493[_0xaae6d0]=_0x84109d[_0xaae6d0];}}};Realtime['prototype'][_0xc75f('0x4')]=function(){var _0x59d983=this;return function(_0x581813){if(_0x581813){freeIsNotKey(_0x581813,_0x59d983['mailAccounts'],'id');for(var _0xa2754d=0x0,_0x20e3b6={},_0x873f3b={};_0xa2754d<_0x581813[_0xc75f('0x5')];_0xa2754d+=0x1){_0x20e3b6=_0x581813[_0xa2754d];if(_[_0xc75f('0x6')](_0x59d983['mailAccounts'][_0x20e3b6['id']])){_0x59d983[_0xc75f('0x1')][_0x20e3b6['id']]=new MailAccount(_0x20e3b6);}else{_[_0xc75f('0x7')](_0x59d983[_0xc75f('0x1')][_0x20e3b6['id']],_0x20e3b6);}}}return _0x59d983[_0xc75f('0x1')];};};module[_0xc75f('0x8')]=Realtime; \ No newline at end of file +var _0xbd2e=['mergeFromDatabase','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x5c51cf,_0x25ad16){var _0x18b05d=function(_0xd5729f){while(--_0xd5729f){_0x5c51cf['push'](_0x5c51cf['shift']());}};_0x18b05d(++_0x25ad16);}(_0xbd2e,0x73));var _0xebd2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbd2e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xebd2('0x0'));var MailAccount=require(_0xebd2('0x1'));var Realtime=function(){this[_0xebd2('0x2')]={};};function freeIsNotKey(_0x188bae,_0x5dbeb4,_0x41bfc5){var _0x21ddaa=_[_0xebd2('0x3')](_0x188bae,function(_0x2dda9a,_0x24a106){return _0x2dda9a[_0x41bfc5];});for(var _0x344e2a in _0x5dbeb4){if(_0x5dbeb4[_0xebd2('0x4')](_0x344e2a)){if(!_0x21ddaa[_0x344e2a]){delete _0x5dbeb4[_0x344e2a];}}}}Realtime[_0xebd2('0x5')][_0xebd2('0x6')]=function(_0x3fb78f,_0x277648){for(var _0x5df145 in _0x277648){if(_0x3fb78f[_0xebd2('0x4')](_0x5df145)){_0x3fb78f[_0x5df145]=_0x277648[_0x5df145];}}};Realtime[_0xebd2('0x5')]['initMailAccounts']=function(){var _0x1e932f=this;return function(_0x13010c){if(_0x13010c){freeIsNotKey(_0x13010c,_0x1e932f[_0xebd2('0x2')],'id');for(var _0x428930=0x0,_0x128468={},_0xa6507c={};_0x428930<_0x13010c[_0xebd2('0x7')];_0x428930+=0x1){_0x128468=_0x13010c[_0x428930];if(_[_0xebd2('0x8')](_0x1e932f[_0xebd2('0x2')][_0x128468['id']])){_0x1e932f[_0xebd2('0x2')][_0x128468['id']]=new MailAccount(_0x128468);}else{_[_0xebd2('0x9')](_0x1e932f['mailAccounts'][_0x128468['id']],_0x128468);}}}return _0x1e932f['mailAccounts'];};};module[_0xebd2('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 ef419ef..d7385d8 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 _0xf7a8=['key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','service','email','active'];(function(_0x57b5ce,_0x3a8cfa){var _0x5c3af4=function(_0x2e2dd2){while(--_0x2e2dd2){_0x57b5ce['push'](_0x57b5ce['shift']());}};_0x5c3af4(++_0x3a8cfa);}(_0xf7a8,0xfa));var _0x8f7a=function(_0x2819fa,_0x512a6c){_0x2819fa=_0x2819fa-0x0;var _0x206382=_0xf7a8[_0x2819fa];return _0x206382;};'use strict';var client=require(_0x8f7a('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8f7a('0x1')](_0x8f7a('0x2'),{'options':{'attributes':['id','name',_0x8f7a('0x3'),_0x8f7a('0x4'),_0x8f7a('0x5'),_0x8f7a('0x6'),_0x8f7a('0x7'),_0x8f7a('0x8')],'raw':![],'include':[{'model':_0x8f7a('0x9'),'as':_0x8f7a('0xa')},{'model':_0x8f7a('0xb'),'as':_0x8f7a('0xc')}]},'log':_0x8f7a('0xd')});};};exports[_0x8f7a('0xe')]=function(_0x9f3931,_0x4f0dd6){return client['Request'](_0x8f7a('0xf'),{'account':{'id':_0x9f3931},'body':_0x4f0dd6,'log':_0x8f7a('0xf')});}; \ No newline at end of file +var _0xc16d=['notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount'];(function(_0x136f58,_0x3f32fa){var _0x1af14f=function(_0x1e488c){while(--_0x1e488c){_0x136f58['push'](_0x136f58['shift']());}};_0x1af14f(++_0x3f32fa);}(_0xc16d,0x145));var _0xdc16=function(_0x74ec89,_0x2d0ddc){_0x74ec89=_0x74ec89-0x0;var _0x33f741=_0xc16d[_0x74ec89];return _0x33f741;};'use strict';var client=require(_0xdc16('0x0'));exports[_0xdc16('0x1')]=function(){return function(){return client[_0xdc16('0x2')](_0xdc16('0x3'),{'options':{'attributes':['id',_0xdc16('0x4'),_0xdc16('0x5'),_0xdc16('0x6'),'active',_0xdc16('0x7'),_0xdc16('0x8'),_0xdc16('0x9')],'raw':![],'include':[{'model':_0xdc16('0xa'),'as':_0xdc16('0xb')},{'model':_0xdc16('0xc'),'as':_0xdc16('0xd')}]},'log':_0xdc16('0xe')});};};exports[_0xdc16('0xf')]=function(_0x473d25,_0x25bde7){return client[_0xdc16('0x2')](_0xdc16('0x10'),{'account':{'id':_0x473d25},'body':_0x25bde7,'log':_0xdc16('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 406e236..97d3cbb 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 _0x2b49=['loginMailFrequency','getSettings','Request','ShowSetting'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x2b49,0xed));var _0x92b4=function(_0x3a3d1a,_0x3cbbb5){_0x3a3d1a=_0x3a3d1a-0x0;var _0x5009fe=_0x2b49[_0x3a3d1a];return _0x5009fe;};'use strict';var client=require('../client');exports[_0x92b4('0x0')]=function(){return client[_0x92b4('0x1')](_0x92b4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x92b4('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x2de7=['GetSettings','../client','Request','ShowSetting','loginMailFrequency'];(function(_0x184d83,_0x4e82c2){var _0x42b14e=function(_0x33ff90){while(--_0x33ff90){_0x184d83['push'](_0x184d83['shift']());}};_0x42b14e(++_0x4e82c2);}(_0x2de7,0x178));var _0x72de=function(_0x4f9aa8,_0x284d52){_0x4f9aa8=_0x4f9aa8-0x0;var _0x4a2205=_0x2de7[_0x4f9aa8];return _0x4a2205;};'use strict';var client=require(_0x72de('0x0'));exports['getSettings']=function(){return client[_0x72de('0x1')](_0x72de('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x72de('0x3')]},'log':_0x72de('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8ef85a8..4e448f9 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 a248e0c..0443c4c 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 _0x57b6=['sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash'];(function(_0x10a28e,_0x182d8a){var _0x5a627a=function(_0x3c9150){while(--_0x3c9150){_0x10a28e['push'](_0x10a28e['shift']());}};_0x5a627a(++_0x182d8a);}(_0x57b6,0x107));var _0x657b=function(_0xbb0463,_0x5b9cbf){_0xbb0463=_0xbb0463-0x0;var _0x51091d=_0x57b6[_0xbb0463];return _0x51091d;};'use strict';var _=require(_0x657b('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x657b('0x1'));var Redis=require(_0x657b('0x2'));var config=require(_0x657b('0x3'));var app=express();var server=http[_0x657b('0x4')](app);server[_0x657b('0x5')]=0xdbba0;if(sticky[_0x657b('0x6')](server,config[_0x657b('0x7')])){var socketio=require(_0x657b('0x8'))(server,{'transports':[_0x657b('0x9'),'polling']});config['redis']=_[_0x657b('0xa')](config[_0x657b('0xb')],{'host':_0x657b('0xc'),'port':0x18eb});socketio[_0x657b('0xd')](require(_0x657b('0xe'))({'pubClient':new Redis(config[_0x657b('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x657b('0xf'))['default']();require(_0x657b('0x10'))[_0x657b('0x11')](socketio);require('../../config/express')[_0x657b('0x11')](app);require(_0x657b('0x12'))[_0x657b('0x11')](app);}else{server[_0x657b('0x13')](_0x657b('0x14'),function(){console[_0x657b('0x15')](_0x657b('0x16'),config[_0x657b('0x7')]);});}exports=module[_0x657b('0x17')]=app; \ No newline at end of file +var _0xd2ea=['../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','localhost','socket.io-redis','../../config/triggers','../../config/socketio','default'];(function(_0x3386fa,_0x2064a7){var _0x1e4cca=function(_0x5510e4){while(--_0x5510e4){_0x3386fa['push'](_0x3386fa['shift']());}};_0x1e4cca(++_0x2064a7);}(_0xd2ea,0x127));var _0xad2e=function(_0x14adfc,_0x2f05fa){_0x14adfc=_0x14adfc-0x0;var _0x384191=_0xd2ea[_0x14adfc];return _0x384191;};'use strict';var _=require('lodash');var http=require(_0xad2e('0x0'));var express=require(_0xad2e('0x1'));var sticky=require(_0xad2e('0x2'));var Redis=require(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));var app=express();var server=http[_0xad2e('0x5')](app);server[_0xad2e('0x6')]=0xdbba0;if(sticky[_0xad2e('0x7')](server,config[_0xad2e('0x8')])){var socketio=require(_0xad2e('0x9'))(server,{'transports':['websocket',_0xad2e('0xa')]});config[_0xad2e('0xb')]=_['defaults'](config[_0xad2e('0xb')],{'host':_0xad2e('0xc'),'port':0x18eb});socketio['adapter'](require(_0xad2e('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xad2e('0xb')])}));require(_0xad2e('0xe'))['default']();require(_0xad2e('0xf'))[_0xad2e('0x10')](socketio);require(_0xad2e('0x11'))[_0xad2e('0x10')](app);require(_0xad2e('0x12'))[_0xad2e('0x10')](app);}else{server[_0xad2e('0x13')](_0xad2e('0x14'),function(){console[_0xad2e('0x15')](_0xad2e('0x16'),config[_0xad2e('0x8')]);});}exports=module[_0xad2e('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index d46e402..4172d6f 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 _0x0620=['client','http','Request','request','then','rpc','routing','error','message','result','jayson/promise','bluebird'];(function(_0x56af8c,_0x584039){var _0x10793a=function(_0xfec941){while(--_0xfec941){_0x56af8c['push'](_0x56af8c['shift']());}};_0x10793a(++_0x584039);}(_0x0620,0x112));var _0x0062=function(_0x58b6fd,_0x2a49fd){_0x58b6fd=_0x58b6fd-0x0;var _0x32b268=_0x0620[_0x58b6fd];return _0x32b268;};'use strict';var jayson=require(_0x0062('0x0'));var BPromise=require(_0x0062('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x0062('0x2')][_0x0062('0x3')]({'port':0x2329});client[_0x0062('0x4')]=function(_0x22795f,_0x316af6){return new BPromise(function(_0x43f9fb,_0xf5c04e){return client[_0x0062('0x5')](_0x22795f,_0x316af6)[_0x0062('0x6')](function(_0xb02e00){logger['debug'](_0x0062('0x7'),_0x0062('0x8'),_0x22795f,_0x316af6,_0xb02e00);if(_0xb02e00['error']){logger[_0x0062('0x9')](_0x0062('0x7'),_0x0062('0x8'),_0x22795f,_0xb02e00['error']['message'],_0x316af6);return _0xf5c04e(_0xb02e00[_0x0062('0x9')][_0x0062('0xa')]);}else{return _0x43f9fb(_0xb02e00[_0x0062('0xb')]);}})['catch'](function(_0x1fb37c){logger[_0x0062('0x9')](_0x0062('0x7'),_0x0062('0x8'),_0x22795f,_0x1fb37c,_0x316af6);return _0xf5c04e(_0x1fb37c);});});};module['exports']=client; \ No newline at end of file +var _0x7782=['routing','http','request','then','debug','error','rpc','message','result','catch','jayson/promise','bluebird','../../config/logger'];(function(_0xb39b04,_0x5910ad){var _0x1ab93b=function(_0x4116c3){while(--_0x4116c3){_0xb39b04['push'](_0xb39b04['shift']());}};_0x1ab93b(++_0x5910ad);}(_0x7782,0x72));var _0x2778=function(_0x435f9e,_0x240e90){_0x435f9e=_0x435f9e-0x0;var _0x5c0cf4=_0x7782[_0x435f9e];return _0x5c0cf4;};'use strict';var jayson=require(_0x2778('0x0'));var BPromise=require(_0x2778('0x1'));var logger=require(_0x2778('0x2'))(_0x2778('0x3'));var client=jayson['client'][_0x2778('0x4')]({'port':0x2329});client['Request']=function(_0x4d4b88,_0x1170f2){return new BPromise(function(_0x30d305,_0x3ca2d1){return client[_0x2778('0x5')](_0x4d4b88,_0x1170f2)[_0x2778('0x6')](function(_0x3eabf0){logger[_0x2778('0x7')]('rpc','routing',_0x4d4b88,_0x1170f2,_0x3eabf0);if(_0x3eabf0['error']){logger[_0x2778('0x8')](_0x2778('0x9'),_0x2778('0x3'),_0x4d4b88,_0x3eabf0[_0x2778('0x8')]['message'],_0x1170f2);return _0x3ca2d1(_0x3eabf0[_0x2778('0x8')][_0x2778('0xa')]);}else{return _0x30d305(_0x3eabf0[_0x2778('0xb')]);}})[_0x2778('0xc')](function(_0x55d8dc){logger[_0x2778('0x8')](_0x2778('0x9'),_0x2778('0x3'),_0x4d4b88,_0x55d8dc,_0x1170f2);return _0x3ca2d1(_0x55d8dc);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index aa1c6dd..d405c2c 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 _0x0ee3=['initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then'];(function(_0x22a518,_0x4dd9a6){var _0x5395a9=function(_0x55eeb3){while(--_0x55eeb3){_0x22a518['push'](_0x22a518['shift']());}};_0x5395a9(++_0x4dd9a6);}(_0x0ee3,0xc9));var _0x30ee=function(_0x7e398a,_0x228dc9){_0x7e398a=_0x7e398a-0x0;var _0x2c714e=_0x0ee3[_0x7e398a];return _0x2c714e;};'use strict';var BPromise=require(_0x30ee('0x0'));var server=require('./server');var Realtime=require(_0x30ee('0x1'));var user=require(_0x30ee('0x2'));var interval=require(_0x30ee('0x3'));var openchannelQueue=require(_0x30ee('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x30ee('0x5'));var mailQueue=require(_0x30ee('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x30ee('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())[_0x30ee('0x8')](realtime[_0x30ee('0x9')]())[_0x30ee('0x8')](interval[_0x30ee('0xa')]())['then'](realtime['initIntervals']())[_0x30ee('0x8')](openchannelQueue[_0x30ee('0xb')]())[_0x30ee('0x8')](realtime[_0x30ee('0xc')]())[_0x30ee('0x8')](chatQueue['getChatQueues']())[_0x30ee('0x8')](realtime[_0x30ee('0xd')]())[_0x30ee('0x8')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x30ee('0x8')](mailQueue[_0x30ee('0xe')]())[_0x30ee('0x8')](realtime['initMailQueues']())[_0x30ee('0x8')](faxQueue[_0x30ee('0xf')]())[_0x30ee('0x8')](realtime[_0x30ee('0x10')]())[_0x30ee('0x8')](whatsappQueue[_0x30ee('0x11')]())[_0x30ee('0x8')](realtime['initWhatsappQueues']())[_0x30ee('0x8')](function(){return realtime;});}function main(){return server[_0x30ee('0x12')](realtime)[_0x30ee('0x8')](function(_0x69ed32){return initRealtime();})[_0x30ee('0x8')](function(_0x4a0a0c){return setInterval(initRealtime,0x1388);})[_0x30ee('0x13')](function(_0x11556e){console[_0x30ee('0x14')](_0x11556e);});}main(); \ No newline at end of file +var _0x6308=['getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initIntervals'];(function(_0x355952,_0x1f47f7){var _0x37fcb7=function(_0x5788f4){while(--_0x5788f4){_0x355952['push'](_0x355952['shift']());}};_0x37fcb7(++_0x1f47f7);}(_0x6308,0x144));var _0x8630=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6308[_0x1d9aa0];return _0x226868;};'use strict';var BPromise=require(_0x8630('0x0'));var server=require(_0x8630('0x1'));var Realtime=require(_0x8630('0x2'));var user=require(_0x8630('0x3'));var interval=require(_0x8630('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x8630('0x5'));var smsQueue=require(_0x8630('0x6'));var mailQueue=require(_0x8630('0x7'));var faxQueue=require(_0x8630('0x8'));var whatsappQueue=require(_0x8630('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8630('0xa')]()[_0x8630('0xb')](user[_0x8630('0xc')]())[_0x8630('0xb')](realtime['initAgents']())['then'](interval['getIntervals']())[_0x8630('0xb')](realtime[_0x8630('0xd')]())[_0x8630('0xb')](openchannelQueue[_0x8630('0xe')]())[_0x8630('0xb')](realtime[_0x8630('0xf')]())[_0x8630('0xb')](chatQueue[_0x8630('0x10')]())[_0x8630('0xb')](realtime[_0x8630('0x11')]())[_0x8630('0xb')](smsQueue[_0x8630('0x12')]())[_0x8630('0xb')](realtime[_0x8630('0x13')]())[_0x8630('0xb')](mailQueue[_0x8630('0x14')]())[_0x8630('0xb')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())[_0x8630('0xb')](realtime[_0x8630('0x15')]())[_0x8630('0xb')](whatsappQueue[_0x8630('0x16')]())[_0x8630('0xb')](realtime[_0x8630('0x17')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x8630('0xb')](function(_0x2c7a3f){return initRealtime();})[_0x8630('0xb')](function(_0xd7173){return setInterval(initRealtime,0x1388);})[_0x8630('0x18')](function(_0x1dc684){console[_0x8630('0x19')](_0x1dc684);});}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 3870314..61d5f36 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x38db77,_0x18239f){var _0x916e60=function(_0x1bdf37){while(--_0x1bdf37){_0x38db77['push'](_0x38db77['shift']());}};_0x916e60(++_0x18239f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x5fc3[_0x51beba];return _0x167ee0;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x3b986a,_0x148398){var _0x386a50=function(_0x7f1879){while(--_0x7f1879){_0x3b986a['push'](_0x3b986a['shift']());}};_0x386a50(++_0x148398);}(_0x5fc3,0xa8));var _0x35fc=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x5fc3[_0x34df4a];return _0x145c69;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9190fd6..955c399 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 _0xecb9=['sendMailMessage','SendMail','bluebird','client','http','request','then','error','message','result'];(function(_0x311812,_0x40ebd8){var _0x25ea86=function(_0x26972d){while(--_0x26972d){_0x311812['push'](_0x311812['shift']());}};_0x25ea86(++_0x40ebd8);}(_0xecb9,0x66));var _0x9ecb=function(_0x2cfc8c,_0x5472df){_0x2cfc8c=_0x2cfc8c-0x0;var _0x1de813=_0xecb9[_0x2cfc8c];return _0x1de813;};'use strict';var BPromise=require(_0x9ecb('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x9ecb('0x1')][_0x9ecb('0x2')]({'port':0x232b});function request(_0x29364d,_0x38c3fd){return new BPromise(function(_0xb733d4,_0x4a9dc7){return client[_0x9ecb('0x3')](_0x29364d,_0x38c3fd)[_0x9ecb('0x4')](function(_0x16814d){if(_0x16814d['error']){return _0x4a9dc7(_0x16814d[_0x9ecb('0x5')][_0x9ecb('0x6')]);}else{return _0xb733d4(_0x16814d[_0x9ecb('0x7')]);}})['catch'](function(_0x5a5f2a){return _0x4a9dc7(_0x5a5f2a);});});}exports[_0x9ecb('0x8')]=function(_0x195d99,_0x11daa9){return request(_0x9ecb('0x9'),{'account':_0x195d99,'message':_0x11daa9});}; \ No newline at end of file +var _0x7c8e=['result','sendMailMessage','jayson/promise','http','request','then','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7c8e,0x12f));var _0xe7c8=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x7c8e[_0x4b4277];return _0x1ff405;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe7c8('0x0'));var client=jayson['client'][_0xe7c8('0x1')]({'port':0x232b});function request(_0x1dad10,_0x4741d1){return new BPromise(function(_0x53458f,_0x1d8e30){return client[_0xe7c8('0x2')](_0x1dad10,_0x4741d1)[_0xe7c8('0x3')](function(_0x3127d0){if(_0x3127d0[_0xe7c8('0x4')]){return _0x1d8e30(_0x3127d0[_0xe7c8('0x4')]['message']);}else{return _0x53458f(_0x3127d0[_0xe7c8('0x5')]);}})['catch'](function(_0x286e61){return _0x1d8e30(_0x286e61);});});}exports[_0xe7c8('0x6')]=function(_0x92d40a,_0xc2928a){return request('SendMail',{'account':_0x92d40a,'message':_0xc2928a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a80cd34..2930961 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 _0xcc47=['maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','toNumber','chatCurrentCapacity','faxStatusTime','whatsappCapacity','busy','stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busyQueue','prototype','CurrentCapacity','Capacity'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcc47,0xfc));var _0x7cc4=function(_0x40fce5,_0x1f661b){_0x40fce5=_0x40fce5-0x0;var _0x5f25ce=_0xcc47[_0x40fce5];return _0x5f25ce;};'use strict';var _=require(_0x7cc4('0x0'));var moment=require(_0x7cc4('0x1'));var md5=require(_0x7cc4('0x2'));var Redis=require(_0x7cc4('0x3'));var config=require(_0x7cc4('0x4'));config[_0x7cc4('0x5')]=_[_0x7cc4('0x6')](config[_0x7cc4('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7cc4('0x7'))(new Redis(config['redis']));function Agent(_0x134c2f){this['id']=_0x134c2f['id']||0x0;this[_0x7cc4('0x8')]=_0x134c2f[_0x7cc4('0x8')]||'';this[_0x7cc4('0x9')]=_0x134c2f[_0x7cc4('0x9')]||!![];this[_0x7cc4('0xa')]=_0x134c2f[_0x7cc4('0xa')]||![];this[_0x7cc4('0xb')]=_0x134c2f[_0x7cc4('0xb')]||![];this[_0x7cc4('0xc')]=_0x134c2f[_0x7cc4('0xc')]||![];this[_0x7cc4('0xd')]=_0x134c2f[_0x7cc4('0xd')]||![];this[_0x7cc4('0xe')]=_0x134c2f[_0x7cc4('0xe')]||![];this[_0x7cc4('0xf')]=_0x134c2f[_0x7cc4('0xf')]||![];this[_0x7cc4('0x10')]='unknown';this[_0x7cc4('0x11')]=0x0;this[_0x7cc4('0x12')]=_0x134c2f[_0x7cc4('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x7cc4('0x13');this[_0x7cc4('0x14')]=0x0;this[_0x7cc4('0x15')]=_0x134c2f[_0x7cc4('0x15')]||0x0;this[_0x7cc4('0x16')]=0x0;this[_0x7cc4('0x17')]=_0x7cc4('0x13');this['faxStatusTime']=0x0;this[_0x7cc4('0x18')]=_0x134c2f[_0x7cc4('0x18')]||0x0;this[_0x7cc4('0x19')]=0x0;this['smsStatus']='unknown';this[_0x7cc4('0x1a')]=0x0;this[_0x7cc4('0x1b')]=_0x134c2f[_0x7cc4('0x1b')]||0x0;this[_0x7cc4('0x1c')]=0x0;this[_0x7cc4('0x1d')]=_0x7cc4('0x13');this[_0x7cc4('0x1e')]=0x0;this['whatsappCapacity']=_0x134c2f['whatsappCapacity']||0x0;this[_0x7cc4('0x1f')]=0x0;this[_0x7cc4('0x20')]='unknown';this['openchannelStatusTime']=0x0;this[_0x7cc4('0x21')]=_0x134c2f[_0x7cc4('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x7cc4('0x22')]=undefined;this[_0x7cc4('0x2')]='';this['updateRealtime']();}Agent[_0x7cc4('0x23')]['getChannelStatus']=function(_0x4087d4){if(this[_0x4087d4+_0x7cc4('0x24')]>0x0){if(this[_0x4087d4+_0x7cc4('0x25')]>0x0&&this[_0x4087d4+_0x7cc4('0x24')]>=this[_0x4087d4+'Capacity']){return _0x7cc4('0x26');}else{return _0x7cc4('0x27');}}else{return _0x7cc4('0x28');}};Agent[_0x7cc4('0x23')]['updateRealtime']=function(){var _0x1eb986=[_0x7cc4('0x29'),_0x7cc4('0x2a'),_0x7cc4('0x2b'),_0x7cc4('0x2c'),_0x7cc4('0x2d'),_0x7cc4('0x2e')];for(var _0x55004f=0x0;_0x55004f<_0x1eb986[_0x7cc4('0x2f')];_0x55004f+=0x1){var _0x446be8=this[_0x7cc4('0x30')](_0x1eb986[_0x55004f]);if(this[_0x1eb986[_0x55004f]+_0x7cc4('0x31')]!==_0x446be8){this[_0x1eb986[_0x55004f]+'StatusTime']=_[_0x7cc4('0x32')](moment()['format']('x'));}this[_0x1eb986[_0x55004f]+'Status']=_0x446be8;}var _0x1f5918={'id':this['id'],'name':this[_0x7cc4('0x8')],'online':this[_0x7cc4('0x9')],'voicePause':this[_0x7cc4('0xa')],'chatPause':this[_0x7cc4('0xb')],'mailPause':this[_0x7cc4('0xc')],'smsPause':this[_0x7cc4('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0x7cc4('0xf')],'chatStatus':this[_0x7cc4('0x10')],'chatStatusTime':this[_0x7cc4('0x11')],'chatCapacity':this[_0x7cc4('0x12')],'chatCurrentCapacity':this[_0x7cc4('0x33')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x7cc4('0x14')],'mailCapacity':this[_0x7cc4('0x15')],'mailCurrentCapacity':this[_0x7cc4('0x16')],'faxStatus':this[_0x7cc4('0x17')],'faxStatusTime':this[_0x7cc4('0x34')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x7cc4('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x7cc4('0x1a')],'smsCapacity':this[_0x7cc4('0x1b')],'smsCurrentCapacity':this[_0x7cc4('0x1c')],'whatsappStatus':this[_0x7cc4('0x1d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x7cc4('0x35')],'whatsappCurrentCapacity':this[_0x7cc4('0x1f')],'openchannelStatus':this[_0x7cc4('0x20')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x7cc4('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x7cc4('0x36')],'busyQueue':this[_0x7cc4('0x22')]};var _0x55d08d=md5(JSON[_0x7cc4('0x37')](_0x1f5918));if(this[_0x7cc4('0x2')]!==_0x55d08d){this[_0x7cc4('0x2')]=_0x55d08d;io['emit'](_0x7cc4('0x38'),_0x1f5918);}};module[_0x7cc4('0x39')]=Agent; \ No newline at end of file +var _0x76e0=['redis','socket.io-emitter','name','voicePause','chatPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','openchannel','fax','length','StatusTime','mailPause','faxPause','chatCapacity','mailCurrentCapacity','smsStatus','openchannelCurrentCapacity','busy','stringify','emit','user:save','exports','../../../config/environment','defaults'];(function(_0x414cec,_0x3b0bd8){var _0x457fca=function(_0x58c0a5){while(--_0x58c0a5){_0x414cec['push'](_0x414cec['shift']());}};_0x457fca(++_0x3b0bd8);}(_0x76e0,0x6e));var _0x076e=function(_0x5a5f14,_0x55826b){_0x5a5f14=_0x5a5f14-0x0;var _0x5f0ac7=_0x76e0[_0x5a5f14];return _0x5f0ac7;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x076e('0x0'));config['redis']=_[_0x076e('0x1')](config[_0x076e('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x076e('0x3'))(new Redis(config[_0x076e('0x2')]));function Agent(_0x3bacb1){this['id']=_0x3bacb1['id']||0x0;this[_0x076e('0x4')]=_0x3bacb1[_0x076e('0x4')]||'';this['online']=_0x3bacb1['online']||!![];this[_0x076e('0x5')]=_0x3bacb1[_0x076e('0x5')]||![];this[_0x076e('0x6')]=_0x3bacb1['chatPause']||![];this['mailPause']=_0x3bacb1['mailPause']||![];this['faxPause']=_0x3bacb1['faxPause']||![];this[_0x076e('0x7')]=_0x3bacb1[_0x076e('0x7')]||![];this[_0x076e('0x8')]=_0x3bacb1[_0x076e('0x8')]||![];this[_0x076e('0x9')]=_0x076e('0xa');this[_0x076e('0xb')]=0x0;this['chatCapacity']=_0x3bacb1['chatCapacity']||0x0;this[_0x076e('0xc')]=0x0;this[_0x076e('0xd')]=_0x076e('0xa');this[_0x076e('0xe')]=0x0;this[_0x076e('0xf')]=_0x3bacb1[_0x076e('0xf')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x076e('0x10')]=_0x076e('0xa');this[_0x076e('0x11')]=0x0;this['faxCapacity']=_0x3bacb1[_0x076e('0x12')]||0x0;this[_0x076e('0x13')]=0x0;this['smsStatus']=_0x076e('0xa');this[_0x076e('0x14')]=0x0;this[_0x076e('0x15')]=_0x3bacb1[_0x076e('0x15')]||0x0;this[_0x076e('0x16')]=0x0;this[_0x076e('0x17')]=_0x076e('0xa');this[_0x076e('0x18')]=0x0;this[_0x076e('0x19')]=_0x3bacb1[_0x076e('0x19')]||0x0;this[_0x076e('0x1a')]=0x0;this[_0x076e('0x1b')]='unknown';this[_0x076e('0x1c')]=0x0;this[_0x076e('0x1d')]=_0x3bacb1[_0x076e('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x076e('0x1e')]=undefined;this[_0x076e('0x1f')]='';this[_0x076e('0x20')]();}Agent['prototype'][_0x076e('0x21')]=function(_0x410bca){if(this[_0x410bca+_0x076e('0x22')]>0x0){if(this[_0x410bca+_0x076e('0x23')]>0x0&&this[_0x410bca+_0x076e('0x22')]>=this[_0x410bca+_0x076e('0x23')]){return _0x076e('0x24');}else{return _0x076e('0x25');}}else{return _0x076e('0x26');}};Agent[_0x076e('0x27')]['updateRealtime']=function(){var _0x447043=[_0x076e('0x28'),'chat',_0x076e('0x29'),_0x076e('0x2a'),'sms','whatsapp'];for(var _0x4c7ed3=0x0;_0x4c7ed3<_0x447043[_0x076e('0x2b')];_0x4c7ed3+=0x1){var _0x1a6011=this[_0x076e('0x21')](_0x447043[_0x4c7ed3]);if(this[_0x447043[_0x4c7ed3]+'Status']!==_0x1a6011){this[_0x447043[_0x4c7ed3]+_0x076e('0x2c')]=_['toNumber'](moment()['format']('x'));}this[_0x447043[_0x4c7ed3]+'Status']=_0x1a6011;}var _0x17d06d={'id':this['id'],'name':this[_0x076e('0x4')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x076e('0x6')],'mailPause':this[_0x076e('0x2d')],'smsPause':this[_0x076e('0x7')],'faxPause':this[_0x076e('0x2e')],'openchannelPause':this[_0x076e('0x8')],'chatStatus':this[_0x076e('0x9')],'chatStatusTime':this[_0x076e('0xb')],'chatCapacity':this[_0x076e('0x2f')],'chatCurrentCapacity':this[_0x076e('0xc')],'mailStatus':this[_0x076e('0xd')],'mailStatusTime':this[_0x076e('0xe')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x076e('0x30')],'faxStatus':this[_0x076e('0x10')],'faxStatusTime':this[_0x076e('0x11')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x076e('0x13')],'smsStatus':this[_0x076e('0x31')],'smsStatusTime':this[_0x076e('0x14')],'smsCapacity':this[_0x076e('0x15')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x076e('0x17')],'whatsappStatusTime':this[_0x076e('0x18')],'whatsappCapacity':this[_0x076e('0x19')],'whatsappCurrentCapacity':this[_0x076e('0x1a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x076e('0x1c')],'openchannelCapacity':this[_0x076e('0x1d')],'openchannelCurrentCapacity':this[_0x076e('0x32')],'busy':this[_0x076e('0x33')],'busyQueue':this[_0x076e('0x1e')]};var _0xd87254=md5(JSON[_0x076e('0x34')](_0x17d06d));if(this[_0x076e('0x1f')]!==_0xd87254){this[_0x076e('0x1f')]=_0xd87254;io[_0x076e('0x35')](_0x076e('0x36'),_0x17d06d);}};module[_0x076e('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 21fa598..90fc2a6 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 _0x3080=['available','stringify','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause'];(function(_0x1846e7,_0x32cf85){var _0x26464a=function(_0x11ece8){while(--_0x11ece8){_0x1846e7['push'](_0x1846e7['shift']());}};_0x26464a(++_0x32cf85);}(_0x3080,0xb4));var _0x0308=function(_0x1f54d5,_0xe60691){_0x1f54d5=_0x1f54d5-0x0;var _0x55ce77=_0x3080[_0x1f54d5];return _0x55ce77;};'use strict';var _=require('lodash');var md5=require(_0x0308('0x0'));var util=require(_0x0308('0x1'));var Redis=require(_0x0308('0x2'));var config=require(_0x0308('0x3'));config[_0x0308('0x4')]=_[_0x0308('0x5')](config[_0x0308('0x4')],{'host':_0x0308('0x6'),'port':0x18eb});var io=require(_0x0308('0x7'))(new Redis(config[_0x0308('0x4')]));function ChatQueue(_0x2674a5){this['id']=_0x2674a5['id']||0x0;this[_0x0308('0x8')]=_0x2674a5[_0x0308('0x8')]||'';this[_0x0308('0x9')]=_0x2674a5[_0x0308('0x9')]||0xa;this[_0x0308('0xa')]=_0x2674a5[_0x0308('0xa')]||_0x0308('0xb');this['Agents']=_0x2674a5[_0x0308('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0308('0x0')]='';this[_0x0308('0xd')]();this[_0x0308('0xe')]();}ChatQueue[_0x0308('0xf')][_0x0308('0xd')]=function(){var _0x4c7e02=this['mapAgentsId'][_0x0308('0x10')];this['mapAgentsId']=_[_0x0308('0x11')](this[_0x0308('0xc')],'id');this['mapAgentsId'][_0x0308('0x10')]=_0x4c7e02;};ChatQueue[_0x0308('0xf')][_0x0308('0xe')]=function(){this[_0x0308('0x12')]=0x0;this[_0x0308('0x13')]=0x0;for(var _0x125ae4=0x0;_0x125ae4=0x0?this[_0x0308('0x17')]:0x0;var _0x148765={'id':this['id'],'available':this[_0x0308('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0308('0x13')],'waiting':this['waiting']};var _0x1a5275=md5(JSON[_0x0308('0x18')](_0x148765));if(this[_0x0308('0x0')]!==_0x1a5275){this['md5']=_0x1a5275;io['to'](util['format'](_0x0308('0x19'),_0x148765[_0x0308('0x8')]))[_0x0308('0x1a')](_0x0308('0x1b'),_0x148765);}};module[_0x0308('0x1c')]=ChatQueue; \ No newline at end of file +var _0xb02c=['length','online','chatPause','available','waiting','stringify','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused'];(function(_0x3b3559,_0x59f47e){var _0x1793a9=function(_0x4b4737){while(--_0x4b4737){_0x3b3559['push'](_0x3b3559['shift']());}};_0x1793a9(++_0x59f47e);}(_0xb02c,0x13d));var _0xcb02=function(_0xe0b772,_0x5d9a20){_0xe0b772=_0xe0b772-0x0;var _0x3fc740=_0xb02c[_0xe0b772];return _0x3fc740;};'use strict';var _=require(_0xcb02('0x0'));var md5=require(_0xcb02('0x1'));var util=require(_0xcb02('0x2'));var Redis=require('ioredis');var config=require(_0xcb02('0x3'));config[_0xcb02('0x4')]=_[_0xcb02('0x5')](config[_0xcb02('0x4')],{'host':_0xcb02('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcb02('0x4')]));function ChatQueue(_0x490de5){this['id']=_0x490de5['id']||0x0;this[_0xcb02('0x7')]=_0x490de5[_0xcb02('0x7')]||'';this[_0xcb02('0x8')]=_0x490de5[_0xcb02('0x8')]||0xa;this[_0xcb02('0x9')]=_0x490de5['strategy']||_0xcb02('0xa');this[_0xcb02('0xb')]=_0x490de5['Agents'];this[_0xcb02('0xc')]={};this['waiting']=0x0;this[_0xcb02('0x1')]='';this['updateRouting']();this[_0xcb02('0xd')]();}ChatQueue['prototype'][_0xcb02('0xe')]=function(){var _0xc58b3e=this[_0xcb02('0xc')]['_rr'];this[_0xcb02('0xc')]=_['map'](this[_0xcb02('0xb')],'id');this[_0xcb02('0xc')][_0xcb02('0xf')]=_0xc58b3e;};ChatQueue[_0xcb02('0x10')][_0xcb02('0xd')]=function(){this[_0xcb02('0x11')]=0x0;this[_0xcb02('0x12')]=0x0;for(var _0x3c60bb=0x0;_0x3c60bb=0x0?this[_0xcb02('0x16')]:0x0;var _0x48dd07={'id':this['id'],'available':this[_0xcb02('0x16')],'loggedIn':this[_0xcb02('0x11')],'name':this['name'],'paused':this[_0xcb02('0x12')],'waiting':this[_0xcb02('0x17')]};var _0x418e61=md5(JSON[_0xcb02('0x18')](_0x48dd07));if(this[_0xcb02('0x1')]!==_0x418e61){this['md5']=_0x418e61;io['to'](util['format'](_0xcb02('0x19'),_0x48dd07['name']))[_0xcb02('0x1a')]('chat_queue:save',_0x48dd07);}};module[_0xcb02('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 4bbee40..690264b 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 _0x754a=['util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x754a,0x149));var _0xa754=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x754a[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xa754('0x0'));var md5=require('md5');var util=require(_0xa754('0x1'));var Redis=require('ioredis');var config=require(_0xa754('0x2'));config['redis']=_[_0xa754('0x3')](config[_0xa754('0x4')],{'host':_0xa754('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa754('0x4')]));function FaxQueue(_0x1ccace){this['id']=_0x1ccace['id']||0x0;this[_0xa754('0x6')]=_0x1ccace['name']||'';this[_0xa754('0x7')]=_0x1ccace[_0xa754('0x7')]||0xa;this[_0xa754('0x8')]=_0x1ccace['strategy']||_0xa754('0x9');this['Agents']=_0x1ccace[_0xa754('0xa')];this[_0xa754('0xb')]={};this[_0xa754('0xc')]=0x0;this[_0xa754('0xd')]='';this[_0xa754('0xe')]();this[_0xa754('0xf')]();}FaxQueue[_0xa754('0x10')][_0xa754('0xe')]=function(){var _0x5aca58=this[_0xa754('0xb')][_0xa754('0x11')];this['mapAgentsId']=_[_0xa754('0x12')](this['Agents'],'id');this[_0xa754('0xb')][_0xa754('0x11')]=_0x5aca58;};FaxQueue[_0xa754('0x10')][_0xa754('0xf')]=function(){this[_0xa754('0x13')]=0x0;this['paused']=0x0;for(var _0x432d76=0x0;_0x432d76=0x0?this[_0xa754('0x17')]:0x0;var _0xd28507={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa754('0x13')],'name':this[_0xa754('0x6')],'paused':this[_0xa754('0x16')],'waiting':this['waiting']};var _0xad4e16=md5(JSON[_0xa754('0x18')](_0xd28507));if(this[_0xa754('0xd')]!==_0xad4e16){this[_0xa754('0xd')]=_0xad4e16;io['to'](util[_0xa754('0x19')](_0xa754('0x1a'),_0xd28507[_0xa754('0x6')]))[_0xa754('0x1b')](_0xa754('0x1c'),_0xd28507);}};module[_0xa754('0x1d')]=FaxQueue; \ No newline at end of file +var _0x576e=['localhost','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','loggedIn','length','online','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults'];(function(_0x50186a,_0xd8acee){var _0x5031a8=function(_0x371fc8){while(--_0x371fc8){_0x50186a['push'](_0x50186a['shift']());}};_0x5031a8(++_0xd8acee);}(_0x576e,0x96));var _0xe576=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x576e[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0xe576('0x0'));var md5=require(_0xe576('0x1'));var util=require(_0xe576('0x2'));var Redis=require(_0xe576('0x3'));var config=require('../../../config/environment');config[_0xe576('0x4')]=_[_0xe576('0x5')](config[_0xe576('0x4')],{'host':_0xe576('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe576('0x4')]));function FaxQueue(_0x22c3bc){this['id']=_0x22c3bc['id']||0x0;this[_0xe576('0x7')]=_0x22c3bc[_0xe576('0x7')]||'';this['timeout']=_0x22c3bc[_0xe576('0x8')]||0xa;this[_0xe576('0x9')]=_0x22c3bc['strategy']||'beepall';this['Agents']=_0x22c3bc[_0xe576('0xa')];this[_0xe576('0xb')]={};this['waiting']=0x0;this[_0xe576('0x1')]='';this[_0xe576('0xc')]();this[_0xe576('0xd')]();}FaxQueue[_0xe576('0xe')][_0xe576('0xc')]=function(){var _0x5554f3=this[_0xe576('0xb')]['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x5554f3;};FaxQueue[_0xe576('0xe')][_0xe576('0xd')]=function(){this[_0xe576('0xf')]=0x0;this['paused']=0x0;for(var _0x14b800=0x0;_0x14b800=0x0?this['available']:0x0;var _0x358178={'id':this['id'],'available':this[_0xe576('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xe576('0x7')],'paused':this[_0xe576('0x13')],'waiting':this[_0xe576('0x15')]};var _0x102b24=md5(JSON[_0xe576('0x16')](_0x358178));if(this[_0xe576('0x1')]!==_0x102b24){this[_0xe576('0x1')]=_0x102b24;io['to'](util[_0xe576('0x17')](_0xe576('0x18'),_0x358178[_0xe576('0x7')]))['emit']('fax_queue:save',_0x358178);}};module[_0xe576('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 73d8dd9..0431199 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 _0xdfc7=['exports','name','Intervals'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0xdfc7,0x7c));var _0x7dfc=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0xdfc7[_0x58a4ac];return _0x545810;};'use strict';function Interval(_0x48f685){this['id']=_0x48f685['id']||0x0;this['name']=_0x48f685[_0x7dfc('0x0')]||'';this[_0x7dfc('0x1')]=_0x48f685[_0x7dfc('0x1')]||{};}module[_0x7dfc('0x2')]=Interval; \ No newline at end of file +var _0x51fc=['name','Intervals','exports'];(function(_0x174202,_0x5c5292){var _0x4daa4a=function(_0x388964){while(--_0x388964){_0x174202['push'](_0x174202['shift']());}};_0x4daa4a(++_0x5c5292);}(_0x51fc,0xb7));var _0xc51f=function(_0xdae6b9,_0x370831){_0xdae6b9=_0xdae6b9-0x0;var _0x4f7567=_0x51fc[_0xdae6b9];return _0x4f7567;};'use strict';function Interval(_0x4c2120){this['id']=_0x4c2120['id']||0x0;this[_0xc51f('0x0')]=_0x4c2120[_0xc51f('0x0')]||'';this['Intervals']=_0x4c2120[_0xc51f('0x1')]||{};}module[_0xc51f('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 44c4aa4..19058bb 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 _0x11ba=['../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s','mail_queue:save','md5','util'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x11ba,0xa6));var _0xa11b=function(_0x3ef5e1,_0x4bad76){_0x3ef5e1=_0x3ef5e1-0x0;var _0x121ec6=_0x11ba[_0x3ef5e1];return _0x121ec6;};'use strict';var _=require('lodash');var md5=require(_0xa11b('0x0'));var util=require(_0xa11b('0x1'));var Redis=require('ioredis');var config=require(_0xa11b('0x2'));config['redis']=_[_0xa11b('0x3')](config[_0xa11b('0x4')],{'host':_0xa11b('0x5'),'port':0x18eb});var io=require(_0xa11b('0x6'))(new Redis(config['redis']));function MailQueue(_0x45f6ed){this['id']=_0x45f6ed['id']||0x0;this[_0xa11b('0x7')]=_0x45f6ed[_0xa11b('0x7')]||'';this[_0xa11b('0x8')]=_0x45f6ed[_0xa11b('0x8')]||0xa;this[_0xa11b('0x9')]=_0x45f6ed[_0xa11b('0x9')]||_0xa11b('0xa');this[_0xa11b('0xb')]=_0x45f6ed[_0xa11b('0xb')];this[_0xa11b('0xc')]={};this[_0xa11b('0xd')]=0x0;this[_0xa11b('0x0')]='';this[_0xa11b('0xe')]();this[_0xa11b('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x341f27=this[_0xa11b('0xc')]['_rr'];this[_0xa11b('0xc')]=_['map'](this[_0xa11b('0xb')],'id');this[_0xa11b('0xc')][_0xa11b('0x10')]=_0x341f27;};MailQueue[_0xa11b('0x11')]['updateRealtime']=function(){this[_0xa11b('0x12')]=0x0;this['paused']=0x0;for(var _0x314b98=0x0;_0x314b98=0x0?this[_0xa11b('0x17')]:0x0;var _0x3251b6={'id':this['id'],'available':this[_0xa11b('0x17')],'loggedIn':this[_0xa11b('0x12')],'name':this['name'],'paused':this[_0xa11b('0x16')],'waiting':this[_0xa11b('0xd')]};var _0x266a9f=md5(JSON[_0xa11b('0x18')](_0x3251b6));if(this[_0xa11b('0x0')]!==_0x266a9f){this[_0xa11b('0x0')]=_0x266a9f;io['to'](util[_0xa11b('0x19')](_0xa11b('0x1a'),_0x3251b6[_0xa11b('0x7')]))['emit'](_0xa11b('0x1b'),_0x3251b6);}};module['exports']=MailQueue; \ No newline at end of file +var _0x7e18=['_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7e18,0x1a3));var _0x87e1=function(_0x18f129,_0x4db6b1){_0x18f129=_0x18f129-0x0;var _0x5de23d=_0x7e18[_0x18f129];return _0x5de23d;};'use strict';var _=require('lodash');var md5=require(_0x87e1('0x0'));var util=require(_0x87e1('0x1'));var Redis=require(_0x87e1('0x2'));var config=require('../../../config/environment');config[_0x87e1('0x3')]=_[_0x87e1('0x4')](config[_0x87e1('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x87e1('0x5'))(new Redis(config[_0x87e1('0x3')]));function MailQueue(_0x476acf){this['id']=_0x476acf['id']||0x0;this[_0x87e1('0x6')]=_0x476acf['name']||'';this['timeout']=_0x476acf[_0x87e1('0x7')]||0xa;this['strategy']=_0x476acf[_0x87e1('0x8')]||_0x87e1('0x9');this[_0x87e1('0xa')]=_0x476acf[_0x87e1('0xa')];this[_0x87e1('0xb')]={};this[_0x87e1('0xc')]=0x0;this[_0x87e1('0x0')]='';this['updateRouting']();this[_0x87e1('0xd')]();}MailQueue[_0x87e1('0xe')][_0x87e1('0xf')]=function(){var _0x2efe27=this[_0x87e1('0xb')][_0x87e1('0x10')];this[_0x87e1('0xb')]=_[_0x87e1('0x11')](this[_0x87e1('0xa')],'id');this['mapAgentsId']['_rr']=_0x2efe27;};MailQueue[_0x87e1('0xe')][_0x87e1('0xd')]=function(){this[_0x87e1('0x12')]=0x0;this[_0x87e1('0x13')]=0x0;for(var _0x2b3042=0x0;_0x2b3042=0x0?this['available']:0x0;var _0x448cf6={'id':this['id'],'available':this[_0x87e1('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x87e1('0x6')],'paused':this[_0x87e1('0x13')],'waiting':this[_0x87e1('0xc')]};var _0xbcb1c9=md5(JSON[_0x87e1('0x18')](_0x448cf6));if(this[_0x87e1('0x0')]!==_0xbcb1c9){this[_0x87e1('0x0')]=_0xbcb1c9;io['to'](util[_0x87e1('0x19')](_0x87e1('0x1a'),_0x448cf6[_0x87e1('0x6')]))['emit'](_0x87e1('0x1b'),_0x448cf6);}};module[_0x87e1('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 47e360a..c25833e 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x4e77c6,_0x4c359c){var _0x3e326c=function(_0x50e425){while(--_0x50e425){_0x4e77c6['push'](_0x4e77c6['shift']());}};_0x3e326c(++_0x4c359c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x5fc3[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x1261,0x144));var _0x1126=function(_0x5f2ed0,_0xaf721b){_0x5f2ed0=_0x5f2ed0-0x0;var _0x4f2eed=_0x1261[_0x5f2ed0];return _0x4f2eed;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c7c39a7..97cdfda 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 _0x702d=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','smsPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x702d,0x147));var _0xd702=function(_0xc67c40,_0x151cbb){_0xc67c40=_0xc67c40-0x0;var _0x207b19=_0x702d[_0xc67c40];return _0x207b19;};'use strict';var _=require(_0xd702('0x0'));var md5=require(_0xd702('0x1'));var util=require(_0xd702('0x2'));var Redis=require(_0xd702('0x3'));var config=require(_0xd702('0x4'));config['redis']=_[_0xd702('0x5')](config[_0xd702('0x6')],{'host':_0xd702('0x7'),'port':0x18eb});var io=require(_0xd702('0x8'))(new Redis(config['redis']));function SmsQueue(_0x432e01){this['id']=_0x432e01['id']||0x0;this['name']=_0x432e01[_0xd702('0x9')]||'';this[_0xd702('0xa')]=_0x432e01[_0xd702('0xa')]||0xa;this['strategy']=_0x432e01[_0xd702('0xb')]||'beepall';this[_0xd702('0xc')]=_0x432e01[_0xd702('0xc')];this[_0xd702('0xd')]={};this[_0xd702('0xe')]=0x0;this[_0xd702('0x1')]='';this[_0xd702('0xf')]();this[_0xd702('0x10')]();}SmsQueue[_0xd702('0x11')][_0xd702('0xf')]=function(){var _0x15a632=this['mapAgentsId']['_rr'];this[_0xd702('0xd')]=_[_0xd702('0x12')](this[_0xd702('0xc')],'id');this['mapAgentsId'][_0xd702('0x13')]=_0x15a632;};SmsQueue[_0xd702('0x11')][_0xd702('0x10')]=function(){this[_0xd702('0x14')]=0x0;this[_0xd702('0x15')]=0x0;for(var _0x181ff2=0x0;_0x181ff2=0x0?this['available']:0x0;var _0x2205de={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd702('0x14')],'name':this[_0xd702('0x9')],'paused':this[_0xd702('0x15')],'waiting':this[_0xd702('0xe')]};var _0x4cf326=md5(JSON[_0xd702('0x19')](_0x2205de));if(this[_0xd702('0x1')]!==_0x4cf326){this['md5']=_0x4cf326;io['to'](util['format']('sms:queue:%s',_0x2205de[_0xd702('0x9')]))[_0xd702('0x1a')]('sms_queue:save',_0x2205de);}};module[_0xd702('0x1b')]=SmsQueue; \ No newline at end of file +var _0x3c7b=['smsPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','paused','length','online'];(function(_0x4aea3f,_0x54bc17){var _0x2c12fa=function(_0x1da529){while(--_0x1da529){_0x4aea3f['push'](_0x4aea3f['shift']());}};_0x2c12fa(++_0x54bc17);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x4c47fe,_0x398b09){_0x4c47fe=_0x4c47fe-0x0;var _0x43bc22=_0x3c7b[_0x4c47fe];return _0x43bc22;};'use strict';var _=require(_0xb3c7('0x0'));var md5=require(_0xb3c7('0x1'));var util=require(_0xb3c7('0x2'));var Redis=require(_0xb3c7('0x3'));var config=require(_0xb3c7('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb3c7('0x5'))(new Redis(config[_0xb3c7('0x6')]));function SmsQueue(_0x4b3f30){this['id']=_0x4b3f30['id']||0x0;this[_0xb3c7('0x7')]=_0x4b3f30['name']||'';this[_0xb3c7('0x8')]=_0x4b3f30[_0xb3c7('0x8')]||0xa;this[_0xb3c7('0x9')]=_0x4b3f30[_0xb3c7('0x9')]||_0xb3c7('0xa');this['Agents']=_0x4b3f30[_0xb3c7('0xb')];this['mapAgentsId']={};this[_0xb3c7('0xc')]=0x0;this[_0xb3c7('0x1')]='';this[_0xb3c7('0xd')]();this[_0xb3c7('0xe')]();}SmsQueue['prototype'][_0xb3c7('0xd')]=function(){var _0x23f08c=this['mapAgentsId'][_0xb3c7('0xf')];this[_0xb3c7('0x10')]=_[_0xb3c7('0x11')](this[_0xb3c7('0xb')],'id');this[_0xb3c7('0x10')][_0xb3c7('0xf')]=_0x23f08c;};SmsQueue[_0xb3c7('0x12')]['updateRealtime']=function(){this[_0xb3c7('0x13')]=0x0;this[_0xb3c7('0x14')]=0x0;for(var _0x4d66c8=0x0;_0x4d66c8=0x0?this['available']:0x0;var _0x1cfafc={'id':this['id'],'available':this[_0xb3c7('0x18')],'loggedIn':this[_0xb3c7('0x13')],'name':this[_0xb3c7('0x7')],'paused':this[_0xb3c7('0x14')],'waiting':this['waiting']};var _0xdbbb66=md5(JSON[_0xb3c7('0x19')](_0x1cfafc));if(this[_0xb3c7('0x1')]!==_0xdbbb66){this[_0xb3c7('0x1')]=_0xdbbb66;io['to'](util['format']('sms:queue:%s',_0x1cfafc[_0xb3c7('0x7')]))[_0xb3c7('0x1a')]('sms_queue:save',_0x1cfafc);}};module[_0xb3c7('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 0ab644c..ce9f618 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 _0x0457=['socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','Agents','prototype','loggedIn','length','online','whatsappPause','paused','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x43841f,_0x4df0c4){var _0x417f61=function(_0x4a354e){while(--_0x4a354e){_0x43841f['push'](_0x43841f['shift']());}};_0x417f61(++_0x4df0c4);}(_0x0457,0xf0));var _0x7045=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x0457[_0x146a85];return _0x1b59bf;};'use strict';var _=require(_0x7045('0x0'));var md5=require(_0x7045('0x1'));var util=require(_0x7045('0x2'));var Redis=require(_0x7045('0x3'));var config=require(_0x7045('0x4'));config[_0x7045('0x5')]=_[_0x7045('0x6')](config[_0x7045('0x5')],{'host':_0x7045('0x7'),'port':0x18eb});var io=require(_0x7045('0x8'))(new Redis(config[_0x7045('0x5')]));function WhatsappQueue(_0x1d5b2c){this['id']=_0x1d5b2c['id']||0x0;this['name']=_0x1d5b2c[_0x7045('0x9')]||'';this[_0x7045('0xa')]=_0x1d5b2c[_0x7045('0xa')]||0xa;this[_0x7045('0xb')]=_0x1d5b2c[_0x7045('0xb')]||'beepall';this['Agents']=_0x1d5b2c['Agents'];this[_0x7045('0xc')]={};this[_0x7045('0xd')]=0x0;this[_0x7045('0x1')]='';this[_0x7045('0xe')]();this[_0x7045('0xf')]();}WhatsappQueue['prototype'][_0x7045('0xe')]=function(){var _0x54220c=this[_0x7045('0xc')][_0x7045('0x10')];this['mapAgentsId']=_[_0x7045('0x11')](this[_0x7045('0x12')],'id');this['mapAgentsId'][_0x7045('0x10')]=_0x54220c;};WhatsappQueue[_0x7045('0x13')][_0x7045('0xf')]=function(){this[_0x7045('0x14')]=0x0;this['paused']=0x0;for(var _0x45bd8a=0x0;_0x45bd8a=0x0?this[_0x7045('0x19')]:0x0;var _0x1ef0d9={'id':this['id'],'available':this[_0x7045('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x7045('0x18')],'waiting':this['waiting']};var _0x24296e=md5(JSON['stringify'](_0x1ef0d9));if(this[_0x7045('0x1')]!==_0x24296e){this[_0x7045('0x1')]=_0x24296e;io['to'](util[_0x7045('0x1a')](_0x7045('0x1b'),_0x1ef0d9[_0x7045('0x9')]))[_0x7045('0x1c')](_0x7045('0x1d'),_0x1ef0d9);}};module[_0x7045('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x593b=['emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','beepall','waiting','updateRouting','prototype','map','Agents','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s'];(function(_0x421d50,_0x19c13e){var _0x320b7c=function(_0x48104f){while(--_0x48104f){_0x421d50['push'](_0x421d50['shift']());}};_0x320b7c(++_0x19c13e);}(_0x593b,0x189));var _0xb593=function(_0xdb9d37,_0xa818ce){_0xdb9d37=_0xdb9d37-0x0;var _0x9ed08d=_0x593b[_0xdb9d37];return _0x9ed08d;};'use strict';var _=require(_0xb593('0x0'));var md5=require(_0xb593('0x1'));var util=require('util');var Redis=require(_0xb593('0x2'));var config=require(_0xb593('0x3'));config[_0xb593('0x4')]=_[_0xb593('0x5')](config[_0xb593('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb593('0x6'))(new Redis(config[_0xb593('0x4')]));function WhatsappQueue(_0xdb0a44){this['id']=_0xdb0a44['id']||0x0;this[_0xb593('0x7')]=_0xdb0a44['name']||'';this[_0xb593('0x8')]=_0xdb0a44['timeout']||0xa;this['strategy']=_0xdb0a44['strategy']||_0xb593('0x9');this['Agents']=_0xdb0a44['Agents'];this['mapAgentsId']={};this[_0xb593('0xa')]=0x0;this[_0xb593('0x1')]='';this[_0xb593('0xb')]();this['updateRealtime']();}WhatsappQueue[_0xb593('0xc')][_0xb593('0xb')]=function(){var _0x3098eb=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xb593('0xd')](this[_0xb593('0xe')],'id');this[_0xb593('0xf')][_0xb593('0x10')]=_0x3098eb;};WhatsappQueue[_0xb593('0xc')][_0xb593('0x11')]=function(){this[_0xb593('0x12')]=0x0;this[_0xb593('0x13')]=0x0;for(var _0x46e501=0x0;_0x46e501=0x0?this[_0xb593('0x17')]:0x0;var _0x51ca71={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb593('0x12')],'name':this['name'],'paused':this[_0xb593('0x13')],'waiting':this[_0xb593('0xa')]};var _0x220732=md5(JSON[_0xb593('0x18')](_0x51ca71));if(this[_0xb593('0x1')]!==_0x220732){this['md5']=_0x220732;io['to'](util[_0xb593('0x19')](_0xb593('0x1a'),_0x51ca71[_0xb593('0x7')]))[_0xb593('0x1b')](_0xb593('0x1c'),_0x51ca71);}};module[_0xb593('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 94c7605..fd84f6c 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(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x2ebbd8,_0x47b53a){var _0x561f8a=function(_0x30a5b4){while(--_0x30a5b4){_0x2ebbd8['push'](_0x2ebbd8['shift']());}};_0x561f8a(++_0x47b53a);}(_0xb10b,0x12a));var _0xbb10=function(_0x23f564,_0x48d2ba){_0x23f564=_0x23f564-0x0;var _0x47582b=_0xb10b[_0x23f564];return _0x47582b;};'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 196914a..9c94a41 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 _0x3d0c=['addTagsToChatInteraction','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x4506d2,_0x20ae25){var _0x5bc054=function(_0x4099f5){while(--_0x4099f5){_0x4506d2['push'](_0x4506d2['shift']());}};_0x5bc054(++_0x20ae25);}(_0x3d0c,0x67));var _0xc3d0=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x3d0c[_0x5400a1];return _0x4006c7;};'use strict';var client=require('../client');exports[_0xc3d0('0x0')]=function(_0x39bdc1,_0x4496e7){return client[_0xc3d0('0x1')]('UpdateChatInteraction',{'body':_0x4496e7,'options':{'where':{'id':_0x39bdc1}},'log':_0xc3d0('0x2')});};exports[_0xc3d0('0x3')]=function(_0x110e18,_0x5dfb03){return client[_0xc3d0('0x1')](_0xc3d0('0x4'),{'body':_0x5dfb03,'options':{'where':{'id':_0x110e18}},'log':_0xc3d0('0x5')});}; \ No newline at end of file +var _0xeb3b=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x145bcc,_0x20f191){var _0x16f195=function(_0x3361bd){while(--_0x3361bd){_0x145bcc['push'](_0x145bcc['shift']());}};_0x16f195(++_0x20f191);}(_0xeb3b,0x1d5));var _0xbeb3=function(_0x4f9d26,_0x641341){_0x4f9d26=_0x4f9d26-0x0;var _0x57debc=_0xeb3b[_0x4f9d26];return _0x57debc;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(_0x2142b3,_0x20d252){return client[_0xbeb3('0x2')](_0xbeb3('0x3'),{'body':_0x20d252,'options':{'where':{'id':_0x2142b3}},'log':_0xbeb3('0x4')});};exports[_0xbeb3('0x5')]=function(_0x589ead,_0xa4699f){return client['Request'](_0xbeb3('0x6'),{'body':_0xa4699f,'options':{'where':{'id':_0x589ead}},'log':_0xbeb3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 8482acf..a7cb295 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 _0xb8b8=['CreateChatMessage','Request'];(function(_0x8a6a5,_0x228364){var _0x175f85=function(_0x29dc3a){while(--_0x29dc3a){_0x8a6a5['push'](_0x8a6a5['shift']());}};_0x175f85(++_0x228364);}(_0xb8b8,0x16d));var _0x8b8b=function(_0x45c1c2,_0x302f4f){_0x45c1c2=_0x45c1c2-0x0;var _0x243166=_0xb8b8[_0x45c1c2];return _0x243166;};'use strict';var client=require('../client');exports['create']=function(_0x5d27f4){return client[_0x8b8b('0x0')](_0x8b8b('0x1'),{'body':_0x5d27f4,'log':'createChatMessage'});}; \ No newline at end of file +var _0x9ab0=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x1e6034,_0x541421){var _0x3dffdf=function(_0x27fc4d){while(--_0x27fc4d){_0x1e6034['push'](_0x1e6034['shift']());}};_0x3dffdf(++_0x541421);}(_0x9ab0,0x127));var _0x09ab=function(_0xfc49f2,_0x555729){_0xfc49f2=_0xfc49f2-0x0;var _0x40d95b=_0x9ab0[_0xfc49f2];return _0x40d95b;};'use strict';var client=require('../client');exports[_0x09ab('0x0')]=function(_0x372a0b){return client[_0x09ab('0x1')](_0x09ab('0x2'),{'body':_0x372a0b,'log':_0x09ab('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index d1b89b6..e633d1d 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 _0xe700=['GetChatQueue','name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe700,0x75));var _0x0e70=function(_0x4b5fd3,_0x33ce49){_0x4b5fd3=_0x4b5fd3-0x0;var _0x42d75e=_0xe700[_0x4b5fd3];return _0x42d75e;};'use strict';var client=require(_0x0e70('0x0'));exports[_0x0e70('0x1')]=function(){return function(){return client[_0x0e70('0x2')](_0x0e70('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e70('0x4'),_0x0e70('0x5'),_0x0e70('0x6')],'include':[{'model':_0x0e70('0x7'),'as':_0x0e70('0x8'),'attributes':['id',_0x0e70('0x4'),'online',_0x0e70('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x2208=['timeout','strategy','User','Agents','name','online','getChatQueues','GetChatQueue'];(function(_0x5c401e,_0x462df1){var _0x59f112=function(_0x362b64){while(--_0x362b64){_0x5c401e['push'](_0x5c401e['shift']());}};_0x59f112(++_0x462df1);}(_0x2208,0x11e));var _0x8220=function(_0x203d5d,_0x1aecbd){_0x203d5d=_0x203d5d-0x0;var _0x55ab11=_0x2208[_0x203d5d];return _0x55ab11;};'use strict';var client=require('../client');exports[_0x8220('0x0')]=function(){return function(){return client['Request'](_0x8220('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8220('0x2'),_0x8220('0x3')],'include':[{'model':_0x8220('0x4'),'as':_0x8220('0x5'),'attributes':['id',_0x8220('0x6'),_0x8220('0x7'),'chatPause']}]},'log':_0x8220('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index c0bd080..5132247 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 _0xe148=['update','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xe148,0x9e));var _0x8e14=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0xe148[_0x173dd9];return _0x5a0d5a;};'use strict';var client=require(_0x8e14('0x0'));exports[_0x8e14('0x1')]=function(_0x57ec7c){return client[_0x8e14('0x2')](_0x8e14('0x3'),{'body':_0x57ec7c,'log':'CreateChatQueueReport'});};exports[_0x8e14('0x4')]=function(_0x234870,_0x46a514){return client[_0x8e14('0x2')]('UpdateChatQueueReport',{'body':_0x46a514,'options':{'where':{'uniqueid':_0x234870},'order':[['id','DESC']],'limit':0x1},'log':_0x8e14('0x5')});}; \ No newline at end of file +var _0x032a=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x281850,_0x2e105c){var _0x291ed1=function(_0x2b370a){while(--_0x2b370a){_0x281850['push'](_0x281850['shift']());}};_0x291ed1(++_0x2e105c);}(_0x032a,0xf0));var _0xa032=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0x032a[_0x2fd160];return _0x5c2031;};'use strict';var client=require('../client');exports[_0xa032('0x0')]=function(_0x591b65){return client[_0xa032('0x1')](_0xa032('0x2'),{'body':_0x591b65,'log':_0xa032('0x2')});};exports[_0xa032('0x3')]=function(_0x185934,_0x23ad84){return client[_0xa032('0x1')](_0xa032('0x4'),{'body':_0x23ad84,'options':{'where':{'uniqueid':_0x185934},'order':[['id',_0xa032('0x5')]],'limit':0x1},'log':_0xa032('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d5b8a53..4fa805e 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(_0x1c7e4d,_0x3476dc){var _0x5749fe=function(_0xa21c52){while(--_0xa21c52){_0x1c7e4d['push'](_0x1c7e4d['shift']());}};_0x5749fe(++_0x3476dc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x7a54,0x106));var _0x47a5=function(_0x1bb443,_0x4cedc1){_0x1bb443=_0x1bb443-0x0;var _0x39ab1b=_0x7a54[_0x1bb443];return _0x39ab1b;};'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 f618ddc..dcf4444 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 _0x96cd=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x96cd,0x6d));var _0xd96c=function(_0x2c6d0b,_0x3c3ba4){_0x2c6d0b=_0x2c6d0b-0x0;var _0x334a45=_0x96cd[_0x2c6d0b];return _0x334a45;};'use strict';var client=require(_0xd96c('0x0'));exports[_0xd96c('0x1')]=function(_0x6023ba){return client[_0xd96c('0x2')](_0xd96c('0x3'),{'body':_0x6023ba,'log':_0xd96c('0x4')});}; \ No newline at end of file +var _0x9acc=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x2c5786,_0xcdc68a){var _0x313a7b=function(_0xd25506){while(--_0xd25506){_0x2c5786['push'](_0x2c5786['shift']());}};_0x313a7b(++_0xcdc68a);}(_0x9acc,0x10a));var _0xc9ac=function(_0x19bf9e,_0xab9510){_0x19bf9e=_0x19bf9e-0x0;var _0x513095=_0x9acc[_0x19bf9e];return _0x513095;};'use strict';var client=require(_0xc9ac('0x0'));exports[_0xc9ac('0x1')]=function(_0x156fbb){return client[_0xc9ac('0x2')](_0xc9ac('0x3'),{'body':_0x156fbb,'log':_0xc9ac('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 7ddd087..43db1a3 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 _0x6f08=['name','timeout','strategy','online','faxPause','getFaxQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f08,0x1cc));var _0x86f0=function(_0x1c2237,_0x4096be){_0x1c2237=_0x1c2237-0x0;var _0x28ef84=_0x6f08[_0x1c2237];return _0x28ef84;};'use strict';var client=require('../client');exports[_0x86f0('0x0')]=function(){return function(){return client[_0x86f0('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x86f0('0x2'),_0x86f0('0x3'),_0x86f0('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x86f0('0x5'),_0x86f0('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x2840=['strategy','User','Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x4be735,_0x4998c9){var _0x3e44e9=function(_0x3182d5){while(--_0x3182d5){_0x4be735['push'](_0x4be735['shift']());}};_0x3e44e9(++_0x4998c9);}(_0x2840,0xec));var _0x0284=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x2840[_0x2b49bc];return _0x43cc65;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x0284('0x0')](_0x0284('0x1'),{'options':{'raw':![],'attributes':['id',_0x0284('0x2'),_0x0284('0x3'),_0x0284('0x4')],'include':[{'model':_0x0284('0x5'),'as':_0x0284('0x6'),'attributes':['id',_0x0284('0x2'),_0x0284('0x7'),_0x0284('0x8')]}]},'log':_0x0284('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 35d5c9f..a8e1b72 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 _0x1c4b=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x505a10,_0x1355eb){var _0x3d0aef=function(_0x5df0ab){while(--_0x5df0ab){_0x505a10['push'](_0x505a10['shift']());}};_0x3d0aef(++_0x1355eb);}(_0x1c4b,0xa9));var _0xb1c4=function(_0x1e54a8,_0x562cc3){_0x1e54a8=_0x1e54a8-0x0;var _0x3a9b7b=_0x1c4b[_0x1e54a8];return _0x3a9b7b;};'use strict';var client=require(_0xb1c4('0x0'));exports['create']=function(_0x2d879b){return client[_0xb1c4('0x1')](_0xb1c4('0x2'),{'body':_0x2d879b,'log':_0xb1c4('0x2')});};exports[_0xb1c4('0x3')]=function(_0x3d59fc,_0x3430ff){return client['Request']('UpdateFaxQueueReport',{'body':_0x3430ff,'options':{'where':{'uniqueid':_0x3d59fc},'order':[['id','DESC']],'limit':0x1},'log':_0xb1c4('0x4')});}; \ No newline at end of file +var _0x0651=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x36a92d,_0x30e3ef){var _0x558a68=function(_0xdd3bb2){while(--_0xdd3bb2){_0x36a92d['push'](_0x36a92d['shift']());}};_0x558a68(++_0x30e3ef);}(_0x0651,0x149));var _0x1065=function(_0x1efea6,_0x18d7e9){_0x1efea6=_0x1efea6-0x0;var _0x13dcec=_0x0651[_0x1efea6];return _0x13dcec;};'use strict';var client=require(_0x1065('0x0'));exports[_0x1065('0x1')]=function(_0x48fb17){return client[_0x1065('0x2')](_0x1065('0x3'),{'body':_0x48fb17,'log':_0x1065('0x3')});};exports[_0x1065('0x4')]=function(_0x272e8f,_0x2f4430){return client[_0x1065('0x2')](_0x1065('0x5'),{'body':_0x2f4430,'options':{'where':{'uniqueid':_0x272e8f},'order':[['id',_0x1065('0x6')]],'limit':0x1},'log':_0x1065('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index bc00667..641abff 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 _0xaa27=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x3354eb,_0x2ff1be){var _0x5d9a84=function(_0x152596){while(--_0x152596){_0x3354eb['push'](_0x3354eb['shift']());}};_0x5d9a84(++_0x2ff1be);}(_0xaa27,0x141));var _0x7aa2=function(_0x4d5f0f,_0x52a127){_0x4d5f0f=_0x4d5f0f-0x0;var _0x400eba=_0xaa27[_0x4d5f0f];return _0x400eba;};'use strict';var client=require(_0x7aa2('0x0'));exports[_0x7aa2('0x1')]=function(){return function(){return client[_0x7aa2('0x2')](_0x7aa2('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7aa2('0x4')],'include':[{'model':_0x7aa2('0x5'),'as':_0x7aa2('0x6'),'attributes':['id',_0x7aa2('0x4'),_0x7aa2('0x7')]}]},'log':_0x7aa2('0x1')});};}; \ No newline at end of file +var _0x01af=['getIntervals','Request','name','Interval','interval','../client'];(function(_0x25c150,_0x1a9df8){var _0x7071ef=function(_0x9ee022){while(--_0x9ee022){_0x25c150['push'](_0x25c150['shift']());}};_0x7071ef(++_0x1a9df8);}(_0x01af,0x1a9));var _0xf01a=function(_0x47b54b,_0x54ff19){_0x47b54b=_0x47b54b-0x0;var _0x150c7f=_0x01af[_0x47b54b];return _0x150c7f;};'use strict';var client=require(_0xf01a('0x0'));exports[_0xf01a('0x1')]=function(){return function(){return client[_0xf01a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf01a('0x3')],'include':[{'model':_0xf01a('0x4'),'as':'Intervals','attributes':['id',_0xf01a('0x3'),_0xf01a('0x5')]}]},'log':_0xf01a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 08c432f..a9caef5 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 _0x5f2f=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x46e39d,_0x541925){var _0x4d6f0a=function(_0x5e6b81){while(--_0x5e6b81){_0x46e39d['push'](_0x46e39d['shift']());}};_0x4d6f0a(++_0x541925);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4468ea,_0x3af88a){_0x4468ea=_0x4468ea-0x0;var _0x1e236a=_0x5f2f[_0x4468ea];return _0x1e236a;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(_0x2dcf60,_0x1a7be1){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'body':_0x1a7be1,'options':{'where':{'id':_0x2dcf60}},'log':_0xf5f2('0x4')});};exports[_0xf5f2('0x5')]=function(_0x501fbd,_0x4854b6){return client[_0xf5f2('0x2')](_0xf5f2('0x6'),{'body':_0x4854b6,'options':{'where':{'id':_0x501fbd}},'log':_0xf5f2('0x7')});}; \ No newline at end of file +var _0xfff0=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x34a860,_0x5a8166){var _0x2a524a=function(_0x2fa78b){while(--_0x2fa78b){_0x34a860['push'](_0x34a860['shift']());}};_0x2a524a(++_0x5a8166);}(_0xfff0,0x139));var _0x0fff=function(_0x10013e,_0x3aee91){_0x10013e=_0x10013e-0x0;var _0x4a38fc=_0xfff0[_0x10013e];return _0x4a38fc;};'use strict';var client=require('../client');exports[_0x0fff('0x0')]=function(_0x2b95e0,_0x148db8){return client['Request'](_0x0fff('0x1'),{'body':_0x148db8,'options':{'where':{'id':_0x2b95e0}},'log':_0x0fff('0x2')});};exports[_0x0fff('0x3')]=function(_0x4bec60,_0x2cd3d5){return client[_0x0fff('0x4')]('AddTagsToMailInteraction',{'body':_0x2cd3d5,'options':{'where':{'id':_0x4bec60}},'log':_0x0fff('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 62cd300..7029a6a 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 _0xb30e=['create','Request','CreateMailMessage','../client'];(function(_0x540051,_0x4cdc5){var _0x4dd787=function(_0x2beed5){while(--_0x2beed5){_0x540051['push'](_0x540051['shift']());}};_0x4dd787(++_0x4cdc5);}(_0xb30e,0xab));var _0xeb30=function(_0x4b7ae3,_0x5dc0c9){_0x4b7ae3=_0x4b7ae3-0x0;var _0x46d4b0=_0xb30e[_0x4b7ae3];return _0x46d4b0;};'use strict';var client=require(_0xeb30('0x0'));exports[_0xeb30('0x1')]=function(_0x3bd1c9){return client[_0xeb30('0x2')](_0xeb30('0x3'),{'body':_0x3bd1c9,'log':'createMailMessage'});}; \ No newline at end of file +var _0x57fa=['createMailMessage','../client','CreateMailMessage'];(function(_0x4915db,_0xb3d70d){var _0x100f93=function(_0x22e9ff){while(--_0x22e9ff){_0x4915db['push'](_0x4915db['shift']());}};_0x100f93(++_0xb3d70d);}(_0x57fa,0x15d));var _0xa57f=function(_0x33470d,_0x18e69e){_0x33470d=_0x33470d-0x0;var _0x2d2583=_0x57fa[_0x33470d];return _0x2d2583;};'use strict';var client=require(_0xa57f('0x0'));exports['create']=function(_0x2a3aae){return client['Request'](_0xa57f('0x1'),{'body':_0x2a3aae,'log':_0xa57f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index eb1f9df..5e8b15b 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 _0xd065=['mailPause','getMailQueues','../client','timeout','strategy','User','name','online'];(function(_0xf4685d,_0x4c189c){var _0xd319d7=function(_0x3366cc){while(--_0x3366cc){_0xf4685d['push'](_0xf4685d['shift']());}};_0xd319d7(++_0x4c189c);}(_0xd065,0xe2));var _0x5d06=function(_0x1f5d7d,_0xdb1763){_0x1f5d7d=_0x1f5d7d-0x0;var _0x2d3ad1=_0xd065[_0x1f5d7d];return _0x2d3ad1;};'use strict';var client=require(_0x5d06('0x0'));exports['getMailQueues']=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x5d06('0x1'),_0x5d06('0x2')],'include':[{'model':_0x5d06('0x3'),'as':'Agents','attributes':['id',_0x5d06('0x4'),_0x5d06('0x5'),_0x5d06('0x6')]}]},'log':_0x5d06('0x7')});};}; \ No newline at end of file +var _0x5e86=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x317f1d,_0x450d87){var _0x17663d=function(_0x19d503){while(--_0x19d503){_0x317f1d['push'](_0x317f1d['shift']());}};_0x17663d(++_0x450d87);}(_0x5e86,0xe2));var _0x65e8=function(_0x22efbc,_0x564044){_0x22efbc=_0x22efbc-0x0;var _0x5f1f97=_0x5e86[_0x22efbc];return _0x5f1f97;};'use strict';var client=require(_0x65e8('0x0'));exports[_0x65e8('0x1')]=function(){return function(){return client[_0x65e8('0x2')](_0x65e8('0x3'),{'options':{'raw':![],'attributes':['id',_0x65e8('0x4'),_0x65e8('0x5'),_0x65e8('0x6')],'include':[{'model':_0x65e8('0x7'),'as':_0x65e8('0x8'),'attributes':['id',_0x65e8('0x4'),_0x65e8('0x9'),_0x65e8('0xa')]}]},'log':_0x65e8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 614c680..8fe1a8f 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 _0xee2d=['CreateMailQueueReport','DESC','../client','create','Request'];(function(_0x55512d,_0x1e4562){var _0x30b066=function(_0x50e6cb){while(--_0x50e6cb){_0x55512d['push'](_0x55512d['shift']());}};_0x30b066(++_0x1e4562);}(_0xee2d,0x174));var _0xdee2=function(_0x58c89a,_0x4cc002){_0x58c89a=_0x58c89a-0x0;var _0x30b3b7=_0xee2d[_0x58c89a];return _0x30b3b7;};'use strict';var client=require(_0xdee2('0x0'));exports[_0xdee2('0x1')]=function(_0x2b2cf3){return client[_0xdee2('0x2')](_0xdee2('0x3'),{'body':_0x2b2cf3,'log':_0xdee2('0x3')});};exports['update']=function(_0x452ad2,_0x2eedb2){return client[_0xdee2('0x2')]('UpdateMailQueueReport',{'body':_0x2eedb2,'options':{'where':{'uniqueid':_0x452ad2},'order':[['id',_0xdee2('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xd7be=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x518f36,_0x5cf9c8){var _0x44425e=function(_0x2d83c6){while(--_0x2d83c6){_0x518f36['push'](_0x518f36['shift']());}};_0x44425e(++_0x5cf9c8);}(_0xd7be,0x68));var _0xed7b=function(_0x27a552,_0x59e120){_0x27a552=_0x27a552-0x0;var _0x430aa2=_0xd7be[_0x27a552];return _0x430aa2;};'use strict';var client=require(_0xed7b('0x0'));exports[_0xed7b('0x1')]=function(_0x24e218){return client[_0xed7b('0x2')](_0xed7b('0x3'),{'body':_0x24e218,'log':_0xed7b('0x3')});};exports['update']=function(_0x89e1a0,_0x1e9cba){return client[_0xed7b('0x2')](_0xed7b('0x4'),{'body':_0x1e9cba,'options':{'where':{'uniqueid':_0x89e1a0},'order':[['id',_0xed7b('0x5')]],'limit':0x1},'log':_0xed7b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index aad1688..41de824 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 _0x0c88=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x5e3825,_0x4b3288){var _0x1374e7=function(_0x31189d){while(--_0x31189d){_0x5e3825['push'](_0x5e3825['shift']());}};_0x1374e7(++_0x4b3288);}(_0x0c88,0x1c0));var _0x80c8=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x0c88[_0x31a37b];return _0x49ae16;};'use strict';var client=require(_0x80c8('0x0'));exports['update']=function(_0x43dca9,_0x322960){return client[_0x80c8('0x1')](_0x80c8('0x2'),{'body':_0x322960,'options':{'where':{'id':_0x43dca9}},'log':_0x80c8('0x3')});};exports['addTags']=function(_0x3a3ad8,_0x5138c5){return client[_0x80c8('0x1')](_0x80c8('0x4'),{'body':_0x5138c5,'options':{'where':{'id':_0x3a3ad8}},'log':_0x80c8('0x5')});}; \ No newline at end of file +var _0x3c80=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3c80,0x1bb));var _0x03c8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3c80[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports['update']=function(_0xc66925,_0x16809a){return client[_0x03c8('0x0')](_0x03c8('0x1'),{'body':_0x16809a,'options':{'where':{'id':_0xc66925}},'log':_0x03c8('0x2')});};exports['addTags']=function(_0x42dee4,_0x2c1923){return client[_0x03c8('0x0')](_0x03c8('0x3'),{'body':_0x2c1923,'options':{'where':{'id':_0x42dee4}},'log':_0x03c8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 379cba6..c0fab63 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 _0x5cb0=['create','createOpenchannelMessage','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5cb0,0x1eb));var _0x05cb=function(_0x291d00,_0x4263d9){_0x291d00=_0x291d00-0x0;var _0x496e20=_0x5cb0[_0x291d00];return _0x496e20;};'use strict';var client=require(_0x05cb('0x0'));exports[_0x05cb('0x1')]=function(_0x1c15fb){return client['Request']('CreateOpenchannelMessage',{'body':_0x1c15fb,'log':_0x05cb('0x2')});}; \ No newline at end of file +var _0x6b83=['CreateOpenchannelMessage','createOpenchannelMessage','../client','Request'];(function(_0x5a4666,_0x1d496a){var _0x54638c=function(_0x45f6a8){while(--_0x45f6a8){_0x5a4666['push'](_0x5a4666['shift']());}};_0x54638c(++_0x1d496a);}(_0x6b83,0x17a));var _0x36b8=function(_0x58bce9,_0x3c41e5){_0x58bce9=_0x58bce9-0x0;var _0x1b4eaf=_0x6b83[_0x58bce9];return _0x1b4eaf;};'use strict';var client=require(_0x36b8('0x0'));exports['create']=function(_0x392897){return client[_0x36b8('0x1')](_0x36b8('0x2'),{'body':_0x392897,'log':_0x36b8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 9c61eee..c36625e 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 _0x8396=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x8396,0x116));var _0x6839=function(_0x51e05d,_0x51cc95){_0x51e05d=_0x51e05d-0x0;var _0x3fa70e=_0x8396[_0x51e05d];return _0x3fa70e;};'use strict';var client=require('../client');exports[_0x6839('0x0')]=function(){return function(){return client[_0x6839('0x1')](_0x6839('0x2'),{'options':{'raw':![],'attributes':['id',_0x6839('0x3'),_0x6839('0x4'),_0x6839('0x5')],'include':[{'model':_0x6839('0x6'),'as':_0x6839('0x7'),'attributes':['id',_0x6839('0x3'),_0x6839('0x8'),_0x6839('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x20c6=['User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x75eeb5,_0x6a129c){var _0x3f098f=function(_0x2bf092){while(--_0x2bf092){_0x75eeb5['push'](_0x75eeb5['shift']());}};_0x3f098f(++_0x6a129c);}(_0x20c6,0xb8));var _0x620c=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x20c6[_0x3fe042];return _0x7d4a1f;};'use strict';var client=require(_0x620c('0x0'));exports[_0x620c('0x1')]=function(){return function(){return client[_0x620c('0x2')](_0x620c('0x3'),{'options':{'raw':![],'attributes':['id',_0x620c('0x4'),_0x620c('0x5'),'strategy'],'include':[{'model':_0x620c('0x6'),'as':_0x620c('0x7'),'attributes':['id','name',_0x620c('0x8'),_0x620c('0x9')]}]},'log':_0x620c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e04f4c9..4ca9cc6 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 _0xdd99=['update','Request','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x25d7a4,_0x2809bd){var _0xa9406b=function(_0x2c7244){while(--_0x2c7244){_0x25d7a4['push'](_0x25d7a4['shift']());}};_0xa9406b(++_0x2809bd);}(_0xdd99,0x146));var _0x9dd9=function(_0x283ca3,_0x2e3d02){_0x283ca3=_0x283ca3-0x0;var _0x4d3bb9=_0xdd99[_0x283ca3];return _0x4d3bb9;};'use strict';var client=require(_0x9dd9('0x0'));exports[_0x9dd9('0x1')]=function(_0x2dbbdd){return client['Request'](_0x9dd9('0x2'),{'body':_0x2dbbdd,'log':'CreateOpenchannelQueueReport'});};exports[_0x9dd9('0x3')]=function(_0x315ac0,_0x5e7d3c){return client[_0x9dd9('0x4')](_0x9dd9('0x5'),{'body':_0x5e7d3c,'options':{'where':{'uniqueid':_0x315ac0},'order':[['id',_0x9dd9('0x6')]],'limit':0x1},'log':_0x9dd9('0x5')});}; \ No newline at end of file +var _0xe018=['update','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x581270,_0x49b097){var _0x1c04f1=function(_0x1bae33){while(--_0x1bae33){_0x581270['push'](_0x581270['shift']());}};_0x1c04f1(++_0x49b097);}(_0xe018,0xc9));var _0x8e01=function(_0x297ef7,_0x441791){_0x297ef7=_0x297ef7-0x0;var _0x35c1ba=_0xe018[_0x297ef7];return _0x35c1ba;};'use strict';var client=require(_0x8e01('0x0'));exports[_0x8e01('0x1')]=function(_0x403904){return client['Request'](_0x8e01('0x2'),{'body':_0x403904,'log':'CreateOpenchannelQueueReport'});};exports[_0x8e01('0x3')]=function(_0x23eeb9,_0x57cd58){return client['Request'](_0x8e01('0x4'),{'body':_0x57cd58,'options':{'where':{'uniqueid':_0x23eeb9},'order':[['id',_0x8e01('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b5cd8f7..fa02d66 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 _0xf2cb=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x54bee3,_0xbde47e){var _0x43c571=function(_0x16280a){while(--_0x16280a){_0x54bee3['push'](_0x54bee3['shift']());}};_0x43c571(++_0xbde47e);}(_0xf2cb,0x130));var _0xbf2c=function(_0x15833e,_0x58a046){_0x15833e=_0x15833e-0x0;var _0x5c4745=_0xf2cb[_0x15833e];return _0x5c4745;};'use strict';var client=require('../client');exports[_0xbf2c('0x0')]=function(_0x5e5c76,_0x15aa19){return client['Request'](_0xbf2c('0x1'),{'body':_0x15aa19,'options':{'where':{'id':_0x5e5c76}},'log':'updateSmsInteraction'});};exports[_0xbf2c('0x2')]=function(_0x41c649,_0x5abeb3){return client['Request'](_0xbf2c('0x3'),{'body':_0x5abeb3,'options':{'where':{'id':_0x41c649}},'log':_0xbf2c('0x4')});}; \ No newline at end of file +var _0xfc76=['addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','addTags'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfc76,0xb5));var _0x6fc7=function(_0xf8963a,_0x18668b){_0xf8963a=_0xf8963a-0x0;var _0x5e6968=_0xfc76[_0xf8963a];return _0x5e6968;};'use strict';var client=require('../client');exports[_0x6fc7('0x0')]=function(_0x461a6d,_0x1d6ab9){return client[_0x6fc7('0x1')](_0x6fc7('0x2'),{'body':_0x1d6ab9,'options':{'where':{'id':_0x461a6d}},'log':'updateSmsInteraction'});};exports[_0x6fc7('0x3')]=function(_0x40d212,_0x51280c){return client[_0x6fc7('0x1')]('AddTagsToSmsInteraction',{'body':_0x51280c,'options':{'where':{'id':_0x40d212}},'log':_0x6fc7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4943732..27c12d0 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 _0x075c=['CreateSmsMessage','create','Request'];(function(_0x2e3416,_0x5073f4){var _0x1749ff=function(_0x3322d1){while(--_0x3322d1){_0x2e3416['push'](_0x2e3416['shift']());}};_0x1749ff(++_0x5073f4);}(_0x075c,0x7c));var _0xc075=function(_0x1f5422,_0x133b3f){_0x1f5422=_0x1f5422-0x0;var _0x2e9c5b=_0x075c[_0x1f5422];return _0x2e9c5b;};'use strict';var client=require('../client');exports[_0xc075('0x0')]=function(_0x379e61){return client[_0xc075('0x1')](_0xc075('0x2'),{'body':_0x379e61,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xeab2=['Request','CreateSmsMessage','createSmsMessage'];(function(_0x2c8eca,_0x3e4244){var _0x190447=function(_0x44c2ac){while(--_0x44c2ac){_0x2c8eca['push'](_0x2c8eca['shift']());}};_0x190447(++_0x3e4244);}(_0xeab2,0x111));var _0x2eab=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xeab2[_0x12d033];return _0x3b4e80;};'use strict';var client=require('../client');exports['create']=function(_0x32af42){return client[_0x2eab('0x0')](_0x2eab('0x1'),{'body':_0x32af42,'log':_0x2eab('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 459deb2..8bd5578 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x5ef6a2,_0x19c424){var _0x4aa800=function(_0x494a5d){while(--_0x494a5d){_0x5ef6a2['push'](_0x5ef6a2['shift']());}};_0x4aa800(++_0x19c424);}(_0x70e0,0x17b));var _0x070e=function(_0x4ea6cb,_0x168e09){_0x4ea6cb=_0x4ea6cb-0x0;var _0xc5d865=_0x70e0[_0x4ea6cb];return _0xc5d865;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 70931b8..eb3ea85 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x245a00,_0x49b273){var _0x27f418=function(_0x263f15){while(--_0x263f15){_0x245a00['push'](_0x245a00['shift']());}};_0x27f418(++_0x49b273);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2f82e7,_0x50f448){var _0x483927=function(_0x1f9d9c){while(--_0x1f9d9c){_0x2f82e7['push'](_0x2f82e7['shift']());}};_0x483927(++_0x50f448);}(_0x008c,0x188));var _0xc008=function(_0x500a1f,_0x14745f){_0x500a1f=_0x500a1f-0x0;var _0x2f5bd7=_0x008c[_0x500a1f];return _0x2f5bd7;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index aab6fa7..9e0c981 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(_0x311a90,_0x3a7313){var _0x1853b7=function(_0x39ec8a){while(--_0x39ec8a){_0x311a90['push'](_0x311a90['shift']());}};_0x1853b7(++_0x3a7313);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x433fa6,_0x7f56f0){var _0x594b56=function(_0x4853b9){while(--_0x4853b9){_0x433fa6['push'](_0x433fa6['shift']());}};_0x594b56(++_0x7f56f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 b16b8ec..660ea24 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 _0x565e=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request','addTags'];(function(_0x345d07,_0x22e202){var _0x39cdb1=function(_0x539cfe){while(--_0x539cfe){_0x345d07['push'](_0x345d07['shift']());}};_0x39cdb1(++_0x22e202);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe565('0x0'));exports['update']=function(_0x19090f,_0x1a2449){return client[_0xe565('0x1')]('UpdateWhatsappInteraction',{'body':_0x1a2449,'options':{'where':{'id':_0x19090f}},'log':'updateWhatsappInteraction'});};exports[_0xe565('0x2')]=function(_0x33fd83,_0x14f472){return client[_0xe565('0x1')](_0xe565('0x3'),{'body':_0x14f472,'options':{'where':{'id':_0x33fd83}},'log':_0xe565('0x4')});}; \ No newline at end of file +var _0x90b1=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','../client','update'];(function(_0xf68320,_0x51a807){var _0x4f224d=function(_0x1c151b){while(--_0x1c151b){_0xf68320['push'](_0xf68320['shift']());}};_0x4f224d(++_0x51a807);}(_0x90b1,0x1bb));var _0x190b=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x90b1[_0x2714ec];return _0x2608e5;};'use strict';var client=require(_0x190b('0x0'));exports[_0x190b('0x1')]=function(_0x158591,_0x55cd11){return client['Request'](_0x190b('0x2'),{'body':_0x55cd11,'options':{'where':{'id':_0x158591}},'log':_0x190b('0x3')});};exports[_0x190b('0x4')]=function(_0x120ddc,_0x4fbcad){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x4fbcad,'options':{'where':{'id':_0x120ddc}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 9b3f998..bd3e496 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 _0x6e5c=['createWhatsappMessage','../client','CreateWhatsappMessage'];(function(_0x1c1555,_0x127b18){var _0x4c8d9d=function(_0x3c96a8){while(--_0x3c96a8){_0x1c1555['push'](_0x1c1555['shift']());}};_0x4c8d9d(++_0x127b18);}(_0x6e5c,0x64));var _0xc6e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e5c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc6e5('0x0'));exports['create']=function(_0x2a3543){return client['Request'](_0xc6e5('0x1'),{'body':_0x2a3543,'log':_0xc6e5('0x2')});}; \ No newline at end of file +var _0x7774=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x5b7a4a,_0x54c362){var _0x5feaf9=function(_0x221637){while(--_0x221637){_0x5b7a4a['push'](_0x5b7a4a['shift']());}};_0x5feaf9(++_0x54c362);}(_0x7774,0x1c7));var _0x4777=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x7774[_0x2f4c1c];return _0x25e0f2;};'use strict';var client=require(_0x4777('0x0'));exports[_0x4777('0x1')]=function(_0x4cbe78){return client[_0x4777('0x2')](_0x4777('0x3'),{'body':_0x4cbe78,'log':_0x4777('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b9f22e5..c00ef99 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 _0x2eeb=['timeout','strategy','online','whatsappPause','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x280c4b,_0xfe785d){var _0x2a5e90=function(_0x37db79){while(--_0x37db79){_0x280c4b['push'](_0x280c4b['shift']());}};_0x2a5e90(++_0xfe785d);}(_0x2eeb,0x1a1));var _0xb2ee=function(_0xe742b8,_0xd36da7){_0xe742b8=_0xe742b8-0x0;var _0x211c7a=_0x2eeb[_0xe742b8];return _0x211c7a;};'use strict';var client=require('../client');exports[_0xb2ee('0x0')]=function(){return function(){return client['Request'](_0xb2ee('0x1'),{'options':{'raw':![],'attributes':['id',_0xb2ee('0x2'),_0xb2ee('0x3'),_0xb2ee('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xb2ee('0x2'),_0xb2ee('0x5'),_0xb2ee('0x6')]}]},'log':_0xb2ee('0x0')});};}; \ No newline at end of file +var _0xe8e6=['online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','strategy','Agents'];(function(_0xb01ede,_0x5df89b){var _0x38b401=function(_0x3228f8){while(--_0x3228f8){_0xb01ede['push'](_0xb01ede['shift']());}};_0x38b401(++_0x5df89b);}(_0xe8e6,0x12a));var _0x6e8e=function(_0x486f0b,_0x19a9b7){_0x486f0b=_0x486f0b-0x0;var _0x12ccaf=_0xe8e6[_0x486f0b];return _0x12ccaf;};'use strict';var client=require(_0x6e8e('0x0'));exports[_0x6e8e('0x1')]=function(){return function(){return client['Request'](_0x6e8e('0x2'),{'options':{'raw':![],'attributes':['id',_0x6e8e('0x3'),'timeout',_0x6e8e('0x4')],'include':[{'model':'User','as':_0x6e8e('0x5'),'attributes':['id',_0x6e8e('0x3'),_0x6e8e('0x6'),_0x6e8e('0x7')]}]},'log':_0x6e8e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7c6e191..289db44 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 _0x9581=['Request','CreateWhatsappQueueReport','update','../client'];(function(_0x54893d,_0x72f441){var _0x3324fb=function(_0x2d744a){while(--_0x2d744a){_0x54893d['push'](_0x54893d['shift']());}};_0x3324fb(++_0x72f441);}(_0x9581,0x19f));var _0x1958=function(_0x3fc1dc,_0x19e1c5){_0x3fc1dc=_0x3fc1dc-0x0;var _0x146a45=_0x9581[_0x3fc1dc];return _0x146a45;};'use strict';var client=require(_0x1958('0x0'));exports['create']=function(_0x2db49b){return client[_0x1958('0x1')](_0x1958('0x2'),{'body':_0x2db49b,'log':_0x1958('0x2')});};exports[_0x1958('0x3')]=function(_0x1c5566,_0x19b53f){return client[_0x1958('0x1')]('UpdateWhatsappQueueReport',{'body':_0x19b53f,'options':{'where':{'uniqueid':_0x1c5566},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x0f1d=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0f1d,0x12b));var _0xd0f1=function(_0x285cf1,_0x47e330){_0x285cf1=_0x285cf1-0x0;var _0x2fea93=_0x0f1d[_0x285cf1];return _0x2fea93;};'use strict';var client=require('../client');exports[_0xd0f1('0x0')]=function(_0x58bb49){return client[_0xd0f1('0x1')](_0xd0f1('0x2'),{'body':_0x58bb49,'log':_0xd0f1('0x2')});};exports[_0xd0f1('0x3')]=function(_0x301f0f,_0x1d36f7){return client[_0xd0f1('0x1')](_0xd0f1('0x4'),{'body':_0x1d36f7,'options':{'where':{'uniqueid':_0x301f0f},'order':[['id',_0xd0f1('0x5')]],'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 ecb0ddf..62b5402 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 _0x874b=['channel','START:%s','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','createQueue'];(function(_0x498c78,_0x2eab48){var _0xb7697f=function(_0x1f6da7){while(--_0x1f6da7){_0x498c78['push'](_0x498c78['shift']());}};_0xb7697f(++_0x2eab48);}(_0x874b,0x196));var _0xb874=function(_0x45cccb,_0x180f00){_0x45cccb=_0x45cccb-0x0;var _0x18bc60=_0x874b[_0x45cccb];return _0x18bc60;};'use strict';var schema=require('validate');var _=require(_0xb874('0x0'));var util=require(_0xb874('0x1'));var seqqueue=require(_0xb874('0x2'));var logger=require(_0xb874('0x3'))(_0xb874('0x4'));var strategy=require(_0xb874('0x5'));var queue=schema({'name':{'type':_0xb874('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xb874('0x7')}});function writeLog(_0x539a17,_0x1d980f,_0x4e7c0c){return logger[_0xb874('0x8')](util[_0xb874('0x9')](_0xb874('0xa'),_0x539a17,_0x1d980f[_0xb874('0xb')],_0x4e7c0c));}function handleFindAgent(_0x183426){return function(_0x1efac8){return _0x1efac8['name'][_0xb874('0xc')]()===_0x183426['toLowerCase']();};}exports['consequence']=function(_0x43483e,_0x19d443,_0x1c7a6e,_0x5cc130){return function(_0x57bf8b){try{var _0x1de0a7={'name':_0x19d443[0x0],'timeout':_0x19d443[0x1]};var _0x15a43d=queue[_0xb874('0xd')](_0x1de0a7,{'typecast':!![]});if(_0x15a43d[_0xb874('0xe')]){logger[_0xb874('0xf')](_0xb874('0x10'),_0x43483e,_[_0xb874('0x11')](_0x15a43d,_0xb874('0x12'))[_0xb874('0x13')](',\x20'));_0x57bf8b[_0xb874('0x14')]();}else{var _0x5719d9=_[_0xb874('0x15')](_0x1c7a6e['agents'],handleFindAgent(_0x1de0a7['name']));if(_0x5719d9){var _0x17d1c7=(_0x1de0a7['timeout']||0xa)*0x3e8;var _0x4bc8b0,_0x43f879;var _0x22fcae=seqqueue[_0xb874('0x16')](_0x17d1c7);_0x22fcae['id']=_0x43483e;_0x22fcae['atimeout']=_0x17d1c7;_0x22fcae['channel']=_0x5cc130[_0xb874('0x17')];writeLog(_0x43483e,_0x5719d9,util[_0xb874('0x9')](_0xb874('0x18'),_0x17d1c7));_0x1c7a6e[_0xb874('0x19')][_0x43483e]['on']('end',function(){logger[_0xb874('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x43483e);clearTimeout(_0x43f879);_0x43f879=undefined;_0x22fcae['close']();if(_0x1c7a6e[_0xb874('0x19')][_0x43483e]){delete _0x1c7a6e[_0xb874('0x19')][_0x43483e];}_0x57bf8b[_0xb874('0x14')]();});_0x1c7a6e[_0xb874('0x19')][_0x43483e]['on'](_0xb874('0x1a'),function(){if(_0x1c7a6e['rules'][_0x43483e]){delete _0x1c7a6e['rules'][_0x43483e];}});_0x43f879=setTimeout(function(){logger[_0xb874('0x8')](_0xb874('0x1b'),_0x43483e);clearTimeout(_0x43f879);_0x22fcae['close']();_0x57bf8b[_0xb874('0x1c')]();},_0x17d1c7);strategy[_0xb874('0x1d')](_0x22fcae,_0x5719d9,_0x1c7a6e,_0x5cc130);}else{logger[_0xb874('0xf')](_0xb874('0x1e'),_0x43483e,_0x1de0a7[_0xb874('0xb')]);_0x57bf8b[_0xb874('0x14')]();}}}catch(_0x3658cc){console[_0xb874('0x1f')](_0x3658cc);logger[_0xb874('0xf')]('[%s][QUEUE]\x20%s',_0x43483e,_0x3658cc[_0xb874('0x20')]);_0x57bf8b[_0xb874('0x14')]();}};}; \ No newline at end of file +var _0xfc40=['info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc40,0x1d4));var _0x0fc4=function(_0x2f3de3,_0x3e0635){_0x2f3de3=_0x2f3de3-0x0;var _0x22e00b=_0xfc40[_0x2f3de3];return _0x22e00b;};'use strict';var schema=require(_0x0fc4('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x0fc4('0x1'));var logger=require(_0x0fc4('0x2'))(_0x0fc4('0x3'));var strategy=require(_0x0fc4('0x4'));var queue=schema({'name':{'type':_0x0fc4('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0fc4('0x6'),'message':_0x0fc4('0x7')}});function writeLog(_0x2db59f,_0x30029e,_0x242a43){return logger[_0x0fc4('0x8')](util[_0x0fc4('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2db59f,_0x30029e['name'],_0x242a43));}function handleFindAgent(_0x3c5533){return function(_0x122f3d){return _0x122f3d[_0x0fc4('0xa')][_0x0fc4('0xb')]()===_0x3c5533[_0x0fc4('0xb')]();};}exports[_0x0fc4('0xc')]=function(_0x447ad6,_0x1f5175,_0x2f0b76,_0x39bafb){return function(_0x44bfa8){try{var _0x58751d={'name':_0x1f5175[0x0],'timeout':_0x1f5175[0x1]};var _0x25770f=queue[_0x0fc4('0x0')](_0x58751d,{'typecast':!![]});if(_0x25770f[_0x0fc4('0xd')]){logger[_0x0fc4('0xe')](_0x0fc4('0xf'),_0x447ad6,_[_0x0fc4('0x10')](_0x25770f,'message')[_0x0fc4('0x11')](',\x20'));_0x44bfa8[_0x0fc4('0x12')]();}else{var _0x2582ca=_['find'](_0x2f0b76['agents'],handleFindAgent(_0x58751d[_0x0fc4('0xa')]));if(_0x2582ca){var _0x502ec0=(_0x58751d['timeout']||0xa)*0x3e8;var _0x226197,_0x2ee33c;var _0x359bcd=seqqueue[_0x0fc4('0x13')](_0x502ec0);_0x359bcd['id']=_0x447ad6;_0x359bcd[_0x0fc4('0x14')]=_0x502ec0;_0x359bcd[_0x0fc4('0x15')]=_0x39bafb['channel'];writeLog(_0x447ad6,_0x2582ca,util[_0x0fc4('0x9')]('START:%s',_0x502ec0));_0x2f0b76['rules'][_0x447ad6]['on'](_0x0fc4('0x16'),function(){logger[_0x0fc4('0x8')](_0x0fc4('0x17'),_0x447ad6);clearTimeout(_0x2ee33c);_0x2ee33c=undefined;_0x359bcd[_0x0fc4('0x18')]();if(_0x2f0b76[_0x0fc4('0x19')][_0x447ad6]){delete _0x2f0b76[_0x0fc4('0x19')][_0x447ad6];}_0x44bfa8[_0x0fc4('0x12')]();});_0x2f0b76['rules'][_0x447ad6]['on'](_0x0fc4('0x1a'),function(){if(_0x2f0b76[_0x0fc4('0x19')][_0x447ad6]){delete _0x2f0b76[_0x0fc4('0x19')][_0x447ad6];}});_0x2ee33c=setTimeout(function(){logger[_0x0fc4('0x8')](_0x0fc4('0x1b'),_0x447ad6);clearTimeout(_0x2ee33c);_0x359bcd[_0x0fc4('0x18')]();_0x44bfa8[_0x0fc4('0x1c')]();},_0x502ec0);strategy[_0x0fc4('0x1d')](_0x359bcd,_0x2582ca,_0x2f0b76,_0x39bafb);}else{logger[_0x0fc4('0xe')](_0x0fc4('0x1e'),_0x447ad6,_0x58751d[_0x0fc4('0xa')]);_0x44bfa8[_0x0fc4('0x12')]();}}}catch(_0x286d2d){console[_0x0fc4('0x1f')](_0x286d2d);logger['error'](_0x0fc4('0x20'),_0x447ad6,_0x286d2d[_0x0fc4('0x21')]);_0x44bfa8[_0x0fc4('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index e5cac89..404b659 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 _0x2261=['account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','create','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','next','providerName','amazonlex','providerResponse','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','phone','chat','ChatWebsiteId'];(function(_0x16736c,_0x844e4){var _0x7170f3=function(_0x418bdb){while(--_0x418bdb){_0x16736c['push'](_0x16736c['shift']());}};_0x7170f3(++_0x844e4);}(_0x2261,0x124));var _0x1226=function(_0x50fb66,_0x5191a0){_0x50fb66=_0x50fb66-0x0;var _0x561ed4=_0x2261[_0x50fb66];return _0x561ed4;};'use strict';var _=require(_0x1226('0x0'));var moment=require(_0x1226('0x1'));var AWS=require(_0x1226('0x2'));var utils=require(_0x1226('0x3'));var logger=require(_0x1226('0x4'))(_0x1226('0x5'));var rpc={'chatMessage':require(_0x1226('0x6')),'openchannelMessage':require(_0x1226('0x7')),'mailMessage':require(_0x1226('0x8')),'smsMessage':require(_0x1226('0x9')),'faxMessage':require(_0x1226('0xa')),'whatsappMessage':require(_0x1226('0xb'))};exports[_0x1226('0xc')]=function(_0x1e4646,_0x2de5f2){return function(_0x5e9c92){try{if(!_[_0x1226('0xd')](this[_0x1226('0xe')][_0x1226('0xf')])){logger[_0x1226('0x10')](_0x1226('0x11'),_0x1e4646,_0x1226('0x12'));return _0x5e9c92['next']();}var _0x1107d5={'ContactId':this[_0x1226('0x13')]['id'],'sentAt':moment()[_0x1226('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1226('0x15')};if(this[_0x1226('0x16')]==='sms'||this[_0x1226('0x16')]==='whatsapp'){_0x1107d5['phone']=this[_0x1226('0xe')][_0x1226('0x17')];}var _0x264fa0=this[_0x1226('0x16')];if(_0x264fa0===_0x1226('0x18')){_0x1107d5[_0x1226('0x19')]=this[_0x1226('0x1a')]['id'];}else{_0x1107d5[_[_0x1226('0x1b')](_0x264fa0)+_0x1226('0x1c')]=this[_0x1226('0x1a')]['id'];}_0x1107d5[_['upperFirst'](_0x264fa0)+_0x1226('0x1d')]=this[_0x1226('0xe')]['id'];if(this[_0x1226('0xe')][_0x1226('0x1e')]){var _0x5d14b3=_0x2de5f2[0x4];if(!_['isEmpty'](_0x5d14b3)){_0x1107d5['body']=utils[_0x1226('0x1f')](_0x5d14b3,this);return rpc[_0x264fa0+_0x1226('0x20')][_0x1226('0x21')](_0x1107d5)[_0x1226('0x22')](function(_0xbf75d4){logger['info'](_0x1226('0x11'),_0x1e4646,_0x1107d5[_0x1226('0x23')]);})['catch'](function(_0x42624c){logger[_0x1226('0x24')](_0x1226('0x11'),_0x1e4646,JSON[_0x1226('0x25')](_0x42624c));})[_0x1226('0x26')](function(){logger[_0x1226('0x10')](_0x1226('0x27'),_0x1e4646);_0x5e9c92['stop']();});}else{logger[_0x1226('0x10')](_0x1226('0x28'),_0x1e4646);_0x5e9c92[_0x1226('0x29')]();}}else{var _0x59f344=this;var _0x8ea8a6=new AWS[(_0x1226('0x2a'))]({'accessKeyId':_0x2de5f2[0x0],'secretAccessKey':_0x2de5f2[0x1],'region':_0x2de5f2[0x2]});var _0x3573b7={'botAlias':_0x1226('0x2b'),'botName':_0x2de5f2[0x3],'inputText':this[_0x1226('0x2c')][_0x1226('0x23')],'userId':this[_0x1226('0x16')]+':'+this['interaction']['id'][_0x1226('0x2d')]()};_0x8ea8a6['postText'](_0x3573b7,function(_0x2ee591,_0x3b7882){if(_0x2ee591){logger['error'](_0x1226('0x11'),_0x1e4646,_0x2ee591[_0x1226('0x2c')]);_0x5e9c92[_0x1226('0x2e')]();}else if(_0x3b7882&&_0x3b7882[_0x1226('0x2c')]){_0x59f344[_0x1226('0x23')]['amazonlex']=_0x3b7882;_0x1107d5[_0x1226('0x23')]=_0x3b7882['message'];_0x1107d5[_0x1226('0x2f')]=_0x1226('0x30');_0x1107d5[_0x1226('0x31')]=JSON['stringify'](_0x3b7882);return rpc[_0x264fa0+_0x1226('0x20')][_0x1226('0x21')](_0x1107d5)[_0x1226('0x22')](function(_0x3f239e){logger[_0x1226('0x10')]('[%s][AMAZONLEX]\x20%s',_0x1e4646,_0x1107d5[_0x1226('0x23')]);if(_0x3b7882[_0x1226('0x32')]==_0x1226('0x33')){_0x5e9c92[_0x1226('0x2e')]();}else{_0x5e9c92[_0x1226('0x29')]();}})[_0x1226('0x34')](function(_0x58a58d){logger['error'](_0x1226('0x11'),_0x1e4646,JSON['stringify'](_0x58a58d));_0x5e9c92[_0x1226('0x2e')]();});}else{_0x5e9c92[_0x1226('0x2e')]();}});}}catch(_0x26d48a){logger['error'](_0x1226('0x11'),_0x1e4646,JSON['stringify'](_0x26d48a));_0x5e9c92[_0x1226('0x29')]();}};}; \ No newline at end of file +var _0xea32=['catch','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','stringify','create','dialogState','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then'];(function(_0xbc8c65,_0x5672fc){var _0x77eb71=function(_0x59eaf1){while(--_0x59eaf1){_0xbc8c65['push'](_0xbc8c65['shift']());}};_0x77eb71(++_0x5672fc);}(_0xea32,0x1a5));var _0x2ea3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea32[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x2ea3('0x0'))('routing');var rpc={'chatMessage':require(_0x2ea3('0x1')),'openchannelMessage':require(_0x2ea3('0x2')),'mailMessage':require(_0x2ea3('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2ea3('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2ea3('0x5')]=function(_0x3ea6da,_0x5d0f4c){return function(_0x3785f3){try{if(!_[_0x2ea3('0x6')](this[_0x2ea3('0x7')]['UserId'])){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x2ea3('0xa'));return _0x3785f3[_0x2ea3('0xb')]();}var _0x201c61={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2ea3('0xc')](_0x2ea3('0xd')),'direction':'out'};if(this[_0x2ea3('0xe')]===_0x2ea3('0xf')||this['channel']===_0x2ea3('0x10')){_0x201c61['phone']=this['interaction'][_0x2ea3('0x11')];}var _0xd5d969=this[_0x2ea3('0xe')];if(_0xd5d969===_0x2ea3('0x12')){_0x201c61[_0x2ea3('0x13')]=this[_0x2ea3('0x14')]['id'];}else{_0x201c61[_['upperFirst'](_0xd5d969)+_0x2ea3('0x15')]=this[_0x2ea3('0x14')]['id'];}_0x201c61[_['upperFirst'](_0xd5d969)+_0x2ea3('0x16')]=this[_0x2ea3('0x7')]['id'];if(this[_0x2ea3('0x7')][_0x2ea3('0x17')]){var _0x1e0b45=_0x5d0f4c[0x4];if(!_[_0x2ea3('0x18')](_0x1e0b45)){_0x201c61[_0x2ea3('0x19')]=utils[_0x2ea3('0x1a')](_0x1e0b45,this);return rpc[_0xd5d969+_0x2ea3('0x1b')]['create'](_0x201c61)[_0x2ea3('0x1c')](function(_0x1c083f){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x201c61['body']);})[_0x2ea3('0x1d')](function(_0x563721){logger[_0x2ea3('0x1e')](_0x2ea3('0x9'),_0x3ea6da,JSON['stringify'](_0x563721));})['finally'](function(){logger[_0x2ea3('0x8')](_0x2ea3('0x1f'),_0x3ea6da);_0x3785f3[_0x2ea3('0x20')]();});}else{logger[_0x2ea3('0x8')](_0x2ea3('0x21'),_0x3ea6da);_0x3785f3[_0x2ea3('0x20')]();}}else{var _0x2cd5b3=this;var _0x24dde6=new AWS[(_0x2ea3('0x22'))]({'accessKeyId':_0x5d0f4c[0x0],'secretAccessKey':_0x5d0f4c[0x1],'region':_0x5d0f4c[0x2]});var _0x5975d9={'botAlias':_0x2ea3('0x23'),'botName':_0x5d0f4c[0x3],'inputText':this[_0x2ea3('0x24')]['body'],'userId':this[_0x2ea3('0xe')]+':'+this[_0x2ea3('0x7')]['id'][_0x2ea3('0x25')]()};_0x24dde6[_0x2ea3('0x26')](_0x5975d9,function(_0x1472ed,_0x773857){if(_0x1472ed){logger['error'](_0x2ea3('0x9'),_0x3ea6da,_0x1472ed[_0x2ea3('0x24')]);_0x3785f3[_0x2ea3('0xb')]();}else if(_0x773857&&_0x773857[_0x2ea3('0x24')]){_0x2cd5b3[_0x2ea3('0x19')][_0x2ea3('0x27')]=_0x773857;_0x201c61[_0x2ea3('0x19')]=_0x773857[_0x2ea3('0x24')];_0x201c61[_0x2ea3('0x28')]='amazonlex';_0x201c61[_0x2ea3('0x29')]=JSON[_0x2ea3('0x2a')](_0x773857);return rpc[_0xd5d969+_0x2ea3('0x1b')][_0x2ea3('0x2b')](_0x201c61)[_0x2ea3('0x1c')](function(_0x215a59){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x201c61['body']);if(_0x773857[_0x2ea3('0x2c')]=='Failed'){_0x3785f3[_0x2ea3('0xb')]();}else{_0x3785f3[_0x2ea3('0x20')]();}})[_0x2ea3('0x1d')](function(_0x4d9964){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3ea6da,JSON['stringify'](_0x4d9964));_0x3785f3['next']();});}else{_0x3785f3[_0x2ea3('0xb')]();}});}}catch(_0x358aca){logger[_0x2ea3('0x1e')](_0x2ea3('0x9'),_0x3ea6da,JSON[_0x2ea3('0x2a')](_0x358aca));_0x3785f3[_0x2ea3('0x20')]();}};}; \ 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 02feb8e..4a30563 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 _0xc097=['../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','html','','replace','';_0x3b0a12['headers']={'Auto-Submitted':_0x7c09('0x39'),'X-Auto-Response-Suppress':_0x7c09('0x3a'),'Precedence':'auto_reply'};return mailRpc[_0x7c09('0x3b')](_0x577718,_0x3b0a12)['then'](function(_0x49ff97){logger[_0x7c09('0x12')](_0x7c09('0x3c'),_0x51a34e);_0x3b0a12[_0x7c09('0x3d')]=_0x49ff97[_0x7c09('0x1e')]['messageId'];return rpc[_0x40f8c4+'Message'][_0x7c09('0x3e')](_0x3b0a12);})[_0x7c09('0x3f')](function(_0x4b177c){logger[_0x7c09('0x12')]('[%s][AUTOREPLY]\x20%s',_0x51a34e,JSON['stringify'](_0x4b177c));})[_0x7c09('0x40')](function(_0x1c00f9){logger['error'](_0x7c09('0x41'),_0x51a34e,JSON['stringify'](_0x1c00f9));})[_0x7c09('0x42')](function(){Promise[_0x7c09('0x43')]()[_0x7c09('0x3f')](function(){if(_0x3479af[0x0]!=='2'||_0xb8ec9[_0x7c09('0x44')])return;return rpc[_0x40f8c4+_0x7c09('0x45')]['update'](_0xb8ec9['id'],{'autoreplyExecuted':!![]})[_0x7c09('0x3f')](function(_0x396fbd){logger['info'](_0x7c09('0x46'),_0x51a34e,JSON['stringify'](_0x396fbd));})[_0x7c09('0x40')](function(_0x373746){logger[_0x7c09('0x47')](_0x7c09('0x48'),_0x51a34e,JSON[_0x7c09('0x49')](_0x373746));});})['then'](function(){_0x333fc1[_0x7c09('0x18')]();});});}else{return rpc[this[_0x7c09('0xf')]+'Message'][_0x7c09('0x3e')](_0x3b0a12)[_0x7c09('0x3f')](function(_0x4cae16){logger[_0x7c09('0x12')](_0x7c09('0x16'),_0x51a34e,_0x3b0a12[_0x7c09('0x11')]);})[_0x7c09('0x40')](function(_0x209b97){logger[_0x7c09('0x47')](_0x7c09('0x16'),_0x51a34e,JSON[_0x7c09('0x49')](_0x209b97));})[_0x7c09('0x42')](function(){Promise['resolve']()['then'](function(){if(_0x3479af[0x0]!=='2'||_0xb8ec9[_0x7c09('0x44')])return;return rpc[_0x40f8c4+_0x7c09('0x45')][_0x7c09('0x4a')](_0xb8ec9['id'],{'autoreplyExecuted':!![]})['then'](function(_0xf9ca53){logger['info'](_0x7c09('0x46'),_0x51a34e,JSON[_0x7c09('0x49')](_0xf9ca53));})[_0x7c09('0x40')](function(_0x44943e){logger[_0x7c09('0x47')](_0x7c09('0x48'),_0x51a34e,JSON[_0x7c09('0x49')](_0x44943e));});})[_0x7c09('0x3f')](function(){_0x333fc1['next']();});});}}}catch(_0x4a5d36){logger['error'](_0x7c09('0x16'),_0x51a34e,JSON[_0x7c09('0x49')](_0x4a5d36));_0x333fc1[_0x7c09('0x4b')]();}};}; \ No newline at end of file +var _0xfa0d=['format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','body','message','from','phone','subject','startsWith','Re:\x20','ChatWebsiteId','upperFirst','AccountId','InteractionId','account','Smtp','service','host','secure','auth','user','pass','inReplyTo','messageId','html','','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','finally','resolve','autoreplyExecuted','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','mail','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0x28231d,_0x33a44f){var _0x5043ce=function(_0xb68e88){while(--_0xb68e88){_0x28231d['push'](_0x28231d['shift']());}};_0x5043ce(++_0x33a44f);}(_0xfa0d,0x158));var _0xdfa0=function(_0x3bc957,_0x4655d1){_0x3bc957=_0x3bc957-0x0;var _0x19d172=_0xfa0d[_0x3bc957];return _0x19d172;};'use strict';var _=require(_0xdfa0('0x0'));var moment=require(_0xdfa0('0x1'));var utils=require(_0xdfa0('0x2'));var logger=require('../../../../config/logger')(_0xdfa0('0x3'));var rpc={'chatMessage':require(_0xdfa0('0x4')),'openchannelMessage':require(_0xdfa0('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xdfa0('0x6')),'faxMessage':require(_0xdfa0('0x7')),'whatsappMessage':require(_0xdfa0('0x8')),'chatInteraction':require(_0xdfa0('0x9')),'openchannelInteraction':require(_0xdfa0('0xa')),'mailInteraction':require(_0xdfa0('0xb')),'smsInteraction':require(_0xdfa0('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xdfa0('0xd'));exports[_0xdfa0('0xe')]=function(_0x5e2de4,_0x503160,_0x4dddf9,_0x24627d){return function(_0x256fdc){try{var _0x11b6bf=this['channel'];if(_0x11b6bf===_0xdfa0('0xf')&&_0x24627d['body']['isAutoreply']){logger['info'](_0xdfa0('0x10'),_0x5e2de4,_0xdfa0('0x11'));return _0x256fdc[_0xdfa0('0x12')]();}if(_0x503160[0x0]==='1'&&(_[_0xdfa0('0x13')](this[_0xdfa0('0x14')]['created'])||!this[_0xdfa0('0x14')][_0xdfa0('0x15')])){logger[_0xdfa0('0x16')](_0xdfa0('0x10'),_0x5e2de4,'Autoreply\x20already\x20sent');return _0x256fdc[_0xdfa0('0x12')]();}if(_0x503160[0x0]==='2'&&this[_0xdfa0('0x14')]['autoreplyExecuted']){logger['info'](_0xdfa0('0x17'),_0x5e2de4,_0xdfa0('0x18'));return _0x256fdc[_0xdfa0('0x12')]();}var _0x4ed188={'ContactId':this[_0xdfa0('0x19')]['id'],'sentAt':moment()[_0xdfa0('0x1a')](_0xdfa0('0x1b')),'direction':'out'};if(this[_0xdfa0('0x1c')]===_0xdfa0('0xf')){_0x4ed188['body']=utils[_0xdfa0('0x1d')](_0x503160[0x2],this);}else{_0x4ed188[_0xdfa0('0x1e')]=utils[_0xdfa0('0x1d')](_0x503160[0x1],this);}if(this[_0xdfa0('0x1f')]){_0x4ed188['to']=this[_0xdfa0('0x1f')][_0xdfa0('0x20')]||'';if(this[_0xdfa0('0x1c')]==='mail'&&_0x503160[0x1]==='1'){_0x4ed188['cc']=this[_0xdfa0('0x1f')]['cc']||'';}_0x4ed188[_0xdfa0('0x20')]=this[_0xdfa0('0x1f')]['to']||'';_0x4ed188[_0xdfa0('0x21')]=this[_0xdfa0('0x1f')][_0xdfa0('0x21')]||'';_0x4ed188['read']=!![];if(this[_0xdfa0('0x1f')]['subject']){_0x4ed188[_0xdfa0('0x22')]='';_0x4ed188['subject']+=_[_0xdfa0('0x23')](this[_0xdfa0('0x1f')][_0xdfa0('0x22')],'Re:')?'':_0xdfa0('0x24');_0x4ed188[_0xdfa0('0x22')]+=this[_0xdfa0('0x1f')][_0xdfa0('0x22')];}}if(this[_0xdfa0('0x1c')]==='chat'){_0x4ed188[_0xdfa0('0x25')]=this['account']['id'];}else{_0x4ed188[_[_0xdfa0('0x26')](this[_0xdfa0('0x1c')])+_0xdfa0('0x27')]=this['account']['id'];}_0x4ed188[_['upperFirst'](this[_0xdfa0('0x1c')])+_0xdfa0('0x28')]=this['interaction']['id'];var _0x41855f=this['interaction'];if(rpc[this[_0xdfa0('0x1c')]+'Message']){if(this[_0xdfa0('0x1c')]===_0xdfa0('0xf')){var _0x5e5154={'tls':{'rejectUnauthorized':![]}};if(this[_0xdfa0('0x29')][_0xdfa0('0x2a')]['service']){_0x5e5154[_0xdfa0('0x2b')]=this[_0xdfa0('0x29')]['Smtp']['service'];}else{_0x5e5154[_0xdfa0('0x2c')]=this[_0xdfa0('0x29')]['Smtp'][_0xdfa0('0x2c')];_0x5e5154['port']=this[_0xdfa0('0x29')][_0xdfa0('0x2a')]['port'];_0x5e5154[_0xdfa0('0x2d')]=this['account'][_0xdfa0('0x2a')]['secure'];}if(this[_0xdfa0('0x29')]['Smtp']['authentication']){_0x5e5154[_0xdfa0('0x2e')]={'user':this[_0xdfa0('0x29')][_0xdfa0('0x2a')][_0xdfa0('0x2f')],'pass':this[_0xdfa0('0x29')][_0xdfa0('0x2a')][_0xdfa0('0x30')]};}_0x4ed188[_0xdfa0('0x31')]=this[_0xdfa0('0x1f')][_0xdfa0('0x32')];_0x4ed188[_0xdfa0('0x33')]=_0xdfa0('0x34')+_['replace'](_0x4ed188['body'],_0xdfa0('0x35'),']+(>|$)/g,''),'priorityTrue':_0x4293bf[0x1],'priorityFalse':_0x4293bf[0x2]};var _0xa3147c=gotoif[_0xaa87('0x0')](_0x3bf8ba,{'typecast':!![]});if(_0xa3147c['length']){logger[_0xaa87('0xc')](_0xaa87('0xd'),_0x2b2fc8,_[_0xaa87('0xe')](_0xa3147c,_0xaa87('0xf'))[_0xaa87('0x10')](',\x20'));_0x134d97[_0xaa87('0x11')]();}else{try{var _0x1e95e8=eval('('+_0x3bf8ba[_0xaa87('0x12')]+')');var _0x4d4c35=_0x1e95e8?_0x3bf8ba[_0xaa87('0x13')]:_0x3bf8ba[_0xaa87('0x14')];logger[_0xaa87('0x15')](_0xaa87('0x16'),_0x2b2fc8,_0x3bf8ba['condition'],_0x1e95e8,_0x4d4c35||_0xaa87('0x17'));if(_0x4d4c35){var _0x5db25a=_['findIndex'](_0x134d97[_0xaa87('0x18')](),{'p':_0x4d4c35});if(_0x5db25a>=0x0){logger[_0xaa87('0x15')](_0xaa87('0x19'),_0x2b2fc8,_0x4d4c35||_0xaa87('0x17'),_0x5db25a);_0x134d97['next'](_0x5db25a);}else{logger['info'](_0xaa87('0x1a'),_0x2b2fc8,_0x4d4c35||_0xaa87('0x17'));_0x134d97['stop']();}}else{_0x134d97[_0xaa87('0x17')]();}}catch(_0x49e966){logger[_0xaa87('0xc')](_0xaa87('0x1b'),_0x2b2fc8,_0x49e966['message']);_0x134d97[_0xaa87('0x11')]();}}}catch(_0x441e4d){logger[_0xaa87('0xc')]('[%s][GOTOIF]\x20%s',_0x2b2fc8,JSON[_0xaa87('0x1c')](_0x441e4d));_0x134d97[_0xaa87('0x11')]();}};}; \ No newline at end of file +var _0x3d22=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','stop','priorityTrue','priorityFalse','info','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d22,0xaa));var _0x23d2=function(_0x26f076,_0x59d978){_0x26f076=_0x26f076-0x0;var _0x14c282=_0x3d22[_0x26f076];return _0x14c282;};'use strict';var schema=require(_0x23d2('0x0'));var _=require(_0x23d2('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x23d2('0x2'));var logger=require(_0x23d2('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x23d2('0x4'),'required':!![],'message':_0x23d2('0x5')},'priorityTrue':{'type':_0x23d2('0x6'),'message':_0x23d2('0x7')},'priorityFalse':{'type':_0x23d2('0x6'),'message':_0x23d2('0x8')}});exports['consequence']=function(_0x18c0fa,_0x5ac536){return function(_0x112576){try{var _0x18964f={'condition':htmlToText[_0x23d2('0x9')](utils[_0x23d2('0xa')](_0x5ac536[0x0],this),{'wordwrap':![]})[_0x23d2('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5ac536[0x1],'priorityFalse':_0x5ac536[0x2]};var _0x55c280=gotoif[_0x23d2('0x0')](_0x18964f,{'typecast':!![]});if(_0x55c280[_0x23d2('0xc')]){logger['error'](_0x23d2('0xd'),_0x18c0fa,_['map'](_0x55c280,_0x23d2('0xe'))['join'](',\x20'));_0x112576[_0x23d2('0xf')]();}else{try{var _0x40bb58=eval('('+_0x18964f['condition']+')');var _0x4653bc=_0x40bb58?_0x18964f[_0x23d2('0x10')]:_0x18964f[_0x23d2('0x11')];logger[_0x23d2('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x18c0fa,_0x18964f[_0x23d2('0x13')],_0x40bb58,_0x4653bc||_0x23d2('0x14'));if(_0x4653bc){var _0x15bb56=_[_0x23d2('0x15')](_0x112576[_0x23d2('0x16')](),{'p':_0x4653bc});if(_0x15bb56>=0x0){logger[_0x23d2('0x12')](_0x23d2('0x17'),_0x18c0fa,_0x4653bc||_0x23d2('0x14'),_0x15bb56);_0x112576[_0x23d2('0x14')](_0x15bb56);}else{logger[_0x23d2('0x12')](_0x23d2('0x18'),_0x18c0fa,_0x4653bc||_0x23d2('0x14'));_0x112576[_0x23d2('0xf')]();}}else{_0x112576[_0x23d2('0x14')]();}}catch(_0x36d457){logger[_0x23d2('0x19')](_0x23d2('0x1a'),_0x18c0fa,_0x36d457[_0x23d2('0xe')]);_0x112576[_0x23d2('0xf')]();}}}catch(_0x256124){logger[_0x23d2('0x19')](_0x23d2('0xd'),_0x18c0fa,JSON[_0x23d2('0x1b')](_0x256124));_0x112576[_0x23d2('0xf')]();}};}; \ 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 c57b51e..fc6137b 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 _0x5852=['validate','lodash','routing','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify'];(function(_0x29f84b,_0x4d41a6){var _0x248820=function(_0x466604){while(--_0x466604){_0x29f84b['push'](_0x29f84b['shift']());}};_0x248820(++_0x4d41a6);}(_0x5852,0xbb));var _0x2585=function(_0x30099e,_0x1ee4b2){_0x30099e=_0x30099e-0x0;var _0x474f63=_0x5852[_0x30099e];return _0x474f63;};'use strict';var schema=require(_0x2585('0x0'));var _=require(_0x2585('0x1'));var logger=require('../../../../config/logger')(_0x2585('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x2585('0x3')]=function(_0x5e1570,_0x3fc1f5){return function(_0x39f9f5){try{var _0x4dd865={'priority':_0x3fc1f5[0x0]};var _0xda7a81=gotop[_0x2585('0x0')](_0x4dd865,{'typecast':!![]});if(_0xda7a81[_0x2585('0x4')]){logger[_0x2585('0x5')](_0x2585('0x6'),_0x5e1570,_['map'](_0xda7a81,_0x2585('0x7'))[_0x2585('0x8')](',\x20'));_0x39f9f5[_0x2585('0x9')]();}else{logger[_0x2585('0xa')](_0x2585('0xb'),_0x5e1570,_0x4dd865['priority']);if(_0x4dd865[_0x2585('0xc')]){var _0x263734=_[_0x2585('0xd')](_0x39f9f5['rules'](),{'p':_0x4dd865[_0x2585('0xc')]});if(_0x263734>=0x0){logger[_0x2585('0xa')](_0x2585('0xe'),_0x5e1570,_0x4dd865['priority']||_0x2585('0xf'),_0x263734);_0x39f9f5[_0x2585('0xf')](_0x263734);}else{logger[_0x2585('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5e1570,_0x4dd865['priority']||_0x2585('0xf'));_0x39f9f5[_0x2585('0x9')]();}}else{_0x39f9f5[_0x2585('0xf')]();}}}catch(_0x4f03f8){logger[_0x2585('0x5')](_0x2585('0x6'),_0x5e1570,JSON[_0x2585('0x10')](_0x4f03f8));_0x39f9f5['stop']();}};}; \ No newline at end of file +var _0x9857=['stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x5e8a2f,_0x178b9){var _0x458efa=function(_0x8745b4){while(--_0x8745b4){_0x5e8a2f['push'](_0x5e8a2f['shift']());}};_0x458efa(++_0x178b9);}(_0x9857,0x1ba));var _0x7985=function(_0x35ea6f,_0x4b2346){_0x35ea6f=_0x35ea6f-0x0;var _0x465420=_0x9857[_0x35ea6f];return _0x465420;};'use strict';var schema=require('validate');var _=require(_0x7985('0x0'));var logger=require(_0x7985('0x1'))(_0x7985('0x2'));var gotop=schema({'priority':{'type':_0x7985('0x3'),'required':!![],'message':_0x7985('0x4')}});exports[_0x7985('0x5')]=function(_0x2c3ef8,_0x44ff4f){return function(_0x50950b){try{var _0x57c2f8={'priority':_0x44ff4f[0x0]};var _0xcccaa0=gotop[_0x7985('0x6')](_0x57c2f8,{'typecast':!![]});if(_0xcccaa0[_0x7985('0x7')]){logger[_0x7985('0x8')](_0x7985('0x9'),_0x2c3ef8,_[_0x7985('0xa')](_0xcccaa0,'message')[_0x7985('0xb')](',\x20'));_0x50950b[_0x7985('0xc')]();}else{logger[_0x7985('0xd')](_0x7985('0xe'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]);if(_0x57c2f8['priority']){var _0x45917a=_['findIndex'](_0x50950b[_0x7985('0x10')](),{'p':_0x57c2f8['priority']});if(_0x45917a>=0x0){logger[_0x7985('0xd')](_0x7985('0x11'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]||_0x7985('0x12'),_0x45917a);_0x50950b['next'](_0x45917a);}else{logger[_0x7985('0xd')](_0x7985('0x13'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]||_0x7985('0x12'));_0x50950b[_0x7985('0xc')]();}}else{_0x50950b['next']();}}}catch(_0x3e3afd){logger['error']('[%s][GOTOP]\x20%s',_0x2c3ef8,JSON[_0x7985('0x14')](_0x3e3afd));_0x50950b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index df9ff0b..ab03140 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 _0x6f18=['error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','body','next','catch'];(function(_0x22056f,_0x38a500){var _0x2f3945=function(_0x4e66cb){while(--_0x4e66cb){_0x22056f['push'](_0x22056f['shift']());}};_0x2f3945(++_0x38a500);}(_0x6f18,0x1b4));var _0x86f1=function(_0x318b73,_0x25f054){_0x318b73=_0x318b73-0x0;var _0x19061f=_0x6f18[_0x318b73];return _0x19061f;};'use strict';var _=require(_0x86f1('0x0'));var utils=require('./utils');var logger=require(_0x86f1('0x1'))('routing');var rpc={'chatMessage':require(_0x86f1('0x2')),'openchannelMessage':require(_0x86f1('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x86f1('0x4')),'faxMessage':require(_0x86f1('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x86f1('0x6')]=function(_0x2733f7,_0x3c91dc){return function(_0x15a5e1){try{var _0x403f48={'body':utils['getMustacheRender'](_0x3c91dc[0x0],this),'ContactId':this[_0x86f1('0x7')]['id']};if(this[_0x86f1('0x8')]===_0x86f1('0x9')){_0x403f48[_0x86f1('0xa')]=this[_0x86f1('0xb')]['id'];}else{_0x403f48[_['upperFirst'](this[_0x86f1('0x8')])+_0x86f1('0xc')]=this[_0x86f1('0xb')]['id'];}_0x403f48[_[_0x86f1('0xd')](this[_0x86f1('0x8')])+_0x86f1('0xe')]=this[_0x86f1('0xf')]['id'];if(rpc[this[_0x86f1('0x8')]+'Message']){return rpc[this[_0x86f1('0x8')]+_0x86f1('0x10')][_0x86f1('0x11')](_0x403f48)[_0x86f1('0x12')](function(_0x692342){logger[_0x86f1('0x13')]('[%s][MESSAGE]\x20%s',_0x2733f7,_0x403f48[_0x86f1('0x14')]);_0x15a5e1[_0x86f1('0x15')]();})[_0x86f1('0x16')](function(_0x648502){logger[_0x86f1('0x17')](_0x86f1('0x18'),_0x2733f7,JSON[_0x86f1('0x19')](_0x648502));_0x15a5e1[_0x86f1('0x1a')]();});}}catch(_0x512cde){logger[_0x86f1('0x17')](_0x86f1('0x18'),_0x2733f7,JSON[_0x86f1('0x19')](_0x512cde));_0x15a5e1[_0x86f1('0x1a')]();}};}; \ No newline at end of file +var _0x35fc=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','lodash','./utils','routing'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0x35fc,0x7f));var _0xc35f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x35fc[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xc35f('0x0'));var utils=require(_0xc35f('0x1'));var logger=require('../../../../config/logger')(_0xc35f('0x2'));var rpc={'chatMessage':require(_0xc35f('0x3')),'openchannelMessage':require(_0xc35f('0x4')),'mailMessage':require(_0xc35f('0x5')),'smsMessage':require(_0xc35f('0x6')),'faxMessage':require(_0xc35f('0x7')),'whatsappMessage':require(_0xc35f('0x8'))};exports[_0xc35f('0x9')]=function(_0x2624ca,_0x1456a9){return function(_0x131e0d){try{var _0x5764b6={'body':utils['getMustacheRender'](_0x1456a9[0x0],this),'ContactId':this[_0xc35f('0xa')]['id']};if(this[_0xc35f('0xb')]===_0xc35f('0xc')){_0x5764b6[_0xc35f('0xd')]=this[_0xc35f('0xe')]['id'];}else{_0x5764b6[_['upperFirst'](this['channel'])+'AccountId']=this[_0xc35f('0xe')]['id'];}_0x5764b6[_[_0xc35f('0xf')](this['channel'])+_0xc35f('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0xc35f('0x11')]){return rpc[this[_0xc35f('0xb')]+_0xc35f('0x11')][_0xc35f('0x12')](_0x5764b6)[_0xc35f('0x13')](function(_0x30bdaa){logger['info'](_0xc35f('0x14'),_0x2624ca,_0x5764b6[_0xc35f('0x15')]);_0x131e0d[_0xc35f('0x16')]();})[_0xc35f('0x17')](function(_0x4dec4c){logger['error']('[%s][MESSAGE]\x20%s',_0x2624ca,JSON[_0xc35f('0x18')](_0x4dec4c));_0x131e0d['stop']();});}}catch(_0x3e6a0f){logger['error'](_0xc35f('0x14'),_0x2624ca,JSON[_0xc35f('0x18')](_0x3e6a0f));_0x131e0d[_0xc35f('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index c19b5f4..6131b92 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 _0x1dab=['stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','error'];(function(_0x1d031e,_0x147ae9){var _0x205c30=function(_0x370d2f){while(--_0x370d2f){_0x1d031e['push'](_0x1d031e['shift']());}};_0x205c30(++_0x147ae9);}(_0x1dab,0x1eb));var _0xb1da=function(_0x17ac2f,_0x522a8d){_0x17ac2f=_0x17ac2f-0x0;var _0x3beeb8=_0x1dab[_0x17ac2f];return _0x3beeb8;};'use strict';var utils=require(_0xb1da('0x0'));var logger=require('../../../../config/logger')(_0xb1da('0x1'));exports[_0xb1da('0x2')]=function(_0x247641,_0x308019){return function(_0xac9834){try{logger[_0xb1da('0x3')](_0xb1da('0x4'),_0x247641,utils['getMustacheRender'](_0x308019[0x0],this));_0xac9834['next']();}catch(_0x5389b0){logger[_0xb1da('0x5')](_0xb1da('0x4'),_0x247641,JSON['stringify'](_0x5389b0));_0xac9834[_0xb1da('0x6')]();}};}; \ No newline at end of file +var _0x7e06=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x1a58d1,_0xa90685){var _0x101adc=function(_0x4a7543){while(--_0x4a7543){_0x1a58d1['push'](_0x1a58d1['shift']());}};_0x101adc(++_0xa90685);}(_0x7e06,0x1b0));var _0x67e0=function(_0x318a60,_0x5c9062){_0x318a60=_0x318a60-0x0;var _0x59d5de=_0x7e06[_0x318a60];return _0x59d5de;};'use strict';var utils=require('./utils');var logger=require(_0x67e0('0x0'))(_0x67e0('0x1'));exports[_0x67e0('0x2')]=function(_0x19d451,_0xae1e79){return function(_0x12fa7f){try{logger[_0x67e0('0x3')](_0x67e0('0x4'),_0x19d451,utils[_0x67e0('0x5')](_0xae1e79[0x0],this));_0x12fa7f[_0x67e0('0x6')]();}catch(_0x3aae4f){logger[_0x67e0('0x7')](_0x67e0('0x4'),_0x19d451,JSON[_0x67e0('0x8')](_0x3aae4f));_0x12fa7f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index c3886b9..f247376 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 _0x1491=['remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','info','length','[%s][QUEUE]\x20%s','map','stop','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','next','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','save'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0x1491,0x1b1));var _0x1149=function(_0x1e1e55,_0xe957f4){_0x1e1e55=_0x1e1e55-0x0;var _0x31cdf5=_0x1491[_0x1e1e55];return _0x31cdf5;};'use strict';var schema=require(_0x1149('0x0'));var _=require(_0x1149('0x1'));var util=require(_0x1149('0x2'));var seqqueue=require(_0x1149('0x3'));var moment=require('moment');var Redis=require(_0x1149('0x4'));var config=require(_0x1149('0x5'));var logger=require(_0x1149('0x6'))(_0x1149('0x7'));var strategy=require(_0x1149('0x8'));config[_0x1149('0x9')]=_[_0x1149('0xa')](config[_0x1149('0x9')],{'host':_0x1149('0xb'),'port':0x18eb});var io=require(_0x1149('0xc'))(new Redis(config[_0x1149('0x9')]));var attributes=['id',_0x1149('0xd'),_0x1149('0xe'),_0x1149('0xf'),_0x1149('0x10'),_0x1149('0x11')];function emit(_0x17a116,_0x449487,_0x82dd3f){io['to'](_0x17a116)['emit'](_0x449487,_0x82dd3f);}function emitChannelQueueInteraction(_0xea86b8,_0x54e748,_0x5150f9,_0x575008,_0x45e302,_0x494aec,_0x5e31ca,_0xd84570){var _0x55ba22=_[_0x1149('0x12')](_0x5150f9);_0x55ba22[_0x1149('0xd')]=_0xd84570;_0x55ba22[_0x1149('0xf')]=_0x54e748;_0x55ba22[_0x1149('0xe')]=_0x575008;_0x55ba22['id']=_0x45e302;if(_0x494aec){_0x5e31ca[util[_0x1149('0x13')](_0x1149('0x14'),_0xea86b8)][_0x45e302]=_['pick'](_0x55ba22,attributes);}else{delete _0x5e31ca[util[_0x1149('0x13')]('%sQueuesWaitingInteractions',_0xea86b8)][_0x45e302];}emit(util['format'](_0x1149('0x15'),_0xea86b8,_0x54e748),util[_0x1149('0x13')]('%s_queue_waiting_interaction:%s',_0xea86b8,_0x494aec?_0x1149('0x16'):_0x1149('0x17')),_[_0x1149('0x18')](_0x55ba22,attributes));}var rpc={'openchannelQueueReport':require(_0x1149('0x19')),'mailQueueReport':require(_0x1149('0x1a')),'chatQueueReport':require(_0x1149('0x1b')),'smsQueueReport':require(_0x1149('0x1c')),'faxQueueReport':require(_0x1149('0x1d')),'whatsappQueueReport':require(_0x1149('0x1e'))};var queue=schema({'name':{'type':_0x1149('0x1f'),'required':!![],'message':_0x1149('0x20')},'timeout':{'type':_0x1149('0x21'),'message':_0x1149('0x22')}});function startRouting(_0x517c77,_0x5e744b,_0x31acc1,_0x2b85f9){if(_0x517c77&&_0x5e744b&&_0x31acc1){_0x5e744b[_0x1149('0x23')]+=0x1;var _0x4781b8={'uniqueid':_0x517c77,'from':_0x31acc1[_0x1149('0x24')]?_0x31acc1['body'][_0x1149('0x10')]:'','joinAt':moment()[_0x1149('0x13')](_0x1149('0x25')),'ContactId':_0x31acc1['contact']?_0x31acc1[_0x1149('0x26')]['id']:null,'ListId':_0x31acc1[_0x1149('0x27')]?_0x31acc1[_0x1149('0x27')]['id']:null};_0x4781b8[_['upperFirst'](_0x31acc1[_0x1149('0x28')])+_0x1149('0x29')]=_0x5e744b['id']||null;_0x4781b8[_[_0x1149('0x2a')](_0x31acc1['channel'])+_0x1149('0x2b')]=_0x31acc1[_0x1149('0x2c')]?_0x31acc1[_0x1149('0x2c')]['id']:null;_0x4781b8[_[_0x1149('0x2a')](_0x31acc1[_0x1149('0x28')])+_0x1149('0x2d')]=_0x31acc1[_0x1149('0x2e')]?_0x31acc1[_0x1149('0x2e')]['id']:null;_0x4781b8[_[_0x1149('0x2a')](_0x31acc1[_0x1149('0x28')])+(_0x31acc1['channel']!==_0x1149('0x2f')?_0x1149('0x30'):'WebsiteId')]=_0x31acc1[_0x1149('0xe')]?_0x31acc1[_0x1149('0xe')]['id']:null;logger['info'](util[_0x1149('0x13')](_0x1149('0x31'),_0x517c77,_0x5e744b[_0x1149('0x32')]));emitChannelQueueInteraction(_0x31acc1['channel'],_0x5e744b[_0x1149('0x32')],_0x4781b8,_0x31acc1[_0x1149('0xe')][_0x1149('0x32')],_0x31acc1[_0x1149('0x2e')]['id'],!![],_0x2b85f9,_0x5e744b['id']);if(rpc[_0x31acc1['channel']+'QueueReport']){return rpc[_0x31acc1['channel']+_0x1149('0x33')][_0x1149('0x34')](_0x4781b8)[_0x1149('0x35')](function(_0x482c8e){logger[_0x1149('0x36')](_0x1149('0x37'));});}}}function stopRouting(_0x123c9e,_0x123317,_0x4bf62b,_0x1aa0b3){if(_0x123c9e&&_0x123317){_0x123317[_0x1149('0x23')]-=0x1;var _0x521909={'leaveAt':moment()['format'](_0x1149('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util[_0x1149('0x13')](_0x1149('0x38'),_0x123c9e,_0x123317[_0x1149('0x32')]));emitChannelQueueInteraction(_0x4bf62b['channel'],_0x123317[_0x1149('0x32')],_0x4bf62b['body'],_0x4bf62b['account'][_0x1149('0x32')],_0x4bf62b[_0x1149('0x2e')]['id'],![],_0x1aa0b3,_0x123317['id']);if(rpc[_0x4bf62b[_0x1149('0x28')]+_0x1149('0x33')]){return rpc[_0x4bf62b[_0x1149('0x28')]+'QueueReport'][_0x1149('0x39')](_0x123c9e,_0x521909)[_0x1149('0x35')](function(_0x254391){logger[_0x1149('0x36')](_0x1149('0x3a'));});}}}function endRouting(_0x4b630c,_0x2c88cf,_0x3c8314,_0x34b1ac){if(_0x4b630c&&_0x2c88cf){_0x2c88cf[_0x1149('0x23')]-=0x1;var _0x46fd08={'leaveAt':moment()[_0x1149('0x13')](_0x1149('0x25')),'exitAt':moment()[_0x1149('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1149('0x3b')};logger[_0x1149('0x3c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x4b630c,_0x2c88cf[_0x1149('0x32')]));emitChannelQueueInteraction(_0x3c8314[_0x1149('0x28')],_0x2c88cf[_0x1149('0x32')],_0x3c8314[_0x1149('0x24')],_0x3c8314['account']['name'],_0x3c8314['message']['id'],![],_0x34b1ac);if(rpc[_0x3c8314[_0x1149('0x28')]+_0x1149('0x33')]){return rpc[_0x3c8314[_0x1149('0x28')]+'QueueReport']['update'](_0x4b630c,_0x46fd08)['catch'](function(_0x210895){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x2b4681){return function(_0x47c84d){return _0x47c84d[_0x1149('0x32')]['toLowerCase']()===_0x2b4681['toLowerCase']();};}exports['consequence']=function(_0x37ad54,_0x4bed03,_0x5e8416,_0x43a889){return function(_0x391add){try{var _0x5690ee={'name':_0x4bed03[0x0],'timeout':_0x4bed03[0x1]};var _0x5f4b44=queue[_0x1149('0x0')](_0x5690ee,{'typecast':!![]});if(_0x5f4b44[_0x1149('0x3d')]){logger[_0x1149('0x36')](_0x1149('0x3e'),_0x37ad54,_[_0x1149('0x3f')](_0x5f4b44,'message')['join'](',\x20'));_0x391add[_0x1149('0x40')]();}else{var _0x31df65=_['find'](_0x5e8416[_0x43a889[_0x1149('0x28')]+'Queues'],handleFindQueue(_0x5690ee[_0x1149('0x32')]));if(_0x31df65){startRouting(_0x37ad54,_0x31df65,_0x43a889,_0x5e8416);var _0x53f145=(_0x31df65[_0x1149('0x3b')]||0xa)*0x3e8;var _0x71fb93=(_0x5690ee[_0x1149('0x3b')]||0x14)*0x3e8;var _0x442bbf,_0x291ace;if(_0x53f145>_0x71fb93){_0x71fb93=_0x53f145;}var _0x505481=seqqueue[_0x1149('0x41')](_0x53f145);_0x505481['id']=_0x37ad54;_0x505481[_0x1149('0x42')]=_0x53f145;_0x505481[_0x1149('0x43')]=_0x71fb93;_0x505481[_0x1149('0x28')]=_0x43a889[_0x1149('0x28')];_0x5e8416['rules'][_0x37ad54]['on']('end',function(){logger[_0x1149('0x3c')](_0x1149('0x44'),_0x37ad54);stopRouting(_0x37ad54,_0x31df65,_0x43a889,_0x5e8416);clearTimeout(_0x442bbf);_0x442bbf=undefined;_0x505481[_0x1149('0x45')](!![]);if(_0x5e8416[_0x1149('0x46')][_0x37ad54]){delete _0x5e8416['rules'][_0x37ad54];}_0x391add[_0x1149('0x40')]();});_0x5e8416[_0x1149('0x46')][_0x37ad54]['on']('complete',function(){if(_0x5e8416[_0x1149('0x46')][_0x37ad54]){delete _0x5e8416[_0x1149('0x46')][_0x37ad54];}});_0x442bbf=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x37ad54);endRouting(_0x37ad54,_0x31df65,_0x43a889,_0x5e8416);clearTimeout(_0x442bbf);_0x505481[_0x1149('0x45')](!![]);_0x391add[_0x1149('0x47')]();},_0x71fb93);switch(_0x31df65['strategy']){case _0x1149('0x48'):strategy[_0x1149('0x48')](_0x505481,_0x31df65,_0x5e8416,_0x43a889);break;default:strategy[_0x1149('0x49')](_0x505481,_0x31df65,_0x5e8416,_0x43a889);}}else{logger[_0x1149('0x36')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x37ad54,_0x5690ee[_0x1149('0x32')]);_0x391add[_0x1149('0x40')]();}}}catch(_0x19defb){console[_0x1149('0x4a')](_0x19defb);logger[_0x1149('0x36')](_0x1149('0x3e'),_0x37ad54,_0x19defb[_0x1149('0x4b')]);_0x391add[_0x1149('0x40')]();}};}; \ No newline at end of file +var _0x6826=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','channel','QueueId','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','queue_id','account','from','queue','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x5de769,_0xd8b92){var _0x226574=function(_0x1c54c2){while(--_0x1c54c2){_0x5de769['push'](_0x5de769['shift']());}};_0x226574(++_0xd8b92);}(_0x6826,0x75));var _0x6682=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x6826[_0x8ae98b];return _0xc30bd4;};'use strict';var schema=require(_0x6682('0x0'));var _=require('lodash');var util=require(_0x6682('0x1'));var seqqueue=require(_0x6682('0x2'));var moment=require(_0x6682('0x3'));var Redis=require(_0x6682('0x4'));var config=require(_0x6682('0x5'));var logger=require(_0x6682('0x6'))('routing');var strategy=require('./strategy');config[_0x6682('0x7')]=_[_0x6682('0x8')](config[_0x6682('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6682('0x9'))(new Redis(config[_0x6682('0x7')]));var attributes=['id',_0x6682('0xa'),_0x6682('0xb'),'queue',_0x6682('0xc'),'joinAt'];function emit(_0x333c6b,_0x1914bd,_0x2a1f92){io['to'](_0x333c6b)['emit'](_0x1914bd,_0x2a1f92);}function emitChannelQueueInteraction(_0x208f89,_0xe3f12e,_0x5ea096,_0x2036c0,_0x33d6de,_0x3b0377,_0x1ec19f,_0x55693c){var _0x2cc606=_['clone'](_0x5ea096);_0x2cc606['queue_id']=_0x55693c;_0x2cc606[_0x6682('0xd')]=_0xe3f12e;_0x2cc606[_0x6682('0xb')]=_0x2036c0;_0x2cc606['id']=_0x33d6de;if(_0x3b0377){_0x1ec19f[util[_0x6682('0xe')]('%sQueuesWaitingInteractions',_0x208f89)][_0x33d6de]=_[_0x6682('0xf')](_0x2cc606,attributes);}else{delete _0x1ec19f[util[_0x6682('0xe')](_0x6682('0x10'),_0x208f89)][_0x33d6de];}emit(util[_0x6682('0xe')](_0x6682('0x11'),_0x208f89,_0xe3f12e),util[_0x6682('0xe')]('%s_queue_waiting_interaction:%s',_0x208f89,_0x3b0377?_0x6682('0x12'):_0x6682('0x13')),_['pick'](_0x2cc606,attributes));}var rpc={'openchannelQueueReport':require(_0x6682('0x14')),'mailQueueReport':require(_0x6682('0x15')),'chatQueueReport':require(_0x6682('0x16')),'smsQueueReport':require(_0x6682('0x17')),'faxQueueReport':require(_0x6682('0x18')),'whatsappQueueReport':require(_0x6682('0x19'))};var queue=schema({'name':{'type':_0x6682('0x1a'),'required':!![],'message':_0x6682('0x1b')},'timeout':{'type':_0x6682('0x1c'),'message':_0x6682('0x1d')}});function startRouting(_0x411ce8,_0x124316,_0x4914df,_0x1483e5){if(_0x411ce8&&_0x124316&&_0x4914df){_0x124316[_0x6682('0x1e')]+=0x1;var _0x2b0880={'uniqueid':_0x411ce8,'from':_0x4914df[_0x6682('0x1f')]?_0x4914df[_0x6682('0x1f')]['from']:'','joinAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'ContactId':_0x4914df['contact']?_0x4914df['contact']['id']:null,'ListId':_0x4914df[_0x6682('0x21')]?_0x4914df[_0x6682('0x21')]['id']:null};_0x2b0880[_['upperFirst'](_0x4914df[_0x6682('0x22')])+_0x6682('0x23')]=_0x124316['id']||null;_0x2b0880[_['upperFirst'](_0x4914df['channel'])+_0x6682('0x24')]=_0x4914df[_0x6682('0x25')]?_0x4914df[_0x6682('0x25')]['id']:null;_0x2b0880[_[_0x6682('0x26')](_0x4914df[_0x6682('0x22')])+_0x6682('0x27')]=_0x4914df[_0x6682('0x28')]?_0x4914df[_0x6682('0x28')]['id']:null;_0x2b0880[_['upperFirst'](_0x4914df[_0x6682('0x22')])+(_0x4914df['channel']!==_0x6682('0x29')?_0x6682('0x2a'):'WebsiteId')]=_0x4914df[_0x6682('0xb')]?_0x4914df['account']['id']:null;logger[_0x6682('0x2b')](util[_0x6682('0xe')](_0x6682('0x2c'),_0x411ce8,_0x124316['name']));emitChannelQueueInteraction(_0x4914df[_0x6682('0x22')],_0x124316['name'],_0x2b0880,_0x4914df['account'][_0x6682('0x2d')],_0x4914df['message']['id'],!![],_0x1483e5,_0x124316['id']);if(rpc[_0x4914df[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x4914df[_0x6682('0x22')]+_0x6682('0x2e')]['create'](_0x2b0880)['catch'](function(_0x45d713){logger[_0x6682('0x2f')](_0x6682('0x30'));});}}}function stopRouting(_0x39c5bb,_0x181bd7,_0x1291ec,_0x5c305a){if(_0x39c5bb&&_0x181bd7){_0x181bd7[_0x6682('0x1e')]-=0x1;var _0x2a842a={'leaveAt':moment()['format'](_0x6682('0x20')),'acceptAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'reason':_0x6682('0x31')};logger[_0x6682('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x39c5bb,_0x181bd7['name']));emitChannelQueueInteraction(_0x1291ec[_0x6682('0x22')],_0x181bd7[_0x6682('0x2d')],_0x1291ec[_0x6682('0x1f')],_0x1291ec['account'][_0x6682('0x2d')],_0x1291ec[_0x6682('0x28')]['id'],![],_0x5c305a,_0x181bd7['id']);if(rpc[_0x1291ec[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x1291ec['channel']+_0x6682('0x2e')][_0x6682('0x32')](_0x39c5bb,_0x2a842a)[_0x6682('0x33')](function(_0x16b0a7){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x3790a7,_0x41d9ee,_0x2bf9ed,_0x46d34d){if(_0x3790a7&&_0x41d9ee){_0x41d9ee['waiting']-=0x1;var _0x3e140f={'leaveAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'exitAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'reason':_0x6682('0x34')};logger['info'](util[_0x6682('0xe')](_0x6682('0x35'),_0x3790a7,_0x41d9ee[_0x6682('0x2d')]));emitChannelQueueInteraction(_0x2bf9ed[_0x6682('0x22')],_0x41d9ee[_0x6682('0x2d')],_0x2bf9ed['body'],_0x2bf9ed[_0x6682('0xb')][_0x6682('0x2d')],_0x2bf9ed['message']['id'],![],_0x46d34d);if(rpc[_0x2bf9ed[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x2bf9ed['channel']+_0x6682('0x2e')][_0x6682('0x32')](_0x3790a7,_0x3e140f)[_0x6682('0x33')](function(_0x104f85){logger[_0x6682('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x137f2b){return function(_0x437bce){return _0x437bce[_0x6682('0x2d')][_0x6682('0x36')]()===_0x137f2b['toLowerCase']();};}exports[_0x6682('0x37')]=function(_0x538c73,_0x46ae02,_0x18791a,_0x236a3d){return function(_0x1a27a4){try{var _0x452dc2={'name':_0x46ae02[0x0],'timeout':_0x46ae02[0x1]};var _0x3e3f5a=queue[_0x6682('0x0')](_0x452dc2,{'typecast':!![]});if(_0x3e3f5a[_0x6682('0x38')]){logger[_0x6682('0x2f')](_0x6682('0x39'),_0x538c73,_['map'](_0x3e3f5a,_0x6682('0x28'))[_0x6682('0x3a')](',\x20'));_0x1a27a4[_0x6682('0x3b')]();}else{var _0xd83a2a=_['find'](_0x18791a[_0x236a3d[_0x6682('0x22')]+_0x6682('0x3c')],handleFindQueue(_0x452dc2['name']));if(_0xd83a2a){startRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);var _0x470b89=(_0xd83a2a[_0x6682('0x34')]||0xa)*0x3e8;var _0x2db9ca=(_0x452dc2[_0x6682('0x34')]||0x14)*0x3e8;var _0x5a09d1,_0x5e57a1;if(_0x470b89>_0x2db9ca){_0x2db9ca=_0x470b89;}var _0x267ebf=seqqueue['createQueue'](_0x470b89);_0x267ebf['id']=_0x538c73;_0x267ebf[_0x6682('0x3d')]=_0x470b89;_0x267ebf[_0x6682('0x3e')]=_0x2db9ca;_0x267ebf[_0x6682('0x22')]=_0x236a3d[_0x6682('0x22')];_0x18791a[_0x6682('0x3f')][_0x538c73]['on']('end',function(){logger[_0x6682('0x2b')](_0x6682('0x40'),_0x538c73);stopRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);clearTimeout(_0x5a09d1);_0x5a09d1=undefined;_0x267ebf[_0x6682('0x41')](!![]);if(_0x18791a[_0x6682('0x3f')][_0x538c73]){delete _0x18791a['rules'][_0x538c73];}_0x1a27a4[_0x6682('0x3b')]();});_0x18791a[_0x6682('0x3f')][_0x538c73]['on']('complete',function(){if(_0x18791a[_0x6682('0x3f')][_0x538c73]){delete _0x18791a[_0x6682('0x3f')][_0x538c73];}});_0x5a09d1=setTimeout(function(){logger[_0x6682('0x2b')](_0x6682('0x42'),_0x538c73);endRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);clearTimeout(_0x5a09d1);_0x267ebf[_0x6682('0x41')](!![]);_0x1a27a4['next']();},_0x2db9ca);switch(_0xd83a2a[_0x6682('0x43')]){case _0x6682('0x44'):strategy['rrmemory'](_0x267ebf,_0xd83a2a,_0x18791a,_0x236a3d);break;default:strategy[_0x6682('0x45')](_0x267ebf,_0xd83a2a,_0x18791a,_0x236a3d);}}else{logger[_0x6682('0x2f')](_0x6682('0x46'),_0x538c73,_0x452dc2[_0x6682('0x2d')]);_0x1a27a4[_0x6682('0x3b')]();}}}catch(_0x108264){console['log'](_0x108264);logger[_0x6682('0x2f')](_0x6682('0x39'),_0x538c73,_0x108264[_0x6682('0x47')]);_0x1a27a4[_0x6682('0x3b')]();}};}; \ 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 4c40664..0f9a76c 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 _0x1af8=['agents','channel','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','bind','handleTimeout','timeout','prototype','handleRun','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable'];(function(_0x310693,_0x5eb0bf){var _0x2dd79c=function(_0x17e800){while(--_0x17e800){_0x310693['push'](_0x310693['shift']());}};_0x2dd79c(++_0x5eb0bf);}(_0x1af8,0x13e));var _0x81af=function(_0x5e7be2,_0x1f61be){_0x5e7be2=_0x5e7be2-0x0;var _0x291caa=_0x1af8[_0x5e7be2];return _0x291caa;};'use strict';var _=require(_0x81af('0x0'));var uuid=require(_0x81af('0x1'));var util=require(_0x81af('0x2'));var logger=require(_0x81af('0x3'))(_0x81af('0x4'));var Agent=function(_0x2a7b16,_0x54a785,_0x5573a3,_0x3f1b49){this[_0x81af('0x5')]=uuid['v4']();this[_0x81af('0x6')]=_0x2a7b16;this['agent']=_0x54a785;this[_0x81af('0x7')]=_0x5573a3;this[_0x81af('0x4')]=_0x3f1b49;this['squeue'][_0x81af('0x8')](this['handleRun'][_0x81af('0x9')](this),this[_0x81af('0xa')][_0x81af('0x9')](this));this[_0x81af('0x6')]['on'](_0x81af('0xb'),this[_0x81af('0xa')][_0x81af('0x9')](this));this[_0x81af('0x6')]['on']('drained',this['handleDrained'][_0x81af('0x9')](this));};Agent[_0x81af('0xc')][_0x81af('0x8')]=function(){this[_0x81af('0x6')][_0x81af('0x8')](this[_0x81af('0xd')]['bind'](this),this['handleTimeout'][_0x81af('0x9')](this));};Agent[_0x81af('0xc')][_0x81af('0xe')]=function(){this[_0x81af('0xa')](!![]);};Agent[_0x81af('0xc')][_0x81af('0xd')]=function(_0x38a495){logger[_0x81af('0xf')](_0x81af('0x10'),this[_0x81af('0x6')]['id'],this[_0x81af('0x11')]['id']);if(_[_0x81af('0x12')](this[_0x81af('0x7')]['agents'][this[_0x81af('0x11')]['id']])){logger[_0x81af('0xf')](_0x81af('0x13'),this[_0x81af('0x6')]['id'],this[_0x81af('0x11')]['id']);setTimeout(this['push'][_0x81af('0x9')](this),0x3e8);}else{if(this['routing'][_0x81af('0x14')]||util[_0x81af('0x15')](this['squeue']['id'],this[_0x81af('0x7')][_0x81af('0x16')][this[_0x81af('0x11')]['id']],this[_0x81af('0x6')][_0x81af('0x17')],![])){this[_0x81af('0x7')][_0x81af('0x16')][this[_0x81af('0x11')]['id']]['busy']=!![];this['realtime']['agents'][this[_0x81af('0x11')]['id']][_0x81af('0x18')]=undefined;util[_0x81af('0x19')](this[_0x81af('0x5')],this[_0x81af('0x6')]['id'],this[_0x81af('0x7')]['agents'][this[_0x81af('0x11')]['id']],null,this[_0x81af('0x4')]);util[_0x81af('0x1a')](this[_0x81af('0x6')]['id'],this[_0x81af('0x7')][_0x81af('0x16')][this[_0x81af('0x11')]['id']],'RINGING'+(this[_0x81af('0x4')][_0x81af('0x14')]?_0x81af('0x1b'):''));}else{logger[_0x81af('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x81af('0x6')]['id'],this[_0x81af('0x11')]['id']);setTimeout(this['push'][_0x81af('0x9')](this),0x3e8);}}};Agent['prototype'][_0x81af('0xa')]=function(_0x1ee4e6){if(_['isNil'](this[_0x81af('0x7')][_0x81af('0x16')][this[_0x81af('0x11')]['id']])){return logger[_0x81af('0xf')](_0x81af('0x13'),this[_0x81af('0x6')]['id'],this[_0x81af('0x11')]['id']);}else{logger['info'](_0x81af('0x1c'),this[_0x81af('0x6')]['id'],this[_0x81af('0x11')]['id']);util[_0x81af('0x1d')](this[_0x81af('0x5')],this['squeue']['id'],this[_0x81af('0x7')]['agents'][this[_0x81af('0x11')]['id']],null,this['routing']);this[_0x81af('0x7')][_0x81af('0x16')][this['agent']['id']][_0x81af('0x1e')]=![];this[_0x81af('0x7')][_0x81af('0x16')][this['agent']['id']][_0x81af('0x18')]=undefined;util[_0x81af('0x1a')](this[_0x81af('0x6')]['id'],this[_0x81af('0x7')]['agents'][this['agent']['id']],_0x1ee4e6?_0x81af('0x1f'):_0x81af('0x20'));}if(!_0x1ee4e6){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x5333c8,_0x4279d9,_0x54c54e,_0x34df18){return new Agent(_0x5333c8,_0x4279d9,_0x54c54e,_0x34df18);}module[_0x81af('0x21')]=agent; \ No newline at end of file +var _0x7210=['timeout','handleTimeout','drained','handleDrained','prototype','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busyQueue','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x7210,0x13e));var _0x0721=function(_0x3c53c7,_0x32a47e){_0x3c53c7=_0x3c53c7-0x0;var _0x51b671=_0x7210[_0x3c53c7];return _0x51b671;};'use strict';var _=require(_0x0721('0x0'));var uuid=require(_0x0721('0x1'));var util=require(_0x0721('0x2'));var logger=require(_0x0721('0x3'))(_0x0721('0x4'));var Agent=function(_0x145e12,_0x36d167,_0x754558,_0x250d04){this[_0x0721('0x5')]=uuid['v4']();this[_0x0721('0x6')]=_0x145e12;this[_0x0721('0x7')]=_0x36d167;this[_0x0721('0x8')]=_0x754558;this[_0x0721('0x4')]=_0x250d04;this[_0x0721('0x6')][_0x0721('0x9')](this[_0x0721('0xa')]['bind'](this),this['handleTimeout'][_0x0721('0xb')](this));this['squeue']['on'](_0x0721('0xc'),this[_0x0721('0xd')][_0x0721('0xb')](this));this[_0x0721('0x6')]['on'](_0x0721('0xe'),this[_0x0721('0xf')][_0x0721('0xb')](this));};Agent[_0x0721('0x10')][_0x0721('0x9')]=function(){this[_0x0721('0x6')]['push'](this[_0x0721('0xa')][_0x0721('0xb')](this),this[_0x0721('0xd')][_0x0721('0xb')](this));};Agent['prototype'][_0x0721('0xf')]=function(){this[_0x0721('0xd')](!![]);};Agent['prototype'][_0x0721('0xa')]=function(_0x1a6dff){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x0721('0x6')]['id'],this[_0x0721('0x7')]['id']);if(_[_0x0721('0x11')](this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']])){logger['info'](_0x0721('0x13'),this[_0x0721('0x6')]['id'],this[_0x0721('0x7')]['id']);setTimeout(this['push'][_0x0721('0xb')](this),0x3e8);}else{if(this[_0x0721('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')][_0x0721('0x12')][this['agent']['id']],this['squeue'][_0x0721('0x14')],![])){this['realtime'][_0x0721('0x12')][this[_0x0721('0x7')]['id']]['busy']=!![];this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']][_0x0721('0x15')]=undefined;util['showNotification'](this[_0x0721('0x5')],this[_0x0721('0x6')]['id'],this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']],null,this[_0x0721('0x4')]);util[_0x0721('0x16')](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')]['agents'][this[_0x0721('0x7')]['id']],_0x0721('0x17')+(this[_0x0721('0x4')][_0x0721('0x18')]?_0x0721('0x19'):''));}else{logger['info'](_0x0721('0x1a'),this['squeue']['id'],this[_0x0721('0x7')]['id']);setTimeout(this[_0x0721('0x9')][_0x0721('0xb')](this),0x3e8);}}};Agent[_0x0721('0x10')][_0x0721('0xd')]=function(_0x2cad07){if(_[_0x0721('0x11')](this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']])){return logger[_0x0721('0x1b')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x0721('0x7')]['id']);}else{logger[_0x0721('0x1b')](_0x0721('0x1c'),this['squeue']['id'],this[_0x0721('0x7')]['id']);util[_0x0721('0x1d')](this['notificationId'],this['squeue']['id'],this[_0x0721('0x8')]['agents'][this[_0x0721('0x7')]['id']],null,this[_0x0721('0x4')]);this['realtime'][_0x0721('0x12')][this[_0x0721('0x7')]['id']][_0x0721('0x1e')]=![];this[_0x0721('0x8')][_0x0721('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x0721('0x16')](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')]['agents'][this['agent']['id']],_0x2cad07?_0x0721('0x1f'):'TIMEOUT');}if(!_0x2cad07){setTimeout(this[_0x0721('0x9')]['bind'](this),0x3e8);}};function agent(_0x3d704e,_0x5bc551,_0x3447aa,_0x486b83){return new Agent(_0x3d704e,_0x5bc551,_0x3447aa,_0x486b83);}module[_0x0721('0x20')]=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 c53d5f9..40ce03e 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 _0x88d5=['handleRun','handleDrained','isNil','Agents','length','agents','info','isAgentAvailable','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','bind','handleTimeout','drained','prototype','push'];(function(_0x26fd05,_0x468556){var _0x4b87ca=function(_0x32b217){while(--_0x32b217){_0x26fd05['push'](_0x26fd05['shift']());}};_0x4b87ca(++_0x468556);}(_0x88d5,0x76));var _0x588d=function(_0x17416c,_0x50f76f){_0x17416c=_0x17416c-0x0;var _0x35832e=_0x88d5[_0x17416c];return _0x35832e;};'use strict';var _=require(_0x588d('0x0'));var uuid=require(_0x588d('0x1'));var util=require(_0x588d('0x2'));var logger=require(_0x588d('0x3'))(_0x588d('0x4'));var Beepall=function(_0x5372b1,_0xe46c98,_0x32c63d,_0x504b52){this[_0x588d('0x5')]=uuid['v4']();this[_0x588d('0x6')]=_0x5372b1;this[_0x588d('0x7')]=_0xe46c98;this[_0x588d('0x8')]=_0x32c63d;this[_0x588d('0x4')]=_0x504b52;this[_0x588d('0x6')]['push'](this['handleRun'][_0x588d('0x9')](this),this[_0x588d('0xa')][_0x588d('0x9')](this));this[_0x588d('0x6')]['on']('timeout',this[_0x588d('0xa')]['bind'](this));this[_0x588d('0x6')]['on'](_0x588d('0xb'),this['handleDrained'][_0x588d('0x9')](this));};Beepall[_0x588d('0xc')][_0x588d('0xd')]=function(){this['squeue'][_0x588d('0xd')](this[_0x588d('0xe')]['bind'](this),this[_0x588d('0xa')][_0x588d('0x9')](this));};Beepall[_0x588d('0xc')][_0x588d('0xf')]=function(_0x396af0){this['handleTimeout'](!![]);};Beepall['prototype'][_0x588d('0xe')]=function(_0x395918){var _0x9a866a=!![];if(!_['isNil'](this['queue'])&&!_[_0x588d('0x10')](this[_0x588d('0x7')]['Agents'])&&this[_0x588d('0x7')][_0x588d('0x11')][_0x588d('0x12')]>0x0){for(var _0x2d64b1=0x0,_0x511f74;_0x2d64b10x0){for(var _0x397bcf=0x0,_0xe02b7a;_0x397bcf0x0&&_0x39a39c[_0x4d68d3+_0xee2f('0x26')]>=_0x39a39c[_0x4d68d3+_0xee2f('0x25')]){writeLog(_0xf278cc,_0x39a39c,_0x4d68d3['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x18bdbb,_0x18ff19,_0x2cb0cb,_0xc7f004,_0x892a4e){return sendNotification(!![],_0x18bdbb,_0x18ff19,_0x2cb0cb,_0xc7f004,_0x892a4e);};exports[_0xee2f('0x27')]=function(_0x4d8398,_0x3d3806,_0x52e1fa,_0x235697,_0x180429){return sendNotification(![],_0x4d8398,_0x3d3806,_0x52e1fa,_0x235697,_0x180429);};exports[_0xee2f('0x28')]=writeLog; \ No newline at end of file +var _0x2ef3=['emit','name','user:save','split','\x20interaction','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','routing','redis','localhost'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2ef3,0xba));var _0x32ef=function(_0x40fd92,_0x3032b9){_0x40fd92=_0x40fd92-0x0;var _0x1b8a86=_0x2ef3[_0x40fd92];return _0x1b8a86;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var utils=require(_0x32ef('0x2'));var Mustache=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var config=require(_0x32ef('0x5'));var logger=require('../../../../../config/logger')(_0x32ef('0x6'));config[_0x32ef('0x7')]=_['defaults'](config[_0x32ef('0x7')],{'host':_0x32ef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2c0089,_0x4bfcf8,_0x367c39){io['to'](_0x2c0089)[_0x32ef('0x9')](_0x4bfcf8,_0x367c39);}function sendNotification(_0x234863,_0x298066,_0x2484a0,_0x2bbb50,_0x28275c,_0x77df79){io['to'](util['format']('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](_0x32ef('0xb'),_0x2bbb50);var _0x1499c2=_0x77df79||{};var _0x5af651=_0x2484a0[_0x32ef('0xc')]('.');var _0x5afcc2={'uniqueid':_0x298066,'channel':_0x5af651[0x0],'id':_0x5af651[0x1],'title':_0x5af651[0x0]+_0x32ef('0xd'),'interactionId':_0x5af651[0x2],'queue':_0x28275c?_0x28275c['name']:null,'sound':_0x1499c2[_0x32ef('0xe')][_0x32ef('0xf')],'shake':_0x1499c2['account']['notificationShake']};try{if(!_0x1499c2[_0x32ef('0x10')]){_0x1499c2['body']={};}if(_0x28275c){_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]=_0x28275c;}else if(_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]){delete _0x1499c2['body']['queue'];}_0x5afcc2['msg']=utils[_0x32ef('0x12')](_0x1499c2[_0x32ef('0xe')][_0x32ef('0x13')],_0x1499c2);}catch(_0x53a5ca){_0x5afcc2['msg']=_0x32ef('0x14');logger[_0x32ef('0x15')](util[_0x32ef('0x16')]('[%s][QUEUE]\x20%s',_0x298066,_0x53a5ca[_0x32ef('0x17')]));}io['to'](util[_0x32ef('0x16')]('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](util[_0x32ef('0x16')](_0x32ef('0x18'),_0x234863?_0x32ef('0x19'):_0x32ef('0x1a')),_0x5afcc2);}function writeLog(_0x4de441,_0x3c5b78,_0x5cc3ef){return logger[_0x32ef('0x1b')](util[_0x32ef('0x16')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4de441,_0x3c5b78[_0x32ef('0xa')],_0x5cc3ef));}exports[_0x32ef('0x1c')]=function(_0x5e8898,_0x55f7f2,_0x57f5e5,_0x22f2d7){if(_0x55f7f2[_0x32ef('0x1d')]){writeLog(_0x5e8898,_0x55f7f2,_0x32ef('0x1e'));return![];}if(!_0x55f7f2['online']){writeLog(_0x5e8898,_0x55f7f2,'OFFLINE');return![];}if(_0x55f7f2[_0x57f5e5+_0x32ef('0x1f')]){writeLog(_0x5e8898,_0x55f7f2,'PAUSE');return![];}if(_0x22f2d7&&_0x55f7f2['hasOwnProperty'](_0x57f5e5+_0x32ef('0x20'))&&_0x55f7f2[_0x32ef('0x21')](_0x57f5e5+_0x32ef('0x22'))){if(_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]>0x0&&_0x55f7f2[_0x57f5e5+_0x32ef('0x22')]>=_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]){writeLog(_0x5e8898,_0x55f7f2,_0x57f5e5[_0x32ef('0x23')]()+_0x32ef('0x24'));return![];}}return!![];};exports[_0x32ef('0x25')]=function(_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde){return sendNotification(!![],_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde);};exports[_0x32ef('0x26')]=function(_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207){return sendNotification(![],_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 816b372..c96bcdc 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 _0xe18e=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','../../../../config/logger','routing','string'];(function(_0x2f5cb0,_0x8b40b2){var _0x2afd41=function(_0x5569eb){while(--_0x5569eb){_0x2f5cb0['push'](_0x2f5cb0['shift']());}};_0x2afd41(++_0x8b40b2);}(_0xe18e,0xe5));var _0xee18=function(_0x27650c,_0x231add){_0x27650c=_0x27650c-0x0;var _0x114630=_0xe18e[_0x27650c];return _0x114630;};'use strict';var schema=require(_0xee18('0x0'));var sh=require(_0xee18('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xee18('0x2'))(_0xee18('0x3'));var system=schema({'command':{'type':_0xee18('0x4'),'required':!![],'message':_0xee18('0x5')}});exports[_0xee18('0x6')]=function(_0x5c7b58,_0x1a32a6){return function(_0x41943c){try{var _0x222b86={'command':_0x1a32a6[0x0]};var _0x25fd0f=system[_0xee18('0x0')](_0x222b86,{'typecast':!![]});if(_0x25fd0f[_0xee18('0x7')]){logger[_0xee18('0x8')](_0xee18('0x9'),_0x5c7b58,_[_0xee18('0xa')](_0x25fd0f,_0xee18('0xb'))['join'](',\x20'));logger[_0xee18('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5c7b58);_0x41943c['next']();}else{var _0x475acc=this;var _0x29a18f=utils[_0xee18('0xd')](_0x1a32a6[0x0],this);logger[_0xee18('0xc')](_0xee18('0xe'),_0x5c7b58,_0x29a18f);sh[_0xee18('0xf')](_[_0xee18('0x10')](_0x29a18f),function(_0x44cb27,_0x3bbbb8){logger[_0xee18('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x5c7b58,_0x44cb27);if(_0x44cb27==0x0){var _0x51268b=_0x3bbbb8[_0xee18('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xee18('0x12')](_0x1a32a6[0x1])||_[_0xee18('0x13')](_0x1a32a6[0x1])){logger[_0xee18('0xc')](_0xee18('0x14'),_0x5c7b58);_0x475acc['body'][_0x1a32a6[0x1]]=_0x51268b;}else{logger[_0xee18('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5c7b58,_0x1a32a6[0x1],_0x51268b);_0x475acc[_0xee18('0x15')][_0x1a32a6[0x1]]=_0x51268b;}}_0x41943c[_0xee18('0x16')]();});}}catch(_0x5eb9a6){logger[_0xee18('0x8')]('[%s][SYSTEM]\x20%s',_0x5c7b58,_[_0xee18('0x17')](_0x5eb9a6)?JSON[_0xee18('0x18')](_0x5eb9a6):_0x5eb9a6);logger[_0xee18('0xc')](_0xee18('0x19'),_0x5c7b58);_0x41943c[_0xee18('0x16')]();}};}; \ No newline at end of file +var _0x6898=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','next','getMustacheRender','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils'];(function(_0x2b7bbf,_0x49a225){var _0x24d744=function(_0x2c3e15){while(--_0x2c3e15){_0x2b7bbf['push'](_0x2b7bbf['shift']());}};_0x24d744(++_0x49a225);}(_0x6898,0x11b));var _0x8689=function(_0x2f19c2,_0x58ba82){_0x2f19c2=_0x2f19c2-0x0;var _0x50af88=_0x6898[_0x2f19c2];return _0x50af88;};'use strict';var schema=require(_0x8689('0x0'));var sh=require('shelljs');var _=require(_0x8689('0x1'));var utils=require(_0x8689('0x2'));var logger=require(_0x8689('0x3'))(_0x8689('0x4'));var system=schema({'command':{'type':_0x8689('0x5'),'required':!![],'message':_0x8689('0x6')}});exports[_0x8689('0x7')]=function(_0x5038aa,_0x141989){return function(_0xb6de5a){try{var _0x2c723e={'command':_0x141989[0x0]};var _0x4e776d=system[_0x8689('0x0')](_0x2c723e,{'typecast':!![]});if(_0x4e776d[_0x8689('0x8')]){logger[_0x8689('0x9')](_0x8689('0xa'),_0x5038aa,_[_0x8689('0xb')](_0x4e776d,_0x8689('0xc'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5038aa);_0xb6de5a[_0x8689('0xd')]();}else{var _0x573c98=this;var _0x24e15a=utils[_0x8689('0xe')](_0x141989[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x5038aa,_0x24e15a);sh[_0x8689('0xf')](_[_0x8689('0x10')](_0x24e15a),function(_0x5d5b56,_0x395872){logger[_0x8689('0x11')](_0x8689('0x12'),_0x5038aa,_0x5d5b56);if(_0x5d5b56==0x0){var _0x5b928d=_0x395872[_0x8689('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x141989[0x1])||_['isEmpty'](_0x141989[0x1])){logger['info'](_0x8689('0x14'),_0x5038aa);_0x573c98[_0x8689('0x15')][_0x141989[0x1]]=_0x5b928d;}else{logger[_0x8689('0x11')](_0x8689('0x16'),_0x5038aa,_0x141989[0x1],_0x5b928d);_0x573c98[_0x8689('0x15')][_0x141989[0x1]]=_0x5b928d;}}_0xb6de5a[_0x8689('0xd')]();});}}catch(_0x5bd579){logger[_0x8689('0x9')]('[%s][SYSTEM]\x20%s',_0x5038aa,_[_0x8689('0x17')](_0x5bd579)?JSON[_0x8689('0x18')](_0x5bd579):_0x5bd579);logger['info'](_0x8689('0x19'),_0x5038aa);_0xb6de5a[_0x8689('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index fd9eccd..afbcdf8 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 _0x90d3=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','[%s][TAG]\x20%s','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x29bfb4,_0x3eeb34){var _0x5a7632=function(_0x1da22d){while(--_0x1da22d){_0x29bfb4['push'](_0x29bfb4['shift']());}};_0x5a7632(++_0x3eeb34);}(_0x90d3,0xae));var _0x390d=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x90d3[_0x5d8018];return _0x151ac4;};'use strict';var schema=require(_0x390d('0x0'));var _=require(_0x390d('0x1'));var rpc={'chatInteraction':require(_0x390d('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x390d('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x390d('0x4')),'whatsappInteraction':require(_0x390d('0x5'))};var logger=require(_0x390d('0x6'))(_0x390d('0x7'));var tag=schema({'tag':{'type':_0x390d('0x8'),'required':!![],'message':_0x390d('0x9')}});exports['consequence']=function(_0x5d456e,_0x418516,_0x11d092,_0x17a7f2){return function(_0x161db1){try{var _0x101f6d={'tag':_0x418516[0x0]};var _0x415e32=tag[_0x390d('0x0')](_0x101f6d,{'typecast':!![]});if(_0x415e32[_0x390d('0xa')]){logger[_0x390d('0xb')]('[%s][TAG]\x20%s',_0x5d456e,_[_0x390d('0xc')](_0x415e32,'message')[_0x390d('0xd')](',\x20'));logger[_0x390d('0xe')](_0x390d('0xf'),_0x5d456e);_0x161db1[_0x390d('0x10')]();}else{var _0x4731d7={'ids':[_0x418516[0x0]]};if(rpc[_0x17a7f2[_0x390d('0x11')]+_0x390d('0x12')]){rpc[_0x17a7f2['channel']+_0x390d('0x12')][_0x390d('0x13')](_0x17a7f2[_0x390d('0x14')]['id'],_0x4731d7)['then'](function(_0x680c19){logger[_0x390d('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5d456e,_0x418516[0x1],_0x17a7f2[_0x390d('0x11')],_0x17a7f2[_0x390d('0x14')]['id']);})[_0x390d('0x15')](function(_0x2c436a){logger['error'](_0x390d('0x16'),_0x5d456e,JSON[_0x390d('0x17')](_0x2c436a));logger[_0x390d('0xe')](_0x390d('0xf'),_0x5d456e);})[_0x390d('0x18')](function(){_0x161db1[_0x390d('0x10')]();});}}}catch(_0x100466){logger[_0x390d('0xb')](_0x390d('0x16'),_0x5d456e,_[_0x390d('0x19')](_0x100466)?JSON[_0x390d('0x17')](_0x100466):_0x100466);logger[_0x390d('0xe')](_0x390d('0xf'),_0x5d456e);_0x161db1[_0x390d('0x10')]();}};}; \ No newline at end of file +var _0x505e=['Interaction','interaction','then','info','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x5000e3,_0x9da855){var _0x258342=function(_0x877658){while(--_0x877658){_0x5000e3['push'](_0x5000e3['shift']());}};_0x258342(++_0x9da855);}(_0x505e,0x1b8));var _0xe505=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x505e[_0x44216d];return _0xeca523;};'use strict';var schema=require(_0xe505('0x0'));var _=require(_0xe505('0x1'));var rpc={'chatInteraction':require(_0xe505('0x2')),'openchannelInteraction':require(_0xe505('0x3')),'smsInteraction':require(_0xe505('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xe505('0x5')),'whatsappInteraction':require(_0xe505('0x6'))};var logger=require(_0xe505('0x7'))(_0xe505('0x8'));var tag=schema({'tag':{'type':_0xe505('0x9'),'required':!![],'message':_0xe505('0xa')}});exports[_0xe505('0xb')]=function(_0x359e7a,_0x591cdd,_0x3c3fa2,_0x1d0a9c){return function(_0x39e3b5){try{var _0x1bb9b9={'tag':_0x591cdd[0x0]};var _0x508ea2=tag[_0xe505('0x0')](_0x1bb9b9,{'typecast':!![]});if(_0x508ea2['length']){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,_['map'](_0x508ea2,_0xe505('0xe'))[_0xe505('0xf')](',\x20'));logger['info'](_0xe505('0x10'),_0x359e7a);_0x39e3b5[_0xe505('0x11')]();}else{var _0x22b4a2={'ids':[_0x591cdd[0x0]]};if(rpc[_0x1d0a9c[_0xe505('0x12')]+_0xe505('0x13')]){rpc[_0x1d0a9c['channel']+_0xe505('0x13')]['addTags'](_0x1d0a9c[_0xe505('0x14')]['id'],_0x22b4a2)[_0xe505('0x15')](function(_0x5b2627){logger[_0xe505('0x16')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x359e7a,_0x591cdd[0x1],_0x1d0a9c[_0xe505('0x12')],_0x1d0a9c[_0xe505('0x14')]['id']);})[_0xe505('0x17')](function(_0x54c184){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,JSON[_0xe505('0x18')](_0x54c184));logger[_0xe505('0x16')](_0xe505('0x10'),_0x359e7a);})[_0xe505('0x19')](function(){_0x39e3b5['next']();});}}}catch(_0x57bc7f){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,_[_0xe505('0x1a')](_0x57bc7f)?JSON[_0xe505('0x18')](_0x57bc7f):_0x57bc7f);logger[_0xe505('0x16')](_0xe505('0x10'),_0x359e7a);_0x39e3b5[_0xe505('0x11')]();}};}; \ 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 d68594f..2ab5bb4 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x33dd6f,_0x31155a){var _0x26f425=function(_0x497a4f){while(--_0x497a4f){_0x33dd6f['push'](_0x33dd6f['shift']());}};_0x26f425(++_0x31155a);}(_0xe706,0xa3));var _0x6e70=function(_0x3ae4bf,_0x554978){_0x3ae4bf=_0x3ae4bf-0x0;var _0x27f7dd=_0xe706[_0x3ae4bf];return _0x27f7dd;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x533a6c,_0x2cd0a8){var _0x2ff772=function(_0x323696){while(--_0x323696){_0x533a6c['push'](_0x533a6c['shift']());}};_0x2ff772(++_0x2cd0a8);}(_0xe706,0xa3));var _0x6e70=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xe706[_0x1f6f84];return _0x177f40;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 390530e..f928b3e 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 _0x282b=['rules','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','interval','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under'];(function(_0x47efc0,_0x4a798f){var _0x4e31af=function(_0x4ac2f1){while(--_0x4ac2f1){_0x47efc0['push'](_0x47efc0['shift']());}};_0x4e31af(++_0x4a798f);}(_0x282b,0xec));var _0xb282=function(_0x1a2b42,_0x1e57e1){_0x1a2b42=_0x1a2b42-0x0;var _0x61c9b9=_0x282b[_0x1a2b42];return _0x61c9b9;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var path=require(_0xb282('0x2'));var fs=require('fs');var jayson=require(_0xb282('0x3'));var BPromise=require(_0xb282('0x4'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0xb282('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xb282('0x6')),'mailQueueReport':require(_0xb282('0x7')),'chatQueueReport':require(_0xb282('0x8')),'smsQueueReport':require(_0xb282('0x9')),'faxQueueReport':require(_0xb282('0xa')),'whatsappQueueReport':require(_0xb282('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4a0d28,_0x17fba1,_0x436eaa){return util['format'](_0xb282('0xc'),_0x4a0d28,_0x17fba1||0x0,_0x436eaa||0x0);}function getIntervals(_0x20f517,_0x3435fc){var _0x2d86ba=[];if(!_['isNil'](_0x3435fc['IntervalId'])&&!_[_0xb282('0xd')](_0x20f517[_0x3435fc[_0xb282('0xe')]])&&!_[_0xb282('0xd')](_0x20f517[_0x3435fc[_0xb282('0xe')]][_0xb282('0xf')])){_0x2d86ba=_['map'](_0x20f517[_0x3435fc['IntervalId']][_0xb282('0xf')],_0xb282('0x10'));}else if(!_[_0xb282('0xd')](_0x3435fc[_0xb282('0x10')])){_0x2d86ba=[_0x3435fc[_0xb282('0x10')]];}return _0x2d86ba;}exports['listen']=function(_0x34c595){_0x34c595['rules']={};return new BPromise(function(_0xe1d53,_0x211862){var _0x4af892={'Start':function(_0x525cfa){var _0x5bc7c3=this;return new Promise(function(_0x13cea1,_0x350676){if(_0x525cfa){try{var _0x7c20df=[];var _0xbb182=getId(_0x525cfa[_0xb282('0x11')],_0x525cfa['message']?_0x525cfa[_0xb282('0x12')]['id']:0x0,_0x525cfa[_0xb282('0x13')]?_0x525cfa[_0xb282('0x13')]['id']:0x0);if(_0x525cfa[_0xb282('0x14')]&&_[_0xb282('0x15')](_0x525cfa['applications'])&&_0x525cfa['applications'][_0xb282('0x16')]){for(var _0x2cdeb1=0x0;_0x2cdeb1<_0x525cfa['applications'][_0xb282('0x16')];_0x2cdeb1+=0x1){var _0x34b6c7=_0x525cfa[_0xb282('0x14')][_0x2cdeb1];if(fs[_0xb282('0x17')](path[_0xb282('0x18')](__dirname,'applications',_0x34b6c7[_0xb282('0x19')]+_0xb282('0x1a')))){var _0x1f3e12=[];switch(_0x34b6c7['app'][_0xb282('0x1b')]()){case _0xb282('0x1c'):var _0x3c55ad=_0x34b6c7[_0xb282('0x1d')][_0xb282('0x1e')](',');if(_0x525cfa['channel']==='mail'){_0x1f3e12[_0xb282('0x1f')](_0x3c55ad[0x0]);_0x1f3e12[_0xb282('0x1f')](_0x3c55ad[0x1]);_0x1f3e12['push'](_0x3c55ad['slice'](0x2,_0x3c55ad[_0xb282('0x16')])[_0xb282('0x18')](','));}else{_0x1f3e12[_0xb282('0x1f')](_0x3c55ad[0x0]);_0x1f3e12[_0xb282('0x1f')](_0x3c55ad[_0xb282('0x20')](0x1,_0x3c55ad[_0xb282('0x16')])['join'](','));}break;case _0xb282('0x21'):var _0x42015c=_0x34b6c7['appdata'][_0xb282('0x1e')](',');_0x1f3e12[_0xb282('0x1f')](_0x42015c[0x0]);_0x1f3e12[_0xb282('0x1f')](_0x42015c[0x1]);_0x1f3e12[_0xb282('0x1f')](_0x42015c['slice'](0x2,_0x42015c[_0xb282('0x16')])[_0xb282('0x18')](','));break;case _0xb282('0x22'):var _0x433ad5=_0x34b6c7[_0xb282('0x1d')][_0xb282('0x1e')](',');_0x1f3e12[_0xb282('0x1f')](_0x433ad5[0x0]);_0x1f3e12['push'](_0x433ad5[0x1]);_0x1f3e12[_0xb282('0x1f')](_0x433ad5[0x2]);_0x1f3e12[_0xb282('0x1f')](_0x433ad5[0x3]);_0x1f3e12[_0xb282('0x1f')](_0x433ad5[_0xb282('0x20')](0x4,_0x433ad5[_0xb282('0x16')])['join'](','));break;case _0xb282('0x23'):var _0x4acd96=_0x34b6c7[_0xb282('0x1d')][_0xb282('0x1e')](',');_0x1f3e12[_0xb282('0x1f')](_0x4acd96[0x0]);_0x1f3e12['push'](_0x4acd96[0x1]);_0x1f3e12[_0xb282('0x1f')](_0x4acd96[0x2]);_0x1f3e12['push'](_0x4acd96[0x3]);_0x1f3e12[_0xb282('0x1f')](_0x4acd96[_0xb282('0x20')](0x4,_0x4acd96[_0xb282('0x16')])[_0xb282('0x18')](','));break;case _0xb282('0x12'):_0x1f3e12[_0xb282('0x1f')](_0x34b6c7['appdata']);break;case _0xb282('0x24'):_0x1f3e12[_0xb282('0x1f')](_0x34b6c7['TagId']);_0x1f3e12['push'](_0x34b6c7[_0xb282('0x1d')]);break;default:_0x1f3e12=_[_0xb282('0xd')](_0x34b6c7[_0xb282('0x1d')])?[]:_0x34b6c7['appdata']['split'](',');}var _0x4ad54b={'id':util[_0xb282('0x25')](_0xb282('0x26'),_0xbb182,_0x34b6c7['id'],_0x34b6c7[_0xb282('0x19')]),'condition':require(_0xb282('0x27'))[_0xb282('0x28')](_0xbb182,getIntervals(_0x34c595[_0xb282('0x29')],_0x34b6c7),_0x34c595),'consequence':require(_0xb282('0x2a')+_0x34b6c7['app'])[_0xb282('0x2b')](_0xbb182,_0x1f3e12,_0x34c595,_0x525cfa),'p':_0x34b6c7['priority']||0x0};logger[_0xb282('0x2c')](_0xb282('0x2d'),_0x4ad54b['id'],_0xb282('0x2e'),getIntervals(_0x34c595['intervals'],_0x34b6c7)[_0xb282('0x18')]('\x20|\x20'));_0x7c20df[_0xb282('0x1f')](_0x4ad54b);}else{logger[_0xb282('0x2f')](_0xb282('0x30'),path[_0xb282('0x18')](__dirname,'applications',_0x34b6c7['app']+_0xb282('0x1a')));}}_0x34c595[_0xb282('0x31')][_0xbb182]=new RuleEngine(_0x7c20df);_0x34c595[_0xb282('0x31')][_0xbb182][_0xb282('0x32')](_0x525cfa,function(_0x488902){logger[_0xb282('0x2c')]('Applications\x20executed',JSON[_0xb282('0x33')](_0x488902[_0xb282('0x34')]));if(_0x34c595['rules'][_0xbb182]){_0x34c595[_0xb282('0x31')][_0xbb182][_0xb282('0x35')](_0xb282('0x36'));}});return _0x13cea1({'code':0xc8,'message':_0x525cfa});}else{logger[_0xb282('0x2c')](_0xb282('0x37'));return _0x13cea1({'code':0xc8,'message':_0x525cfa});}}catch(_0x23c6b8){logger[_0xb282('0x2f')](_0x23c6b8[_0xb282('0x38')]);return _0x350676(_0x5bc7c3[_0xb282('0x2f')](0x1f4,_0x23c6b8));}}return _0x350676(_0xb282('0x39'));});},'AcceptMessage':function(_0x461e17){var _0x91fe43=this;return new Promise(function(_0x1caff0,_0x138a72){if(_0x461e17[_0xb282('0x3a')]&&_0x461e17[_0xb282('0x3a')]['id']){if(_0x34c595[_0xb282('0x3b')][_0x461e17[_0xb282('0x3a')]['id']]){_0x34c595['agents'][_0x461e17[_0xb282('0x3a')]['id']]['busy']=![];_0x34c595[_0xb282('0x3b')][_0x461e17[_0xb282('0x3a')]['id']][_0xb282('0x3c')]=undefined;}}if(_0x461e17[_0xb282('0x12')]&&_0x461e17[_0xb282('0x12')]['id']){try{var _0x3ddf56=getId(_0x461e17['channel'],_0x461e17['message']?_0x461e17[_0xb282('0x12')]['id']:0x0,_0x461e17['interaction']?_0x461e17[_0xb282('0x13')]['id']:0x0);if(_0x34c595[_0xb282('0x31')][_0x3ddf56]){_0x34c595['rules'][_0x3ddf56][_0xb282('0x35')](_0xb282('0x3d'));if(rpc[_0x461e17[_0xb282('0x11')]+'QueueReport']){rpc[_0x461e17['channel']+_0xb282('0x3e')]['update'](_0x3ddf56,{'UserId':_0x461e17[_0xb282('0x12')][_0xb282('0x3f')]})[_0xb282('0x40')](function(_0x33f8cd){logger[_0xb282('0x2f')](_0xb282('0x41'));});}}return _0x1caff0({'code':0xc8,'message':_0x461e17});}catch(_0x4f7ea5){logger[_0xb282('0x2f')](_0x4f7ea5[_0xb282('0x38')]);return _0x138a72(_0x91fe43[_0xb282('0x2f')](0x1f4,_0x4f7ea5));}}logger['error'](_0xb282('0x42'));return _0x138a72(_0x91fe43['error'](0x1f4,_0xb282('0x42')));});},'RejectMessage':function(_0x4b0822){var _0x1bf51c=this;return new Promise(function(_0x4ac56f,_0x4f92c9){if(_0x4b0822['agent']&&_0x4b0822[_0xb282('0x3a')]['id']){try{if(_0x34c595[_0xb282('0x3b')][_0x4b0822[_0xb282('0x3a')]['id']]){_0x34c595[_0xb282('0x3b')][_0x4b0822['agent']['id']]['busy']=![];_0x34c595['agents'][_0x4b0822[_0xb282('0x3a')]['id']][_0xb282('0x3c')]=undefined;}return _0x4ac56f({'code':0xc8,'message':_0x4b0822});}catch(_0x3bed8d){logger[_0xb282('0x2f')](_0x3bed8d['stack']);return _0x4f92c9(_0x1bf51c[_0xb282('0x2f')](0x1f4,_0x3bed8d));}}logger[_0xb282('0x2f')]('message\x20is\x20empty');return _0x4f92c9(_0x1bf51c[_0xb282('0x2f')](0x1f4,_0xb282('0x42')));});},'AbandonInteraction':function(_0x16f66b){var _0x770c9e=this;return new Promise(function(_0x1d356e,_0x5522be){if(_0x16f66b[_0xb282('0x11')]&&_0x16f66b[_0xb282('0x13')]&&_0x16f66b[_0xb282('0x13')]['id']){try{var _0x22d129=getId(_0x16f66b[_0xb282('0x11')],_0x16f66b[_0xb282('0x12')]?_0x16f66b['message']['id']:0x0,_0x16f66b[_0xb282('0x13')]?_0x16f66b['interaction']['id']:0x0);if(_0x34c595[_0xb282('0x31')][_0x22d129]){_0x34c595[_0xb282('0x31')][_0x22d129]['emit'](_0xb282('0x3d'));}return _0x1d356e({'code':0xc8,'message':_0x16f66b});}catch(_0x3dd8cb){logger[_0xb282('0x2f')](_0x3dd8cb['stack']);return _0x5522be(_0x770c9e['error'](0x1f4,_0x3dd8cb));}}logger[_0xb282('0x2f')](_0xb282('0x42'));return _0x5522be(_0x770c9e[_0xb282('0x2f')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2d3839){var _0x50944f=this;return new Promise(function(_0x46db52,_0xd6259a){if(_0x34c595['agents'][_0xb282('0x43')](_0x2d3839['id'])){for(var _0x532cd5 in _0x2d3839[_0xb282('0x44')]){if(_0x2d3839[_0xb282('0x44')][_0xb282('0x43')](_0x532cd5)){if(_0x34c595[_0xb282('0x3b')][_0x2d3839['id']][_0xb282('0x43')](_0x532cd5+_0xb282('0x45'))){_0x34c595['agents'][_0x2d3839['id']][_0x532cd5+_0xb282('0x45')]=parseInt(_0x2d3839['capacity'][_0x532cd5],0xa);}}}_0x34c595[_0xb282('0x3b')][_0x2d3839['id']][_0xb282('0x46')]();return _0x46db52({'code':0xc8,'message':_0x34c595['agents'][_0x2d3839['id']]});}else{return _0xd6259a(_0x50944f['error'](0x1f4,_0xb282('0x47')));}});},'Agents':function(_0x20a0b6){return new Promise(function(_0x14b501,_0x5225d7){var _0x593a93=_[_0xb282('0x48')](_0x34c595[_0xb282('0x3b')]);_0x14b501({'count':_0x593a93[_0xb282('0x16')],'rows':_0x593a93});});},'ChatQueues':function(_0x5d6a78){return new Promise(function(_0x3a1414,_0x5d5318){var _0x152e90=[];for(var _0x1de487 in _0x34c595[_0xb282('0x49')]){if(_0x34c595[_0xb282('0x49')][_0xb282('0x43')](_0x1de487)){var _0x2d0bb=_0x34c595[_0xb282('0x49')][_0x1de487];var _0x5c0bf1={'id':_0x2d0bb['id'],'available':_0x2d0bb[_0xb282('0x4a')],'loggedIn':_0x2d0bb[_0xb282('0x4b')],'name':_0x2d0bb[_0xb282('0x4c')],'paused':_0x2d0bb['paused'],'waiting':_0x2d0bb['waiting']};_0x152e90[_0xb282('0x1f')](_0x5c0bf1);}}_0x3a1414({'count':_0x152e90[_0xb282('0x16')],'rows':_0x152e90});});},'MailQueues':function(_0x1d2d00){return new Promise(function(_0x4f6431,_0x4b59b2){var _0x223aa7=[];for(var _0x22e565 in _0x34c595['mailQueues']){if(_0x34c595[_0xb282('0x4d')][_0xb282('0x43')](_0x22e565)){var _0x15c7b7=_0x34c595['mailQueues'][_0x22e565];var _0xaa37ca={'id':_0x15c7b7['id'],'available':_0x15c7b7[_0xb282('0x4a')],'loggedIn':_0x15c7b7['loggedIn'],'name':_0x15c7b7[_0xb282('0x4c')],'paused':_0x15c7b7[_0xb282('0x4e')],'waiting':_0x15c7b7[_0xb282('0x4f')]};_0x223aa7[_0xb282('0x1f')](_0xaa37ca);}}_0x4f6431({'count':_0x223aa7['length'],'rows':_0x223aa7});});},'OpenchannelQueues':function(_0x4a129d){return new Promise(function(_0xfdf710,_0x3c88ff){var _0x54e55c=[];for(var _0x3cdcf5 in _0x34c595[_0xb282('0x50')]){if(_0x34c595[_0xb282('0x50')][_0xb282('0x43')](_0x3cdcf5)){var _0x568e6d=_0x34c595[_0xb282('0x50')][_0x3cdcf5];var _0x1178c4={'id':_0x568e6d['id'],'available':_0x568e6d[_0xb282('0x4a')],'loggedIn':_0x568e6d['loggedIn'],'name':_0x568e6d[_0xb282('0x4c')],'paused':_0x568e6d[_0xb282('0x4e')],'waiting':_0x568e6d[_0xb282('0x4f')]};_0x54e55c['push'](_0x1178c4);}}_0xfdf710({'count':_0x54e55c[_0xb282('0x16')],'rows':_0x54e55c});});},'SmsQueues':function(_0x1208a7){return new Promise(function(_0x599757,_0x5d8532){var _0x1bb9b3=[];for(var _0x1ef276 in _0x34c595[_0xb282('0x51')]){if(_0x34c595[_0xb282('0x51')][_0xb282('0x43')](_0x1ef276)){var _0x456a22=_0x34c595[_0xb282('0x51')][_0x1ef276];var _0xbb4060={'id':_0x456a22['id'],'available':_0x456a22[_0xb282('0x4a')],'loggedIn':_0x456a22[_0xb282('0x4b')],'name':_0x456a22[_0xb282('0x4c')],'paused':_0x456a22[_0xb282('0x4e')],'waiting':_0x456a22[_0xb282('0x4f')]};_0x1bb9b3[_0xb282('0x1f')](_0xbb4060);}}_0x599757({'count':_0x1bb9b3[_0xb282('0x16')],'rows':_0x1bb9b3});});},'FaxQueues':function(_0x3a87ce){return new Promise(function(_0x4ccef5,_0x2cffa2){var _0x2c7986=[];for(var _0x3cf767 in _0x34c595[_0xb282('0x52')]){if(_0x34c595[_0xb282('0x52')][_0xb282('0x43')](_0x3cf767)){var _0x4179e0=_0x34c595[_0xb282('0x52')][_0x3cf767];var _0x2203e7={'id':_0x4179e0['id'],'available':_0x4179e0[_0xb282('0x4a')],'loggedIn':_0x4179e0[_0xb282('0x4b')],'name':_0x4179e0['name'],'paused':_0x4179e0[_0xb282('0x4e')],'waiting':_0x4179e0[_0xb282('0x4f')]};_0x2c7986[_0xb282('0x1f')](_0x2203e7);}}_0x4ccef5({'count':_0x2c7986[_0xb282('0x16')],'rows':_0x2c7986});});},'WhatsappQueues':function(_0x1e5c3a){return new Promise(function(_0x578702,_0x529afa){var _0x37432b=[];for(var _0x21166a in _0x34c595[_0xb282('0x53')]){if(_0x34c595[_0xb282('0x53')][_0xb282('0x43')](_0x21166a)){var _0x7cb26e=_0x34c595[_0xb282('0x53')][_0x21166a];var _0x4df661={'id':_0x7cb26e['id'],'available':_0x7cb26e['available'],'loggedIn':_0x7cb26e[_0xb282('0x4b')],'name':_0x7cb26e[_0xb282('0x4c')],'paused':_0x7cb26e['paused'],'waiting':_0x7cb26e['waiting']};_0x37432b[_0xb282('0x1f')](_0x4df661);}}_0x578702({'count':_0x37432b[_0xb282('0x16')],'rows':_0x37432b});});},'ChatQueuesWaitingInteractions':function(_0x2ff720){return new Promise(function(_0xad8c7d,_0x15d426){var _0x26066c=_[_0xb282('0x48')](_0x34c595['chatQueuesWaitingInteractions']);_0xad8c7d({'count':_0x26066c[_0xb282('0x16')],'rows':_0x26066c});});},'MailQueuesWaitingInteractions':function(_0x41c558){return new Promise(function(_0x2d7518,_0xc9f89a){var _0x257535=_[_0xb282('0x48')](_0x34c595[_0xb282('0x54')]);_0x2d7518({'count':_0x257535[_0xb282('0x16')],'rows':_0x257535});});},'OpenchannelQueuesWaitingInteractions':function(_0xb3d19a){return new Promise(function(_0x222203,_0x525567){var _0x1888c8=_[_0xb282('0x48')](_0x34c595[_0xb282('0x55')]);_0x222203({'count':_0x1888c8[_0xb282('0x16')],'rows':_0x1888c8});});},'SmsQueuesWaitingInteractions':function(_0xc5ed41){return new Promise(function(_0xb1394f,_0xa0f193){var _0x36bea3=_['values'](_0x34c595[_0xb282('0x56')]);_0xb1394f({'count':_0x36bea3[_0xb282('0x16')],'rows':_0x36bea3});});},'FaxQueuesWaitingInteractions':function(_0x458886){return new Promise(function(_0x313018,_0x314183){var _0x2cdceb=_['values'](_0x34c595[_0xb282('0x57')]);_0x313018({'count':_0x2cdceb[_0xb282('0x16')],'rows':_0x2cdceb});});},'WhatsappQueuesWaitingInteractions':function(_0x39c8a8){return new Promise(function(_0x552760,_0xbe0ab4){var _0x28677e=_['values'](_0x34c595[_0xb282('0x58')]);_0x552760({'count':_0x28677e[_0xb282('0x16')],'rows':_0x28677e});});}};var _0xd4fb06=jayson[_0xb282('0x59')](_0x4af892)[_0xb282('0x5a')]();_0xd4fb06['on'](_0xb282('0x2f'),function(_0x6361aa){logger['error'](JSON['stringify'](_0x6361aa));return _0x211862(_0x6361aa);});_0xd4fb06[_0xb282('0x5b')](0x232c,'127.0.0.1',function(){console[_0xb282('0x5c')](_0xb282('0x5d'),0x232c);return _0xe1d53(_0xb282('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x79ad=['faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','push','slice','split','dialogflowv2','join','amazonlex','tag','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','agent\x20not\x20found','values','chatQueues','name','paused','waiting','mailQueues','available','loggedIn','openchannelQueues','smsQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions'];(function(_0x11fda4,_0x465374){var _0x188e31=function(_0x50e774){while(--_0x50e774){_0x11fda4['push'](_0x11fda4['shift']());}};_0x188e31(++_0x465374);}(_0x79ad,0x16e));var _0xd79a=function(_0x59ff01,_0x295452){_0x59ff01=_0x59ff01-0x0;var _0x16cf73=_0x79ad[_0x59ff01];return _0x16cf73;};'use strict';var _=require(_0xd79a('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xd79a('0x1'));var BPromise=require(_0xd79a('0x2'));var uuid=require(_0xd79a('0x3'));var config=require(_0xd79a('0x4'));var logger=require(_0xd79a('0x5'))(_0xd79a('0x6'));var rpc={'openchannelQueueReport':require(_0xd79a('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd79a('0x8')),'faxQueueReport':require(_0xd79a('0x9')),'whatsappQueueReport':require(_0xd79a('0xa'))};var RuleEngine=require(_0xd79a('0xb'));function getId(_0x12bf8c,_0x263519,_0x2d3ec9){return util[_0xd79a('0xc')](_0xd79a('0xd'),_0x12bf8c,_0x263519||0x0,_0x2d3ec9||0x0);}function getIntervals(_0x3080b0,_0x28c947){var _0x28e5b8=[];if(!_[_0xd79a('0xe')](_0x28c947['IntervalId'])&&!_[_0xd79a('0xe')](_0x3080b0[_0x28c947[_0xd79a('0xf')]])&&!_[_0xd79a('0xe')](_0x3080b0[_0x28c947[_0xd79a('0xf')]][_0xd79a('0x10')])){_0x28e5b8=_[_0xd79a('0x11')](_0x3080b0[_0x28c947[_0xd79a('0xf')]][_0xd79a('0x10')],_0xd79a('0x12'));}else if(!_['isNil'](_0x28c947['interval'])){_0x28e5b8=[_0x28c947[_0xd79a('0x12')]];}return _0x28e5b8;}exports['listen']=function(_0x38d6c4){_0x38d6c4[_0xd79a('0x13')]={};return new BPromise(function(_0x329e2c,_0x2e41c3){var _0x38a582={'Start':function(_0x1e4cd5){var _0x114292=this;return new Promise(function(_0xad42bf,_0x34bad7){if(_0x1e4cd5){try{var _0x28b1a6=[];var _0x262e34=getId(_0x1e4cd5[_0xd79a('0x14')],_0x1e4cd5['message']?_0x1e4cd5[_0xd79a('0x15')]['id']:0x0,_0x1e4cd5[_0xd79a('0x16')]?_0x1e4cd5[_0xd79a('0x16')]['id']:0x0);if(_0x1e4cd5[_0xd79a('0x17')]&&_[_0xd79a('0x18')](_0x1e4cd5[_0xd79a('0x17')])&&_0x1e4cd5[_0xd79a('0x17')][_0xd79a('0x19')]){for(var _0x3f4352=0x0;_0x3f4352<_0x1e4cd5[_0xd79a('0x17')][_0xd79a('0x19')];_0x3f4352+=0x1){var _0x51a253=_0x1e4cd5[_0xd79a('0x17')][_0x3f4352];if(fs['existsSync'](path['join'](__dirname,'applications',_0x51a253[_0xd79a('0x1a')]+_0xd79a('0x1b')))){var _0x33d1de=[];switch(_0x51a253['app'][_0xd79a('0x1c')]()){case _0xd79a('0x1d'):var _0x42bd98=_0x51a253[_0xd79a('0x1e')]['split'](',');if(_0x1e4cd5['channel']==='mail'){_0x33d1de['push'](_0x42bd98[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x42bd98[0x1]);_0x33d1de['push'](_0x42bd98['slice'](0x2,_0x42bd98[_0xd79a('0x19')])['join'](','));}else{_0x33d1de['push'](_0x42bd98[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x42bd98[_0xd79a('0x20')](0x1,_0x42bd98['length'])['join'](','));}break;case'dialogflow':var _0x47e2c9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de['push'](_0x47e2c9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x47e2c9[0x1]);_0x33d1de['push'](_0x47e2c9['slice'](0x2,_0x47e2c9[_0xd79a('0x19')])['join'](','));break;case _0xd79a('0x22'):var _0x4b36b9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x1]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x2]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x3]);_0x33d1de['push'](_0x4b36b9[_0xd79a('0x20')](0x4,_0x4b36b9[_0xd79a('0x19')])[_0xd79a('0x23')](','));break;case _0xd79a('0x24'):var _0x1203e9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x1]);_0x33d1de['push'](_0x1203e9[0x2]);_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x3]);_0x33d1de['push'](_0x1203e9[_0xd79a('0x20')](0x4,_0x1203e9['length'])[_0xd79a('0x23')](','));break;case _0xd79a('0x15'):_0x33d1de[_0xd79a('0x1f')](_0x51a253['appdata']);break;case _0xd79a('0x25'):_0x33d1de['push'](_0x51a253['TagId']);_0x33d1de['push'](_0x51a253[_0xd79a('0x1e')]);break;default:_0x33d1de=_['isNil'](_0x51a253[_0xd79a('0x1e')])?[]:_0x51a253['appdata'][_0xd79a('0x21')](',');}var _0x5072dc={'id':util[_0xd79a('0xc')](_0xd79a('0x26'),_0x262e34,_0x51a253['id'],_0x51a253[_0xd79a('0x1a')]),'condition':require(_0xd79a('0x27'))[_0xd79a('0x28')](_0x262e34,getIntervals(_0x38d6c4[_0xd79a('0x29')],_0x51a253),_0x38d6c4),'consequence':require(_0xd79a('0x2a')+_0x51a253[_0xd79a('0x1a')])['consequence'](_0x262e34,_0x33d1de,_0x38d6c4,_0x1e4cd5),'p':_0x51a253[_0xd79a('0x2b')]||0x0};logger[_0xd79a('0x2c')](_0xd79a('0x2d'),_0x5072dc['id'],'on\x20interval',getIntervals(_0x38d6c4['intervals'],_0x51a253)['join'](_0xd79a('0x2e')));_0x28b1a6[_0xd79a('0x1f')](_0x5072dc);}else{logger['error'](_0xd79a('0x2f'),path[_0xd79a('0x23')](__dirname,_0xd79a('0x17'),_0x51a253[_0xd79a('0x1a')]+_0xd79a('0x1b')));}}_0x38d6c4[_0xd79a('0x13')][_0x262e34]=new RuleEngine(_0x28b1a6);_0x38d6c4[_0xd79a('0x13')][_0x262e34]['execute'](_0x1e4cd5,function(_0x2d95ab){logger[_0xd79a('0x2c')](_0xd79a('0x30'),JSON[_0xd79a('0x31')](_0x2d95ab[_0xd79a('0x32')]));if(_0x38d6c4[_0xd79a('0x13')][_0x262e34]){_0x38d6c4['rules'][_0x262e34][_0xd79a('0x33')](_0xd79a('0x34'));}});return _0xad42bf({'code':0xc8,'message':_0x1e4cd5});}else{logger[_0xd79a('0x2c')](_0xd79a('0x35'));return _0xad42bf({'code':0xc8,'message':_0x1e4cd5});}}catch(_0x14f220){logger[_0xd79a('0x36')](_0x14f220['stack']);return _0x34bad7(_0x114292[_0xd79a('0x36')](0x1f4,_0x14f220));}}return _0x34bad7(_0xd79a('0x37'));});},'AcceptMessage':function(_0x247b15){var _0x114ac0=this;return new Promise(function(_0x463ef4,_0x27213e){if(_0x247b15[_0xd79a('0x38')]&&_0x247b15['agent']['id']){if(_0x38d6c4[_0xd79a('0x39')][_0x247b15[_0xd79a('0x38')]['id']]){_0x38d6c4['agents'][_0x247b15['agent']['id']][_0xd79a('0x3a')]=![];_0x38d6c4[_0xd79a('0x39')][_0x247b15[_0xd79a('0x38')]['id']][_0xd79a('0x3b')]=undefined;}}if(_0x247b15['message']&&_0x247b15[_0xd79a('0x15')]['id']){try{var _0x11ffee=getId(_0x247b15[_0xd79a('0x14')],_0x247b15['message']?_0x247b15[_0xd79a('0x15')]['id']:0x0,_0x247b15[_0xd79a('0x16')]?_0x247b15[_0xd79a('0x16')]['id']:0x0);if(_0x38d6c4[_0xd79a('0x13')][_0x11ffee]){_0x38d6c4[_0xd79a('0x13')][_0x11ffee][_0xd79a('0x33')](_0xd79a('0x3c'));if(rpc[_0x247b15['channel']+_0xd79a('0x3d')]){rpc[_0x247b15[_0xd79a('0x14')]+_0xd79a('0x3d')][_0xd79a('0x3e')](_0x11ffee,{'UserId':_0x247b15[_0xd79a('0x15')][_0xd79a('0x3f')]})['catch'](function(_0x582385){logger[_0xd79a('0x36')](_0xd79a('0x40'));});}}return _0x463ef4({'code':0xc8,'message':_0x247b15});}catch(_0x40edeb){logger[_0xd79a('0x36')](_0x40edeb[_0xd79a('0x41')]);return _0x27213e(_0x114ac0['error'](0x1f4,_0x40edeb));}}logger[_0xd79a('0x36')](_0xd79a('0x42'));return _0x27213e(_0x114ac0['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x583a3e){var _0x1ae409=this;return new Promise(function(_0x5de436,_0x1f3d84){if(_0x583a3e[_0xd79a('0x38')]&&_0x583a3e['agent']['id']){try{if(_0x38d6c4['agents'][_0x583a3e['agent']['id']]){_0x38d6c4[_0xd79a('0x39')][_0x583a3e[_0xd79a('0x38')]['id']]['busy']=![];_0x38d6c4[_0xd79a('0x39')][_0x583a3e['agent']['id']][_0xd79a('0x3b')]=undefined;}return _0x5de436({'code':0xc8,'message':_0x583a3e});}catch(_0x373df3){logger[_0xd79a('0x36')](_0x373df3[_0xd79a('0x41')]);return _0x1f3d84(_0x1ae409['error'](0x1f4,_0x373df3));}}logger[_0xd79a('0x36')](_0xd79a('0x42'));return _0x1f3d84(_0x1ae409['error'](0x1f4,_0xd79a('0x42')));});},'AbandonInteraction':function(_0x462d35){var _0x576226=this;return new Promise(function(_0x17a97c,_0xeec62d){if(_0x462d35['channel']&&_0x462d35['interaction']&&_0x462d35[_0xd79a('0x16')]['id']){try{var _0x506b37=getId(_0x462d35[_0xd79a('0x14')],_0x462d35[_0xd79a('0x15')]?_0x462d35[_0xd79a('0x15')]['id']:0x0,_0x462d35['interaction']?_0x462d35[_0xd79a('0x16')]['id']:0x0);if(_0x38d6c4[_0xd79a('0x13')][_0x506b37]){_0x38d6c4[_0xd79a('0x13')][_0x506b37][_0xd79a('0x33')]('end');}return _0x17a97c({'code':0xc8,'message':_0x462d35});}catch(_0x4b8ab4){logger[_0xd79a('0x36')](_0x4b8ab4[_0xd79a('0x41')]);return _0xeec62d(_0x576226[_0xd79a('0x36')](0x1f4,_0x4b8ab4));}}logger['error'](_0xd79a('0x42'));return _0xeec62d(_0x576226[_0xd79a('0x36')](0x1f4,_0xd79a('0x42')));});},'AgentCapacity':function(_0x5a4cc4){var _0x43a06c=this;return new Promise(function(_0x5380f9,_0x44aa2a){if(_0x38d6c4[_0xd79a('0x39')][_0xd79a('0x43')](_0x5a4cc4['id'])){for(var _0xeb5c82 in _0x5a4cc4[_0xd79a('0x44')]){if(_0x5a4cc4[_0xd79a('0x44')][_0xd79a('0x43')](_0xeb5c82)){if(_0x38d6c4[_0xd79a('0x39')][_0x5a4cc4['id']]['hasOwnProperty'](_0xeb5c82+'CurrentCapacity')){_0x38d6c4['agents'][_0x5a4cc4['id']][_0xeb5c82+'CurrentCapacity']=parseInt(_0x5a4cc4[_0xd79a('0x44')][_0xeb5c82],0xa);}}}_0x38d6c4['agents'][_0x5a4cc4['id']]['updateRealtime']();return _0x5380f9({'code':0xc8,'message':_0x38d6c4['agents'][_0x5a4cc4['id']]});}else{return _0x44aa2a(_0x43a06c[_0xd79a('0x36')](0x1f4,_0xd79a('0x45')));}});},'Agents':function(_0x191b5b){return new Promise(function(_0x1fbb1f,_0x37433a){var _0x596462=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x39')]);_0x1fbb1f({'count':_0x596462[_0xd79a('0x19')],'rows':_0x596462});});},'ChatQueues':function(_0x5b2108){return new Promise(function(_0x20dd2b,_0x1c5df6){var _0x233763=[];for(var _0x584e7d in _0x38d6c4[_0xd79a('0x47')]){if(_0x38d6c4[_0xd79a('0x47')][_0xd79a('0x43')](_0x584e7d)){var _0x1337fb=_0x38d6c4[_0xd79a('0x47')][_0x584e7d];var _0x36f118={'id':_0x1337fb['id'],'available':_0x1337fb['available'],'loggedIn':_0x1337fb['loggedIn'],'name':_0x1337fb[_0xd79a('0x48')],'paused':_0x1337fb[_0xd79a('0x49')],'waiting':_0x1337fb[_0xd79a('0x4a')]};_0x233763[_0xd79a('0x1f')](_0x36f118);}}_0x20dd2b({'count':_0x233763[_0xd79a('0x19')],'rows':_0x233763});});},'MailQueues':function(_0x1e95e8){return new Promise(function(_0x3e08f0,_0x387528){var _0x5b67a9=[];for(var _0x3841f0 in _0x38d6c4['mailQueues']){if(_0x38d6c4[_0xd79a('0x4b')][_0xd79a('0x43')](_0x3841f0)){var _0x48785d=_0x38d6c4[_0xd79a('0x4b')][_0x3841f0];var _0x2c1272={'id':_0x48785d['id'],'available':_0x48785d[_0xd79a('0x4c')],'loggedIn':_0x48785d[_0xd79a('0x4d')],'name':_0x48785d[_0xd79a('0x48')],'paused':_0x48785d[_0xd79a('0x49')],'waiting':_0x48785d[_0xd79a('0x4a')]};_0x5b67a9[_0xd79a('0x1f')](_0x2c1272);}}_0x3e08f0({'count':_0x5b67a9[_0xd79a('0x19')],'rows':_0x5b67a9});});},'OpenchannelQueues':function(_0x3057d8){return new Promise(function(_0x47d3fe,_0x1decd3){var _0x38016d=[];for(var _0x449add in _0x38d6c4[_0xd79a('0x4e')]){if(_0x38d6c4[_0xd79a('0x4e')]['hasOwnProperty'](_0x449add)){var _0x489b5c=_0x38d6c4[_0xd79a('0x4e')][_0x449add];var _0x25e434={'id':_0x489b5c['id'],'available':_0x489b5c[_0xd79a('0x4c')],'loggedIn':_0x489b5c[_0xd79a('0x4d')],'name':_0x489b5c[_0xd79a('0x48')],'paused':_0x489b5c['paused'],'waiting':_0x489b5c[_0xd79a('0x4a')]};_0x38016d[_0xd79a('0x1f')](_0x25e434);}}_0x47d3fe({'count':_0x38016d[_0xd79a('0x19')],'rows':_0x38016d});});},'SmsQueues':function(_0x202097){return new Promise(function(_0x45750e,_0x1a6009){var _0x19c276=[];for(var _0x175b0e in _0x38d6c4[_0xd79a('0x4f')]){if(_0x38d6c4[_0xd79a('0x4f')][_0xd79a('0x43')](_0x175b0e)){var _0x15b102=_0x38d6c4[_0xd79a('0x4f')][_0x175b0e];var _0x121374={'id':_0x15b102['id'],'available':_0x15b102[_0xd79a('0x4c')],'loggedIn':_0x15b102['loggedIn'],'name':_0x15b102[_0xd79a('0x48')],'paused':_0x15b102[_0xd79a('0x49')],'waiting':_0x15b102[_0xd79a('0x4a')]};_0x19c276['push'](_0x121374);}}_0x45750e({'count':_0x19c276[_0xd79a('0x19')],'rows':_0x19c276});});},'FaxQueues':function(_0x1409da){return new Promise(function(_0x36decf,_0x307931){var _0xdcb406=[];for(var _0x10df78 in _0x38d6c4['faxQueues']){if(_0x38d6c4['faxQueues'][_0xd79a('0x43')](_0x10df78)){var _0x18ef8b=_0x38d6c4['faxQueues'][_0x10df78];var _0x2aca56={'id':_0x18ef8b['id'],'available':_0x18ef8b[_0xd79a('0x4c')],'loggedIn':_0x18ef8b[_0xd79a('0x4d')],'name':_0x18ef8b[_0xd79a('0x48')],'paused':_0x18ef8b[_0xd79a('0x49')],'waiting':_0x18ef8b[_0xd79a('0x4a')]};_0xdcb406[_0xd79a('0x1f')](_0x2aca56);}}_0x36decf({'count':_0xdcb406[_0xd79a('0x19')],'rows':_0xdcb406});});},'WhatsappQueues':function(_0x250218){return new Promise(function(_0xc611d5,_0x18d324){var _0x5b7da0=[];for(var _0x341230 in _0x38d6c4[_0xd79a('0x50')]){if(_0x38d6c4['whatsappQueues']['hasOwnProperty'](_0x341230)){var _0x5a352d=_0x38d6c4[_0xd79a('0x50')][_0x341230];var _0xf2a355={'id':_0x5a352d['id'],'available':_0x5a352d[_0xd79a('0x4c')],'loggedIn':_0x5a352d[_0xd79a('0x4d')],'name':_0x5a352d['name'],'paused':_0x5a352d[_0xd79a('0x49')],'waiting':_0x5a352d[_0xd79a('0x4a')]};_0x5b7da0['push'](_0xf2a355);}}_0xc611d5({'count':_0x5b7da0[_0xd79a('0x19')],'rows':_0x5b7da0});});},'ChatQueuesWaitingInteractions':function(_0x4214ff){return new Promise(function(_0x443085,_0x32370a){var _0x191cac=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x51')]);_0x443085({'count':_0x191cac[_0xd79a('0x19')],'rows':_0x191cac});});},'MailQueuesWaitingInteractions':function(_0x2f3cc7){return new Promise(function(_0x1adfda,_0x1c591c){var _0x3673e3=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x52')]);_0x1adfda({'count':_0x3673e3[_0xd79a('0x19')],'rows':_0x3673e3});});},'OpenchannelQueuesWaitingInteractions':function(_0x10d4de){return new Promise(function(_0x2b419a,_0x1831d2){var _0x42a623=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x53')]);_0x2b419a({'count':_0x42a623[_0xd79a('0x19')],'rows':_0x42a623});});},'SmsQueuesWaitingInteractions':function(_0x30694c){return new Promise(function(_0x39c9fb,_0x26563a){var _0x53c446=_['values'](_0x38d6c4['smsQueuesWaitingInteractions']);_0x39c9fb({'count':_0x53c446[_0xd79a('0x19')],'rows':_0x53c446});});},'FaxQueuesWaitingInteractions':function(_0x84c610){return new Promise(function(_0x2d1dc2,_0x282a66){var _0x2eb143=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x54')]);_0x2d1dc2({'count':_0x2eb143[_0xd79a('0x19')],'rows':_0x2eb143});});},'WhatsappQueuesWaitingInteractions':function(_0x438d94){return new Promise(function(_0x4a3fac,_0xda6f8f){var _0x21669c=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x55')]);_0x4a3fac({'count':_0x21669c['length'],'rows':_0x21669c});});}};var _0xc078b0=jayson[_0xd79a('0x56')](_0x38a582)[_0xd79a('0x57')]();_0xc078b0['on'](_0xd79a('0x36'),function(_0x5321c2){logger[_0xd79a('0x36')](JSON['stringify'](_0x5321c2));return _0x2e41c3(_0x5321c2);});_0xc078b0['listen'](0x232c,_0xd79a('0x58'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x329e2c(_0xd79a('0x59')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0d0cb29..8c8bf27 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 _0x3673=['client','http','request','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x56a7dd,_0x3fd9ae){var _0xc7b980=function(_0x34221b){while(--_0x34221b){_0x56a7dd['push'](_0x56a7dd['shift']());}};_0xc7b980(++_0x3fd9ae);}(_0x3673,0xa9));var _0x3367=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0x3673[_0xe896bf];return _0x4c7a8a;};'use strict';var util=require(_0x3367('0x0'));var BPromise=require(_0x3367('0x1'));var jayson=require(_0x3367('0x2'));var _=require(_0x3367('0x3'));var logger=require(_0x3367('0x4'))(_0x3367('0x5'));var client=jayson[_0x3367('0x6')][_0x3367('0x7')]({'port':0x232a});function request(_0x2a19dc,_0x20c918){return new BPromise(function(_0x5d9632,_0x501798){return client[_0x3367('0x8')](_0x2a19dc,_0x20c918)[_0x3367('0x9')](function(_0x488e5a){if(_0x488e5a[_0x3367('0xa')]){return _0x501798(_0x488e5a[_0x3367('0xa')]['message']);}else{return _0x5d9632(_0x488e5a[_0x3367('0xb')]);}})[_0x3367('0xc')](function(_0x5eb0c9){return _0x501798(_0x5eb0c9);});});}exports[_0x3367('0xd')]=function(_0x205f21,_0x4c7621,_0x4e3a5f){return function(_0x476dab){if(_0x4e3a5f[_0x3367('0xe')]&&!_0x4e3a5f[_0x3367('0xe')][_0x205f21]){logger[_0x3367('0xf')](_0x3367('0x10'),_0x205f21);return _0x476dab['stop']();}var _0x1d0acb=[];for(var _0x8335f7=0x0;_0x8335f7<_0x4c7621[_0x3367('0x11')];_0x8335f7+=0x1){_0x1d0acb[_0x3367('0x12')](request(_0x3367('0x13'),{'command':util[_0x3367('0x14')](_0x3367('0x15'),_0x4c7621[_0x8335f7])})[_0x3367('0x9')](function(_0xe90511){return _0xe90511&&_0xe90511[_0x3367('0x16')]&&_0xe90511[_0x3367('0x16')][_0x3367('0x17')](_0x3367('0x18'))>=0x0?!![]:![];})['catch'](function(_0x4691fc){logger[_0x3367('0xa')](_0x3367('0x19'),_0x205f21,_0x4c7621[_0x8335f7]);}));}BPromise[_0x3367('0x1a')](_0x1d0acb)[_0x3367('0x9')](function(_0x1dee6e){var _0x42dee6=_[_0x3367('0x1b')](_0x1dee6e);logger['info'](_0x3367('0x1c'),_0x205f21,_0x4c7621[_0x3367('0x1d')](_0x3367('0x1e')),_0x42dee6);_0x476dab[_0x3367('0x1f')](_0x42dee6);})[_0x3367('0xc')](function(_0x4a3fa9){console[_0x3367('0x20')](_0x4a3fa9);logger['error'](_0x3367('0x1c'),_0x205f21,_0x4c7621[_0x3367('0x1d')](_0x3367('0x1e')),_0x4a3fa9[_0x3367('0x21')]);_0x476dab[_0x3367('0x22')]();});};}; \ No newline at end of file +var _0x08f9=['\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','join'];(function(_0x198504,_0x26a434){var _0x45f7db=function(_0x4170f3){while(--_0x4170f3){_0x198504['push'](_0x198504['shift']());}};_0x45f7db(++_0x26a434);}(_0x08f9,0xed));var _0x908f=function(_0xb9e6ab,_0x460290){_0xb9e6ab=_0xb9e6ab-0x0;var _0x19c667=_0x08f9[_0xb9e6ab];return _0x19c667;};'use strict';var util=require(_0x908f('0x0'));var BPromise=require(_0x908f('0x1'));var jayson=require(_0x908f('0x2'));var _=require(_0x908f('0x3'));var logger=require(_0x908f('0x4'))(_0x908f('0x5'));var client=jayson[_0x908f('0x6')]['http']({'port':0x232a});function request(_0x2bd7ec,_0x33a171){return new BPromise(function(_0x18e4c3,_0x178078){return client[_0x908f('0x7')](_0x2bd7ec,_0x33a171)[_0x908f('0x8')](function(_0x220b49){if(_0x220b49['error']){return _0x178078(_0x220b49[_0x908f('0x9')][_0x908f('0xa')]);}else{return _0x18e4c3(_0x220b49['result']);}})[_0x908f('0xb')](function(_0x5d0fe7){return _0x178078(_0x5d0fe7);});});}exports['condition']=function(_0x5359ab,_0x131dfd,_0x41fbaa){return function(_0x21d167){if(_0x41fbaa['rules']&&!_0x41fbaa[_0x908f('0xc')][_0x5359ab]){logger[_0x908f('0xd')](_0x908f('0xe'),_0x5359ab);return _0x21d167['stop']();}var _0x38b9a5=[];for(var _0x582520=0x0;_0x582520<_0x131dfd[_0x908f('0xf')];_0x582520+=0x1){_0x38b9a5[_0x908f('0x10')](request('Command',{'command':util[_0x908f('0x11')](_0x908f('0x12'),_0x131dfd[_0x582520])})['then'](function(_0x20a435){return _0x20a435&&_0x20a435[_0x908f('0xa')]&&_0x20a435[_0x908f('0xa')][_0x908f('0x13')]('true')>=0x0?!![]:![];})['catch'](function(_0x1ea4d7){logger[_0x908f('0x9')](_0x908f('0x14'),_0x5359ab,_0x131dfd[_0x582520]);}));}BPromise[_0x908f('0x15')](_0x38b9a5)[_0x908f('0x8')](function(_0x315a9c){var _0x1dc649=_[_0x908f('0x16')](_0x315a9c);logger[_0x908f('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x5359ab,_0x131dfd[_0x908f('0x17')](_0x908f('0x18')),_0x1dc649);_0x21d167[_0x908f('0x19')](_0x1dc649);})[_0x908f('0xb')](function(_0x34f4d3){console['log'](_0x34f4d3);logger['error'](_0x908f('0x1a'),_0x5359ab,_0x131dfd[_0x908f('0x17')](_0x908f('0x18')),_0x34f4d3[_0x908f('0x1b')]);_0x21d167[_0x908f('0x1c')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ec62360..b4e21dd 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 _0xb469=['agentringnoanswerAt','timeout','holdtime','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%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','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','splice','diffTime','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x502459,_0x51feab){var _0x3db089=function(_0x111202){while(--_0x111202){_0x502459['push'](_0x502459['shift']());}};_0x3db089(++_0x51feab);}(_0xb469,0x13b));var _0x9b46=function(_0x9fd464,_0x6aff82){_0x9fd464=_0x9fd464-0x0;var _0x787442=_0xb469[_0x9fd464];return _0x787442;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var utils=require(_0x9b46('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34f477,_0x1a41e8){utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34f477[_0x9b46('0x5')],_0x34f477[_0x9b46('0x6')],_0x34f477['queue'],_0x34f477[_0x9b46('0x7')],_0x34f477[_0x9b46('0x8')],_0x34f477['calleridnum'],_0x34f477[_0x9b46('0x9')],_0x34f477['lastevent']));if(_0x34f477['queue']){utils[_0x9b46('0xa')](_0x34f477['queue'])[_0x9b46('0xb')](function(_0xb9d1b5){if(_0xb9d1b5){_0x34f477[_0x9b46('0xc')]=_0xb9d1b5['type'];_0x34f477[_0x9b46('0xd')]=_0x34f477['agentcomplete']?_0xb9d1b5[_0x9b46('0xe')]:![];_0x34f477['acwtime']=_0x34f477[_0x9b46('0xd')]?_0xb9d1b5['acwTimeout']:0x0;}utils[_0x9b46('0xf')](_0x9b46('0x10'),_0x34f477);});}else{utils['request'](_0x9b46('0x10'),_0x34f477);}if(_0x1a41e8){delete transfers[_0x34f477[_0x9b46('0x5')]];}else{delete agents[_0x34f477['destuniqueid']];}}exports[_0x9b46('0x11')]=function(_0x2cfb35){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0x2cfb35);agents[_0x2cfb35[_0x9b46('0x14')]]=_0x2cfb35;agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x18');agents[_0x2cfb35['destuniqueid']]['connectedlinenum']=null;agents[_0x2cfb35['destuniqueid']][_0x9b46('0x19')]=null;utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2cfb35['uniqueid'],agents[_0x2cfb35[_0x9b46('0x14')]]['membername'],_0x2cfb35['destuniqueid']));}catch(_0xfeb1b9){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0xfeb1b9);}};exports['agentringnoanswer']=function(_0x55aece){try{if(!_[_0x9b46('0x1b')](agents[_0x55aece[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util['format']('[%s][agents][agentringnoanswer]',_0x55aece[_0x9b46('0x5')]),_0x55aece);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x1c'),_0x55aece['uniqueid'],agents[_0x55aece[_0x9b46('0x14')]]['membername'],_0x55aece[_0x9b46('0x14')]));agents[_0x55aece[_0x9b46('0x14')]]['agentringnoanswer']=!![];agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]]['reason']=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1f')]=_0x55aece[_0x9b46('0x20')]?parseInt(_0x55aece[_0x9b46('0x20')])/0x3e8:0x0;agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x21')]=0x0;unanswered['push'](_0x55aece[_0x9b46('0x14')]);}}catch(_0xee519e){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x22'),_0x55aece[_0x9b46('0x5')]),_0xee519e);}};exports[_0x9b46('0x23')]=function(_0x17ba3d){try{_[_0x9b46('0x24')](agents,function(_0x20090a,_0x2e1c51){if(_0x20090a['uniqueid']==_0x17ba3d[_0x9b46('0x5')]&&!_[_0x9b46('0x25')](unanswered,_0x20090a[_0x9b46('0x14')])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x17ba3d);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x27'),_0x17ba3d[_0x9b46('0x5')],_0x20090a['membername'],_0x20090a[_0x9b46('0x14')]));_0x20090a['agentringnoanswer']=!![];_0x20090a[_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();_0x20090a[_0x9b46('0x17')]='abandoned';_0x20090a[_0x9b46('0x28')]=_0x9b46('0x29');_0x20090a[_0x9b46('0x1f')]=_0x17ba3d[_0x9b46('0x1f')];_0x20090a[_0x9b46('0x21')]=0x0;writeDB(_0x20090a);}});}catch(_0x5cb73f){utils['error'](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x5cb73f);}};exports[_0x9b46('0x2a')]=function(_0x4fa731){try{if(agents[_0x4fa731[_0x9b46('0x14')]]){utils['debug'](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x4fa731);utils[_0x9b46('0x3')](util['format'](_0x9b46('0x2c'),_0x4fa731['uniqueid'],agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x7')],_0x4fa731[_0x9b46('0x14')]));agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x9')]=_0x4fa731[_0x9b46('0x9')];agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x19')]=_0x4fa731['connectedlinename'];agents[_0x4fa731[_0x9b46('0x14')]]['holdtime']=_0x4fa731[_0x9b46('0x20')];agents[_0x4fa731[_0x9b46('0x14')]]['lastevent']=_0x9b46('0x2e');_['forIn'](agents,function(_0x416538,_0x493b0f){if(_0x416538[_0x9b46('0x14')]!=_0x4fa731[_0x9b46('0x14')]&&_0x416538[_0x9b46('0x5')]==_0x4fa731[_0x9b46('0x5')]){_0x416538[_0x9b46('0x21')]=0x0;_0x416538['holdtime']=_0x4fa731['ringtime'];_0x416538[_0x9b46('0x2f')]=!![];_0x416538['agentringnoanswerAt']=utils['now']();_0x416538['lastevent']='answered_elsewhere';_0x416538[_0x9b46('0x28')]='answered_elsewhere';_0x416538[_0x9b46('0x30')]=_0x4fa731['destuniqueid'];_0x416538[_0x9b46('0x31')]=_0x4fa731[_0x9b46('0x7')];writeDB(_0x416538);}});}}catch(_0x2e92aa){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x2e92aa);}};exports[_0x9b46('0x32')]=function(_0x148d86){try{if(!_['isNil'](agents[_0x148d86[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x148d86);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x34'),_0x148d86[_0x9b46('0x5')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x7')],_0x148d86[_0x9b46('0x14')]));agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x32')]=!![];agents[_0x148d86['destuniqueid']]['agentcompleteAt']=utils[_0x9b46('0x16')]();agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x21')]=utils['diffTime'](agents[_0x148d86['destuniqueid']][_0x9b46('0x35')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x2d')]);agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x28')]=_0x148d86[_0x9b46('0x28')];agents[_0x148d86['destuniqueid']][_0x9b46('0x17')]=_0x9b46('0x36');writeDB(agents[_0x148d86[_0x9b46('0x14')]]);}}catch(_0x47a938){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x47a938);}};exports[_0x9b46('0x37')]=function(_0x566bad){try{if(!_[_0x9b46('0x1b')](agents[_0x566bad[_0x9b46('0x38')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x566bad);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x3a'),_0x566bad[_0x9b46('0x5')],agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x7')],agents[_0x566bad[_0x9b46('0x38')]]['uniqueid']));agents[_0x566bad[_0x9b46('0x38')]]['transfer']=!![];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3b')]=_0x9b46('0x3c');agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3d')]=_0x566bad['extension'];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3e')]=agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x5')];}}catch(_0x3f6b2f){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x3f6b2f);}};exports[_0x9b46('0x3f')]=function(_0x2f411f){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f[_0x9b46('0x40')]),_0x2f411f);if(_0x2f411f['origtransfereruniqueid']==_0x2f411f[_0x9b46('0x41')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x42')]])){utils['info'](util[_0x9b46('0x4')](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x7')]));agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x44')]=!![];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3b')]=_0x9b46('0x45');agents[_0x2f411f[_0x9b46('0x42')]]['transferexten']=_0x2f411f['origtransfererexten'];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x40')];}if(_0x2f411f[_0x9b46('0x46')]&&agents[_0x2f411f[_0x9b46('0x46')]]){agents[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x47')]=0x1;transfers[_0x2f411f[_0x9b46('0x46')]]=_['clone'](agents[_0x2f411f[_0x9b46('0x46')]]);transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x48')]=agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x49')];transfers[_0x2f411f[_0x9b46('0x46')]]['agentcalledAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f['transfereeuniqueid']][_0x9b46('0x47')]=0x2;}}else if(_0x2f411f['secondtransfereruniqueid']==_0x2f411f[_0x9b46('0x4a')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x40')]])){utils[_0x9b46('0x3')](util['format'](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x7')]));agents[_0x2f411f[_0x9b46('0x40')]]['transfer']=!![];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3b')]='ATTENDED';agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x3d')]=_0x2f411f[_0x9b46('0x4b')];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x42')];}if(_0x2f411f[_0x9b46('0x4c')]&&agents[_0x2f411f[_0x9b46('0x4c')]]){agents[_0x2f411f[_0x9b46('0x4c')]]['agententerreason']=0x1;transfers[_0x2f411f['transfertargetuniqueid']]=_[_0x9b46('0x4d')](agents[_0x2f411f[_0x9b46('0x4c')]]);transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x48')]=agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x49')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]]['agentconnectAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x47')]=0x2;}}}catch(_0x4e8756){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f['origtransfereruniqueid']),_0x4e8756);}};exports[_0x9b46('0x4e')]=function(_0x200607){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x200607);if(agents[_0x200607[_0x9b46('0x5')]]&&agents[_0x200607[_0x9b46('0x5')]]['reason']===_0x9b46('0x1e')){if(_0x200607[_0x9b46('0x50')]==='21'){agents[_0x200607['uniqueid']][_0x9b46('0x28')]='rejected';agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x51');}utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]]['membername'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']]['lastevent']));writeDB(agents[_0x200607['uniqueid']]);var _0x2978aa=unanswered['indexOf'](_0x200607['uniqueid']);if(_0x2978aa>-0x1){unanswered[_0x9b46('0x52')](_0x2978aa,0x1);}}if(transfers[_0x200607[_0x9b46('0x5')]]){transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];transfers[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();transfers[_0x200607[_0x9b46('0x5')]]['talktime']=utils['diffTime'](transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x35')],transfers[_0x200607[_0x9b46('0x5')]]['agentconnectAt']);transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')]='agent';transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x36');utils[_0x9b46('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607[_0x9b46('0x5')],transfers[_0x200607['uniqueid']][_0x9b46('0x7')],transfers[_0x200607[_0x9b46('0x5')]]['reason'],transfers[_0x200607['uniqueid']]['lastevent']));writeDB(transfers[_0x200607[_0x9b46('0x5')]],!![]);}if(agents[_0x200607['uniqueid']]&&agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x2d')]){agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];agents[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x21')]=utils[_0x9b46('0x53')](agents[_0x200607['uniqueid']][_0x9b46('0x35')],agents[_0x200607['uniqueid']][_0x9b46('0x2d')]);agents[_0x200607[_0x9b46('0x5')]]['reason']=agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x44')]?_0x9b46('0x44'):_0x9b46('0x54');agents[_0x200607['uniqueid']][_0x9b46('0x17')]='complete';utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x55'),_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x7')],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']][_0x9b46('0x17')]));writeDB(agents[_0x200607['uniqueid']]);}}catch(_0x420d61){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x420d61);}}; \ No newline at end of file +var _0xa902=['agentringnoanswerAt','now','timeout','holdtime','ringtime','push','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','format','channel','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','lastevent','called','connectedlinename','info','uniqueid','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x28c0d4,_0x2ff715){var _0x3ca974=function(_0x592acc){while(--_0x592acc){_0x28c0d4['push'](_0x28c0d4['shift']());}};_0x3ca974(++_0x2ff715);}(_0xa902,0x8d));var _0x2a90=function(_0x2ddc49,_0x2bdf4b){_0x2ddc49=_0x2ddc49-0x0;var _0x1acb04=_0xa902[_0x2ddc49];return _0x1acb04;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var utils=require(_0x2a90('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1839,_0x1b4117){utils['info'](util[_0x2a90('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1839['uniqueid'],_0x3a1839[_0x2a90('0x4')],_0x3a1839[_0x2a90('0x5')],_0x3a1839[_0x2a90('0x6')],_0x3a1839[_0x2a90('0x7')],_0x3a1839[_0x2a90('0x8')],_0x3a1839[_0x2a90('0x9')],_0x3a1839['lastevent']));if(_0x3a1839[_0x2a90('0x5')]){utils['getVoiceQueueByName'](_0x3a1839['queue'])[_0x2a90('0xa')](function(_0x3dfc8f){if(_0x3dfc8f){_0x3a1839[_0x2a90('0xb')]=_0x3dfc8f[_0x2a90('0xb')];_0x3a1839[_0x2a90('0xc')]=_0x3a1839['agentcomplete']?_0x3dfc8f[_0x2a90('0xd')]:![];_0x3a1839[_0x2a90('0xe')]=_0x3a1839[_0x2a90('0xc')]?_0x3dfc8f[_0x2a90('0xf')]:0x0;}utils['request'](_0x2a90('0x10'),_0x3a1839);});}else{utils['request'](_0x2a90('0x10'),_0x3a1839);}if(_0x1b4117){delete transfers[_0x3a1839['uniqueid']];}else{delete agents[_0x3a1839[_0x2a90('0x11')]];}}exports['agentcalled']=function(_0x407ce5){try{utils[_0x2a90('0x12')](util[_0x2a90('0x3')]('[%s][agents][agentcalled]',_0x407ce5['uniqueid']),_0x407ce5);agents[_0x407ce5['destuniqueid']]=_0x407ce5;agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x13')]=utils['now']();agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x15');agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x9')]=null;agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x16')]=null;utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x407ce5[_0x2a90('0x18')],agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x6')],_0x407ce5['destuniqueid']));}catch(_0x1facfb){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x1a'),_0x407ce5[_0x2a90('0x18')]),_0x1facfb);}};exports[_0x2a90('0x1b')]=function(_0x312cd5){try{if(!_[_0x2a90('0x1c')](agents[_0x312cd5[_0x2a90('0x11')]])){utils[_0x2a90('0x12')](util[_0x2a90('0x3')](_0x2a90('0x1d'),_0x312cd5['uniqueid']),_0x312cd5);utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x1e'),_0x312cd5[_0x2a90('0x18')],agents[_0x312cd5['destuniqueid']][_0x2a90('0x6')],_0x312cd5[_0x2a90('0x11')]));agents[_0x312cd5['destuniqueid']][_0x2a90('0x1b')]=!![];agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x21');agents[_0x312cd5[_0x2a90('0x11')]]['reason']=_0x2a90('0x21');agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x22')]=_0x312cd5[_0x2a90('0x23')]?parseInt(_0x312cd5[_0x2a90('0x23')])/0x3e8:0x0;agents[_0x312cd5['destuniqueid']]['talktime']=0x0;unanswered[_0x2a90('0x24')](_0x312cd5['destuniqueid']);}}catch(_0x53391e){utils['error'](util[_0x2a90('0x3')](_0x2a90('0x1d'),_0x312cd5['uniqueid']),_0x53391e);}};exports['queuecallerabandon']=function(_0x1add9a){try{_['forIn'](agents,function(_0x35570e,_0x6892e1){if(_0x35570e[_0x2a90('0x18')]==_0x1add9a[_0x2a90('0x18')]&&!_[_0x2a90('0x25')](unanswered,_0x35570e[_0x2a90('0x11')])){utils[_0x2a90('0x12')](util['format'](_0x2a90('0x26'),_0x1add9a[_0x2a90('0x18')]),_0x1add9a);utils[_0x2a90('0x17')](util['format'](_0x2a90('0x27'),_0x1add9a[_0x2a90('0x18')],_0x35570e[_0x2a90('0x6')],_0x35570e[_0x2a90('0x11')]));_0x35570e['agentringnoanswer']=!![];_0x35570e[_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();_0x35570e[_0x2a90('0x14')]=_0x2a90('0x28');_0x35570e[_0x2a90('0x29')]=_0x2a90('0x28');_0x35570e['holdtime']=_0x1add9a[_0x2a90('0x22')];_0x35570e[_0x2a90('0x2a')]=0x0;writeDB(_0x35570e);}});}catch(_0x1bdebf){utils[_0x2a90('0x19')](util['format'](_0x2a90('0x26'),_0x1add9a[_0x2a90('0x18')]),_0x1bdebf);}};exports['agentconnect']=function(_0x3e5002){try{if(agents[_0x3e5002[_0x2a90('0x11')]]){utils['debug'](util['format'](_0x2a90('0x2b'),_0x3e5002[_0x2a90('0x18')]),_0x3e5002);utils[_0x2a90('0x17')](util['format'](_0x2a90('0x2c'),_0x3e5002['uniqueid'],agents[_0x3e5002[_0x2a90('0x11')]]['membername'],_0x3e5002[_0x2a90('0x11')]));agents[_0x3e5002['destuniqueid']]['agentconnectAt']=utils[_0x2a90('0x20')]();agents[_0x3e5002['destuniqueid']][_0x2a90('0x9')]=_0x3e5002[_0x2a90('0x9')];agents[_0x3e5002[_0x2a90('0x11')]]['connectedlinename']=_0x3e5002[_0x2a90('0x16')];agents[_0x3e5002[_0x2a90('0x11')]][_0x2a90('0x22')]=_0x3e5002['ringtime'];agents[_0x3e5002[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x2d');_['forIn'](agents,function(_0x1aa096,_0x1db9d8){if(_0x1aa096['destuniqueid']!=_0x3e5002[_0x2a90('0x11')]&&_0x1aa096[_0x2a90('0x18')]==_0x3e5002[_0x2a90('0x18')]){_0x1aa096[_0x2a90('0x2a')]=0x0;_0x1aa096[_0x2a90('0x22')]=_0x3e5002[_0x2a90('0x23')];_0x1aa096[_0x2a90('0x1b')]=!![];_0x1aa096[_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();_0x1aa096[_0x2a90('0x14')]=_0x2a90('0x2e');_0x1aa096[_0x2a90('0x29')]=_0x2a90('0x2e');_0x1aa096[_0x2a90('0x2f')]=_0x3e5002['destuniqueid'];_0x1aa096[_0x2a90('0x30')]=_0x3e5002[_0x2a90('0x6')];writeDB(_0x1aa096);}});}}catch(_0x528b41){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x2b'),_0x3e5002[_0x2a90('0x18')]),_0x528b41);}};exports[_0x2a90('0x31')]=function(_0x54b290){try{if(!_[_0x2a90('0x1c')](agents[_0x54b290['destuniqueid']])){utils[_0x2a90('0x12')](util['format'](_0x2a90('0x32'),_0x54b290[_0x2a90('0x18')]),_0x54b290);utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x33'),_0x54b290[_0x2a90('0x18')],agents[_0x54b290[_0x2a90('0x11')]]['membername'],_0x54b290['destuniqueid']));agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x31')]=!![];agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x34')]=utils[_0x2a90('0x20')]();agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x2a')]=utils[_0x2a90('0x35')](agents[_0x54b290['destuniqueid']][_0x2a90('0x34')],agents[_0x54b290['destuniqueid']][_0x2a90('0x36')]);agents[_0x54b290[_0x2a90('0x11')]]['reason']=_0x54b290[_0x2a90('0x29')];agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x37');writeDB(agents[_0x54b290[_0x2a90('0x11')]]);}}catch(_0x43a931){utils[_0x2a90('0x19')](util['format']('[%s][agents][agentcomplete]',_0x54b290[_0x2a90('0x18')]),_0x43a931);}};exports[_0x2a90('0x38')]=function(_0x42c890){try{if(!_[_0x2a90('0x1c')](agents[_0x42c890[_0x2a90('0x39')]])){utils['debug'](util['format'](_0x2a90('0x3a'),_0x42c890[_0x2a90('0x18')]),_0x42c890);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x42c890[_0x2a90('0x18')],agents[_0x42c890['transfereruniqueid']][_0x2a90('0x6')],agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x18')]));agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x3b')]=!![];agents[_0x42c890[_0x2a90('0x39')]]['transfertype']=_0x2a90('0x3c');agents[_0x42c890[_0x2a90('0x39')]]['transferexten']=_0x42c890[_0x2a90('0x3d')];agents[_0x42c890['transfereruniqueid']]['transferuniqueid']=agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x18')];}}catch(_0x5819ab){utils['error'](util[_0x2a90('0x3')]('[%s][agents][blindtransfer]',_0x42c890[_0x2a90('0x18')]),_0x5819ab);}};exports[_0x2a90('0x3e')]=function(_0x561bae){try{utils[_0x2a90('0x12')](util[_0x2a90('0x3')](_0x2a90('0x3f'),_0x561bae['origtransfereruniqueid']),_0x561bae);if(_0x561bae[_0x2a90('0x40')]==_0x561bae[_0x2a90('0x41')]){if(!_['isNil'](agents[_0x561bae['secondtransfereruniqueid']])){utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x561bae[_0x2a90('0x40')],agents[_0x561bae['secondtransfereruniqueid']][_0x2a90('0x6')]));agents[_0x561bae['secondtransfereruniqueid']][_0x2a90('0x3b')]=!![];agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x43')]='ATTENDED';agents[_0x561bae['secondtransfereruniqueid']]['transferexten']=_0x561bae[_0x2a90('0x44')];agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x45')]=_0x561bae[_0x2a90('0x40')];}if(_0x561bae[_0x2a90('0x46')]&&agents[_0x561bae[_0x2a90('0x46')]]){agents[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x47')]=0x1;transfers[_0x561bae[_0x2a90('0x46')]]=_[_0x2a90('0x48')](agents[_0x561bae[_0x2a90('0x46')]]);transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x8')]=agents[_0x561bae['secondtransfereruniqueid']]['calleridnum'];transfers[_0x561bae['transfereeuniqueid']][_0x2a90('0x49')]=agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x49')];transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x13')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x36')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x22')]=0x0;transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x47')]=0x2;}}else if(_0x561bae[_0x2a90('0x42')]==_0x561bae[_0x2a90('0x4a')]){if(!_[_0x2a90('0x1c')](agents[_0x561bae['origtransfereruniqueid']])){utils[_0x2a90('0x17')](util['format'](_0x2a90('0x4b'),_0x561bae[_0x2a90('0x40')],agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x6')]));agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x3b')]=!![];agents[_0x561bae[_0x2a90('0x40')]]['transfertype']=_0x2a90('0x4c');agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x4d')]=_0x561bae['secondtransfererexten'];agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x45')]=_0x561bae[_0x2a90('0x42')];}if(_0x561bae[_0x2a90('0x4e')]&&agents[_0x561bae['transfertargetuniqueid']]){agents[_0x561bae[_0x2a90('0x4e')]]['agententerreason']=0x1;transfers[_0x561bae[_0x2a90('0x4e')]]=_[_0x2a90('0x48')](agents[_0x561bae[_0x2a90('0x4e')]]);transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x8')]=agents[_0x561bae[_0x2a90('0x40')]]['calleridnum'];transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x49')]=agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x49')];transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x13')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x36')]=utils['now']();transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x22')]=0x0;transfers[_0x561bae[_0x2a90('0x4e')]]['agententerreason']=0x2;}}}catch(_0x4404c1){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x3f'),_0x561bae[_0x2a90('0x40')]),_0x4404c1);}};exports['hangup']=function(_0x1bf94c){try{utils['debug'](util['format'](_0x2a90('0x4f'),_0x1bf94c['uniqueid']),_0x1bf94c);if(agents[_0x1bf94c['uniqueid']]&&agents[_0x1bf94c[_0x2a90('0x18')]]['reason']===_0x2a90('0x21')){if(_0x1bf94c[_0x2a90('0x50')]==='21'){agents[_0x1bf94c['uniqueid']]['reason']=_0x2a90('0x51');agents[_0x1bf94c['uniqueid']]['lastevent']=_0x2a90('0x51');}utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x52'),_0x1bf94c['uniqueid'],agents[_0x1bf94c['uniqueid']][_0x2a90('0x6')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]));writeDB(agents[_0x1bf94c[_0x2a90('0x18')]]);var _0x3f4d12=unanswered[_0x2a90('0x53')](_0x1bf94c[_0x2a90('0x18')]);if(_0x3f4d12>-0x1){unanswered[_0x2a90('0x54')](_0x3f4d12,0x1);}}if(transfers[_0x1bf94c[_0x2a90('0x18')]]){transfers[_0x1bf94c[_0x2a90('0x18')]]['agentcomplete']=!![];transfers[_0x1bf94c[_0x2a90('0x18')]]['agentcompleteAt']=utils[_0x2a90('0x20')]();transfers[_0x1bf94c['uniqueid']][_0x2a90('0x2a')]=utils['diffTime'](transfers[_0x1bf94c['uniqueid']][_0x2a90('0x34')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]);transfers[_0x1bf94c[_0x2a90('0x18')]]['reason']='agent';transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]=_0x2a90('0x37');utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x52'),_0x1bf94c[_0x2a90('0x18')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x6')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],transfers[_0x1bf94c[_0x2a90('0x18')]]['lastevent']));writeDB(transfers[_0x1bf94c[_0x2a90('0x18')]],!![]);}if(agents[_0x1bf94c[_0x2a90('0x18')]]&&agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]){agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x31')]=!![];agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x34')]=utils['now']();agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x2a')]=utils['diffTime'](agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x34')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]);agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')]=agents[_0x1bf94c['uniqueid']][_0x2a90('0x3b')]?_0x2a90('0x3b'):_0x2a90('0x55');agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]=_0x2a90('0x37');utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf94c[_0x2a90('0x18')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x6')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],agents[_0x1bf94c[_0x2a90('0x18')]]['lastevent']));writeDB(agents[_0x1bf94c[_0x2a90('0x18')]]);}}catch(_0x44ce8d){utils[_0x2a90('0x19')](util['format'](_0x2a90('0x4f'),_0x1bf94c[_0x2a90('0x18')]),_0x44ce8d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 87bad5d..1ae6b25 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 _0x6288=['disposition','toNumber','error','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','endtime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','_attended','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','toLowerCase','lastdata','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','calleridnum','connectedlinenum','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','channel','answertime'];(function(_0x2b4b73,_0x595be9){var _0x5f1b72=function(_0x4057a2){while(--_0x4057a2){_0x2b4b73['push'](_0x2b4b73['shift']());}};_0x5f1b72(++_0x595be9);}(_0x6288,0x1e0));var _0x8628=function(_0x4a13db,_0x912364){_0x4a13db=_0x4a13db-0x0;var _0x3bdc9e=_0x6288[_0x4a13db];return _0x3bdc9e;};'use strict';var _=require('lodash');var util=require(_0x8628('0x0'));var utils=require(_0x8628('0x1'));var transfers=require(_0x8628('0x2'));var dispositions=[_0x8628('0x3'),_0x8628('0x4'),'FAILED','NO\x20ANSWER',_0x8628('0x3'),_0x8628('0x3'),_0x8628('0x5'),'BUSY','FAILED',_0x8628('0x4'),_0x8628('0x4')];var channels={};function writeDB(_0x4e6f3d){var _0x28cfcb;if(transfers[_0x8628('0x6')][_0x4e6f3d['uniqueid']]){_0x28cfcb=_0x4e6f3d[_0x8628('0x7')];_0x4e6f3d[_0x8628('0x7')]=transfers[_0x8628('0x6')][_0x4e6f3d['uniqueid']][_0x8628('0x8')];}utils[_0x8628('0x9')](util['format'](_0x8628('0xa'),_0x4e6f3d[_0x8628('0x7')],_0x4e6f3d['channel'],_0x4e6f3d[_0x8628('0xb')],_0x4e6f3d[_0x8628('0xc')],_0x4e6f3d['interface'],_0x4e6f3d[_0x8628('0xd')],_0x4e6f3d[_0x8628('0xe')],_0x4e6f3d['lastevent']));if(_0x4e6f3d[_0x8628('0xf')]){utils['getUserByInternal'](_0x4e6f3d[_0x8628('0xf')])[_0x8628('0x10')](function(_0x48da26){if(_0x48da26){_0x4e6f3d['UserId']=_0x48da26['id'];}utils[_0x8628('0x11')](_0x8628('0x12'),_0x4e6f3d);});}else{utils[_0x8628('0x11')](_0x8628('0x12'),_0x4e6f3d);}if(channels[_0x4e6f3d['uniqueid']]){delete channels[_0x4e6f3d['uniqueid']];}else if(_0x28cfcb&&channels[_0x28cfcb]){delete transfers[_0x8628('0x6')][_0x28cfcb];delete channels[_0x28cfcb];}}exports[_0x8628('0x13')]=function(_0x3d702f){try{utils[_0x8628('0x14')](util[_0x8628('0x15')](_0x8628('0x16'),_0x3d702f[_0x8628('0x7')]),_0x3d702f);if(_0x3d702f[_0x8628('0x7')]==_0x3d702f[_0x8628('0x17')]&&_0x3d702f['channel']!=_0x8628('0x18')){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x19'),_0x3d702f['uniqueid'],_0x3d702f['context'],_0x3d702f['exten']));channels[_0x3d702f[_0x8628('0x7')]]={'uniqueid':_0x3d702f[_0x8628('0x7')],'accountcode':_0x3d702f['accountcode'],'source':_0x3d702f['calleridnum'],'destination':_0x3d702f[_0x8628('0x1a')],'destinationcontext':_0x3d702f[_0x8628('0x1b')],'channel':_0x3d702f['channel'],'starttime':utils[_0x8628('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x8b449){utils['error'](util[_0x8628('0x15')](_0x8628('0x16'),_0x3d702f[_0x8628('0x7')]),_0x8b449);}};exports[_0x8628('0x1d')]=function(_0x338935){try{utils[_0x8628('0x14')](util[_0x8628('0x15')](_0x8628('0x1e'),_0x338935[_0x8628('0x7')]),_0x338935);if(!_[_0x8628('0x1f')](channels[_0x338935[_0x8628('0x7')]])&&_0x338935[_0x8628('0x20')]==0x6){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x21'),_0x338935[_0x8628('0x7')],_0x338935[_0x8628('0x1b')],_0x338935['channel']));if(_['isNil'](channels[_0x338935['uniqueid']][_0x8628('0x22')])){channels[_0x338935[_0x8628('0x7')]]['systemanswertime']=utils[_0x8628('0x1c')]();}}else if(!_[_0x8628('0x1f')](channels[_0x338935[_0x8628('0x17')]])&&_0x338935[_0x8628('0x20')]==0x6&&_0x338935[_0x8628('0x1b')]!=_0x8628('0x23')){utils['info'](util[_0x8628('0x15')](_0x8628('0x24'),_0x338935['uniqueid'],_0x338935[_0x8628('0x17')],_0x338935['context'],_0x338935['channel']));channels[_0x338935['linkedid']][_0x8628('0xf')]=_0x338935['accountcode'];channels[_0x338935[_0x8628('0x17')]][_0x8628('0x25')]=_0x338935[_0x8628('0x26')];if(_['isNil'](channels[_0x338935[_0x8628('0x17')]][_0x8628('0x27')])){channels[_0x338935['linkedid']][_0x8628('0x27')]=utils[_0x8628('0x1c')]();}channels[_0x338935[_0x8628('0x17')]][_0x8628('0x28')]=dispositions[_[_0x8628('0x29')](_0x338935[_0x8628('0x20')])]||_0x8628('0x5');}}catch(_0x5d5577){utils[_0x8628('0x2a')](util[_0x8628('0x15')](_0x8628('0x1e'),_0x338935[_0x8628('0x7')]),_0x5d5577);}};exports['hangup']=function(_0x17cc7f){try{if(!_[_0x8628('0x1f')](channels[_0x17cc7f[_0x8628('0x7')]])){utils['debug'](util[_0x8628('0x15')](_0x8628('0x2b'),_0x17cc7f['uniqueid']),_0x17cc7f);if(_[_0x8628('0x1f')](channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x2c')])){channels[_0x17cc7f['uniqueid']][_0x8628('0x2c')]=_0x17cc7f['calleridname']+'\x20<'+_0x17cc7f[_0x8628('0xd')]+'>';}utils['info'](util['format'](_0x8628('0x2d'),_0x17cc7f['uniqueid'],channels[_0x17cc7f[_0x8628('0x7')]]['callerid'],_0x17cc7f['cause-txt']));channels[_0x17cc7f[_0x8628('0x7')]]['endtime']=utils[_0x8628('0x1c')]();channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x2e')]=utils[_0x8628('0x2f')](channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x30')],channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x31')]);channels[_0x17cc7f[_0x8628('0x7')]]['billableseconds']=channels[_0x17cc7f['uniqueid']][_0x8628('0x27')]?utils[_0x8628('0x2f')](channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x30')],channels[_0x17cc7f[_0x8628('0x7')]][_0x8628('0x27')]):0x0;writeDB(channels[_0x17cc7f[_0x8628('0x7')]]);}}catch(_0xdecb5b){utils[_0x8628('0x2a')](util[_0x8628('0x15')](_0x8628('0x2b'),_0x17cc7f[_0x8628('0x7')]),_0xdecb5b);}};exports[_0x8628('0x32')]=function(_0x7939d){try{if(!_[_0x8628('0x1f')](channels[_0x7939d[_0x8628('0x33')]])){utils[_0x8628('0x14')](util[_0x8628('0x15')](_0x8628('0x34'),_0x7939d[_0x8628('0x35')]),_0x7939d);if(channels[_0x7939d[_0x8628('0x33')]][_0x8628('0x26')]==_0x7939d['transfereechannel']){utils['info'](util[_0x8628('0x15')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x7939d[_0x8628('0x35')],_0x7939d[_0x8628('0x33')],_0x7939d['secondtransfererchannel']));channels[_0x7939d[_0x8628('0x33')]]['destinationchannel']=_0x7939d[_0x8628('0x36')];channels[_0x7939d[_0x8628('0x33')]]['userfield']=_0x8628('0x37');}else if(channels[_0x7939d[_0x8628('0x33')]][_0x8628('0x26')]=_0x7939d['transfertargetchannel']){utils['info'](util[_0x8628('0x15')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x7939d[_0x8628('0x35')],_0x7939d[_0x8628('0x33')],_0x7939d[_0x8628('0x38')]));channels[_0x7939d[_0x8628('0x33')]][_0x8628('0x25')]=_0x7939d[_0x8628('0x38')];channels[_0x7939d['localtwolinkedid']][_0x8628('0x39')]=_0x8628('0x37');}}}catch(_0x5686c6){utils[_0x8628('0x2a')](util['format']('[%s][calls][attendedtransfer]',_0x7939d[_0x8628('0x35')]),_0x5686c6);}};exports[_0x8628('0x3a')]=function(_0x1a0e72){try{if(!_[_0x8628('0x1f')](channels[_0x1a0e72['uniqueid']])){utils['debug'](util[_0x8628('0x15')](_0x8628('0x3b'),_0x1a0e72['uniqueid']),_0x1a0e72);channels[_0x1a0e72[_0x8628('0x7')]][_0x8628('0x3c')]=utils[_0x8628('0x1c')]();utils[_0x8628('0x9')](util[_0x8628('0x15')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1a0e72['uniqueid'],channels[_0x1a0e72[_0x8628('0x7')]][_0x8628('0x3c')]));}}catch(_0x4fa0d1){utils[_0x8628('0x2a')](util['format']('[%s][calls][musiconholdstart]',_0x1a0e72[_0x8628('0x7')]),_0x4fa0d1);}};exports[_0x8628('0x3d')]=function(_0x4fe147){try{if(!_[_0x8628('0x1f')](channels[_0x4fe147[_0x8628('0x7')]])){utils[_0x8628('0x14')](util['format'](_0x8628('0x3e'),_0x4fe147[_0x8628('0x7')]),_0x4fe147);if(!_['isNil'](channels[_0x4fe147[_0x8628('0x7')]][_0x8628('0x3c')])){channels[_0x4fe147[_0x8628('0x7')]][_0x8628('0x3f')]+=utils[_0x8628('0x2f')](utils[_0x8628('0x1c')](),channels[_0x4fe147[_0x8628('0x7')]]['musiconholdstartAt']);utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x40'),_0x4fe147['uniqueid'],channels[_0x4fe147[_0x8628('0x7')]][_0x8628('0x3f')]));delete channels[_0x4fe147[_0x8628('0x7')]]['musiconholdstartAt'];}}}catch(_0x5cfa54){utils[_0x8628('0x2a')](util['format'](_0x8628('0x3e'),_0x4fe147['uniqueid']),_0x5cfa54);}};exports[_0x8628('0x41')]=function(_0x2abe80){try{if(!_[_0x8628('0x1f')](channels[_0x2abe80[_0x8628('0x7')]])){utils[_0x8628('0x14')](util[_0x8628('0x15')](_0x8628('0x42'),_0x2abe80[_0x8628('0x7')]),_0x2abe80);if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')][_0x8628('0x44')])){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x45'),_0x2abe80['uniqueid'],_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x47')]=_0x2abe80['value'];}if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')]['xmd-phone'])){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x48'),_0x2abe80['uniqueid'],_0x2abe80['value']));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x49')]=_0x2abe80[_0x8628('0x46')];channels[_0x2abe80['uniqueid']][_0x8628('0x2c')]='\x22'+_0x2abe80[_0x8628('0x46')]+'\x22\x20<'+_0x2abe80[_0x8628('0x46')]+'>';}if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')]['xmd-callerid-preview'])||!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')]['xmd-callerid'])){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x4a'),_0x2abe80[_0x8628('0x7')],!_[_0x8628('0x1f')](_0x2abe80['variable'][_0x8628('0x4b')])?_0x8628('0x4b'):_0x8628('0x4c'),_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x2c')]=_0x2abe80[_0x8628('0x46')];}if(!_[_0x8628('0x1f')](_0x2abe80['variable'][_0x8628('0x4d')])||!_[_0x8628('0x1f')](_0x2abe80['variable']['xmcs-queue'])){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x4a'),_0x2abe80['uniqueid'],!_['isNil'](_0x2abe80[_0x8628('0x43')][_0x8628('0x4d')])?_0x8628('0x4d'):'xmcs-queue',_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x4e')]=_0x8628('0x4f');channels[_0x2abe80[_0x8628('0x7')]]['lastdata']=_0x2abe80[_0x8628('0x46')];channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0xb')]=!![];}if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')]['xmd-contactid'])){utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x50'),_0x2abe80[_0x8628('0x7')],_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80['uniqueid']][_0x8628('0x51')]=_0x2abe80['value'];}if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')][_0x8628('0x52')])){utils[_0x8628('0x9')](util[_0x8628('0x15')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2abe80[_0x8628('0x7')],_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x53')]=_0x2abe80[_0x8628('0x46')];}if(!_[_0x8628('0x1f')](_0x2abe80['variable'][_0x8628('0x54')])){utils[_0x8628('0x9')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2abe80[_0x8628('0x7')],_0x2abe80[_0x8628('0x46')]));channels[_0x2abe80['uniqueid']]['routeid']=_0x2abe80[_0x8628('0x46')];}if(!_[_0x8628('0x1f')](_0x2abe80[_0x8628('0x43')][_0x8628('0x55')])){utils['info'](util['format'](_0x8628('0x56'),_0x2abe80[_0x8628('0x7')],_0x2abe80['value']));channels[_0x2abe80[_0x8628('0x7')]][_0x8628('0x55')]=_0x2abe80[_0x8628('0x46')];}}}catch(_0x11681f){utils[_0x8628('0x2a')](util[_0x8628('0x15')](_0x8628('0x42'),_0x2abe80['uniqueid']),_0x11681f);}};exports[_0x8628('0x57')]=function(_0x516c14){try{if(!_['isNil'](channels[_0x516c14['uniqueid']])){utils[_0x8628('0x14')](util[_0x8628('0x15')](_0x8628('0x58'),_0x516c14[_0x8628('0x7')]),_0x516c14);utils[_0x8628('0x9')](util[_0x8628('0x15')](_0x8628('0x59'),_0x516c14[_0x8628('0x7')],_0x516c14['application'],_0x516c14[_0x8628('0x5a')]));if(_0x516c14[_0x8628('0x5b')]['toLowerCase']()==_0x8628('0x5c')&&_[_0x8628('0x5d')](_0x516c14[_0x8628('0x5a')]['toLowerCase'](),_0x8628('0x5e'))){var _0xcf4b79=_0x516c14[_0x8628('0x5a')][_0x8628('0x5f')]('=');var _0x298034=_0xcf4b79[0x0][_0x8628('0x60')](_0xcf4b79[0x0][_0x8628('0x61')]('(')+0x1,_0xcf4b79[0x0][_0x8628('0x61')](')'));var _0x5844ed=_0xcf4b79[0x1];channels[_0x516c14[_0x8628('0x7')]][_0x298034]=_0x5844ed;}if(!_[_0x8628('0x62')]([_0x8628('0x63'),_0x8628('0x64'),_0x8628('0x65'),'set','gotoif'],_0x516c14[_0x8628('0x5b')][_0x8628('0x66')]())){channels[_0x516c14[_0x8628('0x7')]][_0x8628('0x4e')]=_0x516c14[_0x8628('0x5b')];channels[_0x516c14[_0x8628('0x7')]][_0x8628('0x67')]=_0x516c14[_0x8628('0x5a')];}}}catch(_0x3427f4){utils['error'](util[_0x8628('0x15')](_0x8628('0x58'),_0x516c14[_0x8628('0x7')]),_0x3427f4);}}; \ No newline at end of file +var _0x1caa=['source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','xmd-contactid','ContactId','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','noop','gotoif','lastdata','util','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','context','exten','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','destinationchannel','answertime','toNumber','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value'];(function(_0x130abd,_0x38fc96){var _0x2c874a=function(_0x1aa437){while(--_0x1aa437){_0x130abd['push'](_0x130abd['shift']());}};_0x2c874a(++_0x38fc96);}(_0x1caa,0x1c8));var _0xa1ca=function(_0x5e818f,_0x557b9e){_0x5e818f=_0x5e818f-0x0;var _0x353676=_0x1caa[_0x5e818f];return _0x353676;};'use strict';var _=require('lodash');var util=require(_0xa1ca('0x0'));var utils=require('./utils');var transfers=require(_0xa1ca('0x1'));var dispositions=[_0xa1ca('0x2'),_0xa1ca('0x3'),'FAILED',_0xa1ca('0x2'),_0xa1ca('0x2'),_0xa1ca('0x2'),'ANSWERED',_0xa1ca('0x4'),'FAILED',_0xa1ca('0x3'),_0xa1ca('0x3')];var channels={};function writeDB(_0x3f734b){var _0xded889;if(transfers['blinds'][_0x3f734b[_0xa1ca('0x5')]]){_0xded889=_0x3f734b[_0xa1ca('0x5')];_0x3f734b[_0xa1ca('0x5')]=transfers[_0xa1ca('0x6')][_0x3f734b[_0xa1ca('0x5')]][_0xa1ca('0x7')];}utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x9'),_0x3f734b[_0xa1ca('0x5')],_0x3f734b[_0xa1ca('0xa')],_0x3f734b[_0xa1ca('0xb')],_0x3f734b['membername'],_0x3f734b[_0xa1ca('0xc')],_0x3f734b[_0xa1ca('0xd')],_0x3f734b[_0xa1ca('0xe')],_0x3f734b[_0xa1ca('0xf')]));if(_0x3f734b['accountcode']){utils['getUserByInternal'](_0x3f734b[_0xa1ca('0x10')])[_0xa1ca('0x11')](function(_0x30d86c){if(_0x30d86c){_0x3f734b[_0xa1ca('0x12')]=_0x30d86c['id'];}utils[_0xa1ca('0x13')](_0xa1ca('0x14'),_0x3f734b);});}else{utils[_0xa1ca('0x13')](_0xa1ca('0x14'),_0x3f734b);}if(channels[_0x3f734b[_0xa1ca('0x5')]]){delete channels[_0x3f734b['uniqueid']];}else if(_0xded889&&channels[_0xded889]){delete transfers[_0xa1ca('0x6')][_0xded889];delete channels[_0xded889];}}exports[_0xa1ca('0x15')]=function(_0x10dff3){try{utils[_0xa1ca('0x16')](util['format'](_0xa1ca('0x17'),_0x10dff3[_0xa1ca('0x5')]),_0x10dff3);if(_0x10dff3[_0xa1ca('0x5')]==_0x10dff3['linkedid']&&_0x10dff3[_0xa1ca('0xa')]!=_0xa1ca('0x18')){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x10dff3[_0xa1ca('0x5')],_0x10dff3[_0xa1ca('0x1a')],_0x10dff3[_0xa1ca('0x1b')]));channels[_0x10dff3[_0xa1ca('0x5')]]={'uniqueid':_0x10dff3[_0xa1ca('0x5')],'accountcode':_0x10dff3['accountcode'],'source':_0x10dff3['calleridnum'],'destination':_0x10dff3[_0xa1ca('0x1b')],'destinationcontext':_0x10dff3[_0xa1ca('0x1a')],'channel':_0x10dff3['channel'],'starttime':utils[_0xa1ca('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xa1ca('0x1d')};}}catch(_0x10efef){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x17'),_0x10dff3[_0xa1ca('0x5')]),_0x10efef);}};exports[_0xa1ca('0x1f')]=function(_0x127d7a){try{utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')]('[%s][calls][newstate]',_0x127d7a['uniqueid']),_0x127d7a);if(!_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x5')]])&&_0x127d7a[_0xa1ca('0x21')]==0x6){utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x22'),_0x127d7a[_0xa1ca('0x5')],_0x127d7a[_0xa1ca('0x1a')],_0x127d7a[_0xa1ca('0xa')]));if(_[_0xa1ca('0x20')](channels[_0x127d7a['uniqueid']]['systemanswertime'])){channels[_0x127d7a[_0xa1ca('0x5')]][_0xa1ca('0x23')]=utils[_0xa1ca('0x1c')]();}}else if(!_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x24')]])&&_0x127d7a[_0xa1ca('0x21')]==0x6&&_0x127d7a[_0xa1ca('0x1a')]!=_0xa1ca('0x25')){utils['info'](util[_0xa1ca('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x127d7a['uniqueid'],_0x127d7a[_0xa1ca('0x24')],_0x127d7a[_0xa1ca('0x1a')],_0x127d7a['channel']));channels[_0x127d7a[_0xa1ca('0x24')]]['accountcode']=_0x127d7a[_0xa1ca('0x10')];channels[_0x127d7a['linkedid']][_0xa1ca('0x26')]=_0x127d7a[_0xa1ca('0xa')];if(_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x24')]][_0xa1ca('0x27')])){channels[_0x127d7a[_0xa1ca('0x24')]][_0xa1ca('0x27')]=utils[_0xa1ca('0x1c')]();}channels[_0x127d7a[_0xa1ca('0x24')]]['disposition']=dispositions[_[_0xa1ca('0x28')](_0x127d7a[_0xa1ca('0x21')])]||'ANSWERED';}}catch(_0x27b25e){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x29'),_0x127d7a['uniqueid']),_0x27b25e);}};exports[_0xa1ca('0x2a')]=function(_0x45b54e){try{if(!_['isNil'](channels[_0x45b54e[_0xa1ca('0x5')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')]('[%s][calls][hangup]',_0x45b54e[_0xa1ca('0x5')]),_0x45b54e);if(_['isNil'](channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2b')])){channels[_0x45b54e[_0xa1ca('0x5')]]['callerid']=_0x45b54e[_0xa1ca('0x2c')]+'\x20<'+_0x45b54e['calleridnum']+'>';}utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x2d'),_0x45b54e[_0xa1ca('0x5')],channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2b')],_0x45b54e['cause-txt']));channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2e')]=utils[_0xa1ca('0x1c')]();channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2f')]=utils[_0xa1ca('0x30')](channels[_0x45b54e[_0xa1ca('0x5')]]['endtime'],channels[_0x45b54e['uniqueid']][_0xa1ca('0x31')]);channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x32')]=channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x27')]?utils[_0xa1ca('0x30')](channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2e')],channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x27')]):0x0;writeDB(channels[_0x45b54e[_0xa1ca('0x5')]]);}}catch(_0x2d9894){utils['error'](util['format'](_0xa1ca('0x33'),_0x45b54e[_0xa1ca('0x5')]),_0x2d9894);}};exports['attendedtransfer']=function(_0x4eb59b){try{if(!_[_0xa1ca('0x20')](channels[_0x4eb59b[_0xa1ca('0x34')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')](_0xa1ca('0x35'),_0x4eb59b[_0xa1ca('0x36')]),_0x4eb59b);if(channels[_0x4eb59b[_0xa1ca('0x34')]][_0xa1ca('0xa')]==_0x4eb59b[_0xa1ca('0x37')]){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x38'),_0x4eb59b[_0xa1ca('0x36')],_0x4eb59b['localtwolinkedid'],_0x4eb59b[_0xa1ca('0x39')]));channels[_0x4eb59b['localtwolinkedid']][_0xa1ca('0x26')]=_0x4eb59b[_0xa1ca('0x39')];channels[_0x4eb59b[_0xa1ca('0x34')]]['userfield']='_attended';}else if(channels[_0x4eb59b[_0xa1ca('0x34')]][_0xa1ca('0xa')]=_0x4eb59b[_0xa1ca('0x3a')]){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4eb59b['origtransfereruniqueid'],_0x4eb59b['localtwolinkedid'],_0x4eb59b[_0xa1ca('0x3b')]));channels[_0x4eb59b['localtwolinkedid']][_0xa1ca('0x26')]=_0x4eb59b['origtransfererchannel'];channels[_0x4eb59b[_0xa1ca('0x34')]]['userfield']='_attended';}}}catch(_0x209043){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x35'),_0x4eb59b[_0xa1ca('0x36')]),_0x209043);}};exports[_0xa1ca('0x3c')]=function(_0x50bb04){try{if(!_[_0xa1ca('0x20')](channels[_0x50bb04['uniqueid']])){utils['debug'](util[_0xa1ca('0x8')](_0xa1ca('0x3d'),_0x50bb04[_0xa1ca('0x5')]),_0x50bb04);channels[_0x50bb04[_0xa1ca('0x5')]]['musiconholdstartAt']=utils[_0xa1ca('0x1c')]();utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x3e'),_0x50bb04[_0xa1ca('0x5')],channels[_0x50bb04[_0xa1ca('0x5')]][_0xa1ca('0x3f')]));}}catch(_0x1bfacf){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x3d'),_0x50bb04[_0xa1ca('0x5')]),_0x1bfacf);}};exports[_0xa1ca('0x40')]=function(_0x45dcc1){try{if(!_[_0xa1ca('0x20')](channels[_0x45dcc1['uniqueid']])){utils['debug'](util['format'](_0xa1ca('0x41'),_0x45dcc1[_0xa1ca('0x5')]),_0x45dcc1);if(!_['isNil'](channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x3f')])){channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x42')]+=utils[_0xa1ca('0x30')](utils[_0xa1ca('0x1c')](),channels[_0x45dcc1['uniqueid']][_0xa1ca('0x3f')]);utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x43'),_0x45dcc1['uniqueid'],channels[_0x45dcc1[_0xa1ca('0x5')]]['mohtime']));delete channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x3f')];}}}catch(_0x4108e3){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')]('[%s][calls][musiconholdstop]',_0x45dcc1[_0xa1ca('0x5')]),_0x4108e3);}};exports[_0xa1ca('0x44')]=function(_0x3880d6){try{if(!_[_0xa1ca('0x20')](channels[_0x3880d6[_0xa1ca('0x5')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')](_0xa1ca('0x45'),_0x3880d6[_0xa1ca('0x5')]),_0x3880d6);if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x47')])){utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x48'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x4a')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6['variable'][_0xa1ca('0x4b')])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x4c'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6['uniqueid']][_0xa1ca('0x4d')]=_0x3880d6['value'];channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x2b')]='\x22'+_0x3880d6['value']+'\x22\x20<'+_0x3880d6[_0xa1ca('0x49')]+'>';}if(!_['isNil'](_0x3880d6['variable'][_0xa1ca('0x4e')])||!_['isNil'](_0x3880d6['variable'][_0xa1ca('0x4f')])){utils['info'](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3880d6[_0xa1ca('0x5')],!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x4e')])?_0xa1ca('0x4e'):_0xa1ca('0x4f'),_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]]['callerid']=_0x3880d6['value'];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x50')])||!_['isNil'](_0x3880d6[_0xa1ca('0x46')]['xmcs-queue'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x51'),_0x3880d6['uniqueid'],!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x50')])?'xmd-queue':_0xa1ca('0x52'),_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6['uniqueid']][_0xa1ca('0x53')]='Queue';channels[_0x3880d6[_0xa1ca('0x5')]]['lastdata']=_0x3880d6[_0xa1ca('0x49')];channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0xb')]=!![];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x54')])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x55')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')]['xmd-cdrtype'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x56')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')]['outboundrouteid'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x57'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6['uniqueid']][_0xa1ca('0x58')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x59')])){utils['info'](util['format'](_0xa1ca('0x5a'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x59')]=_0x3880d6[_0xa1ca('0x49')];}}}catch(_0x378e75){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')]('[%s][calls][varset]',_0x3880d6[_0xa1ca('0x5')]),_0x378e75);}};exports[_0xa1ca('0x5b')]=function(_0x98b28d){try{if(!_[_0xa1ca('0x20')](channels[_0x98b28d['uniqueid']])){utils[_0xa1ca('0x16')](util['format'](_0xa1ca('0x5c'),_0x98b28d['uniqueid']),_0x98b28d);utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x5d'),_0x98b28d['uniqueid'],_0x98b28d[_0xa1ca('0x5e')],_0x98b28d[_0xa1ca('0x5f')]));if(_0x98b28d[_0xa1ca('0x5e')][_0xa1ca('0x60')]()==_0xa1ca('0x61')&&_[_0xa1ca('0x62')](_0x98b28d['appdata'][_0xa1ca('0x60')](),_0xa1ca('0x63'))){var _0x4845fe=_0x98b28d[_0xa1ca('0x5f')][_0xa1ca('0x64')]('=');var _0x4e79e2=_0x4845fe[0x0]['substring'](_0x4845fe[0x0][_0xa1ca('0x65')]('(')+0x1,_0x4845fe[0x0][_0xa1ca('0x65')](')'));var _0x331cbd=_0x4845fe[0x1];channels[_0x98b28d['uniqueid']][_0x4e79e2]=_0x331cbd;}if(!_[_0xa1ca('0x66')]([_0xa1ca('0x2a'),_0xa1ca('0x67'),'execif',_0xa1ca('0x61'),_0xa1ca('0x68')],_0x98b28d[_0xa1ca('0x5e')][_0xa1ca('0x60')]())){channels[_0x98b28d[_0xa1ca('0x5')]]['lastapplication']=_0x98b28d[_0xa1ca('0x5e')];channels[_0x98b28d[_0xa1ca('0x5')]][_0xa1ca('0x69')]=_0x98b28d['appdata'];}}}catch(_0x1fdd1f){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x5c'),_0x98b28d[_0xa1ca('0x5')]),_0x1fdd1f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ae620aa..1862dce 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 _0x178a=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x3fad2f,_0x49d647){var _0x4849da=function(_0x4a0c00){while(--_0x4a0c00){_0x3fad2f['push'](_0x3fad2f['shift']());}};_0x4849da(++_0x49d647);}(_0x178a,0xcb));var _0xa178=function(_0x11f5b8,_0x1bb793){_0x11f5b8=_0x11f5b8-0x0;var _0x474820=_0x178a[_0x11f5b8];return _0x474820;};'use strict';var utils=require(_0xa178('0x0'));exports[_0xa178('0x1')]=function(){utils[_0xa178('0x2')]('[core]\x20connected');};exports[_0xa178('0x3')]=function(){utils[_0xa178('0x2')](_0xa178('0x4'));};exports[_0xa178('0x5')]=function(){utils[_0xa178('0x2')](_0xa178('0x6'));};exports[_0xa178('0x7')]=function(_0x406b0b){utils['error'](_0xa178('0x8'),_0x406b0b);};exports[_0xa178('0x9')]=function(){utils[_0xa178('0x2')]('[core]\x20close');};exports[_0xa178('0xa')]=function(_0x296b01){}; \ No newline at end of file +var _0x14ea=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0xaa5a29,_0x2600f9){var _0x4a4401=function(_0x5d0225){while(--_0x5d0225){_0xaa5a29['push'](_0xaa5a29['shift']());}};_0x4a4401(++_0x2600f9);}(_0x14ea,0x189));var _0xa14e=function(_0x340cde,_0x347de6){_0x340cde=_0x340cde-0x0;var _0x5e26ee=_0x14ea[_0x340cde];return _0x5e26ee;};'use strict';var utils=require(_0xa14e('0x0'));exports[_0xa14e('0x1')]=function(){utils[_0xa14e('0x2')](_0xa14e('0x3'));};exports[_0xa14e('0x4')]=function(){utils[_0xa14e('0x2')](_0xa14e('0x5'));};exports[_0xa14e('0x6')]=function(){utils['info'](_0xa14e('0x7'));};exports['error']=function(_0x522a37){utils[_0xa14e('0x8')]('[core]\x20error',_0x522a37);};exports['close']=function(){utils[_0xa14e('0x2')](_0xa14e('0x9'));};exports[_0xa14e('0xa')]=function(_0x17fafe){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 30b335f..ba5e777 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 _0xf50f=['startsWith','toLowerCase','cdr(routeid)','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','debug','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','now','duration','diffTime','endtime','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application'];(function(_0x124aa4,_0x26b916){var _0x95fd9e=function(_0x4c4197){while(--_0x4c4197){_0x124aa4['push'](_0x124aa4['shift']());}};_0x95fd9e(++_0x26b916);}(_0xf50f,0xb3));var _0xff50=function(_0x35fc93,_0xd24319){_0x35fc93=_0x35fc93-0x0;var _0x5f5ccb=_0xf50f[_0x35fc93];return _0x5f5ccb;};'use strict';var _=require(_0xff50('0x0'));var util=require(_0xff50('0x1'));var utils=require(_0xff50('0x2'));var dials={};function writeDB(_0x557ccc){utils['info'](util[_0xff50('0x3')](_0xff50('0x4'),_0x557ccc[_0xff50('0x5')],_0x557ccc[_0xff50('0x6')],_0x557ccc[_0xff50('0x7')],_0x557ccc['calleridnum'],_0x557ccc[_0xff50('0x8')],_0x557ccc[_0xff50('0x9')]));utils['request'](_0xff50('0xa'),_0x557ccc);delete dials[_0x557ccc[_0xff50('0x5')]];}exports[_0xff50('0xb')]=function(_0x1c3168){try{utils['debug'](util[_0xff50('0x3')](_0xff50('0xc'),_0x1c3168[_0xff50('0x5')]),_0x1c3168);utils[_0xff50('0xd')](util[_0xff50('0x3')](_0xff50('0xe'),_0x1c3168['uniqueid'],_0x1c3168['application'],_0x1c3168[_0xff50('0xf')]));if(_0x1c3168[_0xff50('0x10')]['toLowerCase']()=='set'&&_[_0xff50('0x11')](_0x1c3168['appdata'][_0xff50('0x12')](),_0xff50('0x13'))){var _0x5e525b=_0x1c3168['appdata']['split']('=');dials[_0x1c3168['uniqueid']]={'routeId':_0x5e525b[0x1]};}}catch(_0x5a41c9){utils['error'](util[_0xff50('0x3')](_0xff50('0xc'),_0x1c3168[_0xff50('0x5')]),_0x5a41c9);}};exports[_0xff50('0x14')]=function(_0x36ee83){try{utils['debug'](util[_0xff50('0x3')](_0xff50('0x15'),_0x36ee83['uniqueid']),_0x36ee83);if(!_[_0xff50('0x16')](_0x36ee83['variable'][_0xff50('0x17')])){utils[_0xff50('0xd')](util[_0xff50('0x3')](_0xff50('0x18'),_0x36ee83[_0xff50('0x5')],_0x36ee83[_0xff50('0x19')]));dials[_0x36ee83[_0xff50('0x5')]]={'routeId':_0x36ee83[_0xff50('0x19')]};}}catch(_0x41e3c3){utils[_0xff50('0x1a')](util['format']('[%s][dials][varset]',_0x36ee83['uniqueid']),_0x41e3c3);}};exports[_0xff50('0x1b')]=function(_0x553688){try{if(!_[_0xff50('0x16')](dials[_0x553688['uniqueid']])){utils[_0xff50('0x1c')](util[_0xff50('0x3')]('[%s][dials][dialbegin]',_0x553688[_0xff50('0x5')]),_0x553688);dials[_0x553688[_0xff50('0x5')]]=_[_0xff50('0x1d')](dials[_0x553688[_0xff50('0x5')]],_0x553688);dials[_0x553688[_0xff50('0x5')]][_0xff50('0x1e')]=utils['now']();dials[_0x553688['uniqueid']][_0xff50('0x1f')]=_0xff50('0x20');utils['info'](util[_0xff50('0x3')](_0xff50('0x21'),_0x553688[_0xff50('0x5')],dials[_0x553688[_0xff50('0x5')]][_0xff50('0x1e')]));}}catch(_0x101965){utils['error'](util[_0xff50('0x3')](_0xff50('0x22'),_0x553688[_0xff50('0x5')]),_0x101965);}};exports['dialend']=function(_0xf4f6f7){try{if(!_['isNil'](dials[_0xf4f6f7[_0xff50('0x5')]])){utils[_0xff50('0x1c')](util[_0xff50('0x3')](_0xff50('0x23'),_0xf4f6f7[_0xff50('0x5')]),_0xf4f6f7);dials[_0xf4f6f7[_0xff50('0x5')]][_0xff50('0x9')]=_0xf4f6f7[_0xff50('0x9')];if(_0xf4f6f7[_0xff50('0x9')]=='ANSWER'){dials[_0xf4f6f7['uniqueid']]=_[_0xff50('0x1d')](dials[_0xf4f6f7[_0xff50('0x5')]],_0xf4f6f7);dials[_0xf4f6f7[_0xff50('0x5')]][_0xff50('0x24')]=utils['now']();dials[_0xf4f6f7[_0xff50('0x5')]][_0xff50('0x1f')]=_0xff50('0x25');utils[_0xff50('0xd')](util[_0xff50('0x3')](_0xff50('0x26'),_0xf4f6f7[_0xff50('0x5')],_0xf4f6f7[_0xff50('0x9')],dials[_0xf4f6f7[_0xff50('0x5')]]['answertime']));}else{utils[_0xff50('0xd')](util[_0xff50('0x3')](_0xff50('0x27'),_0xf4f6f7[_0xff50('0x5')],_0xf4f6f7[_0xff50('0x9')]));}}}catch(_0x5c0a4c){utils['error'](util[_0xff50('0x3')](_0xff50('0x23'),_0xf4f6f7['uniqueid']),_0x5c0a4c);}};exports[_0xff50('0x28')]=function(_0x39410e){try{if(!_['isNil'](dials[_0x39410e[_0xff50('0x5')]])){utils[_0xff50('0x1c')](util['format']('[%s][dials][hangup]',_0x39410e[_0xff50('0x5')]),_0x39410e);utils[_0xff50('0xd')](util['format'](_0xff50('0x29'),_0x39410e[_0xff50('0x5')],_0x39410e['calleridnum'],_0x39410e[_0xff50('0x2a')],_0x39410e[_0xff50('0x2b')]));dials[_0x39410e[_0xff50('0x5')]]=_[_0xff50('0x1d')](dials[_0x39410e[_0xff50('0x5')]],{'endtime':utils[_0xff50('0x2c')](),'lastevent':'complete'});dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x2d')]=utils[_0xff50('0x2e')](dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x2f')],dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x1e')]);dials[_0x39410e[_0xff50('0x5')]]['holdtime']=utils[_0xff50('0x2e')](dials[_0x39410e['uniqueid']]['answertime']||dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x2f')],dials[_0x39410e['uniqueid']][_0xff50('0x1e')]);dials[_0x39410e['uniqueid']]['billableseconds']=dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x24')]?utils[_0xff50('0x2e')](dials[_0x39410e[_0xff50('0x5')]][_0xff50('0x2f')],dials[_0x39410e[_0xff50('0x5')]]['answertime']):0x0;writeDB(dials[_0x39410e[_0xff50('0x5')]]);}}catch(_0x1ad3e1){utils[_0xff50('0x1a')](util[_0xff50('0x3')](_0xff50('0x30'),_0x39410e[_0xff50('0x5')]),_0x1ad3e1);}}; \ No newline at end of file +var _0x01e1=['value','error','dialbegin','assign','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x16fa27,_0x59aeed){var _0x51047c=function(_0xfc16c0){while(--_0xfc16c0){_0x16fa27['push'](_0x16fa27['shift']());}};_0x51047c(++_0x59aeed);}(_0x01e1,0xed));var _0x101e=function(_0x561344,_0x373df4){_0x561344=_0x561344-0x0;var _0x48f642=_0x01e1[_0x561344];return _0x48f642;};'use strict';var _=require(_0x101e('0x0'));var util=require(_0x101e('0x1'));var utils=require(_0x101e('0x2'));var dials={};function writeDB(_0x197883){utils[_0x101e('0x3')](util['format'](_0x101e('0x4'),_0x197883['uniqueid'],_0x197883[_0x101e('0x5')],_0x197883['dialstring'],_0x197883[_0x101e('0x6')],_0x197883[_0x101e('0x7')],_0x197883[_0x101e('0x8')]));utils[_0x101e('0x9')](_0x101e('0xa'),_0x197883);delete dials[_0x197883[_0x101e('0xb')]];}exports['newexten']=function(_0xba8806){try{utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0xe'),_0xba8806[_0x101e('0xb')]),_0xba8806);utils[_0x101e('0x3')](util[_0x101e('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xba8806[_0x101e('0xb')],_0xba8806[_0x101e('0xf')],_0xba8806[_0x101e('0x10')]));if(_0xba8806[_0x101e('0xf')][_0x101e('0x11')]()==_0x101e('0x12')&&_[_0x101e('0x13')](_0xba8806[_0x101e('0x10')][_0x101e('0x11')](),_0x101e('0x14'))){var _0x2b70a3=_0xba8806['appdata'][_0x101e('0x15')]('=');dials[_0xba8806[_0x101e('0xb')]]={'routeId':_0x2b70a3[0x1]};}}catch(_0x4413fc){utils['error'](util['format']('[%s][dials][newexten]',_0xba8806[_0x101e('0xb')]),_0x4413fc);}};exports[_0x101e('0x16')]=function(_0x3c6c63){try{utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x17'),_0x3c6c63[_0x101e('0xb')]),_0x3c6c63);if(!_[_0x101e('0x18')](_0x3c6c63[_0x101e('0x19')][_0x101e('0x1a')])){utils['info'](util['format'](_0x101e('0x1b'),_0x3c6c63[_0x101e('0xb')],_0x3c6c63[_0x101e('0x1c')]));dials[_0x3c6c63[_0x101e('0xb')]]={'routeId':_0x3c6c63['value']};}}catch(_0x19abac){utils[_0x101e('0x1d')](util['format']('[%s][dials][varset]',_0x3c6c63[_0x101e('0xb')]),_0x19abac);}};exports[_0x101e('0x1e')]=function(_0x1aa648){try{if(!_[_0x101e('0x18')](dials[_0x1aa648[_0x101e('0xb')]])){utils['debug'](util[_0x101e('0xd')]('[%s][dials][dialbegin]',_0x1aa648[_0x101e('0xb')]),_0x1aa648);dials[_0x1aa648[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x1aa648[_0x101e('0xb')]],_0x1aa648);dials[_0x1aa648[_0x101e('0xb')]][_0x101e('0x20')]=utils['now']();dials[_0x1aa648[_0x101e('0xb')]]['lastevent']='called';utils[_0x101e('0x3')](util[_0x101e('0xd')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1aa648[_0x101e('0xb')],dials[_0x1aa648[_0x101e('0xb')]][_0x101e('0x20')]));}}catch(_0x4161c4){utils[_0x101e('0x1d')](util[_0x101e('0xd')](_0x101e('0x21'),_0x1aa648['uniqueid']),_0x4161c4);}};exports[_0x101e('0x22')]=function(_0x3e87a1){try{if(!_[_0x101e('0x18')](dials[_0x3e87a1['uniqueid']])){utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x23'),_0x3e87a1[_0x101e('0xb')]),_0x3e87a1);dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x8')]=_0x3e87a1[_0x101e('0x8')];if(_0x3e87a1[_0x101e('0x8')]==_0x101e('0x24')){dials[_0x3e87a1[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x3e87a1['uniqueid']],_0x3e87a1);dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x25')]=utils[_0x101e('0x26')]();dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x27')]=_0x101e('0x28');utils[_0x101e('0x3')](util[_0x101e('0xd')](_0x101e('0x29'),_0x3e87a1[_0x101e('0xb')],_0x3e87a1['dialstatus'],dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x25')]));}else{utils[_0x101e('0x3')](util[_0x101e('0xd')](_0x101e('0x2a'),_0x3e87a1[_0x101e('0xb')],_0x3e87a1[_0x101e('0x8')]));}}}catch(_0x1559c8){utils['error'](util[_0x101e('0xd')](_0x101e('0x23'),_0x3e87a1[_0x101e('0xb')]),_0x1559c8);}};exports[_0x101e('0x2b')]=function(_0x2bbd51){try{if(!_[_0x101e('0x18')](dials[_0x2bbd51[_0x101e('0xb')]])){utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x2c'),_0x2bbd51[_0x101e('0xb')]),_0x2bbd51);utils['info'](util[_0x101e('0xd')](_0x101e('0x2d'),_0x2bbd51['uniqueid'],_0x2bbd51[_0x101e('0x6')],_0x2bbd51['calleridname'],_0x2bbd51[_0x101e('0x2e')]));dials[_0x2bbd51[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x2bbd51[_0x101e('0xb')]],{'endtime':utils[_0x101e('0x26')](),'lastevent':_0x101e('0x2f')});dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x30')]=utils[_0x101e('0x31')](dials[_0x2bbd51['uniqueid']]['endtime'],dials[_0x2bbd51[_0x101e('0xb')]]['starttime']);dials[_0x2bbd51['uniqueid']][_0x101e('0x32')]=utils['diffTime'](dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]||dials[_0x2bbd51['uniqueid']][_0x101e('0x33')],dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x20')]);dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x34')]=dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]?utils[_0x101e('0x31')](dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x33')],dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]):0x0;writeDB(dials[_0x2bbd51[_0x101e('0xb')]]);}}catch(_0x264986){utils[_0x101e('0x1d')](util[_0x101e('0xd')]('[%s][dials][hangup]',_0x2bbd51[_0x101e('0xb')]),_0x264986);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 7dc50c0..d95da4a 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 _0xe931=['[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','port','asterisk','username','password','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave'];(function(_0x58acac,_0x19d9bf){var _0x23d7db=function(_0x21c957){while(--_0x21c957){_0x58acac['push'](_0x58acac['shift']());}};_0x23d7db(++_0x19d9bf);}(_0xe931,0x127));var _0x1e93=function(_0x610891,_0x559e26){_0x610891=_0x610891-0x0;var _0x56b558=_0xe931[_0x610891];return _0x56b558;};var AsteriskManager=require(_0x1e93('0x0'));var config=require(_0x1e93('0x1'));var utils=require(_0x1e93('0x2'));var util=require('util');var ami=new AsteriskManager(config['asterisk'][_0x1e93('0x3')],config['asterisk']['ip'],config[_0x1e93('0x4')][_0x1e93('0x5')],config[_0x1e93('0x4')][_0x1e93('0x6')],!![]);ami['keepConnected']();if(config['xdr']&&config[_0x1e93('0x7')]['disabled']){utils[_0x1e93('0x8')](_0x1e93('0x9'));}else{var agents=require(_0x1e93('0xa'));var calls=require(_0x1e93('0xb'));var queues=require(_0x1e93('0xc'));var recordings=require(_0x1e93('0xd'));var members=require(_0x1e93('0xe'));var dials=require('./dials.controller');var transfers=require(_0x1e93('0xf'));var core=require(_0x1e93('0x10'));ami['on'](_0x1e93('0x11'),core[_0x1e93('0x11')]);ami['on']('shutdown',core[_0x1e93('0x12')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x1e93('0x13'),core[_0x1e93('0x13')]);ami['on'](_0x1e93('0x14'),core['close']);ami['on'](_0x1e93('0x15'),core[_0x1e93('0x15')]);ami['on']('devicestatechange',function(_0x20d4b1){try{utils['debug'](util[_0x1e93('0x16')]('[%s][index][devicestatechange]',_0x20d4b1['device']),_0x20d4b1);members['devicestatechange'](_0x20d4b1);}catch(_0x9bc66f){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x17'),_0x20d4b1[_0x1e93('0x18')]),_0x9bc66f);}});ami['on'](_0x1e93('0x19'),function(_0x1e5948){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x1a'),_0x1e5948[_0x1e93('0x1b')]),_0x1e5948);agents[_0x1e93('0x19')](_0x1e5948);}catch(_0x3f79b7){utils[_0x1e93('0x13')](util['format']('[%s][index][agentcalled]',_0x1e5948[_0x1e93('0x1b')]),_0x3f79b7);}});ami['on'](_0x1e93('0x1c'),function(_0x44693d){try{utils[_0x1e93('0x1d')](util['format'](_0x1e93('0x1e'),_0x44693d[_0x1e93('0x1b')]),_0x44693d);agents[_0x1e93('0x1c')](_0x44693d);}catch(_0x3bf46f){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x1e'),_0x44693d[_0x1e93('0x1b')]),_0x3bf46f);}});ami['on']('agentconnect',function(_0xb662a7){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x1f'),_0xb662a7[_0x1e93('0x1b')]),_0xb662a7);agents[_0x1e93('0x20')](_0xb662a7);queues[_0x1e93('0x20')](_0xb662a7);}catch(_0x282e8e){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x1f'),_0xb662a7['uniqueid']),_0x282e8e);}});ami['on'](_0x1e93('0x21'),function(_0x5aa8aa){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x22'),_0x5aa8aa[_0x1e93('0x1b')]),_0x5aa8aa);agents[_0x1e93('0x21')](_0x5aa8aa);queues[_0x1e93('0x21')](_0x5aa8aa);members[_0x1e93('0x21')](_0x5aa8aa);}catch(_0x431120){utils[_0x1e93('0x13')](util[_0x1e93('0x16')]('[%s][index][agentcomplete]',_0x5aa8aa[_0x1e93('0x1b')]),_0x431120);}});ami['on'](_0x1e93('0x23'),function(_0x336d5b){try{utils[_0x1e93('0x1d')](util['format'](_0x1e93('0x24'),_0x336d5b[_0x1e93('0x1b')]),_0x336d5b);agents[_0x1e93('0x23')](_0x336d5b);queues[_0x1e93('0x23')](_0x336d5b);}catch(_0x32e260){utils[_0x1e93('0x13')](util['format'](_0x1e93('0x24'),_0x336d5b['uniqueid']),_0x32e260);}});ami['on'](_0x1e93('0x25'),function(_0x42b988){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x26'),_0x42b988[_0x1e93('0x1b')]),_0x42b988);queues[_0x1e93('0x25')](_0x42b988);recordings[_0x1e93('0x25')](_0x42b988);}catch(_0x545876){utils['error'](util[_0x1e93('0x16')](_0x1e93('0x26'),_0x42b988['uniqueid']),_0x545876);}});ami['on'](_0x1e93('0x27'),function(_0x49b3e6){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x28'),_0x49b3e6[_0x1e93('0x1b')]),_0x49b3e6);queues[_0x1e93('0x27')](_0x49b3e6);}catch(_0x565940){utils['error'](util[_0x1e93('0x16')]('[%s][index][queuecallerleave]',_0x49b3e6[_0x1e93('0x1b')]),_0x565940);}});ami['on'](_0x1e93('0x29'),function(_0x5b9fb5){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x2a'),_0x5b9fb5[_0x1e93('0x1b')]),_0x5b9fb5);queues[_0x1e93('0x29')](_0x5b9fb5);calls['musiconholdstart'](_0x5b9fb5);}catch(_0x53dcab){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x2a'),_0x5b9fb5[_0x1e93('0x1b')]),_0x53dcab);}});ami['on'](_0x1e93('0x2b'),function(_0x3d4b2a){try{utils['debug'](util['format'](_0x1e93('0x2c'),_0x3d4b2a['uniqueid']),_0x3d4b2a);queues[_0x1e93('0x2b')](_0x3d4b2a);calls[_0x1e93('0x2b')](_0x3d4b2a);}catch(_0xb4aaf5){utils[_0x1e93('0x13')](util[_0x1e93('0x16')]('[%s][index][musiconholdstop]',_0x3d4b2a[_0x1e93('0x1b')]),_0xb4aaf5);}});ami['on']('newstate',function(_0x12cd6c){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x2d'),_0x12cd6c[_0x1e93('0x1b')]),_0x12cd6c);calls[_0x1e93('0x2e')](_0x12cd6c);recordings[_0x1e93('0x2e')](_0x12cd6c);}catch(_0x2d92de){utils['error'](util[_0x1e93('0x16')](_0x1e93('0x2d'),_0x12cd6c[_0x1e93('0x1b')]),_0x2d92de);}});ami['on']('hangup',function(_0xd9e9db){try{utils[_0x1e93('0x1d')](util['format'](_0x1e93('0x2f'),_0xd9e9db[_0x1e93('0x1b')]),_0xd9e9db);calls[_0x1e93('0x30')](_0xd9e9db);recordings['hangup'](_0xd9e9db);dials[_0x1e93('0x30')](_0xd9e9db);agents[_0x1e93('0x30')](_0xd9e9db);queues[_0x1e93('0x30')](_0xd9e9db);}catch(_0x504c0e){utils[_0x1e93('0x13')](util['format'](_0x1e93('0x2f'),_0xd9e9db[_0x1e93('0x1b')]),_0x504c0e);}});ami['on'](_0x1e93('0x31'),function(_0xedebe6){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x32'),_0xedebe6[_0x1e93('0x1b')]),_0xedebe6);members['cdr'](_0xedebe6);}catch(_0x49f419){utils['error'](util[_0x1e93('0x16')](_0x1e93('0x32'),_0xedebe6[_0x1e93('0x1b')]),_0x49f419);}});ami['on']('blindtransfer',function(_0x587e96){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x33'),_0x587e96[_0x1e93('0x1b')]),_0x587e96);queues[_0x1e93('0x34')](_0x587e96);agents['blindtransfer'](_0x587e96);transfers[_0x1e93('0x34')](_0x587e96);}catch(_0x2f75f1){utils['error'](util['format'](_0x1e93('0x33'),_0x587e96[_0x1e93('0x1b')]),_0x2f75f1);}});ami['on'](_0x1e93('0x35'),function(_0x3778b4){try{utils[_0x1e93('0x1d')](util['format'](_0x1e93('0x36'),_0x3778b4['origtransfereruniqueid']),_0x3778b4);queues[_0x1e93('0x35')](_0x3778b4);transfers[_0x1e93('0x35')](_0x3778b4);agents[_0x1e93('0x35')](_0x3778b4);calls[_0x1e93('0x35')](_0x3778b4);}catch(_0x69f89f){utils[_0x1e93('0x13')](util[_0x1e93('0x16')]('[%s][index][attendedtransfer]',_0x3778b4[_0x1e93('0x37')]),_0x69f89f);}});ami['on'](_0x1e93('0x38'),function(_0x41bc9c){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x39'),_0x41bc9c[_0x1e93('0x1b')]),_0x41bc9c);queues[_0x1e93('0x38')](_0x41bc9c);recordings[_0x1e93('0x38')](_0x41bc9c);calls[_0x1e93('0x38')](_0x41bc9c);dials[_0x1e93('0x38')](_0x41bc9c);}catch(_0x1ccdc3){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x39'),_0x41bc9c[_0x1e93('0x1b')]),_0x1ccdc3);}});ami['on']('newexten',function(_0x3fdf48){try{utils['debug'](util[_0x1e93('0x16')](_0x1e93('0x3a'),_0x3fdf48[_0x1e93('0x1b')]),_0x3fdf48);calls[_0x1e93('0x3b')](_0x3fdf48);recordings[_0x1e93('0x3b')](_0x3fdf48);dials[_0x1e93('0x3b')](_0x3fdf48);}catch(_0xfc495c){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x3a'),_0x3fdf48[_0x1e93('0x1b')]),_0xfc495c);}});ami['on'](_0x1e93('0x3c'),function(_0x540b35){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x3d'),_0x540b35['uniqueid']),_0x540b35);calls[_0x1e93('0x3c')](_0x540b35);recordings[_0x1e93('0x3c')](_0x540b35);}catch(_0x1559ca){utils[_0x1e93('0x13')](util['format'](_0x1e93('0x3d'),_0x540b35['uniqueid']),_0x1559ca);}});ami['on'](_0x1e93('0x3e'),function(_0x1b34ce){try{utils[_0x1e93('0x1d')](util[_0x1e93('0x16')](_0x1e93('0x3f'),_0x1b34ce[_0x1e93('0x1b')]),_0x1b34ce);dials[_0x1e93('0x3e')](_0x1b34ce);}catch(_0x1412ec){utils[_0x1e93('0x13')](util[_0x1e93('0x16')](_0x1e93('0x40'),_0x1b34ce[_0x1e93('0x1b')]),_0x1412ec);}});ami['on'](_0x1e93('0x41'),function(_0x457d3a){try{utils[_0x1e93('0x1d')](util['format'](_0x1e93('0x42'),_0x457d3a[_0x1e93('0x1b')]),_0x457d3a);dials[_0x1e93('0x41')](_0x457d3a);}catch(_0x5c0422){utils[_0x1e93('0x13')](util['format']('[%s][index][dialend]',_0x457d3a['uniqueid']),_0x5c0422);}});} \ No newline at end of file +var _0x5118=['asterisk-manager','../../config/environment','./utils','asterisk','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x49e0e2,_0x39effb){var _0x2d83f4=function(_0x2af8f2){while(--_0x2af8f2){_0x49e0e2['push'](_0x49e0e2['shift']());}};_0x2d83f4(++_0x39effb);}(_0x5118,0x80));var _0x8511=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x5118[_0x5a95fa];return _0x1a61b8;};var AsteriskManager=require(_0x8511('0x0'));var config=require(_0x8511('0x1'));var utils=require(_0x8511('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x8511('0x3')]['port'],config['asterisk']['ip'],config[_0x8511('0x3')]['username'],config[_0x8511('0x3')]['password'],!![]);ami[_0x8511('0x4')]();if(config[_0x8511('0x5')]&&config[_0x8511('0x5')][_0x8511('0x6')]){utils[_0x8511('0x7')](_0x8511('0x8'));}else{var agents=require(_0x8511('0x9'));var calls=require(_0x8511('0xa'));var queues=require(_0x8511('0xb'));var recordings=require(_0x8511('0xc'));var members=require(_0x8511('0xd'));var dials=require(_0x8511('0xe'));var transfers=require(_0x8511('0xf'));var core=require(_0x8511('0x10'));ami['on'](_0x8511('0x11'),core['connect']);ami['on'](_0x8511('0x12'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x8511('0x13'),core[_0x8511('0x13')]);ami['on'](_0x8511('0x14'),core[_0x8511('0x14')]);ami['on'](_0x8511('0x15'),core[_0x8511('0x15')]);ami['on'](_0x8511('0x16'),function(_0x3f7dca){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x19'),_0x3f7dca[_0x8511('0x1a')]),_0x3f7dca);members[_0x8511('0x16')](_0x3f7dca);}catch(_0x1744b5){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x19'),_0x3f7dca[_0x8511('0x1a')]),_0x1744b5);}});ami['on'](_0x8511('0x1b'),function(_0x58ae56){try{utils[_0x8511('0x17')](util[_0x8511('0x18')]('[%s][index][agentcalled]',_0x58ae56[_0x8511('0x1c')]),_0x58ae56);agents[_0x8511('0x1b')](_0x58ae56);}catch(_0xc3fb57){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x1d'),_0x58ae56['uniqueid']),_0xc3fb57);}});ami['on'](_0x8511('0x1e'),function(_0x337dcd){try{utils['debug'](util[_0x8511('0x18')]('[%s][index][agentringnoanswer]',_0x337dcd[_0x8511('0x1c')]),_0x337dcd);agents[_0x8511('0x1e')](_0x337dcd);}catch(_0x2c8bb3){utils[_0x8511('0x13')](util['format']('[%s][index][agentringnoanswer]',_0x337dcd[_0x8511('0x1c')]),_0x2c8bb3);}});ami['on']('agentconnect',function(_0x2982b1){try{utils['debug'](util['format'](_0x8511('0x1f'),_0x2982b1[_0x8511('0x1c')]),_0x2982b1);agents[_0x8511('0x20')](_0x2982b1);queues[_0x8511('0x20')](_0x2982b1);}catch(_0x559ad){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x1f'),_0x2982b1[_0x8511('0x1c')]),_0x559ad);}});ami['on'](_0x8511('0x21'),function(_0x25c2d9){try{utils['debug'](util['format'](_0x8511('0x22'),_0x25c2d9[_0x8511('0x1c')]),_0x25c2d9);agents[_0x8511('0x21')](_0x25c2d9);queues[_0x8511('0x21')](_0x25c2d9);members[_0x8511('0x21')](_0x25c2d9);}catch(_0x65c0cb){utils['error'](util[_0x8511('0x18')](_0x8511('0x22'),_0x25c2d9[_0x8511('0x1c')]),_0x65c0cb);}});ami['on'](_0x8511('0x23'),function(_0x4af493){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x24'),_0x4af493[_0x8511('0x1c')]),_0x4af493);agents[_0x8511('0x23')](_0x4af493);queues[_0x8511('0x23')](_0x4af493);}catch(_0x3322d5){utils['error'](util[_0x8511('0x18')]('[%s][index][queuecallerabandon]',_0x4af493[_0x8511('0x1c')]),_0x3322d5);}});ami['on'](_0x8511('0x25'),function(_0x8414fe){try{utils['debug'](util[_0x8511('0x18')](_0x8511('0x26'),_0x8414fe[_0x8511('0x1c')]),_0x8414fe);queues[_0x8511('0x25')](_0x8414fe);recordings[_0x8511('0x25')](_0x8414fe);}catch(_0x3db9be){utils[_0x8511('0x13')](util['format'](_0x8511('0x26'),_0x8414fe['uniqueid']),_0x3db9be);}});ami['on'](_0x8511('0x27'),function(_0x40800b){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x28'),_0x40800b[_0x8511('0x1c')]),_0x40800b);queues[_0x8511('0x27')](_0x40800b);}catch(_0xf8f6a1){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x28'),_0x40800b['uniqueid']),_0xf8f6a1);}});ami['on'](_0x8511('0x29'),function(_0x3ea94f){try{utils[_0x8511('0x17')](util[_0x8511('0x18')]('[%s][index][musiconholdstart]',_0x3ea94f[_0x8511('0x1c')]),_0x3ea94f);queues['musiconholdstart'](_0x3ea94f);calls[_0x8511('0x29')](_0x3ea94f);}catch(_0x476cad){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][musiconholdstart]',_0x3ea94f[_0x8511('0x1c')]),_0x476cad);}});ami['on'](_0x8511('0x2a'),function(_0xaceb41){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x2b'),_0xaceb41[_0x8511('0x1c')]),_0xaceb41);queues[_0x8511('0x2a')](_0xaceb41);calls[_0x8511('0x2a')](_0xaceb41);}catch(_0x5000d2){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2b'),_0xaceb41[_0x8511('0x1c')]),_0x5000d2);}});ami['on']('newstate',function(_0x5643ec){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x2c'),_0x5643ec[_0x8511('0x1c')]),_0x5643ec);calls[_0x8511('0x2d')](_0x5643ec);recordings['newstate'](_0x5643ec);}catch(_0x3aae7b){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2c'),_0x5643ec['uniqueid']),_0x3aae7b);}});ami['on'](_0x8511('0x2e'),function(_0x3e88ba){try{utils[_0x8511('0x17')](util['format']('[%s][index][hangup]',_0x3e88ba[_0x8511('0x1c')]),_0x3e88ba);calls[_0x8511('0x2e')](_0x3e88ba);recordings[_0x8511('0x2e')](_0x3e88ba);dials[_0x8511('0x2e')](_0x3e88ba);agents[_0x8511('0x2e')](_0x3e88ba);queues[_0x8511('0x2e')](_0x3e88ba);}catch(_0x500ed0){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2f'),_0x3e88ba['uniqueid']),_0x500ed0);}});ami['on'](_0x8511('0x30'),function(_0x50ed33){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x31'),_0x50ed33[_0x8511('0x1c')]),_0x50ed33);members[_0x8511('0x30')](_0x50ed33);}catch(_0x2558ef){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x31'),_0x50ed33['uniqueid']),_0x2558ef);}});ami['on'](_0x8511('0x32'),function(_0xed74a3){try{utils[_0x8511('0x17')](util['format'](_0x8511('0x33'),_0xed74a3[_0x8511('0x1c')]),_0xed74a3);queues['blindtransfer'](_0xed74a3);agents[_0x8511('0x32')](_0xed74a3);transfers[_0x8511('0x32')](_0xed74a3);}catch(_0x51942){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][blindtransfer]',_0xed74a3['uniqueid']),_0x51942);}});ami['on'](_0x8511('0x34'),function(_0x5b35c8){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x35'),_0x5b35c8[_0x8511('0x36')]),_0x5b35c8);queues[_0x8511('0x34')](_0x5b35c8);transfers[_0x8511('0x34')](_0x5b35c8);agents['attendedtransfer'](_0x5b35c8);calls[_0x8511('0x34')](_0x5b35c8);}catch(_0x330edf){utils[_0x8511('0x13')](util['format'](_0x8511('0x35'),_0x5b35c8['origtransfereruniqueid']),_0x330edf);}});ami['on'](_0x8511('0x37'),function(_0x1f90cd){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x38'),_0x1f90cd[_0x8511('0x1c')]),_0x1f90cd);queues[_0x8511('0x37')](_0x1f90cd);recordings[_0x8511('0x37')](_0x1f90cd);calls[_0x8511('0x37')](_0x1f90cd);dials[_0x8511('0x37')](_0x1f90cd);}catch(_0x1d1d6e){utils[_0x8511('0x13')](util['format']('[%s][index][varset]',_0x1f90cd['uniqueid']),_0x1d1d6e);}});ami['on']('newexten',function(_0x249a1e){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x39'),_0x249a1e[_0x8511('0x1c')]),_0x249a1e);calls[_0x8511('0x3a')](_0x249a1e);recordings['newexten'](_0x249a1e);dials[_0x8511('0x3a')](_0x249a1e);}catch(_0x4c70d3){utils['error'](util[_0x8511('0x18')](_0x8511('0x39'),_0x249a1e[_0x8511('0x1c')]),_0x4c70d3);}});ami['on']('newchannel',function(_0x2a12d7){try{utils[_0x8511('0x17')](util['format']('[%s][index][newchannel]',_0x2a12d7[_0x8511('0x1c')]),_0x2a12d7);calls[_0x8511('0x3b')](_0x2a12d7);recordings[_0x8511('0x3b')](_0x2a12d7);}catch(_0x393e89){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][newchannel]',_0x2a12d7[_0x8511('0x1c')]),_0x393e89);}});ami['on']('dialbegin',function(_0x1af22d){try{utils['debug'](util[_0x8511('0x18')]('[%s][index][dialbegin]',_0x1af22d[_0x8511('0x1c')]),_0x1af22d);dials[_0x8511('0x3c')](_0x1af22d);}catch(_0x3f4e2e){utils['error'](util['format'](_0x8511('0x3d'),_0x1af22d[_0x8511('0x1c')]),_0x3f4e2e);}});ami['on'](_0x8511('0x3e'),function(_0x1ddb78){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x3f'),_0x1ddb78[_0x8511('0x1c')]),_0x1ddb78);dials[_0x8511('0x3e')](_0x1ddb78);}catch(_0x1b44ba){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][dialend]',_0x1ddb78[_0x8511('0x1c')]),_0x1b44ba);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 13785d5..8151bea 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 _0x8369=['exitAt','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','devicestatechange','debug','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','NOT_INUSE','isNil','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x8369,0x10b));var _0x9836=function(_0x114e9c,_0x9980e0){_0x114e9c=_0x114e9c-0x0;var _0x432532=_0x8369[_0x114e9c];return _0x432532;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var utils=require(_0x9836('0x2'));var members={};var exclude=[_0x9836('0x3'),_0x9836('0x4')];function writeDB(_0x1fe0f3){utils[_0x9836('0x5')](util['format'](_0x9836('0x6'),_0x1fe0f3['uniqueid'],_0x1fe0f3[_0x9836('0x7')],_0x1fe0f3[_0x9836('0x8')],_0x1fe0f3['data2'],_0x1fe0f3[_0x9836('0x9')],_0x1fe0f3[_0x9836('0xa')]));if(_0x1fe0f3['interface']){utils[_0x9836('0xb')](_0x1fe0f3[_0x9836('0x7')])[_0x9836('0xc')](function(_0x2482d8){if(_0x2482d8){_0x1fe0f3['membername']=_0x2482d8[_0x9836('0xd')];_0x1fe0f3[_0x9836('0xe')]=_0x2482d8[_0x9836('0xe')];utils[_0x9836('0xf')]('CreateMemberReport',_0x1fe0f3);}else{utils[_0x9836('0x10')](_0x1fe0f3[_0x9836('0x7')][_0x9836('0x11')]('/')[0x1])[_0x9836('0xc')](function(_0x42de67){if(_0x42de67){_0x1fe0f3['membername']=_0x42de67[_0x9836('0xd')];_0x1fe0f3[_0x9836('0xe')]=_0x42de67[_0x9836('0xe')];utils[_0x9836('0xf')](_0x9836('0x12'),_0x1fe0f3);}});}})[_0x9836('0x13')](function(_0x2f38fb){utils[_0x9836('0x14')](util['format'](_0x9836('0x15'),_0x1fe0f3[_0x9836('0x16')]),_0x2f38fb);});}delete members[_0x1fe0f3[_0x9836('0x7')]];}function startsWith(_0x47d820,_0x978742){return _['some'](_0x47d820,function(_0xa0b1f8){return _['startsWith'](_0x978742,_0xa0b1f8);});}exports[_0x9836('0x17')]=function(_0x22f9b5){try{utils[_0x9836('0x18')](util[_0x9836('0x19')](_0x9836('0x1a'),members[_0x22f9b5[_0x9836('0x1b')]]?members[_0x22f9b5['device']][_0x9836('0x16')]:_0x22f9b5[_0x9836('0x1b')]),_0x22f9b5);utils['info'](util[_0x9836('0x19')](_0x9836('0x1c'),members[_0x22f9b5[_0x9836('0x1b')]]?members[_0x22f9b5['device']][_0x9836('0x16')]:_0x22f9b5['device'],_0x22f9b5[_0x9836('0x1d')],_0x22f9b5[_0x9836('0x1b')]));switch(_0x22f9b5[_0x9836('0x1d')]){case _0x9836('0x1e'):case _0x9836('0x1f'):if(!startsWith(exclude,_0x22f9b5['device'])){members[_0x22f9b5['device']]={'channel':'voice','interface':_0x22f9b5[_0x9836('0x1b')],'type':_0x9836('0x20'),'enterAt':utils[_0x9836('0x21')](),'role':'agent'};}break;case _0x9836('0x22'):if(!_[_0x9836('0x23')](members[_0x22f9b5[_0x9836('0x1b')]])){members[_0x22f9b5[_0x9836('0x1b')]]['exitAt']=utils[_0x9836('0x21')]();members[_0x22f9b5[_0x9836('0x1b')]][_0x9836('0x24')]=utils[_0x9836('0x25')](members[_0x22f9b5[_0x9836('0x1b')]]['exitAt'],members[_0x22f9b5[_0x9836('0x1b')]][_0x9836('0x26')]);if(members[_0x22f9b5['device']][_0x9836('0x16')]){writeDB(members[_0x22f9b5['device']]);}}break;default:break;}}catch(_0xedb9b7){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x22f9b5[_0x9836('0x1b')]]?members[_0x22f9b5[_0x9836('0x1b')]][_0x9836('0x16')]:_0x22f9b5[_0x9836('0x1b')]),_0xedb9b7);}};exports[_0x9836('0x27')]=function(_0x118aac){try{if(!_[_0x9836('0x23')](members[_0x118aac['interface']])){utils[_0x9836('0x18')](util[_0x9836('0x19')](_0x9836('0x28'),_0x118aac[_0x9836('0x16')]),_0x118aac);utils[_0x9836('0x5')](util[_0x9836('0x19')](_0x9836('0x29'),_0x118aac[_0x9836('0x16')],_0x118aac[_0x9836('0x7')],_0x118aac['queue']));members[_0x118aac[_0x9836('0x7')]]=_[_0x9836('0x2a')](members[_0x118aac[_0x9836('0x7')]],{'data4':_0x118aac[_0x9836('0x2b')],'uniqueid':_0x118aac[_0x9836('0x16')]});}}catch(_0x611229){utils[_0x9836('0x14')](util[_0x9836('0x19')]('[%s][members][agentcomplete]',_0x118aac['uniqueid']),_0x611229);}};exports[_0x9836('0x2c')]=function(_0x2d6705){try{utils[_0x9836('0x18')](util['format']('[%s][members][cdr]',_0x2d6705['uniqueid']),_0x2d6705);if(_0x2d6705[_0x9836('0x8')]){var _0x5aaaae=_0x2d6705[_0x9836('0x8')][_0x9836('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5aaaae])){members[_0x5aaaae]=_['assign'](members[_0x5aaaae],{'data1':members[_0x5aaaae][_0x9836('0x2d')]||_0x2d6705[_0x9836('0xa')],'data2':members[_0x5aaaae][_0x9836('0x2e')]||_0x2d6705[_0x9836('0x2f')],'data3':members[_0x5aaaae][_0x9836('0x30')]||_0x2d6705['destination'],'uniqueid':members[_0x5aaaae]['uniqueid']||_0x2d6705[_0x9836('0x16')]});utils[_0x9836('0x5')](util[_0x9836('0x19')](_0x9836('0x31'),_0x2d6705[_0x9836('0x16')],members[_0x5aaaae][_0x9836('0x2d')],members[_0x5aaaae]['data2'],members[_0x5aaaae][_0x9836('0x30')]));if(members[_0x5aaaae]['exitAt']){writeDB(members[_0x5aaaae]);}}}if(_0x2d6705[_0x9836('0x32')]){var _0x2a347b=_0x2d6705[_0x9836('0x32')][_0x9836('0x11')]('-')[0x0];if(!_[_0x9836('0x23')](members[_0x2a347b])){members[_0x2a347b]=_[_0x9836('0x2a')](members[_0x2a347b],{'data1':members[_0x2a347b][_0x9836('0x2d')]||_0x2d6705['type'],'data2':members[_0x2a347b][_0x9836('0x2e')]||_0x2d6705[_0x9836('0x2f')],'data3':members[_0x2a347b][_0x9836('0x30')]||_0x2d6705['destination'],'uniqueid':members[_0x2a347b]['uniqueid']||_0x2d6705['uniqueid']});utils[_0x9836('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2d6705[_0x9836('0x16')],members[_0x2a347b][_0x9836('0x2d')],members[_0x2a347b][_0x9836('0x2e')],members[_0x2a347b][_0x9836('0x30')]));if(members[_0x2a347b][_0x9836('0x33')]){writeDB(members[_0x2a347b]);}}}}catch(_0x3b8943){utils[_0x9836('0x14')](util['format'](_0x9836('0x34'),_0x2d6705[_0x9836('0x16')]),_0x3b8943);}}; \ No newline at end of file +var _0xbb8f=['[%s][members][cdr]','data1','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','internal','getUserByName','split','then','name','request','catch','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr'];(function(_0x560ef7,_0x4a324f){var _0x316a1f=function(_0x48b6b3){while(--_0x48b6b3){_0x560ef7['push'](_0x560ef7['shift']());}};_0x316a1f(++_0x4a324f);}(_0xbb8f,0x99));var _0xfbb8=function(_0xfbfba4,_0x4c9f69){_0xfbfba4=_0xfbfba4-0x0;var _0x187666=_0xbb8f[_0xfbfba4];return _0x187666;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var utils=require(_0xfbb8('0x1'));var members={};var exclude=[_0xfbb8('0x2'),_0xfbb8('0x3')];function writeDB(_0x449f7b){utils[_0xfbb8('0x4')](util[_0xfbb8('0x5')](_0xfbb8('0x6'),_0x449f7b[_0xfbb8('0x7')],_0x449f7b[_0xfbb8('0x8')],_0x449f7b[_0xfbb8('0x9')],_0x449f7b[_0xfbb8('0xa')],_0x449f7b[_0xfbb8('0xb')],_0x449f7b[_0xfbb8('0xc')]));if(_0x449f7b[_0xfbb8('0x8')]){utils[_0xfbb8('0xd')](_0x449f7b[_0xfbb8('0x8')])['then'](function(_0x4c20b4){if(_0x4c20b4){_0x449f7b['membername']=_0x4c20b4['name'];_0x449f7b[_0xfbb8('0xe')]=_0x4c20b4[_0xfbb8('0xe')];utils['request']('CreateMemberReport',_0x449f7b);}else{utils[_0xfbb8('0xf')](_0x449f7b[_0xfbb8('0x8')][_0xfbb8('0x10')]('/')[0x1])[_0xfbb8('0x11')](function(_0xf2d19b){if(_0xf2d19b){_0x449f7b[_0xfbb8('0xb')]=_0xf2d19b[_0xfbb8('0x12')];_0x449f7b[_0xfbb8('0xe')]=_0xf2d19b[_0xfbb8('0xe')];utils[_0xfbb8('0x13')]('CreateMemberReport',_0x449f7b);}});}})[_0xfbb8('0x14')](function(_0x1ca9b0){utils['error'](util[_0xfbb8('0x5')]('[%s][members][writeDB]',_0x449f7b[_0xfbb8('0x7')]),_0x1ca9b0);});}delete members[_0x449f7b[_0xfbb8('0x8')]];}function startsWith(_0x104a71,_0x550db6){return _[_0xfbb8('0x15')](_0x104a71,function(_0x3ecc3b){return _[_0xfbb8('0x16')](_0x550db6,_0x3ecc3b);});}exports[_0xfbb8('0x17')]=function(_0x2a17da){try{utils[_0xfbb8('0x18')](util[_0xfbb8('0x5')](_0xfbb8('0x19'),members[_0x2a17da[_0xfbb8('0x1a')]]?members[_0x2a17da[_0xfbb8('0x1a')]]['uniqueid']:_0x2a17da[_0xfbb8('0x1a')]),_0x2a17da);utils['info'](util[_0xfbb8('0x5')](_0xfbb8('0x1b'),members[_0x2a17da['device']]?members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]:_0x2a17da[_0xfbb8('0x1a')],_0x2a17da[_0xfbb8('0x1c')],_0x2a17da[_0xfbb8('0x1a')]));switch(_0x2a17da['state']){case _0xfbb8('0x1d'):case _0xfbb8('0x1e'):if(!startsWith(exclude,_0x2a17da['device'])){members[_0x2a17da[_0xfbb8('0x1a')]]={'channel':_0xfbb8('0x1f'),'interface':_0x2a17da['device'],'type':_0xfbb8('0x20'),'enterAt':utils[_0xfbb8('0x21')](),'role':'agent'};}break;case _0xfbb8('0x22'):if(!_[_0xfbb8('0x23')](members[_0x2a17da[_0xfbb8('0x1a')]])){members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x24')]=utils['now']();members[_0x2a17da['device']]['duration']=utils['diffTime'](members[_0x2a17da['device']][_0xfbb8('0x24')],members[_0x2a17da['device']]['enterAt']);if(members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]){writeDB(members[_0x2a17da['device']]);}}break;default:break;}}catch(_0x14c32e){utils[_0xfbb8('0x25')](util['format']('[%s][members][devicestatechange]',members[_0x2a17da['device']]?members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]:_0x2a17da[_0xfbb8('0x1a')]),_0x14c32e);}};exports[_0xfbb8('0x26')]=function(_0x4ef419){try{if(!_[_0xfbb8('0x23')](members[_0x4ef419[_0xfbb8('0x8')]])){utils[_0xfbb8('0x18')](util['format'](_0xfbb8('0x27'),_0x4ef419['uniqueid']),_0x4ef419);utils[_0xfbb8('0x4')](util['format'](_0xfbb8('0x28'),_0x4ef419['uniqueid'],_0x4ef419['interface'],_0x4ef419[_0xfbb8('0x29')]));members[_0x4ef419[_0xfbb8('0x8')]]=_['assign'](members[_0x4ef419[_0xfbb8('0x8')]],{'data4':_0x4ef419['queue'],'uniqueid':_0x4ef419[_0xfbb8('0x7')]});}}catch(_0x3b37f5){utils[_0xfbb8('0x25')](util[_0xfbb8('0x5')](_0xfbb8('0x27'),_0x4ef419[_0xfbb8('0x7')]),_0x3b37f5);}};exports[_0xfbb8('0x2a')]=function(_0x5dc67c){try{utils[_0xfbb8('0x18')](util['format'](_0xfbb8('0x2b'),_0x5dc67c[_0xfbb8('0x7')]),_0x5dc67c);if(_0x5dc67c['channel']){var _0x3f0fb3=_0x5dc67c[_0xfbb8('0x9')][_0xfbb8('0x10')]('-')[0x0];if(!_[_0xfbb8('0x23')](members[_0x3f0fb3])){members[_0x3f0fb3]=_['assign'](members[_0x3f0fb3],{'data1':members[_0x3f0fb3][_0xfbb8('0x2c')]||_0x5dc67c[_0xfbb8('0xc')],'data2':members[_0x3f0fb3][_0xfbb8('0xa')]||_0x5dc67c['source'],'data3':members[_0x3f0fb3][_0xfbb8('0x2d')]||_0x5dc67c[_0xfbb8('0x2e')],'uniqueid':members[_0x3f0fb3]['uniqueid']||_0x5dc67c['uniqueid']});utils[_0xfbb8('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5dc67c[_0xfbb8('0x7')],members[_0x3f0fb3][_0xfbb8('0x2c')],members[_0x3f0fb3][_0xfbb8('0xa')],members[_0x3f0fb3][_0xfbb8('0x2d')]));if(members[_0x3f0fb3]['exitAt']){writeDB(members[_0x3f0fb3]);}}}if(_0x5dc67c[_0xfbb8('0x2f')]){var _0x4f56bf=_0x5dc67c[_0xfbb8('0x2f')][_0xfbb8('0x10')]('-')[0x0];if(!_[_0xfbb8('0x23')](members[_0x4f56bf])){members[_0x4f56bf]=_['assign'](members[_0x4f56bf],{'data1':members[_0x4f56bf][_0xfbb8('0x2c')]||_0x5dc67c[_0xfbb8('0xc')],'data2':members[_0x4f56bf][_0xfbb8('0xa')]||_0x5dc67c['source'],'data3':members[_0x4f56bf][_0xfbb8('0x2d')]||_0x5dc67c['destination'],'uniqueid':members[_0x4f56bf][_0xfbb8('0x7')]||_0x5dc67c[_0xfbb8('0x7')]});utils['info'](util[_0xfbb8('0x5')](_0xfbb8('0x30'),_0x5dc67c[_0xfbb8('0x7')],members[_0x4f56bf][_0xfbb8('0x2c')],members[_0x4f56bf][_0xfbb8('0xa')],members[_0x4f56bf][_0xfbb8('0x2d')]));if(members[_0x4f56bf][_0xfbb8('0x24')]){writeDB(members[_0x4f56bf]);}}}}catch(_0x1fd58b){utils['error'](util[_0xfbb8('0x5')]('[%s][members][cdr]',_0x5dc67c[_0xfbb8('0x7')]),_0x1fd58b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 057ecde..c19b30f 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cde=['queuecallerabandonAt','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerjoinAt','position','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','getVoiceQueueByName','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','value','toUpperCase'];(function(_0x2899ad,_0x3002c9){var _0x5df677=function(_0x5c3851){while(--_0x5c3851){_0x2899ad['push'](_0x2899ad['shift']());}};_0x5df677(++_0x3002c9);}(_0x1cde,0x16f));var _0xe1cd=function(_0x48f9a6,_0x4ea68d){_0x48f9a6=_0x48f9a6-0x0;var _0x24ad80=_0x1cde[_0x48f9a6];return _0x24ad80;};'use strict';var _=require('lodash');var util=require(_0xe1cd('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x100479){utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x2'),_0x100479[_0xe1cd('0x3')],_0x100479[_0xe1cd('0x4')],_0x100479['queue'],_0x100479[_0xe1cd('0x5')],_0x100479[_0xe1cd('0x6')],_0x100479['accountcode'],_0x100479['queuecallerexitreason']));if(_0x100479['queue']){utils[_0xe1cd('0x7')](_0x100479[_0xe1cd('0x8')])[_0xe1cd('0x9')](function(_0x10aab9){if(_0x10aab9){_0x100479[_0xe1cd('0xa')]=_0x10aab9['type'];}utils['request'](_0xe1cd('0xb'),_0x100479);});}else{utils[_0xe1cd('0xc')](_0xe1cd('0xb'),_0x100479);}if(_0x100479['transfereduniqueid']){delete queues[_0x100479[_0xe1cd('0xd')]];}else{delete queues[_0x100479[_0xe1cd('0x3')]];}}exports[_0xe1cd('0xe')]=function(_0x3b09fb){try{utils[_0xe1cd('0xf')](util['format']('[%s][queues][queuecallerjoin]',_0x3b09fb[_0xe1cd('0x3')]),_0x3b09fb);utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')](_0xe1cd('0x11'),_0x3b09fb[_0xe1cd('0x3')],_0x3b09fb[_0xe1cd('0x8')],_0x3b09fb['position']));queues[_0x3b09fb[_0xe1cd('0x3')]]=_[_0xe1cd('0x12')](_0x3b09fb,{'originalposition':_0x3b09fb['position'],'queuecallerjoinAt':utils[_0xe1cd('0x13')](),'mohtime':0x0});}catch(_0x5dfa5d){utils['error'](util[_0xe1cd('0x10')]('[%s][queues][queuecallerjoin]',_0x3b09fb[_0xe1cd('0x3')]),_0x5dfa5d);}};exports[_0xe1cd('0x14')]=function(_0x55b1fb){try{if(!_[_0xe1cd('0x15')](queues[_0x55b1fb[_0xe1cd('0x3')]])){utils['debug'](util['format'](_0xe1cd('0x16'),_0x55b1fb['uniqueid']),_0x55b1fb);if(queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0x17')]){if(!queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0x18')]&&!queues[_0x55b1fb['uniqueid']][_0xe1cd('0x19')]){queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0x1a')]=!![];queues[_0x55b1fb[_0xe1cd('0x3')]]['queuecallercompleteAt']=utils[_0xe1cd('0x13')]();queues[_0x55b1fb['uniqueid']][_0xe1cd('0x1b')]='COMPLETEDBYAGENT';}utils['info'](util[_0xe1cd('0x10')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x55b1fb['uniqueid'],queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0x1c')],queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0x1b')]));writeDB(queues[_0x55b1fb['uniqueid']]);}else if(queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0xd')]){utils['info'](util['format'](_0xe1cd('0x1d'),_0x55b1fb[_0xe1cd('0x3')],queues[_0x55b1fb['uniqueid']][_0xe1cd('0x1c')],queues[_0x55b1fb['uniqueid']][_0xe1cd('0xd')]));queues[queues[_0x55b1fb[_0xe1cd('0x3')]][_0xe1cd('0xd')]]=queues[_0x55b1fb[_0xe1cd('0x3')]];queues[queues[_0x55b1fb['uniqueid']][_0xe1cd('0xd')]][_0xe1cd('0x1e')]=0x2;delete queues[_0x55b1fb['uniqueid']];}}}catch(_0x1a0dde){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')](_0xe1cd('0x16'),_0x55b1fb['uniqueid']),_0x1a0dde);}};exports[_0xe1cd('0x20')]=function(_0x12e3ae){try{utils['debug'](util[_0xe1cd('0x10')](_0xe1cd('0x21'),_0x12e3ae[_0xe1cd('0x3')]),_0x12e3ae);if(!_[_0xe1cd('0x15')](_0x12e3ae[_0xe1cd('0x22')]['queuestatus'])&&_0x12e3ae[_0xe1cd('0x23')][_0xe1cd('0x24')]()!=='CONTINUE'){if(!_[_0xe1cd('0x15')](queues[_0x12e3ae[_0xe1cd('0x3')]])){queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x18')]=![];queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x25')]=null;queues[_0x12e3ae['uniqueid']][_0xe1cd('0x19')]=!![];queues[_0x12e3ae[_0xe1cd('0x3')]]['queuecallerexitAt']=utils[_0xe1cd('0x13')]();queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x1b')]=_0x12e3ae[_0xe1cd('0x23')][_0xe1cd('0x24')]();utils['info'](util[_0xe1cd('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x12e3ae[_0xe1cd('0x3')],queues[_0x12e3ae['uniqueid']]['name'],_0x12e3ae[_0xe1cd('0x23')],queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x1b')]));writeDB(queues[_0x12e3ae[_0xe1cd('0x3')]]);}}else if(!_[_0xe1cd('0x15')](_0x12e3ae[_0xe1cd('0x22')][_0xe1cd('0x26')])){if(!_[_0xe1cd('0x15')](queues[_0x12e3ae[_0xe1cd('0x3')]])&&!queues[_0x12e3ae[_0xe1cd('0x3')]]['queuecallerabandon']){queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x18')]=![];queues[_0x12e3ae['uniqueid']][_0xe1cd('0x25')]=null;queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x19')]=!![];queues[_0x12e3ae[_0xe1cd('0x3')]]['queuecallerexitAt']=utils[_0xe1cd('0x13')]();queues[_0x12e3ae['uniqueid']][_0xe1cd('0x1b')]='EXITWITHKEY';utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')](_0xe1cd('0x27'),_0x12e3ae['uniqueid'],queues[_0x12e3ae[_0xe1cd('0x3')]][_0xe1cd('0x1c')],_0x12e3ae['value'],queues[_0x12e3ae['uniqueid']][_0xe1cd('0x1b')]));}}}catch(_0x33acdb){utils['error'](util[_0xe1cd('0x10')](_0xe1cd('0x21'),_0x12e3ae['uniqueid']),_0x33acdb);}};exports[_0xe1cd('0x18')]=function(_0x40140d){try{if(!_[_0xe1cd('0x15')](queues[_0x40140d[_0xe1cd('0x3')]])){utils[_0xe1cd('0xf')](util[_0xe1cd('0x10')](_0xe1cd('0x28'),_0x40140d[_0xe1cd('0x3')]),_0x40140d);queues[_0x40140d[_0xe1cd('0x3')]][_0xe1cd('0x19')]=![];queues[_0x40140d[_0xe1cd('0x3')]][_0xe1cd('0x29')]=null;queues[_0x40140d['uniqueid']]['queuecallerabandon']=!![];queues[_0x40140d[_0xe1cd('0x3')]][_0xe1cd('0x25')]=utils[_0xe1cd('0x13')]();queues[_0x40140d['uniqueid']][_0xe1cd('0x1b')]='ABANDONED';utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')](_0xe1cd('0x2a'),_0x40140d[_0xe1cd('0x3')],queues[_0x40140d[_0xe1cd('0x3')]][_0xe1cd('0x1c')],queues[_0x40140d[_0xe1cd('0x3')]][_0xe1cd('0x1b')]));}}catch(_0x4970f9){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')](_0xe1cd('0x28'),_0x40140d['uniqueid']),_0x4970f9);}};exports[_0xe1cd('0x2b')]=function(_0x2aec5a){try{if(!_[_0xe1cd('0x15')](queues[_0x2aec5a[_0xe1cd('0x3')]])){utils[_0xe1cd('0xf')](util['format'](_0xe1cd('0x2c'),_0x2aec5a[_0xe1cd('0x3')]),_0x2aec5a);utils['info'](util['format'](_0xe1cd('0x2d'),_0x2aec5a['uniqueid'],queues[_0x2aec5a[_0xe1cd('0x3')]]['name'],_0x2aec5a[_0xe1cd('0x2e')],_0x2aec5a['connectedlinename']));queues[_0x2aec5a[_0xe1cd('0x3')]][_0xe1cd('0x2b')]=!![];queues[_0x2aec5a[_0xe1cd('0x3')]][_0xe1cd('0x17')]=utils[_0xe1cd('0x13')]();queues[_0x2aec5a['uniqueid']]['holdtime']=utils[_0xe1cd('0x2f')](queues[_0x2aec5a[_0xe1cd('0x3')]]['queuecallerleaveAt'],queues[_0x2aec5a['uniqueid']][_0xe1cd('0x30')]);queues[_0x2aec5a[_0xe1cd('0x3')]][_0xe1cd('0x31')]=_0x2aec5a[_0xe1cd('0x31')];queues[_0x2aec5a[_0xe1cd('0x3')]]['count']=_0x2aec5a[_0xe1cd('0x32')];queues[_0x2aec5a['uniqueid']][_0xe1cd('0x2e')]=_0x2aec5a[_0xe1cd('0x2e')];queues[_0x2aec5a[_0xe1cd('0x3')]][_0xe1cd('0x33')]=_0x2aec5a[_0xe1cd('0x33')];}}catch(_0x23fd09){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')](_0xe1cd('0x2c'),_0x2aec5a[_0xe1cd('0x3')]),_0x23fd09);}};exports[_0xe1cd('0x34')]=function(_0x2ea384){try{if(!_[_0xe1cd('0x15')](queues[_0x2ea384[_0xe1cd('0x3')]])){utils[_0xe1cd('0xf')](util[_0xe1cd('0x10')](_0xe1cd('0x35'),_0x2ea384['uniqueid']),_0x2ea384);utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x36'),_0x2ea384[_0xe1cd('0x3')],queues[_0x2ea384['uniqueid']][_0xe1cd('0x1c')],_0x2ea384['membername'],_0x2ea384[_0xe1cd('0x37')]));queues[_0x2ea384['uniqueid']][_0xe1cd('0x18')]=![];queues[_0x2ea384[_0xe1cd('0x3')]][_0xe1cd('0x18')]=![];queues[_0x2ea384['uniqueid']][_0xe1cd('0x25')]=null;queues[_0x2ea384['uniqueid']][_0xe1cd('0x19')]=![];queues[_0x2ea384['uniqueid']]['queuecallerexitreason']=null;queues[_0x2ea384[_0xe1cd('0x3')]][_0xe1cd('0x29')]=null;queues[_0x2ea384[_0xe1cd('0x3')]]['assigned']=!![];queues[_0x2ea384['uniqueid']][_0xe1cd('0x38')]=_0x2ea384['destaccountcode'];queues[_0x2ea384['uniqueid']][_0xe1cd('0x5')]=_0x2ea384[_0xe1cd('0x39')];}}catch(_0x3aa1b4){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')]('[%s][queues][agentconnect]',_0x2ea384['uniqueid']),_0x3aa1b4);}};exports[_0xe1cd('0x3a')]=function(_0x283da6){try{if(!_[_0xe1cd('0x15')](queues[_0x283da6['uniqueid']])){if(queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x17')]){utils[_0xe1cd('0xf')](util['format'](_0xe1cd('0x3b'),_0x283da6[_0xe1cd('0x3')]),_0x283da6);queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x18')]=![];queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x18')]=![];queues[_0x283da6['uniqueid']][_0xe1cd('0x25')]=null;queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x19')]=![];queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x29')]=null;queues[_0x283da6[_0xe1cd('0x3')]]['assigned']=!![];queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x5')]=_0x283da6['membername'];queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x1a')]=!![];queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x3c')]=utils['now']();if(_0x283da6['reason']==_0xe1cd('0x3d')){if(!queues[_0x283da6['uniqueid']]['transfer']){queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x1b')]='TRANSFER';}}else{queues[_0x283da6[_0xe1cd('0x3')]]['queuecallerexitreason']='COMPLETEDBY'+_0x283da6['reason'][_0xe1cd('0x24')]();}utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x283da6['uniqueid'],queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x1c')],_0x283da6[_0xe1cd('0x39')],queues[_0x283da6[_0xe1cd('0x3')]][_0xe1cd('0x1b')]));writeDB(queues[_0x283da6[_0xe1cd('0x3')]]);}}}catch(_0x16d42b){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')]('[%s][queues][agentcomplete]',_0x283da6[_0xe1cd('0x3')]),_0x16d42b);}};exports[_0xe1cd('0x3e')]=function(_0x1c8140){try{if(!_['isNil'](queues[_0x1c8140['transfereeuniqueid']])){utils[_0xe1cd('0xf')](util[_0xe1cd('0x10')](_0xe1cd('0x3f'),_0x1c8140[_0xe1cd('0x3')]),_0x1c8140);queues[_0x1c8140[_0xe1cd('0x40')]][_0xe1cd('0x3d')]=!![];queues[_0x1c8140['transfereeuniqueid']]['transfertype']=_0xe1cd('0x41');queues[_0x1c8140[_0xe1cd('0x40')]][_0xe1cd('0x42')]=_0x1c8140[_0xe1cd('0x43')];queues[_0x1c8140[_0xe1cd('0x40')]]['transferuniqueid']=_0x1c8140['transfereeuniqueid'];queues[_0x1c8140['transfereeuniqueid']][_0xe1cd('0x1b')]=_0xe1cd('0x44');utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x45'),_0x1c8140[_0xe1cd('0x3')],queues[_0x1c8140[_0xe1cd('0x40')]]['name'],_0x1c8140['transfereeuniqueid'],_0x1c8140['extension']));}}catch(_0xd5e170){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')]('[%s][queues][blindtransfer]',_0x1c8140[_0xe1cd('0x3')]),_0xd5e170);}};exports[_0xe1cd('0x46')]=function(_0x55ac2b){try{utils[_0xe1cd('0xf')](util[_0xe1cd('0x10')](_0xe1cd('0x47'),_0x55ac2b[_0xe1cd('0x48')]),_0x55ac2b);if(_0x55ac2b[_0xe1cd('0x48')]==_0x55ac2b[_0xe1cd('0x49')]){if(!_[_0xe1cd('0x15')](queues[_0x55ac2b[_0xe1cd('0x4a')]])){utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x4b'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x1c')],_0x55ac2b[_0xe1cd('0x4c')]));queues[_0x55ac2b['secondtransfererlinkedid']][_0xe1cd('0x3d')]=!![];queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x4d')]=_0xe1cd('0x4e');queues[_0x55ac2b['secondtransfererlinkedid']][_0xe1cd('0x42')]=_0x55ac2b[_0xe1cd('0x4c')];queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x4f')]=_0x55ac2b[_0xe1cd('0x48')];queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x1b')]=_0xe1cd('0x50');}if(!_[_0xe1cd('0x15')](queues[_0x55ac2b[_0xe1cd('0x49')]])){if(_0x55ac2b[_0xe1cd('0x51')]&&queues[_0x55ac2b['transfereelinkedid']]){queues[_0x55ac2b[_0xe1cd('0x51')]][_0xe1cd('0x1e')]=0x1;queues[_0x55ac2b[_0xe1cd('0x40')]]=_[_0xe1cd('0x52')](queues[_0x55ac2b[_0xe1cd('0x51')]]);queues[_0x55ac2b[_0xe1cd('0x40')]][_0xe1cd('0xd')]=_0x55ac2b['transfertargetuniqueid'];queues[_0x55ac2b[_0xe1cd('0x40')]]['queuecallerenterreason']=0x2;queues[_0x55ac2b[_0xe1cd('0x40')]]['calleridnum']=queues[_0x55ac2b['secondtransfererlinkedid']][_0xe1cd('0x6')];queues[_0x55ac2b[_0xe1cd('0x40')]][_0xe1cd('0x53')]=queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x53')];queues[_0x55ac2b[_0xe1cd('0x40')]][_0xe1cd('0x30')]=utils['now']();queues[_0x55ac2b[_0xe1cd('0x40')]]['queuecallerleaveAt']=utils[_0xe1cd('0x13')]();queues[_0x55ac2b[_0xe1cd('0x40')]]['holdtime']=0x0;queues[_0x55ac2b[_0xe1cd('0x40')]]['mohtime']=0x0;utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x54'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b['transfereeuniqueid']][_0xe1cd('0x1c')],queues[_0x55ac2b[_0xe1cd('0x40')]]['calleridnum'],queues[_0x55ac2b['transfereeuniqueid']][_0xe1cd('0x53')]));}else{utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')](_0xe1cd('0x55'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0x1c')],_0x55ac2b[_0xe1cd('0x4a')]));queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0xd')]=_0x55ac2b['secondtransfererlinkedid'];}}}else if(_0x55ac2b[_0xe1cd('0x56')]==_0x55ac2b[_0xe1cd('0x4a')]){if(!_[_0xe1cd('0x15')](queues[_0x55ac2b['origtransfererlinkedid']])){utils['info'](util['format'](_0xe1cd('0x57'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b[_0xe1cd('0x49')]]['name'],_0x55ac2b[_0xe1cd('0x56')],_0x55ac2b[_0xe1cd('0x58')]));queues[_0x55ac2b['origtransfererlinkedid']][_0xe1cd('0x3d')]=!![];queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0x4d')]=_0xe1cd('0x4e');queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0x42')]=_0x55ac2b[_0xe1cd('0x58')];queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0x4f')]=_0x55ac2b['secondtransfereruniqueid'];queues[_0x55ac2b[_0xe1cd('0x49')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xe1cd('0x15')](queues[_0x55ac2b[_0xe1cd('0x4a')]])){if(_0x55ac2b[_0xe1cd('0x59')]&&queues[_0x55ac2b['transfertargetlinkedid']]){queues[_0x55ac2b[_0xe1cd('0x59')]][_0xe1cd('0x1e')]=0x1;queues[_0x55ac2b['transfertargetuniqueid']]=_['clone'](queues[_0x55ac2b[_0xe1cd('0x59')]]);queues[_0x55ac2b[_0xe1cd('0x5a')]]['transfereduniqueid']=_0x55ac2b[_0xe1cd('0x5a')];queues[_0x55ac2b['transfertargetuniqueid']][_0xe1cd('0x1e')]=0x2;queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x6')]=queues[_0x55ac2b[_0xe1cd('0x49')]]['calleridnum'];queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x53')]=queues[_0x55ac2b[_0xe1cd('0x49')]][_0xe1cd('0x53')];queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x30')]=utils[_0xe1cd('0x13')]();queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x17')]=utils[_0xe1cd('0x13')]();queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x5b')]=0x0;queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x5c')]=0x0;utils['info'](util[_0xe1cd('0x10')](_0xe1cd('0x5d'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b['transfertargetuniqueid']][_0xe1cd('0x1c')],queues[_0x55ac2b[_0xe1cd('0x5a')]]['transfereduniqueid'],queues[_0x55ac2b[_0xe1cd('0x5a')]]['calleridnum'],queues[_0x55ac2b[_0xe1cd('0x5a')]][_0xe1cd('0x53')]));}else{utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x55'),_0x55ac2b[_0xe1cd('0x48')],queues[_0x55ac2b[_0xe1cd('0x4a')]][_0xe1cd('0x1c')],_0x55ac2b['origtransfererlinkedid']));queues[_0x55ac2b['secondtransfererlinkedid']]['transfereduniqueid']=_0x55ac2b[_0xe1cd('0x49')];}}}}catch(_0x48094e){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')](_0xe1cd('0x47'),_0x55ac2b['origtransfereruniqueid']),_0x48094e);}};exports[_0xe1cd('0x5e')]=function(_0x214822){try{if(!_['isNil'](queues[_0x214822['uniqueid']])){utils[_0xe1cd('0xf')](util[_0xe1cd('0x10')](_0xe1cd('0x5f'),_0x214822[_0xe1cd('0x3')]),_0x214822);queues[_0x214822[_0xe1cd('0x3')]][_0xe1cd('0x60')]=utils[_0xe1cd('0x13')]();utils[_0xe1cd('0x1')](util['format'](_0xe1cd('0x61'),_0x214822['uniqueid'],queues[_0x214822[_0xe1cd('0x3')]]['name'],queues[_0x214822[_0xe1cd('0x3')]]['musiconholdstartAt']));}}catch(_0x18a5b5){utils[_0xe1cd('0x1f')](util[_0xe1cd('0x10')](_0xe1cd('0x5f'),_0x214822[_0xe1cd('0x3')]),_0x18a5b5);}};exports[_0xe1cd('0x62')]=function(_0x50d52b){try{if(!_[_0xe1cd('0x15')](queues[_0x50d52b[_0xe1cd('0x3')]])){if(!_['isNil'](queues[_0x50d52b['uniqueid']][_0xe1cd('0x60')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x50d52b[_0xe1cd('0x3')]),_0x50d52b);queues[_0x50d52b[_0xe1cd('0x3')]][_0xe1cd('0x5c')]+=utils[_0xe1cd('0x2f')](utils['now'](),queues[_0x50d52b[_0xe1cd('0x3')]][_0xe1cd('0x60')]);utils[_0xe1cd('0x1')](util[_0xe1cd('0x10')](_0xe1cd('0x63'),_0x50d52b[_0xe1cd('0x3')],queues[_0x50d52b[_0xe1cd('0x3')]][_0xe1cd('0x1c')],queues[_0x50d52b[_0xe1cd('0x3')]][_0xe1cd('0x5c')]));delete queues[_0x50d52b['uniqueid']][_0xe1cd('0x60')];}}}catch(_0x2349d0){utils[_0xe1cd('0x1f')](util['format'](_0xe1cd('0x64'),_0x50d52b[_0xe1cd('0x3')]),_0x2349d0);}}; \ No newline at end of file +var _0xba9b=['queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba9b,0x1b5));var _0xbba9=function(_0x1ef1ee,_0x72bc1d){_0x1ef1ee=_0x1ef1ee-0x0;var _0x27a313=_0xba9b[_0x1ef1ee];return _0x27a313;};'use strict';var _=require(_0xbba9('0x0'));var util=require(_0xbba9('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x29b415){utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x4'),_0x29b415[_0xbba9('0x5')],_0x29b415[_0xbba9('0x6')],_0x29b415[_0xbba9('0x7')],_0x29b415[_0xbba9('0x8')],_0x29b415[_0xbba9('0x9')],_0x29b415[_0xbba9('0xa')],_0x29b415[_0xbba9('0xb')]));if(_0x29b415[_0xbba9('0x7')]){utils[_0xbba9('0xc')](_0x29b415[_0xbba9('0x7')])['then'](function(_0x14fac3){if(_0x14fac3){_0x29b415[_0xbba9('0xd')]=_0x14fac3[_0xbba9('0xd')];}utils[_0xbba9('0xe')](_0xbba9('0xf'),_0x29b415);});}else{utils[_0xbba9('0xe')](_0xbba9('0xf'),_0x29b415);}if(_0x29b415[_0xbba9('0x10')]){delete queues[_0x29b415[_0xbba9('0x10')]];}else{delete queues[_0x29b415[_0xbba9('0x5')]];}}exports['queuecallerjoin']=function(_0x13d26e){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x12'),_0x13d26e[_0xbba9('0x5')]),_0x13d26e);utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x13'),_0x13d26e['uniqueid'],_0x13d26e[_0xbba9('0x7')],_0x13d26e['position']));queues[_0x13d26e['uniqueid']]=_[_0xbba9('0x14')](_0x13d26e,{'originalposition':_0x13d26e[_0xbba9('0x15')],'queuecallerjoinAt':utils[_0xbba9('0x16')](),'mohtime':0x0});}catch(_0xc5489b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x12'),_0x13d26e[_0xbba9('0x5')]),_0xc5489b);}};exports[_0xbba9('0x18')]=function(_0x552953){try{if(!_['isNil'](queues[_0x552953[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x19'),_0x552953[_0xbba9('0x5')]),_0x552953);if(queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1a')]){if(!queues[_0x552953['uniqueid']]['queuecallerabandon']&&!queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1b')]){queues[_0x552953['uniqueid']]['queuecallercomplete']=!![];queues[_0x552953[_0xbba9('0x5')]]['queuecallercompleteAt']=utils[_0xbba9('0x16')]();queues[_0x552953[_0xbba9('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x1c'),_0x552953[_0xbba9('0x5')],queues[_0x552953['uniqueid']]['name'],queues[_0x552953[_0xbba9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x552953['uniqueid']]);}else if(queues[_0x552953['uniqueid']]['transfereduniqueid']){utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x1d'),_0x552953[_0xbba9('0x5')],queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x10')]));queues[queues[_0x552953[_0xbba9('0x5')]]['transfereduniqueid']]=queues[_0x552953[_0xbba9('0x5')]];queues[queues[_0x552953['uniqueid']][_0xbba9('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x552953[_0xbba9('0x5')]];}}}catch(_0x20b81c){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x19'),_0x552953[_0xbba9('0x5')]),_0x20b81c);}};exports['varset']=function(_0x1bd079){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')]('[%s][queues][varset]',_0x1bd079[_0xbba9('0x5')]),_0x1bd079);if(!_[_0xbba9('0x1f')](_0x1bd079['variable'][_0xbba9('0x20')])&&_0x1bd079[_0xbba9('0x21')][_0xbba9('0x22')]()!==_0xbba9('0x23')){if(!_[_0xbba9('0x1f')](queues[_0x1bd079[_0xbba9('0x5')]])){queues[_0x1bd079['uniqueid']][_0xbba9('0x24')]=![];queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerabandonAt']=null;queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x1b')]=!![];queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]=_0x1bd079[_0xbba9('0x21')][_0xbba9('0x22')]();utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x25'),_0x1bd079['uniqueid'],queues[_0x1bd079[_0xbba9('0x5')]]['name'],_0x1bd079[_0xbba9('0x21')],queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]));writeDB(queues[_0x1bd079[_0xbba9('0x5')]]);}}else if(!_[_0xbba9('0x1f')](_0x1bd079[_0xbba9('0x26')]['queueposition'])){if(!_['isNil'](queues[_0x1bd079['uniqueid']])&&!queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerabandon']){queues[_0x1bd079['uniqueid']][_0xbba9('0x24')]=![];queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x27')]=null;queues[_0x1bd079['uniqueid']][_0xbba9('0x1b')]=!![];queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x28')]=utils[_0xbba9('0x16')]();queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]=_0xbba9('0x29');utils['info'](util[_0xbba9('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1bd079[_0xbba9('0x5')],queues[_0x1bd079['uniqueid']][_0xbba9('0x1e')],_0x1bd079['value'],queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]));}}}catch(_0x53b01b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x2a'),_0x1bd079[_0xbba9('0x5')]),_0x53b01b);}};exports[_0xbba9('0x24')]=function(_0x23f70e){try{if(!_[_0xbba9('0x1f')](queues[_0x23f70e[_0xbba9('0x5')]])){utils['debug'](util[_0xbba9('0x3')]('[%s][queues][queuecallerabandon]',_0x23f70e[_0xbba9('0x5')]),_0x23f70e);queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0x1b')]=![];queues[_0x23f70e[_0xbba9('0x5')]]['queuecallerexitAt']=null;queues[_0x23f70e[_0xbba9('0x5')]]['queuecallerabandon']=!![];queues[_0x23f70e['uniqueid']]['queuecallerabandonAt']=utils[_0xbba9('0x16')]();queues[_0x23f70e['uniqueid']][_0xbba9('0xb')]='ABANDONED';utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x23f70e['uniqueid'],queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0xb')]));}}catch(_0x26efaf){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x2b'),_0x23f70e[_0xbba9('0x5')]),_0x26efaf);}};exports['queuecallerleave']=function(_0xc70166){try{if(!_[_0xbba9('0x1f')](queues[_0xc70166[_0xbba9('0x5')]])){utils['debug'](util[_0xbba9('0x3')](_0xbba9('0x2c'),_0xc70166['uniqueid']),_0xc70166);utils['info'](util[_0xbba9('0x3')](_0xbba9('0x2d'),_0xc70166[_0xbba9('0x5')],queues[_0xc70166[_0xbba9('0x5')]]['name'],_0xc70166[_0xbba9('0x2e')],_0xc70166['connectedlinename']));queues[_0xc70166[_0xbba9('0x5')]]['queuecallerleave']=!![];queues[_0xc70166['uniqueid']][_0xbba9('0x1a')]=utils[_0xbba9('0x16')]();queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x2f')]=utils['diffTime'](queues[_0xc70166[_0xbba9('0x5')]]['queuecallerleaveAt'],queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x30')]);queues[_0xc70166['uniqueid']][_0xbba9('0x15')]=_0xc70166['position'];queues[_0xc70166['uniqueid']][_0xbba9('0x31')]=_0xc70166[_0xbba9('0x31')];queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x2e')]=_0xc70166['connectedlinenum'];queues[_0xc70166['uniqueid']][_0xbba9('0x32')]=_0xc70166[_0xbba9('0x32')];}}catch(_0x284b47){utils[_0xbba9('0x17')](util[_0xbba9('0x3')]('[%s][queues][queuecallerleave]',_0xc70166[_0xbba9('0x5')]),_0x284b47);}};exports[_0xbba9('0x33')]=function(_0x27b2b1){try{if(!_[_0xbba9('0x1f')](queues[_0x27b2b1[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util['format'](_0xbba9('0x34'),_0x27b2b1[_0xbba9('0x5')]),_0x27b2b1);utils['info'](util[_0xbba9('0x3')](_0xbba9('0x35'),_0x27b2b1[_0xbba9('0x5')],queues[_0x27b2b1['uniqueid']][_0xbba9('0x1e')],_0x27b2b1[_0xbba9('0x36')],_0x27b2b1['destaccountcode']));queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x27')]=null;queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x1b')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0xb')]=null;queues[_0x27b2b1['uniqueid']][_0xbba9('0x28')]=null;queues[_0x27b2b1['uniqueid']][_0xbba9('0x37')]=!![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0xa')]=_0x27b2b1[_0xbba9('0x38')];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x8')]=_0x27b2b1[_0xbba9('0x36')];}}catch(_0x46ff42){utils[_0xbba9('0x17')](util[_0xbba9('0x3')]('[%s][queues][agentconnect]',_0x27b2b1[_0xbba9('0x5')]),_0x46ff42);}};exports[_0xbba9('0x39')]=function(_0x134514){try{if(!_[_0xbba9('0x1f')](queues[_0x134514[_0xbba9('0x5')]])){if(queues[_0x134514['uniqueid']][_0xbba9('0x1a')]){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x3a'),_0x134514[_0xbba9('0x5')]),_0x134514);queues[_0x134514['uniqueid']][_0xbba9('0x24')]=![];queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x134514['uniqueid']]['queuecallerabandonAt']=null;queues[_0x134514['uniqueid']]['queuecallerexit']=![];queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x28')]=null;queues[_0x134514['uniqueid']][_0xbba9('0x37')]=!![];queues[_0x134514['uniqueid']][_0xbba9('0x8')]=_0x134514['membername'];queues[_0x134514['uniqueid']][_0xbba9('0x3b')]=!![];queues[_0x134514['uniqueid']][_0xbba9('0x3c')]=utils[_0xbba9('0x16')]();if(_0x134514[_0xbba9('0x3d')]==_0xbba9('0x3e')){if(!queues[_0x134514[_0xbba9('0x5')]]['transfer']){queues[_0x134514['uniqueid']][_0xbba9('0xb')]=_0xbba9('0x3f');}}else{queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0xb')]='COMPLETEDBY'+_0x134514[_0xbba9('0x3d')][_0xbba9('0x22')]();}utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x40'),_0x134514[_0xbba9('0x5')],queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x1e')],_0x134514[_0xbba9('0x36')],queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0xb')]));writeDB(queues[_0x134514[_0xbba9('0x5')]]);}}}catch(_0x334b85){utils['error'](util['format'](_0xbba9('0x3a'),_0x134514['uniqueid']),_0x334b85);}};exports['blindtransfer']=function(_0x438470){try{if(!_['isNil'](queues[_0x438470['transfereeuniqueid']])){utils['debug'](util[_0xbba9('0x3')](_0xbba9('0x41'),_0x438470[_0xbba9('0x5')]),_0x438470);queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x3e')]=!![];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x43')]=_0xbba9('0x44');queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x45')]=_0x438470[_0xbba9('0x46')];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x47')]=_0x438470[_0xbba9('0x42')];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0xb')]='BLINDTRANSFER';utils['info'](util[_0xbba9('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x438470[_0xbba9('0x5')],queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x1e')],_0x438470[_0xbba9('0x42')],_0x438470[_0xbba9('0x46')]));}}catch(_0x9a9256){utils['error'](util[_0xbba9('0x3')](_0xbba9('0x41'),_0x438470[_0xbba9('0x5')]),_0x9a9256);}};exports['attendedtransfer']=function(_0x1a822b){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')]('[%s][queues][attendedtransfer]',_0x1a822b['origtransfereruniqueid']),_0x1a822b);if(_0x1a822b[_0xbba9('0x48')]==_0x1a822b['origtransfererlinkedid']){if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x49')]])){utils[_0xbba9('0x2')](util['format'](_0xbba9('0x4a'),_0x1a822b['origtransfereruniqueid'],queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x1e')],_0x1a822b[_0xbba9('0x4b')]));queues[_0x1a822b[_0xbba9('0x49')]]['transfer']=!![];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x43')]=_0xbba9('0x4c');queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x45')]=_0x1a822b[_0xbba9('0x4b')];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x47')]=_0x1a822b[_0xbba9('0x48')];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0xb')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x4d')]])){if(_0x1a822b[_0xbba9('0x4e')]&&queues[_0x1a822b[_0xbba9('0x4e')]]){queues[_0x1a822b[_0xbba9('0x4e')]][_0xbba9('0x4f')]=0x1;queues[_0x1a822b['transfereeuniqueid']]=_[_0xbba9('0x50')](queues[_0x1a822b[_0xbba9('0x4e')]]);queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x10')]=_0x1a822b[_0xbba9('0x51')];queues[_0x1a822b[_0xbba9('0x42')]]['queuecallerenterreason']=0x2;queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x9')]=queues[_0x1a822b[_0xbba9('0x49')]]['calleridnum'];queues[_0x1a822b['transfereeuniqueid']]['calleridname']=queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x52')];queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x30')]=utils[_0xbba9('0x16')]();queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x1a')]=utils['now']();queues[_0x1a822b[_0xbba9('0x42')]]['holdtime']=0x0;queues[_0x1a822b[_0xbba9('0x42')]]['mohtime']=0x0;utils['info'](util[_0xbba9('0x3')](_0xbba9('0x53'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x1e')],queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x9')],queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x52')]));}else{utils['info'](util['format'](_0xbba9('0x54'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x4d')]]['name'],_0x1a822b[_0xbba9('0x49')]));queues[_0x1a822b['origtransfererlinkedid']][_0xbba9('0x10')]=_0x1a822b[_0xbba9('0x49')];}}}else if(_0x1a822b[_0xbba9('0x55')]==_0x1a822b['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x4d')]])){utils[_0xbba9('0x2')](util['format'](_0xbba9('0x56'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x1e')],_0x1a822b['secondtransfereruniqueid'],_0x1a822b[_0xbba9('0x57')]));queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x3e')]=!![];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x43')]='ATTENDED';queues[_0x1a822b[_0xbba9('0x4d')]]['transferexten']=_0x1a822b[_0xbba9('0x57')];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x47')]=_0x1a822b[_0xbba9('0x55')];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0xb')]=_0xbba9('0x58');}if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x49')]])){if(_0x1a822b[_0xbba9('0x59')]&&queues[_0x1a822b[_0xbba9('0x59')]]){queues[_0x1a822b[_0xbba9('0x59')]][_0xbba9('0x4f')]=0x1;queues[_0x1a822b[_0xbba9('0x51')]]=_[_0xbba9('0x50')](queues[_0x1a822b['transfertargetlinkedid']]);queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x10')]=_0x1a822b['transfertargetuniqueid'];queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x4f')]=0x2;queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x9')]=queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x9')];queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x52')]=queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x52')];queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x30')]=utils[_0xbba9('0x16')]();queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x1a')]=utils[_0xbba9('0x16')]();queues[_0x1a822b[_0xbba9('0x51')]]['holdtime']=0x0;queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x5a')]=0x0;utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x1e')],queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x10')],queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x9')],queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x52')]));}else{utils[_0xbba9('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x1e')],_0x1a822b[_0xbba9('0x4d')]));queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x10')]=_0x1a822b['origtransfererlinkedid'];}}}}catch(_0x57202b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x5b'),_0x1a822b[_0xbba9('0x48')]),_0x57202b);}};exports['musiconholdstart']=function(_0x3275c2){try{if(!_[_0xbba9('0x1f')](queues[_0x3275c2[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x5c'),_0x3275c2[_0xbba9('0x5')]),_0x3275c2);queues[_0x3275c2[_0xbba9('0x5')]]['musiconholdstartAt']=utils[_0xbba9('0x16')]();utils['info'](util[_0xbba9('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3275c2[_0xbba9('0x5')],queues[_0x3275c2[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x3275c2['uniqueid']][_0xbba9('0x5d')]));}}catch(_0x2b107d){utils['error'](util['format'](_0xbba9('0x5c'),_0x3275c2[_0xbba9('0x5')]),_0x2b107d);}};exports[_0xbba9('0x5e')]=function(_0x3fe1a1){try{if(!_[_0xbba9('0x1f')](queues[_0x3fe1a1[_0xbba9('0x5')]])){if(!_['isNil'](queues[_0x3fe1a1['uniqueid']][_0xbba9('0x5d')])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x5f'),_0x3fe1a1[_0xbba9('0x5')]),_0x3fe1a1);queues[_0x3fe1a1['uniqueid']]['mohtime']+=utils[_0xbba9('0x60')](utils['now'](),queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5d')]);utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3fe1a1[_0xbba9('0x5')],queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5a')]));delete queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5d')];}}}catch(_0x1aa08f){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x5f'),_0x3fe1a1[_0xbba9('0x5')]),_0x1aa08f);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index be02ea3..417e207 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 _0x0925=['format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils'];(function(_0x32ca5a,_0x3bb076){var _0x1a9c63=function(_0x5518b6){while(--_0x5518b6){_0x32ca5a['push'](_0x32ca5a['shift']());}};_0x1a9c63(++_0x3bb076);}(_0x0925,0x1af));var _0x5092=function(_0xdf5452,_0x19af67){_0xdf5452=_0xdf5452-0x0;var _0xf35e7b=_0x0925[_0xdf5452];return _0xf35e7b;};'use strict';var _=require(_0x5092('0x0'));var util=require(_0x5092('0x1'));var utils=require(_0x5092('0x2'));var recordings={};function writeDB(_0x2877c0){utils['info'](util[_0x5092('0x3')](_0x5092('0x4'),_0x2877c0[_0x5092('0x5')]));if(_0x2877c0[_0x5092('0x6')]){utils[_0x5092('0x7')](_0x2877c0['accountcode'])[_0x5092('0x8')](function(_0x582394){if(_0x582394){_0x2877c0[_0x5092('0x9')]=_0x582394['name'];_0x2877c0[_0x5092('0xa')]=_0x582394['id'];}utils['request'](_0x5092('0xb'),_0x2877c0);});}else{utils[_0x5092('0xc')](_0x5092('0xb'),_0x2877c0);}}exports[_0x5092('0xd')]=function(_0x4ee0ed){try{utils[_0x5092('0xe')](util[_0x5092('0x3')](_0x5092('0xf'),_0x4ee0ed[_0x5092('0x5')]),_0x4ee0ed);if(_0x4ee0ed[_0x5092('0x5')]==_0x4ee0ed[_0x5092('0x10')]){utils[_0x5092('0x11')](util[_0x5092('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x4ee0ed['uniqueid'],_0x4ee0ed[_0x5092('0x12')],_0x4ee0ed[_0x5092('0x13')]));recordings[_0x4ee0ed['uniqueid']]={'uniqueid':_0x4ee0ed[_0x5092('0x5')],'accountcode':_0x4ee0ed['accountcode'],'exten':_0x4ee0ed[_0x5092('0x13')],'context':_0x4ee0ed['context'],'channel':_0x4ee0ed[_0x5092('0x14')],'monitors':[]};}}catch(_0xd040b8){utils[_0x5092('0x15')](util['format'](_0x5092('0xf'),_0x4ee0ed[_0x5092('0x5')]),_0xd040b8);}};exports[_0x5092('0x16')]=function(_0x54d988){try{utils['debug'](util['format'](_0x5092('0x17'),_0x54d988['uniqueid']),_0x54d988);if(!_[_0x5092('0x18')](recordings[_0x54d988[_0x5092('0x5')]])&&_0x54d988['channelstate']==0x6){utils[_0x5092('0x11')](util['format'](_0x5092('0x19'),_0x54d988['uniqueid'],_0x54d988['context'],_0x54d988[_0x5092('0x14')]));}else if(!_[_0x5092('0x18')](recordings[_0x54d988['linkedid']])&&_0x54d988['channelstate']==0x6&&_0x54d988[_0x5092('0x12')]!=_0x5092('0x1a')){utils['info'](util['format'](_0x5092('0x1b'),_0x54d988[_0x5092('0x5')],_0x54d988[_0x5092('0x10')],_0x54d988[_0x5092('0x12')],_0x54d988[_0x5092('0x14')]));recordings[_0x54d988[_0x5092('0x10')]][_0x5092('0x6')]=_0x54d988[_0x5092('0x6')];}}catch(_0x4f3c68){utils[_0x5092('0x15')](util['format'](_0x5092('0x17'),_0x54d988['uniqueid']),_0x4f3c68);}};exports[_0x5092('0x1c')]=function(_0x125d39){try{if(!_[_0x5092('0x18')](_0x125d39['variable'])&&!_['isNil'](_0x125d39[_0x5092('0x1d')][_0x5092('0x1e')])){utils[_0x5092('0xe')](util[_0x5092('0x3')]('[%s][recordings][varset]',_0x125d39['uniqueid']),_0x125d39);utils[_0x5092('0x11')](util['format'](_0x5092('0x1f'),_0x125d39[_0x5092('0x5')],_0x125d39['variable'],_0x125d39[_0x5092('0x20')]));if(_[_0x5092('0x21')](_0x125d39[_0x5092('0x20')],_0x5092('0x22'))){_0x125d39[_0x5092('0x20')]=_0x125d39[_0x5092('0x20')]['replace']('.wav49',_0x5092('0x23'));}if(recordings[_0x125d39[_0x5092('0x10')]]){var _0x198d42=_[_0x5092('0x24')](recordings[_0x125d39[_0x5092('0x10')]][_0x5092('0x25')],{'value':_0x125d39[_0x5092('0x20')]});if(_[_0x5092('0x18')](_0x198d42)){recordings[_0x125d39[_0x5092('0x10')]]['monitors']['push']({'value':_0x125d39[_0x5092('0x20')]});}}}}catch(_0x576e43){utils['error'](util[_0x5092('0x3')]('[%s][recordings][varset]',_0x125d39[_0x5092('0x5')]),_0x576e43);}};exports[_0x5092('0x26')]=function(_0x5a3244){try{if(!_[_0x5092('0x18')](recordings[_0x5a3244[_0x5092('0x5')]])){utils[_0x5092('0xe')](util[_0x5092('0x3')]('[%s][recordings][hangup]',_0x5a3244['uniqueid']),_0x5a3244);utils['info'](util[_0x5092('0x3')](_0x5092('0x27'),_0x5a3244[_0x5092('0x5')],_0x5a3244[_0x5092('0x28')],_0x5a3244[_0x5092('0x29')],_0x5a3244[_0x5092('0x2a')]));recordings[_0x5a3244[_0x5092('0x5')]][_0x5092('0x28')]=_0x5a3244[_0x5092('0x28')];recordings[_0x5a3244['uniqueid']][_0x5092('0x29')]=_0x5a3244[_0x5092('0x29')];recordings[_0x5a3244['uniqueid']][_0x5092('0x2b')]=_0x5a3244[_0x5092('0x2b')];recordings[_0x5a3244[_0x5092('0x5')]]['connectedlinename']=_0x5a3244[_0x5092('0x2c')];if(recordings[_0x5a3244['uniqueid']][_0x5092('0x2d')]=='outbound'&&recordings[_0x5a3244[_0x5092('0x5')]][_0x5092('0x6')]){recordings[_0x5a3244['uniqueid']][_0x5092('0x2b')]=recordings[_0x5a3244[_0x5092('0x5')]][_0x5092('0x6')];recordings[_0x5a3244['uniqueid']]['connectedlinename']='';}recordings[_0x5a3244[_0x5092('0x5')]][_0x5092('0x25')]['forEach'](function(_0x50afc0){var _0x33b7b2=_[_0x5092('0x2e')](recordings[_0x5a3244[_0x5092('0x5')]]);_0x33b7b2[_0x5092('0x20')]=_0x50afc0[_0x5092('0x20')];writeDB(_0x33b7b2);});delete recordings[_0x5a3244[_0x5092('0x5')]];}}catch(_0x2260df){utils[_0x5092('0x15')](util[_0x5092('0x3')]('[%s][recordings][hangup]',_0x5a3244[_0x5092('0x5')]),_0x2260df);}};exports[_0x5092('0x2f')]=function(_0x6e1fca){try{if(!_[_0x5092('0x18')](recordings[_0x6e1fca[_0x5092('0x5')]])){utils[_0x5092('0xe')](util[_0x5092('0x3')](_0x5092('0x30'),_0x6e1fca[_0x5092('0x5')]),_0x6e1fca);utils[_0x5092('0x11')](util[_0x5092('0x3')](_0x5092('0x31'),_0x6e1fca[_0x5092('0x5')],_0x6e1fca[_0x5092('0x32')],_0x6e1fca[_0x5092('0x33')]));if(_0x6e1fca[_0x5092('0x32')][_0x5092('0x34')]()==_0x5092('0x35')&&_[_0x5092('0x36')](_0x6e1fca[_0x5092('0x33')][_0x5092('0x34')](),_0x5092('0x37'))){var _0x878a0b=_0x6e1fca[_0x5092('0x33')][_0x5092('0x38')]('=');var _0x122659=_0x878a0b[0x0][_0x5092('0x39')](_0x878a0b[0x0][_0x5092('0x3a')]('(')+0x1,_0x878a0b[0x0][_0x5092('0x3a')](')'));var _0x3055b6=_0x878a0b[0x1];recordings[_0x6e1fca['uniqueid']][_0x122659]=_0x3055b6;}}}catch(_0x3fc3da){utils[_0x5092('0x15')](util[_0x5092('0x3')](_0x5092('0x30'),_0x6e1fca['uniqueid']),_0x3fc3da);}};exports[_0x5092('0x3b')]=function(_0x13e1fe){try{if(!_[_0x5092('0x18')](recordings[_0x13e1fe[_0x5092('0x5')]])){utils[_0x5092('0xe')](util[_0x5092('0x3')](_0x5092('0x3c'),_0x13e1fe[_0x5092('0x5')]),_0x13e1fe);utils['info'](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x13e1fe['uniqueid'],_0x13e1fe[_0x5092('0x3d')]));recordings[_0x13e1fe[_0x5092('0x5')]][_0x5092('0x3d')]=_0x13e1fe[_0x5092('0x3d')];}}catch(_0x5413d5){utils[_0x5092('0x15')](util[_0x5092('0x3')]('[%s][recordings][queuecallerjoin]',_0x13e1fe[_0x5092('0x5')]),_0x5413d5);}}; \ No newline at end of file +var _0x4389=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate'];(function(_0x5c5292,_0x2f1d9c){var _0x116489=function(_0x41c53b){while(--_0x41c53b){_0x5c5292['push'](_0x5c5292['shift']());}};_0x116489(++_0x2f1d9c);}(_0x4389,0x113));var _0x9438=function(_0x2e870b,_0xa74d0a){_0x2e870b=_0x2e870b-0x0;var _0x3fabf8=_0x4389[_0x2e870b];return _0x3fabf8;};'use strict';var _=require(_0x9438('0x0'));var util=require(_0x9438('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2776d7){utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x4'),_0x2776d7[_0x9438('0x5')]));if(_0x2776d7['accountcode']){utils[_0x9438('0x6')](_0x2776d7[_0x9438('0x7')])[_0x9438('0x8')](function(_0x173115){if(_0x173115){_0x2776d7['membername']=_0x173115[_0x9438('0x9')];_0x2776d7[_0x9438('0xa')]=_0x173115['id'];}utils[_0x9438('0xb')](_0x9438('0xc'),_0x2776d7);});}else{utils[_0x9438('0xb')](_0x9438('0xc'),_0x2776d7);}}exports[_0x9438('0xd')]=function(_0x261b75){try{utils['debug'](util[_0x9438('0x3')]('[%s][recordings][newchannel]',_0x261b75[_0x9438('0x5')]),_0x261b75);if(_0x261b75[_0x9438('0x5')]==_0x261b75[_0x9438('0xe')]){utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0xf'),_0x261b75[_0x9438('0x5')],_0x261b75[_0x9438('0x10')],_0x261b75[_0x9438('0x11')]));recordings[_0x261b75[_0x9438('0x5')]]={'uniqueid':_0x261b75['uniqueid'],'accountcode':_0x261b75[_0x9438('0x7')],'exten':_0x261b75[_0x9438('0x11')],'context':_0x261b75['context'],'channel':_0x261b75[_0x9438('0x12')],'monitors':[]};}}catch(_0x9fd098){utils[_0x9438('0x13')](util[_0x9438('0x3')]('[%s][recordings][newchannel]',_0x261b75[_0x9438('0x5')]),_0x9fd098);}};exports[_0x9438('0x14')]=function(_0x4d1509){try{utils[_0x9438('0x15')](util['format'](_0x9438('0x16'),_0x4d1509[_0x9438('0x5')]),_0x4d1509);if(!_[_0x9438('0x17')](recordings[_0x4d1509[_0x9438('0x5')]])&&_0x4d1509[_0x9438('0x18')]==0x6){utils[_0x9438('0x2')](util[_0x9438('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4d1509[_0x9438('0x5')],_0x4d1509['context'],_0x4d1509['channel']));}else if(!_['isNil'](recordings[_0x4d1509[_0x9438('0xe')]])&&_0x4d1509[_0x9438('0x18')]==0x6&&_0x4d1509[_0x9438('0x10')]!='transfer'){utils['info'](util['format'](_0x9438('0x19'),_0x4d1509[_0x9438('0x5')],_0x4d1509[_0x9438('0xe')],_0x4d1509['context'],_0x4d1509[_0x9438('0x12')]));recordings[_0x4d1509[_0x9438('0xe')]]['accountcode']=_0x4d1509['accountcode'];}}catch(_0x37e300){utils['error'](util['format'](_0x9438('0x16'),_0x4d1509[_0x9438('0x5')]),_0x37e300);}};exports[_0x9438('0x1a')]=function(_0x22ca15){try{if(!_[_0x9438('0x17')](_0x22ca15[_0x9438('0x1b')])&&!_[_0x9438('0x17')](_0x22ca15[_0x9438('0x1b')][_0x9438('0x1c')])){utils[_0x9438('0x15')](util[_0x9438('0x3')](_0x9438('0x1d'),_0x22ca15['uniqueid']),_0x22ca15);utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x1e'),_0x22ca15[_0x9438('0x5')],_0x22ca15[_0x9438('0x1b')],_0x22ca15['value']));if(_[_0x9438('0x1f')](_0x22ca15['value'],'.wav49')){_0x22ca15[_0x9438('0x20')]=_0x22ca15['value'][_0x9438('0x21')]('.wav49','.WAV');}if(recordings[_0x22ca15[_0x9438('0xe')]]){var _0x1153a7=_[_0x9438('0x22')](recordings[_0x22ca15[_0x9438('0xe')]][_0x9438('0x23')],{'value':_0x22ca15[_0x9438('0x20')]});if(_[_0x9438('0x17')](_0x1153a7)){recordings[_0x22ca15[_0x9438('0xe')]][_0x9438('0x23')][_0x9438('0x24')]({'value':_0x22ca15['value']});}}}}catch(_0x34daed){utils[_0x9438('0x13')](util['format']('[%s][recordings][varset]',_0x22ca15[_0x9438('0x5')]),_0x34daed);}};exports['hangup']=function(_0x53eb63){try{if(!_[_0x9438('0x17')](recordings[_0x53eb63['uniqueid']])){utils['debug'](util[_0x9438('0x3')](_0x9438('0x25'),_0x53eb63[_0x9438('0x5')]),_0x53eb63);utils[_0x9438('0x2')](util['format'](_0x9438('0x26'),_0x53eb63['uniqueid'],_0x53eb63[_0x9438('0x27')],_0x53eb63['calleridname'],_0x53eb63[_0x9438('0x28')]));recordings[_0x53eb63['uniqueid']][_0x9438('0x27')]=_0x53eb63[_0x9438('0x27')];recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x29')]=_0x53eb63[_0x9438('0x29')];recordings[_0x53eb63['uniqueid']]['connectedlinenum']=_0x53eb63[_0x9438('0x2a')];recordings[_0x53eb63[_0x9438('0x5')]]['connectedlinename']=_0x53eb63[_0x9438('0x2b')];if(recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x2c')]==_0x9438('0x2d')&&recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x7')]){recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x2a')]=recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x7')];recordings[_0x53eb63['uniqueid']][_0x9438('0x2b')]='';}recordings[_0x53eb63['uniqueid']][_0x9438('0x23')][_0x9438('0x2e')](function(_0x2d483d){var _0x278738=_[_0x9438('0x2f')](recordings[_0x53eb63[_0x9438('0x5')]]);_0x278738['value']=_0x2d483d[_0x9438('0x20')];writeDB(_0x278738);});delete recordings[_0x53eb63[_0x9438('0x5')]];}}catch(_0x52492b){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x25'),_0x53eb63[_0x9438('0x5')]),_0x52492b);}};exports[_0x9438('0x30')]=function(_0xef9173){try{if(!_[_0x9438('0x17')](recordings[_0xef9173[_0x9438('0x5')]])){utils[_0x9438('0x15')](util[_0x9438('0x3')]('[%s][recordings][newexten]',_0xef9173[_0x9438('0x5')]),_0xef9173);utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x31'),_0xef9173[_0x9438('0x5')],_0xef9173[_0x9438('0x32')],_0xef9173['appdata']));if(_0xef9173[_0x9438('0x32')][_0x9438('0x33')]()==_0x9438('0x34')&&_[_0x9438('0x35')](_0xef9173[_0x9438('0x36')]['toLowerCase'](),'cdr')){var _0x5e30e0=_0xef9173[_0x9438('0x36')]['split']('=');var _0x3a3065=_0x5e30e0[0x0]['substring'](_0x5e30e0[0x0][_0x9438('0x37')]('(')+0x1,_0x5e30e0[0x0][_0x9438('0x37')](')'));var _0x148946=_0x5e30e0[0x1];recordings[_0xef9173[_0x9438('0x5')]][_0x3a3065]=_0x148946;}}}catch(_0x5c3f3f){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x38'),_0xef9173[_0x9438('0x5')]),_0x5c3f3f);}};exports[_0x9438('0x39')]=function(_0x4333cf){try{if(!_[_0x9438('0x17')](recordings[_0x4333cf[_0x9438('0x5')]])){utils[_0x9438('0x15')](util[_0x9438('0x3')](_0x9438('0x3a'),_0x4333cf['uniqueid']),_0x4333cf);utils[_0x9438('0x2')](util[_0x9438('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4333cf[_0x9438('0x5')],_0x4333cf[_0x9438('0x3b')]));recordings[_0x4333cf[_0x9438('0x5')]][_0x9438('0x3b')]=_0x4333cf[_0x9438('0x3b')];}}catch(_0xd3aac5){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x3a'),_0x4333cf['uniqueid']),_0xd3aac5);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e324814..fb3fd25 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 _0x27d9=['error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfereruniqueid','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds'];(function(_0x3d403c,_0x3f7f3c){var _0x54c570=function(_0x230316){while(--_0x230316){_0x3d403c['push'](_0x3d403c['shift']());}};_0x54c570(++_0x3f7f3c);}(_0x27d9,0x129));var _0x927d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27d9[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x927d('0x0'));function writeDB(_0x388a66){utils['info'](util[_0x927d('0x1')](_0x927d('0x2'),_0x388a66[_0x927d('0x3')]===_0x927d('0x4')?_0x388a66['origtransfereruniqueid']:_0x388a66[_0x927d('0x5')],_0x388a66['type']));utils['request'](_0x927d('0x6'),_0x388a66);}exports['blinds']={};exports[_0x927d('0x7')]=function(_0x4b8123){try{utils['debug'](util[_0x927d('0x1')](_0x927d('0x8'),_0x4b8123['uniqueid']),_0x4b8123);utils[_0x927d('0x9')](util[_0x927d('0x1')](_0x927d('0xa'),_0x4b8123['uniqueid'],_0x4b8123['transferercalleridnum'],_0x4b8123[_0x927d('0xb')],_0x4b8123[_0x927d('0xc')],_0x4b8123[_0x927d('0xd')]));_0x4b8123[_0x927d('0x3')]='blind';exports[_0x927d('0xe')][_0x4b8123['transfereruniqueid']]=_0x4b8123;writeDB(_0x4b8123);}catch(_0x370a5b){utils[_0x927d('0xf')](util[_0x927d('0x1')](_0x927d('0x8'),_0x4b8123[_0x927d('0x5')]),_0x370a5b);}};exports[_0x927d('0x10')]=function(_0x5e7482){try{utils[_0x927d('0x11')](util[_0x927d('0x1')](_0x927d('0x12'),_0x5e7482['origtransfereruniqueid']),_0x5e7482);utils[_0x927d('0x9')](util[_0x927d('0x1')](_0x927d('0x13'),_0x5e7482['origtransfereruniqueid'],_0x5e7482[_0x927d('0x14')],_0x5e7482['origtransferercalleridname'],_0x5e7482[_0x927d('0x15')],_0x5e7482['transfertargetcalleridname']));_0x5e7482=_[_0x927d('0x16')](_0x5e7482,{'transfererchannel':_0x5e7482['origtransfererchannel'],'transferercalleridnum':_0x5e7482[_0x927d('0x14')],'transferercalleridname':_0x5e7482[_0x927d('0x17')],'transfererconnectedlinenum':_0x5e7482['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5e7482[_0x927d('0x18')],'transfereraccountcode':_0x5e7482[_0x927d('0x19')],'transferercontext':_0x5e7482[_0x927d('0x1a')],'transfererexten':_0x5e7482['secondtransfererexten'],'transfererlinkedid':_0x5e7482[_0x927d('0x1b')],'context':_0x5e7482['origtransferercontext'],'extension':_0x5e7482[_0x927d('0x1c')],'type':_0x927d('0x4')});if(_[_0x927d('0x1d')](_0x5e7482[_0x927d('0x1e')])){_0x5e7482=_[_0x927d('0x16')](_0x5e7482,{'transfereechannel':_0x5e7482['transfertargetchannel'],'transfereecalleridnum':_0x5e7482[_0x927d('0x15')],'transfereecalleridname':_0x5e7482[_0x927d('0x1f')],'transfereeconnectedlinenum':_0x5e7482[_0x927d('0x20')],'transfereeconnectedlinename':_0x5e7482[_0x927d('0x21')],'transfereeaccountcode':_0x5e7482[_0x927d('0x22')],'transfereecontext':_0x5e7482[_0x927d('0x23')],'transfereeexten':_0x5e7482[_0x927d('0x24')],'transfereelinkedid':_0x5e7482[_0x927d('0x25')]});}writeDB(_0x5e7482);}catch(_0x428398){utils['error'](util[_0x927d('0x1')](_0x927d('0x12'),_0x5e7482[_0x927d('0x26')]),_0x428398);}}; \ No newline at end of file +var _0x5772=['origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','origtransferercalleridnum','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','assign','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5772,0x175));var _0x2577=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x5772[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var utils=require(_0x2577('0x2'));function writeDB(_0x22cfbb){utils[_0x2577('0x3')](util[_0x2577('0x4')](_0x2577('0x5'),_0x22cfbb[_0x2577('0x6')]===_0x2577('0x7')?_0x22cfbb[_0x2577('0x8')]:_0x22cfbb[_0x2577('0x9')],_0x22cfbb['type']));utils['request'](_0x2577('0xa'),_0x22cfbb);}exports[_0x2577('0xb')]={};exports[_0x2577('0xc')]=function(_0x294d9f){try{utils[_0x2577('0xd')](util[_0x2577('0x4')](_0x2577('0xe'),_0x294d9f[_0x2577('0x9')]),_0x294d9f);utils[_0x2577('0x3')](util['format'](_0x2577('0xf'),_0x294d9f[_0x2577('0x9')],_0x294d9f['transferercalleridnum'],_0x294d9f[_0x2577('0x10')],_0x294d9f[_0x2577('0x11')],_0x294d9f[_0x2577('0x12')]));_0x294d9f['type']='blind';exports[_0x2577('0xb')][_0x294d9f[_0x2577('0x13')]]=_0x294d9f;writeDB(_0x294d9f);}catch(_0x288e66){utils[_0x2577('0x14')](util[_0x2577('0x4')]('[%s][transfers][blindtransfer]',_0x294d9f[_0x2577('0x9')]),_0x288e66);}};exports[_0x2577('0x15')]=function(_0x29d91e){try{utils[_0x2577('0xd')](util[_0x2577('0x4')](_0x2577('0x16'),_0x29d91e[_0x2577('0x8')]),_0x29d91e);utils[_0x2577('0x3')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x29d91e[_0x2577('0x8')],_0x29d91e['origtransferercalleridnum'],_0x29d91e[_0x2577('0x17')],_0x29d91e[_0x2577('0x18')],_0x29d91e['transfertargetcalleridname']));_0x29d91e=_['assign'](_0x29d91e,{'transfererchannel':_0x29d91e[_0x2577('0x19')],'transferercalleridnum':_0x29d91e[_0x2577('0x1a')],'transferercalleridname':_0x29d91e[_0x2577('0x17')],'transfererconnectedlinenum':_0x29d91e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x29d91e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x29d91e['origtransfereraccountcode'],'transferercontext':_0x29d91e['secondtransferercontext'],'transfererexten':_0x29d91e[_0x2577('0x1b')],'transfererlinkedid':_0x29d91e[_0x2577('0x1c')],'context':_0x29d91e[_0x2577('0x1d')],'extension':_0x29d91e[_0x2577('0x1e')],'type':_0x2577('0x7')});if(_['isNil'](_0x29d91e[_0x2577('0x1f')])){_0x29d91e=_[_0x2577('0x20')](_0x29d91e,{'transfereechannel':_0x29d91e['transfertargetchannel'],'transfereecalleridnum':_0x29d91e[_0x2577('0x18')],'transfereecalleridname':_0x29d91e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x29d91e[_0x2577('0x21')],'transfereeconnectedlinename':_0x29d91e['transfertargetconnectedlinename'],'transfereeaccountcode':_0x29d91e['transfertargetaccountcode'],'transfereecontext':_0x29d91e[_0x2577('0x22')],'transfereeexten':_0x29d91e[_0x2577('0x23')],'transfereelinkedid':_0x29d91e['transfertargetlinkedid']});}writeDB(_0x29d91e);}catch(_0x1f648c){utils[_0x2577('0x14')](util[_0x2577('0x4')]('[%s][transfers][attendedtransfer]',_0x29d91e['origtransfereruniqueid']),_0x1f648c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index a3a357b..c356858 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 _0x33af=['error','request','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','then','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','format','diffTime','diff','sumTime','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','jayson/promise','util','client','http','../../config/logger','xdr','info','debug','inspect'];(function(_0x42e88f,_0x305338){var _0x2c4001=function(_0x4d55de){while(--_0x4d55de){_0x42e88f['push'](_0x42e88f['shift']());}};_0x2c4001(++_0x305338);}(_0x33af,0xec));var _0xf33a=function(_0x12187e,_0x3ac0b2){_0x12187e=_0x12187e-0x0;var _0x4e5cf9=_0x33af[_0x12187e];return _0x4e5cf9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf33a('0x0'));var moment=require('moment');var util=require(_0xf33a('0x1'));var client=jayson[_0xf33a('0x2')][_0xf33a('0x3')]({'port':0x2329});var logger=require(_0xf33a('0x4'))(_0xf33a('0x5'));exports[_0xf33a('0x6')]=function(_0x4c734e,_0x433e25){logger[_0xf33a('0x6')](_0x4c734e,_0x433e25?util['inspect'](_0x433e25,{'showHidden':![],'depth':null}):'');};exports[_0xf33a('0x7')]=function(_0x384b14,_0x1b2b01){logger[_0xf33a('0x7')](_0x384b14,_0x1b2b01?util[_0xf33a('0x8')](_0x1b2b01,{'showHidden':![],'depth':null}):'');};exports[_0xf33a('0x9')]=function(_0x52517f,_0x29bb24){logger[_0xf33a('0x9')](_0x52517f,_0x29bb24?util[_0xf33a('0x8')](_0x29bb24,{'showHidden':![],'depth':null}):'');};exports[_0xf33a('0xa')]=function(_0x44ee7f,_0x27f30a){return client['request'](_0x44ee7f,{'body':_0x27f30a})['then'](function(_0x31ccd8){logger[_0xf33a('0x7')](_0xf33a('0xb'),_0x44ee7f,_0x31ccd8?util[_0xf33a('0x8')](_0x31ccd8,{'showHidden':![],'depth':null}):'');})[_0xf33a('0xc')](function(_0x5959c9){logger[_0xf33a('0x9')](_0xf33a('0xb'),_0x44ee7f,_0x5959c9?util['inspect'](_0x5959c9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x506924){return client[_0xf33a('0xa')](_0xf33a('0xd'),{'options':{'raw':!![],'attributes':['id',_0xf33a('0xe'),_0xf33a('0xf'),_0xf33a('0x10')],'where':_0x506924,'limit':0x1}})[_0xf33a('0x11')](function(_0x45e311){logger[_0xf33a('0x7')]('[utils][getUser]\x20where:%s',JSON[_0xf33a('0x12')](_0x506924),_0x45e311?util['inspect'](_0x45e311,{'showHidden':![],'depth':null}):'');return _0x45e311[_0xf33a('0x13')][_0xf33a('0x14')]?_0x45e311['result'][0x0]:null;});}exports[_0xf33a('0x15')]=function(_0x25c931){return new BPromise(function(_0x524109,_0x2946ef){if(_0x25c931){return getUser({'internal':_0x25c931})[_0xf33a('0x11')](function(_0x38d69a){logger[_0xf33a('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x25c931,_0x38d69a?_0xf33a('0x16'):_0xf33a('0x17'));return _0x524109(_0x38d69a);})[_0xf33a('0xc')](function(_0x30e383){logger[_0xf33a('0x9')](_0xf33a('0x18'),_0x30e383?util[_0xf33a('0x8')](_0x30e383,{'showHidden':![],'depth':null}):'');return _0x524109(null);});}return _0x524109(null);});};exports[_0xf33a('0x19')]=function(_0x19055e){return new BPromise(function(_0x3cf525,_0x520dc4){if(_0x19055e){return getUser({'interface':_0x19055e})[_0xf33a('0x11')](function(_0x272e60){logger[_0xf33a('0x6')](_0xf33a('0x1a'),_0x19055e,_0x272e60?_0xf33a('0x16'):'notfound');return _0x3cf525(_0x272e60);})[_0xf33a('0xc')](function(_0x5882ba){logger[_0xf33a('0x9')](_0xf33a('0x1b'),_0x5882ba?util[_0xf33a('0x8')](_0x5882ba,{'showHidden':![],'depth':null}):'');return _0x3cf525(null);});}return _0x3cf525(null);});};exports[_0xf33a('0x1c')]=function(_0x429b83){return new BPromise(function(_0x4b9801,_0x57cb1d){if(_0x429b83){return getUser({'name':_0x429b83})[_0xf33a('0x11')](function(_0x5edf1a){logger['info'](_0xf33a('0x1d'),_0x429b83,_0x5edf1a?'found':'notfound');return _0x4b9801(_0x5edf1a);})[_0xf33a('0xc')](function(_0x4f60a4){logger[_0xf33a('0x9')]('[utils][getUserByName]',_0x4f60a4?util[_0xf33a('0x8')](_0x4f60a4,{'showHidden':![],'depth':null}):'');return _0x4b9801(null);});}return _0x4b9801(null);});};exports[_0xf33a('0x1e')]=function(_0x469741){return new BPromise(function(_0x729fca,_0x4552c9){if(_0x469741){return client[_0xf33a('0xa')](_0xf33a('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xf33a('0xf'),_0xf33a('0x20'),_0xf33a('0x21'),_0xf33a('0x22')],'where':{'name':_0x469741},'limit':0x1}})[_0xf33a('0x11')](function(_0x22c9f2){logger[_0xf33a('0x7')](_0xf33a('0x23'),_0x469741,_0x22c9f2?util['inspect'](_0x22c9f2,{'showHidden':![],'depth':null}):'');logger[_0xf33a('0x6')](_0xf33a('0x24'),_0x469741,_0x22c9f2?_0xf33a('0x16'):_0xf33a('0x17'));return _0x729fca(_0x22c9f2['result'][_0xf33a('0x14')]?_0x22c9f2[_0xf33a('0x13')][0x0]:null);})[_0xf33a('0xc')](function(_0x31cb7c){logger[_0xf33a('0x9')](_0xf33a('0x25'),_0x31cb7c?util['inspect'](_0x31cb7c,{'showHidden':![],'depth':null}):'');return _0x729fca(null);});}return _0x729fca(null);});};exports[_0xf33a('0x26')]=function(_0x6f5b94,_0x3956aa){return moment(_0x6f5b94)[_0xf33a('0x27')](_0x3956aa,_0xf33a('0x28'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf33a('0x29')]=function(_0x4b25dd,_0x5ee01e){return moment(_0x4b25dd)['subtract'](_0x5ee01e,_0xf33a('0x28'))[_0xf33a('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf33a('0x2b')]=function(_0x55f457,_0x2103b5){return moment(_0x55f457)[_0xf33a('0x2c')](moment(_0x2103b5),_0xf33a('0x28'));};exports[_0xf33a('0x2d')]=function(_0x156731,_0x23c92b){return parseInt(_0x156731,0xa)+parseInt(_0x23c92b,0xa);};exports['now']=function(){return moment()[_0xf33a('0x2a')](_0xf33a('0x2e'));};exports['isAfter']=function(_0x380842,_0x3793b4){if(_0x3793b4){return moment(_0x380842)[_0xf33a('0x2f')](_0x3793b4);}return!![];};exports['isBefore']=function(_0x7a06e1,_0x1650c){if(_0x1650c){return moment(_0x7a06e1)[_0xf33a('0x30')](_0x1650c);}else if(_0x7a06e1){return!![];}return![];}; \ No newline at end of file +var _0x5f01=['moment','util','http','../../config/logger','info','inspect','debug','error','request','catch','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','now','isAfter','isBefore','jayson/promise'];(function(_0x29854d,_0x197a1a){var _0x41607d=function(_0xc45220){while(--_0xc45220){_0x29854d['push'](_0x29854d['shift']());}};_0x41607d(++_0x197a1a);}(_0x5f01,0xcc));var _0x15f0=function(_0xc88df4,_0x7b7191){_0xc88df4=_0xc88df4-0x0;var _0x5be5ed=_0x5f01[_0xc88df4];return _0x5be5ed;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x15f0('0x0'));var moment=require(_0x15f0('0x1'));var util=require(_0x15f0('0x2'));var client=jayson['client'][_0x15f0('0x3')]({'port':0x2329});var logger=require(_0x15f0('0x4'))('xdr');exports[_0x15f0('0x5')]=function(_0x59941d,_0x460894){logger[_0x15f0('0x5')](_0x59941d,_0x460894?util[_0x15f0('0x6')](_0x460894,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x7')]=function(_0x39c00b,_0x182b54){logger['debug'](_0x39c00b,_0x182b54?util[_0x15f0('0x6')](_0x182b54,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x8')]=function(_0x9d9779,_0x3445fc){logger[_0x15f0('0x8')](_0x9d9779,_0x3445fc?util[_0x15f0('0x6')](_0x3445fc,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x9')]=function(_0x514902,_0x39c3ba){return client[_0x15f0('0x9')](_0x514902,{'body':_0x39c3ba})['then'](function(_0x1ebdfd){logger[_0x15f0('0x7')]('[utils][request]\x20name:%s',_0x514902,_0x1ebdfd?util[_0x15f0('0x6')](_0x1ebdfd,{'showHidden':![],'depth':null}):'');})[_0x15f0('0xa')](function(_0x1a3ba8){logger['error']('[utils][request]\x20name:%s',_0x514902,_0x1a3ba8?util[_0x15f0('0x6')](_0x1a3ba8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x240f46){return client[_0x15f0('0x9')](_0x15f0('0xb'),{'options':{'raw':!![],'attributes':['id',_0x15f0('0xc'),_0x15f0('0xd'),_0x15f0('0xe')],'where':_0x240f46,'limit':0x1}})[_0x15f0('0xf')](function(_0x43c2be){logger[_0x15f0('0x7')](_0x15f0('0x10'),JSON[_0x15f0('0x11')](_0x240f46),_0x43c2be?util[_0x15f0('0x6')](_0x43c2be,{'showHidden':![],'depth':null}):'');return _0x43c2be[_0x15f0('0x12')][_0x15f0('0x13')]?_0x43c2be['result'][0x0]:null;});}exports[_0x15f0('0x14')]=function(_0x1d38f2){return new BPromise(function(_0x1b21f6,_0x325c46){if(_0x1d38f2){return getUser({'internal':_0x1d38f2})[_0x15f0('0xf')](function(_0x51059a){logger['info'](_0x15f0('0x15'),_0x1d38f2,_0x51059a?_0x15f0('0x16'):_0x15f0('0x17'));return _0x1b21f6(_0x51059a);})[_0x15f0('0xa')](function(_0x180d32){logger[_0x15f0('0x8')](_0x15f0('0x18'),_0x180d32?util[_0x15f0('0x6')](_0x180d32,{'showHidden':![],'depth':null}):'');return _0x1b21f6(null);});}return _0x1b21f6(null);});};exports['getUserByInterface']=function(_0x58d003){return new BPromise(function(_0x13b899,_0x1e0928){if(_0x58d003){return getUser({'interface':_0x58d003})[_0x15f0('0xf')](function(_0x1bf71c){logger[_0x15f0('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x58d003,_0x1bf71c?_0x15f0('0x16'):_0x15f0('0x17'));return _0x13b899(_0x1bf71c);})['catch'](function(_0x118732){logger['error'](_0x15f0('0x19'),_0x118732?util[_0x15f0('0x6')](_0x118732,{'showHidden':![],'depth':null}):'');return _0x13b899(null);});}return _0x13b899(null);});};exports[_0x15f0('0x1a')]=function(_0x55d5b4){return new BPromise(function(_0x59232c,_0x27f3fe){if(_0x55d5b4){return getUser({'name':_0x55d5b4})[_0x15f0('0xf')](function(_0x2dadb9){logger[_0x15f0('0x5')](_0x15f0('0x1b'),_0x55d5b4,_0x2dadb9?_0x15f0('0x16'):_0x15f0('0x17'));return _0x59232c(_0x2dadb9);})[_0x15f0('0xa')](function(_0x1f4943){logger[_0x15f0('0x8')](_0x15f0('0x1c'),_0x1f4943?util[_0x15f0('0x6')](_0x1f4943,{'showHidden':![],'depth':null}):'');return _0x59232c(null);});}return _0x59232c(null);});};exports['getVoiceQueueByName']=function(_0x85b433){return new BPromise(function(_0x2bfc93,_0xfa6079){if(_0x85b433){return client[_0x15f0('0x9')](_0x15f0('0x1d'),{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x15f0('0x1e')],'where':{'name':_0x85b433},'limit':0x1}})['then'](function(_0x240323){logger[_0x15f0('0x7')](_0x15f0('0x1f'),_0x85b433,_0x240323?util[_0x15f0('0x6')](_0x240323,{'showHidden':![],'depth':null}):'');logger[_0x15f0('0x5')](_0x15f0('0x20'),_0x85b433,_0x240323?'found':'notfound');return _0x2bfc93(_0x240323['result']['length']?_0x240323[_0x15f0('0x12')][0x0]:null);})['catch'](function(_0x4d23d1){logger[_0x15f0('0x8')]('[utils][getVoiceQueueByName]',_0x4d23d1?util[_0x15f0('0x6')](_0x4d23d1,{'showHidden':![],'depth':null}):'');return _0x2bfc93(null);});}return _0x2bfc93(null);});};exports['addTime']=function(_0x19ec0c,_0x3b9633){return moment(_0x19ec0c)[_0x15f0('0x21')](_0x3b9633,_0x15f0('0x22'))[_0x15f0('0x23')](_0x15f0('0x24'));};exports[_0x15f0('0x25')]=function(_0x4b9c78,_0x2ac51d){return moment(_0x4b9c78)['subtract'](_0x2ac51d,_0x15f0('0x22'))[_0x15f0('0x23')](_0x15f0('0x24'));};exports['diffTime']=function(_0x4f64d2,_0x4fb664){return moment(_0x4f64d2)['diff'](moment(_0x4fb664),_0x15f0('0x22'));};exports['sumTime']=function(_0x539773,_0x19ce1c){return parseInt(_0x539773,0xa)+parseInt(_0x19ce1c,0xa);};exports[_0x15f0('0x26')]=function(){return moment()['format'](_0x15f0('0x24'));};exports['isAfter']=function(_0x419808,_0x130c9c){if(_0x130c9c){return moment(_0x419808)[_0x15f0('0x27')](_0x130c9c);}return!![];};exports[_0x15f0('0x28')]=function(_0x670094,_0x517281){if(_0x517281){return moment(_0x670094)['isBefore'](_0x517281);}else if(_0x670094){return!![];}return![];}; \ No newline at end of file